@stacksjs/stx 0.2.336 → 0.2.337
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-06qm6p8r.js +2 -0
- package/dist/{chunk-67bh5vrj.js → chunk-09xhvt5p.js} +1 -1
- package/dist/{chunk-te6qym2g.js → chunk-0dz59qg5.js} +2 -2
- package/dist/chunk-0e8x9jkb.js +2 -0
- package/dist/chunk-0tc5p1ty.js +2 -0
- package/dist/{chunk-vd5xvsnv.js → chunk-18018jkn.js} +1 -1
- package/dist/{chunk-5tefa8qb.js → chunk-1vb2rj09.js} +2 -2
- package/dist/chunk-1xqe92jv.js +2 -0
- package/dist/{chunk-c65yrgck.js → chunk-1ybanbh4.js} +10 -10
- package/dist/chunk-1ybaz0a1.js +2 -0
- package/dist/{chunk-fqq5k9ve.js → chunk-1z1efvtw.js} +1 -1
- package/dist/chunk-20e4pcq1.js +2 -0
- package/dist/chunk-2wn5db49.js +2 -0
- package/dist/chunk-3376d979.js +2 -0
- package/dist/{chunk-71y3bhcw.js → chunk-3405q9eb.js} +123 -37
- package/dist/chunk-3g2j4eh8.js +12 -0
- package/dist/{chunk-q85qp5we.js → chunk-3k4wcezp.js} +1 -1
- package/dist/{chunk-1ebyt1ba.js → chunk-3n9rvrk1.js} +1 -1
- package/dist/{chunk-m8kezfrt.js → chunk-3nv5h7jd.js} +5 -5
- package/dist/{chunk-fr66xp8q.js → chunk-3ys2esa2.js} +1 -1
- package/dist/chunk-42tgak9b.js +2 -0
- package/dist/{chunk-0vv5s039.js → chunk-459qxwp1.js} +1 -1
- package/dist/chunk-45bmthfs.js +2 -0
- package/dist/chunk-4bcax4rv.js +2 -0
- package/dist/{chunk-t8ctvjqe.js → chunk-557n2zx7.js} +1 -1
- package/dist/{chunk-dvvx1wny.js → chunk-57atgbyq.js} +1 -1
- package/dist/{chunk-9kxfz708.js → chunk-58jwsgr1.js} +1 -1
- package/dist/{chunk-hyfjnn7g.js → chunk-5ep11kvc.js} +1 -1
- package/dist/chunk-5sqbd646.js +64 -0
- package/dist/chunk-623b1j9c.js +2 -0
- package/dist/{chunk-08w4gtyf.js → chunk-64kky38b.js} +3 -3
- package/dist/{chunk-2vgkc0kg.js → chunk-6ex0t14b.js} +1 -1
- package/dist/{chunk-ke88kpva.js → chunk-6ym84983.js} +3 -3
- package/dist/{chunk-cr8v8k53.js → chunk-7r9vgzg4.js} +1 -1
- package/dist/{chunk-zsnrcbw1.js → chunk-7rf71ecp.js} +2 -2
- package/dist/{chunk-xwxdwqn9.js → chunk-7we3xfde.js} +1 -1
- package/dist/{chunk-xz3evxqp.js → chunk-8bxtvsgm.js} +1 -1
- package/dist/{chunk-e1sxe3q4.js → chunk-8wqz2s4j.js} +2 -2
- package/dist/chunk-96q01emr.js +2 -0
- package/dist/{chunk-9v0fsdsf.js → chunk-97yd8erh.js} +1 -1
- package/dist/{chunk-fkdnfjc2.js → chunk-994aga02.js} +2 -2
- package/dist/{chunk-kw98dfza.js → chunk-9btdax2s.js} +1 -1
- package/dist/{chunk-q0g5c39d.js → chunk-9kb0qv47.js} +1 -1
- package/dist/{chunk-9368t9jm.js → chunk-a959m68j.js} +1 -1
- package/dist/chunk-akdryjck.js +47 -0
- package/dist/{chunk-cdqx2c2h.js → chunk-apsmgvrk.js} +1 -1
- package/dist/{chunk-ymrxpwr8.js → chunk-as5j2s4h.js} +2 -2
- package/dist/chunk-at9knbt1.js +2 -0
- package/dist/chunk-b1w30x36.js +2 -0
- package/dist/{chunk-mgmn1vxy.js → chunk-b9w95df7.js} +1 -1
- package/dist/chunk-bafd6h7t.js +16 -0
- package/dist/{chunk-ej8mv2k6.js → chunk-bgrkxzr7.js} +1 -1
- package/dist/{chunk-q05eh1n4.js → chunk-bkwg5cgq.js} +2 -2
- package/dist/chunk-btqmqzay.js +2 -0
- package/dist/chunk-bv65tr40.js +2 -0
- package/dist/chunk-c21x8w2q.js +2 -0
- package/dist/chunk-ch06z00p.js +2 -0
- package/dist/chunk-cs9w9kwy.js +2 -0
- package/dist/chunk-czh7agd6.js +2 -0
- package/dist/{chunk-kpeqn5tx.js → chunk-dfymexrx.js} +1 -1
- package/dist/{chunk-eth22r93.js → chunk-dwjcmxez.js} +1 -1
- package/dist/{chunk-t41aaehf.js → chunk-e4g8wz6t.js} +1 -1
- package/dist/{chunk-n66k2v2q.js → chunk-eeg62zy4.js} +2 -2
- package/dist/{chunk-mm59b0gg.js → chunk-er3adkx7.js} +1 -1
- package/dist/{chunk-pbexz0d4.js → chunk-evakht2n.js} +2 -2
- package/dist/chunk-evmc7vhg.js +2 -0
- package/dist/{chunk-pbzdjhp8.js → chunk-f5wernak.js} +1 -1
- package/dist/{chunk-4jdj52c5.js → chunk-f6sejeg3.js} +1 -1
- package/dist/{chunk-xdmb578h.js → chunk-fckan25d.js} +1 -1
- package/dist/{chunk-yxppshfd.js → chunk-g3cyygvf.js} +1 -1
- package/dist/{chunk-mwh3ymwc.js → chunk-g6czgcg4.js} +1 -1
- package/dist/chunk-gab2hnk7.js +2 -0
- package/dist/{chunk-5swem3qy.js → chunk-gwrrs1qh.js} +1 -1
- package/dist/chunk-gy9a83n9.js +4 -0
- package/dist/chunk-h3w1y4q7.js +2 -0
- package/dist/chunk-hphhqwn5.js +2 -0
- package/dist/{chunk-2cm03y4y.js → chunk-hv8j33px.js} +1 -1
- package/dist/{chunk-zz8qgqa1.js → chunk-j3b8cnss.js} +2 -2
- package/dist/{chunk-gptwwv3c.js → chunk-jc3t5y1y.js} +1 -1
- package/dist/{chunk-cdsbxghb.js → chunk-jkyvk4x6.js} +1 -1
- package/dist/chunk-jv70d481.js +2 -0
- package/dist/chunk-jxqf4y2y.js +2 -0
- package/dist/{chunk-4k0ce745.js → chunk-jyq43tp9.js} +2 -2
- package/dist/chunk-k14sz6cz.js +2 -0
- package/dist/chunk-m93qtfxw.js +2 -0
- package/dist/{chunk-dfejgnny.js → chunk-meqcxfpr.js} +1 -1
- package/dist/chunk-mppr5jht.js +2 -0
- package/dist/{chunk-7kw3grq5.js → chunk-nf7k53ap.js} +1 -1
- package/dist/{chunk-kffndzch.js → chunk-nzbdgx7d.js} +3 -3
- package/dist/chunk-p4bmz9x3.js +3 -0
- package/dist/{chunk-4ty8j3xn.js → chunk-peqad61h.js} +1 -1
- package/dist/chunk-pp2ssem6.js +2 -0
- package/dist/{chunk-nat3actx.js → chunk-psazw7p1.js} +1 -1
- package/dist/{chunk-vvd659y4.js → chunk-pt4xht7s.js} +1 -1
- package/dist/{chunk-drqdc0mh.js → chunk-qcf4506g.js} +1 -1
- package/dist/{chunk-q569zmrr.js → chunk-qnx0eb8x.js} +1 -1
- package/dist/{chunk-y4nzmkea.js → chunk-qsbjtp60.js} +1 -1
- package/dist/{chunk-c2ta859c.js → chunk-rb69qb49.js} +1 -1
- package/dist/{chunk-hzfd8cz0.js → chunk-s9hsxhb5.js} +2 -2
- package/dist/chunk-sfaj3res.js +2 -0
- package/dist/{chunk-64djh88a.js → chunk-sqvqwd0p.js} +1 -1
- package/dist/chunk-sy44sx1e.js +3747 -0
- package/dist/{chunk-wx5zf66r.js → chunk-t2h8prxq.js} +1 -1
- package/dist/{chunk-24b4711v.js → chunk-t77fg77q.js} +1 -1
- package/dist/chunk-tbynnx22.js +2 -0
- package/dist/{chunk-amxtypkp.js → chunk-tf3b833n.js} +1 -1
- package/dist/chunk-tgsj4g9k.js +2 -0
- package/dist/chunk-thfpfk45.js +2 -0
- package/dist/{chunk-deqnt1w5.js → chunk-tjhzxbxa.js} +1 -1
- package/dist/{chunk-2tjk867y.js → chunk-tp6wkx7g.js} +1 -1
- package/dist/{chunk-p1hy2bwn.js → chunk-v5d0xj8c.js} +3 -3
- package/dist/chunk-vcdt10ke.js +3 -0
- package/dist/{chunk-ya5m5vbn.js → chunk-vgfd9582.js} +1 -1
- package/dist/{chunk-42en0cxm.js → chunk-vjp1sg5y.js} +1 -1
- package/dist/{chunk-tjag2cmm.js → chunk-w3d5xrdy.js} +1 -1
- package/dist/{chunk-6k8h1fj1.js → chunk-w52p79xs.js} +1 -1
- package/dist/{chunk-yk6446kr.js → chunk-when7sgs.js} +2 -2
- package/dist/chunk-wj8sx4fx.js +2 -0
- package/dist/{chunk-crj19mqr.js → chunk-wmgpb6b6.js} +1 -1
- package/dist/{chunk-9fcq5x2r.js → chunk-wnnv5d1t.js} +1 -1
- package/dist/{chunk-27xfkzks.js → chunk-wv9v9mj9.js} +1 -1
- package/dist/{chunk-1hzgxk2m.js → chunk-wx3kf6tm.js} +1 -1
- package/dist/{chunk-1tva0f8f.js → chunk-wxpwt67g.js} +1 -1
- package/dist/{chunk-r8rbf28v.js → chunk-x5y9r3f2.js} +1 -1
- package/dist/{chunk-d4etph79.js → chunk-xgj1jw4p.js} +1 -1
- package/dist/{chunk-x7yc7e9v.js → chunk-xt7bsyj7.js} +1 -1
- package/dist/chunk-xzhvnk8r.js +2 -0
- package/dist/chunk-y97yx6ap.js +2 -0
- package/dist/{chunk-7r80apc5.js → chunk-yjkaqxtc.js} +1 -1
- package/dist/{chunk-09jdvqhg.js → chunk-yrj8gad9.js} +2 -2
- package/dist/{chunk-c79nfdyj.js → chunk-zk6ghjnj.js} +1 -1
- package/dist/{chunk-k6ky5et7.js → chunk-zp5z8qwy.js} +1 -1
- package/dist/{chunk-j2dj21ay.js → chunk-zyb5gfr0.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/component-contract-checks.d.ts +18 -15
- package/dist/component-contract.d.ts +6 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/expressions.d.ts +45 -0
- package/dist/expressions.js +60 -11
- package/dist/includes.js +4 -0
- package/dist/loops.js +10 -0
- package/dist/pwa.js +2 -2
- package/dist/server-components.js +2 -1
- package/dist/signals.js +121 -35
- package/dist/slots.js +86 -12
- package/dist/ssg.js +2 -2
- package/dist/stx-virtual-ts.d.ts +205 -95
- package/dist/template-syntax-escape.d.ts +36 -0
- package/dist/template-syntax-escape.js +8 -0
- package/dist/utils.js +9 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-046dp691.js +0 -2
- package/dist/chunk-1brnvyhv.js +0 -2
- package/dist/chunk-3ntf8f5e.js +0 -2
- package/dist/chunk-4tnxnzja.js +0 -2
- package/dist/chunk-63yfp05p.js +0 -2
- package/dist/chunk-7y4eqkv4.js +0 -2
- package/dist/chunk-7ywnkv1f.js +0 -2
- package/dist/chunk-80zj5516.js +0 -2
- package/dist/chunk-8730k51r.js +0 -2
- package/dist/chunk-907qxn09.js +0 -2
- package/dist/chunk-a97tp43x.js +0 -2
- package/dist/chunk-atw841yx.js +0 -2
- package/dist/chunk-c1m1gng4.js +0 -2
- package/dist/chunk-caaenc3w.js +0 -60
- package/dist/chunk-cvphepjb.js +0 -2
- package/dist/chunk-dbfq77qe.js +0 -4
- package/dist/chunk-dnesmvvb.js +0 -2
- package/dist/chunk-eg8ksaft.js +0 -2
- package/dist/chunk-ewsx2qxm.js +0 -2
- package/dist/chunk-farwrdr2.js +0 -3
- package/dist/chunk-fcenm8n1.js +0 -2
- package/dist/chunk-gbz6pfs8.js +0 -2
- package/dist/chunk-gdbkqatx.js +0 -43
- package/dist/chunk-jnahcd4d.js +0 -2
- package/dist/chunk-krpkfndf.js +0 -3
- package/dist/chunk-kxtqbrfr.js +0 -3759
- package/dist/chunk-m1yrakpk.js +0 -2
- package/dist/chunk-n9c975db.js +0 -2
- package/dist/chunk-q2hvne0v.js +0 -2
- package/dist/chunk-qpbk50xd.js +0 -2
- package/dist/chunk-rxdd3k6n.js +0 -2
- package/dist/chunk-ssd10kje.js +0 -2
- package/dist/chunk-szx6pxh3.js +0 -2
- package/dist/chunk-tpmgq2dx.js +0 -12
- package/dist/chunk-tte4m2s9.js +0 -2
- package/dist/chunk-v7gjsb3f.js +0 -2
- package/dist/chunk-vv289x82.js +0 -2
- package/dist/chunk-vx6mxybh.js +0 -2
- package/dist/chunk-x510wr8z.js +0 -2
- package/dist/chunk-x95sxapm.js +0 -2
- package/dist/chunk-xjrhzkx2.js +0 -2
- package/dist/chunk-y1x2ebhv.js +0 -2
- package/dist/chunk-yvec3f1c.js +0 -2
- package/dist/chunk-yzxm75jp.js +0 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Hu as b,_t as U,ou as v}from"./chunk-akdryjck.js";import{Qu as w}from"./chunk-yjkaqxtc.js";function p(F,z,V,Y){let Q=F;Q=Q.replace(/@meta\(\s*['"]([^'"]+)['"](?:,\s*['"]([^'"]+)['"]\s*)?\)/g,(K,Z,J)=>{if(!J&&Z.includes(":")){let N=Z.split(":"),L=Z,q=N.length>1?N[1]:"";if(q&&z[q])J=z[q];else if(L.startsWith("og:")&&z.openGraph&&z.openGraph[N[1]])J=z.openGraph[N[1]];else J="";return J?`<meta property="${$(L)}" content="${$(J)}">`:""}return J?`<meta name="${$(Z)}" content="${$(J)}">`:""});let _=/@metaTag\s*\(/g,I;while((I=_.exec(Q))!==null){let K=I.index,Z=K+I[0].length-1,J=1,N=Z+1;while(N<Q.length&&J>0){if(Q[N]==="(")J++;else if(Q[N]===")"){if(J--,J===0)break}N++}if(J!==0)break;let L=Q.substring(Z+1,N).trim(),q=N+1,B=(()=>{try{let A=b(L,z);if(!A)return"";let j="<meta";if(A.name)j+=` name="${$(String(A.name))}"`;if(A.property)j+=` property="${$(String(A.property))}"`;if(A.httpEquiv)j+=` http-equiv="${$(String(A.httpEquiv))}"`;if(A.content)j+=` content="${$(String(A.content))}"`;return j+=">",j}catch(A){let j=A instanceof Error?A.message:String(A);return v("MetaTag",j,U.EVALUATION_ERROR)}})();Q=Q.substring(0,K)+B+Q.substring(q),_.lastIndex=0}return Q}function i(F,z,V){let Y=F,Q=/@structuredData\s*\(/g,_;while((_=Q.exec(Y))!==null){let I=_.index,K=I+_[0].length-1,Z=1,J=K+1;while(J<Y.length&&Z>0){if(Y[J]==="(")Z++;else if(Y[J]===")"){if(Z--,Z===0)break}J++}if(Z!==0)break;let N=Y.substring(K+1,J).trim(),L=J+1,q=(()=>{try{let B=b(N,z);if(!B)return"";if(!B["@context"])B["@context"]="https://schema.org";return`<script type="application/ld+json">${JSON.stringify(B).replace(/<\//g,"<\\/")}</script>`}catch(B){let A=B instanceof Error?B.message:String(B);return v("StructuredData",A,U.EVALUATION_ERROR)}})();Y=Y.substring(0,I)+q+Y.substring(L),Q.lastIndex=0}return Y}function c(F,z,V,Y){let Q=F,_=/@seo\s*\(\s*\{/g,I;while((I=_.exec(Q))!==null){let K=Q.indexOf("{",I.index+4),Z=1,J=K+1,N=null,L=!1;while(J<Q.length&&Z>0){let R=Q[J];if(L){L=!1,J++;continue}if(R==="\\"&&N){L=!0,J++;continue}if(N){if(R===N)N=null;J++;continue}if(R==='"'||R==="'"||R==="`"){N=R,J++;continue}if(R==="{")Z++;else if(R==="}")Z--;J++}if(Z!==0)break;let q=Q.substring(J).match(/^\s*\)/);if(!q)break;let B=J+q[0].length,A=Q.substring(K,J),j=Q.substring(I.index,B),X=((R)=>{try{let G=b(R,z);if(!G)return"";let k="";if(G.title)k+=`<title>${$(G.title)}</title>
|
|
3
|
+
`,k+=`<meta name="title" content="${$(G.title)}">
|
|
4
|
+
`;if(G.description)k+=`<meta name="description" content="${$(G.description)}">
|
|
5
|
+
`;if(G.keywords){let W=Array.isArray(G.keywords)?G.keywords.join(", "):G.keywords;k+=`<meta name="keywords" content="${$(W)}">
|
|
6
|
+
`}if(G.robots)k+=`<meta name="robots" content="${$(G.robots)}">
|
|
7
|
+
`;if(G.canonical)k+=`<link rel="canonical" href="${$(G.canonical)}">
|
|
8
|
+
`;if(G.openGraph){let W=G.openGraph;if(k+=`<meta property="og:type" content="${$(W.type||"website")}">
|
|
9
|
+
`,W.title||G.title){let O=W.title||G.title||"";k+=`<meta property="og:title" content="${$(O)}">
|
|
10
|
+
`}if(W.description||G.description){let O=W.description||G.description||"";k+=`<meta property="og:description" content="${$(O)}">
|
|
11
|
+
`}if(W.url||G.canonical){let O=W.url||G.canonical||"";k+=`<meta property="og:url" content="${$(O)}">
|
|
12
|
+
`}if(W.image){if(k+=`<meta property="og:image" content="${$(W.image)}">
|
|
13
|
+
`,W.imageAlt)k+=`<meta property="og:image:alt" content="${$(W.imageAlt)}">
|
|
14
|
+
`;if(W.imageWidth)k+=`<meta property="og:image:width" content="${$(String(W.imageWidth))}">
|
|
15
|
+
`;if(W.imageHeight)k+=`<meta property="og:image:height" content="${$(String(W.imageHeight))}">
|
|
16
|
+
`;if(W.imageType)k+=`<meta property="og:image:type" content="${$(W.imageType)}">
|
|
17
|
+
`}if(W.siteName)k+=`<meta property="og:site_name" content="${$(W.siteName)}">
|
|
18
|
+
`;if(W.locale)k+=`<meta property="og:locale" content="${$(W.locale)}">
|
|
19
|
+
`;if(W.profile){let O=[["first_name",W.profile.firstName],["last_name",W.profile.lastName],["username",W.profile.username],["gender",W.profile.gender]];for(let[D,C]of O)if(C)k+=`<meta property="profile:${D}" content="${$(C)}">
|
|
20
|
+
`}}if(G.twitter){let W=G.twitter;if(k+=`<meta name="twitter:card" content="${$(W.card||"summary_large_image")}">
|
|
21
|
+
`,W.title||G.title){let O=W.title||G.title||"";k+=`<meta name="twitter:title" content="${$(O)}">
|
|
22
|
+
`}if(W.description||G.description){let O=W.description||G.description||"";k+=`<meta name="twitter:description" content="${$(O)}">
|
|
23
|
+
`}if(W.image||G.openGraph&&G.openGraph.image){let O=W.image||(G.openGraph?G.openGraph.image:"")||"";k+=`<meta name="twitter:image" content="${$(O)}">
|
|
24
|
+
`;let D=W.imageAlt||(!W.image&&G.openGraph?G.openGraph.imageAlt:void 0);if(D)k+=`<meta name="twitter:image:alt" content="${$(D)}">
|
|
25
|
+
`}if(W.site)k+=`<meta name="twitter:site" content="${$(W.site)}">
|
|
26
|
+
`;if(W.creator)k+=`<meta name="twitter:creator" content="${$(W.creator)}">
|
|
27
|
+
`}if(G.structuredData){let W=JSON.stringify(G.structuredData).replace(/<\//g,"<\\/");k+=`<script type="application/ld+json">${W}</script>
|
|
28
|
+
`}return k.trim()}catch(G){let k=G instanceof Error?G.message:String(G);return v("SEO",`Error processing @seo directive: ${k}`,U.EVALUATION_ERROR)}})(A);Q=Q.substring(0,I.index)+X+Q.substring(B),_.lastIndex=I.index+X.length}return Q}function r(F,z,V){if(V.seo?.enabled===!1)return F;if(F.includes("<!-- stx SEO Tags -->")||z.__stx_seo_staged===!0||V.skipDefaultSeoTags===!0)return F;let Y=z.__stx_runtime_head;if(!!(Y?.title||Y?.meta?.some((R)=>R.property==="og:title"||R.name==="og:title"||R.name==="twitter:title"||R.name==="description")))return F;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(F)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(F)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(F))return F;if(!F.includes("<head>")&&!F.includes("<head "))return F;let _=F.includes("<title>")||F.includes("</title>"),I=P(F),K=T(I),Z=f(I),J="";if(z.title)J=z.title;else if(z.meta&&z.meta.title)J=z.meta.title;else if(K)J=K;else if(V.seo?.defaultConfig?.title)J=V.seo.defaultConfig.title;else J=V.defaultTitle||"stx Project";let N="";if(z.description)N=z.description;else if(z.meta&&z.meta.description)N=z.meta.description;else if(Z)N=Z;else if(V.seo?.defaultConfig?.description)N=V.seo.defaultConfig.description;else N=V.defaultDescription||"A website built with stx templating engine";let L="";if(z.image)L=z.image;else if(z.meta&&z.meta.image)L=z.meta.image;else if(z.openGraph&&z.openGraph.image)L=z.openGraph.image;else if(V.seo?.defaultImage)L=V.seo.defaultImage;else if(V.defaultImage)L=V.defaultImage;let q=_?"":`
|
|
29
|
+
<meta name="title" content="${$(J)}">`,B=H(I)?"":`
|
|
30
|
+
<meta name="description" content="${$(N)}">`,A=`
|
|
31
|
+
<!-- stx SEO Tags -->${q}${B}
|
|
32
|
+
<meta property="og:title" content="${$(J)}">
|
|
33
|
+
<meta property="og:description" content="${$(N)}">
|
|
34
|
+
<meta property="og:type" content="website">
|
|
35
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
36
|
+
<meta name="twitter:title" content="${$(J)}">
|
|
37
|
+
<meta name="twitter:description" content="${$(N)}">
|
|
38
|
+
`;if(L)A+=`
|
|
39
|
+
<meta property="og:image" content="${$(L)}">
|
|
40
|
+
<meta name="twitter:image" content="${$(L)}">
|
|
41
|
+
`;let j=F;if(!_)j=j.replace(/<head[^>]*>/,`$&
|
|
42
|
+
<title>${$(J)}</title>`);let X=z.__stx_head_injections;if(X)return z.__stx_seo_staged=!0,X.afterOpen.push(`
|
|
43
|
+
${A}
|
|
44
|
+
`),j;return j.replace(/<head[^>]*>/,`$&
|
|
45
|
+
${A}
|
|
46
|
+
`)}function P(F){let z=F.search(/<\/head\s*>/i);return z===-1?F:F.slice(0,z)}function M(F){return F.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function T(F){let z=F.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return z?M(z[1].trim()):""}function y(F){return(F.match(/<meta\s[^>]*>/gi)||[]).filter((z)=>/\sname\s*=\s*["']description["']/i.test(z))}function H(F){return y(F).length>0}function f(F){for(let z of y(F)){let V=z.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),Y=(V?.[1]??V?.[2]??"").trim();if(Y)return M(Y)}return""}function $(F){return F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var x=["og:","article:","book:","profile:","fb:","music:","video:"];function S(F){let z=F.trim(),V=z[0];if((V==="'"||V==='"'||V==="`")&&z.length>1&&z.at(-1)===V)return{value:z.slice(1,-1),quoted:!0};return{value:z,quoted:!1}}var d={name:"meta",handler:(F,z,V,Y)=>{if(z.length<1)return v("Meta","meta directive requires at least the meta name",U.INVALID_DIRECTIVE_SYNTAX);let Q=S(z[0]).value,_;if(z.length>1){let Z=S(z[1]);_=Z.quoted?Z.value:String(V?.[Z.value]??Z.value)}else{let Z=Q.includes(":")?Q.slice(Q.indexOf(":")+1):Q,J=V?.openGraph;_=String(V?.[Z]??J?.[Z]??"")}if(!_)return"";let K=x.some((Z)=>Q.startsWith(Z))?{property:Q,content:_}:{name:Q,content:_};if(V)V.__stx_runtime_head=w(V.__stx_runtime_head??{},{meta:[K]});return""},hasEndTag:!1},h={name:"structuredData",handler:(F,z,V,Y)=>{if(F.trim()==="")return v("StructuredData","structuredData directive requires JSON-LD content",U.INVALID_DIRECTIVE_SYNTAX);try{let Q=JSON.parse(F);if(!Q["@context"])Q["@context"]="https://schema.org";if(!Q["@type"])return v("StructuredData","structuredData requires @type property",U.INVALID_DIRECTIVE_SYNTAX);return`<script type="application/ld+json">${JSON.stringify(Q)}</script>`}catch(Q){let _=Q instanceof Error?Q.message:String(Q);return v("StructuredData",_,U.EVALUATION_ERROR)}},hasEndTag:!0};function s(){return[d,h]}function n(F,z){let{baseUrl:V,defaultChangefreq:Y="weekly",defaultPriority:Q=0.5,includeLastmod:_=!0}=z,I=V.replace(/\/$/,"");return`<?xml version="1.0" encoding="UTF-8"?>
|
|
47
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
48
|
+
${F.map((Z)=>{let J=Z.loc.startsWith("http")?Z.loc:`${I}${Z.loc.startsWith("/")?"":"/"}${Z.loc}`,N=Z.lastmod||(_?new Date().toISOString().split("T")[0]:void 0),L=Z.changefreq||Y,q=Z.priority??Q,B=` <url>
|
|
49
|
+
<loc>${E(J)}</loc>`;if(N)B+=`
|
|
50
|
+
<lastmod>${N}</lastmod>`;return B+=`
|
|
51
|
+
<changefreq>${L}</changefreq>`,B+=`
|
|
52
|
+
<priority>${q.toFixed(1)}</priority>`,B+=`
|
|
53
|
+
</url>`,B}).join(`
|
|
54
|
+
`)}
|
|
55
|
+
</urlset>`}function a(F,z){let V=z.replace(/\/$/,""),Y=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
56
|
+
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
57
|
+
${F.map((_)=>{let I=_.startsWith("http")?_:`${V}${_.startsWith("/")?"":"/"}${_}`;return` <sitemap>
|
|
58
|
+
<loc>${E(I)}</loc>
|
|
59
|
+
<lastmod>${Y}</lastmod>
|
|
60
|
+
</sitemap>`}).join(`
|
|
61
|
+
`)}
|
|
62
|
+
</sitemapindex>`}async function o(F,z){let{extensions:V=[".stx",".html",".htm"],ignore:Y=["_*",".*","node_modules","components","partials","layouts"]}=z,Q=[],_=V.length===1?`*${V[0]}`:`*{${V.join(",")}}`,I=new Bun.Glob(`**/${_}`);for await(let K of I.scan(F)){if(Y.some((q)=>{if(q.startsWith("*"))return K.includes(q.slice(1));return K.startsWith(q)||K.includes(`/${q}`)}))continue;let J=K.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!J.startsWith("/"))J=`/${J}`;if(J!=="/"&&J.endsWith("/"))J=J.slice(0,-1);let N=`${F}/${K}`,L;try{let q=await Bun.file(N).stat();if(q)L=new Date(q.mtime).toISOString().split("T")[0]}catch{}Q.push({loc:J||"/",lastmod:L,priority:J==="/"?1:0.5})}return Q.sort((K,Z)=>K.loc.localeCompare(Z.loc)),Q}function u(F){let z=[];for(let V of F.rules){if(z.push(`User-agent: ${V.userAgent}`),V.allow)for(let Y of V.allow)z.push(`Allow: ${Y}`);if(V.disallow)for(let Y of V.disallow)z.push(`Disallow: ${Y}`);if(V.crawlDelay!==void 0)z.push(`Crawl-delay: ${V.crawlDelay}`);z.push("")}if(F.sitemap){let V=Array.isArray(F.sitemap)?F.sitemap:[F.sitemap];for(let Y of V)z.push(`Sitemap: ${Y}`)}if(F.host)z.push(`Host: ${F.host}`);return z.join(`
|
|
63
|
+
`).trim()}function e(F){return u({rules:[{userAgent:"*",allow:["/"]}],sitemap:F})}function E(F){return F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
64
|
+
export{p as It,i as Jt,c as Kt,r as Lt,d as Mt,h as Nt,s as Ot,n as Pt,a as Qt,o as Rt,u as St,e as Tt};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ei as a,fi as b,gi as c}from"./chunk-jyq43tp9.js";import"./chunk-7we3xfde.js";import"./chunk-sy44sx1e.js";import"./chunk-bafd6h7t.js";import"./chunk-tf3b833n.js";import"./chunk-psazw7p1.js";import"./chunk-x5y9r3f2.js";import"./chunk-9kb0qv47.js";import"./chunk-nzbdgx7d.js";import"./chunk-jc3t5y1y.js";import"./chunk-rb69qb49.js";import"./chunk-eeg62zy4.js";import"./chunk-pt4xht7s.js";import"./chunk-5sqbd646.js";import"./chunk-akdryjck.js";import"./chunk-yjkaqxtc.js";import"./chunk-tp6wkx7g.js";import"./chunk-557n2zx7.js";import"./chunk-tjhzxbxa.js";import"./chunk-s9hsxhb5.js";import"./chunk-qnx0eb8x.js";import"./chunk-5ep11kvc.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Go as k,Ip as w,Ql as A,Rl as b,Xm as T,Ym as y,Zn as M,gm as B,im as F,lo as R,or as P,zo as x}from"./chunk-sy44sx1e.js";import{rw as v}from"./chunk-5ep11kvc.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -14,5 +14,5 @@ ${Q.join(`
|
|
|
14
14
|
`)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,filePath:z})}))).join(`
|
|
15
15
|
`);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
|
|
16
16
|
$1`);else q+=`
|
|
17
|
-
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-
|
|
18
|
-
export{j as
|
|
17
|
+
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-zp5z8qwy.js");q=await N(q)}catch{}return q}
|
|
18
|
+
export{j as nk,C as ok,D as pk,o as qk,r as rk,V as sk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mf as t,nf as u,of as v,pf as w,qf as x,rf as y,sf as z,tf as A,uf as B,vf as C,wf as D,xf as E}from"./chunk-
|
|
2
|
+
import{mf as t,nf as u,of as v,pf as w,qf as x,rf as y,sf as z,tf as A,uf as B,vf as C,wf as D,xf as E}from"./chunk-wmgpb6b6.js";import{yf as r,zf as s}from"./chunk-xt7bsyj7.js";import{Af as b,Bf as c,Cf as d,Df as e,Ef as f,Ff as g,Gf as h,If as i,Jf as j,Kf as k,Lf as l,Mf as m,Nf as n,Of as o,Pf as p,Qf as q}from"./chunk-zyb5gfr0.js";import{di as a}from"./chunk-g6czgcg4.js";import"./chunk-9kb0qv47.js";import"./chunk-5ep11kvc.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Bo as l,Bp as m,Fm as k,Go as T,Vm as d,Wm as c,nm as P,om as D,xm as R}from"./chunk-sy44sx1e.js";import{Is as S,Ks as v}from"./chunk-nzbdgx7d.js";import{ew as XJ,gw as YJ,hw as ZJ}from"./chunk-s9hsxhb5.js";import{ow as QJ,rw as q}from"./chunk-5ep11kvc.js";var n=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function r(J,Y,Q){let X={fullTag:Q,content:Y,attrs:J};if(/\bserver\b/.test(J))return{...X,type:"server"};if(/\bdata-stx-scoped\b/.test(J))return{...X,type:"client"};if(n.test(Y))return{...X,type:"signals"};if(/\bclient\b/.test(J)||/\btype\s*=\s*["']module["']/.test(J)||/\bsrc\s*=/.test(J))return{...X,type:"client"};return{...X,type:"server"}}var s=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function y(J){let Y=[],Q=[],X=[],$=0;while($<J.length){let Z=J.indexOf("<",$);if(Z===-1)break;let U=v(J,Z);if(U>Z){$=U;continue}let W=S(J,Z);if(W>Z){let j=J.slice(Z,W),F=s.exec(j);if(F){let K=r(F[1],F[2],j);switch(K.type){case"signals":Y.push(K);break;case"client":Q.push(K);break;case"server":X.push(K);break}}$=W;continue}$=Z+(J.startsWith("<!--",Z)?4:1)}return{signals:Y,client:Q,server:X}}var o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function a(J){let Y=[],Q=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,X;while((X=Q.exec(J))!==null)Y.push({start:X.index,end:X.index+X[0].length});return Y}function C(J,Y){return Y.some((Q)=>J>=Q.start&&J<Q.end)}function t(J){let Y=(J||"").trim();if(!Y)return null;if(/[\s>+~,:]/.test(Y))return null;let Q={},X=Y,$=X.match(/^[a-z][\w-]*/i);if($)Q.tag=$[0].toLowerCase(),X=X.slice($[0].length);while(X.length>0){let Z=X.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(Z){if(Q.attr=Z[1],Z[3]!==void 0&&Z[3]!=="")Q.attrValue=Z[3];X=X.slice(Z[0].length);continue}let U=X.match(/^#([\w-]+)/);if(U){Q.id=U[1],X=X.slice(U[0].length);continue}let W=X.match(/^\.([\w-]+)/);if(W){Q.className=W[1],X=X.slice(W[0].length);continue}return null}if(!Q.tag&&!Q.attr&&!Q.id&&!Q.className)return null;return Q}function e(J,Y){if(Y.attr){if(!(Y.attrValue===void 0?new RegExp(`\\b${Y.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${Y.attr}\\s*=\\s*(["'])\\s*${Y.attrValue}\\s*\\1`,"i")).test(J))return!1}if(Y.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${Y.id}\\s*\\1`,"i").test(J))return!1}if(Y.className){let Q=J.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!Q)return!1;if(!Q[2].split(/\s+/).includes(Y.className))return!1}return!0}function x(J,Y="main"){let Q=t(Y);if(!Q)return null;let X=/<([a-z][\w-]*)\b([^>]*)>/gi,$=a(J),Z;while((Z=X.exec(J))!==null){if(C(Z.index,$))continue;let U=Z[1].toLowerCase(),W=Z[2]||"";if(W.trimEnd().endsWith("/")||o.has(U))continue;if(Q.tag&&Q.tag!==U)continue;if(!e(W,Q))continue;let j=Z[0],F=Z.index+j.length,K=new RegExp(`<(/?)${U}\\b([^>]*)>`,"gi");K.lastIndex=F;let G=1,B;while((B=K.exec(J))!==null){if(C(B.index,$))continue;let w=B[1]==="/";if(!w&&(B[2]||"").trimEnd().endsWith("/"))continue;if(G+=w?-1:1,G===0)return{openTag:j,openIndex:Z.index,start:F,end:B.index,tagName:U}}return null}return null}var wJ="X-STX-Router",NJ="private, no-store";function AJ(J){return J.replace(/&#(\d+);/g,(Y,Q)=>f(Number(Q),Y)).replace(/&#x([0-9a-f]+);/gi,(Y,Q)=>f(Number.parseInt(Q,16),Y)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function f(J,Y){if(!Number.isInteger(J)||J<0||J>1114111)return Y;try{return String.fromCodePoint(J)}catch{return Y}}function g(J){return J.headers.get("X-STX-Router")==="true"}function JJ(J,Y){if(!J)return Y;return J.split(",").some((X)=>X.trim().toLowerCase()===Y.toLowerCase())?J:`${J}, ${Y}`}function IJ(J){return{Vary:JJ(J,"X-STX-Router")}}import E from"path";XJ();var $J="stx-page-head:",UJ=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,O=null;function WJ(){if(O!==null)return O;try{let{getRouterScript:J}=(ZJ(),QJ(YJ));O=`<script>${J()}</script>`}catch{O=""}return O}async function MJ(J,Y){if(Y===!1)return null;if(Y&&typeof Y==="string"){let X=E.resolve(J,Y);if(await Bun.file(X).exists())return X;return null}let Q=E.join(J,"app.stx");if(await Bun.file(Q).exists())return Q;return null}async function bJ(J,Y){try{let Q=await Bun.file(J).text(),X=Q,$=Q.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)X=$[1].trim();let Z=y(Q),U=[...Z.client.map((V)=>V.fullTag),...Z.signals.map((V)=>V.fullTag)],W=[],j=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,F;while((F=j.exec(Q))!==null)W.push(F[0]);let K=X;for(let V of Z.server)K=K.replace(V.fullTag,"");for(let V of Z.client)K=K.replace(V.fullTag,"");K=K.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let G="<!--__STX_PAGE_SLOT__-->";if(K=K.replace(/<slot\s*\/>/gi,G).replace(/<slot\s*>\s*<\/slot>/gi,G),!K.includes(G))return console.warn(`[stx] Shell ${J} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:B,extractVariables:w,defaultConfig:N,loadStxConfig:I}=await import("./chunk-45bmthfs.js"),_=await I(),z={__filename:J,__dirname:E.dirname(J)};for(let V of U){let L=V.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(L&&!V.includes("client")&&!V.includes('type="module"'))await w(L[1],z,J)}let A=await B(K,z,J,{...N,..._,...Y},new Set),H=A.indexOf(G);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:A.substring(0,H),afterSlot:A.substring(H+G.length),filePath:J,shellScripts:U,shellStyles:W}}catch(Q){return console.error(`[stx] Error processing shell ${J}:`,Q),null}}function PJ(J,Y,Q){let X,$="",Z=Y.match(UJ);if(Z){Y=Y.replace(Z[0],"");try{let K=Buffer.from(Z[1],"base64").toString("utf8"),G=K.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(G)X=G[1].trim();$=K.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let U=Q||X||"stx App",W=WJ(),j="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -26,5 +26,5 @@ ${W}
|
|
|
26
26
|
`));if($.length>0)N.push($.join(`
|
|
27
27
|
`));if(G.length>0)N.push(G.join(`
|
|
28
28
|
`));return N.push(K),N.join(`
|
|
29
|
-
`)}import M from"fs";import h from"path";function CJ(J,Y,Q){return{version:1,buildTime:new Date().toISOString(),routes:J,assets:Y,outputDir:Q}}function xJ(J,Y){let Q=h.join(Y,"manifest.json");M.writeFileSync(Q,JSON.stringify(J,null,2))}function fJ(J){let Y=h.join(J,"manifest.json");if(!M.existsSync(Y))return null;try{let Q=M.readFileSync(Y,"utf-8"),X=JSON.parse(Q);if(X.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${X.version}`),null;return X}catch(Q){return console.warn("[stx] Failed to load manifest:",Q),null}}function b(J,Y,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(Y)}`;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 Y=J.headers.get("content-type")||"",Q={},X=($,Z)=>{let U=Q[$];if(U===void 0)Q[$]=Z;else if(Array.isArray(U))U.push(Z);else Q[$]=[U,Z]};if(Y.includes("multipart/form-data")){let $=await J.formData();for(let[Z,U]of $.entries())if(typeof U==="string")X(Z,U);return Q}if(Y.includes("application/x-www-form-urlencoded")){for(let[$,Z]of new URLSearchParams(await J.text()).entries())X($,Z);return Q}return Q}function FJ(J){if(!J)return!1;let Y=J.toUpperCase();return Y!=="GET"&&Y!=="HEAD"}async function p(J,Y={}){let Q=Y.request,X=Y.method??Q?.method;if(!Q||!FJ(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let $={};try{$=await KJ(Q)}catch{}let Z=await J.action({request:Q,form:$,params:Y.params??{},query:J.query??{},cookies:Y.cookies??{}});if(Z&&typeof Z==="object"){let U=Z,W=GJ(U.cookies),j=U.redirect;if(typeof j==="string"&&j)return{redirect:j,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:F,redirect:K,...G}=U;if(Object.assign(J,G),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function GJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let Y=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){Y.push(b(Q,X));continue}if(X&&typeof X==="object"){let $=X;if(typeof $.value!=="string")continue;Y.push(b(Q,$.value,$))}}return Y}function hJ(J,Y=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let $ of Y)X.append("Set-Cookie",$);for(let[$,Z]of Object.entries(Q??{}))if($.toLowerCase()!=="location")X.set($,Z);return new Response(null,{status:303,headers:X})}async function sJ(J,Y={}){return(await i(J,Y)).html}async function oJ(J,Y={}){let{html:Q,context:X,redirect:$,cookies:Z}=await i(J,Y),U=d(X),W=c(X);if($)return{html:Q,redirect:$,cookies:Z,status:U,headers:W};let{extractStreamBoundaries:j}=await import("./chunk-
|
|
30
|
-
export{r as
|
|
29
|
+
`)}import M from"fs";import h from"path";function CJ(J,Y,Q){return{version:1,buildTime:new Date().toISOString(),routes:J,assets:Y,outputDir:Q}}function xJ(J,Y){let Q=h.join(Y,"manifest.json");M.writeFileSync(Q,JSON.stringify(J,null,2))}function fJ(J){let Y=h.join(J,"manifest.json");if(!M.existsSync(Y))return null;try{let Q=M.readFileSync(Y,"utf-8"),X=JSON.parse(Q);if(X.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${X.version}`),null;return X}catch(Q){return console.warn("[stx] Failed to load manifest:",Q),null}}function b(J,Y,Q={}){let X=`${encodeURIComponent(J)}=${encodeURIComponent(Y)}`;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 Y=J.headers.get("content-type")||"",Q={},X=($,Z)=>{let U=Q[$];if(U===void 0)Q[$]=Z;else if(Array.isArray(U))U.push(Z);else Q[$]=[U,Z]};if(Y.includes("multipart/form-data")){let $=await J.formData();for(let[Z,U]of $.entries())if(typeof U==="string")X(Z,U);return Q}if(Y.includes("application/x-www-form-urlencoded")){for(let[$,Z]of new URLSearchParams(await J.text()).entries())X($,Z);return Q}return Q}function FJ(J){if(!J)return!1;let Y=J.toUpperCase();return Y!=="GET"&&Y!=="HEAD"}async function p(J,Y={}){let Q=Y.request,X=Y.method??Q?.method;if(!Q||!FJ(X))return{ran:!1};if(typeof J.action!=="function")return{ran:!1};let $={};try{$=await KJ(Q)}catch{}let Z=await J.action({request:Q,form:$,params:Y.params??{},query:J.query??{},cookies:Y.cookies??{}});if(Z&&typeof Z==="object"){let U=Z,W=GJ(U.cookies),j=U.redirect;if(typeof j==="string"&&j)return{redirect:j,ran:!0,...W.length>0?{cookies:W}:{}};let{cookies:F,redirect:K,...G}=U;if(Object.assign(J,G),W.length>0)return{ran:!0,cookies:W}}return{ran:!0}}function GJ(J){if(!J||typeof J!=="object"||Array.isArray(J))return[];let Y=[];for(let[Q,X]of Object.entries(J)){if(!Q)continue;if(typeof X==="string"){Y.push(b(Q,X));continue}if(X&&typeof X==="object"){let $=X;if(typeof $.value!=="string")continue;Y.push(b(Q,$.value,$))}}return Y}function hJ(J,Y=[],Q){let X=new Headers({Location:J,"Cache-Control":"no-store"});for(let $ of Y)X.append("Set-Cookie",$);for(let[$,Z]of Object.entries(Q??{}))if($.toLowerCase()!=="location")X.set($,Z);return new Response(null,{status:303,headers:X})}async function sJ(J,Y={}){return(await i(J,Y)).html}async function oJ(J,Y={}){let{html:Q,context:X,redirect:$,cookies:Z}=await i(J,Y),U=d(X),W=c(X);if($)return{html:Q,redirect:$,cookies:Z,status:U,headers:W};let{extractStreamBoundaries:j}=await import("./chunk-96q01emr.js"),F=j(X),K=J.streamTemplates;if(K&&Object.keys(K).length>0){let{processDirectives:G}=await import("./chunk-jv70d481.js"),{defaultConfig:B}=await import("./chunk-y97yx6ap.js"),w=X.streamBoundaries||{},N={...B,autoShell:!1},I=Object.keys(K).map((z)=>({id:z,render:async()=>{let A=typeof w[z]==="function"?await w[z]():void 0;return G(K[z],{...X,$boundary:A},J.sourceFile,N,new Set)}})),_=new Set(I.map((z)=>z.id));F=[...(F||[]).filter((z)=>!_.has(z.id)),...I]}return{html:Q,boundaries:F&&F.length>0?F:void 0,cookies:Z,status:U,headers:W}}async function i(J,Y){let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...Y};if(!J.hasServerScripts&&!D(J.html))return{html:J.html,context:Q};for(let U of J.serverScriptContent)try{await T(U,Q,J.sourceFile)}catch(W){if(Y.__stx_strict_hydration)throw W;console.warn(`[stx] Server script error in ${J.sourceFile}:`,W)}let X=await p(Q,{request:Y.request,method:Y.method,params:Y.params??{},cookies:Y.cookies??{}}),$=(U)=>{let W=U.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),j=l(Q);if(!j)return W;let F=W.indexOf("</head>");return F<0?j+W:W.slice(0,F)+j+W.slice(F)};if(X.redirect)return{html:J.html,context:Q,redirect:X.redirect,cookies:X.cookies};if(!D(J.html))return{html:$(J.html),context:Q,cookies:X.cookies};let Z=new Map;for(let[U,W]of Object.entries(J.placeholders))if(W.expression)try{let j=k(W.expression,Q);if(W.type==="raw")Z.set(U,j!==void 0&&j!==null?String(j):"");else Z.set(U,j!==void 0&&j!==null?R(String(j)):"")}catch(j){if(Y.__stx_strict_hydration)throw j;Z.set(U,"")}return{html:$(P(J.html,Z)),context:Q,cookies:X.cookies}}async function aJ(J,Y={}){if(!J.hasServerScripts&&!D(J.fragment))return J.fragment;let Q={__filename:J.sourceFile,__dirname:J.sourceFile.replace(/[/\\][^/\\]+$/,""),...Y};for(let $ of J.serverScriptContent)try{await T($,Q,J.sourceFile)}catch(Z){console.warn(`[stx] Server script error in ${J.sourceFile}:`,Z)}if(!D(J.fragment))return J.fragment;let X=new Map;for(let[$,Z]of Object.entries(J.placeholders))if(Z.expression)try{let U=k(Z.expression,Q);if(Z.type==="raw")X.set($,U!==void 0&&U!==null?String(U):"");else X.set($,U!==void 0&&U!==null?R(String(U)):"")}catch{X.set($,"")}return P(J.fragment,X)}
|
|
30
|
+
export{r as Xf,y as Yf,t as Zf,x as _f,wJ as $f,NJ as ag,AJ as bg,g as cg,JJ as dg,IJ as eg,MJ as fg,bJ as gg,PJ as hg,jJ as ig,RJ as jg,kJ as kg,CJ as lg,xJ as mg,fJ as ng,b as og,KJ as pg,FJ as qg,p as rg,hJ as sg,sJ as tg,oJ as ug,aJ as vg};
|
|
@@ -213,4 +213,4 @@ function w(Z,M){let{itemHeight:K,containerHeight:P,overscan:F=3,keyProperty:$="i
|
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
215
|
`})}var v={createVirtualList:w,processVirtualListDirectives:C,processInfiniteListDirectives:E,processVirtualGridDirectives:f,generateVirtualListCSS:b,useVirtualList:L};
|
|
216
|
-
export{w as
|
|
216
|
+
export{w as Bh,C as Ch,b as Dh,L as Eh,E as Fh,f as Gh,v as Hh};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ow as W,pw as k,qw as G}from"./chunk-5ep11kvc.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
|
|
3
3
|
${j.entries.map((K)=>` { url: '${K.url}', revision: '${K.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
5
|
]`}function E(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var l;var F=G(()=>{l={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});function g(j){let q={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return q[j]||q["network-first"]}function R(j){return g(j).className}function M(j){let q=j.pwa;if(!q?.enabled)return"";let K=q.routes||[],Q=q.cacheStorage,Y=[];for(let X of K){let Z=R(X.strategy),O=[];if(X.maxAgeSeconds||X.maxEntries||Q?.maxEntries){let $=X.maxEntries||Q?.maxEntries||100,L=X.maxAgeSeconds||(Q?.maxAge?Q.maxAge*24*60*60:void 0);O.push(`new ExpirationPlugin({
|
|
@@ -1191,4 +1191,4 @@ if ('serviceWorker' in navigator) {
|
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
1193
|
</script>`}function Vj(){return'<link rel="manifest" href="/manifest.json">'}function Aj(j){return`<meta name="theme-color" content="${N(j)}">`}function N(j){return j.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
1194
|
-
export{U as
|
|
1194
|
+
export{U as Jk,J as Kk,E as Lk,F as Mk,w as Nk,z as Ok,y as Pk,qj as Qk,H as Rk,I as Sk,Lj as Tk,Uj as Uk,Vj as Vk,Aj as Wk};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import z from"fs";function B(x){return[...x].sort().map((b)=>{try{let j=z.statSync(b);return`${b}:${j.size}:${j.mtimeMs}`}catch{return`${b}:missing`}}).join(`
|
|
3
3
|
`)}function C(x,b,j){let q=x.get(b);return q!==void 0&&q.signature===j?q.value:void 0}function D(x,b,j,q){return x.set(b,{signature:j,value:q}),q}
|
|
4
|
-
export{B as
|
|
4
|
+
export{B as Ji,C as Ki,D as Li};
|
|
@@ -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 yg,Y as zg,Z as Ag,$ as Bg,V as Cg,x as Dg,C as Eg,S as Fg,w as Gg,b as Hg,N as Ig,p as Jg};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{hw as y}from"./chunk-s9hsxhb5.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-css=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"css",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-css="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
|
|
3
3
|
`);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
|
|
4
4
|
`)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
|
|
5
|
-
export{Y as
|
|
5
|
+
export{Y as tk,_ as uk,a as vk,s as wk,h as xk,f as yk,c as zk,HM as Ak};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mi as a,Ni as b,Oi as c,Pi as d,Qi as e,Ri as f,Si as g,Ti as h,Ui as i,Vi as j,Wi as k,Xi as l,Yi as m,Zi as n}from"./chunk-as5j2s4h.js";import"./chunk-sy44sx1e.js";import"./chunk-bafd6h7t.js";import"./chunk-tf3b833n.js";import"./chunk-psazw7p1.js";import"./chunk-x5y9r3f2.js";import"./chunk-9kb0qv47.js";import"./chunk-nzbdgx7d.js";import"./chunk-jc3t5y1y.js";import"./chunk-rb69qb49.js";import"./chunk-eeg62zy4.js";import"./chunk-pt4xht7s.js";import"./chunk-5sqbd646.js";import"./chunk-akdryjck.js";import"./chunk-yjkaqxtc.js";import"./chunk-tp6wkx7g.js";import"./chunk-557n2zx7.js";import"./chunk-tjhzxbxa.js";import"./chunk-s9hsxhb5.js";import"./chunk-qnx0eb8x.js";import"./chunk-5ep11kvc.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};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-5ep11kvc.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,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{A as
|
|
2
|
+
import{gq as M,kq as w}from"./chunk-sy44sx1e.js";import{Es as O}from"./chunk-nzbdgx7d.js";import{rw as G}from"./chunk-5ep11kvc.js";import V from"fs";import W from"path";import{fileURLToPath as y}from"url";var A=new Map,X=new Map;async function u(j){let z;for(let I=0;I<3;I++)try{let Y=(await V.promises.stat(j)).mtime.getTime(),Q=X.get(j);if(Q&&Q.mtime===Y)return Q.content;let Z=await Bun.file(j).text(),N=(await V.promises.stat(j)).mtime.getTime();if(N!==Y)continue;return X.set(j,{content:Z,mtime:N}),Z}catch(J){z=J;break}throw X.delete(j),Error(`File not found: ${j}${z?` (${z.message})`:""}`)}function g(j){X.delete(j)}function P(j){for(let B of X.keys())if(B.startsWith(j))X.delete(B)}var q=null,v=null,T=null;function m(j){T=j}async function k(j=!1){let B=T??await import("./chunk-wxpwt67g.js");if(j)return B.generateSignalsRuntimeDev();if(q===null)q=B.generateSignalsRuntime();return q}var D=null;async function H(){if(D===null){let{getRouterScript:j}=await import("./chunk-wnnv5d1t.js");D=j()}return D}var L={};async function p(j,B=!1){let z=j==="runtime"?await k(B):await H(),I=j==="runtime"&&B?"runtime-debug":j,J=L[I];if(!J||J.content!==z)J={content:z,hash:Bun.hash(z).toString(16).padStart(16,"0").slice(0,16)},L[I]=J;return{content:z,hash:J.hash,url:`/_stx/${j}.${J.hash}.js`}}function d(){X.clear(),w(),O(),q=null,v=null,D=null}function x(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")}var U;function b(){if(U)return U;let j="unknown";try{j=String(JSON.parse(V.readFileSync(new URL("../package.json",import.meta.url),"utf8")).version)}catch{}if(import.meta.url.endsWith(".ts"))try{let B=W.dirname(y(import.meta.url)),z=0;for(let I of V.readdirSync(B,{recursive:!0,withFileTypes:!0}))if(I.isFile()&&I.name.endsWith(".ts"))z=Math.max(z,V.statSync(W.join(I.parentPath,I.name)).mtimeMs);j+=`+src.${Math.trunc(z)}`}catch{}return U=j,j}async function f(j,B){try{if(!B.cachePath)return null;let z=W.resolve(B.cachePath),I=W.join(z,`${K(j)}.html`),J=W.join(z,`${K(j)}.meta.json`);if(!await M(I)||!await M(J))return null;let Y=await Bun.file(J).text(),Q=JSON.parse(Y);if(Q.cacheVersion!==B.cacheVersion)return null;if(Q.engine!==b())return null;if(Q.optionsSignature!==x(B))return null;if((await V.promises.stat(j)).mtime.getTime()>Q.mtime)return null;for(let $ of Q.dependencies)if(await M($)){if((await V.promises.stat($)).mtime.getTime()>Q.mtime)return null}else return null;return await Bun.file(I).text()}catch(z){return console.warn(`Cache error for ${j}:`,z),null}}async function l(j,B,z,I){try{if(!I.cachePath)return;let J=W.resolve(I.cachePath);await V.promises.mkdir(J,{recursive:!0});let Y=W.join(J,`${K(j)}.html`),Q=W.join(J,`${K(j)}.meta.json`),Z=await V.promises.stat(j);await Bun.write(Y,B);let $={sourcePath:j,mtime:Z.mtime.getTime(),dependencies:Array.from(z),cacheVersion:I.cacheVersion,engine:b(),optionsSignature:x(I),generatedAt:Date.now()};await Bun.write(Q,JSON.stringify($,null,2)),A.set(j,{output:B,mtime:Z.mtime.getTime(),dependencies:z})}catch(J){console.warn(`Failed to cache template ${j}:`,J)}}var E=16;function K(j){return new Bun.CryptoHasher("sha1").update(j).digest("hex").substring(0,E)}
|
|
3
|
+
export{A as Jj,u as Kj,g as Lj,P as Mj,m as Nj,k as Oj,H as Pj,p as Qj,d as Rj,b as Sj,f as Tj,l as Uj,K as Vj};
|
|
@@ -5,4 +5,4 @@ import Q from"fs";import U from"path";function W(H){let v=[],j=H.pwa;if(v.push({
|
|
|
5
5
|
`);let J=["required","recommended","optional"];for(let L of J){let N=H.checks.filter((K)=>K.category===L);if(N.length===0)continue;v.push(`
|
|
6
6
|
${L.toUpperCase()}:`);for(let K of N){let T=K.passed?"\x1B[32m\u2713\x1B[0m":"\x1B[31m\u2717\x1B[0m";if(v.push(` ${T} ${K.name}: ${K.message}`),K.details)v.push(` ${K.details}`)}}return v.push(""),v.join(`
|
|
7
7
|
`)}
|
|
8
|
-
export{W as
|
|
8
|
+
export{W as Ek,X as Fk,Y as Gk,A as Hk,B as Ik};
|
|
@@ -144,4 +144,4 @@ var N=new Map,Q=new Map;function T(A){if(N.set(A.name,A),A.client)Q.set(A.name,A
|
|
|
144
144
|
console.log('[stx] Directive runtime initialized');
|
|
145
145
|
})();
|
|
146
146
|
`}function $(A){let B=/v-(\w+)(?::(\w+))?(?:\.([\w.]+))?="([^"]*)"/g;return A.replace(B,(C,F,H,L,J)=>{let E=(L?L.split("."):[]).reduce((M,S)=>{return M[S]=!0,M},{});return`data-stx-directive="${F}:${J}" data-stx-directive-arg="${H||""}" data-stx-directive-modifiers='${JSON.stringify(E)}'`})}
|
|
147
|
-
export{T as
|
|
147
|
+
export{T as rs,V as ss,W as ts,X as us,G as vs,Y as ws,Z as xs,_ as ys,$ as zs};
|
|
@@ -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 Ih,I as Jh,E as Kh,V as Lh,f as Mh,b as Nh,H as Oh,S as Ph,h as Qh,g as Rh,v as Sh,u as Th,x as Uh,y as Vh,r as Wh};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rw as z}from"./chunk-5ep11kvc.js";var Vq={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},L={},u="en";function Gq(q){u=q}function Bq(){return u}function Hq(q){L={...L,...q}}function Wq(){L={}}function f(q,J={}){let Q=L[q]||Vq[q]||{message:`Unknown error (code: ${q})`},Z=Q.message,$=Q.help;for(let[X,V]of Object.entries(J)){let Y=`{{${X}}}`;if(Z=Z.replace(new RegExp(Y,"g"),V),$)$=$.replace(new RegExp(Y,"g"),V)}return{message:Z,help:$}}function Mq(q,J={}){let{message:Q,help:Z}=f(q,J);return Z?`${Q}
|
|
3
|
+
Help: ${Z}`:Q}var w={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function S(q){for(let[J,Q]of Object.entries(w))if(Q===q)return J;return}function Iq(){return!1}function k(){return!Iq()||process.env.STX_DEBUG==="true"}function aq(){return!1}import wq from"path";var x={showRelativePaths:!1,enableAutoRecovery:k(),logRecoveryWarnings:!0},D={...x};function Fq(q){D={...D,...q}}function _(){return{...D}}function jq(){D={...x}}function N(q){if(!D.showRelativePaths||!q)return q;let J=D.baseDir||process.cwd();try{let Q=wq.relative(J,q);return Q.startsWith("..")?q:Q}catch{return q}}class U extends Error{code;filePath;line;column;context;numericCode;constructor(q,J,Q,Z,$,X,V){super(q);this.code=J;this.filePath=Q;this.line=Z;this.column=$;this.context=X;if(this.name="StxError",this.numericCode=V||w.EVALUATION_ERROR,this.filePath)this.filePath=N(this.filePath)}}class m extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_SYNTAX_ERROR",J,Q,Z,$,X||w.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class c extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_RUNTIME_ERROR",J,Q,Z,$,X||w.EVALUATION_ERROR);this.name="StxRuntimeError"}}class d extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_SECURITY_ERROR",J,Q,Z,$,X||w.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class p extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_FILE_ERROR",J,Q,Z,$,X||w.FILE_NOT_FOUND);this.name="StxFileError"}}class l extends U{isFatal=!0;constructor(q,J,Q,Z,$,X){super(q,"stx_VALIDATION_ERROR",J,Q,Z,$,X||w.DOM_API_VIOLATION);this.name="StxValidationError"}}function P(q){let{type:J,message:Q,code:Z,filePath:$,line:X,column:V,template:Y,offset:B,snippet:G,suggestion:H,format:W="text"}=q,M=X,I=V;if(!M&&Y&&B!==void 0){let y=s(Y,B);M=y.line,I=y.column}let j=$?N($):void 0,Yq=Z?S(Z):void 0,K={type:J,code:Z,codeName:Yq,message:Q,filePath:j,line:M,column:I,snippet:G,suggestion:H,timestamp:new Date().toISOString()},O;switch(W){case"html":O=Dq(K);break;case"json":O=JSON.stringify(K,null,2);break;case"console":O=Kq(K,Y,B);break;case"text":default:O=Uq(K,Y,B);break}return{formatted:O,data:K}}function Uq(q,J,Q){let Z=[],$=q.code?` [${q.codeName||q.code}]`:"";if(Z.push(`[${q.type} Error${$}]`),q.filePath){let X=q.filePath;if(q.line){if(X+=`:${q.line}`,q.column)X+=`:${q.column}`}Z.push(`at ${X}`)}if(Z.push(`
|
|
4
|
+
${q.message}`),J&&q.line){let X=Oq(J,q.line,2);if(X)Z.push(`
|
|
5
|
+
${X}`)}if(q.snippet)Z.push(`
|
|
6
|
+
Snippet: ${q.snippet}`);if(q.suggestion)Z.push(`
|
|
7
|
+
Suggestion: ${q.suggestion}`);return Z.join(" ")}function Dq(q){let J=q.code?` [${q.code}]`:"",Q=q.filePath?` in ${q.filePath}${q.line?`:${q.line}`:""}`:"",Z=`<!-- [${q.type} Error${J}]${Q}: ${o(q.message)}`;if(q.suggestion)Z+=` | Suggestion: ${o(q.suggestion)}`;return Z+=" -->",Z}function Kq(q,J,Q){let G=[],H=q.code?` [${q.codeName||q.code}]`:"";if(G.push(`\x1B[1m${"\x1B[31m"}\u2501\u2501\u2501 ${q.type} Error${H} \u2501\u2501\u2501${"\x1B[0m"}`),q.filePath){let W=`\x1B[36m${q.filePath}\x1B[0m`;if(q.line){if(W+=`\x1B[90m:${q.line}\x1B[0m`,q.column)W+=`\x1B[90m:${q.column}\x1B[0m`}G.push(`
|
|
8
|
+
\x1B[90mat\x1B[0m ${W}`)}if(G.push(`
|
|
9
|
+
|
|
10
|
+
${q.message}`),J&&q.line){let W=kq(J,q.line,2);if(W)G.push(`
|
|
11
|
+
|
|
12
|
+
\x1B[90mContext:\x1B[0m
|
|
13
|
+
${W}`)}if(q.suggestion)G.push(`
|
|
14
|
+
|
|
15
|
+
\x1B[33mSuggestion:\x1B[0m ${q.suggestion}`);return G.push(`
|
|
16
|
+
${"\x1B[31m"}\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501${"\x1B[0m"}`),G.join("")}function Oq(q,J,Q){let Z=q.split(`
|
|
17
|
+
`),$=Math.max(0,J-Q-1),X=Math.min(Z.length-1,J+Q-1),V=[];for(let Y=$;Y<=X;Y++){let B=(Y+1).toString().padStart(4),G=Y===J-1?">":" ";V.push(`${G}${B} | ${Z[Y]}`)}return V.join(`
|
|
18
|
+
`)}function kq(q,J,Q){let Z=q.split(`
|
|
19
|
+
`),$=Math.max(0,J-Q-1),X=Math.min(Z.length-1,J+Q-1),V="\x1B[90m",Y="\x1B[31m",B="\x1B[0m",G=[];for(let H=$;H<=X;H++){let W=(H+1).toString().padStart(4),M=H===J-1,I=M?"\x1B[31m>\x1B[0m":" ",j=M?`\x1B[31m${Z[H]}\x1B[0m`:`\x1B[90m${Z[H]}\x1B[0m`;G.push(`${I}\x1B[90m${W}\x1B[0m | ${j}`)}return G.join(`
|
|
20
|
+
`)}function o(q){return q.replace(/--/g,"- -").replace(/>/g,">")}function s(q,J){let Z=q.substring(0,J).split(`
|
|
21
|
+
`);return{line:Z.length,column:Z[Z.length-1].length}}function zq(q,J,Q){return P({type:q,message:J,code:Q,format:"html"}).formatted}function Lq(q,J,Q,Z,$){return P({type:q,message:J,code:$,filePath:Q,line:Z,format:"console"}).formatted}function _q(q,J,Q){let Z=Q.template.split(`
|
|
22
|
+
`),$=s(Q.template,Q.offset),X=`[${q} Error at line ${$.line} in ${Q.filePath}]: ${J}
|
|
23
|
+
|
|
24
|
+
`,V=Math.max(0,$.line-3),Y=Math.min(Z.length-1,$.line+2);X+=`Context:
|
|
25
|
+
`;for(let B=V;B<=Y;B++){let G=B+1,H=Z[B]||"",W=B===$.line-1?">":" ";X+=`${W} ${G.toString().padStart(3)}: ${H}
|
|
26
|
+
`}if($.line-1<Z.length){let B=" ".repeat($.column+5);X+=`${B}^
|
|
27
|
+
`}return X}function Nq(q,J,Q){try{return q()}catch(Z){if(Q&&Z instanceof Error)Q(Z);return J}}async function Tq(q,J,Q){try{return await q()}catch(Z){if(Q&&Z instanceof Error)Q(Z);return J}}var Aq={isEnabled(){return _().enableAutoRecovery},fixCommonSyntaxErrors(q){let J=_();if(!J.enableAutoRecovery)return{fixed:q,fixes:[]};let Q=q,Z=[],$=(Q.match(/\{\{/g)||[]).length,X=(Q.match(/\}\}/g)||[]).length;if($>X){let Y=$-X;Q+="}}".repeat(Y),Z.push(`Added ${Y} missing closing braces '}}'`)}let V=["if","foreach","for","switch","section"];for(let Y of V){let B=(Q.match(new RegExp(`@${Y}\\b`,"g"))||[]).length,G=(Q.match(new RegExp(`@end${Y}\\b`,"g"))||[]).length;if(B>G){let H=B-G;for(let W=0;W<H;W++)Q+=`
|
|
28
|
+
@end${Y}`;Z.push(`Added ${H} missing @end${Y}`)}}if(Z.length>0&&J.logRecoveryWarnings)console.warn("[stx] Auto-recovery applied fixes:"),Z.forEach((Y)=>console.warn(` - ${Y}`)),console.warn(" Consider fixing these issues in your template.");return{fixed:Q,fixes:Z}},createFallbackContent(q,J){if(k())return`<!-- ${q} failed: ${J.message} -->`;return"<!-- stx rendering error -->"}};class C{errors=[];maxErrors;enableFileLogging;logFilePath;logFormat;maxFileSize;maxLogFiles;minLevel;writeQueue=Promise.resolve();constructor(q={}){this.maxErrors=q.maxErrors??1000,this.enableFileLogging=q.enableFileLogging??!1,this.logFilePath=q.logFilePath??".stx/errors.log",this.logFormat=q.logFormat??"json",this.maxFileSize=q.maxFileSize??10485760,this.maxLogFiles=q.maxLogFiles??5,this.minLevel=q.minLevel??"all"}configure(q){if(q.maxErrors!==void 0)this.maxErrors=q.maxErrors;if(q.enableFileLogging!==void 0)this.enableFileLogging=q.enableFileLogging;if(q.logFilePath!==void 0)this.logFilePath=q.logFilePath;if(q.logFormat!==void 0)this.logFormat=q.logFormat;if(q.maxFileSize!==void 0)this.maxFileSize=q.maxFileSize;if(q.maxLogFiles!==void 0)this.maxLogFiles=q.maxLogFiles;if(q.minLevel!==void 0)this.minLevel=q.minLevel}log(q,J,Q="error"){let Z={timestamp:new Date,error:q,context:J,level:Q};if(this.errors.push(Z),this.errors.length>this.maxErrors)this.errors=this.errors.slice(-this.maxErrors);if(this.enableFileLogging&&this.shouldLog(Q))this.writeToFile(Z)}shouldLog(q){if(this.minLevel==="all")return!0;if(this.minLevel==="warning")return q==="error"||q==="warning";if(this.minLevel==="error")return q==="error";return!0}formatEntry(q){if(this.logFormat==="json")return JSON.stringify({timestamp:q.timestamp.toISOString(),level:q.level||"error",type:q.error.constructor.name,message:q.error.message,stack:q.error.stack,context:q.context});let J=[`[${q.timestamp.toISOString()}] [${(q.level||"error").toUpperCase()}] ${q.error.constructor.name}: ${q.error.message}`];if(q.error.stack)J.push(` Stack: ${q.error.stack.split(`
|
|
29
|
+
`).slice(1).join(`
|
|
30
|
+
`)}`);if(q.context)J.push(` Context: ${JSON.stringify(q.context)}`);return J.join(`
|
|
31
|
+
`)}writeToFile(q){this.writeQueue=this.writeQueue.then(async()=>{try{let J=await import("fs"),Z=(await import("path")).dirname(this.logFilePath);if(!J.existsSync(Z))J.mkdirSync(Z,{recursive:!0});await this.rotateIfNeeded(J);let $=`${this.formatEntry(q)}
|
|
32
|
+
`;J.appendFileSync(this.logFilePath,$,"utf-8")}catch(J){if(process.env.STX_DEBUG==="true")console.error("Failed to write to error log:",J)}})}async rotateIfNeeded(q){try{if(!q.existsSync(this.logFilePath))return;if(q.statSync(this.logFilePath).size<this.maxFileSize)return;for(let Q=this.maxLogFiles-1;Q>=1;Q--){let Z=`${this.logFilePath}.${Q}`,$=`${this.logFilePath}.${Q+1}`;if(q.existsSync(Z))if(Q>=this.maxLogFiles-1)q.unlinkSync(Z);else q.renameSync(Z,$)}if(this.maxLogFiles<=1)q.writeFileSync(this.logFilePath,"");else q.renameSync(this.logFilePath,`${this.logFilePath}.1`)}catch(J){if(process.env.STX_DEBUG==="true")console.error("Failed to rotate error logs:",J)}}getRecentErrors(q=10){return this.errors.slice(-q)}getErrorsByType(q){return this.errors.filter((J)=>J.error.constructor.name===q)}getErrorsByLevel(q){return this.errors.filter((J)=>J.level===q)}clear(){this.errors.length=0}async clearLogFile(){try{let q=await import("fs");if(q.existsSync(this.logFilePath))q.writeFileSync(this.logFilePath,"","utf-8")}catch(q){if(process.env.STX_DEBUG==="true")console.error("Failed to clear error log:",q)}}getStats(){let q={},J={error:0,warning:0,info:0};for(let Q of this.errors){let Z=Q.error.constructor.name;q[Z]=(q[Z]||0)+1;let $=Q.level||"error";J[$]=(J[$]||0)+1}return{total:this.errors.length,byType:q,byLevel:J}}async exportToFile(q,J="json"){let Q=await import("fs"),$=(await import("path")).dirname(q);if(!Q.existsSync($))Q.mkdirSync($,{recursive:!0});if(J==="json"){let X=this.errors.map((V)=>({timestamp:V.timestamp.toISOString(),level:V.level||"error",type:V.error.constructor.name,message:V.error.message,stack:V.error.stack,context:V.context}));Q.writeFileSync(q,JSON.stringify(X,null,2),"utf-8")}else{let X=this.errors.map((V)=>this.formatEntry(V));Q.writeFileSync(q,X.join(`
|
|
33
|
+
|
|
34
|
+
`),"utf-8")}}async flush(){await this.writeQueue}}var Rq=new C,bq={isDevelopment(){return k()},logDetailedError(q,J){if(!this.isDevelopment())return;if(console.error("=== stx Detailed Error ==="),console.error("Error:",q.message),console.error("Stack:",q.stack),J)console.error("Context:",J);console.error("========================")},createErrorReport(q,J){let Q=["=== stx Error Report ===",`Time: ${new Date().toISOString()}`,`Error: ${q.message}`,`Type: ${q.constructor.name}`,`Stack: ${q.stack}`];if(J)Q.push(`Context: ${JSON.stringify(J,null,2)}`);return Q.push("========================"),Q.join(`
|
|
35
|
+
`)}};import g from"path";var v={isValidFilePath(q,J){let Q=q.replace(/\\/g,"/");if(Q.includes("\x00"))return!1;if(Q.includes("../")||Q.includes("..\\")||Q===".."||Q.startsWith("../")||Q.endsWith("/..")||Q.includes("/..\\")||Q.includes("\\../"))return!1;if(/^[a-z][a-z0-9+.-]*:/i.test(Q))return!1;if(Q.startsWith("/")){if(["/etc/","/root/","/var/","/usr/","/bin/","/sbin/","/proc/","/sys/","/dev/","/boot/","/home/","/private/","/Library/","/System/"].some((X)=>Q===X.slice(0,-1)||Q.startsWith(X)))return!1}if(/^[a-z]:/i.test(Q)){if(["Windows/","Windows\\","System32/","System32\\","Program Files/","Program Files\\"].some((X)=>Q.includes(X)))return!1}if(J){let $=g.resolve(J,q),X=g.resolve(J);if(!$.startsWith(X+g.sep)&&$!==X)return!1}return!0},isValidVariableName(q){return/^[a-z_$]\w*$/i.test(q)},isValidDirectiveName(q){return/^[a-z][\w-]*$/i.test(q)},isSafeContent(q){return![/<script[^>]*>[\s\S]*?<\/script>/i,/javascript:/i,/data:text\/html/i,/vbscript:/i,/on\w+\s*=/i].some((Q)=>Q.test(q))}};function Sq(q){let J={"&":"&","<":"<",">":">",'"':""","'":"'"};return q.replace(/[&<>"']/g,(Q)=>J[Q]||Q)}function T(q,J={}){let{allowHtml:Q=!1,maxLength:Z=1e4,allowSpecialChars:$=!0,customSanitizer:X}=J,V=[],Y=q,B=!1;if(X){let H=X(Y);if(H!==Y)Y=H,B=!0}if(Y.includes("\x00"))Y=Y.replace(/\0/g,""),B=!0,V.push("Null bytes removed from parameter");if(Y.length>Z)Y=Y.substring(0,Z),B=!0,V.push(`Parameter truncated to ${Z} characters`);if(!Q&&/<[^>]+>/.test(Y))Y=Sq(Y),B=!0,V.push("HTML content was escaped");let G=[{pattern:/javascript:/gi,replacement:"",name:"javascript: URI"},{pattern:/vbscript:/gi,replacement:"",name:"vbscript: URI"},{pattern:/data:text\/html/gi,replacement:"",name:"data:text/html URI"}];for(let{pattern:H,replacement:W,name:M}of G)if(H.test(Y))Y=Y.replace(H,W),B=!0,V.push(`Removed ${M} from parameter`);if(!$){let H=Y;if(Y=Y.split("").filter((W)=>{let M=W.charCodeAt(0);return M>=32&&M!==127}).join(""),Y!==H)B=!0,V.push("Control characters removed")}return{value:Y,modified:B,warnings:V}}function Pq(q,J){let Q=q.replace(/\0/g,"");Q=Q.replace(/\\/g,"/"),Q=Q.replace(/^[a-z][a-z0-9+.-]*:/i,"");while(Q.includes("../")||Q.includes("./"))Q=Q.replace(/\.\.\//g,"").replace(/\.\//g,"");if(!v.isValidFilePath(Q,J))return null;return Q}function Cq(q){let J=[],Q=q.trim(),Z=Q!==q,$=[{pattern:/\beval\s*\(/gi,name:"eval()"},{pattern:/\bFunction\s*\(/gi,name:"Function()"},{pattern:/\bsetTimeout\s*\(/gi,name:"setTimeout()"},{pattern:/\bsetInterval\s*\(/gi,name:"setInterval()"},{pattern:/\bimport\s*\(/gi,name:"dynamic import()"},{pattern:/\brequire\s*\(/gi,name:"require()"},{pattern:/\b__proto__\b/gi,name:"__proto__"},{pattern:/\bconstructor\b/gi,name:"constructor"},{pattern:/\bprototype\b/gi,name:"prototype"}];for(let{pattern:X,name:V}of $)if(X.test(Q))J.push(`Potentially dangerous pattern detected: ${V}`);if(Q.includes("\x00"))Q=Q.replace(/\0/g,""),Z=!0,J.push("Null bytes removed from expression");return{value:Q,modified:Z,warnings:J}}function gq(q,J={}){return q.map((Q)=>T(Q,J))}function r(q){let J={};for(let[Q,Z]of Object.entries(q)){if(!v.isValidVariableName(Q))continue;if(typeof Z==="string"){let $=T(Z);J[Q]=$.value}else if(Array.isArray(Z))J[Q]=Z.map(($)=>typeof $==="string"?T($).value:$);else if(typeof Z==="object"&&Z!==null)J[Q]=r(Z);else J[Q]=Z}return J}var vq={maxSanitizeDepth:10,allowBracketNotation:!1},e={...vq};var R=/\bnew\s+/,b="__stx_safe_ctors",qq=[/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,/\b(process|require|import|exports|module)\b/,/\b(window|document|global|globalThis)\b/,/\b(constructor|prototype|__proto__)\b/,/\b(Reflect|Proxy)\b/,/\bSymbol\b/,/\b(WeakMap|WeakSet|WeakRef|FinalizationRegistry)\b/,/\b(Generator|AsyncGenerator)\b/,/__\w+__/,/\.(bind|call|apply)\s*\(/,R,/\bdelete\s+/,/\bthis\b/],hq=new Set(["eval","Function","setTimeout","setInterval","setImmediate","process","require","import","exports","module","window","document","global","globalThis","constructor","prototype","Reflect","Proxy","Symbol","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Generator","AsyncGenerator","delete","this",b]),Jq=new Set(["__proto__","constructor","prototype"]),Eq=/[\w)\]]\s*\[\s*['"]/;function Qq(q){let J="",Q=[],Z=null,$=!1;for(let X=0;X<q.length;X++){let V=q[X];if($){$=!1;continue}if(V==="\\"&&Z){$=!0;continue}if(Z){if(Z==="`"&&V==="$"&&X+1<q.length&&q[X+1]==="{"){let Y=1;X+=2;while(X<q.length&&Y>0){if(q[X]==="{")Y++;else if(q[X]==="}")Y--;if(Y>0)J+=q[X],Q.push(X),X++}continue}if(V===Z)Z=null;continue}if(V==='"'||V==="'"||V==="`"){Z=V;continue}J+=V,Q.push(X)}return{text:J,map:Q}}function yq(q){return Qq(q).text}var Zq=["Collator","DateTimeFormat","DisplayNames","ListFormat","Locale","NumberFormat","PluralRules","RelativeTimeFormat","Segmenter"],$q=(()=>{let q={Date,URL,URLSearchParams},J=Intl;for(let Q of Zq)if(typeof J[Q]==="function")q[`Intl_${Q}`]=J[Q];return Object.freeze(Object.assign(Object.create(null),q))})(),uq=/^new(\s+)(Date|URLSearchParams|URL|Intl\s*\.\s*([A-Z_a-z]\w*))\s*\(/,n=/(?<![\w$])new(?![\w$])/g,i=`only new Date(), new URL(), new URLSearchParams() and new Intl.{${Zq.join(",")}}() are allowed`;function fq(q){let{text:J,map:Q}=Qq(q),Z=[];n.lastIndex=0;let $;while(($=n.exec(J))!==null){let V=$.index;if(/(?<!\.)\.\s*$/.test(J.slice(0,V)))continue;let Y=uq.exec(J.slice(V)),B=Y?.[3],G=!Y?null:B?`Intl_${B}`:Y[2];if(!Y||!G||!(G in $q))throw new F(`matched /${R.source}/; ${i}`,q);let H=V+Y[0].length,W=Q[V],M=Q[H-1]+1;if(q.slice(W,M)!==J.slice(V,H))throw new F(`matched /${R.source}/; ${i}`,q);let I=W+3+Y[1].length;Z.push({start:I,end:I+Y[2].length,key:G})}let X=q;for(let V=Z.length-1;V>=0;V--){let Y=Z[V];X=`${X.slice(0,Y.start)}${b}.${Y.key}${X.slice(Y.end)}`}return{source:X,usesSafeConstructors:Z.length>0}}class F extends Error{rule;expression;constructor(q,J,Q){super(Q??`Potentially unsafe expression (${q}): ${J}`);this.name="UnsafeExpressionError",this.rule=q,this.expression=J}}function KJ(q){try{return E(q),null}catch(J){return J instanceof F?J.rule:J instanceof Error?J.message:String(J)}}function xq(q,J){let Q=/[$A-Z_a-z][$\w]*/g,Z;while((Z=Q.exec(q))!==null){let $=Z[0],X=q[Z.index-1];if(hq.has($))throw new F(`matched /\\b${$}\\b/; identifier ${$}`,J);if(X==="."&&Jq.has($))throw new F(`matched /.${$}/; property ${$}`,J)}}function mq(q){let J=/\[\s*(['"])(.*?)\1\s*\]/g,Q;while((Q=J.exec(q))!==null){let Z=Q[2];if(!Jq.has(Z))continue;let $=q.slice(0,Q.index).match(/\S(?=\s*$)/)?.[0],X=q.slice(Q.index+Q[0].length).match(/^\s*(\S)/)?.[1];if(!(($==="{"||$===",")&&X===":"))throw new F(`bracket key ${Q[2]}`,q)}}function E(q){let J=q.trim(),Q=yq(J);xq(Q,J),mq(J);for(let Z of qq){if(Z===R)continue;if(Z.test(Q))throw new F(`matched /${Z.source}/`,J)}if(!e.allowBracketNotation&&Eq.test(J))throw new F("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })",J,`Bracket notation with strings not allowed: ${J}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);return fq(J)}function cq(q){return E(q),q.trim()}function dq(q){let J={};J.Math=Math,J.JSON=JSON,J.Date=Date,J.String=String,J.Number=Number,J.Boolean=Boolean,J.Array=Array,J.parseInt=Number.parseInt,J.parseFloat=Number.parseFloat,J.isNaN=Number.isNaN,J.isFinite=Number.isFinite,J.encodeURIComponent=encodeURIComponent,J.decodeURIComponent=decodeURIComponent;for(let[Q,Z]of Object.entries(q)){if(Q.startsWith("__")||qq.some(($)=>$.test(Q)))continue;if(Z&&typeof Z==="object"&&!Array.isArray(Z))J[Q]=h(Z);else J[Q]=Z}return J}function h(q,J=0){if(J>=e.maxSanitizeDepth)return"[Object too deep]";if(q===null||typeof q!=="object")return q;if(Array.isArray(q))return q.map((Z)=>h(Z,J+1));if(q instanceof Date||q instanceof RegExp||q instanceof Map||q instanceof Set||q instanceof Error)return q;let Q={};for(let[Z,$]of Object.entries(q)){if(Z.startsWith("__")||Z==="constructor"||Z==="prototype")continue;if($&&typeof $==="object")Q[Z]=h($,J+1);else Q[Z]=$}return Q}function pq(q,J){try{let Q=dq(J),Z=Object.keys(Q),$=Object.values(Q);return rq(q,Z)(...$)}catch{return}}function OJ(q){try{return cq(q),!0}catch{return!1}}function kJ(q,J){try{let Q=pq(q,J);if(Q&&typeof Q==="object"&&!Array.isArray(Q))return Q;return{}}catch{return{}}}var Xq=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","yield","let","static","implements","interface","package","private","protected","public","arguments","eval","await"]),lq=2000,A=new Map;function a(q,J){let Q=`${q.join(",")}\x00${J}`,Z=A.get(Q);if(Z)return Z;let $=Function(...q,J);if(A.size>=lq)A.clear();return A.set(Q,$),$}function zJ(q){return q.replace(/'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`/g," ").replace(/\??\.\s*[a-zA-Z_$][\w$]*/g," ").replace(/([{,]\s*)[a-zA-Z_$][\w$]*(\s*:)/g,"$1$2").match(/\b[a-zA-Z_$][\w$]*\b/g)||[]}var oq=/^[A-Za-z_$][\w$]*$/;function sq(q){return oq.test(q)&&!Xq.has(q)}function rq(q,J){let{source:Q,usesSafeConstructors:Z}=E(q),$=[];for(let G=0;G<J.length;G++){if(!sq(J[G]))continue;if(J[G]===b)continue;$.push({key:J[G],index:G})}$.sort((G,H)=>G.key.localeCompare(H.key));let X=$.map((G)=>G.key),V=$.map((G)=>G.index),Y=`
|
|
36
|
+
'use strict';
|
|
37
|
+
try {
|
|
38
|
+
return ${Q};
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
if (e instanceof TypeError) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
throw e;
|
|
45
|
+
}
|
|
46
|
+
`;return nq(Z?(G)=>{let H=a([b,...X,...G],Y);return(...W)=>H($q,...W)}:(G)=>a([...X,...G],Y),X,J,$,V)}function nq(q,J,Q,Z,$){let X=q([]),V=Z.every((B,G)=>B.index===G);if(J.length===Q.length&&V)return t(X,J,q);return t((...B)=>{let G=Array($.length);for(let H=0;H<$.length;H++)G[H]=B[$[H]];return X(...G)},J,q,(B)=>{X=q(B)})}function t(q,J,Q,Z){let X=/^(\w+) is not defined$/,V=q,Y=[],B=new Set(J);return(...G)=>{for(let H=0;H<=8;H++)try{return V(...G)}catch(W){let M=W instanceof Error?W.message:"",I=X.exec(M);if(!(W instanceof ReferenceError)||!I)return;let j=I[1];if(B.has(j)||Xq.has(j))return;if(B.add(j),Y.push(j),Z)Z(Y);else V=Q(Y)}return}}function LJ(q){let J=q.trim(),Q=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let Z of Q)if(Z.test(J))return!1;return!0}
|
|
47
|
+
export{Gq as Ut,Bq as Vt,Hq as Wt,Wq as Xt,f as Yt,Mq as Zt,w as _t,S as $t,Iq as au,k as bu,aq as cu,Fq as du,_ as eu,jq as fu,N as gu,U as hu,m as iu,c as ju,d as ku,p as lu,l as mu,P as nu,zq as ou,Lq as pu,_q as qu,Nq as ru,Tq as su,Aq as tu,C as uu,Rq as vu,bq as wu,v as xu,T as yu,Pq as zu,Cq as Au,gq as Bu,r as Cu,KJ as Du,cq as Eu,pq as Fu,OJ as Gu,kJ as Hu,zJ as Iu,sq as Ju,rq as Ku,LJ as Lu};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ag as c,Bg as d,Cg as e,Dg as f,Eg as g,Fg as h,Gg as i,Hg as j,Ig as k,Jg as l,yg as a,zg as b}from"./chunk-8bxtvsgm.js";import"./chunk-5ep11kvc.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Go as R,Ip as H,jq as x,or as g,wm as O}from"./chunk-sy44sx1e.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
4
|
</div>`),w.set(Z.name,H(Z.content,j,q,G,$))}K.enqueue(`
|
|
5
5
|
<script>
|
|
@@ -191,4 +191,4 @@ else {
|
|
|
191
191
|
stx.hydrate();
|
|
192
192
|
}
|
|
193
193
|
})();`}
|
|
194
|
-
export{r as
|
|
194
|
+
export{r as Mi,N as Ni,C as Oi,s as Pi,a as Qi,o as Ri,n as Si,e as Ti,d as Ui,h as Vi,t as Wi,qq as Xi,Bq as Yi,Gq as Zi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Am as l,Bm as m,Cm as n,Dm as o,Em as p,Fm as q,Gm as r,pm as a,qm as b,rm as c,sm as d,tm as e,um as f,vm as g,wm as h,xm as i,ym as j,zm as k}from"./chunk-sy44sx1e.js";import"./chunk-bafd6h7t.js";import"./chunk-tf3b833n.js";import"./chunk-psazw7p1.js";import"./chunk-x5y9r3f2.js";import"./chunk-9kb0qv47.js";import"./chunk-nzbdgx7d.js";import"./chunk-jc3t5y1y.js";import"./chunk-rb69qb49.js";import"./chunk-eeg62zy4.js";import"./chunk-pt4xht7s.js";import"./chunk-5sqbd646.js";import"./chunk-akdryjck.js";import"./chunk-yjkaqxtc.js";import"./chunk-tp6wkx7g.js";import"./chunk-557n2zx7.js";import"./chunk-tjhzxbxa.js";import"./chunk-s9hsxhb5.js";import"./chunk-qnx0eb8x.js";import"./chunk-5ep11kvc.js";export{j as usesSignalsInScript,r as unescapeHtml,p as resetRejectedExpressionWarnings,g as replaceInterpolations,c as registerFilters,b as registerFilter,n as processExpressions,m as interpolateScriptsInTemplate,k as interpolateScriptExpressions,l as interpolateScriptAttributes,d as getAllFilters,f as findMustacheEnd,q as evaluateExpression,i as escapeHtmlValue,h as escapeHtml,a as defaultFilters,e as clearCustomFilters,o as applyFilters};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{wg as I}from"./chunk-57atgbyq.js";import{qr as H}from"./chunk-sy44sx1e.js";import{rw as G}from"./chunk-5ep11kvc.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.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,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-0tc5p1ty.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
|
|
3
3
|
export{Q as Ue};
|