@stacksjs/stx 0.2.847 → 0.2.850
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-rqjskxpw.js → chunk-0dnetjh8.js} +31 -31
- package/dist/{chunk-09412heg.js → chunk-0rszcb0m.js} +13 -13
- package/dist/chunk-1qdhwjs4.js +2 -0
- package/dist/{chunk-z57xq46m.js → chunk-2d7e5g92.js} +4 -4
- package/dist/{chunk-wp14sf2j.js → chunk-2j2qzv8g.js} +1 -1
- package/dist/{chunk-nws4zm4k.js → chunk-2rg9pqmh.js} +4 -4
- package/dist/chunk-3gyq9rjx.js +2 -0
- package/dist/chunk-3w9xhs7k.js +2 -0
- package/dist/chunk-3wt0nh3p.js +2 -0
- package/dist/{chunk-jh36gqcq.js → chunk-422r7zkx.js} +2 -2
- package/dist/chunk-4e6wkjtx.js +2 -0
- package/dist/chunk-4pbrszgz.js +2 -0
- package/dist/chunk-5be6p256.js +2 -0
- package/dist/{chunk-6peq9s4s.js → chunk-5jqz5qff.js} +7 -7
- package/dist/chunk-5m4txcry.js +2 -0
- package/dist/chunk-5p6vpvmz.js +2 -0
- package/dist/chunk-5wk40kjd.js +2 -0
- package/dist/{chunk-q61r0m6r.js → chunk-62k66qj9.js} +1 -1
- package/dist/chunk-660g9vjn.js +2 -0
- package/dist/chunk-67bn31a3.js +2 -0
- package/dist/{chunk-y1cneng3.js → chunk-6p62jjzm.js} +2 -2
- package/dist/{chunk-cv0rmntr.js → chunk-6q6atv4g.js} +5 -5
- package/dist/chunk-6rd4phe3.js +2 -0
- package/dist/chunk-7hnt9a2e.js +2 -0
- package/dist/{chunk-ysqzz2h3.js → chunk-7zxce1yw.js} +3 -3
- package/dist/chunk-80bb89fh.js +2 -0
- package/dist/{chunk-he9dzchk.js → chunk-833y1ndd.js} +1 -1
- package/dist/{chunk-93c08def.js → chunk-88392kaj.js} +5 -5
- package/dist/{chunk-t4dkcf28.js → chunk-8cvgm13s.js} +2 -2
- package/dist/{chunk-jj5fz0fq.js → chunk-8hkgycpm.js} +1 -1
- package/dist/chunk-8k6cd1e0.js +2 -0
- package/dist/{chunk-2ts9pb6s.js → chunk-8vjr3atq.js} +2 -2
- package/dist/{chunk-rsa9ssz7.js → chunk-918ws1g7.js} +6 -6
- package/dist/{chunk-h9778nxm.js → chunk-98qgcmxr.js} +2 -2
- package/dist/chunk-9bkgbyrs.js +2 -0
- package/dist/{chunk-5njk2ba0.js → chunk-9mryv01z.js} +52 -52
- package/dist/{chunk-8586a2hh.js → chunk-9yp0t7zc.js} +2 -2
- package/dist/{chunk-yrmppd8r.js → chunk-a2fngjfx.js} +1 -1
- package/dist/chunk-a2shk93y.js +3 -0
- package/dist/chunk-a7v1j7td.js +2 -0
- package/dist/{chunk-zfb2wnha.js → chunk-aas25pac.js} +3 -3
- package/dist/{chunk-eqbx4yj1.js → chunk-ab1vk7jv.js} +4 -4
- package/dist/chunk-acbx3jn5.js +2 -0
- package/dist/{chunk-0wms5teg.js → chunk-agbkv9ab.js} +2 -2
- package/dist/{chunk-wdwx2aa6.js → chunk-amerebya.js} +2 -2
- package/dist/{chunk-b1q40vq4.js → chunk-anva219c.js} +2 -2
- package/dist/chunk-apq33h4w.js +2 -0
- package/dist/{chunk-fxk08je0.js → chunk-ar1prdev.js} +7 -7
- package/dist/{chunk-trgbdydw.js → chunk-axga9ebe.js} +2 -2
- package/dist/{chunk-5aqvfnvy.js → chunk-brheng7x.js} +8 -8
- package/dist/{chunk-fhyvdxhw.js → chunk-btkazgdb.js} +3 -3
- package/dist/chunk-c90qz5w0.js +2 -0
- package/dist/{chunk-4fc8zs15.js → chunk-caehra7e.js} +5 -5
- package/dist/chunk-cwt26rvt.js +3 -0
- package/dist/chunk-d4kystzh.js +2 -0
- package/dist/chunk-dx31vsyf.js +2 -0
- package/dist/{chunk-jaf44web.js → chunk-e105xsee.js} +1 -1
- package/dist/{chunk-xn0ebqgw.js → chunk-e46n406k.js} +13 -13
- package/dist/{chunk-2j3gttzf.js → chunk-e85wsz8y.js} +1 -1
- package/dist/{chunk-5x8q6e1q.js → chunk-eh8g8kr1.js} +5 -5
- package/dist/chunk-f4x21pqx.js +2 -0
- package/dist/{chunk-6xcmeev9.js → chunk-f5n871gp.js} +5 -5
- package/dist/{chunk-81ysx0tc.js → chunk-fffjjgnt.js} +2 -2
- package/dist/{chunk-wzyc9da7.js → chunk-frhdk0p9.js} +2 -2
- package/dist/chunk-frhh6jd3.js +2 -0
- package/dist/{chunk-b3n1m4m5.js → chunk-g046t3hb.js} +1 -1
- package/dist/chunk-g1gqysb4.js +2 -0
- package/dist/{chunk-110s34yg.js → chunk-gr8q8xqz.js} +3 -3
- package/dist/{chunk-emf6ee94.js → chunk-gsrdjmw9.js} +2 -2
- package/dist/{chunk-r96ahk8s.js → chunk-gwdffrz6.js} +9 -9
- package/dist/chunk-h7rcb74n.js +2 -0
- package/dist/{chunk-jcwtw3hd.js → chunk-h9gjt73q.js} +2 -2
- package/dist/chunk-hg9354gt.js +2 -0
- package/dist/{chunk-s6td2c1k.js → chunk-hhk46fzp.js} +2 -2
- package/dist/chunk-j3x3e353.js +2 -0
- package/dist/chunk-j6r964wk.js +2 -0
- package/dist/chunk-je8ma636.js +2 -0
- package/dist/chunk-jpyk0gtr.js +3 -0
- package/dist/{chunk-v5tzcd49.js → chunk-jqjw00qm.js} +12 -12
- package/dist/{chunk-vm68yvgf.js → chunk-jqsn4sgv.js} +6 -6
- package/dist/{chunk-5m0nyt8d.js → chunk-jt5cqq09.js} +3 -3
- package/dist/chunk-k0pm7p0f.js +2 -0
- package/dist/chunk-k1pyzf9e.js +2 -0
- package/dist/{chunk-eg2p1cyw.js → chunk-k47addf7.js} +29 -29
- package/dist/{chunk-qpz9jrvw.js → chunk-k7dvn2r8.js} +2 -2
- package/dist/{chunk-fa3ygt8c.js → chunk-kd06c90f.js} +4 -4
- package/dist/{chunk-9sjtph54.js → chunk-krtkxnz6.js} +2 -2
- package/dist/chunk-kybes29w.js +2 -0
- package/dist/{chunk-25m74mh1.js → chunk-m05pqmcj.js} +5 -5
- package/dist/chunk-m276y4f3.js +2 -0
- package/dist/{chunk-907zya76.js → chunk-m6nhh5xf.js} +9 -9
- package/dist/{chunk-cww1zk8y.js → chunk-m710wkr4.js} +1 -1
- package/dist/chunk-nnbr1q94.js +2 -0
- package/dist/chunk-nq2z2yrz.js +2 -0
- package/dist/chunk-p2chmq36.js +2 -0
- package/dist/chunk-p9sbpbhg.js +2 -0
- package/dist/{chunk-3qyz80d6.js → chunk-pkq96sqk.js} +6 -6
- package/dist/chunk-q2d8x7p1.js +2 -0
- package/dist/{chunk-cz2s176s.js → chunk-qa1pcm7n.js} +5 -5
- package/dist/{chunk-tm5t3hh3.js → chunk-qa4vs1qg.js} +3 -3
- package/dist/{chunk-5ghw26vq.js → chunk-qahz3n8z.js} +2 -2
- package/dist/{chunk-jm0qsr3s.js → chunk-qev14f76.js} +6 -6
- package/dist/{chunk-tb5h85ag.js → chunk-qjc3qjyf.js} +2 -2
- package/dist/chunk-r0btg48x.js +2 -0
- package/dist/{chunk-qay7pgnq.js → chunk-r0k5jbvk.js} +1 -1
- package/dist/{chunk-ks0dwtp0.js → chunk-r2p2nyyq.js} +3 -3
- package/dist/chunk-ryb4jesm.js +2 -0
- package/dist/{chunk-bttvkzxh.js → chunk-s0pnyd2f.js} +6 -6
- package/dist/{chunk-dv9q56r7.js → chunk-s37af6rd.js} +2 -2
- package/dist/chunk-sa18tper.js +20 -0
- package/dist/{chunk-2xf323h9.js → chunk-scaawv2r.js} +3 -3
- package/dist/chunk-sjpya8wm.js +2 -0
- package/dist/chunk-sy0jtgmv.js +42 -0
- package/dist/chunk-sznk5c66.js +2 -0
- package/dist/{chunk-c541s99z.js → chunk-t23jn83r.js} +4 -4
- package/dist/{chunk-fez9828r.js → chunk-t74qb5ej.js} +3 -3
- package/dist/chunk-t7ws9sth.js +2 -0
- package/dist/{chunk-fr658fhd.js → chunk-tbs24vx1.js} +2 -2
- package/dist/{chunk-acwdf0cf.js → chunk-td6b41vj.js} +4 -4
- package/dist/chunk-tdtwqydq.js +2 -0
- package/dist/{chunk-ga650crj.js → chunk-tm1ec751.js} +9 -9
- package/dist/{chunk-prnebmz1.js → chunk-tmftv8na.js} +102 -102
- package/dist/chunk-tpax2gpz.js +2 -0
- package/dist/chunk-ts6sm467.js +2 -0
- package/dist/{chunk-46t924aw.js → chunk-v4bqmzj9.js} +2 -2
- package/dist/chunk-w005b56n.js +2 -0
- package/dist/{chunk-ema1c29k.js → chunk-w032x0zm.js} +2 -2
- package/dist/chunk-w8aj3f9v.js +2 -0
- package/dist/{chunk-ma9yq04p.js → chunk-wzv7k91a.js} +2 -2
- package/dist/chunk-x4077p94.js +2 -0
- package/dist/{chunk-3c2hgvag.js → chunk-x80b12gr.js} +3 -3
- package/dist/{chunk-sz2nax5v.js → chunk-xa1f13nk.js} +56 -56
- package/dist/{chunk-ybgzr6wn.js → chunk-xe8m66a3.js} +104 -102
- package/dist/{chunk-9qxx2teq.js → chunk-xndr2dx9.js} +6 -6
- package/dist/chunk-xrdh4at4.js +2 -0
- package/dist/chunk-y8qdpb0p.js +2 -0
- package/dist/chunk-ydjy26ch.js +2 -0
- package/dist/{chunk-k44qj40k.js → chunk-ym5qgw03.js} +2 -2
- package/dist/chunk-yx37mvy7.js +2 -0
- package/dist/{chunk-na1x46xm.js → chunk-z0qfspzg.js} +3 -3
- package/dist/chunk-z278w3cb.js +2 -0
- package/dist/chunk-z33esms3.js +3 -0
- package/dist/{chunk-hpaj7zjv.js → chunk-z46mk8ym.js} +4 -4
- package/dist/chunk-znfzh6fm.js +2 -0
- package/dist/chunk-zteccxj9.js +2 -0
- package/dist/cli.js +20 -20
- package/dist/component-renderer.d.ts +1 -0
- package/dist/component-renderer.js +28 -4
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/floating-actions.d.ts +43 -0
- package/dist/native/floating-actions.js +50 -0
- package/dist/native/index.d.ts +1 -0
- package/dist/native/index.js +1 -0
- package/dist/native/primitives/FloatingActions.stx +42 -0
- package/dist/native/runtime/browser-screen.js +3 -8
- package/dist/pwa.js +3 -3
- package/dist/safe-evaluator.d.ts +10 -0
- package/dist/safe-evaluator.js +24 -5
- package/dist/server-bindings.d.ts +11 -0
- package/dist/server-bindings.js +27 -0
- package/dist/ssg.js +15 -15
- package/dist/stx-virtual-ts.d.ts +31 -0
- package/dist/stx-virtual-ts.js +49 -2
- package/dist/typecheck.d.ts +1 -1
- package/dist/typecheck.js +5 -4
- package/package.json +5 -5
- package/dist/chunk-0d4zhbjz.js +0 -2
- package/dist/chunk-0vbt87cv.js +0 -2
- package/dist/chunk-11snc6n0.js +0 -2
- package/dist/chunk-1menbxwb.js +0 -2
- package/dist/chunk-1na30z8t.js +0 -2
- package/dist/chunk-1pf4y2yr.js +0 -2
- package/dist/chunk-1rban2td.js +0 -2
- package/dist/chunk-31rtwv90.js +0 -2
- package/dist/chunk-341c732h.js +0 -2
- package/dist/chunk-343hxxq1.js +0 -2
- package/dist/chunk-37bzsnr7.js +0 -2
- package/dist/chunk-3m6n90sk.js +0 -2
- package/dist/chunk-5bm8hmwd.js +0 -2
- package/dist/chunk-6bemqsdj.js +0 -2
- package/dist/chunk-6hd83cj4.js +0 -2
- package/dist/chunk-77fs8281.js +0 -2
- package/dist/chunk-79pgjds2.js +0 -2
- package/dist/chunk-86z8zrn9.js +0 -3
- package/dist/chunk-8xb9ecb9.js +0 -2
- package/dist/chunk-9c6yvh3p.js +0 -2
- package/dist/chunk-9fxeqf0e.js +0 -2
- package/dist/chunk-9m96yv69.js +0 -2
- package/dist/chunk-atsjexk0.js +0 -2
- package/dist/chunk-bcefawtc.js +0 -2
- package/dist/chunk-byjjz7h8.js +0 -2
- package/dist/chunk-c0azgkss.js +0 -2
- package/dist/chunk-cbz7jtzf.js +0 -2
- package/dist/chunk-cq06hsm4.js +0 -2
- package/dist/chunk-dsh91n7n.js +0 -2
- package/dist/chunk-evdskc25.js +0 -2
- package/dist/chunk-f8akfzzn.js +0 -2
- package/dist/chunk-f8wmxwa3.js +0 -2
- package/dist/chunk-fseqwysr.js +0 -2
- package/dist/chunk-g891ftgz.js +0 -2
- package/dist/chunk-gc7gh0g0.js +0 -2
- package/dist/chunk-gg48cgx3.js +0 -2
- package/dist/chunk-gzx1f8ay.js +0 -2
- package/dist/chunk-h526qmg2.js +0 -2
- package/dist/chunk-hazd1sh8.js +0 -2
- package/dist/chunk-j08r18x1.js +0 -2
- package/dist/chunk-j1sm889p.js +0 -2
- package/dist/chunk-j539dz72.js +0 -2
- package/dist/chunk-jmqwpnpd.js +0 -2
- package/dist/chunk-jqngvqby.js +0 -2
- package/dist/chunk-k33kgf8a.js +0 -2
- package/dist/chunk-ke8rxpp9.js +0 -2
- package/dist/chunk-kvttzk86.js +0 -2
- package/dist/chunk-mbcqpcyt.js +0 -20
- package/dist/chunk-mfbqjkgp.js +0 -3
- package/dist/chunk-my8257pf.js +0 -2
- package/dist/chunk-nm04926f.js +0 -2
- package/dist/chunk-nnnf8cjv.js +0 -2
- package/dist/chunk-p2fkggw4.js +0 -3
- package/dist/chunk-q18508s2.js +0 -2
- package/dist/chunk-r6085mp4.js +0 -2
- package/dist/chunk-rke4q3jk.js +0 -2
- package/dist/chunk-s4wcksaw.js +0 -3
- package/dist/chunk-se79v0pe.js +0 -2
- package/dist/chunk-twfx2scr.js +0 -2
- package/dist/chunk-txs1vxas.js +0 -42
- package/dist/chunk-v7d7m4k1.js +0 -2
- package/dist/chunk-vdb3p2v3.js +0 -2
- package/dist/chunk-vm2y05sr.js +0 -2
- package/dist/chunk-xc1k2zza.js +0 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`)}else{if(!Z(b,t,c,i(a)))continue;A=M(n(R),"@if",b)}r.push({start:a,end:E,replacement:A}),p.lastIndex=E}for(let a=r.length-1;a>=0;a--){let{start:g,end:l,replacement:d}=r[a];u=u.substring(0,g)+d+u.substring(l)}return u}return n(e)}function se(e){let c=e.trim();if(c==="")return;if(c==="true")return!0;if(c==="false")return!1;if(c==="null")return!1;if(c==="undefined")return!1;if(c==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(c)){let s=Number(c);return s!==0&&!Number.isNaN(s)}let t=c.match(/^'((?:\\.|[^'\\])*)'$/);if(t)return t[1].length>0;let n=c.match(/^"((?:\\.|[^"\\])*)"$/);if(n)return n[1].length>0;return}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),F=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function D(e,c,t,n){if(P.has(t.toLowerCase()))return n;let s=t.toLowerCase(),u=e.length,f=1,i=n;while(i<u){let p=e.indexOf("<",i);if(p===-1)return-1;if(i=p,e.startsWith("<!--",i)){let g=e.indexOf("-->",i+4);if(g===-1)return-1;i=g+3;continue}F.lastIndex=i;let m=F.exec(e);if(m){let g=e.indexOf(">",i);if(g===-1)return-1;if(e[g-1]==="/"){i=g+1;continue}let l=m[1].toLowerCase()==="script"?re:ie;l.lastIndex=i;let d=l.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;i=b+1;continue}if(e[i+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(i,i+64));if(!g){i++;continue}if(g[1].toLowerCase()===s){if(f--,i+=g[0].length,f===0)return i;continue}i+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(i,i+64));if(!r){i++;continue}let a=e.indexOf(">",i);if(a===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(i,a+1);if(!(/\/\s*>$/.test(g)||P.has(s)))f++}i=a+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,c){let t=c,n=e.length;for(;;){while(t<n&&e[t]!=="<")t++;if(t>=n)return!1;if(e.startsWith("<!--",t)){let f=e.indexOf("-->",t+4);if(f===-1)return!1;t=f+3;continue}break}if(e[t+1]==="/")return!1;let s=e.indexOf(">",t);if(s===-1)return!1;let u=e.slice(t,s+1);return oe.test(u)}function Jo(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let c=[],t=/<([a-zA-Z][\w-]*)/y,n=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);y(e,(r,a)=>{t.lastIndex=a;let g=t.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let l=t.lastIndex,d;while(l<r.length){let b=l;while(l<r.length&&n.test(r[l]))l++;let S=l;if(r[S]==="/"){S++;while(S<r.length&&n.test(r[S]))S++}if(r[S]===">"){if(d)c.push({start:a,end:S+1,tag:g[1],...d});return-1}if(l===b)return-1;let w=l;while(l<r.length&&!n.test(r[l])&&r[l]!=="="&&r[l]!==">")l++;if(l===w)return-1;let E=r.slice(w,l);if(E.startsWith("@")&&E.includes("("))return-1;let x=l,h=l;while(h<r.length&&n.test(r[h]))h++;if(r[h]!=="="){l=x;continue}h++;while(h<r.length&&n.test(r[h]))h++;let R=r[h];if(R==='"'||R==="'"){let A=r.indexOf(R,h+1);if(A===-1)return-1;if(!d&&R==='"'&&s.has(E))d={attrName:E,attrStart:b,attrEnd:A+1,value:r.slice(h+1,A)};l=A+1}else{l=h;while(l<r.length&&!n.test(r[l])&&r[l]!==">")l++}}return-1});let u=[],f=-1;for(let r of c){let{start:a,end:g,tag:l,attrName:d,value:b}=r;if(a<f)continue;let S=se(b);if(S===void 0)continue;let x=/\/\s*>$/.test(e.slice(a,g))||P.has(l.toLowerCase())?g:D(e,a,l,g);if(x===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ce(e,x))continue;if(S===!0){let R=e.slice(a,r.attrStart)+e.slice(r.attrEnd,g);u.push({start:a,end:g,replacement:R});continue}u.push({start:a,end:x,replacement:""}),f=x}if(u.length===0)return e;u.sort((r,a)=>r.start-a.start);let i=[],p=-1;for(let r of u){if(r.start<p)continue;i.push(r),p=r.end}let m=e;for(let r=i.length-1;r>=0;r--){let{start:a,end:g,replacement:l}=i[r];m=m.substring(0,a)+l+m.substring(g)}return m}var U=[":for","@for","x-for"];function
|
|
2
|
+
import{lt,wl}from"./chunk-agbkv9ab.js";import{I}from"./chunk-xppm4cs4.js";import{V,Ds,o,gn,q,y,Lc,Lt,vn,Be,Fe}from"./chunk-xe8m66a3.js";import{pr}from"./chunk-eh8g8kr1.js";import{B}from"./chunk-ybq56wam.js";import{pn}from"./chunk-833y1ndd.js";var X=`(?:"[^"]*"|'[^']*'|[^>"'])*`,H=/^<([a-zA-Z][a-zA-Z0-9-]*)\b((?:\s+[^=\s>]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]*))?)*\s*)>([\s\S]*)<\/\1>$/s,Q=65536,J=4,O=new Map;function Vh(){O.clear()}function K(e){let c=[];for(let t of y(e,q)){let n=t.token.match(/^<script\b([^>]*)>/i),s=t.token.match(/<\/script\s*>$/i);if(!n||!s)continue;let u=n[0].length,f=t.token.length-s[0].length;c.push(Object.freeze({fullMatch:t.token,attrs:n[1],body:t.token.slice(u,f),start:t.start,end:t.end}))}return c}function ys(e,c={}){let t=e.length>=Q,n=t?O.get(e):void 0;if(n===void 0){if(n=K(e),t)Lc(O,J),O.set(e,n)}let s=c.skipAttrs;if(!s)return n.slice();let u=[];for(let f of n)if(s.lastIndex=0,!s.test(f.attrs))u.push(f);return u}function Go(e){let c=e.trim(),t=c.match(/^([\s\S]+?)\s+as\s+(.+)$/);if(t){let s=t[1].trim(),u=t[2].trim(),{itemVar:f,indexVar:i}=z(u);if(f)return{style:"as",iterable:s,itemVar:f,indexVar:i}}let n=c.match(/^(\([^)]+\)|\w+(?:\s*,\s*\w+)?)\s+(?:in|of)\s+([\s\S]+)$/);if(n){let s=n[1].trim(),u=n[2].trim(),{itemVar:f,indexVar:i}=z(s);if(f)return{style:"in",iterable:u,itemVar:f,indexVar:i}}return{style:"unknown",iterable:null,itemVar:null,indexVar:null}}function z(e){let c=e.trim(),t=c.match(/^(\w+)\s*=>\s*(\w+)$/);if(t)return{itemVar:t[2],indexVar:t[1]};let n=c.match(/^\(\s*(\w+)(?:\s*,\s*(\w+))?\s*\)$/);if(n)return{itemVar:n[1],indexVar:n[2]||null};let s=c.match(/^(\w+)\s*,\s*(\w+)$/);if(s)return{itemVar:s[1],indexVar:s[2]};let u=c.match(/^(\w+)$/);if(u)return{itemVar:u[1],indexVar:null};return{itemVar:null,indexVar:null}}function bs(e,c){return wl(e,c)}function Y(e){let c=/@(if\s*\(|endif|elseif\s*\(|else\b)/g,t=0,n;while((n=c.exec(e))!==null){let s=n[1];if(s.startsWith("if"))t++;else if(s==="endif")t--;else if(t===0)return!0}return!1}function ur(e){let c=new Set,t=/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script>/gi,n=/\b(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*(?:state|derived|computed|ref|reactive|signal|useModel)\s*(?:<[^>]*>)?\s*\(/g,s;while((s=t.exec(e))!==null){let u=s[1],f;while((f=n.exec(u))!==null)c.add(f[1])}return c}function ee(e){if(!/[:@]for\s*=/.test(e)&&!/\bx-for\s*=/.test(e))return[];let c=new RegExp(`<([a-zA-Z][\\w-]*)\\b(${X})>`,"iy"),t=/(?:^|\s)(?::for|@for|x-for)\s*=\s*(?:"([^"]*)"|'([^']*)')/i,n=y(e,(u,f)=>{c.lastIndex=f;let i=c.exec(u);if(!i||i.index!==f||!t.test(i[2]))return-1;return c.lastIndex}),s=[];for(let u of n){c.lastIndex=0;let f=c.exec(u.token);if(!f)continue;let i=f[2].match(t),p=Go(i?.[1]??i?.[2]??""),m=[p.itemVar,p.indexVar].filter(Boolean);if(m.length===0)continue;let r=f[1],g=/\/\s*>$/.test(u.token)||P.has(r.toLowerCase())?u.end:D(e,u.start,r,u.end);if(g!==-1)s.push({start:u.start,end:g,vars:new Set(m)})}return s}var W=new Set(["true","false","null","undefined","NaN","Infinity","typeof","instanceof","in","of","new","void","delete","this","Math","JSON","Date","Number","String","Boolean","Array","Object","RegExp","Map","Set","Symbol","parseInt","parseFloat","isNaN","isFinite","encodeURIComponent","decodeURIComponent","encodeURI","decodeURI","window","document","console"]);function te(e){return e.replace(/'(?:\\.|[^'\\])*'/g,"''").replace(/"(?:\\.|[^"\\])*"/g,'""').replace(/`(?:\\.|[^`\\])*`/g,"``")}function Z(e,c,t,n){if(!e)return!1;let s=te(e),u=!1,f=!1,i=!1,p=/([a-zA-Z_$][\w$]*)/g,m;while((m=p.exec(s))!==null){let l=m[1];if(s.slice(0,m.index).trimEnd().endsWith("."))continue;if(W.has(l))continue;if(c.has(l)||n?.has(l))u=!0;else if(t&&l in t)f=!0}let r=/([a-zA-Z_$][\w$]*)(?:\.[a-zA-Z_$][\w$]*)*\s*\(\s*\)/g,a;while((a=r.exec(s))!==null){let l=a[1];if(s.slice(0,a.index).trimEnd().endsWith("."))continue;if(W.has(l)||t&&l in t)continue;i=!0}return(u||i)&&!f}function M(e,c,t){let n=t===void 0?` ${c}`:` ${c}="${t.replace(/"/g,""")}"`,s=e.trim(),u=s.match(H);if(u&&ne(u[3],u[1])){let[,f,i,p]=u;return`<${f}${i}${n}>${p}</${f}>`}return`<template${n}>${s}</template>`}function ne(e,c){let t=new RegExp(`<(/)?${c}(?=[\\s/>])`,"gi"),n=0,s;while((s=t.exec(e))!==null)if(s[1]){if(n--,n<0)return!1}else n++;return!0}function Xo(e,c){let t=ur(e);function n(s){let u=s,f=ee(s),i=(a)=>{let g=new Set;for(let l of f)if(a>l.start&&a<l.end)for(let d of l.vars)g.add(d);return g},p=/@if\s*\(/g,m,r=[];while((m=p.exec(u))!==null){let a=m.index,g=a+m[0].length,l=1,d=g;while(d<u.length&&l>0){if(u[d]==="(")l++;else if(u[d]===")")l--;d++}if(l!==0)continue;let b=u.substring(g,d-1).trim(),S=d,w=1,E=S,x=/@(if\s*\(|endif)/g;x.lastIndex=S;let h;while((h=x.exec(u))!==null)if(h[1].startsWith("if"))w++;else if(h[1]==="endif"){if(w--,w===0){E=h.index+h[0].length;break}}if(w!==0)continue;let R=u.substring(S,E-6).trim(),A;if(Y(R)){let C=pn(u.substring(a,E));if(C.length===0)continue;let k=C[0].branches.filter((_)=>_.type!=="else"),L=i(a);if(!(k.length>0&&k.every((_)=>Z(_.condition,t,c,L))))continue;A=C[0].branches.map((_)=>{let N=n(_.content);if(_.type==="elseif")return M(N,"@else-if",_.condition??"");if(_.type==="else")return M(N,"@else");return M(N,"@if",_.condition??"")}).join(`
|
|
3
|
+
`)}else{if(!Z(b,t,c,i(a)))continue;A=M(n(R),"@if",b)}r.push({start:a,end:E,replacement:A}),p.lastIndex=E}for(let a=r.length-1;a>=0;a--){let{start:g,end:l,replacement:d}=r[a];u=u.substring(0,g)+d+u.substring(l)}return u}return n(e)}function se(e){let c=e.trim();if(c==="")return;if(c==="true")return!0;if(c==="false")return!1;if(c==="null")return!1;if(c==="undefined")return!1;if(c==="NaN")return!1;if(/^-?\d+(?:\.\d+)?$/.test(c)){let s=Number(c);return s!==0&&!Number.isNaN(s)}let t=c.match(/^'((?:\\.|[^'\\])*)'$/);if(t)return t[1].length>0;let n=c.match(/^"((?:\\.|[^"\\])*)"$/);if(n)return n[1].length>0;return}var P=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),F=/<(script|style)\b/iy,re=/<\/script/gi,ie=/<\/style/gi;function D(e,c,t,n){if(P.has(t.toLowerCase()))return n;let s=t.toLowerCase(),u=e.length,f=1,i=n;while(i<u){let p=e.indexOf("<",i);if(p===-1)return-1;if(i=p,e.startsWith("<!--",i)){let g=e.indexOf("-->",i+4);if(g===-1)return-1;i=g+3;continue}F.lastIndex=i;let m=F.exec(e);if(m){let g=e.indexOf(">",i);if(g===-1)return-1;if(e[g-1]==="/"){i=g+1;continue}let l=m[1].toLowerCase()==="script"?re:ie;l.lastIndex=i;let d=l.exec(e);if(d===null)return-1;let b=e.indexOf(">",d.index);if(b===-1)return-1;i=b+1;continue}if(e[i+1]==="/"){let g=/^<\/([a-z][\w-]*)\s*>/i.exec(e.slice(i,i+64));if(!g){i++;continue}if(g[1].toLowerCase()===s){if(f--,i+=g[0].length,f===0)return i;continue}i+=g[0].length;continue}let r=/^<([a-z][\w-]*)\b/i.exec(e.slice(i,i+64));if(!r){i++;continue}let a=e.indexOf(">",i);if(a===-1)return-1;if(r[1].toLowerCase()===s){let g=e.slice(i,a+1);if(!(/\/\s*>$/.test(g)||P.has(s)))f++}i=a+1}return-1}var oe=/\s(?::else-if|x-else-if|@else-if|:else|x-else|@else)(?=[=\s/>])/;function ce(e,c){let t=c,n=e.length;for(;;){while(t<n&&e[t]!=="<")t++;if(t>=n)return!1;if(e.startsWith("<!--",t)){let f=e.indexOf("-->",t+4);if(f===-1)return!1;t=f+3;continue}break}if(e[t+1]==="/")return!1;let s=e.indexOf(">",t);if(s===-1)return!1;let u=e.slice(t,s+1);return oe.test(u)}function Jo(e){if(!e.includes(":if")&&!e.includes(":show")&&!e.includes("x-if")&&!e.includes("x-show")&&!e.includes("@if=")&&!e.includes("@show="))return e;let c=[],t=/<([a-zA-Z][\w-]*)/y,n=/\s/,s=new Set([":if",":show","x-if","x-show","@if","@show"]);y(e,(r,a)=>{t.lastIndex=a;let g=t.exec(r);if(!g||/^(?:script|style)$/i.test(g[1]))return-1;let l=t.lastIndex,d;while(l<r.length){let b=l;while(l<r.length&&n.test(r[l]))l++;let S=l;if(r[S]==="/"){S++;while(S<r.length&&n.test(r[S]))S++}if(r[S]===">"){if(d)c.push({start:a,end:S+1,tag:g[1],...d});return-1}if(l===b)return-1;let w=l;while(l<r.length&&!n.test(r[l])&&r[l]!=="="&&r[l]!==">")l++;if(l===w)return-1;let E=r.slice(w,l);if(E.startsWith("@")&&E.includes("("))return-1;let x=l,h=l;while(h<r.length&&n.test(r[h]))h++;if(r[h]!=="="){l=x;continue}h++;while(h<r.length&&n.test(r[h]))h++;let R=r[h];if(R==='"'||R==="'"){let A=r.indexOf(R,h+1);if(A===-1)return-1;if(!d&&R==='"'&&s.has(E))d={attrName:E,attrStart:b,attrEnd:A+1,value:r.slice(h+1,A)};l=A+1}else{l=h;while(l<r.length&&!n.test(r[l])&&r[l]!==">")l++}}return-1});let u=[],f=-1;for(let r of c){let{start:a,end:g,tag:l,attrName:d,value:b}=r;if(a<f)continue;let S=se(b);if(S===void 0)continue;let x=/\/\s*>$/.test(e.slice(a,g))||P.has(l.toLowerCase())?g:D(e,a,l,g);if(x===-1)continue;if((d===":if"||d==="x-if"||d==="@if")&&ce(e,x))continue;if(S===!0){let R=e.slice(a,r.attrStart)+e.slice(r.attrEnd,g);u.push({start:a,end:g,replacement:R});continue}u.push({start:a,end:x,replacement:""}),f=x}if(u.length===0)return e;u.sort((r,a)=>r.start-a.start);let i=[],p=-1;for(let r of u){if(r.start<p)continue;i.push(r),p=r.end}let m=e;for(let r=i.length-1;r>=0;r--){let{start:a,end:g,replacement:l}=i[r];m=m.substring(0,a)+l+m.substring(g)}return m}var U=[":for","@for","x-for"];function Vf(e){let c=/(\s)((?::|@|x-|v-)[\w.:-]+)\s*=\s*"([^"]*\{\{[^"]*)"/g;return e.replace(c,(t,n,s,u)=>{let f=u.replace(/'((?:[^'\\]|\\.)*)'/g,(i,p)=>{if(!p.includes("{{"))return i;return`\`${p.replace(/`/g,"\\`").replace(/\$\{/g,"\\${").replace(/\{\{\s*([^}]+?)\s*\}\}/g,(r,a)=>`\${${a}}`)}\``});return`${n}${s}="${f}"`})}function ws(e,c){if(!c||Object.keys(c).length===0)return e;if(!U.some((i)=>e.includes(`${i}=`)))return e;let t=ur(e);if(Array.isArray(c.__stx_client_signal_names)){for(let i of c.__stx_client_signal_names)if(typeof i==="string")t.add(i)}let n=e,s=[],u=/<([a-zA-Z][\w-]*)((?:[^>"']|"[^"]*"|'[^']*')*)>/g,f;while((f=u.exec(n))!==null){let[i,p,m]=f,r=f.index,a=r+i.length,g=U.map((A)=>({attr:A,m:new RegExp(`\\s${A}="([^"]*)"`).exec(m)})).find((A)=>A.m!==null);if(!g||!g.m)continue;let l=Go(g.m[1]);if(!l.iterable||!l.itemVar)continue;let d=l.iterable.trim().split(/[.[(]/)[0].trim();if(!d||t.has(d)||!(d in c))continue;let b=D(n,r,p,a);if(b===-1)continue;let S=m.replace(new RegExp(`\\s${g.attr}="[^"]*"`),"").replace(/\s:key="[^"]*"/,"").replace(/\sx-cloak(?=\s|$)/,""),w=n.slice(a,b-`</${p}>`.length),E={...c,[l.itemVar]:void 0};if(l.indexVar)E[l.indexVar]=void 0;let x=ws(w,E),h=l.indexVar?`${l.iterable} as ${l.indexVar} => ${l.itemVar}`:`${l.iterable} as ${l.itemVar}`,R=p.toLowerCase()==="template"?x:`<${p}${S}>${x}</${p}>`;s.push({start:r,end:b,replacement:`@foreach(${h})${R}@endforeach`}),u.lastIndex=b}for(let i=s.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=s[i];n=n.slice(0,p)+r+n.slice(m)}return n}function vs(e,c){let t=e,n=/@(for|foreach)\s*\(/g,s,u=[],f=[];while((s=n.exec(t))!==null){let i=s[1],p=s.index,m=p+s[0].length,r=1,a=m;while(a<t.length&&r>0){if(t[a]==="(")r++;else if(t[a]===")")r--;a++}if(r!==0)continue;let g=t.substring(m,a-1).trim(),l=a,d=Go(g),b=i==="for"?"@endfor":"@endforeach",S=1,w=l,E=i==="for"?new RegExp("@(for(?!each)\\s*\\(|endfor(?!each))","g"):new RegExp(`@(${i}\\s*\\(|end${i})`,"g");E.lastIndex=l;let x;while((x=E.exec(t))!==null)if(x[1].startsWith(i))S++;else if(S--,S===0){w=x.index+x[0].length;break}if(S!==0)continue;let h=()=>{let v=[d.itemVar,d.indexVar].filter(Boolean);if(v.length)f.push({start:p,end:w,vars:v})};if(d.iterable){let v=d.iterable.trim();if(v.startsWith("[")||v.startsWith("{")||v.startsWith("'")||v.startsWith('"')||v.startsWith("`")||/^-?\d/.test(v)){h();continue}let T=v.split(/[.[(]/)[0].trim(),_=c?T in c:!1,N=f.some((j)=>p>j.start&&p<j.end&&j.vars.includes(T));if(T&&(_||N)){h();continue}}if(d.style==="as")g=d.indexVar?`(${d.itemVar}, ${d.indexVar}) in ${d.iterable}`:`${d.itemVar} in ${d.iterable}`;let R=t.substring(l,w-b.length).trim(),A=c?{...c}:{};if(d.itemVar)delete A[d.itemVar];if(d.indexVar)delete A[d.indexVar];let C=Vf(vs(R,A)),k=C.match(H),L;if(k){let[,v,T,_]=k;L=`<${v}${T} @for="${g}">${_}</${v}>`}else L=`<template @for="${g}">${C}</template>`;u.push({start:p,end:w,replacement:L}),n.lastIndex=w}for(let i=u.length-1;i>=0;i--){let{start:p,end:m,replacement:r}=u[i];t=t.substring(0,p)+r+t.substring(m)}return t}function ae(e){let c=new Set,t=[],n=0,s=0,u=e.length,f=(r)=>{let a=n+1;while(a<u){let g=e[a];if(g==="\\"){a+=2;continue}if(g===r)return a+1;a++}return u},i=()=>{let r=n+2;while(r<u&&e[r]!==`
|
|
4
4
|
`)r++;return r},p=()=>{let r=n+2;while(r<u-1){if(e[r]==="*"&&e[r+1]==="/")return r+2;r++}return u},m=(r)=>{let a=r,g=0;while(a<u){let l=e[a];if(l==="/"&&e[a+1]==="/"){let d=a+2;while(d<u&&e[d]!==`
|
|
5
|
-
`)d++;a=d;continue}if(l==="/"&&e[a+1]==="*"){let d=a+2;while(d<u-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;a=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=a+1;while(d<u){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}a=d;continue}if(l==="("||l==="["||l==="{"){g++,a++;continue}if(l===")"||l==="]"||l==="}"){g--,a++;continue}if(l===";"&&g===0)return a+1;a++}return u};while(n<u){let r=e[n];if(r==="/"&&e[n+1]==="/"){let a=i();t.push(e.slice(n,a)),n=a;continue}if(r==="/"&&e[n+1]==="*"){let a=p();t.push(e.slice(n,a)),n=a;continue}if(r==='"'||r==="'"||r==="`"){let a=f(r);t.push(e.slice(n,a)),n=a;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let a=n>0?e[n-1]:"";if(a===""||/\s/.test(a)||a===";"||a==="}"||a==="{"){let l=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=m(n+l[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function ue(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return y(e,(s,u)=>{c.lastIndex=u;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=u+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!le.has(i))t=p;return u+f[0].length}),n??t}function fe(e,c,t,n){let s=[],u=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),u,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function xs(e,c,t,n={}){let s=ys(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),u=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-
|
|
5
|
+
`)d++;a=d;continue}if(l==="/"&&e[a+1]==="*"){let d=a+2;while(d<u-1&&!(e[d]==="*"&&e[d+1]==="/"))d++;a=d+2;continue}if(l==='"'||l==="'"||l==="`"){let d=a+1;while(d<u){if(e[d]==="\\"){d+=2;continue}if(e[d]===l){d++;break}d++}a=d;continue}if(l==="("||l==="["||l==="{"){g++,a++;continue}if(l===")"||l==="]"||l==="}"){g--,a++;continue}if(l===";"&&g===0)return a+1;a++}return u};while(n<u){let r=e[n];if(r==="/"&&e[n+1]==="/"){let a=i();t.push(e.slice(n,a)),n=a;continue}if(r==="/"&&e[n+1]==="*"){let a=p();t.push(e.slice(n,a)),n=a;continue}if(r==='"'||r==="'"||r==="`"){let a=f(r);t.push(e.slice(n,a)),n=a;continue}if(r==="{"){s++,t.push(r),n++;continue}if(r==="}"){s--,t.push(r),n++;continue}if(s===0){let a=n>0?e[n-1]:"";if(a===""||/\s/.test(a)||a===";"||a==="}"||a==="{"){let l=e.slice(n).match(/^(const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=/);if(l){let d=l[2],b=m(n+l[0].length);if(c.has(d)){t.push(`/* stx: deduped const ${d} */`),n=b;continue}c.add(d),t.push(e.slice(n,b)),n=b;continue}}}t.push(r),n++}return t.join("")}var le=new Set(["script","style","html","head","meta","link","title","!doctype"]);function ue(e){let c=new RegExp(`<([a-zA-Z][a-zA-Z0-9-]*)\\b(${X})>`,"iy"),t=null,n=null;return y(e,(s,u)=>{c.lastIndex=u;let f=c.exec(s);if(!f)return-1;let i=f[1].toLowerCase();if(i==="script"||i==="style")return-1;let p=u+f[0].length-1;if(i==="body"&&n===null)n=p;if(t===null&&!le.has(i))t=p;return u+f[0].length}),n??t}function fe(e,c,t,n){let s=[],u=` data-stx="${n}"`,f=0,i=!1,p=(m)=>{if(t!==null&&!i&&t>=f&&t<=m)s.push(e.slice(f,t),u,e.slice(t,m)),i=!0;else s.push(e.slice(f,m))};for(let m of c){if(m.start<f)continue;p(m.start),f=m.end}return p(e.length),s.join("")}async function xs(e,c,t,n={}){let s=ys(e,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b/}),u=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useStore|useLocalStorage|useSessionStorage|keptState|useCookie|useId|useModel|useReactiveProp|useFetch|useRef|useEventListener|useDebounce|useDebouncedValue|useThrottle|useInterval|useTimeout|useToggle|useCounter|useClickOutside|useFocus|useAsync|useColorMode|useDark|useMediaQuery|useScrollLock|usePreferredDark|usePreferredLight|usePreferredReducedMotion|usePreferredContrast|useWebSocket|useRoute|useSearchParams|onMount|onDestroy|defineProps|withDefaults|defineEmits|defineExpose|defineSlots|useOptimistic)\s*(?:<[^>]*>)?\s*\(/,f=[],{hasUserImports:i,bundleClientScript:p}=await o("stx/client-script-bundler",()=>import("./chunk-zteccxj9.js"));for(let x of s){let h=x.body;if(Be(x.attrs))h=Fe(h);if(n.forceClientSetup||u.test(h)){f.push({content:h,start:x.start,end:x.end});continue}if(!i(h))continue;try{let R=await p(Lt(h).code,c||"",{projectRoot:process.cwd(),externalizeUserModules:!1});if(u.test(R))f.push({content:h,start:x.start,end:x.end})}catch{}}if(f.length===0)return{output:e,setupCode:null};let m=`${c??""}\x00${f.map((x)=>x.content).join("\x00")}`,r=`__stx_setup_${Bun.hash(m).toString(36).slice(0,10)}`,a=[];for(let x=0;x<f.length;x++){let h=f[x].bundled??Lt(f[x].content).code;if(!f[x].bundled&&i(h))h=await p(h,c||"",{projectRoot:process.cwd()});h=xt(h);let R=I(h);a.push(`// \u2500\u2500 merged signal script #${x+1} \u2500\u2500
|
|
6
6
|
${R}`)}let g=a.join(`
|
|
7
7
|
|
|
8
8
|
`);g=ae(g);let d=V(g).split(",").map((x)=>x.trim()).filter(Boolean),b=vn(g,t),S=`
|
|
9
9
|
<script data-stx-scoped>
|
|
10
10
|
function ${r}() {
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
return ${
|
|
11
|
+
${lt("const",d)}
|
|
12
|
+
${gn(`${b}${g}`)}
|
|
13
|
+
return ${Ds(g,d)};
|
|
14
14
|
}
|
|
15
15
|
window.__stx_latestSetup=${r};
|
|
16
16
|
if(window.stx)window.stx._latestSetup=${r};
|
|
17
|
-
</script>`,w=ue(e);return{output:fe(e,f,w,r),setupCode:S}}async function Yo(e,c,t,n){if(!bs(e,t))return e;let s=e;if(c.skipSignalsRuntime)return s;let{output:u,setupCode:f}=await xs(s,t,n);if(s=u,!f){let i=B(s);if(i&&!/data-stx/.test(i.attrs)&&!/data-stx-auto/.test(i.attrs)){let p=i.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");s=s.slice(0,i.index)+p+s.slice(i.index+i.tag.length)}}if(s=await pr(s,c),f){let i=
|
|
17
|
+
</script>`,w=ue(e);return{output:fe(e,f,w,r),setupCode:S}}async function Yo(e,c,t,n){if(!bs(e,t))return e;let s=e;if(c.skipSignalsRuntime)return s;let{output:u,setupCode:f}=await xs(s,t,n);if(s=u,!f){let i=B(s);if(i&&!/data-stx/.test(i.attrs)&&!/data-stx-auto/.test(i.attrs)){let p=i.tag.replace(/^<body([^>]*)>$/i,"<body$1 data-stx-auto>");s=s.slice(0,i.index)+p+s.slice(i.index+i.tag.length)}}if(s=await pr(s,c),f){let i=mc(s,/<\/head>/i),p=i===-1?mc(s,/<body[^>]*>/i):-1;if(i!==-1)s=`${s.slice(0,i)}${f}
|
|
18
18
|
${s.slice(i)}`;else if(p!==-1){let m=/<body[^>]*>/i.exec(s.slice(p))[0],r=p+m.length;s=`${s.slice(0,r)}
|
|
19
19
|
${f}${s.slice(r)}`}else s=`${s}
|
|
20
|
-
${f}`}return s}function
|
|
21
|
-
export{
|
|
20
|
+
${f}`}return s}function mc(e,c){let t=/<(script|style)\b[\s\S]*?<\/\1>/gi,n=[],s;while((s=t.exec(e))!==null)n.push([s.index,s.index+s[0].length]);let u=new RegExp(c.source,c.flags.replace(/[gy]/g,"")),f=0;while(f<e.length){let i=u.exec(e.slice(f));if(!i)return-1;let p=f+i.index;if(!n.some(([r,a])=>p>=r&&p<a))return p;f=p+Math.max(i[0].length,1)}return-1}var G="/* [stx import stripped, resolved via window.stx in __stx_setup] */";function Uf(e){let c=[];for(let t of e.split(",")){let n=t.trim();if(!n||n.startsWith("type "))continue;let s=n.match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(s&&s[1]!==s[2])c.push(`${s[2]} = ${s[1]}`)}if(c.length===0)return G;return`var ${c.join(", ")}; ${G}`}var de=/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm;function xt(e){return e.replace(de,(c,t)=>Uf(t))}
|
|
21
|
+
export{Vh,ys,Go,bs,ur,Xo,Jo,Vf,ws,vs,xs,Yo,mc,Uf,xt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{u,f,cl,d,t,l}from"./chunk-eg2p1cyw.js";import{Qe,xt,dn,Zo}from"./chunk-he9dzchk.js";function L(w,e){try{let p=w.trim();if(f(p))return d(p,Object.keys(e))(...Object.values(e));else return u(p,e)}catch{return!1}}function Q(w,e,p){let n=w,v=!0;while(v){v=!1;let g=n.match(/@switch\s*\(/);if(!g||g.index===void 0)break;let b=g.index,s=Zo(n,b);if(!s)break;try{let o;if(f(s.expression))o=d(s.expression,Object.keys(e))(...Object.values(e));else o=u(s.expression,e);let r="",a=!1;for(let i of s.cases)if(i.type==="default"){if(!a)r=i.content.trim()}else try{let y;if(i.value&&f(i.value))y=d(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=u(i.value,e);if(o===y){r=i.content.trim(),a=!0;break}}catch{continue}n=n.substring(0,b)+r+n.substring(s.end),v=!0}catch(o){let r=o instanceof Error?o.message:String(o),a=l("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+a+n.substring(s.end);break}}return n}function H(w){let e=[];return{masked:w.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(n)=>(e.push(n),`\x00stx-script-${e.length-1}\x00`)),scripts:e}}function J(w,e){if(e.length===0)return w;return w.replace(/\u0000stx-script-(\d+)\u0000/g,(p,n)=>e[Number(n)]??p)}function oe(w,e,p){let{masked:n,scripts:v}=H(w);return J(K(n,e,p),v)}function K(w,e,p){let n=w;n=Q(n,e,p);{let g=!0;while(g){g=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Qe(n,s+7);if(!o)break;let r=o.endPos,a=xt(n,"unless","endunless",r);if(a===-1){console.warn(`[stx] @unless directive at position ${s} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let i=n.slice(r,a),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,h=/@(?:endif|endunless)(?![a-z])/g,E=/@else(?![a-z])/g,S=[],C;while((C=k.exec(i))!==null)S.push({pos:C.index,type:"open"});while((C=h.exec(i))!==null)S.push({pos:C.index,type:"close"});while((C=E.exec(i))!==null)S.push({pos:C.index,type:"else"});S.sort((P,R)=>P.pos-R.pos);for(let P of S)if(P.type==="open")x++;else if(P.type==="close")x--;else if(P.type==="else"&&x===0){m=P.pos;break}}let c;if(m!==-1){let x=i.slice(0,m),k=i.slice(m+5);c=`@if (${y})${k}@else ${x}@endif`}else c=`@if (!(${y}))${i}@endif`;n=n.substring(0,s)+c+n.substring(a+10),g=!0}}n=qo(n,e,p),n=Ko(n,e,p),n=Wo(n,e);let v=()=>{let g=dn(n);if(g.length===0)return!1;let b=Array(g.length);for(let r=g.length-1;r>=0;r--){let a=g[r];try{let i="",y=!1;for(let m of a.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?cl(m.condition,e):!1)i=m.content,y=!0}catch(c){i=l(m.type==="if"?"If":"Elseif",`Error in @${m.type}(${m.condition}): ${c instanceof Error?c.message:String(c)}`,t.EVALUATION_ERROR),y=!0}}b[r]=i}catch(i){let y=i instanceof Error?i.message:String(i);b[r]=l("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(g.length*2+1),o=0;for(let r=0;r<g.length;r++){let a=g[r];s[r*2]=n.slice(o,a.start),s[r*2+1]=b[r],o=a.end}return s[g.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let g=n;if(!v())break;if(n===g)break}return n}function q(w){let e=0;while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!=="(")return null;e++;while(e<w.length&&/\s/.test(w[e]))e++;let p=w[e];if(p!=="'"&&p!=='"')return null;e++;let n=[];while(e<w.length){let v=w[e];if(v==="\\"&&e+1<w.length){n.push(w[e+1]),e+=2;continue}if(v===p){e++;break}n.push(v),e++}while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!==")")return null;return e++,{value:n.join(""),consumed:e}}function Wo(w,e){let p=w;function n(s,o,r,a){let i=1,y=a,m=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),c=new RegExp(`@${r}(?![a-z])`,"g");while(y<s.length&&i>0){m.lastIndex=y,c.lastIndex=y;let x=m.exec(s),k=c.exec(s),h=x?x.index:1/0,E=k?k.index:1/0;if(h<E)i++,y=h+x[0].length;else if(E<1/0){if(i--,i===0)return E;y=E+k[0].length}else break}return-1}function v(s,o,r){let a=0,i=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),y=new RegExp(`@${r}(?![a-z])`,"g"),m=/@else(?![a-z])/g,c=[],x;while((x=i.exec(s))!==null)c.push({pos:x.index,type:"open"});while((x=y.exec(s))!==null)c.push({pos:x.index,type:"close"});while((x=m.exec(s))!==null)c.push({pos:x.index,type:"else"});c.sort((k,h)=>k.pos-h.pos);for(let k of c)if(k.type==="open")a++;else if(k.type==="close")a--;else if(k.type==="else"&&a===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=p.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+5),m=q(y);if(m)a=m.value,i=r+5+m.consumed;else i=r+5;let c=n(p,"auth","endauth",i);if(c===-1){console.warn(`[stx] @auth directive at position ${r} has no matching @endauth \u2014 the block was skipped.`);break}let x=p.slice(i,c),k=v(x,"auth","endauth"),h;if(!e.auth)h=!1;else h=a?L(`auth?.check && auth?.user?.[${a}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=p.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+6),m=q(y);if(m)a=m.value,i=r+6+m.consumed;else i=r+6;let c=n(p,"guest","endguest",i);if(c===-1){console.warn(`[stx] @guest directive at position ${r} has no matching @endguest \u2014 the block was skipped.`);break}let x=p.slice(i,c),k=v(x,"guest","endguest"),h;if(!e.auth)h=!0;else h=a?L(`!auth?.check || !auth?.user?.[${a}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+9),s=!0}}function g(s,o,r){if(e.userCan&&typeof e.userCan[s]==="boolean")return e.userCan[s];if(e.permissions?.check&&typeof e.permissions.check==="function")try{let a=[s];if(o)a.push(o);if(r){let i=L(r,e);a.push(i)}return e.permissions.check(...a)}catch{return!1}return!1}function b(s){let o=s.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!o)return null;return{ability:o[1],type:o[2],id:o[3]?.trim(),paramsEnd:o[0].length}}for(let s of["can","cannot"]){let o=`end${s}`,r=s==="can"?"elsecan":"elsecannot",a=!0;while(a){a=!1;let i=p.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=p.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(p,s,o,x);if(k===-1){console.warn(`[stx] @${s} directive at position ${y} has no matching @${o} \u2014 the block was skipped.`);break}let h=p.slice(x,k),E=[],S=0,C=new RegExp(`@${s}\\s*\\(`,"g"),P=new RegExp(`@${o}(?![a-z])`,"g"),R=new RegExp(`@${r}\\s*\\(`,"g"),T=/@else(?![a-z])/g,_=[],M;while((M=C.exec(h))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(h))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(h))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(h))!==null)_.push({pos:M.index,type:"else"});_.sort((A,z)=>A.pos-z.pos);for(let A of _){if(A.type==="open"){S++;continue}if(A.type==="close"){S--;continue}if(S===0)E.push(A)}let I=[],F=0;for(let A=0;A<E.length;A++){let z=E[A];if(I.push({content:h.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=h.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:h.slice(F,z.pos)},F=z.pos+`@${r}`.length+B.paramsEnd,I.push({content:"",ability:B.ability,type:B.type,id:B.id}),I.pop();let G=E[A+1],U=G?G.pos:h.length;I.push({content:h.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<h.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:h.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:h.slice(F)})}let O=g(c.ability,c.type,c.id),j=s==="can"?O:!O,V="";if(j)V=I[0]?.content||"";else{let A=!1;for(let z=1;z<I.length;z++){let D=I[z];if(D.isFinalElse){V=D.content,A=!0;break}if(D.ability){let B=g(D.ability,D.type,D.id);if(s==="can"?B:!B){V=D.content,A=!0;break}}}if(!A&&I.length>0){let z=I[I.length-1];if(z.isFinalElse)V=z.content}}p=p.substring(0,y)+V+p.substring(k+`@${o}`.length),a=!0}}return p}function qo(w,e,p){let n=w;function v(g,b,s,o,r){let a=!0;while(a){a=!1;let i=new RegExp(`@${b}\\s*\\(`),y=g.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Qe(g,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=xt(g,b,s,x);if(k===-1){console.warn(`[stx] @${b} directive at position ${m} has no matching @${s} \u2014 the block was skipped.`);break}let h=g.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<h.length){let R=h.indexOf("@",P);if(R===-1)break;let T=h.substring(R);if(/^@(?:if|unless|isset|empty)\s*\(/.test(T)){C++,P=R+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(T)){C--,P=R+1;continue}if(C===0&&/^@else(?![a-z])/.test(T)){S=R;break}P=R+1}try{let R=o(E.trim()),T;if(S!==-1){let _=h.slice(0,S),M=h.slice(S+5);T=R?_:M}else T=R?h:"";g=g.substring(0,m)+T+g.substring(k+`@${s}`.length),a=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=l(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);g=g.substring(0,m)+_+g.substring(k+`@${s}`.length);break}}return g}return n=v(n,"isset","endisset",(g)=>{let b=L(g,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(g)=>{let b=L(g,e);return b===void 0||b===null||b===""||b===0||b===!1||Array.isArray(b)&&b.length===0||typeof b==="object"&&b!==null&&Object.keys(b).length===0},"Empty"),n}function Ko(w,e,p){let n=w,v="development";function g(b,s,o,r){let a=new RegExp(`@${s}(?![a-z])`,"g"),i=new RegExp(`@${o}(?![a-z])`,"g"),y=new RegExp(`^@${s}(?![a-z])`),m=new RegExp(`^@${o}(?![a-z])`),c=b,x=!0;while(x){x=!1,a.lastIndex=0;let k=a.exec(c);if(!k)break;let h=k.index,E=h+k[0].length;if(s==="env"){let O=c.substring(E).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!O)break;E+=O[0].length,r=v===O[2]}let S=1,C=E,P=-1;while(S>0&&C<c.length){a.lastIndex=C,i.lastIndex=C;let O=a.exec(c),j=i.exec(c),V=O?O.index:1/0,A=j?j.index:1/0;if(V<A)S++,C=V+O[0].length;else if(A<1/0){if(S--,S===0){P=A;break}C=A+j[0].length}else break}if(P===-1){console.warn(`[stx] @${s} directive at position ${h} has no matching @${o} \u2014 the block was skipped.`);break}let R=c.substring(E,P),T=-1,_=0,M=0;while(M<R.length){let O=R.indexOf("@",M);if(O===-1)break;let j=R.substring(O);if(y.test(j)){_++,M=O+1;continue}if(m.test(j)){_--,M=O+1;continue}if(_===0&&/^@else(?![a-z])/.test(j)){T=O;break}M=O+1}let I;if(T!==-1){let O=R.slice(0,T),j=R.slice(T+5);I=r?O:j}else I=r?R:"";let F=`@${o}`.length;c=c.substring(0,h)+I+c.substring(P+F),x=!0}return c}return n=g(n,"env","endenv",!1),n=g(n,"production","endproduction",v==="production"),n=g(n,"development","enddevelopment",v==="development"),n=g(n,"staging","endstaging",v==="staging"),n=g(n,"testing","endtesting",v==="testing"),n}
|
|
2
|
+
import{u,f,ll,d,t,l}from"./chunk-k47addf7.js";import{Qe,St,pn,Zo}from"./chunk-833y1ndd.js";function L(w,e){try{let p=w.trim();if(f(p))return d(p,Object.keys(e))(...Object.values(e));else return u(p,e)}catch{return!1}}function Q(w,e,p){let n=w,v=!0;while(v){v=!1;let g=n.match(/@switch\s*\(/);if(!g||g.index===void 0)break;let b=g.index,s=Zo(n,b);if(!s)break;try{let o;if(f(s.expression))o=d(s.expression,Object.keys(e))(...Object.values(e));else o=u(s.expression,e);let r="",a=!1;for(let i of s.cases)if(i.type==="default"){if(!a)r=i.content.trim()}else try{let y;if(i.value&&f(i.value))y=d(i.value,Object.keys(e))(...Object.values(e));else if(i.value)y=u(i.value,e);if(o===y){r=i.content.trim(),a=!0;break}}catch{continue}n=n.substring(0,b)+r+n.substring(s.end),v=!0}catch(o){let r=o instanceof Error?o.message:String(o),a=l("Switch",`Error evaluating @switch expression: ${r}`,t.EVALUATION_ERROR);n=n.substring(0,b)+a+n.substring(s.end);break}}return n}function H(w){let e=[];return{masked:w.replace(/<script\b[\s\S]*?<\/script\s*>/gi,(n)=>(e.push(n),`\x00stx-script-${e.length-1}\x00`)),scripts:e}}function J(w,e){if(e.length===0)return w;return w.replace(/\u0000stx-script-(\d+)\u0000/g,(p,n)=>e[Number(n)]??p)}function oe(w,e,p){let{masked:n,scripts:v}=H(w);return J(K(n,e,p),v)}function K(w,e,p){let n=w;n=Q(n,e,p);{let g=!0;while(g){g=!1;let b=n.match(/@unless\s*\(/);if(!b||b.index===void 0)break;let s=b.index,o=Qe(n,s+7);if(!o)break;let r=o.endPos,a=St(n,"unless","endunless",r);if(a===-1){console.warn(`[stx] @unless directive at position ${s} has no matching @endunless \u2014 the block was skipped. Check for typos or missing closers.`);break}let i=n.slice(r,a),y=o.expression,m=-1;{let x=0,k=/@(?:if|unless)\s*\(/g,h=/@(?:endif|endunless)(?![a-z])/g,E=/@else(?![a-z])/g,S=[],C;while((C=k.exec(i))!==null)S.push({pos:C.index,type:"open"});while((C=h.exec(i))!==null)S.push({pos:C.index,type:"close"});while((C=E.exec(i))!==null)S.push({pos:C.index,type:"else"});S.sort((P,R)=>P.pos-R.pos);for(let P of S)if(P.type==="open")x++;else if(P.type==="close")x--;else if(P.type==="else"&&x===0){m=P.pos;break}}let c;if(m!==-1){let x=i.slice(0,m),k=i.slice(m+5);c=`@if (${y})${k}@else ${x}@endif`}else c=`@if (!(${y}))${i}@endif`;n=n.substring(0,s)+c+n.substring(a+10),g=!0}}n=qo(n,e,p),n=Ko(n,e,p),n=Wo(n,e);let v=()=>{let g=pn(n);if(g.length===0)return!1;let b=Array(g.length);for(let r=g.length-1;r>=0;r--){let a=g[r];try{let i="",y=!1;for(let m of a.branches){if(y)break;if(m.type==="else")i=m.content,y=!0;else try{if(m.condition?ll(m.condition,e):!1)i=m.content,y=!0}catch(c){i=l(m.type==="if"?"If":"Elseif",`Error in @${m.type}(${m.condition}): ${c instanceof Error?c.message:String(c)}`,t.EVALUATION_ERROR),y=!0}}b[r]=i}catch(i){let y=i instanceof Error?i.message:String(i);b[r]=l("If",`Error processing @if block: ${y}`,t.EVALUATION_ERROR)}}let s=Array(g.length*2+1),o=0;for(let r=0;r<g.length;r++){let a=g[r];s[r*2]=n.slice(o,a.start),s[r*2+1]=b[r],o=a.end}return s[g.length*2]=n.slice(o),n=s.join(""),!0};while(!0){let g=n;if(!v())break;if(n===g)break}return n}function q(w){let e=0;while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!=="(")return null;e++;while(e<w.length&&/\s/.test(w[e]))e++;let p=w[e];if(p!=="'"&&p!=='"')return null;e++;let n=[];while(e<w.length){let v=w[e];if(v==="\\"&&e+1<w.length){n.push(w[e+1]),e+=2;continue}if(v===p){e++;break}n.push(v),e++}while(e<w.length&&/\s/.test(w[e]))e++;if(w[e]!==")")return null;return e++,{value:n.join(""),consumed:e}}function Wo(w,e){let p=w;function n(s,o,r,a){let i=1,y=a,m=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),c=new RegExp(`@${r}(?![a-z])`,"g");while(y<s.length&&i>0){m.lastIndex=y,c.lastIndex=y;let x=m.exec(s),k=c.exec(s),h=x?x.index:1/0,E=k?k.index:1/0;if(h<E)i++,y=h+x[0].length;else if(E<1/0){if(i--,i===0)return E;y=E+k[0].length}else break}return-1}function v(s,o,r){let a=0,i=new RegExp(`@${o}(?:\\s*\\(|\\s|$)`,"g"),y=new RegExp(`@${r}(?![a-z])`,"g"),m=/@else(?![a-z])/g,c=[],x;while((x=i.exec(s))!==null)c.push({pos:x.index,type:"open"});while((x=y.exec(s))!==null)c.push({pos:x.index,type:"close"});while((x=m.exec(s))!==null)c.push({pos:x.index,type:"else"});c.sort((k,h)=>k.pos-h.pos);for(let k of c)if(k.type==="open")a++;else if(k.type==="close")a--;else if(k.type==="else"&&a===0)return k.pos;return-1}{let s=!0;while(s){s=!1;let o=p.match(/@auth(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+5),m=q(y);if(m)a=m.value,i=r+5+m.consumed;else i=r+5;let c=n(p,"auth","endauth",i);if(c===-1){console.warn(`[stx] @auth directive at position ${r} has no matching @endauth \u2014 the block was skipped.`);break}let x=p.slice(i,c),k=v(x,"auth","endauth"),h;if(!e.auth)h=!1;else h=a?L(`auth?.check && auth?.user?.[${a}]`,e):L("auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+8),s=!0}}{let s=!0;while(s){s=!1;let o=p.match(/@guest(?:\s*\(|\s|(?=\n))/);if(!o||o.index===void 0)break;let r=o.index,a,i,y=p.slice(r+6),m=q(y);if(m)a=m.value,i=r+6+m.consumed;else i=r+6;let c=n(p,"guest","endguest",i);if(c===-1){console.warn(`[stx] @guest directive at position ${r} has no matching @endguest \u2014 the block was skipped.`);break}let x=p.slice(i,c),k=v(x,"guest","endguest"),h;if(!e.auth)h=!0;else h=a?L(`!auth?.check || !auth?.user?.[${a}]`,e):L("!auth?.check",e);let E;if(k!==-1){let S=x.slice(0,k),C=x.slice(k+5);E=h?S:C}else E=h?x:"";p=p.substring(0,r)+E+p.substring(c+9),s=!0}}function g(s,o,r){if(e.userCan&&typeof e.userCan[s]==="boolean")return e.userCan[s];if(e.permissions?.check&&typeof e.permissions.check==="function")try{let a=[s];if(o)a.push(o);if(r){let i=L(r,e);a.push(i)}return e.permissions.check(...a)}catch{return!1}return!1}function b(s){let o=s.match(/^\s*\(\s*'([^']*)'(?:,\s*'([^']*)')?(?:,\s*([^)]*))?\)/);if(!o)return null;return{ability:o[1],type:o[2],id:o[3]?.trim(),paramsEnd:o[0].length}}for(let s of["can","cannot"]){let o=`end${s}`,r=s==="can"?"elsecan":"elsecannot",a=!0;while(a){a=!1;let i=p.match(new RegExp(`@${s}\\s*\\(`));if(!i||i.index===void 0)break;let y=i.index,m=p.slice(y+`@${s}`.length),c=b(m);if(!c)break;let x=y+`@${s}`.length+c.paramsEnd,k=n(p,s,o,x);if(k===-1){console.warn(`[stx] @${s} directive at position ${y} has no matching @${o} \u2014 the block was skipped.`);break}let h=p.slice(x,k),E=[],S=0,C=new RegExp(`@${s}\\s*\\(`,"g"),P=new RegExp(`@${o}(?![a-z])`,"g"),R=new RegExp(`@${r}\\s*\\(`,"g"),T=/@else(?![a-z])/g,_=[],M;while((M=C.exec(h))!==null)_.push({pos:M.index,type:"open"});while((M=P.exec(h))!==null)_.push({pos:M.index,type:"close"});while((M=R.exec(h))!==null)_.push({pos:M.index,type:"elseDirective"});while((M=T.exec(h))!==null)_.push({pos:M.index,type:"else"});_.sort((A,z)=>A.pos-z.pos);for(let A of _){if(A.type==="open"){S++;continue}if(A.type==="close"){S--;continue}if(S===0)E.push(A)}let I=[],F=0;for(let A=0;A<E.length;A++){let z=E[A];if(I.push({content:h.slice(F,z.pos),ability:void 0}),z.type==="elseDirective"){let D=h.slice(z.pos+`@${r}`.length),B=b(D);if(B){I[I.length-1]={content:h.slice(F,z.pos)},F=z.pos+`@${r}`.length+B.paramsEnd,I.push({content:"",ability:B.ability,type:B.type,id:B.id}),I.pop();let G=E[A+1],U=G?G.pos:h.length;I.push({content:h.slice(F,U),ability:B.ability,type:B.type,id:B.id}),F=U}}else F=z.pos+5}if(F<h.length){let A=I[I.length-1];if(E.length>0&&E[E.length-1].type==="else")I.push({content:h.slice(F),isFinalElse:!0});else if(I.length===0)I.push({content:h.slice(F)})}let O=g(c.ability,c.type,c.id),j=s==="can"?O:!O,V="";if(j)V=I[0]?.content||"";else{let A=!1;for(let z=1;z<I.length;z++){let D=I[z];if(D.isFinalElse){V=D.content,A=!0;break}if(D.ability){let B=g(D.ability,D.type,D.id);if(s==="can"?B:!B){V=D.content,A=!0;break}}}if(!A&&I.length>0){let z=I[I.length-1];if(z.isFinalElse)V=z.content}}p=p.substring(0,y)+V+p.substring(k+`@${o}`.length),a=!0}}return p}function qo(w,e,p){let n=w;function v(g,b,s,o,r){let a=!0;while(a){a=!1;let i=new RegExp(`@${b}\\s*\\(`),y=g.match(i);if(!y||y.index===void 0)break;let m=y.index,c=Qe(g,m+`@${b}`.length);if(!c)break;let x=c.endPos,k=St(g,b,s,x);if(k===-1){console.warn(`[stx] @${b} directive at position ${m} has no matching @${s} \u2014 the block was skipped.`);break}let h=g.slice(x,k),E=c.expression,S=-1,C=0,P=0;while(P<h.length){let R=h.indexOf("@",P);if(R===-1)break;let T=h.substring(R);if(/^@(?:if|unless|isset|empty)\s*\(/.test(T)){C++,P=R+1;continue}if(/^@(?:endif|endunless|endisset|endempty)(?![a-z])/.test(T)){C--,P=R+1;continue}if(C===0&&/^@else(?![a-z])/.test(T)){S=R;break}P=R+1}try{let R=o(E.trim()),T;if(S!==-1){let _=h.slice(0,S),M=h.slice(S+5);T=R?_:M}else T=R?h:"";g=g.substring(0,m)+T+g.substring(k+`@${s}`.length),a=!0}catch(R){let T=R instanceof Error?R.message:String(R),_=l(r,`Error processing @${b} directive: ${T}`,t.EVALUATION_ERROR);g=g.substring(0,m)+_+g.substring(k+`@${s}`.length);break}}return g}return n=v(n,"isset","endisset",(g)=>{let b=L(g,e);return b!==void 0&&b!==null},"Isset"),n=v(n,"empty","endempty",(g)=>{let b=L(g,e);return b===void 0||b===null||b===""||b===0||b===!1||Array.isArray(b)&&b.length===0||typeof b==="object"&&b!==null&&Object.keys(b).length===0},"Empty"),n}function Ko(w,e,p){let n=w,v="development";function g(b,s,o,r){let a=new RegExp(`@${s}(?![a-z])`,"g"),i=new RegExp(`@${o}(?![a-z])`,"g"),y=new RegExp(`^@${s}(?![a-z])`),m=new RegExp(`^@${o}(?![a-z])`),c=b,x=!0;while(x){x=!1,a.lastIndex=0;let k=a.exec(c);if(!k)break;let h=k.index,E=h+k[0].length;if(s==="env"){let O=c.substring(E).match(/^\s*\(\s*(['"])([^'"]+)\1\s*\)/);if(!O)break;E+=O[0].length,r=v===O[2]}let S=1,C=E,P=-1;while(S>0&&C<c.length){a.lastIndex=C,i.lastIndex=C;let O=a.exec(c),j=i.exec(c),V=O?O.index:1/0,A=j?j.index:1/0;if(V<A)S++,C=V+O[0].length;else if(A<1/0){if(S--,S===0){P=A;break}C=A+j[0].length}else break}if(P===-1){console.warn(`[stx] @${s} directive at position ${h} has no matching @${o} \u2014 the block was skipped.`);break}let R=c.substring(E,P),T=-1,_=0,M=0;while(M<R.length){let O=R.indexOf("@",M);if(O===-1)break;let j=R.substring(O);if(y.test(j)){_++,M=O+1;continue}if(m.test(j)){_--,M=O+1;continue}if(_===0&&/^@else(?![a-z])/.test(j)){T=O;break}M=O+1}let I;if(T!==-1){let O=R.slice(0,T),j=R.slice(T+5);I=r?O:j}else I=r?R:"";let F=`@${o}`.length;c=c.substring(0,h)+I+c.substring(P+F),x=!0}return c}return n=g(n,"env","endenv",!1),n=g(n,"production","endproduction",v==="production"),n=g(n,"development","enddevelopment",v==="development"),n=g(n,"staging","endstaging",v==="staging"),n=g(n,"testing","endtesting",v==="testing"),n}
|
|
3
3
|
export{oe,Wo,qo,Ko};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ph,So,fh,gh,mh,hh}from"./chunk-6q6atv4g.js";import"./chunk-z46mk8ym.js";import"./chunk-qa1pcm7n.js";import"./chunk-hpwtjb4a.js";import"./chunk-m6nhh5xf.js";import"./chunk-eh8g8kr1.js";import"./chunk-833y1ndd.js";import"./chunk-9mryv01z.js";import"./chunk-r2p2nyyq.js";import"./chunk-jtccqpwa.js";import"./chunk-2rg9pqmh.js";import"./chunk-0rszcb0m.js";import"./chunk-8cvgm13s.js";import"./chunk-xe8m66a3.js";import"./chunk-qahz3n8z.js";import"./chunk-v4bqmzj9.js";import"./chunk-k47addf7.js";import"./chunk-xppm4cs4.js";import"./chunk-agbkv9ab.js";export{hh as clearStoreCache,ph as getStoreScript,mh as getStoreScriptFor,gh as pageStoresAll,So as storesRead,fh as storesReadInFiles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{wn,ig,ag,cg,lg,ug,m,dg,vi,pg,Zc,Qc}from"./chunk-xe8m66a3.js";import"./chunk-qahz3n8z.js";import"./chunk-v4bqmzj9.js";import"./chunk-k47addf7.js";import"./chunk-xppm4cs4.js";import"./chunk-agbkv9ab.js";export{wn as STX_ENGINE_BINDING_NAMES,vi as convertToCommonJS,Zc as extractScriptFromTemplate,m as extractVariables,Qc as hasVariables,dg as isCompleteImport,ug as isMissingBindingFailure,cg as isModuleResolutionFailure,lg as isSyntaxFailure,pg as splitDeclaration,ig as stripTypeScript,ag as withoutStxReferrer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ln,No,Mo,Do,Oh,Lo}from"./chunk-qa1pcm7n.js";import"./chunk-2rg9pqmh.js";import"./chunk-8cvgm13s.js";import"./chunk-v4bqmzj9.js";export{Mo as buildServerApi,Oh as createServerApi,ln as discoverServerApi,No as generateApiTypes,Lo as isServerApiSource,Do as productionApiDispatcher};
|
|
@@ -159,7 +159,7 @@ else {
|
|
|
159
159
|
stxIslands.initIslands();
|
|
160
160
|
}
|
|
161
161
|
})();
|
|
162
|
-
</script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function
|
|
162
|
+
</script>`}function b(e){let t=e.match(/<([A-Z][a-zA-Z0-9]+)[\s/>]/);if(t)return t[1];let n=e.match(/<([a-z][a-z0-9]*-[a-z0-9-]+)[\s/>]/);if(n)return n[1];return null}function w(e,t){let n={},r=/:([a-zA-Z_][\w-]*)\s*=\s*"([^"]+)"/g,i;while((i=r.exec(e))!==null){let d=i[1],o=i[2];if(o in t)n[d]=t[o];else n[d]=o}return n}function ru(){let e=new Map;return{islands:e,register(t){e.set(t.id,t)},get(t){return e.get(t)},async hydrate(t){let n=e.get(t);if(!n||n.hydrated)return;if(n.hydrated=!0,typeof window<"u"&&typeof window.dispatchEvent==="function")window.dispatchEvent(new CustomEvent("stx:hydrate",{detail:{id:t,component:n.component}}))},async hydrateAll(){let t=Array.from(e.values()).filter((n)=>!n.hydrated).map((n)=>this.hydrate(n.id));await Promise.all(t)}}}function I(e){return`
|
|
163
163
|
<script data-hydrate="${e}">
|
|
164
164
|
(function() {
|
|
165
165
|
const island = document.querySelector('[data-island="${e}"]');
|
|
@@ -311,7 +311,7 @@ else {
|
|
|
311
311
|
});
|
|
312
312
|
})();
|
|
313
313
|
</script>
|
|
314
|
-
`}function
|
|
314
|
+
`}function su(e,t={},n){let r=e,i=!1,d=/@client:(load|idle|visible|media|only|hover|event)/i.test(e);if(r=u(r,"load",t),r=u(r,"idle",t),r=u(r,"visible",t),r=u(r,"media",t),r=M(r),r=u(r,"hover",t),r=u(r,"event",t),i=d&&r!==e,i)r+=`
|
|
315
315
|
`+v();return r}function u(e,t,n){let r=new RegExp(`@client:${t}(?:\\s*\\(([^)]*)\\))?\\s*([\\s\\S]*?)@endclient`,"gi");return e.replace(r,(i,d,o)=>{let a={strategy:t};if(d)try{let E=d.split(",").map((h)=>h.trim());for(let h of E){let[m,g]=h.split(":").map((p)=>p.trim());if(m&&g){let p=g.replace(/^['"]|['"]$/g,"");a[m]=p}}}catch{}let s=`island-${Math.random().toString(36).substring(2,9)}`,y=b(o.trim()),f=w(o.trim(),n),c=[];if(a.rootMargin)c.push(`data-root-margin="${a.rootMargin}"`);if(a.threshold!==void 0)c.push(`data-threshold="${a.threshold}"`);if(a.media)c.push(`data-media="${a.media}"`);if(a.event)c.push(`data-event="${a.event}"`);if(y)c.push(`data-component="${y}"`);let x=Object.keys(f).length>0?`
|
|
316
316
|
<script type="application/json" data-island-props="${s}">${JSON.stringify(f)}</script>`:"",l="";switch(t){case"load":l=I(s);break;case"idle":l=L(s,a);break;case"visible":l=C(s,a);break;case"media":l=S(s,a);break;case"hover":l=k(s);break;case"event":l=H(s,a);break}return`
|
|
317
317
|
<div data-island="${s}"
|
|
@@ -342,7 +342,7 @@ else {
|
|
|
342
342
|
}
|
|
343
343
|
})();
|
|
344
344
|
</script>
|
|
345
|
-
`})}function
|
|
345
|
+
`})}function ou(){return`
|
|
346
346
|
/* Island base styles */
|
|
347
347
|
.stx-island {
|
|
348
348
|
display: contents;
|
|
@@ -383,9 +383,9 @@ else {
|
|
|
383
383
|
.stx-island.hydrated {
|
|
384
384
|
opacity: 1;
|
|
385
385
|
}
|
|
386
|
-
`}function
|
|
386
|
+
`}function iu(e){if(typeof window>"u")return;let t=document.querySelector(`[data-island="${e}"]`);if(!t||t.classList.contains("hydrated"))return;t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))}function au(e){if(typeof window>"u")return;document.querySelectorAll(`[data-strategy="${e}"]:not(.hydrated)`).forEach((n)=>{n.classList.add("hydrated"),n.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function cu(){if(typeof window>"u")return;document.querySelectorAll(".stx-island:not(.hydrated)").forEach((t)=>{t.classList.add("hydrated"),t.dispatchEvent(new CustomEvent("stx:hydrated",{bubbles:!0}))})}function lu(e){if(typeof window>"u")return!1;return document.querySelector(`[data-island="${e}"]`)?.classList.contains("hydrated")??!1}function uu(e){return new Promise((t)=>{if(typeof window>"u"){t();return}let n=document.querySelector(`[data-island="${e}"]`);if(!n){t();return}if(n.classList.contains("hydrated")){t();return}n.addEventListener("stx:hydrated",()=>t(),{once:!0})})}function du(e){return e.replace(/@static\s*([\s\S]*?)@endstatic/gi,(t,n)=>`<div class="stx-static">${n.trim()}</div>`)}function pu(e){let t=e.map((n)=>({id:n.id,component:n.component,strategy:n.options.strategy,props:n.props}));return`
|
|
387
387
|
<script type="application/json" id="stx-island-manifest">
|
|
388
388
|
${JSON.stringify(t)}
|
|
389
389
|
</script>
|
|
390
|
-
`}var
|
|
391
|
-
export{
|
|
390
|
+
`}var Bm={processPartialHydrationDirectives:su,processStaticDirectives:du,generatePartialHydrationCSS:ou,generateIslandManifest:pu,createIslandRegistry:ru,hydrateIsland:iu,hydrateByStrategy:au,hydrateAll:cu,isHydrated:lu,onHydrated:uu};
|
|
391
|
+
export{ru,su,ou,iu,au,cu,lu,uu,du,pu,Bm};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Dl,la,Ll,jl,ua,Bl,Fl,zl,Hl,da,Vl,om}from"./chunk-f5n871gp.js";import{va,Kl}from"./chunk-8vjr3atq.js";import{ee,te,ne,jn,he,$e,Yr,ht,Yt,Bn,Fn,zn,re,Hn,Vn,Zr}from"./chunk-422r7zkx.js";import{Zl}from"./chunk-fffjjgnt.js";import"./chunk-t74qb5ej.js";export{te as DEFAULT_FORMATS,ne as DEFAULT_QUALITY,ee as DEFAULT_WIDTHS,Zr as ImageProcessingError,jl as clearImageCache,ua as createImageDirective,Kl as createImageHandler,Fl as createImagePlugin,om as defaultImageConfig,Vn as formatSize,da as generateImageManifest,Yt as generateSizes,ht as generateSrcSet,Bn as getFallbackVariant,Yr as getImageMetadata,re as getMimeType,Hn as getTotalSize,Fn as groupVariantsByFormat,va as handleImageRequest,Bl as imageDirective,he as isImageBackendAvailable,zn as isImageFile,jn as isSharpAvailable,Hl as optimizeDirectory,zl as optimizeImage,la as parseImageComponent,$e as processImage,Ll as processImageComponents,Dl as renderImageComponent,Zl as rewriteImagesWithSiblings,Vl as writeImageManifest};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{de}from"./chunk-
|
|
3
|
-
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function
|
|
4
|
-
`)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),a),f.push({...t,filePath:n})}return f}function E(s,l){let o=s.map((i)=>({route:i,...de(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function
|
|
5
|
-
`));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function Lo(s,l,o){if(
|
|
6
|
-
export{
|
|
2
|
+
import{de}from"./chunk-8cvgm13s.js";import{He,M}from"./chunk-v4bqmzj9.js";import{Tc}from"./chunk-2rg9pqmh.js";import{c}from"./chunk-z33esms3.js";import v from"fs";import m from"path";import{pathToFileURL as I}from"url";var P=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],R=new Set;function ln(s,l={}){let o=m.resolve(s,l.dir??"server/api"),i=[],f=new Map;if(!v.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let p=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=p.pop(),u=n.lastIndexOf("."),d=u>=0?n.slice(u+1):"get",g=d.toUpperCase();if(!P.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${P.map((A)=>A.toLowerCase()).join(", ")}`);if(u>=0)n=n.slice(0,u);if(n!=="index")p.push(n);let r=new Set,h=p.map((A,j)=>{let y=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(A);if(y){if(r.has(y[2])||y[1]&&j!==p.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(y[2]),`:${y[2]}${y[1]?"*":""}`}if(!/^[\w-]+$/.test(A))throw Error(`Unsupported API path segment ${A} in ${e}`);return A}),w=`/api${h.length?`/${h.join("/")}`:""}`,S=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(S))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(S)} and ${e}`);f.set(S,e);let x=m.join(o,e);R.add(m.resolve(x)),R.add(v.realpathSync(x)),i.push({pattern:w,method:g,filePath:x})}return i.sort((e,a)=>{let p=e.pattern.split("/"),n=a.pattern.split("/"),u=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(p.length,n.length);d++){let g=u(n[d])-u(p[d]);if(g)return g}return e.pattern.localeCompare(a.pattern)||e.method.localeCompare(a.method)})}async function No(s,l){let o=c(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of l){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:a}=de(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${a.map((p)=>`${JSON.stringify(p)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
|
|
3
|
+
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function Mo(s,l,o={}){let i=ln(s,o);await No(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
+
`)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),a),f.push({...t,filePath:n})}return f}function E(s,l){let o=s.map((i)=>({route:i,...de(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function Do(s,l){return E(l,async(o)=>(await import(I(m.resolve(s,o.filePath)).href)).default)}async function Oh(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=ln(s,o);return await No(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=ln(s,o);await No(s,t);let{loadStxConfig:e}=await import("./chunk-ryb4jesm.js"),a=M((await e(s)).runtimeConfig);return await He(a,()=>E(t,async(p)=>{let n=await Bun.build({entrypoints:[p.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
|
+
`));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function Lo(s,l,o){if(Tc(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(v.realpathSync(s))))return!0}catch{}if(R.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(l,typeof o==="object"?o.dir??"server/api":"server/api"),t=(a)=>{try{return v.realpathSync(a)}catch{return m.resolve(a)}},e=t(s);return[f,m.resolve(l,"server"),m.resolve(l,".output/server")].some((a)=>{let p=t(a);return e===p||e.startsWith(`${p}${m.sep}`)})}
|
|
6
|
+
export{ln,No,Mo,Do,Oh,Lo};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function
|
|
2
|
+
import y from"fs";import R from"path";var S="_stx";function F(e){return Bun.hash(e).toString(16).slice(0,8)}function k(e){let t=[],n=(i)=>{for(let s of y.readdirSync(i,{withFileTypes:!0})){let r=R.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(y.existsSync(e))n(e);return t}var z=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-runtime src="${e}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(e)=>`<script data-stx-router src="${e}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(e)=>`<link data-css="generated" rel="stylesheet" href="${e}">`}];function I(e,t=`/${S}`){let n=[],i=new Set,s=0,r=e;for(let o of z)r=r.replace(o.pattern,(g,u,c)=>{if(/\b(?:src|href)\s*=/.test(u)||!c.trim())return g;let a=`${o.prefix}.${F(c)}.${o.extension}`;if(!i.has(a))i.add(a),n.push({filename:a,contents:c,contentType:o.contentType});return s+=c.length,o.replace(`${t}/${a}`)});return{html:r,assets:n,bytesInlined:s}}function sc(e){let t={pages:0,assets:0,bytesInlined:0},n=R.join(e,S),i=new Set;for(let s of k(e)){let r=y.readFileSync(s,"utf8"),{html:o,assets:g,bytesInlined:u}=I(r);if(o===r)continue;for(let c of g){if(i.has(c.filename))continue;i.add(c.filename),y.mkdirSync(n,{recursive:!0}),y.writeFileSync(R.join(n,c.filename),c.contents),t.assets++}y.writeFileSync(s,o),t.bytesInlined+=u,t.pages++}return t}import h from"fs";import T from"path";var L=1024,N=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,_=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function B(e){return Bun.hash(e).toString(16).slice(0,8)}function C(e){let t=[],n=(i)=>{for(let s of h.readdirSync(i,{withFileTypes:!0})){let r=T.join(i,s.name);if(s.isDirectory())n(r);else if(s.isFile()&&r.endsWith(".html"))t.push(r)}};if(h.existsSync(e))n(e);return t}function O(e,t){let n=e.match(new RegExp(`\\b${t}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!n)return;return n[2]??n[3]??n[4]??""}function H(e,t,n){if(n.length<L)return!1;if(/\b(?:src|href)\s*=/i.test(t))return!1;if(e.toLowerCase()==="script"){if(!_.has((O(t,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function D(e){let t=[];for(let n of e.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))t.push([n.index,n.index+n[0].length]);return t}function oc(e){let t={pages:0,assets:0,bytesInlined:0},n=C(e);if(n.length<2)return t;let i=new Map,s=new Map;for(let a of n){let f=h.readFileSync(a,"utf8");i.set(a,f);let M=D(f);for(let d of f.matchAll(N)){let[x,p,l,m]=d;if(!H(p,l,m))continue;if(M.some(([j,A])=>d.index>=j&&d.index<A))continue;let w=`${p.toLowerCase()}\x00${m}`,b=s.get(w);if(b)b.push({file:a,whole:x,tag:p,attrs:l,body:m});else s.set(w,[{file:a,whole:x,tag:p,attrs:l,body:m}])}}let r=[...s.values()].filter((a)=>new Set(a.map((f)=>f.file)).size>1);if(r.length===0)return t;let o=T.join(e,S),g=new Map(i),u=new Map,c=[];for(let a of r){let{tag:f,body:M}=a[0],d=f.toLowerCase()==="script",x=`${d?"chunk":"style"}.${B(M)}.${d?"js":"css"}`;c.push({filename:x,contents:M,contentType:d?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let p=`/${S}/${x}`;for(let l of a){let m=d?`<script${l.attrs} src="${p}"></script>`:`<link${l.attrs} rel="stylesheet" href="${p}">`,w=g.get(l.file),b=w.replace(l.whole,()=>m);if(b===w)continue;g.set(l.file,b),u.set(l.file,(u.get(l.file)??0)+l.body.length)}}h.mkdirSync(o,{recursive:!0});for(let a of c)h.writeFileSync(T.join(o,a.filename),a.contents),t.assets++;for(let[a,f]of g){if(f===i.get(a))continue;h.writeFileSync(a,f),t.pages++,t.bytesInlined+=u.get(a)??0}return t}import E from"fs";import v from"path";var K="layout-types.d.ts";function P(e){let t=[],n=(i,s)=>{let r;try{r=E.readdirSync(i,{withFileTypes:!0})}catch{return}for(let o of r){if(o.name.startsWith("."))continue;let g=v.join(i,o.name);if(o.isDirectory())n(g,s?`${s}/${o.name}`:o.name);else if(o.isFile()&&o.name.endsWith(".stx")&&o.name!=="_layout.stx"){let u=o.name.slice(0,-4);t.push(s?`${s}/${u}`:u)}}};return n(e,""),t.sort()}function W(e){let t=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(e.length===0)return t.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),t.join(`
|
|
3
3
|
`);return t.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...e.map((n)=>` '${n}': true`)," }","}","","export {}",""),t.join(`
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
4
|
+
`)}function ic(e,t){if(!e)return[];let n=v.isAbsolute(e)?e:v.resolve(process.cwd(),e),i=P(n),s=W(i),r=v.join(t,K);try{if(E.existsSync(r)&&E.readFileSync(r,"utf8")===s)return i;E.mkdirSync(t,{recursive:!0}),E.writeFileSync(r,s)}catch{}return i}
|
|
5
|
+
export{sc,oc,ic};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Cn,
|
|
2
|
+
import{Cn,M}from"./chunk-v4bqmzj9.js";import m from"fs";import e from"path";async function _n(r,o,i){if(r.__stx_runtime_config)return;let n=Cn();if(n||i){r.__stx_runtime_config=n??M(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-ryb4jesm.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=M(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ti(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
6
6
|
`)}
|
|
7
|
-
export{_n,
|
|
7
|
+
export{_n,Ti};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=
|
|
3
|
-
`)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&a(
|
|
4
|
-
`)return-1;if(
|
|
2
|
+
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=cl(t,n+2),n<t.length)n++;continue}n++}return t.length}function cl(t,i){let n=1,e=i,s="{",f="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=o(t,e),s=h,f="";continue}if(l==="`"){e=b(t,e),s=h,f="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
|
|
3
|
+
`)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&a(s,f)){let u=w(t,e);if(u!==-1){e=u,s=h,f="";continue}}if(l==="{")n++;else if(l==="}"){if(n--,n===0)return e}if(/[\w$]/.test(l))f=/[\w$]/.test(s)?f+l:l,s=l;else if(!/\s/.test(l))s=l,f="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(t,i){if(i)return m.has(i);return!(t===")"||t==="]"||t===h)}var h="\x00";function w(t,i){let n=i+1,e=!1;while(n<t.length){let s=t[n];if(s===`
|
|
4
|
+
`)return-1;if(s==="\\"){n+=2;continue}if(s==="[")e=!0;else if(s==="]")e=!1;else if(s==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function r(t){let i="",n=0,e="",s="";while(n<t.length){let f=t.slice(n,n+2);if(f==="//"){while(n<t.length&&t[n]!==`
|
|
5
5
|
`)i+=" ",n++;continue}if(f==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")i+=t[n]===`
|
|
6
6
|
`?`
|
|
7
7
|
`:" ",n++;i+=" ",n+=2;continue}let l=t[n];if(l==='"'||l==="'"){let u=l;i+=" ",n++;while(n<t.length&&t[n]!==u){if(t[n]==="\\"){i+=" ",n+=2;continue}i+=t[n]===`
|
|
8
8
|
`?`
|
|
9
|
-
`:" ",n++}i+=" ",n++,e=h,
|
|
9
|
+
`:" ",n++}i+=" ",n++,e=h,s="";continue}if(l==="/"&&a(e,s)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,s="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=cl(t,u);if(i+=" ",i+=r(t.slice(u,g)),g<t.length)i+=" ";n=g+1;continue}i+=t[n]===`
|
|
10
10
|
`?`
|
|
11
|
-
`:" ",n++}i+=" ",n++,e=h,
|
|
12
|
-
export{
|
|
11
|
+
`:" ",n++}i+=" ",n++,e=h,s="";continue}if(i+=l,n++,/[\w$]/.test(l))s=/[\w$]/.test(e)?s+l:l,e=l;else if(!/\s/.test(l))e=l,s=""}return i}function me(t){let i=new Uint16Array(t.length),n=0,e=!0;for(let s=0;s<t.length;s++){let f=t[s];if(f===")"||f==="]"||f==="}")if(n===0)e=!1;else n--;if(i[s]=n,f==="("||f==="["||f==="{")n++}return{depths:i,balanced:e&&n===0}}
|
|
12
|
+
export{cl,r,me};
|
|
@@ -72,7 +72,7 @@ else {
|
|
|
72
72
|
${t}
|
|
73
73
|
})();
|
|
74
74
|
</script>
|
|
75
|
-
`}function
|
|
75
|
+
`}function Zm(i,n,o){f=0;let l=/@defer\s*\(([^)]*)\)\s*([\s\S]*?)@enddefer/g;return i.replace(l,(t,e,s)=>{let a=v(),r=p(t,e,s),d=r.placeholder?`<div data-defer-placeholder>${r.placeholder}</div>`:"",c=r.loading?`<div data-defer-loading style="display: none;">${r.loading}</div>`:'<div data-defer-loading style="display: none;"></div>',g=r.error?`<div data-defer-error style="display: none;">${r.error}</div>`:"",u=`<div data-defer-content style="display: none;">${r.content}</div>`,h=E(a,r);return`
|
|
76
76
|
<div id="${a}" class="stx-defer" data-defer-trigger="${r.trigger}">
|
|
77
77
|
${d}
|
|
78
78
|
${c}
|
|
@@ -81,4 +81,4 @@ else {
|
|
|
81
81
|
</div>
|
|
82
82
|
${h}
|
|
83
83
|
`})}
|
|
84
|
-
export{
|
|
84
|
+
export{Zm};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{em}from"./chunk-jt5cqq09.js";import"./chunk-xa1f13nk.js";import"./chunk-ar1prdev.js";import"./chunk-jqjw00qm.js";import"./chunk-t5q31st4.js";import"./chunk-sy0jtgmv.js";import"./chunk-a2shk93y.js";import"./chunk-7zxce1yw.js";import"./chunk-m710wkr4.js";import"./chunk-m6nhh5xf.js";import"./chunk-eh8g8kr1.js";import"./chunk-833y1ndd.js";import"./chunk-jpyk0gtr.js";import"./chunk-9mryv01z.js";import"./chunk-r2p2nyyq.js";import"./chunk-jtccqpwa.js";import"./chunk-2rg9pqmh.js";import"./chunk-0rszcb0m.js";import"./chunk-8cvgm13s.js";import"./chunk-xe8m66a3.js";import"./chunk-qahz3n8z.js";import"./chunk-v4bqmzj9.js";import"./chunk-k47addf7.js";import"./chunk-xppm4cs4.js";import"./chunk-agbkv9ab.js";export{em as startInteractive};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ee,te,ne,jn,he,$e,Yr,
|
|
2
|
+
import{ee,te,ne,jn,he,$e,Yr,Yl,ht,Yt,Bn,Fn,zn,re,Hn,Vn,Zr}from"./chunk-422r7zkx.js";import"./chunk-t74qb5ej.js";export{te as DEFAULT_FORMATS,ne as DEFAULT_QUALITY,ee as DEFAULT_WIDTHS,Zr as ImageProcessingError,Vn as formatSize,Yt as generateSizes,ht as generateSrcSet,Bn as getFallbackVariant,Yr as getImageMetadata,re as getMimeType,Hn as getTotalSize,Fn as groupVariantsByFormat,he as isImageBackendAvailable,zn as isImageFile,jn as isSharpAvailable,$e as processImage,Yl as resizeAndConvert};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{P,t,l}from"./chunk-
|
|
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 xc(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 Sc(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 kc(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],c=await ti(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 _c={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},Cc={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
|
|
4
|
-
export{
|
|
2
|
+
import{P,t,l}from"./chunk-k47addf7.js";import{Q}from"./chunk-xe8m66a3.js";import{ti}from"./chunk-jtccqpwa.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
|
+
`),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 Sc(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 kc(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 _c(e,s={}){let i={},{recursive:n=!0,ignorePaths:r=[]}=s,o=Array.isArray(e)?e:[e],c=await ti(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 Cc={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},Ec={name:"screenReader",handler:(e)=>`<span class="sr-only">${e}</span>`,hasEndTag:!0};
|
|
4
|
+
export{Sc,kc,_c,Cc,Ec};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{F,Gf,ei,a,O,Yh,Zh}from"./chunk-9mryv01z.js";import"./chunk-r2p2nyyq.js";import"./chunk-jtccqpwa.js";import"./chunk-2rg9pqmh.js";import"./chunk-0rszcb0m.js";import"./chunk-8cvgm13s.js";import"./chunk-xe8m66a3.js";import"./chunk-qahz3n8z.js";import"./chunk-v4bqmzj9.js";import"./chunk-k47addf7.js";import"./chunk-xppm4cs4.js";import"./chunk-agbkv9ab.js";export{O as config,F as defaultConfig,Yh as defineStxConfig,ei as discoverConfig,a as loadStxConfig,Gf as resolveStxDirectories,Zh as validateConfig};
|