@stacksjs/stx 0.2.441 → 0.2.442
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-06qhvtsv.js +2 -0
- package/dist/{chunk-4gmdfym5.js → chunk-0ahjxtkx.js} +22 -22
- package/dist/chunk-0e6da0m4.js +2 -0
- package/dist/{chunk-zfzcedw4.js → chunk-0vbpcef6.js} +4 -4
- package/dist/{chunk-nvht5259.js → chunk-0xntpjmp.js} +3 -3
- package/dist/{chunk-fg5ve6ey.js → chunk-149r1q6c.js} +2 -2
- package/dist/{chunk-a9necy79.js → chunk-1ghj9pgz.js} +154 -154
- package/dist/chunk-1gsr2z6s.js +2 -0
- package/dist/chunk-1k55q9ff.js +2 -0
- package/dist/{chunk-489z8wry.js → chunk-1qnyn82e.js} +2 -2
- package/dist/{chunk-dc89a93n.js → chunk-1rn1g4ac.js} +11 -11
- package/dist/chunk-1s04q9hz.js +2 -0
- package/dist/chunk-224x6rsx.js +2 -0
- package/dist/chunk-2rs6n7c0.js +2 -0
- package/dist/{chunk-1yj3p63h.js → chunk-2xnwsavq.js} +2 -2
- package/dist/{chunk-xfv7evmd.js → chunk-3n8qh43z.js} +3 -3
- package/dist/chunk-3wezvz6m.js +2 -0
- package/dist/chunk-41fbr3m6.js +2 -0
- package/dist/chunk-4ct5vj9n.js +2 -0
- package/dist/chunk-4ta6131h.js +2 -0
- package/dist/chunk-5402rpwg.js +2 -0
- package/dist/{chunk-b9wpgn7b.js → chunk-56hvemdx.js} +5 -5
- package/dist/chunk-5tx1wqns.js +2 -0
- package/dist/chunk-5vgyr78g.js +2 -0
- package/dist/{chunk-t7x753ga.js → chunk-5zpt78j4.js} +4 -4
- package/dist/{chunk-7a0ffmer.js → chunk-6a1jr9pp.js} +4 -4
- package/dist/chunk-6nxzh304.js +2 -0
- package/dist/{chunk-8x47zcfa.js → chunk-73h7qjgq.js} +2 -2
- package/dist/chunk-7416mm6g.js +2 -0
- package/dist/{chunk-8wkja2z2.js → chunk-7676qzab.js} +3 -3
- package/dist/chunk-7cdrpkzz.js +2 -0
- package/dist/{chunk-yhxazetv.js → chunk-7cvc6hdw.js} +6 -6
- package/dist/{chunk-s28eh0jn.js → chunk-7mbx7dzg.js} +2 -2
- package/dist/{chunk-36kkc60p.js → chunk-7x8nd4fw.js} +3 -3
- package/dist/{chunk-74j5jbs6.js → chunk-81zfdd95.js} +3 -3
- package/dist/{chunk-5vwg3h5g.js → chunk-8nsmx2w4.js} +2 -2
- package/dist/{chunk-nq7z26y6.js → chunk-8sbm4bza.js} +5 -5
- package/dist/{chunk-acwgap78.js → chunk-9ad04ksh.js} +1 -1
- package/dist/{chunk-3rbz496d.js → chunk-9f0srtmg.js} +1 -1
- package/dist/{chunk-w040f2er.js → chunk-a3smkhem.js} +2 -2
- package/dist/chunk-a8hjvjb8.js +2 -0
- package/dist/{chunk-my3jkpv7.js → chunk-aa7w63xc.js} +7 -7
- package/dist/{chunk-tywmtk33.js → chunk-ak7eyyka.js} +2 -2
- package/dist/{chunk-pxqs3psa.js → chunk-b5emjcf1.js} +4 -4
- package/dist/{chunk-p2x7tjbt.js → chunk-bbnyq3gm.js} +2 -2
- package/dist/chunk-bcgth8qf.js +2 -0
- package/dist/{chunk-b8dbq51z.js → chunk-bh432b7n.js} +2 -2
- package/dist/chunk-by1s70jp.js +2 -0
- package/dist/{chunk-wtms9jhs.js → chunk-cm875f73.js} +2 -2
- package/dist/chunk-cpfnd8ta.js +2 -0
- package/dist/{chunk-721yq8qx.js → chunk-cs15xqf0.js} +4 -4
- package/dist/chunk-d59cjrpm.js +2 -0
- package/dist/chunk-d6npyn3x.js +2 -0
- package/dist/chunk-dftp2bp0.js +2 -0
- package/dist/{chunk-24e7qjb8.js → chunk-dn9thd0h.js} +2 -2
- package/dist/{chunk-114zdbnd.js → chunk-dqr5n49p.js} +2 -2
- package/dist/chunk-drsy8gek.js +2 -0
- package/dist/chunk-dvja1k84.js +2 -0
- package/dist/{chunk-4xemkkm8.js → chunk-dwp3knc4.js} +3 -3
- package/dist/chunk-e1n2t5tk.js +2 -0
- package/dist/{chunk-ydz7w2mt.js → chunk-f85dyf2f.js} +1 -1
- package/dist/chunk-fgedcdc1.js +2 -0
- package/dist/chunk-fm3k5v8s.js +2 -0
- package/dist/{chunk-thx147nq.js → chunk-fmj4xvqm.js} +5 -5
- package/dist/{chunk-5zahqrb4.js → chunk-fx994kkj.js} +6 -6
- package/dist/chunk-gsgkaa1g.js +2 -0
- package/dist/{chunk-6wmxrn6x.js → chunk-gvefw19e.js} +1 -1
- package/dist/{chunk-m607bd3m.js → chunk-h7ny0py8.js} +5 -5
- package/dist/{chunk-hc9242wm.js → chunk-hkx8pggg.js} +1 -1
- package/dist/{chunk-bjnvymb7.js → chunk-hqywyyez.js} +5 -5
- package/dist/{chunk-tprtjzzc.js → chunk-htwgkg91.js} +5 -5
- package/dist/{chunk-44zjqsh9.js → chunk-hwaxjfr0.js} +2 -2
- package/dist/{chunk-vzek2z1v.js → chunk-j0nyamyf.js} +1 -1
- package/dist/chunk-j3gcjbnm.js +2 -0
- package/dist/{chunk-ptjqacjd.js → chunk-jwpcck1b.js} +2 -2
- package/dist/chunk-k2k6engs.js +2 -0
- package/dist/chunk-kagy1rcd.js +2 -0
- package/dist/{chunk-5ty8h14h.js → chunk-kpz3tpx7.js} +4 -4
- package/dist/chunk-kr2phxhf.js +2 -0
- package/dist/{chunk-771hf74z.js → chunk-m0nw8he9.js} +5 -5
- package/dist/chunk-m3f50p6c.js +2 -0
- package/dist/{chunk-dtvwes4f.js → chunk-m4q2e418.js} +3 -3
- package/dist/chunk-m90a5dpn.js +2 -0
- package/dist/{chunk-9w5nse46.js → chunk-mcgpeyy8.js} +4 -4
- package/dist/{chunk-w2085fwx.js → chunk-mnz6bdp3.js} +5 -5
- package/dist/{chunk-93e1nf1y.js → chunk-mx9wp3va.js} +1 -1
- package/dist/{chunk-j1q65enz.js → chunk-n9jn3qzw.js} +2 -2
- package/dist/chunk-nqcg2bf0.js +2 -0
- package/dist/{chunk-3hmy75tw.js → chunk-nw8p8eg9.js} +5 -5
- package/dist/chunk-pe9hxhrb.js +2 -0
- package/dist/{chunk-3akpy7er.js → chunk-phafsgd9.js} +10 -10
- package/dist/{chunk-p4wvc7wx.js → chunk-qa7j3j71.js} +6 -6
- package/dist/chunk-qg5e32gx.js +2 -0
- package/dist/chunk-qqq7jr16.js +2 -0
- package/dist/chunk-qy8wb31b.js +2 -0
- package/dist/{chunk-ccq35xp7.js → chunk-r3f9jcf7.js} +3 -3
- package/dist/chunk-ra2wyhrd.js +2 -0
- package/dist/{chunk-8zf5q1m3.js → chunk-rdq113p4.js} +2 -2
- package/dist/chunk-rk3nsd1x.js +2 -0
- package/dist/chunk-rmnhy5az.js +2 -0
- package/dist/{chunk-spx27cs4.js → chunk-rvbcnahe.js} +2 -2
- package/dist/chunk-rwdkh7c0.js +2 -0
- package/dist/{chunk-4wf68rht.js → chunk-s5drjm2j.js} +6 -6
- package/dist/{chunk-zpnz1k3b.js → chunk-t5wfq4r9.js} +2 -2
- package/dist/{chunk-hnep9jbj.js → chunk-tn85vr56.js} +2 -2
- package/dist/chunk-tr1q484n.js +2 -0
- package/dist/chunk-tz32ndmq.js +2 -0
- package/dist/chunk-v404gvm0.js +2 -0
- package/dist/chunk-v4mrkvzc.js +33 -0
- package/dist/{chunk-r9vrqxma.js → chunk-v93znq7a.js} +1 -1
- package/dist/chunk-vhywbdej.js +2 -0
- package/dist/{chunk-3pxp0r0a.js → chunk-vxgtq00t.js} +3 -3
- package/dist/{chunk-r7pmpd2x.js → chunk-wbdk7bcw.js} +1 -1
- package/dist/{chunk-5ahb6arz.js → chunk-wf2gq6hc.js} +2 -2
- package/dist/chunk-wn1p05ac.js +2 -0
- package/dist/chunk-xf873x70.js +2 -0
- package/dist/{chunk-mtb5000n.js → chunk-xh420ckt.js} +2 -2
- package/dist/{chunk-7x8qwshk.js → chunk-xq4jdzje.js} +4 -4
- package/dist/chunk-y3695sgc.js +2 -0
- package/dist/chunk-ye27ept1.js +2 -0
- package/dist/chunk-ymvdbs80.js +2 -0
- package/dist/chunk-yqnkzkd3.js +2 -0
- package/dist/{chunk-tnbgy59s.js → chunk-yva29j3q.js} +3 -3
- package/dist/chunk-zntspqxt.js +2 -0
- package/dist/cli.js +19 -19
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/bridge/protocol.d.ts +1 -0
- package/dist/native/compiler/headwind-to-style.js +14 -6
- package/dist/native/compiler/icons.d.ts +1 -0
- package/dist/native/compiler/icons.js +1 -0
- package/dist/native/primitives/Icon.stx +1 -1
- package/dist/native/runtime/craft-bridge.js +6 -1
- package/dist/native/runtime/craft.d.ts +4 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +3 -3
- package/package.json +5 -5
- package/dist/chunk-053t5wrs.js +0 -2
- package/dist/chunk-0jgvwa50.js +0 -2
- package/dist/chunk-0n28xm1q.js +0 -2
- package/dist/chunk-1cq9w2qz.js +0 -2
- package/dist/chunk-1n7d9ag2.js +0 -2
- package/dist/chunk-259ecbwa.js +0 -2
- package/dist/chunk-386zrhbf.js +0 -2
- package/dist/chunk-397fy72k.js +0 -2
- package/dist/chunk-48w0qzmk.js +0 -2
- package/dist/chunk-4bpc0tsf.js +0 -2
- package/dist/chunk-535nrr6j.js +0 -2
- package/dist/chunk-60j147cj.js +0 -2
- package/dist/chunk-67r98kff.js +0 -2
- package/dist/chunk-6c7294j8.js +0 -2
- package/dist/chunk-6faqgn2f.js +0 -2
- package/dist/chunk-7pbv9mg7.js +0 -2
- package/dist/chunk-7tkwt0a9.js +0 -2
- package/dist/chunk-87c76jq3.js +0 -2
- package/dist/chunk-88ey0pdm.js +0 -2
- package/dist/chunk-8h0nbb7t.js +0 -2
- package/dist/chunk-9yy4fyq6.js +0 -2
- package/dist/chunk-a88mq2k6.js +0 -2
- package/dist/chunk-awqft00q.js +0 -2
- package/dist/chunk-cczrcjfs.js +0 -2
- package/dist/chunk-cnmz9543.js +0 -2
- package/dist/chunk-cv56m171.js +0 -2
- package/dist/chunk-ed7p2a5q.js +0 -2
- package/dist/chunk-fg8kmyz8.js +0 -2
- package/dist/chunk-gq16fxc2.js +0 -2
- package/dist/chunk-h4avjh3q.js +0 -2
- package/dist/chunk-k5tcanyq.js +0 -2
- package/dist/chunk-k6kvgdd0.js +0 -2
- package/dist/chunk-kcwz3kvn.js +0 -2
- package/dist/chunk-ksyb5bgt.js +0 -2
- package/dist/chunk-mh4qh1dk.js +0 -2
- package/dist/chunk-p3462q2p.js +0 -2
- package/dist/chunk-pey0cpyh.js +0 -2
- package/dist/chunk-q5433grh.js +0 -2
- package/dist/chunk-qke87dwv.js +0 -2
- package/dist/chunk-r089d1s4.js +0 -2
- package/dist/chunk-rnjkfhh0.js +0 -2
- package/dist/chunk-s4ypqjhp.js +0 -2
- package/dist/chunk-st6exqqv.js +0 -2
- package/dist/chunk-tv7hxprx.js +0 -2
- package/dist/chunk-veqzjwty.js +0 -2
- package/dist/chunk-vw8a7yfw.js +0 -2
- package/dist/chunk-vwms759h.js +0 -2
- package/dist/chunk-vzey1tm1.js +0 -2
- package/dist/chunk-w7zh2avv.js +0 -2
- package/dist/chunk-w88efb66.js +0 -2
- package/dist/chunk-xeb3vyhx.js +0 -2
- package/dist/chunk-xq5hzqg5.js +0 -2
- package/dist/chunk-xx5gx241.js +0 -2
- package/dist/chunk-ynrnx1tp.js +0 -2
- package/dist/chunk-z9154ddm.js +0 -2
- package/dist/chunk-zdkspb3m.js +0 -2
- package/dist/chunk-zg79w3gk.js +0 -33
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p,l}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{p,l}from"./chunk-56hvemdx.js";import{h}from"./chunk-1ghj9pgz.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var x=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function b(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=b(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=b(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let c=i.lastIndexOf(u);if(c!==-1)i.splice(c);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let c=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),S=g||x.has(u)?-1:N(t,u,s);if(S===-1)o.push({start:n,end:s,slotName:c,element:m}),e=s;else o.push({start:n,end:S,slotName:c,element:m+t.slice(s,S)}),e=S;continue}if(!g&&!x.has(u)){if(i.push(u),u==="script"||u==="style"){let c=t.toLowerCase().indexOf(`</${u}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=b(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let c=i.lastIndexOf(g);if(c!==-1)i.splice(c);e=s;continue}if(g==="template"&&i.length===0){let c=a.match(r);if(c){let m=y(t,s);if(m!==-1){let S=c[1]||c[2]||c[3];o.push({start:n,end:m,slotName:S,content:t.slice(s,m-11).trim(),propsBinding:c[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!x.has(g)){if(i.push(g),g==="script"||g==="style"){let c=t.toLowerCase().indexOf(`</${g}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function Jo(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function ll(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function Yo(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((c)=>c.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return h(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return l(t,Object.keys(o))(...Object.values(o))}catch{return}}async function Zo(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",c=f||"",m={},S=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,w;while((w=S.exec(c))!==null){let E=w[1],R=w[2];m[E]=k(R,i)}return await Yo(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function ul(t){let o=Jo(t);return{defaultSlot:o.default,namedSlots:o.named}}async function dl(t,o,i,r){return await Zo(t,{default:o,named:i},r)}
|
|
3
|
+
export{Jo,ll,Yo,Zo,ul,dl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,o}from"./chunk-
|
|
2
|
+
import{t,o}from"./chunk-56hvemdx.js";import{Xe,Ge,Je,ue,we,k,Qn,cn,pe}from"./chunk-cs15xqf0.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,x=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function S(e,r){return(n)=>k(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Ss(e,r,n,p){if(!e.includes("@meta"))return e;let i=Xe(e,I,(s,c)=>{let a=cn(Ge(s),r);if(a.kind==="tag")return j(a.tag);if(a.kind==="empty")return"";return k("Meta",c,a.message,n,a.code)},S("Meta",n));return i=Xe(i,C,(s,c)=>{let a=Je(s,r);if(!a.ok)return k("MetaTag",c,a.message,n,a.code);if(a.value===void 0||a.value===null)return"";if(!we(a.value))return k("MetaTag",c,`expected an object such as { name, content }, got ${ue(a.value)}`,n,t.TYPE_ERROR);let u=a.value;if(!u.name&&!u.property&&!u.httpEquiv)return k("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let g="<meta";if(u.name)g+=` name="${l(u.name)}"`;if(u.property)g+=` property="${l(u.property)}"`;if(u.httpEquiv)g+=` http-equiv="${l(u.httpEquiv)}"`;return g+=` content="${l(u.content)}">`,g},S("MetaTag",n)),i}function R(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(we(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(we))return e.map(r);return null}function _(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function ks(e,r,n){if(!e.includes("@structuredData"))return e;return Xe(e,x,(p,i)=>{let s=Je(p,r);if(!s.ok)return k("StructuredData",i,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=R(s.value);if(!c)return k("StructuredData",i,`expected an object or an array of objects, got ${ue(s.value)}`,n,t.TYPE_ERROR);try{return _(c)}catch(a){let u=a instanceof Error?a.message:String(a);return k("StructuredData",i,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},S("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),E={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Cs(e,r,n,p){if(!e.includes("@seo"))return e;return Xe(e,N,(i,s)=>{if(!i.trim())return k("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=Je(i,r);if(!c.ok)return k("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!we(c.value))return k("SEO",s,`expected an object such as { title, description }, got ${ue(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(a){let u=a instanceof Error?a.message:String(a);return k("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},S("SEO",n))}function A(e,r,n,p){let i=e[r];if(i===void 0||i===null||i===!1)return;if(we(i))return i;Qn(n,`${r} must be an object, got ${ue(i)}; its tags were left out`,p);return}function q(e,r,n){let p=Object.keys(e).filter((a)=>!L.has(a));if(p.length>0){let a=p.map((u)=>E[u]?`${u} (use ${E[u]})`:u).join(", ");Qn(r,`@seo does not read ${a}; ${p.length===1?"it was":"they were"} ignored`,n)}let i="";if(e.title)i+=`<title>${l(e.title)}</title>
|
|
3
3
|
`,i+=`<meta name="title" content="${l(e.title)}">
|
|
4
4
|
`;if(e.description)i+=`<meta name="description" content="${l(e.description)}">
|
|
5
5
|
`;if(e.keywords){let a=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;i+=`<meta name="keywords" content="${l(a)}">
|
|
@@ -25,7 +25,7 @@ import{t,o}from"./chunk-b9wpgn7b.js";import{Xe,Ge,Je,ue,we,k,Zn,cn,pe}from"./chu
|
|
|
25
25
|
`}if(c.site)i+=`<meta name="twitter:site" content="${l(c.site)}">
|
|
26
26
|
`;if(c.creator)i+=`<meta name="twitter:creator" content="${l(c.creator)}">
|
|
27
27
|
`}if(e.structuredData!==void 0&&e.structuredData!==null){let a=R(e.structuredData);if(a)i+=`${_(a)}
|
|
28
|
-
`;else
|
|
28
|
+
`;else Qn(r,`structuredData must be an object or an array of objects, got ${ue(e.structuredData)}; it was left out`,n)}return i.trim()}function $s(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let p=r.__stx_runtime_head;if(!!(p?.title||p?.meta?.some((w)=>w.property==="og:title"||w.name==="og:title"||w.name==="twitter:title"||w.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=M(e),a=V(c),u=U(c),g="";if(r.title)g=r.title;else if(r.meta&&r.meta.title)g=r.meta.title;else if(a)g=a;else if(n.seo?.defaultConfig?.title)g=n.seo.defaultConfig.title;else g=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
|
|
29
29
|
<meta name="title" content="${l(g)}">`,h=G(c)?"":`
|
|
30
30
|
<meta name="description" content="${l(m)}">`,T=`
|
|
31
31
|
<!-- stx SEO Tags -->${f}${h}
|
|
@@ -43,7 +43,7 @@ import{t,o}from"./chunk-b9wpgn7b.js";import{Xe,Ge,Je,ue,we,k,Zn,cn,pe}from"./chu
|
|
|
43
43
|
${T}
|
|
44
44
|
`),y;return y.replace(/<head[^>]*>/,`$&
|
|
45
45
|
${T}
|
|
46
|
-
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function b(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?b(r[1].trim()):""}function v(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return v(e).length>0}function U(e){for(let r of v(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),p=(n?.[1]??n?.[2]??"").trim();if(p)return b(p)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var
|
|
46
|
+
`)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function b(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/�*39;|'/g,"'").replace(/&/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?b(r[1].trim()):""}function v(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return v(e).length>0}function U(e){for(let r of v(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),p=(n?.[1]??n?.[2]??"").trim();if(p)return b(p)}return""}function l(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var Jn={name:"meta",rawParams:!0,handler:(e,r,n,p)=>{let i=cn(r,n??{});if(i.kind==="error")return k("Meta",`@meta(${r.join(", ")})`,i.message,p,i.code);if(i.kind==="empty")return"";if(n)n.__stx_runtime_head=pe(n.__stx_runtime_head??{},{meta:[i.tag]});return""},hasEndTag:!1},Yn={name:"structuredData",handler:(e,r,n,p)=>{if(e.trim()==="")return o("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let i=JSON.parse(e);if(!i["@context"])i["@context"]="https://schema.org";if(!i["@type"])return o("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return _(i)}catch(i){let s=i instanceof Error?i.message:String(i);return o("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function zu(){return[Jn,Yn]}function Hu(e,r){let{baseUrl:n,defaultChangefreq:p="weekly",defaultPriority:i=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,"");return`<?xml version="1.0" encoding="UTF-8"?>
|
|
47
47
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
48
48
|
${e.map((u)=>{let g=u.loc.startsWith("http")?u.loc:`${c}${u.loc.startsWith("/")?"":"/"}${u.loc}`,m=u.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),d=u.changefreq||p,f=u.priority??i,h=` <url>
|
|
49
49
|
<loc>${O(g)}</loc>`;if(m)h+=`
|
|
@@ -52,13 +52,13 @@ ${e.map((u)=>{let g=u.loc.startsWith("http")?u.loc:`${c}${u.loc.startsWith("/")?
|
|
|
52
52
|
<priority>${f.toFixed(1)}</priority>`,h+=`
|
|
53
53
|
</url>`,h}).join(`
|
|
54
54
|
`)}
|
|
55
|
-
</urlset>`}function
|
|
55
|
+
</urlset>`}function Vu(e,r){let n=r.replace(/\/$/,""),p=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
|
|
56
56
|
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
57
57
|
${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
|
|
58
58
|
<loc>${O(c)}</loc>
|
|
59
59
|
<lastmod>${p}</lastmod>
|
|
60
60
|
</sitemap>`}).join(`
|
|
61
61
|
`)}
|
|
62
|
-
</sitemapindex>`}async function
|
|
63
|
-
`).trim()}function
|
|
64
|
-
export{
|
|
62
|
+
</sitemapindex>`}async function Uu(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:p=["_*",".*","node_modules","components","partials","layouts"]}=r,i=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let a of c.scan(e)){if(p.some((f)=>{if(f.startsWith("*"))return a.includes(f.slice(1));return a.startsWith(f)||a.includes(`/${f}`)}))continue;let g=a.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!g.startsWith("/"))g=`/${g}`;if(g!=="/"&&g.endsWith("/"))g=g.slice(0,-1);let m=`${e}/${a}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}i.push({loc:g||"/",lastmod:d,priority:g==="/"?1:0.5})}return i.sort((a,u)=>a.loc.localeCompare(u.loc)),i}function Zn(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let p of n.allow)r.push(`Allow: ${p}`);if(n.disallow)for(let p of n.disallow)r.push(`Disallow: ${p}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let p of n)r.push(`Sitemap: ${p}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
|
|
63
|
+
`).trim()}function Wu(e){return Zn({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function O(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
64
|
+
export{Ss,ks,Cs,$s,Jn,Yn,zu,Hu,Vu,Uu,Zn,Wu};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function it(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function
|
|
3
|
-
export{it,
|
|
2
|
+
var w={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},R={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function p(e,t){return`${w[t]}${e}\x1B[0m`}function C(e,t){return`${R[t]}${e}\x1B[0m`}var b=(e)=>p(e,"red"),S=(e)=>p(e,"green"),y=(e)=>p(e,"yellow"),O=(e)=>p(e,"blue");var c=(e)=>p(e,"cyan");var a=(e)=>C(e,"bold"),m=(e)=>C(e,"dim");function it(){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" \uD83D\uDCD6 STX Story ")+c("\u2551")),console.log(c(" \u2551")+m(" Component Showcase & Testing ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function ur(e,t){if(console.log(a(" Server running at:")),console.log(""),console.log(` ${m("\u279C")} ${a("Local:")} ${c(e)}`),t)console.log(` ${m("\u279C")} ${a("Network:")} ${c(t)}`);console.log("")}function ot(e){let t=e>0?"\u2713":"\u25CB",r=e>0?S:y;console.log(` ${r(t)} Found ${a(String(e))} story ${e===1?"file":"files"}`)}function Ls(e,t){if(console.log(""),console.log(` ${b("\u2717")} ${a(b("Error:"))} ${e}`),t)console.log(` ${m(t)}`);console.log("")}function ke(e){console.log(` ${y("\u26A0")} ${y("Warning:")} ${e}`)}function js(e){console.log(` ${O("\u2139")} ${e}`)}function Bs(e,t,r){console.log(""),console.log(c(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(c(" \u2551")+a(" Build Complete ")+c("\u2551")),console.log(c(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${S("\u2713")} Stories: ${a(String(e))}`),console.log(` ${S("\u2713")} Output: ${a(t)}`),console.log(` ${S("\u2713")} Time: ${a(`${r}ms`)}`),console.log("")}function dr(){console.log(""),console.log(a(" Keyboard Shortcuts:")),console.log(""),console.log(` ${c("h")} Show this help`),console.log(` ${c("o")} Open in browser`),console.log(` ${c("r")} Restart server`),console.log(` ${c("c")} Clear console`),console.log(` ${c("q")} Quit`),console.log("")}import h from"fs";import d from"path";async function at(e){let{root:t,config:r}=e,o=[],i=await P(t,r.storyMatch,r.storyIgnored);for(let s of i){let n=d.resolve(t,s),l=v(s,n);o.push(l)}return o}async function P(e,t,r){let o=[];async function i(s,n){let l=await h.promises.readdir(s,{withFileTypes:!0});for(let g of l){let f=d.join(s,g.name),u=d.relative(n,f);if(T(u,r))continue;if(g.isDirectory())await i(f,n);else if(g.isFile()){if(F(u,t))o.push(u)}}}return await i(e,e),o}function T(e,t){for(let r of t)if(E(e,r))return!0;return!1}function F(e,t){for(let r of t)if(E(e,r))return!0;return!1}function E(e,t){let r=e.replace(/\\/g,"/"),i=t.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return i=`^${i}$`,new RegExp(i).test(r)}function v(e,t){let r=d.basename(e,".story.stx");return{id:e.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:t,relativePath:e,fileName:r,treeFile:{title:r,path:e}}}function Fs(e,t){let{root:r,config:o}=e,i=[],s=h.watch(r,{recursive:!0},async(n,l)=>{if(!l)return;let g=l.replace(/\\/g,"/");if(!F(g,o.storyMatch))return;if(T(g,o.storyIgnored))return;let f=d.resolve(r,g);try{await h.promises.access(f);let u=v(g,f);t(n==="rename"?"add":"change",u)}catch{let u=v(g,f);t("unlink",u)}});return i.push(s),()=>{for(let n of i)n.close()}}function N(e,t){let r=t.treeFile||{title:t.fileName,path:t.relativePath};if(e.tree.file==="title")return r.title.split("/");if(e.tree.file==="path")return[...t.relativePath.split("/").slice(0,-1),r.title];if(typeof e.tree.file==="function")return e.tree.file(r);return[r.title]}function ct(e,t){for(let n of t)n.treePath=N(e,n);let r=(e.tree.groups||[]).map((n)=>({groupConfig:{id:n.id||n.title,title:n.title,include:n.include},treeObject:{}})),o={treeObject:{}};r.push(o);for(let n=0;n<t.length;n++){let l=t[n],g=j(l,r,o);k(l.treePath,n,g.treeObject)}let i=e.tree.order==="asc"?(n,l)=>n.localeCompare(l):e.tree.order,s=[];for(let n of r)if(n===o)s.push(...x(n.treeObject,i));else if(n.groupConfig&&Object.keys(n.treeObject).length>0)s.push({group:!0,id:n.groupConfig.id,title:n.groupConfig.title,children:x(n.treeObject,i)});return s}function j(e,t,r){let o=e.treeFile||{title:e.fileName,path:e.relativePath};for(let i of t)if(i.groupConfig?.include&&i.groupConfig.include(o))return i;return r}function k(e,t,r){let o=r;for(let i=0;i<e.length;i++){let s=e[i];if(i===e.length-1)if(o[s]!==void 0){let l=1;while(o[`${s}-${l}`]!==void 0)l++;o[`${s}-${l}`]=t}else o[s]=t;else{if(o[s]===void 0)o[s]={};else if(typeof o[s]==="number"){let l=o[s];o[s]={"":l}}o=o[s]}}}function x(e,t){let r=[];for(let[o,i]of Object.entries(e))if(typeof i==="number")r.push({title:o,index:i});else r.push({title:o,children:x(i,t)});return r.sort((o,i)=>t(o.title,i.title)),r}
|
|
3
|
+
export{it,ur,ot,Ls,ke,js,Bs,dr,at,Fs,ct};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import x from"fs";import u from"path";import p from"fs";import v from"path";var y=["components","layouts","partials","emails"];function P(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return P(e.replace(/^\//,""))}function
|
|
3
|
-
`),o=v.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function
|
|
4
|
-
`))}import D from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),I=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),j=new RegExp(`\\.(?:${I})$`),E=`(?![^/]*\\.(?:${I})$)`;function Ze(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&j.test(r)}function R(e,t){let r=D.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(D.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function X(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function gn(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function sr(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return X(a,t)}import K from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(K.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function F(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...F(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class mn{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=F(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:H,params:M}=X(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:H,params:M,filePath:h,isDynamic:M.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");Is(this.routes,s),Ds(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function ir(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function or(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Ec(e){k=e.replace(/\/$/,"")}function Tc(e,t,a={}){f[e]={path:t,name:e,params:a}}function _c(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function hn(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Rc(){for(let e of Object.keys(f))delete f[e];k=""}import B from"fs";import U from"path";function Ac(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Pc(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Ic(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function _o(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Ro(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function Ao(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var w=new Map;function Os(e,t){w.set(e,t)}function Po(e){return w.get(e)}function Dc(e){return w.has(e)}function Qe(){w.clear()}function et(){return Array.from(w.keys())}async function tt(e,t="middleware"){let a=U.resolve(e,t);if(!B.existsSync(a))return;let r=B.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")Os(o,s);else if(typeof s==="function")Os(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function W(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function nt(e,t,a,r=""){return{path:e,params:t,query:W(r),fullPath:r?`${e}?${r}`:e,meta:a}}function rt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?_o(a,i):Ro(),storage:Ao(),state:{},request:a,responseHeaders:i}}async function st(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Po(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function ar(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function xe(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||ar(n)}}var A,T;function z(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function q(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function G(){return`
|
|
2
|
+
import x from"fs";import u from"path";import p from"fs";import v from"path";var y=["components","layouts","partials","emails"];function P(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return P(e.replace(/^\//,""))}function Ds(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
|
|
3
|
+
`),o=v.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function Os(e,t,a){let r=process.cwd(),n=v.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=v.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${v.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(v.join(t,"routes.ts"),i.join(`
|
|
4
|
+
`))}import D from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),I=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),j=new RegExp(`\\.(?:${I})$`),E=`(?![^/]*\\.(?:${I})$)`;function Ze(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&j.test(r)}function R(e,t){let r=D.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(D.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function X(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function gn(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function ir(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return X(a,t)}import K from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(K.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function F(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...F(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class mn{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=F(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:H,params:M}=X(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:H,params:M,filePath:h,isDynamic:M.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");Ds(this.routes,s),Os(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function or(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function ar(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function Tc(e){k=e.replace(/\/$/,"")}function _c(e,t,a={}){f[e]={path:t,name:e,params:a}}function Rc(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function hn(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function Ac(){for(let e of Object.keys(f))delete f[e];k=""}import B from"fs";import U from"path";function Pc(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function Ic(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function Dc(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function Ro(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function Ao(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function Po(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var w=new Map;function Ms(e,t){w.set(e,t)}function Io(e){return w.get(e)}function Oc(e){return w.has(e)}function Qe(){w.clear()}function et(){return Array.from(w.keys())}async function tt(e,t="middleware"){let a=U.resolve(e,t);if(!B.existsSync(a))return;let r=B.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")Ms(o,s);else if(typeof s==="function")Ms(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function W(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function nt(e,t,a,r=""){return{path:e,params:t,query:W(r),fullPath:r?`${e}?${r}`:e,meta:a}}function rt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?Ro(a,i):Ao(),storage:Po(),state:{},request:a,responseHeaders:i}}async function st(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=Io(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function cr(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function xe(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||cr(n)}}var A,T;function z(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function q(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function G(){return`
|
|
5
5
|
;(function(){
|
|
6
6
|
'use strict';
|
|
7
7
|
var ROUTER_REV=7;
|
|
@@ -3532,4 +3532,4 @@ else {
|
|
|
3532
3532
|
|
|
3533
3533
|
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
|
|
3534
3534
|
})();
|
|
3535
|
-
`}function Se(){if(A)return A;return A=q(z(G()),!0),A}function
|
|
3535
|
+
`}function Se(){if(A)return A;return A=q(z(G()),!0),A}function Mc(){if(T)return T;return T=q(G()),T}export{Ds,Os,Ze,X,gn,ir,mn,or,ar,Tc,_c,Rc,hn,Ac,Pc,Ic,Dc,Ro,Ao,Po,Ms,Io,Oc,Qe,et,tt,nt,rt,st,cr,xe,Se,Mc};
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import o from"fs";import u from"path";var h={".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 p(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];r=(r<<5)-r+n,r=r&r}return Math.abs(r).toString(16).padStart(8,"0")}function x(e,r){let t=u.basename(e);for(let n of r)if(n.startsWith("*.")){let i=n.slice(1);if(t.endsWith(i))return!0}else if(n.includes("*")){let i=new RegExp(`^${n.replace(/\*/g,".*")}$`);if(i.test(t)||i.test(e))return!0}else if(t===n||e.includes(n))return!0;return!1}function S(e,r,t){let n=u.extname(e).toLowerCase(),i=h[n],c=(t.maxFileSizeKB||500)*1024;if(r>c)return!1;if(t.exclude&&x(e,t.exclude))return!1;if(t.include&&t.include.length>0){for(let s of t.include)if(s.startsWith("*.")){if(e.endsWith(s.slice(1)))return!0}else if(e.includes(s))return!0}if(i&&t[i]===!0)return!0;if(!i)return!1;return!1}function f(e,r,t,n){let i=o.readdirSync(e,{withFileTypes:!0});for(let c of i){let s=u.join(e,c.name);if(c.isDirectory()){if(["node_modules",".git",".stx"].includes(c.name))continue;f(s,r,t,n)}else if(c.isFile()){let a=o.statSync(s),l=u.relative(r,s);if(S(l,a.size,t)){let d=o.readFileSync(s),g=p(d),m=`/${l.replace(/\\/g,"/")}`;n.push({url:m,revision:g,size:a.size})}}}}function ie(e,r){let t=r.pwa?.precache,n=[];if(!t?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!o.existsSync(e))return{entries:[],totalSize:0,fileCount:0};f(e,e,t,n),n.sort((c,s)=>c.url.localeCompare(s.url));let i=n.reduce((c,s)=>c+s.size,0);return{entries:n,totalSize:i,fileCount:n.length}}function pt(e){if(e.entries.length===0)return"[]";return`[
|
|
3
3
|
${e.entries.map((t)=>` { url: '${t.url}', revision: '${t.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
|
-
]`}function
|
|
6
|
-
export{ie,pt,
|
|
5
|
+
]`}function Fr(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1048576).toFixed(2)} MB`}
|
|
6
|
+
export{ie,pt,Fr};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{F}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{F}from"./chunk-dn9thd0h.js";import S from"fs";import g from"path";import q from"crypto";var T=new Set(["webp","avif","jpeg","png"]),k=new Set(["cover","contain","fill","inside","outside"]),D=new Set([".jpg",".jpeg",".png",".webp",".avif",".gif"]),C=4096,U=80,A="cover";async function ei(e,t){let r=t.routePath??"/_stx/img",h=new URL(e.url);if(h.pathname!==r)return null;let a=L(h,t);if(!a.ok)return new Response(a.error,{status:a.status,headers:{"Content-Type":"text/plain"}});let{srcFsPath:n,srcUrl:d,width:l,height:i,format:s,quality:u,fit:c}=a,m;try{m=S.statSync(n)}catch{return new Response(`Source image not found: ${d}`,{status:404,headers:{"Content-Type":"text/plain"}})}if(!m.isFile())return new Response("Not a file",{status:404,headers:{"Content-Type":"text/plain"}});let w=t.cacheDir??".stx/cache/img";await S.promises.mkdir(w,{recursive:!0});let b=`${n}:${m.mtimeMs}:${m.size}`,I=`${l}x${i}:${s}:${u}:${c}`,f=q.createHash("sha256").update(`${b}|${I}`).digest("hex").slice(0,16),o=g.join(w,`${f}.${s}`),p={"Content-Type":F(s),"Cache-Control":"public, max-age=31536000, immutable",ETag:`"${f}"`,"X-Stx-Image-Cache":"HIT"};if(e.headers.get("if-none-match")===`"${f}"`)return new Response(null,{status:304,headers:p});let v=Bun.file(o);if(await v.exists())return new Response(v,{headers:p});try{let x=Buffer.from(await Bun.file(n).arrayBuffer()),{resizeAndConvert:P}=await N(),R=await P(x,{width:l,height:i,format:s,quality:u,fit:c});return await Bun.write(o,R),p["X-Stx-Image-Cache"]="MISS",new Response(new Uint8Array(R),{headers:p})}catch(x){let P=x.message;return new Response(`Image processing failed: ${P}`,{status:500,headers:{"Content-Type":"text/plain"}})}}function Xo(e){return async(t)=>await ei(t,e)??new Response("Not Found",{status:404,headers:{"Content-Type":"text/plain"}})}function L(e,t){let r=e.searchParams.get("src");if(!r)return{ok:!1,error:"Missing required param: src",status:400};if(!r.startsWith("/"))return{ok:!1,error:"src must be an absolute URL path (start with /)",status:400};if(r.startsWith("//"))return{ok:!1,error:"src must be a local path",status:400};let h=g.extname(r).toLowerCase();if(!D.has(h))return{ok:!1,error:`Unsupported source extension: ${h}`,status:400};let a=g.resolve(t.publicDir),n=g.resolve(a,r.slice(1));if(!n.startsWith(`${a}${g.sep}`)&&n!==a)return{ok:!1,error:"src is outside publicDir",status:400};let d=t.maxWidth??C,l=t.maxHeight??C,i=e.searchParams.get("w"),s=e.searchParams.get("h"),u=i?Number.parseInt(i,10):0,c=s?Number.parseInt(s,10):0;if(i&&(!Number.isFinite(u)||u<=0))return{ok:!1,error:"Invalid w (must be positive integer)",status:400};if(s&&(!Number.isFinite(c)||c<=0))return{ok:!1,error:"Invalid h (must be positive integer)",status:400};if(!i&&!s)return{ok:!1,error:"At least one of w or h is required",status:400};let m=Math.min(u||d,d),w=Math.min(c||l,l),b=e.searchParams.get("f")||"webp";if(!T.has(b))return{ok:!1,error:`Invalid f (must be one of: ${[...T].join(", ")})`,status:400};let I=b,f=e.searchParams.get("q"),o=f?Number.parseInt(f,10):t.defaultQuality??U;if(!Number.isFinite(o)||o<1||o>100)return{ok:!1,error:"Invalid q (must be 1-100)",status:400};let y=e.searchParams.get("fit")||t.defaultFit||A;if(!k.has(y))return{ok:!1,error:`Invalid fit (must be one of: ${[...k].join(", ")})`,status:400};return{ok:!0,srcFsPath:n,srcUrl:r,width:m,height:w,format:I,quality:o,fit:y}}async function N(){return await import("./chunk-gvefw19e.js")}
|
|
3
|
+
export{ei,Xo};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import i from"path";var Ct=".stx",o="STX_DIR",e=null;function
|
|
3
|
-
export{Ct,
|
|
2
|
+
import i from"path";var Ct=".stx",o="STX_DIR",e=null;function bo(t){e=t?.trim()||null}function sn(){return process.env[o]?.trim()||e||Ct}function a(t=process.cwd(),...n){let r=sn();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function on(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==Ct&&!n.startsWith(`${Ct}/`))return t;let r=n.slice(Ct.length+1);return r?i.join(sn(),r):sn()}
|
|
3
|
+
export{Ct,bo,sn,a,on};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ul,Wl}from"./chunk-yva29j3q.js";import"./chunk-m0nw8he9.js";import"./chunk-htwgkg91.js";import"./chunk-1ghj9pgz.js";import"./chunk-7676qzab.js";import"./chunk-73h7qjgq.js";import"./chunk-5zpt78j4.js";import"./chunk-wf2gq6hc.js";import"./chunk-jwpcck1b.js";import"./chunk-aa7w63xc.js";import"./chunk-cs15xqf0.js";import"./chunk-56hvemdx.js";import"./chunk-axydabse.js";import"./chunk-2xnwsavq.js";import"./chunk-b5emjcf1.js";import"./chunk-dqr5n49p.js";export{Wl as clearStoreCache,Ul as getStoreScript};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,o,dn,
|
|
3
|
-
`:u==="t"?"\t":u;continue}if(i===r)return null;if(r==="`"&&i==="$"&&n[a+1]==="{")return null;s+=i}return s}var R=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Je(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let s=dn(r);if(s)return{ok:!1,message:`the expression is not allowed (${s})`,code:t.UNSAFE_EXPRESSION};let a=
|
|
4
|
-
`)}function
|
|
5
|
-
`,"")),headContent:n.trim()}}function
|
|
2
|
+
import{t,o,dn,As,ve,l}from"./chunk-56hvemdx.js";function w(e,n,r,s=0){let a=0,i=s,u=null,c=0,p=!1;while(i<e.length){let h=e[i];if(u&&p){p=!1,i++;continue}if(u&&h==="\\"){p=!0,i++;continue}if(p=!1,(h==='"'||h==="'"||h==="`")&&!u){u=h,i++;continue}if(h===u&&u!=="`"){u=null,i++;continue}if(u==="`"&&h==="$"&&e[i+1]==="{"){c++,i+=2;continue}if(c>0&&h==="}"){c--,i++;continue}if(h==="`"&&u==="`"&&c===0){u=null,i++;continue}if(u){i++;continue}if(h===n)a++;else if(h===r){if(a--,a===0)return i}i++}return-1}import v from"path";function Es(e,n){let r=[];n.lastIndex=0;let s;while((s=n.exec(e))!==null){let a=s.index,i=a+s[0].length-1,u=w(e,"(",")",i);if(u===-1){r.push({start:a,end:-1,args:"",call:e.slice(a,Math.min(e.length,a+80))}),n.lastIndex=i+1;continue}r.push({start:a,end:u+1,args:e.slice(i+1,u),call:e.slice(a,u+1)}),n.lastIndex=u+1}return r}function Xe(e,n,r,s){let a="",i=0;for(let u of Es(e,n)){if(a+=e.slice(i,u.start),u.end===-1){a+=s(u.call),i=u.start;continue}a+=r(u.args,u.call),i=u.end}return a+e.slice(i)}function Ge(e){let n=[],r=0,s=null,a="";for(let i=0;i<e.length;i++){let u=e[i];if(s){if(a+=u,u==="\\"&&i+1<e.length){a+=e[++i];continue}if(u===s)s=null;continue}if(u==="'"||u==='"'||u==="`")s=u;else if(u==="("||u==="["||u==="{")r++;else if(u===")"||u==="]"||u==="}")r--;else if(u===","&&r===0){n.push(a.trim()),a="";continue}a+=u}if(a.trim())n.push(a.trim());return n}function y(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let s="";for(let a=1;a<n.length-1;a++){let i=n[a];if(i==="\\"&&a+1<n.length-1){let u=n[++a];s+=u==="n"?`
|
|
3
|
+
`:u==="t"?"\t":u;continue}if(i===r)return null;if(r==="`"&&i==="$"&&n[a+1]==="{")return null;s+=i}return s}var R=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function Je(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let s=dn(r);if(s)return{ok:!1,message:`the expression is not allowed (${s})`,code:t.UNSAFE_EXPRESSION};let a=As(n),i;try{i=l(r,Object.keys(a))(...Object.values(a))}catch(c){return{ok:!1,message:`the expression could not be evaluated: ${c instanceof Error?c.message:String(c)}`,code:t.EVALUATION_ERROR}}if(i!==void 0&&i!==null)return{ok:!0,value:i};let u=[...new Set(ve(r))].filter((c)=>!R.has(c)&&!(c in a)&&!(c in globalThis));if(u.length>0)return{ok:!1,message:`${u.map((p)=>`"${p}"`).join(", ")} ${u.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(i===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:i}}function ue(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function we(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function b(e){if(!e)return"";return v.isAbsolute(e)?v.relative(process.cwd(),e)||e:e}function f(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function k(e,n,r,s,a=t.EVALUATION_ERROR){let i=s?` in ${b(s)}`:"";return console.warn(`[stx] ${f(n)}${i}: ${r}`),o(e,`${f(n)}: ${r}`,a)}function Qn(e,n,r){let s=r?` in ${b(r)}`:"";console.warn(`[stx] ${f(e)}${s}: ${n}`)}var x=["og:","article:","book:","profile:","fb:","music:","video:"],I=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function cn(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=_(e[0],n);if(typeof r!=="string")return r;let s;if(e.length===2){let i=C(e[1],n);if(typeof i!=="string")return i;s=i}else{let i=r.includes(":")?r.slice(r.indexOf(":")+1):r,u=n.openGraph,c=n[i]??(we(u)?u[i]:void 0);s=c===void 0||c===null||typeof c==="object"?"":String(c)}if(!s)return{kind:"empty"};return{kind:"tag",tag:x.some((i)=>r.startsWith(i))?{property:r,content:s}:{name:r,content:s}}}function _(e,n){let r=y(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(I.test(e.trim()))return e.trim();let s=Je(e,n);if(!s.ok)return{kind:"error",message:`meta name: ${s.message}`,code:s.code};if(typeof s.value!=="string"||!s.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${ue(s.value)}`,code:t.TYPE_ERROR};return s.value}function C(e,n){let r=y(e);if(r!==null)return r;let s=Je(e,n);if(!s.ok)return{kind:"error",message:s.message,code:s.code};let a=s.value;if(a===void 0||a===null||a===!1)return"";if(Array.isArray(a))return a.filter((i)=>i!==void 0&&i!==null&&i!=="").map(String).join(", ");if(typeof a==="object"&&!(a instanceof Date))return{kind:"error",message:`the content must be text, got ${ue(a)}`,code:t.TYPE_ERROR};return String(a)}var ln=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],er=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],S={links:"link",metas:"meta",scripts:"script",styles:"style"},A=new Set,E=new WeakMap;function T(e){if(A.has(e))return;A.add(e),console.warn(e)}function N(e,n){let r=Array.from({length:n.length+1},(s,a)=>a);for(let s=1;s<=e.length;s++){let a=r[0];r[0]=s;for(let i=1;i<=n.length;i++){let u=r[i];r[i]=Math.min(r[i]+1,r[i-1]+1,a+(e[s-1]===n[i-1]?0:1)),a=u}}return r[n.length]}function M(e,n){let r=e.toLowerCase(),s=n.find((p)=>p.toLowerCase()===r);if(s)return s;let a=S[r];if(a&&n.includes(a))return a;let i,u=1/0;for(let p of n){let h=N(r,p.toLowerCase());if(h<u)i=p,u=h}let c=Math.min(e.length,i?.length??0)<=4?1:2;return u<=c?i:void 0}function de(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=E.get(e);if(r)return r;let{known:s,source:a}=n,i=e;for(let u of Object.keys(e)){if(s.includes(u))continue;let c=S[u];if(c&&s.includes(c)&&Array.isArray(e[u])){if(i===e)i={...e};let h=Array.isArray(i[c])?i[c]:[];i[c]=[...h,...e[u]],delete i[u],T(`[stx] ${a}.${u} is not a head key; reading it as ${a}.${c}. Rename it to \`${c}\`.`);continue}if(/^styles?$/.test(u)&&!s.includes("style")){T(`[stx] ${a}.${u} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=M(u,s);T(p?`[stx] ${a}.${u} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${a}.${u} is not a head key and is ignored. Known keys: ${s.join(", ")}.`)}return E.set(e,i),i}var d={},D=[],g={};function Ts(){return d}function qu(){return g}function Ku(){d={},D.length=0,g={}}function wo(e){d=pe(d,de(e,{known:er,source:"useHead()"}))}function pe(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:[...e.meta||[],...n.meta||[]],link:[...e.link||[],...n.link||[]],script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function Ec(e){wo(tr(e))}function tr(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,s=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(s)n.push({property:"og:description",content:s});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let a=e.twitterTitle??e.title,i=e.twitterDescription??e.description,u=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(a)n.push({name:"twitter:title",content:a});if(i)n.push({name:"twitter:description",content:i});if(u){n.push({name:"twitter:image",content:u});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let c=[];if(e.canonical)c.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:c}}function Xu(e){if(g={...g,...e},e.title||e.description)Ec({title:e.title,description:e.description})}function Gu(e){let n=typeof e==="function"?e():e;wo({title:n})}function Ju(e=d){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${m(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([s,a])=>`${s}="${m(a)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let s=Object.entries(r).filter(([a,i])=>i!==void 0).map(([a,i])=>`${a==="httpEquiv"?"http-equiv":a}="${m(String(i))}"`).join(" ");n.push(`<meta ${s}>`)}for(let r of e.link||[]){let s=Object.entries(r).filter(([a,i])=>i!==void 0).map(([a,i])=>`${a}="${m(String(i))}"`).join(" ");n.push(`<link ${s}>`)}for(let r of e.script||[]){let{content:s,...a}=r,i=Object.entries(a).filter(([u,c])=>c!==void 0).map(([u,c])=>{if(typeof c==="boolean")return c?u:"";return`${u}="${m(String(c))}"`}).filter(Boolean).join(" ");if(s)n.push(`<script ${i}>${s}</script>`);else n.push(`<script ${i}></script>`)}for(let r of e.style||[]){let s=r.type?` type="${r.type}"`:"";n.push(`<style${s}>${r.content}</style>`)}return n.join(`
|
|
4
|
+
`)}function Yu(e=d){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${m(r)}"`).join(" ")}function Zu(e=d){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${m(r)}"`).join(" ")}function m(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Qu(e=d){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let s=document.querySelector(r);if(!s){if(s=document.createElement("meta"),n.name)s.setAttribute("name",n.name);if(n.property)s.setAttribute("property",n.property);document.head.appendChild(s)}s.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,s=document.querySelector(r);if(!s)s=document.createElement("link"),document.head.appendChild(s);for(let[a,i]of Object.entries(n))if(i!==void 0)s.setAttribute(a,String(i))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let s of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(s);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function ed(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(s,a)=>(n+=a.trim()+`
|
|
5
|
+
`,"")),headContent:n.trim()}}function td(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,s,a,i)=>{let u=s?a:n[(i||"").trim()]??i,c=n.__stx_runtime_head??{};return n.__stx_runtime_head=pe(c,{title:u}),""})}function nd(e,n,r=""){if(!e.includes("@meta"))return e;return Xe(e,/(?<![\w$@])@meta\s*\(/g,(s,a)=>{let i=cn(Ge(s),n);if(i.kind==="error")return k("Meta",a,i.message,r,i.code);if(i.kind==="tag"){let u=n.__stx_runtime_head??{};n.__stx_runtime_head=pe(u,{meta:[i.tag]})}return""},(s)=>k("Meta",s,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{w,Es,Xe,Ge,Je,ue,we,k,Qn,cn,ln,er,de,Ts,qu,Ku,wo,pe,Ec,tr,Xu,Gu,Ju,Yu,Zu,Qu,ed,td,nd};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Do,Oo}from"./chunk-0ahjxtkx.js";import"./chunk-fmj4xvqm.js";import"./chunk-mcgpeyy8.js";import"./chunk-phafsgd9.js";import"./chunk-8nsmx2w4.js";import"./chunk-7x8nd4fw.js";import"./chunk-xh420ckt.js";import"./chunk-rvbcnahe.js";import"./chunk-bh432b7n.js";import"./chunk-t5wfq4r9.js";import"./chunk-hwaxjfr0.js";import{ti}from"./chunk-6a1jr9pp.js";import"./chunk-9f0srtmg.js";import"./chunk-dn9thd0h.js";import"./chunk-a3smkhem.js";import"./chunk-hkx8pggg.js";import"./chunk-m4q2e418.js";import"./chunk-qa7j3j71.js";import"./chunk-s5drjm2j.js";import"./chunk-0xntpjmp.js";import"./chunk-7mbx7dzg.js";import"./chunk-3n8qh43z.js";import"./chunk-n9jn3qzw.js";import"./chunk-dwp3knc4.js";import"./chunk-hqywyyez.js";import"./chunk-mnz6bdp3.js";import"./chunk-0vbpcef6.js";import"./chunk-nw8p8eg9.js";import"./chunk-yva29j3q.js";import"./chunk-fx994kkj.js";import"./chunk-7cvc6hdw.js";import"./chunk-kpz3tpx7.js";import"./chunk-r3f9jcf7.js";import"./chunk-m0nw8he9.js";import"./chunk-htwgkg91.js";import{me,Zt,Qt,q,d,n,qn,A,i,ce}from"./chunk-1ghj9pgz.js";import"./chunk-7676qzab.js";import"./chunk-73h7qjgq.js";import"./chunk-5zpt78j4.js";import"./chunk-wf2gq6hc.js";import"./chunk-jwpcck1b.js";import"./chunk-aa7w63xc.js";import"./chunk-cs15xqf0.js";import"./chunk-56hvemdx.js";import"./chunk-axydabse.js";import"./chunk-2xnwsavq.js";import"./chunk-b5emjcf1.js";import"./chunk-dqr5n49p.js";export{qn as buildWebComponents,Qt as cacheTemplate,Zt as checkCache,ti as classifyAllScripts,Do as createMiddleware,Oo as createRoute,A as defaultConfig,d as extractVariables,q as injectRouterScript,i as loadStxConfig,me as processClientScript,n as processDirectives,ce as readMarkdownFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Nu,ye,Yi,Lu,as,cs,ls}from"./chunk-1ghj9pgz.js";import"./chunk-7676qzab.js";import"./chunk-73h7qjgq.js";import"./chunk-5zpt78j4.js";import"./chunk-wf2gq6hc.js";import"./chunk-jwpcck1b.js";import"./chunk-aa7w63xc.js";import"./chunk-cs15xqf0.js";import"./chunk-56hvemdx.js";import"./chunk-axydabse.js";import"./chunk-2xnwsavq.js";import"./chunk-b5emjcf1.js";import"./chunk-dqr5n49p.js";export{Lu as clearOnceStore,Yi as onceStore,ye as partialsCache,as as processIncludes,cs as processStackPushDirectives,ls as processStackReplacements,Nu as resetUnscopedSignalWarnings};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Me,Xa,ku,Cu,$u,Eu,Ga,Ja,Tu,_u,Fi,Ru,Zt,Qt,On}from"./chunk-1ghj9pgz.js";import"./chunk-7676qzab.js";import"./chunk-73h7qjgq.js";import"./chunk-5zpt78j4.js";import"./chunk-wf2gq6hc.js";import"./chunk-jwpcck1b.js";import"./chunk-aa7w63xc.js";import"./chunk-cs15xqf0.js";import"./chunk-56hvemdx.js";import"./chunk-axydabse.js";import"./chunk-2xnwsavq.js";import"./chunk-b5emjcf1.js";import"./chunk-dqr5n49p.js";export{Eu as __setSignalsGeneratorsForTest,Me as cacheEngineFingerprint,Qt as cacheTemplate,Zt as checkCache,Ru as clearDevCaches,Ja as getCachedRouterScript,Ga as getCachedSignalsRuntime,Tu as getServeClientAsset,Fi as getServeModuleBundle,On as hashFilePath,Cu as invalidateFileCache,$u as invalidateFileCacheByDir,ku as readFileCached,_u as registerServeModuleBundle,Xa as templateCache};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var L=[320,640,768,1024,1280,1536,1920],j=["webp","jpeg"],B=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],k={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Dt(){return await p()!==null}async function G(){return!0}async function se(t,e={}){let{widths:a=L,formats:r=j,quality:n=B,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new $n(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),R=await Cn(h),{width:c,height:S}=R,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],T=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${T}-${s}w-${y}.${d}`,A=u.join(o,U),z=`${b}/${U}`,q=await
|
|
3
|
-
export{L,j,B,Dt,G,se,Cn,
|
|
2
|
+
import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var L=[320,640,768,1024,1280,1536,1920],j=["webp","jpeg"],B=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],k={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Dt(){return await p()!==null}async function G(){return!0}async function se(t,e={}){let{widths:a=L,formats:r=j,quality:n=B,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new $n(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),R=await Cn(h),{width:c,height:S}=R,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],T=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${T}-${s}w-${y}.${d}`,A=u.join(o,U),z=`${b}/${U}`,q=await Go(h,{width:s,height:f,format:d,quality:n,fit:i});await Bun.write(A,q),E.push({path:A,url:z,width:s,height:f,format:d,size:q.length})}}let M;if(m!=="none")M=await _(h,m);return{src:g,variants:E,placeholder:M,width:c,height:S,aspectRatio:P,hash:y}}async function Cn(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await p();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return N(e)}function N(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new $n("Unable to parse image dimensions","PARSE_ERROR")}async function Go(t,e){let a=await p();if(a){let n=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":n=n.webp({quality:e.quality});break;case"avif":n=n.avif({quality:e.quality});break;case"jpeg":n=n.jpeg({quality:e.quality});break;case"png":n=n.png({quality:e.quality});break}return n.toBuffer()}let r=u.join(V.tmpdir(),`stx-img-${x.randomBytes(8).toString("hex")}.${e.format}`);try{return await D({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await I.promises.unlink(r).catch(()=>{})}}async function _(t,e){let a=await p();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),o=await Cn(t);return`data:${k[o.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let o=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await Cn(t),n=u.join(V.tmpdir(),`stx-ph-${x.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(n,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",o=await C(n,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&o.dominantColor)return o.dominantColor;if(o.dataURL)return o.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await I.promises.unlink(n).catch(()=>{})}}function Re(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function ut(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,r)=>{let n=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(r[0].replace(/\D/g,""))||0)-n}).map(([a,r])=>`(max-width: ${a}) ${r}`).join(", ")+", 100vw"}function Ot(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,n)=>r.width-n.width);return a[Math.floor(a.length/2)]}function Mt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function Nt(t){let e=u.extname(t).toLowerCase();return O.includes(e)}function F(t){return k[t]||"application/octet-stream"}function Lt(t){return t.reduce((e,a)=>e+a.size,0)}function jt(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class $n extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
|
|
3
|
+
export{L,j,B,Dt,G,se,Cn,Go,Re,ut,Ot,Mt,Nt,F,Lt,jt,$n};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),b=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function l(i){return i.replace(/[^\n]/g," ")}function w(i){let o=i.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,l).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,l).replace(/<!--[\s\S]*?-->/g,l).replace(/\{\{\{[\s\S]*?\}\}\}/g,l).replace(/\{\{[\s\S]*?\}\}/g,l).replace(/\{!![\s\S]*?!!\}/g,l),s=new Map,r=new Map,p=/<(\/?)([A-Za-z][\w-]*)\b(?:[^<>"']|"[^"]*"|'[^']*')*?(\/?)>/g,t;while((t=p.exec(o))!==null){let e=t[1]==="/",n=t[2],a=t[3]==="/";if(f.has(n.toLowerCase()))continue;if(a)continue;if(e)r.set(n,(r.get(n)??0)+1);else{let g=s.get(n);if(g)g.count++;else{let d=o.slice(0,t.index).split(`
|
|
3
|
-
`).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function
|
|
4
|
-
export{
|
|
3
|
+
`).length;s.set(n,{count:1,firstLine:d})}}}let c=[];for(let e of new Set([...s.keys(),...r.keys()])){if(b.has(e.toLowerCase()))continue;let n=s.get(e)?.count??0,a=r.get(e)??0;if(n!==a)c.push({tag:e,opened:n,closed:a,firstOpenLine:s.get(e)?.firstLine??0})}return c}var u=new Set;function Ns(i,o){let s;try{s=w(i)}catch{return}if(s.length===0)return;let r=`${o}:${i.length}`;if(u.has(r))return;u.add(r);let p=o?o.split(/[/\\]/).pop()||o:"template";for(let{tag:t,opened:c,closed:e,firstOpenLine:n}of s)if(c>e){let a=n?` (first opened at line ${n})`:"";console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 an unclosed <${t}>${a} may swallow the content that follows it.`)}else console.warn(`[stx] ${p}: <${t}> ${c} opened, ${e} closed \u2014 ${e-c} stray </${t}>.`)}
|
|
4
|
+
export{Ns};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Xc}from"./chunk-xh420ckt.js";import"./chunk-6a1jr9pp.js";import"./chunk-fx994kkj.js";import"./chunk-htwgkg91.js";import"./chunk-1ghj9pgz.js";import"./chunk-7676qzab.js";import"./chunk-73h7qjgq.js";import"./chunk-5zpt78j4.js";import"./chunk-wf2gq6hc.js";import"./chunk-jwpcck1b.js";import"./chunk-aa7w63xc.js";import"./chunk-cs15xqf0.js";import"./chunk-56hvemdx.js";import"./chunk-axydabse.js";import"./chunk-2xnwsavq.js";import"./chunk-b5emjcf1.js";import"./chunk-dqr5n49p.js";export{Xc as buildForProduction};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{kr,Cr,$r,Qo,ea,ta,ui,na,ra}from"./chunk-hkx8pggg.js";export{kr as ImageProcessorCache,ui as applyTransformations,Qo as clearImageCache,na as generateResponsiveVariants,ra as generateSrcset,Cr as getCachedImageResult,ta as optimizeImage,ea as processImage,$r as setCachedImageResult};
|
|
@@ -45,12 +45,12 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
45
45
|
});
|
|
46
46
|
})();
|
|
47
47
|
</script>
|
|
48
|
-
`}function
|
|
48
|
+
`}function wl(t,e,l){p=0;let o=/@teleport\s*\(([^)]+)\)\s*([\s\S]*?)@endteleport/g;return t.replace(o,(r,s,d)=>{let a=f(),{target:u,disabled:n}=g(s),c=d.trim();if(n)try{let i=!1;if(n==="true")i=!0;else if(n==="false")i=!1;else if(n in e)i=Boolean(e[n]);if(i)return`<div class="stx-teleport-inline" data-teleport-disabled>${c}</div>`}catch{}let m=h(a,u);return`
|
|
49
49
|
<div id="${a}" class="stx-teleport-source" style="display: none;">
|
|
50
50
|
<template>${c}</template>
|
|
51
51
|
</div>
|
|
52
52
|
${m}
|
|
53
|
-
`})}function
|
|
53
|
+
`})}function vl(){return`
|
|
54
54
|
<script>
|
|
55
55
|
(function() {
|
|
56
56
|
// Common teleport targets
|
|
@@ -68,4 +68,4 @@ var p=0;function f(){return`stx-teleport-${++p}`}function g(t){let e=t.split(","
|
|
|
68
68
|
})();
|
|
69
69
|
</script>
|
|
70
70
|
`}
|
|
71
|
-
export{
|
|
71
|
+
export{wl,vl};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ie,pt}from"./chunk-
|
|
2
|
+
import{ie,pt}from"./chunk-bbnyq3gm.js";import{fe}from"./chunk-yqsza22w.js";function m(e){let t={"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 t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|