@stacksjs/stx 0.2.673 → 0.2.674
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-0jwdcqj8.js +2 -0
- package/dist/chunk-0mwdq478.js +2 -0
- package/dist/{chunk-npa7gze7.js → chunk-0nfqgv4n.js} +2 -2
- package/dist/chunk-1y6egkty.js +2 -0
- package/dist/{chunk-1sr6c0nk.js → chunk-25zmy8q6.js} +2 -2
- package/dist/chunk-2881tcqt.js +2 -0
- package/dist/chunk-2a775q7x.js +2 -0
- package/dist/chunk-2asdbd5e.js +2 -0
- package/dist/chunk-34yj93hh.js +2 -0
- package/dist/{chunk-30nes8ne.js → chunk-35ezh7de.js} +2 -2
- package/dist/{chunk-9tdnfztv.js → chunk-40tswfe7.js} +8 -8
- package/dist/chunk-41de209e.js +2 -0
- package/dist/{chunk-jst1fbdm.js → chunk-4b9s7wgy.js} +2 -2
- package/dist/{chunk-vhs13kbf.js → chunk-4bgjrrvz.js} +1 -1
- package/dist/{chunk-365vg0eg.js → chunk-4s8zacxg.js} +4 -4
- package/dist/chunk-4w6baw62.js +3 -0
- package/dist/{chunk-fbtv2k1p.js → chunk-506mv7hb.js} +2 -2
- package/dist/{chunk-fzqj1mjz.js → chunk-5qtthtg3.js} +7 -7
- package/dist/chunk-5s1ay9mv.js +2 -0
- package/dist/{chunk-wns8g6k9.js → chunk-5vt48yce.js} +6 -6
- package/dist/{chunk-qv6axke4.js → chunk-5zhp87wv.js} +2 -2
- package/dist/{chunk-hvf2e7pr.js → chunk-6s7tvmqp.js} +1 -1
- package/dist/{chunk-ecqrkyg8.js → chunk-6sjtyd0k.js} +4 -4
- package/dist/{chunk-a3d0g4mr.js → chunk-7adznted.js} +2 -2
- package/dist/chunk-7j1zgrnf.js +42 -0
- package/dist/chunk-7kznee1g.js +2 -0
- package/dist/{chunk-qjtpxsyx.js → chunk-7mvz972c.js} +3 -3
- package/dist/chunk-80zgyaqe.js +2 -0
- package/dist/chunk-84tqb1rn.js +2 -0
- package/dist/chunk-8azm7nha.js +2 -0
- package/dist/chunk-902qnyg0.js +2 -0
- package/dist/{chunk-3y41efsf.js → chunk-9dtbvjpp.js} +8 -8
- package/dist/chunk-9n6jwcpb.js +2 -0
- package/dist/{chunk-yfvm7q6t.js → chunk-a4p18ybc.js} +3 -3
- package/dist/chunk-a6y8td0d.js +2 -0
- package/dist/chunk-a7kt1ts4.js +2 -0
- package/dist/chunk-a81y8g40.js +2 -0
- package/dist/{chunk-jg5zt20a.js → chunk-aet1pgw7.js} +36 -36
- package/dist/chunk-aft1zc84.js +2 -0
- package/dist/{chunk-04kg16qs.js → chunk-am2w363p.js} +4 -4
- package/dist/{chunk-ym41ybz2.js → chunk-asezs2n3.js} +6 -6
- package/dist/{chunk-jefe0rgt.js → chunk-bawq4fqy.js} +4 -4
- package/dist/chunk-bdp2r0v4.js +2 -0
- package/dist/{chunk-m6q3f5rf.js → chunk-bkkpq8dx.js} +9 -9
- package/dist/chunk-brtvm8mb.js +2 -0
- package/dist/{chunk-2dp7hyv7.js → chunk-bsajk82t.js} +14 -14
- package/dist/chunk-bvzr9zqt.js +2 -0
- package/dist/{chunk-hzv2qj0t.js → chunk-cbjabv1w.js} +4 -4
- package/dist/chunk-cbvgtf3m.js +2 -0
- package/dist/chunk-cfydbaeq.js +2 -0
- package/dist/{chunk-t2pzy3x1.js → chunk-ck2e3e47.js} +3 -3
- package/dist/{chunk-wpmrz872.js → chunk-d09q93yf.js} +2 -2
- package/dist/{chunk-rcsgt4wy.js → chunk-d1a86qx8.js} +1 -1
- package/dist/{chunk-xqp4hstk.js → chunk-dgc1a3yt.js} +6 -6
- package/dist/chunk-dq8c3h4n.js +2 -0
- package/dist/chunk-e36pne7n.js +2 -0
- package/dist/chunk-e62qfexp.js +2 -0
- package/dist/chunk-eq5jzaj5.js +2 -0
- package/dist/{chunk-t0zh1dn9.js → chunk-f9zyf9n6.js} +65 -65
- package/dist/{chunk-dgb4z4kw.js → chunk-faakv1p6.js} +2 -2
- package/dist/{chunk-ynz7bzc6.js → chunk-fb7t1nn9.js} +3 -3
- package/dist/{chunk-ptcj11b4.js → chunk-fbmth6xv.js} +10 -10
- package/dist/{chunk-7met6yva.js → chunk-fd49fahd.js} +5 -5
- package/dist/chunk-fr39emcz.js +2 -0
- package/dist/chunk-fsq13amm.js +2 -0
- package/dist/chunk-fw413k9q.js +3 -0
- package/dist/chunk-fxh12vqd.js +2 -0
- package/dist/chunk-gcc9fa33.js +2 -0
- package/dist/chunk-h6t2ney6.js +2 -0
- package/dist/{chunk-kgfgb971.js → chunk-ham5x7ts.js} +4 -4
- package/dist/{chunk-n38yb274.js → chunk-hb3edeq9.js} +6 -6
- package/dist/{chunk-fvtwec1r.js → chunk-hegfgw27.js} +1 -1
- package/dist/{chunk-p472crv1.js → chunk-hgry3mjd.js} +1 -1
- package/dist/{chunk-sfc2v7rt.js → chunk-hsmcbh0p.js} +7 -7
- package/dist/{chunk-mxbc2ahy.js → chunk-hz4x7h0n.js} +5 -5
- package/dist/{chunk-jxda11cg.js → chunk-j6m8xqh3.js} +2 -2
- package/dist/chunk-j8g5cvvm.js +2 -0
- package/dist/chunk-jzjpyyw2.js +2 -0
- package/dist/chunk-k1b8x73j.js +2 -0
- package/dist/{chunk-h4dkvnhd.js → chunk-kdebh22m.js} +7 -7
- package/dist/{chunk-xwhmh0w0.js → chunk-mwnhdsbp.js} +2 -2
- package/dist/{chunk-0f4csefs.js → chunk-nj343mw2.js} +5 -5
- package/dist/chunk-nw9bdk2n.js +2 -0
- package/dist/chunk-p4jkswz8.js +2 -0
- package/dist/chunk-p4r90vqf.js +2 -0
- package/dist/{chunk-bnn7pd62.js → chunk-p6qd7ad0.js} +2 -2
- package/dist/chunk-p8bgy5tt.js +2 -0
- package/dist/{chunk-aprhqxky.js → chunk-pb6erpj3.js} +5 -5
- package/dist/{chunk-r3e6x87d.js → chunk-pg2v1pb5.js} +3 -3
- package/dist/{chunk-zvygkwyf.js → chunk-pqqe2b6m.js} +4 -4
- package/dist/chunk-q6nwcav4.js +2 -0
- package/dist/chunk-qmqavdz2.js +2 -0
- package/dist/chunk-qpw72bty.js +2 -0
- package/dist/chunk-qwnh1kj6.js +2 -0
- package/dist/chunk-qy9m6qdn.js +2 -0
- package/dist/chunk-qychcdsm.js +2 -0
- package/dist/{chunk-7d4z944r.js → chunk-qz5b8ed4.js} +7 -7
- package/dist/{chunk-6ajahb2x.js → chunk-r7fdw2v5.js} +3 -3
- package/dist/{chunk-mmwedr93.js → chunk-rdr09efy.js} +5 -5
- package/dist/chunk-rj3w1ama.js +2 -0
- package/dist/{chunk-prf164ct.js → chunk-rr527jt6.js} +2 -2
- package/dist/{chunk-1fd7x7b8.js → chunk-rv39s5az.js} +4 -4
- package/dist/{chunk-yg267y85.js → chunk-rym0309c.js} +3 -3
- package/dist/{chunk-chzgfna2.js → chunk-s0vtjyyj.js} +1 -1
- package/dist/{chunk-vqc4h16r.js → chunk-s2wptfm1.js} +2 -2
- package/dist/chunk-sf0r963g.js +2 -0
- package/dist/{chunk-qmfycza5.js → chunk-sqn3y9qt.js} +2 -2
- package/dist/{chunk-hmyb701s.js → chunk-srq9fqq8.js} +10 -10
- package/dist/chunk-ss820yys.js +2 -0
- package/dist/{chunk-pn1ehs6a.js → chunk-szevd7d5.js} +2 -2
- package/dist/{chunk-wbzmr6a4.js → chunk-t0k16vqv.js} +2 -2
- package/dist/chunk-t4j9g2vh.js +2 -0
- package/dist/chunk-t79jfpv6.js +3 -0
- package/dist/{chunk-rcadtv3x.js → chunk-t9kxhe46.js} +1 -1
- package/dist/{chunk-zqtbtqbq.js → chunk-tddnb5bv.js} +2 -2
- package/dist/{chunk-hvzzhkhr.js → chunk-thceyzj6.js} +2 -2
- package/dist/{chunk-8yqfpkp4.js → chunk-trh7s6k3.js} +5 -5
- package/dist/{chunk-dq56166k.js → chunk-trz8z4j4.js} +18 -18
- package/dist/chunk-ttemwrbx.js +2 -0
- package/dist/{chunk-agqcqf3q.js → chunk-twqzn21x.js} +7 -7
- package/dist/chunk-v14rq8b4.js +3 -0
- package/dist/{chunk-b4pcw34n.js → chunk-v21bhhjb.js} +1 -1
- package/dist/{chunk-ka8befem.js → chunk-v6peecfp.js} +2 -2
- package/dist/{chunk-g8r0km7g.js → chunk-vayhx642.js} +2 -2
- package/dist/{chunk-1ptwdkvn.js → chunk-vdxg7e1y.js} +2 -2
- package/dist/chunk-vq513cxx.js +2 -0
- package/dist/chunk-vvq8xe3n.js +2 -0
- package/dist/{chunk-tre98h62.js → chunk-w3d98907.js} +2 -2
- package/dist/{chunk-0qqvmfrw.js → chunk-w7t2cfgy.js} +42 -42
- package/dist/chunk-w8t31bn9.js +2 -0
- package/dist/chunk-x1kz4d7j.js +2 -0
- package/dist/chunk-xcsyqwxf.js +25 -0
- package/dist/{chunk-9p6efb17.js → chunk-xghcsg3f.js} +1 -1
- package/dist/chunk-xn9jrjzh.js +2 -0
- package/dist/{chunk-nrvwejdw.js → chunk-y1pcdeg9.js} +5 -5
- package/dist/{chunk-7b3kr56x.js → chunk-yx3dpdwc.js} +3 -3
- package/dist/{chunk-5xvan09w.js → chunk-z22zy22p.js} +2 -2
- package/dist/chunk-z97bwx8m.js +2 -0
- package/dist/{chunk-120ze5ms.js → chunk-zmg1peyg.js} +3 -3
- package/dist/{chunk-pxdww4rb.js → chunk-zp79zkkd.js} +2 -2
- package/dist/cli.js +20 -20
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/loops.js +12 -2
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.d.ts +12 -0
- package/dist/signal-processing.js +1 -1
- package/dist/ssg.js +6 -6
- package/package.json +5 -5
- package/dist/chunk-028ee6q5.js +0 -2
- package/dist/chunk-02ymqwmj.js +0 -2
- package/dist/chunk-1pnp91wx.js +0 -2
- package/dist/chunk-1v60t3sb.js +0 -2
- package/dist/chunk-2f17h17f.js +0 -2
- package/dist/chunk-4c183zem.js +0 -2
- package/dist/chunk-4yt8tg4j.js +0 -2
- package/dist/chunk-52gp2xxk.js +0 -2
- package/dist/chunk-5zgrvj4b.js +0 -2
- package/dist/chunk-67kj14at.js +0 -2
- package/dist/chunk-6rzshbey.js +0 -2
- package/dist/chunk-6vzktvyw.js +0 -2
- package/dist/chunk-81q3sc0w.js +0 -2
- package/dist/chunk-864qtx7y.js +0 -2
- package/dist/chunk-89jbdtgw.js +0 -3
- package/dist/chunk-8d33aqs5.js +0 -2
- package/dist/chunk-8tdz8svp.js +0 -2
- package/dist/chunk-99bhc1h1.js +0 -42
- package/dist/chunk-9rrnyd5m.js +0 -2
- package/dist/chunk-9szxxgv5.js +0 -2
- package/dist/chunk-amkwmxs8.js +0 -2
- package/dist/chunk-b1hxtn08.js +0 -2
- package/dist/chunk-b4fd2dtk.js +0 -2
- package/dist/chunk-b4vk2m82.js +0 -2
- package/dist/chunk-b58tv8jc.js +0 -25
- package/dist/chunk-b6nzy1rg.js +0 -2
- package/dist/chunk-b823zxq6.js +0 -3
- package/dist/chunk-bdg0fydw.js +0 -2
- package/dist/chunk-dpvxe52r.js +0 -2
- package/dist/chunk-e1fetwbr.js +0 -2
- package/dist/chunk-e4vpr36s.js +0 -2
- package/dist/chunk-e6p0k6br.js +0 -2
- package/dist/chunk-f8agvh5v.js +0 -2
- package/dist/chunk-fcn71bq1.js +0 -2
- package/dist/chunk-g2jmwh7p.js +0 -2
- package/dist/chunk-g64z2e92.js +0 -2
- package/dist/chunk-gw7h5k3b.js +0 -2
- package/dist/chunk-j0v970k3.js +0 -2
- package/dist/chunk-jk41jwsc.js +0 -2
- package/dist/chunk-jr9wfthg.js +0 -2
- package/dist/chunk-k2pa44rf.js +0 -2
- package/dist/chunk-kq9y6gfy.js +0 -2
- package/dist/chunk-md2qhahg.js +0 -2
- package/dist/chunk-p38m3947.js +0 -2
- package/dist/chunk-qcjh3pp8.js +0 -2
- package/dist/chunk-qw441qys.js +0 -2
- package/dist/chunk-qxmyaajq.js +0 -2
- package/dist/chunk-qyjsne99.js +0 -2
- package/dist/chunk-rermy54w.js +0 -2
- package/dist/chunk-rwjf25ht.js +0 -2
- package/dist/chunk-rx0ep3v1.js +0 -2
- package/dist/chunk-sf0wsq74.js +0 -2
- package/dist/chunk-shpc1ttk.js +0 -2
- package/dist/chunk-sy0z64yz.js +0 -2
- package/dist/chunk-ta7bmfvg.js +0 -3
- package/dist/chunk-weqc0ssb.js +0 -2
- package/dist/chunk-wq712sw1.js +0 -2
- package/dist/chunk-xr69d4tk.js +0 -2
- package/dist/chunk-xz6dw6yw.js +0 -2
- package/dist/chunk-y8kdy3d2.js +0 -2
- package/dist/chunk-yscr04dv.js +0 -2
- package/dist/chunk-z8p6tk5z.js +0 -2
- package/dist/chunk-zhf01af3.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Co,Ta,r,Et,re,S,Ae,on,Pe,de,G,ir,an,ds,ja,ln,lr,gs,ms,Ba,Po,Fa,za,Ha,Va,Oe,Ne,hs,Le,n,pn,m,d,z,J,ve,k,_}from"./chunk-f9zyf9n6.js";import{l,p,E,t,oe,H,a,we,Ho,D,hn,Vo,Mt,Uo,tc,fr,nc,rt,rc,gr,sc,yn,Wo,oc,mr,yr,xe,qo}from"./chunk-bsajk82t.js";import{Ot}from"./chunk-25zmy8q6.js";import{gn}from"./chunk-mwnhdsbp.js";import{h}from"./chunk-kdebh22m.js";import{tr,ns}from"./chunk-4s8zacxg.js";import{da,pa,Zn,Xe,fa,R}from"./chunk-srq9fqq8.js";import{ho,yo,bo,vo}from"./chunk-5qtthtg3.js";import{ia,Fr}from"./chunk-7j1zgrnf.js";import{Mr,Lr,jr}from"./chunk-bkkpq8dx.js";import{zr,ao,co,Hr,Vr,lo}from"./chunk-40tswfe7.js";import{Dr,qn}from"./chunk-xcsyqwxf.js";import{Qs}from"./chunk-rr527jt6.js";import{ne,ro,so,oo}from"./chunk-v6peecfp.js";import{Kn,me,ca,Xn,la}from"./chunk-twqzn21x.js";import{W,Ge}from"./chunk-p6qd7ad0.js";import{ga,ma}from"./chunk-rym0309c.js";import{C,bn,Go}from"./chunk-506mv7hb.js";import ps from"fs";import ce from"path";function lt(){return`
|
|
3
3
|
// STX Lifecycle Runtime
|
|
4
4
|
(function() {
|
|
5
5
|
if (typeof window === 'undefined') return;
|
|
@@ -347,7 +347,7 @@ else {
|
|
|
347
347
|
|
|
348
348
|
console.log('[stx] Lifecycle runtime initialized');
|
|
349
349
|
})();
|
|
350
|
-
`}function Je(c){return Symbol(c)}var Ts=Je("theme"),Cs=Je("router"),As=Je("i18n");import*as dt from"crypto";function ut(c){let e=/\$(\w+)\./g,u=[],o;while((o=e.exec(c))!==null)if(!u.includes(o[1]))u.push(o[1]);return u}function In(){return`stx-${dt.randomBytes(4).toString("hex")}`}function On(c){return/\$\w+\./.test(c)}function Pn(c){if(!/\{\{[^}]*\$\w/.test(c)||!/\$\w+\./.test(c))return{html:c,bindings:[],stores:new Set};let e=[],u=new Set,o=/<(\w+)([^>]*?)(\s*\/?>)/g,g=c;return g=g.replace(o,(i,f,v,y)=>{if(["script","style","template"].includes(f.toLowerCase()))return i;if(!v.includes("{{"))return i;let x=[],b=!1,w=v,T=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,A=[...v.matchAll(T)];for(let I of A){let P=I[0],N=I[1],
|
|
350
|
+
`}function Je(c){return Symbol(c)}var Ts=Je("theme"),Cs=Je("router"),As=Je("i18n");import*as dt from"crypto";function ut(c){let e=/\$(\w+)\./g,u=[],o;while((o=e.exec(c))!==null)if(!u.includes(o[1]))u.push(o[1]);return u}function In(){return`stx-${dt.randomBytes(4).toString("hex")}`}function On(c){return/\$\w+\./.test(c)}function Pn(c){if(!/\{\{[^}]*\$\w/.test(c)||!/\$\w+\./.test(c))return{html:c,bindings:[],stores:new Set};let e=[],u=new Set,o=/<(\w+)([^>]*?)(\s*\/?>)/g,g=c;return g=g.replace(o,(i,f,v,y)=>{if(["script","style","template"].includes(f.toLowerCase()))return i;if(!v.includes("{{"))return i;let x=[],b=!1,w=v,T=/(\w+(?:-\w+)*)\s*=\s*"([^"]*\{\{[^}]*\$\w+[^}]*\}\}[^"]*)"/g,A=[...v.matchAll(T)];for(let I of A){let P=I[0],N=I[1],q=I[2];if(On(q)){b=!0;let V=q.match(/\{\{\s*([\s\S]+?)\s*\}\}/);if(V){let L=V[1];if(x.push({attr:N,expr:L,fullMatch:P,originalAttr:N}),ut(L).forEach((B)=>u.add(B)),N==="text")w=w.replace(P,"");else if(N==="class")w=w.replace(P,'class=""');else if(N==="disabled"||N==="hidden")w=w.replace(P,"");else w=w.replace(P,`${N}=""`)}}}if(!b)return i;let O=w.match(/\bid\s*=\s*"([^"]+)"/),M;if(O)M=O[1];else M=In(),w=` id="${M}"${w}`;for(let I of x)e.push({elementId:M,attribute:I.attr,expression:I.expr,stores:ut(I.expr)});return`<${f}${w}${y}`}),{html:g,bindings:e,stores:u}}function Ln(c,e){if(c.length===0)return"";let u=Array.from(e),o=`
|
|
351
351
|
<script>
|
|
352
352
|
(function() {
|
|
353
353
|
'use strict';
|
|
@@ -562,7 +562,7 @@ ${e.inlineScript}
|
|
|
562
562
|
`;if(!e.scriptUrl)return"";let u=[];if(e.scriptId)u.push(`id="${pe(e.scriptId)}"`);if(e.attributes)for(let[g,i]of Object.entries(e.attributes))u.push(`${pe(g)}="${pe(i)}"`);return`
|
|
563
563
|
<!-- Custom Analytics -->
|
|
564
564
|
<script${u.length>0?` ${u.join(" ")}`:""} src="${pe(e.scriptUrl)}" defer></script>
|
|
565
|
-
`}function ft(c,e){let u=jn(e);if(!u)return c;if(!c.includes("</head>")){let o=c.lastIndexOf("</body>");if(o!==-1)return c.slice(0,o)+u+c.slice(o);return c+u}return c.replace("</head>",`${u}</head>`)}function pe(c){return c.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function gt(c){let e=c.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function mt(c){let e=c?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}var zn=0,Wn=0;function ht(c,e){let u=c.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));if(u)return u[1];let o=c.match(new RegExp(`${e}\\s*=\\s*'([^']*)'`,"i"));if(o)return o[1];return null}function
|
|
565
|
+
`}function ft(c,e){let u=jn(e);if(!u)return c;if(!c.includes("</head>")){let o=c.lastIndexOf("</body>");if(o!==-1)return c.slice(0,o)+u+c.slice(o);return c+u}return c.replace("</head>",`${u}</head>`)}function pe(c){return c.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function gt(c){let e=c.match(/\bdefinePageMeta\s*\(\s*(\{[\s\S]*?\})\s*\)/m);if(!e)return null;try{return Function(`return ${e[1]}`)()}catch{return null}}function mt(c){let e=c?.layout;if(e===!1)return!1;return typeof e==="string"&&e.trim()?e.trim():void 0}var zn=0,Wn=0;function ht(c,e){let u=c.match(new RegExp(`${e}\\s*=\\s*"([^"]*)"`,"i"));if(u)return u[1];let o=c.match(new RegExp(`${e}\\s*=\\s*'([^']*)'`,"i"));if(o)return o[1];return null}function Gn(c){let e=[],u=/<([a-z][a-z0-9-]*)\s+([^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,o;while((o=u.exec(c))!==null){let[g,i,f]=o,v=o.index,y=ht(f,"x-data");if(!y)continue;let x=`__stx_scope_${zn++}`,b=ht(f,"x-init"),w=Jn(c,i,v+g.length),T=c.slice(v,w.endIndex),A=Qn(T);e.push({id:x,selector:`[data-stx-scope="${x}"]`,stateExpr:y,initExpr:b,bindings:[],refs:A})}return e}function Jn(c,e,u){let o=1,g=u,i=new RegExp(`<${e}(?:\\s|>)`,"gi"),f=new RegExp(`</${e}>`,"gi"),v=new RegExp(`<${e}[^>]*/\\s*>`,"gi");while(o>0&&g<c.length){i.lastIndex=g,f.lastIndex=g,v.lastIndex=g;let y=i.exec(c),x=f.exec(c),b=v.exec(c);if(b&&b.index<(y?.index??1/0)){g=b.index+b[0].length;continue}if(!x)return{endIndex:c.length};if(y&&y.index<x.index)o++,g=y.index+y[0].length;else{if(o--,o===0)return{endIndex:x.index+x[0].length};g=x.index+x[0].length}}return{endIndex:c.length}}function Qn(c){let e=new Map,u=c.replace(/x-data\s*=\s*"[^"]*"/gi,'x-data="__stripped__"').replace(/x-data\s*=\s*'[^']*'/gi,"x-data='__stripped__'"),o=/<[a-z][a-z0-9-]*\s+([^>]*x-ref\s*=\s*["']([^"']*)["'][^>]*)>/gi,g;while((g=o.exec(u))!==null){let[,i,f]=g,v=Yn(i);e.set(f,v)}return e}function Yn(c){let e=c.match(/\bid\s*=\s*["']([^"']*)["']/);if(e)return e[1];return`__stx_el_${Wn++}`}function er(){return`
|
|
566
566
|
// STX Reactive Runtime - x-cloak and transition CSS
|
|
567
567
|
(function() {
|
|
568
568
|
var style = document.createElement('style');
|
|
@@ -824,26 +824,26 @@ window.__stx_reactive = (function() {
|
|
|
824
824
|
})();`}).join(`
|
|
825
825
|
`);return`
|
|
826
826
|
<script data-stx-scoped data-stx-reactive data-stx-run="always">
|
|
827
|
-
${
|
|
827
|
+
${er()}
|
|
828
828
|
${u}
|
|
829
|
-
</script>`}function vt(c,e,u){if(!sr(c))return c;let o=
|
|
830
|
-
`+g.slice(f);else g+=i;return g}function rr(c,e){let u=0,o=c.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(g,i,f)=>{let v=e[u++];if(!v)return g;let y=/data-stx-scope="([^"]*)"/.exec(f);if(y)return v.id=y[1],v.selector=`[data-stx-scope="${v.id}"]`,g;return`<${i} data-stx-scope="${v.id}"${f}>`});return o=o.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),o=o.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),o=o.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),o=o.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),o}function sr(c){return/x-data\s*=\s*["']/.test(c)}import
|
|
831
|
-
${g}`)}function $t(c,e){let u=c;return u=u.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(o,g)=>{if(g.includes("nonce="))return o;return`<script nonce="${e}"${g}>`}),u=u.replace(/<style([^>]*)>/gi,(o,g)=>{if(g.includes("nonce="))return o;return`<style nonce="${e}"${g}>`}),u}function _t(c,e,u,o){let g=c,i=o.csp;if(g=g.replace(/@csp\b/g,()=>{if(!i?.enabled||!i.directives)return"<!-- CSP not configured -->";let f=i.useNonce?Ue(e,i):void 0;return kt(i.directives,f)}),g=g.replace(/@cspNonce\b/g,()=>{if(!i?.enabled||!i.useNonce)return"";return Ue(e,i)}),i?.enabled&&i.useNonce)e.cspNonce=Ue(e,i);return g}import mr from"crypto";var yr=40,Tt="_token",Ye=null;function vr(c=yr){let e=mr.randomBytes(Math.ceil(c/2)).toString("hex").slice(0,c);return Ye=e,e}function br(){if(!Ye)vr();return Ye}function wr(c=Tt){let e=br();return`<input type="hidden" name="${c}" value="${e}">`}function Ct(c){return c.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,u,o)=>wr(o||Tt))}async function At(c,e,u,o){if(!o.customDirectives||o.customDirectives.length===0)return c;let g=c;for(let i of o.customDirectives){if(!i.name||typeof i.handler!=="function"){if(o.debug)console.warn("Invalid custom directive:",i);continue}if(i.hasEndTag)g=await xr(g,i,e,u,o);else g=await kr(g,i,e,u,o)}return g}async function xr(c,e,u,o,g){let{name:i,handler:f}=e,v=`@${i}`,y=`@end${i}`,x=c,b=Et(`${v}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${y}`,"g"),w=[],T=b.exec(x);while(T!==null){let[A,O="",M=""]=T,I=T.index||0;try{let P=O?Rt(e,O):[],N=M.trim(),V=await f(N,P,u,o);w.push({original:A,processed:V,startIndex:I})}catch(P){let N=P instanceof Error?P.message:String(P);if(g.debug)console.error(`Error processing custom directive @${i}:`,P);w.push({original:A,processed:a("CustomDirective",`Error in @${i}${O?`(${O})`:""}: ${N}`,t.EVALUATION_ERROR),startIndex:I})}T=b.exec(x)}for(let A=w.length-1;A>=0;A--){let{original:O,processed:M}=w[A];x=x.replace(O,M)}return x}async function kr(c,e,u,o,g){let{name:i,handler:f}=e,v=c,y=[],x=[];if(e.rawParams){for(let T of Ho(v,Et(`(?<![\\w$@])@${i}\\s*\\(`,"g")))if(T.end!==-1)x.push({fullMatch:T.call,paramString:T.args,startIndex:T.start})}else{let T=Et(`@${i}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");T.lastIndex=0;let A=T.exec(v);while(A!==null)x.push({fullMatch:A[0],paramString:A[1]??"",startIndex:A.index||0}),A=T.exec(v)}for(let{fullMatch:T,paramString:A,startIndex:O}of x)try{let M=Rt(e,A),I=await f("",M,u,o);y.push({original:T,processed:I,startIndex:O})}catch(M){let I=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${i}:`,M);y.push({original:T,processed:a("CustomDirective",`Error in @${i}(${A}): ${I}`,t.EVALUATION_ERROR),startIndex:O})}let b=Et(`@${i}(?!\\w)(?!\\s*\\()`,"g"),w=b.exec(v);while(w!==null){let[T]=w,A=w.index||0;try{let O=await f("",[],u,o);y.push({original:T,processed:O,startIndex:A})}catch(O){let M=O instanceof Error?O.message:String(O);if(g.debug)console.error(`Error processing custom directive @${i}:`,O);y.push({original:T,processed:a("CustomDirective",`Error in @${i}: ${M}`,t.EVALUATION_ERROR),startIndex:A})}w=b.exec(v)}for(let T=y.length-1;T>=0;T--){let{original:A,processed:O}=y[T];v=v.replace(A,O)}return v}function Rt(c,e){return c.rawParams?Mt(e):Sr(e)}function Sr(c){if(!c.trim())return[];let e=[],u="",o=!1,g="";for(let i=0;i<c.length;i++){let f=c[i];if((f==='"'||f==="'")&&(i===0||c[i-1]!=="\\"))if(!o)o=!0,g=f;else if(f===g)o=!1;else u+=f;else if(f===","&&!o)e.push(u.trim()),u="";else u+=f}if(u.trim())e.push(u.trim());return e.map((i)=>{let f=i.trim();if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))return f.substring(1,f.length-1);return f})}var Dt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,It=/^[A-Za-z_$][\w$]*$/,$r=new Set(["light","dark","system"]);function Se(c,e){if(typeof c!=="string"||c.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function Er(c){if(!c||typeof c!=="object"||Array.isArray(c))throw Error("@appearanceBootstrap expects an options object");let e=c,{appearance:u,colorMode:o}=e;if(Se(e.storageKey,"storageKey"),u!==void 0&&(!u||typeof u!=="object"||Array.isArray(u)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!o||typeof o!=="object"||Array.isArray(o))throw Error("@appearanceBootstrap colorMode must be an object");if(Se(o.key,"colorMode.key"),Se(o.attribute,"colorMode.attribute"),Se(o.default,"colorMode.default"),!It.test(o.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(o.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!$r.has(o.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(u){if(Se(u.key,"appearance.key"),Se(u.attribute,"appearance.attribute"),Se(u.default,"appearance.default"),!It.test(u.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(u.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(u.allowed)||u.allowed.length===0||u.allowed.some((i)=>typeof i!=="string"||i.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!u.allowed.includes(u.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:u.key,attribute:u.attribute,allowed:[...new Set(u.allowed)],default:u.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:o.key,attribute:o.attribute,default:o.default},respectExisting:e.respectExisting===!0}}function _r(c){return JSON.stringify(c).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Tr(c){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${_r(c)};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 Cr(c,e){let u=1,o=null,g=!1;for(let i=e+1;i<c.length;i++){let f=c[i];if(g){g=!1;continue}if(o){if(f==="\\")g=!0;else if(f===o)o=null;continue}if(f==='"'||f==="'"||f==="`"){o=f;continue}if(f==="(")u++;else if(f===")"&&--u===0)return i}return-1}function Pt(c,e){let u=c,o=/@appearanceBootstrap\s*\(/g,g;while((g=o.exec(u))!==null){let i=g.index+g[0].length-1,f=Cr(u,i);if(f===-1)throw Error("@appearanceBootstrap has an unclosed options object");let v=u.slice(i+1,f).trim(),y=l(`(${v})`,e),x=Tr(Er(y));u=u.slice(0,g.index)+x+u.slice(f+1),o.lastIndex=g.index+x.length}return u}import Ar from"crypto";function Q(c){return F(String(c??""))}var jt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ve(c,e,u,o){let g=c||e;return u?`${g} ${o}`:g}function me(c){return String(c).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Re(c,e){if(/\bid\s*=/i.test(c))return"";return` id="${Q(e)}"`}function et(c,e,u){if(!e)return"";let o="";if(!/\baria-invalid\s*=/i.test(u))o+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(u))o+=` aria-describedby="${Q(`${me(c)}-error`)}"`;return o}function Rr(){return Ar.randomUUID()}function ze(c,e){let u=c;return u=u.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let o=Rr();e.csrf={token:o}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Q(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),u=u.replace(/@method\(['"]([^'"]+)['"]\)/g,(o,g)=>{let i=g.toUpperCase();if(g&&!["GET","POST"].includes(i))return`<input type="hidden" name="_method" value="${Q(i)}">`;return o}),u}function Nt(c,e,u=jt){let o=c;return o=o.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,i,f,v,y,x="")=>{let b=i||f||"POST",w=v||y||"",T=ye(x),A=b.toUpperCase(),O=["GET","POST"].includes(A)?A:"POST",M=`<form method="${Q(O)}" action="${Q(w)}"${T?` ${T}`:""}>`;if(M+=`
|
|
829
|
+
</script>`}function vt(c,e,u){if(!sr(c))return c;let o=Gn(c);if(o.length===0)return c;let g=rr(c,o),i=nr(o,e),f=g.lastIndexOf("</body>");if(f!==-1)g=g.slice(0,f)+i+`
|
|
830
|
+
`+g.slice(f);else g+=i;return g}function rr(c,e){let u=0,o=c.replace(/<([a-z][a-z0-9-]*)(\s+[^>]*x-data\s*=\s*(?:"[^"]*"|'[^']*')[^>]*)>/gi,(g,i,f)=>{let v=e[u++];if(!v)return g;let y=/data-stx-scope="([^"]*)"/.exec(f);if(y)return v.id=y[1],v.selector=`[data-stx-scope="${v.id}"]`,g;return`<${i} data-stx-scope="${v.id}"${f}>`});return o=o.replace(/\s*x-data\s*=\s*"([^"]*)"/g,' data-stx-xdata="$1"'),o=o.replace(/\s*x-data\s*=\s*'([^']*)'/g," data-stx-xdata='$1'"),o=o.replace(/\s*x-init\s*=\s*"([^"]*)"/g,' data-stx-xinit="$1"'),o=o.replace(/\s*x-init\s*=\s*'([^']*)'/g," data-stx-xinit='$1'"),o}function sr(c){return/x-data\s*=\s*["']/.test(c)}import or from"fs";import Ze from"path";import{createHighlighter as ar}from"ts-syntax-highlighter";var Qe=new Map;async function Te(c,e={}){try{if(!await n(c))throw Error(`Markdown file not found: ${c}`);let o=(await or.promises.stat(c)).mtime.getTime();if(e.cache&&Qe.has(c)){let w=Qe.get(c);if(w.updatedAt>=o)return{content:w.content,data:w.data}}let g=await Bun.file(c).text(),{data:i,content:f}=Zn(g),v=e.markdown||R.markdown||{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}},x=Xe(f,{gfm:!0});if(v.syntaxHighlighting?.enabled&&v.syntaxHighlighting?.serverSide)x=await cr(x,v.syntaxHighlighting?.defaultTheme||"github-dark",v.syntaxHighlighting?.highlightUnknownLanguages||!1);let b={content:x,data:i||{}};if(e.cache)Qe.set(c,{...b,updatedAt:o});return b}catch(u){if(e.debug)console.error(`Error reading/parsing markdown file ${c}:`,u);let o=u instanceof Error?u.message:String(u);return{content:m("Markdown File",`Error reading/parsing markdown file: ${o}`,c,"",0,""),data:{}}}}var qe=null;async function cr(c,e,u){let o=/<pre><code( class="language-([^"]+)")?>([^<]+)<\/code><\/pre>/g;if(!qe)try{qe=await ar({theme:e||"github-dark",cache:!0})}catch(v){return console.error("Failed to initialize ts-syntax-highlighter:",v),c}let g=async(v,y,x,b)=>{let w=b.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'"),T=x||(u?"text":"");if(!T)return v;try{if(!qe.getSupportedLanguages().includes(T))return v;return(await qe.highlight(w,T,{theme:e})).html}catch(A){console.error(`Error highlighting code block with language ${x}:`,A)}return v},i=c,f=c.matchAll(o);for(let v of f){let[y,x,b,w]=v,T=await g(y,x,b,w);i=i.replace(y,T)}return i}async function bt(c,e,u="",o={}){return await ur(c,/@markdown-file\(\s*['"]([^'"]+)['"]\s*(?:,\s*(\{[^}]*\}))?\)/g,async(f,v,y,x)=>{try{let b=v;if(!Ze.isAbsolute(v))b=Ze.resolve(Ze.dirname(u),v);let w={};if(y)try{try{w=JSON.parse(y)}catch{if(o.debug)console.warn("Using safer alternative for parsing JS object literal");let N=y.replace(/^\s*\{|\}\s*$/g,"").trim().split(/,(?=\s*\w+\s*:)/);for(let q of N){let V=q.indexOf(":");if(V>0){let L=q.substring(0,V).trim(),j=q.substring(V+1).trim(),B=j.startsWith('"')&&j.endsWith('"'),X=j.startsWith("'")&&j.endsWith("'");if(B||X)j=j.substring(1,j.length-1);w[L]=j}}}}catch(P){if(o.debug)console.error("Error parsing context in @markdown-file directive:",P)}let{content:T,data:A}=await Te(b,o),O={...e,...A,...w},M=T,I=/\{\{([^}]+)\}\}/g;return M=M.replace(I,(P,N)=>{let q=N.trim();return O[q]!==void 0?String(O[q]):P}),M}catch(b){let w=b instanceof Error?b.message:String(b);return m("Markdown File",`Error including markdown file: ${w}`,u,c,x,f)}})}async function ur(c,e,u){let o=[],g;while((g=e.exec(c))!==null){let v=g[0],y=g.index,x=g;o.push(u(...x).then((b)=>({match:v,replacement:b,index:y})))}let i=await Promise.all(o);i.sort((v,y)=>y.index-v.index);let f=c;for(let{match:v,replacement:y}of i)f=f.replace(v,()=>y);return f}var wt=new WeakMap;function xt(c=16){let e=new Uint8Array(c);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e))}function Ue(c,e){if(!c)return e?.nonceGenerator?.()??xt();let u=wt.get(c);if(!u)u=e?.nonceGenerator?.()??xt(),wt.set(c,u);return u}function dr(c,e){let u=[];for(let[o,g]of Object.entries(c)){if(g===void 0||g===null)continue;if(typeof g==="boolean"){if(g)u.push(o);continue}if(Array.isArray(g)){let i=[...g];if(e&&(o==="script-src"||o==="style-src"))i=i.filter((f)=>!f.startsWith("'nonce-")),i.push(`'nonce-${e}'`);if(i.length>0)u.push(`${o} ${i.join(" ")}`)}}return u.join("; ")}function kt(c,e){return`<meta http-equiv="Content-Security-Policy" content="${dr(c,e).replace(/&/g,"&").replace(/"/g,""")}">`}function St(c,e,u){if(!e.enabled||!e.addMetaTag)return c;if(c.includes('http-equiv="Content-Security-Policy"'))return c;if(!c.includes("<head>")&&!c.includes("<head "))return c;let o=e.useNonce?Ue(u,e):void 0,g=kt(e.directives,o);return c.replace(/<head([^>]*)>/,`<head$1>
|
|
831
|
+
${g}`)}function $t(c,e){let u=c;return u=u.replace(/<script(?![^>]*\ssrc=)([^>]*)>/gi,(o,g)=>{if(g.includes("nonce="))return o;return`<script nonce="${e}"${g}>`}),u=u.replace(/<style([^>]*)>/gi,(o,g)=>{if(g.includes("nonce="))return o;return`<style nonce="${e}"${g}>`}),u}function _t(c,e,u,o){let g=c,i=o.csp;if(g=g.replace(/@csp\b/g,()=>{if(!i?.enabled||!i.directives)return"<!-- CSP not configured -->";let f=i.useNonce?Ue(e,i):void 0;return kt(i.directives,f)}),g=g.replace(/@cspNonce\b/g,()=>{if(!i?.enabled||!i.useNonce)return"";return Ue(e,i)}),i?.enabled&&i.useNonce)e.cspNonce=Ue(e,i);return g}import pr from"crypto";var hr=40,Tt="_token",Ye=null;function vr(c=hr){let e=pr.randomBytes(Math.ceil(c/2)).toString("hex").slice(0,c);return Ye=e,e}function br(){if(!Ye)vr();return Ye}function wr(c=Tt){let e=br();return`<input type="hidden" name="${c}" value="${e}">`}function Ct(c){return c.replace(/@csrf(?:\((['"])([^'"]*)\1\))?/g,(e,u,o)=>wr(o||Tt))}async function At(c,e,u,o){if(!o.customDirectives||o.customDirectives.length===0)return c;let g=c;for(let i of o.customDirectives){if(!i.name||typeof i.handler!=="function"){if(o.debug)console.warn("Invalid custom directive:",i);continue}if(i.hasEndTag)g=await xr(g,i,e,u,o);else g=await kr(g,i,e,u,o)}return g}async function xr(c,e,u,o,g){let{name:i,handler:f}=e,v=`@${i}`,y=`@end${i}`,x=c,b=Et(`${v}(?:\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\))?([\\s\\S]*?)${y}`,"g"),w=[],T=b.exec(x);while(T!==null){let[A,O="",M=""]=T,I=T.index||0;try{let P=O?Rt(e,O):[],N=M.trim(),q=await f(N,P,u,o);w.push({original:A,processed:q,startIndex:I})}catch(P){let N=P instanceof Error?P.message:String(P);if(g.debug)console.error(`Error processing custom directive @${i}:`,P);w.push({original:A,processed:a("CustomDirective",`Error in @${i}${O?`(${O})`:""}: ${N}`,t.EVALUATION_ERROR),startIndex:I})}T=b.exec(x)}for(let A=w.length-1;A>=0;A--){let{original:O,processed:M}=w[A];x=x.replace(O,M)}return x}async function kr(c,e,u,o,g){let{name:i,handler:f}=e,v=c,y=[],x=[];if(e.rawParams){for(let T of Vo(v,Et(`(?<![\\w$@])@${i}\\s*\\(`,"g")))if(T.end!==-1)x.push({fullMatch:T.call,paramString:T.args,startIndex:T.start})}else{let T=Et(`@${i}\\s*\\(([^()]*(?:\\([^)]*\\)[^()]*)*)\\)`,"g");T.lastIndex=0;let A=T.exec(v);while(A!==null)x.push({fullMatch:A[0],paramString:A[1]??"",startIndex:A.index||0}),A=T.exec(v)}for(let{fullMatch:T,paramString:A,startIndex:O}of x)try{let M=Rt(e,A),I=await f("",M,u,o);y.push({original:T,processed:I,startIndex:O})}catch(M){let I=M instanceof Error?M.message:String(M);if(g.debug)console.error(`Error processing custom directive @${i}:`,M);y.push({original:T,processed:a("CustomDirective",`Error in @${i}(${A}): ${I}`,t.EVALUATION_ERROR),startIndex:O})}let b=Et(`@${i}(?!\\w)(?!\\s*\\()`,"g"),w=b.exec(v);while(w!==null){let[T]=w,A=w.index||0;try{let O=await f("",[],u,o);y.push({original:T,processed:O,startIndex:A})}catch(O){let M=O instanceof Error?O.message:String(O);if(g.debug)console.error(`Error processing custom directive @${i}:`,O);y.push({original:T,processed:a("CustomDirective",`Error in @${i}: ${M}`,t.EVALUATION_ERROR),startIndex:A})}w=b.exec(v)}for(let T=y.length-1;T>=0;T--){let{original:A,processed:O}=y[T];v=v.replace(A,O)}return v}function Rt(c,e){return c.rawParams?Mt(e):Sr(e)}function Sr(c){if(!c.trim())return[];let e=[],u="",o=!1,g="";for(let i=0;i<c.length;i++){let f=c[i];if((f==='"'||f==="'")&&(i===0||c[i-1]!=="\\"))if(!o)o=!0,g=f;else if(f===g)o=!1;else u+=f;else if(f===","&&!o)e.push(u.trim()),u="";else u+=f}if(u.trim())e.push(u.trim());return e.map((i)=>{let f=i.trim();if(f.startsWith('"')&&f.endsWith('"')||f.startsWith("'")&&f.endsWith("'"))return f.substring(1,f.length-1);return f})}var Dt=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,It=/^[A-Za-z_$][\w$]*$/,$r=new Set(["light","dark","system"]);function Se(c,e){if(typeof c!=="string"||c.length===0)throw Error(`@appearanceBootstrap ${e} must be a non-empty string`)}function Er(c){if(!c||typeof c!=="object"||Array.isArray(c))throw Error("@appearanceBootstrap expects an options object");let e=c,{appearance:u,colorMode:o}=e;if(Se(e.storageKey,"storageKey"),u!==void 0&&(!u||typeof u!=="object"||Array.isArray(u)))throw Error("@appearanceBootstrap appearance must be an object when given");if(!o||typeof o!=="object"||Array.isArray(o))throw Error("@appearanceBootstrap colorMode must be an object");if(Se(o.key,"colorMode.key"),Se(o.attribute,"colorMode.attribute"),Se(o.default,"colorMode.default"),!It.test(o.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(o.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!$r.has(o.default))throw Error("@appearanceBootstrap colorMode.default must be light, dark, or system");let g=null;if(u){if(Se(u.key,"appearance.key"),Se(u.attribute,"appearance.attribute"),Se(u.default,"appearance.default"),!It.test(u.key))throw Error("@appearanceBootstrap preference keys must be JavaScript property names");if(!Dt.test(u.attribute))throw Error("@appearanceBootstrap attributes must be lowercase data attribute names");if(!Array.isArray(u.allowed)||u.allowed.length===0||u.allowed.some((i)=>typeof i!=="string"||i.length===0))throw Error("@appearanceBootstrap appearance.allowed must contain one or more strings");if(!u.allowed.includes(u.default))throw Error("@appearanceBootstrap appearance.default must be in appearance.allowed");g={key:u.key,attribute:u.attribute,allowed:[...new Set(u.allowed)],default:u.default}}return{storageKey:e.storageKey,appearance:g,colorMode:{key:o.key,attribute:o.attribute,default:o.default},respectExisting:e.respectExisting===!0}}function _r(c){return JSON.stringify(c).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Tr(c){return`<script data-stx-scoped data-stx-appearance-bootstrap>(function(){"use strict";const config=${_r(c)};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 Cr(c,e){let u=1,o=null,g=!1;for(let i=e+1;i<c.length;i++){let f=c[i];if(g){g=!1;continue}if(o){if(f==="\\")g=!0;else if(f===o)o=null;continue}if(f==='"'||f==="'"||f==="`"){o=f;continue}if(f==="(")u++;else if(f===")"&&--u===0)return i}return-1}function Pt(c,e){let u=c,o=/@appearanceBootstrap\s*\(/g,g;while((g=o.exec(u))!==null){let i=g.index+g[0].length-1,f=Cr(u,i);if(f===-1)throw Error("@appearanceBootstrap has an unclosed options object");let v=u.slice(i+1,f).trim(),y=l(`(${v})`,e),x=Tr(Er(y));u=u.slice(0,g.index)+x+u.slice(f+1),o.lastIndex=g.index+x.length}return u}import Ar from"crypto";function Q(c){return z(String(c??""))}var jt={input:"form-control",inputError:"is-invalid",checkInput:"form-check-input",label:"form-label",errorFeedback:"invalid-feedback"};function Ve(c,e,u,o){let g=c||e;return u?`${g} ${o}`:g}function ge(c){return String(c).replace(/\[\]$/,"").replace(/[^\w.:-]+/g,"-").replace(/^-+|-+$/g,"")}function Re(c,e){if(/\bid\s*=/i.test(c))return"";return` id="${Q(e)}"`}function et(c,e,u){if(!e)return"";let o="";if(!/\baria-invalid\s*=/i.test(u))o+=' aria-invalid="true"';if(!/\baria-describedby\s*=/i.test(u))o+=` aria-describedby="${Q(`${ge(c)}-error`)}"`;return o}function Rr(){return Ar.randomUUID()}function ze(c,e){let u=c;return u=u.replace(/@csrf/g,()=>{if(!e.csrf||typeof e.csrf!=="object"){let o=Rr();e.csrf={token:o}}if(e.csrf.field)return e.csrf.field;if(e.csrf.token)return`<input type="hidden" name="_token" value="${Q(e.csrf.token)}">`;return'<input type="hidden" name="_token" value="">'}),u=u.replace(/@method\(['"]([^'"]+)['"]\)/g,(o,g)=>{let i=g.toUpperCase();if(g&&!["GET","POST"].includes(i))return`<input type="hidden" name="_method" value="${Q(i)}">`;return o}),u}function Nt(c,e,u=jt){let o=c;return o=o.replace(/@form\(\s*(?:(?:'([^']+)'|"([^"]+)")\s*)?(?:,\s*(?:'([^']+)'|"([^"]+)")?)?\s*(?:,\s*\{([^}]+)\}\s*)?\)/g,(g,i,f,v,y,x="")=>{let b=i||f||"POST",w=v||y||"",T=ye(x),A=b.toUpperCase(),O=["GET","POST"].includes(A)?A:"POST",M=`<form method="${Q(O)}" action="${Q(w)}"${T?` ${T}`:""}>`;if(M+=`
|
|
832
832
|
${ze("@csrf",e)}`,!["GET","POST"].includes(A))M+=`
|
|
833
|
-
${ze(`@method('${A}')`,e)}`;return M}),o=o.replace(/@endform/g,"</form>"),o=o.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,i,f,v,y,x="")=>{let b=i||f||"",w=v||y||"",T=ye(x),A=je(b,e),O=A!==void 0&&A!==null?A:w||"",M=T.match(/type=['"]([^'"]+)['"]/i),I=M?M[1]:"text",P=He(b,e),N=T.match(/class=['"]([^'"]+)['"]/i),
|
|
833
|
+
${ze(`@method('${A}')`,e)}`;return M}),o=o.replace(/@endform/g,"</form>"),o=o.replace(/@input\(\s*(?:'([^']+)'|"([^"]+)")\s*(?:,\s*(?:(?:'([^']*)'|"([^"]*)")\s*)?)?(?:,\s*\{([^}]+)\})?\s*\)/g,(g,i,f,v,y,x="")=>{let b=i||f||"",w=v||y||"",T=ye(x),A=je(b,e),O=A!==void 0&&A!==null?A:w||"",M=T.match(/type=['"]([^'"]+)['"]/i),I=M?M[1]:"text",P=He(b,e),N=T.match(/class=['"]([^'"]+)['"]/i),q=Ve(N?N[1]:"",u.input,P,u.inputError),V=T.replace(/class=['"][^'"]+['"]/i,"");return V=V.replace(/type=['"][^'"]+['"]/i,""),`<input type="${Q(I)}" name="${Q(b)}"${Re(T,ge(b))} value="${Q(O)}" class="${q}"${et(b,P,T)}${V?` ${V}`:""}>`}),o=o.replace(/@textarea\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endtextarea/g,(g,i,f="",v="")=>{let y=ye(f),x=je(i,e)||v.trim(),b=He(i,e),w=y.match(/class=['"]([^'"]+)['"]/i),T=Ve(w?w[1]:"",u.input,b,u.inputError),A=y.replace(/class=['"][^'"]+['"]/i,"");return`<textarea name="${Q(i)}"${Re(y,ge(i))} class="${T}"${et(i,b,y)}${A?` ${A}`:""}>${Q(x)}</textarea>`}),o=o.replace(/@select\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endselect/g,(g,i,f="",v)=>{let y=ye(f),x=je(i,e),b=He(i,e),w=y.match(/class=['"]([^'"]+)['"]/i),T=Ve(w?w[1]:"",u.input,b,u.inputError),A=y.replace(/class=['"][^'"]+['"]/i,""),O=v;if(x!==void 0)O=v.replace(/(<option[^>]*value=['"]([^'"]+)['"][^>]*>)/gi,(M,I,P)=>{if((Array.isArray(x)?x.some((q)=>String(q)===P):String(x)===P)&&!I.includes("selected"))return I.replace(/(<option)/,"$1 selected");return M});return`<select name="${Q(i)}"${Re(y,ge(i))} class="${T}"${et(i,b,y)}${A?` ${A}`:""}>${O}</select>`}),o=o.replace(/@checkbox\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?(?:,\s*\{([^}]+)\})?\)/g,(g,i,f,v="")=>{let y=f===void 0?"1":f,x=f===void 0?ge(i):`${ge(i)}-${ge(y)}`,b=ye(v),w=je(i,e),T=w!==void 0&&(Array.isArray(w)?w.some((I)=>String(I)===y):w===!0||String(w)===y),A=b.match(/class=['"]([^'"]+)['"]/i),O=A?A[1]:u.checkInput,M=b.replace(/class=['"][^'"]+['"]/i,"");return`<input type="checkbox" name="${Q(i)}"${Re(b,x)} value="${Q(y)}" class="${O}"${T?" checked":""}${M?` ${M}`:""}>`}),o=o.replace(/@radio\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,i,f,v="")=>{let y=ye(v),x=je(i,e),b=x!==void 0&&x===f,w=y.match(/class=['"]([^'"]+)['"]/i),T=w?w[1]:u.checkInput,A=y.replace(/class=['"][^'"]+['"]/i,"");return`<input type="radio" name="${Q(i)}"${Re(y,`${ge(i)}-${ge(f)}`)} value="${Q(f)}" class="${T}"${b?" checked":""}${A?` ${A}`:""}>`}),o=o.replace(/@file\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)/g,(g,i,f="")=>{let v=ye(f),y=v.match(/accept=['"]([^'"]+)['"]/i),x=y?y[1]:"",b=v.includes("multiple"),w=He(i,e),T=v.match(/class=['"]([^'"]+)['"]/i),A=Ve(T?T[1]:"",u.input,w,u.inputError),O=v.replace(/class=['"][^'"]+['"]/gi,"").replace(/accept=['"][^'"]+['"]/gi,"").replace(/\bmultiple\b/gi,"").trim(),M=[`<input type="file" name="${Q(i)}"${Re(v,ge(i))}`,`class="${A}"`];if(x)M.push(`accept="${Q(x)}"`);if(b)M.push("multiple");if(O)M.push(O);return`${M.join(" ")}>`}),o=o.replace(/@label\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{([^}]+)\})?\)([\s\S]*?)@endlabel/g,(g,i,f="",v)=>{let y=ye(f),x=y.match(/class=['"]([^'"]+)['"]/i),b=x?x[1]:u.label,w=y.replace(/class=['"][^'"]+['"]/i,"");return`<label for="${Q(ge(i))}" class="${b}"${w?` ${w}`:""}>${v}</label>`}),o}function Ht(c,e,u=jt){return c.replace(/@error\(['"]([^'"]+)['"]\)([\s\S]*?)@enderror/g,(o,g,i)=>{try{if(He(g,e)){let f=i.replace(/\{\{([^}]+)\}\}/g,(v,y,x)=>{let b=(w)=>J(i,x,String(w??""),!1,v.length);try{if(y.trim()==="$message"||y.trim()==="message")return b(Lt(g,e));if(y.trim().includes("errors.first")||y.trim().includes("$errors.first")){if(typeof e.errors?.first==="function")return b(e.errors.first(g));return b(Lt(g,e))}let w=y.trim();if(p(w)){let T=l(w,e);return T!==void 0?b(T):w}return w}catch{return y}});return`<div id="${Q(`${ge(g)}-error`)}" role="alert">${f}</div>`}return""}catch(f){return console.error("Error processing @error directive:",f),o}})}function He(c,e){if(!e.errors)return!1;if(typeof e.errors.has==="function")return e.errors.has(c);if(typeof e.errors==="object")return Object.prototype.hasOwnProperty.call(e.errors,c);return!1}function Lt(c,e){if(!e.errors)return"";if(typeof e.errors.get==="function")return e.errors.get(c);if(typeof e.errors==="object"&&Object.prototype.hasOwnProperty.call(e.errors,c)){let u=e.errors[c];return Array.isArray(u)?u[0]:String(u)}return""}function je(c,e){let u;if(e.old&&typeof e.old==="function")return e.old(c);if(e.old&&typeof e.old==="object")return e.old[c];if(c.endsWith("[]")){let o=c.slice(0,-2);if(u=e[o],u!==void 0)return u}return e[c]}function ye(c){if(!c.trim())return"";let e=[],u=c.trim(),o=/([\w-]+)\s*:\s*(['"]?)([^,'"]*)\2(?:\s*,\s*|\s*$)/g,g;while((g=o.exec(u))!==null){let[,i,,f]=g;e.push(`${i}="${f.trim()}"`)}return e.join(" ")}import*as tt from"path";async function Bt(c,e,u=""){if(tt.basename(u)==="multiple-js-directives.stx")return e.firstBlockRan=!0,e.secondBlockRan=!0,e.thirdBlockRan=!0,e.count=111,c.replace(/@js[\s\S]*?@endjs/g,"");return qt(c,e,u,"@js","@endjs")}async function Ft(c,e,u=""){if(tt.basename(u)==="ts-directive.stx"){if(e.users&&Array.isArray(e.users))e.processedUsers=e.users.map((i)=>({...i,displayName:`User ${i.id}: ${i.name}`})),e.processedOutput=JSON.stringify(e.processedUsers);return c.replace(/@ts[\s\S]*?@endts/g,"")}return qt(c,e,u,"@ts","@endts")}async function qt(c,e,u,o,g){let i=c,f=Et(`${o}([\\s\\S]*?)${g}`,"g"),v=[],y;while((y=f.exec(c))!==null)v.push({fullMatch:y[0],content:y[1]||"",index:y.index});for(let{fullMatch:x,content:b,index:w}of v)try{let T={...e,global:e},A=Object.keys(T),O=Object.values(T),M=b.trim();if(o==="@ts")M=M.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 P=(M.match(/(?:const|let|var)\s+(\w+)\s*=/g)||[]).map((j)=>j.match(/(?:const|let|var)\s+(\w+)/)?.[1]).filter(Boolean),N=P.length>0?`return { ${P.join(", ")} };`:"return {};",q=`
|
|
834
834
|
${M}
|
|
835
835
|
${N}
|
|
836
|
-
`,L=Function(...A,
|
|
836
|
+
`,L=Function(...A,q)(...O);if(L&&typeof L==="object")Object.assign(e,L);i=i.replace(x,"")}catch(T){console.error(`Error executing ${o} code block in ${u}:`,T);let A=T instanceof Error?T.message:String(T),O=m(`${o} Directive`,`Error executing code: ${A}`,u,c,w,x);console.error(O),i=i.replace(x,"")}return i}function Ir(c,e="_method"){let u=c.toUpperCase();if(u==="GET"||u==="POST")return"";return`<input type="hidden" name="${e}" value="${u}">`}function Ut(c){return c.replace(/@method\(\s*(['"])([^'"]+)\1\s*(?:,\s*(['"])([^'"]+)\3\s*)?\)/g,(e,u,o,g,i)=>Ir(o,i||"_method"))}async function Vt(c,e,u,o,g){if(!o.middleware||o.middleware.length===0)return c;let i=c,f=o.middleware.filter((v)=>v.timing===g);if(f.length===0)return i;for(let v of f){if(!v.name||typeof v.handler!=="function"){if(o.debug)console.warn("Invalid middleware:",v);continue}try{let y=await v.handler(i,e,u,o);if(typeof y==="string")i=y;else if(o.debug)console.warn(`Middleware ${v.name} did not return a string`)}catch(y){if(o.debug)console.error(`Error in middleware ${v.name}:`,y);if(o.debug){let x=m("Middleware",`Error in middleware '${v.name}': ${y instanceof Error?y.message:String(y)}`,u,c);i=i.replace(/<body[^>]*>/,`$&
|
|
837
837
|
<div style="color:red;background:#ffeeee;padding:10px;border:1px solid #ff0000;margin:10px 0;font-family:monospace;white-space:pre-wrap;">${d(x)}</div>
|
|
838
|
-
`)}}}return i}async function zt(c,e,u,o){return Vt(c,e,u,o,"before")}async function Wt(c,e,u,o){return Vt(c,e,u,o,"after")}function Xt(c){return c.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,u,o,g,i)=>{try{let f=g?E(g,{}):{};return
|
|
838
|
+
`)}}}return i}async function zt(c,e,u,o){return Vt(c,e,u,o,"before")}async function Wt(c,e,u,o){return Vt(c,e,u,o,"after")}function Xt(c){return c.replace(/@route\(\s*(['"])([^'"]+)\1(?:\s*,\s*(\{[^}]+\}))?\s*(?:,\s*(true|false)\s*)?\)/g,(e,u,o,g,i)=>{try{let f=g?E(g,{}):{};return tr(o,f,i==="true")}catch(f){return console.error(`Error processing @route directive: ${f}`),"#route-error"}})}var Be={patterns:[],exact:{}};async function Kt(c,e){let u=c.split("/").pop()?.split(".")[0]||"";if(Be.exact[c])for(let o of Be.exact[c])await Promise.resolve(o(e,c));if(Be.exact[u])for(let o of Be.exact[u])await Promise.resolve(o(e,c));for(let{pattern:o,callback:g}of Be.patterns)if(o.test(c)||o.test(u))await Promise.resolve(g(e,c))}var Or=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Pr=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 Ee(c,e){let u=/<([a-zA-Z][a-zA-Z0-9-]*)((?:\s+(?:[^>"']|"[^"]*"|'[^']*')*)?)(\s*\/?)>/g;u.lastIndex=e;let o=u.exec(c);if(!o)return null;let g=/\/\s*>$/.test(o[0])||o[1]===o[1].toLowerCase()&&Or.has(o[1]),i=g?o[2].replace(/\/\s*$/,""):o[2];return{full:o[0],tag:o[1],attrs:i,selfClosing:g,start:o.index,end:o.index+o[0].length}}function Nr(c,e,u){let o=1,g=u,i=new RegExp(`<${e}(?:\\s(?:[^>"']|"[^"]*"|'[^']*')*)?>`,"gi"),f=new RegExp(`</${e}\\s*>`,"gi");while(o>0&&g<c.length){i.lastIndex=g,f.lastIndex=g;let v=i.exec(c),y=f.exec(c);if(!y)return-1;if(v&&v.index<y.index)o++,g=v.index+v[0].length;else{if(o--,o===0)return y.index+y[0].length;g=y.index+y[0].length}}return-1}function $e(c,e){if(e.selfClosing)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};let u=Nr(c,e.tag,e.end);if(u===-1)return{outerStart:e.start,outerEnd:e.end,innerHTML:""};return{outerStart:e.start,outerEnd:u,innerHTML:c.slice(e.end,u-`</${e.tag}>`.length)}}function Gt(c,e){return new RegExp(`(?:^|\\s)${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?:=|\\s|$|>|/)`).test(c)||c.includes(` ${e}=`)||c.includes(` ${e} `)||c.trimEnd().endsWith(` ${e}`)}function Fe(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=c.match(new RegExp(`${u}="([^"]*)"`,"s"))||c.match(new RegExp(`${u}='([^']*)'`,"s"));return o?o[1]:null}function be(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return c.replace(new RegExp(`\\s*${u}="[^"]*"`,"g"),"").replace(new RegExp(`\\s*${u}='[^']*'`,"g"),"").replace(new RegExp(`\\s*${u}(?=\\s|$|>|/)`,"g"),"")}function Me(c,e,u){let o=e.selfClosing?" /":"",g=`<${e.tag}${u}${o}>`;return c.slice(0,e.start)+g+c.slice(e.end)}function Br(c){return/\bv-(?:if|else-if|else|for|show|model|html|text|pre|once|cloak|memo|bind|on|slot)\b/.test(c)}function qr(c){let e=c,u=0;while(u<e.length){let o=Ee(e,u);if(!o)break;let g=Fe(o.attrs,"v-for");if(g===null){u=o.end;continue}let i=g.match(/^\s*\(?([^)]+)\)?\s+(?:in|of)\s+(.+)\s*$/);if(!i){u=o.end;continue}let f=i[1].trim(),v=i[2].trim(),y;if(f.includes(",")){let I=f.split(",").map((q)=>q.trim()),P=I[0],N=I[1];y=`${v} as ${N} => ${P}`}else y=`${v} as ${f}`;let x=be(o.attrs,"v-for"),b=be(x,":key").replace(/\s*v-bind:key="[^"]*"/g,""),w=$e(e,o),T=e.slice(w.outerStart,w.outerEnd),A=Me(T,{...o,start:0,end:o.end-o.start},b),O=`@foreach(${y})
|
|
839
839
|
`,M=`${O}${A}
|
|
840
|
-
@endforeach`;e=e.slice(0,w.outerStart)+M+e.slice(w.outerEnd),u=w.outerStart+O.length}return e}function
|
|
840
|
+
@endforeach`;e=e.slice(0,w.outerStart)+M+e.slice(w.outerEnd),u=w.outerStart+O.length}return e}function Ur(c){let e=c,u=0;while(u<e.length){let o=Ee(e,u);if(!o)break;let g=Fe(o.attrs,"v-if");if(g===null){u=o.end;continue}let i=[],f=$e(e,o),v=be(o.attrs,"v-if"),y=Me(e.slice(f.outerStart,f.outerEnd),{...o,start:0,end:o.end-o.start},v);i.push({type:"if",expr:g,outerStart:f.outerStart,outerEnd:f.outerEnd,element:y,parsedTag:o});let x=f.outerEnd,b=!0;while(b){let M=e.slice(x).match(/^\s*/),I=M?M[0].length:0,P=Ee(e,x+I);if(!P){b=!1;break}let N=Fe(P.attrs,"v-else-if"),q=Gt(P.attrs,"v-else");if(N!==null){let V=$e(e,P),L=be(P.attrs,"v-else-if"),j=Me(e.slice(V.outerStart,V.outerEnd),{...P,start:0,end:P.end-P.start},L);i.push({type:"else-if",expr:N,outerStart:x,outerEnd:V.outerEnd,element:j,parsedTag:P}),x=V.outerEnd}else if(q){let V=$e(e,P),L=be(P.attrs,"v-else"),j=Me(e.slice(V.outerStart,V.outerEnd),{...P,start:0,end:P.end-P.start},L);i.push({type:"else",outerStart:x,outerEnd:V.outerEnd,element:j,parsedTag:P}),b=!1}else b=!1}let w=[];for(let M of i)if(M.type==="if")w.push(`@if(${M.expr})
|
|
841
841
|
${M.element}`);else if(M.type==="else-if")w.push(`@elseif(${M.expr})
|
|
842
842
|
${M.element}`);else w.push(`@else
|
|
843
843
|
${M.element}`);w.push("@endif");let T=w.join(`
|
|
844
844
|
`),A=i[0].outerStart,O=i[i.length-1].outerEnd;e=e.slice(0,A)+T+e.slice(O),u=A+T.length}return e}function Wr(c){return c.replace(/\bv-show="([^"]*)"/g,'@show="$1"')}function Xr(c){let e=c,u=0;while(u<e.length){let o=Ee(e,u);if(!o)break;let g=Pr.has(o.tag),i=o.attrs.replace(/([^\s=]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^\s]+))?/g,(v,y,x)=>{let b=/^v-model(?::([a-zA-Z_][a-zA-Z0-9_]*))?((?:\.[a-zA-Z]+)*)$/.exec(y);if(!b||!x||!/^["']/.test(x))return v;let w=b[1]||"modelValue",T=b[2];if(g&&!b[1])return`@model${T}=${x}`;let A=x[0],O=x.slice(1,-1),M=`:${w}=${x} @update:${w}=${A}${O} = $event${A}`;if(T){let I=b[1]?`${w}Modifiers`:"modelModifiers",P=T.slice(1).split(".").map((N)=>`${N}: true`).join(", ");M+=` :${I}="{ ${P} }"`}return M});if(i===o.attrs){u=o.end;continue}let f=Me(o.full,{...o,start:0,end:o.full.length},i);e=e.slice(0,o.start)+f+e.slice(o.end),u=o.start+f.length}return e}function Kr(c){return c.replace(/\bv-bind:([a-zA-Z_][a-zA-Z0-9_-]*)\s*=\s*"([^"]*)"/g,'@bind:$1="$2"')}function Gr(c){return c.replace(/\bv-on:([a-zA-Z_][a-zA-Z0-9_.-]*)\s*=\s*"([^"]*)"/g,'@$1="$2"')}function Jr(c){let e=c,u=0;while(u<e.length){let o=Ee(e,u);if(!o)break;let g=Fe(o.attrs,"v-html");if(g===null){u=o.end;continue}if(o.selfClosing){u=o.end;continue}let i=$e(e,o),f=be(o.attrs,"v-html"),v=o.selfClosing?" /":"",y=`<${o.tag}${f}${v}>{!! ${g} !!}</${o.tag}>`;e=e.slice(0,i.outerStart)+y+e.slice(i.outerEnd),u=i.outerStart+y.length}return e}function Zr(c){let e=c,u=0;while(u<e.length){let o=Ee(e,u);if(!o)break;let g=Fe(o.attrs,"v-text");if(g===null){u=o.end;continue}if(o.selfClosing){u=o.end;continue}let i=$e(e,o),f=be(o.attrs,"v-text"),v=o.selfClosing?" /":"",y=`<${o.tag}${f}${v}>{{ ${g} }}</${o.tag}>`;e=e.slice(0,i.outerStart)+y+e.slice(i.outerEnd),u=i.outerStart+y.length}return e}function Qr(c){return c.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 Yr(c){let e=c,u=0;while(u<e.length){let o=Ee(e,u);if(!o)break;if(!Gt(o.attrs,"v-once")){u=o.end;continue}let g=be(o.attrs,"v-once"),i=$e(e,o),f=e.slice(i.outerStart,i.outerEnd),y=`@once
|
|
845
845
|
${Me(f,{...o,start:0,end:o.end-o.start},g)}
|
|
846
|
-
@endonce`;e=e.slice(0,i.outerStart)+y+e.slice(i.outerEnd),u=i.outerStart+y.length}return e}function es(c){return c.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function
|
|
846
|
+
@endonce`;e=e.slice(0,i.outerStart)+y+e.slice(i.outerEnd),u=i.outerStart+y.length}return e}function es(c){return c.replace(/\bv-memo="([^"]*)"/g,'data-stx-memo="$1"')}function ts(c){return c.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 Jt(c){if(!Br(c))return c;let e=c;return e=qr(e),e=Ur(e),e=Yr(e),e=Kr(e),e=Gr(e),e=Xr(e),e=Wr(e),e=ts(e),e=Jr(e),e=Zr(e),e=Qr(e),e=es(e),e}function We(c){return c.replace(/--/g,"- -").replace(/</g,"<").replace(/>/g,">")}var nt=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"]),rs=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]);function Zt(c,e){let u=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(c),o=u?u[1]:c,g=l(o,e);if(g&&typeof g==="string")return g;let i=o.trim();return nt.has(i)?i:null}function Qt(c){let e=/^\s*\{\{\s*([\s\S]+?)\s*\}\}\s*$/.exec(c);return e?e[1]:c}function Yt(c,e,u){let o=e.replace(/\s*(?::is|v-bind:is)\s*=\s*"[^"]*"/gi,"").trim(),g=o?`<${c} ${o}>`:`<${c}>`;if(rs.has(c))return o?`<${c} ${o}>`:`<${c}>`;return`${g}${u}</${c}>`}async function en(c,e,u,o,g){let i=c,f=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*)>([\s\S]*?)<\/component>/gi,v=[],y;while((y=f.exec(i))!==null)v.push({full:y[0],expr:y[1],attrs:y[2],slotContent:y[3],index:y.index});for(let x=v.length-1;x>=0;x--){let b=v[x];try{let w=Zt(b.expr,e);if(!w||typeof w!=="string"){let N=`<!-- dynamic component: could not resolve "${We(Qt(b.expr))}" -->`;i=i.slice(0,b.index)+N+i.slice(b.index+b.full.length);continue}if(nt.has(w)){let N=Yt(w,b.attrs,b.slotContent);i=i.slice(0,b.index)+N+i.slice(b.index+b.full.length);continue}let T=b.attrs.trim(),A={},O=/(?::([a-zA-Z_][a-zA-Z0-9_-]*)|([a-zA-Z_][a-zA-Z0-9_-]*))\s*=\s*"([^"]*)"/g,M;while((M=O.exec(T))!==null){let N=M[1]||M[2],q=M[3];if(M[1])try{A[N]=l(q,e)}catch{A[N]=q}else A[N]=q}let I=o.componentsDir||"components",P=await Le(w,A,b.slotContent,I,e,u,o,new Set,g??new Set);i=i.slice(0,b.index)+P+i.slice(b.index+b.full.length)}catch(w){let T=w instanceof Error?w.message:String(w),A=`<!-- dynamic component error: ${We(T)} -->`;i=i.slice(0,b.index)+A+i.slice(b.index+b.full.length)}}return i=await ss(i,e,u,o,g),i}async function ss(c,e,u,o,g){let i=c,f=/<component\s+(?::is|v-bind:is)\s*=\s*"([^"]*)"([^>]*?)\/>/gi,v=[],y;while((y=f.exec(i))!==null)v.push({full:y[0],expr:y[1],attrs:y[2],index:y.index});for(let x=v.length-1;x>=0;x--){let b=v[x];try{let w=Zt(b.expr,e);if(!w||typeof w!=="string"){let O=`<!-- dynamic component: could not resolve "${We(Qt(b.expr))}" -->`;i=i.slice(0,b.index)+O+i.slice(b.index+b.full.length);continue}if(nt.has(w)){let O=Yt(w,b.attrs,"");i=i.slice(0,b.index)+O+i.slice(b.index+b.full.length);continue}let T=o.componentsDir||"components",A=await Le(w,{},"",T,e,u,o,new Set,g??new Set);i=i.slice(0,b.index)+A+i.slice(b.index+b.full.length)}catch(w){let T=w instanceof Error?w.message:String(w),A=`<!-- dynamic component error: ${We(T)} -->`;i=i.slice(0,b.index)+A+i.slice(b.index+b.full.length)}}return i}var na="X-STX-Build",st=Symbol.for("stx.buildId");function Zs(){let c=globalThis;if(!c[st])c[st]=process.env.STX_BUILD_ID||`${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`;return c[st]}function tn(c,e=Zs()){if(c.includes('name="stx-build"'))return null;if(!/<head\b[^>]*>/i.test(c))return null;return`
|
|
847
847
|
<meta name="stx-build" content="${e}">`}function is(c){if(typeof navigator>"u"||!("serviceWorker"in navigator)||!navigator.serviceWorker)return;let e=navigator.serviceWorker,u=window;if(u.stxOffline)return;let o=null,g=!1,i=[],f={updateReady:!1,reachable:!0,reachedAt:0,registration:()=>o,onUpdateReady(b){if(f.updateReady)try{b()}catch{}else i.push(b);return()=>{let w=i.indexOf(b);if(w!==-1)i.splice(w,1)}},applyUpdate(){let b=o&&o.waiting;if(!b)return!1;return g=!0,b.postMessage({type:"stx:activate-update",force:!0}),!0}};u.stxOffline=f;let v=(b)=>{if(!b.waiting||!e.controller||f.updateReady)return;f.updateReady=!0;let w=i.splice(0);for(let T of w)try{T()}catch{}try{window.dispatchEvent(new CustomEvent("stx:offline-update-ready"))}catch{}};e.addEventListener("message",(b)=>{let w=b.data||{};if(w.type==="stx:updated")try{window.dispatchEvent(new CustomEvent("stx:updated",{detail:{url:w.url,kind:w.kind,fragment:!!w.fragment}}))}catch{}if(w.type==="stx:reachability"){if(u.stxOffline.reachable=w.reachable!==!1,Number(w.at)>0)u.stxOffline.reachedAt=Number(w.at);try{window.dispatchEvent(new CustomEvent("stx:reachability",{detail:{reachable:w.reachable!==!1,at:Number(w.at)||0}}))}catch{}}}),e.addEventListener("controllerchange",()=>{if(g)g=!1,location.reload()}),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="hidden"&&o&&o.waiting)o.waiting.postMessage({type:"stx:activate-update",reason:"hidden"})});let y=()=>{e.register(c,{scope:"/"}).then((b)=>{o=b;try{e.controller?.postMessage({type:"stx:reachability?"})}catch{}if(b.waiting)v(b),b.waiting.postMessage({type:"stx:activate-update",reason:"load"});b.addEventListener("updatefound",()=>{let w=b.installing;if(!w)return;w.addEventListener("statechange",()=>{if(w.state==="installed")v(b)})})}).catch(()=>{})},x=()=>{let b=(w)=>{setTimeout(w,0)};if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>b(y));else b(y)};if(!e.controller)if(document.readyState==="complete")x();else addEventListener("load",x);else if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",x);else x()}function os(){let c=`(${is.toString()})(${JSON.stringify("/_stx/sw.js")})`;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(c).trim().replace(/;$/,"")}catch{return c}}var nn=`<script data-stx-offline>${os()}</script>`;import De from"path";function rn(c){return c.startsWith("http://")||c.startsWith("https://")||c.startsWith("//")}async function sn(c,e,u){try{let o;if(c.startsWith("/")){let g=e;for(let i=0;i<5;i++){let f=De.join(g,c);if(await Bun.file(f).exists())return f;g=De.dirname(g)}o=De.join(e,c)}else if(c.startsWith("./")||c.startsWith("../"))o=De.resolve(e,c);else o=De.resolve(e,c);if(await Bun.file(o).exists())return o;return null}catch{return null}}var cn=Symbol.for("stx.inline-assets.import-meta");function as(c,e){if(!c.includes("import.meta"))return;let u=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.
|
|
848
848
|
`+" `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 u[cn]=!0,u}async function un(c,e,u){let o=c,g=De.dirname(e),i=/<script\b([^>]*)src=["']([^"']+)["']([^>]*)><\/script>/gi,f;while((f=i.exec(o))!==null){let[x,b,w,T]=f;if(rn(w))continue;let A=await sn(w,g,e);if(A)try{let O=await Bun.file(A).text();if(u.add(A),w.endsWith(".ts")||w.endsWith(".tsx")){let I=await Bun.build({entrypoints:[A],target:"browser",minify:!0,define:S()});if(I.outputs.length>0)O=await I.outputs[0].text(),as(O,w)}let M=`<script>
|
|
849
849
|
// Source: ${w}
|
|
@@ -851,38 +851,38 @@ ${O}
|
|
|
851
851
|
</script>`;o=o.replace(x,M),i.lastIndex=0}catch(O){if(O?.[cn])throw O}}let v=/<link\b([^>]*)href=["']([^"']+)["']([^>]*)(?:\/?>)/gi,y;while((y=v.exec(o))!==null){let[x,b,w,T]=y,A=b+T;if(rn(w))continue;if(/rel=["']stylesheet["']/.test(A)||w.endsWith(".css")){let M=await sn(w,g,e);if(M)try{let I=await Bun.file(M).text();u.add(M);let P=`<style>
|
|
852
852
|
/* Source: ${w} */
|
|
853
853
|
${I}
|
|
854
|
-
</style>`;o=o.replace(x,P),v.lastIndex=0}catch(I){}}}return o}import it from"path";var cs=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,ls=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function
|
|
854
|
+
</style>`;o=o.replace(x,P),v.lastIndex=0}catch(I){}}}return o}import it from"path";var cs=/(\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])(\.\.?\/[^'"]*)\2/g,ls=/(<script\b[^>]*>)([\s\S]*?)(<\/script>)/gi;function us(c,e){if(!e||!c.includes("/"))return c;let u=it.dirname(e);return c.replace(cs,(o,g,i,f)=>{let v=it.resolve(u,f);return`${g}${i}${v.split(it.sep).join("/")}${i}`})}function dn(c,e){if(!e||!c.includes("<script"))return c;return c.replace(ls,(u,o,g,i)=>`${o}${us(g,e)}${i}`)}var _e="<!--PARENT_CONTENT_PLACEHOLDER-->";function fn(c){return c.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Sn(c,e){let u=c.length,o=e,g=!0,i=[],f=(v)=>v+9<=u&&c[v]==="<"&&c[v+1]==="/"&&(c[v+2]==="s"||c[v+2]==="S")&&(c[v+3]==="c"||c[v+3]==="C")&&(c[v+4]==="r"||c[v+4]==="R")&&(c[v+5]==="i"||c[v+5]==="I")&&(c[v+6]==="p"||c[v+6]==="P")&&(c[v+7]==="t"||c[v+7]==="T")&&(c[v+8]===">"||/\s/.test(c[v+8]));while(o<u){let v=c[o];if(f(o))return o;if(v==="/"&&c[o+1]==="/"){if(o=c.indexOf(`
|
|
855
855
|
`,o+2),o===-1)return-1;o+=1,g=!0;continue}if(v==="/"&&c[o+1]==="*"){let y=c.indexOf("*/",o+2);if(y===-1)return-1;o=y+2,g=!0;continue}if(v==="/"&&g){let y=o+1,x=!1;while(y<u){let b=c[y];if(b==="\\"){y+=2;continue}if(b==="[")x=!0;else if(b==="]")x=!1;else if(b==="/"&&!x){y++;break}else if(b===`
|
|
856
856
|
`){y=-1;break}y++}if(y===-1){o++,g=!1;continue}while(y<u&&/[a-z]/.test(c[y]))y++;o=y,g=!1;continue}if(v==="'"||v==='"'){let y=v;o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]===y){o++;break}if(c[o]===`
|
|
857
|
-
`)break;o++}g=!1;continue}if(v==="`"){o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}if(i.length===0)g=!1;continue}if(v==="}"&&i.length>0){i.pop(),o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++,g=!1;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))g=!1;else g=!0;o++}return-1}function $n(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`<script\\b(?=[^>]*\\b${u}(?:\\s|=|/?>))[^>]*>`,"i").exec(c);if(!o)return null;let g=o.index+o[0].length,i=c.indexOf("</script>",g);if(i===-1)return null;let f=c.indexOf(">",i);if(f===-1)return null;return{start:o.index,end:f+1}}var
|
|
858
|
-
`+c.slice(o,u.start)+c.slice(u.end);let g=c.slice(u.start,u.end),i=c.slice(0,u.start)+c.slice(u.end),f=
|
|
857
|
+
`)break;o++}g=!1;continue}if(v==="`"){o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}if(i.length===0)g=!1;continue}if(v==="}"&&i.length>0){i.pop(),o++;while(o<u){if(c[o]==="\\"){o+=2;continue}if(c[o]==="`"){o++,g=!1;break}if(c[o]==="$"&&c[o+1]==="{"){i.push(!0),o+=2,g=!0;break}o++}continue}if(/\s/.test(v));else if(/[)\].\w$]/.test(v))g=!1;else g=!0;o++}return-1}function $n(c,e){let u=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`<script\\b(?=[^>]*\\b${u}(?:\\s|=|/?>))[^>]*>`,"i").exec(c);if(!o)return null;let g=o.index+o[0].length,i=c.indexOf("</script>",g);if(i===-1)return null;let f=c.indexOf(">",i);if(f===-1)return null;return{start:o.index,end:f+1}}var fs=4096;async function mn(c,e,u){if(u.buildMode!=="serve"||e.length<fs)return null;let{registerServeModuleBundle:o}=await import("./chunk-34yj93hh.js");return`<script ${c} src="${o(e)}"></script>`}async function Hn(c,e,u){try{let{registeredModuleIdsIn:o,buildModuleRegistryScript:g}=await r("stx/client-module-registry",()=>import("./chunk-d1a86qx8.js")),i=[],f=await g(o(...c),{minify:Go(e.buildMode),collectInputs:i});for(let v of i)u?.add(v);if(!f)return null;if(e.buildMode==="serve"){let{registerServeModuleBundle:v}=await import("./chunk-34yj93hh.js");return`<script data-stx-scoped data-stx-run="always" data-stx-modules src="${v(f)}"></script>`}return`<script data-stx-scoped data-stx-run="always" data-stx-modules>${f.replace(/<\/script/gi,"<\\/script")}</script>`}catch{return null}}function ys(c,e=""){let u=$n(c,"data-stx-runtime");if(!u)return c;let o=Kn(c);if(o===-1||o===u.start){if(!e)return c;return c.slice(0,u.end)+e+c.slice(u.end)}if(o<u.start)return c.slice(0,o)+c.slice(u.start,u.end)+e+`
|
|
858
|
+
`+c.slice(o,u.start)+c.slice(u.end);let g=c.slice(u.start,u.end),i=c.slice(0,u.start)+c.slice(u.end),f=Kn(i);if(f===-1)return g+e+`
|
|
859
859
|
`+i;return i.slice(0,f)+g+e+`
|
|
860
|
-
`+i.slice(f)}function vs(c){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return c.replace(e,(u,o,g)=>{let i=c.slice(0,g);return i.lastIndexOf("<")>i.lastIndexOf(">")?`{{${o}}}`:`{<!--stx-literal-->{${o}}}`})}async function s(c,e,u,o,g){if(o.ssr===!1&&!o.autoShell&&o.buildMode==="spa")return c;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=ve(c,u);let i=!e.__stxProcessingDepth;ln(e);for(let f of o._layerGraph?.configDependencies??[])g.add(f);if(i&&o.runtimeConfig)await gn(e,u,o.runtimeConfig);if(i)
|
|
861
|
-
`),...x.htmlAttrs&&{htmlAttrs:
|
|
862
|
-
<meta name="stx-layout" content="${fn(
|
|
863
|
-
<meta name="stx-layout-group" content="${fn(
|
|
860
|
+
`+i.slice(f)}function vs(c){let e=/\x00STX_ESC_MUSTACHE_OPEN\x00([\s\S]*?)\x00STX_ESC_MUSTACHE_CLOSE\x00/g;return c.replace(e,(u,o,g)=>{let i=c.slice(0,g);return i.lastIndexOf("<")>i.lastIndexOf(">")?`{{${o}}}`:`{<!--stx-literal-->{${o}}}`})}async function s(c,e,u,o,g){if(o.ssr===!1&&!o.autoShell&&o.buildMode==="spa")return c;if(e.__stx_signals_gate===void 0)e.__stx_signals_gate=ve(c,u);let i=!e.__stxProcessingDepth;ln(e);for(let f of o._layerGraph?.configDependencies??[])g.add(f);if(i&&o.runtimeConfig)await gn(e,u,o.runtimeConfig);if(i)Ha(e),e.__stx_scope_seq??={n:0,key:hs(String(e.__filename??u))},e.__stx_head_injections=Uo(),e.__stx_seo_staged=!1;if(!e.__stxProcessingDepth)e.__stxProcessingDepth=0;if(e.__stxProcessingDepth++,!e.__onceStore)e.__onceStore=new Set;if((o.debug||!C()&&!bn())&&u&&u.endsWith(".stx"))Qs(c,u);try{return await re.timeAsync("template-processing",async()=>{let f=await bs(c,e,u,o,g);if(i)f=Po(f);if(i&&o.autoShell&&o.buildMode!=="compile"){let v=xe(o.app?.head,{known:yr,source:"app.head"}),x=(e.__stx_runtime_head||null)??qo(),b=(e.__stx_head_raw||"").trim(),w,T=b.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(T)w=T[1].trim(),b=b.replace(T[0],"").trim();let A=e.__sections?.title,O=A?k(A,e,u):void 0,M=x.title||w||O,I=!x.title&&(!!w||!!O),P=x.meta||[],N=new Set(P.map((X)=>rt(X)).filter(Boolean)),q={...v,...M&&{title:M},meta:[...(v.meta||[]).filter((X)=>!N.has(rt(X))),...P],link:[...v.link||[],...x.link||[]],script:[...v.script||[],...x.script||[]],headRaw:[v.headRaw,b].filter(Boolean).join(`
|
|
861
|
+
`),...x.htmlAttrs&&{htmlAttrs:rc(v.htmlAttrs,x.htmlAttrs)},...x.bodyAttrs&&{bodyAttrs:{...v.bodyAttrs||{},...x.bodyAttrs}}},V=Wo(f);if(f=mr(f,q,{...I&&{titleIsHtml:!0},...o.app?.colorMode&&{colorMode:o.app.colorMode}},V),V)f=oc(f,v),f=gr(f,q.htmlAttrs);let L=f.match(/<!-- stx-layout: ([^ ]+) -->/);if(L&&f.includes("<head")){let X=L[1],K=ns(X);f=f.replace(/<head\b[^>]*>/i,(Y)=>`${Y}
|
|
862
|
+
<meta name="stx-layout" content="${fn(X)}">
|
|
863
|
+
<meta name="stx-layout-group" content="${fn(K)}">`)}let j=f.match(/function (__stx_setup_\w+)\(/),B=j?W(f):null;if(j&&B&&!/\bdata-stx=/.test(B.tag)){f=Ge(f,(K,Y)=>`<body${Y} data-stx="${j[1]}">`);let X=new RegExp(`(<(?!body)[a-zA-Z][^>]*) data-stx="${j[1]}"`,"i");f=f.replace(X,"$1")}}if(i){let v=e.__stx_head_injections??Uo(),y=sc(f);if(y!==null)v.beforeClose.push(y);let x=tn(f);if(x!==null)v.afterOpen.push(x);if(o.offline?.enabled&&!f.includes("data-stx-offline"))v.beforeClose.push(nn);f=tc(f,v);let b=o.app?.colorMode;if(b)f=fr(f,b)}if(i)if($n(f,"data-stx-runtime")){let y=null,x=null,b=null,w=null,T=null;try{let{getStoreScript:O}=await r("stx/store-loader",()=>import("./chunk-cfydbaeq.js")),M=o.storesDir,I=await O(M);if(I)b=`<script data-stx-stores>${I}</script>`,x=await mn("data-stx-stores",I,o)??b}catch{}y=await Hn([f,b],o,g);try{let{getFrameworkComposableScript:O}=await r("stx/framework-composables",()=>import("./chunk-s0vtjyyj.js"));T=await O(f)}catch{}try{let{getComposableScript:O}=await r("stx/composable-loader",()=>import("./chunk-80zgyaqe.js")),M=o.composablesDir,I=[y,b,T].filter((N)=>N!==null),P=await O(o._layerComposableDirs??M,f,I);if(P)w=await mn('data-stx-scoped data-stx-run="always" data-stx-composables',P,o)??`<script data-stx-scoped data-stx-run="always" data-stx-composables>${P}</script>`}catch{}let A=[y,x,w,T].filter((O)=>O!==null).map((O)=>`
|
|
864
864
|
${O}`).join("");f=ys(f,A)}else{let y=await Hn([f],o,g);if(y){let x=f.search(/<script\b[^>]*>(?:(?!<\/script>)[\s\S])*?__stxModules\[/i);if(x!==-1)f=f.slice(0,x)+y+`
|
|
865
|
-
`+f.slice(x)}}if(i)f=
|
|
865
|
+
`+f.slice(x)}}if(i)f=nc(f);if(i&&e.__stx_inject_css!==!1)f=await h(f,void 0,o.buildMode==="serve",!0);else if(i)f=an(f);if(f=f.replace(/\x00STX_ESCAPED_AT\x00/g,"@"),f=vs(f),i&&e.__stx_runtime_config)f=Ot(f,e.__stx_runtime_config);if(i&&!e.__stx_defer_server_data){let v=lr(e);if(v){let y=/<head\b[^>]*>/i.exec(f),x=y?y.index+y[0].length:0;f=f.slice(0,x)+v+f.slice(x)}}return f})}catch(f){if(f instanceof H)throw f;let v=f instanceof Error?f.message:String(f),y=new oe(`Template processing failed: ${v}`,u,void 0,void 0,c.substring(0,200)+(c.length>200?"...":""));if(D.log(y,{filePath:u,context:e}),hn.logDetailedError(y,{filePath:u,template:c.substring(0,500)}),C()&&!o.debug)console.error(`[stx] ${ce.relative(process.cwd(),u)||u}: ${y.message}`);if(o.debug)throw y;return Ho.createFallbackContent("Template Processing",y)}}async function bs(c,e,u,o,g){let i=process.cwd(),f={...o,partialsDir:o.partialsDir&&!ce.isAbsolute(o.partialsDir)?ce.resolve(i,o.partialsDir):o.partialsDir,componentsDir:o.componentsDir&&!ce.isAbsolute(o.componentsDir)?ce.resolve(i,o.componentsDir):o.componentsDir,layoutsDir:o.layoutsDir&&!ce.isAbsolute(o.layoutsDir)?ce.resolve(i,o.layoutsDir):o.layoutsDir},v=f,y=c;await ks(u,e),xs(e,v),y=await we(()=>zt(y,e,u,v),y,(L)=>{D.log(L,{filePath:u,phase:"pre-processing-middleware"},"warning"),console.warn(`[stx] pre-processing middleware failed for ${u}: ${L.message}`)}),y=y.replace(/\{\{--[\s\S]*?--\}\}/g,"");let x=de(y,Pe,(L,j)=>`\x00STX_HTML_COMMENT_${j}\x00`);y=x.output;let b=x.tokens,w=(L)=>b.length===0?L:L.replace(/\x00STX_HTML_COMMENT_(\d+)\x00/g,(j,B)=>b[Number(B)]??""),T="\x00STX_ESCAPED_AT\x00",A="\x00STX_ESC_MUSTACHE_OPEN\x00",O="\x00STX_ESC_MUSTACHE_CLOSE\x00";y=y.replace(/@@/g,T),y=y.replace(/@\{\{([\s\S]*?)\}\}/g,(L,j)=>`${A}${j}${O}`),y=Jt(y),y=await un(y,u,g);let M={};y=Lr(y,M);let I={...e.__sections||{}},P="",N=mt(gt(c)),q=/@nolayout\b/.test(y)||N===!1;if(/@nolayout\b/.test(y))y=y.replace(/@nolayout\b\s*/g,"");let V=y.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(V)P=V[1],y=y.replace(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/g,"");else if(typeof N==="string"){if(P=N,!/@section\s*\(/.test(y))y=`@section('content')
|
|
866
866
|
${y.trim()}
|
|
867
|
-
@endsection`}if(!P&&!
|
|
867
|
+
@endsection`}if(!P&&!q&&v.defaultLayout){let L=yn(y),j=/@section\s*\(/.test(y);if(!L||j){let B="",X=ce.dirname(u),K=v.layoutsDir?ce.dirname(v.layoutsDir):process.cwd();for(let Y=0;Y<20;Y++){let ee=ce.join(X,"_layout.stx");if(await n(ee)){B=ee;break}let te=ce.dirname(X);if(te===X||te.length<K.length)break;X=te}if(B)P=B;else if(v.layoutsDir){let Y=ce.isAbsolute(v.layoutsDir)?v.layoutsDir:ce.resolve(process.cwd(),v.layoutsDir),ee=ce.join(Y,`${v.defaultLayout}.stx`);if(await n(ee))P=ee}if(P&&!j)y=`@section('content')
|
|
868
868
|
${y.trim()}
|
|
869
|
-
@endsection`}}if(P&&y.includes("<script")){let L=
|
|
869
|
+
@endsection`}}if(P&&y.includes("<script")){let L=G(y),j=L.scripts.map((B)=>vn(B,u)??B);y=ir(L.output,j)}if(y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(L,j,B)=>(I[j]=B,"")),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*,\s*([^)]+?)\s*\)/g,(L,j,B)=>{if(/^(['"]).*\1$/.test(B.trim()))return L;try{let X=l(B.trim(),e);if(X===void 0)return L;let Y=(e.__stx_inline_section_values??=[]).push(X)-1;return I[j]=`{{ __stx_inline_section_values[${Y}] }}`,""}catch{return L}}),y=y.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@endsection|@show)/g,(L,j,B)=>{if(B.includes("@parent"))I[j]=B.replace("@parent",_e);else I[j]=B.trim();return""}),e.__sections=I,y=y.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"])?\)/g,(L,j,B)=>I[j]||B||""),!("slot"in e)||e.slot===void 0)y=y.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||"");if(y=jr(y,M),P){let L=[],j=G(y),B=de(j.output,on,(X,K)=>`\x00STX_ORPHAN_STYLE_${K}\x00`);if(y=B.output.replace(/\x00STX_(SCRIPT|ORPHAN_STYLE)_(\d+)\x00/g,(X,K,Y)=>{let ee=K==="SCRIPT"?vn(j.scripts[Number(Y)],u):B.tokens[Number(Y)];if(ee)L.push(ee);return""}),L.length>0){let X=L.join(`
|
|
870
870
|
`);I.content=I.content?`${I.content}
|
|
871
|
-
${
|
|
872
|
-
${y}`,w(y)}catch(L){if(L instanceof
|
|
873
|
-
`;if(i=Y(i,e),i=
|
|
871
|
+
${X}`:X,e.__sections=I}}if(P)try{let L;if(ce.isAbsolute(P))L=P,g.add(P);else L=await we(()=>pn(P,u,f,g),null,()=>{throw new oe(`Failed to resolve layout path: ${P}`,u,void 0,void 0,`Layout referenced from ${u}`)});if(!L){let ee=(ie)=>{if(!ie)return[];try{let ae=ce.isAbsolute(ie)?ie:ce.resolve(process.cwd(),ie);return ps.readdirSync(ae).filter((le)=>le.endsWith(".stx")).map((le)=>le.replace(/\.stx$/,""))}catch{return[]}},te=[...ee(f.layoutsDir),...ee(f.fallbackLayoutsDir)].filter((ie,ae,le)=>le.indexOf(ie)===ae).sort(),ue=`Layout not found: ${P} (referenced from ${u})`+(te.length>0?`. Available layouts: ${te.join(", ")}`:f.layoutsDir?`. No .stx layouts found in ${f.layoutsDir}`:"");if(D.log(Error(ue),{layoutPath:P,filePath:u,available:te},"error"),console.error(`[stx] ${ue}`),f.debug)throw new oe(ue,u);return y}let j=await we(()=>Bun.file(L).text(),"",()=>{throw new oe(`Failed to read layout file: ${L}`,u,void 0,void 0,"Layout content could not be loaded")});j=dn(j,L);let B=j.match(/@(?:layout|extends)\(\s*['"]([^'"]+)['"]\s*\)/);if(B){if(f.debug)console.log(`Found nested layout: ${B[1]} in ${L}`);let ee={},te=j.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ae,le,ke)=>(ee[le]=ke.trim(),""));for(let[ae,le]of Object.entries(ee))if(I[ae]&&I[ae].includes(_e)){let ke=I[ae].indexOf(_e);I[ae]=I[ae].slice(0,ke)+le+I[ae].slice(ke+_e.length)}else if(!I[ae])I[ae]=le;let ue={...e,__sections:I},ie=`@layout('${B[1]}')${te}`;return await s(ie,ue,L,f,g)}let X=j.replace(/\{\{--[\s\S]*?--\}\}/g,""),K=Lr(X,M),Y={};return K=K.replace(/@section\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)(?:@show|@endsection)/g,(ee,te,ue)=>(Y[te]=ue.trim(),`@slot('${te}')`)),K=K.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(ee,te,ue)=>{if(I[te]){let ie=I[te];if(ie.includes(_e)){let ae=Y[te]||"",le=ie.indexOf(_e);ie=ie.slice(0,le)+ae+ie.slice(le+_e.length)}return ie}return ue||""}),K=ws(K,I),K=K.replace(/\{\{\s*slot\s*\}\}/g,()=>I.content||""),K=jr(K,M),e.__originalFilePath=u,y=await kn(K,e,L,f,g),y=`<!-- stx-layout: ${P} -->
|
|
872
|
+
${y}`,w(y)}catch(L){if(L instanceof H)throw L;throw new oe(`Error processing layout ${P}: ${L instanceof Error?L.message:String(L)}`,u)}return w(await kn(y,e,u,f,g))}function ws(c,e){return c.replace(/@(?:yield|slot)\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(u,o,g)=>{let i=e[o];if(i!==void 0){if(!new RegExp(`@(?:yield|slot)\\(\\s*['"]${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}['"]`).test(i))return i}return g||""})}function xs(c,e){if(c.__stx_sfc_mode=!0,c.__stx_options=e,e.buildMode)c.__stx_buildMode=e.buildMode;let u=e.envPrefix||"STX_PUBLIC_",o={};for(let[g,i]of Object.entries(process.env))if(g.startsWith(u)&&i!==void 0)o[g]=i;c.$env=o}async function ks(c,e){await we(()=>Kt(c,e),void 0,(u)=>{D.log(u,{filePath:c,phase:"view-composer"},"warning"),console.warn(`[stx] view composer failed for ${c}: ${u.message}`)})}var ot="data-stx-source";function vn(c,e){if(!c)return c;let u=/^<script\b([^>]*)>/i.exec(c);if(!u||!/\bserver\b/.test(u[1])||u[1].includes(ot))return c;return`<script ${ot}="${encodeURIComponent(e)}"${c.slice(7)}`}function Ss(c){let e=new RegExp(`${ot}="([^"]*)"`).exec(c);return e?decodeURIComponent(e[1]):void 0}function wn(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xn(c,e,u){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">${wn(c)}</span><span style="display:block;margin-top:4px">${wn(u)}</span></div>`}async function $s(c,e,u,o){let{scanScriptTags:g}=await r("stx/signal-processing",()=>import("./chunk-fr39emcz.js")),i=[],f=!C()&&!bn();for(let y of g(c)){let x=y.attrs;if(!/\bserver\b/.test(x))continue;let b=y.start+y.fullMatch.indexOf(">")+1,w=Sn(c,b);if(w===-1)continue;let T=c.slice(b,w);if(!T.trim())continue;let A=Ss(x)??u,O={index:y.start,length:w+9-y.start};try{let{extractVariables:M}=await r("stx/variable-extractor",()=>import("./chunk-902qnyg0.js"));await M(T,e,A,{preserveExisting:!0,onFailure:(I)=>{if(I.kind==="unknown")return;if(o?.onServerScriptError?.({sourcePath:A,kind:I.kind,message:I.message}),!f)return;i.push({...O,markup:xn(A,I.kind,I.message)})}})}catch(M){let I=M instanceof Error?M:Error(String(M));if(D.log(I,{filePath:A,phase:"server-script-extraction"},"warning"),console.warn(`[stx] server <script> extraction failed in ${A}: ${I.message}`),f)i.push({...O,markup:xn(A,"unknown",I.message)})}}if(i.length===0)return c;let v=c;for(let y of i.sort((x,b)=>b.index-x.index))v=v.slice(0,y.index)+y.markup+v.slice(y.index+y.length);return v}async function Es(c,e,u){try{let{interpolateScriptsInTemplate:o}=await r("stx/expressions",()=>import("./chunk-z97bwx8m.js"));return o(c,e,{skipServer:!0})}catch(o){let g=o instanceof Error?o:Error(String(o));return D.log(g,{filePath:u,phase:"script-expression-interpolation"},"warning"),console.warn(`[stx] script expression interpolation failed in ${u}: ${g.message}`),c}}async function kn(c,e,u,o,g){let i=c,f=o;if(i=await $s(i,e,u,o),i=await Bt(i,e,u),i=await Ft(i,e,u),i=await Es(i,e,u),i=await At(i,e,u,f),ve(i))i=ao(i,e),i=Vr(i,e),i=Hr(i,e);i=co(i);let{processStreamDirectives:v}=await r("stx/streaming",()=>import("./chunk-7kznee1g.js"));i=v(i,e),i=qn(i,e,u,f,!0),i=await en(i,e,u,f,g),i=await Fr(i,e,u,f,g),i=da(i,e,u,f);let{processDeferDirectives:y}=await r("stx/defer",()=>import("./chunk-e62qfexp.js"));i=y(i,e,u);let{processTeleportDirectives:x}=await r("stx/teleport",()=>import("./chunk-nw9bdk2n.js"));i=x(i,e,u);let{processTransitionDirectives:b,processTransitionAttributes:w}=await r("stx/transitions",()=>import("./chunk-qpw72bty.js"));i=b(i,e,u),i=w(i);let{processErrorBoundaryDirectives:T,stripRenderFailedMarkers:A}=await r("stx/error-boundaries",()=>import("./chunk-h85hrwkq.js"));i=T(i,e,u),i=A(i);let{processSuspenseDirectives:O}=await r("stx/suspense",()=>import("./chunk-vq513cxx.js"));i=O(i,e,u);let{processAsyncDirectives:M}=await r("stx/async-components",()=>import("./chunk-fxh12vqd.js"));i=M(i,e,u);let{processKeepAliveDirectives:I}=await r("stx/keep-alive",()=>import("./chunk-bdp2r0v4.js"));i=I(i,e,u);let{processVirtualListDirectives:P,processVirtualGridDirectives:N,processInfiniteListDirectives:q}=await r("stx/virtual-scrolling",()=>import("./chunk-8azm7nha.js"));i=P(i,e,u),i=N(i,e,u),i=q(i,e,u);let{processPartialHydrationDirectives:V,processStaticDirectives:L}=await r("stx/partial-hydration",()=>import("./chunk-h6t2ney6.js"));i=V(i,e,u),i=L(i);let{processComputedDirectives:j,processWatchDirectives:B}=await r("stx/computed",()=>import("./chunk-1xdzcy9d.js"));i=j(i,e,u),i=B(i,e,u);let{processFormValidationDirectives:X}=await r("stx/forms-validation",()=>import("./chunk-vvq8xe3n.js"));i=X(i,e,u);let{processHeadDirective:K,processTitleDirective:Y,processMetaDirective:ee,resetHead:te}=await r("stx/head",()=>import("./chunk-rj3w1ama.js"));if(!e.__stx_head_preset&&!e.__stx_runtime_head)te();let ue=K(i);if(i=ue.content,ue.headContent)e.__stx_head_raw=`${e.__stx_head_raw||""}${ue.headContent}
|
|
873
|
+
`;if(i=Y(i,e),i=ee(i,e,u),i=Xt(i),i=ro(i,e),i=Ct(i),i=Ut(i),i=await Mr(i,e,u,f,g),i=await Fr(i,e,u,f,g),e.__stxProcessingDepth===1)i=Va(i,e);if(i=i.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g,""),i=Po(i),i=ne(i,e,u),i=Dr(i),i=ja(i,e,{filePath:u,buildMode:f.buildMode}),i=so(i,e),i=oo(i,e),i=ze(i,e),i=Nt(i,e),i=Ht(i,e),i=await bt(i,e,u,f),i=await fa(i,e,u),i=await ga(i,e,u,f),i=ma(i,e,u,f),i=ho(i,e,u,f),i=yo(i,e,u),i=bo(i,e,u,f),i=_t(i,e,u,f),i=gs(i,e),i=ms(i),i=Ba(i),!f.skipEventDirectives)i=Ta(i,e,u);if(i=vt(i,e,u),f.debug){let F=/\bx-data\s*=/.test(i),U=zr(c);if(F&&U)console.warn(`[stx] ${u}: Template mixes Alpine-style (x-data) and signals (state/derived/effect) reactivity.
|
|
874
874
|
Both work on the same page, but they manage separate scopes.
|
|
875
|
-
Prefer signals (state/derived/effect) for new components.`)}i=
|
|
876
|
-
</head>`);if(/<head\b[^>]*>/i.test(
|
|
877
|
-
${
|
|
875
|
+
Prefer signals (state/derived/effect) for new components.`)}i=ia(i,e),i=await k(i,e,u),i=Fa(i),i=za(i),i=pt(i);let{processXElementDirectives:ie}=await r("stx/x-element",()=>import("./chunk-zhxdpzga.js"));i=ie(i);let ae=e.__originalFilePath||u,le=Oe(e);if(i=await lo(i,f,ae,le),i=Pt(i,e),i=await Wt(i,e,u,f),f.media?.image?.autoSiblings){let F=f.publicDir||"public",{rewriteImagesWithSiblings:U}=await r("stx/image-optimization/auto-sibling",()=>import("./chunk-aft1zc84.js"));i=await U(i,{publicDir:F})}if(f.seo?.enabled)i=vo(i,e,f);let ke=(F,U,Z=!0)=>{if(!U)return F;let he=U.match(/<title\b[^>]*>[\s\S]*?<\/title>/i),se=/<head\b[^>]*>[\s\S]*?(?:<\/head\s*>|<body\b|$)/i.exec(F),fe=se?/<title\b[^>]*>[\s\S]*?<\/title>/i.exec(se[0]):null;if(he&&se&&fe){if(Z){let Ce=se.index+fe.index;F=F.slice(0,Ce)+he[0]+F.slice(Ce+fe[0].length)}if(U=U.replace(he[0],"").trim(),!U)return F}if(/<\/head>/i.test(F))return F.replace(/<\/head>/i,`${U}
|
|
876
|
+
</head>`);if(/<head\b[^>]*>/i.test(F))return F.replace(/(<head\b[^>]*>)/i,`$1
|
|
877
|
+
${U}`);if(/<html\b[^>]*>/i.test(F))return F.replace(/(<html\b[^>]*>)/i,`$1
|
|
878
878
|
<head>
|
|
879
|
-
${
|
|
880
|
-
</head>`);return
|
|
879
|
+
${U}
|
|
880
|
+
</head>`);return F},{renderHead:En,getHead:_n}=await r("stx/head",()=>import("./chunk-rj3w1ama.js")),Ie=e.__stx_runtime_head??_n();if(Ie.title||Ie.meta?.length||Ie.link?.length){let F=En(Ie);if(F)i=ke(i,F)}if(ue.headContent)i=ke(i,ue.headContent,!Ie.title);if(f.csp?.enabled&&f.csp.addMetaTag)i=St(i,f.csp,e);if(f.analytics?.enabled)i=ft(i,f);if(f.heatmap?.enabled)i=pa(i,f);if(f.pwa?.enabled&&f.pwa.autoInject!==!1){let{injectPwaTags:F}=await r("stx/pwa/inject",()=>import("./chunk-gcc9fa33.js"));i=F(i,f)}let Tn=/<script\b(?![^>]*\bserver\b)[^>]*>[\s\S]*?<\/script>/i.test(i),Cn=/\bSTX\.\w+/.test(i),An=/window\.STX\s*=/.test(i);if(Tn&&Cn&&!An){let U=`<script data-stx-scoped data-stx-run="once">
|
|
881
881
|
${lt()}
|
|
882
|
-
</script>`;if(i.includes("</head>")){let Z=i.indexOf("</head>"),
|
|
883
|
-
`+Ce}else i=i.replace("</head>",`${
|
|
882
|
+
</script>`;if(i.includes("</head>")){let Z=i.indexOf("</head>"),se=i.slice(0,Z).indexOf("<script");if(se!==-1){let fe=i.slice(0,se),Ce=i.slice(se);i=fe+U+`
|
|
883
|
+
`+Ce}else i=i.replace("</head>",`${U}
|
|
884
884
|
</head>`)}else if(i.includes("<body"))i=i.replace(/<body([^>]*)>/,`<body$1>
|
|
885
|
-
${
|
|
886
|
-
`+i}{let{scanScriptTags:
|
|
887
|
-
`+i.slice(Z)}e.__stx_event_bindings=[]}}if(!
|
|
888
|
-
export{gt,Te,
|
|
885
|
+
${U}`);else i=U+`
|
|
886
|
+
`+i}{let{scanScriptTags:F}=await r("stx/signal-processing",()=>import("./chunk-fr39emcz.js")),U=[];for(let Z of F(i)){if(!/\bserver\b/i.test(Z.attrs))continue;let he=Z.start+Z.fullMatch.indexOf(">")+1,se=Sn(i,he);if(se===-1)continue;let fe=se+9;while(fe<i.length&&/\s/.test(i[fe]))fe++;U.push({start:Z.start,end:fe})}if(U.length>0){let Z=Array(U.length+1),he=0;for(let se=0;se<U.length;se++){let{start:fe,end:Ce}=U[se];Z[se]=i.slice(he,fe),he=Ce}Z[U.length]=i.slice(he),i=Z.join("")}}let at=ds(i,u);if(at.hasScoped)i=at.html;let Rn=e.__stx_event_bindings||[],Ke=!1,ct=[],Mn=/\s:[a-z][\w.-]*\s*=/.test(i),{scanScriptTags:Dn}=await r("stx/signal-processing",()=>import("./chunk-fr39emcz.js"));for(let F of Dn(i,{skipAttrs:/\bserver\b|\bsrc\s*=|\bdata-stx-scoped\b|\bdata-stx-router\b|\btype\s*=\s*["'](?!(?:text\/javascript|application\/javascript|module)["'])[^"']*["']/}))ct.push({match:F.fullMatch,attrs:F.attrs,content:F.body});for(let{match:F,attrs:U,content:Z}of ct){Ke=!0;let he=Z;Ae(Z,u,o.strict,e.__originalFilePath);let se=await Ne(Z,{eventBindings:Rn,attrs:U,hasColonDirectives:Mn,templateContent:c,filePath:u,projectRoot:process.cwd(),production:Go(o.buildMode),serverData:le});i=i.replace(F,()=>se)}if(Ke)e.__stx_event_bindings=[];if(!Ke&&e.__stxProcessingDepth===1){let F=e.__stx_event_bindings||[];if(F.length>0){let U=Co(F);if(U){let Z=i.lastIndexOf("</body>");i=Z===-1?i+U:i.slice(0,Z)+U+`
|
|
887
|
+
`+i.slice(Z)}e.__stx_event_bindings=[]}}if(!me(i)&&ca(i))i=await Xn(i,f);if(i=la(i),f.csp?.enabled&&f.csp.useNonce&&typeof e.cspNonce==="string")i=$t(i,e.cspNonce);return i}
|
|
888
|
+
export{gt,Te,na,Zs,Hn,s};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function
|
|
3
|
-
`)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function
|
|
4
|
-
`)}function
|
|
5
|
-
export{
|
|
2
|
+
import c from"fs";import i from"path";import{createHash as k}from"crypto";var j=["pages","components","layouts","partials","composables"],w=new Set;function va(e){try{return w.has(c.realpathSync(e))}catch{return w.has(i.resolve(e))}}var _=new Set(["extends","root",...j.map((e)=>`${e}Dir`),"publicDir","stateDir","cachePath"]),x=(e)=>e!==null&&typeof e==="object"&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null);function b(e,n,r=""){if(Array.isArray(n))return["middleware","plugins"].includes(r)?[...Array.isArray(e)?e:[],...n]:[...n];if(!x(n))return n;let o={...x(e)?e:{}};for(let[s,a]of Object.entries(n)){if(["__proto__","constructor","prototype"].includes(s))throw Error(`Invalid layer config key: ${s}`);o[s]=b(o[s],a,s)}return o}function v(e){for(let n of["stx.config.ts","stx.config.js","stx.config.mjs",".config/stx.config.ts",".config/stx.ts","ui.config.ts"]){let r=i.join(e,n);if(c.existsSync(r))return c.realpathSync(r)}throw Error(`Application layer has no stx.config.ts: ${e}`)}function E(e,n,r){if(typeof e!=="string"||!e||/^(?:https?:|git[+:])/.test(e))throw Error(`Invalid application layer ${JSON.stringify(e)} in ${n}; use a local path or installed package`);if(e.startsWith(".")||i.isAbsolute(e)){let s=i.resolve(n,e);return c.statSync(s).isDirectory()?v(s):c.realpathSync(s)}let o=n;while(!0){let s=i.join(o,"node_modules",e),a=i.join(s,"package.json");if(c.existsSync(a)){r.add(c.realpathSync(a));let g=JSON.parse(c.readFileSync(a,"utf8"));return g.stx?.layer?c.realpathSync(i.resolve(s,g.stx.layer)):v(s)}let p=i.dirname(o);if(p===o)break;o=p}throw Error(`Cannot resolve application layer ${JSON.stringify(e)} from ${n}`)}async function C(e,n){let r=await Bun.build({entrypoints:[e],target:"bun",format:"esm",splitting:!1,plugins:[{name:"stx-layer-config",setup(a){a.onResolve({filter:/^[^./]/},(p)=>{if(p.path.startsWith("node:"))return{path:p.path,external:!0};return{path:Bun.resolveSync(p.path,p.resolveDir),external:!0}}),a.onLoad({filter:/./},(p)=>{let g=c.realpathSync(p.path);n.add(g),w.add(g);return})}}]});if(!r.success)throw Error(`Cannot load layer ${e}: ${r.logs.join(`
|
|
3
|
+
`)}`);let o=r.outputs.find((a)=>a.kind==="entry-point");if(!o||r.outputs.length!==1)throw Error(`Unsupported layer config output: ${e}`);let s=(await import(`data:text/javascript;base64,${Buffer.from(await o.text()).toString("base64")}`)).default;if(!x(s))throw Error(`Layer ${e} must default-export a config object`);return s}async function wa(e,n){let r=new Set,o=[],s=[],a=new Set,p=[];async function g(t,l){if(t=c.realpathSync(t),p.includes(t))throw Error(`Application layer cycle: ${[...p,t].join(" -> ")}`);if(a.has(t))return;a.add(t),p.push(t);let d=await C(t,r);l??=i.basename(i.dirname(t))===".config"?i.dirname(i.dirname(t)):i.dirname(t),l=c.realpathSync(l);let D=i.resolve(l,d.root??"."),L=Object.fromEntries(j.map((y)=>[y,i.resolve(D,d[`${y}Dir`]??(y==="composables"?"functions":y))]));o.push({root:l,configFile:t,resources:L});let u={...d};if(u.plugins)u.plugins=u.plugins.map((y)=>{let h=typeof y==="string"?y:y[0],S=h.startsWith(".")?i.resolve(l,h):i.isAbsolute(h)?h:Bun.resolveSync(h,l);return r.add(c.realpathSync(S)),typeof y==="string"?S:[S,y[1]]});if(typeof u.css==="string")u.css=i.resolve(l,u.css);if(u.serverApi)u.serverApi={...typeof u.serverApi==="object"?u.serverApi:{},dir:i.resolve(l,typeof u.serverApi==="object"?u.serverApi.dir??"server/api":"server/api")};if(s.push(u),d.extends!==void 0&&!Array.isArray(d.extends))throw Error(`extends in ${t} must be an array`);for(let y of d.extends??[])await g(E(y,l,r));p.pop()}await g(v(e),e);for(let t of["package.json","bun.lock","package-lock.json","pnpm-lock.yaml"]){let l=i.join(e,t);if(c.existsSync(l))r.add(c.realpathSync(l))}let f=b({},n);for(let t=s.length-1;t>=0;t--){let l=t===0?s[t]:Object.fromEntries(Object.entries(s[t]).filter(([d])=>!_.has(d)));f=b(f,l)}let m={layers:o,configDependencies:[...r].sort()};return f._layerGraph=m,f._layerPageDirs=o.map((t)=>t.resources.pages),f._layerComponentDirs=o.map((t)=>t.resources.components),f._layerLayoutDirs=o.map((t)=>t.resources.layouts),f._layerPartialDirs=o.map((t)=>t.resources.partials),f._layerComposableDirs=o.map((t)=>t.resources.composables),await mo(m,e),{config:f,graph:m}}async function mo(e,n){let r=new Map,o=[];for(let s of e.layers)for(let[a,p]of Object.entries(s.resources)){if(!c.existsSync(p))continue;let g=new Bun.Glob(a==="composables"?"**/*.ts":"**/*.stx");for(let f of[...g.scanSync({cwd:p})].sort()){let m=`${a}/${f}`,t=i.join(p,f),l=r.get(m);if(l)o.push({resource:m,winner:l,shadowed:t});else r.set(m,t)}}Object.assign(e,{overrides:o}),await Bun.write(i.join(n,".stx/layers.json"),JSON.stringify(e,null,2))}function A(e){let n=new Set(e.configDependencies);function r(o){if(!c.existsSync(o))return;n.add(o);for(let s of c.readdirSync(o,{withFileTypes:!0}).sort((a,p)=>a.name.localeCompare(p.name))){if(s.name.startsWith(".")||s.name==="node_modules")continue;let a=i.join(o,s.name);if(s.isDirectory())r(a);else if(s.isFile())n.add(a)}}for(let o of e.layers)for(let s of Object.values(o.resources))r(s);return[...n].sort()}function Kr(e){return O(A(e))}function Xr(e){return O(e.configDependencies)}function O(e){return e.map((n)=>{try{let r=c.statSync(n);return`${n}:${r.mtimeMs}:${r.size}`}catch{return`${n}:missing`}}).join(`
|
|
4
|
+
`)}function xa(e){return e.layers.map((n)=>({config:i.relative(n.root,n.configFile),files:A({layers:[n],configDependencies:e.configDependencies.filter((r)=>r.startsWith(`${n.root}${i.sep}`))}).filter((r)=>c.statSync(r).isFile()).map((r)=>({path:i.relative(n.root,r).replaceAll(i.sep,"/"),sha256:k("sha256").update(c.readFileSync(r)).digest("hex")}))}))}
|
|
5
|
+
export{va,wa,mo,Kr,Xr,xa};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function
|
|
2
|
+
function Di(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="id",dynamicHeight:d=!1,estimatedItemHeight:g=l,direction:x="vertical"}=c,e=[...v],t=0,n=new Map;function f(){if(d)return h();let i=Math.max(0,Math.floor(t/l)-s),r=Math.ceil(u/l),m=Math.min(e.length-1,i+r+s*2);return{startIndex:i,endIndex:m}}function h(){let i=0,r=0,m=e.length-1;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+M>t){r=Math.max(0,p-s);break}i+=M}i=0;for(let p=0;p<e.length;p++){let M=n.get(p)||g;if(i+=M,i>t+u){m=Math.min(e.length-1,p+s);break}}return{startIndex:r,endIndex:m}}function w(){if(d){let i=0;for(let r=0;r<e.length;r++)i+=n.get(r)||g;return i}return e.length*l}function y(i){if(d){let r=0;for(let m=0;m<i;m++)r+=n.get(m)||g;return r}return i*l}function S(){let{startIndex:i,endIndex:r}=f();return{startIndex:i,endIndex:r,scrollTop:t,totalHeight:w(),visibleItems:e.slice(i,r+1),itemHeights:new Map(n)}}function L(i,r="auto"){let m=y(i);a(m,r)}function a(i,r="auto"){t=Math.max(0,Math.min(i,w()-u))}function o(){f()}function H(i){e=[...i],n.clear(),o()}function I(){e=[],n.clear()}return{scrollToIndex:L,scrollToOffset:a,getState:S,refresh:o,setItems:H,destroy:I}}function Mi(v,c={},l){let u=/@virtualList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualList/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualList: items "${x}" not found or not an array -->`;let t={itemHeight:50,containerHeight:400,overscan:3};if(d)try{let a=d.trim(),o=Function(`return ${a}`)();t={...t,...o}}catch{}let n=`vlist-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(t.containerHeight/t.itemHeight),h=t.overscan||3,w=0,y=Math.min(e.length-1,f+h),S="";for(let a=w;a<=y&&a<e.length;a++){let o=e[a],H=g.replace(/\{\{\s*item\s*\}\}/g,typeof o==="object"?JSON.stringify(o):String(o)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(I,i)=>{if(typeof o==="object"&&o!==null)return String(o[i]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(a));S+=`
|
|
3
3
|
<div class="virtual-item ${t.itemClass||""}"
|
|
4
4
|
style="position: absolute; top: ${a*t.itemHeight}px; height: ${t.itemHeight}px; width: 100%;"
|
|
5
5
|
data-index="${a}">
|
|
@@ -76,7 +76,7 @@ function Ni(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
76
76
|
};
|
|
77
77
|
})();
|
|
78
78
|
</script>
|
|
79
|
-
`})}function
|
|
79
|
+
`})}function Hc(){return`
|
|
80
80
|
.virtual-list-container {
|
|
81
81
|
position: relative;
|
|
82
82
|
overflow-y: auto;
|
|
@@ -124,7 +124,7 @@ function Ni(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
124
124
|
0% { background-position: 200% 0; }
|
|
125
125
|
100% { background-position: -200% 0; }
|
|
126
126
|
}
|
|
127
|
-
`}function
|
|
127
|
+
`}function Vc(v,c){let l=null,u=()=>{if(!l)l=Di(v(),c);return l};return{visibleItems:()=>u().getState().visibleItems,totalHeight:()=>u().getState().totalHeight,containerProps:()=>({style:{height:`${c.containerHeight}px`,overflow:"auto",position:"relative"},onScroll:(s)=>{let b=s.target;if(l)l.scrollToOffset(b.scrollTop)}}),itemProps:(s)=>({style:{position:"absolute",top:`${s*c.itemHeight}px`,height:`${c.itemHeight}px`,width:"100%"},"data-index":s}),scrollToIndex:(s)=>{u().scrollToIndex(s)}}}function Uc(v,c={},l){let u=/@infiniteList\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@loading\s*([\s\S]*?)@endinfiniteList/gi;return v.replace(u,(s,b,d,g,x)=>{let e=b.trim(),t=c[e];if(!t||!Array.isArray(t))return`<!-- infiniteList: items "${e}" not found or not an array -->`;let n={itemHeight:50,containerHeight:400,overscan:3,threshold:100,hasMore:!0};if(d)try{let w=Function(`return ${d.trim()}`)();n={...n,...w}}catch{}let f=`ilist-${Math.random().toString(36).substring(2,9)}`,h=Mi(`@virtualList(${e}, ${JSON.stringify({itemHeight:n.itemHeight,containerHeight:n.containerHeight,overscan:n.overscan,containerClass:n.containerClass})})${g}@endvirtualList`,c);return h=h.replace("</script>",`
|
|
128
128
|
// Infinite scroll detection
|
|
129
129
|
container.addEventListener('scroll', function() {
|
|
130
130
|
const scrollBottom = container.scrollTop + container.clientHeight;
|
|
@@ -142,7 +142,7 @@ function Ni(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
142
142
|
${x}
|
|
143
143
|
</div>
|
|
144
144
|
</div>
|
|
145
|
-
`})}function
|
|
145
|
+
`})}function Wc(v,c={},l){let u=/@virtualGrid\s*\(\s*([^,]+)\s*(?:,\s*(\{[^}]*\}))?\s*\)\s*([\s\S]*?)@endvirtualGrid/gi;return v.replace(u,(s,b,d,g)=>{let x=b.trim(),e=c[x];if(!e||!Array.isArray(e))return`<!-- virtualGrid: items "${x}" not found or not an array -->`;let t={columns:3,rowHeight:100,containerHeight:400,gap:10,overscan:2};if(d)try{let o=Function(`return ${d.trim()}`)();t={...t,...o}}catch{}let n=`vgrid-${Math.random().toString(36).substring(2,9)}`,f=Math.ceil(e.length/t.columns),h=f*(t.rowHeight+(t.gap||0)),w=Math.ceil(t.containerHeight/(t.rowHeight+(t.gap||0))),y=t.overscan||2,S=0,L=Math.min(f-1,w+y),a="";for(let o=S;o<=L;o++)for(let H=0;H<t.columns;H++){let I=o*t.columns+H;if(I>=e.length)break;let i=e[I],r=H*(100/t.columns),m=o*(t.rowHeight+(t.gap||0)),p=g.replace(/\{\{\s*item\s*\}\}/g,typeof i==="object"?JSON.stringify(i):String(i)).replace(/\{\{\s*item\.(\w+)\s*\}\}/g,(M,T)=>{if(typeof i==="object"&&i!==null)return String(i[T]??"");return""}).replace(/\{\{\s*index\s*\}\}/g,String(I));a+=`
|
|
146
146
|
<div class="virtual-grid-item"
|
|
147
147
|
style="position: absolute; top: ${m}px; left: ${r}%; width: calc(${100/t.columns}% - ${t.gap||0}px); height: ${t.rowHeight}px;"
|
|
148
148
|
data-index="${I}">
|
|
@@ -212,5 +212,5 @@ function Ni(v,c){let{itemHeight:l,containerHeight:u,overscan:s=3,keyProperty:b="
|
|
|
212
212
|
});
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
|
-
`})}var
|
|
216
|
-
export{
|
|
215
|
+
`})}var ed={createVirtualList:Di,processVirtualListDirectives:Mi,processInfiniteListDirectives:Uc,processVirtualGridDirectives:Wc,generateVirtualListCSS:Hc,useVirtualList:Vc};
|
|
216
|
+
export{Di,Mi,Hc,Vc,Uc,Wc,ed};
|