@stacksjs/stx 0.2.834 → 0.2.836
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.
- package/dist/{chunk-mya2g8sn.js → chunk-0ee6a69c.js} +1 -1
- package/dist/{chunk-zb7kfwac.js → chunk-14dmmthm.js} +1 -1
- package/dist/{chunk-0mrzdsh5.js → chunk-1av9cx4h.js} +1 -1
- package/dist/{chunk-rfdwn0k3.js → chunk-1rgex0bn.js} +5 -5
- package/dist/{chunk-qdagsy5b.js → chunk-2b25kjyx.js} +1 -1
- package/dist/{chunk-9n14m2gn.js → chunk-3sty93sy.js} +1 -1
- package/dist/{chunk-kzvt88tk.js → chunk-6c3wj83w.js} +1 -1
- package/dist/{chunk-npn692c4.js → chunk-71vj7v61.js} +1 -1
- package/dist/{chunk-qbvy23qa.js → chunk-7kzxmm80.js} +6 -6
- package/dist/{chunk-vnk6gt0t.js → chunk-876qk7ct.js} +1 -1
- package/dist/{chunk-ddtk57fy.js → chunk-8dr42g11.js} +1 -1
- package/dist/{chunk-pt8nft3k.js → chunk-8p9bphp5.js} +1 -1
- package/dist/{chunk-0mb3jch4.js → chunk-8tktmm5d.js} +1 -1
- package/dist/{chunk-zsdqsky6.js → chunk-8xmm692p.js} +1 -1
- package/dist/{chunk-3w8kt53x.js → chunk-91qky0er.js} +2 -2
- package/dist/{chunk-5379q74v.js → chunk-92j6qkbh.js} +1 -1
- package/dist/{chunk-dvyysszs.js → chunk-944tcqgg.js} +4 -4
- package/dist/{chunk-jmk1ze6r.js → chunk-9gg6hm3q.js} +1 -1
- package/dist/{chunk-y47n1j5x.js → chunk-9wsrkcyw.js} +2 -2
- package/dist/{chunk-rtj900pa.js → chunk-a20xgjzx.js} +1 -1
- package/dist/{chunk-dgqp0pjn.js → chunk-c3n6rbr8.js} +1 -1
- package/dist/{chunk-fc5zj6qg.js → chunk-c7hw37ww.js} +1 -1
- package/dist/{chunk-v1wgp7ep.js → chunk-cjna1thj.js} +1 -1
- package/dist/{chunk-v4kenb7z.js → chunk-cyd6s7tj.js} +1 -1
- package/dist/{chunk-x57x0yq7.js → chunk-d6twwydm.js} +2 -2
- package/dist/{chunk-ecmvq302.js → chunk-d85fvcf5.js} +2 -2
- package/dist/{chunk-cddzcckm.js → chunk-d9m9azzk.js} +4 -4
- package/dist/chunk-dcsg4h3n.js +2 -0
- package/dist/{chunk-55k7m9cp.js → chunk-dq9mrthz.js} +1 -1
- package/dist/{chunk-99ddfv0b.js → chunk-ek3gqadc.js} +1 -1
- package/dist/{chunk-4g6v5qsp.js → chunk-eydfzmdj.js} +1 -1
- package/dist/{chunk-z2e06633.js → chunk-fn0419dn.js} +1 -1
- package/dist/chunk-fxc0q5g6.js +2 -0
- package/dist/{chunk-k46pfdmn.js → chunk-h12ekfb7.js} +1 -1
- package/dist/chunk-hf8750kf.js +2 -0
- package/dist/{chunk-ga2k1rga.js → chunk-hrzef4vb.js} +1 -1
- package/dist/{chunk-cy3c4yxg.js → chunk-hzp3yf39.js} +1 -1
- package/dist/{chunk-3f1ks1ah.js → chunk-kkvyy9an.js} +1 -1
- package/dist/{chunk-b3s8tb18.js → chunk-mpd57aqc.js} +1 -1
- package/dist/{chunk-v53kdjz6.js → chunk-nzybzbh4.js} +1 -1
- package/dist/chunk-pb1f52s7.js +2 -0
- package/dist/{chunk-1qgzexkc.js → chunk-pj904eyr.js} +4 -4
- package/dist/{chunk-srb0qmgx.js → chunk-pkxy74j9.js} +1 -1
- package/dist/{chunk-srqk1nxc.js → chunk-qq19g7e2.js} +1 -1
- package/dist/{chunk-913grzaj.js → chunk-s5g6gtz3.js} +1 -1
- package/dist/chunk-s5gt7k23.js +2 -0
- package/dist/chunk-t02y9hrh.js +2 -0
- package/dist/{chunk-3tn9tb9w.js → chunk-tc7s3tny.js} +4 -4
- package/dist/{chunk-t33fttx9.js → chunk-tj24x37q.js} +1 -1
- package/dist/{chunk-xvmn976f.js → chunk-v8mh2xvp.js} +1 -1
- package/dist/chunk-vdyvtnbs.js +2 -0
- package/dist/{chunk-6j2aea05.js → chunk-vjh6va50.js} +1 -1
- package/dist/{chunk-g3xbwz51.js → chunk-vrptmxvt.js} +1 -1
- package/dist/{chunk-5gqjhq31.js → chunk-vxmfeys6.js} +1 -1
- package/dist/{chunk-q46ay7aq.js → chunk-w0a6yz73.js} +4 -4
- package/dist/{chunk-b0z85f8h.js → chunk-we6yqv3w.js} +1 -1
- package/dist/{chunk-xqy8y5dc.js → chunk-we7cc5x7.js} +1 -1
- package/dist/{chunk-qfcabz87.js → chunk-wsaann3r.js} +2 -2
- package/dist/{chunk-xd9t20sx.js → chunk-xa8jn2ym.js} +1 -1
- package/dist/chunk-xg852k9h.js +3 -0
- package/dist/chunk-xvwpc56h.js +2 -0
- package/dist/chunk-y8ban8z2.js +2 -0
- package/dist/{chunk-e7ssdryq.js → chunk-yjp3bggk.js} +1 -1
- package/dist/{chunk-0z7w8e0s.js → chunk-z9rm4rcv.js} +1 -1
- package/dist/{chunk-7h5rt22w.js → chunk-zbnxrj3b.js} +2 -2
- package/dist/{chunk-gnt1v0kc.js → chunk-zwgxnjmx.js} +3 -3
- package/dist/cli.js +8 -8
- package/dist/client/signals-class-runtime.js +1 -1
- package/dist/client/signals-native-row-runtime.js +3 -3
- package/dist/component-image-usage.js +7 -3
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-0c8fqfan.js +0 -3
- package/dist/chunk-4f2zy3y6.js +0 -2
- package/dist/chunk-523s4p08.js +0 -2
- package/dist/chunk-brk1pk8w.js +0 -2
- package/dist/chunk-db7p6bc4.js +0 -2
- package/dist/chunk-ee147ezb.js +0 -2
- package/dist/chunk-g5jfb1ms.js +0 -2
- package/dist/chunk-k4hjqfx1.js +0 -2
- package/dist/chunk-q1cfc2fp.js +0 -2
- package/dist/chunk-xxyhzsqx.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Sn,Si}from"./chunk-
|
|
2
|
+
import{Sn,Si}from"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";export{Si as generateRuntimeConfigTypes,Sn as prepareRuntimeConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ih,Nf,Ye,cc,Oh,as,cs,ls}from"./chunk-
|
|
2
|
+
import{Ih,Nf,Ye,cc,Oh,as,cs,ls}from"./chunk-d9m9azzk.js";import"./chunk-71vj7v61.js";import"./chunk-xg852k9h.js";import"./chunk-3bjnrmha.js";import"./chunk-ya6bp08c.js";import"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{Oh as clearOnceStore,cc as onceStore,Ye as partialsCache,as as processIncludes,cs as processStackPushDirectives,ls as processStackReplacements,Ih as resetUnscopedSignalWarnings,Nf as topLevelElements};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Mf,ds}from"./chunk-
|
|
2
|
+
import{Mf,ds}from"./chunk-71vj7v61.js";import"./chunk-xg852k9h.js";import"./chunk-3bjnrmha.js";import"./chunk-ya6bp08c.js";import{_r}from"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import{ot}from"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{ot as freeIdentifiers,ds as processComponents,Mf as processESImports,_r as rendersAsElement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rf,ic,Rh,ac,Af,Pf,ln,ir,Ah,If,Of,Ph,b}from"./chunk-
|
|
2
|
+
import{Rf,ic,Rh,ac,Af,Pf,ln,ir,Ah,If,Of,Ph,b}from"./chunk-9wsrkcyw.js";import"./chunk-eydfzmdj.js";import"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{ln as buildCss,If as extractClassNames,Pf as fingerprintConfig,Of as generateCss,Ah as getCachedCSS,Rf as getCssServeAsset,b as injectCss,ic as loadCssEngine,ac as loadCssEngineConfig,ir as rebuildCss,Rh as resetCssCache,Af as resolveUserCssConfig,Ph as withLinkedModuleBundles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ah,wo,ch,lh,uh,dh}from"./chunk-3sty93sy.js";import"./chunk-8dr42g11.js";import"./chunk-cyd6s7tj.js";import"./chunk-tx8wk6h7.js";import"./chunk-91qky0er.js";import"./chunk-944tcqgg.js";import"./chunk-ya6bp08c.js";import"./chunk-d85fvcf5.js";import"./chunk-qq19g7e2.js";import"./chunk-gh62p9mx.js";import"./chunk-amg6kr1p.js";import"./chunk-ms3v5nat.js";import"./chunk-29f6vmyz.js";import"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{dh as clearStoreCache,ah as getStoreScript,uh as getStoreScriptFor,lh as pageStoresAll,wo as storesRead,ch as storesReadInFiles};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{jt,ae,A,u,f,P,t,ce,K,l,_e,Ci,z,_n,Ei,zt,Ti,il,Rr,al,at,cl,Ar,ll,Cn,$i,ul,Pr,Or,Ce,Ri}from"./chunk-txd2js5v.js";import{li,Ac,o,C,Ne,fn,gn,Me,fe,J,xr,mn,Fs,Fc,zc,yn,Cr,Hs,Vs,Hc,mi,Vc,Uc,Wc,qc,Le,je,Us,ze,s,vn,h,p,W,Q,ke,_}from"./chunk-
|
|
2
|
+
import{jt,ae,A,u,f,P,t,ce,K,l,_e,Ci,z,_n,Ei,zt,Ti,il,Rr,al,at,cl,Ar,ll,Cn,$i,ul,Pr,Or,Ce,Ri}from"./chunk-txd2js5v.js";import{li,Ac,o,C,Ne,fn,gn,Me,fe,J,xr,mn,Fs,Fc,zc,yn,Cr,Hs,Vs,Hc,mi,Vc,Uc,Wc,qc,Le,je,Us,ze,s,vn,h,p,W,Q,ke,_}from"./chunk-7kzxmm80.js";import{Lt}from"./chunk-vfj9wp11.js";import{Sn}from"./chunk-2b25kjyx.js";import{b}from"./chunk-9wsrkcyw.js";import{mr,Ps}from"./chunk-29f6vmyz.js";import{gc,mc,pr,et,hc,O}from"./chunk-d85fvcf5.js";import{ei,ti,ni,ri}from"./chunk-ms3v5nat.js";import{lc,ds}from"./chunk-71vj7v61.js";import{as,cs,ls}from"./chunk-d9m9azzk.js";import{ms,qo,Ko,hs,ys,Xo}from"./chunk-91qky0er.js";import{ps,zo}from"./chunk-14dmmthm.js";import{Lo}from"./chunk-s33andzg.js";import{oe,Ho,Vo,Uo}from"./chunk-3bjnrmha.js";import{cr,we,dc,lr,pc}from"./chunk-944tcqgg.js";import{B,Ze}from"./chunk-ybq56wam.js";import{yc,bc}from"./chunk-qq19g7e2.js";import{E,En,Ai}from"./chunk-jr0r5pzw.js";import Kn from"fs";import ie from"path";function dt(n){let e=fn(n),c=e.find((x)=>x.closing&&x.name.toLowerCase()==="head");if(!c)return n;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),g=0,r=[];for(let x=0;x<e.length;x++){let w=e[x];if(w.start<c.end)continue;let v=w.name.toLowerCase();if(a.has(v)){g=Math.max(0,g+(w.closing?-1:w.selfClosing?0:1));continue}if(v!=="style"||w.closing||g>0)continue;let k=e[x+1];if(k?.name.toLowerCase()==="style"&&k.closing){if(/@scope\s*\{/.test(n.slice(w.end,k.start)))continue;r.push({start:w.start,end:k.end}),x++}}if(!r.length)return n;let d=r.map((x)=>n.slice(x.start,x.end)).join(`
|
|
3
3
|
`),y=[n.slice(0,c.start),d,`
|
|
4
4
|
`],m=c.start;for(let x of r)y.push(n.slice(m,x.start)),m=x.end;return y.push(n.slice(m)),y.join("")}function pt(){return`
|
|
5
5
|
// STX Lifecycle Runtime
|
|
@@ -1295,7 +1295,7 @@ ${R}
|
|
|
1295
1295
|
</style>`;a=a.replace(x,D),y.lastIndex=0}catch(R){}}}return a}import it from"path";var Wn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Xn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function zn(n,e){if(!e||!n.includes("/"))return n;let c=it.dirname(e);return n.replace(Wn,(a,g,r,d)=>{let y=it.resolve(c,d);return`${g}${r}${y.split(it.sep).join("/")}${r}`})}function ur(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Xn,(c,a,g,r)=>`${a}${zn(g,e)}${r}`)}var Ee="<!--PARENT_CONTENT_PLACEHOLDER-->";function dr(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function vr(n,e){let c=n.length,a=e,g=!0,r=[],d=(y)=>y+9<=c&&n[y]==="<"&&n[y+1]==="/"&&(n[y+2]==="s"||n[y+2]==="S")&&(n[y+3]==="c"||n[y+3]==="C")&&(n[y+4]==="r"||n[y+4]==="R")&&(n[y+5]==="i"||n[y+5]==="I")&&(n[y+6]==="p"||n[y+6]==="P")&&(n[y+7]==="t"||n[y+7]==="T")&&(n[y+8]===">"||/\s/.test(n[y+8]));while(a<c){let y=n[a];if(d(a))return a;if(y==="/"&&n[a+1]==="/"){if(a=n.indexOf(`
|
|
1296
1296
|
`,a+2),a===-1)return-1;a+=1,g=!0;continue}if(y==="/"&&n[a+1]==="*"){let m=n.indexOf("*/",a+2);if(m===-1)return-1;a=m+2,g=!0;continue}if(y==="/"&&g){let m=a+1,x=!1;while(m<c){let w=n[m];if(w==="\\"){m+=2;continue}if(w==="[")x=!0;else if(w==="]")x=!1;else if(w==="/"&&!x){m++;break}else if(w===`
|
|
1297
1297
|
`){m=-1;break}m++}if(m===-1){a++,g=!1;continue}while(m<c&&/[a-z]/.test(n[m]))m++;a=m,g=!1;continue}if(y==="'"||y==='"'){let m=y;a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]===m){a++;break}if(n[a]===`
|
|
1298
|
-
`)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(y==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function kr(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function ot(n,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-
|
|
1298
|
+
`)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(y==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function kr(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function ot(n,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-6c3wj83w.js");return`<script ${n} src="${a(e)}"></script>`}async function rr(n,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-9gg6hm3q.js")),d=[],y=await r(g(...n),{minify:Ai(e.buildMode,e.minifyClient),collectInputs:d});for(let m of d)c?.add(m);if(a)a.inputs=d,a.code=y??void 0;if(!y)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:m}=await import("./chunk-6c3wj83w.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${m(y)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Zn(n,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-we6yqv3w.js"));g.frameworkScript=await k(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-pb1f52s7.js"))}catch{}let d=e.storesDir,y=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),m=y?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",T=!1;try{if(r){let N=y?await r.getStoreScript(d).then((F)=>F?{code:F,stores:["*"],functions:null}:null):await r.getStoreScriptFor(d,[m],{reads:r.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),T=!!N.functions&&!y}}catch{}if(v!==null&&M===v)break;v=M;let R=T?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await ot(R,S,e)??D:null;let j={};g.modulesTag=await rr([n,D],e,c,j),g.modulesCode=j.code??null,x=j.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-y8ban8z2.js")),F=e.composablesDir,I=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??F,n,I,w);if(L)g.composableCode=L,g.composableTag=await ot('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(y||!r)break}return g}async function Jn(n,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:r}=await import("./chunk-fn0419dn.js"),d=await import("./chunk-2nxxhcyy.js"),{messages:y,webModules:m}=e,x=null,w=null,v=r()===""&&!a.__stx_native_screen;if(y&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),y)}catch(R){Qn(R)}if(m&&Object.keys(m).length&&v)try{w=await(await import("./chunk-c3dg8qdn.js")).loadWebModules(process.cwd(),m)}catch(R){Yn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Zn(n,e,c,a),M=k.size?await g(k,S):await S(),T=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(n,x),R);if(D)T=await ot('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[T,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var fr=!1;function Qn(n){if(fr)return;fr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var gr=!1;function Yn(n){if(gr)return;gr=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function es(n,e=""){let c=kr(n,"data-stx-runtime");if(!c)return n;let a=cr(n);if(a===-1||a===c.start){if(!e)return n;return n.slice(0,c.end)+e+n.slice(c.end)}if(a<c.start)return n.slice(0,a)+n.slice(c.start,c.end)+e+`
|
|
1299
1299
|
`+n.slice(a,c.start)+n.slice(c.end);let g=n.slice(c.start,c.end),r=n.slice(0,c.start)+n.slice(c.end),d=cr(r);if(d===-1)return g+e+`
|
|
1300
1300
|
`+r;return r.slice(0,d)+g+e+`
|
|
1301
1301
|
`+r.slice(d)}function ts(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(await A(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=ke(n,c);let r=!e.__stxProcessingDepth;yn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await Sn(e,c,a.runtimeConfig);if(r)Wc(e),e.__stx_scope_seq??={n:0,key:Us(String(e.__filename??c))},e.__stx_head_injections=Ti(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!E()&&!En())&&c&&c.endsWith(".stx"))Lo(n,c);try{return await ae.timeAsync("template-processing",async()=>{let d=await rs(n,e,c,a,g);if(r)d=mi(d);if(r&&a.autoShell&&a.buildMode!=="compile"){let y=Ce(a.app?.head,{known:Or,source:"app.head"}),x=(e.__stx_runtime_head||null)??Ri(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?_(S,e,c):void 0,T=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],j=new Set(D.map((V)=>at(V)).filter(Boolean)),N={...y,...T&&{title:T},meta:[...(y.meta||[]).filter((V)=>!j.has(at(V))),...D],link:[...y.link||[],...x.link||[]],script:[...y.script||[],...x.script||[]],headRaw:[y.headRaw,w].filter(Boolean).join(`
|
|
@@ -1310,7 +1310,7 @@ ${m.trim()}
|
|
|
1310
1310
|
@endsection`}}if(D&&m.includes("<script")){let I=J(m),L=I.scripts.map((H)=>hr(H,c)??H);m=xr(I.output,L)}if(m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(I,L,H)=>(R[L]=H,"")),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(I,L,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return I;try{let V=u(H.trim(),e);if(V===void 0)return I;let ee=(e.__stx_inline_section_values??=[]).push(V)-1;return R[L]=`{{ __stx_inline_section_values[${ee}] }}`,""}catch{return I}}),m=m.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(I,L,H)=>{if(H.includes("@parent"))R[L]=H.replace("@parent",Ee);else R[L]=H.trim();return""}),e.__sections=R,m=m.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(I,L,H)=>R[L]||H||""),!("slot"in e)||e.slot===void 0)m=m.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||"");if(m=ls(m,T),D){let I=[],L=J(m),H=fe(L.output,gn,(V,X)=>`\x00STX_ORPHAN_STYLE_${X}\x00`);if(m=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(V,X,ee)=>{let te=X==="SCRIPT"?hr(L.scripts[Number(ee)],c):H.tokens[Number(ee)];if(te)I.push(te);return""}),I.length>0){let V=I.join(`
|
|
1311
1311
|
`);R.content=R.content?`${R.content}
|
|
1312
1312
|
${V}`:V,e.__sections=R}}if(D)try{let I;if(ie.isAbsolute(D))I=D,g.add(D);else I=await _e(()=>vn(D,c,d,g),null,()=>{throw new ce(`Failed to resolve layout path: ${D}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!I){let te=(G)=>{if(!G)return[];try{let me=ie.isAbsolute(G)?G:ie.resolve(process.cwd(),G);return Kn.readdirSync(me).filter((ve)=>ve.endsWith(".stx")).map((ve)=>ve.replace(/\.stx$/,""))}catch{return[]}},re=[...te(d.layoutsDir),...te(d.fallbackLayoutsDir)].filter((G,me,ve)=>ve.indexOf(G)===me).sort(),le=[d.layoutsDir,d.fallbackLayoutsDir].filter((G)=>typeof G==="string"&&G.length>0),de=le.length>0?` Searched: ${le.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",se=`Layout not found: ${D} (referenced from ${c})`+(re.length>0?`. Available layouts: ${re.join(", ")}`:d.layoutsDir?`. No .stx layouts found in ${d.layoutsDir}`:"")+de;if(z.log(Error(se),{layoutPath:D,filePath:c,available:re},"error"),console.error(`[stx] ${se}`),d.debug)throw new ce(se,c);return m}let L=await _e(()=>Bun.file(I).text(),"",()=>{throw new ce(`Failed to read layout file: ${I}`,c,void 0,void 0,"Layout content could not be loaded")});L=ur(L,I);let H=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(H){if(d.debug)console.log(`Found nested layout: ${H[1]} in ${I}`);let te={},re=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(se,G,me)=>(te[G]=me.trim(),""));for(let[se,G]of Object.entries(te))if(R[se]&&R[se].includes(Ee)){let me=R[se].indexOf(Ee);R[se]=R[se].slice(0,me)+G+R[se].slice(me+Ee.length)}else if(!R[se])R[se]=G;let le={...e,__sections:R},de=`@layout('${H[1]}')${re}`;return await i(de,le,I,d,g)}let V=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),X=cs(V,T),ee={};return X=X.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(te,re,le)=>(ee[re]=le.trim(),`@slot('${re}')`)),X=X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(te,re,le)=>{if(R[re]){let de=R[re];if(de.includes(Ee)){let se=ee[re]||"",G=de.indexOf(Ee);de=de.slice(0,G)+se+de.slice(G+Ee.length)}return de}return le||""}),X=ns(X,R),X=X.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||""),X=ls(X,T),e.__originalFilePath=c,m=await wr(X,e,I,d,g),m=`<!-- stx-layout: ${D} -->
|
|
1313
|
-
${m}`,v(m)}catch(I){if(I instanceof K)throw I;throw new ce(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await wr(m,e,c,d,g))}function ns(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function ss(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function os(n,e){await _e(()=>Kt(n,e),void 0,(c)=>{z.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var ct="data-stx-source";function hr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return n;return`<script ${ct}="${encodeURIComponent(e)}"${n.slice(7)}`}function us(n){let e=new RegExp(`${ct}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function yr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function br(n,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${yr(n)}</span><span style="display:block;margin-top:4px">${yr(c)}</span></div>`}async function fs(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1313
|
+
${m}`,v(m)}catch(I){if(I instanceof K)throw I;throw new ce(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await wr(m,e,c,d,g))}function ns(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function ss(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function os(n,e){await _e(()=>Kt(n,e),void 0,(c)=>{z.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var ct="data-stx-source";function hr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return n;return`<script ${ct}="${encodeURIComponent(e)}"${n.slice(7)}`}function us(n){let e=new RegExp(`${ct}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function yr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function br(n,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${yr(n)}</span><span style="display:block;margin-top:4px">${yr(c)}</span></div>`}async function fs(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-vjh6va50.js")),r=[],d=!E()&&!En();for(let m of g(n)){let x=m.attrs;if(!/\bserver\b/.test(x))continue;let w=m.start+m.fullMatch.indexOf(">")+1,v=vr(n,w);if(v===-1)continue;let k=n.slice(w,v);if(!k.trim())continue;let S=us(x)??c,M={index:m.start,length:v+9-m.start};try{let{extractVariables:T}=await o("stx/variable-extractor",()=>import("./chunk-xa8jn2ym.js"));await T(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;r.push({...M,markup:br(S,R.kind,R.message)})}})}catch(T){let R=T instanceof Error?T:Error(String(T));if(z.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)r.push({...M,markup:br(S,"unknown",R.message)})}}if(r.length===0)return n;let y=n;for(let m of r.sort((x,w)=>w.index-x.index))y=y.slice(0,m.index)+m.markup+y.slice(m.index+m.length);return y}async function gs(n,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-h12ekfb7.js"));return a(n,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return z.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),n}}async function wr(n,e,c,a,g){let r=n;await A();let d=a;if(r=await fs(r,e,c,a),r=await Ht(r,e,c),r=await Bt(r,e,c),r=await gs(r,e,c),await A(),r=await Ct(r,e,c,d),ke(r))r=qo(r,e),r=ys(r,e),r=hs(r,e);r=Ko(r),await A();let{processStreamDirectives:y}=await o("stx/streaming",()=>import("./chunk-s5g6gtz3.js"));r=y(r,e),r=await zo(r,e,c,d,!0),await A(),r=await er(r,e,c,d,g),r=await ds(r,e,c,d,g),await A(),r=gc(r,e,c,d);let{processDeferDirectives:m}=await o("stx/defer",()=>import("./chunk-ay7ggc4k.js"));r=m(r,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-1bpx9b0m.js"));r=x(r,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-72n804gy.js"));r=w(r,e,c),r=v(r);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=k(r,e,c),r=S(r);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-txzap6yn.js"));r=M(r,e,c);let{processAsyncDirectives:T}=await o("stx/async-components",()=>import("./chunk-m3tnxk01.js"));r=T(r,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-6aak0b7c.js"));r=R(r,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:j,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-cw8vpk41.js"));r=D(r,e,c),r=j(r,e,c),r=N(r,e,c),await A();let{processPartialHydrationDirectives:F,processStaticDirectives:I}=await o("stx/partial-hydration",()=>import("./chunk-pe5qqem0.js"));r=F(r,e,c),r=I(r);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=L(r,e,c),r=H(r,e,c);let{processFormValidationDirectives:V}=await o("stx/forms-validation",()=>import("./chunk-vxmfeys6.js"));r=V(r,e,c);let{processHeadDirective:X,processTitleDirective:ee,processMetaDirective:te,resetHead:re}=await o("stx/head",()=>import("./chunk-bc4x45vx.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)re();let le=X(r);if(r=le.content,le.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${le.headContent}
|
|
1314
1314
|
`;if(r=ee(r,e),r=te(r,e,c),r=Xt(r),r=Ho(r,e),r=_t(r),r=Ut(r),r=await as(r,e,c,d,g),r=await ds(r,e,c,d,g),await A(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=mi(r),r=oe(r,e,c),r=ps(r),await A(),e.__stxProcessingDepth===1)r=qc(r,e);if(r=Fc(r,e,{filePath:c,buildMode:d.buildMode}),r=Vo(r,e),r=Uo(r,e),r=We(r,e),r=Pt(r,e),r=Nt(r,e),r=await wt(r,e,c,d),r=await hc(r,e,c),r=await yc(r,e,c,d),await A(),r=bc(r,e,c,d),r=ei(r,e,c,d),r=ti(r,e,c),r=ni(r,e,c,d),r=Et(r,e,c,d),r=Hs(r,e),r=Vs(r),r=Hc(r),!d.skipEventDirectives)r=Ac(r,e,c);if(r=zc(r,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await A(),d.debug){let U=/\bx-data\s*=/.test(r),q=ms(n);if(U&&q)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1315
1315
|
Both work on the same page, but they manage separate scopes.
|
|
1316
1316
|
Prefer signals (state/derived/effect) for new components.`)}r=lc(r,e),r=await _(r,e,c),await A(),r=Vc(r),r=Uc(r),r=mt(r);let{processXElementDirectives:de}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));r=de(r);let se=e.__originalFilePath||c,G=Le(e);if(r=await Xo(r,d,se,G),await A(),r=Dt(r,e),r=await Wt(r,e,c,d),await A(),d.media?.image?.autoSiblings){let U=d.publicDir||"public",{rewriteImagesWithSiblings:q}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-xrspzeqx.js"));r=await q(r,{publicDir:U})}if(d.seo?.enabled)r=ri(r,e,d);let me=(U,q,Z=!0)=>{if(!q)return U;let he=q.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ne=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(U),pe=ne?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ne[0]):null;if(he&&ne&&pe){if(Z){let Te=ne.index+pe.index;U=U.slice(0,Te)+he[0]+U.slice(Te+pe[0].length)}if(q=q.replace(he[0],"").trim(),!q)return U}if(/<\/head>/i.test(U))return U.replace(/<\/head>/i,`${q}
|
|
@@ -1324,6 +1324,6 @@ ${pt()}
|
|
|
1324
1324
|
`+Te}else r=r.replace("</head>",`${q}
|
|
1325
1325
|
</head>`)}else if(r.includes("<body"))r=r.replace(/<body([^>]*)>/,`<body$1>
|
|
1326
1326
|
${q}`);else r=q+`
|
|
1327
|
-
`+r}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1327
|
+
`+r}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-vjh6va50.js")),q=[];for(let Z of U(r)){if(!/\bserver\b/i.test(Z.attrs))continue;let he=Z.start+Z.fullMatch.indexOf(">")+1,ne=vr(r,he);if(ne===-1)continue;let pe=ne+9;while(pe<r.length&&/\s/.test(r[pe]))pe++;q.push({start:Z.start,end:pe})}if(q.length>0){let Z=Array(q.length+1),he=0;for(let ne=0;ne<q.length;ne++){let{start:pe,end:Te}=q[ne];Z[ne]=r.slice(he,pe),he=Te}Z[q.length]=r.slice(he),r=Z.join("")}}let lt=Fs(r,c);if(lt.hasScoped)r=lt.html;let _r=e.__stx_event_bindings||[],Ke=!1,ut=[],Mr=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Dr}=await o("stx/signal-processing",()=>import("./chunk-vjh6va50.js"));for(let U of Dr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ut.push({match:U.fullMatch,attrs:U.attrs,content:U.body});for(let{match:U,attrs:q,content:Z}of ut){Ke=!0;let he=Z;Ne(Z,c,a.strict,e.__originalFilePath);let ne=await je(Z,{eventBindings:_r,attrs:q,hasColonDirectives:Mr,templateContent:n,filePath:c,projectRoot:process.cwd(),production:Ai(a.buildMode,a.minifyClient),serverData:G});r=r.replace(U,()=>ne)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let U=e.__stx_event_bindings||[];if(U.length>0){let q=li(U);if(q){let Z=r.lastIndexOf("</body>");r=Z===-1?r+q:r.slice(0,Z)+q+`
|
|
1328
1328
|
`+r.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!we(r)&&dc(r))r=await lr(r,d);if(r=pc(r),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")r=$t(r,e.cspNonce);return r}
|
|
1329
1329
|
export{bt,Ae,oc,is,Mo,Do,rr,i};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{f,d}from"./chunk-txd2js5v.js";import{Y,N,p}from"./chunk-
|
|
2
|
+
import{f,d}from"./chunk-txd2js5v.js";import{Y,N,p}from"./chunk-7kzxmm80.js";function B(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var k=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function E(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function Z(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=E(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function L(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=E(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||k.has(c)?-1:Z(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!k.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function j(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=E(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",g=u[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=B(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!k.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Vl(t){let o={default:"",named:new Map},i=t,r=j(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=L(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function bm(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Ul(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=I(e,s,a,u)}return e}function I(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(N(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!N(s,r))return e;let a=C(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function C(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!f(t))return;return d(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Wl(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,g)=>{let m=o.named.get(u),l=g?.trim()||"",h=c||"",S={},A=[],M=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=M.exec(h))!==null){let w=b[1],x=b[2];S[w]=C(x,i),A.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=Y(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let v=A.map(([O,z])=>{let R=S[O],_;try{_=R===void 0?void 0:JSON.stringify(R)}catch{}return`${JSON.stringify(O)}:(${_??z})`}).join(","),P=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${v}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${P}">${m.content}</template>`}return await Ul(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function wm(t){let o=Vl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function vm(t,o,i,r,e){return await Wl(t,{default:o,named:i},r,e)}
|
|
3
3
|
export{Vl,bm,Ul,Wl,wm,vm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P,t,l}from"./chunk-txd2js5v.js";import{Q}from"./chunk-
|
|
2
|
+
import{P,t,l}from"./chunk-txd2js5v.js";import{Q}from"./chunk-7kzxmm80.js";import{Zo}from"./chunk-gh62p9mx.js";import E from"path";var S;async function W(){if(S!==void 0)return S;try{let e=await import("@stacksjs/ts-i18n");S=e.loadLocale??null}catch{S=null}return S}var T={defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},v={},L={},k={};function J(e,s=0){if(s<=0)return!1;return Date.now()-e.loadedAt>s}async function G(e,s){if({...T,...s.i18n}.cache&&v[e]){let r=v[e],o=s.i18n?.cacheMaxAge??0;if(!J(r,o))return r.translations}if(L[e]?.state==="loading")return L[e].promise;k[e]="loading";let n=C(e,s).then((r)=>(k[e]="loaded",delete L[e],r)).catch((r)=>{throw k[e]="error",L[e]={promise:n,state:"error",error:r instanceof Error?r:Error(String(r))},r});return L[e]={promise:n,state:"loading"},n}async function C(e,s){let i={...T,...s.i18n},n=E.isAbsolute(i.translationsDir)?i.translationsDir:E.resolve(s.root||process.cwd(),i.translationsDir);try{let r=await W(),o=r?await r(e,{translationsDir:n,defaultLocale:i.defaultLocale,sources:te(i.format)}):await Y(e,i,n);if(o===void 0){let u=e!==i.defaultLocale?await C(i.defaultLocale,s):{};if(i.cache)v[e]={translations:u,loadedAt:Date.now(),locale:e};return u}let c=o;if(i.cache)v[e]={translations:c,loadedAt:Date.now(),locale:e};return c}catch(r){if(s.debug)console.error(`Error loading translation file for locale "${e}":`,r);if(e!==i.defaultLocale)return C(i.defaultLocale,s);return{}}}async function Y(e,s,i){let n=E.join(i,`${e}${Z(s.format)}`);try{let r=await import(n);return r.default||r}catch(r){try{let o=await Bun.file(n).text();if(s.format==="yaml"||s.format==="yml")return X(o);if(s.format==="json")return JSON.parse(o);throw r}catch{return}}}function Z(e){switch(e){case"yaml":return".yaml";case"yml":return".yml";case"js":return".js";case"ts":return".ts";case"json":default:return".json"}}function X(e){let s={},i=e.split(`
|
|
3
3
|
`),n=[{obj:s,indent:-1}];for(let r of i){let o=r.replace(/#.*$/,"").trimEnd();if(!o.trim())continue;let c=o.search(/\S/);if(c===-1)continue;while(n.length>1&&n[n.length-1].indent>=c)n.pop();let u=n[n.length-1].obj,a=o.match(/^(\s*)(\S[^:]*):\s*(.*)$/);if(a){let[,,g,p]=a,f=g.trim(),m=p.trim();if(m==="")u[f]={},n.push({obj:u[f],indent:c});else u[f]=ee(m)}}return s}function ee(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let s=e.toLowerCase();if(s==="true"||s==="yes")return!0;if(s==="false"||s==="no")return!1;if(s==="null"||s==="~")return null;let i=Number(e);if(!Number.isNaN(i)&&e!=="")return i;return e}function te(e){switch(e){case"yaml":case"yml":return["yaml"];case"js":case"ts":return["ts"];case"json":default:return["json"]}}async function re(e,s){return G(e,s)}function ne(e,s){for(let i of e){let n=i.trim(),r=n.match(/^\{(\d+)\}\s*(.*)$/);if(r){let c=Number.parseInt(r[1],10);if(s===c)return r[2];continue}let o=n.match(/^\[(\d+),(\d+|\*)\]\s*(.*)$/);if(o){let c=Number.parseInt(o[1],10),u=o[2]==="*"?Number.POSITIVE_INFINITY:Number.parseInt(o[2],10);if(s>=c&&s<=u)return o[3];continue}}if(e.length===2)return s===1?e[0].trim():e[1].trim();if(s<e.length)return e[s].trim();return e[e.length-1].trim()}function ie(e,s={}){return j(e,s)}function j(e,s){let i="",n=0;while(n<e.length)if(e[n]==="{"){let r=se(e,n);if(r===-1){i+=e[n],n++;continue}let o=e.slice(n+1,r);i+=ae(o,s),n=r+1}else if(e[n]==="'"&&n+1<e.length)if(e[n+1]==="'")i+="'",n+=2;else if(e[n+1]==="{"||e[n+1]==="}")i+=e[n+1],n+=2;else i+=e[n],n++;else i+=e[n],n++;return i}function se(e,s){let i=0;for(let n=s;n<e.length;n++)if(e[n]==="{")i++;else if(e[n]==="}"){if(i--,i===0)return n}return-1}function ae(e,s){let i=oe(e);if(i.length===0)return`{${e}}`;let n=i[0].trim(),r=s[n];if(i.length===1)return r!==void 0?String(r):`{${n}}`;switch(i[1].trim().toLowerCase()){case"plural":return le(r,i.slice(2).join(","),s);case"select":return ue(r,i.slice(2).join(","));case"selectordinal":return de(r,i.slice(2).join(","));case"number":return pe(r,i[2]?.trim());case"date":return fe(r,i[2]?.trim());case"time":return me(r,i[2]?.trim());default:return r!==void 0?String(r):`{${e}}`}}function oe(e){let s=[],i="",n=0;for(let r=0;r<e.length;r++){let o=e[r];if(o==="{")n++,i+=o;else if(o==="}")n--,i+=o;else if(o===","&&n===0)s.push(i),i="";else i+=o}if(i)s.push(i);return s}function le(e,s,i){let n=Number(e)||0,r=I(s),o=`=${n}`;if(r[o])return R(r[o],n,i);let c=ce(n);if(r[c])return R(r[c],n,i);if(r.other)return R(r.other,n,i);return String(n)}function R(e,s,i){let n=e.replace(/#/g,String(s));return j(n,i)}function ce(e){let s=Math.abs(e),i=Math.floor(s),n=String(e).includes(".")?String(e).split(".")[1].length:0;if(i===1&&n===0)return"one";return"other"}function ue(e,s){let i=String(e||""),n=I(s);if(n[i])return n[i];return n.other||String(e)}function de(e,s){let i=Number(e)||0,n=I(s),r=ge(i);if(n[r])return n[r].replace(/#/g,String(i));if(n.other)return n.other.replace(/#/g,String(i));return String(i)}function ge(e){let s=Math.abs(e),i=s%10,n=s%100;if(i===1&&n!==11)return"one";if(i===2&&n!==12)return"two";if(i===3&&n!==13)return"few";return"other"}function I(e){let s={},i=/(\w+|=\d+)\s*\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/g,n=i.exec(e);while(n!==null)s[n[1]]=n[2],n=i.exec(e);return s}function pe(e,s){let i=Number(e);if(Number.isNaN(i))return String(e);switch(s){case"integer":return Math.floor(i).toLocaleString();case"percent":return`${(i*100).toFixed(0)}%`;case"currency":return i.toLocaleString(void 0,{style:"currency",currency:"USD"});default:return i.toLocaleString()}}function fe(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.dateStyle="short";break;case"medium":n.dateStyle="medium";break;case"long":n.dateStyle="long";break;case"full":n.dateStyle="full";break;default:n.dateStyle="medium"}return i.toLocaleDateString(void 0,n)}function me(e,s){let i=e instanceof Date?e:new Date(String(e));if(Number.isNaN(i.getTime()))return String(e);let n={};switch(s){case"short":n.timeStyle="short";break;case"medium":n.timeStyle="medium";break;case"long":n.timeStyle="long";break;case"full":n.timeStyle="full";break;default:n.timeStyle="short"}return i.toLocaleTimeString(void 0,n)}function be(e){return/\{[^}]+,\s*(?:plural|select|selectordinal|number|date|time)\s*,/.test(e)}function O(e,s,i=!0,n={}){let r=e.split("."),o=s;for(let u of r){if(o===void 0||o===null)break;o=o[u]}if(o===void 0||o===null)return i?e:"";let c=String(o);if(be(c))return ie(c,n);if(c.includes("|")&&"count"in n){let u=Number(n.count),a=c.split("|");c=ne(a,u)}for(let[u,a]of Object.entries(n)){let g=u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");c=c.replace(new RegExp(`:${g}`,"g"),()=>String(a))}return c}var D=new Set(["ar","arc","ckb","dv","fa","he","khw","ks","nqo","prs","ps","sd","syr","ug","ur","uz-af","yi"]),he=new Set(["adlm","arab","aran","hebr","nkoo","rohg","syrc","thaa","yezi"]);function q(e){if(!e)return"ltr";let s=e.trim().toLowerCase().replace(/_/g,"-").split("-"),i=s[0];if(!i)return"ltr";let n=s[1]?.length===4?s[1]:void 0;if(n)return he.has(n)?"rtl":"ltr";if(s.length>1&&D.has(`${i}-${s[1]}`))return"rtl";return D.has(i)?"rtl":"ltr"}async function yc(e,s,i,n){let r=e,o=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)([\s\S]*?)@endtranslate/g,c={...T,...n.i18n},u=await re(c.locale,n);s.__translations=u,s.__locale=c.locale,s.__i18nConfig=c,r=await F(r,o,async(p,f,m,w,h)=>{try{let b={};if(m)try{let d=[()=>JSON.parse(m),()=>{let x=`{"data":${m}}`,A=JSON.parse(x);return typeof A.data==="object"?A.data:{}},()=>P(m,s)];for(let x of d)try{if(b=x(),Object.keys(b).length>0)break}catch{}}catch(d){if(n.debug)console.error("Error parsing parameters for @translate directive:",d)}let y=O(f,u,c.fallbackToKey,b);return y?Q(r,h,y,!1,p.length):w.trim()}catch(b){if(n.debug)console.error("Error processing @translate directive:",b);return l("Translate",`Error in @translate('${f}'): ${b instanceof Error?b.message:String(b)}`,t.EVALUATION_ERROR)}});let a=/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]+\})\s*)?\)/g;if(n.debug){console.warn(`Processing translations in template. Sections: ${r.includes("<h2>Translation with Parameters</h2>")?"Parameters section found":"Parameters section missing"}`);let p=[...r.matchAll(a)];console.warn(`Found ${p.length} @translate matches`),p.forEach((f,m)=>console.warn(`Match ${m}: ${f[0]}, Key: ${f[1]}, Params: ${f[2]||"none"}`))}return r=await F(r,/@translate\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\})\s*)?\)/g,async(p,f,m,w)=>{try{let h={};if(m)try{let b=[()=>JSON.parse(m),()=>{let y=`{"data":${m}}`,d=JSON.parse(y);return typeof d.data==="object"?d.data:{}},()=>P(m,s)];for(let y of b)try{if(h=y(),Object.keys(h).length>0)break}catch{}}catch(b){if(n.debug)console.error("Error parsing parameters for @translate directive:",b)}return Q(r,w,O(f,u,c.fallbackToKey,h),!1,p.length)}catch(h){if(n.debug)console.error("Error processing @translate directive:",h);return l("Translate",`Error in @translate('${f}'): ${h instanceof Error?h.message:String(h)}`,t.EVALUATION_ERROR)}}),r}async function F(e,s,i){let n=[];return e.replace(s,(o,...c)=>{let u=i(o,...c).then((a)=>({match:o,replacement:a}));return n.push(u),o}),(await Promise.all(n)).reduce((o,{match:c,replacement:u})=>o.replace(c,()=>u),e)}function _(e,s){if(!e||q(e)!=="rtl")return!1;return!s||s.trim().toLowerCase()!=="rtl"}function V(e){if(!e)return!1;return e.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||e.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function U(e,s){let i=new RegExp(`\\b${s}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(e);if(!i)return null;return i[2]??i[3]??i[4]??null}function bc(e,s,i,n){let r=e;r=r.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,u,a)=>{let p={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[u]||"Make this element accessible";return`<!-- a11y-hint: ${a||p} -->`});let o=/@screenReader\(([^@]*)\)@endScreenReader/g;return r=r.replace(o,(c,u)=>`<span class="sr-only">${u.trim()}</span>`),r=r.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(c,u,a)=>`<span id="${`desc-${u}`}" class="sr-only">${a}</span>`),r}function ye(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function xe(e){let s=new Map,i=e.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(r,o,c)=>{let u=s.get(c);if(!u)u=`stx-a11y-component-${s.size}`,s.set(c,u);return`<${o}${u}`}),n=new Map([...s.entries()].map(([r,o])=>[o,r]));return{protectedSource:i,restore:(r)=>r.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(o,c,u)=>{let a=n.get(u);return a?`<${c}${a}`:o})}}function we(e,s){let i=[],n=/<img\s+([^>]*)>/gi,r;r=n.exec(e);while(r!==null){let d=r[1];if(!/\balt\s*=/i.test(d))i.push({type:"missing-alt",element:r[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});r=n.exec(e)}let o=/<button([^>]*)>\s*<\/button>/gi;r=o.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"missing-accessible-name",element:r[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});r=o.exec(e)}let c=/<a\s+([^>]*)>\s*<\/a>/gi;r=c.exec(e);while(r!==null){let d=r[1];if(!/\baria-label\s*=/i.test(d)&&!/\btitle\s*=/i.test(d))i.push({type:"link-missing-text",element:r[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});r=c.exec(e)}let u=/<(input|select|textarea)\s+([^>]*)>/gi;r=u.exec(e);while(r!==null){let d=r[2];if(/\btype\s*=\s*["']hidden["']/i.test(d)){r=u.exec(e);continue}let x=/\baria-label\s*=/i.test(d)||/\baria-labelledby\s*=/i.test(d),A=d.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!x){let B=A&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${A[1]}["']`,"i").test(e),M=r.index,N=e.substring(0,M),Se=e.substring(M),H=(N.match(/<label\b/gi)||[]).length,z=(N.match(/<\/label>/gi)||[]).length,K=H>z;if(!B&&!K)i.push({type:"input-missing-label",element:r[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}r=u.exec(e)}let a=/<h([1-6])[^>]*>/gi,g=[];r=a.exec(e);while(r!==null)g.push(Number.parseInt(r[1],10)),r=a.exec(e);let p=0;for(let d of g){if(p>0&&d>p+1)i.push({type:"heading-skip",element:`<h${d}>`,message:`Heading level skipped from h${p} to h${d}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});p=d}if(/<html\b/i.test(e)&&!/<html[^>]*\slang\s*=/i.test(e))i.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let f=e.match(/<html\b([^>]*)>/i);if(f&&_(U(f[1],"lang"),U(f[1],"dir")))i.push({type:"missing-dir",element:f[0].substring(0,100),message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});let m=/<table([^>]*)>([\s\S]*?)<\/table>/gi;r=m.exec(e);while(r!==null){let d=r[2];if(!V(U(r[1],"role"))&&!/<th\b/i.test(d))i.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});r=m.exec(e)}let w=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;r=w.exec(e);while(r!==null){if(!/\bmuted\b/i.test(r[0]))i.push({type:"autoplay-audio",element:`<${r[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});r=w.exec(e)}let h=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;r=h.exec(e);while(r!==null)i.push({type:"positive-tabindex",element:`tabindex="${r[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),r=h.exec(e);let b=/<iframe\s+([^>]*)>/gi;r=b.exec(e);while(r!==null){let d=r[1];if(!/\btitle\s*=/i.test(d)&&!/\baria-label\s*=/i.test(d))i.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});r=b.exec(e)}let y=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;r=y.exec(e);while(r!==null){let d=r[1].toLowerCase(),x=r[2];if(d!=="button"&&!/\btabindex\s*=/i.test(x))i.push({type:"button-not-focusable",element:r[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});r=y.exec(e)}return i}async function Ae(e,s){let{protectedSource:i}=xe(e);if(!ye())return we(i,s);let n=[];try{let r=globalThis.document.createElement("div");r.innerHTML=i,r.querySelectorAll("img").forEach((a)=>{if(!a.hasAttribute("alt"))n.push({type:"missing-alt",element:`<${a.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),r.querySelectorAll('button, a, [role="button"]').forEach((a)=>{if(!(a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby")||a.textContent&&a.textContent.trim().length>0))n.push({type:"missing-accessible-name",element:`<${a.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),r.querySelectorAll("input, select, textarea").forEach((a)=>{let g=a.getAttribute("id"),p=g&&r.querySelector(`label[for="${g}"]`),f=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),m=a.closest("label")!==null;if(!p&&!f&&!m)n.push({type:"input-missing-label",element:`<${a.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let o=Array.from(r.querySelectorAll("h1, h2, h3, h4, h5, h6")),c=0;for(let a of o){let g=Number.parseInt(a.tagName.charAt(1));if(c>0&&g>c+1)n.push({type:"heading-skip",element:`<${a.outerHTML}>`,message:`Heading level skipped from h${c} to h${g}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});c=g}let u=r.querySelector("html");if(i.includes("<html")&&u&&!u.hasAttribute("lang"))n.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(u&&_(u.getAttribute("lang"),u.getAttribute("dir")))n.push({type:"missing-dir",element:"<html>",message:'Document language is right-to-left but dir="rtl" is not set',impact:"serious",help:'Add dir="rtl" to the html element so the layout mirrors the text',helpUrl:"https://www.w3.org/International/questions/qa-html-dir"});if(r.querySelectorAll("a").forEach((a)=>{let g=a.textContent&&a.textContent.trim().length>0,p=a.hasAttribute("aria-label")||a.hasAttribute("aria-labelledby"),f=a.hasAttribute("title"),m=a.querySelector("img[alt]");if(!g&&!p&&!f&&!m)n.push({type:"link-missing-text",element:`<${a.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),i.includes("<nav")||i.includes("<header")){if(!r.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&r.querySelectorAll("a").length>5)n.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(r.querySelectorAll("table").forEach((a)=>{if(V(a.getAttribute("role")))return;let g=a.querySelector("caption");if(!a.querySelector("th"))n.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!g&&!a.hasAttribute("aria-label")&&!a.hasAttribute("aria-labelledby"))n.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),r.querySelectorAll('[style*="color"]').forEach((a)=>{let g=a.getAttribute("style")||"";if(g.includes("color:")&&!g.includes("background"))n.push({type:"potential-contrast-issue",element:`<${a.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),r.querySelectorAll("video[autoplay], audio[autoplay]").forEach((a)=>{if(!a.hasAttribute("muted"))n.push({type:"autoplay-audio",element:`<${a.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),r.querySelectorAll("[tabindex]").forEach((a)=>{if(Number.parseInt(a.getAttribute("tabindex")||"0")>0)n.push({type:"positive-tabindex",element:`<${a.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),r.querySelectorAll('[role="button"]').forEach((a)=>{if(!a.hasAttribute("tabindex"))n.push({type:"button-not-focusable",element:`<${a.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),i.includes("<body")&&!r.querySelector('main, [role="main"]'))n.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});r.querySelectorAll("iframe").forEach((a)=>{if(!a.hasAttribute("title")&&!a.hasAttribute("aria-label"))n.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(r){console.error(`Error checking accessibility in ${s}:`,r)}return n}async function wc(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],c=await Zo(o,{recursive:n,ignorePaths:r}),u=[];for(let a of c)try{let g=await Bun.file(a).text();if(a.endsWith("good-a11y.stx"))continue;let p=await Ae(g,a);if(u.push(a),p.length>0)i[a]=p}catch(g){console.error(`Error scanning ${a}:`,g)}return{results:i,scannedFiles:u}}var vc={name:"a11y",handler:(e,s,i,n)=>{if(!s.length)return e;let r=s[0].replace(/['"]/g,""),o=s.length>1?s[1].replace(/['"]/g,""):"",u={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[r]||"Make this element accessible";return`<!-- a11y-hint: ${o||u} -->${e}`},hasEndTag:!1},xc={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
|
|
4
4
|
export{yc,bc,wc,vc,xc};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lm,va,pu,jm,Bm,Fm,zm,Hm,fu,gu,Vm,Um,Wm,qm}from"./chunk-
|
|
2
|
+
import{Lm,va,pu,jm,Bm,Fm,zm,Hm,fu,gu,Vm,Um,Wm,qm}from"./chunk-we7cc5x7.js";import"./chunk-pj904eyr.js";import"./chunk-9wsrkcyw.js";import"./chunk-d9m9azzk.js";import"./chunk-s33andzg.js";import"./chunk-71vj7v61.js";import"./chunk-xg852k9h.js";import"./chunk-14dmmthm.js";import"./chunk-3bjnrmha.js";import"./chunk-91qky0er.js";import"./chunk-944tcqgg.js";import"./chunk-ya6bp08c.js";import"./chunk-eydfzmdj.js";import"./chunk-d85fvcf5.js";import"./chunk-qq19g7e2.js";import"./chunk-gh62p9mx.js";import"./chunk-amg6kr1p.js";import"./chunk-ms3v5nat.js";import"./chunk-29f6vmyz.js";import"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{pu as SUSPENSE_RESOLVER_RUNTIME,va as buildSuspenseResolveScript,Hm as createStreamRenderer,Fm as extractStreamBoundaries,qm as generateHydrationRuntime,gu as islandDirective,Um as processSectionDirectives,Bm as processStreamDirectives,Vm as registerStreamingDirectives,jm as renderStreamingPage,Lm as streamTemplate,zm as streamTemplateSimple,Wm as streamToResponse,fu as streamingSuspenseDirective};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rr,i}from"./chunk-pj904eyr.js";import"./chunk-9wsrkcyw.js";import"./chunk-d9m9azzk.js";import"./chunk-s33andzg.js";import"./chunk-71vj7v61.js";import"./chunk-xg852k9h.js";import"./chunk-14dmmthm.js";import"./chunk-3bjnrmha.js";import"./chunk-91qky0er.js";import{ve}from"./chunk-944tcqgg.js";import"./chunk-ya6bp08c.js";import"./chunk-eydfzmdj.js";import"./chunk-d85fvcf5.js";import"./chunk-qq19g7e2.js";import"./chunk-gh62p9mx.js";import"./chunk-amg6kr1p.js";import"./chunk-ms3v5nat.js";import"./chunk-29f6vmyz.js";import{Ne,Hs,Vs}from"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";export{rr as buildModulesTag,ve as injectRouterScript,i as processDirectives,Hs as processJsonDirective,Vs as processOnceDirective,Ne as validateClientScript};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$l,Rl}from"./chunk-1rgex0bn.js";import"./chunk-e75dntfb.js";import"./chunk-v8mh2xvp.js";import"./chunk-tj24x37q.js";import"./chunk-dq9mrthz.js";import"./chunk-n4qznmkm.js";import"./chunk-55e46spy.js";import"./chunk-1av9cx4h.js";import"./chunk-0ee6a69c.js";import"./chunk-zwgxnjmx.js";import"./chunk-f49x34sr.js";import"./chunk-xtqapjz3.js";import"./chunk-q5pwvr98.js";import"./chunk-pkxy74j9.js";import"./chunk-nmtya57z.js";import"./chunk-vyv76w55.js";import"./chunk-z25w7kmr.js";import"./chunk-ckg6q98b.js";import"./chunk-s5dhvnnd.js";import"./chunk-7k9yahng.js";import"./chunk-c3n6rbr8.js";import"./chunk-we7cc5x7.js";import"./chunk-b7tb00nz.js";import"./chunk-0rvntfhj.js";import"./chunk-myje6fhm.js";import"./chunk-f7jgda7x.js";import"./chunk-3sty93sy.js";import"./chunk-8tktmm5d.js";import"./chunk-w0a6yz73.js";import"./chunk-zbnxrj3b.js";import"./chunk-s53wjw7y.js";import"./chunk-ac9ncbfw.js";import{en}from"./chunk-876qk7ct.js";import"./chunk-8dr42g11.js";import"./chunk-cyd6s7tj.js";import"./chunk-tx8wk6h7.js";import{Ae,i}from"./chunk-pj904eyr.js";import"./chunk-9wsrkcyw.js";import"./chunk-d9m9azzk.js";import"./chunk-s33andzg.js";import"./chunk-71vj7v61.js";import"./chunk-xg852k9h.js";import"./chunk-14dmmthm.js";import"./chunk-3bjnrmha.js";import"./chunk-91qky0er.js";import{ve}from"./chunk-944tcqgg.js";import"./chunk-ya6bp08c.js";import{ur,dr}from"./chunk-eydfzmdj.js";import{Ss,F,a}from"./chunk-d85fvcf5.js";import"./chunk-qq19g7e2.js";import"./chunk-gh62p9mx.js";import"./chunk-amg6kr1p.js";import"./chunk-ms3v5nat.js";import"./chunk-29f6vmyz.js";import{m,je}from"./chunk-7kzxmm80.js";import"./chunk-2b25kjyx.js";import"./chunk-vfj9wp11.js";import"./chunk-txd2js5v.js";import"./chunk-s6r54dyf.js";import"./chunk-4ntm3dtk.js";import"./chunk-dv11h4f0.js";import"./chunk-nyg0nbjj.js";export{Ss as buildWebComponents,dr as cacheTemplate,ur as checkCache,en as classifyAllScripts,$l as createMiddleware,Rl as createRoute,F as defaultConfig,m as extractVariables,ve as injectRouterScript,a as loadStxConfig,je as processClientScript,i as processDirectives,Ae as readMarkdownFile};
|