@stacksjs/stx 0.2.304 → 0.2.306
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-0gz0rhvs.js → chunk-0gbptqh2.js} +1 -1
- package/dist/{chunk-g97atepq.js → chunk-0mnv8pf5.js} +1 -1
- package/dist/{chunk-nqq7y7m9.js → chunk-18p8dqya.js} +1 -1
- package/dist/{chunk-gfc3qye3.js → chunk-1bmtk8s5.js} +1 -1
- package/dist/{chunk-fvtv1s5j.js → chunk-1zcm299e.js} +1 -1
- package/dist/{chunk-awj7yy37.js → chunk-1ztjv7a4.js} +1 -1
- package/dist/{chunk-qev11kg8.js → chunk-2kv2gnzc.js} +1 -1
- package/dist/chunk-2mx57479.js +2 -0
- package/dist/{chunk-b4xwbh8a.js → chunk-322qz0cj.js} +1 -1
- package/dist/{chunk-t51mwjyq.js → chunk-397rqs12.js} +1 -1
- package/dist/{chunk-env6knrs.js → chunk-3by4c2g9.js} +1 -1
- package/dist/{chunk-tt4r8q4v.js → chunk-3pv0qj5f.js} +1 -1
- package/dist/{chunk-9499k64n.js → chunk-3qc0h6bj.js} +2 -2
- package/dist/{chunk-9xzszvn5.js → chunk-3qfz82gw.js} +1 -1
- package/dist/chunk-455m2k1y.js +2 -0
- package/dist/{chunk-c131k3mt.js → chunk-4ee1aaet.js} +1 -1
- package/dist/{chunk-d3srvh3q.js → chunk-4hk5ewgp.js} +1 -1
- package/dist/{chunk-xganfzgn.js → chunk-4k0h6sca.js} +1 -1
- package/dist/chunk-4mtc9vyb.js +2 -0
- package/dist/chunk-4yky0frv.js +2 -0
- package/dist/{chunk-wx13qmaw.js → chunk-51gea48g.js} +1 -1
- package/dist/chunk-5598ankf.js +2 -0
- package/dist/{chunk-gbwhbasw.js → chunk-5g39e9ra.js} +1 -1
- package/dist/{chunk-8215nhej.js → chunk-5yhb5fad.js} +1 -1
- package/dist/{chunk-xsfwcj6x.js → chunk-604qr43v.js} +1 -1
- package/dist/chunk-6vt9ddra.js +2 -0
- package/dist/{chunk-9vqnrcrw.js → chunk-74sgwgyt.js} +1 -1
- package/dist/{chunk-zggm7kjd.js → chunk-79nj87t6.js} +1 -1
- package/dist/chunk-7amgwmrw.js +2 -0
- package/dist/{chunk-gssbag3e.js → chunk-7c1qq9zq.js} +1 -1
- package/dist/chunk-7q81jygp.js +2 -0
- package/dist/{chunk-sb7ana2z.js → chunk-7sn5rbrd.js} +1 -1
- package/dist/{chunk-yyyxt326.js → chunk-7yzyn9k7.js} +1 -1
- package/dist/{chunk-ppyz9623.js → chunk-85p4dmft.js} +1 -1
- package/dist/chunk-8n2cafmh.js +2 -0
- package/dist/{chunk-8ee62a9q.js → chunk-8q8gj45z.js} +1 -1
- package/dist/chunk-9aw5d4rr.js +2 -0
- package/dist/{chunk-5k1hznvq.js → chunk-9b9znn2f.js} +2 -2
- package/dist/{chunk-y7wsk78j.js → chunk-9eat8v8r.js} +1 -1
- package/dist/{chunk-fp7ms6e7.js → chunk-9ebfmdyb.js} +1 -1
- package/dist/chunk-9j1jfhrf.js +2 -0
- package/dist/chunk-9ypp0a8t.js +2 -0
- package/dist/{chunk-rzevgemj.js → chunk-a50hb40e.js} +1 -1
- package/dist/{chunk-z9ezmjwd.js → chunk-aftse9mb.js} +1 -1
- package/dist/{chunk-wfffa8zm.js → chunk-aqrp68m6.js} +1 -1
- package/dist/{chunk-8jam44my.js → chunk-at84gyvf.js} +1 -1
- package/dist/{chunk-ess2pgt5.js → chunk-b8cteeha.js} +1 -1
- package/dist/{chunk-mbmqpaq1.js → chunk-bnq0p4r4.js} +1 -1
- package/dist/{chunk-ez28vck6.js → chunk-bs18cyh6.js} +1 -1
- package/dist/{chunk-yz16bgs3.js → chunk-bxqzqwv5.js} +1 -1
- package/dist/chunk-bzmxbz48.js +2 -0
- package/dist/{chunk-5x2fc4vk.js → chunk-e5yebhrk.js} +2 -2
- package/dist/{chunk-45y8bjrv.js → chunk-ejjzrtym.js} +10 -10
- package/dist/{chunk-54f8bpp6.js → chunk-ewcxfn7m.js} +3 -3
- package/dist/{chunk-gt8ja700.js → chunk-f044qmn3.js} +1 -1
- package/dist/chunk-f3k3kk5x.js +2 -0
- package/dist/{chunk-y2kmm6bt.js → chunk-ffexgxm3.js} +1 -1
- package/dist/chunk-fh97a60e.js +2 -0
- package/dist/chunk-fzwqh8sy.js +2 -0
- package/dist/chunk-g812bscg.js +2 -0
- package/dist/chunk-gt40xkj3.js +2 -0
- package/dist/chunk-h78pksyp.js +2 -0
- package/dist/chunk-hq3w5crk.js +2 -0
- package/dist/chunk-hy1ma54e.js +2 -0
- package/dist/{chunk-695fkras.js → chunk-j3ajrx2n.js} +1 -1
- package/dist/{chunk-jsg1rthc.js → chunk-jd9nv63q.js} +1 -1
- package/dist/{chunk-jp2f8yzw.js → chunk-jryjwara.js} +1 -1
- package/dist/{chunk-4evbx7sz.js → chunk-jwnbwemq.js} +1 -1
- package/dist/{chunk-zhcs8m2a.js → chunk-k14nr7rz.js} +1 -1
- package/dist/{chunk-hg2afckn.js → chunk-ka2xspj3.js} +1 -1
- package/dist/{chunk-mygq61f5.js → chunk-ka5wtqmw.js} +1 -1
- package/dist/{chunk-6vswphz4.js → chunk-kdkv0j67.js} +1 -1
- package/dist/{chunk-d5cqnwdd.js → chunk-kexk6z9s.js} +1 -1
- package/dist/{chunk-9wrrr7g3.js → chunk-kgtbm5rp.js} +1 -1
- package/dist/{chunk-qeyw5za9.js → chunk-ksqba0cq.js} +1 -1
- package/dist/chunk-kz149fx5.js +2 -0
- package/dist/chunk-mhety3pf.js +2 -0
- package/dist/{chunk-m31n9pkr.js → chunk-msmhta0w.js} +1 -1
- package/dist/chunk-mvj75wef.js +2 -0
- package/dist/{chunk-cbgh359m.js → chunk-n43zq50e.js} +1 -1
- package/dist/{chunk-g912mb7x.js → chunk-nnv8wytm.js} +1 -1
- package/dist/chunk-nvb9nsqv.js +2 -0
- package/dist/chunk-ps7nfwq5.js +2 -0
- package/dist/{chunk-hay1rzb0.js → chunk-qhnyrwz2.js} +268 -267
- package/dist/{chunk-fczfdsab.js → chunk-r7qap4bh.js} +2 -2
- package/dist/chunk-raxr83fs.js +60 -0
- package/dist/{chunk-jfzfrmzy.js → chunk-rtaa4ys9.js} +1 -1
- package/dist/{chunk-jxxv18a0.js → chunk-ry1key0g.js} +1 -1
- package/dist/{chunk-ankp4reb.js → chunk-s3951qwp.js} +1 -1
- package/dist/{chunk-9c835qjn.js → chunk-s3pvp8qv.js} +1 -1
- package/dist/chunk-smtve243.js +2 -0
- package/dist/{chunk-sart9ehj.js → chunk-snmtft92.js} +1 -1
- package/dist/chunk-szdwkfzq.js +2 -0
- package/dist/{chunk-zs5y7xnt.js → chunk-t5kwx6fa.js} +1 -1
- package/dist/{chunk-39qzhpn6.js → chunk-ttkt7xhd.js} +2 -2
- package/dist/{chunk-rrankpmj.js → chunk-ttny9g8k.js} +1 -1
- package/dist/chunk-v33qvj8y.js +2 -0
- package/dist/{chunk-30nbe9hr.js → chunk-v7b5ny0x.js} +2 -2
- package/dist/{chunk-d19tvdvv.js → chunk-vhan24as.js} +1 -1
- package/dist/chunk-vpbw6g2t.js +2 -0
- package/dist/{chunk-1c2j4eby.js → chunk-w1dxgs78.js} +1 -1
- package/dist/{chunk-hgjjnjas.js → chunk-w764f6g4.js} +2 -2
- package/dist/{chunk-bd9wrcq1.js → chunk-w8hkprzv.js} +1 -1
- package/dist/{chunk-ghw5p1yk.js → chunk-wm86mmgq.js} +1 -1
- package/dist/{chunk-d57gb0v2.js → chunk-wwghzbbg.js} +1 -1
- package/dist/{chunk-kxavsh3m.js → chunk-xcsf7my7.js} +1 -1
- package/dist/chunk-xfdckfqr.js +2 -0
- package/dist/{chunk-hrcxfvh1.js → chunk-y4dd2n2n.js} +1 -1
- package/dist/{chunk-7skk34dh.js → chunk-ybct46zd.js} +1 -1
- package/dist/chunk-z8yh03mr.js +2 -0
- package/dist/{chunk-t3qb9s6s.js → chunk-zdzd2jb4.js} +1 -1
- package/dist/{chunk-7gqbr8nr.js → chunk-zr1r73p3.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/expressions.d.ts +10 -1
- package/dist/expressions.js +42 -11
- package/dist/includes.js +19 -1
- package/dist/pwa.js +2 -2
- package/dist/safe-evaluator.d.ts +18 -0
- package/dist/safe-evaluator.js +100 -17
- package/dist/seo.js +34 -4
- package/dist/ssg.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-02hm88m5.js +0 -2
- package/dist/chunk-2h94c5hm.js +0 -60
- package/dist/chunk-3z6bqqr7.js +0 -2
- package/dist/chunk-43p1qq7g.js +0 -2
- package/dist/chunk-4jgr954p.js +0 -2
- package/dist/chunk-51j2aqvb.js +0 -2
- package/dist/chunk-5qfpcgcs.js +0 -2
- package/dist/chunk-6hcc4973.js +0 -2
- package/dist/chunk-8z0n5mtg.js +0 -2
- package/dist/chunk-976g5qe5.js +0 -2
- package/dist/chunk-9px4y692.js +0 -2
- package/dist/chunk-a07chbgj.js +0 -2
- package/dist/chunk-b1hd8kvy.js +0 -2
- package/dist/chunk-c3tmzx7q.js +0 -2
- package/dist/chunk-ckzhp09g.js +0 -2
- package/dist/chunk-dgpjxmhs.js +0 -2
- package/dist/chunk-hzav4hyd.js +0 -2
- package/dist/chunk-jjq9q9jr.js +0 -2
- package/dist/chunk-kbw2qzqx.js +0 -2
- package/dist/chunk-kdxvraec.js +0 -2
- package/dist/chunk-krfjb7b8.js +0 -2
- package/dist/chunk-nws8fbde.js +0 -2
- package/dist/chunk-pr14wjkn.js +0 -2
- package/dist/chunk-rpfcnq8n.js +0 -2
- package/dist/chunk-rst1rw09.js +0 -2
- package/dist/chunk-snt2773t.js +0 -2
- package/dist/chunk-vd3h9z7e.js +0 -2
- package/dist/chunk-wbecqx03.js +0 -2
- package/dist/chunk-xd5ahrtn.js +0 -2
- package/dist/chunk-xq1swv2e.js +0 -2
- package/dist/chunk-xzgvcrnz.js +0 -2
- package/dist/chunk-yyebm8q4.js +0 -2
- package/dist/chunk-zbtfhxhn.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ah as v,Bh as P,th as x,yh as M,zh as C}from"./chunk-vd5xvsnv.js";import{
|
|
2
|
+
import{Ah as v,Bh as P,th as x,yh as M,zh as C}from"./chunk-vd5xvsnv.js";import{ew as y}from"./chunk-jryjwara.js";import{resolve as h,basename as f,extname as u,join as m}from"path";import{mkdir as l}from"fs/promises";var I={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class z{config;constructor(J={}){this.config={...I,...J}}async get(J,Z){return C(J,Z,"image",this.config)}async set(J,Z,Y){return v(J,Z,Y,"image",this.config)}async clear(){return P("image",this.config)}updateConfig(J){this.config={...this.config,...J}}}var H=null;function S(J){if(!H)H=new z(J);else if(J)H.updateConfig(J);return H}async function w(J,Z,Y){let K=Y?{directory:`${Y.outputDir}/../.cache`}:{};return S(K).get(J,Z)}async function Q(J,Z,Y,K){let X=K?{directory:`${K.outputDir}/../.cache`}:{};return S(X).set(J,Z,Y)}async function d(){return S().clear()}async function R(){try{return await import("ts-images")}catch{return null}}function b(J){switch(J){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function p(J,Z){let Y=Z?b(Z):b("web"),K=J.formatQuality||{};return{jpeg:{...Y.jpeg,...K.jpeg},png:{...Y.png,...K.png},webp:{...Y.webp,...K.webp},avif:{...Y.avif,...K.avif}}}async function g(J,Z,Y){let K=await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:J,processed:!1};let X=await w(J,Z,Y);if(X)return X;try{let N=h(J);if(!await M(N))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let L=p(Y,Z.preset),V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await l(V,{recursive:!0});let q=await x(N),U=f(J,u(J)),E=Z.outputFormat?[Z.outputFormat]:Y.defaultFormats||["avif","webp","jpeg"],G={src:J,processed:!0,variants:[],hash:q},j=null;if(Z.transformations&&Z.transformations.length>0)j=await D(N,Z.transformations,K);for(let $ of E){let A=L[$]||{},W=`${U}-${q}.${$}`,_=m(V,W);try{let O=await K.optimizeImage({input:j||N,output:_,format:$,quality:A.quality,progressive:A.progressive});if(O){if(G.variants.push({path:_,url:`${F}/${W}`,width:O.width||0,height:O.height||0,format:$,size:O.outputSize||0}),!G.originalWidth&&O.width)G.originalWidth=O.width,G.originalHeight=O.height}}catch(O){G.errors=G.errors||[],G.errors.push(`Failed to optimize ${$}: ${O}`)}}if(Z.embedThumbhash||Z.placeholder==="thumbhash")try{let $=await K.generateThumbHash(N);G.placeholder=$.dataUrl}catch($){G.errors=G.errors||[],G.errors.push(`Failed to generate thumbhash: ${$}`)}if(Z.useDominantColor)try{let $=await K.generatePlaceholder(N,{strategy:"dominant-color"});G.dominantColor=$.dominantColor}catch($){G.errors=G.errors||[],G.errors.push(`Failed to extract dominant color: ${$}`)}return await Q(J,Z,G,Y),G}catch(N){return{src:J,processed:!1,errors:[`Processing failed: ${N}`]}}}async function n(J,Z,Y,K){let X=await R();if(!X)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await X.optimizeImage({input:J,output:K,format:Z,quality:Y}))?.outputSize}}catch(N){return{success:!1,error:String(N)}}}async function D(J,Z,Y){let K=Y||await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let X=await K.decode(J);for(let N of Z){let L=N.options||{};switch(N.type){case"resize":if(L.width||L.height)X=await K.resize(X,{width:L.width,height:L.height,fit:L.fit});break;case"blur":if(L.sigma!==void 0)X=await K.blur(X,L.sigma);break;case"sharpen":if(L.amount!==void 0)X=await K.sharpen(X,L.amount);break;case"grayscale":X=await K.grayscale(X);break;case"rotate":if(L.angle!==void 0)X=await K.rotate(X,L.angle);break;case"flip":X=await K.flip(X);break;case"flop":X=await K.flop(X);break;case"brightness":if(L.value!==void 0)X=await K.brightness(X,L.value);break;case"contrast":if(L.value!==void 0)X=await K.contrast(X,L.value);break;case"saturation":if(L.value!==void 0)X=await K.saturation(X,L.value);break}}return await K.encode(X,"png")}catch(X){return console.error(`[stx-media] Transformation failed: ${X}`),null}}import{resolve as c,basename as i,extname as r,join as o}from"path";import{mkdir as a}from"fs/promises";async function e(){try{return await import("ts-images")}catch{return null}}var s=[320,480,640,768,1024,1280,1536,1920];async function t(J,Z,Y){let K=await e();if(!K)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let X=c(J);if(!await M(X))return console.warn(`[stx-media] Source file not found: ${J}`),null;try{let N=Z.responsiveWidths||Y.breakpoints||s,L=Z.formats||Y.defaultFormats||["avif","webp","jpeg"],V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await a(V,{recursive:!0});let q=await x(X),U=i(J,r(J)),E=Y.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},G={src:J,byFormat:{},srcsets:{}};for(let $ of L){G.byFormat[$]=[];let A=[];for(let W of N){let _=`${U}-${W}w-${q}.${$}`,O=o(V,_),B=`${F}/${_}`;try{let T=E[$]?.quality||80;if(await M(O)){G.byFormat[$].push({path:O,url:B,width:W,height:0,format:$,size:0}),A.push(`${B} ${W}w`);continue}let k=await K.processImage({input:X,output:O,format:$,quality:T,resize:{width:W}});if(k)G.byFormat[$].push({path:O,url:B,width:W,height:k.height||Math.round(W*(k.height||1)/(k.width||1)),format:$,size:k.outputSize||0}),A.push(`${B} ${W}w`)}catch(T){console.warn(`[stx-media] Failed to generate ${$} at ${W}w: ${T}`)}}G.srcsets[$]=A.join(", ")}let j=Z.placeholder||Y.placeholderStrategy||"thumbhash";if(j!=="none")try{if(j==="thumbhash"){let $=await K.generateThumbHash(X);G.placeholder={dataURL:$.dataUrl,width:$.width||32,height:$.height||32,strategy:"thumbhash"}}else{let $=await K.generatePlaceholder(X,{strategy:j,width:20});G.placeholder={dataURL:$.dataURL,width:$.width,height:$.height,strategy:j}}}catch($){console.warn(`[stx-media] Failed to generate placeholder: ${$}`)}return G.sizes=Z.sizes||JJ(N),G}catch(N){return console.error(`[stx-media] Responsive generation failed: ${N}`),null}}function JJ(J){let Z=[...J].sort((K,X)=>K-X),Y=[];for(let K=0;K<Z.length-1;K++){let X=Z[K];Y.push(`(max-width: ${X}px) ${X}px`)}return Y.push(`${Z[Z.length-1]}px`),Y.join(", ")}function KJ(J,Z="width"){if(!J||J.length===0)return"";if(Z==="dpr")return J.filter((Y)=>Y.dpr).map((Y)=>`${Y.url} ${Y.dpr}x`).join(", ");return J.map((Y)=>`${Y.url} ${Y.width}w`).join(", ")}export{z as $g,w as ah,Q as bh,d as ch,g as dh,n as eh,D as fh,t as gh,KJ as hh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Re as a,Se as b}from"./chunk-2ver2s2y.js";import"./chunk-
|
|
2
|
+
import{Re as a,Se as b}from"./chunk-2ver2s2y.js";import"./chunk-jryjwara.js";export{b as captureScreenshots,a as captureScreenshot};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{AsyncLocalStorage as U}from"async_hooks";var V=Symbol.for("stx.runtime-config.scope"),W=globalThis,Q=W[V]??=new U;function b(x,H){return Q.run(x,H)}function A(){return Q.getStore()}function X(){let x=Q.getStore();if(!x)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:x.public},"private",{value:x.private}))}function N(){return X().public}function O(x={},H=process.env){let I=new Set;function E(j,z){if(z===null)return j===null;if(Array.isArray(z))return Array.isArray(j)&&(!z.length||j.every((B)=>z.some((F)=>E(B,F))));if(typeof z==="object")return j!==null&&typeof j==="object"&&!Array.isArray(j)&&Object.entries(z).every(([B,F])=>Object.hasOwn(j,B)&&E(j[B],F));return typeof j===typeof z}function J(j,z){if(j&&typeof j==="object"&&!Array.isArray(j)){if(Object.getPrototypeOf(j)!==Object.prototype&&Object.getPrototypeOf(j)!==null)throw TypeError(`Runtime config ${z.join(".")} must contain JSON values`);let q=Object.create(null);for(let[G,P]of Object.entries(j)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(G)||["constructor","prototype","__proto__"].includes(G))throw TypeError(`Invalid runtime config key: ${G}`);q[G]=J(P,[...z,G])}return Object.freeze(q)}let B=`STX_RUNTIME_${z.map((q)=>q.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(I.has(B))throw TypeError(`Ambiguous runtime config environment key: ${B}`);I.add(B);let F=H[B],K=j;if(F!==void 0){try{K=typeof j==="string"?F:JSON.parse(F)}catch{throw TypeError(`Invalid runtime config override: ${B}`)}if(!E(K,j))throw TypeError(`Wrong runtime config override type: ${B}`)}function M(q){if(q===null||typeof q==="string"||typeof q==="boolean")return q;if(typeof q==="number"&&Number.isFinite(q))return q;if(Array.isArray(q))return Object.freeze(q.map(M));if(q&&typeof q==="object"&&(Object.getPrototypeOf(q)===Object.prototype||Object.getPrototypeOf(q)===null))return Object.freeze(Object.fromEntries(Object.entries(q).map(([G,P])=>[G,M(P)])));throw TypeError(`Runtime config ${z.join(".")} must contain JSON values`)}return M(K)}return Object.freeze({public:J(x.public??{},["public"]),private:J(x.private??{},["private"])})}function Z(x){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(x.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function T(x,H){let I=x.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),E=/<head\b[^>]*>/i.exec(I),J=E?E.index+E[0].length:0;return I.slice(0,J)+Z(H)+I.slice(J)}
|
|
3
|
-
export{b as
|
|
3
|
+
export{b as su,A as tu,X as uu,N as vu,O as wu,Z as xu,T as yu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ak as m}from"./chunk-
|
|
2
|
+
import{Ak as m}from"./chunk-ttkt7xhd.js";import{ew as z}from"./chunk-jryjwara.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bg as WJ,Dg as YJ,Fg as jJ,lg as ZJ,ng as g,pg as A,vg as n,yg as GJ}from"./chunk-
|
|
2
|
+
import{Bg as WJ,Dg as YJ,Fg as jJ,lg as ZJ,ng as g,pg as A,vg as n,yg as GJ}from"./chunk-e5yebhrk.js";import{Ig as $J}from"./chunk-dvvx1wny.js";import{yl as XJ}from"./chunk-3qc0h6bj.js";import{uo as h}from"./chunk-qhnyrwz2.js";import{ut as e}from"./chunk-ewcxfn7m.js";import{su as QJ,wu as i,yu as p}from"./chunk-18p8dqya.js";import{Sv as l,Wv as VJ,pv as KJ}from"./chunk-r7qap4bh.js";import{ew as DJ}from"./chunk-jryjwara.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-z8yh03mr.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
|
|
3
3
|
export{zJ as Ve,LJ as We,t as Xe,uJ as Ye};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jg as a,Kg as b,Lg as c,Mg as d,Ng as e,Og as f,Pg as g,Qg as h,Rg as i,Sg as j,Tg as k,Ug as l}from"./chunk-xz3evxqp.js";import"./chunk-
|
|
2
|
+
import{Jg as a,Kg as b,Lg as c,Mg as d,Ng as e,Og as f,Pg as g,Qg as h,Rg as i,Sg as j,Tg as k,Ug as l}from"./chunk-xz3evxqp.js";import"./chunk-jryjwara.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var E=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),N=new Set(["html","head","body","p","li","dt","dd","rt","rp","option","optgroup","thead","tbody","tfoot","tr","td","th","colgroup","caption"]);function X(Q){return Q.replace(/[^\n]/g," ")}function R(Q){let H=Q.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,X).replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,X).replace(/<!--[\s\S]*?-->/g,X).replace(/\{\{\{[\s\S]*?\}\}\}/g,X).replace(/\{\{[\s\S]*?\}\}/g,X).replace(/\{!![\s\S]*?!!\}/g,X),F=new Map,J=new Map,Y=/<(\/?)([A-Za-z][\w-]*)\b(?:[^>"']|"[^"]*"|'[^']*')*?(\/?)>/g,z;while((z=Y.exec(H))!==null){let j=z[1]==="/",q=z[2],W=z[3]==="/";if(E.has(q.toLowerCase()))continue;if(W)continue;if(j)J.set(q,(J.get(q)??0)+1);else{let Z=F.get(q);if(Z)Z.count++;else{let B=H.slice(0,z.index).split(`
|
|
3
3
|
`).length;F.set(q,{count:1,firstLine:B})}}}let M=[];for(let j of new Set([...F.keys(),...J.keys()])){if(N.has(j.toLowerCase()))continue;let q=F.get(j)?.count??0,W=J.get(j)??0;if(q!==W)M.push({tag:j,opened:q,closed:W,firstOpenLine:F.get(j)?.firstLine??0})}return M}var $=new Set;function U(Q,H){let F;try{F=R(Q)}catch{return}if(F.length===0)return;let J=`${H}:${Q.length}`;if($.has(J))return;$.add(J);let Y=H?H.split(/[/\\]/).pop()||H:"template";for(let{tag:z,opened:M,closed:j,firstOpenLine:q}of F)if(M>j){let W=q?` (first opened at line ${q})`:"";console.warn(`[stx] ${Y}: <${z}> ${M} opened, ${j} closed \u2014 an unclosed <${z}>${W} may swallow the content that follows it.`)}else console.warn(`[stx] ${Y}: <${z}> ${M} opened, ${j} closed \u2014 ${j-M} stray </${z}>.`)}
|
|
4
|
-
export{R as
|
|
4
|
+
export{R as Ru,U as Su};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Le as c,Me as d,Ne as e,Oe as f,Pe as g,Qe as h}from"./chunk-7sn5rbrd.js";import{Xf as a,_f as b}from"./chunk-ffexgxm3.js";import"./chunk-bxqzqwv5.js";import"./chunk-xwxdwqn9.js";import"./chunk-qhnyrwz2.js";import"./chunk-raxr83fs.js";import"./chunk-at84gyvf.js";import"./chunk-397rqs12.js";import"./chunk-aqrp68m6.js";import"./chunk-ewcxfn7m.js";import"./chunk-jwnbwemq.js";import"./chunk-ry1key0g.js";import"./chunk-4ee1aaet.js";import"./chunk-w764f6g4.js";import"./chunk-18p8dqya.js";import"./chunk-w1dxgs78.js";import"./chunk-xcsf7my7.js";import"./chunk-2kv2gnzc.js";import"./chunk-ttny9g8k.js";import"./chunk-r7qap4bh.js";import"./chunk-9ebfmdyb.js";import"./chunk-jryjwara.js";export{d as virtualPathFor,g as typecheckStxFiles,e as sourcePathFor,h as formatTypecheckDiagnostics,f as findRuntimeTypeDeclarations,b as extractTemplateExpressions,a as extractScriptBlocks,c as buildVirtualSource};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ek as a,fk as b,gk as c,hk as d}from"./chunk-pcvayb2f.js";import"./chunk-
|
|
2
|
+
import{ek as a,fk as b,gk as c,hk as d}from"./chunk-pcvayb2f.js";import"./chunk-jryjwara.js";export{d as default,c as createHotReloadServer,b as compileToNative,a as NATIVE_COMPONENTS};
|
|
@@ -8,4 +8,4 @@ function N(D,G){let j=D[G],F=G+1;while(F<D.length){if(D[F]==="\\"){F+=2;continue
|
|
|
8
8
|
`:" ",j++}G+=" ",j++;continue}if(H==="`"){G+=" ",j++;while(j<D.length&&D[j]!=="`"){if(D[j]==="\\"){G+=" ",j+=2;continue}if(D[j]==="$"&&D[j+1]==="{"){let J=j+2,K=M(D,J);if(G+=" ",G+=R(D.slice(J,K)),K<D.length)G+=" ";j=K+1;continue}G+=D[j]===`
|
|
9
9
|
`?`
|
|
10
10
|
`:" ",j++}G+=" ",j++;continue}G+=H,j++}return G}function U(D){let G=new Uint16Array(D.length),j=0,F=!0;for(let H=0;H<D.length;H++){let J=D[H];if(J===")"||J==="]"||J==="}")if(j===0)F=!1;else j--;if(G[H]=j,J==="("||J==="["||J==="{")j++}return{depths:G,balanced:F&&j===0}}
|
|
11
|
-
export{M as
|
|
11
|
+
export{M as it,R as jt,U as kt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{jt as _}from"./chunk-397rqs12.js";import"./chunk-jryjwara.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
|
|
3
3
|
`)H++;return H}function P(j,G){let H=j.lastIndexOf(`
|
|
4
4
|
`,G)+1,Q=j.indexOf(`
|
|
5
5
|
`,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ok as a,Pk as b,Qk as c,Rk as d,Sk as e}from"./chunk-m3a20mmb.js";import"./chunk-
|
|
2
|
+
import{Ok as a,Pk as b,Qk as c,Rk as d,Sk as e}from"./chunk-m3a20mmb.js";import"./chunk-jryjwara.js";export{d as runPwaAudit,e as formatAuditResult,c as calculateAuditResult,a as auditConfig,b as auditBuildOutput};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{eu as x}from"./chunk-ry1key0g.js";import{ou as A}from"./chunk-4ee1aaet.js";import{su as T,wu as q}from"./chunk-18p8dqya.js";import{Wv as y,pv as C}from"./chunk-r7qap4bh.js";import{ew as P}from"./chunk-jryjwara.js";y();import H from"fs";import $ from"path";import{pathToFileURL as b}from"url";var R=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],O=new Set;function N(J,Y={}){let K=$.resolve(J,Y.dir??"server/api"),Q=[],Z=new Map;if(!H.existsSync(K))return Q;let B=Array.from(new Bun.Glob("**/*.{ts,js,mts,mjs}").scanSync({cwd:K})).sort();for(let z of B){if(z.endsWith(".d.ts"))continue;let W=z.replace(/\.(?:ts|js|mts|mjs)$/,"").split("/"),I=W.pop(),X=I.lastIndexOf("."),_=X>=0?I.slice(X+1):"get",F=_.toUpperCase();if(!R.includes(F)||_!==_.toLowerCase())throw Error(`Unsupported API method suffix in ${z}; use ${R.map((k)=>k.toLowerCase()).join(", ")}`);if(X>=0)I=I.slice(0,X);if(I!=="index")W.push(I);let G=new Set,j=W.map((k,S)=>{let E=/^\[(\.\.\.)?([A-Za-z_]\w*)\]$/.exec(k);if(E){if(G.has(E[2])||E[1]&&S!==W.length-1)throw Error(`Invalid API parameter in ${z}`);return G.add(E[2]),`:${E[2]}${E[1]?"*":""}`}if(!/^[\w-]+$/.test(k))throw Error(`Unsupported API path segment ${k} in ${z}`);return k}),U=`/api${j.length?`/${j.join("/")}`:""}`,L=`${F} ${U.replace(/:\w+/g,":param")}`;if(Z.has(L))throw Error(`Ambiguous API route ${F} ${U}: ${Z.get(L)} and ${z}`);Z.set(L,z);let M=$.join(K,z);O.add($.resolve(M)),O.add(H.realpathSync(M)),Q.push({pattern:U,method:F,filePath:M})}return Q.sort((z,V)=>{let W=z.pattern.split("/"),I=V.pattern.split("/"),X=(_)=>_?.endsWith("*")?0:_?.startsWith(":")?1:2;for(let _=0;_<Math.max(W.length,I.length);_++){let F=X(I[_])-X(W[_]);if(F)return F}return z.pattern.localeCompare(V.pattern)||z.method.localeCompare(V.method)})}async function w(J,Y){let K=A(J,"api-types.d.ts"),Q=["// Generated by stx. Include this file in tsconfig.json.","declare module '@stacksjs/stx/api-client' {"," interface KnownApiRoutes {"];for(let B of Y){let z=`./${$.relative($.dirname(K),B.filePath).replace(/\\/g,"/")}`,{params:V}=C(B.pattern);Q.push(` ${JSON.stringify(`${B.method} ${B.pattern}`)}: { params: { ${V.map((W)=>`${JSON.stringify(W)}: string`).join("; ")} }; response: Awaited<ReturnType<typeof import(${JSON.stringify(z)}).default>> }`)}Q.push(" }","}","export {}","");let Z=Q.join(`
|
|
3
3
|
`);if(!await Bun.file(K).exists()||await Bun.file(K).text()!==Z)await Bun.write(K,Z);return K}async function p(J,Y,K={}){let Q=N(J,K);await w(J,Q);let Z=[];for(let B of Q){let z=await Bun.build({entrypoints:[B.filePath],target:"bun",format:"esm",minify:!1,splitting:!1});if(!z.success)throw Error(`API build failed for ${B.filePath}: ${z.logs.join(`
|
|
4
|
-
`)}`);let V=z.outputs.find((X)=>X.kind==="entry-point");if(!V)throw Error(`No API bundle for ${B.filePath}`);if(z.outputs.length!==1)throw Error(`API endpoint ${B.filePath} emits assets; package those explicitly instead`);let I=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await V.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write($.join(Y,I),V),Z.push({...B,filePath:I})}return Z}function D(J,Y){let K=J.map((Q)=>({route:Q,...C(Q.pattern)}));return async(Q)=>{let Z=new URL(Q.url).pathname,B=K.filter((G)=>G.regex.test(Z));if(!B.length)return null;let z=B[0].route.pattern,V=(G)=>G.replace(/:\w+/g,":param"),W=B.filter((G)=>V(G.route.pattern)===V(z)),I=Q.method,X=W.find((G)=>G.route.method===I)??(I==="HEAD"?W.find((G)=>G.route.method==="GET"):void 0);if(!X){let G=new Set(W.map((j)=>j.route.method));if(G.has("GET"))G.add("HEAD");return G.add("OPTIONS"),new Response(null,{status:I==="OPTIONS"?204:405,headers:{Allow:Array.from(G).sort().join(", ")}})}let _=X.regex.exec(Z),F=Object.create(null);try{X.params.forEach((G,j)=>{F[G]=decodeURIComponent(_[j+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let G=await Y(X.route);if(typeof G!=="function")throw Error(`API endpoint ${X.route.filePath} must default-export a handler`);let j=await G(Q,{params:F}),U=j instanceof Response?j:j===void 0?new Response(null,{status:204}):Response.json(j);if(I==="HEAD")return new Response(null,{status:U.status,headers:U.headers});return U}catch(G){return console.error(`[stx] API error for ${I} ${z}:`,G),Response.json({error:"Internal Server Error"},{status:500})}}}function l(J,Y){return D(Y,async(K)=>(await import(b($.resolve(J,K.filePath)).href)).default)}async function s(J,Y){if(!Y)return async()=>null;let K=Y===!0?{}:Y,Q=N(J,K);return await w(J,Q),async(Z)=>{if(!new URL(Z.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let B=N(J,K);await w(J,B);let{loadStxConfig:z}=await import("./chunk-
|
|
4
|
+
`)}`);let V=z.outputs.find((X)=>X.kind==="entry-point");if(!V)throw Error(`No API bundle for ${B.filePath}`);if(z.outputs.length!==1)throw Error(`API endpoint ${B.filePath} emits assets; package those explicitly instead`);let I=`server/api/endpoint-${new Bun.CryptoHasher("sha256").update(await V.arrayBuffer()).digest("hex").slice(0,20)}.mjs`;await Bun.write($.join(Y,I),V),Z.push({...B,filePath:I})}return Z}function D(J,Y){let K=J.map((Q)=>({route:Q,...C(Q.pattern)}));return async(Q)=>{let Z=new URL(Q.url).pathname,B=K.filter((G)=>G.regex.test(Z));if(!B.length)return null;let z=B[0].route.pattern,V=(G)=>G.replace(/:\w+/g,":param"),W=B.filter((G)=>V(G.route.pattern)===V(z)),I=Q.method,X=W.find((G)=>G.route.method===I)??(I==="HEAD"?W.find((G)=>G.route.method==="GET"):void 0);if(!X){let G=new Set(W.map((j)=>j.route.method));if(G.has("GET"))G.add("HEAD");return G.add("OPTIONS"),new Response(null,{status:I==="OPTIONS"?204:405,headers:{Allow:Array.from(G).sort().join(", ")}})}let _=X.regex.exec(Z),F=Object.create(null);try{X.params.forEach((G,j)=>{F[G]=decodeURIComponent(_[j+1])})}catch{return new Response("Invalid URL parameter encoding",{status:400})}try{let G=await Y(X.route);if(typeof G!=="function")throw Error(`API endpoint ${X.route.filePath} must default-export a handler`);let j=await G(Q,{params:F}),U=j instanceof Response?j:j===void 0?new Response(null,{status:204}):Response.json(j);if(I==="HEAD")return new Response(null,{status:U.status,headers:U.headers});return U}catch(G){return console.error(`[stx] API error for ${I} ${z}:`,G),Response.json({error:"Internal Server Error"},{status:500})}}}function l(J,Y){return D(Y,async(K)=>(await import(b($.resolve(J,K.filePath)).href)).default)}async function s(J,Y){if(!Y)return async()=>null;let K=Y===!0?{}:Y,Q=N(J,K);return await w(J,Q),async(Z)=>{if(!new URL(Z.url).pathname.match(/^\/api(?:\/|$)/))return null;try{let B=N(J,K);await w(J,B);let{loadStxConfig:z}=await import("./chunk-fh97a60e.js"),V=q((await z(J)).runtimeConfig);return await T(V,()=>D(B,async(W)=>{let I=await Bun.build({entrypoints:[W.filePath],target:"bun",format:"esm",splitting:!1});if(!I.success)throw Error(I.logs.join(`
|
|
5
5
|
`));let X=I.outputs.find((_)=>_.kind==="entry-point");if(!X||I.outputs.length!==1)throw Error(`Unsupported API bundle output: ${W.filePath}`);return(await import(`data:text/javascript;base64,${Buffer.from(await X.text()).toString("base64")}`)).default})(Z))}catch(B){return console.error("[stx] API discovery failed:",B),Response.json({error:"API discovery failed; check the server log"},{status:500})}}}function u(J,Y,K){if(x(J))return!0;let Q=/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/;if(Q.test($.basename(J)))return!0;try{if(Q.test($.basename(H.realpathSync(J))))return!0}catch{}if(O.has($.resolve(J)))return!0;if(!K)return!1;let Z=$.resolve(Y,typeof K==="object"?K.dir??"server/api":"server/api"),B=(V)=>{try{return H.realpathSync(V)}catch{return $.resolve(V)}},z=B(J);return[Z,$.resolve(Y,"server"),$.resolve(Y,".output/server")].some((V)=>{let W=B(V);return z===W||z.startsWith(`${W}${$.sep}`)})}
|
|
6
6
|
export{N as ul,w as vl,p as wl,D as xl,l as yl,s as zl,u as Al};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$t as k,Rt as a,St as b,Tt as c,Ut as d,Vt as e,Wt as f,Xt as g,Yt as h,Zt as i,_t as j,au as l}from"./chunk-ewcxfn7m.js";import"./chunk-4ee1aaet.js";import"./chunk-jryjwara.js";export{e as resolveUserCssConfig,c as resetCssCache,h as rebuildCss,d as loadCssEngineConfig,b as loadCssEngine,l as injectCss,a as getCssServeAsset,i as getCachedCSS,k as generateCss,f as fingerprintConfig,j as extractClassNames,g as buildCss};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import C from"path";var G=".stx",K="STX_DIR",J=null;function O(j){J=j?.trim()||null}function H(){return process.env[K]?.trim()||J||G}function Q(j=process.cwd(),...q){let B=H();return C.isAbsolute(B)?C.join(B,...q):C.join(j,B,...q)}function W(j){if(!j||C.isAbsolute(j))return j;let q=j.replace(/\\/g,"/");if(q!==G&&!q.startsWith(`${G}/`))return j;let B=q.slice(G.length+1);return B?C.join(H(),B):H()}
|
|
3
|
-
export{G as
|
|
3
|
+
export{G as ku,K as lu,O as mu,H as nu,Q as ou,W as pu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-jryjwara.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
|
|
3
3
|
`)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
|
|
4
4
|
`)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ui as O,Vi as w,Wi as Z}from"./chunk-xwxdwqn9.js";import{gl as R,nl as U,tl as T}from"./chunk-
|
|
2
|
+
import{Ui as O,Vi as w,Wi as Z}from"./chunk-xwxdwqn9.js";import{gl as R,nl as U,tl as T}from"./chunk-79nj87t6.js";import{Io as W,fm as M,hq as k,yr as C}from"./chunk-qhnyrwz2.js";import{Pu as E,Qu as L}from"./chunk-xcsf7my7.js";import{Uu as B}from"./chunk-ttny9g8k.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
3
|
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
4
|
|
|
5
5
|
`),x=`;(function(){
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$o as d,Yo as a,Zo as b,_o as c,ap as e,bp as f}from"./chunk-qhnyrwz2.js";import"./chunk-raxr83fs.js";import"./chunk-at84gyvf.js";import"./chunk-397rqs12.js";import"./chunk-aqrp68m6.js";import"./chunk-ewcxfn7m.js";import"./chunk-jwnbwemq.js";import"./chunk-ry1key0g.js";import"./chunk-4ee1aaet.js";import"./chunk-w764f6g4.js";import"./chunk-18p8dqya.js";import"./chunk-w1dxgs78.js";import"./chunk-xcsf7my7.js";import"./chunk-2kv2gnzc.js";import"./chunk-ttny9g8k.js";import"./chunk-r7qap4bh.js";import"./chunk-9ebfmdyb.js";import"./chunk-jryjwara.js";export{f as processStackReplacements,e as processStackPushDirectives,d as processIncludes,a as partialsCache,b as onceStore,c as clearOnceStore};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Mo as a,No as b,Oo as c,Po as d,Qo as e,Ro as f,So as g,To as h,Uo as i,Vo as j}from"./chunk-qhnyrwz2.js";import"./chunk-raxr83fs.js";import"./chunk-at84gyvf.js";import"./chunk-397rqs12.js";import"./chunk-aqrp68m6.js";import"./chunk-ewcxfn7m.js";import"./chunk-jwnbwemq.js";import"./chunk-ry1key0g.js";import"./chunk-4ee1aaet.js";import"./chunk-w764f6g4.js";import"./chunk-18p8dqya.js";import"./chunk-w1dxgs78.js";import"./chunk-xcsf7my7.js";import"./chunk-2kv2gnzc.js";import"./chunk-ttny9g8k.js";import"./chunk-r7qap4bh.js";import"./chunk-9ebfmdyb.js";import"./chunk-jryjwara.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as a,ah as b,bh as c,ch as d,dh as e,eh as f,fh as g,gh as h,hh as i}from"./chunk-
|
|
2
|
+
import{$g as a,ah as b,bh as c,ch as d,dh as e,eh as f,fh as g,gh as h,hh as i}from"./chunk-0gbptqh2.js";import"./chunk-vd5xvsnv.js";import"./chunk-jryjwara.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$ as Tl,$a as Xn,$b as gp,$c as gq,$d as gr,A as Dk,Aa as gn,Ab as Bo,Ac as Hp,Ad as Hq,Ae as Nr,B as Ek,Ba as hn,Bb as Co,Bc as Ip,Bd as Iq,Be as Or,C as Fk,Ca as vn,Cb as Do,Cc as Jp,Cd as Jq,Ce as Pr,D as Gk,Da as wn,Db as Eo,Dc as Kp,Dd as Kq,De as Qr,E as wl,Ea as xn,Eb as Fo,Ec as Lp,Ed as Lq,Ee as Rr,F as xl,Fa as yn,Fb as Go,Fc as Mp,Fd as Mq,Fe as Sr,G as yl,Ga as zn,Gb as Ho,Gc as Np,Gd as Nq,Ge as Tr,H as zl,Ha as An,Hb as Io,Hc as Op,Hd as Oq,He as Ur,I as Al,Ia as En,Ib as Jo,Ic as Pp,Id as Pq,Ie as Vr,J as Bl,Ja as Fn,Jb as Ko,Jc as Qp,Jd as Qq,Je as Wr,K as Cl,Ka as Gn,Kb as Lo,Kc as Rp,Kd as Rq,Ke as Xr,L as Dl,La as Hn,Lb as Mo,Lc as Sp,Ld as Sq,M as El,Ma as In,Mb as No,Mc as Tp,Md as Tq,N as Fl,Na as Jn,Nb as Uo,Nc as Up,Nd as Uq,O as Gl,Oa as Kn,Ob as Vo,Oc as Vp,Od as Vq,P as Hl,Pa as Ln,Pb as Wo,Pc as Wp,Pd as Wq,Q as Il,Qa as Mn,Qb as Xo,Qc as Xp,Qd as Xq,R as Jl,Ra as Nn,Rb as Yo,Rc as Yp,Rd as Yq,S as Kl,Sa as On,Sb as Zo,Sc as Zp,Sd as Zq,T as Ll,Ta as Pn,Tb as _o,Tc as _p,Td as _q,U as Ml,Ua as Qn,Ub as $o,Uc as $p,Ud as $q,V as Nl,Va as Rn,Vb as ap,Vc as aq,Vd as ar,W as Ol,Wa as Sn,Wb as bp,Wc as bq,Wd as br,X as Pl,Xa as Tn,Xb as cp,Xc as cq,Xd as cr,Y as Ql,Ya as Un,Yb as dp,Yc as dq,Yd as dr,Z as Rl,Za as Vn,Zb as ep,Zc as eq,Zd as er,_ as Sl,_a as Wn,_b as fp,_c as fq,_d as fr,aa as Ul,ab as Yn,ac as hp,ad as hq,ae as hr,ba as Vl,bb as Zn,bc as ip,bd as iq,be as or,ca as Wl,cb as _n,cc as jp,cd as jq,ce as pr,da as Xl,db as $n,dc as kp,dd as kq,de as qr,ea as Yl,eb as ao,ec as lp,ed as lq,ee as rr,fa as Zl,fb as bo,fc as mp,fd as mq,fe as sr,ga as _l,gb as co,gc as np,gd as nq,ge as tr,ha as $l,hb as eo,hc as op,hd as oq,he as ur,ia as am,ib as fo,ic as pp,id as pq,ie as vr,ja as bm,jb as go,jc as qp,jd as qq,je as wr,ka as cm,kb as ho,kc as rp,kd as rq,ke as xr,la as dm,lb as io,lc as sp,ld as sq,le as yr,ma as em,mb as jo,mc as tp,md as tq,me as zr,na as fm,nb as mo,nc as up,nd as uq,ne as Ar,o as a,oa as gm,ob as no,oc as vp,od as vq,oe as Br,p as ok,pa as Xm,pb as oo,pc as wp,pd as wq,pe as Cr,q as pk,qa as Ym,qb as po,qc as xp,qd as xq,qe as Dr,r as qk,ra as Zm,rb as ro,rc as yp,rd as yq,re as Er,s as rk,sa as _m,sb as so,sc as zp,sd as zq,se as Fr,t as sk,ta as $m,tb as to,tc as Ap,td as Aq,te as Gr,u as tk,ua as an,ub as uo,uc as Bp,ud as Bq,ue as Hr,v as uk,va as bn,vb as wo,vc as Cp,vd as Cq,ve as Ir,w as vk,wa as cn,wb as xo,wc as Dp,wd as Dq,we as Jr,x as wk,xa as dn,xb as yo,xc as Ep,xd as Eq,xe as Kr,y as Bk,ya as en,yb as zo,yc as Fp,yd as Fq,ye as Lr,z as Ck,za as fn,zb as Ao,zc as Gp,zd as Gq,ze as Mr}from"./chunk-ejjzrtym.js";import{Le as Oo,Me as Po,Ne as Qo,Oe as Ro,Pe as So,Qe as To}from"./chunk-7sn5rbrd.js";import{Re as ko,Se as lo}from"./chunk-2ver2s2y.js";import{Te as qo}from"./chunk-74sgwgyt.js";import{Ue as Wm}from"./chunk-9eat8v8r.js";import{Ve as Bn,We as Cn,Xe as Dn,Ye as vo}from"./chunk-1zcm299e.js";import{$e as Jk,Ze as Hk,_e as Ik,af as Kk,bf as Lk,cf as Mk,df as Nk,ef as Ok,ff as Pk,gf as Qk,hf as Rk,if as Sk,jf as Tk,kf as Uk,lf as Vk}from"./chunk-ym3r8ktq.js";import{mf as kl,nf as ll,of as ml,pf as nl,qf as ol,rf as pl,sf as ql,tf as rl,uf as sl,vf as tl,wf as ul,xf as vl}from"./chunk-a50hb40e.js";import{yf as il,zf as jl}from"./chunk-ka5wtqmw.js";import{Af as Wk,Bf as Xk,Cf as Yk,Df as Zk,Ef as _k,Ff as $k,Gf as al,If as bl,Jf as cl,Kf as dl,Lf as el,Mf as fl,Nf as gl,Qf as hl}from"./chunk-zdzd2jb4.js";import{Rf as Dm,Sf as Em,Tf as Fm,Uf as Gm,Vf as Jm,Wf as Vm}from"./chunk-kgtbm5rp.js";import{Xf as Hm,_f as Im}from"./chunk-ffexgxm3.js";import{Ag as Om,Bg as Pm,Cg as Qm,Dg as Rm,Eg as Sm,Fg as Tm,Gg as Um,gg as hm,hg as im,ig as jm,jg as km,kg as lm,lg as mm,mg as nm,ng as om,og as pm,pg as qm,qg as rm,rg as sm,sg as tm,tg as um,ug as vm,vg as wm,wg as Km,xg as Lm,yg as Mm,zg as Nm}from"./chunk-e5yebhrk.js";import{Hg as xm,Ig as ym}from"./chunk-dvvx1wny.js";import{Jg as jn,Kg as kn,Lg as ln,Mg as mn,Ng as nn,Og as on,Pg as pn,Qg as qn,Rg as rn,Sg as sn,Tg as tn,Ug as un}from"./chunk-xz3evxqp.js";import{Vg as _h,Wg as $h,Xg as ai,Yg as bi,Zg as ci,_g as di}from"./chunk-kdkv0j67.js";import{$g as sj,ah as tj,bh as uj,fh as vj,gh as wj,hh as xj}from"./chunk-0gbptqh2.js";import{ih as Dj,jh as Ej,kh as Fj,lh as Gj,mh as Hj,nh as Ij,oh as Jj,ph as Kj,qh as Lj,rh as Mj,sh as Nj}from"./chunk-f044qmn3.js";import{Ah as oj,Bh as pj,Ch as qj,Dh as rj,th as ij,uh as jj,vh as kj,wh as lj,xh as mj,zh as nj}from"./chunk-vd5xvsnv.js";import{Eh as dk,Gh as ek}from"./chunk-64djh88a.js";import{Mh as Bh,Nh as Ch,Oh as Dh,Ph as Eh,Qh as Fh,Rh as Gh,Sh as Hh,Th as Ih,Uh as Jh,Vh as Kh,Wh as Lh,Xh as Mh,Yh as Nh,Zh as Oh}from"./chunk-9368t9jm.js";import{$h as Ph,ai as Qh,bi as Rh,ci as Sh}from"./chunk-5tefa8qb.js";import{hi as Th}from"./chunk-mwh3ymwc.js";import{ii as Xg}from"./chunk-fqq5k9ve.js";import{ji as Yg,ki as Zg}from"./chunk-ya5m5vbn.js";import{li as _g,mi as $g,ni as ah,oi as bh,pi as ch,qi as dh}from"./chunk-y4nzmkea.js";import{ri as eh,si as fh,ti as gh,ui as hh,vi as ih}from"./chunk-7kw3grq5.js";import{Ai as nh,wi as jh,xi as kh,yi as lh,zi as mh}from"./chunk-c79nfdyj.js";import{Bi as oh,Ci as ph,Di as qh,Ei as rh,Fi as sh,Gi as th,Hi as uh}from"./chunk-ej8mv2k6.js";import{Ii as vh,Ji as wh,Ki as xh,Li as yh,Mi as zh,Ni as Ah}from"./chunk-cr8v8k53.js";import{Pi as Ug,Qi as Vg}from"./chunk-4k0h6sca.js";import{Ti as Wg}from"./chunk-bxqzqwv5.js";import"./chunk-xwxdwqn9.js";import{$i as He,Xi as De,Yi as Ee,Zi as Fe,_i as Ge,aj as Ie,bj as Je,cj as Ke,dj as Le,ej as Me,fj as Ne,gj as Oe,hj as Pe,ij as Qe}from"./chunk-aftse9mb.js";import{jj as ff,kj as gf,lj as hf,mj as jf,nj as kf,oj as lf,pj as mf,qj as nf,rj as of,sj as pf,tj as qf,uj as rf,vj as sf,wj as tf,xj as uf,yj as vf,zj as wf}from"./chunk-w8hkprzv.js";import{Gj as Te,Hj as Ue,Ij as Ve,Jj as We,Kj as Xe,Lj as Ye,Mj as Ze,Nj as _e,Oj as $e,Pj as af,Qj as bf,Rj as cf,Sj as df,Tj as ef}from"./chunk-t41aaehf.js";import{$j as Ef,Uj as xf,Vj as yf,Wj as zf,Xj as Af,Yj as Bf,Zj as Cf,_j as Df,ak as Ff,bk as Gf,ck as Hf,dk as If}from"./chunk-s3951qwp.js";import{Ak as lr,Bk as mr,Ck as nr,xk as ir,yk as jr,zk as kr}from"./chunk-ttkt7xhd.js";import{Dk as xk,Ek as yk,Fk as zk,Gk as Ak,Hk as zm,Ik as Am,Jk as Bm,Kk as Cm}from"./chunk-k14nr7rz.js";import"./chunk-09zjty4k.js";import"./chunk-79nj87t6.js";import{ul as Yb,vl as Zb,zl as _b}from"./chunk-3qc0h6bj.js";import{$l as Fb,$m as $c,$n as pe,$o as Uf,$p as Uh,$q as hj,Am as sc,An as Ad,Ap as tg,Aq as Ii,Ar as jk,Bl as xa,Bm as tc,Bn as Bd,Bp as ug,Bq as Ji,Br as kk,Cl as ya,Cm as uc,Cn as Cd,Cp as vg,Cq as Ki,Cr as lk,Dl as za,Dm as vc,Dn as Dd,Dp as wg,Dq as Li,Dr as mk,El as Aa,Em as wc,En as Ed,Ep as xg,Eq as Mi,Er as nk,Fl as Ba,Fm as xc,Fn as Fd,Fp as yg,Fq as Ni,Gl as Ca,Gm as yc,Gn as Gd,Gp as zg,Gq as Oi,Hl as Da,Hm as zc,Hn as Hd,Hp as Ag,Hq as Pi,Il as Ea,Im as Ac,In as Id,Ip as Bg,Iq as Qi,Jl as Fa,Jm as Bc,Jn as Jd,Jp as Cg,Jq as Ri,Kl as Ga,Km as Cc,Kn as Kd,Ko as Kf,Kp as Dg,Kq as Si,Ll as Ha,Lm as Dc,Ln as Ld,Lp as Eg,Lq as Ti,Ml as Ia,Mm as Ec,Mn as Md,Mp as Fg,Mq as Ui,Nl as Ja,Nm as Oc,Nn as Nd,Np as Gg,Nq as Vi,Ol as Ka,Om as Pc,On as Od,Op as Hg,Oq as Wi,Pl as La,Pm as Qc,Pn as Pd,Pp as Ig,Pq as Xi,Ql as Ma,Qm as Rc,Qn as Qd,Qo as Lf,Qp as Jg,Qq as Yi,Rl as Na,Rm as Sc,Rn as fe,Rp as Kg,Rq as Zi,Sl as Oa,Sm as Tc,Sn as ge,So as Mf,Sp as Lg,Sq as _i,Tl as ib,Tm as Uc,Tn as he,Tp as Mg,Tq as $i,Ul as jb,Un as ie,Uo as Nf,Up as Ng,Uq as aj,Vl as kb,Vm as Vc,Vn as je,Vo as Of,Vp as Og,Vq as bj,Wl as lb,Wm as Wc,Wn as ke,Wo as Pf,Wp as Pg,Wq as cj,Xl as mb,Xm as Xc,Xn as le,Xo as Qf,Xp as Qg,Xq as dj,Yl as nb,Ym as Yc,Yn as me,Yo as Rf,Yp as Rg,Yq as ej,Zm as Zc,Zn as ne,Zo as Sf,Zp as Sg,Zq as fj,_m as _c,_n as oe,_o as Tf,_p as Tg,_q as gj,am as Gb,an as ad,ao as qe,ap as Vf,aq as Vh,ar as yj,bm as Hb,bn as bd,bo as re,bp as Wf,bq as Wh,br as zj,cm as Ib,cn as cd,co as se,cp as Xf,cq as Xh,cr as Aj,dm as Jb,dn as dd,dp as Yf,dq as Yh,dr as Bj,em as Nb,en as ed,ep as Zf,eq as Zh,er as Cj,fm as Ob,fn as fd,fp as _f,fq as ei,fr as Oj,gm as Pb,gn as gd,gp as $f,gq as fi,gr as Pj,hm as $b,hn as hd,hp as ag,hq as gi,hr as Qj,im as ac,in as id,io as we,ip as bg,iq as hi,ir as Rj,jm as bc,jn as jd,jo as xe,jp as cg,jq as ii,jr as Sj,km as cc,kn as kd,ko as ye,kp as dg,kq as ji,kr as Tj,lm as dc,ln as ld,lo as ze,lp as eg,lq as ki,lr as Uj,mm as ec,mn as md,mo as Ae,mp as fg,mq as li,mr as Vj,nm as fc,nn as nd,no as Be,np as gg,nq as mi,nr as Wj,om as gc,on as od,oo as Ce,op as hg,oq as ni,or as Xj,pm as hc,pn as pd,pp as ig,pq as oi,pr as Yj,qm as ic,qn as qd,qp as jg,qq as pi,qr as Zj,rm as jc,rn as rd,rp as kg,rq as qi,rr as _j,sm as kc,sn as sd,so as Re,sp as lg,sq as ri,sr as $j,tm as lc,tn as td,to as Se,tp as mg,tq as si,tr as ak,um as mc,un as ud,up as ng,uq as ti,ur as bk,vm as nc,vn as vd,vo as Jf,vp as og,vq as ui,vr as ck,wm as oc,wn as wd,wp as pg,wq as Ei,wr as fk,xm as pc,xn as xd,xp as qg,xq as Fi,xr as gk,ym as qc,yn as yd,yp as rg,yq as Gi,yr as hk,zm as rc,zn as zd,zp as sg,zq as Hi,zr as ik}from"./chunk-qhnyrwz2.js";import{$r as x,$s as qa,As as P,Bs as Q,Cs as R,Ds as S,Es as T,Fr as b,Fs as U,Gr as c,Gs as V,Hr as d,Hs as W,Ir as e,Is as X,Jr as f,Js as Y,Kr as g,Ks as Z,Lr as h,Ls as _,Mr as i,Ms as $,Nr as j,Ns as aa,Or as k,Os as ba,Pr as l,Ps as ca,Qr as m,Qs as da,Rr as n,Rs as ea,Sr as o,Ss as fa,Tr as p,Ts as ia,Ur as q,Us as ja,Vr as r,Vs as ka,Wr as s,Ws as la,Xr as t,Xs as ma,Yr as u,Ys as na,Zr as v,Zs as oa,_r as w,_s as pa,as as y,at as ra,bs as z,bt as sa,cs as A,ct as ta,ds as B,dt as ua,es as C,et as va,fs as D,ft as wa,gs as E,hs as F,is as G,js as H,ks as I,ls as J,ms as K,ns as L,xs as M,ys as N,zs as O}from"./chunk-raxr83fs.js";import{gt as ga,ht as ha}from"./chunk-at84gyvf.js";import{it as Kb,jt as Lb,kt as Mb}from"./chunk-397rqs12.js";import{lt as vi,mt as wi,nt as xi,ot as yi,pt as zi,qt as Ai,rt as Bi,st as Ci,tt as Di}from"./chunk-aqrp68m6.js";import{$t as Mc,Lt as Fc,Mt as Gc,Nt as Hc,Ot as Ic,Pt as Jc,Rt as Kc,_t as Lc,au as Nc}from"./chunk-ewcxfn7m.js";import{bu as te,cu as ue,du as ve}from"./chunk-jwnbwemq.js";import"./chunk-ry1key0g.js";import{ku as Qb,lu as Rb,mu as Sb,nu as Tb,ou as Ub,pu as Vb}from"./chunk-4ee1aaet.js";import"./chunk-w764f6g4.js";import{uu as Wb,vu as Xb}from"./chunk-18p8dqya.js";import{Au as Sd,Bu as Td,Cu as Ud,Du as Vd,Eu as Wd,Fu as Xd,Gu as Yd,Hu as Zd,Iu as _d,Ju as $d,Ku as ae,Lu as be,Mu as ce,Nu as de,Ou as ee,zu as Rd}from"./chunk-w1dxgs78.js";import"./chunk-xcsf7my7.js";import"./chunk-2kv2gnzc.js";import{$u as vb,Uu as ob,Vu as pb,Wu as qb,Xu as rb,Yu as sb,Zu as tb,_u as ub,av as wb,bv as xb,cv as yb,dv as zb,ev as Ab,fv as Bb,gv as Cb,hv as Db,iv as Eb}from"./chunk-ttny9g8k.js";import{Cv as Ua,Dv as Va,Ev as Wa,Fv as Xa,Gv as Ya,Hv as Za,Iv as _a,Jv as $a,Kv as ab,Lv as bb,Mv as cb,Nv as db,Ov as eb,Pv as fb,Qv as gb,Sv as hb,mv as Pa,nv as Qa,qv as Ra,vv as Sa,wv as Ta}from"./chunk-r7qap4bh.js";import"./chunk-9ebfmdyb.js";import"./chunk-jryjwara.js";export{Rk as writeNetlifyConfig,Lm as writeManifest,ul as writeImageManifest,bp as wrapComponentForHMR,Kr as withDefaults,ck as webComponentDirectiveHandler,Sp as watermark,Uq as watchViews,El as watchMultiple,Fl as watchEffect,Dl as watch,Ae as warmImagePlaceholders,Sl as waitForStore,X as waitForLocale,Po as virtualPathFor,Rj as videoDirective,G as validators,Or as validated,qe as validateValueEnhanced,Vh as validateTemplate,xm as validateRouteRules,Xp as validateParams,re as validateFormEnhanced,Jq as validateFile,me as validateFields,le as validateField,Xh as validateDirective,Ld as validateCspDirectives,kk as validateConfig,Ym as validateComponentScripts,vn as validateComponentProps,Tg as validateClientScript,Sh as v,wc as usesSignalsInScript,ub as usesReactiveRuntime,ii as userComponentFileExists,yh as useVirtualList,Zd as useTitle,Rl as useStoreOrThrow,tp as useStore,Bk as useStorage,of as useSlots,Dk as useSessionStorage,Wb as useServerRuntimeConfig,Kf as useServerData,Wd as useSeoMeta,Xb as useRuntimeConfig,Tl as useRouteParams,Vl as useRouteParamOrThrow,Ul as useRouteParam,Zd as usePageTitle,ef as useOptimistic,tf as useModel,Xl as useMiddlewareValue,Wl as useMiddlewareState,Ck as useLocalStorage,Wo as useLoadingIndicator,Ud as useHead,Ph as useForm,qf as useAttrs,Lq as uploadFiles,Kq as uploadFile,Ol as updateInstance,cf as untrack,yi as unregisterDirective,Pl as unmountInstance,Ec as unescapeHtml,So as typecheckStxFiles,hi as transpileTypeScript,xr as translate,Ba as transitionDirective,dc as transformAutoImports,pn as toUsers,on as toUser,Bp as thumbnail,Cq as thumbHashToRGBA,Dq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,xf as templateCache,bd as syncRecordedResponse,_o as stxClientHelpers,dg as structuredDataDirective,Ar as stripLocalePrefix,um as stripDocumentWrapper,Lb as stripCommentsAndLiterals,$n as stringToStream,zd as strictCspPreset,Le as streamingSuspenseDirective,Pe as streamToResponse,Je as streamTemplateSimple,De as streamTemplate,wk as stopHmrServer,ln as stopBroadcasting,Tb as stateDirName,Ub as stateDir,Te as state,Ng as startsDocument,vo as startProductionServer,qo as startInteractive,kn as startBroadcasting,Cr as stampLocaleLayoutGroup,Ia as staggerDirective,Vp as srcsetUrls,Ja as springDirective,id as splitByPipe,qm as spaNavVaryHeaders,Qo as sourcePathFor,aq as smartBatchSign,ki as slotContentHasExpressions,_p as signUrl,fi as shouldTranspileTypeScript,tk as shouldReloadOnChange,dq as shouldRefreshSignature,uk as shouldIgnoreFile,qh as shouldCacheComponent,Fp as sharpen,Rr as shape,Sb as setStateDir,$l as setRouteParams,am as setMiddlewareState,ze as setImagePlaceholder,hf as setGlobalProvide,b as setErrorLocale,wl as setCurrentInstance,Fj as setCachedVideoResult,uj as setCachedImageResult,oj as setCached,Ur as serveStxFile,Wr as serveMultipleStxFiles,ok as serveMarkdownFile,Go as serveFile,Xr as serveApp,Fo as serve,ep as serializeState,Nm as serializeSetCookie,Hp as sepia,Xd as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,Vj as scopeHTML,Uj as scopeCSS,gg as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,Lp as saturation,Yp as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,Yf as runPreProcessingMiddleware,Zf as runPostProcessingMiddleware,Qm as runPageAction,Ze as runMountCallbacks,gb as runMiddleware,Ml as runHooks,qr as runDoctor,_e as runDestroyCallbacks,lg as runComposers,Mp as rotate,Th as rewriteImagesWithSiblings,cd as responseBindings,oi as resolveTemplatePath,ha as resolveStxTargets,gk as resolveStxDirectories,wr as resolveI18n,zp as resize,Cc as resetRejectedExpressionWarnings,jc as resetPlaceholders,Td as resetHead,dp as resetHMRHandler,o as resetErrorConfig,Mr as required,nc as replacePlaceholders,Sq as renderView,Oj as renderVideoComponent,ac as renderVendorStyleTags,$q as renderToString,ar as renderToStream,br as renderToDOM,Bq as renderThumbhashToCanvas,nr as renderTemplateString,lr as renderTemplate,mr as renderString,Ge as renderStreamingPage,ai as renderSlot,gh as renderSSRSuspense,lq as renderProtectedVideo,kq as renderProtectedImg,Zp as renderMediaUpload,kr as renderMarkdownView,Bm as renderLayoutTypes,yj as renderImgComponent,kl as renderImageComponent,$d as renderHtmlAttrs,_d as renderHead,Vq as renderEmail,mi as renderComponentWithSlot,ae as renderBodyAttrs,op as render,Bd as relaxedCspPreset,ke as registerValidationRule,Ne as registerStreamingDirectives,vp as registerStoresClient,Zl as registerStore,eg as registerSeoDirectives,_a as registerMiddleware,rc as registerFilters,qc as registerFilter,d as registerErrorMessages,pe as registerEnhancedValidationRule,vi as registerDirective,Kd as registerCspDirectives,yn as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,Al as ref,io as redirect,Zc as recordResponseStatus,_c as recordResponseHeader,Vb as rebaseOntoStateDir,$c as readResponseStatus,ad as readResponseHeaders,mk as readMarkdownFile,yf as readFileCached,Bl as reactive,Qp as quality,iq as pruneSignatureCache,rj as pruneCache,ff as provide,jr as protectCodeBlocks,Lr as prop,og as processVueTemplate,wh as processVirtualListDirectives,Ah as processVirtualGridDirectives,Nj as processVideo,ne as processValidateDirective,ea as processTranslateDirective,ah as processTransitionDirectives,dh as processTransitionAttributes,de as processTitleDirective,Rc as processTemplateBindings,Yg as processTeleportDirectives,eh as processSuspenseDirectives,$f as processStructuredData,He as processStreamDirectives,dd as processStatusDirective,Nh as processStaticDirectives,Wf as processStackReplacements,Vf as processStackPushDirectives,bi as processSlots,sm as processShell,Ce as processServerBindings,ag as processSeoDirective,Oe as processSectionDirectives,Jc as processScopedStyles,Pc as processReactiveBindings,mq as processProtectedMedia,Gh as processPartialHydrationDirectives,Sg as processOnceDirective,Xf as processMiddleware,_f as processMetaDirectives,ee as processMetaDirective,nk as processMarkdownFileDirectives,ti as processMarkdownDirectives,Qf as processLoops,oh as processKeepAliveDirectives,Rg as processJsonDirective,zh as processInfiniteListDirectives,Uf as processIncludes,Aj as processImgComponents,ml as processImageComponents,$k as processImage,ce as processHeadDirective,ge as processForms,ie as processFormInputDirectives,Ac as processExpressions,Ib as processEventDirectives,je as processErrorDirective,pg as processDynamicComponents,Uh as processDirectives,Di as processDirectiveAttributes,Xg as processDeferDirectives,Pd as processCustomDirectives,Hd as processCspDirectives,Sr as processComponentProps,ic as processClientScript,he as processBasicFormDirectives,jh as processAsyncDirectives,Qd as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,ve as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,Vo as preloadIslandHandlers,Be as preloadIconCollection,fn as poolStrings,ek as pluginManager,xe as placeholdersWarmed,$g as performLeave,_g as performEnter,$e as pendingLifecycleCounts,df as peek,Rf as partialsCache,Pj as parseVideoDirectiveOptions,xp as parseUrl,Eq as parseThumbhashString,od as parseSwitchBlock,_h as parseSlots,$h as parseSlotElement,td as parseScriptDeclarations,ak as parseSFCComponent,nq as parseProtectedArgs,Pf as parseLoopBinding,zj as parseImgComponent,Ri as parseImageUrl,ll as parseImageComponent,Om as parseFormBody,qd as parseExpressionWithFilters,zn as parseDefaults,fo as parseCookies,jm as parseContainerSelector,ld as parseConditionalBlock,rd as parseArguments,Ma as parseAnimationShorthand,Nr as optional,gn as optimizeTemplate,rl as optimizeImage,sl as optimizeDirectory,Pr as oneOf,Sf as onceStore,Jl as onUpdated,Oc as onUpdate,Ll as onUnmounted,em as onServer,Hl as onMounted,Xe as onMount,Mh as onHydrated,mf as onErrorCaptured,Ye as onDestroy,uh as onDeactivated,dm as onClient,Il as onBeforeUpdate,Kl as onBeforeUnmount,Gl as onBeforeMount,th as onActivated,xq as observeElement,jo as notFound,ug as normalizeCriticalHeadOrder,lf as nextTick,Cn as negotiateEncoding,Ua as navigateTo,Nl as mountInstance,Ea as motionDirective,Ad as moderateCspPreset,en as minifyHtml,cg as metaDirective,Fg as metaDedupKey,yp as mergeParams,Hg as mergeHtmlAttrs,Vd as mergeHeadConfigs,Gc as mergeCssConfig,Ed as mergeCspDirectives,Ra as matchRoute,ui as markdownDirectiveHandler,lk as markdownCache,ga as looksLikeGlob,zr as localizePath,U as loadTranslationLazy,_ as loadTranslation,hk as loadStxConfig,db as loadMiddlewareFromDirectory,Mm as loadManifest,tq as loadElement,mn as loadChannels,Gr as lintStxStrict,vq as lazyLoadAll,uq as lazyLoad,Ha as keyframeDirective,Zq as jsxs,_q as jsxDEV,Yq as jsx,ho as jsonResponse,Me as islandDirective,l as isTest,vm as isSpaNavigation,om as isSpaNavRequest,bq as isSignatureValid,af as isSignal,Zk as isSharpAvailable,Un as isServerEnvironment,bm as isServer,yb as isRuntimeOwnedColonAttr,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,qq as isNativeLazySupported,ir as isMarkdownPath,Q as isLoading,R as isLoaded,ei as isJavaScriptScript,rq as isIntersectionObserverSupported,fl as isImageFile,_k as isImageBackendAvailable,aa as isICUFormat,Lh as isHydrated,ji as isHydrateTrigger,Xc as isHttpStatus,Tn as isEdgeEnvironment,Hr as isDirectiveKind,k as isDevelopment,bf as isDerived,sk as isCssOnlyChange,Bn as isCompressible,cm as isClient,lh as isAsyncComponent,Pm as isActionableMethod,Ip as invert,Af as invalidateFileCacheByDir,zf as invalidateFileCache,zc as interpolateScriptsInTemplate,xc as interpolateScriptExpressions,yc as interpolateScriptAttributes,x as inlineError,vr as injectThemeBootstrap,bg as injectSeoTags,sr as injectSeo,Jf as injectRouterScript,rk as injectHotReload,kb as injectHeatmap,Nc as injectCss,Fd as injectCspMetaTag,Pg as injectConfigHeadTags,tg as injectColorModeBootScript,Jg as injectCloakStyle,Ag as injectBuildId,cc as injectBrowserCoreAutoImports,Tc as injectAnalytics,gf as inject,Yl as initStoreRegistry,Uk as initNetlify,Xo as initLoadingIndicator,sq as initLazyLoading,po as initFile,Aq as initBlurUp,Gq as initAllBlurUp,Cj as imgDirective,pl as imageDirective,Tm as hydrateTemplateStream,Sm as hydrateTemplate,Uo as hydrateIslands,Ih as hydrateIsland,Um as hydrateFragment,Jh as hydrateByStrategy,Kh as hydrateAll,lp as hydrate,Eo as htmlResponse,Lg as hoistLeadingHeadTags,vg as hoistColorModeBootScript,lb as heatmapDirective,kj as hashString,If as hashFilePath,ij as hashFile,jj as hashBuffer,ng as hasVueTemplateSyntax,Of as hasVariables,qp as hasStore,oc as hasPlaceholders,Sk as hasNetlifyConfig,ab as hasMiddleware,Jb as hasEventDirectives,Og as hasDocumentShell,Yh as hasDirectives,ma as hasDOMSupport,il as handleImageRequest,nf as handleError,fr as h,el as groupVariantsByFormat,Gp as grayscale,xo as gitHash,_m as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,Nk as getTotalSize,cq as getTimeUntilExpiry,Ug as getStoreScript,rp as getStoreNames,pp as getStore,Gk as getStorageSize,Fk as getStorageKeys,pi as getSourceLineInfo,gi as getSharedTranspiler,Ef as getServeClientAsset,la as getScreenReaderOnlyStyle,Wj as getScopeAttribute,Se as getRouteParams,Ob as getPublicEnvDefine,Pb as getPublicEnv,Wh as getPositionInfo,lc as getPlaceholderRegistry,hj as getPlaceholderCacheStats,Sd as getPageMeta,vd as getNonce,gl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,we as getImagePlaceholder,al as getImageMetadata,te as getImageDelivery,kp as getHydrationRuntime,_l as getHydratedStoreState,vk as getHmrServer,Rd as getHead,cp as getHMRHandler,Vi as getFormatExtension,mj as getFileMtime,dl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,xi as getDirectives,wi as getDirective,xl as getCurrentInstance,Kc as getCssServeAsset,Dd as getCspPreset,Md as getCspHeaderName,si as getComponentCacheStats,Ej as getCachedVideoResult,gq as getCachedSignature,Cf as getCachedSignalsRuntime,Df as getCachedRouterScript,fj as getCachedPlaceholder,tj as getCachedImageResult,nj as getCached,qj as getCacheStats,yg as getBuildId,jn as getBroadcastServer,Ui as getBestVariant,sc as getAllFilters,Ii as generateWidthSrcset,xh as generateVirtualListCSS,Nq as generateVideoPreview,se as generateValidationScript,Oq as generateUploadRuntime,$m as generateTreeShakenBundle,ch as generateTransitionRuntime,bh as generateTransitionCSS,Ij as generateThumbnails,_i as generateThumbhashPlaceholder,Ln as generateTemplatesDocs,ih as generateSuspenseRuntime,hh as generateSuspenseCSS,fp as generateStateScript,Si as generateSrcsetData,xj as generateSrcset,bl as generateSrcSet,Jj as generateSpriteSheet,Wq as generateSpaShell,Ti as generateSourceTags,Oi as generateSizesFromBreakpoints,Ni as generateSizesAttribute,cl as generateSizes,fg as generateSitemapIndex,tr as generateSitemap,pq as generateSimpleMediaPicker,jq as generateSignatureRuntime,wf as generateSignalsRuntimeDev,vf as generateSignalsRuntime,hc as generateServerDataBridge,Tj as generateScopeId,bk as generateSFCWebComponent,Gb as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,hg as generateRobotsTxt,ur as generateRobots,wj as generateResponsiveVariants,Zj as generateReactiveWebComponentTS,Yj as generateReactiveWebComponent,$j as generateReactiveRuntime,_j as generateReactiveMixin,Hj as generatePoster,ej as generatePlaceholderStyle,dj as generatePlaceholderCSS,Zi as generatePlaceholder,Hh as generatePartialHydrationCSS,ud as generateNonce,Ok as generateNetlifyToml,Qq as generateMinifiedMediaRuntime,Pq as generateMediaRuntime,oq as generateMediaManagerEmbed,Km as generateManifest,Zo as generateLoadingIndicatorHtml,zq as generateLazyLoadRuntime,Cm as generateLayoutTypes,aj as generateLQIP,sh as generateKeepAliveRuntime,rh as generateKeepAliveCSS,Oh as generateIslandManifest,Mq as generateImagePreview,tl as generateImageManifest,jp as generateHydrationScript,Qe as generateHydrationRuntime,mp as generateHydrationCSS,Bh as generateHydrationBootstrap,qk as generateHotReloadScript,jb as generateHeatmapScript,ap as generateHMRClientScript,Kj as generateHLSManifest,gp as generateEventBindings,Mi as generateDprSrcsetWithVariableQuality,Li as generateDprSrcset,Mg as generateDocumentShell,Qn as generateDocs,Mn as generateDirectivesDocs,Ci as generateDirectiveRuntime,ig as generateDefaultRobotsTxt,Lj as generateDASHManifest,Mc as generateCss,yd as generateCspMetaTag,xd as generateCspHeader,sf as generateCompositionRuntime,Kn as generateComponentsDocs,Ch as generateComponentManifest,In as generateComponentDoc,cj as generateColorPlaceholder,sg as generateColorModeBootScript,Ql as generateClientRuntime,lj as generateCacheKey,fc as generateBrowserAutoImportDestructuring,Hq as generateBlurUpRuntime,Iq as generateBlurUpCSS,Qc as generateBindingsRuntime,Ji as generateAutoWidthSrcset,ec as generateAutoImportDestructuring,nh as generateAsyncComponentRuntime,mh as generateAsyncComponentCSS,Zb as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,Sc as generateAnalyticsScript,To as formatTypecheckDiagnostics,No as formatTypeErrors,mo as formatStxContent,Mk as formatSize,Ta as formatRoutes,no as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,rr as formatDoctorReport,Nn as formatDocsAsMarkdown,Pn as formatDocsAsJson,On as formatDocsAsHtml,Pp as format,dn as foldConstants,Op as flipVertical,Np as flipHorizontal,Dm as fingerprint,Ro as findRuntimeTypeDeclarations,pr as findPantryPackage,kd as findMatchingEndTag,gd as findMatchingDelimiter,Kb as findInterpolationEnd,md as findIfBlocks,pd as findExpressions,Sa as findErrorPage,Hc as findDuplicateScopedStyleRanges,nd as findDirectiveBlocks,an as findDeadCode,an as findDeadBranches,km as findContainerRegion,Jn as findComponentFiles,Vr as findCommonDir,Lk as filterRequiredFiles,ni as fileExists,Lf as extractVariables,Im as extractTemplateExpressions,Ie as extractStreamBoundaries,hp as extractState,ci as extractSlotContent,Nf as extractScriptFromTemplate,Hm as extractScriptBlocks,mc as extractPlaceholders,jd as extractParenthesizedExpression,Yc as extractPageResponseStatus,hb as extractLayoutMetadata,bj as extractDominantColor,sd as extractDirectiveParams,Zh as extractDirectiveNames,wm as extractContainerContent,Gn as extractComponentProps,Dh as extractComponentName,Hn as extractComponentDescription,Lc as extractClassNames,gc as extractBridgeData,Eh as extractBoundProps,hd as extractBalancedExpression,$b as extractAndStripCssImports,Xj as extractAndScopeStyles,Hb as extractAndProcessEvents,zk as externalizeSharedAssets,Ak as externalizeRepeatedAssets,yk as externalizeHtml,Dc as evaluateExpression,cn as evaluateConstant,ed as evaluateAuthExpression,vc as escapeHtmlValue,uc as escapeHtml,C as errorRecovery,E as errorLogger,Zg as ensureTeleportTargets,Qg as ensureDocumentShell,oe as enhancedValidationRules,En as enableDevTools,bn as eliminateDeadCode,Ve as effect,Wp as dprUrls,Rn as docsCommand,Yb as discoverServerApi,Am as discoverLayoutNames,yq as disconnectObserver,Fn as disableDevTools,F as devHelpers,rm as detectShell,Sn as detectRuntime,Pk as detectProjectConfig,Wi as detectFormat,Xm as detectBuildMode,Ue as derived,Tk as deploy,jk as defineStxConfig,up as defineStore,pf as defineSlots,Fr as defineSiteConfig,Jr as definePropsWithValidation,Ir as defineProps,dk as definePlugin,Yd as definePageMeta,Wa as defineMiddleware,Qh as defineForm,kf as defineExpose,jf as defineEmits,zi as defineDirective,hr as defineCustomElement,uo as defineConfig,Ai as defineClientDirective,kh as defineAsyncComponent,wo as defineApiHandler,Rq as defaultMediaConfig,vl as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,fe as defaultFormClasses,pc as defaultFilters,Od as defaultCspConfig,fk as defaultConfig,Tr as default,Fc as deepMergeThemes,Ic as dedupeScopedStyles,nm as decodeTitleEntities,$i as decodeThumbhash,Jd as cspNonceDirective,Id as cspDirective,Fq as crossfadeTransition,Ap as crop,vh as createVirtualList,Qj as createVideoDirective,co as createVercelHandler,Ko as createTypeChecker,fa as createTranslateFilter,_n as createTextEncoderStream,gr as createStxApp,Zn as createStreamingResponse,Ke as createStreamRenderer,sp as createStore,Za as createStorageManager,Xa as createServerCookieManager,_b as createServerApi,zl as createScope,fh as createSSRSuspense,Re as createRouter,ym as createRouteRuleResolver,eb as createRouteLocation,Io as createRoute,Al as createRef,Bl as createReactive,rf as createProvideContext,zo as createProject,to as createProductionBuild,kc as createPlaceholder,hn as createOptimizedBuild,eo as createNetlifyHandler,Hk as createNetlifyClient,fb as createMiddlewareContext,Ho as createMiddleware,wq as createLazyObserver,ph as createKeepAliveCache,Wn as createKVNamespace,Fh as createIslandRegistry,Bj as createImgDirective,ql as createImagePlugin,jl as createImageHandler,ol as createImageDirective,nb as createHeatmapAggregator,Kk as createFileManifest,Vn as createEnvAccessor,z as createEnhancedError,Yn as createEdgeHandler,Xn as createEdgeCache,qi as createDetailedErrorMessage,bo as createDenoHandler,Qk as createDefaultNetlifyConfig,Nd as createCspHeaders,go as createCookie,Cl as createComputed,yl as createComponentInstance,ao as createCloudflareHandler,Ya as createClientCookieManager,Bi as createBuiltinDirectives,gr as createApp,Ka as createAnimationTimeline,Dp as cover,Mf as convertToCommonJS,Kp as contrast,Cp as contain,y as consoleError,m as configureErrorHandling,ik as config,Cl as computed,Dn as compressResponse,kg as composerPattern,jg as composer,tm as composeShellWithPage,xn as componentDirective,li as componentClientSignalNames,Jm as compileTemplate,a as collectRepeatedFlag,Jk as collectDeployFiles,Kg as cloakStyleFragment,Gj as clearVideoCache,N as clearTranslationCache,Vg as clearStoreCache,Ek as clearStorage,hq as clearSignatureCache,uf as clearServerData,gj as clearPlaceholderCache,Tf as clearOnceStore,wd as clearNonce,bb as clearMiddleware,ye as clearImagePlaceholders,ue as clearImageDeliveryCatalog,nl as clearImageCache,e as clearErrorMessages,Ff as clearDevCaches,tc as clearCustomFilters,mg as clearComposers,Wg as clearComposableCache,ri as clearComponentCache,pj as clearCache,Db as clearBlankCache,Yo as cleanupLoadingIndicator,hm as classifyScript,im as classifyAllScripts,Lo as checkTemplateFile,Mo as checkTemplate,Gf as checkCache,eq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,sn as channel,lo as captureScreenshots,ko as captureScreenshot,Z as cancelPendingLoads,Ik as calculateSha1,Ki as calculateOptimalWidths,Hf as cacheTemplate,Sj as buildWebComponents,Oo as buildVirtualSource,Tq as buildViews,wp as buildUrl,Ee as buildSuspenseResolveScript,Er as buildStaticSite,qb as buildRuntimeGlobalsDestructure,Em as buildRuntimeAsset,Fm as buildRouterAsset,Dr as buildLangPickerScript,Qi as buildImageUrl,Bg as buildIdFragment,Gg as buildHtmlAttrs,Vm as buildForProduction,An as buildComponentLibrary,fq as buildAuthParams,Wm as buildApp,Br as buildAlternateLinks,so as build,qn as broadcastPrivate,rn as broadcastPresence,nn as broadcast,Jp as brightness,Mb as bracketDepths,Ep as blur,Eb as blankInertHtmlRegions,$p as batchSignUrls,We as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,Rp as auto,ja as attributeValue,Gm as assetTags,Fb as asInvocableStatement,Qr as arrayOf,yr as applyTranslations,vj as applyTransformations,di as applySlots,wn as applyPropDefaults,Up as applyPreset,Ig as applyHtmlAttrs,be as applyHead,Bc as applyFilters,pm as appendVary,Cd as apiCspPreset,Da as animationGroupDirective,Mj as analyzeVideo,Zm as analyzeUsage,fm as analyzeTemplate,gm as analyzeProject,Zm as analyzeDirectiveUsage,Uc as analyticsDirective,Co as addStore,Bo as addPage,Gd as addNonceToInlineContent,Do as addLayout,Ao as addComponent,Rm as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Bf as __setSignalsGeneratorsForTest,zg as __setBuildIdForTest,Dj as VideoProcessorCache,Rh as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,fd as Tokenizer,Jo as TemplateTypeChecker,oo as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,cr as Show,Fe as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,bc as STX_AUTO_IMPORTS,Rb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,lm as SPA_NAV_HEADER,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,Vc as RESPONSE_STATUS_KEY,Wc as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,ro as ProductionBuild,er as Portal,yo as PROJECT_TEMPLATES,Tp as PRESETS,sb as NON_CLIENT_PRIMITIVES,np as MemorySessionStore,Hi as MIME_TYPES,Ei as MEDIA_DEFAULT_WIDTHS,Gi as MEDIA_DEFAULT_FORMATS,zm as LAYOUT_TYPES_FILE,sj as ImageProcessorCache,hl as ImageProcessingError,ip as HydrationRuntime,pk as HotReloadServer,mb as HeatmapAggregator,Eg as HTML_CLASS_MARKER,Dg as HTML_ATTRS_MARKER,Xq as Fragment,dr as For,mm as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,xk as EXTERNALIZED_ASSET_DIR,Vk as DeployError,Wk as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Qb as DEFAULT_STATE_DIR,Yk as DEFAULT_QUALITY,Xi as DEFAULT_PLACEHOLDER_OPTIONS,Xk as DEFAULT_FORMATS,Fi as DEFAULT_DPR_VALUES,$o as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,Pi as COMMON_SIZES,qg as COLOR_MODE_BOOT_MARKER,rg as COLOR_MODE_BOOT_GLOBAL,Cg as CLOAK_STYLE,un as BroadcastServer,tn as Broadcast,wg as BUILD_ID_META,xg as BUILD_ID_HEADER,Nb as BROWSER_CORE_IMPORTS,Yi as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,or as $path};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ew as O}from"./chunk-jryjwara.js";import{mkdir as b,writeFile as T}from"fs/promises";import{join as q}from"path";var E="https://api.iconify.design";async function k(){let G=await fetch(`${E}/collections`);if(!G.ok)throw Error(`Failed to fetch collections: ${G.statusText}`);return await G.json()}async function P(G,z){try{let Z=O.resolve("@iconify/json"),X=`${`${Z.substring(0,Z.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${G}.json`,Q=Bun.file(X);if(await Q.exists()){let $=await Q.json();if(z&&z.length>0){let B={};for(let S of z)if($.icons[S])B[S]=$.icons[S];return{...$,icons:B}}return $}}catch{}let M=z&&z.length>0?`${E}/${G}.json?icons=${z.join(",")}`:`${E}/${G}.json`,U=await fetch(M);if(!U.ok)throw Error(`Failed to fetch icons for ${G}: ${U.statusText}`);return await U.json()}function j(G,z=24,M=24){return{body:G.body,width:G.width||z,height:G.height||M,viewBox:`0 0 ${G.width||z} ${G.height||M}`}}function F(G,z){let M=V(G);return`import type { IconData } from '@stacksjs/iconify-core'
|
|
3
3
|
|
|
4
4
|
export const ${M}: IconData = ${JSON.stringify(z,null,2)}
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fm as x,
|
|
2
|
+
import{fm as x,hq as M}from"./chunk-qhnyrwz2.js";import"./chunk-raxr83fs.js";import"./chunk-at84gyvf.js";import"./chunk-397rqs12.js";import"./chunk-aqrp68m6.js";import{xt as B,zt as P}from"./chunk-ewcxfn7m.js";import"./chunk-jwnbwemq.js";import"./chunk-ry1key0g.js";import"./chunk-4ee1aaet.js";import"./chunk-w764f6g4.js";import"./chunk-18p8dqya.js";import"./chunk-w1dxgs78.js";import"./chunk-xcsf7my7.js";import"./chunk-2kv2gnzc.js";import"./chunk-ttny9g8k.js";import"./chunk-r7qap4bh.js";import"./chunk-9ebfmdyb.js";import"./chunk-jryjwara.js";import G from"path";var T=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],O=new Set(T);var K=new Map,U=B(64),V=new Set,D=0,N=new Set(T);function f(){K.clear(),U.clear()}function S(H){let J=new Map;for(let Q of H){let Z=G.basename(Q);if(Z.endsWith(".d.ts"))continue;let z=Z.replace(/\.[jt]s$/,"");if(z==="index")continue;if(z===Z)continue;let X=J.get(z);if(X&&!X.endsWith(".js"))continue;J.set(z,Q)}return[...J.values()].sort()}function g(H,J){let Q=J.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${Q}\\b`).test(H)}function y(H){if(!H)return[];let J=P(H,D),Q=U.get(J);if(Q)return Q.slice();let Z=H.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),z=[];for(let X of N){if(V.has(X))continue;let A=X.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${A}\\s*\\(`).test(Z))z.push(X)}return z.sort(),U.set(J,z),z.slice()}async function p(H,J){let Q=y(H);if(Q.length===0)return null;let Z=J??G.join(import.meta.dir,"composables"),z=`${Z}\x00${Q.join(",")}`,X=K.get(z);if(X!==void 0)return X||null;let A=M({loader:"ts",target:"browser",define:x()}),L=new Set(Q),W=[],C=new Set,F=[];try{let q=new Bun.Glob("*.{ts,js}");for await(let j of q.scan({cwd:Z,absolute:!0}))F.push(j)}catch{return K.set(z,""),null}F=S(F);for(let q of F){let j;try{j=await Bun.file(q).text()}catch{continue}let I=[];try{I=A.scan(j).exports.filter(($)=>$!=="default")}catch{continue}if(!I.some(($)=>L.has($)))continue;try{j=j.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^import\s+type\s+.*$/gm,""),j=j.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),j=j.replace(/^export\s+default\s+/gm,""),j=j.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),W.push(`// ${G.basename(q).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${A.transformSync(j).trim()}`);for(let $ of I)C.add($)}catch($){console.warn(`[stx] framework composable ${G.basename(q)} could not be bundled:`,$)}}let Y=Q.filter((q)=>!C.has(q)&&!g(H,q));if(Y.length>0)console.warn(`[stx] could not bundle ${Y.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(W.length===0)return K.set(z,""),null;let k=[...C].map((q)=>` try { if (!(${JSON.stringify(q)} in __s)) { __s[${JSON.stringify(q)}] = ${q}; if (!(${JSON.stringify(q)} in window)) window[${JSON.stringify(q)}] = ${q}; } } catch (e) {}`).join(`
|
|
4
4
|
`),w=`<script data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$h as a,ai as b,bi as c,ci as d,di as e,ei as f,fi as g,gi as h}from"./chunk-5tefa8qb.js";import"./chunk-t41aaehf.js";import"./chunk-
|
|
2
|
+
import{$h as a,ai as b,bi as c,ci as d,di as e,ei as f,fi as g,gi as h}from"./chunk-5tefa8qb.js";import"./chunk-t41aaehf.js";import"./chunk-jryjwara.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$p as X,Im as W}from"./chunk-qhnyrwz2.js";import V from"fs";import M from"path";import*as Y from"readline";var j={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},Q={help:{description:"Show available commands",usage:"help [command]",handler:async(q,z)=>{if(q[0]&&Q[q[0]]){let A=Q[q[0]];console.log(`
|
|
3
3
|
${j.bold}${q[0]}${j.reset} - ${A.description}`),console.log(` Usage: ${j.cyan}${A.usage}${j.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${j.bold}Available Commands:${j.reset}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Al as GJ}from"./chunk-
|
|
2
|
+
import{Al as GJ}from"./chunk-3qc0h6bj.js";import{fm as $J,yr as HJ,zr as zJ}from"./chunk-qhnyrwz2.js";import{jt as KJ,kt as ZJ}from"./chunk-397rqs12.js";import{Bt as u,xt as WJ}from"./chunk-ewcxfn7m.js";import{ou as c}from"./chunk-4ee1aaet.js";import X from"path";import O from"fs";function OJ(J){if(!J||typeof J!=="object")return!1;let K=J;return typeof K.message==="string"&&(K.name==="BuildMessage"||K.name==="ResolveMessage"||("position"in K))}function wJ(J){if(J&&typeof J==="object"&&Array.isArray(J.errors))return J.errors;return[J]}function b(J,K){let $=[];for(let W of wJ(J)){if(OJ(W)){let H=W.position||void 0;$.push({file:K||H?.file,line:H?.line,column:H?.column,message:W.message??"",lineText:H?.lineText});continue}$.push({file:K,message:W instanceof Error?W.message:String(W)})}return $}function s(J,K){return b(J,K).map(($)=>{let W=$.file?`${$.file}${$.line?`:${$.line}${$.column?`:${$.column}`:""}`:""}`:"",H=$.lineText?`
|
|
3
3
|
${$.lineText.trim()}`:"";return W?`${W}: ${$.message}${H}`:`${$.message}${H}`}).join(`
|
|
4
4
|
`)}var UJ=9;function P(J,K,$){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(X.basename(J))||GJ(J,K,$)}var QJ=1,YJ=new Map,f=600,LJ=100,g=new Map;async function TJ(J){let K=g.get(J)??0;if(K>0&&K<LJ){g.set(J,K+1);return}g.set(J,1);try{let $=(await O.promises.readdir(J)).filter((z)=>z.endsWith(".js"));if($.length<=f)return;let H=(await Promise.all($.map(async(z)=>{try{return{name:z,at:(await O.promises.stat(X.join(J,z))).mtimeMs}}catch{return null}}))).filter((z)=>z!==null);H.sort((z,Y)=>Y.at-z.at);for(let z of H.slice(f)){let Y=z.name.slice(0,-3);await O.promises.rm(X.join(J,`${Y}.js`),{force:!0}),await O.promises.rm(X.join(J,`${Y}.deps.json`),{force:!0})}I("pruned bundle cache to",f,"entries")}catch{}}function mJ(J){return YJ.get(J)??[]}function h(J,K){if(J)YJ.set(J,K)}function AJ(J=process.env){return J.STX_DEBUG==="true"||J.STX_DEBUG==="1"}function I(...J){if(AJ())console.log("[stx:bundler]",...J)}var n=[];function t(J,K,$){n.push({filePath:J||"<inline>",message:K,details:$})}function uJ(){return n.slice()}function hJ(){n.length=0}var p;function pJ(J){p=J}function r(){if(p)return p;try{let J=zJ.strict;return typeof J==="object"&&J!==null?J.bundlerFallback??"warn":"warn"}catch{return"warn"}}var a=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function cJ(J){let K=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,$;while(($=K.exec(J))!==null){let H=$[1];if(!a.some((Y)=>Y.test(H)))return I("detected user import:",H),!0}let W=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while(($=W.exec(J))!==null){let H=$[1];if(/\.css(?:\?.*)?$/.test(H))continue;if(!a.some((Y)=>Y.test(H)))return I("detected side-effect import:",H),!0}return!1}var D="stx-module:",CJ=/\.(?:[cm]?[jt]sx?|json)$/i;function MJ(J,K){return X.relative(J,K).split(X.sep).join("/")}function xJ(J,K){if(K.size===0)return J;return J.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,($,W,H,z)=>{let Y=K.get(z);return Y&&!z.startsWith(D)?`${W}${H}${Y}${H}`:$})}function IJ(J,K){let $=0,W=(z)=>{let Y=`__stxMod${$++}`,j=JSON.stringify(z);return K.push(`var ${Y} = globalThis.__stxModules && globalThis.__stxModules[${j}];`,`if (${Y} === undefined) throw new Error("[stx] module " + ${JSON.stringify(j)} + " is not registered on this page (#1957)");`),Y},H=(z,Y)=>{for(let j of z.split(",")){let T=j.trim();if(!T)continue;let Q=T.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!Q)continue;let Z=Q[1].startsWith('"')?JSON.parse(Q[1]):Q[1],G=Q[2]??Z;K.push(`var ${G} = ${Y}[${JSON.stringify(Z)}];`)}};return J=J.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(z,Y,j)=>{let T=j.slice(D.length),Q=W(T),Z=Y.trim(),G=Z.match(/^([\w$]+)\s*(?:,\s*|$)/);if(G&&!Z.startsWith("{")&&!Z.startsWith("*"))K.push(`var ${G[1]} = ${Q}.default;`),Z=Z.slice(G[0].length).trim();let q=Z.match(/^\*\s*as\s+([\w$]+)$/);if(q)K.push(`var ${q[1]} = ${Q};`);else if(Z.startsWith("{"))H(Z.replace(/^\{|\}$/g,""),Q);return""}),J=J.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(z,Y)=>{return W(Y.slice(D.length)),""}),J}function e(J){let K=[J,`${J}.ts`,`${J}.tsx`,`${J}.js`,`${J}.mjs`,`${J}.jsx`,X.join(J,"index.ts"),X.join(J,"index.tsx"),X.join(J,"index.js"),X.join(J,"index.mjs")];for(let $ of K)try{if(O.existsSync($)&&O.statSync($,{throwIfNoEntry:!1})?.isFile())return $}catch{}return}function NJ(J,K,$,W,H,z=new Map,Y){let j=(Q,Z,G)=>{if(P(Z,J,Y))return null;if(!H||Q!==$||!CJ.test(Z))return null;try{if(!O.statSync(Z,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}W.add(Z);let q=`${D}${MJ(process.cwd(),Z)}`;return z.set(G,q),{path:q,external:!0}},T=(Q,Z)=>{let G=Q===$?K:X.dirname(Q),q=X.resolve(G,Z);return e(q)??q};return{name:"stx-client-bundle",setup(Q){Q.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(Z)=>({path:Z.path,external:!0})),Q.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Z)=>({path:Z.path,external:!0})),Q.onResolve({filter:/^\//},(Z)=>{let G=e(Z.path);if(G){let q=j(Z.importer,G,Z.path);if(q)return q;if(G!==$)W.add(G);return{path:G}}return{path:Z.path,external:!0}}),Q.onResolve({filter:/^\.\.?\//},(Z)=>{let G=T(Z.importer,Z.path),q=j(Z.importer,G,Z.path);if(q)return q;return W.add(G),{path:G}}),Q.onResolve({filter:/^[@~]\//},(Z)=>{let G=X.resolve(J,Z.path.slice(2)),q=[G,`${G}.ts`,`${G}.tsx`,`${G}.js`,`${G}.mjs`,`${G}.jsx`,X.join(G,"index.ts"),X.join(G,"index.tsx"),X.join(G,"index.js"),X.join(G,"index.mjs")];for(let A of q)if(O.existsSync(A)&&O.statSync(A,{throwIfNoEntry:!1})?.isFile()){let U=j(Z.importer,A,Z.path);if(U)return U;return I(`resolved ${Z.path[0]}/ import:`,Z.path,"\u2192",A),W.add(A),{path:A}}return console.warn(`[stx:bundler] could not resolve ${Z.path[0]}/ import:`,Z.path),{path:G}}),Q.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(Z)=>{if(!H||Z.importer!==$)return;let G=`${D}npm:${Z.path}`;return z.set(Z.path,G),{path:G,external:!0}}),Q.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(Z)=>{if(P(Z.path,J,Y))throw Error(`Server-only API source cannot be imported by a client script: ${Z.path}`);let G=X.extname(Z.path).toLowerCase(),q=G===".json"?"json":G===".tsx"?"tsx":G===".jsx"?"jsx":G===".ts"||G===".mts"||G===".cts"?"ts":"js";if(Z.path!==$)W.add(Z.path);return{contents:O.readFileSync(Z.path,"utf8"),loader:q}})}}}var m=new Map,F=WJ(64),JJ=Symbol.for("stx.client-bundle-build-queue");function _J(J){let K=globalThis,W=(K[JJ]??Promise.resolve()).then(J,J);return K[JJ]=W.then(()=>{return},()=>{return}),W}async function nJ(J,K,$={}){let W=$.projectRoot||process.cwd(),H=(await HJ(W)).serverApi,z=$.minify??!1,Y=$.externalizeUserModules??!0,j=$.cacheDir||c(W,"bundle-cache"),T=new Bun.CryptoHasher("md5");T.update(`${UJ}\x00${JSON.stringify(H??!1)}\x00${Y?"registry":"inline"}\x00${J}\x00${K}`);let Q=T.digest("hex").slice(0,12),Z=X.join(j,`${Q}.js`),G=F.get(Z);if(G){if(u(G.files)&&G.files.every((C)=>!P(C.path,W,H))){I("memo hit:",Q);let C=G.files.map((w)=>w.path);return h(K,C),$.collectInputs?.push(...C),G.code}F.delete(Z),I("memo invalidated by dep change:",Q)}let q=X.join(j,`${Q}.deps.json`),A=Bun.file(Z);if(await A.exists()){let C=Bun.file(q),w=!1,M=null;if(await C.exists())try{let _=JSON.parse(await C.text());if(_.metadataVersion!==QJ||!Array.isArray(_.files))w=!1;else M=_.files,w=!0;if(M&&(!u(M)||M.some((S)=>P(S.path,W,H))))w=!1}catch{w=!1}if(w){if(I("cache hit:",Q),M)h(K,M.map((S)=>S.path)),$.collectInputs?.push(...M.map((S)=>S.path));let _=await A.text();if(M)F.set(Z,{code:_,files:M});return _}I("cache invalidated by dep change:",Q)}let U=m.get(Q);if(U){let C=await U;if($.collectInputs)$.collectInputs.push(...(F.get(Z)?.files??[]).map((w)=>w.path));return C}let v=_J(()=>SJ(J,K,{projectRoot:W,minify:z,cacheDir:j,hash:Q,cachePath:Z,depsPath:q,collectInputs:$.collectInputs,externalizeUserModules:Y,serverApi:H}));m.set(Q,v);try{return await v}finally{m.delete(Q)}}async function SJ(J,K,$){let{projectRoot:W,minify:H,cacheDir:z,hash:Y,cachePath:j,depsPath:T,externalizeUserModules:Q}=$,Z=c(W,"bundle-tmp"),G=X.join(Z,`${Y}.ts`),q=X.join(Z,"out",Y);O.mkdirSync(Z,{recursive:!0}),O.mkdirSync(q,{recursive:!0});let A=X.dirname(K),U=new Set,v=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,C=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,w=KJ(J),{depths:M,balanced:_}=ZJ(w),S=(L)=>!_||M[L]===0,x;while((x=v.exec(w))!==null){if(x[1])continue;if(!S(x.index))continue;if(x[2])x[2].split(",").forEach((L)=>{let k=BJ(L);if(k)U.add(k)});else if(x[3])U.add(x[3])}while((x=C.exec(w))!==null){if(x[1])continue;if(!S(x.index))continue;U.add(x[2])}let XJ=U.size>0?`
|
|
5
5
|
export { ${[...U].join(", ")} }`:"";await Bun.write(G,J+XJ),I("bundling:",Y,"from:",X.basename(K));let o=new Set,l=new Map;try{let L=await Bun.build({entrypoints:[G],outdir:q,target:"browser",format:"esm",minify:H,plugins:[NJ(W,A,G,o,Q,l,$.serverApi)],define:{"process.env.NODE_ENV":H?'"production"':'"development"',...$J()},root:W});if(!L.success){let B=L.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||`Unable to bundle ${X.basename(K)}`,R=b(L.logs,K||void 0);if(console.warn("[stx:bundler] build failed:",B),t(K||"",B,R),r()==="error")throw Error(B);return J}let k="";for(let V of L.outputs){k=await V.text();break}let N=[];for(let V of k.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let B of V[1].split(",")){let R=B.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(R){N.push([R[2],R[1]]);continue}let y=B.trim();if(/^[A-Za-z_$][\w$]*$/.test(y))N.push([y,y])}let d=[];k=IJ(xJ(k,l),d);let qJ=k.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];k=k.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let i=`__stxBundle_${Y}`,VJ=N.map(([V,B])=>`${JSON.stringify(V)}: ${B}`).join(", "),kJ=N.map(([V])=>`var ${V} = undefined;`).join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ri as a,Si as b,Ti as c}from"./chunk-bxqzqwv5.js";import"./chunk-xwxdwqn9.js";import"./chunk-qhnyrwz2.js";import"./chunk-raxr83fs.js";import"./chunk-at84gyvf.js";import"./chunk-397rqs12.js";import"./chunk-aqrp68m6.js";import"./chunk-ewcxfn7m.js";import"./chunk-jwnbwemq.js";import"./chunk-ry1key0g.js";import"./chunk-4ee1aaet.js";import"./chunk-w764f6g4.js";import"./chunk-18p8dqya.js";import"./chunk-w1dxgs78.js";import"./chunk-xcsf7my7.js";import"./chunk-2kv2gnzc.js";import"./chunk-ttny9g8k.js";import"./chunk-r7qap4bh.js";import"./chunk-9ebfmdyb.js";import"./chunk-jryjwara.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-jryjwara.js";import E from"fs";import K from"path";var V=[];function _(U){V=[];for(let A of U.storyFiles)if(V.push({text:A.fileName.toLowerCase(),original:A.fileName,type:"story",storyId:A.id}),V.push({text:A.relativePath.toLowerCase(),original:A.relativePath,type:"story",storyId:A.id}),A.story)for(let z of A.story.variants)V.push({text:z.title.toLowerCase(),original:z.title,type:"story",storyId:A.id,variantId:z.id})}function $(){return JSON.stringify(V)}async function O(U={}){let A=Date.now();N();let z=await k({mode:"build"});if(!z.config.enabled){W("Story feature is disabled in config.");return}let P=await H(z);w(z,P);let Y=J(z.config,P);B(z,Y),R(P.length);let X=U.outDir??z.config.outDir,Q=K.resolve(z.root,X);await E.promises.mkdir(Q,{recursive:!0}),console.log(` Building to ${X}...`);let M=F(z);await E.promises.writeFile(K.join(Q,"index.html"),M);let v={files:P.map((G)=>({id:G.id,fileName:G.fileName,relativePath:G.relativePath,treePath:G.treePath})),tree:Y};await E.promises.writeFile(K.join(Q,"stories.json"),JSON.stringify(v,null,2));let L={theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets};await E.promises.writeFile(K.join(Q,"config.json"),JSON.stringify(L,null,2));let Z=K.join(Q,"stories");await E.promises.mkdir(Z,{recursive:!0});for(let G of P){let g=await E.promises.readFile(G.path,"utf-8");await E.promises.writeFile(K.join(Z,`${G.id}.stx`),g)}_(z);let T=$();await E.promises.writeFile(K.join(Q,"search-index.json"),T);let C=Date.now()-A;j(P.length,X,C)}function F(U){let{theme:A}=U.config,z=A.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|