@stacksjs/stx 0.2.356 → 0.2.357

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.
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ve as a}from"./chunk-801bg5d8.js";import"./chunk-0knxnyq6.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as buildApp};
2
+ import{Ve as a}from"./chunk-f2jypsax.js";import"./chunk-0knxnyq6.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as buildApp};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Le as c,Me as d,Ne as e,Oe as f,Pe as g,Qe as h,Re as i}from"./chunk-4ce5ma6a.js";import"./chunk-3y8vvkar.js";import"./chunk-ra1s4s6b.js";import"./chunk-degz74nv.js";import"./chunk-t23kccpz.js";import"./chunk-qjvny3wf.js";import{Lp as a,Op as b}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{d as virtualPathFor,h as typecheckStxFiles,e as sourcePathFor,i as formatTypecheckDiagnostics,g as findStxModuleDeclarations,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
2
+ import{Le as c,Me as d,Ne as e,Oe as f,Pe as g,Qe as h,Re as i}from"./chunk-m0eg86q3.js";import"./chunk-3y8vvkar.js";import"./chunk-ra1s4s6b.js";import"./chunk-degz74nv.js";import"./chunk-t23kccpz.js";import"./chunk-qjvny3wf.js";import{Lp as a,Op as b}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{d as virtualPathFor,h as typecheckStxFiles,e as sourcePathFor,i as formatTypecheckDiagnostics,g as findStxModuleDeclarations,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{jg as e,lg as kF,mg as UF,ng as wF,vg as EF}from"./chunk-jy451jg5.js";import{yg as BF}from"./chunk-0knxnyq6.js";import{oj as l,pj as d}from"./chunk-krt45cqy.js";import{Dk as HF,Ek as IF,Fk as KF}from"./chunk-frp9fc7j.js";import{nl as YF,pl as ZF}from"./chunk-t23kccpz.js";import{Gp as VF,Kp as r,Pp as o,Xm as s,jo as zF,jp as $F,om as p,qm as i,ur as t,wr as M,yp as GF}from"./chunk-3ssjb8cx.js";import{ws as XF}from"./chunk-tf16jtj4.js";import{mt as qF}from"./chunk-kjd9hbg4.js";import{Gt as WF}from"./chunk-q4kgqqed.js";import{Lt as QF}from"./chunk-1nnza3m6.js";import{Ew as h,Hw as _F}from"./chunk-trva71am.js";import G from"fs";import q from"path";import{createHash as NF}from"crypto";_F();function u(Q){return NF("sha256").update(Q).digest("hex").slice(0,8)}function c(Q=!1){let z=Q?d():l(),Z=u(z);return{content:z,filename:`runtime.${Z}.js`,hash:Z}}function a(){let Q=h(),z=u(Q);return{content:Q,filename:`router.${z}.js`,hash:z}}function bF(Q){return{runtimeTag:Q.runtime?`<script src="/__stx/${Q.runtime.filename}"></script>`:"",routerTag:Q.router?`<script src="/__stx/${Q.router.filename}"></script>`:"",cssTag:Q.css?`<link rel="stylesheet" href="/__stx/${Q.css.filename}">`:""}}import n from"path";import{createHash as OF}from"crypto";function TF(Q={}){let z=new Set;return{context:new Proxy(Q,{get(X,F){if(F in X)return X[F];if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return},has(X,F){if(F in X)return!0;if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return!1}}),accessedKeys:z}}async function FF(Q,z,Z={}){let X=n.resolve(Q),F=await Bun.file(X).text(),U=OF("sha256").update(F).digest("hex").slice(0,16);p();let w={};try{w=await M(Z.configDir)}catch{}let H=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(F))!==null){let E=k[1];if(/\bserver\b/.test(E))H.push(k[2])}let W=new Set(H.flatMap((E)=>o(E))),{context:_}=TF({__filename:X,__dirname:n.dirname(X),__stx_serverDeclared:W}),N=new Set,x={...t,...w,...Z,buildMode:"compile",strict:!1},I=await r(F,_,X,x,N),O=e(I),j=i();return{route:z,sourceFile:Q,html:I,fragment:O,placeholders:j,hasServerScripts:H.length>0,serverScriptContent:H,dependencies:Array.from(N),contentHash:U,status:s(F),streamTemplates:_.__streamTemplates}}var MF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function JF(Q,z){let Z=0,X=0;if(!G.existsSync(Q))return{copied:Z,bytes:X};G.mkdirSync(z,{recursive:!0});function F(U,w){let H=G.readdirSync(U,{withFileTypes:!0});for(let V of H){if(MF.has(V.name))continue;let k=q.join(U,V.name),W=q.join(w,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),F(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),Z++,X+=G.statSync(W).size}}}return F(Q,z),{copied:Z,bytes:X}}async function qJ(Q={}){let z=Date.now(),Z=q.resolve(Q.root||process.cwd()),X=q.resolve(Z,Q.outputDir||".output");console.log("[stx build] Starting production build...");let F=await M(Z),U=q.resolve(Z,Q.componentsDir??F.componentsDir??"components"),w=q.resolve(Z,Q.partialsDir??F.partialsDir??"partials"),H=q.resolve(Z,Q.layoutsDir??F.layoutsDir??"layouts"),V=Q.publicDir??F.publicDir??"public",k=F.app?.head||{},W=F.app?.colorMode,_=F.router?.container||"main",N=Q.routeRules??F.routeRules??{},x=BF(N),I=Q.serverApi??F.serverApi,O=typeof I==="object"?I:{};if(I)YF(Z,O);if(F.runtimeConfig)QF(F.runtimeConfig,{});if(G.existsSync(X))G.rmSync(X,{recursive:!0});let j=[q.join(X,"public","__stx"),q.join(X,"public","assets"),q.join(X,"server","pages"),q.join(X,"server","fragments")];for(let Y of j)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let E=zF(Z,{pagesDirs:F._layerPageDirs}),LF=["components","layouts","partials"],y=E.filter((Y)=>{return!LF.some((B)=>Y.pattern.startsWith(`/${B}/`)||Y.pattern===`/${B}`)});console.log(`[stx build] Found ${y.length} page routes (${E.length-y.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let L=c(Q.debug),K=a();await Bun.write(q.join(X,"public","__stx",L.filename),L.content),await Bun.write(q.join(X,"public","__stx",K.filename),K.content),console.log(`[stx build] Runtime: ${L.filename} (${(L.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${K.filename} (${(K.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let R=[],v=[];for(let Y of y){let B=x(Y.pattern),b=B.rendering==="prerender";if(b&&(Y.pattern.includes(":")||Y.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${Y.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let J=await FF(Y.filePath,Y.pattern,{configDir:Z,componentsDir:U,partialsDir:w,layoutsDir:H,debug:Q.debug});if(R.push(J),J.html=J.html.replace(/runtime\.__STX_HASH__\.js/g,L.filename).replace(/router\.__STX_HASH__\.js/g,K.filename),J.html=VF(J.html,k,{bodyScripts:[`<script src="/__stx/${K.filename}"></script>`],...W&&{colorMode:W}}),W)J.html=$F(J.html,W);if(k.htmlAttrs)J.html=GF(J.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(J.html)){let $=J.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if($&&$[1]){let m=$[1];J.html=J.html.replace(" "+m,""),J.html=J.html.replace(/<body([^>]*)>/,`<body$1 ${m}>`)}}if(J.html=J.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),J.html=await qF(J.html),b){let $=await EF(J,{params:{},request:new Request(`http://stx.build${Y.pattern}`),method:"GET",__stx_strict_hydration:!0});if($.redirect||$.cookies?.length||$.boundaries?.length||$.headers&&Object.keys($.headers).length)throw Error(`Prerendered route ${Y.pattern} cannot set response headers/cookies, redirect or stream`);J.html=$.html,J.status=$.status??J.status,J.hasServerScripts=!1,J.serverScriptContent=[],J.placeholders={}}J.fragment=kF(J.html,_);let C=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),g=q.join("server","pages",`${C}.compiled.json`),f=q.join("server","fragments",`${C}.html`);await Bun.write(q.join(X,g),JSON.stringify(J,null,2)),await Bun.write(q.join(X,f),J.fragment),v.push({pattern:Y.pattern,compiledPath:g,fragmentPath:f,isDynamic:J.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("["),prerendered:b}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(J){if(Object.keys(B).length)throw J;console.error(`[stx build] \u2717 ${Y.pattern}:`,J instanceof Error?J.message:J)}}let P=q.resolve(Z,V);if(G.existsSync(P)){let{copied:Y,bytes:B}=JF(P,q.join(X,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${V}/`)}let A=KF(Z);if(A){let{copied:Y,bytes:B}=JF(A,q.join(X,"public",IF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${HF}/`)}let S={runtime:L.filename,router:K.filename},T=UF(v,S,X);if(T.routeRules=N,T.routerContainer=_,I)T.apiRoutes=await ZF(Z,X,O);if(F.runtimeConfig)await Bun.write(q.join(X,"server/runtime-config.json"),JSON.stringify(F.runtimeConfig)),await WF(Z,F.runtimeConfig);if(F._layerGraph)await Bun.write(q.join(X,"server/layers.json"),JSON.stringify(XF(F._layerGraph),null,2));wF(T,X);let D=Date.now()-z;return console.log(`
2
+ import{jg as e,lg as kF,mg as UF,ng as wF,vg as EF}from"./chunk-a4jhcbsh.js";import{yg as BF}from"./chunk-0knxnyq6.js";import{oj as l,pj as d}from"./chunk-krt45cqy.js";import{Dk as HF,Ek as IF,Fk as KF}from"./chunk-frp9fc7j.js";import{nl as YF,pl as ZF}from"./chunk-t23kccpz.js";import{Gp as VF,Kp as r,Pp as o,Xm as s,jo as zF,jp as $F,om as p,qm as i,ur as t,wr as M,yp as GF}from"./chunk-3ssjb8cx.js";import{ws as XF}from"./chunk-tf16jtj4.js";import{mt as qF}from"./chunk-kjd9hbg4.js";import{Gt as WF}from"./chunk-q4kgqqed.js";import{Lt as QF}from"./chunk-1nnza3m6.js";import{Ew as h,Hw as _F}from"./chunk-trva71am.js";import G from"fs";import q from"path";import{createHash as NF}from"crypto";_F();function u(Q){return NF("sha256").update(Q).digest("hex").slice(0,8)}function c(Q=!1){let z=Q?d():l(),Z=u(z);return{content:z,filename:`runtime.${Z}.js`,hash:Z}}function a(){let Q=h(),z=u(Q);return{content:Q,filename:`router.${z}.js`,hash:z}}function bF(Q){return{runtimeTag:Q.runtime?`<script src="/__stx/${Q.runtime.filename}"></script>`:"",routerTag:Q.router?`<script src="/__stx/${Q.router.filename}"></script>`:"",cssTag:Q.css?`<link rel="stylesheet" href="/__stx/${Q.css.filename}">`:""}}import n from"path";import{createHash as OF}from"crypto";function TF(Q={}){let z=new Set;return{context:new Proxy(Q,{get(X,F){if(F in X)return X[F];if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return},has(X,F){if(F in X)return!0;if(typeof F==="string"&&!F.startsWith("__"))z.add(F);return!1}}),accessedKeys:z}}async function FF(Q,z,Z={}){let X=n.resolve(Q),F=await Bun.file(X).text(),U=OF("sha256").update(F).digest("hex").slice(0,16);p();let w={};try{w=await M(Z.configDir)}catch{}let H=[],V=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,k;while((k=V.exec(F))!==null){let E=k[1];if(/\bserver\b/.test(E))H.push(k[2])}let W=new Set(H.flatMap((E)=>o(E))),{context:_}=TF({__filename:X,__dirname:n.dirname(X),__stx_serverDeclared:W}),N=new Set,x={...t,...w,...Z,buildMode:"compile",strict:!1},I=await r(F,_,X,x,N),O=e(I),j=i();return{route:z,sourceFile:Q,html:I,fragment:O,placeholders:j,hasServerScripts:H.length>0,serverScriptContent:H,dependencies:Array.from(N),contentHash:U,status:s(F),streamTemplates:_.__streamTemplates}}var MF=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function JF(Q,z){let Z=0,X=0;if(!G.existsSync(Q))return{copied:Z,bytes:X};G.mkdirSync(z,{recursive:!0});function F(U,w){let H=G.readdirSync(U,{withFileTypes:!0});for(let V of H){if(MF.has(V.name))continue;let k=q.join(U,V.name),W=q.join(w,V.name);if(V.isDirectory())G.mkdirSync(W,{recursive:!0}),F(k,W);else if(V.isFile()){if(G.existsSync(W))continue;G.copyFileSync(k,W),Z++,X+=G.statSync(W).size}}}return F(Q,z),{copied:Z,bytes:X}}async function qJ(Q={}){let z=Date.now(),Z=q.resolve(Q.root||process.cwd()),X=q.resolve(Z,Q.outputDir||".output");console.log("[stx build] Starting production build...");let F=await M(Z),U=q.resolve(Z,Q.componentsDir??F.componentsDir??"components"),w=q.resolve(Z,Q.partialsDir??F.partialsDir??"partials"),H=q.resolve(Z,Q.layoutsDir??F.layoutsDir??"layouts"),V=Q.publicDir??F.publicDir??"public",k=F.app?.head||{},W=F.app?.colorMode,_=F.router?.container||"main",N=Q.routeRules??F.routeRules??{},x=BF(N),I=Q.serverApi??F.serverApi,O=typeof I==="object"?I:{};if(I)YF(Z,O);if(F.runtimeConfig)QF(F.runtimeConfig,{});if(G.existsSync(X))G.rmSync(X,{recursive:!0});let j=[q.join(X,"public","__stx"),q.join(X,"public","assets"),q.join(X,"server","pages"),q.join(X,"server","fragments")];for(let Y of j)G.mkdirSync(Y,{recursive:!0});console.log("[stx build] Discovering routes...");let E=zF(Z,{pagesDirs:F._layerPageDirs}),LF=["components","layouts","partials"],y=E.filter((Y)=>{return!LF.some((B)=>Y.pattern.startsWith(`/${B}/`)||Y.pattern===`/${B}`)});console.log(`[stx build] Found ${y.length} page routes (${E.length-y.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let L=c(Q.debug),K=a();await Bun.write(q.join(X,"public","__stx",L.filename),L.content),await Bun.write(q.join(X,"public","__stx",K.filename),K.content),console.log(`[stx build] Runtime: ${L.filename} (${(L.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${K.filename} (${(K.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let R=[],v=[];for(let Y of y){let B=x(Y.pattern),b=B.rendering==="prerender";if(b&&(Y.pattern.includes(":")||Y.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${Y.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let J=await FF(Y.filePath,Y.pattern,{configDir:Z,componentsDir:U,partialsDir:w,layoutsDir:H,debug:Q.debug});if(R.push(J),J.html=J.html.replace(/runtime\.__STX_HASH__\.js/g,L.filename).replace(/router\.__STX_HASH__\.js/g,K.filename),J.html=VF(J.html,k,{bodyScripts:[`<script src="/__stx/${K.filename}"></script>`],...W&&{colorMode:W}}),W)J.html=$F(J.html,W);if(k.htmlAttrs)J.html=GF(J.html,k.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(J.html)){let $=J.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if($&&$[1]){let m=$[1];J.html=J.html.replace(" "+m,""),J.html=J.html.replace(/<body([^>]*)>/,`<body$1 ${m}>`)}}if(J.html=J.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),J.html=await qF(J.html),b){let $=await EF(J,{params:{},request:new Request(`http://stx.build${Y.pattern}`),method:"GET",__stx_strict_hydration:!0});if($.redirect||$.cookies?.length||$.boundaries?.length||$.headers&&Object.keys($.headers).length)throw Error(`Prerendered route ${Y.pattern} cannot set response headers/cookies, redirect or stream`);J.html=$.html,J.status=$.status??J.status,J.hasServerScripts=!1,J.serverScriptContent=[],J.placeholders={}}J.fragment=kF(J.html,_);let C=Y.pattern==="/"?"index":Y.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),g=q.join("server","pages",`${C}.compiled.json`),f=q.join("server","fragments",`${C}.html`);await Bun.write(q.join(X,g),JSON.stringify(J,null,2)),await Bun.write(q.join(X,f),J.fragment),v.push({pattern:Y.pattern,compiledPath:g,fragmentPath:f,isDynamic:J.hasServerScripts,hasParams:Y.pattern.includes(":")||Y.pattern.includes("["),prerendered:b}),console.log(`[stx build] \u2713 ${Y.pattern}`)}catch(J){if(Object.keys(B).length)throw J;console.error(`[stx build] \u2717 ${Y.pattern}:`,J instanceof Error?J.message:J)}}let P=q.resolve(Z,V);if(G.existsSync(P)){let{copied:Y,bytes:B}=JF(P,q.join(X,"public"));if(Y>0)console.log(`[stx build] Copied ${Y} public asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${V}/`)}let A=KF(Z);if(A){let{copied:Y,bytes:B}=JF(A,q.join(X,"public",IF));if(Y>0)console.log(`[stx build] Copied ${Y} asset${Y===1?"":"s"} (${(B/1024).toFixed(1)}KB) from ${HF}/`)}let S={runtime:L.filename,router:K.filename},T=UF(v,S,X);if(T.routeRules=N,T.routerContainer=_,I)T.apiRoutes=await ZF(Z,X,O);if(F.runtimeConfig)await Bun.write(q.join(X,"server/runtime-config.json"),JSON.stringify(F.runtimeConfig)),await WF(Z,F.runtimeConfig);if(F._layerGraph)await Bun.write(q.join(X,"server/layers.json"),JSON.stringify(XF(F._layerGraph),null,2));wF(T,X);let D=Date.now()-z;return console.log(`
3
3
  [stx build] Done in ${D}ms \u2014 ${R.length} pages compiled`),{pageCount:R.length,assets:S,outputDir:X,duration:D}}
4
4
  export{u as Sf,c as Tf,a as Uf,bF as Vf,FF as Wf,qJ as Xf};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{$m as l,Cm as P,Co as i,Dp as h,Io as T,Km as k,_m as c,sm as R,tm as O}from"./chunk-3ssjb8cx.js";import{Os as S,Qs as y}from"./chunk-kjd9hbg4.js";import{Ku as m}from"./chunk-czj6nq0b.js";import{Dw as YJ,Gw as ZJ,Hw as $J}from"./chunk-trva71am.js";import{Ow as XJ,Rw as q}from"./chunk-emjmshj8.js";var r=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function s(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(r.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var o=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function C(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=y(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=o.exec(j);if(F){let K=s(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var a=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function t(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function v(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function e(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function JJ(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=e(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=t(J),Z;while((Z=X.exec(J))!==null){if(v(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||a.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!JJ(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(v(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var NJ="X-STX-Router",_J="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function QJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:QJ(J,"X-STX-Router")}}import E from"path";YJ();var UJ="stx-page-head:",WJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,D={dev:null,prod:null};function jJ(){let J=m()?"dev":"prod",Y=D[J];if(Y!==null)return Y;try{let Q=($J(),XJ(ZJ)),X=J==="dev"&&typeof Q.getRouterScriptDev==="function"?Q.getRouterScriptDev:Q.getRouterScript;D[J]=`<script>${X()}</script>`}catch{D[J]=""}return D[J]}async function RJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function PJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=C(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:A}=await import("./chunk-3eya6sbk.js"),I=await A(),z={__filename:J,__dirname:E.dirname(J)};for(let V of U){let L=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(L&&!V.includes("client")&&!V.includes('type="module"'))await w(L[1],z,J)}let _=await B(K,z,J,{...N,...I,...Y},new Set),H=_.indexOf(G);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:_.substring(0,H),afterSlot:_.substring(H+G.length),filePath:J,shellScripts:U,shellStyles:W}}catch(Q){return console.error(`[stx] Error processing shell ${J}:`,Q),null}}function kJ(J,Y,Q){let X,$="",Z=Y.match(WJ);if(Z){Y=Y.replace(Z[0],"");try{let K=Buffer.from(Z[1],"base64").toString("utf8"),G=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(G)X=G[1].trim();$=K.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let U=Q||X||"stx App",W=jJ(),j="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
2
+ import{$m as l,Cm as P,Co as i,Dp as h,Io as T,Km as k,_m as c,sm as R,tm as O}from"./chunk-3ssjb8cx.js";import{Os as S,Qs as y}from"./chunk-kjd9hbg4.js";import{Ku as m}from"./chunk-czj6nq0b.js";import{Dw as YJ,Gw as ZJ,Hw as $J}from"./chunk-trva71am.js";import{Ow as XJ,Rw as q}from"./chunk-emjmshj8.js";var r=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function s(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(r.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var o=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function C(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=y(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=o.exec(j);if(F){let K=s(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var a=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function t(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function v(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function e(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function JJ(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=e(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=t(J),Z;while((Z=X.exec(J))!==null){if(v(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||a.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!JJ(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(v(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var NJ="X-STX-Router",_J="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function QJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:QJ(J,"X-STX-Router")}}import E from"path";YJ();var UJ="stx-page-head:",WJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,D={dev:null,prod:null};function jJ(){let J=m()?"dev":"prod",Y=D[J];if(Y!==null)return Y;try{let Q=($J(),XJ(ZJ)),X=J==="dev"&&typeof Q.getRouterScriptDev==="function"?Q.getRouterScriptDev:Q.getRouterScript;D[J]=`<script>${X()}</script>`}catch{D[J]=""}return D[J]}async function RJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function PJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=C(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:A}=await import("./chunk-e0f3qs59.js"),I=await A(),z={__filename:J,__dirname:E.dirname(J)};for(let V of U){let L=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(L&&!V.includes("client")&&!V.includes('type="module"'))await w(L[1],z,J)}let _=await B(K,z,J,{...N,...I,...Y},new Set),H=_.indexOf(G);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:_.substring(0,H),afterSlot:_.substring(H+G.length),filePath:J,shellScripts:U,shellStyles:W}}catch(Q){return console.error(`[stx] Error processing shell ${J}:`,Q),null}}function kJ(J,Y,Q){let X,$="",Z=Y.match(WJ);if(Z){Y=Y.replace(Z[0],"");try{let K=Buffer.from(Z[1],"base64").toString("utf8"),G=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(G)X=G[1].trim();$=K.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let U=Q||X||"stx App",W=jJ(),j="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ye as z$}from"./chunk-s5dwatkj.js";import{Zf as i7,bg as j$,cg as c6,dg as T6,fg as B1,gg as l6,hg as K5,ig as O$,jg as A$,kg as i6,lg as a6,pg as z5}from"./chunk-jy451jg5.js";import{bj as u5}from"./chunk-krt45cqy.js";import{rj as l1,sj as I1,tj as R1,uj as a$,vj as s$,wj as n5,yj as o5}from"./chunk-0t1yyn1d.js";import{Vj as _$,Wj as U$}from"./chunk-3kd0zn9c.js";import{xk as l5,yk as i5}from"./chunk-wz4fnsat.js";import{Ek as Z3,Fk as Q3}from"./chunk-frp9fc7j.js";import{Zk as U1}from"./chunk-degz74nv.js";import{sl as M5,tl as j8}from"./chunk-t23kccpz.js";import{$m as C1,Bm as n0,Br as T0,Io as M0,Kp as V0,So as o0,Tm as d6,Wl as V8,Xm as _5,_m as T1,_n as K$,gp as s7,hr as B$,jo as H$,lo as u6,lq as _6,mo as E6,mq as x1,nm as l7,np as m6,op as p6,qq as t0,ur as C$,wr as r0,xr as w0}from"./chunk-3ssjb8cx.js";import{Is as J5,at as B,ht as L$,it as F$,mt as J0}from"./chunk-kjd9hbg4.js";import{rt as u0}from"./chunk-ejwfnttb.js";import{$u as Y5,Hu as s1,Ku as M6,Su as Z5,Uu as Q5,Xu as r1,cv as W$,dv as V6,pv as K6}from"./chunk-czj6nq0b.js";import{Aw as f6,Cw as h6,Hw as w6,aw as W5,bw as D6,fw as x6,gw as S6,vw as P6,ww as b6,xw as y6,yw as v6,zw as g6}from"./chunk-trva71am.js";import{Rw as s}from"./chunk-emjmshj8.js";var t5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function U3($,X,Z={}){let{storage:Q="local",serializer:Y=t5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Z,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Q==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let O=L.getItem($);if(O===null)return X;let A=Y.read(O);if(J&&typeof X==="object"&&X!==null)return{...X,...A};return A}catch{return X}},F=(L)=>{let O=_();if(!O)return;try{if(L===null||L===void 0)O.removeItem($);else O.setItem($,Y.write(L))}catch(A){console.warn(`[useStorage] Failed to write key "${$}":`,A)}},z=U(),j=(L,O)=>{for(let A of W)try{A(L,O)}catch(M){console.error("[useStorage] Subscriber error:",M)}};if(K&&G){let L=(A)=>{if(A.key===$&&A.storageArea===_()){let M=z;try{z=A.newValue?Y.read(A.newValue):X}catch(V){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,V);return}j(z,M)}};window.addEventListener("storage",L);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",L))}let H={get value(){return z},set value(L){let O=z;z=L,F(L),j(L,O)},get:()=>z,set:(L)=>{H.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let O=z;z=X,j(X,O)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return H}function e5($,X,Z,Q,Y={}){let{serializer:J=t5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Q;try{let H=J.read(j);if(G&&typeof Q==="object"&&Q!==null)return{...Q,...H};return H}catch(H){return console.warn(`[${X}] Failed to read key "${Z}":`,H),Q}},z=n5((()=>{let j=_();if(!j)return Q;try{return U(j.getItem(Z))}catch(H){return console.warn(`[${X}] Cannot read "${Z}":`,H),Q}})());if(o5(()=>{let j=z(),H=_();if(!H)return;try{if(j===null||j===void 0)H.removeItem(Z);else H.setItem(Z,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Z}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Z)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",j))}return z}function B3($,X,Z){return e5("local","useLocalStorage",$,X,Z)}function L3($,X,Z){return e5("session","useSessionStorage",$,X,Z)}function F3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function j3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Z=0;for(let Q in X)if(Object.prototype.hasOwnProperty.call(X,Q))Z+=(Q.length+(X.getItem(Q)?.length||0))*2;return Z}var t=null;function c1($,X,Z=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Z.has($))return!0;if(Z.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!c1($[J],X[J],Z))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!c1(G,X.get(J),Z))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Q=Object.keys($),Y=Object.keys(X);if(Q.length!==Y.length)return!1;for(let J of Q){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!c1($[J],X[J],Z))return!1}return!0}function UJ($){t=$}function BJ(){return t}function LJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:H3()}}function H3(){return{refs:new Map,effects:new Set,cleanups:[]}}function FJ($){let X=new Set,Z=new Set,Q=$,Y=Symbol("ref"),J={get value(){let G=l1();if(G)Z.add(G);return Q},set value(G){if(!Object.is(G,Q)){let W=Q;Q=G;for(let K of X)K(G,W);for(let K of Z)if(a$())s$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(t)t.scope.refs.set(Y,J);return J}var $6=new WeakMap;function O3($){let X=$6.get($);if(X)return X;let Z=new Map,Q=(G)=>{let W=Z.get(G);if(!W)return;for(let K of[...W])if(a$())s$(K);else K()},Y=(G,W)=>{if(!Z.has(G))Z.set(G,new Set);return Z.get(G).add(W),()=>{Z.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=l1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return O3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Q(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Q(W),K}});return $6.set($,J),J}function zJ($){let X,Z=!0,Q=new Set,Y=new Set,J=()=>{Z=!0,G()},G=()=>{if(Z){let K=X,_=I1(J);if(X=$(),R1(_),Z=!1,!Object.is(X,K)){for(let U of Q)U(X,K);for(let U of Y)U()}}},W=I1(J);return X=$(),Z=!1,R1(W),{get value(){let K=l1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Q.add(K),()=>{Q.delete(K)}}}}function A3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function jJ($,X,Z={}){let{immediate:Q=!1,deep:Y=!1,flush:J="post"}=Z,G,W,K=!1,_=()=>{if(K)return;let H=j();if((Y?!c1(H,G):!Object.is(H,G))||Q)if(X(H,G),Y&&H!==null&&typeof H==="object")try{G=structuredClone(H)}catch{G=H}else G=H},U=(H)=>{if(J==="sync")H();else if(J==="pre")Promise.resolve().then(H);else A3(H)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let H=I1(z);try{return $()}finally{R1(H)}}return $.value};if(typeof $!=="function"){let H=$.subscribe(()=>{U(_)});W=()=>{K=!0,H()}}else W=()=>{K=!0};if(G=j(),Q)U(_);if(t)t.scope.cleanups.push(()=>W?.());return()=>W?.()}function HJ($,X,Z={}){let Q=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Q.push(G)}if(Z.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Q)J()}}function OJ($){let X,Z=!1,Q=()=>{if(Z)return;if(X)X();let Y=I1(Q);X=$(),R1(Y)};if(Q(),t)t.scope.cleanups.push(()=>{if(Z=!0,X)X()});return()=>{if(Z=!0,X)X()}}function AJ($){if(t)t.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function NJ($){if(t)t.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function qJ($){if(t)t.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function MJ($){if(t)t.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function VJ($){if(t)t.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function EJ($){if(t)t.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function Y1($,X){let Z=$.hooks[X];for(let Q of Z)await Q()}async function IJ($){await Y1($,"beforeMount"),$.isMounted=!0,await Y1($,"mounted")}async function RJ($){if(!$.isMounted||$.isUnmounted)return;await Y1($,"beforeUpdate"),await Y1($,"updated")}async function DJ($){if($.isUnmounted)return;await Y1($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await Y1($,"unmounted")}function wJ(){return`
2
+ import{Ye as z$}from"./chunk-f72c62s7.js";import{Zf as i7,bg as j$,cg as c6,dg as T6,fg as B1,gg as l6,hg as K5,ig as O$,jg as A$,kg as i6,lg as a6,pg as z5}from"./chunk-a4jhcbsh.js";import{bj as u5}from"./chunk-krt45cqy.js";import{rj as l1,sj as I1,tj as R1,uj as a$,vj as s$,wj as n5,yj as o5}from"./chunk-0t1yyn1d.js";import{Vj as _$,Wj as U$}from"./chunk-3kd0zn9c.js";import{xk as l5,yk as i5}from"./chunk-wz4fnsat.js";import{Ek as Z3,Fk as Q3}from"./chunk-frp9fc7j.js";import{Zk as U1}from"./chunk-degz74nv.js";import{sl as M5,tl as j8}from"./chunk-t23kccpz.js";import{$m as C1,Bm as n0,Br as T0,Io as M0,Kp as V0,So as o0,Tm as d6,Wl as V8,Xm as _5,_m as T1,_n as K$,gp as s7,hr as B$,jo as H$,lo as u6,lq as _6,mo as E6,mq as x1,nm as l7,np as m6,op as p6,qq as t0,ur as C$,wr as r0,xr as w0}from"./chunk-3ssjb8cx.js";import{Is as J5,at as B,ht as L$,it as F$,mt as J0}from"./chunk-kjd9hbg4.js";import{rt as u0}from"./chunk-ejwfnttb.js";import{$u as Y5,Hu as s1,Ku as M6,Su as Z5,Uu as Q5,Xu as r1,cv as W$,dv as V6,pv as K6}from"./chunk-czj6nq0b.js";import{Aw as f6,Cw as h6,Hw as w6,aw as W5,bw as D6,fw as x6,gw as S6,vw as P6,ww as b6,xw as y6,yw as v6,zw as g6}from"./chunk-trva71am.js";import{Rw as s}from"./chunk-emjmshj8.js";var t5={read:($)=>{try{return JSON.parse($)}catch{return $}},write:($)=>{return JSON.stringify($)}};function U3($,X,Z={}){let{storage:Q="local",serializer:Y=t5,mergeDefaults:J=!1,listenToStorageChanges:G=!0}=Z,W=new Set,K=typeof window<"u",_=()=>{if(!K)return null;return Q==="session"?sessionStorage:localStorage},U=()=>{let L=_();if(!L)return X;try{let O=L.getItem($);if(O===null)return X;let A=Y.read(O);if(J&&typeof X==="object"&&X!==null)return{...X,...A};return A}catch{return X}},F=(L)=>{let O=_();if(!O)return;try{if(L===null||L===void 0)O.removeItem($);else O.setItem($,Y.write(L))}catch(A){console.warn(`[useStorage] Failed to write key "${$}":`,A)}},z=U(),j=(L,O)=>{for(let A of W)try{A(L,O)}catch(M){console.error("[useStorage] Subscriber error:",M)}};if(K&&G){let L=(A)=>{if(A.key===$&&A.storageArea===_()){let M=z;try{z=A.newValue?Y.read(A.newValue):X}catch(V){console.warn(`[useStorage] Failed to read key "${$}" from a cross-tab update:`,V);return}j(z,M)}};window.addEventListener("storage",L);let O=globalThis.onDestroy;if(typeof O==="function")O(()=>window.removeEventListener("storage",L))}let H={get value(){return z},set value(L){let O=z;z=L,F(L),j(L,O)},get:()=>z,set:(L)=>{H.value=L},remove:()=>{let L=_();if(L){L.removeItem($);let O=z;z=X,j(X,O)}},subscribe:(L)=>{return W.add(L),L(z,void 0),()=>W.delete(L)}};return H}function e5($,X,Z,Q,Y={}){let{serializer:J=t5,mergeDefaults:G=!1,listenToStorageChanges:W=!0}=Y,K=typeof window<"u",_=()=>{if(!K)return null;return $==="session"?sessionStorage:localStorage},U=(j)=>{if(j===null||j===void 0)return Q;try{let H=J.read(j);if(G&&typeof Q==="object"&&Q!==null)return{...Q,...H};return H}catch(H){return console.warn(`[${X}] Failed to read key "${Z}":`,H),Q}},z=n5((()=>{let j=_();if(!j)return Q;try{return U(j.getItem(Z))}catch(H){return console.warn(`[${X}] Cannot read "${Z}":`,H),Q}})());if(o5(()=>{let j=z(),H=_();if(!H)return;try{if(j===null||j===void 0)H.removeItem(Z);else H.setItem(Z,J.write(j))}catch(L){console.warn(`[${X}] Cannot persist "${Z}":`,L)}}),K&&W){let j=(L)=>{if(L.key!==Z)return;if(L.storageArea&&L.storageArea!==_())return;z.set(U(L.newValue))};window.addEventListener("storage",j);let H=globalThis.onDestroy;if(typeof H==="function")H(()=>window.removeEventListener("storage",j))}return z}function B3($,X,Z){return e5("local","useLocalStorage",$,X,Z)}function L3($,X,Z){return e5("session","useSessionStorage",$,X,Z)}function F3($="local"){if(typeof window>"u")return;($==="session"?sessionStorage:localStorage).clear()}function z3($="local"){if(typeof window>"u")return[];let X=$==="session"?sessionStorage:localStorage;return Object.keys(X)}function j3($="local"){if(typeof window>"u")return 0;let X=$==="session"?sessionStorage:localStorage,Z=0;for(let Q in X)if(Object.prototype.hasOwnProperty.call(X,Q))Z+=(Q.length+(X.getItem(Q)?.length||0))*2;return Z}var t=null;function c1($,X,Z=new WeakSet){if(Object.is($,X))return!0;if(typeof $!=="object"||typeof X!=="object"||$===null||X===null)return!1;if(Z.has($))return!0;if(Z.add($),$ instanceof Date&&X instanceof Date)return $.getTime()===X.getTime();if($ instanceof RegExp&&X instanceof RegExp)return $.source===X.source&&$.flags===X.flags;if(Array.isArray($)){if(!Array.isArray(X)||$.length!==X.length)return!1;for(let J=0;J<$.length;J++)if(!c1($[J],X[J],Z))return!1;return!0}if(Array.isArray(X))return!1;if($ instanceof Map){if(!(X instanceof Map)||$.size!==X.size)return!1;for(let[J,G]of $)if(!X.has(J)||!c1(G,X.get(J),Z))return!1;return!0}if(X instanceof Map)return!1;if($ instanceof Set){if(!(X instanceof Set)||$.size!==X.size)return!1;for(let J of $)if(!X.has(J))return!1;return!0}if(X instanceof Set)return!1;let Q=Object.keys($),Y=Object.keys(X);if(Q.length!==Y.length)return!1;for(let J of Q){if(!Object.prototype.hasOwnProperty.call(X,J))return!1;if(!c1($[J],X[J],Z))return!1}return!0}function UJ($){t=$}function BJ(){return t}function LJ(){return{isMounted:!1,isUnmounted:!1,hooks:{beforeMount:[],mounted:[],beforeUpdate:[],updated:[],beforeUnmount:[],unmounted:[]},effects:[],scope:H3()}}function H3(){return{refs:new Map,effects:new Set,cleanups:[]}}function FJ($){let X=new Set,Z=new Set,Q=$,Y=Symbol("ref"),J={get value(){let G=l1();if(G)Z.add(G);return Q},set value(G){if(!Object.is(G,Q)){let W=Q;Q=G;for(let K of X)K(G,W);for(let K of Z)if(a$())s$(K);else K()}},subscribe(G){return X.add(G),()=>{X.delete(G)}}};if(t)t.scope.refs.set(Y,J);return J}var $6=new WeakMap;function O3($){let X=$6.get($);if(X)return X;let Z=new Map,Q=(G)=>{let W=Z.get(G);if(!W)return;for(let K of[...W])if(a$())s$(K);else K()},Y=(G,W)=>{if(!Z.has(G))Z.set(G,new Set);return Z.get(G).add(W),()=>{Z.get(G)?.delete(W)}},J=new Proxy($,{get(G,W,K){let _=Reflect.get(G,W,K),U=l1();if(U)Y(W,U);if(_!==null&&typeof _==="object"&&!Array.isArray(_)){let F=Object.getPrototypeOf(_);if(F===Object.prototype||F===null)return O3(_)}return _},set(G,W,K,_){let U=Reflect.get(G,W,_),F=Reflect.set(G,W,K,_);if(!Object.is(K,U))Q(W);return F},deleteProperty(G,W){let K=Reflect.deleteProperty(G,W);return Q(W),K}});return $6.set($,J),J}function zJ($){let X,Z=!0,Q=new Set,Y=new Set,J=()=>{Z=!0,G()},G=()=>{if(Z){let K=X,_=I1(J);if(X=$(),R1(_),Z=!1,!Object.is(X,K)){for(let U of Q)U(X,K);for(let U of Y)U()}}},W=I1(J);return X=$(),Z=!1,R1(W),{get value(){let K=l1();if(K)Y.add(K);return G(),X},set value(K){console.warn("[stx] Computed properties are readonly")},subscribe(K){return Q.add(K),()=>{Q.delete(K)}}}}function A3($){if(typeof requestAnimationFrame==="function"){requestAnimationFrame(()=>{requestAnimationFrame($)});return}setTimeout($,0)}function jJ($,X,Z={}){let{immediate:Q=!1,deep:Y=!1,flush:J="post"}=Z,G,W,K=!1,_=()=>{if(K)return;let H=j();if((Y?!c1(H,G):!Object.is(H,G))||Q)if(X(H,G),Y&&H!==null&&typeof H==="object")try{G=structuredClone(H)}catch{G=H}else G=H},U=(H)=>{if(J==="sync")H();else if(J==="pre")Promise.resolve().then(H);else A3(H)},F=!1,z=()=>{if(K||F)return;F=!0,U(()=>{F=!1,_()})},j=()=>{if(typeof $==="function"){let H=I1(z);try{return $()}finally{R1(H)}}return $.value};if(typeof $!=="function"){let H=$.subscribe(()=>{U(_)});W=()=>{K=!0,H()}}else W=()=>{K=!0};if(G=j(),Q)U(_);if(t)t.scope.cleanups.push(()=>W?.());return()=>W?.()}function HJ($,X,Z={}){let Q=[],Y=$.map((J)=>J.value);for(let J of $){let G=J.subscribe(()=>{let W=$.map((K)=>K.value);X(W,Y),Y=[...W]});Q.push(G)}if(Z.immediate){let J=$.map((G)=>G.value);X(J,Y)}return()=>{for(let J of Q)J()}}function OJ($){let X,Z=!1,Q=()=>{if(Z)return;if(X)X();let Y=I1(Q);X=$(),R1(Y)};if(Q(),t)t.scope.cleanups.push(()=>{if(Z=!0,X)X()});return()=>{if(Z=!0,X)X()}}function AJ($){if(t)t.hooks.beforeMount.push($);else console.warn("[stx] onBeforeMount called outside of component setup")}function NJ($){if(t)t.hooks.mounted.push($);else console.warn("[stx] onMounted called outside of component setup")}function qJ($){if(t)t.hooks.beforeUpdate.push($);else console.warn("[stx] onBeforeUpdate called outside of component setup")}function MJ($){if(t)t.hooks.updated.push($);else console.warn("[stx] onUpdated called outside of component setup")}function VJ($){if(t)t.hooks.beforeUnmount.push($);else console.warn("[stx] onBeforeUnmount called outside of component setup")}function EJ($){if(t)t.hooks.unmounted.push($);else console.warn("[stx] onUnmounted called outside of component setup")}async function Y1($,X){let Z=$.hooks[X];for(let Q of Z)await Q()}async function IJ($){await Y1($,"beforeMount"),$.isMounted=!0,await Y1($,"mounted")}async function RJ($){if(!$.isMounted||$.isUnmounted)return;await Y1($,"beforeUpdate"),await Y1($,"updated")}async function DJ($){if($.isUnmounted)return;await Y1($,"beforeUnmount");for(let X of $.scope.cleanups)X();$.isUnmounted=!0,await Y1($,"unmounted")}function wJ(){return`
3
3
  <script data-stx-client-runtime>
4
4
  (function() {
5
5
  'use strict';
@@ -1132,7 +1132,7 @@ ${O}`}if(H=await E6(H),W.forEach((L)=>Q.add(L)),Z.cache&&Z.cachePath){if(await U
1132
1132
  <h1>Something went wrong</h1>
1133
1133
  <p>An internal error occurred. Please try again later.</p>
1134
1134
  </body>
1135
- </html>`,loader:"html"}}})}};async function C4($,X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=Q0.resolve($);if(!E0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return X5(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=u0(process.cwd(),"output");E0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let I={name:"public-assets",setup(T){T.onResolve({filter:/^\/(images|fonts|assets|public)\//},(f)=>{return{path:f.path,external:!0}})}},E=await Bun.build({entrypoints:[W],outdir:K,plugins:[I,_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!E.success)return console.error(`${B.red}Build failed:${B.reset}`,E.logs),!1;let w=E.outputs.find((T)=>T.path.endsWith(".html"));if(!w)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(w.path).text(),!0}catch(I){return console.error(`${B.red}Error building stx file:${B.reset}`,I),!1}};if(!await U())return!1;let z=Q0.dirname(W);await L$(z);let j=Z;try{if(j=await h0(Z),j!==Z)console.log(`${B.yellow}Port ${Z} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let I=X.hmrPort||j+1;J=G$({wsPort:I,verbose:!1}),G=J.start(I)}let H={},L=null,O;try{let{loadStxConfig:I}=await import("./chunk-3eya6sbk.js"),E=await I();if(O=X.stxOptions?.serverApi??E.serverApi,E?.apiRouter)L=E?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(E?.apiRoutes){H=E.apiRoutes;let w=Object.keys(H).length;if(w>0)console.log(`${B.blue}Loaded ${B.bright}${w} API route${w>1?"s":""}${B.reset}`)}if(E?.broadcasting?.enabled)try{let{startBroadcasting:w,loadChannels:D}=await import("./chunk-2gtwha4k.js"),T=E.broadcasting;await w(T);let f=T.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${f}/ws${B.reset}`);let c=Q0.join(process.cwd(),"channels.ts");if(E0.existsSync(c))try{let v=await D(c);console.log(`${B.blue}Loaded ${B.bright}${v} broadcast channel${v!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(v){console.warn(`${B.yellow}Failed to load channels.ts: ${v.message}${B.reset}`)}}catch(w){console.warn(`${B.yellow}Broadcasting failed to start: ${w.message}${B.reset}`)}}catch{}let{createServerApi:A,isServerApiSource:M}=await import("./chunk-zxnf0c9x.js"),V=await A(process.cwd(),O);if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let N=T4({port:j,async fetch(I){return z$(I,await(async()=>{let E=new URL(I.url);if([K,Q0.dirname(W),Q0.join(process.cwd(),"public")].some((v)=>M(Q0.join(v,E.pathname),process.cwd(),O)))return new Response("Not Found",{status:404});if(L)try{let v=await L.handleRequest(I);if(v.status!==404)return v}catch{}if(H[E.pathname])try{return await H[E.pathname](I)}catch(v){return new Response(JSON.stringify({error:v.message}),{status:500,headers:{"Content-Type":"application/json"}})}let w=await V(I);if(w)return w;if(E.pathname==="/")return(async()=>{let S=await J0(_||"");if(Y)S=P0(S,G);if(X.native)if(S.includes("<head>"))S=S.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(S.includes("<html"))S=S.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else S="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+S;if(X.titlebarHidden)if(S.includes("<head>"))S=S.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(S.includes("<html"))S=S.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else S=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${S}`;return S})().then((S)=>new Response(S,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let D=Q0.join(K,E.pathname);if(E0.existsSync(D)&&E0.statSync(D).isFile()){let v=Bun.file(D),S=Q0.extname(D).toLowerCase(),k="text/plain";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}let T=Q0.dirname(W),f=Q0.join(T,E.pathname);if(E0.existsSync(f)&&E0.statSync(f).isFile()){let v=Bun.file(f),S=Q0.extname(f).toLowerCase(),k="text/plain";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".svg":k="image/svg+xml";break;case".ico":k="image/x-icon";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}let c=Q0.join(process.cwd(),"public",E.pathname);if(E0.existsSync(c)&&E0.statSync(c).isFile()){let v=Bun.file(c),S=Q0.extname(c).toLowerCase(),k="application/octet-stream";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".svg":k="image/svg+xml";break;case".ico":k="image/x-icon";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}return new Response("Not Found",{status:404})})())},error(I){return new Response(`<pre>${I}
1135
+ </html>`,loader:"html"}}})}};async function C4($,X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=Q0.resolve($);if(!E0.existsSync(W))return console.error(`${B.red}Error: File not found: ${B.bright}${W}${B.reset}`),!1;if(W.endsWith(".md"))return X5(W,X);else if(!W.endsWith(".stx"))return console.error(`${B.red}Error: Unsupported file type: ${B.bright}${W}${B.reset}. Only .stx and .md files are supported.`),!1;let K=u0(process.cwd(),"output");E0.mkdirSync(K,{recursive:!0}),console.log(`${B.blue}Building ${B.bright}${$}${B.reset}...`);let _=null,U=async()=>{try{let I={name:"public-assets",setup(T){T.onResolve({filter:/^\/(images|fonts|assets|public)\//},(f)=>{return{path:f.path,external:!0}})}},E=await Bun.build({entrypoints:[W],outdir:K,plugins:[I,_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!E.success)return console.error(`${B.red}Build failed:${B.reset}`,E.logs),!1;let w=E.outputs.find((T)=>T.path.endsWith(".html"));if(!w)return console.error(`${B.red}No HTML output found${B.reset}`),!1;return _=await Bun.file(w.path).text(),!0}catch(I){return console.error(`${B.red}Error building stx file:${B.reset}`,I),!1}};if(!await U())return!1;let z=Q0.dirname(W);await L$(z);let j=Z;try{if(j=await h0(Z),j!==Z)console.log(`${B.yellow}Port ${Z} is busy, using port ${j} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let I=X.hmrPort||j+1;J=G$({wsPort:I,verbose:!1}),G=J.start(I)}let H={},L=null,O;try{let{loadStxConfig:I}=await import("./chunk-e0f3qs59.js"),E=await I();if(O=X.stxOptions?.serverApi??E.serverApi,E?.apiRouter)L=E?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(E?.apiRoutes){H=E.apiRoutes;let w=Object.keys(H).length;if(w>0)console.log(`${B.blue}Loaded ${B.bright}${w} API route${w>1?"s":""}${B.reset}`)}if(E?.broadcasting?.enabled)try{let{startBroadcasting:w,loadChannels:D}=await import("./chunk-2gtwha4k.js"),T=E.broadcasting;await w(T);let f=T.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${f}/ws${B.reset}`);let c=Q0.join(process.cwd(),"channels.ts");if(E0.existsSync(c))try{let v=await D(c);console.log(`${B.blue}Loaded ${B.bright}${v} broadcast channel${v!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(v){console.warn(`${B.yellow}Failed to load channels.ts: ${v.message}${B.reset}`)}}catch(w){console.warn(`${B.yellow}Broadcasting failed to start: ${w.message}${B.reset}`)}}catch{}let{createServerApi:A,isServerApiSource:M}=await import("./chunk-zxnf0c9x.js"),V=await A(process.cwd(),O);if(console.log(`${B.blue}Starting server on ${B.cyan}http://localhost:${j}/${B.reset}...`),Y)console.log(`${B.magenta}Hot reload enabled on ws://localhost:${G}${B.reset}`);let N=T4({port:j,async fetch(I){return z$(I,await(async()=>{let E=new URL(I.url);if([K,Q0.dirname(W),Q0.join(process.cwd(),"public")].some((v)=>M(Q0.join(v,E.pathname),process.cwd(),O)))return new Response("Not Found",{status:404});if(L)try{let v=await L.handleRequest(I);if(v.status!==404)return v}catch{}if(H[E.pathname])try{return await H[E.pathname](I)}catch(v){return new Response(JSON.stringify({error:v.message}),{status:500,headers:{"Content-Type":"application/json"}})}let w=await V(I);if(w)return w;if(E.pathname==="/")return(async()=>{let S=await J0(_||"");if(Y)S=P0(S,G);if(X.native)if(S.includes("<head>"))S=S.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else if(S.includes("<html"))S=S.replace(/(<html[^>]*>)/,"$1<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>");else S="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+S;if(X.titlebarHidden)if(S.includes("<head>"))S=S.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else if(S.includes("<html"))S=S.replace(/(<html[^>]*>)/,"$1<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>");else S=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${S}`;return S})().then((S)=>new Response(S,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}}));let D=Q0.join(K,E.pathname);if(E0.existsSync(D)&&E0.statSync(D).isFile()){let v=Bun.file(D),S=Q0.extname(D).toLowerCase(),k="text/plain";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}let T=Q0.dirname(W),f=Q0.join(T,E.pathname);if(E0.existsSync(f)&&E0.statSync(f).isFile()){let v=Bun.file(f),S=Q0.extname(f).toLowerCase(),k="text/plain";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".svg":k="image/svg+xml";break;case".ico":k="image/x-icon";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}let c=Q0.join(process.cwd(),"public",E.pathname);if(E0.existsSync(c)&&E0.statSync(c).isFile()){let v=Bun.file(c),S=Q0.extname(c).toLowerCase(),k="application/octet-stream";if(S===".ts"||S===".tsx"){let H0=new Bun.Transpiler({loader:S===".tsx"?"tsx":"ts"}),G0=await v.text(),s0=H0.transformSync(G0);return new Response(s0,{headers:{"Content-Type":"application/javascript","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}switch(S){case".html":k="text/html";break;case".css":k="text/css";break;case".js":k="text/javascript";break;case".json":k="application/json";break;case".png":k="image/png";break;case".jpg":case".jpeg":k="image/jpeg";break;case".gif":k="image/gif";break;case".svg":k="image/svg+xml";break;case".ico":k="image/x-icon";break;case".woff":k="font/woff";break;case".woff2":k="font/woff2";break;case".ttf":k="font/ttf";break;case".otf":k="font/otf";break;case".eot":k="application/vnd.ms-fontobject";break}return new Response(v,{headers:{"Content-Type":k}})}return new Response("Not Found",{status:404})})())},error(I){return new Response(`<pre>${I}
1136
1136
  ${I.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),console.log(`
1137
1137
  ${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
1138
1138
  ${B.bright}\u2192 ${B.cyan}http://localhost:${j}/${B.reset}`),console.log(`
@@ -1619,7 +1619,7 @@ ${H.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});console.clear(),con
1619
1619
  ${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
1620
1620
  ${B.bright}\u2192 ${B.cyan}http://localhost:${U}/${B.reset}`),console.log(`
1621
1621
  ${B.yellow}Routes:${B.reset}`);let z=new Set(W.map((H)=>H.routeTemplate)),j=Object.entries(G).filter(([H])=>!z.has(H)).sort(([H],[L])=>H.localeCompare(L)).map(([H,L])=>({route:H==="/"?"/":H,filePath:B0.relative(process.cwd(),L.filePath),fileType:L.fileType}));for(let H of W){let L=H.routeTemplate.replace(/\[([^\]]+)\]/g,":$1");j.push({route:L,filePath:B0.relative(process.cwd(),H.filePath),fileType:"stx"})}if(j.sort((H,L)=>H.route.localeCompare(L.route)),j.forEach((H,L)=>{let A=L===j.length-1?"\u2514\u2500 ":"\u251C\u2500 ",M=H.fileType==="md"?`${B.magenta}(markdown)${B.reset}`:"";console.log(` ${B.green}${A}${H.route}${B.reset} \u2192 ${B.bright}${H.filePath}${B.reset} ${M}`)}),console.log(`
1622
- Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),d0(F.url.toString(),()=>{if(Q)m0.watch(J,{recursive:!0}).close();F.stop()}),Q){console.log(`${B.blue}Watching for changes...${B.reset}`);let H=m0.watch(J,{recursive:!0},async(L,O)=>{if(!O)return;if(O.endsWith(".stx")||O.endsWith(".js")||O.endsWith(".ts")||O.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${O}${B.yellow} changed, rebuilding...${B.reset}`),o0.clear(),t0(),await K()});process.on("SIGINT",()=>{H.close(),F.stop(),process.exit(0)})}return!0}function R6($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var{serve:S4}=globalThis.Bun;import e from"fs";import m from"path";async function k6($){try{return _5(await Bun.file($).text())}catch{return}}function G5($){let X=Bun.file($),Z=m.extname($).toLowerCase(),Q={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Z)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Q[Z]||"application/octet-stream",...J}})}async function P4($=".",X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=m.resolve($),{loadStxConfig:K}=await import("./chunk-3eya6sbk.js"),_=await K(W),{createServerApi:U,isServerApiSource:F}=await import("./chunk-zxnf0c9x.js"),z=X.stxOptions?.serverApi??_.serverApi,j=await U(W,z),H=_.root&&_.root!=="."?m.join(W,_.root):W,L=X.pagesDir||_.pagesDir||"pages",O=m.join(H,L);if(!e.existsSync(O)&&!_._layerPageDirs?.some((R)=>e.existsSync(R)))return console.error(`${B.red}Error: No '${L}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${O}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${L}/index.stx for the homepage.${B.reset}`),!1;let A=H$(H,{pagesDir:L,pagesDirs:_._layerPageDirs?[O,..._._layerPageDirs.slice(1)]:void 0});if(A.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${O}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${A.length}${B.blue} routes${B.reset}`);let M=_?._pluginPageDirs||[],V=[];for(let{dir:R,prefix:x}of M)if(e.existsSync(R)){let P=H$(m.dirname(R),{pagesDir:m.basename(R)});for(let y of P){let Z0=x==="/"?y.pattern:`${x}${y.pattern==="/"?"":y.pattern}`;V.push({route:{...y,pattern:Z0},prefix:x})}if(P.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${P.length}${B.blue} routes at ${B.cyan}${x}${B.reset}`)}let N=new Map,q=null,I=null;if(X.stxOptions?.shell!==!1){if(I=await l6(W,X.stxOptions?.shell),I){if(q=await K5(I,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${m.relative(W,I)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}P6(),await y6(W);let E=b6();if(E.length>0)console.log(`${B.blue}Loaded ${B.bright}${E.length}${B.blue} middleware: ${B.dim}${E.join(", ")}${B.reset}`);let w={},D=null;try{let{loadStxConfig:R}=await import("./chunk-3eya6sbk.js"),x=await R(W);if(x?.apiRouter)D=x?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(x?.apiRoutes){w=x.apiRoutes;let P=Object.keys(w).length;if(P>0)console.log(`${B.blue}Loaded ${B.bright}${P} API route${P>1?"s":""}${B.reset}`)}if(x?.broadcasting?.enabled)try{let{startBroadcasting:P,loadChannels:y}=await import("./chunk-2gtwha4k.js"),Z0=x.broadcasting;await P(Z0);let R0=Z0.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${R0}/ws${B.reset}`);let g0=m.join(process.cwd(),"channels.ts");if(e.existsSync(g0))try{let p=await y(g0);console.log(`${B.blue}Loaded ${B.bright}${p} broadcast channel${p!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(p){console.warn(`${B.yellow}Failed to load channels.ts: ${p.message}${B.reset}`)}}catch(P){console.warn(`${B.yellow}Broadcasting failed to start: ${P.message}${B.reset}`)}}catch{}let T=u0(W,"output");e.mkdirSync(T,{recursive:!0});let f=new Map,c=new Set,v=async(R)=>{let x=x6(O,R);if(!x)return null;try{let P=await Bun.build({entrypoints:[x],outdir:T,plugins:[_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!P.success)return null;let y=P.outputs.find((Z0)=>Z0.path.endsWith(".html"));if(!y)return null;return await Bun.file(y.path).text()}catch{return null}},S=new Map,k=async(R,x)=>{try{let{processDirectives:P,extractVariables:y,defaultConfig:Z0,loadStxConfig:R0,injectRouterScript:g0}=await import("./chunk-3eya6sbk.js"),{checkCache:p,cacheTemplate:u,readFileCached:g,templateCache:h}=await import("./chunk-8wgsjh65.js"),Y0=await R0(W),f0=(i)=>{if(!i)return i;if(m.isAbsolute(i))return i;return m.resolve(W,i)},C={...Z0,...Y0,...X.stxOptions,autoShell:!0};if(X.debugDirectives)C.debug=!0;C.partialsDir=f0(C.partialsDir),C.componentsDir=f0(C.componentsDir),C.layoutsDir=f0(C.layoutsDir),C.storesDir=f0(C.storesDir||"stores"),C.cachePath=f0(C.cachePath)??u0(W,"cache");let X0=!x&&!X.profile,a=C.cache!==!1;if(a&&X0){let i=h.get(R.filePath);if(i)try{if((await e.promises.stat(R.filePath)).mtime.getTime()<=i.mtime){let q0=!0;for(let _0 of i.dependencies){if(!e.existsSync(_0)){q0=!1;break}if((await e.promises.stat(_0)).mtime.getTime()>i.mtime){q0=!1;break}}if(q0){let _0=i.output;if(q)_0=A$(_0,{preserveHead:!0});let E1=S.get(R.filePath);return{route:R,content:_0,status:E1?.status??await k6(R.filePath),headers:E1?.headers}}}}catch{}let A0=await p(R.filePath,C);if(A0){let N0=A0;if(q)N0=A$(N0,{preserveHead:!0});let q0=S.get(R.filePath);return{route:R,content:N0,status:q0?.status??await k6(R.filePath),headers:q0?.headers}}}let o=a?await g(R.filePath):await Bun.file(R.filePath).text(),K0=_5(o),{classifyAllScripts:d}=await import("./chunk-3eya6sbk.js"),O0=d(o),D0=O0.server.map((i)=>i.content),r=o;for(let i of O0.server)r=r.replace(i.fullTag,"");let n={__filename:R.filePath,__dirname:m.dirname(R.filePath),__stx_options:C,params:x??{},__stx_runtime_head:{}};for(let i of D0)try{await y(i,n,R.filePath)}catch(A0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",R.filePath,A0?.message||A0)}let S0=new Set,j0;if(X.profile){let i=performance.now();j0=await P(r,n,R.filePath,C,S0);let A0=performance.now()-i,N0=m.relative(W,R.filePath)||R.filePath;console.log(`[stx:profile] ${N0} \u2192 ${A0.toFixed(2)}ms`)}else j0=await P(r,n,R.filePath,C,S0);if(!q)j0=await g0(j0,{router:C.router});{let{interpolateScriptExpressions:i}=await import("./chunk-jmdxn2mq.js");j0=j0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(A0,N0,q0)=>{if(!/function\s+__stx_setup_/.test(q0))return A0;return`<script${N0}>${i(q0,n)}</script>`})}if(q)j0=A$(j0,{preserveHead:!0});if(a&&X0)await u(R.filePath,j0,S0,C);let{extractStreamBoundaries:_3}=await import("./chunk-0d6qgbks.js"),Q1=_3(n),V1=n.__streamTemplates;if(V1&&typeof V1==="object"&&Object.keys(V1).length>0){let i=n.streamBoundaries||{},A0={...C,autoShell:!1},N0=Object.keys(V1).map((_0)=>({id:_0,render:async()=>{let E1=typeof i[_0]==="function"?await i[_0]():void 0;return P(V1[_0],{...n,$boundary:E1},R.filePath,A0,new Set)}})),q0=new Set(N0.map((_0)=>_0.id));Q1=[...(Q1||[]).filter((_0)=>!q0.has(_0.id)),...N0]}if(Q1&&Q1.length>0)c.add(R.pattern);else Q1=void 0;let s5=T1(n),r5=C1(n);if(X0)S.set(R.filePath,{status:s5,headers:r5});return{route:R,content:j0,status:s5??K0,headers:r5,boundaries:Q1}}catch(P){return console.error(`${B.red}Error building ${B.bright}${R.pattern}${B.reset}:`,P),null}},H0=8,G0=async()=>{f.clear(),N.clear();for(let R=0;R<A.length;R+=H0){let x=A.slice(R,R+H0),P=await Promise.all(x.map((y)=>k(y)));for(let y of P)if(y)f.set(y.route.pattern,y)}for(let R=0;R<V.length;R+=H0){let x=V.slice(R,R+H0),P=await Promise.all(x.map(({route:y})=>k(y)));for(let y of P)if(y)N.set(y.route.pattern,y)}return f.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await G0())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await L$(W);let v0=Z;try{if(v0=await h0(Z),v0!==Z)console.log(`${B.yellow}Port ${Z} is busy, using port ${v0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let R=X.hmrPort||v0+1;J=G$({wsPort:R,verbose:!1}),G=J.start(R)}let z0=(R,x)=>{let y=`<script data-stx-route-params>(function(){var p=${JSON.stringify(x).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(R.includes("</head>"))return R.replace("</head>",`${y}</head>`);if(R.includes("<body"))return R.replace(/<body([^>]*)>/,`<body$1>${y}`);return y+R};console.log(`${B.blue}Starting server...${B.reset}`);let Z1=S4({port:v0,async fetch(R){let x=new URL(R.url),P=_?.publicDir||"public",y=m.join(W,P,x.pathname),Z0=m.join(W,x.pathname),R0=m.join(T,x.pathname);if([y,Z0,R0].some((C)=>F(C,W,z)))return new Response("Not Found",{status:404});let[g0,p,u]=await Promise.all([e.promises.stat(y).catch(()=>null),e.promises.stat(Z0).catch(()=>null),e.promises.stat(R0).catch(()=>null)]);if(g0?.isFile()&&!F(y,W,z))return G5(y);if(p?.isFile()&&!F(Z0,W,z))return G5(Z0);if(u?.isFile()&&!F(R0,W,z))return G5(R0);if(x.pathname.startsWith("/_stx/component/")){let C=decodeURIComponent(x.pathname.slice(16));if(C)try{let X0=`<${C} />`,a={...buildConfig,autoShell:!1},o=await processDirectives(X0,{},m.join(W,"components",`${C}.stx`),a,new Set);return new Response(o,{headers:{"Content-Type":"text/html"}})}catch(X0){return new Response(`<div class="stx-async-error">${X0.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(x.pathname==="/_stx/img"){let{handleImageRequest:C}=await import("./chunk-p78b80dp.js"),X0=await C(R,{publicDir:m.join(W,P),cacheDir:u0(W,"cache","img")});if(X0)return X0}if(D)try{let C=await D.handleRequest(R);if(C.status!==404)return C}catch{}if(w[x.pathname])try{return await w[x.pathname](R)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}let g=await j(R);if(g)return g;let h=W5(x.pathname,A);if(h){let C=f.get(h.route.pattern),X0=c.has(h.route.pattern);if(h.route.isDynamic&&Object.keys(h.params).length>0||X0){let a=await k(h.route,h.params);if(a)C=a}if(C){let a=C.status??200,o=C.headers??{},K0=(h.route.filePath?d6(await Bun.file(h.route.filePath).text().catch(()=>"")):null)??{};if(K0.validate){if(!await K0.validate({params:h.params})){let D0=await v(404);if(D0){let r=D0;if(r=await J0(r,W),Y)r=P0(r,G);return new Response(r,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(K0.middleware){let O0=v6(x.pathname,h.params,K0,x.search),D0=g6(O0,null,R,{isServer:!0}),r=await f6(K0.middleware,D0);if(r.redirect){let n=r.redirect.path,S0=r.redirect.options.redirectCode||302,j0=new Headers(r.responseHeaders);return j0.set("Location",n),new Response(null,{status:S0,headers:j0})}if(r.abort){let{statusCode:n,message:S0}=r.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${n}</title></head><body><h1>Error ${n}</h1><p>${S0}</p></body></html>`,{status:n,headers:{"Content-Type":"text/html"}})}if(Object.keys(r.state).length>0){let n=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(r.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;C.content=C.content.replace("</head>",`${n}</head>`)}}let d=C.content;if(q&&i6(R)){let O0=h6(d),D0=u6(d),r=d.match(/<title[^>]*>([\s\S]*?)<\/title>/i),n=r?c6(r[1].trim()):"";if(Object.keys(h.params).length>0)d=z0(d,h.params);d=await J0(d,W);let S0=_?.router?.container||"main";return d=a6(d,S0),new Response(d,{status:a,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":O0.layout,"X-STX-Layout-Group":O0.group,"X-STX-Runtime":D0?"true":"false",...n&&{"X-STX-Title":encodeURIComponent(n)},[m6]:p6(),...B1(),"Cache-Control":j$}})}if(q)d=O$(q,d);if(Object.keys(h.params).length>0)d=z0(d,h.params);if(d=await J0(d,W),Y)d=P0(d,G);if(X.native)if(d.includes("<head>"))d=d.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else d="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+d;if(X.titlebarHidden)if(d.includes("<head>"))d=d.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else d=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${d}`;if(C.boundaries&&C.boundaries.length>0){let{renderStreamingPage:O0,streamToResponse:D0}=await import("./chunk-0d6qgbks.js");return D0(O0(d,C.boundaries,{timeoutMs:30000}),{status:a,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(d,{status:a,headers:{"Content-Type":"text/html",...B1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...o}})}}if(V.length>0){let C=V.map((a)=>a.route),X0=W5(x.pathname,C);if(X0){let a=N.get(X0.route.pattern);if(a){let o=a.content;if(q)o=O$(q,o);if(Object.keys(X0.params).length>0)o=z0(o,X0.params);if(o=await J0(o,W),Y)o=P0(o,G);return new Response(o,{status:a.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:a}of M)if(a!=="/"&&x.pathname.startsWith(a)){let o=N.get(a)||N.get(a+"/");if(o){let K0=o.content;if(q)K0=O$(q,K0);if(K0=await J0(K0,W),Y)K0=P0(K0,G);return new Response(K0,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let Y0=f.get("/");if(Y0){let C=Y0.content;if(C=await J0(C,W),Y)C=P0(C,G);if(X.native)if(C.includes("<head>"))C=C.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else C="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+C;return new Response(C,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let f0=await v(404);if(f0){let C=f0;if(C=await J0(C,W),Y)C=P0(C,G);return new Response(C,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(R){let x=await v(500);if(x)return new Response(x,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${R}
1622
+ Press ${B.cyan}h${B.reset} + ${B.cyan}Enter${B.reset} to show shortcuts`),d0(F.url.toString(),()=>{if(Q)m0.watch(J,{recursive:!0}).close();F.stop()}),Q){console.log(`${B.blue}Watching for changes...${B.reset}`);let H=m0.watch(J,{recursive:!0},async(L,O)=>{if(!O)return;if(O.endsWith(".stx")||O.endsWith(".js")||O.endsWith(".ts")||O.endsWith(".md"))console.log(`${B.yellow}File ${B.bright}${O}${B.yellow} changed, rebuilding...${B.reset}`),o0.clear(),t0(),await K()});process.on("SIGINT",()=>{H.close(),F.stop(),process.exit(0)})}return!0}function R6($){return String($??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}var{serve:S4}=globalThis.Bun;import e from"fs";import m from"path";async function k6($){try{return _5(await Bun.file($).text())}catch{return}}function G5($){let X=Bun.file($),Z=m.extname($).toLowerCase(),Q={".html":"text/html",".css":"text/css",".js":"text/javascript",".json":"application/json",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".svg":"image/svg+xml",".ico":"image/x-icon",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"},J=[".js",".css",".json"].includes(Z)?{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}:{};return new Response(X,{headers:{"Content-Type":Q[Z]||"application/octet-stream",...J}})}async function P4($=".",X={}){let Z=X.port||3000,Q=X.watch!==!1,Y=X.hotReload!==!1&&Q,J=null,G=X.hmrPort||Z+1,W=m.resolve($),{loadStxConfig:K}=await import("./chunk-e0f3qs59.js"),_=await K(W),{createServerApi:U,isServerApiSource:F}=await import("./chunk-zxnf0c9x.js"),z=X.stxOptions?.serverApi??_.serverApi,j=await U(W,z),H=_.root&&_.root!=="."?m.join(W,_.root):W,L=X.pagesDir||_.pagesDir||"pages",O=m.join(H,L);if(!e.existsSync(O)&&!_._layerPageDirs?.some((R)=>e.existsSync(R)))return console.error(`${B.red}Error: No '${L}' directory found${B.reset}`),console.log(`${B.dim}Looked in: ${B.bright}${O}${B.reset}`),console.log(`${B.dim}Run stx dev from the app directory, pass it as an argument (stx dev <dir>),${B.reset}`),console.log(`${B.dim}point at another directory with --pages <dir>, or set pagesDir in stx.config.ts.${B.reset}`),console.log(`${B.dim}Starting fresh? Create ${L}/index.stx for the homepage.${B.reset}`),!1;let A=H$(H,{pagesDir:L,pagesDirs:_._layerPageDirs?[O,..._._layerPageDirs.slice(1)]:void 0});if(A.length===0)return console.error(`${B.red}Error: No page files found in ${B.bright}${O}${B.reset}`),!1;console.log(`${B.blue}Found ${B.bright}${A.length}${B.blue} routes${B.reset}`);let M=_?._pluginPageDirs||[],V=[];for(let{dir:R,prefix:x}of M)if(e.existsSync(R)){let P=H$(m.dirname(R),{pagesDir:m.basename(R)});for(let y of P){let Z0=x==="/"?y.pattern:`${x}${y.pattern==="/"?"":y.pattern}`;V.push({route:{...y,pattern:Z0},prefix:x})}if(P.length>0)console.log(`${B.blue}Plugin pages: ${B.bright}${P.length}${B.blue} routes at ${B.cyan}${x}${B.reset}`)}let N=new Map,q=null,I=null;if(X.stxOptions?.shell!==!1){if(I=await l6(W,X.stxOptions?.shell),I){if(q=await K5(I,X.stxOptions||{}),q)console.log(`${B.blue}Using app shell: ${B.bright}${m.relative(W,I)}${B.reset} ${B.dim}(deprecated: use layouts/default.stx instead)${B.reset}`)}}P6(),await y6(W);let E=b6();if(E.length>0)console.log(`${B.blue}Loaded ${B.bright}${E.length}${B.blue} middleware: ${B.dim}${E.join(", ")}${B.reset}`);let w={},D=null;try{let{loadStxConfig:R}=await import("./chunk-e0f3qs59.js"),x=await R(W);if(x?.apiRouter)D=x?.apiRouter,console.log(`${B.blue}Using custom router for API handling${B.reset}`);if(x?.apiRoutes){w=x.apiRoutes;let P=Object.keys(w).length;if(P>0)console.log(`${B.blue}Loaded ${B.bright}${P} API route${P>1?"s":""}${B.reset}`)}if(x?.broadcasting?.enabled)try{let{startBroadcasting:P,loadChannels:y}=await import("./chunk-2gtwha4k.js"),Z0=x.broadcasting;await P(Z0);let R0=Z0.port??6001;console.log(`${B.magenta}Broadcasting on ${B.cyan}ws://localhost:${R0}/ws${B.reset}`);let g0=m.join(process.cwd(),"channels.ts");if(e.existsSync(g0))try{let p=await y(g0);console.log(`${B.blue}Loaded ${B.bright}${p} broadcast channel${p!==1?"s":""}${B.blue} from channels.ts${B.reset}`)}catch(p){console.warn(`${B.yellow}Failed to load channels.ts: ${p.message}${B.reset}`)}}catch(P){console.warn(`${B.yellow}Broadcasting failed to start: ${P.message}${B.reset}`)}}catch{}let T=u0(W,"output");e.mkdirSync(T,{recursive:!0});let f=new Map,c=new Set,v=async(R)=>{let x=x6(O,R);if(!x)return null;try{let P=await Bun.build({entrypoints:[x],outdir:T,plugins:[_1],publicPath:"/",define:{"process.env.NODE_ENV":'"development"'},...X.stxOptions});if(!P.success)return null;let y=P.outputs.find((Z0)=>Z0.path.endsWith(".html"));if(!y)return null;return await Bun.file(y.path).text()}catch{return null}},S=new Map,k=async(R,x)=>{try{let{processDirectives:P,extractVariables:y,defaultConfig:Z0,loadStxConfig:R0,injectRouterScript:g0}=await import("./chunk-e0f3qs59.js"),{checkCache:p,cacheTemplate:u,readFileCached:g,templateCache:h}=await import("./chunk-8wgsjh65.js"),Y0=await R0(W),f0=(i)=>{if(!i)return i;if(m.isAbsolute(i))return i;return m.resolve(W,i)},C={...Z0,...Y0,...X.stxOptions,autoShell:!0};if(X.debugDirectives)C.debug=!0;C.partialsDir=f0(C.partialsDir),C.componentsDir=f0(C.componentsDir),C.layoutsDir=f0(C.layoutsDir),C.storesDir=f0(C.storesDir||"stores"),C.cachePath=f0(C.cachePath)??u0(W,"cache");let X0=!x&&!X.profile,a=C.cache!==!1;if(a&&X0){let i=h.get(R.filePath);if(i)try{if((await e.promises.stat(R.filePath)).mtime.getTime()<=i.mtime){let q0=!0;for(let _0 of i.dependencies){if(!e.existsSync(_0)){q0=!1;break}if((await e.promises.stat(_0)).mtime.getTime()>i.mtime){q0=!1;break}}if(q0){let _0=i.output;if(q)_0=A$(_0,{preserveHead:!0});let E1=S.get(R.filePath);return{route:R,content:_0,status:E1?.status??await k6(R.filePath),headers:E1?.headers}}}}catch{}let A0=await p(R.filePath,C);if(A0){let N0=A0;if(q)N0=A$(N0,{preserveHead:!0});let q0=S.get(R.filePath);return{route:R,content:N0,status:q0?.status??await k6(R.filePath),headers:q0?.headers}}}let o=a?await g(R.filePath):await Bun.file(R.filePath).text(),K0=_5(o),{classifyAllScripts:d}=await import("./chunk-e0f3qs59.js"),O0=d(o),D0=O0.server.map((i)=>i.content),r=o;for(let i of O0.server)r=r.replace(i.fullTag,"");let n={__filename:R.filePath,__dirname:m.dirname(R.filePath),__stx_options:C,params:x??{},__stx_runtime_head:{}};for(let i of D0)try{await y(i,n,R.filePath)}catch(A0){if(X.stxOptions?.debug)console.error("[stx] variable extraction error",R.filePath,A0?.message||A0)}let S0=new Set,j0;if(X.profile){let i=performance.now();j0=await P(r,n,R.filePath,C,S0);let A0=performance.now()-i,N0=m.relative(W,R.filePath)||R.filePath;console.log(`[stx:profile] ${N0} \u2192 ${A0.toFixed(2)}ms`)}else j0=await P(r,n,R.filePath,C,S0);if(!q)j0=await g0(j0,{router:C.router});{let{interpolateScriptExpressions:i}=await import("./chunk-jmdxn2mq.js");j0=j0.replace(/<script\b([^>]*)>([\s\S]*?)<\/script>/g,(A0,N0,q0)=>{if(!/function\s+__stx_setup_/.test(q0))return A0;return`<script${N0}>${i(q0,n)}</script>`})}if(q)j0=A$(j0,{preserveHead:!0});if(a&&X0)await u(R.filePath,j0,S0,C);let{extractStreamBoundaries:_3}=await import("./chunk-0d6qgbks.js"),Q1=_3(n),V1=n.__streamTemplates;if(V1&&typeof V1==="object"&&Object.keys(V1).length>0){let i=n.streamBoundaries||{},A0={...C,autoShell:!1},N0=Object.keys(V1).map((_0)=>({id:_0,render:async()=>{let E1=typeof i[_0]==="function"?await i[_0]():void 0;return P(V1[_0],{...n,$boundary:E1},R.filePath,A0,new Set)}})),q0=new Set(N0.map((_0)=>_0.id));Q1=[...(Q1||[]).filter((_0)=>!q0.has(_0.id)),...N0]}if(Q1&&Q1.length>0)c.add(R.pattern);else Q1=void 0;let s5=T1(n),r5=C1(n);if(X0)S.set(R.filePath,{status:s5,headers:r5});return{route:R,content:j0,status:s5??K0,headers:r5,boundaries:Q1}}catch(P){return console.error(`${B.red}Error building ${B.bright}${R.pattern}${B.reset}:`,P),null}},H0=8,G0=async()=>{f.clear(),N.clear();for(let R=0;R<A.length;R+=H0){let x=A.slice(R,R+H0),P=await Promise.all(x.map((y)=>k(y)));for(let y of P)if(y)f.set(y.route.pattern,y)}for(let R=0;R<V.length;R+=H0){let x=V.slice(R,R+H0),P=await Promise.all(x.map(({route:y})=>k(y)));for(let y of P)if(y)N.set(y.route.pattern,y)}return f.size>0};if(console.log(`${B.blue}Building pages...${B.reset}`),!await G0())return console.error(`${B.red}No pages were successfully built${B.reset}`),!1;await L$(W);let v0=Z;try{if(v0=await h0(Z),v0!==Z)console.log(`${B.yellow}Port ${Z} is busy, using port ${v0} instead${B.reset}`)}catch{return console.error(`${B.red}Could not find an available port${B.reset}`),!1}if(Y){let R=X.hmrPort||v0+1;J=G$({wsPort:R,verbose:!1}),G=J.start(R)}let z0=(R,x)=>{let y=`<script data-stx-route-params>(function(){var p=${JSON.stringify(x).replace(/</g,"\\u003C").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")};window.__stx_rp=p;if(window.stx){window.stx._rp=p;if(window.stx.setRouteParams)window.stx.setRouteParams(p)}})()</script>`;if(R.includes("</head>"))return R.replace("</head>",`${y}</head>`);if(R.includes("<body"))return R.replace(/<body([^>]*)>/,`<body$1>${y}`);return y+R};console.log(`${B.blue}Starting server...${B.reset}`);let Z1=S4({port:v0,async fetch(R){let x=new URL(R.url),P=_?.publicDir||"public",y=m.join(W,P,x.pathname),Z0=m.join(W,x.pathname),R0=m.join(T,x.pathname);if([y,Z0,R0].some((C)=>F(C,W,z)))return new Response("Not Found",{status:404});let[g0,p,u]=await Promise.all([e.promises.stat(y).catch(()=>null),e.promises.stat(Z0).catch(()=>null),e.promises.stat(R0).catch(()=>null)]);if(g0?.isFile()&&!F(y,W,z))return G5(y);if(p?.isFile()&&!F(Z0,W,z))return G5(Z0);if(u?.isFile()&&!F(R0,W,z))return G5(R0);if(x.pathname.startsWith("/_stx/component/")){let C=decodeURIComponent(x.pathname.slice(16));if(C)try{let X0=`<${C} />`,a={...buildConfig,autoShell:!1},o=await processDirectives(X0,{},m.join(W,"components",`${C}.stx`),a,new Set);return new Response(o,{headers:{"Content-Type":"text/html"}})}catch(X0){return new Response(`<div class="stx-async-error">${X0.message}</div>`,{status:500,headers:{"Content-Type":"text/html"}})}}if(x.pathname==="/_stx/img"){let{handleImageRequest:C}=await import("./chunk-p78b80dp.js"),X0=await C(R,{publicDir:m.join(W,P),cacheDir:u0(W,"cache","img")});if(X0)return X0}if(D)try{let C=await D.handleRequest(R);if(C.status!==404)return C}catch{}if(w[x.pathname])try{return await w[x.pathname](R)}catch(C){return new Response(JSON.stringify({error:C.message}),{status:500,headers:{"Content-Type":"application/json"}})}let g=await j(R);if(g)return g;let h=W5(x.pathname,A);if(h){let C=f.get(h.route.pattern),X0=c.has(h.route.pattern);if(h.route.isDynamic&&Object.keys(h.params).length>0||X0){let a=await k(h.route,h.params);if(a)C=a}if(C){let a=C.status??200,o=C.headers??{},K0=(h.route.filePath?d6(await Bun.file(h.route.filePath).text().catch(()=>"")):null)??{};if(K0.validate){if(!await K0.validate({params:h.params})){let D0=await v(404);if(D0){let r=D0;if(r=await J0(r,W),Y)r=P0(r,G);return new Response(r,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}}if(K0.middleware){let O0=v6(x.pathname,h.params,K0,x.search),D0=g6(O0,null,R,{isServer:!0}),r=await f6(K0.middleware,D0);if(r.redirect){let n=r.redirect.path,S0=r.redirect.options.redirectCode||302,j0=new Headers(r.responseHeaders);return j0.set("Location",n),new Response(null,{status:S0,headers:j0})}if(r.abort){let{statusCode:n,message:S0}=r.abort.error;return new Response(`<!DOCTYPE html><html><head><title>Error ${n}</title></head><body><h1>Error ${n}</h1><p>${S0}</p></body></html>`,{status:n,headers:{"Content-Type":"text/html"}})}if(Object.keys(r.state).length>0){let n=`<script>(function(){var s=typeof stx!=='undefined'?stx:{};s._ms=${JSON.stringify(r.state)};if(s.setMiddlewareState)s.setMiddlewareState(s._ms);})()</script>`;C.content=C.content.replace("</head>",`${n}</head>`)}}let d=C.content;if(q&&i6(R)){let O0=h6(d),D0=u6(d),r=d.match(/<title[^>]*>([\s\S]*?)<\/title>/i),n=r?c6(r[1].trim()):"";if(Object.keys(h.params).length>0)d=z0(d,h.params);d=await J0(d,W);let S0=_?.router?.container||"main";return d=a6(d,S0),new Response(d,{status:a,headers:{"Content-Type":"text/html","X-STX-Fragment":"true","X-STX-Layout":O0.layout,"X-STX-Layout-Group":O0.group,"X-STX-Runtime":D0?"true":"false",...n&&{"X-STX-Title":encodeURIComponent(n)},[m6]:p6(),...B1(),"Cache-Control":j$}})}if(q)d=O$(q,d);if(Object.keys(h.params).length>0)d=z0(d,h.params);if(d=await J0(d,W),Y)d=P0(d,G);if(X.native)if(d.includes("<head>"))d=d.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else d="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+d;if(X.titlebarHidden)if(d.includes("<head>"))d=d.replace("<head>","<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script>");else d=`<head><style>html.stx-titlebar-hidden .stx-traffic-lights-dot{visibility:hidden}</style><script>document.documentElement.classList.add('stx-titlebar-hidden')</script></head>${d}`;if(C.boundaries&&C.boundaries.length>0){let{renderStreamingPage:O0,streamToResponse:D0}=await import("./chunk-0d6qgbks.js");return D0(O0(d,C.boundaries,{timeoutMs:30000}),{status:a,headers:{"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}return new Response(d,{status:a,headers:{"Content-Type":"text/html",...B1(),"Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0",...o}})}}if(V.length>0){let C=V.map((a)=>a.route),X0=W5(x.pathname,C);if(X0){let a=N.get(X0.route.pattern);if(a){let o=a.content;if(q)o=O$(q,o);if(Object.keys(X0.params).length>0)o=z0(o,X0.params);if(o=await J0(o,W),Y)o=P0(o,G);return new Response(o,{status:a.status??200,headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}for(let{prefix:a}of M)if(a!=="/"&&x.pathname.startsWith(a)){let o=N.get(a)||N.get(a+"/");if(o){let K0=o.content;if(q)K0=O$(q,K0);if(K0=await J0(K0,W),Y)K0=P0(K0,G);return new Response(K0,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}}}let Y0=f.get("/");if(Y0){let C=Y0.content;if(C=await J0(C,W),Y)C=P0(C,G);if(X.native)if(C.includes("<head>"))C=C.replace("<head>","<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script>");else C="<head><style>[data-stx-sidebar],.stx-sidebar{display:none!important}</style><script>window.__craftNativeSidebar=true;document.documentElement.classList.add('has-native-sidebar')</script></head>"+C;return new Response(C,{headers:{"Content-Type":"text/html","Cache-Control":"no-store, no-cache, must-revalidate",Pragma:"no-cache",Expires:"0"}})}let f0=await v(404);if(f0){let C=f0;if(C=await J0(C,W),Y)C=P0(C,G);return new Response(C,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})},async error(R){let x=await v(500);if(x)return new Response(x,{status:500,headers:{"Content-Type":"text/html"}});return new Response(`<pre>${R}
1623
1623
  ${R.stack}</pre>`,{headers:{"Content-Type":"text/html"}})}});if(console.clear(),console.log(`
1624
1624
  ${B.blue}stx${B.reset} ${B.green}${process.env.stx_VERSION||"v0.0.10"}${B.reset} ${B.dim}ready in ${Math.random()*10+5|0}.${Math.random()*90+10|0} ms${B.reset}`),console.log(`
1625
1625
  ${B.bright}\u2192 ${B.cyan}http://localhost:${v0}/${B.reset}`),Y)console.log(`${B.dim} HMR: ws://localhost:${G}${B.reset}`);console.log(`
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$ as jm,$a as mo,$b as xp,$c as xq,$d as xr,A as Vk,Aa as xn,Ab as Ro,Ac as Yp,Ad as Yq,Ae as cs,B as Wk,Ba as yn,Bb as So,Bc as Zp,Bd as Zq,Be as ds,C as Xk,Ca as Ln,Cb as To,Cc as _p,Cd as _q,Ce as es,D as Yk,Da as Mn,Db as Uo,Dc as $p,Dd as $q,De as fs,E as Ol,Ea as Nn,Eb as Vo,Ec as aq,Ed as ar,Ee as gs,F as Pl,Fa as On,Fb as Wo,Fc as bq,Fd as br,Fe as hs,G as Ql,Ga as Pn,Gb as Xo,Gc as cq,Gd as cr,Ge as is,H as Rl,Ha as Qn,Hb as Yo,Hc as dq,Hd as dr,He as js,I as Sl,Ia as Un,Ib as Zo,Ic as eq,Id as er,Ie as ks,J as Tl,Ja as Vn,Jb as _o,Jc as fq,Jd as fr,Je as ls,K as Ul,Ka as Wn,Kb as $o,Kc as gq,Kd as gr,Ke as ms,L as Vl,La as Xn,Lb as ap,Lc as hq,Ld as hr,M as Wl,Ma as Yn,Mb as bp,Mc as iq,Md as ir,N as Xl,Na as Zn,Nb as jp,Nc as jq,Nd as jr,O as Yl,Oa as _n,Ob as kp,Oc as kq,Od as kr,P as Zl,Pa as $n,Pb as lp,Pc as lq,Pd as lr,Q as _l,Qa as ao,Qb as mp,Qc as mq,Qd as mr,R as $l,Ra as bo,Rb as np,Rc as nq,Rd as nr,S as am,Sa as co,Sb as op,Sc as oq,Sd as or,T as bm,Ta as eo,Tb as pp,Tc as pq,Td as pr,U as cm,Ua as fo,Ub as qp,Uc as qq,Ud as qr,V as dm,Va as go,Vb as rp,Vc as rq,Vd as rr,W as em,Wa as ho,Wb as sp,Wc as sq,Wd as sr,X as fm,Xa as io,Xb as tp,Xc as tq,Xd as tr,Y as gm,Ya as jo,Yb as up,Yc as uq,Yd as ur,Z as hm,Za as ko,Zb as vp,Zc as vq,Zd as vr,_ as im,_a as lo,_b as wp,_c as wq,_d as wr,aa as km,ab as no,ac as yp,ad as yq,ae as yr,ba as lm,bb as oo,bc as zp,bd as zq,be as Fr,ca as mm,cb as po,cc as Ap,cd as Aq,ce as Gr,da as nm,db as qo,dc as Bp,dd as Bq,de as Hr,ea as om,eb as ro,ec as Cp,ed as Cq,ee as Ir,fa as pm,fb as so,fc as Dp,fd as Dq,fe as Jr,ga as qm,gb as to,gc as Ep,gd as Eq,ge as Kr,ha as rm,hb as uo,hc as Fp,hd as Fq,he as Lr,ia as sm,ib as vo,ic as Gp,id as Gq,ie as Mr,ja as tm,jb as wo,jc as Hp,jd as Hq,je as Nr,ka as um,kb as xo,kc as Ip,kd as Iq,ke as Or,la as vm,lb as yo,lc as Jp,ld as Jq,le as Pr,ma as wm,mb as zo,mc as Kp,md as Kq,me as Qr,na as xm,nb as Co,nc as Lp,nd as Lq,ne as Rr,o as a,oa as ym,ob as Do,oc as Mp,od as Mq,oe as Sr,p as Gk,pa as mn,pb as Eo,pc as Np,pd as Nq,pe as Tr,q as Hk,qa as nn,qb as Fo,qc as Op,qd as Oq,qe as Ur,r as Ik,ra as on,rb as Ho,rc as Pp,rd as Pq,re as Vr,s as Jk,sa as pn,sb as Io,sc as Qp,sd as Qq,se as Wr,t as Kk,ta as qn,tb as Jo,tc as Rp,td as Rq,te as Xr,u as Lk,ua as rn,ub as Ko,uc as Sp,ud as Sq,ue as Yr,v as Mk,va as sn,vb as Mo,vc as Tp,vd as Tq,ve as Zr,w as Nk,wa as tn,wb as No,wc as Up,wd as Uq,we as _r,x as Ok,xa as un,xb as Oo,xc as Vp,xd as Vq,xe as $r,y as Tk,ya as vn,yb as Po,yc as Wp,yd as Wq,ye as as,z as Uk,za as wn,zb as Qo,zc as Xp,zd as Xq,ze as bs}from"./chunk-57kxjr4t.js";import{Le as cp,Me as dp,Ne as ep,Oe as fp,Pe as gp,Qe as hp,Re as ip}from"./chunk-4ce5ma6a.js";import{Se as Ao,Te as Bo}from"./chunk-7hb89n3z.js";import{Ue as Go}from"./chunk-0smr2xjs.js";import{Ve as ln}from"./chunk-801bg5d8.js";import{We as Rn,Xe as Sn,Ye as Tn,Ze as Lo}from"./chunk-s5dwatkj.js";import{$e as _k,_e as Zk,af as $k,bf as al,cf as bl,df as cl,ef as dl,ff as el,gf as fl,hf as gl,if as hl,jf as il,kf as jl,lf as kl,mf as ll}from"./chunk-n0d7nwhd.js";import{nf as Cl,of as Dl,pf as El,qf as Fl,rf as Gl,sf as Hl,tf as Il,uf as Jl,vf as Kl,wf as Ll,xf as Ml,yf as Nl}from"./chunk-qrvey4wk.js";import{Af as Bl,zf as Al}from"./chunk-nybn003d.js";import{Bf as ml,Cf as nl,Df as ol,Ef as pl,Ff as ql,Gf as rl,Hf as sl,Jf as tl,Kf as ul,Lf as vl,Mf as wl,Nf as xl,Of as yl,Rf as zl}from"./chunk-hy79zwyy.js";import{Sf as Vm,Tf as Wm,Uf as Xm,Vf as Ym,Wf as Zm,Xf as kn}from"./chunk-rbfm5sjt.js";import{$f as Cm,Yf as zm,Zf as Am,_f as Bm,ag as Dm,bg as Em,cg as Fm,dg as Gm,eg as Hm,fg as Im,gg as Jm,hg as Km,ig as Lm,jg as Mm,kg as Nm,lg as Om,mg as _m,ng as $m,og as an,pg as bn,qg as cn,rg as dn,sg as en,tg as fn,ug as gn,vg as hn,wg as jn}from"./chunk-jy451jg5.js";import{xg as Pm,yg as Qm}from"./chunk-0knxnyq6.js";import{Ag as An,Bg as Bn,Cg as Cn,Dg as Dn,Eg as En,Fg as Fn,Gg as Gn,Hg as Hn,Ig as In,Jg as Jn,Kg as Kn,zg as zn}from"./chunk-634gaa9d.js";import{Lg as pi,Mg as qi,Ng as ri,Og as si,Pg as ti,Qg as ui}from"./chunk-6yfccnr7.js";import{Rg as Kj,Sg as Lj,Tg as Mj,Xg as Nj,Yg as Oj,Zg as Pj}from"./chunk-tv04k7gq.js";import{$g as Wj,_g as Vj,ah as Xj,bh as Yj,ch as Zj,dh as _j,eh as $j,fh as ak,gh as bk,hh as ck,ih as dk}from"./chunk-n1y0hjk1.js";import{jh as Aj,kh as Bj,lh as Cj,mh as Dj,nh as Ej,ph as Fj,qh as Gj,rh as Hj,sh as Ij,th as Jj}from"./chunk-bcpjhcpn.js";import{uh as vk,wh as wk}from"./chunk-y4zddt5r.js";import{Ch as Kh,Dh as Lh,Eh as Mh,Fh as Nh,Gh as Oh,Hh as Ph}from"./chunk-g7bpkpd4.js";import{Jh as Qh,Kh as Rh,Lh as Sh,Mh as Th,Nh as Uh,Oh as Vh,Ph as Wh,Qh as Xh,Rh as Yh,Sh as Zh,Th as _h,Uh as $h,Vh as ai,Wh as bi}from"./chunk-k33778kc.js";import{$h as fi,Yh as ci,Zh as di,_h as ei}from"./chunk-yg0qm73a.js";import{ei as gi}from"./chunk-g1vxsvqv.js";import{hi as jh}from"./chunk-3y8vvkar.js";import{ii as kh}from"./chunk-fqq5k9ve.js";import{ji as lh,ki as mh}from"./chunk-ya5m5vbn.js";import{li as nh,mi as oh,ni as ph,oi as qh,pi as rh,qi as sh}from"./chunk-y4nzmkea.js";import{ri as th,si as uh,ti as vh,ui as wh,vi as xh}from"./chunk-7kw3grq5.js";import{Ai as Ch,wi as yh,xi as zh,yi as Ah,zi as Bh}from"./chunk-c79nfdyj.js";import{Bi as Dh,Ci as Eh,Di as Fh,Ei as Gh,Fi as Hh,Gi as Ih,Hi as Jh}from"./chunk-ej8mv2k6.js";import{Ii as hh,Ji as ih}from"./chunk-dtdwjpvf.js";import"./chunk-ra1s4s6b.js";import{Ni as Oe,Oi as Pe,Pi as Qe,Qi as Re,Ri as Se,Si as Te,Ti as Ue,Ui as Ve,Vi as We,Wi as Xe,Xi as Ye,Yi as Ze,Zi as _e,_i as $e}from"./chunk-79fj9zem.js";import{$i as rf,aj as sf,bj as tf,cj as uf,dj as vf,ej as wf,fj as xf,gj as yf,hj as zf,ij as Af,jj as Bf,kj as Cf,lj as Df,mj as Ef,nj as Ff,oj as Gf,pj as Hf}from"./chunk-krt45cqy.js";import{Aj as gf,Bj as hf,Cj as jf,Dj as kf,Ej as lf,Fj as mf,Gj as nf,Hj as of,Ij as pf,Jj as qf,wj as cf,xj as df,yj as ef,zj as ff}from"./chunk-0t1yyn1d.js";import{Kj as If,Lj as Jf,Mj as Kf,Nj as Lf,Oj as Mf,Pj as Nf,Qj as Of,Rj as Pf,Sj as Qf,Tj as Rf,Uj as Sf,Vj as Tf,Wj as Uf,Xj as Vf}from"./chunk-3kd0zn9c.js";import{pk as zr,qk as Ar,rk as Br,sk as Cr,tk as Dr,uk as Er}from"./chunk-ec8jsqgm.js";import{Ak as Sm,Bk as Tm,Ck as Um,vk as Pk,wk as Qk,xk as Rk,yk as Sk,zk as Rm}from"./chunk-wz4fnsat.js";import"./chunk-frp9fc7j.js";import"./chunk-degz74nv.js";import{nl as ec,ol as fc,sl as gc}from"./chunk-t23kccpz.js";import{ul as bc}from"./chunk-qjvny3wf.js";import{$l as Qb,$m as ld,$n as He,$o as yg,$p as mi,$q as Rj,Al as Ca,Am as Ec,An as Qd,Ap as Zg,Aq as aj,Ar as Dk,Bl as Da,Bm as Fc,Bn as Rd,Bo as Xf,Bp as _g,Bq as bj,Br as Ek,Cl as Ea,Cm as Gc,Cn as Sd,Cp as $g,Cq as cj,Cr as Fk,Dl as Fa,Dm as Hc,Dn as Td,Dp as ah,Dq as dj,El as Ga,Em as Ic,En as Ud,Ep as bh,Eq as ej,Fl as Ha,Fm as Jc,Fn as Vd,Fp as ch,Fq as fj,Gl as Ia,Gm as Kc,Gn as Wd,Gp as dh,Gq as gj,Hl as Ja,Hm as Lc,Hn as Xd,Hp as eh,Hq as hj,Il as Ka,Im as Mc,In as Yd,Io as Yf,Ip as fh,Iq as ij,Jl as La,Jm as Nc,Jn as Zd,Jp as gh,Jq as jj,Kl as Ma,Km as Oc,Kn as _d,Ko as Zf,Kp as hi,Kq as kj,Ll as Na,Lm as Pc,Ln as $d,Lp as ii,Lq as lj,Ml as Oa,Mm as Zc,Mn as qe,Mo as _f,Mq as mj,Nl as ib,Nm as _c,Nn as re,No as $f,Nq as nj,Ol as jb,Om as $c,On as se,Oo as ag,Op as ji,Oq as oj,Pl as kb,Pm as ad,Pn as te,Po as bg,Pq as pj,Ql as lb,Qm as bd,Qn as ue,Qo as cg,Qq as qj,Rl as mb,Rm as cd,Rn as ve,Ro as og,Rq as rj,Sl as nb,Sm as dd,Sn as we,So as pg,Sq as sj,Tn as xe,To as qg,Tq as tj,Um as ed,Un as ye,Uo as rg,Uq as uj,Vl as Kb,Vm as fd,Vn as ze,Vo as sg,Vq as vj,Wl as Lb,Wm as gd,Wn as Ae,Wo as tg,Wq as wj,Xl as Mb,Xm as hd,Xn as Be,Xo as ug,Xq as xj,Yl as Nb,Ym as id,Yn as Ce,Yo as vg,Yq as yj,Zl as Ob,Zm as jd,Zn as De,Zo as wg,Zp as ki,Zq as zj,_l as Pb,_m as kd,_o as xg,_p as li,_q as Qj,am as Ub,an as md,ao as Ie,ap as zg,aq as ni,ar as Sj,bm as Vb,bn as nd,bo as Je,bp as Ag,bq as oi,br as Tj,cm as Wb,cn as od,co as Ke,cp as Bg,cq as vi,cr as Uj,dm as hc,dn as pd,do as Le,dp as Cg,dq as wi,dr as ek,em as ic,en as ud,eo as Me,ep as Dg,eq as xi,er as fk,fm as jc,fn as vd,fo as Ne,fp as Eg,fq as yi,fr as gk,gm as kc,gn as wd,gp as Fg,gq as zi,gr as hk,hm as lc,hn as xd,hp as Gg,hq as Ai,hr as ik,im as mc,in as yd,ip as Hg,iq as Bi,ir as jk,jm as nc,jn as zd,jo as af,jp as Ig,jq as Ci,jr as kk,km as oc,kn as Ad,ko as bf,kp as Jg,kq as Di,kr as lk,lm as pc,ln as Bd,lp as Kg,lq as Ei,lr as mk,mm as qc,mn as Cd,mo as Wf,mp as Lg,mq as Fi,mr as nk,nm as rc,nn as Dd,np as Mg,nq as Gi,nr as ok,om as sc,on as Ed,op as Ng,oq as Hi,or as pk,pm as tc,pn as Fd,pp as Og,pq as Ii,pr as qk,qm as uc,qn as Gd,qp as Pg,qq as Ji,qr as rk,rm as vc,rn as Hd,rp as Qg,rq as Ki,rr as sk,sm as wc,sn as Id,sp as Rg,sq as Li,sr as tk,tm as xc,tn as Jd,tp as Sg,tq as Mi,tr as uk,um as yc,un as Kd,up as Tg,uq as Wi,ur as xk,vl as xa,vm as zc,vn as Ld,vp as Ug,vq as Xi,vr as yk,wl as ya,wm as Ac,wn as Md,wp as Vg,wq as Yi,wr as zk,xl as za,xm as Bc,xn as Nd,xp as Wg,xq as Zi,xr as Ak,yl as Aa,ym as Cc,yn as Od,yp as Xg,yq as _i,yr as Bk,zl as Ba,zm as Dc,zn as Pd,zp as Yg,zq as $i,zr as Ck}from"./chunk-3ssjb8cx.js";import{$r as ka,Dr as M,Er as N,Fr as O,Gr as P,Hr as Q,Ir as R,Jr as S,Kr as T,Lr as U,Mr as V,Nr as W,Or as X,Pr as Y,Qr as Z,Rr as _,Sr as $,Tr as aa,Ur as ba,Vr as ca,Wr as da,Xr as ea,Yr as fa,Zr as ia,_r as ja,as as la,bs as ma,cs as na,ds as oa,es as pa,fs as qa,gs as ra,hs as sa,is as ta,js as ua,ks as va,ls as wa}from"./chunk-ykevda74.js";import{ms as ga,ns as ha}from"./chunk-ez003q74.js";import{os as Rb,ps as Sb,qs as Tb}from"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import{As as Qi,Bs as Ri,Cs as Si,Ds as Ti,Es as Ui,Fs as Vi,xs as Ni,ys as Oi,zs as Pi}from"./chunk-19m7hed6.js";import{$s as Uc,Xs as Qc,Ys as Rc,Zs as Sc,_s as Tc,bt as Vc,kt as Wc,lt as Xc,mt as Yc}from"./chunk-kjd9hbg4.js";import{nt as Xb,ot as Yb,pt as Zb,qt as _b,rt as $b,st as ac}from"./chunk-ejwfnttb.js";import{Bt as Fe,Et as Ge,zt as Ee}from"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import{Jt as cc,Kt as dc}from"./chunk-1nnza3m6.js";import{Ot as dg,Pt as eg,Qt as fg,Rt as gg,St as hg,Tt as ig,Ut as jg,Wt as kg,Xt as lg,Yt as mg,Zt as ng}from"./chunk-hkrzv980.js";import{$t as rd,Au as pe,_t as qd,au as sd,bu as td,lu as ae,mu as be,nu as ce,ou as de,pu as ee,qu as fe,ru as ge,su as he,tu as ie,uu as je,vu as ke,wu as le,xu as me,yu as ne,zu as oe}from"./chunk-qbz6yn8c.js";import{$u as B,Bu as b,Cu as c,Du as d,Eu as e,Fu as f,Gu as g,Hu as h,Iu as i,Ju as j,Ku as k,Lu as l,Mu as m,Nu as n,Ou as o,Pu as p,Qu as q,Ru as r,Su as s,Tu as t,Uu as u,Vu as v,Wu as w,Xu as x,Yu as y,Zu as z,_u as A,av as C,bv as D,cv as E,dv as F,ev as G,fv as H,gv as I,hv as J,iv as K,jv as L}from"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import{Av as pb,Bv as qb,Cv as rb,Dv as sb,Ev as tb,Fv as ub,Gv as vb,Hv as wb,Iv as xb,Jv as yb,Kv as zb,Lv as Ab,Mv as Bb,Nv as Cb,Ov as Db,Pv as Eb,Qv as Fb,Rv as Gb,Sv as Hb,Tv as Ib,Uv as Jb,zv as ob}from"./chunk-aa8015mk.js";import{Aw as gb,Cw as hb,Yv as Pa,Zv as Qa,aw as Ra,fw as Sa,gw as Ta,mw as Ua,nw as Va,ow as Wa,pw as Xa,qw as Ya,rw as Za,sw as _a,tw as $a,uw as ab,vw as bb,ww as cb,xw as db,yw as eb,zw as fb}from"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{hl as writeNetlifyConfig,$m as writeManifest,Ml as writeImageManifest,sp as wrapComponentForHMR,$r as withDefaults,uk as webComponentDirectiveHandler,hq as watermark,jr as watchViews,Wl as watchMultiple,Xl as watchEffect,Vl as watch,Le as warmImagePlaceholders,im as waitForStore,X as waitForLocale,dp as virtualPathFor,hk as videoDirective,G as validators,ds as validated,Be as validateValueEnhanced,ki as validateTemplate,Pm as validateRouteRules,mq as validateParams,Ce as validateFormEnhanced,_q as validateFile,xe as validateFields,we as validateField,mi as validateDirective,Wd as validateCspDirectives,Ck as validateConfig,nn as validateComponentScripts,Ln as validateComponentProps,gh as validateClientScript,fi as v,Hc as usesSignalsInScript,ub as usesReactiveRuntime,Ai as userComponentFileExists,Nh as useVirtualList,ie as useTitle,hm as useStoreOrThrow,Kp as useStore,Tk as useStorage,zf as useSlots,Vk as useSessionStorage,cc as useServerRuntimeConfig,Xf as useServerData,fe as useSeoMeta,dc as useRuntimeConfig,jm as useRouteParams,lm as useRouteParamOrThrow,km as useRouteParam,ie as usePageTitle,qf as useOptimistic,Ef as useModel,nm as useMiddlewareValue,mm as useMiddlewareState,Uk as useLocalStorage,lp as useLoadingIndicator,de as useHead,ci as useForm,Bf as useAttrs,ar as uploadFiles,$q as uploadFile,em as updateInstance,of as untrack,Qi as unregisterDirective,fm as unmountInstance,Pc as unescapeHtml,hp as typecheckStxFiles,yi as transpileTypeScript,Or as translate,Ba as transitionDirective,lc as transformAutoImports,Fn as toUsers,En as toUser,Sp as thumbnail,Tq as thumbHashToRGBA,Uq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,If as templateCache,md as syncRecordedResponse,pp as stxClientHelpers,ig as structuredDataDirective,Rr as stripLocalePrefix,Mm as stripDocumentWrapper,Sb as stripCommentsAndLiterals,qo as stringToStream,Kd as strictCspPreset,We as streamingSuspenseDirective,_e as streamToResponse,Ue as streamTemplateSimple,Oe as streamTemplate,Ok as stopHmrServer,Bn as stopBroadcasting,_b as stateDirName,$b as stateDir,cf as state,ah as startsDocument,Lo as startProductionServer,Go as startInteractive,An as startBroadcasting,Tr as stampLocaleLayoutGroup,Ia as staggerDirective,kq as srcsetUrls,Ja as springDirective,td as splitByPipe,Im as spaNavVaryHeaders,ep as sourcePathFor,rq as smartBatchSign,Ci as slotContentHasExpressions,pq as signUrl,wi as shouldTranspileTypeScript,Lk as shouldReloadOnChange,uq as shouldRefreshSignature,Mk as shouldIgnoreFile,Fh as shouldCacheComponent,Wp as sharpen,gs as shape,Zb as setStateDir,rm as setRouteParams,sm as setMiddlewareState,Ke as setImagePlaceholder,tf as setGlobalProvide,b as setErrorLocale,Ol as setCurrentInstance,Xj as setCachedVideoResult,Mj as setCachedImageResult,Gj as setCached,js as serveStxFile,ls as serveMultipleStxFiles,Gk as serveMarkdownFile,Wo as serveFile,ms as serveApp,Vo as serve,vp as serializeState,bn as serializeSetCookie,Yp as sepia,ge as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,zi as scopeOnRootElement,lk as scopeHTML,kk as scopeCSS,lg as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,aq as saturation,nq as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,Gb as runtimeEventRegexLiteral,Eb as runtimeDirectiveNamesLiteral,wg as runPreProcessingMiddleware,xg as runPostProcessingMiddleware,en as runPageAction,jf as runMountCallbacks,gb as runMiddleware,cm as runHooks,Hr as runDoctor,kf as runDestroyCallbacks,Ag as runComposers,bq as rotate,gi as rewriteImagesWithSiblings,nd as responseBindings,Gi as resolveTemplatePath,ha as resolveStxTargets,yk as resolveStxDirectories,Nr as resolveI18n,Qp as resize,og as resetUnscopedSignalWarnings,Nc as resetRejectedExpressionWarnings,sc as resetPlaceholders,ce as resetHead,up as resetHMRHandler,o as resetErrorConfig,bs as required,bg as reportDeferredLoopWarnings,wc as replacePlaceholders,Ec as replaceInterpolations,hr as renderView,ek as renderVideoComponent,ic as renderVendorStyleTags,qr as renderToString,rr as renderToStream,sr as renderToDOM,Sq as renderThumbhashToCanvas,Er as renderTemplateString,Cr as renderTemplate,Dr as renderString,Re as renderStreamingPage,ri as renderSlot,vh as renderSSRSuspense,Cq as renderProtectedVideo,Bq as renderProtectedImg,oq as renderMediaUpload,Br as renderMarkdownView,Tm as renderLayoutTypes,Qj as renderImgComponent,Cl as renderImageComponent,ke as renderHtmlAttrs,je as renderHead,kr as renderEmail,Ei as renderComponentWithSlot,le as renderBodyAttrs,Fp as render,Md as relaxedCspPreset,ve as registerValidationRule,Ye as registerStreamingDirectives,Mp as registerStoresClient,pm as registerStore,Qf as registerServeModuleBundle,jg as registerSeoDirectives,_a as registerMiddleware,Ac as registerFilters,zc as registerFilter,d as registerErrorMessages,Ae as registerEnhancedValidationRule,Ni as registerDirective,Vd as registerCspDirectives,On as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,mc as referencesName,Sl as ref,yo as redirect,id as recordResponseStatus,jd as recordResponseHeader,ac as rebaseOntoStateDir,kd as readResponseStatus,ld as readResponseHeaders,Ek as readMarkdownFile,Jf as readFileCached,Tl as reactive,fq as quality,zq as pruneSignatureCache,Jj as pruneCache,rf as provide,Ar as protectCodeBlocks,as as prop,Dg as processVueTemplate,Lh as processVirtualListDirectives,Ph as processVirtualGridDirectives,dk as processVideo,ye as processValidateDirective,ea as processTranslateDirective,ph as processTransitionDirectives,sh as processTransitionAttributes,oe as processTitleDirective,ad as processTemplateBindings,lh as processTeleportDirectives,th as processSuspenseDirectives,eg as processStructuredData,Se as processStreamDirectives,od as processStatusDirective,ai as processStaticDirectives,ug as processStackReplacements,tg as processStackPushDirectives,si as processSlots,Km as processShell,Ne as processServerBindings,fg as processSeoDirective,Ze as processSectionDirectives,Uc as processScopedStyles,_c as processReactiveBindings,Dq as processProtectedMedia,Vh as processPartialHydrationDirectives,fh as processOnceDirective,vg as processMiddleware,dg as processMetaDirectives,pe as processMetaDirective,Fk as processMarkdownFileDirectives,Li as processMarkdownDirectives,cg as processLoops,Dh as processKeepAliveDirectives,eh as processJsonDirective,Oh as processInfiniteListDirectives,sg as processIncludes,Sj as processImgComponents,El as processImageComponents,rl as processImage,ne as processHeadDirective,re as processForms,te as processFormInputDirectives,Lc as processExpressions,Pb as processEventDirectives,ue as processErrorDirective,Eg as processDynamicComponents,hi as processDirectives,Vi as processDirectiveAttributes,kh as processDeferDirectives,_d as processCustomDirectives,Sd as processCspDirectives,hs as processComponentProps,rc as processClientScript,se as processBasicFormDirectives,yh as processAsyncDirectives,$d as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Ge as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,kp as preloadIslandHandlers,Me as preloadIconCollection,wn as poolStrings,wk as pluginManager,Ie as placeholdersWarmed,oh as performLeave,nh as performEnter,lf as pendingLifecycleCounts,pf as peek,pg as partialsCache,fk as parseVideoDirectiveOptions,Op as parseUrl,Vq as parseThumbhashString,zd as parseSwitchBlock,pi as parseSlots,qi as parseSlotElement,Ed as parseScriptDeclarations,sk as parseSFCComponent,Eq as parseProtectedArgs,ag as parseLoopBinding,Rj as parseImgComponent,hj as parseImageUrl,Dl as parseImageComponent,cn as parseFormBody,Bd as parseExpressionWithFilters,Pn as parseDefaults,vo as parseCookies,Bm as parseContainerSelector,wd as parseConditionalBlock,Cd as parseArguments,Ma as parseAnimationShorthand,cs as optional,xn as optimizeTemplate,Jl as optimizeImage,Kl as optimizeDirectory,es as oneOf,qg as onceStore,$l as onUpdated,Zc as onUpdate,bm as onUnmounted,wm as onServer,Zl as onMounted,gf as onMount,$h as onHydrated,xf as onErrorCaptured,hf as onDestroy,Jh as onDeactivated,vm as onClient,_l as onBeforeUpdate,am as onBeforeUnmount,Yl as onBeforeMount,Ih as onActivated,Oq as observeElement,zo as notFound,Jg as normalizeCriticalHeadOrder,wf as nextTick,Sn as negotiateEncoding,Ua as navigateTo,dm as mountInstance,Ea as motionDirective,Ld as moderateCspPreset,vn as minifyHtml,hg as metaDirective,Ug as metaDedupKey,Pp as mergeParams,Wg as mergeHtmlAttrs,ee as mergeHeadConfigs,Rc as mergeCssConfig,Pd as mergeCspDirectives,Ra as matchRoute,Mi as markdownDirectiveHandler,Dk as markdownCache,ga as looksLikeGlob,Qr as localizePath,U as loadTranslationLazy,_ as loadTranslation,zk as loadStxConfig,db as loadMiddlewareFromDirectory,an as loadManifest,Kq as loadElement,Cn as loadChannels,Lb as listensPassively,Xr as lintStxStrict,Mq as lazyLoadAll,Lq as lazyLoad,Ha as keyframeDirective,or as jsxs,pr as jsxDEV,nr as jsx,xo as jsonResponse,Xe as islandDirective,l as isTest,Nm as isSpaNavigation,Gm as isSpaNavRequest,sq as isSignatureValid,mf as isSignal,pl as isSharpAvailable,jo as isServerEnvironment,tm as isServer,yb as isRuntimeOwnedColonAttr,Hb as isRuntimeEventName,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Hq as isNativeLazySupported,zr as isMarkdownPath,Q as isLoading,R as isLoaded,vi as isJavaScriptScript,Iq as isIntersectionObserverSupported,xl as isImageFile,ql as isImageBackendAvailable,aa as isICUFormat,_h as isHydrated,Bi as isHydrateTrigger,gd as isHttpStatus,io as isEdgeEnvironment,Yr as isDirectiveKind,k as isDevelopment,nf as isDerived,Kk as isCssOnlyChange,Rn as isCompressible,um as isClient,Ah as isAsyncComponent,dn as isActionableMethod,Zp as invert,Lf as invalidateFileCacheByDir,Kf as invalidateFileCache,Kc as interpolateScriptsInTemplate,Ic as interpolateScriptExpressions,Jc as interpolateScriptAttributes,x as inlineError,Mr as injectThemeBootstrap,gg as injectSeoTags,Jr as injectSeo,Wf as injectRouterScript,Jk as injectHotReload,kb as injectHeatmap,Yc as injectCss,Qd as injectCspMetaTag,ch as injectConfigHeadTags,Ig as injectColorModeBootScript,Yg as injectCloakStyle,Pg as injectBuildId,kc as injectBrowserCoreAutoImports,cd as injectAnalytics,sf as inject,om as initStoreRegistry,kl as initNetlify,mp as initLoadingIndicator,Jq as initLazyLoading,Fo as initFile,Rq as initBlurUp,Xq as initAllBlurUp,Uj as imgDirective,Hl as imageDirective,hn as hydrateTemplateStream,gn as hydrateTemplate,jp as hydrateIslands,Xh as hydrateIsland,jn as hydrateFragment,Yh as hydrateByStrategy,Zh as hydrateAll,Cp as hydrate,Uo as htmlResponse,_g as hoistLeadingHeadTags,Kg as hoistColorModeBootScript,lb as heatmapDirective,Cj as hashString,Vf as hashFilePath,Aj as hashFile,Bj as hashBuffer,Cg as hasVueTemplateSyntax,$f as hasVariables,Hp as hasStore,xc as hasPlaceholders,il as hasNetlifyConfig,ab as hasMiddleware,Qb as hasEventDirectives,bh as hasDocumentShell,ni as hasDirectives,ma as hasDOMSupport,Al as handleImageRequest,yf as handleError,wr as h,wl as groupVariantsByFormat,Xp as grayscale,No as gitHash,pn as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,dl as getTotalSize,tq as getTimeUntilExpiry,hh as getStoreScript,Ip as getStoreNames,Gp as getStore,Yk as getStorageSize,Xk as getStorageKeys,Hi as getSourceLineInfo,xi as getSharedTranspiler,Rf as getServeModuleBundle,Pf as getServeClientAsset,la as getScreenReaderOnlyStyle,mk as getScopeAttribute,bf as getRouteParams,Vb as getPublicEnvDefine,Wb as getPublicEnv,li as getPositionInfo,uc as getPlaceholderRegistry,zj as getPlaceholderCacheStats,be as getPageMeta,Gd as getNonce,yl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,He as getImagePlaceholder,sl as getImageMetadata,Ee as getImageDelivery,Bp as getHydrationRuntime,qm as getHydratedStoreState,Nk as getHmrServer,ae as getHead,tp as getHMRHandler,lj as getFormatExtension,Ej as getFileMtime,vl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,Pi as getDirectives,Oi as getDirective,Pl as getCurrentInstance,Vc as getCssServeAsset,Od as getCspPreset,Xd as getCspHeaderName,Ki as getComponentCacheStats,Wj as getCachedVideoResult,xq as getCachedSignature,Nf as getCachedSignalsRuntime,Of as getCachedRouterScript,xj as getCachedPlaceholder,Lj as getCachedImageResult,Fj as getCached,Ij as getCacheStats,Ng as getBuildId,zn as getBroadcastServer,kj as getBestVariant,Bc as getAllFilters,_i as generateWidthSrcset,Mh as generateVirtualListCSS,cr as generateVideoPreview,De as generateValidationScript,dr as generateUploadRuntime,qn as generateTreeShakenBundle,rh as generateTransitionRuntime,qh as generateTransitionCSS,_j as generateThumbnails,qj as generateThumbhashPlaceholder,$n as generateTemplatesDocs,xh as generateSuspenseRuntime,wh as generateSuspenseCSS,wp as generateStateScript,ij as generateSrcsetData,Pj as generateSrcset,tl as generateSrcSet,$j as generateSpriteSheet,lr as generateSpaShell,jj as generateSourceTags,ej as generateSizesFromBreakpoints,dj as generateSizesAttribute,ul as generateSizes,kg as generateSitemapIndex,Kr as generateSitemap,Gq as generateSimpleMediaPicker,Aq as generateSignatureRuntime,Hf as generateSignalsRuntimeDev,Gf as generateSignalsRuntime,qc as generateServerDataBridge,jk as generateScopeId,tk as generateSFCWebComponent,Nb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,mg as generateRobotsTxt,Lr as generateRobots,Oj as generateResponsiveVariants,pk as generateReactiveWebComponentTS,ok as generateReactiveWebComponent,rk as generateReactiveRuntime,qk as generateReactiveMixin,Zj as generatePoster,wj as generatePlaceholderStyle,vj as generatePlaceholderCSS,pj as generatePlaceholder,Wh as generatePartialHydrationCSS,Fd as generateNonce,el as generateNetlifyToml,fr as generateMinifiedMediaRuntime,er as generateMediaRuntime,Fq as generateMediaManagerEmbed,_m as generateManifest,op as generateLoadingIndicatorHtml,Qq as generateLazyLoadRuntime,Um as generateLayoutTypes,sj as generateLQIP,Hh as generateKeepAliveRuntime,Gh as generateKeepAliveCSS,bi as generateIslandManifest,br as generateImagePreview,Ll as generateImageManifest,Ap as generateHydrationScript,$e as generateHydrationRuntime,Dp as generateHydrationCSS,Qh as generateHydrationBootstrap,Ik as generateHotReloadScript,jb as generateHeatmapScript,rp as generateHMRClientScript,ak as generateHLSManifest,xp as generateEventBindings,cj as generateDprSrcsetWithVariableQuality,bj as generateDprSrcset,$g as generateDocumentShell,fo as generateDocs,ao as generateDirectivesDocs,Ui as generateDirectiveRuntime,ng as generateDefaultRobotsTxt,bk as generateDASHManifest,Xc as generateCss,Jd as generateCspMetaTag,Id as generateCspHeader,Df as generateCompositionRuntime,_n as generateComponentsDocs,Rh as generateComponentManifest,Yn as generateComponentDoc,uj as generateColorPlaceholder,Hg as generateColorModeBootScript,gm as generateClientRuntime,Dj as generateCacheKey,oc as generateBrowserAutoImportDestructuring,Yq as generateBlurUpRuntime,Zq as generateBlurUpCSS,$c as generateBindingsRuntime,$i as generateAutoWidthSrcset,nc as generateAutoImportDestructuring,Ch as generateAsyncComponentRuntime,Bh as generateAsyncComponentCSS,fc as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,bd as generateAnalyticsScript,ip as formatTypecheckDiagnostics,bp as formatTypeErrors,Co as formatStxContent,cl as formatSize,Ta as formatRoutes,Do as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,Ir as formatDoctorReport,bo as formatDocsAsMarkdown,eo as formatDocsAsJson,co as formatDocsAsHtml,eq as format,un as foldConstants,dq as flipVertical,cq as flipHorizontal,Vm as fingerprint,gp as findStxModuleDeclarations,fp as findRuntimeTypeDeclarations,Gr as findPantryPackage,Dc as findMustacheEnd,vd as findMatchingEndTag,rd as findMatchingDelimiter,Rb as findInterpolationEnd,xd as findIfBlocks,Ad as findExpressions,Sa as findErrorPage,Sc as findDuplicateScopedStyleRanges,yd as findDirectiveBlocks,rn as findDeadCode,rn as findDeadBranches,Cm as findContainerRegion,Zn as findComponentFiles,ks as findCommonDir,bl as filterRequiredFiles,Fi as fileExists,Yf as extractVariables,ji as extractTemplateExpressions,Te as extractStreamBoundaries,yp as extractState,ti as extractSlotContent,_f as extractScriptFromTemplate,ii as extractScriptBlocks,vc as extractPlaceholders,ud as extractParenthesizedExpression,hd as extractPageResponseStatus,hb as extractLayoutMetadata,tj as extractDominantColor,Dd as extractDirectiveParams,oi as extractDirectiveNames,Om as extractContainerContent,Wn as extractComponentProps,Sh as extractComponentName,Xn as extractComponentDescription,Wc as extractClassNames,pc as extractBridgeData,Th as extractBoundProps,sd as extractBalancedExpression,hc as extractAndStripCssImports,nk as extractAndScopeStyles,Ob as extractAndProcessEvents,Rk as externalizeSharedAssets,Sk as externalizeRepeatedAssets,Qk as externalizeHtml,Oc as evaluateExpression,tn as evaluateConstant,pd as evaluateAuthExpression,Gc as escapeHtmlValue,Fc as escapeHtml,C as errorRecovery,E as errorLogger,mh as ensureTeleportTargets,dh as ensureDocumentShell,ze as enhancedValidationRules,Un as enableDevTools,sn as eliminateDeadCode,ef as effect,lq as dprUrls,go as docsCommand,ec as discoverServerApi,Sm as discoverLayoutNames,Pq as disconnectObserver,Vn as disableDevTools,F as devHelpers,Jm as detectShell,ho as detectRuntime,fl as detectProjectConfig,mj as detectFormat,mn as detectBuildMode,df as derived,jl as deploy,Bk as defineStxConfig,Lp as defineStore,Af as defineSlots,Wr as defineSiteConfig,_r as definePropsWithValidation,Zr as defineProps,vk as definePlugin,he as definePageMeta,Wa as defineMiddleware,di as defineForm,vf as defineExpose,uf as defineEmits,Ri as defineDirective,yr as defineCustomElement,Ko as defineConfig,Si as defineClientDirective,zh as defineAsyncComponent,Mo as defineApiHandler,gr as defaultMediaConfig,Nl as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,qe as defaultFormClasses,yc as defaultFilters,Zd as defaultCspConfig,xk as defaultConfig,is as default,Qc as deepMergeThemes,Tc as dedupeScopedStyles,Fm as decodeTitleEntities,rj as decodeThumbhash,Ud as cspNonceDirective,Td as cspDirective,Wq as crossfadeTransition,Rp as crop,Kh as createVirtualList,gk as createVideoDirective,to as createVercelHandler,_o as createTypeChecker,fa as createTranslateFilter,po as createTextEncoderStream,xr as createStxApp,oo as createStreamingResponse,Ve as createStreamRenderer,Jp as createStore,Za as createStorageManager,Xa as createServerCookieManager,gc as createServerApi,Rl as createScope,uh as createSSRSuspense,af as createRouter,Qm as createRouteRuleResolver,eb as createRouteLocation,Yo as createRoute,Sl as createRef,Tl as createReactive,Cf as createProvideContext,Po as createProject,Jo as createProductionBuild,tc as createPlaceholder,yn as createOptimizedBuild,uo as createNetlifyHandler,Zk as createNetlifyClient,fb as createMiddlewareContext,Xo as createMiddleware,Nq as createLazyObserver,Eh as createKeepAliveCache,lo as createKVNamespace,Uh as createIslandRegistry,Tj as createImgDirective,Il as createImagePlugin,Bl as createImageHandler,Gl as createImageDirective,nb as createHeatmapAggregator,al as createFileManifest,ko as createEnvAccessor,z as createEnhancedError,no as createEdgeHandler,mo as createEdgeCache,Ii as createDetailedErrorMessage,so as createDenoHandler,gl as createDefaultNetlifyConfig,Yd as createCspHeaders,wo as createCookie,Ul as createComputed,Ql as createComponentInstance,ro as createCloudflareHandler,Ya as createClientCookieManager,Ti as createBuiltinDirectives,xr as createApp,Ka as createAnimationTimeline,Up as cover,Zf as convertToCommonJS,$p as contrast,Tp as contain,y as consoleError,m as configureErrorHandling,Ak as config,Ul as computed,Tn as compressResponse,zg as composerPattern,yg as composer,Lm as composeShellWithPage,Nn as componentDirective,Di as componentClientSignalNames,Zm as compileTemplate,a as collectRepeatedFlag,$k as collectDeployFiles,Zg as cloakStyleFragment,Yj as clearVideoCache,N as clearTranslationCache,ih as clearStoreCache,Wk as clearStorage,yq as clearSignatureCache,Ff as clearServerData,yj as clearPlaceholderCache,rg as clearOnceStore,Hd as clearNonce,bb as clearMiddleware,Je as clearImagePlaceholders,Fe as clearImageDeliveryCatalog,Fl as clearImageCache,e as clearErrorMessages,Sf as clearDevCaches,Cc as clearCustomFilters,Bg as clearComposers,jh as clearComposableCache,Ji as clearComponentCache,Hj as clearCache,Ib as clearBlankCache,np as cleanupLoadingIndicator,zm as classifyScript,Am as classifyAllScripts,$o as checkTemplateFile,ap as checkTemplate,Tf as checkCache,vq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,In as channel,Bo as captureScreenshots,Ao as captureScreenshot,Z as cancelPendingLoads,_k as calculateSha1,aj as calculateOptimalWidths,Uf as cacheTemplate,bc as cacheEngineFingerprint,ik as buildWebComponents,cp as buildVirtualSource,ir as buildViews,Np as buildUrl,Pe as buildSuspenseResolveScript,Vr as buildStaticSite,qb as buildRuntimeGlobalsDestructure,Wm as buildRuntimeAsset,Xm as buildRouterAsset,Ur as buildLangPickerScript,gj as buildImageUrl,Qg as buildIdFragment,Vg as buildHtmlAttrs,kn as buildForProduction,Qn as buildComponentLibrary,wq as buildAuthParams,ln as buildApp,Sr as buildAlternateLinks,Io as build,Gn as broadcastPrivate,Hn as broadcastPresence,Dn as broadcast,_p as brightness,Tb as bracketDepths,Vp as blur,Jb as blankInertHtmlRegions,qq as batchSignUrls,ff as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,gq as auto,ja as attributeValue,Ym as assetTags,Mb as asInvocableStatement,fs as arrayOf,Pr as applyTranslations,Nj as applyTransformations,ui as applySlots,Mn as applyPropDefaults,jq as applyPreset,Xg as applyHtmlAttrs,me as applyHead,Mc as applyFilters,Hm as appendVary,Nd as apiCspPreset,Da as animationGroupDirective,ck as analyzeVideo,on as analyzeUsage,xm as analyzeTemplate,ym as analyzeProject,on as analyzeDirectiveUsage,dd as analyticsDirective,So as addStore,Ro as addPage,Rd as addNonceToInlineContent,To as addLayout,Qo as addComponent,fn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Mf as __setSignalsGeneratorsForTest,Og as __setBuildIdForTest,Vj as VideoProcessorCache,ei as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,qd as Tokenizer,Zo as TemplateTypeChecker,Eo as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,tr as Show,Qe as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,jc as STX_AUTO_IMPORTS,Yb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Dm as SPA_NAV_HEADER,Kb as SCROLL_BLOCKING_EVENTS,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Fb as RUNTIME_EVENT_NAMES,Db as RUNTIME_DIRECTIVE_NAMES,ed as RESPONSE_STATUS_KEY,fd as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Ho as ProductionBuild,vr as Portal,Oo as PROJECT_TEMPLATES,iq as PRESETS,sb as NON_CLIENT_PRIMITIVES,Ep as MemorySessionStore,Zi as MIME_TYPES,Wi as MEDIA_DEFAULT_WIDTHS,Yi as MEDIA_DEFAULT_FORMATS,Rm as LAYOUT_TYPES_FILE,Kj as ImageProcessorCache,zl as ImageProcessingError,zp as HydrationRuntime,Hk as HotReloadServer,mb as HeatmapAggregator,Tg as HTML_CLASS_MARKER,Sg as HTML_ATTRS_MARKER,mr as Fragment,ur as For,Em as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,Pk as EXTERNALIZED_ASSET_DIR,ll as DeployError,ml as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Xb as DEFAULT_STATE_DIR,ol as DEFAULT_QUALITY,nj as DEFAULT_PLACEHOLDER_OPTIONS,nl as DEFAULT_FORMATS,Xi as DEFAULT_DPR_VALUES,qp as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,fj as COMMON_SIZES,Fg as COLOR_MODE_BOOT_MARKER,Gg as COLOR_MODE_BOOT_GLOBAL,Rg as CLOAK_STYLE,Kn as BroadcastServer,Jn as Broadcast,Lg as BUILD_ID_META,Mg as BUILD_ID_HEADER,Ub as BROWSER_CORE_IMPORTS,oj as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,Fr as $path};
2
+ import{$ as jm,$a as mo,$b as xp,$c as xq,$d as xr,A as Vk,Aa as xn,Ab as Ro,Ac as Yp,Ad as Yq,Ae as cs,B as Wk,Ba as yn,Bb as So,Bc as Zp,Bd as Zq,Be as ds,C as Xk,Ca as Ln,Cb as To,Cc as _p,Cd as _q,Ce as es,D as Yk,Da as Mn,Db as Uo,Dc as $p,Dd as $q,De as fs,E as Ol,Ea as Nn,Eb as Vo,Ec as aq,Ed as ar,Ee as gs,F as Pl,Fa as On,Fb as Wo,Fc as bq,Fd as br,Fe as hs,G as Ql,Ga as Pn,Gb as Xo,Gc as cq,Gd as cr,Ge as is,H as Rl,Ha as Qn,Hb as Yo,Hc as dq,Hd as dr,He as js,I as Sl,Ia as Un,Ib as Zo,Ic as eq,Id as er,Ie as ks,J as Tl,Ja as Vn,Jb as _o,Jc as fq,Jd as fr,Je as ls,K as Ul,Ka as Wn,Kb as $o,Kc as gq,Kd as gr,Ke as ms,L as Vl,La as Xn,Lb as ap,Lc as hq,Ld as hr,M as Wl,Ma as Yn,Mb as bp,Mc as iq,Md as ir,N as Xl,Na as Zn,Nb as jp,Nc as jq,Nd as jr,O as Yl,Oa as _n,Ob as kp,Oc as kq,Od as kr,P as Zl,Pa as $n,Pb as lp,Pc as lq,Pd as lr,Q as _l,Qa as ao,Qb as mp,Qc as mq,Qd as mr,R as $l,Ra as bo,Rb as np,Rc as nq,Rd as nr,S as am,Sa as co,Sb as op,Sc as oq,Sd as or,T as bm,Ta as eo,Tb as pp,Tc as pq,Td as pr,U as cm,Ua as fo,Ub as qp,Uc as qq,Ud as qr,V as dm,Va as go,Vb as rp,Vc as rq,Vd as rr,W as em,Wa as ho,Wb as sp,Wc as sq,Wd as sr,X as fm,Xa as io,Xb as tp,Xc as tq,Xd as tr,Y as gm,Ya as jo,Yb as up,Yc as uq,Yd as ur,Z as hm,Za as ko,Zb as vp,Zc as vq,Zd as vr,_ as im,_a as lo,_b as wp,_c as wq,_d as wr,aa as km,ab as no,ac as yp,ad as yq,ae as yr,ba as lm,bb as oo,bc as zp,bd as zq,be as Fr,ca as mm,cb as po,cc as Ap,cd as Aq,ce as Gr,da as nm,db as qo,dc as Bp,dd as Bq,de as Hr,ea as om,eb as ro,ec as Cp,ed as Cq,ee as Ir,fa as pm,fb as so,fc as Dp,fd as Dq,fe as Jr,ga as qm,gb as to,gc as Ep,gd as Eq,ge as Kr,ha as rm,hb as uo,hc as Fp,hd as Fq,he as Lr,ia as sm,ib as vo,ic as Gp,id as Gq,ie as Mr,ja as tm,jb as wo,jc as Hp,jd as Hq,je as Nr,ka as um,kb as xo,kc as Ip,kd as Iq,ke as Or,la as vm,lb as yo,lc as Jp,ld as Jq,le as Pr,ma as wm,mb as zo,mc as Kp,md as Kq,me as Qr,na as xm,nb as Co,nc as Lp,nd as Lq,ne as Rr,o as a,oa as ym,ob as Do,oc as Mp,od as Mq,oe as Sr,p as Gk,pa as mn,pb as Eo,pc as Np,pd as Nq,pe as Tr,q as Hk,qa as nn,qb as Fo,qc as Op,qd as Oq,qe as Ur,r as Ik,ra as on,rb as Ho,rc as Pp,rd as Pq,re as Vr,s as Jk,sa as pn,sb as Io,sc as Qp,sd as Qq,se as Wr,t as Kk,ta as qn,tb as Jo,tc as Rp,td as Rq,te as Xr,u as Lk,ua as rn,ub as Ko,uc as Sp,ud as Sq,ue as Yr,v as Mk,va as sn,vb as Mo,vc as Tp,vd as Tq,ve as Zr,w as Nk,wa as tn,wb as No,wc as Up,wd as Uq,we as _r,x as Ok,xa as un,xb as Oo,xc as Vp,xd as Vq,xe as $r,y as Tk,ya as vn,yb as Po,yc as Wp,yd as Wq,ye as as,z as Uk,za as wn,zb as Qo,zc as Xp,zd as Xq,ze as bs}from"./chunk-cf9gt3h9.js";import{Le as cp,Me as dp,Ne as ep,Oe as fp,Pe as gp,Qe as hp,Re as ip}from"./chunk-m0eg86q3.js";import{Se as Ao,Te as Bo}from"./chunk-7hb89n3z.js";import{Ue as Go}from"./chunk-0smr2xjs.js";import{Ve as ln}from"./chunk-f2jypsax.js";import{We as Rn,Xe as Sn,Ye as Tn,Ze as Lo}from"./chunk-f72c62s7.js";import{$e as _k,_e as Zk,af as $k,bf as al,cf as bl,df as cl,ef as dl,ff as el,gf as fl,hf as gl,if as hl,jf as il,kf as jl,lf as kl,mf as ll}from"./chunk-n0d7nwhd.js";import{nf as Cl,of as Dl,pf as El,qf as Fl,rf as Gl,sf as Hl,tf as Il,uf as Jl,vf as Kl,wf as Ll,xf as Ml,yf as Nl}from"./chunk-qrvey4wk.js";import{Af as Bl,zf as Al}from"./chunk-nybn003d.js";import{Bf as ml,Cf as nl,Df as ol,Ef as pl,Ff as ql,Gf as rl,Hf as sl,Jf as tl,Kf as ul,Lf as vl,Mf as wl,Nf as xl,Of as yl,Rf as zl}from"./chunk-hy79zwyy.js";import{Sf as Vm,Tf as Wm,Uf as Xm,Vf as Ym,Wf as Zm,Xf as kn}from"./chunk-7v1g7prf.js";import{$f as Cm,Yf as zm,Zf as Am,_f as Bm,ag as Dm,bg as Em,cg as Fm,dg as Gm,eg as Hm,fg as Im,gg as Jm,hg as Km,ig as Lm,jg as Mm,kg as Nm,lg as Om,mg as _m,ng as $m,og as an,pg as bn,qg as cn,rg as dn,sg as en,tg as fn,ug as gn,vg as hn,wg as jn}from"./chunk-a4jhcbsh.js";import{xg as Pm,yg as Qm}from"./chunk-0knxnyq6.js";import{Ag as An,Bg as Bn,Cg as Cn,Dg as Dn,Eg as En,Fg as Fn,Gg as Gn,Hg as Hn,Ig as In,Jg as Jn,Kg as Kn,zg as zn}from"./chunk-634gaa9d.js";import{Lg as pi,Mg as qi,Ng as ri,Og as si,Pg as ti,Qg as ui}from"./chunk-6yfccnr7.js";import{Rg as Kj,Sg as Lj,Tg as Mj,Xg as Nj,Yg as Oj,Zg as Pj}from"./chunk-tv04k7gq.js";import{$g as Wj,_g as Vj,ah as Xj,bh as Yj,ch as Zj,dh as _j,eh as $j,fh as ak,gh as bk,hh as ck,ih as dk}from"./chunk-n1y0hjk1.js";import{jh as Aj,kh as Bj,lh as Cj,mh as Dj,nh as Ej,ph as Fj,qh as Gj,rh as Hj,sh as Ij,th as Jj}from"./chunk-bcpjhcpn.js";import{uh as vk,wh as wk}from"./chunk-y4zddt5r.js";import{Ch as Kh,Dh as Lh,Eh as Mh,Fh as Nh,Gh as Oh,Hh as Ph}from"./chunk-g7bpkpd4.js";import{Jh as Qh,Kh as Rh,Lh as Sh,Mh as Th,Nh as Uh,Oh as Vh,Ph as Wh,Qh as Xh,Rh as Yh,Sh as Zh,Th as _h,Uh as $h,Vh as ai,Wh as bi}from"./chunk-k33778kc.js";import{$h as fi,Yh as ci,Zh as di,_h as ei}from"./chunk-yg0qm73a.js";import{ei as gi}from"./chunk-g1vxsvqv.js";import{hi as jh}from"./chunk-3y8vvkar.js";import{ii as kh}from"./chunk-fqq5k9ve.js";import{ji as lh,ki as mh}from"./chunk-ya5m5vbn.js";import{li as nh,mi as oh,ni as ph,oi as qh,pi as rh,qi as sh}from"./chunk-y4nzmkea.js";import{ri as th,si as uh,ti as vh,ui as wh,vi as xh}from"./chunk-7kw3grq5.js";import{Ai as Ch,wi as yh,xi as zh,yi as Ah,zi as Bh}from"./chunk-c79nfdyj.js";import{Bi as Dh,Ci as Eh,Di as Fh,Ei as Gh,Fi as Hh,Gi as Ih,Hi as Jh}from"./chunk-ej8mv2k6.js";import{Ii as hh,Ji as ih}from"./chunk-dtdwjpvf.js";import"./chunk-ra1s4s6b.js";import{Ni as Oe,Oi as Pe,Pi as Qe,Qi as Re,Ri as Se,Si as Te,Ti as Ue,Ui as Ve,Vi as We,Wi as Xe,Xi as Ye,Yi as Ze,Zi as _e,_i as $e}from"./chunk-79fj9zem.js";import{$i as rf,aj as sf,bj as tf,cj as uf,dj as vf,ej as wf,fj as xf,gj as yf,hj as zf,ij as Af,jj as Bf,kj as Cf,lj as Df,mj as Ef,nj as Ff,oj as Gf,pj as Hf}from"./chunk-krt45cqy.js";import{Aj as gf,Bj as hf,Cj as jf,Dj as kf,Ej as lf,Fj as mf,Gj as nf,Hj as of,Ij as pf,Jj as qf,wj as cf,xj as df,yj as ef,zj as ff}from"./chunk-0t1yyn1d.js";import{Kj as If,Lj as Jf,Mj as Kf,Nj as Lf,Oj as Mf,Pj as Nf,Qj as Of,Rj as Pf,Sj as Qf,Tj as Rf,Uj as Sf,Vj as Tf,Wj as Uf,Xj as Vf}from"./chunk-3kd0zn9c.js";import{pk as zr,qk as Ar,rk as Br,sk as Cr,tk as Dr,uk as Er}from"./chunk-ec8jsqgm.js";import{Ak as Sm,Bk as Tm,Ck as Um,vk as Pk,wk as Qk,xk as Rk,yk as Sk,zk as Rm}from"./chunk-wz4fnsat.js";import"./chunk-frp9fc7j.js";import"./chunk-degz74nv.js";import{nl as ec,ol as fc,sl as gc}from"./chunk-t23kccpz.js";import{ul as bc}from"./chunk-qjvny3wf.js";import{$l as Qb,$m as ld,$n as He,$o as yg,$p as mi,$q as Rj,Al as Ca,Am as Ec,An as Qd,Ap as Zg,Aq as aj,Ar as Dk,Bl as Da,Bm as Fc,Bn as Rd,Bo as Xf,Bp as _g,Bq as bj,Br as Ek,Cl as Ea,Cm as Gc,Cn as Sd,Cp as $g,Cq as cj,Cr as Fk,Dl as Fa,Dm as Hc,Dn as Td,Dp as ah,Dq as dj,El as Ga,Em as Ic,En as Ud,Ep as bh,Eq as ej,Fl as Ha,Fm as Jc,Fn as Vd,Fp as ch,Fq as fj,Gl as Ia,Gm as Kc,Gn as Wd,Gp as dh,Gq as gj,Hl as Ja,Hm as Lc,Hn as Xd,Hp as eh,Hq as hj,Il as Ka,Im as Mc,In as Yd,Io as Yf,Ip as fh,Iq as ij,Jl as La,Jm as Nc,Jn as Zd,Jp as gh,Jq as jj,Kl as Ma,Km as Oc,Kn as _d,Ko as Zf,Kp as hi,Kq as kj,Ll as Na,Lm as Pc,Ln as $d,Lp as ii,Lq as lj,Ml as Oa,Mm as Zc,Mn as qe,Mo as _f,Mq as mj,Nl as ib,Nm as _c,Nn as re,No as $f,Nq as nj,Ol as jb,Om as $c,On as se,Oo as ag,Op as ji,Oq as oj,Pl as kb,Pm as ad,Pn as te,Po as bg,Pq as pj,Ql as lb,Qm as bd,Qn as ue,Qo as cg,Qq as qj,Rl as mb,Rm as cd,Rn as ve,Ro as og,Rq as rj,Sl as nb,Sm as dd,Sn as we,So as pg,Sq as sj,Tn as xe,To as qg,Tq as tj,Um as ed,Un as ye,Uo as rg,Uq as uj,Vl as Kb,Vm as fd,Vn as ze,Vo as sg,Vq as vj,Wl as Lb,Wm as gd,Wn as Ae,Wo as tg,Wq as wj,Xl as Mb,Xm as hd,Xn as Be,Xo as ug,Xq as xj,Yl as Nb,Ym as id,Yn as Ce,Yo as vg,Yq as yj,Zl as Ob,Zm as jd,Zn as De,Zo as wg,Zp as ki,Zq as zj,_l as Pb,_m as kd,_o as xg,_p as li,_q as Qj,am as Ub,an as md,ao as Ie,ap as zg,aq as ni,ar as Sj,bm as Vb,bn as nd,bo as Je,bp as Ag,bq as oi,br as Tj,cm as Wb,cn as od,co as Ke,cp as Bg,cq as vi,cr as Uj,dm as hc,dn as pd,do as Le,dp as Cg,dq as wi,dr as ek,em as ic,en as ud,eo as Me,ep as Dg,eq as xi,er as fk,fm as jc,fn as vd,fo as Ne,fp as Eg,fq as yi,fr as gk,gm as kc,gn as wd,gp as Fg,gq as zi,gr as hk,hm as lc,hn as xd,hp as Gg,hq as Ai,hr as ik,im as mc,in as yd,ip as Hg,iq as Bi,ir as jk,jm as nc,jn as zd,jo as af,jp as Ig,jq as Ci,jr as kk,km as oc,kn as Ad,ko as bf,kp as Jg,kq as Di,kr as lk,lm as pc,ln as Bd,lp as Kg,lq as Ei,lr as mk,mm as qc,mn as Cd,mo as Wf,mp as Lg,mq as Fi,mr as nk,nm as rc,nn as Dd,np as Mg,nq as Gi,nr as ok,om as sc,on as Ed,op as Ng,oq as Hi,or as pk,pm as tc,pn as Fd,pp as Og,pq as Ii,pr as qk,qm as uc,qn as Gd,qp as Pg,qq as Ji,qr as rk,rm as vc,rn as Hd,rp as Qg,rq as Ki,rr as sk,sm as wc,sn as Id,sp as Rg,sq as Li,sr as tk,tm as xc,tn as Jd,tp as Sg,tq as Mi,tr as uk,um as yc,un as Kd,up as Tg,uq as Wi,ur as xk,vl as xa,vm as zc,vn as Ld,vp as Ug,vq as Xi,vr as yk,wl as ya,wm as Ac,wn as Md,wp as Vg,wq as Yi,wr as zk,xl as za,xm as Bc,xn as Nd,xp as Wg,xq as Zi,xr as Ak,yl as Aa,ym as Cc,yn as Od,yp as Xg,yq as _i,yr as Bk,zl as Ba,zm as Dc,zn as Pd,zp as Yg,zq as $i,zr as Ck}from"./chunk-3ssjb8cx.js";import{$r as ka,Dr as M,Er as N,Fr as O,Gr as P,Hr as Q,Ir as R,Jr as S,Kr as T,Lr as U,Mr as V,Nr as W,Or as X,Pr as Y,Qr as Z,Rr as _,Sr as $,Tr as aa,Ur as ba,Vr as ca,Wr as da,Xr as ea,Yr as fa,Zr as ia,_r as ja,as as la,bs as ma,cs as na,ds as oa,es as pa,fs as qa,gs as ra,hs as sa,is as ta,js as ua,ks as va,ls as wa}from"./chunk-ykevda74.js";import{ms as ga,ns as ha}from"./chunk-ez003q74.js";import{os as Rb,ps as Sb,qs as Tb}from"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import{As as Qi,Bs as Ri,Cs as Si,Ds as Ti,Es as Ui,Fs as Vi,xs as Ni,ys as Oi,zs as Pi}from"./chunk-19m7hed6.js";import{$s as Uc,Xs as Qc,Ys as Rc,Zs as Sc,_s as Tc,bt as Vc,kt as Wc,lt as Xc,mt as Yc}from"./chunk-kjd9hbg4.js";import{nt as Xb,ot as Yb,pt as Zb,qt as _b,rt as $b,st as ac}from"./chunk-ejwfnttb.js";import{Bt as Fe,Et as Ge,zt as Ee}from"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import{Jt as cc,Kt as dc}from"./chunk-1nnza3m6.js";import{Ot as dg,Pt as eg,Qt as fg,Rt as gg,St as hg,Tt as ig,Ut as jg,Wt as kg,Xt as lg,Yt as mg,Zt as ng}from"./chunk-hkrzv980.js";import{$t as rd,Au as pe,_t as qd,au as sd,bu as td,lu as ae,mu as be,nu as ce,ou as de,pu as ee,qu as fe,ru as ge,su as he,tu as ie,uu as je,vu as ke,wu as le,xu as me,yu as ne,zu as oe}from"./chunk-qbz6yn8c.js";import{$u as B,Bu as b,Cu as c,Du as d,Eu as e,Fu as f,Gu as g,Hu as h,Iu as i,Ju as j,Ku as k,Lu as l,Mu as m,Nu as n,Ou as o,Pu as p,Qu as q,Ru as r,Su as s,Tu as t,Uu as u,Vu as v,Wu as w,Xu as x,Yu as y,Zu as z,_u as A,av as C,bv as D,cv as E,dv as F,ev as G,fv as H,gv as I,hv as J,iv as K,jv as L}from"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import{Av as pb,Bv as qb,Cv as rb,Dv as sb,Ev as tb,Fv as ub,Gv as vb,Hv as wb,Iv as xb,Jv as yb,Kv as zb,Lv as Ab,Mv as Bb,Nv as Cb,Ov as Db,Pv as Eb,Qv as Fb,Rv as Gb,Sv as Hb,Tv as Ib,Uv as Jb,zv as ob}from"./chunk-aa8015mk.js";import{Aw as gb,Cw as hb,Yv as Pa,Zv as Qa,aw as Ra,fw as Sa,gw as Ta,mw as Ua,nw as Va,ow as Wa,pw as Xa,qw as Ya,rw as Za,sw as _a,tw as $a,uw as ab,vw as bb,ww as cb,xw as db,yw as eb,zw as fb}from"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{hl as writeNetlifyConfig,$m as writeManifest,Ml as writeImageManifest,sp as wrapComponentForHMR,$r as withDefaults,uk as webComponentDirectiveHandler,hq as watermark,jr as watchViews,Wl as watchMultiple,Xl as watchEffect,Vl as watch,Le as warmImagePlaceholders,im as waitForStore,X as waitForLocale,dp as virtualPathFor,hk as videoDirective,G as validators,ds as validated,Be as validateValueEnhanced,ki as validateTemplate,Pm as validateRouteRules,mq as validateParams,Ce as validateFormEnhanced,_q as validateFile,xe as validateFields,we as validateField,mi as validateDirective,Wd as validateCspDirectives,Ck as validateConfig,nn as validateComponentScripts,Ln as validateComponentProps,gh as validateClientScript,fi as v,Hc as usesSignalsInScript,ub as usesReactiveRuntime,Ai as userComponentFileExists,Nh as useVirtualList,ie as useTitle,hm as useStoreOrThrow,Kp as useStore,Tk as useStorage,zf as useSlots,Vk as useSessionStorage,cc as useServerRuntimeConfig,Xf as useServerData,fe as useSeoMeta,dc as useRuntimeConfig,jm as useRouteParams,lm as useRouteParamOrThrow,km as useRouteParam,ie as usePageTitle,qf as useOptimistic,Ef as useModel,nm as useMiddlewareValue,mm as useMiddlewareState,Uk as useLocalStorage,lp as useLoadingIndicator,de as useHead,ci as useForm,Bf as useAttrs,ar as uploadFiles,$q as uploadFile,em as updateInstance,of as untrack,Qi as unregisterDirective,fm as unmountInstance,Pc as unescapeHtml,hp as typecheckStxFiles,yi as transpileTypeScript,Or as translate,Ba as transitionDirective,lc as transformAutoImports,Fn as toUsers,En as toUser,Sp as thumbnail,Tq as thumbHashToRGBA,Uq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,If as templateCache,md as syncRecordedResponse,pp as stxClientHelpers,ig as structuredDataDirective,Rr as stripLocalePrefix,Mm as stripDocumentWrapper,Sb as stripCommentsAndLiterals,qo as stringToStream,Kd as strictCspPreset,We as streamingSuspenseDirective,_e as streamToResponse,Ue as streamTemplateSimple,Oe as streamTemplate,Ok as stopHmrServer,Bn as stopBroadcasting,_b as stateDirName,$b as stateDir,cf as state,ah as startsDocument,Lo as startProductionServer,Go as startInteractive,An as startBroadcasting,Tr as stampLocaleLayoutGroup,Ia as staggerDirective,kq as srcsetUrls,Ja as springDirective,td as splitByPipe,Im as spaNavVaryHeaders,ep as sourcePathFor,rq as smartBatchSign,Ci as slotContentHasExpressions,pq as signUrl,wi as shouldTranspileTypeScript,Lk as shouldReloadOnChange,uq as shouldRefreshSignature,Mk as shouldIgnoreFile,Fh as shouldCacheComponent,Wp as sharpen,gs as shape,Zb as setStateDir,rm as setRouteParams,sm as setMiddlewareState,Ke as setImagePlaceholder,tf as setGlobalProvide,b as setErrorLocale,Ol as setCurrentInstance,Xj as setCachedVideoResult,Mj as setCachedImageResult,Gj as setCached,js as serveStxFile,ls as serveMultipleStxFiles,Gk as serveMarkdownFile,Wo as serveFile,ms as serveApp,Vo as serve,vp as serializeState,bn as serializeSetCookie,Yp as sepia,ge as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,zi as scopeOnRootElement,lk as scopeHTML,kk as scopeCSS,lg as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,aq as saturation,nq as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,Gb as runtimeEventRegexLiteral,Eb as runtimeDirectiveNamesLiteral,wg as runPreProcessingMiddleware,xg as runPostProcessingMiddleware,en as runPageAction,jf as runMountCallbacks,gb as runMiddleware,cm as runHooks,Hr as runDoctor,kf as runDestroyCallbacks,Ag as runComposers,bq as rotate,gi as rewriteImagesWithSiblings,nd as responseBindings,Gi as resolveTemplatePath,ha as resolveStxTargets,yk as resolveStxDirectories,Nr as resolveI18n,Qp as resize,og as resetUnscopedSignalWarnings,Nc as resetRejectedExpressionWarnings,sc as resetPlaceholders,ce as resetHead,up as resetHMRHandler,o as resetErrorConfig,bs as required,bg as reportDeferredLoopWarnings,wc as replacePlaceholders,Ec as replaceInterpolations,hr as renderView,ek as renderVideoComponent,ic as renderVendorStyleTags,qr as renderToString,rr as renderToStream,sr as renderToDOM,Sq as renderThumbhashToCanvas,Er as renderTemplateString,Cr as renderTemplate,Dr as renderString,Re as renderStreamingPage,ri as renderSlot,vh as renderSSRSuspense,Cq as renderProtectedVideo,Bq as renderProtectedImg,oq as renderMediaUpload,Br as renderMarkdownView,Tm as renderLayoutTypes,Qj as renderImgComponent,Cl as renderImageComponent,ke as renderHtmlAttrs,je as renderHead,kr as renderEmail,Ei as renderComponentWithSlot,le as renderBodyAttrs,Fp as render,Md as relaxedCspPreset,ve as registerValidationRule,Ye as registerStreamingDirectives,Mp as registerStoresClient,pm as registerStore,Qf as registerServeModuleBundle,jg as registerSeoDirectives,_a as registerMiddleware,Ac as registerFilters,zc as registerFilter,d as registerErrorMessages,Ae as registerEnhancedValidationRule,Ni as registerDirective,Vd as registerCspDirectives,On as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,mc as referencesName,Sl as ref,yo as redirect,id as recordResponseStatus,jd as recordResponseHeader,ac as rebaseOntoStateDir,kd as readResponseStatus,ld as readResponseHeaders,Ek as readMarkdownFile,Jf as readFileCached,Tl as reactive,fq as quality,zq as pruneSignatureCache,Jj as pruneCache,rf as provide,Ar as protectCodeBlocks,as as prop,Dg as processVueTemplate,Lh as processVirtualListDirectives,Ph as processVirtualGridDirectives,dk as processVideo,ye as processValidateDirective,ea as processTranslateDirective,ph as processTransitionDirectives,sh as processTransitionAttributes,oe as processTitleDirective,ad as processTemplateBindings,lh as processTeleportDirectives,th as processSuspenseDirectives,eg as processStructuredData,Se as processStreamDirectives,od as processStatusDirective,ai as processStaticDirectives,ug as processStackReplacements,tg as processStackPushDirectives,si as processSlots,Km as processShell,Ne as processServerBindings,fg as processSeoDirective,Ze as processSectionDirectives,Uc as processScopedStyles,_c as processReactiveBindings,Dq as processProtectedMedia,Vh as processPartialHydrationDirectives,fh as processOnceDirective,vg as processMiddleware,dg as processMetaDirectives,pe as processMetaDirective,Fk as processMarkdownFileDirectives,Li as processMarkdownDirectives,cg as processLoops,Dh as processKeepAliveDirectives,eh as processJsonDirective,Oh as processInfiniteListDirectives,sg as processIncludes,Sj as processImgComponents,El as processImageComponents,rl as processImage,ne as processHeadDirective,re as processForms,te as processFormInputDirectives,Lc as processExpressions,Pb as processEventDirectives,ue as processErrorDirective,Eg as processDynamicComponents,hi as processDirectives,Vi as processDirectiveAttributes,kh as processDeferDirectives,_d as processCustomDirectives,Sd as processCspDirectives,hs as processComponentProps,rc as processClientScript,se as processBasicFormDirectives,yh as processAsyncDirectives,$d as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Ge as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,kp as preloadIslandHandlers,Me as preloadIconCollection,wn as poolStrings,wk as pluginManager,Ie as placeholdersWarmed,oh as performLeave,nh as performEnter,lf as pendingLifecycleCounts,pf as peek,pg as partialsCache,fk as parseVideoDirectiveOptions,Op as parseUrl,Vq as parseThumbhashString,zd as parseSwitchBlock,pi as parseSlots,qi as parseSlotElement,Ed as parseScriptDeclarations,sk as parseSFCComponent,Eq as parseProtectedArgs,ag as parseLoopBinding,Rj as parseImgComponent,hj as parseImageUrl,Dl as parseImageComponent,cn as parseFormBody,Bd as parseExpressionWithFilters,Pn as parseDefaults,vo as parseCookies,Bm as parseContainerSelector,wd as parseConditionalBlock,Cd as parseArguments,Ma as parseAnimationShorthand,cs as optional,xn as optimizeTemplate,Jl as optimizeImage,Kl as optimizeDirectory,es as oneOf,qg as onceStore,$l as onUpdated,Zc as onUpdate,bm as onUnmounted,wm as onServer,Zl as onMounted,gf as onMount,$h as onHydrated,xf as onErrorCaptured,hf as onDestroy,Jh as onDeactivated,vm as onClient,_l as onBeforeUpdate,am as onBeforeUnmount,Yl as onBeforeMount,Ih as onActivated,Oq as observeElement,zo as notFound,Jg as normalizeCriticalHeadOrder,wf as nextTick,Sn as negotiateEncoding,Ua as navigateTo,dm as mountInstance,Ea as motionDirective,Ld as moderateCspPreset,vn as minifyHtml,hg as metaDirective,Ug as metaDedupKey,Pp as mergeParams,Wg as mergeHtmlAttrs,ee as mergeHeadConfigs,Rc as mergeCssConfig,Pd as mergeCspDirectives,Ra as matchRoute,Mi as markdownDirectiveHandler,Dk as markdownCache,ga as looksLikeGlob,Qr as localizePath,U as loadTranslationLazy,_ as loadTranslation,zk as loadStxConfig,db as loadMiddlewareFromDirectory,an as loadManifest,Kq as loadElement,Cn as loadChannels,Lb as listensPassively,Xr as lintStxStrict,Mq as lazyLoadAll,Lq as lazyLoad,Ha as keyframeDirective,or as jsxs,pr as jsxDEV,nr as jsx,xo as jsonResponse,Xe as islandDirective,l as isTest,Nm as isSpaNavigation,Gm as isSpaNavRequest,sq as isSignatureValid,mf as isSignal,pl as isSharpAvailable,jo as isServerEnvironment,tm as isServer,yb as isRuntimeOwnedColonAttr,Hb as isRuntimeEventName,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Hq as isNativeLazySupported,zr as isMarkdownPath,Q as isLoading,R as isLoaded,vi as isJavaScriptScript,Iq as isIntersectionObserverSupported,xl as isImageFile,ql as isImageBackendAvailable,aa as isICUFormat,_h as isHydrated,Bi as isHydrateTrigger,gd as isHttpStatus,io as isEdgeEnvironment,Yr as isDirectiveKind,k as isDevelopment,nf as isDerived,Kk as isCssOnlyChange,Rn as isCompressible,um as isClient,Ah as isAsyncComponent,dn as isActionableMethod,Zp as invert,Lf as invalidateFileCacheByDir,Kf as invalidateFileCache,Kc as interpolateScriptsInTemplate,Ic as interpolateScriptExpressions,Jc as interpolateScriptAttributes,x as inlineError,Mr as injectThemeBootstrap,gg as injectSeoTags,Jr as injectSeo,Wf as injectRouterScript,Jk as injectHotReload,kb as injectHeatmap,Yc as injectCss,Qd as injectCspMetaTag,ch as injectConfigHeadTags,Ig as injectColorModeBootScript,Yg as injectCloakStyle,Pg as injectBuildId,kc as injectBrowserCoreAutoImports,cd as injectAnalytics,sf as inject,om as initStoreRegistry,kl as initNetlify,mp as initLoadingIndicator,Jq as initLazyLoading,Fo as initFile,Rq as initBlurUp,Xq as initAllBlurUp,Uj as imgDirective,Hl as imageDirective,hn as hydrateTemplateStream,gn as hydrateTemplate,jp as hydrateIslands,Xh as hydrateIsland,jn as hydrateFragment,Yh as hydrateByStrategy,Zh as hydrateAll,Cp as hydrate,Uo as htmlResponse,_g as hoistLeadingHeadTags,Kg as hoistColorModeBootScript,lb as heatmapDirective,Cj as hashString,Vf as hashFilePath,Aj as hashFile,Bj as hashBuffer,Cg as hasVueTemplateSyntax,$f as hasVariables,Hp as hasStore,xc as hasPlaceholders,il as hasNetlifyConfig,ab as hasMiddleware,Qb as hasEventDirectives,bh as hasDocumentShell,ni as hasDirectives,ma as hasDOMSupport,Al as handleImageRequest,yf as handleError,wr as h,wl as groupVariantsByFormat,Xp as grayscale,No as gitHash,pn as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,dl as getTotalSize,tq as getTimeUntilExpiry,hh as getStoreScript,Ip as getStoreNames,Gp as getStore,Yk as getStorageSize,Xk as getStorageKeys,Hi as getSourceLineInfo,xi as getSharedTranspiler,Rf as getServeModuleBundle,Pf as getServeClientAsset,la as getScreenReaderOnlyStyle,mk as getScopeAttribute,bf as getRouteParams,Vb as getPublicEnvDefine,Wb as getPublicEnv,li as getPositionInfo,uc as getPlaceholderRegistry,zj as getPlaceholderCacheStats,be as getPageMeta,Gd as getNonce,yl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,He as getImagePlaceholder,sl as getImageMetadata,Ee as getImageDelivery,Bp as getHydrationRuntime,qm as getHydratedStoreState,Nk as getHmrServer,ae as getHead,tp as getHMRHandler,lj as getFormatExtension,Ej as getFileMtime,vl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,Pi as getDirectives,Oi as getDirective,Pl as getCurrentInstance,Vc as getCssServeAsset,Od as getCspPreset,Xd as getCspHeaderName,Ki as getComponentCacheStats,Wj as getCachedVideoResult,xq as getCachedSignature,Nf as getCachedSignalsRuntime,Of as getCachedRouterScript,xj as getCachedPlaceholder,Lj as getCachedImageResult,Fj as getCached,Ij as getCacheStats,Ng as getBuildId,zn as getBroadcastServer,kj as getBestVariant,Bc as getAllFilters,_i as generateWidthSrcset,Mh as generateVirtualListCSS,cr as generateVideoPreview,De as generateValidationScript,dr as generateUploadRuntime,qn as generateTreeShakenBundle,rh as generateTransitionRuntime,qh as generateTransitionCSS,_j as generateThumbnails,qj as generateThumbhashPlaceholder,$n as generateTemplatesDocs,xh as generateSuspenseRuntime,wh as generateSuspenseCSS,wp as generateStateScript,ij as generateSrcsetData,Pj as generateSrcset,tl as generateSrcSet,$j as generateSpriteSheet,lr as generateSpaShell,jj as generateSourceTags,ej as generateSizesFromBreakpoints,dj as generateSizesAttribute,ul as generateSizes,kg as generateSitemapIndex,Kr as generateSitemap,Gq as generateSimpleMediaPicker,Aq as generateSignatureRuntime,Hf as generateSignalsRuntimeDev,Gf as generateSignalsRuntime,qc as generateServerDataBridge,jk as generateScopeId,tk as generateSFCWebComponent,Nb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,mg as generateRobotsTxt,Lr as generateRobots,Oj as generateResponsiveVariants,pk as generateReactiveWebComponentTS,ok as generateReactiveWebComponent,rk as generateReactiveRuntime,qk as generateReactiveMixin,Zj as generatePoster,wj as generatePlaceholderStyle,vj as generatePlaceholderCSS,pj as generatePlaceholder,Wh as generatePartialHydrationCSS,Fd as generateNonce,el as generateNetlifyToml,fr as generateMinifiedMediaRuntime,er as generateMediaRuntime,Fq as generateMediaManagerEmbed,_m as generateManifest,op as generateLoadingIndicatorHtml,Qq as generateLazyLoadRuntime,Um as generateLayoutTypes,sj as generateLQIP,Hh as generateKeepAliveRuntime,Gh as generateKeepAliveCSS,bi as generateIslandManifest,br as generateImagePreview,Ll as generateImageManifest,Ap as generateHydrationScript,$e as generateHydrationRuntime,Dp as generateHydrationCSS,Qh as generateHydrationBootstrap,Ik as generateHotReloadScript,jb as generateHeatmapScript,rp as generateHMRClientScript,ak as generateHLSManifest,xp as generateEventBindings,cj as generateDprSrcsetWithVariableQuality,bj as generateDprSrcset,$g as generateDocumentShell,fo as generateDocs,ao as generateDirectivesDocs,Ui as generateDirectiveRuntime,ng as generateDefaultRobotsTxt,bk as generateDASHManifest,Xc as generateCss,Jd as generateCspMetaTag,Id as generateCspHeader,Df as generateCompositionRuntime,_n as generateComponentsDocs,Rh as generateComponentManifest,Yn as generateComponentDoc,uj as generateColorPlaceholder,Hg as generateColorModeBootScript,gm as generateClientRuntime,Dj as generateCacheKey,oc as generateBrowserAutoImportDestructuring,Yq as generateBlurUpRuntime,Zq as generateBlurUpCSS,$c as generateBindingsRuntime,$i as generateAutoWidthSrcset,nc as generateAutoImportDestructuring,Ch as generateAsyncComponentRuntime,Bh as generateAsyncComponentCSS,fc as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,bd as generateAnalyticsScript,ip as formatTypecheckDiagnostics,bp as formatTypeErrors,Co as formatStxContent,cl as formatSize,Ta as formatRoutes,Do as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,Ir as formatDoctorReport,bo as formatDocsAsMarkdown,eo as formatDocsAsJson,co as formatDocsAsHtml,eq as format,un as foldConstants,dq as flipVertical,cq as flipHorizontal,Vm as fingerprint,gp as findStxModuleDeclarations,fp as findRuntimeTypeDeclarations,Gr as findPantryPackage,Dc as findMustacheEnd,vd as findMatchingEndTag,rd as findMatchingDelimiter,Rb as findInterpolationEnd,xd as findIfBlocks,Ad as findExpressions,Sa as findErrorPage,Sc as findDuplicateScopedStyleRanges,yd as findDirectiveBlocks,rn as findDeadCode,rn as findDeadBranches,Cm as findContainerRegion,Zn as findComponentFiles,ks as findCommonDir,bl as filterRequiredFiles,Fi as fileExists,Yf as extractVariables,ji as extractTemplateExpressions,Te as extractStreamBoundaries,yp as extractState,ti as extractSlotContent,_f as extractScriptFromTemplate,ii as extractScriptBlocks,vc as extractPlaceholders,ud as extractParenthesizedExpression,hd as extractPageResponseStatus,hb as extractLayoutMetadata,tj as extractDominantColor,Dd as extractDirectiveParams,oi as extractDirectiveNames,Om as extractContainerContent,Wn as extractComponentProps,Sh as extractComponentName,Xn as extractComponentDescription,Wc as extractClassNames,pc as extractBridgeData,Th as extractBoundProps,sd as extractBalancedExpression,hc as extractAndStripCssImports,nk as extractAndScopeStyles,Ob as extractAndProcessEvents,Rk as externalizeSharedAssets,Sk as externalizeRepeatedAssets,Qk as externalizeHtml,Oc as evaluateExpression,tn as evaluateConstant,pd as evaluateAuthExpression,Gc as escapeHtmlValue,Fc as escapeHtml,C as errorRecovery,E as errorLogger,mh as ensureTeleportTargets,dh as ensureDocumentShell,ze as enhancedValidationRules,Un as enableDevTools,sn as eliminateDeadCode,ef as effect,lq as dprUrls,go as docsCommand,ec as discoverServerApi,Sm as discoverLayoutNames,Pq as disconnectObserver,Vn as disableDevTools,F as devHelpers,Jm as detectShell,ho as detectRuntime,fl as detectProjectConfig,mj as detectFormat,mn as detectBuildMode,df as derived,jl as deploy,Bk as defineStxConfig,Lp as defineStore,Af as defineSlots,Wr as defineSiteConfig,_r as definePropsWithValidation,Zr as defineProps,vk as definePlugin,he as definePageMeta,Wa as defineMiddleware,di as defineForm,vf as defineExpose,uf as defineEmits,Ri as defineDirective,yr as defineCustomElement,Ko as defineConfig,Si as defineClientDirective,zh as defineAsyncComponent,Mo as defineApiHandler,gr as defaultMediaConfig,Nl as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,qe as defaultFormClasses,yc as defaultFilters,Zd as defaultCspConfig,xk as defaultConfig,is as default,Qc as deepMergeThemes,Tc as dedupeScopedStyles,Fm as decodeTitleEntities,rj as decodeThumbhash,Ud as cspNonceDirective,Td as cspDirective,Wq as crossfadeTransition,Rp as crop,Kh as createVirtualList,gk as createVideoDirective,to as createVercelHandler,_o as createTypeChecker,fa as createTranslateFilter,po as createTextEncoderStream,xr as createStxApp,oo as createStreamingResponse,Ve as createStreamRenderer,Jp as createStore,Za as createStorageManager,Xa as createServerCookieManager,gc as createServerApi,Rl as createScope,uh as createSSRSuspense,af as createRouter,Qm as createRouteRuleResolver,eb as createRouteLocation,Yo as createRoute,Sl as createRef,Tl as createReactive,Cf as createProvideContext,Po as createProject,Jo as createProductionBuild,tc as createPlaceholder,yn as createOptimizedBuild,uo as createNetlifyHandler,Zk as createNetlifyClient,fb as createMiddlewareContext,Xo as createMiddleware,Nq as createLazyObserver,Eh as createKeepAliveCache,lo as createKVNamespace,Uh as createIslandRegistry,Tj as createImgDirective,Il as createImagePlugin,Bl as createImageHandler,Gl as createImageDirective,nb as createHeatmapAggregator,al as createFileManifest,ko as createEnvAccessor,z as createEnhancedError,no as createEdgeHandler,mo as createEdgeCache,Ii as createDetailedErrorMessage,so as createDenoHandler,gl as createDefaultNetlifyConfig,Yd as createCspHeaders,wo as createCookie,Ul as createComputed,Ql as createComponentInstance,ro as createCloudflareHandler,Ya as createClientCookieManager,Ti as createBuiltinDirectives,xr as createApp,Ka as createAnimationTimeline,Up as cover,Zf as convertToCommonJS,$p as contrast,Tp as contain,y as consoleError,m as configureErrorHandling,Ak as config,Ul as computed,Tn as compressResponse,zg as composerPattern,yg as composer,Lm as composeShellWithPage,Nn as componentDirective,Di as componentClientSignalNames,Zm as compileTemplate,a as collectRepeatedFlag,$k as collectDeployFiles,Zg as cloakStyleFragment,Yj as clearVideoCache,N as clearTranslationCache,ih as clearStoreCache,Wk as clearStorage,yq as clearSignatureCache,Ff as clearServerData,yj as clearPlaceholderCache,rg as clearOnceStore,Hd as clearNonce,bb as clearMiddleware,Je as clearImagePlaceholders,Fe as clearImageDeliveryCatalog,Fl as clearImageCache,e as clearErrorMessages,Sf as clearDevCaches,Cc as clearCustomFilters,Bg as clearComposers,jh as clearComposableCache,Ji as clearComponentCache,Hj as clearCache,Ib as clearBlankCache,np as cleanupLoadingIndicator,zm as classifyScript,Am as classifyAllScripts,$o as checkTemplateFile,ap as checkTemplate,Tf as checkCache,vq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,In as channel,Bo as captureScreenshots,Ao as captureScreenshot,Z as cancelPendingLoads,_k as calculateSha1,aj as calculateOptimalWidths,Uf as cacheTemplate,bc as cacheEngineFingerprint,ik as buildWebComponents,cp as buildVirtualSource,ir as buildViews,Np as buildUrl,Pe as buildSuspenseResolveScript,Vr as buildStaticSite,qb as buildRuntimeGlobalsDestructure,Wm as buildRuntimeAsset,Xm as buildRouterAsset,Ur as buildLangPickerScript,gj as buildImageUrl,Qg as buildIdFragment,Vg as buildHtmlAttrs,kn as buildForProduction,Qn as buildComponentLibrary,wq as buildAuthParams,ln as buildApp,Sr as buildAlternateLinks,Io as build,Gn as broadcastPrivate,Hn as broadcastPresence,Dn as broadcast,_p as brightness,Tb as bracketDepths,Vp as blur,Jb as blankInertHtmlRegions,qq as batchSignUrls,ff as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,gq as auto,ja as attributeValue,Ym as assetTags,Mb as asInvocableStatement,fs as arrayOf,Pr as applyTranslations,Nj as applyTransformations,ui as applySlots,Mn as applyPropDefaults,jq as applyPreset,Xg as applyHtmlAttrs,me as applyHead,Mc as applyFilters,Hm as appendVary,Nd as apiCspPreset,Da as animationGroupDirective,ck as analyzeVideo,on as analyzeUsage,xm as analyzeTemplate,ym as analyzeProject,on as analyzeDirectiveUsage,dd as analyticsDirective,So as addStore,Ro as addPage,Rd as addNonceToInlineContent,To as addLayout,Qo as addComponent,fn as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Mf as __setSignalsGeneratorsForTest,Og as __setBuildIdForTest,Vj as VideoProcessorCache,ei as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,qd as Tokenizer,Zo as TemplateTypeChecker,Eo as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,tr as Show,Qe as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,jc as STX_AUTO_IMPORTS,Yb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,Dm as SPA_NAV_HEADER,Kb as SCROLL_BLOCKING_EVENTS,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Fb as RUNTIME_EVENT_NAMES,Db as RUNTIME_DIRECTIVE_NAMES,ed as RESPONSE_STATUS_KEY,fd as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Ho as ProductionBuild,vr as Portal,Oo as PROJECT_TEMPLATES,iq as PRESETS,sb as NON_CLIENT_PRIMITIVES,Ep as MemorySessionStore,Zi as MIME_TYPES,Wi as MEDIA_DEFAULT_WIDTHS,Yi as MEDIA_DEFAULT_FORMATS,Rm as LAYOUT_TYPES_FILE,Kj as ImageProcessorCache,zl as ImageProcessingError,zp as HydrationRuntime,Hk as HotReloadServer,mb as HeatmapAggregator,Tg as HTML_CLASS_MARKER,Sg as HTML_ATTRS_MARKER,mr as Fragment,ur as For,Em as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,Pk as EXTERNALIZED_ASSET_DIR,ll as DeployError,ml as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Xb as DEFAULT_STATE_DIR,ol as DEFAULT_QUALITY,nj as DEFAULT_PLACEHOLDER_OPTIONS,nl as DEFAULT_FORMATS,Xi as DEFAULT_DPR_VALUES,qp as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,fj as COMMON_SIZES,Fg as COLOR_MODE_BOOT_MARKER,Gg as COLOR_MODE_BOOT_GLOBAL,Rg as CLOAK_STYLE,Kn as BroadcastServer,Jn as Broadcast,Lg as BUILD_ID_META,Mg as BUILD_ID_HEADER,Ub as BROWSER_CORE_IMPORTS,oj as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,Fr as $path};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{xg as I}from"./chunk-0knxnyq6.js";import{wr as H}from"./chunk-3ssjb8cx.js";import{Rw as G}from"./chunk-emjmshj8.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-jwmact5f.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
2
+ import{xg as I}from"./chunk-0knxnyq6.js";import{wr as H}from"./chunk-3ssjb8cx.js";import{Rw as G}from"./chunk-emjmshj8.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-w9gserf7.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
3
3
  export{Q as Ve};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{bg as ZJ,dg as g,fg as A,lg as n,og as GJ,rg as WJ,tg as YJ,vg as jJ}from"./chunk-jy451jg5.js";import{yg as $J}from"./chunk-0knxnyq6.js";import{rl as XJ}from"./chunk-t23kccpz.js";import{lo as h}from"./chunk-3ssjb8cx.js";import{Gs as e}from"./chunk-kjd9hbg4.js";import{Ht as QJ,Lt as i,Nt as p}from"./chunk-1nnza3m6.js";import{$v as KJ,Cw as l,Hw as VJ}from"./chunk-trva71am.js";import{Rw as DJ}from"./chunk-emjmshj8.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".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 uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-0d6qgbks.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
2
+ import{bg as ZJ,dg as g,fg as A,lg as n,og as GJ,rg as WJ,tg as YJ,vg as jJ}from"./chunk-a4jhcbsh.js";import{yg as $J}from"./chunk-0knxnyq6.js";import{rl as XJ}from"./chunk-t23kccpz.js";import{lo as h}from"./chunk-3ssjb8cx.js";import{Gs as e}from"./chunk-kjd9hbg4.js";import{Ht as QJ,Lt as i,Nt as p}from"./chunk-1nnza3m6.js";import{$v as KJ,Cw as l,Hw as VJ}from"./chunk-trva71am.js";import{Rw as DJ}from"./chunk-emjmshj8.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".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 uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-0d6qgbks.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
3
3
  export{zJ as We,LJ as Xe,t as Ye,uJ as Ze};
@@ -0,0 +1,20 @@
1
+ // @bun
2
+ import{fi as jH}from"./chunk-3y8vvkar.js";import{Do as e,Lp as S,Mp as zH,Np as qH,Qp as JH,Rp as WH,Sp as VH,Tp as AH,Up as GH,Vp as UH,Wp as FH,Xp as MH,Yp as XH,am as $H,wr as BH}from"./chunk-3ssjb8cx.js";import{rt as f}from"./chunk-ejwfnttb.js";import{zv as D}from"./chunk-aa8015mk.js";import{existsSync as x,readFileSync as m}from"fs";import U from"path";var EH=new Set(["module","exports","require","$bool","window","document","console","confirm","alert","fetch"]),HH=e.filter((H)=>!EH.has(H)).sort(),KH=[...D].sort(),DH=[...new Set([...HH,...KH])].sort(),PH=new Set(HH),TH=new Set(KH),SH=new Set(DH),t=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function xH(H,K){if(K==="server")return`'${H}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${H}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${H}', so it is undefined in the browser.`}function QH(H,K){let Z=[];for(let q of K){if(q.offset===void 0)continue;let Y=q.kind==="server"?PH:TH;t.lastIndex=0;for(let z of q.code.matchAll(t)){let A=z.index+z[0].indexOf("{")+1;for(let G of z[1].matchAll(/[^,]+/g)){let X=G[0];if(/^\s*type\s/.test(X))continue;let M=/^\s*([A-Za-z_$][\w$]*)/.exec(X);if(!M)continue;let $=M[1];if(!SH.has($)||Y.has($))continue;let V=q.offset+A+G.index+M[0].length-$.length,J=H.slice(0,V),I=J.split(`
3
+ `).length;Z.push({line:I,column:V-(J.lastIndexOf(`
4
+ `)+1)+1,offset:V,length:$.length,name:$,kind:q.kind,message:xH($,q.kind)})}}}return Z}import w from"path";var hH="@stacksjs/stx-typescript-plugin";function kH(H,K){let Z=w.resolve(H);for(;;){let q=w.join(Z,"tsconfig.json");if(K(q))return q;let Y=w.dirname(Z);if(Y===Z)return;Z=Y}}function YH(H,K,Z){let q=kH(H,Z);if(!q)return;let Y=new Set,z=(A)=>{if(Y.has(A))return;Y.add(A);let G=K(A);if(!G)return;let X=G.compilerOptions?.plugins;if(Array.isArray(X)){let $=X.find((J)=>J?.name===hH),V=Array.isArray($?.libs)?$.libs.filter((J)=>typeof J==="string"):[];return $?{configPath:A,libs:V.map((J)=>w.resolve(w.dirname(A),J))}:null}let M=typeof G.extends==="string"?[G.extends]:Array.isArray(G.extends)?G.extends:[];for(let $ of[...M].reverse()){if(typeof $!=="string"||!$.startsWith("."))continue;let V=w.resolve(w.dirname(A),$.endsWith(".json")?$:`${$}.json`),J=z(V);if(J!==void 0)return J}return};return z(q)??void 0}function gH(H,K="",Z=""){let q=H.startLine>1?`
5
+ `.repeat(H.startLine-1):"",Y=UH(H)+qH(zH(H.code)),z=H.kind==="client"||H.kind==="plain"?VH(K,H.code):"";return GH(`${q+Y}
6
+ ${z}
7
+ export {}
8
+ `,Z)}var fH=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function mH(H){if(H.length===0)return"";let K=["// Generated \u2014 the composables the runtime publishes as bare globals."],Z=new Set(D),q=[];for(let{file:Y,names:z}of H){let A=JSON.stringify(Y.replace(/\\/g,"/").replace(/\.ts$/,""));q.push(` export * from ${A}`);for(let G of z){if(Z.has(G)||fH.has(G))continue;Z.add(G),K.push(`declare const ${G}: typeof import(${A})[${JSON.stringify(G)}]`)}}return K.push("declare module '@composables' {",...q,"}"),K.join(`
9
+ `)}function ZH(H,K,Z){return`${H}.__stx_${K}${Z}.ts`}function JK(H){return H.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function uH(){return IH("stx.d.ts")}function bH(){return IH("stx-module.d.ts")}function IH(H){for(let K of[U.resolve(import.meta.dir,"..",H),U.resolve(import.meta.dir,"..","..",H)])if(x(K))return K;return null}var pH=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function dH(H){return H>=1000&&H<2000}function LH(H){let K="",Z=!1,q=!1;for(let Y=0;Y<H.length;Y++){let z=H[Y];if(Z){if(K+=z,q)q=!1;else if(z==="\\")q=!0;else if(z==='"')Z=!1;continue}if(z==='"'){Z=!0,K+=z;continue}if(z==="/"&&H[Y+1]==="/"){while(Y<H.length&&H[Y]!==`
10
+ `)Y++;K+=`
11
+ `;continue}if(z==="/"&&H[Y+1]==="*"){Y+=2;while(Y<H.length&&!(H[Y]==="*"&&H[Y+1]==="/"))Y++;Y++;continue}K+=z}return K.replace(/,(\s*[}\]])/g,"$1")}function lH(H){try{return JSON.parse(LH(m(H,"utf8")))}catch{return}}function cH(H){let K=U.resolve(H),Z;for(;;){let $=U.join(K,"tsconfig.json");if(x($)){Z=$;break}let V=U.dirname(K);if(V===K)break;K=V}if(!Z)return{};let q=new Set,Y=Z,z,A,G=Z;while(Y&&!q.has(Y)){q.add(Y);let $;try{$=JSON.parse(LH(m(Y,"utf8")))}catch{break}let V=$?.compilerOptions??{};if(!z&&V.paths&&typeof V.paths==="object")z=V.paths,G=Y;if(!A&&typeof V.baseUrl==="string")A=U.resolve(U.dirname(Y),V.baseUrl);if(z&&A)break;Y=typeof $?.extends==="string"?U.resolve(U.dirname(Y),$.extends.endsWith(".json")?$.extends:`${$.extends}.json`):void 0}if(!z)return{};let X=A??U.dirname(G),M={};for(let[$,V]of Object.entries(z)){if(!Array.isArray(V))continue;M[$]=V.map((J)=>typeof J==="string"&&!U.isAbsolute(J)?U.resolve(X,J):J)}return{paths:M}}async function WK(H,K={}){let Z=K.client!==!1,q=K.server!==!1,Y=K.templates!==!1,z=K.componentsDir??(Y?(await BH()).componentsDir:void 0),A=new Map,G=new Map,X=[],M=[],$=0,V=0,J=uH();for(let Q of H){let j=await Bun.file(Q).text(),F=S(j).filter((W)=>{if(W.kind==="server")return q;return Z}),B=S(j).filter((W)=>W.kind==="server").map((W)=>W.code).join(`
12
+ `);for(let W of QH(j,F))X.push({file:Q,line:W.line,column:W.column,code:0,message:W.message,category:"error",blockKind:W.kind});if(Z&&B){let W=F.filter((R)=>R.kind!=="server"),N=[...new Set(W.flatMap((R)=>AH(B,R.code)))];if(N.length>0)G.set(Q,{names:N,line:W[0].startLine,kind:W[0].kind})}let C=U.dirname(U.resolve(Q)),L=Y?FH(j,{runtimeGlobals:!J,originDir:C,filePath:U.resolve(Q),componentsDir:z}):null,_=L?[...L.lineMap.values()].filter((W)=>W.expression).length:0;if(F.length===0&&_===0)continue;if(M.push(Q),$+=F.length,V+=_,F.forEach((W,N)=>{A.set(ZH(Q,W.kind,N),{source:gH(W,B,C),origin:Q,kind:W.kind})}),L&&_>0)A.set(ZH(Q,"template",0),{source:L.text,origin:Q,kind:"template",virtual:L})}if(A.size===0)return{diagnostics:X,checkedFiles:M,blockCount:0,expressionCount:0};let I=(K.extraLibs??[]).map((Q)=>U.resolve(Q)),wH=YH(H.length>0?U.dirname(U.resolve(H[0])):process.cwd(),lH,x);for(let Q of wH?.libs??[])if(!I.includes(Q)&&x(Q))I.push(Q);if(J)I.push(J);let u=J?bH():null;if(u)I.push(u);let b=`${f()}/typecheck/__stx_globals.d.ts`,CH=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",JH(J?WH(m(J,"utf8")):void 0),...J?[]:["declare const window: any",...D.map((Q)=>`declare const ${Q}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...$H.map((Q)=>`declare const ${Q}: any`)].join(`
13
+ `),mH(await jH())].filter(Boolean).join(`
14
+ `),v=`${f()}/typecheck`;await Bun.$`rm -rf ${v}`.quiet().nothrow(),await Bun.$`mkdir -p ${v}`.quiet().nothrow(),await Bun.write(b,CH);let O=new Map,NH=0;for(let[Q,j]of A){let F=`${NH++}_${Q.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${v}/${F}`,j.source),O.set(F,j)}let RH={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...cH(H.length>0?U.dirname(U.resolve(H[0])):process.cwd()),...K.compilerOptions??{}},p=async(Q,j)=>{let F=`${v}/tsconfig${j===1?"":`.${j}`}.json`;await Bun.write(F,JSON.stringify({compilerOptions:RH,files:Q.map((C)=>`${v}/${C}`).concat(b,...I)},null,2));let B=Bun.spawnSync(["bun","x","tsc","-p",F,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(B.stdout)+new TextDecoder().decode(B.stderr),exitCode:B.exitCode??0}},d=await p([...O.keys()],1),l=d.output,P=[],c=d.exitCode,r=0,vH=new Set(I.map((Q)=>Q.split("/").pop())),o=0,T=new Set,n=(Q)=>{for(let j of Q.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
15
+ `)){let F=j.match(pH);if(!F)continue;if(r++,vH.has(F[1].split("/").pop()))o++;let[,B,C,L,_,W,N]=F,R=B.split("/").pop(),y=O.get(R);if(!y)continue;if(dH(Number(W)))T.add(R);let k=Number(C),g=Number(L),i;if(y.virtual){let E=XH(y.virtual,k,g);if(!E?.expression)continue;if(MH(E,Number(W)))continue;k=E.line,g=E.column,i=E.expression.code.trim()}P.push({file:y.origin,line:k,column:g,code:Number(W),message:N,category:_==="error"?"error":"warning",blockKind:y.kind,expression:i})}};n(l);let OH=r,_H=o;if(T.size>0&&T.size<O.size){let Q=[...O.keys()].filter((j)=>!T.has(j));n((await p(Q,2)).output)}if(Z)for(let[Q,j]of G){if(j.names.length===0)continue;P.push({file:Q,line:j.line,column:1,code:0,message:`${j.names.length===1?"1 value reaches":`${j.names.length} values reach`} this block on the implicit bridge and ${j.names.length===1?"is":"are"} untyped: ${j.names.join(", ")}. Declare them with defineClientPayload({ ${j.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:j.kind})}P.push(...X);let s=new Set,h=P.filter((Q)=>{let j=`${Q.file}:${Q.line}:${Q.column}:${Q.code}:${Q.message}`;if(s.has(j))return!1;return s.add(j),!0});h.sort((Q,j)=>Q.file.localeCompare(j.file)||Q.line-j.line||Q.column-j.column);let a=_H>0&&h.length===0,yH=a||c!==0&&OH===0?`${a?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${c} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
16
+ ${l.trim().split(`
17
+ `).slice(0,12).join(`
18
+ `)||"(no output)"}`:void 0;return{diagnostics:h,checkedFiles:M,blockCount:$,expressionCount:V,failure:yH}}function VK(H){return H.map((K)=>{let Z=K.blockKind==="template"?`[template: ${K.expression??""}]`:`[${K.blockKind==="plain"?"<script>":`<script ${K.blockKind}>`}]`;return`${K.file}:${K.line}:${K.column} ${K.category} TS${K.code} ${K.message} ${Z}`}).join(`
19
+ `)}
20
+ export{gH as Le,ZH as Me,JK as Ne,uH as Oe,bH as Pe,WK as Qe,VK as Re};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Xf as a}from"./chunk-rbfm5sjt.js";import"./chunk-jy451jg5.js";import"./chunk-0knxnyq6.js";import"./chunk-krt45cqy.js";import"./chunk-0t1yyn1d.js";import"./chunk-frp9fc7j.js";import"./chunk-t23kccpz.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as buildForProduction};
2
+ import{Xf as a}from"./chunk-7v1g7prf.js";import"./chunk-a4jhcbsh.js";import"./chunk-0knxnyq6.js";import"./chunk-krt45cqy.js";import"./chunk-0t1yyn1d.js";import"./chunk-frp9fc7j.js";import"./chunk-t23kccpz.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as buildForProduction};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Ze as a}from"./chunk-s5dwatkj.js";import"./chunk-jy451jg5.js";import"./chunk-0knxnyq6.js";import"./chunk-t23kccpz.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as startProductionServer};
2
+ import{Ze as a}from"./chunk-f72c62s7.js";import"./chunk-a4jhcbsh.js";import"./chunk-0knxnyq6.js";import"./chunk-t23kccpz.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as startProductionServer};
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-57kxjr4t.js";import"./chunk-4ce5ma6a.js";import"./chunk-7hb89n3z.js";import"./chunk-0smr2xjs.js";import"./chunk-801bg5d8.js";import"./chunk-s5dwatkj.js";import"./chunk-n0d7nwhd.js";import"./chunk-qrvey4wk.js";import"./chunk-nybn003d.js";import"./chunk-hy79zwyy.js";import"./chunk-rbfm5sjt.js";import"./chunk-jy451jg5.js";import"./chunk-0knxnyq6.js";import"./chunk-634gaa9d.js";import"./chunk-6yfccnr7.js";import"./chunk-tv04k7gq.js";import"./chunk-n1y0hjk1.js";import"./chunk-bcpjhcpn.js";import"./chunk-y4zddt5r.js";import"./chunk-g7bpkpd4.js";import"./chunk-k33778kc.js";import"./chunk-yg0qm73a.js";import"./chunk-g1vxsvqv.js";import"./chunk-3y8vvkar.js";import"./chunk-fqq5k9ve.js";import"./chunk-ya5m5vbn.js";import"./chunk-y4nzmkea.js";import"./chunk-7kw3grq5.js";import"./chunk-c79nfdyj.js";import"./chunk-ej8mv2k6.js";import"./chunk-dtdwjpvf.js";import"./chunk-ra1s4s6b.js";import"./chunk-79fj9zem.js";import"./chunk-krt45cqy.js";import"./chunk-0t1yyn1d.js";import"./chunk-3kd0zn9c.js";import"./chunk-ec8jsqgm.js";import"./chunk-wz4fnsat.js";import"./chunk-frp9fc7j.js";import{bl as u,cl as c}from"./chunk-degz74nv.js";import"./chunk-t23kccpz.js";import"./chunk-qjvny3wf.js";import"./chunk-3ssjb8cx.js";import{es as f}from"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import{Is as A}from"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import{Rw as B}from"./chunk-emjmshj8.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.356";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
3
+ import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-cf9gt3h9.js";import"./chunk-m0eg86q3.js";import"./chunk-7hb89n3z.js";import"./chunk-0smr2xjs.js";import"./chunk-f2jypsax.js";import"./chunk-f72c62s7.js";import"./chunk-n0d7nwhd.js";import"./chunk-qrvey4wk.js";import"./chunk-nybn003d.js";import"./chunk-hy79zwyy.js";import"./chunk-7v1g7prf.js";import"./chunk-a4jhcbsh.js";import"./chunk-0knxnyq6.js";import"./chunk-634gaa9d.js";import"./chunk-6yfccnr7.js";import"./chunk-tv04k7gq.js";import"./chunk-n1y0hjk1.js";import"./chunk-bcpjhcpn.js";import"./chunk-y4zddt5r.js";import"./chunk-g7bpkpd4.js";import"./chunk-k33778kc.js";import"./chunk-yg0qm73a.js";import"./chunk-g1vxsvqv.js";import"./chunk-3y8vvkar.js";import"./chunk-fqq5k9ve.js";import"./chunk-ya5m5vbn.js";import"./chunk-y4nzmkea.js";import"./chunk-7kw3grq5.js";import"./chunk-c79nfdyj.js";import"./chunk-ej8mv2k6.js";import"./chunk-dtdwjpvf.js";import"./chunk-ra1s4s6b.js";import"./chunk-79fj9zem.js";import"./chunk-krt45cqy.js";import"./chunk-0t1yyn1d.js";import"./chunk-3kd0zn9c.js";import"./chunk-ec8jsqgm.js";import"./chunk-wz4fnsat.js";import"./chunk-frp9fc7j.js";import{bl as u,cl as c}from"./chunk-degz74nv.js";import"./chunk-t23kccpz.js";import"./chunk-qjvny3wf.js";import"./chunk-3ssjb8cx.js";import{es as f}from"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import{Is as A}from"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import{Rw as B}from"./chunk-emjmshj8.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.357";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
4
4
  Test run interrupted`),j.kill("SIGINT"),w.exit(1)})})}catch(K){return console.error("Error running tests:",K instanceof Error?K.message:String(K)),!1}}var Qb=w.argv.length>=3&&(jb(w.argv[2])&&L.existsSync(w.argv[2])||V(w.argv[2]));if(Qb){let J=w.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let K=3;K<w.argv.length;K++){let x=w.argv[K];if(x==="--port"&&K+1<w.argv.length){let b=h(w.argv[++K]);if(!b.isValid)S(b);Z.port=Number.parseInt(w.argv[K],10)}else if(x==="--no-watch")Z.watch=!1;else if(x==="--highlight-theme"&&K+1<w.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=w.argv[++K]}else if(x==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(x==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(x==="--no-cache")Z.cache=!1;else if(x==="--native")Z.native=!0}if(V(J))try{let K=await Array.fromAsync(new Bun.Glob(J).scan({onlyFiles:!0,absolute:!0})),x=J.endsWith(".stx")?K.filter((j)=>j.endsWith(".stx")):J.endsWith(".md")?K.filter((j)=>j.endsWith(".md")):K.filter((j)=>j.endsWith(".stx")||j.endsWith(".md")),b=J.split("*")[0].replace(/\/$/,"")||".",z=$.resolve(b);try{let j=new Bun.Glob("**/*.stx"),H=(await Array.fromAsync(j.scan({cwd:z,onlyFiles:!0,absolute:!0}))).filter((U)=>/\[.+\]/.test($.basename(U)));for(let U of H)if(!x.includes(U))x.push(U)}catch{}if(x.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${J}`),w.exit(1);if(!await v(x,Z))w.exit(1)}catch(K){console.error("Failed to process files:",K),w.exit(1)}else F(J,Z).catch((K)=>{console.error("Failed to start dev server:",K),w.exit(1)})}else{let J=function(x,b){let z=[];for(let k=0;k<=b.length;k++)z[k]=[k];for(let k=0;k<=x.length;k++)z[0][k]=k;for(let k=1;k<=b.length;k++)for(let j=1;j<=x.length;j++)if(b.charAt(k-1)===x.charAt(j-1))z[k][j]=z[k-1][j-1];else z[k][j]=Math.min(z[k-1][j-1]+1,z[k][j-1]+1,z[k-1][j]+1);return z[b.length][x.length]};E.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(x)=>{try{if(await r(x))console.log("Documentation generated successfully."),w.exit(0);else console.error("Documentation generation failed."),w.exit(1)}catch(b){console.error("Error generating documentation:",b),w.exit(1)}}),E.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(x,b)=>{try{let{fetchCollections:z,generatePackage:k}=await import("./chunk-7jcntsp4.js");if(x==="list"){console.log(`
5
5
  \uD83D\uDCDA Fetching available icon collections...
6
6
  `);let j=await z(),W=Object.entries(j).sort((H,U)=>U[1].total-H[1].total);console.log(`Available collections:
@@ -69,7 +69,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
69
69
  File not found: ${x}`),w.exit(1);if(!x.endsWith(".stx"))console.error(`
70
70
  File must have .stx extension: ${x}`),w.exit(1)}let k=$.resolve(b.pages),j=$.resolve(b.out);if(!x&&!L.existsSync(k))console.error(`
71
71
  Pages directory not found: ${k}`),console.log(`
72
- Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-596cftgk.js");c();let H=await W({root:x?$.dirname(x):void 0,debug:b.verbose,ssg:{pagesDir:b.pages,outputDir:b.out,domain:b.domain,baseUrl:b.base,sitemap:b.sitemap,rss:b.rss,minify:b.minify,cache:b.cache!==!1,cleanOutput:b.clean,concurrency:Number.parseInt(b.concurrency,10)||10,publicDir:b.public,trailingSlash:b.trailingSlash,generate404:!0,hooks:b.verbose?{onPageStart:(Y)=>console.log(` Generating: ${Y}`),onPageEnd:(Y,Q)=>console.log(` Generated: ${Y} (${Q.length} bytes)`),onError:(Y,Q)=>console.error(` Error in ${Q}: ${Y.message}`)}:void 0},ssr:{outputDir:b.out==="dist"?".output":b.out,debug:b.verbose}}),U=((performance.now()-z)/1000).toFixed(2);if(H.mode==="ssr"&&H.ssr)console.log(`
72
+ Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-54w1tgzq.js");c();let H=await W({root:x?$.dirname(x):void 0,debug:b.verbose,ssg:{pagesDir:b.pages,outputDir:b.out,domain:b.domain,baseUrl:b.base,sitemap:b.sitemap,rss:b.rss,minify:b.minify,cache:b.cache!==!1,cleanOutput:b.clean,concurrency:Number.parseInt(b.concurrency,10)||10,publicDir:b.public,trailingSlash:b.trailingSlash,generate404:!0,hooks:b.verbose?{onPageStart:(Y)=>console.log(` Generating: ${Y}`),onPageEnd:(Y,Q)=>console.log(` Generated: ${Y} (${Q.length} bytes)`),onError:(Y,Q)=>console.error(` Error in ${Q}: ${Y.message}`)}:void 0},ssr:{outputDir:b.out==="dist"?".output":b.out,debug:b.verbose}}),U=((performance.now()-z)/1000).toFixed(2);if(H.mode==="ssr"&&H.ssr)console.log(`
73
73
  Build complete! (SSR)
74
74
  `),console.log(` Pages compiled: ${H.ssr.pageCount}`),console.log(` Output: ${H.ssr.outputDir}`),console.log(` Duration: ${U}s
75
75
  `);else if(H.ssg){if(console.log(`
@@ -84,7 +84,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
84
84
  Build completed with ${H.ssg.failedCount} error(s). Fix the issues above and try again.
85
85
  `),w.exit(1);console.log(" To preview locally:"),console.log(` cd ${b.out||"dist"} && npx serve
86
86
  `)}}catch(z){console.error(`
87
- Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-p1426yar.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){console.error(`
87
+ Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-xxrv2p42.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){console.error(`
88
88
  Failed to start production server:`,b instanceof Error?b.message:String(b)),w.exit(1)}}),E.command("deploy [directory]","Deploy built site to Netlify").option("--site-id <id>","Netlify site ID (or set NETLIFY_SITE_ID env var)").option("--token <token>","Auth token (or set NETLIFY_AUTH_TOKEN env var)").option("--production","Deploy to production (default: draft preview)").option("--message <msg>","Deploy message/title").option("--no-build","Skip build step before deploy").option("--open","Open deployed URL in browser").option("--dry-run","Preview deployment without uploading").option("--init","Initialize Netlify configuration for this project").example("stx deploy").example("stx deploy --production").example("stx deploy dist --site-id my-site-abc123").example("stx deploy --init").example("stx deploy --dry-run").action(async(x,b)=>{try{let{deploy:z,initNetlify:k,DeployError:j}=await import("./chunk-9qdn9y72.js");if(console.log(`\x1B[1mstx deploy\x1B[0m \x1B[2mv${N}\x1B[0m`),b.init){console.log(`
89
89
  \uD83D\uDCDD Initializing Netlify configuration...
90
90
  `);let H=await k({directory:x||w.cwd(),siteId:b.siteId});if(console.log(`\u2713 Created ${H.configPath}`),H.siteId)console.log("\u2713 Saved site ID to .env.local");console.log(`
@@ -124,7 +124,7 @@ To view it in the development server:`),console.log(` stx dev ${x}
124
124
  \uD83D\uDCDD ${$.relative(w.cwd(),Q)}:`),console.log("--- Original"),console.log("+++ Formatted"),console.log(`@@ Changes in ${$.basename(Q)} @@`),console.log("+ Formatted content would be applied");else await Bun.write(Q,q),console.log(`\u2705 Formatted ${$.relative(w.cwd(),Q)}`),U++}catch(X){console.error(`\u274C Error formatting ${$.relative(w.cwd(),Q)}:`,X),Y++}if(b.check&&Y>0)console.log(`
125
125
  ${Y} files need formatting. Run 'stx format' to fix.`),w.exit(1);else if(!b.check&&!b.diff)console.log(`\u2728 Formatted ${U} files successfully`)}catch(z){console.error("Error formatting files:",z),w.exit(1)}}),E.command("perf [command...]","Show performance statistics for STX operations").option("--clear","Clear performance statistics").option("--json","Output as JSON").example("stx perf").example("stx perf --clear").example("stx perf --json").action(async(x,b)=>{try{if(b.clear){A.clear(),console.log("\u2705 Performance statistics cleared");return}let z=A.getStats();if(Object.keys(z).length===0){if(b.json){console.log(JSON.stringify({},null,2));return}console.log("No performance data available. Run some STX commands first.");return}if(b.json)console.log(JSON.stringify(z,null,2));else{console.log(`
126
126
  \uD83D\uDCCA STX Performance Statistics
127
- `);for(let[k,j]of Object.entries(z))console.log(`\uD83D\uDD27 ${k}:`),console.log(` Count: ${j.count}`),console.log(` Average: ${j.avgTime.toFixed(2)}ms`),console.log(` Total: ${j.totalTime.toFixed(2)}ms`),console.log(` Min: ${j.minTime.toFixed(2)}ms`),console.log(` Max: ${j.maxTime.toFixed(2)}ms`),console.log("")}}catch(z){console.error("Error showing performance stats:",z),w.exit(1)}}),E.command("typecheck [patterns...]","Type-check the TypeScript inside .stx script blocks").option("--no-client","Skip <script client> and bare <script> blocks").option("--no-server","Skip <script server> blocks").option("--no-templates","Skip {{ }} and directive expressions in the markup").option("--lib <path>","Extra ambient declaration file (repeatable)").example("stx typecheck").example('stx typecheck "resources/views/**/*.stx"').action(async(x,b)=>{let{formatTypecheckDiagnostics:z,typecheckStxFiles:k}=await import("./chunk-kdmkk0rb.js"),{resolveStxTargets:j}=await import("./chunk-dpyc7pht.js"),W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx"],U=await j(H);if(U.length===0){console.log(`
127
+ `);for(let[k,j]of Object.entries(z))console.log(`\uD83D\uDD27 ${k}:`),console.log(` Count: ${j.count}`),console.log(` Average: ${j.avgTime.toFixed(2)}ms`),console.log(` Total: ${j.totalTime.toFixed(2)}ms`),console.log(` Min: ${j.minTime.toFixed(2)}ms`),console.log(` Max: ${j.maxTime.toFixed(2)}ms`),console.log("")}}catch(z){console.error("Error showing performance stats:",z),w.exit(1)}}),E.command("typecheck [patterns...]","Type-check the TypeScript inside .stx script blocks").option("--no-client","Skip <script client> and bare <script> blocks").option("--no-server","Skip <script server> blocks").option("--no-templates","Skip {{ }} and directive expressions in the markup").option("--lib <path>","Extra ambient declaration file (repeatable)").example("stx typecheck").example('stx typecheck "resources/views/**/*.stx"').action(async(x,b)=>{let{formatTypecheckDiagnostics:z,typecheckStxFiles:k}=await import("./chunk-5x0zjm34.js"),{resolveStxTargets:j}=await import("./chunk-dpyc7pht.js"),W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx"],U=await j(H);if(U.length===0){console.log(`
128
128
  No .stx files matched ${H.join(", ")}
129
129
  `);return}let Y=m(w.argv,"--lib"),Q=Y.length>0?Y:b.lib?Array.isArray(b.lib)?b.lib:[b.lib]:[],X=await k(U,{client:b.client!==!1,server:b.server!==!1,templates:b.templates!==!1,extraLibs:Q});if(X.failure)console.error(`
130
130
  Type-check did not run.
@@ -0,0 +1,17 @@
1
+ /** The nearest `tsconfig.json` at or above `startDir`. */
2
+ export declare function findNearestTsconfig(startDir: string, exists: (file: string) => boolean): string | undefined;
3
+ /**
4
+ * The stx plugin entry governing files under `startDir`, following `extends`.
5
+ *
6
+ * Only relative `extends` are followed; a package base (`@tsconfig/…`) does not
7
+ * carry an app's stx configuration.
8
+ */
9
+ export declare function findStxPluginEntry(startDir: string, read: ReadConfig, exists: (file: string) => boolean): StxPluginEntry | undefined;
10
+ /** The name the stx TypeScript plugin is contributed and configured under. */
11
+ export declare const STX_TS_PLUGIN_NAME: '@stacksjs/stx-typescript-plugin';
12
+ export declare interface StxPluginEntry {
13
+ configPath: string
14
+ libs: string[]
15
+ }
16
+ /** Read a tsconfig file as an object, or undefined when it cannot be read. */
17
+ export type ReadConfig = (file: string) => Record<string, any> | undefined;
@@ -0,0 +1,42 @@
1
+ import path from "node:path";
2
+ export const STX_TS_PLUGIN_NAME = "@stacksjs/stx-typescript-plugin";
3
+ export function findNearestTsconfig(startDir, exists) {
4
+ let dir = path.resolve(startDir);
5
+ for (;; ) {
6
+ const candidate = path.join(dir, "tsconfig.json");
7
+ if (exists(candidate))
8
+ return candidate;
9
+ const parent = path.dirname(dir);
10
+ if (parent === dir)
11
+ return;
12
+ dir = parent;
13
+ }
14
+ }
15
+ export function findStxPluginEntry(startDir, read, exists) {
16
+ const leaf = findNearestTsconfig(startDir, exists);
17
+ if (!leaf)
18
+ return;
19
+ const seen = new Set, visit = (configPath) => {
20
+ if (seen.has(configPath))
21
+ return;
22
+ seen.add(configPath);
23
+ const config = read(configPath);
24
+ if (!config)
25
+ return;
26
+ const plugins = config.compilerOptions?.plugins;
27
+ if (Array.isArray(plugins)) {
28
+ const entry = plugins.find((plugin) => plugin?.name === STX_TS_PLUGIN_NAME), libs = Array.isArray(entry?.libs) ? entry.libs.filter((lib) => typeof lib === "string") : [];
29
+ return entry ? { configPath, libs: libs.map((lib) => path.resolve(path.dirname(configPath), lib)) } : null;
30
+ }
31
+ const bases = typeof config.extends === "string" ? [config.extends] : Array.isArray(config.extends) ? config.extends : [];
32
+ for (const base of [...bases].reverse()) {
33
+ if (typeof base !== "string" || !base.startsWith("."))
34
+ continue;
35
+ const resolved = path.resolve(path.dirname(configPath), base.endsWith(".json") ? base : `${base}.json`), found = visit(resolved);
36
+ if (found !== void 0)
37
+ return found;
38
+ }
39
+ return;
40
+ };
41
+ return visit(leaf) ?? void 0;
42
+ }
package/dist/typecheck.js CHANGED
@@ -20,6 +20,7 @@ import {
20
20
  substituteInterpolationsInPlace
21
21
  } from "./stx-virtual-ts.js";
22
22
  import { stxImportDiagnostics } from "./stx-module-imports.js";
23
+ import { findStxPluginEntry } from "./stx-plugin-config.js";
23
24
  export {
24
25
  extractScriptBlocks,
25
26
  extractTemplateExpressions
@@ -101,6 +102,51 @@ const TSC_LINE_RE = /^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$
101
102
  function isSyntactic(code) {
102
103
  return code >= 1000 && code < 2000;
103
104
  }
105
+ function stripJsonc(text) {
106
+ let out = "", inString = !1, escaped = !1;
107
+ for (let i = 0;i < text.length; i++) {
108
+ const c = text[i];
109
+ if (inString) {
110
+ out += c;
111
+ if (escaped)
112
+ escaped = !1;
113
+ else if (c === "\\")
114
+ escaped = !0;
115
+ else if (c === '"')
116
+ inString = !1;
117
+ continue;
118
+ }
119
+ if (c === '"') {
120
+ inString = !0;
121
+ out += c;
122
+ continue;
123
+ }
124
+ if (c === "/" && text[i + 1] === "/") {
125
+ while (i < text.length && text[i] !== `
126
+ `)
127
+ i++;
128
+ out += `
129
+ `;
130
+ continue;
131
+ }
132
+ if (c === "/" && text[i + 1] === "*") {
133
+ i += 2;
134
+ while (i < text.length && !(text[i] === "*" && text[i + 1] === "/"))
135
+ i++;
136
+ i++;
137
+ continue;
138
+ }
139
+ out += c;
140
+ }
141
+ return out.replace(/,(\s*[}\]])/g, "$1");
142
+ }
143
+ function readJsoncConfig(file) {
144
+ try {
145
+ return JSON.parse(stripJsonc(readFileSync(file, "utf8")));
146
+ } catch {
147
+ return;
148
+ }
149
+ }
104
150
  function readProjectPathAliases(startDir) {
105
151
  let dir = path.resolve(startDir), configPath;
106
152
  for (;; ) {
@@ -116,44 +162,7 @@ function readProjectPathAliases(startDir) {
116
162
  }
117
163
  if (!configPath)
118
164
  return {};
119
- const stripJsonc = (text) => {
120
- let out = "", inString = !1, escaped = !1;
121
- for (let i = 0;i < text.length; i++) {
122
- const c = text[i];
123
- if (inString) {
124
- out += c;
125
- if (escaped)
126
- escaped = !1;
127
- else if (c === "\\")
128
- escaped = !0;
129
- else if (c === '"')
130
- inString = !1;
131
- continue;
132
- }
133
- if (c === '"') {
134
- inString = !0;
135
- out += c;
136
- continue;
137
- }
138
- if (c === "/" && text[i + 1] === "/") {
139
- while (i < text.length && text[i] !== `
140
- `)
141
- i++;
142
- out += `
143
- `;
144
- continue;
145
- }
146
- if (c === "/" && text[i + 1] === "*") {
147
- i += 2;
148
- while (i < text.length && !(text[i] === "*" && text[i + 1] === "/"))
149
- i++;
150
- i++;
151
- continue;
152
- }
153
- out += c;
154
- }
155
- return out.replace(/,(\s*[}\]])/g, "$1");
156
- }, seen = new Set;
165
+ const seen = new Set;
157
166
  let current = configPath, paths, baseUrl, owner = configPath;
158
167
  while (current && !seen.has(current)) {
159
168
  seen.add(current);
@@ -233,7 +242,10 @@ export async function typecheckStxFiles(files, options = {}) {
233
242
  }
234
243
  if (virtualFiles.size === 0)
235
244
  return { diagnostics: importDiagnostics, checkedFiles, blockCount: 0, expressionCount: 0 };
236
- const ambient = (options.extraLibs ?? []).map((lib) => path.resolve(lib));
245
+ const ambient = (options.extraLibs ?? []).map((lib) => path.resolve(lib)), pluginEntry = findStxPluginEntry(files.length > 0 ? path.dirname(path.resolve(files[0])) : process.cwd(), readJsoncConfig, existsSync);
246
+ for (const lib of pluginEntry?.libs ?? [])
247
+ if (!ambient.includes(lib) && existsSync(lib))
248
+ ambient.push(lib);
237
249
  if (runtimeTypes)
238
250
  ambient.push(runtimeTypes);
239
251
  const stxModule = runtimeTypes ? findStxModuleDeclarations() : null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.356",
4
+ "version": "0.2.357",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -118,12 +118,12 @@
118
118
  "dependencies": {
119
119
  "@stacksjs/ts-css": "^0.3.2",
120
120
  "@stacksjs/clapp": "^0.2.16",
121
- "@stacksjs/desktop": "0.2.356",
122
- "@stacksjs/sanitizer": "0.2.356",
121
+ "@stacksjs/desktop": "0.2.357",
122
+ "@stacksjs/sanitizer": "0.2.357",
123
123
  "@stacksjs/ts-i18n": "^0.1.11",
124
- "bun-plugin-stx": "0.2.356",
124
+ "bun-plugin-stx": "0.2.357",
125
125
  "bunfig": "^0.15.19",
126
- "stx-router": "0.2.356",
126
+ "stx-router": "0.2.357",
127
127
  "ts-broadcasting": "^0.0.10",
128
128
  "ts-images": "^0.2.22",
129
129
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,20 +0,0 @@
1
- // @bun
2
- import{fi as YH}from"./chunk-3y8vvkar.js";import{Do as i,Lp as g,Mp as ZH,Np as $H,Qp as jH,Rp as zH,Sp as JH,Tp as qH,Up as WH,Vp as VH,Wp as AH,Xp as GH,Yp as UH,am as QH,wr as FH}from"./chunk-3ssjb8cx.js";import{rt as u}from"./chunk-ejwfnttb.js";import{zv as x}from"./chunk-aa8015mk.js";import{existsSync as MH,readFileSync as XH}from"fs";import q from"path";var RH=new Set(["module","exports","require","$bool","window","document","console","confirm","alert","fetch"]),t=i.filter((Q)=>!RH.has(Q)).sort(),e=[...x].sort(),yH=[...new Set([...t,...e])].sort(),OH=new Set(t),PH=new Set(e),_H=new Set(yH),s=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function EH(Q,K){if(K==="server")return`'${Q}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${Q}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${Q}', so it is undefined in the browser.`}function HH(Q,K){let z=[];for(let A of K){if(A.offset===void 0)continue;let X=A.kind==="server"?OH:PH;s.lastIndex=0;for(let J of A.code.matchAll(s)){let G=J.index+J[0].indexOf("{")+1;for(let V of J[1].matchAll(/[^,]+/g)){let B=V[0];if(/^\s*type\s/.test(B))continue;let I=/^\s*([A-Za-z_$][\w$]*)/.exec(B);if(!I)continue;let M=I[1];if(!_H.has(M)||X.has(M))continue;let Z=A.offset+G+V.index+I[0].length-M.length,$=Q.slice(0,Z),U=$.split(`
3
- `).length;z.push({line:U,column:Z-($.lastIndexOf(`
4
- `)+1)+1,offset:Z,length:M.length,name:M,kind:A.kind,message:EH(M,A.kind)})}}}return z}function DH(Q,K="",z=""){let A=Q.startLine>1?`
5
- `.repeat(Q.startLine-1):"",X=VH(Q)+$H(ZH(Q.code)),J=Q.kind==="client"||Q.kind==="plain"?JH(K,Q.code):"";return WH(`${A+X}
6
- ${J}
7
- export {}
8
- `,z)}var xH=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function SH(Q){if(Q.length===0)return"";let K=["// Generated \u2014 the composables the runtime publishes as bare globals."],z=new Set(x),A=[];for(let{file:X,names:J}of Q){let G=JSON.stringify(X.replace(/\\/g,"/").replace(/\.ts$/,""));A.push(` export * from ${G}`);for(let V of J){if(z.has(V)||xH.has(V))continue;z.add(V),K.push(`declare const ${V}: typeof import(${G})[${JSON.stringify(V)}]`)}}return K.push("declare module '@composables' {",...A,"}"),K.join(`
9
- `)}function KH(Q,K,z){return`${Q}.__stx_${K}${z}.ts`}function eH(Q){return Q.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function TH(){return LH("stx.d.ts")}function gH(){return LH("stx-module.d.ts")}function LH(Q){for(let K of[q.resolve(import.meta.dir,"..",Q),q.resolve(import.meta.dir,"..","..",Q)])if(MH(K))return K;return null}var hH=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function fH(Q){return Q>=1000&&Q<2000}function kH(Q){let K=q.resolve(Q),z;for(;;){let Z=q.join(K,"tsconfig.json");if(MH(Z)){z=Z;break}let $=q.dirname(K);if($===K)break;K=$}if(!z)return{};let A=(Z)=>{let $="",U=!1,N=!1;for(let W=0;W<Z.length;W++){let L=Z[W];if(U){if($+=L,N)N=!1;else if(L==="\\")N=!0;else if(L==='"')U=!1;continue}if(L==='"'){U=!0,$+=L;continue}if(L==="/"&&Z[W+1]==="/"){while(W<Z.length&&Z[W]!==`
10
- `)W++;$+=`
11
- `;continue}if(L==="/"&&Z[W+1]==="*"){W+=2;while(W<Z.length&&!(Z[W]==="*"&&Z[W+1]==="/"))W++;W++;continue}$+=L}return $.replace(/,(\s*[}\]])/g,"$1")},X=new Set,J=z,G,V,B=z;while(J&&!X.has(J)){X.add(J);let Z;try{Z=JSON.parse(A(XH(J,"utf8")))}catch{break}let $=Z?.compilerOptions??{};if(!G&&$.paths&&typeof $.paths==="object")G=$.paths,B=J;if(!V&&typeof $.baseUrl==="string")V=q.resolve(q.dirname(J),$.baseUrl);if(G&&V)break;J=typeof Z?.extends==="string"?q.resolve(q.dirname(J),Z.extends.endsWith(".json")?Z.extends:`${Z.extends}.json`):void 0}if(!G)return{};let I=V??q.dirname(B),M={};for(let[Z,$]of Object.entries(G)){if(!Array.isArray($))continue;M[Z]=$.map((U)=>typeof U==="string"&&!q.isAbsolute(U)?q.resolve(I,U):U)}return{paths:M}}async function HK(Q,K={}){let z=K.client!==!1,A=K.server!==!1,X=K.templates!==!1,J=K.componentsDir??(X?(await FH()).componentsDir:void 0),G=new Map,V=new Map,B=[],I=[],M=0,Z=0,$=TH();for(let H of Q){let Y=await Bun.file(H).text(),F=g(Y).filter((j)=>{if(j.kind==="server")return A;return z}),w=g(Y).filter((j)=>j.kind==="server").map((j)=>j.code).join(`
12
- `);for(let j of HH(Y,F))B.push({file:H,line:j.line,column:j.column,code:0,message:j.message,category:"error",blockKind:j.kind});if(z&&w){let j=F.filter((y)=>y.kind!=="server"),R=[...new Set(j.flatMap((y)=>qH(w,y.code)))];if(R.length>0)V.set(H,{names:R,line:j[0].startLine,kind:j[0].kind})}let v=q.dirname(q.resolve(H)),C=X?AH(Y,{runtimeGlobals:!$,originDir:v,filePath:q.resolve(H),componentsDir:J}):null,_=C?[...C.lineMap.values()].filter((j)=>j.expression).length:0;if(F.length===0&&_===0)continue;if(I.push(H),M+=F.length,Z+=_,F.forEach((j,R)=>{G.set(KH(H,j.kind,R),{source:DH(j,w,v),origin:H,kind:j.kind})}),C&&_>0)G.set(KH(H,"template",0),{source:C.text,origin:H,kind:"template",virtual:C})}if(G.size===0)return{diagnostics:B,checkedFiles:I,blockCount:0,expressionCount:0};let U=(K.extraLibs??[]).map((H)=>q.resolve(H));if($)U.push($);let N=$?gH():null;if(N)U.push(N);let W=`${u()}/typecheck/__stx_globals.d.ts`,L=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",jH($?zH(XH($,"utf8")):void 0),...$?[]:["declare const window: any",...x.map((H)=>`declare const ${H}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...QH.map((H)=>`declare const ${H}: any`)].join(`
13
- `),SH(await YH())].filter(Boolean).join(`
14
- `),O=`${u()}/typecheck`;await Bun.$`rm -rf ${O}`.quiet().nothrow(),await Bun.$`mkdir -p ${O}`.quiet().nothrow(),await Bun.write(W,L);let P=new Map,BH=0;for(let[H,Y]of G){let F=`${BH++}_${H.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${O}/${F}`,Y.source),P.set(F,Y)}let IH={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...kH(Q.length>0?q.dirname(q.resolve(Q[0])):process.cwd()),...K.compilerOptions??{}},b=async(H,Y)=>{let F=`${O}/tsconfig${Y===1?"":`.${Y}`}.json`;await Bun.write(F,JSON.stringify({compilerOptions:IH,files:H.map((v)=>`${O}/${v}`).concat(W,...U)},null,2));let w=Bun.spawnSync(["bun","x","tsc","-p",F,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(w.stdout)+new TextDecoder().decode(w.stderr),exitCode:w.exitCode??0}},m=await b([...P.keys()],1),p=m.output,S=[],d=m.exitCode,l=0,wH=new Set(U.map((H)=>H.split("/").pop())),c=0,T=new Set,n=(H)=>{for(let Y of H.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
15
- `)){let F=Y.match(hH);if(!F)continue;if(l++,wH.has(F[1].split("/").pop()))c++;let[,w,v,C,_,j,R]=F,y=w.split("/").pop(),E=P.get(y);if(!E)continue;if(fH(Number(j)))T.add(y);let f=Number(v),k=Number(C),a;if(E.virtual){let D=UH(E.virtual,f,k);if(!D?.expression)continue;if(GH(D,Number(j)))continue;f=D.line,k=D.column,a=D.expression.code.trim()}S.push({file:E.origin,line:f,column:k,code:Number(j),message:R,category:_==="error"?"error":"warning",blockKind:E.kind,expression:a})}};n(p);let CH=l,NH=c;if(T.size>0&&T.size<P.size){let H=[...P.keys()].filter((Y)=>!T.has(Y));n((await b(H,2)).output)}if(z)for(let[H,Y]of V){if(Y.names.length===0)continue;S.push({file:H,line:Y.line,column:1,code:0,message:`${Y.names.length===1?"1 value reaches":`${Y.names.length} values reach`} this block on the implicit bridge and ${Y.names.length===1?"is":"are"} untyped: ${Y.names.join(", ")}. Declare them with defineClientPayload({ ${Y.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:Y.kind})}S.push(...B);let r=new Set,h=S.filter((H)=>{let Y=`${H.file}:${H.line}:${H.column}:${H.code}:${H.message}`;if(r.has(Y))return!1;return r.add(Y),!0});h.sort((H,Y)=>H.file.localeCompare(Y.file)||H.line-Y.line||H.column-Y.column);let o=NH>0&&h.length===0,vH=o||d!==0&&CH===0?`${o?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${d} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
16
- ${p.trim().split(`
17
- `).slice(0,12).join(`
18
- `)||"(no output)"}`:void 0;return{diagnostics:h,checkedFiles:I,blockCount:M,expressionCount:Z,failure:vH}}function KK(Q){return Q.map((K)=>{let z=K.blockKind==="template"?`[template: ${K.expression??""}]`:`[${K.blockKind==="plain"?"<script>":`<script ${K.blockKind}>`}]`;return`${K.file}:${K.line}:${K.column} ${K.category} TS${K.code} ${K.message} ${z}`}).join(`
19
- `)}
20
- export{DH as Le,KH as Me,eH as Ne,TH as Oe,gH as Pe,HK as Qe,KK as Re};