@stacksjs/stx 0.2.811 → 0.2.812

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 (83) hide show
  1. package/dist/{chunk-jf0cn7e2.js → chunk-021eq782.js} +2 -2
  2. package/dist/{chunk-4664b8rv.js → chunk-0752padg.js} +1 -1
  3. package/dist/{chunk-7d1kx4zz.js → chunk-0aqrjw4c.js} +1 -1
  4. package/dist/{chunk-ds9c47sj.js → chunk-154n9bj7.js} +1 -1
  5. package/dist/{chunk-cxf2pdjk.js → chunk-2sqkzpt5.js} +1 -1
  6. package/dist/{chunk-e3qkbq8g.js → chunk-46npem9j.js} +1 -1
  7. package/dist/{chunk-y3jx43d7.js → chunk-4g2vnemw.js} +4 -4
  8. package/dist/{chunk-peabdz2j.js → chunk-5d98q2hm.js} +1 -1
  9. package/dist/{chunk-390v4dv9.js → chunk-60bhj25e.js} +1 -1
  10. package/dist/chunk-6pghczk4.js +3 -0
  11. package/dist/{chunk-c84fwzfq.js → chunk-6sh0qbqe.js} +4 -4
  12. package/dist/{chunk-7vqhm1rx.js → chunk-6vqm866c.js} +1 -1
  13. package/dist/{chunk-q4efhj8q.js → chunk-6yjyymnd.js} +1 -1
  14. package/dist/{chunk-5ffzbq9r.js → chunk-962800vx.js} +2 -2
  15. package/dist/{chunk-zfes9kn1.js → chunk-9k7c5y4t.js} +1 -1
  16. package/dist/{chunk-evnznyg7.js → chunk-9t4qc1ej.js} +1 -1
  17. package/dist/{chunk-fg20p7by.js → chunk-a9t7ytwg.js} +1 -1
  18. package/dist/{chunk-cx2bwpfj.js → chunk-acftnzex.js} +1 -1
  19. package/dist/{chunk-kr5jhk30.js → chunk-atbqt79s.js} +1 -1
  20. package/dist/{chunk-vz5beayx.js → chunk-awqq6rxz.js} +1 -1
  21. package/dist/{chunk-mt7d37jh.js → chunk-b83vt90z.js} +1 -1
  22. package/dist/{chunk-49xn95m7.js → chunk-bega3dk7.js} +1 -1
  23. package/dist/{chunk-w050qx5j.js → chunk-chwt709a.js} +2 -2
  24. package/dist/chunk-cnvetevs.js +2 -0
  25. package/dist/{chunk-s1w9nxws.js → chunk-crfj882k.js} +1 -1
  26. package/dist/{chunk-16p71jmw.js → chunk-d8kvpb4n.js} +2 -2
  27. package/dist/{chunk-nk51w4tw.js → chunk-db3h2e1r.js} +1 -1
  28. package/dist/{chunk-15hfs2cp.js → chunk-db4bd5vc.js} +1 -1
  29. package/dist/{chunk-161n5e5y.js → chunk-dn17ve25.js} +5 -5
  30. package/dist/{chunk-n9pbkj5v.js → chunk-e3sd2w5t.js} +1 -1
  31. package/dist/chunk-ef2367nq.js +2 -0
  32. package/dist/{chunk-3y6jhcrb.js → chunk-et7jca3r.js} +1 -1
  33. package/dist/{chunk-6nskg4sx.js → chunk-et7s58sj.js} +1 -1
  34. package/dist/chunk-etg32aev.js +2 -0
  35. package/dist/chunk-ezd6jev1.js +2 -0
  36. package/dist/{chunk-mfnyqcfg.js → chunk-f8awd1cy.js} +1 -1
  37. package/dist/{chunk-1jwqjdk7.js → chunk-fwwf1t9k.js} +1 -1
  38. package/dist/chunk-ga5f5try.js +2 -0
  39. package/dist/{chunk-j54ph3jm.js → chunk-hea7mctr.js} +2 -2
  40. package/dist/{chunk-20qn18ry.js → chunk-je1nvds2.js} +2 -2
  41. package/dist/{chunk-ncmdmgrj.js → chunk-kgmeby9f.js} +1 -1
  42. package/dist/{chunk-1jr259ct.js → chunk-nrnzkh3e.js} +1 -1
  43. package/dist/{chunk-f33wwacc.js → chunk-p4yhhx16.js} +4 -4
  44. package/dist/{chunk-aak95hpm.js → chunk-p77087r3.js} +1 -1
  45. package/dist/{chunk-jd1mvgwb.js → chunk-r13bcmsh.js} +3 -3
  46. package/dist/{chunk-6ct3hhae.js → chunk-r94q8xdh.js} +1 -1
  47. package/dist/{chunk-n15eyqcr.js → chunk-rggdk5e2.js} +1 -1
  48. package/dist/{chunk-k11bkgx6.js → chunk-rz0zww80.js} +1 -1
  49. package/dist/{chunk-3hzdpc0m.js → chunk-ttj34qz6.js} +1 -1
  50. package/dist/chunk-vgddw569.js +2 -0
  51. package/dist/{chunk-vt5nrrax.js → chunk-vntea4k0.js} +4 -4
  52. package/dist/{chunk-3affwe7d.js → chunk-vq65ywpx.js} +1 -1
  53. package/dist/chunk-ws0tc67p.js +2 -0
  54. package/dist/{chunk-kfgbk0x9.js → chunk-x14jm9hg.js} +1 -1
  55. package/dist/{chunk-8aw5chnj.js → chunk-x1tt23w7.js} +1 -1
  56. package/dist/{chunk-41n0qrc0.js → chunk-xaycmazr.js} +1 -1
  57. package/dist/{chunk-66mz8bf3.js → chunk-xbcktxjc.js} +1 -1
  58. package/dist/{chunk-cm23d335.js → chunk-y4yz5qf5.js} +1 -1
  59. package/dist/chunk-y9hacnzt.js +2 -0
  60. package/dist/{chunk-m76jbcey.js → chunk-ygrc6aej.js} +6 -6
  61. package/dist/{chunk-agcfhj1v.js → chunk-yvqmr4p0.js} +1 -1
  62. package/dist/chunk-ze2ykje6.js +2 -0
  63. package/dist/{chunk-3fq9v4a4.js → chunk-zqfdeh3y.js} +1 -1
  64. package/dist/chunk-zvmm78rc.js +2 -0
  65. package/dist/cli.js +7 -7
  66. package/dist/craft-entry.js +1 -1
  67. package/dist/craft.js +1 -1
  68. package/dist/native/runtime/browser-screen.js +10 -10
  69. package/dist/native/runtime/craft.d.ts +1 -1
  70. package/dist/pwa.js +1 -1
  71. package/dist/ssg.js +2 -2
  72. package/package.json +5 -5
  73. package/dist/chunk-20bcj7cm.js +0 -2
  74. package/dist/chunk-3tf2wwwt.js +0 -2
  75. package/dist/chunk-45bh5bjj.js +0 -2
  76. package/dist/chunk-4jmzw6kg.js +0 -2
  77. package/dist/chunk-ehmy6gyb.js +0 -2
  78. package/dist/chunk-ez0d7fpw.js +0 -2
  79. package/dist/chunk-jqhcst3j.js +0 -2
  80. package/dist/chunk-jvs9g0c0.js +0 -2
  81. package/dist/chunk-p8eg9kne.js +0 -2
  82. package/dist/chunk-pmrkv7v3.js +0 -2
  83. package/dist/chunk-y6pyr4km.js +0 -3
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$h,Pf,Je,ic,Rh,as,cs,ls}from"./chunk-y3jx43d7.js";import"./chunk-kr5jhk30.js";import"./chunk-y6pyr4km.js";import"./chunk-y7sf7aj0.js";import"./chunk-1carv1dw.js";import"./chunk-m76jbcey.js";import"./chunk-kfgbk0x9.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Rh as clearOnceStore,ic as onceStore,Je as partialsCache,as as processIncludes,cs as processStackPushDirectives,ls as processStackReplacements,$h as resetUnscopedSignalWarnings,Pf as topLevelElements};
2
+ import{$h,Pf,Je,ic,Rh,as,cs,ls}from"./chunk-4g2vnemw.js";import"./chunk-atbqt79s.js";import"./chunk-6pghczk4.js";import"./chunk-y7sf7aj0.js";import"./chunk-1carv1dw.js";import"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Rh as clearOnceStore,ic as onceStore,Je as partialsCache,as as processIncludes,cs as processStackPushDirectives,ls as processStackReplacements,$h as resetUnscopedSignalWarnings,Pf as topLevelElements};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{oa,Yg,ia,Zg,Dl,Ll,Qg,em}from"./chunk-r94q8xdh.js";import"./chunk-et7s58sj.js";import"./chunk-bega3dk7.js";import"./chunk-et7jca3r.js";import"./chunk-7sh9fa3q.js";import"./chunk-021eq782.js";import"./chunk-p4yhhx16.js";import"./chunk-1carv1dw.js";import"./chunk-je1nvds2.js";import"./chunk-fwwf1t9k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import{Pt,Jf}from"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{oa as buildScriptVirtualFile,Yg as buildVirtualSource,Pt as extractScriptBlocks,Jf as extractTemplateExpressions,Dl as findRuntimeTypeDeclarations,Ll as findStxModuleDeclarations,em as formatTypecheckDiagnostics,Zg as sourcePathFor,Qg as typecheckStxFiles,ia as virtualPathFor};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{xn,N}from"./chunk-m7hfcxt3.js";import m from"fs";import e from"path";async function vn(r,o,i){if(r.__stx_runtime_config)return;let n=xn();if(n||i){r.__stx_runtime_config=n??N(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-agcfhj1v.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=N(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function vi(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{xn,N}from"./chunk-m7hfcxt3.js";import m from"fs";import e from"path";async function vn(r,o,i){if(r.__stx_runtime_config)return;let n=xn();if(n||i){r.__stx_runtime_config=n??N(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-yvqmr4p0.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=N(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function vi(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{qg}from"./chunk-7vqhm1rx.js";import"./chunk-20qn18ry.js";import"./chunk-1jwqjdk7.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-m76jbcey.js";import"./chunk-kfgbk0x9.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{qg as buildApp};
2
+ import{qg}from"./chunk-6vqm866c.js";import"./chunk-je1nvds2.js";import"./chunk-fwwf1t9k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{qg as buildApp};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import"./chunk-gebb12ak.js";import"./chunk-ybjfr7e8.js";import"./chunk-r9e0r6jx.js";import"./chunk-m76jbcey.js";import"./chunk-m7hfcxt3.js";import"./chunk-kfgbk0x9.js";import"./chunk-2ws2qe1k.js";import"./chunk-1jwqjdk7.js";import{c}from"./chunk-0rjcbqk3.js";import u from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||c(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),m=JSON.parse(p);if(m.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
2
+ import"./chunk-gebb12ak.js";import"./chunk-ybjfr7e8.js";import"./chunk-r9e0r6jx.js";import"./chunk-ygrc6aej.js";import"./chunk-m7hfcxt3.js";import"./chunk-x14jm9hg.js";import"./chunk-2ws2qe1k.js";import"./chunk-fwwf1t9k.js";import{c}from"./chunk-0rjcbqk3.js";import u from"fs";import l from"path";async function d(e,t={}){let s=Date.now(),n={total:0,passed:0,failed:0,new:0,failures:[],duration:0},i=t.snapshotDir||c(e.root,"story","snapshots");await u.promises.mkdir(i,{recursive:!0});let r=e.storyFiles;if(t.filter&&t.filter.length>0)r=r.filter((a)=>t.filter.some((o)=>a.fileName.toLowerCase().includes(o.toLowerCase())));for(let a of r)await h(a,i,t,n);return n.duration=Date.now()-s,n}async function h(e,t,s,n){let i=e.story;if(!i)return;for(let r of i.variants){n.total++;let a=l.join(t,`${e.id}-${r.id}.snap`),o=g(r.source||""),f=await w(a);if(s.update||!f){let p={storyId:e.id,variantId:r.id,component:e.fileName,timestamp:Date.now(),hash:o};if(await u.promises.writeFile(a,JSON.stringify(p,null,2)),!f)n.new++;n.passed++}else try{let p=await u.promises.readFile(a,"utf-8"),m=JSON.parse(p);if(m.hash===o)n.passed++;else n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:"Snapshot mismatch",difference:y(m.hash,o)})}catch(p){n.failed++,n.failures.push({storyId:e.id,variantId:r.id,component:e.fileName,message:`Error reading snapshot: ${p}`})}}}async function x(e,t={}){return(await d(e,{...t,update:!0})).total}function g(e){let t=0;for(let s=0;s<e.length;s++){let n=e.charCodeAt(s);t=(t<<5)-t+n,t=t&t}return t.toString(16)}function y(e,t){if(e===t)return 0;let s=Math.abs(Number.parseInt(e,16)-Number.parseInt(t,16));return Math.min(s/1e6,1)}async function w(e){try{return await u.promises.access(e),!0}catch{return!1}}function F(e){let t=[];if(t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(" STX Story Visual Regression Tests"),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),e.failures.length>0){t.push(" \u274C Failures:"),t.push("");for(let s of e.failures){if(t.push(` \u2022 ${s.component} / ${s.variantId}`),t.push(` ${s.message}`),s.difference!==void 0)t.push(` Difference: ${(s.difference*100).toFixed(2)}%`);t.push("")}}if(t.push(" Summary:"),t.push(` Total: ${e.total}`),t.push(` Passed: ${e.passed} \u2713`),t.push(` Failed: ${e.failed} \u2717`),e.new>0)t.push(` New: ${e.new} \u26A1`);return t.push(` Time: ${e.duration}ms`),t.push(""),t.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),t.push(""),t.join(`
3
3
  `)}export{F as formatTestResults,d as runVisualTests,x as updateSnapshots};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{ze,N,Dt}from"./chunk-m7hfcxt3.js";import{R}from"./chunk-gebb12ak.js";import{ft,Ce,L,qe,Ee,da,ho,pa,In}from"./chunk-jd1mvgwb.js";import{St,ue,et}from"./chunk-bmkm1c8s.js";import{Io}from"./chunk-3y6jhcrb.js";import{On}from"./chunk-j3st59hv.js";import{be}from"./chunk-f33wwacc.js";import Z from"fs";import P from"path";var{serve:ce}=globalThis.Bun;import F from"zlib";import{promisify as Q}from"util";var K=Q(F.brotliCompress),ee=Q(F.gzip),te=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ne=["text/event-stream","multipart/x-mixed-replace"],re=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ne.some((a)=>e.startsWith(a)))return!1;return te.some((a)=>e.startsWith(a))}function oe(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ae(t){if(!t)return null;let e=oe(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,H=new Map,U=0;function ie(t,e){if(e.length>Y/8)return;H.set(t,e),U+=e.length;for(let[a,r]of H){if(U<=Y)break;H.delete(a),U-=r.length}}async function $n(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let r=ae(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(i.length<(a.threshold??re))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=H.get(g);if(!l)l=r==="br"?await K(i,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await ee(i),ie(g,l);if(l.length>=i.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new R(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",L(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${Ce(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await a();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((C)=>C.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((C)=>C!=="x-stx-router"&&C!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",L(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return i();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let M=await v;return M?l(M):i()}}var pe={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function Kg(t={}){let e=P.resolve(t.outputDir||".output"),a=t.port??3000,r=da(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=On(r.routeRules),f=new G,h=Io(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?N(l):void 0,b=new Map,k=new Map,v=new Map,M=new Map;for(let n of r.routes)try{let C=P.join(e,n.compiledPath),c=JSON.parse(await Bun.file(C).text());if(m)c.html=Dt(c.html,m);b.set(n.pattern,c),v.set(n.pattern,et(c.html)),M.set(n.pattern,be(c.html));let X=P.join(e,n.fragmentPath);if(qe(c.html,r.routerContainer||"main")&&await Bun.file(X).exists()){let A=await Bun.file(X).text();k.set(n.pattern,m?Dt(A,m):A)}}catch(C){console.warn(`[stx] Failed to load route ${n.pattern}:`,C)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:C,params:c}=ue(n.pattern,{page:!0});S.push({regex:C,route:n,paramNames:c})}else s.set(n.pattern,n);let E=ce({port:a,async fetch(n){return $n(n,await ze(m??N(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let y=P.extname(u).toLowerCase(),B=pe[y]||"application/octet-stream",_=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=Ce(n),w=null,q={};if(w=s.get(c)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let o=c.match(p);if(o){w=d,u.forEach((y,B)=>{q[y]=o[B+1]});break}}if(!w){let p=St(c)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=i(c),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=k.get(w.pattern);if(o){let y=v.get(w.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...M.has(w.pattern)?{"X-STX-Runtime":M.get(w.pattern)?"true":"false"}:{},...y?{"X-STX-Layout":y.layout,"X-STX-Layout-Group":y.group}:{},...L(),...O.cache?{}:{"Cache-Control":ft}}})}}let d=ho(n.method),u=b.get(w.pattern);if(!u){let o=s.get("/500")||null;if(o){let y=b.get(o.pattern);if(y)return new Response(y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...L(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:y,redirect:B,cookies:_,status:I,headers:D}=await In(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return pa(B,_,D);if(y&&y.length>0){let{renderStreamingPage:T,streamToResponse:z}=await import("./chunk-mfnyqcfg.js"),j=new Headers({...L(),...D,"Cache-Control":"private, no-store"});for(let V of _??[])j.append("Set-Cookie",V);if(A&&!d&&qe(o,r.routerContainer||"main")){let V=et(o);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",be(o)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(T(A&&!d&&qe(o,r.routerContainer||"main")?Ee(o,r.routerContainer||"main",!0):o,y,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let x=new Headers({"Content-Type":"text/html",...L(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let T of _??[])x.append("Set-Cookie",T);for(let[T,z]of Object.entries(D??{}))x.set(T,z);if(x.set("Vary",L(x.get("Vary")).Vary),A&&!d&&qe(o,r.routerContainer||"main")){let T=et(o);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",be(o)?"true":"false"),x.set("X-STX-Layout",T.layout),x.set("X-STX-Layout-Group",T.group),new Response(Ee(o,r.routerContainer||"main",!0),{status:I??u.status??200,headers:x})}return new Response(o,{status:I??u.status??200,headers:x})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
2
+ import{ze,N,Dt}from"./chunk-m7hfcxt3.js";import{R}from"./chunk-gebb12ak.js";import{ft,Ce,L,qe,Ee,da,ho,pa,In}from"./chunk-r13bcmsh.js";import{St,ue,et}from"./chunk-bmkm1c8s.js";import{Io}from"./chunk-et7jca3r.js";import{On}from"./chunk-j3st59hv.js";import{be}from"./chunk-p4yhhx16.js";import Z from"fs";import P from"path";var{serve:ce}=globalThis.Bun;import F from"zlib";import{promisify as Q}from"util";var K=Q(F.brotliCompress),ee=Q(F.gzip),te=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ne=["text/event-stream","multipart/x-mixed-replace"],re=1024;function se(t){if(!t)return!1;let e=t.toLowerCase();if(ne.some((a)=>e.startsWith(a)))return!1;return te.some((a)=>e.startsWith(a))}function oe(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function ae(t){if(!t)return null;let e=oe(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var Y=33554432,H=new Map,U=0;function ie(t,e){if(e.length>Y/8)return;H.set(t,e),U+=e.length;for(let[a,r]of H){if(U<=Y)break;H.delete(a),U-=r.length}}async function $n(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!se(e.headers.get("content-type")))return e;let r=ae(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:J(e.headers)});if(i.length<(a.threshold??re))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=H.get(g);if(!l)l=r==="br"?await K(i,{params:{[F.constants.BROTLI_PARAM_QUALITY]:h,[F.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await ee(i),ie(g,l);if(l.length>=i.length)return f();let m=J(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function J(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new R(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",L(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${Ce(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let S=new Headers(s.headers);return S.set("Cache-Control","private, no-store"),S.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:S})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let b=this.generation,k=async()=>{let s=await a();r=s;let S=(s.headers.get("Vary")??"").toLowerCase().split(",").map((C)=>C.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||S.some((C)=>C!=="x-stx-router"&&C!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",L(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===b)this.entries.set(h,n);return n},v=this.pending.get(h);if(!v){if(this.pending.size>=1000)return i();v=k().finally(()=>{if(this.pending.get(h)===v)this.pending.delete(h)}),this.pending.set(h,v)}if(g&&m<e.maxAge+(e.swr??0))return v.catch(()=>{}),l(g);let M=await v;return M?l(M):i()}}var pe={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function Kg(t={}){let e=P.resolve(t.outputDir||".output"),a=t.port??3000,r=da(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=On(r.routeRules),f=new G,h=Io(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?N(l):void 0,b=new Map,k=new Map,v=new Map,M=new Map;for(let n of r.routes)try{let C=P.join(e,n.compiledPath),c=JSON.parse(await Bun.file(C).text());if(m)c.html=Dt(c.html,m);b.set(n.pattern,c),v.set(n.pattern,et(c.html)),M.set(n.pattern,be(c.html));let X=P.join(e,n.fragmentPath);if(qe(c.html,r.routerContainer||"main")&&await Bun.file(X).exists()){let A=await Bun.file(X).text();k.set(n.pattern,m?Dt(A,m):A)}}catch(C){console.warn(`[stx] Failed to load route ${n.pattern}:`,C)}let s=new Map,S=[];for(let n of r.routes)if(n.hasParams){let{regex:C,params:c}=ue(n.pattern,{page:!0});S.push({regex:C,route:n,paramNames:c})}else s.set(n.pattern,n);let E=ce({port:a,async fetch(n){return $n(n,await ze(m??N(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let X=await h(n);if(X)return X;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let y=P.extname(u).toLowerCase(),B=pe[y]||"application/octet-stream",_=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":_?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=Ce(n),w=null,q={};if(w=s.get(c)||null,!w)for(let{regex:p,route:d,paramNames:u}of S){let o=c.match(p);if(o){w=d,u.forEach((y,B)=>{q[y]=o[B+1]});break}}if(!w){let p=St(c)?null:s.get("/404")||null;if(p){let d=b.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let O=i(c),W=Object.keys(O).length>0;return f.respond(n,O.cache,async()=>{let p=b.get(w.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=k.get(w.pattern);if(o){let y=v.get(w.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...M.has(w.pattern)?{"X-STX-Runtime":M.get(w.pattern)?"true":"false"}:{},...y?{"X-STX-Layout":y.layout,"X-STX-Layout-Group":y.group}:{},...L(),...O.cache?{}:{"Cache-Control":ft}}})}}let d=ho(n.method),u=b.get(w.pattern);if(!u){let o=s.get("/500")||null;if(o){let y=b.get(o.pattern);if(y)return new Response(y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(w.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...L(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:y,redirect:B,cookies:_,status:I,headers:D}=await In(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return pa(B,_,D);if(y&&y.length>0){let{renderStreamingPage:T,streamToResponse:z}=await import("./chunk-f8awd1cy.js"),j=new Headers({...L(),...D,"Cache-Control":"private, no-store"});for(let V of _??[])j.append("Set-Cookie",V);if(A&&!d&&qe(o,r.routerContainer||"main")){let V=et(o);j.set("X-STX-Fragment","true"),j.set("X-STX-Runtime",be(o)?"true":"false"),j.set("X-STX-Layout",V.layout),j.set("X-STX-Layout-Group",V.group)}return z(T(A&&!d&&qe(o,r.routerContainer||"main")?Ee(o,r.routerContainer||"main",!0):o,y,{timeoutMs:30000}),{status:I??u.status??200,headers:j})}let x=new Headers({"Content-Type":"text/html",...L(),...O.cache?{}:{"Cache-Control":"private, no-store"}});for(let T of _??[])x.append("Set-Cookie",T);for(let[T,z]of Object.entries(D??{}))x.set(T,z);if(x.set("Vary",L(x.get("Vary")).Vary),A&&!d&&qe(o,r.routerContainer||"main")){let T=et(o);return x.set("X-STX-Fragment","true"),x.set("X-STX-Runtime",be(o)?"true":"false"),x.set("X-STX-Layout",T.layout),x.set("X-STX-Layout-Group",T.group),new Response(Ee(o,r.routerContainer||"main",!0),{status:I??u.status??200,headers:x})}return new Response(o,{status:I??u.status??200,headers:x})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${b.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
3
3
  export{$n,Kg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{m,h,p}from"./chunk-m76jbcey.js";import{B}from"./chunk-20qn18ry.js";import{i}from"./chunk-c84fwzfq.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Om(e,t={},o={}){let n={...B,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,y,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((f)=>setTimeout(f,0))}else{let u=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)u.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,y,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,y,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,y,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,y,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
2
+ import{m,h,p}from"./chunk-ygrc6aej.js";import{B}from"./chunk-je1nvds2.js";import{i}from"./chunk-6sh0qbqe.js";import k from"path";var q={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var M=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function H(e){let t=[],o=0,n;M.lastIndex=0;while((n=M.exec(e))!==null){if(n.index>o){let a=e.slice(o,n.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let s=n[1],r=n[2];t.push({type:"suspense",name:s,content:r}),o=n.index+n[0].length}if(o<e.length){let s=e.slice(o);if(s.trim())t.push({type:t.length===0?"shell":"content",content:s})}if(t.length===0)t.push({type:"shell",content:e});return t}async function Om(e,t={},o={}){let n={...B,...o,streaming:{...q,...o.streaming}},s=n.streaming?.bufferSize||16384;return new ReadableStream({async start(r){try{let a=await Bun.file(e).text(),S=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),g=S?S[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:k.dirname(e)};if(g.trim())await m(g,y,e);let E=H(c),l=new Set;if(!E.some((w)=>w.type==="suspense")){let w=n.streaming?.strategy||"auto",x=new RegExp(T.source,"g");if(!(w!=="manual"&&x.test(c))){let u=await i(c,y,e,n,l);for(let b=0;b<u.length;b+=s)r.enqueue(u.slice(b,b+s)),await new Promise((f)=>setTimeout(f,0))}else{let u=[],b=new RegExp(T.source,"g"),f;while((f=b.exec(c))!==null)u.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of u){if(_.start>v){let I=c.slice(v,_.start);if(I.trim()){let O=await i(I,y,e,n,l);r.enqueue(O),await new Promise((D)=>setTimeout(D,0))}}let C=await i(_.content,y,e,n,l);r.enqueue(C),await new Promise((I)=>setTimeout(I,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await i(_,y,e,n,l);r.enqueue(C)}}}}else{let w=new Map;for(let d of E)if(d.type==="shell"||d.type==="content"){let u=await i(d.content,y,e,n,l);r.enqueue(u)}else if(d.type==="suspense"&&d.name){let u=`stx-suspense-${d.name}`;r.enqueue(`<div id="${u}" data-suspense="${d.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(d.name,i(d.content,y,e,n,l))}r.enqueue(`
5
5
  <script>
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{rh,bo,sh,oh,ih,ah}from"./chunk-db3h2e1r.js";import"./chunk-bega3dk7.js";import"./chunk-et7jca3r.js";import"./chunk-7sh9fa3q.js";import"./chunk-021eq782.js";import"./chunk-p4yhhx16.js";import"./chunk-1carv1dw.js";import"./chunk-je1nvds2.js";import"./chunk-fwwf1t9k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{ah as clearStoreCache,rh as getStoreScript,ih as getStoreScriptFor,oh as pageStoresAll,bo as storesRead,sh as storesReadInFiles};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ze,xn,Ws,xi,N}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-kfgbk0x9.js";import{Nr,k,ll,at,Ri,ul}from"./chunk-ybjfr7e8.js";import{P}from"./chunk-r9e0r6jx.js";import{R,qs,u,f,jt,d,q,F,w,Js,_e,Ve,Ys}from"./chunk-gebb12ak.js";import{r,ge}from"./chunk-3vpgr6nk.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-c5vzr1va.js";import Qe from"path";import kt from"process";import{AsyncLocalStorage as Bo}from"async_hooks";var cr=new Bo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ar(e,t){return cr.run(mn(e),t)}async function lr(e,t){let i=cr.getStore();if(!i)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 n=i.pending.get(e);if(n)return n;let c=Promise.resolve().then(t).then((l)=>{let a=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),y=JSON.parse(a);return i.values.set(e,y),y}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,c),c}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function H(e,t=!1){let i=r(e),n=[],c=new Set,l=0,a=0,y=i.length,v=()=>{if(l!==0)return;let E=i.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let I=E[2];if(!c.has(I))n.push(I),c.add(I);return}let A=i.slice(a).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(a).startsWith("const"))return;A[1].split(",").forEach((I)=>{let j=I.trim();if(!j)return;let Q=j.indexOf(":"),z=(Q>=0?j.slice(Q+1).trim():j).split(/[\s=]/)[0];if(z&&!c.has(z))n.push(z),c.add(z)});return}let M=i.slice(a).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(t&&i.slice(a).startsWith("const"))return;M[1].split(",").forEach((I)=>{let j=I.trim().replace(/^\.\.\./,"");if(!j)return;let Q=j.split(/[\s=]/)[0];if(Q&&!c.has(Q))n.push(Q),c.add(Q)});return}if(t)return;let B=i.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let I=B[1];if(!c.has(I))n.push(I),c.add(I);return}let D=i.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let I=D[1];if(!c.has(I))n.push(I),c.add(I)}};while(a<y){if(i[a]==="{"){l++,a++;continue}if(i[a]==="}"){l--,a++;continue}if(l===0&&/[a-z]/i.test(i[a])&&(a===0||/\s|[;{}()]/.test(i[a-1])))v();a++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,t=H(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(H(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Wo(e,t)} }`;return H(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import An from"fs";import Te from"path";function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ur=new Map;function yr(e,t=!0){let i=ur.get(e);if(t&&i)return i;let n=new Map,c=[Te.join(e,"src"),Te.join(e,"dist"),e];function l(a,y){if(y>6)return;let v;try{v=An.readdirSync(a,{withFileTypes:!0})}catch{return}for(let E of v){let A=Te.join(a,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!n.has(M))n.set(M,A);let B=M.toLowerCase();if(!n.has(B))n.set(B,A);let D=V(M);if(!n.has(D))n.set(D,A)}}}for(let a of c)if(l(a,0),n.size>0)break;if(t)ur.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=Te.join(i,"node_modules",e);try{if(An.statSync(n).isDirectory())return n}catch{}let c=Te.dirname(i);if(c===i)return null;i=c}}function Ms(e,t,i={}){return[Te.resolve(Te.dirname(t),`${e}.stx`),Te.resolve(Te.dirname(t),e),Te.resolve(i.componentsDir||"components",`${e}.stx`),Te.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),n=V(t);return[t,i,n]}function oi(e,t){let[i,n,c]=fr(e);for(let l of[i,i.toLowerCase(),n,c]){let a=t?.__importedComponents?.get(l);if(a!==void 0)return a}}function*ii(e,t,i={},n){let c=fr(e);if(c[0].startsWith("./")||c[0].startsWith("../")){yield Te.resolve(Te.dirname(t),`${c[0]}.stx`);return}let l=[...new Set(c.map((v)=>`${v}.stx`))],a=i.projectRoot||process.cwd(),y=[...n?.__originalFilePath?[Te.join(Te.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],Te.join(Te.dirname(t),"components"),Te.resolve(a,"src/components"),Te.resolve(a,"components"),...import.meta.dir?[Te.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield Te.join(v,E);try{for(let E of An.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield Te.join(v,E.name,A)}catch{}}}function pr(e,t,i={},n){let c=oi(e,n);if(c!==void 0)return c;for(let l of ii(e,t,i,n))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let c=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=c.get("alt"),a=c.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof a==="string"?!["false","0","off","no"].includes(a.trim().toLowerCase()):Boolean(a);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import Zn from"fs";import ce from"path";import ht from"path";import Kt from"fs";var zo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function cs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return zo.has(e.toLowerCase())}var dr=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"]),gr={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"},Fo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function mr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(Fo.has(n))t.systemKeys.push(n);else if(n in $r)t.mouse=n;else if(n in gr||/^[a-z]$/.test(n))t.keys.push(gr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let c=n.match(/debounce(?:\.(\d+))?/);t.debounce=c?.[1]?Number.parseInt(c[1],10):300}else if(n.startsWith("throttle")){let c=n.match(/throttle(?:\.(\d+))?/);t.throttle=c?.[1]?Number.parseInt(c[1],10):300}}return t}function Rr(e,t=""){let i=[],n=0,c=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=c.exec(e))!==null){let[a,y,v]=l,E=l.index,A=E+a.length,M=`__stx_evt_${t}${n++}`,B=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=D.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=j.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}if(B.length>0)i.push({originalTag:a,elementId:M,events:B,startIndex:E,endIndex:A})}return i}function Uo(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((c)=>`$event.key === '${c}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=$r[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function Vo(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function as(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function Ho(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=Uo(e),c=Vo(as(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(cs(e.event,t))l.push("passive: true");let a=l.length>0?`, { ${l.join(", ")} }`:"",y=c.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{ze,xn,Ws,xi,N}from"./chunk-m7hfcxt3.js";import{vn}from"./chunk-x14jm9hg.js";import{Nr,k,ll,at,Ri,ul}from"./chunk-ybjfr7e8.js";import{P}from"./chunk-r9e0r6jx.js";import{R,qs,u,f,jt,d,q,F,w,Js,_e,Ve,Ys}from"./chunk-gebb12ak.js";import{r,ge}from"./chunk-3vpgr6nk.js";import{g}from"./chunk-0dve54ne.js";import{K}from"./chunk-c5vzr1va.js";import Qe from"path";import kt from"process";import{AsyncLocalStorage as Bo}from"async_hooks";var cr=new Bo;function mn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ar(e,t){return cr.run(mn(e),t)}async function lr(e,t){let i=cr.getStore();if(!i)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 n=i.pending.get(e);if(n)return n;let c=Promise.resolve().then(t).then((l)=>{let a=JSON.stringify(l,(v,E)=>{if(E===void 0||typeof E==="function"||typeof E==="symbol"||typeof E==="bigint"||typeof E==="number"&&!Number.isFinite(E))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(E&&typeof E==="object"&&!Array.isArray(E)&&Object.getPrototypeOf(E)!==Object.prototype&&Object.getPrototypeOf(E)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return E}),y=JSON.parse(a);return i.values.set(e,y),y}).catch((l)=>{throw i.pending.delete(e),l});return i.pending.set(e,c),c}function Cr(e){let t=e.__stx_server_data;if(!t?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(t.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function H(e,t=!1){let i=r(e),n=[],c=new Set,l=0,a=0,y=i.length,v=()=>{if(l!==0)return;let E=i.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(E){if(t&&E[1]==="const")return;let I=E[2];if(!c.has(I))n.push(I),c.add(I);return}let A=i.slice(a).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){if(t&&i.slice(a).startsWith("const"))return;A[1].split(",").forEach((I)=>{let j=I.trim();if(!j)return;let Q=j.indexOf(":"),z=(Q>=0?j.slice(Q+1).trim():j).split(/[\s=]/)[0];if(z&&!c.has(z))n.push(z),c.add(z)});return}let M=i.slice(a).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(t&&i.slice(a).startsWith("const"))return;M[1].split(",").forEach((I)=>{let j=I.trim().replace(/^\.\.\./,"");if(!j)return;let Q=j.split(/[\s=]/)[0];if(Q&&!c.has(Q))n.push(Q),c.add(Q)});return}if(t)return;let B=i.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(B){let I=B[1];if(!c.has(I))n.push(I),c.add(I);return}let D=i.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let I=D[1];if(!c.has(I))n.push(I),c.add(I)}};while(a<y){if(i[a]==="{"){l++,a++;continue}if(i[a]==="}"){l--,a++;continue}if(l===0&&/[a-z]/i.test(i[a])&&(a===0||/\s|[;{}()]/.test(i[a-1])))v();a++}return n.join(", ")}function Is(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function Wo(e,t=H(e).split(",").map((i)=>i.trim()).filter(Boolean)){let i=new Set(H(e,!0).split(",").map((n)=>n.trim()));return t.map((n)=>i.has(n)?`get ${n}() { return ${n} }, set ${n}(__stxValue_${n}) { ${n} = __stxValue_${n} }`:n).join(", ")}function Os(e,t){let i=`{ ${Wo(e,t)} }`;return H(e).split(",").some((n)=>n.trim()==="__stxLiveBindings")?`Object.defineProperties(${i}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:i}import An from"fs";import Te from"path";function V(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ur=new Map;function yr(e,t=!0){let i=ur.get(e);if(t&&i)return i;let n=new Map,c=[Te.join(e,"src"),Te.join(e,"dist"),e];function l(a,y){if(y>6)return;let v;try{v=An.readdirSync(a,{withFileTypes:!0})}catch{return}for(let E of v){let A=Te.join(a,E.name);if(E.isDirectory()){if(E.name==="node_modules"||E.name.startsWith("."))continue;l(A,y+1)}else if(E.isFile()&&E.name.endsWith(".stx")){let M=E.name.slice(0,-4);if(!n.has(M))n.set(M,A);let B=M.toLowerCase();if(!n.has(B))n.set(B,A);let D=V(M);if(!n.has(D))n.set(D,A)}}}for(let a of c)if(l(a,0),n.size>0)break;if(t)ur.set(e,n);return n}function Ns(e,t){if(e.startsWith(".")||e.startsWith("/"))return null;let i=t;while(!0){let n=Te.join(i,"node_modules",e);try{if(An.statSync(n).isDirectory())return n}catch{}let c=Te.dirname(i);if(c===i)return null;i=c}}function Ms(e,t,i={}){return[Te.resolve(Te.dirname(t),`${e}.stx`),Te.resolve(Te.dirname(t),e),Te.resolve(i.componentsDir||"components",`${e}.stx`),Te.resolve(i.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let t=e.endsWith(".stx")?e.slice(0,-4):e,i=t.split("-").map((c)=>c.charAt(0).toUpperCase()+c.slice(1)).join(""),n=V(t);return[t,i,n]}function oi(e,t){let[i,n,c]=fr(e);for(let l of[i,i.toLowerCase(),n,c]){let a=t?.__importedComponents?.get(l);if(a!==void 0)return a}}function*ii(e,t,i={},n){let c=fr(e);if(c[0].startsWith("./")||c[0].startsWith("../")){yield Te.resolve(Te.dirname(t),`${c[0]}.stx`);return}let l=[...new Set(c.map((v)=>`${v}.stx`))],a=i.projectRoot||process.cwd(),y=[...n?.__originalFilePath?[Te.join(Te.dirname(n.__originalFilePath),"components")]:[],...i.componentsDir?[i.componentsDir]:[],Te.join(Te.dirname(t),"components"),Te.resolve(a,"src/components"),Te.resolve(a,"components"),...import.meta.dir?[Te.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let E of l)yield Te.join(v,E);try{for(let E of An.readdirSync(v,{withFileTypes:!0}))if(E.isDirectory())for(let A of l)yield Te.join(v,E.name,A)}catch{}}}function pr(e,t,i={},n){let c=oi(e,n);if(c!==void 0)return c;for(let l of ii(e,t,i,n))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Ds(e,t=[],i={}){let n=new Set([...e].map((E)=>E.replace(/[-_]/g,"").toLowerCase()));if(!n.has("src")||!n.has("alt")&&!n.has("decorative"))return!1;let c=new Map(Object.entries(i).map(([E,A])=>[E.replace(/[-_]/g,"").toLowerCase(),A])),l=c.get("alt"),a=c.get("decorative"),y=typeof l==="string"&&!!l.trim(),v=typeof a==="string"?!["false","0","off","no"].includes(a.trim().toLowerCase()):Boolean(a);if(!y&&!v)return!1;if(["source","resizemode","defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((E)=>n.has(E)))return!1;if([...t].some((E)=>!["load","error"].includes(E.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;return["fit","objectfit","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((E)=>n.has(E))}import Zn from"fs";import ce from"path";import ht from"path";import Kt from"fs";var zo=new Set(["touchstart","touchmove","wheel","mousewheel"]);function cs(e,t){if(t.passive)return!0;if(t.prevent||t.nonpassive)return!1;return zo.has(e.toLowerCase())}var dr=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"]),gr={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"},Fo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function mr(e){let t={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let i of e){let n=i.toLowerCase();if(n==="prevent")t.prevent=!0;else if(n==="stop")t.stop=!0;else if(n==="once")t.once=!0;else if(n==="capture")t.capture=!0;else if(n==="self")t.self=!0;else if(n==="passive")t.passive=!0;else if(n==="nonpassive")t.nonpassive=!0;else if(Fo.has(n))t.systemKeys.push(n);else if(n in $r)t.mouse=n;else if(n in gr||/^[a-z]$/.test(n))t.keys.push(gr[n]||n.toUpperCase());else if(n.startsWith("debounce")){let c=n.match(/debounce(?:\.(\d+))?/);t.debounce=c?.[1]?Number.parseInt(c[1],10):300}else if(n.startsWith("throttle")){let c=n.match(/throttle(?:\.(\d+))?/);t.throttle=c?.[1]?Number.parseInt(c[1],10):300}}return t}function Rr(e,t=""){let i=[],n=0,c=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=c.exec(e))!==null){let[a,y,v]=l,E=l.index,A=E+a.length,M=`__stx_evt_${t}${n++}`,B=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,I;while((I=D.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}let j=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((I=j.exec(v))!==null){let[,Q,X]=I,z=Q.split("."),L=z[0];if(!dr.has(L))continue;B.push({attribute:`@${Q}`,event:L,handler:X,modifiers:mr(z.slice(1)),elementId:M})}if(B.length>0)i.push({originalTag:a,elementId:M,events:B,startIndex:E,endIndex:A})}return i}function Uo(e){let t=[],{modifiers:i}=e;if(i.self)t.push("if ($event.target !== $el) return");for(let n of i.systemKeys)t.push(`if (!$event.${n}Key) return`);if(i.keys.length>0){let n=i.keys.map((c)=>`$event.key === '${c}'`).join(" || ");t.push(`if (!(${n})) return`)}if(i.mouse!==null){let n=$r[i.mouse];t.push(`if ($event.button !== ${n}) return`)}if(i.prevent)t.push("$event.preventDefault()");if(i.stop)t.push("$event.stopPropagation()");return t.join("; ")}function Vo(e,t){let i=e;if(t.debounce!==null)i=`__stx_debounce(() => { ${i} }, ${t.debounce})`;else if(t.throttle!==null)i=`__stx_throttle(() => { ${i} }, ${t.throttle})`;return i}function as(e){let t=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t))return e;return`if (typeof ${t} === 'function' && !${t}._isSignal) ${t}($event);`}function Ho(e){let{modifiers:t}=e,i=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),n=Uo(e),c=Vo(as(e.handler),t),l=[];if(t.once)l.push("once: true");if(t.capture)l.push("capture: true");if(cs(e.event,t))l.push("passive: true");let a=l.length>0?`, { ${l.join(", ")} }`:"",y=c.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('${i}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function Zo(e,t=""){let i=Rr(e,t);if(i.length===0)return{template:e,bindings:[]};let n=e,c=[];for(let l=i.length-1;l>=0;l--){let a=i[l],y=a.originalTag;if(!y.includes(" id="))y=y.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${a.elementId}"`);else{let v=y.match(/id=["']([^"']+)["']/);if(v)for(let E of a.events)E.elementId=v[1]}for(let v of a.events){let E=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(`\\s*${E}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${E}\\s*=\\s*'[^']*'`,"g");y=y.replace(A,""),y=y.replace(M,"")}n=n.slice(0,a.startIndex)+y+n.slice(a.endIndex),c.push(...a.events)}return{template:n,bindings:c}}function hr(e){let t=e.$uid;return typeof t==="string"&&t?`${t}_`:""}function $c(e,t,i){if(ul(e))return e;if(t.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:y,bindings:v}=Zo(e,hr(t)),E=t.__stx_event_bindings||[];return t.__stx_event_bindings=[...E,...v],y}let n=Rr(e,hr(t));if(n.length===0)return e;let c=e;for(let y=n.length-1;y>=0;y--){let v=n[y],E=v.originalTag;if(!E.includes(" id="))E=E.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let A=E.match(/id=["']([^"']+)["']/);if(A)for(let M of v.events)M.elementId=A[1]}for(let A of v.events){let M=A.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=new RegExp(`\\s*${M}\\s*=\\s*"[^"]*"`,"g"),D=new RegExp(`\\s*${M}\\s*=\\s*'[^']*'`,"g");E=E.replace(B,""),E=E.replace(D,"")}c=c.slice(0,v.startIndex)+E+c.slice(v.endIndex)}let l=ai(n.flatMap((y)=>y.events)),a=c.lastIndexOf("</body>");if(a!==-1)c=c.slice(0,a)+l+`
115
- `+c.slice(a);else c+=l;return c}function Ar(e,t){let i=new Set;for(let n of e.split(",")){let c=n.trim().replace(/^\.\.\./,"").trim();if(!c)continue;if(t){let l=c.lastIndexOf(":");if(l!==-1)c=c.slice(l+1).trim()}if(c=c.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(c))i.add(c)}return i}function Rt(e,t){let i=r(e),{depths:n,balanced:c}=ge(i),l=(y)=>!c||n[y]===0,a=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let y of i.matchAll(a)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Ar(y[1],!0).has(t))return!0;for(let y of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Ar(y[1],!1).has(t))return!0;return!1}var Tr=new R(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),ut=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Ir=["(","[","{"],Or=[")","]","}"],Ko=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Xo(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let c=n.index??0;i.push({text:n[0],start:c,end:c+n[0].length})}return{code:t,tokens:i}}function ls(e){let t=Tr.get(e);if(t)return t;let{code:i,tokens:n}=Xo(e),c=new Map,l=[];for(let Q=0;Q<n.length;Q++){let X=n[Q].text;if(["(","[","{"].includes(X))l.push(Q);else if([")","]","}"].includes(X)){let z=l.at(-1);if(z!==void 0&&["()","[]","{}"].includes(n[z].text+X))l.pop(),c.set(z,Q),c.set(Q,z)}}function a(Q,X){let z=[],L=Q;for(let ee=Q;ee<X;ee++){if(["(","[","{"].includes(n[ee].text)&&(c.get(ee)??X)<X){ee=c.get(ee);continue}if(n[ee].text===",")z.push([L,ee]),L=ee+1}return z.push([L,X]),z}let y=[];function v(Q,X,z,L=!1){if(n[Q]?.text==="...")Q++;if(Q>=X)return;let ee=n[Q].text;if(ut.test(ee)){if(z.add(ee),z===M)y.push({name:ee,token:Q,functionScoped:L});return}if(ee!=="{"&&ee!=="[")return;let te=c.get(Q);if(te===void 0||te>=X)return;for(let[re,me]of a(Q+1,te)){let he=re;if(ee==="{")for(let le=re;le<me;le++){if(n[le].text===":"){he=le+1;break}if(n[le].text==="=")break;if(["(","[","{"].includes(n[le].text)&&c.has(le))le=c.get(le)}v(he,me,z,L)}}function E(Q,X){let z=new Set;for(let[L,ee]of a(Q,X))v(L,ee,z);return z}function A(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(["(","[","{"].includes(z)&&c.has(X)){X=c.get(X);continue}if([",",";",")","]","}"].includes(z))break}return n[Math.max(Q,X-1)]?.end??i.length}let M=new Set,B=[];for(let Q=0;Q<n.length;Q++)if(n[Q].text==="=>"){let X=Q-1,z=X,L;if(n[X]?.text===")"&&c.has(X))z=c.get(X),L=E(z+1,X);else if(n[X]&&ut.test(n[X].text))L=new Set([n[X].text]);else continue;let ee=Q+1,te=n[ee]?.text==="{"&&c.has(ee)?n[c.get(ee)].end:A(ee);B.push({start:n[z].start,end:te,bodyStart:n[ee]?.start??te,functionBody:!0,names:L})}else if(n[Q].text==="("&&c.has(Q)){let X=n[Q-1]?.text;if(!X||qo.has(X)||!ut.test(X)&&X!=="*"&&X!=="]")continue;let z=c.get(Q),L=z+1;if(n[L]?.text===":"){L++;while(L<n.length&&!["{","=>",";","="].includes(n[L].text))L++}if(n[L]?.text!=="{"||!c.has(L))continue;B.push({start:n[Q].start,end:n[c.get(L)].end,bodyStart:n[L].start,functionBody:X!=="catch",names:E(Q+1,z)})}function D(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(Ir.includes(z)&&c.has(X)){X=c.get(X);continue}if(z===";"||Or.includes(z))break;let L=n[X-1];if(X>Q&&Ko.has(z)&&L.text!==".")break;if(X>Q&&/[\n\r]/.test(i.slice(L.end,n[X].start))&&(/^[\w$]+$/.test(L.text)||Or.includes(L.text)||['"',"'","`"].includes(L.text))&&ut.test(z)&&!["in","of","instanceof"].includes(z))break}return X}let I=[];for(let Q=0;Q<n.length;Q++){if(n[Q].text!=="for")continue;let X=n[Q+1]?.text==="await"?Q+2:Q+1;if(n[X]?.text!=="("||!c.has(X))continue;let z=c.get(X),L=z+1,ee=n[L]?.text==="{"&&c.has(L)?c.get(L):D(L),te=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(L,ee-1)]?.end??i.length;I.push({headStart:X,headEnd:z,start:n[X].start,end:te})}for(let Q=0;Q<n.length;Q++){let X=n[Q].text,z=n[Q-1]?.text;if(z==="."||n[Q+1]?.text===":")continue;if(z==="as"||z==="<")continue;if(X==="const"||X==="let"||X==="var"){let L=D(Q+1),ee=Q+1,te=!1,re=!1,me=0;for(let he=Q+1;he<=L;he++){let le=n[he]?.text;if(he<L&&Ir.includes(le)&&c.has(he)&&c.get(he)<L){he=c.get(he);continue}if(he<L&&le===":"&&!re)te=!0;else if(he<L&&le==="="&&me===0)te=!1,re=!0;else if(he<L&&te&&le==="<")me++;else if(he<L&&te&&le===">"&&me>0)me--;else if(he===L||le===","&&me===0)v(ee,he,M,X==="var"),ee=he+1,te=!1,re=!1}}else if(X==="function"||X==="class"){let L=Q+1;if(n[L]?.text==="*")L++;if(n[L]&&ut.test(n[L].text)&&n[L].text!=="extends")M.add(n[L].text),y.push({name:n[L].text,token:L})}else if(X==="import"){let L=Q+1;if(n[L]?.text==="*"&&n[L+1]?.text==="as")L+=2;let ee=n[L]?.text;if(ee&&ut.test(ee)&&ee!=="type"&&n[L+1]?.text!=="("&&n[L+1]?.text!==".")M.add(ee),y.push({name:ee,token:L,file:!0});let te=n[L]?.text==="{"?L:n[L+1]?.text===","&&n[L+2]?.text==="{"?L+2:-1;if(te!==-1&&c.has(te)){let re=c.get(te);for(let[me,he]of a(te+1,re)){let le=he-1;while(le>=me&&!ut.test(n[le].text))le--;if(le>=me&&n[le].text!=="type")y.push({name:n[le].text,token:le,file:!0})}}}}let j={code:i,scopes:B,loops:I,declarations:M,sites:y,tokens:n,pairs:c};return Tr.set(e,j),j}function qt(e){let t=ls(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((c)=>n>=c.start&&n<c.end&&c.names.has(i))}}function Tn(e){return new Set(ls(e).declarations)}function Ie(e,t){let{scopes:i,loops:n,sites:c,tokens:l,pairs:a}=ls(e),y=Array.from({length:l.length},()=>-1),v=[];for(let D=0;D<l.length;D++){y[D]=v.length?v[v.length-1]:-1;let I=l[D].text;if(I==="{"&&a.has(D))v.push(D);else if(I==="}"&&v.length&&a.get(D)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let D of c){if(!t.has(D.name))continue;E.add(D.token);let I=D.file?-1:y[D.token],j=I===-1?[0,Number.POSITIVE_INFINITY]:[l[I].start,l[a.get(I)].end];if(D.functionScoped){let X=l[D.token].start,z=i.filter((L)=>L.functionBody&&X>=L.bodyStart&&X<L.end).sort((L,ee)=>L.end-L.bodyStart-(ee.end-ee.bodyStart))[0];j=z?[z.bodyStart,z.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let X=n.filter((z)=>D.token>z.headStart&&D.token<z.headEnd).sort((z,L)=>z.headEnd-z.headStart-(L.headEnd-L.headStart))[0];if(X)j=[X.start,X.end]}let Q=A.get(D.name);if(Q)Q.push(j);else A.set(D.name,[j])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let I=D+1;if(l[I]?.text==="type")I++;if(l[I]&&ut.test(l[I].text)&&l[I+1]?.text===",")I+=2;if(l[I]?.text==="{"&&a.has(I))for(let j=I+1;j<a.get(I);j++)M.add(j)}let B=new Set;for(let D=0;D<l.length;D++){let I=l[D].text;if(!t.has(I)||B.has(I)||E.has(D)||M.has(D))continue;let j=l[D-1]?.text;if(j==="#"||j==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(j==="{"||j===","))continue;let Q=l[D].start;if(A.get(I)?.some(([X,z])=>Q>=X&&Q<z))continue;if(i.some((X)=>Q>=X.start&&Q<X.end&&X.names.has(I)))continue;B.add(I)}return B}var Pe="0.2.811";var Pr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Go(){let e=globalThis;return e[Pr]??=new Map,e[Pr]}function o(e,t){let i=Go(),n=`${import.meta.url}\x00${e}`,c=i.get(n);if(c)return c;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var Yo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Yo,"<\\/$1")}import Dr from"fs";var Mr=[];function b(e){let t=new R(e);return Mr.push(t),t}function Rc(){for(let e of Mr)e.clear()}function x(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function br(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Dr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Dr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var xe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var Qo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ec(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function tc(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let c=ht.dirname(i);if(c===i)return null;i=c}}function nc(e,t){if(!e||typeof e!=="object")return null;let i=(c)=>{if(typeof c==="string")return c;if(c&&typeof c==="object"){if(typeof c.import==="string")return c.import;if(typeof c.default==="string")return c.default;if(typeof c.import==="object")return i(c.import);if(typeof c.default==="object")return i(c.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let c of Object.keys(e)){let l=c.indexOf("*");if(l===-1)continue;let a=c.slice(0,l),y=c.slice(l+1);if(!t.startsWith(a)||!t.endsWith(y))continue;if(t.length<a.length+y.length)continue;if(!n||a.length>n.prefix.length)n={pattern:c,prefix:a,suffix:y}}if(n){let c=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",c)}return null}function sc(e,t){let i=ec(e);if(!i||!i.subpath)return null;let n=tc(i.pkg,t);if(!n)return null;let c;try{c=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,a=nc(c.exports,l);if(!a)return null;let y=ht.resolve(n,a);return Kt.existsSync(y)?y:null}function mi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),c=new Set,l=[],a=[];return{code:e.replace(Qo,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let M=null;try{M=Bun.resolveSync(E,n)}catch{M=sc(E,n)}if(!M)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=M}}catch(M){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${M?.message||M}`),a.push(E),""}if(c.has(A))return"";c.add(A);try{let M=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:M})}catch(M){console.warn(`[stx:vendor-css] could not read ${A}: ${M?.message||M}`),a.push(E)}return""}),styles:l,unresolved:a}}function rc(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${rc(t.source)}" data-stx-layer="vendor">
115
+ `+c.slice(a);else c+=l;return c}function Ar(e,t){let i=new Set;for(let n of e.split(",")){let c=n.trim().replace(/^\.\.\./,"").trim();if(!c)continue;if(t){let l=c.lastIndexOf(":");if(l!==-1)c=c.slice(l+1).trim()}if(c=c.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(c))i.add(c)}return i}function Rt(e,t){let i=r(e),{depths:n,balanced:c}=ge(i),l=(y)=>!c||n[y]===0,a=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${t}\\b)`,"g");for(let y of i.matchAll(a)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of i.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&Ar(y[1],!0).has(t))return!0;for(let y of i.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&Ar(y[1],!1).has(t))return!0;return!1}var Tr=new R(32,{maxBytes:2097152,sizeOf:(e)=>e.code.length*4}),ut=/^[A-Za-z_$][\w$]*$/,qo=new Set(["if","for","while","switch","with"]),Ir=["(","[","{"],Or=[")","]","}"],Ko=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Xo(e){let t=r(e),i=[];for(let n of t.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let c=n.index??0;i.push({text:n[0],start:c,end:c+n[0].length})}return{code:t,tokens:i}}function ls(e){let t=Tr.get(e);if(t)return t;let{code:i,tokens:n}=Xo(e),c=new Map,l=[];for(let Q=0;Q<n.length;Q++){let X=n[Q].text;if(["(","[","{"].includes(X))l.push(Q);else if([")","]","}"].includes(X)){let z=l.at(-1);if(z!==void 0&&["()","[]","{}"].includes(n[z].text+X))l.pop(),c.set(z,Q),c.set(Q,z)}}function a(Q,X){let z=[],L=Q;for(let ee=Q;ee<X;ee++){if(["(","[","{"].includes(n[ee].text)&&(c.get(ee)??X)<X){ee=c.get(ee);continue}if(n[ee].text===",")z.push([L,ee]),L=ee+1}return z.push([L,X]),z}let y=[];function v(Q,X,z,L=!1){if(n[Q]?.text==="...")Q++;if(Q>=X)return;let ee=n[Q].text;if(ut.test(ee)){if(z.add(ee),z===M)y.push({name:ee,token:Q,functionScoped:L});return}if(ee!=="{"&&ee!=="[")return;let te=c.get(Q);if(te===void 0||te>=X)return;for(let[re,me]of a(Q+1,te)){let he=re;if(ee==="{")for(let le=re;le<me;le++){if(n[le].text===":"){he=le+1;break}if(n[le].text==="=")break;if(["(","[","{"].includes(n[le].text)&&c.has(le))le=c.get(le)}v(he,me,z,L)}}function E(Q,X){let z=new Set;for(let[L,ee]of a(Q,X))v(L,ee,z);return z}function A(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(["(","[","{"].includes(z)&&c.has(X)){X=c.get(X);continue}if([",",";",")","]","}"].includes(z))break}return n[Math.max(Q,X-1)]?.end??i.length}let M=new Set,B=[];for(let Q=0;Q<n.length;Q++)if(n[Q].text==="=>"){let X=Q-1,z=X,L;if(n[X]?.text===")"&&c.has(X))z=c.get(X),L=E(z+1,X);else if(n[X]&&ut.test(n[X].text))L=new Set([n[X].text]);else continue;let ee=Q+1,te=n[ee]?.text==="{"&&c.has(ee)?n[c.get(ee)].end:A(ee);B.push({start:n[z].start,end:te,bodyStart:n[ee]?.start??te,functionBody:!0,names:L})}else if(n[Q].text==="("&&c.has(Q)){let X=n[Q-1]?.text;if(!X||qo.has(X)||!ut.test(X)&&X!=="*"&&X!=="]")continue;let z=c.get(Q),L=z+1;if(n[L]?.text===":"){L++;while(L<n.length&&!["{","=>",";","="].includes(n[L].text))L++}if(n[L]?.text!=="{"||!c.has(L))continue;B.push({start:n[Q].start,end:n[c.get(L)].end,bodyStart:n[L].start,functionBody:X!=="catch",names:E(Q+1,z)})}function D(Q){let X=Q;for(;X<n.length;X++){let z=n[X].text;if(Ir.includes(z)&&c.has(X)){X=c.get(X);continue}if(z===";"||Or.includes(z))break;let L=n[X-1];if(X>Q&&Ko.has(z)&&L.text!==".")break;if(X>Q&&/[\n\r]/.test(i.slice(L.end,n[X].start))&&(/^[\w$]+$/.test(L.text)||Or.includes(L.text)||['"',"'","`"].includes(L.text))&&ut.test(z)&&!["in","of","instanceof"].includes(z))break}return X}let I=[];for(let Q=0;Q<n.length;Q++){if(n[Q].text!=="for")continue;let X=n[Q+1]?.text==="await"?Q+2:Q+1;if(n[X]?.text!=="("||!c.has(X))continue;let z=c.get(X),L=z+1,ee=n[L]?.text==="{"&&c.has(L)?c.get(L):D(L),te=n[ee]?.text===";"||n[ee]?.text==="}"?n[ee].end:n[Math.max(L,ee-1)]?.end??i.length;I.push({headStart:X,headEnd:z,start:n[X].start,end:te})}for(let Q=0;Q<n.length;Q++){let X=n[Q].text,z=n[Q-1]?.text;if(z==="."||n[Q+1]?.text===":")continue;if(z==="as"||z==="<")continue;if(X==="const"||X==="let"||X==="var"){let L=D(Q+1),ee=Q+1,te=!1,re=!1,me=0;for(let he=Q+1;he<=L;he++){let le=n[he]?.text;if(he<L&&Ir.includes(le)&&c.has(he)&&c.get(he)<L){he=c.get(he);continue}if(he<L&&le===":"&&!re)te=!0;else if(he<L&&le==="="&&me===0)te=!1,re=!0;else if(he<L&&te&&le==="<")me++;else if(he<L&&te&&le===">"&&me>0)me--;else if(he===L||le===","&&me===0)v(ee,he,M,X==="var"),ee=he+1,te=!1,re=!1}}else if(X==="function"||X==="class"){let L=Q+1;if(n[L]?.text==="*")L++;if(n[L]&&ut.test(n[L].text)&&n[L].text!=="extends")M.add(n[L].text),y.push({name:n[L].text,token:L})}else if(X==="import"){let L=Q+1;if(n[L]?.text==="*"&&n[L+1]?.text==="as")L+=2;let ee=n[L]?.text;if(ee&&ut.test(ee)&&ee!=="type"&&n[L+1]?.text!=="("&&n[L+1]?.text!==".")M.add(ee),y.push({name:ee,token:L,file:!0});let te=n[L]?.text==="{"?L:n[L+1]?.text===","&&n[L+2]?.text==="{"?L+2:-1;if(te!==-1&&c.has(te)){let re=c.get(te);for(let[me,he]of a(te+1,re)){let le=he-1;while(le>=me&&!ut.test(n[le].text))le--;if(le>=me&&n[le].text!=="type")y.push({name:n[le].text,token:le,file:!0})}}}}let j={code:i,scopes:B,loops:I,declarations:M,sites:y,tokens:n,pairs:c};return Tr.set(e,j),j}function qt(e){let t=ls(e);return{code:t.code,shadows:(i,n)=>t.scopes.some((c)=>n>=c.start&&n<c.end&&c.names.has(i))}}function Tn(e){return new Set(ls(e).declarations)}function Ie(e,t){let{scopes:i,loops:n,sites:c,tokens:l,pairs:a}=ls(e),y=Array.from({length:l.length},()=>-1),v=[];for(let D=0;D<l.length;D++){y[D]=v.length?v[v.length-1]:-1;let I=l[D].text;if(I==="{"&&a.has(D))v.push(D);else if(I==="}"&&v.length&&a.get(D)===v[v.length-1])v.pop()}let E=new Set,A=new Map;for(let D of c){if(!t.has(D.name))continue;E.add(D.token);let I=D.file?-1:y[D.token],j=I===-1?[0,Number.POSITIVE_INFINITY]:[l[I].start,l[a.get(I)].end];if(D.functionScoped){let X=l[D.token].start,z=i.filter((L)=>L.functionBody&&X>=L.bodyStart&&X<L.end).sort((L,ee)=>L.end-L.bodyStart-(ee.end-ee.bodyStart))[0];j=z?[z.bodyStart,z.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let X=n.filter((z)=>D.token>z.headStart&&D.token<z.headEnd).sort((z,L)=>z.headEnd-z.headStart-(L.headEnd-L.headStart))[0];if(X)j=[X.start,X.end]}let Q=A.get(D.name);if(Q)Q.push(j);else A.set(D.name,[j])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let I=D+1;if(l[I]?.text==="type")I++;if(l[I]&&ut.test(l[I].text)&&l[I+1]?.text===",")I+=2;if(l[I]?.text==="{"&&a.has(I))for(let j=I+1;j<a.get(I);j++)M.add(j)}let B=new Set;for(let D=0;D<l.length;D++){let I=l[D].text;if(!t.has(I)||B.has(I)||E.has(D)||M.has(D))continue;let j=l[D-1]?.text;if(j==="#"||j==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(j==="{"||j===","))continue;let Q=l[D].start;if(A.get(I)?.some(([X,z])=>Q>=X&&Q<z))continue;if(i.some((X)=>Q>=X.start&&Q<X.end&&X.names.has(I)))continue;B.add(I)}return B}var Pe="0.2.812";var Pr=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Go(){let e=globalThis;return e[Pr]??=new Map,e[Pr]}function o(e,t){let i=Go(),n=`${import.meta.url}\x00${e}`,c=i.get(n);if(c)return c;let l=t();return i.set(n,l),l.catch(()=>{if(i.get(n)===l)i.delete(n)}),l}var Yo=/<\/(script)/gi;function dn(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Yo,"<\\/$1")}import Dr from"fs";var Mr=[];function b(e){let t=new R(e);return Mr.push(t),t}function Rc(){for(let e of Mr)e.clear()}function x(e,...t){return`${t.map((i)=>String(i??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function br(e){let t=[];for(let i of new Set(e))try{t.push({path:i,mtimeMs:Dr.statSync(i).mtimeMs})}catch{}return t}function Ls(e){for(let t of e)try{if(Dr.statSync(t.path).mtimeMs!==t.mtimeMs)return!1}catch{return!1}return!0}var xe=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var Qo=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function ec(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let i=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!i)return null;return{pkg:i[1],subpath:i[2]||""}}let t=e.match(/^([^/]+)(\/.*)?$/);if(!t)return null;return{pkg:t[1],subpath:t[2]||""}}function tc(e,t){let i=t;while(!0){let n=ht.join(i,"node_modules",e,"package.json");if(Kt.existsSync(n))return ht.dirname(n);let c=ht.dirname(i);if(c===i)return null;i=c}}function nc(e,t){if(!e||typeof e!=="object")return null;let i=(c)=>{if(typeof c==="string")return c;if(c&&typeof c==="object"){if(typeof c.import==="string")return c.import;if(typeof c.default==="string")return c.default;if(typeof c.import==="object")return i(c.import);if(typeof c.default==="object")return i(c.default)}return null};if(Object.prototype.hasOwnProperty.call(e,t))return i(e[t]);let n=null;for(let c of Object.keys(e)){let l=c.indexOf("*");if(l===-1)continue;let a=c.slice(0,l),y=c.slice(l+1);if(!t.startsWith(a)||!t.endsWith(y))continue;if(t.length<a.length+y.length)continue;if(!n||a.length>n.prefix.length)n={pattern:c,prefix:a,suffix:y}}if(n){let c=t.slice(n.prefix.length,t.length-n.suffix.length),l=i(e[n.pattern]);if(l)return l.replace("*",c)}return null}function sc(e,t){let i=ec(e);if(!i||!i.subpath)return null;let n=tc(i.pkg,t);if(!n)return null;let c;try{c=JSON.parse(Kt.readFileSync(ht.join(n,"package.json"),"utf8"))}catch{return null}let l=`.${i.subpath}`,a=nc(c.exports,l);if(!a)return null;let y=ht.resolve(n,a);return Kt.existsSync(y)?y:null}function mi(e,t){let i=t.filePath?ht.dirname(t.filePath):t.projectRoot||process.cwd(),n=t.projectRoot||process.cwd(),c=new Set,l=[],a=[];return{code:e.replace(Qo,(v,E)=>{let A;try{if(E.startsWith("./")||E.startsWith("../")||E.startsWith("/")){if(A=E.startsWith("/")?E:ht.resolve(i,E),!Kt.existsSync(A))throw Error(`file not found: ${A}`)}else{let M=null;try{M=Bun.resolveSync(E,n)}catch{M=sc(E,n)}if(!M)throw Error(`could not resolve ${E} (Bun.resolveSync + exports fallback both failed)`);A=M}}catch(M){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(E)} (from ${t.filePath||"<unknown>"}): ${M?.message||M}`),a.push(E),""}if(c.has(A))return"";c.add(A);try{let M=Kt.readFileSync(A,"utf8");l.push({source:E,resolvedPath:A,contents:M})}catch(M){console.warn(`[stx:vendor-css] could not read ${A}: ${M?.message||M}`),a.push(E)}return""}),styles:l,unresolved:a}}function rc(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function hi(e){if(e.length===0)return"";return`${e.map((t)=>`<style data-stx-vendor="${rc(t.source)}" data-stx-layer="vendor">
116
116
  @layer vendor {
117
117
  ${t.contents}
118
118
  }
@@ -182,7 +182,7 @@ else {
182
182
  // STX: auto-generated event bindings
183
183
  ${e.map((i,n)=>mc(i,n)).join(`
184
184
  `)}`}function Wr(e){let t=[],i=new Set,n=e.replace(/^\s*import\s+.*$/gm,""),c=0,l=n.length,a=0;while(a<l){let y=n[a];if(y==="'"||y==='"'||y==="`"){let v=y;if(a++,v==="`"){let E=0;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"&&E===0){a++;break}if(n[a]==="$"&&n[a+1]==="{"){E++,a+=2;continue}if(n[a]==="}"&&E>0){E--,a++;continue}a++}}else while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]===v){a++;break}a++}continue}if(y==="/"&&n[a+1]==="/"){while(a<l&&n[a]!==`
185
- `)a++;continue}if(y==="/"&&n[a+1]==="*"){a+=2;while(a<l-1&&!(n[a]==="*"&&n[a+1]==="/"))a++;a+=2;continue}if(y==="{"){c++,a++;continue}if(y==="}"){c--,a++;continue}if(c===0){let v=n.slice(a),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let B=E[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((B)=>{let D=B.trim(),I=D.indexOf(":"),j=I>=0?D.slice(I+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(j&&!j.startsWith("_")&&!i.has(j))t.push(j),i.add(j)}),a+=A[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let B=M[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=M[0].length;continue}}a++}return t}var xc=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 bc(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(B){let D;while((D=i.exec(B))!==null){let I=D[0];if(!xc.has(I))t.add(I)}}let c=/\{\{([\s\S]*?)\}\}/g,l;while((l=c.exec(e))!==null)n(l[1]);let a=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=a.exec(e))!==null)n(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)n(l[1]);return t}async function Le(e,t={}){let i=e,n="",c=!1,l=[],a=mi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=a.code;let y=hi(a.styles),v=Nt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-e3qkbq8g.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),c=!0;if(t.autoImports!==!1){let L=qc(i);i=L.code,n=Kc(L.stxImports,L.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${yn(i,t.serverData)}${n}`,i=P(i),!c&&je(t.attrs||""))i=Be(i);let M=hc(t.eventBindings||[]),B=(t.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(B),I=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(D){let L=B.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${I}${L?` ${L}`:""}`;return`${y}<script ${ee}>
185
+ `)a++;continue}if(y==="/"&&n[a+1]==="*"){a+=2;while(a<l-1&&!(n[a]==="*"&&n[a+1]==="/"))a++;a+=2;continue}if(y==="{"){c++,a++;continue}if(y==="}"){c--,a++;continue}if(c===0){let v=n.slice(a),E=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(E){let B=E[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=E[0].length;continue}let A=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(A){A[1].split(",").forEach((B)=>{let D=B.trim(),I=D.indexOf(":"),j=I>=0?D.slice(I+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(j&&!j.startsWith("_")&&!i.has(j))t.push(j),i.add(j)}),a+=A[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let B=M[1];if(!B.startsWith("_")&&!i.has(B))t.push(B),i.add(B);a+=M[0].length;continue}}a++}return t}var xc=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 bc(e){let t=new Set,i=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function n(B){let D;while((D=i.exec(B))!==null){let I=D[0];if(!xc.has(I))t.add(I)}}let c=/\{\{([\s\S]*?)\}\}/g,l;while((l=c.exec(e))!==null)n(l[1]);let a=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=a.exec(e))!==null)n(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)n(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)n(l[1]);let E=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=E.exec(e))!==null)n(l[1]);let A=/@model\s*=\s*["']([^"']*)["']/gi;while((l=A.exec(e))!==null)n(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)n(l[1]);return t}async function Le(e,t={}){let i=e,n="",c=!1,l=[],a=mi(i,{filePath:t.filePath,projectRoot:t.projectRoot});i=a.code;let y=hi(a.styles),v=Nt(i);i=v.code,l=[...v.imports,...v.models];let{hasUserImports:E,bundleClientScript:A}=await o("stx/client-script-bundler",()=>import("./chunk-46npem9j.js"));if(E(i))i=await A(i,t.filePath||"",{projectRoot:t.projectRoot,minify:t.production}),c=!0;if(t.autoImports!==!1){let L=qc(i);i=L.code,n=Kc(L.stxImports,L.browserImports.filter((ee)=>!l.includes(ee)))}if(n=`${yn(i,t.serverData)}${n}`,i=P(i),!c&&je(t.attrs||""))i=Be(i);let M=hc(t.eventBindings||[]),B=(t.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(B),I=t.instanceId?` data-stx-instance="${t.instanceId}"`:"";if(D){let L=B.replace(/\btype\s*=\s*["']module["']/i,"").trim(),ee=`type="module" data-stx-scoped${I}${L?` ${L}`:""}`;return`${y}<script ${ee}>
186
186
  ${dn(`${n}${i}
187
187
  ${M}`)}
188
188
  </script>`}let j=Ri(e),Q=/function __stx_setup_/.test(i),X=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function z(L){let ee=L.length>0?`
@@ -285,8 +285,8 @@ ${E.join(`
285
285
  `){let I=e[c];if(I==="\\"){c+=2;continue}if(I==="[")D=!0;else if(I==="]")D=!1;else if(I==="/"&&!D){c++;while(c<l&&/[a-z]/i.test(e[c]))c++;return}c++}},B=()=>{if(n!==0)return;let D=e.slice(c).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(D){let X=D[2].split(",").map((z)=>{let L=z.trim().split(":");return L[L.length-1].trim()});for(let z of X)if(z&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(z)&&!i.has(z))t.push(z),i.add(z);return}let I=e.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(I){let X=I[2];if(!i.has(X))t.push(X),i.add(X);return}let j=e.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(j){let X=j[1];if(!i.has(X))t.push(X),i.add(X);return}let Q=e.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Q){let X=Q[1];if(!i.has(X))t.push(X),i.add(X)}};while(c<l){if(v())continue;if(e[c]==="'"||e[c]==='"'){a(e[c]);continue}if(e[c]==="`"){y();continue}if(e[c]==="/"&&A()){M();continue}if(e[c]==="{"){n++,c++;continue}if(e[c]==="}"){n--,c++;continue}if(n===0&&/[a-z]/i.test(e[c])&&(c===0||/\s|[;{}()]/.test(e[c-1])))B();c++}return t}function kl(e){let t=[],i=0,n=0,c=null;for(let l=0;l<e.length;l++){let a=e[l];if(c){if(a==="\\"){l++;continue}if(a===c)c=null;continue}if(a==='"'||a==="'"||a==="`"){c=a;continue}if(a==="("||a==="["||a==="{")i++;else if(a===")"||a==="]"||a==="}")i--;else if(a===","&&i===0)t.push(e.slice(n,l)),n=l+1}if(n<e.length)t.push(e.slice(n));return t}function Rl(e){let t=0,i=null;for(let n=0;n<e.length;n++){let c=e[n];if(i){if(c==="\\"){n++;continue}if(c===i)i=null;continue}if(c==='"'||c==="'"||c==="`"){i=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c==="="&&t===0){let l=e[n-1],a=e[n+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(a==="="||a===">")continue;return n}}return-1}function Cl(e,t){try{let i=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!i)return;let n=i.index-1;while(n>=0&&/\s/.test(e[n]))n--;if(e[n]!=="}")return;let c=n,l=0,a=-1;for(;n>=0;n--){let v=e[n];if(v==="}")l++;else if(v==="{"){if(l--,l===0){a=n;break}}}if(a===-1)return;let y=e.slice(a+1,c);for(let v of kl(y)){let E=v.trim();if(!E||E.startsWith("..."))continue;let A=Rl(E);if(A===-1)continue;let M=E.slice(0,A).trim();if(!/^[A-Z_$][\w$]*$/i.test(M))continue;if(t[M]!==void 0)continue;let B=E.slice(A+1).trim();if(!B)continue;try{let D=Object.keys(t).filter(jt),I=Function(...D,`"use strict"; return (${B});`);t[M]=I(...D.map((j)=>t[j]))}catch{}}}catch{}}var Al=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function pg(e,t){let i=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!i)return null;let n=i[2].toLowerCase();if(!Al.has(n))return null;let c=new RegExp(`<\\/?${n}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=S(e,(E,A)=>(c.lastIndex=A,c.exec(E)?.index===A?c.lastIndex:-1));if(n==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let a=0,y=!1;for(let E of l){if(a+=E.token.startsWith("</")?-1:1,a<0)return null;if(a===0){if(e.slice(E.end).trim())return null;y=!0;break}}if(!y)return null;let v=i[0].length;return e.slice(0,v)+t+e.slice(v)}function wo(e,t){if(!e)return!1;return[...t.additionalComponentsDirs??[],...t.fallbackComponentsDir?[t.fallbackComponentsDir]:[]].some((n)=>{let c=ce.relative(ce.resolve(n),ce.resolve(e));return!c.startsWith("..")&&!ce.isAbsolute(c)})}async function Er(e,t,i,n,c){let l=e.endsWith(".stx")?e.slice(0,-4):e,a=(re)=>re.split("-").map((me)=>me.charAt(0).toUpperCase()+me.slice(1)).join(""),y=i.__importedComponents;if(y){for(let re of[l,l.toLowerCase(),a(l),V(l)])if(y.has(re))return!0}let v=[...new Set([`${l}.stx`,`${a(l)}.stx`,`${V(l)}.stx`])],E=typeof c.root==="string"?ce.resolve(c.root):void 0,A=E??ce.dirname(n),M=[],B=(re)=>{if(re&&!M.includes(re))M.push(re)},D=i.__originalFilePath;if(D)B(ce.join(ce.dirname(D),"components"));if(wo(t,c))B(c._rootComponentsDir);B(t),B(c._rootComponentsDir),B(ce.join(ce.dirname(n),"components")),B(c.componentsDir);for(let re of c.additionalComponentsDirs??[])B(re);let I=c._targetComponentFallbackNames?.some((re)=>re.toLowerCase()===l.toLowerCase());if(!I)for(let re of c._targetComponentDirs??[])B(re);if(E)B(ce.resolve(E,"resources/views/components")),B(ce.resolve(E,"resources/components")),B(ce.resolve(E,"src/components")),B(ce.resolve(E,"components"));for(let re of c._layerComponentDirs??[])B(re);let j=c._pluginComponentDirs;if(Array.isArray(j))for(let re of j)B(typeof re==="string"?re:null);if(B(c.fallbackComponentsDir),I)for(let re of c._targetComponentDirs??[])B(re);let Q=c._nativePrimitivesFallback;if(Q&&!Q.except.some((re)=>re.toLowerCase()===l.toLowerCase()))B(Q.dir);if(l.startsWith("./")||l.startsWith("../"))return s(ce.resolve(ce.dirname(n),`${l}.stx`));let X=po(ce.resolve(import.meta.dir,"components")),z=M.map((re)=>ce.isAbsolute(re)?re:ce.resolve(A,re)),L=`${v.join("\x00")}\x00\x00${z.join("\x00")}`,ee=Ps.get(L);if(ee!==void 0)return ee;let te=!1;e:for(let re of z){if(po(re)===X)continue;for(let me of v)if(await s(ce.join(re,me))){te=!0;break e}}return Ps.set(L,te),te}function po(e){let t=Zs.get(e);if(t!==void 0)return t;let i=e;try{i=Zn.realpathSync(e)}catch{}return Zs.set(e,i),i}function fg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Xc(e){if(!e)return!1;let t=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(t)}function Tl(e,t,i){if(!e.includes("{{")&&!e.includes("{!!"))return e;let n=(c,l)=>{let a;try{a=T(c,t)}catch{return l}if(a===void 0||a===null)return"";let y=String(a);if(/<\/style/i.test(y))return console.warn(`[stx] a <style> expression in ${i??"<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,(c,l)=>n(l,c)).replace(/\{\{([\s\S]*?)\}\}/g,(c,l)=>n(l,c))}var go=new Set;function mo(e,t,i,n){let c=`${e}\x00${t}\x00${n??""}`;if(!process.env.STX_DEBUG&&go.has(c))return;go.add(c);let l=t?` used in ${t}`:"",a=n?` Cause: ${n}.`:"",y=i.length>0?`
286
286
  searched:
287
287
  ${i.map((v)=>` - ${v}`).join(`
288
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${a}${y}`)}function ho(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Il=new Set(["for","if","show","key","ref","class","className","style"]),xo=new Set,So="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Gc=new RegExp(`\\b(?:${So})\\s*(?:<[^>]*>)?\\s*\\(`);function yi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${So})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let c;while((c=i.exec(n))!==null)t.add(c[1]);i.lastIndex=0}return[...t]}async function Fe(e,t,i,n,c,l,a,y=new Set,v,E=rt(c),A,M=e){let{extractVariables:B}=await o("stx/variable-extractor",()=>import("./chunk-cx2bwpfj.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let I=new Set(D);I.add(e);let j=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let Q=j&&j!=="load"&&fg(j)?j:"";try{let X=(se)=>se.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),z=M.endsWith(".stx")?M.slice(0,-4):M,L=null,ee=c.__importedComponents;if(ee){let se=[z,z.toLowerCase(),X(z),V(z)];for(let ae of se)if(ee.has(ae)){L=ee.get(ae);break}}let te=[];if(!L){let se=[`${z}.stx`,`${X(z)}.stx`,`${V(z)}.stx`],ae=[...new Set(se)],we=c.__originalFilePath,be=[];if(be.push(...a._layerComponentDirs??[]),we){let ye=ce.join(ce.dirname(we),"components");be.push(ye)}let Ue=a._rootComponentsDir;if(typeof Ue==="string"&&wo(n,a)&&!be.includes(Ue))be.push(Ue);if(n&&!be.includes(n))be.push(n);if(typeof Ue==="string"&&!be.includes(Ue))be.push(Ue);let Ae=ce.join(ce.dirname(l),"components");if(!be.includes(Ae))be.push(Ae);if(a.componentsDir&&a.componentsDir!==n&&!be.includes(a.componentsDir))be.push(a.componentsDir);for(let ye of a.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ct=a._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(z),lt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),es=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),ts=!lt.includes("valuechange")&&(yt||lt.includes("change")&&!es),gt=a._nativeHostAttrs&&/^textinput$/i.test(z),_t=lt.includes("update:value")&&!lt.includes("input"),Ht=a._nativeHostAttrs&&/^video$/i.test(z),ns=a._nativeHostAttrs&&/^image$/i.test(z),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),_n=Ht&&wt&&!un&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),mt=(ye)=>Object.hasOwn(t,ye)||Boolean(A?.reactiveProps?.includes(ye)),Sn=a._nativeHostAttrs&&/^button$/i.test(z)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!i.trim()),Zt=a._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&(!ct||ts)&&(!gt||_t)&&(!Ht||_n)&&(!ns||ln)&&!Sn;for(let ye of Zt?[]:a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof a.root==="string"?ce.resolve(a.root):void 0,jo=St??ce.dirname(l),$t=[];if(St)$t.push(ce.resolve(St,"resources/views/components")),$t.push(ce.resolve(St,"resources/components")),$t.push(ce.resolve(St,"src/components")),$t.push(ce.resolve(St,"components"));$t.push(ce.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let sr=a._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(a.fallbackComponentsDir&&!be.includes(a.fallbackComponentsDir))be.push(a.fallbackComponentsDir);if(Zt){for(let ye of a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let $n=a._nativePrimitivesFallback;if($n&&!$n.except.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&!be.includes($n.dir))be.push($n.dir);let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ce.isAbsolute(ye)?ye:ce.resolve(jo,ye)}))];be.length=0,be.push(...rr);let ss=`${z}\x00${l}\x00${rr.join("\x00")}`,rs=Vn.get(ss);if(rs)if(await s(rs))L=rs;else Vn.delete(ss);if(!L&&(z.startsWith("./")||z.startsWith("../")))L=ce.resolve(ce.dirname(l),`${z}.stx`),te.push(L);else if(!L)for(let ye of be){if(!ye)continue;for(let En of ae){let kn=ce.join(ye,En);if(te.push(kn),await s(kn)){L=kn;break}}if(L)break;if(!L)try{let En=await import("fs");if(!En.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let No=8,is=[{path:ye,depth:0}];while(is.length>0&&!L){let Rn=is.pop();if(Rn.depth>=No)continue;let ir;try{ir=En.readdirSync(Rn.path,{withFileTypes:!0})}catch{continue}for(let Cn of ir){if(!Cn.isDirectory())continue;if(Cn.name==="node_modules"||Cn.name.startsWith("."))continue;let or=ce.join(Rn.path,Cn.name);for(let Lo of ae){let os=ce.join(or,Lo);if(te.push(os),await s(os)){L=os;break}}if(L)break;is.push({path:or,depth:Rn.depth+1})}}}catch{}if(L)break}if(L)Vn.set(ss,L)}if(!L||!await s(L))return mo(e,l,te),ho(e);v.add(L);let re;if(tn.has(L)&&Ts.get(L)===lo(L))re=tn.get(L);else try{let se=lo(L);re=await Bun.file(L).text(),tn.set(L,re),Ts.set(L,se)}catch(se){let ae=se instanceof Error?se.message:String(se);return mo(e,l,[L],ae),ho(e)}if(A)for(let se of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ae=se.toLowerCase();if(ae.startsWith("aria-")||ae.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(re))A.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(re))A.consumedProps?.add(se)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(re))for(let se of A.reactiveProps){if(Il.has(se)||A.consumedProps?.has(se))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(re))continue;let ae=`${L}\x00${se}`;if(xo.has(ae))continue;xo.add(ae),console.warn(`[stx] ${ce.basename(L)} reads \`${se}\` with defineProps(), which is not live, but ${ce.basename(l)} binds it (:${se}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${se}').`)}let me=new Set(["__originalFilePath","__importedComponents",Pn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[se,ae]of Object.entries(c))if(!se.startsWith("__")||me.has(se))he[se]=ae;let le=E.length>0?{[Bn]:[...E]}:{},ke=i;if(i.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-3affwe7d.js"));ke=await se(i,c,l,a,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ke)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-s1w9nxws.js")),ae={...c,__processedComponents:D,...le};ke=await se(ke,ae,l,a,v);let we=ae.__stx_preserved_client_expressions;if(Array.isArray(we)&&we.length>0)c.__stx_preserved_client_expressions=[...new Set([...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...we])]}let Re=[];if(Xc(ke)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-cxf2pdjk.js")),ae=c.__stx_signals_gate===void 0?{...c,__stx_signals_gate:!0,...le}:E.length>0?{...c,...le}:c;ke=se(ke,ae,l);for(let we of ke.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(we[1].trim())}let He=G(ke),Xe=[],Ze=He.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,ae)=>{let we=He.scripts[Number(ae)]||"",be=we.match(/^<script\b([^>]*)>/i)?.[1]||"",Ue=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ae=!Ue||["module","text/javascript","application/javascript"].includes(Ue),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Ae&&!ct)return Xe.push(we),"";return we}),{extractSlotContent:Kn}=await o("stx/slots",()=>import("./chunk-k11bkgx6.js")),ft=Kn(Ze),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[se,ae]of ft.namedSlots)pt[se]=ae.content;let dt=c.__stx_scope_seq??={n:0,key:Vs(String(c.__filename??l))},Ct=_o(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,We={...he,$uid:it,$native:a._nativeHostAttrs===!0,...t,props:t,slot:Ze,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:Se(re)||Xc(i),__stx_preserved_client_expressions:[...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...Re]};Cl(re,We);let Tt=re,sn=de(Tt);if(sn)Tt=sn.content.trim();let Xn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Xn)];for(let[,se,ae]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(ae,L,a.strict);let Je=[],Lt=null,Jn=Dt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,et=null,Bt=null,rn=0,Wt=null;if(wl(a),Jn&&Ks>0){let se=Sl({props:t,slot:ke,slotContext:i.trim()?$l(he):void 0,buildMode:a.buildMode??"",skipEventDirectives:a.skipEventDirectives===!0,native:a._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:a._layerGraph?.layers.map((ae)=>ae.configFile),uid:it});if(se!==null){bt=`${L}\x00${x(re)}\x00${se}`;let ae=Hn.get(bt);if(ae){for(let we of ae.dependencies)v.add(we);if(Kr(c,ae.clientFactories),dt.n+=ae.uidsConsumed,ae.preservedClientExpressions.length>0){let we=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let be of ae.preservedClientExpressions)we.add(be);c.__stx_preserved_client_expressions=[...we]}return ae.output}et=new Set(v),Bt=Zr(c),rn=dt.n,Wt=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let se of Dt){let ae=se[1]||"",we=se[2]||"",be=ae.includes("server");if(je(ae)&&we.trim())we=Be(we);if(be&&we){for(let Ae of Me(we))zt.add(Ae);try{await B(we,We,L,{onFailure:(Ae)=>{if(Ae.kind!=="unknown")Lt=Ae.kind}})}catch(Ae){}}if(!be){let Ae=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ae.includes("{{")&&Ae.includes("}}"),lt=Ae.includes("{!!")&&Ae.includes("!!}");if(ct||lt)Ae=wi(Ae,We,L);let yt=ae.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${yt}>${Ae}</script>`)}}let Ge=G(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ge?Ge[1]:"",Gn=Ge?Ge[2]:"",tt="",ne=Ft&&/\bscoped\b/i.test(Ft);if(Ge)tt=`<style${Ft}>${Tl(Gn,We,L)}</style>`;let ie=Tt;if(ie=ie.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ge)ie=ie.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ae=[];if(ie=ie.replace(se,(we,be)=>{let Ue=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ue)ae.push(`<style${Ue[1]}>${Ue[2]}</style>`);return""}),ie=ie.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ae.length>0)tt=`${tt}${ae.join(`
289
- `)}`}if(i&&ie.includes("{{ text || slot }}"))ie=ie.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-k11bkgx6.js")),{defaultSlot:$e,namedSlots:Ce}=ft,qe=c.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ze),nt=a._nativeHostAttrs===!0&&Je.length>0||qe&&Je.length>0||Je.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)),Yn=(se)=>nt?Ni(se,it):se,Qn=new Map([...Ce].map(([se,ae])=>[se,{...ae,content:Yn(ae.content)}]));ie=await ue(ie,Yn($e),Qn,We,nt?it:"");let on=yi(Je),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!zt.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 Vt=E.filter((se)=>!zt.has(se)&&!(se in t));if(Vt.length>0)We[Bn]=Vt;let cn={...a,_rootComponentsDir:a._rootComponentsDir||a.componentsDir,componentsDir:ce.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:a._nativeHostAttrs===!0||nt||Je.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(c.__stxProcessingDepth||0)+1;let{processDirectives:an}=await o("stx/process",()=>import("./chunk-ez0d7fpw.js")),Ye=await an(ie,We,L,cn,v),ot=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let se of Ye.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)c.__stx_preserved_client_expressions=[...ot];let st=it,Ke=Ye;if(nt){let se="";if(Object.keys(t).length>0)try{se=` data-stx-props="${Cs(JSON.stringify(t))}"`}catch{}let ae=Q?` stx-hydrate="${Cs(Q)}"`:"",we=Object.fromEntries(Object.entries(pt).map(([gt,_t])=>[gt,Boolean(_t)])),be=Object.keys(we).length>0?` data-stx-slots="${Cs(JSON.stringify(we))}"`:"",Ue=` data-stx-scope="${st}"${se}${be}${ae}`,Ae=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Ye),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Ye),lt=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Ye),yt=Ae?"span":"div",es=ct&&a._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':lt&&a._nativeHostAttrs?' style="width:100%;height:100%"':Ae||ct?' style="display:contents"':"";Ke=pg(Ye,Ue)??`<${yt}${Ue} data-stx-component-wrapper${es}>${Ye}</${yt}>`;let ts=await Promise.all(Je.map(async(gt)=>{let _t=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return gt;let[,Ht,ns]=_t,ln=ao(gt,We,L);if(ln!==null)return ln;let wt=await Pl(ns,L,a.buildMode==="compile"),un=yn(wt.clientCode,De(We)),{vendorStyleTags:_n}=wt,mt=un?`function(__scopeId) {
288
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${a}${y}`)}function ho(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Il=new Set(["for","if","show","key","ref","class","className","style"]),xo=new Set,So="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",Gc=new RegExp(`\\b(?:${So})\\s*(?:<[^>]*>)?\\s*\\(`);function yi(e){let t=new Set,i=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${So})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let n of e){let c;while((c=i.exec(n))!==null)t.add(c[1]);i.lastIndex=0}return[...t]}async function Fe(e,t,i,n,c,l,a,y=new Set,v,E=rt(c),A,M=e){let{extractVariables:B}=await o("stx/variable-extractor",()=>import("./chunk-acftnzex.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let I=new Set(D);I.add(e);let j=typeof t.client==="string"?t.client.trim():"";if("client"in t)delete t.client;let Q=j&&j!=="load"&&fg(j)?j:"";try{let X=(se)=>se.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),z=M.endsWith(".stx")?M.slice(0,-4):M,L=null,ee=c.__importedComponents;if(ee){let se=[z,z.toLowerCase(),X(z),V(z)];for(let ae of se)if(ee.has(ae)){L=ee.get(ae);break}}let te=[];if(!L){let se=[`${z}.stx`,`${X(z)}.stx`,`${V(z)}.stx`],ae=[...new Set(se)],we=c.__originalFilePath,be=[];if(be.push(...a._layerComponentDirs??[]),we){let ye=ce.join(ce.dirname(we),"components");be.push(ye)}let Ue=a._rootComponentsDir;if(typeof Ue==="string"&&wo(n,a)&&!be.includes(Ue))be.push(Ue);if(n&&!be.includes(n))be.push(n);if(typeof Ue==="string"&&!be.includes(Ue))be.push(Ue);let Ae=ce.join(ce.dirname(l),"components");if(!be.includes(Ae))be.push(Ae);if(a.componentsDir&&a.componentsDir!==n&&!be.includes(a.componentsDir))be.push(a.componentsDir);for(let ye of a.additionalComponentsDirs??[])if(ye&&!be.includes(ye))be.push(ye);let ct=a._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(z),lt=(A?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),yt=Object.hasOwn(t,"checked")||Boolean(A?.reactiveProps?.includes("checked")),es=Object.hasOwn(t,"value")||Boolean(A?.reactiveProps?.includes("value")),ts=!lt.includes("valuechange")&&(yt||lt.includes("change")&&!es),gt=a._nativeHostAttrs&&/^textinput$/i.test(z),_t=lt.includes("update:value")&&!lt.includes("input"),Ht=a._nativeHostAttrs&&/^video$/i.test(z),ns=a._nativeHostAttrs&&/^image$/i.test(z),ln=Ds([...Object.keys(t),...A?.reactiveProps??[]],A?.events,t),wt=Object.hasOwn(t,"src")||Boolean(A?.reactiveProps?.includes("src")),un=Object.hasOwn(t,"source")||Boolean(A?.reactiveProps?.includes("source")),_n=Ht&&wt&&!un&&(A?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),mt=(ye)=>Object.hasOwn(t,ye)||Boolean(A?.reactiveProps?.includes(ye)),Sn=a._nativeHostAttrs&&/^button$/i.test(z)&&(mt("symbol")||mt("iconOnly")||mt("title")&&!mt("label")&&!i.trim()),Zt=a._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&(!ct||ts)&&(!gt||_t)&&(!Ht||_n)&&(!ns||ln)&&!Sn;for(let ye of Zt?[]:a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let St=typeof a.root==="string"?ce.resolve(a.root):void 0,jo=St??ce.dirname(l),$t=[];if(St)$t.push(ce.resolve(St,"resources/views/components")),$t.push(ce.resolve(St,"resources/components")),$t.push(ce.resolve(St,"src/components")),$t.push(ce.resolve(St,"components"));$t.push(ce.resolve(import.meta.dir,"components"));for(let ye of $t)if(!be.includes(ye))be.push(ye);let sr=a._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(a.fallbackComponentsDir&&!be.includes(a.fallbackComponentsDir))be.push(a.fallbackComponentsDir);if(Zt){for(let ye of a._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let $n=a._nativePrimitivesFallback;if($n&&!$n.except.some((ye)=>ye.toLowerCase()===z.toLowerCase())&&!be.includes($n.dir))be.push($n.dir);let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return ce.isAbsolute(ye)?ye:ce.resolve(jo,ye)}))];be.length=0,be.push(...rr);let ss=`${z}\x00${l}\x00${rr.join("\x00")}`,rs=Vn.get(ss);if(rs)if(await s(rs))L=rs;else Vn.delete(ss);if(!L&&(z.startsWith("./")||z.startsWith("../")))L=ce.resolve(ce.dirname(l),`${z}.stx`),te.push(L);else if(!L)for(let ye of be){if(!ye)continue;for(let En of ae){let kn=ce.join(ye,En);if(te.push(kn),await s(kn)){L=kn;break}}if(L)break;if(!L)try{let En=await import("fs");if(!En.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let No=8,is=[{path:ye,depth:0}];while(is.length>0&&!L){let Rn=is.pop();if(Rn.depth>=No)continue;let ir;try{ir=En.readdirSync(Rn.path,{withFileTypes:!0})}catch{continue}for(let Cn of ir){if(!Cn.isDirectory())continue;if(Cn.name==="node_modules"||Cn.name.startsWith("."))continue;let or=ce.join(Rn.path,Cn.name);for(let Lo of ae){let os=ce.join(or,Lo);if(te.push(os),await s(os)){L=os;break}}if(L)break;is.push({path:or,depth:Rn.depth+1})}}}catch{}if(L)break}if(L)Vn.set(ss,L)}if(!L||!await s(L))return mo(e,l,te),ho(e);v.add(L);let re;if(tn.has(L)&&Ts.get(L)===lo(L))re=tn.get(L);else try{let se=lo(L);re=await Bun.file(L).text(),tn.set(L,re),Ts.set(L,se)}catch(se){let ae=se instanceof Error?se.message:String(se);return mo(e,l,[L],ae),ho(e)}if(A)for(let se of new Set([...Object.keys(t),...A.reactiveProps??[]])){let ae=se.toLowerCase();if(ae.startsWith("aria-")||ae.startsWith("data-"))continue;let we=se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${we}\\b`).test(re))A.declaredProps.add(se);if(new RegExp(`\\$props\\s*(?:\\.\\s*${we}\\b|\\[\\s*['"]${we}['"]\\s*\\])`).test(re)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${we}['"]`).test(re))A.consumedProps?.add(se)}if(A?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(re))for(let se of A.reactiveProps){if(Il.has(se)||A.consumedProps?.has(se))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${se.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(re))continue;let ae=`${L}\x00${se}`;if(xo.has(ae))continue;xo.add(ae),console.warn(`[stx] ${ce.basename(L)} reads \`${se}\` with defineProps(), which is not live, but ${ce.basename(l)} binds it (:${se}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${se}').`)}let me=new Set(["__originalFilePath","__importedComponents",Pn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),he={};for(let[se,ae]of Object.entries(c))if(!se.startsWith("__")||me.has(se))he[se]=ae;let le=E.length>0?{[Bn]:[...E]}:{},ke=i;if(i.includes("@include")){let{processIncludes:se}=await o("stx/includes",()=>import("./chunk-vq65ywpx.js"));ke=await se(i,c,l,a,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ke)){let{processComponents:se}=await o("stx/component-renderer",()=>import("./chunk-crfj882k.js")),ae={...c,__processedComponents:D,...le};ke=await se(ke,ae,l,a,v);let we=ae.__stx_preserved_client_expressions;if(Array.isArray(we)&&we.length>0)c.__stx_preserved_client_expressions=[...new Set([...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...we])]}let Re=[];if(Xc(ke)){let{processExpressions:se}=await o("stx/expressions",()=>import("./chunk-2sqkzpt5.js")),ae=c.__stx_signals_gate===void 0?{...c,__stx_signals_gate:!0,...le}:E.length>0?{...c,...le}:c;ke=se(ke,ae,l);for(let we of ke.matchAll(/\{\{([\s\S]*?)\}\}/g))Re.push(we[1].trim())}let He=G(ke),Xe=[],Ze=He.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(se,ae)=>{let we=He.scripts[Number(ae)]||"",be=we.match(/^<script\b([^>]*)>/i)?.[1]||"",Ue=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Ae=!Ue||["module","text/javascript","application/javascript"].includes(Ue),ct=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Ae&&!ct)return Xe.push(we),"";return we}),{extractSlotContent:Kn}=await o("stx/slots",()=>import("./chunk-rz0zww80.js")),ft=Kn(Ze),pt={};if(ft.defaultSlot?.trim())pt.default=ft.defaultSlot;for(let[se,ae]of ft.namedSlots)pt[se]=ae.content;let dt=c.__stx_scope_seq??={n:0,key:Vs(String(c.__filename??l))},Ct=_o(e,process.cwd()),it=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++dt.n}_${dt.key}`,We={...he,$uid:it,$native:a._nativeHostAttrs===!0,...t,props:t,slot:Ze,$slots:pt,__processedComponents:I,__sections:{},__stx_signals_gate:Se(re)||Xc(i),__stx_preserved_client_expressions:[...Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[],...Re]};Cl(re,We);let Tt=re,sn=de(Tt);if(sn)Tt=sn.content.trim();let Xn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Dt=[...re.matchAll(Xn)];for(let[,se,ae]of Dt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(se))Oe(ae,L,a.strict);let Je=[],Lt=null,Jn=Dt.some((se)=>/\bserver\b/.test(se[1]||"")&&/\bcache\b/.test(se[1]||"")),bt=null,et=null,Bt=null,rn=0,Wt=null;if(wl(a),Jn&&Ks>0){let se=Sl({props:t,slot:ke,slotContext:i.trim()?$l(he):void 0,buildMode:a.buildMode??"",skipEventDirectives:a.skipEventDirectives===!0,native:a._nativeHostAttrs===!0,clientLoopNames:[...E].sort(),layers:a._layerGraph?.layers.map((ae)=>ae.configFile),uid:it});if(se!==null){bt=`${L}\x00${x(re)}\x00${se}`;let ae=Hn.get(bt);if(ae){for(let we of ae.dependencies)v.add(we);if(Kr(c,ae.clientFactories),dt.n+=ae.uidsConsumed,ae.preservedClientExpressions.length>0){let we=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let be of ae.preservedClientExpressions)we.add(be);c.__stx_preserved_client_expressions=[...we]}return ae.output}et=new Set(v),Bt=Zr(c),rn=dt.n,Wt=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[])}}let zt=new Set;for(let se of Dt){let ae=se[1]||"",we=se[2]||"",be=ae.includes("server");if(je(ae)&&we.trim())we=Be(we);if(be&&we){for(let Ae of Me(we))zt.add(Ae);try{await B(we,We,L,{onFailure:(Ae)=>{if(Ae.kind!=="unknown")Lt=Ae.kind}})}catch(Ae){}}if(!be){let Ae=we.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),ct=Ae.includes("{{")&&Ae.includes("}}"),lt=Ae.includes("{!!")&&Ae.includes("!!}");if(ct||lt)Ae=wi(Ae,We,L);let yt=ae.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Je.push(`<script${yt}>${Ae}</script>`)}}let Ge=G(re).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ge?Ge[1]:"",Gn=Ge?Ge[2]:"",tt="",ne=Ft&&/\bscoped\b/i.test(Ft);if(Ge)tt=`<style${Ft}>${Tl(Gn,We,L)}</style>`;let ie=Tt;if(ie=ie.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ge)ie=ie.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let se=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ae=[];if(ie=ie.replace(se,(we,be)=>{let Ue=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ue)ae.push(`<style${Ue[1]}>${Ue[2]}</style>`);return""}),ie=ie.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ae.length>0)tt=`${tt}${ae.join(`
289
+ `)}`}if(i&&ie.includes("{{ text || slot }}"))ie=ie.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>i);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-rz0zww80.js")),{defaultSlot:$e,namedSlots:Ce}=ft,qe=c.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Ze),nt=a._nativeHostAttrs===!0&&Je.length>0||qe&&Je.length>0||Je.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)),Yn=(se)=>nt?Ni(se,it):se,Qn=new Map([...Ce].map(([se,ae])=>[se,{...ae,content:Yn(ae.content)}]));ie=await ue(ie,Yn($e),Qn,We,nt?it:"");let on=yi(Je),Ut=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((se)=>!zt.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 Vt=E.filter((se)=>!zt.has(se)&&!(se in t));if(Vt.length>0)We[Bn]=Vt;let cn={...a,_rootComponentsDir:a._rootComponentsDir||a.componentsDir,componentsDir:ce.dirname(L),skipSignalsRuntime:!0,skipEventDirectives:a._nativeHostAttrs===!0||nt||Je.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(c.__stxProcessingDepth||0)+1;let{processDirectives:an}=await o("stx/process",()=>import("./chunk-ef2367nq.js")),Ye=await an(ie,We,L,cn,v),ot=new Set(Array.isArray(c.__stx_preserved_client_expressions)?c.__stx_preserved_client_expressions:[]);for(let se of Ye.matchAll(/\{\{([\s\S]*?)\}\}/g))ot.add(se[1].trim());if(ot.size>0)c.__stx_preserved_client_expressions=[...ot];let st=it,Ke=Ye;if(nt){let se="";if(Object.keys(t).length>0)try{se=` data-stx-props="${Cs(JSON.stringify(t))}"`}catch{}let ae=Q?` stx-hydrate="${Cs(Q)}"`:"",we=Object.fromEntries(Object.entries(pt).map(([gt,_t])=>[gt,Boolean(_t)])),be=Object.keys(we).length>0?` data-stx-slots="${Cs(JSON.stringify(we))}"`:"",Ue=` data-stx-scope="${st}"${se}${be}${ae}`,Ae=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Ye),ct=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Ye),lt=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Ye),yt=Ae?"span":"div",es=ct&&a._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':lt&&a._nativeHostAttrs?' style="width:100%;height:100%"':Ae||ct?' style="display:contents"':"";Ke=pg(Ye,Ue)??`<${yt}${Ue} data-stx-component-wrapper${es}>${Ye}</${yt}>`;let ts=await Promise.all(Je.map(async(gt)=>{let _t=gt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!_t)return gt;let[,Ht,ns]=_t,ln=ao(gt,We,L);if(ln!==null)return ln;let wt=await Pl(ns,L,a.buildMode==="compile"),un=yn(wt.clientCode,De(We)),{vendorStyleTags:_n}=wt,mt=un?`function(__scopeId) {
290
290
  ${un}
291
291
  return (${wt.factoryBody})(__scopeId);
292
292
  }`:wt.factoryBody,Sn=Q?null:hs(c,mt),Zt=Sn?`window.__stxComponentFactories[${JSON.stringify(Sn)}](${JSON.stringify(st)});`:`(${mt})(${JSON.stringify(st)});`;if(Q)return`${_n}<script type="stx/island" data-stx-island="${st}" data-stx-scoped data-stx-owner="${st}"${Ht}>${Zt}</script>`;return`${_n}<script data-stx-scoped data-stx-run="always" data-stx-owner="${st}"${Ht}>${Zt}</script>`}));if(Ke=Ke+`
@@ -312,7 +312,7 @@ ${Ee.yellow}${Ee.bold}Message:${Ee.reset} ${t}
312
312
  `,y)A+=`
313
313
  ${Ee.blue}${Ee.bold}Context:${Ee.reset}
314
314
  ${Ee.dim}${y}${Ee.reset}
315
- `;return A}function fe(){tn.clear(),Ts.clear(),Vn.clear(),Ps.clear(),Zs.clear(),Hn.clear()}function Xh(){return{size:tn.size,maxSize:500}}var As=b(128);async function Pl(e,t,i){let n=x(e,t,i),c=As.get(n);if(c){if(Ls(c.deps))return c;As.delete(n)}let l=mi(e,{filePath:t,projectRoot:process.cwd()}),a=l.code,y=hi(l.styles);a=Nt(a).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-e3qkbq8g.js")),A=[],M=!1;if(v(a)){let z=a;a=await E(z,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),M=a===z}let{stripStxRuntimeImports:B}=await o("stx/signal-processing",()=>import("./chunk-mt7d37jh.js"));a=B(a);let D=P(a),I=El(D),j=new Set(H(D,!0).split(",").map((z)=>z.trim())),Q=`function(__scopeId) {
315
+ `;return A}function fe(){tn.clear(),Ts.clear(),Vn.clear(),Ps.clear(),Zs.clear(),Hn.clear()}function Xh(){return{size:tn.size,maxSize:500}}var As=b(128);async function Pl(e,t,i){let n=x(e,t,i),c=As.get(n);if(c){if(Ls(c.deps))return c;As.delete(n)}let l=mi(e,{filePath:t,projectRoot:process.cwd()}),a=l.code,y=hi(l.styles);a=Nt(a).code;let{hasUserImports:v,bundleClientScript:E}=await o("stx/client-script-bundler",()=>import("./chunk-46npem9j.js")),A=[],M=!1;if(v(a)){let z=a;a=await E(z,t,{projectRoot:process.cwd(),minify:i,collectInputs:A}),M=a===z}let{stripStxRuntimeImports:B}=await o("stx/signal-processing",()=>import("./chunk-b83vt90z.js"));a=B(a);let D=P(a),I=El(D),j=new Set(H(D,!0).split(",").map((z)=>z.trim())),Q=`function(__scopeId) {
316
316
  ${at("const",[...ll,...I],D)}
317
317
  const __scope = window.stx._scopes = window.stx._scopes || {};
318
318
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{B,Bf,Go,a,I,Fh,zh}from"./chunk-20qn18ry.js";import"./chunk-1jwqjdk7.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-m76jbcey.js";import"./chunk-kfgbk0x9.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{I as config,B as defaultConfig,Fh as defineStxConfig,Go as discoverConfig,a as loadStxConfig,Bf as resolveStxDirectories,zh as validateConfig};
2
+ import{B,Bf,Go,a,I,Fh,zh}from"./chunk-je1nvds2.js";import"./chunk-fwwf1t9k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{I as config,B as defaultConfig,Fh as defineStxConfig,Go as discoverConfig,a as loadStxConfig,Bf as resolveStxDirectories,zh as validateConfig};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Kg}from"./chunk-xbcktxjc.js";import"./chunk-r13bcmsh.js";import"./chunk-awqq6rxz.js";import"./chunk-et7jca3r.js";import"./chunk-6pghczk4.js";import"./chunk-p4yhhx16.js";import"./chunk-je1nvds2.js";import"./chunk-fwwf1t9k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Kg as startProductionServer};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{_}from"./chunk-m76jbcey.js";import{le}from"./chunk-kvz01wzc.js";function g(e,t){let r={};for(let n of e)r[n]=le(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=le(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function ya(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=le(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var ou=ya;class Fn{rules=[];defaultValue="";addRule(e){let t=new Fn;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Fn;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Fn;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var Pm=new Fn;function iu(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>_(c,{...t,message:l},r)).join(`
2
+ import{_}from"./chunk-ygrc6aej.js";import{le}from"./chunk-kvz01wzc.js";function g(e,t){let r={};for(let n of e)r[n]=le(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=le(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function ya(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=le(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var ou=ya;class Fn{rules=[];defaultValue="";addRule(e){let t=new Fn;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new Fn;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new Fn;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var Pm=new Fn;function iu(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>_(c,{...t,message:l},r)).join(`
3
3
  `)}catch{return""}})}function au(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>_(c,{...t,message:l},r)).join(`
4
4
  `)}catch{return""}})}function cu(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function Im(e,t,r){let n=e;return n=iu(n,t,r),n=au(n,t,r),n=cu(n,t,r),n}export{ya,ou,Fn,Pm,iu,au,cu,Im};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Wg}from"./chunk-154n9bj7.js";import"./chunk-6sh0qbqe.js";import"./chunk-hea7mctr.js";import"./chunk-4g2vnemw.js";import"./chunk-c84pxd2k.js";import"./chunk-atbqt79s.js";import"./chunk-6pghczk4.js";import"./chunk-6yjyymnd.js";import"./chunk-y7sf7aj0.js";import"./chunk-021eq782.js";import"./chunk-p4yhhx16.js";import"./chunk-1carv1dw.js";import"./chunk-0752padg.js";import"./chunk-je1nvds2.js";import"./chunk-fwwf1t9k.js";import"./chunk-2ws2qe1k.js";import"./chunk-vbc8a8fh.js";import"./chunk-3z0e637x.js";import"./chunk-bmkm1c8s.js";import"./chunk-ygrc6aej.js";import"./chunk-x14jm9hg.js";import"./chunk-m7hfcxt3.js";import"./chunk-gebb12ak.js";import"./chunk-r9e0r6jx.js";import"./chunk-ybjfr7e8.js";export{Wg as startInteractive};