@stacksjs/stx 0.2.708 → 0.2.710

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 (88) hide show
  1. package/dist/{chunk-dedmk383.js → chunk-07t75sa9.js} +1 -1
  2. package/dist/{chunk-9whmbfwx.js → chunk-0fsf124j.js} +1 -1
  3. package/dist/chunk-0v9ddb6n.js +2 -0
  4. package/dist/chunk-2t4z29p8.js +2 -0
  5. package/dist/{chunk-gvs17jd0.js → chunk-34hsn8tn.js} +39 -12
  6. package/dist/{chunk-0myrwz84.js → chunk-3ps07041.js} +42 -10
  7. package/dist/{chunk-xw8wwcr8.js → chunk-4jnmr21x.js} +1 -1
  8. package/dist/{chunk-fj3pct59.js → chunk-5q9epbwk.js} +1 -1
  9. package/dist/{chunk-kxwfrdt3.js → chunk-5zgb01qx.js} +1 -1
  10. package/dist/{chunk-c2b5p621.js → chunk-6r4at2sz.js} +5 -5
  11. package/dist/{chunk-bhpsr1mt.js → chunk-6w1qcqr1.js} +1 -1
  12. package/dist/{chunk-cqnpjdc9.js → chunk-717bek8h.js} +1 -1
  13. package/dist/{chunk-eywx2f4h.js → chunk-7c9nfrhv.js} +1 -1
  14. package/dist/{chunk-hmkg3xy0.js → chunk-8jb55rfm.js} +1 -1
  15. package/dist/{chunk-f9b7847f.js → chunk-8skqad4q.js} +1 -1
  16. package/dist/chunk-8xjp70r6.js +2 -0
  17. package/dist/{chunk-d2xnkt8m.js → chunk-9dsfcxzr.js} +1 -1
  18. package/dist/{chunk-3907sad1.js → chunk-9yn3nsr1.js} +1 -1
  19. package/dist/{chunk-erqsgfdj.js → chunk-a026vsrp.js} +1 -1
  20. package/dist/{chunk-r5k21k3x.js → chunk-b1a1wx8z.js} +4 -4
  21. package/dist/{chunk-ccty08sm.js → chunk-db9tv9kf.js} +3 -3
  22. package/dist/{chunk-zjcmybab.js → chunk-dkrj1qn3.js} +1 -1
  23. package/dist/{chunk-qcw1neka.js → chunk-e2fvr2w6.js} +1 -1
  24. package/dist/chunk-e5xa3xh1.js +2 -0
  25. package/dist/{chunk-19knw8c6.js → chunk-ebjn0t9q.js} +1 -1
  26. package/dist/{chunk-nde9yj3n.js → chunk-ecy52773.js} +1 -1
  27. package/dist/{chunk-0jtrdgyv.js → chunk-ev2asp1e.js} +6 -6
  28. package/dist/{chunk-90kfvtf6.js → chunk-f134xm9v.js} +2 -2
  29. package/dist/{chunk-c71f6mfr.js → chunk-fdzpctxs.js} +1 -1
  30. package/dist/{chunk-v5s6r2b3.js → chunk-ferqef0h.js} +3 -3
  31. package/dist/{chunk-cjx11tgd.js → chunk-fxvxkb55.js} +1 -1
  32. package/dist/{chunk-27catnpa.js → chunk-hek3gvcs.js} +1 -1
  33. package/dist/{chunk-65fcex5r.js → chunk-j184qf8s.js} +1 -1
  34. package/dist/{chunk-hb77kw66.js → chunk-jaq288y2.js} +1 -1
  35. package/dist/{chunk-9xb33nz0.js → chunk-jbvznf9t.js} +1 -1
  36. package/dist/{chunk-86775qk0.js → chunk-jh44a0eh.js} +1 -1
  37. package/dist/{chunk-sz0e6tpq.js → chunk-kdfdgn6c.js} +1 -1
  38. package/dist/{chunk-s1vj8gtz.js → chunk-khqa12tb.js} +2 -2
  39. package/dist/{chunk-3vsnnr1b.js → chunk-nf44whzd.js} +1 -1
  40. package/dist/{chunk-03p4w958.js → chunk-pp1beqrr.js} +1 -1
  41. package/dist/{chunk-4cs5t287.js → chunk-q5aptpc8.js} +1 -1
  42. package/dist/{chunk-3xmt01wr.js → chunk-q986z4qy.js} +2 -2
  43. package/dist/chunk-qq0m0fyn.js +3 -0
  44. package/dist/{chunk-vqratjvb.js → chunk-rr4dndjr.js} +1 -1
  45. package/dist/chunk-rrc9zwyh.js +2 -0
  46. package/dist/{chunk-609pekf5.js → chunk-s04ban9p.js} +1 -1
  47. package/dist/{chunk-w8yv9hnf.js → chunk-s6mzv28a.js} +1 -1
  48. package/dist/{chunk-7kaadsd1.js → chunk-t2kr9438.js} +2 -2
  49. package/dist/chunk-t7b8q0fg.js +2 -0
  50. package/dist/{chunk-e5vsw0fw.js → chunk-tbf23kt0.js} +1 -1
  51. package/dist/{chunk-f6ybdjt0.js → chunk-tvdaa2s4.js} +4 -4
  52. package/dist/{chunk-a32xsr61.js → chunk-vb0vf4f4.js} +1 -1
  53. package/dist/{chunk-2srb5f7t.js → chunk-vdbmvn1m.js} +1 -1
  54. package/dist/{chunk-rswg7xsg.js → chunk-vq5z2b8n.js} +2 -2
  55. package/dist/{chunk-e8brwwp1.js → chunk-vvdew463.js} +5 -5
  56. package/dist/{chunk-8c4zbq1k.js → chunk-wcj2rb7b.js} +1 -1
  57. package/dist/{chunk-zaj3gzet.js → chunk-wj1xg3z5.js} +1 -1
  58. package/dist/{chunk-avr65xra.js → chunk-x5h95nnq.js} +1 -1
  59. package/dist/chunk-xrx6ay3j.js +2 -0
  60. package/dist/{chunk-1kwsnqr1.js → chunk-xwdhvmnt.js} +1 -1
  61. package/dist/{chunk-9wgvn5rn.js → chunk-y0t70c3t.js} +1 -1
  62. package/dist/chunk-yaanjj3t.js +2 -0
  63. package/dist/chunk-yaxq5qq6.js +2 -0
  64. package/dist/chunk-z84yfx2x.js +2 -0
  65. package/dist/chunk-z9khppp8.js +2 -0
  66. package/dist/chunk-zc5e9bnh.js +2 -0
  67. package/dist/{chunk-93y8zwcz.js → chunk-zgvbsrq1.js} +2 -2
  68. package/dist/cli.js +8 -8
  69. package/dist/client/signals-authoring-runtime.js +17 -6
  70. package/dist/client/signals-binding-utils-runtime.js +17 -1
  71. package/dist/craft-entry.js +1 -1
  72. package/dist/craft.js +1 -1
  73. package/dist/pwa.js +1 -1
  74. package/dist/ssg.js +2 -2
  75. package/package.json +5 -5
  76. package/dist/chunk-2k6d8s6h.js +0 -2
  77. package/dist/chunk-3nsdb1fg.js +0 -2
  78. package/dist/chunk-3qnke2jb.js +0 -2
  79. package/dist/chunk-3sg2ardr.js +0 -2
  80. package/dist/chunk-48936paw.js +0 -2
  81. package/dist/chunk-75n3vbtk.js +0 -2
  82. package/dist/chunk-8z469777.js +0 -2
  83. package/dist/chunk-9nvywf05.js +0 -3
  84. package/dist/chunk-axwwhdtt.js +0 -2
  85. package/dist/chunk-h9n71rdn.js +0 -2
  86. package/dist/chunk-j7gg6xrc.js +0 -2
  87. package/dist/chunk-weaxr0qe.js +0 -2
  88. package/dist/chunk-ztckg7a3.js +0 -2
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- import{xn}from"./chunk-xyyt8v1r.js";import{U,C,Pt,It,vr,m,Mc,si,H,E}from"./chunk-0jtrdgyv.js";import{Jt}from"./chunk-609pekf5.js";import{n}from"./chunk-9nvywf05.js";import{q}from"./chunk-ncs2j5kc.js";var G=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function W(t){let r=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,s;while((s=e.exec(t))!==null)r.push({start:s.index,end:s.index+s[0].length});return r}function I(t,r){return r.some((e)=>t>=e.start&&t<e.end)}function X(t){let r=(t||"").trim();if(!r)return null;if(/[\s>+~,:]/.test(r))return null;let e={},s=r,a=s.match(/^[a-z][\w-]*/i);if(a)e.tag=a[0].toLowerCase(),s=s.slice(a[0].length);while(s.length>0){let i=s.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(i){if(e.attr=i[1],i[3]!==void 0&&i[3]!=="")e.attrValue=i[3];s=s.slice(i[0].length);continue}let o=s.match(/^#([\w-]+)/);if(o){e.id=o[1],s=s.slice(o[0].length);continue}let c=s.match(/^\.([\w-]+)/);if(c){e.className=c[1],s=s.slice(c[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function J(t,r){if(r.attr){if(!(r.attrValue===void 0?new RegExp(`\\b${r.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${r.attr}\\s*=\\s*(["'])\\s*${r.attrValue}\\s*\\1`,"i")).test(t))return!1}if(r.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${r.id}\\s*\\1`,"i").test(t))return!1}if(r.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(r.className))return!1}return!0}function N(t,r="main"){let e=X(r);if(!e)return null;let s=/<([a-z][\w-]*)\b([^>]*)>/gi,a=W(t),i;while((i=s.exec(t))!==null){if(I(i.index,a))continue;let o=i[1].toLowerCase(),c=i[2]||"";if(c.trimEnd().endsWith("/")||G.has(o))continue;if(e.tag&&e.tag!==o)continue;if(!J(c,e))continue;let l=i[0],u=i.index+l.length,f=new RegExp(`<(/?)${o}\\b([^>]*)>`,"gi");f.lastIndex=u;let p=1,h;while((h=f.exec(t))!==null){if(I(h.index,a))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(p+=S?-1:1,p===0)return{openTag:l,openIndex:i.index,start:u,end:h.index,tagName:o}}return null}return null}var dt="private, no-store";function Tn(t){return t.replace(/&#(\d+);/g,(r,e)=>D(Number(e),r)).replace(/&#x([0-9a-f]+);/gi,(r,e)=>D(Number.parseInt(e,16),r)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function D(t,r){if(!Number.isInteger(t)||t<0||t>1114111)return r;try{return String.fromCodePoint(t)}catch{return r}}function _e(t){return t.headers.get("X-STX-Router")==="true"}function K(t,r){if(!t)return r;return t.split(",").some((s)=>s.trim().toLowerCase()===r.toLowerCase())?t:`${t}, ${r}`}function M(t){return{Vary:K(t,"X-STX-Router")}}function k(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $n(t){let r=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy,s=C(r,(i,o)=>(e.lastIndex=o,e.exec(i)?e.lastIndex:-1)),a=[];for(let{token:i}of s){if(/^<title\b/i.test(i)){a.push(`<title>${k(i.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let o=Object.create(null),c=i.replace(/^<\w+\b|>$/g,"");for(let l of c.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let u=l[1].toLowerCase();if(!(u in o))o[u]=l[2]??l[3]??l[4]??""}if(/^<meta\b/i.test(i)){let l=o.property?"property":"name",u=Tn(o[l]??"").toLowerCase();if(u==="description"||/^(?:og|twitter):[\w:]+$/.test(u))a.push(`<meta ${l}="${n(u)}" content="${k(o.content??"")}">`)}else{let l=Tn(o.rel??"").toLowerCase();if(l==="canonical"||l==="alternate"&&o.hreflang)a.push(`<link rel="${l}" href="${k(o.href??"")}"${l==="alternate"?` hreflang="${k(o.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${a.join("")}</template>
3
- `}import P from"path";var Y="stx-page-head:",Z=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Q(){let t=q()?"dev":"prod",r=v[t];if(r!==null)return r;try{let e=import.meta.require("./chunk-avr65xra.js"),s=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${s()}</script>`}catch{v[t]=""}return v[t]}async function qi(t,r){if(r===!1)return null;if(r&&typeof r==="string"){let s=P.resolve(t,r);if(await Bun.file(s).exists())return s;return null}let e=P.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function eo(t,r){try{let e=await Bun.file(t).text(),s=e,a=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(a)s=a[1].trim();let i=Jt(e),o=[...i.client.map((g)=>g.fullTag),...i.signals.map((g)=>g.fullTag)],c=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=l.exec(e))!==null)c.push(u[0]);let f=s;for(let g of i.server)f=f.replace(g.fullTag,"");for(let g of i.client)f=f.replace(g.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let p="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,p).replace(/<slot\s*>\s*<\/slot>/gi,p),!f.includes(p))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:b,loadStxConfig:y}=await import("./chunk-weaxr0qe.js"),A=await y(),d={__filename:t,__dirname:P.dirname(t)};for(let g of o){let w=g.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(w&&!g.includes("client")&&!g.includes('type="module"'))await S(w[1],d,t)}let x=await h(f,d,t,{...b,...A,...r},new Set),R=x.indexOf(p);if(R===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,R),afterSlot:x.substring(R+p.length),filePath:t,shellScripts:o,shellStyles:c}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Br(t,r,e){let s,a="",i=r.match(Z);if(i){r=r.replace(i[0],"");try{let f=Buffer.from(i[1],"base64").toString("utf8"),p=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(p)s=p[1].trim();a=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let o=e||s||"stx App",c=Q(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{xn}from"./chunk-xyyt8v1r.js";import{U,C,Pt,It,vr,m,Mc,si,H,E}from"./chunk-ev2asp1e.js";import{Jt}from"./chunk-s04ban9p.js";import{n}from"./chunk-qq0m0fyn.js";import{q}from"./chunk-ncs2j5kc.js";var G=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function W(t){let r=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,s;while((s=e.exec(t))!==null)r.push({start:s.index,end:s.index+s[0].length});return r}function I(t,r){return r.some((e)=>t>=e.start&&t<e.end)}function X(t){let r=(t||"").trim();if(!r)return null;if(/[\s>+~,:]/.test(r))return null;let e={},s=r,a=s.match(/^[a-z][\w-]*/i);if(a)e.tag=a[0].toLowerCase(),s=s.slice(a[0].length);while(s.length>0){let i=s.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(i){if(e.attr=i[1],i[3]!==void 0&&i[3]!=="")e.attrValue=i[3];s=s.slice(i[0].length);continue}let o=s.match(/^#([\w-]+)/);if(o){e.id=o[1],s=s.slice(o[0].length);continue}let c=s.match(/^\.([\w-]+)/);if(c){e.className=c[1],s=s.slice(c[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function J(t,r){if(r.attr){if(!(r.attrValue===void 0?new RegExp(`\\b${r.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${r.attr}\\s*=\\s*(["'])\\s*${r.attrValue}\\s*\\1`,"i")).test(t))return!1}if(r.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${r.id}\\s*\\1`,"i").test(t))return!1}if(r.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(r.className))return!1}return!0}function N(t,r="main"){let e=X(r);if(!e)return null;let s=/<([a-z][\w-]*)\b([^>]*)>/gi,a=W(t),i;while((i=s.exec(t))!==null){if(I(i.index,a))continue;let o=i[1].toLowerCase(),c=i[2]||"";if(c.trimEnd().endsWith("/")||G.has(o))continue;if(e.tag&&e.tag!==o)continue;if(!J(c,e))continue;let l=i[0],u=i.index+l.length,f=new RegExp(`<(/?)${o}\\b([^>]*)>`,"gi");f.lastIndex=u;let p=1,h;while((h=f.exec(t))!==null){if(I(h.index,a))continue;let S=h[1]==="/";if(!S&&(h[2]||"").trimEnd().endsWith("/"))continue;if(p+=S?-1:1,p===0)return{openTag:l,openIndex:i.index,start:u,end:h.index,tagName:o}}return null}return null}var dt="private, no-store";function Tn(t){return t.replace(/&#(\d+);/g,(r,e)=>D(Number(e),r)).replace(/&#x([0-9a-f]+);/gi,(r,e)=>D(Number.parseInt(e,16),r)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function D(t,r){if(!Number.isInteger(t)||t<0||t>1114111)return r;try{return String.fromCodePoint(t)}catch{return r}}function _e(t){return t.headers.get("X-STX-Router")==="true"}function K(t,r){if(!t)return r;return t.split(",").some((s)=>s.trim().toLowerCase()===r.toLowerCase())?t:`${t}, ${r}`}function M(t){return{Vary:K(t,"X-STX-Router")}}function k(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function $n(t){let r=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy,s=C(r,(i,o)=>(e.lastIndex=o,e.exec(i)?e.lastIndex:-1)),a=[];for(let{token:i}of s){if(/^<title\b/i.test(i)){a.push(`<title>${k(i.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let o=Object.create(null),c=i.replace(/^<\w+\b|>$/g,"");for(let l of c.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let u=l[1].toLowerCase();if(!(u in o))o[u]=l[2]??l[3]??l[4]??""}if(/^<meta\b/i.test(i)){let l=o.property?"property":"name",u=Tn(o[l]??"").toLowerCase();if(u==="description"||/^(?:og|twitter):[\w:]+$/.test(u))a.push(`<meta ${l}="${n(u)}" content="${k(o.content??"")}">`)}else{let l=Tn(o.rel??"").toLowerCase();if(l==="canonical"||l==="alternate"&&o.hreflang)a.push(`<link rel="${l}" href="${k(o.href??"")}"${l==="alternate"?` hreflang="${k(o.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${a.join("")}</template>
3
+ `}import P from"path";var Y="stx-page-head:",Z=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Q(){let t=q()?"dev":"prod",r=v[t];if(r!==null)return r;try{let e=import.meta.require("./chunk-x5h95nnq.js"),s=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${s()}</script>`}catch{v[t]=""}return v[t]}async function qi(t,r){if(r===!1)return null;if(r&&typeof r==="string"){let s=P.resolve(t,r);if(await Bun.file(s).exists())return s;return null}let e=P.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function eo(t,r){try{let e=await Bun.file(t).text(),s=e,a=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(a)s=a[1].trim();let i=Jt(e),o=[...i.client.map((g)=>g.fullTag),...i.signals.map((g)=>g.fullTag)],c=[],l=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,u;while((u=l.exec(e))!==null)c.push(u[0]);let f=s;for(let g of i.server)f=f.replace(g.fullTag,"");for(let g of i.client)f=f.replace(g.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let p="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,p).replace(/<slot\s*>\s*<\/slot>/gi,p),!f.includes(p))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:S,defaultConfig:b,loadStxConfig:y}=await import("./chunk-yaanjj3t.js"),A=await y(),d={__filename:t,__dirname:P.dirname(t)};for(let g of o){let w=g.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(w&&!g.includes("client")&&!g.includes('type="module"'))await S(w[1],d,t)}let x=await h(f,d,t,{...b,...A,...r},new Set),R=x.indexOf(p);if(R===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:x.substring(0,R),afterSlot:x.substring(R+p.length),filePath:t,shellScripts:o,shellStyles:c}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Br(t,r,e){let s,a="",i=r.match(Z);if(i){r=r.replace(i[0],"");try{let f=Buffer.from(i[1],"base64").toString("utf8"),p=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(p)s=p[1].trim();a=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let o=e||s||"stx App",c=Q(),l="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
4
4
  <html lang="en">
5
5
  <head>
6
6
  <meta charset="UTF-8">
@@ -28,5 +28,5 @@ ${c}
28
28
  `));if(i.length>0)d.push(i.filter((x)=>!u.has(x)).join(`
29
29
  `));if(b.length>0)d.push(b.filter((x)=>!u.has(x)).join(`
30
30
  `));return d.push(S),d.join(`
31
- `)}import O from"fs";import V from"path";function Gi(t,r,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:r,outputDir:e}}function Xi(t,r){let e=V.join(r,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function Ji(t){let r=V.join(t,"manifest.json");if(!O.existsSync(r))return null;try{let e=O.readFileSync(r,"utf-8"),s=JSON.parse(e);if(s.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${s.version}`),null;return s}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function T(t,r,e={}){let s=`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(e.maxAge!==void 0)s+=`; Max-Age=${e.maxAge}`;if(e.expires)s+=`; Expires=${e.expires.toUTCString()}`;if(e.path)s+=`; Path=${e.path}`;if(e.domain)s+=`; Domain=${e.domain}`;if(e.secure)s+="; Secure";if(e.httpOnly)s+="; HttpOnly";if(e.sameSite)s+=`; SameSite=${e.sameSite}`;return s}async function et(t){let r=t.headers.get("content-type")||"",e={},s=(a,i)=>{let o=e[a];if(o===void 0)e[a]=i;else if(Array.isArray(o))o.push(i);else e[a]=[o,i]};if(r.includes("multipart/form-data")){let a=await t.formData();for(let[i,o]of a.entries())if(typeof o==="string")s(i,o);return e}if(r.includes("application/x-www-form-urlencoded")){for(let[a,i]of new URLSearchParams(await t.text()).entries())s(a,i);return e}return e}function to(t){if(!t)return!1;let r=t.toUpperCase();return r!=="GET"&&r!=="HEAD"}async function B(t,r={}){let e=r.request,s=r.method??e?.method;if(!e||!to(s))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let a={};try{a=await et(e)}catch{}let i=await t.action({request:e,form:a,params:r.params??{},query:t.query??{},cookies:r.cookies??{}});if(i&&typeof i==="object"){let o=i,c=nt(o.cookies),l=o.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...c.length>0?{cookies:c}:{}};let{cookies:u,redirect:f,...p}=o;if(Object.assign(t,p),c.length>0)return{ran:!0,cookies:c}}return{ran:!0}}function nt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let r=[];for(let[e,s]of Object.entries(t)){if(!e)continue;if(typeof s==="string"){r.push(T(e,s));continue}if(s&&typeof s==="object"){let a=s;if(typeof a.value!=="string")continue;r.push(T(e,a.value,a))}}return r}function Yi(t,r=[],e){let s=new Headers({Location:t,"Cache-Control":"no-store"});for(let a of r)s.append("Set-Cookie",a);for(let[a,i]of Object.entries(e??{}))if(a.toLowerCase()!=="location")s.set(a,i);return new Response(null,{status:303,headers:s})}async function Rn(t,r={}){let{html:e,context:s,redirect:a,cookies:i}=await rt(t,r),o=Pt(s),c=It(s);if(a)return{html:e,redirect:a,cookies:i,status:o,headers:c};let{extractStreamBoundaries:l}=await import("./chunk-8z469777.js"),u=l(s),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:p}=await import("./chunk-3qnke2jb.js"),{defaultConfig:h}=await import("./chunk-zaj3gzet.js"),S=s.streamBoundaries||{},b={...h,autoShell:!1},y=Object.keys(f).map((d)=>({id:d,render:async()=>{let x=typeof S[d]==="function"?await S[d]():void 0;return p(f[d],{...s,$boundary:x},t.sourceFile,b,new Set)}})),A=new Set(y.map((d)=>d.id));u=[...(u||[]).filter((d)=>!A.has(d.id)),...y]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:i,status:o,headers:c}}async function rt(t,r){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...r};if(!t.hasServerScripts&&!si(t.html))return{html:t.html,context:e};for(let o of t.serverScriptContent)try{await m(o,e,t.sourceFile)}catch(c){if(r.__stx_strict_hydration)throw c;console.warn(`[stx] Server script error in ${t.sourceFile}:`,c)}let s=await B(e,{request:r.request,method:r.method,params:r.params??{},cookies:r.cookies??{}}),a=(o)=>{let c=o.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=vr(e);if(!l)return c;let u=c.indexOf("</head>");return u<0?l+c:c.slice(0,u)+l+c.slice(u)};if(s.redirect)return{html:t.html,context:e,redirect:s.redirect,cookies:s.cookies};if(!si(t.html))return{html:a(t.html),context:e,cookies:s.cookies};let i=new Map;for(let[o,c]of Object.entries(t.placeholders))if(c.expression)try{let l=E(c.expression,e);if(c.type==="raw")i.set(o,l!==void 0&&l!==null?String(l):"");else i.set(o,l!==void 0&&l!==null?H(String(l)):"")}catch(l){if(r.__stx_strict_hydration)throw l;i.set(o,"")}return{html:a(Mc(t.html,i)),context:e,cookies:s.cookies}}
31
+ `)}import O from"fs";import V from"path";function Gi(t,r,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:r,outputDir:e}}function Xi(t,r){let e=V.join(r,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function Ji(t){let r=V.join(t,"manifest.json");if(!O.existsSync(r))return null;try{let e=O.readFileSync(r,"utf-8"),s=JSON.parse(e);if(s.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${s.version}`),null;return s}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function T(t,r,e={}){let s=`${encodeURIComponent(t)}=${encodeURIComponent(r)}`;if(e.maxAge!==void 0)s+=`; Max-Age=${e.maxAge}`;if(e.expires)s+=`; Expires=${e.expires.toUTCString()}`;if(e.path)s+=`; Path=${e.path}`;if(e.domain)s+=`; Domain=${e.domain}`;if(e.secure)s+="; Secure";if(e.httpOnly)s+="; HttpOnly";if(e.sameSite)s+=`; SameSite=${e.sameSite}`;return s}async function et(t){let r=t.headers.get("content-type")||"",e={},s=(a,i)=>{let o=e[a];if(o===void 0)e[a]=i;else if(Array.isArray(o))o.push(i);else e[a]=[o,i]};if(r.includes("multipart/form-data")){let a=await t.formData();for(let[i,o]of a.entries())if(typeof o==="string")s(i,o);return e}if(r.includes("application/x-www-form-urlencoded")){for(let[a,i]of new URLSearchParams(await t.text()).entries())s(a,i);return e}return e}function to(t){if(!t)return!1;let r=t.toUpperCase();return r!=="GET"&&r!=="HEAD"}async function B(t,r={}){let e=r.request,s=r.method??e?.method;if(!e||!to(s))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let a={};try{a=await et(e)}catch{}let i=await t.action({request:e,form:a,params:r.params??{},query:t.query??{},cookies:r.cookies??{}});if(i&&typeof i==="object"){let o=i,c=nt(o.cookies),l=o.redirect;if(typeof l==="string"&&l)return{redirect:l,ran:!0,...c.length>0?{cookies:c}:{}};let{cookies:u,redirect:f,...p}=o;if(Object.assign(t,p),c.length>0)return{ran:!0,cookies:c}}return{ran:!0}}function nt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let r=[];for(let[e,s]of Object.entries(t)){if(!e)continue;if(typeof s==="string"){r.push(T(e,s));continue}if(s&&typeof s==="object"){let a=s;if(typeof a.value!=="string")continue;r.push(T(e,a.value,a))}}return r}function Yi(t,r=[],e){let s=new Headers({Location:t,"Cache-Control":"no-store"});for(let a of r)s.append("Set-Cookie",a);for(let[a,i]of Object.entries(e??{}))if(a.toLowerCase()!=="location")s.set(a,i);return new Response(null,{status:303,headers:s})}async function Rn(t,r={}){let{html:e,context:s,redirect:a,cookies:i}=await rt(t,r),o=Pt(s),c=It(s);if(a)return{html:e,redirect:a,cookies:i,status:o,headers:c};let{extractStreamBoundaries:l}=await import("./chunk-2t4z29p8.js"),u=l(s),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:p}=await import("./chunk-zc5e9bnh.js"),{defaultConfig:h}=await import("./chunk-wj1xg3z5.js"),S=s.streamBoundaries||{},b={...h,autoShell:!1},y=Object.keys(f).map((d)=>({id:d,render:async()=>{let x=typeof S[d]==="function"?await S[d]():void 0;return p(f[d],{...s,$boundary:x},t.sourceFile,b,new Set)}})),A=new Set(y.map((d)=>d.id));u=[...(u||[]).filter((d)=>!A.has(d.id)),...y]}return{html:e,boundaries:u&&u.length>0?u:void 0,cookies:i,status:o,headers:c}}async function rt(t,r){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...r};if(!t.hasServerScripts&&!si(t.html))return{html:t.html,context:e};for(let o of t.serverScriptContent)try{await m(o,e,t.sourceFile)}catch(c){if(r.__stx_strict_hydration)throw c;console.warn(`[stx] Server script error in ${t.sourceFile}:`,c)}let s=await B(e,{request:r.request,method:r.method,params:r.params??{},cookies:r.cookies??{}}),a=(o)=>{let c=o.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),l=vr(e);if(!l)return c;let u=c.indexOf("</head>");return u<0?l+c:c.slice(0,u)+l+c.slice(u)};if(s.redirect)return{html:t.html,context:e,redirect:s.redirect,cookies:s.cookies};if(!si(t.html))return{html:a(t.html),context:e,cookies:s.cookies};let i=new Map;for(let[o,c]of Object.entries(t.placeholders))if(c.expression)try{let l=E(c.expression,e);if(c.type==="raw")i.set(o,l!==void 0&&l!==null?String(l):"");else i.set(o,l!==void 0&&l!==null?H(String(l)):"")}catch(l){if(r.__stx_strict_hydration)throw l;i.set(o,"")}return{html:a(Mc(t.html,i)),context:e,cookies:s.cookies}}
32
32
  export{dt,Tn,_e,M,$n,qi,eo,Br,Ue,Ki,Ce,Gi,Xi,Ji,to,Yi,Rn};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{pc,r,fe}from"./chunk-0jtrdgyv.js";import{et}from"./chunk-j2mpqa4p.js";import{l}from"./chunk-5n4qg8za.js";import o from"fs";import u from"path";var yf=new Map,m=new Map;async function oh(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){n=s;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function ih(e){m.delete(e)}function ah(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function ch(e){x=e}async function bf(e=!1){let t=x??await import("./chunk-cjx11tgd.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function vf(){if(S===null){let{getRouterScript:e}=await import("./chunk-avr65xra.js");S=e()}return S}var y={};async function lh(e,t=!1){let n=e==="runtime"?await bf(t):await vf(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==n)s={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:n,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function uh(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let s=c.keys().next().value;p-=c.get(s).length*2,c.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(u.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function Oo(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function dh(){m.clear(),fe(),pc(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function ir(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${as(e)}.html`),s=u.join(n,`${as(e)}.meta.json`);if(!await r(i)||!await r(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==et())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await r(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function ar(e,t,n,i){try{if(!i.cachePath)return;let s=u.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=u.join(s,`${as(e)}.html`),a=u.join(s,`${as(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:et(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),yf.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function as(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
2
+ import{pc,r,fe}from"./chunk-ev2asp1e.js";import{et}from"./chunk-j2mpqa4p.js";import{l}from"./chunk-5n4qg8za.js";import o from"fs";import u from"path";var yf=new Map,m=new Map;async function oh(e){let n;for(let i=0;i<3;i++)try{let g=(await o.promises.stat(e)).mtime.getTime(),a=m.get(e);if(a&&a.mtime===g)return a.content;let h=await Bun.file(e).text(),w=(await o.promises.stat(e)).mtime.getTime();if(w!==g)continue;return m.set(e,{content:h,mtime:w}),h}catch(s){n=s;break}throw m.delete(e),Error(`File not found: ${e}${n?` (${n.message})`:""}`)}function ih(e){m.delete(e)}function ah(e){for(let t of m.keys())if(t.startsWith(e))m.delete(t)}var f=null,B=null,x=null;function ch(e){x=e}async function bf(e=!1){let t=x??await import("./chunk-fxvxkb55.js");if(e)return t.generateSignalsRuntimeDev();if(f===null)f=t.generateSignalsRuntime();return f}var S=null;async function vf(){if(S===null){let{getRouterScript:e}=await import("./chunk-x5h95nnq.js");S=e()}return S}var y={};async function lh(e,t=!1){let n=e==="runtime"?await bf(t):await vf(),i=e==="runtime"&&t?"runtime-debug":e,s=y[i];if(!s||s.content!==n)s={content:n,hash:Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)},y[i]=s;return{content:n,hash:s.hash,url:`/_stx/${e}.${s.hash}.js`}}var E=500,T=33554432,c=new Map,p=0;function C(e){return l(process.cwd(),"module-bundles",`${e}.js`)}function uh(e){let t=Bun.hash(e).toString(16).padStart(16,"0").slice(0,16),n=c.get(t),i=n!==void 0;if(i)c.delete(t),p-=n.length*2;c.set(t,e),p+=e.length*2;while(c.size>1&&(c.size>E||p>T)){let s=c.keys().next().value;p-=c.get(s).length*2,c.delete(s)}if(!i)try{let s=C(t);if(!o.existsSync(s))o.mkdirSync(u.dirname(s),{recursive:!0}),o.writeFileSync(s,e)}catch{}return`/_stx/modules.${t}.js`}function Oo(e){if(!/^[0-9a-f]{16}$/.test(e))return;let t=c.get(e);if(t!==void 0)return t;try{return o.readFileSync(C(e),"utf8")}catch{return}}function dh(){m.clear(),fe(),pc(),f=null,B=null,S=null}function v(e){let t={debug:e.debug===!0,middleware:(e.middleware??[]).map((n)=>({name:n.name,timing:n.timing,handler:String(n.handler)})),customDirectives:(e.customDirectives??[]).map((n)=>({name:n.name,hasEndTag:n.hasEndTag===!0,rawParams:n.rawParams===!0,handler:String(n.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(t)).digest("hex")}async function ir(e,t){try{if(!t.cachePath)return null;let n=u.resolve(t.cachePath),i=u.join(n,`${as(e)}.html`),s=u.join(n,`${as(e)}.meta.json`);if(!await r(i)||!await r(s))return null;let g=await Bun.file(s).text(),a=JSON.parse(g);if(a.cacheVersion!==t.cacheVersion)return null;if(a.engine!==et())return null;if(a.optionsSignature!==v(t))return null;if((await o.promises.stat(e)).mtime.getTime()>a.mtime)return null;for(let d of a.dependencies)if(await r(d)){if((await o.promises.stat(d)).mtime.getTime()>a.mtime)return null}else return null;return await Bun.file(i).text()}catch(n){return console.warn(`Cache error for ${e}:`,n),null}}async function ar(e,t,n,i){try{if(!i.cachePath)return;let s=u.resolve(i.cachePath);await o.promises.mkdir(s,{recursive:!0});let g=u.join(s,`${as(e)}.html`),a=u.join(s,`${as(e)}.meta.json`),h=await o.promises.stat(e);await Bun.write(g,t);let d={sourcePath:e,mtime:h.mtime.getTime(),dependencies:Array.from(n),cacheVersion:i.cacheVersion,engine:et(),optionsSignature:v(i),generatedAt:Date.now()};await Bun.write(a,JSON.stringify(d,null,2)),yf.set(e,{output:t,mtime:h.mtime.getTime(),dependencies:n})}catch(s){console.warn(`Failed to cache template ${e}:`,s)}}var _=16;function as(e){return new Bun.CryptoHasher("sha1").update(e).digest("hex").substring(0,_)}
3
3
  export{yf,oh,ih,ah,ch,bf,vf,lh,uh,Oo,dh,ir,ar,as};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{vn,O}from"./chunk-wp6q0geg.js";import m from"fs";import e from"path";async function bn(r,o,i){if(r.__stx_runtime_config)return;let n=vn();if(n||i){r.__stx_runtime_config=n??O(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-zaj3gzet.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=O(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function ii(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{vn,O}from"./chunk-wp6q0geg.js";import m from"fs";import e from"path";async function bn(r,o,i){if(r.__stx_runtime_config)return;let n=vn();if(n||i){r.__stx_runtime_config=n??O(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-wj1xg3z5.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=O(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function ii(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??{})} }
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Bg}from"./chunk-ecy52773.js";import"./chunk-f134xm9v.js";import"./chunk-8jb55rfm.js";import"./chunk-stvw8y3c.js";import"./chunk-zjw6j2x0.js";import"./chunk-3t3p2c1t.js";import"./chunk-3ps07041.js";import"./chunk-ev2asp1e.js";import"./chunk-e2fvr2w6.js";import"./chunk-wp6q0geg.js";import"./chunk-xyyt8v1r.js";import"./chunk-zn3c0ew5.js";import"./chunk-wt18wv6x.js";export{Bg as buildApp};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{So,ko,_o,nh,es,rh}from"./chunk-65fcex5r.js";export{es as clearImageDeliveryCatalog,nh as deliveredImage,_o as efficientDeliverySources,So as getImageDelivery,ko as isTransparentImage,rh as prepareImageDelivery};
2
+ import{So,ko,_o,nh,es,rh}from"./chunk-j184qf8s.js";export{es as clearImageDeliveryCatalog,nh as deliveredImage,_o as efficientDeliverySources,So as getImageDelivery,ko as isTransparentImage,rh as prepareImageDelivery};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{a}from"./chunk-90kfvtf6.js";import{no}from"./chunk-b7j48bq9.js";import p from"path";async function Bg(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(no(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-48936paw.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
2
+ import{a}from"./chunk-f134xm9v.js";import{no}from"./chunk-b7j48bq9.js";import p from"path";async function Bg(t={}){let l=performance.now(),s=t.root||process.cwd(),e=await a(s),o=t.ssr?.routeRules??e.routeRules??{};if(no(o),!e.ssr&&Object.keys(o).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let u,n;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");u=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-xrx6ay3j.js");n=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let d=Math.round(performance.now()-l);return{mode:r,ssg:u,ssr:n,duration:d}}
3
3
  export{Bg};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fe,vn,Os,ai,O}from"./chunk-wp6q0geg.js";import{bn}from"./chunk-qcw1neka.js";import{Rr,k,qc,ot,mi,Kc}from"./chunk-wt18wv6x.js";import{A}from"./chunk-zn3c0ew5.js";import{Ns,u,f,Mt,d,W,j,b,js,ke,He,Bs}from"./chunk-xyyt8v1r.js";import{s,ge}from"./chunk-vstvadc2.js";import{g}from"./chunk-0dve54ne.js";import{q}from"./chunk-ncs2j5kc.js";import Je from"path";import kt from"process";import{AsyncLocalStorage as wo}from"async_hooks";var ar=new wo;function fn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function cr(e,n){return ar.run(fn(e),n)}async function lr(e,n){let t=ar.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let c=JSON.stringify(l,(v,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),y=JSON.parse(c);return t.values.set(e,y),y}).catch((l)=>{throw t.pending.delete(e),l});return t.pending.set(e,a),a}function vr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function F(e,n=!1){let t=s(e),i=[],a=new Set,l=0,c=0,y=t.length,v=()=>{if(l!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(n&&R[1]==="const")return;let P=R[2];if(!a.has(P))i.push(P),a.add(P);return}let T=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){if(n&&t.slice(c).startsWith("const"))return;T[1].split(",").forEach((P)=>{let N=P.trim();if(!N)return;let G=N.indexOf(":"),B=(G>=0?N.slice(G+1).trim():N).split(/[\s=]/)[0];if(B&&!a.has(B))i.push(B),a.add(B)});return}let M=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(n&&t.slice(c).startsWith("const"))return;M[1].split(",").forEach((P)=>{let N=P.trim().replace(/^\.\.\./,"");if(!N)return;let G=N.split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}if(n)return;let L=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let P=L[1];if(!a.has(P))i.push(P),a.add(P);return}let D=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let P=D[1];if(!a.has(P))i.push(P),a.add(P)}};while(c<y){if(t[c]==="{"){l++,c++;continue}if(t[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))v();c++}return i.join(", ")}function vs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function So(e,n=F(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(F(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function ws(e,n){let t=`{ ${So(e,n)} }`;return F(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import An from"fs";import Ae from"path";function z(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 xs(e,n=!0){let t=ur.get(e);if(n&&t)return t;let i=new Map,a=[Ae.join(e,"src"),Ae.join(e,"dist"),e];function l(c,y){if(y>6)return;let v;try{v=An.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of v){let T=Ae.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;l(T,y+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let M=R.name.slice(0,-4);if(!i.has(M))i.set(M,T);let L=M.toLowerCase();if(!i.has(L))i.set(L,T);let D=z(M);if(!i.has(D))i.set(D,T)}}}for(let c of a)if(l(c,0),i.size>0)break;if(n)ur.set(e,i);return i}function Ss(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let t=n;while(!0){let i=Ae.join(t,"node_modules",e);try{if(An.statSync(i).isDirectory())return i}catch{}let a=Ae.dirname(t);if(a===t)return null;t=a}}function ks(e,n,t={}){return[Ae.resolve(Ae.dirname(n),`${e}.stx`),Ae.resolve(Ae.dirname(n),e),Ae.resolve(t.componentsDir||"components",`${e}.stx`),Ae.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,t=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=z(n);return[n,t,i]}function Uo(e,n){let[t,i,a]=fr(e);for(let l of[t,t.toLowerCase(),i,a]){let c=n?.__importedComponents?.get(l);if(c!==void 0)return c}}function*Wo(e,n,t={},i){let a=fr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ae.resolve(Ae.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=t.projectRoot||process.cwd(),y=[...i?.__originalFilePath?[Ae.join(Ae.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ae.join(Ae.dirname(n),"components"),Ae.resolve(c,"src/components"),Ae.resolve(c,"components"),...import.meta.dir?[Ae.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let R of l)yield Ae.join(v,R);try{for(let R of An.readdirSync(v,{withFileTypes:!0}))if(R.isDirectory())for(let T of l)yield Ae.join(v,R.name,T)}catch{}}}function pr(e,n,t={},i){let a=Uo(e,i);if(a!==void 0)return a;for(let l of Wo(e,n,t,i))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}import Js from"fs";import le from"path";import mt from"path";import Kt from"fs";var $o=new Set(["touchstart","touchmove","wheel","mousewheel"]);function rs(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return $o.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"]),xr={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"},vo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function _r(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(vo.has(i))n.systemKeys.push(i);else if(i in $r)n.mouse=i;else if(i in xr||/^[a-z]$/.test(i))n.keys.push(xr[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function Er(e,n=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,y,v]=l,R=l.index,T=R+c.length,M=`__stx_evt_${n}${i++}`,L=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=D.exec(v))!==null){let[,G,K]=P,B=G.split("."),Q=B[0];if(!dr.has(Q))continue;L.push({attribute:`@${G}`,event:Q,handler:K,modifiers:_r(B.slice(1)),elementId:M})}let N=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=N.exec(v))!==null){let[,G,K]=P,B=G.split("."),Q=B[0];if(!dr.has(Q))continue;L.push({attribute:`@${G}`,event:Q,handler:K,modifiers:_r(B.slice(1)),elementId:M})}if(L.length>0)t.push({originalTag:c,elementId:M,events:L,startIndex:R,endIndex:T})}return t}function Eo(e){let n=[],{modifiers:t}=e;if(t.self)n.push("if ($event.target !== $el) return");for(let i of t.systemKeys)n.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=$r[t.mouse];n.push(`if ($event.button !== ${i}) return`)}if(t.prevent)n.push("$event.preventDefault()");if(t.stop)n.push("$event.stopPropagation()");return n.join("; ")}function ko(e,n){let t=e;if(n.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${n.debounce})`;else if(n.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${n.throttle})`;return t}function is(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Ro(e){let{modifiers:n}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Eo(e),a=ko(is(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(rs(e.event,n))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",y=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{Fe,vn,Os,ai,O}from"./chunk-wp6q0geg.js";import{bn}from"./chunk-e2fvr2w6.js";import{Rr,k,qc,ot,mi,Kc}from"./chunk-wt18wv6x.js";import{A}from"./chunk-zn3c0ew5.js";import{Ns,u,f,Mt,d,W,j,b,js,ke,He,Bs}from"./chunk-xyyt8v1r.js";import{s,ge}from"./chunk-vstvadc2.js";import{g}from"./chunk-0dve54ne.js";import{q}from"./chunk-ncs2j5kc.js";import Je from"path";import kt from"process";import{AsyncLocalStorage as wo}from"async_hooks";var ar=new wo;function fn(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function cr(e,n){return ar.run(fn(e),n)}async function lr(e,n){let t=ar.getStore();if(!t)throw Error("useServerData must run inside a <script server> render");if(typeof e!=="string"||!e.trim())throw TypeError("useServerData requires a non-empty string key");let i=t.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let c=JSON.stringify(l,(v,R)=>{if(R===void 0||typeof R==="function"||typeof R==="symbol"||typeof R==="bigint"||typeof R==="number"&&!Number.isFinite(R))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(R&&typeof R==="object"&&!Array.isArray(R)&&Object.getPrototypeOf(R)!==Object.prototype&&Object.getPrototypeOf(R)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return R}),y=JSON.parse(c);return t.values.set(e,y),y}).catch((l)=>{throw t.pending.delete(e),l});return t.pending.set(e,a),a}function vr(e){let n=e.__stx_server_data;if(!n?.values.size)return"";return`<script data-stx-scoped data-stx-server-data type="application/json">${JSON.stringify(Object.fromEntries(n.values)).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function F(e,n=!1){let t=s(e),i=[],a=new Set,l=0,c=0,y=t.length,v=()=>{if(l!==0)return;let R=t.slice(c).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(R){if(n&&R[1]==="const")return;let P=R[2];if(!a.has(P))i.push(P),a.add(P);return}let T=t.slice(c).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){if(n&&t.slice(c).startsWith("const"))return;T[1].split(",").forEach((P)=>{let N=P.trim();if(!N)return;let G=N.indexOf(":"),B=(G>=0?N.slice(G+1).trim():N).split(/[\s=]/)[0];if(B&&!a.has(B))i.push(B),a.add(B)});return}let M=t.slice(c).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(M){if(n&&t.slice(c).startsWith("const"))return;M[1].split(",").forEach((P)=>{let N=P.trim().replace(/^\.\.\./,"");if(!N)return;let G=N.split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}if(n)return;let L=t.slice(c).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let P=L[1];if(!a.has(P))i.push(P),a.add(P);return}let D=t.slice(c).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(D){let P=D[1];if(!a.has(P))i.push(P),a.add(P)}};while(c<y){if(t[c]==="{"){l++,c++;continue}if(t[c]==="}"){l--,c++;continue}if(l===0&&/[a-z]/i.test(t[c])&&(c===0||/\s|[;{}()]/.test(t[c-1])))v();c++}return i.join(", ")}function vs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function So(e,n=F(e).split(",").map((t)=>t.trim()).filter(Boolean)){let t=new Set(F(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>t.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function ws(e,n){let t=`{ ${So(e,n)} }`;return F(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${t}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:t}import An from"fs";import Ae from"path";function z(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 xs(e,n=!0){let t=ur.get(e);if(n&&t)return t;let i=new Map,a=[Ae.join(e,"src"),Ae.join(e,"dist"),e];function l(c,y){if(y>6)return;let v;try{v=An.readdirSync(c,{withFileTypes:!0})}catch{return}for(let R of v){let T=Ae.join(c,R.name);if(R.isDirectory()){if(R.name==="node_modules"||R.name.startsWith("."))continue;l(T,y+1)}else if(R.isFile()&&R.name.endsWith(".stx")){let M=R.name.slice(0,-4);if(!i.has(M))i.set(M,T);let L=M.toLowerCase();if(!i.has(L))i.set(L,T);let D=z(M);if(!i.has(D))i.set(D,T)}}}for(let c of a)if(l(c,0),i.size>0)break;if(n)ur.set(e,i);return i}function Ss(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let t=n;while(!0){let i=Ae.join(t,"node_modules",e);try{if(An.statSync(i).isDirectory())return i}catch{}let a=Ae.dirname(t);if(a===t)return null;t=a}}function ks(e,n,t={}){return[Ae.resolve(Ae.dirname(n),`${e}.stx`),Ae.resolve(Ae.dirname(n),e),Ae.resolve(t.componentsDir||"components",`${e}.stx`),Ae.resolve(t.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function fr(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,t=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=z(n);return[n,t,i]}function Uo(e,n){let[t,i,a]=fr(e);for(let l of[t,t.toLowerCase(),i,a]){let c=n?.__importedComponents?.get(l);if(c!==void 0)return c}}function*Wo(e,n,t={},i){let a=fr(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ae.resolve(Ae.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],c=t.projectRoot||process.cwd(),y=[...i?.__originalFilePath?[Ae.join(Ae.dirname(i.__originalFilePath),"components")]:[],...t.componentsDir?[t.componentsDir]:[],Ae.join(Ae.dirname(n),"components"),Ae.resolve(c,"src/components"),Ae.resolve(c,"components"),...import.meta.dir?[Ae.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(y)){for(let R of l)yield Ae.join(v,R);try{for(let R of An.readdirSync(v,{withFileTypes:!0}))if(R.isDirectory())for(let T of l)yield Ae.join(v,R.name,T)}catch{}}}function pr(e,n,t={},i){let a=Uo(e,i);if(a!==void 0)return a;for(let l of Wo(e,n,t,i))try{if(An.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}import Js from"fs";import le from"path";import mt from"path";import Kt from"fs";var $o=new Set(["touchstart","touchmove","wheel","mousewheel"]);function rs(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return $o.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"]),xr={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"},vo=new Set(["ctrl","alt","shift","meta"]),$r={left:0,middle:1,right:2};function _r(e){let n={prevent:!1,stop:!1,once:!1,capture:!1,self:!1,passive:!1,nonpassive:!1,keys:[],systemKeys:[],mouse:null,debounce:null,throttle:null};for(let t of e){let i=t.toLowerCase();if(i==="prevent")n.prevent=!0;else if(i==="stop")n.stop=!0;else if(i==="once")n.once=!0;else if(i==="capture")n.capture=!0;else if(i==="self")n.self=!0;else if(i==="passive")n.passive=!0;else if(i==="nonpassive")n.nonpassive=!0;else if(vo.has(i))n.systemKeys.push(i);else if(i in $r)n.mouse=i;else if(i in xr||/^[a-z]$/.test(i))n.keys.push(xr[i]||i.toUpperCase());else if(i.startsWith("debounce")){let a=i.match(/debounce(?:\.(\d+))?/);n.debounce=a?.[1]?Number.parseInt(a[1],10):300}else if(i.startsWith("throttle")){let a=i.match(/throttle(?:\.(\d+))?/);n.throttle=a?.[1]?Number.parseInt(a[1],10):300}}return n}function Er(e,n=""){let t=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[c,y,v]=l,R=l.index,T=R+c.length,M=`__stx_evt_${n}${i++}`,L=[],D=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,P;while((P=D.exec(v))!==null){let[,G,K]=P,B=G.split("."),Q=B[0];if(!dr.has(Q))continue;L.push({attribute:`@${G}`,event:Q,handler:K,modifiers:_r(B.slice(1)),elementId:M})}let N=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((P=N.exec(v))!==null){let[,G,K]=P,B=G.split("."),Q=B[0];if(!dr.has(Q))continue;L.push({attribute:`@${G}`,event:Q,handler:K,modifiers:_r(B.slice(1)),elementId:M})}if(L.length>0)t.push({originalTag:c,elementId:M,events:L,startIndex:R,endIndex:T})}return t}function Eo(e){let n=[],{modifiers:t}=e;if(t.self)n.push("if ($event.target !== $el) return");for(let i of t.systemKeys)n.push(`if (!$event.${i}Key) return`);if(t.keys.length>0){let i=t.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(t.mouse!==null){let i=$r[t.mouse];n.push(`if ($event.button !== ${i}) return`)}if(t.prevent)n.push("$event.preventDefault()");if(t.stop)n.push("$event.stopPropagation()");return n.join("; ")}function ko(e,n){let t=e;if(n.debounce!==null)t=`__stx_debounce(() => { ${t} }, ${n.debounce})`;else if(n.throttle!==null)t=`__stx_throttle(() => { ${t} }, ${n.throttle})`;return t}function is(e){let n=e.trim();if(!/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n))return e;return`if (typeof ${n} === 'function' && !${n}._isSignal) ${n}($event);`}function Ro(e){let{modifiers:n}=e,t=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=Eo(e),a=ko(is(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(rs(e.event,n))l.push("passive: true");let c=l.length>0?`, { ${l.join(", ")} }`:"",y=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
3
3
  (function() {
4
4
  var $el = document.getElementById('${t}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function To(e,n=""){let t=Er(e,n);if(t.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=t.length-1;l>=0;l--){let c=t[l],y=c.originalTag;if(!y.includes(" id="))y=y.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${c.elementId}"`);else{let v=y.match(/id=["']([^"']+)["']/);if(v)for(let R of c.events)R.elementId=v[1]}for(let v of c.events){let R=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),T=new RegExp(`\\s*${R}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${R}\\s*=\\s*'[^']*'`,"g");y=y.replace(T,""),y=y.replace(M,"")}i=i.slice(0,c.startIndex)+y+i.slice(c.endIndex),a.push(...c.events)}return{template:i,bindings:a}}function Sr(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function dc(e,n,t){if(Kc(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:y,bindings:v}=To(e,Sr(n)),R=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...R,...v],y}let i=Er(e,Sr(n));if(i.length===0)return e;let a=e;for(let y=i.length-1;y>=0;y--){let v=i[y],R=v.originalTag;if(!R.includes(" id="))R=R.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let T=R.match(/id=["']([^"']+)["']/);if(T)for(let M of v.events)M.elementId=T[1]}for(let T of v.events){let M=T.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`\\s*${M}\\s*=\\s*"[^"]*"`,"g"),D=new RegExp(`\\s*${M}\\s*=\\s*'[^']*'`,"g");R=R.replace(L,""),R=R.replace(D,"")}a=a.slice(0,v.startIndex)+R+a.slice(v.endIndex)}let l=qo(i.flatMap((y)=>y.events)),c=a.lastIndexOf("</body>");if(c!==-1)a=a.slice(0,c)+l+`
115
- `+a.slice(c);else a+=l;return a}function kr(e,n){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Tt(e,n){let t=s(e),{depths:i,balanced:a}=ge(t),l=(y)=>!a||i[y]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let y of t.matchAll(c)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&kr(y[1],!0).has(n))return!0;for(let y of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&kr(y[1],!1).has(n))return!0;return!1}var Tr="",In,at=/^[A-Za-z_$][\w$]*$/,Co=new Set(["if","for","while","switch","with"]),Cr=["(","[","{"],Ar=[")","]","}"],Ao=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Io(e){let n=s(e),t=[];for(let i of n.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:n,tokens:t}}function os(e){if(In&&e===Tr)return In;let{code:n,tokens:t}=Io(e),i=new Map,a=[];for(let P=0;P<t.length;P++){let N=t[P].text;if(["(","[","{"].includes(N))a.push(P);else if([")","]","}"].includes(N)){let G=a.at(-1);if(G!==void 0&&["()","[]","{}"].includes(t[G].text+N))a.pop(),i.set(G,P),i.set(P,G)}}function l(P,N){let G=[],K=P;for(let B=P;B<N;B++){if(["(","[","{"].includes(t[B].text)&&(i.get(B)??N)<N){B=i.get(B);continue}if(t[B].text===",")G.push([K,B]),K=B+1}return G.push([K,N]),G}let c=[];function y(P,N,G,K=!1){if(t[P]?.text==="...")P++;if(P>=N)return;let B=t[P].text;if(at.test(B)){if(G.add(B),G===T)c.push({name:B,token:P,functionScoped:K});return}if(B!=="{"&&B!=="[")return;let Q=i.get(P);if(Q===void 0||Q>=N)return;for(let[te,ne]of l(P+1,Q)){let ae=te;if(B==="{")for(let me=te;me<ne;me++){if(t[me].text===":"){ae=me+1;break}if(t[me].text==="=")break;if(["(","[","{"].includes(t[me].text)&&i.has(me))me=i.get(me)}y(ae,ne,G,K)}}function v(P,N){let G=new Set;for(let[K,B]of l(P,N))y(K,B,G);return G}function R(P){let N=P;for(;N<t.length;N++){let G=t[N].text;if(["(","[","{"].includes(G)&&i.has(N)){N=i.get(N);continue}if([",",";",")","]","}"].includes(G))break}return t[Math.max(P,N-1)]?.end??n.length}let T=new Set,M=[];for(let P=0;P<t.length;P++)if(t[P].text==="=>"){let N=P-1,G=N,K;if(t[N]?.text===")"&&i.has(N))G=i.get(N),K=v(G+1,N);else if(t[N]&&at.test(t[N].text))K=new Set([t[N].text]);else continue;let B=P+1,Q=t[B]?.text==="{"&&i.has(B)?t[i.get(B)].end:R(B);M.push({start:t[G].start,end:Q,bodyStart:t[B]?.start??Q,functionBody:!0,names:K})}else if(t[P].text==="("&&i.has(P)){let N=t[P-1]?.text;if(!N||Co.has(N)||!at.test(N)&&N!=="*"&&N!=="]")continue;let G=i.get(P),K=G+1;if(t[K]?.text===":"){K++;while(K<t.length&&!["{","=>",";","="].includes(t[K].text))K++}if(t[K]?.text!=="{"||!i.has(K))continue;M.push({start:t[P].start,end:t[i.get(K)].end,bodyStart:t[K].start,functionBody:N!=="catch",names:v(P+1,G)})}function L(P){let N=P;for(;N<t.length;N++){let G=t[N].text;if(Cr.includes(G)&&i.has(N)){N=i.get(N);continue}if(G===";"||Ar.includes(G))break;let K=t[N-1];if(N>P&&Ao.has(G)&&K.text!==".")break;if(N>P&&/[\n\r]/.test(n.slice(K.end,t[N].start))&&(/^[\w$]+$/.test(K.text)||Ar.includes(K.text)||['"',"'","`"].includes(K.text))&&at.test(G)&&!["in","of","instanceof"].includes(G))break}return N}let D=[];for(let P=0;P<t.length;P++){if(t[P].text!=="for")continue;let N=t[P+1]?.text==="await"?P+2:P+1;if(t[N]?.text!=="("||!i.has(N))continue;let G=i.get(N),K=G+1,B=t[K]?.text==="{"&&i.has(K)?i.get(K):L(K),Q=t[B]?.text===";"||t[B]?.text==="}"?t[B].end:t[Math.max(K,B-1)]?.end??n.length;D.push({headStart:N,headEnd:G,start:t[N].start,end:Q})}for(let P=0;P<t.length;P++){let N=t[P].text,G=t[P-1]?.text;if(G==="."||t[P+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(N==="const"||N==="let"||N==="var"){let K=L(P+1),B=P+1,Q=!1,te=!1,ne=0;for(let ae=P+1;ae<=K;ae++){let me=t[ae]?.text;if(ae<K&&Cr.includes(me)&&i.has(ae)&&i.get(ae)<K){ae=i.get(ae);continue}if(ae<K&&me===":"&&!te)Q=!0;else if(ae<K&&me==="="&&ne===0)Q=!1,te=!0;else if(ae<K&&Q&&me==="<")ne++;else if(ae<K&&Q&&me===">"&&ne>0)ne--;else if(ae===K||me===","&&ne===0)y(B,ae,T,N==="var"),B=ae+1,Q=!1,te=!1}}else if(N==="function"||N==="class"){let K=P+1;if(t[K]?.text==="*")K++;if(t[K]&&at.test(t[K].text)&&t[K].text!=="extends")T.add(t[K].text),c.push({name:t[K].text,token:K})}else if(N==="import"){let K=P+1;if(t[K]?.text==="*"&&t[K+1]?.text==="as")K+=2;let B=t[K]?.text;if(B&&at.test(B)&&B!=="type"&&t[K+1]?.text!=="("&&t[K+1]?.text!==".")T.add(B),c.push({name:B,token:K,file:!0});let Q=t[K]?.text==="{"?K:t[K+1]?.text===","&&t[K+2]?.text==="{"?K+2:-1;if(Q!==-1&&i.has(Q)){let te=i.get(Q);for(let[ne,ae]of l(Q+1,te)){let me=ae-1;while(me>=ne&&!at.test(t[me].text))me--;if(me>=ne&&t[me].text!=="type")c.push({name:t[me].text,token:me,file:!0})}}}}return Tr=e,In={code:n,scopes:M,loops:D,declarations:T,sites:c,tokens:t,pairs:i},In}function as(e){let n=os(e);return{code:n.code,shadows:(t,i)=>n.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function On(e){return new Set(os(e).declarations)}function cn(e,n){let{scopes:t,loops:i,sites:a,tokens:l,pairs:c}=os(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 P=l[D].text;if(P==="{"&&c.has(D))v.push(D);else if(P==="}"&&v.length&&c.get(D)===v[v.length-1])v.pop()}let R=new Set,T=new Map;for(let D of a){if(!n.has(D.name))continue;R.add(D.token);let P=D.file?-1:y[D.token],N=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(D.functionScoped){let K=l[D.token].start,B=t.filter((Q)=>Q.functionBody&&K>=Q.bodyStart&&K<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];N=B?[B.bodyStart,B.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let K=i.filter((B)=>D.token>B.headStart&&D.token<B.headEnd).sort((B,Q)=>B.headEnd-B.headStart-(Q.headEnd-Q.headStart))[0];if(K)N=[K.start,K.end]}let G=T.get(D.name);if(G)G.push(N);else T.set(D.name,[N])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let P=D+1;if(l[P]?.text==="type")P++;if(l[P]&&at.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let N=P+1;N<c.get(P);N++)M.add(N)}let L=new Set;for(let D=0;D<l.length;D++){let P=l[D].text;if(!n.has(P)||L.has(P)||R.has(D)||M.has(D))continue;let N=l[D-1]?.text;if(N==="#"||N==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(N==="{"||N===","))continue;let G=l[D].start;if(T.get(P)?.some(([K,B])=>G>=K&&G<B))continue;if(t.some((K)=>G>=K.start&&G<K.end&&K.names.has(P)))continue;L.add(P)}return L}var Pe="0.2.708";var Ir=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Po(){let e=globalThis;return e[Ir]??=new Map,e[Ir]}function o(e,n){let t=Po(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let l=n();return t.set(i,l),l.catch(()=>{if(t.get(i)===l)t.delete(i)}),l}var Mo=/<\/(script)/gi;function ln(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Mo,"<\\/$1")}import Mr from"fs";class V{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(n):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,Do=500;function $t(e,n){if(n?.includes("g"))return new RegExp(e,n);let t=`${e}:${n||""}`;if(!St.has(t)){if(St.size>=Do){let i=St.keys().next().value;if(i)St.delete(i)}St.set(t,new RegExp(e,n))}return St.get(t)}class Or{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),t=n.sort().join(","),i=this.pool.find((y)=>y.context.join(",")===t);if(i)return i.func;let a=this.fnCache,l=this.fnCacheMaxSize,c=(...y)=>(v)=>{try{let R=`${t}:${v}`,T=a.get(R);if(!T){if(a.size>=l){let M=a.keys().next().value;if(M)a.delete(M)}T=Function(...n,`
115
+ `+a.slice(c);else a+=l;return a}function kr(e,n){let t=new Set;for(let i of e.split(",")){let a=i.trim().replace(/^\.\.\./,"").trim();if(!a)continue;if(n){let l=a.lastIndexOf(":");if(l!==-1)a=a.slice(l+1).trim()}if(a=a.split("=")[0].trim(),/^[A-Za-z_$][\w$]*$/.test(a))t.add(a)}return t}function Tt(e,n){let t=s(e),{depths:i,balanced:a}=ge(t),l=(y)=>!a||i[y]===0,c=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let y of t.matchAll(c)){let v=(y.index??0)+y[0].length-y[1].length;if(l(v))return!0}for(let y of t.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(y.index??0)&&kr(y[1],!0).has(n))return!0;for(let y of t.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(y.index??0)&&kr(y[1],!1).has(n))return!0;return!1}var Tr="",In,at=/^[A-Za-z_$][\w$]*$/,Co=new Set(["if","for","while","switch","with"]),Cr=["(","[","{"],Ar=[")","]","}"],Ao=new Set(["const","let","var","return","if","for","while","do","switch","try","throw","export"]);function Io(e){let n=s(e),t=[];for(let i of n.matchAll(/[A-Za-z_$][\w$]*|=>|\.\.\.|[^\s]/g)){let a=i.index??0;t.push({text:i[0],start:a,end:a+i[0].length})}return{code:n,tokens:t}}function os(e){if(In&&e===Tr)return In;let{code:n,tokens:t}=Io(e),i=new Map,a=[];for(let P=0;P<t.length;P++){let N=t[P].text;if(["(","[","{"].includes(N))a.push(P);else if([")","]","}"].includes(N)){let G=a.at(-1);if(G!==void 0&&["()","[]","{}"].includes(t[G].text+N))a.pop(),i.set(G,P),i.set(P,G)}}function l(P,N){let G=[],K=P;for(let B=P;B<N;B++){if(["(","[","{"].includes(t[B].text)&&(i.get(B)??N)<N){B=i.get(B);continue}if(t[B].text===",")G.push([K,B]),K=B+1}return G.push([K,N]),G}let c=[];function y(P,N,G,K=!1){if(t[P]?.text==="...")P++;if(P>=N)return;let B=t[P].text;if(at.test(B)){if(G.add(B),G===T)c.push({name:B,token:P,functionScoped:K});return}if(B!=="{"&&B!=="[")return;let Q=i.get(P);if(Q===void 0||Q>=N)return;for(let[te,ne]of l(P+1,Q)){let ae=te;if(B==="{")for(let me=te;me<ne;me++){if(t[me].text===":"){ae=me+1;break}if(t[me].text==="=")break;if(["(","[","{"].includes(t[me].text)&&i.has(me))me=i.get(me)}y(ae,ne,G,K)}}function v(P,N){let G=new Set;for(let[K,B]of l(P,N))y(K,B,G);return G}function R(P){let N=P;for(;N<t.length;N++){let G=t[N].text;if(["(","[","{"].includes(G)&&i.has(N)){N=i.get(N);continue}if([",",";",")","]","}"].includes(G))break}return t[Math.max(P,N-1)]?.end??n.length}let T=new Set,M=[];for(let P=0;P<t.length;P++)if(t[P].text==="=>"){let N=P-1,G=N,K;if(t[N]?.text===")"&&i.has(N))G=i.get(N),K=v(G+1,N);else if(t[N]&&at.test(t[N].text))K=new Set([t[N].text]);else continue;let B=P+1,Q=t[B]?.text==="{"&&i.has(B)?t[i.get(B)].end:R(B);M.push({start:t[G].start,end:Q,bodyStart:t[B]?.start??Q,functionBody:!0,names:K})}else if(t[P].text==="("&&i.has(P)){let N=t[P-1]?.text;if(!N||Co.has(N)||!at.test(N)&&N!=="*"&&N!=="]")continue;let G=i.get(P),K=G+1;if(t[K]?.text===":"){K++;while(K<t.length&&!["{","=>",";","="].includes(t[K].text))K++}if(t[K]?.text!=="{"||!i.has(K))continue;M.push({start:t[P].start,end:t[i.get(K)].end,bodyStart:t[K].start,functionBody:N!=="catch",names:v(P+1,G)})}function L(P){let N=P;for(;N<t.length;N++){let G=t[N].text;if(Cr.includes(G)&&i.has(N)){N=i.get(N);continue}if(G===";"||Ar.includes(G))break;let K=t[N-1];if(N>P&&Ao.has(G)&&K.text!==".")break;if(N>P&&/[\n\r]/.test(n.slice(K.end,t[N].start))&&(/^[\w$]+$/.test(K.text)||Ar.includes(K.text)||['"',"'","`"].includes(K.text))&&at.test(G)&&!["in","of","instanceof"].includes(G))break}return N}let D=[];for(let P=0;P<t.length;P++){if(t[P].text!=="for")continue;let N=t[P+1]?.text==="await"?P+2:P+1;if(t[N]?.text!=="("||!i.has(N))continue;let G=i.get(N),K=G+1,B=t[K]?.text==="{"&&i.has(K)?i.get(K):L(K),Q=t[B]?.text===";"||t[B]?.text==="}"?t[B].end:t[Math.max(K,B-1)]?.end??n.length;D.push({headStart:N,headEnd:G,start:t[N].start,end:Q})}for(let P=0;P<t.length;P++){let N=t[P].text,G=t[P-1]?.text;if(G==="."||t[P+1]?.text===":")continue;if(G==="as"||G==="<")continue;if(N==="const"||N==="let"||N==="var"){let K=L(P+1),B=P+1,Q=!1,te=!1,ne=0;for(let ae=P+1;ae<=K;ae++){let me=t[ae]?.text;if(ae<K&&Cr.includes(me)&&i.has(ae)&&i.get(ae)<K){ae=i.get(ae);continue}if(ae<K&&me===":"&&!te)Q=!0;else if(ae<K&&me==="="&&ne===0)Q=!1,te=!0;else if(ae<K&&Q&&me==="<")ne++;else if(ae<K&&Q&&me===">"&&ne>0)ne--;else if(ae===K||me===","&&ne===0)y(B,ae,T,N==="var"),B=ae+1,Q=!1,te=!1}}else if(N==="function"||N==="class"){let K=P+1;if(t[K]?.text==="*")K++;if(t[K]&&at.test(t[K].text)&&t[K].text!=="extends")T.add(t[K].text),c.push({name:t[K].text,token:K})}else if(N==="import"){let K=P+1;if(t[K]?.text==="*"&&t[K+1]?.text==="as")K+=2;let B=t[K]?.text;if(B&&at.test(B)&&B!=="type"&&t[K+1]?.text!=="("&&t[K+1]?.text!==".")T.add(B),c.push({name:B,token:K,file:!0});let Q=t[K]?.text==="{"?K:t[K+1]?.text===","&&t[K+2]?.text==="{"?K+2:-1;if(Q!==-1&&i.has(Q)){let te=i.get(Q);for(let[ne,ae]of l(Q+1,te)){let me=ae-1;while(me>=ne&&!at.test(t[me].text))me--;if(me>=ne&&t[me].text!=="type")c.push({name:t[me].text,token:me,file:!0})}}}}return Tr=e,In={code:n,scopes:M,loops:D,declarations:T,sites:c,tokens:t,pairs:i},In}function as(e){let n=os(e);return{code:n.code,shadows:(t,i)=>n.scopes.some((a)=>i>=a.start&&i<a.end&&a.names.has(t))}}function On(e){return new Set(os(e).declarations)}function cn(e,n){let{scopes:t,loops:i,sites:a,tokens:l,pairs:c}=os(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 P=l[D].text;if(P==="{"&&c.has(D))v.push(D);else if(P==="}"&&v.length&&c.get(D)===v[v.length-1])v.pop()}let R=new Set,T=new Map;for(let D of a){if(!n.has(D.name))continue;R.add(D.token);let P=D.file?-1:y[D.token],N=P===-1?[0,Number.POSITIVE_INFINITY]:[l[P].start,l[c.get(P)].end];if(D.functionScoped){let K=l[D.token].start,B=t.filter((Q)=>Q.functionBody&&K>=Q.bodyStart&&K<Q.end).sort((Q,te)=>Q.end-Q.bodyStart-(te.end-te.bodyStart))[0];N=B?[B.bodyStart,B.end]:[0,Number.POSITIVE_INFINITY]}else if(!D.file){let K=i.filter((B)=>D.token>B.headStart&&D.token<B.headEnd).sort((B,Q)=>B.headEnd-B.headStart-(Q.headEnd-Q.headStart))[0];if(K)N=[K.start,K.end]}let G=T.get(D.name);if(G)G.push(N);else T.set(D.name,[N])}let M=new Set;for(let D=0;D<l.length;D++){if(l[D].text!=="import"||l[D-1]?.text===".")continue;let P=D+1;if(l[P]?.text==="type")P++;if(l[P]&&at.test(l[P].text)&&l[P+1]?.text===",")P+=2;if(l[P]?.text==="{"&&c.has(P))for(let N=P+1;N<c.get(P);N++)M.add(N)}let L=new Set;for(let D=0;D<l.length;D++){let P=l[D].text;if(!n.has(P)||L.has(P)||R.has(D)||M.has(D))continue;let N=l[D-1]?.text;if(N==="#"||N==="."&&l[D-2]?.text!=="..")continue;if(l[D+1]?.text===":"&&(N==="{"||N===","))continue;let G=l[D].start;if(T.get(P)?.some(([K,B])=>G>=K&&G<B))continue;if(t.some((K)=>G>=K.start&&G<K.end&&K.names.has(P)))continue;L.add(P)}return L}var Pe="0.2.710";var Ir=Symbol.for(`stx.lazy-module-promises.${Pe}`);function Po(){let e=globalThis;return e[Ir]??=new Map,e[Ir]}function o(e,n){let t=Po(),i=`${import.meta.url}\x00${e}`,a=t.get(i);if(a)return a;let l=n();return t.set(i,l),l.catch(()=>{if(t.get(i)===l)t.delete(i)}),l}var Mo=/<\/(script)/gi;function ln(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(Mo,"<\\/$1")}import Mr from"fs";class V{cache=new Map;maxSize;options;sizes;bytes=0;constructor(e=100,n){this.maxSize=e,this.options=n??null,this.sizes=n?new Map:null}get byteSize(){return this.bytes}setMaxBytes(e){if(!this.options)return;this.options={...this.options,maxBytes:e};while(this.bytes>e&&this.cache.size>0){let n=this.cache.keys().next().value;if(n===void 0)break;this.delete(n)}}get(e){if(!this.cache.has(e))return;let n=this.cache.get(e);return this.cache.delete(e),this.cache.set(e,n),n}set(e,n){if(this.cache.has(e))this.delete(e);let t=this.options?this.options.sizeOf(n):0;if(this.options&&t>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+t>this.options.maxBytes)){let i=this.cache.keys().next().value;if(i===void 0)break;this.delete(i)}if(this.cache.set(e,n),this.sizes)this.sizes.set(e,t),this.bytes+=t}has(e){return this.cache.has(e)}delete(e){if(this.sizes){let n=this.sizes.get(e);if(n!==void 0)this.bytes-=n,this.sizes.delete(e)}return this.cache.delete(e)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var St=new Map,Do=500;function $t(e,n){if(n?.includes("g"))return new RegExp(e,n);let t=`${e}:${n||""}`;if(!St.has(t)){if(St.size>=Do){let i=St.keys().next().value;if(i)St.delete(i)}St.set(t,new RegExp(e,n))}return St.get(t)}class Or{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(e){let n=Array.from(new Set(e)),t=n.sort().join(","),i=this.pool.find((y)=>y.context.join(",")===t);if(i)return i.func;let a=this.fnCache,l=this.fnCacheMaxSize,c=(...y)=>(v)=>{try{let R=`${t}:${v}`,T=a.get(R);if(!T){if(a.size>=l){let M=a.keys().next().value;if(M)a.delete(M)}T=Function(...n,`
116
116
  'use strict';
117
117
  try {
118
118
  return ${v};
@@ -193,7 +193,7 @@ else {
193
193
  // STX: auto-generated event bindings
194
194
  ${e.map((t,i)=>la(t,i)).join(`
195
195
  `)}`}function Br(e){let n=[],t=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,c=0;while(c<l){let y=i[c];if(y==="'"||y==='"'||y==="`"){let v=y;if(c++,v==="`"){let R=0;while(c<l){if(i[c]==="\\"){c+=2;continue}if(i[c]==="`"&&R===0){c++;break}if(i[c]==="$"&&i[c+1]==="{"){R++,c+=2;continue}if(i[c]==="}"&&R>0){R--,c++;continue}c++}}else while(c<l){if(i[c]==="\\"){c+=2;continue}if(i[c]===v){c++;break}c++}continue}if(y==="/"&&i[c+1]==="/"){while(c<l&&i[c]!==`
196
- `)c++;continue}if(y==="/"&&i[c+1]==="*"){c+=2;while(c<l-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(y==="{"){a++,c++;continue}if(y==="}"){a--,c++;continue}if(a===0){let v=i.slice(c),R=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let L=R[1];if(!L.startsWith("_")&&!t.has(L))n.push(L),t.add(L);c+=R[0].length;continue}let T=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){T[1].split(",").forEach((L)=>{let D=L.trim(),P=D.indexOf(":"),N=P>=0?D.slice(P+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(N&&!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N)}),c+=T[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let L=M[1];if(!L.startsWith("_")&&!t.has(L))n.push(L),t.add(L);c+=M[0].length;continue}}c++}return n}var fa=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 pa(e){let n=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let D;while((D=t.exec(L))!==null){let P=D[0];if(!fa.has(P))n.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)i(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=R.exec(e))!==null)i(l[1]);let T=/@model\s*=\s*["']([^"']*)["']/gi;while((l=T.exec(e))!==null)i(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)i(l[1]);return n}async function Me(e,n={}){let t=e,i="",a=!1,l=[],c=ei(t,{filePath:n.filePath,projectRoot:n.projectRoot});t=c.code;let y=ti(c.styles),v=Ot(t);t=v.code,l=[...v.imports,...v.models];let{hasUserImports:R,bundleClientScript:T}=await o("stx/client-script-bundler",()=>import("./chunk-2srb5f7t.js"));if(R(t))t=await T(t,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let Q=Ac(t);t=Q.code,i=Pc(Q.stxImports,Q.browserImports.filter((te)=>!l.includes(te)))}if(i=`${mn(t,n.serverData)}${i}`,t=A(t),!a&&Le(n.attrs||""))t=je(t);let M=ua(n.eventBindings||[]),L=(n.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(L),P=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(D){let Q=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${P}${Q?` ${Q}`:""}`;return`${y}<script ${te}>
196
+ `)c++;continue}if(y==="/"&&i[c+1]==="*"){c+=2;while(c<l-1&&!(i[c]==="*"&&i[c+1]==="/"))c++;c+=2;continue}if(y==="{"){a++,c++;continue}if(y==="}"){a--,c++;continue}if(a===0){let v=i.slice(c),R=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(R){let L=R[1];if(!L.startsWith("_")&&!t.has(L))n.push(L),t.add(L);c+=R[0].length;continue}let T=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(T){T[1].split(",").forEach((L)=>{let D=L.trim(),P=D.indexOf(":"),N=P>=0?D.slice(P+1).trim().split(/[\s=]/)[0]:D.split(/[\s=]/)[0];if(N&&!N.startsWith("_")&&!t.has(N))n.push(N),t.add(N)}),c+=T[0].length;continue}let M=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(M){let L=M[1];if(!L.startsWith("_")&&!t.has(L))n.push(L),t.add(L);c+=M[0].length;continue}}c++}return n}var fa=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 pa(e){let n=new Set,t=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let D;while((D=t.exec(L))!==null){let P=D[0];if(!fa.has(P))n.add(P)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let c=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=c.exec(e))!==null)i(l[1]);let y=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=y.exec(e))!==null)i(l[1]);let v=/@[a-z]+(?:\.[a-z]+)*\s*=\s*"([^"]*)"/gi;while((l=v.exec(e))!==null)i(l[1]);let R=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=R.exec(e))!==null)i(l[1]);let T=/@model\s*=\s*["']([^"']*)["']/gi;while((l=T.exec(e))!==null)i(l[1]);let M=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=M.exec(e))!==null)i(l[1]);return n}async function Me(e,n={}){let t=e,i="",a=!1,l=[],c=ei(t,{filePath:n.filePath,projectRoot:n.projectRoot});t=c.code;let y=ti(c.styles),v=Ot(t);t=v.code,l=[...v.imports,...v.models];let{hasUserImports:R,bundleClientScript:T}=await o("stx/client-script-bundler",()=>import("./chunk-vdbmvn1m.js"));if(R(t))t=await T(t,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let Q=Ac(t);t=Q.code,i=Pc(Q.stxImports,Q.browserImports.filter((te)=>!l.includes(te)))}if(i=`${mn(t,n.serverData)}${i}`,t=A(t),!a&&Le(n.attrs||""))t=je(t);let M=ua(n.eventBindings||[]),L=(n.attrs||"").trim(),D=/\btype\s*=\s*["']module["']/i.test(L),P=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(D){let Q=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),te=`type="module" data-stx-scoped${P}${Q?` ${Q}`:""}`;return`${y}<script ${te}>
197
197
  ${ln(`${i}${t}
198
198
  ${M}`)}
199
199
  </script>`}let N=mi(e),G=/function __stx_setup_/.test(t),K=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function B(Q){let te=Q.length>0?`
@@ -287,8 +287,8 @@ ${R.join(`
287
287
  `){let P=e[a];if(P==="\\"){a+=2;continue}if(P==="[")D=!0;else if(P==="]")D=!1;else if(P==="/"&&!D){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let D=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(D){let K=D[2].split(",").map((B)=>{let Q=B.trim().split(":");return Q[Q.length-1].trim()});for(let B of K)if(B&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(B)&&!t.has(B))n.push(B),t.add(B);return}let P=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(P){let K=P[2];if(!t.has(K))n.push(K),t.add(K);return}let N=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(N){let K=N[1];if(!t.has(K))n.push(K),t.add(K);return}let G=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(G){let K=G[1];if(!t.has(K))n.push(K),t.add(K)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){c(e[a]);continue}if(e[a]==="`"){y();continue}if(e[a]==="/"&&T()){M();continue}if(e[a]==="{"){i++,a++;continue}if(e[a]==="}"){i--,a++;continue}if(i===0&&/[a-z]/i.test(e[a])&&(a===0||/\s|[;{}()]/.test(e[a-1])))L();a++}return n}function bl(e){let n=[],t=0,i=0,a=null;for(let l=0;l<e.length;l++){let c=e[l];if(a){if(c==="\\"){l++;continue}if(c===a)a=null;continue}if(c==='"'||c==="'"||c==="`"){a=c;continue}if(c==="("||c==="["||c==="{")t++;else if(c===")"||c==="]"||c==="}")t--;else if(c===","&&t===0)n.push(e.slice(i,l)),i=l+1}if(i<e.length)n.push(e.slice(i));return n}function yl(e){let n=0,t=null;for(let i=0;i<e.length;i++){let a=e[i];if(t){if(a==="\\"){i++;continue}if(a===t)t=null;continue}if(a==='"'||a==="'"||a==="`"){t=a;continue}if(a==="("||a==="["||a==="{")n++;else if(a===")"||a==="]"||a==="}")n--;else if(a==="="&&n===0){let l=e[i-1],c=e[i+1];if(l==="!"||l==="<"||l===">"||l==="=")continue;if(c==="="||c===">")continue;return i}}return-1}function _l(e,n){try{let t=/=\s*(?:withDefaults\s*\([\s\S]*?defineProps|defineProps)\b/.exec(e);if(!t)return;let i=t.index-1;while(i>=0&&/\s/.test(e[i]))i--;if(e[i]!=="}")return;let a=i,l=0,c=-1;for(;i>=0;i--){let v=e[i];if(v==="}")l++;else if(v==="{"){if(l--,l===0){c=i;break}}}if(c===-1)return;let y=e.slice(c+1,a);for(let v of bl(y)){let R=v.trim();if(!R||R.startsWith("..."))continue;let T=yl(R);if(T===-1)continue;let M=R.slice(0,T).trim();if(!/^[A-Z_$][\w$]*$/i.test(M))continue;if(n[M]!==void 0)continue;let L=R.slice(T+1).trim();if(!L)continue;try{let D=Object.keys(n).filter(Mt),P=Function(...D,`"use strict"; return (${L});`);n[M]=P(...D.map((N)=>n[N]))}catch{}}}catch{}}var wl=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function qf(e,n){let t=e.match(/^(\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*)<([a-zA-Z][a-zA-Z0-9-]*)/s);if(!t)return null;let i=t[2].toLowerCase();if(!wl.has(i))return null;let a=new RegExp(`<\\/?${i}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),l=C(e,(R,T)=>(a.lastIndex=T,a.exec(R)?.index===T?a.lastIndex:-1));if(i==="span"&&/\sdata-stx-scope\s*=/.test(l[0]?.token||""))return null;let c=0,y=!1;for(let R of l){if(c+=R.token.startsWith("</")?-1:1,c<0)return null;if(c===0){if(e.slice(R.end).trim())return null;y=!0;break}}if(!y)return null;let v=t[0].length;return e.slice(0,v)+n+e.slice(v)}async function wr(e,n,t,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,c=(ne)=>ne.split("-").map((ae)=>ae.charAt(0).toUpperCase()+ae.slice(1)).join(""),y=t.__importedComponents;if(y){for(let ne of[l,l.toLowerCase(),c(l),z(l)])if(y.has(ne))return!0}let v=[...new Set([`${l}.stx`,`${c(l)}.stx`,`${z(l)}.stx`])],R=typeof a.root==="string"?le.resolve(a.root):void 0,T=R??le.dirname(i),M=[],L=(ne)=>{if(ne&&!M.includes(ne))M.push(ne)},D=t.__originalFilePath;if(D)L(le.join(le.dirname(D),"components"));L(n),L(a._rootComponentsDir),L(le.join(le.dirname(i),"components")),L(a.componentsDir);let P=a._targetComponentFallbackNames?.some((ne)=>ne.toLowerCase()===l.toLowerCase());if(!P)for(let ne of a._targetComponentDirs??[])L(ne);if(R)L(le.resolve(R,"resources/views/components")),L(le.resolve(R,"resources/components")),L(le.resolve(R,"src/components")),L(le.resolve(R,"components"));for(let ne of a._layerComponentDirs??[])L(ne);let N=a._pluginComponentDirs;if(Array.isArray(N))for(let ne of N)L(typeof ne==="string"?ne:null);if(L(a.fallbackComponentsDir),P)for(let ne of a._targetComponentDirs??[])L(ne);if(l.startsWith("./")||l.startsWith("../"))return r(le.resolve(le.dirname(i),`${l}.stx`));let G=Yi(le.resolve(import.meta.dir,"components")),K=M.map((ne)=>le.isAbsolute(ne)?ne:le.resolve(T,ne)),B=`${v.join("\x00")}\x00\x00${K.join("\x00")}`,Q=Ks.get(B);if(Q!==void 0)return Q;let te=!1;e:for(let ne of K){if(Yi(ne)===G)continue;for(let ae of v)if(await r(le.join(ne,ae))){te=!0;break e}}return Ks.set(B,te),te}function Yi(e){let n=Zs.get(e);if(n!==void 0)return n;let t=e;try{t=Js.realpathSync(e)}catch{}return Zs.set(e,t),t}function Kf(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function Ic(e){if(!e)return!1;let n=e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"");return/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/.test(n)}function Sl(e,n,t){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let c;try{c=E(a,n)}catch{return l}if(c===void 0||c===null)return"";let y=String(c);if(/<\/style/i.test(y))return console.warn(`[stx] a <style> expression in ${t??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return y};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var Qi=new Set;function eo(e,n,t,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&Qi.has(a))return;Qi.add(a);let l=n?` used in ${n}`:"",c=i?` Cause: ${i}.`:"",y=t.length>0?`
288
288
  searched:
289
289
  ${t.map((v)=>` - ${v}`).join(`
290
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${y}`)}function to(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function ri(e){let n=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)n.add(a[1]);t.lastIndex=0}return[...n]}async function Be(e,n,t,i,a,l,c,y=new Set,v,R=tt(a),T,M=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-8c4zbq1k.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let P=new Set(D);P.add(e);let N=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let G=N&&N!=="load"&&Kf(N)?N:"";try{let K=(ce)=>ce.split("-").map((re)=>re.charAt(0).toUpperCase()+re.slice(1)).join(""),B=M.endsWith(".stx")?M.slice(0,-4):M,Q=null,te=a.__importedComponents;if(te){let ce=[B,B.toLowerCase(),K(B),z(B)];for(let re of ce)if(te.has(re)){Q=te.get(re);break}}let ne=[];if(!Q){let ce=[`${B}.stx`,`${K(B)}.stx`,`${z(B)}.stx`],re=[...new Set(ce)],he=a.__originalFilePath,be=[];if(be.push(...c._layerComponentDirs??[]),he){let ye=le.join(le.dirname(he),"components");be.push(ye)}if(i)be.push(i);let Ke=c._rootComponentsDir;if(typeof Ke==="string"&&!be.includes(Ke))be.push(Ke);let Te=le.join(le.dirname(l),"components");if(!be.includes(Te))be.push(Te);if(c.componentsDir&&c.componentsDir!==i&&!be.includes(c.componentsDir))be.push(c.componentsDir);let it=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(B),et=(T?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Ut=Object.hasOwn(n,"checked")||Boolean(T?.reactiveProps?.includes("checked")),Qn=Object.hasOwn(n,"value")||Boolean(T?.reactiveProps?.includes("value")),dt=!et.includes("valuechange")&&(Ut||et.includes("change")&&!Qn),yt=c._nativeHostAttrs&&/^textinput$/i.test(B),_n=et.includes("update:value")&&!et.includes("input"),wn=c._nativeHostAttrs&&/^video$/i.test(B),Sn=Object.hasOwn(n,"src")||Boolean(T?.reactiveProps?.includes("src")),_t=Object.hasOwn(n,"source")||Boolean(T?.reactiveProps?.includes("source")),$n=wn&&Sn&&!_t&&(T?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),gt=(ye)=>Object.hasOwn(n,ye)||Boolean(T?.reactiveProps?.includes(ye)),En=c._nativeHostAttrs&&/^button$/i.test(B)&&(gt("symbol")||gt("iconOnly")||gt("title")&&!gt("label")&&!t.trim()),Ht=c._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===B.toLowerCase())&&(!it||dt)&&(!yt||_n)&&(!wn||$n)&&!En;for(let ye of Ht?[]:c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let nt=typeof c.root==="string"?le.resolve(c.root):void 0,bo=nt??le.dirname(l),wt=[];if(nt)wt.push(le.resolve(nt,"resources/views/components")),wt.push(le.resolve(nt,"resources/components")),wt.push(le.resolve(nt,"src/components")),wt.push(le.resolve(nt,"components"));wt.push(le.resolve(import.meta.dir,"components"));for(let ye of wt)if(!be.includes(ye))be.push(ye);let sr=c._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(c.fallbackComponentsDir&&!be.includes(c.fallbackComponentsDir))be.push(c.fallbackComponentsDir);if(Ht){for(let ye of c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return le.isAbsolute(ye)?ye:le.resolve(bo,ye)}))];be.length=0,be.push(...rr);let es=`${B}\x00${l}\x00${rr.join("\x00")}`,ts=Kn.get(es);if(ts)if(await r(ts))Q=ts;else Kn.delete(es);if(!Q&&(B.startsWith("./")||B.startsWith("../")))Q=le.resolve(le.dirname(l),`${B}.stx`),ne.push(Q);else if(!Q)for(let ye of be){if(!ye)continue;for(let kn of re){let Rn=le.join(ye,kn);if(ne.push(Rn),await r(Rn)){Q=Rn;break}}if(Q)break;if(!Q)try{let kn=await import("fs");if(!kn.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let yo=8,ns=[{path:ye,depth:0}];while(ns.length>0&&!Q){let Tn=ns.pop();if(Tn.depth>=yo)continue;let ir;try{ir=kn.readdirSync(Tn.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=le.join(Tn.path,Cn.name);for(let _o of re){let ss=le.join(or,_o);if(ne.push(ss),await r(ss)){Q=ss;break}}if(Q)break;ns.push({path:or,depth:Tn.depth+1})}}}catch{}if(Q)break}if(Q)Kn.set(es,Q)}if(!Q||!await r(Q))return eo(e,l,ne),to(e);v.add(Q);let ae;if(Qt.has(Q))ae=Qt.get(Q);else try{ae=await Bun.file(Q).text(),Qt.set(Q,ae)}catch(ce){let re=ce instanceof Error?ce.message:String(ce);return eo(e,l,[Q],re),to(e)}if(T)for(let ce of new Set([...Object.keys(n),...T.reactiveProps??[]])){let re=ce.toLowerCase();if(re.startsWith("aria-")||re.startsWith("data-"))continue;let he=ce.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${he}\\b`).test(ae))T.declaredProps.add(ce);if(new RegExp(`\\$props\\s*(?:\\.\\s*${he}\\b|\\[\\s*['"]${he}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${he}['"]`).test(ae))T.consumedProps?.add(ce)}let me=new Set(["__originalFilePath","__importedComponents",Dn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[ce,re]of Object.entries(a))if(!ce.startsWith("__")||me.has(ce))Ee[ce]=re;let Ce=R.length>0?{[Wn]:[...R]}:{},ze=t;if(t.includes("@include")){let{processIncludes:ce}=await o("stx/includes",()=>import("./chunk-9whmbfwx.js"));ze=await ce(t,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ze)){let{processComponents:ce}=await o("stx/component-renderer",()=>import("./chunk-4cs5t287.js"));ze=await ce(ze,{...a,__processedComponents:D,...Ce},l,c,v)}let $e=[];if(Ic(ze)){let{processExpressions:ce}=await o("stx/expressions",()=>import("./chunk-03p4w958.js")),re=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ce}:R.length>0?{...a,...Ce}:a;ze=ce(ze,re,l);for(let he of ze.matchAll(/\{\{([\s\S]*?)\}\}/g))$e.push(he[1].trim())}let st=X(ze),ct=[],tn=st.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ce,re)=>{let he=st.scripts[Number(re)]||"",be=he.match(/^<script\b([^>]*)>/i)?.[1]||"",Ke=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Te=!Ke||["module","text/javascript","application/javascript"].includes(Ke),it=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Te&&!it)return ct.push(he),"";return he}),{extractSlotContent:Xn}=await o("stx/slots",()=>import("./chunk-dedmk383.js")),lt=Xn(tn),ut={};if(lt.defaultSlot?.trim())ut.default=lt.defaultSlot;for(let[ce,re]of lt.namedSlots)ut[ce]=re.content;let ft=a.__stx_scope_seq??={n:0,key:Ps(String(a.__filename??l))},Ct=so(e,process.cwd()),rt=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,We={...Ee,$uid:rt,$native:c._nativeHostAttrs===!0,...n,props:n,slot:tn,$slots:ut,__processedComponents:P,__sections:{},__stx_signals_gate:xe(ae)||Ic(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...$e]};_l(ae,We);let Dt=ae,nn=de(Dt);if(nn)Dt=nn.content.trim();let Jn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,jt=[...ae.matchAll(Jn)];for(let[,ce,re]of jt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ce))Ie(re,Q,c.strict);let Xe=[],Lt=null,Gn=jt.some((ce)=>/\bserver\b/.test(ce[1]||"")&&/\bcache\b/.test(ce[1]||"")),xt=null,Ge=null,Bt=null,sn=0,zt=null;if(dl(c),Gn&&qs>0){let ce=gl({props:n,slot:ze,slotContext:t.trim()?ml(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((re)=>re.configFile),uid:rt});if(ce!==null){xt=`${Q}\x00${x(ae)}\x00${ce}`;let re=Zn.get(xt);if(re){for(let he of re.dependencies)v.add(he);if(Zr(a,re.clientFactories),ft.n+=re.uidsConsumed,re.preservedClientExpressions.length>0){let he=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let be of re.preservedClientExpressions)he.add(be);a.__stx_preserved_client_expressions=[...he]}return re.output}Ge=new Set(v),Bt=Hr(a),sn=ft.n,zt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Wt=new Set;for(let ce of jt){let re=ce[1]||"",he=ce[2]||"",be=re.includes("server");if(Le(re)&&he.trim())he=je(he);if(be&&he){for(let Te of Ne(he))Wt.add(Te);try{await L(he,We,Q,{onFailure:(Te)=>{if(Te.kind!=="unknown")Lt=Te.kind}})}catch(Te){}}if(!be){let Te=he.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),it=Te.includes("{{")&&Te.includes("}}"),et=Te.includes("{!!")&&Te.includes("!!}");if(it||et)Te=oi(Te,We,Q);let Ut=re.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Xe.push(`<script${Ut}>${Te}</script>`)}}let Ze=X(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ze?Ze[1]:"",Yn=Ze?Ze[2]:"",Ye="",ee=Ft&&/\bscoped\b/i.test(Ft);if(Ze)Ye=`<style${Ft}>${Sl(Yn,We,Q)}</style>`;let se=Dt;if(se=se.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ze)se=se.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ce=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,re=[];if(se=se.replace(ce,(he,be)=>{let Ke=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ke)re.push(`<style${Ke[1]}>${Ke[2]}</style>`);return""}),se=se.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),re.length>0)Ye=`${Ye}${re.join(`
291
- `)}`}if(t&&se.includes("{{ text || slot }}"))se=se.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-dedmk383.js")),{defaultSlot:_e,namedSlots:Re}=lt,Ve=c._nativeHostAttrs===!0&&Xe.length>0||Xe.some((ce)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ce)),pt=(ce)=>Ve?Ri(ce,rt):ce,nr=new Map([...Re].map(([ce,re])=>[ce,{...re,content:pt(re.content)}]));se=await ue(se,pt(_e),nr,We,Ve?rt:"");let rn=ri(Xe),on=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((ce)=>!Wt.has(ce));if(rn.length>0||on.length>0)We.__stx_client_signal_names=[...new Set([...on,...rn])];else delete We.__stx_client_signal_names;let Vt=R.filter((ce)=>!Wt.has(ce)&&!(ce in n));if(Vt.length>0)We[Wn]=Vt;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:le.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||Ve||Xe.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:xn}=await o("stx/process",()=>import("./chunk-3qnke2jb.js")),Qe=await xn(se,We,Q,an,v),bt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ce of Qe.matchAll(/\{\{([\s\S]*?)\}\}/g))bt.add(ce[1].trim());if(bt.size>0)a.__stx_preserved_client_expressions=[...bt];let qe=rt,Ue=Qe;if(Ve){let ce="";if(Object.keys(n).length>0)try{ce=` data-stx-props="${Us(JSON.stringify(n))}"`}catch{}let re=G?` stx-hydrate="${Us(G)}"`:"",he=Object.fromEntries(Object.entries(ut).map(([dt,yt])=>[dt,Boolean(yt)])),be=Object.keys(he).length>0?` data-stx-slots="${Us(JSON.stringify(he))}"`:"",Ke=` data-stx-scope="${qe}"${ce}${be}${re}`,Te=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Qe),it=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),et=Te?"span":"div",Ut=it&&c._nativeHostAttrs?' style="display:flex;flex:1;min-height:0;min-width:0"':Te||it?' style="display:contents"':"";Ue=qf(Qe,Ke)??`<${et}${Ke} data-stx-component-wrapper${Ut}>${Qe}</${et}>`;let Qn=await Promise.all(Xe.map(async(dt)=>{let yt=dt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return dt;let[,_n,wn]=yt,Sn=Xi(dt,We,Q);if(Sn!==null)return Sn;let _t=await El(wn,Q,c.buildMode==="compile"),$n=mn(_t.clientCode,De(We)),{vendorStyleTags:gt}=_t,En=$n?`function(__scopeId) {
290
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${c}${y}`)}function to(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}function ri(e){let n=new Set,t=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue)\s*(?:<[^>]*>)?\s*\(/g;for(let i of e){let a;while((a=t.exec(i))!==null)n.add(a[1]);t.lastIndex=0}return[...n]}async function Be(e,n,t,i,a,l,c,y=new Set,v,R=tt(a),T,M=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-wcj2rb7b.js")),D=y??new Set;if(D.has(e))return`[Circular component reference: ${e}]`;let P=new Set(D);P.add(e);let N=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let G=N&&N!=="load"&&Kf(N)?N:"";try{let K=(ce)=>ce.split("-").map((re)=>re.charAt(0).toUpperCase()+re.slice(1)).join(""),B=M.endsWith(".stx")?M.slice(0,-4):M,Q=null,te=a.__importedComponents;if(te){let ce=[B,B.toLowerCase(),K(B),z(B)];for(let re of ce)if(te.has(re)){Q=te.get(re);break}}let ne=[];if(!Q){let ce=[`${B}.stx`,`${K(B)}.stx`,`${z(B)}.stx`],re=[...new Set(ce)],he=a.__originalFilePath,be=[];if(be.push(...c._layerComponentDirs??[]),he){let ye=le.join(le.dirname(he),"components");be.push(ye)}if(i)be.push(i);let Ke=c._rootComponentsDir;if(typeof Ke==="string"&&!be.includes(Ke))be.push(Ke);let Te=le.join(le.dirname(l),"components");if(!be.includes(Te))be.push(Te);if(c.componentsDir&&c.componentsDir!==i&&!be.includes(c.componentsDir))be.push(c.componentsDir);let it=c._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(B),et=(T?.events??[]).map((ye)=>ye.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Ut=Object.hasOwn(n,"checked")||Boolean(T?.reactiveProps?.includes("checked")),Qn=Object.hasOwn(n,"value")||Boolean(T?.reactiveProps?.includes("value")),dt=!et.includes("valuechange")&&(Ut||et.includes("change")&&!Qn),yt=c._nativeHostAttrs&&/^textinput$/i.test(B),_n=et.includes("update:value")&&!et.includes("input"),wn=c._nativeHostAttrs&&/^video$/i.test(B),Sn=Object.hasOwn(n,"src")||Boolean(T?.reactiveProps?.includes("src")),_t=Object.hasOwn(n,"source")||Boolean(T?.reactiveProps?.includes("source")),$n=wn&&Sn&&!_t&&(T?.events??[]).every((ye)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(ye.replace(/^@/,"").split(".")[0])),gt=(ye)=>Object.hasOwn(n,ye)||Boolean(T?.reactiveProps?.includes(ye)),En=c._nativeHostAttrs&&/^button$/i.test(B)&&(gt("symbol")||gt("iconOnly")||gt("title")&&!gt("label")&&!t.trim()),Ht=c._targetComponentFallbackNames?.some((ye)=>ye.toLowerCase()===B.toLowerCase())&&(!it||dt)&&(!yt||_n)&&(!wn||$n)&&!En;for(let ye of Ht?[]:c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye);let nt=typeof c.root==="string"?le.resolve(c.root):void 0,bo=nt??le.dirname(l),wt=[];if(nt)wt.push(le.resolve(nt,"resources/views/components")),wt.push(le.resolve(nt,"resources/components")),wt.push(le.resolve(nt,"src/components")),wt.push(le.resolve(nt,"components"));wt.push(le.resolve(import.meta.dir,"components"));for(let ye of wt)if(!be.includes(ye))be.push(ye);let sr=c._pluginComponentDirs;if(Array.isArray(sr)){for(let ye of sr)if(typeof ye==="string"&&!be.includes(ye))be.push(ye)}if(c.fallbackComponentsDir&&!be.includes(c.fallbackComponentsDir))be.push(c.fallbackComponentsDir);if(Ht){for(let ye of c._targetComponentDirs??[])if(ye&&!be.includes(ye))be.push(ye)}let rr=[...new Set(be.map((ye)=>{if(!ye)return ye;return le.isAbsolute(ye)?ye:le.resolve(bo,ye)}))];be.length=0,be.push(...rr);let es=`${B}\x00${l}\x00${rr.join("\x00")}`,ts=Kn.get(es);if(ts)if(await r(ts))Q=ts;else Kn.delete(es);if(!Q&&(B.startsWith("./")||B.startsWith("../")))Q=le.resolve(le.dirname(l),`${B}.stx`),ne.push(Q);else if(!Q)for(let ye of be){if(!ye)continue;for(let kn of re){let Rn=le.join(ye,kn);if(ne.push(Rn),await r(Rn)){Q=Rn;break}}if(Q)break;if(!Q)try{let kn=await import("fs");if(!kn.statSync(ye,{throwIfNoEntry:!1})?.isDirectory())continue;let yo=8,ns=[{path:ye,depth:0}];while(ns.length>0&&!Q){let Tn=ns.pop();if(Tn.depth>=yo)continue;let ir;try{ir=kn.readdirSync(Tn.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=le.join(Tn.path,Cn.name);for(let _o of re){let ss=le.join(or,_o);if(ne.push(ss),await r(ss)){Q=ss;break}}if(Q)break;ns.push({path:or,depth:Tn.depth+1})}}}catch{}if(Q)break}if(Q)Kn.set(es,Q)}if(!Q||!await r(Q))return eo(e,l,ne),to(e);v.add(Q);let ae;if(Qt.has(Q))ae=Qt.get(Q);else try{ae=await Bun.file(Q).text(),Qt.set(Q,ae)}catch(ce){let re=ce instanceof Error?ce.message:String(ce);return eo(e,l,[Q],re),to(e)}if(T)for(let ce of new Set([...Object.keys(n),...T.reactiveProps??[]])){let re=ce.toLowerCase();if(re.startsWith("aria-")||re.startsWith("data-"))continue;let he=ce.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${he}\\b`).test(ae))T.declaredProps.add(ce);if(new RegExp(`\\$props\\s*(?:\\.\\s*${he}\\b|\\[\\s*['"]${he}['"]\\s*\\])`).test(ae)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${he}['"]`).test(ae))T.consumedProps?.add(ce)}let me=new Set(["__originalFilePath","__importedComponents",Dn,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),Ee={};for(let[ce,re]of Object.entries(a))if(!ce.startsWith("__")||me.has(ce))Ee[ce]=re;let Ce=R.length>0?{[Wn]:[...R]}:{},ze=t;if(t.includes("@include")){let{processIncludes:ce}=await o("stx/includes",()=>import("./chunk-0fsf124j.js"));ze=await ce(t,a,l,c,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(ze)){let{processComponents:ce}=await o("stx/component-renderer",()=>import("./chunk-q5aptpc8.js"));ze=await ce(ze,{...a,__processedComponents:D,...Ce},l,c,v)}let $e=[];if(Ic(ze)){let{processExpressions:ce}=await o("stx/expressions",()=>import("./chunk-pp1beqrr.js")),re=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ce}:R.length>0?{...a,...Ce}:a;ze=ce(ze,re,l);for(let he of ze.matchAll(/\{\{([\s\S]*?)\}\}/g))$e.push(he[1].trim())}let st=X(ze),ct=[],tn=st.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(ce,re)=>{let he=st.scripts[Number(re)]||"",be=he.match(/^<script\b([^>]*)>/i)?.[1]||"",Ke=be.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Te=!Ke||["module","text/javascript","application/javascript"].includes(Ke),it=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${be}`);if(!/\bserver\b/i.test(be)&&Te&&!it)return ct.push(he),"";return he}),{extractSlotContent:Xn}=await o("stx/slots",()=>import("./chunk-07t75sa9.js")),lt=Xn(tn),ut={};if(lt.defaultSlot?.trim())ut.default=lt.defaultSlot;for(let[ce,re]of lt.namedSlots)ut[ce]=re.content;let ft=a.__stx_scope_seq??={n:0,key:Ps(String(a.__filename??l))},Ct=so(e,process.cwd()),rt=`stx_${(Ct.endsWith(".stx")?Ct.slice(0,-4):Ct).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,We={...Ee,$uid:rt,$native:c._nativeHostAttrs===!0,...n,props:n,slot:tn,$slots:ut,__processedComponents:P,__sections:{},__stx_signals_gate:xe(ae)||Ic(t),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...$e]};_l(ae,We);let Dt=ae,nn=de(Dt);if(nn)Dt=nn.content.trim();let Jn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,jt=[...ae.matchAll(Jn)];for(let[,ce,re]of jt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(ce))Ie(re,Q,c.strict);let Xe=[],Lt=null,Gn=jt.some((ce)=>/\bserver\b/.test(ce[1]||"")&&/\bcache\b/.test(ce[1]||"")),xt=null,Ge=null,Bt=null,sn=0,zt=null;if(dl(c),Gn&&qs>0){let ce=gl({props:n,slot:ze,slotContext:t.trim()?ml(Ee):void 0,buildMode:c.buildMode??"",skipEventDirectives:c.skipEventDirectives===!0,native:c._nativeHostAttrs===!0,clientLoopNames:[...R].sort(),layers:c._layerGraph?.layers.map((re)=>re.configFile),uid:rt});if(ce!==null){xt=`${Q}\x00${x(ae)}\x00${ce}`;let re=Zn.get(xt);if(re){for(let he of re.dependencies)v.add(he);if(Zr(a,re.clientFactories),ft.n+=re.uidsConsumed,re.preservedClientExpressions.length>0){let he=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let be of re.preservedClientExpressions)he.add(be);a.__stx_preserved_client_expressions=[...he]}return re.output}Ge=new Set(v),Bt=Hr(a),sn=ft.n,zt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let Wt=new Set;for(let ce of jt){let re=ce[1]||"",he=ce[2]||"",be=re.includes("server");if(Le(re)&&he.trim())he=je(he);if(be&&he){for(let Te of Ne(he))Wt.add(Te);try{await L(he,We,Q,{onFailure:(Te)=>{if(Te.kind!=="unknown")Lt=Te.kind}})}catch(Te){}}if(!be){let Te=he.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),it=Te.includes("{{")&&Te.includes("}}"),et=Te.includes("{!!")&&Te.includes("!!}");if(it||et)Te=oi(Te,We,Q);let Ut=re.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");Xe.push(`<script${Ut}>${Te}</script>`)}}let Ze=X(ae).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),Ft=Ze?Ze[1]:"",Yn=Ze?Ze[2]:"",Ye="",ee=Ft&&/\bscoped\b/i.test(Ft);if(Ze)Ye=`<style${Ft}>${Sl(Yn,We,Q)}</style>`;let se=Dt;if(se=se.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),Ze)se=se.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let ce=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,re=[];if(se=se.replace(ce,(he,be)=>{let Ke=be.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(Ke)re.push(`<style${Ke[1]}>${Ke[2]}</style>`);return""}),se=se.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),re.length>0)Ye=`${Ye}${re.join(`
291
+ `)}`}if(t&&se.includes("{{ text || slot }}"))se=se.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>t);let{applySlots:ue}=await o("stx/slots",()=>import("./chunk-07t75sa9.js")),{defaultSlot:_e,namedSlots:Re}=lt,Ve=c._nativeHostAttrs===!0&&Xe.length>0||Xe.some((ce)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(ce)),pt=(ce)=>Ve?Ri(ce,rt):ce,nr=new Map([...Re].map(([ce,re])=>[ce,{...re,content:pt(re.content)}]));se=await ue(se,pt(_e),nr,We,Ve?rt:"");let rn=ri(Xe),on=(Array.isArray(We.__stx_client_signal_names)?We.__stx_client_signal_names:[]).filter((ce)=>!Wt.has(ce));if(rn.length>0||on.length>0)We.__stx_client_signal_names=[...new Set([...on,...rn])];else delete We.__stx_client_signal_names;let Vt=R.filter((ce)=>!Wt.has(ce)&&!(ce in n));if(Vt.length>0)We[Wn]=Vt;let an={...c,_rootComponentsDir:c._rootComponentsDir||c.componentsDir,componentsDir:le.dirname(Q),skipSignalsRuntime:!0,skipEventDirectives:c._nativeHostAttrs===!0||Ve||Xe.length===0,defaultLayout:void 0};We.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:xn}=await o("stx/process",()=>import("./chunk-zc5e9bnh.js")),Qe=await xn(se,We,Q,an,v),bt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let ce of Qe.matchAll(/\{\{([\s\S]*?)\}\}/g))bt.add(ce[1].trim());if(bt.size>0)a.__stx_preserved_client_expressions=[...bt];let qe=rt,Ue=Qe;if(Ve){let ce="";if(Object.keys(n).length>0)try{ce=` data-stx-props="${Us(JSON.stringify(n))}"`}catch{}let re=G?` stx-hydrate="${Us(G)}"`:"",he=Object.fromEntries(Object.entries(ut).map(([dt,yt])=>[dt,Boolean(yt)])),be=Object.keys(he).length>0?` data-stx-slots="${Us(JSON.stringify(he))}"`:"",Ke=` data-stx-scope="${qe}"${ce}${be}${re}`,Te=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<span(?=[\s/>])/i.test(Qe),it=/^\s*(?:(?:<!--[\s\S]*?-->|\x00STX_HTML_COMMENT_\d+\x00)\s*)*<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),et=Te?"span":"div",Ut=it&&c._nativeHostAttrs?' style="display:flex;flex:1;min-height:0;min-width:0"':Te||it?' style="display:contents"':"";Ue=qf(Qe,Ke)??`<${et}${Ke} data-stx-component-wrapper${Ut}>${Qe}</${et}>`;let Qn=await Promise.all(Xe.map(async(dt)=>{let yt=dt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!yt)return dt;let[,_n,wn]=yt,Sn=Xi(dt,We,Q);if(Sn!==null)return Sn;let _t=await El(wn,Q,c.buildMode==="compile"),$n=mn(_t.clientCode,De(We)),{vendorStyleTags:gt}=_t,En=$n?`function(__scopeId) {
292
292
  ${$n}
293
293
  return (${_t.factoryBody})(__scopeId);
294
294
  }`:_t.factoryBody,Ht=G?null:gs(a,En),nt=Ht?`window.__stxComponentFactories[${JSON.stringify(Ht)}](${JSON.stringify(qe)});`:`(${En})(${JSON.stringify(qe)});`;if(G)return`${gt}<script type="stx/island" data-stx-island="${qe}" data-stx-scoped data-stx-owner="${qe}"${_n}>${nt}</script>`;return`${gt}<script data-stx-scoped data-stx-run="always" data-stx-owner="${qe}"${_n}>${nt}</script>`}));if(Ue=Ue+`
@@ -314,7 +314,7 @@ ${Se.yellow}${Se.bold}Message:${Se.reset} ${n}
314
314
  `,y)T+=`
315
315
  ${Se.blue}${Se.bold}Context:${Se.reset}
316
316
  ${Se.dim}${y}${Se.reset}
317
- `;return T}function fe(){Qt.clear(),Kn.clear(),Ks.clear(),Zs.clear(),Zn.clear()}function wh(){return{size:Qt.size,maxSize:500}}var Hs=w(128);async function El(e,n,t){let i=x(e,n,t),a=Hs.get(i);if(a){if(_s(a.deps))return a;Hs.delete(i)}let l=ei(e,{filePath:n,projectRoot:process.cwd()}),c=l.code,y=ti(l.styles);c=Ot(c).code;let{hasUserImports:v,bundleClientScript:R}=await o("stx/client-script-bundler",()=>import("./chunk-2srb5f7t.js")),T=[],M=!1;if(v(c)){let B=c;c=await R(B,n,{projectRoot:process.cwd(),minify:t,collectInputs:T}),M=c===B}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-cqnpjdc9.js"));c=L(c);let D=A(c),P=xl(D),N=new Set(F(D,!0).split(",").map((B)=>B.trim())),G=`function(__scopeId) {
317
+ `;return T}function fe(){Qt.clear(),Kn.clear(),Ks.clear(),Zs.clear(),Zn.clear()}function wh(){return{size:Qt.size,maxSize:500}}var Hs=w(128);async function El(e,n,t){let i=x(e,n,t),a=Hs.get(i);if(a){if(_s(a.deps))return a;Hs.delete(i)}let l=ei(e,{filePath:n,projectRoot:process.cwd()}),c=l.code,y=ti(l.styles);c=Ot(c).code;let{hasUserImports:v,bundleClientScript:R}=await o("stx/client-script-bundler",()=>import("./chunk-vdbmvn1m.js")),T=[],M=!1;if(v(c)){let B=c;c=await R(B,n,{projectRoot:process.cwd(),minify:t,collectInputs:T}),M=c===B}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-717bek8h.js"));c=L(c);let D=A(c),P=xl(D),N=new Set(F(D,!0).split(",").map((B)=>B.trim())),G=`function(__scopeId) {
318
318
  ${ot("const",[...qc,...P],D)}
319
319
  const __scope = window.stx._scopes = window.stx._scopes || {};
320
320
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{t,c}from"./chunk-xyyt8v1r.js";import{r,hn,h}from"./chunk-0jtrdgyv.js";import{Qe}from"./chunk-0myrwz84.js";import{ds,ps}from"./chunk-3t3p2c1t.js";import{sc,Mo,ls,us}from"./chunk-zjw6j2x0.js";import{tc,nc}from"./chunk-hmkg3xy0.js";import{vt}from"./chunk-am4wadh7.js";import{an,uc,pr,fr}from"./chunk-5n4qg8za.js";import{g}from"./chunk-0dve54ne.js";import{Vs}from"./chunk-zjaw79zp.js";import Q from"fs";import N from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,s={}){let{duration:i,delay:o,ease:n,direction:l,custom:d}={...B,...s};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
2
+ import{t,c}from"./chunk-xyyt8v1r.js";import{r,hn,h}from"./chunk-ev2asp1e.js";import{Qe}from"./chunk-3ps07041.js";import{ds,ps}from"./chunk-3t3p2c1t.js";import{sc,Mo,ls,us}from"./chunk-zjw6j2x0.js";import{tc,nc}from"./chunk-8jb55rfm.js";import{vt}from"./chunk-am4wadh7.js";import{an,uc,pr,fr}from"./chunk-5n4qg8za.js";import{g}from"./chunk-0dve54ne.js";import{Vs}from"./chunk-zjaw79zp.js";import Q from"fs";import N from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,s={}){let{duration:i,delay:o,ease:n,direction:l,custom:d}={...B,...s};if(e==="custom"&&d)return d;switch(e){case"fade":return`${l==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
3
3
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
4
4
  @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${l==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":l==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
5
5
  @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@@ -1307,6 +1307,6 @@ ${y}
1307
1307
  customElements.define('${s}', ${d});
1308
1308
  `}async function Ze(e,s,i,o){if(s.length<1)return c("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let n=s[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${n}.stx`),q.join(q.dirname(o),`${n}.stx`)]:[q.join(q.dirname(o),d,`${n}.stx`),q.join(process.cwd(),d,`${n}.stx`),q.join(q.dirname(o),`${n}.stx`)],u=null;for(let f of p)if(await r(f)){u=await Bun.file(f).text();break}if(!u)return c("WebComponent",`Component file not found: ${n}.stx`,t.FILE_NOT_FOUND);let m=Ft(u,n);return`<script type="module">
1309
1309
  ${qt(m)}
1310
- </script>`}var L={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:an,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},tc,nc,ds,ps,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Vs],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,s,i){let o=s||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),l=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,s){let i=s.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function wf(e,s){let i=!e.root,o=Ut(e.root,e.pagesDir,s);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${s}::${o.root}`;if(!et.has(n))et.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let n={};for(let l of ue){let d=e[l];if(typeof d==="string"&&d)n[l]=d}Se.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let l of ue){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Bt(d,n))continue;e[l]=N.join(n,d)}}for(let n of ue){let l=e[n];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[n]=N.resolve(s,l)}return e}function Jt(e,s){let i=Se.get(e);for(let o of ue){let n=e[o];if(typeof n!=="string"||!n)continue;let l=N.isAbsolute(n)?n:N.join(s,n);if(Q.existsSync(l))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(uc(e.stateDir),e.stateDir=pr(),e.cachePath=fr(e.cachePath),e.build)e.build.cacheDir=fr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=fr(e.media.cache.directory);if(e.story)e.story.outDir=fr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function No(e,s=Ht){try{return await s(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let s=e?N.resolve(e):process.cwd(),i=de.get(s);if(i&&i.signature!==ls(i.graph)){let l=Y.get(s);if(Y.delete(s),de.delete(s),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-3907sad1.js"),{partialsCache:p}=await import("./chunk-9whmbfwx.js");if(d(),p.clear(),l&&i.configSignature===us(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await Mo(y,s),de.set(s,{graph:y,signature:ls(y),configSignature:us(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(s,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(s);if(o)return o;let n=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(s,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(s,"config",`ui${v}`))),u;if(d&&p){let v=await No({name:"ui",cwd:N.join(s,"config"),defaultConfig:L,errorPolicy:"throw",verbose:!1});u=(await No({name:"stx",alias:"ui",cwd:s,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await No({name:"stx",alias:"ui",cwd:s,defaultConfig:L,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await sc(s,L);u=v.config,de.set(s,{graph:v.graph,signature:ls(v.graph),configSignature:us(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-2snfd93r.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-w8yv9hnf.js");await b(s,u.runtimeConfig)}Kt(u),Gt(u),wf(u,s),Jt(u,s);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[s]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-sy1btryy.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[s]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(s,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1310
+ </script>`}var L={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:an,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},tc,nc,ds,ps,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Vs],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,s,i){let o=s||"pages";if(e)return{root:e,pagesDir:o};let n=i||process.cwd(),l=N.join(n,"resources","views"),d=N.join(n,"resources","layouts");if(Q.existsSync(l)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(n,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,s){let i=s.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),n=i.replace(/\\/g,"/");return o===n||o.startsWith(`${n}/`)}function wf(e,s){let i=!e.root,o=Ut(e.root,e.pagesDir,s);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let n=`${s}::${o.root}`;if(!et.has(n))et.add(n),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let n={};for(let l of ue){let d=e[l];if(typeof d==="string"&&d)n[l]=d}Se.set(e,n)}if(e.root&&e.root!=="."){let n=e.root;for(let l of ue){let d=e[l];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Bt(d,n))continue;e[l]=N.join(n,d)}}for(let n of ue){let l=e[n];if(typeof l!=="string"||!l||N.isAbsolute(l))continue;e[n]=N.resolve(s,l)}return e}function Jt(e,s){let i=Se.get(e);for(let o of ue){let n=e[o];if(typeof n!=="string"||!n)continue;let l=N.isAbsolute(n)?n:N.join(s,n);if(Q.existsSync(l))continue;let d=i?.[o]??n,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${l}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(uc(e.stateDir),e.stateDir=pr(),e.cachePath=fr(e.cachePath),e.build)e.build.cacheDir=fr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=fr(e.media.cache.directory);if(e.story)e.story.outDir=fr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function No(e,s=Ht){try{return await s(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let s=e?N.resolve(e):process.cwd(),i=de.get(s);if(i&&i.signature!==ls(i.graph)){let l=Y.get(s);if(Y.delete(s),de.delete(s),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-9yn3nsr1.js"),{partialsCache:p}=await import("./chunk-0fsf124j.js");if(d(),p.clear(),l&&i.configSignature===us(i.graph)){let u=l.then(async(m)=>{let y={...i.graph};await Mo(y,s),de.set(s,{graph:y,signature:ls(y),configSignature:us(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(s,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(s);if(o)return o;let n=(async()=>{let l=[".ts",".js",".mjs",".cjs",".json"],d=l.some((v)=>Q.existsSync(N.join(s,`stx.config${v}`))),p=l.some((v)=>Q.existsSync(N.join(s,"config",`ui${v}`))),u;if(d&&p){let v=await No({name:"ui",cwd:N.join(s,"config"),defaultConfig:L,errorPolicy:"throw",verbose:!1});u=(await No({name:"stx",alias:"ui",cwd:s,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await No({name:"stx",alias:"ui",cwd:s,defaultConfig:L,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await sc(s,L);u=v.config,de.set(s,{graph:v.graph,signature:ls(v.graph),configSignature:us(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-2snfd93r.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-s6mzv28a.js");await b(s,u.runtimeConfig)}Kt(u),Gt(u),wf(u,s),Jt(u,s);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[s]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-sy1btryy.js"),b=[],x=[];for(let k of f){let S=typeof k==="string"?k:k[0],_=typeof k==="string"?{}:k[1]||{};try{let A,E;try{let w=g.resolve(S,{paths:[s]});A=await import(w),E=N.dirname(w)}catch{let w=N.resolve(s,S);A=await import(w),E=N.dirname(w)}let I=A.default||A;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(N.resolve(E,C))}if(I.pages){let w=N.resolve(E,I.pages),C=_.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(_,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
1311
  `)}catch(A){console.warn(`[stx] Failed to load plugin ${S}:`,A.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(s,n),n.catch(()=>{if(Y.get(s)===n)Y.delete(s)}),!e)se=n,n.then((l)=>{K=l}).catch(()=>{});return n}var P=new Proxy(L,{get(e,s){if(K&&s in K)return K[s];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[s]}});function ph(e){return e}function fh(e){let s=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")s.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")s.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")s.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")s.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)s.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)s.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))s.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))s.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)s.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)s.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))s.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))s.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))s.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))s.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")s.push({path:`customDirectives[${n}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")s.push({path:`customDirectives[${n}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))s.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,n)=>{if(!o.name||typeof o.name!=="string")s.push({path:`middleware[${n}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")s.push({path:`middleware[${n}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))s.push({path:`middleware[${n}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)s.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))s.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))s.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((n,l)=>{if(!n.pattern||typeof n.pattern!=="string")s.push({path:`pwa.routes[${l}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(n.strategy))s.push({path:`pwa.routes[${l}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(n.maxAgeSeconds!==void 0&&(typeof n.maxAgeSeconds!=="number"||n.maxAgeSeconds<0))s.push({path:`pwa.routes[${l}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(n.maxEntries!==void 0&&(typeof n.maxEntries!=="number"||n.maxEntries<1))s.push({path:`pwa.routes[${l}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))s.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((n)=>typeof n!=="number"||n<16||n>1024).length>0)s.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((l)=>!o.includes(l)).length>0)s.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:s.length===0,errors:s,warnings:i}}
1312
1312
  export{Xa,Ja,cr,Ye,Ya,cs,L,wf,No,a,P,ph,fh};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Wr}from"./chunk-p3dkhz9v.js";import{a}from"./chunk-90kfvtf6.js";import{We,re}from"./chunk-t63f15yh.js";import{Oa}from"./chunk-rswg7xsg.js";import{g}from"./chunk-0dve54ne.js";import{existsSync as A,mkdirSync as x,copyFileSync as T,chmodSync as P,rmSync as ue}from"fs";import{join as c,basename as be,resolve as H}from"path";import{spawn as q}from"child_process";import{platform as ge}from"os";var Fm=`
2
+ import{Wr}from"./chunk-p3dkhz9v.js";import{a}from"./chunk-f134xm9v.js";import{We,re}from"./chunk-t63f15yh.js";import{Oa}from"./chunk-vq5z2b8n.js";import{g}from"./chunk-0dve54ne.js";import{existsSync as A,mkdirSync as x,copyFileSync as T,chmodSync as P,rmSync as ue}from"fs";import{join as c,basename as be,resolve as H}from"path";import{spawn as q}from"child_process";import{platform as ge}from"os";var Fm=`
3
3
  <script>
4
4
  (function() {
5
5
  'use strict';