@stacksjs/stx 0.2.842 → 0.2.844
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-01gwdj2y.js +2 -0
- package/dist/{chunk-321e41ck.js → chunk-02qbawwq.js} +3 -3
- package/dist/{chunk-p32n92sy.js → chunk-0q3vkfqt.js} +5 -5
- package/dist/chunk-0tse1k5e.js +2 -0
- package/dist/{chunk-fstm9dcb.js → chunk-11kp389s.js} +1 -1
- package/dist/{chunk-32p5bqy2.js → chunk-1c6kczkt.js} +4 -4
- package/dist/chunk-1cdxe8yt.js +2 -0
- package/dist/{chunk-2bvjn3jg.js → chunk-1efmkw4t.js} +3 -3
- package/dist/{chunk-yffv17js.js → chunk-1h6pb8d1.js} +5 -5
- package/dist/{chunk-736q5pgh.js → chunk-2524ayee.js} +6 -6
- package/dist/{chunk-7cg2f588.js → chunk-28zze2wm.js} +1 -1
- package/dist/{chunk-6wrf6302.js → chunk-2cafvex6.js} +2 -2
- package/dist/{chunk-kqpdnbvs.js → chunk-2jwsntc9.js} +1 -1
- package/dist/{chunk-8pj4v1eh.js → chunk-2ytaezad.js} +2 -2
- package/dist/{chunk-e2dxyxaf.js → chunk-35e3qawb.js} +1 -1
- package/dist/{chunk-v3q126ys.js → chunk-3ba0nqwm.js} +2 -2
- package/dist/{chunk-wr1werwe.js → chunk-3e1hmm3h.js} +5 -5
- package/dist/chunk-3g46mker.js +2 -0
- package/dist/chunk-3qstewq3.js +2 -0
- package/dist/{chunk-4j08cbjd.js → chunk-3rjgm7qk.js} +5 -5
- package/dist/{chunk-y68xstqy.js → chunk-3sskqw4b.js} +1 -1
- package/dist/chunk-40r740w1.js +2 -0
- package/dist/chunk-469nzheq.js +2 -0
- package/dist/{chunk-er5tdp6k.js → chunk-46wqk1fb.js} +3 -3
- package/dist/{chunk-fvmd4kk6.js → chunk-47n5s7wk.js} +2 -2
- package/dist/{chunk-4y1a7nbm.js → chunk-48vnw9t9.js} +1 -1
- package/dist/chunk-54eap9rq.js +2 -0
- package/dist/chunk-5fspjf7x.js +42 -0
- package/dist/chunk-5hhyqze9.js +2 -0
- package/dist/{chunk-m5bj2jnb.js → chunk-5p96rafz.js} +2 -2
- package/dist/{chunk-mhyd24bg.js → chunk-5y3m5vzg.js} +2 -2
- package/dist/chunk-60jtrz9f.js +2 -0
- package/dist/{chunk-a1s5wqw4.js → chunk-69b8mr68.js} +2 -2
- package/dist/{chunk-t3p0jy0s.js → chunk-6hb75r07.js} +6 -6
- package/dist/chunk-6vcpmt0y.js +2 -0
- package/dist/{chunk-wrn3n4b8.js → chunk-71fsg3az.js} +5 -5
- package/dist/chunk-76a66cw3.js +2 -0
- package/dist/{chunk-wbgc2n04.js → chunk-78q3apyy.js} +2 -2
- package/dist/{chunk-jc5y35b7.js → chunk-79wb76ya.js} +1 -1
- package/dist/{chunk-694w19gx.js → chunk-7cxbt404.js} +5 -5
- package/dist/chunk-7k4npa5e.js +2 -0
- package/dist/{chunk-ngnr831a.js → chunk-7s411sa9.js} +5 -5
- package/dist/chunk-7xp2ec0v.js +2 -0
- package/dist/{chunk-qfvddpcg.js → chunk-87ksn02m.js} +2 -2
- package/dist/{chunk-tzd0f95w.js → chunk-8g5dsjr0.js} +6 -6
- package/dist/chunk-8nq2snvy.js +2 -0
- package/dist/{chunk-7ywzjj7t.js → chunk-8qjf16yr.js} +4 -4
- package/dist/chunk-8s27mteq.js +2 -0
- package/dist/chunk-8weaawqm.js +2 -0
- package/dist/chunk-9hzbqwrp.js +2 -0
- package/dist/{chunk-11y84h2d.js → chunk-9mtyxvhk.js} +2 -2
- package/dist/{chunk-gtchtap6.js → chunk-9vg3jtzw.js} +6 -6
- package/dist/{chunk-w20kjp62.js → chunk-a28rhqq2.js} +4 -4
- package/dist/{chunk-q9xzfnpz.js → chunk-a3wv8q6g.js} +16 -16
- package/dist/chunk-as6x6be8.js +2 -0
- package/dist/chunk-b30fzxwd.js +2 -0
- package/dist/{chunk-1m16mvt4.js → chunk-b6qf7w2b.js} +4 -4
- package/dist/chunk-bgaq87h6.js +2 -0
- package/dist/{chunk-qk079ca7.js → chunk-bqsrtvad.js} +2 -2
- package/dist/chunk-bygxt820.js +3 -0
- package/dist/chunk-c1vf7qev.js +2 -0
- package/dist/{chunk-r65vb67k.js → chunk-c4by7m5b.js} +6 -6
- package/dist/{chunk-7t57cnz9.js → chunk-c6yc6qsv.js} +5 -5
- package/dist/{chunk-p5x2j3xd.js → chunk-chetq1ce.js} +5 -5
- package/dist/{chunk-6dz3k0jc.js → chunk-cwwm14b3.js} +5 -5
- package/dist/chunk-d5bjpjbv.js +2 -0
- package/dist/chunk-e1vf62ck.js +2 -0
- package/dist/{chunk-7rtm7nd1.js → chunk-e3r9fybx.js} +4 -4
- package/dist/{chunk-vvv8wyr7.js → chunk-e5seb8f7.js} +2 -2
- package/dist/chunk-eq8enrjw.js +2 -0
- package/dist/chunk-f1wv2q2z.js +2 -0
- package/dist/chunk-f404rga4.js +2 -0
- package/dist/{chunk-9xps62ek.js → chunk-fm8gfj2g.js} +2 -2
- package/dist/{chunk-a9tzjqny.js → chunk-fs5mshcs.js} +5 -5
- package/dist/chunk-fyesbfvr.js +2 -0
- package/dist/chunk-gd7vyzhw.js +2 -0
- package/dist/chunk-gg63af5n.js +2 -0
- package/dist/chunk-gz45xsbg.js +709 -0
- package/dist/{chunk-97k72dfh.js → chunk-hc1f1yq8.js} +1 -1
- package/dist/chunk-hpw6hq7p.js +2 -0
- package/dist/{chunk-ph9f3hwk.js → chunk-hws9yb0b.js} +6 -6
- package/dist/chunk-jabw4ck5.js +3 -0
- package/dist/{chunk-51r39yw4.js → chunk-japk9yf6.js} +32 -32
- package/dist/chunk-jbb9pjae.js +2 -0
- package/dist/{chunk-f1hkagxk.js → chunk-jf0a5ew8.js} +2 -2
- package/dist/chunk-jv2z9qb7.js +2 -0
- package/dist/chunk-k609nyan.js +2 -0
- package/dist/{chunk-q0s0kc66.js → chunk-ka5ea34g.js} +2 -2
- package/dist/{chunk-bdaz0k5c.js → chunk-kbv5nwwd.js} +1 -1
- package/dist/chunk-ksaj3br7.js +2 -0
- package/dist/{chunk-2j5yane9.js → chunk-kxj5sp5w.js} +2 -2
- package/dist/{chunk-zvy88beh.js → chunk-mnt7jbek.js} +3 -3
- package/dist/chunk-mxrmed55.js +2 -0
- package/dist/{chunk-gjg82tsf.js → chunk-my85fge2.js} +4 -4
- package/dist/chunk-n4c8srx8.js +2 -0
- package/dist/{chunk-fx094pwg.js → chunk-n91sm385.js} +2 -2
- package/dist/{chunk-4657mnht.js → chunk-ncrrxp60.js} +4 -4
- package/dist/chunk-nfxd6y75.js +2 -0
- package/dist/chunk-nsqx4xwn.js +2 -0
- package/dist/{chunk-xmsf1bnx.js → chunk-ntg8ttm4.js} +3 -3
- package/dist/{chunk-yy83cyj1.js → chunk-pfzwgxk9.js} +10 -10
- package/dist/chunk-q5ehy99b.js +2 -0
- package/dist/{chunk-fgxydvt9.js → chunk-qtkjbz4n.js} +2 -2
- package/dist/chunk-r10h4xmw.js +2 -0
- package/dist/{chunk-x12e55sd.js → chunk-r3jf8v5a.js} +31 -31
- package/dist/{chunk-kd6r7z27.js → chunk-r4jwhy37.js} +2 -2
- package/dist/{chunk-cqwhafc9.js → chunk-r8xwd8r1.js} +14 -14
- package/dist/{chunk-0pghy8kw.js → chunk-rb6vr5v9.js} +6 -6
- package/dist/chunk-rf0q3mva.js +2 -0
- package/dist/{chunk-f8azcvh3.js → chunk-rjenga8c.js} +2 -2
- package/dist/{chunk-frqf7t08.js → chunk-rk2ex6qx.js} +2 -2
- package/dist/chunk-rm5pnhzx.js +3 -0
- package/dist/{chunk-4a989sxm.js → chunk-rpapxkdm.js} +3 -3
- package/dist/chunk-rrj3gv46.js +3 -0
- package/dist/chunk-s37e6wjj.js +2 -0
- package/dist/{chunk-bkcq0dxb.js → chunk-sfww6v6m.js} +7 -7
- package/dist/chunk-sjcvc0bd.js +2 -0
- package/dist/chunk-t2a78fzq.js +2 -0
- package/dist/chunk-t2sqxbv5.js +2 -0
- package/dist/chunk-t5mnysyw.js +2 -0
- package/dist/chunk-th7343bz.js +2 -0
- package/dist/{chunk-20ep26hg.js → chunk-tpf8v2mb.js} +2 -2
- package/dist/{chunk-bq7qcndg.js → chunk-tpyk6b4c.js} +2 -2
- package/dist/{chunk-t9mw38hk.js → chunk-txfz7gc3.js} +8 -8
- package/dist/{chunk-7bd85w4d.js → chunk-tzdwg9rw.js} +4 -4
- package/dist/{chunk-q8yfdjww.js → chunk-v7j50pfw.js} +12 -12
- package/dist/{chunk-h6hct02d.js → chunk-v7rat63v.js} +2 -2
- package/dist/{chunk-fzkjm2g2.js → chunk-v9jfxbwx.js} +2 -2
- package/dist/{chunk-m87qhcsz.js → chunk-vhckqe4x.js} +10 -10
- package/dist/chunk-vkrxrt0a.js +2 -0
- package/dist/chunk-vq4nccm4.js +2 -0
- package/dist/{chunk-sb0gtzcf.js → chunk-vrwdnefe.js} +2 -2
- package/dist/{chunk-sen1svvw.js → chunk-vyvjbydn.js} +4 -4
- package/dist/chunk-vzpbxgg7.js +2 -0
- package/dist/chunk-wj93vpy5.js +2 -0
- package/dist/chunk-wz30ghcf.js +2 -0
- package/dist/{chunk-x4f7efgp.js → chunk-x0dx1pyf.js} +3 -3
- package/dist/chunk-xjthcx9s.js +2 -0
- package/dist/chunk-xvd3vdrw.js +2 -0
- package/dist/chunk-xvtp7nyj.js +2 -0
- package/dist/chunk-xy45tx27.js +2 -0
- package/dist/{chunk-hcf1wv74.js → chunk-y49nzyxf.js} +9 -9
- package/dist/{chunk-vcx6dy59.js → chunk-yhzakgpp.js} +1 -1
- package/dist/chunk-z3qgv971.js +2 -0
- package/dist/cli.js +20 -20
- package/dist/component-renderer.d.ts +1 -0
- package/dist/component-renderer.js +15 -1
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/document-shell.d.ts +16 -0
- package/dist/expressions.d.ts +39 -9
- package/dist/expressions.js +36 -5
- package/dist/process.js +2 -2
- package/dist/pwa.js +3 -3
- package/dist/server-bindings.d.ts +1 -1
- package/dist/server-bindings.js +1 -1
- package/dist/ssg.js +6 -6
- package/package.json +5 -5
- package/dist/chunk-0bacm8xg.js +0 -2
- package/dist/chunk-0gjx468c.js +0 -2
- package/dist/chunk-1m2sx3rc.js +0 -2
- package/dist/chunk-31bkv5yk.js +0 -2
- package/dist/chunk-38cj6zgb.js +0 -2
- package/dist/chunk-3cnf9vk3.js +0 -2
- package/dist/chunk-41sh9y5w.js +0 -2
- package/dist/chunk-4eagsz5d.js +0 -2
- package/dist/chunk-5gjzfgc5.js +0 -42
- package/dist/chunk-5t93dqft.js +0 -2
- package/dist/chunk-67gy8ktq.js +0 -2
- package/dist/chunk-6hn9n00a.js +0 -2
- package/dist/chunk-7m0r7mq9.js +0 -2
- package/dist/chunk-7v54wqsh.js +0 -2
- package/dist/chunk-7vhm0jj5.js +0 -3
- package/dist/chunk-8c363c2r.js +0 -2
- package/dist/chunk-8tkg5ews.js +0 -2
- package/dist/chunk-ajq3fnxc.js +0 -3
- package/dist/chunk-ar86zwmp.js +0 -2
- package/dist/chunk-b0fkvrat.js +0 -2
- package/dist/chunk-b4tpv1jd.js +0 -2
- package/dist/chunk-bj2bgazr.js +0 -2
- package/dist/chunk-c18pafmf.js +0 -3
- package/dist/chunk-c1xxnn0k.js +0 -2
- package/dist/chunk-c656az66.js +0 -2
- package/dist/chunk-d44g9sek.js +0 -2
- package/dist/chunk-d5vr9g4b.js +0 -2
- package/dist/chunk-dmjx0mjy.js +0 -2
- package/dist/chunk-ds3yhz8f.js +0 -2
- package/dist/chunk-dt4qswne.js +0 -2
- package/dist/chunk-e2ghgjb0.js +0 -2
- package/dist/chunk-ehgmm2sy.js +0 -2
- package/dist/chunk-eqn3jm65.js +0 -2
- package/dist/chunk-fjkge1xy.js +0 -2
- package/dist/chunk-ft30g13p.js +0 -2
- package/dist/chunk-g63jq20j.js +0 -2
- package/dist/chunk-gaxx0z19.js +0 -2
- package/dist/chunk-hph5qt43.js +0 -2
- package/dist/chunk-ht0nncp5.js +0 -2
- package/dist/chunk-hzgd52zc.js +0 -2
- package/dist/chunk-k4c4xa7b.js +0 -2
- package/dist/chunk-m7ev93s9.js +0 -2
- package/dist/chunk-nhk0aat9.js +0 -2
- package/dist/chunk-nwt1g6s6.js +0 -2
- package/dist/chunk-p7q6e8k1.js +0 -2
- package/dist/chunk-pf49wf76.js +0 -2
- package/dist/chunk-phfdcdhk.js +0 -2
- package/dist/chunk-pjkdn8zf.js +0 -2
- package/dist/chunk-q1v3c6v8.js +0 -2
- package/dist/chunk-q88w2rv9.js +0 -2
- package/dist/chunk-qjtt6hjd.js +0 -2
- package/dist/chunk-qmg1srpk.js +0 -2
- package/dist/chunk-r5bhgyes.js +0 -2
- package/dist/chunk-rzfbffnv.js +0 -2
- package/dist/chunk-sv2d6nfe.js +0 -2
- package/dist/chunk-txakmp61.js +0 -2
- package/dist/chunk-wfv30y38.js +0 -2
- package/dist/chunk-wj84r15x.js +0 -2
- package/dist/chunk-x4k11c9v.js +0 -2
- package/dist/chunk-y5k93ysf.js +0 -709
- package/dist/chunk-y64qhgv1.js +0 -2
- package/dist/chunk-yjskeqaj.js +0 -2
- package/dist/chunk-yxqzarzh.js +0 -2
- package/dist/chunk-z4g64re8.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,l}from"./chunk-
|
|
2
|
+
import{t,l}from"./chunk-r8xwd8r1.js";import{r,vn,h}from"./chunk-gz45xsbg.js";import{nt}from"./chunk-kxj5sp5w.js";import{Es,Ts}from"./chunk-rb6vr5v9.js";import{Cc,ei,_s,Cs}from"./chunk-ncrrxp60.js";import{Sc,kc}from"./chunk-46wqk1fb.js";import{St}from"./chunk-b1q40vq4.js";import{dn,Pc,yr,br}from"./chunk-bygxt820.js";import{g}from"./chunk-0dve54ne.js";import{ro}from"./chunk-69b8mr68.js";import Q from"fs";import N from"path";import{loadConfigWithResult as Bt}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function it(e,n={}){let{duration:i,delay:o,ease:s,direction:c,custom:d}={...B,...n};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -234,7 +234,7 @@ else {
|
|
|
234
234
|
</script>
|
|
235
235
|
`}var Pe={name:"transition",handler:(e,n,i,o)=>{if(n.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let s=n[0],c=n.length>1?Number.parseInt(n[1],10)||B.duration:B.duration,d=n.length>2?n[2]||B.ease:B.ease,p=n.length>3?Number.parseInt(n[3],10)||B.delay:B.delay,u=n.length>4?n[4]||B.direction:B.direction,m=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=it(s,{duration:c,delay:p,ease:d,direction:u}),f="stx-transition",v="";if(s==="fade")v="stx-fade";else if(s==="slide")v="stx-slide";else if(s==="scale")v="stx-scale";else if(s==="flip")v="stx-flip";else if(s==="rotate")v="stx-rotate";return`<div id="${m}" class="${f} ${v} ${u==="out"?"stx-out":""}"
|
|
236
236
|
style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},ke={name:"scrollAnimate",handler:(e,n,i,o)=>{if(n.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let s=n[0],c=n.length>1?Number.parseInt(n[1],10)||300:300,d=n.length>2?n[2]||"ease":"ease",p=n.length>3?Number.parseFloat(n[3])||0.2:0.2,u=n.length>4?Number.parseInt(n[4],10)||0:0,m=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,f="stx-transition stx-observe stx-out";if(s==="fade")f+=" stx-fade";else if(s==="slide-up"||s==="slide")f+=" stx-from-bottom";else if(s==="slide-down")f+=" stx-from-top";else if(s==="slide-left")f+=" stx-from-right";else if(s==="slide-right")f+=" stx-from-left";else if(s==="scale")f+=" stx-scale";else if(s.includes("-"))f+=` stx-${s}`;else f+=` stx-${s}`;return`<div id="${m}" class="${f}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},Ae={name:"animationGroup",handler:(e,n,i,o)=>{if(n.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let s=n[0],c=n.slice(1).map((m)=>m.startsWith("#")||m.startsWith(".")?m:`#${m}`),d=i.staggerDelay||50,p=i.sequence||!0,u=dt(s,c,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,n,i,o)=>{let s=n.length>0?n[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},_e={name:"motion",handler:(e,n,i,o)=>{let s=n.length>0?n[0].toLowerCase()==="true":!0,c=at();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function hc(e,n,i,o){let s=e;if(o.animation?.enabled===!1)return s;let c=i.includes("test")&&i.includes("animation");if(!ot(s)&&!c)return s;if(!s.includes('<style id="stx-animation-base">')){let p=ct();s=s.replace("</head>",`${p}
|
|
238
238
|
</head>`)}if(s.includes("stx-observe")){if(!s.includes("Intersection Observer for scroll animations")){let u=lt(),m=s.lastIndexOf("</body>");if(m!==-1)s=s.slice(0,m)+u+`
|
|
239
239
|
`+s.slice(m)}}return s}async function ut(e,n,i,o){let s=n[0]?.replace(/['"]/g,"")||"main",c=nt();if(s!=="main")c=c.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${c}</script>`}var Re={name:"stxRouter",handler:ut,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var pt={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Oe(e){let n=e.heatmap;if(!n?.enabled)return"";let i={...pt,...n};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
@@ -619,7 +619,7 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
622
|
+
`}function yc(e,n){let i=Oe(n);if(!i)return e;let o=e.lastIndexOf("</body>");if(o!==-1)return e.slice(0,o)+i+e.slice(o);return e+i}var Ee={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,n,i,o)=>{let s=i.__stx_config||{};if(n.length>0){let c=mt(n.join(" "));s.heatmap={...s.heatmap,...c,enabled:!0}}return Oe(s)}};function mt(e){let n={},i=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let o of i){let[s,c]=o.split("="),d=c?.replace(/["']/g,"");switch(s){case"endpoint":n.endpoint=d;break;case"samplingRate":n.samplingRate=Number.parseInt(d,10);break;case"batchSize":n.batchSize=Number.parseInt(d,10);break;case"trackMouse":n.trackMouse=d==="true";break;case"trackClicks":n.trackClicks=d==="true";break;case"trackScroll":n.trackScroll=d==="true";break;case"honorDnt":n.honorDnt=d==="true";break;case"debugOverlay":n.debugOverlay=d==="true";break}}return n}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ie(e){let n=e.trim().toLowerCase();return!n.startsWith("javascript:")&&!n.startsWith("vbscript:")&&!n.startsWith("data:text/html")}function fr(e){let n=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,i=e.match(n);if(!i)return{data:{},content:e.trim()};let o=i[1],s=e.slice(i[0].length),c={};for(let d of o.split(`
|
|
623
623
|
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let m=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[m]=y}return{data:c,content:s.trim()}}function et(e,n={}){let{gfm:i=!0,breaks:o=!1}=n,s=e,c=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,f,v)=>{let b=c.length,w=f?` class="language-${J(f)}"`:"";return c.push(`<pre><code${w}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),s=s.replace(/`([^`]*)`/g,(y,f)=>`<code>${J(f)}</code>`),s=s.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),s=s.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),s=s.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),s=s.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),s=s.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),s=s.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),s=s.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),s=s.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/__(.+?)__/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),i)s=s.replace(/~~(.+?)~~/g,"<del>$1</del>");if(s=s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,f,v)=>`<img src="${Ie(v)?J(v):""}" alt="${J(f)}" />`),s=s.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,f,v)=>`<a href="${Ie(v)?J(v):""}">${f}</a>`),s=s.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),s=s.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),s=s.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
624
624
|
`),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),i)s=s.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,f,v)=>{let w=`<tr>${f.split("|").map((C)=>C.trim()).filter(Boolean).map((C)=>`<th>${J(C)}</th>`).join("")}</tr>`,k=v.trim().split(`
|
|
625
625
|
`).map((C)=>`<tr>${C.split("|").map((P)=>P.trim()).filter(Boolean).map((P)=>`<td>${J(P)}</td>`).join("")}</tr>`).join(`
|
|
@@ -637,7 +637,7 @@ ${k}
|
|
|
637
637
|
`:`
|
|
638
638
|
`)}</p>`);if(s=p.join(`
|
|
639
639
|
`),o)s=s.replace(/\n/g,`<br />
|
|
640
|
-
`);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function
|
|
640
|
+
`);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function bc(e,n,i=""){let o=e,s=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let p=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),m=u?u[1]:"",y=p+d[0].length,f=1,v=y,b=-1;while(f>0&&v<e.length){let C=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(C!==-1&&C<A&&C!==p){let P=e[C+9];if(P==="("||P===`
|
|
641
641
|
`||P==="\r"||P===" "||P===void 0)f++;v=C+9}else{if(f--,f===0){b=A;break}v=A+12}}if(b===-1)continue;let w=e.slice(y,b),k=e.slice(p,b+12);s.push({fullMatch:k,options:m,content:w,index:p}),c.lastIndex=b+12}for(let{fullMatch:p,options:u,content:m,index:y}of s)try{let f={};if(u)u.split(",").forEach((w)=>{let k=w.trim();if(k)f[k]=!0});let v={gfm:f.gfm??!0,breaks:f.breaks??!1},b=et(m.trim(),v);o=o.split(p).join(b)}catch(f){let v=f instanceof Error?f.message:String(f),b=h("Markdown Directive",`Error processing markdown: ${v}`,i,e,y,p);o=o.split(p).join(b)}return o}async function Te(e,n,i,o){let s={gfm:!0,breaks:!1};return n.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),et(e.trim(),s)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],gt=[1,1.5,2,3],te=["avif","webp","jpeg"],ft={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function me(e,n=Z,i={},o){return n.sort((s,c)=>s-c).map((s)=>`${re(e,{...i,w:s,fm:o})} ${s}w`).join(", ")}function Me(e,n,i=gt,o={},s){return i.sort((c,d)=>c-d).map((c)=>{let d=Math.round(n*c);return`${re(e,{...o,w:d,dpr:c,fm:s})} ${c}x`}).join(", ")}function ge(e,n="100vw"){if(!e||Object.keys(e).length===0)return n;let o=Object.entries(e).map(([s,c])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((s,c)=>s.numericBp-c.numericBp).map(({bp:s,size:c})=>`(max-width: ${s}) ${c}`);return o.push(n),o.join(", ")}function re(e,n={}){let i=Object.entries(n).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(i.length===0)return e;let o=i.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),s=e.includes("?")?"&":"?";return`${e}${s}${o}`}function fe(e){return ft[e]||"application/octet-stream"}var ht={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},ye=`
|
|
642
642
|
.stx-img-placeholder {
|
|
643
643
|
position: relative;
|
|
@@ -684,7 +684,7 @@ ${k}
|
|
|
684
684
|
#${e}.stx-img-loaded img {
|
|
685
685
|
opacity: 1;
|
|
686
686
|
}
|
|
687
|
-
`.trim()}var he=new Map;async function Ne(e,n={}){let i=`${e}:${JSON.stringify(n)}`;if(he.has(i))return he.get(i);let o=await vt(e,n);return he.set(i,o),o}async function wt(){try{return await import("./chunk-
|
|
687
|
+
`.trim()}var he=new Map;async function Ne(e,n={}){let i=`${e}:${JSON.stringify(n)}`;if(he.has(i))return he.get(i);let o=await vt(e,n);return he.set(i,o),o}async function wt(){try{return await import("./chunk-3qstewq3.js")}catch(e){if(!Ve)console.warn("[stx-media] Image processor not available, some features disabled:",e),Ve=!0;return null}}var Ve=!1,ve=80,le="async",ce="lazy",ze=!1;async function oe(e,n={}){let i=n,o=e;if(o.process&&!o.skipOptimization){if(i.tsImagesConfig?.enabled&&!i.isDev)return Pt(o,i)}if(i.processedResult?.processed)return we(e,i.processedResult,n);if(i.responsiveVariants)return Fe(e,i.responsiveVariants,n);let{src:s,alt:c,width:d,height:p,sizes:u,widths:m=Z,dpr:y,formats:f=te,quality:v=ve,params:b={},placeholder:w="none",placeholderOptions:k={},lazy:C=!0,priority:A=!1,loading:P=A?"eager":ce,decoding:E=le,fetchpriority:I,objectFit:D,objectPosition:S,crossorigin:x,referrerpolicy:T}=e,{class:V,style:M,id:z}=e,_=e.data||{},{isDev:L=!1,baseUrl:G=""}=n;if(L&&!n.optimize)return Dt(e);let W,R,H=z||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(w!=="none"&&!A)try{W=await Ne(s,{strategy:w,...k}),R=je(H,W,k)}catch{}let ie=y!==void 0&&d!==void 0,X;if(ie)X=Ct(e,H,W,n);else X=await $t(e,H,W,n);let ee;if(A){let De=f.includes("webp")?"webp":f[0],rt=me(s,m,{...b,q:v},De),st=typeof u==="object"?ge(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ae=[];if(!ze&&w!=="none")ae.push(ye),ze=!0;if(R)ae.push(R);let tt=C?We(H):void 0;return{html:X,preloadLink:ee,css:ae.length>0?ae.join(`
|
|
688
688
|
`):void 0,script:tt}}async function $t(e,n,i,o){let{src:s,alt:c,width:d,height:p,sizes:u,widths:m=Z,formats:y=te,quality:f=ve,params:v={},lazy:b=!0,priority:w=!1,loading:k=w?"eager":ce,decoding:C=le,fetchpriority:A,objectFit:P,objectPosition:E,crossorigin:I,referrerpolicy:D}=e,{class:S,style:x}=e,T=e.data||{},V=typeof u==="object"?ge(u):u||"100vw",M=[];for(let L of y){let G=me(s,m,{...v,q:f},L),W=fe(L);if(b&&!w)M.push(` <source type="${W}" data-srcset="${G}" data-sizes="${V}" />`);else M.push(` <source type="${W}" srcset="${G}" sizes="${V}" />`)}let z=be({src:re(s,{...v,q:f}),alt:c,width:d,height:p,loading:w?void 0:k,decoding:C,fetchpriority:w?"high":A,objectFit:P,objectPosition:E,crossorigin:I,referrerpolicy:D,className:Le(S,i),style:xe(x,P,E,i),lazy:b&&!w,data:T}),_;if(i){let L=`background-image: url('${i.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${n}" class="stx-img-placeholder" style="${L}">
|
|
689
689
|
<picture>
|
|
690
690
|
${M.join(`
|
|
@@ -748,7 +748,7 @@ ${D.join(`
|
|
|
748
748
|
`):void 0,script:G}}async function Fe(e,n,i){let o={src:n.src,processed:!0,variants:[],placeholder:n.placeholder?.dataURL,originalWidth:n.placeholder?.width,originalHeight:n.placeholder?.height};for(let[s,c]of Object.entries(n.byFormat))if(c)o.variants.push(...c);return we(e,o,i)}function kt(){return St({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,n,i,o)=>{let{src:s,alt:c,options:d}=At(e,n,i);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let p={src:s,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=i.__isDev||!1,m=await oe(p,{isDev:u}),y=m.html;if(m.preloadLink)y=m.preloadLink+`
|
|
749
749
|
`+y;if(m.css)y+=`
|
|
750
750
|
<style>${m.css}</style>`;if(m.script)y+=`
|
|
751
|
-
<script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,n,i){if(n.src)return{src:String(n.src),alt:String(n.alt||""),options:n.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=_t(o),c=$e(s[0],i)||"",d=$e(s[1],i)||"",p={};if(s[2]){let u=$e(s[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof s[2]==="string")try{p=JSON.parse(s[2])}catch{}}return{src:c,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function $e(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function Ss(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let n of e)if(Rt(ne.join(n,"View.stx")))return n;return e[0]}async function Ue(){try{return await import("./chunk-
|
|
751
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function At(e,n,i){if(n.src)return{src:String(n.src),alt:String(n.alt||""),options:n.options||{}};let o=e.trim();if(o.startsWith("@img(")||o.startsWith("("))o=o.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=_t(o),c=$e(s[0],i)||"",d=$e(s[1],i)||"",p={};if(s[2]){let u=$e(s[2],i);if(typeof u==="object"&&u!==null)p=u;else if(typeof s[2]==="string")try{p=JSON.parse(s[2])}catch{}}return{src:c,alt:d,options:p}}function _t(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function $e(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var qe=kt();import{existsSync as Rt}from"fs";import ne from"path";function Ss(){let e=[ne.join(import.meta.dir,"primitives"),ne.join(import.meta.dir,"..","primitives"),ne.join(import.meta.dir,"native","primitives"),ne.join(import.meta.dir,"..","native","primitives")];for(let n of e)if(Rt(ne.join(n,"View.stx")))return n;return e[0]}async function Ue(){try{return await import("./chunk-f1wv2q2z.js")}catch(e){if(!He)console.warn("[stx-media] Video processor not available, some features disabled:",e),He=!0;return null}}var He=!1,Be=!0,Je="metadata",Ot="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function de(e,n={}){let i=n,o=e;if(o.process&&!o.skipProcessing){if(i.tsVideosConfig?.enabled&&!i.isDev)return jt(o,i)}if(i.processedResult?.processed)return Ge(e,i.processedResult,n);let s;if(o.generatePoster&&o.src&&!e.poster)s=await Nt(o,i);let{src:c,sources:d=[],poster:p,posterPlaceholder:u,controls:m=Be,autoplay:y=!1,muted:f=!1,loop:v=!1,preload:b=Je,playsinline:w=!0,lazy:k=!0,player:C="native",type:A,width:P,height:E,crossorigin:I,disablePictureInPicture:D=!1,disableRemotePlayback:S=!1}=e,x=s||p,{class:T,style:V}=e,M=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(C==="ts-video")return It(e,n);if(A&&A!=="video")return Et(c||"",A,e);let z=d.length>0?d:c?[{src:c,type:Ke(c)}]:[],_=[`id="${M}"`];if(m)_.push("controls");if(y)_.push("autoplay");if(f)_.push("muted");if(v)_.push("loop");if(w)_.push("playsinline");if(D)_.push("disablepictureinpicture");if(S)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(k){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),x)_.push(`data-poster="${j(x)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),x)_.push(`poster="${j(x)}"`);if(P)_.push(`width="${P}"`);if(E)_.push(`height="${E}"`);if(T)_.push(`class="${j(T)}"`);if(V)_.push(`style="${j(V)}"`);let L=z.map((R)=>` <source ${k?`data-src="${j(R.src)}"`:`src="${j(R.src)}"`} type="${R.type}"${R.media?` media="${R.media}"`:""} />`).join(`
|
|
752
752
|
`),G=`<video ${_.join(" ")}>
|
|
753
753
|
${L}
|
|
754
754
|
Your browser does not support the video tag.
|
|
@@ -1007,7 +1007,7 @@ ${z}
|
|
|
1007
1007
|
}
|
|
1008
1008
|
`.trim();return{html:z,script:_,css:L}}function Ye(){return St({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,n,i,o)=>{let{src:s,options:c}=Vt(e,n,i);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,poster:c.poster,controls:c.controls!==!1,autoplay:c.autoplay||!1,muted:c.muted||!1,loop:c.loop||!1,preload:c.preload||"metadata",playsinline:c.playsinline!==!1,lazy:c.lazy!==!1,player:c.player||"native",type:c.type,width:c.width,height:c.height,class:c.class,style:c.style,id:c.id,crossorigin:c.crossorigin,disablePictureInPicture:c.disablePictureInPicture,disableRemotePlayback:c.disableRemotePlayback,title:c.title,quality:c.quality,platform:c.platform,process:c.process,generatePoster:c.generatePoster,streaming:c.streaming,transcode:c.transcode,spriteSheet:c.spriteSheet,waveform:c.waveform},u={isDev:i.__isDev||!1,tsVideosConfig:i.__tsVideosConfig},m=await de(d,u),y=m.html;if(m.css)y+=`
|
|
1009
1009
|
<style>${m.css}</style>`;if(m.script)y+=`
|
|
1010
|
-
<script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,n,i){if(n.src)return{src:String(n.src),options:n.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=zt(o),c=Xe(s[0],i)||"",d={};if(s[1]){let p=Xe(s[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:c,options:d}}function zt(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function Xe(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import q from"path";async function ks(e,n){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let s of i)try{let c=await Wt(s,e,n);if(c)o.push(c)}catch(c){if(console.error(`Error building web component ${s.name}:`,c),e.debug)throw c}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:c,extends:d}=e;if(!o||!s||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(s)&&await r(s))p=s;else if(n.componentsDir){let k=q.join(n.componentsDir,s);if(await r(k))p=k}if(!p)p=await
|
|
1010
|
+
<script>${m.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Vt(e,n,i){if(n.src)return{src:String(n.src),options:n.options||{}};let o=e.trim();if(o.startsWith("@video(")||o.startsWith("("))o=o.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=zt(o),c=Xe(s[0],i)||"",d={};if(s[1]){let p=Xe(s[1],i);if(typeof p==="object"&&p!==null)d=p;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:c,options:d}}function zt(e){let n=[],i="",o=!1,s="",c=0,d=0;for(let p=0;p<e.length;p++){let u=e[p],m=p>0?e[p-1]:"";if((u==='"'||u==="'"||u==="`")&&m!=="\\"){if(!o)o=!0,s=u;else if(u===s)o=!1,s="";else i+=u;continue}if(!o){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){n.push(i.trim()),i="";continue}}i+=u}if(i.trim())n.push(i.trim());return n}function Xe(e,n){if(typeof e!=="string")return e;let i=e.trim();if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))return i.slice(1,-1);if(!i.startsWith("/")&&!i.startsWith(".")&&!i.startsWith("http")&&!i.startsWith("{")){let o=n[i];if(o!==void 0)return o}if(i.startsWith("{")||i.startsWith("["))try{return JSON.parse(i)}catch{}return i}var Se=Ye();import Lt from"fs";import q from"path";async function ks(e,n){if(!e.webComponents?.enabled)return[];let i=e.webComponents.components||[],o=[];if(i.length>0){if(e.debug)console.log(`Building ${i.length} web components...`);for(let s of i)try{let c=await Wt(s,e,n);if(c)o.push(c)}catch(c){if(console.error(`Error building web component ${s.name}:`,c),e.debug)throw c}}return o}async function Wt(e,n,i){let{name:o,file:s,tag:c,extends:d}=e;if(!o||!s||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let p=null;if(q.isAbsolute(s)&&await r(s))p=s;else if(n.componentsDir){let k=q.join(n.componentsDir,s);if(await r(k))p=k}if(!p)p=await vn(s,process.cwd(),n,i);if(!p)return console.error(`Web component source file not found: ${s}`),null;let u=await Bun.file(p).text();i.add(p);let y=(e.outputFormat||"js")==="ts",f=y?qt({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Ft({name:o,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=n.webComponents?.outputDir||"dist/web-components";await Lt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",w=q.join(v,`${c}.${b}`);if(await Bun.write(w,f),n.debug)console.log(`Built web component ${o} -> ${w}`);return w}function Ft(e){let{name:n,tag:i,baseElement:o="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:p,attributes:u=[]}=e,m=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)m=m.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),m=m.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),m=m.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),m=m.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(p)y=`<link rel="stylesheet" href="${p}">`;return`/**
|
|
1011
1011
|
* ${n} Web Component
|
|
1012
1012
|
* Auto-generated from stx component
|
|
1013
1013
|
*/
|
|
@@ -1307,6 +1307,6 @@ ${y}
|
|
|
1307
1307
|
customElements.define('${n}', ${d});
|
|
1308
1308
|
`}async function Ze(e,n,i,o){if(n.length<1)return l("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=n[0].replace(/['"]/g,""),d=(i.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(o),`${s}.stx`)]:[q.join(q.dirname(o),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(o),`${s}.stx`)],u=null;for(let f of p)if(await r(f)){u=await Bun.file(f).text();break}if(!u)return l("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let m=Ht(u,s);return`<script type="module">
|
|
1309
1309
|
${Ut(m)}
|
|
1310
|
-
</script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:pn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},xc,Sc,Es,Ts,Pe,Ae,_e,ke,Re,Ee,qe,Se,...ro],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,n,i){let o=n||"pages";if(e)return{root:e,pagesDir:o};let s=i||process.cwd(),c=N.join(s,"resources","views"),d=N.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,n){let i=n.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return o===s||o.startsWith(`${s}/`)}function Uf(e,n){let i=!e.root,o=Jt(e.root,e.pagesDir,n);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let s=`${n}::${o.root}`;if(!Qe.has(s))Qe.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let s={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,s))continue;e[c]=N.join(s,d)}}for(let s of pe){let c=e[s];if(typeof c!=="string"||!c||N.isAbsolute(c))continue;e[s]=N.resolve(n,c)}return e}function Gt(e,n){let i=Ce.get(e);for(let o of pe){let s=e[o];if(typeof s!=="string"||!s)continue;let c=N.isAbsolute(s)?s:N.join(n,s);if(Q.existsSync(c))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Ac(e.stateDir),e.stateDir=yr(),e.cachePath=br(e.cachePath),e.build)e.build.cacheDir=br(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=br(e.media.cache.directory);if(e.story)e.story.outDir=br(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Zo(e,n=Bt){try{return await n(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let n=e?N.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==_s(i.graph)){let c=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-txakmp61.js"),{partialsCache:p}=await import("./chunk-bj2bgazr.js");if(d(),p.clear(),c&&i.configSignature===Cs(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await ei(y,n),ue.set(n,{graph:y,signature:_s(y),configSignature:Cs(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(n,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(n);if(o)return o;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(N.join(n,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(N.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await Zo({name:"ui",cwd:N.join(n,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await Zo({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Zo({name:"stx",alias:"ui",cwd:n,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await _c(n,F);u=v.config,ue.set(n,{graph:v.graph,signature:_s(v.graph),configSignature:Cs(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-hph5qt43.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-c656az66.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Uf(u,n),Gt(u,n);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[n]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-5t93dqft.js"),b=[],w=[],k=new Set(u.componentPackages??["@stacksjs/components"]),C=[];for(let A of f){let P=typeof A==="string"?A:A[0],E=typeof A==="string"?{}:A[1]||{};try{let I,D;try{let x=g.resolve(P,{paths:[n]});I=await import(x),D=N.dirname(x)}catch{let x=N.resolve(n,P);I=await import(x),D=N.dirname(x)}let S=I.default||I;if(!v.has(S.name))await v.register(S,u);if(S.components){let x=Array.isArray(S.components)?S.components:[S.components],T=k.has(S.name)||k.has(P)||k.has(P.replace(/\/stx-plugin$/,""));for(let V of x){let M=N.resolve(D,V);if(b.push(M),T)w.push(M)}}if(S.pages){let x=N.resolve(D,S.pages),T=E.path||"/";C.push({dir:x,prefix:T})}if(S.setup){let x={addDirective:(T)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(T)},addRoute:(T,V)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[T]=V},addMiddleware:(T)=>{u.middleware=u.middleware||[],u.middleware.push(T)},pluginDir:D,config:u};await S.setup(E,x)}process.stderr.write(`[stx] Plugin loaded: ${S.name||P}
|
|
1311
|
-
`)}catch(I){console.warn(`[stx] Failed to load plugin ${P}:`,I.message)}}u._pluginComponentDirs=b,u._componentPackageDirs=w,u._pluginPageDirs=C}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:Ss(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(n,s),s.catch(()=>{if(Y.get(n)===s)Y.delete(n)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var O=new Proxy(F,{get(e,n){if(K&&n in K)return K[n];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[n]}});function
|
|
1312
|
-
export{
|
|
1310
|
+
</script>`}var F={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:dn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Te,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Ze,hasEndTag:!1,description:"Include a web component in the template"},Sc,kc,Es,Ts,Pe,Ae,_e,ke,Re,Ee,qe,Se,...ro],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Jt(e,n,i){let o=n||"pages";if(e)return{root:e,pagesDir:o};let s=i||process.cwd(),c=N.join(s,"resources","views"),d=N.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=N.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:o};return{root:".",pagesDir:o}}var Qe=new Set,pe=["partialsDir","componentsDir","layoutsDir"],Ce=new WeakMap;function Kt(e,n){let i=n.replace(/[\\/]+$/,"");if(!i||i===".")return!0;let o=e.replace(/\\/g,"/"),s=i.replace(/\\/g,"/");return o===s||o.startsWith(`${s}/`)}function Wf(e,n){let i=!e.root,o=Jt(e.root,e.pagesDir,n);if(e.root=o.root,e.pagesDir=o.pagesDir,i&&o.root!=="."){let s=`${n}::${o.root}`;if(!Qe.has(s))Qe.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${o.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Ce.has(e)){let s={};for(let c of pe){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Ce.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of pe){let d=e[c];if(typeof d!=="string"||!d)continue;if(N.isAbsolute(d)||Kt(d,s))continue;e[c]=N.join(s,d)}}for(let s of pe){let c=e[s];if(typeof c!=="string"||!c||N.isAbsolute(c))continue;e[s]=N.resolve(n,c)}return e}function Gt(e,n){let i=Ce.get(e);for(let o of pe){let s=e[o];if(typeof s!=="string"||!s)continue;let c=N.isAbsolute(s)?s:N.join(n,s);if(Q.existsSync(c))continue;let d=i?.[o]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(o)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Yt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Xt(e){if(Pc(e.stateDir),e.stateDir=yr(),e.cachePath=br(e.cachePath),e.build)e.build.cacheDir=br(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=br(e.media.cache.directory);if(e.story)e.story.outDir=br(e.story.outDir)}var K=null,Y=new Map,ue=new Map,se=null;async function Zo(e,n=Bt){try{return await n(e)}catch(i){if(i instanceof Error&&i.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw i}}async function a(e){let n=e?N.resolve(e):process.cwd(),i=ue.get(n);if(i&&i.signature!==_s(i.graph)){let c=Y.get(n);if(Y.delete(n),ue.delete(n),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-gd7vyzhw.js"),{partialsCache:p}=await import("./chunk-th7343bz.js");if(d(),p.clear(),c&&i.configSignature===Cs(i.graph)){let u=c.then(async(m)=>{let y={...i.graph};await ei(y,n),ue.set(n,{graph:y,signature:_s(y),configSignature:Cs(y)});let f={...m,_layerGraph:y};if(!e)K=f;return f});return Y.set(n,u),u}}if(!e){if(K)return K;if(se)return se}let o=Y.get(n);if(o)return o;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(N.join(n,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(N.join(n,"config",`ui${v}`))),u;if(d&&p){let v=await Zo({name:"ui",cwd:N.join(n,"config"),defaultConfig:F,errorPolicy:"throw",verbose:!1});u=(await Zo({name:"stx",alias:"ui",cwd:n,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Zo({name:"stx",alias:"ui",cwd:n,defaultConfig:F,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||i){let v=await Cc(n,F);u=v.config,ue.set(n,{graph:v.graph,signature:_s(v.graph),configSignature:Cs(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-n4c8srx8.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-sjcvc0bd.js");await b(n,u.runtimeConfig)}Yt(u),Xt(u),Wf(u,n),Gt(u,n);let m=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{g.resolve(b,{paths:[n]}),m.push(b)}catch{}}let f=[...u.plugins??[],...m];if(f.length>0){let{pluginManager:v}=await import("./chunk-z3qgv971.js"),b=[],w=[],k=new Set(u.componentPackages??["@stacksjs/components"]),C=[];for(let A of f){let P=typeof A==="string"?A:A[0],E=typeof A==="string"?{}:A[1]||{};try{let I,D;try{let x=g.resolve(P,{paths:[n]});I=await import(x),D=N.dirname(x)}catch{let x=N.resolve(n,P);I=await import(x),D=N.dirname(x)}let S=I.default||I;if(!v.has(S.name))await v.register(S,u);if(S.components){let x=Array.isArray(S.components)?S.components:[S.components],T=k.has(S.name)||k.has(P)||k.has(P.replace(/\/stx-plugin$/,""));for(let V of x){let M=N.resolve(D,V);if(b.push(M),T)w.push(M)}}if(S.pages){let x=N.resolve(D,S.pages),T=E.path||"/";C.push({dir:x,prefix:T})}if(S.setup){let x={addDirective:(T)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(T)},addRoute:(T,V)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[T]=V},addMiddleware:(T)=>{u.middleware=u.middleware||[],u.middleware.push(T)},pluginDir:D,config:u};await S.setup(E,x)}process.stderr.write(`[stx] Plugin loaded: ${S.name||P}
|
|
1311
|
+
`)}catch(I){console.warn(`[stx] Failed to load plugin ${P}:`,I.message)}}u._pluginComponentDirs=b,u._componentPackageDirs=w,u._pluginPageDirs=C}if(u.nativePrimitives!==!1)u._nativePrimitivesFallback={dir:Ss(),except:["Button","Checkbox","Switch","TextInput","Image","Video"]};return u})();if(Y.set(n,s),s.catch(()=>{if(Y.get(n)===s)Y.delete(n)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var O=new Proxy(F,{get(e,n){if(K&&n in K)return K[n];if(!se)a().catch((i)=>{console.warn("[stx] Failed to load config file:",i?.message||i)});return e[n]}});function Kh(e){return e}function Xh(e){let n=[],i=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")n.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")n.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")n.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")n.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)n.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)n.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let o=["auto","manual","sections"];if(!o.includes(e.streaming.strategy))n.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let o=["json","yaml","yml","js"];if(!o.includes(e.i18n.format))n.push({path:"i18n.format",message:`i18n.format must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)n.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)n.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let o=["AA","AAA"];if(!o.includes(e.a11y.level))n.push({path:"a11y.level",message:`a11y.level must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let o=["progressive","islands"];if(!o.includes(e.hydration.mode))n.push({path:"hydration.mode",message:`hydration.mode must be one of: ${o.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let o=["none","eager","lazy"];if(!o.includes(e.hydration.preload))n.push({path:"hydration.preload",message:`hydration.preload must be one of: ${o.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))n.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))n.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((o,s)=>{if(!o.name||typeof o.name!=="string")n.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!o.handler||typeof o.handler!=="function")n.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!o.timing||!["before","after"].includes(o.timing))n.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)i.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)i.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)n.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let o=["fullscreen","standalone","minimal-ui","browser"];if(!o.includes(e.pwa.manifest.display))n.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let o=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!o.includes(e.pwa.manifest.orientation))n.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.routes){let o=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")n.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!o.includes(s.strategy))n.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${o.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))n.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))n.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)n.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let o=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!o.includes(c)).length>0)n.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${o.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)i.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)i.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:n.length===0,errors:n,warnings:i}}
|
|
1312
|
+
export{hc,yc,fr,et,bc,Ss,ks,F,Wf,Zo,a,O,Kh,Xh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{cm,lm,um,dm,Vl,pm,fm,gm,mm,hm,ym,bm}from"./chunk-3ba0nqwm.js";export{ym as Broadcast,bm as BroadcastServer,Vl as broadcast,mm as broadcastPresence,gm as broadcastPrivate,hm as channel,cm as getBroadcastServer,dm as loadChannels,lm as startBroadcasting,um as stopBroadcasting,pm as toUser,fm as toUsers};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bm,Sa,gu,Fm,zm,Hm,Vm,Um,mu,hu,Wm,qm,Km,Xm}from"./chunk-c4by7m5b.js";import"./chunk-japk9yf6.js";import"./chunk-sfww6v6m.js";import"./chunk-y49nzyxf.js";import"./chunk-4dxq7ft1.js";import"./chunk-5fspjf7x.js";import"./chunk-rm5pnhzx.js";import"./chunk-71fsg3az.js";import"./chunk-48vnw9t9.js";import"./chunk-txfz7gc3.js";import"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-e5seb8f7.js";import"./chunk-vhckqe4x.js";import"./chunk-46wqk1fb.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-rb6vr5v9.js";import"./chunk-kxj5sp5w.js";import"./chunk-gz45xsbg.js";import"./chunk-tpf8v2mb.js";import"./chunk-47n5s7wk.js";import"./chunk-r8xwd8r1.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{gu as SUSPENSE_RESOLVER_RUNTIME,Sa as buildSuspenseResolveScript,Um as createStreamRenderer,Hm as extractStreamBoundaries,Xm as generateHydrationRuntime,hu as islandDirective,qm as processSectionDirectives,zm as processStreamDirectives,Wm as registerStreamingDirectives,Fm as renderStreamingPage,Bm as streamTemplate,Vm as streamTemplateSimple,Km as streamToResponse,mu as streamingSuspenseDirective};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{f,d}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{f,d}from"./chunk-r8xwd8r1.js";import{Y,N,p}from"./chunk-gz45xsbg.js";function B(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var k=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function E(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function Z(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=E(t,s+1);if(a===-1)return-1;let u=t.slice(s,a),c=u.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(c&&c[2].toLowerCase()===r){if(c[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(u))e++}n=a}return-1}function L(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=E(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[2].toLowerCase();if(u[1]==="/"){let l=i.lastIndexOf(c);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),m=i.length===0?a.match(r):null;if(m){let l=m[1]||m[2],h=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||k.has(c)?-1:Z(t,c,s);if(S===-1)o.push({start:n,end:s,slotName:l,element:h}),e=s;else o.push({start:n,end:S,slotName:l,element:h+t.slice(s,S)}),e=S;continue}if(!g&&!k.has(c)){if(i.push(c),c==="script"||c==="style"){let l=t.toLowerCase().indexOf(`</${c}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function j(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=E(t,n+1);if(s===-1)break;let a=t.slice(n,s),u=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!u){e=s;continue}let c=u[1]==="/",g=u[2].toLowerCase();if(c){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let h=B(t,s);if(h!==-1){let S=l[1]||l[2]||l[3];o.push({start:n,end:h,slotName:S,content:t.slice(s,h-11).trim(),propsBinding:l[4]||void 0}),e=h;continue}}}if(!/\/\s*>$/.test(a)&&!k.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function Wl(t){let o={default:"",named:new Map},i=t,r=j(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=L(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function vm(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function ql(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r},a=new Set,u=new Set;if(n.startsWith("{")&&n.endsWith("}")){let c=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of c){let[m,l]=g.split(":").map((S)=>S.trim()),h=l||m;if(s[h]=o[m],o[m]!==void 0)u.add(h);else a.add(h)}}else if(s[n]=o,Object.values(o).some((c)=>c===void 0))a.add(n);else u.add(n);e=I(e,s,a,u)}return e}function I(t,o,i,r){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(e,n)=>{try{let s=n.trim();if(N(s,i))return e;if(Array.isArray(o.__stx_preserved_client_expressions)&&o.__stx_preserved_client_expressions.includes(s)&&!N(s,r))return e;let a=C(s,o);if(a===void 0)return e;return p(String(a??""))}catch{return`{{ ${n} }}`}})}function C(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!f(t))return;return d(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Kl(t,o,i,r){let e=t;e=await W(e,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(a,u,c,g)=>{let m=o.named.get(u),l=g?.trim()||"",h=c||"",S={},A=[],M=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,b;while((b=M.exec(h))!==null){let w=b[1],x=b[2];S[w]=C(x,i),A.push([w,x])}if(r!==void 0&&m?.propsBinding&&Object.values(S).some((w)=>w===void 0)){let w=m.propsBinding.trim(),x=Y(`${w} in []`),y="__stx_slot_props";while(x.includes(y))y+="_";let v=A.map(([O,z])=>{let R=S[O],_;try{_=R===void 0?void 0:JSON.stringify(R)}catch{}return`${JSON.stringify(O)}:(${_??z})`}).join(","),P=p(JSON.stringify({binding:w,names:x,owner:r}));return`<template :for="${p(`${y} in [{${v}}]`)}" data-stx-slot-binding="${encodeURIComponent(w)}" data-stx-slot-scope="${P}">${m.content}</template>`}return await ql(m,S,l,i)});let s=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return e=e.replace(s,(a,u,c)=>{if(/\bname\s*=/.test(u||""))return a;let g=c?.trim()||"";return o.default||g}),e}async function W(t,o,i){let r=[],e=[];t.replace(o,(a,...u)=>{let c=u[u.length-2];return e.push({match:a,index:c}),r.push(i(a,...u.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:u,index:c}=e[a];s=s.slice(0,c)+n[a]+s.slice(c+u.length)}return s}function xm(t){let o=Wl(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Sm(t,o,i,r,e){return await Kl(t,{default:o,named:i},r,e)}
|
|
3
|
+
export{Wl,vm,ql,Kl,xm,Sm};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{rr,Re}from"./chunk-4y6hes3h.js";import{V,w,vr,js,C}from"./chunk-y5k93ysf.js";import{a,O}from"./chunk-m87qhcsz.js";import{Do}from"./chunk-wr1werwe.js";import{rt}from"./chunk-car6nhfe.js";import{c}from"./chunk-z4g64re8.js";import{s,me}from"./chunk-x4f7efgp.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||Do(t,e,n)}var at=2;function kf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function nt(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var st=new Map;function wt(t){let e=p.resolve(t),n=st.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),st.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function _f(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var H=new Map;async function jt(t){let e=H.get(t)??0;if(e>0&&e<vt){H.set(t,e+1);return}H.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=_f();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,b)=>b.at-o.at);for(let o of d.slice(i)){let b=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${b}.js`),{force:!0}),await B.promises.rm(p.join(t,`${b}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function ye(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function Cf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(Cf())console.log("[stx:bundler]",...t)}var K=[];function rc(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function nn(){return K.slice()}function rn(){K.length=0}var Q;function Th(t){Q=t}function sc(){if(Q)return Q;try{let t=O.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function sn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var nr="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Ef(t,e){return p.relative(t,e).split(p.sep).join("/")}function Tf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(nr)?`${i}${l}${o}${l}`:n})}function $f(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,b=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let b of d.split(",")){let I=b.trim();if(!I)continue;let M=I.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,b)=>{let I=b.slice(nr.length),M=i(I),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(nr.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var G=new xt;function is(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return G.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function on(){return G.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,b,I,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,r,u)=>{if(X(r,t,b))return null;if(!d||!f(j)||!Bt.test(r))return null;try{if(!B.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(r);let E=`${nr}${Ef(process.cwd(),r)}`;return o.set(u,E),{path:E,external:!0}},y=(j,r)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,r);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),j.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=it(r.path);if(u){let E=v(r.importer,u,r.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:r.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(r)=>{let u=y(r.importer,r.path),E=v(r.importer,u,r.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(r)=>{let u=p.resolve(t,r.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,h,r.path);if(D)return D;return A(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${nr}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(S.has(r.path))return{contents:S.get(r.path),loader:"ts"};if(X(r.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=p.extname(r.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))l.add(r.path);let h=I?.get(r.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(r.path,"utf8"),loader:E}})}}}var q=new Map,P=w(64),ot=Symbol.for("stx.client-bundle-build-queue");function Rf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function an(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,b=n.expose?.length?[...new Set(n.expose)].sort():void 0,I=n.cacheDir||kf(i),M=G.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${rt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${nt(t,i)}\x00${nt(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(I,`${f}.js`),y=P.get(v);if(y){if(js(y.files)&&y.files.every((h)=>!X(h.path,i,l))){A("memo hit:",f);let h=y.files.map((D)=>D.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(I,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let h=Bun.file(j),D=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=vr(N.files.map((g)=>ct(g,i))),D=k.length===N.files.length&&!k.some((g)=>X(g.path,i,l))}catch{D=!1}if(D){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await r.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((D)=>D.path));return h}let E=Rf(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:I,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:b,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function oc(t){return`${t}-${process.pid}-${yt()}`}async function $h(t,e){let{projectRoot:n}=e,i=oc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,b=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${b++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[I,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),I,M,S,!1,new Map,void 0,G.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let r=o.get(j.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:b,depsPath:I,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=oc(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=s(t),{depths:D,balanced:k}=me(h),N=(R)=>!k||D[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;r.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)r.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)r.delete(_)}let pt=r.size>0?`
|
|
3
|
-
export { ${[...r].join(", ")} }`:"";A("bundling:",o,"from:",p.basename(e));let tt=new Set,et=new Map;try{let R=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:l?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ut(i,j,v,t+pt,tt,M,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":l?'"production"':'"development"',...C()},root:i});if(!R.success){let F=R.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${p.basename(e)}`,z=rr(R.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",F),
|
|
2
|
+
import{rr,Re}from"./chunk-4y6hes3h.js";import{V,w,vr,js,C}from"./chunk-gz45xsbg.js";import{a,O}from"./chunk-vhckqe4x.js";import{Do}from"./chunk-3e1hmm3h.js";import{rt}from"./chunk-car6nhfe.js";import{c}from"./chunk-bygxt820.js";import{s,me}from"./chunk-x0dx1pyf.js";import p from"path";import B from"fs";import{AsyncLocalStorage as xt}from"async_hooks";import{randomUUID as yt}from"crypto";var $t=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(p.basename(t))||Do(t,e,n)}var at=2;function _f(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?p.resolve(e):c(t,"bundle-cache")}function nt(t,e){let n=t;for(let i of wt(e))if(i!==p.sep)n=n.split(i).join("\x00root");return n}var st=new Map;function wt(t){let e=p.resolve(t),n=st.get(e);if(!n){let i=e;try{i=B.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((l,d)=>d.length-l.length),st.set(e,n)}return n}function bt(t,e){try{let n=B.statSync(t),i=p.resolve(e),l=t.startsWith(`${i}${p.sep}`);return{path:l?p.relative(i,t):t,...l?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(B.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?p.join(p.resolve(e),t.path):t.path}function St(t,e){for(let n of t){let i=ct(n,e);try{let l=B.statSync(i);if(l.size!==n.size)return!1;if(l.mtimeMs!==n.mtimeMs&&Bun.hash(B.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,vt=100;function Cf(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var H=new Map;async function jt(t){let e=H.get(t)??0;if(e>0&&e<vt){H.set(t,e+1);return}H.set(t,1);try{let n=(await B.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=Cf();if(n.length<=i)return;let d=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await B.promises.stat(p.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);d.sort((o,b)=>b.at-o.at);for(let o of d.slice(i)){let b=o.name.slice(0,-3);await B.promises.rm(p.join(t,`${b}.js`),{force:!0}),await B.promises.rm(p.join(t,`${b}.deps.json`),{force:!0})}A("pruned bundle cache to",i,"entries")}catch{}}function ye(t){return lt.get(t)??[]}function Z(t,e){if(t)lt.set(t,e)}function Ef(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function A(...t){if(Ef())console.log("[stx:bundler]",...t)}var K=[];function sc(t,e,n){K.push({filePath:t||"<inline>",message:e,details:n})}function tn(){return K.slice()}function nn(){K.length=0}var Q;function $h(t){Q=t}function oc(){if(Q)return Q;try{let t=O.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Y=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function rn(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let l=n[1];if(!Y.some((o)=>o.test(l)))return A("detected user import:",l),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let l=n[1];if(/\.css(?:\?.*)?$/.test(l))continue;if(!Y.some((o)=>o.test(l)))return A("detected side-effect import:",l),!0}return!1}var nr="stx-module:",Bt=/\.(?:[cm]?[jt]sx?|json)$/i;function Tf(t,e){return p.relative(t,e).split(p.sep).join("/")}function $f(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,l,d)=>{let o=e.get(d);return o&&!d.startsWith(nr)?`${i}${l}${o}${l}`:n})}function Rf(t,e){let n=0,i=(d)=>{let o=`__stxMod${n++}`,b=JSON.stringify(d);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},l=(d,o)=>{for(let b of d.split(",")){let I=b.trim();if(!I)continue;let M=I.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!M)continue;let S=M[1].startsWith('"')?JSON.parse(M[1]):M[1],f=M[2]??S;e.push(`var ${f} = ${o}[${JSON.stringify(S)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o,b)=>{let I=b.slice(nr.length),M=i(I),S=o.trim(),f=S.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!S.startsWith("{")&&!S.startsWith("*"))e.push(`var ${f[1]} = ${M}.default;`),S=S.slice(f[0].length).trim();let v=S.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${M};`);else if(S.startsWith("{"))l(S.replace(/^\{|\}$/g,""),M);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(d,o)=>(i(o.slice(nr.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,p.join(t,"index.ts"),p.join(t,"index.tsx"),p.join(t,"index.js"),p.join(t,"index.mjs")];for(let n of e)try{if(B.existsSync(n)&&B.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var G=new xt;function is(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,l]of[...t].sort(([d],[o])=>d<o?-1:d>o?1:0))n.update(`${i}\x00${l}\x00`);return G.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function sn(){return G.getStore()?.key??""}function ut(t,e,n,i,l,d,o=new Map,b,I,M){let S=new Map([[n,i],...M??[]]),f=(j)=>j!==void 0&&S.has(j),v=(j,r,u)=>{if(X(r,t,b))return null;if(!d||!f(j)||!Bt.test(r))return null;try{if(!B.statSync(r,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}l.add(r);let E=`${nr}${Tf(process.cwd(),r)}`;return o.set(u,E),{path:E,external:!0}},y=(j,r)=>{let u=f(j)?e:p.dirname(j),E=p.resolve(u,r);return it(E)??E};return{name:"stx-client-bundle",setup(j){if(j.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(r)=>({path:r.path,external:!0})),j.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(r)=>({path:r.path,external:!0})),j.onResolve({filter:/^\//},(r)=>{if(f(r.path))return{path:r.path};let u=it(r.path);if(u){let E=v(r.importer,u,r.path);if(E)return E;if(!f(u))l.add(u);return{path:u}}return{path:r.path,external:!0}}),j.onResolve({filter:/^\.\.?\//},(r)=>{let u=y(r.importer,r.path),E=v(r.importer,u,r.path);if(E)return E;return l.add(u),{path:u}}),j.onResolve({filter:/^[@~]\//},(r)=>{let u=p.resolve(t,r.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,p.join(u,"index.ts"),p.join(u,"index.tsx"),p.join(u,"index.js"),p.join(u,"index.mjs")];for(let h of E)if(B.existsSync(h)&&B.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(r.importer,h,r.path);if(D)return D;return A(`resolved ${r.path[0]}/ import:`,r.path,"\u2192",h),l.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${r.path[0]}/ import:`,r.path),{path:u}}),d)j.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(r)=>{if(!f(r.importer))return;let u=`${nr}npm:${r.path}`;return o.set(r.path,u),{path:u,external:!0}});j.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(r)=>{if(S.has(r.path))return{contents:S.get(r.path),loader:"ts"};if(X(r.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${r.path}`);let u=p.extname(r.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(r.path))l.add(r.path);let h=I?.get(r.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:B.readFileSync(r.path,"utf8"),loader:E}})}}}var q=new Map,P=w(64),ot=Symbol.for("stx.client-bundle-build-queue");function Af(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function on(t,e,n={}){let i=n.projectRoot||process.cwd(),l=(await a(i)).serverApi,d=n.minify??!1,o=n.externalizeUserModules??!0,b=n.expose?.length?[...new Set(n.expose)].sort():void 0,I=n.cacheDir||_f(i),M=G.getStore(),S=new Bun.CryptoHasher("md5");S.update(`${$t}\x00${rt()}\x00${JSON.stringify(l??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${d?"minified":"readable"}\x00${M?.key??""}\x00${nt(t,i)}\x00${nt(e,i)}`);let f=S.digest("hex").slice(0,12),v=p.join(I,`${f}.js`),y=P.get(v);if(y){if(js(y.files)&&y.files.every((h)=>!X(h.path,i,l))){A("memo hit:",f);let h=y.files.map((D)=>D.path);return Z(e,h),n.collectInputs?.push(...h),y.code}P.delete(v),A("memo invalidated by dep change:",f)}let j=p.join(I,`${f}.deps.json`),r=Bun.file(v);if(await r.exists()){let h=Bun.file(j),D=!1,k=null;if(await h.exists())try{let N=JSON.parse(await h.text());if(N.metadataVersion===at&&Array.isArray(N.files)&&St(N.files,i))k=vr(N.files.map((g)=>ct(g,i))),D=k.length===N.files.length&&!k.some((g)=>X(g.path,i,l))}catch{D=!1}if(D){if(A("cache hit:",f),k)Z(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let N=await r.text(),g=new Date;if(B.promises.utimes(v,g,g).catch(()=>{}),k)P.set(v,{code:N,files:k});return N}A("cache invalidated by dep change:",f)}let u=q.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(P.get(v)?.files??[]).map((D)=>D.path));return h}let E=Af(()=>Et(t,e,{projectRoot:i,minify:d,cacheDir:I,hash:f,cachePath:v,depsPath:j,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:l,expose:b,throwOnFailure:n.throwOnFailure,substitutes:M?.modules}));q.set(f,E);try{return await E}finally{q.delete(f)}}function ic(t){return`${t}-${process.pid}-${yt()}`}async function Rh(t,e){let{projectRoot:n}=e,i=ic(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),l=p.join(c(n,"bundle-tmp"),"out",i);B.mkdirSync(l,{recursive:!0});let d=new Map,o=new Map,b=0;for(let[f,v]of t){let y=p.join(n,`.stx-split-${i}-${b++}.ts`);d.set(y,v),o.set(p.basename(y).replace(/\.ts$/,""),f)}let[I,M]=[...d][0],S=new Set;try{let f=await Bun.build({entrypoints:[...d.keys()],outdir:l,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ut(n,p.dirname(e.filePath),I,M,S,!1,new Map,void 0,G.getStore()?.modules,d)],define:{"process.env.NODE_ENV":'"development"',...C()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let j=p.basename(y.path);if(y.kind==="entry-point"){let r=o.get(j.replace(/\.js$/,""));if(r!==void 0)v.entries.set(r,await y.text())}else if(y.kind==="chunk")v.chunks.set(j.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...S),v}finally{try{B.rmSync(l,{recursive:!0,force:!0})}catch{}}}async function Et(t,e,n){let{projectRoot:i,minify:l,cacheDir:d,hash:o,cachePath:b,depsPath:I,externalizeUserModules:M}=n,S=c(i,"bundle-tmp"),f=ic(o),v=p.join(i,`.stx-client-${f}.ts`),y=p.join(S,"out",f);B.mkdirSync(y,{recursive:!0});let j=p.dirname(e),r=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=s(t),{depths:D,balanced:k}=me(h),N=(R)=>!k||D[R]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;if(g[2])g[2].split(",").forEach((R)=>{let m=_t(R);if(m)r.add(m)});else if(g[3])r.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!N(g.index))continue;r.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!N(g.index))continue;let R=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(R&&Y.some((m)=>m.test(R)))continue;if(g[1])r.add(g[1]);if(g[2])r.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)r.add(L)}}for(let R of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of R[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)r.delete(_)}let pt=r.size>0?`
|
|
3
|
+
export { ${[...r].join(", ")} }`:"";A("bundling:",o,"from:",p.basename(e));let tt=new Set,et=new Map;try{let R=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:l?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ut(i,j,v,t+pt,tt,M,et,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":l?'"production"':'"development"',...C()},root:i});if(!R.success){let F=R.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${p.basename(e)}`,z=rr(R.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",F),sc(e||"",F,z),n.throwOnFailure||oc()==="error")throw Error(F);return t}let m="";for(let x of R.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let z=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(z){_.push([z[2],z[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))_.push([T,T])}if(n.expose){let x=new Set(n.expose);for(let F=_.length-1;F>=0;F--)if(!x.has(_[F][0]))_.splice(F,1)}let L=[];m=Rf($f(m,et),L);let dt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),l&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let J=`__stxBundle_${o}`,ft=new Set(V(t,!0).split(",").map((x)=>x.trim())),mt=_.map(([x,F])=>`get ${JSON.stringify(x)}() { return ${F} }${ft.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${F}) { ${F} = __stxValue_${F} }`:""}`).join(", "),gt=_.map(([x])=>`var ${x} = undefined;`).join(`
|
|
4
4
|
`),ht=_.map(([x])=>`${x} = ${J}[${JSON.stringify(x)}];`).join(`
|
|
5
5
|
`);if(m=`${dt.join(`
|
|
6
6
|
`)}
|
|
@@ -16,5 +16,5 @@ var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiv
|
|
|
16
16
|
Object.keys(${J}).forEach(function(name) {
|
|
17
17
|
if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
|
|
18
18
|
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${J}, name));
|
|
19
|
-
});`.trim(),A("bundled:",o,"output:",m.length,"bytes"),r.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${p.basename(e)} (${o}); serving the unbundled source and not caching this result`),t;B.mkdirSync(d,{recursive:!0}),await Bun.write(b,m);let W=vr(tt);return await Bun.write(I,JSON.stringify({metadataVersion:at,files:W.map((x)=>bt(x.path,i)).filter((x)=>x!==null)})),Z(e,W.map((x)=>x.path)),n.collectInputs?.push(...W.map((x)=>x.path)),P.set(b,{code:m,files:W}),await jt(d),m}catch(R){let m=rr(R,e||void 0),_=Re(R,e||void 0);if(console.warn(`[stx:bundler] error: ${_}`),
|
|
20
|
-
export{
|
|
19
|
+
});`.trim(),A("bundled:",o,"output:",m.length,"bytes"),r.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${p.basename(e)} (${o}); serving the unbundled source and not caching this result`),t;B.mkdirSync(d,{recursive:!0}),await Bun.write(b,m);let W=vr(tt);return await Bun.write(I,JSON.stringify({metadataVersion:at,files:W.map((x)=>bt(x.path,i)).filter((x)=>x!==null)})),Z(e,W.map((x)=>x.path)),n.collectInputs?.push(...W.map((x)=>x.path)),P.set(b,{code:m,files:W}),await jt(d),m}catch(R){let m=rr(R,e||void 0),_=Re(R,e||void 0);if(console.warn(`[stx:bundler] error: ${_}`),sc(e||"",_,m),n.throwOnFailure||oc()==="error")throw R;return t}finally{try{B.rmSync(y,{recursive:!0,force:!0})}catch{}}}function _t(t){let e=t.trim();if(!e)return null;let n=e.indexOf("=");if(n!==-1)e=e.slice(0,n).trim();let i=e.indexOf(":");if(i!==-1)e=e.slice(i+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
|
|
20
|
+
export{_f,Cf,ye,Ef,sc,tn,nn,$h,oc,rn,nr,Tf,$f,Rf,is,sn,Af,on,ic,Rh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{am}from"./chunk-rjenga8c.js";import"./chunk-hws9yb0b.js";import"./chunk-8qjf16yr.js";import"./chunk-v9jfxbwx.js";import"./chunk-3e1hmm3h.js";import"./chunk-japk9yf6.js";import"./chunk-sfww6v6m.js";import"./chunk-y49nzyxf.js";import"./chunk-4dxq7ft1.js";import"./chunk-5fspjf7x.js";import"./chunk-rm5pnhzx.js";import"./chunk-71fsg3az.js";import"./chunk-48vnw9t9.js";import"./chunk-txfz7gc3.js";import"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-e5seb8f7.js";import"./chunk-vhckqe4x.js";import"./chunk-46wqk1fb.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-rb6vr5v9.js";import"./chunk-kxj5sp5w.js";import"./chunk-gz45xsbg.js";import"./chunk-tpf8v2mb.js";import"./chunk-47n5s7wk.js";import"./chunk-r8xwd8r1.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{am as buildForProduction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{lh,vo,uh,dh,ph,fh}from"./chunk-cwwm14b3.js";import"./chunk-vyvjbydn.js";import"./chunk-3e1hmm3h.js";import"./chunk-4y6hes3h.js";import"./chunk-txfz7gc3.js";import"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-vhckqe4x.js";import"./chunk-46wqk1fb.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-rb6vr5v9.js";import"./chunk-kxj5sp5w.js";import"./chunk-gz45xsbg.js";import"./chunk-tpf8v2mb.js";import"./chunk-47n5s7wk.js";import"./chunk-r8xwd8r1.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{fh as clearStoreCache,lh as getStoreScript,ph as getStoreScriptFor,dh as pageStoresAll,vo as storesRead,uh as storesReadInFiles};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=
|
|
2
|
+
function o(t,i){let n=t[i],e=i+1;while(e<t.length){if(t[e]==="\\"){e+=2;continue}if(t[e]===n)return e+1;e++}return t.length}function b(t,i){let n=i+1;while(n<t.length){if(t[n]==="\\"){n+=2;continue}if(t[n]==="`")return n+1;if(t[n]==="$"&&t[n+1]==="{"){if(n=ol(t,n+2),n<t.length)n++;continue}n++}return t.length}function ol(t,i){let n=1,e=i,r="{",f="";while(e<t.length){let l=t[e];if(l==="\\"){e+=2;continue}if(l==='"'||l==="'"){e=o(t,e),r=h,f="";continue}if(l==="`"){e=b(t,e),r=h,f="";continue}if(l==="/"&&t[e+1]==="/"){while(e<t.length&&t[e]!==`
|
|
3
3
|
`)e++;continue}if(l==="/"&&t[e+1]==="*"){e+=2;while(e<t.length&&t.slice(e,e+2)!=="*/")e++;e+=2;continue}if(l==="/"&&a(r,f)){let u=w(t,e);if(u!==-1){e=u,r=h,f="";continue}}if(l==="{")n++;else if(l==="}"){if(n--,n===0)return e}if(/[\w$]/.test(l))f=/[\w$]/.test(r)?f+l:l,r=l;else if(!/\s/.test(l))r=l,f="";e++}return t.length}var m=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function a(t,i){if(i)return m.has(i);return!(t===")"||t==="]"||t===h)}var h="\x00";function w(t,i){let n=i+1,e=!1;while(n<t.length){let r=t[n];if(r===`
|
|
4
4
|
`)return-1;if(r==="\\"){n+=2;continue}if(r==="[")e=!0;else if(r==="]")e=!1;else if(r==="/"&&!e){n++;while(n<t.length&&/[a-z]/i.test(t[n]))n++;return n}n++}return-1}function s(t){let i="",n=0,e="",r="";while(n<t.length){let f=t.slice(n,n+2);if(f==="//"){while(n<t.length&&t[n]!==`
|
|
5
5
|
`)i+=" ",n++;continue}if(f==="/*"){while(n<t.length&&t.slice(n,n+2)!=="*/")i+=t[n]===`
|
|
6
6
|
`?`
|
|
7
7
|
`:" ",n++;i+=" ",n+=2;continue}let l=t[n];if(l==='"'||l==="'"){let u=l;i+=" ",n++;while(n<t.length&&t[n]!==u){if(t[n]==="\\"){i+=" ",n+=2;continue}i+=t[n]===`
|
|
8
8
|
`?`
|
|
9
|
-
`:" ",n++}i+=" ",n++,e=h,r="";continue}if(l==="/"&&a(e,r)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=
|
|
9
|
+
`:" ",n++}i+=" ",n++,e=h,r="";continue}if(l==="/"&&a(e,r)){let u=w(t,n);if(u!==-1){i+=`/${" ".repeat(u-n-2)}/`,n=u,e=h,r="";continue}}if(l==="`"){i+=" ",n++;while(n<t.length&&t[n]!=="`"){if(t[n]==="\\"){i+=" ",n+=2;continue}if(t[n]==="$"&&t[n+1]==="{"){let u=n+2,g=ol(t,u);if(i+=" ",i+=s(t.slice(u,g)),g<t.length)i+=" ";n=g+1;continue}i+=t[n]===`
|
|
10
10
|
`?`
|
|
11
11
|
`:" ",n++}i+=" ",n++,e=h,r="";continue}if(i+=l,n++,/[\w$]/.test(l))r=/[\w$]/.test(e)?r+l:l,e=l;else if(!/\s/.test(l))e=l,r=""}return i}function me(t){let i=new Uint16Array(t.length),n=0,e=!0;for(let r=0;r<t.length;r++){let f=t[r];if(f===")"||f==="]"||f==="}")if(n===0)e=!1;else n--;if(i[r]=n,f==="("||f==="["||f==="{")n++}return{depths:i,balanced:e&&n===0}}
|
|
12
|
-
export{
|
|
12
|
+
export{ol,s,me};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Yg}from"./chunk-0q3vkfqt.js";import"./chunk-japk9yf6.js";import"./chunk-sfww6v6m.js";import"./chunk-y49nzyxf.js";import"./chunk-4dxq7ft1.js";import"./chunk-5fspjf7x.js";import"./chunk-rm5pnhzx.js";import"./chunk-71fsg3az.js";import"./chunk-48vnw9t9.js";import"./chunk-txfz7gc3.js";import"./chunk-7cxbt404.js";import"./chunk-kbv5nwwd.js";import"./chunk-e5seb8f7.js";import"./chunk-vhckqe4x.js";import"./chunk-46wqk1fb.js";import"./chunk-9mtyxvhk.js";import"./chunk-ncrrxp60.js";import"./chunk-rb6vr5v9.js";import"./chunk-kxj5sp5w.js";import"./chunk-gz45xsbg.js";import"./chunk-tpf8v2mb.js";import"./chunk-47n5s7wk.js";import"./chunk-r8xwd8r1.js";import"./chunk-zjqvbcwa.js";import"./chunk-n91sm385.js";export{Yg as startInteractive};
|