@stacksjs/stx 0.2.899 → 0.2.901

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 (84) hide show
  1. package/dist/{chunk-hpqvq1r9.js → chunk-03ymcxsb.js} +1 -1
  2. package/dist/{chunk-9n5san33.js → chunk-0tzyr4cc.js} +1 -1
  3. package/dist/chunk-15qrs231.js +2 -0
  4. package/dist/{chunk-h2gnz7ja.js → chunk-1fxq73hk.js} +1 -1
  5. package/dist/{chunk-ft9h5qbs.js → chunk-235fkffb.js} +1 -1
  6. package/dist/chunk-3043ycz6.js +2 -0
  7. package/dist/{chunk-k352spys.js → chunk-52njxk3w.js} +1 -1
  8. package/dist/{chunk-rapr0m13.js → chunk-5hksy9tt.js} +1 -1
  9. package/dist/{chunk-8v2hsn4d.js → chunk-5qkd77vw.js} +1 -1
  10. package/dist/{chunk-jq49238b.js → chunk-6cnahhm1.js} +1 -1
  11. package/dist/{chunk-vgvxs1ag.js → chunk-6d10g8wf.js} +1 -1
  12. package/dist/{chunk-mjqsz20a.js → chunk-6fv02vzc.js} +1 -1
  13. package/dist/chunk-77nn1ckz.js +3 -0
  14. package/dist/{chunk-e5q1ammf.js → chunk-7tjfca0a.js} +1 -1
  15. package/dist/{chunk-1tb18a92.js → chunk-8kvqv885.js} +1 -1
  16. package/dist/{chunk-p4hm5srd.js → chunk-95tvzssr.js} +1 -1
  17. package/dist/{chunk-65rx54n6.js → chunk-9ehryt4w.js} +1 -1
  18. package/dist/{chunk-pd31ge72.js → chunk-9gjt51ac.js} +1 -1
  19. package/dist/{chunk-73nazfe5.js → chunk-9mjr6187.js} +1 -1
  20. package/dist/{chunk-avqxkbrd.js → chunk-a7x8897c.js} +1 -1
  21. package/dist/{chunk-7z1hqp86.js → chunk-at70apjf.js} +1 -1
  22. package/dist/{chunk-d1bwb2kz.js → chunk-bts9v10s.js} +1 -1
  23. package/dist/{chunk-2vqamyay.js → chunk-c05zj2m9.js} +1 -1
  24. package/dist/{chunk-3my2eef2.js → chunk-c2e4m8qq.js} +1 -1
  25. package/dist/{chunk-g065d7p7.js → chunk-ccgcj9tg.js} +1 -1
  26. package/dist/chunk-dvy101w4.js +2 -0
  27. package/dist/{chunk-4e28p8vf.js → chunk-e23yc82s.js} +4 -4
  28. package/dist/{chunk-3k4rteax.js → chunk-e42x1k6j.js} +1 -1
  29. package/dist/{chunk-v5v6w6rn.js → chunk-e9nyfgwk.js} +1 -1
  30. package/dist/{chunk-36mz0nwv.js → chunk-ecknsnr2.js} +1 -1
  31. package/dist/{chunk-gq3gttt5.js → chunk-ek4prrmd.js} +17 -17
  32. package/dist/{chunk-q6p96qq7.js → chunk-f32mtkqf.js} +4 -4
  33. package/dist/chunk-frf4qp4z.js +2 -0
  34. package/dist/{chunk-ytk4f2j9.js → chunk-frjpvdxn.js} +1 -1
  35. package/dist/{chunk-tga3nrn6.js → chunk-g4cs4dj8.js} +2 -2
  36. package/dist/{chunk-fsxk5fsh.js → chunk-gypna2zb.js} +2 -2
  37. package/dist/{chunk-4jtewn1v.js → chunk-h1bd9496.js} +1 -1
  38. package/dist/{chunk-40fpt0r6.js → chunk-hg31hs5d.js} +2 -2
  39. package/dist/chunk-kdh1s839.js +2 -0
  40. package/dist/{chunk-8rgy17fj.js → chunk-kmby9q2c.js} +2 -2
  41. package/dist/{chunk-e4xd1ca7.js → chunk-krdhn8h1.js} +1 -1
  42. package/dist/{chunk-70ez3njv.js → chunk-kxbk4505.js} +1 -1
  43. package/dist/{chunk-9jpsxqaf.js → chunk-kxh9rqdm.js} +1 -1
  44. package/dist/{chunk-javb4e3b.js → chunk-ndwvgwvs.js} +2 -2
  45. package/dist/{chunk-becs8132.js → chunk-ntvgvvrh.js} +1 -1
  46. package/dist/{chunk-9m45t60c.js → chunk-p80nnmha.js} +6 -6
  47. package/dist/{chunk-6hjcqaqr.js → chunk-pgqennwt.js} +1 -1
  48. package/dist/{chunk-0f2d61b3.js → chunk-pms1q3c6.js} +1 -1
  49. package/dist/{chunk-472w7t7p.js → chunk-q3we5jsk.js} +1 -1
  50. package/dist/{chunk-rrpfn9rr.js → chunk-qgcw5jy8.js} +1 -1
  51. package/dist/chunk-s43ty9bg.js +2 -0
  52. package/dist/{chunk-4wd5sn16.js → chunk-sn1qtgmc.js} +3 -3
  53. package/dist/{chunk-r9n86na1.js → chunk-sxkkxmkc.js} +10 -6
  54. package/dist/{chunk-dj8fyaea.js → chunk-v35zj9fq.js} +1 -1
  55. package/dist/{chunk-b6ctdvdf.js → chunk-vtan6nan.js} +2 -2
  56. package/dist/chunk-wkat7js9.js +2 -0
  57. package/dist/{chunk-q4yq72wh.js → chunk-xf2jf63c.js} +1 -1
  58. package/dist/{chunk-bmwcgmev.js → chunk-xk1pht3a.js} +1 -1
  59. package/dist/chunk-xr5xp6v0.js +2 -0
  60. package/dist/{chunk-e0bwzxfd.js → chunk-yar3c574.js} +4 -4
  61. package/dist/{chunk-eka2e4cm.js → chunk-ybpxtaft.js} +1 -1
  62. package/dist/{chunk-n8xjqsze.js → chunk-yf715phy.js} +1 -1
  63. package/dist/{chunk-cgqpn3e2.js → chunk-yjs11rre.js} +1 -1
  64. package/dist/{chunk-fe1wmmr5.js → chunk-ysncnbyf.js} +1 -1
  65. package/dist/cli.js +7 -7
  66. package/dist/craft-entry.js +1 -1
  67. package/dist/craft.js +1 -1
  68. package/dist/dev-server/serve-app.js +2 -1
  69. package/dist/native/runtime/craft-bridge.js +17 -3
  70. package/dist/native/runtime/craft.d.ts +1 -0
  71. package/dist/offline/app-service-worker.d.ts +2 -1
  72. package/dist/offline/app-service-worker.js +6 -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-3m37fzvh.js +0 -2
  77. package/dist/chunk-8a9gmbxa.js +0 -2
  78. package/dist/chunk-9vafweyd.js +0 -3
  79. package/dist/chunk-psyqrxg0.js +0 -2
  80. package/dist/chunk-ryp47rwp.js +0 -2
  81. package/dist/chunk-t9j000tb.js +0 -2
  82. package/dist/chunk-y10eaxgc.js +0 -2
  83. package/dist/chunk-zcys6b06.js +0 -2
  84. package/dist/chunk-zpwh9bpc.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ze,Dn,po,Gi,z}from"./chunk-esm0pnpz.js";import{Mn}from"./chunk-472w7t7p.js";import{Yr,C,Fl,xt,na,zl}from"./chunk-hdfhaddy.js";import{D}from"./chunk-7b3dqeyr.js";import{T,R}from"./chunk-0jdz31q1.js";import{Jr,wo,zn,Ll,Le}from"./chunk-5g5khx0m.js";import{fo,d,m,Hr,p,te,K,be,_,bt,yo,De,et,bo}from"./chunk-945zygwa.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-qykbjg3z.js";import{t,h}from"./chunk-68r2zs20.js";import{c}from"./chunk-p92272k0.js";import Ct from"path";import un from"process";import{AsyncLocalStorage as sc}from"async_hooks";var ti=new sc;function An(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ni(e,n){return ti.run(An(e),n)}async function si(e,n){let r=ti.getStore();if(!r)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=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Fr(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 X(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),G=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Xs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function rc(e,n=X(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(X(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Js(e,n){let r=`{ ${rc(e,n)} }`;return X(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import sn from"fs";import Ve from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ri=new Map;function Or(e,n=!0){let r=ri.get(e);if(n&&r)return r;let i=new Map,a=[Ve.join(e,"src"),Ve.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=sn.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ve.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ri.set(e,i);return i}function Ys(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ve.join(r,"node_modules",e);try{if(sn.statSync(i).isDirectory())return i}catch{}let a=Ve.dirname(r);if(a===r)return null;r=a}}function Zs(e,n,r={}){return[Ve.resolve(Ve.dirname(n),`${e}.stx`),Ve.resolve(Ve.dirname(n),e),Ve.resolve(r.componentsDir||"components",`${e}.stx`),Ve.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ii(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function $i(e,n){let[r,i,a]=ii(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Ri(e,n){let r=n?Ve.resolve(n):void 0,i=Ve.dirname(Ve.resolve(e));for(;;){if(sn.existsSync(Ve.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ve.dirname(i);if(a===i)return;i=a}}var ic=["src/ui","src/components","components","dist"];function rs(e,n){let r=Ve.resolve(e);if(!n&&!r.split(Ve.sep).includes("node_modules"))return[];let i=Ri(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(sn.readFileSync(Ve.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:ic;return[Ve.dirname(Ve.resolve(e)),...l.map((u)=>Ve.resolve(i,u))]}function*Ai(e,n,r={},i){let a=ii(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ve.resolve(Ve.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...rs(n,r.projectRoot),...i?.__originalFilePath?[Ve.join(Ve.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ve.join(Ve.dirname(n),"components"),Ve.resolve(u,"src/components"),Ve.resolve(u,"components"),...import.meta.dir?[Ve.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ve.join(v,S);try{for(let S of sn.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ve.join(v,S.name,I)}catch{}}}function oi(e,n,r={},i){let a=$i(e,i);if(a!==void 0)return a;for(let l of Ai(e,n,r,i))try{if(sn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Qs(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Is from"fs";import xe from"path";import Bt from"path";import _n from"fs";var oc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Us(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return oc.has(e.toLowerCase())}var ai=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"]),ci={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"},ac=new Set(["ctrl","alt","shift","meta"]),pi={left:0,middle:1,right:2};function li(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 r of e){let i=r.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(ac.has(i))n.systemKeys.push(i);else if(i in pi)n.mouse=i;else if(i in ci||/^[a-z]$/.test(i))n.keys.push(ci[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 fi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function cc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=pi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function lc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Hs(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 uc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=cc(e),a=lc(Hs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Us(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t");if(e.event==="mounted")return`
2
+ import{Ze,Dn,po,Gi,z}from"./chunk-esm0pnpz.js";import{Mn}from"./chunk-q3we5jsk.js";import{Yr,C,Fl,xt,na,zl}from"./chunk-hdfhaddy.js";import{D}from"./chunk-7b3dqeyr.js";import{T,R}from"./chunk-0jdz31q1.js";import{Jr,wo,zn,Ll,Le}from"./chunk-5g5khx0m.js";import{fo,d,m,Hr,p,te,K,be,_,bt,yo,De,et,bo}from"./chunk-945zygwa.js";import{w}from"./chunk-v6gkjg5f.js";import{ne}from"./chunk-qykbjg3z.js";import{t,h}from"./chunk-68r2zs20.js";import{c}from"./chunk-p92272k0.js";import Ct from"path";import un from"process";import{AsyncLocalStorage as sc}from"async_hooks";var ti=new sc;function An(e){return e.__stx_server_data??={pending:new Map,values:new Map}}function ni(e,n){return ti.run(An(e),n)}async function si(e,n){let r=ti.getStore();if(!r)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=r.pending.get(e);if(i)return i;let a=Promise.resolve().then(n).then((l)=>{let u=JSON.stringify(l,(v,S)=>{if(S===void 0||typeof S==="function"||typeof S==="symbol"||typeof S==="bigint"||typeof S==="number"&&!Number.isFinite(S))throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);if(S&&typeof S==="object"&&!Array.isArray(S)&&Object.getPrototypeOf(S)!==Object.prototype&&Object.getPrototypeOf(S)!==null)throw TypeError(`useServerData(${JSON.stringify(e)}) requires JSON-serializable data`);return S}),f=JSON.parse(u);return r.values.set(e,f),f}).catch((l)=>{throw r.pending.delete(e),l});return r.pending.set(e,a),a}function Fr(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 X(e,n=!1){let r=t(e),i=[],a=new Set,l=0,u=0,f=r.length,v=()=>{if(l!==0)return;let S=r.slice(u).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*(?:[!:;,\n]|=(?!=)|$)/);if(S){if(n&&S[1]==="const")return;let V=S[2];if(!a.has(V))i.push(V),a.add(V);return}let I=r.slice(u).match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){if(n&&r.slice(u).startsWith("const"))return;I[1].split(",").forEach((V)=>{let W=V.trim();if(!W)return;let Z=W.indexOf(":"),G=(Z>=0?W.slice(Z+1).trim():W).split(/[\s=]/)[0];if(G&&!a.has(G))i.push(G),a.add(G)});return}let j=r.slice(u).match(/^(?:const|let|var)\s+\[([^\]]+)\]\s*=/);if(j){if(n&&r.slice(u).startsWith("const"))return;j[1].split(",").forEach((V)=>{let W=V.trim().replace(/^\.\.\./,"");if(!W)return;let Z=W.split(/[\s=]/)[0];if(Z&&!a.has(Z))i.push(Z),a.add(Z)});return}if(n)return;let L=r.slice(u).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(L){let V=L[1];if(!a.has(V))i.push(V),a.add(V);return}let M=r.slice(u).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(M){let V=M[1];if(!a.has(V))i.push(V),a.add(V)}};while(u<f){if(r[u]==="{"){l++,u++;continue}if(r[u]==="}"){l--,u++;continue}if(l===0&&/[a-z]/i.test(r[u])&&(u===0||/\s|[;{}()]/.test(r[u-1])))v();u++}return i.join(", ")}function Xs(e){return`{ enumerable: true, configurable: true, get() { return ${e} }, set(__stxValue_${e}) { ${e} = __stxValue_${e} } }`}function rc(e,n=X(e).split(",").map((r)=>r.trim()).filter(Boolean)){let r=new Set(X(e,!0).split(",").map((i)=>i.trim()));return n.map((i)=>r.has(i)?`get ${i}() { return ${i} }, set ${i}(__stxValue_${i}) { ${i} = __stxValue_${i} }`:i).join(", ")}function Js(e,n){let r=`{ ${rc(e,n)} }`;return X(e).split(",").some((i)=>i.trim()==="__stxLiveBindings")?`Object.defineProperties(${r}, Object.getOwnPropertyDescriptors(__stxLiveBindings))`:r}import sn from"fs";import Ve from"path";function J(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").toLowerCase()}var ri=new Map;function Or(e,n=!0){let r=ri.get(e);if(n&&r)return r;let i=new Map,a=[Ve.join(e,"src"),Ve.join(e,"dist"),e];function l(u,f){if(f>6)return;let v;try{v=sn.readdirSync(u,{withFileTypes:!0})}catch{return}for(let S of v){let I=Ve.join(u,S.name);if(S.isDirectory()){if(S.name==="node_modules"||S.name.startsWith("."))continue;l(I,f+1)}else if(S.isFile()&&S.name.endsWith(".stx")){let j=S.name.slice(0,-4);if(!i.has(j))i.set(j,I);let L=j.toLowerCase();if(!i.has(L))i.set(L,I);let M=J(j);if(!i.has(M))i.set(M,I)}}}for(let u of a)if(l(u,0),i.size>0)break;if(n)ri.set(e,i);return i}function Ys(e,n){if(e.startsWith(".")||e.startsWith("/"))return null;let r=n;while(!0){let i=Ve.join(r,"node_modules",e);try{if(sn.statSync(i).isDirectory())return i}catch{}let a=Ve.dirname(r);if(a===r)return null;r=a}}function Zs(e,n,r={}){return[Ve.resolve(Ve.dirname(n),`${e}.stx`),Ve.resolve(Ve.dirname(n),e),Ve.resolve(r.componentsDir||"components",`${e}.stx`),Ve.resolve(r.componentsDir||"components",e),e.endsWith(".stx")?e:`${e}.stx`]}function ii(e){let n=e.endsWith(".stx")?e.slice(0,-4):e,r=n.split("-").map((a)=>a.charAt(0).toUpperCase()+a.slice(1)).join(""),i=J(n);return[n,r,i]}function $i(e,n){let[r,i,a]=ii(e);for(let l of[r,r.toLowerCase(),i,a]){let u=n?.__importedComponents?.get(l);if(u!==void 0)return u}}function Ri(e,n){let r=n?Ve.resolve(n):void 0,i=Ve.dirname(Ve.resolve(e));for(;;){if(sn.existsSync(Ve.join(i,"package.json")))return r&&i===r?void 0:i;let a=Ve.dirname(i);if(a===i)return;i=a}}var ic=["src/ui","src/components","components","dist"];function rs(e,n){let r=Ve.resolve(e);if(!n&&!r.split(Ve.sep).includes("node_modules"))return[];let i=Ri(r,n);if(!i)return[];let a=[];try{let f=JSON.parse(sn.readFileSync(Ve.join(i,"package.json"),"utf8")).stx?.components;if(Array.isArray(f))a=f.filter((v)=>typeof v==="string")}catch{}let l=a.length?a:ic;return[Ve.dirname(Ve.resolve(e)),...l.map((u)=>Ve.resolve(i,u))]}function*Ai(e,n,r={},i){let a=ii(e);if(a[0].startsWith("./")||a[0].startsWith("../")){yield Ve.resolve(Ve.dirname(n),`${a[0]}.stx`);return}let l=[...new Set(a.map((v)=>`${v}.stx`))],u=r.projectRoot||process.cwd(),f=[...rs(n,r.projectRoot),...i?.__originalFilePath?[Ve.join(Ve.dirname(i.__originalFilePath),"components")]:[],...r.componentsDir?[r.componentsDir]:[],Ve.join(Ve.dirname(n),"components"),Ve.resolve(u,"src/components"),Ve.resolve(u,"components"),...import.meta.dir?[Ve.resolve(import.meta.dir,"components")]:[]];for(let v of new Set(f)){for(let S of l)yield Ve.join(v,S);try{for(let S of sn.readdirSync(v,{withFileTypes:!0}))if(S.isDirectory())for(let I of l)yield Ve.join(v,S.name,I)}catch{}}}function oi(e,n,r={},i){let a=$i(e,i);if(a!==void 0)return a;for(let l of Ai(e,n,r,i))try{if(sn.statSync(l,{throwIfNoEntry:!1})?.isFile())return l}catch{}return null}function Qs(e,n=[],r={}){let i=new Set([...e].map((S)=>S.replace(/[-_]/g,"").toLowerCase()));if(!i.has("src")&&!i.has("source")||!i.has("alt")&&!i.has("decorative"))return!1;let a=new Map(Object.entries(r).map(([S,I])=>[S.replace(/[-_]/g,"").toLowerCase(),I])),l=a.get("alt"),u=a.get("decorative"),f=typeof l==="string"&&!!l.trim(),v=typeof u==="string"?!["false","0","off","no"].includes(u.trim().toLowerCase()):Boolean(u);if(!f&&!v)return!1;if(["defaultsource","provider","format","densities","quality","preload","modifiers","preset"].some((S)=>i.has(S)))return!1;if([...n].some((S)=>!["load","error"].includes(S.replace(/^@/,"").split(".")[0].toLowerCase())))return!1;if(i.has("resizemode")&&(i.has("fit")||i.has("objectfit")))return!1;if(i.has("src")&&i.has("source"))return!1;return["fit","objectfit","resizemode","position","objectposition","rounded","aspectratio","zoomonhover","sources","webpsrc","webpsrcset"].some((S)=>i.has(S))}import Is from"fs";import xe from"path";import Bt from"path";import _n from"fs";var oc=new Set(["touchstart","touchmove","wheel","mousewheel"]);function Us(e,n){if(n.passive)return!0;if(n.prevent||n.nonpassive)return!1;return oc.has(e.toLowerCase())}var ai=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"]),ci={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"},ac=new Set(["ctrl","alt","shift","meta"]),pi={left:0,middle:1,right:2};function li(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 r of e){let i=r.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(ac.has(i))n.systemKeys.push(i);else if(i in pi)n.mouse=i;else if(i in ci||/^[a-z]$/.test(i))n.keys.push(ci[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 fi(e,n=""){let r=[],i=0,a=/<([a-z][a-z0-9-]*)\s+([^>]*@[a-z][^>]*)>/gi,l;while((l=a.exec(e))!==null){let[u,f,v]=l,S=l.index,I=S+u.length,j=`__stx_evt_${n}${i++}`,L=[],M=/@([a-z][a-z0-9.]*)\s*=\s*"([^"]*)"/gi,V;while((V=M.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}let W=/@([a-z][a-z0-9.]*)\s*=\s*'([^']*)'/gi;while((V=W.exec(v))!==null){let[,Z,q]=V,G=Z.split("."),U=G[0];if(!ai.has(U))continue;L.push({attribute:`@${Z}`,event:U,handler:q,modifiers:li(G.slice(1)),elementId:j})}if(L.length>0)r.push({originalTag:u,elementId:j,events:L,startIndex:S,endIndex:I})}return r}function cc(e){let n=[],{modifiers:r}=e;if(r.self)n.push("if ($event.target !== $el) return");for(let i of r.systemKeys)n.push(`if (!$event.${i}Key) return`);if(r.keys.length>0){let i=r.keys.map((a)=>`$event.key === '${a}'`).join(" || ");n.push(`if (!(${i})) return`)}if(r.mouse!==null){let i=pi[r.mouse];n.push(`if ($event.button !== ${i}) return`)}if(r.prevent)n.push("$event.preventDefault()");if(r.stop)n.push("$event.stopPropagation()");return n.join("; ")}function lc(e,n){let r=e;if(n.debounce!==null)r=`__stx_debounce(() => { ${r} }, ${n.debounce})`;else if(n.throttle!==null)r=`__stx_throttle(() => { ${r} }, ${n.throttle})`;return r}function Hs(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 uc(e){let{modifiers:n}=e,r=e.elementId.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),i=cc(e),a=lc(Hs(e.handler),n),l=[];if(n.once)l.push("once: true");if(n.capture)l.push("capture: true");if(Us(e.event,n))l.push("passive: true");let u=l.length>0?`, { ${l.join(", ")} }`:"",f=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('${r}');
5
5
  if (!$el) return;
@@ -112,7 +112,7 @@ else {
112
112
  `)}
113
113
  })();
114
114
  </script>`}function pc(e,n=""){let r=fi(e,n);if(r.length===0)return{template:e,bindings:[]};let i=e,a=[];for(let l=r.length-1;l>=0;l--){let u=r[l],f=u.originalTag;if(!f.includes(" id="))f=f.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${u.elementId}"`);else{let v=f.match(/id=["']([^"']+)["']/);if(v)for(let S of u.events)S.elementId=v[1]}for(let v of u.events){let S=v.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),I=new RegExp(`\\s*${S}\\s*=\\s*"[^"]*"`,"g"),j=new RegExp(`\\s*${S}\\s*=\\s*'[^']*'`,"g");f=f.replace(I,""),f=f.replace(j,"")}i=i.slice(0,u.startIndex)+f+i.slice(u.endIndex),a.push(...u.events)}return{template:i,bindings:a}}function ui(e){let n=e.$uid;return typeof n==="string"&&n?`${n}_`:""}function nl(e,n,r){if(zl(e))return e;if(n.__stx_sfc_mode){if(/x-data\s*=\s*["']/.test(e))return e;let{template:f,bindings:v}=pc(e,ui(n)),S=n.__stx_event_bindings||[];return n.__stx_event_bindings=[...S,...v],f}let i=fi(e,ui(n));if(i.length===0)return e;let a=e;for(let f=i.length-1;f>=0;f--){let v=i[f],S=v.originalTag;if(!S.includes(" id="))S=S.replace(/^<([a-z][a-z0-9-]*)/,`<$1 id="${v.elementId}"`);else{let I=S.match(/id=["']([^"']+)["']/);if(I)for(let j of v.events)j.elementId=I[1]}for(let I of v.events){let j=I.attribute.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),L=new RegExp(`\\s*${j}\\s*=\\s*"[^"]*"`,"g"),M=new RegExp(`\\s*${j}\\s*=\\s*'[^']*'`,"g");S=S.replace(L,""),S=S.replace(M,"")}a=a.slice(0,v.startIndex)+S+a.slice(v.endIndex)}let l=Pi(i.flatMap((f)=>f.events)),u=c(a);if(u!==-1)a=a.slice(0,u)+l+`
115
- `+a.slice(u);else a+=l;return a}function di(e,n){let r=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))r.add(a)}return r}function Vt(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&di(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&di(f[1],!1).has(n))return!0;return!1}var Ue="0.2.899";var gi=Symbol.for(`stx.lazy-module-promises.${Ue}`);function dc(){let e=globalThis;return e[gi]??=new Map,e[gi]}function o(e,n){let r=dc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var gc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(gc,"<\\/$1")}import mi from"fs";var hi=[];function k(e){let n=new T(e);return hi.push(n),n}function rl(){for(let e of hi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Nr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:mi.statSync(r).mtimeMs})}catch{}return n}function eo(e){for(let n of e)try{if(mi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Ie=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var mc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function hc(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function xc(e,n){let r=n;while(!0){let i=Bt.join(r,"node_modules",e,"package.json");if(_n.existsSync(i))return Bt.dirname(i);let a=Bt.dirname(r);if(a===r)return null;r=a}}function bc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function yc(e,n){let r=hc(e);if(!r||!r.subpath)return null;let i=xc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(_n.readFileSync(Bt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=bc(a.exports,l);if(!u)return null;let f=Bt.resolve(i,u);return _n.existsSync(f)?f:null}function zi(e,n){let r=n.filePath?Bt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(mc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Bt.resolve(r,S),!_n.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=yc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=_n.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function _c(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Hi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${_c(n.source)}" data-stx-layer="vendor">
115
+ `+a.slice(u);else a+=l;return a}function di(e,n){let r=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))r.add(a)}return r}function Vt(e,n){let r=t(e),{depths:i,balanced:a}=h(r),l=(f)=>!a||i[f]===0,u=new RegExp(`(?:^|[^\\w$.])((?:const|let|var|function|class)\\s+${n}\\b)`,"g");for(let f of r.matchAll(u)){let v=(f.index??0)+f[0].length-f[1].length;if(l(v))return!0}for(let f of r.matchAll(/(?:const|let|var)\s*\{([^}]*)\}/g))if(l(f.index??0)&&di(f[1],!0).has(n))return!0;for(let f of r.matchAll(/(?:const|let|var)\s*\[([^\]]*)\]/g))if(l(f.index??0)&&di(f[1],!1).has(n))return!0;return!1}var Ue="0.2.901";var gi=Symbol.for(`stx.lazy-module-promises.${Ue}`);function dc(){let e=globalThis;return e[gi]??=new Map,e[gi]}function o(e,n){let r=dc(),i=`${import.meta.url}\x00${e}`,a=r.get(i);if(a)return a;let l=n();return r.set(i,l),l.catch(()=>{if(r.get(i)===l)r.delete(i)}),l}var gc=/<\/(script)/gi;function me(e){if(!e||e.indexOf("</")===-1)return e;return e.replace(gc,"<\\/$1")}import mi from"fs";var hi=[];function k(e){let n=new T(e);return hi.push(n),n}function rl(){for(let e of hi)e.clear()}function E(e,...n){return`${n.map((r)=>String(r??"")).join("\x00")}\x00${e.length}\x00${Bun.hash(e)}`}function Nr(e){let n=[];for(let r of new Set(e))try{n.push({path:r,mtimeMs:mi.statSync(r).mtimeMs})}catch{}return n}function eo(e){for(let n of e)try{if(mi.statSync(n.path).mtimeMs!==n.mtimeMs)return!1}catch{return!1}return!0}var Ie=["browserQuery","BrowserQueryBuilder","BrowserQueryError","browserAuth","configureBrowser","getBrowserConfig","createBrowserDb","createBrowserModel","isBrowser","debounce","throttle","retry","sleep","wait","delay","waitUntil","waitWhile","lazy","clamp","rand","readableSize","useActiveElement","useIntervalFn","useObjectUrl"];var mc=/^[ \t]*import\s+['"]([^'"]+?\.css)(\?[^'"]*)?['"]\s*;?\s*$/gm;function hc(e){if(e.startsWith(".")||e.startsWith("/"))return null;if(e.startsWith("@")){let r=e.match(/^(@[^/]+\/[^/]+)(\/.*)?$/);if(!r)return null;return{pkg:r[1],subpath:r[2]||""}}let n=e.match(/^([^/]+)(\/.*)?$/);if(!n)return null;return{pkg:n[1],subpath:n[2]||""}}function xc(e,n){let r=n;while(!0){let i=Bt.join(r,"node_modules",e,"package.json");if(_n.existsSync(i))return Bt.dirname(i);let a=Bt.dirname(r);if(a===r)return null;r=a}}function bc(e,n){if(!e||typeof e!=="object")return null;let r=(a)=>{if(typeof a==="string")return a;if(a&&typeof a==="object"){if(typeof a.import==="string")return a.import;if(typeof a.default==="string")return a.default;if(typeof a.import==="object")return r(a.import);if(typeof a.default==="object")return r(a.default)}return null};if(Object.prototype.hasOwnProperty.call(e,n))return r(e[n]);let i=null;for(let a of Object.keys(e)){let l=a.indexOf("*");if(l===-1)continue;let u=a.slice(0,l),f=a.slice(l+1);if(!n.startsWith(u)||!n.endsWith(f))continue;if(n.length<u.length+f.length)continue;if(!i||u.length>i.prefix.length)i={pattern:a,prefix:u,suffix:f}}if(i){let a=n.slice(i.prefix.length,n.length-i.suffix.length),l=r(e[i.pattern]);if(l)return l.replace("*",a)}return null}function yc(e,n){let r=hc(e);if(!r||!r.subpath)return null;let i=xc(r.pkg,n);if(!i)return null;let a;try{a=JSON.parse(_n.readFileSync(Bt.join(i,"package.json"),"utf8"))}catch{return null}let l=`.${r.subpath}`,u=bc(a.exports,l);if(!u)return null;let f=Bt.resolve(i,u);return _n.existsSync(f)?f:null}function zi(e,n){let r=n.filePath?Bt.dirname(n.filePath):n.projectRoot||process.cwd(),i=n.projectRoot||process.cwd(),a=new Set,l=[],u=[];return{code:e.replace(mc,(v,S)=>{let I;try{if(S.startsWith("./")||S.startsWith("../")||S.startsWith("/")){if(I=S.startsWith("/")?S:Bt.resolve(r,S),!_n.existsSync(I))throw Error(`file not found: ${I}`)}else{let j=null;try{j=Bun.resolveSync(S,i)}catch{j=yc(S,i)}if(!j)throw Error(`could not resolve ${S} (Bun.resolveSync + exports fallback both failed)`);I=j}}catch(j){return console.warn(`[stx:vendor-css] could not resolve ${JSON.stringify(S)} (from ${n.filePath||"<unknown>"}): ${j?.message||j}`),u.push(S),""}if(a.has(I))return"";a.add(I);try{let j=_n.readFileSync(I,"utf8");l.push({source:S,resolvedPath:I,contents:j})}catch(j){console.warn(`[stx:vendor-css] could not read ${I}: ${j?.message||j}`),u.push(S)}return""}),styles:l,unresolved:u}}function _c(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Hi(e){if(e.length===0)return"";return`${e.map((n)=>`<style data-stx-vendor="${_c(n.source)}" data-stx-layer="vendor">
116
116
  @layer vendor {
117
117
  ${n.contents}
118
118
  }
@@ -182,7 +182,7 @@ else {
182
182
  // STX: auto-generated event bindings
183
183
  ${e.map((r,i)=>Ic(r,i)).join(`
184
184
  `)}`}function _i(e){let n=[],r=new Set,i=e.replace(/^\s*import\s+.*$/gm,""),a=0,l=i.length,u=0;while(u<l){let f=i[u];if(f==="'"||f==='"'||f==="`"){let v=f;if(u++,v==="`"){let S=0;while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]==="`"&&S===0){u++;break}if(i[u]==="$"&&i[u+1]==="{"){S++,u+=2;continue}if(i[u]==="}"&&S>0){S--,u++;continue}u++}}else while(u<l){if(i[u]==="\\"){u+=2;continue}if(i[u]===v){u++;break}u++}continue}if(f==="/"&&i[u+1]==="/"){while(u<l&&i[u]!==`
185
- `)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var jc=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 Pc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!jc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.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 S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Ge(e,n={}){let r=e,i="",a=!1,l=[],u=zi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Hi(u.styles),v=Xt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-2vqamyay.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=xl(r);r=U.code,i=Sl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${Pn(r,n.serverData)}${i}`,r=D(r),!a&&Xe(n.attrs||""))r=Je(r);let j=Oc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
185
+ `)u++;continue}if(f==="/"&&i[u+1]==="*"){u+=2;while(u<l-1&&!(i[u]==="*"&&i[u+1]==="/"))u++;u+=2;continue}if(f==="{"){a++,u++;continue}if(f==="}"){a--,u++;continue}if(a===0){let v=i.slice(u),S=v.match(/^(?:const|let|var)\s+([a-zA-Z_$]\w*)\s*(?::[^=]*)?=/);if(S){let L=S[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=S[0].length;continue}let I=v.match(/^(?:const|let|var)\s+\{([^}]+)\}\s*=/);if(I){I[1].split(",").forEach((L)=>{let M=L.trim(),V=M.indexOf(":"),W=V>=0?M.slice(V+1).trim().split(/[\s=]/)[0]:M.split(/[\s=]/)[0];if(W&&!W.startsWith("_")&&!r.has(W))n.push(W),r.add(W)}),u+=I[0].length;continue}let j=v.match(/^(?:async\s+)?function\s+([a-zA-Z_$]\w*)/);if(j){let L=j[1];if(!L.startsWith("_")&&!r.has(L))n.push(L),r.add(L);u+=j[0].length;continue}}u++}return n}var jc=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 Pc(e){let n=new Set,r=/[a-zA-Z_$][a-zA-Z0-9_$]*/g;function i(L){let M;while((M=r.exec(L))!==null){let V=M[0];if(!jc.has(V))n.add(V)}}let a=/\{\{([\s\S]*?)\}\}/g,l;while((l=a.exec(e))!==null)i(l[1]);let u=/:[a-z][\w.-]*\s*=\s*"([^"]*)"/gi;while((l=u.exec(e))!==null)i(l[1]);let f=/:[a-z][\w.-]*\s*=\s*'([^']*)'/gi;while((l=f.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 S=/@[a-z]+(?:\.[a-z]+)*\s*=\s*'([^']*)'/gi;while((l=S.exec(e))!==null)i(l[1]);let I=/@model\s*=\s*["']([^"']*)["']/gi;while((l=I.exec(e))!==null)i(l[1]);let j=/@for\s*=\s*["'][^"']*\bin\s+([^"']+)["']/gi;while((l=j.exec(e))!==null)i(l[1]);return n}async function Ge(e,n={}){let r=e,i="",a=!1,l=[],u=zi(r,{filePath:n.filePath,projectRoot:n.projectRoot});r=u.code;let f=Hi(u.styles),v=Xt(r);r=v.code,l=[...v.imports,...v.models];let{hasUserImports:S,bundleClientScript:I}=await o("stx/client-script-bundler",()=>import("./chunk-c05zj2m9.js"));if(S(r))r=await I(r,n.filePath||"",{projectRoot:n.projectRoot,minify:n.production}),a=!0;if(n.autoImports!==!1){let U=xl(r);r=U.code,i=Sl(U.stxImports,U.browserImports.filter((H)=>!l.includes(H)))}if(i=`${Pn(r,n.serverData)}${i}`,r=D(r),!a&&Xe(n.attrs||""))r=Je(r);let j=Oc(n.eventBindings||[]),L=(n.attrs||"").trim(),M=/\btype\s*=\s*["']module["']/i.test(L),V=n.instanceId?` data-stx-instance="${n.instanceId}"`:"";if(M){let U=L.replace(/\btype\s*=\s*["']module["']/i,"").trim(),H=`type="module" data-stx-scoped${V}${U?` ${U}`:""}`;return`${f}<script ${H}>
186
186
  ${me(`${i}${r}
187
187
  ${j}`)}
188
188
  </script>`}let W=na(e),Z=/function __stx_setup_/.test(r),q=/\bstx\.mount\s*\(|\bstx\.mountEl\s*\(/.test(e);function G(U){let H=U.length>0?`
@@ -1183,8 +1183,8 @@ ${S.join(`
1183
1183
  `){let V=e[a];if(V==="\\"){a+=2;continue}if(V==="[")M=!0;else if(V==="]")M=!1;else if(V==="/"&&!M){a++;while(a<l&&/[a-z]/i.test(e[a]))a++;return}a++}},L=()=>{if(i!==0)return;let M=e.slice(a).match(/^(const|let|var)\s*\{([^}]+)\}\s*=/);if(M){let q=M[2].split(",").map((G)=>{let U=G.trim().split(":");return U[U.length-1].trim()});for(let G of q)if(G&&/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(G)&&!r.has(G))n.push(G),r.add(G);return}let V=e.slice(a).match(/^(const|let|var)\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*=/);if(V){let q=V[2];if(!r.has(q))n.push(q),r.add(q);return}let W=e.slice(a).match(/^function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(W){let q=W[1];if(!r.has(q))n.push(q),r.add(q);return}let Z=e.slice(a).match(/^async\s+function\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\(/);if(Z){let q=Z[1];if(!r.has(q))n.push(q),r.add(q)}};while(a<l){if(v())continue;if(e[a]==="'"||e[a]==='"'){u(e[a]);continue}if(e[a]==="`"){f();continue}if(e[a]==="/"&&I()){j();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 jp(e,n,r){for(let i of ee(e)){let a=O(i.attrs);if(["server","src","component","stx:component"].some((f)=>a.has(f))||!$t(a))continue;let l=an(e.slice(i.bodyStart,i.bodyEnd));if(!l)continue;let u=Object.assign(Object.create(null),r);for(let[f,v]of Object.entries(l.defaults))if(u[f]===void 0)u[f]=ws(v);for(let f of new Set([...l.propNames,...Object.keys(l.defaults)])){let v=l.localBindings[f]??(l.propBindings[f]?void 0:f);if(v)Object.defineProperty(n,v,{value:u[f],writable:!0,enumerable:!0,configurable:!0})}if(l.identifier)Object.defineProperty(n,l.identifier,{value:u,writable:!0,enumerable:!0,configurable:!0})}}var Pp=new Set(["tr","td","th","thead","tbody","tfoot","caption","colgroup","col","option","optgroup","li","dt","dd","span"]);function Wg(e,n){let r=Ut(e),i=e.slice(r).match(/^<([a-zA-Z][a-zA-Z0-9-]*)/);if(!i)return null;let a=i[1].toLowerCase();if(!Pp.has(a))return null;let l=new RegExp(`<\\/?${a}(?=[\\s/>])(?:[^>"']|"[^"]*"|'[^']*')*>`,"iy"),u=x(e,(I,j)=>(l.lastIndex=j,l.exec(I)?.index===j?l.lastIndex:-1));if(a==="span"&&/\sdata-stx-scope\s*=/.test(u[0]?.token||""))return null;let f=0,v=!1;for(let I of u){if(f+=I.token.startsWith("</")?-1:1,f<0)return null;if(f===0){if(e.slice(I.end).trim())return null;v=!0;break}}if(!v)return null;let S=r+i[0].length;return e.slice(0,S)+n+e.slice(S)}function Wa(e,n){if(!e)return!1;return[...n.additionalComponentsDirs??[],...n.fallbackComponentsDir?[n.fallbackComponentsDir]:[]].some((i)=>{let a=xe.relative(xe.resolve(i),xe.resolve(e));return!a.startsWith("..")&&!xe.isAbsolute(a)})}async function zr(e,n,r,i,a){let l=e.endsWith(".stx")?e.slice(0,-4):e,u=(ce)=>ce.split("-").map((le)=>le.charAt(0).toUpperCase()+le.slice(1)).join(""),f=r.__importedComponents;if(f){for(let ce of[l,l.toLowerCase(),u(l),J(l)])if(f.has(ce))return!0}let v=[...new Set([`${l}.stx`,`${u(l)}.stx`,`${J(l)}.stx`])],S=typeof a.root==="string"?xe.resolve(a.root):void 0,I=S??xe.dirname(i),j=[],L=(ce)=>{if(ce&&!j.includes(ce))j.push(ce)};for(let ce of rs(i,S))L(ce);let M=r.__originalFilePath;if(M)L(xe.join(xe.dirname(M),"components"));if(Wa(n,a))L(a._rootComponentsDir);L(n),L(a._rootComponentsDir),L(xe.join(xe.dirname(i),"components")),L(a.componentsDir);for(let ce of a.additionalComponentsDirs??[])L(ce);let V=a._targetComponentFallbackNames?.some((ce)=>ce.toLowerCase()===l.toLowerCase());if(!V)for(let ce of a._targetComponentDirs??[])L(ce);if(S)L(xe.resolve(S,"resources/views/components")),L(xe.resolve(S,"resources/components")),L(xe.resolve(S,"src/components")),L(xe.resolve(S,"components"));for(let ce of a._layerComponentDirs??[])L(ce);let W=a._pluginComponentDirs;if(Array.isArray(W))for(let ce of W)L(typeof ce==="string"?ce:null);if(L(a.fallbackComponentsDir),V)for(let ce of a._targetComponentDirs??[])L(ce);let Z=a._nativePrimitivesFallback;if(Z&&!Z.except.some((ce)=>ce.toLowerCase()===l.toLowerCase()))L(Z.dir);if(l.startsWith("./")||l.startsWith("../"))return s(xe.resolve(xe.dirname(i),`${l}.stx`));let q=ja(xe.resolve(import.meta.dir,"components")),G=j.map((ce)=>xe.isAbsolute(ce)?ce:xe.resolve(I,ce)),U=`${v.join("\x00")}\x00\x00${G.join("\x00")}`,H=Ar.get(U);if(H!==void 0)return H;let re=!1;e:for(let ce of G){if(ja(ce)===q)continue;for(let le of v)if(await s(xe.join(ce,le))){re=!0;break e}}return Ar.set(U,re),re}function ja(e){let n=Ir.get(e);if(n!==void 0)return n;let r=e;try{r=Is.realpathSync(e)}catch{}return Ir.set(e,r),r}function qg(e){return e==="visible"||e==="idle"||e==="interaction"||e.startsWith("media:")}function kl(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 Mp(e,n,r){if(!e.includes("{{")&&!e.includes("{!!"))return e;let i=(a,l)=>{let u;try{u=N(a,n)}catch{return l}if(u===void 0||u===null)return"";let f=String(u);if(/<\/style/i.test(f))return console.warn(`[stx] a <style> expression in ${r??"<unknown>"} evaluated to CSS containing a closing style tag, which would end the element early, so it was dropped rather than emitted.`),"";return f};return e.replace(/\{!!([\s\S]*?)!!\}/g,(a,l)=>i(l,a)).replace(/\{\{([\s\S]*?)\}\}/g,(a,l)=>i(l,a))}var Pa=new Set;function Ma(e,n,r,i){let a=`${e}\x00${n}\x00${i??""}`;if(!process.env.STX_DEBUG&&Pa.has(a))return;Pa.add(a);let l=n?` used in ${n}`:"",u=i?` Cause: ${i}.`:"",f=r.length>0?`
1184
1184
  searched:
1185
1185
  ${r.map((v)=>` - ${v}`).join(`
1186
- `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Da(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Dp=new Set(["for","if","show","key","ref","class","className","style"]),Na=new Set,Fa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",_l=new RegExp(`\\b(?:${Fa})\\s*(?:<[^>]*>)?\\s*\\(`);function Vi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Fa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Ye(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-1tb18a92.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&qg(W)?W:"";try{let q=(pe)=>pe.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let pe=[G,G.toLowerCase(),q(G),J(G)];for(let ve of pe)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let pe=[`${G}.stx`,`${q(G)}.stx`,`${J(G)}.stx`],ve=[...new Set(pe)],Me=a.__originalFilePath,$e=[];for(let Te of rs(l))if(!$e.includes(Te))$e.push(Te);let lt=$e.length;for(let Te of u._layerComponentDirs??[])if(!$e.includes(Te))$e.push(Te);if(Me){let Te=xe.join(xe.dirname(Me),"components");$e.push(Te)}let Qe=u._rootComponentsDir;if(typeof Qe==="string"&&Wa(i,u)&&!$e.includes(Qe))$e.push(Qe);if(i&&!$e.includes(i))$e.push(i);if(typeof Qe==="string"&&!$e.includes(Qe))$e.push(Qe);let Ot=xe.join(xe.dirname(l),"components");if(!$e.includes(Ot))$e.push(Ot);if(u.componentsDir&&u.componentsDir!==i&&!$e.includes(u.componentsDir))$e.push(u.componentsDir);for(let Te of u.additionalComponentsDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let Yt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),Dt=(I?.events??[]).map((Te)=>Te.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Ns=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ls=!Dt.includes("valuechange")&&(Zn||Dt.includes("change")&&!Ns),Lt=u._nativeHostAttrs&&/^textinput$/i.test(G),Qt=Dt.includes("update:value")&&!Dt.includes("input"),yn=u._nativeHostAttrs&&/^video$/i.test(G),zs=u._nativeHostAttrs&&/^image$/i.test(G),Jn=Qs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),en=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Xn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Gn=yn&&(en||Xn)&&(I?.events??[]).every((Te)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Te.replace(/^@/,"").split(".")[0])),Yn=new Set(["","primary","secondary","outline","ghost","danger"]),Qn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",es=u._nativeHostAttrs&&/^button$/i.test(G)&&!Yn.has(Qn),Zr=u._targetComponentFallbackNames?.some((Te)=>Te.toLowerCase()===G.toLowerCase())??!1,Bs=Zr&&(!Yt||Ls)&&(!Lt||Qt)&&(!yn||Gn)&&(!zs||Jn)&&!es;for(let Te of Bs?[]:u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let tn=typeof u.root==="string"?xe.resolve(u.root):void 0,Xr=tn??xe.dirname(l),nn=[];if(tn)nn.push(xe.resolve(tn,"resources/views/components")),nn.push(xe.resolve(tn,"resources/components")),nn.push(xe.resolve(tn,"src/components")),nn.push(xe.resolve(tn,"components"));nn.push(xe.resolve(import.meta.dir,"components"));for(let Te of nn)if(!$e.includes(Te))$e.push(Te);if(Zr){let Te=(u._componentPackageDirs??[]).filter((gt)=>typeof gt==="string"&&gt.length>0),jt=(Bs?Te.length?Te:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((gt)=>typeof gt==="string"&&gt.length>0);if(jt.length){let gt=$e.slice(lt).map((ut)=>xe.isAbsolute(ut)?ut:xe.resolve(Xr,ut)).filter((ut)=>!jt.includes(ut)),ns=`${G}\x00${gt.join("\x00")}`,kt=Tr.get(ns);if(kt===void 0){kt=!1;for(let ut of gt){for(let zt of ve)if(await s(xe.join(ut,zt))){kt=!0;break}if(kt)break}Tr.set(ns,kt)}if(!kt){for(let ut of jt){let zt=$e.indexOf(ut);if(zt>=0)$e.splice(zt,1)}$e.splice(lt,0,...jt)}}}let Gr=u._pluginComponentDirs;if(Array.isArray(Gr)){for(let Te of Gr)if(typeof Te==="string"&&!$e.includes(Te))$e.push(Te)}if(u.fallbackComponentsDir&&!$e.includes(u.fallbackComponentsDir))$e.push(u.fallbackComponentsDir);if(Bs){for(let Te of u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te)}let ts=u._nativePrimitivesFallback;if(ts&&!ts.except.some((Te)=>Te.toLowerCase()===G.toLowerCase())&&!$e.includes(ts.dir))$e.push(ts.dir);let Qr=[...new Set($e.map((Te)=>{if(!Te)return Te;return xe.isAbsolute(Te)?Te:xe.resolve(Xr,Te)}))];$e.length=0,$e.push(...Qr);let Ws=`${G}\x00${l}\x00${Qr.join("\x00")}`,Fs=Ts.get(Ws);if(Fs)if(await s(Fs))U=Fs;else Ts.delete(Ws);if(!U&&(G.startsWith("./")||G.startsWith("../")))U=xe.resolve(xe.dirname(l),`${G}.stx`),re.push(U);else if(!U)for(let Te of $e){if(!Te)continue;for(let jt of ve){let gt=xe.join(Te,jt);if(re.push(gt),await s(gt)){U=gt;break}}if(U)break;if(!U)try{let jt=await import("fs");if(!jt.statSync(Te,{throwIfNoEntry:!1})?.isDirectory())continue;let ns=8,kt=[{path:Te,depth:0}];while(kt.length>0&&!U){let ut=kt.pop();if(ut.depth>=ns)continue;let zt;try{zt=jt.readdirSync(ut.path,{withFileTypes:!0})}catch{continue}for(let ss of zt){if(!ss.isDirectory())continue;if(ss.name==="node_modules"||ss.name.startsWith("."))continue;let ei=xe.join(ut.path,ss.name);for(let nc of ve){let Vs=xe.join(ei,nc);if(re.push(Vs),await s(Vs)){U=Vs;break}}if(U)break;kt.push({path:ei,depth:ut.depth+1})}}}catch{}if(U)break}if(U)Ts.set(Ws,U)}if(!U||!await s(U))return Ma(e,l,re),Da(e);v.add(U);let ce;if(Fn.has(U)&&Rr.get(U)===Aa(U))ce=Fn.get(U);else try{let pe=Aa(U);ce=await Bun.file(U).text(),Fn.set(U,ce),Rr.set(U,pe)}catch(pe){let ve=pe instanceof Error?pe.message:String(pe);return Ma(e,l,[U],ve),Da(e)}if(I)for(let pe of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=pe.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let Me=pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Me}\\b`).test(ce))I.declaredProps.add(pe);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Me}\\b|\\[\\s*['"]${Me}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Me}['"]`).test(ce))I.consumedProps?.add(pe)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let pe of I.reactiveProps){if(Dp.has(pe)||I.consumedProps?.has(pe))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${pe}`;if(Na.has(ve))continue;Na.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${pe}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${pe}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${pe}').`)}let le=new Set(["__originalFilePath","__importedComponents",ls,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),de={};for(let[pe,ve]of Object.entries(a))if(!pe.startsWith("__")||le.has(pe))de[pe]=ve;let Ee=S.length>0?{[ms]:[...S]}:{},Re=r;if(r.includes("@include")){let{processIncludes:pe}=await o("stx/includes",()=>import("./chunk-avqxkbrd.js"));Re=await pe(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Re)){let{processComponents:pe}=await o("stx/component-renderer",()=>import("./chunk-jq49238b.js")),ve={...a,__processedComponents:M,...Ee};Re=await pe(Re,ve,l,u,v);let Me=ve.__stx_preserved_client_expressions;if(Array.isArray(Me)&&Me.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Me])]}let we=[];if(kl(Re)){let{processExpressions:pe}=await o("stx/expressions",()=>import("./chunk-k352spys.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:S.length>0?{...a,...Ee}:a;Re=pe(Re,ve,l);for(let Me of Re.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(Me[1].trim())}let ge=se(Re),ze=[],Fe=ge.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(pe,ve)=>{let Me=ge.scripts[Number(ve)]||"",$e=Me.match(/^<script\b([^>]*)>/i)?.[1]||"",lt=$e.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Qe=!lt||["module","text/javascript","application/javascript"].includes(lt),Ot=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${$e}`);if(!/\bserver\b/i.test($e)&&Qe&&!Ot)return ze.push(Me),"";return Me}),{extractSlotContent:it}=await o("stx/slots",()=>import("./chunk-73nazfe5.js")),rt=it(Fe),wt={};if(rt.defaultSlot?.trim())wt.default=rt.defaultSlot;for(let[pe,ve]of rt.namedSlots)wt[pe]=ve.content;let ft=a.__stx_scope_seq??={n:0,key:lo(String(a.__filename??l))},ot=Ba(e,process.cwd()),je=`stx_${(ot.endsWith(".stx")?ot.slice(0,-4):ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ae={...de,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:Fe,$slots:wt,__processedComponents:V,__sections:{},__stx_signals_gate:Ne(ce)||kl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we]};if(/import\s/.test(ce)){Ae.__importedComponents=new Map(Ae.__importedComponents);let{processESImports:pe}=await o("stx/component-renderer",()=>import("./chunk-jq49238b.js"));ce=await pe(ce,Ae,U,u,v)}jp(ce,Ae,n);let dt=ce,nt=B(dt);if(nt)dt=nt.content.trim();let pn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Pt=[...ce.matchAll(pn)];for(let[,pe,ve]of Pt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(pe))We(ve,U,u.strict);let vt=[],fn=null,js=Pt.some((pe)=>/\bserver\b/.test(pe[1]||"")&&/\bcache\b/.test(pe[1]||"")),Jt=null,Rt=null,dn=null,Un=0,gn=null;if(Rp(u),js&&Pr>0){let pe=Tp({props:n,slot:Re,slotContext:r.trim()?Ap(de):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:je});if(pe!==null){Jt=`${U}\x00${E(ce)}\x00${pe}`;let ve=As.get(Jt);if(ve){for(let Me of ve.dependencies)v.add(Me);if(Ki(a,ve.clientFactories),ft.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let Me=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let $e of ve.preservedClientExpressions)Me.add($e);a.__stx_preserved_client_expressions=[...Me]}return ve.output}Rt=new Set(v),dn=Ci(a),Un=ft.n,gn=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let mn=new Set;for(let pe of Pt){let ve=pe[1]||"",Me=pe[2]||"",$e=ve.includes("server");if(Xe(ve)&&Me.trim())Me=Je(Me);if($e&&Me){for(let Qe of ye(Me))mn.add(Qe);try{await L(Me,Ae,U,{onFailure:(Qe)=>{if(Qe.kind!=="unknown")fn=Qe.kind}})}catch(Qe){}}if(!$e){let Qe=Me.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ot=Qe.includes("{{")&&Qe.includes("}}"),Yt=Qe.includes("{!!")&&Qe.includes("!!}");if(Ot||Yt)Qe=Wi(Qe,Ae,U);let Dt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");vt.push(`<script${Dt}>${Qe}</script>`)}}let St=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),hn=St?St[1]:"",Ps=St?St[2]:"",Tt="",ue=hn&&/\bscoped\b/i.test(hn);if(St)Tt=`<style${hn}>${Mp(Ps,Ae,U)}</style>`;let fe=dt;if(fe=fe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),St)fe=fe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let pe=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(fe=fe.replace(pe,(Me,$e)=>{let lt=$e.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(lt)ve.push(`<style${lt[1]}>${lt[2]}</style>`);return""}),fe=fe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)Tt=`${Tt}${ve.join(`
1187
- `)}`}if(r&&fe.includes("{{ text || slot }}"))fe=fe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:Se}=await o("stx/slots",()=>import("./chunk-73nazfe5.js")),{defaultSlot:Be,namedSlots:tt}=rt,at=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Fe),Et=vt.length>0&&pr(fe)||u._nativeHostAttrs===!0&&vt.length>0||at&&vt.length>0||vt.some((pe)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(pe)),Ms=(pe)=>Et?Vo(pe,je):pe,Ds=new Map([...tt].map(([pe,ve])=>[pe,{...ve,content:Ms(ve.content)}]));fe=await Se(fe,Et?Fo(Ms(Be),je):Be,Ds,Ae,Et?je:"");let Hn=Vi(vt),xn=(Array.isArray(Ae.__stx_client_signal_names)?Ae.__stx_client_signal_names:[]).filter((pe)=>!mn.has(pe));if(Hn.length>0||xn.length>0)Ae.__stx_client_signal_names=[...new Set([...xn,...Hn])];else delete Ae.__stx_client_signal_names;let bn=S.filter((pe)=>!mn.has(pe)&&!(pe in n));if(bn.length>0)Ae[ms]=bn;let Kn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Et||vt.length===0,defaultLayout:void 0};Ae.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:qn}=await o("stx/process",()=>import("./chunk-zcys6b06.js")),At=await qn(fe,Ae,U,Kn,v),Mt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let pe of At.matchAll(/\{\{([\s\S]*?)\}\}/g))Mt.add(pe[1].trim());if(Mt.size>0)a.__stx_preserved_client_expressions=[...Mt];let It=je,ct=At;if(Et){let pe="";if(Object.keys(n).length>0)try{pe=` data-stx-props="${kr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${kr(Z)}"`:"",Me=Object.fromEntries(Object.entries(wt).map(([Lt,Qt])=>[Lt,Boolean(Qt)])),$e=Object.keys(Me).length>0?` data-stx-slots="${kr(JSON.stringify(Me))}"`:"",lt=` data-stx-scope="${It}"${pe}${$e}${ve}`,Qe=At.slice(Ut(At)),Ot=/^<span(?=[\s/>])/i.test(Qe),Yt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),Dt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Qe),Zn=Ot?"span":"div",Ns=Yt&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Dt&&u._nativeHostAttrs?' style="width:100%;height:100%"':Ot||Yt?' style="display:contents"':"";ct=Wg(At,lt)??`<${Zn}${lt} data-stx-component-wrapper${Ns}>${At}</${Zn}>`;let Ls=await Promise.all(vt.map(async(Lt)=>{let Qt=Lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Qt)return Lt;let[,yn,zs]=Qt,Jn=Ta(Lt,Ae,U);if(Jn!==null)return Jn;let en=await Lp(zs,U,u.buildMode==="compile"),Xn=Pn(en.clientCode,Ke(Ae)),{vendorStyleTags:Gn}=en,Yn=Xn?`function(__scopeId) {
1186
+ `)}`:"";console.error(`[stx] component <${e}> could not be resolved${l}, so it rendered as nothing.${u}${f}`)}function Da(e){return`<!-- stx: component "${e.replace(/--+/g,"-")}" could not be resolved; see the server log -->`}var Dp=new Set(["for","if","show","key","ref","class","className","style"]),Na=new Set,Fa="useMediaQuery|useDark|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useDocumentVisibility|useScrollLock",_l=new RegExp(`\\b(?:${Fa})\\s*(?:<[^>]*>)?\\s*\\(`);function Vi(e){let n=new Set,r=new RegExp(`\\b(?:const|let|var)\\s+([a-zA-Z_$][\\w$]*)\\s*=\\s*(?:state|derived|computed|ref|reactive|signal|useModel|useReactiveProp|useLocalStorage|useSessionStorage|keptState|useCookie|useDebouncedValue|${Fa})\\s*(?:<[^>]*>)?\\s*\\(`,"g");for(let i of e){let a;while((a=r.exec(i))!==null)n.add(a[1]);r.lastIndex=0}return[...n]}async function Ye(e,n,r,i,a,l,u,f=new Set,v,S=mt(a),I,j=e){let{extractVariables:L}=await o("stx/variable-extractor",()=>import("./chunk-8kvqv885.js")),M=f??new Set;if(M.has(e))return`[Circular component reference: ${e}]`;let V=new Set(M);V.add(e);let W=typeof n.client==="string"?n.client.trim():"";if("client"in n)delete n.client;let Z=W&&W!=="load"&&qg(W)?W:"";try{let q=(pe)=>pe.split("-").map((ve)=>ve.charAt(0).toUpperCase()+ve.slice(1)).join(""),G=j.endsWith(".stx")?j.slice(0,-4):j,U=null,H=a.__importedComponents;if(H){let pe=[G,G.toLowerCase(),q(G),J(G)];for(let ve of pe)if(H.has(ve)){U=H.get(ve);break}}let re=[];if(!U){let pe=[`${G}.stx`,`${q(G)}.stx`,`${J(G)}.stx`],ve=[...new Set(pe)],Me=a.__originalFilePath,$e=[];for(let Te of rs(l))if(!$e.includes(Te))$e.push(Te);let lt=$e.length;for(let Te of u._layerComponentDirs??[])if(!$e.includes(Te))$e.push(Te);if(Me){let Te=xe.join(xe.dirname(Me),"components");$e.push(Te)}let Qe=u._rootComponentsDir;if(typeof Qe==="string"&&Wa(i,u)&&!$e.includes(Qe))$e.push(Qe);if(i&&!$e.includes(i))$e.push(i);if(typeof Qe==="string"&&!$e.includes(Qe))$e.push(Qe);let Ot=xe.join(xe.dirname(l),"components");if(!$e.includes(Ot))$e.push(Ot);if(u.componentsDir&&u.componentsDir!==i&&!$e.includes(u.componentsDir))$e.push(u.componentsDir);for(let Te of u.additionalComponentsDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let Yt=u._nativeHostAttrs&&/^(?:checkbox|switch)$/i.test(G),Dt=(I?.events??[]).map((Te)=>Te.replace(/^@/,"").split(".")[0].toLowerCase().replace(/-/g,"")),Zn=Object.hasOwn(n,"checked")||Boolean(I?.reactiveProps?.includes("checked")),Ns=Object.hasOwn(n,"value")||Boolean(I?.reactiveProps?.includes("value")),Ls=!Dt.includes("valuechange")&&(Zn||Dt.includes("change")&&!Ns),Lt=u._nativeHostAttrs&&/^textinput$/i.test(G),Qt=Dt.includes("update:value")&&!Dt.includes("input"),yn=u._nativeHostAttrs&&/^video$/i.test(G),zs=u._nativeHostAttrs&&/^image$/i.test(G),Jn=Qs([...Object.keys(n),...I?.reactiveProps??[]],I?.events,n),en=Object.hasOwn(n,"src")||Boolean(I?.reactiveProps?.includes("src")),Xn=Object.hasOwn(n,"source")||Boolean(I?.reactiveProps?.includes("source")),Gn=yn&&(en||Xn)&&(I?.events??[]).every((Te)=>/^(?:play|pause|ended|timeupdate|loadedmetadata|loadstart|error)$/.test(Te.replace(/^@/,"").split(".")[0])),Yn=new Set(["","primary","secondary","outline","ghost","danger"]),Qn=typeof n.variant==="string"?n.variant.trim().toLowerCase():"",es=u._nativeHostAttrs&&/^button$/i.test(G)&&!Yn.has(Qn),Zr=u._targetComponentFallbackNames?.some((Te)=>Te.toLowerCase()===G.toLowerCase())??!1,Bs=Zr&&(!Yt||Ls)&&(!Lt||Qt)&&(!yn||Gn)&&(!zs||Jn)&&!es;for(let Te of Bs?[]:u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te);let tn=typeof u.root==="string"?xe.resolve(u.root):void 0,Xr=tn??xe.dirname(l),nn=[];if(tn)nn.push(xe.resolve(tn,"resources/views/components")),nn.push(xe.resolve(tn,"resources/components")),nn.push(xe.resolve(tn,"src/components")),nn.push(xe.resolve(tn,"components"));nn.push(xe.resolve(import.meta.dir,"components"));for(let Te of nn)if(!$e.includes(Te))$e.push(Te);if(Zr){let Te=(u._componentPackageDirs??[]).filter((gt)=>typeof gt==="string"&&gt.length>0),jt=(Bs?Te.length?Te:u._pluginComponentDirs??[]:u._targetComponentDirs??[]).filter((gt)=>typeof gt==="string"&&gt.length>0);if(jt.length){let gt=$e.slice(lt).map((ut)=>xe.isAbsolute(ut)?ut:xe.resolve(Xr,ut)).filter((ut)=>!jt.includes(ut)),ns=`${G}\x00${gt.join("\x00")}`,kt=Tr.get(ns);if(kt===void 0){kt=!1;for(let ut of gt){for(let zt of ve)if(await s(xe.join(ut,zt))){kt=!0;break}if(kt)break}Tr.set(ns,kt)}if(!kt){for(let ut of jt){let zt=$e.indexOf(ut);if(zt>=0)$e.splice(zt,1)}$e.splice(lt,0,...jt)}}}let Gr=u._pluginComponentDirs;if(Array.isArray(Gr)){for(let Te of Gr)if(typeof Te==="string"&&!$e.includes(Te))$e.push(Te)}if(u.fallbackComponentsDir&&!$e.includes(u.fallbackComponentsDir))$e.push(u.fallbackComponentsDir);if(Bs){for(let Te of u._targetComponentDirs??[])if(Te&&!$e.includes(Te))$e.push(Te)}let ts=u._nativePrimitivesFallback;if(ts&&!ts.except.some((Te)=>Te.toLowerCase()===G.toLowerCase())&&!$e.includes(ts.dir))$e.push(ts.dir);let Qr=[...new Set($e.map((Te)=>{if(!Te)return Te;return xe.isAbsolute(Te)?Te:xe.resolve(Xr,Te)}))];$e.length=0,$e.push(...Qr);let Ws=`${G}\x00${l}\x00${Qr.join("\x00")}`,Fs=Ts.get(Ws);if(Fs)if(await s(Fs))U=Fs;else Ts.delete(Ws);if(!U&&(G.startsWith("./")||G.startsWith("../")))U=xe.resolve(xe.dirname(l),`${G}.stx`),re.push(U);else if(!U)for(let Te of $e){if(!Te)continue;for(let jt of ve){let gt=xe.join(Te,jt);if(re.push(gt),await s(gt)){U=gt;break}}if(U)break;if(!U)try{let jt=await import("fs");if(!jt.statSync(Te,{throwIfNoEntry:!1})?.isDirectory())continue;let ns=8,kt=[{path:Te,depth:0}];while(kt.length>0&&!U){let ut=kt.pop();if(ut.depth>=ns)continue;let zt;try{zt=jt.readdirSync(ut.path,{withFileTypes:!0})}catch{continue}for(let ss of zt){if(!ss.isDirectory())continue;if(ss.name==="node_modules"||ss.name.startsWith("."))continue;let ei=xe.join(ut.path,ss.name);for(let nc of ve){let Vs=xe.join(ei,nc);if(re.push(Vs),await s(Vs)){U=Vs;break}}if(U)break;kt.push({path:ei,depth:ut.depth+1})}}}catch{}if(U)break}if(U)Ts.set(Ws,U)}if(!U||!await s(U))return Ma(e,l,re),Da(e);v.add(U);let ce;if(Fn.has(U)&&Rr.get(U)===Aa(U))ce=Fn.get(U);else try{let pe=Aa(U);ce=await Bun.file(U).text(),Fn.set(U,ce),Rr.set(U,pe)}catch(pe){let ve=pe instanceof Error?pe.message:String(pe);return Ma(e,l,[U],ve),Da(e)}if(I)for(let pe of new Set([...Object.keys(n),...I.reactiveProps??[]])){let ve=pe.toLowerCase();if(ve.startsWith("aria-")||ve.startsWith("data-"))continue;let Me=pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${Me}\\b`).test(ce))I.declaredProps.add(pe);if(new RegExp(`\\$props\\s*(?:\\.\\s*${Me}\\b|\\[\\s*['"]${Me}['"]\\s*\\])`).test(ce)||new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${Me}['"]`).test(ce))I.consumedProps?.add(pe)}if(I?.reactiveProps?.length&&/\bdefineProps\s*(?:<[^>]*>)?\s*\(/.test(ce))for(let pe of I.reactiveProps){if(Dp.has(pe)||I.consumedProps?.has(pe))continue;if(new RegExp(`\\buse(?:ReactiveProp|Model)\\s*\\(\\s*['"]${pe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(ce))continue;let ve=`${U}\x00${pe}`;if(Na.has(ve))continue;Na.add(ve),console.warn(`[stx] ${xe.basename(U)} reads \`${pe}\` with defineProps(), which is not live, but ${xe.basename(l)} binds it (:${pe}): the value can arrive empty or stale (on a native screen, and for a :for's rows, it does not arrive at all). Read it with useReactiveProp('${pe}').`)}let le=new Set(["__originalFilePath","__importedComponents",ls,"__stx_client_signal_names","__stx_client_declared_names","__stx_runtime_config","__stxServeContext","__stx_scope_seq"]),de={};for(let[pe,ve]of Object.entries(a))if(!pe.startsWith("__")||le.has(pe))de[pe]=ve;let Ee=S.length>0?{[ms]:[...S]}:{},Re=r;if(r.includes("@include")){let{processIncludes:pe}=await o("stx/includes",()=>import("./chunk-a7x8897c.js"));Re=await pe(r,a,l,u,v)}if(/<[A-Z][\w.-]*[\s/>]/.test(Re)){let{processComponents:pe}=await o("stx/component-renderer",()=>import("./chunk-6cnahhm1.js")),ve={...a,__processedComponents:M,...Ee};Re=await pe(Re,ve,l,u,v);let Me=ve.__stx_preserved_client_expressions;if(Array.isArray(Me)&&Me.length>0)a.__stx_preserved_client_expressions=[...new Set([...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...Me])]}let we=[];if(kl(Re)){let{processExpressions:pe}=await o("stx/expressions",()=>import("./chunk-52njxk3w.js")),ve=a.__stx_signals_gate===void 0?{...a,__stx_signals_gate:!0,...Ee}:S.length>0?{...a,...Ee}:a;Re=pe(Re,ve,l);for(let Me of Re.matchAll(/\{\{([\s\S]*?)\}\}/g))we.push(Me[1].trim())}let ge=se(Re),ze=[],Fe=ge.output.replace(/\x00STX_SCRIPT_(\d+)\x00/g,(pe,ve)=>{let Me=ge.scripts[Number(ve)]||"",$e=Me.match(/^<script\b([^>]*)>/i)?.[1]||"",lt=$e.match(/\btype\s*=\s*["']([^"']+)["']/i)?.[1]?.toLowerCase(),Qe=!lt||["module","text/javascript","application/javascript"].includes(lt),Ot=/\sdata-stx-(?:owner|instance)(?=[\s=/>])/i.test(` ${$e}`);if(!/\bserver\b/i.test($e)&&Qe&&!Ot)return ze.push(Me),"";return Me}),{extractSlotContent:it}=await o("stx/slots",()=>import("./chunk-9mjr6187.js")),rt=it(Fe),wt={};if(rt.defaultSlot?.trim())wt.default=rt.defaultSlot;for(let[pe,ve]of rt.namedSlots)wt[pe]=ve.content;let ft=a.__stx_scope_seq??={n:0,key:lo(String(a.__filename??l))},ot=Ba(e,process.cwd()),je=`stx_${(ot.endsWith(".stx")?ot.slice(0,-4):ot).replace(/[^a-zA-Z0-9]/g,"_")}_${++ft.n}_${ft.key}`,Ae={...de,$uid:je,$native:u._nativeHostAttrs===!0,...n,props:n,slot:Fe,$slots:wt,__processedComponents:V,__sections:{},__stx_signals_gate:Ne(ce)||kl(r),__stx_preserved_client_expressions:[...Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[],...we]};if(/import\s/.test(ce)){Ae.__importedComponents=new Map(Ae.__importedComponents);let{processESImports:pe}=await o("stx/component-renderer",()=>import("./chunk-6cnahhm1.js"));ce=await pe(ce,Ae,U,u,v)}jp(ce,Ae,n);let dt=ce,nt=B(dt);if(nt)dt=nt.content.trim();let pn=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,Pt=[...ce.matchAll(pn)];for(let[,pe,ve]of Pt)if(!/\bserver\b|\bsrc\s*=|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/i.test(pe))We(ve,U,u.strict);let vt=[],fn=null,js=Pt.some((pe)=>/\bserver\b/.test(pe[1]||"")&&/\bcache\b/.test(pe[1]||"")),Jt=null,Rt=null,dn=null,Un=0,gn=null;if(Rp(u),js&&Pr>0){let pe=Tp({props:n,slot:Re,slotContext:r.trim()?Ap(de):void 0,buildMode:u.buildMode??"",skipEventDirectives:u.skipEventDirectives===!0,native:u._nativeHostAttrs===!0,clientLoopNames:[...S].sort(),layers:u._layerGraph?.layers.map((ve)=>ve.configFile),uid:je});if(pe!==null){Jt=`${U}\x00${E(ce)}\x00${pe}`;let ve=As.get(Jt);if(ve){for(let Me of ve.dependencies)v.add(Me);if(Ki(a,ve.clientFactories),ft.n+=ve.uidsConsumed,ve.preservedClientExpressions.length>0){let Me=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let $e of ve.preservedClientExpressions)Me.add($e);a.__stx_preserved_client_expressions=[...Me]}return ve.output}Rt=new Set(v),dn=Ci(a),Un=ft.n,gn=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[])}}let mn=new Set;for(let pe of Pt){let ve=pe[1]||"",Me=pe[2]||"",$e=ve.includes("server");if(Xe(ve)&&Me.trim())Me=Je(Me);if($e&&Me){for(let Qe of ye(Me))mn.add(Qe);try{await L(Me,Ae,U,{onFailure:(Qe)=>{if(Qe.kind!=="unknown")fn=Qe.kind}})}catch(Qe){}}if(!$e){let Qe=Me.replace(/^\s*const\s*\{[^}]+\}\s*=\s*window\.stx\s*;?\s*\n?/gm,""),Ot=Qe.includes("{{")&&Qe.includes("}}"),Yt=Qe.includes("{!!")&&Qe.includes("!!}");if(Ot||Yt)Qe=Wi(Qe,Ae,U);let Dt=ve.replace(/\s*\bts\b/g,"").replace(/\s*\blang\s*=\s*["']?(ts|typescript)["']?/gi,"");vt.push(`<script${Dt}>${Qe}</script>`)}}let St=se(ce).output.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i),hn=St?St[1]:"",Ps=St?St[2]:"",Tt="",ue=hn&&/\bscoped\b/i.test(hn);if(St)Tt=`<style${hn}>${Mp(Ps,Ae,U)}</style>`;let fe=dt;if(fe=fe.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),St)fe=fe.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");{let pe=/@push\s*\(\s*['"]styles['"]\s*\)([\s\S]*?)@endpush/gi,ve=[];if(fe=fe.replace(pe,(Me,$e)=>{let lt=$e.match(/<style\b([^>]*)>([\s\S]*?)<\/style>/i);if(lt)ve.push(`<style${lt[1]}>${lt[2]}</style>`);return""}),fe=fe.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/gi,""),ve.length>0)Tt=`${Tt}${ve.join(`
1187
+ `)}`}if(r&&fe.includes("{{ text || slot }}"))fe=fe.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g,()=>r);let{applySlots:Se}=await o("stx/slots",()=>import("./chunk-9mjr6187.js")),{defaultSlot:Be,namedSlots:tt}=rt,at=a.__stx_signals_gate===!0&&/\s(?:@[\w:.-]+|x-on:[\w:.-]+)\s*=/.test(Fe),Et=vt.length>0&&pr(fe)||u._nativeHostAttrs===!0&&vt.length>0||at&&vt.length>0||vt.some((pe)=>/\b(?:state|derived|effect|ref|useRef|reactive|computed|watch|watchEffect|useModel|useReactiveProp|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots)\s*(?:<[^<>()]*>)?\s*\(/.test(pe)),Ms=(pe)=>Et?Vo(pe,je):pe,Ds=new Map([...tt].map(([pe,ve])=>[pe,{...ve,content:Ms(ve.content)}]));fe=await Se(fe,Et?Fo(Ms(Be),je):Be,Ds,Ae,Et?je:"");let Hn=Vi(vt),xn=(Array.isArray(Ae.__stx_client_signal_names)?Ae.__stx_client_signal_names:[]).filter((pe)=>!mn.has(pe));if(Hn.length>0||xn.length>0)Ae.__stx_client_signal_names=[...new Set([...xn,...Hn])];else delete Ae.__stx_client_signal_names;let bn=S.filter((pe)=>!mn.has(pe)&&!(pe in n));if(bn.length>0)Ae[ms]=bn;let Kn={...u,_rootComponentsDir:u._rootComponentsDir||u.componentsDir,componentsDir:xe.dirname(U),skipSignalsRuntime:!0,skipEventDirectives:u._nativeHostAttrs===!0||Et||vt.length===0,defaultLayout:void 0};Ae.__stxProcessingDepth=(a.__stxProcessingDepth||0)+1;let{processDirectives:qn}=await o("stx/process",()=>import("./chunk-15qrs231.js")),At=await qn(fe,Ae,U,Kn,v),Mt=new Set(Array.isArray(a.__stx_preserved_client_expressions)?a.__stx_preserved_client_expressions:[]);for(let pe of At.matchAll(/\{\{([\s\S]*?)\}\}/g))Mt.add(pe[1].trim());if(Mt.size>0)a.__stx_preserved_client_expressions=[...Mt];let It=je,ct=At;if(Et){let pe="";if(Object.keys(n).length>0)try{pe=` data-stx-props="${kr(JSON.stringify(n))}"`}catch{}let ve=Z?` stx-hydrate="${kr(Z)}"`:"",Me=Object.fromEntries(Object.entries(wt).map(([Lt,Qt])=>[Lt,Boolean(Qt)])),$e=Object.keys(Me).length>0?` data-stx-slots="${kr(JSON.stringify(Me))}"`:"",lt=` data-stx-scope="${It}"${pe}${$e}${ve}`,Qe=At.slice(Ut(At)),Ot=/^<span(?=[\s/>])/i.test(Qe),Yt=/^<[^>]+\bdata-stx-layout-root(?:\s|=|>)/i.test(Qe),Dt=/^<[^>]+\bdata-stx-fill-root(?:\s|=|>)/i.test(Qe),Zn=Ot?"span":"div",Ns=Yt&&u._nativeHostAttrs?' style="display:flex;flex-direction:column;flex:1;min-height:0;min-width:0"':Dt&&u._nativeHostAttrs?' style="width:100%;height:100%"':Ot||Yt?' style="display:contents"':"";ct=Wg(At,lt)??`<${Zn}${lt} data-stx-component-wrapper${Ns}>${At}</${Zn}>`;let Ls=await Promise.all(vt.map(async(Lt)=>{let Qt=Lt.match(/<script([^>]*)>([\s\S]*)<\/script>/i);if(!Qt)return Lt;let[,yn,zs]=Qt,Jn=Ta(Lt,Ae,U);if(Jn!==null)return Jn;let en=await Lp(zs,U,u.buildMode==="compile"),Xn=Pn(en.clientCode,Ke(Ae)),{vendorStyleTags:Gn}=en,Yn=Xn?`function(__scopeId) {
1188
1188
  ${Xn}
1189
1189
  return (${en.factoryBody})(__scopeId);
1190
1190
  }`:en.factoryBody,Qn=Z?null:rr(a,Yn),es=Qn?`window.__stxComponentFactories[${JSON.stringify(Qn)}](${JSON.stringify(It)});`:`(${Yn})(${JSON.stringify(It)});`;if(Z)return`${Gn}<script type="stx/island" data-stx-island="${It}" data-stx-scoped data-stx-owner="${It}"${yn}>${me(es)}</script>`;return`${Gn}<script data-stx-scoped data-stx-run="always" data-stx-owner="${It}"${yn}>${me(es)}</script>`}));if(ct=ct+`
@@ -1210,7 +1210,7 @@ ${He.yellow}${He.bold}Message:${He.reset} ${n}
1210
1210
  `,f)I+=`
1211
1211
  ${He.blue}${He.bold}Context:${He.reset}
1212
1212
  ${He.dim}${f}${He.reset}
1213
- `;return I}function Ce(){Fn.clear(),Rr.clear(),Ts.clear(),Tr.clear(),Ar.clear(),Ir.clear(),As.clear()}function Ry(){return{size:Fn.size,maxSize:500}}var Cr=k(128);async function Lp(e,n,r){let i=E(e,n,r),a=Cr.get(i);if(a){if(eo(a.deps))return a;Cr.delete(i)}let l=zi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Hi(l.styles);u=Xt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-2vqamyay.js")),I=[],j=!1;if(v(u)){let G=u;u=await S(G,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===G}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-hpqvq1r9.js"));u=L(u);let M=D(u),V=Op(M),W=new Set(X(M,!0).split(",").map((G)=>G.trim())),Z=`function(__scopeId) {
1213
+ `;return I}function Ce(){Fn.clear(),Rr.clear(),Ts.clear(),Tr.clear(),Ar.clear(),Ir.clear(),As.clear()}function Ry(){return{size:Fn.size,maxSize:500}}var Cr=k(128);async function Lp(e,n,r){let i=E(e,n,r),a=Cr.get(i);if(a){if(eo(a.deps))return a;Cr.delete(i)}let l=zi(e,{filePath:n,projectRoot:process.cwd()}),u=l.code,f=Hi(l.styles);u=Xt(u).code;let{hasUserImports:v,bundleClientScript:S}=await o("stx/client-script-bundler",()=>import("./chunk-c05zj2m9.js")),I=[],j=!1;if(v(u)){let G=u;u=await S(G,n,{projectRoot:process.cwd(),minify:r,collectInputs:I}),j=u===G}let{stripStxRuntimeImports:L}=await o("stx/signal-processing",()=>import("./chunk-03ymcxsb.js"));u=L(u);let M=D(u),V=Op(M),W=new Set(X(M,!0).split(",").map((G)=>G.trim())),Z=`function(__scopeId) {
1214
1214
  ${xt("const",[...Fl,...V],M)}
1215
1215
  const __scope = window.stx._scopes = window.stx._scopes || {};
1216
1216
  const __scopeVars = __scope[__scopeId] = __scope[__scopeId] || {};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ze,z,Jt}from"./chunk-esm0pnpz.js";import{T}from"./chunk-0jdz31q1.js";import{Tt,je,U,st,Be,La,jo,ja,Gn}from"./chunk-4wd5sn16.js";import{Dt,Se,pt}from"./chunk-0b57fgpn.js";import{ei}from"./chunk-becs8132.js";import{Xn}from"./chunk-gnf1e5q7.js";import{Re}from"./chunk-e0bwzxfd.js";import Z from"fs";import P from"path";var{serve:ae}=globalThis.Bun;import O from"zlib";import{promisify as Y}from"util";var K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function se(t){if(!t)return null;let e=re(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var J=33554432,V=new Map,D=0;function oe(t,e){if(e.length>J/8)return;V.set(t,e),D+=e.length;for(let[a,r]of V){if(D<=J)break;V.delete(a),D-=r.length}}async function Un(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let r=se(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:Q(e.headers)});if(i.length<(a.threshold??te))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=V.get(g);if(!l)l=r==="br"?await Y(O.brotliCompress)(i,{params:{[O.constants.BROTLI_PARAM_QUALITY]:h,[O.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Y(O.gzip)(i),oe(g,l);if(l.length>=i.length)return f();let m=Q(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function Q(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new T(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",U(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${je(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let b=new Headers(s.headers);return b.set("Cache-Control","private, no-store"),b.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:b})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let v=this.generation,_=async()=>{let s=await a();r=s;let b=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||b.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",U(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===v)this.entries.set(h,n);return n},x=this.pending.get(h);if(!x){if(this.pending.size>=1000)return i();x=_().finally(()=>{if(this.pending.get(h)===x)this.pending.delete(h)}),this.pending.set(h,x)}if(g&&m<e.maxAge+(e.swr??0))return x.catch(()=>{}),l(g);let M=await x;return M?l(M):i()}}var ie={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function Em(t={}){let e=P.resolve(t.outputDir||".output"),a=t.port??3000,r=La(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=Xn(r.routeRules),f=new G,h=ei(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?z(l):void 0,v=new Map,_=new Map,x=new Map,M=new Map;for(let n of r.routes)try{let y=P.join(e,n.compiledPath),c=JSON.parse(await Bun.file(y).text());if(m)c.html=Jt(c.html,m);v.set(n.pattern,c),x.set(n.pattern,pt(c.html)),M.set(n.pattern,Re(c.html));let j=P.join(e,n.fragmentPath);if(st(c.html,r.routerContainer||"main")&&await Bun.file(j).exists()){let A=await Bun.file(j).text();_.set(n.pattern,m?Jt(A,m):A)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,b=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:c}=Se(n.pattern,{page:!0});b.push({regex:y,route:n,paramNames:c})}else s.set(n.pattern,n);let E=ae({port:a,async fetch(n){return Un(n,await Ze(m??z(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let j=await h(n);if(j)return j;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let R=P.extname(u).toLowerCase(),B=ie[R]||"application/octet-stream",X=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":X?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=je(n),C=null,q={};if(C=s.get(c)||null,!C)for(let{regex:p,route:d,paramNames:u}of b){let o=c.match(p);if(o){C=d,u.forEach((R,B)=>{q[R]=o[B+1]});break}}if(!C){let p=Dt(c)?null:s.get("/404")||null;if(p){let d=v.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let N=i(c),W=Object.keys(N).length>0;return f.respond(n,N.cache,async()=>{let p=v.get(C.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=_.get(C.pattern);if(o){let R=x.get(C.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...M.has(C.pattern)?{"X-STX-Runtime":M.get(C.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...U(),...N.cache?{}:{"Cache-Control":Tt}}})}}let d=jo(n.method),u=v.get(C.pattern);if(!u){let o=s.get("/500")||null;if(o){let R=v.get(o.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(C.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...U(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:R,redirect:B,cookies:X,status:H,headers:F}=await Gn(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return ja(B,X,F);if(R&&R.length>0){let{renderStreamingPage:S,streamToResponse:I}=await import("./chunk-y10eaxgc.js"),L=new Headers({...U(),...F,"Cache-Control":"private, no-store"});for(let k of X??[])L.append("Set-Cookie",k);if(A&&!d&&st(o,r.routerContainer||"main")){let k=pt(o);L.set("X-STX-Fragment","true"),L.set("X-STX-Runtime",Re(o)?"true":"false"),L.set("X-STX-Layout",k.layout),L.set("X-STX-Layout-Group",k.group)}return I(S(A&&!d&&st(o,r.routerContainer||"main")?Be(o,r.routerContainer||"main",!0):o,R,{timeoutMs:30000}),{status:H??u.status??200,headers:L})}let w=new Headers({"Content-Type":"text/html",...U(),...N.cache?{}:{"Cache-Control":"private, no-store"}});for(let S of X??[])w.append("Set-Cookie",S);for(let[S,I]of Object.entries(F??{}))w.set(S,I);if(w.set("Vary",U(w.get("Vary")).Vary),A&&!d&&st(o,r.routerContainer||"main")){let S=pt(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",Re(o)?"true":"false"),w.set("X-STX-Layout",S.layout),w.set("X-STX-Layout-Group",S.group),new Response(Be(o,r.routerContainer||"main",!0),{status:H??u.status??200,headers:w})}return new Response(o,{status:H??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${v.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
2
+ import{Ze,z,Jt}from"./chunk-esm0pnpz.js";import{T}from"./chunk-0jdz31q1.js";import{Tt,je,U,st,Be,La,jo,ja,Gn}from"./chunk-sn1qtgmc.js";import{Dt,Se,pt}from"./chunk-0b57fgpn.js";import{ei}from"./chunk-ntvgvvrh.js";import{Xn}from"./chunk-gnf1e5q7.js";import{Re}from"./chunk-yar3c574.js";import Z from"fs";import P from"path";var{serve:ae}=globalThis.Bun;import O from"zlib";import{promisify as Y}from"util";var K=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],ee=["text/event-stream","multipart/x-mixed-replace"],te=1024;function ne(t){if(!t)return!1;let e=t.toLowerCase();if(ee.some((a)=>e.startsWith(a)))return!1;return K.some((a)=>e.startsWith(a))}function re(t){let e=new Map;for(let a of t.split(",")){let[r,...i]=a.trim().split(";"),f=r.trim().toLowerCase();if(!f)continue;let h=1;for(let g of i){let l=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(g);if(!l)continue;let m=Number.parseFloat(l[1]);if(Number.isFinite(m))h=m}e.set(f,h)}return e}function se(t){if(!t)return null;let e=re(t),a=e.get("*"),r=(i)=>e.get(i)??a??0;if(r("br")>0)return"br";if(r("gzip")>0)return"gzip";return null}var J=33554432,V=new Map,D=0;function oe(t,e){if(e.length>J/8)return;V.set(t,e),D+=e.length;for(let[a,r]of V){if(D<=J)break;V.delete(a),D-=r.length}}async function Un(t,e,a={}){if(e.headers.get("content-encoding"))return e;if(e.status===204||e.status===304||!e.body)return e;if(!ne(e.headers.get("content-type")))return e;let r=se(t.headers.get("accept-encoding"));if(!r)return e;let i;try{i=new Uint8Array(await e.arrayBuffer())}catch{return e}let f=()=>new Response(i,{status:e.status,statusText:e.statusText,headers:Q(e.headers)});if(i.length<(a.threshold??te))return f();try{let h=a.quality??5,g=`${r}:${h}:${i.length}:${Bun.hash(i)}`,l=V.get(g);if(!l)l=r==="br"?await Y(O.brotliCompress)(i,{params:{[O.constants.BROTLI_PARAM_QUALITY]:h,[O.constants.BROTLI_PARAM_SIZE_HINT]:i.length}}):await Y(O.gzip)(i),oe(g,l);if(l.length>=i.length)return f();let m=Q(e.headers);return m.set("Content-Encoding",r),m.set("Content-Length",String(l.length)),new Response(l,{status:e.status,statusText:e.statusText,headers:m})}catch{return f()}}function Q(t){let e=new Headers(t),a=e.get("Vary");if(!a)return e.set("Vary","Accept-Encoding"),e;if(!a.split(",").some((i)=>i.trim().toLowerCase()==="accept-encoding"))e.set("Vary",`${a}, Accept-Encoding`);return e}class G{now;entries=new T(1000,{maxBytes:33554432,sizeOf:(t)=>t.body.byteLength+JSON.stringify(t.headers).length*2});pending=new Map;generation=0;constructor(t=Date.now){this.now=t}invalidate(t){this.generation++,this.pending.clear();for(let e of Array.from(this.entries.keys()))if(t===void 0||this.entries.get(e)?.path===t)this.entries.delete(e)}async respond(t,e,a){let r,i=async()=>{let s=r??await a();return s.headers.set("Cache-Control","private, no-store"),s.headers.set("Vary",U(s.headers.get("Vary")).Vary),s};if(!e||t.method!=="GET"||t.headers.has("Cookie")||t.headers.has("Authorization")||t.headers.has("Range"))return i();let f=new URL(t.url),h=`${f.origin}${f.pathname}${f.search}|${je(t)?"fragment":"document"}`,g=this.entries.get(h),l=(s)=>{let b=new Headers(s.headers);return b.set("Cache-Control","private, no-store"),b.set("Age",String(Math.max(0,Math.floor((this.now()-s.created)/1000)))),new Response(s.body.slice(0),{headers:b})},m=g?(this.now()-g.created)/1000:1/0;if(g&&m<e.maxAge)return l(g);let v=this.generation,_=async()=>{let s=await a();r=s;let b=(s.headers.get("Vary")??"").toLowerCase().split(",").map((y)=>y.trim()).filter(Boolean);if(s.status!==200||s.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(s.headers.get("Cache-Control")??"")||b.some((y)=>y!=="x-stx-router"&&y!=="accept-encoding"))return null;let E=await s.clone().arrayBuffer();if(E.byteLength>1048576)return null;s.headers.set("Vary",U(s.headers.get("Vary")).Vary);let n={body:E,headers:Array.from(s.headers.entries()),created:this.now(),path:f.pathname};if(this.generation===v)this.entries.set(h,n);return n},x=this.pending.get(h);if(!x){if(this.pending.size>=1000)return i();x=_().finally(()=>{if(this.pending.get(h)===x)this.pending.delete(h)}),this.pending.set(h,x)}if(g&&m<e.maxAge+(e.swr??0))return x.catch(()=>{}),l(g);let M=await x;return M?l(M):i()}}var ie={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function Em(t={}){let e=P.resolve(t.outputDir||".output"),a=t.port??3000,r=La(e);if(!r)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${r.routes.length} routes...`);let i=Xn(r.routeRules),f=new G,h=ei(e,r.apiRoutes??[]),g=Bun.file(P.join(e,"server/runtime-config.json")),l=t.runtimeConfig??(await g.exists()?await g.json():void 0),m=l?z(l):void 0,v=new Map,_=new Map,x=new Map,M=new Map;for(let n of r.routes)try{let y=P.join(e,n.compiledPath),c=JSON.parse(await Bun.file(y).text());if(m)c.html=Jt(c.html,m);v.set(n.pattern,c),x.set(n.pattern,pt(c.html)),M.set(n.pattern,Re(c.html));let j=P.join(e,n.fragmentPath);if(st(c.html,r.routerContainer||"main")&&await Bun.file(j).exists()){let A=await Bun.file(j).text();_.set(n.pattern,m?Jt(A,m):A)}}catch(y){console.warn(`[stx] Failed to load route ${n.pattern}:`,y)}let s=new Map,b=[];for(let n of r.routes)if(n.hasParams){let{regex:y,params:c}=Se(n.pattern,{page:!0});b.push({regex:y,route:n,paramNames:c})}else s.set(n.pattern,n);let E=ae({port:a,async fetch(n){return Un(n,await Ze(m??z(),async()=>{let c=new URL(n.url).pathname;if(t.onRequest){let p=await t.onRequest(n);if(p)return p}if(t.apiRouter){let p=await t.apiRouter.handleRequest(n);if(p.status!==404)return p}if(t.apiRoutes?.[c])return t.apiRoutes[c](n);let j=await h(n);if(j)return j;if((n.method==="GET"||n.method==="HEAD")&&c!=="/"){let p=P.resolve(e,"public"),d;try{d=decodeURIComponent(c)}catch{d=c}if(!d.includes("\x00")){let u=P.resolve(p,`.${d}`);if(u===p||u.startsWith(`${p}${P.sep}`))try{if(Z.existsSync(u)&&Z.statSync(u).isFile()){let R=P.extname(u).toLowerCase(),B=ie[R]||"application/octet-stream",X=c.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(c);return new Response(Bun.file(u),{headers:{"Content-Type":B,"Cache-Control":X?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let A=je(n),C=null,q={};if(C=s.get(c)||null,!C)for(let{regex:p,route:d,paramNames:u}of b){let o=c.match(p);if(o){C=d,u.forEach((R,B)=>{q[R]=o[B+1]});break}}if(!C){let p=Dt(c)?null:s.get("/404")||null;if(p){let d=v.get(p.pattern);if(d)return new Response(d.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain; charset=utf-8"}})}let N=i(c),W=Object.keys(N).length>0;return f.respond(n,N.cache,async()=>{let p=v.get(C.pattern);if(A&&n.method==="GET"&&p&&!p.hasServerScripts&&Object.keys(p.placeholders).length===0){let o=_.get(C.pattern);if(o){let R=x.get(C.pattern);return new Response(o,{status:p.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...M.has(C.pattern)?{"X-STX-Runtime":M.get(C.pattern)?"true":"false"}:{},...R?{"X-STX-Layout":R.layout,"X-STX-Layout-Group":R.group}:{},...U(),...N.cache?{}:{"Cache-Control":Tt}}})}}let d=jo(n.method),u=v.get(C.pattern);if(!u){let o=s.get("/500")||null;if(o){let R=v.get(o.pattern);if(R)return new Response(R.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(C.prerendered&&d)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!d&&!u.hasServerScripts&&Object.keys(u.placeholders).length===0)return new Response(u.html,{status:u.status??200,headers:{"Content-Type":"text/html",...U(),"Cache-Control":"public, max-age=60"}});try{let{html:o,boundaries:R,redirect:B,cookies:X,status:H,headers:F}=await Gn(u,{params:q,request:n,method:n.method,__stx_strict_hydration:W,__stx_runtime_config:m});if(B)return ja(B,X,F);if(R&&R.length>0){let{renderStreamingPage:S,streamToResponse:I}=await import("./chunk-3043ycz6.js"),L=new Headers({...U(),...F,"Cache-Control":"private, no-store"});for(let k of X??[])L.append("Set-Cookie",k);if(A&&!d&&st(o,r.routerContainer||"main")){let k=pt(o);L.set("X-STX-Fragment","true"),L.set("X-STX-Runtime",Re(o)?"true":"false"),L.set("X-STX-Layout",k.layout),L.set("X-STX-Layout-Group",k.group)}return I(S(A&&!d&&st(o,r.routerContainer||"main")?Be(o,r.routerContainer||"main",!0):o,R,{timeoutMs:30000}),{status:H??u.status??200,headers:L})}let w=new Headers({"Content-Type":"text/html",...U(),...N.cache?{}:{"Cache-Control":"private, no-store"}});for(let S of X??[])w.append("Set-Cookie",S);for(let[S,I]of Object.entries(F??{}))w.set(S,I);if(w.set("Vary",U(w.get("Vary")).Vary),A&&!d&&st(o,r.routerContainer||"main")){let S=pt(o);return w.set("X-STX-Fragment","true"),w.set("X-STX-Runtime",Re(o)?"true":"false"),w.set("X-STX-Layout",S.layout),w.set("X-STX-Layout-Group",S.group),new Response(Be(o,r.routerContainer||"main",!0),{status:H??u.status??200,headers:w})}return new Response(o,{status:H??u.status??200,headers:w})}catch(o){if(console.error(`[stx] Hydration error for ${c}:`,o),W)return new Response("Internal Server Error",{status:500});return new Response(u.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${E.port}`),console.log(`[stx] Serving ${r.routes.length} routes (${v.size} pre-loaded)`),{port:E.port,stop:()=>{f.invalidate(),E.stop()},invalidate:(n)=>f.invalidate(n)}}
3
3
  export{Un,Em};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{hg,gy,my,hy,yy,yg,bg,by,wy,yi,vy,Cr,Er,Ls}from"./chunk-g065d7p7.js";import{gt}from"./chunk-zkwkhesc.js";import"./chunk-9m45t60c.js";import"./chunk-472w7t7p.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{yy as __setSignalsGeneratorsForTest,gt as cacheEngineFingerprint,Er as cacheTemplate,Cr as checkCache,vy as clearDevCaches,bg as getCachedRouterScript,yg as getCachedSignalsRuntime,by as getServeClientAsset,yi as getServeModuleBundle,Ls as hashFilePath,my as invalidateFileCache,hy as invalidateFileCacheByDir,gy as readFileCached,wy as registerServeModuleBundle,hg as templateCache};
2
+ import{hg,gy,my,hy,yy,yg,bg,by,wy,yi,vy,Cr,Er,Ls}from"./chunk-ccgcj9tg.js";import{gt}from"./chunk-zkwkhesc.js";import"./chunk-p80nnmha.js";import"./chunk-q3we5jsk.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{yy as __setSignalsGeneratorsForTest,gt as cacheEngineFingerprint,Er as cacheTemplate,Cr as checkCache,vy as clearDevCaches,bg as getCachedRouterScript,yg as getCachedSignalsRuntime,by as getServeClientAsset,yi as getServeModuleBundle,Ls as hashFilePath,my as invalidateFileCache,hy as invalidateFileCacheByDir,gy as readFileCached,wy as registerServeModuleBundle,hg as templateCache};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Dn,z}from"./chunk-esm0pnpz.js";import m from"fs";import e from"path";async function Mn(r,o,i){if(r.__stx_runtime_config)return;let n=Dn();if(n||i){r.__stx_runtime_config=n??z(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-cgqpn3e2.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=z(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ki(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{Dn,z}from"./chunk-esm0pnpz.js";import m from"fs";import e from"path";async function Mn(r,o,i){if(r.__stx_runtime_config)return;let n=Dn();if(n||i){r.__stx_runtime_config=n??z(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-yjs11rre.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=z(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ki(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-hdfhaddy.js";import"./chunk-7b3dqeyr.js";import"./chunk-0jdz31q1.js";import"./chunk-5g5khx0m.js";import{k,E,A,ie}from"./chunk-9m45t60c.js";import"./chunk-945zygwa.js";import"./chunk-esm0pnpz.js";import"./chunk-472w7t7p.js";import{xr}from"./chunk-eb5v9npc.js";import{existsSync as C}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],_=new Set(b);var u=new Map,h=k(64),S=new Set,y=0,R=new Set(b);function z(){u.clear(),h.clear()}function P(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function I(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function M(s){if(!s)return[];let o=E(s,y),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of R){if(S.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function L(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=xr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=M(s);if(t.length===0)return null;let i=o??L();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=ie({loader:"ts",target:"browser",define:A()}),v=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=P(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>v.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
2
+ import"./chunk-hdfhaddy.js";import"./chunk-7b3dqeyr.js";import"./chunk-0jdz31q1.js";import"./chunk-5g5khx0m.js";import{k,E,A,ie}from"./chunk-p80nnmha.js";import"./chunk-945zygwa.js";import"./chunk-esm0pnpz.js";import"./chunk-q3we5jsk.js";import{xr}from"./chunk-eb5v9npc.js";import{existsSync as C}from"fs";import l from"path";var b=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useCompletion","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVirtualList","useVisibility","useWakeLock","useWindowSize"],_=new Set(b);var u=new Map,h=k(64),S=new Set,y=0,R=new Set(b);function z(){u.clear(),h.clear()}function P(s){let o=new Map;for(let t of s){let i=l.basename(t);if(i.endsWith(".d.ts"))continue;let r=i.replace(/\.[jt]s$/,"");if(r==="index")continue;if(r===i)continue;let a=o.get(r);if(a&&!a.endsWith(".js"))continue;o.set(r,t)}return[...o.values()].sort()}function I(s,o){let t=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${t}\\b`).test(s)}function M(s){if(!s)return[];let o=E(s,y),t=h.get(o);if(t)return t.slice();let i=s.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),r=[];for(let a of R){if(S.has(a))continue;let p=a.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${p}\\s*\\(`).test(i))r.push(a)}return r.sort(),h.set(o,r),r.slice()}function L(){let s=l.join(import.meta.dir,"composables"),o=import.meta.url.endsWith(".ts")?"ts":"js";if(C(l.join(s,`index.${o}`)))return s;let t=xr("@stacksjs/stx/composables");return t?l.dirname(t):void 0}async function V(s,o){let t=M(s);if(t.length===0)return null;let i=o??L();if(!i)return null;let r=`${i}\x00${t.join(",")}`,a=u.get(r);if(a!==void 0)return a||null;let p=ie({loader:"ts",target:"browser",define:A()}),v=new Set(t),m=[],d=new Set,f=[];try{let n=new Bun.Glob("*.{ts,js}");for await(let e of n.scan({cwd:i,absolute:!0}))f.push(e)}catch{return u.set(r,""),null}f=P(f);for(let n of f){let e;try{e=await Bun.file(n).text()}catch{continue}let g=[];try{g=p.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!g.some((c)=>v.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),m.push(`// ${l.basename(n).replace(/\.[jt]s$/,"")}
3
3
  ${p.transformSync(e).trim()}`);for(let c of g)d.add(c)}catch(c){console.warn(`[stx] framework composable ${l.basename(n)} could not be bundled:`,c)}}let w=t.filter((n)=>!d.has(n)&&!I(s,n));if(w.length>0)console.warn(`[stx] could not bundle ${w.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(m.length===0)return u.set(r,""),null;let O=[...d].map((n)=>` try { if (!(${JSON.stringify(n)} in __s)) { __s[${JSON.stringify(n)}] = ${n}; if (!(${JSON.stringify(n)} in window)) window[${JSON.stringify(n)}] = ${n}; } } catch (e) {}`).join(`
4
4
  `),x=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
5
  ;(function(){
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ya,Za,Qa,ec,ey}from"./chunk-e42x1k6j.js";import"./chunk-7nn5s0c3.js";import"./chunk-ndwvgwvs.js";import"./chunk-9ejk9mwk.js";import"./chunk-sxkkxmkc.js";import"./chunk-gypna2zb.js";import"./chunk-f32mtkqf.js";import"./chunk-de61k0ab.js";import"./chunk-ybpxtaft.js";import"./chunk-77nn1ckz.js";import"./chunk-5qkd77vw.js";import"./chunk-5jrpzepc.js";import"./chunk-kmby9q2c.js";import"./chunk-yar3c574.js";import"./chunk-vbmvft7g.js";import"./chunk-ccgcj9tg.js";import"./chunk-65g78sge.js";import"./chunk-hg31hs5d.js";import"./chunk-5hksy9tt.js";import"./chunk-5mrt1enm.js";import"./chunk-vw7crz0z.js";import"./chunk-150cz8qq.js";import"./chunk-0b57fgpn.js";import"./chunk-p80nnmha.js";import"./chunk-q3we5jsk.js";import"./chunk-esm0pnpz.js";import"./chunk-945zygwa.js";import"./chunk-7b3dqeyr.js";import"./chunk-5g5khx0m.js";import"./chunk-0jdz31q1.js";import"./chunk-hdfhaddy.js";export{Ya as buildNative,ey as default,Za as findCraftBinary,ec as getAvailableFormats,Qa as getAvailableTargets};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{jn}from"./chunk-945zygwa.js";import{B,Q,x,Kt,Gt,Fr,y,$l,Ui,Y,N}from"./chunk-9m45t60c.js";import{gn}from"./chunk-9jpsxqaf.js";import{r}from"./chunk-9vafweyd.js";import{ne}from"./chunk-qykbjg3z.js";import{L,c}from"./chunk-p92272k0.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function I(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Z(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=n.exec(t))!==null){if(I(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!Z(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,h;while((h=f.exec(t))!==null){if(I(h.index,i))continue;let b=h[1]==="/";if(!b&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=b?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:h.index,tagName:l}}return null}return null}var Tt="private, no-store";function cn(t){return t.replace(/&#(\d+);/g,(s,e)=>F(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>F(Number.parseInt(e,16),s)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function F(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function je(t){return t.headers.get("X-STX-Router")==="true"}function tt(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function U(t){return{Vary:tt(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function D(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return x(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function H(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function qn(t){let s=[];for(let e of D(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=H(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=cn(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${E(n.content??"")}">`)}else{let i=cn(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${E(n.href??"")}"${i==="alternate"?` hreflang="${E(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
2
+ import{jn}from"./chunk-945zygwa.js";import{B,Q,x,Kt,Gt,Fr,y,$l,Ui,Y,N}from"./chunk-p80nnmha.js";import{gn}from"./chunk-kxh9rqdm.js";import{r}from"./chunk-77nn1ckz.js";import{ne}from"./chunk-qykbjg3z.js";import{L,c}from"./chunk-p92272k0.js";var X=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function J(t){let s=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,n;while((n=e.exec(t))!==null)s.push({start:n.index,end:n.index+n[0].length});return s}function I(t,s){return s.some((e)=>t>=e.start&&t<e.end)}function K(t){let s=(t||"").trim();if(!s)return null;if(/[\s>+~,:]/.test(s))return null;let e={},n=s,i=n.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),n=n.slice(i[0].length);while(n.length>0){let o=n.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(o){if(e.attr=o[1],o[3]!==void 0&&o[3]!=="")e.attrValue=o[3];n=n.slice(o[0].length);continue}let l=n.match(/^#([\w-]+)/);if(l){e.id=l[1],n=n.slice(l[0].length);continue}let a=n.match(/^\.([\w-]+)/);if(a){e.className=a[1],n=n.slice(a[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function Z(t,s){if(s.attr){if(!(s.attrValue===void 0?new RegExp(`\\b${s.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${s.attr}\\s*=\\s*(["'])\\s*${s.attrValue}\\s*\\1`,"i")).test(t))return!1}if(s.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${s.id}\\s*\\1`,"i").test(t))return!1}if(s.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(s.className))return!1}return!0}function P(t,s="main"){let e=K(s);if(!e)return null;let n=/<([a-z][\w-]*)\b([^>]*)>/gi,i=J(t),o;while((o=n.exec(t))!==null){if(I(o.index,i))continue;let l=o[1].toLowerCase(),a=o[2]||"";if(a.trimEnd().endsWith("/")||X.has(l))continue;if(e.tag&&e.tag!==l)continue;if(!Z(a,e))continue;let u=o[0],g=o.index+u.length,f=new RegExp(`<(/?)${l}\\b([^>]*)>`,"gi");f.lastIndex=g;let d=1,h;while((h=f.exec(t))!==null){if(I(h.index,i))continue;let b=h[1]==="/";if(!b&&(h[2]||"").trimEnd().endsWith("/"))continue;if(d+=b?-1:1,d===0)return{openTag:u,openIndex:o.index,start:g,end:h.index,tagName:l}}return null}return null}var Tt="private, no-store";function cn(t){return t.replace(/&#(\d+);/g,(s,e)=>F(Number(e),s)).replace(/&#x([0-9a-f]+);/gi,(s,e)=>F(Number.parseInt(e,16),s)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function F(t,s){if(!Number.isInteger(t)||t<0||t>1114111)return s;try{return String.fromCodePoint(t)}catch{return s}}function je(t){return t.headers.get("X-STX-Router")==="true"}function tt(t,s){if(!t)return s;return t.split(",").some((n)=>n.trim().toLowerCase()===s.toLowerCase())?t:`${t}, ${s}`}function U(t){return{Vary:tt(t,"X-STX-Router")}}function E(t){return t.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function D(t){let s=/<head\b[^>]*>([\s\S]*?)<\/head\s*>/i.exec(t)?.[1]??"",e=/<(meta|link)\b(?:[^>"']|"[^"]*"|'[^']*')*>|<title\b[^>]*>[\s\S]*?<\/title\s*>/giy;return x(s,(n,i)=>(e.lastIndex=i,e.exec(n)?e.lastIndex:-1)).map(({token:n})=>n)}function H(t){let s=Object.create(null),e=t.replace(/^<\w+\b|>$/g,"");for(let n of e.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g)){let i=n[1].toLowerCase();if(!(i in s))s[i]=n[2]??n[3]??n[4]??""}return s}function qn(t){let s=[];for(let e of D(t)){if(/^<title\b/i.test(e)){s.push(`<title>${E(e.replace(/^<title\b[^>]*>|<\/title\s*>$/gi,""))}</title>`);continue}let n=H(e);if(/^<meta\b/i.test(e)){let i=n.property?"property":"name",o=cn(n[i]??"").toLowerCase();if(o==="description"||/^(?:og|twitter):[\w:]+$/.test(o))s.push(`<meta ${i}="${r(o)}" content="${E(n.content??"")}">`)}else{let i=cn(n.rel??"").toLowerCase();if(i==="canonical"||i==="alternate"&&n.hreflang)s.push(`<link rel="${i}" href="${E(n.href??"")}"${i==="alternate"?` hreflang="${E(n.hreflang)}"`:""}>`)}}return`<template data-stx-page-head="1">${s.join("")}</template>
3
3
  `}var et=["media","crossorigin","integrity"];function Kn(t){let s=[];for(let e of D(t)){if(!/^<link\b/i.test(e))continue;let n=H(e);if(cn(n.rel??"").trim().toLowerCase()!=="stylesheet")continue;if(!n.href||"data-css"in n||"disabled"in n)continue;let i=et.filter((o)=>(o in n)).map((o)=>` ${o}="${E(n[o])}"`).join("");s.push(`<link rel="stylesheet" href="${E(n.href)}"${i}>`)}return s.length?`<template data-stx-page-css="1">${s.join("")}</template>
4
- `:""}import T from"path";var nt="stx-page-head:",it=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function ot(){let t=ne()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-hs2a040z.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Oa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=T.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Lo(t,s){try{let e=await Bun.file(t).text(),n=e,i=B(e);if(i)n=i.content.trim();let o=gn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:b,defaultConfig:w,loadStxConfig:R}=await import("./chunk-zpwh9bpc.js"),k=await R(),m={__filename:t,__dirname:T.dirname(t)};for(let p of l){let A=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!p.includes("client")&&!p.includes('type="module"'))await b(A[1],m,t)}let S=await h(f,m,t,{...w,...k,...s},new Set),C=S.indexOf(d);if(C===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,C),afterSlot:S.substring(C+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function us(t,s,e){let n,i="",o=s.match(it);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=ot(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
4
+ `:""}import T from"path";var nt="stx-page-head:",it=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,_={dev:null,prod:null};function ot(){let t=ne()?"dev":"prod",s=_[t];if(s!==null)return s;try{let e=import.meta.require("./chunk-hs2a040z.js"),n=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;_[t]=`<script>${n()}</script>`}catch{_[t]=""}return _[t]}async function Oa(t,s){if(s===!1)return null;if(s&&typeof s==="string"){let n=T.resolve(t,s);if(await Bun.file(n).exists())return n;return null}let e=T.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Lo(t,s){try{let e=await Bun.file(t).text(),n=e,i=B(e);if(i)n=i.content.trim();let o=gn(e),l=[...o.client.map((p)=>p.fullTag),...o.signals.map((p)=>p.fullTag)],a=[],u=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,g;while((g=u.exec(e))!==null)a.push(g[0]);let f=n;for(let p of o.server)f=f.replace(p.fullTag,"");for(let p of o.client)f=f.replace(p.fullTag,"");f=f.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let d="<!--__STX_PAGE_SLOT__-->";if(f=f.replace(/<slot\s*\/>/gi,d).replace(/<slot\s*>\s*<\/slot>/gi,d),!f.includes(d))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:h,extractVariables:b,defaultConfig:w,loadStxConfig:R}=await import("./chunk-kdh1s839.js"),k=await R(),m={__filename:t,__dirname:T.dirname(t)};for(let p of l){let A=p.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(A&&!p.includes("client")&&!p.includes('type="module"'))await b(A[1],m,t)}let S=await h(f,m,t,{...w,...k,...s},new Set),C=S.indexOf(d);if(C===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:S.substring(0,C),afterSlot:S.substring(C+d.length),filePath:t,shellScripts:l,shellStyles:a}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function us(t,s,e){let n,i="",o=s.match(it);if(o){s=s.replace(o[0],"");try{let f=Buffer.from(o[1],"base64").toString("utf8"),d=f.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(d)n=d[1].trim();i=f.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let l=e||n||"stx App",a=ot(),u="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
5
5
  <html lang="en">
6
6
  <head>
7
7
  <meta charset="UTF-8">
@@ -29,5 +29,5 @@ ${a}
29
29
  `));if(o.length>0)m.push(o.filter((S)=>!g.has(S)).join(`
30
30
  `));if(w.length>0)m.push(w.filter((S)=>!g.has(S)).join(`
31
31
  `));return m.push(b),m.join(`
32
- `)}import O from"fs";import z from"path";function Ma(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Da(t,s){let e=z.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function La(t){let s=z.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function ct(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function jo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function G(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!jo(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await ct(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=lt(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function lt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(M(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function ja(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Gn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await ut(t,s),l=Kt(n),a=Gt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-y10eaxgc.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-zcys6b06.js"),{defaultConfig:h}=await import("./chunk-cgqpn3e2.js"),b=n.streamBoundaries||{},w={...h,autoShell:!1},R=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof b[m]==="function"?await b[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,w,new Set)}})),k=new Set(R.map((m)=>m.id));g=[...(g||[]).filter((m)=>!k.has(m.id)),...R]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function ut(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Ui(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await y(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await G(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=Fr(e);if(!u)return a;let g=L(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Ui(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=N(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i($l(t.html,o)),context:e,cookies:n.cookies}}
32
+ `)}import O from"fs";import z from"path";function Ma(t,s,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:s,outputDir:e}}function Da(t,s){let e=z.join(s,"manifest.json");O.writeFileSync(e,JSON.stringify(t,null,2))}function La(t){let s=z.join(t,"manifest.json");if(!O.existsSync(s))return null;try{let e=O.readFileSync(s,"utf-8"),n=JSON.parse(e);if(n.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${n.version}`),null;return n}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function M(t,s,e={}){let n=`${encodeURIComponent(t)}=${encodeURIComponent(s)}`;if(e.maxAge!==void 0)n+=`; Max-Age=${e.maxAge}`;if(e.expires)n+=`; Expires=${e.expires.toUTCString()}`;if(e.path)n+=`; Path=${e.path}`;if(e.domain)n+=`; Domain=${e.domain}`;if(e.secure)n+="; Secure";if(e.httpOnly)n+="; HttpOnly";if(e.sameSite)n+=`; SameSite=${e.sameSite}`;return n}async function ct(t){let s=t.headers.get("content-type")||"",e={},n=(i,o)=>{let l=e[i];if(l===void 0)e[i]=o;else if(Array.isArray(l))l.push(o);else e[i]=[l,o]};if(s.includes("multipart/form-data")){let i=await t.formData();for(let[o,l]of i.entries())if(typeof l==="string")n(o,l);return e}if(s.includes("application/x-www-form-urlencoded")){for(let[i,o]of new URLSearchParams(await t.text()).entries())n(i,o);return e}return e}function jo(t){if(!t)return!1;let s=t.toUpperCase();return s!=="GET"&&s!=="HEAD"}async function G(t,s={}){let e=s.request,n=s.method??e?.method;if(!e||!jo(n))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await ct(e)}catch{}let o=await t.action({request:e,form:i,params:s.params??{},query:t.query??{},cookies:s.cookies??{}});if(o&&typeof o==="object"){let l=o,a=lt(l.cookies),u=l.redirect;if(typeof u==="string"&&u)return{redirect:u,ran:!0,...a.length>0?{cookies:a}:{}};let{cookies:g,redirect:f,...d}=l;if(Object.assign(t,d),a.length>0)return{ran:!0,cookies:a}}return{ran:!0}}function lt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let s=[];for(let[e,n]of Object.entries(t)){if(!e)continue;if(typeof n==="string"){s.push(M(e,n));continue}if(n&&typeof n==="object"){let i=n;if(typeof i.value!=="string")continue;s.push(M(e,i.value,i))}}return s}function ja(t,s=[],e){let n=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of s)n.append("Set-Cookie",i);for(let[i,o]of Object.entries(e??{}))if(i.toLowerCase()!=="location")n.set(i,o);return new Response(null,{status:303,headers:n})}async function Gn(t,s={}){let{html:e,context:n,redirect:i,cookies:o}=await ut(t,s),l=Kt(n),a=Gt(n);if(i)return{html:e,redirect:i,cookies:o,status:l,headers:a};let{extractStreamBoundaries:u}=await import("./chunk-3043ycz6.js"),g=u(n),f=t.streamTemplates;if(f&&Object.keys(f).length>0){let{processDirectives:d}=await import("./chunk-15qrs231.js"),{defaultConfig:h}=await import("./chunk-yjs11rre.js"),b=n.streamBoundaries||{},w={...h,autoShell:!1},R=Object.keys(f).map((m)=>({id:m,render:async()=>{let S=typeof b[m]==="function"?await b[m]():void 0;return d(f[m],{...n,$boundary:S},t.sourceFile,w,new Set)}})),k=new Set(R.map((m)=>m.id));g=[...(g||[]).filter((m)=>!k.has(m.id)),...R]}return{html:e,boundaries:g&&g.length>0?g:void 0,cookies:o,status:l,headers:a}}async function ut(t,s){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...s};if(!t.hasServerScripts&&!Ui(t.html))return{html:t.html,context:e};for(let l of t.serverScriptContent)try{await y(l,e,t.sourceFile)}catch(a){if(s.__stx_strict_hydration)throw a;console.warn(`[stx] Server script error in ${t.sourceFile}:`,a)}let n=await G(e,{request:s.request,method:s.method,params:s.params??{},cookies:s.cookies??{}}),i=(l)=>{let a=l.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),u=Fr(e);if(!u)return a;let g=L(a);return g<0?u+a:a.slice(0,g)+u+a.slice(g)};if(n.redirect)return{html:t.html,context:e,redirect:n.redirect,cookies:n.cookies};if(!Ui(t.html))return{html:i(t.html),context:e,cookies:n.cookies};let o=new Map;for(let[l,a]of Object.entries(t.placeholders))if(a.expression)try{let u=N(a.expression,e);if(a.type==="raw")o.set(l,u!==void 0&&u!==null?String(u):"");else o.set(l,u!==void 0&&u!==null?Y(String(u)):"")}catch(u){if(s.__stx_strict_hydration)throw u;o.set(l,"")}return{html:i($l(t.html,o)),context:e,cookies:n.cookies}}
33
33
  export{Tt,cn,je,U,qn,Kn,Oa,Lo,us,rt,Na,st,Be,Ma,Da,La,jo,ja,Gn};