@stacksjs/stx 0.2.873 → 0.2.875
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-003ph86a.js +2 -0
- package/dist/chunk-027meh1k.js +2 -0
- package/dist/chunk-0bc3mwqd.js +2 -0
- package/dist/{chunk-gbtbfg7e.js → chunk-0g2mg8cw.js} +3 -3
- package/dist/chunk-0gv2mmr0.js +2 -0
- package/dist/{chunk-e631k202.js → chunk-0h6r7nvn.js} +38 -38
- package/dist/chunk-0j8zre1m.js +2 -0
- package/dist/{chunk-rb71xcfw.js → chunk-0qwbhv3f.js} +9 -9
- package/dist/{chunk-6mkn81pd.js → chunk-0sa9gqmc.js} +7 -7
- package/dist/chunk-1gfg6qmr.js +2 -0
- package/dist/{chunk-6ftee542.js → chunk-1q5w3xav.js} +2 -2
- package/dist/chunk-1tqp2s13.js +2 -0
- package/dist/chunk-1y7kfp5d.js +2 -0
- package/dist/chunk-1ztp5vkh.js +3 -0
- package/dist/chunk-24e4dapm.js +2 -0
- package/dist/{chunk-zktbzwkv.js → chunk-2qb9kp21.js} +3 -3
- package/dist/{chunk-01mwbg1r.js → chunk-2zaatnnh.js} +4 -4
- package/dist/chunk-32wvc376.js +2 -0
- package/dist/{chunk-h3j2zvms.js → chunk-3f9wctns.js} +2 -2
- package/dist/{chunk-v4xes880.js → chunk-3mz9bdf7.js} +3 -3
- package/dist/chunk-3te2y9qf.js +2 -0
- package/dist/{chunk-farh4p7f.js → chunk-3w7gacva.js} +2 -2
- package/dist/chunk-447jc6zc.js +2 -0
- package/dist/{chunk-s584xnzx.js → chunk-4517hny7.js} +2 -2
- package/dist/chunk-45rzd16g.js +1609 -0
- package/dist/{chunk-2drcj9wn.js → chunk-4m11kcxz.js} +8 -8
- package/dist/chunk-51ymssz5.js +2 -0
- package/dist/{chunk-xpzt4wwb.js → chunk-644ckv6e.js} +10 -10
- package/dist/{chunk-xr1yrdxy.js → chunk-6az66mrc.js} +14 -14
- package/dist/chunk-6dz5za5z.js +2 -0
- package/dist/{chunk-f30bpj7a.js → chunk-6ezt9kbe.js} +11 -11
- package/dist/chunk-6grkdknk.js +2 -0
- package/dist/chunk-6q9a5bph.js +2 -0
- package/dist/chunk-6rqef7wp.js +2 -0
- package/dist/{chunk-w3d7pwzg.js → chunk-6ykfy7eh.js} +2 -2
- package/dist/{chunk-vvddndcm.js → chunk-72p5annm.js} +4 -4
- package/dist/chunk-74x6j229.js +4 -0
- package/dist/{chunk-n3jw3xpj.js → chunk-75v0yxeh.js} +2 -2
- package/dist/chunk-7j11vgm1.js +3 -0
- package/dist/chunk-7ngfcdv9.js +2 -0
- package/dist/chunk-7njy024g.js +2 -0
- package/dist/{chunk-0489wcvq.js → chunk-88xayf21.js} +9 -9
- package/dist/{chunk-wa4w5bcn.js → chunk-95hbmv7k.js} +7 -7
- package/dist/{chunk-nack2xs5.js → chunk-976kgb3r.js} +5 -5
- package/dist/{chunk-mxdapaz2.js → chunk-9anqwafq.js} +3 -3
- package/dist/chunk-9e3ggwk7.js +2 -0
- package/dist/chunk-9mz2n39m.js +2 -0
- package/dist/chunk-a262spx7.js +2 -0
- package/dist/{chunk-j7q17ws8.js → chunk-a5yb8w7s.js} +3 -3
- package/dist/chunk-a8wn0snv.js +2 -0
- package/dist/{chunk-55zq2ha8.js → chunk-ae8q4gze.js} +5 -5
- package/dist/{chunk-hq0zqaqc.js → chunk-af6m1s2b.js} +1 -1
- package/dist/{chunk-hev4t4d5.js → chunk-afxfkb60.js} +6 -6
- package/dist/{chunk-aed45njs.js → chunk-az5rh7fs.js} +2 -2
- package/dist/chunk-b1tcym2x.js +2 -0
- package/dist/{chunk-j1efsjsb.js → chunk-b4d4tjvx.js} +5 -5
- package/dist/{chunk-hq4d1me0.js → chunk-b61dq7pz.js} +1 -1
- package/dist/{chunk-j89p53vx.js → chunk-bdh73gxd.js} +2 -2
- package/dist/{chunk-4068rmzv.js → chunk-bjjfr7qt.js} +2 -2
- package/dist/chunk-bs7g6jtt.js +2 -0
- package/dist/chunk-bspj1rf1.js +2 -0
- package/dist/chunk-bx3hpsxn.js +2 -0
- package/dist/chunk-byq488g4.js +2 -0
- package/dist/chunk-c8pzj57b.js +2 -0
- package/dist/{chunk-eq3mqbcn.js → chunk-cmh0bfkb.js} +5 -5
- package/dist/{chunk-7j0qkye5.js → chunk-d3q0cg47.js} +2 -2
- package/dist/{chunk-b666d8m6.js → chunk-d6gqh2wv.js} +1 -1
- package/dist/{chunk-vvxcebpn.js → chunk-dbvsa5ya.js} +2 -2
- package/dist/{chunk-b53rzbrh.js → chunk-dw0ttj6p.js} +2 -2
- package/dist/chunk-e2b2f502.js +2 -0
- package/dist/chunk-ec6mrad6.js +2 -0
- package/dist/chunk-eh2gec79.js +2 -0
- package/dist/{chunk-8hhhmscy.js → chunk-eknm4jrm.js} +2 -2
- package/dist/chunk-em31p5pb.js +2 -0
- package/dist/chunk-eqfsw6x4.js +2 -0
- package/dist/{chunk-4nb7egk0.js → chunk-esjr9qhe.js} +2 -2
- package/dist/chunk-ey1vwfpc.js +24 -0
- package/dist/{chunk-wk2rge05.js → chunk-f4vgagjb.js} +3 -3
- package/dist/chunk-fa57bncd.js +2 -0
- package/dist/{chunk-qjey0jk6.js → chunk-fdjx4vs3.js} +2 -2
- package/dist/chunk-fk79jbzn.js +2 -0
- package/dist/{chunk-8xjj7wjf.js → chunk-fnjm3xbf.js} +6 -6
- package/dist/{chunk-zfrzdje6.js → chunk-ft6em3wm.js} +6 -6
- package/dist/{chunk-w4a3fqf4.js → chunk-fy6ts0n4.js} +2 -2
- package/dist/{chunk-ct90b523.js → chunk-g33ycxe3.js} +5 -5
- package/dist/{chunk-scsmp2e5.js → chunk-g7qpnmbm.js} +14 -14
- package/dist/chunk-g97krv0d.js +2 -0
- package/dist/chunk-gn16yq49.js +2 -0
- package/dist/{chunk-qcxrcypb.js → chunk-gqtb53s8.js} +2 -2
- package/dist/chunk-gvs61tqn.js +2 -0
- package/dist/chunk-h2928108.js +2 -0
- package/dist/chunk-hd5bny2c.js +2 -0
- package/dist/chunk-j1ytbd6r.js +1184 -0
- package/dist/chunk-jm7qa3v3.js +2 -0
- package/dist/chunk-jmjgj3nh.js +2 -0
- package/dist/chunk-jqtpzzz4.js +12 -0
- package/dist/{chunk-hmdkf6c6.js → chunk-jqxerj6k.js} +2 -2
- package/dist/{chunk-3z1mmar2.js → chunk-jt5tzddc.js} +2 -2
- package/dist/{chunk-q50x1gfd.js → chunk-k1ew643q.js} +2 -2
- package/dist/chunk-kq8mffgf.js +2 -0
- package/dist/chunk-kx06jzdw.js +2 -0
- package/dist/{chunk-ysfeg3cn.js → chunk-kywe0f1v.js} +2 -2
- package/dist/{chunk-60yppcbb.js → chunk-kzc2tqzr.js} +2 -2
- package/dist/{chunk-9zrvh3pz.js → chunk-mce3g2wb.js} +2 -2
- package/dist/{chunk-bbq79tap.js → chunk-mw0rb1sf.js} +4 -4
- package/dist/chunk-n344ss97.js +2 -0
- package/dist/chunk-n5pvdrkb.js +2 -0
- package/dist/chunk-ne8q191s.js +2 -0
- package/dist/{chunk-e7s109j6.js → chunk-nnp6rf4c.js} +1 -1
- package/dist/chunk-np8wgbsa.js +3 -0
- package/dist/{chunk-tyvm49be.js → chunk-nv4c25zj.js} +3 -3
- package/dist/{chunk-tny8mz6q.js → chunk-p4e8myzj.js} +6 -6
- package/dist/{chunk-dhbpbjt3.js → chunk-p5m1z6e1.js} +6 -6
- package/dist/{chunk-18a3vdnq.js → chunk-pk714ynv.js} +4 -4
- package/dist/{chunk-csymxc5a.js → chunk-pp99rmjm.js} +15 -15
- package/dist/chunk-pqmjeea6.js +2 -0
- package/dist/chunk-q0k2gmva.js +2 -0
- package/dist/{chunk-e5xfbcp7.js → chunk-q7zc78az.js} +6 -6
- package/dist/chunk-qggwr60r.js +2 -0
- package/dist/chunk-qm3v4qb7.js +2 -0
- package/dist/{chunk-40h07m5w.js → chunk-qnwd5bz4.js} +1 -1
- package/dist/chunk-qrn1nza9.js +2 -0
- package/dist/chunk-qty0t69x.js +2 -0
- package/dist/{chunk-696cdgkg.js → chunk-qvrew79n.js} +1 -1
- package/dist/{chunk-tnp2ta5q.js → chunk-r09kz9bf.js} +2 -2
- package/dist/{chunk-q1wxgw5s.js → chunk-r2bxjna3.js} +2 -2
- package/dist/chunk-rzadf7vx.js +20 -0
- package/dist/{chunk-6vgr5g6d.js → chunk-rzd9hyhv.js} +2 -2
- package/dist/{chunk-8tk8yf91.js → chunk-s7fhpkvf.js} +6 -6
- package/dist/{chunk-ew5cey88.js → chunk-saqzk45g.js} +1 -1
- package/dist/{chunk-srgnevws.js → chunk-stn7p7f1.js} +2 -2
- package/dist/{chunk-xvj6yf0q.js → chunk-t4g3ka8c.js} +6 -6
- package/dist/chunk-ts37jw3s.js +2 -0
- package/dist/{chunk-cqhwzd9y.js → chunk-v0tdg16k.js} +5 -5
- package/dist/{chunk-j7f3h982.js → chunk-vmssv78v.js} +3 -3
- package/dist/{chunk-ymdw4fhd.js → chunk-vnrbjbrw.js} +2 -2
- package/dist/{chunk-gynvaceg.js → chunk-vznf808n.js} +5 -5
- package/dist/chunk-wkb7dhp7.js +2 -0
- package/dist/{chunk-m131znxe.js → chunk-wm029dh0.js} +13 -13
- package/dist/{chunk-hhbt8grm.js → chunk-wp0qpa50.js} +4 -4
- package/dist/chunk-wxyqp6g9.js +2 -0
- package/dist/{chunk-01c16zw4.js → chunk-wzvdr4ta.js} +2 -2
- package/dist/{chunk-e2t7mk29.js → chunk-x2ftkaz3.js} +2 -2
- package/dist/chunk-x76qvq1n.js +2 -0
- package/dist/{chunk-v37zmez0.js → chunk-xmws1gaf.js} +2 -2
- package/dist/{chunk-a8164hnf.js → chunk-xtaq95em.js} +1 -1
- package/dist/{chunk-5a0d3048.js → chunk-y2e2zm6y.js} +3 -3
- package/dist/chunk-y4hn1qh0.js +2 -0
- package/dist/{chunk-pywz8q4k.js → chunk-y75bds1g.js} +31 -31
- package/dist/chunk-yc8ggeh2.js +2 -0
- package/dist/{chunk-r0v2chpn.js → chunk-ydppkb8y.js} +2 -2
- package/dist/chunk-ydy0tfar.js +2 -0
- package/dist/chunk-yfed67yc.js +2 -0
- package/dist/{chunk-7ayvybdy.js → chunk-ysfgabpf.js} +3 -3
- package/dist/{chunk-fd1bpv35.js → chunk-yxdhz4ps.js} +2 -2
- package/dist/{chunk-rw5492e2.js → chunk-zc8a2erc.js} +4 -4
- package/dist/{chunk-7cvbz4eq.js → chunk-zn6n075d.js} +3 -3
- package/dist/cli.js +22 -22
- package/dist/component-library.d.ts +31 -1
- package/dist/component-library.js +74 -54
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/inherited-context.d.ts +14 -0
- package/dist/inherited-context.js +102 -0
- package/dist/native-component-context.d.ts +10 -0
- package/dist/native-component-context.js +94 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +12 -12
- package/dist/stx-virtual-ts.d.ts +14 -2
- package/dist/stx-virtual-ts.js +64 -34
- package/dist/typecheck.d.ts +5 -2
- package/dist/typecheck.js +29 -19
- package/package.json +5 -5
- package/dist/chunk-0g80km93.js +0 -2
- package/dist/chunk-1mzfynpk.js +0 -2
- package/dist/chunk-26s2jxvn.js +0 -2
- package/dist/chunk-2asyyky3.js +0 -2
- package/dist/chunk-36e94whg.js +0 -3
- package/dist/chunk-3t91wwbe.js +0 -2
- package/dist/chunk-46pxmpeb.js +0 -3
- package/dist/chunk-4es07dwb.js +0 -2
- package/dist/chunk-4pr29yrx.js +0 -2
- package/dist/chunk-4v70bs2q.js +0 -2
- package/dist/chunk-5nj2k8zf.js +0 -2
- package/dist/chunk-60ezkjcz.js +0 -2
- package/dist/chunk-6pczzq5f.js +0 -2
- package/dist/chunk-73k579v7.js +0 -2
- package/dist/chunk-7wqevtks.js +0 -2
- package/dist/chunk-85m8nyk6.js +0 -2
- package/dist/chunk-8q8xkw02.js +0 -2
- package/dist/chunk-9fyw1xkh.js +0 -3
- package/dist/chunk-9kghtf20.js +0 -2
- package/dist/chunk-are96jcb.js +0 -2
- package/dist/chunk-asrzmw7w.js +0 -2
- package/dist/chunk-ba91r7q9.js +0 -2
- package/dist/chunk-cvgbtmxp.js +0 -2
- package/dist/chunk-d0h18m2r.js +0 -2
- package/dist/chunk-d3mmnzwy.js +0 -2
- package/dist/chunk-d8zhtwnw.js +0 -2
- package/dist/chunk-d9f7zb5p.js +0 -2
- package/dist/chunk-df49nnj9.js +0 -2
- package/dist/chunk-dhjet15m.js +0 -2
- package/dist/chunk-djdganvr.js +0 -2
- package/dist/chunk-dy1brym3.js +0 -2
- package/dist/chunk-eczy00w6.js +0 -2
- package/dist/chunk-ek5mv2h8.js +0 -2
- package/dist/chunk-eprhhrzc.js +0 -712
- package/dist/chunk-f52b9hjv.js +0 -2
- package/dist/chunk-fbqk2w2k.js +0 -4
- package/dist/chunk-gc4bgven.js +0 -2
- package/dist/chunk-gvz0kqkz.js +0 -2
- package/dist/chunk-h2qgqjkn.js +0 -2
- package/dist/chunk-h8rpk597.js +0 -2
- package/dist/chunk-hcaedzck.js +0 -2
- package/dist/chunk-hmsjjw34.js +0 -2
- package/dist/chunk-j4zrq17p.js +0 -2
- package/dist/chunk-jq0zvr43.js +0 -2
- package/dist/chunk-k0ph8zr7.js +0 -2
- package/dist/chunk-kp12tsn0.js +0 -2
- package/dist/chunk-m9cperj4.js +0 -2
- package/dist/chunk-me7cxs0e.js +0 -2
- package/dist/chunk-meqsd5bt.js +0 -2
- package/dist/chunk-n0d4vbcv.js +0 -2051
- package/dist/chunk-natvnazg.js +0 -2
- package/dist/chunk-nxqsdt89.js +0 -20
- package/dist/chunk-p2kqsb5k.js +0 -2
- package/dist/chunk-p71c1wrw.js +0 -2
- package/dist/chunk-qhczf1wf.js +0 -20
- package/dist/chunk-rqa92xm4.js +0 -2
- package/dist/chunk-s92j8k4z.js +0 -2
- package/dist/chunk-sb8qv9wy.js +0 -2
- package/dist/chunk-ts1jwj54.js +0 -2
- package/dist/chunk-vk98r75z.js +0 -2
- package/dist/chunk-vmq773pb.js +0 -2
- package/dist/chunk-w8qr5414.js +0 -2
- package/dist/chunk-xjxcwrqs.js +0 -2
- package/dist/chunk-y0a8hex3.js +0 -2
- package/dist/chunk-y2ctxchq.js +0 -2
- package/dist/chunk-ytzzth34.js +0 -2
- package/dist/chunk-yxpjj003.js +0 -2
- package/dist/chunk-z347p6cg.js +0 -2
- package/dist/chunk-z3afnkan.js +0 -2
- package/dist/chunk-z6c4c951.js +0 -2
- package/dist/chunk-z9xe3xkg.js +0 -12
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gi,mi,$t,be,vr,Ds,xr,Ms,Ls,cg,lg,ug,Sr,dg,pg,fg,gg,Fc,zc,Hc,hi,Vc,mg,Rt,At,Pt,It,Ot,Nt,at,hg}from"./chunk-wp0qpa50.js";export{xr as Router,fg as abortNavigation,Ds as bracketPathToRegex,Rt as clearMiddleware,zc as createClientCookieManager,Ot as createMiddlewareContext,It as createRouteLocation,Fc as createServerCookieManager,Hc as createStorageManager,gg as defineMiddleware,lg as defineRoute,ug as defineRoutes,Ms as findErrorPage,Ls as formatRoutes,mi as generateRouteManifest,gi as generateRouteTypes,Vc as getMiddleware,At as getMiddlewareNames,at as getRouterScript,hg as getRouterScriptDev,mg as hasMiddleware,$t as isFileRequestPath,Pt as loadMiddlewareFromDirectory,vr as matchRoute,pg as navigateTo,be as patternToRegex,hi as registerMiddleware,dg as resetRoutes,Sr as route,Nt as runMiddleware,cg as setAppUrl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Fa,za,Ha,Va,Hh}from"./chunk-g7qpnmbm.js";import"./chunk-y75bds1g.js";import"./chunk-g33ycxe3.js";import"./chunk-f4vgagjb.js";import"./chunk-0h6r7nvn.js";import"./chunk-644ckv6e.js";import"./chunk-6ezt9kbe.js";import"./chunk-r2bxjna3.js";import"./chunk-88xayf21.js";import"./chunk-7j11vgm1.js";import"./chunk-2qb9kp21.js";import"./chunk-dbvsa5ya.js";import"./chunk-4m11kcxz.js";import"./chunk-95hbmv7k.js";import"./chunk-xtaq95em.js";import"./chunk-dw0ttj6p.js";import"./chunk-6az66mrc.js";import"./chunk-a5yb8w7s.js";import"./chunk-r09kz9bf.js";import"./chunk-zc8a2erc.js";import"./chunk-0sa9gqmc.js";import"./chunk-wp0qpa50.js";import"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{Fa as buildNative,Hh as default,za as findCraftBinary,Va as getAvailableFormats,Ha as getAvailableTargets};
|
|
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
45
45
|
});
|
|
46
46
|
})();
|
|
47
47
|
</script>
|
|
48
|
-
`}function
|
|
48
|
+
`}function dh(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
|
|
49
49
|
<div id="${a}" class="stx-teleport-source" style="display: none;">
|
|
50
50
|
<template>${c}</template>
|
|
51
51
|
</div>
|
|
52
52
|
${m}
|
|
53
|
-
`})}function
|
|
53
|
+
`})}function ph(){return`
|
|
54
54
|
<script>
|
|
55
55
|
(function() {
|
|
56
56
|
// Common teleport targets
|
|
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
68
68
|
})();
|
|
69
69
|
</script>
|
|
70
70
|
`}
|
|
71
|
-
export{
|
|
71
|
+
export{dh,ph};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kn,bg,wg,vg,xg,Sg,h,kg,Ri,_g,cl,ll}from"./chunk-j1ytbd6r.js";import"./chunk-6ykfy7eh.js";import"./chunk-kzc2tqzr.js";import"./chunk-pp99rmjm.js";import"./chunk-3w7gacva.js";import"./chunk-fdjx4vs3.js";export{kn as STX_ENGINE_BINDING_NAMES,Ri as convertToCommonJS,cl as extractScriptFromTemplate,h as extractVariables,ll as hasVariables,kg as isCompleteImport,Sg as isMissingBindingFailure,vg as isModuleResolutionFailure,xg as isSyntaxFailure,_g as splitDeclaration,bg as stripTypeScript,wg as withoutStxReferrer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Vt,
|
|
2
|
+
import{Vt,me,E,d,m,O,t,oe,Y,u,Ae,Bi,W,An,Fi,qt,zi,xl,Mr,Sl,pt,kl,Lr,_l,Pn,Hi,Cl,jr,Fr,Pe,Vi}from"./chunk-pp99rmjm.js";import{vi,Wc,o,T,Fe,Lt,bn,ze,we,ee,Tr,vn,Xs,tl,nl,Sn,Ir,Ys,Zs,rl,$i,sl,ol,il,al,He,Ve,Qs,qe,s,Cn,y,g,X,re,Re,R,Di}from"./chunk-j1ytbd6r.js";import{Ht}from"./chunk-kzc2tqzr.js";import{$n}from"./chunk-6ykfy7eh.js";import{x}from"./chunk-644ckv6e.js";import{Sr,js}from"./chunk-wp0qpa50.js";import{$c,Rc,wr,ot,Ac,M}from"./chunk-6az66mrc.js";import{ui,di,pi,fi}from"./chunk-0sa9gqmc.js";import{kc,ws}from"./chunk-88xayf21.js";import{ms,hs,ys}from"./chunk-6ezt9kbe.js";import{Ss,ni,ri,ks,_s,si}from"./chunk-4m11kcxz.js";import{vs,Yo}from"./chunk-2qb9kp21.js";import{Ko}from"./chunk-r2bxjna3.js";import{de,Zo,Qo,ei}from"./chunk-dbvsa5ya.js";import{mr,Ce,Cc,hr,Ec}from"./chunk-95hbmv7k.js";import{V,rt}from"./chunk-bjjfr7qt.js";import{Ic,Oc}from"./chunk-a5yb8w7s.js";import{A,In,Ui}from"./chunk-1ztp5vkh.js";import{D,c,f}from"./chunk-yxdhz4ps.js";import Jn from"fs";import ae from"path";function mt(n){let e=Lt(n),l=e.find((S)=>S.closing&&S.name.toLowerCase()==="head");if(!l)return n;let a=new Set(["template","svg","noscript","math","textarea","title","xmp","iframe","noembed","noframes","plaintext"]),h=0,r=[];for(let S=0;S<e.length;S++){let v=e[S];if(v.start<l.end)continue;let k=v.name.toLowerCase();if(a.has(k)){h=Math.max(0,h+(v.closing?-1:v.selfClosing?0:1));continue}if(k!=="style"||v.closing||h>0)continue;let C=e[S+1];if(C?.name.toLowerCase()==="style"&&C.closing){if(/@scope\s*\{/.test(n.slice(v.end,C.start)))continue;r.push({start:v.start,end:C.end}),S++}}if(!r.length)return n;let p=r.map((S)=>n.slice(S.start,S.end)).join(`
|
|
3
3
|
`),w=[n.slice(0,l.start),p,`
|
|
4
4
|
`],b=l.start;for(let S of r)w.push(n.slice(b,S.start)),b=S.end;return w.push(n.slice(b)),w.join("")}function ht(){return`
|
|
5
5
|
// STX Lifecycle Runtime
|
|
@@ -349,7 +349,7 @@ else {
|
|
|
349
349
|
|
|
350
350
|
console.log('[stx] Lifecycle runtime initialized');
|
|
351
351
|
})();
|
|
352
|
-
`}function Ye(n){return Symbol(n)}var
|
|
352
|
+
`}function Ye(n){return Symbol(n)}var xs=Ye("theme"),$s=Ye("router"),Es=Ye("i18n");import*as bt from"crypto";function yt(n){let e=/\$(\w+)\./g,l=[],a;while((a=e.exec(n))!==null)if(!l.includes(a[1]))l.push(a[1]);return l}function Hr(){return`stx-${bt.randomBytes(4).toString("hex")}`}function Nr(n){return/\$\w+\./.test(n)}function Br(n){if(!/\{\{[^}]*\$\w/.test(n)||!/\$\w+\./.test(n))return{html:n,bindings:[],stores:new Set};let e=[],l=new Set,a=/<(\w+)([^>]*?)(\s*\/?>)/g,h=n;return h=h.replace(a,(r,p,w,b)=>{if(["script","style","template"].includes(p.toLowerCase()))return r;if(!w.includes("{{"))return r;let S=[],v=!1,k=w,C=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,_=[...w.matchAll(C)];for(let L of _){let j=L[0],B=L[1],F=L[2];if(Nr(F)){v=!0;let q=F.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(q){let H=q[1];if(S.push({attr:B,expr:H,fullMatch:j,originalAttr:B}),yt(H).forEach((U)=>l.add(U)),B==="text")k=k.replace(j,"");else if(B==="class")k=k.replace(j,'class=""');else if(B==="disabled"||B==="hidden")k=k.replace(j,"");else k=k.replace(j,`${B}=""`)}}}if(!v)return r;let P=k.match(/\bid\s*=\s*"([^"]+)"/),I;if(P)I=P[1];else I=Hr(),k=` id="${I}"${k}`;for(let L of S)e.push({elementId:I,attribute:L.attr,expression:L.expr,stores:yt(L.expr)});return`<${p}${k}${b}`}),{html:h,bindings:e,stores:l}}function Ur(n,e){if(n.length===0)return"";let l=Array.from(e),a=`
|
|
353
353
|
<script>
|
|
354
354
|
(function() {
|
|
355
355
|
'use strict';
|
|
@@ -507,7 +507,7 @@ else {
|
|
|
507
507
|
}
|
|
508
508
|
})();
|
|
509
509
|
</script>
|
|
510
|
-
`,a}function wt(n){let{html:e,bindings:l,stores:a}=
|
|
510
|
+
`,a}function wt(n){let{html:e,bindings:l,stores:a}=Br(n);if(l.length===0)return n;let h=Ur(l,a),r=c(e);if(r!==-1)return e.slice(0,r)+h+e.slice(r);return e+h}function qr(n){let e=n.analytics;if(!e?.enabled)return"";switch(e.driver){case"fathom":return Vr(e);case"google-analytics":return Wr(e);case"plausible":return Xr(e);case"self-hosted":return zr(e);case"custom":return Kr(e);default:return""}}function Vr(n){let e=n.fathom;if(!e?.siteId)return"";let l=e.scriptUrl||"https://cdn.usefathom.com/script.js",a=e.defer!==!1?" defer":"",h=[`data-site="${pe(e.siteId)}"`];if(e.honorDnt)h.push('data-honor-dnt="true"');if(e.spa)h.push('data-spa="auto"');if(e.canonical)h.push(`data-canonical="${pe(e.canonical)}"`);if(e.auto===!1)h.push('data-auto="false"');return`
|
|
511
511
|
<!-- Fathom Analytics -->
|
|
512
512
|
<script src="${pe(l)}" ${h.join(" ")}${a}></script>
|
|
513
513
|
`}function Wr(n){let e=n.googleAnalytics;if(!e?.measurementId)return"";let l=pe(e.measurementId),a=e.debug?`gtag('config', '${l}', { 'debug_mode': true });`:"";return`
|
|
@@ -564,24 +564,24 @@ ${e.inlineScript}
|
|
|
564
564
|
`;if(!e.scriptUrl)return"";let l=[];if(e.scriptId)l.push(`id="${pe(e.scriptId)}"`);if(e.attributes)for(let[h,r]of Object.entries(e.attributes))l.push(`${pe(h)}="${pe(r)}"`);return`
|
|
565
565
|
<!-- Custom Analytics -->
|
|
566
566
|
<script${l.length>0?` ${l.join(" ")}`:""} src="${pe(e.scriptUrl)}" defer></script>
|
|
567
|
-
`}function vt(n,e){let l=qr(e);if(!l)return n;if(!n.includes("</head>")){let a=c(n);if(a!==-1)return n.slice(0,a)+l+n.slice(a);return n+l}return f(n,l,"")}function pe(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function kt(n){let e=n.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function xt(n){let e=n?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Gr from"fs";import et from"path";import{createHighlighter as Zr}from"ts-syntax-highlighter";var tt=new Map;async function
|
|
568
|
-
${h}`)}function Tt(n,e){let l=n;return l=l.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<script nonce="${e}"${h}>`}),l=l.replace(/<style([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<style nonce="${e}"${h}>`}),l}function At(n,e,l,a){let h=n,r=a.csp;if(h=h.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let p=r.useNonce?Ke(e,r):void 0;return Ct(r.directives,p)}),h=h.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return Ke(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=Ke(e,r);return h}import en from"crypto";var tn=40,Rt="_token",rt=null;function rn(n=tn){let e=en.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return rt=e,e}function nn(){if(!rt)rn();return rt}function sn(n=Rt){let e=nn();return`<input type="hidden" name="${n}" value="${e}">`}function Mt(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,l,a)=>sn(a||Rt))}async function Dt(n,e,l,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let h=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)h=await on(h,r,e,l,a);else h=await an(h,r,e,l,a)}return h}async function on(n,e,l,a,h){let{name:r,handler:p}=e,w=`@${r}`,b=`@end${r}`,S=n,v=Vt(`${w}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${b}`,"g"),k=[],C=v.exec(S);while(C!==null){let[_,P="",I=""]=C,L=C.index||0;try{let j=P?It(e,P):[],B=I.trim(),F=await p(B,j,l,a);k.push({original:_,processed:F,startIndex:L})}catch(j){let B=j instanceof Error?j.message:String(j);if(h.debug)console.error(`Error processing custom directive @${r}:`,j);k.push({original:_,processed:u("CustomDirective",`Error in @${r}${P?`(${P})`:""}: ${B}`,t.EVALUATION_ERROR),startIndex:L})}C=v.exec(S)}for(let _=k.length-1;_>=0;_--){let{original:P,processed:I}=k[_];S=S.replace(P,I)}return S}async function an(n,e,l,a,h){let{name:r,handler:p}=e,w=n,b=[],S=[];if(e.rawParams){for(let C of Di(w,Vt(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(C.end!==-1)S.push({fullMatch:C.call,paramString:C.args,startIndex:C.start})}else{let C=Vt(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");C.lastIndex=0;let _=C.exec(w);while(_!==null)S.push({fullMatch:_[0],paramString:_[1]??"",startIndex:_.index||0}),_=C.exec(w)}for(let{fullMatch:C,paramString:_,startIndex:P}of S)try{let I=It(e,_),L=await p("",I,l,a);b.push({original:C,processed:L,startIndex:P})}catch(I){let L=I instanceof Error?I.message:String(I);if(h.debug)console.error(`Error processing custom directive @${r}:`,I);b.push({original:C,processed:u("CustomDirective",`Error in @${r}(${_}): ${L}`,t.EVALUATION_ERROR),startIndex:P})}let v=Vt(`@${r}(?!\\w)(?!\\s*\\()`,"g"),k=v.exec(w);while(k!==null){let[C]=k,_=k.index||0;try{let P=await p("",[],l,a);b.push({original:C,processed:P,startIndex:_})}catch(P){let I=P instanceof Error?P.message:String(P);if(h.debug)console.error(`Error processing custom directive @${r}:`,P);b.push({original:C,processed:u("CustomDirective",`Error in @${r}: ${I}`,t.EVALUATION_ERROR),startIndex:_})}k=v.exec(w)}for(let C=b.length-1;C>=0;C--){let{original:_,processed:P}=b[C];w=w.replace(_,P)}return w}function It(n,e){return n.rawParams?qt(e):cn(e)}function cn(n){if(!n.trim())return[];let e=[],l="",a=!1,h="";for(let r=0;r<n.length;r++){let p=n[r];if((p==='"'||p==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,h=p;else if(p===h)a=!1;else l+=p;else if(p===","&&!a)e.push(l.trim()),l="";else l+=p}if(l.trim())e.push(l.trim());return e.map((r)=>{let p=r.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Ot=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Pt=/^[A-Za-z_$][\w$]*$/,ln=new Set(["light","dark","system"]);function Ce(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function un(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:l,colorMode:a}=e;if(Ce(e.storageKey,"storageKey"),l!==void 0&&(!l||typeof l!=="object"||Array.isArray(l)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if(Ce(a.key,"colorMode.key"),Ce(a.attribute,"colorMode.attribute"),Ce(a.default,"colorMode.default"),!Pt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ot.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!ln.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let h=null;if(l){if(Ce(l.key,"appearance.key"),Ce(l.attribute,"appearance.attribute"),Ce(l.default,"appearance.default"),!Pt.test(l.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ot.test(l.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(l.allowed)||l.allowed.length===0||l.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!l.allowed.includes(l.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");h={key:l.key,attribute:l.attribute,allowed:[...new Set(l.allowed)],default:l.default}}return{storageKey:e.storageKey,appearance:h,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function dn(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function pn(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${dn(n)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function fn(n,e){let l=1,a=null,h=!1;for(let r=e+1;r<n.length;r++){let p=n[r];if(h){h=!1;continue}if(a){if(p==="\\")h=!0;else if(p===a)a=null;continue}if(p==='"'||p==="'"||p==="`"){a=p;continue}if(p==="(")l++;else if(p===")"&&--l===0)return r}return-1}function jt(n,e){let l=n,a=/@appearanceBootstrap\s*\(/g,h;while((h=a.exec(l))!==null){let r=h.index+h[0].length-1,p=fn(l,r);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let w=l.slice(r+1,p).trim(),b=d(`(${w})`,e),S=pn(un(b));l=l.slice(0,h.index)+S+l.slice(p+1),a.lastIndex=h.index+S.length}return l}import gn from"crypto";function ee(n){return G(String(n??""))}var Bt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ge(n,e,l,a){let h=n||e;return l?`${h} ${a}`:h}function he(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Ie(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${ee(e)}"`}function it(n,e,l){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(l))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(l))a+=` aria-describedby="${ee(`${he(n)}-error`)}"`;return a}function mn(){return gn.randomUUID()}function Ze(n,e){let l=n;return l=l.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=mn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${ee(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),l=l.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,h)=>{let r=h.toUpperCase();if(h&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${ee(r)}">`;return a}),l}function Ft(n,e,l=Bt){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(h,r,p,w,b,S="")=>{let v=r||p||"POST",k=w||b||"",C=xe(S),_=v.toUpperCase(),P=["GET","POST"].includes(_)?_:"POST",I=`<form method="${ee(P)}" action="${ee(k)}"${C?` ${C}`:""}>`;if(I+=`
|
|
567
|
+
`}function vt(n,e){let l=qr(e);if(!l)return n;if(!n.includes("</head>")){let a=c(n);if(a!==-1)return n.slice(0,a)+l+n.slice(a);return n+l}return f(n,l,"")}function pe(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function kt(n){let e=n.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function xt(n){let e=n?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}import Gr from"fs";import et from"path";import{createHighlighter as Zr}from"ts-syntax-highlighter";var tt=new Map;async function Me(n,e={}){try{if(!await s(n))throw Error(`Markdown file not found: ${n}`);let a=(await Gr.promises.stat(n)).mtime.getTime();if(e.cache&&tt.has(n)){let k=tt.get(n);if(k.updatedAt>=a)return{content:k.content,data:k.data}}let h=await Bun.file(n).text(),{data:r,content:p}=wr(h),w=e.markdown||M.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},S=ot(p,{gfm:!0});if(w.syntaxHighlighting?.enabled&&w.syntaxHighlighting?.serverSide)S=await Jr(S,w.syntaxHighlighting?.defaultTheme||"github-dark",w.syntaxHighlighting?.highlightUnknownLanguages||!1);let v={content:S,data:r||{}};if(e.cache)tt.set(n,{...v,updatedAt:a});return v}catch(l){if(e.debug)console.error(`Error reading/parsing markdown file ${n}:`,l);let a=l instanceof Error?l.message:String(l);return{content:y("Markdown File",`Error reading/parsing markdown file: ${a}`,n,"",0,""),data:{}}}}var Xe=null;async function Jr(n,e,l){let a=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!Xe)try{Xe=await Zr({theme:e||"github-dark",cache:!0})}catch(w){return console.error("Failed to initialize ts-syntax-highlighter:",w),n}let h=async(w,b,S,v)=>{let k=v.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),C=S||(l?"text":"");if(!C)return w;try{if(!Xe.getSupportedLanguages().includes(C))return w;return(await Xe.highlight(k,C,{theme:e})).html}catch(_){console.error(`Error highlighting code block with language ${S}:`,_)}return w},r=n,p=n.matchAll(a);for(let w of p){let[b,S,v,k]=w,C=await h(b,S,v,k);r=r.replace(b,C)}return r}async function St(n,e,l="",a={}){return await Qr(n,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(p,w,b,S)=>{try{let v=w;if(!et.isAbsolute(w))v=et.resolve(et.dirname(l),w);let k={};if(b)try{try{k=JSON.parse(b)}catch{if(a.debug)console.warn("Using safer alternative for parsing JS object literal");let B=b.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let F of B){let q=F.indexOf(":");if(q>0){let H=F.substring(0,q).trim(),N=F.substring(q+1).trim(),U=N.startsWith('"')&&N.endsWith('"'),G=N.startsWith("'")&&N.endsWith("'");if(U||G)N=N.substring(1,N.length-1);k[H]=N}}}}catch(j){if(a.debug)console.error("Error parsing context in @markdown-file directive:",j)}let{content:C,data:_}=await Me(v,a),P={...e,..._,...k},I=C,L=/\{\{([^}]+)\}\}/g;return I=I.replace(L,(j,B)=>{let F=B.trim();return P[F]!==void 0?String(P[F]):j}),I}catch(v){let k=v instanceof Error?v.message:String(v);return y("Markdown File",`Error including markdown file: ${k}`,l,n,S,p)}})}async function Qr(n,e,l){let a=[],h;while((h=e.exec(n))!==null){let w=h[0],b=h.index,S=h;a.push(l(...S).then((v)=>({match:w,replacement:v,index:b})))}let r=await Promise.all(a);r.sort((w,b)=>b.index-w.index);let p=n;for(let{match:w,replacement:b}of r)p=p.replace(w,()=>b);return p}var $t=new WeakMap;function Et(n=16){let e=new Uint8Array(n);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function Ke(n,e){if(!n)return e?.nonceGenerator?.()??Et();let l=$t.get(n);if(!l)l=e?.nonceGenerator?.()??Et(),$t.set(n,l);return l}function Yr(n,e){let l=[];for(let[a,h]of Object.entries(n)){if(h===void 0||h===null)continue;if(typeof h==="boolean"){if(h)l.push(a);continue}if(Array.isArray(h)){let r=[...h];if(e&&(a==="script-src"||a==="style-src"))r=r.filter((p)=>!p.startsWith("'nonce-")),r.push(`'nonce-${e}'`);if(r.length>0)l.push(`${a} ${r.join(" ")}`)}}return l.join("; ")}function Ct(n,e){return`<meta http-equiv="Content-Security-Policy" content="${Yr(n,e).replace(/&/g,"&").replace(/"/g,""")}">`}function _t(n,e,l){if(!e.enabled||!e.addMetaTag)return n;if(n.includes('http-equiv="Content-Security-Policy"'))return n;if(!n.includes("<head>")&&!n.includes("<head "))return n;let a=e.useNonce?Ke(l,e):void 0,h=Ct(e.directives,a);return n.replace(/<head([^>]*)>/,`<head$1>
|
|
568
|
+
${h}`)}function Tt(n,e){let l=n;return l=l.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<script nonce="${e}"${h}>`}),l=l.replace(/<style([^>]*)>/gi,(a,h)=>{if(h.includes("nonce="))return a;return`<style nonce="${e}"${h}>`}),l}function At(n,e,l,a){let h=n,r=a.csp;if(h=h.replace(/@csp\b/g,()=>{if(!r?.enabled||!r.directives)return"<!-- CSP not configured -->";let p=r.useNonce?Ke(e,r):void 0;return Ct(r.directives,p)}),h=h.replace(/@cspNonce\b/g,()=>{if(!r?.enabled||!r.useNonce)return"";return Ke(e,r)}),r?.enabled&&r.useNonce)e.cspNonce=Ke(e,r);return h}import en from"crypto";var tn=40,Rt="_token",nt=null;function rn(n=tn){let e=en.randomBytes(Math.ceil(n/2)).toString("hex").slice(0,n);return nt=e,e}function nn(){if(!nt)rn();return nt}function sn(n=Rt){let e=nn();return`<input type="hidden" name="${n}" value="${e}">`}function Mt(n){return n.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,l,a)=>sn(a||Rt))}async function Dt(n,e,l,a){if(!a.customDirectives||a.customDirectives.length===0)return n;let h=n;for(let r of a.customDirectives){if(!r.name||typeof r.handler!=="function"){if(a.debug)console.warn("Invalid custom directive:",r);continue}if(r.hasEndTag)h=await on(h,r,e,l,a);else h=await an(h,r,e,l,a)}return h}async function on(n,e,l,a,h){let{name:r,handler:p}=e,w=`@${r}`,b=`@end${r}`,S=n,v=Vt(`${w}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${b}`,"g"),k=[],C=v.exec(S);while(C!==null){let[_,P="",I=""]=C,L=C.index||0;try{let j=P?It(e,P):[],B=I.trim(),F=await p(B,j,l,a);k.push({original:_,processed:F,startIndex:L})}catch(j){let B=j instanceof Error?j.message:String(j);if(h.debug)console.error(`Error processing custom directive @${r}:`,j);k.push({original:_,processed:u("CustomDirective",`Error in @${r}${P?`(${P})`:""}: ${B}`,t.EVALUATION_ERROR),startIndex:L})}C=v.exec(S)}for(let _=k.length-1;_>=0;_--){let{original:P,processed:I}=k[_];S=S.replace(P,I)}return S}async function an(n,e,l,a,h){let{name:r,handler:p}=e,w=n,b=[],S=[];if(e.rawParams){for(let C of Fi(w,Vt(`(?<![\\w$@])@${r}\\s*\\(`,"g")))if(C.end!==-1)S.push({fullMatch:C.call,paramString:C.args,startIndex:C.start})}else{let C=Vt(`@${r}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");C.lastIndex=0;let _=C.exec(w);while(_!==null)S.push({fullMatch:_[0],paramString:_[1]??"",startIndex:_.index||0}),_=C.exec(w)}for(let{fullMatch:C,paramString:_,startIndex:P}of S)try{let I=It(e,_),L=await p("",I,l,a);b.push({original:C,processed:L,startIndex:P})}catch(I){let L=I instanceof Error?I.message:String(I);if(h.debug)console.error(`Error processing custom directive @${r}:`,I);b.push({original:C,processed:u("CustomDirective",`Error in @${r}(${_}): ${L}`,t.EVALUATION_ERROR),startIndex:P})}let v=Vt(`@${r}(?!\\w)(?!\\s*\\()`,"g"),k=v.exec(w);while(k!==null){let[C]=k,_=k.index||0;try{let P=await p("",[],l,a);b.push({original:C,processed:P,startIndex:_})}catch(P){let I=P instanceof Error?P.message:String(P);if(h.debug)console.error(`Error processing custom directive @${r}:`,P);b.push({original:C,processed:u("CustomDirective",`Error in @${r}: ${I}`,t.EVALUATION_ERROR),startIndex:_})}k=v.exec(w)}for(let C=b.length-1;C>=0;C--){let{original:_,processed:P}=b[C];w=w.replace(_,P)}return w}function It(n,e){return n.rawParams?qt(e):cn(e)}function cn(n){if(!n.trim())return[];let e=[],l="",a=!1,h="";for(let r=0;r<n.length;r++){let p=n[r];if((p==='"'||p==="'")&&(r===0||n[r-1]!=="\\"))if(!a)a=!0,h=p;else if(p===h)a=!1;else l+=p;else if(p===","&&!a)e.push(l.trim()),l="";else l+=p}if(l.trim())e.push(l.trim());return e.map((r)=>{let p=r.trim();if(p.startsWith('"')&&p.endsWith('"')||p.startsWith("'")&&p.endsWith("'"))return p.substring(1,p.length-1);return p})}var Ot=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,Pt=/^[A-Za-z_$][\w$]*$/,ln=new Set(["light","dark","system"]);function $e(n,e){if(typeof n!=="string"||n.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function un(n){if(!n||typeof n!=="object"||Array.isArray(n))throw Error("@appearanceBootstrap expects an options object");let e=n,{appearance:l,colorMode:a}=e;if($e(e.storageKey,"storageKey"),l!==void 0&&(!l||typeof l!=="object"||Array.isArray(l)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!a||typeof a!=="object"||Array.isArray(a))throw Error("@appearanceBootstrap colorMode must be an object");if($e(a.key,"colorMode.key"),$e(a.attribute,"colorMode.attribute"),$e(a.default,"colorMode.default"),!Pt.test(a.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ot.test(a.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!ln.has(a.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let h=null;if(l){if($e(l.key,"appearance.key"),$e(l.attribute,"appearance.attribute"),$e(l.default,"appearance.default"),!Pt.test(l.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Ot.test(l.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(l.allowed)||l.allowed.length===0||l.allowed.some((r)=>typeof r!=="string"||r.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!l.allowed.includes(l.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");h={key:l.key,attribute:l.attribute,allowed:[...new Set(l.allowed)],default:l.default}}return{storageKey:e.storageKey,appearance:h,colorMode:{key:a.key,attribute:a.attribute,default:a.default},respectExisting:e.respectExisting===!0}}function dn(n){return JSON.stringify(n).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function pn(n){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${dn(n)};const root=document.documentElement;const MODES=["light","dark","system"];let format="json";const forced=(function(){const found={colorMode:null,appearance:null};if(!config.respectExisting)return found;try{const mode=root.getAttribute("data-"+config.colorMode.attribute);if(mode==="light"||mode==="dark")found.colorMode=mode;if(config.appearance){const name=root.getAttribute("data-"+config.appearance.attribute);if(config.appearance.allowed.includes(name))found.appearance=name}}catch{}return found}());function read(){let stored={};try{const raw=localStorage.getItem(config.storageKey);if(raw){let parsed=null;try{parsed=JSON.parse(raw)}catch{parsed=raw}if(parsed&&typeof parsed==="object"&&!Array.isArray(parsed)){stored=parsed;format="json"}else if(typeof parsed==="string"&&MODES.includes(parsed)){stored={};stored[config.colorMode.key]=parsed;format="string"}}}catch{}return stored}function write(stored){try{if(format==="string"&&!config.appearance)localStorage.setItem(config.storageKey,stored[config.colorMode.key]);else localStorage.setItem(config.storageKey,JSON.stringify(stored))}catch{}}function resolve(){const stored=read();const state={colorMode:forced.colorMode||(MODES.includes(stored[config.colorMode.key])?stored[config.colorMode.key]:config.colorMode.default)};if(config.appearance)state.appearance=forced.appearance||(config.appearance.allowed.includes(stored[config.appearance.key])?stored[config.appearance.key]:config.appearance.default);return state}function prefersDark(){try{return matchMedia("(prefers-color-scheme: dark)").matches}catch{return false}}function apply(){const state=resolve();const dark=state.colorMode==="dark"||(state.colorMode==="system"&&prefersDark());if(config.appearance)root.setAttribute("data-"+config.appearance.attribute,state.appearance);root.setAttribute("data-"+config.colorMode.attribute,state.colorMode);root.classList.toggle("dark",dark);root.dataset.theme=dark?"dark":"light";state.dark=dark;try{window.dispatchEvent(new CustomEvent("stx:appearance",{detail:state}))}catch{}return state}function store(key,allowed,value){if(allowed.includes(value)){const stored=read();stored[key]=value;write(stored)}return apply()}window.__stxAppearance={config:config,forced:forced,read:read,resolve:resolve,apply:apply,setColorMode:function(mode){return store(config.colorMode.key,MODES,mode)},setAppearance:function(name){return config.appearance?store(config.appearance.key,config.appearance.allowed,name):apply()},watchSystem:function(){try{matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(){if(resolve().colorMode==="system")apply()})}catch{}}};apply()}());</script>`}function fn(n,e){let l=1,a=null,h=!1;for(let r=e+1;r<n.length;r++){let p=n[r];if(h){h=!1;continue}if(a){if(p==="\\")h=!0;else if(p===a)a=null;continue}if(p==='"'||p==="'"||p==="`"){a=p;continue}if(p==="(")l++;else if(p===")"&&--l===0)return r}return-1}function jt(n,e){let l=n,a=/@appearanceBootstrap\s*\(/g,h;while((h=a.exec(l))!==null){let r=h.index+h[0].length-1,p=fn(l,r);if(p===-1)throw Error("@appearanceBootstrap has an unclosed options object");let w=l.slice(r+1,p).trim(),b=d(`(${w})`,e),S=pn(un(b));l=l.slice(0,h.index)+S+l.slice(p+1),a.lastIndex=h.index+S.length}return l}import gn from"crypto";function te(n){return X(String(n??""))}var Bt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ge(n,e,l,a){let h=n||e;return l?`${h} ${a}`:h}function he(n){return String(n).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Ie(n,e){if(/\bid\s*=/i.test(n))return"";return` id="${te(e)}"`}function st(n,e,l){if(!e)return"";let a="";if(!/\baria-invalid\s*=/i.test(l))a+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(l))a+=` aria-describedby="${te(`${he(n)}-error`)}"`;return a}function mn(){return gn.randomUUID()}function Ze(n,e){let l=n;return l=l.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let a=mn();e.csrf={token:a}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${te(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),l=l.replace(/@method\(['"]([^'"]+)['"]\)/g,(a,h)=>{let r=h.toUpperCase();if(h&&!["GET","POST"].includes(r))return`<input type="hidden" name="_method" value="${te(r)}">`;return a}),l}function Ft(n,e,l=Bt){let a=n;return a=a.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(h,r,p,w,b,S="")=>{let v=r||p||"POST",k=w||b||"",C=xe(S),_=v.toUpperCase(),P=["GET","POST"].includes(_)?_:"POST",I=`<form method="${te(P)}" action="${te(k)}"${C?` ${C}`:""}>`;if(I+=`
|
|
569
569
|
${Ze("@csrf",e)}`,!["GET","POST"].includes(_))I+=`
|
|
570
|
-
${Ze(`@method('${_}')`,e)}`;return I}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(h,r,p,w,b,S="")=>{let v=r||p||"",k=w||b||"",C=xe(S),_=
|
|
570
|
+
${Ze(`@method('${_}')`,e)}`;return I}),a=a.replace(/@endform/g,"</form>"),a=a.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(h,r,p,w,b,S="")=>{let v=r||p||"",k=w||b||"",C=xe(S),_=Ne(v,e),P=_!==void 0&&_!==null?_:k||"",I=C.match(/type=['"]([^'"]+)['"]/i),L=I?I[1]:"text",j=Be(v,e),B=C.match(/class=['"]([^'"]+)['"]/i),F=Ge(B?B[1]:"",l.input,j,l.inputError),q=C.replace(/class=['"][^'"]+['"]/i,"");return q=q.replace(/type=['"][^'"]+['"]/i,""),`<input type="${te(L)}" name="${te(v)}"${Ie(C,he(v))} value="${te(P)}" class="${F}"${st(v,j,C)}${q?` ${q}`:""}>`}),a=a.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(h,r,p="",w="")=>{let b=xe(p),S=Ne(r,e)||w.trim(),v=Be(r,e),k=b.match(/class=['"]([^'"]+)['"]/i),C=Ge(k?k[1]:"",l.input,v,l.inputError),_=b.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${te(r)}"${Ie(b,he(r))} class="${C}"${st(r,v,b)}${_?` ${_}`:""}>${te(S)}</textarea>`}),a=a.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(h,r,p="",w)=>{let b=xe(p),S=Ne(r,e),v=Be(r,e),k=b.match(/class=['"]([^'"]+)['"]/i),C=Ge(k?k[1]:"",l.input,v,l.inputError),_=b.replace(/class=['"][^'"]+['"]/i,""),P=w;if(S!==void 0)P=w.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(I,L,j)=>{if((Array.isArray(S)?S.some((F)=>String(F)===j):String(S)===j)&&!L.includes("selected"))return L.replace(/(<option)/,"$1 selected");return I});return`<select name="${te(r)}"${Ie(b,he(r))} class="${C}"${st(r,v,b)}${_?` ${_}`:""}>${P}</select>`}),a=a.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(h,r,p,w="")=>{let b=p===void 0?"1":p,S=p===void 0?he(r):`${he(r)}-${he(b)}`,v=xe(w),k=Ne(r,e),C=k!==void 0&&(Array.isArray(k)?k.some((L)=>String(L)===b):k===!0||String(k)===b),_=v.match(/class=['"]([^'"]+)['"]/i),P=_?_[1]:l.checkInput,I=v.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${te(r)}"${Ie(v,S)} value="${te(b)}" class="${P}"${C?" checked":""}${I?` ${I}`:""}>`}),a=a.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(h,r,p,w="")=>{let b=xe(w),S=Ne(r,e),v=S!==void 0&&S===p,k=b.match(/class=['"]([^'"]+)['"]/i),C=k?k[1]:l.checkInput,_=b.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${te(r)}"${Ie(b,`${he(r)}-${he(p)}`)} value="${te(p)}" class="${C}"${v?" checked":""}${_?` ${_}`:""}>`}),a=a.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(h,r,p="")=>{let w=xe(p),b=w.match(/accept=['"]([^'"]+)['"]/i),S=b?b[1]:"",v=w.includes("multiple"),k=Be(r,e),C=w.match(/class=['"]([^'"]+)['"]/i),_=Ge(C?C[1]:"",l.input,k,l.inputError),P=w.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),I=[`<input type="file" name="${te(r)}"${Ie(w,he(r))}`,`class="${_}"`];if(S)I.push(`accept="${te(S)}"`);if(v)I.push("multiple");if(P)I.push(P);return`${I.join(" ")}>`}),a=a.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(h,r,p="",w)=>{let b=xe(p),S=b.match(/class=['"]([^'"]+)['"]/i),v=S?S[1]:l.label,k=b.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${te(he(r))}" class="${v}"${k?` ${k}`:""}>${w}</label>`}),a}function Ut(n,e,l=Bt){return n.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(a,h,r)=>{try{if(Be(h,e)){let p=r.replace(/\{\{([^}]+)\}\}/g,(w,b,S)=>{let v=(k)=>re(r,S,String(k??""),!1,w.length);try{if(b.trim()==="$message"||b.trim()==="message")return v(Nt(h,e));if(b.trim().includes("errors.first")||b.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return v(e.errors.first(h));return v(Nt(h,e))}let k=b.trim();if(m(k)){let C=d(k,e);return C!==void 0?v(C):k}return k}catch{return b}});return`<div id="${te(`${he(h)}-error`)}" role="alert">${p}</div>`}return""}catch(p){return console.error("Error processing @error directive:",p),a}})}function Be(n,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(n);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,n);return!1}function Nt(n,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(n);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,n)){let l=e.errors[n];return Array.isArray(l)?l[0]:String(l)}return""}function Ne(n,e){let l;if(e.old&&typeof e.old==="function")return e.old(n);if(e.old&&typeof e.old==="object")return e.old[n];if(n.endsWith("[]")){let a=n.slice(0,-2);if(l=e[a],l!==void 0)return l}return e[n]}function xe(n){if(!n.trim())return"";let e=[],l=n.trim(),a=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,h;while((h=a.exec(l))!==null){let[,r,,p]=h;e.push(`${r}="${p.trim()}"`)}return e.join(" ")}import*as it from"path";async function Wt(n,e,l=""){if(it.basename(l)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,n.replace(/@js[\s\S]*?@endjs/g,"");return zt(n,e,l,"@js","@endjs")}async function Xt(n,e,l=""){if(it.basename(l)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((r)=>({...r,displayName:`User ${r.id}: ${r.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return n.replace(/@ts[\s\S]*?@endts/g,"")}return zt(n,e,l,"@ts","@endts")}async function zt(n,e,l,a,h){let r=n,p=Vt(`${a}([\\s\\S]*?)${h}`,"g"),w=[],b;while((b=p.exec(n))!==null)w.push({fullMatch:b[0],content:b[1]||"",index:b.index});for(let{fullMatch:S,content:v,index:k}of w)try{let C={...e,global:e},_=Object.keys(C),P=Object.values(C),I=v.trim();if(a==="@ts")I=I.replace(/interface\s+\w+\s*\{[^}]*\}/g,"").replace(/type\s+\w+\s*=[^;]+;/g,"").replace(/(const|let|var)\s+(\w+)\s*:[^=]+=/g,"$1 $2 =").replace(/(\w+)\s*:[\w<>|&[\],\s]+(?=[,)])/g,"$1").replace(/\)\s*:[\w<>|&[\],\s]+(?=[{=>])/g,") ").replace(/<[\w<>|&[\],\s]+>/g,"").replace(/\s+as\s[\w<>|&[\],\s]+/g,"");let j=(I.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((N)=>N.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),B=j.length>0?`return { ${j.join(", ")} };`:"return {};",F=`
|
|
571
571
|
${I}
|
|
572
572
|
${B}
|
|
573
573
|
`,H=Function(..._,F)(...P);if(H&&typeof H==="object")Object.assign(e,H);r=r.replace(S,"")}catch(C){console.error(`Error executing ${a} code block in ${l}:`,C);let _=C instanceof Error?C.message:String(C),P=y(`${a} Directive`,`Error executing code: ${_}`,l,n,k,S);console.error(P),r=r.replace(S,"")}return r}function hn(n,e="_method"){let l=n.toUpperCase();if(l==="GET"||l==="POST")return"";return`<input type="hidden" name="${e}" value="${l}">`}function Kt(n){return n.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,l,a,h,r)=>hn(a,r||"_method"))}async function Gt(n,e,l,a,h){if(!a.middleware||a.middleware.length===0)return n;let r=n,p=a.middleware.filter((w)=>w.timing===h);if(p.length===0)return r;for(let w of p){if(!w.name||typeof w.handler!=="function"){if(a.debug)console.warn("Invalid middleware:",w);continue}try{let b=await w.handler(r,e,l,a);if(typeof b==="string")r=b;else if(a.debug)console.warn(`Middleware ${w.name} did not return a string`)}catch(b){if(a.debug)console.error(`Error in middleware ${w.name}:`,b);if(a.debug){let S=y("Middleware",`Error in middleware '${w.name}': ${b instanceof Error?b.message:String(b)}`,l,n);r=r.replace(/<body[^>]*>/,`$&
|
|
574
574
|
<div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${g(S)}</div>
|
|
575
|
-
`)}}}return r}async function Zt(n,e,l,a){return Gt(n,e,l,a,"before")}async function Jt(n,e,l,a){return Gt(n,e,l,a,"after")}function Qt(n){return n.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,l,a,h,r)=>{try{let p=h?O(h,{}):{};return
|
|
575
|
+
`)}}}return r}async function Zt(n,e,l,a){return Gt(n,e,l,a,"before")}async function Jt(n,e,l,a){return Gt(n,e,l,a,"after")}function Qt(n){return n.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,l,a,h,r)=>{try{let p=h?O(h,{}):{};return Sr(a,p,r==="true")}catch(p){return console.error(`Error processing @route directive: ${p}`),"#route-error"}})}var Ue={patterns:[],exact:{}};async function Yt(n,e){let l=n.split("/").pop()?.split(".")[0]||"";if(Ue.exact[n])for(let a of Ue.exact[n])await Promise.resolve(a(e,n));if(Ue.exact[l])for(let a of Ue.exact[l])await Promise.resolve(a(e,n));for(let{pattern:a,callback:h}of Ue.patterns)if(a.test(n)||a.test(l))await Promise.resolve(h(e,n))}var yn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wn=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]);function _e(n,e){let l=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;l.lastIndex=e;let a=l.exec(n);if(!a)return null;let h=/\/\s*>$/.test(a[0])||a[1]===a[1].toLowerCase()&&yn.has(a[1]),r=h?a[2].replace(/\/\s*$/,""):a[2];return{full:a[0],tag:a[1],attrs:r,selfClosing:h,start:a.index,end:a.index+a[0].length}}function xn(n,e,l){let a=1,h=l,r=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),p=new RegExp(`</${e}\\s*>`,"gi");while(a>0&&h<n.length){r.lastIndex=h,p.lastIndex=h;let w=r.exec(n),b=p.exec(n);if(!b)return-1;if(w&&w.index<b.index)a++,h=w.index+w[0].length;else{if(a--,a===0)return b.index+b[0].length;h=b.index+b[0].length}}return-1}function Ee(n,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let l=xn(n,e.tag,e.end);if(l===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:l,innerHTML:n.slice(e.end,l-`</${e.tag}>`.length)}}function er(n,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(n)||n.includes(` ${e}=`)||n.includes(` ${e} `)||n.trimEnd().endsWith(` ${e}`)}function We(n,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=n.match(new RegExp(`${l}="([^"]*)"`,"s"))||n.match(new RegExp(`${l}='([^']*)'`,"s"));return a?a[1]:null}function ke(n,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return n.replace(new RegExp(`\\s*${l}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${l}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${l}(?=\\s|$|>|/)`,"g"),"")}function Oe(n,e,l){let a=e.selfClosing?" /":"",h=`<${e.tag}${l}${a}>`;return n.slice(0,e.start)+h+n.slice(e.end)}function kn(n){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(n)}function En(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-for");if(h===null){l=a.end;continue}let r=h.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!r){l=a.end;continue}let p=r[1].trim(),w=r[2].trim(),b;if(p.includes(",")){let L=p.split(",").map((F)=>F.trim()),j=L[0],B=L[1];b=`${w} as ${B} => ${j}`}else b=`${w} as ${p}`;let S=ke(a.attrs,"v-for"),v=ke(S,":key").replace(/\s*v-bind:key="[^"]*"/g,""),k=Ee(e,a),C=e.slice(k.outerStart,k.outerEnd),_=Oe(C,{...a,start:0,end:a.end-a.start},v),P=`@foreach(${b})
|
|
576
576
|
`,I=`${P}${_}
|
|
577
|
-
@endforeach`;e=e.slice(0,k.outerStart)+I+e.slice(k.outerEnd),l=k.outerStart+P.length}return e}function
|
|
577
|
+
@endforeach`;e=e.slice(0,k.outerStart)+I+e.slice(k.outerEnd),l=k.outerStart+P.length}return e}function _n(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-if");if(h===null){l=a.end;continue}let r=[],p=Ee(e,a),w=ke(a.attrs,"v-if"),b=Oe(e.slice(p.outerStart,p.outerEnd),{...a,start:0,end:a.end-a.start},w);r.push({type:"if",expr:h,outerStart:p.outerStart,outerEnd:p.outerEnd,element:b,parsedTag:a});let S=p.outerEnd,v=!0;while(v){let I=e.slice(S).match(/^\s*/),L=I?I[0].length:0,j=_e(e,S+L);if(!j){v=!1;break}let B=We(j.attrs,"v-else-if"),F=er(j.attrs,"v-else");if(B!==null){let q=Ee(e,j),H=ke(j.attrs,"v-else-if"),N=Oe(e.slice(q.outerStart,q.outerEnd),{...j,start:0,end:j.end-j.start},H);r.push({type:"else-if",expr:B,outerStart:S,outerEnd:q.outerEnd,element:N,parsedTag:j}),S=q.outerEnd}else if(F){let q=Ee(e,j),H=ke(j.attrs,"v-else"),N=Oe(e.slice(q.outerStart,q.outerEnd),{...j,start:0,end:j.end-j.start},H);r.push({type:"else",outerStart:S,outerEnd:q.outerEnd,element:N,parsedTag:j}),v=!1}else v=!1}let k=[];for(let I of r)if(I.type==="if")k.push(`@if(${I.expr})
|
|
578
578
|
${I.element}`);else if(I.type==="else-if")k.push(`@elseif(${I.expr})
|
|
579
579
|
${I.element}`);else k.push(`@else
|
|
580
580
|
${I.element}`);k.push("@endif");let C=k.join(`
|
|
581
|
-
`),_=r[0].outerStart,P=r[r.length-1].outerEnd;e=e.slice(0,_)+C+e.slice(P),l=_+C.length}return e}function
|
|
581
|
+
`),_=r[0].outerStart,P=r[r.length-1].outerEnd;e=e.slice(0,_)+C+e.slice(P),l=_+C.length}return e}function Tn(n){return n.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function Rn(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=wn.has(a.tag),r=a.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(w,b,S)=>{let v=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(b);if(!v||!S||!/^["']/.test(S))return w;let k=v[1]||"modelValue",C=v[2];if(h&&!v[1])return`@model${C}=${S}`;let _=S[0],P=S.slice(1,-1),I=`:${k}=${S} @update:${k}=${_}${P} = $event${_}`;if(C){let L=v[1]?`${k}Modifiers`:"modelModifiers",j=C.slice(1).split(".").map((B)=>`${B}: true`).join(", ");I+=` :${L}="{ ${j} }"`}return I});if(r===a.attrs){l=a.end;continue}let p=Oe(a.full,{...a,start:0,end:a.full.length},r);e=e.slice(0,a.start)+p+e.slice(a.end),l=a.start+p.length}return e}function Mn(n){return n.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Dn(n){return n.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function On(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-html");if(h===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let r=Ee(e,a),p=ke(a.attrs,"v-html"),w=a.selfClosing?" /":"",b=`<${a.tag}${p}${w}>{!! ${h} !!}</${a.tag}>`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function Ln(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;let h=We(a.attrs,"v-text");if(h===null){l=a.end;continue}if(a.selfClosing){l=a.end;continue}let r=Ee(e,a),p=ke(a.attrs,"v-text"),w=a.selfClosing?" /":"",b=`<${a.tag}${p}${w}>{{ ${h} }}</${a.tag}>`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function jn(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 Hn(n){let e=n,l=0;while(l<e.length){let a=_e(e,l);if(!a)break;if(!er(a.attrs,"v-once")){l=a.end;continue}let h=ke(a.attrs,"v-once"),r=Ee(e,a),p=e.slice(r.outerStart,r.outerEnd),b=`@once
|
|
582
582
|
${Oe(p,{...a,start:0,end:a.end-a.start},h)}
|
|
583
|
-
@endonce`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function Nn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Bn(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 tr(n){if(!
|
|
584
|
-
<meta name="stx-build" content="${e}">`}var
|
|
583
|
+
@endonce`;e=e.slice(0,r.outerStart)+b+e.slice(r.outerEnd),l=r.outerStart+b.length}return e}function Nn(n){return n.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function Bn(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 tr(n){if(!kn(n))return n;let e=n;return e=En(e),e=_n(e),e=Hn(e),e=Mn(e),e=Dn(e),e=Rn(e),e=Tn(e),e=Bn(e),e=On(e),e=Ln(e),e=jn(e),e=Nn(e),e}function Je(n){return n.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var at=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"]),Fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function rr(n,e){let l=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n),a=l?l[1]:n,h=d(a,e);if(h&&typeof h==="string")return h;let r=a.trim();return at.has(r)?r:null}function nr(n){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(n);return e?e[1]:n}function sr(n,e,l){let a=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),h=a?`<${n} ${a}>`:`<${n}>`;if(Fn.has(n))return a?`<${n} ${a}>`:`<${n}>`;return`${h}${l}</${n}>`}async function ir(n,e,l,a,h){let r=n,p=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,w=[],b;while((b=p.exec(r))!==null)w.push({full:b[0],expr:b[1],attrs:b[2],slotContent:b[3],index:b.index});for(let S=w.length-1;S>=0;S--){let v=w[S];try{let k=rr(v.expr,e);if(!k||typeof k!=="string"){let B=`<!-- dynamic component: could not resolve "${Je(nr(v.expr))}" -->`;r=r.slice(0,v.index)+B+r.slice(v.index+v.full.length);continue}if(at.has(k)){let B=sr(k,v.attrs,v.slotContent);r=r.slice(0,v.index)+B+r.slice(v.index+v.full.length);continue}let C=v.attrs.trim(),_={},P=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,I;while((I=P.exec(C))!==null){let B=I[1]||I[2],F=I[3];if(I[1])try{_[B]=d(F,e)}catch{_[B]=F}else _[B]=F}let L=a.componentsDir||"components",j=await qe(k,_,v.slotContent,L,e,l,a,new Set,h??new Set);r=r.slice(0,v.index)+j+r.slice(v.index+v.full.length)}catch(k){let C=k instanceof Error?k.message:String(k),_=`<!-- dynamic component error: ${Je(C)} -->`;r=r.slice(0,v.index)+_+r.slice(v.index+v.full.length)}}return r=await Un(r,e,l,a,h),r}async function Un(n,e,l,a,h){let r=n,p=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,w=[],b;while((b=p.exec(r))!==null)w.push({full:b[0],expr:b[1],attrs:b[2],index:b.index});for(let S=w.length-1;S>=0;S--){let v=w[S];try{let k=rr(v.expr,e);if(!k||typeof k!=="string"){let P=`<!-- dynamic component: could not resolve "${Je(nr(v.expr))}" -->`;r=r.slice(0,v.index)+P+r.slice(v.index+v.full.length);continue}if(at.has(k)){let P=sr(k,v.attrs,"");r=r.slice(0,v.index)+P+r.slice(v.index+v.full.length);continue}let C=a.componentsDir||"components",_=await qe(k,{},"",C,e,l,a,new Set,h??new Set);r=r.slice(0,v.index)+_+r.slice(v.index+v.full.length)}catch(k){let C=k instanceof Error?k.message:String(k),_=`<!-- dynamic component error: ${Je(C)} -->`;r=r.slice(0,v.index)+_+r.slice(v.index+v.full.length)}}return r}var wc="X-STX-Build",ct=Symbol.for("stx.buildId");function gs(){let n=globalThis;if(!n[ct])n[ct]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return n[ct]}function or(n,e=gs()){if(n.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(n))return null;return`
|
|
584
|
+
<meta name="stx-build" content="${e}">`}var Wo="/_stx/sw.js";function qn(n){if(typeof n!=="string"||!n.startsWith("/"))return null;let e=[],l=[],a=n.replace(/\/+$/,"").split("/").slice(1).map((h)=>{let r=/^:(\w+)$/.exec(h)||/^\[(\w+)\]$/.exec(h);if(r)return e.push(r[1]),l.push("0"),"([^/]+)";return l.push(h),h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")});if(!e.length)return null;return{path:n,re:`^/${a.join("/")}/?$`,names:e,sample:`/${l.join("/")}`}}function Vn(n){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,l=window;if(l.stxOffline)return;let a=null,h=!1,r=[],p={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>a,onUpdateReady(v){if(p.updateReady)try{v()}catch{}else r.push(v);return()=>{let k=r.indexOf(v);if(k!==-1)r.splice(k,1)}},applyUpdate(){let v=a&&a.waiting;if(!v)return!1;return h=!0,v.postMessage({type:"stx:activate-update",force:!0}),!0}};l.stxOffline=p;let w=(v)=>{if(!v.waiting||!e.controller||p.updateReady)return;p.updateReady=!0;let k=r.splice(0);for(let C of k)try{C()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(v)=>{let k=v.data||{};if(k.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:k.url,kind:k.kind,fragment:!!k.fragment}}))}catch{}if(k.type==="stx:reachability"){if(l.stxOffline.reachable=k.reachable!==!1,Number(k.at)>0)l.stxOffline.reachedAt=Number(k.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:k.reachable!==!1,at:Number(k.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(h)h=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&a&&a.waiting)a.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let b=()=>{e.register(n,{scope:"/"}).then((v)=>{a=v;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(v.waiting)w(v),v.waiting.postMessage({type:"stx:activate-update",reason:"load"});v.addEventListener("updatefound",()=>{let k=v.installing;if(!k)return;k.addEventListener("statechange",()=>{if(k.state==="installed")w(v)})})}).catch(()=>{})},S=()=>{let v=(k)=>{setTimeout(k,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>v(b));else v(b)};if(!e.controller)if(document.readyState==="complete")S();else addEventListener("load",S);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",S);else S()}function Wn(){let n=`(${Vn.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim().replace(/;$/,"")}catch{return n}}function Xn(n,e){if(typeof e==="string"&&e.startsWith("/"))return e==="/"?"/":e.replace(/\/+$/,"");if(!n||!n.startsWith("/"))return null;let l=n.split(/[?#]/)[0].split("/").filter(Boolean)[0];return l?`/${l}`:"/"}var ar=`<script data-stx-offline>${Wn()}</script>`;function qo(n,e){let l=Number(n.precacheTimeoutMs),a={build:String(e||"dev"),pages:Array.from(new Set((n.pages||[]).filter((h)=>typeof h==="string"&&h.startsWith("/")))),staticPages:(n.staticPages||[]).filter((h)=>typeof h==="string"&&((n.pages||[]).includes(h)||(n.routes||[]).includes(h))),api:n.apiPrefix||"/api/",timeout:Math.max(500,Number(n.networkTimeoutMs)||1500),precacheTimeout:Number.isFinite(l)&&l>0?Math.min(2147483647,Math.max(1,Math.floor(l))):1e4,networkFirst:(n.networkFirst||[]).filter((h)=>typeof h==="string"&&h.startsWith("/")),updateOnColdStart:n.updateOnColdStart===!0,fallback:n.fallback||n.pages&&n.pages[0]||null,fallbackScope:Xn(n.fallback||n.pages&&n.pages[0]||null,n.fallbackScope),routes:(n.routes||[]).map(qn).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)};
|
|
587
587
|
var SHELL = 'stx-shell-' + S.build;
|
|
@@ -1285,43 +1285,43 @@ self.addEventListener('fetch', function (event) {
|
|
|
1285
1285
|
event.respondWith(pageResponse(request, event));
|
|
1286
1286
|
}
|
|
1287
1287
|
});
|
|
1288
|
-
`}import Le from"path";function
|
|
1289
|
-
`+" `import.meta.env.STX_PUBLIC_*` is substituted at build time and is safe; anything else is not.\n Fix it by moving the module-only code (`import.meta.glob`, `import.meta.url`) into its own module, or by resolving the value without `import.meta`.");throw l[dr]=!0,l}async function pr(n,e,l){let a=n,h=Le.dirname(e),r=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,p;while((p=r.exec(a))!==null){let[S,v,k,C]=p;if(
|
|
1288
|
+
`}import Le from"path";function cr(n){return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("//")}async function ur(n,e,l){try{let a;if(n.startsWith("/")){let h=e;for(let r=0;r<5;r++){let p=Le.join(h,n);if(await Bun.file(p).exists())return p;h=Le.dirname(h)}a=Le.join(e,n)}else if(n.startsWith("./")||n.startsWith("../"))a=Le.resolve(e,n);else a=Le.resolve(e,n);if(await Bun.file(a).exists())return a;return null}catch{return null}}var dr=Symbol.for("stx.inline-assets.import-meta");function zn(n,e){if(!n.includes("import.meta"))return;let l=Error(`[stx] ${e} still references \`import.meta\` after bundling, and it is being inlined as a classic <script> where that is a SyntaxError \u2014 the whole script fails to parse, taking every other script on the page with it.
|
|
1289
|
+
`+" `import.meta.env.STX_PUBLIC_*` is substituted at build time and is safe; anything else is not.\n Fix it by moving the module-only code (`import.meta.glob`, `import.meta.url`) into its own module, or by resolving the value without `import.meta`.");throw l[dr]=!0,l}async function pr(n,e,l){let a=n,h=Le.dirname(e),r=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,p;while((p=r.exec(a))!==null){let[S,v,k,C]=p;if(cr(k))continue;let _=await ur(k,h,e);if(_)try{let P=await Bun.file(_).text();if(l.add(_),k.endsWith(".ts")||k.endsWith(".tsx")){let L=await Bun.build({entrypoints:[_],target:"browser",minify:!0,define:T()});if(L.outputs.length>0)P=await L.outputs[0].text(),zn(P,k)}let I=`<script>
|
|
1290
1290
|
// Source: ${k}
|
|
1291
1291
|
${P}
|
|
1292
|
-
</script>`;a=a.replace(S,I),r.lastIndex=0}catch(P){if(P?.[dr])throw P}}let w=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,b;while((b=w.exec(a))!==null){let[S,v,k,C]=b,_=v+C;if(
|
|
1292
|
+
</script>`;a=a.replace(S,I),r.lastIndex=0}catch(P){if(P?.[dr])throw P}}let w=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,b;while((b=w.exec(a))!==null){let[S,v,k,C]=b,_=v+C;if(cr(k))continue;if(/rel=["']stylesheet["']/.test(_)||k.endsWith(".css")){let I=await ur(k,h,e);if(I)try{let L=await Bun.file(I).text();l.add(I);let j=`<style>
|
|
1293
1293
|
/* Source: ${k} */
|
|
1294
1294
|
${L}
|
|
1295
|
-
</style>`;a=a.replace(S,j),w.lastIndex=0}catch(L){}}}return a}import lt from"path";var Kn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Gn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function Zn(n,e){if(!e||!n.includes("/"))return n;let l=lt.dirname(e);return n.replace(Kn,(a,h,r,p)=>{let w=lt.resolve(l,p);return`${h}${r}${w.split(lt.sep).join("/")}${r}`})}function fr(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Gn,(l,a,h,r)=>`${a}${Zn(h,e)}${r}`)}var
|
|
1295
|
+
</style>`;a=a.replace(S,j),w.lastIndex=0}catch(L){}}}return a}import lt from"path";var Kn=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,Gn=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function Zn(n,e){if(!e||!n.includes("/"))return n;let l=lt.dirname(e);return n.replace(Kn,(a,h,r,p)=>{let w=lt.resolve(l,p);return`${h}${r}${w.split(lt.sep).join("/")}${r}`})}function fr(n,e){if(!e||!n.includes("<script"))return n;return n.replace(Gn,(l,a,h,r)=>`${a}${Zn(h,e)}${r}`)}var Te="<!--PARENT_CONTENT_PLACEHOLDER-->";function gr(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Er(n,e){let l=n.length,a=e,h=!0,r=[],p=(w)=>w+9<=l&&n[w]==="<"&&n[w+1]==="/"&&(n[w+2]==="s"||n[w+2]==="S")&&(n[w+3]==="c"||n[w+3]==="C")&&(n[w+4]==="r"||n[w+4]==="R")&&(n[w+5]==="i"||n[w+5]==="I")&&(n[w+6]==="p"||n[w+6]==="P")&&(n[w+7]==="t"||n[w+7]==="T")&&(n[w+8]===">"||/\s/.test(n[w+8]));while(a<l){let w=n[a];if(p(a))return a;if(w==="/"&&n[a+1]==="/"){if(a=n.indexOf(`
|
|
1296
1296
|
`,a+2),a===-1)return-1;a+=1,h=!0;continue}if(w==="/"&&n[a+1]==="*"){let b=n.indexOf("*/",a+2);if(b===-1)return-1;a=b+2,h=!0;continue}if(w==="/"&&h){let b=a+1,S=!1;while(b<l){let v=n[b];if(v==="\\"){b+=2;continue}if(v==="[")S=!0;else if(v==="]")S=!1;else if(v==="/"&&!S){b++;break}else if(v===`
|
|
1297
1297
|
`){b=-1;break}b++}if(b===-1){a++,h=!1;continue}while(b<l&&/[a-z]/.test(n[b]))b++;a=b,h=!1;continue}if(w==="'"||w==='"'){let b=w;a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]===b){a++;break}if(n[a]===`
|
|
1298
|
-
`)break;a++}h=!1;continue}if(w==="`"){a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,h=!0;break}a++}if(r.length===0)h=!1;continue}if(w==="}"&&r.length>0){r.pop(),a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,h=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,h=!0;break}a++}continue}if(/\s/.test(w));else if(/[)\].\w$]/.test(w))h=!1;else h=!0;a++}return-1}function
|
|
1299
|
-
`+n.slice(a,l.start)+n.slice(l.end);let h=n.slice(l.start,l.end),r=n.slice(0,l.start)+n.slice(l.end),p=
|
|
1298
|
+
`)break;a++}h=!1;continue}if(w==="`"){a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,h=!0;break}a++}if(r.length===0)h=!1;continue}if(w==="}"&&r.length>0){r.pop(),a++;while(a<l){if(n[a]==="\\"){a+=2;continue}if(n[a]==="`"){a++,h=!1;break}if(n[a]==="$"&&n[a+1]==="{"){r.push(!0),a+=2,h=!0;break}a++}continue}if(/\s/.test(w));else if(/[)\].\w$]/.test(w))h=!1;else h=!0;a++}return-1}function Cr(n,e){let l=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`<script\\b(?=[^>]*\\b${l}(?:\\s|=|/?>))[^>]*>`,"i").exec(n);if(!a)return null;let h=a.index+a[0].length,r=n.indexOf("</script>",h);if(r===-1)return null;let p=n.indexOf(">",r);if(p===-1)return null;return{start:a.index,end:p+1}}var Qn=4096;async function ut(n,e,l){if(l.buildMode!=="serve"||e.length<Qn)return null;let{registerServeModuleBundle:a}=await import("./chunk-6rqef7wp.js");return`<script ${n} src="${a(e)}"></script>`}async function lr(n,e,l,a){try{let{registeredModuleIdsIn:h,buildModuleRegistryScript:r}=await o("stx/client-module-registry",()=>import("./chunk-a262spx7.js")),p=[],w=await r(h(...n),{minify:Ui(e.buildMode,e.minifyClient),collectInputs:p});for(let b of p)l?.add(b);if(a)a.inputs=p,a.code=w??void 0;if(!w)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:b}=await import("./chunk-6rqef7wp.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${b(w)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${w.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}async function Yn(n,e,l,a){let h={modulesTag:null,modulesCode:null,storeTag:null,storeCode:null,composableTag:null,composableCode:null,frameworkScript:null};try{let{getFrameworkComposableScript:C}=await o("stx/framework-composables",()=>import("./chunk-b61dq7pz.js"));h.frameworkScript=await C(n)}catch{}let r=null;try{r=await o("stx/store-loader",()=>import("./chunk-wkb7dhp7.js"))}catch{}let p=e.storesDir,w=!!a.__stx_native_screen||(r?.pageStoresAll()??!0),b=w?"":n.replace(/<script\b[^>]*\bdata-stx-(?:runtime|router|hmr)\b[^>]*>[\s\S]*?<\/script>/gi,""),S=[],v=[],k=null;for(let C=0;C<8;C++){let _=null,P="",I=!1;try{if(r){let F=w?await r.getStoreScript(p).then((q)=>q?{code:q,stores:["*"],functions:null}:null):await r.getStoreScriptFor(p,[b],{reads:r.storesReadInFiles([...S,...v]),runOnce:!0});if(F)_=F.code,P=F.stores.join(","),I=!!F.functions&&!w}}catch{}if(k!==null&&P===k)break;k=P;let L=I?'data-stx-scoped data-stx-run="always" data-stx-stores':"data-stx-stores",j=_?`<script ${L}>${_}</script>`:null;h.storeCode=_,h.storeTag=_?await ut(L,_,e)??j:null;let B={};h.modulesTag=await lr([n,j],e,l,B),h.modulesCode=B.code??null,S=B.inputs??[],h.composableTag=null,h.composableCode=null,v=[];try{let{getComposableScript:F}=await o("stx/composable-loader",()=>import("./chunk-a8wn0snv.js")),q=e.composablesDir,H=[h.modulesCode??h.modulesTag,j,h.frameworkScript].filter((U)=>U!==null),N=await F(e._layerComposableDirs??q,n,H,v);if(N)h.composableCode=N,h.composableTag=await ut('data-stx-scoped data-stx-run="always" data-stx-composables',N,e)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${N}</script>`}catch{}if(w||!r)break}return h}async function es(n,e,l,a={}){let{withModuleSubstitutes:h,moduleSubstitutionKey:r}=await import("./chunk-em31p5pb.js"),p=await import("./chunk-ne8q191s.js"),{messages:w,webModules:b}=e,S=null,v=null,k=r()===""&&!a.__stx_native_screen;if(w&&p.pageMessagesEnabled(e)&&k)try{S=await p.loadPageMessages(process.cwd(),w)}catch(L){ts(L)}if(b&&Object.keys(b).length&&k)try{v=await(await import("./chunk-eknm4jrm.js")).loadWebModules(process.cwd(),b)}catch(L){rs(L)}let C=new Map([...v??[],...S?.stubs??[]]),_=()=>Yn(n,e,l,a),P=C.size?await h(C,_):await _(),I=null;if(S){let L=p.messageAreasIn(P.modulesCode,P.storeCode,P.composableCode),j=p.pageMessagesScript(S,p.pageLanguages(n,S),L);if(j)I=await ut('data-stx-scoped data-stx-run="always" data-stx-messages',j,e)??`<script data-stx-scoped data-stx-run="always" data-stx-messages>${j.replace(/<\/script/gi,"<\\/script")}</script>`}return[I,P.modulesTag,P.storeTag,P.composableTag,P.frameworkScript].filter((L)=>L!==null)}var yr=!1;function ts(n){if(yr)return;yr=!0,console.warn(`[stx] messages: ${n instanceof Error?n.message:String(n)}; pages ship every language`)}var br=!1;function rs(n){if(br)return;br=!0,console.warn(`[stx] ${n instanceof Error?n.message:String(n)}; pages bundle the real modules`)}function ns(n,e=""){let l=Cr(n,"data-stx-runtime");if(!l)return n;let a=mr(n);if(a===-1||a===l.start){if(!e)return n;return n.slice(0,l.end)+e+n.slice(l.end)}if(a<l.start)return n.slice(0,a)+n.slice(l.start,l.end)+e+`
|
|
1299
|
+
`+n.slice(a,l.start)+n.slice(l.end);let h=n.slice(l.start,l.end),r=n.slice(0,l.start)+n.slice(l.end),p=mr(r);if(p===-1)return h+e+`
|
|
1300
1300
|
`+r;return r.slice(0,p)+h+e+`
|
|
1301
|
-
`+r.slice(p)}function ss(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(l,a,h)=>{let r=n.slice(0,h);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,l,a,h){if(await E(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=
|
|
1302
|
-
`),...S.htmlAttrs&&{htmlAttrs:
|
|
1303
|
-
<meta name="stx-layout" content="${
|
|
1304
|
-
<meta name="stx-layout-group" content="${
|
|
1305
|
-
${S}`).join(""))}else{let b=await
|
|
1306
|
-
`+p.slice(S)}}if(r)p=
|
|
1301
|
+
`+r.slice(p)}function ss(n){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return n.replace(e,(l,a,h)=>{let r=n.slice(0,h);return r.lastIndexOf("<")>r.lastIndexOf(">")?`{{${a}}}`:`{<!--stx-literal-->{${a}}}`})}async function i(n,e,l,a,h){if(await E(),a.ssr===!1&&!a.autoShell&&a.buildMode==="spa")return n;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=Re(n,l);let r=!e.__stxProcessingDepth;Sn(e);for(let p of a._layerGraph?.configDependencies??[])h.add(p);if(r&&a.runtimeConfig)await $n(e,l,a.runtimeConfig);if(r)il(e),e.__stx_scope_seq??={n:0,key:Qs(String(e.__filename??l))},e.__stx_head_injections=zi(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((a.debug||!A()&&!In())&&l&&l.endsWith(".stx"))Ko(n,l);try{return await me.timeAsync("template-processing",async()=>{let p=await is(n,e,l,a,h);if(r)p=$i(p);if(r&&a.autoShell&&a.buildMode!=="compile"){let w=Pe(a.app?.head,{known:Fr,source:"app.head"}),S=(e.__stx_runtime_head||null)??Vi(),v=(e.__stx_head_raw||"").trim(),k,C=v.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(C)k=C[1].trim(),v=v.replace(C[0],"").trim();let _=e.__sections?.title,P=_?R(_,e,l):void 0,I=S.title||k||P,L=!S.title&&(!!k||!!P),j=S.meta||[],B=new Set(j.map((G)=>pt(G)).filter(Boolean)),F={...w,...I&&{title:I},meta:[...(w.meta||[]).filter((G)=>!B.has(pt(G))),...j],link:[...w.link||[],...S.link||[]],script:[...w.script||[],...S.script||[]],headRaw:[w.headRaw,v].filter(Boolean).join(`
|
|
1302
|
+
`),...S.htmlAttrs&&{htmlAttrs:kl(w.htmlAttrs,S.htmlAttrs)},...S.bodyAttrs&&{bodyAttrs:{...w.bodyAttrs||{},...S.bodyAttrs}}},q=Hi(p);if(p=jr(p,F,{...L&&{titleIsHtml:!0},...a.app?.colorMode&&{colorMode:a.app.colorMode}},q),q)p=Cl(p,w),p=Lr(p,F.htmlAttrs);let H=p.match(/<!-- stx-layout: ([^ ]+) -->/);if(H&&p.includes("<head")){let G=H[1],le=js(G);p=p.replace(/<head\b[^>]*>/i,(Z)=>`${Z}
|
|
1303
|
+
<meta name="stx-layout" content="${gr(G)}">
|
|
1304
|
+
<meta name="stx-layout-group" content="${gr(le)}">`)}let N=p.match(/function (__stx_setup_\w+)\(/),U=N?V(p):null;if(N&&U&&!/\bdata-stx=/.test(U.tag)){p=rt(p,(le,Z)=>`<body${Z} data-stx="${N[1]}">`);let G=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${N[1]}"`,"i");p=p.replace(G,"$1")}}if(r){let w=e.__stx_head_injections??zi(),b=_l(p);if(b!==null)w.beforeClose.push(b);let S=or(p);if(S!==null)w.afterOpen.push(S);if(a.offline?.enabled&&!p.includes("data-stx-offline"))w.beforeClose.push(ar);p=xl(p,w);let v=a.app?.colorMode;if(v)p=Mr(p,v)}if(r)if(Cr(p,"data-stx-runtime")){let b=await es(p,a,h,e);p=ns(p,b.map((S)=>`
|
|
1305
|
+
${S}`).join(""))}else{let b=await lr([p],a,h);if(b){let S=p.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(S!==-1)p=p.slice(0,S)+b+`
|
|
1306
|
+
`+p.slice(S)}}if(r)p=Sl(p);if(r&&e.__stx_inject_css!==!1)p=await x(p,void 0,a.buildMode==="serve",!0);else if(r)p=vn(p);if(r)p=mt(p);if(p=p.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),p=ss(p),r&&e.__stx_runtime_config)p=Ht(p,e.__stx_runtime_config);if(r&&!e.__stx_defer_server_data){let w=Ir(e);if(w){let b=/<head\b[^>]*>/i.exec(p),S=b?b.index+b[0].length:0;p=p.slice(0,S)+w+p.slice(S)}}return p})}catch(p){if(p instanceof Y)throw p;let w=p instanceof Error?p.message:String(p),b=new oe(`Template processing failed: ${w}`,l,void 0,void 0,n.substring(0,200)+(n.length>200?"...":""));if(W.log(b,{filePath:l,context:e}),An.logDetailedError(b,{filePath:l,template:n.substring(0,500)}),A()&&!a.debug)console.error(`[stx] ${ae.relative(process.cwd(),l)||l}: ${b.message}`);if(a.debug)throw b;return Bi.createFallbackContent("Template Processing",b)}}async function is(n,e,l,a,h){let r=process.cwd(),p={...a,partialsDir:a.partialsDir&&!ae.isAbsolute(a.partialsDir)?ae.resolve(r,a.partialsDir):a.partialsDir,componentsDir:a.componentsDir&&!ae.isAbsolute(a.componentsDir)?ae.resolve(r,a.componentsDir):a.componentsDir,layoutsDir:a.layoutsDir&&!ae.isAbsolute(a.layoutsDir)?ae.resolve(r,a.layoutsDir):a.layoutsDir},w=p,b=n;await cs(l,e),as(e,w),b=await Ae(()=>Zt(b,e,l,w),b,(H)=>{W.log(H,{filePath:l,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${l}: ${H.message}`)}),b=b.replace(/\{\{--[\s\S]*?--\}\}/g,"");let S=we(b,ze,(H,N)=>`\x00STX_HTML_COMMENT_${N}\x00`);b=S.output;let v=S.tokens,k=(H)=>v.length===0?H:H.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(N,U)=>v[Number(U)]??""),C="\x00STX_ESCAPED_AT\x00",_="\x00STX_ESC_MUSTACHE_OPEN\x00",P="\x00STX_ESC_MUSTACHE_CLOSE\x00";b=b.replace(/@@/g,C),b=b.replace(/@\{\{([\s\S]*?)\}\}/g,(H,N)=>`${_}${N}${P}`),b=tr(b),b=await pr(b,l,h);let I={};b=hs(b,I);let L={...e.__sections||{}},j="",B=xt(kt(n)),F=/@nolayout\b/.test(b)||B===!1;if(/@nolayout\b/.test(b))b=b.replace(/@nolayout\b\s*/g,"");let q=b.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(q)j=q[1],b=b.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof B==="string"){if(j=B,!/@section\s*\(/.test(b))b=`@section('content')
|
|
1307
1307
|
${b.trim()}
|
|
1308
|
-
@endsection`}if(!j&&!F&&w.defaultLayout){let H=
|
|
1308
|
+
@endsection`}if(!j&&!F&&w.defaultLayout){let H=Pn(b),N=/@section\s*\(/.test(b);if(!H||N){let U="",G=ae.dirname(l),le=w.layoutsDir?ae.dirname(w.layoutsDir):process.cwd();for(let Z=0;Z<20;Z++){let ue=ae.join(G,"_layout.stx");if(await s(ue)){U=ue;break}let ce=ae.dirname(G);if(ce===G||ce.length<le.length)break;G=ce}if(U)j=U;else if(w.layoutsDir){let Z=ae.isAbsolute(w.layoutsDir)?w.layoutsDir:ae.resolve(process.cwd(),w.layoutsDir),ue=ae.join(Z,`${w.defaultLayout}.stx`);if(await s(ue))j=ue}if(j&&!N)b=`@section('content')
|
|
1309
1309
|
${b.trim()}
|
|
1310
|
-
@endsection`}}if(j&&b.includes("<script")){let H=
|
|
1310
|
+
@endsection`}}if(j&&b.includes("<script")){let H=ee(b),N=H.scripts.map((U)=>vr(U,l)??U);b=Tr(H.output,N)}if(b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(H,N,U)=>(L[N]=U,"")),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(H,N,U)=>{if(/^(['"]).*\1$/.test(U.trim()))return H;try{let G=d(U.trim(),e);if(G===void 0)return H;let Z=(e.__stx_inline_section_values??=[]).push(G)-1;return L[N]=`{{ __stx_inline_section_values[${Z}] }}`,""}catch{return H}}),b=b.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(H,N,U)=>{if(U.includes("@parent"))L[N]=U.replace("@parent",Te);else L[N]=U.trim();return""}),e.__sections=L,b=b.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(H,N,U)=>L[N]||U||""),!("slot"in e)||e.slot===void 0)b=b.replace(/\{\{\s*slot\s*\}\}/g,()=>L.content||"");if(b=ys(b,I),j){let H=[],N=ee(b),U=we(N.output,bn,(G,le)=>`\x00STX_ORPHAN_STYLE_${le}\x00`);if(b=U.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(G,le,Z)=>{let ue=le==="SCRIPT"?vr(N.scripts[Number(Z)],l):U.tokens[Number(Z)];if(ue)H.push(ue);return""}),H.length>0){let G=H.join(`
|
|
1311
1311
|
`);L.content=L.content?`${L.content}
|
|
1312
|
-
${
|
|
1313
|
-
${b}`,k(b)}catch(H){if(H instanceof
|
|
1314
|
-
`;if(r=
|
|
1312
|
+
${G}`:G,e.__sections=L}}if(j)try{let H;if(ae.isAbsolute(j))H=j,h.add(j);else H=await Ae(()=>Cn(j,l,p,h),null,()=>{throw new oe(`Failed to resolve layout path: ${j}`,l,void 0,void 0,`Layout referenced from ${l}`)});if(!H){let ce=(J)=>{if(!J)return[];try{let ve=ae.isAbsolute(J)?J:ae.resolve(process.cwd(),J);return Jn.readdirSync(ve).filter((Se)=>Se.endsWith(".stx")).map((Se)=>Se.replace(/\.stx$/,""))}catch{return[]}},ne=[...ce(p.layoutsDir),...ce(p.fallbackLayoutsDir)].filter((J,ve,Se)=>Se.indexOf(J)===ve).sort(),be=[p.layoutsDir,p.fallbackLayoutsDir].filter((J)=>typeof J==="string"&&J.length>0),fe=be.length>0?` Searched: ${be.join(", ")} (set \`layoutsDir\` to look elsewhere).`:"",se=`Layout not found: ${j} (referenced from ${l})`+(ne.length>0?`. Available layouts: ${ne.join(", ")}`:p.layoutsDir?`. No .stx layouts found in ${p.layoutsDir}`:"")+fe;if(W.log(Error(se),{layoutPath:j,filePath:l,available:ne},"error"),console.error(`[stx] ${se}`),p.debug)throw new oe(se,l);return b}let N=await Ae(()=>Bun.file(H).text(),"",()=>{throw new oe(`Failed to read layout file: ${H}`,l,void 0,void 0,"Layout content could not be loaded")});N=fr(N,H),N=N.replace(/\{\{--[\s\S]*?--\}\}/g,"");let U=Array.isArray(e.__layoutChain)?e.__layoutChain:[];if(U.includes(H)){let ce=[...U.slice(U.indexOf(H)),H];throw new oe(ce.length===2?`Circular layout: ${H} extends itself`:`Circular layout: ${ce.join(" -> ")}`,l,void 0,void 0,"Remove the @extends or @layout line that points back at a layout already in use")}let G=N.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(G){if(p.debug)console.log(`Found nested layout: ${G[1]} in ${H}`);let ce={},ne=N.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(se,J,ve)=>(ce[J]=ve.trim(),""));for(let[se,J]of Object.entries(ce))if(L[se]&&L[se].includes(Te)){let ve=L[se].indexOf(Te);L[se]=L[se].slice(0,ve)+J+L[se].slice(ve+Te.length)}else if(!L[se])L[se]=J;let be={...e,__sections:L,__layoutChain:[...U,H]},fe=`@layout('${G[1]}')${ne}`;return await i(fe,be,H,p,h)}let le=N.replace(/\{\{--[\s\S]*?--\}\}/g,""),Z=hs(le,I),ue={};return Z=Z.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ce,ne,be)=>(ue[ne]=be.trim(),`@slot('${ne}')`)),Z=Z.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ce,ne,be)=>{if(L[ne]){let fe=L[ne];if(fe.includes(Te)){let se=ue[ne]||"",J=fe.indexOf(Te);fe=fe.slice(0,J)+se+fe.slice(J+Te.length)}return fe}return be||""}),Z=os(Z,L),Z=Z.replace(/\{\{\s*slot\s*\}\}/g,()=>L.content||""),Z=ys(Z,I),e.__originalFilePath=l,b=await $r(Z,e,H,p,h),b=`<!-- stx-layout: ${j} -->
|
|
1313
|
+
${b}`,k(b)}catch(H){if(H instanceof Y)throw H;throw new oe(`Error processing layout ${j}: ${H instanceof Error?H.message:String(H)}`,l)}return k(await $r(b,e,l,p,h))}function os(n,e){return n.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(l,a,h)=>{let r=e[a];if(r!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(r))return r}return h||""})}function as(n,e){if(n.__stx_sfc_mode=!0,n.__stx_options=e,e.buildMode)n.__stx_buildMode=e.buildMode;let l=e.envPrefix||"STX_PUBLIC_",a={};for(let[h,r]of Object.entries(process.env))if(h.startsWith(l)&&r!==void 0)a[h]=r;n.$env=a}async function cs(n,e){await Ae(()=>Yt(n,e),void 0,(l)=>{W.log(l,{filePath:n,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${n}: ${l.message}`)})}var dt="data-stx-source";function vr(n,e){if(!n)return n;let l=/^<script\b([^>]*)>/i.exec(n);if(!l||!/\bserver\b/.test(l[1])||l[1].includes(dt))return n;return`<script ${dt}="${encodeURIComponent(e)}"${n.slice(7)}`}function ls(n){let e=new RegExp(`${dt}="([^"]*)"`).exec(n);return e?decodeURIComponent(e[1]):void 0}function xr(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function kr(n,e,l){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">${xr(n)}</span><span style="display:block;margin-top:4px">${xr(l)}</span></div>`}async function us(n,e,l,a){let{scanScriptTags:h}=await o("stx/signal-processing",()=>import("./chunk-7ngfcdv9.js")),r=[],p=!A()&&!In();for(let b of h(n)){let S=b.attrs;if(!/\bserver\b/.test(S))continue;let v=b.start+b.fullMatch.indexOf(">")+1,k=Er(n,v);if(k===-1)continue;let C=n.slice(v,k);if(!C.trim())continue;let _=ls(S)??l,P={index:b.start,length:k+9-b.start};try{let{extractVariables:I}=await o("stx/variable-extractor",()=>import("./chunk-0gv2mmr0.js"));await I(C,e,_,{preserveExisting:!0,onFailure:(L)=>{if(L.kind==="unknown")return;if(a?.onServerScriptError?.({sourcePath:_,kind:L.kind,message:L.message}),!p)return;r.push({...P,markup:kr(_,L.kind,L.message)})}})}catch(I){let L=I instanceof Error?I:Error(String(I));if(W.log(L,{filePath:_,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${_}: ${L.message}`),p)r.push({...P,markup:kr(_,"unknown",L.message)})}}if(r.length===0)return n;let w=n;for(let b of r.sort((S,v)=>v.index-S.index))w=w.slice(0,b.index)+b.markup+w.slice(b.index+b.length);return w}async function ds(n,e,l){try{let{interpolateScriptsInTemplate:a}=await o("stx/expressions",()=>import("./chunk-9e3ggwk7.js"));return a(n,e,{skipServer:!0})}catch(a){let h=a instanceof Error?a:Error(String(a));return W.log(h,{filePath:l,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${l}: ${h.message}`),n}}async function $r(n,e,l,a,h){let r=n;await E();let p=a;if(r=await us(r,e,l,a),r=await Wt(r,e,l),r=await Xt(r,e,l),r=await ds(r,e,l),await E(),r=await Dt(r,e,l,p),Re(r))r=ni(r,e),r=_s(r,e),r=ks(r,e);r=ri(r),await E();let{processStreamDirectives:w}=await o("stx/streaming",()=>import("./chunk-24e4dapm.js"));r=w(r,e),r=await Yo(r,e,l,p,!0),await E(),r=await ir(r,e,l,p,h),r=await ws(r,e,l,p,h),await E(),r=$c(r,e,l,p);let{processDeferDirectives:b}=await o("stx/defer",()=>import("./chunk-kq8mffgf.js"));r=b(r,e,l);let{processTeleportDirectives:S}=await o("stx/teleport",()=>import("./chunk-fa57bncd.js"));r=S(r,e,l);let{processTransitionDirectives:v,processTransitionAttributes:k}=await o("stx/transitions",()=>import("./chunk-h2928108.js"));r=v(r,e,l),r=k(r);let{processErrorBoundaryDirectives:C,stripRenderFailedMarkers:_}=await o("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));r=C(r,e,l),r=_(r);let{processSuspenseDirectives:P}=await o("stx/suspense",()=>import("./chunk-y4hn1qh0.js"));r=P(r,e,l);let{processAsyncDirectives:I}=await o("stx/async-components",()=>import("./chunk-byq488g4.js"));r=I(r,e,l);let{processKeepAliveDirectives:L}=await o("stx/keep-alive",()=>import("./chunk-x76qvq1n.js"));r=L(r,e,l);let{processVirtualListDirectives:j,processVirtualGridDirectives:B,processInfiniteListDirectives:F}=await o("stx/virtual-scrolling",()=>import("./chunk-yfed67yc.js"));r=j(r,e,l),r=B(r,e,l),r=F(r,e,l),await E();let{processPartialHydrationDirectives:q,processStaticDirectives:H}=await o("stx/partial-hydration",()=>import("./chunk-9mz2n39m.js"));r=q(r,e,l),r=H(r);let{processComputedDirectives:N,processWatchDirectives:U}=await o("stx/computed",()=>import("./chunk-1xdzcy9d.js"));r=N(r,e,l),r=U(r,e,l);let{processFormValidationDirectives:G}=await o("stx/forms-validation",()=>import("./chunk-fk79jbzn.js"));r=G(r,e,l);let{processHeadDirective:le,processTitleDirective:Z,processMetaDirective:ue,resetHead:ce}=await o("stx/head",()=>import("./chunk-ts37jw3s.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)ce();let ne=le(r);if(r=ne.content,ne.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${ne.headContent}
|
|
1314
|
+
`;if(r=Z(r,e),r=ue(r,e,l),r=Qt(r),r=Zo(r,e),r=Mt(r),r=Kt(r),r=await ms(r,e,l,p,h),r=await ws(r,e,l,p,h),await E(),r=r.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),r=$i(r),r=de(r,e,l),r=vs(r),await E(),e.__stxProcessingDepth===1)r=al(r,e);if(r=tl(r,e,{filePath:l,buildMode:p.buildMode}),r=Qo(r,e),r=ei(r,e),r=Ze(r,e),r=Ft(r,e),r=Ut(r,e),r=await St(r,e,l,p),r=await Ac(r,e,l),r=await Ic(r,e,l,p),await E(),r=Oc(r,e,l,p),r=ui(r,e,l,p),r=di(r,e,l),r=pi(r,e,l,p),r=At(r,e,l,p),r=Ys(r,e),r=Zs(r),r=rl(r),!p.skipEventDirectives)r=Wc(r,e,l);if(r=nl(r,e,l,a.skipSignalsRuntime===!0&&Number(e.__stxProcessingDepth)>0),await E(),p.debug){let z=/\bx-data\s*=/.test(r),K=Ss(n);if(z&&K)console.warn(`[stx] ${l}: 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=
|
|
1317
|
-
${
|
|
1316
|
+
Prefer signals (state/derived/effect) for new components.`)}r=kc(r,e),r=await Di(r,e,l),await E(),r=sl(r),r=ol(r),r=wt(r);let{processXElementDirectives:be}=await o("stx/x-element",()=>import("./chunk-d6gqh2wv.js"));r=be(r);let fe=e.__originalFilePath||l,se=He(e);if(r=await si(r,p,fe,se),await E(),r=jt(r,e),r=await Jt(r,e,l,p),await E(),p.media?.image?.autoSiblings){let z=p.publicDir||"public",{rewriteImagesWithSiblings:K}=await o("stx/image-optimization/auto-sibling",()=>import("./chunk-447jc6zc.js"));r=await K(r,{publicDir:z})}if(p.seo?.enabled)r=fi(r,e,p);let J=(z,K,Q=!0)=>{if(!K)return z;let ye=K.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),ie=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(z),ge=ie?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(ie[0]):null;if(ye&&ie&&ge){if(Q){let De=ie.index+ge.index;z=z.slice(0,De)+ye[0]+z.slice(De+ge[0].length)}if(K=K.replace(ye[0],"").trim(),!K)return z}if(/<\/head>/i.test(z))return f(z,K);if(/<head\b[^>]*>/i.test(z))return z.replace(/(<head\b[^>]*>)/i,`$1
|
|
1317
|
+
${K}`);if(/<html\b[^>]*>/i.test(z))return z.replace(/(<html\b[^>]*>)/i,`$1
|
|
1318
1318
|
<head>
|
|
1319
|
-
${
|
|
1320
|
-
</head>`);return
|
|
1319
|
+
${K}
|
|
1320
|
+
</head>`);return z},{renderHead:ve,getHead:Se}=await o("stx/head",()=>import("./chunk-ts37jw3s.js")),je=e.__stx_runtime_head??Se();if(je.title||je.meta?.length||je.link?.length){let z=ve(je);if(z)r=J(r,z)}if(ne.headContent)r=J(r,ne.headContent,!je.title);if(p.csp?.enabled&&p.csp.addMetaTag)r=_t(r,p.csp,e);if(p.analytics?.enabled)r=vt(r,p);if(p.heatmap?.enabled)r=Rc(r,p);if(p.pwa?.enabled&&p.pwa.autoInject!==!1){let{injectPwaTags:z}=await o("stx/pwa/inject",()=>import("./chunk-qggwr60r.js"));r=z(r,p)}let _r=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(r),Ar=/\bSTX\.\w+/.test(r),Rr=/window\.STX\s*=/.test(r);if(_r&&Ar&&!Rr){let K=`<script data-stx-scoped data-stx-run="once">
|
|
1321
1321
|
${ht()}
|
|
1322
|
-
</script>`;if(r.includes("</head>")){let
|
|
1323
|
-
`+De}else r=f(r,
|
|
1324
|
-
${
|
|
1325
|
-
`+r}{let{scanScriptTags:
|
|
1326
|
-
`+r.slice(
|
|
1327
|
-
export{kt,
|
|
1322
|
+
</script>`;if(r.includes("</head>")){let Q=D(r),ie=r.slice(0,Q).indexOf("<script");if(ie!==-1){let ge=r.slice(0,ie),De=r.slice(ie);r=ge+K+`
|
|
1323
|
+
`+De}else r=f(r,K)}else if(r.includes("<body"))r=r.replace(/<body([^>]*)>/,`<body$1>
|
|
1324
|
+
${K}`);else r=K+`
|
|
1325
|
+
`+r}{let{scanScriptTags:z}=await o("stx/signal-processing",()=>import("./chunk-7ngfcdv9.js")),K=[];for(let Q of z(r)){if(!/\bserver\b/i.test(Q.attrs))continue;let ye=Q.start+Q.fullMatch.indexOf(">")+1,ie=Er(r,ye);if(ie===-1)continue;let ge=ie+9;while(ge<r.length&&/\s/.test(r[ge]))ge++;K.push({start:Q.start,end:ge})}if(K.length>0){let Q=Array(K.length+1),ye=0;for(let ie=0;ie<K.length;ie++){let{start:ge,end:De}=K[ie];Q[ie]=r.slice(ye,ge),ye=De}Q[K.length]=r.slice(ye),r=Q.join("")}}let ft=Xs(r,l);if(ft.hasScoped)r=ft.html;let Dr=e.__stx_event_bindings||[],Qe=!1,gt=[],Or=/\s:[a-z][\w.-]*\s*=/.test(r),{scanScriptTags:Pr}=await o("stx/signal-processing",()=>import("./chunk-7ngfcdv9.js"));for(let z of Pr(r,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))gt.push({match:z.fullMatch,attrs:z.attrs,content:z.body});for(let{match:z,attrs:K,content:Q}of gt){Qe=!0;let ye=Q;Fe(Q,l,a.strict,e.__originalFilePath);let ie=await Ve(Q,{eventBindings:Dr,attrs:K,hasColonDirectives:Or,templateContent:n,filePath:l,projectRoot:process.cwd(),production:Ui(a.buildMode,a.minifyClient),serverData:se});r=r.replace(z,()=>ie)}if(Qe)e.__stx_event_bindings=[];if(!Qe&&e.__stxProcessingDepth===1){let z=e.__stx_event_bindings||[];if(z.length>0){let K=vi(z);if(K){let Q=c(r);r=Q===-1?r+K:r.slice(0,Q)+K+`
|
|
1326
|
+
`+r.slice(Q)}e.__stx_event_bindings=[]}}if(!p.skipSignalsRuntime&&!Ce(r)&&Cc(r))r=await hr(r,p);if(r=Ec(r),p.csp?.enabled&&p.csp.useNonce&&typeof e.cspNonce==="string")r=Tt(r,e.cspNonce);return r}
|
|
1327
|
+
export{kt,Me,wc,gs,Wo,qo,lr,i};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ui,di,pi,fi,Is,Os,dy,py,fy,gy,Ns,my}from"./chunk-0sa9gqmc.js";import"./chunk-pp99rmjm.js";export{my as generateDefaultRobotsTxt,Ns as generateRobotsTxt,py as generateSitemap,fy as generateSitemapIndex,fi as injectSeoTags,Is as metaDirective,ui as processMetaDirectives,pi as processSeoDirective,di as processStructuredData,dy as registerSeoDirectives,gy as scanForSitemapEntries,Os as structuredDataDirective};
|