@stacksjs/stx 0.2.745 → 0.2.747

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 (101) hide show
  1. package/dist/chunk-181r1814.js +2 -0
  2. package/dist/{chunk-59m4zta2.js → chunk-1ewtjh1w.js} +1 -1
  3. package/dist/chunk-1kdw7cms.js +2 -0
  4. package/dist/chunk-2bgrwygq.js +2 -0
  5. package/dist/chunk-2e2yh6t5.js +2 -0
  6. package/dist/{chunk-dc1b9qrp.js → chunk-2gcj7sty.js} +1 -1
  7. package/dist/{chunk-er1r66m6.js → chunk-3rc07ans.js} +1 -1
  8. package/dist/{chunk-avjbhczg.js → chunk-3v3dssk7.js} +1 -1
  9. package/dist/{chunk-2dc3bxec.js → chunk-3xa9vxyq.js} +4 -4
  10. package/dist/{chunk-9c0sjs5j.js → chunk-4rer7y75.js} +1 -1
  11. package/dist/{chunk-psf38nq6.js → chunk-4w8zdkxw.js} +1 -1
  12. package/dist/{chunk-5pxtqq83.js → chunk-4wpp8zqg.js} +1 -1
  13. package/dist/chunk-6amq1fnc.js +2 -0
  14. package/dist/{chunk-fcep45sw.js → chunk-6jgt685n.js} +1 -1
  15. package/dist/{chunk-xznv6fnn.js → chunk-6ph5jasj.js} +6 -6
  16. package/dist/{chunk-5rrjmvna.js → chunk-6xytp0tk.js} +1 -1
  17. package/dist/chunk-7017n280.js +2 -0
  18. package/dist/{chunk-vw07g57k.js → chunk-72a5fgj3.js} +5 -5
  19. package/dist/{chunk-zj6k5d98.js → chunk-7fdw7p3e.js} +1 -1
  20. package/dist/chunk-7hky61eh.js +2 -0
  21. package/dist/{chunk-q53eg32x.js → chunk-7w7f14jq.js} +1 -1
  22. package/dist/chunk-8a40gq1k.js +2 -0
  23. package/dist/{chunk-5s7swxer.js → chunk-8b6stw4x.js} +1 -1
  24. package/dist/{chunk-rm8nt1gr.js → chunk-8f14cgm8.js} +1 -1
  25. package/dist/chunk-9hbgp70k.js +2 -0
  26. package/dist/chunk-a5j9sbff.js +2 -0
  27. package/dist/chunk-b8wgnpat.js +3 -0
  28. package/dist/{chunk-3qe85y8x.js → chunk-bas06v5y.js} +1 -1
  29. package/dist/{chunk-220pc67r.js → chunk-bj0z4gve.js} +1 -1
  30. package/dist/{chunk-309m7fk2.js → chunk-byxksw9c.js} +1 -1
  31. package/dist/{chunk-jhdqq80c.js → chunk-c3bdjva4.js} +1 -1
  32. package/dist/{chunk-37q792qg.js → chunk-cczxhrbh.js} +1 -1
  33. package/dist/chunk-chxhfdpc.js +2 -0
  34. package/dist/{chunk-a4avfxz2.js → chunk-d25pawk8.js} +2 -2
  35. package/dist/{chunk-4zbmw3bt.js → chunk-d7tgfndt.js} +1 -1
  36. package/dist/{chunk-9h1m8h7x.js → chunk-dnt3q3jv.js} +1 -1
  37. package/dist/{chunk-eys9qtvt.js → chunk-dxsdr77m.js} +1 -1
  38. package/dist/{chunk-pdjr53q1.js → chunk-e8g374pz.js} +1 -1
  39. package/dist/chunk-et11hr3d.js +2 -0
  40. package/dist/{chunk-qxt8dw9q.js → chunk-ewf7sq6y.js} +1 -1
  41. package/dist/{chunk-e6527scq.js → chunk-fb6af3vk.js} +1 -1
  42. package/dist/chunk-g0n18v7m.js +2 -0
  43. package/dist/{chunk-fef0x3da.js → chunk-g78zvf6j.js} +1 -1
  44. package/dist/{chunk-esj3wb57.js → chunk-hp3vebgn.js} +2 -2
  45. package/dist/{chunk-1ysfm4w8.js → chunk-k9tay7g7.js} +1 -1
  46. package/dist/{chunk-bngfwrxs.js → chunk-kb1ghegh.js} +2 -2
  47. package/dist/{chunk-t3zs3pgm.js → chunk-m5a8zgft.js} +1 -1
  48. package/dist/{chunk-z9pzqt8v.js → chunk-mjjb720w.js} +1 -1
  49. package/dist/{chunk-ecp3bh3p.js → chunk-mt41rpec.js} +1 -1
  50. package/dist/chunk-n79ww4aq.js +2 -0
  51. package/dist/{chunk-dmm7skxs.js → chunk-pach41d0.js} +1 -1
  52. package/dist/{chunk-6bdjwv43.js → chunk-qgpy8cye.js} +1 -1
  53. package/dist/{chunk-n96wmvtm.js → chunk-r6jjx157.js} +1 -1
  54. package/dist/chunk-r8e80xr8.js +2 -0
  55. package/dist/{chunk-yj70yp6d.js → chunk-rwsyemkp.js} +1 -1
  56. package/dist/{chunk-fcaxgwwb.js → chunk-s8vj3xs0.js} +6 -6
  57. package/dist/{chunk-sfscvxaw.js → chunk-stkxvrxd.js} +1 -1
  58. package/dist/{chunk-ab6hx6en.js → chunk-ttrjc1w5.js} +29 -29
  59. package/dist/{chunk-qzs0barx.js → chunk-v364k1q7.js} +1 -1
  60. package/dist/{chunk-v1v5w18z.js → chunk-v5yhcpg3.js} +1 -1
  61. package/dist/{chunk-shf75rrg.js → chunk-wpwh529h.js} +26 -26
  62. package/dist/{chunk-00c0wzsm.js → chunk-xjv46712.js} +4 -4
  63. package/dist/{chunk-drf0h877.js → chunk-y4rm4gpv.js} +2 -2
  64. package/dist/chunk-y6t6djz7.js +2 -0
  65. package/dist/{chunk-9022fa2r.js → chunk-yfg0fwkk.js} +3 -3
  66. package/dist/{chunk-vewm14fk.js → chunk-z24bjeny.js} +1 -1
  67. package/dist/{chunk-wnven47g.js → chunk-z6kz9jqc.js} +2 -2
  68. package/dist/{chunk-mkjtvm6r.js → chunk-zeqybrbc.js} +1 -1
  69. package/dist/{chunk-8n1najwy.js → chunk-zsqg1cy6.js} +1 -1
  70. package/dist/cli.js +7 -7
  71. package/dist/craft-entry.js +1 -1
  72. package/dist/craft.js +1 -1
  73. package/dist/native/compiler/html-to-ir.d.ts +2 -0
  74. package/dist/native/compiler/html-to-ir.js +3 -1
  75. package/dist/native/compiler/icons.d.ts +4 -2
  76. package/dist/native/compiler/icons.js +9 -9
  77. package/dist/native/compiler/layout-chrome.d.ts +1 -1
  78. package/dist/native/compiler/layout-chrome.js +6 -4
  79. package/dist/native/compiler/render-screen.js +4 -1
  80. package/dist/native/runtime/native-host.js +9 -2
  81. package/dist/pwa.js +1 -1
  82. package/dist/safe-evaluator.js +13 -2
  83. package/dist/ssg.js +2 -2
  84. package/package.json +5 -5
  85. package/dist/chunk-00160599.js +0 -2
  86. package/dist/chunk-093s0gye.js +0 -2
  87. package/dist/chunk-10zmf3zh.js +0 -2
  88. package/dist/chunk-2m0vj036.js +0 -2
  89. package/dist/chunk-643tvm0k.js +0 -3
  90. package/dist/chunk-7314r3dn.js +0 -2
  91. package/dist/chunk-95wasv6s.js +0 -2
  92. package/dist/chunk-cnsc2paf.js +0 -2
  93. package/dist/chunk-ek61s5wf.js +0 -2
  94. package/dist/chunk-nb5xxv4t.js +0 -2
  95. package/dist/chunk-ng3p44jj.js +0 -2
  96. package/dist/chunk-rgc2p1cj.js +0 -2
  97. package/dist/chunk-tr9qcjpe.js +0 -2
  98. package/dist/chunk-v7qcp28k.js +0 -2
  99. package/dist/chunk-vbp0b5tr.js +0 -2
  100. package/dist/chunk-yv8h5sjb.js +0 -2
  101. package/dist/chunk-zph16kja.js +0 -2
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{zg}from"./chunk-3rc07ans.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{zg as buildApp};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{bn,ci}from"./chunk-t3zs3pgm.js";import"./chunk-nzwcbt98.js";export{ci as generateRuntimeConfigTypes,bn as prepareRuntimeConfig};
2
+ import{bn,ci}from"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";export{ci as generateRuntimeConfigTypes,bn as prepareRuntimeConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{xg}from"./chunk-mjjb720w.js";import"./chunk-yfg0fwkk.js";import"./chunk-4w8zdkxw.js";import"./chunk-stkxvrxd.js";import"./chunk-b8wgnpat.js";import"./chunk-3xa9vxyq.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{xg as startProductionServer};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vl,Ki,Cg,wl,xl,Eg,Tg}from"./chunk-d7tgfndt.js";import"./chunk-8b6stw4x.js";import"./chunk-6jgt685n.js";import"./chunk-stkxvrxd.js";import"./chunk-1xjv71dw.js";import"./chunk-hp3vebgn.js";import"./chunk-3xa9vxyq.js";import"./chunk-8f14cgm8.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import{At,Of}from"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{vl as buildVirtualSource,At as extractScriptBlocks,Of as extractTemplateExpressions,wl as findRuntimeTypeDeclarations,xl as findStxModuleDeclarations,Tg as formatTypecheckDiagnostics,Cg as sourcePathFor,Eg as typecheckStxFiles,Ki as virtualPathFor};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zn,i}from"./chunk-s8vj3xs0.js";import"./chunk-z6kz9jqc.js";import"./chunk-91pycazt.js";import"./chunk-e8g374pz.js";import"./chunk-xjv46712.js";import"./chunk-dnt3q3jv.js";import"./chunk-b8wgnpat.js";import"./chunk-bj0z4gve.js";import"./chunk-hp3vebgn.js";import{be}from"./chunk-3xa9vxyq.js";import"./chunk-8f14cgm8.js";import"./chunk-bas06v5y.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import{Ie,Ps,Is}from"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{Zn as buildModulesTag,be as injectRouterScript,i as processDirectives,Ps as processJsonDirective,Is as processOnceDirective,Ie as validateClientScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{_}from"./chunk-27agaezn.js";import{A,kn}from"./chunk-zn3c0ew5.js";import{C,Y}from"./chunk-xznv6fnn.js";import{a}from"./chunk-a4avfxz2.js";import{Te,Qt,en,tn}from"./chunk-fcep45sw.js";import{yt}from"./chunk-esj3wb57.js";import{ft,jn,Kt,ce}from"./chunk-h6pmg82p.js";import{T,$r}from"./chunk-byaasw3f.js";import p from"path";var c=new Map;function v(i,n){for(let s of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of i.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let o of(s[1]??"").split(",")){let l=((o.includes(":")?o.split(":").pop():o)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of i.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let o of(s[1]??"").split(",")){let r=o.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function Im(i){let n;if(i)n=p.resolve(i);else{let t=await a();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${en()}`,o=new Bun.Glob("*.ts"),r=[];try{for await(let t of o.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return ce(c,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>Te(t))])],f=ft(l()),d=Kt(c,s,f);if(d!==void 0)return d||null;if(r.length===0)return ce(c,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let b=u.map((t)=>t.file),m=[],g=new Set,x=Y({loader:"ts",target:"browser",define:C()});for(let t of b)try{let e=await Bun.file(t).text(),y=p.basename(t,".ts");if(v(e,g),Qt(e))e=await tn(e,t,{projectRoot:process.cwd(),externalizeUserModules:T()});e=yt(e),e=A(e),e=kn(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=x.transformSync(e),m.push(`// Store: ${y}
2
+ import{_}from"./chunk-27agaezn.js";import{A,kn}from"./chunk-zn3c0ew5.js";import{C,Y}from"./chunk-6ph5jasj.js";import{a}from"./chunk-d25pawk8.js";import{Te,Qt,en,tn}from"./chunk-6jgt685n.js";import{yt}from"./chunk-hp3vebgn.js";import{ft,jn,Kt,ce}from"./chunk-h6pmg82p.js";import{T,$r}from"./chunk-byaasw3f.js";import p from"path";var c=new Map;function v(i,n){for(let s of i.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(s[1])n.add(s[1]);for(let s of i.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let o of(s[1]??"").split(",")){let l=((o.includes(":")?o.split(":").pop():o)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(l))n.add(l)}for(let s of i.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let o of(s[1]??"").split(",")){let r=o.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(r))n.add(r)}}async function Im(i){let n;if(i)n=p.resolve(i);else{let t=await a();n=p.resolve(t.root||process.cwd(),t.storesDir||"stores")}let s=`${n}\x00${en()}`,o=new Bun.Glob("*.ts"),r=[];try{for await(let t of o.scan({cwd:n,absolute:!0})){let e=p.basename(t,".ts");if(["index","types"].includes(e))continue;if(t.includes(".d.ts"))continue;r.push(t)}}catch{return ce(c,s,"",""),null}let l=()=>[...new Set([...r,...r.flatMap((t)=>Te(t))])],f=ft(l()),d=Kt(c,s,f);if(d!==void 0)return d||null;if(r.length===0)return ce(c,s,f,""),null;let u=[];for(let t of r){let e=await Bun.file(t).text();u.push({file:t,hasUseStore:/useStore\s*\(/.test(e)})}u.sort((t,e)=>{if(t.hasUseStore===e.hasUseStore)return 0;return t.hasUseStore?1:-1});let b=u.map((t)=>t.file),m=[],g=new Set,x=Y({loader:"ts",target:"browser",define:C()});for(let t of b)try{let e=await Bun.file(t).text(),y=p.basename(t,".ts");if(v(e,g),Qt(e))e=await tn(e,t,{projectRoot:process.cwd(),externalizeUserModules:T()});e=yt(e),e=A(e),e=kn(e),e=e.replace(/^export\s+(default\s+)?/gm,""),e=x.transformSync(e),m.push(`// Store: ${y}
3
3
  ${e.trim()}`)}catch(e){console.warn(`[stx] Failed to load store ${t}:`,e)}if(m.length===0)return ce(c,s,f,""),null;let S=m.join(`
4
4
 
5
5
  `),h=`;(function(){
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{a}from"./chunk-a4avfxz2.js";import{so}from"./chunk-3kw9m62d.js";import p from"path";async function zg(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(so(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-v7qcp28k.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
2
+ import{a}from"./chunk-d25pawk8.js";import{so}from"./chunk-3kw9m62d.js";import p from"path";async function zg(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(so(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-9hbgp70k.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
3
3
  export{zg};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{sh,rs,Ao,ss,rr,Po,Io,os,is,as,Oo,Ka,bf,yt}from"./chunk-esj3wb57.js";import"./chunk-2dc3bxec.js";import"./chunk-rm8nt1gr.js";import"./chunk-a4avfxz2.js";import"./chunk-fef0x3da.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-eys9qtvt.js";import"./chunk-4s1k8k2a.js";import{z}from"./chunk-xznv6fnn.js";import"./chunk-t3zs3pgm.js";import"./chunk-nzwcbt98.js";import"./chunk-shf75rrg.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{sh as clearScriptScanCache,os as convertServerLoopAttributesToDirectives,Po as convertSignalDirectivesToAttributes,is as convertSignalLoopsToAttributes,rr as extractClientSignalNames,z as extractExports,Ka as findMarkupIndexOutsideScripts,ss as hasSignalsSyntax,Ao as parseLoopExpression,Io as preEvalLiteralReactiveIfs,as as processScriptSetup,Oo as processSignals,bf as rewriteStxImportSpecifiers,rs as scanScriptTags,yt as stripStxRuntimeImports};
2
+ import{sh,rs,Ao,ss,rr,Po,Io,os,is,as,Oo,Ka,bf,yt}from"./chunk-hp3vebgn.js";import"./chunk-3xa9vxyq.js";import"./chunk-8f14cgm8.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import{z}from"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{sh as clearScriptScanCache,os as convertServerLoopAttributesToDirectives,Po as convertSignalDirectivesToAttributes,is as convertSignalLoopsToAttributes,rr as extractClientSignalNames,z as extractExports,Ka as findMarkupIndexOutsideScripts,ss as hasSignalsSyntax,Ao as parseLoopExpression,Io as preEvalLiteralReactiveIfs,as as processScriptSetup,Oo as processSignals,bf as rewriteStxImportSpecifiers,rs as scanScriptTags,yt as stripStxRuntimeImports};
@@ -1,14 +1,14 @@
1
1
  // @bun
2
- import{ur}from"./chunk-4s1k8k2a.js";import{Sr}from"./chunk-shf75rrg.js";import{a}from"./chunk-a4avfxz2.js";import{L,Xe}from"./chunk-f4gqzg1y.js";import{Ja}from"./chunk-cka9p9v5.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function sr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function G(e,r={}){return new ur(e,r).routes}import w from"path";var T=new Map;async function y(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=T.get(n);if(c)return c;let o=[];try{o=G(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return O(JSON.stringify(e))}function ye(e){return e.includes("data-stx-runtime")}function Ga(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function f(e,r){let t=sr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
2
+ import{ur}from"./chunk-4s1k8k2a.js";import{Sr}from"./chunk-wpwh529h.js";import{a}from"./chunk-d25pawk8.js";import{L,Xe}from"./chunk-f4gqzg1y.js";import{Ja}from"./chunk-cka9p9v5.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function sr(e){let r=0,t=0,s=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let c=p.exec(e);if(c){x.lastIndex=n+c[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let o=b.exec(e);if(o){if(t===0)s=n;t++,r=n+o[0].length;continue}S.lastIndex=n;let u=S.exec(e);if(u){if(t>0)t--;r=n+u[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?s:n;r=n+1}return-1}function G(e,r={}){return new ur(e,r).routes}import w from"path";var T=new Map;async function y(e,r){let t=e,s=r;if(!t||!s)try{let u=await a();t||=u?.pagesDir||"pages",s||=u?.root||"."}catch{t||="pages",s||="."}let n=w.isAbsolute(t)?t:w.join(s,t),c=T.get(n);if(c)return c;let o=[];try{o=G(".",{pagesDir:n,emit:!1}).map((u)=>u.regex.source).filter(Boolean)}catch{o=[]}return T.set(n,o),o}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return O(JSON.stringify(e))}function ye(e){return e.includes("data-stx-runtime")}function Ga(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let s=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(s))continue;return!0}return!1}function f(e,r){let t=sr(e),s=e.search(/<!doctype\b/i);if(t!==-1&&(s===-1||t>s))return e.slice(0,t)+r+`
3
3
  `+e.slice(t);let n=Sr(e);if(n!==null)return`${e.slice(0,n)}
4
4
  ${r}${e.slice(n)}`;if(e.includes("</head>")){let o=e.indexOf("</head>");return e.slice(0,o)+r+`
5
5
  `+e.slice(o)}if(L(e))return Xe(e,(o)=>`${o}
6
6
  ${r}`);return`${r}
7
- ${e}`}async function or(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-vewm14fk.js"),{url:c}=await n("runtime",r.debug===!0);return f(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return f(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-vewm14fk.js"),s=await t(r.debug);return f(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function Xa(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${Ja()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
7
+ ${e}`}async function or(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-z24bjeny.js"),{url:c}=await n("runtime",r.debug===!0);return f(e,`<script data-stx-runtime src="${c}"></script>`)}if(r.buildMode==="compile")return f(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-z24bjeny.js"),s=await t(r.debug);return f(e,`<script data-stx-scoped data-stx-runtime>${s}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function Xa(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${Ja()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
8
8
  ${r}`;return`${e.slice(0,t)}${r}
9
- ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function be(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let g=await y(r?.pagesDir,r?.root);if(g.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-vewm14fk.js");n=`<script data-stx-owned-routes src="${h(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(g)};
9
+ ${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function be(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,s="",n="";{let i={};if(t){if(t.container)i.container=t.container;if(t.interceptAllLinks!==void 0)i.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)i.progress=t.progress;if(t.viewTransitions!==void 0)i.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)i.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)i.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)i.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)i.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)i.prefetch=t.prefetch;if(t.cache!==void 0)i.cache=t.cache;if(t.progressColor!==void 0)i.progressColor=t.progressColor;if(t.progressHeight!==void 0)i.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)i.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)i.prefetchVisibleMax=t.prefetchVisibleMax;if(t.keepOpening!==void 0)i.keepOpening=t.keepOpening}try{let g=await y(r?.pagesDir,r?.root);if(g.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-z24bjeny.js");n=`<script data-stx-owned-routes src="${h(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(g)};
10
10
  `)}"></script>
11
11
  `}else i.ownedRoutes=g}catch{}if(Object.keys(i).length>0)s=`<script>window.__stxRouterConfig=${l(i)};</script>
12
- `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-vewm14fk.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
12
+ `}let{getCachedRouterScript:c,getServeClientAsset:o}=await import("./chunk-z24bjeny.js"),u=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await o("router")).url}"></script>`:`<script data-stx-router>${await c()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+s+n+u+`
13
13
  </body>`+e.slice(d+7)}
14
14
  export{sr,G,ye,Ga,or,Xa,be};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{m,ti,Ac,Pc,Hf,Vf,Uf,Wf,qf,Os,Kf,Le,Y,je,Gf,wr,Xf,Nc,oi,Be,r,hn,Dc,h,fe,wh}from"./chunk-xznv6fnn.js";import"./chunk-t3zs3pgm.js";import"./chunk-nzwcbt98.js";import"./chunk-shf75rrg.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{fe as clearComponentCache,oi as componentClientSignalNames,ti as convertToCommonJS,h as createDetailedErrorMessage,qf as extractDirectiveNames,Ac as extractScriptFromTemplate,m as extractVariables,r as fileExists,wh as getComponentCacheStats,Vf as getPositionInfo,Y as getSharedTranspiler,Dc as getSourceLineInfo,Wf as hasDirectives,Pc as hasVariables,Xf as isHydrateTrigger,Kf as isJavaScriptScript,Be as renderComponentWithSlot,hn as resolveTemplatePath,Gf as scopeOnRootElement,Os as scopeSequenceKey,Le as shouldTranspileTypeScript,Nc as slotContentHasExpressions,je as transpileTypeScript,wr as userComponentFileExists,Uf as validateDirective,Hf as validateTemplate};
2
+ import{m,ti,Ac,Pc,Hf,Vf,Uf,Wf,qf,Os,Kf,Le,Y,je,Gf,wr,Xf,Nc,oi,Be,r,hn,Dc,h,fe,wh}from"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{fe as clearComponentCache,oi as componentClientSignalNames,ti as convertToCommonJS,h as createDetailedErrorMessage,qf as extractDirectiveNames,Ac as extractScriptFromTemplate,m as extractVariables,r as fileExists,wh as getComponentCacheStats,Vf as getPositionInfo,Y as getSharedTranspiler,Dc as getSourceLineInfo,Wf as hasDirectives,Pc as hasVariables,Xf as isHydrateTrigger,Kf as isJavaScriptScript,Be as renderComponentWithSlot,hn as resolveTemplatePath,Gf as scopeOnRootElement,Os as scopeSequenceKey,Le as shouldTranspileTypeScript,Nc as slotContentHasExpressions,je as transpileTypeScript,wr as userComponentFileExists,Uf as validateDirective,Hf as validateTemplate};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{W,Oe}from"./chunk-xznv6fnn.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function Jt(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Oe(t,s);if(p>s){c=p;continue}let a=W(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
2
+ import{W,Oe}from"./chunk-6ph5jasj.js";var o=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function u(t,e,r){let i={fullTag:r,content:e,attrs:t};if(/\bserver\b/.test(t))return{...i,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...i,type:"client"};if(o.test(e))return{...i,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...i,type:"client"};return{...i,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function Jt(t){let e=[],r=[],i=[],c=0;while(c<t.length){let s=t.indexOf("<",c);if(s===-1)break;let p=Oe(t,s);if(p>s){c=p;continue}let a=W(t,s);if(a>s){let f=t.slice(s,a),l=S.exec(f);if(l){let n=u(l[1],l[2],f);switch(n.type){case"signals":e.push(n);break;case"client":r.push(n);break;case"server":i.push(n);break}}c=a;continue}c=s+(t.startsWith("<!--",s)?4:1)}return{signals:e,client:r,server:i}}
3
3
  export{Jt};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{we,ni,ri,zf,Ot,Ic,si,Oc,vh,De,mn,Me}from"./chunk-xznv6fnn.js";import{Bc,s}from"./chunk-q1db41k8.js";import"./chunk-t3zs3pgm.js";import"./chunk-nzwcbt98.js";import"./chunk-shf75rrg.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{we as BROWSER_CORE_IMPORTS,zf as STX_AUTO_IMPORTS,ni as extractAndStripCssImports,De as extractBridgeData,Bc as findInterpolationEnd,Oc as generateAutoImportDestructuring,vh as generateBrowserAutoImportDestructuring,mn as generateServerDataBridge,Ot as injectBrowserCoreAutoImports,Me as processClientScript,si as referencesName,ri as renderVendorStyleTags,s as stripCommentsAndLiterals,Ic as transformAutoImports};
2
+ import{we,ni,ri,zf,Ot,Ic,si,Oc,vh,De,mn,Me}from"./chunk-6ph5jasj.js";import{Bc,s}from"./chunk-q1db41k8.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{we as BROWSER_CORE_IMPORTS,zf as STX_AUTO_IMPORTS,ni as extractAndStripCssImports,De as extractBridgeData,Bc as findInterpolationEnd,Oc as generateAutoImportDestructuring,vh as generateBrowserAutoImportDestructuring,mn as generateServerDataBridge,Ot as injectBrowserCoreAutoImports,Me as processClientScript,si as referencesName,ri as renderVendorStyleTags,s as stripCommentsAndLiterals,Ic as transformAutoImports};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Im,Om}from"./chunk-2gcj7sty.js";import"./chunk-6jgt685n.js";import"./chunk-stkxvrxd.js";import"./chunk-1xjv71dw.js";import"./chunk-hp3vebgn.js";import"./chunk-3xa9vxyq.js";import"./chunk-8f14cgm8.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{Om as clearStoreCache,Im as getStoreScript};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Yn,$e}from"./chunk-1xjv71dw.js";import{z,w,gr,Es,C}from"./chunk-xznv6fnn.js";import{a,P}from"./chunk-a4avfxz2.js";import{wo}from"./chunk-sfscvxaw.js";import{et}from"./chunk-j2mpqa4p.js";import{l}from"./chunk-h2y36t58.js";import{s,ge}from"./chunk-q1db41k8.js";import d from"path";import v from"fs";import{AsyncLocalStorage as ht}from"async_hooks";var xt=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||wo(t,e,n)}var at=2;function nf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):l(t,"bundle-cache")}function st(t,e){let n=t;for(let i of $t(e))if(i!==d.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function $t(t){let e=d.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=v.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((u,m)=>m.length-u.length),rt.set(e,n)}return n}function yt(t,e){try{let n=v.statSync(t),i=d.resolve(e),u=t.startsWith(`${i}${d.sep}`);return{path:u?d.relative(i,t):t,...u?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(v.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function bt(t,e){for(let n of t){let i=ct(n,e);try{let u=v.statSync(i);if(u.size!==n.size)return!1;if(u.mtimeMs!==n.mtimeMs&&Bun.hash(v.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,wt=100;function rf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function St(t){let e=G.get(t)??0;if(e>0&&e<wt){G.set(t,e+1);return}G.set(t,1);try{let n=(await v.promises.readdir(t)).filter((c)=>c.endsWith(".js")),i=rf();if(n.length<=i)return;let m=(await Promise.all(n.map(async(c)=>{try{return{name:c,at:(await v.promises.stat(d.join(t,c))).mtimeMs}}catch{return null}}))).filter((c)=>c!==null);m.sort((c,y)=>y.at-c.at);for(let c of m.slice(i)){let y=c.name.slice(0,-3);await v.promises.rm(d.join(t,`${y}.js`),{force:!0}),await v.promises.rm(d.join(t,`${y}.deps.json`),{force:!0})}D("pruned bundle cache to",i,"entries")}catch{}}function Te(t){return lt.get(t)??[]}function q(t,e){if(t)lt.set(t,e)}function sf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function D(...t){if(sf())console.log("[stx:bundler]",...t)}var Y=[];function Fa(t,e,n){Y.push({filePath:t||"<inline>",message:e,details:n})}function Yt(){return Y.slice()}function Zt(){Y.length=0}var Z;function Gm(t){Z=t}function za(){if(Z)return Z;try{let t=P.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function Qt(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let u=n[1];if(!Q.some((c)=>c.test(u)))return D("detected user import:",u),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let u=n[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Q.some((c)=>c.test(u)))return D("detected side-effect import:",u),!0}return!1}var Jn="stx-module:",vt=/\.(?:[cm]?[jt]sx?|json)$/i;function of(t,e){return d.relative(t,e).split(d.sep).join("/")}function af(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,u,m)=>{let c=e.get(m);return c&&!m.startsWith(Jn)?`${i}${u}${c}${u}`:n})}function cf(t,e){let n=0,i=(m)=>{let c=`__stxMod${n++}`,y=JSON.stringify(m);return e.push(`var ${c} = globalThis.__stxModules && globalThis.__stxModules[${y}];`,`if (${c} === undefined) throw new Error("[stx] module " + ${JSON.stringify(y)} + " is not registered on this page (#1957)");`),c},u=(m,c)=>{for(let y of m.split(",")){let R=y.trim();if(!R)continue;let B=R.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!B)continue;let j=B[1].startsWith('"')?JSON.parse(B[1]):B[1],p=B[2]??j;e.push(`var ${p} = ${c}[${JSON.stringify(j)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,c,y)=>{let R=y.slice(Jn.length),B=i(R),j=c.trim(),p=j.match(/^([\w$]+)\s*(?:,\s*|$)/);if(p&&!j.startsWith("{")&&!j.startsWith("*"))e.push(`var ${p[1]} = ${B}.default;`),j=j.slice(p[0].length).trim();let r=j.match(/^\*\s*as\s+([\w$]+)$/);if(r)e.push(`var ${r[1]} = ${B};`);else if(j.startsWith("{"))u(j.replace(/^\{|\}$/g,""),B);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,c)=>(i(c.slice(Jn.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,d.join(t,"index.ts"),d.join(t,"index.tsx"),d.join(t,"index.js"),d.join(t,"index.mjs")];for(let n of e)try{if(v.existsSync(n)&&v.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var K=new ht;function ho(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,u]of[...t].sort(([m],[c])=>m<c?-1:m>c?1:0))n.update(`${i}\x00${u}\x00`);return K.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function en(){return K.getStore()?.key??""}function Bt(t,e,n,i,u,m,c=new Map,y,R){let B=(p,r,o)=>{if(X(r,t,y))return null;if(!m||p!==n||!vt.test(r))return null;try{if(!v.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}u.add(r);let b=`${Jn}${of(process.cwd(),r)}`;return c.set(o,b),{path:b,external:!0}},j=(p,r)=>{let o=p===n?e:d.dirname(p),b=d.resolve(o,r);return it(b)??b};return{name:"stx-client-bundle",setup(p){if(p.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),p.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),p.onResolve({filter:/^\//},(r)=>{if(r.path===n)return{path:n};let o=it(r.path);if(o){let b=B(r.importer,o,r.path);if(b)return b;if(o!==n)u.add(o);return{path:o}}return{path:r.path,external:!0}}),p.onResolve({filter:/^\.\.?\//},(r)=>{let o=j(r.importer,r.path),b=B(r.importer,o,r.path);if(b)return b;return u.add(o),{path:o}}),p.onResolve({filter:/^[@~]\//},(r)=>{let o=d.resolve(t,r.path.slice(2)),b=[o,`${o}.ts`,`${o}.tsx`,`${o}.js`,`${o}.mjs`,`${o}.jsx`,d.join(o,"index.ts"),d.join(o,"index.tsx"),d.join(o,"index.js"),d.join(o,"index.mjs")];for(let x of b)if(v.existsSync(x)&&v.statSync(x,{throwIfNoEntry:!1})?.isFile()){let A=B(r.importer,x,r.path);if(A)return A;return D(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",x),u.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:o}}),m)p.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(r.importer!==n)return;let o=`${Jn}npm:${r.path}`;return c.set(r.path,o),{path:o,external:!0}});p.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(r.path===n)return{contents:i,loader:"ts"};if(X(r.path,t,y))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let o=d.extname(r.path).toLowerCase(),b=o===".json"?"json":o===".tsx"?"tsx":o===".jsx"?"jsx":o===".ts"||o===".mts"||o===".cts"?"ts":"js";if(r.path!==n)u.add(r.path);let x=R?.get(r.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:v.readFileSync(r.path,"utf8"),loader:b}})}}}var H=new Map,k=w(64),ot=Symbol.for("stx.client-bundle-build-queue");function lf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function tn(t,e,n={}){let i=n.projectRoot||process.cwd(),u=(await a(i)).serverApi,m=n.minify??!1,c=n.externalizeUserModules??!0,y=n.expose?.length?[...new Set(n.expose)].sort():void 0,R=n.cacheDir||nf(i),B=K.getStore(),j=new Bun.CryptoHasher("md5");j.update(`${xt}\x00${et()}\x00${JSON.stringify(u??!1)}\x00${c?"registry":"inline"}\x00${y?y.join(","):"*"}\x00${m?"minified":"readable"}\x00${B?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let p=j.digest("hex").slice(0,12),r=d.join(R,`${p}.js`),o=k.get(r);if(o){if(Es(o.files)&&o.files.every((M)=>!X(M.path,i,u))){D("memo hit:",p);let M=o.files.map((O)=>O.path);return q(e,M),n.collectInputs?.push(...M),o.code}k.delete(r),D("memo invalidated by dep change:",p)}let b=d.join(R,`${p}.deps.json`),x=Bun.file(r);if(await x.exists()){let M=Bun.file(b),O=!1,I=null;if(await M.exists())try{let F=JSON.parse(await M.text());if(F.metadataVersion===at&&Array.isArray(F.files)&&bt(F.files,i))I=gr(F.files.map((g)=>ct(g,i))),O=I.length===F.files.length&&!I.some((g)=>X(g.path,i,u))}catch{O=!1}if(O){if(D("cache hit:",p),I)q(e,I.map((T)=>T.path)),n.collectInputs?.push(...I.map((T)=>T.path));let F=await x.text(),g=new Date;if(v.promises.utimes(r,g,g).catch(()=>{}),I)k.set(r,{code:F,files:I});return F}D("cache invalidated by dep change:",p)}let A=H.get(p);if(A){let M=await A;if(n.collectInputs)n.collectInputs.push(...(k.get(r)?.files??[]).map((O)=>O.path));return M}let V=lf(()=>_t(t,e,{projectRoot:i,minify:m,cacheDir:R,hash:p,cachePath:r,depsPath:b,collectInputs:n.collectInputs,externalizeUserModules:c,serverApi:u,expose:y,throwOnFailure:n.throwOnFailure,substitutes:B?.modules}));H.set(p,V);try{return await V}finally{H.delete(p)}}var jt=0;function uf(t){return`${t}-${process.pid}-${++jt}`}async function _t(t,e,n){let{projectRoot:i,minify:u,cacheDir:m,hash:c,cachePath:y,depsPath:R,externalizeUserModules:B}=n,j=l(i,"bundle-tmp"),p=uf(c),r=d.join(i,`.stx-client-${p}.ts`),o=d.join(j,"out",p);v.mkdirSync(o,{recursive:!0});let b=d.dirname(e),x=new Set,A=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,V=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=s(t),{depths:O,balanced:I}=ge(M),F=(_)=>!I||O[_]===0,g;while((g=A.exec(M))!==null){if(g[1])continue;if(!F(g.index))continue;if(g[2])g[2].split(",").forEach((_)=>{let f=Et(_);if(f)x.add(f)});else if(g[3])x.add(g[3])}while((g=V.exec(M))!==null){if(g[1])continue;if(!F(g.index))continue;x.add(g[2])}let T=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=T.exec(M))!==null){if(!F(g.index))continue;let _=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(_&&Q.some((f)=>f.test(_)))continue;if(g[1])x.add(g[1]);if(g[2])x.add(g[2]);for(let f of(g[3]??"").split(",")){let S=f.trim();if(!S||/^type\s/.test(S))continue;let L=/\bas\s+(\w+)\s*$/.exec(S)?.[1]??/^\w+$/.exec(S)?.[0];if(L)x.add(L)}}for(let _ of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of _[1].split(",")){let S=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(S)x.delete(S)}let ut=x.size>0?`
2
+ import{Yn,$e}from"./chunk-1xjv71dw.js";import{z,w,gr,Es,C}from"./chunk-6ph5jasj.js";import{a,P}from"./chunk-d25pawk8.js";import{wo}from"./chunk-stkxvrxd.js";import{et}from"./chunk-j2mpqa4p.js";import{l}from"./chunk-h2y36t58.js";import{s,ge}from"./chunk-q1db41k8.js";import d from"path";import v from"fs";import{AsyncLocalStorage as ht}from"async_hooks";var xt=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||wo(t,e,n)}var at=2;function nf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):l(t,"bundle-cache")}function st(t,e){let n=t;for(let i of $t(e))if(i!==d.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function $t(t){let e=d.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=v.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((u,m)=>m.length-u.length),rt.set(e,n)}return n}function yt(t,e){try{let n=v.statSync(t),i=d.resolve(e),u=t.startsWith(`${i}${d.sep}`);return{path:u?d.relative(i,t):t,...u?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(v.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function bt(t,e){for(let n of t){let i=ct(n,e);try{let u=v.statSync(i);if(u.size!==n.size)return!1;if(u.mtimeMs!==n.mtimeMs&&Bun.hash(v.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,wt=100;function rf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function St(t){let e=G.get(t)??0;if(e>0&&e<wt){G.set(t,e+1);return}G.set(t,1);try{let n=(await v.promises.readdir(t)).filter((c)=>c.endsWith(".js")),i=rf();if(n.length<=i)return;let m=(await Promise.all(n.map(async(c)=>{try{return{name:c,at:(await v.promises.stat(d.join(t,c))).mtimeMs}}catch{return null}}))).filter((c)=>c!==null);m.sort((c,y)=>y.at-c.at);for(let c of m.slice(i)){let y=c.name.slice(0,-3);await v.promises.rm(d.join(t,`${y}.js`),{force:!0}),await v.promises.rm(d.join(t,`${y}.deps.json`),{force:!0})}D("pruned bundle cache to",i,"entries")}catch{}}function Te(t){return lt.get(t)??[]}function q(t,e){if(t)lt.set(t,e)}function sf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function D(...t){if(sf())console.log("[stx:bundler]",...t)}var Y=[];function Fa(t,e,n){Y.push({filePath:t||"<inline>",message:e,details:n})}function Yt(){return Y.slice()}function Zt(){Y.length=0}var Z;function Gm(t){Z=t}function za(){if(Z)return Z;try{let t=P.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function Qt(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let u=n[1];if(!Q.some((c)=>c.test(u)))return D("detected user import:",u),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let u=n[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Q.some((c)=>c.test(u)))return D("detected side-effect import:",u),!0}return!1}var Jn="stx-module:",vt=/\.(?:[cm]?[jt]sx?|json)$/i;function of(t,e){return d.relative(t,e).split(d.sep).join("/")}function af(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,u,m)=>{let c=e.get(m);return c&&!m.startsWith(Jn)?`${i}${u}${c}${u}`:n})}function cf(t,e){let n=0,i=(m)=>{let c=`__stxMod${n++}`,y=JSON.stringify(m);return e.push(`var ${c} = globalThis.__stxModules && globalThis.__stxModules[${y}];`,`if (${c} === undefined) throw new Error("[stx] module " + ${JSON.stringify(y)} + " is not registered on this page (#1957)");`),c},u=(m,c)=>{for(let y of m.split(",")){let R=y.trim();if(!R)continue;let B=R.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!B)continue;let j=B[1].startsWith('"')?JSON.parse(B[1]):B[1],p=B[2]??j;e.push(`var ${p} = ${c}[${JSON.stringify(j)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,c,y)=>{let R=y.slice(Jn.length),B=i(R),j=c.trim(),p=j.match(/^([\w$]+)\s*(?:,\s*|$)/);if(p&&!j.startsWith("{")&&!j.startsWith("*"))e.push(`var ${p[1]} = ${B}.default;`),j=j.slice(p[0].length).trim();let r=j.match(/^\*\s*as\s+([\w$]+)$/);if(r)e.push(`var ${r[1]} = ${B};`);else if(j.startsWith("{"))u(j.replace(/^\{|\}$/g,""),B);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,c)=>(i(c.slice(Jn.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,d.join(t,"index.ts"),d.join(t,"index.tsx"),d.join(t,"index.js"),d.join(t,"index.mjs")];for(let n of e)try{if(v.existsSync(n)&&v.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var K=new ht;function ho(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,u]of[...t].sort(([m],[c])=>m<c?-1:m>c?1:0))n.update(`${i}\x00${u}\x00`);return K.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function en(){return K.getStore()?.key??""}function Bt(t,e,n,i,u,m,c=new Map,y,R){let B=(p,r,o)=>{if(X(r,t,y))return null;if(!m||p!==n||!vt.test(r))return null;try{if(!v.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}u.add(r);let b=`${Jn}${of(process.cwd(),r)}`;return c.set(o,b),{path:b,external:!0}},j=(p,r)=>{let o=p===n?e:d.dirname(p),b=d.resolve(o,r);return it(b)??b};return{name:"stx-client-bundle",setup(p){if(p.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),p.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),p.onResolve({filter:/^\//},(r)=>{if(r.path===n)return{path:n};let o=it(r.path);if(o){let b=B(r.importer,o,r.path);if(b)return b;if(o!==n)u.add(o);return{path:o}}return{path:r.path,external:!0}}),p.onResolve({filter:/^\.\.?\//},(r)=>{let o=j(r.importer,r.path),b=B(r.importer,o,r.path);if(b)return b;return u.add(o),{path:o}}),p.onResolve({filter:/^[@~]\//},(r)=>{let o=d.resolve(t,r.path.slice(2)),b=[o,`${o}.ts`,`${o}.tsx`,`${o}.js`,`${o}.mjs`,`${o}.jsx`,d.join(o,"index.ts"),d.join(o,"index.tsx"),d.join(o,"index.js"),d.join(o,"index.mjs")];for(let x of b)if(v.existsSync(x)&&v.statSync(x,{throwIfNoEntry:!1})?.isFile()){let A=B(r.importer,x,r.path);if(A)return A;return D(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",x),u.add(x),{path:x}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:o}}),m)p.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(r.importer!==n)return;let o=`${Jn}npm:${r.path}`;return c.set(r.path,o),{path:o,external:!0}});p.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(r.path===n)return{contents:i,loader:"ts"};if(X(r.path,t,y))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let o=d.extname(r.path).toLowerCase(),b=o===".json"?"json":o===".tsx"?"tsx":o===".jsx"?"jsx":o===".ts"||o===".mts"||o===".cts"?"ts":"js";if(r.path!==n)u.add(r.path);let x=R?.get(r.path);if(x!==void 0)return{contents:x,loader:"js"};return{contents:v.readFileSync(r.path,"utf8"),loader:b}})}}}var H=new Map,k=w(64),ot=Symbol.for("stx.client-bundle-build-queue");function lf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function tn(t,e,n={}){let i=n.projectRoot||process.cwd(),u=(await a(i)).serverApi,m=n.minify??!1,c=n.externalizeUserModules??!0,y=n.expose?.length?[...new Set(n.expose)].sort():void 0,R=n.cacheDir||nf(i),B=K.getStore(),j=new Bun.CryptoHasher("md5");j.update(`${xt}\x00${et()}\x00${JSON.stringify(u??!1)}\x00${c?"registry":"inline"}\x00${y?y.join(","):"*"}\x00${m?"minified":"readable"}\x00${B?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let p=j.digest("hex").slice(0,12),r=d.join(R,`${p}.js`),o=k.get(r);if(o){if(Es(o.files)&&o.files.every((M)=>!X(M.path,i,u))){D("memo hit:",p);let M=o.files.map((O)=>O.path);return q(e,M),n.collectInputs?.push(...M),o.code}k.delete(r),D("memo invalidated by dep change:",p)}let b=d.join(R,`${p}.deps.json`),x=Bun.file(r);if(await x.exists()){let M=Bun.file(b),O=!1,I=null;if(await M.exists())try{let F=JSON.parse(await M.text());if(F.metadataVersion===at&&Array.isArray(F.files)&&bt(F.files,i))I=gr(F.files.map((g)=>ct(g,i))),O=I.length===F.files.length&&!I.some((g)=>X(g.path,i,u))}catch{O=!1}if(O){if(D("cache hit:",p),I)q(e,I.map((T)=>T.path)),n.collectInputs?.push(...I.map((T)=>T.path));let F=await x.text(),g=new Date;if(v.promises.utimes(r,g,g).catch(()=>{}),I)k.set(r,{code:F,files:I});return F}D("cache invalidated by dep change:",p)}let A=H.get(p);if(A){let M=await A;if(n.collectInputs)n.collectInputs.push(...(k.get(r)?.files??[]).map((O)=>O.path));return M}let V=lf(()=>_t(t,e,{projectRoot:i,minify:m,cacheDir:R,hash:p,cachePath:r,depsPath:b,collectInputs:n.collectInputs,externalizeUserModules:c,serverApi:u,expose:y,throwOnFailure:n.throwOnFailure,substitutes:B?.modules}));H.set(p,V);try{return await V}finally{H.delete(p)}}var jt=0;function uf(t){return`${t}-${process.pid}-${++jt}`}async function _t(t,e,n){let{projectRoot:i,minify:u,cacheDir:m,hash:c,cachePath:y,depsPath:R,externalizeUserModules:B}=n,j=l(i,"bundle-tmp"),p=uf(c),r=d.join(i,`.stx-client-${p}.ts`),o=d.join(j,"out",p);v.mkdirSync(o,{recursive:!0});let b=d.dirname(e),x=new Set,A=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,V=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=s(t),{depths:O,balanced:I}=ge(M),F=(_)=>!I||O[_]===0,g;while((g=A.exec(M))!==null){if(g[1])continue;if(!F(g.index))continue;if(g[2])g[2].split(",").forEach((_)=>{let f=Et(_);if(f)x.add(f)});else if(g[3])x.add(g[3])}while((g=V.exec(M))!==null){if(g[1])continue;if(!F(g.index))continue;x.add(g[2])}let T=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=T.exec(M))!==null){if(!F(g.index))continue;let _=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(_&&Q.some((f)=>f.test(_)))continue;if(g[1])x.add(g[1]);if(g[2])x.add(g[2]);for(let f of(g[3]??"").split(",")){let S=f.trim();if(!S||/^type\s/.test(S))continue;let L=/\bas\s+(\w+)\s*$/.exec(S)?.[1]??/^\w+$/.exec(S)?.[0];if(L)x.add(L)}}for(let _ of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of _[1].split(",")){let S=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(S)x.delete(S)}let ut=x.size>0?`
3
3
  export { ${[...x].join(", ")} }`:"";D("bundling:",c,"from:",d.basename(e));let tt=new Set,nt=new Map;try{let _=await Bun.build({entrypoints:[r],outdir:o,target:"browser",format:"esm",minify:u?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[Bt(i,b,r,t+ut,tt,B,nt,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...C()},root:i});if(!_.success){let E=_.logs.filter((N)=>N.level==="error").map((N)=>N.message).join(", ")||`Unable to bundle ${d.basename(e)}`,U=Yn(_.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",E),Fa(e||"",E,U),n.throwOnFailure||za()==="error")throw Error(E);return t}let f="";for(let h of _.outputs){f=await h.text();break}let S=[];for(let h of f.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let E of h[1].split(",")){let U=E.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(U){S.push([U[2],U[1]]);continue}let N=E.trim();if(/^[A-Za-z_$][\w$]*$/.test(N))S.push([N,N])}if(n.expose){let h=new Set(n.expose);for(let E=S.length-1;E>=0;E--)if(!h.has(S[E][0]))S.splice(E,1)}let L=[];f=cf(af(f,nt),L);let dt=f.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(f=f.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),u&&f)try{f=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(f)}catch{}let J=`__stxBundle_${c}`,pt=new Set(z(t,!0).split(",").map((h)=>h.trim())),ft=S.map(([h,E])=>`get ${JSON.stringify(h)}() { return ${E} }${pt.has(h)?`, set ${JSON.stringify(h)}(__stxValue_${E}) { ${E} = __stxValue_${E} }`:""}`).join(", "),mt=S.map(([h])=>`var ${h} = undefined;`).join(`
4
4
  `),gt=S.map(([h])=>`${h} = ${J}[${JSON.stringify(h)}];`).join(`
5
5
  `);if(f=`${dt.join(`
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fe,vn,Ds,li,O}from"./chunk-nzwcbt98.js";import{bn}from"./chunk-t3zs3pgm.js";import{Rr,_,Gc,ot,yi,Xc}from"./chunk-27agaezn.js";import{A}from"./chunk-zn3c0ew5.js";import{Ms,u,f,Mt,d,q,B,b,Fs,ke,He,zs}from"./chunk-shf75rrg.js";import{s,ge}from"./chunk-q1db41k8.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-byaasw3f.js";import Xe from"path";import kt from"process";import{AsyncLocalStorage as ko}from"async_hooks";var cr=new ko;function fn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function lr(e,n){return cr.run(fn(e),n)}async function ur(e,n){let t=cr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let c=JSON.stringify(l,(v,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),y=JSON.parse(c);return t.values.set(e,y),y}).catch((l)=>{throw t.pending.delete(e),l});return t.pending.set(e,a),a}function vr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function z(e,n=!1){let t=s(e),i=[],a=new Set,l=0,c=0,y=t.length,v=()=>{if(l!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(n&&R[1]==="const")return;let P=R[2];if(!a.has(P))i.push(P),a.add(P);return}let T=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){if(n&&t.slice(c).startsWith("const"))return;T[1].split(",").forEach((P)=>{let M=P.trim();if(!M)return;let G=M.indexOf(":"),L=(G>=0?M.slice(G+1).trim():M).split(/[\s=]/)[0];if(L&&!a.has(L))i.push(L),a.add(L)});return}let D=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(D){if(n&&t.slice(c).startsWith("const"))return;D[1].split(",").forEach((P)=>{let M=P.trim().replace(/^\.\.\./,"");if(!M)return;let G=M.split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}if(n)return;let N=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let P=N[1];if(!a.has(P))i.push(P),a.add(P);return}let j=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let P=j[1];if(!a.has(P))i.push(P),a.add(P)}};while(c<y){if(t[c]==="{"){l++,c++;continue}if(t[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))v();c++}return i.join(", ")}function xs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Ro(e,n=z(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(z(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ss(e,n){let t=`{ ${Ro(e,n)} }`;return z(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import An from"fs";import Ae from"path";function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var fr=new Map;function ks(e,n=!0){let t=fr.get(e);if(n&&t)return t;let i=new Map,a=[Ae.join(e,"src"),Ae.join(e,"dist"),e];function l(c,y){if(y>6)return;let v;try{v=An.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of v){let T=Ae.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;l(T,y+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let D=R.name.slice(0,-4);if(!i.has(D))i.set(D,T);let N=D.toLowerCase();if(!i.has(N))i.set(N,T);let j=H(D);if(!i.has(j))i.set(j,T)}}}for(let c of a)if(l(c,0),i.size>0)break;if(n)fr.set(e,i);return i}function _s(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let t=n;while(!0){let i=Ae.join(t,"node_modules",e);try{if(An.statSync(i).isDirectory())return i}catch{}let a=Ae.dirname(t);if(a===t)return null;t=a}}function Cs(e,n,t={}){return[Ae.resolve(Ae.dirname(n),`${e}.stx`),Ae.resolve(Ae.dirname(n),e),Ae.resolve(t.componentsDir||"components",`${e}.stx`),Ae.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function dr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,t=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=H(n);return[n,t,i]}function qo(e,n){let[t,i,a]=dr(e);for(let l of[t,t.toLowerCase(),i,a]){let c=n?.__importedComponents?.get(l);if(c!==void 0)return c}}function*Ko(e,n,t={},i){let a=dr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ae.resolve(Ae.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=t.projectRoot||process.cwd(),y=[...i?.__originalFilePath?[Ae.join(Ae.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ae.join(Ae.dirname(n),"components"),Ae.resolve(c,"src/components"),Ae.resolve(c,"components"),...import.meta.dir?[Ae.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let R of l)yield Ae.join(v,R);try{for(let R of An.readdirSync(v,{withFileTypes:!0}))if(R.isDirectory())for(let T of l)yield Ae.join(v,R.name,T)}catch{}}}function pr(e,n,t={},i){let a=qo(e,i);if(a!==void 0)return a;for(let l of Ko(e,n,t,i))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}import Ys from"fs";import ce from"path";import ht from"path";import qt from"fs";var Co=new Set(["touchstart","touchmove","wheel","mousewheel"]);function os(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return Co.has(e.toLowerCase())}var xr=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"]),_r={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"},To=new Set(["ctrl","alt","shift","meta"]),Er={left:0,middle:1,right:2};function Sr(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(To.has(i))n.systemKeys.push(i);else if(i in Er)n.mouse=i;else if(i in _r||/^[a-z]$/.test(i))n.keys.push(_r[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function kr(e,n=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,y,v]=l,R=l.index,T=R+c.length,D=`__stx_evt_${n}${i++}`,N=[],j=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=j.exec(v))!==null){let[,G,F]=P,L=G.split("."),Q=L[0];if(!xr.has(Q))continue;N.push({attribute:`@${G}`,event:Q,handler:F,modifiers:Sr(L.slice(1)),elementId:D})}let M=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=M.exec(v))!==null){let[,G,F]=P,L=G.split("."),Q=L[0];if(!xr.has(Q))continue;N.push({attribute:`@${G}`,event:Q,handler:F,modifiers:Sr(L.slice(1)),elementId:D})}if(N.length>0)t.push({originalTag:c,elementId:D,events:N,startIndex:R,endIndex:T})}return t}function Ao(e){let n=[],{modifiers:t}=e;if(t.self)n.push("if ($event.target !== $el) return");for(let i of t.systemKeys)n.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=Er[t.mouse];n.push(`if ($event.button !== ${i}) return`)}if(t.prevent)n.push("$event.preventDefault()");if(t.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Io(e,n){let t=e;if(n.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${n.debounce})`;else if(n.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${n.throttle})`;return t}function as(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Oo(e){let{modifiers:n}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Ao(e),a=Io(as(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(os(e.event,n))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",y=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{Fe,vn,Ds,li,O}from"./chunk-nzwcbt98.js";import{bn}from"./chunk-m5a8zgft.js";import{Rr,_,Gc,ot,yi,Xc}from"./chunk-27agaezn.js";import{A}from"./chunk-zn3c0ew5.js";import{Ms,u,f,Mt,d,q,B,b,Fs,ke,He,zs}from"./chunk-wpwh529h.js";import{s,ge}from"./chunk-q1db41k8.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-byaasw3f.js";import Xe from"path";import kt from"process";import{AsyncLocalStorage as ko}from"async_hooks";var cr=new ko;function fn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function lr(e,n){return cr.run(fn(e),n)}async function ur(e,n){let t=cr.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let c=JSON.stringify(l,(v,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),y=JSON.parse(c);return t.values.set(e,y),y}).catch((l)=>{throw t.pending.delete(e),l});return t.pending.set(e,a),a}function vr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function z(e,n=!1){let t=s(e),i=[],a=new Set,l=0,c=0,y=t.length,v=()=>{if(l!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(n&&R[1]==="const")return;let P=R[2];if(!a.has(P))i.push(P),a.add(P);return}let T=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){if(n&&t.slice(c).startsWith("const"))return;T[1].split(",").forEach((P)=>{let M=P.trim();if(!M)return;let G=M.indexOf(":"),L=(G>=0?M.slice(G+1).trim():M).split(/[\s=]/)[0];if(L&&!a.has(L))i.push(L),a.add(L)});return}let D=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(D){if(n&&t.slice(c).startsWith("const"))return;D[1].split(",").forEach((P)=>{let M=P.trim().replace(/^\.\.\./,"");if(!M)return;let G=M.split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}if(n)return;let N=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let P=N[1];if(!a.has(P))i.push(P),a.add(P);return}let j=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let P=j[1];if(!a.has(P))i.push(P),a.add(P)}};while(c<y){if(t[c]==="{"){l++,c++;continue}if(t[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))v();c++}return i.join(", ")}function xs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Ro(e,n=z(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(z(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Ss(e,n){let t=`{ ${Ro(e,n)} }`;return z(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import An from"fs";import Ae from"path";function H(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var fr=new Map;function ks(e,n=!0){let t=fr.get(e);if(n&&t)return t;let i=new Map,a=[Ae.join(e,"src"),Ae.join(e,"dist"),e];function l(c,y){if(y>6)return;let v;try{v=An.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of v){let T=Ae.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;l(T,y+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let D=R.name.slice(0,-4);if(!i.has(D))i.set(D,T);let N=D.toLowerCase();if(!i.has(N))i.set(N,T);let j=H(D);if(!i.has(j))i.set(j,T)}}}for(let c of a)if(l(c,0),i.size>0)break;if(n)fr.set(e,i);return i}function _s(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let t=n;while(!0){let i=Ae.join(t,"node_modules",e);try{if(An.statSync(i).isDirectory())return i}catch{}let a=Ae.dirname(t);if(a===t)return null;t=a}}function Cs(e,n,t={}){return[Ae.resolve(Ae.dirname(n),`${e}.stx`),Ae.resolve(Ae.dirname(n),e),Ae.resolve(t.componentsDir||"components",`${e}.stx`),Ae.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function dr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,t=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=H(n);return[n,t,i]}function qo(e,n){let[t,i,a]=dr(e);for(let l of[t,t.toLowerCase(),i,a]){let c=n?.__importedComponents?.get(l);if(c!==void 0)return c}}function*Ko(e,n,t={},i){let a=dr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ae.resolve(Ae.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=t.projectRoot||process.cwd(),y=[...i?.__originalFilePath?[Ae.join(Ae.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ae.join(Ae.dirname(n),"components"),Ae.resolve(c,"src/components"),Ae.resolve(c,"components"),...import.meta.dir?[Ae.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let R of l)yield Ae.join(v,R);try{for(let R of An.readdirSync(v,{withFileTypes:!0}))if(R.isDirectory())for(let T of l)yield Ae.join(v,R.name,T)}catch{}}}function pr(e,n,t={},i){let a=qo(e,i);if(a!==void 0)return a;for(let l of Ko(e,n,t,i))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}import Ys from"fs";import ce from"path";import ht from"path";import qt from"fs";var Co=new Set(["touchstart","touchmove","wheel","mousewheel"]);function os(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return Co.has(e.toLowerCase())}var xr=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"]),_r={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"},To=new Set(["ctrl","alt","shift","meta"]),Er={left:0,middle:1,right:2};function Sr(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(To.has(i))n.systemKeys.push(i);else if(i in Er)n.mouse=i;else if(i in _r||/^[a-z]$/.test(i))n.keys.push(_r[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function kr(e,n=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,y,v]=l,R=l.index,T=R+c.length,D=`__stx_evt_${n}${i++}`,N=[],j=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=j.exec(v))!==null){let[,G,F]=P,L=G.split("."),Q=L[0];if(!xr.has(Q))continue;N.push({attribute:`@${G}`,event:Q,handler:F,modifiers:Sr(L.slice(1)),elementId:D})}let M=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=M.exec(v))!==null){let[,G,F]=P,L=G.split("."),Q=L[0];if(!xr.has(Q))continue;N.push({attribute:`@${G}`,event:Q,handler:F,modifiers:Sr(L.slice(1)),elementId:D})}if(N.length>0)t.push({originalTag:c,elementId:D,events:N,startIndex:R,endIndex:T})}return t}function Ao(e){let n=[],{modifiers:t}=e;if(t.self)n.push("if ($event.target !== $el) return");for(let i of t.systemKeys)n.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=Er[t.mouse];n.push(`if ($event.button !== ${i}) return`)}if(t.prevent)n.push("$event.preventDefault()");if(t.stop)n.push("$event.stopPropagation()");return n.join("; ")}function Io(e,n){let t=e;if(n.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${n.debounce})`;else if(n.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${n.throttle})`;return t}function as(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Oo(e){let{modifiers:n}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Ao(e),a=Io(as(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(os(e.event,n))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",y=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${t}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function Po(e,n=""){let t=kr(e,n);if(t.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=t.length-1;l>=0;l--){let c=t[l],y=c.originalTag;if(!y.includes(" id="))y=y.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let v=y.match(/id=["']([^"']+)["']/);if(v)for(let R of c.events)R.elementId=v[1]}for(let v of c.events){let R=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),T=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),D=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");y=y.replace(T,""),y=y.replace(D,"")}i=i.slice(0,c.startIndex)+y+i.slice(c.endIndex),a.push(...c.events)}return{template:i,bindings:a}}function $r(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function fc(e,n,t){if(Xc(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:y,bindings:v}=Po(e,$r(n)),R=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...R,...v],y}let i=kr(e,$r(n));if(i.length===0)return e;let a=e;for(let y=i.length-1;y>=0;y--){let v=i[y],R=v.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let T=R.match(/id=["']([^"']+)["']/);if(T)for(let D of v.events)D.elementId=T[1]}for(let T of v.events){let D=T.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),N=new RegExp(`\\s*${D}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${D}\\s*=\\s*'[^']*'`,"g");R=R.replace(N,""),R=R.replace(j,"")}a=a.slice(0,v.startIndex)+R+a.slice(v.endIndex)}let l=Go(i.flatMap((y)=>y.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+l+`
115
- `+a.slice(c);else a+=l;return a}function Cr(e,n){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Tt(e,n){let t=s(e),{depths:i,balanced:a}=ge(t),l=(y)=>!a||i[y]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let y of t.matchAll(c)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Cr(y[1],!0).has(n))return!0;for(let y of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Cr(y[1],!1).has(n))return!0;return!1}var Tr="",In,lt=/^[A-Za-z_$][\w$]*$/,Do=new Set(["if","for","while","switch","with"]),Ar=["(","[","{"],Ir=[")","]","}"],Mo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function jo(e){let n=s(e),t=[];for(let i of n.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:n,tokens:t}}function cs(e){if(In&&e===Tr)return In;let{code:n,tokens:t}=jo(e),i=new Map,a=[];for(let P=0;P<t.length;P++){let M=t[P].text;if(["(","[","{"].includes(M))a.push(P);else if([")","]","}"].includes(M)){let G=a.at(-1);if(G!==void 0&&["()","[]","{}"].includes(t[G].text+M))a.pop(),i.set(G,P),i.set(P,G)}}function l(P,M){let G=[],F=P;for(let L=P;L<M;L++){if(["(","[","{"].includes(t[L].text)&&(i.get(L)??M)<M){L=i.get(L);continue}if(t[L].text===",")G.push([F,L]),F=L+1}return G.push([F,M]),G}let c=[];function y(P,M,G,F=!1){if(t[P]?.text==="...")P++;if(P>=M)return;let L=t[P].text;if(lt.test(L)){if(G.add(L),G===T)c.push({name:L,token:P,functionScoped:F});return}if(L!=="{"&&L!=="[")return;let Q=i.get(P);if(Q===void 0||Q>=M)return;for(let[te,ne]of l(P+1,Q)){let ae=te;if(L==="{")for(let me=te;me<ne;me++){if(t[me].text===":"){ae=me+1;break}if(t[me].text==="=")break;if(["(","[","{"].includes(t[me].text)&&i.has(me))me=i.get(me)}y(ae,ne,G,F)}}function v(P,M){let G=new Set;for(let[F,L]of l(P,M))y(F,L,G);return G}function R(P){let M=P;for(;M<t.length;M++){let G=t[M].text;if(["(","[","{"].includes(G)&&i.has(M)){M=i.get(M);continue}if([",",";",")","]","}"].includes(G))break}return t[Math.max(P,M-1)]?.end??n.length}let T=new Set,D=[];for(let P=0;P<t.length;P++)if(t[P].text==="=>"){let M=P-1,G=M,F;if(t[M]?.text===")"&&i.has(M))G=i.get(M),F=v(G+1,M);else if(t[M]&&lt.test(t[M].text))F=new Set([t[M].text]);else continue;let L=P+1,Q=t[L]?.text==="{"&&i.has(L)?t[i.get(L)].end:R(L);D.push({start:t[G].start,end:Q,bodyStart:t[L]?.start??Q,functionBody:!0,names:F})}else if(t[P].text==="("&&i.has(P)){let M=t[P-1]?.text;if(!M||Do.has(M)||!lt.test(M)&&M!=="*"&&M!=="]")continue;let G=i.get(P),F=G+1;if(t[F]?.text===":"){F++;while(F<t.length&&!["{","=>",";","="].includes(t[F].text))F++}if(t[F]?.text!=="{"||!i.has(F))continue;D.push({start:t[P].start,end:t[i.get(F)].end,bodyStart:t[F].start,functionBody:M!=="catch",names:v(P+1,G)})}function N(P){let M=P;for(;M<t.length;M++){let G=t[M].text;if(Ar.includes(G)&&i.has(M)){M=i.get(M);continue}if(G===";"||Ir.includes(G))break;let F=t[M-1];if(M>P&&Mo.has(G)&&F.text!==".")break;if(M>P&&/[\n\r]/.test(n.slice(F.end,t[M].start))&&(/^[\w$]+$/.test(F.text)||Ir.includes(F.text)||['"',"'","`"].includes(F.text))&&lt.test(G)&&!["in","of","instanceof"].includes(G))break}return M}let j=[];for(let P=0;P<t.length;P++){if(t[P].text!=="for")continue;let M=t[P+1]?.text==="await"?P+2:P+1;if(t[M]?.text!=="("||!i.has(M))continue;let G=i.get(M),F=G+1,L=t[F]?.text==="{"&&i.has(F)?i.get(F):N(F),Q=t[L]?.text===";"||t[L]?.text==="}"?t[L].end:t[Math.max(F,L-1)]?.end??n.length;j.push({headStart:M,headEnd:G,start:t[M].start,end:Q})}for(let P=0;P<t.length;P++){let M=t[P].text,G=t[P-1]?.text;if(G==="."||t[P+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(M==="const"||M==="let"||M==="var"){let F=N(P+1),L=P+1,Q=!1,te=!1,ne=0;for(let ae=P+1;ae<=F;ae++){let me=t[ae]?.text;if(ae<F&&Ar.includes(me)&&i.has(ae)&&i.get(ae)<F){ae=i.get(ae);continue}if(ae<F&&me===":"&&!te)Q=!0;else if(ae<F&&me==="="&&ne===0)Q=!1,te=!0;else if(ae<F&&Q&&me==="<")ne++;else if(ae<F&&Q&&me===">"&&ne>0)ne--;else if(ae===F||me===","&&ne===0)y(L,ae,T,M==="var"),L=ae+1,Q=!1,te=!1}}else if(M==="function"||M==="class"){let F=P+1;if(t[F]?.text==="*")F++;if(t[F]&&lt.test(t[F].text)&&t[F].text!=="extends")T.add(t[F].text),c.push({name:t[F].text,token:F})}else if(M==="import"){let F=P+1;if(t[F]?.text==="*"&&t[F+1]?.text==="as")F+=2;let L=t[F]?.text;if(L&&lt.test(L)&&L!=="type"&&t[F+1]?.text!=="("&&t[F+1]?.text!==".")T.add(L),c.push({name:L,token:F,file:!0});let Q=t[F]?.text==="{"?F:t[F+1]?.text===","&&t[F+2]?.text==="{"?F+2:-1;if(Q!==-1&&i.has(Q)){let te=i.get(Q);for(let[ne,ae]of l(Q+1,te)){let me=ae-1;while(me>=ne&&!lt.test(t[me].text))me--;if(me>=ne&&t[me].text!=="type")c.push({name:t[me].text,token:me,file:!0})}}}}return Tr=e,In={code:n,scopes:D,loops:j,declarations:T,sites:c,tokens:t,pairs:i},In}function ls(e){let n=cs(e);return{code:n.code,shadows:(t,i)=>n.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function On(e){return new Set(cs(e).declarations)}function cn(e,n){let{scopes:t,loops:i,sites:a,tokens:l,pairs:c}=cs(e),y=Array.from({length:l.length},()=>-1),v=[];for(let j=0;j<l.length;j++){y[j]=v.length?v[v.length-1]:-1;let P=l[j].text;if(P==="{"&&c.has(j))v.push(j);else if(P==="}"&&v.length&&c.get(j)===v[v.length-1])v.pop()}let R=new Set,T=new Map;for(let j of a){if(!n.has(j.name))continue;R.add(j.token);let P=j.file?-1:y[j.token],M=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(j.functionScoped){let F=l[j.token].start,L=t.filter((Q)=>Q.functionBody&&F>=Q.bodyStart&&F<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];M=L?[L.bodyStart,L.end]:[0,Number.POSITIVE_INFINITY]}else if(!j.file){let F=i.filter((L)=>j.token>L.headStart&&j.token<L.headEnd).sort((L,Q)=>L.headEnd-L.headStart-(Q.headEnd-Q.headStart))[0];if(F)M=[F.start,F.end]}let G=T.get(j.name);if(G)G.push(M);else T.set(j.name,[M])}let D=new Set;for(let j=0;j<l.length;j++){if(l[j].text!=="import"||l[j-1]?.text===".")continue;let P=j+1;if(l[P]?.text==="type")P++;if(l[P]&&lt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let M=P+1;M<c.get(P);M++)D.add(M)}let N=new Set;for(let j=0;j<l.length;j++){let P=l[j].text;if(!n.has(P)||N.has(P)||R.has(j)||D.has(j))continue;let M=l[j-1]?.text;if(M==="#"||M==="."&&l[j-2]?.text!=="..")continue;if(l[j+1]?.text===":"&&(M==="{"||M===","))continue;let G=l[j].start;if(T.get(P)?.some(([F,L])=>G>=F&&G<L))continue;if(t.some((F)=>G>=F.start&&G<F.end&&F.names.has(P)))continue;N.add(P)}return N}var Pe="0.2.745";var Or=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Lo(){let e=globalThis;return e[Or]??=new Map,e[Or]}function o(e,n){let t=Lo(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let l=n();return t.set(i,l),l.catch(()=>{if(t.get(i)===l)t.delete(i)}),l}var Bo=/<\/(script)/gi;function ln(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Bo,"<\\/$1")}import Mr from"fs";class U{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(n):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,zo=500;function $t(e,n){if(n?.includes("g"))return new RegExp(e,n);let t=`${e}:${n||""}`;if(!St.has(t)){if(St.size>=zo){let i=St.keys().next().value;if(i)St.delete(i)}St.set(t,new RegExp(e,n))}return St.get(t)}class Pr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),t=n.sort().join(","),i=this.pool.find((y)=>y.context.join(",")===t);if(i)return i.func;let a=this.fnCache,l=this.fnCacheMaxSize,c=(...y)=>(v)=>{try{let R=`${t}:${v}`,T=a.get(R);if(!T){if(a.size>=l){let D=a.keys().next().value;if(D)a.delete(D)}T=Function(...n,`
115
+ `+a.slice(c);else a+=l;return a}function Cr(e,n){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Tt(e,n){let t=s(e),{depths:i,balanced:a}=ge(t),l=(y)=>!a||i[y]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let y of t.matchAll(c)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Cr(y[1],!0).has(n))return!0;for(let y of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Cr(y[1],!1).has(n))return!0;return!1}var Tr="",In,lt=/^[A-Za-z_$][\w$]*$/,Do=new Set(["if","for","while","switch","with"]),Ar=["(","[","{"],Ir=[")","]","}"],Mo=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function jo(e){let n=s(e),t=[];for(let i of n.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:n,tokens:t}}function cs(e){if(In&&e===Tr)return In;let{code:n,tokens:t}=jo(e),i=new Map,a=[];for(let P=0;P<t.length;P++){let M=t[P].text;if(["(","[","{"].includes(M))a.push(P);else if([")","]","}"].includes(M)){let G=a.at(-1);if(G!==void 0&&["()","[]","{}"].includes(t[G].text+M))a.pop(),i.set(G,P),i.set(P,G)}}function l(P,M){let G=[],F=P;for(let L=P;L<M;L++){if(["(","[","{"].includes(t[L].text)&&(i.get(L)??M)<M){L=i.get(L);continue}if(t[L].text===",")G.push([F,L]),F=L+1}return G.push([F,M]),G}let c=[];function y(P,M,G,F=!1){if(t[P]?.text==="...")P++;if(P>=M)return;let L=t[P].text;if(lt.test(L)){if(G.add(L),G===T)c.push({name:L,token:P,functionScoped:F});return}if(L!=="{"&&L!=="[")return;let Q=i.get(P);if(Q===void 0||Q>=M)return;for(let[te,ne]of l(P+1,Q)){let ae=te;if(L==="{")for(let me=te;me<ne;me++){if(t[me].text===":"){ae=me+1;break}if(t[me].text==="=")break;if(["(","[","{"].includes(t[me].text)&&i.has(me))me=i.get(me)}y(ae,ne,G,F)}}function v(P,M){let G=new Set;for(let[F,L]of l(P,M))y(F,L,G);return G}function R(P){let M=P;for(;M<t.length;M++){let G=t[M].text;if(["(","[","{"].includes(G)&&i.has(M)){M=i.get(M);continue}if([",",";",")","]","}"].includes(G))break}return t[Math.max(P,M-1)]?.end??n.length}let T=new Set,D=[];for(let P=0;P<t.length;P++)if(t[P].text==="=>"){let M=P-1,G=M,F;if(t[M]?.text===")"&&i.has(M))G=i.get(M),F=v(G+1,M);else if(t[M]&&lt.test(t[M].text))F=new Set([t[M].text]);else continue;let L=P+1,Q=t[L]?.text==="{"&&i.has(L)?t[i.get(L)].end:R(L);D.push({start:t[G].start,end:Q,bodyStart:t[L]?.start??Q,functionBody:!0,names:F})}else if(t[P].text==="("&&i.has(P)){let M=t[P-1]?.text;if(!M||Do.has(M)||!lt.test(M)&&M!=="*"&&M!=="]")continue;let G=i.get(P),F=G+1;if(t[F]?.text===":"){F++;while(F<t.length&&!["{","=>",";","="].includes(t[F].text))F++}if(t[F]?.text!=="{"||!i.has(F))continue;D.push({start:t[P].start,end:t[i.get(F)].end,bodyStart:t[F].start,functionBody:M!=="catch",names:v(P+1,G)})}function N(P){let M=P;for(;M<t.length;M++){let G=t[M].text;if(Ar.includes(G)&&i.has(M)){M=i.get(M);continue}if(G===";"||Ir.includes(G))break;let F=t[M-1];if(M>P&&Mo.has(G)&&F.text!==".")break;if(M>P&&/[\n\r]/.test(n.slice(F.end,t[M].start))&&(/^[\w$]+$/.test(F.text)||Ir.includes(F.text)||['"',"'","`"].includes(F.text))&&lt.test(G)&&!["in","of","instanceof"].includes(G))break}return M}let j=[];for(let P=0;P<t.length;P++){if(t[P].text!=="for")continue;let M=t[P+1]?.text==="await"?P+2:P+1;if(t[M]?.text!=="("||!i.has(M))continue;let G=i.get(M),F=G+1,L=t[F]?.text==="{"&&i.has(F)?i.get(F):N(F),Q=t[L]?.text===";"||t[L]?.text==="}"?t[L].end:t[Math.max(F,L-1)]?.end??n.length;j.push({headStart:M,headEnd:G,start:t[M].start,end:Q})}for(let P=0;P<t.length;P++){let M=t[P].text,G=t[P-1]?.text;if(G==="."||t[P+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(M==="const"||M==="let"||M==="var"){let F=N(P+1),L=P+1,Q=!1,te=!1,ne=0;for(let ae=P+1;ae<=F;ae++){let me=t[ae]?.text;if(ae<F&&Ar.includes(me)&&i.has(ae)&&i.get(ae)<F){ae=i.get(ae);continue}if(ae<F&&me===":"&&!te)Q=!0;else if(ae<F&&me==="="&&ne===0)Q=!1,te=!0;else if(ae<F&&Q&&me==="<")ne++;else if(ae<F&&Q&&me===">"&&ne>0)ne--;else if(ae===F||me===","&&ne===0)y(L,ae,T,M==="var"),L=ae+1,Q=!1,te=!1}}else if(M==="function"||M==="class"){let F=P+1;if(t[F]?.text==="*")F++;if(t[F]&&lt.test(t[F].text)&&t[F].text!=="extends")T.add(t[F].text),c.push({name:t[F].text,token:F})}else if(M==="import"){let F=P+1;if(t[F]?.text==="*"&&t[F+1]?.text==="as")F+=2;let L=t[F]?.text;if(L&&lt.test(L)&&L!=="type"&&t[F+1]?.text!=="("&&t[F+1]?.text!==".")T.add(L),c.push({name:L,token:F,file:!0});let Q=t[F]?.text==="{"?F:t[F+1]?.text===","&&t[F+2]?.text==="{"?F+2:-1;if(Q!==-1&&i.has(Q)){let te=i.get(Q);for(let[ne,ae]of l(Q+1,te)){let me=ae-1;while(me>=ne&&!lt.test(t[me].text))me--;if(me>=ne&&t[me].text!=="type")c.push({name:t[me].text,token:me,file:!0})}}}}return Tr=e,In={code:n,scopes:D,loops:j,declarations:T,sites:c,tokens:t,pairs:i},In}function ls(e){let n=cs(e);return{code:n.code,shadows:(t,i)=>n.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function On(e){return new Set(cs(e).declarations)}function cn(e,n){let{scopes:t,loops:i,sites:a,tokens:l,pairs:c}=cs(e),y=Array.from({length:l.length},()=>-1),v=[];for(let j=0;j<l.length;j++){y[j]=v.length?v[v.length-1]:-1;let P=l[j].text;if(P==="{"&&c.has(j))v.push(j);else if(P==="}"&&v.length&&c.get(j)===v[v.length-1])v.pop()}let R=new Set,T=new Map;for(let j of a){if(!n.has(j.name))continue;R.add(j.token);let P=j.file?-1:y[j.token],M=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(j.functionScoped){let F=l[j.token].start,L=t.filter((Q)=>Q.functionBody&&F>=Q.bodyStart&&F<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];M=L?[L.bodyStart,L.end]:[0,Number.POSITIVE_INFINITY]}else if(!j.file){let F=i.filter((L)=>j.token>L.headStart&&j.token<L.headEnd).sort((L,Q)=>L.headEnd-L.headStart-(Q.headEnd-Q.headStart))[0];if(F)M=[F.start,F.end]}let G=T.get(j.name);if(G)G.push(M);else T.set(j.name,[M])}let D=new Set;for(let j=0;j<l.length;j++){if(l[j].text!=="import"||l[j-1]?.text===".")continue;let P=j+1;if(l[P]?.text==="type")P++;if(l[P]&&lt.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let M=P+1;M<c.get(P);M++)D.add(M)}let N=new Set;for(let j=0;j<l.length;j++){let P=l[j].text;if(!n.has(P)||N.has(P)||R.has(j)||D.has(j))continue;let M=l[j-1]?.text;if(M==="#"||M==="."&&l[j-2]?.text!=="..")continue;if(l[j+1]?.text===":"&&(M==="{"||M===","))continue;let G=l[j].start;if(T.get(P)?.some(([F,L])=>G>=F&&G<L))continue;if(t.some((F)=>G>=F.start&&G<F.end&&F.names.has(P)))continue;N.add(P)}return N}var Pe="0.2.747";var Or=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Lo(){let e=globalThis;return e[Or]??=new Map,e[Or]}function o(e,n){let t=Lo(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let l=n();return t.set(i,l),l.catch(()=>{if(t.get(i)===l)t.delete(i)}),l}var Bo=/<\/(script)/gi;function ln(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Bo,"<\\/$1")}import Mr from"fs";class U{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(n):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,zo=500;function $t(e,n){if(n?.includes("g"))return new RegExp(e,n);let t=`${e}:${n||""}`;if(!St.has(t)){if(St.size>=zo){let i=St.keys().next().value;if(i)St.delete(i)}St.set(t,new RegExp(e,n))}return St.get(t)}class Pr{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),t=n.sort().join(","),i=this.pool.find((y)=>y.context.join(",")===t);if(i)return i.func;let a=this.fnCache,l=this.fnCacheMaxSize,c=(...y)=>(v)=>{try{let R=`${t}:${v}`,T=a.get(R);if(!T){if(a.size>=l){let D=a.keys().next().value;if(D)a.delete(D)}T=Function(...n,`
116
116
  'use strict';
117
117
  try {
118
118
  return ${v};
@@ -193,7 +193,7 @@ else {
193
193
  // STX: auto-generated event bindings
194
194
  ${e.map((t,i)=>da(t,i)).join(`
195
195
  `)}`}function zr(e){let n=[],t=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,c=0;while(c<l){let y=i[c];if(y==="'"||y==='"'||y==="`"){let v=y;if(c++,v==="`"){let R=0;while(c<l){if(i[c]==="\\"){c+=2;continue}if(i[c]==="`"&&R===0){c++;break}if(i[c]==="$"&&i[c+1]==="{"){R++,c+=2;continue}if(i[c]==="}"&&R>0){R--,c++;continue}c++}}else while(c<l){if(i[c]==="\\"){c+=2;continue}if(i[c]===v){c++;break}c++}continue}if(y==="/"&&i[c+1]==="/"){while(c<l&&i[c]!==`
196
- `)c++;continue}if(y==="/"&&i[c+1]==="*"){c+=2;while(c<l-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(y==="{"){a++,c++;continue}if(y==="}"){a--,c++;continue}if(a===0){let v=i.slice(c),R=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let N=R[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=R[0].length;continue}let T=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){T[1].split(",").forEach((N)=>{let j=N.trim(),P=j.indexOf(":"),M=P>=0?j.slice(P+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(M&&!M.startsWith("_")&&!t.has(M))n.push(M),t.add(M)}),c+=T[0].length;continue}let D=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(D){let N=D[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=D[0].length;continue}}c++}return n}var ga=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 ma(e){let n=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(N){let j;while((j=t.exec(N))!==null){let P=j[0];if(!ga.has(P))n.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)i(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=R.exec(e))!==null)i(l[1]);let T=/@model\s*=\s*["']([^"']*)["']/gi;while((l=T.exec(e))!==null)i(l[1]);let D=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=D.exec(e))!==null)i(l[1]);return n}async function Me(e,n={}){let t=e,i="",a=!1,l=[],c=ni(t,{filePath:n.filePath,projectRoot:n.projectRoot});t=c.code;let y=ri(c.styles),v=Ot(t);t=v.code,l=[...v.imports,...v.models];let{hasUserImports:R,bundleClientScript:T}=await o("stx/client-script-bundler",()=>import("./chunk-mkjtvm6r.js"));if(R(t))t=await T(t,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let Q=Ic(t);t=Q.code,i=Oc(Q.stxImports,Q.browserImports.filter((te)=>!l.includes(te)))}if(i=`${mn(t,n.serverData)}${i}`,t=A(t),!a&&Le(n.attrs||""))t=je(t);let D=pa(n.eventBindings||[]),N=(n.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(N),P=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(j){let Q=N.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${P}${Q?` ${Q}`:""}`;return`${y}<script ${te}>
196
+ `)c++;continue}if(y==="/"&&i[c+1]==="*"){c+=2;while(c<l-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(y==="{"){a++,c++;continue}if(y==="}"){a--,c++;continue}if(a===0){let v=i.slice(c),R=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let N=R[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=R[0].length;continue}let T=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){T[1].split(",").forEach((N)=>{let j=N.trim(),P=j.indexOf(":"),M=P>=0?j.slice(P+1).trim().split(/[\s=]/)[0]:j.split(/[\s=]/)[0];if(M&&!M.startsWith("_")&&!t.has(M))n.push(M),t.add(M)}),c+=T[0].length;continue}let D=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(D){let N=D[1];if(!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N);c+=D[0].length;continue}}c++}return n}var ga=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 ma(e){let n=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(N){let j;while((j=t.exec(N))!==null){let P=j[0];if(!ga.has(P))n.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)i(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=R.exec(e))!==null)i(l[1]);let T=/@model\s*=\s*["']([^"']*)["']/gi;while((l=T.exec(e))!==null)i(l[1]);let D=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=D.exec(e))!==null)i(l[1]);return n}async function Me(e,n={}){let t=e,i="",a=!1,l=[],c=ni(t,{filePath:n.filePath,projectRoot:n.projectRoot});t=c.code;let y=ri(c.styles),v=Ot(t);t=v.code,l=[...v.imports,...v.models];let{hasUserImports:R,bundleClientScript:T}=await o("stx/client-script-bundler",()=>import("./chunk-zeqybrbc.js"));if(R(t))t=await T(t,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let Q=Ic(t);t=Q.code,i=Oc(Q.stxImports,Q.browserImports.filter((te)=>!l.includes(te)))}if(i=`${mn(t,n.serverData)}${i}`,t=A(t),!a&&Le(n.attrs||""))t=je(t);let D=pa(n.eventBindings||[]),N=(n.attrs||"").trim(),j=/\btype\s*=\s*["']module["']/i.test(N),P=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(j){let Q=N.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${P}${Q?` ${Q}`:""}`;return`${y}<script ${te}>
197
197
  ${ln(`${i}${t}
198
198
  ${D}`)}
199
199
  </script>`}let M=yi(e),G=/function __stx_setup_/.test(t),F=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function L(Q){let te=Q.length>0?`
@@ -287,8 +287,8 @@ ${R.join(`
287
287
  `){let P=e[a];if(P==="\\"){a+=2;continue}if(P==="[")j=!0;else if(P==="]")j=!1;else if(P==="/"&&!j){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},N=()=>{if(i!==0)return;let j=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(j){let F=j[2].split(",").map((L)=>{let Q=L.trim().split(":");return Q[Q.length-1].trim()});for(let L of F)if(L&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(L)&&!t.has(L))n.push(L),t.add(L);return}let P=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(P){let F=P[2];if(!t.has(F))n.push(F),t.add(F);return}let M=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let F=M[1];if(!t.has(F))n.push(F),t.add(F);return}let G=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(G){let F=G[1];if(!t.has(F))n.push(F),t.add(F)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){y();continue}if(e[a]==="/"&&T()){D();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))N();a++}return n}function wl(e){let n=[],t=0,i=0,a=null;for(let l=0;l<e.length;l++){let c=e[l];if(a){if(c==="\\"){l++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)n.push(e.slice(i,l)),i=l+1}if(i<e.length)n.push(e.slice(i));return n}function Sl(e){let n=0,t=null;for(let i=0;i<e.length;i++){let a=e[i];if(t){if(a==="\\"){i++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")n++;else if(a===")"||a==="]"||a==="}")n--;else if(a==="="&&n===0){let l=e[i-1],c=e[i+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(c==="="||c===">")continue;return i}}return-1}function $l(e,n){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let i=t.index-1;while(i>=0&&/\s/.test(e[i]))i--;if(e[i]!=="}")return;let a=i,l=0,c=-1;for(;i>=0;i--){let v=e[i];if(v==="}")l++;else if(v==="{"){if(l--,l===0){c=i;break}}}if(c===-1)return;let y=e.slice(c+1,a);for(let v of wl(y)){let R=v.trim();if(!R||R.startsWith("..."))continue;let T=Sl(R);if(T===-1)continue;let D=R.slice(0,T).trim();if(!/^[A-Z_$][\w$]*$/i.test(D))continue;if(n[D]!==void 0)continue;let N=R.slice(T+1).trim();if(!N)continue;try{let j=Object.keys(n).filter(Mt),P=Function(...j,`"use strict"; return (${N});`);n[D]=P(...j.map((M)=>n[M]))}catch{}}}catch{}}var vl=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Gf(e,n){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let i=t[2].toLowerCase();if(!vl.has(i))return null;let a=new RegExp(`<\\/?${i}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=S(e,(R,T)=>(a.lastIndex=T,a.exec(R)?.index===T?a.lastIndex:-1));if(i==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let c=0,y=!1;for(let R of l){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;y=!0;break}}if(!y)return null;let v=t[0].length;return e.slice(0,v)+n+e.slice(v)}function co(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=ce.relative(ce.resolve(i),ce.resolve(e));return!a.startsWith("..")&&!ce.isAbsolute(a)})}async function wr(e,n,t,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,c=(ne)=>ne.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),y=t.__importedComponents;if(y){for(let ne of[l,l.toLowerCase(),c(l),H(l)])if(y.has(ne))return!0}let v=[...new Set([`${l}.stx`,`${c(l)}.stx`,`${H(l)}.stx`])],R=typeof a.root==="string"?ce.resolve(a.root):void 0,T=R??ce.dirname(i),D=[],N=(ne)=>{if(ne&&!D.includes(ne))D.push(ne)},j=t.__originalFilePath;if(j)N(ce.join(ce.dirname(j),"components"));if(co(n,a))N(a._rootComponentsDir);N(n),N(a._rootComponentsDir),N(ce.join(ce.dirname(i),"components")),N(a.componentsDir);for(let ne of a.additionalComponentsDirs??[])N(ne);let P=a._targetComponentFallbackNames?.some((ne)=>ne.toLowerCase()===l.toLowerCase());if(!P)for(let ne of a._targetComponentDirs??[])N(ne);if(R)N(ce.resolve(R,"resources/views/components")),N(ce.resolve(R,"resources/components")),N(ce.resolve(R,"src/components")),N(ce.resolve(R,"components"));for(let ne of a._layerComponentDirs??[])N(ne);let M=a._pluginComponentDirs;if(Array.isArray(M))for(let ne of M)N(typeof ne==="string"?ne:null);if(N(a.fallbackComponentsDir),P)for(let ne of a._targetComponentDirs??[])N(ne);if(l.startsWith("./")||l.startsWith("../"))return r(ce.resolve(ce.dirname(i),`${l}.stx`));let G=to(ce.resolve(import.meta.dir,"components")),F=D.map((ne)=>ce.isAbsolute(ne)?ne:ce.resolve(T,ne)),L=`${v.join("\x00")}\x00\x00${F.join("\x00")}`,Q=qs.get(L);if(Q!==void 0)return Q;let te=!1;e:for(let ne of F){if(to(ne)===G)continue;for(let ae of v)if(await r(ce.join(ne,ae))){te=!0;break e}}return qs.set(L,te),te}function to(e){let n=Xs.get(e);if(n!==void 0)return n;let t=e;try{t=Ys.realpathSync(e)}catch{}return Xs.set(e,t),t}function Xf(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Nc(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function El(e,n,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let c;try{c=E(a,n)}catch{return l}if(c===void 0||c===null)return"";let y=String(c);if(/<\/style/i.test(y))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return y};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var no=new Set;function so(e,n,t,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&no.has(a))return;no.add(a);let l=n?` used in ${n}`:"",c=i?` Cause: ${i}.`:"",y=t.length>0?`
288
288
  searched:
289
289
  ${t.map((v)=>` - ${v}`).join(`
290
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${y}`)}function ro(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function oi(e){let n=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)n.add(a[1]);t.lastIndex=0}return[...n]}async function Be(e,n,t,i,a,l,c,y=new Set,v,R=tt(a),T,D=e){let{extractVariables:N}=await o("stx/variable-extractor",()=>import("./chunk-5rrjmvna.js")),j=y??new Set;if(j.has(e))return`[Circular component reference: ${e}]`;let P=new Set(j);P.add(e);let M=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let G=M&&M!=="load"&&Xf(M)?M:"";try{let F=(se)=>se.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),L=D.endsWith(".stx")?D.slice(0,-4):D,Q=null,te=a.__importedComponents;if(te){let se=[L,L.toLowerCase(),F(L),H(L)];for(let le of se)if(te.has(le)){Q=te.get(le);break}}let ne=[];if(!Q){let se=[`${L}.stx`,`${F(L)}.stx`,`${H(L)}.stx`],le=[...new Set(se)],_e=a.__originalFilePath,he=[];if(he.push(...c._layerComponentDirs??[]),_e){let be=ce.join(ce.dirname(_e),"components");he.push(be)}let Ve=c._rootComponentsDir;if(typeof Ve==="string"&&co(i,c)&&!he.includes(Ve))he.push(Ve);if(i&&!he.includes(i))he.push(i);if(typeof Ve==="string"&&!he.includes(Ve))he.push(Ve);let Ce=ce.join(ce.dirname(l),"components");if(!he.includes(Ce))he.push(Ce);if(c.componentsDir&&c.componentsDir!==i&&!he.includes(c.componentsDir))he.push(c.componentsDir);for(let be of c.additionalComponentsDirs??[])if(be&&!he.includes(be))he.push(be);let ct=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(L),nt=(T?.events??[]).map((be)=>be.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Kt=Object.hasOwn(n,"checked")||Boolean(T?.reactiveProps?.includes("checked")),ts=Object.hasOwn(n,"value")||Boolean(T?.reactiveProps?.includes("value")),gt=!nt.includes("valuechange")&&(Kt||nt.includes("change")&&!ts),yt=c._nativeHostAttrs&&/^textinput$/i.test(L),_n=nt.includes("update:value")&&!nt.includes("input"),wn=c._nativeHostAttrs&&/^video$/i.test(L),Sn=Object.hasOwn(n,"src")||Boolean(T?.reactiveProps?.includes("src")),_t=Object.hasOwn(n,"source")||Boolean(T?.reactiveProps?.includes("source")),$n=wn&&Sn&&!_t&&(T?.events??[]).every((be)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(be.replace(/^@/,"").split(".")[0])),mt=(be)=>Object.hasOwn(n,be)||Boolean(T?.reactiveProps?.includes(be)),En=c._nativeHostAttrs&&/^button$/i.test(L)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!t.trim()),Zt=c._targetComponentFallbackNames?.some((be)=>be.toLowerCase()===L.toLowerCase())&&(!ct||gt)&&(!yt||_n)&&(!wn||$n)&&!En;for(let be of Zt?[]:c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be);let st=typeof c.root==="string"?ce.resolve(c.root):void 0,$o=st??ce.dirname(l),wt=[];if(st)wt.push(ce.resolve(st,"resources/views/components")),wt.push(ce.resolve(st,"resources/components")),wt.push(ce.resolve(st,"src/components")),wt.push(ce.resolve(st,"components"));wt.push(ce.resolve(import.meta.dir,"components"));for(let be of wt)if(!he.includes(be))he.push(be);let rr=c._pluginComponentDirs;if(Array.isArray(rr)){for(let be of rr)if(typeof be==="string"&&!he.includes(be))he.push(be)}if(c.fallbackComponentsDir&&!he.includes(c.fallbackComponentsDir))he.push(c.fallbackComponentsDir);if(Zt){for(let be of c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be)}let ir=[...new Set(he.map((be)=>{if(!be)return be;return ce.isAbsolute(be)?be:ce.resolve($o,be)}))];he.length=0,he.push(...ir);let ns=`${L}\x00${l}\x00${ir.join("\x00")}`,ss=Kn.get(ns);if(ss)if(await r(ss))Q=ss;else Kn.delete(ns);if(!Q&&(L.startsWith("./")||L.startsWith("../")))Q=ce.resolve(ce.dirname(l),`${L}.stx`),ne.push(Q);else if(!Q)for(let be of he){if(!be)continue;for(let kn of le){let Rn=ce.join(be,kn);if(ne.push(Rn),await r(Rn)){Q=Rn;break}}if(Q)break;if(!Q)try{let kn=await import("fs");if(!kn.statSync(be,{throwIfNoEntry:!1})?.isDirectory())continue;let vo=8,rs=[{path:be,depth:0}];while(rs.length>0&&!Q){let Cn=rs.pop();if(Cn.depth>=vo)continue;let or;try{or=kn.readdirSync(Cn.path,{withFileTypes:!0})}catch{continue}for(let Tn of or){if(!Tn.isDirectory())continue;if(Tn.name==="node_modules"||Tn.name.startsWith("."))continue;let ar=ce.join(Cn.path,Tn.name);for(let Eo of le){let is=ce.join(ar,Eo);if(ne.push(is),await r(is)){Q=is;break}}if(Q)break;rs.push({path:ar,depth:Cn.depth+1})}}}catch{}if(Q)break}if(Q)Kn.set(ns,Q)}if(!Q||!await r(Q))return so(e,l,ne),ro(e);v.add(Q);let ae;if(tn.has(Q))ae=tn.get(Q);else try{ae=await Bun.file(Q).text(),tn.set(Q,ae)}catch(se){let le=se instanceof Error?se.message:String(se);return so(e,l,[Q],le),ro(e)}if(T)for(let se of new Set([...Object.keys(n),...T.reactiveProps??[]])){let le=se.toLowerCase();if(le.startsWith("aria-")||le.startsWith("data-"))continue;let _e=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${_e}\\b`).test(ae))T.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${_e}\\b|\\[\\s*['"]${_e}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${_e}['"]`).test(ae))T.consumedProps?.add(se)}let me=new Set(["__originalFilePath","__importedComponents",Mn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[se,le]of Object.entries(a))if(!se.startsWith("__")||me.has(se))Ee[se]=le;let Te=R.length>0?{[Wn]:[...R]}:{},ze=t;if(t.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-7314r3dn.js"));ze=await se(t,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ze)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-vbp0b5tr.js"));ze=await se(ze,{...a,__processedComponents:j,...Te},l,c,v)}let $e=[];if(Nc(ze)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-37q792qg.js")),le=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Te}:R.length>0?{...a,...Te}:a;ze=se(ze,le,l);for(let _e of ze.matchAll(/\{\{([\s\S]*?)\}\}/g))$e.push(_e[1].trim())}let rt=X(ze),ut=[],Ct=rt.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,le)=>{let _e=rt.scripts[Number(le)]||"",he=_e.match(/^<script\b([^>]*)>/i)?.[1]||"",Ve=he.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ce=!Ve||["module","text/javascript","application/javascript"].includes(Ve),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${he}`);if(!/\bserver\b/i.test(he)&&Ce&&!ct)return ut.push(_e),"";return _e}),{extractSlotContent:Xn}=await o("stx/slots",()=>import("./chunk-093s0gye.js")),ft=Xn(Ct),dt={};if(ft.defaultSlot?.trim())dt.default=ft.defaultSlot;for(let[se,le]of ft.namedSlots)dt[se]=le.content;let pt=a.__stx_scope_seq??={n:0,key:Os(String(a.__filename??l))},Dt=ao(e,process.cwd()),it=`stx_${(Dt.endsWith(".stx")?Dt.slice(0,-4):Dt).replace(/[^a-zA-Z0-9]/g,"_")}_${++pt.n}_${pt.key}`,We={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...n,props:n,slot:Ct,$slots:dt,__processedComponents:P,__sections:{},__stx_signals_gate:xe(ae)||Nc(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...$e]};$l(ae,We);let jt=ae,sn=de(jt);if(sn)jt=sn.content.trim();let Jn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Lt=[...ae.matchAll(Jn)];for(let[,se,le]of Lt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Ie(le,Q,c.strict);let Ze=[],Bt=null,Gn=Lt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,Je=null,zt=null,rn=0,Wt=null;if(hl(c),Gn&&Js>0){let se=xl({props:n,slot:ze,slotContext:t.trim()?bl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((le)=>le.configFile),uid:it});if(se!==null){bt=`${Q}\x00${x(ae)}\x00${se}`;let le=Zn.get(bt);if(le){for(let _e of le.dependencies)v.add(_e);if(qr(a,le.clientFactories),pt.n+=le.uidsConsumed,le.preservedClientExpressions.length>0){let _e=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let he of le.preservedClientExpressions)_e.add(he);a.__stx_preserved_client_expressions=[..._e]}return le.output}Je=new Set(v),zt=Kr(a),rn=pt.n,Wt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Ft=new Set;for(let se of Lt){let le=se[1]||"",_e=se[2]||"",he=le.includes("server");if(Le(le)&&_e.trim())_e=je(_e);if(he&&_e){for(let Ce of Ne(_e))Ft.add(Ce);try{await N(_e,We,Q,{onFailure:(Ce)=>{if(Ce.kind!=="unknown")Bt=Ce.kind}})}catch(Ce){}}if(!he){let Ce=_e.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ce.includes("{{")&&Ce.includes("}}"),nt=Ce.includes("{!!")&&Ce.includes("!!}");if(ct||nt)Ce=ai(Ce,We,Q);let Kt=le.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ze.push(`<script${Kt}>${Ce}</script>`)}}let qe=X(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Vt=qe?qe[1]:"",Yn=qe?qe[2]:"",Ge="",ee=Vt&&/\bscoped\b/i.test(Vt);if(qe)Ge=`<style${Vt}>${El(Yn,We,Q)}</style>`;let re=jt;if(re=re.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),qe)re=re.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,le=[];if(re=re.replace(se,(_e,he)=>{let Ve=he.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ve)le.push(`<style${Ve[1]}>${Ve[2]}</style>`);return""}),re=re.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),le.length>0)Ge=`${Ge}${le.join(`
291
- `)}`}if(t&&re.includes("{{ text || slot }}"))re=re.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-093s0gye.js")),{defaultSlot:ye,namedSlots:Re}=ft,Ue=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ct),Ye=c._nativeHostAttrs===!0&&Ze.length>0||Ue&&Ze.length>0||Ze.some((se)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(se)),Qn=(se)=>Ye?Ai(se,it):se,es=new Map([...Re].map(([se,le])=>[se,{...le,content:Qn(le.content)}]));re=await ue(re,Qn(ye),es,We,Ye?it:"");let on=oi(Ze),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!Ft.has(se));if(on.length>0||Ut.length>0)We.__stx_client_signal_names=[...new Set([...Ut,...on])];else delete We.__stx_client_signal_names;let Ht=R.filter((se)=>!Ft.has(se)&&!(se in n));if(Ht.length>0)We[Wn]=Ht;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ce.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||Ye||Ze.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:xn}=await o("stx/process",()=>import("./chunk-cnsc2paf.js")),Qe=await xn(re,We,Q,an,v),at=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let se of Qe.matchAll(/\{\{([\s\S]*?)\}\}/g))at.add(se[1].trim());if(at.size>0)a.__stx_preserved_client_expressions=[...at];let et=it,Ke=Qe;if(Ye){let se="";if(Object.keys(n).length>0)try{se=` data-stx-props="${Ks(JSON.stringify(n))}"`}catch{}let le=G?` stx-hydrate="${Ks(G)}"`:"",_e=Object.fromEntries(Object.entries(dt).map(([gt,yt])=>[gt,Boolean(yt)])),he=Object.keys(_e).length>0?` data-stx-slots="${Ks(JSON.stringify(_e))}"`:"",Ve=` data-stx-scope="${et}"${se}${he}${le}`,Ce=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Qe),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),nt=Ce?"span":"div",Kt=ct&&c._nativeHostAttrs?' style="display:flex;flex:1;min-height:0;min-width:0"':Ce||ct?' style="display:contents"':"";Ke=Gf(Qe,Ve)??`<${nt}${Ve} data-stx-component-wrapper${Kt}>${Qe}</${nt}>`;let ts=await Promise.all(Ze.map(async(gt)=>{let yt=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return gt;let[,_n,wn]=yt,Sn=Yi(gt,We,Q);if(Sn!==null)return Sn;let _t=await Rl(wn,Q,c.buildMode==="compile"),$n=mn(_t.clientCode,De(We)),{vendorStyleTags:mt}=_t,En=$n?`function(__scopeId) {
290
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${y}`)}function ro(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function oi(e){let n=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)n.add(a[1]);t.lastIndex=0}return[...n]}async function Be(e,n,t,i,a,l,c,y=new Set,v,R=tt(a),T,D=e){let{extractVariables:N}=await o("stx/variable-extractor",()=>import("./chunk-6xytp0tk.js")),j=y??new Set;if(j.has(e))return`[Circular component reference: ${e}]`;let P=new Set(j);P.add(e);let M=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let G=M&&M!=="load"&&Xf(M)?M:"";try{let F=(se)=>se.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),L=D.endsWith(".stx")?D.slice(0,-4):D,Q=null,te=a.__importedComponents;if(te){let se=[L,L.toLowerCase(),F(L),H(L)];for(let le of se)if(te.has(le)){Q=te.get(le);break}}let ne=[];if(!Q){let se=[`${L}.stx`,`${F(L)}.stx`,`${H(L)}.stx`],le=[...new Set(se)],_e=a.__originalFilePath,he=[];if(he.push(...c._layerComponentDirs??[]),_e){let be=ce.join(ce.dirname(_e),"components");he.push(be)}let Ve=c._rootComponentsDir;if(typeof Ve==="string"&&co(i,c)&&!he.includes(Ve))he.push(Ve);if(i&&!he.includes(i))he.push(i);if(typeof Ve==="string"&&!he.includes(Ve))he.push(Ve);let Ce=ce.join(ce.dirname(l),"components");if(!he.includes(Ce))he.push(Ce);if(c.componentsDir&&c.componentsDir!==i&&!he.includes(c.componentsDir))he.push(c.componentsDir);for(let be of c.additionalComponentsDirs??[])if(be&&!he.includes(be))he.push(be);let ct=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(L),nt=(T?.events??[]).map((be)=>be.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Kt=Object.hasOwn(n,"checked")||Boolean(T?.reactiveProps?.includes("checked")),ts=Object.hasOwn(n,"value")||Boolean(T?.reactiveProps?.includes("value")),gt=!nt.includes("valuechange")&&(Kt||nt.includes("change")&&!ts),yt=c._nativeHostAttrs&&/^textinput$/i.test(L),_n=nt.includes("update:value")&&!nt.includes("input"),wn=c._nativeHostAttrs&&/^video$/i.test(L),Sn=Object.hasOwn(n,"src")||Boolean(T?.reactiveProps?.includes("src")),_t=Object.hasOwn(n,"source")||Boolean(T?.reactiveProps?.includes("source")),$n=wn&&Sn&&!_t&&(T?.events??[]).every((be)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(be.replace(/^@/,"").split(".")[0])),mt=(be)=>Object.hasOwn(n,be)||Boolean(T?.reactiveProps?.includes(be)),En=c._nativeHostAttrs&&/^button$/i.test(L)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!t.trim()),Zt=c._targetComponentFallbackNames?.some((be)=>be.toLowerCase()===L.toLowerCase())&&(!ct||gt)&&(!yt||_n)&&(!wn||$n)&&!En;for(let be of Zt?[]:c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be);let st=typeof c.root==="string"?ce.resolve(c.root):void 0,$o=st??ce.dirname(l),wt=[];if(st)wt.push(ce.resolve(st,"resources/views/components")),wt.push(ce.resolve(st,"resources/components")),wt.push(ce.resolve(st,"src/components")),wt.push(ce.resolve(st,"components"));wt.push(ce.resolve(import.meta.dir,"components"));for(let be of wt)if(!he.includes(be))he.push(be);let rr=c._pluginComponentDirs;if(Array.isArray(rr)){for(let be of rr)if(typeof be==="string"&&!he.includes(be))he.push(be)}if(c.fallbackComponentsDir&&!he.includes(c.fallbackComponentsDir))he.push(c.fallbackComponentsDir);if(Zt){for(let be of c._targetComponentDirs??[])if(be&&!he.includes(be))he.push(be)}let ir=[...new Set(he.map((be)=>{if(!be)return be;return ce.isAbsolute(be)?be:ce.resolve($o,be)}))];he.length=0,he.push(...ir);let ns=`${L}\x00${l}\x00${ir.join("\x00")}`,ss=Kn.get(ns);if(ss)if(await r(ss))Q=ss;else Kn.delete(ns);if(!Q&&(L.startsWith("./")||L.startsWith("../")))Q=ce.resolve(ce.dirname(l),`${L}.stx`),ne.push(Q);else if(!Q)for(let be of he){if(!be)continue;for(let kn of le){let Rn=ce.join(be,kn);if(ne.push(Rn),await r(Rn)){Q=Rn;break}}if(Q)break;if(!Q)try{let kn=await import("fs");if(!kn.statSync(be,{throwIfNoEntry:!1})?.isDirectory())continue;let vo=8,rs=[{path:be,depth:0}];while(rs.length>0&&!Q){let Cn=rs.pop();if(Cn.depth>=vo)continue;let or;try{or=kn.readdirSync(Cn.path,{withFileTypes:!0})}catch{continue}for(let Tn of or){if(!Tn.isDirectory())continue;if(Tn.name==="node_modules"||Tn.name.startsWith("."))continue;let ar=ce.join(Cn.path,Tn.name);for(let Eo of le){let is=ce.join(ar,Eo);if(ne.push(is),await r(is)){Q=is;break}}if(Q)break;rs.push({path:ar,depth:Cn.depth+1})}}}catch{}if(Q)break}if(Q)Kn.set(ns,Q)}if(!Q||!await r(Q))return so(e,l,ne),ro(e);v.add(Q);let ae;if(tn.has(Q))ae=tn.get(Q);else try{ae=await Bun.file(Q).text(),tn.set(Q,ae)}catch(se){let le=se instanceof Error?se.message:String(se);return so(e,l,[Q],le),ro(e)}if(T)for(let se of new Set([...Object.keys(n),...T.reactiveProps??[]])){let le=se.toLowerCase();if(le.startsWith("aria-")||le.startsWith("data-"))continue;let _e=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${_e}\\b`).test(ae))T.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${_e}\\b|\\[\\s*['"]${_e}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${_e}['"]`).test(ae))T.consumedProps?.add(se)}let me=new Set(["__originalFilePath","__importedComponents",Mn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[se,le]of Object.entries(a))if(!se.startsWith("__")||me.has(se))Ee[se]=le;let Te=R.length>0?{[Wn]:[...R]}:{},ze=t;if(t.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-7hky61eh.js"));ze=await se(t,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ze)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-y6t6djz7.js"));ze=await se(ze,{...a,__processedComponents:j,...Te},l,c,v)}let $e=[];if(Nc(ze)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-cczxhrbh.js")),le=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Te}:R.length>0?{...a,...Te}:a;ze=se(ze,le,l);for(let _e of ze.matchAll(/\{\{([\s\S]*?)\}\}/g))$e.push(_e[1].trim())}let rt=X(ze),ut=[],Ct=rt.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,le)=>{let _e=rt.scripts[Number(le)]||"",he=_e.match(/^<script\b([^>]*)>/i)?.[1]||"",Ve=he.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ce=!Ve||["module","text/javascript","application/javascript"].includes(Ve),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${he}`);if(!/\bserver\b/i.test(he)&&Ce&&!ct)return ut.push(_e),"";return _e}),{extractSlotContent:Xn}=await o("stx/slots",()=>import("./chunk-chxhfdpc.js")),ft=Xn(Ct),dt={};if(ft.defaultSlot?.trim())dt.default=ft.defaultSlot;for(let[se,le]of ft.namedSlots)dt[se]=le.content;let pt=a.__stx_scope_seq??={n:0,key:Os(String(a.__filename??l))},Dt=ao(e,process.cwd()),it=`stx_${(Dt.endsWith(".stx")?Dt.slice(0,-4):Dt).replace(/[^a-zA-Z0-9]/g,"_")}_${++pt.n}_${pt.key}`,We={...Ee,$uid:it,$native:c._nativeHostAttrs===!0,...n,props:n,slot:Ct,$slots:dt,__processedComponents:P,__sections:{},__stx_signals_gate:xe(ae)||Nc(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...$e]};$l(ae,We);let jt=ae,sn=de(jt);if(sn)jt=sn.content.trim();let Jn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Lt=[...ae.matchAll(Jn)];for(let[,se,le]of Lt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Ie(le,Q,c.strict);let Ze=[],Bt=null,Gn=Lt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,Je=null,zt=null,rn=0,Wt=null;if(hl(c),Gn&&Js>0){let se=xl({props:n,slot:ze,slotContext:t.trim()?bl(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((le)=>le.configFile),uid:it});if(se!==null){bt=`${Q}\x00${x(ae)}\x00${se}`;let le=Zn.get(bt);if(le){for(let _e of le.dependencies)v.add(_e);if(qr(a,le.clientFactories),pt.n+=le.uidsConsumed,le.preservedClientExpressions.length>0){let _e=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let he of le.preservedClientExpressions)_e.add(he);a.__stx_preserved_client_expressions=[..._e]}return le.output}Je=new Set(v),zt=Kr(a),rn=pt.n,Wt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Ft=new Set;for(let se of Lt){let le=se[1]||"",_e=se[2]||"",he=le.includes("server");if(Le(le)&&_e.trim())_e=je(_e);if(he&&_e){for(let Ce of Ne(_e))Ft.add(Ce);try{await N(_e,We,Q,{onFailure:(Ce)=>{if(Ce.kind!=="unknown")Bt=Ce.kind}})}catch(Ce){}}if(!he){let Ce=_e.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ce.includes("{{")&&Ce.includes("}}"),nt=Ce.includes("{!!")&&Ce.includes("!!}");if(ct||nt)Ce=ai(Ce,We,Q);let Kt=le.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Ze.push(`<script${Kt}>${Ce}</script>`)}}let qe=X(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Vt=qe?qe[1]:"",Yn=qe?qe[2]:"",Ge="",ee=Vt&&/\bscoped\b/i.test(Vt);if(qe)Ge=`<style${Vt}>${El(Yn,We,Q)}</style>`;let re=jt;if(re=re.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),qe)re=re.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,le=[];if(re=re.replace(se,(_e,he)=>{let Ve=he.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ve)le.push(`<style${Ve[1]}>${Ve[2]}</style>`);return""}),re=re.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),le.length>0)Ge=`${Ge}${le.join(`
291
+ `)}`}if(t&&re.includes("{{ text || slot }}"))re=re.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-chxhfdpc.js")),{defaultSlot:ye,namedSlots:Re}=ft,Ue=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ct),Ye=c._nativeHostAttrs===!0&&Ze.length>0||Ue&&Ze.length>0||Ze.some((se)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(se)),Qn=(se)=>Ye?Ai(se,it):se,es=new Map([...Re].map(([se,le])=>[se,{...le,content:Qn(le.content)}]));re=await ue(re,Qn(ye),es,We,Ye?it:"");let on=oi(Ze),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!Ft.has(se));if(on.length>0||Ut.length>0)We.__stx_client_signal_names=[...new Set([...Ut,...on])];else delete We.__stx_client_signal_names;let Ht=R.filter((se)=>!Ft.has(se)&&!(se in n));if(Ht.length>0)We[Wn]=Ht;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:ce.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||Ye||Ze.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:xn}=await o("stx/process",()=>import("./chunk-2e2yh6t5.js")),Qe=await xn(re,We,Q,an,v),at=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let se of Qe.matchAll(/\{\{([\s\S]*?)\}\}/g))at.add(se[1].trim());if(at.size>0)a.__stx_preserved_client_expressions=[...at];let et=it,Ke=Qe;if(Ye){let se="";if(Object.keys(n).length>0)try{se=` data-stx-props="${Ks(JSON.stringify(n))}"`}catch{}let le=G?` stx-hydrate="${Ks(G)}"`:"",_e=Object.fromEntries(Object.entries(dt).map(([gt,yt])=>[gt,Boolean(yt)])),he=Object.keys(_e).length>0?` data-stx-slots="${Ks(JSON.stringify(_e))}"`:"",Ve=` data-stx-scope="${et}"${se}${he}${le}`,Ce=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Qe),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),nt=Ce?"span":"div",Kt=ct&&c._nativeHostAttrs?' style="display:flex;flex:1;min-height:0;min-width:0"':Ce||ct?' style="display:contents"':"";Ke=Gf(Qe,Ve)??`<${nt}${Ve} data-stx-component-wrapper${Kt}>${Qe}</${nt}>`;let ts=await Promise.all(Ze.map(async(gt)=>{let yt=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return gt;let[,_n,wn]=yt,Sn=Yi(gt,We,Q);if(Sn!==null)return Sn;let _t=await Rl(wn,Q,c.buildMode==="compile"),$n=mn(_t.clientCode,De(We)),{vendorStyleTags:mt}=_t,En=$n?`function(__scopeId) {
292
292
  ${$n}
293
293
  return (${_t.factoryBody})(__scopeId);
294
294
  }`:_t.factoryBody,Zt=G?null:hs(a,En),st=Zt?`window.__stxComponentFactories[${JSON.stringify(Zt)}](${JSON.stringify(et)});`:`(${En})(${JSON.stringify(et)});`;if(G)return`${mt}<script type="stx/island" data-stx-island="${et}" data-stx-scoped data-stx-owner="${et}"${_n}>${st}</script>`;return`${mt}<script data-stx-scoped data-stx-run="always" data-stx-owner="${et}"${_n}>${st}</script>`}));if(Ke=Ke+`
@@ -314,7 +314,7 @@ ${Se.yellow}${Se.bold}Message:${Se.reset} ${n}
314
314
  `,y)T+=`
315
315
  ${Se.blue}${Se.bold}Context:${Se.reset}
316
316
  ${Se.dim}${y}${Se.reset}
317
- `;return T}function fe(){tn.clear(),Kn.clear(),qs.clear(),Xs.clear(),Zn.clear()}function wh(){return{size:tn.size,maxSize:500}}var Zs=w(128);async function Rl(e,n,t){let i=x(e,n,t),a=Zs.get(i);if(a){if(Es(a.deps))return a;Zs.delete(i)}let l=ni(e,{filePath:n,projectRoot:process.cwd()}),c=l.code,y=ri(l.styles);c=Ot(c).code;let{hasUserImports:v,bundleClientScript:R}=await o("stx/client-script-bundler",()=>import("./chunk-mkjtvm6r.js")),T=[],D=!1;if(v(c)){let L=c;c=await R(L,n,{projectRoot:process.cwd(),minify:t,collectInputs:T}),D=c===L}let{stripStxRuntimeImports:N}=await o("stx/signal-processing",()=>import("./chunk-avjbhczg.js"));c=N(c);let j=A(c),P=_l(j),M=new Set(z(j,!0).split(",").map((L)=>L.trim())),G=`function(__scopeId) {
317
+ `;return T}function fe(){tn.clear(),Kn.clear(),qs.clear(),Xs.clear(),Zn.clear()}function wh(){return{size:tn.size,maxSize:500}}var Zs=w(128);async function Rl(e,n,t){let i=x(e,n,t),a=Zs.get(i);if(a){if(Es(a.deps))return a;Zs.delete(i)}let l=ni(e,{filePath:n,projectRoot:process.cwd()}),c=l.code,y=ri(l.styles);c=Ot(c).code;let{hasUserImports:v,bundleClientScript:R}=await o("stx/client-script-bundler",()=>import("./chunk-zeqybrbc.js")),T=[],D=!1;if(v(c)){let L=c;c=await R(L,n,{projectRoot:process.cwd(),minify:t,collectInputs:T}),D=c===L}let{stripStxRuntimeImports:N}=await o("stx/signal-processing",()=>import("./chunk-3v3dssk7.js"));c=N(c);let j=A(c),P=_l(j),M=new Set(z(j,!0).split(",").map((L)=>L.trim())),G=`function(__scopeId) {
318
318
  ${ot("const",[...Gc,...P],j)}
319
319
  const __scope = window.stx._scopes = window.stx._scopes || {};
320
320
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{gn,Nf,Df,Mf,Lf,jf,m,Bf,ti,Ff,Ac,Pc}from"./chunk-xznv6fnn.js";import"./chunk-t3zs3pgm.js";import"./chunk-nzwcbt98.js";import"./chunk-shf75rrg.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{gn as STX_ENGINE_BINDING_NAMES,ti as convertToCommonJS,Ac as extractScriptFromTemplate,m as extractVariables,Pc as hasVariables,Bf as isCompleteImport,jf as isMissingBindingFailure,Mf as isModuleResolutionFailure,Lf as isSyntaxFailure,Ff as splitDeclaration,Nf as stripTypeScript,Df as withoutStxReferrer};
2
+ import{gn,Nf,Df,Mf,Lf,jf,m,Bf,ti,Ff,Ac,Pc}from"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{gn as STX_ENGINE_BINDING_NAMES,ti as convertToCommonJS,Ac as extractScriptFromTemplate,m as extractVariables,Pc as hasVariables,Bf as isCompleteImport,jf as isMissingBindingFailure,Mf as isModuleResolutionFailure,Lf as isSyntaxFailure,Ff as splitDeclaration,Nf as stripTypeScript,Df as withoutStxReferrer};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wg}from"./chunk-k9tay7g7.js";import"./chunk-s8vj3xs0.js";import"./chunk-z6kz9jqc.js";import"./chunk-91pycazt.js";import"./chunk-e8g374pz.js";import"./chunk-xjv46712.js";import"./chunk-dnt3q3jv.js";import"./chunk-b8wgnpat.js";import"./chunk-bj0z4gve.js";import"./chunk-hp3vebgn.js";import"./chunk-3xa9vxyq.js";import"./chunk-8f14cgm8.js";import"./chunk-bas06v5y.js";import"./chunk-d25pawk8.js";import"./chunk-g78zvf6j.js";import"./chunk-6ew10ptg.js";import"./chunk-5f6x6fyp.js";import"./chunk-dxsdr77m.js";import"./chunk-4s1k8k2a.js";import"./chunk-6ph5jasj.js";import"./chunk-m5a8zgft.js";import"./chunk-nzwcbt98.js";import"./chunk-wpwh529h.js";import"./chunk-zn3c0ew5.js";import"./chunk-27agaezn.js";export{wg as startInteractive};