@stacksjs/stx 0.2.231 → 0.2.232
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-0h46e2ng.js +2 -0
- package/dist/{chunk-0h08j951.js → chunk-17kxd17m.js} +1 -1
- package/dist/{chunk-z6ev72qj.js → chunk-1gdzz04h.js} +1 -1
- package/dist/{chunk-pw21r03f.js → chunk-1h0twjzw.js} +2 -2
- package/dist/{chunk-nstqd54d.js → chunk-1kg9sz9a.js} +1 -1
- package/dist/{chunk-zpvva2dh.js → chunk-1nztpv0g.js} +2 -2
- package/dist/chunk-1x91733n.js +2 -0
- package/dist/{chunk-pq6rgbbw.js → chunk-264rn67f.js} +2 -2
- package/dist/chunk-27m136s4.js +2 -0
- package/dist/{chunk-njc6sven.js → chunk-2fspj91j.js} +1 -1
- package/dist/{chunk-ge69r310.js → chunk-2tew0h6f.js} +1 -1
- package/dist/{chunk-f0yhv8yr.js → chunk-2v320r60.js} +2 -2
- package/dist/{chunk-m38wyaes.js → chunk-2w64hysh.js} +2 -2
- package/dist/chunk-33zg81y6.js +2 -0
- package/dist/{chunk-ep2agtrk.js → chunk-35ezbs7m.js} +1 -1
- package/dist/chunk-3j404s9z.js +2 -0
- package/dist/{chunk-vr04z80c.js → chunk-3sy1cf6v.js} +1 -1
- package/dist/{chunk-n58aem37.js → chunk-3zdkcdvf.js} +2 -2
- package/dist/{chunk-by2p4by1.js → chunk-4awxsp8f.js} +2 -2
- package/dist/{chunk-mjv4ar2y.js → chunk-5cjnfn8d.js} +1 -1
- package/dist/chunk-5k5qczgz.js +2 -0
- package/dist/{chunk-h2fq4ksg.js → chunk-5v3dv3xv.js} +2 -2
- package/dist/{chunk-dn8x6vf7.js → chunk-6ea3th9j.js} +155 -155
- package/dist/chunk-6k94kwfr.js +2 -0
- package/dist/{chunk-c9v94scd.js → chunk-6qhezn34.js} +1 -1
- package/dist/{chunk-kqjxwz6c.js → chunk-74r77tz1.js} +2 -2
- package/dist/chunk-7dznwvcy.js +2 -0
- package/dist/{chunk-bqdbf8k2.js → chunk-7kpfk426.js} +2 -2
- package/dist/chunk-7t4yc43k.js +2 -0
- package/dist/{chunk-vs7843yp.js → chunk-81zcv66r.js} +1 -1
- package/dist/{chunk-8hdb7abn.js → chunk-87rj95tw.js} +3 -3
- package/dist/{chunk-5mrs8cs2.js → chunk-8m7fhky6.js} +1 -1
- package/dist/{chunk-snktca7b.js → chunk-94fee5jw.js} +1 -1
- package/dist/{chunk-8tth46zf.js → chunk-9agksxkk.js} +2 -2
- package/dist/chunk-aeyrfcn5.js +2 -0
- package/dist/{chunk-w6h9c3f6.js → chunk-akm700yc.js} +1 -1
- package/dist/chunk-anc397f7.js +2 -0
- package/dist/chunk-b1rj6fk4.js +2 -0
- package/dist/{chunk-kf2w2xxb.js → chunk-b34x0v3f.js} +2 -2
- package/dist/{chunk-cq6fsp6j.js → chunk-b6jhznkh.js} +1 -1
- package/dist/{chunk-zdrpkrgc.js → chunk-bjs711qv.js} +1 -1
- package/dist/chunk-bnwpg6fg.js +2 -0
- package/dist/{chunk-z6e0b8wv.js → chunk-c5411vve.js} +2 -2
- package/dist/{chunk-m54yzzn8.js → chunk-cs1dc1n7.js} +1 -1
- package/dist/chunk-cv0z0qpy.js +2 -0
- package/dist/{chunk-e6tvnnnz.js → chunk-d19bydks.js} +1 -1
- package/dist/{chunk-4xzmg2xk.js → chunk-d2x4ma3m.js} +2 -2
- package/dist/chunk-ddqzxbkr.js +2 -0
- package/dist/chunk-dkt2rq3s.js +2 -0
- package/dist/{chunk-74pjj8d0.js → chunk-dq88kv1p.js} +1 -1
- package/dist/{chunk-e63m9jhd.js → chunk-dtfgxjy9.js} +4 -4
- package/dist/{chunk-d729yxzx.js → chunk-dvb8vgfe.js} +2 -2
- package/dist/chunk-dxepdtt2.js +2 -0
- package/dist/{chunk-d550gf3h.js → chunk-eb9caxff.js} +1 -1
- package/dist/chunk-ege2zbez.js +2 -0
- package/dist/{chunk-39hy7f4g.js → chunk-eqbr4jnw.js} +2 -2
- package/dist/{chunk-70v7vvry.js → chunk-evv58hf5.js} +1 -1
- package/dist/{chunk-v4rgwxs1.js → chunk-exaa3t0c.js} +2 -2
- package/dist/chunk-f3r3x3bh.js +2 -0
- package/dist/{chunk-82qd7jw1.js → chunk-f48gnx24.js} +1 -1
- package/dist/{chunk-6pzgmp1h.js → chunk-fexeqbkk.js} +2 -2
- package/dist/{chunk-8hnyynhv.js → chunk-fgfb9fs0.js} +1 -1
- package/dist/{chunk-c0n802j1.js → chunk-frp9fc7j.js} +1 -1
- package/dist/{chunk-swy03mg9.js → chunk-fvjh7rx0.js} +1 -1
- package/dist/{chunk-dxd830pt.js → chunk-fzxjrdnv.js} +1 -1
- package/dist/chunk-g5bhgv8m.js +2 -0
- package/dist/{chunk-vwwn4h5j.js → chunk-geztp3y3.js} +1 -1
- package/dist/{chunk-6345zcg6.js → chunk-gjapb8k6.js} +1 -1
- package/dist/{chunk-0yw0x5qz.js → chunk-gtek2yzx.js} +1 -1
- package/dist/{chunk-jewcmcaf.js → chunk-gzf1dg38.js} +2 -2
- package/dist/{chunk-xcac3tkq.js → chunk-hh6yxbyv.js} +1 -1
- package/dist/{chunk-rhkwswq0.js → chunk-hjdqejae.js} +1 -1
- package/dist/{chunk-a2ppgamd.js → chunk-hk8j3eps.js} +1 -1
- package/dist/{chunk-efr3ejqt.js → chunk-ht51fz7w.js} +1 -1
- package/dist/{chunk-jw1besrt.js → chunk-j93x5fzs.js} +1 -1
- package/dist/{chunk-z87q7ee7.js → chunk-jd90twtr.js} +1 -1
- package/dist/chunk-js0r6bc9.js +2 -0
- package/dist/{chunk-jcped0kt.js → chunk-jy6madxa.js} +1 -1
- package/dist/{chunk-wvc7t11n.js → chunk-kaet6r9w.js} +1 -1
- package/dist/chunk-mgexc8xe.js +2 -0
- package/dist/{chunk-dmzc008f.js → chunk-mxva4zmq.js} +1 -1
- package/dist/chunk-nebfw3pc.js +2 -0
- package/dist/{chunk-k6b7gpk2.js → chunk-nhmq45hh.js} +1 -1
- package/dist/{chunk-572ttrsj.js → chunk-ntnv2f7a.js} +1 -1
- package/dist/chunk-pe06ke3f.js +2 -0
- package/dist/{chunk-s88yt309.js → chunk-pv9at6r1.js} +1 -1
- package/dist/{chunk-nf4tx374.js → chunk-pwfqgvyf.js} +2 -2
- package/dist/chunk-q253eftn.js +2 -0
- package/dist/chunk-q9p451rb.js +2 -0
- package/dist/chunk-qh9bw4w4.js +2 -0
- package/dist/chunk-qj0jaw5s.js +2 -0
- package/dist/{chunk-exr6hs21.js → chunk-qpt60465.js} +1 -1
- package/dist/chunk-qq5xar6q.js +2 -0
- package/dist/{chunk-5ys0zfgp.js → chunk-qsdv9c1c.js} +2 -2
- package/dist/{chunk-m0sgdvnk.js → chunk-r23ycexh.js} +1 -1
- package/dist/{chunk-ncvd7673.js → chunk-r84h7wxw.js} +1 -1
- package/dist/{chunk-9edt3qh6.js → chunk-rbke5wqk.js} +1 -1
- package/dist/{chunk-7qx5ebq7.js → chunk-rmrxs0qz.js} +2 -2
- package/dist/chunk-s9669ak6.js +2 -0
- package/dist/{chunk-72w4hhbq.js → chunk-ssfhndm6.js} +1 -1
- package/dist/chunk-t68jcajf.js +2 -0
- package/dist/{chunk-6rjc6687.js → chunk-tbr46jye.js} +2 -2
- package/dist/chunk-tdj3gqaa.js +2 -0
- package/dist/{chunk-dn4gw490.js → chunk-ts9swsgf.js} +1 -1
- package/dist/chunk-ttmtwp1x.js +2 -0
- package/dist/{chunk-a6nnbnmb.js → chunk-tv4n71jy.js} +2 -2
- package/dist/{chunk-x7v6xqz9.js → chunk-v2qx1jrb.js} +1 -1
- package/dist/{chunk-z44ra321.js → chunk-v80629x2.js} +1 -1
- package/dist/{chunk-0vzvd62b.js → chunk-vgf3zdpb.js} +1 -1
- package/dist/{chunk-b72rxkbf.js → chunk-vw7h103c.js} +2 -2
- package/dist/{chunk-5d4csjhx.js → chunk-vzskgbqj.js} +1 -1
- package/dist/{chunk-58at6vf3.js → chunk-ww9sz124.js} +1 -1
- package/dist/{chunk-myh6j9ab.js → chunk-xaqjtned.js} +1 -1
- package/dist/{chunk-t0jzk81v.js → chunk-xgtcq9bj.js} +1 -1
- package/dist/{chunk-6t89bck2.js → chunk-xkeyq622.js} +1 -1
- package/dist/{chunk-ty6pj7b5.js → chunk-xvmvbkwy.js} +187 -185
- package/dist/{chunk-tgcbjer0.js → chunk-y7z44vr9.js} +2 -2
- package/dist/chunk-ymnt0ze7.js +2 -0
- package/dist/{chunk-6k9e6vfx.js → chunk-ypajs9wd.js} +1 -1
- package/dist/chunk-yqtc8ax6.js +2 -0
- package/dist/{chunk-q891e1vj.js → chunk-yx8vftp0.js} +1 -1
- package/dist/{chunk-d62d38ss.js → chunk-z9tj6jq7.js} +1 -1
- package/dist/{chunk-tdt7b8kg.js → chunk-znjrab9a.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/includes.js +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/pwa.js +2 -2
- package/dist/signal-processing.d.ts +17 -0
- package/dist/signal-processing.js +5 -1
- package/dist/site-builder/build.js +3 -1
- package/dist/site-builder/i18n.d.ts +18 -0
- package/dist/site-builder/i18n.js +10 -0
- package/dist/site-builder/index.d.ts +1 -0
- package/dist/site-builder/index.js +1 -0
- package/dist/ssg.js +4 -4
- package/dist/utils.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-18e804vq.js +0 -2
- package/dist/chunk-38dwv9n5.js +0 -2
- package/dist/chunk-3h7exkbb.js +0 -2
- package/dist/chunk-47v621t0.js +0 -2
- package/dist/chunk-4j0fwfej.js +0 -2
- package/dist/chunk-5n44cxqv.js +0 -2
- package/dist/chunk-72ywcwe8.js +0 -2
- package/dist/chunk-7hdjf2d8.js +0 -2
- package/dist/chunk-7vj34efv.js +0 -2
- package/dist/chunk-800m4ehs.js +0 -2
- package/dist/chunk-8n8ae329.js +0 -2
- package/dist/chunk-8tekg302.js +0 -2
- package/dist/chunk-8ybja3e1.js +0 -2
- package/dist/chunk-ayv6vby2.js +0 -2
- package/dist/chunk-ccam7wfn.js +0 -2
- package/dist/chunk-d8efym0s.js +0 -2
- package/dist/chunk-fk4waw6p.js +0 -2
- package/dist/chunk-h23wts30.js +0 -2
- package/dist/chunk-h9z3rfk8.js +0 -2
- package/dist/chunk-hrdps19s.js +0 -2
- package/dist/chunk-ht4wqwr6.js +0 -2
- package/dist/chunk-hwvzkhbe.js +0 -2
- package/dist/chunk-k4ejba6b.js +0 -2
- package/dist/chunk-m29rat2r.js +0 -2
- package/dist/chunk-q9v240z7.js +0 -2
- package/dist/chunk-qn2hsdy5.js +0 -2
- package/dist/chunk-r1ym4dxv.js +0 -2
- package/dist/chunk-sc3bz0z7.js +0 -2
- package/dist/chunk-smr28g8g.js +0 -2
- package/dist/chunk-t13jx2p3.js +0 -2
- package/dist/chunk-t7had6e0.js +0 -2
- package/dist/chunk-vmx4f37f.js +0 -2
- package/dist/chunk-wkmd8pfh.js +0 -2
- package/dist/chunk-z4msg4y0.js +0 -2
- package/dist/chunk-zs9j4xyx.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Is as Y}from"./chunk-1kg9sz9a.js";import{Ct as N}from"./chunk-xaqjtned.js";import C from"path";var O=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function x(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function R(K){let J=[],Q=x(K);O.lastIndex=0;let Z;while((Z=O.exec(Q))!==null){let j=(Z[1]||"").trim(),F=(Z[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=(Z[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=Z.index+F,$=Z.index+Z[0].length-z,U=K.slice(W,$);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let G=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",X=B(K,W);J.push({kind:G,code:U,startLine:X,attrs:j})}return J}function B(K,J){let Q=1;for(let Z=0;Z<J&&Z<K.length;Z++)if(K.charCodeAt(Z)===10)Q++;return Q}function M(K,J){let Q=K.lastIndexOf(`
|
|
3
3
|
`,J-1)+1;return J-Q+1}function k(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
|
|
4
4
|
`)J[z]=" "},Z=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of Z){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function T(K){let J=0,Q="";for(let Z=0;Z<K.length;Z++){let j=K[Z];if(Q){if(j==="\\"){Z++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[Z+1]==="|"){Z++;continue}if(K[Z-1]==="|")continue;return K.slice(0,Z)}}return K}var L=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,g="__stx_interpolated",D="__StxElement",A="__StxTemplateValue",E=`type ${A}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function P(K){return K.replace(/\{\{[\s\S]*?\}\}/g,g).replace(/\{!![\s\S]*?!!\}/g,g)}function Zj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
|
|
5
5
|
`).length-1,Z=J.length-Q;return`0${" ".repeat(Math.max(0,Z-1))}${`
|
|
@@ -19,4 +19,4 @@ import{Gs as Y}from"./chunk-nstqd54d.js";import{At as N}from"./chunk-myh6j9ab.js
|
|
|
19
19
|
`))z($);for(let $ of d().split(`
|
|
20
20
|
`))z($);for(let $ of a)z(`declare var ${$}: any`);z(`declare var ${g}: any`);let W=new Set(Q.flatMap(($)=>V($.code)));z(`type ${D}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let $ of p(K)){if(W.has($.name))continue;let U=$.iterable&&W.has($.iterable)?`${D}<typeof ${$.iterable}>`:"any";z(`declare var ${$.name}: ${U}`)}}if(J.templateExpressions!==!1){let W=h(K).map(($)=>({expression:$,statement:t($)})).filter(($)=>$.statement!==null);if(W.length>0){let U=[...new Set(Q.flatMap((G)=>V(G.code)))].filter((G)=>/^[A-Z_$][\w$]*$/i.test(G)),q=0;if(U.length>0){z(E);for(let G of U)z(`type __StxT_${G} = ${A}<typeof ${G}>`);z(`;((${U.map((G)=>`${G}: __StxT_${G}`).join(", ")}) => {`),q=1}for(let{expression:G,statement:X}of W){let H=" ".repeat(q);z(H+X.text,{line:G.line,column:G.column,expression:G,prefixLength:X.prefixLength+H.length})}if(q>0)z("});")}}return z("export {}"),{text:j.join(`
|
|
21
21
|
`),lineMap:F,sourceLineCount:Z.length}}function Gj(K,J,Q){let Z=K.lineMap.get(J);if(!Z)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-(Z.prefixLength??0));return{line:Z.line,column:Z.column+j,expression:Z.expression}}
|
|
22
|
-
export{R as
|
|
22
|
+
export{R as Mf,Zj as Nf,$j as Of,h as Pf,V as Qf,d as Rf,zj as Sf,Wj as Tf,jj as Uf,Fj as Vf,Gj as Wf};
|
|
@@ -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-yx8vftp0.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
function G(q){if(!q||typeof q!=="object")return!1;let z=q;return typeof z.message==="string"&&(z.name==="BuildMessage"||z.name==="ResolveMessage"||("position"in z))}function H(q){if(q&&typeof q==="object"&&Array.isArray(q.errors))return q.errors;return[q]}function I(q,z){let j=[];for(let A of H(q)){if(G(A)){let D=A.position||void 0;j.push({file:z||D?.file,line:D?.line,column:D?.column,message:A.message??"",lineText:D?.lineText});continue}j.push({file:z,message:A instanceof Error?A.message:String(A)})}return j}function J(q,z){return I(q,z).map((j)=>{let A=j.file?`${j.file}${j.line?`:${j.line}${j.column?`:${j.column}`:""}`:""}`:"",D=j.lineText?`
|
|
3
3
|
${j.lineText.trim()}`:"";return A?`${A}: ${j.message}${D}`:`${j.message}${D}`}).join(`
|
|
4
4
|
`)}
|
|
5
|
-
export{I as
|
|
5
|
+
export{I as gl,J as hl};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import G from"path";var L=new Set([".jpg",".jpeg",".png",".gif"]),O=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function M(j,z){let H=z.formats??O;if(!z.publicDir)return j;let C=N(j),J=[],Y=/<img\b[^>]*?>/gi,K=[],Q;while((Q=Y.exec(j))!==null){let q=Q[0],y=q.match(/\bsrc=["']([^"']+)["']/i);if(!y)continue;if(_(Q.index,C))continue;K.push({idx:Q.index,length:q.length,src:y[1],raw:q})}if(K.length===0)return j;let Z=await Promise.all(K.map(async(q)=>{let y=await X(q.src,z.publicDir,H);return{match:q,sources:y}}));for(let{match:q,sources:y}of Z){if(y.length===0)continue;let I=`<picture>${y.map(($)=>`<source type="${$.mime}" srcset="${w($.url)}">`).join("")}${q.raw}</picture>`;J.push({start:q.idx,end:q.idx+q.length,replacement:I})}if(J.length===0)return j;let V="",W=0;for(let q of J)V+=j.slice(W,q.start),V+=q.replacement,W=q.end;return V+=j.slice(W),V}async function X(j,z,H){if(!F(j))return[];let C=G.extname(j).toLowerCase();if(!L.has(C))return[];if(!j.startsWith("/"))return[];let J=G.join(z,j.slice(1)),Y=G.dirname(J),K=G.basename(J,C),Q=G.resolve(Y),Z=G.resolve(z);if(!Q.startsWith(Z))return[];let V=G.posix.dirname(j),W=H.map(async(y)=>{let k=G.join(Y,`${K}${y.ext}`);if(!await Bun.file(k).exists())return null;return{url:G.posix.join(V,`${K}${y.ext}`),mime:y.mime}});return(await Promise.all(W)).filter((y)=>y!==null)}function F(j){if(!j)return!1;if(j.startsWith("http://")||j.startsWith("https://"))return!1;if(j.startsWith("//"))return!1;if(j.startsWith("data:"))return!1;return!0}function N(j){let z=[],H=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,C;while((C=H.exec(j))!==null)z.push([C.index,C.index+C[0].length]);return z}function _(j,z){for(let[H,C]of z)if(j>=H&&j<C)return!0;return!1}function w(j){return j.replace(/&/g,"&").replace(/"/g,""")}
|
|
3
|
-
export{M as
|
|
3
|
+
export{M as Ch};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bg as b,Kg as JJ,yg as t,zg as e}from"./chunk-tgcbjer0.js";import{Nm as u,Om as l,ap as g,fm as y,gm as P,lq as o,pm as x,wm as v}from"./chunk-dn8x6vf7.js";import{Pt as a,qu as s,uu as OJ}from"./chunk-bqdbf8k2.js";import{Eu as R}from"./chunk-q891e1vj.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-k4ejba6b.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-5n44cxqv.js"),{defaultConfig:z}=await import("./chunk-vmx4f37f.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".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 mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-k4ejba6b.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
3
|
-
export{WJ as
|
|
2
|
+
import{Ag as e,Cg as b,Lg as JJ,zg as t}from"./chunk-y7z44vr9.js";import{$o as o,Om as u,Pm as l,gm as y,hm as P,qm as x,rp as g,xm as v}from"./chunk-6ea3th9j.js";import{Rt as a,su as s,wu as OJ}from"./chunk-7kpfk426.js";import{Gu as R}from"./chunk-yx8vftp0.js";import r from"fs";import B from"path";var{serve:IJ}=globalThis.Bun;function q(J,K,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(K)}`;if(Q.maxAge!==void 0)X+=`; Max-Age=${Q.maxAge}`;if(Q.expires)X+=`; Expires=${Q.expires.toUTCString()}`;if(Q.path)X+=`; Path=${Q.path}`;if(Q.domain)X+=`; Domain=${Q.domain}`;if(Q.secure)X+="; Secure";if(Q.httpOnly)X+="; HttpOnly";if(Q.sameSite)X+=`; SameSite=${Q.sameSite}`;return X}async function KJ(J){let K=J.headers.get("content-type")||"",Q={},X=(Z,$)=>{let G=Q[Z];if(G===void 0)Q[Z]=$;else if(Array.isArray(G))G.push($);else Q[Z]=[G,$]};if(K.includes("multipart/form-data")){let Z=await J.formData();for(let[$,G]of Z.entries())if(typeof G==="string")X($,G);return Q}if(K.includes("application/x-www-form-urlencoded")){for(let[Z,$]of new URLSearchParams(await J.text()).entries())X(Z,$);return Q}return Q}function f(J){if(!J)return!1;let K=J.toUpperCase();return K!=="GET"&&K!=="HEAD"}async function h(J,K={}){let Q=K.request,X=K.method??Q?.method;if(!Q||!f(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let Z={};try{Z=await KJ(Q)}catch{}let $=await J.action({request:Q,form:Z,params:K.params??{},query:J.query??{},cookies:K.cookies??{}});if($&&typeof $==="object"){let G=$,W=QJ(G.cookies),I=G.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:_,redirect:N,...U}=G;if(Object.assign(J,U),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function QJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let K=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){K.push(q(Q,X));continue}if(X&&typeof X==="object"){let Z=X;if(typeof Z.value!=="string")continue;K.push(q(Q,Z.value,Z))}}return K}function m(J,K=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let Z of K)X.append("Set-Cookie",Z);for(let[Z,$]of Object.entries(Q??{}))if(Z.toLowerCase()!=="location")X.set(Z,$);return new Response(null,{status:303,headers:X})}async function wJ(J,K={}){return(await c(J,K)).html}async function d(J,K={}){let{html:Q,context:X,redirect:Z,cookies:$}=await c(J,K),G=u(X),W=l(X);if(Z)return{html:Q,redirect:Z,cookies:$,status:G,headers:W};let{extractStreamBoundaries:I}=await import("./chunk-q253eftn.js"),_=I(X),N=J.streamTemplates;if(N&&Object.keys(N).length>0){let{processDirectives:U}=await import("./chunk-7dznwvcy.js"),{defaultConfig:z}=await import("./chunk-anc397f7.js"),O=X.streamBoundaries||{},w={...z,autoShell:!1},D=Object.keys(N).map((V)=>({id:V,render:async()=>{let F=typeof O[V]==="function"?await O[V]():void 0;return U(N[V],{...X,$boundary:F},J.sourceFile,w,new Set)}})),E=new Set(D.map((V)=>V.id));_=[...(_||[]).filter((V)=>!E.has(V.id)),...D]}return{html:Q,boundaries:_&&_.length>0?_:void 0,cookies:$,status:G,headers:W}}async function c(J,K){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};if(!J.hasServerScripts&&!P(J.html))return{html:J.html,context:Q};for(let $ of J.serverScriptContent)try{await g($,Q,J.sourceFile)}catch(G){console.warn(`[stx] Server script error in ${J.sourceFile}:`,G)}let X=await h(Q,{request:K.request,method:K.method,params:K.params??{},cookies:K.cookies??{}});if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!P(J.html))return{html:J.html,context:Q,cookies:X.cookies};let Z=new Map;for(let[$,G]of Object.entries(J.placeholders))if(G.expression)try{let W=v(G.expression,Q);if(G.type==="raw")Z.set($,W!==void 0&&W!==null?String(W):"");else Z.set($,W!==void 0&&W!==null?x(String(W)):"")}catch{Z.set($,"")}return{html:y(J.html,Z),context:Q,cookies:X.cookies}}async function AJ(J,K={}){if(!J.hasServerScripts&&!P(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...K};for(let Z of J.serverScriptContent)try{await g(Z,Q,J.sourceFile)}catch($){console.warn(`[stx] Server script error in ${J.sourceFile}:`,$)}if(!P(J.fragment))return J.fragment;let X=new Map;for(let[Z,$]of Object.entries(J.placeholders))if($.expression)try{let G=v($.expression,Q);if($.type==="raw")X.set(Z,G!==void 0&&G!==null?String(G):"");else X.set(Z,G!==void 0&&G!==null?x(String(G)):"")}catch{X.set(Z,"")}return y(J.fragment,X)}OJ();import C from"zlib";import{promisify as n}from"util";var XJ=n(C.brotliCompress),ZJ=n(C.gzip),$J=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],GJ=["text/event-stream","multipart/x-mixed-replace"],UJ=1024;function WJ(J){if(!J)return!1;let K=J.toLowerCase();if(GJ.some((Q)=>K.startsWith(Q)))return!1;return $J.some((Q)=>K.startsWith(Q))}function jJ(J){let K=new Map;for(let Q of J.split(",")){let[X,...Z]=Q.trim().split(";"),$=X.trim().toLowerCase();if(!$)continue;let G=1;for(let W of Z){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(W);if(!I)continue;let _=Number.parseFloat(I[1]);if(Number.isFinite(_))G=_}K.set($,G)}return K}function YJ(J){if(!J)return null;let K=jJ(J),Q=K.get("*"),X=(Z)=>K.get(Z)??Q??0;if(X("br")>0)return"br";if(X("gzip")>0)return"gzip";return null}async function i(J,K,Q={}){if(K.headers.get("content-encoding"))return K;if(K.status===204||K.status===304||!K.body)return K;if(!WJ(K.headers.get("content-type")))return K;let X=YJ(J.headers.get("accept-encoding"));if(!X)return K;let Z;try{Z=new Uint8Array(await K.arrayBuffer())}catch{return K}let $=()=>new Response(Z,{status:K.status,statusText:K.statusText,headers:p(K.headers)});if(Z.length<(Q.threshold??UJ))return $();try{let G=X==="br"?await XJ(Z,{params:{[C.constants.BROTLI_PARAM_QUALITY]:Q.quality??5,[C.constants.BROTLI_PARAM_SIZE_HINT]:Z.length}}):await ZJ(Z);if(G.length>=Z.length)return $();let W=p(K.headers);return W.set("Content-Encoding",X),W.set("Content-Length",String(G.length)),new Response(G,{status:K.status,statusText:K.statusText,headers:W})}catch{return $()}}function p(J){let K=new Headers(J),Q=K.get("Vary");if(!Q)return K.set("Vary","Accept-Encoding"),K;if(!Q.split(",").some((Z)=>Z.trim().toLowerCase()==="accept-encoding"))K.set("Vary",`${Q}, Accept-Encoding`);return K}var _J={".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 mJ(J={}){let K=B.resolve(J.outputDir||".output"),Q=J.port||3000,X=JJ(K);if(!X)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${X.routes.length} routes...`);let Z=new Map,$=new Map,G=new Map,W=new Map;for(let U of X.routes)try{let z=B.join(K,U.compiledPath),O=JSON.parse(await Bun.file(z).text());Z.set(U.pattern,O),G.set(U.pattern,s(O.html)),W.set(U.pattern,o(O.html));let w=B.join(K,U.fragmentPath);if(await Bun.file(w).exists())$.set(U.pattern,await Bun.file(w).text())}catch(z){console.warn(`[stx] Failed to load route ${U.pattern}:`,z)}let I=new Map,_=[];for(let U of X.routes)if(U.hasParams){let{regex:z,params:O}=a(U.pattern);_.push({regex:z,route:U,paramNames:O})}else I.set(U.pattern,U);let N=IJ({port:Q,async fetch(U){return i(U,await(async()=>{let O=new URL(U.url).pathname;if(J.onRequest){let j=await J.onRequest(U);if(j)return j}if(J.apiRoutes?.[O])return J.apiRoutes[O](U);if((U.method==="GET"||U.method==="HEAD")&&O!=="/"){let j=B.resolve(K,"public"),Y;try{Y=decodeURIComponent(O)}catch{Y=O}if(!Y.includes("\x00")){let L=B.resolve(j,`.${Y}`);if(L===j||L.startsWith(`${j}${B.sep}`))try{if(r.existsSync(L)&&r.statSync(L).isFile()){let M=B.extname(L).toLowerCase(),S=_J[M]||"application/octet-stream",H=O.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(O);return new Response(Bun.file(L),{headers:{"Content-Type":S,"Cache-Control":H?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let w=e(U),D=null,E={};if(D=I.get(O)||null,!D)for(let{regex:j,route:Y,paramNames:L}of _){let A=O.match(j);if(A){D=Y,L.forEach((M,S)=>{E[M]=A[S+1]});break}}if(!D){let j=I.get("/404")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(w){let j=$.get(D.pattern);if(j){let Y=G.get(D.pattern);return new Response(j,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...W.has(D.pattern)?{"X-STX-Runtime":W.get(D.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},...b(),"Cache-Control":t}})}}let V=f(U.method),F=Z.get(D.pattern);if(!F){let j=I.get("/500")||null;if(j){let Y=Z.get(j.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!V&&!F.hasServerScripts&&Object.keys(F.placeholders).length===0)return new Response(F.html,{status:F.status??200,headers:{"Content-Type":"text/html",...b(),"Cache-Control":"public, max-age=60"}});try{let{html:j,boundaries:Y,redirect:L,cookies:A,status:M,headers:S}=await d(F,{params:E,request:U,method:U.method});if(L)return m(L,A,S);if(Y&&Y.length>0){let{renderStreamingPage:T,streamToResponse:k}=await import("./chunk-q253eftn.js");return k(T(j,Y,{timeoutMs:30000}),{status:M??F.status??200,headers:{"Cache-Control":"no-cache",...S}})}let H=new Headers({"Content-Type":"text/html",...b(),"Cache-Control":"no-cache"});for(let T of A??[])H.append("Set-Cookie",T);for(let[T,k]of Object.entries(S??{}))H.set(T,k);return new Response(j,{status:M??F.status??200,headers:H})}catch(j){return console.error(`[stx] Hydration error for ${O}:`,j),new Response(F.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${Q}`),console.log(`[stx] Serving ${X.routes.length} routes (${Z.size} pre-loaded)`),{port:Q,stop:()=>N.stop()}}
|
|
3
|
+
export{WJ as kg,YJ as lg,i as mg,q as ng,KJ as og,f as pg,h as qg,m as rg,wJ as sg,d as tg,AJ as ug,mJ as vg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$k as c,Zk as a,_k as b,al as d,bl as e,cl as f,dl as g,el as h,fl as i}from"./chunk-dvb8vgfe.js";import"./chunk-r84h7wxw.js";import"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.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{Aj as N,Bj as O,Cj as P,Dj as Q,Ej as T,Ij as U,Jj as V,Kj as W,Lj as Y,zj as K}from"./chunk-nhmq45hh.js";import{Kt as J}from"./chunk-xaqjtned.js";function $(){let w=q(Z());try{let z=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(w);return z=z.replace(/\}(var |let |const |function )/g,"};$1"),z}catch{return w}}function q(w){let E=[],z=0,I="console.log(";while(z<w.length){let F=w.indexOf(I,z);if(F===-1){E.push(w.slice(z));break}E.push(w.slice(z,F));let G=1,x=F+I.length;while(x<w.length&&G>0){let B=w[x];if(B==='"'||B==="'"||B==="`"){let _=B;x++;while(x<w.length&&w[x]!==_){if(w[x]==="\\")x++;x++}x++;continue}if(B==="(")G++;else if(B===")")G--;x++}E.push("0"),z=x}return E.join("")}function Z(){return`
|
|
3
3
|
// STX Signals Runtime (Development Build)
|
|
4
4
|
console.log('[stx] signals runtime loading');
|
|
5
5
|
// Pre-initialization shim: capture onMount/onDestroy calls made before the runtime IIFE runs
|
|
@@ -7995,4 +7995,4 @@ catch (e) { console.warn('[stx] destroy callback error:', e); }
|
|
|
7995
7995
|
}
|
|
7996
7996
|
})();
|
|
7997
7997
|
`}var C={state:K,derived:N,effect:O,batch:P,onMount:Q,onDestroy:T,isSignal:U,isDerived:V,untrack:W,peek:Y,generateSignalsRuntime:$,generateSignalsRuntimeDev:Z};
|
|
7998
|
-
export{$ as
|
|
7998
|
+
export{$ as rj,Z as sj,C as tj};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{np as a,op as b,pp as c,qp as d,rp as e,sp as f,tp as g,up as h,vp as i,wp as j}from"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-yx8vftp0.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
|
|
3
3
|
`)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
|
|
4
4
|
`)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{zj as _}from"./chunk-nhmq45hh.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 uh,E as vh,Z as wh,y as xh,w as yh,D as zh,S as Ah,V as Bh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ms as a,Ns as b,Os as c,Ps as d,Qs as e,Rs as f,Ss as g,Ts as h,Us as i,Vs as j,Ws as k,Xs as l,Ys as m}from"./chunk-87rj95tw.js";import"./chunk-xgtcq9bj.js";import"./chunk-yx8vftp0.js";export{f as resolveUserCrosswindConfig,c as resetCssCache,d as resetCrosswindCache,i as rebuildCrosswindCSS,e as loadCrosswindConfig,b as loadCrosswind,m as injectCrosswindCSS,a as getCrosswindServeAsset,j as getCachedCSS,l as generateCrosswindCSS,g as fingerprintConfig,k as extractClassNames,h as buildCrosswindCSS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{kt as a,lt as b,mt as c,nt as d,ot as e,pt as f,qt as g,rt as h,st as i,tt as j,ut as k,vt as l,wt as m,xt as n,yt as o,zt as p}from"./chunk-2fspj91j.js";import"./chunk-yx8vftp0.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as
|
|
2
|
+
import{$g as e,Xg as a,Yg as b,Zg as c,_g as d,ah as f,bh as g,ch as h}from"./chunk-cs1dc1n7.js";import"./chunk-yx8vftp0.js";export{g as timingPlugin,c as pluginManager,a as definePlugin,f as debugPlugin,h as createVariablesPlugin,e as createFilterPlugin,d as createDirectivePlugin,b as PluginManager};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{sk as m}from"./chunk-dtfgxjy9.js";import{Gu as z}from"./chunk-yx8vftp0.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 Yj,D as Zj,Cq as _j,yq as $j,N as ak,b as bk,h as ck,bq as dk,u as ek,Pq as fk,vq as gk,Qq as hk,Vq as ik,Fq as jk,cq as kk};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var{WebView:F}=globalThis.Bun;import{existsSync as V,mkdirSync as k,readdirSync as O,statSync as E}from"fs";import $ from"path";var C=16384;function X(j){if(/^https?:\/\//.test(j)||j.startsWith("file://"))return j;return`file://${$.resolve(j)}`}function K(j,B,z,L){return new Promise((Q)=>{let J=!1,G,Y,R=()=>{if(!J){if(J=!0,clearTimeout(Y),G)clearTimeout(G);j.onNavigated=void 0,Q()}};Y=setTimeout(R,L),j.onNavigated=()=>{if(!J)G=setTimeout(R,z)};try{let Z=j.navigate(B);if(Z&&typeof Z.catch==="function")Z.catch(R)}catch{R()}})}async function U(j,B,z){let L=`!!document.querySelector(${JSON.stringify(B)})`,Q=Date.now()+z;while(Date.now()<Q){try{if(await j.evaluate(L))return}catch{}await new Promise((J)=>setTimeout(J,100))}}async function _(j){try{let B=await j.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof B==="number"&&Number.isFinite(B)&&B>0?Math.min(B,C):0}catch{return 0}}async function x(j,B,z={}){let L=Math.min(z.width??1440,C),Q=Math.min(z.height??2200,C),J=z.waitMs??800,G=z.timeoutMs??15000,Y=z.format??"png",R=X(j),Z=(q)=>new F({width:L,height:q,headless:!0,...z.backend?{backend:z.backend}:{}}),P=Z(Q);try{if(await K(P,R,J,G),z.waitSelector)await U(P,z.waitSelector,G);if(z.fullPage){let H=await _(P);if(H>Q){if(P.close(),P=Z(H),await K(P,R,J,G),z.waitSelector)await U(P,z.waitSelector,G)}}let q=await P.screenshot({encoding:"buffer",format:Y});k($.dirname($.resolve(B)),{recursive:!0}),await Bun.write(B,q)}finally{P.close()}if(!V(B))throw Error(`Screenshot was not produced for ${j}`);return{input:j,output:B,bytes:E(B).size}}async function W(j,B,z={}){k(B,{recursive:!0});let L;if(!/^https?:\/\//.test(j)&&V(j)&&E(j).isDirectory())L=O(j).filter((G)=>G.endsWith(".html")).map((G)=>$.join(j,G));else L=[j];let Q=z.format??"png",J=[];for(let G of L){let Y=/^https?:\/\//.test(G)?new URL(G).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":$.basename(G).replace(/\.html?$/,"");J.push(await x(G,$.join(B,`${Y}.${Q}`),z))}return J}
|
|
3
|
-
export{x as
|
|
3
|
+
export{x as Df,W as Ef};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Lq as x,Pl as Y}from"./chunk-6ea3th9j.js";import"./chunk-4awxsp8f.js";import"./chunk-hk8j3eps.js";import"./chunk-mxva4zmq.js";import"./chunk-1kg9sz9a.js";import"./chunk-87rj95tw.js";import"./chunk-74r77tz1.js";import"./chunk-xgtcq9bj.js";import"./chunk-2fspj91j.js";import"./chunk-evv58hf5.js";import"./chunk-xaqjtned.js";import"./chunk-7kpfk426.js";import"./chunk-2tew0h6f.js";import"./chunk-yx8vftp0.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
2
|
var j=["batch","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],X=["onMount","onDestroy"];function B(z="const",F=[],J){let Z=F.length?j.filter((Q)=>!F.includes(Q)):j;if(J!==void 0)Z=Z.filter((Q)=>{let $=Q.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${$}(?![\\w$])`).test(J)});return`${z} { ${Z.join(", ")} } = window.stx;`}var W=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var Y=j.filter((z)=>!W.includes(z));function V(z){if(!z)return!1;return Y.some((F)=>new RegExp(`\\b${F}\\s*(?:<[^>]*>)?\\s*\\(`).test(z))}var P=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],C=/\s@[a-z][\w.:-]*\s*=/i;function G(z){if(!z)return!1;let F=K(z);if(P.some((J)=>J.test(F)))return!0;return V(F)}function D(z){if(!z)return!1;return C.test(K(z))||G(z)}var f=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function H(z){return f.includes(z.toLowerCase())}var q=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],U=["x-init","x-transition","x-effect","x-on"],w=[...q,...U];function M(){return`{${q.map((z)=>`'${z}':1`).join(",")}}`}function K(z){if(!z)return z;let F=(J)=>J.replace(/(<[^>]*>)|([^<]+)/g,(Z,Q,$)=>Q??" ".repeat($.length));return z.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(J,Z,Q,$)=>Z+F(Q)+$).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(J,Z,Q,$)=>Z+F(Q)+$).replace(/<!--[\s\S]*?-->/g,(J)=>" ".repeat(J.length))}
|
|
3
|
-
export{j as
|
|
3
|
+
export{j as Ct,X as Dt,B as Et,V as Ft,G as Gt,D as Ht,H as It,w as Jt,M as Kt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import C from"path";var G=".stx",K="STX_DIR",J=null;function O(j){J=j?.trim()||null}function H(){return process.env[K]?.trim()||J||G}function Q(j=process.cwd(),...q){let B=H();return C.isAbsolute(B)?C.join(B,...q):C.join(j,B,...q)}function W(j){if(!j||C.isAbsolute(j))return j;let q=j.replace(/\\/g,"/");if(q!==G&&!q.startsWith(`${G}/`))return j;let B=q.slice(G.length+1);return B?C.join(H(),B):H()}
|
|
3
|
-
export{G as
|
|
3
|
+
export{G as et,K as ft,O as gt,H as ht,Q as it,W as jt};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{bi as a,ci as b,di as c,ei as d,fi as e,gi as f}from"./chunk-ntnv2f7a.js";import"./chunk-yx8vftp0.js";export{c as processTransitionDirectives,f as processTransitionAttributes,b as performLeave,a as performEnter,e as generateTransitionRuntime,d as generateTransitionCSS};
|