@stacksjs/stx 0.2.857 → 0.2.858
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-0ts3p84y.js +2 -0
- package/dist/{chunk-sgnkbgx1.js → chunk-0vptj943.js} +2 -2
- package/dist/{chunk-0d3z8hwz.js → chunk-0z2gqttt.js} +9 -9
- package/dist/{chunk-g0h1gxew.js → chunk-1347hwt5.js} +9 -9
- package/dist/chunk-139mxsyc.js +2 -0
- package/dist/chunk-1barsha6.js +2 -0
- package/dist/chunk-1fnx7ze9.js +2 -0
- package/dist/chunk-1g06wfs9.js +2 -0
- package/dist/chunk-1nasq00e.js +2 -0
- package/dist/{chunk-v1eycdhj.js → chunk-1z2am28h.js} +2 -2
- package/dist/chunk-2102tvxh.js +2 -0
- package/dist/{chunk-0veh8bcn.js → chunk-252enthj.js} +1 -1
- package/dist/{chunk-cvrkr3re.js → chunk-2bks42z4.js} +4 -4
- package/dist/chunk-39cwa35j.js +2 -0
- package/dist/{chunk-fj5jw2jd.js → chunk-3b7q7d7j.js} +6 -6
- package/dist/{chunk-fyp1v087.js → chunk-3evwxrpx.js} +1 -1
- package/dist/chunk-3rcegvgg.js +2 -0
- package/dist/chunk-3wvq28hz.js +2 -0
- package/dist/{chunk-zx5bt056.js → chunk-4ezfen91.js} +8 -8
- package/dist/{chunk-41md2f3q.js → chunk-5xy1z71a.js} +4 -4
- package/dist/{chunk-63rvsnt2.js → chunk-69zj9q02.js} +3 -3
- package/dist/{chunk-chr56bhk.js → chunk-6d74qdc6.js} +1 -1
- package/dist/chunk-6m4v1tsq.js +2 -0
- package/dist/{chunk-dnrgcjds.js → chunk-6qbha6fb.js} +5 -5
- package/dist/{chunk-3wabhzf4.js → chunk-71s4hpkj.js} +3 -3
- package/dist/chunk-75e4wzzs.js +3 -0
- package/dist/{chunk-wdh20fxz.js → chunk-78amng8s.js} +5 -5
- package/dist/chunk-7ambc4f7.js +2 -0
- package/dist/{chunk-432c35hs.js → chunk-7fgfzaah.js} +2 -2
- package/dist/{chunk-xfymp197.js → chunk-8623gte8.js} +6 -6
- package/dist/{chunk-mpmnbvy4.js → chunk-8cpqcn19.js} +5 -5
- package/dist/chunk-8nmc3rh7.js +2 -0
- package/dist/chunk-8pn7ah12.js +2 -0
- package/dist/chunk-8zwwmnpb.js +2 -0
- package/dist/chunk-98bgx3ws.js +2 -0
- package/dist/chunk-a58w524e.js +2 -0
- package/dist/chunk-a6v6x2pg.js +2 -0
- package/dist/{chunk-cama7kaq.js → chunk-afrqm7w5.js} +3 -3
- package/dist/{chunk-t3a3wbjk.js → chunk-az9b4bj4.js} +2 -2
- package/dist/chunk-b62mr2kz.js +2 -0
- package/dist/chunk-b7vxb2y6.js +2 -0
- package/dist/chunk-bb20hnqd.js +2 -0
- package/dist/chunk-bc3sknxf.js +2 -0
- package/dist/{chunk-fphnst8a.js → chunk-bef0wr53.js} +5 -5
- package/dist/{chunk-npzzbdn1.js → chunk-bhzh7mj1.js} +1 -1
- package/dist/{chunk-08a7j82a.js → chunk-bxn4b0wm.js} +2 -2
- package/dist/{chunk-zrsc45wv.js → chunk-c7eew8qs.js} +1 -1
- package/dist/chunk-cbrbrkp1.js +2 -0
- package/dist/{chunk-xw12cd90.js → chunk-cqkr291c.js} +3 -3
- package/dist/{chunk-mmdqdkbd.js → chunk-d6am6en8.js} +1 -1
- package/dist/chunk-d8djpp7f.js +2 -0
- package/dist/chunk-dk6t4h48.js +2 -0
- package/dist/chunk-dkbm7117.js +2 -0
- package/dist/chunk-e44bse67.js +2 -0
- package/dist/{chunk-kvafq9gy.js → chunk-e763qsg0.js} +2 -2
- package/dist/{chunk-pm241ehv.js → chunk-e7thwrt5.js} +2 -2
- package/dist/{chunk-1ywqsmy2.js → chunk-eazccp6e.js} +2 -2
- package/dist/{chunk-1772ax8e.js → chunk-egwtv5hp.js} +3 -3
- package/dist/chunk-ewnfgczq.js +2 -0
- package/dist/chunk-f1v5hvbt.js +2 -0
- package/dist/{chunk-914wcp1a.js → chunk-fbnykfnv.js} +3 -3
- package/dist/{chunk-827rt3ew.js → chunk-fd7e162p.js} +3 -3
- package/dist/{chunk-fhrvxfq9.js → chunk-ff3j7jnf.js} +2 -2
- package/dist/{chunk-j2wcawmf.js → chunk-fw50vydb.js} +2 -2
- package/dist/{chunk-xejhmsfw.js → chunk-fxk1psd8.js} +30 -30
- package/dist/chunk-g6epqcb3.js +2 -0
- package/dist/{chunk-23mccy5y.js → chunk-g8d24rfk.js} +2 -2
- package/dist/{chunk-ya6f7mt5.js → chunk-gjbnzn7k.js} +4 -4
- package/dist/chunk-gmvypdm8.js +2 -0
- package/dist/{chunk-sb7zn84j.js → chunk-gz0j98dy.js} +2 -2
- package/dist/{chunk-csksn1kg.js → chunk-hjh5wt5f.js} +2 -2
- package/dist/chunk-hmgry6dn.js +2 -0
- package/dist/{chunk-s37af6rd.js → chunk-jafn7f7f.js} +2 -2
- package/dist/chunk-jbv1srnh.js +2 -0
- package/dist/{chunk-fp24ecp8.js → chunk-jdqmk5sv.js} +40 -40
- package/dist/{chunk-d4gy4yz0.js → chunk-jgvwzt1t.js} +2 -2
- package/dist/{chunk-0hrkpb2h.js → chunk-jtag68hg.js} +2 -2
- package/dist/chunk-jwtp4csj.js +20 -0
- package/dist/{chunk-dhpd4mx7.js → chunk-jwwsxym6.js} +2 -2
- package/dist/chunk-jzynkjfc.js +2 -0
- package/dist/{chunk-n77xrpv9.js → chunk-k19ba3jz.js} +2 -2
- package/dist/chunk-k1qajhpx.js +2 -0
- package/dist/{chunk-tm8a2b69.js → chunk-kedgfk9z.js} +4 -4
- package/dist/{chunk-sftyb8k4.js → chunk-kq3h2rjq.js} +4 -4
- package/dist/{chunk-k0ert6e7.js → chunk-ksxbfyef.js} +2 -2
- package/dist/chunk-m28j4ym7.js +2 -0
- package/dist/{chunk-4nhbbcr9.js → chunk-m2rm2gxv.js} +5 -5
- package/dist/{chunk-cskmp5p1.js → chunk-me16tftr.js} +1 -1
- package/dist/{chunk-bkefg64w.js → chunk-mh45hcsa.js} +5 -5
- package/dist/{chunk-16p1vkn6.js → chunk-mxazxwc4.js} +3 -3
- package/dist/chunk-mzembfxk.js +2 -0
- package/dist/{chunk-hfng042r.js → chunk-mzg1wq86.js} +14 -14
- package/dist/chunk-ngzjwp2e.js +2 -0
- package/dist/chunk-nj9n0en9.js +2 -0
- package/dist/{chunk-6zj9wsy3.js → chunk-nv5xhfwz.js} +2 -2
- package/dist/chunk-nyasqjnt.js +2 -0
- package/dist/{chunk-j2s8j7ff.js → chunk-pa8xkctc.js} +6 -6
- package/dist/chunk-pn0rmd8d.js +2 -0
- package/dist/chunk-pvx1hrqq.js +2 -0
- package/dist/chunk-q78dsejp.js +2 -0
- package/dist/{chunk-8hymdzv2.js → chunk-q93jcdgj.js} +5 -5
- package/dist/{chunk-6tpcm12w.js → chunk-qv52et0d.js} +1 -1
- package/dist/{chunk-1277d5we.js → chunk-qvwzaxdd.js} +4 -4
- package/dist/chunk-qw1f97s7.js +2 -0
- package/dist/chunk-rcn0yyh2.js +2 -0
- package/dist/{chunk-1kmzj10y.js → chunk-rq9pqd4s.js} +5 -5
- package/dist/{chunk-htwn1f36.js → chunk-s322kcw7.js} +5 -5
- package/dist/{chunk-w7p34cr3.js → chunk-smve11g0.js} +1 -1
- package/dist/{chunk-gqrypyk7.js → chunk-snmq7yn4.js} +3 -3
- package/dist/chunk-t9h3e3bp.js +2 -0
- package/dist/{chunk-bg574nvy.js → chunk-tjer45j7.js} +2 -2
- package/dist/{chunk-xqr2ec9k.js → chunk-tk67pqaf.js} +3 -3
- package/dist/{chunk-4tzsze9z.js → chunk-tpw435g0.js} +2 -2
- package/dist/chunk-ts9bvjzh.js +2 -0
- package/dist/chunk-tzvgjrp4.js +2 -0
- package/dist/{chunk-1qvtme01.js → chunk-v8b1wz1b.js} +1 -1
- package/dist/{chunk-qvydfw8g.js → chunk-va1hj69e.js} +4 -4
- package/dist/{chunk-r69en2jg.js → chunk-w7s3afam.js} +1 -1
- package/dist/chunk-w9aa8xte.js +2 -0
- package/dist/{chunk-eefdz43s.js → chunk-wd4z5w4d.js} +1 -1
- package/dist/chunk-wegkgjmf.js +2 -0
- package/dist/chunk-wn065q3f.js +2 -0
- package/dist/{chunk-bq6jy4yk.js → chunk-wskdnfh9.js} +4 -4
- package/dist/{chunk-jr346anv.js → chunk-xhvw0t0f.js} +2 -2
- package/dist/{chunk-jefafv6s.js → chunk-xz1csyq9.js} +9 -9
- package/dist/chunk-y2dtqrrz.js +2 -0
- package/dist/{chunk-mfwfaggj.js → chunk-y67r0d0c.js} +3 -3
- package/dist/chunk-yss7n9db.js +2 -0
- package/dist/chunk-z6p0yxwd.js +2 -0
- package/dist/{chunk-5erremft.js → chunk-z703xzhy.js} +2 -2
- package/dist/chunk-zcpwc47w.js +2 -0
- package/dist/{chunk-2cy33z00.js → chunk-zn9dp7yn.js} +4 -4
- package/dist/chunk-zsmrq1w3.js +2 -0
- package/dist/cli.js +13 -13
- package/dist/client-script-bundler.d.ts +21 -0
- package/dist/client-script-bundler.js +14 -0
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +3 -3
- package/package.json +5 -5
- package/dist/chunk-03t7tk2k.js +0 -2
- package/dist/chunk-05f4tjsq.js +0 -2
- package/dist/chunk-08vwk3x7.js +0 -2
- package/dist/chunk-0xwmweqm.js +0 -2
- package/dist/chunk-1ffkbwdz.js +0 -2
- package/dist/chunk-1qbagang.js +0 -2
- package/dist/chunk-1xx55d2p.js +0 -2
- package/dist/chunk-2a471sw1.js +0 -3
- package/dist/chunk-2jrf9m4w.js +0 -2
- package/dist/chunk-3jgrrjvx.js +0 -2
- package/dist/chunk-5758n8sm.js +0 -2
- package/dist/chunk-655m8g98.js +0 -2
- package/dist/chunk-68kspmq4.js +0 -2
- package/dist/chunk-6x0jm4bv.js +0 -2
- package/dist/chunk-8j8fth4b.js +0 -2
- package/dist/chunk-8ta5b0eb.js +0 -2
- package/dist/chunk-93cgpqva.js +0 -2
- package/dist/chunk-9wf5fx4s.js +0 -2
- package/dist/chunk-a53jtd74.js +0 -2
- package/dist/chunk-b16g785w.js +0 -2
- package/dist/chunk-bz4bskx3.js +0 -2
- package/dist/chunk-ccdp6g5z.js +0 -2
- package/dist/chunk-dee5mtdv.js +0 -2
- package/dist/chunk-dm10y06z.js +0 -2
- package/dist/chunk-dtxg2a6m.js +0 -2
- package/dist/chunk-dw9vnhc4.js +0 -2
- package/dist/chunk-ent64fyq.js +0 -2
- package/dist/chunk-erfspa7v.js +0 -2
- package/dist/chunk-f0kveh4g.js +0 -2
- package/dist/chunk-f1z6y2ts.js +0 -2
- package/dist/chunk-f3msj6jf.js +0 -2
- package/dist/chunk-fk7wk568.js +0 -2
- package/dist/chunk-fsg958xx.js +0 -2
- package/dist/chunk-gggethdc.js +0 -2
- package/dist/chunk-gr19kv83.js +0 -2
- package/dist/chunk-hj1yn8w5.js +0 -2
- package/dist/chunk-hzrcnxzg.js +0 -2
- package/dist/chunk-jed9n2hz.js +0 -2
- package/dist/chunk-js7nmw8v.js +0 -2
- package/dist/chunk-kfq4mwem.js +0 -2
- package/dist/chunk-knd3m4t4.js +0 -2
- package/dist/chunk-m3kc2a3v.js +0 -2
- package/dist/chunk-mjp2sp74.js +0 -2
- package/dist/chunk-mx79sfyr.js +0 -2
- package/dist/chunk-n68sanmz.js +0 -2
- package/dist/chunk-n6w82yf2.js +0 -2
- package/dist/chunk-nstcwcpj.js +0 -2
- package/dist/chunk-q1z8edtn.js +0 -2
- package/dist/chunk-qw0ctwnc.js +0 -20
- package/dist/chunk-rrf78ezg.js +0 -2
- package/dist/chunk-syww37qd.js +0 -2
- package/dist/chunk-vmrvkbw6.js +0 -2
- package/dist/chunk-vr5h5jpw.js +0 -2
- package/dist/chunk-vw9h1x2m.js +0 -2
- package/dist/chunk-wg7xzens.js +0 -2
- package/dist/chunk-x2vybq9n.js +0 -2
- package/dist/chunk-y5agvhgg.js +0 -2
- package/dist/chunk-zd2c84ct.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ft,le,_,u,f,P,t,ee,K,l,Ce,Ai,z,En,Pi,Vt,Ii,
|
|
2
|
+
import{Ft,le,_,u,f,P,t,ee,K,l,Ce,Ai,z,En,Pi,Vt,Ii,fl,Ir,gl,lt,ml,Or,hl,Tn,Oi,yl,Nr,Dr,Ee,Ni}from"./chunk-0z2gqttt.js";import{pi,Lc,o,C,Me,Nt,mn,De,ge,J,kr,hn,Vs,Kc,Gc,bn,$r,Ws,qs,Xc,wi,Jc,Yc,Zc,Qc,je,Be,Ks,He,s,xn,m,p,W,Q,_e,E,Ei}from"./chunk-jdqmk5sv.js";import{Bt}from"./chunk-sny8rqe8.js";import{_n}from"./chunk-qv52et0d.js";import{b}from"./chunk-6qbha6fb.js";import{br,Ns}from"./chunk-jwwsxym6.js";import{vc,xc,mr,tt,Sc,O}from"./chunk-1347hwt5.js";import{ri,si,oi,ii}from"./chunk-pa8xkctc.js";import{mc,ms}from"./chunk-71s4hpkj.js";import{us,ds,ps}from"./chunk-rq9pqd4s.js";import{bs,Xo,Jo,ws,vs,Yo}from"./chunk-8623gte8.js";import{hs,Uo}from"./chunk-mxazxwc4.js";import{Fo}from"./chunk-t5q31st4.js";import{ie,Wo,qo,Ko}from"./chunk-me16tftr.js";import{dr,ve,yc,pr,bc}from"./chunk-s322kcw7.js";import{B,Qe}from"./chunk-pb09xy77.js";import{_c,Cc}from"./chunk-tk67pqaf.js";import{T,$n,Mi}from"./chunk-ym5qgw03.js";import Kn from"fs";import se from"path";function pt(n){let e=Nt(n),c=e.find((x)=>x.closing&&x.name.toLowerCase()==="head");if(!c)return n;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),g=0,r=[];for(let x=0;x<e.length;x++){let w=e[x];if(w.start<c.end)continue;let v=w.name.toLowerCase();if(a.has(v)){g=Math.max(0,g+(w.closing?-1:w.selfClosing?0:1));continue}if(v!=="style"||w.closing||g>0)continue;let k=e[x+1];if(k?.name.toLowerCase()==="style"&&k.closing){if(/@scope\s*\{/.test(n.slice(w.end,k.start)))continue;r.push({start:w.start,end:k.end}),x++}}if(!r.length)return n;let d=r.map((x)=>n.slice(x.start,x.end)).join(`
|
|
3
3
|
`),y=[n.slice(0,c.start),d,`
|
|
4
4
|
`],h=c.start;for(let x of r)y.push(n.slice(h,x.start)),h=x.end;return y.push(n.slice(h)),y.join("")}function ft(){return`
|
|
5
5
|
// STX Lifecycle Runtime
|
|
@@ -580,7 +580,7 @@ ${A.element}`);else v.push(`@else
|
|
|
580
580
|
${A.element}`);v.push("@endif");let k=v.join(`
|
|
581
581
|
`),S=r[0].outerStart,M=r[r.length-1].outerEnd;e=e.slice(0,S)+k+e.slice(M),c=S+k.length}return e}function Cn(n){return n.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function An(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=yn.has(a.tag),r=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(y,h,x)=>{let w=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(h);if(!w||!x||!/^["']/.test(x))return y;let v=w[1]||"modelValue",k=w[2];if(g&&!w[1])return`@model${k}=${x}`;let S=x[0],M=x.slice(1,-1),A=`:${v}=${x} @update:${v}=${S}${M} = $event${S}`;if(k){let R=w[1]?`${v}Modifiers`:"modelModifiers",D=k.slice(1).split(".").map((j)=>`${j}: true`).join(", ");A+=` :${R}="{ ${D} }"`}return A});if(r===a.attrs){c=a.end;continue}let d=Ie(a.full,{...a,start:0,end:a.full.length},r);e=e.slice(0,a.start)+d+e.slice(a.end),c=a.start+d.length}return e}function Rn(n){return n.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Mn(n){return n.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Dn(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=qe(a.attrs,"v-html");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let r=Se(e,a),d=we(a.attrs,"v-html"),y=a.selfClosing?" /":"",h=`<${a.tag}${d}${y}>{!! ${g} !!}</${a.tag}>`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function In(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;let g=qe(a.attrs,"v-text");if(g===null){c=a.end;continue}if(a.selfClosing){c=a.end;continue}let r=Se(e,a),d=we(a.attrs,"v-text"),y=a.selfClosing?" /":"",h=`<${a.tag}${d}${y}>{{ ${g} }}</${a.tag}>`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function On(n){return n.replace(/(<[a-zA-Z][a-zA-Z0-9-]*)(\s[^>]*?)\s+v-pre([^>]*>)/g,"$1$2 data-stx-skip$3").replace(/(<[a-zA-Z][a-zA-Z0-9-]*)\s+v-pre(\s[^>]*>|>)/g,"$1 data-stx-skip$2")}function Ln(n){let e=n,c=0;while(c<e.length){let a=$e(e,c);if(!a)break;if(!Jt(a.attrs,"v-once")){c=a.end;continue}let g=we(a.attrs,"v-once"),r=Se(e,a),d=e.slice(r.outerStart,r.outerEnd),h=`@once
|
|
582
582
|
${Ie(d,{...a,start:0,end:a.end-a.start},g)}
|
|
583
|
-
@endonce`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function Pn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jn(n){return n.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function Qt(n){if(!vn(n))return n;let e=n;return e=kn(e),e=Sn(e),e=Ln(e),e=Rn(e),e=Mn(e),e=An(e),e=Cn(e),e=jn(e),e=Dn(e),e=In(e),e=On(e),e=Pn(e),e}function Ke(n){return n.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var st=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),Nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Yt(n,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=c?c[1]:n,g=u(a,e);if(g&&typeof g==="string")return g;let r=a.trim();return st.has(r)?r:null}function er(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function tr(n,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${n} ${a}>`:`<${n}>`;if(Nn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${g}${c}</${n}>`}async function rr(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],slotContent:h[3],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let j=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}if(st.has(v)){let j=tr(v,w.attrs,w.slotContent);r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,A;while((A=M.exec(k))!==null){let j=A[1]||A[2],N=A[3];if(A[1])try{S[j]=u(N,e)}catch{S[j]=N}else S[j]=N}let R=a.componentsDir||"components",D=await He(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+D+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r=await Hn(r,e,c,a,g),r}async function Hn(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}if(st.has(v)){let M=tr(v,w.attrs,"");r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await He(v,{},"",k,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r}var
|
|
583
|
+
@endonce`;e=e.slice(0,r.outerStart)+h+e.slice(r.outerEnd),c=r.outerStart+h.length}return e}function Pn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function jn(n){return n.replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'#$1="$2"').replace(/\bv-slot:([a-zA-Z_][a-zA-Z0-9_-]*)(?=[\s>])/g,"#$1").replace(/\bv-slot\s*=\s*"([^"]*)"/g,'#default="$1"')}function Qt(n){if(!vn(n))return n;let e=n;return e=kn(e),e=Sn(e),e=Ln(e),e=Rn(e),e=Mn(e),e=An(e),e=Cn(e),e=jn(e),e=Dn(e),e=In(e),e=On(e),e=Pn(e),e}function Ke(n){return n.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var st=new Set(["a","abbr","address","article","aside","audio","b","bdi","bdo","blockquote","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","meter","nav","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","video"]),Nn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Yt(n,e){let c=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=c?c[1]:n,g=u(a,e);if(g&&typeof g==="string")return g;let r=a.trim();return st.has(r)?r:null}function er(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function tr(n,e,c){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=a?`<${n} ${a}>`:`<${n}>`;if(Nn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${g}${c}</${n}>`}async function rr(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],slotContent:h[3],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let j=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}if(st.has(v)){let j=tr(v,w.attrs,w.slotContent);r=r.slice(0,w.index)+j+r.slice(w.index+w.full.length);continue}let k=w.attrs.trim(),S={},M=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,A;while((A=M.exec(k))!==null){let j=A[1]||A[2],N=A[3];if(A[1])try{S[j]=u(N,e)}catch{S[j]=N}else S[j]=N}let R=a.componentsDir||"components",D=await He(v,S,w.slotContent,R,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+D+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r=await Hn(r,e,c,a,g),r}async function Hn(n,e,c,a,g){let r=n,d=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,y=[],h;while((h=d.exec(r))!==null)y.push({full:h[0],expr:h[1],attrs:h[2],index:h.index});for(let x=y.length-1;x>=0;x--){let w=y[x];try{let v=Yt(w.expr,e);if(!v||typeof v!=="string"){let M=`<!-- dynamic component: could not resolve "${Ke(er(w.expr))}" -->`;r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}if(st.has(v)){let M=tr(v,w.attrs,"");r=r.slice(0,w.index)+M+r.slice(w.index+w.full.length);continue}let k=a.componentsDir||"components",S=await He(v,{},"",k,e,c,a,new Set,g??new Set);r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}catch(v){let k=v instanceof Error?v.message:String(v),S=`<!-- dynamic component error: ${Ke(k)} -->`;r=r.slice(0,w.index)+S+r.slice(w.index+w.full.length)}}return r}var dc="X-STX-Build",it=Symbol.for("stx.buildId");function ls(){let n=globalThis;if(!n[it])n[it]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return n[it]}function nr(n,e=ls()){if(n.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(n))return null;return`
|
|
584
584
|
<meta name="stx-build" content="${e}">`}var jo="/_stx/sw.js";function Bn(n){if(typeof n!=="string"||!n.startsWith("/"))return null;let e=[],c=[],a=n.replace(/\/+$/,"").split("/").slice(1).map((g)=>{let r=/^:(\w+)$/.exec(g)||/^\[(\w+)\]$/.exec(g);if(r)return e.push(r[1]),c.push("0"),"([^/]+)";return c.push(g),g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:n,re:`^/${a.join("/")}/?$`,names:e,sample:`/${c.join("/")}`}}function Fn(n){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,c=window;if(c.stxOffline)return;let a=null,g=!1,r=[],d={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(w){if(d.updateReady)try{w()}catch{}else r.push(w);return()=>{let v=r.indexOf(w);if(v!==-1)r.splice(v,1)}},applyUpdate(){let w=a&&a.waiting;if(!w)return!1;return g=!0,w.postMessage({type:"stx:activate-update",force:!0}),!0}};c.stxOffline=d;let y=(w)=>{if(!w.waiting||!e.controller||d.updateReady)return;d.updateReady=!0;let v=r.splice(0);for(let k of v)try{k()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(w)=>{let v=w.data||{};if(v.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:v.url,kind:v.kind,fragment:!!v.fragment}}))}catch{}if(v.type==="stx:reachability"){if(c.stxOffline.reachable=v.reachable!==!1,Number(v.at)>0)c.stxOffline.reachedAt=Number(v.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:v.reachable!==!1,at:Number(v.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(g)g=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let h=()=>{e.register(n,{scope:"/"}).then((w)=>{a=w;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(w.waiting)y(w),w.waiting.postMessage({type:"stx:activate-update",reason:"load"});w.addEventListener("updatefound",()=>{let v=w.installing;if(!v)return;v.addEventListener("statechange",()=>{if(v.state==="installed")y(w)})})}).catch(()=>{})},x=()=>{let w=(v)=>{setTimeout(v,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>w(h));else w(h)};if(!e.controller)if(document.readyState==="complete")x();else addEventListener("load",x);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",x);else x()}function Un(){let n=`(${Fn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim().replace(/;$/,"")}catch{return n}}function qn(n,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!n||!n.startsWith("/"))return null;let c=n.split(/[?#]/)[0].split("/").filter(Boolean)[0];return c?`/${c}`:"/"}var sr=`<script data-stx-offline>${Un()}</script>`;function Bo(n,e){let c=Number(n.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((n.pages||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")))),staticPages:(n.staticPages||[]).filter((g)=>typeof g==="string"&&((n.pages||[]).includes(g)||(n.routes||[]).includes(g))),api:n.apiPrefix||"/api/",timeout:Math.max(500,Number(n.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(c)&&c>0?Math.min(2147483647,Math.max(1,Math.floor(c))):1e4,networkFirst:(n.networkFirst||[]).filter((g)=>typeof g==="string"&&g.startsWith("/")),updateOnColdStart:n.updateOnColdStart===!0,fallback:n.fallback||n.pages&&n.pages[0]||null,fallbackScope:qn(n.fallback||n.pages&&n.pages[0]||null,n.fallbackScope),routes:(n.routes||[]).map(Bn).filter(Boolean),exclude:["/_stx/hmr","/_stx/sw.js",...n.exclude||[]],mediaMax:Math.max(10485760,Number(n.mediaMaxBytes)||629145600),assetsMax:Math.max(50,Number(n.assetsMaxEntries)||500)};return`/* stx offline worker, build ${a.build} */
|
|
585
585
|
'use strict';
|
|
586
586
|
var S = ${JSON.stringify(a)};
|
|
@@ -1295,35 +1295,35 @@ ${R}
|
|
|
1295
1295
|
</style>`;a=a.replace(x,D),y.lastIndex=0}catch(R){}}}return a}import ot from"path";var Wn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Xn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function zn(n,e){if(!e||!n.includes("/"))return n;let c=ot.dirname(e);return n.replace(Wn,(a,g,r,d)=>{let y=ot.resolve(c,d);return`${g}${r}${y.split(ot.sep).join("/")}${r}`})}function ur(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Xn,(c,a,g,r)=>`${a}${zn(g,e)}${r}`)}var Te="<!--PARENT_CONTENT_PLACEHOLDER-->";function fr(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Sr(n,e){let c=n.length,a=e,g=!0,r=[],d=(y)=>y+9<=c&&n[y]==="<"&&n[y+1]==="/"&&(n[y+2]==="s"||n[y+2]==="S")&&(n[y+3]==="c"||n[y+3]==="C")&&(n[y+4]==="r"||n[y+4]==="R")&&(n[y+5]==="i"||n[y+5]==="I")&&(n[y+6]==="p"||n[y+6]==="P")&&(n[y+7]==="t"||n[y+7]==="T")&&(n[y+8]===">"||/\s/.test(n[y+8]));while(a<c){let y=n[a];if(d(a))return a;if(y==="/"&&n[a+1]==="/"){if(a=n.indexOf(`
|
|
1296
1296
|
`,a+2),a===-1)return-1;a+=1,g=!0;continue}if(y==="/"&&n[a+1]==="*"){let h=n.indexOf("*/",a+2);if(h===-1)return-1;a=h+2,g=!0;continue}if(y==="/"&&g){let h=a+1,x=!1;while(h<c){let w=n[h];if(w==="\\"){h+=2;continue}if(w==="[")x=!0;else if(w==="]")x=!1;else if(w==="/"&&!x){h++;break}else if(w===`
|
|
1297
1297
|
`){h=-1;break}h++}if(h===-1){a++,g=!1;continue}while(h<c&&/[a-z]/.test(n[h]))h++;a=h,g=!1;continue}if(y==="'"||y==='"'){let h=y;a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]===h){a++;break}if(n[a]===`
|
|
1298
|
-
`)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(y==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function Er(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function at(n,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-
|
|
1298
|
+
`)break;a++}g=!1;continue}if(y==="`"){a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}if(r.length===0)g=!1;continue}if(y==="}"&&r.length>0){r.pop(),a++;while(a<c){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,g=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,g=!0;break}a++}continue}if(/\s/.test(y));else if(/[)\].\w$]/.test(y))g=!1;else g=!0;a++}return-1}function Er(n,e){let c=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${c}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let g=a.index+a[0].length,r=n.indexOf("</script>",g);if(r===-1)return null;let d=n.indexOf(">",r);if(d===-1)return null;return{start:a.index,end:d+1}}var Gn=4096;async function at(n,e,c){if(c.buildMode!=="serve"||e.length<Gn)return null;let{registerServeModuleBundle:a}=await import("./chunk-b62mr2kz.js");return`<script ${n} src="${a(e)}"></script>`}async function or(n,e,c,a){try{let{registeredModuleIdsIn:g,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-cbrbrkp1.js")),d=[],y=await r(g(...n),{minify:Mi(e.buildMode,e.minifyClient),collectInputs:d});for(let h of d)c?.add(h);if(a)a.inputs=d,a.code=y??void 0;if(!y)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-b62mr2kz.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${h(y)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${y.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Zn(n,e,c,a){let g={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:k}=await o("stx/framework-composables",()=>import("./chunk-c7eew8qs.js"));g.frameworkScript=await k(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-gmvypdm8.js"))}catch{}let d=e.storesDir,y=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),h=y?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),x=[],w=[],v=null;for(let k=0;k<8;k++){let S=null,M="",A=!1;try{if(r){let N=y?await r.getStoreScript(d).then((F)=>F?{code:F,stores:["*"],functions:null}:null):await r.getStoreScriptFor(d,[h],{reads:r.storesReadInFiles([...x,...w]),runOnce:!0});if(N)S=N.code,M=N.stores.join(","),A=!!N.functions&&!y}}catch{}if(v!==null&&M===v)break;v=M;let R=A?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",D=S?`<script ${R}>${S}</script>`:null;g.storeCode=S,g.storeTag=S?await at(R,S,e)??D:null;let j={};g.modulesTag=await or([n,D],e,c,j),g.modulesCode=j.code??null,x=j.inputs??[],g.composableTag=null,g.composableCode=null,w=[];try{let{getComposableScript:N}=await o("stx/composable-loader",()=>import("./chunk-dkbm7117.js")),F=e.composablesDir,I=[g.modulesCode??g.modulesTag,D,g.frameworkScript].filter((H)=>H!==null),L=await N(e._layerComposableDirs??F,n,I,w);if(L)g.composableCode=L,g.composableTag=await at('data-stx-scoped data-stx-run="always" data-stx-composables',L,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${L}</script>`}catch{}if(y||!r)break}return g}async function Jn(n,e,c,a={}){let{withModuleSubstitutes:g,moduleSubstitutionKey:r}=await import("./chunk-mzembfxk.js"),d=await import("./chunk-nyasqjnt.js"),{messages:y,webModules:h}=e,x=null,w=null,v=r()===""&&!a.__stx_native_screen;if(y&&d.pageMessagesEnabled(e)&&v)try{x=await d.loadPageMessages(process.cwd(),y)}catch(R){Qn(R)}if(h&&Object.keys(h).length&&v)try{w=await(await import("./chunk-d6am6en8.js")).loadWebModules(process.cwd(),h)}catch(R){Yn(R)}let k=new Map([...w??[],...x?.stubs??[]]),S=()=>Zn(n,e,c,a),M=k.size?await g(k,S):await S(),A=null;if(x){let R=d.messageAreasIn(M.modulesCode,M.storeCode,M.composableCode),D=d.pageMessagesScript(x,d.pageLanguages(n,x),R);if(D)A=await at('data-stx-scoped data-stx-run="always" data-stx-messages',D,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${D.replace(/<\/script/gi,"<\\/script")}</script>`}return[A,M.modulesTag,M.storeTag,M.composableTag,M.frameworkScript].filter((R)=>R!==null)}var gr=!1;function Qn(n){if(gr)return;gr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var hr=!1;function Yn(n){if(hr)return;hr=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function es(n,e=""){let c=Er(n,"data-stx-runtime");if(!c)return n;let a=dr(n);if(a===-1||a===c.start){if(!e)return n;return n.slice(0,c.end)+e+n.slice(c.end)}if(a<c.start)return n.slice(0,a)+n.slice(c.start,c.end)+e+`
|
|
1299
1299
|
`+n.slice(a,c.start)+n.slice(c.end);let g=n.slice(c.start,c.end),r=n.slice(0,c.start)+n.slice(c.end),d=dr(r);if(d===-1)return g+e+`
|
|
1300
1300
|
`+r;return r.slice(0,d)+g+e+`
|
|
1301
|
-
`+r.slice(d)}function ts(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(await _(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=_e(n,c);let r=!e.__stxProcessingDepth;bn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await _n(e,c,a.runtimeConfig);if(r)
|
|
1302
|
-
`),...x.htmlAttrs&&{htmlAttrs:
|
|
1301
|
+
`+r.slice(d)}function ts(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(c,a,g)=>{let r=n.slice(0,g);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,c,a,g){if(await _(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=_e(n,c);let r=!e.__stxProcessingDepth;bn(e);for(let d of a._layerGraph?.configDependencies??[])g.add(d);if(r&&a.runtimeConfig)await _n(e,c,a.runtimeConfig);if(r)Zc(e),e.__stx_scope_seq??={n:0,key:Ks(String(e.__filename??c))},e.__stx_head_injections=Ii(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!T()&&!$n())&&c&&c.endsWith(".stx"))Fo(n,c);try{return await le.timeAsync("template-processing",async()=>{let d=await rs(n,e,c,a,g);if(r)d=wi(d);if(r&&a.autoShell&&a.buildMode!=="compile"){let y=Ee(a.app?.head,{known:Dr,source:"app.head"}),x=(e.__stx_runtime_head||null)??Ni(),w=(e.__stx_head_raw||"").trim(),v,k=w.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(k)v=k[1].trim(),w=w.replace(k[0],"").trim();let S=e.__sections?.title,M=S?E(S,e,c):void 0,A=x.title||v||M,R=!x.title&&(!!v||!!M),D=x.meta||[],j=new Set(D.map((V)=>lt(V)).filter(Boolean)),N={...y,...A&&{title:A},meta:[...(y.meta||[]).filter((V)=>!j.has(lt(V))),...D],link:[...y.link||[],...x.link||[]],script:[...y.script||[],...x.script||[]],headRaw:[y.headRaw,w].filter(Boolean).join(`
|
|
1302
|
+
`),...x.htmlAttrs&&{htmlAttrs:ml(y.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...y.bodyAttrs||{},...x.bodyAttrs}}},F=Oi(d);if(d=Nr(d,N,{...R&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},F),F)d=yl(d,y),d=Or(d,N.htmlAttrs);let I=d.match(/<!-- stx-layout: ([^ ]+) -->/);if(I&&d.includes("<head")){let V=I[1],ae=Ns(V);d=d.replace(/<head\b[^>]*>/i,(X)=>`${X}
|
|
1303
1303
|
<meta name="stx-layout" content="${fr(V)}">
|
|
1304
|
-
<meta name="stx-layout-group" content="${fr(ae)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?B(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Qe(d,(ae,X)=>`<body${X} data-stx="${L[1]}">`);let V=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(V,"$1")}}if(r){let y=e.__stx_head_injections??Ii(),h=
|
|
1304
|
+
<meta name="stx-layout-group" content="${fr(ae)}">`)}let L=d.match(/function (__stx_setup_\w+)\(/),H=L?B(d):null;if(L&&H&&!/\bdata-stx=/.test(H.tag)){d=Qe(d,(ae,X)=>`<body${X} data-stx="${L[1]}">`);let V=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${L[1]}"`,"i");d=d.replace(V,"$1")}}if(r){let y=e.__stx_head_injections??Ii(),h=hl(d);if(h!==null)y.beforeClose.push(h);let x=nr(d);if(x!==null)y.afterOpen.push(x);if(a.offline?.enabled&&!d.includes("data-stx-offline"))y.beforeClose.push(sr);d=fl(d,y);let w=a.app?.colorMode;if(w)d=Ir(d,w)}if(r)if(Er(d,"data-stx-runtime")){let h=await Jn(d,a,g,e);d=es(d,h.map((x)=>`
|
|
1305
1305
|
${x}`).join(""))}else{let h=await or([d],a,g);if(h){let x=d.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)d=d.slice(0,x)+h+`
|
|
1306
|
-
`+d.slice(x)}}if(r)d=
|
|
1306
|
+
`+d.slice(x)}}if(r)d=gl(d);if(r&&e.__stx_inject_css!==!1)d=await b(d,void 0,a.buildMode==="serve",!0);else if(r)d=hn(d);if(r)d=pt(d);if(d=d.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),d=ts(d),r&&e.__stx_runtime_config)d=Bt(d,e.__stx_runtime_config);if(r&&!e.__stx_defer_server_data){let y=$r(e);if(y){let h=/<head\b[^>]*>/i.exec(d),x=h?h.index+h[0].length:0;d=d.slice(0,x)+y+d.slice(x)}}return d})}catch(d){if(d instanceof K)throw d;let y=d instanceof Error?d.message:String(d),h=new ee(`Template processing failed: ${y}`,c,void 0,void 0,n.substring(0,200)+(n.length>200?"...":""));if(z.log(h,{filePath:c,context:e}),En.logDetailedError(h,{filePath:c,template:n.substring(0,500)}),T()&&!a.debug)console.error(`[stx] ${se.relative(process.cwd(),c)||c}: ${h.message}`);if(a.debug)throw h;return Ai.createFallbackContent("Template Processing",h)}}async function rs(n,e,c,a,g){let r=process.cwd(),d={...a,partialsDir:a.partialsDir&&!se.isAbsolute(a.partialsDir)?se.resolve(r,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!se.isAbsolute(a.componentsDir)?se.resolve(r,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!se.isAbsolute(a.layoutsDir)?se.resolve(r,a.layoutsDir):a.layoutsDir},y=d,h=n;await is(c,e),ss(e,y),h=await Ce(()=>zt(h,e,c,y),h,(I)=>{z.log(I,{filePath:c,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${c}: ${I.message}`)}),h=h.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=ge(h,De,(I,L)=>`\x00STX_HTML_COMMENT_${L}\x00`);h=x.output;let w=x.tokens,v=(I)=>w.length===0?I:I.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(L,H)=>w[Number(H)]??""),k="\x00STX_ESCAPED_AT\x00",S="\x00STX_ESC_MUSTACHE_OPEN\x00",M="\x00STX_ESC_MUSTACHE_CLOSE\x00";h=h.replace(/@@/g,k),h=h.replace(/@\{\{([\s\S]*?)\}\}/g,(I,L)=>`${S}${L}${M}`),h=Qt(h),h=await lr(h,c,g);let A={};h=ds(h,A);let R={...e.__sections||{}},D="",j=bt(vt(n)),N=/@nolayout\b/.test(h)||j===!1;if(/@nolayout\b/.test(h))h=h.replace(/@nolayout\b\s*/g,"");let F=h.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(F)D=F[1],h=h.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof j==="string"){if(D=j,!/@section\s*\(/.test(h))h=`@section('content')
|
|
1307
1307
|
${h.trim()}
|
|
1308
1308
|
@endsection`}if(!D&&!N&&y.defaultLayout){let I=Tn(h),L=/@section\s*\(/.test(h);if(!I||L){let H="",V=se.dirname(c),ae=y.layoutsDir?se.dirname(y.layoutsDir):process.cwd();for(let X=0;X<20;X++){let ce=se.join(V,"_layout.stx");if(await s(ce)){H=ce;break}let oe=se.dirname(V);if(oe===V||oe.length<ae.length)break;V=oe}if(H)D=H;else if(y.layoutsDir){let X=se.isAbsolute(y.layoutsDir)?y.layoutsDir:se.resolve(process.cwd(),y.layoutsDir),ce=se.join(X,`${y.defaultLayout}.stx`);if(await s(ce))D=ce}if(D&&!L)h=`@section('content')
|
|
1309
1309
|
${h.trim()}
|
|
1310
1310
|
@endsection`}}if(D&&h.includes("<script")){let I=J(h),L=I.scripts.map((H)=>yr(H,c)??H);h=kr(I.output,L)}if(h=h.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(I,L,H)=>(R[L]=H,"")),h=h.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(I,L,H)=>{if(/^(['"]).*\1$/.test(H.trim()))return I;try{let V=u(H.trim(),e);if(V===void 0)return I;let X=(e.__stx_inline_section_values??=[]).push(V)-1;return R[L]=`{{ __stx_inline_section_values[${X}] }}`,""}catch{return I}}),h=h.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(I,L,H)=>{if(H.includes("@parent"))R[L]=H.replace("@parent",Te);else R[L]=H.trim();return""}),e.__sections=R,h=h.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(I,L,H)=>R[L]||H||""),!("slot"in e)||e.slot===void 0)h=h.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||"");if(h=ps(h,A),D){let I=[],L=J(h),H=ge(L.output,mn,(V,ae)=>`\x00STX_ORPHAN_STYLE_${ae}\x00`);if(h=H.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(V,ae,X)=>{let ce=ae==="SCRIPT"?yr(L.scripts[Number(X)],c):H.tokens[Number(X)];if(ce)I.push(ce);return""}),I.length>0){let V=I.join(`
|
|
1311
1311
|
`);R.content=R.content?`${R.content}
|
|
1312
1312
|
${V}`:V,e.__sections=R}}if(D)try{let I;if(se.isAbsolute(D))I=D,g.add(D);else I=await Ce(()=>xn(D,c,d,g),null,()=>{throw new ee(`Failed to resolve layout path: ${D}`,c,void 0,void 0,`Layout referenced from ${c}`)});if(!I){let oe=(G)=>{if(!G)return[];try{let ye=se.isAbsolute(G)?G:se.resolve(process.cwd(),G);return Kn.readdirSync(ye).filter((xe)=>xe.endsWith(".stx")).map((xe)=>xe.replace(/\.stx$/,""))}catch{return[]}},te=[...oe(d.layoutsDir),...oe(d.fallbackLayoutsDir)].filter((G,ye,xe)=>xe.indexOf(G)===ye).sort(),he=[d.layoutsDir,d.fallbackLayoutsDir].filter((G)=>typeof G==="string"&&G.length>0),de=he.length>0?` Searched: ${he.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",re=`Layout not found: ${D} (referenced from ${c})`+(te.length>0?`. Available layouts: ${te.join(", ")}`:d.layoutsDir?`. No .stx layouts found in ${d.layoutsDir}`:"")+de;if(z.log(Error(re),{layoutPath:D,filePath:c,available:te},"error"),console.error(`[stx] ${re}`),d.debug)throw new ee(re,c);return h}let L=await Ce(()=>Bun.file(I).text(),"",()=>{throw new ee(`Failed to read layout file: ${I}`,c,void 0,void 0,"Layout content could not be loaded")});L=ur(L,I),L=L.replace(/\{\{--[\s\S]*?--\}\}/g,"");let H=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(H.includes(I)){let oe=[...H.slice(H.indexOf(I)),I];throw new ee(oe.length===2?`Circular layout: ${I} extends itself`:`Circular layout: ${oe.join(" -> ")}`,c,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let V=L.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(V){if(d.debug)console.log(`Found nested layout: ${V[1]} in ${I}`);let oe={},te=L.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(re,G,ye)=>(oe[G]=ye.trim(),""));for(let[re,G]of Object.entries(oe))if(R[re]&&R[re].includes(Te)){let ye=R[re].indexOf(Te);R[re]=R[re].slice(0,ye)+G+R[re].slice(ye+Te.length)}else if(!R[re])R[re]=G;let he={...e,__sections:R,__layoutChain:[...H,I]},de=`@layout('${V[1]}')${te}`;return await i(de,he,I,d,g)}let ae=L.replace(/\{\{--[\s\S]*?--\}\}/g,""),X=ds(ae,A),ce={};return X=X.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(oe,te,he)=>(ce[te]=he.trim(),`@slot('${te}')`)),X=X.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(oe,te,he)=>{if(R[te]){let de=R[te];if(de.includes(Te)){let re=ce[te]||"",G=de.indexOf(Te);de=de.slice(0,G)+re+de.slice(G+Te.length)}return de}return he||""}),X=ns(X,R),X=X.replace(/\{\{\s*slot\s*\}\}/g,()=>R.content||""),X=ps(X,A),e.__originalFilePath=c,h=await xr(X,e,I,d,g),h=`<!-- stx-layout: ${D} -->
|
|
1313
|
-
${h}`,v(h)}catch(I){if(I instanceof K)throw I;throw new ee(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await xr(h,e,c,d,g))}function ns(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function ss(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function is(n,e){await Ce(()=>Zt(n,e),void 0,(c)=>{z.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var ct="data-stx-source";function yr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return n;return`<script ${ct}="${encodeURIComponent(e)}"${n.slice(7)}`}function os(n){let e=new RegExp(`${ct}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function wr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function vr(n,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wr(n)}</span><span style="display:block;margin-top:4px">${wr(c)}</span></div>`}async function as(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1314
|
-
`;if(r=X(r,e),r=ce(r,e,c),r=Gt(r),r=Wo(r,e),r=Tt(r),r=Wt(r),r=await us(r,e,c,d,g),r=await ms(r,e,c,d,g),await _(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=wi(r),r=ie(r,e,c),r=hs(r),await _(),e.__stxProcessingDepth===1)r=
|
|
1313
|
+
${h}`,v(h)}catch(I){if(I instanceof K)throw I;throw new ee(`Error processing layout ${D}: ${I instanceof Error?I.message:String(I)}`,c)}return v(await xr(h,e,c,d,g))}function ns(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(c,a,g)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return g||""})}function ss(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let c=e.envPrefix||"STX_PUBLIC_",a={};for(let[g,r]of Object.entries(process.env))if(g.startsWith(c)&&r!==void 0)a[g]=r;n.$env=a}async function is(n,e){await Ce(()=>Zt(n,e),void 0,(c)=>{z.log(c,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${c.message}`)})}var ct="data-stx-source";function yr(n,e){if(!n)return n;let c=/^<script\b([^>]*)>/i.exec(n);if(!c||!/\bserver\b/.test(c[1])||c[1].includes(ct))return n;return`<script ${ct}="${encodeURIComponent(e)}"${n.slice(7)}`}function os(n){let e=new RegExp(`${ct}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function wr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function vr(n,e,c){return`<div data-stx-server-script-error role="alert" style="padding:12px 14px;border:1px solid #f0b4b4;border-left-width:4px;background:#fff5f5;color:#7a1f1f;font:13px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace"><strong style="display:block;margin-bottom:4px">stx: a <script server> ${e==="module-resolution"?"imports a module that does not resolve":e==="syntax"?"does not parse":"names something that does not exist"}, so this component rendered nothing.</strong><span style="display:block;opacity:.85">${wr(n)}</span><span style="display:block;margin-top:4px">${wr(c)}</span></div>`}async function as(n,e,c,a){let{scanScriptTags:g}=await o("stx/signal-processing",()=>import("./chunk-nj9n0en9.js")),r=[],d=!T()&&!$n();for(let h of g(n)){let x=h.attrs;if(!/\bserver\b/.test(x))continue;let w=h.start+h.fullMatch.indexOf(">")+1,v=Sr(n,w);if(v===-1)continue;let k=n.slice(w,v);if(!k.trim())continue;let S=os(x)??c,M={index:h.start,length:v+9-h.start};try{let{extractVariables:A}=await o("stx/variable-extractor",()=>import("./chunk-39cwa35j.js"));await A(k,e,S,{preserveExisting:!0,onFailure:(R)=>{if(R.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:S,kind:R.kind,message:R.message}),!d)return;r.push({...M,markup:vr(S,R.kind,R.message)})}})}catch(A){let R=A instanceof Error?A:Error(String(A));if(z.log(R,{filePath:S,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${S}: ${R.message}`),d)r.push({...M,markup:vr(S,"unknown",R.message)})}}if(r.length===0)return n;let y=n;for(let h of r.sort((x,w)=>w.index-x.index))y=y.slice(0,h.index)+h.markup+y.slice(h.index+h.length);return y}async function cs(n,e,c){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-rcn0yyh2.js"));return a(n,e,{skipServer:!0})}catch(a){let g=a instanceof Error?a:Error(String(a));return z.log(g,{filePath:c,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${c}: ${g.message}`),n}}async function xr(n,e,c,a,g){let r=n;await _();let d=a;if(r=await as(r,e,c,a),r=await Ht(r,e,c),r=await Ut(r,e,c),r=await cs(r,e,c),await _(),r=await At(r,e,c,d),_e(r))r=Xo(r,e),r=vs(r,e),r=ws(r,e);r=Jo(r),await _();let{processStreamDirectives:y}=await o("stx/streaming",()=>import("./chunk-98bgx3ws.js"));r=y(r,e),r=await Uo(r,e,c,d,!0),await _(),r=await rr(r,e,c,d,g),r=await ms(r,e,c,d,g),await _(),r=vc(r,e,c,d);let{processDeferDirectives:h}=await o("stx/defer",()=>import("./chunk-bb20hnqd.js"));r=h(r,e,c);let{processTeleportDirectives:x}=await o("stx/teleport",()=>import("./chunk-z6p0yxwd.js"));r=x(r,e,c);let{processTransitionDirectives:w,processTransitionAttributes:v}=await o("stx/transitions",()=>import("./chunk-1nasq00e.js"));r=w(r,e,c),r=v(r);let{processErrorBoundaryDirectives:k,stripRenderFailedMarkers:S}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=k(r,e,c),r=S(r);let{processSuspenseDirectives:M}=await o("stx/suspense",()=>import("./chunk-8pn7ah12.js"));r=M(r,e,c);let{processAsyncDirectives:A}=await o("stx/async-components",()=>import("./chunk-jbv1srnh.js"));r=A(r,e,c);let{processKeepAliveDirectives:R}=await o("stx/keep-alive",()=>import("./chunk-wegkgjmf.js"));r=R(r,e,c);let{processVirtualListDirectives:D,processVirtualGridDirectives:j,processInfiniteListDirectives:N}=await o("stx/virtual-scrolling",()=>import("./chunk-8zwwmnpb.js"));r=D(r,e,c),r=j(r,e,c),r=N(r,e,c),await _();let{processPartialHydrationDirectives:F,processStaticDirectives:I}=await o("stx/partial-hydration",()=>import("./chunk-d8djpp7f.js"));r=F(r,e,c),r=I(r);let{processComputedDirectives:L,processWatchDirectives:H}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=L(r,e,c),r=H(r,e,c);let{processFormValidationDirectives:V}=await o("stx/forms-validation",()=>import("./chunk-3wvq28hz.js"));r=V(r,e,c);let{processHeadDirective:ae,processTitleDirective:X,processMetaDirective:ce,resetHead:oe}=await o("stx/head",()=>import("./chunk-0ts3p84y.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)oe();let te=ae(r);if(r=te.content,te.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${te.headContent}
|
|
1314
|
+
`;if(r=X(r,e),r=ce(r,e,c),r=Gt(r),r=Wo(r,e),r=Tt(r),r=Wt(r),r=await us(r,e,c,d,g),r=await ms(r,e,c,d,g),await _(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=wi(r),r=ie(r,e,c),r=hs(r),await _(),e.__stxProcessingDepth===1)r=Qc(r,e);if(r=Kc(r,e,{filePath:c,buildMode:d.buildMode}),r=qo(r,e),r=Ko(r,e),r=ze(r,e),r=Pt(r,e),r=jt(r,e),r=await wt(r,e,c,d),r=await Sc(r,e,c),r=await _c(r,e,c,d),await _(),r=Cc(r,e,c,d),r=ri(r,e,c,d),r=si(r,e,c),r=oi(r,e,c,d),r=_t(r,e,c,d),r=Ws(r,e),r=qs(r),r=Xc(r),!d.skipEventDirectives)r=Lc(r,e,c);if(r=Gc(r,e,c,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await _(),d.debug){let U=/\bx-data\s*=/.test(r),q=bs(n);if(U&&q)console.warn(`[stx] ${c}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
1315
1315
|
Both work on the same page, but they manage separate scopes.
|
|
1316
|
-
Prefer signals (state/derived/effect) for new components.`)}r=
|
|
1316
|
+
Prefer signals (state/derived/effect) for new components.`)}r=mc(r,e),r=await Ei(r,e,c),await _(),r=Jc(r),r=Yc(r),r=ht(r);let{processXElementDirectives:he}=await o("stx/x-element",()=>import("./chunk-zhxdpzga.js"));r=he(r);let de=e.__originalFilePath||c,re=je(e);if(r=await Yo(r,d,de,re),await _(),r=It(r,e),r=await Kt(r,e,c,d),await _(),d.media?.image?.autoSiblings){let U=d.publicDir||"public",{rewriteImagesWithSiblings:q}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-zcpwc47w.js"));r=await q(r,{publicDir:U})}if(d.seo?.enabled)r=ii(r,e,d);let G=(U,q,Z=!0)=>{if(!q)return U;let me=q.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ne=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(U),pe=ne?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ne[0]):null;if(me&&ne&&pe){if(Z){let Ae=ne.index+pe.index;U=U.slice(0,Ae)+me[0]+U.slice(Ae+pe[0].length)}if(q=q.replace(me[0],"").trim(),!q)return U}if(/<\/head>/i.test(U))return U.replace(/<\/head>/i,`${q}
|
|
1317
1317
|
</head>`);if(/<head\b[^>]*>/i.test(U))return U.replace(/(<head\b[^>]*>)/i,`$1
|
|
1318
1318
|
${q}`);if(/<html\b[^>]*>/i.test(U))return U.replace(/(<html\b[^>]*>)/i,`$1
|
|
1319
1319
|
<head>
|
|
1320
1320
|
${q}
|
|
1321
|
-
</head>`);return U},{renderHead:ye,getHead:xe}=await o("stx/head",()=>import("./chunk-
|
|
1321
|
+
</head>`);return U},{renderHead:ye,getHead:xe}=await o("stx/head",()=>import("./chunk-0ts3p84y.js")),Le=e.__stx_runtime_head??xe();if(Le.title||Le.meta?.length||Le.link?.length){let U=ye(Le);if(U)r=G(r,U)}if(te.headContent)r=G(r,te.headContent,!Le.title);if(d.csp?.enabled&&d.csp.addMetaTag)r=$t(r,d.csp,e);if(d.analytics?.enabled)r=yt(r,d);if(d.heatmap?.enabled)r=xc(r,d);if(d.pwa?.enabled&&d.pwa.autoInject!==!1){let{injectPwaTags:U}=await o("stx/pwa/inject",()=>import("./chunk-b7vxb2y6.js"));r=U(r,d)}let _r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(r),Cr=/\bSTX\.\w+/.test(r),Tr=/window\.STX\s*=/.test(r);if(_r&&Cr&&!Tr){let q=`<script data-stx-scoped data-stx-run="once">
|
|
1322
1322
|
${ft()}
|
|
1323
1323
|
</script>`;if(r.includes("</head>")){let Z=r.indexOf("</head>"),ne=r.slice(0,Z).indexOf("<script");if(ne!==-1){let pe=r.slice(0,ne),Ae=r.slice(ne);r=pe+q+`
|
|
1324
1324
|
`+Ae}else r=r.replace("</head>",`${q}
|
|
1325
1325
|
</head>`)}else if(r.includes("<body"))r=r.replace(/<body([^>]*)>/,`<body$1>
|
|
1326
1326
|
${q}`);else r=q+`
|
|
1327
|
-
`+r}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-
|
|
1328
|
-
`+r.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!ve(r)&&
|
|
1329
|
-
export{vt,Pe,
|
|
1327
|
+
`+r}{let{scanScriptTags:U}=await o("stx/signal-processing",()=>import("./chunk-nj9n0en9.js")),q=[];for(let Z of U(r)){if(!/\bserver\b/i.test(Z.attrs))continue;let me=Z.start+Z.fullMatch.indexOf(">")+1,ne=Sr(r,me);if(ne===-1)continue;let pe=ne+9;while(pe<r.length&&/\s/.test(r[pe]))pe++;q.push({start:Z.start,end:pe})}if(q.length>0){let Z=Array(q.length+1),me=0;for(let ne=0;ne<q.length;ne++){let{start:pe,end:Ae}=q[ne];Z[ne]=r.slice(me,pe),me=Ae}Z[q.length]=r.slice(me),r=Z.join("")}}let ut=Vs(r,c);if(ut.hasScoped)r=ut.html;let Ar=e.__stx_event_bindings||[],Ge=!1,dt=[],Rr=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Mr}=await o("stx/signal-processing",()=>import("./chunk-nj9n0en9.js"));for(let U of Mr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))dt.push({match:U.fullMatch,attrs:U.attrs,content:U.body});for(let{match:U,attrs:q,content:Z}of dt){Ge=!0;let me=Z;Me(Z,c,a.strict,e.__originalFilePath);let ne=await Be(Z,{eventBindings:Ar,attrs:q,hasColonDirectives:Rr,templateContent:n,filePath:c,projectRoot:process.cwd(),production:Mi(a.buildMode,a.minifyClient),serverData:re});r=r.replace(U,()=>ne)}if(Ge)e.__stx_event_bindings=[];if(!Ge&&e.__stxProcessingDepth===1){let U=e.__stx_event_bindings||[];if(U.length>0){let q=pi(U);if(q){let Z=r.lastIndexOf("</body>");r=Z===-1?r+q:r.slice(0,Z)+q+`
|
|
1328
|
+
`+r.slice(Z)}e.__stx_event_bindings=[]}}if(!d.skipSignalsRuntime&&!ve(r)&&yc(r))r=await pr(r,d);if(r=bc(r),d.csp?.enabled&&d.csp.useNonce&&typeof e.cspNonce==="string")r=Et(r,e.cspNonce);return r}
|
|
1329
|
+
export{vt,Pe,dc,ls,jo,Bo,or,i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Kh,ys,Go,bs,ur,Xo,Jo,Kf,ws,vs,xs,Yo,hc,Gf,St}from"./chunk-8623gte8.js";import"./chunk-s322kcw7.js";import"./chunk-wd4z5w4d.js";import"./chunk-1347hwt5.js";import"./chunk-tk67pqaf.js";import"./chunk-e763qsg0.js";import"./chunk-kedgfk9z.js";import"./chunk-pa8xkctc.js";import"./chunk-jwwsxym6.js";import{V}from"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{Kf as bindLoopInterpolations,Kh as clearScriptScanCache,ws as convertServerLoopAttributesToDirectives,Xo as convertSignalDirectivesToAttributes,vs as convertSignalLoopsToAttributes,ur as extractClientSignalNames,V as extractExports,hc as findMarkupIndexOutsideScripts,bs as hasSignalsSyntax,Go as parseLoopExpression,Jo as preEvalLiteralReactiveIfs,xs as processScriptSetup,Yo as processSignals,Gf as rewriteStxImportSpecifiers,ys as scanScriptTags,St as stripStxRuntimeImports};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rt}from"./chunk-
|
|
2
|
+
import{rt}from"./chunk-jwwsxym6.js";import{wt,qn}from"./chunk-kq3h2rjq.js";import{Ir,Or,Nr,Dr,Ee}from"./chunk-0z2gqttt.js";import{Le,yn,al,cl}from"./chunk-jdqmk5sv.js";import{M}from"./chunk-sny8rqe8.js";import{Ti}from"./chunk-qv52et0d.js";import{b}from"./chunk-6qbha6fb.js";import{i}from"./chunk-mzg1wq86.js";import{F,a}from"./chunk-1347hwt5.js";import{Pc}from"./chunk-kedgfk9z.js";import{Nn,Mn,Ke,$e,ha,ya,Dn}from"./chunk-cqkr291c.js";import{un,Mo}from"./chunk-qvwzaxdd.js";import{Ln}from"./chunk-12r22pf0.js";import{nn,tr,nr}from"./chunk-q87hkwfg.js";import{X}from"./chunk-s322kcw7.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function W(n){return Q("sha256").update(n).digest("hex").slice(0,8)}function J(n=!1){let l=n?qn():wt(),o=W(l);return{content:l,filename:`runtime.${o}.js`,hash:o}}function U(){let n=rt(),l=W(n);return{content:n,filename:`router.${l}.js`,hash:l}}import V from"path";import{createHash as ee}from"crypto";function te(n={}){let l=new Set;return{context:new Proxy(n,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function q(n,l,o={}){let r=V.resolve(n),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);al();let _={};try{_=await a(o.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>Le(R))),{context:D}=te({__filename:r,__dirname:V.dirname(r),__stx_serverDeclared:u}),A=new Set,T={...F,..._,...o,buildMode:"compile",strict:!1},f=await i(e,D,r,T,A),w=Nn(f)+Mn(f)+Ke(f),j=cl();return{route:l,sourceFile:n,html:f,fragment:w,placeholders:j,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(A),contentHash:S,status:yn(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(n,l){let o=0,r=0;if(!m.existsSync(n))return{copied:o,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),o++,r+=m.statSync(u).size}}}return e(n,l),{copied:o,bytes:r}}async function gm(n={}){let l=Date.now(),o=c.resolve(n.root||process.cwd()),r=c.resolve(o,n.outputDir||".output");console.log("[stx build] Starting production build...");let e=await a(o),S=c.resolve(o,n.componentsDir??e.componentsDir??"components"),_=c.resolve(o,n.partialsDir??e.partialsDir??"partials"),y=c.resolve(o,n.layoutsDir??e.layoutsDir??"layouts"),d=n.publicDir??e.publicDir??"public",g=Ee(e.app?.head,{known:Dr,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",A=n.routeRules??e.routeRules??{},T=Ln(A),f=n.serverApi??e.serverApi,w=typeof f==="object"?f:{};if(f)un(o,w);if(e.runtimeConfig)M(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let j=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of j)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=X(o,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],P=R.filter((s)=>!Y.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${P.length} page routes (${R.length-P.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=J(n.debug),x=U();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let B=[],H=[];for(let s of P){let h=T(s.pattern),O=h.rendering==="prerender";if(O&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await q(s.filePath,s.pattern,{configDir:o,componentsDir:S,partialsDir:_,layoutsDir:y,debug:n.debug});if(B.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=Nr(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=Ir(t.html,u);if(g.htmlAttrs)t.html=Or(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let I=p[1];t.html=t.html.replace(" "+I,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${I}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await b(t.html),O){let p=await Dn(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=$e(t.html,D,!0);let L=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),z=c.join("server","pages",`${L}.compiled.json`),G=c.join("server","fragments",`${L}.html`);await Bun.write(c.join(r,z),JSON.stringify(t,null,2)),await Bun.write(c.join(r,G),t.fragment),H.push({pattern:s.pattern,compiledPath:z,fragmentPath:G,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:O}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let k=c.resolve(o,d);if(m.existsSync(k)){let{copied:s,bytes:h}=Z(k,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let E=nr(o);if(E){let{copied:s,bytes:h}=Z(E,c.join(r,"public",tr));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${nn}/`)}let N={runtime:v.filename,router:x.filename},C=ha(H,N,r);if(C.routeRules=A,C.routerContainer=D,f)C.apiRoutes=await Mo(o,r,w);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Ti(o,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Pc(e._layerGraph),null,2));ya(C,r);let K=Date.now()-l;return console.log(`
|
|
3
3
|
[stx build] Done in ${K}ms \u2014 ${B.length} pages compiled`),{pageCount:B.length,assets:N,outputDir:r,duration:K}}
|
|
4
|
-
export{
|
|
4
|
+
export{gm};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,l,Ht,Vt,Ut,Ue,ct,D,Qs,Mr,We}from"./chunk-
|
|
2
|
+
import{t,l,Ht,Vt,Ut,Ue,ct,D,Qs,Mr,We}from"./chunk-0z2gqttt.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function _(e,r){return(n)=>D(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${c(e.property)}" content="${c(e.content)}">`:`<meta name="${c(e.name)}" content="${c(e.content)}">`}function ri(e,r,n,g){if(!e.includes("@meta"))return e;let i=Ht(e,I,(a,o)=>{let s=Mr(Vt(a),r);if(s.kind==="tag")return j(s.tag);if(s.kind==="empty")return"";return D("Meta",o,s.message,n,s.code)},_("Meta",n));return i=Ht(i,C,(a,o)=>{let s=Ut(a,r);if(!s.ok)return D("MetaTag",o,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";if(!ct(s.value))return D("MetaTag",o,`expected an object such as { name, content }, got ${Ue(s.value)}`,n,t.TYPE_ERROR);let u=s.value;if(!u.name&&!u.property&&!u.httpEquiv)return D("MetaTag",o,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${c(u.name)}"`;if(u.property)p+=` property="${c(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${c(u.httpEquiv)}"`;return p+=` content="${c(u.content)}">`,p},_("MetaTag",n)),i}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(ct(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(ct))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function si(e,r,n){if(!e.includes("@structuredData"))return e;return Ht(e,k,(g,i)=>{let a=Ut(g,r);if(!a.ok)return D("StructuredData",i,a.message,n,a.code);if(a.value===void 0||a.value===null)return"";let o=v(a.value);if(!o)return D("StructuredData",i,`expected an object or an array of objects, got ${Ue(a.value)}`,n,t.TYPE_ERROR);try{return A(o)}catch(s){let u=s instanceof Error?s.message:String(s);return D("StructuredData",i,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},_("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function oi(e,r,n,g){if(!e.includes("@seo"))return e;return Ht(e,N,(i,a)=>{if(!i.trim())return D("SEO",a,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let o=Ut(i,r);if(!o.ok)return D("SEO",a,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!ct(o.value))return D("SEO",a,`expected an object such as { title, description }, got ${Ue(o.value)}`,n,t.TYPE_ERROR);try{return q(o.value,a,n)}catch(s){let u=s instanceof Error?s.message:String(s);return D("SEO",a,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},_("SEO",n))}function b(e,r,n,g){let i=e[r];if(i===void 0||i===null||i===!1)return;if(ct(i))return i;Qs(n,`${r} must be an object, got ${Ue(i)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((s)=>!L.has(s));if(g.length>0){let s=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");Qs(r,`@seo does not read ${s}; ${g.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${c(e.title)}</title>
|
|
3
3
|
`,i+=`<meta name="title" content="${c(e.title)}">
|
|
4
4
|
`;if(e.description)i+=`<meta name="description" content="${c(e.description)}">
|
|
5
5
|
`;if(e.keywords){let s=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${c(s)}">
|
|
@@ -43,7 +43,7 @@ import{t,l,Ht,Vt,Ut,Ue,ct,D,Qs,Mr,We}from"./chunk-0d3z8hwz.js";var I=/(?<![\w$@]
|
|
|
43
43
|
${y}
|
|
44
44
|
`),h;return h.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${y}
|
|
46
|
-
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function c(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var $s={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=Mr(r,n??{});if(i.kind==="error")return D("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=We(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Rs={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return l("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return l("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(i)}catch(i){let a=i instanceof Error?i.message:String(i);return l("StructuredData",a,t.EVALUATION_ERROR)}},hasEndTag:!0};function
|
|
46
|
+
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function c(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var $s={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let i=Mr(r,n??{});if(i.kind==="error")return D("Meta",`@meta(${r.join(", ")})`,i.message,g,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=We(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Rs={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return l("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return l("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(i)}catch(i){let a=i instanceof Error?i.message:String(i);return l("StructuredData",a,t.EVALUATION_ERROR)}},hasEndTag:!0};function ry(){return[$s,Rs]}function sy(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:i=0.5,includeLastmod:a=!0}=r,o=n.replace(/\/$/,""),s=(m)=>m.startsWith("http")?m:`${o}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=s(m.loc),f=m.lastmod||(a?new Date().toISOString().split("T")[0]:void 0),E=m.changefreq||g,y=m.priority??i,h=` <url>
|
|
47
47
|
<loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
|
|
48
48
|
<xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(s(w.href))}"/>`;if(f)h+=`
|
|
49
49
|
<lastmod>${f}</lastmod>`;return h+=`
|
|
@@ -53,13 +53,13 @@ ${y}
|
|
|
53
53
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
|
|
54
54
|
${u.join(`
|
|
55
55
|
`)}
|
|
56
|
-
</urlset>`}function
|
|
56
|
+
</urlset>`}function oy(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
57
57
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
58
58
|
${e.map((a)=>{let o=a.startsWith("http")?a:`${n}${a.startsWith("/")?"":"/"}${a}`;return` <sitemap>
|
|
59
59
|
<loc>${T(o)}</loc>
|
|
60
60
|
<lastmod>${g}</lastmod>
|
|
61
61
|
</sitemap>`}).join(`
|
|
62
62
|
`)}
|
|
63
|
-
</sitemapindex>`}async function
|
|
64
|
-
`).trim()}function
|
|
65
|
-
export{ri,si,oi,ii,$s,Rs,
|
|
63
|
+
</sitemapindex>`}async function iy(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],a=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,o=new Bun.Glob(`**/${a}`);for await(let s of o.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return s.includes(f.slice(1));return s.startsWith(f)||s.includes(`/${f}`)}))continue;let p=s.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${s}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return i.sort((s,u)=>s.loc.localeCompare(u.loc)),i}function As(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
64
|
+
`).trim()}function ay(e){return As({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
65
|
+
export{ri,si,oi,ii,$s,Rs,ry,sy,oy,iy,As,ay};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{F,Zf,ei,kc,a,O,ty,ny}from"./chunk-1347hwt5.js";import"./chunk-tk67pqaf.js";import"./chunk-e763qsg0.js";import"./chunk-kedgfk9z.js";import"./chunk-pa8xkctc.js";import"./chunk-jwwsxym6.js";import"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{O as config,F as defaultConfig,ty as defineStxConfig,ei as discoverConfig,a as loadStxConfig,kc as resolveInstalledPackage,Zf as resolveStxDirectories,ny as validateConfig};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{or,i}from"./chunk-mzg1wq86.js";import"./chunk-6qbha6fb.js";import"./chunk-rq9pqd4s.js";import"./chunk-t5q31st4.js";import"./chunk-71s4hpkj.js";import"./chunk-75e4wzzs.js";import"./chunk-mxazxwc4.js";import"./chunk-me16tftr.js";import"./chunk-8623gte8.js";import{xe}from"./chunk-s322kcw7.js";import"./chunk-wd4z5w4d.js";import"./chunk-jtag68hg.js";import"./chunk-1347hwt5.js";import"./chunk-tk67pqaf.js";import"./chunk-e763qsg0.js";import"./chunk-kedgfk9z.js";import"./chunk-pa8xkctc.js";import"./chunk-jwwsxym6.js";import{Me,Ws,qs}from"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{or as buildModulesTag,xe as injectRouterScript,i as processDirectives,Ws as processJsonDirective,qs as processOnceDirective,Me as validateClientScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rs,ss}from"./chunk-
|
|
2
|
+
import{rs,ss}from"./chunk-fxk1psd8.js";import{y}from"./chunk-jdqmk5sv.js";import{a}from"./chunk-1347hwt5.js";import{Xe,oe}from"./chunk-3zjyhhg4.js";import{nc}from"./chunk-afrqm7w5.js";import{B}from"./chunk-pb09xy77.js";import{h}from"./chunk-kgrvvtcy.js";import{existsSync as z,mkdirSync as S,copyFileSync as P,chmodSync as I,rmSync as ve}from"fs";import{join as c,basename as xe,resolve as X}from"path";import{spawn as _}from"child_process";import{platform as ye}from"os";function O(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=y(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var Su=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -468,7 +468,7 @@ else if (data.type === 'event' && data.method) {
|
|
|
468
468
|
}
|
|
469
469
|
})();
|
|
470
470
|
</script>
|
|
471
|
-
`;function $a(e={}){let{debug:r=!1,timeout:i=30000}=e;return
|
|
471
|
+
`;function $a(e={}){let{debug:r=!1,timeout:i=30000}=e;return Su.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function Ah(){return!1}function Ph(e,r={}){let i=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(i,(n,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return $a(t)})}function Ra(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=$a(r),n=O(e,"head",`${i}
|
|
472
472
|
`);if(n!==null)return n;let s=B(e);if(s){let t=s.index+s.tag.length;return e.slice(0,t)+`
|
|
473
473
|
${i}`+e.slice(t)}return i+e}var To={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,r)=>{let i=e.checked?"checked":"",n=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
|
|
474
474
|
<input type="checkbox" class="craft-checkbox" ${i} ${n}>
|
|
@@ -1029,7 +1029,7 @@ ${i}`+e.slice(t)}return i+e}var To={button:{nativeType:"craft-button",fallbackTa
|
|
|
1029
1029
|
${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${x(e.icon)}"${i}></span>`:""}
|
|
1030
1030
|
<span class="craft-sidebar-item-label">${T(e.label)}</span>
|
|
1031
1031
|
${e.badge?`<span class="craft-sidebar-item-badge">${T(e.badge)}</span>`:""}
|
|
1032
|
-
</button>`}function R(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function fe(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function x(e){return T(e).replace(/`/g,"`")}function pe(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ue(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,""");n.push(`${s}="${o}"`)}return n.join(" ")}function
|
|
1032
|
+
</button>`}function R(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function fe(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function T(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function x(e){return T(e).replace(/`/g,"`")}function pe(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function ue(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,""");n.push(`${s}="${o}"`)}return n.join(" ")}function Ih(e,r){To[e]=r}function Oh(){return{...To}}import{chmodSync as be,copyFileSync as ge,mkdtempSync as V,rmSync as me,writeFileSync as J}from"fs";import{tmpdir as W}from"os";import{join as D}from"path";function we(e){let r=Bun.spawnSync(["/usr/bin/plutil","-extract","Entitlements","xml1","-o","-","-"],{stdin:e});if(r.exitCode!==0)throw Error(`Could not extract the macOS profile entitlements: ${r.stderr.toString().trim()||r.stdout.toString().trim()}`);let i=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-","-"],{stdin:r.stdout});if(i.exitCode!==0)throw Error(`Could not convert the macOS profile entitlements: ${i.stderr.toString().trim()||i.stdout.toString().trim()}`);let n=JSON.parse(i.stdout.toString());if(!n||typeof n!=="object"||Array.isArray(n))throw Error("The macOS profile entitlements must be a dictionary.");return n}function he(e,r){let i=D(r,"Contents","embedded.provisionprofile");ge(e,i),be(i,420)}async function Q(e,r=[],i={}){if(process.platform!=="darwin")return;let n=i.entitlements,s;try{if(i.provisioningProfile){if(!i.identity||i.identity==="-")throw Error("A provisioning profile requires a signing identity.");let p=Bun.spawnSync(["/usr/bin/security","cms","-D","-i",i.provisioningProfile]);if(p.exitCode!==0)throw Error("Could not decode the macOS provisioning profile.");let l=we(p.stdout),u={};if(i.entitlements){let b=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",i.entitlements]);if(b.exitCode!==0)throw Error("Could not read the app entitlements plist.");u=JSON.parse(b.stdout.toString())}for(let b of["com.apple.application-identifier","com.apple.developer.team-identifier"])if(l[b])u[b]=l[b];if(s=V(D(W(),"stx-entitlements-")),n=D(s,"entitlements.plist"),J(n,JSON.stringify(u)),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",n]).exitCode!==0)throw Error("Could not generate the provisioned app entitlements.");he(i.provisioningProfile,e)}let t;if(r.length){let p=!1;if(n){let l=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",n]);if(l.exitCode!==0)throw Error("Could not read native parent entitlements.");p=JSON.parse(l.stdout.toString())["com.apple.security.app-sandbox"]===!0}if(s??=V(D(W(),"stx-entitlements-")),t=D(s,"helper.entitlements.plist"),J(t,JSON.stringify({"com.apple.security.cs.allow-jit":!0,...p?{"com.apple.security.app-sandbox":!0,"com.apple.security.inherit":!0}:{}})),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",t]).exitCode!==0)throw Error("Could not generate native helper entitlements.")}for(let p of[...r,e]){let l=i.hardenedRuntime?["--options","runtime"]:[];if(p===e&&n)l.push("--entitlements",n);if(p!==e&&t)l.push("--entitlements",t);let u=i.identity&&i.identity!=="-"?"--timestamp":"--timestamp=none",b=Bun.spawn(["/usr/bin/codesign","--force","--sign",i.identity||"-",u,...l,p],{stdout:"pipe",stderr:"pipe"}),[g,v]=await Promise.all([new Response(b.stderr).text(),b.exited]);if(v!==0)throw Error(`Could not sign native bundle ${p}: ${g.trim()}`)}let o=Bun.spawn(["/usr/bin/codesign","--verify","--strict",e],{stdout:"pipe",stderr:"pipe"}),[d,f]=await Promise.all([new Response(o.stderr).text(),o.exited]);if(f!==0)throw Error(`Invalid native bundle signature: ${d.trim()}`)}finally{if(s)me(s,{recursive:!0,force:!0})}}var Y=(e)=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function G(e){let r=new Set,i=(n,s,t)=>{if(typeof n==="string")return`${s}<string>${Y(n)}</string>`;if(typeof n==="boolean")return`${s}<${n}/>`;if(typeof n==="number"){if(!Number.isFinite(n))throw TypeError(`Non-finite Info.plist number at ${t}`);let o=Number.isSafeInteger(n)?"integer":"real";return`${s}<${o}>${n}</${o}>`}if(n!==null&&typeof n==="object"){let o=Array.isArray(n);if(!o&&Object.getPrototypeOf(n)!==Object.prototype&&Object.getPrototypeOf(n)!==null)throw TypeError(`Unsupported Info.plist value at ${t}`);if(r.has(n))throw TypeError(`Cyclic Info.plist value at ${t}`);r.add(n);try{let d=o?"array":"dict",f=`${s} `,p=o?Array.from(n,(l,u)=>i(l,f,`${t}[${u}]`)):Object.entries(n).map(([l,u])=>`${f}<key>${Y(l)}</key>
|
|
1033
1033
|
${i(u,f,`${t}.${l}`)}`);return p.length?`${s}<${d}>
|
|
1034
1034
|
${p.join(`
|
|
1035
1035
|
`)}
|
|
@@ -1097,5 +1097,5 @@ Exec=${i.toLowerCase()}
|
|
|
1097
1097
|
Terminal=false
|
|
1098
1098
|
Categories=Utility;
|
|
1099
1099
|
Icon=${i.toLowerCase()}
|
|
1100
|
-
`;h("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),g);let v=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(h("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),v),n.icon&&z(n.icon))P(n.icon,c(o,`${i.toLowerCase()}.png`));let k=_("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});k.on("close",(w)=>{if(oe(t),w===0)I(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${w}. Install from https://appimage.github.io/appimagetool/`})}),k.on("error",(w)=>{oe(t),s({success:!1,error:`appimagetool not found: ${w.message}`})})}catch(o){oe(t),s({success:!1,error:o.message})}})}function Na(){return[q()]}function Ma(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var qe={buildNative:Ia,getAvailableTargets:Na,getAvailableFormats:Ma,detectPlatform:q},
|
|
1101
|
-
export{
|
|
1100
|
+
`;h("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),g);let v=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(h("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),v),n.icon&&z(n.icon))P(n.icon,c(o,`${i.toLowerCase()}.png`));let k=_("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});k.on("close",(w)=>{if(oe(t),w===0)I(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${w}. Install from https://appimage.github.io/appimagetool/`})}),k.on("error",(w)=>{oe(t),s({success:!1,error:`appimagetool not found: ${w.message}`})})}catch(o){oe(t),s({success:!1,error:o.message})}})}function Na(){return[q()]}function Ma(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var qe={buildNative:Ia,getAvailableTargets:Na,getAvailableFormats:Ma,detectPlatform:q},Nh=qe;
|
|
1101
|
+
export{Su,$a,Ah,Ph,Ra,To,ns,Aa,Pa,Ih,Oh,Ia,Oa,Na,Ma,Nh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Cn,M}from"./chunk-sny8rqe8.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-
|
|
2
|
+
import{Cn,M}from"./chunk-sny8rqe8.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-pn0rmd8d.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??{})} }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{pe}from"./chunk-
|
|
2
|
+
import{pe}from"./chunk-jwwsxym6.js";import{Ve,M}from"./chunk-sny8rqe8.js";import{Rc}from"./chunk-kedgfk9z.js";import{c}from"./chunk-ksxbfyef.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 un(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}=pe(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
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=un(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,...pe(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
|
|
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{un,No,Mo,Do,
|
|
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,...pe(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 Lh(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=un(s,o);return await No(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=un(s,o);await No(s,t);let{loadStxConfig:e}=await import("./chunk-pn0rmd8d.js"),a=M((await e(s)).runtimeConfig);return await Ve(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(Rc(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{un,No,Mo,Do,Lh,Lo};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fi,zi,Hi,Vg,Ug,Wg,Il,qg,Kg}from"./chunk-smve11g0.js";export{Fi as ImageProcessorCache,Il as applyTransformations,Vg as clearImageCache,qg as generateResponsiveVariants,Kg as generateSrcset,zi as getCachedImageResult,Wg as optimizeImage,Ug as processImage,Hi as setCachedImageResult};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Se,Gs,Tg,uy,$g,dy,Sn,p,W,Q,kn,_e,Rg,Ci,Ag,py,E,Ei,Pg,fy,A,gy}from"./chunk-jdqmk5sv.js";import"./chunk-qv52et0d.js";import"./chunk-sny8rqe8.js";import"./chunk-0z2gqttt.js";import"./chunk-xppm4cs4.js";import"./chunk-7fgfzaah.js";export{Pg as applyFilters,dy as clearCustomFilters,Rg as clientLoopScopes,Gs as defaultFilters,kn as escapeAttributeValue,p as escapeHtml,W as escapeHtmlValue,Q as escapeInterpolatedHtmlValue,A as evaluateExpression,Se as findMustacheEnd,$g as getAllFilters,Ag as interpolateScriptAttributes,Ci as interpolateScriptExpressions,py as interpolateScriptsInTemplate,E as processExpressions,Ei as processExpressionsChunked,Tg as registerFilter,uy as registerFilters,Sn as replaceInterpolations,fy as resetRejectedExpressionWarnings,gy as unescapeHtml,_e as usesSignalsInScript};
|