@stacksjs/stx 0.2.673 → 0.2.675
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-pn1ehs6a.js → chunk-028e9fty.js} +2 -2
- package/dist/{chunk-wns8g6k9.js → chunk-03hhanvm.js} +9 -9
- package/dist/{chunk-prf164ct.js → chunk-078qg8r5.js} +2 -2
- package/dist/{chunk-120ze5ms.js → chunk-09gchq7d.js} +3 -3
- package/dist/chunk-0gk78x3r.js +2 -0
- package/dist/{chunk-xwhmh0w0.js → chunk-0thxpgtp.js} +2 -2
- package/dist/chunk-1b9thkg5.js +3 -0
- package/dist/chunk-1s2y6f4b.js +2 -0
- package/dist/chunk-1wdawkn8.js +2 -0
- package/dist/chunk-248a88mc.js +2 -0
- package/dist/{chunk-0f4csefs.js → chunk-29wj0c68.js} +5 -5
- package/dist/chunk-2nqtmp8c.js +2 -0
- package/dist/chunk-2pga7zzb.js +4 -0
- package/dist/chunk-2xv29pfj.js +11 -0
- package/dist/{chunk-md2jn67b.js → chunk-374nhgyf.js} +2 -2
- package/dist/chunk-3vwkyjan.js +421 -0
- package/dist/chunk-3wsm9g9c.js +2 -0
- package/dist/chunk-3xx9d934.js +2 -0
- package/dist/chunk-41q5rww8.js +2 -0
- package/dist/chunk-4c5tk71j.js +2 -0
- package/dist/chunk-4e5jrxbn.js +14 -0
- package/dist/{chunk-kgfgb971.js → chunk-4fhbh04h.js} +4 -4
- package/dist/chunk-4x5dk7a4.js +2 -0
- package/dist/{chunk-mxbc2ahy.js → chunk-54fazdmn.js} +5 -5
- package/dist/chunk-57ege36s.js +2 -0
- package/dist/{chunk-5xvan09w.js → chunk-5fh9m8fm.js} +2 -2
- package/dist/chunk-5n4c99y5.js +2 -0
- package/dist/{chunk-mmwedr93.js → chunk-5z0q3qv3.js} +5 -5
- package/dist/{chunk-ecqrkyg8.js → chunk-5z8mq37c.js} +4 -4
- package/dist/{chunk-bnn7pd62.js → chunk-5zvrbms2.js} +2 -2
- package/dist/{chunk-ce6zddpf.js → chunk-6beg47t4.js} +2 -2
- package/dist/chunk-6kam8r5y.js +2 -0
- package/dist/{chunk-h4dkvnhd.js → chunk-6ncvb8gp.js} +10 -10
- package/dist/{chunk-hmyb701s.js → chunk-6qh2mx6q.js} +38 -38
- package/dist/chunk-6rftdp7c.js +2 -0
- package/dist/{chunk-zqtbtqbq.js → chunk-6ycyaf5g.js} +2 -2
- package/dist/chunk-7475sm3m.js +2 -0
- package/dist/{chunk-aprhqxky.js → chunk-78x52gz3.js} +5 -5
- package/dist/{chunk-pxdww4rb.js → chunk-78yjmbbs.js} +2 -2
- package/dist/{chunk-b4pcw34n.js → chunk-7j7h1eg3.js} +1 -1
- package/dist/{chunk-vhs13kbf.js → chunk-7q699phs.js} +1 -1
- package/dist/chunk-7s6hypn5.js +2 -0
- package/dist/chunk-7ym269yp.js +2 -0
- package/dist/{chunk-rcsgt4wy.js → chunk-81rdyz2n.js} +1 -1
- package/dist/chunk-855h3crg.js +2 -0
- package/dist/chunk-8an7vcxx.js +2 -0
- package/dist/{chunk-m6q3f5rf.js → chunk-8jdbrcgt.js} +10 -10
- package/dist/{chunk-0qqvmfrw.js → chunk-8md2707p.js} +76 -76
- package/dist/chunk-8p92r2sc.js +2 -0
- package/dist/{chunk-yg267y85.js → chunk-8xxc5edr.js} +3 -3
- package/dist/{chunk-dq56166k.js → chunk-93z9f2be.js} +40 -40
- package/dist/{chunk-6ajahb2x.js → chunk-97h9ga3b.js} +3 -3
- package/dist/chunk-9859r1d5.js +2 -0
- package/dist/{chunk-jg5zt20a.js → chunk-9azagdq6.js} +75 -75
- package/dist/{chunk-1sr6c0nk.js → chunk-9wdd7eq6.js} +2 -2
- package/dist/{chunk-wbzmr6a4.js → chunk-9ybjsfyp.js} +2 -2
- package/dist/chunk-ammn4wbd.js +2 -0
- package/dist/chunk-arh1qgmp.js +2 -0
- package/dist/{chunk-7d4z944r.js → chunk-bh19ezq0.js} +7 -7
- package/dist/chunk-bpf3xxng.js +3 -0
- package/dist/chunk-c2rq9pap.js +2 -0
- package/dist/chunk-cfm6a679.js +2 -0
- package/dist/{chunk-fvtwec1r.js → chunk-cxgremn0.js} +5 -5
- package/dist/chunk-dasxbb9y.js +2 -0
- package/dist/{chunk-qmfycza5.js → chunk-db5017x8.js} +2 -2
- package/dist/{chunk-p472crv1.js → chunk-dba795e1.js} +1 -1
- package/dist/{chunk-a3d0g4mr.js → chunk-dera8fmc.js} +2 -2
- package/dist/chunk-e02ne8zd.js +2 -0
- package/dist/chunk-e492je6q.js +2 -0
- package/dist/{chunk-ka8befem.js → chunk-e4ezpevb.js} +2 -2
- package/dist/chunk-etbpzmxv.js +4 -0
- package/dist/{chunk-365vg0eg.js → chunk-f26n6y9p.js} +4 -4
- package/dist/chunk-fqa5ej45.js +2 -0
- package/dist/{chunk-xqp4hstk.js → chunk-fzc98qgn.js} +7 -7
- package/dist/chunk-g98gafg7.js +3 -0
- package/dist/chunk-gc4w2s5n.js +31 -0
- package/dist/{chunk-n38yb274.js → chunk-ggf4z3bv.js} +6 -6
- package/dist/chunk-ggwvnpwj.js +2 -0
- package/dist/chunk-gx6wxmbv.js +2 -0
- package/dist/chunk-hamk3dky.js +2 -0
- package/dist/{chunk-g8r0km7g.js → chunk-haz2ezyk.js} +2 -2
- package/dist/chunk-hfbkbrwk.js +130 -0
- package/dist/chunk-hg0dd64a.js +2 -0
- package/dist/chunk-hh58k0nh.js +3 -0
- package/dist/chunk-hz5eh77e.js +2 -0
- package/dist/chunk-hz8dj5jy.js +21 -0
- package/dist/{chunk-3y41efsf.js → chunk-j6x7ryyn.js} +14 -14
- package/dist/{chunk-wpmrz872.js → chunk-jv021x8e.js} +2 -2
- package/dist/{chunk-r3e6x87d.js → chunk-k06n5bjp.js} +3 -3
- package/dist/{chunk-30nes8ne.js → chunk-k72jqz6a.js} +3 -3
- package/dist/chunk-kqbpkg8n.js +2 -0
- package/dist/{chunk-2dp7hyv7.js → chunk-kzb04293.js} +19 -19
- package/dist/{chunk-qv6axke4.js → chunk-mabja59q.js} +2 -2
- package/dist/chunk-mf19qxgv.js +3 -0
- package/dist/{chunk-7met6yva.js → chunk-mn47s2ef.js} +5 -5
- package/dist/chunk-mvz825w0.js +33 -0
- package/dist/chunk-n615cbxq.js +2 -0
- package/dist/chunk-nv0jjhtd.js +2 -0
- package/dist/chunk-nvbyscdh.js +20 -0
- package/dist/chunk-nw44qq6h.js +24 -0
- package/dist/{chunk-chzgfna2.js → chunk-p6g58hwg.js} +2 -2
- package/dist/chunk-prc5dxp1.js +2 -0
- package/dist/{chunk-04kg16qs.js → chunk-q3gactm1.js} +4 -4
- package/dist/{chunk-tre98h62.js → chunk-q4rejyd2.js} +2 -2
- package/dist/chunk-q7tfqavs.js +42 -0
- package/dist/{chunk-jst1fbdm.js → chunk-qdkwg2b8.js} +2 -2
- package/dist/{chunk-yfvm7q6t.js → chunk-qr7a378v.js} +3 -3
- package/dist/chunk-qwdgx34g.js +2 -0
- package/dist/chunk-r6t1712p.js +2 -0
- package/dist/{chunk-hzv2qj0t.js → chunk-ram7pa4k.js} +6 -6
- package/dist/{chunk-hvzzhkhr.js → chunk-rza1p6e4.js} +2 -2
- package/dist/chunk-s5q9ztvj.js +2 -0
- package/dist/chunk-s8qe247r.js +2 -0
- package/dist/chunk-sfpymq5h.js +2 -0
- package/dist/chunk-shft9r9d.js +2 -0
- package/dist/{chunk-hvf2e7pr.js → chunk-sr3hmrah.js} +2 -2
- package/dist/chunk-sswy3tfc.js +2 -0
- package/dist/chunk-swxznm5v.js +2 -0
- package/dist/chunk-t8tst3sk.js +2 -0
- package/dist/chunk-t9bsgbwv.js +3 -0
- package/dist/chunk-tst8p27s.js +12 -0
- package/dist/chunk-tz09earb.js +2 -0
- package/dist/{chunk-t2pzy3x1.js → chunk-vd5w1jaz.js} +3 -3
- package/dist/chunk-vf6yaymh.js +2 -0
- package/dist/{chunk-9p6efb17.js → chunk-vg1pg6yt.js} +1 -1
- package/dist/chunk-w0vpvcj0.js +2 -0
- package/dist/{chunk-vqc4h16r.js → chunk-wav0xbnb.js} +2 -2
- package/dist/{chunk-rcadtv3x.js → chunk-wr1gm35v.js} +1 -1
- package/dist/{chunk-dgb4z4kw.js → chunk-wscnjtss.js} +2 -2
- package/dist/{chunk-ym41ybz2.js → chunk-wtvy9r5w.js} +6 -6
- package/dist/chunk-x4q4bx3q.js +3 -0
- package/dist/{chunk-nrvwejdw.js → chunk-x7wr720m.js} +5 -5
- package/dist/chunk-xayfz35c.js +2 -0
- package/dist/{chunk-7b3kr56x.js → chunk-xdn6rtq2.js} +3 -3
- package/dist/chunk-xh5mh8kn.js +2 -0
- package/dist/chunk-xna6b7km.js +2 -0
- package/dist/chunk-xrrx2ddz.js +2 -0
- package/dist/{chunk-ptcj11b4.js → chunk-xtnxvmdb.js} +13 -13
- package/dist/chunk-xw4rm5zj.js +2 -0
- package/dist/{chunk-fzqj1mjz.js → chunk-yaccg2c0.js} +7 -7
- package/dist/chunk-yar7fwrb.js +2 -0
- package/dist/{chunk-2zzc7006.js → chunk-yn9kvsk1.js} +2 -2
- package/dist/chunk-yt33wzqk.js +2 -0
- package/dist/{chunk-jxda11cg.js → chunk-z17sy8g3.js} +2 -2
- package/dist/chunk-z4bfgvb3.js +25 -0
- package/dist/chunk-z6mrnh98.js +2 -0
- package/dist/chunk-zq7xbc1k.js +2 -0
- package/dist/cli.js +23 -23
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/loops.js +12 -2
- package/dist/native/compiler/headwind-to-style.js +13 -1
- package/dist/native/compiler/html-to-ir.d.ts +2 -0
- package/dist/native/compiler/html-to-ir.js +9 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/compiler/render-screen.js +4 -3
- package/dist/native/compiler/style-config.d.ts +3 -0
- package/dist/native/compiler/style-config.js +5 -0
- package/dist/native/components/primitives.d.ts +2 -0
- package/dist/native/event-names.js +2 -0
- package/dist/native/prop-names.js +1 -0
- package/dist/native/runtime/craft-bridge.js +15 -8
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.d.ts +12 -0
- package/dist/signal-processing.js +76 -17
- package/dist/ssg-static-paths.d.ts +12 -0
- package/dist/ssg-static-paths.js +62 -0
- package/dist/ssg.d.ts +2 -4
- package/dist/ssg.js +43 -47
- package/dist/utils.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-028ee6q5.js +0 -2
- package/dist/chunk-02ymqwmj.js +0 -2
- package/dist/chunk-1fd7x7b8.js +0 -20
- package/dist/chunk-1pnp91wx.js +0 -2
- package/dist/chunk-1ptwdkvn.js +0 -4
- package/dist/chunk-1v60t3sb.js +0 -2
- package/dist/chunk-280p4q7a.js +0 -2
- package/dist/chunk-2f17h17f.js +0 -2
- package/dist/chunk-4c183zem.js +0 -2
- package/dist/chunk-4yt8tg4j.js +0 -2
- package/dist/chunk-52gp2xxk.js +0 -2
- package/dist/chunk-5zgrvj4b.js +0 -2
- package/dist/chunk-67kj14at.js +0 -2
- package/dist/chunk-6rzshbey.js +0 -2
- package/dist/chunk-6vzktvyw.js +0 -2
- package/dist/chunk-81q3sc0w.js +0 -2
- package/dist/chunk-864qtx7y.js +0 -2
- package/dist/chunk-89jbdtgw.js +0 -3
- package/dist/chunk-8d33aqs5.js +0 -2
- package/dist/chunk-8tdz8svp.js +0 -2
- package/dist/chunk-8yqfpkp4.js +0 -130
- package/dist/chunk-99bhc1h1.js +0 -42
- package/dist/chunk-9rrnyd5m.js +0 -2
- package/dist/chunk-9szxxgv5.js +0 -2
- package/dist/chunk-9tdnfztv.js +0 -21
- package/dist/chunk-agqcqf3q.js +0 -14
- package/dist/chunk-amkwmxs8.js +0 -2
- package/dist/chunk-b1hxtn08.js +0 -2
- package/dist/chunk-b4fd2dtk.js +0 -2
- package/dist/chunk-b4vk2m82.js +0 -2
- package/dist/chunk-b58tv8jc.js +0 -25
- package/dist/chunk-b6nzy1rg.js +0 -2
- package/dist/chunk-b823zxq6.js +0 -3
- package/dist/chunk-bdg0fydw.js +0 -2
- package/dist/chunk-dpvxe52r.js +0 -2
- package/dist/chunk-e1fetwbr.js +0 -2
- package/dist/chunk-e4vpr36s.js +0 -2
- package/dist/chunk-e6p0k6br.js +0 -2
- package/dist/chunk-f8agvh5v.js +0 -2
- package/dist/chunk-fbtv2k1p.js +0 -3
- package/dist/chunk-fcn71bq1.js +0 -2
- package/dist/chunk-g2jmwh7p.js +0 -2
- package/dist/chunk-g64z2e92.js +0 -2
- package/dist/chunk-gw7h5k3b.js +0 -2
- package/dist/chunk-hvtzw1jh.js +0 -2
- package/dist/chunk-j0v970k3.js +0 -2
- package/dist/chunk-jefe0rgt.js +0 -31
- package/dist/chunk-jk41jwsc.js +0 -2
- package/dist/chunk-jr9wfthg.js +0 -2
- package/dist/chunk-k2pa44rf.js +0 -2
- package/dist/chunk-kq9y6gfy.js +0 -2
- package/dist/chunk-md2qhahg.js +0 -2
- package/dist/chunk-npa7gze7.js +0 -4
- package/dist/chunk-p38m3947.js +0 -2
- package/dist/chunk-qcjh3pp8.js +0 -2
- package/dist/chunk-qjtpxsyx.js +0 -12
- package/dist/chunk-qw441qys.js +0 -2
- package/dist/chunk-qxmyaajq.js +0 -2
- package/dist/chunk-qyjsne99.js +0 -2
- package/dist/chunk-rermy54w.js +0 -2
- package/dist/chunk-rwjf25ht.js +0 -2
- package/dist/chunk-rx0ep3v1.js +0 -2
- package/dist/chunk-sf0wsq74.js +0 -2
- package/dist/chunk-sfc2v7rt.js +0 -33
- package/dist/chunk-shpc1ttk.js +0 -2
- package/dist/chunk-sy0z64yz.js +0 -2
- package/dist/chunk-t0zh1dn9.js +0 -421
- package/dist/chunk-ta7bmfvg.js +0 -3
- package/dist/chunk-weqc0ssb.js +0 -2
- package/dist/chunk-wq712sw1.js +0 -2
- package/dist/chunk-xaa36b0x.js +0 -3
- package/dist/chunk-xr69d4tk.js +0 -2
- package/dist/chunk-xz6dw6yw.js +0 -2
- package/dist/chunk-y8kdy3d2.js +0 -2
- package/dist/chunk-ynz7bzc6.js +0 -24
- package/dist/chunk-yscr04dv.js +0 -2
- package/dist/chunk-z8p6tk5z.js +0 -2
- package/dist/chunk-zhf01af3.js +0 -3
- package/dist/chunk-zvygkwyf.js +0 -11
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{El,Hr}from"./chunk-q7tfqavs.js";import"./chunk-e4ezpevb.js";import"./chunk-dba795e1.js";import{ur}from"./chunk-3vwkyjan.js";import"./chunk-0thxpgtp.js";import"./chunk-9wdd7eq6.js";import{tt}from"./chunk-kzb04293.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{tt as freeIdentifiers,Hr as processComponents,El as processESImports,ur as rendersAsElement};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{N,Il,mo,i,R,_p,Cp}from"./chunk-6qh2mx6q.js";import"./chunk-8xxc5edr.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-yaccg2c0.js";import"./chunk-f26n6y9p.js";import"./chunk-3vwkyjan.js";import"./chunk-0thxpgtp.js";import"./chunk-9wdd7eq6.js";import"./chunk-kzb04293.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{R as config,N as defaultConfig,_p as defineStxConfig,mo as discoverConfig,i as loadStxConfig,Il as resolveStxDirectories,Cp as validateConfig};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{nr}from"./chunk-f26n6y9p.js";import{gr}from"./chunk-kzb04293.js";import{i}from"./chunk-6qh2mx6q.js";import{q,Ke}from"./chunk-5zvrbms2.js";import{da}from"./chunk-haz2ezyk.js";var p=/<style\b[^>]*>/iy,x=/<\/style>/gi,R=/<script\b[^>]*>/iy,b=/<template(?=[\s>/])[^>]*>/iy,S=/<\/template\s*>/iy;function Jn(e){let r=0,t=0,o=-1;while(r<e.length){let n=e.indexOf("<",r);if(n===-1)return-1;if(e.startsWith("<!--",n)){let d=e.indexOf("-->",n+4);r=d===-1?e.length:d+3;continue}p.lastIndex=n;let u=p.exec(e);if(u){x.lastIndex=n+u[0].length;let d=x.exec(e);r=d===null?e.length:d.index+8;continue}b.lastIndex=n;let c=b.exec(e);if(c){if(t===0)o=n;t++,r=n+c[0].length;continue}S.lastIndex=n;let a=S.exec(e);if(a){if(t>0)t--;r=n+a[0].length;continue}if(R.lastIndex=n,R.test(e))return t>0?o:n;r=n+1}return-1}function W(e,r={}){return new nr(e,r).routes}import w from"path";var T=new Map;async function y(e,r){let t=e,o=r;if(!t||!o)try{let a=await i();t||=a?.pagesDir||"pages",o||=a?.root||"."}catch{t||="pages",o||="."}let n=w.isAbsolute(t)?t:w.join(o,t),u=T.get(n);if(u)return u;let c=[];try{c=W(".",{pagesDir:n,emit:!1}).map((a)=>a.regex.source).filter(Boolean)}catch{c=[]}return T.set(n,c),c}function O(e){return e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function l(e){return O(JSON.stringify(e))}function he(e){return e.includes("data-stx-runtime")}function la(e){let r=/window\.stx\s*\.\s*[A-Za-z_$]|\}\s*=\s*window\.stx\s*;/g;for(let t=r.exec(e);t!==null;t=r.exec(e)){let o=e.slice(Math.max(0,t.index-80),t.index);if(/if\s*\(\s*window\.stx\s*\)|window\.stx\s*&&/.test(o))continue;return!0}return!1}function f(e,r){let t=Jn(e),o=e.search(/<!doctype\b/i);if(t!==-1&&(o===-1||t>o))return e.slice(0,t)+r+`
|
|
3
|
+
`+e.slice(t);let n=gr(e);if(n!==null)return`${e.slice(0,n)}
|
|
4
|
+
${r}${e.slice(n)}`;if(e.includes("</head>")){let c=e.indexOf("</head>");return e.slice(0,c)+r+`
|
|
5
|
+
`+e.slice(c)}if(q(e))return Ke(e,(c)=>`${c}
|
|
6
|
+
${r}`);return`${r}
|
|
7
|
+
${e}`}async function Yn(e,r){if(e.includes("data-stx-runtime")||e.includes("window.stx.state")||e.includes("STX Signals Runtime"))return e;if(r.buildMode==="serve"){let{getServeClientAsset:n}=await import("./chunk-w0vpvcj0.js"),{url:u}=await n("runtime",r.debug===!0);return f(e,`<script data-stx-runtime src="${u}"></script>`)}if(r.buildMode==="compile")return f(e,'<script data-stx-runtime src="/__stx/runtime.__STX_HASH__.js"></script>');let{getCachedSignalsRuntime:t}=await import("./chunk-w0vpvcj0.js"),o=await t(r.debug);return f(e,`<script data-stx-scoped data-stx-runtime>${o}</script>`)}function m(e){return/<[a-z][^>]*?\sx-tooltip\s*=/i.test(e)}function ua(e){if(e.includes("data-stx-tooltip-runtime")||!m(e))return e;let r=`<script data-stx-scoped data-stx-tooltip-runtime>${da()}</script>`,t=e.lastIndexOf("</body>");if(t===-1)return`${e}
|
|
8
|
+
${r}`;return`${e.slice(0,t)}${r}
|
|
9
|
+
${e.slice(t)}`}var E=/<script\b[^>]*\sdata-stx-router(?=[\s=>])/i;function C(e){return E.test(e)||e.includes("__stxRouter)return")||e.includes("__stxRouter=true")}async function ye(e,r){if(!e.includes("</body>"))return e;if(C(e))return e;let t=r?.router,o="",n="";{let s={};if(t){if(t.container)s.container=t.container;if(t.interceptAllLinks!==void 0)s.interceptAllLinks=t.interceptAllLinks;if(t.progress!==void 0)s.progress=t.progress;if(t.viewTransitions!==void 0)s.viewTransitions=t.viewTransitions;if(t.viewTransitionDuration!==void 0)s.viewTransitionDuration=t.viewTransitionDuration;if(t.viewTransitionEasing!==void 0)s.viewTransitionEasing=t.viewTransitionEasing;if(t.scrollToTop!==void 0)s.scrollToTop=t.scrollToTop;if(t.scrollRestoration!==void 0)s.scrollRestoration=t.scrollRestoration;if(t.prefetch!==void 0)s.prefetch=t.prefetch;if(t.cache!==void 0)s.cache=t.cache;if(t.progressColor!==void 0)s.progressColor=t.progressColor;if(t.progressHeight!==void 0)s.progressHeight=t.progressHeight;if(t.prefetchVisible!==void 0)s.prefetchVisible=t.prefetchVisible;if(t.prefetchVisibleMax!==void 0)s.prefetchVisibleMax=t.prefetchVisibleMax;if(t.keepOpening!==void 0)s.keepOpening=t.keepOpening}try{let g=await y(r?.pagesDir,r?.root);if(g.length>0)if(r?.buildMode==="serve"){let{registerServeModuleBundle:h}=await import("./chunk-w0vpvcj0.js");n=`<script data-stx-owned-routes src="${h(`(window.__stxRouterConfig=window.__stxRouterConfig||{}).ownedRoutes=${l(g)};
|
|
10
|
+
`)}"></script>
|
|
11
|
+
`}else s.ownedRoutes=g}catch{}if(Object.keys(s).length>0)o=`<script>window.__stxRouterConfig=${l(s)};</script>
|
|
12
|
+
`}let{getCachedRouterScript:u,getServeClientAsset:c}=await import("./chunk-w0vpvcj0.js"),a=r?.buildMode==="compile"?'<script data-stx-router src="/__stx/router.__STX_HASH__.js"></script>':r?.buildMode==="serve"?`<script data-stx-router src="${(await c("router")).url}"></script>`:`<script data-stx-router>${await u()}</script>`,d=e.lastIndexOf("</body>");return e.slice(0,d)+o+n+a+`
|
|
13
|
+
</body>`+e.slice(d+7)}
|
|
14
|
+
export{Jn,W,he,la,Yn,ua,ye};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function
|
|
2
|
+
var g=0;function p(){return`async-${++g}-${Date.now().toString(36)}`}function Ad(e,t={},c){let o=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@error\s*([\s\S]*?)@endasync/gi,i=/@async\s*\(([^)]*)\)\s*([\s\S]*?)@endasync/gi,n=e;return n=n.replace(o,(r,s,a,d)=>{let l=p(),y=u(s);return m(l,y,a.trim(),d.trim())}),n=n.replace(i,(r,s,a)=>{let d=p(),l=u(s);return m(d,l,a.trim(),'<div class="stx-async-error">Failed to load component</div>')}),n}function u(e){let t={component:"",timeout:30000,delay:200,suspensible:!0,retries:0},c=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,o;while((o=c.exec(e))!==null){let i=o[1],n=o[2]||o[3],r=o[4],s=o[5];switch(i){case"component":t.component=n||s||"";break;case"timeout":t.timeout=r?parseInt(r,10):30000;break;case"delay":t.delay=r?parseInt(r,10):200;break;case"suspensible":t.suspensible=s==="true";break;case"retries":t.retries=r?parseInt(r,10):0;break;case"loadingComponent":t.loadingComponent=n||s;break;case"errorComponent":t.errorComponent=n||s;break}}return t}function m(e,t,c,o){let{component:i,timeout:n,delay:r,suspensible:s,retries:a}=t;return`
|
|
3
3
|
<div class="stx-async-component" data-async-id="${e}" data-component="${i}" data-status="pending">
|
|
4
4
|
<div class="stx-async-loading" data-async-loading="${e}">
|
|
5
5
|
${c}
|
|
@@ -226,7 +226,7 @@ catch (error) {
|
|
|
226
226
|
loadComponent();
|
|
227
227
|
})();
|
|
228
228
|
</script>
|
|
229
|
-
`}function
|
|
229
|
+
`}function Pd(e){return{__asyncComponent:!0,...typeof e==="function"?{loader:e}:e}}function Id(e){return typeof e==="object"&&e!==null&&"__asyncComponent"in e&&e.__asyncComponent===!0}function Od(){return`
|
|
230
230
|
/* STX Async Component Styles */
|
|
231
231
|
.stx-async-component {
|
|
232
232
|
position: relative;
|
|
@@ -300,7 +300,7 @@ catch (error) {
|
|
|
300
300
|
background-size: 200% 100%;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
`}function
|
|
303
|
+
`}function Nd(){return`
|
|
304
304
|
// STX Async Component Runtime
|
|
305
305
|
(function() {
|
|
306
306
|
if (typeof window === 'undefined') return;
|
|
@@ -355,4 +355,4 @@ catch (error) {
|
|
|
355
355
|
console.log('[stx] Async component runtime initialized');
|
|
356
356
|
})();
|
|
357
357
|
`}
|
|
358
|
-
export{
|
|
358
|
+
export{Ad,Pd,Id,Od,Nd};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{be,vs,iu,Op,au,Np,Ot,d,H,J,mn,we,cu,Fo,lu,Dp,k,uu,Mp,_,Lp}from"./chunk-3vwkyjan.js";import"./chunk-0thxpgtp.js";import"./chunk-9wdd7eq6.js";import"./chunk-kzb04293.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{uu as applyFilters,Np as clearCustomFilters,cu as clientLoopScopes,vs as defaultFilters,mn as escapeAttributeValue,d as escapeHtml,H as escapeHtmlValue,J as escapeInterpolatedHtmlValue,_ as evaluateExpression,be as findMustacheEnd,au as getAllFilters,lu as interpolateScriptAttributes,Fo as interpolateScriptExpressions,Dp as interpolateScriptsInTemplate,k as processExpressions,iu as registerFilter,Op as registerFilters,Ot as replaceInterpolations,Mp as resetRejectedExpressionWarnings,Lp as unescapeHtml,we as usesSignalsInScript};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function
|
|
4
|
-
`)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),a),f.push({...t,filePath:n})}return f}function j(s,l){let o=s.map((i)=>({route:i,...
|
|
5
|
-
`));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function
|
|
6
|
-
export{
|
|
2
|
+
import{le}from"./chunk-f26n6y9p.js";import{Be,A}from"./chunk-9wdd7eq6.js";import{wa}from"./chunk-q3gactm1.js";import{c}from"./chunk-mf19qxgv.js";import S from"fs";import m from"path";import{pathToFileURL as O}from"url";var E=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],P=new Set;function en(s,l={}){let o=m.resolve(s,l.dir??"server/api"),i=[],f=new Map;if(!S.existsSync(o))return i;let t=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:o})).sort();for(let e of t){if(e.endsWith(".d.ts"))continue;let p=e.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),n=p.pop(),u=n.lastIndexOf("."),d=u>=0?n.slice(u+1):"get",g=d.toUpperCase();if(!E.includes(g)||d!==d.toLowerCase())throw Error(`Unsupported API method suffix in ${e}; use ${E.map((y)=>y.toLowerCase()).join(", ")}`);if(u>=0)n=n.slice(0,u);if(n!=="index")p.push(n);let r=new Set,h=p.map((y,I)=>{let v=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(y);if(v){if(r.has(v[2])||v[1]&&I!==p.length-1)throw Error(`Invalid API parameter in ${e}`);return r.add(v[2]),`:${v[2]}${v[1]?"*":""}`}if(!/^[\w-]+$/.test(y))throw Error(`Unsupported API path segment ${y} in ${e}`);return y}),w=`/api${h.length?`/${h.join("/")}`:""}`,x=`${g} ${w.replace(/:\w+/g,":param")}`;if(f.has(x))throw Error(`Ambiguous API route ${g} ${w}: ${f.get(x)} and ${e}`);f.set(x,e);let R=m.join(o,e);P.add(m.resolve(R)),P.add(S.realpathSync(R)),i.push({pattern:w,method:g,filePath:R})}return i.sort((e,a)=>{let p=e.pattern.split("/"),n=a.pattern.split("/"),u=(d)=>d?.endsWith("*")?0:d?.startsWith(":")?1:2;for(let d=0;d<Math.max(p.length,n.length);d++){let g=u(n[d])-u(p[d]);if(g)return g}return e.pattern.localeCompare(a.pattern)||e.method.localeCompare(a.method)})}async function Js(s,l){let o=c(s,"api-types.d.ts"),i=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let t of l){let e=`./${m.relative(m.dirname(o),t.filePath).replace(/\\/g,"/")}`,{params:a}=le(t.pattern);i.push(` ${JSON.stringify(`${t.method} ${t.pattern}`)}: { params: { ${a.map((p)=>`${JSON.stringify(p)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(e)}).default>> }`)}i.push(" }","}","export {}","");let f=i.join(`
|
|
3
|
+
`);if(!await Bun.file(o).exists()||await Bun.file(o).text()!==f)await Bun.write(o,f);return o}async function Ys(s,l,o={}){let i=en(s,o);await Js(s,i);let f=[];for(let t of i){let e=await Bun.build({entrypoints:[t.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!e.success)throw Error(`API build failed for ${t.filePath}: ${e.logs.join(`
|
|
4
|
+
`)}`);let a=e.outputs.find((u)=>u.kind==="entry-point");if(!a)throw Error(`No API bundle for ${t.filePath}`);if(e.outputs.length!==1)throw Error(`API endpoint ${t.filePath} emits assets; package those explicitly instead`);let n=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await a.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write(m.join(l,n),a),f.push({...t,filePath:n})}return f}function j(s,l){let o=s.map((i)=>({route:i,...le(i.pattern)}));return async(i)=>{let f=new URL(i.url).pathname,t=o.filter((r)=>r.regex.test(f));if(!t.length)return null;let e=t[0].route.pattern,a=(r)=>r.replace(/:\w+/g,":param"),p=t.filter((r)=>a(r.route.pattern)===a(e)),n=i.method,u=p.find((r)=>r.route.method===n)??(n==="HEAD"?p.find((r)=>r.route.method==="GET"):void 0);if(!u){let r=new Set(p.map((h)=>h.route.method));if(r.has("GET"))r.add("HEAD");return r.add("OPTIONS"),new Response(null,{status:n==="OPTIONS"?204:405,headers:{Allow:Array.from(r).sort().join(", ")}})}let d=u.regex.exec(f),g=Object.create(null);try{u.params.forEach((r,h)=>{g[r]=decodeURIComponent(d[h+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let r=await l(u.route);if(typeof r!=="function")throw Error(`API endpoint ${u.route.filePath} must default-export a handler`);let h=await r(i,{params:g}),w=h instanceof Response?h:h===void 0?new Response(null,{status:204}):Response.json(h);if(n==="HEAD")return new Response(null,{status:w.status,headers:w.headers});return w}catch(r){return console.error(`[stx] API error for ${n} ${e}:`,r),Response.json({error:"Internal Server Error"},{status:500})}}}function Zs(s,l){return j(l,async(o)=>(await import(O(m.resolve(s,o.filePath)).href)).default)}async function ap(s,l){if(!l)return async()=>null;let o=l===!0?{}:l,i=en(s,o);return await Js(s,i),async(f)=>{if(!new URL(f.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let t=en(s,o);await Js(s,t);let{loadStxConfig:e}=await import("./chunk-4c5tk71j.js"),a=A((await e(s)).runtimeConfig);return await Be(a,()=>j(t,async(p)=>{let n=await Bun.build({entrypoints:[p.filePath],target:"bun",format:"esm",splitting:!1});if(!n.success)throw Error(n.logs.join(`
|
|
5
|
+
`));let u=n.outputs.find((d)=>d.kind==="entry-point");if(!u||n.outputs.length!==1)throw Error(`Unsupported API bundle output: ${p.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await u.text()).toString("base64")}`)).default})(f))}catch(t){return console.error("[stx] API discovery failed:",t),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function Qs(s,l,o){if(wa(s))return!0;let i=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(i.test(m.basename(s)))return!0;try{if(i.test(m.basename(S.realpathSync(s))))return!0}catch{}if(P.has(m.resolve(s)))return!0;if(!o)return!1;let f=m.resolve(l,typeof o==="object"?o.dir??"server/api":"server/api"),t=(a)=>{try{return S.realpathSync(a)}catch{return m.resolve(a)}},e=t(s);return[f,m.resolve(l,"server"),m.resolve(l,".output/server")].some((a)=>{let p=t(a);return e===p||e.startsWith(`${p}${m.sep}`)})}
|
|
6
|
+
export{en,Js,Ys,Zs,ap,Qs};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Au}from"./chunk-nw44qq6h.js";import"./chunk-9azagdq6.js";import"./chunk-6ncvb8gp.js";import"./chunk-078qg8r5.js";import"./chunk-z4bfgvb3.js";import"./chunk-8jdbrcgt.js";import"./chunk-q7tfqavs.js";import"./chunk-e4ezpevb.js";import"./chunk-hz8dj5jy.js";import"./chunk-4e5jrxbn.js";import"./chunk-dba795e1.js";import"./chunk-qdkwg2b8.js";import"./chunk-6qh2mx6q.js";import"./chunk-8xxc5edr.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-yaccg2c0.js";import"./chunk-f26n6y9p.js";import"./chunk-3vwkyjan.js";import"./chunk-0thxpgtp.js";import"./chunk-9wdd7eq6.js";import"./chunk-kzb04293.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{Au as startInteractive};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{
|
|
2
|
+
import{i}from"./chunk-6qh2mx6q.js";import{Vs}from"./chunk-wav0xbnb.js";import p from"path";async function Yu(t={}){let d=performance.now(),o=t.root||process.cwd(),e=await i(o),u=t.ssr?.routeRules??e.routeRules??{};if(Vs(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:s}=await import("./ssg.js");n=await s({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:s}=await import("./chunk-7ym269yp.js");l=await s({root:o,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
|
|
3
|
+
export{Yu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Pu}from"./chunk-db5017x8.js";import"./chunk-gc4w2s5n.js";import"./chunk-t9bsgbwv.js";import"./chunk-54fazdmn.js";import"./chunk-4e5jrxbn.js";import"./chunk-6qh2mx6q.js";import"./chunk-8xxc5edr.js";import"./chunk-dera8fmc.js";import"./chunk-q3gactm1.js";import"./chunk-yaccg2c0.js";import"./chunk-f26n6y9p.js";import"./chunk-3vwkyjan.js";import"./chunk-0thxpgtp.js";import"./chunk-9wdd7eq6.js";import"./chunk-kzb04293.js";import"./chunk-6beg47t4.js";import"./chunk-78yjmbbs.js";export{Pu as startProductionServer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function
|
|
2
|
+
function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:t.enterActiveClass||`${e}-enter-active`,enterTo:t.enterToClass||`${e}-enter-to`,leaveFrom:t.leaveClass||`${e}-leave-from`,leaveActive:t.leaveActiveClass||`${e}-leave-active`,leaveTo:t.leaveToClass||`${e}-leave-to`}}function u(e){let t=getComputedStyle(e),o=t.transitionDuration||"0s",n=t.animationDuration||"0s",s=(a)=>{let i=a.match(/^([\d.]+)(s|ms)?$/);if(!i)return 0;let r=parseFloat(i[1]);return(i[2]||"s")==="ms"?r:r*1000};return Math.max(s(o),s(n))}function v(e,t){return new Promise((o)=>{let n=t??u(e);if(n===0){o();return}let s=!1,a=()=>{if(s)return;s=!0,e.removeEventListener("transitionend",i),e.removeEventListener("animationend",i),o()},i=(r)=>{if(r.target===e)a()};e.addEventListener("transitionend",i),e.addEventListener("animationend",i),setTimeout(a,n+50)})}function f(e){e.offsetHeight}async function vd(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.enter:t.duration;if(t.onBeforeEnter?.(e),e.classList.add(n.enterFrom),e.classList.add(n.enterActive),f(e),e.classList.remove(n.enterFrom),e.classList.add(n.enterTo),t.onEnter)await new Promise((a)=>{t.onEnter(e,a)});else await v(e,s);e.classList.remove(n.enterActive),e.classList.remove(n.enterTo),t.onAfterEnter?.(e)}async function wd(e,t={}){let o=t.name||"stx",n=m(o,t),s=typeof t.duration==="object"?t.duration.leave:t.duration;if(t.onBeforeLeave?.(e),e.classList.add(n.leaveFrom),e.classList.add(n.leaveActive),f(e),e.classList.remove(n.leaveFrom),e.classList.add(n.leaveTo),t.onLeave)await new Promise((a)=>{t.onLeave(e,a)});else await v(e,s);e.classList.remove(n.leaveActive),e.classList.remove(n.leaveTo),t.onAfterLeave?.(e)}function xd(e,t={},o){let n=/@transition\s*\(([^)]*)\)([\s\S]*?)@endtransition/gi;return e.replace(n,(s,a,i)=>{let r=p(a),l=r.name||"stx",c=r.duration||300,d=`stx-transition-${Math.random().toString(36).slice(2,9)}`;return`
|
|
3
3
|
<div
|
|
4
4
|
class="stx-transition-wrapper"
|
|
5
5
|
data-transition="${l}"
|
|
@@ -41,7 +41,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
|
|
|
41
41
|
});
|
|
42
42
|
})();
|
|
43
43
|
</script>
|
|
44
|
-
`})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function
|
|
44
|
+
`})}function p(e){let t={},o=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,n;while((n=o.exec(e))!==null){let s=n[1],a=n[2]||n[3]||n[4]||n[5];switch(s){case"name":t.name=a;break;case"duration":t.duration=parseInt(a,10);break;case"mode":t.mode=a;break;case"easing":t.easing=a;break}}return t}function Sd(){return`
|
|
45
45
|
/* STX Transition Presets */
|
|
46
46
|
|
|
47
47
|
/* Fade */
|
|
@@ -228,7 +228,7 @@ function m(e,t={}){return{enterFrom:t.enterClass||`${e}-enter-from`,enterActive:
|
|
|
228
228
|
opacity: 1;
|
|
229
229
|
max-height: 1000px;
|
|
230
230
|
}
|
|
231
|
-
`}function
|
|
231
|
+
`}function kd(){return`
|
|
232
232
|
// STX Transition Runtime
|
|
233
233
|
(function() {
|
|
234
234
|
if (typeof window === 'undefined') return;
|
|
@@ -317,5 +317,5 @@ else {
|
|
|
317
317
|
|
|
318
318
|
console.log('[stx] Transition runtime initialized');
|
|
319
319
|
})();
|
|
320
|
-
`}function
|
|
321
|
-
export{
|
|
320
|
+
`}function _d(e){let t=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return e.replace(t,(o,n,s,a)=>{let i=s||"300",r=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${n}" data-stx-transition-duration="${i}" data-stx-transition-condition="${a}" data-stx-transition-id="${r}"`})}
|
|
321
|
+
export{vd,wd,xd,Sd,kd,_d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{He,Sn,Qo}from"./chunk-k72jqz6a.js";function Rs(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?He(a,e):null,h=u?Sn(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
|
|
3
3
|
* Service Worker - Auto-generated by stx
|
|
4
4
|
* Cache Version: ${i}
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@ import{ze,wn,Jo}from"./chunk-30nes8ne.js";function Es(e,a){let t=e.pwa;if(!t?.en
|
|
|
13
13
|
* Additional features:
|
|
14
14
|
* - Push notifications: ${r?.enabled?"enabled":"disabled"}
|
|
15
15
|
* - Background sync: ${s?.enabled?"enabled":"disabled"}
|
|
16
|
-
* - Cache limits: ${n?.maxSize?`${
|
|
16
|
+
* - Cache limits: ${n?.maxSize?`${Qo(n.maxSize*1024*1024)}`:"unlimited"}
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
const CACHE_VERSION = '${i}';
|
|
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
|
|
|
825
825
|
event.waitUntil(registerFormSync(event.data.payload));
|
|
826
826
|
}
|
|
827
827
|
});
|
|
828
|
-
`}function
|
|
829
|
-
export{
|
|
828
|
+
`}function Bt(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function xc(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function yu(e,a){if(!e.pwa?.enabled)return"";if(xc(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-sr3hmrah.js");return t(e,a)}return Rs(e,a)}
|
|
829
|
+
export{Rs,Bt,xc,yu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function
|
|
3
|
-
export{
|
|
2
|
+
var d=[{open:/<!--/g,close:/-->/g},{open:/<script\b/gi,close:/<\/script\s*>/gi},{open:/<style\b/gi,close:/<\/style\s*>/gi}],u=/<body\b([^>]*)>/gi;function q(n){let i=0,e,c=d.map(()=>{return});while(i<n.length){if(e===void 0||e!==null&&e.index<i)u.lastIndex=i,e=u.exec(n);if(!e)return null;let a=e.index,r=-1,o=null;for(let l=0;l<d.length;l++){let g=d[l],t=c[l];if(t===void 0||t!==null&&t.index<i)g.open.lastIndex=i,t=g.open.exec(n),c[l]=t;if(!t)continue;if(t.index<a&&(r===-1||t.index<r))r=t.index,o=g.close}if(r===-1||!o)return{index:a,tag:e[0],attrs:e[1]??""};o.lastIndex=r;let s=o.exec(n);if(!s)return null;i=s.index+s[0].length}return null}function Ke(n,i){let e=q(n);if(!e)return n;return n.slice(0,e.index)+i(e.tag,e.attrs)+n.slice(e.index+e.tag.length)}
|
|
3
|
+
export{q,Ke};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function T(s){let o=/import\s*\{([^}]+)\}\s*from\s*['"](@stores|stx\/stores)['"]\s*;?\n?/g;s=s.replace(o,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__STX_STORES__
|
|
3
3
|
`);let n=/import\s*\{([^}]+)\}\s*from\s*['"]@composables['"]\s*;?\n?/g;return s=s.replace(n,(e,t)=>`const { ${t.split(",").map((r)=>r.trim()).filter(Boolean).join(", ")} } = window.__composables
|
|
4
|
-
`),s}function
|
|
5
|
-
export{T,
|
|
4
|
+
`),s}function xn(s){return s.replace(/^import\s+[^'"]*?from\s*['"][^'"]+['"]\s*;?[ \t]*$/gm,"").replace(/^import\s+['"][^'"]+['"]\s*;?[ \t]*$/gm,"")}
|
|
5
|
+
export{T,xn};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`)}var
|
|
4
|
-
`)}var
|
|
2
|
+
import{b,w,Io,ln}from"./chunk-3vwkyjan.js";import{go}from"./chunk-qdkwg2b8.js";import{c}from"./chunk-mf19qxgv.js";import M from"fs";import d from"path";import{hasLocalConfig as le}from"bunfig";var mt={fg:{light:"neutral-900",dark:"neutral-100",description:"Primary text"},"fg-strong":{light:"neutral-700",dark:"neutral-300",description:"Labels, secondary headings"},"fg-muted":{light:"neutral-600",dark:"neutral-400",description:"Supporting text"},"fg-soft":{light:"neutral-500",dark:"neutral-400",description:"De-emphasised text"},"fg-subtle":{light:"neutral-400",dark:"neutral-500",description:"Recessive, non-essential text"},surface:{light:"neutral-50",dark:"neutral-800",description:"Page and panel background"},"surface-raised":{light:"neutral-100",dark:"neutral-700",description:"Cards, popovers"},"surface-sunken":{light:"neutral-200",dark:"neutral-700",description:"Wells, track backgrounds"},panel:{light:"white",dark:"neutral-800",description:"Card, menu, dialog surface"},field:{light:"white",dark:"neutral-700",description:"Form control surface"},page:{light:"neutral-50",dark:"neutral-900",description:"Page background, behind panels"},content:{light:"white",dark:"neutral-900",description:"Content area under a chrome header - a table or list body"},"surface-hover":{light:"neutral-100",dark:"neutral-700",description:"Row or item highlight on a page or panel"},"surface-raised-hover":{light:"neutral-200",dark:"neutral-600",description:"Raised surface, hovered"},"surface-sunken-hover":{light:"neutral-300",dark:"neutral-600",description:"Sunken surface, hovered"},"field-hover":{light:"neutral-50",dark:"neutral-600",description:"Form control surface, hovered"},link:{light:"blue-500",dark:"blue-400",description:"Hyperlink"},"link-hover":{light:"blue-600",dark:"blue-300",description:"Hyperlink, hovered"},inverse:{light:"neutral-900",dark:"neutral-700",description:"Tooltip bubble, inverted surface"},"inverse-ink":{light:"white",dark:"white",description:"Text on an inverted surface"},line:{light:"neutral-200",dark:"neutral-700",description:"Default border, divider"},"line-strong":{light:"neutral-300",dark:"neutral-600",description:"Input border, focus ring track"},"line-hover":{light:"neutral-400",dark:"neutral-500",description:"Border of a hovered control"},accent:{light:"blue-600",dark:"blue-400",description:"Primary action, selected state"},info:{light:"cyan-600",dark:"cyan-400",description:"Informational emphasis"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-600",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"blue-500",dark:"blue-600",description:"Primary button fill"},"info-solid":{light:"cyan-500",dark:"cyan-600",description:"Informational fill"},"danger-solid":{light:"red-500",dark:"red-600",description:"Destructive button fill"},"success-solid":{light:"green-500",dark:"green-600",description:"Confirmation fill"},"warning-solid":{light:"yellow-500",dark:"yellow-600",description:"Caution fill"},"accent-solid-hover":{light:"blue-600",dark:"blue-700",description:"Primary button fill, hovered"},"info-solid-hover":{light:"cyan-600",dark:"cyan-700",description:"Informational fill, hovered"},"danger-solid-hover":{light:"red-600",dark:"red-700",description:"Destructive fill, hovered"},"success-solid-hover":{light:"green-600",dark:"green-700",description:"Confirmation fill, hovered"},"warning-solid-hover":{light:"yellow-600",dark:"yellow-700",description:"Caution fill, hovered"},"accent-ink":{light:"white",dark:"white",description:"Text on a primary fill"},"info-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on an informational fill"},"danger-ink":{light:"white",dark:"white",description:"Text on a destructive fill"},"success-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a confirmation fill"},"warning-ink":{light:"neutral-900",dark:"neutral-900",description:"Text on a caution fill"},"accent-soft":{light:"blue-100",dark:"blue-900",description:"Tinted primary fill"},"accent-soft-ink":{light:"blue-800",dark:"blue-200",description:"Text on a tinted primary fill"},"info-soft":{light:"cyan-100",dark:"cyan-900",description:"Tinted informational fill"},"info-soft-ink":{light:"cyan-800",dark:"cyan-200",description:"Text on a tinted informational fill"},"danger-soft":{light:"red-100",dark:"red-900",description:"Tinted destructive fill"},"danger-soft-ink":{light:"red-800",dark:"red-200",description:"Text on a tinted destructive fill"},"success-soft":{light:"green-100",dark:"green-900",description:"Tinted confirmation fill"},"success-soft-ink":{light:"green-800",dark:"green-200",description:"Text on a tinted confirmation fill"},"warning-soft":{light:"yellow-100",dark:"yellow-900",description:"Tinted caution fill"},"warning-soft-ink":{light:"yellow-800",dark:"yellow-200",description:"Text on a tinted caution fill"},secondary:{light:"purple-600",dark:"purple-400",description:"Secondary emphasis"},"secondary-solid":{light:"purple-500",dark:"purple-600",description:"Secondary fill"},"secondary-solid-hover":{light:"purple-600",dark:"purple-700",description:"Secondary fill, hovered"},"secondary-ink":{light:"white",dark:"white",description:"Text on a secondary fill"},"secondary-soft":{light:"purple-100",dark:"purple-900",description:"Tinted secondary fill"},"secondary-soft-ink":{light:"purple-800",dark:"purple-200",description:"Text on a tinted secondary fill"},"danger-fg":{light:"red-900",dark:"red-300",description:"Text in a field with an error"},"danger-fg-subtle":{light:"red-300",dark:"red-500",description:"Recessive text in a field with an error"},"danger-line":{light:"red-300",dark:"red-600",description:"Border of a field with an error"},"danger-focus":{light:"red-500",dark:"red-400",description:"Focus ring of a field with an error"}};function We(n){return`--stx-${n}`}function F(n,t){let s=t.lastIndexOf("-");if(s===-1)return typeof n[t]==="string"?n[t]:void 0;let r=n[t.slice(0,s)];if(!r||typeof r!=="object")return;let i=r[t.slice(s+1)];return typeof i==="string"?i:void 0}var xe=/^(?:#[\da-f]{3,8}|(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color|color-mix|var)\(.*\)|white|black|transparent|currentcolor)$/i;function X(n,t){let s=t.trim();return F(n,s)??(xe.test(s)?s:void 0)}function Z(n={}){return[...Object.keys(n.roles??{}).filter((t)=>!mt[t]).map((t)=>`roles.${t}`),...Object.keys(n.shapes??{}).filter((t)=>!me[t]).map((t)=>`shapes.${t}`),...Object.keys(n.density??{}).filter((t)=>!Re[t]).map((t)=>`density.${t}`)]}function q(n){let t={};for(let[s,r]of Object.entries(mt)){let i=F(n,r.light);if(i===void 0)continue;t[s]=`var(${We(s)}, ${i})`}return t}function ee(n,t={}){let s=[],r=[];for(let[i,o]of Object.entries(mt)){let l=t[i],g=typeof l==="string"?l:l?.light,a=typeof l==="string"?l:l?.dark,u=g&&X(n,g)||F(n,o.light),y=a&&X(n,a)||F(n,o.dark);if(u===void 0)continue;if(s.push(` ${We(i)}: ${u};`),y!==void 0)r.push(` ${We(i)}: ${y};`)}if(s.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...s,"}",".dark {",...r,"}",""].join(`
|
|
3
|
+
`)}var me={control:{value:"0.375rem",description:"Buttons, inputs, selects \u2014 rounded-md"},panel:{value:"0.5rem",description:"Cards, dialogs, menus \u2014 rounded-lg"},pill:{value:"9999px",description:"Chips and badges, which are pill-shaped by intent"}};function tn(n){return`--stx-radius-${n}`}function te(){let n={};for(let[t,s]of Object.entries(me))n[t]=`var(${tn(t)}, ${s.value})`;return n}function ne(n={}){return["/* stx shape tokens \u2014 a radius by what the thing is. */",":root {",...Object.entries(me).map(([t,s])=>` ${tn(t)}: ${n[t]??s.value};`),"}",""].join(`
|
|
4
|
+
`)}var Re={"control-px":{value:"1rem",description:"Inline padding of a md text control \u2014 px-4"},"control-py":{value:"0.5rem",description:"Block padding of a md text control \u2014 py-2"},"control-text":{value:"1rem",description:"Font size of a md text control \u2014 text-base"},"control-leading":{value:"1.5rem",description:"Line height of a md text control \u2014 text-base"},"cell-px":{value:"1.5rem",description:"Inline padding of every table cell, header or body \u2014 px-6"},"cell-py":{value:"1rem",description:"Block padding of a body cell \u2014 py-4"},"cell-text":{value:"0.875rem",description:"Font size of a body cell \u2014 text-sm"},"cell-leading":{value:"1.25rem",description:"Line height of a body cell \u2014 text-sm"},"cell-head-py":{value:"0.75rem",description:"Block padding of a header cell \u2014 py-3"},"cell-head-text":{value:"0.75rem",description:"Font size of a header cell \u2014 text-xs"},"cell-head-leading":{value:"1rem",description:"Line height of a header cell \u2014 text-xs"}},Wn={"control-x":"control-px","control-y":"control-py","cell-x":"cell-px","cell-y":"cell-py","cell-head-y":"cell-head-py"},qn={control:{size:"control-text",leading:"control-leading"},cell:{size:"cell-text",leading:"cell-leading"},"cell-head":{size:"cell-head-text",leading:"cell-head-leading"}};function qe(n){return`--stx-${n}`}function V(n){let t=Re[n];if(!t)throw Error(`[stx] unknown density token "${n}"`);return`var(${qe(n)}, ${t.value})`}function se(){let n={};for(let[t,s]of Object.entries(Wn))n[t]=V(s);return n}function re(){let n={};for(let[t,{size:s,leading:r}]of Object.entries(qn))n[t]=[V(s),{lineHeight:V(r)}];return n}function ie(n={}){return["/* stx density tokens \u2014 how much room a control or a table cell takes. */",":root {",...Object.entries(Re).map(([t,s])=>` ${qe(t)}: ${n[t]??s.value};`),"}",""].join(`
|
|
5
5
|
`)}function oe(n){return typeof n==="object"&&n!==null&&!Array.isArray(n)}function U(n,t){let s={...n};for(let[r,i]of Object.entries(t))s[r]=oe(i)&&oe(s[r])?U(s[r],i):i;return s}function ce(n,t){if(!t.fonts)return"";let s=new n({...t.config,fonts:t.fonts,cssVariables:!1}).toCSS(!1,t.minify);return s&&!t.minify?`${s}
|
|
6
|
-
`:s}function ae(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...o}=r,{extend:l,...g}=s,a=g.colors||{};g.colors={...a,...q(a)};let u=g.borderRadius||{};g.borderRadius={...u,...te()};let
|
|
7
|
-
`)}async function Te(n,t){try{let s=await
|
|
8
|
-
`))
|
|
9
|
-
`}let
|
|
6
|
+
`:s}function ae(n={},t={}){let s=n.theme||{},r=t.theme||{},{extend:i,...o}=r,{extend:l,...g}=s,a=g.colors||{};g.colors={...a,...q(a)};let u=g.borderRadius||{};g.borderRadius={...u,...te()};let y=g.spacing||{};g.spacing={...y,...se()};let H=g.fontSize||{};g.fontSize={...H,...re()};let R=U(g,o),x=U(l||{},i||{});if(Object.keys(x).length>0)R.extend=x;let E=[...n.safelist||[],...t.safelist||[]],_={...n.shortcuts||{},...t.shortcuts||{}},P=[...n.preflights||[],...t.preflights||[]],{fonts:K,...D}=n,{fonts:O,roles:T,shapes:N,density:k,...S}=t,f={roles:T,shapes:N,density:k},j=O??K;return{config:{...D,...S,theme:R,safelist:E,shortcuts:_,...P.length>0?{preflights:P}:{},content:[],output:""},safelist:E,shortcuts:_,includePreflight:t.preflight!==!1,minify:t.minify===!0,tokenCSS:ee({...a,...R.colors},T)+ne(N)+ie(k),unknownRoles:Z(f),...j?{fonts:j}:{}}}var e={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};var p=null,A="";function de(n){try{let t=n.startsWith("file:")?new URL(n).pathname:n;A=`${t}@${Math.trunc(M.statSync(t).mtimeMs)}`}catch{A=n}}var Q=!1,v=null,I="",B=!1,pe=256,C=new Map,m=new Map,z=null,he=null,G=new Map,ge=new Set;function L(n){return Bun.hash(n).toString(16).padStart(16,"0").slice(0,16)}function W(n,t){if(C.has(n))C.delete(n);else if(C.size>=pe)C.delete(C.keys().next().value);C.set(n,t)}function ke(n){let t=L(n);if(m.has(t))m.delete(t);else if(m.size>=pe)m.delete(m.keys().next().value);return m.set(t,n),t}function cp(n){let t=m.get(n);if(t===void 0)return;return m.delete(n),m.set(n,t),t}async function Ce(n,t=z){if(!t)return null;try{let s=Bun.file(d.join(t,`cw-${L(n)}.css`));if(!await s.exists())return null;return await s.text()}catch{return null}}async function Se(n,t,s=z){if(!s)return;try{if(!M.existsSync(s))M.mkdirSync(s,{recursive:!0});await Bun.write(d.join(s,`cw-${L(n)}.css`),t)}catch{}}async function ue(n){try{let t=await import(n);if(t&&t.CSSGenerator)return{CSSGenerator:t.CSSGenerator,config:t.config,build:t.build,defaultConfig:t.defaultConfig,extractClasses:t.extractClasses}}catch{}return null}var we=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],be=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function ve(){let n=[],t=process.cwd();while(t!==d.dirname(t)){for(let s of["node_modules","pantry"])for(let r of we)n.push(d.join(t,s,...r));t=d.dirname(t)}return n}function $e(){let n=[],t=process.env.HOME||process.env.USERPROFILE||"",s=[t&&d.join(t,"Code","Tools","ts-css"),t&&d.join(t,"Code","Tools","crosswind"),t&&d.join(t,"repos","stacks-org","ts-css"),t&&d.join(t,"repos","stacks-org","crosswind"),d.join(process.cwd(),"..","ts-css"),d.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let r of s)n.push(d.join(r,"packages","toolkit","dist","engine","index.js")),n.push(d.join(r,"packages","toolkit","src","engine","index.ts"));if(t)n.push(d.join(t,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return n}async function sa(){if(Q)return p;Q=!0;try{let n=async(i)=>{for(let o of i){if(!await Bun.file(o).exists())continue;let l=await ue(o);if(l){if(de(o),!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded from ${d.dirname(d.dirname(o))}`);return l}}return null};if(process.env.CROSSWIND_SRC){let i=d.resolve(process.env.CROSSWIND_SRC),o=await n([i]);if(!o)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${i}`);return p=o,p}let t=await n(ve());if(t)return p=t,p;let s=be;for(let i of s){let o=await ue(i);if(o){p=o;try{de(import.meta.resolve(i))}catch{A=i}if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} CSS engine loaded`);return p}}let r=await n($e());if(r)return p=r,p;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${e.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${e.reset}`),console.warn(`${e.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${e.reset}`),null}}function lp(){Y.clear(),p=null,Q=!1,v=null,I="",C.clear(),m.clear(),he=null,G.clear()}var fe=!1;async function oa(n){try{let t=le({name:"css",cwd:n})?"css":le({name:"crosswind",cwd:n})?"crosswind":null;if(!t)return null;if(t==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!fe)fe=!0,console.warn(`${e.yellow}[ts-css]${e.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:s}=await import("bunfig"),r=await s({name:t,cwd:n,defaultConfig:{},checkEnv:!1,verbose:!1});if(!r?.path||!r.config||Object.keys(r.config).length===0)return null;let i=d.relative(n,r.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${e.green}[ts-css]${e.reset} Loaded config from ${i||r.path}`);return r.config}catch(t){if(t instanceof Error&&t.name==="ConfigNotFoundError")return null;return console.warn(`${e.yellow}[ts-css]${e.reset} Failed to load css config:`,t instanceof Error?t.message:t),null}}async function wl(n){let t=null;try{let{loadStxConfig:s}=await import("./chunk-4c5tk71j.js"),r=await s(n);if(r.css)if(typeof r.css==="string"){let i=d.isAbsolute(r.css)?r.css:d.resolve(n,r.css);if(await Bun.file(i).exists()){let o=await import(i);t=o.default||o,console.log(`${e.green}[ts-css]${e.reset} Loaded config from stx.config.ts \u2192 ${r.css}`)}}else{if(t={...r.css,content:r.css.content||[],preflight:r.css.preflight??!0,minify:r.css.minify??!1},r.css.config){let i=d.isAbsolute(r.css.config)?r.css.config:d.resolve(n,r.css.config);if(await Bun.file(i).exists()){let o=await import(i);t={...o.default||o,...t}}}console.log(`${e.green}[ts-css]${e.reset} Using inline CSS config from stx.config.ts`)}}catch{}return t||await oa(n)}function xl(n){try{let t=new WeakSet;return L(JSON.stringify(n??{},(s,r)=>{if(typeof r==="function")return`[fn]${String(r)}`;if(typeof r==="object"&&r!==null){if(t.has(r))return"[circular]";t.add(r)}return r})??"")}catch{return"unhashable"}}async function nn(n){if(B)return I;B=!0;try{let t=await sa();if(!t||!t.build)return B=!1,"";if(!v)v=await oa(n);if(!v)return B=!1,"";let s=t.defaultConfig?.theme||{},r=v.theme||{},i={...t.defaultConfig,...v,theme:{...s,...r,extend:{...s.extend||{},...r.extend||{}}}},o=performance.now(),l=await t.build(i),g=performance.now()-o;if(I=l.css,console.log(`${e.cyan}[ts-css]${e.reset} Built ${l.classes.size} classes in ${g.toFixed(1)}ms`),i.output){let a=d.isAbsolute(i.output)?i.output:d.join(n,i.output),u=d.dirname(a);if(!M.existsSync(u))M.mkdirSync(u,{recursive:!0});await Bun.write(a,l.css)}return B=!1,l.css}catch(t){return console.error(`${e.red}[ts-css]${e.reset} Build error:`,t),B=!1,I}}async function Gn(n){v=null,await nn(n)}function up(){return I}function Sl(n){let t=new Set,s=/class\s*=\s*["']([^"']+)["']/gi,r=s.exec(n);while(r!==null){for(let l of r[1].split(/\s+/))if(l.trim())t.add(l.trim());r=s.exec(n)}let i=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,o=i.exec(n);while(o!==null){let l=o[1].match(/'([^']+)'/g);if(l){for(let g of l)for(let a of g.slice(1,-1).split(/\s+/))if(a.trim())t.add(a.trim())}o=i.exec(n)}return t}var Y=b(64);async function kl(n,t){let s=()=>G.get(t?d.resolve(t):process.cwd())?.fingerprint??null,r=Y.get(w(n,t,s()));if(r!==void 0)return r;let i=await Te(n,t);if(i)Y.set(w(n,t,s()),i);return i}function*ye(n){yield n;let t=new Set;for(let s of n.matchAll(/\/_stx\/modules\.([0-9a-f]{16})\.js/g)){let r=s[1];if(t.has(r))continue;t.add(r);let i=go(r);if(i)yield i}}function dp(n){return[...ye(n)].join(`
|
|
7
|
+
`)}async function Te(n,t){try{let s=await sa();if(!s)return"";let r=new Set;for(let f of ye(n)){let j=typeof s.extractClasses==="function"?s.extractClasses(f):Sl(f);for(let J of j)r.add(J)}if(r.size===0)return"";let i=t?d.resolve(t):process.cwd(),o=c(i,"cache");if(!z)z=o;let l=G.get(i);if(!l){let f=await wl(i);l={config:f,fingerprint:xl(f)},G.set(i,l),he=l.fingerprint}let g=[...r].sort().join(" "),a=`${A}::${l.fingerprint||"default"}::${g}`,u=C.get(a);if(u!==void 0)return W(a,u),u;let y=await Ce(a,o);if(y!==null)return W(a,y),y;let H=s.defaultConfig||s.config,R=l.config||{},x=ae(H,R),{safelist:E,includePreflight:_,minify:P,tokenCSS:K}=x;if(x.unknownRoles.length>0&&!ge.has(i))ge.add(i),console.warn(`${e.yellow}[ts-css]${e.reset} No stx role for ${x.unknownRoles.join(", ")} - these keep the stock value. Role names: semanticTokenNames() in @stacksjs/stx/theme-tokens.`);let D=x.config,O=new s.CSSGenerator(D),T=D.shortcuts||R.shortcuts||{},N=Object.keys(T).filter((f)=>r.has(f)||E.includes(f));for(let f of E)if(!T[f])O.generate(f);for(let f of r)if(!T[f])O.generate(f);let k="";if(N.length>0){let f=new s.CSSGenerator(D);for(let j of N)f.generate(j);if(k=f.toCSS(!1,P),k&&!k.endsWith(`
|
|
8
|
+
`))k+=`
|
|
9
|
+
`}let S=k+O.toCSS(_,P);return S=ce(s.CSSGenerator,x)+K+S,W(a,S),Se(a,S,o),S}catch(s){return console.warn("Failed to generate Css CSS:",s),""}}async function h(n,t,s=!1,r=!1){let i=await kl(n,t);if(!i)return r?ln(n):n;let o=s?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${ke(i)}.css">`:`<style data-css="generated">
|
|
10
10
|
${i}
|
|
11
11
|
</style>`;if(r)return je(n,o);let l=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(l.test(n)){let g=!1;return n.replace(l,()=>{if(g)return"";return g=!0,o})}if(n.includes("</head>"))return n.replace("</head>",`${o}
|
|
12
12
|
</head>`);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
|
|
13
|
-
${o}`);return o+n}function je(n,t){let s=
|
|
13
|
+
${o}`);return o+n}function je(n,t){let s=Io(n).map((a)=>({...a,replacement:""})),r=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g,i=r.exec(n);if(i!==null){let a=!0;while(i!==null)s.push({start:i.index,end:i.index+i[0].length,replacement:a?t:""}),a=!1,i=r.exec(n)}else{let a=n.indexOf("</head>");if(a!==-1)s.push({start:a,end:a,replacement:`${t}
|
|
14
14
|
`});else{let u=n.match(/<body([^>]*)>/);if(u?.index!==void 0)s.push({start:u.index,end:u.index+u[0].length,replacement:`${u[0]}
|
|
15
|
-
${t}`});else s.push({start:0,end:0,replacement:t})}}s.sort((a,u)=>a.start-u.start||a.end-u.end);for(let a=1;a<s.length;a++)if(s[a].start<s[a-1].end)return Be(
|
|
15
|
+
${t}`});else s.push({start:0,end:0,replacement:t})}}s.sort((a,u)=>a.start-u.start||a.end-u.end);for(let a=1;a<s.length;a++)if(s[a].start<s[a-1].end)return Be(ln(n),t);let o=Array(s.length*2+1),l=0,g=0;for(let a of s)o[g++]=n.slice(l,a.start),o[g++]=a.replacement,l=a.end;return o[g]=n.slice(l),o.join("")}function Be(n,t){let s=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(s.test(n)){let r=!1;return n.replace(s,()=>{if(r)return"";return r=!0,t})}if(n.includes("</head>"))return n.replace("</head>",`${t}
|
|
16
16
|
</head>`);if(n.includes("<body"))return n.replace(/<body([^>]*)>/,`<body$1>
|
|
17
17
|
${t}`);return t+n}
|
|
18
|
-
export{mt,
|
|
18
|
+
export{mt,We,me,tn,Re,Wn,qn,qe,e,cp,sa,lp,oa,wl,xl,nn,Gn,up,Sl,kl,dp,h};
|