@stacksjs/stx 0.2.264 → 0.2.266

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 (163) hide show
  1. package/dist/caching.js +2 -0
  2. package/dist/{chunk-25de1sj7.js → chunk-0athjw48.js} +2 -2
  3. package/dist/{chunk-38ykv2gd.js → chunk-135mme4g.js} +1 -1
  4. package/dist/{chunk-gpt6ggxj.js → chunk-1hhxj2r5.js} +1 -1
  5. package/dist/{chunk-f0rjjfk0.js → chunk-1j77d7fw.js} +1 -1
  6. package/dist/{chunk-sr49fd8p.js → chunk-1m4sa11y.js} +1 -1
  7. package/dist/{chunk-nteg247p.js → chunk-278yw67q.js} +1 -1
  8. package/dist/{chunk-0mk858ne.js → chunk-2ed60g20.js} +2 -2
  9. package/dist/{chunk-qpsj28s2.js → chunk-2qsa4h1t.js} +2 -2
  10. package/dist/{chunk-3rnc94mp.js → chunk-2x9s5z8x.js} +1 -1
  11. package/dist/{chunk-va2wwrpf.js → chunk-455pgdzh.js} +1 -1
  12. package/dist/{chunk-k6st4606.js → chunk-4ay1ymgp.js} +1 -1
  13. package/dist/{chunk-x7pp10qb.js → chunk-4cr21p7m.js} +1 -1
  14. package/dist/chunk-4mvpapjz.js +2 -0
  15. package/dist/{chunk-7exqxjx5.js → chunk-4mw2kfqd.js} +1 -1
  16. package/dist/chunk-4wnnet1k.js +12 -0
  17. package/dist/{chunk-jt8as8j8.js → chunk-52wr95ps.js} +1 -1
  18. package/dist/chunk-5htqgzbb.js +2 -0
  19. package/dist/chunk-5jcsg2mc.js +2 -0
  20. package/dist/{chunk-z0aygs4h.js → chunk-5k0j7bjy.js} +1 -1
  21. package/dist/{chunk-aw651z2y.js → chunk-5wkwhjjn.js} +54 -20
  22. package/dist/{chunk-xr1758xj.js → chunk-6746wmsf.js} +1 -1
  23. package/dist/{chunk-0bm5enna.js → chunk-6g4mnrr0.js} +1 -1
  24. package/dist/{chunk-new80es4.js → chunk-6g7m08rv.js} +1 -1
  25. package/dist/{chunk-4zkv1vqh.js → chunk-6yphtg3q.js} +1 -1
  26. package/dist/{chunk-p1rswnys.js → chunk-73yr54sg.js} +1 -1
  27. package/dist/{chunk-2pavh1yg.js → chunk-78bm61kd.js} +1 -1
  28. package/dist/chunk-7cts329z.js +2 -0
  29. package/dist/chunk-7kkc13rc.js +2 -0
  30. package/dist/chunk-8evws5cc.js +11 -0
  31. package/dist/{chunk-zr4emtxf.js → chunk-8jvmjzmr.js} +1 -1
  32. package/dist/{chunk-zr6m5k3t.js → chunk-987kjtg8.js} +1 -1
  33. package/dist/{chunk-3fa6t4fw.js → chunk-9gzmcxzg.js} +1 -1
  34. package/dist/{chunk-b3f5dwzz.js → chunk-9rdg7x9h.js} +1 -1
  35. package/dist/chunk-9rkcrzj4.js +2 -0
  36. package/dist/{chunk-8pvymy12.js → chunk-9y175wxc.js} +1 -1
  37. package/dist/{chunk-7a7jy8yr.js → chunk-a78tzerx.js} +1 -1
  38. package/dist/{chunk-5qngxbmv.js → chunk-a7x7dmtf.js} +1 -1
  39. package/dist/{chunk-3txrk37v.js → chunk-a95rrp0j.js} +1 -1
  40. package/dist/{chunk-s44edj8s.js → chunk-aagn8j9e.js} +10 -10
  41. package/dist/{chunk-dnhckx52.js → chunk-bby4emay.js} +1 -1
  42. package/dist/{chunk-j59pkkzn.js → chunk-behbakfv.js} +1 -1
  43. package/dist/chunk-c1r9q5pk.js +15 -0
  44. package/dist/chunk-cd4v7xyr.js +2 -0
  45. package/dist/chunk-d3v3p15c.js +2 -0
  46. package/dist/{chunk-jq375v8t.js → chunk-dhe8sp1a.js} +1 -1
  47. package/dist/chunk-dpgp6rzq.js +2 -0
  48. package/dist/{chunk-g8tce9rr.js → chunk-f1jd5qjb.js} +1 -1
  49. package/dist/chunk-f3k5xbhk.js +2 -0
  50. package/dist/{chunk-4qq5wj04.js → chunk-f3m0q482.js} +1 -1
  51. package/dist/{chunk-wb7dfcnc.js → chunk-f8g0zbm3.js} +1 -1
  52. package/dist/{chunk-0y6f4037.js → chunk-f8wjdg40.js} +1 -1
  53. package/dist/chunk-fcv00xs9.js +2 -0
  54. package/dist/{chunk-sne7938g.js → chunk-fn9yw31x.js} +1 -1
  55. package/dist/chunk-g4z7gah7.js +2 -0
  56. package/dist/{chunk-ph5f8eev.js → chunk-gej3rmfy.js} +1 -1
  57. package/dist/{chunk-a90d3xne.js → chunk-gn48cpgb.js} +1 -1
  58. package/dist/{chunk-1qnyvw5w.js → chunk-hhyf0s7s.js} +1 -1
  59. package/dist/{chunk-x84g0m0p.js → chunk-j24k071e.js} +1 -1
  60. package/dist/chunk-jb7h4qgh.js +22 -0
  61. package/dist/{chunk-a8mnhryz.js → chunk-jnbhyzkv.js} +2 -2
  62. package/dist/{chunk-nqy2v6vh.js → chunk-k4m48h62.js} +1 -1
  63. package/dist/chunk-k5c19t7e.js +2 -0
  64. package/dist/{chunk-6vqb54c8.js → chunk-k7n88ess.js} +1 -1
  65. package/dist/{chunk-wj2trgsn.js → chunk-krgth3gf.js} +1 -1
  66. package/dist/chunk-mb0kqnwf.js +2 -0
  67. package/dist/{chunk-r7dd7c7y.js → chunk-mbvkvac6.js} +332 -343
  68. package/dist/{chunk-4w3gg4g7.js → chunk-mcn9mwzv.js} +1 -1
  69. package/dist/{chunk-bjj27mf3.js → chunk-mv0syvrg.js} +1 -1
  70. package/dist/{chunk-rp0m678g.js → chunk-n2r83qwt.js} +1 -1
  71. package/dist/{chunk-j6e4vwv5.js → chunk-n3jgypjf.js} +1 -1
  72. package/dist/{chunk-ksm4b1cx.js → chunk-nfykda12.js} +1 -1
  73. package/dist/chunk-ng1wyd2v.js +2 -0
  74. package/dist/{chunk-xhq2a50x.js → chunk-nswz1rkm.js} +1 -1
  75. package/dist/{chunk-1n16xphq.js → chunk-nwq01xh0.js} +1 -1
  76. package/dist/chunk-p9ase2nx.js +2 -0
  77. package/dist/{chunk-s2wm8qwg.js → chunk-q4n8a7sf.js} +1 -1
  78. package/dist/chunk-q5et8k2d.js +2 -0
  79. package/dist/chunk-qf5grrg1.js +2 -0
  80. package/dist/{chunk-k1e72asa.js → chunk-qh6223a0.js} +1 -1
  81. package/dist/{chunk-gg2en16q.js → chunk-qkbrbys7.js} +1 -1
  82. package/dist/{chunk-yjk7vyd8.js → chunk-r4nkpr60.js} +1 -1
  83. package/dist/{chunk-c17txgm7.js → chunk-r9z71gj0.js} +1 -1
  84. package/dist/{chunk-c59rkxwf.js → chunk-rc4zrsw3.js} +1 -1
  85. package/dist/chunk-rgh4njyv.js +2 -0
  86. package/dist/{chunk-10tcqry1.js → chunk-rwb4nztb.js} +1 -1
  87. package/dist/chunk-scdxk8nn.js +2 -0
  88. package/dist/{chunk-5h5ydexj.js → chunk-sde45gh3.js} +1 -1
  89. package/dist/{chunk-chsfdfqm.js → chunk-shtemwbq.js} +1 -1
  90. package/dist/chunk-tc01rmwh.js +2 -0
  91. package/dist/{chunk-wx73fmky.js → chunk-tv6ds16a.js} +1 -1
  92. package/dist/chunk-tybdapd3.js +2 -0
  93. package/dist/chunk-v9crchhq.js +2 -0
  94. package/dist/{chunk-95mj2e8x.js → chunk-vrskjx64.js} +1 -1
  95. package/dist/{chunk-4svmpj7y.js → chunk-w7gpyx2k.js} +1 -1
  96. package/dist/{chunk-gyga6sjp.js → chunk-wacr03x4.js} +1 -1
  97. package/dist/chunk-x2mke7a1.js +2 -0
  98. package/dist/chunk-xkb16kmv.js +2 -0
  99. package/dist/chunk-xpsxwbw0.js +2 -0
  100. package/dist/{chunk-yb3nrbqz.js → chunk-yhtq662h.js} +1 -1
  101. package/dist/chunk-ykxs16y7.js +2 -0
  102. package/dist/chunk-yxp7wv61.js +3 -0
  103. package/dist/{chunk-x0t0ndxd.js → chunk-z66a9nnd.js} +1 -1
  104. package/dist/cli.js +14 -14
  105. package/dist/client-script-bundler.d.ts +14 -0
  106. package/dist/client-script-bundler.js +37 -21
  107. package/dist/client-script.d.ts +1 -0
  108. package/dist/client-script.js +4 -2
  109. package/dist/color-mode-boot.js +6 -3
  110. package/dist/component-client-factories.d.ts +29 -0
  111. package/dist/component-client-factories.js +24 -0
  112. package/dist/craft-entry.js +1 -1
  113. package/dist/craft.js +1 -1
  114. package/dist/database.js +1 -1
  115. package/dist/dev-server/crosswind.d.ts +0 -3
  116. package/dist/dev-server/crosswind.js +13 -0
  117. package/dist/framework-composables.js +12 -2
  118. package/dist/performance-utils.d.ts +22 -1
  119. package/dist/performance-utils.js +30 -5
  120. package/dist/pwa.js +2 -2
  121. package/dist/render-memo.d.ts +40 -0
  122. package/dist/render-memo.js +33 -0
  123. package/dist/script-validation.js +25 -11
  124. package/dist/ssg.js +3 -3
  125. package/dist/store-loader.js +10 -1
  126. package/dist/style-scoping.js +18 -7
  127. package/dist/utils.js +108 -58
  128. package/dist/variable-extractor.js +14 -8
  129. package/dist/visual-testing.js +1 -1
  130. package/package.json +5 -5
  131. package/dist/chunk-0ha9e1wt.js +0 -5
  132. package/dist/chunk-0x022m9m.js +0 -2
  133. package/dist/chunk-14cps421.js +0 -2
  134. package/dist/chunk-1r8c2wws.js +0 -2
  135. package/dist/chunk-2p4v6ed7.js +0 -2
  136. package/dist/chunk-2qbde7w2.js +0 -2
  137. package/dist/chunk-3wwnx5d4.js +0 -2
  138. package/dist/chunk-6gc8phhe.js +0 -2
  139. package/dist/chunk-7qgnd7z8.js +0 -2
  140. package/dist/chunk-85wgtm01.js +0 -2
  141. package/dist/chunk-8raem8ng.js +0 -2
  142. package/dist/chunk-a5sn113x.js +0 -12
  143. package/dist/chunk-b3zes539.js +0 -11
  144. package/dist/chunk-c2mvr9z1.js +0 -2
  145. package/dist/chunk-fenb3cqw.js +0 -2
  146. package/dist/chunk-g4t9zc0a.js +0 -2
  147. package/dist/chunk-gayjne01.js +0 -2
  148. package/dist/chunk-gd9gfw08.js +0 -2
  149. package/dist/chunk-gyf9fky4.js +0 -2
  150. package/dist/chunk-h44qqffw.js +0 -2
  151. package/dist/chunk-k6wnmjhf.js +0 -3
  152. package/dist/chunk-m116b3d9.js +0 -2
  153. package/dist/chunk-m8hggrdc.js +0 -2
  154. package/dist/chunk-mjbsb088.js +0 -2
  155. package/dist/chunk-p8ppbq1a.js +0 -2
  156. package/dist/chunk-ptcpaeem.js +0 -11
  157. package/dist/chunk-rs5w6cm5.js +0 -2
  158. package/dist/chunk-s5pd0ec9.js +0 -2
  159. package/dist/chunk-tn2kwwy4.js +0 -13
  160. package/dist/chunk-venjrj7g.js +0 -2
  161. package/dist/chunk-xezfdh27.js +0 -2
  162. package/dist/chunk-xmrwskw2.js +0 -2
  163. package/dist/chunk-zcz486dz.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ns as r8,xs as R6,ys as D6}from"./chunk-25de1sj7.js";import{Es as i5}from"./chunk-38ykv2gd.js";import{Ms as d0}from"./chunk-g8tce9rr.js";import{at as t8}from"./chunk-ptcpaeem.js";import{bt as F8}from"./chunk-a8mnhryz.js";import{it as N6,kt as A6,lt as M6,nt as L5}from"./chunk-dnhckx52.js";import{ot as e8,st as $$,ut as q2}from"./chunk-jt8as8j8.js";import{Ft as $2}from"./chunk-x84g0m0p.js";import{Gt as G7,Ht as w2,It as _2,Jt as s1,Nt as R2,Ot as h4,Pt as G8,Rt as N9,Ut as x8}from"./chunk-5h5ydexj.js";import{Du as a8,Fu as jG,Gu as n$,Iu as B5,cu as e3,fu as n9,mu as p3}from"./chunk-aw651z2y.js";import{Nu as T6}from"./chunk-wj2trgsn.js";import{Su as f}from"./chunk-0y6f4037.js";import C1 from"path";import S5 from"fs";var f4=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"]),x4={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"},T2=new Set(["ctrl","alt","shift","meta"]),u4={left:0,middle:1,right:2};function g4($){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(T2.has(J))Z.systemKeys.push(J);else if(J in u4)Z.mouse=J;else if(J in x4||/^[a-z]$/.test(J))Z.keys.push(x4[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 d4($){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,U=Y.index,W=U+Q.length,z=`__stx_evt_${X++}`,K=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=H.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!f4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:g4(V.slice(1)),elementId:z})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=j.exec(q))!==null){let[,_,F]=B,V=_.split("."),O=V[0];if(!f4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:F,modifiers:g4(V.slice(1)),elementId:z})}if(K.length>0)Z.push({originalTag:Q,elementId:z,events:K,startIndex:U,endIndex:W})}return Z}function I2($){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=u4[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 k2($,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 C$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function E2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=I2($),Y=k2(C$($.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{ls as G2,vs as I6,ws as k6}from"./chunk-0athjw48.js";import{Cs as o5}from"./chunk-135mme4g.js";import{Ks as c0}from"./chunk-f1jd5qjb.js";import{Ls as c1,Ms as d1,Ns as U2,Os as J5,Qs as E1,Rs as T2,Ss as E2,gt as W2}from"./chunk-jb7h4qgh.js";import{ht as T8}from"./chunk-jnbhyzkv.js";import{ot as T6,qt as E6,rt as b6,tt as V5}from"./chunk-bby4emay.js";import{At as L2,ut as z2,yt as J$}from"./chunk-52wr95ps.js";import{Lt as K2}from"./chunk-j24k071e.js";import{Mt as j7,Nt as P2,Ot as k2,Pt as l1,Tt as v2,Ut as i4,Vt as V8,Xt as T9,_t as n8}from"./chunk-sde45gh3.js";import{Ju as q2,Lu as TG,Mu as t$,Ou as z5,iu as Y4,lu as J8,su as r3}from"./chunk-5wkwhjjn.js";import{Tu as y6}from"./chunk-krgth3gf.js";import{Yu as v}from"./chunk-f8wjdg40.js";import y1 from"path";import E5 from"fs";var l4=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"]),c4={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"},d2=new Set(["ctrl","alt","shift","meta"]),n4={left:0,middle:1,right:2};function p4($){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(d2.has(J))Z.systemKeys.push(J);else if(J in n4)Z.mouse=J;else if(J in c4||/^[a-z]$/.test(J))Z.keys.push(c4[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 s4($){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,U=Y.index,W=U+Q.length,z=`__stx_evt_${X++}`,K=[],H=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,B;while((B=H.exec(q))!==null){let[,_,L]=B,V=_.split("."),O=V[0];if(!l4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:L,modifiers:p4(V.slice(1)),elementId:z})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((B=j.exec(q))!==null){let[,_,L]=B,V=_.split("."),O=V[0];if(!l4.has(O))continue;K.push({attribute:`@${_}`,event:O,handler:L,modifiers:p4(V.slice(1)),elementId:z})}if(K.length>0)Z.push({originalTag:Q,elementId:z,events:K,startIndex:U,endIndex:W})}return Z}function m2($){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=n4[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 l2($,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 g$($){let Z=$.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(Z))return $;return`if (typeof ${Z} === 'function' && !${Z}._isSignal) ${Z}($event);`}function c2($){let{modifiers:Z}=$,X=$.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),J=m2($),Y=l2(g$($.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;
@@ -53,7 +53,7 @@ else {
53
53
  __stx_runHandler('${q}', $event, $el);
54
54
  }
55
55
  }${G});
56
- })();`}function P$($){if($.length===0)return"";return`
56
+ })();`}function h$($){if($.length===0)return"";return`
57
57
  <script data-stx-events>
58
58
  (function() {
59
59
  'use strict';
@@ -108,13 +108,13 @@ else {
108
108
  }
109
109
 
110
110
  // Event listeners
111
- ${$.map(E2).join(`
111
+ ${$.map(c2).join(`
112
112
  `)}
113
113
  })();
114
- </script>`}function b2($){let Z=d4($);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 U of Q.events)U.elementId=q[1]}for(let q of Q.events){let U=q.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(`\\s*${U}\\s*=\\s*"[^"]*"`,"g"),z=new RegExp(`\\s*${U}\\s*=\\s*'[^']*'`,"g");G=G.replace(W,""),G=G.replace(z,"")}X=X.slice(0,Q.startIndex)+G+X.slice(Q.endIndex),J.push(...Q.events)}return{template:X,bindings:J}}function m4($,Z,X){if(h4($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:q,bindings:U}=b2($),W=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...W,...U],q}let J=d4($);if(J.length===0)return $;let Y=$;for(let q=J.length-1;q>=0;q--){let U=J[q],W=U.originalTag;if(!W.includes(" id="))W=W.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${U.elementId}"`);else{let z=W.match(/id=["']([^"']+)["']/);if(z)for(let K of U.events)K.elementId=z[1]}for(let z of U.events){let K=z.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${K}\\s*=\\s*"[^"]*"`,"g"),B=new RegExp(`\\s*${K}\\s*=\\s*'[^']*'`,"g");W=W.replace(H,""),W=W.replace(B,"")}Y=Y.slice(0,U.startIndex)+W+Y.slice(U.endIndex)}let Q=P$(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 Sq($){return/@[a-z]+(?:\.[a-z]+)*\s*=\s*["'][^"']*["']/i.test($)}function t0($){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__
114
+ </script>`}function p2($){let Z=s4($);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 U of Q.events)U.elementId=q[1]}for(let q of Q.events){let U=q.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(`\\s*${U}\\s*=\\s*"[^"]*"`,"g"),z=new RegExp(`\\s*${U}\\s*=\\s*'[^']*'`,"g");G=G.replace(W,""),G=G.replace(z,"")}X=X.slice(0,Q.startIndex)+G+X.slice(Q.endIndex),J.push(...Q.events)}return{template:X,bindings:J}}function o4($,Z,X){if(i4($))return $;if(Z.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test($))return $;let{template:q,bindings:U}=p2($),W=Z.__stx_event_bindings||[];return Z.__stx_event_bindings=[...W,...U],q}let J=s4($);if(J.length===0)return $;let Y=$;for(let q=J.length-1;q>=0;q--){let U=J[q],W=U.originalTag;if(!W.includes(" id="))W=W.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${U.elementId}"`);else{let z=W.match(/id=["']([^"']+)["']/);if(z)for(let K of U.events)K.elementId=z[1]}for(let z of U.events){let K=z.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),H=new RegExp(`\\s*${K}\\s*=\\s*"[^"]*"`,"g"),B=new RegExp(`\\s*${K}\\s*=\\s*'[^']*'`,"g");W=W.replace(H,""),W=W.replace(B,"")}Y=Y.slice(0,U.startIndex)+W+Y.slice(U.endIndex)}let Q=h$(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 sq($){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 Pq($){return $.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}import eG from"fs";import g from"path";import{createHash as y2}from"crypto";var v5="__stx_component_client_factories";function l4($){let Z=$[v5];return Z instanceof Map?Z:null}function c4($){$[v5]=new Map}function p4($,Z){let X=l4($);if(!X)return null;let J=y2("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 i4($,Z){let X=l4(Z);if(!X?.size)return $;let J=$;for(let[U,W]of X){if(W.instances!==1)continue;let z=new RegExp(`window\\.__stxComponentFactories\\[${JSON.stringify(U)}\\]\\(("[^"]+")\\);`,"g");J=J.replace(z,(K,H)=>`(${W.body})(${H});`)}let Y=[...X].filter(([,U])=>U.instances>1);if(Y.length===0)return J;let G=`<script data-stx-scoped data-stx-run="always" data-stx-component-factories>
117
+ `}),$}function rq($){return $.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}import Bq from"fs";import x from"path";import{createHash as i2}from"crypto";var x5="__stx_component_client_factories";function g5($){let Z=$[x5];return Z instanceof Map?Z:null}function r4($){$[x5]=new Map}function u$($,Z){let X=g5($);if(!X)return null;let J=i2("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 a4($,Z){let X=g5(Z);if(!X?.size)return $;let J=$;for(let[U,W]of X){if(W.instances!==1)continue;let z=new RegExp(`window\\.__stxComponentFactories\\[${JSON.stringify(U)}\\]\\(("[^"]+")\\);`,"g");J=J.replace(z,(K,H)=>`(${W.body})(${H});`)}let Y=[...X].filter(([,U])=>U.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(([U,W])=>` try { factories[${JSON.stringify(U)}] = factories[${JSON.stringify(U)}] || ${W.body}; }
@@ -123,7 +123,7 @@ ${Y.map(([U,W])=>` try { factories[${JSON.stringify(U)}] = factories[${JSON.str
123
123
  })();
124
124
  </script>`,q=J.search(/<script\b(?=[^>]*\bdata-stx-scoped\b)/i);if(q<0)return`${G}
125
125
  ${J}`;return`${J.slice(0,q)}${G}
126
- ${J.slice(q)}`}var S2={maxSanitizeDepth:10,allowBracketNotation:!1},s4={...S2};var o4=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],C2=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this"]),r4=new Set(["__proto__","constructor","prototype"]),P2=/[\w)\]]\s*\[\s*['"]/;function v2($){let Z="",X=null,J=!1;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if(J){J=!1;continue}if(Q==="\\"&&X){J=!0;continue}if(X){if(X==="`"&&Q==="$"&&Y+1<$.length&&$[Y+1]==="{"){let G=1;Y+=2;while(Y<$.length&&G>0){if($[Y]==="{")G++;else if($[Y]==="}")G--;if(G>0)Z+=$[Y],Y++}continue}if(Q===X)X=null;continue}if(Q==='"'||Q==="'"||Q==="`"){X=Q;continue}Z+=Q}return Z}function f2($,Z){let X=/[$A-Z_a-z][$\w]*/g,J;while((J=X.exec($))!==null){let Y=J[0],Q=$[J.index-1];if(C2.has(Y))throw Error(`Potentially unsafe expression (matched /\\b${Y}\\b/; identifier ${Y}): ${Z}`);if(Q==="."&&r4.has(Y))throw Error(`Potentially unsafe expression (matched /.${Y}/; property ${Y}): ${Z}`)}}function x2($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,X;while((X=Z.exec($))!==null){let J=X[2];if(!r4.has(J))continue;let Y=$.slice(0,X.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(X.index+X[0].length).match(/^\s*(\S)/)?.[1];if(!((Y==="{"||Y===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${X[2]}): ${$}`)}}function f5($){let Z=$.trim(),X=v2(Z);f2(X,Z),x2(Z);for(let J of o4)if(J.test(X))throw Error(`Potentially unsafe expression (matched /${J.source}/): ${Z}`);if(!s4.allowBracketNotation&&P2.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function g2($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[X,J]of Object.entries($)){if(X.startsWith("__")||o4.some((Y)=>Y.test(X)))continue;if(J&&typeof J==="object"&&!Array.isArray(J))Z[X]=v$(J);else Z[X]=J}return Z}function v$($,Z=0){if(Z>=s4.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((J)=>v$(J,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let X={};for(let[J,Y]of Object.entries($)){if(J.startsWith("__")||J==="constructor"||J==="prototype")continue;if(Y&&typeof Y==="object")X[J]=v$(Y,Z+1);else X[J]=Y}return X}function t($,Z){try{let X=g2(Z),J=Object.keys(X),Y=Object.values(X);return q0($,J)(...Y)}catch{return}}function G0($){try{return f5($),!0}catch{return!1}}function w0($,Z){try{let X=t($,Z);if(X&&typeof X==="object"&&!Array.isArray(X))return X;return{}}catch{return{}}}var a4=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]);function x5($){return $.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}function q0($,Z){let X=f5($),J=/^[A-Za-z_$][\w$]*$/,Y=[],Q=[];for(let W=0;W<Z.length;W++){let z=Z[W];if(!J.test(z))continue;if(a4.has(z))continue;Y.push(W),Q.push(z)}let G=(W)=>Function(...Q,...W,`
126
+ ${J.slice(q)}`}function t4($){let Z=g5($),X=new Map;if(Z)for(let[J,Y]of Z)X.set(J,Y.instances);return X}function e4($,Z){let X=g5($);if(!X)return[];let J=[];for(let[Y,Q]of X){let G=Q.instances-(Z.get(Y)??0);if(G>0)J.push({body:Q.body,count:G})}return J}function $7($,Z){for(let{body:X,count:J}of Z)for(let Y=0;Y<J;Y++)u$($,X)}var n2={maxSanitizeDepth:10,allowBracketNotation:!1},X7={...n2};var J7=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,/\bnew\s+/,/\bdelete\s+/,/\bthis\b/],s2=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this"]),Y7=new Set(["__proto__","constructor","prototype"]),o2=/[\w)\]]\s*\[\s*['"]/;function r2($){let Z="",X=null,J=!1;for(let Y=0;Y<$.length;Y++){let Q=$[Y];if(J){J=!1;continue}if(Q==="\\"&&X){J=!0;continue}if(X){if(X==="`"&&Q==="$"&&Y+1<$.length&&$[Y+1]==="{"){let G=1;Y+=2;while(Y<$.length&&G>0){if($[Y]==="{")G++;else if($[Y]==="}")G--;if(G>0)Z+=$[Y],Y++}continue}if(Q===X)X=null;continue}if(Q==='"'||Q==="'"||Q==="`"){X=Q;continue}Z+=Q}return Z}function a2($,Z){let X=/[$A-Z_a-z][$\w]*/g,J;while((J=X.exec($))!==null){let Y=J[0],Q=$[J.index-1];if(s2.has(Y))throw Error(`Potentially unsafe expression (matched /\\b${Y}\\b/; identifier ${Y}): ${Z}`);if(Q==="."&&Y7.has(Y))throw Error(`Potentially unsafe expression (matched /.${Y}/; property ${Y}): ${Z}`)}}function t2($){let Z=/\[\s*(['"])(.*?)\1\s*\]/g,X;while((X=Z.exec($))!==null){let J=X[2];if(!Y7.has(J))continue;let Y=$.slice(0,X.index).match(/\S(?=\s*$)/)?.[0],Q=$.slice(X.index+X[0].length).match(/^\s*(\S)/)?.[1];if(!((Y==="{"||Y===",")&&Q===":"))throw Error(`Potentially unsafe expression (bracket key ${X[2]}): ${$}`)}}function h5($){let Z=$.trim(),X=r2(Z);a2(X,Z),t2(Z);for(let J of J7)if(J.test(X))throw Error(`Potentially unsafe expression (matched /${J.source}/): ${Z}`);if(!X7.allowBracketNotation&&o2.test(Z))throw Error(`Bracket notation with strings not allowed: ${Z}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return Z}function e2($){let Z={};Z.Math=Math,Z.JSON=JSON,Z.Date=Date,Z.String=String,Z.Number=Number,Z.Boolean=Boolean,Z.Array=Array,Z.parseInt=Number.parseInt,Z.parseFloat=Number.parseFloat,Z.isNaN=Number.isNaN,Z.isFinite=Number.isFinite,Z.encodeURIComponent=encodeURIComponent,Z.decodeURIComponent=decodeURIComponent;for(let[X,J]of Object.entries($)){if(X.startsWith("__")||J7.some((Y)=>Y.test(X)))continue;if(J&&typeof J==="object"&&!Array.isArray(J))Z[X]=d$(J);else Z[X]=J}return Z}function d$($,Z=0){if(Z>=X7.maxSanitizeDepth)return"[Object too deep]";if($===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((J)=>d$(J,Z+1));if($ instanceof Date||$ instanceof RegExp||$ instanceof Map||$ instanceof Set||$ instanceof Error)return $;let X={};for(let[J,Y]of Object.entries($)){if(J.startsWith("__")||J==="constructor"||J==="prototype")continue;if(Y&&typeof Y==="object")X[J]=d$(Y,Z+1);else X[J]=Y}return X}function e($,Z){try{let X=e2(Z),J=Object.keys(X),Y=Object.values(X);return q0($,J)(...Y)}catch{return}}function G0($){try{return h5($),!0}catch{return!1}}function w0($,Z){try{let X=e($,Z);if(X&&typeof X==="object"&&!Array.isArray(X))return X;return{}}catch{return{}}}var Q7=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]);function u5($){return $.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}function q0($,Z){let X=h5($),J=/^[A-Za-z_$][\w$]*$/,Y=[],Q=[];for(let W=0;W<Z.length;W++){let z=Z[W];if(!J.test(z))continue;if(Q7.has(z))continue;Y.push(W),Q.push(z)}let G=(W)=>Function(...Q,...W,`
127
127
  'use strict';
128
128
  try {
129
129
  return ${X};
@@ -134,18 +134,7 @@ catch (e) {
134
134
  }
135
135
  throw e;
136
136
  }
137
- `),q=G([]);if(Q.length===Z.length)return n4(q,Q,G);return n4((...W)=>{let z=Array(Y.length);for(let K=0;K<Y.length;K++)z[K]=W[Y[K]];return q(...z)},Q,G,(W)=>{q=G(W)})}function n4($,Z,X,J){let Q=/^(\w+) is not defined$/,G=$,q=[],U=new Set(Z);return(...W)=>{for(let z=0;z<=8;z++)try{return G(...W)}catch(K){let H=K instanceof Error?K.message:"",B=Q.exec(H);if(!(K instanceof ReferenceError)||!B)return;let j=B[1];if(U.has(j)||a4.has(j))return;U.add(j),q.push(j),G=X(q),J?.(q)}return}}function g5($){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 t4=0,h5=new Map;function hq(){t4=0,h5.clear()}function u5($,Z){let X=t4++,J=`<!--__STX_${$.toUpperCase()}_${X}__-->`;return h5.set(J,{type:$,expression:Z}),J}function uq(){let $={};for(let[Z,X]of h5)$[Z]={type:X.type,expression:X.expression};return $}function dq($){let Z={},X=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,J;while((J=X.exec($))!==null){let Y=J[0],Q=J[1].toLowerCase(),G=h5.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function mq($,Z){let X=$;for(let[J,Y]of Z)X=X.split(J).join(Y);return X}function lq($){return $.includes("<!--__STX_")}var e4=/<script\b[^>]*>/iy,$7=/<\/script\s*>/ig,Z7=/<style\b[^>]*>/iy,X7=/<\/style\s*>/ig;function J7($,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 Y1($,Z){return J7($,Z,e4,$7)}function f1($,Z){return J7($,Z,Z7,X7)}function z5($,Z){if(!$.startsWith("<!--",Z))return-1;let X=$.indexOf("-->",Z+4);if(X===-1)return-1;return X+3}function h2($,Z){if($.startsWith("<!--",Z)){let X=z5($,Z);return X===-1?$.length:X}for(let[X,J]of[[e4,$7],[Z7,X7]]){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 d5($,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 U=Z($,J);if(U>J){X.push({start:J,end:U,token:$.slice(J,U)}),J=U;continue}let W=h2($,J);if(W>J){J=W;continue}if(/^<\/?[a-zA-Z]/.test($.slice(J,J+2)))Q=!0;J++}return X}function n0($,Z,X){let J=d5($,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 U=J[q];Q+=$.slice(G,U.start),Q+=X(U.token,q),G=U.end}return Q+=$.slice(G),{output:Q,tokens:Y}}function s0($){let{output:Z,tokens:X}=n0($,Y1,(J,Y)=>`\x00STX_SCRIPT_${Y}\x00`);return{output:Z,scripts:X}}function x1($,Z){if(Z.length===0)return $;return $.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(X,J)=>Z[+J]??"")}var K5={},Y7=new Map;function u2($){let Z=Y7.get($);if(!Z){let X=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${X}(?!\\w)`,"g"),Y7.set($,Z)}return Z.lastIndex=0,Z}var m5={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 q7(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 U of Q){if(G===void 0||G===null)break;G=G[U]}if(G===void 0||G===null)return Y?$:"";let q=String(G);return Object.entries(X).forEach(([U,W])=>{q=q.replace(u2(U),String(W))}),q},t:($,Z,X={})=>{return m5.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 d2($,Z){if($ in m5)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);K5[$]=Z}function tq($){for(let[Z,X]of Object.entries($))d2(Z,X)}function m2(){return{...m5,...K5}}function eq(){for(let $ of Object.keys(K5))delete K5[$]}function f$($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function q7($){return f$($).replace(/\{{2,}/g,(Z)=>l2(Z.length)).replace(/\{(?=!)/g,`&#123;${U7}`)}var U7="&#8288;";function l2($){return Array.from({length:$},()=>"&#123;").join(U7)}function Q1($,Z){let{scripts:X}=s0($);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(G7(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 Q7($,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 W=0;W<J.length;W++){let z=J[W];if(!Q&&z==="`"){Q=!0,G=0;continue}if(Q){if(z==="`"&&G===0){Q=!1;continue}if(z==="$"&&J[W+1]==="{"){G++,W++,Y+=" ";continue}if(z==="}"&&G>0){G--;continue}if(G>0){Y+=z;continue}continue}Y+=z}J=Y;let q=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,U;while((U=q.exec(J))!==null){let W=U[1];if(!J.substring(0,U.index).trimEnd().endsWith(".")){if(!X.includes(W)&&!(W in Z))return!1}}return!0}function c2($,Z){let X=Z.__stx_serverDeclared;if(!X||X.size===0)return!1;let J=d0($);for(let Y of X)if(new RegExp(`(?<![.#\\w$])${Y}(?![\\w$])`).test(J))return!0;return!1}function x$($,Z){let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(J,Y)=>{try{let Q=S0(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=S0(Y,Z);if(G===void 0)return J;return JSON.stringify(G).replace(/</g,"\\u003c")}catch{return J}}),X}function p2($,Z){if(!$.includes("{"))return $;let X=$;return X=X.replace(/\{!!([\s\S]*?)!!\}/g,(J,Y)=>{try{let Q=S0(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=S0(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 $U($,Z,X={}){let{output:J,scripts:Y}=s0($),Q=Y.map((G)=>{let q=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),U=G.match(/^<script\b[^>]*>/i),W=G.search(/<\/script\s*>$/i);if(!q||!U||W===-1)return G;let z=q[1],K=q[2];if(/\bdata-raw\b/.test(z))return G;if(X.skipServer&&/\bserver\b/.test(z))return G;let B=`<script${p2(z,Z)}>`;if(/\bsrc\s*=/.test(z)||/\btype\s*=\s*["']application\/json["']/.test(z))return B+K+G.slice(W);return B+x$(K,Z)+G.slice(W)});return x1(J,Q)}function F1($,Z,X){let J=$,Y=(K,H)=>{let B=f1(K,H);if(B===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K.slice(H,B))?-1:B},Q=(K,H,B,j)=>{let _=B.length,{output:F,tokens:V}=n0(K,H,(O,L)=>j(_+L));return B.push(...V),F},G=[];J=Q(J,Y,G,(K)=>`<!--__STX_STYLE_${K}__-->`);let q=[];J=Q(J,Y1,q,(K)=>`<!--__STX_SCRIPT_EXPR_${K}__-->`);let U=Z?.__stx_signals_gate===!0||Q1($),W=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),z=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);J=J.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,H,B)=>{try{let j=S0(H,Z);return j!==void 0&&j!==null?String(j):""}catch(j){let _=j instanceof Error?j.message:String(j);return K0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${_}`,X,$,B,K)}}),J=J.replace(/\{!!([\s\S]*?)!!\}/g,(K,H,B)=>{try{let j=S0(H,Z);if(j===void 0&&Z.__stx_buildMode==="compile")return u5("raw",H.trim());return j!==void 0&&j!==null?String(j):""}catch(j){if(Z.__stx_buildMode==="compile")return u5("raw",H.trim());let _=j instanceof Error?j.message:String(j);return K0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${_}`,X,$,B,K)}}),J=Q(J,Y1,q,(K)=>`<!--__STX_SCRIPT_EXPR_${K}__-->`),J=Q(J,Y,G,(K)=>`<!--__STX_STYLE_${K}__-->`),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(K,H,B)=>{let j=H.trim();if(z.has(j))return K;let _=["parseInt","parseFloat","String","Number","Boolean","Array","Object","JSON","Math","Date","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","true","false","null","undefined"],F=/^([a-zA-Z_$][a-zA-Z0-9_$]*)/,O=j.match(F)?.[1],L=O&&((O in Z)||_.includes(O)),w=Boolean(O&&W.has(O)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,D=j.match(R),N=D&&!_.includes(D[1])&&!(D[1]in Z);if(/^__[A-Z_]+__$/.test(j))return"";try{let T=S0(H,Z);if(w)return K;if(U&&!Q7(j,Z))return K;if(Z.__stx_buildMode==="compile"&&!U&&(T===void 0||c2(j,Z)))return u5("expr",j);return T!==void 0&&T!==null?q7(String(T)):""}catch(T){if(w)return K;if(U&&!Q7(j,Z))return K;if(N)return K;let A=T instanceof Error?T.message:String(T);return K0("Expression",`Error evaluating: {{ ${j} }}: ${A}`,X,$,B,K)}});for(let K=0;K<q.length;K++)J=J.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>q[K]);for(let K=0;K<G.length;K++)J=J.replace(`<!--__STX_STYLE_${K}__-->`,()=>G[K]);return J}function i2($,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=K5[G]||m5[G];if(!q)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(m2()).join(", ")}`);let U=[];if(Y.startsWith(":")){let W=Y.match(/^:([^|\s]+)/);if(W){let z=W[1].trim();try{let K=Number(z);U=[Number.isNaN(K)?z:K]}catch{U=[z]}Y=Y.substring(W[0].length).trim()}}else if(Y.startsWith("(")){let W=1,z=1;while(W>0&&z<Y.length){if(Y[z]==="(")W++;if(Y[z]===")")W--;z++}if(W===0){let K=Y.substring(1,z-1).trim();if(K)try{if(K.startsWith("{")&&K.endsWith("}"))U=[S0(`(${K})`,X,!0)];else{let H=[],B="",j=null,_=0,F=0,V=0,O=!1;for(let L=0;L<K.length;L++){let w=K[L];if(O){B+=w,O=!1;continue}if(w==="\\"){B+=w,O=!0;continue}if(j){if(B+=w,w===j)j=null;continue}if(w==='"'||w==="'"||w==="`"){j=w,B+=w;continue}if(w==="(")_++;else if(w===")")_--;else if(w==="[")F++;else if(w==="]")F--;else if(w==="{")V++;else if(w==="}")V--;if(w===","&&_===0&&F===0&&V===0){H.push(B),B="";continue}B+=w}if(B)H.push(B);U=H.map((L)=>{let w=L.trim();return S0(w,X,!0)})}}catch{U=[K]}Y=Y.substring(z).trim()}}try{J=q(J,X,...U)}catch(W){let z=W instanceof Error?W.message:String(W);throw Error(`Error applying filter '${G}': ${z}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return J}function n2($){let Z=!1,X="",J=0,Y=0,Q=0,G=!1;for(let q=0;q<$.length;q++){let U=$[q],W=$[q+1];if(Z&&G){G=!1;continue}if(Z&&U==="\\"){G=!0;continue}if(G=!1,(U==='"'||U==="'"||U==="`")&&!G){if(!Z)Z=!0,X=U;else if(U===X)Z=!1,X="";continue}if(Z&&X==="`"&&U==="$"&&W==="{"){let z=1;q+=2;while(q<$.length&&z>0){if($[q]==="{")z++;else if($[q]==="}")z--;if(z>0)q++}continue}if(Z)continue;if(U==="(")J++;else if(U===")")J--;else if(U==="[")Y++;else if(U==="]")Y--;else if(U==="{")Q++;else if(U==="}")Q--;if(U==="|"&&J===0&&Y===0&&Q===0){if(W==="|"){q++;continue}if(W==="="){q++;continue}return q}}return-1}function S0($,Z,X=!1){try{let J=$.trim(),Y=n2(J);if(Y>0){let Q=J.substring(0,Y).trim(),G=J.substring(Y+1).trim(),q=S0(Q,Z,!0);return i2(q,G,Z)}if(!G0(J)){if(!X)console.warn(`Potentially unsafe expression detected, using safe evaluator: ${J}`);return t(J,Z)}try{let Q=Object.keys(Z),G=Object.values(Z);return q0(J,Q)(...G)}catch{return t(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=s2(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 s2($,Z){let X=null;for(let Y of Z){if(Y===$)continue;let Q=o2($,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 o2($,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 U=X[q-1]===J[G-1]?0:1;Q[q]=Math.min(Q[q-1]+1,Y[q]+1,Y[q-1]+U)}for(let q=0;q<=X.length;q++)Y[q]=Q[q]}return Y[X.length]}function ZU($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}class L1{cache=new Map;maxSize;constructor($=100){this.maxSize=$}get($){if(!this.cache.has($))return;let Z=this.cache.get($);return this.cache.delete($),this.cache.set($,Z),Z}set($,Z){if(this.cache.has($))this.cache.delete($);else if(this.cache.size>=this.maxSize){let X=this.cache.keys().next().value;if(X!==void 0)this.cache.delete(X)}this.cache.set($,Z)}has($){return this.cache.has($)}delete($){return this.cache.delete($)}clear(){this.cache.clear()}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var g1=new Map,r2=500;function h1($,Z){if(Z?.includes("g"))return new RegExp($,Z);let X=`${$}:${Z||""}`;if(!g1.has(X)){if(g1.size>=r2){let J=g1.keys().next().value;if(J)g1.delete(J)}g1.set(X,new RegExp($,Z))}return g1.get(X)}class W7{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator($){let Z=Array.from(new Set($)),X=Z.sort().join(","),J=this.pool.find((q)=>q.context.join(",")===X);if(J)return J.func;let Y=this.fnCache,Q=this.fnCacheMaxSize,G=(...q)=>{return(U)=>{try{let W=`${X}:${U}`,z=Y.get(W);if(!z){if(Y.size>=Q){let K=Y.keys().next().value;if(K)Y.delete(K)}z=Function(...Z,`
138
- 'use strict';
139
- try {
140
- return ${U};
141
- }
142
- catch (e) {
143
- if (e instanceof ReferenceError || e instanceof TypeError) {
144
- return undefined;
145
- }
146
- throw e;
147
- }
148
- `),Y.set(W,z)}return z(...q)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:G,context:Z.slice()});return G}clear(){this.pool.length=0,this.fnCache.clear()}}var JU=new W7;class z7{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled($){this.enabled=$}isEnabled(){return this.enabled}setBudget($,Z){this.budgets.set($,{warnThreshold:0.8,action:"warn",...Z})}setBudgets($){for(let[Z,X]of Object.entries($))this.setBudget(Z,X)}removeBudget($){this.budgets.delete($)}getBudgets(){let $={};for(let[Z,X]of this.budgets.entries())$[Z]=X;return $}onViolation($){this.violationHandlers.push($)}offViolation($){let Z=this.violationHandlers.indexOf($);if(Z!==-1)this.violationHandlers.splice(Z,1)}time($,Z){if(!this.enabled)return Z();let X=performance.now(),J=Z(),Y=performance.now()-X;return this.recordTime($,Y),this.checkBudget($,Y),J}async timeAsync($,Z){if(!this.enabled)return Z();let X=performance.now(),J=await Z(),Y=performance.now()-X;return this.recordTime($,Y),this.checkBudget($,Y),J}checkBudget($,Z){let X=this.budgets.get($);if(!X)return;let J=Z/X.maxTime*100,Y=X.warnThreshold!==void 0?Z>=X.maxTime*X.warnThreshold&&Z<X.maxTime:!1,Q=Z>=X.maxTime;if(!Y&&!Q)return;let G={label:$,actualTime:Z,budgetTime:X.maxTime,exceedancePercent:J,timestamp:new Date,isWarning:Y};this.violations.push(G);while(this.violations.length>this.maxViolations)this.violations.shift();for(let U of this.violationHandlers)try{U(G)}catch{}let q=Y?`[Performance Warning] "${$}" took ${Z.toFixed(2)}ms (${J.toFixed(1)}% of ${X.maxTime}ms budget)`:`[Performance Budget Exceeded] "${$}" took ${Z.toFixed(2)}ms (exceeded ${X.maxTime}ms budget by ${(J-100).toFixed(1)}%)`;switch(X.action){case"log":console.log(q);break;case"warn":console.warn(q);break;case"error":console.error(q);break;case"throw":if(Q)throw Error(q);else console.warn(q);break}}recordTime($,Z){let X=this.metrics.get($);if(X)X.count++,X.totalTime+=Z,X.maxTime=Math.max(X.maxTime,Z),X.minTime=Math.min(X.minTime,Z);else this.metrics.set($,{count:1,totalTime:Z,maxTime:Z,minTime:Z})}getStats($){if($){let X=this.metrics.get($);if(!X)return{};let J=this.budgets.get($);return{count:X.count,avgTime:X.totalTime/X.count,totalTime:X.totalTime,maxTime:X.maxTime,minTime:X.minTime,budget:J?.maxTime,budgetUtilization:J?X.totalTime/X.count/J.maxTime*100:void 0}}let Z={};for(let[X,J]of this.metrics.entries()){let Y=this.budgets.get(X);Z[X]={count:J.count,avgTime:J.totalTime/J.count,totalTime:J.totalTime,maxTime:J.maxTime,minTime:J.minTime,budget:Y?.maxTime,budgetUtilization:Y?J.totalTime/J.count/Y.maxTime*100:void 0}}return Z}getViolations($){if($)return this.violations.filter((Z)=>Z.label===$);return[...this.violations]}getViolationStats(){let $={},Z=0,X=0;for(let J of this.violations)if($[J.label]=($[J.label]||0)+1,J.isWarning)Z++;else X++;return{total:this.violations.length,byLabel:$,warnings:Z,errors:X}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var g$=null;function a2(){if(!g$)g$=new z7;return g$}var K7=new Proxy({},{get($,Z){return a2()[Z]}});import _G from"fs";import T0 from"path";var h$=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],H7=/<body\b([^>]*)>/gi;function G1($){let Z=0,X,J=h$.map(()=>{return});while(Z<$.length){if(X===void 0||X!==null&&X.index<Z)H7.lastIndex=Z,X=H7.exec($);if(!X)return null;let Y=X.index,Q=-1,G=null;for(let U=0;U<h$.length;U++){let W=h$[U],z=J[U];if(z===void 0||z!==null&&z.index<Z)W.open.lastIndex=Z,z=W.open.exec($),J[U]=z;if(!z)continue;if(z.index<Y&&(Q===-1||z.index<Q))Q=z.index,G=W.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 u1($,Z){let X=G1($);if(!X)return $;return $.slice(0,X.index)+Z(X.tag,X.attrs)+$.slice(X.index+X.tag.length)}var B7=null;function t2($){if(!B7)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return B7}function GU($){let Z=t2("onUpdate");if(Z)Z.updateHooks.push($)}function j7(){return`
137
+ `),q=G([]);if(Q.length===Z.length)return Z7(q,Q,G);return Z7((...W)=>{let z=Array(Y.length);for(let K=0;K<Y.length;K++)z[K]=W[Y[K]];return q(...z)},Q,G,(W)=>{q=G(W)})}function Z7($,Z,X,J){let Q=/^(\w+) is not defined$/,G=$,q=[],U=new Set(Z);return(...W)=>{for(let z=0;z<=8;z++)try{return G(...W)}catch(K){let H=K instanceof Error?K.message:"",B=Q.exec(H);if(!(K instanceof ReferenceError)||!B)return;let j=B[1];if(U.has(j)||Q7.has(j))return;U.add(j),q.push(j),G=X(q),J?.(q)}return}}function d5($){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 G7=0,m5=new Map;function ZU(){G7=0,m5.clear()}function l5($,Z){let X=G7++,J=`<!--__STX_${$.toUpperCase()}_${X}__-->`;return m5.set(J,{type:$,expression:Z}),J}function XU(){let $={};for(let[Z,X]of m5)$[Z]={type:X.type,expression:X.expression};return $}function JU($){let Z={},X=/<!--__STX_(EXPR|COND|RAW)_(\d+)__-->/g,J;while((J=X.exec($))!==null){let Y=J[0],Q=J[1].toLowerCase(),G=m5.get(Y);Z[Y]={type:Q,expression:G?.expression||""}}return Z}function YU($,Z){let X=$;for(let[J,Y]of Z)X=X.split(J).join(Y);return X}function QU($){return $.includes("<!--__STX_")}var q7=/<script\b[^>]*>/iy,U7=/<\/script\s*>/ig,W7=/<style\b[^>]*>/iy,z7=/<\/style\s*>/ig;function K7($,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 K7($,Z,q7,U7)}function S1($,Z){return K7($,Z,W7,z7)}function q5($,Z){if(!$.startsWith("<!--",Z))return-1;let X=$.indexOf("-->",Z+4);if(X===-1)return-1;return X+3}function $Z($,Z){if($.startsWith("<!--",Z)){let X=q5($,Z);return X===-1?$.length:X}for(let[X,J]of[[q7,U7],[W7,z7]]){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 c5($,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 U=Z($,J);if(U>J){X.push({start:J,end:U,token:$.slice(J,U)}),J=U;continue}let W=$Z($,J);if(W>J){J=W;continue}if(/^<\/?[a-zA-Z]/.test($.slice(J,J+2)))Q=!0;J++}return X}function o0($,Z,X){let J=c5($,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 U=J[q];Q+=$.slice(G,U.start),Q+=X(U.token,q),G=U.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 C1($,Z){if(Z.length===0)return $;return $.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(X,J)=>Z[+J]??"")}var U5={},H7=new Map;function ZZ($){let Z=H7.get($);if(!Z){let X=$.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");Z=new RegExp(`:${X}(?!\\w)`,"g"),H7.set($,Z)}return Z.lastIndex=0,Z}var p5={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 _7(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 U of Q){if(G===void 0||G===null)break;G=G[U]}if(G===void 0||G===null)return Y?$:"";let q=String(G);return Object.entries(X).forEach(([U,W])=>{q=q.replace(ZZ(U),String(W))}),q},t:($,Z,X={})=>{return p5.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 XZ($,Z){if($ in p5)console.warn(`Filter "${$}" already exists as a built-in filter. Custom filter will take precedence.`);U5[$]=Z}function jU($){for(let[Z,X]of Object.entries($))XZ(Z,X)}function JZ(){return{...p5,...U5}}function _U(){for(let $ of Object.keys(U5))delete U5[$]}function m$($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function _7($){return m$($).replace(/\{{2,}/g,(Z)=>YZ(Z.length)).replace(/\{(?=!)/g,`&#123;${V7}`)}var V7="&#8288;";function YZ($){return Array.from({length:$},()=>"&#123;").join(V7)}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(j7(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 B7($,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 W=0;W<J.length;W++){let z=J[W];if(!Q&&z==="`"){Q=!0,G=0;continue}if(Q){if(z==="`"&&G===0){Q=!1;continue}if(z==="$"&&J[W+1]==="{"){G++,W++,Y+=" ";continue}if(z==="}"&&G>0){G--;continue}if(G>0){Y+=z;continue}continue}Y+=z}J=Y;let q=/(?<![a-zA-Z0-9_$])([a-zA-Z_$][a-zA-Z0-9_$]*)/g,U;while((U=q.exec(J))!==null){let W=U[1];if(!J.substring(0,U.index).trimEnd().endsWith(".")){if(!X.includes(W)&&!(W in Z))return!1}}return!0}function QZ($,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 l$($,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 GZ($,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 VU($,Z,X={}){let{output:J,scripts:Y}=r0($),Q=Y.map((G)=>{let q=G.match(/^<script\b([^>]*)>([\s\S]*?)<\/script\s*>$/i),U=G.match(/^<script\b[^>]*>/i),W=G.search(/<\/script\s*>$/i);if(!q||!U||W===-1)return G;let z=q[1],K=q[2];if(/\bdata-raw\b/.test(z))return G;if(X.skipServer&&/\bserver\b/.test(z))return G;let B=`<script${GZ(z,Z)}>`;if(/\bsrc\s*=/.test(z)||/\btype\s*=\s*["']application\/json["']/.test(z))return B+K+G.slice(W);return B+l$(K,Z)+G.slice(W)});return C1(J,Q)}function V1($,Z,X){let J=$,Y=(K,H)=>{let B=S1(K,H);if(B===-1)return-1;return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(K.slice(H,B))?-1:B},Q=(K,H,B,j)=>{let _=B.length,{output:L,tokens:V}=o0(K,H,(O,F)=>j(_+F));return B.push(...V),L},G=[];J=Q(J,Y,G,(K)=>`<!--__STX_STYLE_${K}__-->`);let q=[];J=Q(J,Q1,q,(K)=>`<!--__STX_SCRIPT_EXPR_${K}__-->`);let U=Z?.__stx_signals_gate===!0||G1($),W=new Set(Array.isArray(Z?.__stx_client_signal_names)?Z.__stx_client_signal_names:[]),z=new Set(Array.isArray(Z?.__stx_preserved_client_expressions)?Z.__stx_preserved_client_expressions:[]);J=J.replace(/\{\{\{([\s\S]*?)\}\}\}/g,(K,H,B)=>{try{let j=f0(H,Z);return j!==void 0&&j!==null?String(j):""}catch(j){let _=j instanceof Error?j.message:String(j);return B0("Expression",`Error evaluating: {{{ ${H.trim()}}}}: ${_}`,X,$,B,K)}}),J=J.replace(/\{!!([\s\S]*?)!!\}/g,(K,H,B)=>{try{let j=f0(H,Z);if(j===void 0&&Z.__stx_buildMode==="compile")return l5("raw",H.trim());return j!==void 0&&j!==null?String(j):""}catch(j){if(Z.__stx_buildMode==="compile")return l5("raw",H.trim());let _=j instanceof Error?j.message:String(j);return B0("Expression",`Error evaluating: {!! ${H.trim()} !!}: ${_}`,X,$,B,K)}}),J=Q(J,Q1,q,(K)=>`<!--__STX_SCRIPT_EXPR_${K}__-->`),J=Q(J,Y,G,(K)=>`<!--__STX_STYLE_${K}__-->`),J=J.replace(/\{\{([\s\S]*?)\}\}/g,(K,H,B)=>{let j=H.trim();if(z.has(j))return K;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=j.match(L)?.[1],F=O&&((O in Z)||_.includes(O)),w=Boolean(O&&W.has(O)),R=/^([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/,D=j.match(R),N=D&&!_.includes(D[1])&&!(D[1]in Z);if(/^__[A-Z_]+__$/.test(j))return"";try{let I=f0(H,Z);if(w)return K;if(U&&!B7(j,Z))return K;if(Z.__stx_buildMode==="compile"&&!U&&(I===void 0||QZ(j,Z)))return l5("expr",j);return I!==void 0&&I!==null?_7(String(I)):""}catch(I){if(w)return K;if(U&&!B7(j,Z))return K;if(N)return K;let A=I instanceof Error?I.message:String(I);return B0("Expression",`Error evaluating: {{ ${j} }}: ${A}`,X,$,B,K)}});for(let K=0;K<q.length;K++)J=J.replace(`<!--__STX_SCRIPT_EXPR_${K}__-->`,()=>q[K]);for(let K=0;K<G.length;K++)J=J.replace(`<!--__STX_STYLE_${K}__-->`,()=>G[K]);return J}function qZ($,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=U5[G]||p5[G];if(!q)throw Error(`Filter not found: ${G}. Available filters: ${Object.keys(JZ()).join(", ")}`);let U=[];if(Y.startsWith(":")){let W=Y.match(/^:([^|\s]+)/);if(W){let z=W[1].trim();try{let K=Number(z);U=[Number.isNaN(K)?z:K]}catch{U=[z]}Y=Y.substring(W[0].length).trim()}}else if(Y.startsWith("(")){let W=1,z=1;while(W>0&&z<Y.length){if(Y[z]==="(")W++;if(Y[z]===")")W--;z++}if(W===0){let K=Y.substring(1,z-1).trim();if(K)try{if(K.startsWith("{")&&K.endsWith("}"))U=[f0(`(${K})`,X,!0)];else{let H=[],B="",j=null,_=0,L=0,V=0,O=!1;for(let F=0;F<K.length;F++){let w=K[F];if(O){B+=w,O=!1;continue}if(w==="\\"){B+=w,O=!0;continue}if(j){if(B+=w,w===j)j=null;continue}if(w==='"'||w==="'"||w==="`"){j=w,B+=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(B),B="";continue}B+=w}if(B)H.push(B);U=H.map((F)=>{let w=F.trim();return f0(w,X,!0)})}}catch{U=[K]}Y=Y.substring(z).trim()}}try{J=q(J,X,...U)}catch(W){let z=W instanceof Error?W.message:String(W);throw Error(`Error applying filter '${G}': ${z}`)}if(Y.startsWith("|"))Y=Y.substring(1).trim();else break}return J}function UZ($){let Z=!1,X="",J=0,Y=0,Q=0,G=!1;for(let q=0;q<$.length;q++){let U=$[q],W=$[q+1];if(Z&&G){G=!1;continue}if(Z&&U==="\\"){G=!0;continue}if(G=!1,(U==='"'||U==="'"||U==="`")&&!G){if(!Z)Z=!0,X=U;else if(U===X)Z=!1,X="";continue}if(Z&&X==="`"&&U==="$"&&W==="{"){let z=1;q+=2;while(q<$.length&&z>0){if($[q]==="{")z++;else if($[q]==="}")z--;if(z>0)q++}continue}if(Z)continue;if(U==="(")J++;else if(U===")")J--;else if(U==="[")Y++;else if(U==="]")Y--;else if(U==="{")Q++;else if(U==="}")Q--;if(U==="|"&&J===0&&Y===0&&Q===0){if(W==="|"){q++;continue}if(W==="="){q++;continue}return q}}return-1}function f0($,Z,X=!1){try{let J=$.trim(),Y=UZ(J);if(Y>0){let Q=J.substring(0,Y).trim(),G=J.substring(Y+1).trim(),q=f0(Q,Z,!0);return qZ(q,G,Z)}if(!G0(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 q0(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=WZ(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 WZ($,Z){let X=null;for(let Y of Z){if(Y===$)continue;let Q=zZ($,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 zZ($,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 U=X[q-1]===J[G-1]?0:1;Q[q]=Math.min(Q[q-1]+1,Y[q]+1,Y[q-1]+U)}for(let q=0;q<=X.length;q++)Y[q]=Q[q]}return Y[X.length]}function OU($){if(!$)return"";return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#039;/g,"'").replace(/&#39;/g,"'").replace(/&amp;/g,"&")}import EG from"fs";import A0 from"path";var c$=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],O7=/<body\b([^>]*)>/gi;function q1($){let Z=0,X,J=c$.map(()=>{return});while(Z<$.length){if(X===void 0||X!==null&&X.index<Z)O7.lastIndex=Z,X=O7.exec($);if(!X)return null;let Y=X.index,Q=-1,G=null;for(let U=0;U<c$.length;U++){let W=c$[U],z=J[U];if(z===void 0||z!==null&&z.index<Z)W.open.lastIndex=Z,z=W.open.exec($),J[U]=z;if(!z)continue;if(z.index<Y&&(Q===-1||z.index<Q))Q=z.index,G=W.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 P1($,Z){let X=q1($);if(!X)return $;return $.slice(0,X.index)+Z(X.tag,X.attrs)+$.slice(X.index+X.tag.length)}var F7=null;function KZ($){if(!F7)return console.warn(`[stx] ${$} must be called within a component setup.`),null;return F7}function wU($){let Z=KZ("onUpdate");if(Z)Z.updateHooks.push($)}function L7(){return`
149
138
  // STX Lifecycle Runtime
150
139
  (function() {
151
140
  if (typeof window === 'undefined') return;
@@ -493,7 +482,7 @@ else {
493
482
 
494
483
  console.log('[stx] Lifecycle runtime initialized');
495
484
  })();
496
- `}function u$($){return Symbol($)}var qU=u$("theme"),UU=u$("router"),WU=u$("i18n");import*as V7 from"crypto";function _7($){let Z=/\$(\w+)\./g,X=[],J;while((J=Z.exec($))!==null)if(!X.includes(J[1]))X.push(J[1]);return X}function e2(){return`stx-${V7.randomBytes(4).toString("hex")}`}function $Z($){return/\$\w+\./.test($)}function ZZ($){let Z=[],X=new Set,J=/<(\w+)([^>]*?)(\s*\/?>)/g,Y=$;return Y=Y.replace(J,(Q,G,q,U)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let W=[],z=!1,K=q,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,B=[...q.matchAll(H)];for(let F of B){let V=F[0],O=F[1],L=F[2];if($Z(L)){z=!0;let w=L.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(W.push({attr:O,expr:R,fullMatch:V,originalAttr:O}),_7(R).forEach((N)=>X.add(N)),O==="text")K=K.replace(V,"");else if(O==="class")K=K.replace(V,'class=""');else if(O==="disabled"||O==="hidden")K=K.replace(V,"");else K=K.replace(V,`${O}=""`)}}}if(!z)return Q;let j=K.match(/\bid\s*=\s*"([^"]+)"/),_;if(j)_=j[1];else _=e2(),K=` id="${_}"${K}`;for(let F of W)Z.push({elementId:_,attribute:F.attr,expression:F.expr,stores:_7(F.expr)});return`<${G}${K}${U}`}),{html:Y,bindings:Z,stores:X}}function XZ($,Z){if($.length===0)return"";let X=Array.from(Z),J=`
485
+ `}function p$($){return Symbol($)}var RU=p$("theme"),DU=p$("router"),NU=p$("i18n");import*as R7 from"crypto";function w7($){let Z=/\$(\w+)\./g,X=[],J;while((J=Z.exec($))!==null)if(!X.includes(J[1]))X.push(J[1]);return X}function HZ(){return`stx-${R7.randomBytes(4).toString("hex")}`}function BZ($){return/\$\w+\./.test($)}function jZ($){let Z=[],X=new Set,J=/<(\w+)([^>]*?)(\s*\/?>)/g,Y=$;return Y=Y.replace(J,(Q,G,q,U)=>{if(["script","style","template"].includes(G.toLowerCase()))return Q;let W=[],z=!1,K=q,H=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,B=[...q.matchAll(H)];for(let L of B){let V=L[0],O=L[1],F=L[2];if(BZ(F)){z=!0;let w=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(w){let R=w[1];if(W.push({attr:O,expr:R,fullMatch:V,originalAttr:O}),w7(R).forEach((N)=>X.add(N)),O==="text")K=K.replace(V,"");else if(O==="class")K=K.replace(V,'class=""');else if(O==="disabled"||O==="hidden")K=K.replace(V,"");else K=K.replace(V,`${O}=""`)}}}if(!z)return Q;let j=K.match(/\bid\s*=\s*"([^"]+)"/),_;if(j)_=j[1];else _=HZ(),K=` id="${_}"${K}`;for(let L of W)Z.push({elementId:_,attribute:L.attr,expression:L.expr,stores:w7(L.expr)});return`<${G}${K}${U}`}),{html:Y,bindings:Z,stores:X}}function _Z($,Z){if($.length===0)return"";let X=Array.from(Z),J=`
497
486
  <script>
498
487
  (function() {
499
488
  'use strict';
@@ -651,10 +640,10 @@ else {
651
640
  }
652
641
  })();
653
642
  </script>
654
- `,J}function O7($){let{html:Z,bindings:X,stores:J}=ZZ($);if(X.length===0)return $;let Y=XZ(X,J),Q=Z.lastIndexOf("</body>");if(Q!==-1)return Z.slice(0,Q)+Y+Z.slice(Q);return Z+Y}function F7($){let Z=$.analytics;if(!Z?.enabled)return"";switch(Z.driver){case"fathom":return JZ(Z);case"google-analytics":return YZ(Z);case"plausible":return QZ(Z);case"self-hosted":return GZ(Z);case"custom":return qZ(Z);default:return""}}function JZ($){let Z=$.fathom;if(!Z?.siteId)return"";let X=Z.scriptUrl||"https://cdn.usefathom.com/script.js",J=Z.defer!==!1?" defer":"",Y=[`data-site="${C0(Z.siteId)}"`];if(Z.honorDnt)Y.push('data-honor-dnt="true"');if(Z.spa)Y.push('data-spa="auto"');if(Z.canonical)Y.push(`data-canonical="${C0(Z.canonical)}"`);if(Z.auto===!1)Y.push('data-auto="false"');return`
643
+ `,J}function D7($){let{html:Z,bindings:X,stores:J}=jZ($);if(X.length===0)return $;let Y=_Z(X,J),Q=Z.lastIndexOf("</body>");if(Q!==-1)return Z.slice(0,Q)+Y+Z.slice(Q);return Z+Y}function N7($){let Z=$.analytics;if(!Z?.enabled)return"";switch(Z.driver){case"fathom":return VZ(Z);case"google-analytics":return OZ(Z);case"plausible":return FZ(Z);case"self-hosted":return LZ(Z);case"custom":return wZ(Z);default:return""}}function VZ($){let Z=$.fathom;if(!Z?.siteId)return"";let X=Z.scriptUrl||"https://cdn.usefathom.com/script.js",J=Z.defer!==!1?" defer":"",Y=[`data-site="${x0(Z.siteId)}"`];if(Z.honorDnt)Y.push('data-honor-dnt="true"');if(Z.spa)Y.push('data-spa="auto"');if(Z.canonical)Y.push(`data-canonical="${x0(Z.canonical)}"`);if(Z.auto===!1)Y.push('data-auto="false"');return`
655
644
  <!-- Fathom Analytics -->
656
- <script src="${C0(X)}" ${Y.join(" ")}${J}></script>
657
- `}function YZ($){let Z=$.googleAnalytics;if(!Z?.measurementId)return"";let X=C0(Z.measurementId),J=Z.debug?`gtag('config', '${X}', { 'debug_mode': true });`:"";return`
645
+ <script src="${x0(X)}" ${Y.join(" ")}${J}></script>
646
+ `}function OZ($){let Z=$.googleAnalytics;if(!Z?.measurementId)return"";let X=x0(Z.measurementId),J=Z.debug?`gtag('config', '${X}', { 'debug_mode': true });`:"";return`
658
647
  <!-- Google Analytics -->
659
648
  <script async src="https://www.googletagmanager.com/gtag/js?id=${X}"></script>
660
649
  <script>
@@ -664,10 +653,10 @@ else {
664
653
  gtag('config', '${X}');
665
654
  ${J}
666
655
  </script>
667
- `}function QZ($){let Z=$.plausible;if(!Z?.domain)return"";let X=Z.scriptUrl||"https://plausible.io/js/script.js",J=[`data-domain="${C0(Z.domain)}"`],Y=X,Q=[];if(Z.trackLocalhost)Q.push("local");if(Z.hashMode)Q.push("hash");if(Q.length>0&&X==="https://plausible.io/js/script.js")Y=`https://plausible.io/js/script.${Q.join(".")}.js`;return`
656
+ `}function FZ($){let Z=$.plausible;if(!Z?.domain)return"";let X=Z.scriptUrl||"https://plausible.io/js/script.js",J=[`data-domain="${x0(Z.domain)}"`],Y=X,Q=[];if(Z.trackLocalhost)Q.push("local");if(Z.hashMode)Q.push("hash");if(Q.length>0&&X==="https://plausible.io/js/script.js")Y=`https://plausible.io/js/script.${Q.join(".")}.js`;return`
668
657
  <!-- Plausible Analytics -->
669
- <script defer data-domain="${C0(Z.domain)}" src="${C0(Y)}"></script>
670
- `}function GZ($){let Z=$.selfHosted;if(!Z?.siteId||!Z?.apiEndpoint)return"";let X=C0(Z.siteId),J=C0(Z.apiEndpoint),Y=Z.honorDnt?'if(n.doNotTrack==="1")return;':"",Q=Z.trackHashChanges?"w.addEventListener('hashchange',pv);":"",G=Z.trackOutboundLinks?`
658
+ <script defer data-domain="${x0(Z.domain)}" src="${x0(Y)}"></script>
659
+ `}function LZ($){let Z=$.selfHosted;if(!Z?.siteId||!Z?.apiEndpoint)return"";let X=x0(Z.siteId),J=x0(Z.apiEndpoint),Y=Z.honorDnt?'if(n.doNotTrack==="1")return;':"",Q=Z.trackHashChanges?"w.addEventListener('hashchange',pv);":"",G=Z.trackOutboundLinks?`
671
660
  d.addEventListener('click',function(e){
672
661
  var a=e.target.closest('a');
673
662
  if(a&&a.hostname!==location.hostname){
@@ -700,15 +689,15 @@ else {
700
689
  w.stxAnalytics={track:function(n,v){t('event',{name:n,value:v});}};
701
690
  })();
702
691
  </script>
703
- `}function qZ($){let Z=$.custom;if(!Z)return"";if(Z.inlineScript)return`
692
+ `}function wZ($){let Z=$.custom;if(!Z)return"";if(Z.inlineScript)return`
704
693
  <!-- Custom Analytics -->
705
694
  <script>
706
695
  ${Z.inlineScript}
707
696
  </script>
708
- `;if(!Z.scriptUrl)return"";let X=[];if(Z.scriptId)X.push(`id="${C0(Z.scriptId)}"`);if(Z.attributes)for(let[Y,Q]of Object.entries(Z.attributes))X.push(`${C0(Y)}="${C0(Q)}"`);return`
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`
709
698
  <!-- Custom Analytics -->
710
- <script${X.length>0?` ${X.join(" ")}`:""} src="${C0(Z.scriptUrl)}" defer></script>
711
- `}function L7($,Z){let X=F7(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 C0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var HU={name:"analytics",hasEndTag:!1,handler:async($,Z,X,J)=>{let Y=X.__stx_config||{};return F7(Y)}};var UZ={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 w7($){let Z=$.heatmap;if(!Z?.enabled)return"";let X={...UZ,...Z};return`
699
+ <script${X.length>0?` ${X.join(" ")}`:""} src="${x0(Z.scriptUrl)}" defer></script>
700
+ `}function A7($,Z){let X=N7(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 IU={name:"analytics",hasEndTag:!1,handler:async($,Z,X,J)=>{let Y=X.__stx_config||{};return N7(Y)}};var RZ={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 M7($){let Z=$.heatmap;if(!Z?.enabled)return"";let X={...RZ,...Z};return`
712
701
  <!-- stx Heatmap - Privacy-Compliant Tracking -->
713
702
  <script>
714
703
  (function() {
@@ -1091,7 +1080,7 @@ else {
1091
1080
  };
1092
1081
  })();
1093
1082
  </script>
1094
- `}function R7($,Z){let X=w7(Z);if(!X)return $;let J=$.lastIndexOf("</body>");if(J!==-1)return $.slice(0,J)+X+$.slice(J);return $+X}var D7={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=WZ(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return w7(Y)}};function WZ($){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 N7{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,U)=>({x:U,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 jU(){return new N7}var zZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(zZ||={});var KZ;((J)=>{J.In="in";J.Out="out";J.Both="both"})(KZ||={});var HZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(HZ||={});var e0={duration:300,delay:0,ease:"ease",direction:"both"};function BZ($,Z={}){let{duration:X,delay:J,ease:Y,direction:Q,custom:G}={...e0,...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 I7($,Z){let X=M7(Z);if(!X)return $;let J=$.lastIndexOf("</body>");if(J!==-1)return $.slice(0,J)+X+$.slice(J);return $+X}var k7={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=DZ(Z.join(" "));Y.heatmap={...Y.heatmap,...Q,enabled:!0}}return M7(Y)}};function DZ($){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 T7{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,U)=>({x:U,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 TU(){return new T7}var NZ;((G)=>{G.Fade="fade";G.Slide="slide";G.Scale="scale";G.Flip="flip";G.Rotate="rotate";G.Custom="custom"})(NZ||={});var AZ;((J)=>{J.In="in";J.Out="out";J.Both="both"})(AZ||={});var MZ;((G)=>{G.Linear="linear";G.Ease="ease";G.EaseIn="ease-in";G.EaseOut="ease-out";G.EaseInOut="ease-in-out";G.Spring="spring"})(MZ||={});var Z1={duration:300,delay:0,ease:"ease",direction:"both"};function IZ($,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);"}
1095
1084
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
1096
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);"}
1097
1086
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1101,7 +1090,7 @@ else {
1101
1090
  @keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
1102
1091
  @keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${Q==="in"?"transform: rotate(-90deg); opacity: 0; animation: rotateIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":Q==="out"?"transform: rotate(0); opacity: 1; animation: rotateOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: rotate(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);"}
1103
1092
  @keyframes rotateIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
1104
- @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function jZ(){return`
1093
+ @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function kZ(){return`
1105
1094
  <script data-stx-scoped data-stx-run="once">
1106
1095
  // Motion preferences handling
1107
1096
  (function() {
@@ -1129,7 +1118,7 @@ else {
1129
1118
  });
1130
1119
  })();
1131
1120
  </script>
1132
- `}function _Z($){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((X)=>X.test($))}function VZ($=0.1,Z="0px"){return`
1121
+ `}function TZ($){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((X)=>X.test($))}function EZ($=0.1,Z="0px"){return`
1133
1122
  <script data-stx-scoped data-stx-run="always">
1134
1123
  // Intersection Observer for scroll animations
1135
1124
  (function() {
@@ -1172,7 +1161,7 @@ else {
1172
1161
  }
1173
1162
  })();
1174
1163
  </script>
1175
- `}function OZ(){return`
1164
+ `}function bZ(){return`
1176
1165
  <style id="stx-animation-base">
1177
1166
  :root {
1178
1167
  --stx-transition-duration: 300ms;
@@ -1287,7 +1276,7 @@ else {
1287
1276
  transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
1288
1277
  }
1289
1278
  </style>
1290
- `}function FZ($,Z,X={}){let{staggerDelay:J=50,sequence:Y=!1}=X;return`
1279
+ `}function yZ($,Z,X={}){let{staggerDelay:J=50,sequence:Y=!1}=X;return`
1291
1280
  <script data-stx-scoped data-stx-run="always">
1292
1281
  // Animation Group: ${$}
1293
1282
  (function() {
@@ -1324,21 +1313,21 @@ else {
1324
1313
  }
1325
1314
  })();
1326
1315
  </script>
1327
- `}var d$={name:"transition",handler:($,Z,X,J)=>{if(Z.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||e0.duration:e0.duration,G=Z.length>2?Z[2]||e0.ease:e0.ease,q=Z.length>3?Number.parseInt(Z[3],10)||e0.delay:e0.delay,U=Z.length>4?Z[4]||e0.direction:e0.direction,W=`stx-transition-${Math.random().toString(36).substr(2,9)}`,z=BZ(Y,{duration:Q,delay:q,ease:G,direction:U}),K="stx-transition",H="";if(Y==="fade")H="stx-fade";else if(Y==="slide")H="stx-slide";else if(Y==="scale")H="stx-scale";else if(Y==="flip")H="stx-flip";else if(Y==="rotate")H="stx-rotate";return`<div id="${W}" class="${K} ${H} ${U==="out"?"stx-out":""}"
1328
- style="--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${q}ms;">${$}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},m$={name:"scrollAnimate",handler:($,Z,X,J)=>{if(Z.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||300:300,G=Z.length>2?Z[2]||"ease":"ease",q=Z.length>3?Number.parseFloat(Z[3])||0.2:0.2,U=Z.length>4?Number.parseInt(Z[4],10)||0:0,W=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,z=`--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${U}ms; will-change: opacity, transform;`,K="stx-transition stx-observe stx-out";if(Y==="fade")K+=" stx-fade";else if(Y==="slide-up"||Y==="slide")K+=" stx-from-bottom";else if(Y==="slide-down")K+=" stx-from-top";else if(Y==="slide-left")K+=" stx-from-right";else if(Y==="slide-right")K+=" stx-from-left";else if(Y==="scale")K+=" stx-scale";else if(Y.includes("-"))K+=` stx-${Y}`;else K+=` stx-${Y}`;return`<div id="${W}" class="${K}" style="${z}" data-threshold="${q}">${$}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},l$={name:"animationGroup",handler:($,Z,X,J)=>{if(Z.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${$}`;let Y=Z[0],Q=Z.slice(1).map((W)=>W.startsWith("#")||W.startsWith(".")?W:`#${W}`),G=X.staggerDelay||50,q=X.sequence||!0,U=FZ(Y,Q,{staggerDelay:G,sequence:q});return`${$}
1329
- ${U}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},c$={name:"motion",handler:($,Z,X,J)=>{let Y=Z.length>0?Z[0].toLowerCase()==="true":!0,Q=jZ();return`<div data-animate="${Y?"auto":"true"}">${$}</div>${Q}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function M7($,Z,X,J){let Y=$;if(J.animation?.enabled===!1)return Y;let Q=X.includes("test")&&X.includes("animation");if(!_Z(Y)&&!Q)return Y;if(!Y.includes('<style id="stx-animation-base">')){let q=OZ();Y=Y.replace("</head>",`${q}
1330
- </head>`)}if(Y.includes("stx-observe")){if(!Y.includes("Intersection Observer for scroll animations")){let U=VZ(),W=Y.lastIndexOf("</body>");if(W!==-1)Y=Y.slice(0,W)+U+`
1331
- `+Y.slice(W)}}return Y}var A7={default:{stiffness:100,damping:10,mass:1},gentle:{stiffness:120,damping:14,mass:1},wobbly:{stiffness:180,damping:12,mass:1},stiff:{stiffness:210,damping:20,mass:1},slow:{stiffness:280,damping:60,mass:1},molasses:{stiffness:280,damping:120,mass:1}};function LZ($,Z){let X=Z.map((J)=>{let Y=J.offset!==void 0?`${J.offset*100}%`:"from",Q=Object.entries(J.properties).map(([G,q])=>`${G}: ${q}`).join("; ");return`${Y} { ${Q} }`}).join(`
1316
+ `}var i$={name:"transition",handler:($,Z,X,J)=>{if(Z.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||Z1.duration:Z1.duration,G=Z.length>2?Z[2]||Z1.ease:Z1.ease,q=Z.length>3?Number.parseInt(Z[3],10)||Z1.delay:Z1.delay,U=Z.length>4?Z[4]||Z1.direction:Z1.direction,W=`stx-transition-${Math.random().toString(36).substr(2,9)}`,z=IZ(Y,{duration:Q,delay:q,ease:G,direction:U}),K="stx-transition",H="";if(Y==="fade")H="stx-fade";else if(Y==="slide")H="stx-slide";else if(Y==="scale")H="stx-scale";else if(Y==="flip")H="stx-flip";else if(Y==="rotate")H="stx-rotate";return`<div id="${W}" class="${K} ${H} ${U==="out"?"stx-out":""}"
1317
+ style="--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${q}ms;">${$}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},n$={name:"scrollAnimate",handler:($,Z,X,J)=>{if(Z.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${$}`;let Y=Z[0],Q=Z.length>1?Number.parseInt(Z[1],10)||300:300,G=Z.length>2?Z[2]||"ease":"ease",q=Z.length>3?Number.parseFloat(Z[3])||0.2:0.2,U=Z.length>4?Number.parseInt(Z[4],10)||0:0,W=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,z=`--stx-transition-duration: ${Q}ms; --stx-transition-ease: ${G}; --stx-transition-delay: ${U}ms; will-change: opacity, transform;`,K="stx-transition stx-observe stx-out";if(Y==="fade")K+=" stx-fade";else if(Y==="slide-up"||Y==="slide")K+=" stx-from-bottom";else if(Y==="slide-down")K+=" stx-from-top";else if(Y==="slide-left")K+=" stx-from-right";else if(Y==="slide-right")K+=" stx-from-left";else if(Y==="scale")K+=" stx-scale";else if(Y.includes("-"))K+=` stx-${Y}`;else K+=` stx-${Y}`;return`<div id="${W}" class="${K}" style="${z}" data-threshold="${q}">${$}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},s$={name:"animationGroup",handler:($,Z,X,J)=>{if(Z.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${$}`;let Y=Z[0],Q=Z.slice(1).map((W)=>W.startsWith("#")||W.startsWith(".")?W:`#${W}`),G=X.staggerDelay||50,q=X.sequence||!0,U=yZ(Y,Q,{staggerDelay:G,sequence:q});return`${$}
1318
+ ${U}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},o$={name:"motion",handler:($,Z,X,J)=>{let Y=Z.length>0?Z[0].toLowerCase()==="true":!0,Q=kZ();return`<div data-animate="${Y?"auto":"true"}">${$}</div>${Q}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function b7($,Z,X,J){let Y=$;if(J.animation?.enabled===!1)return Y;let Q=X.includes("test")&&X.includes("animation");if(!TZ(Y)&&!Q)return Y;if(!Y.includes('<style id="stx-animation-base">')){let q=bZ();Y=Y.replace("</head>",`${q}
1319
+ </head>`)}if(Y.includes("stx-observe")){if(!Y.includes("Intersection Observer for scroll animations")){let U=EZ(),W=Y.lastIndexOf("</body>");if(W!==-1)Y=Y.slice(0,W)+U+`
1320
+ `+Y.slice(W)}}return Y}var E7={default:{stiffness:100,damping:10,mass:1},gentle:{stiffness:120,damping:14,mass:1},wobbly:{stiffness:180,damping:12,mass:1},stiff:{stiffness:210,damping:20,mass:1},slow:{stiffness:280,damping:60,mass:1},molasses:{stiffness:280,damping:120,mass:1}};function SZ($,Z){let X=Z.map((J)=>{let Y=J.offset!==void 0?`${J.offset*100}%`:"from",Q=Object.entries(J.properties).map(([G,q])=>`${G}: ${q}`).join("; ");return`${Y} { ${Q} }`}).join(`
1332
1321
  `);return`@keyframes ${$} {
1333
1322
  ${X}
1334
- }`}var wZ={name:"keyframe",hasEndTag:!0,handler:($,Z,X,J)=>{if(Z.length<1)return`<div class="stx-error">@keyframe requires an animation name</div>${$}`;let Y=Z[0].replace(/['"`]/g,""),Q=Z[1]?Number.parseInt(Z[1],10):1000,G=Z[2]?.replace(/['"`]/g,"")||"ease",q=Z[3]||"1",U=Z[4]?.replace(/['"`]/g,"")||"normal",W=Z[5]?.replace(/['"`]/g,"")||"forwards",z=`stx-keyframe-${Math.random().toString(36).slice(2,9)}`,K=`
1323
+ }`}var CZ={name:"keyframe",hasEndTag:!0,handler:($,Z,X,J)=>{if(Z.length<1)return`<div class="stx-error">@keyframe requires an animation name</div>${$}`;let Y=Z[0].replace(/['"`]/g,""),Q=Z[1]?Number.parseInt(Z[1],10):1000,G=Z[2]?.replace(/['"`]/g,"")||"ease",q=Z[3]||"1",U=Z[4]?.replace(/['"`]/g,"")||"normal",W=Z[5]?.replace(/['"`]/g,"")||"forwards",z=`stx-keyframe-${Math.random().toString(36).slice(2,9)}`,K=`
1335
1324
  animation-name: ${Y};
1336
1325
  animation-duration: ${Q}ms;
1337
1326
  animation-timing-function: ${G};
1338
1327
  animation-iteration-count: ${q};
1339
1328
  animation-direction: ${U};
1340
1329
  animation-fill-mode: ${W};
1341
- `.trim().replace(/\s+/g," ");return`<div id="${z}" style="${K}">${$}</div>`},description:"Applies a keyframe animation to an element"};function RZ($,Z,X,J,Y){return`
1330
+ `.trim().replace(/\s+/g," ");return`<div id="${z}" style="${K}">${$}</div>`},description:"Applies a keyframe animation to an element"};function PZ($,Z,X,J,Y){return`
1342
1331
  <script data-stx-scoped data-stx-run="always">
1343
1332
  (function() {
1344
1333
  const container = document.getElementById('${$}');
@@ -1352,7 +1341,7 @@ ${U}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1352
1341
  child.classList.add('${Y}');
1353
1342
  });
1354
1343
  })();
1355
- </script>`}var DZ={name:"stagger",hasEndTag:!0,handler:($,Z,X,J)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"> *",Q=Z[1]?Number.parseInt(Z[1],10):100,G=Z[2]?Number.parseInt(Z[2],10):0,q=Z[3]?.replace(/['"`]/g,"")||"fade",U=`stx-stagger-${Math.random().toString(36).slice(2,9)}`,W="stx-stagger-item";if(q==="fade")W+=" stx-fade";else if(q==="slide")W+=" stx-from-bottom";else if(q==="scale")W+=" stx-scale";let z=RZ(U,Y,G,Q,W);return`${`
1344
+ </script>`}var vZ={name:"stagger",hasEndTag:!0,handler:($,Z,X,J)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"> *",Q=Z[1]?Number.parseInt(Z[1],10):100,G=Z[2]?Number.parseInt(Z[2],10):0,q=Z[3]?.replace(/['"`]/g,"")||"fade",U=`stx-stagger-${Math.random().toString(36).slice(2,9)}`,W="stx-stagger-item";if(q==="fade")W+=" stx-fade";else if(q==="slide")W+=" stx-from-bottom";else if(q==="scale")W+=" stx-scale";let z=PZ(U,Y,G,Q,W);return`${`
1356
1345
  <style>
1357
1346
  #${U} .stx-stagger-item {
1358
1347
  opacity: 0;
@@ -1362,12 +1351,12 @@ ${U}`},hasEndTag:!1,description:"Coordinates multiple animations together as a g
1362
1351
  from { opacity: 0; transform: translateY(10px); }
1363
1352
  to { opacity: 1; transform: translateY(0); }
1364
1353
  }
1365
- </style>`}<div id="${U}" class="stx-stagger-container">${$}</div>${z}`},description:"Applies staggered animations to child elements"};function NZ($){let{stiffness:Z,damping:X}=$,J=X/(2*Math.sqrt(Z));if(J<0.5)return"cubic-bezier(0.175, 0.885, 0.32, 1.275)";else if(J<1)return"cubic-bezier(0.34, 1.56, 0.64, 1)";else return"cubic-bezier(0.25, 0.1, 0.25, 1)"}var AZ={name:"spring",hasEndTag:!0,handler:($,Z,X,J)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"default",Q;if(A7[Y])Q=A7[Y];else Q={stiffness:Number.parseInt(Y,10)||100,damping:Z[1]?Number.parseInt(Z[1],10):10,mass:Z[2]?Number.parseFloat(Z[2]):1};let G=Z[3]?Number.parseInt(Z[3],10):500,q=`stx-spring-${Math.random().toString(36).slice(2,9)}`,U=NZ(Q),W=`
1354
+ </style>`}<div id="${U}" class="stx-stagger-container">${$}</div>${z}`},description:"Applies staggered animations to child elements"};function fZ($){let{stiffness:Z,damping:X}=$,J=X/(2*Math.sqrt(Z));if(J<0.5)return"cubic-bezier(0.175, 0.885, 0.32, 1.275)";else if(J<1)return"cubic-bezier(0.34, 1.56, 0.64, 1)";else return"cubic-bezier(0.25, 0.1, 0.25, 1)"}var xZ={name:"spring",hasEndTag:!0,handler:($,Z,X,J)=>{let Y=Z[0]?.replace(/['"`]/g,"")||"default",Q;if(E7[Y])Q=E7[Y];else Q={stiffness:Number.parseInt(Y,10)||100,damping:Z[1]?Number.parseInt(Z[1],10):10,mass:Z[2]?Number.parseFloat(Z[2]):1};let G=Z[3]?Number.parseInt(Z[3],10):500,q=`stx-spring-${Math.random().toString(36).slice(2,9)}`,U=fZ(Q),W=`
1366
1355
  transition: all ${G}ms ${U};
1367
1356
  --stx-spring-stiffness: ${Q.stiffness};
1368
1357
  --stx-spring-damping: ${Q.damping};
1369
1358
  --stx-spring-mass: ${Q.mass};
1370
- `.trim().replace(/\s+/g," ");return`<div id="${q}" class="stx-spring" style="${W}">${$}</div>`},description:"Applies spring physics animations to an element"};function VU($){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="${W}">${$}</div>`},description:"Applies spring physics animations to an element"};function bU($){let Z=`stx-timeline-${Math.random().toString(36).slice(2,9)}`;return`
1371
1360
  <script data-stx-scoped data-stx-run="always">
1372
1361
  (function() {
1373
1362
  const timeline = ${JSON.stringify($)};
@@ -1404,7 +1393,7 @@ else {
1404
1393
  runTimeline();
1405
1394
  }
1406
1395
  })();
1407
- </script>`}function OU($,Z,X){let J=LZ($,Z),Y=`
1396
+ </script>`}function yU($,Z,X){let J=SZ($,Z),Y=`
1408
1397
  .${$}-animation {
1409
1398
  animation-name: ${$};
1410
1399
  animation-duration: ${X.duration}ms;
@@ -1414,7 +1403,7 @@ else {
1414
1403
  animation-direction: ${X.direction||"normal"};
1415
1404
  animation-fill-mode: ${X.fill||"forwards"};
1416
1405
  }`;return`${J}
1417
- ${Y}`}function FU($){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 LU(){return`
1406
+ ${Y}`}function SU($){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 CU(){return`
1418
1407
  <script data-stx-scoped data-stx-run="once">
1419
1408
  window.__stxAnimation = {
1420
1409
  // Registry of animations
@@ -1486,7 +1475,7 @@ else {
1486
1475
  );
1487
1476
  }
1488
1477
  };
1489
- </script>`}function wU($){let Z=$.customDirectives||[];return Z.push(d$),Z.push(l$),Z.push(c$),Z.push(m$),Z.push(wZ),Z.push(DZ),Z.push(AZ),{...$,customDirectives:Z}}function T7($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function I7($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var MZ=100,TZ=599,i$="__stxResponseStatus",H5="__stxResponseHeaders";function l5($){return typeof $==="number"&&Number.isInteger($)&&$>=MZ&&$<=TZ}function AU($){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(l5(J))return J}return}function p$($,Z){if(!$||typeof $!=="object")return!1;let X=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!l5(X))return!1;return $[i$]=X,!0}function IZ($,Z,X){if(!$||typeof $!=="object")return;let J=String(Z??"").trim();if(!J)return;$[H5]={...$[H5],[J]:String(X)}}function kZ($){let Z=$?.[i$];return l5(Z)?Z:void 0}function EZ($){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 MU($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let X=kZ($);if(X!==void 0)Z[i$]=X;let J=EZ($);if(J)Z[H5]={...Z[H5],...J}}function k7($){return{setResponseStatus:(Z)=>{p$($,Z)},notFound:(Z=404)=>{let X=l5(Z)&&Z>=400?Z:404;p$($,X)},setResponseHeader:(Z,X)=>{IZ($,Z,X)}}}function E7($,Z,X={}){if(!$.includes("@status"))return $;let{filePath:J,buildMode:Y}=X,Q=Y==="compile",G="",q=0,U=/@status\s*\(/g,W;while((W=U.exec($))!==null){let z=bZ($,W.index+W[0].length-1);if(z<0)break;let K=$.slice(W.index+W[0].length,z).trim(),H=/^\d+$/.test(K)?Number(K):t(K,Z),B=J?` in ${J}`:"";if(Q)console.warn(`[stx] @status(${K})${B} 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(${K}) from <script server> instead \u2014 that runs per request.`);else if(!p$(Z,H))console.warn(`[stx] @status(${K})${B} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(q,W.index),q=z+1+($.slice(z+1).match(/^[^\S\n]*\n?/)?.[0].length??0),U.lastIndex=q}return q===0?$:G+$.slice(q)}function bZ($,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 yZ=0,SZ=0;function b7($,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 CZ($){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,U=b7(G,"x-data");if(!U)continue;let W=`__stx_scope_${yZ++}`,z=b7(G,"x-init"),K=PZ($,Q,q+Y.length),H=$.slice(q,K.endIndex),B=vZ(H);Z.push({id:W,selector:`[data-stx-scope="${W}"]`,stateExpr:U,initExpr:z,bindings:[],refs:B})}return Z}function PZ($,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 U=Q.exec($),W=G.exec($),z=q.exec($);if(z&&z.index<(U?.index??1/0)){Y=z.index+z[0].length;continue}if(!W)return{endIndex:$.length};if(U&&U.index<W.index)J++,Y=U.index+U[0].length;else{if(J--,J===0)return{endIndex:W.index+W[0].length};Y=W.index+W[0].length}}return{endIndex:$.length}}function vZ($){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=fZ(Q);Z.set(G,q)}return Z}function fZ($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${SZ++}`}function xZ(){return`
1478
+ </script>`}function PU($){let Z=$.customDirectives||[];return Z.push(i$),Z.push(s$),Z.push(o$),Z.push(n$),Z.push(CZ),Z.push(vZ),Z.push(xZ),{...$,customDirectives:Z}}function y7($){let Z=$.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!Z)return null;try{return Function(`return ${Z[1]}`)()}catch{return null}}function S7($){let Z=$?.layout;if(Z===!1)return!1;return typeof Z==="string"&&Z.trim()?Z.trim():void 0}var gZ=100,hZ=599,a$="__stxResponseStatus",W5="__stxResponseHeaders";function i5($){return typeof $==="number"&&Number.isInteger($)&&$>=gZ&&$<=hZ}function gU($){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(i5(J))return J}return}function r$($,Z){if(!$||typeof $!=="object")return!1;let X=typeof Z==="string"&&/^\d+$/.test(Z.trim())?Number(Z.trim()):Z;if(!i5(X))return!1;return $[a$]=X,!0}function uZ($,Z,X){if(!$||typeof $!=="object")return;let J=String(Z??"").trim();if(!J)return;$[W5]={...$[W5],[J]:String(X)}}function dZ($){let Z=$?.[a$];return i5(Z)?Z:void 0}function mZ($){let Z=$?.[W5];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 hU($,Z){if(!$||!Z||$===Z||typeof Z!=="object")return;let X=dZ($);if(X!==void 0)Z[a$]=X;let J=mZ($);if(J)Z[W5]={...Z[W5],...J}}function C7($){return{setResponseStatus:(Z)=>{r$($,Z)},notFound:(Z=404)=>{let X=i5(Z)&&Z>=400?Z:404;r$($,X)},setResponseHeader:(Z,X)=>{uZ($,Z,X)}}}function P7($,Z,X={}){if(!$.includes("@status"))return $;let{filePath:J,buildMode:Y}=X,Q=Y==="compile",G="",q=0,U=/@status\s*\(/g,W;while((W=U.exec($))!==null){let z=lZ($,W.index+W[0].length-1);if(z<0)break;let K=$.slice(W.index+W[0].length,z).trim(),H=/^\d+$/.test(K)?Number(K):e(K,Z),B=J?` in ${J}`:"";if(Q)console.warn(`[stx] @status(${K})${B} 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(${K}) from <script server> instead \u2014 that runs per request.`);else if(!r$(Z,H))console.warn(`[stx] @status(${K})${B} is not an HTTP status (100-599) \u2014 ignoring it.`);G+=$.slice(q,W.index),q=z+1+($.slice(z+1).match(/^[^\S\n]*\n?/)?.[0].length??0),U.lastIndex=q}return q===0?$:G+$.slice(q)}function lZ($,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 cZ=0,pZ=0;function v7($,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 iZ($){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,U=v7(G,"x-data");if(!U)continue;let W=`__stx_scope_${cZ++}`,z=v7(G,"x-init"),K=nZ($,Q,q+Y.length),H=$.slice(q,K.endIndex),B=sZ(H);Z.push({id:W,selector:`[data-stx-scope="${W}"]`,stateExpr:U,initExpr:z,bindings:[],refs:B})}return Z}function nZ($,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 U=Q.exec($),W=G.exec($),z=q.exec($);if(z&&z.index<(U?.index??1/0)){Y=z.index+z[0].length;continue}if(!W)return{endIndex:$.length};if(U&&U.index<W.index)J++,Y=U.index+U[0].length;else{if(J--,J===0)return{endIndex:W.index+W[0].length};Y=W.index+W[0].length}}return{endIndex:$.length}}function sZ($){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=oZ(Q);Z.set(G,q)}return Z}function oZ($){let Z=$.match(/\bid\s*=\s*["']([^"']*)["']/);if(Z)return Z[1];return`__stx_el_${pZ++}`}function rZ(){return`
1490
1479
  // STX Reactive Runtime - x-cloak and transition CSS
1491
1480
  (function() {
1492
1481
  var style = document.createElement('style');
@@ -1693,7 +1682,7 @@ window.__stx_reactive = (function() {
1693
1682
 
1694
1683
  return { initScope: initScope, reactive: reactive };
1695
1684
  })();
1696
- `}function y7($,Z){let X=$.replace(/\{!!([\s\S]*?)!!\}/g,(q,U)=>{try{let W=S0(U,Z,!0);if(W===void 0)return q;return String(W)}catch{return q}}),J="",Y=0,Q=null;while(Y<X.length){let q=X[Y];if(Q&&q==="\\"){J+=q+(X[Y+1]??""),Y+=2;continue}if(q==="{"&&X[Y+1]==="{"){let U=X.indexOf("}}",Y+2);if(U!==-1){let W=X.slice(Y,U+2);J+=G(X.slice(Y+2,U),W,Q),Y=U+2;continue}}if(Q){if(q===Q)Q=null}else if(q==="'"||q==='"'||q==="`")Q=q;J+=q,Y++}return J;function G(q,U,W){let z;try{z=S0(q,Z,!0)}catch{return U}if(z===void 0)return U;if(W){let K=String(z).replace(/\\/g,"\\\\").replace(new RegExp(W==="`"?"`":W,"g"),`\\${W}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return W==="`"?K.replace(/\$\{/g,"\\${"):K}if(typeof z==="string"){let K=z.trim();if(K.startsWith("{")&&K.endsWith("}")||K.startsWith("[")&&K.endsWith("]"))try{return JSON.parse(K),K}catch{}}return JSON.stringify(z)}}function gZ($,Z){if($.length===0)return"";let X=$.map((J)=>{let Y=JSON.stringify(Object.fromEntries(J.refs)),Q=y7(J.stateExpr,Z),G=J.initExpr?y7(J.initExpr,Z):null,q=JSON.stringify(Q),U=G?JSON.stringify(G):"null";return`
1685
+ `}function f7($,Z){let X=$.replace(/\{!!([\s\S]*?)!!\}/g,(q,U)=>{try{let W=f0(U,Z,!0);if(W===void 0)return q;return String(W)}catch{return q}}),J="",Y=0,Q=null;while(Y<X.length){let q=X[Y];if(Q&&q==="\\"){J+=q+(X[Y+1]??""),Y+=2;continue}if(q==="{"&&X[Y+1]==="{"){let U=X.indexOf("}}",Y+2);if(U!==-1){let W=X.slice(Y,U+2);J+=G(X.slice(Y+2,U),W,Q),Y=U+2;continue}}if(Q){if(q===Q)Q=null}else if(q==="'"||q==='"'||q==="`")Q=q;J+=q,Y++}return J;function G(q,U,W){let z;try{z=f0(q,Z,!0)}catch{return U}if(z===void 0)return U;if(W){let K=String(z).replace(/\\/g,"\\\\").replace(new RegExp(W==="`"?"`":W,"g"),`\\${W}`).replace(/\r/g,"\\r").replace(/\n/g,"\\n");return W==="`"?K.replace(/\$\{/g,"\\${"):K}if(typeof z==="string"){let K=z.trim();if(K.startsWith("{")&&K.endsWith("}")||K.startsWith("[")&&K.endsWith("]"))try{return JSON.parse(K),K}catch{}}return JSON.stringify(z)}}function aZ($,Z){if($.length===0)return"";let X=$.map((J)=>{let Y=JSON.stringify(Object.fromEntries(J.refs)),Q=f7(J.stateExpr,Z),G=J.initExpr?f7(J.initExpr,Z):null,q=JSON.stringify(Q),U=G?JSON.stringify(G):"null";return`
1697
1686
  (function() {
1698
1687
  var scopeEl = document.querySelector('${J.selector}');
1699
1688
  if (!scopeEl) return;
@@ -1702,13 +1691,13 @@ window.__stx_reactive = (function() {
1702
1691
  })();`}).join(`
1703
1692
  `);return`
1704
1693
  <script data-stx-scoped data-stx-reactive data-stx-run="always">
1705
- ${xZ()}
1694
+ ${rZ()}
1706
1695
  ${X}
1707
- </script>`}function S7($,Z,X){if(!uZ($))return $;let J=CZ($);if(J.length===0)return $;let Y=hZ($,J),Q=gZ(J,Z),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
1708
- `+Y.slice(G);else Y+=Q;return Y}function hZ($,Z){let X=0,J=$.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(Y,Q,G)=>{let q=Z[X++];if(!q)return Y;let U=/data-stx-scope="([^"]*)"/.exec(G);if(U)return q.id=U[1],q.selector=`[data-stx-scope="${q.id}"]`,Y;return`<${Q} data-stx-scope="${q.id}"${G}>`});return J=J.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),J=J.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),J=J.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),J=J.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),J}function uZ($){return/x-data\s*=\s*["']/.test($)}import tX from"fs";import F3 from"path";import{createHighlighter as eX}from"ts-syntax-highlighter";import X$ from"fs";import I0 from"path";import{loadConfigWithResult as pX}from"bunfig";B5();async function dZ($,Z,X,J){let Y=Z[0]?.replace(/['"]/g,"")||"main",Q=n$();if(Y!=="main")Q=Q.replace("container:'main'",`container:'${Y}'`);return`<script data-stx-router>${Q}</script>`}var C7={name:"stxRouter",handler:dZ,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};function q1($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function P7($){let Z=$.trim().toLowerCase();return!Z.startsWith("javascript:")&&!Z.startsWith("vbscript:")&&!Z.startsWith("data:text/html")}function v7($){let Z=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,X=$.match(Z);if(!X)return{data:{},content:$.trim()};let J=X[1],Y=$.slice(X[0].length),Q={};for(let G of J.split(`
1709
- `)){let q=G.trim();if(!q||q.startsWith("#"))continue;let U=q.indexOf(":");if(U===-1)continue;let W=q.slice(0,U).trim(),z=q.slice(U+1).trim();if(typeof z==="string"){if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'"))z=z.slice(1,-1);else if(z.startsWith("[")&&z.endsWith("]"))try{z=JSON.parse(z)}catch{}else if(z==="true")z=!0;else if(z==="false")z=!1;else if(/^-?\d+(?:\.\d+)?$/.test(z))z=Number(z)}Q[W]=z}return{data:Q,content:Y.trim()}}function j5($,Z={}){let{gfm:X=!0,breaks:J=!1}=Z,Y=$,Q=[];if(Y=Y.replace(/```(\w*)\n([\s\S]*?)```/g,(z,K,H)=>{let B=Q.length,j=K?` class="language-${q1(K)}"`:"";return Q.push(`<pre><code${j}>${q1(H.trim())}</code></pre>`),`\x00CODEBLOCK${B}\x00`}),Y=Y.replace(/`([^`]*)`/g,(z,K)=>`<code>${q1(K)}</code>`),Y=Y.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),Y=Y.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),Y=Y.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),Y=Y.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),Y=Y.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),Y=Y.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),Y=Y.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),Y=Y.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),Y=Y.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),Y=Y.replace(/__(.+?)__/g,"<strong>$1</strong>"),Y=Y.replace(/\*(.+?)\*/g,"<em>$1</em>"),Y=Y.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),X)Y=Y.replace(/~~(.+?)~~/g,"<del>$1</del>");if(Y=Y.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(z,K,H)=>{return`<img src="${P7(H)?q1(H):""}" alt="${q1(K)}" />`}),Y=Y.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(z,K,H)=>{return`<a href="${P7(H)?q1(H):""}">${K}</a>`}),Y=Y.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),Y=Y.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),Y=Y.replace(/<\/blockquote>\n<blockquote>/g,`
1710
- `),Y=Y.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),Y=Y.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),Y=Y.replace(/<\/ul>\n<ul>/g,""),Y=Y.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),Y=Y.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),Y=Y.replace(/<\/ol>\n<ol>/g,""),Y=Y.replace(/<li data-ul>/g,"<li>"),Y=Y.replace(/<li data-ol>/g,"<li>"),X)Y=Y.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(z,K,H)=>{let j=`<tr>${K.split("|").map((F)=>F.trim()).filter(Boolean).map((F)=>`<th>${q1(F)}</th>`).join("")}</tr>`,_=H.trim().split(`
1711
- `).map((F)=>{return`<tr>${F.split("|").map((O)=>O.trim()).filter(Boolean).map((O)=>`<td>${q1(O)}</td>`).join("")}</tr>`}).join(`
1696
+ </script>`}function x7($,Z,X){if(!eZ($))return $;let J=iZ($);if(J.length===0)return $;let Y=tZ($,J),Q=aZ(J,Z),G=Y.lastIndexOf("</body>");if(G!==-1)Y=Y.slice(0,G)+Q+`
1697
+ `+Y.slice(G);else Y+=Q;return Y}function tZ($,Z){let X=0,J=$.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(Y,Q,G)=>{let q=Z[X++];if(!q)return Y;let U=/data-stx-scope="([^"]*)"/.exec(G);if(U)return q.id=U[1],q.selector=`[data-stx-scope="${q.id}"]`,Y;return`<${Q} data-stx-scope="${q.id}"${G}>`});return J=J.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),J=J.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),J=J.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),J=J.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),J}function eZ($){return/x-data\s*=\s*["']/.test($)}import KJ from"fs";import N3 from"path";import{createHighlighter as HJ}from"ts-syntax-highlighter";import Q$ from"fs";import k0 from"path";import{loadConfigWithResult as YJ}from"bunfig";z5();async function $X($,Z,X,J){let Y=Z[0]?.replace(/['"]/g,"")||"main",Q=t$();if(Y!=="main")Q=Q.replace("container:'main'",`container:'${Y}'`);return`<script data-stx-router>${Q}</script>`}var g7={name:"stxRouter",handler:$X,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};function U1($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function h7($){let Z=$.trim().toLowerCase();return!Z.startsWith("javascript:")&&!Z.startsWith("vbscript:")&&!Z.startsWith("data:text/html")}function u7($){let Z=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,X=$.match(Z);if(!X)return{data:{},content:$.trim()};let J=X[1],Y=$.slice(X[0].length),Q={};for(let G of J.split(`
1698
+ `)){let q=G.trim();if(!q||q.startsWith("#"))continue;let U=q.indexOf(":");if(U===-1)continue;let W=q.slice(0,U).trim(),z=q.slice(U+1).trim();if(typeof z==="string"){if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'"))z=z.slice(1,-1);else if(z.startsWith("[")&&z.endsWith("]"))try{z=JSON.parse(z)}catch{}else if(z==="true")z=!0;else if(z==="false")z=!1;else if(/^-?\d+(?:\.\d+)?$/.test(z))z=Number(z)}Q[W]=z}return{data:Q,content:Y.trim()}}function K5($,Z={}){let{gfm:X=!0,breaks:J=!1}=Z,Y=$,Q=[];if(Y=Y.replace(/```(\w*)\n([\s\S]*?)```/g,(z,K,H)=>{let B=Q.length,j=K?` class="language-${U1(K)}"`:"";return Q.push(`<pre><code${j}>${U1(H.trim())}</code></pre>`),`\x00CODEBLOCK${B}\x00`}),Y=Y.replace(/`([^`]*)`/g,(z,K)=>`<code>${U1(K)}</code>`),Y=Y.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),Y=Y.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),Y=Y.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),Y=Y.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),Y=Y.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),Y=Y.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),Y=Y.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),Y=Y.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),Y=Y.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),Y=Y.replace(/__(.+?)__/g,"<strong>$1</strong>"),Y=Y.replace(/\*(.+?)\*/g,"<em>$1</em>"),Y=Y.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),X)Y=Y.replace(/~~(.+?)~~/g,"<del>$1</del>");if(Y=Y.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(z,K,H)=>{return`<img src="${h7(H)?U1(H):""}" alt="${U1(K)}" />`}),Y=Y.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(z,K,H)=>{return`<a href="${h7(H)?U1(H):""}">${K}</a>`}),Y=Y.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),Y=Y.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),Y=Y.replace(/<\/blockquote>\n<blockquote>/g,`
1699
+ `),Y=Y.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),Y=Y.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),Y=Y.replace(/<\/ul>\n<ul>/g,""),Y=Y.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),Y=Y.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),Y=Y.replace(/<\/ol>\n<ol>/g,""),Y=Y.replace(/<li data-ul>/g,"<li>"),Y=Y.replace(/<li data-ol>/g,"<li>"),X)Y=Y.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(z,K,H)=>{let j=`<tr>${K.split("|").map((L)=>L.trim()).filter(Boolean).map((L)=>`<th>${U1(L)}</th>`).join("")}</tr>`,_=H.trim().split(`
1700
+ `).map((L)=>{return`<tr>${L.split("|").map((O)=>O.trim()).filter(Boolean).map((O)=>`<td>${U1(O)}</td>`).join("")}</tr>`}).join(`
1712
1701
  `);return`<table>
1713
1702
  <thead>
1714
1703
  ${j}
@@ -1723,9 +1712,9 @@ ${_}
1723
1712
  `:`
1724
1713
  `)}</p>`);if(Y=q.join(`
1725
1714
  `),J)Y=Y.replace(/\n/g,`<br />
1726
- `);for(let z=0;z<Q.length;z++)Y=Y.replace(`\x00CODEBLOCK${z}\x00`,Q[z]);return Y=Y.replace(/<p>\s*<\/p>/g,""),Y.trim()}async function f7($,Z,X=""){let J=$,Y=[],Q=/@markdown(?:\([^)]*\))?/g,G;while((G=Q.exec($))!==null){let q=G.index,U=G[0].match(/@markdown\(([^)]*)\)/),W=U?U[1]:"",z=q+G[0].length,K=1,H=z,B=-1;while(K>0&&H<$.length){let F=$.indexOf("@markdown",H),V=$.indexOf("@endmarkdown",H);if(V===-1)break;if(F!==-1&&F<V&&F!==q){let O=$[F+9];if(O==="("||O===`
1727
- `||O==="\r"||O===" "||O===void 0)K++;H=F+9}else{if(K--,K===0){B=V;break}H=V+12}}if(B===-1)continue;let j=$.slice(z,B),_=$.slice(q,B+12);Y.push({fullMatch:_,options:W,content:j,index:q}),Q.lastIndex=B+12}for(let{fullMatch:q,options:U,content:W,index:z}of Y)try{let K={};if(U)U.split(",").forEach((j)=>{let _=j.trim();if(_)K[_]=!0});let H={gfm:K.gfm??!0,breaks:K.breaks??!1},B=j5(W.trim(),H);J=J.split(q).join(B)}catch(K){let H=K instanceof Error?K.message:String(K),B=K0("Markdown Directive",`Error processing markdown: ${H}`,X,$,z,q);J=J.split(q).join(B)}return J}async function x7($,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}),j5($.trim(),Y)}var w1=[320,480,640,768,1024,1280,1536,1920,2560],g7=[1,1.5,2,3],d1=["avif","webp","jpeg"],h7={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},mZ={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function _5($,Z=w1,X={},J){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${U1($,{...X,w:Y,fm:J})} ${Y}w`}).join(", ")}function gU($,Z=320,X=2560,J=0.08,Y={},Q){let G=lZ(Z,X,J);return _5($,G,Y,Q)}function lZ($,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 s$($,Z,X=g7,J={},Y){return X.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${U1($,{...J,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function hU($,Z,X=g7,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,U)=>q-U).map((q)=>{let U=Math.round(Z*q),W=G[q]||Math.round(J*Math.max(0.5,1-q*0.1));return`${U1($,{...Y,w:U,q:W,dpr:q,fm:Q})} ${q}x`}).join(", ")}function o$($,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 uU($,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 dU={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 U1($,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 mU($){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 lU($){let{src:Z,widths:X,dprValues:J,fixedWidth:Y,formats:Q=d1,baseUrl:G="",params:q={}}=$,U=[];for(let W of Q){let z,K;if(Y!==void 0&&J)z=s$(Z,Y,J,q,W),K=J.map((H)=>({path:"",url:U1(Z,{...q,w:Math.round(Y*H),fm:W}),width:Math.round(Y*H),height:0,format:W,size:0,dpr:H}));else{let H=X||w1;z=_5(Z,H,q,W),K=H.map((B)=>({path:"",url:U1(Z,{...q,w:B,fm:W}),width:B,height:0,format:W,size:0}))}U.push({srcset:z,format:W,mimeType:h7[W],variants:K})}return U}function cU($,Z="100vw"){return $.map(({srcset:X,mimeType:J})=>`<source type="${J}" srcset="${X}" sizes="${Z}" />`).join(`
1728
- `)}function pU($,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 r$($){return h7[$]||"application/octet-stream"}function iU($){return mZ[$]||$}function nU($){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 cZ={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},a$=`
1715
+ `);for(let z=0;z<Q.length;z++)Y=Y.replace(`\x00CODEBLOCK${z}\x00`,Q[z]);return Y=Y.replace(/<p>\s*<\/p>/g,""),Y.trim()}async function d7($,Z,X=""){let J=$,Y=[],Q=/@markdown(?:\([^)]*\))?/g,G;while((G=Q.exec($))!==null){let q=G.index,U=G[0].match(/@markdown\(([^)]*)\)/),W=U?U[1]:"",z=q+G[0].length,K=1,H=z,B=-1;while(K>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)K++;H=L+9}else{if(K--,K===0){B=V;break}H=V+12}}if(B===-1)continue;let j=$.slice(z,B),_=$.slice(q,B+12);Y.push({fullMatch:_,options:W,content:j,index:q}),Q.lastIndex=B+12}for(let{fullMatch:q,options:U,content:W,index:z}of Y)try{let K={};if(U)U.split(",").forEach((j)=>{let _=j.trim();if(_)K[_]=!0});let H={gfm:K.gfm??!0,breaks:K.breaks??!1},B=K5(W.trim(),H);J=J.split(q).join(B)}catch(K){let H=K instanceof Error?K.message:String(K),B=B0("Markdown Directive",`Error processing markdown: ${H}`,X,$,z,q);J=J.split(q).join(B)}return J}async function m7($,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}),K5($.trim(),Y)}var O1=[320,480,640,768,1024,1280,1536,1920,2560],l7=[1,1.5,2,3],v1=["avif","webp","jpeg"],c7={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},ZX={avif:"avif",webp:"webp",jpeg:"jpg",png:"png",gif:"gif"};function H5($,Z=O1,X={},J){return Z.sort((Y,Q)=>Y-Q).map((Y)=>{return`${W1($,{...X,w:Y,fm:J})} ${Y}w`}).join(", ")}function tU($,Z=320,X=2560,J=0.08,Y={},Q){let G=XX(Z,X,J);return H5($,G,Y,Q)}function XX($,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 e$($,Z,X=l7,J={},Y){return X.sort((Q,G)=>Q-G).map((Q)=>{let G=Math.round(Z*Q);return`${W1($,{...J,w:G,dpr:Q,fm:Y})} ${Q}x`}).join(", ")}function eU($,Z,X=l7,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,U)=>q-U).map((q)=>{let U=Math.round(Z*q),W=G[q]||Math.round(J*Math.max(0.5,1-q*0.1));return`${W1($,{...Y,w:U,q:W,dpr:q,fm:Q})} ${q}x`}).join(", ")}function $3($,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 $W($,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 ZW={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 W1($,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 XW($){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 JW($){let{src:Z,widths:X,dprValues:J,fixedWidth:Y,formats:Q=v1,baseUrl:G="",params:q={}}=$,U=[];for(let W of Q){let z,K;if(Y!==void 0&&J)z=e$(Z,Y,J,q,W),K=J.map((H)=>({path:"",url:W1(Z,{...q,w:Math.round(Y*H),fm:W}),width:Math.round(Y*H),height:0,format:W,size:0,dpr:H}));else{let H=X||O1;z=H5(Z,H,q,W),K=H.map((B)=>({path:"",url:W1(Z,{...q,w:B,fm:W}),width:B,height:0,format:W,size:0}))}U.push({srcset:z,format:W,mimeType:c7[W],variants:K})}return U}function YW($,Z="100vw"){return $.map(({srcset:X,mimeType:J})=>`<source type="${J}" srcset="${X}" sizes="${Z}" />`).join(`
1717
+ `)}function QW($,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 Z3($){return c7[$]||"application/octet-stream"}function GW($){return ZX[$]||$}function qW($){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 JX={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},X3=`
1729
1718
  .stx-img-placeholder {
1730
1719
  position: relative;
1731
1720
  overflow: hidden;
@@ -1754,9 +1743,9 @@ ${_}
1754
1743
  filter: blur(0);
1755
1744
  transform: scale(1);
1756
1745
  }
1757
- `.trim();async function t$(){try{return await import("ts-images")}catch{return null}}async function u7($,Z={}){let X={...cZ,...Z},J=await t$();if(J)try{return await pZ($,X,J)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return d7($,X)}async function pZ($,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 d7($,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 oU($){let Z=await t$();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await d7($,{strategy:"thumbhash",width:32,height:32})).dataURL}function rU($){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,U=(q>>3&63)/63,W=(q>>9&63)/63,z=q>>15!==0,K=Math.max(3,z?G?5:7:G?5:7),H=Math.max(3,z?G?5:7:G?5:7),B=32,j=32,_=Math.max(0,Math.min(255,Math.round((X+J)*255))),F=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">
1758
- <rect fill="rgb(${_},${F},${V})" width="32" height="32"/>
1759
- </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(O)}`}async function aU($,Z=20,X=50){return u7($,{strategy:"blur",width:Z,quality:X,blurLevel:40})}async function tU($){let Z=await t$();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function eU($,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 m7($,Z,X={}){let J=X.transitionDuration||300,Y=X.easing||"ease-out";return`
1746
+ `.trim();async function J3(){try{return await import("ts-images")}catch{return null}}async function p7($,Z={}){let X={...JX,...Z},J=await J3();if(J)try{return await YX($,X,J)}catch(Y){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${Y}`)}return i7($,X)}async function YX($,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 i7($,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 WW($){let Z=await J3();if(Z)try{return(await Z.generateThumbHash($)).dataUrl}catch{}return(await i7($,{strategy:"thumbhash",width:32,height:32})).dataURL}function zW($){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,U=(q>>3&63)/63,W=(q>>9&63)/63,z=q>>15!==0,K=Math.max(3,z?G?5:7:G?5:7),H=Math.max(3,z?G?5:7:G?5:7),B=32,j=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
+ <rect fill="rgb(${_},${L},${V})" width="32" height="32"/>
1748
+ </svg>`;return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(O)}`}async function KW($,Z=20,X=50){return p7($,{strategy:"blur",width:Z,quality:X,blurLevel:40})}async function HW($){let Z=await J3();if(Z)try{return(await Z.generatePlaceholder($,{strategy:"dominant-color"})).dominantColor||"#e5e7eb"}catch{}return"#e5e7eb"}function BW($,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 n7($,Z,X={}){let J=X.transitionDuration||300,Y=X.easing||"ease-out";return`
1760
1749
  #${$} {
1761
1750
  --stx-img-transition-duration: ${J}ms;
1762
1751
  --stx-img-transition-easing: ${Y};
@@ -1773,20 +1762,20 @@ ${_}
1773
1762
  #${$}.stx-img-loaded img {
1774
1763
  opacity: 1;
1775
1764
  }
1776
- `.trim()}function $W($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var m1=new Map;async function l7($,Z={}){let X=`${$}:${JSON.stringify(Z)}`;if(m1.has(X))return m1.get(X);let J=await u7($,Z);return m1.set(X,J),J}function ZW(){m1.clear()}function XW(){return{size:m1.size,keys:Array.from(m1.keys())}}async function iZ(){try{return await import("./chunk-wb7dfcnc.js")}catch($){if(!c7)console.warn("[stx-media] Image processor not available, some features disabled:",$),c7=!0;return null}}var c7=!1,e$=80,c5="async",p5="lazy",p7=!1;async function V5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipOptimization){if(X.tsImagesConfig?.enabled&&!X.isDev)return aZ(J,X)}if(X.processedResult?.processed)return X3($,X.processedResult,Z);if(X.responsiveVariants)return s7($,X.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=w1,dpr:z,formats:K=d1,quality:H=e$,params:B={},placeholder:j="none",placeholderOptions:_={},lazy:F=!0,priority:V=!1,loading:O=V?"eager":p5,decoding:L=c5,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:T}=$,A=$.class,M=$.style,k=$.id,I=$.data||{},{isDev:y=!1,baseUrl:E=""}=Z;if(y&&!Z.optimize)return oZ($);let b,C,h=k||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(j!=="none"&&!V)try{b=await l7(Y,{strategy:j,..._}),C=m7(h,b,_)}catch{}let x=z!==void 0&&G!==void 0,l;if(x)l=sZ($,h,b,Z);else l=await nZ($,h,b,Z);let d;if(V){let D0=K.includes("webp")?"webp":K[0],y0=_5(Y,W,{...B,q:H},D0),X0=typeof U==="object"?o$(U):U||"100vw";d=`<link rel="preload" as="image" imagesrcset="${y0}" imagesizes="${X0}" />`}let _0=[];if(!p7&&j!=="none")_0.push(a$),p7=!0;if(C)_0.push(C);let h0=F?n7(h):void 0;return{html:l,preloadLink:d,css:_0.length>0?_0.join(`
1777
- `):void 0,script:h0}}async function nZ($,Z,X,J){let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=w1,formats:z=d1,quality:K=e$,params:H={},lazy:B=!0,priority:j=!1,loading:_=j?"eager":p5,decoding:F=c5,fetchpriority:V,objectFit:O,objectPosition:L,crossorigin:w,referrerpolicy:R}=$,D=$.class,N=$.style,T=$.data||{},A=typeof U==="object"?o$(U):U||"100vw",M=[];for(let y of z){let E=_5(Y,W,{...H,q:K},y),b=r$(y);if(B&&!j)M.push(` <source type="${b}" data-srcset="${E}" data-sizes="${A}" />`);else M.push(` <source type="${b}" srcset="${E}" sizes="${A}" />`)}let k=$3({src:U1(Y,{...H,q:K}),alt:Q,width:G,height:q,loading:j?void 0:_,decoding:F,fetchpriority:j?"high":V,objectFit:O,objectPosition:L,crossorigin:w,referrerpolicy:R,className:i7(D,X),style:Z3(N,O,L,X),lazy:B&&!j,data:T}),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}">
1765
+ `.trim()}function jW($){return`background-image: url('${$.dataURL}'); background-size: cover; background-position: center;`}var f1=new Map;async function s7($,Z={}){let X=`${$}:${JSON.stringify(Z)}`;if(f1.has(X))return f1.get(X);let J=await p7($,Z);return f1.set(X,J),J}function _W(){f1.clear()}function VW(){return{size:f1.size,keys:Array.from(f1.keys())}}async function QX(){try{return await import("./chunk-f8g0zbm3.js")}catch($){if(!o7)console.warn("[stx-media] Image processor not available, some features disabled:",$),o7=!0;return null}}var o7=!1,Y3=80,n5="async",s5="lazy",r7=!1;async function B5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipOptimization){if(X.tsImagesConfig?.enabled&&!X.isDev)return zX(J,X)}if(X.processedResult?.processed)return q3($,X.processedResult,Z);if(X.responsiveVariants)return e7($,X.responsiveVariants,Z);let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=O1,dpr:z,formats:K=v1,quality:H=Y3,params:B={},placeholder:j="none",placeholderOptions:_={},lazy:L=!0,priority:V=!1,loading:O=V?"eager":s5,decoding:F=n5,fetchpriority:w,objectFit:R,objectPosition:D,crossorigin:N,referrerpolicy:I}=$,A=$.class,M=$.style,T=$.id,k=$.data||{},{isDev:y=!1,baseUrl:E=""}=Z;if(y&&!Z.optimize)return UX($);let b,S,f=T||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(j!=="none"&&!V)try{b=await s7(Y,{strategy:j,..._}),S=n7(f,b,_)}catch{}let g=z!==void 0&&G!==void 0,o;if(g)o=qX($,f,b,Z);else o=await GX($,f,b,Z);let u;if(V){let M0=K.includes("webp")?"webp":K[0],C0=H5(Y,W,{...B,q:H},M0),X0=typeof U==="object"?$3(U):U||"100vw";u=`<link rel="preload" as="image" imagesrcset="${C0}" imagesizes="${X0}" />`}let K0=[];if(!r7&&j!=="none")K0.push(X3),r7=!0;if(S)K0.push(S);let e0=L?t7(f):void 0;return{html:o,preloadLink:u,css:K0.length>0?K0.join(`
1766
+ `):void 0,script:e0}}async function GX($,Z,X,J){let{src:Y,alt:Q,width:G,height:q,sizes:U,widths:W=O1,formats:z=v1,quality:K=Y3,params:H={},lazy:B=!0,priority:j=!1,loading:_=j?"eager":s5,decoding:L=n5,fetchpriority:V,objectFit:O,objectPosition:F,crossorigin:w,referrerpolicy:R}=$,D=$.class,N=$.style,I=$.data||{},A=typeof U==="object"?$3(U):U||"100vw",M=[];for(let y of z){let E=H5(Y,W,{...H,q:K},y),b=Z3(y);if(B&&!j)M.push(` <source type="${b}" data-srcset="${E}" data-sizes="${A}" />`);else M.push(` <source type="${b}" srcset="${E}" sizes="${A}" />`)}let T=Q3({src:W1(Y,{...H,q:K}),alt:Q,width:G,height:q,loading:j?void 0:_,decoding:L,fetchpriority:j?"high":V,objectFit:O,objectPosition:F,crossorigin:w,referrerpolicy:R,className:a7(D,X),style:G3(N,O,F,X),lazy:B&&!j,data:I}),k;if(X){let y=`background-image: url('${X.dataURL}'); background-size: cover; background-position: center;`;k=`<div id="${Z}" class="stx-img-placeholder" style="${y}">
1778
1767
  <picture>
1779
1768
  ${M.join(`
1780
1769
  `)}
1781
- <img ${k} />
1770
+ <img ${T} />
1782
1771
  </picture>
1783
- </div>`}else I=`<picture${Z?` id="${Z}"`:""}>
1772
+ </div>`}else k=`<picture${Z?` id="${Z}"`:""}>
1784
1773
  ${M.join(`
1785
1774
  `)}
1786
- <img ${k} />
1787
- </picture>`;return I}function sZ($,Z,X,J){let{src:Y,alt:Q,width:G,height:q,dpr:U=[1,2,3],quality:W=e$,params:z={},lazy:K=!0,priority:H=!1,loading:B=H?"eager":p5,decoding:j=c5,fetchpriority:_,objectFit:F,objectPosition:V,crossorigin:O,referrerpolicy:L}=$,w=$.class,R=$.style,D=$.data||{},N=typeof G==="number"?G:Number.parseInt(String(G),10),T=s$(Y,N,U,{...z,q:W}),A=$3({src:U1(Y,{...z,w:N,q:W}),alt:Q,width:G,height:q,loading:H?void 0:B,decoding:j,fetchpriority:H?"high":_,objectFit:F,objectPosition:V,crossorigin:O,referrerpolicy:L,className:i7(w,X),style:Z3(R,F,V,X),lazy:K&&!H,data:D}),M=K&&!H?`data-srcset="${T}"`:`srcset="${T}"`;if(X){let k=`background-image: url('${X.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${Z}" class="stx-img-placeholder" style="${k}">
1775
+ <img ${T} />
1776
+ </picture>`;return k}function qX($,Z,X,J){let{src:Y,alt:Q,width:G,height:q,dpr:U=[1,2,3],quality:W=Y3,params:z={},lazy:K=!0,priority:H=!1,loading:B=H?"eager":s5,decoding:j=n5,fetchpriority:_,objectFit:L,objectPosition:V,crossorigin:O,referrerpolicy:F}=$,w=$.class,R=$.style,D=$.data||{},N=typeof G==="number"?G:Number.parseInt(String(G),10),I=e$(Y,N,U,{...z,q:W}),A=Q3({src:W1(Y,{...z,w:N,q:W}),alt:Q,width:G,height:q,loading:H?void 0:B,decoding:j,fetchpriority:H?"high":_,objectFit:L,objectPosition:V,crossorigin:O,referrerpolicy:F,className:a7(w,X),style:G3(R,L,V,X),lazy:K&&!H,data:D}),M=K&&!H?`data-srcset="${I}"`:`srcset="${I}"`;if(X){let T=`background-image: url('${X.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${Z}" class="stx-img-placeholder" style="${T}">
1788
1777
  <img ${A} ${M} />
1789
- </div>`}return`<img ${Z?`id="${Z}" `:""}${A} ${M} />`}function oZ($){let{src:Z,alt:X,width:J,height:Y,loading:Q=p5,decoding:G=c5,fetchpriority:q,objectFit:U,objectPosition:W,crossorigin:z,referrerpolicy:K,priority:H=!1}=$,B=$.class,j=$.style,_=$.id,F=$.data||{};return{html:`<img ${$3({src:Z,alt:X,width:J,height:Y,loading:H?"eager":Q,decoding:G,fetchpriority:H?"high":q,objectFit:U,objectPosition:W,crossorigin:z,referrerpolicy:K,className:B,style:Z3(j,U,W),id:_,data:F})} />`}}function $3($){let Z=[];if($.lazy)Z.push(`data-src="${m0($.src)}"`),Z.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else Z.push(`src="${m0($.src)}"`);if(Z.push(`alt="${m0($.alt)}"`),$.width)Z.push(`width="${$.width}"`);if($.height)Z.push(`height="${$.height}"`);if($.loading)Z.push(`loading="${$.loading}"`);if($.decoding)Z.push(`decoding="${$.decoding}"`);if($.fetchpriority)Z.push(`fetchpriority="${$.fetchpriority}"`);if($.crossorigin)Z.push(`crossorigin="${$.crossorigin}"`);if($.referrerpolicy)Z.push(`referrerpolicy="${$.referrerpolicy}"`);if($.className)Z.push(`class="${m0($.className)}"`);if($.style)Z.push(`style="${m0($.style)}"`);if($.id)Z.push(`id="${m0($.id)}"`);if($.data)for(let[X,J]of Object.entries($.data))Z.push(`data-${X}="${m0(J)}"`);if($.lazy)Z.push("data-stx-lazy");return Z.join(" ")}function i7($,Z){let X=[];if($)X.push($);if(Z)X.push("stx-img-blur");return X.join(" ")||""}function Z3($,Z,X,J){let Y=[];if(Z)Y.push(`object-fit: ${Z}`);if(X)Y.push(`object-position: ${X}`);if(J)Y.push("opacity: 0; transition: opacity 300ms ease-out");if($)Y.push($);return Y.join("; ")}function m0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function n7($){return`
1778
+ </div>`}return`<img ${Z?`id="${Z}" `:""}${A} ${M} />`}function UX($){let{src:Z,alt:X,width:J,height:Y,loading:Q=s5,decoding:G=n5,fetchpriority:q,objectFit:U,objectPosition:W,crossorigin:z,referrerpolicy:K,priority:H=!1}=$,B=$.class,j=$.style,_=$.id,L=$.data||{};return{html:`<img ${Q3({src:Z,alt:X,width:J,height:Y,loading:H?"eager":Q,decoding:G,fetchpriority:H?"high":q,objectFit:U,objectPosition:W,crossorigin:z,referrerpolicy:K,className:B,style:G3(j,U,W),id:_,data:L})} />`}}function Q3($){let Z=[];if($.lazy)Z.push(`data-src="${p0($.src)}"`),Z.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else Z.push(`src="${p0($.src)}"`);if(Z.push(`alt="${p0($.alt)}"`),$.width)Z.push(`width="${$.width}"`);if($.height)Z.push(`height="${$.height}"`);if($.loading)Z.push(`loading="${$.loading}"`);if($.decoding)Z.push(`decoding="${$.decoding}"`);if($.fetchpriority)Z.push(`fetchpriority="${$.fetchpriority}"`);if($.crossorigin)Z.push(`crossorigin="${$.crossorigin}"`);if($.referrerpolicy)Z.push(`referrerpolicy="${$.referrerpolicy}"`);if($.className)Z.push(`class="${p0($.className)}"`);if($.style)Z.push(`style="${p0($.style)}"`);if($.id)Z.push(`id="${p0($.id)}"`);if($.data)for(let[X,J]of Object.entries($.data))Z.push(`data-${X}="${p0(J)}"`);if($.lazy)Z.push("data-stx-lazy");return Z.join(" ")}function a7($,Z){let X=[];if($)X.push($);if(Z)X.push("stx-img-blur");return X.join(" ")||""}function G3($,Z,X,J){let Y=[];if(Z)Y.push(`object-fit: ${Z}`);if(X)Y.push(`object-position: ${X}`);if(J)Y.push("opacity: 0; transition: opacity 300ms ease-out");if($)Y.push($);return Y.join("; ")}function p0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t7($){return`
1790
1779
  (function() {
1791
1780
  const container = document.getElementById('${$}');
1792
1781
  if (!container) return;
@@ -1823,22 +1812,22 @@ ${M.join(`
1823
1812
 
1824
1813
  observer.observe(container);
1825
1814
  })();
1826
- `.trim()}function rZ($){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,U,W,z]=Q,K=U??W??z??!0;if(G===":"&&typeof K==="string")try{J[q]=JSON.parse(K)}catch{J[q]=K}else switch(q){case"src":J.src=String(K);break;case"alt":J.alt=String(K);break;case"width":J.width=Number(K)||K;break;case"height":J.height=Number(K)||K;break;case"sizes":J.sizes=String(K);break;case"quality":J.quality=Number(K);break;case"placeholder":J.placeholder=K;break;case"lazy":J.lazy=K===!0||K==="true";break;case"priority":J.priority=K===!0||K==="true";break;case"class":J.class=String(K);break;case"style":J.style=String(K);break;case"id":J.id=String(K);break;case"loading":J.loading=K;break;case"decoding":J.decoding=K;break;case"fetchpriority":J.fetchpriority=K;break;case"objectFit":J.objectFit=K;break;case"objectPosition":J.objectPosition=String(K);break;case"crossorigin":J.crossorigin=K;break}}if(!J.src||!J.alt)return null;return J}async function GW($,Z={}){let X=/<Img\s+[^>]*?\/?>/g,J=[],Y=[],Q=[],G=$,q=[],U;while((U=X.exec($))!==null)q.push({match:U[0],index:U.index});for(let W=q.length-1;W>=0;W--){let{match:z}=q[W],K=rZ(z);if(K){let H=await V5(K,Z);if(G=G.replace(z,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 aZ($,Z){let X=await iZ();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 s7($,Q,Z)}else{let Q=await X.processImage($.src,$,J);if(Q.processed)return X3($,Q,Z)}return V5({...$,process:!1},Z)}async function X3($,Z,X){let{alt:J,width:Y,height:Q,lazy:G=!0,priority:q=!1,objectFit:U,objectPosition:W,crossorigin:z,referrerpolicy:K}=$,H=$.class,B=$.style,j=$.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,_=$.data||{},F=Z.variants||[],V=F.find((C)=>C.format==="jpeg")||F.find((C)=>C.format==="webp")||F[0],O=V?.url||$.src,L=F.filter((C)=>C.format===(V?.format||"jpeg")).map((C)=>`${C.url} ${C.width}w`).join(", "),w=new Map;for(let C of F){if(!w.has(C.format))w.set(C.format,[]);w.get(C.format).push(C)}let R=[],D=["avif","webp","jpeg","png"];for(let C of D){let h=w.get(C);if(h&&h.length>0){let x=h.map((d)=>`${d.url} ${d.width}w`).join(", "),l=r$(C);if(G&&!q)R.push(` <source type="${l}" data-srcset="${x}" />`);else R.push(` <source type="${l}" srcset="${x}" />`)}}let N=[];if(G&&!q){if(N.push(`data-src="${m0(O)}"`),N.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),L)N.push(`data-srcset="${L}"`)}else if(N.push(`src="${m0(O)}"`),L)N.push(`srcset="${L}"`);N.push(`alt="${m0(J)}"`);let T=Y||Z.originalWidth,A=Q||Z.originalHeight;if(T)N.push(`width="${T}"`);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(z)N.push(`crossorigin="${z}"`);if(K)N.push(`referrerpolicy="${K}"`);let M=[];if(U)M.push(`object-fit: ${U}`);if(W)M.push(`object-position: ${W}`);if(Z.placeholder&&G)M.push("opacity: 0; transition: opacity 300ms ease-out");if(B)M.push(B);if(M.length>0)N.push(`style="${M.join("; ")}"`);let k=[];if(H)k.push(H);if(Z.placeholder)k.push("stx-img-blur");if(k.length>0)N.push(`class="${k.join(" ")}"`);if(G&&!q)N.push("data-stx-lazy");for(let[C,h]of Object.entries(_))N.push(`data-${C}="${m0(h)}"`);let I;if(Z.placeholder||Z.dominantColor&&$.useDominantColor){let C=Z.placeholder?`background-image: url('${Z.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${Z.dominantColor};`;I=`<div id="${j}" class="stx-img-placeholder" style="${C}">
1815
+ `.trim()}function WX($){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,U,W,z]=Q,K=U??W??z??!0;if(G===":"&&typeof K==="string")try{J[q]=JSON.parse(K)}catch{J[q]=K}else switch(q){case"src":J.src=String(K);break;case"alt":J.alt=String(K);break;case"width":J.width=Number(K)||K;break;case"height":J.height=Number(K)||K;break;case"sizes":J.sizes=String(K);break;case"quality":J.quality=Number(K);break;case"placeholder":J.placeholder=K;break;case"lazy":J.lazy=K===!0||K==="true";break;case"priority":J.priority=K===!0||K==="true";break;case"class":J.class=String(K);break;case"style":J.style=String(K);break;case"id":J.id=String(K);break;case"loading":J.loading=K;break;case"decoding":J.decoding=K;break;case"fetchpriority":J.fetchpriority=K;break;case"objectFit":J.objectFit=K;break;case"objectPosition":J.objectPosition=String(K);break;case"crossorigin":J.crossorigin=K;break}}if(!J.src||!J.alt)return null;return J}async function wW($,Z={}){let X=/<Img\s+[^>]*?\/?>/g,J=[],Y=[],Q=[],G=$,q=[],U;while((U=X.exec($))!==null)q.push({match:U[0],index:U.index});for(let W=q.length-1;W>=0;W--){let{match:z}=q[W],K=WX(z);if(K){let H=await B5(K,Z);if(G=G.replace(z,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 zX($,Z){let X=await QX();if(!X)return B5({...$,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 e7($,Q,Z)}else{let Q=await X.processImage($.src,$,J);if(Q.processed)return q3($,Q,Z)}return B5({...$,process:!1},Z)}async function q3($,Z,X){let{alt:J,width:Y,height:Q,lazy:G=!0,priority:q=!1,objectFit:U,objectPosition:W,crossorigin:z,referrerpolicy:K}=$,H=$.class,B=$.style,j=$.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 f=w.get(S);if(f&&f.length>0){let g=f.map((u)=>`${u.url} ${u.width}w`).join(", "),o=Z3(S);if(G&&!q)R.push(` <source type="${o}" data-srcset="${g}" />`);else R.push(` <source type="${o}" srcset="${g}" />`)}}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 I=Y||Z.originalWidth,A=Q||Z.originalHeight;if(I)N.push(`width="${I}"`);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(z)N.push(`crossorigin="${z}"`);if(K)N.push(`referrerpolicy="${K}"`);let M=[];if(U)M.push(`object-fit: ${U}`);if(W)M.push(`object-position: ${W}`);if(Z.placeholder&&G)M.push("opacity: 0; transition: opacity 300ms ease-out");if(B)M.push(B);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,f]of Object.entries(_))N.push(`data-${S}="${p0(f)}"`);let k;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};`;k=`<div id="${j}" class="stx-img-placeholder" style="${S}">
1827
1816
  <picture>
1828
1817
  ${R.join(`
1829
1818
  `)}
1830
1819
  <img ${N.join(" ")} />
1831
1820
  </picture>
1832
- </div>`}else I=`<picture${j?` id="${j}"`:""}>
1821
+ </div>`}else k=`<picture${j?` id="${j}"`:""}>
1833
1822
  ${R.join(`
1834
1823
  `)}
1835
1824
  <img ${N.join(" ")} />
1836
- </picture>`;let y=[];if(Z.placeholder)y.push(a$);let E=G?n7(j):void 0,b;if(q&&L)b=`<link rel="preload" as="image" imagesrcset="${L}" />`;return{html:I,preloadLink:b,css:y.length>0?y.join(`
1837
- `):void 0,script:E}}async function s7($,Z,X){let J={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Y,Q]of Object.entries(Z.byFormat))if(Q)J.variants.push(...Q);return X3($,J,X)}function tZ(){return i5({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,X,J)=>{let{src:Y,alt:Q,options:G}=eZ($,Z,X);if(!Y)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let q={src:Y,alt:Q||"",widths:G.widths||w1,formats:G.formats||d1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},U=X.__isDev||!1,W=await V5(q,{isDev:U}),z=W.html;if(W.preloadLink)z=W.preloadLink+`
1825
+ </picture>`;let y=[];if(Z.placeholder)y.push(X3);let E=G?t7(j):void 0,b;if(q&&F)b=`<link rel="preload" as="image" imagesrcset="${F}" />`;return{html:k,preloadLink:b,css:y.length>0?y.join(`
1826
+ `):void 0,script:E}}async function e7($,Z,X){let J={src:Z.src,processed:!0,variants:[],placeholder:Z.placeholder?.dataURL,originalWidth:Z.placeholder?.width,originalHeight:Z.placeholder?.height};for(let[Y,Q]of Object.entries(Z.byFormat))if(Q)J.variants.push(...Q);return q3($,J,X)}function KX(){return o5({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async($,Z,X,J)=>{let{src:Y,alt:Q,options:G}=HX($,Z,X);if(!Y)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let q={src:Y,alt:Q||"",widths:G.widths||O1,formats:G.formats||v1,quality:G.quality,sizes:G.sizes,dpr:G.dpr,params:G.params,placeholder:G.placeholder,placeholderOptions:G.placeholderOptions,lazy:G.lazy!==!1,priority:G.priority||!1,loading:G.loading,decoding:G.decoding,fetchpriority:G.fetchpriority,objectFit:G.objectFit,objectPosition:G.objectPosition,class:G.class,style:G.style,id:G.id,width:G.width,height:G.height},U=X.__isDev||!1,W=await B5(q,{isDev:U}),z=W.html;if(W.preloadLink)z=W.preloadLink+`
1838
1827
  `+z;if(W.css)z+=`
1839
1828
  <style>${W.css}</style>`;if(W.script)z+=`
1840
- <script>${W.script}</script>`;return z},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function eZ($,Z,X){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let J=$.trim();if(J.startsWith("@img(")||J.startsWith("("))J=J.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=$X(J),Q=J3(Y[0],X)||"",G=J3(Y[1],X)||"",q={};if(Y[2]){let U=J3(Y[2],X);if(typeof U==="object"&&U!==null)q=U;else if(typeof Y[2]==="string")try{q=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:q}}function $X($){let Z=[],X="",J=!1,Y="",Q=0,G=0;for(let q=0;q<$.length;q++){let U=$[q],W=q>0?$[q-1]:"";if((U==='"'||U==="'"||U==="`")&&W!=="\\"){if(!J)J=!0,Y=U;else if(U===Y)J=!1,Y="";else X+=U;continue}if(!J){if(U==="{")Q++;if(U==="}")Q--;if(U==="[")G++;if(U==="]")G--;if(U===","&&Q===0&&G===0){Z.push(X.trim()),X="";continue}}X+=U}if(X.trim())Z.push(X.trim());return Z}function J3($,Z){if(typeof $!=="string")return $;let X=$.trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))return X.slice(1,-1);if(!X.startsWith("/")&&!X.startsWith(".")&&!X.startsWith("http")&&!X.startsWith("{")){let J=Z[X];if(J!==void 0)return J}if(X.startsWith("{")||X.startsWith("["))try{return JSON.parse(X)}catch{}return X}var o7=tZ();async function a7(){try{return await import("./chunk-3rnc94mp.js")}catch($){if(!r7)console.warn("[stx-media] Video processor not available, some features disabled:",$),r7=!0;return null}}var r7=!1,t7=!0,e7="metadata",ZX="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function n5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipProcessing){if(X.tsVideosConfig?.enabled&&!X.isDev)return GX(J,X)}if(X.processedResult?.processed)return Z6($,X.processedResult,Z);let Y;if(J.generatePoster&&J.src&&!$.poster)Y=await qX(J,X);let{src:Q,sources:G=[],poster:q,posterPlaceholder:U,controls:W=t7,autoplay:z=!1,muted:K=!1,loop:H=!1,preload:B=e7,playsinline:j=!0,lazy:_=!0,player:F="native",type:V,width:O,height:L,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,N=Y||q,T=$.class,A=$.style,M=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(F==="ts-video")return JX($,Z);if(V&&V!=="video")return XX(Q||"",V,$);let k=G.length>0?G:Q?[{src:Q,type:$6(Q)}]:[],I=[`id="${M}"`];if(W)I.push("controls");if(z)I.push("autoplay");if(K)I.push("muted");if(H)I.push("loop");if(j)I.push("playsinline");if(R)I.push("disablepictureinpicture");if(D)I.push("disableremoteplayback");if(w)I.push(`crossorigin="${w}"`);if(_){if(I.push(`data-preload="${B}"`),I.push('preload="none"'),N)I.push(`data-poster="${R0(N)}"`);I.push("data-stx-lazy")}else if(I.push(`preload="${B}"`),N)I.push(`poster="${R0(N)}"`);if(O)I.push(`width="${O}"`);if(L)I.push(`height="${L}"`);if(T)I.push(`class="${R0(T)}"`);if(A)I.push(`style="${R0(A)}"`);let y=k.map((C)=>{return` <source ${_?`data-src="${R0(C.src)}"`:`src="${R0(C.src)}"`} type="${C.type}"${C.media?` media="${C.media}"`:""} />`}).join(`
1841
- `),E=`<video ${I.join(" ")}>
1829
+ <script>${W.script}</script>`;return z},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function HX($,Z,X){if(Z.src)return{src:String(Z.src),alt:String(Z.alt||""),options:Z.options||{}};let J=$.trim();if(J.startsWith("@img(")||J.startsWith("("))J=J.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=BX(J),Q=U3(Y[0],X)||"",G=U3(Y[1],X)||"",q={};if(Y[2]){let U=U3(Y[2],X);if(typeof U==="object"&&U!==null)q=U;else if(typeof Y[2]==="string")try{q=JSON.parse(Y[2])}catch{}}return{src:Q,alt:G,options:q}}function BX($){let Z=[],X="",J=!1,Y="",Q=0,G=0;for(let q=0;q<$.length;q++){let U=$[q],W=q>0?$[q-1]:"";if((U==='"'||U==="'"||U==="`")&&W!=="\\"){if(!J)J=!0,Y=U;else if(U===Y)J=!1,Y="";else X+=U;continue}if(!J){if(U==="{")Q++;if(U==="}")Q--;if(U==="[")G++;if(U==="]")G--;if(U===","&&Q===0&&G===0){Z.push(X.trim()),X="";continue}}X+=U}if(X.trim())Z.push(X.trim());return Z}function U3($,Z){if(typeof $!=="string")return $;let X=$.trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))return X.slice(1,-1);if(!X.startsWith("/")&&!X.startsWith(".")&&!X.startsWith("http")&&!X.startsWith("{")){let J=Z[X];if(J!==void 0)return J}if(X.startsWith("{")||X.startsWith("["))try{return JSON.parse(X)}catch{}return X}var $6=KX();async function X6(){try{return await import("./chunk-2x9s5z8x.js")}catch($){if(!Z6)console.warn("[stx-media] Video processor not available, some features disabled:",$),Z6=!0;return null}}var Z6=!1,J6=!0,Y6="metadata",jX="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function r5($,Z={}){let X=Z,J=$;if(J.process&&!J.skipProcessing){if(X.tsVideosConfig?.enabled&&!X.isDev)return LX(J,X)}if(X.processedResult?.processed)return G6($,X.processedResult,Z);let Y;if(J.generatePoster&&J.src&&!$.poster)Y=await wX(J,X);let{src:Q,sources:G=[],poster:q,posterPlaceholder:U,controls:W=J6,autoplay:z=!1,muted:K=!1,loop:H=!1,preload:B=Y6,playsinline:j=!0,lazy:_=!0,player:L="native",type:V,width:O,height:F,crossorigin:w,disablePictureInPicture:R=!1,disableRemotePlayback:D=!1}=$,N=Y||q,I=$.class,A=$.style,M=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(L==="ts-video")return VX($,Z);if(V&&V!=="video")return _X(Q||"",V,$);let T=G.length>0?G:Q?[{src:Q,type:Q6(Q)}]:[],k=[`id="${M}"`];if(W)k.push("controls");if(z)k.push("autoplay");if(K)k.push("muted");if(H)k.push("loop");if(j)k.push("playsinline");if(R)k.push("disablepictureinpicture");if(D)k.push("disableremoteplayback");if(w)k.push(`crossorigin="${w}"`);if(_){if(k.push(`data-preload="${B}"`),k.push('preload="none"'),N)k.push(`data-poster="${R0(N)}"`);k.push("data-stx-lazy")}else if(k.push(`preload="${B}"`),N)k.push(`poster="${R0(N)}"`);if(O)k.push(`width="${O}"`);if(F)k.push(`height="${F}"`);if(I)k.push(`class="${R0(I)}"`);if(A)k.push(`style="${R0(A)}"`);let y=T.map((S)=>{return` <source ${_?`data-src="${R0(S.src)}"`:`src="${R0(S.src)}"`} type="${S.type}"${S.media?` media="${S.media}"`:""} />`}).join(`
1830
+ `),E=`<video ${k.join(" ")}>
1842
1831
  ${y}
1843
1832
  Your browser does not support the video tag.
1844
1833
  </video>`,b;if(_)b=`
@@ -1876,11 +1865,11 @@ ${y}
1876
1865
 
1877
1866
  observer.observe(video);
1878
1867
  })();
1879
- `.trim();return{html:E,script:b}}function XX($,Z,X){let{width:J=640,height:Y=360}=X,Q=X.class,G=X.style,q=X.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,U,W=null;switch(Z){case"youtube":W=YX($),U=W?`https://www.youtube-nocookie.com/embed/${W}`:$;break;case"vimeo":W=QX($),U=W?`https://player.vimeo.com/video/${W}`:$;break;case"dailymotion":W=$.split("/").pop()||"",U=`https://www.dailymotion.com/embed/video/${W}`;break;case"twitch":W=$.split("/").pop()||"",U=`https://player.twitch.tv/?video=${W}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:U=$}let z=[`id="${q}"`,`src="${R0(U)}"`,`width="${J}"`,`height="${Y}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(Q)z.push(`class="${R0(Q)}"`);if(G)z.push(`style="${R0(G)}"`);if(X.lazy)z.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
1868
+ `.trim();return{html:E,script:b}}function _X($,Z,X){let{width:J=640,height:Y=360}=X,Q=X.class,G=X.style,q=X.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,U,W=null;switch(Z){case"youtube":W=OX($),U=W?`https://www.youtube-nocookie.com/embed/${W}`:$;break;case"vimeo":W=FX($),U=W?`https://player.vimeo.com/video/${W}`:$;break;case"dailymotion":W=$.split("/").pop()||"",U=`https://www.dailymotion.com/embed/video/${W}`;break;case"twitch":W=$.split("/").pop()||"",U=`https://player.twitch.tv/?video=${W}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:U=$}let z=[`id="${q}"`,`src="${R0(U)}"`,`width="${J}"`,`height="${Y}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(Q)z.push(`class="${R0(Q)}"`);if(G)z.push(`style="${R0(G)}"`);if(X.lazy)z.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
1880
1869
  <iframe ${z.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
1881
- </div>`}}function JX($,Z={}){let{src:X,sources:J=[],poster:Y,controls:Q=!0,autoplay:G=!1,muted:q=!1,loop:U=!1,preload:W="metadata",playsinline:z=!0,lazy:K=!0,width:H,height:B}=$,j=$.class,_=$.style,F=$.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,V={src:J.length>0?J:X,autoplay:G,loop:U,muted:q,playsinline:z,preload:W,poster:Y,controls:Q,title:$.title},O=["position: relative",H?`width: ${typeof H==="number"?H+"px":H}`:"width: 100%",B?`height: ${typeof B==="number"?B+"px":B}`:"",_||""].filter(Boolean).join("; "),L=`
1870
+ </div>`}}function VX($,Z={}){let{src:X,sources:J=[],poster:Y,controls:Q=!0,autoplay:G=!1,muted:q=!1,loop:U=!1,preload:W="metadata",playsinline:z=!0,lazy:K=!0,width:H,height:B}=$,j=$.class,_=$.style,L=$.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,V={src:J.length>0?J:X,autoplay:G,loop:U,muted:q,playsinline:z,preload:W,poster:Y,controls:Q,title:$.title},O=["position: relative",H?`width: ${typeof H==="number"?H+"px":H}`:"width: 100%",B?`height: ${typeof B==="number"?B+"px":B}`:"",_||""].filter(Boolean).join("; "),F=`
1882
1871
  <div
1883
- id="${F}"
1872
+ id="${L}"
1884
1873
  class="ts-video-player${j?" "+R0(j):""}"
1885
1874
  style="${O}"
1886
1875
  data-ts-video-player
@@ -1901,7 +1890,7 @@ ${y}
1901
1890
  </div>
1902
1891
  `.trim(),w=`
1903
1892
  (function() {
1904
- var container = document.getElementById('${F}');
1893
+ var container = document.getElementById('${L}');
1905
1894
  if (!container) return;
1906
1895
 
1907
1896
  var config = JSON.parse(container.dataset.config || '{}');
@@ -1915,7 +1904,7 @@ ${y}
1915
1904
 
1916
1905
  // Load ts-video-player from CDN
1917
1906
  var script = document.createElement('script');
1918
- script.src = '${ZX}';
1907
+ script.src = '${jX}';
1919
1908
  script.onload = initPlayer;
1920
1909
  script.onerror = function() {
1921
1910
  console.error('[stx] Failed to load ts-video-player');
@@ -2045,12 +2034,12 @@ else {
2045
2034
  .ts-video-player__play-button svg {
2046
2035
  margin-left: 4px;
2047
2036
  }
2048
- `.trim();return{html:L,script:w,css:R}}function $6($){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 YX($){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 QX($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function R0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function HW($,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 GX($,Z){let X=await a7();if(!X)return n5({...$,process:!1},Z);let J=Z.tsVideosConfig,Y=await X.processVideo($.src,$,J,$.onProcessProgress);if(Y.processed)return Z6($,Y,Z);return n5({...$,process:!1},Z)}async function qX($,Z){let X=await a7();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=t7,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:q=e7,playsinline:U=!0,lazy:W=!0,width:z,height:K,crossorigin:H,disablePictureInPicture:B=!1,disableRemotePlayback:j=!1}=$,_=$.class,F=$.style,V=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,O=$.src,L=$6(O);if(Z.transcoded)O=Z.transcoded.url,L="video/mp4";let w=Z.streaming?.hls||Z.streaming?.dash;if(w){if(Z.streaming?.hls)O=Z.streaming.hls.manifestUrl,L="application/x-mpegURL";else if(Z.streaming?.dash)O=Z.streaming.dash.manifestUrl,L="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(U)D.push("playsinline");if(B)D.push("disablepictureinpicture");if(j)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(W){if(D.push(`data-preload="${q}"`),D.push('preload="none"'),R)D.push(`data-poster="${R0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${q}"`),R)D.push(`poster="${R0(R)}"`);let N=z||Z.metadata?.width,T=K||Z.metadata?.height;if(N)D.push(`width="${N}"`);if(T)D.push(`height="${T}"`);if(_)D.push(`class="${R0(_)}"`);if(F)D.push(`style="${R0(F)}"`);let M=` <source ${W?`data-src="${R0(O)}"`:`src="${R0(O)}"`} type="${L}" />`,k=`<video ${D.join(" ")}>
2037
+ `.trim();return{html:F,script:w,css:R}}function Q6($){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 OX($){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 FX($){let Z=$.match(/vimeo\.com\/(\d+)/);return Z?Z[1]:null}function R0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function IW($,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 LX($,Z){let X=await X6();if(!X)return r5({...$,process:!1},Z);let J=Z.tsVideosConfig,Y=await X.processVideo($.src,$,J,$.onProcessProgress);if(Y.processed)return G6($,Y,Z);return r5({...$,process:!1},Z)}async function wX($,Z){let X=await X6();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 G6($,Z,X){let{controls:J=J6,autoplay:Y=!1,muted:Q=!1,loop:G=!1,preload:q=Y6,playsinline:U=!0,lazy:W=!0,width:z,height:K,crossorigin:H,disablePictureInPicture:B=!1,disableRemotePlayback:j=!1}=$,_=$.class,L=$.style,V=$.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,O=$.src,F=Q6(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(U)D.push("playsinline");if(B)D.push("disablepictureinpicture");if(j)D.push("disableremoteplayback");if(H)D.push(`crossorigin="${H}"`);if(W){if(D.push(`data-preload="${q}"`),D.push('preload="none"'),R)D.push(`data-poster="${R0(R)}"`);D.push("data-stx-lazy")}else if(D.push(`preload="${q}"`),R)D.push(`poster="${R0(R)}"`);let N=z||Z.metadata?.width,I=K||Z.metadata?.height;if(N)D.push(`width="${N}"`);if(I)D.push(`height="${I}"`);if(_)D.push(`class="${R0(_)}"`);if(L)D.push(`style="${R0(L)}"`);let M=` <source ${W?`data-src="${R0(O)}"`:`src="${R0(O)}"`} type="${F}" />`,T=`<video ${D.join(" ")}>
2049
2038
  ${M}
2050
2039
  Your browser does not support the video tag.
2051
- </video>`;if(Z.spriteSheet)k=`<div class="stx-video-wrapper" data-sprite-sheet="${R0(Z.spriteSheet.url)}" data-sprite-cols="${Z.spriteSheet.columns}" data-sprite-interval="${Z.spriteSheet.interval}">
2052
- ${k}
2053
- </div>`;let I;if(W)I=`
2040
+ </video>`;if(Z.spriteSheet)T=`<div class="stx-video-wrapper" data-sprite-sheet="${R0(Z.spriteSheet.url)}" data-sprite-cols="${Z.spriteSheet.columns}" data-sprite-interval="${Z.spriteSheet.interval}">
2041
+ ${T}
2042
+ </div>`;let k;if(W)k=`
2054
2043
  (function() {
2055
2044
  var video = document.getElementById('${V}');
2056
2045
  if (!video) return;
@@ -2094,88 +2083,88 @@ ${k}
2094
2083
  width: 100%;
2095
2084
  height: auto;
2096
2085
  }
2097
- `.trim();return{html:k,script:I,css:y}}function X6(){return i5({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async($,Z,X,J)=>{let{src:Y,options:Q}=UX($,Z,X);if(!Y)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Y,poster:Q.poster,controls:Q.controls!==!1,autoplay:Q.autoplay||!1,muted:Q.muted||!1,loop:Q.loop||!1,preload:Q.preload||"metadata",playsinline:Q.playsinline!==!1,lazy:Q.lazy!==!1,player:Q.player||"native",type:Q.type,width:Q.width,height:Q.height,class:Q.class,style:Q.style,id:Q.id,crossorigin:Q.crossorigin,disablePictureInPicture:Q.disablePictureInPicture,disableRemotePlayback:Q.disableRemotePlayback,title:Q.title,quality:Q.quality,platform:Q.platform,process:Q.process,generatePoster:Q.generatePoster,streaming:Q.streaming,transcode:Q.transcode,spriteSheet:Q.spriteSheet,waveform:Q.waveform},U={isDev:X.__isDev||!1,tsVideosConfig:X.__tsVideosConfig},W=await n5(G,U),z=W.html;if(W.css)z+=`
2086
+ `.trim();return{html:T,script:k,css:y}}function q6(){return o5({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async($,Z,X,J)=>{let{src:Y,options:Q}=RX($,Z,X);if(!Y)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let G={src:Y,poster:Q.poster,controls:Q.controls!==!1,autoplay:Q.autoplay||!1,muted:Q.muted||!1,loop:Q.loop||!1,preload:Q.preload||"metadata",playsinline:Q.playsinline!==!1,lazy:Q.lazy!==!1,player:Q.player||"native",type:Q.type,width:Q.width,height:Q.height,class:Q.class,style:Q.style,id:Q.id,crossorigin:Q.crossorigin,disablePictureInPicture:Q.disablePictureInPicture,disableRemotePlayback:Q.disableRemotePlayback,title:Q.title,quality:Q.quality,platform:Q.platform,process:Q.process,generatePoster:Q.generatePoster,streaming:Q.streaming,transcode:Q.transcode,spriteSheet:Q.spriteSheet,waveform:Q.waveform},U={isDev:X.__isDev||!1,tsVideosConfig:X.__tsVideosConfig},W=await r5(G,U),z=W.html;if(W.css)z+=`
2098
2087
  <style>${W.css}</style>`;if(W.script)z+=`
2099
- <script>${W.script}</script>`;return z},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function UX($,Z,X){if(Z.src)return{src:String(Z.src),options:Z.options||{}};let J=$.trim();if(J.startsWith("@video(")||J.startsWith("("))J=J.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=WX(J),Q=J6(Y[0],X)||"",G={};if(Y[1]){let q=J6(Y[1],X);if(typeof q==="object"&&q!==null)G=q;else if(typeof Y[1]==="string")try{G=JSON.parse(Y[1])}catch{}}return{src:Q,options:G}}function WX($){let Z=[],X="",J=!1,Y="",Q=0,G=0;for(let q=0;q<$.length;q++){let U=$[q],W=q>0?$[q-1]:"";if((U==='"'||U==="'"||U==="`")&&W!=="\\"){if(!J)J=!0,Y=U;else if(U===Y)J=!1,Y="";else X+=U;continue}if(!J){if(U==="{")Q++;if(U==="}")Q--;if(U==="[")G++;if(U==="]")G--;if(U===","&&Q===0&&G===0){Z.push(X.trim()),X="";continue}}X+=U}if(X.trim())Z.push(X.trim());return Z}function J6($,Z){if(typeof $!=="string")return $;let X=$.trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))return X.slice(1,-1);if(!X.startsWith("/")&&!X.startsWith(".")&&!X.startsWith("http")&&!X.startsWith("{")){let J=Z[X];if(J!==void 0)return J}if(X.startsWith("{")||X.startsWith("["))try{return JSON.parse(X)}catch{}return X}var Y3=X6();var zX={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},s5={},Y6="en";function KX($){Y6=$}function HX(){return Y6}function BX($){s5={...s5,...$}}function jX(){s5={}}function Q6($,Z={}){let X=s5[$]||zX[$]||{message:`Unknown error (code: ${$})`},J=X.message,Y=X.help;for(let[Q,G]of Object.entries(Z)){let q=`{{${Q}}}`;if(J=J.replace(new RegExp(q,"g"),G),Y)Y=Y.replace(new RegExp(q,"g"),G)}return{message:J,help:Y}}function _X($,Z={}){let{message:X,help:J}=Q6($,Z);return J?`${X}
2100
- Help: ${J}`:X}var c={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function Q3($){for(let[Z,X]of Object.entries(c))if(X===$)return Z;return}import VX from"path";function O5(){return!1}function F5(){return!O5()||process.env.STX_DEBUG==="true"}function o5(){return!1}var G6={showRelativePaths:!1,enableAutoRecovery:F5(),logRecoveryWarnings:!0},l1={...G6};function OX($){l1={...l1,...$}}function r5(){return{...l1}}function FX(){l1={...G6}}function a5($){if(!l1.showRelativePaths||!$)return $;let Z=l1.baseDir||process.cwd();try{let X=VX.relative(Z,$);return X.startsWith("..")?$:X}catch{return $}}class R1 extends Error{code;filePath;line;column;context;numericCode;constructor($,Z,X,J,Y,Q,G){super($);this.code=Z;this.filePath=X;this.line=J;this.column=Y;this.context=Q;if(this.name="StxError",this.numericCode=G||c.EVALUATION_ERROR,this.filePath)this.filePath=a5(this.filePath)}}class q6 extends R1{constructor($,Z,X,J,Y,Q){super($,"stx_SYNTAX_ERROR",Z,X,J,Y,Q||c.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class D1 extends R1{constructor($,Z,X,J,Y,Q){super($,"stx_RUNTIME_ERROR",Z,X,J,Y,Q||c.EVALUATION_ERROR);this.name="StxRuntimeError"}}class U6 extends R1{constructor($,Z,X,J,Y,Q){super($,"stx_SECURITY_ERROR",Z,X,J,Y,Q||c.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class W6 extends R1{constructor($,Z,X,J,Y,Q){super($,"stx_FILE_ERROR",Z,X,J,Y,Q||c.FILE_NOT_FOUND);this.name="StxFileError"}}class t5 extends R1{isFatal=!0;constructor($,Z,X,J,Y,Q){super($,"stx_VALIDATION_ERROR",Z,X,J,Y,Q||c.DOM_API_VIOLATION);this.name="StxValidationError"}}function G3($){let{type:Z,message:X,code:J,filePath:Y,line:Q,column:G,template:q,offset:U,snippet:W,suggestion:z,format:K="text"}=$,H=Q,B=G;if(!H&&q&&U!==void 0){let O=K6(q,U);H=O.line,B=O.column}let j=Y?a5(Y):void 0,_=J?Q3(J):void 0,F={type:Z,code:J,codeName:_,message:X,filePath:j,line:H,column:B,snippet:W,suggestion:z,timestamp:new Date().toISOString()},V;switch(K){case"html":V=wX(F);break;case"json":V=JSON.stringify(F,null,2);break;case"console":V=RX(F,q,U);break;case"text":default:V=LX(F,q,U);break}return{formatted:V,data:F}}function LX($,Z,X){let J=[],Y=$.code?` [${$.codeName||$.code}]`:"";if(J.push(`[${$.type} Error${Y}]`),$.filePath){let Q=$.filePath;if($.line){if(Q+=`:${$.line}`,$.column)Q+=`:${$.column}`}J.push(`at ${Q}`)}if(J.push(`
2101
- ${$.message}`),Z&&$.line){let Q=DX(Z,$.line,2);if(Q)J.push(`
2088
+ <script>${W.script}</script>`;return z},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function RX($,Z,X){if(Z.src)return{src:String(Z.src),options:Z.options||{}};let J=$.trim();if(J.startsWith("@video(")||J.startsWith("("))J=J.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let Y=DX(J),Q=U6(Y[0],X)||"",G={};if(Y[1]){let q=U6(Y[1],X);if(typeof q==="object"&&q!==null)G=q;else if(typeof Y[1]==="string")try{G=JSON.parse(Y[1])}catch{}}return{src:Q,options:G}}function DX($){let Z=[],X="",J=!1,Y="",Q=0,G=0;for(let q=0;q<$.length;q++){let U=$[q],W=q>0?$[q-1]:"";if((U==='"'||U==="'"||U==="`")&&W!=="\\"){if(!J)J=!0,Y=U;else if(U===Y)J=!1,Y="";else X+=U;continue}if(!J){if(U==="{")Q++;if(U==="}")Q--;if(U==="[")G++;if(U==="]")G--;if(U===","&&Q===0&&G===0){Z.push(X.trim()),X="";continue}}X+=U}if(X.trim())Z.push(X.trim());return Z}function U6($,Z){if(typeof $!=="string")return $;let X=$.trim();if(X.startsWith('"')&&X.endsWith('"')||X.startsWith("'")&&X.endsWith("'"))return X.slice(1,-1);if(!X.startsWith("/")&&!X.startsWith(".")&&!X.startsWith("http")&&!X.startsWith("{")){let J=Z[X];if(J!==void 0)return J}if(X.startsWith("{")||X.startsWith("["))try{return JSON.parse(X)}catch{}return X}var W3=q6();var NX={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},a5={},W6="en";function AX($){W6=$}function MX(){return W6}function IX($){a5={...a5,...$}}function kX(){a5={}}function z6($,Z={}){let X=a5[$]||NX[$]||{message:`Unknown error (code: ${$})`},J=X.message,Y=X.help;for(let[Q,G]of Object.entries(Z)){let q=`{{${Q}}}`;if(J=J.replace(new RegExp(q,"g"),G),Y)Y=Y.replace(new RegExp(q,"g"),G)}return{message:J,help:Y}}function TX($,Z={}){let{message:X,help:J}=z6($,Z);return J?`${X}
2089
+ Help: ${J}`:X}var m={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function z3($){for(let[Z,X]of Object.entries(m))if(X===$)return Z;return}import EX from"path";function j5(){return!1}function _5(){return!j5()||process.env.STX_DEBUG==="true"}function t5(){return!1}var K6={showRelativePaths:!1,enableAutoRecovery:_5(),logRecoveryWarnings:!0},x1={...K6};function bX($){x1={...x1,...$}}function e5(){return{...x1}}function yX(){x1={...K6}}function $$($){if(!x1.showRelativePaths||!$)return $;let Z=x1.baseDir||process.cwd();try{let X=EX.relative(Z,$);return X.startsWith("..")?$:X}catch{return $}}class F1 extends Error{code;filePath;line;column;context;numericCode;constructor($,Z,X,J,Y,Q,G){super($);this.code=Z;this.filePath=X;this.line=J;this.column=Y;this.context=Q;if(this.name="StxError",this.numericCode=G||m.EVALUATION_ERROR,this.filePath)this.filePath=$$(this.filePath)}}class H6 extends F1{constructor($,Z,X,J,Y,Q){super($,"stx_SYNTAX_ERROR",Z,X,J,Y,Q||m.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class L1 extends F1{constructor($,Z,X,J,Y,Q){super($,"stx_RUNTIME_ERROR",Z,X,J,Y,Q||m.EVALUATION_ERROR);this.name="StxRuntimeError"}}class B6 extends F1{constructor($,Z,X,J,Y,Q){super($,"stx_SECURITY_ERROR",Z,X,J,Y,Q||m.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class j6 extends F1{constructor($,Z,X,J,Y,Q){super($,"stx_FILE_ERROR",Z,X,J,Y,Q||m.FILE_NOT_FOUND);this.name="StxFileError"}}class Z$ extends F1{isFatal=!0;constructor($,Z,X,J,Y,Q){super($,"stx_VALIDATION_ERROR",Z,X,J,Y,Q||m.DOM_API_VIOLATION);this.name="StxValidationError"}}function K3($){let{type:Z,message:X,code:J,filePath:Y,line:Q,column:G,template:q,offset:U,snippet:W,suggestion:z,format:K="text"}=$,H=Q,B=G;if(!H&&q&&U!==void 0){let O=V6(q,U);H=O.line,B=O.column}let j=Y?$$(Y):void 0,_=J?z3(J):void 0,L={type:Z,code:J,codeName:_,message:X,filePath:j,line:H,column:B,snippet:W,suggestion:z,timestamp:new Date().toISOString()},V;switch(K){case"html":V=CX(L);break;case"json":V=JSON.stringify(L,null,2);break;case"console":V=PX(L,q,U);break;case"text":default:V=SX(L,q,U);break}return{formatted:V,data:L}}function SX($,Z,X){let J=[],Y=$.code?` [${$.codeName||$.code}]`:"";if(J.push(`[${$.type} Error${Y}]`),$.filePath){let Q=$.filePath;if($.line){if(Q+=`:${$.line}`,$.column)Q+=`:${$.column}`}J.push(`at ${Q}`)}if(J.push(`
2090
+ ${$.message}`),Z&&$.line){let Q=vX(Z,$.line,2);if(Q)J.push(`
2102
2091
  ${Q}`)}if($.snippet)J.push(`
2103
2092
  Snippet: ${$.snippet}`);if($.suggestion)J.push(`
2104
- Suggestion: ${$.suggestion}`);return J.join(" ")}function wX($){let Z=$.code?` [${$.code}]`:"",X=$.filePath?` in ${$.filePath}${$.line?`:${$.line}`:""}`:"",J=`<!-- [${$.type} Error${Z}]${X}: ${z6($.message)}`;if($.suggestion)J+=` | Suggestion: ${z6($.suggestion)}`;return J+=" -->",J}function RX($,Z,X){let W=[],z=$.code?` [${$.codeName||$.code}]`:"";if(W.push(`\x1B[1m${"\x1B[31m"}\u2501\u2501\u2501 ${$.type} Error${z} \u2501\u2501\u2501${"\x1B[0m"}`),$.filePath){let K=`\x1B[36m${$.filePath}\x1B[0m`;if($.line){if(K+=`\x1B[90m:${$.line}\x1B[0m`,$.column)K+=`\x1B[90m:${$.column}\x1B[0m`}W.push(`
2093
+ Suggestion: ${$.suggestion}`);return J.join(" ")}function CX($){let Z=$.code?` [${$.code}]`:"",X=$.filePath?` in ${$.filePath}${$.line?`:${$.line}`:""}`:"",J=`<!-- [${$.type} Error${Z}]${X}: ${_6($.message)}`;if($.suggestion)J+=` | Suggestion: ${_6($.suggestion)}`;return J+=" -->",J}function PX($,Z,X){let W=[],z=$.code?` [${$.codeName||$.code}]`:"";if(W.push(`\x1B[1m${"\x1B[31m"}\u2501\u2501\u2501 ${$.type} Error${z} \u2501\u2501\u2501${"\x1B[0m"}`),$.filePath){let K=`\x1B[36m${$.filePath}\x1B[0m`;if($.line){if(K+=`\x1B[90m:${$.line}\x1B[0m`,$.column)K+=`\x1B[90m:${$.column}\x1B[0m`}W.push(`
2105
2094
  \x1B[90mat\x1B[0m ${K}`)}if(W.push(`
2106
2095
 
2107
- ${$.message}`),Z&&$.line){let K=NX(Z,$.line,2);if(K)W.push(`
2096
+ ${$.message}`),Z&&$.line){let K=fX(Z,$.line,2);if(K)W.push(`
2108
2097
 
2109
2098
  \x1B[90mContext:\x1B[0m
2110
2099
  ${K}`)}if($.suggestion)W.push(`
2111
2100
 
2112
2101
  \x1B[33mSuggestion:\x1B[0m ${$.suggestion}`);return W.push(`
2113
- ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),W.join("")}function DX($,Z,X){let J=$.split(`
2102
+ ${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),W.join("")}function vX($,Z,X){let J=$.split(`
2114
2103
  `),Y=Math.max(0,Z-X-1),Q=Math.min(J.length-1,Z+X-1),G=[];for(let q=Y;q<=Q;q++){let U=(q+1).toString().padStart(4),W=q===Z-1?">":" ";G.push(`${W}${U} | ${J[q]}`)}return G.join(`
2115
- `)}function NX($,Z,X){let J=$.split(`
2104
+ `)}function fX($,Z,X){let J=$.split(`
2116
2105
  `),Y=Math.max(0,Z-X-1),Q=Math.min(J.length-1,Z+X-1),G="\x1B[90m",q="\x1B[31m",U="\x1B[0m",W=[];for(let z=Y;z<=Q;z++){let K=(z+1).toString().padStart(4),H=z===Z-1,B=H?"\x1B[31m>\x1B[0m":" ",j=H?`\x1B[31m${J[z]}\x1B[0m`:`\x1B[90m${J[z]}\x1B[0m`;W.push(`${B}\x1B[90m${K}\x1B[0m | ${j}`)}return W.join(`
2117
- `)}function z6($){return $.replace(/--/g,"- -").replace(/>/g,"&gt;")}function K6($,Z){let J=$.substring(0,Z).split(`
2118
- `);return{line:J.length,column:J[J.length-1].length}}function e($,Z,X){return G3({type:$,message:Z,code:X,format:"html"}).formatted}function AX($,Z,X,J,Y){return G3({type:$,message:Z,code:Y,filePath:X,line:J,format:"console"}).formatted}function MX($,Z,X){let J=X.template.split(`
2119
- `),Y=K6(X.template,X.offset),Q=`[${$} Error at line ${Y.line} in ${X.filePath}]: ${Z}
2106
+ `)}function _6($){return $.replace(/--/g,"- -").replace(/>/g,"&gt;")}function V6($,Z){let J=$.substring(0,Z).split(`
2107
+ `);return{line:J.length,column:J[J.length-1].length}}function $0($,Z,X){return K3({type:$,message:Z,code:X,format:"html"}).formatted}function xX($,Z,X,J,Y){return K3({type:$,message:Z,code:Y,filePath:X,line:J,format:"console"}).formatted}function gX($,Z,X){let J=X.template.split(`
2108
+ `),Y=V6(X.template,X.offset),Q=`[${$} Error at line ${Y.line} in ${X.filePath}]: ${Z}
2120
2109
 
2121
2110
  `,G=Math.max(0,Y.line-3),q=Math.min(J.length-1,Y.line+2);Q+=`Context:
2122
2111
  `;for(let U=G;U<=q;U++){let W=U+1,z=J[U]||"",K=U===Y.line-1?">":" ";Q+=`${K} ${W.toString().padStart(3)}: ${z}
2123
2112
  `}if(Y.line-1<J.length){let U=" ".repeat(Y.column+5);Q+=`${U}^
2124
- `}return Q}function TX($,Z,X){try{return $()}catch(J){if(X&&J instanceof Error)X(J);return Z}}async function c1($,Z,X){try{return await $()}catch(J){if(X&&J instanceof Error)X(J);return Z}}var q3={isEnabled(){return r5().enableAutoRecovery},fixCommonSyntaxErrors($){let Z=r5();if(!Z.enableAutoRecovery)return{fixed:$,fixes:[]};let X=$,J=[],Y=(X.match(/\{\{/g)||[]).length,Q=(X.match(/\}\}/g)||[]).length;if(Y>Q){let q=Y-Q;X+="}}".repeat(q),J.push(`Added ${q} missing closing braces '}}'`)}let G=["if","foreach","for","switch","section"];for(let q of G){let U=(X.match(new RegExp(`@${q}\\b`,"g"))||[]).length,W=(X.match(new RegExp(`@end${q}\\b`,"g"))||[]).length;if(U>W){let z=U-W;for(let K=0;K<z;K++)X+=`
2125
- @end${q}`;J.push(`Added ${z} missing @end${q}`)}}if(J.length>0&&Z.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),J.forEach((q)=>console.warn(` - ${q}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:X,fixes:J}},createFallbackContent($,Z){if(F5())return`<!-- ${$} failed: ${Z.message} -->`;return"<!-- stx rendering error -->"}};class U3{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor($={}){this.maxErrors=$.maxErrors??1000,this.enableFileLogging=$.enableFileLogging??!1,this.logFilePath=$.logFilePath??".stx/errors.log",this.logFormat=$.logFormat??"json",this.maxFileSize=$.maxFileSize??10485760,this.maxLogFiles=$.maxLogFiles??5,this.minLevel=$.minLevel??"all"}configure($){if($.maxErrors!==void 0)this.maxErrors=$.maxErrors;if($.enableFileLogging!==void 0)this.enableFileLogging=$.enableFileLogging;if($.logFilePath!==void 0)this.logFilePath=$.logFilePath;if($.logFormat!==void 0)this.logFormat=$.logFormat;if($.maxFileSize!==void 0)this.maxFileSize=$.maxFileSize;if($.maxLogFiles!==void 0)this.maxLogFiles=$.maxLogFiles;if($.minLevel!==void 0)this.minLevel=$.minLevel}log($,Z,X="error"){let J={timestamp:new Date,error:$,context:Z,level:X};if(this.errors.push(J),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(X))this.writeToFile(J)}shouldLog($){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return $==="error"||$==="warning";if(this.minLevel==="error")return $==="error";return!0}formatEntry($){if(this.logFormat==="json")return JSON.stringify({timestamp:$.timestamp.toISOString(),level:$.level||"error",type:$.error.constructor.name,message:$.error.message,stack:$.error.stack,context:$.context});let Z=[`[${$.timestamp.toISOString()}] [${($.level||"error").toUpperCase()}] ${$.error.constructor.name}: ${$.error.message}`];if($.error.stack)Z.push(` Stack: ${$.error.stack.split(`
2113
+ `}return Q}function hX($,Z,X){try{return $()}catch(J){if(X&&J instanceof Error)X(J);return Z}}async function g1($,Z,X){try{return await $()}catch(J){if(X&&J instanceof Error)X(J);return Z}}var H3={isEnabled(){return e5().enableAutoRecovery},fixCommonSyntaxErrors($){let Z=e5();if(!Z.enableAutoRecovery)return{fixed:$,fixes:[]};let X=$,J=[],Y=(X.match(/\{\{/g)||[]).length,Q=(X.match(/\}\}/g)||[]).length;if(Y>Q){let q=Y-Q;X+="}}".repeat(q),J.push(`Added ${q} missing closing braces '}}'`)}let G=["if","foreach","for","switch","section"];for(let q of G){let U=(X.match(new RegExp(`@${q}\\b`,"g"))||[]).length,W=(X.match(new RegExp(`@end${q}\\b`,"g"))||[]).length;if(U>W){let z=U-W;for(let K=0;K<z;K++)X+=`
2114
+ @end${q}`;J.push(`Added ${z} missing @end${q}`)}}if(J.length>0&&Z.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),J.forEach((q)=>console.warn(` - ${q}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:X,fixes:J}},createFallbackContent($,Z){if(_5())return`<!-- ${$} failed: ${Z.message} -->`;return"<!-- stx rendering error -->"}};class B3{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor($={}){this.maxErrors=$.maxErrors??1000,this.enableFileLogging=$.enableFileLogging??!1,this.logFilePath=$.logFilePath??".stx/errors.log",this.logFormat=$.logFormat??"json",this.maxFileSize=$.maxFileSize??10485760,this.maxLogFiles=$.maxLogFiles??5,this.minLevel=$.minLevel??"all"}configure($){if($.maxErrors!==void 0)this.maxErrors=$.maxErrors;if($.enableFileLogging!==void 0)this.enableFileLogging=$.enableFileLogging;if($.logFilePath!==void 0)this.logFilePath=$.logFilePath;if($.logFormat!==void 0)this.logFormat=$.logFormat;if($.maxFileSize!==void 0)this.maxFileSize=$.maxFileSize;if($.maxLogFiles!==void 0)this.maxLogFiles=$.maxLogFiles;if($.minLevel!==void 0)this.minLevel=$.minLevel}log($,Z,X="error"){let J={timestamp:new Date,error:$,context:Z,level:X};if(this.errors.push(J),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(X))this.writeToFile(J)}shouldLog($){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return $==="error"||$==="warning";if(this.minLevel==="error")return $==="error";return!0}formatEntry($){if(this.logFormat==="json")return JSON.stringify({timestamp:$.timestamp.toISOString(),level:$.level||"error",type:$.error.constructor.name,message:$.error.message,stack:$.error.stack,context:$.context});let Z=[`[${$.timestamp.toISOString()}] [${($.level||"error").toUpperCase()}] ${$.error.constructor.name}: ${$.error.message}`];if($.error.stack)Z.push(` Stack: ${$.error.stack.split(`
2126
2115
  `).slice(1).join(`
2127
2116
  `)}`);if($.context)Z.push(` Context: ${JSON.stringify($.context)}`);return Z.join(`
2128
2117
  `)}writeToFile($){this.writeQueue=this.writeQueue.then(async()=>{try{let Z=await import("fs"),J=(await import("path")).dirname(this.logFilePath);if(!Z.existsSync(J))Z.mkdirSync(J,{recursive:!0});await this.rotateIfNeeded(Z);let Y=`${this.formatEntry($)}
2129
2118
  `;Z.appendFileSync(this.logFilePath,Y,"utf-8")}catch(Z){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",Z)}})}async rotateIfNeeded($){try{if(!$.existsSync(this.logFilePath))return;if($.statSync(this.logFilePath).size<this.maxFileSize)return;for(let X=this.maxLogFiles-1;X>=1;X--){let J=`${this.logFilePath}.${X}`,Y=`${this.logFilePath}.${X+1}`;if($.existsSync(J))if(X>=this.maxLogFiles-1)$.unlinkSync(J);else $.renameSync(J,Y)}if(this.maxLogFiles<=1)$.writeFileSync(this.logFilePath,"");else $.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(Z){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",Z)}}getRecentErrors($=10){return this.errors.slice(-$)}getErrorsByType($){return this.errors.filter((Z)=>Z.error.constructor.name===$)}getErrorsByLevel($){return this.errors.filter((Z)=>Z.level===$)}clear(){this.errors.length=0}async clearLogFile(){try{let $=await import("fs");if($.existsSync(this.logFilePath))$.writeFileSync(this.logFilePath,"","utf-8")}catch($){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",$)}}getStats(){let $={},Z={error:0,warning:0,info:0};for(let X of this.errors){let J=X.error.constructor.name;$[J]=($[J]||0)+1;let Y=X.level||"error";Z[Y]=(Z[Y]||0)+1}return{total:this.errors.length,byType:$,byLevel:Z}}async exportToFile($,Z="json"){let X=await import("fs"),Y=(await import("path")).dirname($);if(!X.existsSync(Y))X.mkdirSync(Y,{recursive:!0});if(Z==="json"){let Q=this.errors.map((G)=>({timestamp:G.timestamp.toISOString(),level:G.level||"error",type:G.error.constructor.name,message:G.error.message,stack:G.error.stack,context:G.context}));X.writeFileSync($,JSON.stringify(Q,null,2),"utf-8")}else{let Q=this.errors.map((G)=>this.formatEntry(G));X.writeFileSync($,Q.join(`
2130
2119
 
2131
- `),"utf-8")}}async flush(){await this.writeQueue}}var l0=new U3,W3={isDevelopment(){return F5()},logDetailedError($,Z){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",$.message),console.error("Stack:",$.stack),Z)console.error("Context:",Z);console.error("========================")},createErrorReport($,Z){let X=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${$.message}`,`Type: ${$.constructor.name}`,`Stack: ${$.stack}`];if(Z)X.push(`Context: ${JSON.stringify(Z,null,2)}`);return X.push("========================"),X.join(`
2132
- `)}};import z3 from"path";var K3={isValidFilePath($,Z){let X=$.replace(/\\/g,"/");if(X.includes("\x00"))return!1;if(X.includes("../")||X.includes("..\\")||X===".."||X.startsWith("../")||X.endsWith("/..")||X.includes("/..\\")||X.includes("\\../"))return!1;if(/^[a-z][a-z0-9+.-]*:/i.test(X))return!1;if(X.startsWith("/")){if(["/etc/","/root/","/var/","/usr/","/bin/","/sbin/","/proc/","/sys/","/dev/","/boot/","/home/","/private/","/Library/","/System/"].some((Q)=>X===Q.slice(0,-1)||X.startsWith(Q)))return!1}if(/^[a-z]:/i.test(X)){if(["Windows/","Windows\\","System32/","System32\\","Program Files/","Program Files\\"].some((Q)=>X.includes(Q)))return!1}if(Z){let Y=z3.resolve(Z,$),Q=z3.resolve(Z);if(!Y.startsWith(Q+z3.sep)&&Y!==Q)return!1}return!0},isValidVariableName($){return/^[a-z_$]\w*$/i.test($)},isValidDirectiveName($){return/^[a-z][\w-]*$/i.test($)},isSafeContent($){return![/<script[^>]*>[\s\S]*?<\/script>/i,/javascript:/i,/data:text\/html/i,/vbscript:/i,/on\w+\s*=/i].some((X)=>X.test($))}};function IX($){let Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return $.replace(/[&<>"']/g,(X)=>Z[X]||X)}function e5($,Z={}){let{allowHtml:X=!1,maxLength:J=1e4,allowSpecialChars:Y=!0,customSanitizer:Q}=Z,G=[],q=$,U=!1;if(Q){let z=Q(q);if(z!==q)q=z,U=!0}if(q.includes("\x00"))q=q.replace(/\0/g,""),U=!0,G.push("Null bytes removed from parameter");if(q.length>J)q=q.substring(0,J),U=!0,G.push(`Parameter truncated to ${J} characters`);if(!X&&/<[^>]+>/.test(q))q=IX(q),U=!0,G.push("HTML content was escaped");let W=[{pattern:/javascript:/gi,replacement:"",name:"javascript: URI"},{pattern:/vbscript:/gi,replacement:"",name:"vbscript: URI"},{pattern:/data:text\/html/gi,replacement:"",name:"data:text/html URI"}];for(let{pattern:z,replacement:K,name:H}of W)if(z.test(q))q=q.replace(z,K),U=!0,G.push(`Removed ${H} from parameter`);if(!Y){let z=q;if(q=q.split("").filter((K)=>{let H=K.charCodeAt(0);return H>=32&&H!==127}).join(""),q!==z)U=!0,G.push("Control characters removed")}return{value:q,modified:U,warnings:G}}function kX($,Z){let X=$.replace(/\0/g,"");X=X.replace(/\\/g,"/"),X=X.replace(/^[a-z][a-z0-9+.-]*:/i,"");while(X.includes("../")||X.includes("./"))X=X.replace(/\.\.\//g,"").replace(/\.\//g,"");if(!K3.isValidFilePath(X,Z))return null;return X}function EX($){let Z=[],X=$.trim(),J=X!==$,Y=[{pattern:/\beval\s*\(/gi,name:"eval()"},{pattern:/\bFunction\s*\(/gi,name:"Function()"},{pattern:/\bsetTimeout\s*\(/gi,name:"setTimeout()"},{pattern:/\bsetInterval\s*\(/gi,name:"setInterval()"},{pattern:/\bimport\s*\(/gi,name:"dynamic import()"},{pattern:/\brequire\s*\(/gi,name:"require()"},{pattern:/\b__proto__\b/gi,name:"__proto__"},{pattern:/\bconstructor\b/gi,name:"constructor"},{pattern:/\bprototype\b/gi,name:"prototype"}];for(let{pattern:Q,name:G}of Y)if(Q.test(X))Z.push(`Potentially dangerous pattern detected: ${G}`);if(X.includes("\x00"))X=X.replace(/\0/g,""),J=!0,Z.push("Null bytes removed from expression");return{value:X,modified:J,warnings:Z}}function bX($,Z={}){return $.map((X)=>e5(X,Z))}function H6($){let Z={};for(let[X,J]of Object.entries($)){if(!K3.isValidVariableName(X))continue;if(typeof J==="string"){let Y=e5(J);Z[X]=Y.value}else if(Array.isArray(J))Z[X]=J.map((Y)=>typeof Y==="string"?e5(Y).value:Y);else if(typeof J==="object"&&J!==null)Z[X]=H6(J);else Z[X]=J}return Z}function j6($,Z,X,J){let Y=$;Y=Y.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(q,U,W)=>{if(!W&&U.includes(":")){let z=U.split(":"),K=U,H=z.length>1?z[1]:"";if(H&&Z[H])W=Z[H];else if(K.startsWith("og:")&&Z.openGraph&&Z.openGraph[z[1]])W=Z.openGraph[z[1]];else W="";return W?`<meta property="${p(K)}" content="${p(W)}">`:""}return W?`<meta name="${p(U)}" content="${p(W)}">`:""});let Q=/@metaTag\s*\(/g,G;while((G=Q.exec(Y))!==null){let q=G.index,U=q+G[0].length-1,W=1,z=U+1;while(z<Y.length&&W>0){if(Y[z]==="(")W++;else if(Y[z]===")"){if(W--,W===0)break}z++}if(W!==0)break;let K=Y.substring(U+1,z).trim(),H=z+1,B=(()=>{try{let j=w0(K,Z);if(!j)return"";let _="<meta";if(j.name)_+=` name="${p(String(j.name))}"`;if(j.property)_+=` property="${p(String(j.property))}"`;if(j.httpEquiv)_+=` http-equiv="${p(String(j.httpEquiv))}"`;if(j.content)_+=` content="${p(String(j.content))}"`;return _+=">",_}catch(j){let _=j instanceof Error?j.message:String(j);return e("MetaTag",_,c.EVALUATION_ERROR)}})();Y=Y.substring(0,q)+B+Y.substring(H),Q.lastIndex=0}return Y}function _6($,Z,X){let J=$,Y=/@structuredData\s*\(/g,Q;while((Q=Y.exec(J))!==null){let G=Q.index,q=G+Q[0].length-1,U=1,W=q+1;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")"){if(U--,U===0)break}W++}if(U!==0)break;let z=J.substring(q+1,W).trim(),K=W+1,H=(()=>{try{let B=w0(z,Z);if(!B)return"";if(!B["@context"])B["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(B).replace(/<\//g,"<\\/")}</script>`}catch(B){let j=B instanceof Error?B.message:String(B);return e("StructuredData",j,c.EVALUATION_ERROR)}})();J=J.substring(0,G)+H+J.substring(K),Y.lastIndex=0}return J}function V6($,Z,X,J){let Y=$,Q=/@seo\s*\(\s*\{/g,G;while((G=Q.exec(Y))!==null){let q=Y.indexOf("{",G.index+4),U=1,W=q+1,z=null,K=!1;while(W<Y.length&&U>0){let V=Y[W];if(K){K=!1,W++;continue}if(V==="\\"&&z){K=!0,W++;continue}if(z){if(V===z)z=null;W++;continue}if(V==='"'||V==="'"||V==="`"){z=V,W++;continue}if(V==="{")U++;else if(V==="}")U--;W++}if(U!==0)break;let H=Y.substring(W).match(/^\s*\)/);if(!H)break;let B=W+H[0].length,j=Y.substring(q,W),_=Y.substring(G.index,B),F=((V)=>{try{let O=w0(V,Z);if(!O)return"";let L="";if(O.title)L+=`<title>${p(O.title)}</title>
2133
- `,L+=`<meta name="title" content="${p(O.title)}">
2134
- `;if(O.description)L+=`<meta name="description" content="${p(O.description)}">
2135
- `;if(O.keywords){let w=Array.isArray(O.keywords)?O.keywords.join(", "):O.keywords;L+=`<meta name="keywords" content="${p(w)}">
2136
- `}if(O.robots)L+=`<meta name="robots" content="${p(O.robots)}">
2137
- `;if(O.canonical)L+=`<link rel="canonical" href="${p(O.canonical)}">
2138
- `;if(O.openGraph){let w=O.openGraph;if(L+=`<meta property="og:type" content="${p(w.type||"website")}">
2139
- `,w.title||O.title){let R=w.title||O.title||"";L+=`<meta property="og:title" content="${p(R)}">
2140
- `}if(w.description||O.description){let R=w.description||O.description||"";L+=`<meta property="og:description" content="${p(R)}">
2141
- `}if(w.url||O.canonical){let R=w.url||O.canonical||"";L+=`<meta property="og:url" content="${p(R)}">
2142
- `}if(w.image){if(L+=`<meta property="og:image" content="${p(w.image)}">
2143
- `,w.imageAlt)L+=`<meta property="og:image:alt" content="${p(w.imageAlt)}">
2144
- `;if(w.imageWidth)L+=`<meta property="og:image:width" content="${p(String(w.imageWidth))}">
2145
- `;if(w.imageHeight)L+=`<meta property="og:image:height" content="${p(String(w.imageHeight))}">
2146
- `}if(w.siteName)L+=`<meta property="og:site_name" content="${p(w.siteName)}">
2147
- `}if(O.twitter){let w=O.twitter;if(L+=`<meta name="twitter:card" content="${p(w.card||"summary_large_image")}">
2148
- `,w.title||O.title){let R=w.title||O.title||"";L+=`<meta name="twitter:title" content="${p(R)}">
2149
- `}if(w.description||O.description){let R=w.description||O.description||"";L+=`<meta name="twitter:description" content="${p(R)}">
2150
- `}if(w.image||O.openGraph&&O.openGraph.image){let R=w.image||(O.openGraph?O.openGraph.image:"")||"";L+=`<meta name="twitter:image" content="${p(R)}">
2151
- `}if(w.site)L+=`<meta name="twitter:site" content="${p(w.site)}">
2152
- `;if(w.creator)L+=`<meta name="twitter:creator" content="${p(w.creator)}">
2153
- `}if(O.structuredData){let w=JSON.stringify(O.structuredData).replace(/<\//g,"<\\/");L+=`<script type="application/ld+json">${w}</script>
2154
- `}return L.trim()}catch(O){let L=O instanceof Error?O.message:String(O);return e("SEO",`Error processing @seo directive: ${L}`,c.EVALUATION_ERROR)}})(j);Y=Y.substring(0,G.index)+F+Y.substring(B),Q.lastIndex=G.index+F.length}return Y}function O6($,Z,X){if(X.seo?.enabled===!1)return $;if($.includes("<!-- stx SEO Tags -->")||X.skipDefaultSeoTags===!0)return $;let J=Z.__stx_runtime_head;if(!!(J?.title||J?.meta?.some((K)=>K.property==="og:title"||K.name==="og:title"||K.name==="twitter:title"||K.name==="description")))return $;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test($))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let Q=$.includes("<title>")||$.includes("</title>"),G="";if(Z.title)G=Z.title;else if(Z.meta&&Z.meta.title)G=Z.meta.title;else if(X.seo?.defaultConfig?.title)G=X.seo.defaultConfig.title;else G=X.defaultTitle||"stx Project";let q="";if(Z.description)q=Z.description;else if(Z.meta&&Z.meta.description)q=Z.meta.description;else if(X.seo?.defaultConfig?.description)q=X.seo.defaultConfig.description;else q=X.defaultDescription||"A website built with stx templating engine";let U="";if(Z.image)U=Z.image;else if(Z.meta&&Z.meta.image)U=Z.meta.image;else if(Z.openGraph&&Z.openGraph.image)U=Z.openGraph.image;else if(X.seo?.defaultImage)U=X.seo.defaultImage;else if(X.defaultImage)U=X.defaultImage;let W=`
2120
+ `),"utf-8")}}async flush(){await this.writeQueue}}var i0=new B3,j3={isDevelopment(){return _5()},logDetailedError($,Z){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",$.message),console.error("Stack:",$.stack),Z)console.error("Context:",Z);console.error("========================")},createErrorReport($,Z){let X=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${$.message}`,`Type: ${$.constructor.name}`,`Stack: ${$.stack}`];if(Z)X.push(`Context: ${JSON.stringify(Z,null,2)}`);return X.push("========================"),X.join(`
2121
+ `)}};import _3 from"path";var V3={isValidFilePath($,Z){let X=$.replace(/\\/g,"/");if(X.includes("\x00"))return!1;if(X.includes("../")||X.includes("..\\")||X===".."||X.startsWith("../")||X.endsWith("/..")||X.includes("/..\\")||X.includes("\\../"))return!1;if(/^[a-z][a-z0-9+.-]*:/i.test(X))return!1;if(X.startsWith("/")){if(["/etc/","/root/","/var/","/usr/","/bin/","/sbin/","/proc/","/sys/","/dev/","/boot/","/home/","/private/","/Library/","/System/"].some((Q)=>X===Q.slice(0,-1)||X.startsWith(Q)))return!1}if(/^[a-z]:/i.test(X)){if(["Windows/","Windows\\","System32/","System32\\","Program Files/","Program Files\\"].some((Q)=>X.includes(Q)))return!1}if(Z){let Y=_3.resolve(Z,$),Q=_3.resolve(Z);if(!Y.startsWith(Q+_3.sep)&&Y!==Q)return!1}return!0},isValidVariableName($){return/^[a-z_$]\w*$/i.test($)},isValidDirectiveName($){return/^[a-z][\w-]*$/i.test($)},isSafeContent($){return![/<script[^>]*>[\s\S]*?<\/script>/i,/javascript:/i,/data:text\/html/i,/vbscript:/i,/on\w+\s*=/i].some((X)=>X.test($))}};function uX($){let Z={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return $.replace(/[&<>"']/g,(X)=>Z[X]||X)}function X$($,Z={}){let{allowHtml:X=!1,maxLength:J=1e4,allowSpecialChars:Y=!0,customSanitizer:Q}=Z,G=[],q=$,U=!1;if(Q){let z=Q(q);if(z!==q)q=z,U=!0}if(q.includes("\x00"))q=q.replace(/\0/g,""),U=!0,G.push("Null bytes removed from parameter");if(q.length>J)q=q.substring(0,J),U=!0,G.push(`Parameter truncated to ${J} characters`);if(!X&&/<[^>]+>/.test(q))q=uX(q),U=!0,G.push("HTML content was escaped");let W=[{pattern:/javascript:/gi,replacement:"",name:"javascript: URI"},{pattern:/vbscript:/gi,replacement:"",name:"vbscript: URI"},{pattern:/data:text\/html/gi,replacement:"",name:"data:text/html URI"}];for(let{pattern:z,replacement:K,name:H}of W)if(z.test(q))q=q.replace(z,K),U=!0,G.push(`Removed ${H} from parameter`);if(!Y){let z=q;if(q=q.split("").filter((K)=>{let H=K.charCodeAt(0);return H>=32&&H!==127}).join(""),q!==z)U=!0,G.push("Control characters removed")}return{value:q,modified:U,warnings:G}}function dX($,Z){let X=$.replace(/\0/g,"");X=X.replace(/\\/g,"/"),X=X.replace(/^[a-z][a-z0-9+.-]*:/i,"");while(X.includes("../")||X.includes("./"))X=X.replace(/\.\.\//g,"").replace(/\.\//g,"");if(!V3.isValidFilePath(X,Z))return null;return X}function mX($){let Z=[],X=$.trim(),J=X!==$,Y=[{pattern:/\beval\s*\(/gi,name:"eval()"},{pattern:/\bFunction\s*\(/gi,name:"Function()"},{pattern:/\bsetTimeout\s*\(/gi,name:"setTimeout()"},{pattern:/\bsetInterval\s*\(/gi,name:"setInterval()"},{pattern:/\bimport\s*\(/gi,name:"dynamic import()"},{pattern:/\brequire\s*\(/gi,name:"require()"},{pattern:/\b__proto__\b/gi,name:"__proto__"},{pattern:/\bconstructor\b/gi,name:"constructor"},{pattern:/\bprototype\b/gi,name:"prototype"}];for(let{pattern:Q,name:G}of Y)if(Q.test(X))Z.push(`Potentially dangerous pattern detected: ${G}`);if(X.includes("\x00"))X=X.replace(/\0/g,""),J=!0,Z.push("Null bytes removed from expression");return{value:X,modified:J,warnings:Z}}function lX($,Z={}){return $.map((X)=>X$(X,Z))}function O6($){let Z={};for(let[X,J]of Object.entries($)){if(!V3.isValidVariableName(X))continue;if(typeof J==="string"){let Y=X$(J);Z[X]=Y.value}else if(Array.isArray(J))Z[X]=J.map((Y)=>typeof Y==="string"?X$(Y).value:Y);else if(typeof J==="object"&&J!==null)Z[X]=O6(J);else Z[X]=J}return Z}function L6($,Z,X,J){let Y=$;Y=Y.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(q,U,W)=>{if(!W&&U.includes(":")){let z=U.split(":"),K=U,H=z.length>1?z[1]:"";if(H&&Z[H])W=Z[H];else if(K.startsWith("og:")&&Z.openGraph&&Z.openGraph[z[1]])W=Z.openGraph[z[1]];else W="";return W?`<meta property="${l(K)}" content="${l(W)}">`:""}return W?`<meta name="${l(U)}" content="${l(W)}">`:""});let Q=/@metaTag\s*\(/g,G;while((G=Q.exec(Y))!==null){let q=G.index,U=q+G[0].length-1,W=1,z=U+1;while(z<Y.length&&W>0){if(Y[z]==="(")W++;else if(Y[z]===")"){if(W--,W===0)break}z++}if(W!==0)break;let K=Y.substring(U+1,z).trim(),H=z+1,B=(()=>{try{let j=w0(K,Z);if(!j)return"";let _="<meta";if(j.name)_+=` name="${l(String(j.name))}"`;if(j.property)_+=` property="${l(String(j.property))}"`;if(j.httpEquiv)_+=` http-equiv="${l(String(j.httpEquiv))}"`;if(j.content)_+=` content="${l(String(j.content))}"`;return _+=">",_}catch(j){let _=j instanceof Error?j.message:String(j);return $0("MetaTag",_,m.EVALUATION_ERROR)}})();Y=Y.substring(0,q)+B+Y.substring(H),Q.lastIndex=0}return Y}function w6($,Z,X){let J=$,Y=/@structuredData\s*\(/g,Q;while((Q=Y.exec(J))!==null){let G=Q.index,q=G+Q[0].length-1,U=1,W=q+1;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")"){if(U--,U===0)break}W++}if(U!==0)break;let z=J.substring(q+1,W).trim(),K=W+1,H=(()=>{try{let B=w0(z,Z);if(!B)return"";if(!B["@context"])B["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(B).replace(/<\//g,"<\\/")}</script>`}catch(B){let j=B instanceof Error?B.message:String(B);return $0("StructuredData",j,m.EVALUATION_ERROR)}})();J=J.substring(0,G)+H+J.substring(K),Y.lastIndex=0}return J}function R6($,Z,X,J){let Y=$,Q=/@seo\s*\(\s*\{/g,G;while((G=Q.exec(Y))!==null){let q=Y.indexOf("{",G.index+4),U=1,W=q+1,z=null,K=!1;while(W<Y.length&&U>0){let V=Y[W];if(K){K=!1,W++;continue}if(V==="\\"&&z){K=!0,W++;continue}if(z){if(V===z)z=null;W++;continue}if(V==='"'||V==="'"||V==="`"){z=V,W++;continue}if(V==="{")U++;else if(V==="}")U--;W++}if(U!==0)break;let H=Y.substring(W).match(/^\s*\)/);if(!H)break;let B=W+H[0].length,j=Y.substring(q,W),_=Y.substring(G.index,B),L=((V)=>{try{let O=w0(V,Z);if(!O)return"";let F="";if(O.title)F+=`<title>${l(O.title)}</title>
2122
+ `,F+=`<meta name="title" content="${l(O.title)}">
2123
+ `;if(O.description)F+=`<meta name="description" content="${l(O.description)}">
2124
+ `;if(O.keywords){let w=Array.isArray(O.keywords)?O.keywords.join(", "):O.keywords;F+=`<meta name="keywords" content="${l(w)}">
2125
+ `}if(O.robots)F+=`<meta name="robots" content="${l(O.robots)}">
2126
+ `;if(O.canonical)F+=`<link rel="canonical" href="${l(O.canonical)}">
2127
+ `;if(O.openGraph){let w=O.openGraph;if(F+=`<meta property="og:type" content="${l(w.type||"website")}">
2128
+ `,w.title||O.title){let R=w.title||O.title||"";F+=`<meta property="og:title" content="${l(R)}">
2129
+ `}if(w.description||O.description){let R=w.description||O.description||"";F+=`<meta property="og:description" content="${l(R)}">
2130
+ `}if(w.url||O.canonical){let R=w.url||O.canonical||"";F+=`<meta property="og:url" content="${l(R)}">
2131
+ `}if(w.image){if(F+=`<meta property="og:image" content="${l(w.image)}">
2132
+ `,w.imageAlt)F+=`<meta property="og:image:alt" content="${l(w.imageAlt)}">
2133
+ `;if(w.imageWidth)F+=`<meta property="og:image:width" content="${l(String(w.imageWidth))}">
2134
+ `;if(w.imageHeight)F+=`<meta property="og:image:height" content="${l(String(w.imageHeight))}">
2135
+ `}if(w.siteName)F+=`<meta property="og:site_name" content="${l(w.siteName)}">
2136
+ `}if(O.twitter){let w=O.twitter;if(F+=`<meta name="twitter:card" content="${l(w.card||"summary_large_image")}">
2137
+ `,w.title||O.title){let R=w.title||O.title||"";F+=`<meta name="twitter:title" content="${l(R)}">
2138
+ `}if(w.description||O.description){let R=w.description||O.description||"";F+=`<meta name="twitter:description" content="${l(R)}">
2139
+ `}if(w.image||O.openGraph&&O.openGraph.image){let R=w.image||(O.openGraph?O.openGraph.image:"")||"";F+=`<meta name="twitter:image" content="${l(R)}">
2140
+ `}if(w.site)F+=`<meta name="twitter:site" content="${l(w.site)}">
2141
+ `;if(w.creator)F+=`<meta name="twitter:creator" content="${l(w.creator)}">
2142
+ `}if(O.structuredData){let w=JSON.stringify(O.structuredData).replace(/<\//g,"<\\/");F+=`<script type="application/ld+json">${w}</script>
2143
+ `}return F.trim()}catch(O){let F=O instanceof Error?O.message:String(O);return $0("SEO",`Error processing @seo directive: ${F}`,m.EVALUATION_ERROR)}})(j);Y=Y.substring(0,G.index)+L+Y.substring(B),Q.lastIndex=G.index+L.length}return Y}function D6($,Z,X){if(X.seo?.enabled===!1)return $;if($.includes("<!-- stx SEO Tags -->")||X.skipDefaultSeoTags===!0)return $;let J=Z.__stx_runtime_head;if(!!(J?.title||J?.meta?.some((K)=>K.property==="og:title"||K.name==="og:title"||K.name==="twitter:title"||K.name==="description")))return $;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test($)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test($))return $;if(!$.includes("<head>")&&!$.includes("<head "))return $;let Q=$.includes("<title>")||$.includes("</title>"),G="";if(Z.title)G=Z.title;else if(Z.meta&&Z.meta.title)G=Z.meta.title;else if(X.seo?.defaultConfig?.title)G=X.seo.defaultConfig.title;else G=X.defaultTitle||"stx Project";let q="";if(Z.description)q=Z.description;else if(Z.meta&&Z.meta.description)q=Z.meta.description;else if(X.seo?.defaultConfig?.description)q=X.seo.defaultConfig.description;else q=X.defaultDescription||"A website built with stx templating engine";let U="";if(Z.image)U=Z.image;else if(Z.meta&&Z.meta.image)U=Z.meta.image;else if(Z.openGraph&&Z.openGraph.image)U=Z.openGraph.image;else if(X.seo?.defaultImage)U=X.seo.defaultImage;else if(X.defaultImage)U=X.defaultImage;let W=`
2155
2144
  <!-- stx SEO Tags -->
2156
- <meta name="title" content="${p(G)}">
2157
- <meta name="description" content="${p(q)}">
2158
- <meta property="og:title" content="${p(G)}">
2159
- <meta property="og:description" content="${p(q)}">
2145
+ <meta name="title" content="${l(G)}">
2146
+ <meta name="description" content="${l(q)}">
2147
+ <meta property="og:title" content="${l(G)}">
2148
+ <meta property="og:description" content="${l(q)}">
2160
2149
  <meta property="og:type" content="website">
2161
2150
  <meta name="twitter:card" content="summary_large_image">
2162
- <meta name="twitter:title" content="${p(G)}">
2163
- <meta name="twitter:description" content="${p(q)}">
2151
+ <meta name="twitter:title" content="${l(G)}">
2152
+ <meta name="twitter:description" content="${l(q)}">
2164
2153
  `;if(U)W+=`
2165
- <meta property="og:image" content="${p(U)}">
2166
- <meta name="twitter:image" content="${p(U)}">
2154
+ <meta property="og:image" content="${l(U)}">
2155
+ <meta name="twitter:image" content="${l(U)}">
2167
2156
  `;let z=$;if(!Q)z=z.replace(/<head[^>]*>/,`$&
2168
- <title>${p(G)}</title>`);return z.replace(/<head[^>]*>/,`$&
2157
+ <title>${l(G)}</title>`);return z.replace(/<head[^>]*>/,`$&
2169
2158
  ${W}
2170
- `)}function p($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var yX=["og:","article:","book:","profile:","fb:","music:","video:"];function B6($){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 H3={name:"meta",handler:($,Z,X,J)=>{if(Z.length<1)return e("Meta","meta directive requires at least the meta name",c.INVALID_DIRECTIVE_SYNTAX);let Y=B6(Z[0]).value,Q;if(Z.length>1){let U=B6(Z[1]);Q=U.quoted?U.value:String(X?.[U.value]??U.value)}else{let U=Y.includes(":")?Y.slice(Y.indexOf(":")+1):Y,W=X?.openGraph;Q=String(X?.[U]??W?.[U]??"")}if(!Q)return"";let q=yX.some((U)=>Y.startsWith(U))?{property:Y,content:Q}:{name:Y,content:Q};if(X)X.__stx_runtime_head=$$(X.__stx_runtime_head??{},{meta:[q]});return""},hasEndTag:!1},B3={name:"structuredData",handler:($,Z,X,J)=>{if($.trim()==="")return e("StructuredData","structuredData directive requires JSON-LD content",c.INVALID_DIRECTIVE_SYNTAX);try{let Y=JSON.parse($);if(!Y["@context"])Y["@context"]="https://schema.org";if(!Y["@type"])return e("StructuredData","structuredData requires @type property",c.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 e("StructuredData",Q,c.EVALUATION_ERROR)}},hasEndTag:!0};function lW(){return[H3,B3]}function cW($,Z){let X=Z.replace(/\/$/,""),J=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2159
+ `)}function l($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var cX=["og:","article:","book:","profile:","fb:","music:","video:"];function F6($){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 O3={name:"meta",handler:($,Z,X,J)=>{if(Z.length<1)return $0("Meta","meta directive requires at least the meta name",m.INVALID_DIRECTIVE_SYNTAX);let Y=F6(Z[0]).value,Q;if(Z.length>1){let U=F6(Z[1]);Q=U.quoted?U.value:String(X?.[U.value]??U.value)}else{let U=Y.includes(":")?Y.slice(Y.indexOf(":")+1):Y,W=X?.openGraph;Q=String(X?.[U]??W?.[U]??"")}if(!Q)return"";let q=cX.some((U)=>Y.startsWith(U))?{property:Y,content:Q}:{name:Y,content:Q};if(X)X.__stx_runtime_head=J$(X.__stx_runtime_head??{},{meta:[q]});return""},hasEndTag:!1},F3={name:"structuredData",handler:($,Z,X,J)=>{if($.trim()==="")return $0("StructuredData","structuredData directive requires JSON-LD content",m.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",m.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,m.EVALUATION_ERROR)}},hasEndTag:!0};function Jz(){return[O3,F3]}function Yz($,Z){let X=Z.replace(/\/$/,""),J=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
2171
2160
  <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
2172
2161
  ${$.map((Q)=>{let G=Q.startsWith("http")?Q:`${X}${Q.startsWith("/")?"":"/"}${Q}`;return` <sitemap>
2173
- <loc>${CX(G)}</loc>
2162
+ <loc>${iX(G)}</loc>
2174
2163
  <lastmod>${J}</lastmod>
2175
2164
  </sitemap>`}).join(`
2176
2165
  `)}
2177
- </sitemapindex>`}async function pW($,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 W=q.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!W.startsWith("/"))W=`/${W}`;if(W!=="/"&&W.endsWith("/"))W=W.slice(0,-1);let z=`${$}/${q}`,K;try{let H=await Bun.file(z).stat();if(H)K=new Date(H.mtime).toISOString().split("T")[0]}catch{}Y.push({loc:W||"/",lastmod:K,priority:W==="/"?1:0.5})}return Y.sort((q,U)=>q.loc.localeCompare(U.loc)),Y}function SX($){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(`
2178
- `).trim()}function iW($){return SX({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function CX($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import PX from"fs";import f0 from"path";async function tW($,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 vX(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 vX($,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(f0.isAbsolute(Y)&&await a(Y))q=Y;else if(Z.componentsDir){let _=f0.join(Z.componentsDir,Y);if(await a(_))q=_}if(!q)q=await Z$(Y,process.cwd(),Z,X);if(!q)return console.error(`Web component source file not found: ${Y}`),null;let U=await Bun.file(q).text();X.add(q);let z=($.outputFormat||"js")==="ts",K=z?xX({name:J,tag:Q,baseElement:G,source:U,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):fX({name:J,tag:Q,baseElement:G,source:U,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await PX.promises.mkdir(H,{recursive:!0});let B=z?"ts":"js",j=f0.join(H,`${Q}.${B}`);if(await Bun.write(j,K),Z.debug)console.log(`Built web component ${J} -> ${j}`);return j}function fX($){let{name:Z,tag:X,baseElement:J="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:q,attributes:U=[]}=$,W=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)W=W.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),W=W.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),W=W.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),W=W.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let z="";if(q)z=`<link rel="stylesheet" href="${q}">`;return`/**
2166
+ </sitemapindex>`}async function Qz($,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 W=q.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!W.startsWith("/"))W=`/${W}`;if(W!=="/"&&W.endsWith("/"))W=W.slice(0,-1);let z=`${$}/${q}`,K;try{let H=await Bun.file(z).stat();if(H)K=new Date(H.mtime).toISOString().split("T")[0]}catch{}Y.push({loc:W||"/",lastmod:K,priority:W==="/"?1:0.5})}return Y.sort((q,U)=>q.loc.localeCompare(U.loc)),Y}function pX($){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 Gz($){return pX({rules:[{userAgent:"*",allow:["/"]}],sitemap:$})}function iX($){return $.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}import nX from"fs";import h0 from"path";async function Hz($,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 sX(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 sX($,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 Y$(Y,process.cwd(),Z,X);if(!q)return console.error(`Web component source file not found: ${Y}`),null;let U=await Bun.file(q).text();X.add(q);let z=($.outputFormat||"js")==="ts",K=z?rX({name:J,tag:Q,baseElement:G,source:U,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[],attributeTypes:$.attributeTypes||{}}):oX({name:J,tag:Q,baseElement:G,source:U,shadowDOM:$.shadowDOM??!0,template:$.template??!0,styleSource:$.styleSource,attributes:$.attributes||[]}),H=Z.webComponents?.outputDir||"dist/web-components";await nX.promises.mkdir(H,{recursive:!0});let B=z?"ts":"js",j=h0.join(H,`${Q}.${B}`);if(await Bun.write(j,K),Z.debug)console.log(`Built web component ${J} -> ${j}`);return j}function oX($){let{name:Z,tag:X,baseElement:J="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:q,attributes:U=[]}=$,W=Y.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!Q)W=W.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),W=W.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),W=W.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),W=W.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let z="";if(q)z=`<link rel="stylesheet" href="${q}">`;return`/**
2179
2168
  * ${Z} Web Component
2180
2169
  * Auto-generated from stx component
2181
2170
  */
@@ -2267,8 +2256,8 @@ class ${Z.replace(/\W/g,"")} extends ${J} {
2267
2256
 
2268
2257
  // Register the web component
2269
2258
  customElements.define('${X}', ${Z.replace(/\W/g,"")})
2270
- `}function xX($){let{name:Z,tag:X,baseElement:J="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:q,attributes:U=[],attributeTypes:W={}}=$,z=Z.replace(/\W/g,""),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>");K=K.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let H=q?`<link rel="stylesheet" href="${q}">`:"",B=(R)=>{switch(W[R]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},j=(R)=>R.replace(/-([a-z])/g,(D,N)=>N.toUpperCase()),_=U.map((R)=>` private _${j(R)}: ${B(R)} | null = null;`).join(`
2271
- `),F=U.map((R)=>{let D=B(R),N=j(R);return`
2259
+ `}function rX($){let{name:Z,tag:X,baseElement:J="HTMLElement",source:Y,shadowDOM:Q,template:G,styleSource:q,attributes:U=[],attributeTypes:W={}}=$,z=Z.replace(/\W/g,""),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>");K=K.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let H=q?`<link rel="stylesheet" href="${q}">`:"",B=(R)=>{switch(W[R]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},j=(R)=>R.replace(/-([a-z])/g,(D,N)=>N.toUpperCase()),_=U.map((R)=>` private _${j(R)}: ${B(R)} | null = null;`).join(`
2260
+ `),L=U.map((R)=>{let D=B(R),N=j(R);return`
2272
2261
  get ${N}(): ${D} | null {
2273
2262
  return this._${N};
2274
2263
  }
@@ -2314,7 +2303,7 @@ catch { return value; }
2314
2303
  default: return value;
2315
2304
  }
2316
2305
  }
2317
- `:"",L=G?`
2306
+ `:"",F=G?`
2318
2307
  private _createTemplate(): void {
2319
2308
  const template = document.createElement('template');
2320
2309
  template.innerHTML = \`${H}${K}\`;
@@ -2356,7 +2345,7 @@ ${_}
2356
2345
  super();
2357
2346
  ${Q?'this.attachShadow({ mode: "open" });':""}
2358
2347
  }
2359
- ${L}
2348
+ ${F}
2360
2349
  ${Q?`
2361
2350
  private _processSlots(): void {
2362
2351
  const slots = this.shadowRoot!.querySelectorAll('slot');
@@ -2395,7 +2384,7 @@ ${Q?`
2395
2384
  }
2396
2385
  }`}
2397
2386
  ${O}
2398
- ${F}
2387
+ ${L}
2399
2388
 
2400
2389
  connectedCallback(): void {
2401
2390
  if (this._initialized) return;
@@ -2422,35 +2411,35 @@ declare global {
2422
2411
 
2423
2412
  // Register the web component
2424
2413
  customElements.define('${X}', ${z});
2425
- `}var j3={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function _3($){let Z=$.split("").reduce((X,J)=>(X<<5)-X+J.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function gX($,Z,X={}){let J={...j3,...X},Y=_3(Z);switch(J.strategy){case"shadow":return $;case"prefix":return uX($,J.prefix||Z,J.preserveOriginal);case"attribute":return hX($,Y,J.attributeName||"data-v",J.preserveOriginal);case"bem":return dX($,Z,J.preserveOriginal);default:return $}}function hX($,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 uX($,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 dX($,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 mX($,Z,X={}){let J={...j3,...X};if(J.strategy==="shadow")return $;if(J.strategy==="attribute"){let Y=_3(Z),G=`${J.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(q,U,W)=>{if(/^(?:script|style|!--)$/i.test(U))return q;let z=W.trimEnd().endsWith("/"),K=z?W.slice(0,-1):W;return`<${U}${K} ${G}${z?"/":""}>`})}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((U)=>{if(!U)return U;if(U.startsWith(Y))return U;return`${Y}__${U}`}).join(" ")}"`})}return $}function eW($,Z={}){let X={...j3,...Z},J=_3($);return`${X.attributeName||"data-v"}-${J}`}function $z($,Z,X={}){let J="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,q,U)=>{if(/\bscoped\b/i.test(q)||X.strategy!=="shadow")J+=`${gX(U,Z,X)}
2414
+ `}var L3={strategy:"attribute",attributeName:"data-v",preserveOriginal:!0};function w3($){let Z=$.split("").reduce((X,J)=>(X<<5)-X+J.charCodeAt(0)|0,0);return Math.abs(Z).toString(36).slice(0,8)}function aX($,Z,X={}){let J={...L3,...X},Y=w3(Z);switch(J.strategy){case"shadow":return $;case"prefix":return eX($,J.prefix||Z,J.preserveOriginal);case"attribute":return tX($,Y,J.attributeName||"data-v",J.preserveOriginal);case"bem":return $J($,Z,J.preserveOriginal);default:return $}}function tX($,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 eX($,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 $J($,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 ZJ($,Z,X={}){let J={...L3,...X};if(J.strategy==="shadow")return $;if(J.strategy==="attribute"){let Y=w3(Z),G=`${J.attributeName||"data-v"}-${Y}`;return $.replace(/<([a-z][a-z0-9-]*)([^>]*)>/gi,(q,U,W)=>{if(/^(?:script|style|!--)$/i.test(U))return q;let z=W.trimEnd().endsWith("/"),K=z?W.slice(0,-1):W;return`<${U}${K} ${G}${z?"/":""}>`})}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((U)=>{if(!U)return U;if(U.startsWith(Y))return U;return`${Y}__${U}`}).join(" ")}"`})}return $}function Bz($,Z={}){let X={...L3,...Z},J=w3($);return`${X.attributeName||"data-v"}-${J}`}function jz($,Z,X={}){let J="",Y=$.replace(/<style([^>]*)>([\s\S]*?)<\/style>/gi,(G,q,U)=>{if(/\bscoped\b/i.test(q)||X.strategy!=="shadow")J+=`${aX(U,Z,X)}
2426
2415
  `;else J+=`${U}
2427
- `;return""});return{html:mX(Y,Z,X),css:J.trim()}}function p1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Zz($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:U={},events:W={},methods:z={},state:K={}}=$,H=Z.replace(/\W/g,""),B=Object.keys(q),j=B.filter((T)=>q[T].attribute!==!1).map((T)=>q[T].attribute||p1(T)),_=B.map((T)=>{let A=q[T],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._${T} = ${M};`}).join(`
2428
- `),F=B.map((T)=>{let A=q[T],M=A.attribute!==!1?A.attribute||p1(T):null,k=A.reflect&&M?`
2416
+ `;return""});return{html:ZJ(Y,Z,X),css:J.trim()}}function h1($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function _z($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:U={},events:W={},methods:z={},state:K={}}=$,H=Z.replace(/\W/g,""),B=Object.keys(q),j=B.filter((I)=>q[I].attribute!==!1).map((I)=>q[I].attribute||h1(I)),_=B.map((I)=>{let A=q[I],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._${I} = ${M};`}).join(`
2417
+ `),L=B.map((I)=>{let A=q[I],M=A.attribute!==!1?A.attribute||h1(I):null,T=A.reflect&&M?`
2429
2418
  if (value !== null && value !== undefined) {
2430
2419
  ${A.type==="boolean"?`if (value) { this.setAttribute('${M}', ''); }
2431
2420
  else { this.removeAttribute('${M}'); }`:`this.setAttribute('${M}', ${A.type==="object"||A.type==="array"?"JSON.stringify(value)":"String(value)"});`}
2432
2421
  }
2433
2422
  else {
2434
2423
  this.removeAttribute('${M}');
2435
- }`:"",I=A.observer?`this.${A.observer}(value, oldValue);`:"",y=A.render!==!1?"this._scheduleRender();":"";return`
2436
- get ${T}() {
2437
- return this._${T};
2424
+ }`:"",k=A.observer?`this.${A.observer}(value, oldValue);`:"",y=A.render!==!1?"this._scheduleRender();":"";return`
2425
+ get ${I}() {
2426
+ return this._${I};
2438
2427
  }
2439
2428
 
2440
- set ${T}(value) {
2441
- const oldValue = this._${T};
2429
+ set ${I}(value) {
2430
+ const oldValue = this._${I};
2442
2431
  if (oldValue === value) return;
2443
- this._${T} = value;${k}
2444
- ${I}
2432
+ this._${I} = value;${T}
2433
+ ${k}
2445
2434
  ${y}
2446
- this.dispatchEvent(new CustomEvent('${T}-changed', {
2435
+ this.dispatchEvent(new CustomEvent('${I}-changed', {
2447
2436
  detail: { value, oldValue },
2448
2437
  bubbles: true
2449
2438
  }));
2450
2439
  }`}).join(`
2451
2440
  `),V=j.length>0?`
2452
2441
  static get observedAttributes() {
2453
- return [${j.map((T)=>`'${T}'`).join(", ")}];
2442
+ return [${j.map((I)=>`'${I}'`).join(", ")}];
2454
2443
  }
2455
2444
 
2456
2445
  attributeChangedCallback(name, oldValue, newValue) {
@@ -2461,12 +2450,12 @@ else {
2461
2450
  this[propName] = this._deserializeAttribute(newValue, propDef.type);
2462
2451
  }
2463
2452
  ${U.attributeChanged||""}
2464
- }`:"",O=Object.entries(W).map(([T,A])=>{return`this._root.addEventListener('${T}', (e) => { ${A} });`}).join(`
2465
- `),L=Object.entries(z).map(([T,A])=>{return`
2466
- ${T}() {
2453
+ }`:"",O=Object.entries(W).map(([I,A])=>{return`this._root.addEventListener('${I}', (e) => { ${A} });`}).join(`
2454
+ `),F=Object.entries(z).map(([I,A])=>{return`
2455
+ ${I}() {
2467
2456
  ${A}
2468
2457
  }`}).join(`
2469
- `),w=JSON.stringify(Object.fromEntries(B.map((T)=>[T,q[T]]))),R=JSON.stringify(Object.fromEntries(B.filter((T)=>q[T].attribute!==!1).map((T)=>[q[T].attribute||p1(T),T]))),D=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),N=Q.replace(/\\/g,"\\\\").replace(/`/g,"\\`");return`/**
2458
+ `),w=JSON.stringify(Object.fromEntries(B.map((I)=>[I,q[I]]))),R=JSON.stringify(Object.fromEntries(B.filter((I)=>q[I].attribute!==!1).map((I)=>[q[I].attribute||h1(I),I]))),D=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),N=Q.replace(/\\/g,"\\\\").replace(/`/g,"\\`");return`/**
2470
2459
  * ${Z} - Reactive Web Component
2471
2460
  * Auto-generated with reactive properties and lifecycle management
2472
2461
  *
@@ -2497,7 +2486,7 @@ ${_}
2497
2486
  // =========================================================================
2498
2487
  // Reactive Properties
2499
2488
  // =========================================================================
2500
- ${F}
2489
+ ${L}
2501
2490
 
2502
2491
  // =========================================================================
2503
2492
  // State Management
@@ -2617,7 +2606,7 @@ ${V}
2617
2606
  // =========================================================================
2618
2607
  // Custom Methods
2619
2608
  // =========================================================================
2620
- ${L}
2609
+ ${F}
2621
2610
  }
2622
2611
 
2623
2612
  // Register the custom element
@@ -2626,7 +2615,7 @@ customElements.define('${X}', ${H});
2626
2615
  // Export for module usage
2627
2616
  export { ${H} };
2628
2617
  export default ${H};
2629
- `}function Xz($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:U={},events:W={},methods:z={},state:K={}}=$,H=Z.replace(/\W/g,""),B=Object.keys(q),j=B.filter((A)=>q[A].attribute!==!1).map((A)=>q[A].attribute||p1(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"}},F=B.length>0?`
2618
+ `}function Vz($){let{name:Z,tag:X,baseElement:J="HTMLElement",template:Y,styles:Q="",shadowDOM:G=!0,properties:q={},lifecycle:U={},events:W={},methods:z={},state:K={}}=$,H=Z.replace(/\W/g,""),B=Object.keys(q),j=B.filter((A)=>q[A].attribute!==!1).map((A)=>q[A].attribute||h1(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=B.length>0?`
2630
2619
  /**
2631
2620
  * Props interface for ${Z}
2632
2621
  */
@@ -2646,25 +2635,25 @@ ${Object.entries(K).map(([A,M])=>` ${A}: ${typeof M};`).join(`
2646
2635
  export interface ${H}State {
2647
2636
  [key: string]: unknown;
2648
2637
  }
2649
- `,O=B.map((A)=>{let M=q[A],k=_(M.type);return` private _${A}: ${k};`}).join(`
2650
- `),L=B.map((A)=>{let M=q[A],k=_(M.type),I=M.attribute!==!1?M.attribute||p1(A):null,y=M.default!==void 0?JSON.stringify(M.default):M.type==="string"?'""':M.type==="number"?"0":M.type==="boolean"?"false":M.type==="array"?"[]":"{}",E=M.reflect&&I?`
2638
+ `,O=B.map((A)=>{let M=q[A],T=_(M.type);return` private _${A}: ${T};`}).join(`
2639
+ `),F=B.map((A)=>{let M=q[A],T=_(M.type),k=M.attribute!==!1?M.attribute||h1(A):null,y=M.default!==void 0?JSON.stringify(M.default):M.type==="string"?'""':M.type==="number"?"0":M.type==="boolean"?"false":M.type==="array"?"[]":"{}",E=M.reflect&&k?`
2651
2640
  if (value !== null && value !== undefined) {
2652
- ${M.type==="boolean"?`if (value) { this.setAttribute('${I}', ''); }
2653
- else { this.removeAttribute('${I}'); }`:`this.setAttribute('${I}', ${M.type==="object"||M.type==="array"?"JSON.stringify(value)":"String(value)"});`}
2641
+ ${M.type==="boolean"?`if (value) { this.setAttribute('${k}', ''); }
2642
+ else { this.removeAttribute('${k}'); }`:`this.setAttribute('${k}', ${M.type==="object"||M.type==="array"?"JSON.stringify(value)":"String(value)"});`}
2654
2643
  }
2655
2644
  else {
2656
- this.removeAttribute('${I}');
2657
- }`:"",b=M.observer?`this.${M.observer}(value, oldValue);`:"",C=M.render!==!1?"this._scheduleRender();":"";return`
2658
- get ${A}(): ${k} {
2645
+ this.removeAttribute('${k}');
2646
+ }`:"",b=M.observer?`this.${M.observer}(value, oldValue);`:"",S=M.render!==!1?"this._scheduleRender();":"";return`
2647
+ get ${A}(): ${T} {
2659
2648
  return this._${A};
2660
2649
  }
2661
2650
 
2662
- set ${A}(value: ${k}) {
2651
+ set ${A}(value: ${T}) {
2663
2652
  const oldValue = this._${A};
2664
2653
  if (oldValue === value) return;
2665
2654
  this._${A} = value;${E}
2666
2655
  ${b}
2667
- ${C}
2656
+ ${S}
2668
2657
  this.dispatchEvent(new CustomEvent('${A}-changed', {
2669
2658
  detail: { value, oldValue },
2670
2659
  bubbles: true
@@ -2690,14 +2679,14 @@ else {
2690
2679
  ${A}(): void {
2691
2680
  ${M}
2692
2681
  }`}).join(`
2693
- `),N=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),T=Q.replace(/\\/g,"\\\\").replace(/`/g,"\\`");return`/**
2682
+ `),N=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),I=Q.replace(/\\/g,"\\\\").replace(/`/g,"\\`");return`/**
2694
2683
  * ${Z} - Reactive Web Component (TypeScript)
2695
2684
  * Auto-generated with reactive properties and lifecycle management
2696
2685
  *
2697
2686
  * @customElement ${X}
2698
2687
  */
2699
2688
 
2700
- ${F}
2689
+ ${L}
2701
2690
  ${V}
2702
2691
 
2703
2692
  /**
@@ -2718,7 +2707,7 @@ interface PropertyDefinition {
2718
2707
  export class ${H} extends ${J} {
2719
2708
  // Property definitions
2720
2709
  private _propertyDefs: Record<string, PropertyDefinition> = ${JSON.stringify(q)};
2721
- private _attrToProp: Record<string, string> = ${JSON.stringify(Object.fromEntries(B.filter((A)=>q[A].attribute!==!1).map((A)=>[q[A].attribute||p1(A),A])))};
2710
+ private _attrToProp: Record<string, string> = ${JSON.stringify(Object.fromEntries(B.filter((A)=>q[A].attribute!==!1).map((A)=>[q[A].attribute||h1(A),A])))};
2722
2711
 
2723
2712
  // Internal state
2724
2713
  private _state: ${H}State = ${JSON.stringify(K)};
@@ -2735,7 +2724,7 @@ ${O}
2735
2724
  this._root = ${G?"this.shadowRoot!":"this"};
2736
2725
 
2737
2726
  // Initialize properties with defaults
2738
- ${B.map((A)=>{let M=q[A],k=M.default!==void 0?JSON.stringify(M.default):M.type==="string"?'""':M.type==="number"?"0":M.type==="boolean"?"false":M.type==="array"?"[]":"{}";return` this._${A} = ${k};`}).join(`
2727
+ ${B.map((A)=>{let M=q[A],T=M.default!==void 0?JSON.stringify(M.default):M.type==="string"?'""':M.type==="number"?"0":M.type==="boolean"?"false":M.type==="array"?"[]":"{}";return` this._${A} = ${T};`}).join(`
2739
2728
  `)}
2740
2729
 
2741
2730
  // Initial render
@@ -2745,7 +2734,7 @@ ${B.map((A)=>{let M=q[A],k=M.default!==void 0?JSON.stringify(M.default):M.type==
2745
2734
  // =========================================================================
2746
2735
  // Reactive Properties
2747
2736
  // =========================================================================
2748
- ${L}
2737
+ ${F}
2749
2738
 
2750
2739
  // =========================================================================
2751
2740
  // State Management
@@ -2791,7 +2780,7 @@ ${L}
2791
2780
  * Render the component template
2792
2781
  */
2793
2782
  private _render(): void {
2794
- const template = \`${T?`<style>${T}</style>`:""}${N}\`;
2783
+ const template = \`${I?`<style>${I}</style>`:""}${N}\`;
2795
2784
 
2796
2785
  // Interpolate template with property values
2797
2786
  const rendered = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, propName) => {
@@ -2878,7 +2867,7 @@ declare global {
2878
2867
  customElements.define('${X}', ${H});
2879
2868
 
2880
2869
  export default ${H};
2881
- `}function Jz(){return`/**
2870
+ `}function Oz(){return`/**
2882
2871
  * ReactiveElement Mixin
2883
2872
  * Adds reactive properties and lifecycle management to web components
2884
2873
  */
@@ -3000,7 +2989,7 @@ else {
3000
2989
 
3001
2990
  export { ReactiveElement };
3002
2991
  export default ReactiveElement;
3003
- `}function Yz(){return`/**
2992
+ `}function Fz(){return`/**
3004
2993
  * stx Reactive Web Components Runtime
3005
2994
  * Provides base classes and utilities for reactive web components
3006
2995
  */
@@ -3217,7 +3206,7 @@ else {
3217
3206
  };
3218
3207
 
3219
3208
  })(typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : this);
3220
- `}function lX($,Z){let X=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),J=X?X[1].trim():"",Y=Z,Q=[],G=!0;if(J){let K=J.match(/export\s+default\s+({[\s\S]*})/);if(K)try{let H=K[1],B=H.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(B)Y=B[1];let j=H.match(/props\s*:\s*\[([\s\S]*?)\]/);if(j)Q=j[1].split(",").map((F)=>F.trim().replace(/['"`]/g,"")).filter((F)=>F.length>0);let _=H.match(/shadowDOM\s*:\s*(true|false)/);if(_)G=_[1]==="true"}catch{}}let q=$.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),U=q?q[1].trim():"",W=$.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),z=W?W[1].trim():"";return{tag:Y,props:Q,template:U,styles:z,script:J,shadowDOM:G}}function cX($){let{tag:Z,props:X,template:J,styles:Y,shadowDOM:Q}=$,G=Z.split("-").map((K)=>K.charAt(0).toUpperCase()+K.slice(1)).join(""),q=J.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),U=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),W=X.map((K)=>`'${K}'`).join(", "),z=X.map((K)=>`
3209
+ `}function XJ($,Z){let X=$.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),J=X?X[1].trim():"",Y=Z,Q=[],G=!0;if(J){let K=J.match(/export\s+default\s+({[\s\S]*})/);if(K)try{let H=K[1],B=H.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(B)Y=B[1];let j=H.match(/props\s*:\s*\[([\s\S]*?)\]/);if(j)Q=j[1].split(",").map((L)=>L.trim().replace(/['"`]/g,"")).filter((L)=>L.length>0);let _=H.match(/shadowDOM\s*:\s*(true|false)/);if(_)G=_[1]==="true"}catch{}}let q=$.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),U=q?q[1].trim():"",W=$.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),z=W?W[1].trim():"";return{tag:Y,props:Q,template:U,styles:z,script:J,shadowDOM:G}}function JJ($){let{tag:Z,props:X,template:J,styles:Y,shadowDOM:Q}=$,G=Z.split("-").map((K)=>K.charAt(0).toUpperCase()+K.slice(1)).join(""),q=J.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),U=Y.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),W=X.map((K)=>`'${K}'`).join(", "),z=X.map((K)=>`
3221
3210
  get ${K}() {
3222
3211
  return this.getAttribute('${K}') || '';
3223
3212
  }
@@ -3268,14 +3257,14 @@ ${z}
3268
3257
  }
3269
3258
 
3270
3259
  customElements.define('${Z}', ${G});
3271
- `}async function F6($,Z,X,J){if(Z.length<1)return e("WebComponent","@webcomponent directive requires at least the tag name parameter",c.INVALID_DIRECTIVE_SYNTAX);let Y=Z[0].replace(/['"]/g,""),G=(X.__stx_options||{}).componentsDir||"components",q=f0.isAbsolute(G)?[f0.join(G,`${Y}.stx`),f0.join(f0.dirname(J),`${Y}.stx`)]:[f0.join(f0.dirname(J),G,`${Y}.stx`),f0.join(process.cwd(),G,`${Y}.stx`),f0.join(f0.dirname(J),`${Y}.stx`)],U=null;for(let K of q)if(await a(K)){U=await Bun.file(K).text();break}if(!U)return e("WebComponent",`Component file not found: ${Y}.stx`,c.FILE_NOT_FOUND);let W=lX(U,Y);return`<script type="module">
3272
- ${cX(W)}
3273
- </script>`}var I6={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:N6,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:x7,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:F6,hasEndTag:!1,description:"Include a web component in the template"},R6,D6,H3,B3,d$,l$,c$,m$,C7,D7,o7,Y3,...T6],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 iX($,Z,X){let J=Z||"pages";if($)return{root:$,pagesDir:J};let Y=X||process.cwd(),Q=I0.join(Y,"resources","views"),G=I0.join(Y,"resources","layouts");if(X$.existsSync(Q)&&X$.existsSync(G))return{root:"resources",pagesDir:"views"};let q=I0.join(Y,"resources","views","pages");if(X$.existsSync(q))return{root:"resources/views",pagesDir:J};return{root:".",pagesDir:J}}var L6=new Set,J$=["partialsDir","componentsDir","layoutsDir"],V3=new WeakMap;function nX($,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 sX($,Z){let X=!$.root,J=iX($.root,$.pagesDir,Z);if($.root=J.root,$.pagesDir=J.pagesDir,X&&J.root!=="."){let Y=`${Z}::${J.root}`;if(!L6.has(Y))L6.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(!V3.has($)){let Y={};for(let Q of J$){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}V3.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of J$){let G=$[Q];if(typeof G!=="string"||!G)continue;if(I0.isAbsolute(G)||nX(G,Y))continue;$[Q]=I0.join(Y,G)}}for(let Y of J$){let Q=$[Y];if(typeof Q!=="string"||!Q||I0.isAbsolute(Q))continue;$[Y]=I0.resolve(Z,Q)}return $}function oX($,Z){let X=V3.get($);for(let J of J$){let Y=$[J];if(typeof Y!=="string"||!Y)continue;let Q=I0.isAbsolute(Y)?Y:I0.join(Z,Y);if(X$.existsSync(Q))continue;let G=X?.[J]??Y,q=$.root,U=!!q&&q!==".";console.warn(`[stx] ${String(J)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(U?`, resolved under root "${q}".`:"."))}}function rX($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function aX($){if(A6($.stateDir),$.stateDir=M6(),$.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 i1=null,w6=new Map,Y$=null;async function O3($){if(!$){if(i1)return i1;if(Y$)return Y$}let Z=$?I0.resolve($):process.cwd(),X=w6.get(Z);if(X)return X;let J=(async()=>{let Q=(await pX({name:"stx",alias:"ui",cwd:Z,defaultConfig:I6,verbose:!1})).config;if(rX(Q),aX(Q),sX(Q,Z),oX(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-rp0m678g.js"),q=[],U=[];for(let W of Q.plugins){let z=typeof W==="string"?W:W[0],K=typeof W==="string"?{}:W[1]||{};try{let H,B;try{H=await import(z),B=I0.dirname(f.resolve(z))}catch{let _=I0.resolve(process.cwd(),z);H=await import(_),B=I0.dirname(_)}let j=H.default||H;if(!G.has(j.name))await G.register(j,Q);if(j.components){let _=Array.isArray(j.components)?j.components:[j.components];for(let F of _)q.push(I0.resolve(B,F))}if(j.pages){let _=I0.resolve(B,j.pages),F=K.path||"/";U.push({dir:_,prefix:F})}if(j.setup){let _={addDirective:(F)=>{Q.customDirectives=Q.customDirectives||[],Q.customDirectives.push(F)},addRoute:(F,V)=>{Q.apiRoutes=Q.apiRoutes||{},Q.apiRoutes[F]=V},addMiddleware:(F)=>{Q.middleware=Q.middleware||[],Q.middleware.push(F)},pluginDir:B,config:Q};await j.setup(K,_)}console.log(`[stx] Plugin loaded: ${j.name||z}`)}catch(H){console.warn(`[stx] Failed to load plugin ${z}:`,H.message)}}Q._pluginComponentDirs=q,Q._pluginPageDirs=U}return Q})();if(w6.set(Z,J),!$)Y$=J,J.then((Y)=>{i1=Y}).catch(()=>{});return J}var k6=new Proxy(I6,{get($,Z){if(i1&&Z in i1)return i1[Z];if(!Y$)O3().catch((X)=>{console.warn("[stx] Failed to load config file:",X?.message||X)});return $[Z]}});function wz($){return $}function Rz($){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 L3=new Map;async function $J($,Z={}){try{if(!await a($))throw Error(`Markdown file not found: ${$}`);let J=(await tX.promises.stat($)).mtime.getTime();if(Z.cache&&L3.has($)){let K=L3.get($);if(K.updatedAt>=J)return{content:K.content,data:K.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=v7(Y),q=Z.markdown||k6.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},W=j5(G,{gfm:!0});if(q.syntaxHighlighting?.enabled&&q.syntaxHighlighting?.serverSide)W=await ZJ(W,q.syntaxHighlighting?.defaultTheme||"github-dark",q.syntaxHighlighting?.highlightUnknownLanguages||!1);let z={content:W,data:Q||{}};if(Z.cache)L3.set($,{...z,updatedAt:J});return z}catch(X){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,X);let J=X instanceof Error?X.message:String(X);return{content:K0("Markdown File",`Error reading/parsing markdown file: ${J}`,$,"",0,""),data:{}}}}var Q$=null;async function ZJ($,Z,X){let J=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Q$)try{Q$=await eX({theme:Z||"github-dark",cache:!0})}catch(q){return console.error("Failed to initialize ts-syntax-highlighter:",q),$}let Y=async(q,U,W,z)=>{let K=z.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=W||(X?"text":"");if(!H)return q;try{if(!Q$.getSupportedLanguages().includes(H))return q;return(await Q$.highlight(K,H,{theme:Z})).html}catch(B){console.error(`Error highlighting code block with language ${W}:`,B)}return q},Q=$,G=$.matchAll(J);for(let q of G){let[U,W,z,K]=q,H=await Y(U,W,z,K);Q=Q.replace(U,H)}return Q}async function E6($,Z,X="",J={}){return await XJ($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,q,U,W)=>{try{let z=q;if(!F3.isAbsolute(q))z=F3.resolve(F3.dirname(X),q);let K={};if(U)try{try{K=JSON.parse(U)}catch{if(J.debug)console.warn("Using safer alternative for parsing JS object literal");let O=U.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let L of O){let w=L.indexOf(":");if(w>0){let R=L.substring(0,w).trim(),D=L.substring(w+1).trim(),N=D.startsWith('"')&&D.endsWith('"'),T=D.startsWith("'")&&D.endsWith("'");if(N||T)D=D.substring(1,D.length-1);K[R]=D}}}}catch(V){if(J.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:H,data:B}=await $J(z,J),j={...Z,...B,...K},_=H,F=/\{\{([^}]+)\}\}/g;return _=_.replace(F,(V,O)=>{let L=O.trim();return j[L]!==void 0?String(j[L]):V}),_}catch(z){let K=z instanceof Error?z.message:String(z);return K0("Markdown File",`Error including markdown file: ${K}`,X,$,W,G)}})}async function XJ($,Z,X){let J=[],Y;while((Y=Z.exec($))!==null){let q=Y[0],U=Y.index,W=Y;J.push(X(...W).then((z)=>({match:q,replacement:z,index:U})))}let Q=await Promise.all(J);Q.sort((q,U)=>U.index-q.index);let G=$;for(let{match:q,replacement:U}of Q)G=G.replace(q,()=>U);return G}function W1($,Z){try{let X=$.trim();if(G0(X))return q0(X,Object.keys(Z))(...Object.values(Z));else return t(X,Z)}catch{return!1}}class G${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]!==`
3260
+ `}async function N6($,Z,X,J){if(Z.length<1)return $0("WebComponent","@webcomponent directive requires at least the tag name parameter",m.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`)],U=null;for(let K of q)if(await t(K)){U=await Bun.file(K).text();break}if(!U)return $0("WebComponent",`Component file not found: ${Y}.stx`,m.FILE_NOT_FOUND);let W=XJ(U,Y);return`<script type="module">
3261
+ ${JJ(W)}
3262
+ </script>`}var S6={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:T6,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:m7,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:N6,hasEndTag:!1,description:"Include a web component in the template"},I6,k6,O3,F3,i$,s$,o$,n$,g7,k7,$6,W3,...y6],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 QJ($,Z,X){let J=Z||"pages";if($)return{root:$,pagesDir:J};let Y=X||process.cwd(),Q=k0.join(Y,"resources","views"),G=k0.join(Y,"resources","layouts");if(Q$.existsSync(Q)&&Q$.existsSync(G))return{root:"resources",pagesDir:"views"};let q=k0.join(Y,"resources","views","pages");if(Q$.existsSync(q))return{root:"resources/views",pagesDir:J};return{root:".",pagesDir:J}}var A6=new Set,G$=["partialsDir","componentsDir","layoutsDir"],R3=new WeakMap;function GJ($,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 qJ($,Z){let X=!$.root,J=QJ($.root,$.pagesDir,Z);if($.root=J.root,$.pagesDir=J.pagesDir,X&&J.root!=="."){let Y=`${Z}::${J.root}`;if(!A6.has(Y))A6.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(!R3.has($)){let Y={};for(let Q of G$){let G=$[Q];if(typeof G==="string"&&G)Y[Q]=G}R3.set($,Y)}if($.root&&$.root!=="."){let Y=$.root;for(let Q of G$){let G=$[Q];if(typeof G!=="string"||!G)continue;if(k0.isAbsolute(G)||GJ(G,Y))continue;$[Q]=k0.join(Y,G)}}for(let Y of G$){let Q=$[Y];if(typeof Q!=="string"||!Q||k0.isAbsolute(Q))continue;$[Y]=k0.resolve(Z,Q)}return $}function UJ($,Z){let X=R3.get($);for(let J of G$){let Y=$[J];if(typeof Y!=="string"||!Y)continue;let Q=k0.isAbsolute(Y)?Y:k0.join(Z,Y);if(Q$.existsSync(Q))continue;let G=X?.[J]??Y,q=$.root,U=!!q&&q!==".";console.warn(`[stx] ${String(J)} resolves to "${Q}", which does not exist. Configured as "${G}"`+(U?`, resolved under root "${q}".`:"."))}}function WJ($){if($.customDirectives)$.customDirectives=[...$.customDirectives];if($.middleware)$.middleware=[...$.middleware];if($.apiRoutes)$.apiRoutes={...$.apiRoutes}}function zJ($){if(E6($.stateDir),$.stateDir=b6(),$.cachePath=V5($.cachePath),$.build)$.build.cacheDir=V5($.build.cacheDir);if($.media?.cache)$.media.cache.directory=V5($.media.cache.directory);if($.story)$.story.outDir=V5($.story.outDir)}var u1=null,M6=new Map,q$=null;async function D3($){if(!$){if(u1)return u1;if(q$)return q$}let Z=$?k0.resolve($):process.cwd(),X=M6.get(Z);if(X)return X;let J=(async()=>{let Q=(await YJ({name:"stx",alias:"ui",cwd:Z,defaultConfig:S6,verbose:!1})).config;if(WJ(Q),zJ(Q),qJ(Q,Z),UJ(Q,Z),Q.plugins&&Q.plugins.length>0){let{pluginManager:G}=await import("./chunk-n2r83qwt.js"),q=[],U=[];for(let W of Q.plugins){let z=typeof W==="string"?W:W[0],K=typeof W==="string"?{}:W[1]||{};try{let H,B;try{H=await import(z),B=k0.dirname(v.resolve(z))}catch{let _=k0.resolve(process.cwd(),z);H=await import(_),B=k0.dirname(_)}let j=H.default||H;if(!G.has(j.name))await G.register(j,Q);if(j.components){let _=Array.isArray(j.components)?j.components:[j.components];for(let L of _)q.push(k0.resolve(B,L))}if(j.pages){let _=k0.resolve(B,j.pages),L=K.path||"/";U.push({dir:_,prefix:L})}if(j.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:B,config:Q};await j.setup(K,_)}console.log(`[stx] Plugin loaded: ${j.name||z}`)}catch(H){console.warn(`[stx] Failed to load plugin ${z}:`,H.message)}}Q._pluginComponentDirs=q,Q._pluginPageDirs=U}return Q})();if(M6.set(Z,J),!$)q$=J,J.then((Y)=>{u1=Y}).catch(()=>{});return J}var C6=new Proxy(S6,{get($,Z){if(u1&&Z in u1)return u1[Z];if(!q$)D3().catch((X)=>{console.warn("[stx] Failed to load config file:",X?.message||X)});return $[Z]}});function Pz($){return $}function vz($){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 A3=new Map;async function BJ($,Z={}){try{if(!await t($))throw Error(`Markdown file not found: ${$}`);let J=(await KJ.promises.stat($)).mtime.getTime();if(Z.cache&&A3.has($)){let K=A3.get($);if(K.updatedAt>=J)return{content:K.content,data:K.data}}let Y=await Bun.file($).text(),{data:Q,content:G}=u7(Y),q=Z.markdown||C6.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},W=K5(G,{gfm:!0});if(q.syntaxHighlighting?.enabled&&q.syntaxHighlighting?.serverSide)W=await jJ(W,q.syntaxHighlighting?.defaultTheme||"github-dark",q.syntaxHighlighting?.highlightUnknownLanguages||!1);let z={content:W,data:Q||{}};if(Z.cache)A3.set($,{...z,updatedAt:J});return z}catch(X){if(Z.debug)console.error(`Error reading/parsing markdown file ${$}:`,X);let J=X instanceof Error?X.message:String(X);return{content:B0("Markdown File",`Error reading/parsing markdown file: ${J}`,$,"",0,""),data:{}}}}var U$=null;async function jJ($,Z,X){let J=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!U$)try{U$=await HJ({theme:Z||"github-dark",cache:!0})}catch(q){return console.error("Failed to initialize ts-syntax-highlighter:",q),$}let Y=async(q,U,W,z)=>{let K=z.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&#39;/g,"'"),H=W||(X?"text":"");if(!H)return q;try{if(!U$.getSupportedLanguages().includes(H))return q;return(await U$.highlight(K,H,{theme:Z})).html}catch(B){console.error(`Error highlighting code block with language ${W}:`,B)}return q},Q=$,G=$.matchAll(J);for(let q of G){let[U,W,z,K]=q,H=await Y(U,W,z,K);Q=Q.replace(U,H)}return Q}async function P6($,Z,X="",J={}){return await _J($,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(G,q,U,W)=>{try{let z=q;if(!N3.isAbsolute(q))z=N3.resolve(N3.dirname(X),q);let K={};if(U)try{try{K=JSON.parse(U)}catch{if(J.debug)console.warn("Using safer alternative for parsing JS object literal");let O=U.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('"'),I=D.startsWith("'")&&D.endsWith("'");if(N||I)D=D.substring(1,D.length-1);K[R]=D}}}}catch(V){if(J.debug)console.error("Error parsing context in @markdown-file directive:",V)}let{content:H,data:B}=await BJ(z,J),j={...Z,...B,...K},_=H,L=/\{\{([^}]+)\}\}/g;return _=_.replace(L,(V,O)=>{let F=O.trim();return j[F]!==void 0?String(j[F]):V}),_}catch(z){let K=z instanceof Error?z.message:String(z);return B0("Markdown File",`Error including markdown file: ${K}`,X,$,W,G)}})}async function _J($,Z,X){let J=[],Y;while((Y=Z.exec($))!==null){let q=Y[0],U=Y.index,W=Y;J.push(X(...W).then((z)=>({match:q,replacement:z,index:U})))}let Q=await Promise.all(J);Q.sort((q,U)=>U.index-q.index);let G=$;for(let{match:q,replacement:U}of Q)G=G.replace(q,()=>U);return G}function z1($,Z){try{let X=$.trim();if(G0(X))return q0(X,Object.keys(Z))(...Object.values(Z));else return e(X,Z)}catch{return!1}}class W${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]!==`
3274
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]===`
3275
- `)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,U=!1;while(Q<$.length){let W=$[Q];if(G&&U){U=!1,Q++;continue}if(G&&W==="\\"){U=!0,Q++;continue}if(U=!1,(W==='"'||W==="'"||W==="`")&&!G){G=W,Q++;continue}if(W===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&W==="$"&&$[Q+1]==="{"){q++,Q+=2;continue}if(q>0&&W==="}"){q--,Q++;continue}if(W==="`"&&G==="`"&&q===0){G=null,Q++;continue}if(G){Q++;continue}if(W===Z)Y++;else if(W===X){if(Y--,Y===0)return Q}Q++}return-1}function b6($,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 w3($){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=JJ($,Z);return X.ok?{expression:X.expression,endPos:X.endPos}:null}function JJ($,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 YJ($,Z){let X=$.lastIndexOf("<",Z);if(X===-1)return!1;return X>$.lastIndexOf(">",Z)}function N1($,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 U=G.exec($),W=q.exec($),z=U?U.index:1/0,K=W?W.index:1/0;if(z<K)Y++,Q=z+U[0].length;else if(K<1/0){if(Y--,Y===0)return K;Q=K+W[0].length}else break}return-1}function y6($,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=N1($,"if","endif",Q);if(G===-1)return null;let q=$.slice(Q,G),U=[],W=0,z="if",K=Y.expression,H=0,B=0;while(W<q.length){let j=q.indexOf("@",W);if(j===-1)break;W=j;let _=q.substring(j);if(YJ(q,j)){W++;continue}if(/^@if\s*\(/.test(_)){B++,W++;continue}if(/^@endif(?![a-z])/.test(_)){B--,W+=6;continue}if(B===0){let F=_.match(/^@elseif\s*/);if(F){U.push({type:z,condition:K,content:q.substring(H,W),start:Q+H,end:Q+W});let V=W+F[0].length,O=z1(q,V);if(!O){W++;continue}z="elseif",K=O.expression,W=O.endPos,H=W;continue}else if(/^@else(?![a-z])/.test(_)){U.push({type:z,condition:K,content:q.substring(H,W),start:Q+H,end:Q+W}),z="else",K=void 0,W+=5,H=W;continue}}W++}return U.push({type:z,condition:K,content:q.slice(H),start:Q+H,end:Q+q.length}),{fullMatch:$.slice(Z,G+6),branches:U,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=y6($,J.index);if(Q)Z.push(Q),X.lastIndex=Q.end;J=X.exec($)}return Z}function q$($,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,U=q+Q[0].length-1,W=B0($,"(",")",U);if(W===-1){Q=Y.exec($);continue}let z=$.slice(U+1,W),K=W+1,H=N1($,Z,X,K);if(H===-1){Q=Y.exec($);continue}let B=$.slice(K,H),j=H+`@${X}`.length;J.push({fullMatch:$.slice(q,j),name:Z,params:z,content:B,start:q,end:j}),Y.lastIndex=j,Q=Y.exec($)}return J}function R3($,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=N1($,"switch","endswitch",Q);if(G===-1)return null;let q=$.slice(Q,G),U=[],W=0,z=null,K=0;while(W<q.length){let H=q.slice(W),B=H.match(/^@switch\s*\(/),j=H.match(/^@endswitch(?![a-z])/);if(B){if(K++,z)z.content+=B[0];W+=B[0].length;continue}if(j){if(K--,z)z.content+=j[0];W+=j[0].length;continue}if(K>0){if(z)z.content+=q[W];W++;continue}let _=H.match(/^@case\s*/),F=H.match(/^@default(?![a-z])/),V=H.match(/^@break(?![a-z])/);if(_&&H.startsWith("@case")){if(z)U.push(z);let O=W+_[0].length,L=z1(q,O);if(!L){W++;continue}z={type:"case",value:L.expression,content:""},W=L.endPos}else if(F&&H.startsWith("@default")){if(z)U.push(z);z={type:"default",content:""},W+=F[0].length}else if(V&&H.startsWith("@break"))W+=V[0].length;else{if(z)z.content+=q[W];W++}}if(z)U.push(z);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:U,start:Z,end:G+10}}function QJ($){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)==="{{{"?"{{{":"{!!":"{{",U=Q?q==="{{{"?"}}}":"!!}":"}}",W=G+q.length,z=GJ($,W,U);if(z===-1){X=G+1;continue}let K=$.slice(W,z).trim(),H=z+U.length;Z.push({fullMatch:$.slice(G,H),expression:K,start:G,end:H,isRaw:Q}),X=H}return Z}function GJ($,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 qJ($){let Z=w3($);if(Z.length===0)return{baseExpression:"",filters:[]};let X=Z[0],J=[];for(let Y=1;Y<Z.length;Y++){let Q=UJ(Z[Y]);if(Q)J.push(Q)}return{baseExpression:X,filters:J}}function UJ($){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=P6(G);return{name:J,args:q}}function P6($){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 WJ($,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 zJ($){let Z=[],J=new G$($).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 U=q.value;if(Y++,Y>=J.length)break;let W=J[Y];if(W.type==="IDENTIFIER"){let z=W.value;if(Y++,Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let K=Y<J.length?J[Y].start:$.length,H=S6(J,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:z,value:$.slice(K,H.endPos),exported:G,start:q.start,end:H.endPos})}}else if(W.type==="PUNCTUATION"&&(W.value==="{"||W.value==="[")){let z=W.start,K=W.value==="{"?"}":"]",H=B0($,W.value,K,z);if(H!==-1){let B=$.slice(z,H+1);if(Y=C6(J,H+1),Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let j=Y<J.length?J[Y].start:$.length,_=S6(J,Y,$);Y=_.nextIndex;let F=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:F,value:`${$.slice(j,_.endPos)}; ${U} ${B} = ${F}`,exported:G,start:q.start,end:_.endPos})}}}}else if(q.type==="IDENTIFIER"&&q.value==="function"){let U=G?J[Y-1].start:q.start;if(Y++,Y>=J.length)break;let W=J[Y];if(W.type==="IDENTIFIER"){let z=W.value;Y++;let K=-1;while(Y<J.length){if(J[Y].type==="PUNCTUATION"&&J[Y].value==="{"){K=J[Y].start;break}Y++}if(K!==-1){let H=B0($,"{","}",K);if(H!==-1)Z.push({type:"function",name:z,value:$.slice(U,H+1).replace(/^export\s+/,""),exported:G,start:U,end:H+1}),Y=C6(J,H+1)}}}else Y++}return Z}function S6($,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 C6($,Z){for(let X=0;X<$.length;X++)if($[X].start>=Z)return X;return $.length}function KJ($,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=R3(J,G);if(!q)break;try{let U;if(G0(q.expression))U=q0(q.expression,Object.keys(Z))(...Object.values(Z));else U=t(q.expression,Z);let W="",z=!1;for(let K of q.cases)if(K.type==="default"){if(!z)W=K.content.trim()}else try{let H;if(K.value&&G0(K.value))H=q0(K.value,Object.keys(Z))(...Object.values(Z));else if(K.value)H=t(K.value,Z);if(U===H){W=K.content.trim(),z=!0;break}}catch{continue}J=J.substring(0,G)+W+J.substring(q.end),Y=!0}catch(U){let W=U instanceof Error?U.message:String(U),z=e("Switch",`Error evaluating @switch expression: ${W}`,c.EVALUATION_ERROR);J=J.substring(0,G)+z+J.substring(q.end);break}}return J}function HJ($){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 BJ($,Z){if(Z.length===0)return $;return $.replace(/\u0000stx-script-(\d+)\u0000/g,(X,J)=>Z[Number(J)]??X)}function $1($,Z,X){let{masked:J,scripts:Y}=HJ($);return BJ(jJ(J,Z,X),Y)}function jJ($,Z,X){let J=$;J=KJ(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,U=z1(J,q+7);if(!U)break;let W=U.endPos,z=N1(J,"unless","endunless",W);if(z===-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 K=J.slice(W,z),H=U.expression,B=-1;{let _=0,F=/@(?:if|unless)\s*\(/g,V=/@(?:endif|endunless)(?![a-z])/g,O=/@else(?![a-z])/g,L=[],w;while((w=F.exec(K))!==null)L.push({pos:w.index,type:"open"});while((w=V.exec(K))!==null)L.push({pos:w.index,type:"close"});while((w=O.exec(K))!==null)L.push({pos:w.index,type:"else"});L.sort((R,D)=>R.pos-D.pos);for(let R of L)if(R.type==="open")_++;else if(R.type==="close")_--;else if(R.type==="else"&&_===0){B=R.pos;break}}let j;if(B!==-1){let _=K.slice(0,B),F=K.slice(B+5);j=`@if (${H})${F}@else ${_}@endif`}else j=`@if (!(${H}))${K}@endif`;J=J.substring(0,q)+j+J.substring(z+10),Q=!0}}J=N3(J,Z,X),J=A3(J,Z,X),J=D3(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 U="",W=!1;for(let z of q.branches){if(W)break;if(z.type==="else")U=z.content,W=!0;else try{let K;if(z.condition&&G0(z.condition))K=q0(z.condition,Object.keys(Z))(...Object.values(Z));else if(z.condition)K=t(z.condition,Z);if(K)U=z.content,W=!0}catch(K){U=e(z.type==="if"?"If":"Elseif",`Error in @${z.type}(${z.condition}): ${K instanceof Error?K.message:String(K)}`,c.EVALUATION_ERROR),W=!0}}J=J.substring(0,q.start)+U+J.substring(q.end)}catch(U){let W=U instanceof Error?U.message:String(U),z=e("If",`Error processing @if block: ${W}`,c.EVALUATION_ERROR);J=J.substring(0,q.start)+z+J.substring(q.end)}}return!0};while(!0){let Q=J;if(!Y())break;if(J===Q)break}return J}function v6($){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 D3($,Z){let X=$;function J(q,U,W,z){let K=1,H=z,B=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),j=new RegExp(`@${W}(?![a-z])`,"g");while(H<q.length&&K>0){B.lastIndex=H,j.lastIndex=H;let _=B.exec(q),F=j.exec(q),V=_?_.index:1/0,O=F?F.index:1/0;if(V<O)K++,H=V+_[0].length;else if(O<1/0){if(K--,K===0)return O;H=O+F[0].length}else break}return-1}function Y(q,U,W){let z=0,K=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${W}(?![a-z])`,"g"),B=/@else(?![a-z])/g,j=[],_;while((_=K.exec(q))!==null)j.push({pos:_.index,type:"open"});while((_=H.exec(q))!==null)j.push({pos:_.index,type:"close"});while((_=B.exec(q))!==null)j.push({pos:_.index,type:"else"});j.sort((F,V)=>F.pos-V.pos);for(let F of j)if(F.type==="open")z++;else if(F.type==="close")z--;else if(F.type==="else"&&z===0)return F.pos;return-1}{let q=!0;while(q){q=!1;let U=X.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let W=U.index,z,K,H=X.slice(W+5),B=v6(H);if(B)z=B.value,K=W+5+B.consumed;else K=W+5;let j=J(X,"auth","endauth",K);if(j===-1){console.warn(`[stx] @auth directive at position ${W} has no matching @endauth \u2014 the block was skipped.`);break}let _=X.slice(K,j),F=Y(_,"auth","endauth"),V;if(!Z.auth)V=!1;else V=z?W1(`auth?.check && auth?.user?.[${z}]`,Z):W1("auth?.check",Z);let O;if(F!==-1){let L=_.slice(0,F),w=_.slice(F+5);O=V?L:w}else O=V?_:"";X=X.substring(0,W)+O+X.substring(j+8),q=!0}}{let q=!0;while(q){q=!1;let U=X.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let W=U.index,z,K,H=X.slice(W+6),B=v6(H);if(B)z=B.value,K=W+6+B.consumed;else K=W+6;let j=J(X,"guest","endguest",K);if(j===-1){console.warn(`[stx] @guest directive at position ${W} has no matching @endguest \u2014 the block was skipped.`);break}let _=X.slice(K,j),F=Y(_,"guest","endguest"),V;if(!Z.auth)V=!0;else V=z?W1(`!auth?.check || !auth?.user?.[${z}]`,Z):W1("!auth?.check",Z);let O;if(F!==-1){let L=_.slice(0,F),w=_.slice(F+5);O=V?L:w}else O=V?_:"";X=X.substring(0,W)+O+X.substring(j+9),q=!0}}function Q(q,U,W){if(Z.userCan&&typeof Z.userCan[q]==="boolean")return Z.userCan[q];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let z=[q];if(U)z.push(U);if(W){let K=W1(W,Z);z.push(K)}return Z.permissions.check(...z)}catch{return!1}return!1}function G(q){let U=q.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!U)return null;return{ability:U[1],type:U[2],id:U[3]?.trim(),paramsEnd:U[0].length}}for(let q of["can","cannot"]){let U=`end${q}`,W=q==="can"?"elsecan":"elsecannot",z=!0;while(z){z=!1;let K=X.match(new RegExp(`@${q}\\s*\\(`));if(!K||K.index===void 0)break;let H=K.index,B=X.slice(H+`@${q}`.length),j=G(B);if(!j)break;let _=H+`@${q}`.length+j.paramsEnd,F=J(X,q,U,_);if(F===-1){console.warn(`[stx] @${q} directive at position ${H} has no matching @${U} \u2014 the block was skipped.`);break}let V=X.slice(_,F),O=[],L=0,w=new RegExp(`@${q}\\s*\\(`,"g"),R=new RegExp(`@${U}(?![a-z])`,"g"),D=new RegExp(`@${W}\\s*\\(`,"g"),N=/@else(?![a-z])/g,T=[],A;while((A=w.exec(V))!==null)T.push({pos:A.index,type:"open"});while((A=R.exec(V))!==null)T.push({pos:A.index,type:"close"});while((A=D.exec(V))!==null)T.push({pos:A.index,type:"elseDirective"});while((A=N.exec(V))!==null)T.push({pos:A.index,type:"else"});T.sort((b,C)=>b.pos-C.pos);for(let b of T){if(b.type==="open"){L++;continue}if(b.type==="close"){L--;continue}if(L===0)O.push(b)}let M=[],k=0;for(let b=0;b<O.length;b++){let C=O[b];if(M.push({content:V.slice(k,C.pos),ability:void 0}),C.type==="elseDirective"){let h=V.slice(C.pos+`@${W}`.length),x=G(h);if(x){M[M.length-1]={content:V.slice(k,C.pos)},k=C.pos+`@${W}`.length+x.paramsEnd,M.push({content:"",ability:x.ability,type:x.type,id:x.id}),M.pop();let l=O[b+1],d=l?l.pos:V.length;M.push({content:V.slice(k,d),ability:x.ability,type:x.type,id:x.id}),k=d}}else k=C.pos+5}if(k<V.length){let b=M[M.length-1];if(O.length>0&&O[O.length-1].type==="else")M.push({content:V.slice(k),isFinalElse:!0});else if(M.length===0)M.push({content:V.slice(k)})}let I=Q(j.ability,j.type,j.id),y=q==="can"?I:!I,E="";if(y)E=M[0]?.content||"";else{let b=!1;for(let C=1;C<M.length;C++){let h=M[C];if(h.isFinalElse){E=h.content,b=!0;break}if(h.ability){let x=Q(h.ability,h.type,h.id);if(q==="can"?x:!x){E=h.content,b=!0;break}}}if(!b&&M.length>0){let C=M[M.length-1];if(C.isFinalElse)E=C.content}}X=X.substring(0,H)+E+X.substring(F+`@${U}`.length),z=!0}}return X}function N3($,Z,X){let J=$;function Y(Q,G,q,U,W){let z=!0;while(z){z=!1;let K=new RegExp(`@${G}\\s*\\(`),H=Q.match(K);if(!H||H.index===void 0)break;let B=H.index,j=z1(Q,B+`@${G}`.length);if(!j)break;let _=j.endPos,F=N1(Q,G,q,_);if(F===-1){console.warn(`[stx] @${G} directive at position ${B} has no matching @${q} \u2014 the block was skipped.`);break}let V=Q.slice(_,F),O=j.expression,L=-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)){L=D;break}R=D+1}try{let D=U(O.trim()),N;if(L!==-1){let T=V.slice(0,L),A=V.slice(L+5);N=D?T:A}else N=D?V:"";Q=Q.substring(0,B)+N+Q.substring(F+`@${q}`.length),z=!0}catch(D){let N=D instanceof Error?D.message:String(D),T=e(W,`Error processing @${G} directive: ${N}`,c.EVALUATION_ERROR);Q=Q.substring(0,B)+T+Q.substring(F+`@${q}`.length);break}}return Q}return J=Y(J,"isset","endisset",(Q)=>{let G=W1(Q,Z);return G!==void 0&&G!==null},"Isset"),J=Y(J,"empty","endempty",(Q)=>{let G=W1(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 A3($,Z,X){let J=$,Y="development";function Q(G,q,U,W){let z=new RegExp(`@${q}(?![a-z])`,"g"),K=new RegExp(`@${U}(?![a-z])`,"g"),H=new RegExp(`^@${q}(?![a-z])`),B=new RegExp(`^@${U}(?![a-z])`),j=G,_=!0;while(_){_=!1,z.lastIndex=0;let F=z.exec(j);if(!F)break;let V=F.index,O=V+F[0].length;if(q==="env"){let I=j.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!I)break;O+=I[0].length,W=Y===I[2]}let L=1,w=O,R=-1;while(L>0&&w<j.length){z.lastIndex=w,K.lastIndex=w;let I=z.exec(j),y=K.exec(j),E=I?I.index:1/0,b=y?y.index:1/0;if(E<b)L++,w=E+I[0].length;else if(b<1/0){if(L--,L===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 @${U} \u2014 the block was skipped.`);break}let D=j.substring(O,R),N=-1,T=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)){T++,A=I+1;continue}if(B.test(y)){T--,A=I+1;continue}if(T===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=W?I:y}else M=W?D:"";let k=`@${U}`.length;j=j.substring(0,V)+M+j.substring(R+k),_=!0}return j}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 M3=new WeakMap;function f6($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function A1($,Z){if(!$)return Z?.nonceGenerator?.()??f6();let X=M3.get($);if(!X)X=Z?.nonceGenerator?.()??f6(),M3.set($,X);return X}function sz($){M3.delete($)}function x6($,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 I3($,Z){return`<meta http-equiv="Content-Security-Policy" content="${x6($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var _J={"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},T3={"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'"]},OJ={"default-src":["'none'"],"frame-ancestors":["'none'"]};function oz($){return{enabled:!0,directives:{strict:_J,moderate:T3,relaxed:VJ,api:OJ}[$]||T3,useNonce:$==="strict",addMetaTag:!0}}function rz($,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:[],U=[...new Set([...q,...Y])];X[Q]=U}}return X}function g6($,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?A1(X,Z):void 0,Y=I3(Z.directives,J);return $.replace(/<head([^>]*)>/,`<head$1>
3276
- ${Y}`)}function h6($,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 u6($,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?A1(Z,Q):void 0;return I3(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return A1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=A1(Z,Q);return Y}var FJ={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?A1(X,Q):void 0;return I3(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},LJ={name:"cspNonce",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return A1(X,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function az(){return[FJ,LJ]}function tz($){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 wJ($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function ez($,Z){if(!$.enabled)return{};let X=$.useNonce?A1(Z,$):void 0,J=x6($.directives,X);return{[wJ($.reportOnly)]:J}}var $K={enabled:!1,reportOnly:!1,directives:T3,useNonce:!1,addMetaTag:!0};import RJ from"crypto";var DJ=40,d6="_token",k3=null;function NJ($=DJ){let Z=RJ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return k3=Z,Z}function AJ(){if(!k3)NJ();return k3}function MJ($=d6){let Z=AJ();return`<input type="hidden" name="${$}" value="${Z}">`}function m6($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,X,J)=>{return MJ(J||d6)})}async function l6($,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 TJ(Y,Q,Z,X,J);else Y=await IJ(Y,Q,Z,X,J)}return Y}async function TJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=`@${Q}`,U=`@end${Q}`,W=$,z=h1(`${q}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${U}`,"g"),K=[],H=z.exec(W);while(H!==null){let[B,j="",_=""]=H,F=H.index||0;try{let V=j?c6(j):[],O=_.trim(),L=await G(O,V,X,J);K.push({original:B,processed:L,startIndex:F})}catch(V){let O=V instanceof Error?V.message:String(V);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,V);K.push({original:B,processed:e("CustomDirective",`Error in @${Q}${j?`(${j})`:""}: ${O}`,c.EVALUATION_ERROR),startIndex:F})}H=z.exec(W)}for(let B=K.length-1;B>=0;B--){let{original:j,processed:_}=K[B];W=W.replace(j,_)}return W}async function IJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=$,U=h1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),W=[],z=U.exec(q);while(z!==null){let[B,j=""]=z,_=z.index||0;try{let F=c6(j),V=await G("",F,X,J);W.push({original:B,processed:V,startIndex:_})}catch(F){let V=F instanceof Error?F.message:String(F);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,F);W.push({original:B,processed:e("CustomDirective",`Error in @${Q}(${j}): ${V}`,c.EVALUATION_ERROR),startIndex:_})}z=U.exec(q)}let K=h1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=K.exec(q);while(H!==null){let[B]=H,j=H.index||0;try{let _=await G("",[],X,J);W.push({original:B,processed:_,startIndex:j})}catch(_){let F=_ instanceof Error?_.message:String(_);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,_);W.push({original:B,processed:e("CustomDirective",`Error in @${Q}: ${F}`,c.EVALUATION_ERROR),startIndex:j})}H=K.exec(q)}for(let B=W.length-1;B>=0;B--){let{original:j,processed:_}=W[B];q=q.replace(j,_)}return q}function c6($){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 p6=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,i6=/^[A-Za-z_$][\w$]*$/,kJ=new Set(["light","dark","system"]);function M1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function EJ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,X=Z.appearance,J=Z.colorMode;if(M1(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(M1(X.key,"appearance.key"),M1(X.attribute,"appearance.attribute"),M1(X.default,"appearance.default"),M1(J.key,"colorMode.key"),M1(J.attribute,"colorMode.attribute"),M1(J.default,"colorMode.default"),!i6.test(X.key)||!i6.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!p6.test(X.attribute)||!p6.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(!kJ.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 bJ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function yJ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${bJ($)};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 SJ($,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 n6($,Z){let X=$,J=/@appearanceBootstrap\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index+Y[0].length-1,G=SJ(X,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let q=X.slice(Q+1,G).trim(),U=t(`(${q})`,Z),W=yJ(EJ(U));X=X.slice(0,Y.index)+W+X.slice(G+1),J.lastIndex=Y.index+W.length}return X}import CJ from"crypto";function j0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var b3={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function PJ($){return{...b3,...$.forms?.classes}}function U$($,Z,X,J){let Y=$||Z;return X?`${Y} ${J}`:Y}function x0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function n1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${j0(Z)}"`}function E3($,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="${j0(`${x0($)}-error`)}"`;return J}function vJ(){return CJ.randomUUID()}function KK($,Z,X,J){let Y=PJ(J),Q=$;return Q=xJ(Q,Z),Q=N5(Q,Z),Q=y3(Q,Z,Y),Q=S3(Q,Z,Y),Q}function N5($,Z){let X=$;return X=X.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let J=vJ();Z.csrf={token:J}}if(Z.csrf.field)return Z.csrf.field;if(Z.csrf.token)return`<input type="hidden" name="_token" value="${j0(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="${j0(Q)}">`;return J}),X}function y3($,Z,X=b3){let J=$;return J=J.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,q,U,W="")=>{let z=Q||G||"POST",K=q||U||"",H=K1(W),B=z.toUpperCase(),j=["GET","POST"].includes(B)?B:"POST",_=`<form method="${j0(j)}" action="${j0(K)}"${H?` ${H}`:""}>`;if(_+=`
3277
- ${N5("@csrf",Z)}`,!["GET","POST"].includes(B))_+=`
3278
- ${N5(`@method('${B}')`,Z)}`;return _}),J=J.replace(/@endform/g,"</form>"),J=J.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Y,Q,G,q,U,W="")=>{let z=Q||G||"",K=q||U||"",H=K1(W),B=R5(z,Z),j=B!==void 0&&B!==null?B:K||"",_=H.match(/type=['"]([^'"]+)['"]/i),F=_?_[1]:"text",V=D5(z,Z),O=H.match(/class=['"]([^'"]+)['"]/i),L=U$(O?O[1]:"",X.input,V,X.inputError),w=H.replace(/class=['"][^'"]+['"]/i,"");return w=w.replace(/type=['"][^'"]+['"]/i,""),`<input type="${j0(F)}" name="${j0(z)}"${n1(H,x0(z))} value="${j0(j)}" class="${L}"${E3(z,V,H)}${w?` ${w}`:""}>`}),J=J.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",q="")=>{let U=K1(G),W=R5(Q,Z)||q.trim(),z=D5(Q,Z),K=U.match(/class=['"]([^'"]+)['"]/i),H=U$(K?K[1]:"",X.input,z,X.inputError),B=U.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${j0(Q)}"${n1(U,x0(Q))} class="${H}"${E3(Q,z,U)}${B?` ${B}`:""}>${j0(W)}</textarea>`}),J=J.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",q)=>{let U=K1(G),W=R5(Q,Z),z=D5(Q,Z),K=U.match(/class=['"]([^'"]+)['"]/i),H=U$(K?K[1]:"",X.input,z,X.inputError),B=U.replace(/class=['"][^'"]+['"]/i,""),j=q;if(W!==void 0)j=q.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(_,F,V)=>{if((Array.isArray(W)?W.some((L)=>String(L)===V):String(W)===V)&&!F.includes("selected"))return F.replace(/(<option)/,"$1 selected");return _});return`<select name="${j0(Q)}"${n1(U,x0(Q))} class="${H}"${E3(Q,z,U)}${B?` ${B}`:""}>${j}</select>`}),J=J.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let U=G===void 0?"1":G,W=G===void 0?x0(Q):`${x0(Q)}-${x0(U)}`,z=K1(q),K=R5(Q,Z),H=K!==void 0&&(Array.isArray(K)?K.some((F)=>String(F)===U):K===!0||String(K)===U),B=z.match(/class=['"]([^'"]+)['"]/i),j=B?B[1]:X.checkInput,_=z.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${j0(Q)}"${n1(z,W)} value="${j0(U)}" class="${j}"${H?" checked":""}${_?` ${_}`:""}>`}),J=J.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let U=K1(q),W=R5(Q,Z),z=W!==void 0&&W===G,K=U.match(/class=['"]([^'"]+)['"]/i),H=K?K[1]:X.checkInput,B=U.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${j0(Q)}"${n1(U,`${x0(Q)}-${x0(G)}`)} value="${j0(G)}" class="${H}"${z?" checked":""}${B?` ${B}`:""}>`}),J=J.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let q=K1(G),U=q.match(/accept=['"]([^'"]+)['"]/i),W=U?U[1]:"",z=q.includes("multiple"),K=D5(Q,Z),H=q.match(/class=['"]([^'"]+)['"]/i),B=U$(H?H[1]:"",X.input,K,X.inputError),j=q.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),_=[`<input type="file" name="${j0(Q)}"${n1(q,x0(Q))}`,`class="${B}"`];if(W)_.push(`accept="${j0(W)}"`);if(z)_.push("multiple");if(j)_.push(j);return`${_.join(" ")}>`}),J=J.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Y,Q,G="",q)=>{let U=K1(G),W=U.match(/class=['"]([^'"]+)['"]/i),z=W?W[1]:X.label,K=U.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${j0(x0(Q))}" class="${z}"${K?` ${K}`:""}>${q}</label>`}),J}function S3($,Z,X=b3){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(J,Y,Q)=>{try{if(D5(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(q,U)=>{try{if(U.trim()==="$message"||U.trim()==="message")return s6(Y,Z);if(U.trim().includes("errors.first")||U.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return s6(Y,Z)}let W=U.trim();if(G0(W)){let z=t(W,Z);return z!==void 0?String(z):W}return W}catch{return U}});return`<div id="${j0(`${x0(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 s6($,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 K1($){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 o6={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 HK($,Z){o6[$]=Z}function C3($){let[Z,...X]=$.split(":"),J=X.length>0?X.join(":").split(","):[];return{name:Z.trim(),params:J}}function fJ($,Z,X,J={}){let Y=[],Q=X.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let q=C3(G),U=o6[q.name];if(!U){console.warn(`Unknown validation rule: ${q.name}`);continue}if(q.name==="confirmed"){let z=`${$}_confirmation`;q.params=[J[z]]}let W=U(Z,q.params||[],$);if(W)Y.push(q.message||W)}return{field:$,valid:Y.length===0,errors:Y}}function BK($,Z){let X={};for(let[J,Y]of Object.entries(Z)){let Q=fJ(J,$[J],Y,$);if(!Q.valid)X[J]=Q.errors}return X}function xJ($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(X,J,Y,Q)=>{let G=Y.split("|").map((U)=>U.trim()),q=[];for(let U of G){let W=C3(U);switch(W.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"'),W.name==="integer")q.push('step="1"');break;case"min":if(W.params?.[0])q.push(`minlength="${W.params[0]}"`);break;case"max":if(W.params?.[0])q.push(`maxlength="${W.params[0]}"`);break;case"regex":if(W.params?.[0])q.push(`pattern="${W.params[0]}"`);break}}return`<!-- @validate:${J}:${Y} -->${q.length>0?`<!-- attrs:${q.join(" ")} -->`:""}`})}var r6={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 jK($){r6[$.name]=$}function gJ($,Z,X={}){let J=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=C3(Q),q=r6[G.name];if(!q){console.warn(`Unknown validation rule: ${G.name}`);continue}let U=q.validate($,G.params||[],X);if(U!==!0)J.push(U)}return{valid:J.length===0,errors:J}}function _K($,Z){let X={},J=!0;for(let[Y,Q]of Object.entries(Z)){let G=gJ($[Y],Q,$);if(!G.valid)J=!1,X[Y]=G.errors}return{valid:J,errors:X}}function VK($,Z){let X=JSON.stringify(Z);return`
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 j0($,Z,X,J=0){let Y=0,Q=J,G=null,q=0,U=!1;while(Q<$.length){let W=$[Q];if(G&&U){U=!1,Q++;continue}if(G&&W==="\\"){U=!0,Q++;continue}if(U=!1,(W==='"'||W==="'"||W==="`")&&!G){G=W,Q++;continue}if(W===G&&G!=="`"){G=null,Q++;continue}if(G==="`"&&W==="$"&&$[Q+1]==="{"){q++,Q+=2;continue}if(q>0&&W==="}"){q--,Q++;continue}if(W==="`"&&G==="`"&&q===0){G=null,Q++;continue}if(G){Q++;continue}if(W===Z)Y++;else if(W===X){if(Y--,Y===0)return Q}Q++}return-1}function v6($,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 M3($){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 K1($,Z){let X=VJ($,Z);return X.ok?{expression:X.expression,endPos:X.endPos}:null}function VJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return{ok:!1,reason:"missing-open-paren",pos:X};let J=j0($,"(",")",X);if(J===-1)return{ok:!1,reason:"unclosed-paren",pos:X};return{ok:!0,expression:$.slice(X+1,J),endPos:J+1}}function OJ($,Z){let X=$.lastIndexOf("<",Z);if(X===-1)return!1;return X>$.lastIndexOf(">",Z)}function w1($,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 U=G.exec($),W=q.exec($),z=U?U.index:1/0,K=W?W.index:1/0;if(z<K)Y++,Q=z+U[0].length;else if(K<1/0){if(Y--,Y===0)return K;Q=K+W[0].length}else break}return-1}function f6($,Z){let X=$.slice(Z).match(/^@if\s*/);if(!X)return null;let J=Z+X[0].length,Y=K1($,J);if(!Y)return null;let Q=Y.endPos,G=w1($,"if","endif",Q);if(G===-1)return null;let q=$.slice(Q,G),U=[],W=0,z="if",K=Y.expression,H=0,B=0;while(W<q.length){let j=q.indexOf("@",W);if(j===-1)break;W=j;let _=q.substring(j);if(OJ(q,j)){W++;continue}if(/^@if\s*\(/.test(_)){B++,W++;continue}if(/^@endif(?![a-z])/.test(_)){B--,W+=6;continue}if(B===0){let L=_.match(/^@elseif\s*/);if(L){U.push({type:z,condition:K,content:q.substring(H,W),start:Q+H,end:Q+W});let V=W+L[0].length,O=K1(q,V);if(!O){W++;continue}z="elseif",K=O.expression,W=O.endPos,H=W;continue}else if(/^@else(?![a-z])/.test(_)){U.push({type:z,condition:K,content:q.substring(H,W),start:Q+H,end:Q+W}),z="else",K=void 0,W+=5,H=W;continue}}W++}return U.push({type:z,condition:K,content:q.slice(H),start:Q+H,end:Q+q.length}),{fullMatch:$.slice(Z,G+6),branches:U,start:Z,end:G+6}}function O5($){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=f6($,J.index);if(Q)Z.push(Q),X.lastIndex=Q.end;J=X.exec($)}return Z}function z$($,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,U=q+Q[0].length-1,W=j0($,"(",")",U);if(W===-1){Q=Y.exec($);continue}let z=$.slice(U+1,W),K=W+1,H=w1($,Z,X,K);if(H===-1){Q=Y.exec($);continue}let B=$.slice(K,H),j=H+`@${X}`.length;J.push({fullMatch:$.slice(q,j),name:Z,params:z,content:B,start:q,end:j}),Y.lastIndex=j,Q=Y.exec($)}return J}function I3($,Z){let X=$.slice(Z).match(/^@switch\s*/);if(!X)return null;let J=Z+X[0].length,Y=K1($,J);if(!Y)return null;let Q=Y.endPos,G=w1($,"switch","endswitch",Q);if(G===-1)return null;let q=$.slice(Q,G),U=[],W=0,z=null,K=0;while(W<q.length){let H=q.slice(W),B=H.match(/^@switch\s*\(/),j=H.match(/^@endswitch(?![a-z])/);if(B){if(K++,z)z.content+=B[0];W+=B[0].length;continue}if(j){if(K--,z)z.content+=j[0];W+=j[0].length;continue}if(K>0){if(z)z.content+=q[W];W++;continue}let _=H.match(/^@case\s*/),L=H.match(/^@default(?![a-z])/),V=H.match(/^@break(?![a-z])/);if(_&&H.startsWith("@case")){if(z)U.push(z);let O=W+_[0].length,F=K1(q,O);if(!F){W++;continue}z={type:"case",value:F.expression,content:""},W=F.endPos}else if(L&&H.startsWith("@default")){if(z)U.push(z);z={type:"default",content:""},W+=L[0].length}else if(V&&H.startsWith("@break"))W+=V[0].length;else{if(z)z.content+=q[W];W++}}if(z)U.push(z);return{fullMatch:$.slice(Z,G+10),expression:Y.expression,cases:U,start:Z,end:G+10}}function FJ($){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)==="{{{"?"{{{":"{!!":"{{",U=Q?q==="{{{"?"}}}":"!!}":"}}",W=G+q.length,z=LJ($,W,U);if(z===-1){X=G+1;continue}let K=$.slice(W,z).trim(),H=z+U.length;Z.push({fullMatch:$.slice(G,H),expression:K,start:G,end:H,isRaw:Q}),X=H}return Z}function LJ($,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 wJ($){let Z=M3($);if(Z.length===0)return{baseExpression:"",filters:[]};let X=Z[0],J=[];for(let Y=1;Y<Z.length;Y++){let Q=RJ(Z[Y]);if(Q)J.push(Q)}return{baseExpression:X,filters:J}}function RJ($){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=j0(Z,"(",")",X);if(Q===-1)return{name:J,args:[]};let G=Z.slice(Y,Q),q=h6(G);return{name:J,args:q}}function h6($){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 DJ($,Z){let X=Z;while(X<$.length&&/\s/.test($[X]))X++;if($[X]!=="(")return null;let J=j0($,"(",")",X);if(J===-1)return null;return{params:$.slice(X+1,J),endPos:J+1}}function NJ($){let Z=[],J=new W$($).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 U=q.value;if(Y++,Y>=J.length)break;let W=J[Y];if(W.type==="IDENTIFIER"){let z=W.value;if(Y++,Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let K=Y<J.length?J[Y].start:$.length,H=x6(J,Y,$);Y=H.nextIndex,Z.push({type:"variable",name:z,value:$.slice(K,H.endPos),exported:G,start:q.start,end:H.endPos})}}else if(W.type==="PUNCTUATION"&&(W.value==="{"||W.value==="[")){let z=W.start,K=W.value==="{"?"}":"]",H=j0($,W.value,K,z);if(H!==-1){let B=$.slice(z,H+1);if(Y=g6(J,H+1),Y<J.length&&J[Y].type==="OPERATOR"&&J[Y].value==="="){Y++;let j=Y<J.length?J[Y].start:$.length,_=x6(J,Y,$);Y=_.nextIndex;let L=`__stx_destructured_${Z.length}`;Z.push({type:"variable",name:L,value:`${$.slice(j,_.endPos)}; ${U} ${B} = ${L}`,exported:G,start:q.start,end:_.endPos})}}}}else if(q.type==="IDENTIFIER"&&q.value==="function"){let U=G?J[Y-1].start:q.start;if(Y++,Y>=J.length)break;let W=J[Y];if(W.type==="IDENTIFIER"){let z=W.value;Y++;let K=-1;while(Y<J.length){if(J[Y].type==="PUNCTUATION"&&J[Y].value==="{"){K=J[Y].start;break}Y++}if(K!==-1){let H=j0($,"{","}",K);if(H!==-1)Z.push({type:"function",name:z,value:$.slice(U,H+1).replace(/^export\s+/,""),exported:G,start:U,end:H+1}),Y=g6(J,H+1)}}}else Y++}return Z}function x6($,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 g6($,Z){for(let X=0;X<$.length;X++)if($[X].start>=Z)return X;return $.length}function AJ($,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=I3(J,G);if(!q)break;try{let U;if(G0(q.expression))U=q0(q.expression,Object.keys(Z))(...Object.values(Z));else U=e(q.expression,Z);let W="",z=!1;for(let K of q.cases)if(K.type==="default"){if(!z)W=K.content.trim()}else try{let H;if(K.value&&G0(K.value))H=q0(K.value,Object.keys(Z))(...Object.values(Z));else if(K.value)H=e(K.value,Z);if(U===H){W=K.content.trim(),z=!0;break}}catch{continue}J=J.substring(0,G)+W+J.substring(q.end),Y=!0}catch(U){let W=U instanceof Error?U.message:String(U),z=$0("Switch",`Error evaluating @switch expression: ${W}`,m.EVALUATION_ERROR);J=J.substring(0,G)+z+J.substring(q.end);break}}return J}function MJ($){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 IJ($,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}=MJ($);return IJ(kJ(J,Z,X),Y)}function kJ($,Z,X){let J=$;J=AJ(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,U=K1(J,q+7);if(!U)break;let W=U.endPos,z=w1(J,"unless","endunless",W);if(z===-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 K=J.slice(W,z),H=U.expression,B=-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(K))!==null)F.push({pos:w.index,type:"open"});while((w=V.exec(K))!==null)F.push({pos:w.index,type:"close"});while((w=O.exec(K))!==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){B=R.pos;break}}let j;if(B!==-1){let _=K.slice(0,B),L=K.slice(B+5);j=`@if (${H})${L}@else ${_}@endif`}else j=`@if (!(${H}))${K}@endif`;J=J.substring(0,q)+j+J.substring(z+10),Q=!0}}J=T3(J,Z,X),J=E3(J,Z,X),J=k3(J,Z);let Y=()=>{let Q=O5(J);if(Q.length===0)return!1;for(let G=Q.length-1;G>=0;G--){let q=Q[G];try{let U="",W=!1;for(let z of q.branches){if(W)break;if(z.type==="else")U=z.content,W=!0;else try{let K;if(z.condition&&G0(z.condition))K=q0(z.condition,Object.keys(Z))(...Object.values(Z));else if(z.condition)K=e(z.condition,Z);if(K)U=z.content,W=!0}catch(K){U=$0(z.type==="if"?"If":"Elseif",`Error in @${z.type}(${z.condition}): ${K instanceof Error?K.message:String(K)}`,m.EVALUATION_ERROR),W=!0}}J=J.substring(0,q.start)+U+J.substring(q.end)}catch(U){let W=U instanceof Error?U.message:String(U),z=$0("If",`Error processing @if block: ${W}`,m.EVALUATION_ERROR);J=J.substring(0,q.start)+z+J.substring(q.end)}}return!0};while(!0){let Q=J;if(!Y())break;if(J===Q)break}return J}function u6($){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 k3($,Z){let X=$;function J(q,U,W,z){let K=1,H=z,B=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),j=new RegExp(`@${W}(?![a-z])`,"g");while(H<q.length&&K>0){B.lastIndex=H,j.lastIndex=H;let _=B.exec(q),L=j.exec(q),V=_?_.index:1/0,O=L?L.index:1/0;if(V<O)K++,H=V+_[0].length;else if(O<1/0){if(K--,K===0)return O;H=O+L[0].length}else break}return-1}function Y(q,U,W){let z=0,K=new RegExp(`@${U}(?:\\s*\\(|\\s|$)`,"g"),H=new RegExp(`@${W}(?![a-z])`,"g"),B=/@else(?![a-z])/g,j=[],_;while((_=K.exec(q))!==null)j.push({pos:_.index,type:"open"});while((_=H.exec(q))!==null)j.push({pos:_.index,type:"close"});while((_=B.exec(q))!==null)j.push({pos:_.index,type:"else"});j.sort((L,V)=>L.pos-V.pos);for(let L of j)if(L.type==="open")z++;else if(L.type==="close")z--;else if(L.type==="else"&&z===0)return L.pos;return-1}{let q=!0;while(q){q=!1;let U=X.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let W=U.index,z,K,H=X.slice(W+5),B=u6(H);if(B)z=B.value,K=W+5+B.consumed;else K=W+5;let j=J(X,"auth","endauth",K);if(j===-1){console.warn(`[stx] @auth directive at position ${W} has no matching @endauth \u2014 the block was skipped.`);break}let _=X.slice(K,j),L=Y(_,"auth","endauth"),V;if(!Z.auth)V=!1;else V=z?z1(`auth?.check && auth?.user?.[${z}]`,Z):z1("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,W)+O+X.substring(j+8),q=!0}}{let q=!0;while(q){q=!1;let U=X.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!U||U.index===void 0)break;let W=U.index,z,K,H=X.slice(W+6),B=u6(H);if(B)z=B.value,K=W+6+B.consumed;else K=W+6;let j=J(X,"guest","endguest",K);if(j===-1){console.warn(`[stx] @guest directive at position ${W} has no matching @endguest \u2014 the block was skipped.`);break}let _=X.slice(K,j),L=Y(_,"guest","endguest"),V;if(!Z.auth)V=!0;else V=z?z1(`!auth?.check || !auth?.user?.[${z}]`,Z):z1("!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,W)+O+X.substring(j+9),q=!0}}function Q(q,U,W){if(Z.userCan&&typeof Z.userCan[q]==="boolean")return Z.userCan[q];if(Z.permissions?.check&&typeof Z.permissions.check==="function")try{let z=[q];if(U)z.push(U);if(W){let K=z1(W,Z);z.push(K)}return Z.permissions.check(...z)}catch{return!1}return!1}function G(q){let U=q.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!U)return null;return{ability:U[1],type:U[2],id:U[3]?.trim(),paramsEnd:U[0].length}}for(let q of["can","cannot"]){let U=`end${q}`,W=q==="can"?"elsecan":"elsecannot",z=!0;while(z){z=!1;let K=X.match(new RegExp(`@${q}\\s*\\(`));if(!K||K.index===void 0)break;let H=K.index,B=X.slice(H+`@${q}`.length),j=G(B);if(!j)break;let _=H+`@${q}`.length+j.paramsEnd,L=J(X,q,U,_);if(L===-1){console.warn(`[stx] @${q} directive at position ${H} has no matching @${U} \u2014 the block was skipped.`);break}let V=X.slice(_,L),O=[],F=0,w=new RegExp(`@${q}\\s*\\(`,"g"),R=new RegExp(`@${U}(?![a-z])`,"g"),D=new RegExp(`@${W}\\s*\\(`,"g"),N=/@else(?![a-z])/g,I=[],A;while((A=w.exec(V))!==null)I.push({pos:A.index,type:"open"});while((A=R.exec(V))!==null)I.push({pos:A.index,type:"close"});while((A=D.exec(V))!==null)I.push({pos:A.index,type:"elseDirective"});while((A=N.exec(V))!==null)I.push({pos:A.index,type:"else"});I.sort((b,S)=>b.pos-S.pos);for(let b of I){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 f=V.slice(S.pos+`@${W}`.length),g=G(f);if(g){M[M.length-1]={content:V.slice(T,S.pos)},T=S.pos+`@${W}`.length+g.paramsEnd,M.push({content:"",ability:g.ability,type:g.type,id:g.id}),M.pop();let o=O[b+1],u=o?o.pos:V.length;M.push({content:V.slice(T,u),ability:g.ability,type:g.type,id:g.id}),T=u}}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 k=Q(j.ability,j.type,j.id),y=q==="can"?k:!k,E="";if(y)E=M[0]?.content||"";else{let b=!1;for(let S=1;S<M.length;S++){let f=M[S];if(f.isFinalElse){E=f.content,b=!0;break}if(f.ability){let g=Q(f.ability,f.type,f.id);if(q==="can"?g:!g){E=f.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+`@${U}`.length),z=!0}}return X}function T3($,Z,X){let J=$;function Y(Q,G,q,U,W){let z=!0;while(z){z=!1;let K=new RegExp(`@${G}\\s*\\(`),H=Q.match(K);if(!H||H.index===void 0)break;let B=H.index,j=K1(Q,B+`@${G}`.length);if(!j)break;let _=j.endPos,L=w1(Q,G,q,_);if(L===-1){console.warn(`[stx] @${G} directive at position ${B} has no matching @${q} \u2014 the block was skipped.`);break}let V=Q.slice(_,L),O=j.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=U(O.trim()),N;if(F!==-1){let I=V.slice(0,F),A=V.slice(F+5);N=D?I:A}else N=D?V:"";Q=Q.substring(0,B)+N+Q.substring(L+`@${q}`.length),z=!0}catch(D){let N=D instanceof Error?D.message:String(D),I=$0(W,`Error processing @${G} directive: ${N}`,m.EVALUATION_ERROR);Q=Q.substring(0,B)+I+Q.substring(L+`@${q}`.length);break}}return Q}return J=Y(J,"isset","endisset",(Q)=>{let G=z1(Q,Z);return G!==void 0&&G!==null},"Isset"),J=Y(J,"empty","endempty",(Q)=>{let G=z1(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 E3($,Z,X){let J=$,Y="development";function Q(G,q,U,W){let z=new RegExp(`@${q}(?![a-z])`,"g"),K=new RegExp(`@${U}(?![a-z])`,"g"),H=new RegExp(`^@${q}(?![a-z])`),B=new RegExp(`^@${U}(?![a-z])`),j=G,_=!0;while(_){_=!1,z.lastIndex=0;let L=z.exec(j);if(!L)break;let V=L.index,O=V+L[0].length;if(q==="env"){let k=j.substring(O).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!k)break;O+=k[0].length,W=Y===k[2]}let F=1,w=O,R=-1;while(F>0&&w<j.length){z.lastIndex=w,K.lastIndex=w;let k=z.exec(j),y=K.exec(j),E=k?k.index:1/0,b=y?y.index:1/0;if(E<b)F++,w=E+k[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 @${U} \u2014 the block was skipped.`);break}let D=j.substring(O,R),N=-1,I=0,A=0;while(A<D.length){let k=D.indexOf("@",A);if(k===-1)break;let y=D.substring(k);if(H.test(y)){I++,A=k+1;continue}if(B.test(y)){I--,A=k+1;continue}if(I===0&&/^@else(?![a-z])/.test(y)){N=k;break}A=k+1}let M;if(N!==-1){let k=D.slice(0,N),y=D.slice(N+5);M=W?k:y}else M=W?D:"";let T=`@${U}`.length;j=j.substring(0,V)+M+j.substring(R+T),_=!0}return j}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 b3=new WeakMap;function d6($=16){let Z=new Uint8Array($);return crypto.getRandomValues(Z),btoa(String.fromCharCode(...Z))}function R1($,Z){if(!$)return Z?.nonceGenerator?.()??d6();let X=b3.get($);if(!X)X=Z?.nonceGenerator?.()??d6(),b3.set($,X);return X}function UK($){b3.delete($)}function m6($,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 S3($,Z){return`<meta http-equiv="Content-Security-Policy" content="${m6($,Z).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}">`}var TJ={"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},y3={"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},EJ={"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'"]},bJ={"default-src":["'none'"],"frame-ancestors":["'none'"]};function WK($){return{enabled:!0,directives:{strict:TJ,moderate:y3,relaxed:EJ,api:bJ}[$]||y3,useNonce:$==="strict",addMetaTag:!0}}function zK($,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:[],U=[...new Set([...q,...Y])];X[Q]=U}}return X}function l6($,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?R1(X,Z):void 0,Y=S3(Z.directives,J);return $.replace(/<head([^>]*)>/,`<head$1>
3265
+ ${Y}`)}function c6($,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 p6($,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?R1(Z,Q):void 0;return S3(Q.directives,G)}),Y=Y.replace(/@cspNonce\b/g,()=>{if(!Q?.enabled||!Q.useNonce)return"";return R1(Z,Q)}),Q?.enabled&&Q.useNonce)Z.cspNonce=R1(Z,Q);return Y}var yJ={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?R1(X,Q):void 0;return S3(Q.directives,G)},hasEndTag:!1,description:"Insert Content-Security-Policy meta tag"},SJ={name:"cspNonce",handler:($,Z,X,J)=>{let Q=X.__stx_options?.csp;if(!Q?.enabled||!Q.useNonce)return"";return R1(X,Q)},hasEndTag:!1,description:"Output the current CSP nonce value"};function KK(){return[yJ,SJ]}function HK($){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 CJ($=!1){return $?"Content-Security-Policy-Report-Only":"Content-Security-Policy"}function BK($,Z){if(!$.enabled)return{};let X=$.useNonce?R1(Z,$):void 0,J=m6($.directives,X);return{[CJ($.reportOnly)]:J}}var jK={enabled:!1,reportOnly:!1,directives:y3,useNonce:!1,addMetaTag:!0};import PJ from"crypto";var vJ=40,i6="_token",C3=null;function fJ($=vJ){let Z=PJ.randomBytes(Math.ceil($/2)).toString("hex").slice(0,$);return C3=Z,Z}function xJ(){if(!C3)fJ();return C3}function gJ($=i6){let Z=xJ();return`<input type="hidden" name="${$}" value="${Z}">`}function n6($){return $.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(Z,X,J)=>{return gJ(J||i6)})}async function s6($,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 hJ(Y,Q,Z,X,J);else Y=await uJ(Y,Q,Z,X,J)}return Y}async function hJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=`@${Q}`,U=`@end${Q}`,W=$,z=d1(`${q}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${U}`,"g"),K=[],H=z.exec(W);while(H!==null){let[B,j="",_=""]=H,L=H.index||0;try{let V=j?o6(j):[],O=_.trim(),F=await G(O,V,X,J);K.push({original:B,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);K.push({original:B,processed:$0("CustomDirective",`Error in @${Q}${j?`(${j})`:""}: ${O}`,m.EVALUATION_ERROR),startIndex:L})}H=z.exec(W)}for(let B=K.length-1;B>=0;B--){let{original:j,processed:_}=K[B];W=W.replace(j,_)}return W}async function uJ($,Z,X,J,Y){let{name:Q,handler:G}=Z,q=$,U=d1(`@${Q}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g"),W=[],z=U.exec(q);while(z!==null){let[B,j=""]=z,_=z.index||0;try{let L=o6(j),V=await G("",L,X,J);W.push({original:B,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);W.push({original:B,processed:$0("CustomDirective",`Error in @${Q}(${j}): ${V}`,m.EVALUATION_ERROR),startIndex:_})}z=U.exec(q)}let K=d1(`@${Q}(?!\\w)(?!\\s*\\()`,"g"),H=K.exec(q);while(H!==null){let[B]=H,j=H.index||0;try{let _=await G("",[],X,J);W.push({original:B,processed:_,startIndex:j})}catch(_){let L=_ instanceof Error?_.message:String(_);if(Y.debug)console.error(`Error processing custom directive @${Q}:`,_);W.push({original:B,processed:$0("CustomDirective",`Error in @${Q}: ${L}`,m.EVALUATION_ERROR),startIndex:j})}H=K.exec(q)}for(let B=W.length-1;B>=0;B--){let{original:j,processed:_}=W[B];q=q.replace(j,_)}return q}function o6($){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 r6=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,a6=/^[A-Za-z_$][\w$]*$/,dJ=new Set(["light","dark","system"]);function D1($,Z){if(typeof $!=="string"||$.length===0)throw Error(`@appearanceBootstrap ${Z} must be a non-empty string`)}function mJ($){if(!$||typeof $!=="object"||Array.isArray($))throw Error("@appearanceBootstrap expects an options object");let Z=$,X=Z.appearance,J=Z.colorMode;if(D1(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(D1(X.key,"appearance.key"),D1(X.attribute,"appearance.attribute"),D1(X.default,"appearance.default"),D1(J.key,"colorMode.key"),D1(J.attribute,"colorMode.attribute"),D1(J.default,"colorMode.default"),!a6.test(X.key)||!a6.test(J.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!r6.test(X.attribute)||!r6.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(!dJ.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 lJ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function cJ($){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${lJ($)};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 pJ($,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 t6($,Z){let X=$,J=/@appearanceBootstrap\s*\(/g,Y;while((Y=J.exec(X))!==null){let Q=Y.index+Y[0].length-1,G=pJ(X,Q);if(G===-1)throw Error("@appearanceBootstrap has an unclosed options object");let q=X.slice(Q+1,G).trim(),U=e(`(${q})`,Z),W=cJ(mJ(U));X=X.slice(0,Y.index)+W+X.slice(G+1),J.lastIndex=Y.index+W.length}return X}import iJ from"crypto";function _0($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var v3={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function nJ($){return{...v3,...$.forms?.classes}}function K$($,Z,X,J){let Y=$||Z;return X?`${Y} ${J}`:Y}function u0($){return String($).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function m1($,Z){if(/\bid\s*=/i.test($))return"";return` id="${_0(Z)}"`}function P3($,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 sJ(){return iJ.randomUUID()}function MK($,Z,X,J){let Y=nJ(J),Q=$;return Q=rJ(Q,Z),Q=w5(Q,Z),Q=f3(Q,Z,Y),Q=x3(Q,Z,Y),Q}function w5($,Z){let X=$;return X=X.replace(/@csrf/g,()=>{if(!Z.csrf||typeof Z.csrf!=="object"){let J=sJ();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 f3($,Z,X=v3){let J=$;return J=J.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(Y,Q,G,q,U,W="")=>{let z=Q||G||"POST",K=q||U||"",H=H1(W),B=z.toUpperCase(),j=["GET","POST"].includes(B)?B:"POST",_=`<form method="${_0(j)}" action="${_0(K)}"${H?` ${H}`:""}>`;if(_+=`
3266
+ ${w5("@csrf",Z)}`,!["GET","POST"].includes(B))_+=`
3267
+ ${w5(`@method('${B}')`,Z)}`;return _}),J=J.replace(/@endform/g,"</form>"),J=J.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(Y,Q,G,q,U,W="")=>{let z=Q||G||"",K=q||U||"",H=H1(W),B=F5(z,Z),j=B!==void 0&&B!==null?B:K||"",_=H.match(/type=['"]([^'"]+)['"]/i),L=_?_[1]:"text",V=L5(z,Z),O=H.match(/class=['"]([^'"]+)['"]/i),F=K$(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(z)}"${m1(H,u0(z))} value="${_0(j)}" class="${F}"${P3(z,V,H)}${w?` ${w}`:""}>`}),J=J.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(Y,Q,G="",q="")=>{let U=H1(G),W=F5(Q,Z)||q.trim(),z=L5(Q,Z),K=U.match(/class=['"]([^'"]+)['"]/i),H=K$(K?K[1]:"",X.input,z,X.inputError),B=U.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${_0(Q)}"${m1(U,u0(Q))} class="${H}"${P3(Q,z,U)}${B?` ${B}`:""}>${_0(W)}</textarea>`}),J=J.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(Y,Q,G="",q)=>{let U=H1(G),W=F5(Q,Z),z=L5(Q,Z),K=U.match(/class=['"]([^'"]+)['"]/i),H=K$(K?K[1]:"",X.input,z,X.inputError),B=U.replace(/class=['"][^'"]+['"]/i,""),j=q;if(W!==void 0)j=q.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(_,L,V)=>{if((Array.isArray(W)?W.some((F)=>String(F)===V):String(W)===V)&&!L.includes("selected"))return L.replace(/(<option)/,"$1 selected");return _});return`<select name="${_0(Q)}"${m1(U,u0(Q))} class="${H}"${P3(Q,z,U)}${B?` ${B}`:""}>${j}</select>`}),J=J.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let U=G===void 0?"1":G,W=G===void 0?u0(Q):`${u0(Q)}-${u0(U)}`,z=H1(q),K=F5(Q,Z),H=K!==void 0&&(Array.isArray(K)?K.some((L)=>String(L)===U):K===!0||String(K)===U),B=z.match(/class=['"]([^'"]+)['"]/i),j=B?B[1]:X.checkInput,_=z.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${_0(Q)}"${m1(z,W)} value="${_0(U)}" class="${j}"${H?" checked":""}${_?` ${_}`:""}>`}),J=J.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G,q="")=>{let U=H1(q),W=F5(Q,Z),z=W!==void 0&&W===G,K=U.match(/class=['"]([^'"]+)['"]/i),H=K?K[1]:X.checkInput,B=U.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${_0(Q)}"${m1(U,`${u0(Q)}-${u0(G)}`)} value="${_0(G)}" class="${H}"${z?" checked":""}${B?` ${B}`:""}>`}),J=J.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(Y,Q,G="")=>{let q=H1(G),U=q.match(/accept=['"]([^'"]+)['"]/i),W=U?U[1]:"",z=q.includes("multiple"),K=L5(Q,Z),H=q.match(/class=['"]([^'"]+)['"]/i),B=K$(H?H[1]:"",X.input,K,X.inputError),j=q.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),_=[`<input type="file" name="${_0(Q)}"${m1(q,u0(Q))}`,`class="${B}"`];if(W)_.push(`accept="${_0(W)}"`);if(z)_.push("multiple");if(j)_.push(j);return`${_.join(" ")}>`}),J=J.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(Y,Q,G="",q)=>{let U=H1(G),W=U.match(/class=['"]([^'"]+)['"]/i),z=W?W[1]:X.label,K=U.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${_0(u0(Q))}" class="${z}"${K?` ${K}`:""}>${q}</label>`}),J}function x3($,Z,X=v3){return $.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(J,Y,Q)=>{try{if(L5(Y,Z)){let G=Q.replace(/\{\{([^}]+)\}\}/g,(q,U)=>{try{if(U.trim()==="$message"||U.trim()==="message")return e6(Y,Z);if(U.trim().includes("errors.first")||U.trim().includes("$errors.first")){if(typeof Z.errors?.first==="function")return Z.errors.first(Y);return e6(Y,Z)}let W=U.trim();if(G0(W)){let z=e(W,Z);return z!==void 0?String(z):W}return W}catch{return U}});return`<div id="${_0(`${u0(Y)}-error`)}" role="alert">${G}</div>`}return""}catch(G){return console.error("Error processing @error directive:",G),J}})}function L5($,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 e6($,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 F5($,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 $9={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 IK($,Z){$9[$]=Z}function g3($){let[Z,...X]=$.split(":"),J=X.length>0?X.join(":").split(","):[];return{name:Z.trim(),params:J}}function oJ($,Z,X,J={}){let Y=[],Q=X.split("|").map((G)=>G.trim()).filter(Boolean);for(let G of Q){let q=g3(G),U=$9[q.name];if(!U){console.warn(`Unknown validation rule: ${q.name}`);continue}if(q.name==="confirmed"){let z=`${$}_confirmation`;q.params=[J[z]]}let W=U(Z,q.params||[],$);if(W)Y.push(q.message||W)}return{field:$,valid:Y.length===0,errors:Y}}function kK($,Z){let X={};for(let[J,Y]of Object.entries(Z)){let Q=oJ(J,$[J],Y,$);if(!Q.valid)X[J]=Q.errors}return X}function rJ($,Z){return $.replace(/@validate\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]*)\})?\s*\)/g,(X,J,Y,Q)=>{let G=Y.split("|").map((U)=>U.trim()),q=[];for(let U of G){let W=g3(U);switch(W.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"'),W.name==="integer")q.push('step="1"');break;case"min":if(W.params?.[0])q.push(`minlength="${W.params[0]}"`);break;case"max":if(W.params?.[0])q.push(`maxlength="${W.params[0]}"`);break;case"regex":if(W.params?.[0])q.push(`pattern="${W.params[0]}"`);break}}return`<!-- @validate:${J}:${Y} -->${q.length>0?`<!-- attrs:${q.join(" ")} -->`:""}`})}var Z9={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 TK($){Z9[$.name]=$}function aJ($,Z,X={}){let J=[],Y=Z.split("|").map((Q)=>Q.trim());for(let Q of Y){let G=g3(Q),q=Z9[G.name];if(!q){console.warn(`Unknown validation rule: ${G.name}`);continue}let U=q.validate($,G.params||[],X);if(U!==!0)J.push(U)}return{valid:J.length===0,errors:J}}function EK($,Z){let X={},J=!0;for(let[Y,Q]of Object.entries(Z)){let G=aJ($[Y],Q,$);if(!G.valid)J=!1,X[Y]=G.errors}return{valid:J,errors:X}}function bK($,Z){let X=JSON.stringify(Z);return`
3279
3268
  <script>
3280
3269
  (function() {
3281
3270
  const form = document.getElementById('${$}');
@@ -3327,22 +3316,22 @@ catch { return 'Please enter a valid URL'; } },
3327
3316
  }
3328
3317
  });
3329
3318
  })();
3330
- </script>`.trim()}import v3 from"path";var A5;async function hJ(){if(A5!==void 0)return A5;try{A5=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{A5=null}return A5}var g3={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},E0={},c0={},Z1={};function RK($){if($)delete E0[$];else for(let Z of Object.keys(E0))delete E0[Z]}function DK(){let $=Object.entries(E0).map(([Z,X])=>({locale:Z,loadedAt:new Date(X.loadedAt),keyCount:t6(X.translations)}));return{size:Object.keys(E0).length,locales:Object.keys(E0),entries:$}}function t6($,Z=0){for(let X of Object.values($))if(Z++,X&&typeof X==="object"&&!Array.isArray(X))Z=t6(X,Z);return Z}function uJ($,Z=0){if(Z<=0)return!1;return Date.now()-$.loadedAt>Z}function NK($){if(E0[$])return"loaded";return Z1[$]||"idle"}function AK($){return Z1[$]==="loading"}function MK($){return!!E0[$]}async function dJ($,Z){let{locales:X,parallel:J=!0,priority:Y={},onLocaleLoaded:Q,onComplete:G,onError:q}=$,U=J?X:[...X].sort((W,z)=>(Y[z]||0)-(Y[W]||0));if(J){let W=U.map(async(z)=>{try{await W$(z,Z),Q?.(z)}catch(K){q?.(z,K instanceof Error?K:Error(String(K)))}});await Promise.all(W)}else for(let W of U)try{await W$(W,Z),Q?.(W)}catch(z){q?.(W,z instanceof Error?z:Error(String(z)))}G?.()}function TK($,Z){queueMicrotask(()=>{dJ($,Z).catch((X)=>{if(Z.debug)console.error("Background preload error:",X)})})}async function W$($,Z){if({...g3,...Z.i18n}.cache&&E0[$]){let Y=E0[$],Q=Z.i18n?.cacheMaxAge??0;if(!uJ(Y,Q))return Y.translations}if(c0[$]?.state==="loading")return c0[$].promise;Z1[$]="loading";let J=f3($,Z).then((Y)=>{return Z1[$]="loaded",delete c0[$],Y}).catch((Y)=>{throw Z1[$]="error",c0[$]={promise:J,state:"error",error:Y instanceof Error?Y:Error(String(Y))},Y});return c0[$]={promise:J,state:"loading"},J}function mJ($){return E0[$]?.translations}async function IK($,Z){let X=mJ($);if(X)return X;return W$($,Z)}async function kK($,Z){if(E0[$])return E0[$].translations;if(c0[$]){if(Z)return Promise.race([c0[$].promise,new Promise((X,J)=>setTimeout(()=>J(Error(`Timeout waiting for locale: ${$}`)),Z))]);return c0[$].promise}throw Error(`Locale "${$}" is not loading. Call loadTranslationLazy first.`)}function EK(){return Object.entries(Z1).filter(([$,Z])=>Z==="loading").map(([$])=>$)}function bK($){if($)delete c0[$],delete Z1[$];else{for(let Z of Object.keys(c0))delete c0[Z];for(let Z of Object.keys(Z1))delete Z1[Z]}}async function f3($,Z){let X={...g3,...Z.i18n},J=v3.isAbsolute(X.translationsDir)?X.translationsDir:v3.resolve(Z.root||process.cwd(),X.translationsDir);try{let Y=await hJ(),Q=Y?await Y($,{translationsDir:J,defaultLocale:X.defaultLocale,sources:nJ(X.format)}):await lJ($,X,J);if(Q===void 0){if($!==X.defaultLocale)return f3(X.defaultLocale,Z);return{}}let G=Q;if(X.cache)E0[$]={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 f3(X.defaultLocale,Z);return{}}}async function lJ($,Z,X){let J=v3.join(X,`${$}${cJ(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 pJ(Q);if(Z.format==="json")return JSON.parse(Q);throw Y}catch{return}}}function cJ($){switch($){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function pJ($){let Z={},X=$.split(`
3331
- `),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,U=Q.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(U){let[,,W,z]=U,K=W.trim(),H=z.trim();if(H==="")q[K]={},J.push({obj:q[K],indent:G});else q[K]=iJ(H)}}return Z}function iJ($){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 nJ($){switch($){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function sJ($,Z){return W$($,Z)}function oJ($,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 rJ($,Z={}){return e6($,Z)}function e6($,Z){let X="",J=0;while(J<$.length)if($[J]==="{"){let Y=aJ($,J);if(Y===-1){X+=$[J],J++;continue}let Q=$.slice(J+1,Y);X+=tJ(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 aJ($,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 tJ($,Z){let X=eJ($);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 $Y(Y,X.slice(2).join(","),Z);case"select":return XY(Y,X.slice(2).join(","));case"selectordinal":return JY(Y,X.slice(2).join(","));case"number":return QY(Y,X[2]?.trim());case"date":return GY(Y,X[2]?.trim());case"time":return qY(Y,X[2]?.trim());default:return Y!==void 0?String(Y):`{${$}}`}}function eJ($){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 $Y($,Z,X){let J=Number($)||0,Y=h3(Z),Q=`=${J}`;if(Y[Q])return P3(Y[Q],J,X);let G=ZY(J);if(Y[G])return P3(Y[G],J,X);if(Y.other)return P3(Y.other,J,X);return String(J)}function P3($,Z,X){let J=$.replace(/#/g,String(Z));return e6(J,X)}function ZY($){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 XY($,Z){let X=String($||""),J=h3(Z);if(J[X])return J[X];return J.other||String($)}function JY($,Z){let X=Number($)||0,J=h3(Z),Y=YY(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 YY($){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 h3($){let Z={},X=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,J=X.exec($);while(J!==null)Z[J[1]]=J[2],J=X.exec($);return Z}function QY($,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 GY($,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 qY($,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 UY($){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test($)}function x3($,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(UY(G))return rJ(G,J);if(G.includes("|")&&"count"in J){let q=Number(J.count),U=G.split("|");G=oJ(U,q)}for(let[q,U]of Object.entries(J)){let W=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");G=G.replace(new RegExp(`:${W}`,"g"),String(U))}return G}async function $9($,Z,X,J){let Y=$,Q=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,G={...g3,...J.i18n},q=await sJ(G.locale,J);Z.__translations=q,Z.__locale=G.locale,Z.__i18nConfig=G,Y=await a6(Y,Q,async(z,K,H,B,j)=>{try{let _={};if(H)try{let V=[()=>JSON.parse(H),()=>{let O=`{"data":${H}}`,L=JSON.parse(O);return typeof L.data==="object"?L.data:{}},()=>{return w0(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 x3(K,q,G.fallbackToKey,_)||B.trim()}catch(_){if(J.debug)console.error("Error processing @translate directive:",_);return e("Translate",`Error in @translate('${K}'): ${_ instanceof Error?_.message:String(_)}`,c.EVALUATION_ERROR)}});let U=/@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 z=[...Y.matchAll(U)];console.warn(`Found ${z.length} @translate matches`),z.forEach((K,H)=>console.warn(`Match ${H}: ${K[0]}, Key: ${K[1]}, Params: ${K[2]||"none"}`))}return Y=await a6(Y,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(z,K,H,B)=>{try{let j={};if(H)try{let _=[()=>JSON.parse(H),()=>{let F=`{"data":${H}}`,V=JSON.parse(F);return typeof V.data==="object"?V.data:{}},()=>{return w0(H,Z)}];for(let F of _)try{if(j=F(),Object.keys(j).length>0)break}catch{}}catch(_){if(J.debug)console.error("Error parsing parameters for @translate directive:",_)}return x3(K,q,G.fallbackToKey,j)}catch(j){if(J.debug)console.error("Error processing @translate directive:",j);return e("Translate",`Error in @translate('${K}'): ${j instanceof Error?j.message:String(j)}`,c.EVALUATION_ERROR)}}),Y}async function a6($,Z,X){let J=[];return $.replace(Z,(Q,...G)=>{let q=X(Q,...G).then((U)=>({match:Q,replacement:U}));return J.push(q),Q}),(await Promise.all(J)).reduce((Q,{match:G,replacement:q})=>Q.replace(G,q),$)}function yK($,Z=!0){return(X,J={})=>{return x3(X,$,Z,J)}}var M5=/<\/?template\b[^>]*>/gi,WY=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function zY($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return WY.test(Z)}function z$($){M5.lastIndex=0;let Z;while((Z=M5.exec($))!==null){if(Z[0].startsWith("</")||zY(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 W0 from"path";function u3($,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 KY($,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,U=1,W=q+1;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")")U--;W++}if(U!==0)break;let z=J.substring(q+1,W-1),K=`${X}(${z})`;J=J.substring(0,G)+K+J.substring(W),Y.lastIndex=G+K.length,Q=Y.exec(J)}return J}function HY($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function X9($){let Z=$,X=[],J=new Set,Y=0,Q=0,G=Z.length,q=(K)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===K){Q++;return}Q++}},U=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let K=1;while(Q<G&&K>0)if(Z[Q]==="{")K++,Q++;else if(Z[Q]==="}")K--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')q(Z[Q]);else if(Z[Q]==="`")U();else Q++;continue}Q++}},W=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3332
- `)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},z=()=>{if(Y!==0)return;let K=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!J.has(j))X.push(j),J.add(j);return}let H=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!J.has(j))X.push(j),J.add(j);return}let B=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!J.has(j))X.push(j),J.add(j)}};while(Q<G){if(W())continue;if(Z[Q]==="'"||Z[Q]==='"'){q(Z[Q]);continue}if(Z[Q]==="`"){U();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])))z();Q++}return X.join(", ")}function J9($,Z=""){let X=X9($).split(",").map((J)=>J.trim()).filter(Boolean);return`
3319
+ </script>`.trim()}import u3 from"path";var R5;async function tJ(){if(R5!==void 0)return R5;try{R5=(await import("@stacksjs/ts-i18n")).loadLocale??null}catch{R5=null}return R5}var l3={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},y0={},n0={},J1={};function vK($){if($)delete y0[$];else for(let Z of Object.keys(y0))delete y0[Z]}function fK(){let $=Object.entries(y0).map(([Z,X])=>({locale:Z,loadedAt:new Date(X.loadedAt),keyCount:J9(X.translations)}));return{size:Object.keys(y0).length,locales:Object.keys(y0),entries:$}}function J9($,Z=0){for(let X of Object.values($))if(Z++,X&&typeof X==="object"&&!Array.isArray(X))Z=J9(X,Z);return Z}function eJ($,Z=0){if(Z<=0)return!1;return Date.now()-$.loadedAt>Z}function xK($){if(y0[$])return"loaded";return J1[$]||"idle"}function gK($){return J1[$]==="loading"}function hK($){return!!y0[$]}async function $Y($,Z){let{locales:X,parallel:J=!0,priority:Y={},onLocaleLoaded:Q,onComplete:G,onError:q}=$,U=J?X:[...X].sort((W,z)=>(Y[z]||0)-(Y[W]||0));if(J){let W=U.map(async(z)=>{try{await H$(z,Z),Q?.(z)}catch(K){q?.(z,K instanceof Error?K:Error(String(K)))}});await Promise.all(W)}else for(let W of U)try{await H$(W,Z),Q?.(W)}catch(z){q?.(W,z instanceof Error?z:Error(String(z)))}G?.()}function uK($,Z){queueMicrotask(()=>{$Y($,Z).catch((X)=>{if(Z.debug)console.error("Background preload error:",X)})})}async function H$($,Z){if({...l3,...Z.i18n}.cache&&y0[$]){let Y=y0[$],Q=Z.i18n?.cacheMaxAge??0;if(!eJ(Y,Q))return Y.translations}if(n0[$]?.state==="loading")return n0[$].promise;J1[$]="loading";let J=d3($,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 ZY($){return y0[$]?.translations}async function dK($,Z){let X=ZY($);if(X)return X;return H$($,Z)}async function mK($,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 lK(){return Object.entries(J1).filter(([$,Z])=>Z==="loading").map(([$])=>$)}function cK($){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 d3($,Z){let X={...l3,...Z.i18n},J=u3.isAbsolute(X.translationsDir)?X.translationsDir:u3.resolve(Z.root||process.cwd(),X.translationsDir);try{let Y=await tJ(),Q=Y?await Y($,{translationsDir:J,defaultLocale:X.defaultLocale,sources:GY(X.format)}):await XY($,X,J);if(Q===void 0){if($!==X.defaultLocale)return d3(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 d3(X.defaultLocale,Z);return{}}}async function XY($,Z,X){let J=u3.join(X,`${$}${JY(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 YY(Q);if(Z.format==="json")return JSON.parse(Q);throw Y}catch{return}}}function JY($){switch($){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function YY($){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,U=Q.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(U){let[,,W,z]=U,K=W.trim(),H=z.trim();if(H==="")q[K]={},J.push({obj:q[K],indent:G});else q[K]=QY(H)}}return Z}function QY($){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 GY($){switch($){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function qY($,Z){return H$($,Z)}function UY($,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 WY($,Z={}){return Y9($,Z)}function Y9($,Z){let X="",J=0;while(J<$.length)if($[J]==="{"){let Y=zY($,J);if(Y===-1){X+=$[J],J++;continue}let Q=$.slice(J+1,Y);X+=KY(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 zY($,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 KY($,Z){let X=HY($);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 BY(Y,X.slice(2).join(","),Z);case"select":return _Y(Y,X.slice(2).join(","));case"selectordinal":return VY(Y,X.slice(2).join(","));case"number":return FY(Y,X[2]?.trim());case"date":return LY(Y,X[2]?.trim());case"time":return wY(Y,X[2]?.trim());default:return Y!==void 0?String(Y):`{${$}}`}}function HY($){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 BY($,Z,X){let J=Number($)||0,Y=c3(Z),Q=`=${J}`;if(Y[Q])return h3(Y[Q],J,X);let G=jY(J);if(Y[G])return h3(Y[G],J,X);if(Y.other)return h3(Y.other,J,X);return String(J)}function h3($,Z,X){let J=$.replace(/#/g,String(Z));return Y9(J,X)}function jY($){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 _Y($,Z){let X=String($||""),J=c3(Z);if(J[X])return J[X];return J.other||String($)}function VY($,Z){let X=Number($)||0,J=c3(Z),Y=OY(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 OY($){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 c3($){let Z={},X=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,J=X.exec($);while(J!==null)Z[J[1]]=J[2],J=X.exec($);return Z}function FY($,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 LY($,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 wY($,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 RY($){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test($)}function m3($,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(RY(G))return WY(G,J);if(G.includes("|")&&"count"in J){let q=Number(J.count),U=G.split("|");G=UY(U,q)}for(let[q,U]of Object.entries(J)){let W=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");G=G.replace(new RegExp(`:${W}`,"g"),String(U))}return G}async function Q9($,Z,X,J){let Y=$,Q=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,G={...l3,...J.i18n},q=await qY(G.locale,J);Z.__translations=q,Z.__locale=G.locale,Z.__i18nConfig=G,Y=await X9(Y,Q,async(z,K,H,B,j)=>{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 w0(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 m3(K,q,G.fallbackToKey,_)||B.trim()}catch(_){if(J.debug)console.error("Error processing @translate directive:",_);return $0("Translate",`Error in @translate('${K}'): ${_ instanceof Error?_.message:String(_)}`,m.EVALUATION_ERROR)}});let U=/@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 z=[...Y.matchAll(U)];console.warn(`Found ${z.length} @translate matches`),z.forEach((K,H)=>console.warn(`Match ${H}: ${K[0]}, Key: ${K[1]}, Params: ${K[2]||"none"}`))}return Y=await X9(Y,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(z,K,H,B)=>{try{let j={};if(H)try{let _=[()=>JSON.parse(H),()=>{let L=`{"data":${H}}`,V=JSON.parse(L);return typeof V.data==="object"?V.data:{}},()=>{return w0(H,Z)}];for(let L of _)try{if(j=L(),Object.keys(j).length>0)break}catch{}}catch(_){if(J.debug)console.error("Error parsing parameters for @translate directive:",_)}return m3(K,q,G.fallbackToKey,j)}catch(j){if(J.debug)console.error("Error processing @translate directive:",j);return $0("Translate",`Error in @translate('${K}'): ${j instanceof Error?j.message:String(j)}`,m.EVALUATION_ERROR)}}),Y}async function X9($,Z,X){let J=[];return $.replace(Z,(Q,...G)=>{let q=X(Q,...G).then((U)=>({match:Q,replacement:U}));return J.push(q),Q}),(await Promise.all(J)).reduce((Q,{match:G,replacement:q})=>Q.replace(G,q),$)}function pK($,Z=!0){return(X,J={})=>{return m3(X,$,Z,J)}}var D5=/<\/?template\b[^>]*>/gi,DY=/(?:^|\s)(?:id\s*=|(?:x-|[@:])(?:for|if|else(?:-if)?)(?=\s|=|$)|#[\w-]+(?:\s*=|\s|$)|v-slot(?::[\w-]+)?(?=\s|=|$)|slot\s*=)/i;function NY($){let Z=$.replace(/^<template\b/i,"").replace(/>$/,"");return DY.test(Z)}function B$($){D5.lastIndex=0;let Z;while((Z=D5.exec($))!==null){if(Z[0].startsWith("</")||NY(Z[0]))continue;let X=Z.index,J=D5.lastIndex,Y=1,Q;while((Q=D5.exec($))!==null)if(Q[0].startsWith("</")){if(Y--,Y===0){let G=Q.index;return{start:X,openEnd:J,closeStart:G,end:D5.lastIndex,content:$.slice(J,G)}}}else Y++;return null}return null}import z0 from"path";function p3($,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 AY($,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,U=1,W=q+1;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")")U--;W++}if(U!==0)break;let z=J.substring(q+1,W-1),K=`${X}(${z})`;J=J.substring(0,G)+K+J.substring(W),Y.lastIndex=G+K.length,Q=Y.exec(J)}return J}function MY($){return/\b(state|derived|effect)\s*(?:<[^<>()]*>)?\s*\(/.test($)}function q9($){let Z=$,X=[],J=new Set,Y=0,Q=0,G=Z.length,q=(K)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===K){Q++;return}Q++}},U=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let K=1;while(Q<G&&K>0)if(Z[Q]==="{")K++,Q++;else if(Z[Q]==="}")K--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')q(Z[Q]);else if(Z[Q]==="`")U();else Q++;continue}Q++}},W=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
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},z=()=>{if(Y!==0)return;let K=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!J.has(j))X.push(j),J.add(j);return}let H=Z.slice(Q).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!J.has(j))X.push(j),J.add(j);return}let B=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!J.has(j))X.push(j),J.add(j)}};while(Q<G){if(W())continue;if(Z[Q]==="'"||Z[Q]==='"'){q(Z[Q]);continue}if(Z[Q]==="`"){U();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])))z();Q++}return X.join(", ")}function U9($,Z=""){let X=q9($).split(",").map((J)=>J.trim()).filter(Boolean);return`
3333
3322
  (function() {
3334
- ${s1("var",X)}
3323
+ ${l1("var",X)}
3335
3324
  var __destroyHooks = [];
3336
3325
  var __origOnDestroy = onDestroy;
3337
3326
  onDestroy = function(fn) { __origOnDestroy(fn); __destroyHooks.push(fn); };
3338
3327
 
3339
3328
  ${$}
3340
3329
  ${Z}})();
3341
- `}function Y9($,Z){return`
3330
+ `}function W9($,Z){return`
3342
3331
  // Register scope variables for STX runtime
3343
3332
  if (!window.stx._scopes) window.stx._scopes = {};
3344
3333
  var __scopeRegistration = { __destroyCallbacks: __destroyHooks };
3345
- ${X9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeRegistration[${JSON.stringify(Q)}] = ${Q}; } catch (e) { /* not actually top-level */ }`).join(`
3334
+ ${q9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeRegistration[${JSON.stringify(Q)}] = ${Q}; } catch (e) { /* not actually top-level */ }`).join(`
3346
3335
  `)}
3347
3336
  // #1767: when the bundler renamed a component const that collided with an
3348
3337
  // inlined import (foo -> foo2), rebind the ORIGINAL template name to the
@@ -3350,7 +3339,7 @@ ${X9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3350
3339
  // shadowing import. __stxScopeRenames is emitted by bundleClientScript.
3351
3340
  try { if (typeof __stxScopeRenames !== 'undefined' && __stxScopeRenames) { for (var __stxRK in __stxScopeRenames) __scopeRegistration[__stxRK] = __stxScopeRenames[__stxRK]; } } catch (e) { /* no renames */ }
3352
3341
  window.stx._scopes['${Z}'] = __scopeRegistration;
3353
- `}function BY($,Z){let X=Y9($,Z),J=`
3342
+ `}function IY($,Z){let X=W9($,Z),J=`
3354
3343
  (function() {
3355
3344
  var __stxScopeEl = (typeof document !== 'undefined') ? document.querySelector('[data-stx-scope="${Z}"]') : null;
3356
3345
  var __stxPrevEl = (typeof window !== 'undefined') ? window.__STX_CURRENT_ELEMENT__ : undefined;
@@ -3359,29 +3348,29 @@ ${X9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3359
3348
  } finally {
3360
3349
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3361
3350
  }
3362
- })();`;return J+J9($,X)+`
3351
+ })();`;return J+U9($,X)+`
3363
3352
  } finally {
3364
3353
  if (typeof window !== 'undefined') window.__STX_CURRENT_ELEMENT__ = __stxPrevEl;
3365
3354
  }
3366
- })();`}function jY($,Z){if(G1($)){let Y=G1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:u1($,(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,pK=new L1(500),Q9=new Set;function iK(){Q9.clear()}function _Y($){if($.__onceStore instanceof Set)return $.__onceStore;return Q9}async function d3($,Z,X,J,Y,Q=new Set){let G=J.partialsDir||W0.join(W0.dirname(X),"partials");if(G&&!W0.isAbsolute(G))G=W0.resolve(process.cwd(),G);let q=KY($,"@partial","@include"),U=_Y(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,F,V)=>{let O=F.trim(),L=`${X}:${O}`;if(U.has(L))return"";return U.add(L),F});{let _=/@includeIf\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")")L--;w++}if(L!==0)break;let R=q.substring(O+1,w-1),D=R.match(/^\s*['"]([^'"]+)['"]/);if(!D){_.lastIndex=w;continue}let N=D[1],T=W(N,G,X),A="";if(T&&await Bun.file(T).exists())Y.add(T),A=`@include(${R})`;q=q.substring(0,V)+A+q.substring(w),_.lastIndex=0}}for(let[_,F]of[["@includeWhen",!1],["@includeUnless",!0]]){let V=new RegExp(`${_.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*\\(`,"g"),O;while((O=V.exec(q))!==null){let L=O.index,w=L+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),T=u3(N,0);if(T===-1){V.lastIndex=D;continue}let A=N.substring(0,T).trim(),M=N.substring(T+1).trim(),k=M.match(/^\s*['"]([^'"]+)['"]/);if(!k){V.lastIndex=D;continue}let I=k[1],y=M.substring(k[0].length),E,b=u3(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let C=`Boolean(${A})`,h;if(G0(C)){let d=q0(C,Object.keys(Z));h=Boolean(d(...Object.values(Z)))}else h=Boolean(t(C,Z));let x=F?!h:h,l="";if(x){let d=W(I,G,X);if(d&&await Bun.file(d).exists())Y.add(d);l=`@include('${I}'${E?`, ${E}`:""})`}q=q.substring(0,L)+l+q.substring(D),V.lastIndex=0}catch(C){let h=C instanceof Error?C.message:String(C),x=K0("Include",`Error evaluating ${_} condition: ${h}`,X,$,L);q=q.substring(0,L)+x+q.substring(D),V.lastIndex=0}}}{let _=/@each\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==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[,T,A,M,k]=N;try{let I,y=A.trim();if(G0(y))I=q0(y,Object.keys(Z))(...Object.values(Z));else I=t(y,Z);let E="";if(Array.isArray(I)&&I.length>0)for(let b of I){let C={...Z,[M]:b},h=await H(T,C,$,V);E+=h}else if(k)E=await H(k,{},$,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)+K0("Each",`Error in @each: ${y}`,X,$,V)+q.substring(w+1),_.lastIndex=0}}}{let _=/@includeFirst\s*\(/g,F;while((F=_.exec(q))!==null){let V=F.index,O=V+F[0].length-1,L=1,w=O+1;while(w<q.length&&L>0){if(q[w]==="(")L++;else if(q[w]===")"){if(L--,L===0)break}w++}if(L!==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 T=N[1],A=R.slice(N[0].length),M,k=A.match(/^\s*,\s*\{/);if(k){A=A.slice(k[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(T.replace(/'/g,'"')),b={};if(M)try{b=w0(M,Z)}catch(h){let x=h instanceof Error?h.message:String(h);if(J.debug){let l=K0("Include",`Error parsing includeFirst variables: ${x}`,X,$,V,D);q=q.replace(D,()=>l)}else q=q.replace(D,()=>I||"");continue}let C=!1;for(let h of E){let x=W(h,G,X);if(!x)continue;if(await a(x)){let l=await H(h,b,$,V);q=q.replace(D,()=>l),C=!0;break}}if(!C)if(I!==void 0)q=q.replace(D,()=>I);else if(J.debug){let h=K0("Include",`None of the includeFirst paths exist: ${T}`,X,$,V,D);q=q.replace(D,()=>h)}else q=q.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),C=K0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>C)}_.lastIndex=0}}function W(_,F,V){try{let O=_;if(!_.endsWith(".stx"))O=`${_}.stx`;let L=W0.resolve(F),w=W0.resolve(W0.dirname(V)),R;if(!O.startsWith("./")&&!O.startsWith("../"))R=W0.resolve(F,O);else R=W0.resolve(w,O);let D=W0.normalize(R),N=D.startsWith(L+W0.sep)||D===L,T=D.startsWith(w+W0.sep)||D===w,A=!1,M=W0.dirname(w);if(D.startsWith(M+W0.sep)){if(!W0.relative(M,D).split(W0.sep).some((E)=>E.startsWith(".")&&E!=="."&&E!==".."))A=!0}if(!N&&!T&&!A)return console.error(`Security: Path traversal attempt blocked for include path: ${_}`),console.error(` Resolved to: ${D}`),console.error(` Allowed dirs: ${L}, ${w}`),null;return D}catch(O){return console.error(`Error resolving path ${_}: ${O}`),null}}let z=W0.resolve(X);Q.add(z);function K(_,F,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:F,partialsDir:G}),K0("Include",F,X,V,O)}async function H(_,F={},V,O){let L=W(_,G,X);if(!L)return K(_,`Could not resolve path for include: ${_}`,V,O);let w=W0.resolve(L);if(Q.has(w)){let R=[...Q,w].map((D)=>W0.basename(D)).join(" -> ");return K(_,`Circular include detected: ${R}`,V,O)}try{Y.add(L);let R;if(!R)try{R=await Bun.file(L).text()}catch(x){let l=x instanceof Error?x.message:String(x);return K(_,`Error loading include file ${_}: ${l}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:x}=await import("./chunk-2pavh1yg.js");R=x(R,Z)}if(R&&(J.debug||!O5()&&!o5()))try{let{warnUnbalancedTags:x}=await import("./chunk-85wgtm01.js");x(R,L)}catch{}let D=R;try{let{processESImports:x}=await import("./chunk-h44qqffw.js");await x(R,Z,L,J,Y)}catch(x){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${L}:`,x instanceof Error?x.message:x)}let N=z$(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 k={...Z};k.__stx_signals_gate=Q1(R,L);for(let[x,l]of Object.entries(F))k[x]=l;let I=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(I)],E="",b=null;for(let x of y){let l=x[1]||"",d=x[2]||"",_0=l.includes("server"),h0=T1(l);if(!_0&&d.trim()){let{interpolateScriptExpressions:X0}=await import("./chunk-0x022m9m.js");d=X0(d,k)}let D0="";try{let{extractAndStripCssImports:X0,renderVendorStyleTags:J0}=await import("./chunk-1r8c2wws.js"),N0=X0(d,{filePath:L,projectRoot:process.cwd()});d=N0.code,D0=J0(N0.styles)}catch(X0){if(J.debug)console.warn(`[stx] vendor-css extractor skipped for ${L}:`,X0 instanceof Error?X0.message:X0)}if(h0&&d.trim())d=I1(d);if(!_0){try{let{injectBrowserCoreAutoImports:J0}=await import("./chunk-1r8c2wws.js");d=J0(d).code;let{hasUserImports:N0,bundleClientScript:z0}=await import("./chunk-g4t9zc0a.js");if(N0(d))d=await z0(d,L,{projectRoot:process.cwd()})}catch(J0){if(J.debug)console.warn(`[stx] bundler skipped for ${L}:`,J0 instanceof Error?J0.message:J0)}let{stripStxRuntimeImports:X0}=await import("./chunk-8raem8ng.js");d=X0(d)}let y0=HY(d);if(y0&&!_0){b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++Z9}`;let X0=t0(d),J0=BY(X0,b);E+=`${D0}<script data-stx-scoped data-stx-run="always">${J0}</script>
3367
- `;continue}if(_0)try{let{extractVariables:X0}=await import("./chunk-fenb3cqw.js");await X0(d,k,L)}catch(X0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${L}:`,X0)}if(!_0&&!y0){let X0=l.replace(/\bclient\b/i,"").trim();b=`stx_scope_${W0.basename(L,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++Z9}`;let J0=t0(d),N0=Y9(J0,b),z0=J9(J0,N0);E+=`${D0}<script data-stx-scoped data-stx-run="always"${X0?` ${X0}`:""}>${z0}</script>
3368
- `}}if(b){let x=jY(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] ${W0.relative(process.cwd(),L)} 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 d3(D,k,L,J,Y,Q);let{processLoops:C}=await import("./chunk-gd9gfw08.js"),h=C(D,k,L);if(h=$1(h,k,L),h=F1(h,k,L),M)h+=`
3369
- `+M;if(E)h+=`
3370
- `+E;return h}catch(R){let D=R instanceof Error?R.message:String(R);return K(_,`Error processing include ${_}: ${D}`,V,O)}}let B=/@include\s*\(/g,j;while((j=B.exec(q))!==null){let _=j.index,F=_+j[0].length-1,V=1,O=F+1;while(O<q.length&&V>0){if(q[O]==="(")V++;else if(q[O]===")")V--;O++}if(V!==0)break;let L=q.substring(_,O),w=q.substring(F+1,O-1),R=w.match(/^\s*['"]([^'"]+)['"]/);if(!R){B.lastIndex=O;continue}let D=R[1],N,T=w.substring(R[0].length),A=u3(T,0);if(A!==-1)N=T.substring(A+1).trim();let M={};if(N)try{M=w0(N,Z)}catch(I){let y=I instanceof Error?I.message:String(I);q=q.replace(L,K0("Include",`Error parsing include variables for ${D}: ${y}`,X,$,_)),B.lastIndex=0;continue}let k=await H(D,M,$,_);q=q.substring(0,_)+k+q.substring(O),B.lastIndex=0}return q}function m3($,Z){let X=$;function J(Y,Q,G,q){let U=Y,W=!0;while(W){W=!1;let z=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),K=U.match(z);if(!K||K.index===void 0)break;let H=K.index,B=K[1],j=H+K[0].length,_=new RegExp(`@${Q}\\(`),F=new RegExp(`@${G}(?![a-z])`),V=1,O=j,L=-1;while(V>0&&O<U.length){let R=U.slice(O),D=R.match(_),N=R.match(F),T=D?O+D.index:1/0,A=N?O+N.index:1/0;if(T<A)V++,O=T+(D[0].length||1);else if(A<1/0){if(V--,V===0){L=A;break}O=A+G.length+1}else break}if(L===-1)break;let w=U.slice(j,L);if(!Z[B])Z[B]=[];if(q)Z[B].unshift(w);else Z[B].push(w);U=U.substring(0,H)+U.substring(L+`@${G}`.length),W=!0}return U}return X=J(X,"push","endpush",!1),X=J(X,"prepend","endprepend",!0),X}function l3($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(X,J)=>{if(!Z[J]||Z[J].length===0)return"";return Z[J].join(`
3371
- `)})}import*as c3 from"path";async function G9($,Z,X=""){if(c3.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 U9($,Z,X,"@js","@endjs")}async function q9($,Z,X=""){if(c3.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 U9($,Z,X,"@ts","@endts")}async function U9($,Z,X,J,Y){let Q=$,G=h1(`${J}([\\s\\S]*?)${Y}`,"g"),q=[],U;while((U=G.exec($))!==null)q.push({fullMatch:U[0],content:U[1]||"",index:U.index});for(let{fullMatch:W,content:z,index:K}of q)try{let H={...Z,global:Z},B=Object.keys(H),j=Object.values(H),_=z.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 {};",L=`
3355
+ })();`}function kY($,Z){if(q1($)){let Y=q1($).tag.match(/data-stx-scope="([^"]*)"/);if(Y)return{html:$,mergedIntoExisting:Y[1],stamped:!0};return{html:P1($,(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 G9=0,QH=new c1(500),z9=new Set;function GH(){z9.clear()}function TY($){if($.__onceStore instanceof Set)return $.__onceStore;return z9}async function i3($,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=AY($,"@partial","@include"),U=TY(Z);q=q.replace(/@once([\s\S]*?)@endonce/g,(_,L,V)=>{let O=L.trim(),F=`${X}:${O}`;if(U.has(F))return"";return U.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],I=W(N,G,X),A="";if(I&&await Bun.file(I).exists())Y.add(I),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),I=p3(N,0);if(I===-1){V.lastIndex=D;continue}let A=N.substring(0,I).trim(),M=N.substring(I+1).trim(),T=M.match(/^\s*['"]([^'"]+)['"]/);if(!T){V.lastIndex=D;continue}let k=T[1],y=M.substring(T[0].length),E,b=p3(y,0);if(b!==-1)E=y.substring(b+1).trim();try{let S=`Boolean(${A})`,f;if(G0(S)){let u=q0(S,Object.keys(Z));f=Boolean(u(...Object.values(Z)))}else f=Boolean(e(S,Z));let g=L?!f:f,o="";if(g){let u=W(k,G,X);if(u&&await Bun.file(u).exists())Y.add(u);o=`@include('${k}'${E?`, ${E}`:""})`}q=q.substring(0,F)+o+q.substring(D),V.lastIndex=0}catch(S){let f=S instanceof Error?S.message:String(S),g=B0("Include",`Error evaluating ${_} condition: ${f}`,X,$,F);q=q.substring(0,F)+g+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[,I,A,M,T]=N;try{let k,y=A.trim();if(G0(y))k=q0(y,Object.keys(Z))(...Object.values(Z));else k=e(y,Z);let E="";if(Array.isArray(k)&&k.length>0)for(let b of k){let S={...Z,[M]:b},f=await H(I,S,$,V);E+=f}else if(T)E=await H(T,{},$,V);q=q.substring(0,V)+E+q.substring(w+1),_.lastIndex=0}catch(k){let y=k instanceof Error?k.message:String(k);q=q.substring(0,V)+B0("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 I=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 k,y=A.match(/^\s*,\s*['"]([^'"]*)['"]\s*$/);if(y)k=y[1];try{let E=JSON.parse(I.replace(/'/g,'"')),b={};if(M)try{b=w0(M,Z)}catch(f){let g=f instanceof Error?f.message:String(f);if(J.debug){let o=B0("Include",`Error parsing includeFirst variables: ${g}`,X,$,V,D);q=q.replace(D,()=>o)}else q=q.replace(D,()=>k||"");continue}let S=!1;for(let f of E){let g=W(f,G,X);if(!g)continue;if(await t(g)){let o=await H(f,b,$,V);q=q.replace(D,()=>o),S=!0;break}}if(!S)if(k!==void 0)q=q.replace(D,()=>k);else if(J.debug){let f=B0("Include",`None of the includeFirst paths exist: ${I}`,X,$,V,D);q=q.replace(D,()=>f)}else q=q.replace(D,"")}catch(E){let b=E instanceof Error?E.message:String(E),S=B0("Include",`Error processing @includeFirst: ${b}`,X,$,V,D);q=q.replace(D,()=>S)}_.lastIndex=0}}function W(_,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,I=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&&!I&&!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 z=z0.resolve(X);Q.add(z);function K(_,L,V,O){return J.onIncludeError?.({includePath:_,templatePath:X,message:L,partialsDir:G}),B0("Include",L,X,V,O)}async function H(_,L={},V,O){let F=W(_,G,X);if(!F)return K(_,`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 K(_,`Circular include detected: ${R}`,V,O)}try{Y.add(F);let R;if(!R)try{R=await Bun.file(F).text()}catch(g){let o=g instanceof Error?g.message:String(g);return K(_,`Error loading include file ${_}: ${o}`,V,O)}if(R)R=R.replace(/\{\{--[\s\S]*?--\}\}/g,"");if(R&&R.includes("@stream")){let{processStreamDirectives:g}=await import("./chunk-78bm61kd.js");R=g(R,Z)}if(R&&(J.debug||!j5()&&!t5()))try{let{warnUnbalancedTags:g}=await import("./chunk-tc01rmwh.js");g(R,F)}catch{}let D=R;try{let{processESImports:g}=await import("./chunk-mb0kqnwf.js");await g(R,Z,F,J,Y)}catch(g){if(J.debug)console.warn(`[stx] partial ES import extraction skipped for ${F}:`,g instanceof Error?g.message:g)}let N=B$(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[g,o]of Object.entries(L))T[g]=o;let k=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,y=[...R.matchAll(k)],E="",b=null;for(let g of y){let o=g[1]||"",u=g[2]||"",K0=o.includes("server"),e0=N1(o);if(!K0&&u.trim()){let{interpolateScriptExpressions:X0}=await import("./chunk-cd4v7xyr.js");u=X0(u,T)}let M0="";try{let{extractAndStripCssImports:X0,renderVendorStyleTags:H0}=await import("./chunk-qf5grrg1.js"),I0=X0(u,{filePath:F,projectRoot:process.cwd()});u=I0.code,M0=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&&u.trim())u=A1(u);if(!K0){try{let{injectBrowserCoreAutoImports:H0}=await import("./chunk-qf5grrg1.js");u=H0(u).code;let{hasUserImports:I0,bundleClientScript:E0}=await import("./chunk-9rkcrzj4.js");if(I0(u))u=await E0(u,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-q5et8k2d.js");u=X0(u)}let C0=MY(u);if(C0&&!K0){b=`stx_scope_${z0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++G9}`;let X0=$1(u),H0=IY(X0,b);E+=`${M0}<script data-stx-scoped data-stx-run="always">${H0}</script>
3356
+ `;continue}if(K0)try{let{extractVariables:X0}=await import("./chunk-7cts329z.js");await X0(u,T,F)}catch(X0){if(J.debug)console.warn(`Warning: Could not extract variables from server script in ${F}:`,X0)}if(!K0&&!C0){let X0=o.replace(/\bclient\b/i,"").trim();b=`stx_scope_${z0.basename(F,".stx").replace(/[^a-zA-Z0-9]/g,"_")}_${++G9}`;let H0=$1(u),I0=W9(H0,b),E0=U9(H0,I0);E+=`${M0}<script data-stx-scoped data-stx-run="always"${X0?` ${X0}`:""}>${E0}</script>
3357
+ `}}if(b){let g=kY(D,b);if(D=g.html,g.mergedIntoExisting)E=E.replace(`window.stx._scopes['${b}']`,`window.stx._scopes['${g.mergedIntoExisting}']`),b=g.mergedIntoExisting;else if(!g.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 i3(D,T,F,J,Y,Q);let{processLoops:S}=await import("./chunk-xpsxwbw0.js"),f=S(D,T,F);if(f=X1(f,T,F),f=V1(f,T,F),M)f+=`
3358
+ `+M;if(E)f+=`
3359
+ `+E;return f}catch(R){let D=R instanceof Error?R.message:String(R);return K(_,`Error processing include ${_}: ${D}`,V,O)}}let B=/@include\s*\(/g,j;while((j=B.exec(q))!==null){let _=j.index,L=_+j[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){B.lastIndex=O;continue}let D=R[1],N,I=w.substring(R[0].length),A=p3(I,0);if(A!==-1)N=I.substring(A+1).trim();let M={};if(N)try{M=w0(N,Z)}catch(k){let y=k instanceof Error?k.message:String(k);q=q.replace(F,B0("Include",`Error parsing include variables for ${D}: ${y}`,X,$,_)),B.lastIndex=0;continue}let T=await H(D,M,$,_);q=q.substring(0,_)+T+q.substring(O),B.lastIndex=0}return q}function n3($,Z){let X=$;function J(Y,Q,G,q){let U=Y,W=!0;while(W){W=!1;let z=new RegExp(`@${Q}\\(['"]([^'"]+)['"]\\)`),K=U.match(z);if(!K||K.index===void 0)break;let H=K.index,B=K[1],j=H+K[0].length,_=new RegExp(`@${Q}\\(`),L=new RegExp(`@${G}(?![a-z])`),V=1,O=j,F=-1;while(V>0&&O<U.length){let R=U.slice(O),D=R.match(_),N=R.match(L),I=D?O+D.index:1/0,A=N?O+N.index:1/0;if(I<A)V++,O=I+(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=U.slice(j,F);if(!Z[B])Z[B]=[];if(q)Z[B].unshift(w);else Z[B].push(w);U=U.substring(0,H)+U.substring(F+`@${G}`.length),W=!0}return U}return X=J(X,"push","endpush",!1),X=J(X,"prepend","endprepend",!0),X}function s3($,Z){return $.replace(/@stack\(['"]([^'"]+)['"]\)/g,(X,J)=>{if(!Z[J]||Z[J].length===0)return"";return Z[J].join(`
3360
+ `)})}import*as o3 from"path";async function K9($,Z,X=""){if(o3.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 B9($,Z,X,"@js","@endjs")}async function H9($,Z,X=""){if(o3.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 B9($,Z,X,"@ts","@endts")}async function B9($,Z,X,J,Y){let Q=$,G=d1(`${J}([\\s\\S]*?)${Y}`,"g"),q=[],U;while((U=G.exec($))!==null)q.push({fullMatch:U[0],content:U[1]||"",index:U.index});for(let{fullMatch:W,content:z,index:K}of q)try{let H={...Z,global:Z},B=Object.keys(H),j=Object.values(H),_=z.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=`
3372
3361
  ${_}
3373
3362
  ${O}
3374
- `,R=Function(...B,L)(...j);if(R&&typeof R==="object")Object.assign(Z,R);Q=Q.replace(W,"")}catch(H){console.error(`Error executing ${J} code block in ${X}:`,H);let B=H instanceof Error?H.message:String(H),j=K0(`${J} Directive`,`Error executing code: ${B}`,X,$,K,W);console.error(j),Q=Q.replace(W,"")}return Q}var VY=1000,OY=!1;function FY($,Z){let X=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,J="",Y=0,Q;while((Q=X.exec($))!==null){let G=Q.index+Q[0].length,q=Q.index+Q[0].indexOf("("),U=B0($,"(",")",q);if(U===-1)continue;let W=$.slice(G,U).trim();if(!W)continue;if(!Object.keys(Z).some((H)=>new RegExp(`(?:^|[^\\w$.])${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(W)))continue;let K;try{let H=w0(W,Z);if(!H||typeof H!=="object")continue;K=JSON.stringify(H)}catch{continue}J+=$.slice(Y,G)+K,Y=U,X.lastIndex=U}return Y===0?$:J+$.slice(Y)}function LY($,Z){let X=/@component\s*\(/g,J=$,Y,Q=[];while((Y=X.exec(J))!==null){let G=Y.index,q=G+Y[0].length-1,U=1,W=q+1;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")"){if(U--,U===0)break}W++}if(U!==0)continue;let z=J.substring(q+1,W),K=W+1,H=z.match(/^\s*['"]([^'"]+)['"]/);if(!H)continue;let B=H[1],j=z.slice(H[0].length),_=j.match(/^\s*,\s*/);if(!_)continue;let F=j.slice(_[0].length).trim();if(!F)continue;try{let V=w0(F,Z),O=JSON.stringify(V),L=`@component('${B}', ${O})`;Q.push({start:G,end:K,replacement:L})}catch{continue}}for(let G=Q.length-1;G>=0;G--){let{start:q,end:U,replacement:W}=Q[G];J=J.substring(0,q)+W+J.substring(U)}return J}function K$($,Z,X){let J=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),Q;while((Q=Y.exec(J))!==null){let G=Q.index,q=G+Q[0].length-1,U=1,W=q+1,z=null,K=!1;while(W<J.length&&U>0){let j=J[W];if(K){K=!1,W++;continue}if(j==="\\"&&z){K=!0,W++;continue}if(z){if(j===z)z=null;W++;continue}if(j==='"'||j==="'"||j==="`"){z=j,W++;continue}if(j==="(")U++;else if(j===")"){if(U--,U===0)break}W++}if(U!==0)break;let H=J.substring(q+1,W),B=X(H);J=J.substring(0,G)+B+J.substring(W+1)}return J}function wY($,Z){let X=$;return X=X.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(J,Y)=>{if(Y in Z)return`:${Y}="${Y}"`;return J}),X=X.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(J,Y,Q)=>{try{let G=Object.keys(Z),q=Object.values(Z);f5(Q);let W=q0(Q,G)(...q),z=JSON.stringify(W);if(z===void 0){if(!x5(Q).some((B)=>!(B in Z)))return"";return J}let K=Buffer.from(z,"utf8").toString("base64");return`__stx_${Y}="${K}"`}catch(G){return J}}),X}var H$="<!--__STX_BREAK__-->",B$="<!--__STX_CONTINUE__-->";function RY($,Z){let X=$;return X=K$(X,"@break",(J)=>{try{let Q=`!!(${J.trim()})`,G;if(G0(Q)){let q=q0(Q,Object.keys(Z));G=Boolean(q(...Object.values(Z)))}else G=Boolean(t(Q,Z));return G?H$:""}catch{return""}}),X=K$(X,"@continue",(J)=>{try{let Q=`!!(${J.trim()})`,G;if(G0(Q)){let q=q0(Q,Object.keys(Z));G=Boolean(q(...Object.values(Z)))}else G=Boolean(t(Q,Z));return G?B$:""}catch{return""}}),X}function DY($){let Z=$;return Z=Z.replace(/@break(?!\()/g,H$),Z=Z.replace(/@continue(?!\()/g,B$),Z}function W9($){let Z=$.includes(H$),X=Z?$.substring(0,$.indexOf(H$)):$;return{hasBreak:Z,content:X}}function z9($){let Z=$.includes(B$),X=Z?$.substring(0,$.indexOf(B$)):$;return{hasContinue:Z,content:X}}function H9($){let Z=$;return Z=K$(Z,"@break",(X)=>{let J=X.trim();if(!g5(J))return"";return`\`; if (${J}) { break; } result += \``}),Z=K$(Z,"@continue",(X)=>{let J=X.trim();if(!g5(J))return"";return`\`; if (${J}) { continue; } result += \``}),Z=Z.replace(/@break(?!\()/g,"`; break; result += `"),Z=Z.replace(/@continue(?!\()/g,"`; continue; result += `"),Z}function NY($){let Z=/@forelse\s*\(/g,X,J=[],Y=/@foreach\s*\(/g,Q=/@endforeach/g,G;while((G=Y.exec($))!==null)J.push({pos:G.index,delta:1});while((G=Q.exec($))!==null)J.push({pos:G.index,delta:-1});J.sort((z,K)=>z.pos-K.pos);let q=[],U=0;for(let z of J)U+=z.delta,q.push({pos:z.pos,depth:U});function W(z){let K=0,H=q.length-1,B=0;while(K<=H){let j=K+H>>1;if(q[j].pos<=z)B=q[j].depth,K=j+1;else H=j-1}return B}while((X=Z.exec($))!==null){if(W(X.index)>0)continue;let z=X.index,K=X.index+X[0].length-1,H=1,B=K+1,j=-1;while(B<$.length&&H>0){if($[B]==="(")H++;else if($[B]===")"){if(H--,H===0){j=B;break}}B++}if(j===-1)continue;let _=$.substring(K+1,j),F=B9(_);if(!F)continue;let{arrayExpr:V,itemVar:O}=F,L=j+1,w=1,R=L,D=/@forelse\s*\(/g,N=/@endforelse/g,T=-1;while(w>0&&R<$.length){D.lastIndex=R,N.lastIndex=R;let E=D.exec($),b=N.exec($);if(!b)break;if(E&&E.index<b.index)w++,R=E.index+E[0].length;else{if(w--,w===0){T=b.index;break}R=b.index+11}}if(T===-1)continue;let A=$.substring(L,T),M=T+11,k=-1,I=0,y=0;while(y<A.length){let E=A.indexOf("@",y);if(E===-1)break;let b=A.substring(E);if(/^@forelse\s*\(/.test(b))I++,y=E+1;else if(b.startsWith("@endforelse"))I--,y=E+11;else if(I===0&&b.startsWith("@empty")){if(A.length<=E+6||!/[a-z]/i.test(A[E+6])){k=E;break}y=E+1}else y=E+1}if(k===-1)continue;return{start:z,end:M,arrayExpr:V,itemVar:O,foreachContent:A.substring(0,k),emptyContent:A.substring(k+6)}}return null}function K9($,Z){let X=$;while(!0){let J=NY(X);if(!J)break;let{start:Y,end:Q,arrayExpr:G,itemVar:q,foreachContent:U,emptyContent:W}=J;try{let z;if(G0(G))z=q0(G,Object.keys(Z))(...Object.values(Z));else z=t(G,Z);let K;if(!Array.isArray(z)||z.length===0)K=W;else K=`@foreach (${G} as ${q})${U}@endforeach`;X=X.substring(0,Y)+K+X.substring(Q)}catch(z){let K=z instanceof Error?z.message:String(z),H=e("Forelse",`Error in @forelse(${G} as ${q}): ${K}`,c.EVALUATION_ERROR);X=X.substring(0,Y)+H+X.substring(Q)}}return X}function B9($){let Z=$.indexOf(" as ");if(Z!==-1){let Q=$.slice(0,Z).trim(),G=$.slice(Z+4).trim();return Q&&G?{arrayExpr:Q,itemVar:G}:null}let X=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec($);if(!X)return null;let J=X[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),Y=X[2].trim();return J&&Y?{arrayExpr:Y,itemVar:J}:null}function j9($,Z,X,J){let Y=$;Y=K9(Y,Z);function Q(U){let W=/@foreach\s*\(/g,z;while((z=W.exec(U))!==null){let K=z.index,H=z.index+z[0].length-1,B=1,j=H+1,_=-1;while(j<U.length&&B>0){if(U[j]==="(")B++;else if(U[j]===")"){if(B--,B===0){_=j;break}}j++}if(_===-1)continue;let F=U.substring(H+1,_),V=B9(F);if(!V)continue;let O=K,{arrayExpr:L,itemVar:w}=V,R=_+1,D=1,N=R,T=/@foreach\s*\(/g,A=/@endforeach/g;while(D>0&&N<U.length){T.lastIndex=N,A.lastIndex=N;let M=T.exec(U),k=A.exec(U);if(!k)break;if(M&&M.index<k.index)D++,N=M.index+M[0].length;else{if(D--,D===0){let I=U.substring(R,k.index),y=k.index+11;return{start:O,end:y,arrayExpr:L,itemVar:w,content:I}}N=k.index+11}}}return null}function G(U,W){let z=U;while(!0){let K=Q(z);if(!K)break;let{start:H,end:B,arrayExpr:j,itemVar:_,content:F}=K;try{let V=j.trim(),O;if(G0(V))O=q0(V,Object.keys(W))(...Object.values(W));else O=t(V,W);let L=!1;if(!Array.isArray(O))if(O instanceof Map)O=Array.from(O),L=!0;else if(O instanceof Set)O=Array.from(O);else if(typeof O==="string")O=Array.from(O);else if(O&&typeof O==="object"&&!(O instanceof Date)&&!(O instanceof RegExp))O=Object.entries(O),L=!0;else{console.warn(`[stx] @foreach(${V}) in ${X}: ${V} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.");let k=e("Foreach",`Error in @foreach: ${V} is not iterable`,c.TYPE_ERROR);z=z.substring(0,H)+k+z.substring(B);continue}let w=J?.loops?.useAltLoopVariable??OY,R=_.trim(),D=null,N,T=!1;if(R.includes("=>")){let k=R.split("=>").map((I)=>I.trim());if(k.length===2&&k[0]&&k[1])D=k[0],N=k[1];else N=R}else if(!R.startsWith("[")&&!R.startsWith("{")&&R.includes(",")){let k=R.split(",").map((I)=>I.trim());if(k.length===2&&k[0]&&k[1])N=k[0],D=k[1],T=!0;else N=R}else N=R;let A="",M=O;for(let k=0;k<M.length;k++){let I=M[k],y={index:k,iteration:k+1,first:k===0,last:k===M.length-1,count:M.length},E={...W,loop:y,$loop:y};if(N.startsWith("[")&&N.endsWith("]")){let x=N.slice(1,-1).split(",").map((l)=>l.trim());if(Array.isArray(I))x.forEach((l,d)=>{if(l)E[l]=I[d]});else E[N]=I}else E[N]=I;if(D)if(!T&&L&&Array.isArray(I)&&I.length===2)E[D]=I[0],E[N]=I[1];else E[D]=k;let b=RY(F,E),C=z9(b);if(C.hasContinue){A+=C.content;continue}let h=W9(b);if(h.hasBreak){A+=h.content;break}if(b=K9(b,E),b=G(b,E),b=$1(b,E,X),b=DY(b),h=W9(b),h.hasBreak){A+=h.content;break}if(C=z9(b),C.hasContinue){A+=C.content;continue}b=F1(b,E,X),b=wY(b,E),b=LY(b,E),b=FY(b,E),A+=b}z=z.substring(0,H)+A+z.substring(B)}catch(V){let O=e("Foreach",`Error in @foreach(${j.trim()} as ${_.trim()}): ${V instanceof Error?V.message:String(V)}`,c.EVALUATION_ERROR);z=z.substring(0,H)+O+z.substring(B)}}return z}Y=G(Y,Z),Y=V9(Y,Z,X,J);let q=J?.loops?.maxWhileIterations??VY;return Y=TY(Y,Z,q),Y}function _9($){return g5($)}function V9($,Z,X,J){let Y=$,Q=!0;while(Q){Q=!1;let G=Y.match(/@for\s*\(/);if(!G||G.index===void 0)break;let q=G.index,U=q+G[0].length-1,W=B0(Y,"(",")",U);if(W===-1)break;let z=Y.slice(U+1,W),K=W+1,H=q$(Y.slice(q),"for","endfor");if(H.length===0)break;let B=H[0].content,j=q+H[0].end;if(!_9(z)){let _=e("For",`Unsafe expression in @for: ${z}`,c.UNSAFE_EXPRESSION);Y=Y.substring(0,q)+_+Y.substring(j),Q=!0;continue}try{let _=AY(z),F=/@(?:for|foreach|if|unless)\s*\(/.test(B);if(_.length>0&&F){let D=MY({forExpr:z,content:B,iterVarNames:_,context:Z,filePath:X,options:J});Y=Y.substring(0,q)+D+Y.substring(j),Q=!0;continue}let V=Object.keys(Z),O=Object.values(Z),L=B.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(D,N)=>{return`\${${N}}`});L=H9(L);let R=Function(...V,`
3363
+ `,R=Function(...B,F)(...j);if(R&&typeof R==="object")Object.assign(Z,R);Q=Q.replace(W,"")}catch(H){console.error(`Error executing ${J} code block in ${X}:`,H);let B=H instanceof Error?H.message:String(H),j=B0(`${J} Directive`,`Error executing code: ${B}`,X,$,K,W);console.error(j),Q=Q.replace(W,"")}return Q}var EY=1000,bY=!1;function yY($,Z){let X=/@(include|partial)\s*\(\s*(['"])([^'"]+)\2\s*,\s*/g,J="",Y=0,Q;while((Q=X.exec($))!==null){let G=Q.index+Q[0].length,q=Q.index+Q[0].indexOf("("),U=j0($,"(",")",q);if(U===-1)continue;let W=$.slice(G,U).trim();if(!W)continue;if(!Object.keys(Z).some((H)=>new RegExp(`(?:^|[^\\w$.])${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w$])`).test(W)))continue;let K;try{let H=w0(W,Z);if(!H||typeof H!=="object")continue;K=JSON.stringify(H)}catch{continue}J+=$.slice(Y,G)+K,Y=U,X.lastIndex=U}return Y===0?$:J+$.slice(Y)}function SY($,Z){let X=/@component\s*\(/g,J=$,Y,Q=[];while((Y=X.exec(J))!==null){let G=Y.index,q=G+Y[0].length-1,U=1,W=q+1;while(W<J.length&&U>0){if(J[W]==="(")U++;else if(J[W]===")"){if(U--,U===0)break}W++}if(U!==0)continue;let z=J.substring(q+1,W),K=W+1,H=z.match(/^\s*['"]([^'"]+)['"]/);if(!H)continue;let B=H[1],j=z.slice(H[0].length),_=j.match(/^\s*,\s*/);if(!_)continue;let L=j.slice(_[0].length).trim();if(!L)continue;try{let V=w0(L,Z),O=JSON.stringify(V),F=`@component('${B}', ${O})`;Q.push({start:G,end:K,replacement:F})}catch{continue}}for(let G=Q.length-1;G>=0;G--){let{start:q,end:U,replacement:W}=Q[G];J=J.substring(0,q)+W+J.substring(U)}return J}function j$($,Z,X){let J=$,Y=new RegExp(`${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\(`),Q;while((Q=Y.exec(J))!==null){let G=Q.index,q=G+Q[0].length-1,U=1,W=q+1,z=null,K=!1;while(W<J.length&&U>0){let j=J[W];if(K){K=!1,W++;continue}if(j==="\\"&&z){K=!0,W++;continue}if(z){if(j===z)z=null;W++;continue}if(j==='"'||j==="'"||j==="`"){z=j,W++;continue}if(j==="(")U++;else if(j===")"){if(U--,U===0)break}W++}if(U!==0)break;let H=J.substring(q+1,W),B=X(H);J=J.substring(0,G)+B+J.substring(W+1)}return J}function CY($,Z){let X=$;return X=X.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)(?=\s+[^=]|\s*\/?>|\s*$)/g,(J,Y)=>{if(Y in Z)return`:${Y}="${Y}"`;return J}),X=X.replace(/:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,(J,Y,Q)=>{try{let G=Object.keys(Z),q=Object.values(Z);h5(Q);let W=q0(Q,G)(...q),z=JSON.stringify(W);if(z===void 0){if(!u5(Q).some((B)=>!(B in Z)))return"";return J}let K=Buffer.from(z,"utf8").toString("base64");return`__stx_${Y}="${K}"`}catch(G){return J}}),X}var _$="<!--__STX_BREAK__-->",V$="<!--__STX_CONTINUE__-->";function PY($,Z){let X=$;return X=j$(X,"@break",(J)=>{try{let Q=`!!(${J.trim()})`,G;if(G0(Q)){let q=q0(Q,Object.keys(Z));G=Boolean(q(...Object.values(Z)))}else G=Boolean(e(Q,Z));return G?_$:""}catch{return""}}),X=j$(X,"@continue",(J)=>{try{let Q=`!!(${J.trim()})`,G;if(G0(Q)){let q=q0(Q,Object.keys(Z));G=Boolean(q(...Object.values(Z)))}else G=Boolean(e(Q,Z));return G?V$:""}catch{return""}}),X}function vY($){let Z=$;return Z=Z.replace(/@break(?!\()/g,_$),Z=Z.replace(/@continue(?!\()/g,V$),Z}function j9($){let Z=$.includes(_$),X=Z?$.substring(0,$.indexOf(_$)):$;return{hasBreak:Z,content:X}}function _9($){let Z=$.includes(V$),X=Z?$.substring(0,$.indexOf(V$)):$;return{hasContinue:Z,content:X}}function O9($){let Z=$;return Z=j$(Z,"@break",(X)=>{let J=X.trim();if(!d5(J))return"";return`\`; if (${J}) { break; } result += \``}),Z=j$(Z,"@continue",(X)=>{let J=X.trim();if(!d5(J))return"";return`\`; if (${J}) { continue; } result += \``}),Z=Z.replace(/@break(?!\()/g,"`; break; result += `"),Z=Z.replace(/@continue(?!\()/g,"`; continue; result += `"),Z}function fY($){let Z=/@forelse\s*\(/g,X,J=[],Y=/@foreach\s*\(/g,Q=/@endforeach/g,G;while((G=Y.exec($))!==null)J.push({pos:G.index,delta:1});while((G=Q.exec($))!==null)J.push({pos:G.index,delta:-1});J.sort((z,K)=>z.pos-K.pos);let q=[],U=0;for(let z of J)U+=z.delta,q.push({pos:z.pos,depth:U});function W(z){let K=0,H=q.length-1,B=0;while(K<=H){let j=K+H>>1;if(q[j].pos<=z)B=q[j].depth,K=j+1;else H=j-1}return B}while((X=Z.exec($))!==null){if(W(X.index)>0)continue;let z=X.index,K=X.index+X[0].length-1,H=1,B=K+1,j=-1;while(B<$.length&&H>0){if($[B]==="(")H++;else if($[B]===")"){if(H--,H===0){j=B;break}}B++}if(j===-1)continue;let _=$.substring(K+1,j),L=F9(_);if(!L)continue;let{arrayExpr:V,itemVar:O}=L,F=j+1,w=1,R=F,D=/@forelse\s*\(/g,N=/@endforelse/g,I=-1;while(w>0&&R<$.length){D.lastIndex=R,N.lastIndex=R;let E=D.exec($),b=N.exec($);if(!b)break;if(E&&E.index<b.index)w++,R=E.index+E[0].length;else{if(w--,w===0){I=b.index;break}R=b.index+11}}if(I===-1)continue;let A=$.substring(F,I),M=I+11,T=-1,k=0,y=0;while(y<A.length){let E=A.indexOf("@",y);if(E===-1)break;let b=A.substring(E);if(/^@forelse\s*\(/.test(b))k++,y=E+1;else if(b.startsWith("@endforelse"))k--,y=E+11;else if(k===0&&b.startsWith("@empty")){if(A.length<=E+6||!/[a-z]/i.test(A[E+6])){T=E;break}y=E+1}else y=E+1}if(T===-1)continue;return{start:z,end:M,arrayExpr:V,itemVar:O,foreachContent:A.substring(0,T),emptyContent:A.substring(T+6)}}return null}function V9($,Z){let X=$;while(!0){let J=fY(X);if(!J)break;let{start:Y,end:Q,arrayExpr:G,itemVar:q,foreachContent:U,emptyContent:W}=J;try{let z;if(G0(G))z=q0(G,Object.keys(Z))(...Object.values(Z));else z=e(G,Z);let K;if(!Array.isArray(z)||z.length===0)K=W;else K=`@foreach (${G} as ${q})${U}@endforeach`;X=X.substring(0,Y)+K+X.substring(Q)}catch(z){let K=z instanceof Error?z.message:String(z),H=$0("Forelse",`Error in @forelse(${G} as ${q}): ${K}`,m.EVALUATION_ERROR);X=X.substring(0,Y)+H+X.substring(Q)}}return X}function F9($){let Z=$.indexOf(" as ");if(Z!==-1){let Q=$.slice(0,Z).trim(),G=$.slice(Z+4).trim();return Q&&G?{arrayExpr:Q,itemVar:G}:null}let X=/^\s*(.+?)\s+in\s+([\s\S]+)$/.exec($);if(!X)return null;let J=X[1].trim().replace(/^\(([\s\S]*)\)$/,"$1").trim(),Y=X[2].trim();return J&&Y?{arrayExpr:Y,itemVar:J}:null}function L9($,Z,X,J){let Y=$;Y=V9(Y,Z);function Q(U){let W=/@foreach\s*\(/g,z;while((z=W.exec(U))!==null){let K=z.index,H=z.index+z[0].length-1,B=1,j=H+1,_=-1;while(j<U.length&&B>0){if(U[j]==="(")B++;else if(U[j]===")"){if(B--,B===0){_=j;break}}j++}if(_===-1)continue;let L=U.substring(H+1,_),V=F9(L);if(!V)continue;let O=K,{arrayExpr:F,itemVar:w}=V,R=_+1,D=1,N=R,I=/@foreach\s*\(/g,A=/@endforeach/g;while(D>0&&N<U.length){I.lastIndex=N,A.lastIndex=N;let M=I.exec(U),T=A.exec(U);if(!T)break;if(M&&M.index<T.index)D++,N=M.index+M[0].length;else{if(D--,D===0){let k=U.substring(R,T.index),y=T.index+11;return{start:O,end:y,arrayExpr:F,itemVar:w,content:k}}N=T.index+11}}}return null}function G(U,W){let z=U;while(!0){let K=Q(z);if(!K)break;let{start:H,end:B,arrayExpr:j,itemVar:_,content:L}=K;try{let V=j.trim(),O;if(G0(V))O=q0(V,Object.keys(W))(...Object.values(W));else O=e(V,W);let F=!1;if(!Array.isArray(O))if(O instanceof Map)O=Array.from(O),F=!0;else if(O instanceof Set)O=Array.from(O);else if(typeof O==="string")O=Array.from(O);else if(O&&typeof O==="object"&&!(O instanceof Date)&&!(O instanceof RegExp))O=Object.entries(O),F=!0;else{console.warn(`[stx] @foreach(${V}) in ${X}: ${V} is not iterable server-side, so the loop rendered nothing. `+"Values a server loop reads must come from <script server> or the page context \u2014 "+"a plain <script> runs in the browser.");let T=$0("Foreach",`Error in @foreach: ${V} is not iterable`,m.TYPE_ERROR);z=z.substring(0,H)+T+z.substring(B);continue}let w=J?.loops?.useAltLoopVariable??bY,R=_.trim(),D=null,N,I=!1;if(R.includes("=>")){let T=R.split("=>").map((k)=>k.trim());if(T.length===2&&T[0]&&T[1])D=T[0],N=T[1];else N=R}else if(!R.startsWith("[")&&!R.startsWith("{")&&R.includes(",")){let T=R.split(",").map((k)=>k.trim());if(T.length===2&&T[0]&&T[1])N=T[0],D=T[1],I=!0;else N=R}else N=R;let A="",M=O;for(let T=0;T<M.length;T++){let k=M[T],y={index:T,iteration:T+1,first:T===0,last:T===M.length-1,count:M.length},E={...W,loop:y,$loop:y};if(N.startsWith("[")&&N.endsWith("]")){let g=N.slice(1,-1).split(",").map((o)=>o.trim());if(Array.isArray(k))g.forEach((o,u)=>{if(o)E[o]=k[u]});else E[N]=k}else E[N]=k;if(D)if(!I&&F&&Array.isArray(k)&&k.length===2)E[D]=k[0],E[N]=k[1];else E[D]=T;let b=PY(L,E),S=_9(b);if(S.hasContinue){A+=S.content;continue}let f=j9(b);if(f.hasBreak){A+=f.content;break}if(b=V9(b,E),b=G(b,E),b=X1(b,E,X),b=vY(b),f=j9(b),f.hasBreak){A+=f.content;break}if(S=_9(b),S.hasContinue){A+=S.content;continue}b=V1(b,E,X),b=CY(b,E),b=SY(b,E),b=yY(b,E),A+=b}z=z.substring(0,H)+A+z.substring(B)}catch(V){let O=$0("Foreach",`Error in @foreach(${j.trim()} as ${_.trim()}): ${V instanceof Error?V.message:String(V)}`,m.EVALUATION_ERROR);z=z.substring(0,H)+O+z.substring(B)}}return z}Y=G(Y,Z),Y=R9(Y,Z,X,J);let q=J?.loops?.maxWhileIterations??EY;return Y=hY(Y,Z,q),Y}function w9($){return d5($)}function R9($,Z,X,J){let Y=$,Q=!0;while(Q){Q=!1;let G=Y.match(/@for\s*\(/);if(!G||G.index===void 0)break;let q=G.index,U=q+G[0].length-1,W=j0(Y,"(",")",U);if(W===-1)break;let z=Y.slice(U+1,W),K=W+1,H=z$(Y.slice(q),"for","endfor");if(H.length===0)break;let B=H[0].content,j=q+H[0].end;if(!w9(z)){let _=$0("For",`Unsafe expression in @for: ${z}`,m.UNSAFE_EXPRESSION);Y=Y.substring(0,q)+_+Y.substring(j),Q=!0;continue}try{let _=xY(z),L=/@(?:for|foreach|if|unless)\s*\(/.test(B);if(_.length>0&&L){let D=gY({forExpr:z,content:B,iterVarNames:_,context:Z,filePath:X,options:J});Y=Y.substring(0,q)+D+Y.substring(j),Q=!0;continue}let V=Object.keys(Z),O=Object.values(Z),F=B.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(D,N)=>{return`\${${N}}`});F=O9(F);let R=Function(...V,`
3375
3364
  let result = '';
3376
3365
  for (${z}) {
3377
- result += \`${L}\`;
3366
+ result += \`${F}\`;
3378
3367
  }
3379
3368
  return result;
3380
- `)(...O);Y=Y.substring(0,q)+R+Y.substring(j),Q=!0}catch(_){let F=e("For",`Error in @for(${z}): ${_ instanceof Error?_.message:String(_)}`,c.EVALUATION_ERROR);Y=Y.substring(0,q)+F+Y.substring(j),Q=!0}}return Y}function AY($){let Z=$.trim(),X=Z.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(X){let Q=X[1];return Q.slice(1,-1).split(",").map((q)=>{let U=q.trim();if(!U)return"";let W=U.indexOf(":");if(W>=0&&Q.startsWith("{")){let H=U.slice(W+1).trim(),B=H.indexOf("=");return(B>=0?H.slice(0,B):H).trim()}let z=U.indexOf("="),K=(z>=0?U.slice(0,z):U).trim();return/^[A-Za-z_$][\w$]*$/.test(K)?K:""}).filter(Boolean)}let J=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(J)return[J[1]];let Y=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(Y)return[Y[1]];return[]}function MY($){let{forExpr:Z,content:X,iterVarNames:J,context:Y,filePath:Q,options:G}=$,q=Object.keys(Y),U=Object.values(Y),W=Function(...q,"__pushIter",`
3369
+ `)(...O);Y=Y.substring(0,q)+R+Y.substring(j),Q=!0}catch(_){let L=$0("For",`Error in @for(${z}): ${_ instanceof Error?_.message:String(_)}`,m.EVALUATION_ERROR);Y=Y.substring(0,q)+L+Y.substring(j),Q=!0}}return Y}function xY($){let Z=$.trim(),X=Z.match(/^(?:const|let|var)\s+(\[[^\]]+\]|\{[^}]+\})\s+(?:of|in)\s+/);if(X){let Q=X[1];return Q.slice(1,-1).split(",").map((q)=>{let U=q.trim();if(!U)return"";let W=U.indexOf(":");if(W>=0&&Q.startsWith("{")){let H=U.slice(W+1).trim(),B=H.indexOf("=");return(B>=0?H.slice(0,B):H).trim()}let z=U.indexOf("="),K=(z>=0?U.slice(0,z):U).trim();return/^[A-Za-z_$][\w$]*$/.test(K)?K:""}).filter(Boolean)}let J=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s+(?:of|in)\s+/);if(J)return[J[1]];let Y=Z.match(/^(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=[^;]*;/);if(Y)return[Y[1]];return[]}function gY($){let{forExpr:Z,content:X,iterVarNames:J,context:Y,filePath:Q,options:G}=$,q=Object.keys(Y),U=Object.values(Y),W=Function(...q,"__pushIter",`
3381
3370
  for (${Z}) {
3382
3371
  __pushIter([${J.join(", ")}])
3383
3372
  }
3384
- `),z=[];W(...U,(B)=>{z.push(B)});let K=Q??"inline.stx",H="";for(let B of z){let j={...Y};J.forEach((F,V)=>{j[F]=B[V]});let _=V9(X,j,Q,G);_=$1(_,j,K),_=F1(_,j,K),H+=_}return H}function TY($,Z,X){let J=$,Y=!0;while(Y){Y=!1;let Q=J.match(/@while\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,q=G+Q[0].length-1,U=B0(J,"(",")",q);if(U===-1)break;let W=J.slice(q+1,U),z=q$(J.slice(G),"while","endwhile");if(z.length===0)break;let K=z[0].content,H=G+z[0].end;if(!_9(W)){let B=e("While",`Unsafe expression in @while: ${W}`,c.UNSAFE_EXPRESSION);J=J.substring(0,G)+B+J.substring(H),Y=!0;continue}try{let B=Object.keys(Z),j=Object.values(Z),_=K.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(O,L)=>{return`\${${L}}`});_=H9(_);let V=Function(...B,`
3373
+ `),z=[];W(...U,(B)=>{z.push(B)});let K=Q??"inline.stx",H="";for(let B of z){let j={...Y};J.forEach((L,V)=>{j[L]=B[V]});let _=R9(X,j,Q,G);_=X1(_,j,K),_=V1(_,j,K),H+=_}return H}function hY($,Z,X){let J=$,Y=!0;while(Y){Y=!1;let Q=J.match(/@while\s*\(/);if(!Q||Q.index===void 0)break;let G=Q.index,q=G+Q[0].length-1,U=j0(J,"(",")",q);if(U===-1)break;let W=J.slice(q+1,U),z=z$(J.slice(G),"while","endwhile");if(z.length===0)break;let K=z[0].content,H=G+z[0].end;if(!w9(W)){let B=$0("While",`Unsafe expression in @while: ${W}`,m.UNSAFE_EXPRESSION);J=J.substring(0,G)+B+J.substring(H),Y=!0;continue}try{let B=Object.keys(Z),j=Object.values(Z),_=K.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{([^}]+)\}\}/g,(O,F)=>{return`\${${F}}`});_=O9(_);let V=Function(...B,`
3385
3374
  let result = '';
3386
3375
  let maxIterations = ${X}; // Configurable safety limit
3387
3376
  let counter = 0;
@@ -3393,43 +3382,43 @@ ${X9($).split(",").map((Q)=>Q.trim()).filter(Boolean).map((Q)=>` try { __scopeR
3393
3382
  result += '<!-- [While Error [1104]]: Maximum iterations (${X}) exceeded in while loop. Configure via options.loops.maxWhileIterations -->';
3394
3383
  }
3395
3384
  return result;
3396
- `)(...j);J=J.substring(0,G)+V+J.substring(H),Y=!0}catch(B){let j=e("While",`Error in @while(${W}): ${B instanceof Error?B.message:String(B)}`,c.EVALUATION_ERROR);J=J.substring(0,G)+j+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 O9($){return $.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(Z,X,J,Y,Q)=>{return IY(J,Q||"_method")})}async function F9($,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 U=await q.handler(Q,Z,X,J);if(typeof U==="string")Q=U;else if(J.debug)console.warn(`Middleware ${q.name} did not return a string`)}catch(U){if(J.debug)console.error(`Error in middleware ${q.name}:`,U);if(J.debug){let W=K0("Middleware",`Error in middleware '${q.name}': ${U instanceof Error?U.message:String(U)}`,X,$);Q=Q.replace(/<body[^>]*>/,`$&
3397
- <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${f$(W)}</div>
3398
- `)}}}return Q}async function L9($,Z,X,J){return F9($,Z,X,J,"before")}async function w9($,Z,X,J){return F9($,Z,X,J,"after")}B5();B5();function R9($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,X,J,Y,Q)=>{try{let G=Y?w0(Y,{}):{};return p3(J,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var p0={patterns:[],exact:{}};function _H($,Z){if(!p0.exact[$])p0.exact[$]=[];p0.exact[$].push(Z)}function VH($,Z){let X=typeof $==="string"?new RegExp($):$;p0.patterns.push({pattern:X,callback:Z})}async function D9($,Z){let X=$.split("/").pop()?.split(".")[0]||"";if(p0.exact[$])for(let J of p0.exact[$])await Promise.resolve(J(Z,$));if(p0.exact[X])for(let J of p0.exact[X])await Promise.resolve(J(Z,$));for(let{pattern:J,callback:Y}of p0.patterns)if(J.test($)||J.test(X))await Promise.resolve(Y(Z,$))}function OH(){p0.patterns=[],p0.exact={}}var kY=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),EY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function bY($){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("/>")||EY.has(q)){Z.push([Q,G]);continue}let U=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(`<\\/?${U}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");W.lastIndex=G;let z=1,K=G,H;while((H=W.exec($))!==null)if(H[0].startsWith("</")){if(z--,z===0){K=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))z++;Z.push([Q,K])}return Z}function A9($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>A9(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function M9($,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(...bY($));function G(W){return Y.some(([z,K])=>W>=z&&W<K)}let q=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,U=[];while((Q=q.exec(X))!==null){if(G(Q.index))continue;let W=Q[0],z=Q[2];if(!z||!z.includes(":"))continue;let K=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,H,B=z,j=!1;while((H=K.exec(z))!==null){let _=H[1],F=H[2];if(N9(_))continue;if(F.includes("()")&&!F.includes(".get(")||F.includes("$store")||F.includes("$ref"))continue;try{let V=Object.keys(Z),O=Object.values(Z),L=F.match(/^([a-zA-Z_$][\w$]*)/);if(L&&!V.includes(L[1])&&!["true","false","null","undefined","Math","JSON","String","Number","Array","Object","Date","parseInt","parseFloat"].includes(L[1]))continue;let R=Function(...V,`return (${F})`)(...O);if(_==="class"){let D=A9(R);if(D){let N=B.match(/\sclass="([^"]*)"/);if(N)B=B.replace(N[0],` class="${N[1]} ${D}"`);else B=B.replace(H[0],` class="${D}"`)}else B=B.replace(H[0],"");j=!0;continue}if(kY.has(_)){if(R)B=B.replace(H[0],` ${_}`);else B=B.replace(H[0],"");j=!0;continue}if(R===null||R===void 0||R===!1)B=B.replace(H[0],"");else{let D=String(R).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B=B.replace(H[0],` ${_}="${D}"`)}j=!0}catch{continue}}if(j){let _=W.endsWith("/>")?" /":"",V=`<${Q[1]}${B}${_}>`;U.push({start:Q.index,end:Q.index+W.length,replacement:V})}}for(let W=U.length-1;W>=0;W--){let{start:z,end:K,replacement:H}=U[W];X=X.slice(0,z)+H+X.slice(K)}return X}var yY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),SY=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()&&yY.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 CY($,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($),U=G.exec($);if(!U)return-1;if(q&&q.index<U.index)J++,Y=q.index+q[0].length;else{if(J--,J===0)return U.index+U[0].length;Y=U.index+U[0].length}}return-1}function o0($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let X=CY($,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 T9($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function o1($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),J=$.match(new RegExp(`${X}="([^"]*)"`,"s"))||$.match(new RegExp(`${X}='([^']*)'`,"s"));return J?J[1]:null}function H1($,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 PY($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function vY($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=o1(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(),U;if(G.includes(",")){let F=G.split(",").map((L)=>L.trim()),V=F[0],O=F[1];U=`${q} as ${O} => ${V}`}else U=`${q} as ${G}`;let W=H1(J.attrs,"v-for"),z=H1(W,":key").replace(/\s*v-bind:key="[^"]*"/g,""),K=o0(Z,J),H=Z.slice(K.outerStart,K.outerEnd),B=B1(H,{...J,start:0,end:J.end-J.start},z),j=`@foreach(${U})
3385
+ `)(...j);J=J.substring(0,G)+V+J.substring(H),Y=!0}catch(B){let j=$0("While",`Error in @while(${W}): ${B instanceof Error?B.message:String(B)}`,m.EVALUATION_ERROR);J=J.substring(0,G)+j+J.substring(H),Y=!0}}return J}function uY($,Z="_method"){let X=$.toUpperCase();if(X==="GET"||X==="POST")return"";return`<input type="hidden" name="${Z}" value="${X}">`}function D9($){return $.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(Z,X,J,Y,Q)=>{return uY(J,Q||"_method")})}async function N9($,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 U=await q.handler(Q,Z,X,J);if(typeof U==="string")Q=U;else if(J.debug)console.warn(`Middleware ${q.name} did not return a string`)}catch(U){if(J.debug)console.error(`Error in middleware ${q.name}:`,U);if(J.debug){let W=B0("Middleware",`Error in middleware '${q.name}': ${U instanceof Error?U.message:String(U)}`,X,$);Q=Q.replace(/<body[^>]*>/,`$&
3386
+ <div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${m$(W)}</div>
3387
+ `)}}}return Q}async function A9($,Z,X,J){return N9($,Z,X,J,"before")}async function M9($,Z,X,J){return N9($,Z,X,J,"after")}z5();z5();function I9($){return $.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(Z,X,J,Y,Q)=>{try{let G=Y?w0(Y,{}):{};return r3(J,G,Q==="true")}catch(G){return console.error(`Error processing @route directive: ${G}`),"#route-error"}})}var s0={patterns:[],exact:{}};function EH($,Z){if(!s0.exact[$])s0.exact[$]=[];s0.exact[$].push(Z)}function bH($,Z){let X=typeof $==="string"?new RegExp($):$;s0.patterns.push({pattern:X,callback:Z})}async function k9($,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 yH(){s0.patterns=[],s0.exact={}}var dY=new Set(["disabled","checked","readonly","required","autofocus","autoplay","controls","default","defer","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","reversed","selected"]),mY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function lY($){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("/>")||mY.has(q)){Z.push([Q,G]);continue}let U=q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),W=new RegExp(`<\\/?${U}\\b(?:[^>"']|"[^"]*"|'[^']*')*>`,"gi");W.lastIndex=G;let z=1,K=G,H;while((H=W.exec($))!==null)if(H[0].startsWith("</")){if(z--,z===0){K=H.index+H[0].length;break}}else if(!H[0].endsWith("/>"))z++;Z.push([Q,K])}return Z}function E9($){if(typeof $==="string")return $;if(Array.isArray($))return $.filter(Boolean).map((Z)=>E9(Z)).join(" ");if($&&typeof $==="object")return Object.entries($).filter(([,Z])=>Z).map(([Z])=>Z).join(" ");return $?String($):""}function b9($,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(...lY($));function G(W){return Y.some(([z,K])=>W>=z&&W<K)}let q=/<([a-zA-Z][a-zA-Z0-9-]*)\b((?:[^>"']|"[^"]*"|'[^']*')*)\s*\/?>/g,U=[];while((Q=q.exec(X))!==null){if(G(Q.index))continue;let W=Q[0],z=Q[2];if(!z||!z.includes(":"))continue;let K=/\s:([a-zA-Z_][\w-]*)\s*=\s*"([^"]*)"/g,H,B=z,j=!1;while((H=K.exec(z))!==null){let _=H[1],L=H[2];if(T9(_))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=E9(R);if(D){let N=B.match(/\sclass="([^"]*)"/);if(N)B=B.replace(N[0],` class="${N[1]} ${D}"`);else B=B.replace(H[0],` class="${D}"`)}else B=B.replace(H[0],"");j=!0;continue}if(dY.has(_)){if(R)B=B.replace(H[0],` ${_}`);else B=B.replace(H[0],"");j=!0;continue}if(R===null||R===void 0||R===!1)B=B.replace(H[0],"");else{let D=String(R).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B=B.replace(H[0],` ${_}="${D}"`)}j=!0}catch{continue}}if(j){let _=W.endsWith("/>")?" /":"",V=`<${Q[1]}${B}${_}>`;U.push({start:Q.index,end:Q.index+W.length,replacement:V})}}for(let W=U.length-1;W>=0;W--){let{start:z,end:K,replacement:H}=U[W];X=X.slice(0,z)+H+X.slice(K)}return X}var cY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),pY=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 M1($,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()&&cY.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 iY($,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($),U=G.exec($);if(!U)return-1;if(q&&q.index<U.index)J++,Y=q.index+q[0].length;else{if(J--,J===0)return U.index+U[0].length;Y=U.index+U[0].length}}return-1}function a0($,Z){if(Z.selfClosing)return{outerStart:Z.start,outerEnd:Z.end,innerHTML:""};let X=iY($,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 y9($,Z){return new RegExp(`(?:^|\\s)${Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test($)||$.includes(` ${Z}=`)||$.includes(` ${Z} `)||$.trimEnd().endsWith(` ${Z}`)}function p1($,Z){let X=Z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),J=$.match(new RegExp(`${X}="([^"]*)"`,"s"))||$.match(new RegExp(`${X}='([^']*)'`,"s"));return J?J[1]:null}function B1($,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 j1($,Z,X){let J=Z.selfClosing?" /":"",Y=`<${Z.tag}${X}${J}>`;return $.slice(0,Z.start)+Y+$.slice(Z.end)}function nY($){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test($)}function sY($){let Z=$,X=0;while(X<Z.length){let J=M1(Z,X);if(!J)break;let Y=p1(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(),U;if(G.includes(",")){let L=G.split(",").map((F)=>F.trim()),V=L[0],O=L[1];U=`${q} as ${O} => ${V}`}else U=`${q} as ${G}`;let W=B1(J.attrs,"v-for"),z=B1(W,":key").replace(/\s*v-bind:key="[^"]*"/g,""),K=a0(Z,J),H=Z.slice(K.outerStart,K.outerEnd),B=j1(H,{...J,start:0,end:J.end-J.start},z),j=`@foreach(${U})
3399
3388
  `,_=`${j}${B}
3400
- @endforeach`;Z=Z.slice(0,K.outerStart)+_+Z.slice(K.outerEnd),X=K.outerStart+j.length}return Z}function fY($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=o1(J.attrs,"v-if");if(Y===null){X=J.end;continue}let Q=[],G=o0(Z,J),q=H1(J.attrs,"v-if"),U=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:U,parsedTag:J});let W=G.outerEnd,z=!0;while(z){let _=Z.slice(W).match(/^\s*/),F=_?_[0].length:0,V=k1(Z,W+F);if(!V){z=!1;break}let O=o1(V.attrs,"v-else-if"),L=T9(V.attrs,"v-else");if(O!==null){let w=o0(Z,V),R=H1(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:W,outerEnd:w.outerEnd,element:D,parsedTag:V}),W=w.outerEnd}else if(L){let w=o0(Z,V),R=H1(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:W,outerEnd:w.outerEnd,element:D,parsedTag:V}),z=!1}else z=!1}let K=[];for(let _ of Q)if(_.type==="if")K.push(`@if(${_.expr})
3389
+ @endforeach`;Z=Z.slice(0,K.outerStart)+_+Z.slice(K.outerEnd),X=K.outerStart+j.length}return Z}function oY($){let Z=$,X=0;while(X<Z.length){let J=M1(Z,X);if(!J)break;let Y=p1(J.attrs,"v-if");if(Y===null){X=J.end;continue}let Q=[],G=a0(Z,J),q=B1(J.attrs,"v-if"),U=j1(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:U,parsedTag:J});let W=G.outerEnd,z=!0;while(z){let _=Z.slice(W).match(/^\s*/),L=_?_[0].length:0,V=M1(Z,W+L);if(!V){z=!1;break}let O=p1(V.attrs,"v-else-if"),F=y9(V.attrs,"v-else");if(O!==null){let w=a0(Z,V),R=B1(V.attrs,"v-else-if"),D=j1(Z.slice(w.outerStart,w.outerEnd),{...V,start:0,end:V.end-V.start},R);Q.push({type:"else-if",expr:O,outerStart:W,outerEnd:w.outerEnd,element:D,parsedTag:V}),W=w.outerEnd}else if(F){let w=a0(Z,V),R=B1(V.attrs,"v-else"),D=j1(Z.slice(w.outerStart,w.outerEnd),{...V,start:0,end:V.end-V.start},R);Q.push({type:"else",outerStart:W,outerEnd:w.outerEnd,element:D,parsedTag:V}),z=!1}else z=!1}let K=[];for(let _ of Q)if(_.type==="if")K.push(`@if(${_.expr})
3401
3390
  ${_.element}`);else if(_.type==="else-if")K.push(`@elseif(${_.expr})
3402
3391
  ${_.element}`);else K.push(`@else
3403
3392
  ${_.element}`);K.push("@endif");let H=K.join(`
3404
- `),B=Q[0].outerStart,j=Q[Q.length-1].outerEnd;Z=Z.slice(0,B)+H+Z.slice(j),X=B+H.length}return Z}function xY($){return $.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function gY($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=J.attrs,Q=!1,G=/v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/,q=Y.match(G);while(q){Q=!0;let z=q[1],K=q[2],H=q[3];Y=Y.replace(q[0],""),Y+=` :${z}="${H}" @update:${z}="${H} = $event"`,q=Y.match(G)}if(Q){let z=o0(Z,J),K=Z.slice(z.outerStart,z.outerEnd),H=B1(K,{...J,start:0,end:J.end-J.start},Y);Z=Z.slice(0,z.outerStart)+H+Z.slice(z.outerEnd),X=z.outerStart+H.length;continue}let U=o1(J.attrs,"v-model");if(U===null){X=J.end;continue}if(SY.has(J.tag)){let z=J.attrs.replace(/\s*v-model="[^"]*"/g,"")+` @model="${U}"`,K=o0(Z,J),H=Z.slice(K.outerStart,K.outerEnd),B=B1(H,{...J,start:0,end:J.end-J.start},z);Z=Z.slice(0,K.outerStart)+B+Z.slice(K.outerEnd),X=K.outerStart+B.length}else{let z=J.attrs.replace(/\s*v-model="[^"]*"/g,"");z+=` :modelValue="${U}" @update:modelValue="${U} = $event"`;let K=o0(Z,J),H=Z.slice(K.outerStart,K.outerEnd),B=B1(H,{...J,start:0,end:J.end-J.start},z);Z=Z.slice(0,K.outerStart)+B+Z.slice(K.outerEnd),X=K.outerStart+B.length}}return Z}function hY($){return $.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function uY($){return $.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function dY($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=o1(J.attrs,"v-html");if(Y===null){X=J.end;continue}if(J.selfClosing){X=J.end;continue}let Q=o0(Z,J),G=H1(J.attrs,"v-html"),q=J.selfClosing?" /":"",U=`<${J.tag}${G}${q}>{!! ${Y} !!}</${J.tag}>`;Z=Z.slice(0,Q.outerStart)+U+Z.slice(Q.outerEnd),X=Q.outerStart+U.length}return Z}function mY($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;let Y=o1(J.attrs,"v-text");if(Y===null){X=J.end;continue}if(J.selfClosing){X=J.end;continue}let Q=o0(Z,J),G=H1(J.attrs,"v-text"),q=J.selfClosing?" /":"",U=`<${J.tag}${G}${q}>{{ ${Y} }}</${J.tag}>`;Z=Z.slice(0,Q.outerStart)+U+Z.slice(Q.outerEnd),X=Q.outerStart+U.length}return Z}function lY($){return $.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function cY($){let Z=$,X=0;while(X<Z.length){let J=k1(Z,X);if(!J)break;if(!T9(J.attrs,"v-once")){X=J.end;continue}let Y=H1(J.attrs,"v-once"),Q=o0(Z,J),G=Z.slice(Q.outerStart,Q.outerEnd),U=`@once
3405
- ${B1(G,{...J,start:0,end:J.end-J.start},Y)}
3406
- @endonce`;Z=Z.slice(0,Q.outerStart)+U+Z.slice(Q.outerEnd),X=Q.outerStart+U.length}return Z}function pY($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function iY($){return $.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function I9($){if(!PY($))return $;let Z=$;return Z=vY(Z),Z=fY(Z),Z=cY(Z),Z=hY(Z),Z=uY(Z),Z=gY(Z),Z=xY(Z),Z=iY(Z),Z=dY(Z),Z=mY(Z),Z=lY(Z),Z=pY(Z),Z}function j$($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var i3=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),nY=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function k9($,Z){let X=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),J=X?X[1]:$,Y=t(J,Z);if(Y&&typeof Y==="string")return Y;let Q=J.trim();return i3.has(Q)?Q:null}function E9($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function b9($,Z,X){let J=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Y=J?`<${$} ${J}>`:`<${$}>`;if(nY.has($))return J?`<${$} ${J}>`:`<${$}>`;return`${Y}${X}</${$}>`}async function y9($,Z,X,J,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,q=[],U;while((U=G.exec(Q))!==null)q.push({full:U[0],expr:U[1],attrs:U[2],slotContent:U[3],index:U.index});for(let W=q.length-1;W>=0;W--){let z=q[W];try{let K=k9(z.expr,Z);if(!K||typeof K!=="string"){let O=`<!-- dynamic component: could not resolve "${j$(E9(z.expr))}" -->`;Q=Q.slice(0,z.index)+O+Q.slice(z.index+z.full.length);continue}if(i3.has(K)){let O=b9(K,z.attrs,z.slotContent);Q=Q.slice(0,z.index)+O+Q.slice(z.index+z.full.length);continue}let H=z.attrs.trim(),B={},j=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,_;while((_=j.exec(H))!==null){let O=_[1]||_[2],L=_[3];if(_[1])try{B[O]=t(L,Z)}catch{B[O]=L}else B[O]=L}let F=J.componentsDir||"components",V=await E1(K,B,z.slotContent,F,Z,X,J,new Set,Y??new Set);Q=Q.slice(0,z.index)+V+Q.slice(z.index+z.full.length)}catch(K){let H=K instanceof Error?K.message:String(K),B=`<!-- dynamic component error: ${j$(H)} -->`;Q=Q.slice(0,z.index)+B+Q.slice(z.index+z.full.length)}}return Q=await sY(Q,Z,X,J,Y),Q}async function sY($,Z,X,J,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,q=[],U;while((U=G.exec(Q))!==null)q.push({full:U[0],expr:U[1],attrs:U[2],index:U.index});for(let W=q.length-1;W>=0;W--){let z=q[W];try{let K=k9(z.expr,Z);if(!K||typeof K!=="string"){let j=`<!-- dynamic component: could not resolve "${j$(E9(z.expr))}" -->`;Q=Q.slice(0,z.index)+j+Q.slice(z.index+z.full.length);continue}if(i3.has(K)){let j=b9(K,z.attrs,"");Q=Q.slice(0,z.index)+j+Q.slice(z.index+z.full.length);continue}let H=J.componentsDir||"components",B=await E1(K,{},"",H,Z,X,J,new Set,Y??new Set);Q=Q.slice(0,z.index)+B+Q.slice(z.index+z.full.length)}catch(K){let H=K instanceof Error?K.message:String(K),B=`<!-- dynamic component error: ${j$(H)} -->`;Q=Q.slice(0,z.index)+B+Q.slice(z.index+z.full.length)}}return Q}function S9($,Z=""){let X=`${$}${Z}`,J=0;for(let Y=0;Y<X.length;Y++){let Q=X.charCodeAt(Y);J=(J<<5)-J+Q,J=J&J}return`stx-${Math.abs(J).toString(36)}`}function C9($,Z,X={}){let{prefix:J="",preserveHost:Y=!0,scopeKeyframes:Q=!0,scopeCustomProperties:G=!1}=X;if(!$.trim())return"";let q=n3($),U=[],W=new Map;if(Q)for(let z of q){let K=z.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(K){let H=K[1],B=`${Z}_${H}`;W.set(H,B)}}for(let z of q){let K=P9(z,Z,J,Y,W,G);U.push(K)}return U.join(`
3393
+ `),B=Q[0].outerStart,j=Q[Q.length-1].outerEnd;Z=Z.slice(0,B)+H+Z.slice(j),X=B+H.length}return Z}function rY($){return $.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function aY($){let Z=$,X=0;while(X<Z.length){let J=M1(Z,X);if(!J)break;let Y=J.attrs,Q=!1,G=/v-model:([a-zA-Z_][a-zA-Z0-9_]*)(?:\.([a-zA-Z.]+))?\s*=\s*"([^"]*)"/,q=Y.match(G);while(q){Q=!0;let z=q[1],K=q[2],H=q[3];Y=Y.replace(q[0],""),Y+=` :${z}="${H}" @update:${z}="${H} = $event"`,q=Y.match(G)}if(Q){let z=a0(Z,J),K=Z.slice(z.outerStart,z.outerEnd),H=j1(K,{...J,start:0,end:J.end-J.start},Y);Z=Z.slice(0,z.outerStart)+H+Z.slice(z.outerEnd),X=z.outerStart+H.length;continue}let U=p1(J.attrs,"v-model");if(U===null){X=J.end;continue}if(pY.has(J.tag)){let z=J.attrs.replace(/\s*v-model="[^"]*"/g,"")+` @model="${U}"`,K=a0(Z,J),H=Z.slice(K.outerStart,K.outerEnd),B=j1(H,{...J,start:0,end:J.end-J.start},z);Z=Z.slice(0,K.outerStart)+B+Z.slice(K.outerEnd),X=K.outerStart+B.length}else{let z=J.attrs.replace(/\s*v-model="[^"]*"/g,"");z+=` :modelValue="${U}" @update:modelValue="${U} = $event"`;let K=a0(Z,J),H=Z.slice(K.outerStart,K.outerEnd),B=j1(H,{...J,start:0,end:J.end-J.start},z);Z=Z.slice(0,K.outerStart)+B+Z.slice(K.outerEnd),X=K.outerStart+B.length}}return Z}function tY($){return $.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function eY($){return $.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function $Q($){let Z=$,X=0;while(X<Z.length){let J=M1(Z,X);if(!J)break;let Y=p1(J.attrs,"v-html");if(Y===null){X=J.end;continue}if(J.selfClosing){X=J.end;continue}let Q=a0(Z,J),G=B1(J.attrs,"v-html"),q=J.selfClosing?" /":"",U=`<${J.tag}${G}${q}>{!! ${Y} !!}</${J.tag}>`;Z=Z.slice(0,Q.outerStart)+U+Z.slice(Q.outerEnd),X=Q.outerStart+U.length}return Z}function ZQ($){let Z=$,X=0;while(X<Z.length){let J=M1(Z,X);if(!J)break;let Y=p1(J.attrs,"v-text");if(Y===null){X=J.end;continue}if(J.selfClosing){X=J.end;continue}let Q=a0(Z,J),G=B1(J.attrs,"v-text"),q=J.selfClosing?" /":"",U=`<${J.tag}${G}${q}>{{ ${Y} }}</${J.tag}>`;Z=Z.slice(0,Q.outerStart)+U+Z.slice(Q.outerEnd),X=Q.outerStart+U.length}return Z}function XQ($){return $.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function JQ($){let Z=$,X=0;while(X<Z.length){let J=M1(Z,X);if(!J)break;if(!y9(J.attrs,"v-once")){X=J.end;continue}let Y=B1(J.attrs,"v-once"),Q=a0(Z,J),G=Z.slice(Q.outerStart,Q.outerEnd),U=`@once
3394
+ ${j1(G,{...J,start:0,end:J.end-J.start},Y)}
3395
+ @endonce`;Z=Z.slice(0,Q.outerStart)+U+Z.slice(Q.outerEnd),X=Q.outerStart+U.length}return Z}function YQ($){return $.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function QQ($){return $.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function S9($){if(!nY($))return $;let Z=$;return Z=sY(Z),Z=oY(Z),Z=JQ(Z),Z=tY(Z),Z=eY(Z),Z=aY(Z),Z=rY(Z),Z=QQ(Z),Z=$Q(Z),Z=ZQ(Z),Z=XQ(Z),Z=YQ(Z),Z}function O$($){return $.replace(/--/g,"- -").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var a3=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),GQ=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function C9($,Z){let X=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($),J=X?X[1]:$,Y=e(J,Z);if(Y&&typeof Y==="string")return Y;let Q=J.trim();return a3.has(Q)?Q:null}function P9($){let Z=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec($);return Z?Z[1]:$}function v9($,Z,X){let J=Z.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),Y=J?`<${$} ${J}>`:`<${$}>`;if(GQ.has($))return J?`<${$} ${J}>`:`<${$}>`;return`${Y}${X}</${$}>`}async function f9($,Z,X,J,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,q=[],U;while((U=G.exec(Q))!==null)q.push({full:U[0],expr:U[1],attrs:U[2],slotContent:U[3],index:U.index});for(let W=q.length-1;W>=0;W--){let z=q[W];try{let K=C9(z.expr,Z);if(!K||typeof K!=="string"){let O=`<!-- dynamic component: could not resolve "${O$(P9(z.expr))}" -->`;Q=Q.slice(0,z.index)+O+Q.slice(z.index+z.full.length);continue}if(a3.has(K)){let O=v9(K,z.attrs,z.slotContent);Q=Q.slice(0,z.index)+O+Q.slice(z.index+z.full.length);continue}let H=z.attrs.trim(),B={},j=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,_;while((_=j.exec(H))!==null){let O=_[1]||_[2],F=_[3];if(_[1])try{B[O]=e(F,Z)}catch{B[O]=F}else B[O]=F}let L=J.componentsDir||"components",V=await I1(K,B,z.slotContent,L,Z,X,J,new Set,Y??new Set);Q=Q.slice(0,z.index)+V+Q.slice(z.index+z.full.length)}catch(K){let H=K instanceof Error?K.message:String(K),B=`<!-- dynamic component error: ${O$(H)} -->`;Q=Q.slice(0,z.index)+B+Q.slice(z.index+z.full.length)}}return Q=await qQ(Q,Z,X,J,Y),Q}async function qQ($,Z,X,J,Y){let Q=$,G=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,q=[],U;while((U=G.exec(Q))!==null)q.push({full:U[0],expr:U[1],attrs:U[2],index:U.index});for(let W=q.length-1;W>=0;W--){let z=q[W];try{let K=C9(z.expr,Z);if(!K||typeof K!=="string"){let j=`<!-- dynamic component: could not resolve "${O$(P9(z.expr))}" -->`;Q=Q.slice(0,z.index)+j+Q.slice(z.index+z.full.length);continue}if(a3.has(K)){let j=v9(K,z.attrs,"");Q=Q.slice(0,z.index)+j+Q.slice(z.index+z.full.length);continue}let H=J.componentsDir||"components",B=await I1(K,{},"",H,Z,X,J,new Set,Y??new Set);Q=Q.slice(0,z.index)+B+Q.slice(z.index+z.full.length)}catch(K){let H=K instanceof Error?K.message:String(K),B=`<!-- dynamic component error: ${O$(H)} -->`;Q=Q.slice(0,z.index)+B+Q.slice(z.index+z.full.length)}}return Q}function x9($,Z=""){let X=`${$}${Z}`,J=0;for(let Y=0;Y<X.length;Y++){let Q=X.charCodeAt(Y);J=(J<<5)-J+Q,J=J&J}return`stx-${Math.abs(J).toString(36)}`}function g9($,Z,X={}){let{prefix:J="",preserveHost:Y=!0,scopeKeyframes:Q=!0,scopeCustomProperties:G=!1}=X;if(!$.trim())return"";let q=t3($),U=[],W=new Map;if(Q)for(let z of q){let K=z.selector.match(/@keyframes\s+([a-z_-][a-z0-9_-]*)/i);if(K){let H=K[1],B=`${Z}_${H}`;W.set(H,B)}}for(let z of q){let K=h9(z,Z,J,Y,W,G);U.push(K)}return U.join(`
3407
3396
 
3408
- `)}function n3($){let Z=[],X=$.replace(/\/\*[\s\S]*?\*\//g,""),J=0,Y="",Q=!1,G="";for(let q=0;q<X.length;q++){let U=X[q];if(U==="@"&&J===0)Q=!0;if(U==="{")J++;else if(U==="}"){if(J--,J===0){if(Q){G+=U;let W=G.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(W){let[,z,K,H]=W;if(z==="keyframes")Z.push({selector:`@keyframes ${K.trim()}`,declarations:H.trim()});else if(z==="media"||z==="supports"||z==="container"){let B=n3(H);Z.push({selector:`@${z} ${K.trim()}`,declarations:B.map((j)=>`${j.selector} { ${j.declarations} }`).join(`
3409
- `)})}else Z.push({selector:`@${z} ${K.trim()}`,declarations:H.trim()})}G="",Q=!1}else if(Y.trim()){Y+=U;let W=Y.match(/([^{]+)\{([^}]*)\}/);if(W)Z.push({selector:W[1].trim(),declarations:W[2].trim()});Y=""}continue}}if(Q)G+=U;else Y+=U}return Z}function P9($,Z,X,J,Y,Q){let{selector:G,declarations:q}=$;if(G.startsWith("@")){if(G.startsWith("@keyframes")){let z=G.replace("@keyframes ","").trim();return`@keyframes ${Y.get(z)||z} { ${q} }`}if(G.startsWith("@media")||G.startsWith("@supports")||G.startsWith("@container")){let K=n3(`x { ${q} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((H)=>P9(H,Z,X,J,Y,Q)).join(`
3397
+ `)}function t3($){let Z=[],X=$.replace(/\/\*[\s\S]*?\*\//g,""),J=0,Y="",Q=!1,G="";for(let q=0;q<X.length;q++){let U=X[q];if(U==="@"&&J===0)Q=!0;if(U==="{")J++;else if(U==="}"){if(J--,J===0){if(Q){G+=U;let W=G.match(/@([a-z-]+)\s*([^{]*)\{([\s\S]*)\}/i);if(W){let[,z,K,H]=W;if(z==="keyframes")Z.push({selector:`@keyframes ${K.trim()}`,declarations:H.trim()});else if(z==="media"||z==="supports"||z==="container"){let B=t3(H);Z.push({selector:`@${z} ${K.trim()}`,declarations:B.map((j)=>`${j.selector} { ${j.declarations} }`).join(`
3398
+ `)})}else Z.push({selector:`@${z} ${K.trim()}`,declarations:H.trim()})}G="",Q=!1}else if(Y.trim()){Y+=U;let W=Y.match(/([^{]+)\{([^}]*)\}/);if(W)Z.push({selector:W[1].trim(),declarations:W[2].trim()});Y=""}continue}}if(Q)G+=U;else Y+=U}return Z}function h9($,Z,X,J,Y,Q){let{selector:G,declarations:q}=$;if(G.startsWith("@")){if(G.startsWith("@keyframes")){let z=G.replace("@keyframes ","").trim();return`@keyframes ${Y.get(z)||z} { ${q} }`}if(G.startsWith("@media")||G.startsWith("@supports")||G.startsWith("@container")){let K=t3(`x { ${q} }`.replace(/x \{ /,"").replace(/ \}$/,"")).map((H)=>h9(H,Z,X,J,Y,Q)).join(`
3410
3399
  `);return`${G} {
3411
3400
  ${K}
3412
- }`}return`${G} { ${q} }`}let U=oY(G,Z,X,J),W=q;for(let[z,K]of Y)W=W.replace(new RegExp(`\\b${z}\\b`,"g"),K);if(Q)W=W.replace(/--([a-z-]+)/gi,`--${Z}-$1`);return`${U} { ${W} }`}function oY($,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 W=G.replace(/:host(\([^)]*\))?/,`.${Z}$1`);Q.push(W)}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 U=rY(G,Z);if(U)Q.push(X?`${X} ${U}`:U)}return Q.join(", ")}function rY($,Z){let X=0,J=$.length;for(let U=0;U<$.length;U++){let W=$[U];if(W==="["||W==="(")X++;else if(W==="]"||W===")")X--;else if(X===0&&(W===" "||W===">"||W==="+"||W==="~")){J=U;break}}let Y=$.slice(0,J),Q=$.slice(J);if(!Y)return"";let G=Y.length,q=0;for(let U=0;U<Y.length;U++){let W=Y[U];if(W==="["||W==="(")q++;else if(W==="]"||W===")")q--;else if(X===0&&q===0&&W===":"){G=U;break}}return`${Y.slice(0,G)}.${Z}${Y.slice(G)}${Q}`}var s3=String.raw`(?<![\w-])scoped(?![\w-])`,aY=new RegExp(`<style\\s+[^>]*${s3}`,"i");function f9($){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 _$($,Z){if(!aY.test($))return{html:$,hasScoped:!1};let X=S9(Z),J=`data-v-${X}`,Y=$,Q=new RegExp(`<style\\s+([^>]*${s3}[^>]*)>([\\s\\S]*?)</style>`,"gi"),G=!1;if(Y=Y.replace(Q,(q,U,W)=>{G=!0;let z=tY(W,J),K=U.replace(new RegExp(s3,"gi"),"").trim(),H=K?` ${K}`:"";return`<style data-stx-scoped="${X}"${H}>${z}</style>`}),!G)return{html:$,hasScoped:!1};return Y=$Q(Y,J),{html:Y,hasScoped:!0}}function tY($,Z){return C9($,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${Z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${Z}]`)}var eY=($)=>`\x00stx-scope-mask-${$}\x00`,v9=/\u0000stx-scope-mask-(\d+)\u0000/g;function $Q($,Z){let X=n0($,(Y,Q)=>{let G=Y1(Y,Q);return G>Q?G:f1(Y,Q)},(Y,Q)=>eY(Q)),J=ZQ(X.output,Z);return v9.lastIndex=0,J.replace(v9,(Y,Q)=>X.tokens[Number(Q)])}function ZQ($,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 bH="data-stx-color-mode-boot",yH="__STX_COLOR_MODE__",XQ=new Set(["light","dark","auto","system"]),JQ=new Set(["auto","system"]),YQ=/^[a-z][\w:-]*$/i,QQ=/^[\w-]+$/;function GQ($){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(!XQ.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"||!QQ.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"||!YQ.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!JQ.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 qQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function r3($={}){let Z=GQ($);return`<script data-stx-color-mode-boot>${`(function(){"use strict";var c=${qQ(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 x9($,Z={}){if($.includes("data-stx-color-mode-boot"))return $;let X=o3($);if(X===null)return $;let J=r3(Z);return`${$.slice(0,X)}
3413
- ${J}${$.slice(X)}`}function o3($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let X=Z.index+Z[0].length,J=/^\s*<meta\b[^>]*\bcharset\b[^>]*>/i.exec($.slice(X));if(J)X+=J[0].length;return X}var UQ=new RegExp("<script\\b[^>]*\\bdata-stx-color-mode-boot\\b[^>]*>[\\s\\S]*?<\\/script>","i"),WQ=/<meta\b[^>]*\bcharset\b[^>]*>/i;function zQ($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let X=Z.index+Z[0].length,J=$.toLowerCase().indexOf("</head>",X),Y=$.slice(X,J===-1?$.length:J),Q=WQ.exec(Y);if(!Q||Y.slice(0,Q.index).trim()==="")return $;let G=Y.slice(0,Q.index)+Y.slice(Q.index+Q[0].length);return $.slice(0,X)+`
3414
- ${Q[0]}`+G+$.slice(X+Y.length)}function g9($){return KQ(zQ($))}function KQ($){let Z=UQ.exec($);if(!Z)return $;let X=o3($);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=o3(J);if(Y===null)return $;return`${J.slice(0,Y)}
3415
- ${Z[0]}${J.slice(Y)}`}var CH="stx-build",PH="X-STX-Build",V$=null;function HQ(){if(V$===null)V$=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return V$}function vH($){V$=$}function h9($,Z=HQ()){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)}
3416
- <meta name="stx-build" content="${Z}">${$.slice(J)}`}var u9="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",O$="data-stx-html-attrs",F$="data-stx-html-class",d9=/^[A-Za-z_:][\w:.-]*$/;function X1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function BQ($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function a1($){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 r1($,Z){return Object.entries($).filter(([X])=>!Z?.(X)).map(([X,J])=>`${X}="${X1(String(J))}"`).join(" ")}function jQ($={},Z="en"){let X=[],J=[],Y="",Q=Z;for(let[q,U]of Object.entries($||{})){if(U==null)continue;let W=q.trim();if(!d9.test(W))continue;let z=W.toLowerCase();if(z==="lang"){Q=String(U);continue}if(z==="class"){Y=String(U).trim();continue}X.push(` ${W}="${X1(String(U))}"`),J.push(W)}let G=` lang="${X1(Q)}"`;if(Y)G+=` class="${X1(Y)}"`;if(G+=X.join(""),Y)G+=` ${F$}="${X1(Y)}"`;if(J.length)G+=` ${O$}="${X1(J.join(" "))}"`;return G}function m9($={},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 l9($,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 z=G[1];if(!(z in J))Y.push(z);J[z]=G[2]??G[3]??G[4]??""}let q=[],U=[];for(let[z,K]of Object.entries(Z)){if(K==null)continue;let H=z.trim();if(!d9.test(H))continue;let B=H.toLowerCase();if(B==="class"){let j=(J.class||"").split(/\s+/).filter(Boolean);for(let _ of String(K).split(/\s+/).filter(Boolean))if(!j.includes(_))j.push(_),q.push(_);if(!("class"in J))Y.push("class");J.class=j.join(" ");continue}if(!(H in J))Y.push(H);if(J[H]=String(K),B!=="lang")U.push(H)}if(q.length){if(!(F$ in J))Y.push(F$);J[F$]=q.join(" ")}if(U.length){if(!(O$ in J))Y.push(O$);J[O$]=U.join(" ")}let W=Y.map((z)=>` ${z}="${X1(J[z])}"`).join("");return $.replace(X[0],()=>`<html${W}>`)}function c9($){if($.includes("data-stx-cloak"))return $;let Z=$.lastIndexOf("</head>");if(Z===-1)return $;return`${$.slice(0,Z)}${u9}
3417
- ${$.slice(Z)}`}function _Q($){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 K=$.indexOf("-->",X);if(K===-1)break;X=K+3;continue}let q=Q.match(/^<script\b[^>]*>/i);if(q){let K=$.toLowerCase().indexOf("</script>",X+q[0].length);if(K===-1)break;X=K+9;continue}let U=Q.match(/^<link\b[^>]*>/i);if(U){Z.push(U[0]),X+=U[0].length;continue}let W=Q.match(/^<meta\b[^>]*>/i);if(W){Z.push(W[0]),X+=W[0].length;continue}let z=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(z){Z.push(z[0]),X+=z[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 U=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(U&&Z.includes(U[0])){Y+=U[0].length;continue}J+=$[Y],Y++}return J+=$.slice(X),{body:J,hoisted:Z}}function VQ($,Z={},X={}){let{title:J="stx App",lang:Y="en",meta:Q=[],link:G=[],script:q=[],headRaw:U="",htmlAttrs:W={},bodyClass:z="",bodyAttrs:K={}}=Z,H=X.title||J,B=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],j=new Set(Q.map(a1).filter(Boolean)),F=[...B.filter((M)=>!j.has(a1(M))),...Q].map((M)=>{return` <meta ${r1(M)}>`}).join(`
3418
- `),V=G.map((M)=>{return` <link ${r1(M)}>`}).join(`
3419
- `),O=q.map((M)=>{if(M.src)return` <script ${r1(M,(k)=>k==="content")}></script>`;if(M.content)return` <script>${M.content}</script>`;return""}).filter(Boolean).join(`
3420
- `),L=jQ(W,Y),w=Object.entries(K).map(([M,k])=>` ${M}="${X1(String(k))}"`).join(""),R=z?` class="${X1(z)}"`:"",{body:D,hoisted:N}=_Q($),T=[F,X.colorMode?` ${r3(X.colorMode)}`:"",` <title>${X.titleIsHtml?H:BQ(H)}</title>`,` ${u9}`,V,O,U?` ${U}`:"",...(X.styles||[]).map((M)=>` ${M}`),...N.map((M)=>` ${M}`),...(X.headScripts||[]).map((M)=>` ${M}`),X.headStack||""].filter(Boolean),A=[D,...(X.bodyScripts||[]).map((M)=>M),X.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3421
- <html${L}>
3401
+ }`}return`${G} { ${q} }`}let U=UQ(G,Z,X,J),W=q;for(let[z,K]of Y)W=W.replace(new RegExp(`\\b${z}\\b`,"g"),K);if(Q)W=W.replace(/--([a-z-]+)/gi,`--${Z}-$1`);return`${U} { ${W} }`}function UQ($,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 W=G.replace(/:host(\([^)]*\))?/,`.${Z}$1`);Q.push(W)}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 U=WQ(G,Z);if(U)Q.push(X?`${X} ${U}`:U)}return Q.join(", ")}function WQ($,Z){let X=0,J=$.length;for(let U=0;U<$.length;U++){let W=$[U];if(W==="["||W==="(")X++;else if(W==="]"||W===")")X--;else if(X===0&&(W===" "||W===">"||W==="+"||W==="~")){J=U;break}}let Y=$.slice(0,J),Q=$.slice(J);if(!Y)return"";let G=Y.length,q=0;for(let U=0;U<Y.length;U++){let W=Y[U];if(W==="["||W==="(")q++;else if(W==="]"||W===")")q--;else if(X===0&&q===0&&W===":"){G=U;break}}return`${Y.slice(0,G)}.${Z}${Y.slice(G)}${Q}`}var m9=String.raw`(?<![\w-])scoped(?![\w-])`,e3=/<style\s+([^>]*)>/gi,u9=/<style\s+([^>]*)>([\s\S]*?)<\/style>/gi,l9=new RegExp(m9,"i"),zQ=new RegExp(m9,"gi");function KQ($){e3.lastIndex=0;let Z=e3.exec($);while(Z!==null){if(l9.test(Z[1]))return!0;Z=e3.exec($)}return!1}function c9($){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 F$($,Z){if(!KQ($))return{html:$,hasScoped:!1};let X=x9(Z),J=`data-v-${X}`,Y=$,Q=!1;if(u9.lastIndex=0,Y=Y.replace(u9,(G,q,U)=>{if(!l9.test(q))return G;Q=!0;let W=HQ(U,J),z=q.replace(zQ,"").trim(),K=z?` ${z}`:"";return`<style data-stx-scoped="${X}"${K}>${W}</style>`}),!Q)return{html:$,hasScoped:!1};return Y=jQ(Y,J),{html:Y,hasScoped:!0}}function HQ($,Z){return g9($,"__SCOPE_PLACEHOLDER__",{preserveHost:!1}).replace(/\.(__SCOPE_PLACEHOLDER__) /g,`[${Z}] `).replace(/\.(__SCOPE_PLACEHOLDER__)/g,`[${Z}]`)}var BQ=($)=>`\x00stx-scope-mask-${$}\x00`,d9=/\u0000stx-scope-mask-(\d+)\u0000/g;function jQ($,Z){let X=o0($,(Y,Q)=>{let G=Q1(Y,Q);return G>Q?G:S1(Y,Q)},(Y,Q)=>BQ(Q)),J=_Q(X.output,Z);return d9.lastIndex=0,J.replace(d9,(Y,Q)=>X.tokens[Number(Q)])}function _Q($,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 cH="data-stx-color-mode-boot",pH="__STX_COLOR_MODE__",VQ=new Set(["light","dark","auto","system"]),OQ=new Set(["auto","system"]),FQ=/^[a-z][\w:-]*$/i,LQ=/^[\w-]+$/;function wQ($){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(!VQ.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"||!LQ.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"||!FQ.test(Y)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(Y)}`);if(Q!==null&&!OQ.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 RQ($){return JSON.stringify($).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Z4($={}){let Z=wQ($);return`<script data-stx-color-mode-boot>${`(function(){"use strict";var c=${RQ(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 n9($,Z={}){if($.includes("data-stx-color-mode-boot"))return $;let X=$4($);if(X===null)return $;let J=Z4(Z);return`${$.slice(0,X)}
3402
+ ${J}${$.slice(X)}`}function $4($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return null;let X=Z.index+Z[0].length;p9.lastIndex=X;let J=p9.exec($);if(J)X+=J[0].length;return X}var DQ=new RegExp("<script\\b[^>]*\\bdata-stx-color-mode-boot\\b[^>]*>[\\s\\S]*?<\\/script>","i"),NQ=/<meta\b[^>]*\bcharset\b[^>]*>/i,p9=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy,i9=/<\/head>/gi;function AQ($){let Z=/<head\b[^>]*>/i.exec($);if(!Z)return $;let X=Z.index+Z[0].length;i9.lastIndex=X;let J=i9.exec($),Y=J?J.index:-1,Q=$.slice(X,Y===-1?$.length:Y),G=NQ.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
+ ${G[0]}`+q+$.slice(X+Q.length)}function s9($){return MQ(AQ($))}function MQ($){let Z=DQ.exec($);if(!Z)return $;let X=$4($);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=$4(J);if(Y===null)return $;return`${J.slice(0,Y)}
3404
+ ${Z[0]}${J.slice(Y)}`}var nH="stx-build",sH="X-STX-Build",L$=null;function IQ(){if(L$===null)L$=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return L$}function oH($){L$=$}function o9($,Z=IQ()){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
+ <meta name="stx-build" content="${Z}">${$.slice(J)}`}var r9="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",w$="data-stx-html-attrs",R$="data-stx-html-class",a9=/^[A-Za-z_:][\w:.-]*$/;function Y1($){return String($).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kQ($){return String($).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function n1($){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 i1($,Z){return Object.entries($).filter(([X])=>!Z?.(X)).map(([X,J])=>`${X}="${Y1(String(J))}"`).join(" ")}function TQ($={},Z="en"){let X=[],J=[],Y="",Q=Z;for(let[q,U]of Object.entries($||{})){if(U==null)continue;let W=q.trim();if(!a9.test(W))continue;let z=W.toLowerCase();if(z==="lang"){Q=String(U);continue}if(z==="class"){Y=String(U).trim();continue}X.push(` ${W}="${Y1(String(U))}"`),J.push(W)}let G=` lang="${Y1(Q)}"`;if(Y)G+=` class="${Y1(Y)}"`;if(G+=X.join(""),Y)G+=` ${R$}="${Y1(Y)}"`;if(J.length)G+=` ${w$}="${Y1(J.join(" "))}"`;return G}function t9($={},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 e9($,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 z=G[1];if(!(z in J))Y.push(z);J[z]=G[2]??G[3]??G[4]??""}let q=[],U=[];for(let[z,K]of Object.entries(Z)){if(K==null)continue;let H=z.trim();if(!a9.test(H))continue;let B=H.toLowerCase();if(B==="class"){let j=(J.class||"").split(/\s+/).filter(Boolean);for(let _ of String(K).split(/\s+/).filter(Boolean))if(!j.includes(_))j.push(_),q.push(_);if(!("class"in J))Y.push("class");J.class=j.join(" ");continue}if(!(H in J))Y.push(H);if(J[H]=String(K),B!=="lang")U.push(H)}if(q.length){if(!(R$ in J))Y.push(R$);J[R$]=q.join(" ")}if(U.length){if(!(w$ in J))Y.push(w$);J[w$]=U.join(" ")}let W=Y.map((z)=>` ${z}="${Y1(J[z])}"`).join("");return $.replace(X[0],()=>`<html${W}>`)}function $8($){if($.includes("data-stx-cloak"))return $;let Z=$.lastIndexOf("</head>");if(Z===-1)return $;return`${$.slice(0,Z)}${r9}
3406
+ ${$.slice(Z)}`}function EQ($){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 K=$.indexOf("-->",X);if(K===-1)break;X=K+3;continue}let q=Q.match(/^<script\b[^>]*>/i);if(q){let K=$.toLowerCase().indexOf("</script>",X+q[0].length);if(K===-1)break;X=K+9;continue}let U=Q.match(/^<link\b[^>]*>/i);if(U){Z.push(U[0]),X+=U[0].length;continue}let W=Q.match(/^<meta\b[^>]*>/i);if(W){Z.push(W[0]),X+=W[0].length;continue}let z=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(z){Z.push(z[0]),X+=z[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 U=Q.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(U&&Z.includes(U[0])){Y+=U[0].length;continue}J+=$[Y],Y++}return J+=$.slice(X),{body:J,hoisted:Z}}function bQ($,Z={},X={}){let{title:J="stx App",lang:Y="en",meta:Q=[],link:G=[],script:q=[],headRaw:U="",htmlAttrs:W={},bodyClass:z="",bodyAttrs:K={}}=Z,H=X.title||J,B=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],j=new Set(Q.map(n1).filter(Boolean)),L=[...B.filter((M)=>!j.has(n1(M))),...Q].map((M)=>{return` <meta ${i1(M)}>`}).join(`
3407
+ `),V=G.map((M)=>{return` <link ${i1(M)}>`}).join(`
3408
+ `),O=q.map((M)=>{if(M.src)return` <script ${i1(M,(T)=>T==="content")}></script>`;if(M.content)return` <script>${M.content}</script>`;return""}).filter(Boolean).join(`
3409
+ `),F=TQ(W,Y),w=Object.entries(K).map(([M,T])=>` ${M}="${Y1(String(T))}"`).join(""),R=z?` class="${Y1(z)}"`:"",{body:D,hoisted:N}=EQ($),I=[L,X.colorMode?` ${Z4(X.colorMode)}`:"",` <title>${X.titleIsHtml?H:kQ(H)}</title>`,` ${r9}`,V,O,U?` ${U}`:"",...(X.styles||[]).map((M)=>` ${M}`),...N.map((M)=>` ${M}`),...(X.headScripts||[]).map((M)=>` ${M}`),X.headStack||""].filter(Boolean),A=[D,...(X.bodyScripts||[]).map((M)=>M),X.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
3410
+ <html${F}>
3422
3411
  <head>
3423
- ${T.join(`
3412
+ ${I.join(`
3424
3413
  `)}
3425
3414
  </head>
3426
3415
  <body${R}${w}>
3427
3416
  ${A.join(`
3428
3417
  `)}
3429
3418
  </body>
3430
- </html>`}function a3($){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 t3($){return a3($)}function p9($,Z={}){let X=$.lastIndexOf("</head>");if(X===-1)return $;let{meta:J=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,q=$.slice(0,X),U=[];for(let W of J){let z=a1(W);if(z&&q.includes(z))continue;U.push(` <meta ${r1(W)}>`)}for(let W of Y){if(W.href&&q.includes(`href="${W.href}"`))continue;U.push(` <link ${r1(W)}>`)}for(let W of Q)if(W.src){if(q.includes(`src="${W.src}"`))continue;U.push(` <script ${r1(W,(z)=>z==="content")}></script>`)}else if(W.content){if(q.includes(W.content))continue;U.push(` <script>${W.content}</script>`)}if(G&&!q.includes(G))U.push(` ${G}`);if(U.length===0)return $;return`${$.slice(0,X)}${U.join(`
3419
+ </html>`}function X4($){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 J4($){return X4($)}function Z8($,Z={}){let X=$.lastIndexOf("</head>");if(X===-1)return $;let{meta:J=[],link:Y=[],script:Q=[],headRaw:G=""}=Z,q=$.slice(0,X),U=[];for(let W of J){let z=n1(W);if(z&&q.includes(z))continue;U.push(` <meta ${i1(W)}>`)}for(let W of Y){if(W.href&&q.includes(`href="${W.href}"`))continue;U.push(` <link ${i1(W)}>`)}for(let W of Q)if(W.src){if(q.includes(`src="${W.src}"`))continue;U.push(` <script ${i1(W,(z)=>z==="content")}></script>`)}else if(W.content){if(q.includes(W.content))continue;U.push(` <script>${W.content}</script>`)}if(G&&!q.includes(G))U.push(` ${G}`);if(U.length===0)return $;return`${$.slice(0,X)}${U.join(`
3431
3420
  `)}
3432
- ${$.slice(X)}`}function i9($,Z={},X={}){if(t3($))return $;return VQ($,Z,X)}var OQ=/<\/(script)/gi;function t1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(OQ,"<\\/$1")}var T5=["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"];B5();B5();function s9($,Z={}){return new n9($,Z).routes}function iH($,Z){let X=e3($,Z);return X?X.params:null}var o9=new Map;async function r9($){let Z=$;if(!Z)try{Z=(await O3())?.pagesDir||"pages"}catch{Z="pages"}let X=Z,J=o9.get(X);if(J)return J;let Y=[];try{Y=s9(".",{pagesDir:X}).map((Q)=>Q.regex.source).filter(Boolean)}catch{Y=[]}return o9.set(X,Y),Y}function FQ($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function a9($){return FQ(JSON.stringify($))}function $4(){return`
3421
+ ${$.slice(X)}`}function X8($,Z={},X={}){if(J4($))return $;return bQ($,Z,X)}var yQ=/<\/(script)/gi;function s1($){if(!$||$.indexOf("</")===-1)return $;return $.replace(yQ,"<\\/$1")}var N5=["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"];z5();z5();function Y8($,Z={}){return new J8($,Z).routes}function GB($,Z){let X=Y4($,Z);return X?X.params:null}var Q8=new Map;async function G8($){let Z=$;if(!Z)try{Z=(await D3())?.pagesDir||"pages"}catch{Z="pages"}let X=Z,J=Q8.get(X);if(J)return J;let Y=[];try{Y=Y8(".",{pagesDir:X}).map((Q)=>Q.regex.source).filter(Boolean)}catch{Y=[]}return Q8.set(X,Y),Y}function SQ($){return $.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function q8($){return SQ(JSON.stringify($))}function Q4(){return`
3433
3422
  (function(){
3434
3423
  var tip=null,hideTimer=null,currentEl=null;
3435
3424
 
@@ -3532,48 +3521,48 @@ document.addEventListener("focusout",function(e){
3532
3521
  if(el) hideTip();
3533
3522
  });
3534
3523
  })();
3535
- `}function t9($){return $.includes("data-stx-runtime")}function e9($){let Z=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let X=Z.exec($);X!==null;X=Z.exec($)){let J=$.slice(Math.max(0,X.index-80),X.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(J))continue;return!0}return!1}function Z4($,Z){let X=$.indexOf("<script"),J=$.search(/<!doctype\b/i);if(X!==-1&&(J===-1||X>J))return $.slice(0,X)+Z+`
3524
+ `}function U8($){return $.includes("data-stx-runtime")}function W8($){let Z=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let X=Z.exec($);X!==null;X=Z.exec($)){let J=$.slice(Math.max(0,X.index-80),X.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(J))continue;return!0}return!1}function G4($,Z){let X=$.indexOf("<script"),J=$.search(/<!doctype\b/i);if(X!==-1&&(J===-1||X>J))return $.slice(0,X)+Z+`
3536
3525
  `+$.slice(X);let Y=/<head\b[^>]*>/i.exec($);if(Y){let G=Y.index+Y[0].length;return`${$.slice(0,G)}
3537
3526
  ${Z}${$.slice(G)}`}if($.includes("</head>")){let G=$.indexOf("</head>");return $.slice(0,G)+Z+`
3538
- `+$.slice(G)}if(G1($))return u1($,(G)=>`${G}
3527
+ `+$.slice(G)}if(q1($))return P1($,(G)=>`${G}
3539
3528
  ${Z}`);return`${Z}
3540
- ${$}`}async function L$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return Z4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return Z4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-xezfdh27.js"),J=await X(Z.debug);return Z4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function LQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function $8($){if($.includes("data-stx-tooltip-runtime")||!LQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${$4()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3529
+ ${$}`}async function D$($,Z){if($.includes("data-stx-runtime")||$.includes("window.stx.state")||$.includes("STX Signals Runtime"))return $;if(Z.buildMode==="serve")return G4($,'<script data-stx-runtime src="/_stx/runtime.js"></script>');if(Z.buildMode==="compile")return G4($,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:X}=await import("./chunk-scdxk8nn.js"),J=await X(Z.debug);return G4($,`<script data-stx-scoped data-stx-runtime>${J}</script>`)}function CQ($){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test($)}function z8($){if($.includes("data-stx-tooltip-runtime")||!CQ($))return $;let Z=`<script data-stx-scoped data-stx-tooltip-runtime>${Q4()}</script>`,X=$.lastIndexOf("</body>");if(X===-1)return`${$}
3541
3530
  ${Z}`;return`${$.slice(0,X)}${Z}
3542
- ${$.slice(X)}`}var wQ=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function RQ($){return wQ.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function DQ($,Z){if(!$.includes("</body>"))return $;if(RQ($))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 U=await r9(Z?.pagesDir);if(U.length>0)q.ownedRoutes=U}catch{}if(Object.keys(q).length>0)J=`<script>window.__stxRouterConfig=${a9(q)};</script>
3543
- `}let{getCachedRouterScript:Y}=await import("./chunk-xezfdh27.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+`
3544
- </body>`+$.slice(G+7)}var Z8=Symbol.for("stx.lazy-module-promises");function NQ(){let $=globalThis;return $[Z8]??=new Map,$[Z8]}function o($,Z){let X=NQ(),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 J4=`(?:"[^"]*"|'[^']*'|[^>"'])*`,q8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function AQ($,Z={}){let X=[];for(let J of d5($,Y1)){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,U=J.token.length-Q[0].length;X.push({fullMatch:J.token,attrs:G,body:J.token.slice(q,U),start:J.start,end:J.end})}return X}function U8($){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}=X8(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}=X8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:q}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function X8($){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 Q4($,Z){return G8($,Z)}function MQ($){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 TQ($){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 IQ($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${J4})>`,"iy"),X=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,J=d5($,(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),U=U8(q?.[1]??q?.[2]??""),W=[U.itemVar,U.indexVar].filter(Boolean);if(W.length===0)continue;let z=G[1],H=/\/\s*>$/.test(Q.token)||R$.has(z.toLowerCase())?Q.end:z8($,Q.start,z,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(W)})}return Y}var J8=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 kQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function Y8($,Z,X,J){if(!$)return!1;let Y=kQ($),Q=!1,G=!1,q=!1,U=/([a-zA-Z_$][\w$]*)/g,W;while((W=U.exec(Y))!==null){let B=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(J8.has(B))continue;if(Z.has(B)||J?.has(B))Q=!0;else if(X&&B in X)G=!0}let z=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,K;while((K=z.exec(Y))!==null){let B=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(J8.has(B)||X&&B in X)continue;q=!0}return(Q||q)&&!G}function w$($,Z,X){let J=X===void 0?` ${Z}`:` ${Z}="${X.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(q8);if(Q&&EQ(Q[3],Q[1])){let[,G,q,U]=Q;return`<${G}${q}${J}>${U}</${G}>`}return`<template${J}>${Y}</template>`}function EQ($,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 W8($,Z){let X=TQ($);function J(Y){let Q=Y,G=IQ(Y),q=(K)=>{let H=new Set;for(let B of G)if(K>B.start&&K<B.end)for(let j of B.vars)H.add(j);return H},U=/@if\s*\(/g,W,z=[];while((W=U.exec(Q))!==null){let K=W.index,H=K+W[0].length,B=1,j=H;while(j<Q.length&&B>0){if(Q[j]==="(")B++;else if(Q[j]===")")B--;j++}if(B!==0)continue;let _=Q.substring(H,j-1).trim(),F=j,V=1,O=F,L=/@(if\s*\(|endif)/g;L.lastIndex=F;let w;while((w=L.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(F,O-6).trim(),D;if(MQ(R)){let N=w5(Q.substring(K,O));if(N.length===0)continue;let T=N[0].branches.filter((I)=>I.type!=="else"),A=q(K);if(!(T.length>0&&T.every((I)=>Y8(I.condition,X,Z,A))))continue;D=N[0].branches.map((I)=>{let y=J(I.content);if(I.type==="elseif")return w$(y,"@else-if",I.condition??"");if(I.type==="else")return w$(y,"@else");return w$(y,"@if",I.condition??"")}).join(`
3545
- `)}else{if(!Y8(_,X,Z,q(K)))continue;D=w$(J(R),"@if",_)}z.push({start:K,end:O,replacement:D}),U.lastIndex=O}for(let K=z.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=z[K];Q=Q.substring(0,H)+j+Q.substring(B)}return Q}return J($)}function bQ($){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 R$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function z8($,Z,X,J){if(R$.has(X.toLowerCase()))return J;let Y=X.toLowerCase(),Q=$.toLowerCase(),G=$.length,q=1,U=J;while(U<G){let W=$.indexOf("<",U);if(W===-1)return-1;if(U=W,$.startsWith("<!--",U)){let B=$.indexOf("-->",U+4);if(B===-1)return-1;U=B+3;continue}let z=/^<(script|style)\b/i.exec($.slice(U,U+8));if(z){let B=$.indexOf(">",U);if(B===-1)return-1;if($[B-1]==="/"){U=B+1;continue}let j=Q.indexOf(`</${z[1].toLowerCase()}`,U);if(j===-1)return-1;let _=$.indexOf(">",j);if(_===-1)return-1;U=_+1;continue}if($[U+1]==="/"){let B=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(U,U+64));if(!B){U++;continue}if(B[1].toLowerCase()===Y){if(q--,U+=B[0].length,q===0)return U;continue}U+=B[0].length;continue}let K=/^<([a-z][\w-]*)\b/i.exec($.slice(U,U+64));if(!K){U++;continue}let H=$.indexOf(">",U);if(H===-1)return-1;if(K[1].toLowerCase()===Y){let B=$.slice(U,H+1);if(!(/\/\s*>$/.test(B)||R$.has(Y)))q++}U=H+1}return-1}var yQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function SQ($,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 yQ.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=(K)=>Z.some(([H,B])=>K>=H&&K<B),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[K,H,B,j,_,F,V]=q,O=bQ(_);if(O===void 0)continue;let L=q.index,w=L+K.length,N=!!V||/\/\s*>$/.test(K)||R$.has(H.toLowerCase())?w:z8($,L,H,w);if(N===-1)continue;if((j===":if"||j==="x-if"||j==="@if")&&SQ($,N)){Q.lastIndex=w;continue}if(O===!0){let A=`<${H}${B}${F}${V}>`;G.push({start:L,end:w,replacement:A});continue}G.push({start:L,end:N,replacement:""}),Q.lastIndex=N}if(G.length===0)return $;G.sort((K,H)=>K.start-H.start);let U=[],W=-1;for(let K of G){if(K.start<W)continue;U.push(K),W=K.end}let z=$;for(let K=U.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=U[K];z=z.substring(0,H)+j+z.substring(B)}return z}function H8($,Z){let X=$,J=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=J.exec(X))!==null){let q=Y[1],U=Y.index,W=U+Y[0].length,z=1,K=W;while(K<X.length&&z>0){if(X[K]==="(")z++;else if(X[K]===")")z--;K++}if(z!==0)continue;let H=X.substring(W,K-1).trim(),B=K,j=U8(H),_=q==="for"?"@endfor":"@endforeach",F=1,V=B,O=q==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${q}\\s*\\(|end${q})`,"g");O.lastIndex=B;let L;while((L=O.exec(X))!==null)if(L[1].startsWith(q))F++;else if(F--,F===0){V=L.index+L[0].length;break}if(F!==0)continue;let w=()=>{let T=[j.itemVar,j.indexVar].filter(Boolean);if(T.length)G.push({start:U,end:V,vars:T})};if(j.iterable){let T=j.iterable.trim();if(T.startsWith("[")||T.startsWith("{")||T.startsWith("'")||T.startsWith('"')||T.startsWith("`")||/^-?\d/.test(T)){w();continue}let A=T.split(/[.[(]/)[0].trim(),M=Z?A in Z:!1,k=G.some((I)=>U>I.start&&U<I.end&&I.vars.includes(A));if(A&&(M||k)){w();continue}}if(j.style==="as")H=j.indexVar?`(${j.itemVar}, ${j.indexVar}) in ${j.iterable}`:`${j.itemVar} in ${j.iterable}`;let R=X.substring(B,V-_.length).trim(),D=R.match(q8),N;if(D){let[,T,A,M]=D;N=`<${T}${A} @for="${H}">${M}</${T}>`}else N=`<template @for="${H}">${R}</template>`;Q.push({start:U,end:V,replacement:N})}for(let q=Q.length-1;q>=0;q--){let{start:U,end:W,replacement:z}=Q[q];X=X.substring(0,U)+z+X.substring(W)}return X}function CQ($){let Z=new Set,X=[],J=0,Y=0,Q=$.length,G=(z)=>{let K=J+1;while(K<Q){let H=$[K];if(H==="\\"){K+=2;continue}if(H===z)return K+1;K++}return Q},q=()=>{let z=J+2;while(z<Q&&$[z]!==`
3531
+ ${$.slice(X)}`}var PQ=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function vQ($){return PQ.test($)||$.includes("__stxRouter)return")||$.includes("__stxRouter=true")}async function fQ($,Z){if(!$.includes("</body>"))return $;if(vQ($))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 U=await G8(Z?.pagesDir);if(U.length>0)q.ownedRoutes=U}catch{}if(Object.keys(q).length>0)J=`<script>window.__stxRouterConfig=${q8(q)};</script>
3532
+ `}let{getCachedRouterScript:Y}=await import("./chunk-scdxk8nn.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
+ </body>`+$.slice(G+7)}var K8=Symbol.for("stx.lazy-module-promises");function xQ(){let $=globalThis;return $[K8]??=new Map,$[K8]}function s($,Z){let X=xQ(),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 U4=`(?:"[^"]*"|'[^']*'|[^>"'])*`,O8=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s;function gQ($,Z={}){let X=[];for(let J of c5($,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,U=J.token.length-Q[0].length;X.push({fullMatch:J.token,attrs:G,body:J.token.slice(q,U),start:J.start,end:J.end})}return X}function F8($){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}=H8(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}=H8(Y);if(G)return{style:"in",iterable:Q,itemVar:G,indexVar:q}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function H8($){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 z4($,Z){return V8($,Z)}function hQ($){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 uQ($){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 dQ($){if(!/[:@]for\s*=/.test($)&&!/\bx-for\s*=/.test($))return[];let Z=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${U4})>`,"iy"),X=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,J=c5($,(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),U=F8(q?.[1]??q?.[2]??""),W=[U.itemVar,U.indexVar].filter(Boolean);if(W.length===0)continue;let z=G[1],H=/\/\s*>$/.test(Q.token)||A$.has(z.toLowerCase())?Q.end:w8($,Q.start,z,Q.end);if(H!==-1)Y.push({start:Q.start,end:H,vars:new Set(W)})}return Y}var B8=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 mQ($){return $.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function j8($,Z,X,J){if(!$)return!1;let Y=mQ($),Q=!1,G=!1,q=!1,U=/([a-zA-Z_$][\w$]*)/g,W;while((W=U.exec(Y))!==null){let B=W[1];if(Y.slice(0,W.index).trimEnd().endsWith("."))continue;if(B8.has(B))continue;if(Z.has(B)||J?.has(B))Q=!0;else if(X&&B in X)G=!0}let z=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,K;while((K=z.exec(Y))!==null){let B=K[1];if(Y.slice(0,K.index).trimEnd().endsWith("."))continue;if(B8.has(B)||X&&B in X)continue;q=!0}return(Q||q)&&!G}function N$($,Z,X){let J=X===void 0?` ${Z}`:` ${Z}="${X.replace(/"/g,"&quot;")}"`,Y=$.trim(),Q=Y.match(O8);if(Q&&lQ(Q[3],Q[1])){let[,G,q,U]=Q;return`<${G}${q}${J}>${U}</${G}>`}return`<template${J}>${Y}</template>`}function lQ($,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 L8($,Z){let X=uQ($);function J(Y){let Q=Y,G=dQ(Y),q=(K)=>{let H=new Set;for(let B of G)if(K>B.start&&K<B.end)for(let j of B.vars)H.add(j);return H},U=/@if\s*\(/g,W,z=[];while((W=U.exec(Q))!==null){let K=W.index,H=K+W[0].length,B=1,j=H;while(j<Q.length&&B>0){if(Q[j]==="(")B++;else if(Q[j]===")")B--;j++}if(B!==0)continue;let _=Q.substring(H,j-1).trim(),L=j,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(hQ(R)){let N=O5(Q.substring(K,O));if(N.length===0)continue;let I=N[0].branches.filter((k)=>k.type!=="else"),A=q(K);if(!(I.length>0&&I.every((k)=>j8(k.condition,X,Z,A))))continue;D=N[0].branches.map((k)=>{let y=J(k.content);if(k.type==="elseif")return N$(y,"@else-if",k.condition??"");if(k.type==="else")return N$(y,"@else");return N$(y,"@if",k.condition??"")}).join(`
3534
+ `)}else{if(!j8(_,X,Z,q(K)))continue;D=N$(J(R),"@if",_)}z.push({start:K,end:O,replacement:D}),U.lastIndex=O}for(let K=z.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=z[K];Q=Q.substring(0,H)+j+Q.substring(B)}return Q}return J($)}function cQ($){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 A$=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function w8($,Z,X,J){if(A$.has(X.toLowerCase()))return J;let Y=X.toLowerCase(),Q=$.toLowerCase(),G=$.length,q=1,U=J;while(U<G){let W=$.indexOf("<",U);if(W===-1)return-1;if(U=W,$.startsWith("<!--",U)){let B=$.indexOf("-->",U+4);if(B===-1)return-1;U=B+3;continue}let z=/^<(script|style)\b/i.exec($.slice(U,U+8));if(z){let B=$.indexOf(">",U);if(B===-1)return-1;if($[B-1]==="/"){U=B+1;continue}let j=Q.indexOf(`</${z[1].toLowerCase()}`,U);if(j===-1)return-1;let _=$.indexOf(">",j);if(_===-1)return-1;U=_+1;continue}if($[U+1]==="/"){let B=/^<\/([a-z][\w-]*)\s*>/i.exec($.slice(U,U+64));if(!B){U++;continue}if(B[1].toLowerCase()===Y){if(q--,U+=B[0].length,q===0)return U;continue}U+=B[0].length;continue}let K=/^<([a-z][\w-]*)\b/i.exec($.slice(U,U+64));if(!K){U++;continue}let H=$.indexOf(">",U);if(H===-1)return-1;if(K[1].toLowerCase()===Y){let B=$.slice(U,H+1);if(!(/\/\s*>$/.test(B)||A$.has(Y)))q++}U=H+1}return-1}var pQ=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function iQ($,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 pQ.test(Q)}function R8($){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=(K)=>Z.some(([H,B])=>K>=H&&K<B),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[K,H,B,j,_,L,V]=q,O=cQ(_);if(O===void 0)continue;let F=q.index,w=F+K.length,N=!!V||/\/\s*>$/.test(K)||A$.has(H.toLowerCase())?w:w8($,F,H,w);if(N===-1)continue;if((j===":if"||j==="x-if"||j==="@if")&&iQ($,N)){Q.lastIndex=w;continue}if(O===!0){let A=`<${H}${B}${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((K,H)=>K.start-H.start);let U=[],W=-1;for(let K of G){if(K.start<W)continue;U.push(K),W=K.end}let z=$;for(let K=U.length-1;K>=0;K--){let{start:H,end:B,replacement:j}=U[K];z=z.substring(0,H)+j+z.substring(B)}return z}function D8($,Z){let X=$,J=/@(for|foreach)\s*\(/g,Y,Q=[],G=[];while((Y=J.exec(X))!==null){let q=Y[1],U=Y.index,W=U+Y[0].length,z=1,K=W;while(K<X.length&&z>0){if(X[K]==="(")z++;else if(X[K]===")")z--;K++}if(z!==0)continue;let H=X.substring(W,K-1).trim(),B=K,j=F8(H),_=q==="for"?"@endfor":"@endforeach",L=1,V=B,O=q==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${q}\\s*\\(|end${q})`,"g");O.lastIndex=B;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 I=[j.itemVar,j.indexVar].filter(Boolean);if(I.length)G.push({start:U,end:V,vars:I})};if(j.iterable){let I=j.iterable.trim();if(I.startsWith("[")||I.startsWith("{")||I.startsWith("'")||I.startsWith('"')||I.startsWith("`")||/^-?\d/.test(I)){w();continue}let A=I.split(/[.[(]/)[0].trim(),M=Z?A in Z:!1,T=G.some((k)=>U>k.start&&U<k.end&&k.vars.includes(A));if(A&&(M||T)){w();continue}}if(j.style==="as")H=j.indexVar?`(${j.itemVar}, ${j.indexVar}) in ${j.iterable}`:`${j.itemVar} in ${j.iterable}`;let R=X.substring(B,V-_.length).trim(),D=R.match(O8),N;if(D){let[,I,A,M]=D;N=`<${I}${A} @for="${H}">${M}</${I}>`}else N=`<template @for="${H}">${R}</template>`;Q.push({start:U,end:V,replacement:N})}for(let q=Q.length-1;q>=0;q--){let{start:U,end:W,replacement:z}=Q[q];X=X.substring(0,U)+z+X.substring(W)}return X}function nQ($){let Z=new Set,X=[],J=0,Y=0,Q=$.length,G=(z)=>{let K=J+1;while(K<Q){let H=$[K];if(H==="\\"){K+=2;continue}if(H===z)return K+1;K++}return Q},q=()=>{let z=J+2;while(z<Q&&$[z]!==`
3546
3535
  `)z++;return z},U=()=>{let z=J+2;while(z<Q-1){if($[z]==="*"&&$[z+1]==="/")return z+2;z++}return Q},W=(z)=>{let K=z,H=0;while(K<Q){let B=$[K];if(B==="/"&&$[K+1]==="/"){let j=K+2;while(j<Q&&$[j]!==`
3547
- `)j++;K=j;continue}if(B==="/"&&$[K+1]==="*"){let j=K+2;while(j<Q-1&&!($[j]==="*"&&$[j+1]==="/"))j++;K=j+2;continue}if(B==='"'||B==="'"||B==="`"){let j=K+1;while(j<Q){if($[j]==="\\"){j+=2;continue}if($[j]===B){j++;break}j++}K=j;continue}if(B==="("||B==="["||B==="{"){H++,K++;continue}if(B===")"||B==="]"||B==="}"){H--,K++;continue}if(B===";"&&H===0)return K+1;K++}return Q};while(J<Q){let z=$[J];if(z==="/"&&$[J+1]==="/"){let K=q();X.push($.slice(J,K)),J=K;continue}if(z==="/"&&$[J+1]==="*"){let K=U();X.push($.slice(J,K)),J=K;continue}if(z==='"'||z==="'"||z==="`"){let K=G(z);X.push($.slice(J,K)),J=K;continue}if(z==="{"){Y++,X.push(z),J++;continue}if(z==="}"){Y--,X.push(z),J++;continue}if(Y===0){let K=J>0?$[J-1]:"";if(K===""||/\s/.test(K)||K===";"||K==="}"||K==="{"){let B=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(B){let j=B[2],_=W(J+B[0].length);if(Z.has(j)){X.push(`/* stx: deduped const ${j} */`),J=_;continue}Z.add(j),X.push($.slice(J,_)),J=_;continue}}}X.push(z),J++}return X.join("")}async function PQ($,Z,X){let J=AQ($,{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-g4t9zc0a.js"));for(let V of J){let O=V.body;if(T1(V.attrs))O=I1(O);if(Y.test(O)){Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O});continue}if(!G(O))continue;try{let L=await q(e1(O).code,Z||"",{projectRoot:process.cwd()});if(Y.test(L))Q.push({fullMatch:V.fullMatch,attrs:V.attrs,content:O,bundled:L})}catch{}}if(Q.length===0)return{output:$,setupCode:null};let U=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,W=`__stx_setup_${Bun.hash(U).toString(36).slice(0,10)}`,z=[];for(let V=0;V<Q.length;V++){let O=Q[V].bundled??e1(Q[V].content).code;if(!Q[V].bundled&&G(O))O=await q(O,Z||"",{projectRoot:process.cwd()});O=gQ(O);let L=t0(O);z.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3548
- ${L}`)}let K=z.join(`
3536
+ `)j++;K=j;continue}if(B==="/"&&$[K+1]==="*"){let j=K+2;while(j<Q-1&&!($[j]==="*"&&$[j+1]==="/"))j++;K=j+2;continue}if(B==='"'||B==="'"||B==="`"){let j=K+1;while(j<Q){if($[j]==="\\"){j+=2;continue}if($[j]===B){j++;break}j++}K=j;continue}if(B==="("||B==="["||B==="{"){H++,K++;continue}if(B===")"||B==="]"||B==="}"){H--,K++;continue}if(B===";"&&H===0)return K+1;K++}return Q};while(J<Q){let z=$[J];if(z==="/"&&$[J+1]==="/"){let K=q();X.push($.slice(J,K)),J=K;continue}if(z==="/"&&$[J+1]==="*"){let K=U();X.push($.slice(J,K)),J=K;continue}if(z==='"'||z==="'"||z==="`"){let K=G(z);X.push($.slice(J,K)),J=K;continue}if(z==="{"){Y++,X.push(z),J++;continue}if(z==="}"){Y--,X.push(z),J++;continue}if(Y===0){let K=J>0?$[J-1]:"";if(K===""||/\s/.test(K)||K===";"||K==="}"||K==="{"){let B=$.slice(J).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(B){let j=B[2],_=W(J+B[0].length);if(Z.has(j)){X.push(`/* stx: deduped const ${j} */`),J=_;continue}Z.add(j),X.push($.slice(J,_)),J=_;continue}}}X.push(z),J++}return X.join("")}async function sQ($,Z,X){let J=gQ($,{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 s("stx/client-script-bundler",()=>import("./chunk-9rkcrzj4.js"));for(let V of J){let O=V.body;if(N1(V.attrs))O=A1(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(o1(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 U=`${Z??""}\x00${Q.map((V)=>V.content).join("\x00")}`,W=`__stx_setup_${Bun.hash(U).toString(36).slice(0,10)}`,z=[];for(let V=0;V<Q.length;V++){let O=Q[V].bundled??o1(Q[V].content).code;if(!Q[V].bundled&&G(O))O=await q(O,Z||"",{projectRoot:process.cwd()});O=tQ(O);let F=$1(O);z.push(`// \u2500\u2500 merged signal script #${V+1} \u2500\u2500
3537
+ ${F}`)}let K=z.join(`
3549
3538
 
3550
- `);K=CQ(K);let H=vQ(K),B=H.split(",").map((V)=>V.trim()).filter(Boolean),j=Y4(K,X),_=`
3539
+ `);K=nQ(K);let H=oQ(K),B=H.split(",").map((V)=>V.trim()).filter(Boolean),j=W4(K,X),_=`
3551
3540
  <script data-stx-scoped>
3552
3541
  function ${W}() {
3553
- ${s1("const",B)}
3554
- ${t1(`${j}${K}`)}
3542
+ ${l1("const",B)}
3543
+ ${s1(`${j}${K}`)}
3555
3544
  return { ${H} };
3556
3545
  }
3557
3546
  window.__stx_latestSetup=${W};
3558
3547
  if(window.stx)window.stx._latestSetup=${W};
3559
- </script>`,F=$;for(let V of Q)F=F.split(V.fullMatch).join("");if(F.includes("<body"))F=F.replace(new RegExp(`<body(${J4})>`),`<body$1 data-stx="${W}">`);else{let V=["script","style","html","head","meta","link","title","!doctype"],O=!1;F=F.replace(new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${J4})>`,"gi"),(L,w,R)=>{if(O||V.includes(w.toLowerCase()))return L;return O=!0,`<${w}${R} data-stx="${W}">`})}return{output:F,setupCode:_}}function vQ($){let Z=$,X=[],J=new Set,Y=0,Q=0,G=Z.length,q="",U=()=>{Q++;let j=!1;while(Q<G){let _=Z[Q];if(_==="\\"){Q+=2;continue}if(_==="["&&!j){j=!0,Q++;continue}if(_==="]"&&j){j=!1,Q++;continue}if(_==="/"&&!j){Q++;while(Q<G&&/[gimsuyd]/.test(Z[Q]))Q++;return}if(_===`
3548
+ </script>`,L=$;for(let V of Q)L=L.split(V.fullMatch).join("");if(L.includes("<body"))L=L.replace(new RegExp(`<body(${U4})>`),`<body$1 data-stx="${W}">`);else{let V=["script","style","html","head","meta","link","title","!doctype"],O=!1;L=L.replace(new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${U4})>`,"gi"),(F,w,R)=>{if(O||V.includes(w.toLowerCase()))return F;return O=!0,`<${w}${R} data-stx="${W}">`})}return{output:L,setupCode:_}}function oQ($){let Z=$,X=[],J=new Set,Y=0,Q=0,G=Z.length,q="",U=()=>{Q++;let j=!1;while(Q<G){let _=Z[Q];if(_==="\\"){Q+=2;continue}if(_==="["&&!j){j=!0,Q++;continue}if(_==="]"&&j){j=!1,Q++;continue}if(_==="/"&&!j){Q++;while(Q<G&&/[gimsuyd]/.test(Z[Q]))Q++;return}if(_===`
3560
3549
  `)return;Q++}},W=()=>{if(!q)return!0;if(/[\w)\]]/.test(q))return!1;return!0},z=(j)=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]===j){Q++;return}Q++}},K=()=>{Q++;while(Q<G){if(Z[Q]==="\\"){Q+=2;continue}if(Z[Q]==="`"){Q++;return}if(Z[Q]==="$"&&Z[Q+1]==="{"){Q+=2;let j=1;while(Q<G&&j>0)if(Z[Q]==="{")j++,Q++;else if(Z[Q]==="}")j--,Q++;else if(Z[Q]==="'"||Z[Q]==='"')z(Z[Q]);else if(Z[Q]==="`")K();else Q++;continue}Q++}},H=()=>{if(Z[Q]==="/"&&Z[Q+1]==="/"){while(Q<G&&Z[Q]!==`
3561
- `)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},B=()=>{if(Y!==0)return;let j=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(j){let L=j[2];if(!J.has(L))X.push(L),J.add(L);return}let _=Z.slice(Q).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(_){_[1].split(",").forEach((L)=>{let w=L.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 F=Z.slice(Q).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(F){F[1].split(",").forEach((L)=>{let w=L.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 L=V[1];if(!J.has(L))X.push(L),J.add(L);return}let O=Z.slice(Q).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(O){let L=O[1];if(!J.has(L))X.push(L),J.add(L)}};while(Q<G){if(H())continue;if(Z[Q]==="'"||Z[Q]==='"'){z(Z[Q]),q=Z[Q-1];continue}if(Z[Q]==="`"){K(),q="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&W()){U(),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])))B();if(!/\s/.test(Z[Q]))q=Z[Q];Q++}return X.join(", ")}async function B8($,Z,X,J){if(!Q4($,X))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await PQ(Y,X,J);if(Y=Q,Y=await L$(Y,Z),G){let z=X4(Y,/<\/head>/i),K=z===-1?X4(Y,/<body[^>]*>/i):-1;if(z!==-1)Y=`${Y.slice(0,z)}${G}
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},B=()=>{if(Y!==0)return;let j=Z.slice(Q).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(j){let F=j[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]==='"'){z(Z[Q]),q=Z[Q-1];continue}if(Z[Q]==="`"){K(),q="`";continue}if(Z[Q]==="/"&&Z[Q+1]!=="/"&&Z[Q+1]!=="*"&&W()){U(),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])))B();if(!/\s/.test(Z[Q]))q=Z[Q];Q++}return X.join(", ")}async function N8($,Z,X,J){if(!z4($,X))return $;let Y=$;if(Z.skipSignalsRuntime)return Y;let{output:Q,setupCode:G}=await sQ(Y,X,J);if(Y=Q,Y=await D$(Y,Z),G){let z=q4(Y,/<\/head>/i),K=z===-1?q4(Y,/<body[^>]*>/i):-1;if(z!==-1)Y=`${Y.slice(0,z)}${G}
3562
3551
  ${Y.slice(z)}`;else if(K!==-1){let H=/<body[^>]*>/i.exec(Y.slice(K))[0],B=K+H.length;Y=`${Y.slice(0,B)}
3563
3552
  ${G}${Y.slice(B)}`}else Y=`${Y}
3564
- ${G}`}let U=Y.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i),W=U&&/data-stx/.test(U[1]);if(!G&&!W&&U&&!/data-stx-auto/.test(U[1])){let z=/<body[^>]*>/i,K=X4(Y,z);if(K!==-1){let H=Y.slice(0,K),B=Y.slice(K).replace(z,(j)=>j.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));Y=H+B}}return Y}function X4($,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 U=G+q.index;if(!J.some(([z,K])=>U>=z&&U<K))return U;G=U+Math.max(q[0].length,1)}return-1}var Q8="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function fQ($){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 Q8;return`var ${Z.join(", ")}; ${Q8}`}var xQ=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function gQ($){return $.replace(xQ,(Z,X)=>fQ(X))}import g0 from"path";import G4 from"fs";function j8($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function _8($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class V8{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 B=[Y,Y.toLowerCase(),j8(Y),_8(Y)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${Y}.stx`,`${j8(Y)}.stx`,`${_8(Y)}.stx`])];if(Y.startsWith("./")||Y.startsWith("../")){let B=g0.resolve(g0.dirname(Z),`${Y}.stx`);if(await a(B))return B;return null}let q=[],U=X.componentsDir||"",W=J?.__originalFilePath;if(W)q.push(g0.join(g0.dirname(W),"components"));if(U)q.push(U);let z=g0.join(g0.dirname(Z),"components");if(!q.includes(z))q.push(z);let K=process.cwd(),H=[g0.resolve(K,"src/components"),g0.resolve(K,"components"),g0.resolve(import.meta.dir,"components")];for(let B of H)if(!q.includes(B))q.push(B);for(let B of q){if(!B)continue;for(let j of G){let _=g0.join(B,j);if(await a(_))return _}try{if(!G4.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let _=G4.readdirSync(B,{withFileTypes:!0});for(let F of _)if(F.isDirectory()){let V=g0.join(B,F.name);for(let O of G){let L=g0.join(V,O);if(await a(L))return L}}}catch{}}return null}}var b0=new V8;function V0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var b1="\x00stx-boolean-attribute";function q4($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function $5($,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(V0(Q));continue}if(Y===b1){X.push(V0(Q));continue}X.push(`${V0(Q)}="${V0(q4(String(Y)))}"`)}return X}function Z5($,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(V0(Q));continue}if(typeof Y==="object")continue;X.push(`${V0(Q)}="${V0(q4(String(Y)))}"`)}return X}function I5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hQ($){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 U4={name:"StxLink",aliases:["stx-link"],render($,Z,X){let J=hQ($),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,U=[];if(J.reactive)U.push(`:href="${I5(J.value)}"`);else U.push(`href="${I5(J.value)}"`);if(Y)U.push(`class="${I5(Y)}"`);if(U.push("data-stx-link"),U.push(`data-stx-active-class="${I5(Q)}"`),U.push(`data-stx-exact-active-class="${I5(G)}"`),q)U.push("data-stx-prefetch");let W=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);return U.push(...$5($,W)),U.push(...Z5($,W)),`<a ${U.join(" ")}>${Z}</a>`}};var uQ={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},W4=[320,640,768,1024,1280,1536,1920];function M0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function k0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function z4($,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 O8($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),X=[];for(let J of Z)if(J.includes(":")){let[Y,Q]=J.split(":"),G=uQ[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 K4($,Z,X,J){return Z.map((Y)=>`${k5($,Y,void 0,X,J)} ${Y}w`).join(", ")}function dQ($,Z,X,J,Y){return Z.map((Q)=>{let G=X?X*Q:void 0;return`${k5($,G,void 0,J,Y)} ${Q}x`}).join(", ")}function k5($,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 mQ($,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 H4={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,X){let J=k0($,"src")||"",Y=k0($,"alt")||"",Q=k0($,"width"),G=k0($,"height"),q=k0($,"sizes"),U=k0($,"srcset"),W=k0($,"densities"),z=k0($,"format"),K=k0($,"placeholder"),H=k0($,"placeholderColor")||"#e5e7eb",B=k0($,"provider"),j=k0($,"class")||k0($,"className")||"",_=k0($,"style")||"",F=k0($,"quality"),V=z4($,"lazy",!0),O=z4($,"preload",!1),L=z4($,"picture",!1)||!!z,w=Q?Number.parseInt(Q):void 0,R=G?Number.parseInt(G):void 0,D=U||"",N="";if(!D&&q)D=K4(J,W4,B,z),N=O8(q);else if(!D&&W){let E=W.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));D=dQ(J,E,w,B,z)}else if(q)N=O8(q);let T=[];if(_)T.push(_);if(w&&R)T.push(`aspect-ratio:${w}/${R}`);if(K==="blur"||K==="color"||K==="thumbhash"){let E=F8(J);if(E&&K==="color")T.push(`background-color:${E.color}`);else if(E)T.push(`background-color:${E.color}`),T.push(`background-image:url(${E.dataUrl})`),T.push("background-size:cover"),T.push("background-repeat:no-repeat");else{let b=mQ(w||16,R||9,H);T.push(`background-image:url(${b})`),T.push("background-size:cover"),T.push("background-repeat:no-repeat")}}else if(K&&K!=="empty"&&K!=="none")T.push(`background-image:url(${M0(K)})`),T.push("background-size:cover"),T.push("background-repeat:no-repeat");let A=k5(J,w,R,B,z),M=[];if(M.push(`src="${M0(A)}"`),M.push(`alt="${M0(Y)}"`),Q)M.push(`width="${M0(Q)}"`);if(G)M.push(`height="${M0(G)}"`);if(V)M.push('loading="lazy"');if(M.push('decoding="async"'),j)M.push(`class="${M0(j)}"`);if(T.length>0)M.push(`style="${M0(T.join(";"))}"`);if(D)M.push(`srcset="${M0(D)}"`);if(N)M.push(`sizes="${M0(N)}"`);let k=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);M.push(...$5($,k)),M.push(...Z5($,k));let I=`<img ${M.join(" ")} />`,y="";if(O){let b=z==="webp"?"image/webp":z==="avif"?"image/avif":"";y=`<link rel="preload" as="image" href="${M0(A)}"${b?` type="${b}"`:""}${D?` imagesrcset="${M0(D)}"`:""}${N?` imagesizes="${M0(N)}"`:""} />
3565
- `}if(L){let E=[];if(z==="avif"||z==="auto"){let b=k5(J,w,R,B,"avif"),C=D?K4(J,W4,B,"avif"):`${b}`;E.push(`<source type="image/avif" srcset="${M0(C)}"${N?` sizes="${M0(N)}"`:""} />`)}if(z==="webp"||z==="auto"){let b=k5(J,w,R,B,"webp"),C=D?K4(J,W4,B,"webp"):`${b}`;E.push(`<source type="image/webp" srcset="${M0(C)}"${N?` sizes="${M0(N)}"`:""} />`)}return`${y}<picture>
3553
+ ${G}`}let U=Y.replace(/<script\b[\s\S]*?<\/script>/gi,"").replace(/<style\b[\s\S]*?<\/style>/gi,"").match(/<body([^>]*)>/i),W=U&&/data-stx/.test(U[1]);if(!G&&!W&&U&&!/data-stx-auto/.test(U[1])){let z=/<body[^>]*>/i,K=q4(Y,z);if(K!==-1){let H=Y.slice(0,K),B=Y.slice(K).replace(z,(j)=>j.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>"));Y=H+B}}return Y}function q4($,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 U=G+q.index;if(!J.some(([z,K])=>U>=z&&U<K))return U;G=U+Math.max(q[0].length,1)}return-1}var _8="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function rQ($){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 _8;return`var ${Z.join(", ")}; ${_8}`}var aQ=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function tQ($){return $.replace(aQ,(Z,X)=>rQ(X))}import d0 from"path";import K4 from"fs";function A8($){return $.split("-").map((Z)=>Z.charAt(0).toUpperCase()+Z.slice(1)).join("")}function M8($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}class I8{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 B=[Y,Y.toLowerCase(),A8(Y),M8(Y)];for(let j of B)if(Q.has(j))return Q.get(j)}let G=[...new Set([`${Y}.stx`,`${A8(Y)}.stx`,`${M8(Y)}.stx`])];if(Y.startsWith("./")||Y.startsWith("../")){let B=d0.resolve(d0.dirname(Z),`${Y}.stx`);if(await t(B))return B;return null}let q=[],U=X.componentsDir||"",W=J?.__originalFilePath;if(W)q.push(d0.join(d0.dirname(W),"components"));if(U)q.push(U);let z=d0.join(d0.dirname(Z),"components");if(!q.includes(z))q.push(z);let K=process.cwd(),H=[d0.resolve(K,"src/components"),d0.resolve(K,"components"),d0.resolve(import.meta.dir,"components")];for(let B of H)if(!q.includes(B))q.push(B);for(let B of q){if(!B)continue;for(let j of G){let _=d0.join(B,j);if(await t(_))return _}try{if(!K4.statSync(B,{throwIfNoEntry:!1})?.isDirectory())continue;let _=K4.readdirSync(B,{withFileTypes:!0});for(let L of _)if(L.isDirectory()){let V=d0.join(B,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 I8;function L0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var k1="\x00stx-boolean-attribute";function H4($){return $.indexOf("\x00")===-1?$:$.replace(/\0/g,"")}function r1($,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(L0(Q));continue}if(Y===k1){X.push(L0(Q));continue}X.push(`${L0(Q)}="${L0(H4(String(Y)))}"`)}return X}function a1($,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(L0(Q));continue}if(typeof Y==="object")continue;X.push(`${L0(Q)}="${L0(H4(String(Y)))}"`)}return X}function A5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function eQ($){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 B4={name:"StxLink",aliases:["stx-link"],render($,Z,X){let J=eQ($),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,U=[];if(J.reactive)U.push(`:href="${A5(J.value)}"`);else U.push(`href="${A5(J.value)}"`);if(Y)U.push(`class="${A5(Y)}"`);if(U.push("data-stx-link"),U.push(`data-stx-active-class="${A5(Q)}"`),U.push(`data-stx-exact-active-class="${A5(G)}"`),q)U.push("data-stx-prefetch");let W=new Set(["to","class","className","activeClass","exactActiveClass","prefetch"]);return U.push(...r1($,W)),U.push(...a1($,W)),`<a ${U.join(" ")}>${Z}</a>`}};var $G={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},j4=[320,640,768,1024,1280,1536,1920];function N0($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function T0($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function _4($,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 k8($){if($.includes("(")||$.includes(","))return $;let Z=$.trim().split(/\s+/),X=[];for(let J of Z)if(J.includes(":")){let[Y,Q]=J.split(":"),G=$G[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 V4($,Z,X,J){return Z.map((Y)=>`${M5($,Y,void 0,X,J)} ${Y}w`).join(", ")}function ZG($,Z,X,J,Y){return Z.map((Q)=>{let G=X?X*Q:void 0;return`${M5($,G,void 0,J,Y)} ${Q}x`}).join(", ")}function M5($,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 XG($,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 O4={name:"StxImage",aliases:["stx-image","stx-img"],render($,Z,X){let J=T0($,"src")||"",Y=T0($,"alt")||"",Q=T0($,"width"),G=T0($,"height"),q=T0($,"sizes"),U=T0($,"srcset"),W=T0($,"densities"),z=T0($,"format"),K=T0($,"placeholder"),H=T0($,"placeholderColor")||"#e5e7eb",B=T0($,"provider"),j=T0($,"class")||T0($,"className")||"",_=T0($,"style")||"",L=T0($,"quality"),V=_4($,"lazy",!0),O=_4($,"preload",!1),F=_4($,"picture",!1)||!!z,w=Q?Number.parseInt(Q):void 0,R=G?Number.parseInt(G):void 0,D=U||"",N="";if(!D&&q)D=V4(J,j4,B,z),N=k8(q);else if(!D&&W){let E=W.split(/\s+/).map((b)=>Number.parseFloat(b.replace("x","")));D=ZG(J,E,w,B,z)}else if(q)N=k8(q);let I=[];if(_)I.push(_);if(w&&R)I.push(`aspect-ratio:${w}/${R}`);if(K==="blur"||K==="color"||K==="thumbhash"){let E=T8(J);if(E&&K==="color")I.push(`background-color:${E.color}`);else if(E)I.push(`background-color:${E.color}`),I.push(`background-image:url(${E.dataUrl})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat");else{let b=XG(w||16,R||9,H);I.push(`background-image:url(${b})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat")}}else if(K&&K!=="empty"&&K!=="none")I.push(`background-image:url(${N0(K)})`),I.push("background-size:cover"),I.push("background-repeat:no-repeat");let A=M5(J,w,R,B,z),M=[];if(M.push(`src="${N0(A)}"`),M.push(`alt="${N0(Y)}"`),Q)M.push(`width="${N0(Q)}"`);if(G)M.push(`height="${N0(G)}"`);if(V)M.push('loading="lazy"');if(M.push('decoding="async"'),j)M.push(`class="${N0(j)}"`);if(I.length>0)M.push(`style="${N0(I.join(";"))}"`);if(D)M.push(`srcset="${N0(D)}"`);if(N)M.push(`sizes="${N0(N)}"`);let T=new Set(["src","alt","width","height","lazy","sizes","srcset","placeholder","placeholderColor","class","className","style","format","provider","quality","densities","preload","picture"]);M.push(...r1($,T)),M.push(...a1($,T));let k=`<img ${M.join(" ")} />`,y="";if(O){let b=z==="webp"?"image/webp":z==="avif"?"image/avif":"";y=`<link rel="preload" as="image" href="${N0(A)}"${b?` type="${b}"`:""}${D?` imagesrcset="${N0(D)}"`:""}${N?` imagesizes="${N0(N)}"`:""} />
3554
+ `}if(F){let E=[];if(z==="avif"||z==="auto"){let b=M5(J,w,R,B,"avif"),S=D?V4(J,j4,B,"avif"):`${b}`;E.push(`<source type="image/avif" srcset="${N0(S)}"${N?` sizes="${N0(N)}"`:""} />`)}if(z==="webp"||z==="auto"){let b=M5(J,w,R,B,"webp"),S=D?V4(J,j4,B,"webp"):`${b}`;E.push(`<source type="image/webp" srcset="${N0(S)}"${N?` sizes="${N0(N)}"`:""} />`)}return`${y}<picture>
3566
3555
  ${E.join(`
3567
3556
  `)}
3568
- ${I}
3569
- </picture>`}return`${y}${I}`}};var L8="/images/safe-image-default.svg";function E5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function X5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var lQ=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${L8}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,B4={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,X){let J=X5($,"src")||"",Y=X5($,"alt")||"",Q=X5($,"fallback")||L8,G=X5($,"class")||X5($,"className")||"",q=X5($,"fallbackClassName")||"",U=[];if(U.push(`src="${E5(J)}"`),U.push(`alt="${E5(Y)}"`),G)U.push(`class="${E5(G)}"`);if(U.push(`data-fallback="${E5(Q)}"`),q)U.push(`data-fallback-class="${E5(q)}"`);U.push('onerror="window.__stxSafeImageHandler(this)"');let W=new Set(["src","alt","fallback","class","className","fallbackClassName"]);U.push(...$5($,W)),U.push(...Z5($,W));let z=`<img ${U.join(" ")} />`,K=X.context;if(!K.__safeImageHandlerEmitted)return K.__safeImageHandlerEmitted=!0,`${lQ}${z}`;return z}};function j4($){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 D$($,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 _4={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,X){let J=j4(b5($,"color")||"#6366f1"),Y=j4(b5($,"initialColor")||b5($,"initial-color")||""),Q=j4(b5($,"height")||"3px"),G=D$($,"duration",2000),q=D$($,"throttle",200),U=D$($,"zIndex",999999)||D$($,"z-index",999999),W=Y?`linear-gradient(to right, ${Y}, ${J})`:J;return`
3557
+ ${k}
3558
+ </picture>`}return`${y}${k}`}};var E8="/images/safe-image-default.svg";function I5($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function t1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var JG=`<script>window.__stxSafeImageHandler||(window.__stxSafeImageHandler=function(i){if(i.__stx_fb)return;i.__stx_fb=1;var f=i.getAttribute('data-fallback')||'${E8}';var c=i.getAttribute('data-fallback-class');i.src=f;if(c)i.className=c;});</script>`,F4={name:"SafeImage",aliases:["safe-image","safe-img"],render($,Z,X){let J=t1($,"src")||"",Y=t1($,"alt")||"",Q=t1($,"fallback")||E8,G=t1($,"class")||t1($,"className")||"",q=t1($,"fallbackClassName")||"",U=[];if(U.push(`src="${I5(J)}"`),U.push(`alt="${I5(Y)}"`),G)U.push(`class="${I5(G)}"`);if(U.push(`data-fallback="${I5(Q)}"`),q)U.push(`data-fallback-class="${I5(q)}"`);U.push('onerror="window.__stxSafeImageHandler(this)"');let W=new Set(["src","alt","fallback","class","className","fallbackClassName"]);U.push(...r1($,W)),U.push(...a1($,W));let z=`<img ${U.join(" ")} />`,K=X.context;if(!K.__safeImageHandlerEmitted)return K.__safeImageHandlerEmitted=!0,`${JG}${z}`;return z}};function L4($){return $.replace(/[;{}()]/g,"").replace(/url/gi,"")}function k5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function M$($,Z,X){let J=k5($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var w4={name:"StxLoadingIndicator",aliases:["stx-loading-indicator"],render($,Z,X){let J=L4(k5($,"color")||"#6366f1"),Y=L4(k5($,"initialColor")||k5($,"initial-color")||""),Q=L4(k5($,"height")||"3px"),G=M$($,"duration",2000),q=M$($,"throttle",200),U=M$($,"zIndex",999999)||M$($,"z-index",999999),W=Y?`linear-gradient(to right, ${Y}, ${J})`:J;return`
3570
3559
  <div id="stx-loading-indicator" style="position:fixed;top:0;left:0;right:0;height:${Q};background:${W};z-index:${U};transform:scaleX(0);transform-origin:left;transition:transform 0.1s ease-out,opacity 0.3s ease;opacity:0;pointer-events:none">
3571
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>
3572
3561
  </div>
3573
3562
  <style>@keyframes stx-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}</style>
3574
3563
  <script>
3575
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()})})();
3576
- </script>`}};function R8($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function cQ($,Z,X){let J=R8($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var w8={"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%)"},V4={name:"StxToast",aliases:["stx-toast"],render($,Z,X){let J=V0(R8($,"position")||"top-right"),Y=cQ($,"max",5),Q=w8[J]||w8["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 y8($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}function YG($,Z,X){let J=y8($,Z);if(J!==void 0){let Y=Number.parseInt(J,10);if(!Number.isNaN(Y))return Y}return X}var b8={"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%)"},R4={name:"StxToast",aliases:["stx-toast"],render($,Z,X){let J=L0(y8($,"position")||"top-right"),Y=YG($,"max",5),Q=b8[J]||b8["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>
3577
3566
  <style>
3578
3567
  @keyframes stx-toast-in{from{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}
3579
3568
  @keyframes stx-toast-out{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(100%)}}
@@ -3581,7 +3570,7 @@ ${I}
3581
3570
  @keyframes stx-toast-out-left{from{opacity:1;transform:translateX(0)}to{opacity:0;transform:translateX(-100%)}}
3582
3571
  @keyframes stx-toast-in-center{from{opacity:0;transform:translateY(-1rem)}to{opacity:1;transform:translateY(0)}}
3583
3572
  @keyframes stx-toast-out-center{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-1rem)}}
3584
- </style>`}};function N$($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var D8={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},O4={name:"StxModal",aliases:["stx-modal"],render($,Z,X){let J=N$($,"id");if(!J)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let Y=V0(J),Q=N$($,"size")||"md",G=N$($,"closeOnBackdrop")!=="false",q=N$($,"closeOnEscape")!=="false",U=D8[Q]||D8.md;return`<div id="stx-modal-${Y}" class="stx-modal-backdrop" data-stx-modal="${Y}" data-close-backdrop="${G}" data-close-escape="${q}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
3573
+ </style>`}};function I$($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var S8={sm:"max-width:24rem",md:"max-width:32rem",lg:"max-width:42rem",xl:"max-width:56rem",full:"max-width:calc(100vw - 2rem);max-height:calc(100vh - 2rem)"},D4={name:"StxModal",aliases:["stx-modal"],render($,Z,X){let J=I$($,"id");if(!J)return console.warn('[stx] <StxModal> requires an "id" prop'),"<!-- StxModal: missing id prop -->";let Y=L0(J),Q=I$($,"size")||"md",G=I$($,"closeOnBackdrop")!=="false",q=I$($,"closeOnEscape")!=="false",U=S8[Q]||S8.md;return`<div id="stx-modal-${Y}" class="stx-modal-backdrop" data-stx-modal="${Y}" data-close-backdrop="${G}" data-close-escape="${q}" style="display:none;position:fixed;inset:0;z-index:99999;align-items:center;justify-content:center;background:rgba(0,0,0,0.5);backdrop-filter:blur(2px);opacity:0;transition:opacity 0.2s ease" aria-modal="true" role="dialog">
3585
3574
  <div class="stx-modal-panel" style="${U};width:100%;margin:1rem;border-radius:0.75rem;box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow:hidden;transform:scale(0.95) translateY(8px);transition:transform 0.2s ease,opacity 0.2s ease;opacity:0;background:var(--stx-modal-bg,#fff);color:var(--stx-modal-text,#1f2937)">
3586
3575
  <div style="padding:1.5rem">${Z}</div>
3587
3576
  </div>
@@ -3590,7 +3579,7 @@ ${I}
3590
3579
  @media(prefers-color-scheme:dark){[data-stx-modal]{--stx-modal-bg:#1f2937;--stx-modal-text:#f3f4f6}}
3591
3580
  .stx-modal-backdrop[data-stx-modal-open]{display:flex!important;opacity:1}
3592
3581
  .stx-modal-backdrop[data-stx-modal-open] .stx-modal-panel{transform:scale(1) translateY(0);opacity:1}
3593
- </style>`}};function J5($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var N8={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},F4={name:"StxDrawer",aliases:["stx-drawer"],render($,Z,X){let J=J5($,"id");if(!J)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let Y=V0(J),Q=J5($,"side")||"right",G=J5($,"size")||"md",q=J5($,"closeOnBackdrop")!=="false",U=J5($,"closeOnEscape")!=="false",W=J5($,"overlay")!=="false",z=N8[G]||N8.md,K=Q==="left",H=K?"left:0":"right:0",B=K?"translateX(-100%)":"translateX(100%)",j=K?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${Y}" class="stx-drawer-backdrop" data-stx-drawer="${Y}" data-close-backdrop="${q}" data-close-escape="${U}" style="display:none;position:fixed;inset:0;z-index:99999;${W?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
3582
+ </style>`}};function e1($,Z){if($.serverDynamic[Z]!==void 0)return String($.serverDynamic[Z]);let X=$.static[Z];if(typeof X==="string")return X;return}var C8={sm:"16rem",md:"24rem",lg:"32rem",xl:"40rem"},N4={name:"StxDrawer",aliases:["stx-drawer"],render($,Z,X){let J=e1($,"id");if(!J)return console.warn('[stx] <StxDrawer> requires an "id" prop'),"<!-- StxDrawer: missing id prop -->";let Y=L0(J),Q=e1($,"side")||"right",G=e1($,"size")||"md",q=e1($,"closeOnBackdrop")!=="false",U=e1($,"closeOnEscape")!=="false",W=e1($,"overlay")!=="false",z=C8[G]||C8.md,K=Q==="left",H=K?"left:0":"right:0",B=K?"translateX(-100%)":"translateX(100%)",j=K?"stx-drawer-slide-left":"stx-drawer-slide-right";return`<div id="stx-drawer-${Y}" class="stx-drawer-backdrop" data-stx-drawer="${Y}" data-close-backdrop="${q}" data-close-escape="${U}" style="display:none;position:fixed;inset:0;z-index:99999;${W?"background:rgba(0,0,0,0.5);backdrop-filter:blur(2px)":"background:transparent;pointer-events:none"};opacity:0;transition:opacity 0.2s ease" role="dialog" aria-modal="true">
3594
3583
  <div class="stx-drawer-panel" style="position:fixed;top:0;bottom:0;${H};width:${z};max-width:100vw;transform:${B};transition:transform 0.3s cubic-bezier(0.4,0,0.2,1);background:var(--stx-drawer-bg,#fff);color:var(--stx-drawer-text,#1f2937);box-shadow:0 20px 60px rgba(0,0,0,0.3);overflow-y:auto;pointer-events:auto">
3595
3584
  <div style="padding:1.5rem">${Z}</div>
3596
3585
  </div>
@@ -3599,81 +3588,104 @@ ${I}
3599
3588
  @media(prefers-color-scheme:dark){[data-stx-drawer]{--stx-drawer-bg:#1f2937;--stx-drawer-text:#f3f4f6}}
3600
3589
  .stx-drawer-backdrop[data-stx-drawer-open]{display:block!important;opacity:1}
3601
3590
  .stx-drawer-backdrop[data-stx-drawer-open] .stx-drawer-panel{transform:translateX(0)}
3602
- </style>`}};import{existsSync as pQ,readFileSync as iQ}from"fs";var y1=new Map,A8=new Set;function M8($){if(A8.has($))return;A8.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function T8($){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(pQ(X))return X;for(let X of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return f.resolve(X)}catch{}return null}function nQ($){if(y1.has($))return y1.get($);let Z=T8($);if(!Z)return M8($),null;try{let X=JSON.parse(iQ(Z,"utf8"));return y1.set($,X.icons),X.icons}catch{return null}}async function sQ($,Z=!1){if(y1.has($))return y1.get($);let X=T8($);if(!X){if(!Z)M8($);return null}try{let J=await Bun.file(X).json();return y1.set($,J.icons),J.icons}catch{return null}}function Y5($,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 L4={name:"Icon",aliases:["icon","stx-icon"],render($,Z,X){let J=Y5($,"name")??Y5($,"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=V0(Y5($,"size")||"24"),q=V0(Y5($,"color")||"currentColor"),U=V0(Y5($,"class")||""),W=V0(Y5($,"style")||""),z=y1.get(Y)??nQ(Y);if(!z)return`<!-- Icon: collection "${Y}" not loaded -->`;let K=z[Q];if(!K)return`<!-- Icon: "${Q}" not found in ${Y} -->`;let H=K.width||24,B=K.height||24,j=`0 0 ${H} ${B}`,_=K.body;if(q!=="currentColor")_=_.replace(/currentColor/g,q);let F=U?` class="${U}"`:"",V=W?` style="${W}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${j}" fill="none"${F}${V}>${_}</svg>`}};async function oQ($="lucide",Z={}){await sQ($,Z.speculative??!0)}function I8($,...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 k8($,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 w4={name:"Suspense",aliases:["suspense"],render($,Z,X){let J=k8(Z,"fallback"),Y=J.rest,Q=k8(Y,"error"),G=Q.rest,q=J.region??I8($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',U=Q.region??I8($,"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>${U}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function A$($,...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 R4={name:"TransitionGroup",aliases:["transition-group"],render($,Z,X){let J=(A$($,"name")||"v").replace(/["'<>]/g,""),Y=(A$($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Q=A$($,"class"),G=A$($,"id"),q=[`data-stx-transition-group="${J}"`,Q?`class="${Q}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Y} ${q}>${Z}</${Y}>`}};function E8(){b0.registerBuiltin(U4),b0.registerBuiltin(H4),b0.registerBuiltin(B4),b0.registerBuiltin(_4),b0.registerBuiltin(V4),b0.registerBuiltin(O4),b0.registerBuiltin(F4),b0.registerBuiltin(L4),b0.registerBuiltin(w4),b0.registerBuiltin(R4)}function M$($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}function b8($,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 U=q[1];if(X&&X.has(U.toLowerCase())){let _=Q+1+U.length;while(_<$.length&&$[_]!==">")_++;Y=_+1;continue}let W=Q+1+U.length,z=null,K=W,H=-1,B=!1;while(W<$.length){let _=$[W];if(z){if(_==="\\"&&W+1<$.length){W+=2;continue}if(_===z)z=null;W++;continue}if(_==='"'||_==="'"){z=_,W++;continue}if(_==="/"&&W+1<$.length&&$[W+1]===">"){H=W+2,B=!0;break}if(_===">"){H=W+1;break}W++}if(H===-1){Y=Q+1;continue}let j=$.slice(K,B?H-2:H-1).trim();if(B)J.push({fullMatch:$.slice(Q,H),tagName:U,attributes:j,content:"",startIndex:Q,endIndex:H,isSelfClosing:!0}),Y=H;else{let _=`<${U}`,F=`</${U}>`,V=1,O=H,L=-1;while(V>0&&O<$.length){let D=$.indexOf(_,O),N=$.indexOf(F,O);if(N===-1)break;if(D!==-1&&D<N){let T=$[D+_.length];if(T===" "||T===">"||T==="/"||T===`
3603
- `||T==="\t")V++;O=D+_.length}else{if(V--,V===0){L=N;break}O=N+F.length}}if(L===-1){Y=H;continue}let w=$.slice(H,L),R=L+F.length;J.push({fullMatch:$.slice(Q,R),tagName:U,attributes:j,content:w,startIndex:Q,endIndex:R,isSelfClosing:!1}),Y=R}}return J}function y8($){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 I$ from"fs";import P0 from"path";var C8=!1,rQ=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 aQ($,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=(W)=>{if(Y.size===0)return!1;let z=d0(W),K=z.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(K&&Y.has(K))return!0;for(let H of Y){let B=H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${B}\\s*\\(`).test(z))return!0}return!1},G=new Set(x8),q=(W)=>{if(!W.includes("-")||W.startsWith("@")||W.startsWith(":")||W.startsWith("x-")||W.startsWith("__"))return W;if(W.startsWith("aria-")||W.startsWith("data-"))return W;return W.replace(/-([a-z0-9])/g,(z,K)=>K.toUpperCase())},U=(W,z)=>{let K=q(W);if(J.static[K]=z,K!==W)J.staticNames[K]=W};for(let[W,z]of Object.entries($)){let K=W.startsWith("x-")&&!G.has(W)&&!W.startsWith("x-bind:")&&!W.startsWith("x-on:")?`:${W.slice(2)}`:W;if(K.startsWith("@")){J.events[K]=z;continue}if(K.startsWith("__stx_")){let H=q(K.slice(6));J.serverDynamic[H]=S8(z,X);continue}if(K.startsWith(":")){let H=q(K.slice(1)),B=z===b1?H:z;if(H==="if"||H==="for"||H==="show"){J.clientReactive[H]=B;continue}if(Q(B)){J.clientReactive[H]=B;continue}try{if(!G0(B)){if(X.debug)console.error(`Unsafe expression in :${H} binding: ${B}`);J.clientReactive[H]=B;continue}let j=Object.keys(Z),F=q0(B,j)(...Object.values(Z));if(F===void 0){let V=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","this","return","void","delete","throw","if","else"]);if(x5(B).some((L)=>!V.has(L)&&!j.includes(L))){J.clientReactive[H]=B;continue}}if(J.serverDynamic[H]=F,H!==K.slice(1)&&J.serverDynamicNames)J.serverDynamicNames[H]=K.slice(1)}catch{J.clientReactive[H]=B}continue}if(typeof z==="string"&&z.includes("{{")&&z.includes("}}")){let H=z.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(H)try{let B=H[1];if(G0(B)){let _=q0(B,Object.keys(Z))(...Object.values(Z));U(K,_!=null?String(_):"")}else{if(X.debug)console.error(`Unsafe expression in ${K}: ${B}`);U(K,z)}}catch(B){if(X.debug)console.error(`Error evaluating expression for ${K}:`,B);U(K,z)}else{let B=z,j=/\{\{\s*([\s\S]+?)\s*\}\}/g,_;while((_=j.exec(z))!==null)try{let F=_[1];if(!G0(F)){if(X.debug)console.error(`Unsafe expression in ${K}: ${F}`);continue}let O=q0(F,Object.keys(Z))(...Object.values(Z));B=B.replace(_[0],String(O??""))}catch(F){if(X.debug)console.error(`Error evaluating expression in ${K}:`,F)}U(K,B)}continue}U(K,z===b1?"true":y8(z))}return J}var tQ=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function eQ($,Z,X){if(!$.includes("@"))return $;if(!tQ.some(([Y,Q])=>Y.test($)&&$.includes(Q)))return $;try{return $1($,Z,X)}catch{return $}}function $G($){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]=b1}return Z}function P8($){return Object.entries($).map(([Z,X])=>X===b1?Z:`${Z}="${ZG(X)}"`).join(" ")}function ZG($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function XG($){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(b0.isBuiltin(Y))Z.add(Y)}return[...Z].sort()}var v8=new Map;function JG($){let Z=v8.get($);if(Z)return Z;let X=new Map,J=[P0.join($,"src"),P0.join($,"dist"),$];function Y(Q,G){if(G>6)return;let q;try{q=I$.readdirSync(Q,{withFileTypes:!0})}catch{return}for(let U of q){let W=P0.join(Q,U.name);if(U.isDirectory()){if(U.name==="node_modules"||U.name.startsWith("."))continue;Y(W,G+1)}else if(U.isFile()&&U.name.endsWith(".stx")){let z=U.name.slice(0,-4);if(!X.has(z))X.set(z,W);let K=z.toLowerCase();if(!X.has(K))X.set(K,W);let H=z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!X.has(H))X.set(H,W)}}}for(let Q of J)if(Y(Q,0),X.size>0)break;return v8.set($,X),X}function YG($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let X=Z;while(!0){let J=P0.join(X,"node_modules",$);try{if(I$.statSync(J).isDirectory())return J}catch{}let Y=P0.dirname(X);if(Y===X)return null;X=Y}}async function QG($,Z,X,J,Y){if(!$.includes("import"))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Q=Z.__importedComponents,G=P0.dirname(X),q=$,U=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;return q=q.replace(U,(W,z,K)=>{let H=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,B=K,j,_=[];while((j=H.exec(K))!==null){let[F,V,O,L]=j,w=null,R=null;if(L.startsWith(".")||L.startsWith("/")){let T=P0.resolve(G,L);if(T.endsWith(".stx"))R=T;else{let A=`${T}.stx`;try{if(I$.statSync(A).isFile())R=A}catch{try{if(I$.statSync(T).isDirectory())w=T}catch{}}}}else w=YG(L,G);if(!w&&!R)continue;let D=!1,N=(T,A)=>{Q.set(T,A),Q.set(T.toLowerCase(),A);let M=T.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 T=V.slice(1,-1).split(",").map((M)=>M.trim()).filter(Boolean).map((M)=>{let k=M.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(k)return{source:k[1],local:k[2]};return{source:M,local:M}}),A=w?JG(w):null;for(let{source:M,local:k}of T){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(k,I),D=!0}}if(D)_.push({start:j.index,end:j.index+F.length})}if(_.length===0)return W;for(let F=_.length-1;F>=0;F--)B=B.slice(0,_[F].start)+B.slice(_[F].end);return`<script${z}>${B}</script>`}),q}async function GG($,Z,X,J,Y){let Q=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,q=/@import\s*\(\s*([^)]+)\s*\)/g,U;while((U=q.exec(Q))!==null){let[W,z]=U,K=z.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of K){let B=H.split("/"),_=B[B.length-1].replace(/\.stx$/,""),F=_.includes("-")?_.split("-").map((L)=>L.charAt(0).toUpperCase()+L.slice(1)).join(""):_.charAt(0).toUpperCase()+_.slice(1),V=null,O=[P0.resolve(P0.dirname(X),`${H}.stx`),P0.resolve(P0.dirname(X),H),P0.resolve(J.componentsDir||"components",`${H}.stx`),P0.resolve(J.componentsDir||"components",H),H.endsWith(".stx")?H:`${H}.stx`];for(let L of O)try{if(await Bun.file(L).exists()){V=L;break}}catch{}if(V){G.set(F,V),G.set(_,V),G.set(_.toLowerCase(),V);let L=F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(G.set(L,V),Y.add(V),J.debug)console.log(`Imported component: ${F} -> ${V}`)}else if(J.debug)console.warn(`Could not resolve imported component: ${H}`)}Q=Q.replace(W,""),q.lastIndex=0}return Q}async function qG($,Z,X,J,Y){let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,U=/@component\s*\(/g,W;while((W=U.exec(Q))!==null){let z=W.index,K=z+W[0].length-1,H=1,B=K+1;while(B<Q.length&&H>0){if(Q[B]==="(")H++;else if(Q[B]===")"){if(H--,H===0)break}B++}if(H!==0)break;let j=Q.substring(K+1,B),_=B+1,F=j.match(/^\s*['"]([^'"]+)['"]/);if(!F){U.lastIndex=0;continue}let V=F[1],O,L=j.slice(F[0].length),w=L.match(/^\s*,\s*/);if(w)O=L.slice(w[0].length).trim();let R={};if(O)try{R=w0(O,Z)}catch(k){let I=k instanceof Error?k.message:String(k);Q=Q.replace(Q.substring(z,_),`[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 E1(V,R,D,G,Z,X,J,q,Y);Q=Q.substring(0,z)+M+Q.substring(N),U.lastIndex=0}return Q}async function UG($,Z,X,J,Y){if(!$)return $;let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,U=s0(Q);return Q=U.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,rQ),Q=x1(Q,U.scripts),Q;async function H(B,j,_,F){if(!B)return B;let V=B,O=b8(V,j,F);for(let L=O.length-1;L>=0;L--){let w=O[L],R=_?M$(w.tagName):w.tagName,D=$G(eQ(w.attributes,Z,X)),N=aQ(D,Z,J),T=b0.getBuiltin(w.tagName),A=T?await T$(R,G,Z,X,J):!1;if(T&&!A){let y={context:Z,filePath:X,options:J,dependencies:Y},E=T.render(N,w.content,y);if(Object.keys(N.clientReactive).length>0)E=f8(E,N.clientReactive);if(Object.keys(N.events).length>0){let b=P8(N.events);E=E.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${b}`)}V=V.substring(0,w.startIndex)+E+V.substring(w.endIndex);continue}if(!_&&w.tagName.includes("-")&&!await T$(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 E1(R,M,x1(w.content,U.scripts),G,Z,X,J,q,Y);if(Object.keys(N.clientReactive).length>0)I=f8(I,N.clientReactive);if(Object.keys(N.events).length>0){let y=g8(I);if(y){let E=P8(N.events),b=Object.keys(N.events).map((C)=>C.replace(/^@/,"").split(".")[0]).join(" ");I=I.substring(0,y.insertPos)+` data-stx-parent-events="${b}" ${E}`+I.substring(y.insertPos)}}V=V.substring(0,w.startIndex)+I+V.substring(w.endIndex)}return V}}function f8($,Z){let X=new Set(["if","for"]),J=new Set(["show"]),Y=Object.entries(Z).filter(([z])=>!X.has(z)),Q=Y.filter(([z])=>!J.has(z)).map(([z])=>M$(z)).join(" "),G=$,q=Y.length>0?g8(G):null;if(q){let z=Y.map(([H,B])=>`:${M$(H)}="${B.replace(/"/g,"&quot;")}"`).join(" "),K=Q?` data-stx-parent-bindings="${Q}"`:"";G=G.substring(0,q.insertPos)+`${K} ${z}`+G.substring(q.insertPos)}let U=Z.if;if(U)G=`<template :if="${U.replace(/"/g,"&quot;")}">${G}</template>`;let W=Z.for;if(W)G=`<template :for="${W.replace(/"/g,"&quot;")}">${G}</template>`;return G}function g8($){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()}>`,U=$.toLowerCase().indexOf(q,X+Q[0].length);if(U===-1)return null;X=U+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 D4($,Z,X,J,Y){if(!C8)E8(),C8=!0;let Q=await QG($,Z,X,J,Y);Q=await GG(Q,Z,X,J,Y),Q=await qG(Q,Z,X,J,Y);let G=[];for(let q=0;q<3;q++){let U=n0(Q,z5,(z,K)=>`\x00STX_COMPONENT_COMMENT_${G.length+K}\x00`);G.push(...U.tokens);let W=Q;if(Q=await UG(U.output,Z,X,J,Y),Q===W)break}if(G.length>0)Q=Q.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(q,U)=>G[Number(U)]??"");if(J.debug){let q=XG(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 G5 from"path";import h8 from"process";function Q5($="STX_PUBLIC_"){let Z={},X={};for(let[J,Y]of Object.entries(h8.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 vj($="STX_PUBLIC_"){let Z={};for(let[X,J]of Object.entries(h8.env))if(X.startsWith($)&&J!==void 0)Z[X]=J;return Z}function u8($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function d8($,Z,X){try{let J;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=G5.join(Y,$);if(await Bun.file(G).exists())return G;Y=G5.dirname(Y)}J=G5.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))J=G5.resolve(Z,$);else J=G5.resolve(Z,$);if(await Bun.file(J).exists())return J;return null}catch{return null}}async function m8($,Z,X){let J=$,Y=G5.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(J))!==null){let[W,z,K,H]=G;if(u8(K))continue;let B=await d8(K,Y,Z);if(B)try{let j=await Bun.file(B).text();if(X.add(B),K.endsWith(".ts")||K.endsWith(".tsx")){let F=await Bun.build({entrypoints:[B],target:"browser",minify:!0,define:Q5()});if(F.outputs.length>0)j=await F.outputs[0].text()}let _=`<script>
3591
+ </style>`}};import{existsSync as QG,readFileSync as GG}from"fs";var T1=new Map,P8=new Set;function v8($){if(P8.has($))return;P8.add($),console.warn(`[stx] icon collection "${$}" is not installed, so its icons render as nothing. Install it with \`bun add -d @iconify-json/${$}\`.`)}function f8($){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(QG(X))return X;for(let X of[`@iconify-json/${$}/icons.json`,`@iconify/json/json/${$}.json`])try{return v.resolve(X)}catch{}return null}function qG($){if(T1.has($))return T1.get($);let Z=f8($);if(!Z)return v8($),null;try{let X=JSON.parse(GG(Z,"utf8"));return T1.set($,X.icons),X.icons}catch{return null}}async function UG($,Z=!1){if(T1.has($))return T1.get($);let X=f8($);if(!X){if(!Z)v8($);return null}try{let J=await Bun.file(X).json();return T1.set($,J.icons),J.icons}catch{return null}}function $5($,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 A4={name:"Icon",aliases:["icon","stx-icon"],render($,Z,X){let J=$5($,"name")??$5($,"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=L0($5($,"size")||"24"),q=L0($5($,"color")||"currentColor"),U=L0($5($,"class")||""),W=L0($5($,"style")||""),z=T1.get(Y)??qG(Y);if(!z)return`<!-- Icon: collection "${Y}" not loaded -->`;let K=z[Q];if(!K)return`<!-- Icon: "${Q}" not found in ${Y} -->`;let H=K.width||24,B=K.height||24,j=`0 0 ${H} ${B}`,_=K.body;if(q!=="currentColor")_=_.replace(/currentColor/g,q);let L=U?` class="${U}"`:"",V=W?` style="${W}"`:"";return`<svg xmlns="http://www.w3.org/2000/svg" width="${G}" height="${G}" viewBox="${j}" fill="none"${L}${V}>${_}</svg>`}};async function WG($="lucide",Z={}){await UG($,Z.speculative??!0)}function x8($,...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 g8($,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 M4={name:"Suspense",aliases:["suspense"],render($,Z,X){let J=g8(Z,"fallback"),Y=J.rest,Q=g8(Y,"error"),G=Q.rest,q=J.region??x8($,"fallback")??'<div class="stx-suspense-loading">Loading\u2026</div>',U=Q.region??x8($,"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>${U}</div><div data-stx-suspense-content hidden>${G}</div></div>`}};function k$($,...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 I4={name:"TransitionGroup",aliases:["transition-group"],render($,Z,X){let J=(k$($,"name")||"v").replace(/["'<>]/g,""),Y=(k$($,"tag")||"div").replace(/[^a-z0-9-]/gi,"")||"div",Q=k$($,"class"),G=k$($,"id"),q=[`data-stx-transition-group="${J}"`,Q?`class="${Q}"`:"",G?`id="${G}"`:""].filter(Boolean).join(" ");return`<${Y} ${q}>${Z}</${Y}>`}};function h8(){S0.registerBuiltin(B4),S0.registerBuiltin(O4),S0.registerBuiltin(F4),S0.registerBuiltin(w4),S0.registerBuiltin(R4),S0.registerBuiltin(D4),S0.registerBuiltin(N4),S0.registerBuiltin(A4),S0.registerBuiltin(M4),S0.registerBuiltin(I4)}function T$($){return $.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}function u8($,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 U=q[1];if(X&&X.has(U.toLowerCase())){let _=Q+1+U.length;while(_<$.length&&$[_]!==">")_++;Y=_+1;continue}let W=Q+1+U.length,z=null,K=W,H=-1,B=!1;while(W<$.length){let _=$[W];if(z){if(_==="\\"&&W+1<$.length){W+=2;continue}if(_===z)z=null;W++;continue}if(_==='"'||_==="'"){z=_,W++;continue}if(_==="/"&&W+1<$.length&&$[W+1]===">"){H=W+2,B=!0;break}if(_===">"){H=W+1;break}W++}if(H===-1){Y=Q+1;continue}let j=$.slice(K,B?H-2:H-1).trim();if(B)J.push({fullMatch:$.slice(Q,H),tagName:U,attributes:j,content:"",startIndex:Q,endIndex:H,isSelfClosing:!0}),Y=H;else{let _=`<${U}`,L=`</${U}>`,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 I=$[D+_.length];if(I===" "||I===">"||I==="/"||I===`
3592
+ `||I==="\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:U,attributes:j,content:w,startIndex:Q,endIndex:R,isSelfClosing:!1}),Y=R}}return J}function d8($){return $.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0?39;/g,"'").replace(/&#x27;/gi,"'").replace(/&amp;/g,"&")}function m8($,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 b$ from"fs";import g0 from"path";var l8=!1,zG=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 KG($,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=(W)=>{if(Y.size===0)return!1;let z=c0(W),K=z.match(/^\s*[!+~(-]*\s*([a-zA-Z_$][\w$]*)/)?.[1];if(K&&Y.has(K))return!0;for(let H of Y){let B=H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?:^|[^\\w$.])${B}\\s*\\(`).test(z))return!0}return!1},G=new Set(n8),q=(W)=>{if(!W.includes("-")||W.startsWith("@")||W.startsWith(":")||W.startsWith("x-")||W.startsWith("__"))return W;if(W.startsWith("aria-")||W.startsWith("data-"))return W;return W.replace(/-([a-z0-9])/g,(z,K)=>K.toUpperCase())},U=(W,z)=>{let K=q(W);if(J.static[K]=z,K!==W)J.staticNames[K]=W};for(let[W,z]of Object.entries($)){let K=W.startsWith("x-")&&!G.has(W)&&!W.startsWith("x-bind:")&&!W.startsWith("x-on:")?`:${W.slice(2)}`:W;if(K.startsWith("@")){J.events[K]=z;continue}if(K.startsWith("__stx_")){let H=q(K.slice(6));J.serverDynamic[H]=m8(z,X);continue}if(K.startsWith(":")){let H=q(K.slice(1)),B=z===k1?H:z;if(H==="if"||H==="for"||H==="show"){J.clientReactive[H]=B;continue}if(Q(B)){J.clientReactive[H]=B;continue}try{if(!G0(B)){if(X.debug)console.error(`Unsafe expression in :${H} binding: ${B}`);J.clientReactive[H]=B;continue}let j=Object.keys(Z),L=q0(B,j)(...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(u5(B).some((F)=>!V.has(F)&&!j.includes(F))){J.clientReactive[H]=B;continue}}if(J.serverDynamic[H]=L,H!==K.slice(1)&&J.serverDynamicNames)J.serverDynamicNames[H]=K.slice(1)}catch{J.clientReactive[H]=B}continue}if(typeof z==="string"&&z.includes("{{")&&z.includes("}}")){let H=z.match(/^\{\{\s*([\s\S]+?)\s*\}\}$/);if(H)try{let B=H[1];if(G0(B)){let _=q0(B,Object.keys(Z))(...Object.values(Z));U(K,_!=null?String(_):"")}else{if(X.debug)console.error(`Unsafe expression in ${K}: ${B}`);U(K,z)}}catch(B){if(X.debug)console.error(`Error evaluating expression for ${K}:`,B);U(K,z)}else{let B=z,j=/\{\{\s*([\s\S]+?)\s*\}\}/g,_;while((_=j.exec(z))!==null)try{let L=_[1];if(!G0(L)){if(X.debug)console.error(`Unsafe expression in ${K}: ${L}`);continue}let O=q0(L,Object.keys(Z))(...Object.values(Z));B=B.replace(_[0],String(O??""))}catch(L){if(X.debug)console.error(`Error evaluating expression in ${K}:`,L)}U(K,B)}continue}U(K,z===k1?"true":d8(z))}return J}var HG=[[/@if\s*\(/,"@endif"],[/@unless\s*\(/,"@endunless"]];function BG($,Z,X){if(!$.includes("@"))return $;if(!HG.some(([Y,Q])=>Y.test($)&&$.includes(Q)))return $;try{return X1($,Z,X)}catch{return $}}function jG($){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]=k1}return Z}function c8($){return Object.entries($).map(([Z,X])=>X===k1?Z:`${Z}="${_G(X)}"`).join(" ")}function _G($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VG($){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 p8=new Map;function OG($){let Z=p8.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=b$.readdirSync(Q,{withFileTypes:!0})}catch{return}for(let U of q){let W=g0.join(Q,U.name);if(U.isDirectory()){if(U.name==="node_modules"||U.name.startsWith("."))continue;Y(W,G+1)}else if(U.isFile()&&U.name.endsWith(".stx")){let z=U.name.slice(0,-4);if(!X.has(z))X.set(z,W);let K=z.toLowerCase();if(!X.has(K))X.set(K,W);let H=z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();if(!X.has(H))X.set(H,W)}}}for(let Q of J)if(Y(Q,0),X.size>0)break;return p8.set($,X),X}function FG($,Z){if($.startsWith(".")||$.startsWith("/"))return null;let X=Z;while(!0){let J=g0.join(X,"node_modules",$);try{if(b$.statSync(J).isDirectory())return J}catch{}let Y=g0.dirname(X);if(Y===X)return null;X=Y}}async function LG($,Z,X,J,Y){if(!$.includes("import"))return $;if(!Z.__importedComponents)Z.__importedComponents=new Map;let Q=Z.__importedComponents,G=g0.dirname(X),q=$,U=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi;return q=q.replace(U,(W,z,K)=>{let H=/import\s+(?:(\{[^}]*\})|([A-Za-z_$][\w$]*))\s+from\s+['"]([^'"]+)['"]\s*;?\s*\n?/g,B=K,j,_=[];while((j=H.exec(K))!==null){let[L,V,O,F]=j,w=null,R=null;if(F.startsWith(".")||F.startsWith("/")){let I=g0.resolve(G,F);if(I.endsWith(".stx"))R=I;else{let A=`${I}.stx`;try{if(b$.statSync(A).isFile())R=A}catch{try{if(b$.statSync(I).isDirectory())w=I}catch{}}}}else w=FG(F,G);if(!w&&!R)continue;let D=!1,N=(I,A)=>{Q.set(I,A),Q.set(I.toLowerCase(),A);let M=I.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 I=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?OG(w):null;for(let{source:M,local:T}of I){let k=null;if(R)k=R;else if(A)k=A.get(M)??A.get(M.toLowerCase())??A.get(M.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase())??null;if(k)N(T,k),D=!0}}if(D)_.push({start:j.index,end:j.index+L.length})}if(_.length===0)return W;for(let L=_.length-1;L>=0;L--)B=B.slice(0,_[L].start)+B.slice(_[L].end);return`<script${z}>${B}</script>`}),q}async function wG($,Z,X,J,Y){let Q=$;if(!Z.__importedComponents)Z.__importedComponents=new Map;let G=Z.__importedComponents,q=/@import\s*\(\s*([^)]+)\s*\)/g,U;while((U=q.exec(Q))!==null){let[W,z]=U,K=z.split(",").map((H)=>H.trim().replace(/^['"]|['"]$/g,"")).filter((H)=>H.length>0);for(let H of K){let B=H.split("/"),_=B[B.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(W,""),q.lastIndex=0}return Q}async function RG($,Z,X,J,Y){let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,U=/@component\s*\(/g,W;while((W=U.exec(Q))!==null){let z=W.index,K=z+W[0].length-1,H=1,B=K+1;while(B<Q.length&&H>0){if(Q[B]==="(")H++;else if(Q[B]===")"){if(H--,H===0)break}B++}if(H!==0)break;let j=Q.substring(K+1,B),_=B+1,L=j.match(/^\s*['"]([^'"]+)['"]/);if(!L){U.lastIndex=0;continue}let V=L[1],O,F=j.slice(L[0].length),w=F.match(/^\s*,\s*/);if(w)O=F.slice(w[0].length).trim();let R={};if(O)try{R=w0(O,Z)}catch(T){let k=T instanceof Error?T.message:String(T);Q=Q.replace(Q.substring(z,_),`[Error parsing component props: ${k}]`);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,z)+M+Q.substring(N),U.lastIndex=0}return Q}async function DG($,Z,X,J,Y){if(!$)return $;let Q=$,G=J.componentsDir||"components";if(!Z.__processedComponents)Z.__processedComponents=new Set;let q=Z.__processedComponents,U=r0(Q);return Q=U.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,zG),Q=C1(Q,U.scripts),Q;async function H(B,j,_,L){if(!B)return B;let V=B,O=u8(V,j,L);for(let F=O.length-1;F>=0;F--){let w=O[F],R=_?T$(w.tagName):w.tagName,D=jG(BG(w.attributes,Z,X)),N=KG(D,Z,J),I=S0.getBuiltin(w.tagName),A=I?await E$(R,G,Z,X,J):!1;if(I&&!A){let y={context:Z,filePath:X,options:J,dependencies:Y},E=I.render(N,w.content,y);if(Object.keys(N.clientReactive).length>0)E=i8(E,N.clientReactive);if(Object.keys(N.events).length>0){let b=c8(N.events);E=E.replace(/^(\s*<[a-zA-Z][a-zA-Z0-9-]*)/,`$1 ${b}`)}V=V.substring(0,w.startIndex)+E+V.substring(w.endIndex);continue}if(!_&&w.tagName.includes("-")&&!await E$(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 k=await I1(R,M,C1(w.content,U.scripts),G,Z,X,J,q,Y);if(Object.keys(N.clientReactive).length>0)k=i8(k,N.clientReactive);if(Object.keys(N.events).length>0){let y=s8(k);if(y){let E=c8(N.events),b=Object.keys(N.events).map((S)=>S.replace(/^@/,"").split(".")[0]).join(" ");k=k.substring(0,y.insertPos)+` data-stx-parent-events="${b}" ${E}`+k.substring(y.insertPos)}}V=V.substring(0,w.startIndex)+k+V.substring(w.endIndex)}return V}}function i8($,Z){let X=new Set(["if","for"]),J=new Set(["show"]),Y=Object.entries(Z).filter(([z])=>!X.has(z)),Q=Y.filter(([z])=>!J.has(z)).map(([z])=>T$(z)).join(" "),G=$,q=Y.length>0?s8(G):null;if(q){let z=Y.map(([H,B])=>`:${T$(H)}="${B.replace(/"/g,"&quot;")}"`).join(" "),K=Q?` data-stx-parent-bindings="${Q}"`:"";G=G.substring(0,q.insertPos)+`${K} ${z}`+G.substring(q.insertPos)}let U=Z.if;if(U)G=`<template :if="${U.replace(/"/g,"&quot;")}">${G}</template>`;let W=Z.for;if(W)G=`<template :for="${W.replace(/"/g,"&quot;")}">${G}</template>`;return G}function s8($){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()}>`,U=$.toLowerCase().indexOf(q,X+Q[0].length);if(U===-1)return null;X=U+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 k4($,Z,X,J,Y){if(!l8)h8(),l8=!0;let Q=await LG($,Z,X,J,Y);Q=await wG(Q,Z,X,J,Y),Q=await RG(Q,Z,X,J,Y);let G=[];for(let q=0;q<3;q++){let U=o0(Q,q5,(z,K)=>`\x00STX_COMPONENT_COMMENT_${G.length+K}\x00`);G.push(...U.tokens);let W=Q;if(Q=await DG(U.output,Z,X,J,Y),Q===W)break}if(G.length>0)Q=Q.replace(/\x00STX_COMPONENT_COMMENT_(\d+)\x00/g,(q,U)=>G[Number(U)]??"");if(J.debug){let q=VG(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 X5 from"path";import o8 from"process";function Z5($="STX_PUBLIC_"){let Z={},X={};for(let[J,Y]of Object.entries(o8.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 oj($="STX_PUBLIC_"){let Z={};for(let[X,J]of Object.entries(o8.env))if(X.startsWith($)&&J!==void 0)Z[X]=J;return Z}function r8($){return $.startsWith("http://")||$.startsWith("https://")||$.startsWith("//")}async function a8($,Z,X){try{let J;if($.startsWith("/")){let Y=Z;for(let Q=0;Q<5;Q++){let G=X5.join(Y,$);if(await Bun.file(G).exists())return G;Y=X5.dirname(Y)}J=X5.join(Z,$)}else if($.startsWith("./")||$.startsWith("../"))J=X5.resolve(Z,$);else J=X5.resolve(Z,$);if(await Bun.file(J).exists())return J;return null}catch{return null}}async function t8($,Z,X){let J=$,Y=X5.dirname(Z),Q=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,G;while((G=Q.exec(J))!==null){let[W,z,K,H]=G;if(r8(K))continue;let B=await a8(K,Y,Z);if(B)try{let j=await Bun.file(B).text();if(X.add(B),K.endsWith(".ts")||K.endsWith(".tsx")){let L=await Bun.build({entrypoints:[B],target:"browser",minify:!0,define:Z5()});if(L.outputs.length>0)j=await L.outputs[0].text()}let _=`<script>
3604
3593
  // Source: ${K}
3605
3594
  ${j}
3606
- </script>`;J=J.replace(W,_),Q.lastIndex=0}catch(j){}}let q=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,U;while((U=q.exec(J))!==null){let[W,z,K,H]=U,B=z+H;if(u8(K))continue;if(/rel=["']stylesheet["']/.test(B)||K.endsWith(".css")){let _=await d8(K,Y,Z);if(_)try{let F=await Bun.file(_).text();X.add(_);let V=`<style>
3595
+ </script>`;J=J.replace(W,_),Q.lastIndex=0}catch(j){}}let q=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,U;while((U=q.exec(J))!==null){let[W,z,K,H]=U,B=z+H;if(r8(K))continue;if(/rel=["']stylesheet["']/.test(B)||K.endsWith(".css")){let _=await a8(K,Y,Z);if(_)try{let L=await Bun.file(_).text();X.add(_);let V=`<style>
3607
3596
  /* Source: ${K} */
3608
- ${F}
3609
- </style>`;J=J.replace(W,V),q.lastIndex=0}catch(F){}}}return J}function N4($,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,U=G+1,W=null,z=!1;while(U<X.length&&q>0){let L=X[U];if(z){z=!1,U++;continue}if(L==="\\"&&W){z=!0,U++;continue}if(W){if(L===W)W=null;U++;continue}if(L==='"'||L==="'"||L==="`"){W=L,U++;continue}if(L==="(")q++;else if(L===")"){if(q--,q===0)break}U++}if(q!==0)break;let K=X.substring(G+1,U).trim(),H=X.substring(Q,U+1),B=-1,j=0,_=null,F=!1;for(let L=0;L<K.length;L++){let w=K[L];if(F){F=!1;continue}if(w==="\\"&&_){F=!0;continue}if(_){if(w===_)_=null;continue}if(w==='"'||w==="'"||w==="`"){_=w;continue}if(w==="("||w==="["||w==="{")j++;else if(w===")"||w==="]"||w==="}")j--;if(w===","&&j===0){B=L;break}}let V=B>=0?K.substring(0,B).trim():K,O=B>=0?K.substring(B+1).trim():void 0;try{let L=V.trim(),w;if(G0(L))w=q0(L,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(U+1),J.lastIndex=Q+D.length}catch(L){l0.log(L instanceof Error?L:Error(String(L)),{directive:"@json"},"error"),J.lastIndex=Q+H.length}}return X}function A4($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function l8($){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,U=G;while(U<Z.length&&q>0){if(Z[U]==="(")q++;else if(Z[U]===")")q--;U++}if(q!==0)continue;let W=Z.slice(G,U-1).trim(),z=U,K=Z.slice(z),H=K.indexOf("@endmemo");if(H===-1)continue;let B=K.slice(0,H),j=z+H+8,_=B.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),F=_?_[0].length:0,V=B.slice(F),O=B.match(/(\s*)$/),L=O?O[0].length:0,w=V.slice(0,V.length-L),R=w.match(/^<([a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)?(\/?)>/),D;if(R){let[N,T,A="",M]=R,k=`<${T}${A} data-stx-memo="${W}"${M}>`;D=B.slice(0,F)+k+w.slice(N.length)+B.slice(F+w.length)}else D=`${B.slice(0,F)}<div data-stx-memo="${W}">${w}</div>${B.slice(F+w.length)}`;Y.push({start:Q,end:j,replacement:D}),X.lastIndex=j}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 M4($){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 WG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),c8=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/;function zG($,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 KG($,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 W=$.indexOf("-->",Y);Y=W===-1?$.length:W+3;continue}let G=zG($,Y);if(G===-1)break;let q=$.slice(Y,G+1),U=/^<\/?\s*([a-z][\w-]*)/i.exec(q)?.[1]?.toLowerCase()??"";if(q[1]==="/"){if(X===0)break;X--}else if(!/\/\s*>$/.test(q)&&!WG.has(U))X++;Y=G+1}return J}function p8($){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,U=!1,W=!1,z=-1;while(q<$.length){let B=$[q];if(U){if(B==="'")U=!1}else if(W){if(B==='"')W=!1}else if(B==="'")U=!0;else if(B==='"')W=!0;else if(B===">"){z=q;break}q++}if(z===-1)continue;let K=$.slice(G,z+1);if(c8.test(K))continue;if(K.includes("x-cloak"))continue;let H=KG($,z+1);if(/\{\{[\s\S]*?\}\}/.test(H))J+=$.slice(Y,z)+" x-cloak>",Y=z+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 i8($){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 j=`</${G}>`,_=$.toLowerCase().indexOf(j,Q);if(_!==-1)Z.lastIndex=_+j.length;continue}let q=Q+Y[0].length,U=!1,W=!1,z=-1;while(q<$.length){let j=$[q];if(U){if(j==="'")U=!1}else if(W){if(j==='"')W=!1}else if(j==="'")U=!0;else if(j==='"')W=!0;else if(j===">"){z=q;break}q++}if(z===-1)continue;let K=$.slice(Q+Y[0].length,z);if(c8.test(K))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(K))continue;if(!HG.test(K))continue;let H=$[z-1]==="/",B=H?z-1:z;X+=`${$.slice(J,B)} x-cloak${H?" ":""}`,J=B}return X+=$.slice(J),X}var BG=[{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 T4($,Z,X,J){let Y=typeof X==="boolean"?{enabled:X,failOnViolation:X}:X??{enabled:!1},Q=Y.allowPatterns??[],G=[],q=d0($.replace(/\{\{--[\s\S]*?--\}\}/g,(U)=>U.replace(/[^\n]/g," ")));for(let{pattern:U,message:W,suggestion:z}of BG){if(Q.some((H)=>/\w/.test(H)&&W.includes(H)))continue;U.lastIndex=0;let K=q.match(U);if(K&&K.length>0){let H=q.split(`
3610
- `),B=$.split(`
3611
- `),j=[];H.forEach((O,L)=>{if(U.lastIndex=0,U.test(O))j.push(L+1)});let _=j.length>0?` (script line${j.length>1?"s":""} ${j.join(", ")})`:"",F=j.slice(0,3).map((O)=>` ${O} | ${(B[O-1]??"").trim().slice(0,100)}`).join(`
3612
- `),V=F?`
3613
- ${F}`:"";G.push(` \u2717 ${W}${_}
3614
- \u2192 ${z}${V}`)}}if(G.length>0&&Y.enabled){let U=(K)=>{let H=`${process.cwd()}/`;return K.startsWith(H)?K.slice(H.length):K},z=`[STX] DOM API violation in ${J&&J!==Z?`${U(J)} (composed into ${U(Z)})`:U(Z)}:
3615
- ${G.join(`
3597
+ ${L}
3598
+ </style>`;J=J.replace(W,V),q.lastIndex=0}catch(L){}}}return J}function T4($,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,U=G+1,W=null,z=!1;while(U<X.length&&q>0){let F=X[U];if(z){z=!1,U++;continue}if(F==="\\"&&W){z=!0,U++;continue}if(W){if(F===W)W=null;U++;continue}if(F==='"'||F==="'"||F==="`"){W=F,U++;continue}if(F==="(")q++;else if(F===")"){if(q--,q===0)break}U++}if(q!==0)break;let K=X.substring(G+1,U).trim(),H=X.substring(Q,U+1),B=-1,j=0,_=null,L=!1;for(let F=0;F<K.length;F++){let w=K[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==="{")j++;else if(w===")"||w==="]"||w==="}")j--;if(w===","&&j===0){B=F;break}}let V=B>=0?K.substring(0,B).trim():K,O=B>=0?K.substring(B+1).trim():void 0;try{let F=V.trim(),w;if(G0(F))w=q0(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(U+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 E4($){return $.replace(/@once\s*([\s\S]*?)@endonce/g,"$1")}function e8($){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,U=G;while(U<Z.length&&q>0){if(Z[U]==="(")q++;else if(Z[U]===")")q--;U++}if(q!==0)continue;let W=Z.slice(G,U-1).trim(),z=U,K=Z.slice(z),H=K.indexOf("@endmemo");if(H===-1)continue;let B=K.slice(0,H),j=z+H+8,_=B.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)/),L=_?_[0].length:0,V=B.slice(L),O=B.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,I,A="",M]=R,T=`<${I}${A} data-stx-memo="${W}"${M}>`;D=B.slice(0,L)+T+w.slice(N.length)+B.slice(L+w.length)}else D=`${B.slice(0,L)}<div data-stx-memo="${W}">${w}</div>${B.slice(L+w.length)}`;Y.push({start:Q,end:j,replacement:D}),X.lastIndex=j}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 b4($){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 NG=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$2=/(?:^|\s)x-no-cloak(?:=|\s|\/|>|$)/;function AG($,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 MG($,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 W=$.indexOf("-->",Y);Y=W===-1?$.length:W+3;continue}let G=AG($,Y);if(G===-1)break;let q=$.slice(Y,G+1),U=/^<\/?\s*([a-z][\w-]*)/i.exec(q)?.[1]?.toLowerCase()??"";if(q[1]==="/"){if(X===0)break;X--}else if(!/\/\s*>$/.test(q)&&!NG.has(U))X++;Y=G+1}return J}function Z2($){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,U=!1,W=!1,z=-1;while(q<$.length){let B=$[q];if(U){if(B==="'")U=!1}else if(W){if(B==='"')W=!1}else if(B==="'")U=!0;else if(B==='"')W=!0;else if(B===">"){z=q;break}q++}if(z===-1)continue;let K=$.slice(G,z+1);if($2.test(K))continue;if(K.includes("x-cloak"))continue;let H=MG($,z+1);if(/\{\{[\s\S]*?\}\}/.test(H))J+=$.slice(Y,z)+" x-cloak>",Y=z+1}return J+=$.slice(Y),J}var IG=/(?:^|\s)(?::else-if|:if|:else|:show|x-else-if|x-if|x-else|x-show|@if|@show)(?:=|\s|\/|>|$)/;function X2($){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 j=`</${G}>`,_=$.toLowerCase().indexOf(j,Q);if(_!==-1)Z.lastIndex=_+j.length;continue}let q=Q+Y[0].length,U=!1,W=!1,z=-1;while(q<$.length){let j=$[q];if(U){if(j==="'")U=!1}else if(W){if(j==='"')W=!1}else if(j==="'")U=!0;else if(j==='"')W=!0;else if(j===">"){z=q;break}q++}if(z===-1)continue;let K=$.slice(Q+Y[0].length,z);if($2.test(K))continue;if(/(?:^|\s)x-cloak(?:=|\s|\/|>|$)/.test(K))continue;if(!IG.test(K))continue;let H=$[z-1]==="/",B=H?z-1:z;X+=`${$.slice(J,B)} x-cloak${H?" ":""}`,J=B}return X+=$.slice(J),X}var y4=J5(256),kG=[{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 S4($,Z,X,J){let Y=typeof X==="boolean"?{enabled:X,failOnViolation:X}:X??{enabled:!1};if(!Y.enabled)return;let Q=E1($,Z,J,JSON.stringify(Y)),G=y4.get(Q);if(G!==void 0){if(G&&Y.failOnViolation)throw Error(G);return}let q=Y.allowPatterns??[],U=[],W=c0($.replace(/\{\{--[\s\S]*?--\}\}/g,(B)=>B.replace(/[^\n]/g," ")));for(let{pattern:B,message:j,suggestion:_}of kG){if(q.some((V)=>/\w/.test(V)&&j.includes(V)))continue;B.lastIndex=0;let L=W.match(B);if(L&&L.length>0){let V=W.split(`
3599
+ `),O=$.split(`
3600
+ `),F=[];V.forEach((N,I)=>{if(B.lastIndex=0,B.test(N))F.push(I+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
+ `),D=R?`
3602
+ ${R}`:"";U.push(` \u2717 ${j}${w}
3603
+ \u2192 ${_}${D}`)}}if(U.length===0){y4.set(Q,"");return}let z=(B)=>{let j=`${process.cwd()}/`;return B.startsWith(j)?B.slice(j.length):B},H=`[STX] DOM API violation in ${J&&J!==Z?`${z(J)} (composed into ${z(Z)})`:z(Z)}:
3604
+ ${U.join(`
3616
3605
  `)}
3617
- Tip: prefer useRef(), navigate(), and composables for component code`;if(Y.failOnViolation)throw Error(z);else console.warn(z)}}jG();var S1="<!--PARENT_CONTENT_PLACEHOLDER-->";function n8($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function VG($,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(y4.set(Q,H),Y.failOnViolation)throw Error(H);else console.warn(H)}TG();var b1="<!--PARENT_CONTENT_PLACEHOLDER-->";function J2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function bG($,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(`
3618
3607
  `,J+2),J===-1)return-1;J+=1,Y=!0;continue}if(q==="/"&&$[J+1]==="*"){let U=$.indexOf("*/",J+2);if(U===-1)return-1;J=U+2,Y=!0;continue}if(q==="/"&&Y){let U=J+1,W=!1;while(U<X){let z=$[U];if(z==="\\"){U+=2;continue}if(z==="[")W=!0;else if(z==="]")W=!1;else if(z==="/"&&!W){U++;break}else if(z===`
3619
3608
  `){U=-1;break}U++}if(U===-1){J++,Y=!1;continue}while(U<X&&/[a-z]/.test($[U]))U++;J=U,Y=!1;continue}if(q==="'"||q==='"'){let U=q;J++;while(J<X){if($[J]==="\\"){J+=2;continue}if($[J]===U){J++;break}if($[J]===`
3620
- `)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 s8($){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 OG($){let Z=q5($,"data-stx-runtime");if(!Z)return $;let X=s8($);if(X===-1||X===Z.start)return $;let J=$.slice(Z.start,Z.end),Y=$.slice(0,Z.start)+$.slice(Z.end),Q=s8(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 Y5($,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 Y2($){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 yG($){let Z=Y5($,"data-stx-runtime");if(!Z)return $;let X=Y2($);if(X===-1||X===Z.start)return $;let J=$.slice(Z.start,Z.end),Y=$.slice(0,Z.start)+$.slice(Z.end),Q=Y2(Y);if(Q===-1)return J+`
3621
3610
  `+Y;return Y.slice(0,Q)+J+`
3622
- `+Y.slice(Q)}async function I4($,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=Q1($,X);let Q=!Z.__stxProcessingDepth;if(Q)c4(Z);if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!O5()&&!o5())&&X&&X.endsWith(".stx"))$2($,X);try{return await K7.timeAsync("template-processing",async()=>{let G=await FG($,Z,X,J,Y);if(Q)G=M4(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let q=J.app?.head||{},W=(Z.__stx_runtime_head||null)??e8(),z=(Z.__stx_head_raw||"").trim(),K,H=z.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)K=H[1].trim(),z=z.replace(H[0],"").trim();let B=Z.__sections?.title,j=W.title||K||B,_=!W.title&&(!!K||!!B),F=W.meta||[],V=new Set(F.map((N)=>a1(N)).filter(Boolean)),O={...q,...j&&{title:j},meta:[...(q.meta||[]).filter((N)=>!V.has(a1(N))),...F],link:[...q.link||[],...W.link||[]],script:[...q.script||[],...W.script||[]],headRaw:[q.headRaw,z].filter(Boolean).join(`
3623
- `),...W.htmlAttrs&&{htmlAttrs:m9(q.htmlAttrs,W.htmlAttrs)},...W.bodyAttrs&&{bodyAttrs:{...q.bodyAttrs||{},...W.bodyAttrs}}},L=t3(G);if(G=i9(G,O,{..._&&{titleIsHtml:!0},...J.app?.colorMode&&{colorMode:J.app.colorMode}}),L)G=p9(G,q),G=l9(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let N=w[1],T=a8(N);G=G.replace(/<head\b[^>]*>/i,(A)=>`${A}
3624
- <meta name="stx-layout" content="${n8(N)}">
3625
- <meta name="stx-layout-group" content="${n8(T)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?G1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=u1(G,(T,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=c9(G);let q=J.app?.colorMode;if(q)G=x9(G,q);G=h9(G),G=OG(G)}if(Q)try{let{getStoreScript:q}=await o("stx/store-loader",()=>import("./chunk-xmrwskw2.js")),U=J.storesDir,W=await q(U);if(W){let z=`<script data-stx-stores>${W}</script>`,K=q5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3626
- `+z+G.slice(K.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await o("stx/framework-composables",()=>import("./chunk-a5sn113x.js")),U=await q(G);if(U){let W=q5(G,"data-stx-stores")||q5(G,"data-stx-runtime");if(W)G=G.slice(0,W.end)+`
3627
- `+U+G.slice(W.end)}}catch{}if(Q)try{let{getComposableScript:q}=await o("stx/composable-loader",()=>import("./chunk-mjbsb088.js")),U=J.composablesDir,W=await q(U,G);if(W){let z=`<script data-stx-composables>${W}</script>`,K=q5(G,"data-stx-stores")||q5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3628
- `+z+G.slice(K.end)}}catch{}if(Q)G=g9(G);if(Q&&Z.__stx_inject_css!==!1)G=await t8(G,void 0,J.buildMode==="serve");if(Q)G=f9(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof t5)throw G;let q=G instanceof Error?G.message:String(G),U=new D1(`Template processing failed: ${q}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(l0.log(U,{filePath:X,context:Z}),W3.logDetailedError(U,{filePath:X,template:$.substring(0,500)}),J.debug)throw U;return q3.createFallbackContent("Template Processing",U)}}async function FG($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!T0.isAbsolute(J.partialsDir)?T0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!T0.isAbsolute(J.componentsDir)?T0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!T0.isAbsolute(J.layoutsDir)?T0.resolve(Q,J.layoutsDir):J.layoutsDir},q=G,U=$;await RG(X,Z),wG(Z,q),U=await c1(()=>L9(U,Z,X,q),U,(L)=>{l0.log(L,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${L.message}`)}),U=U.replace(/\{\{--[\s\S]*?--\}\}/g,"");let W=n0(U,z5,(L,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);U=W.output;let z=W.tokens,K=(L)=>z.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>z[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";U=U.replace(/@@/g,H),U=U.replace(/@\{\{([\s\S]*?)\}\}/g,(L,w)=>{return`{{ ${w} }}`}),U=I9(U),U=await m8(U,X,Y);let B={};U=m3(U,B);let j={...Z.__sections||{}},_="",F=I7(T7($)),V=/@nolayout\b/.test(U)||F===!1;if(/@nolayout\b/.test(U))U=U.replace(/@nolayout\b\s*/g,"");let O=U.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],U=U.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof F==="string"){if(_=F,!/@section\s*\(/.test(U))U=`@section('content')
3611
+ `+Y.slice(Q)}async function C4($,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)r4(Z);if(!Z.__stxProcessingDepth)Z.__stxProcessingDepth=0;if(Z.__stxProcessingDepth++,!Z.__onceStore)Z.__onceStore=new Set;if((J.debug||!j5()&&!t5())&&X&&X.endsWith(".stx"))K2($,X);try{return await U2.timeAsync("template-processing",async()=>{let G=await SG($,Z,X,J,Y);if(Q)G=b4(G);if(Q&&J.autoShell&&J.buildMode!=="compile"){let q=J.app?.head||{},W=(Z.__stx_runtime_head||null)??z2(),z=(Z.__stx_head_raw||"").trim(),K,H=z.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(H)K=H[1].trim(),z=z.replace(H[0],"").trim();let B=Z.__sections?.title,j=W.title||K||B,_=!W.title&&(!!K||!!B),L=W.meta||[],V=new Set(L.map((N)=>n1(N)).filter(Boolean)),O={...q,...j&&{title:j},meta:[...(q.meta||[]).filter((N)=>!V.has(n1(N))),...L],link:[...q.link||[],...W.link||[]],script:[...q.script||[],...W.script||[]],headRaw:[q.headRaw,z].filter(Boolean).join(`
3612
+ `),...W.htmlAttrs&&{htmlAttrs:t9(q.htmlAttrs,W.htmlAttrs)},...W.bodyAttrs&&{bodyAttrs:{...q.bodyAttrs||{},...W.bodyAttrs}}},F=J4(G);if(G=X8(G,O,{..._&&{titleIsHtml:!0},...J.app?.colorMode&&{colorMode:J.app.colorMode}}),F)G=Z8(G,q),G=e9(G,O.htmlAttrs);let w=G.match(/<!-- stx-layout: ([^ ]+) -->/);if(w&&G.includes("<head")){let N=w[1],I=q2(N);G=G.replace(/<head\b[^>]*>/i,(A)=>`${A}
3613
+ <meta name="stx-layout" content="${J2(N)}">
3614
+ <meta name="stx-layout-group" content="${J2(I)}">`)}let R=G.match(/function (__stx_setup_\w+)\(/),D=R?q1(G):null;if(R&&D&&!/\bdata-stx=/.test(D.tag)){G=P1(G,(I,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=$8(G);let q=J.app?.colorMode;if(q)G=n9(G,q);G=o9(G),G=yG(G)}if(Q)try{let{getStoreScript:q}=await s("stx/store-loader",()=>import("./chunk-ykxs16y7.js")),U=J.storesDir,W=await q(U);if(W){let z=`<script data-stx-stores>${W}</script>`,K=Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3615
+ `+z+G.slice(K.end)}}catch{}if(Q)try{let{getFrameworkComposableScript:q}=await s("stx/framework-composables",()=>import("./chunk-4wnnet1k.js")),U=await q(G);if(U){let W=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(W)G=G.slice(0,W.end)+`
3616
+ `+U+G.slice(W.end)}}catch{}if(Q)try{let{getComposableScript:q}=await s("stx/composable-loader",()=>import("./chunk-d3v3p15c.js")),U=J.composablesDir,W=await q(U,G);if(W){let z=`<script data-stx-composables>${W}</script>`,K=Y5(G,"data-stx-stores")||Y5(G,"data-stx-runtime");if(K)G=G.slice(0,K.end)+`
3617
+ `+z+G.slice(K.end)}}catch{}if(Q)G=s9(G);if(Q&&Z.__stx_inject_css!==!1)G=await W2(G,void 0,J.buildMode==="serve");if(Q)G=c9(G);return G=G.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),G})}catch(G){if(G instanceof Z$)throw G;let q=G instanceof Error?G.message:String(G),U=new L1(`Template processing failed: ${q}`,X,void 0,void 0,$.substring(0,200)+($.length>200?"...":""));if(i0.log(U,{filePath:X,context:Z}),j3.logDetailedError(U,{filePath:X,template:$.substring(0,500)}),J.debug)throw U;return H3.createFallbackContent("Template Processing",U)}}async function SG($,Z,X,J,Y){let Q=process.cwd(),G={...J,partialsDir:J.partialsDir&&!A0.isAbsolute(J.partialsDir)?A0.resolve(Q,J.partialsDir):J.partialsDir,componentsDir:J.componentsDir&&!A0.isAbsolute(J.componentsDir)?A0.resolve(Q,J.componentsDir):J.componentsDir,layoutsDir:J.layoutsDir&&!A0.isAbsolute(J.layoutsDir)?A0.resolve(Q,J.layoutsDir):J.layoutsDir},q=G,U=$;await vG(X,Z),PG(Z,q),U=await g1(()=>A9(U,Z,X,q),U,(F)=>{i0.log(F,{filePath:X,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${X}: ${F.message}`)}),U=U.replace(/\{\{--[\s\S]*?--\}\}/g,"");let W=o0(U,q5,(F,w)=>`\x00STX_HTML_COMMENT_${w}\x00`);U=W.output;let z=W.tokens,K=(F)=>z.length===0?F:F.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(w,R)=>z[Number(R)]??""),H="\x00STX_ESCAPED_AT\x00";U=U.replace(/@@/g,H),U=U.replace(/@\{\{([\s\S]*?)\}\}/g,(F,w)=>{return`{{ ${w} }}`}),U=S9(U),U=await t8(U,X,Y);let B={};U=n3(U,B);let j={...Z.__sections||{}},_="",L=S7(y7($)),V=/@nolayout\b/.test(U)||L===!1;if(/@nolayout\b/.test(U))U=U.replace(/@nolayout\b\s*/g,"");let O=U.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(O)_=O[1],U=U.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof L==="string"){if(_=L,!/@section\s*\(/.test(U))U=`@section('content')
3629
3618
  ${U.trim()}
3630
- @endsection`}if(!_&&!V&&q.defaultLayout){let L=a3(U),w=/@section\s*\(/.test(U);if(!L||w){let R="",D=T0.dirname(X),N=q.layoutsDir?T0.dirname(q.layoutsDir):process.cwd();for(let T=0;T<20;T++){let A=T0.join(D,"_layout.stx");if(await a(A)){R=A;break}let M=T0.dirname(D);if(M===D||M.length<N.length)break;D=M}if(R)_=R;else if(q.layoutsDir){let T=T0.isAbsolute(q.layoutsDir)?q.layoutsDir:T0.resolve(process.cwd(),q.layoutsDir),A=T0.join(T,`${q.defaultLayout}.stx`);if(await a(A))_=A}if(_&&!w)U=`@section('content')
3619
+ @endsection`}if(!_&&!V&&q.defaultLayout){let F=X4(U),w=/@section\s*\(/.test(U);if(!F||w){let R="",D=A0.dirname(X),N=q.layoutsDir?A0.dirname(q.layoutsDir):process.cwd();for(let I=0;I<20;I++){let A=A0.join(D,"_layout.stx");if(await t(A)){R=A;break}let M=A0.dirname(D);if(M===D||M.length<N.length)break;D=M}if(R)_=R;else if(q.layoutsDir){let I=A0.isAbsolute(q.layoutsDir)?q.layoutsDir:A0.resolve(process.cwd(),q.layoutsDir),A=A0.join(I,`${q.defaultLayout}.stx`);if(await t(A))_=A}if(_&&!w)U=`@section('content')
3631
3620
  ${U.trim()}
3632
- @endsection`}}if(U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,w,R)=>{return j[w]=R,""}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,w,R)=>{if(/^(['"]).*\1$/.test(R.trim()))return L;try{let D=t(R.trim(),Z);if(D===void 0)return L;return j[w]=String(D??""),""}catch{return L}}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,w,R)=>{if(R.includes("@parent"))j[w]=R.replace("@parent",S1);else j[w]=R.trim();return""}),Z.__sections=j,U=U.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,w,R)=>{return j[w]||R||""}),!("slot"in Z)||Z.slot===void 0)U=U.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""});if(U=l3(U,B),_){let L=[],w=s0(U),R=n0(w.output,f1,(D,N)=>`\x00STX_ORPHAN_STYLE_${N}\x00`);if(U=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,N,T)=>{let A=N==="SCRIPT"?w.scripts[Number(T)]:R.tokens[Number(T)];if(A)L.push(A);return""}),L.length>0){let D=L.join(`
3621
+ @endsection`}}if(U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(F,w,R)=>{return j[w]=R,""}),U=U.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 j[w]=String(D??""),""}catch{return F}}),U=U.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(F,w,R)=>{if(R.includes("@parent"))j[w]=R.replace("@parent",b1);else j[w]=R.trim();return""}),Z.__sections=j,U=U.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(F,w,R)=>{return j[w]||R||""}),!("slot"in Z)||Z.slot===void 0)U=U.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""});if(U=s3(U,B),_){let F=[],w=r0(U),R=o0(w.output,S1,(D,N)=>`\x00STX_ORPHAN_STYLE_${N}\x00`);if(U=R.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(D,N,I)=>{let A=N==="SCRIPT"?w.scripts[Number(I)]:R.tokens[Number(I)];if(A)F.push(A);return""}),F.length>0){let D=F.join(`
3633
3622
  `);j.content=j.content?`${j.content}
3634
- ${D}`:D,Z.__sections=j}}if(_)try{let L;if(T0.isAbsolute(_))L=_,Y.add(_);else L=await c1(()=>Z$(_,X,G,Y),null,()=>{throw new D1(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!L){let A=(I)=>{if(!I)return[];try{let y=T0.isAbsolute(I)?I:T0.resolve(process.cwd(),I);return _G.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(),k=`Layout not found: ${_} (referenced from ${X})`+(M.length>0?`. Available layouts: ${M.join(", ")}`:G.layoutsDir?`. No .stx layouts found in ${G.layoutsDir}`:"");if(l0.log(Error(k),{layoutPath:_,filePath:X,available:M},"error"),console.error(`[stx] ${k}`),G.debug)throw new D1(k,X);return U}let w=await c1(()=>Bun.file(L).text(),"",()=>{throw new D1(`Failed to read layout file: ${L}`,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 ${L}`);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(j[y]&&j[y].includes(S1)){let b=j[y].indexOf(S1);j[y]=j[y].slice(0,b)+E+j[y].slice(b+S1.length)}else if(!j[y])j[y]=E;let k={...Z,__sections:j},I=`@layout('${R[1]}')${M}`;return await I4(I,k,L,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=m3(D,B),T={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(A,M,k)=>{return T[M]=k.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(A,M,k)=>{if(j[M]){let I=j[M];if(I.includes(S1)){let y=T[M]||"",E=I.indexOf(S1);I=I.slice(0,E)+y+I.slice(E+S1.length)}return I}return k||""}),N=LG(N,j),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""}),N=l3(N,B),Z.__originalFilePath=X,U=await o8(N,Z,L,G,Y),U=`<!-- stx-layout: ${_} -->
3635
- ${U}`,K(U)}catch(L){return l0.log(L instanceof Error?L:Error(String(L)),{layoutPath:_,filePath:X},"error"),`[Error processing layout: ${L instanceof Error?L.message:String(L)}]`}return K(await o8(U,Z,X,G,Y))}function LG($,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 wG($,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 RG($,Z){await c1(()=>D9($,Z),void 0,(X)=>{l0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function DG($,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:U}=await o("stx/variable-extractor",()=>import("./chunk-fenb3cqw.js"));await U(G,Z,X,{preserveExisting:!0})}catch(U){let W=U instanceof Error?U:Error(String(U));l0.log(W,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${W.message}`)}}}async function NG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await o("stx/expressions",()=>import("./chunk-0x022m9m.js"));return J($,Z,{skipServer:!0})}catch(J){let Y=J instanceof Error?J:Error(String(J));return l0.log(Y,{filePath:X,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${X}: ${Y.message}`),$}}async function o8($,Z,X,J,Y){let Q=$,G=J;if(await DG(Q,Z,X),Q=await NG(Q,Z,X),Q=await G9(Q,Z,X),Q=await q9(Q,Z,X),Q=await l6(Q,Z,X,G),Q1(Q))Q=W8(Q,Z),Q=H8(Q,Z);Q=K8(Q);let{processStreamDirectives:q}=await o("stx/streaming",()=>import("./chunk-2pavh1yg.js"));Q=q(Q,Z),Q=j9(Q,Z,X,G),Q=await y9(Q,Z,X,G,Y),Q=await D4(Q,Z,X,G,Y),Q=M7(Q,Z,X,G);let{processDeferDirectives:U}=await o("stx/defer",()=>import("./chunk-m8hggrdc.js"));Q=U(Q,Z,X);let{processTeleportDirectives:W}=await o("stx/teleport",()=>import("./chunk-gyga6sjp.js"));Q=W(Q,Z,X);let{processTransitionDirectives:z,processTransitionAttributes:K}=await o("stx/transitions",()=>import("./chunk-6vqb54c8.js"));Q=z(Q,Z,X),Q=K(Q);let{processErrorBoundaryDirectives:H}=await o("stx/error-boundaries",()=>import("./chunk-c59rkxwf.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:B}=await o("stx/suspense",()=>import("./chunk-chsfdfqm.js"));Q=B(Q,Z,X);let{processAsyncDirectives:j}=await o("stx/async-components",()=>import("./chunk-xr1758xj.js"));Q=j(Q,Z,X);let{processKeepAliveDirectives:_}=await o("stx/keep-alive",()=>import("./chunk-b3f5dwzz.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:F,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await o("stx/virtual-scrolling",()=>import("./chunk-gpt6ggxj.js"));Q=F(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:L,processStaticDirectives:w}=await o("stx/partial-hydration",()=>import("./chunk-jq375v8t.js"));Q=L(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await o("stx/computed",()=>import("./chunk-gg2en16q.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await o("stx/forms-validation",()=>import("./chunk-95mj2e8x.js"));Q=N(Q,Z,X);let{processHeadDirective:T,processTitleDirective:A,processMetaDirective:M,resetHead:k}=await o("stx/head",()=>import("./chunk-nteg247p.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)k();let I=T(Q);if(Q=I.content,I.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${I.headContent}
3636
- `;if(Q=A(Q,Z),Q=M(Q,Z),Q=R9(Q),Q=D3(Q,Z),Q=m6(Q),Q=O9(Q),Q=await d3(Q,Z,X,G,Y),Q=await D4(Q,Z,X,G,Y),Z.__stxProcessingDepth===1)Q=i4(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=M4(Q),Q=$1(Q,Z,X),Q=E7(Q,Z,{filePath:X,buildMode:G.buildMode}),Q=N3(Q,Z),Q=A3(Q,Z),Q=N5(Q,Z),Q=y3(Q,Z),Q=S3(Q,Z),Q=await E6(Q,Z,X,G),Q=await f7(Q,Z,X),Q=await $9(Q,Z,X,G),Q=r8(Q,Z,X,G),Q=j6(Q,Z,X,G),Q=_6(Q,Z,X),Q=V6(Q,Z,X,G),Q=u6(Q,Z,X,G),Q=N4(Q,Z),Q=A4(Q),Q=l8(Q),!G.skipEventDirectives)Q=m4(Q,Z,X);if(Q=S7(Q,Z,X),G.debug){let i=/\bx-data\s*=/.test(Q),Z0=Q4($);if(i&&Z0)console.warn(`[stx] ${X}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3623
+ ${D}`:D,Z.__sections=j}}if(_)try{let F;if(A0.isAbsolute(_))F=_,Y.add(_);else F=await g1(()=>Y$(_,X,G,Y),null,()=>{throw new L1(`Failed to resolve layout path: ${_}`,X,void 0,void 0,`Layout referenced from ${X}`)});if(!F){let A=(k)=>{if(!k)return[];try{let y=A0.isAbsolute(k)?k:A0.resolve(process.cwd(),k);return EG.readdirSync(y).filter((E)=>E.endsWith(".stx")).map((E)=>E.replace(/\.stx$/,""))}catch{return[]}},M=[...A(G.layoutsDir),...A(G.fallbackLayoutsDir)].filter((k,y,E)=>E.indexOf(k)===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 L1(T,X);return U}let w=await g1(()=>Bun.file(F).text(),"",()=>{throw new L1(`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(j[y]&&j[y].includes(b1)){let b=j[y].indexOf(b1);j[y]=j[y].slice(0,b)+E+j[y].slice(b+b1.length)}else if(!j[y])j[y]=E;let T={...Z,__sections:j},k=`@layout('${R[1]}')${M}`;return await C4(k,T,F,G,Y)}let D=w.replace(/\{\{--[\s\S]*?--\}\}/g,""),N=n3(D,B),I={};return N=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(A,M,T)=>{return I[M]=T.trim(),`@slot('${M}')`}),N=N.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(A,M,T)=>{if(j[M]){let k=j[M];if(k.includes(b1)){let y=I[M]||"",E=k.indexOf(b1);k=k.slice(0,E)+y+k.slice(E+b1.length)}return k}return T||""}),N=CG(N,j),N=N.replace(/\{\{\s*slot\s*\}\}/g,()=>{return j.content||""}),N=s3(N,B),Z.__originalFilePath=X,U=await Q2(N,Z,F,G,Y),U=`<!-- stx-layout: ${_} -->
3624
+ ${U}`,K(U)}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 K(await Q2(U,Z,X,G,Y))}function CG($,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 PG($,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 vG($,Z){await g1(()=>k9($,Z),void 0,(X)=>{i0.log(X,{filePath:$,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${$}: ${X.message}`)})}async function fG($,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:U}=await s("stx/variable-extractor",()=>import("./chunk-7cts329z.js"));await U(G,Z,X,{preserveExisting:!0})}catch(U){let W=U instanceof Error?U:Error(String(U));i0.log(W,{filePath:X,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${X}: ${W.message}`)}}}async function xG($,Z,X){try{let{interpolateScriptsInTemplate:J}=await s("stx/expressions",()=>import("./chunk-cd4v7xyr.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 Q2($,Z,X,J,Y){let Q=$,G=J;if(await fG(Q,Z,X),Q=await xG(Q,Z,X),Q=await K9(Q,Z,X),Q=await H9(Q,Z,X),Q=await s6(Q,Z,X,G),G1(Q))Q=L8(Q,Z),Q=D8(Q,Z);Q=R8(Q);let{processStreamDirectives:q}=await s("stx/streaming",()=>import("./chunk-78bm61kd.js"));Q=q(Q,Z),Q=L9(Q,Z,X,G),Q=await f9(Q,Z,X,G,Y),Q=await k4(Q,Z,X,G,Y),Q=b7(Q,Z,X,G);let{processDeferDirectives:U}=await s("stx/defer",()=>import("./chunk-ng1wyd2v.js"));Q=U(Q,Z,X);let{processTeleportDirectives:W}=await s("stx/teleport",()=>import("./chunk-wacr03x4.js"));Q=W(Q,Z,X);let{processTransitionDirectives:z,processTransitionAttributes:K}=await s("stx/transitions",()=>import("./chunk-k7n88ess.js"));Q=z(Q,Z,X),Q=K(Q);let{processErrorBoundaryDirectives:H}=await s("stx/error-boundaries",()=>import("./chunk-rc4zrsw3.js"));Q=H(Q,Z,X);let{processSuspenseDirectives:B}=await s("stx/suspense",()=>import("./chunk-shtemwbq.js"));Q=B(Q,Z,X);let{processAsyncDirectives:j}=await s("stx/async-components",()=>import("./chunk-6746wmsf.js"));Q=j(Q,Z,X);let{processKeepAliveDirectives:_}=await s("stx/keep-alive",()=>import("./chunk-9rdg7x9h.js"));Q=_(Q,Z,X);let{processVirtualListDirectives:L,processVirtualGridDirectives:V,processInfiniteListDirectives:O}=await s("stx/virtual-scrolling",()=>import("./chunk-1hhxj2r5.js"));Q=L(Q,Z,X),Q=V(Q,Z,X),Q=O(Q,Z,X);let{processPartialHydrationDirectives:F,processStaticDirectives:w}=await s("stx/partial-hydration",()=>import("./chunk-dhe8sp1a.js"));Q=F(Q,Z,X),Q=w(Q);let{processComputedDirectives:R,processWatchDirectives:D}=await s("stx/computed",()=>import("./chunk-qkbrbys7.js"));Q=R(Q,Z,X),Q=D(Q,Z,X);let{processFormValidationDirectives:N}=await s("stx/forms-validation",()=>import("./chunk-vrskjx64.js"));Q=N(Q,Z,X);let{processHeadDirective:I,processTitleDirective:A,processMetaDirective:M,resetHead:T}=await s("stx/head",()=>import("./chunk-278yw67q.js"));if(!Z.__stx_head_preset&&!Z.__stx_runtime_head)T();let k=I(Q);if(Q=k.content,k.headContent)Z.__stx_head_raw=`${Z.__stx_head_raw||""}${k.headContent}
3625
+ `;if(Q=A(Q,Z),Q=M(Q,Z),Q=I9(Q),Q=k3(Q,Z),Q=n6(Q),Q=D9(Q),Q=await i3(Q,Z,X,G,Y),Q=await k4(Q,Z,X,G,Y),Z.__stxProcessingDepth===1)Q=a4(Q,Z);if(Q=Q.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),Q=b4(Q),Q=X1(Q,Z,X),Q=P7(Q,Z,{filePath:X,buildMode:G.buildMode}),Q=T3(Q,Z),Q=E3(Q,Z),Q=w5(Q,Z),Q=f3(Q,Z),Q=x3(Q,Z),Q=await P6(Q,Z,X,G),Q=await d7(Q,Z,X),Q=await Q9(Q,Z,X,G),Q=G2(Q,Z,X,G),Q=L6(Q,Z,X,G),Q=w6(Q,Z,X),Q=R6(Q,Z,X,G),Q=p6(Q,Z,X,G),Q=T4(Q,Z),Q=E4(Q),Q=e8(Q),!G.skipEventDirectives)Q=o4(Q,Z,X);if(Q=x7(Q,Z,X),G.debug){let c=/\bx-data\s*=/.test(Q),p=z4($);if(c&&p)console.warn(`[stx] ${X}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
3637
3626
  Both work on the same page, but they manage separate scopes.
3638
- Prefer signals (state/derived/effect) for new components.`)}Q=M9(Q,Z),Q=await F1(Q,Z,X),Q=p8(Q),Q=i8(Q),Q=O7(Q);let{processXElementDirectives:y}=await o("stx/x-element",()=>import("./chunk-3fa6t4fw.js"));Q=y(Q);let E=Z.__originalFilePath||X,b=k$(Z);if(Q=await B8(Q,G,E,b),Q=n6(Q,Z),Q=await w9(Q,Z,X,G),G.media?.image?.autoSiblings){let i=G.publicDir||"public",{rewriteImagesWithSiblings:Z0}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-14cps421.js"));Q=await Z0(Q,{publicDir:i})}if(G.seo?.enabled)Q=O6(Q,Z,G);let C=(i,Z0,Y0=!0)=>{if(!Z0)return i;let A0=Z0.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),O0=i.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(A0&&O0){if(Y0)i=i.replace(O0[0],A0[0]);if(Z0=Z0.replace(A0[0],"").trim(),!Z0)return i}if(/<\/head>/i.test(i))return i.replace(/<\/head>/i,`${Z0}
3639
- </head>`);if(/<head\b[^>]*>/i.test(i))return i.replace(/(<head\b[^>]*>)/i,`$1
3640
- ${Z0}`);if(/<html\b[^>]*>/i.test(i))return i.replace(/(<html\b[^>]*>)/i,`$1
3627
+ Prefer signals (state/derived/effect) for new components.`)}Q=b9(Q,Z),Q=await V1(Q,Z,X),Q=Z2(Q),Q=X2(Q),Q=D7(Q);let{processXElementDirectives:y}=await s("stx/x-element",()=>import("./chunk-9gzmcxzg.js"));Q=y(Q);let E=Z.__originalFilePath||X,b=y$(Z);if(Q=await N8(Q,G,E,b),Q=t6(Q,Z),Q=await M9(Q,Z,X,G),G.media?.image?.autoSiblings){let c=G.publicDir||"public",{rewriteImagesWithSiblings:p}=await s("stx/image-optimization/auto-sibling",()=>import("./chunk-7kkc13rc.js"));Q=await p(Q,{publicDir:c})}if(G.seo?.enabled)Q=D6(Q,Z,G);let S=(c,p,U0=!0)=>{if(!p)return c;let Q0=p.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),D0=c.match(/<title\b[^>]*>[\s\S]*?<\/title>/i);if(Q0&&D0){if(U0)c=c.replace(D0[0],Q0[0]);if(p=p.replace(Q0[0],"").trim(),!p)return c}if(/<\/head>/i.test(c))return c.replace(/<\/head>/i,`${p}
3628
+ </head>`);if(/<head\b[^>]*>/i.test(c))return c.replace(/(<head\b[^>]*>)/i,`$1
3629
+ ${p}`);if(/<html\b[^>]*>/i.test(c))return c.replace(/(<html\b[^>]*>)/i,`$1
3641
3630
  <head>
3642
- ${Z0}
3643
- </head>`);return i},{renderHead:h,getHead:x}=await o("stx/head",()=>import("./chunk-nteg247p.js")),d=Z.__stx_runtime_head??x();if(d.title||d.meta?.length||d.link?.length){let i=h(d);if(i)Q=C(Q,i)}if(I.headContent)Q=C(Q,I.headContent,!d.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=g6(Q,G.csp,Z);if(G.analytics?.enabled)Q=L7(Q,G);if(G.heatmap?.enabled)Q=R7(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:i}=await o("stx/pwa/inject",()=>import("./chunk-3wwnx5d4.js"));Q=i(Q,G)}let _0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),h0=/\bSTX\.\w+/.test(Q),D0=/window\.STX\s*=/.test(Q);if(_0&&h0&&!D0){let Z0=`<script data-stx-scoped data-stx-run="once">
3644
- ${j7()}
3645
- </script>`;if(Q.includes("</head>")){let Y0=Q.indexOf("</head>"),O0=Q.slice(0,Y0).indexOf("<script");if(O0!==-1){let i0=Q.slice(0,O0),j1=Q.slice(O0);Q=i0+Z0+`
3646
- `+j1}else Q=Q.replace("</head>",`${Z0}
3631
+ ${p}
3632
+ </head>`);return c},{renderHead:f,getHead:g}=await s("stx/head",()=>import("./chunk-278yw67q.js")),u=Z.__stx_runtime_head??g();if(u.title||u.meta?.length||u.link?.length){let c=f(u);if(c)Q=S(Q,c)}if(k.headContent)Q=S(Q,k.headContent,!u.title);if(G.csp?.enabled&&G.csp.addMetaTag)Q=l6(Q,G.csp,Z);if(G.analytics?.enabled)Q=A7(Q,G);if(G.heatmap?.enabled)Q=I7(Q,G);if(G.pwa?.enabled&&G.pwa.autoInject!==!1){let{injectPwaTags:c}=await s("stx/pwa/inject",()=>import("./chunk-5htqgzbb.js"));Q=c(Q,G)}let K0=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(Q),e0=/\bSTX\.\w+/.test(Q),M0=/window\.STX\s*=/.test(Q);if(K0&&e0&&!M0){let p=`<script data-stx-scoped data-stx-run="once">
3633
+ ${L7()}
3634
+ </script>`;if(Q.includes("</head>")){let U0=Q.indexOf("</head>"),D0=Q.slice(0,U0).indexOf("<script");if(D0!==-1){let P0=Q.slice(0,D0),G5=Q.slice(D0);Q=P0+p+`
3635
+ `+G5}else Q=Q.replace("</head>",`${p}
3647
3636
  </head>`)}else if(Q.includes("<body"))Q=Q.replace(/<body([^>]*)>/,`<body$1>
3648
- ${Z0}`);else Q=Z0+`
3649
- `+Q}{let{scanScriptTags:i}=await o("stx/signal-processing",()=>import("./chunk-8raem8ng.js")),Z0=[];for(let Y0 of i(Q)){if(!/\bserver\b/i.test(Y0.attrs))continue;let A0=Y0.start+Y0.fullMatch.indexOf(">")+1,O0=VG(Q,A0);if(O0===-1)continue;let i0=O0+9;while(i0<Q.length&&/\s/.test(Q[i0]))i0++;Z0.push({start:Y0.start,end:i0})}for(let Y0=Z0.length-1;Y0>=0;Y0--){let{start:A0,end:O0}=Z0[Y0];Q=Q.substring(0,A0)+Q.substring(O0)}}let y0=_$(Q,X);if(y0.hasScoped)Q=y0.html;let X0=Z.__stx_event_bindings||[],J0=!1,N0=[],z0=/\s:[a-z][\w.-]*\s*=/.test(Q),{scanScriptTags:W5}=await o("stx/signal-processing",()=>import("./chunk-8raem8ng.js"));for(let i of W5(Q,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))N0.push({match:i.fullMatch,attrs:i.attrs,content:i.body});for(let{match:i,attrs:Z0,content:Y0}of N0){J0=!0;let A0=Y0;T4(Y0,X,J.strict,Z.__originalFilePath);let O0=await E$(Y0,{eventBindings:X0,attrs:Z0,hasColonDirectives:z0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(i,()=>O0)}if(J0)Z.__stx_event_bindings=[];if(!J0&&Z.__stxProcessingDepth===1){let i=Z.__stx_event_bindings||[];if(i.length>0){let Z0=P$(i);if(Z0){let Y0=Q.lastIndexOf("</body>");Q=Y0===-1?Q+Z0:Q.slice(0,Y0)+Z0+`
3650
- `+Q.slice(Y0)}Z.__stx_event_bindings=[]}}if(!t9(Q)&&e9(Q))Q=await L$(Q,G);if(Q=$8(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=h6(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"}],MG=[{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 IG($){let Z=[],X=[];return kG($,Z),EG($,Z,X),bG($,X),yG($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function kG($,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 EG($,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 U=new RegExp(J.altClose,"g");q+=($.match(U)||[]).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 bG($,Z){for(let X of MG)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function yG($,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 SG($,Z){let X=$.slice(0,Z).split(`
3651
- `);return{line:X.length,column:X[X.length-1].length+1}}function CG($,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 PG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function vG($){let Z=$.matchAll(/@([a-z]+)/gi),X=new Set;for(let J of Z){let Y=J[1].toLowerCase();if(!Y.startsWith("end"))X.add(Y)}return Array.from(X)}import r0 from"path";import U5 from"process";var U2=["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"],Z2=new Set(U2),fG=new Set(["props","$props","defineProps"]),xG=new Set(["stx","@stacksjs/stx"]);function gG($){let Z=[],X=0,J=$.split(`
3652
- `);for(let Y of J){let Q=X,G=null,q=!1;for(let U=0;U<Y.length;U++){let W=Y[U];if(q){q=!1;continue}if(W==="\\"){q=!0;continue}if(G){if(W===G)G=null;continue}if(W==="'"||W==='"'||W==="`"){G=W;continue}if(W==="/"&&U+1<Y.length&&Y[U+1]==="/")break;if(W==="{")X++;else if(W==="}")X--}if(Q===0){let U=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(U)Z.push(U[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let W=Y.match(/(?:const|let|var)\s+(\w+)/);if(W)Z.push(W[1])}else{let W=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(W){let K=W[1].slice(1,-1).split(",").map((H)=>{let B=H.split(":");return(B.length>1?B[1]:B[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...K)}}}}return[...new Set(Z)]}function hG($){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,U=null;for(let W=0;W<J.length;W++){let z=J[W];if(U){if(Q+=z,z===U)U=null;continue}if(z==='"'||z==="'"||z==="`"){U=z,Q+=z;continue}if(z==="<")G++;else if(z===">"&&G>0)G--;else if(z==="(")q++;else if(z===")")q--;if(z===","&&G===0&&q===0){Y.push(Q),Q="";continue}Q+=z}if(Q)Y.push(Q);return Y.map((W)=>{let z=W.trim(),K=z.startsWith("..."),H=K?z.slice(3):z,B=-1,j=0;for(let R=0;R<H.length;R++)if(H[R]==="<")j++;else if(H[R]===">")j--;else if(H[R]===":"&&j===0){B=R;break}if(B===-1)return W;let F=H.substring(0,B).trim().replace(/\?$/,""),V=H.substring(B+1),O=-1,L=0;for(let R=0;R<V.length;R++)if(V[R]==="<")L++;else if(V[R]===">")L--;else if(V[R]==="="&&L===0){O=R;break}let w=K?"...":"";if(O!==-1)return`${w}${F} = ${V.substring(O+1).trim()}`;return`${w}${F}`}).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,U=G+1,W=0,z=null;while(U<Z.length&&q>0){let B=Z[U];if(z){if(B===z)z=null;U++;continue}if(B==='"'||B==="'"||B==="`"){z=B,U++;continue}if(B==="<")W++;else if(B===">"&&W>0)W--;else if(W===0){if(B==="(")q++;else if(B===")")q--}if(q>0)U++}if(q!==0)continue;let K=Z.substring(G+1,U);if(!K.includes(":"))continue;let H=X(K);Q.push({start:G+1,end:U,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:q,end:U,replacement:W}=Q[G];Z=Z.substring(0,q)+W+Z.substring(U)}}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,...U]=G.split("="),W=q.split(":")[0].trim();if(U.length>0)return`${W} = ${U.join("=").trim()}`;return W}).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,`
3653
-
3654
- `),Z}function uG($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function dG($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function mG($,Z,X,J={}){if(!$.trim())return;let Y;try{let S=E4({loader:"ts",target:"browser",define:Q5()}),v=$.replace(/^\s*import\s+\w+\s+from\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,"");v=v.replace(/^\s*import\s+['"][^'"]*\.stx['"]\s*;?\s*$/gm,""),Y=S.transformSync(v)}catch{Y=hG($)}let Q={exports:{}},G=Q.exports,q=U5.cwd(),U={},W=[...Y.matchAll(/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g)||[]].map((S)=>S[1]).filter((S)=>!S.startsWith("node:")&&!["fs","path","os","child_process","crypto","http","https","url","util","stream","events","buffer","net","querystring","zlib","tls"].includes(S)),z=new Map;for(let S of W)try{if(S.startsWith(".")){U[S]=await import(r0.resolve(r0.dirname(X),S));continue}let v=r0.resolve(q,"node_modules",S),n=r0.join(v,"package.json"),m=JSON.parse(f("fs").readFileSync(n,"utf8")),P=m.main||"index.js";if(m.exports){let u=typeof m.exports==="string"?m.exports:m.exports["."];if(typeof u==="string")P=u;else if(u?.bun)P=u.bun;else if(u?.import)P=u.import;else if(u?.default)P=u.default}U[S]=await import(r0.resolve(v,P))}catch(v){if(S.startsWith("."))z.set(S,v instanceof Error?v.message:String(v))}let K=(S)=>{if(U[S])return U[S];let v=z.get(S);if(v!==void 0)throw Error(`Cannot require '${S}' from ${X}: ${v}`);return f(S)},H=Z.props||{},B=(S)=>{if(!S)return H;let v={};for(let[n,m]of Object.entries(S)){let P=H[n];if(P!==void 0)v[n]=P;else if(typeof m==="function")v[n]=m();else v[n]=m}return v};for(let[S,v]of Object.entries(H))Object.defineProperty(B,S,{value:v,enumerable:!0,configurable:!0,writable:!0});for(let S of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(H,S))continue;try{Object.defineProperty(B,S,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let j=(S)=>{if(!S)return H;let v={...H};for(let[n,m]of Object.entries(S)){let P=m&&typeof m==="object"&&!Array.isArray(m)?m:{type:m};if(v[n]===void 0&&P.default!==void 0)v[n]=typeof P.default==="function"?P.default():P.default}return v},_=()=>Z.slots||{},F=(S,v)=>{let n={...S};for(let[m,P]of Object.entries(v))if(n[m]===void 0)if(typeof P==="function")n[m]=P();else n[m]=P;return n},V=(S)=>{let v=()=>S;return v.set=(n)=>{},v.update=(n)=>{},v},O=(S)=>{let v,n=!1;return()=>{if(!n)try{v=S(),n=!0}catch{v=void 0}return v}},L=(S)=>{},w=(S)=>S(),R=(S)=>{},D=(S)=>{},N=k7(Z);function T(S){let v=S||{};if(v.title!==void 0||v.description!==void 0)y({title:v.title,description:v.description})}function A(S){if(!S||typeof S!=="object")return;let v=Z.__stxClientPayload??{};Object.assign(v,S),Z.__stxClientPayload=v}let M=()=>{let S=Z.__stxServeContext,v=Z.__stxServeSearch??S?.search??"",n=S?.path??"",m=Object.fromEntries(new URLSearchParams(v)),P=Z.query,u=Object.keys(m).length>0?m:P??{},Q0=v||(Object.keys(u).length>0?`?${new URLSearchParams(u).toString()}`:"");return{params:Z.params??{},query:u,path:n,name:"",fullPath:n+Q0,hash:"",matched:[]}},k=()=>({push:(S)=>{},replace:(S)=>{},back:()=>{},forward:()=>{},go:(S)=>{}}),I=(S)=>{let v=Z.__stx_runtime_head||{};Z.__stx_runtime_head=$$(v,S||{})},y=(S)=>{I(q2(S||{}))},E=(S)=>({value:S}),b=(S)=>S,C=(S)=>({value:typeof S==="function"?S():S}),h=(S,v)=>{},x=(S)=>{},l=(S)=>{},d=(S)=>S?S():Promise.resolve(),_0=(S)=>(v,...n)=>{},h0=(S)=>{},D0=(S,v)=>{},y0=(S,v)=>v,X0=()=>({value:"light"}),J0=()=>V(!1),N0=(S)=>V(!1),z0=()=>V(!1),W5=()=>N0("(prefers-color-scheme: dark)"),i=()=>N0("(prefers-color-scheme: light)"),Z0=()=>N0("(prefers-reduced-motion: reduce)"),Y0=()=>N0("(prefers-contrast: more)"),A0={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:{}},O0=new Proxy(A0,{get(S,v){if(v in S)return S[v];return},set(S,v,n){return S[v]=n,!0}}),i0={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},j1=console;try{let S=W2(Y,X),v=new Set(Object.keys(H)),n=(s)=>/^[a-z_$][\w$]*$/i.test(s),m=Object.keys(Z).filter((s)=>!v.has(s)&&!fG.has(s)&&n(s)),P=m.map((s)=>Z[s]);if(!m.includes("__stxServeContext"))m.push("__stxServeContext"),P.push(void 0);let u=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"]),Q0=[],r=[];for(let[s,u0]of Object.entries(H)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))continue;if(u.has(s))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${s}\\b`).test(S))continue;Q0.push(s),r.push(u0)}let L0=gG(S).map((s)=>`module.exports.${s} = typeof ${s} !== 'undefined' ? ${s} : module.exports.${s};`).join(`
3655
- `),v0=Z.params??{},a0=[],H0=[];for(let s=0;s<m.length;s++){if(m[s]==="params")continue;a0.push(m[s]),H0.push(P[s])}let _1=await Function(...U2,...Q0,...a0,`return (async () => {
3656
- ${S}
3657
- ${L0}
3637
+ ${p}`);else Q=p+`
3638
+ `+Q}{let{scanScriptTags:c}=await s("stx/signal-processing",()=>import("./chunk-q5et8k2d.js")),p=[];for(let U0 of c(Q)){if(!/\bserver\b/i.test(U0.attrs))continue;let Q0=U0.start+U0.fullMatch.indexOf(">")+1,D0=bG(Q,Q0);if(D0===-1)continue;let P0=D0+9;while(P0<Q.length&&/\s/.test(Q[P0]))P0++;p.push({start:U0.start,end:P0})}for(let U0=p.length-1;U0>=0;U0--){let{start:Q0,end:D0}=p[U0];Q=Q.substring(0,Q0)+Q.substring(D0)}}let C0=F$(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 s("stx/signal-processing",()=>import("./chunk-q5et8k2d.js"));for(let c 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:c.fullMatch,attrs:c.attrs,content:c.body});for(let{match:c,attrs:p,content:U0}of I0){H0=!0;let Q0=U0;S4(U0,X,J.strict,Z.__originalFilePath);let D0=await S$(U0,{eventBindings:X0,attrs:p,hasColonDirectives:E0,templateContent:$,filePath:X,projectRoot:process.cwd(),production:J.buildMode==="compile",serverData:b});Q=Q.replace(c,()=>D0)}if(H0)Z.__stx_event_bindings=[];if(!H0&&Z.__stxProcessingDepth===1){let c=Z.__stx_event_bindings||[];if(c.length>0){let p=h$(c);if(p){let U0=Q.lastIndexOf("</body>");Q=U0===-1?Q+p:Q.slice(0,U0)+p+`
3639
+ `+Q.slice(U0)}Z.__stx_event_bindings=[]}}if(!U8(Q)&&W8(Q))Q=await D$(Q,G);if(Q=z8(Q),G.csp?.enabled&&G.csp.useNonce&&typeof Z.cspNonce==="string")Q=c6(Q,Z.cspNonce);return Q}var gG=[{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"}],hG=[{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')"}],uG=[{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 dG($){let Z=[],X=[];return mG($,Z),lG($,Z,X),cG($,X),pG($,Z),{valid:Z.length===0,errors:Z,warnings:X}}function mG($,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 lG($,Z,X){for(let J of gG){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 U=new RegExp(J.altClose,"g");q+=($.match(U)||[]).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 cG($,Z){for(let X of hG)if(X.pattern.test($))Z.push({type:"syntax",message:X.message,suggestion:X.suggestion})}function pG($,Z){for(let X of uG)if(X.pattern.test($))Z.push({type:"expression",message:`Security warning: ${X.message}`,suggestion:"Remove dangerous code from template expressions"})}function iG($,Z){let X=$.slice(0,Z).split(`
3640
+ `);return{line:X.length,column:X[X.length-1].length+1}}function nG($,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 sG($){return/@[a-z]+/i.test($)||/\{\{/.test($)}function oG($){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 Q5 from"process";var w2=["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"],H2=new Set(w2),rG=new Set(["props","$props","defineProps"]),aG=new Set(["stx","@stacksjs/stx"]),B2=J5(128);function tG($){let Z=[],X=0,J=$.split(`
3641
+ `);for(let Y of J){let Q=X,G=null,q=!1;for(let U=0;U<Y.length;U++){let W=Y[U];if(q){q=!1;continue}if(W==="\\"){q=!0;continue}if(G){if(W===G)G=null;continue}if(W==="'"||W==='"'||W==="`"){G=W;continue}if(W==="/"&&U+1<Y.length&&Y[U+1]==="/")break;if(W==="{")X++;else if(W==="}")X--}if(Q===0){let U=Y.match(/(?:const|let|var)\s+(\w+)\s*=/);if(U)Z.push(U[1]);else if(/^\s*(?:const|let|var)\s+\w+\s*;?\s*$/.test(Y)){let W=Y.match(/(?:const|let|var)\s+(\w+)/);if(W)Z.push(W[1])}else{let W=Y.match(/(?:const|let|var)\s+(\{[^}]+\}|\[[^\]]+\])\s*=/);if(W){let K=W[1].slice(1,-1).split(",").map((H)=>{let B=H.split(":");return(B.length>1?B[1]:B[0]).trim()}).filter((H)=>/^\w+$/.test(H));Z.push(...K)}}}}return[...new Set(Z)]}function eG($){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,U=null;for(let W=0;W<J.length;W++){let z=J[W];if(U){if(Q+=z,z===U)U=null;continue}if(z==='"'||z==="'"||z==="`"){U=z,Q+=z;continue}if(z==="<")G++;else if(z===">"&&G>0)G--;else if(z==="(")q++;else if(z===")")q--;if(z===","&&G===0&&q===0){Y.push(Q),Q="";continue}Q+=z}if(Q)Y.push(Q);return Y.map((W)=>{let z=W.trim(),K=z.startsWith("..."),H=K?z.slice(3):z,B=-1,j=0;for(let R=0;R<H.length;R++)if(H[R]==="<")j++;else if(H[R]===">")j--;else if(H[R]===":"&&j===0){B=R;break}if(B===-1)return W;let L=H.substring(0,B).trim().replace(/\?$/,""),V=H.substring(B+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=K?"...":"";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,U=G+1,W=0,z=null;while(U<Z.length&&q>0){let B=Z[U];if(z){if(B===z)z=null;U++;continue}if(B==='"'||B==="'"||B==="`"){z=B,U++;continue}if(B==="<")W++;else if(B===">"&&W>0)W--;else if(W===0){if(B==="(")q++;else if(B===")")q--}if(q>0)U++}if(q!==0)continue;let K=Z.substring(G+1,U);if(!K.includes(":"))continue;let H=X(K);Q.push({start:G+1,end:U,replacement:H})}for(let G=Q.length-1;G>=0;G--){let{start:q,end:U,replacement:W}=Q[G];Z=Z.substring(0,q)+W+Z.substring(U)}}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,...U]=G.split("="),W=q.split(":")[0].trim();if(U.length>0)return`${W} = ${U.join("=").trim()}`;return W}).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
+
3643
+ `),Z}function $q($){return/cannot find module|could not resolve|module not found|failed to resolve/i.test($)}function Zq($){if(!/is not defined|can't find variable/i.test($))return!1;return!/\b(document|window|navigator|localStorage|sessionStorage|self)\b/.test($)}async function Xq($,Z,X,J={}){if(!$.trim())return;let Y=Z5(),Q=E1($,JSON.stringify(Y)),G=B2.get(Q);if(G===void 0){try{let C=v4({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=eG($)}B2.set(Q,G)}let q={exports:{}},U=q.exports,W=Q5.cwd(),z={},K=[...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 K)try{if(C.startsWith(".")){z[C]=await import(t0.resolve(t0.dirname(X),C));continue}let P=t0.resolve(W,"node_modules",C),r=t0.join(P,"package.json"),a=JSON.parse(v("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}z[C]=await import(t0.resolve(P,J0))}catch(P){if(C.startsWith("."))H.set(C,P instanceof Error?P.message:String(P))}let B=(C)=>{if(z[C])return z[C];let P=H.get(C);if(P!==void 0)throw Error(`Cannot require '${C}' from ${X}: ${P}`);return v(C)},j=Z.props||{},_=(C)=>{if(!C)return j;let P={};for(let[r,a]of Object.entries(C)){let J0=j[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(j))Object.defineProperty(_,C,{value:P,enumerable:!0,configurable:!0,writable:!0});for(let C of["name","length","caller","arguments"]){if(Object.prototype.hasOwnProperty.call(j,C))continue;try{Object.defineProperty(_,C,{value:void 0,enumerable:!1,configurable:!0,writable:!0})}catch{}}let L=(C)=>{if(!C)return j;let P={...j};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)=>{},I=(C)=>{},A=C7(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 k=()=>{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??{},h=P||(Object.keys(Y0).length>0?`?${new URLSearchParams(Y0).toString()}`:"");return{params:Z.params??{},query:Y0,path:r,name:"",fullPath:r+h,hash:"",matched:[]}},y=()=>({push:(C)=>{},replace:(C)=>{},back:()=>{},forward:()=>{},go:(C)=>{}}),E=(C)=>{let P=Z.__stx_runtime_head||{};Z.__stx_runtime_head=J$(P,C||{})},b=(C)=>{E(L2(C||{}))},S=(C)=>({value:C}),f=(C)=>C,g=(C)=>({value:typeof C==="function"?C():C}),o=(C,P)=>{},u=(C)=>{},K0=(C)=>{},e0=(C)=>C?C():Promise.resolve(),M0=(C)=>(P,...r)=>{},C0=(C)=>{},X0=(C,P)=>{},H0=(C,P)=>P,I0=()=>({value:"light"}),E0=()=>F(!1),m0=(C)=>F(!1),c=()=>F(!1),p=()=>m0("(prefers-color-scheme: dark)"),U0=()=>m0("(prefers-color-scheme: light)"),Q0=()=>m0("(prefers-reduced-motion: reduce)"),D0=()=>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:{}},G5=new Proxy(P0,{get(C,P){if(P in C)return C[P];return},set(C,P,r){return C[P]=r,!0}}),b5={getElementById:()=>null,querySelector:()=>null,querySelectorAll:()=>[],createElement:()=>({}),createTextNode:()=>({}),body:{},head:{},documentElement:{},addEventListener:()=>{},removeEventListener:()=>{}},y5=console;try{let C=R2(G,X),P=new Set(Object.keys(j)),r=(n)=>/^[a-z_$][\w$]*$/i.test(n),a=Object.keys(Z).filter((n)=>!P.has(n)&&!rG.has(n)&&r(n)),J0=a.map((n)=>Z[n]);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"]),h=[],d=[];for(let[n,l0]of Object.entries(j)){if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(n))continue;if(Y0.has(n))continue;if(new RegExp(`(?:^|[\\s;{])(?:const|let|var|function)\\s+${n}\\b`).test(C))continue;h.push(n),d.push(l0)}let i=tG(C).map((n)=>`module.exports.${n} = typeof ${n} !== 'undefined' ? ${n} : module.exports.${n};`).join(`
3644
+ `),V0=Z.params??{},O0=[],v0=[];for(let n=0;n<a.length;n++){if(a[n]==="params")continue;O0.push(a[n]),v0.push(J0[n])}let b0=await Function(...w2,...h,...O0,`return (async () => {
3645
+ ${C}
3646
+ ${i}
3658
3647
  return module.exports
3659
- })()`)(Q,G,K,H,B,j,F,A,V,O,L,w,R,D,T,M,k,I,y,N.setResponseStatus,N.setResponseHeader,N.notFound,E,b,C,h,x,l,d,_0,h0,_,D0,y0,X0,J0,N0,z0,W5,i,Z0,Y0,O0,i0,j1,A0.confirm,A0.alert,A0.fetch,v0,...r,...H0);if(J.preserveExisting){for(let[s,u0]of Object.entries(_1))if(!(s in Z)||Z[s]===void 0)Z[s]=u0}else Object.assign(Z,_1);for(let[s,u0]of Object.entries(H))if(!(s in Z))Z[s]=u0}catch(S){let v=S instanceof Error?S.message:String(S);if(uG(v))console.warn(`[stx] server <script> in ${X??"<unknown>"} imports a module that does not resolve, so every variable in that script is undefined. Cause: ${v}`);else if(dG(v))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: ${v}`);else if(U5.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${X??"<unknown>"} \u2014 falling back to static extraction. Cause: ${v}`);try{await rG(Y,Z,X)}catch(n){if(U5.env.STX_DEBUG){let m=n instanceof Error?n.message:String(n);console.warn(`[stx] fallback extraction also failed in ${X??"<unknown>"}: ${m}`)}}}}function lG($){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 cG=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function W2($,Z){let X=Z?r0.dirname(Z):U5.cwd(),J=U5.cwd(),Y=$.split(`
3660
- `),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 U=0;for(;G<Y.length;G++){for(let W of Y[G])if(W==="{")U++;else if(W==="}")U--;if(U<=0)break}}G++;continue}if(q.startsWith("definePageMeta(")){let U=0,W=!1,z=G;for(let B=G;B<Y.length&&!W;B++){let j=null,_=!1,F=Y[B];for(let V=0;V<F.length;V++){let O=F[V];if(_){_=!1;continue}if(O==="\\"){_=!0;continue}if(j){if(O===j)j=null;continue}if(O==='"'||O==="'"||O==="`"){j=O;continue}if(O==="(")U++;else if(O===")"){if(U--,U===0){G=B+1,W=!0;break}}}}if(!W)G=Y.length;let K=Y.slice(z,G).join(`
3661
- `),H=[];for(let B of["title","description"]){let j=new RegExp(`\\b${B}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(K);if(j)H.push(`${B}: ${JSON.stringify(j[2])}`)}if(H.length>0)Q.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(q.startsWith("import ")||q==="import"||q.startsWith("import{")){let U=q,W=0;while(!lG(U)&&G+W+1<Y.length)W++,U=`${U} ${Y[G+W].trim()}`;G+=W;let z=U.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),K=U.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=U.match(/^import\s+['"](.+?)['"]/),B=U,j=(_)=>{if(_.startsWith("."))return r0.resolve(X,_);if(_.startsWith("~/")||_.startsWith("@/"))return r0.resolve(J,_.slice(2));return _};if(z){let[,_,F]=z,V=j(F);Q.push(`const ${_} = (await import('${V}')).default`),Q.push(`module.exports.${_} = ${_};`)}else if(K){let[,_,F]=K,V=j(F),O=[],L=[],w=xG.has(F);for(let R of _.split(",")){let D=R.trim();if(!D)continue;let N=D.split(/\s+as\s+/);if(N.length===2){let[T,A]=[N[0].trim(),N[1].trim()];if(w&&Z2.has(T)){Q.push(`const ${A} = ${T};`);continue}O.push(`${T}: ${A}`),L.push(A)}else{if(w&&Z2.has(D))continue;O.push(D),L.push(D)}}if(O.length>0)Q.push(`const { ${O.join(", ")} } = await import('${V}')`);for(let R of L)Q.push(`module.exports.${R} = ${R};`)}else if(H){let _=j(H[1]);Q.push(`await import('${_}')`)}else Q.push(B);G++;continue}if(cG.test(q))Q.push(Y[G]),G++;else if(q.startsWith("export const ")||q.startsWith("export let ")||q.startsWith("export var ")){let U=J2(Y,G),{type:W,name:z,value:K}=U;Q.push(`${W} ${z} = ${K};`),Q.push(`module.exports.${z} = ${z};`),G=U.nextIndex}else if(q.startsWith("export function ")||q.startsWith("export async function ")){let U=k4(Y,G);Q.push(U.functionCode),Q.push(`module.exports.${U.name} = ${U.name};`),G=U.nextIndex}else if(q.startsWith("const ")||q.startsWith("let ")||q.startsWith("var ")){let U=J2(Y,G),{type:W,name:z,value:K}=U;Q.push(`${W} ${z} = ${K};`),Q.push(`module.exports.${z} = ${z};`),G=U.nextIndex}else if(q.startsWith("function ")||q.startsWith("async function ")){let U=k4(Y,G);Q.push(U.functionCode),Q.push(`module.exports.${U.name} = ${U.name};`),G=U.nextIndex}else if(q.startsWith("export default function ")||q.startsWith("export default async function ")){let U=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),W=[...Y];W[G]=U;let z=k4(W,G);if(Q.push(z.functionCode),z.name)Q.push(`module.exports.default = ${z.name};`);G=z.nextIndex}else if(q.startsWith("export default ")){let U=q.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${U};`),G++}else if(q.startsWith("class ")||q.startsWith("export class ")){let U=q.match(/(?:export\s+)?class\s+(\w+)/);if(U){let W=U[1],z=Y[G].replace(/^export\s+/,""),K=0,H=G;for(;H<Y.length;H++){let B=Y[H];for(let j of B)if(j==="{")K++;else if(j==="}")K--;if(H>G)z+=`
3662
- `+B;if(K<=0&&H>=G)break}Q.push(z),Q.push(`module.exports.${W} = ${W};`),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 pG(Q.join(`
3663
- `),X,J)}function pG($,Z,X){let J=$.length,Y="",Q=0,G=null,q=!1,U=!1,W=0;while(Q<J){let z=$[Q],K=$[Q+1];if(q){if(Y+=z,z===`
3664
- `)q=!1;Q++;continue}if(U){if(Y+=z,z==="*"&&K==="/"){Y+=K,Q+=2,U=!1;continue}Q++;continue}if(!G&&z==="/"&&K==="/"){q=!0,Y+=z,Q++;continue}if(!G&&z==="/"&&K==="*"){U=!0,Y+=z,Q++;continue}if(G){if(Y+=z,z==="\\"){Y+=K,Q+=2;continue}if(z===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(z==="$"&&K==="{"){W++,Y+=K,Q+=2;continue}if(z==="`"){G=null,Q++;continue}}Q++;continue}if(W>0){if(z==="{")W++;else if(z==="}")W--}if(z==='"'||z==="'"||z==="`"){G=z,Y+=z,Q++;continue}if(z==="a"&&$.startsWith("await",Q)){let H=iG($,Q);if(H){let{quote:B,path:j,end:_}=H;if(j.startsWith(".")||j.startsWith("~/")||j.startsWith("@/")){let F=j.startsWith(".")?r0.resolve(Z,j):r0.resolve(X,j.slice(2));Y+=`await import(${B}${F}${B})`,Q=_;continue}}}Y+=z,Q++}return Y}function iG($,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 z2($,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 K2($){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?z2(X,J):null;if(q){Z.push(...K2(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 nG($){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],U=$[X-1];if(q!=="="&&q!==">"&&U!=="="&&U!=="!"&&U!=="<"&&U!==">")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 X2($,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 J2($,Z){let X=$[Z].trim(),J=nG(X),Y=J?[X,J.type,J.name,J.value]:null;if(!Y){let z=X.match(/^(?:export\s+)?(const|let|var)\s+/);if(z){let K=X.slice(z[0].length),H=Z;if(K.startsWith("{")||K.startsWith("[")){let j=K[0],_=j==="{"?"}":"]",F=X2(K,j,_,0),V=K;for(let O=Z+1;O<$.length&&F>0;O++)V+=` ${$[O].trim()}`,H=O,F=X2($[O],j,_,F);if(F>0)V=K,H=Z;K=V}let B=z2(K,0);if(B){let j=z[1],_=B.pattern,F=K.slice(B.endPos).trim();if(F.startsWith("=")){let V=F.slice(1).trim(),O=V,L=Math.max(H,Z);if(Y2(V)){let N=Q2($,L,V);O=N.value,L=N.nextIndex}else L=L+1;O=O.trim().replace(/;$/,"");let w=K2(_),R=`__stx_src_${Z}`,D=w.map((N)=>`module.exports.${N} = ${N};`).join(`
3648
+ })()`)(q,U,B,j,_,L,O,T,F,w,R,D,N,I,M,k,y,E,b,A.setResponseStatus,A.setResponseHeader,A.notFound,S,f,g,o,u,K0,e0,M0,C0,V,X0,H0,I0,E0,m0,c,p,U0,Q0,D0,G5,b5,y5,P0.confirm,P0.alert,P0.fetch,V0,...d,...v0);if(J.preserveExisting){for(let[n,l0]of Object.entries(b0))if(!(n in Z)||Z[n]===void 0)Z[n]=l0}else Object.assign(Z,b0);for(let[n,l0]of Object.entries(j))if(!(n in Z))Z[n]=l0}catch(C){let P=C instanceof Error?C.message:String(C);if($q(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(Zq(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(Q5.env.STX_DEBUG)console.warn(`[stx] server <script> did not execute in ${X??"<unknown>"} \u2014 falling back to static extraction. Cause: ${P}`);try{await zq(G,Z,X)}catch(r){if(Q5.env.STX_DEBUG){let a=r instanceof Error?r.message:String(r);console.warn(`[stx] fallback extraction also failed in ${X??"<unknown>"}: ${a}`)}}}}function Jq($){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 Yq=/^(?:export\s+)?(?:const|let|var)\s+[A-Za-z_$][\w$]*(?:\s*,\s*[A-Za-z_$][\w$]*)*\s*;?$/;function R2($,Z){let X=Z?t0.dirname(Z):Q5.cwd(),J=Q5.cwd(),Y=$.split(`
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 U=0;for(;G<Y.length;G++){for(let W of Y[G])if(W==="{")U++;else if(W==="}")U--;if(U<=0)break}}G++;continue}if(q.startsWith("definePageMeta(")){let U=0,W=!1,z=G;for(let B=G;B<Y.length&&!W;B++){let j=null,_=!1,L=Y[B];for(let V=0;V<L.length;V++){let O=L[V];if(_){_=!1;continue}if(O==="\\"){_=!0;continue}if(j){if(O===j)j=null;continue}if(O==='"'||O==="'"||O==="`"){j=O;continue}if(O==="(")U++;else if(O===")"){if(U--,U===0){G=B+1,W=!0;break}}}}if(!W)G=Y.length;let K=Y.slice(z,G).join(`
3650
+ `),H=[];for(let B of["title","description"]){let j=new RegExp(`\\b${B}\\s*:\\s*(['"\`])((?:\\\\.|(?!\\1)[^\\\\])*)\\1`).exec(K);if(j)H.push(`${B}: ${JSON.stringify(j[2])}`)}if(H.length>0)Q.push(`useSeoMeta({ ${H.join(", ")} });`);continue}if(q.startsWith("import ")||q==="import"||q.startsWith("import{")){let U=q,W=0;while(!Jq(U)&&G+W+1<Y.length)W++,U=`${U} ${Y[G+W].trim()}`;G+=W;let z=U.match(/^import\s+(\w+)\s+from\s+['"](.+?)['"]/),K=U.match(/^import\s+\{([^}]*)\}\s+from\s+['"](.+?)['"]/),H=U.match(/^import\s+['"](.+?)['"]/),B=U,j=(_)=>{if(_.startsWith("."))return t0.resolve(X,_);if(_.startsWith("~/")||_.startsWith("@/"))return t0.resolve(J,_.slice(2));return _};if(z){let[,_,L]=z,V=j(L);Q.push(`const ${_} = (await import('${V}')).default`),Q.push(`module.exports.${_} = ${_};`)}else if(K){let[,_,L]=K,V=j(L),O=[],F=[],w=aG.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[I,A]=[N[0].trim(),N[1].trim()];if(w&&H2.has(I)){Q.push(`const ${A} = ${I};`);continue}O.push(`${I}: ${A}`),F.push(A)}else{if(w&&H2.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 _=j(H[1]);Q.push(`await import('${_}')`)}else Q.push(B);G++;continue}if(Yq.test(q))Q.push(Y[G]),G++;else if(q.startsWith("export const ")||q.startsWith("export let ")||q.startsWith("export var ")){let U=_2(Y,G),{type:W,name:z,value:K}=U;Q.push(`${W} ${z} = ${K};`),Q.push(`module.exports.${z} = ${z};`),G=U.nextIndex}else if(q.startsWith("export function ")||q.startsWith("export async function ")){let U=P4(Y,G);Q.push(U.functionCode),Q.push(`module.exports.${U.name} = ${U.name};`),G=U.nextIndex}else if(q.startsWith("const ")||q.startsWith("let ")||q.startsWith("var ")){let U=_2(Y,G),{type:W,name:z,value:K}=U;Q.push(`${W} ${z} = ${K};`),Q.push(`module.exports.${z} = ${z};`),G=U.nextIndex}else if(q.startsWith("function ")||q.startsWith("async function ")){let U=P4(Y,G);Q.push(U.functionCode),Q.push(`module.exports.${U.name} = ${U.name};`),G=U.nextIndex}else if(q.startsWith("export default function ")||q.startsWith("export default async function ")){let U=Y[G].replace(/^(\s*)export\s+default\s+/,"$1"),W=[...Y];W[G]=U;let z=P4(W,G);if(Q.push(z.functionCode),z.name)Q.push(`module.exports.default = ${z.name};`);G=z.nextIndex}else if(q.startsWith("export default ")){let U=q.replace(/^export\s+default\s+/,"").replace(/;$/,"");Q.push(`module.exports.default = ${U};`),G++}else if(q.startsWith("class ")||q.startsWith("export class ")){let U=q.match(/(?:export\s+)?class\s+(\w+)/);if(U){let W=U[1],z=Y[G].replace(/^export\s+/,""),K=0,H=G;for(;H<Y.length;H++){let B=Y[H];for(let j of B)if(j==="{")K++;else if(j==="}")K--;if(H>G)z+=`
3651
+ `+B;if(K<=0&&H>=G)break}Q.push(z),Q.push(`module.exports.${W} = ${W};`),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 Qq(Q.join(`
3652
+ `),X,J)}function Qq($,Z,X){let J=$.length,Y="",Q=0,G=null,q=!1,U=!1,W=0;while(Q<J){let z=$[Q],K=$[Q+1];if(q){if(Y+=z,z===`
3653
+ `)q=!1;Q++;continue}if(U){if(Y+=z,z==="*"&&K==="/"){Y+=K,Q+=2,U=!1;continue}Q++;continue}if(!G&&z==="/"&&K==="/"){q=!0,Y+=z,Q++;continue}if(!G&&z==="/"&&K==="*"){U=!0,Y+=z,Q++;continue}if(G){if(Y+=z,z==="\\"){Y+=K,Q+=2;continue}if(z===G&&G!=="`"){G=null,Q++;continue}if(G==="`"){if(z==="$"&&K==="{"){W++,Y+=K,Q+=2;continue}if(z==="`"){G=null,Q++;continue}}Q++;continue}if(W>0){if(z==="{")W++;else if(z==="}")W--}if(z==='"'||z==="'"||z==="`"){G=z,Y+=z,Q++;continue}if(z==="a"&&$.startsWith("await",Q)){let H=Gq($,Q);if(H){let{quote:B,path:j,end:_}=H;if(j.startsWith(".")||j.startsWith("~/")||j.startsWith("@/")){let L=j.startsWith(".")?t0.resolve(Z,j):t0.resolve(X,j.slice(2));Y+=`await import(${B}${L}${B})`,Q=_;continue}}}Y+=z,Q++}return Y}function Gq($,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 D2($,Z){let X=$[Z];if(X!=="{"&&X!=="[")return null;let Y=j0($,X,X==="{"?"}":"]",Z);if(Y===-1)return null;return{pattern:$.slice(Z,Y+1),endPos:Y+1}}function N2($){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?D2(X,J):null;if(q){Z.push(...N2(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 qq($){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],U=$[X-1];if(q!=="="&&q!==">"&&U!=="="&&U!=="!"&&U!=="<"&&U!==">")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 j2($,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 _2($,Z){let X=$[Z].trim(),J=qq(X),Y=J?[X,J.type,J.name,J.value]:null;if(!Y){let z=X.match(/^(?:export\s+)?(const|let|var)\s+/);if(z){let K=X.slice(z[0].length),H=Z;if(K.startsWith("{")||K.startsWith("[")){let j=K[0],_=j==="{"?"}":"]",L=j2(K,j,_,0),V=K;for(let O=Z+1;O<$.length&&L>0;O++)V+=` ${$[O].trim()}`,H=O,L=j2($[O],j,_,L);if(L>0)V=K,H=Z;K=V}let B=D2(K,0);if(B){let j=z[1],_=B.pattern,L=K.slice(B.endPos).trim();if(L.startsWith("=")){let V=L.slice(1).trim(),O=V,F=Math.max(H,Z);if(V2(V)){let N=O2($,F,V);O=N.value,F=N.nextIndex}else F=F+1;O=O.trim().replace(/;$/,"");let w=N2(_),R=`__stx_src_${Z}`,D=w.map((N)=>`module.exports.${N} = ${N};`).join(`
3665
3654
  `);return{type:j,name:R,value:`${O}; ${j} ${_} = ${R};
3666
- ${D}`,nextIndex:L}}}}throw Error(`Failed to parse variable declaration: ${X}`)}let[,Q,G,q]=Y,U=q,W=Z;if(Y2(q)){let z=Q2($,Z,q);U=z.value,W=z.nextIndex}else W=Z+1;while(W<$.length){let z=$[W].trim();if(z.startsWith(".")||z.startsWith("?."))U+=`
3667
- ${$[W]}`,W++;else break}return U=U.trim().replace(/;$/,""),{type:Q,name:G,value:U,nextIndex:W}}function k4($,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(sG(X)){let q=oG($,Z,Q);Q=q.functionCode,G=q.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function Y2($){let Z=$.trim();if(Z.startsWith("{"))return B0(Z,"{","}",0)===-1;if(Z.startsWith("["))return B0(Z,"[","]",0)===-1;return!H2(Z)}function H2($){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 B2($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let X=B0($,"(",")",Z);if(X===-1)return-1;return $.indexOf("{",X)}function sG($){let Z=B2($);if(Z===-1)return!0;return B0($,"{","}",Z)===-1}function Q2($,Z,X){let J=X,Y=Z+1;while(Y<$.length&&!H2(J)){let Q=$[Y];J+=`
3655
+ ${D}`,nextIndex:F}}}}throw Error(`Failed to parse variable declaration: ${X}`)}let[,Q,G,q]=Y,U=q,W=Z;if(V2(q)){let z=O2($,Z,q);U=z.value,W=z.nextIndex}else W=Z+1;while(W<$.length){let z=$[W].trim();if(z.startsWith(".")||z.startsWith("?."))U+=`
3656
+ ${$[W]}`,W++;else break}return U=U.trim().replace(/;$/,""),{type:Q,name:G,value:U,nextIndex:W}}function P4($,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(Uq(X)){let q=Wq($,Z,Q);Q=q.functionCode,G=q.nextIndex}else G=Z+1;return{name:Y,functionCode:Q,nextIndex:G}}function V2($){let Z=$.trim();if(Z.startsWith("{"))return j0(Z,"{","}",0)===-1;if(Z.startsWith("["))return j0(Z,"[","]",0)===-1;return!A2(Z)}function A2($){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 M2($){let Z=$.indexOf("(");if(Z===-1)return $.indexOf("{");let X=j0($,"(",")",Z);if(X===-1)return-1;return $.indexOf("{",X)}function Uq($){let Z=M2($);if(Z===-1)return!0;return j0($,"{","}",Z)===-1}function O2($,Z,X){let J=X,Y=Z+1;while(Y<$.length&&!A2(J)){let Q=$[Y];J+=`
3668
3657
  ${Q}`,Y++}while(Y<$.length){let Q=$[Y].trim();if(Q.startsWith(".")||Q.startsWith("?."))J+=`
3669
- ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function oG($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=B2(J);if(Q!==-1){if(B0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3670
- ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function G2($,Z){let X=t($,Z)??t(`(${$})`,Z);if(X!==void 0)return X;if(!/\bprocess\b/.test($))return;let J={...Z,process:Object.freeze({env:{...U5.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 rG($,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 U=q.trim().replace(/;$/,""),W=G2(U,Z);if(W!==void 0)Z[G]=W}catch(U){console.warn(`Failed to parse export ${G} in fallback:`,U)}}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 U=q.trim().replace(/;$/,""),W=G2(U,Z);if(W!==void 0)Z[G]=W}catch{}}}function aG($){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 tG($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var y5=new L1(500),y$=new L1(1000),b4=new L1(2000);function $q($){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 j2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Zq($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function T1($){return!Zq($)}var b$=new Map;function E4($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=b$.get(Z);if(X)return X;if(b$.size>=16)b$.clear();let J=new Bun.Transpiler($);return b$.set(Z,J),J}function I1($){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=E4({loader:"ts",target:"browser",define:Q5()}).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 Xq($){let Z=[],X=new Set,J=0,Y=0,Q=$.length,G=(z)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===z){Y++;return}Y++}},q=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let z=1;while(Y<Q&&z>0)if($[Y]==="{")z++,Y++;else if($[Y]==="}")z--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")q();else Y++;continue}Y++}},U=()=>{if($[Y]==="/"&&$[Y+1]==="/"){while(Y<Q&&$[Y]!==`
3671
- `)Y++;return!0}if($[Y]==="/"&&$[Y+1]==="*"){Y+=2;while(Y<Q-1&&!($[Y]==="*"&&$[Y+1]==="/"))Y++;return Y+=2,!0}return!1},W=()=>{if(J!==0)return;let z=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(z){let j=z[2].split(",").map((_)=>{let F=_.trim().split(":");return F[F.length-1].trim()});for(let _ of j)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let K=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!X.has(j))Z.push(j),X.add(j);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!X.has(j))Z.push(j),X.add(j);return}let B=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!X.has(j))Z.push(j),X.add(j)}};while(Y<Q){if(U())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])))W();Y++}return Z}function Jq($){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 Qq($,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 U=$[J];if(U==="}")Q++;else if(U==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let U of Jq(q)){let W=U.trim();if(!W||W.startsWith("..."))continue;let z=Yq(W);if(z===-1)continue;let K=W.slice(0,z).trim();if(!/^[A-Z_$][\w$]*$/i.test(K))continue;if(Z[K]!==void 0)continue;let H=W.slice(z+1).trim();if(!H)continue;try{let B=Object.keys(Z),j=Function(...B,`"use strict"; return (${H});`);Z[K]=j(...B.map((_)=>Z[_]))}catch{}}}catch{}}async function T$($,Z,X,J,Y){let Q=$.endsWith(".stx")?$.slice(0,-4):$,G=(F)=>F.split("-").map((V)=>V.charAt(0).toUpperCase()+V.slice(1)).join(""),q=(F)=>F.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=X.__importedComponents;if(U){for(let F of[Q,Q.toLowerCase(),G(Q),q(Q)])if(U.has(F))return!0}let W=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],z=typeof Y.root==="string"?g.resolve(Y.root):void 0,K=z??g.dirname(J),H=[],B=(F)=>{if(F&&!H.includes(F))H.push(F)},j=X.__originalFilePath;if(j)B(g.join(g.dirname(j),"components"));if(B(Z),B(Y._rootComponentsDir),B(g.join(g.dirname(J),"components")),B(Y.componentsDir),z)B(g.resolve(z,"resources/views/components")),B(g.resolve(z,"resources/components")),B(g.resolve(z,"src/components")),B(g.resolve(z,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let F of _)B(typeof F==="string"?F:null);if(B(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return a(g.resolve(g.dirname(J),`${Q}.stx`));for(let F of H){let V=g.isAbsolute(F)?F:g.resolve(K,F);for(let O of W)if(await a(g.join(V,O)))return!0}return!1}function Gq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function qq($){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 Uq($){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 E1($,Z,X,J,Y,Q,G,q=new Set,U){let{extractVariables:W}=await o("stx/variable-extractor",()=>import("./chunk-fenb3cqw.js")),z=q??new Set;if(z.has($))return`[Circular component reference: ${$}]`;let K=new Set(z);K.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let B=H&&H!=="load"&&Gq(H)?H:"";try{let j=(P)=>P.split("-").map((u)=>u.charAt(0).toUpperCase()+u.slice(1)).join(""),_=(P)=>P.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let P=[F,F.toLowerCase(),j(F),_(F)];for(let u of P)if(O.has(u)){V=O.get(u);break}}let L=[];if(!V){let P=[`${F}.stx`,`${j(F)}.stx`,`${_(F)}.stx`],u=[...new Set(P)],Q0=Y.__originalFilePath,r=[];if(Q0){let U0=g.join(g.dirname(Q0),"components");r.push(U0)}if(J)r.push(J);let F0=G._rootComponentsDir;if(typeof F0==="string"&&!r.includes(F0))r.push(F0);let L0=g.join(g.dirname(Q),"components");if(!r.includes(L0))r.push(L0);if(G.componentsDir&&G.componentsDir!==J&&!r.includes(G.componentsDir))r.push(G.componentsDir);let v0=typeof G.root==="string"?g.resolve(G.root):void 0,a0=v0??g.dirname(Q),H0=[];if(v0)H0.push(g.resolve(v0,"resources/views/components")),H0.push(g.resolve(v0,"resources/components")),H0.push(g.resolve(v0,"src/components")),H0.push(g.resolve(v0,"components"));H0.push(g.resolve(import.meta.dir,"components"));for(let U0 of H0)if(!r.includes(U0))r.push(U0);let P1=G._pluginComponentDirs;if(Array.isArray(P1)){for(let U0 of P1)if(typeof U0==="string"&&!r.includes(U0))r.push(U0)}if(G.fallbackComponentsDir&&!r.includes(G.fallbackComponentsDir))r.push(G.fallbackComponentsDir);let _1=[...new Set(r.map((U0)=>{if(!U0)return U0;return g.isAbsolute(U0)?U0:g.resolve(a0,U0)}))];r.length=0,r.push(..._1);let s=`${F}\x00${Q}\x00${_1.join("\x00")}`,u0=y$.get(s);if(u0)if(await a(u0))V=u0;else y$.delete(s);if(!V&&(F.startsWith("./")||F.startsWith("../")))V=g.resolve(g.dirname(Q),`${F}.stx`),L.push(V);else if(!V)for(let U0 of r){if(!U0)continue;for(let V1 of u){let O1=g.join(U0,V1);if(L.push(O1),await a(O1)){V=O1;break}}if(V)break;if(!V)try{let V1=await import("fs");if(!V1.statSync(U0,{throwIfNoEntry:!1})?.isDirectory())continue;let C5=8,v1=[{path:U0,depth:0}];while(v1.length>0&&!V){let J1=v1.pop();if(J1.depth>=C5)continue;let P4;try{P4=V1.readdirSync(J1.path,{withFileTypes:!0})}catch{continue}for(let P5 of P4){if(!P5.isDirectory())continue;if(P5.name==="node_modules"||P5.name.startsWith("."))continue;let v4=g.join(J1.path,P5.name);for(let M2 of u){let S$=g.join(v4,M2);if(L.push(S$),await a(S$)){V=S$;break}}if(V)break;v1.push({path:v4,depth:J1.depth+1})}}}catch{}if(V)break}if(V)y$.set(s,V)}if(!V||!await a(V)){let P=L.length>0?`
3658
+ ${$[Y]}`,Y++;else break}return{value:J,nextIndex:Y}}function Wq($,Z,X){let J=X,Y=Z+1;while(Y<$.length){let Q=M2(J);if(Q!==-1){if(j0(J,"{","}",Q)!==-1)break}let G=$[Y];J+=`
3659
+ ${G}`,Y++}return{functionCode:J,nextIndex:Y}}function F2($,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:{...Q5.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 zq($,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 U=q.trim().replace(/;$/,""),W=F2(U,Z);if(W!==void 0)Z[G]=W}catch(U){console.warn(`Failed to parse export ${G} in fallback:`,U)}}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 U=q.trim().replace(/;$/,""),W=F2(U,Z);if(W!==void 0)Z[G]=W}catch{}}}function Kq($){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 Hq($){let Z=$.trim();if(!Z)return!1;return/(?:const|let|var|function)\s+\w+/.test(Z)}var T5=new c1(500),P$=new c1(1000),jq=33554432,x4=new c1(2000,{maxBytes:jq,sizeOf:($)=>$.output.length});function _q($){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 I2($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Vq($){return/\bjs\b/.test($)||/\blang\s*=\s*["']?(js|javascript)["']?/i.test($)}function N1($){return!Vq($)}var C$=new Map;function v4($){let Z;try{Z=JSON.stringify($)}catch{return new Bun.Transpiler($)}let X=C$.get(Z);if(X)return X;if(C$.size>=16)C$.clear();let J=new Bun.Transpiler($);return C$.set(Z,J),J}function A1($){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=v4({loader:"ts",target:"browser",define:Z5()}).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 Oq($){let Z=[],X=new Set,J=0,Y=0,Q=$.length,G=(z)=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]===z){Y++;return}Y++}},q=()=>{Y++;while(Y<Q){if($[Y]==="\\"){Y+=2;continue}if($[Y]==="`"){Y++;return}if($[Y]==="$"&&$[Y+1]==="{"){Y+=2;let z=1;while(Y<Q&&z>0)if($[Y]==="{")z++,Y++;else if($[Y]==="}")z--,Y++;else if($[Y]==="'"||$[Y]==='"')G($[Y]);else if($[Y]==="`")q();else Y++;continue}Y++}},U=()=>{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},W=()=>{if(J!==0)return;let z=$.slice(Y).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(z){let j=z[2].split(",").map((_)=>{let L=_.trim().split(":");return L[L.length-1].trim()});for(let _ of j)if(_&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(_)&&!X.has(_))Z.push(_),X.add(_);return}let K=$.slice(Y).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(K){let j=K[2];if(!X.has(j))Z.push(j),X.add(j);return}let H=$.slice(Y).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(H){let j=H[1];if(!X.has(j))Z.push(j),X.add(j);return}let B=$.slice(Y).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let j=B[1];if(!X.has(j))Z.push(j),X.add(j)}};while(Y<Q){if(U())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])))W();Y++}return Z}function Fq($){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 Lq($){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 wq($,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 U=$[J];if(U==="}")Q++;else if(U==="{"){if(Q--,Q===0){G=J;break}}}if(G===-1)return;let q=$.slice(G+1,Y);for(let U of Fq(q)){let W=U.trim();if(!W||W.startsWith("..."))continue;let z=Lq(W);if(z===-1)continue;let K=W.slice(0,z).trim();if(!/^[A-Z_$][\w$]*$/i.test(K))continue;if(Z[K]!==void 0)continue;let H=W.slice(z+1).trim();if(!H)continue;try{let B=Object.keys(Z),j=Function(...B,`"use strict"; return (${H});`);Z[K]=j(...B.map((_)=>Z[_]))}catch{}}}catch{}}async function E$($,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(),U=X.__importedComponents;if(U){for(let L of[Q,Q.toLowerCase(),G(Q),q(Q)])if(U.has(L))return!0}let W=[...new Set([`${Q}.stx`,`${G(Q)}.stx`,`${q(Q)}.stx`])],z=typeof Y.root==="string"?x.resolve(Y.root):void 0,K=z??x.dirname(J),H=[],B=(L)=>{if(L&&!H.includes(L))H.push(L)},j=X.__originalFilePath;if(j)B(x.join(x.dirname(j),"components"));if(B(Z),B(Y._rootComponentsDir),B(x.join(x.dirname(J),"components")),B(Y.componentsDir),z)B(x.resolve(z,"resources/views/components")),B(x.resolve(z,"resources/components")),B(x.resolve(z,"src/components")),B(x.resolve(z,"components"));let _=Y._pluginComponentDirs;if(Array.isArray(_))for(let L of _)B(typeof L==="string"?L:null);if(B(Y.fallbackComponentsDir),Q.startsWith("./")||Q.startsWith("../"))return t(x.resolve(x.dirname(J),`${Q}.stx`));for(let L of H){let V=x.isAbsolute(L)?L:x.resolve(K,L);for(let O of W)if(await t(x.join(V,O)))return!0}return!1}function Rq($){return $==="visible"||$==="idle"||$==="interaction"||$.startsWith("media:")}function Dq($){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 Nq($){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,U){let{extractVariables:W}=await s("stx/variable-extractor",()=>import("./chunk-7cts329z.js")),z=q??new Set;if(z.has($))return`[Circular component reference: ${$}]`;let K=new Set(z);K.add($);let H=typeof Z.client==="string"?Z.client.trim():"";if("client"in Z)delete Z.client;let B=H&&H!=="load"&&Rq(H)?H:"";try{let j=(h)=>h.split("-").map((d)=>d.charAt(0).toUpperCase()+d.slice(1)).join(""),_=(h)=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),L=$.endsWith(".stx")?$.slice(0,-4):$,V=null,O=Y.__importedComponents;if(O){let h=[L,L.toLowerCase(),j(L),_(L)];for(let d of h)if(O.has(d)){V=O.get(d);break}}let F=[];if(!V){let h=[`${L}.stx`,`${j(L)}.stx`,`${_(L)}.stx`],d=[...new Set(h)],W0=Y.__originalFilePath,i=[];if(W0){let F0=x.join(x.dirname(W0),"components");i.push(F0)}if(J)i.push(J);let V0=G._rootComponentsDir;if(typeof V0==="string"&&!i.includes(V0))i.push(V0);let O0=x.join(x.dirname(Q),"components");if(!i.includes(O0))i.push(O0);if(G.componentsDir&&G.componentsDir!==J&&!i.includes(G.componentsDir))i.push(G.componentsDir);let v0=typeof G.root==="string"?x.resolve(G.root):void 0,_1=v0??x.dirname(Q),b0=[];if(v0)b0.push(x.resolve(v0,"resources/views/components")),b0.push(x.resolve(v0,"resources/components")),b0.push(x.resolve(v0,"src/components")),b0.push(x.resolve(v0,"components"));b0.push(x.resolve(import.meta.dir,"components"));for(let F0 of b0)if(!i.includes(F0))i.push(F0);let n=G._pluginComponentDirs;if(Array.isArray(n)){for(let F0 of n)if(typeof F0==="string"&&!i.includes(F0))i.push(F0)}if(G.fallbackComponentsDir&&!i.includes(G.fallbackComponentsDir))i.push(G.fallbackComponentsDir);let l0=[...new Set(i.map((F0)=>{if(!F0)return F0;return x.isAbsolute(F0)?F0:x.resolve(_1,F0)}))];i.length=0,i.push(...l0);let S5=`${L}\x00${Q}\x00${l0.join("\x00")}`,v$=P$.get(S5);if(v$)if(await t(v$))V=v$;else P$.delete(S5);if(!V&&(L.startsWith("./")||L.startsWith("../")))V=x.resolve(x.dirname(Q),`${L}.stx`),F.push(V);else if(!V)for(let F0 of i){if(!F0)continue;for(let C5 of d){let P5=x.join(F0,C5);if(F.push(P5),await t(P5)){V=P5;break}}if(V)break;if(!V)try{let C5=await import("fs");if(!C5.statSync(F0,{throwIfNoEntry:!1})?.isDirectory())continue;let h2=8,f$=[{path:F0,depth:0}];while(f$.length>0&&!V){let v5=f$.pop();if(v5.depth>=h2)continue;let d4;try{d4=C5.readdirSync(v5.path,{withFileTypes:!0})}catch{continue}for(let f5 of d4){if(!f5.isDirectory())continue;if(f5.name==="node_modules"||f5.name.startsWith("."))continue;let m4=x.join(v5.path,f5.name);for(let u2 of d){let x$=x.join(m4,u2);if(F.push(x$),await t(x$)){V=x$;break}}if(V)break;f$.push({path:m4,depth:v5.depth+1})}}}catch{}if(V)break}if(V)P$.set(S5,V)}if(!V||!await t(V)){let h=F.length>0?`
3672
3661
  Searched paths:
3673
- ${L.map((u)=>` - ${u}`).join(`
3674
- `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${P}`}U.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(P){return`[Error loading component: ${P instanceof Error?P.message:String(P)}]`}let R=new Set(["__originalFilePath","__importedComponents",v5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[P,u]of Object.entries(Y))if(!P.startsWith("__")||R.has(P))D[P]=u;let N=X;if(X.includes("@include")){let{processIncludes:P}=await o("stx/includes",()=>import("./chunk-2p4v6ed7.js"));N=await P(X,Y,Q,G,U)}let T=s0(N),A=[],M=T.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(P,u)=>{let Q0=T.scripts[Number(u)]||"",r=Q0.match(/^<script\b([^>]*)>/i)?.[1]||"",F0=r.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),L0=!F0||["module","text/javascript","application/javascript"].includes(F0);if(!/\bserver\b/i.test(r)&&L0)return A.push(Q0),"";return Q0}),{extractSlotContent:k}=await o("stx/slots",()=>import("./chunk-rs5w6cm5.js")),I=k(M),y={};if(I.defaultSlot?.trim())y.default=I.defaultSlot;for(let[P,u]of I.namedSlots)y[P]=u.content;let E={...D,...Z,props:Z,slot:M,$slots:y,__processedComponents:K,__sections:{},__stx_signals_gate:Q1(w)||qq(X)};Qq(w,E);let b=w,C=z$(b);if(C)b=C.content.trim();let h=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,x=[...w.matchAll(h)],l=[],d=x.some((P)=>/\bserver\b/.test(P[1]||"")&&/\bcache\b/.test(P[1]||""))&&x.every((P)=>/\bserver\b/.test(P[1]||"")),_0=null,h0=null;if(d){let P=$q({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0});if(P!==null){_0=`${V}\x00${P}`;let u=b4.get(_0);if(u){for(let Q0 of u.dependencies)U.add(Q0);return u.output}h0=new Set(U)}}for(let P of x){let u=P[1]||"",Q0=P[2]||"",r=u.includes("server");if(T1(u)&&Q0.trim())Q0=I1(Q0);if(r&&Q0)try{await W(Q0,E,V)}catch(L0){}if(!r){let L0=Q0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=L0.includes("{{")&&L0.includes("}}"),a0=L0.includes("{!!")&&L0.includes("!!}");if(v0||a0)L0=x$(L0,E);let H0=u.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");l.push(`<script${H0}>${L0}</script>`)}}let D0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),y0=D0?D0[1]:"",X0=D0?D0[2]:"",J0="",N0=y0&&/\bscoped\b/i.test(y0);if(D0)J0=`<style${y0}>${X0}</style>`;let z0=b;if(z0=z0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),D0)z0=z0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let P=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,u=[];if(z0=z0.replace(P,(Q0,r)=>{let F0=r.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(F0)u.push(`<style${F0[1]}>${F0[2]}</style>`);return""}),z0=z0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),u.length>0)J0=`${J0}${u.join(`
3675
- `)}`}if(X&&z0.includes("{{ text || slot }}"))z0=z0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:W5}=await o("stx/slots",()=>import("./chunk-rs5w6cm5.js")),{defaultSlot:i,namedSlots:Z0}=I;z0=await W5(z0,i,Z0,E);let Y0=l.some((P)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(P)),A0=Uq(l),O0=Array.isArray(E.__stx_client_signal_names)?E.__stx_client_signal_names:[];if(A0.length>0||O0.length>0)E.__stx_client_signal_names=[...new Set([...O0,...A0])];let i0={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:g.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:Y0||l.length===0,defaultLayout:void 0};E.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let j1=await I4(z0,E,V,i0,U),S=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let P of j1.matchAll(/\{\{([\s\S]*?)\}\}/g))S.add(P[1].trim());if(S.size>0)Y.__stx_preserved_client_expressions=[...S];let v=Y.__stx_scope_seq??={n:0,key:Bun.hash(String(Y.__filename??Q)).toString(36).slice(0,6)},n=`stx_${F.replace(/[^a-zA-Z0-9]/g,"_")}_${++v.n}_${v.key}`,m=j1;if(Y0){let P="";if(Object.keys(Z).length>0)try{P=` data-stx-props="${j2(JSON.stringify(Z))}"`}catch{}let u=B?` stx-hydrate="${j2(B)}"`:"";m=`<div data-stx-scope="${n}"${P}${u}>${j1}</div>`;let Q0=await Promise.all(l.map(async(r)=>{let F0=r.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!F0)return r;let[,L0,v0]=F0,a0=S4(v0,{filePath:V,projectRoot:process.cwd()}),H0=a0.code,P1=C4(a0.styles);H0=e1(H0).code;let{hasUserImports:_1,bundleClientScript:s}=await o("stx/client-script-bundler",()=>import("./chunk-g4t9zc0a.js"));if(_1(H0))H0=await s(H0,V,{projectRoot:process.cwd(),minify:G.buildMode==="compile"});let{stripStxRuntimeImports:u0}=await o("stx/signal-processing",()=>import("./chunk-8raem8ng.js"));H0=u0(H0);let U0=t0(H0),V1=Xq(U0),O1=`function(__scopeId) {
3676
- ${s1("const",[..._2,...V1],U0)}
3662
+ ${F.map((d)=>` - ${d}`).join(`
3663
+ `)}`:"";return`[Error loading component: ENOENT: no such file or directory, open '${$}']${h}`}U.add(V);let w;if(T5.has(V))w=T5.get(V);else try{w=await Bun.file(V).text(),T5.set(V,w)}catch(h){return`[Error loading component: ${h instanceof Error?h.message:String(h)}]`}let R=new Set(["__originalFilePath","__importedComponents",x5,"__stx_client_signal_names","__stxServeContext","__stx_scope_seq"]),D={};for(let[h,d]of Object.entries(Y))if(!h.startsWith("__")||R.has(h))D[h]=d;let N=X;if(X.includes("@include")){let{processIncludes:h}=await s("stx/includes",()=>import("./chunk-xkb16kmv.js"));N=await h(X,Y,Q,G,U)}let I=r0(N),A=[],M=I.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(h,d)=>{let W0=I.scripts[Number(d)]||"",i=W0.match(/^<script\b([^>]*)>/i)?.[1]||"",V0=i.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),O0=!V0||["module","text/javascript","application/javascript"].includes(V0);if(!/\bserver\b/i.test(i)&&O0)return A.push(W0),"";return W0}),{extractSlotContent:T}=await s("stx/slots",()=>import("./chunk-fcv00xs9.js")),k=T(M),y={};if(k.defaultSlot?.trim())y.default=k.defaultSlot;for(let[h,d]of k.namedSlots)y[h]=d.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:K,__sections:{},__stx_signals_gate:G1(w)||Dq(X)};wq(w,S);let f=w,g=B$(f);if(g)f=g.content.trim();let o=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,u=[...w.matchAll(o)],K0=[],e0=u.some((h)=>/\bserver\b/.test(h[1]||"")&&/\bcache\b/.test(h[1]||"")),M0=null,C0=null,X0=null,H0=0,I0=null;if(e0){let h=_q({props:Z,slot:X,buildMode:G.buildMode??"",skipEventDirectives:G.skipEventDirectives===!0,uid:b});if(h!==null){M0=`${V}\x00${E1(w)}\x00${h}`;let d=x4.get(M0);if(d){for(let W0 of d.dependencies)U.add(W0);if($7(Y,d.clientFactories),E.n+=d.uidsConsumed,d.preservedClientExpressions.length>0){let W0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let i of d.preservedClientExpressions)W0.add(i);Y.__stx_preserved_client_expressions=[...W0]}return d.output}C0=new Set(U),X0=t4(Y),H0=E.n,I0=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[])}}for(let h of u){let d=h[1]||"",W0=h[2]||"",i=d.includes("server");if(N1(d)&&W0.trim())W0=A1(W0);if(i&&W0)try{await W(W0,S,V)}catch(O0){}if(!i){let O0=W0.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),v0=O0.includes("{{")&&O0.includes("}}"),_1=O0.includes("{!!")&&O0.includes("!!}");if(v0||_1)O0=l$(O0,S);let b0=d.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");K0.push(`<script${b0}>${O0}</script>`)}}let E0=w.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),m0=E0?E0[1]:"",c=E0?E0[2]:"",p="",U0=m0&&/\bscoped\b/i.test(m0);if(E0)p=`<style${m0}>${c}</style>`;let Q0=f;if(Q0=Q0.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),E0)Q0=Q0.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let h=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,d=[];if(Q0=Q0.replace(h,(W0,i)=>{let V0=i.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(V0)d.push(`<style${V0[1]}>${V0[2]}</style>`);return""}),Q0=Q0.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),d.length>0)p=`${p}${d.join(`
3664
+ `)}`}if(X&&Q0.includes("{{ text || slot }}"))Q0=Q0.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>X);let{applySlots:D0}=await s("stx/slots",()=>import("./chunk-fcv00xs9.js")),{defaultSlot:P0,namedSlots:G5}=k;Q0=await D0(Q0,P0,G5,S);let b5=K0.some((h)=>/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useReactiveProp|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(h)),y5=Nq(K0),C=Array.isArray(S.__stx_client_signal_names)?S.__stx_client_signal_names:[];if(y5.length>0||C.length>0)S.__stx_client_signal_names=[...new Set([...C,...y5])];let P={...G,_rootComponentsDir:G._rootComponentsDir||G.componentsDir,componentsDir:x.dirname(V),skipSignalsRuntime:!0,skipEventDirectives:b5||K0.length===0,defaultLayout:void 0};S.__stxProcessingDepth=(Y.__stxProcessingDepth||0)+1;let r=await C4(Q0,S,V,P,U),a=new Set(Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[]);for(let h of r.matchAll(/\{\{([\s\S]*?)\}\}/g))a.add(h[1].trim());if(a.size>0)Y.__stx_preserved_client_expressions=[...a];let J0=b,Y0=r;if(b5){let h="";if(Object.keys(Z).length>0)try{h=` data-stx-props="${I2(JSON.stringify(Z))}"`}catch{}let d=B?` stx-hydrate="${I2(B)}"`:"";Y0=`<div data-stx-scope="${J0}"${h}${d}>${r}</div>`;let W0=await Promise.all(K0.map(async(i)=>{let V0=i.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!V0)return i;let[,O0,v0]=V0,{vendorStyleTags:_1,factoryBody:b0}=await Iq(v0,V,G.buildMode==="compile"),n=B?null:u$(Y,b0),l0=n?`window.__stxComponentFactories[${JSON.stringify(n)}](${JSON.stringify(J0)});`:`(${b0})(${JSON.stringify(J0)});`;if(B)return`${_1}<script type="stx/island" data-stx-island="${J0}" data-stx-scoped${O0}>${l0}</script>`;return`${_1}<script data-stx-scoped data-stx-run="always"${O0}>${l0}</script>`}));if(Y0=Y0+`
3665
+ `+W0.join(`
3666
+ `),p)Y0+=`
3667
+ `+p}else{if(p)Y0+=`
3668
+ `+p;if(K0.length>0){let h=S.__stx_event_bindings||[],d=y$(S),W0=await Promise.all(K0.map(async(i)=>{let V0=i.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!V0)return i;return await S$(V0[1],{eventBindings:h,templateContent:Y0,filePath:V,projectRoot:process.cwd(),serverData:d})}));Y0+=`
3669
+ `+W0.join(`
3670
+ `),S.__stx_event_bindings=[]}}if(U0){let h=F$(Y0,V);if(h.hasScoped)Y0=h.html}if(M0&&C0){let h=Array.isArray(Y.__stx_preserved_client_expressions)?Y.__stx_preserved_client_expressions:[];x4.set(M0,{output:Y0,dependencies:[...U].filter((d)=>!C0.has(d)),clientFactories:X0?e4(Y,X0):[],uidsConsumed:E.n-H0,preservedClientExpressions:I0?h.filter((d)=>!I0.has(d)):[]})}return A.length>0?`${Y0}
3671
+ ${A.join(`
3672
+ `)}`:Y0}catch(j){return`[Error processing component: ${j instanceof Error?j.message:String(j)}]`}finally{z.delete($)}}async function t($){return Bun.file($).exists()}function g4($,Z){let X=x.resolve(Z),J=x.resolve($),Y=X.endsWith(x.sep)?X:X+x.sep;if(J===X||J.startsWith(Y))return J;return null}async function Aq($,Z,X,J){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=x.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 Y$($,Z,X,J){let Y=await Mq($,Z,X,J);if(Y===null)return null;let Q=g4(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 U=x.isAbsolute(q)?q:x.resolve(process.cwd(),q);if(g4(Y,U))return x.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function Mq($,Z,X,J){if(X.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=x.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=x.join(Q,$),B=g4(H,Q);if(!B)return console.warn(`[stx] rejected template path that escapes project root: ${$} (from ${Z})`),null;if(X.debug)console.log(`Checking absolute path: ${B}`);if(await t(B)&&J)J.add(B);return B}let G=x.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 B=`${G}${H}`;if(await t(B)){if(X.debug)console.log(`Found direct path with extension: ${B}`);if(J)J.add(B);return B}}let q=[];if(X.layoutsDir)q.push(x.isAbsolute(X.layoutsDir)?X.layoutsDir:x.resolve(process.cwd(),X.layoutsDir));let U=x.resolve(Y),W=process.cwd();for(let H=0;H<10;H++){let B=x.join(U,"layouts"),j=!1;try{j=Bq.statSync(B,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(j){q.push(B);break}let _=x.dirname(U);if(_===U||_.length<W.length)break;U=_}for(let H of q){let B=await Aq(H,$,J,X.debug);if(B)return B}if(X.fallbackLayoutsDir){let H=x.isAbsolute(X.fallbackLayoutsDir)?X.fallbackLayoutsDir:x.resolve(process.cwd(),X.fallbackLayoutsDir),B=$.startsWith("layouts/")?$.slice(8):$,j=[x.join(H,B)];if(!$.endsWith(".stx"))j.push(`${j[0]}.stx`);for(let _ of j)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/"),B=x.join(X.partialsDir||Y,"layouts",H[1]);if(await t(B)){if(X.debug)console.log(`Found in layouts path: ${B}`);if(J)J.add(B);return B}if(!B.endsWith(".stx")){let j=`${B}.stx`;if(await t(j)){if(X.debug)console.log(`Found in layouts path with extension: ${j}`);if(J)J.add(j);return j}}}if(X.partialsDir){let H=x.join(X.partialsDir,"layouts");if(await t(H)){let B=x.join(H,$);if(await t(B)){if(X.debug)console.log(`Found in partials layouts dir: ${B}`);if(J)J.add(B);return B}if(!$.endsWith(".stx")){let j=`${B}.stx`;if(await t(j)){if(X.debug)console.log(`Found in partials layouts dir with extension: ${j}`);if(J)J.add(j);return j}}}}let z=X.partialsDir||x.join(process.cwd(),"views"),K=x.join(z,$);if(await t(K)){if(X.debug)console.log(`Found in views path: ${K}`);if(J)J.add(K);return K}if(!$.endsWith(".stx")){let H=`${K}.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=x.join(x.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 B=`${H}.stx`;if(await t(B)){if(X.debug)console.log(`Found in temp layouts dir with extension: ${B}`);if(J)J.add(B);return B}}}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 b2($,Z,X){let J=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3673
+ `),q=0;for(let U=0;U<G.length;U++)if(q+=G[U].length+1,q>=Z){J=U+1,Y=G[U].trim();let W=Math.max(0,U-2),z=Math.min(G.length,U+3);Q=G.slice(W,z).map((K,H)=>{let B=W+H+1;return`${B===J?"> ":" "}${B}: ${K}`}).join(`
3674
+ `);break}}else if(X){let G=$.indexOf(X);if(G>=0)return b2($,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 B0($,Z,X,J,Y,Q){let{lineNumber:G,context:q}=b2(J,Y,Q),U=X.split("/").pop(),W=0;if(typeof Y==="number"&&Y>=0&&J){let K=J.lastIndexOf(`
3675
+ `,Math.max(0,Y-1));W=Y-(K+1)+1}let z="";if(G>0)z+=`
3676
+ ${X}:${G}${W>0?`:${W}`:""}: ${$.toLowerCase()} error: ${Z}
3677
+ `;if(z+=`
3678
+ ${Z0.bold}${Z0.red}\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${Z0.reset}
3679
+ `,z+=`${Z0.bold}${Z0.red}\u2502${Z0.reset} ${Z0.bold}${Z0.bgRed} ERROR ${Z0.reset} ${Z0.red}${$} Error${Z0.reset}${" ".repeat(Math.max(0,43-$.length))}${Z0.bold}${Z0.red}\u2502${Z0.reset}
3680
+ `,z+=`${Z0.bold}${Z0.red}\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F${Z0.reset}
3681
+ `,z+=`
3682
+ ${Z0.cyan}${Z0.bold}File:${Z0.reset} ${Z0.dim}${U}${Z0.reset}`,G>0)z+=` ${Z0.gray}(line ${G}${W>0?`, col ${W}`:""})${Z0.reset}`;if(z+=`
3683
+ ${Z0.yellow}${Z0.bold}Message:${Z0.reset} ${Z}
3684
+ `,q)z+=`
3685
+ ${Z0.blue}${Z0.bold}Context:${Z0.reset}
3686
+ ${Z0.dim}${q}${Z0.reset}
3687
+ `;return z}function dV(){T5.clear(),P$.clear(),x4.clear()}function mV(){return{size:T5.size,maxSize:500}}var f4=J5(128);async function Iq($,Z,X){let J=E1($,Z,X),Y=f4.get(J);if(Y){if(E2(Y.deps))return Y;f4.delete(J)}let Q=h4($,{filePath:Z,projectRoot:process.cwd()}),G=Q.code,q=u4(Q.styles);G=o1(G).code;let{hasUserImports:U,bundleClientScript:W}=await s("stx/client-script-bundler",()=>import("./chunk-9rkcrzj4.js")),z=[],K=!1;if(U(G)){let V=G;G=await W(V,Z,{projectRoot:process.cwd(),minify:X,collectInputs:z}),K=G===V}let{stripStxRuntimeImports:H}=await s("stx/signal-processing",()=>import("./chunk-q5et8k2d.js"));G=H(G);let B=$1(G),j=Oq(B),_=`function(__scopeId) {
3688
+ ${l1("const",[...k2,...j],B)}
3677
3689
  const __scope = window.stx._scopes = window.stx._scopes || {};
3678
3690
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
3679
3691
  __scopeVars.$refs = __scopeVars.$refs || {};
@@ -3687,12 +3699,12 @@ ${L.map((u)=>` - ${u}`).join(`
3687
3699
  const onDestroy = (fn) => __scopeVars.__destroyCallbacks.push(fn);
3688
3700
 
3689
3701
  try {
3690
- ${U0}
3702
+ ${B}
3691
3703
 
3692
3704
  // Register all defined signals and functions in this scope
3693
3705
  const __localVars = {};
3694
3706
  try {
3695
- ${V1.map((J1)=>`if (typeof ${J1} !== 'undefined') __localVars['${J1}'] = ${J1};`).join(`
3707
+ ${j.map((V)=>`if (typeof ${V} !== 'undefined') __localVars['${V}'] = ${V};`).join(`
3696
3708
  `)}
3697
3709
  }
3698
3710
  catch (e) {}
@@ -3701,41 +3713,18 @@ catch (e) {}
3701
3713
  finally {
3702
3714
  window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
3703
3715
  }
3704
- }`,C5=B?null:p4(Y,O1),v1=C5?`window.__stxComponentFactories[${JSON.stringify(C5)}](${JSON.stringify(n)});`:`(${O1})(${JSON.stringify(n)});`;if(B)return`${P1}<script type="stx/island" data-stx-island="${n}" data-stx-scoped${L0}>${v1}</script>`;return`${P1}<script data-stx-scoped data-stx-run="always"${L0}>${v1}</script>`}));if(m=m+`
3705
- `+Q0.join(`
3706
- `),J0)m+=`
3707
- `+J0}else{if(J0)m+=`
3708
- `+J0;if(l.length>0){let P=E.__stx_event_bindings||[],u=k$(E),Q0=await Promise.all(l.map(async(r)=>{let F0=r.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!F0)return r;return await E$(F0[1],{eventBindings:P,templateContent:m,filePath:V,projectRoot:process.cwd(),serverData:u})}));m+=`
3709
- `+Q0.join(`
3710
- `),E.__stx_event_bindings=[]}}if(N0){let P=_$(m,V);if(P.hasScoped)m=P.html}if(_0&&h0)b4.set(_0,{output:m,dependencies:[...U].filter((P)=>!h0.has(P))});return A.length>0?`${m}
3711
- ${A.join(`
3712
- `)}`:m}catch(j){return`[Error processing component: ${j instanceof Error?j.message:String(j)}]`}finally{z.delete($)}}async function a($){return Bun.file($).exists()}function y4($,Z){let X=g.resolve(Z),J=g.resolve($),Y=X.endsWith(g.sep)?X:X+g.sep;if(J===X||J.startsWith(Y))return J;return null}async function Wq($,Z,X,J){let Y=Z.startsWith("layouts/")?Z.slice(8):Z,Q=g.join($,Y);for(let G of Q.endsWith(".stx")?[Q]:[Q,`${Q}.stx`])if(await a(G)){if(J)console.log(`Found layout in ${$}: ${G}`);return X?.add(G),G}return null}async function Z$($,Z,X,J){let Y=await zq($,Z,X,J);if(Y===null)return null;let Q=y4(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 U=g.isAbsolute(q)?q:g.resolve(process.cwd(),q);if(y4(Y,U))return g.resolve(Y)}return console.warn(`[stx] rejected resolved template path that escapes project root: ${Y} (template: ${$}, from: ${Z})`),null}async function zq($,Z,X,J){if(X.debug)console.log(`Resolving template path: ${$} from ${Z}`);let Y=g.dirname(Z),Q=process.cwd();if($.startsWith("/")){let H=g.join(Q,$),B=y4(H,Q);if(!B)return console.warn(`[stx] rejected template path that escapes project root: ${$} (from ${Z})`),null;if(X.debug)console.log(`Checking absolute path: ${B}`);if(await a(B)&&J)J.add(B);return B}let G=g.join(Y,$);if(await a(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 B=`${G}${H}`;if(await a(B)){if(X.debug)console.log(`Found direct path with extension: ${B}`);if(J)J.add(B);return B}}let q=[];if(X.layoutsDir)q.push(g.isAbsolute(X.layoutsDir)?X.layoutsDir:g.resolve(process.cwd(),X.layoutsDir));let U=g.resolve(Y),W=process.cwd();for(let H=0;H<10;H++){let B=g.join(U,"layouts"),j=!1;try{j=eG.statSync(B,{throwIfNoEntry:!1})?.isDirectory()??!1}catch{}if(j){q.push(B);break}let _=g.dirname(U);if(_===U||_.length<W.length)break;U=_}for(let H of q){let B=await Wq(H,$,J,X.debug);if(B)return B}if(X.fallbackLayoutsDir){let H=g.isAbsolute(X.fallbackLayoutsDir)?X.fallbackLayoutsDir:g.resolve(process.cwd(),X.fallbackLayoutsDir),B=$.startsWith("layouts/")?$.slice(8):$,j=[g.join(H,B)];if(!$.endsWith(".stx"))j.push(`${j[0]}.stx`);for(let _ of j)if(await a(_)){if(X.debug)console.log(`Found in options.fallbackLayoutsDir: ${_}`);if(J)J.add(_);return _}}if($.startsWith("layouts/")||$.includes("/layouts/")){let H=$.split("layouts/"),B=g.join(X.partialsDir||Y,"layouts",H[1]);if(await a(B)){if(X.debug)console.log(`Found in layouts path: ${B}`);if(J)J.add(B);return B}if(!B.endsWith(".stx")){let j=`${B}.stx`;if(await a(j)){if(X.debug)console.log(`Found in layouts path with extension: ${j}`);if(J)J.add(j);return j}}}if(X.partialsDir){let H=g.join(X.partialsDir,"layouts");if(await a(H)){let B=g.join(H,$);if(await a(B)){if(X.debug)console.log(`Found in partials layouts dir: ${B}`);if(J)J.add(B);return B}if(!$.endsWith(".stx")){let j=`${B}.stx`;if(await a(j)){if(X.debug)console.log(`Found in partials layouts dir with extension: ${j}`);if(J)J.add(j);return j}}}}let z=X.partialsDir||g.join(process.cwd(),"views"),K=g.join(z,$);if(await a(K)){if(X.debug)console.log(`Found in views path: ${K}`);if(J)J.add(K);return K}if(!$.endsWith(".stx")){let H=`${K}.stx`;if(await a(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=g.join(g.dirname(Y),"layouts",$);if(await a(H)){if(X.debug)console.log(`Found in temp layouts dir: ${H}`);if(J)J.add(H);return H}if(!$.endsWith(".stx")){let B=`${H}.stx`;if(await a(B)){if(X.debug)console.log(`Found in temp layouts dir with extension: ${B}`);if(J)J.add(B);return B}}}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 V2($,Z,X){let J=0,Y="",Q="";try{if(typeof Z==="number"&&Z>=0){let G=$.split(`
3713
- `),q=0;for(let U=0;U<G.length;U++)if(q+=G[U].length+1,q>=Z){J=U+1,Y=G[U].trim();let W=Math.max(0,U-2),z=Math.min(G.length,U+3);Q=G.slice(W,z).map((K,H)=>{let B=W+H+1;return`${B===J?"> ":" "}${B}: ${K}`}).join(`
3714
- `);break}}else if(X){let G=$.indexOf(X);if(G>=0)return V2($,G)}}catch{}return{lineNumber:J,lineContent:Y,context:Q}}var $0={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 K0($,Z,X,J,Y,Q){let{lineNumber:G,context:q}=V2(J,Y,Q),U=X.split("/").pop(),W=0;if(typeof Y==="number"&&Y>=0&&J){let K=J.lastIndexOf(`
3715
- `,Math.max(0,Y-1));W=Y-(K+1)+1}let z="";if(G>0)z+=`
3716
- ${X}:${G}${W>0?`:${W}`:""}: ${$.toLowerCase()} error: ${Z}
3717
- `;if(z+=`
3718
- ${$0.bold}${$0.red}\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E${$0.reset}
3719
- `,z+=`${$0.bold}${$0.red}\u2502${$0.reset} ${$0.bold}${$0.bgRed} ERROR ${$0.reset} ${$0.red}${$} Error${$0.reset}${" ".repeat(Math.max(0,43-$.length))}${$0.bold}${$0.red}\u2502${$0.reset}
3720
- `,z+=`${$0.bold}${$0.red}\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F${$0.reset}
3721
- `,z+=`
3722
- ${$0.cyan}${$0.bold}File:${$0.reset} ${$0.dim}${U}${$0.reset}`,G>0)z+=` ${$0.gray}(line ${G}${W>0?`, col ${W}`:""})${$0.reset}`;if(z+=`
3723
- ${$0.yellow}${$0.bold}Message:${$0.reset} ${Z}
3724
- `,q)z+=`
3725
- ${$0.blue}${$0.bold}Context:${$0.reset}
3726
- ${$0.dim}${q}${$0.reset}
3727
- `;return z}function AV(){y5.clear(),y$.clear(),b4.clear()}function MV(){return{size:y5.size,maxSize:500}}var Kq=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function Hq($){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 Bq($,Z){let X=Z;while(!0){let J=C1.join(X,"node_modules",$,"package.json");if(S5.existsSync(J))return C1.dirname(J);let Y=C1.dirname(X);if(Y===X)return null;X=Y}}function jq($,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 _q($,Z){let X=Hq($);if(!X||!X.subpath)return null;let J=Bq(X.pkg,Z);if(!J)return null;let Y;try{Y=JSON.parse(S5.readFileSync(C1.join(J,"package.json"),"utf8"))}catch{return null}let Q=`.${X.subpath}`,G=jq(Y.exports,Q);if(!G)return null;let q=C1.resolve(J,G);return S5.existsSync(q)?q:null}function S4($,Z){let X=Z.filePath?C1.dirname(Z.filePath):Z.projectRoot||process.cwd(),J=Z.projectRoot||process.cwd(),Y=new Set,Q=[];return{code:$.replace(Kq,(q,U)=>{let W;try{if(U.startsWith("./")||U.startsWith("../")||U.startsWith("/")){if(W=U.startsWith("/")?U:C1.resolve(X,U),!S5.existsSync(W))throw Error(`file not found: ${W}`)}else{let z=null;try{z=Bun.resolveSync(U,J)}catch{z=_q(U,J)}if(!z)throw Error(`could not resolve ${U} (Bun.resolveSync + exports fallback both failed)`);W=z}}catch(z){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(U)} (from ${Z.filePath||"<unknown>"}): ${z?.message||z}`),""}if(Y.has(W))return"";Y.add(W);try{let z=S5.readFileSync(W,"utf8");Q.push({source:U,resolvedPath:W,contents:z})}catch(z){console.warn(`[stx:vendor-css] could not read ${W}: ${z?.message||z}`)}return""}),styles:Q}}function Vq($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function C4($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${Vq(Z.source)}" data-stx-layer="vendor">
3716
+ }`,L={vendorStyleTags:q,factoryBody:_,deps:T2([...z,...Q.styles.map((V)=>V.resolvedPath)])};if(!K&&Q.unresolved.length===0)f4.set(J,L);return L}var kq=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function Tq($){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 Eq($,Z){let X=Z;while(!0){let J=y1.join(X,"node_modules",$,"package.json");if(E5.existsSync(J))return y1.dirname(J);let Y=y1.dirname(X);if(Y===X)return null;X=Y}}function bq($,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 yq($,Z){let X=Tq($);if(!X||!X.subpath)return null;let J=Eq(X.pkg,Z);if(!J)return null;let Y;try{Y=JSON.parse(E5.readFileSync(y1.join(J,"package.json"),"utf8"))}catch{return null}let Q=`.${X.subpath}`,G=bq(Y.exports,Q);if(!G)return null;let q=y1.resolve(J,G);return E5.existsSync(q)?q:null}function h4($,Z){let X=Z.filePath?y1.dirname(Z.filePath):Z.projectRoot||process.cwd(),J=Z.projectRoot||process.cwd(),Y=new Set,Q=[],G=[];return{code:$.replace(kq,(U,W)=>{let z;try{if(W.startsWith("./")||W.startsWith("../")||W.startsWith("/")){if(z=W.startsWith("/")?W:y1.resolve(X,W),!E5.existsSync(z))throw Error(`file not found: ${z}`)}else{let K=null;try{K=Bun.resolveSync(W,J)}catch{K=yq(W,J)}if(!K)throw Error(`could not resolve ${W} (Bun.resolveSync + exports fallback both failed)`);z=K}}catch(K){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(W)} (from ${Z.filePath||"<unknown>"}): ${K?.message||K}`),G.push(W),""}if(Y.has(z))return"";Y.add(z);try{let K=E5.readFileSync(z,"utf8");Q.push({source:W,resolvedPath:z,contents:K})}catch(K){console.warn(`[stx:vendor-css] could not read ${z}: ${K?.message||K}`),G.push(W)}return""}),styles:Q,unresolved:G}}function Sq($){return $.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function u4($){if($.length===0)return"";return`${$.map((Z)=>{return`<style data-stx-vendor="${Sq(Z.source)}" data-stx-layer="vendor">
3728
3717
  @layer vendor {
3729
3718
  ${Z.contents}
3730
3719
  }
3731
3720
  </style>`}).join(`
3732
3721
  `)}
3733
- `}var Oq=w2;function e1($){let Z=d0($),X=new Set;for(let q of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let U of q[1].split(",")){let W=U.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(W)X.add(W)}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 U of q[1].split(",")){let W=U.trim().split(/[:=]/).pop()?.trim();if(W)J.add(W)}let Y=T5.filter((q)=>{if(X.has(q)||J.has(q))return!1;return new RegExp(`\\b${q}\\s*\\(`).test(Z)}),Q=D2(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 Cq=P2;function o1($){let Z=c0($),X=new Set;for(let q of $.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let U of q[1].split(",")){let W=U.trim().split(/\s+as\s+/).pop()?.replace(/^type\s+/,"").trim();if(W)X.add(W)}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 U of q[1].split(",")){let W=U.trim().split(/[:=]/).pop()?.trim();if(W)J.add(W)}let Y=N5.filter((q)=>{if(X.has(q)||J.has(q))return!1;return new RegExp(`\\b${q}\\s*\\(`).test(Z)}),Q=f2(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(`
3734
3723
  `)}
3735
- ${$}`,imports:Y,models:Q}}var Fq=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 D2($){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(!Fq.has(J[1]))Z.add(J[1]);return Array.from(Z)}function Lq($){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 N2($){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 K=G[1],H=G[2];if(G[0].includes("import type"))continue;let B=[];for(let _ of K.split(",")){let F=_.trim();if(!F||F.startsWith("type "))continue;let V=F.match(/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/);if(!V)continue;let O=V[1],L=V[2]||O;if(Y.add(O),Y.add(L),H==="stx"||H==="@stacksjs/stx")Z.add(O);else X.add(O);if(L!==O)B.push(`${L} = ${O}`)}let j=B.length>0?`var ${B.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";J=J.replace(G[0],j)}let q=Lq(J);for(let K of Oq){if(Y.has(K)||q.has(K))continue;if(new RegExp(`\\b${K}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(J))Z.add(K)}let U=d0(J),W=new Set;for(let K of J.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of K[1].split(",")){let B=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let j of B){let _=j.trim();if(_)W.add(_)}}for(let K of T5){if(Y.has(K)||q.has(K)||W.has(K))continue;if(new RegExp(`\\b${K}\\b`,"g").test(U))X.add(K)}let z=D2(J);for(let K of z)if(!Y.has(K)&&!q.has(K))X.add(K);return{code:J,stxImports:Array.from(Z),browserImports:Array.from(X)}}function A2($,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 Pq=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 f2($){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(!Pq.has(J[1]))Z.add(J[1]);return Array.from(Z)}function vq($){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 x2($){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 K=G[1],H=G[2];if(G[0].includes("import type"))continue;let B=[];for(let _ of K.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)B.push(`${F} = ${O}`)}let j=B.length>0?`var ${B.join(", ")}; /* [auto-import processed] */`:"// [auto-import processed]";J=J.replace(G[0],j)}let q=vq(J);for(let K of Cq){if(Y.has(K)||q.has(K))continue;if(new RegExp(`\\b${K}\\s*(?:<[^>]*>)?\\s*\\(`,"g").test(J))Z.add(K)}let U=c0(J),W=new Set;for(let K of J.matchAll(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"][^'"]+['"]\s*;?\s*$/gm))for(let H of K[1].split(",")){let B=H.trim().replace(/^type\s+/,"").split(/\s+as\s+/);for(let j of B){let _=j.trim();if(_)W.add(_)}}for(let K of N5){if(Y.has(K)||q.has(K)||W.has(K))continue;if(new RegExp(`\\b${K}\\b`,"g").test(U))X.add(K)}let z=f2(J);for(let K of z)if(!Y.has(K)&&!q.has(K))X.add(K);return{code:J,stxImports:Array.from(Z),browserImports:Array.from(X)}}function g2($,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
3736
3725
  ${X.join(`
3737
3726
  `)}
3738
- ${wq($,Z)}`;return""}function dV($,Z=[]){let{browserImports:X}=N2($),J=new Set(Z);return A2([],X.filter((Y)=>!J.has(Y)))}function wq($,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
+ ${fq($,Z)}`;return""}function YO($,Z=[]){let{browserImports:X}=x2($),J=new Set(Z);return g2([],X.filter((Y)=>!J.has(Y)))}function fq($,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
3739
3728
  [${X.join(", ")}].forEach(function (e) {
3740
3729
  if (e[1] !== 'undefined') return;
3741
3730
  console.error(
@@ -3744,10 +3733,10 @@ ${wq($,Z)}`;return""}function dV($,Z=[]){let{browserImports:X}=N2($),J=new Set(Z
3744
3733
  + 'or it should be imported from a relative path so the bundler includes it.'
3745
3734
  );
3746
3735
  });
3747
- `}function k$($){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 O2($,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(O2(X[1],!0).has(Z))return!0;for(let X of $.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(O2(X[1],!1).has(Z))return!0;return!1}function Dq($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var Nq=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,F2=new Set;function Aq($,Z){let X=Nq.test($),J=Z.length>32768;if(!X&&!J)return;if(F2.has($))return;if(F2.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 Y4($,Z){if(!Z)return"";let X=d0($),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&&!Dq(X,Q))continue;if(Rq($,Q))continue;let q;try{q=JSON.stringify(G)}catch{continue}if(q===void 0)continue;Aq(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 y$($){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 y2($,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 xq($,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(y2(X[1],!0).has(Z))return!0;for(let X of $.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(y2(X[1],!1).has(Z))return!0;return!1}function gq($,Z){return new RegExp(`(?<![.#\\w$])${Z}(?![\\w$])`).test($)}var hq=/token|secret|passw|apikey|api_key|privatekey|private_key|credential|webhook|bearer|jwt|signature/i,S2=new Set;function uq($,Z){let X=hq.test($),J=Z.length>32768;if(!X&&!J)return;if(S2.has($))return;if(S2.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 W4($,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&&!gq(X,Q))continue;if(xq($,Q))continue;let q;try{q=JSON.stringify(G)}catch{continue}if(q===void 0)continue;uq(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)
3748
3737
  ${Y.join(`
3749
3738
  `)}
3750
- `}var Mq={left:0,middle:1,right:2};function Tq($){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=Mq[$.mouse];Z.push(`if ($event.button !== ${X}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function Iq($,Z){let{elementId:X,event:J,modifiers:Y}=$,Q=C$($.handler),G=Tq(Y),q=[];if(Y.once)q.push("once: true");if(Y.capture)q.push("capture: true");if(Y.passive)q.push("passive: true");let U=q.length>0?`, { ${q.join(", ")} }`:"",W="";if(G)W+=`${G}; `;let z=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),K=`var $emit = function(name, detail) {
3739
+ `}var dq={left:0,middle:1,right:2};function mq($){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=dq[$.mouse];Z.push(`if ($event.button !== ${X}) return`)}if($.prevent)Z.push("$event.preventDefault()");if($.stop)Z.push("$event.stopPropagation()");return Z.join("; ")}function lq($,Z){let{elementId:X,event:J,modifiers:Y}=$,Q=g$($.handler),G=mq(Y),q=[];if(Y.once)q.push("once: true");if(Y.capture)q.push("capture: true");if(Y.passive)q.push("passive: true");let U=q.length>0?`, { ${q.join(", ")} }`:"",W="";if(G)W+=`${G}; `;let z=Q.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),K=`var $emit = function(name, detail) {
3751
3740
  $el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, cancelable: true }))
3752
3741
  };`;function H(B){if(/\$emit\s*\(/.test(B))return`${K}
3753
3742
  ${B}`;return`var scope = $el.closest('[data-stx-scope]');
@@ -3790,23 +3779,23 @@ else {
3790
3779
  else {
3791
3780
  ${Q}
3792
3781
  }
3793
- }${U})`}function kq($){if($.length===0)return"";return`
3782
+ }${U})`}function cq($){if($.length===0)return"";return`
3794
3783
  // STX: auto-generated event bindings
3795
- ${$.map((X,J)=>Iq(X,J)).join(`
3796
- `)}`}function L2($){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 U=q;if(G++,U==="`"){let W=0;while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]==="`"&&W===0){G++;break}if(J[G]==="$"&&J[G+1]==="{"){W++,G+=2;continue}if(J[G]==="}"&&W>0){W--,G++;continue}G++}}else while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]===U){G++;break}G++}continue}if(q==="/"&&J[G+1]==="/"){while(G<Q&&J[G]!==`
3797
- `)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 U=J.slice(G),W=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}let z=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(z){z[1].split(",").forEach((H)=>{let B=H.trim(),j=B.indexOf(":"),_=j>=0?B.slice(j+1).trim().split(/[\s=]/)[0]:B.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=z[0].length;continue}let K=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}}G++}return Z}var Eq=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 bq($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let B;while((B=X.exec(H))!==null){let j=B[0];if(!Eq.has(j))Z.add(j)}}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 U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=W.exec($))!==null)J(Q[1]);let z=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);let K=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=K.exec($))!==null)J(Q[1]);return Z}async function E$($,Z={}){let X=$,J="",Y=!1,Q=[],G=S4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=C4(G.styles),U=e1(X);X=U.code,Q=[...U.imports,...U.models];let{hasUserImports:W,bundleClientScript:z}=await o("stx/client-script-bundler",()=>import("./chunk-g4t9zc0a.js"));if(W(X))X=await z(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=N2(X);X=O.code,J=A2(O.stxImports,O.browserImports.filter((L)=>!Q.includes(L)))}if(J=`${Y4(X,Z.serverData)}${J}`,X=t0(X),!Y&&T1(Z.attrs||""))X=I1(X);let K=kq(Z.eventBindings||[]),H=(Z.attrs||"").trim();if(/\btype\s*=\s*["']module["']/i.test(H)){let O=H.replace(/\btype\s*=\s*["']module["']/i,"").trim(),L=`type="module" data-stx-scoped${O?` ${O}`:""}`;return`${q}<script ${L}>
3798
- ${t1(`${J}${X}
3784
+ ${$.map((X,J)=>lq(X,J)).join(`
3785
+ `)}`}function C2($){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 U=q;if(G++,U==="`"){let W=0;while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]==="`"&&W===0){G++;break}if(J[G]==="$"&&J[G+1]==="{"){W++,G+=2;continue}if(J[G]==="}"&&W>0){W--,G++;continue}G++}}else while(G<Q){if(J[G]==="\\"){G+=2;continue}if(J[G]===U){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 U=J.slice(G),W=U.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(W){let H=W[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=W[0].length;continue}let z=U.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(z){z[1].split(",").forEach((H)=>{let B=H.trim(),j=B.indexOf(":"),_=j>=0?B.slice(j+1).trim().split(/[\s=]/)[0]:B.split(/[\s=]/)[0];if(_&&!_.startsWith("_")&&!X.has(_))Z.push(_),X.add(_)}),G+=z[0].length;continue}let K=U.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(K){let H=K[1];if(!H.startsWith("_")&&!X.has(H))Z.push(H),X.add(H);G+=K[0].length;continue}}G++}return Z}var pq=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 iq($){let Z=new Set,X=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function J(H){let B;while((B=X.exec(H))!==null){let j=B[0];if(!pq.has(j))Z.add(j)}}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 U=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((Q=U.exec($))!==null)J(Q[1]);let W=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((Q=W.exec($))!==null)J(Q[1]);let z=/@model\s*=\s*["']([^"']*)["']/gi;while((Q=z.exec($))!==null)J(Q[1]);let K=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((Q=K.exec($))!==null)J(Q[1]);return Z}async function S$($,Z={}){let X=$,J="",Y=!1,Q=[],G=h4(X,{filePath:Z.filePath,projectRoot:Z.projectRoot});X=G.code;let q=u4(G.styles),U=o1(X);X=U.code,Q=[...U.imports,...U.models];let{hasUserImports:W,bundleClientScript:z}=await s("stx/client-script-bundler",()=>import("./chunk-9rkcrzj4.js"));if(W(X))X=await z(X,Z.filePath||"",{projectRoot:Z.projectRoot,minify:Z.production}),Y=!0;if(Z.autoImports!==!1){let O=x2(X);X=O.code,J=g2(O.stxImports,O.browserImports.filter((F)=>!Q.includes(F)))}if(J=`${W4(X,Z.serverData)}${J}`,X=$1(X),!Y&&N1(Z.attrs||""))X=A1(X);let K=cq(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
+ ${s1(`${J}${X}
3799
3788
  ${K}`)}
3800
- </script>`}let j=R2($),_=/function __stx_setup_/.test(X),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function V(O){let L=O.length>0?`
3789
+ </script>`}let j=v2($),_=/function __stx_setup_/.test(X),L=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test($);function V(O){let F=O.length>0?`
3801
3790
  return { ${O.join(", ")} };`:"";return`${q}<script data-stx-scoped data-stx-run="always">
3802
3791
  window.stx.mount(function() {
3803
3792
  'use strict';
3804
- ${t1(`${J}${X}
3805
- ${K}${L}`)}
3806
- })</script>`}if(!F&&!_){if(j)return V(L2($));if(Z.templateContent){let O=L2($);if(O.length>0){let L=bq(Z.templateContent);if(O.some((R)=>L.has(R)))return V(O)}}}return`${q}<script data-stx-scoped data-stx-run="always">
3793
+ ${s1(`${J}${X}
3794
+ ${K}${F}`)}
3795
+ })</script>`}if(!L&&!_){if(j)return V(C2($));if(Z.templateContent){let O=C2($);if(O.length>0){let F=iq(Z.templateContent);if(O.some((R)=>F.has(R)))return V(O)}}}return`${q}<script data-stx-scoped data-stx-run="always">
3807
3796
  ;(function() {
3808
3797
  'use strict';
3809
- ${t1(`${J}${X}
3798
+ ${s1(`${J}${X}
3810
3799
  ${K}`)}
3811
3800
  })()</script>`}
3812
- export{zZ as kl,KZ as ll,HZ as ml,e0 as nl,d$ as ol,m$ as pl,l$ as ql,c$ as rl,M7 as sl,A7 as tl,wZ as ul,DZ as vl,AZ as wl,VU as xl,OU as yl,FU as zl,LU as Al,wU as Bl,UZ as Cl,w7 as Dl,R7 as El,D7 as Fl,N7 as Gl,jU as Hl,v7 as Il,j5 as Jl,C$ as Kl,P$ as Ll,b2 as Ml,m4 as Nl,Sq as Ol,t0 as Pl,Pq as Ql,T5 as Rl,Q5 as Sl,vj as Tl,S4 as Ul,C4 as Vl,Oq as Wl,e1 as Xl,N2 as Yl,A2 as Zl,dV as _l,k$ as $l,Y4 as am,E$ as bm,G0 as cm,w0 as dm,x5 as em,q0 as fm,hq as gm,u5 as hm,uq as im,dq as jm,mq as km,lq as lm,Y1 as mm,z5 as nm,m5 as om,d2 as pm,tq as qm,m2 as rm,eq as sm,f$ as tm,q7 as um,Q1 as vm,x$ as wm,p2 as xm,$U as ym,F1 as zm,i2 as Am,S0 as Bm,ZU as Cm,K7 as Dm,GU as Em,ZZ as Fm,XZ as Gm,O7 as Hm,F7 as Im,L7 as Jm,HU as Km,T7 as Lm,i$ as Mm,H5 as Nm,l5 as Om,AU as Pm,p$ as Qm,IZ as Rm,kZ as Sm,EZ as Tm,MU as Um,k7 as Vm,E7 as Wm,W1 as Xm,KX as Ym,HX as Zm,BX as _m,jX as $m,Q6 as an,_X as bn,c as cn,Q3 as dn,O5 as en,F5 as fn,o5 as gn,OX as hn,r5 as in,FX as jn,a5 as kn,R1 as ln,q6 as mn,D1 as nn,U6 as on,W6 as pn,t5 as qn,G3 as rn,e as sn,AX as tn,MX as un,TX as vn,c1 as wn,q3 as xn,U3 as yn,l0 as zn,W3 as An,K3 as Bn,e5 as Cn,kX as Dn,EX as En,bX as Fn,H6 as Gn,G$ as Hn,B0 as In,b6 as Jn,w3 as Kn,z1 as Ln,N1 as Mn,y6 as Nn,w5 as On,q$ as Pn,R3 as Qn,QJ as Rn,qJ as Sn,P6 as Tn,WJ as Un,zJ as Vn,f6 as Wn,A1 as Xn,sz as Yn,x6 as Zn,I3 as _n,_J as $n,T3 as ao,VJ as bo,OJ as co,oz as do,rz as eo,g6 as fo,h6 as go,u6 as ho,FJ as io,LJ as jo,az as ko,tz as lo,wJ as mo,ez as no,$K as oo,l6 as po,n6 as qo,b3 as ro,KK as so,N5 as to,y3 as uo,S3 as vo,HK as wo,fJ as xo,BK as yo,xJ as zo,r6 as Ao,jK as Bo,gJ as Co,_K as Do,VK as Eo,g3 as Fo,RK as Go,DK as Ho,NK as Io,AK as Jo,MK as Ko,dJ as Lo,TK as Mo,W$ as No,mJ as Oo,IK as Po,kK as Qo,EK as Ro,bK as So,sJ as To,rJ as Uo,UY as Vo,x3 as Wo,$9 as Xo,yK as Yo,z$ as Zo,oQ as _o,QG as $o,D4 as ap,s9 as bp,iH as cp,t9 as dp,DQ as ep,AQ as fp,U8 as gp,Q4 as hp,W8 as ip,K8 as jp,H8 as kp,PQ as lp,vQ as mp,B8 as np,X4 as op,fQ as pp,gQ as qp,U2 as rp,hG as sp,uG as tp,dG as up,mG as vp,lG as wp,W2 as xp,nG as yp,aG as zp,tG as Ap,B9 as Bp,j9 as Cp,pK as Dp,Q9 as Ep,iK as Fp,d3 as Gp,m3 as Hp,l3 as Ip,F9 as Jp,L9 as Kp,w9 as Lp,j6 as Mp,_6 as Np,V6 as Op,O6 as Pp,H3 as Qp,B3 as Rp,lW as Sp,cW as Tp,pW as Up,SX as Vp,iW as Wp,_H as Xp,VH as Yp,D9 as Zp,OH as _p,M9 as $p,PY as aq,I9 as bq,y9 as cq,f9 as dq,_$ as eq,bH as fq,yH as gq,r3 as hq,x9 as iq,g9 as jq,KQ as kq,CH as lq,PH as mq,HQ as nq,vH as oq,h9 as pq,u9 as qq,O$ as rq,F$ as sq,a1 as tq,jQ as uq,m9 as vq,l9 as wq,c9 as xq,_Q as yq,VQ as zq,a3 as Aq,t3 as Bq,p9 as Cq,i9 as Dq,N4 as Eq,A4 as Fq,T4 as Gq,I4 as Hq,IG as Iq,SG as Jq,CG as Kq,PG as Lq,vG as Mq,Zq as Nq,T1 as Oq,E4 as Pq,I1 as Qq,T$ as Rq,Gq as Sq,qq as Tq,Uq,E1 as Vq,a as Wq,Z$ as Xq,V2 as Yq,K0 as Zq,AV as _q,MV as $q,f7 as ar,x7 as br,w1 as cr,g7 as dr,d1 as er,h7 as fr,_5 as gr,gU as hr,lZ as ir,s$ as jr,hU as kr,o$ as lr,uU as mr,dU as nr,U1 as or,mU as pr,lU as qr,cU as rr,pU as sr,iU as tr,nU as ur,cZ as vr,a$ as wr,u7 as xr,oU as yr,rU as zr,aU as Ar,tU as Br,eU as Cr,m7 as Dr,$W as Er,l7 as Fr,ZW as Gr,XW as Hr,V5 as Ir,rZ as Jr,GW as Kr,tZ as Lr,o7 as Mr,n5 as Nr,HW as Or,X6 as Pr,Y3 as Qr,tW as Rr,_3 as Sr,gX as Tr,mX as Ur,eW as Vr,$z as Wr,Zz as Xr,Xz as Yr,Jz as Zr,Yz as _r,lX as $r,cX as as,F6 as bs,I6 as cs,sX as ds,O3 as es,k6 as fs,wz as gs,Rz as hs,L3 as is,$J as js,E6 as ks};
3801
+ export{NZ as jl,AZ as kl,MZ as ll,Z1 as ml,i$ as nl,n$ as ol,s$ as pl,o$ as ql,b7 as rl,E7 as sl,CZ as tl,vZ as ul,xZ as vl,bU as wl,yU as xl,SU as yl,CU as zl,PU as Al,RZ as Bl,M7 as Cl,I7 as Dl,k7 as El,T7 as Fl,TU as Gl,u7 as Hl,K5 as Il,g$ as Jl,h$ as Kl,p2 as Ll,o4 as Ml,sq as Nl,$1 as Ol,rq as Pl,N5 as Ql,Z5 as Rl,oj as Sl,h4 as Tl,u4 as Ul,Cq as Vl,o1 as Wl,x2 as Xl,g2 as Yl,YO as Zl,y$ as _l,W4 as $l,S$ as am,G0 as bm,w0 as cm,u5 as dm,q0 as em,ZU as fm,l5 as gm,XU as hm,JU as im,YU as jm,QU as km,Q1 as lm,q5 as mm,p5 as nm,XZ as om,jU as pm,JZ as qm,_U as rm,m$ as sm,_7 as tm,G1 as um,l$ as vm,GZ as wm,VU as xm,V1 as ym,qZ as zm,f0 as Am,OU as Bm,wU as Cm,jZ as Dm,_Z as Em,D7 as Fm,N7 as Gm,A7 as Hm,IU as Im,y7 as Jm,a$ as Km,W5 as Lm,i5 as Mm,gU as Nm,r$ as Om,uZ as Pm,dZ as Qm,mZ as Rm,hU as Sm,C7 as Tm,P7 as Um,z1 as Vm,AX as Wm,MX as Xm,IX as Ym,kX as Zm,z6 as _m,TX as $m,m as an,z3 as bn,j5 as cn,_5 as dn,t5 as en,bX as fn,e5 as gn,yX as hn,$$ as in,F1 as jn,H6 as kn,L1 as ln,B6 as mn,j6 as nn,Z$ as on,K3 as pn,$0 as qn,xX as rn,gX as sn,hX as tn,g1 as un,H3 as vn,B3 as wn,i0 as xn,j3 as yn,V3 as zn,X$ as An,dX as Bn,mX as Cn,lX as Dn,O6 as En,W$ as Fn,j0 as Gn,v6 as Hn,M3 as In,K1 as Jn,w1 as Kn,f6 as Ln,O5 as Mn,z$ as Nn,I3 as On,FJ as Pn,wJ as Qn,h6 as Rn,DJ as Sn,NJ as Tn,d6 as Un,R1 as Vn,UK as Wn,m6 as Xn,S3 as Yn,TJ as Zn,y3 as _n,EJ as $n,bJ as ao,WK as bo,zK as co,l6 as do,c6 as eo,p6 as fo,yJ as go,SJ as ho,KK as io,HK as jo,CJ as ko,BK as lo,jK as mo,s6 as no,t6 as oo,v3 as po,MK as qo,w5 as ro,f3 as so,x3 as to,IK as uo,oJ as vo,kK as wo,rJ as xo,Z9 as yo,TK as zo,aJ as Ao,EK as Bo,bK as Co,l3 as Do,vK as Eo,fK as Fo,xK as Go,gK as Ho,hK as Io,$Y as Jo,uK as Ko,H$ as Lo,ZY as Mo,dK as No,mK as Oo,lK as Po,cK as Qo,qY as Ro,WY as So,RY as To,m3 as Uo,Q9 as Vo,pK as Wo,B$ as Xo,WG as Yo,LG as Zo,k4 as _o,Y8 as $o,GB as ap,U8 as bp,fQ as cp,gQ as dp,F8 as ep,z4 as fp,L8 as gp,R8 as hp,D8 as ip,sQ as jp,oQ as kp,N8 as lp,q4 as mp,rQ as np,tQ as op,w2 as pp,eG as qp,$q as rp,Zq as sp,Xq as tp,Jq as up,R2 as vp,qq as wp,Kq as xp,Hq as yp,F9 as zp,L9 as Ap,QH as Bp,z9 as Cp,GH as Dp,i3 as Ep,n3 as Fp,s3 as Gp,N9 as Hp,A9 as Ip,M9 as Jp,L6 as Kp,w6 as Lp,R6 as Mp,D6 as Np,O3 as Op,F3 as Pp,Jz as Qp,Yz as Rp,Qz as Sp,pX as Tp,Gz as Up,EH as Vp,bH as Wp,k9 as Xp,yH as Yp,b9 as Zp,nY as _p,S9 as $p,f9 as aq,c9 as bq,F$ as cq,cH as dq,pH as eq,Z4 as fq,n9 as gq,s9 as hq,MQ as iq,nH as jq,sH as kq,IQ as lq,oH as mq,o9 as nq,r9 as oq,w$ as pq,R$ as qq,n1 as rq,TQ as sq,t9 as tq,e9 as uq,$8 as vq,EQ as wq,bQ as xq,X4 as yq,J4 as zq,Z8 as Aq,X8 as Bq,T4 as Cq,E4 as Dq,S4 as Eq,C4 as Fq,dG as Gq,iG as Hq,nG as Iq,sG as Jq,oG as Kq,Vq as Lq,N1 as Mq,v4 as Nq,A1 as Oq,E$ as Pq,Rq as Qq,Dq as Rq,Nq as Sq,I1 as Tq,t as Uq,Y$ as Vq,b2 as Wq,B0 as Xq,dV as Yq,mV as Zq,d7 as _q,m7 as $q,O1 as ar,l7 as br,v1 as cr,c7 as dr,H5 as er,tU as fr,XX as gr,e$ as hr,eU as ir,$3 as jr,$W as kr,ZW as lr,W1 as mr,XW as nr,JW as or,YW as pr,QW as qr,GW as rr,qW as sr,JX as tr,X3 as ur,p7 as vr,WW as wr,zW as xr,KW as yr,HW as zr,BW as Ar,n7 as Br,jW as Cr,s7 as Dr,_W as Er,VW as Fr,B5 as Gr,WX as Hr,wW as Ir,KX as Jr,$6 as Kr,r5 as Lr,IW as Mr,q6 as Nr,W3 as Or,Hz as Pr,w3 as Qr,aX as Rr,ZJ as Sr,Bz as Tr,jz as Ur,_z as Vr,Vz as Wr,Oz as Xr,Fz as Yr,XJ as Zr,JJ as _r,N6 as $r,S6 as as,qJ as bs,D3 as cs,C6 as ds,Pz as es,vz as fs,A3 as gs,BJ as hs,P6 as is};