@stacksjs/stx 0.2.218 → 0.2.219
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-pdh79z63.js → chunk-02e5r50t.js} +1 -1
- package/dist/chunk-03t9yevc.js +2 -0
- package/dist/{chunk-z47tw39z.js → chunk-0kj7rses.js} +2 -2
- package/dist/{chunk-c0p9kf53.js → chunk-0m7mt6zc.js} +1 -1
- package/dist/{chunk-wbq7cp57.js → chunk-0wwbjhs2.js} +1 -1
- package/dist/chunk-1339ynfv.js +2 -0
- package/dist/{chunk-96kpqgh3.js → chunk-1b0yfasc.js} +1 -1
- package/dist/{chunk-b6jhznkh.js → chunk-1t7cy4zb.js} +1 -1
- package/dist/{chunk-808qy9cq.js → chunk-27crt28c.js} +196 -196
- package/dist/{chunk-xwc4pg5w.js → chunk-29y9cskh.js} +2 -2
- package/dist/{chunk-st5qggks.js → chunk-2v9qzeb5.js} +1 -1
- package/dist/{chunk-1bvstnz4.js → chunk-2w1qaf5b.js} +2 -2
- package/dist/chunk-395dm3a0.js +3 -0
- package/dist/{chunk-w0ng9e1m.js → chunk-3q8c4kex.js} +1 -1
- package/dist/{chunk-xkd164zg.js → chunk-3tm1df07.js} +1 -1
- package/dist/chunk-3v9drr1f.js +2 -0
- package/dist/chunk-40zvzck0.js +2 -0
- package/dist/chunk-4cm1n157.js +2 -0
- package/dist/{chunk-j0tfxbns.js → chunk-4q17c8sg.js} +2 -2
- package/dist/chunk-4v8358s4.js +2 -0
- package/dist/{chunk-j5vyt8wd.js → chunk-54cefpt2.js} +1 -1
- package/dist/chunk-55yz6apk.js +2 -0
- package/dist/chunk-5xg4y72b.js +2 -0
- package/dist/chunk-62ypndze.js +2 -0
- package/dist/{chunk-x8b16v5q.js → chunk-6b80avmh.js} +1 -1
- package/dist/chunk-6shcpcn9.js +2 -0
- package/dist/{chunk-s7dqawk0.js → chunk-6v2pfq30.js} +2 -2
- package/dist/{chunk-n8zpm7xb.js → chunk-6xtajfpz.js} +1 -1
- package/dist/{chunk-bsr7yrxh.js → chunk-71kpxn5y.js} +1 -1
- package/dist/{chunk-mxqp7x07.js → chunk-7az4zfm8.js} +2 -2
- package/dist/{chunk-7md45k52.js → chunk-7ftn4dpc.js} +2 -2
- package/dist/{chunk-y4hkqsgw.js → chunk-81jqzypz.js} +2 -2
- package/dist/{chunk-q8szpd6w.js → chunk-8dz63q4e.js} +1 -1
- package/dist/chunk-8ksdma43.js +2 -0
- package/dist/{chunk-weajy31v.js → chunk-937b32gs.js} +2 -2
- package/dist/{chunk-crmk2jzf.js → chunk-97t2tj98.js} +1 -1
- package/dist/chunk-99ncmbh8.js +2 -0
- package/dist/{chunk-9064gyt5.js → chunk-9k6890an.js} +2 -2
- package/dist/{chunk-pezxve4a.js → chunk-9tmcj4y7.js} +3 -3
- package/dist/{chunk-ymccpdg6.js → chunk-a39thx3m.js} +1 -1
- package/dist/{chunk-cqt6ry1e.js → chunk-a53v1er1.js} +1 -1
- package/dist/chunk-a7zjfav5.js +2 -0
- package/dist/chunk-aca3hetd.js +2 -0
- package/dist/{chunk-7mst8kqm.js → chunk-ags8t27c.js} +1 -1
- package/dist/{chunk-zgvga8rc.js → chunk-ap23bgyb.js} +1 -1
- package/dist/chunk-b9kdezkq.js +2 -0
- package/dist/{chunk-1nnpwrqj.js → chunk-bbrm07kg.js} +2 -2
- package/dist/{chunk-y2jr10y8.js → chunk-bhqcp8b0.js} +2 -2
- package/dist/{chunk-fnkxbnka.js → chunk-bx766t25.js} +1 -1
- package/dist/{chunk-ht51fz7w.js → chunk-c23nyjd0.js} +1 -1
- package/dist/chunk-c6pb88k7.js +2 -0
- package/dist/{chunk-47pge5gz.js → chunk-ch5n6w31.js} +1 -1
- package/dist/chunk-cmz46x9n.js +2 -0
- package/dist/{chunk-m2mhtpwy.js → chunk-cnkex10g.js} +1 -1
- package/dist/{chunk-3es366z4.js → chunk-dve5ehgr.js} +1 -1
- package/dist/{chunk-vgk5v31k.js → chunk-e31kcmmd.js} +1 -1
- package/dist/{chunk-gvm4dw6p.js → chunk-e4mj16za.js} +2 -2
- package/dist/chunk-e5s2b5z3.js +2 -0
- package/dist/{chunk-msjzqne1.js → chunk-es9ygzeh.js} +1 -1
- package/dist/{chunk-p7qqbw2k.js → chunk-ests3gcx.js} +2 -2
- package/dist/{chunk-jmnftb29.js → chunk-fc33v1qf.js} +2 -2
- package/dist/{chunk-q4se9rtw.js → chunk-fk1qyjdw.js} +1 -1
- package/dist/chunk-gdaq67k8.js +2 -0
- package/dist/{chunk-f6jm4hy3.js → chunk-gfvb1926.js} +1 -1
- package/dist/{chunk-9b82d4g5.js → chunk-gnmft4dz.js} +1 -1
- package/dist/{chunk-74gc1x9x.js → chunk-gzjnkskc.js} +2 -2
- package/dist/chunk-h8s4n9vj.js +2 -0
- package/dist/chunk-hdy6e3yf.js +2 -0
- package/dist/chunk-hkh1d5m5.js +18 -0
- package/dist/{chunk-53ajah3v.js → chunk-hnrtm6xb.js} +2 -2
- package/dist/chunk-hzg9r43r.js +2 -0
- package/dist/{chunk-zxb128xa.js → chunk-j0bcnfbq.js} +2 -2
- package/dist/chunk-jde8jz10.js +2 -0
- package/dist/chunk-jn7g22fd.js +2 -0
- package/dist/{chunk-hncp9gz6.js → chunk-jw93tsxz.js} +1 -1
- package/dist/{chunk-3twce5kp.js → chunk-jzavbzn8.js} +1 -1
- package/dist/{chunk-3wd9kfyz.js → chunk-k0cqdptr.js} +1 -1
- package/dist/{chunk-qd1nadff.js → chunk-khxs70kb.js} +2 -2
- package/dist/{chunk-8anh6d36.js → chunk-kqdrjd0e.js} +1 -1
- package/dist/{chunk-fvjh7rx0.js → chunk-kw311y8k.js} +1 -1
- package/dist/{chunk-zat2ndst.js → chunk-m3dcd2j3.js} +347 -347
- package/dist/{chunk-yckd6ks5.js → chunk-m9tpk603.js} +1 -1
- package/dist/{chunk-yf3bmmkk.js → chunk-mt7htpvg.js} +1 -1
- package/dist/{chunk-1nm2xrvq.js → chunk-n09vpazf.js} +1 -1
- package/dist/{chunk-dmb6t0qj.js → chunk-n98pfm3h.js} +2 -2
- package/dist/{chunk-6xg3j487.js → chunk-n98zvmdq.js} +1 -1
- package/dist/{chunk-khrtzbxd.js → chunk-p5ktexx3.js} +1 -1
- package/dist/{chunk-fvpaf9v5.js → chunk-p6dtgqeq.js} +2 -2
- package/dist/{chunk-yk1smsev.js → chunk-p9mx8rh4.js} +1 -1
- package/dist/{chunk-ne8sygmy.js → chunk-q98bqfzh.js} +1 -1
- package/dist/chunk-rr6scjzr.js +2 -0
- package/dist/{chunk-9xh78snm.js → chunk-s6yn1mbm.js} +1 -1
- package/dist/{chunk-1306tswx.js → chunk-sgncfrb3.js} +1 -1
- package/dist/chunk-t1fqr070.js +2 -0
- package/dist/{chunk-rg6v68ya.js → chunk-t9mf6ddw.js} +1 -1
- package/dist/{chunk-css1sfnr.js → chunk-ta43eqe0.js} +1 -1
- package/dist/{chunk-rczpw37w.js → chunk-tmfrweee.js} +1 -1
- package/dist/{chunk-j3njy10j.js → chunk-tpjekhep.js} +2 -2
- package/dist/chunk-tvcf5760.js +2 -0
- package/dist/chunk-tw2ydyww.js +4 -0
- package/dist/chunk-vcw2ft8z.js +2 -0
- package/dist/{chunk-p8pyqr7p.js → chunk-vdqbbqe2.js} +1 -1
- package/dist/chunk-vg9xvtqz.js +2 -0
- package/dist/{chunk-a2rj5ce0.js → chunk-vgtcj29n.js} +2 -2
- package/dist/chunk-vh7h37mn.js +2 -0
- package/dist/chunk-vhajz6q3.js +2 -0
- package/dist/{chunk-x13f5bbe.js → chunk-vhx0v4jv.js} +1 -1
- package/dist/{chunk-c7pvwvse.js → chunk-vswv49x0.js} +1 -1
- package/dist/{chunk-zj44h5kk.js → chunk-vwn8hkr2.js} +1 -1
- package/dist/{chunk-z2sp0k8d.js → chunk-vx8zk4yt.js} +1 -1
- package/dist/{chunk-aw9z3m10.js → chunk-wzjcw1h6.js} +1 -1
- package/dist/{chunk-tryt2h85.js → chunk-xdq4zkqk.js} +1 -1
- package/dist/{chunk-3fwn9edg.js → chunk-xvh1k1a4.js} +1 -1
- package/dist/chunk-y2j14rjd.js +2 -0
- package/dist/chunk-yd3rg2be.js +2 -0
- package/dist/{chunk-7zk48rd8.js → chunk-ynqc1gyr.js} +1 -1
- package/dist/{chunk-hyrjade7.js → chunk-z2gv9n8s.js} +1 -1
- package/dist/{chunk-trtm887x.js → chunk-z3cgw8j4.js} +1 -1
- package/dist/{chunk-whxregkn.js → chunk-zbww31ss.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/dev-server/serve-app.js +29 -7
- package/dist/page-response.d.ts +113 -0
- package/dist/page-response.js +106 -1
- package/dist/process.js +2 -0
- package/dist/production-server.js +7 -3
- package/dist/pwa.js +2 -2
- package/dist/render.d.ts +14 -0
- package/dist/render.js +3 -19
- package/dist/serve.js +19 -10
- package/dist/ssg.js +2 -2
- package/dist/template-compiler.d.ts +1 -0
- package/dist/template-compiler.js +2 -0
- package/dist/template-hydrator.d.ts +1 -1
- package/dist/template-hydrator.js +4 -3
- package/dist/variable-extractor.d.ts +1 -1
- package/dist/variable-extractor.js +6 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-10yft4b7.js +0 -2
- package/dist/chunk-17atrbv2.js +0 -2
- package/dist/chunk-23vxz3hp.js +0 -2
- package/dist/chunk-2me28xee.js +0 -2
- package/dist/chunk-2w5d5tw1.js +0 -2
- package/dist/chunk-2xeq5xnf.js +0 -2
- package/dist/chunk-2z6k7gsa.js +0 -2
- package/dist/chunk-3fxcwk6a.js +0 -2
- package/dist/chunk-4vwxgmg0.js +0 -2
- package/dist/chunk-5gr4vv7m.js +0 -2
- package/dist/chunk-775fabj4.js +0 -2
- package/dist/chunk-8cyv5316.js +0 -2
- package/dist/chunk-8xtvmwpr.js +0 -2
- package/dist/chunk-9db2f09j.js +0 -2
- package/dist/chunk-9h908knr.js +0 -2
- package/dist/chunk-a1ydhf5t.js +0 -3
- package/dist/chunk-ba18hn7n.js +0 -2
- package/dist/chunk-bd0yv6a0.js +0 -2
- package/dist/chunk-cr7s8q08.js +0 -2
- package/dist/chunk-d48tzd8c.js +0 -2
- package/dist/chunk-dcy8hg45.js +0 -2
- package/dist/chunk-e6377wfq.js +0 -4
- package/dist/chunk-jnjxf5t2.js +0 -2
- package/dist/chunk-n4smz31k.js +0 -18
- package/dist/chunk-njkv35c3.js +0 -2
- package/dist/chunk-q3ea7q6t.js +0 -2
- package/dist/chunk-qwzfdq8q.js +0 -2
- package/dist/chunk-r153ybwd.js +0 -2
- package/dist/chunk-tg0w29j1.js +0 -2
- package/dist/chunk-tqhwzjj7.js +0 -2
- package/dist/chunk-vgr8kykv.js +0 -2
- package/dist/chunk-w670sde5.js +0 -2
- package/dist/chunk-x9bsft57.js +0 -2
- package/dist/chunk-y05vd24g.js +0 -2
- package/dist/chunk-yrqnsd3a.js +0 -2
- package/dist/chunk-z0hkt5sk.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Cg as t,Dg as e,Eg as HH,Fg as KH,Gg as QH,Hg as YH,xg as S,yg as s,zg as i}from"./chunk-ests3gcx.js";import{Vi as a}from"./chunk-7az4zfm8.js";import{Ws as h}from"./chunk-cnkex10g.js";import{ot as f}from"./chunk-n09vpazf.js";import{existsSync as ZH,readFileSync as XH}from"fs";import J from"path";function qH(K,Q="",V=""){let U=K.startLine>1?`
|
|
3
3
|
`.repeat(K.startLine-1):"",E=i(s(K.code)),X=K.kind==="client"||K.kind==="plain"?e(Q,K.code):"";return KH(`${U+E}
|
|
4
4
|
${X}
|
|
5
5
|
export {}
|
|
@@ -15,4 +15,4 @@ ${b.trim().split(`
|
|
|
15
15
|
`).slice(0,12).join(`
|
|
16
16
|
`)||"(no output)"}`:void 0;return{diagnostics:D,checkedFiles:q,blockCount:B,expressionCount:T,failure:VH}}function PH(K){return K.map((Q)=>{let V=Q.blockKind==="template"?`[template: ${Q.expression??""}]`:`[${Q.blockKind==="plain"?"<script>":`<script ${Q.blockKind}>`}]`;return`${Q.file}:${Q.line}:${Q.column} ${Q.category} TS${Q.code} ${Q.message} ${V}`}).join(`
|
|
17
17
|
`)}
|
|
18
|
-
export{qH as
|
|
18
|
+
export{qH as Xe,r as Ye,wH as Ze,MH as _e,TH as $e,PH as af};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{Broadcast as D,BroadcastServer as U}from"ts-broadcasting";import{channel as b}from"ts-broadcasting";import{Broadcast as N,BroadcastServer as p}from"ts-broadcasting";var z=null,H=[];function X(){return z}async function Y(j){if(z)return z;let k=j.driver??"bun",q=j.host??"0.0.0.0",G=j.port??6001,J=j.scheme??"ws",E={verbose:j.verbose??!1,driver:k,default:k,connections:{[k]:{driver:k,host:q,port:G,scheme:J}}};return z=new U(E),D.setServer(z),await z.start(),z}async function Z(){for(let j of H)clearInterval(j);if(H.length=0,!z)return;await z.stop(),z=null}async function $(j){let k=await import(j),q=k.default??k;if(typeof q!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof q}`);let G=0;return q({channel(E,A){if(G++,A.authorize&&z)z.channels.channel(E,A.authorize);if(A.interval&&A.data){let L=A.event??`${E}.updated`,M=A.data,Q=setInterval(async()=>{try{let T=await M();V(E,L,T)}catch{}},A.interval);H.push(Q)}}}),G}var K=!1;function F(){if(z)return!0;if(!K)K=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function V(j,k,q){if(!F())return;D.send(j,k,q)}function x(j,k,q){if(!F())return;D.toUser(j,k,q)}function C(j,k,q){if(!F())return;D.toUsers(j,k,q)}function S(j,k,q){if(!F())return;D.send(`private-${j}`,k,q)}function w(j,k,q){if(!F())return;D.presence(j,k,q)}
|
|
3
|
-
export{X as
|
|
3
|
+
export{X as Tg,Y as Ug,Z as Vg,$ as Wg,V as Xg,x as Yg,C as Zg,S as _g,w as $g,b as ah,N as bh,p as ch};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{T as
|
|
2
|
+
import{Lq as q,Pq as y}from"./chunk-m3dcd2j3.js";import{su as L}from"./chunk-z3cgw8j4.js";import M from"fs";import X from"path";var T=new Map,Q=new Map;async function A(j){let z;for(let K=0;K<3;K++)try{let V=(await M.promises.stat(j)).mtime.getTime(),J=Q.get(j);if(J&&J.mtime===V)return J.content;let W=await Bun.file(j).text(),U=(await M.promises.stat(j)).mtime.getTime();if(U!==V)continue;return Q.set(j,{content:W,mtime:U}),W}catch(I){z=I;break}throw Q.delete(j),Error(`File not found: ${j}${z?` (${z.message})`:""}`)}function H(j){Q.delete(j)}function v(j){for(let B of Q.keys())if(B.startsWith(j))Q.delete(B)}var Z=null,b=null,N=null;function E(j){N=j}async function F(j=!1){let B=N??await import("./chunk-02e5r50t.js");if(j)return B.generateSignalsRuntimeDev();if(Z===null)Z=B.generateSignalsRuntime();return Z}var $=null;async function R(){if($===null){let{getRouterScript:j}=await import("./chunk-wzjcw1h6.js");$=j()}return $}function S(){Q.clear(),y(),Z=null,b=null,$=null}function k(j){let B={debug:j.debug===!0,middleware:(j.middleware??[]).map((z)=>({name:z.name,timing:z.timing,handler:String(z.handler)})),customDirectives:(j.customDirectives??[]).map((z)=>({name:z.name,hasEndTag:z.hasEndTag===!0,handler:String(z.handler)}))};return new Bun.CryptoHasher("sha1").update(JSON.stringify(B)).digest("hex")}async function _(j,B){try{if(!B.cachePath)return null;let z=X.resolve(B.cachePath),K=X.join(z,`${D(j)}.html`),I=X.join(z,`${D(j)}.meta.json`);if(!await q(K)||!await q(I))return null;let V=await Bun.file(I).text(),J=JSON.parse(V);if(J.cacheVersion!==B.cacheVersion)return null;if(J.optionsSignature!==k(B))return null;if((await M.promises.stat(j)).mtime.getTime()>J.mtime)return null;for(let Y of J.dependencies)if(await q(Y)){if((await M.promises.stat(Y)).mtime.getTime()>J.mtime)return null}else return null;return await Bun.file(K).text()}catch(z){return console.warn(`Cache error for ${j}:`,z),null}}async function g(j,B,z,K){try{if(!K.cachePath)return;let I=X.resolve(K.cachePath);await M.promises.mkdir(I,{recursive:!0});let V=X.join(I,`${D(j)}.html`),J=X.join(I,`${D(j)}.meta.json`),W=await M.promises.stat(j);await Bun.write(V,B);let Y={sourcePath:j,mtime:W.mtime.getTime(),dependencies:Array.from(z),cacheVersion:K.cacheVersion,optionsSignature:k(K),generatedAt:Date.now()};await Bun.write(J,JSON.stringify(Y,null,2)),T.set(j,{output:B,mtime:W.mtime.getTime(),dependencies:z})}catch(I){console.warn(`Failed to cache template ${j}:`,I)}}var G=16;function D(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,G)}
|
|
3
|
+
export{T as Ii,A as Ji,H as Ki,v as Li,E as Mi,F as Ni,R as Oi,S as Pi,_ as Qi,g as Ri,D as Si};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Sg as t}from"./chunk-khxs70kb.js";import{Im as u,Jm as m,Xo as x,am as f,bm as E,gq as s,km as y,rm as v}from"./chunk-m3dcd2j3.js";import{Dt as r,eu as a,iu as UG}from"./chunk-0kj7rses.js";import{su as R}from"./chunk-z3cgw8j4.js";import i from"fs";import z from"path";var{serve:WG}=globalThis.Bun;function k(G,J,K={}){let Q=`${encodeURIComponent(G)}=${encodeURIComponent(J)}`;if(K.maxAge!==void 0)Q+=`; Max-Age=${K.maxAge}`;if(K.expires)Q+=`; Expires=${K.expires.toUTCString()}`;if(K.path)Q+=`; Path=${K.path}`;if(K.domain)Q+=`; Domain=${K.domain}`;if(K.secure)Q+="; Secure";if(K.httpOnly)Q+="; HttpOnly";if(K.sameSite)Q+=`; SameSite=${K.sameSite}`;return Q}async function o(G){let J=G.headers.get("content-type")||"",K={},Q=(X,$)=>{let Z=K[X];if(Z===void 0)K[X]=$;else if(Array.isArray(Z))Z.push($);else K[X]=[Z,$]};if(J.includes("multipart/form-data")){let X=await G.formData();for(let[$,Z]of X.entries())if(typeof Z==="string")Q($,Z);return K}if(J.includes("application/x-www-form-urlencoded")){for(let[X,$]of new URLSearchParams(await G.text()).entries())Q(X,$);return K}return K}function q(G){if(!G)return!1;let J=G.toUpperCase();return J!=="GET"&&J!=="HEAD"}async function g(G,J={}){let K=J.request,Q=J.method??K?.method;if(!K||!q(Q))return{ran:!1};if(typeof G.action!=="function")return{ran:!1};let X={};try{X=await o(K)}catch{}let $=await G.action({request:K,form:X,params:J.params??{},query:G.query??{},cookies:J.cookies??{}});if($&&typeof $==="object"){let Z=$,U=e(Z.cookies),_=Z.redirect;if(typeof _==="string"&&_)return{redirect:_,ran:!0,...U.length>0?{cookies:U}:{}};let{cookies:I,redirect:B,...O}=Z;if(Object.assign(G,O),U.length>0)return{ran:!0,cookies:U}}return{ran:!0}}function e(G){if(!G||typeof G!=="object"||Array.isArray(G))return[];let J=[];for(let[K,Q]of Object.entries(G)){if(!K)continue;if(typeof Q==="string"){J.push(k(K,Q));continue}if(Q&&typeof Q==="object"){let X=Q;if(typeof X.value!=="string")continue;J.push(k(K,X.value,X))}}return J}function h(G,J=[]){let K=new Headers({Location:G,"Cache-Control":"no-store"});for(let Q of J)K.append("Set-Cookie",Q);return new Response(null,{status:303,headers:K})}async function zG(G,J={}){return(await d(G,J)).html}async function l(G,J={}){let{html:K,context:Q,redirect:X,cookies:$}=await d(G,J),Z=u(Q),U=m(Q);if(X)return{html:K,redirect:X,cookies:$,status:Z,headers:U};let{extractStreamBoundaries:_}=await import("./chunk-3v9drr1f.js"),I=_(Q),B=G.streamTemplates;if(B&&Object.keys(B).length>0){let{processDirectives:O}=await import("./chunk-b9kdezkq.js"),{defaultConfig:N}=await import("./chunk-4v8358s4.js"),j=Q.streamBoundaries||{},H={...N,autoShell:!1},L=Object.keys(B).map((F)=>({id:F,render:async()=>{let V=typeof j[F]==="function"?await j[F]():void 0;return O(B[F],{...Q,$boundary:V},G.sourceFile,H,new Set)}})),P=new Set(L.map((F)=>F.id));I=[...(I||[]).filter((F)=>!P.has(F.id)),...L]}return{html:K,boundaries:I&&I.length>0?I:void 0,cookies:$,status:Z,headers:U}}async function d(G,J){let K={__filename:G.sourceFile,__dirname:G.sourceFile.replace(/[/\\][^/\\]+$/,""),...J};if(!G.hasServerScripts&&!E(G.html))return{html:G.html,context:K};for(let $ of G.serverScriptContent)try{await x($,K,G.sourceFile)}catch(Z){console.warn(`[stx] Server script error in ${G.sourceFile}:`,Z)}let Q=await g(K,{request:J.request,method:J.method,params:J.params??{},cookies:J.cookies??{}});if(Q.redirect)return{html:G.html,context:K,redirect:Q.redirect,cookies:Q.cookies};if(!E(G.html))return{html:G.html,context:K,cookies:Q.cookies};let X=new Map;for(let[$,Z]of Object.entries(G.placeholders))if(Z.expression)try{let U=v(Z.expression,K);if(Z.type==="raw")X.set($,U!==void 0&&U!==null?String(U):"");else X.set($,U!==void 0&&U!==null?y(String(U)):"")}catch{X.set($,"")}return{html:f(G.html,X),context:K,cookies:Q.cookies}}async function BG(G,J={}){if(!G.hasServerScripts&&!E(G.fragment))return G.fragment;let K={__filename:G.sourceFile,__dirname:G.sourceFile.replace(/[/\\][^/\\]+$/,""),...J};for(let X of G.serverScriptContent)try{await x(X,K,G.sourceFile)}catch($){console.warn(`[stx] Server script error in ${G.sourceFile}:`,$)}if(!E(G.fragment))return G.fragment;let Q=new Map;for(let[X,$]of Object.entries(G.placeholders))if($.expression)try{let Z=v($.expression,K);if($.type==="raw")Q.set(X,Z!==void 0&&Z!==null?String(Z):"");else Q.set(X,Z!==void 0&&Z!==null?y(String(Z)):"")}catch{Q.set(X,"")}return f(G.fragment,Q)}UG();import C from"zlib";import{promisify as p}from"util";var GG=p(C.brotliCompress),JG=p(C.gzip),KG=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],QG=["text/event-stream","multipart/x-mixed-replace"],XG=1024;function ZG(G){if(!G)return!1;let J=G.toLowerCase();if(QG.some((K)=>J.startsWith(K)))return!1;return KG.some((K)=>J.startsWith(K))}function $G(G){let J=new Map;for(let K of G.split(",")){let[Q,...X]=K.trim().split(";"),$=Q.trim().toLowerCase();if(!$)continue;let Z=1;for(let U of X){let _=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(U);if(!_)continue;let I=Number.parseFloat(_[1]);if(Number.isFinite(I))Z=I}J.set($,Z)}return J}function OG(G){if(!G)return null;let J=$G(G),K=J.get("*"),Q=(X)=>J.get(X)??K??0;if(Q("br")>0)return"br";if(Q("gzip")>0)return"gzip";return null}async function n(G,J,K={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!ZG(J.headers.get("content-type")))return J;let Q=OG(G.headers.get("accept-encoding"));if(!Q)return J;let X;try{X=new Uint8Array(await J.arrayBuffer())}catch{return J}let $=()=>new Response(X,{status:J.status,statusText:J.statusText,headers:c(J.headers)});if(X.length<(K.threshold??XG))return $();try{let Z=Q==="br"?await GG(X,{params:{[C.constants.BROTLI_PARAM_QUALITY]:K.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:X.length}}):await JG(X);if(Z.length>=X.length)return $();let U=c(J.headers);return U.set("Content-Encoding",Q),U.set("Content-Length",String(Z.length)),new Response(Z,{status:J.status,statusText:J.statusText,headers:U})}catch{return $()}}function c(G){let J=new Headers(G),K=J.get("Vary");if(!K)return J.set("Vary","Accept-Encoding"),J;if(!K.split(",").some((X)=>X.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${K}, Accept-Encoding`);return J}var YG={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function vG(G={}){let J=z.resolve(G.outputDir||".output"),K=G.port||3000,Q=t(J);if(!Q)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Q.routes.length} routes...`);let X=new Map,$=new Map,Z=new Map,U=new Map;for(let O of Q.routes)try{let N=z.join(J,O.compiledPath),j=JSON.parse(await Bun.file(N).text());X.set(O.pattern,j),Z.set(O.pattern,a(j.html)),U.set(O.pattern,s(j.html));let H=z.join(J,O.fragmentPath);if(await Bun.file(H).exists())$.set(O.pattern,await Bun.file(H).text())}catch(N){console.warn(`[stx] Failed to load route ${O.pattern}:`,N)}let _=new Map,I=[];for(let O of Q.routes)if(O.hasParams){let{regex:N,params:j}=r(O.pattern);I.push({regex:N,route:O,paramNames:j})}else _.set(O.pattern,O);let B=WG({port:K,async fetch(O){return n(O,await(async()=>{let j=new URL(O.url).pathname;if(G.onRequest){let W=await G.onRequest(O);if(W)return W}if(G.apiRoutes?.[j])return G.apiRoutes[j](O);if((O.method==="GET"||O.method==="HEAD")&&j!=="/"){let W=z.resolve(J,"public"),Y;try{Y=decodeURIComponent(j)}catch{Y=j}if(!Y.includes("\x00")){let D=z.resolve(W,`.${Y}`);if(D===W||D.startsWith(`${W}${z.sep}`))try{if(i.existsSync(D)&&i.statSync(D).isFile()){let A=z.extname(D).toLowerCase(),S=YG[A]||"application/octet-stream",M=j.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(j);return new Response(Bun.file(D),{headers:{"Content-Type":S,"Cache-Control":M?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let H=O.headers.get("X-STX-Router")==="true",L=null,P={};if(L=_.get(j)||null,!L)for(let{regex:W,route:Y,paramNames:D}of I){let w=j.match(W);if(w){L=Y,D.forEach((A,S)=>{P[A]=w[S+1]});break}}if(!L){let W=_.get("/404")||null;if(W){let Y=X.get(W.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(H){let W=$.get(L.pattern);if(W){let Y=Z.get(L.pattern);return new Response(W,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...U.has(L.pattern)?{"X-STX-Runtime":U.get(L.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},"Cache-Control":"no-cache"}})}}let F=q(O.method),V=X.get(L.pattern);if(!V){let W=_.get("/500")||null;if(W){let Y=X.get(W.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!F&&!V.hasServerScripts&&Object.keys(V.placeholders).length===0)return new Response(V.html,{status:V.status??200,headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:W,boundaries:Y,redirect:D,cookies:w,status:A,headers:S}=await l(V,{params:P,request:O,method:O.method});if(D)return h(D,w);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:b}=await import("./chunk-3v9drr1f.js");return b(T(W,Y,{timeoutMs:30000}),{status:A??V.status??200,headers:{"Cache-Control":"no-cache",...S}})}let M=new Headers({"Content-Type":"text/html","Cache-Control":"no-cache"});for(let T of w??[])M.append("Set-Cookie",T);for(let[T,b]of Object.entries(S??{}))M.set(T,b);return new Response(W,{status:A??V.status??200,headers:M})}catch(W){return console.error(`[stx] Hydration error for ${j}:`,W),new Response(V.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${K}`),console.log(`[stx] Serving ${Q.routes.length} routes (${X.size} pre-loaded)`),{port:K,stop:()=>B.stop()}}
|
|
3
|
+
export{ZG as ff,OG as gf,n as hf,k as if,o as jf,q as kf,g as lf,h as mf,zG as nf,l as of,BG as pf,vG as qf};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{su as Y}from"./chunk-z3cgw8j4.js";import{mkdir as O,writeFile as q}from"fs/promises";import{join as X}from"path";var T="https://api.iconify.design";async function k(){let E=await fetch(`${T}/collections`);if(!E.ok)throw Error(`Failed to fetch collections: ${E.statusText}`);return await E.json()}async function P(E,z){try{let U=Y.resolve("@iconify/json"),S=`${`${U.substring(0,U.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${E}.json`,M=Bun.file(S);if(await M.exists()){let V=await M.json();if(z&&z.length>0){let Z={};for(let L of z)if(V.icons[L])Z[L]=V.icons[L];return{...V,icons:Z}}return V}}catch{}let K=z&&z.length>0?`${T}/${E}.json?icons=${z.join(",")}`:`${T}/${E}.json`,Q=await fetch(K);if(!Q.ok)throw Error(`Failed to fetch icons for ${E}: ${Q.statusText}`);return await Q.json()}function j(E,z=24,K=24){return{body:E.body,width:E.width||z,height:E.height||K,viewBox:`0 0 ${E.width||z} ${E.height||K}`}}function F(E,z){let K=B(E);return`import type { IconData } from '@stacksjs/iconify-core'
|
|
3
3
|
|
|
4
4
|
export const ${K}: IconData = ${JSON.stringify(z,null,2)}
|
|
5
5
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ij as a,jj as b,kj as c,lj as d,mj as e,nj as f,oj as g,pj as h,qj as i,rj as j,sj as k,tj as l,uj as m,vj as n}from"./chunk-fc33v1qf.js";import"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ro as b,So as c,Wl as a}from"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{b as processESImports,c as processComponents,a as freeIdentifiers};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qf as a}from"./chunk-395dm3a0.js";import"./chunk-khxs70kb.js";import"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{a as startProductionServer};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{qs as B}from"./chunk-p5ktexx3.js";import I from"path";function M(z){if(!z)return!1;return z.trim().split(/\s+/)[0]?.toLowerCase()==="presentation"||z.trim().split(/\s+/)[0]?.toLowerCase()==="none"}function L(z,X){let J=new RegExp(`\\b${X}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i").exec(z);if(!J)return null;return J[2]??J[3]??J[4]??null}function h(z,X,J,K){let j=z;j=j.replace(/@a11y\(\s*['"]([^'"]+)['"]\s*(?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(Q,G,q)=>{let U={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[G]||"Make this element accessible";return`<!-- a11y-hint: ${q||U} -->`});let _=/@screenReader\(([^@]*)\)@endScreenReader/g;return j=j.replace(_,(Q,G)=>{return`<span class="sr-only">${G.trim()}</span>`}),j=j.replace(/@ariaDescribe\(\s*['"]([^'"]+)['"]\s*,\s*['"]([^'"]+)['"]\s*\)/g,(Q,G,q)=>{return`<span id="${`desc-${G}`}" class="sr-only">${q}</span>`}),j}function s(){return`
|
|
3
3
|
.sr-only {
|
|
4
4
|
position: absolute;
|
|
5
5
|
width: 1px;
|
|
@@ -12,4 +12,4 @@ import{gs as B}from"./chunk-khrtzbxd.js";import I from"path";function M(z){if(!z
|
|
|
12
12
|
border-width: 0;
|
|
13
13
|
}
|
|
14
14
|
`.trim()}function k(){return typeof globalThis.document<"u"&&typeof globalThis.document.createElement==="function"}function A(z){let X=new Map,J=z.replace(/<(\/?)([A-Z][\w:.-]*)(?=[\s/>])/g,(j,_,Q)=>{let G=X.get(Q);if(!G)G=`stx-a11y-component-${X.size}`,X.set(Q,G);return`<${_}${G}`}),K=new Map([...X.entries()].map(([j,_])=>[_,j]));return{protectedSource:J,restore:(j)=>j.replace(/<(\/?)(stx-a11y-component-\d+)(?=[\s/>])/g,(_,Q,G)=>{let q=K.get(G);return q?`<${Q}${q}`:_})}}function N(z,X){let J=[],K=/<img\s+([^>]*)>/gi,j;j=K.exec(z);while(j!==null){let Y=j[1];if(!/\balt\s*=/i.test(Y))J.push({type:"missing-alt",element:j[0].substring(0,100),message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"});j=K.exec(z)}let _=/<button([^>]*)>\s*<\/button>/gi;j=_.exec(z);while(j!==null){let Y=j[1];if(!/\baria-label\s*=/i.test(Y)&&!/\btitle\s*=/i.test(Y))J.push({type:"missing-accessible-name",element:j[0].substring(0,100),message:"Empty button missing accessible name",impact:"critical",help:"Add text content, aria-label, or title",helpUrl:"https://web.dev/learn/accessibility/aria-html/"});j=_.exec(z)}let Q=/<a\s+([^>]*)>\s*<\/a>/gi;j=Q.exec(z);while(j!==null){let Y=j[1];if(!/\baria-label\s*=/i.test(Y)&&!/\btitle\s*=/i.test(Y))J.push({type:"link-missing-text",element:j[0].substring(0,100),message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"});j=Q.exec(z)}let G=/<(input|select|textarea)\s+([^>]*)>/gi;j=G.exec(z);while(j!==null){let Y=j[2];if(/\btype\s*=\s*["']hidden["']/i.test(Y)){j=G.exec(z);continue}let W=/\baria-label\s*=/i.test(Y)||/\baria-labelledby\s*=/i.test(Y),E=Y.match(/\bid\s*=\s*["']([^"']+)["']/i);if(!W){let T=E&&new RegExp(`<label[^>]*\\bfor\\s*=\\s*["']${E[1]}["']`,"i").test(z),w=j.index,F=z.substring(0,w),f=z.substring(w),S=(F.match(/<label\b/gi)||[]).length,C=(F.match(/<\/label>/gi)||[]).length,P=S>C;if(!T&&!P)J.push({type:"input-missing-label",element:j[0].substring(0,100),message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})}j=G.exec(z)}let q=/<h([1-6])[^>]*>/gi,H=[];j=q.exec(z);while(j!==null)H.push(Number.parseInt(j[1],10)),j=q.exec(z);let U=0;for(let Y of H){if(U>0&&Y>U+1)J.push({type:"heading-skip",element:`<h${Y}>`,message:`Heading level skipped from h${U} to h${Y}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});U=Y}if(/<html\b/i.test(z)&&!/<html[^>]*\slang\s*=/i.test(z))J.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});let Z=/<table([^>]*)>([\s\S]*?)<\/table>/gi;j=Z.exec(z);while(j!==null){let Y=j[2];if(!M(L(j[1],"role"))&&!/<th\b/i.test(Y))J.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});j=Z.exec(z)}let O=/<(video|audio)[^>]*\sautoplay\s[^>]*>/gi;j=O.exec(z);while(j!==null){if(!/\bmuted\b/i.test(j[0]))J.push({type:"autoplay-audio",element:`<${j[1]}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"});j=O.exec(z)}let $=/\btabindex\s*=\s*["']([1-9]\d*)["']/gi;j=$.exec(z);while(j!==null)J.push({type:"positive-tabindex",element:`tabindex="${j[1]}"`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"}),j=$.exec(z);let V=/<iframe\s+([^>]*)>/gi;j=V.exec(z);while(j!==null){let Y=j[1];if(!/\btitle\s*=/i.test(Y)&&!/\baria-label\s*=/i.test(Y))J.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"});j=V.exec(z)}let D=/<([a-z]+)\s+([^>]*role\s*=\s*["']button["'][^>]*)>/gi;j=D.exec(z);while(j!==null){let Y=j[1].toLowerCase(),W=j[2];if(Y!=="button"&&!/\btabindex\s*=/i.test(W))J.push({type:"button-not-focusable",element:j[0].substring(0,100),message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"});j=D.exec(z)}return J}async function y(z,X){let{protectedSource:J}=A(z);if(!k())return N(J,X);let K=[];try{let j=globalThis.document.createElement("div");j.innerHTML=J,j.querySelectorAll("img").forEach((q)=>{if(!q.hasAttribute("alt"))K.push({type:"missing-alt",element:`<${q.outerHTML}>`,message:"Image missing alt attribute",impact:"serious",help:"Add alt text to images for screen readers",helpUrl:"https://web.dev/learn/accessibility/images/"})}),j.querySelectorAll('button, a, [role="button"]').forEach((q)=>{if(!(q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby")||q.textContent&&q.textContent.trim().length>0))K.push({type:"missing-accessible-name",element:`<${q.outerHTML}>`,message:"Interactive element missing accessible name",impact:"critical",help:"Add text content, aria-label, or aria-labelledby",helpUrl:"https://web.dev/learn/accessibility/aria-html/"})}),j.querySelectorAll("input, select, textarea").forEach((q)=>{let H=q.getAttribute("id"),U=H&&j.querySelector(`label[for="${H}"]`),Z=q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby"),O=q.closest("label")!==null;if(!U&&!Z&&!O)K.push({type:"input-missing-label",element:`<${q.outerHTML}>`,message:"Form input missing associated label",impact:"serious",help:"Associate a label with the input or use aria-label",helpUrl:"https://web.dev/learn/accessibility/forms/"})});let _=Array.from(j.querySelectorAll("h1, h2, h3, h4, h5, h6")),Q=0;for(let q of _){let H=Number.parseInt(q.tagName.charAt(1));if(Q>0&&H>Q+1)K.push({type:"heading-skip",element:`<${q.outerHTML}>`,message:`Heading level skipped from h${Q} to h${H}`,impact:"moderate",help:"Maintain proper heading hierarchy without skipping levels",helpUrl:"https://web.dev/learn/accessibility/structure/"});Q=H}let G=j.querySelector("html");if(J.includes("<html")&&G&&!G.hasAttribute("lang"))K.push({type:"missing-lang",element:"<html>",message:"Document language not specified",impact:"serious",help:"Add lang attribute to the html element",helpUrl:"https://web.dev/learn/accessibility/more-html/#language"});if(j.querySelectorAll("a").forEach((q)=>{let H=q.textContent&&q.textContent.trim().length>0,U=q.hasAttribute("aria-label")||q.hasAttribute("aria-labelledby"),Z=q.hasAttribute("title"),O=q.querySelector("img[alt]");if(!H&&!U&&!Z&&!O)K.push({type:"link-missing-text",element:`<${q.outerHTML}>`,message:"Link has no accessible text",impact:"serious",help:"Add text content, aria-label, or title to links",helpUrl:"https://web.dev/learn/accessibility/more-html/#links"})}),J.includes("<nav")||J.includes("<header")){if(!j.querySelector('a[href="#main"], a[href="#content"], .skip-link, [class*="skip"]')&&j.querySelectorAll("a").length>5)K.push({type:"missing-skip-link",element:"<nav>",message:"Consider adding a skip navigation link",impact:"minor",help:"Add a skip link to allow keyboard users to bypass navigation",helpUrl:"https://web.dev/learn/accessibility/focus/#skip-links"})}if(j.querySelectorAll("table").forEach((q)=>{if(M(q.getAttribute("role")))return;let H=q.querySelector("caption");if(!q.querySelector("th"))K.push({type:"table-missing-headers",element:"<table>",message:"Table missing header cells (th)",impact:"serious",help:"Use th elements for table headers",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"});if(!H&&!q.hasAttribute("aria-label")&&!q.hasAttribute("aria-labelledby"))K.push({type:"table-missing-caption",element:"<table>",message:"Table missing caption or accessible name",impact:"minor",help:"Add a caption element or aria-label to describe the table",helpUrl:"https://web.dev/learn/accessibility/more-html/#tables"})}),j.querySelectorAll('[style*="color"]').forEach((q)=>{let H=q.getAttribute("style")||"";if(H.includes("color:")&&!H.includes("background"))K.push({type:"potential-contrast-issue",element:`<${q.tagName.toLowerCase()}>`,message:"Element has inline color style - verify contrast ratio",impact:"minor",help:"Ensure text has sufficient contrast ratio (4.5:1 for normal text)",helpUrl:"https://web.dev/learn/accessibility/color-contrast/"})}),j.querySelectorAll("video[autoplay], audio[autoplay]").forEach((q)=>{if(!q.hasAttribute("muted"))K.push({type:"autoplay-audio",element:`<${q.tagName.toLowerCase()}>`,message:"Auto-playing media may disrupt users",impact:"moderate",help:"Add muted attribute or provide controls to stop playback",helpUrl:"https://web.dev/learn/accessibility/more-html/#multimedia"})}),j.querySelectorAll("[tabindex]").forEach((q)=>{if(Number.parseInt(q.getAttribute("tabindex")||"0")>0)K.push({type:"positive-tabindex",element:`<${q.tagName.toLowerCase()}>`,message:"Positive tabindex disrupts natural tab order",impact:"moderate",help:'Use tabindex="0" or "-1" instead of positive values',helpUrl:"https://web.dev/learn/accessibility/focus/#tab-index"})}),j.querySelectorAll('[role="button"]').forEach((q)=>{if(!q.hasAttribute("tabindex"))K.push({type:"button-not-focusable",element:`<${q.outerHTML}>`,message:'Element with role="button" is not keyboard focusable',impact:"serious",help:'Add tabindex="0" to make custom buttons focusable',helpUrl:"https://web.dev/learn/accessibility/focus/"})}),J.includes("<body")&&!j.querySelector('main, [role="main"]'))K.push({type:"missing-main-landmark",element:"<body>",message:"Document missing main landmark region",impact:"moderate",help:"Add a main element to identify the primary content",helpUrl:"https://web.dev/learn/accessibility/structure/#landmarks"});j.querySelectorAll("iframe").forEach((q)=>{if(!q.hasAttribute("title")&&!q.hasAttribute("aria-label"))K.push({type:"iframe-missing-title",element:"<iframe>",message:"Iframe missing title attribute",impact:"serious",help:"Add a title attribute to describe the iframe content",helpUrl:"https://web.dev/learn/accessibility/more-html/#frames"})})}catch(j){console.error(`Error checking accessibility in ${X}:`,j)}return K}async function R(z,X={}){let J={},{recursive:K=!0,ignorePaths:j=[]}=X,_=Array.isArray(z)?z:[z],Q=await B(_,{recursive:K,ignorePaths:j}),G=[];for(let q of Q)try{let H=await Bun.file(q).text();if(q.endsWith("good-a11y.stx"))continue;let U=await y(H,q);if(G.push(q),U.length>0)J[q]=U}catch(H){console.error(`Error scanning ${q}:`,H)}return{results:J,scannedFiles:G}}async function c(z,X={}){return(await R(z,X)).results}var b={fixMissingAlt:!0,fixMissingLabels:!0,fixMissingFormLabels:!0,fixTableHeaders:!0,fixMissingLang:!0,fixPositiveTabindex:!0,fixButtonFocusable:!0,defaultLang:"en"};function v(z,X={}){let J={...b,...X},K=[],{protectedSource:j,restore:_}=A(z),Q=j;if(J.fixMissingAlt)Q=Q.replace(/<img([^>]*?)(?<!\balt\s*=\s*["'][^"']*["'])(\s*\/?>)/gi,(G,q,H)=>{if(/\balt\s*=/i.test(q))return G;let U=G,Z=`<img${q} alt=""${H}`;return K.push({type:"missing-alt",description:"Added empty alt attribute to image",before:U,after:Z}),Z});if(J.fixMissingLabels)Q=Q.replace(/<button([^>]*)>\s*<\/button>/gi,(G,q)=>{if(/\baria-label\s*=/i.test(q)||/\btitle\s*=/i.test(q))return G;let H=G,U=`<button${q} aria-label="Button"></button>`;return K.push({type:"missing-accessible-name",description:"Added aria-label to empty button",before:H,after:U}),U}),Q=Q.replace(/<a([^>]*)>\s*(<(?:i|span|svg)[^>]*(?:class="[^"]*icon[^"]*")?[^>]*>.*?<\/(?:i|span|svg)>)?\s*<\/a>/gi,(G,q,H)=>{if(/\baria-label\s*=/i.test(q)||/\btitle\s*=/i.test(q))return G;if(!H&&G.replace(/<a[^>]*>|<\/a>/gi,"").trim())return G;let U=G,Z=`<a${q} aria-label="Link">${H||""}</a>`;return K.push({type:"missing-accessible-name",description:"Added aria-label to link without text",before:U,after:Z}),Z});if(J.fixMissingFormLabels)Q=Q.replace(/<(input|select|textarea)([^>]*)>/gi,(G,q,H)=>{if(/\baria-label\s*=/i.test(H)||/\baria-labelledby\s*=/i.test(H))return G;if(/\btype\s*=\s*["']hidden["']/i.test(H))return G;let U=H.match(/\bname\s*=\s*["']([^"']+)["']/i),Z=H.match(/\bid\s*=\s*["']([^"']+)["']/i),O=U?.[1]||Z?.[1]||q,$=G,V=`<${q}${H} aria-label="${O}">`;return K.push({type:"input-missing-label",description:`Added aria-label to ${q} element`,before:$,after:V}),V});if(J.fixMissingLang)Q=Q.replace(/<html([^>]*)>/gi,(G,q)=>{if(/\blang\s*=/i.test(q))return G;let H=G,U=`<html${q} lang="${J.defaultLang}">`;return K.push({type:"missing-lang",description:`Added lang="${J.defaultLang}" to html element`,before:H,after:U}),U});if(J.fixPositiveTabindex)Q=Q.replace(/\btabindex\s*=\s*["']([1-9]\d*)["']/gi,(G,q)=>{let H=G,U='tabindex="0"';return K.push({type:"positive-tabindex",description:`Changed tabindex="${q}" to tabindex="0"`,before:H,after:'tabindex="0"'}),'tabindex="0"'});if(J.fixButtonFocusable)Q=Q.replace(/<([a-z]+)(\s[^>]*role\s*=\s*["']button["'][^>]*)>/gi,(G,q,H)=>{if(/\btabindex\s*=/i.test(H))return G;if(q.toLowerCase()==="button")return G;let U=G,Z=`<${q}${H} tabindex="0">`;return K.push({type:"button-not-focusable",description:'Added tabindex="0" to element with role="button"',before:U,after:Z}),Z});if(J.fixTableHeaders)Q=Q.replace(/<th([^>]*)>/gi,(G,q)=>{if(/\bscope\s*=/i.test(q))return G;let H=G,U=`<th${q} scope="col">`;return K.push({type:"table-missing-scope",description:'Added scope="col" to table header',before:H,after:U}),U});return{original:z,fixed:_(Q),fixCount:K.length,fixes:K}}async function x(z,X={},J=!1){let K=await Bun.file(z).text(),j=v(K,X);if(J&&j.fixCount>0)await Bun.write(z,j.fixed);return j}async function m(z,X={},J={}){let K={},{recursive:j=!0,ignorePaths:_=[],writeBack:Q=!1,extensions:G=[".stx",".html",".htm"]}=J,q=G.length===1?`*${G[0]}`:`*{${G.join(",")}}`,H=I.join(z,j?`**/${q}`:q),U=new Bun.Glob(H);for await(let Z of U.scan()){if(_.some(($)=>Z.includes(I.normalize($))))continue;try{let $=await x(Z,X,Q);if($.fixCount>0)K[Z]=$}catch($){console.error(`Error fixing ${Z}:`,$)}}return K}var u={name:"a11y",handler:(z,X,J,K)=>{if(!X.length)return z;let j=X[0].replace(/['"]/g,""),_=X.length>1?X[1].replace(/['"]/g,""):"",G={"aria-label":"Ensure interactive elements have accessible labels","alt-text":"Provide alternative text for images",focus:"Ensure the element can receive keyboard focus",landmark:"Use appropriate landmark roles","heading-order":"Maintain proper heading hierarchy","color-contrast":"Ensure sufficient color contrast","keyboard-nav":"Make sure element is keyboard navigable","screen-reader":"Optimize for screen reader users"}[j]||"Make this element accessible";return`<!-- a11y-hint: ${_||G} -->${z}`},hasEndTag:!1},d={name:"screenReader",handler:(z)=>{return`<span class="sr-only">${z}</span>`},hasEndTag:!0};function r(){return[u,d]}
|
|
15
|
-
export{M as
|
|
15
|
+
export{M as as,L as bs,h as cs,s as ds,k as es,N as fs,y as gs,R as hs,c as is,v as js,x as ks,m as ls,u as ms,d as ns,r as os};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Tr as a,Ur as b,Vr as c,Wr as d,Xr as e,Yr as f}from"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ah as
|
|
2
|
+
import{Ah as h,Bh as i,Ch as j,Dh as k,th as a,uh as b,vh as c,wh as d,xh as e,yh as f,zh as g}from"./chunk-bhqcp8b0.js";import"./chunk-8dz63q4e.js";import"./chunk-z3cgw8j4.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Gf as t,Hf as u,If as v,Jf as w,Kf as x,Lf as y,Mf as z,Nf as A,Of as B,Pf as C,Qf as D,Rf as E}from"./chunk-j0bcnfbq.js";import{Sf as r,Tf as s}from"./chunk-6v2pfq30.js";import{ag as b,bg as c,cg as d,dg as e,eg as f,fg as g,gg as h,ig as i,jg as j,kg as k,lg as l,mg as m,ng as n,og as o,pg as p,qg as q}from"./chunk-vgtcj29n.js";import{dh as a}from"./chunk-vx8zk4yt.js";import"./chunk-xvh1k1a4.js";import"./chunk-z3cgw8j4.js";export{D as writeImageManifest,a as rewriteImagesWithSiblings,t as renderImageComponent,v as processImageComponents,g as processImage,u as parseImageComponent,A as optimizeImage,B as optimizeDirectory,e as isSharpAvailable,m as isImageFile,f as isImageBackendAvailable,y as imageDirective,r as handleImageRequest,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,h as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,C as generateImageManifest,p as formatSize,E as defaultImageConfig,z as createImagePlugin,s as createImageHandler,x as createImageDirective,w as clearImageCache,q as ImageProcessingError,b as DEFAULT_WIDTHS,d as DEFAULT_QUALITY,c as DEFAULT_FORMATS};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{df as a}from"./chunk-p6dtgqeq.js";import"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{a as startInteractive};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{g as
|
|
2
|
+
import{ng as T}from"./chunk-vgtcj29n.js";import{su as I}from"./chunk-z3cgw8j4.js";import E from"fs";import X from"path";import U from"crypto";var _=new Set(["webp","avif","jpeg","png"]),F=new Set(["cover","contain","fill","inside","outside"]),A=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),S=4096,y=80,D="cover";async function g(k,G){let J=G.routePath??"/_stx/img",B=new URL(k.url);if(B.pathname!==J)return null;let $=q(B,G);if(!$.ok)return new Response($.error,{status:$.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:j,srcUrl:K,width:H,height:v,format:Z,quality:Y,fit:z}=$,C;try{C=E.statSync(j)}catch{return new Response(`Source image not found: ${K}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!C.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let N=G.cacheDir??".stx/cache/img";await E.promises.mkdir(N,{recursive:!0});let V=`${j}:${C.mtimeMs}:${C.size}`,O=`${H}x${v}:${Z}:${Y}:${z}`,b=U.createHash("sha256").update(`${V}|${O}`).digest("hex").slice(0,16),Q=X.join(N,`${b}.${Z}`),W={"Content-Type":T(Z),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${b}"`,"X-Stx-Image-Cache":"HIT"};if(k.headers.get("if-none-match")===`"${b}"`)return new Response(null,{status:304,headers:W});let L=Bun.file(Q);if(await L.exists())return new Response(L,{headers:W});try{let R=Buffer.from(await Bun.file(j).arrayBuffer()),{resizeAndConvert:M}=await P(),w=await M(R,{width:H,height:v,format:Z,quality:Y,fit:z});return await Bun.write(Q,w),W["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(w),{headers:W})}catch(R){let M=R.message;return new Response(`Image processing failed: ${M}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function l(k){return async(G)=>{return await g(G,k)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}}function q(k,G){let J=k.searchParams.get("src");if(!J)return{ok:!1,error:"Missing required param: src",status:400};if(!J.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(J.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let B=X.extname(J).toLowerCase();if(!A.has(B))return{ok:!1,error:`Unsupported source extension: ${B}`,status:400};let $=X.resolve(G.publicDir),j=X.resolve($,J.slice(1));if(!j.startsWith(`${$}${X.sep}`)&&j!==$)return{ok:!1,error:"src is outside publicDir",status:400};let K=G.maxWidth??S,H=G.maxHeight??S,v=k.searchParams.get("w"),Z=k.searchParams.get("h"),Y=v?Number.parseInt(v,10):0,z=Z?Number.parseInt(Z,10):0;if(v&&(!Number.isFinite(Y)||Y<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(Z&&(!Number.isFinite(z)||z<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!v&&!Z)return{ok:!1,error:"At least one of w or h is required",status:400};let C=Math.min(Y||K,K),N=Math.min(z||H,H),V=k.searchParams.get("f")||"webp";if(!_.has(V))return{ok:!1,error:`Invalid f (must be one of: ${[..._].join(", ")})`,status:400};let O=V,b=k.searchParams.get("q"),Q=b?Number.parseInt(b,10):G.defaultQuality??y;if(!Number.isFinite(Q)||Q<1||Q>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let x=k.searchParams.get("fit")||G.defaultFit||D;if(!F.has(x))return{ok:!1,error:`Invalid fit (must be one of: ${[...F].join(", ")})`,status:400};return{ok:!0,srcFsPath:j,srcUrl:J,width:C,height:N,format:O,quality:Q,fit:x}}async function P(){return await import("./chunk-71kpxn5y.js")}
|
|
3
|
+
export{g as Sf,l as Tf};
|
|
@@ -394,4 +394,4 @@ else {
|
|
|
394
394
|
${JSON.stringify(j)}
|
|
395
395
|
</script>
|
|
396
396
|
`}var r={processPartialHydrationDirectives:b,processStaticDirectives:x,generatePartialHydrationCSS:H,generateIslandManifest:y,createIslandRegistry:f,hydrateIsland:S,hydrateByStrategy:h,hydrateAll:g,isHydrated:v,onHydrated:u};
|
|
397
|
-
export{B as
|
|
397
|
+
export{B as li,I as mi,E as ni,V as oi,f as pi,b as qi,H as ri,S as si,h as ti,g as ui,v as vi,u as wi,x as xi,y as yi,r as zi};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ag as a,bg as b,cg as c,dg as d,eg as e,fg as f,gg as g,hg as h,ig as i,jg as j,kg as k,lg as l,mg as m,ng as n,og as o,pg as p,qg as q}from"./chunk-vgtcj29n.js";import"./chunk-z3cgw8j4.js";export{h as resizeAndConvert,f as processImage,d as isSharpAvailable,m as isImageFile,e as isImageBackendAvailable,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,g as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,p as formatSize,q as ImageProcessingError,a as DEFAULT_WIDTHS,c as DEFAULT_QUALITY,b as DEFAULT_FORMATS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yi as _,Zi as v,_i as U}from"./chunk-c23nyjd0.js";import{Eq as T,Hl as C,Il as N,Jl as E,Vr as S}from"./chunk-m3dcd2j3.js";import{ot as y}from"./chunk-n09vpazf.js";import L from"path";var j=new Map,M=new Map,b=["composables","functions"];function K(V){let J=L.basename(V,".ts");return J==="index"||J==="types"||V.endsWith(".d.ts")}async function F(V){if(V)return L.resolve(V);let J=`<default>:${process.cwd()}`,Q=M.get(J);if(Q!==void 0)return Q;let z=await h();if(z!==null)M.set(J,z);return z}async function h(){let V=await S(),J=V.root||process.cwd(),Q=V.composablesDir;if(Q)return L.resolve(J,Q);for(let z of b){let Z=L.resolve(J,z);try{let W=new Bun.Glob("**/*.ts");for await(let Y of W.scan({cwd:Z,absolute:!0}))if(!K(Y))return Z}catch{}}return null}async function s(V){let J=await F(V);if(!J)return[];let Q=[];try{let W=new Bun.Glob("**/*.ts");for await(let Y of W.scan({cwd:J,absolute:!0}))if(!K(Y))Q.push(Y)}catch{return[]}Q.sort();let z=T({loader:"ts",target:"browser",define:E()}),Z=[];for(let W of Q)try{let Y=await Bun.file(W).text(),G=z.scan(Y).exports.filter(($)=>$!=="default");if(G.length>0)Z.push({file:W,names:G})}catch{}return Z}function u(V,J){return new RegExp(`\\b${J.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(V)}function f(V,J,Q){let z=new Map;for(let{file:G,names:$}of V)for(let O of $)if(!z.has(O))z.set(O,G);let Z=(G)=>{let $=[];for(let[O,P]of z)if(u(G,O))$.push(P);return $},W=new Set,Y=Z(Q);while(Y.length>0){let G=[];for(let $ of Y){if(W.has($))continue;W.add($);for(let O of Z(J.get($)??""))if(!W.has(O))G.push(O)}Y=G}return W}async function i(V,J){let Q=await F(V);if(!Q)return null;let z=[];try{let q=new Bun.Glob("**/*.ts");for await(let H of q.scan({cwd:Q,absolute:!0})){if(K(H))continue;z.push(H)}}catch{return U(j,Q,"",""),null}let Z=_(z);if(z.length===0)return U(j,Q,Z,""),null;z.sort();let W=T({loader:"ts",target:"browser",define:E()}),Y=new Map,G=[];for(let q of z)try{let H=await Bun.file(q).text();Y.set(q,H);let w=W.scan(H).exports.filter((X)=>X!=="default");if(w.length>0)G.push({file:q,names:w})}catch{Y.set(q,"")}let $=J===void 0?new Set(z):f(G,Y,J);if($.size===0)return null;let O=z.filter((q)=>$.has(q)),P=`${Q}\x00${O.join("\x00")}`,B=v(j,P,Z);if(B!==void 0)return B||null;let A=[],R=new Set,I=new Set;for(let q of O)try{let H=Y.get(q)??await Bun.file(q).text(),w=L.basename(q,".ts");for(let X of H.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])I.add(X[1]);try{for(let X of W.scan(H).exports)if(X!=="default")R.add(X)}catch{}H=C(H),H=N(H),H=H.replace(/^export\s+(default\s+)?/gm,""),H=W.transformSync(H),A.push(`// Composable: ${w}
|
|
3
3
|
${H.trim()}`)}catch(H){console.warn(`[stx] Failed to load composable ${q}:`,H)}if(A.length===0||R.size===0)return U(j,P,Z,""),null;let D=[...R].map((q)=>` try { __c[${JSON.stringify(q)}] = ${q}; } catch (e) {}`).join(`
|
|
4
4
|
`),g=JSON.stringify([...R]),k=A.join(`
|
|
5
5
|
|
|
@@ -25,4 +25,4 @@ ${D}
|
|
|
25
25
|
window[__n] = __c[__n];
|
|
26
26
|
}
|
|
27
27
|
})();`;return U(j,P,Z,x),x}function o(){j.clear(),M.clear()}
|
|
28
|
-
export{s as
|
|
28
|
+
export{s as Vi,i as Wi,o as Xi};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{mk as m}from"./chunk-hkh1d5m5.js";import{su as z}from"./chunk-z3cgw8j4.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -3019,4 +3019,4 @@ Terminal=false
|
|
|
3019
3019
|
Categories=Utility;
|
|
3020
3020
|
Icon=${$.toLowerCase()}
|
|
3021
3021
|
`;z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.desktop`),_);let E=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.png`),E),J.icon&&s(J.icon))F(J.icon,Z(Y,`${$.toLowerCase()}.png`));let H=j("appimagetool",[Y,U],{env:{...process.env,ARCH:"x86_64"}});H.on("close",(x)=>{if(z("fs").rmSync(K,{recursive:!0,force:!0}),x===0)A(U,493),W({success:!0});else W({success:!1,error:`appimagetool exited with code ${x}. Install from https://appimage.github.io/appimagetool/`})}),H.on("error",(x)=>{z("fs").rmSync(K,{recursive:!0,force:!0}),W({success:!1,error:`appimagetool not found: ${x.message}`})})}catch(K){W({success:!1,error:K.message})}})}function Vq(){return[I()]}function Fq(q){switch(q){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var Aq={buildNative:Qq,getAvailableTargets:Vq,getAvailableFormats:Fq,detectPlatform:I},cq=Aq;
|
|
3022
|
-
export{Iq as
|
|
3022
|
+
export{Iq as Wj,D as Xj,Cq as Yj,yq as Zj,N as _j,b as $j,h as ak,bq as bk,u as ck,Pq as dk,vq as ek,Qq as fk,Vq as gk,Fq as hk,cq as ik};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ej as _}from"./chunk-dve5ehgr.js";function Y(q,z){let B={};for(let C of q)B[C]=_(z(C));return new Proxy({},{get:(C,G)=>B[G]?.(),set:(C,G,L)=>{if(B[G])B[G].set(L);else B[G]=_(L);return!0},has:(C,G)=>(G in B),deleteProperty:(C,G)=>{return delete B[G],!0},ownKeys:()=>Reflect.ownKeys(B),getOwnPropertyDescriptor:(C,G)=>(G in B)?{enumerable:!0,configurable:!0,writable:!0,value:B[G]()}:void 0})}function T(q,z){let B={};for(let C of z)B[C]=q[C];return B}function $(q,z){let B=Object.keys(q),C=Y(B,(I)=>z?.[I]??q[I].getDefaultValue()),G=Y(B,()=>[]),L=Y(B,()=>!1),W=Y(B,()=>!1),X=Y(B,()=>!1),J=_(!1);async function M(I){X[I]=!0;let Q=await q[I].validate(C[I],C);return G[I]=Q,X[I]=!1,Q.length===0}async function O(){J.set(!0);let I=await Promise.all(B.map(M));return J.set(!1),I.every(Boolean)}function j(){for(let I of B)C[I]=z?.[I]??q[I].getDefaultValue(),G[I]=[],L[I]=!1,W[I]=!1}function A(I){for(let Q of B)if(Q in I)C[Q]=I[Q],W[Q]=!0}function H(I,Q){C[I]=Q,W[I]=!0}function K(I,Q=!0){if(L[I]=Q,Q)M(I)}function U(I){return{value:C[I],errors:G[I],touched:L[I],dirty:W[I],valid:G[I].length===0,validating:X[I]}}function k(I){return async(Q)=>{Q?.preventDefault?.();for(let N of B)L[N]=!0;if(await O())await I(T(C,B))}}return{values:C,errors:G,touched:L,dirty:W,get isValid(){return B.every((I)=>G[I].length===0)},get isValidating(){return J()||B.some((I)=>X[I])},get isDirty(){return B.some((I)=>W[I])},validate:O,validateField:M,reset:j,setValues:A,setFieldValue:H,setFieldTouched:K,getFieldState:U,handleSubmit:k}}var E=$;class Z{rules=[];defaultValue="";addRule(q){let z=new Z;return z.rules=[...this.rules,q],z.defaultValue=this.defaultValue,z}required(q="This field is required"){return this.addRule({name:"required",message:q,validate:(z)=>{if(z===null||z===void 0)return q;if(typeof z==="string"&&z.trim()==="")return q;if(Array.isArray(z)&&z.length===0)return q;return!0}})}email(q="Please enter a valid email"){return this.addRule({name:"email",message:q,validate:(z)=>{if(!z)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(z))||q}})}url(q="Please enter a valid URL"){return this.addRule({name:"url",message:q,validate:(z)=>{if(!z)return!0;try{return new URL(String(z)),!0}catch{return q}}})}min(q,z){let B=z||`Must be at least ${q} characters`;return this.addRule({name:"min",message:B,validate:(C)=>{if(!C)return!0;return String(C).length>=q||B}})}max(q,z){let B=z||`Must be no more than ${q} characters`;return this.addRule({name:"max",message:B,validate:(C)=>{if(!C)return!0;return String(C).length<=q||B}})}length(q,z,B){let C=B||`Must be between ${q} and ${z} characters`;return this.addRule({name:"length",message:C,validate:(G)=>{if(!G)return!0;let L=String(G).length;return L>=q&&L<=z||C}})}pattern(q,z="Invalid format"){return this.addRule({name:"pattern",message:z,validate:(B)=>{if(!B)return!0;return q.test(String(B))||z}})}hasUppercase(q="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,q)}hasLowercase(q="Must contain a lowercase letter"){return this.pattern(/[a-z]/,q)}hasNumber(q="Must contain a number"){return this.pattern(/\d/,q)}hasSpecial(q="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,q)}alphanumeric(q="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,q)}startsWithLetter(q="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,q)}noSpaces(q="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:q,validate:(z)=>{if(!z)return!0;return!String(z).includes(" ")||q}})}number(q="Must be a number"){let z=this.addRule({name:"number",message:q,validate:(B)=>{if(!B&&B!==0)return!0;return!Number.isNaN(Number(B))||q}});return z.defaultValue=0,z}integer(q="Must be a whole number"){return this.addRule({name:"integer",message:q,validate:(z)=>{if(!z&&z!==0)return!0;return Number.isInteger(Number(z))||q}})}positive(q="Must be a positive number"){return this.addRule({name:"positive",message:q,validate:(z)=>{if(!z&&z!==0)return!0;return Number(z)>0||q}})}negative(q="Must be a negative number"){return this.addRule({name:"negative",message:q,validate:(z)=>{if(!z&&z!==0)return!0;return Number(z)<0||q}})}minValue(q,z){let B=z||`Must be at least ${q}`;return this.addRule({name:"minValue",message:B,validate:(C)=>{if(!C&&C!==0)return!0;return Number(C)>=q||B}})}maxValue(q,z){let B=z||`Must be no more than ${q}`;return this.addRule({name:"maxValue",message:B,validate:(C)=>{if(!C&&C!==0)return!0;return Number(C)<=q||B}})}between(q,z,B){let C=B||`Must be between ${q} and ${z}`;return this.addRule({name:"between",message:C,validate:(G)=>{if(!G&&G!==0)return!0;let L=Number(G);return L>=q&&L<=z||C}})}matches(q,z){let B=z||`Must match ${q}`;return this.addRule({name:"matches",message:B,validate:(C,G)=>{if(!G)return!0;return C===G[q]||B}})}oneOf(q,z){let B=z||`Must be one of: ${q.join(", ")}`;return this.addRule({name:"oneOf",message:B,validate:(C)=>{if(!C)return!0;return q.includes(C)||B}})}notOneOf(q,z){let B=z||`Cannot be one of: ${q.join(", ")}`;return this.addRule({name:"notOneOf",message:B,validate:(C)=>{if(!C)return!0;return!q.includes(C)||B}})}date(q="Must be a valid date"){return this.addRule({name:"date",message:q,validate:(z)=>{if(!z)return!0;let B=new Date(String(z));return!Number.isNaN(B.getTime())||q}})}before(q,z){let B=new Date(q),C=z||`Must be before ${B.toLocaleDateString()}`;return this.addRule({name:"before",message:C,validate:(G)=>{if(!G)return!0;return new Date(String(G))<B||C}})}after(q,z){let B=new Date(q),C=z||`Must be after ${B.toLocaleDateString()}`;return this.addRule({name:"after",message:C,validate:(G)=>{if(!G)return!0;return new Date(String(G))>B||C}})}custom(q,z="Invalid value"){return this.addRule({name:"custom",message:z,validate:q})}async(q,z="Invalid value"){return this.addRule({name:"async",message:z,async:!0,validate:q})}when(q,z){let B=new Z;B.rules=[...this.rules],B.defaultValue=this.defaultValue;for(let C of z.getRules())B.rules.push({...C,validate:(G,L)=>{if(!q(G,L||{}))return!0;return C.validate(G,L)}});return B}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(q){let z=new Z;return z.rules=[...this.rules],z.defaultValue=q,z}async validate(q,z){let B=[];for(let C of this.rules){let G=await C.validate(q,z);if(G!==!0)B.push(G)}return B}validateSync(q,z){let B=[];for(let C of this.rules){if(C.async)continue;let G=C.validate(q,z);if(G!==!0)B.push(G)}return B}}var y=new Z;function w(q,z,B){let C=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return q.replace(C,(G,L,W)=>{try{let X=L.trim().split("."),J=z;for(let O of X)if(J&&typeof J==="object"&&O in J)J=J[O];else return"";let M=J;if(!M||!Array.isArray(M)||M.length===0)return"";return M.map((O)=>{return W.replace(/\{\{\s*message\s*\}\}/g,O)}).join(`
|
|
3
3
|
`)}catch{return""}})}function D(q,z,B){let C=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return q.replace(C,(G,L,W)=>{try{let X=L.trim().split("."),J=z;for(let O of X)if(J&&typeof J==="object"&&O in J)J=J[O];else return"";let M=J;if(!M||!Array.isArray(M)||M.length===0)return"";return M.map((O)=>W.replace(/\{\{\s*message\s*\}\}/g,O)).join(`
|
|
4
|
-
`)}catch{return""}})}function S(q,z,B){let C=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return q.replace(C,(G,L,W)=>{try{let X=L.trim().split("."),J=z;for(let O of X)if(J&&typeof J==="object"&&O in J)J=J[O];else return"";let M=J;if(!M||!Array.isArray(M)||M.length===0)return"";return W}catch{return""}})}function V(q,z,B){let C=q;return C=w(C,z,B),C=D(C,z,B),C=S(C,z,B),C}export{$ as
|
|
4
|
+
`)}catch{return""}})}function S(q,z,B){let C=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return q.replace(C,(G,L,W)=>{try{let X=L.trim().split("."),J=z;for(let O of X)if(J&&typeof J==="object"&&O in J)J=J[O];else return"";let M=J;if(!M||!Array.isArray(M)||M.length===0)return"";return W}catch{return""}})}function V(q,z,B){let C=q;return C=w(C,z,B),C=D(C,z,B),C=S(C,z,B),C}export{$ as Ai,E as Bi,Z as Ci,y as Di,w as Ei,D as Fi,S as Gi,V as Hi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{createHash as Y}from"crypto";import{readFile as M,stat as w}from"fs/promises";async function G(q){try{let z=await M(q);return Y("sha256").update(z).digest("hex").slice(0,16)}catch{return""}}function u(q){return Y("sha256").update(q).digest("hex").slice(0,16)}function $(q){return Y("sha256").update(q).digest("hex").slice(0,16)}function X(q,z){let B=JSON.stringify(z,Object.keys(z).sort());return`${$(q)}-${$(B)}`}async function Z(q){try{return(await w(q)).mtimeMs}catch{return 0}}async function b(q){try{return await w(q),!0}catch{return!1}}import{mkdir as S,readFile as V,writeFile as E,readdir as A,rm as _,stat as j}from"fs/promises";import{join as U,dirname as x}from"path";var R=new Map,W={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function F(q){try{await S(q,{recursive:!0})}catch{}}function K(q,z,B){return U(q,B,`${z}.json`)}async function v(q,z,B){if((Date.now()-q.createdAt)/86400000>B)return!1;if(await Z(z)!==q.srcMtime)return!1;return!0}async function g(q,z,B,J=W){if(!J.enabled)return null;let I=X(q,z),L=R.get(I);if(L){if(await v(L,q,J.maxAge))return L.lastAccessedAt=Date.now(),L.data;R.delete(I)}let Q=K(J.directory,I,B);if(await b(Q))try{let N=await V(Q,"utf-8"),O=JSON.parse(N);if(await v(O,q,J.maxAge))return O.lastAccessedAt=Date.now(),R.set(I,O),O.data}catch{}return null}async function l(q,z,B,J,I=W){if(!I.enabled)return;let L=X(q,z),Q=await G(q),N=await Z(q),O={key:L,src:q,srcHash:Q,srcMtime:N,optionsHash:X("",z),data:B,createdAt:Date.now(),lastAccessedAt:Date.now()};R.set(L,O);let T=K(I.directory,L,J);try{await F(x(T)),await E(T,JSON.stringify(O,null,2))}catch(H){console.warn(`[stx-media] Failed to write cache: ${H}`)}}async function m(q,z=W){if(q==="all")R.clear();else R.clear();let B=q==="all"?["image","video"]:[q];for(let J of B){let I=U(z.directory,J);try{await _(I,{recursive:!0,force:!0})}catch{}}}async function y(q=W){let z={memoryEntries:R.size,diskEntries:{image:0,video:0},totalSizeMB:0};for(let B of["image","video"]){let J=U(q.directory,B);try{let I=await A(J);z.diskEntries[B]=I.length;for(let L of I){let Q=U(J,L),N=await j(Q);z.totalSizeMB+=N.size/1048576}}catch{}}return z}async function f(q=W){let z=0,B=q.maxAge*24*60*60*1000;for(let J of["image","video"]){let I=U(q.directory,J);try{let L=await A(I);for(let Q of L){let N=U(I,Q);try{let O=await V(N,"utf-8"),T=JSON.parse(O);if(Date.now()-T.createdAt>B)await _(N),R.delete(T.key),z++}catch{await _(N).catch(()=>{}),z++}}}catch{}}return z}
|
|
3
|
-
export{G as
|
|
3
|
+
export{G as Eh,u as Fh,$ as Gh,X as Hh,Z as Ih,b as Jh,g as Kh,l as Lh,m as Mh,y as Nh,f as Oh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$k as i,Tk as a,Uk as b,Vk as c,Wk as d,Xk as e,Yk as f,Zk as g,_k as h}from"./chunk-n98pfm3h.js";import"./chunk-ap23bgyb.js";import"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{a as shouldLogBundlerDiagnostics,e as setBundlerFallbackMode,f as resolveBundlerFallback,b as recordBundleFailure,h as queueClientBundleBuild,g as hasUserImports,c as getBundleFailures,d as clearBundleFailures,i as bundleClientScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yi as j,Zi as E,_i as Z}from"./chunk-c23nyjd0.js";import{Eq as L,Hl as R,Il as U,Jl as X,Vr as M}from"./chunk-m3dcd2j3.js";import{ot as P}from"./chunk-n09vpazf.js";import $ from"path";var V=new Map;function w(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let Y=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(Y))z.add(Y)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let K=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}}async function u(Q){let z;if(Q)z=$.resolve(Q);else{let q=await M();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(V,z,"",""),null}let K=j(H),Y=E(V,z,K);if(Y!==void 0)return Y||null;if(H.length===0)return Z(V,z,K,""),null;let x=[];for(let q of H){let y=await Bun.file(q).text();x.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}x.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let I=x.map((q)=>q.file),A=[],B=new Set,T=L({loader:"ts",target:"browser",define:X()});for(let q of I)try{let y=await Bun.file(q).text(),W=$.basename(q,".ts");w(y,B),y=R(y),y=U(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=T.transformSync(y),A.push(`// Store: ${W}
|
|
3
3
|
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(A.length===0)return Z(V,z,K,""),null;let G=A.join(`
|
|
4
4
|
|
|
5
5
|
`),O=`;(function(){
|
|
@@ -8,4 +8,4 @@ ${P.filter((q)=>!B.has(q)&&new RegExp(`\\b${q}\\b`).test(G)).map((q)=>`var ${q}
|
|
|
8
8
|
`)}
|
|
9
9
|
${G}
|
|
10
10
|
})();`;return Z(V,z,K,O),O}function g(){V.clear()}
|
|
11
|
-
export{u as
|
|
11
|
+
export{u as Ti,g as Ui};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Eq as x,Jl as Y}from"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";import A from"path";var C=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],y=new Set(C);var Z=new Map,I=new Set,P=new Set(C);function R(){Z.clear()}function D(G){let H=new Map;for(let z of G){let K=A.basename(z);if(K.endsWith(".d.ts"))continue;let J=K.replace(/\.[jt]s$/,"");if(J==="index")continue;if(J===K)continue;let X=H.get(J);if(X&&!X.endsWith(".js"))continue;H.set(J,z)}return[...H.values()].sort()}function L(G,H){let z=H.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${z}\\b`).test(G)}function k(G){if(!G)return[];let H=G.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),z=[];for(let K of P){if(I.has(K))continue;let J=K.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${J}\\s*\\(`).test(H))z.push(K)}return z.sort()}async function _(G,H){let z=k(G);if(z.length===0)return null;let K=H??A.join(import.meta.dir,"composables"),J=`${K}\x00${z.join(",")}`,X=Z.get(J);if(X!==void 0)return X||null;let T=x({loader:"ts",target:"browser",define:Y()}),B=new Set(z),F=[],w=new Set,$=[];try{let q=new Bun.Glob("*.{ts,js}");for await(let j of q.scan({cwd:K,absolute:!0}))$.push(j)}catch{return Z.set(J,""),null}$=D($);for(let q of $){let j;try{j=await Bun.file(q).text()}catch{continue}let W=[];try{W=T.scan(j).exports.filter((Q)=>Q!=="default")}catch{continue}if(!W.some((Q)=>B.has(Q)))continue;try{j=j.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^import\s+type\s+.*$/gm,""),j=j.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),j=j.replace(/^export\s+default\s+/gm,""),j=j.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),F.push(`// ${A.basename(q).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${T.transformSync(j).trim()}`);for(let Q of W)w.add(Q)}catch(Q){console.warn(`[stx] framework composable ${A.basename(q)} could not be bundled:`,Q)}}let U=z.filter((q)=>!w.has(q)&&!L(G,q));if(U.length>0)console.warn(`[stx] could not bundle ${U.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(F.length===0)return Z.set(J,""),null;let M=[...w].map((q)=>` try { if (!(${JSON.stringify(q)} in __s)) { __s[${JSON.stringify(q)}] = ${q}; if (!(${JSON.stringify(q)} in window)) window[${JSON.stringify(q)}] = ${q}; } } catch (e) {}`).join(`
|
|
4
4
|
`),V=`<script data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{M as
|
|
2
|
+
import{Vr as E}from"./chunk-m3dcd2j3.js";import{su as D}from"./chunk-z3cgw8j4.js";import I from"path";async function M(q={}){let G=performance.now(),J=q.root||process.cwd(),j=await E(),y=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${y.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(y==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,...q.ssg})}else{let{buildForProduction:z}=await import("./chunk-t1fqr070.js");B=await z({outputDir:".output",debug:q.debug,...q.ssr})}let H=Math.round(performance.now()-G);return{mode:y,ssg:A,ssr:B,duration:H}}
|
|
3
|
+
export{M as ef};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
`)}function s(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function g(G,q){let Q={...G};for(let[J,Y]of Object.entries(q))Q[J]=s(Y)&&s(Q[J])?g(Q[J],Y):Y;return Q}function e(G={},q={}){let Q=G.theme||{},J=q.theme||{},{extend:Y,...Z}=J,{extend:U,...z}=Q,X=z.colors||{};z.colors={...X,...o(X)};let A=g(z,Z),L=g(U||{},Y||{});if(Object.keys(L).length>0)A.extend=L;let H=[...G.safelist||[],...q.safelist||[]],E={...G.shortcuts||{},...q.shortcuts||{}},P=[...G.preflights||[],...q.preflights||[]];return{config:{...G,...q,theme:A,safelist:H,shortcuts:E,...P.length>0?{preflights:P}:{},content:[],output:""},safelist:H,shortcuts:E,includePreflight:q.preflight!==!1,minify:q.minify===!0,tokenCSS:t(X)}}var W={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 F=null,C=!1,_=null,b="",K=!1,Qq=256,V=new Map,O=new Map,j=null,d=null;function S(G){return Bun.hash(G).toString(16).padStart(16,"0").slice(0,16)}function u(G,q){if(V.has(G))V.delete(G);else if(V.size>=Qq)V.delete(V.keys().next().value);V.set(G,q)}function Wq(G){let q=S(G);if(O.has(q))O.delete(q);else if(O.size>=Qq)O.delete(O.keys().next().value);return O.set(q,G),q}function Dq(G){let q=O.get(G);if(q===void 0)return;return O.delete(G),O.set(G,q),q}async function Xq(G){if(!j)return null;try{let q=Bun.file($.join(j,`cw-${S(G)}.css`));if(!await q.exists())return null;return await q.text()}catch{return null}}async function zq(G,q){if(!j)return;try{if(!fs.existsSync(j))fs.mkdirSync(j,{recursive:!0});await Bun.write($.join(j,`cw-${S(G)}.css`),q)}catch{}}async function qq(G){try{let q=await import(G);if(q&&q.CSSGenerator)return{CSSGenerator:q.CSSGenerator,config:q.config,build:q.build,defaultConfig:q.defaultConfig,extractClasses:q.extractClasses}}catch{}return null}function Iq(){let G=[],q=process.cwd();while(q!==$.dirname(q))G.push($.join(q,"node_modules","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"node_modules","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"pantry","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"pantry","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"node_modules","@stacksjs","crosswind","dist","index.js")),G.push($.join(q,"pantry","@stacksjs","crosswind","dist","index.js")),q=$.dirname(q);return G}function Oq(){let G=[],q=process.env.HOME||process.env.USERPROFILE||"";if(q){let Q=[$.join(q,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),$.join(q,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];G.push(...Q)}return G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),G}async function Yq(){if(C)return F;C=!0;try{let G=async(Y)=>{for(let Z of Y){if(!await Bun.file(Z).exists())continue;let U=await qq(Z);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded from ${$.dirname($.dirname(Z))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Y=$.resolve(process.env.CROSSWIND_SRC),Z=await G([Y]);if(!Z)throw Error(`CROSSWIND_SRC did not resolve to a Crosswind module: ${Y}`);return F=Z,F}let q=await G(Iq());if(q)return F=q,F;let Q=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Y of Q){let Z=await qq(Y);if(Z){if(F=Z,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded`);return F}}let J=await G(Oq());if(J)return F=J,F;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${W.reset}`),null}}function Sq(){V.clear(),O.clear()}function xq(){F=null,C=!1,_=null,b="",V.clear(),O.clear(),d=null}async function Zq(G){try{if(!Uq({name:"crosswind",cwd:G}))return null;let{loadConfigWithResult:q}=await import("bunfig"),Q=await q({name:"crosswind",cwd:G,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Q?.path||!Q.config||Object.keys(Q.config).length===0)return null;let J=$.relative(G,Q.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} Loaded config from ${J||Q.path}`);return Q.config}catch(q){if(q instanceof Error&&q.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[Crosswind]${W.reset} Failed to load crosswind config:`,q instanceof Error?q.message:q),null}}async function _q(G){let q=null;try{let{loadStxConfig:Q}=await import("./chunk-
|
|
2
|
+
import{Ws as Jq}from"./chunk-cnkex10g.js";import{su as Gq}from"./chunk-z3cgw8j4.js";import $ from"path";import{hasLocalConfig as Uq}from"bunfig";var a={fg:{light:"gray-900",dark:"gray-100",description:"Primary text"},"fg-strong":{light:"gray-700",dark:"gray-300",description:"Labels, secondary headings"},"fg-muted":{light:"gray-600",dark:"gray-400",description:"Supporting text"},"fg-soft":{light:"gray-500",dark:"gray-400",description:"De-emphasised text"},"fg-subtle":{light:"gray-400",dark:"gray-500",description:"Placeholders, disabled text"},surface:{light:"gray-50",dark:"gray-800",description:"Page and panel background"},"surface-raised":{light:"gray-100",dark:"gray-700",description:"Cards, popovers"},"surface-sunken":{light:"gray-200",dark:"gray-700",description:"Wells, track backgrounds"},line:{light:"gray-200",dark:"gray-700",description:"Default border, divider"},"line-strong":{light:"gray-300",dark:"gray-600",description:"Input border, focus ring track"},accent:{light:"indigo-600",dark:"indigo-400",description:"Primary action, selected state"},info:{light:"blue-600",dark:"blue-400",description:"Informational emphasis, links"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-500",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"indigo-600",dark:"indigo-500",description:"Primary button fill"},"info-solid":{light:"blue-600",dark:"blue-500",description:"Informational fill"},"danger-solid":{light:"red-600",dark:"red-500",description:"Destructive button fill"},"success-solid":{light:"green-600",dark:"green-500",description:"Confirmation fill"}};function m(G){return`--stx-${G}`}function p(G,q){let Q=q.lastIndexOf("-");if(Q===-1)return typeof G[q]==="string"?G[q]:void 0;let J=G[q.slice(0,Q)];if(!J||typeof J!=="object")return;let Y=J[q.slice(Q+1)];return typeof Y==="string"?Y:void 0}function o(G){let q={};for(let[Q,J]of Object.entries(a)){let Y=p(G,J.light);if(Y===void 0)continue;q[Q]=`var(${m(Q)}, ${Y})`}return q}function t(G){let q=[],Q=[];for(let[J,Y]of Object.entries(a)){let Z=p(G,Y.light),U=p(G,Y.dark);if(Z===void 0)continue;if(q.push(` ${m(J)}: ${Z};`),U!==void 0)Q.push(` ${m(J)}: ${U};`)}if(q.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...q,"}",".dark {",...Q,"}",""].join(`
|
|
3
|
+
`)}function s(G){return typeof G==="object"&&G!==null&&!Array.isArray(G)}function g(G,q){let Q={...G};for(let[J,Y]of Object.entries(q))Q[J]=s(Y)&&s(Q[J])?g(Q[J],Y):Y;return Q}function e(G={},q={}){let Q=G.theme||{},J=q.theme||{},{extend:Y,...Z}=J,{extend:U,...z}=Q,X=z.colors||{};z.colors={...X,...o(X)};let A=g(z,Z),L=g(U||{},Y||{});if(Object.keys(L).length>0)A.extend=L;let H=[...G.safelist||[],...q.safelist||[]],E={...G.shortcuts||{},...q.shortcuts||{}},P=[...G.preflights||[],...q.preflights||[]];return{config:{...G,...q,theme:A,safelist:H,shortcuts:E,...P.length>0?{preflights:P}:{},content:[],output:""},safelist:H,shortcuts:E,includePreflight:q.preflight!==!1,minify:q.minify===!0,tokenCSS:t(X)}}var W={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 F=null,C=!1,_=null,b="",K=!1,Qq=256,V=new Map,O=new Map,j=null,d=null;function S(G){return Bun.hash(G).toString(16).padStart(16,"0").slice(0,16)}function u(G,q){if(V.has(G))V.delete(G);else if(V.size>=Qq)V.delete(V.keys().next().value);V.set(G,q)}function Wq(G){let q=S(G);if(O.has(q))O.delete(q);else if(O.size>=Qq)O.delete(O.keys().next().value);return O.set(q,G),q}function Dq(G){let q=O.get(G);if(q===void 0)return;return O.delete(G),O.set(G,q),q}async function Xq(G){if(!j)return null;try{let q=Bun.file($.join(j,`cw-${S(G)}.css`));if(!await q.exists())return null;return await q.text()}catch{return null}}async function zq(G,q){if(!j)return;try{if(!fs.existsSync(j))fs.mkdirSync(j,{recursive:!0});await Bun.write($.join(j,`cw-${S(G)}.css`),q)}catch{}}async function qq(G){try{let q=await import(G);if(q&&q.CSSGenerator)return{CSSGenerator:q.CSSGenerator,config:q.config,build:q.build,defaultConfig:q.defaultConfig,extractClasses:q.extractClasses}}catch{}return null}function Iq(){let G=[],q=process.cwd();while(q!==$.dirname(q))G.push($.join(q,"node_modules","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"node_modules","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"pantry","@cwcss","crosswind","dist","index.js")),G.push($.join(q,"pantry","@cwcss","crosswind","src","index.ts")),G.push($.join(q,"node_modules","@stacksjs","crosswind","dist","index.js")),G.push($.join(q,"pantry","@stacksjs","crosswind","dist","index.js")),q=$.dirname(q);return G}function Oq(){let G=[],q=process.env.HOME||process.env.USERPROFILE||"";if(q){let Q=[$.join(q,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),$.join(q,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),$.join(q,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),$.join(q,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];G.push(...Q)}return G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),G.push($.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),G}async function Yq(){if(C)return F;C=!0;try{let G=async(Y)=>{for(let Z of Y){if(!await Bun.file(Z).exists())continue;let U=await qq(Z);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded from ${$.dirname($.dirname(Z))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Y=$.resolve(process.env.CROSSWIND_SRC),Z=await G([Y]);if(!Z)throw Error(`CROSSWIND_SRC did not resolve to a Crosswind module: ${Y}`);return F=Z,F}let q=await G(Iq());if(q)return F=q,F;let Q=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Y of Q){let Z=await qq(Y);if(Z){if(F=Z,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} CSS engine loaded`);return F}}let J=await G(Oq());if(J)return F=J,F;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${W.reset}`),null}}function Sq(){V.clear(),O.clear()}function xq(){F=null,C=!1,_=null,b="",V.clear(),O.clear(),d=null}async function Zq(G){try{if(!Uq({name:"crosswind",cwd:G}))return null;let{loadConfigWithResult:q}=await import("bunfig"),Q=await q({name:"crosswind",cwd:G,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Q?.path||!Q.config||Object.keys(Q.config).length===0)return null;let J=$.relative(G,Q.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[Crosswind]${W.reset} Loaded config from ${J||Q.path}`);return Q.config}catch(q){if(q instanceof Error&&q.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[Crosswind]${W.reset} Failed to load crosswind config:`,q instanceof Error?q.message:q),null}}async function _q(G){let q=null;try{let{loadStxConfig:Q}=await import("./chunk-4v8358s4.js"),J=await Q(G);if(J.css)if(typeof J.css==="string"){let Y=$.isAbsolute(J.css)?J.css:$.resolve(G,J.css);if(await Bun.file(Y).exists()){let Z=await import(Y);q=Z.default||Z,console.log(`${W.green}[Crosswind]${W.reset} Loaded config from stx.config.ts \u2192 ${J.css}`)}}else{if(q={...J.css,content:J.css.content||[],preflight:J.css.preflight??!0,minify:J.css.minify??!1},J.css.config){let Y=$.isAbsolute(J.css.config)?J.css.config:$.resolve(G,J.css.config);if(await Bun.file(Y).exists()){let Z=await import(Y);q={...Z.default||Z,...q}}}console.log(`${W.green}[Crosswind]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return q||await Zq(G)}function Fq(G){try{let q=new WeakSet;return S(JSON.stringify(G??{},(Q,J)=>{if(typeof J==="function")return`[fn]${String(J)}`;if(typeof J==="object"&&J!==null){if(q.has(J))return"[circular]";q.add(J)}return J})??"")}catch{return"unhashable"}}async function Nq(G){if(K)return b;K=!0;try{let q=await Yq();if(!q||!q.build)return K=!1,"";if(!_)_=await Zq(G);if(!_)return K=!1,"";let Q=q.defaultConfig?.theme||{},J=_.theme||{},Y={...q.defaultConfig,..._,theme:{...Q,...J,extend:{...Q.extend||{},...J.extend||{}}}},Z=performance.now(),U=await q.build(Y),z=performance.now()-Z;if(b=U.css,console.log(`${W.cyan}[Crosswind]${W.reset} Built ${U.classes.size} classes in ${z.toFixed(1)}ms`),Y.output){let X=$.isAbsolute(Y.output)?Y.output:$.join(G,Y.output),A=$.dirname(X);if(!fs.existsSync(A))fs.mkdirSync(A,{recursive:!0});await Bun.write(X,U.css)}return K=!1,U.css}catch(q){return console.error(`${W.red}[Crosswind]${W.reset} Build error:`,q),K=!1,b}}async function kq(G){_=null,await Nq(G)}function wq(){return b}function Vq(G){let q=new Set,Q=/class\s*=\s*["']([^"']+)["']/gi,J=Q.exec(G);while(J!==null){for(let U of J[1].split(/\s+/))if(U.trim())q.add(U.trim());J=Q.exec(G)}let Y=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,Z=Y.exec(G);while(Z!==null){let U=Z[1].match(/'([^']+)'/g);if(U){for(let z of U)for(let X of z.slice(1,-1).split(/\s+/))if(X.trim())q.add(X.trim())}Z=Y.exec(G)}return q}async function jq(G,q){try{let Q=await Yq();if(!Q)return"";let J=typeof Q.extractClasses==="function"?Q.extractClasses(G):Vq(G);if(J.size===0)return"";let Y=q?$.resolve(q):process.cwd();if(!j)j=Jq(Y,"cache");let Z=[...J].sort().join(" "),U=`${d||"default"}::${Z}`,z=V.get(U);if(z!==void 0)return u(U,z),z;let X=await Xq(U);if(X!==null)return u(U,X),X;if(!_)_=await _q(Y),d=Fq(_);let A=Q.defaultConfig||Q.config,L=_||{},H=e(A,L),{safelist:E,includePreflight:P,minify:x,tokenCSS:$q}=H,h=H.config,R=new Q.CSSGenerator(h);for(let I of E)R.generate(I);for(let I of J)R.generate(I);let N=R.toCSS(P,x),i=h.shortcuts||L.shortcuts||{};for(let[I,k]of Object.entries(i)){if(!J.has(I)&&!E.includes(I))continue;let w=k.split(/\s+/).filter(Boolean);for(let T of w)R.generate(T)}N=R.toCSS(P,x);let B=N.split(`
|
|
4
4
|
`);for(let[I,k]of Object.entries(i)){if(!J.has(I)&&!E.includes(I))continue;let w=k.split(/\s+/).filter(Boolean),T=[],y=[];for(let v of w){let c=v.startsWith("dark:"),n=`.${(c?v.slice(5):v).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let M=0;M<B.length;M++){let l=B[M].trim();if(l===`${n} {`||l.startsWith(`${n} {`)){let D=M,r="";while(D<B.length){if(r+=B[D],B[D].includes("}"))break;D++}let f=r.match(/\{([^}]+)\}/);if(f)if(c)y.push(f[1].trim());else T.push(f[1].trim());break}}}if(T.length)N+=`
|
|
5
5
|
.${I} { ${T.join(" ")} }`;if(y.length)N+=`
|
|
6
6
|
@media (prefers-color-scheme: dark) { .dark .${I} { ${y.join(" ")} } }`}return N=$q+N,u(U,N),zq(U,N),N}catch(Q){return console.warn("Failed to generate Crosswind CSS:",Q),""}}async function yq(G,q,Q=!1){let J=await jq(G,q);if(!J)return G;let Y=Q?`<link data-crosswind="generated" rel="stylesheet" href="/_stx/crosswind.${Wq(J)}.css">`:`<style data-crosswind="generated">
|
|
@@ -8,4 +8,4 @@ ${J}
|
|
|
8
8
|
</style>`,Z=/(?:<style\b[^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*>)/g;if(Z.test(G)){let U=!1;return G.replace(Z,()=>{if(U)return"";return U=!0,Y})}if(G.includes("</head>"))return G.replace("</head>",`${Y}
|
|
9
9
|
</head>`);if(G.includes("<body"))return G.replace(/<body([^>]*)>/,`<body$1>
|
|
10
10
|
${Y}`);return Y+G}
|
|
11
|
-
export{g as
|
|
11
|
+
export{g as Cs,e as Ds,W as Es,Dq as Fs,Yq as Gs,Sq as Hs,xq as Is,Zq as Js,_q as Ks,Fq as Ls,Nq as Ms,kq as Ns,wq as Os,Vq as Ps,jq as Qs,yq as Rs};
|
|
@@ -348,4 +348,4 @@ else {
|
|
|
348
348
|
console.log('[stx] Keep-alive runtime initialized');
|
|
349
349
|
})();
|
|
350
350
|
`}function Z(f){if(typeof document<"u")document.addEventListener("stx:activated",(j)=>{f(j.detail)})}function _(f){if(typeof document<"u")document.addEventListener("stx:deactivated",(j)=>{f(j.detail)})}
|
|
351
|
-
export{Q as
|
|
351
|
+
export{Q as Zh,T as _h,W as $h,X as ai,Y as bi,Z as ci,_ as di};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-z3cgw8j4.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ii as a,Ji as b,Ki as c,Li as d,Mi as e,Ni as f,Oi as g,Pi as h,Qi as i,Ri as j,Si as k}from"./chunk-2w1qaf5b.js";import"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Vi as a,Wi as b,Xi as c}from"./chunk-7az4zfm8.js";import"./chunk-c23nyjd0.js";import"./chunk-m3dcd2j3.js";import"./chunk-4q17c8sg.js";import"./chunk-p5ktexx3.js";import"./chunk-kqdrjd0e.js";import"./chunk-xvh1k1a4.js";import"./chunk-9tmcj4y7.js";import"./chunk-cnkex10g.js";import"./chunk-n98zvmdq.js";import"./chunk-fk1qyjdw.js";import"./chunk-n09vpazf.js";import"./chunk-0kj7rses.js";import"./chunk-k0cqdptr.js";import"./chunk-z3cgw8j4.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
|