@stacksjs/stx 0.2.296 → 0.2.299
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-nqwjb8k7.js → chunk-00mag1n0.js} +1 -1
- package/dist/chunk-0dz7yme0.js +2 -0
- package/dist/chunk-0hjsgddy.js +2 -0
- package/dist/{chunk-6z04mpxz.js → chunk-17389q0t.js} +22 -22
- package/dist/{chunk-85mzetge.js → chunk-18kcg747.js} +2 -2
- package/dist/chunk-1bn1wp3r.js +2 -0
- package/dist/chunk-1vzgt63y.js +2 -0
- package/dist/{chunk-xtwybxtw.js → chunk-1zvyq6jj.js} +1 -1
- package/dist/{chunk-c5rehxqy.js → chunk-1zyqv8p8.js} +1 -1
- package/dist/chunk-23jg0x9d.js +2 -0
- package/dist/{chunk-e3ta86aa.js → chunk-2d9yq3m4.js} +1 -1
- package/dist/chunk-2dsyd62p.js +2 -0
- package/dist/{chunk-mywp77gt.js → chunk-3bc8bqw2.js} +1 -1
- package/dist/{chunk-9616c6wn.js → chunk-3x05529h.js} +1 -1
- package/dist/{chunk-d3kac3mv.js → chunk-42b81qv3.js} +1 -1
- package/dist/chunk-4kzk4s3f.js +2 -0
- package/dist/{chunk-xc4b1ngp.js → chunk-4r5rpv5e.js} +1 -1
- package/dist/{chunk-jmh31a2a.js → chunk-54fnvfp1.js} +2 -2
- package/dist/{chunk-fz91fd99.js → chunk-5c8f2rt7.js} +2 -2
- package/dist/chunk-5fmpyxwr.js +2 -0
- package/dist/{chunk-8bxtvsgm.js → chunk-634gaa9d.js} +1 -1
- package/dist/{chunk-hmf9z4jx.js → chunk-683tfkz4.js} +1 -1
- package/dist/{chunk-vwqv8f0y.js → chunk-6bcw8twx.js} +1 -1
- package/dist/{chunk-k70fgb2f.js → chunk-6btbgxh1.js} +1 -1
- package/dist/{chunk-k78gvm0g.js → chunk-6rzwef28.js} +1 -1
- package/dist/chunk-6sz2hd8t.js +2 -0
- package/dist/{chunk-ynt7y2n5.js → chunk-6w8fa3b8.js} +1 -1
- package/dist/{chunk-3mbkn6vk.js → chunk-6xbscz34.js} +2 -2
- package/dist/{chunk-xtx53xyz.js → chunk-7eea1cse.js} +1 -1
- package/dist/{chunk-nmkra8q5.js → chunk-7eg7ep8f.js} +2 -2
- package/dist/{chunk-maq28582.js → chunk-7g37nv98.js} +2 -2
- package/dist/chunk-7v83gvj4.js +2 -0
- package/dist/{chunk-pb4jjbpq.js → chunk-7wh0eyz9.js} +3 -3
- package/dist/chunk-7xbk9755.js +2 -0
- package/dist/chunk-812p93m2.js +2 -0
- package/dist/{chunk-nnkz36zg.js → chunk-8jy8mt5m.js} +1 -1
- package/dist/{chunk-vqtbc3q4.js → chunk-8xzcfg5w.js} +2 -2
- package/dist/{chunk-efr3ejqt.js → chunk-91007tan.js} +1 -1
- package/dist/{chunk-24pgjzmy.js → chunk-9k5p10e4.js} +2 -2
- package/dist/{chunk-phrd5kxe.js → chunk-9vft4bjw.js} +1 -1
- package/dist/{chunk-5ey1fdjf.js → chunk-9vpabjdm.js} +1 -1
- package/dist/{chunk-2v69c72j.js → chunk-9xa9kvtr.js} +1 -1
- package/dist/{chunk-h625b8k6.js → chunk-b24h02ck.js} +2 -2
- package/dist/{chunk-dn8006f7.js → chunk-bkbr9yz2.js} +1 -1
- package/dist/{chunk-psraz70k.js → chunk-bt6mqvzy.js} +1 -1
- package/dist/chunk-c1jkpd5e.js +2 -0
- package/dist/chunk-cgw60tse.js +2 -0
- package/dist/{chunk-sptmr6wf.js → chunk-cp60r9ck.js} +1 -1
- package/dist/{chunk-4vpsvh6x.js → chunk-ctz53mbz.js} +1 -1
- package/dist/{chunk-nx96x8sh.js → chunk-d3r5pdz7.js} +1 -1
- package/dist/{chunk-mx93vwmq.js → chunk-ddrsx18x.js} +1 -1
- package/dist/{chunk-bc7emj22.js → chunk-dfnevxkj.js} +1 -1
- package/dist/chunk-dg5mhg7t.js +2 -0
- package/dist/chunk-fc7dc3f6.js +2 -0
- package/dist/{chunk-vqxpsd6r.js → chunk-ffetkbht.js} +1 -1
- package/dist/{chunk-9a1f6dz7.js → chunk-fj6fbqgb.js} +1 -1
- package/dist/{chunk-a84j7v61.js → chunk-fsq7492g.js} +1 -1
- package/dist/chunk-geyrsxc0.js +2 -0
- package/dist/{chunk-e2ymkgjk.js → chunk-gfrznj5v.js} +137 -137
- package/dist/{chunk-qzbwa5xe.js → chunk-gmfcddcw.js} +1 -1
- package/dist/{chunk-03mc9wc9.js → chunk-gn6m4f5p.js} +2 -2
- package/dist/chunk-h58zg4p4.js +2 -0
- package/dist/{chunk-8zyv8jf3.js → chunk-hqqas72x.js} +1 -1
- package/dist/{chunk-knz3zy2t.js → chunk-jbrdrxrc.js} +2 -2
- package/dist/{chunk-4yqnabzy.js → chunk-jk4bexrn.js} +1 -1
- package/dist/chunk-jv41s3xp.js +2 -0
- package/dist/{chunk-3jxt0y11.js → chunk-k4v9k7vj.js} +1 -1
- package/dist/chunk-k8j9bt64.js +2 -0
- package/dist/{chunk-k7mewajj.js → chunk-kpgvx2p1.js} +1 -1
- package/dist/chunk-ky8g0n1e.js +2 -0
- package/dist/chunk-m7dw0h4b.js +2 -0
- package/dist/{chunk-wvxce7p4.js → chunk-m8qcap5h.js} +2 -2
- package/dist/{chunk-kp8ec2f4.js → chunk-mq0vtxe6.js} +2 -2
- package/dist/{chunk-fdnbqt4r.js → chunk-mtbtnryk.js} +1 -1
- package/dist/{chunk-vrhp2xnm.js → chunk-mzbnczgk.js} +2 -2
- package/dist/{chunk-vg8yh8te.js → chunk-nn4k6hvv.js} +1 -1
- package/dist/{chunk-asn02v4q.js → chunk-p2aa1ak4.js} +2 -2
- package/dist/{chunk-ahdzc50z.js → chunk-peytnjme.js} +1 -1
- package/dist/{chunk-6tzzh1dg.js → chunk-pt902dd9.js} +1 -1
- package/dist/{chunk-8h9xqc3p.js → chunk-q0h9kdms.js} +1 -1
- package/dist/chunk-q1pqkc22.js +2 -0
- package/dist/{chunk-ahqn4s3t.js → chunk-q6xfyasj.js} +1 -1
- package/dist/{chunk-a668m28h.js → chunk-qg6pg6ze.js} +1 -1
- package/dist/{chunk-wb00aqm7.js → chunk-qga8gyr7.js} +1 -1
- package/dist/{chunk-mdd9yk4f.js → chunk-qx1zbx35.js} +1 -1
- package/dist/{chunk-0xtnepfj.js → chunk-qx7c8qnw.js} +1 -1
- package/dist/{chunk-224m1jrf.js → chunk-r19ajkwr.js} +3 -3
- package/dist/{chunk-29hfy1xw.js → chunk-rkz0rhx4.js} +1 -1
- package/dist/{chunk-qxmywwq5.js → chunk-rn2nsn9e.js} +2 -2
- package/dist/chunk-rxnxjw3d.js +2 -0
- package/dist/{chunk-3npkbgfm.js → chunk-s710wybv.js} +1 -1
- package/dist/{chunk-5t50pdtm.js → chunk-shem708r.js} +1 -1
- package/dist/{chunk-qfec1s34.js → chunk-snsb8nm6.js} +3 -3
- package/dist/chunk-sprn2n68.js +2 -0
- package/dist/{chunk-zwknasm0.js → chunk-sqqwas4j.js} +1 -1
- package/dist/chunk-syvg73q0.js +2 -0
- package/dist/{chunk-6sy85s25.js → chunk-tn1za8mt.js} +1 -1
- package/dist/chunk-trpmf02p.js +30 -0
- package/dist/{chunk-kgxkrnyt.js → chunk-v4vvm7mz.js} +1 -1
- package/dist/chunk-v54vyt8g.js +2 -0
- package/dist/chunk-v5jtjp8t.js +2 -0
- package/dist/{chunk-wvq1g6gr.js → chunk-v8474ah4.js} +1 -1
- package/dist/{chunk-hvqae2g1.js → chunk-vdzv694w.js} +1 -1
- package/dist/chunk-vk57tj7y.js +2 -0
- package/dist/chunk-vw5zxsc1.js +2 -0
- package/dist/{chunk-fed3xsp9.js → chunk-w8yac9xp.js} +1 -1
- package/dist/{chunk-2b9r38hs.js → chunk-wbq4srvy.js} +1 -1
- package/dist/{chunk-6tqbgd20.js → chunk-wdw9hb5y.js} +1 -1
- package/dist/{chunk-jem20v5k.js → chunk-weqpt9nt.js} +1 -1
- package/dist/{chunk-pfwhd5xs.js → chunk-x14vvxfh.js} +2 -2
- package/dist/{chunk-wyxw61az.js → chunk-x4prtyjs.js} +1 -1
- package/dist/chunk-xjnx0ms8.js +2 -0
- package/dist/{chunk-1ge7rfg4.js → chunk-y33hd9x7.js} +1 -1
- package/dist/{chunk-k0y7ta0d.js → chunk-y9nyqcha.js} +1 -1
- package/dist/chunk-yft2a2bf.js +2 -0
- package/dist/chunk-yjvd2p32.js +2 -0
- package/dist/{chunk-3rjeare9.js → chunk-ykgj5w4g.js} +2 -2
- package/dist/{chunk-bax52sn4.js → chunk-yq903p32.js} +2 -2
- package/dist/chunk-yvnx05f6.js +2 -0
- package/dist/{chunk-6kdb8j9d.js → chunk-ze3qgdaf.js} +1 -1
- package/dist/{chunk-6xsxkzhy.js → chunk-zqrh41k8.js} +1 -1
- package/dist/chunk-zv2hvn7r.js +2 -0
- package/dist/cli.js +14 -14
- package/dist/client-script-bundler.js +1 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/dev-server/serve-app.js +2 -2
- package/dist/pwa.js +2 -2
- package/dist/spa-nav.d.ts +20 -0
- package/dist/spa-nav.js +12 -0
- package/dist/ssg.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-2a8q7c9z.js +0 -2
- package/dist/chunk-2enzjhrh.js +0 -2
- package/dist/chunk-31e2jrb4.js +0 -2
- package/dist/chunk-3fv1agwg.js +0 -2
- package/dist/chunk-3nmkjd4b.js +0 -2
- package/dist/chunk-44gm42cq.js +0 -2
- package/dist/chunk-76p7bnw1.js +0 -2
- package/dist/chunk-7mem81az.js +0 -2
- package/dist/chunk-7ncfmg13.js +0 -2
- package/dist/chunk-86cmtck2.js +0 -2
- package/dist/chunk-8tdj5zep.js +0 -2
- package/dist/chunk-a9c8w6fq.js +0 -2
- package/dist/chunk-b24chdr8.js +0 -2
- package/dist/chunk-cfx3vjh6.js +0 -2
- package/dist/chunk-e17ys98t.js +0 -2
- package/dist/chunk-f57xky9r.js +0 -2
- package/dist/chunk-f76qk302.js +0 -2
- package/dist/chunk-fqggvrwy.js +0 -2
- package/dist/chunk-fz52r2f7.js +0 -2
- package/dist/chunk-gbewds58.js +0 -2
- package/dist/chunk-gw431w90.js +0 -2
- package/dist/chunk-hfjhybrn.js +0 -2
- package/dist/chunk-k2f4jwez.js +0 -2
- package/dist/chunk-m38tpeke.js +0 -2
- package/dist/chunk-my8x4p73.js +0 -2
- package/dist/chunk-pb5s3vwg.js +0 -2
- package/dist/chunk-psbfqbkt.js +0 -2
- package/dist/chunk-pwyjrwrc.js +0 -2
- package/dist/chunk-q2dmpbqf.js +0 -2
- package/dist/chunk-sq24kkns.js +0 -2
- package/dist/chunk-tqtcs1wb.js +0 -2
- package/dist/chunk-tt50t72e.js +0 -30
- package/dist/chunk-vt31an48.js +0 -2
- package/dist/chunk-wrm7300v.js +0 -2
- package/dist/chunk-yzb748mw.js +0 -2
- package/dist/chunk-zafnsr0w.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{mh as x,rh as M,sh as C,th as v,uh as P}from"./chunk-6rzwef28.js";import{ov as y}from"./chunk-6bcw8twx.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 Ug,w as Vg,Q as Wg,d as Xg,g as Yg,n as Zg,D as _g,t as $g,KJ as ah};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ht as IJ}from"./chunk-v4vvm7mz.js";import{ov as VJ}from"./chunk-6bcw8twx.js";import O from"path";import{hasLocalConfig as FJ}from"bunfig";var JJ={fg:{light:"gray-900",dark:"gray-100",description:"Primary text"},"fg-strong":{light:"gray-700",dark:"gray-300",description:"Labels, secondary headings"},"fg-muted":{light:"gray-600",dark:"gray-400",description:"Supporting text"},"fg-soft":{light:"gray-500",dark:"gray-400",description:"De-emphasised text"},"fg-subtle":{light:"gray-400",dark:"gray-500",description:"Placeholders, disabled text"},surface:{light:"gray-50",dark:"gray-800",description:"Page and panel background"},"surface-raised":{light:"gray-100",dark:"gray-700",description:"Cards, popovers"},"surface-sunken":{light:"gray-200",dark:"gray-700",description:"Wells, track backgrounds"},line:{light:"gray-200",dark:"gray-700",description:"Default border, divider"},"line-strong":{light:"gray-300",dark:"gray-600",description:"Input border, focus ring track"},accent:{light:"indigo-600",dark:"indigo-400",description:"Primary action, selected state"},info:{light:"blue-600",dark:"blue-400",description:"Informational emphasis, links"},danger:{light:"red-600",dark:"red-400",description:"Errors, destructive actions"},success:{light:"green-600",dark:"green-400",description:"Confirmation"},warning:{light:"yellow-500",dark:"yellow-400",description:"Caution"},"accent-solid":{light:"indigo-600",dark:"indigo-500",description:"Primary button fill"},"info-solid":{light:"blue-600",dark:"blue-500",description:"Informational fill"},"danger-solid":{light:"red-600",dark:"red-500",description:"Destructive button fill"},"success-solid":{light:"green-600",dark:"green-500",description:"Confirmation fill"}};function g(Q){return`--stx-${Q}`}function m(Q,J){let Y=J.lastIndexOf("-");if(Y===-1)return typeof Q[J]==="string"?Q[J]:void 0;let $=Q[J.slice(0,Y)];if(!$||typeof $!=="object")return;let Z=$[J.slice(Y+1)];return typeof Z==="string"?Z:void 0}function QJ(Q){let J={};for(let[Y,$]of Object.entries(JJ)){let Z=m(Q,$.light);if(Z===void 0)continue;J[Y]=`var(${g(Y)}, ${Z})`}return J}function YJ(Q){let J=[],Y=[];for(let[$,Z]of Object.entries(JJ)){let q=m(Q,Z.light),U=m(Q,Z.dark);if(q===void 0)continue;if(J.push(` ${g($)}: ${q};`),U!==void 0)Y.push(` ${g($)}: ${U};`)}if(J.length===0)return"";return["/* stx role tokens \u2014 override any of these to re-theme by meaning. */",":root {",...J,"}",".dark {",...Y,"}",""].join(`
|
|
3
3
|
`)}function $J(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function u(Q,J){let Y={...Q};for(let[$,Z]of Object.entries(J))Y[$]=$J(Z)&&$J(Y[$])?u(Y[$],Z):Z;return Y}function ZJ(Q={},J={}){let Y=Q.theme||{},$=J.theme||{},{extend:Z,...q}=$,{extend:U,...j}=Y,F=j.colors||{};j.colors={...F,...QJ(F)};let V=u(j,q),I=u(U||{},Z||{});if(Object.keys(I).length>0)V.extend=I;let L=[...Q.safelist||[],...J.safelist||[]],T={...Q.shortcuts||{},...J.shortcuts||{}},K=[...Q.preflights||[],...J.preflights||[]];return{config:{...Q,...J,theme:V,safelist:L,shortcuts:T,...K.length>0?{preflights:K}:{},content:[],output:""},safelist:L,shortcuts:T,includePreflight:J.preflight!==!1,minify:J.minify===!0,tokenCSS:YJ(F)}}var W={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",blink:"\x1B[5m",reverse:"\x1B[7m",hidden:"\x1B[8m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgBlack:"\x1B[40m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",bgGray:"\x1B[100m"};import OJ from"fs";class h{cache=new Map;maxSize;options;sizes;bytes=0;constructor(Q=100,J){this.maxSize=Q,this.options=J??null,this.sizes=J?new Map:null}get byteSize(){return this.bytes}setMaxBytes(Q){if(!this.options)return;this.options={...this.options,maxBytes:Q};while(this.bytes>Q&&this.cache.size>0){let J=this.cache.keys().next().value;if(J===void 0)break;this.delete(J)}}get(Q){if(!this.cache.has(Q))return;let J=this.cache.get(Q);return this.cache.delete(Q),this.cache.set(Q,J),J}set(Q,J){if(this.cache.has(Q))this.delete(Q);let Y=this.options?this.options.sizeOf(J):0;if(this.options&&Y>this.options.maxBytes)return;while(this.cache.size>0&&(this.cache.size>=this.maxSize||this.options!==null&&this.bytes+Y>this.options.maxBytes)){let $=this.cache.keys().next().value;if($===void 0)break;this.delete($)}if(this.cache.set(Q,J),this.sizes)this.sizes.set(Q,Y),this.bytes+=Y}has(Q){return this.cache.has(Q)}delete(Q){if(this.sizes){let J=this.sizes.get(Q);if(J!==void 0)this.bytes-=J,this.sizes.delete(Q)}return this.cache.delete(Q)}clear(){this.cache.clear(),this.sizes?.clear(),this.bytes=0}get size(){return this.cache.size}keys(){return this.cache.keys()}values(){return this.cache.values()}}var B=new Map,_J=500;function mJ(Q,J){if(J?.includes("g"))return new RegExp(Q,J);let Y=`${Q}:${J||""}`;if(!B.has(Y)){if(B.size>=_J){let $=B.keys().next().value;if($)B.delete($)}B.set(Y,new RegExp(Q,J))}return B.get(Y)}class qJ{pool=[];maxPoolSize=10;fnCache=new Map;fnCacheMaxSize=200;getEvaluator(Q){let J=Array.from(new Set(Q)),Y=J.sort().join(","),$=this.pool.find((j)=>j.context.join(",")===Y);if($)return $.func;let Z=this.fnCache,q=this.fnCacheMaxSize,U=(...j)=>{return(F)=>{try{let V=`${Y}:${F}`,I=Z.get(V);if(!I){if(Z.size>=q){let L=Z.keys().next().value;if(L)Z.delete(L)}I=Function(...J,`
|
|
4
4
|
'use strict';
|
|
5
5
|
try {
|
|
@@ -11,7 +11,7 @@ catch (e) {
|
|
|
11
11
|
}
|
|
12
12
|
throw e;
|
|
13
13
|
}
|
|
14
|
-
`),Z.set(V,I)}return I(...j)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:U,context:J.slice()});return U}clear(){this.pool.length=0,this.fnCache.clear()}}var uJ=new qJ;class UJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(Q){this.enabled=Q}isEnabled(){return this.enabled}setBudget(Q,J){this.budgets.set(Q,{warnThreshold:0.8,action:"warn",...J})}setBudgets(Q){for(let[J,Y]of Object.entries(Q))this.setBudget(J,Y)}removeBudget(Q){this.budgets.delete(Q)}getBudgets(){let Q={};for(let[J,Y]of this.budgets.entries())Q[J]=Y;return Q}onViolation(Q){this.violationHandlers.push(Q)}offViolation(Q){let J=this.violationHandlers.indexOf(Q);if(J!==-1)this.violationHandlers.splice(J,1)}time(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}async timeAsync(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=await J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}checkBudget(Q,J){let Y=this.budgets.get(Q);if(!Y)return;let $=J/Y.maxTime*100,Z=Y.warnThreshold!==void 0?J>=Y.maxTime*Y.warnThreshold&&J<Y.maxTime:!1,q=J>=Y.maxTime;if(!Z&&!q)return;let U={label:Q,actualTime:J,budgetTime:Y.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:Z};this.violations.push(U);while(this.violations.length>this.maxViolations)this.violations.shift();for(let F of this.violationHandlers)try{F(U)}catch{}let j=Z?`[Performance Warning] "${Q}" took ${J.toFixed(2)}ms (${$.toFixed(1)}% of ${Y.maxTime}ms budget)`:`[Performance Budget Exceeded] "${Q}" took ${J.toFixed(2)}ms (exceeded ${Y.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Y.action){case"log":console.log(j);break;case"warn":console.warn(j);break;case"error":console.error(j);break;case"throw":if(q)throw Error(j);else console.warn(j);break}}recordTime(Q,J){let Y=this.metrics.get(Q);if(Y)Y.count++,Y.totalTime+=J,Y.maxTime=Math.max(Y.maxTime,J),Y.minTime=Math.min(Y.minTime,J);else this.metrics.set(Q,{count:1,totalTime:J,maxTime:J,minTime:J})}getStats(Q){if(Q){let Y=this.metrics.get(Q);if(!Y)return{};let $=this.budgets.get(Q);return{count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:$?.maxTime,budgetUtilization:$?Y.totalTime/Y.count/$.maxTime*100:void 0}}let J={};for(let[Y,$]of this.metrics.entries()){let Z=this.budgets.get(Y);J[Y]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:Z?.maxTime,budgetUtilization:Z?$.totalTime/$.count/Z.maxTime*100:void 0}}return J}getViolations(Q){if(Q)return this.violations.filter((J)=>J.label===Q);return[...this.violations]}getViolationStats(){let Q={},J=0,Y=0;for(let $ of this.violations)if(Q[$.label]=(Q[$.label]||0)+1,$.isWarning)J++;else Y++;return{total:this.violations.length,byLabel:Q,warnings:J,errors:Y}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var d=null;function HJ(){if(!d)d=new UJ;return d}var dJ=new Proxy({},{get(Q,J){return HJ()[J]}});var WJ=[];function jJ(Q){let J=new h(Q);return WJ.push(J),J}function lJ(){for(let Q of WJ)Q.clear()}function i(Q,...J){return`${J.map((Y)=>String(Y??"")).join("\x00")}\x00${Q.length}\x00${Bun.hash(Q)}`}function nJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function oJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var N=null,l=!1,X=null,M="",w=!1,NJ=256,_=new Map,z=new Map,H=null,E=null;function x(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function c(Q,J){if(_.has(Q))_.delete(Q);else if(_.size>=NJ)_.delete(_.keys().next().value);_.set(Q,J)}function TJ(Q){let J=x(Q);if(z.has(J))z.delete(J);else if(z.size>=NJ)z.delete(z.keys().next().value);return z.set(J,Q),J}function YQ(Q){let J=z.get(Q);if(J===void 0)return;return z.delete(Q),z.set(Q,J),J}async function BJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${x(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function wJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${x(Q)}.css`),J)}catch{}}async function GJ(Q){try{let J=await import(Q);if(J&&J.CSSGenerator)return{CSSGenerator:J.CSSGenerator,config:J.config,build:J.build,defaultConfig:J.defaultConfig,extractClasses:J.extractClasses}}catch{}return null}var KJ=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],RJ=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function PJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J)){for(let Y of["node_modules","pantry"])for(let $ of KJ)Q.push(O.join(J,Y,...$));J=O.dirname(J)}return Q}function DJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"",Y=[J&&O.join(J,"Code","Tools","ts-css"),J&&O.join(J,"Code","Tools","crosswind"),J&&O.join(J,"repos","stacks-org","ts-css"),J&&O.join(J,"repos","stacks-org","crosswind"),O.join(process.cwd(),"..","ts-css"),O.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let $ of Y)Q.push(O.join($,"packages","toolkit","dist","engine","index.js")),Q.push(O.join($,"packages","toolkit","src","engine","index.ts"));if(J)Q.push(O.join(J,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return Q}async function zJ(){if(l)return N;l=!0;try{let Q=async(Z)=>{for(let q of Z){if(!await Bun.file(q).exists())continue;let U=await GJ(q);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded from ${O.dirname(O.dirname(q))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Z=O.resolve(process.env.CROSSWIND_SRC),q=await Q([Z]);if(!q)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${Z}`);return N=q,N}let J=await Q(PJ());if(J)return N=J,N;let Y=RJ;for(let Z of Y){let q=await GJ(Z);if(q){if(N=q,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded`);return N}}let $=await Q(DJ());if($)return N=$,N;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${W.reset}`),null}}function $Q(){n.clear(),N=null,l=!1,X=null,M="",_.clear(),z.clear(),E=null}var XJ=!1;async function AJ(Q){try{let J=FJ({name:"css",cwd:Q})?"css":FJ({name:"crosswind",cwd:Q})?"crosswind":null;if(!J)return null;if(J==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!XJ)XJ=!0,console.warn(`${W.yellow}[ts-css]${W.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:Y}=await import("bunfig"),$=await Y({name:J,cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!$?.path||!$.config||Object.keys($.config).length===0)return null;let Z=O.relative(Q,$.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} Loaded config from ${Z||$.path}`);return $.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[ts-css]${W.reset} Failed to load css config:`,J instanceof Error?J.message:J),null}}async function MJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-b24chdr8.js"),$=await Y(Q);if($.css)if(typeof $.css==="string"){let Z=O.isAbsolute($.css)?$.css:O.resolve(Q,$.css);if(await Bun.file(Z).exists()){let q=await import(Z);J=q.default||q,console.log(`${W.green}[ts-css]${W.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(J={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let Z=O.isAbsolute($.css.config)?$.css.config:O.resolve(Q,$.css.config);if(await Bun.file(Z).exists()){let q=await import(Z);J={...q.default||q,...J}}}console.log(`${W.green}[ts-css]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await AJ(Q)}function EJ(Q){try{let J=new WeakSet;return x(JSON.stringify(Q??{},(Y,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(J.has($))return"[circular]";J.add($)}return $})??"")}catch{return"unhashable"}}async function SJ(Q){if(w)return M;w=!0;try{let J=await zJ();if(!J||!J.build)return w=!1,"";if(!X)X=await AJ(Q);if(!X)return w=!1,"";let Y=J.defaultConfig?.theme||{},$=X.theme||{},Z={...J.defaultConfig,...X,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),j=performance.now()-q;if(M=U.css,console.log(`${W.cyan}[ts-css]${W.reset} Built ${U.classes.size} classes in ${j.toFixed(1)}ms`),Z.output){let F=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),V=O.dirname(F);if(!fs.existsSync(V))fs.mkdirSync(V,{recursive:!0});await Bun.write(F,U.css)}return w=!1,U.css}catch(J){return console.error(`${W.red}[ts-css]${W.reset} Build error:`,J),w=!1,M}}async function ZQ(Q){X=null,await SJ(Q)}function qQ(){return M}function vJ(Q){let J=new Set,Y=/class\s*=\s*["']([^"']+)["']/gi,$=Y.exec(Q);while($!==null){for(let U of $[1].split(/\s+/))if(U.trim())J.add(U.trim());$=Y.exec(Q)}let Z=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,q=Z.exec(Q);while(q!==null){let U=q[1].match(/'([^']+)'/g);if(U){for(let j of U)for(let F of j.slice(1,-1).split(/\s+/))if(F.trim())J.add(F.trim())}q=Z.exec(Q)}return J}var n=jJ(64);async function xJ(Q,J){let Y=n.get(i(Q,J,E));if(Y!==void 0)return Y;let $=await kJ(Q,J);if($)n.set(i(Q,J,E),$);return $}async function kJ(Q,J){try{let Y=await zJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):vJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=IJ(Z,"cache");let q=[...$].sort().join(" "),U=`${E||"default"}::${q}`,j=_.get(U);if(j!==void 0)return c(U,j),j;let F=await BJ(U);if(F!==null)return c(U,F),F;if(!X)X=await MJ(Z),E=EJ(X);let V=Y.defaultConfig||Y.config,I=X||{},L=ZJ(V,I),{safelist:T,includePreflight:K,minify:k,tokenCSS:LJ}=L,o=L.config,R=new Y.CSSGenerator(o);for(let G of T)R.generate(G);for(let G of $)R.generate(G);let A=R.toCSS(K,k),r=o.shortcuts||I.shortcuts||{};for(let[G,b]of Object.entries(r)){if(!$.has(G)&&!T.includes(G))continue;let y=b.split(/\s+/).filter(Boolean);for(let D of y)R.generate(D)}A=R.toCSS(K,k);let P=A.split(`
|
|
14
|
+
`),Z.set(V,I)}return I(...j)}catch{return}}};if(this.pool.length<this.maxPoolSize)this.pool.push({func:U,context:J.slice()});return U}clear(){this.pool.length=0,this.fnCache.clear()}}var uJ=new qJ;class UJ{metrics=new Map;budgets=new Map;violations=[];maxViolations=100;violationHandlers=[];enabled=!0;setEnabled(Q){this.enabled=Q}isEnabled(){return this.enabled}setBudget(Q,J){this.budgets.set(Q,{warnThreshold:0.8,action:"warn",...J})}setBudgets(Q){for(let[J,Y]of Object.entries(Q))this.setBudget(J,Y)}removeBudget(Q){this.budgets.delete(Q)}getBudgets(){let Q={};for(let[J,Y]of this.budgets.entries())Q[J]=Y;return Q}onViolation(Q){this.violationHandlers.push(Q)}offViolation(Q){let J=this.violationHandlers.indexOf(Q);if(J!==-1)this.violationHandlers.splice(J,1)}time(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}async timeAsync(Q,J){if(!this.enabled)return J();let Y=performance.now(),$=await J(),Z=performance.now()-Y;return this.recordTime(Q,Z),this.checkBudget(Q,Z),$}checkBudget(Q,J){let Y=this.budgets.get(Q);if(!Y)return;let $=J/Y.maxTime*100,Z=Y.warnThreshold!==void 0?J>=Y.maxTime*Y.warnThreshold&&J<Y.maxTime:!1,q=J>=Y.maxTime;if(!Z&&!q)return;let U={label:Q,actualTime:J,budgetTime:Y.maxTime,exceedancePercent:$,timestamp:new Date,isWarning:Z};this.violations.push(U);while(this.violations.length>this.maxViolations)this.violations.shift();for(let F of this.violationHandlers)try{F(U)}catch{}let j=Z?`[Performance Warning] "${Q}" took ${J.toFixed(2)}ms (${$.toFixed(1)}% of ${Y.maxTime}ms budget)`:`[Performance Budget Exceeded] "${Q}" took ${J.toFixed(2)}ms (exceeded ${Y.maxTime}ms budget by ${($-100).toFixed(1)}%)`;switch(Y.action){case"log":console.log(j);break;case"warn":console.warn(j);break;case"error":console.error(j);break;case"throw":if(q)throw Error(j);else console.warn(j);break}}recordTime(Q,J){let Y=this.metrics.get(Q);if(Y)Y.count++,Y.totalTime+=J,Y.maxTime=Math.max(Y.maxTime,J),Y.minTime=Math.min(Y.minTime,J);else this.metrics.set(Q,{count:1,totalTime:J,maxTime:J,minTime:J})}getStats(Q){if(Q){let Y=this.metrics.get(Q);if(!Y)return{};let $=this.budgets.get(Q);return{count:Y.count,avgTime:Y.totalTime/Y.count,totalTime:Y.totalTime,maxTime:Y.maxTime,minTime:Y.minTime,budget:$?.maxTime,budgetUtilization:$?Y.totalTime/Y.count/$.maxTime*100:void 0}}let J={};for(let[Y,$]of this.metrics.entries()){let Z=this.budgets.get(Y);J[Y]={count:$.count,avgTime:$.totalTime/$.count,totalTime:$.totalTime,maxTime:$.maxTime,minTime:$.minTime,budget:Z?.maxTime,budgetUtilization:Z?$.totalTime/$.count/Z.maxTime*100:void 0}}return J}getViolations(Q){if(Q)return this.violations.filter((J)=>J.label===Q);return[...this.violations]}getViolationStats(){let Q={},J=0,Y=0;for(let $ of this.violations)if(Q[$.label]=(Q[$.label]||0)+1,$.isWarning)J++;else Y++;return{total:this.violations.length,byLabel:Q,warnings:J,errors:Y}}clear(){this.metrics.clear()}clearViolations(){this.violations.length=0}clearBudgets(){this.budgets.clear()}reset(){this.clear(),this.clearViolations(),this.clearBudgets(),this.violationHandlers.length=0}}var d=null;function HJ(){if(!d)d=new UJ;return d}var dJ=new Proxy({},{get(Q,J){return HJ()[J]}});var WJ=[];function jJ(Q){let J=new h(Q);return WJ.push(J),J}function lJ(){for(let Q of WJ)Q.clear()}function i(Q,...J){return`${J.map((Y)=>String(Y??"")).join("\x00")}\x00${Q.length}\x00${Bun.hash(Q)}`}function nJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function oJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var N=null,l=!1,X=null,M="",w=!1,NJ=256,_=new Map,z=new Map,H=null,E=null;function x(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function c(Q,J){if(_.has(Q))_.delete(Q);else if(_.size>=NJ)_.delete(_.keys().next().value);_.set(Q,J)}function TJ(Q){let J=x(Q);if(z.has(J))z.delete(J);else if(z.size>=NJ)z.delete(z.keys().next().value);return z.set(J,Q),J}function YQ(Q){let J=z.get(Q);if(J===void 0)return;return z.delete(Q),z.set(Q,J),J}async function BJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${x(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function wJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${x(Q)}.css`),J)}catch{}}async function GJ(Q){try{let J=await import(Q);if(J&&J.CSSGenerator)return{CSSGenerator:J.CSSGenerator,config:J.config,build:J.build,defaultConfig:J.defaultConfig,extractClasses:J.extractClasses}}catch{}return null}var KJ=[["@stacksjs","ts-css","dist","engine","index.js"],["@stacksjs","ts-css","src","engine","index.ts"]],RJ=["@stacksjs/ts-css/engine","@stacksjs/ts-css/dist/engine/index.js"];function PJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J)){for(let Y of["node_modules","pantry"])for(let $ of KJ)Q.push(O.join(J,Y,...$));J=O.dirname(J)}return Q}function DJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"",Y=[J&&O.join(J,"Code","Tools","ts-css"),J&&O.join(J,"Code","Tools","crosswind"),J&&O.join(J,"repos","stacks-org","ts-css"),J&&O.join(J,"repos","stacks-org","crosswind"),O.join(process.cwd(),"..","ts-css"),O.join(process.cwd(),"..","crosswind")].filter(Boolean);for(let $ of Y)Q.push(O.join($,"packages","toolkit","dist","engine","index.js")),Q.push(O.join($,"packages","toolkit","src","engine","index.ts"));if(J)Q.push(O.join(J,"Code","Tools","stx","node_modules","@stacksjs","ts-css","dist","engine","index.js"));return Q}async function zJ(){if(l)return N;l=!0;try{let Q=async(Z)=>{for(let q of Z){if(!await Bun.file(q).exists())continue;let U=await GJ(q);if(U){if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded from ${O.dirname(O.dirname(q))}`);return U}}return null};if(process.env.CROSSWIND_SRC){let Z=O.resolve(process.env.CROSSWIND_SRC),q=await Q([Z]);if(!q)throw Error(`CROSSWIND_SRC did not resolve to a Css module: ${Z}`);return N=q,N}let J=await Q(PJ());if(J)return N=J,N;let Y=RJ;for(let Z of Y){let q=await GJ(Z);if(q){if(N=q,!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} CSS engine loaded`);return N}}let $=await Q(DJ());if($)return N=$,N;throw Error("Css CSSGenerator not found in any location")}catch{return console.warn(`${W.yellow}[ts-css] CSS engine not available, Tailwind styles will not be generated${W.reset}`),console.warn(`${W.yellow}Run 'bun add @stacksjs/ts-css' to enable CSS generation${W.reset}`),null}}function $Q(){n.clear(),N=null,l=!1,X=null,M="",_.clear(),z.clear(),E=null}var XJ=!1;async function AJ(Q){try{let J=FJ({name:"css",cwd:Q})?"css":FJ({name:"crosswind",cwd:Q})?"crosswind":null;if(!J)return null;if(J==="crosswind"&&!process.env.STACKS_DEV_QUIET&&!XJ)XJ=!0,console.warn(`${W.yellow}[ts-css]${W.reset} Reading the CSS config from a \`crosswind\` file. Rename it to \`css\` (e.g. config/css.ts) \u2014 the old name is deprecated.`);let{loadConfigWithResult:Y}=await import("bunfig"),$=await Y({name:J,cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!$?.path||!$.config||Object.keys($.config).length===0)return null;let Z=O.relative(Q,$.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${W.green}[ts-css]${W.reset} Loaded config from ${Z||$.path}`);return $.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${W.yellow}[ts-css]${W.reset} Failed to load css config:`,J instanceof Error?J.message:J),null}}async function MJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-h58zg4p4.js"),$=await Y(Q);if($.css)if(typeof $.css==="string"){let Z=O.isAbsolute($.css)?$.css:O.resolve(Q,$.css);if(await Bun.file(Z).exists()){let q=await import(Z);J=q.default||q,console.log(`${W.green}[ts-css]${W.reset} Loaded config from stx.config.ts \u2192 ${$.css}`)}}else{if(J={...$.css,content:$.css.content||[],preflight:$.css.preflight??!0,minify:$.css.minify??!1},$.css.config){let Z=O.isAbsolute($.css.config)?$.css.config:O.resolve(Q,$.css.config);if(await Bun.file(Z).exists()){let q=await import(Z);J={...q.default||q,...J}}}console.log(`${W.green}[ts-css]${W.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await AJ(Q)}function EJ(Q){try{let J=new WeakSet;return x(JSON.stringify(Q??{},(Y,$)=>{if(typeof $==="function")return`[fn]${String($)}`;if(typeof $==="object"&&$!==null){if(J.has($))return"[circular]";J.add($)}return $})??"")}catch{return"unhashable"}}async function SJ(Q){if(w)return M;w=!0;try{let J=await zJ();if(!J||!J.build)return w=!1,"";if(!X)X=await AJ(Q);if(!X)return w=!1,"";let Y=J.defaultConfig?.theme||{},$=X.theme||{},Z={...J.defaultConfig,...X,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),j=performance.now()-q;if(M=U.css,console.log(`${W.cyan}[ts-css]${W.reset} Built ${U.classes.size} classes in ${j.toFixed(1)}ms`),Z.output){let F=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),V=O.dirname(F);if(!fs.existsSync(V))fs.mkdirSync(V,{recursive:!0});await Bun.write(F,U.css)}return w=!1,U.css}catch(J){return console.error(`${W.red}[ts-css]${W.reset} Build error:`,J),w=!1,M}}async function ZQ(Q){X=null,await SJ(Q)}function qQ(){return M}function vJ(Q){let J=new Set,Y=/class\s*=\s*["']([^"']+)["']/gi,$=Y.exec(Q);while($!==null){for(let U of $[1].split(/\s+/))if(U.trim())J.add(U.trim());$=Y.exec(Q)}let Z=/(?:x-class|:class)\s*=\s*"([^"]+)"/gi,q=Z.exec(Q);while(q!==null){let U=q[1].match(/'([^']+)'/g);if(U){for(let j of U)for(let F of j.slice(1,-1).split(/\s+/))if(F.trim())J.add(F.trim())}q=Z.exec(Q)}return J}var n=jJ(64);async function xJ(Q,J){let Y=n.get(i(Q,J,E));if(Y!==void 0)return Y;let $=await kJ(Q,J);if($)n.set(i(Q,J,E),$);return $}async function kJ(Q,J){try{let Y=await zJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):vJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=IJ(Z,"cache");let q=[...$].sort().join(" "),U=`${E||"default"}::${q}`,j=_.get(U);if(j!==void 0)return c(U,j),j;let F=await BJ(U);if(F!==null)return c(U,F),F;if(!X)X=await MJ(Z),E=EJ(X);let V=Y.defaultConfig||Y.config,I=X||{},L=ZJ(V,I),{safelist:T,includePreflight:K,minify:k,tokenCSS:LJ}=L,o=L.config,R=new Y.CSSGenerator(o);for(let G of T)R.generate(G);for(let G of $)R.generate(G);let A=R.toCSS(K,k),r=o.shortcuts||I.shortcuts||{};for(let[G,b]of Object.entries(r)){if(!$.has(G)&&!T.includes(G))continue;let y=b.split(/\s+/).filter(Boolean);for(let D of y)R.generate(D)}A=R.toCSS(K,k);let P=A.split(`
|
|
15
15
|
`);for(let[G,b]of Object.entries(r)){if(!$.has(G)&&!T.includes(G))continue;let y=b.split(/\s+/).filter(Boolean),D=[],f=[];for(let C of y){let a=C.startsWith("dark:"),s=`.${(a?C.slice(5):C).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let S=0;S<P.length;S++){let t=P[S].trim();if(t===`${s} {`||t.startsWith(`${s} {`)){let v=S,e="";while(v<P.length){if(e+=P[v],P[v].includes("}"))break;v++}let p=e.match(/\{([^}]+)\}/);if(p)if(a)f.push(p[1].trim());else D.push(p[1].trim());break}}}if(D.length)A+=`
|
|
16
16
|
.${G} { ${D.join(" ")} }`;if(f.length)A+=`
|
|
17
17
|
@media (prefers-color-scheme: dark) { .dark .${G} { ${f.join(" ")} } }`}return A=LJ+A,c(U,A),wJ(U,A),A}catch(Y){return console.warn("Failed to generate Css CSS:",Y),""}}async function UQ(Q,J,Y=!1){let $=await xJ(Q,J);if(!$)return Q;let Z=Y?`<link data-css="generated" rel="stylesheet" href="/_stx/css.${TJ($)}.css">`:`<style data-css="generated">
|
|
@@ -19,4 +19,4 @@ ${$}
|
|
|
19
19
|
</style>`,q=/(?:<style\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-css=(?:"generated"|'generated')[^>]*>)/g;if(q.test(Q)){let U=!1;return Q.replace(q,()=>{if(U)return"";return U=!0,Z})}if(Q.includes("</head>"))return Q.replace("</head>",`${Z}
|
|
20
20
|
</head>`);if(Q.includes("<body"))return Q.replace(/<body([^>]*)>/,`<body$1>
|
|
21
21
|
${Z}`);return Z+Q}
|
|
22
|
-
export{h as
|
|
22
|
+
export{h as gt,mJ as ht,dJ as it,jJ as jt,lJ as kt,i as lt,nJ as mt,oJ as nt,u as ot,ZJ as pt,W as qt,YQ as rt,zJ as st,$Q as tt,AJ as ut,MJ as vt,EJ as wt,SJ as xt,ZQ as yt,qQ as zt,vJ as At,xJ as Bt,UQ as Ct};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fj as a,gj as b,hj as c,ij as d,jj as e,kj as f,lj as g,mj as h,nj as i,oj as j,pj as k,qj as l,rj as m,sj as n}from"./chunk-18kcg747.js";import"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{i as streamingSuspenseDirective,m as streamToResponse,g as streamTemplateSimple,a as streamTemplate,d as renderStreamingPage,k as registerStreamingDirectives,e as processStreamDirectives,l as processSectionDirectives,j as islandDirective,n as generateHydrationRuntime,f as extractStreamBoundaries,h as createStreamRenderer,b as buildSuspenseResolveScript,c as SUSPENSE_RESOLVER_RUNTIME};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Lp as X,ym as W}from"./chunk-17389q0t.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,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-6bcw8twx.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ep as T,lm as D,mm as O}from"./chunk-17389q0t.js";import{bv as h,dv as i,ev as o}from"./chunk-54fnvfp1.js";import{lv as d,ov as c}from"./chunk-6bcw8twx.js";var C=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function y(z,J,F){let Q={fullTag:F,content:J,attrs:z};if(/\bserver\b/.test(z))return{...Q,type:"server"};if(/\bdata-stx-scoped\b/.test(z))return{...Q,type:"client"};if(C.test(J))return{...Q,type:"signals"};if(/\bclient\b/.test(z)||/\btype\s*=\s*["']module["']/.test(z)||/\bsrc\s*=/.test(z))return{...Q,type:"client"};return{...Q,type:"server"}}var S=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function b(z){let J=[],F=[],Q=[],$=0;while($<z.length){let X=z.indexOf("<",$);if(X===-1)break;let j=O(z,X);if(j>X){$=j;continue}let Z=D(z,X);if(Z>X){let U=z.slice(X,Z),B=S.exec(U);if(B){let Y=y(B[1],B[2],U);switch(Y.type){case"signals":J.push(Y);break;case"client":F.push(Y);break;case"server":Q.push(Y);break}}$=Z;continue}$=X+(z.startsWith("<!--",X)?4:1)}return{signals:J,client:F,server:Q}}var f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function u(z){let J=[],F=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,Q;while((Q=F.exec(z))!==null)J.push({start:Q.index,end:Q.index+Q[0].length});return J}function x(z,J){return J.some((F)=>z>=F.start&&z<F.end)}function g(z){let J=(z||"").trim();if(!J)return null;if(/[\s>+~,:]/.test(J))return null;let F={},Q=J,$=Q.match(/^[a-z][\w-]*/i);if($)F.tag=$[0].toLowerCase(),Q=Q.slice($[0].length);while(Q.length>0){let X=Q.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(X){if(F.attr=X[1],X[3]!==void 0&&X[3]!=="")F.attrValue=X[3];Q=Q.slice(X[0].length);continue}let j=Q.match(/^#([\w-]+)/);if(j){F.id=j[1],Q=Q.slice(j[0].length);continue}let Z=Q.match(/^\.([\w-]+)/);if(Z){F.className=Z[1],Q=Q.slice(Z[0].length);continue}return null}if(!F.tag&&!F.attr&&!F.id&&!F.className)return null;return F}function m(z,J){if(J.attr){if(!(J.attrValue===void 0?new RegExp(`\\b${J.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${J.attr}\\s*=\\s*(["'])\\s*${J.attrValue}\\s*\\1`,"i")).test(z))return!1}if(J.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${J.id}\\s*\\1`,"i").test(z))return!1}if(J.className){let F=z.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!F)return!1;if(!F[2].split(/\s+/).includes(J.className))return!1}return!0}function E(z,J="main"){let F=g(J);if(!F)return null;let Q=/<([a-z][\w-]*)\b([^>]*)>/gi,$=u(z),X;while((X=Q.exec(z))!==null){if(x(X.index,$))continue;let j=X[1].toLowerCase(),Z=X[2]||"";if(Z.trimEnd().endsWith("/")||f.has(j))continue;if(F.tag&&F.tag!==j)continue;if(!m(Z,F))continue;let U=X[0],B=X.index+U.length,Y=new RegExp(`<(/?)${j}\\b([^>]*)>`,"gi");Y.lastIndex=B;let W=1,G;while((G=Y.exec(z))!==null){if(x(G.index,$))continue;let w=G[1]==="/";if(!w&&(G[2]||"").trimEnd().endsWith("/"))continue;if(W+=w?-1:1,W===0)return{openTag:U,openIndex:X.index,start:B,end:G.index,tagName:j}}return null}return null}var Fz="X-STX-Router",Jz="private, no-store";function Qz(z){return z.replace(/&#(\d+);/g,(J,F)=>M(Number(F),J)).replace(/&#x([0-9a-f]+);/gi,(J,F)=>M(Number.parseInt(F,16),J)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function M(z,J){if(!Number.isInteger(z)||z<0||z>1114111)return J;try{return String.fromCodePoint(z)}catch{return J}}function P(z){return z.headers.get("X-STX-Router")==="true"}function p(z,J){if(!z)return J;return z.split(",").some((Q)=>Q.trim().toLowerCase()===J.toLowerCase())?z:`${z}, ${J}`}function Xz(z){return{Vary:p(z,"X-STX-Router")}}import L from"path";h();var n="stx-page-head:",l=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,I=null;function r(){if(I!==null)return I;try{let{getRouterScript:z}=(o(),d(i));I=`<script>${z()}</script>`}catch{I=""}return I}async function Kz(z,J){if(J===!1)return null;if(J&&typeof J==="string"){let Q=L.resolve(z,J);if(await Bun.file(Q).exists())return Q;return null}let F=L.join(z,"app.stx");if(await Bun.file(F).exists())return F;return null}async function Gz(z,J){try{let F=await Bun.file(z).text(),Q=F,$=F.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if($)Q=$[1].trim();let X=b(F),j=[...X.client.map((K)=>K.fullTag),...X.signals.map((K)=>K.fullTag)],Z=[],U=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,B;while((B=U.exec(F))!==null)Z.push(B[0]);let Y=Q;for(let K of X.server)Y=Y.replace(K.fullTag,"");for(let K of X.client)Y=Y.replace(K.fullTag,"");Y=Y.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let W="<!--__STX_PAGE_SLOT__-->";if(Y=Y.replace(/<slot\s*\/>/gi,W).replace(/<slot\s*>\s*<\/slot>/gi,W),!Y.includes(W))return console.warn(`[stx] Shell ${z} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:G,extractVariables:w,defaultConfig:q,loadStxConfig:A}=await import("./chunk-c1jkpd5e.js"),v=await A(),V={__filename:z,__dirname:L.dirname(z)};for(let K of j){let N=K.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(N&&!K.includes("client")&&!K.includes('type="module"'))await w(N[1],V,z)}let k=await G(Y,V,z,{...q,...v,...J},new Set),H=k.indexOf(W);if(H===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:k.substring(0,H),afterSlot:k.substring(H+W.length),filePath:z,shellScripts:j,shellStyles:Z}}catch(F){return console.error(`[stx] Error processing shell ${z}:`,F),null}}function Vz(z,J,F){let Q,$="",X=J.match(l);if(X){J=J.replace(X[0],"");try{let Y=Buffer.from(X[1],"base64").toString("utf8"),W=Y.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(W)Q=W[1].trim();$=Y.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let j=F||Q||"stx App",Z=r(),U="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<title>${j}</title>
|
|
8
|
+
${$?` ${$}
|
|
9
|
+
`:""} ${z.shellStyles.join(`
|
|
10
|
+
`)}
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
${z.beforeSlot}
|
|
14
|
+
<div data-stx-content>${J}</div>
|
|
15
|
+
${z.afterSlot}
|
|
16
|
+
${z.shellScripts.filter((Y)=>!Y.includes("server")).join(`
|
|
17
|
+
`)}
|
|
18
|
+
${U}
|
|
19
|
+
${Z}
|
|
20
|
+
</body>
|
|
21
|
+
</html>`}function s(z,J={}){let F=z.trim();if(!T(F))return z;let Q=[],$=F.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if($){let U=$[1],B=/<style\b[^>]*>[\s\S]*?<\/style>/gi,Y;while((Y=B.exec(U))!==null)Q.push(Y[0])}if(J.preserveHead&&$){let U=[],B=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,Y;while((Y=B.exec($[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(Y[0]))continue;U.push(Y[0])}if(U.length>0)Q.unshift(`<!--${n}${Buffer.from(U.join(`
|
|
22
|
+
`),"utf8").toString("base64")}-->`)}let X=F.match(/<body\b[^>]*>/i),j=F.lastIndexOf("</body>");if(X&&j!==-1){let U=X.index+X[0].length,B=F.slice(U,j).trim();if(Q.length>0)return Q.join(`
|
|
23
|
+
`)+`
|
|
24
|
+
`+B;return B}let Z=F;if(Z=Z.replace(/<!DOCTYPE\b[^>]*>/i,""),Z=Z.replace(/<html\b[^>]*>/i,""),Z=Z.replace(/<\/html\s*>/i,""),$)Z=Z.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,Q.join(`
|
|
25
|
+
`));return Z=Z.replace(/<body\b[^>]*>/i,""),Z=Z.replace(/<\/body\s*>/i,""),Z.trim()}var a=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function qz(z){return P(z)}function kz(z,J="main"){let F=z.trim(),Q=[],$=[],X=F.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(X){let A=X[1],v=/<style\b[^>]*>[\s\S]*?<\/style>/gi,V;while((V=v.exec(A))!==null)Q.push(V[0]);let k=/<script\b[^>]*data-stx-route-params[^>]*>[\s\S]*?<\/script>/gi;while((V=k.exec(A))!==null)$.push(V[0])}let j=E(F,J);if(!j)return s(z);let{tagName:Z,start:U,end:B}=j,Y=F.slice(U,B).trim(),W=[],G=F.match(/<body\b[^>]*>/i),w=F.lastIndexOf("</body>");if(G&&G.index!==void 0&&w!==-1){let v=[[G.index+G[0].length,j.openIndex],[B+`</${Z}>`.length,w]],V=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[k,H]of v){if(k>=H)continue;let K=F.slice(k,H),N;V.lastIndex=0;while((N=V.exec(K))!==null){if(a.test(N[0]))continue;W.push(N[0])}}}let q=[];if(Q.length>0)q.push(Q.join(`
|
|
26
|
+
`));if($.length>0)q.push($.join(`
|
|
27
|
+
`));if(W.length>0)q.push(W.join(`
|
|
28
|
+
`));return q.push(Y),q.join(`
|
|
29
|
+
`)}import _ from"fs";import R from"path";function vz(z,J,F){return{version:1,buildTime:new Date().toISOString(),routes:z,assets:J,outputDir:F}}function Iz(z,J){let F=R.join(J,"manifest.json");_.writeFileSync(F,JSON.stringify(z,null,2))}function Lz(z){let J=R.join(z,"manifest.json");if(!_.existsSync(J))return null;try{let F=_.readFileSync(J,"utf-8"),Q=JSON.parse(F);if(Q.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${Q.version}`),null;return Q}catch(F){return console.warn("[stx] Failed to load manifest:",F),null}}
|
|
30
|
+
export{y as Xf,b as Yf,g as Zf,E as _f,Fz as $f,Jz as ag,Qz as bg,P as cg,p as dg,Xz as eg,Kz as fg,Gz as gg,Vz as hg,s as ig,qz as jg,kz as kg,vz as lg,Iz as mg,Lz as ng};
|
|
@@ -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 Dt,K as Et,O as Ft,H as Gt,Q as Ht,W as It};
|
|
@@ -318,4 +318,4 @@ else {
|
|
|
318
318
|
console.log('[stx] Transition runtime initialized');
|
|
319
319
|
})();
|
|
320
320
|
`}function $(b){let j=/@transition\.([a-z-]+)(?:\.(\d+))?="([^"]+)"/gi;return b.replace(j,(B,q,A,z)=>{let F=A||"300",G=`stx-t-${Math.random().toString(36).slice(2,7)}`;return`data-stx-transition="${q}" data-stx-transition-duration="${F}" data-stx-transition-condition="${z}" data-stx-transition-id="${G}"`})}
|
|
321
|
-
export{W as
|
|
321
|
+
export{W as vi,X as wi,Y as xi,Z as yi,_ as zi,$ as Ai};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Is as Q}from"./chunk-6xbscz34.js";import"./chunk-nn4k6hvv.js";import{Ht as R}from"./chunk-v4vvm7mz.js";import"./chunk-6bcw8twx.js";import O from"fs";import U from"path";async function W(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R(j.root,"story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await X(J,K,b,z);return z.duration=Date.now()-q,z}async function X(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=U.join(b,`${j.id}-${B.id}.snap`),G=Y(B.source||""),L=await _(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Z(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function A(j,b={}){return(await W(j,{...b,update:!0})).total}function Y(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Z(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function _(j){try{return await O.promises.access(j),!0}catch{return!1}}function I(j){let b=[];if(b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(" STX Story Visual Regression Tests"),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),b.join(`
|
|
3
3
|
`)}async function S(j,b={}){let q=performance.now(),z=[],K=0,B=0;for(let G of j.storyFiles)try{let L=await Bun.file(G.path).text(),M=await Q(L,G.path);if(M.length>0){for(let N of M)z.push({storyId:G.id,variantId:"default",component:G.component,message:`A11y: ${N.message}`,expected:"No accessibility violations",actual:`${N.type}: ${N.message} (impact: ${N.impact})`});B++}else K++}catch(L){z.push({storyId:G.id,variantId:"default",component:G.component,message:`Failed to check a11y: ${L instanceof Error?L.message:String(L)}`,expected:"File readable for a11y check",actual:"File read error"}),B++}let J=performance.now()-q;return{total:j.storyFiles.length,passed:K,failed:B,new:0,failures:z,duration:J}}export{A as updateSnapshots,W as runVisualTests,S as runA11yTests,I as formatTestResults};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Eo as a,Fo as b}from"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{b as processLoops,a as parseLoopBinding};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Am as n,Bm as o,nm as a,om as b,pm as c,qm as d,rm as e,sm as f,tm as g,um as h,vm as i,wm as j,xm as k,ym as l,zm as m}from"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{h as usesSignalsInScript,o as unescapeHtml,c as registerFilters,b as registerFilter,l as processExpressions,k as interpolateScriptsInTemplate,i as interpolateScriptExpressions,j as interpolateScriptAttributes,d as getAllFilters,n as evaluateExpression,g as escapeHtmlValue,f as escapeHtml,a as defaultFilters,e as clearCustomFilters,m as applyFilters};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var L=null,R=[],N=0,U=new Set;function X(){return L}function Y(j){let G=L;return R.push(j),L=j,G}function Z(j){R.pop(),L=j}function _(){return N>0}function $(j){U.add(j)}function B(j){N++;try{j()}finally{if(N--,N===0){let G=[...U];U.clear();for(let F of G)F()}}}function A(j){let G=L;L=null;try{return j()}finally{L=G}}var O=[],P=[];function q(j){let G=j,F=new Set,H=new Set,I=()=>{let z=X();if(z)H.add(z);return G};return I.set=(z)=>{if(!Object.is(z,G)){let J=G;if(G=z,F.forEach((K)=>K(G,J)),_())H.forEach((K)=>$(K));else H.forEach((K)=>K())}},I.update=(z)=>{I.set(z(G))},I.subscribe=(z)=>{return F.add(z),()=>F.delete(z)},Object.defineProperty(I,"_isSignal",{value:!0,writable:!1}),Object.defineProperty(I,"value",{get:()=>I(),set:(z)=>I.set(z),configurable:!0}),I}function E(j){let G,F=!0,H=new Set,I=()=>{if(!F)if(F=!0,_())H.forEach((J)=>$(J));else H.forEach((J)=>J())},z=()=>{let J=X();if(J)H.add(J);if(F){let K=Y(I);try{G=j()}finally{Z(K)}F=!1}return G};return Object.defineProperty(z,"_isDerived",{value:!0,writable:!1}),Object.defineProperty(z,"value",{get:()=>z(),configurable:!0}),z}function V(j,G={}){let F,H=!1,I=()=>{if(H)return;if(F)F(),F=void 0;let z=Y(I);try{let J=j();F=typeof J==="function"?J:void 0}finally{Z(z)}};if(G.immediate!==!1)I();return()=>{if(H=!0,F){let z=F;F=void 0,z()}}}function h(j){B(j)}function k(j){O.push(j)}function o(j){P.push(j)}function g(){W(O,"onMount",P)}function v(){W(P,"onDestroy")}function W(j,G,F){let H=j.splice(0,j.length);for(let I of H)try{let z=I();if(F&&typeof z==="function")F.push(z)}catch(z){console.error(`[stx] ${G} callback threw:`,z)}}function d(){return{mount:O.length,destroy:P.length}}function m(j){return typeof j==="function"&&j._isSignal===!0}function D(j){return typeof j==="function"&&j._isDerived===!0}function p(j){if(m(j)||D(j))return j();return j}function w(j){return A(j)}function f(j,G){let F=typeof j==="function"?j:()=>j,H=q([]),I=E(()=>H().reduce((K,M)=>G(K,M.action),F())),z=!1;return V(()=>{if(F(),!z){z=!0;return}if(w(()=>H().length))H.set([])}),[I,(K,M)=>{let T={action:K};H.set([...H(),T]);let Q=()=>{let x=H().filter((C)=>C!==T);if(x.length!==H().length)H.set(x)};if(M&&typeof M.then==="function")Promise.resolve(M).then(Q,Q);return Q}]}
|
|
3
|
-
export{X as
|
|
3
|
+
export{X as wj,Y as xj,Z as yj,_ as zj,$ as Aj,q as Bj,E as Cj,V as Dj,h as Ej,k as Fj,o as Gj,g as Hj,v as Ij,d as Jj,m as Kj,D as Lj,p as Mj,w as Nj,f as Oj};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{if as a,jf as b,kf as c,lf as d,mf as e,nf as f,of as g,pf as h,qf as i,rf as j,sf as k,tf as l,uf as m,vf as n,wf as o}from"./chunk-ps20v1ah.js";import"./chunk-
|
|
2
|
+
import{if as a,jf as b,kf as c,lf as d,mf as e,nf as f,of as g,pf as h,qf as i,rf as j,sf as k,tf as l,uf as m,vf as n,wf as o}from"./chunk-ps20v1ah.js";import"./chunk-6bcw8twx.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-6bcw8twx.js";var Y=null,S=[],F=new WeakMap;function I(z){let K=z,B=new Set,G={get value(){if(Y){let H=F.get(G);if(!H)H=new Set,F.set(G,H);H.add(Y)}return K},set value(H){if(!Object.is(K,H)){K=H,B.forEach((J)=>J(H));let L=F.get(G);if(L)L.forEach((J)=>J())}},subscribe(H){return B.add(H),()=>B.delete(H)},peek(){return K}};return G}function W(z){return z!==null&&typeof z==="object"&&"value"in z&&"subscribe"in z&&"peek"in z}function P(z){return W(z)?z.value:z}function j(z){let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=I(z[B]);return K}function D(z){return I(z)}function U(z){let K=typeof z==="function",B=K?z:z.get,G=K?void 0:z.set,H=K?Object.is:z.equals||Object.is,L,J=!0,Q=new Set,X=new Set,_=()=>{if(J=!0,X.size>0){let N=T.value;X.forEach(($)=>$(N))}};function Z(){Q.clear();let N=Y;Y=_,S.push(_);try{return B()}finally{S.pop(),Y=N}}let T={get value(){if(Y){let N=F.get(T);if(!N)N=new Set,F.set(T,N);N.add(Y)}if(J){let N=Z();if(!H(L,N))L=N;J=!1}return L},set value(N){if(G)G(N);else console.warn("Computed property is readonly")},subscribe(N){return X.add(N),()=>X.delete(N)},peek(){if(J)L=B(),J=!1;return L},invalidate(){J=!0},get dirty(){return J},get deps(){return Q}};return T}function x(z,K,B={}){let{immediate:G=!1,deep:H=!1,flush:L="pre",once:J=!1}=B,Q,X=!0,_=!1,Z=()=>{if(W(z))return H?q(z.value):z.value;return z()},T=()=>{if(!X||_)return;let M=Z();if(Q!==void 0&&Object.is(Q,M)&&!H)return;let A=()=>{if(K(M,Q),Q=H?q(M):M,J)$()};if(L==="sync")A();else if(L==="post")queueMicrotask(A);else Promise.resolve().then(A)},N=null;if(W(z))N=z.subscribe(()=>T());else N=U(z).subscribe(()=>T());if(G)Q=void 0,T();else Q=Z();let $=()=>{if(X=!1,N)N(),N=null};return $.pause=()=>{_=!0},$.resume=()=>{_=!1},$}function E(z,K,B={}){let{immediate:G=!1,once:H=!1}=B,L=z.map((T)=>W(T)?T.value:void 0),J=!0,Q=!1,X=()=>{if(!J||Q)return;let T=z.map((N)=>W(N)?N.value:void 0);if(K(T,L),L=[...T],H)Z()},_=z.map((T)=>{if(W(T))return T.subscribe(()=>X());return()=>{}});if(G)X();let Z=()=>{J=!1,_.forEach((T)=>T())};return Z.pause=()=>{Q=!0},Z.resume=()=>{Q=!1},Z}function y(z,K={}){let{flush:B="pre"}=K,G,H=!0,L=!1,J=()=>{if(!H||L)return;if(G)G();let X=Y;Y=J,S.push(J);try{G=z()}finally{S.pop(),Y=X}};if(B==="sync")J();else if(B==="post")queueMicrotask(J);else Promise.resolve().then(J);let Q=()=>{if(H=!1,G)G()};return Q.pause=()=>{L=!0},Q.resume=()=>{L=!1},Q}function C(z,K={},B){let G=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return z.replace(G,(H,L,J)=>{try{let X=Function(...Object.keys(K),`return ${J}`)(...Object.values(K));return K[L]=X,`<!-- computed: ${L} = ${X} -->`}catch(Q){return`<!-- computed error: ${L} - ${Q} -->`}})}function R(z,K={},B){let G=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return z.replace(G,(H,L,J)=>{return`
|
|
3
3
|
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
4
|
(function() {
|
|
5
5
|
// Watch implementation for ${L}
|
|
@@ -213,4 +213,4 @@ function w(Z,M){let{itemHeight:K,containerHeight:P,overscan:F=3,keyProperty:$="i
|
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
215
|
`})}var v={createVirtualList:w,processVirtualListDirectives:C,processInfiniteListDirectives:E,processVirtualGridDirectives:f,generateVirtualListCSS:b,useVirtualList:L};
|
|
216
|
-
export{w as
|
|
216
|
+
export{w as Si,C as Ti,b as Ui,L as Vi,E as Wi,f as Xi,v as Yi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{d as
|
|
2
|
+
import{ov as l}from"./chunk-6bcw8twx.js";import U from"fs";import G from"path";import I from"os";import H from"crypto";import{generatePlaceholder as m,processImage as g}from"ts-images";var d=[320,640,768,1024,1280,1536,1920],h=["webp","jpeg"],b=80,u=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],P={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},N=null,W=!1;async function Y(){if(W)return N;W=!0;try{let J=await import("sharp");return N=J.default||J,N}catch{return null}}async function e(){return await Y()!==null}async function t(){return!0}async function JJ(J,K={}){let{widths:Z=d,formats:$=h,quality:q=b,fit:C="cover",placeholder:X="none",outputDir:Q=".stx/images",baseUrl:_="/images"}=K,j,x;if(typeof J==="string"){if(x=J,!await Bun.file(J).exists())throw new L(`Image not found: ${J}`,"NOT_FOUND");j=await Bun.file(J).arrayBuffer().then((V)=>Buffer.from(V))}else x="buffer-input",j=J;let w=H.createHash("sha256").update(j).digest("hex").slice(0,12),y=await O(j),{width:B,height:D}=y,A=B/D;await U.promises.mkdir(Q,{recursive:!0});let T=[],v=G.basename(x,G.extname(x)),z=Z.filter((V)=>V<=B);if(!z.includes(B)&&B<=Math.max(...Z))z.push(B);z.sort((V,R)=>V-R);for(let V of z){let R=Math.round(V/A);for(let F of $){let S=`${v}-${V}w-${w}.${F}`,k=G.join(Q,S),c=`${_}/${S}`,E=await n(j,{width:V,height:R,format:F,quality:q,fit:C});await Bun.write(k,E),T.push({path:k,url:c,width:V,height:R,format:F,size:E.length})}}let M;if(X!=="none")M=await o(j,X);return{src:x,variants:T,placeholder:M,width:B,height:D,aspectRatio:A,hash:w}}async function O(J){let K=typeof J==="string"?Buffer.from(await Bun.file(J).arrayBuffer()):J,Z=await Y();if(Z){let q=await Z(K).metadata();return{width:q.width||0,height:q.height||0,format:q.format||"unknown",hasAlpha:q.hasAlpha}}return p(K)}function p(J){if(J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71){let K=J.readUInt32BE(16),Z=J.readUInt32BE(20);return{width:K,height:Z,format:"png",hasAlpha:!0}}if(J[0]===255&&J[1]===216){let K=2;while(K<J.length){if(J[K]!==255)break;let Z=J[K+1];if(Z>=192&&Z<=207&&Z!==196&&Z!==200&&Z!==204){let q=J.readUInt16BE(K+5);return{width:J.readUInt16BE(K+7),height:q,format:"jpeg",hasAlpha:!1}}let $=J.readUInt16BE(K+2);K+=2+$}}if(J.toString("utf8",0,4)==="RIFF"&&J.toString("utf8",8,12)==="WEBP"){let K=J.toString("utf8",12,16);if(K==="VP8 "){let Z=J.readUInt16LE(26)&16383,$=J.readUInt16LE(28)&16383;return{width:Z,height:$,format:"webp",hasAlpha:!1}}if(K==="VP8L"){let Z=J.readUInt32LE(21),$=(Z&16383)+1,q=(Z>>14&16383)+1;return{width:$,height:q,format:"webp",hasAlpha:!0}}}if(J.toString("utf8",0,3)==="GIF"){let K=J.readUInt16LE(6),Z=J.readUInt16LE(8);return{width:K,height:Z,format:"gif",hasAlpha:!0}}throw new L("Unable to parse image dimensions","PARSE_ERROR")}async function n(J,K){let Z=await Y();if(Z){let q=Z(J).resize(K.width,K.height,{fit:K.fit});switch(K.format){case"webp":q=q.webp({quality:K.quality});break;case"avif":q=q.avif({quality:K.quality});break;case"jpeg":q=q.jpeg({quality:K.quality});break;case"png":q=q.png({quality:K.quality});break}return q.toBuffer()}let $=G.join(I.tmpdir(),`stx-img-${H.randomBytes(8).toString("hex")}.${K.format}`);try{return await g({input:J,output:$,format:K.format,quality:K.quality,resize:{width:K.width,height:K.height,fit:K.fit}}),Buffer.from(await Bun.file($).arrayBuffer())}finally{await U.promises.unlink($).catch(()=>{})}}async function o(J,K){let Z=await Y();if(K==="blur"&&Z){let X=(await Z(J).resize(20).blur(10).toBuffer()).toString("base64"),Q=await O(J);return`data:${P[Q.format]||"image/jpeg"};base64,${X}`}if(K==="dominant-color"&&Z){let{dominant:C}=await Z(J).resize(1,1).toBuffer().then(async(X)=>{let Q=await Z(X).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${C.r}, ${C.g}, ${C.b})`}let $=await O(J),q=G.join(I.tmpdir(),`stx-ph-${H.randomBytes(8).toString("hex")}.${$.format==="unknown"?"bin":$.format}`);try{await Bun.write(q,J);let C=K==="blur"?"blur":K==="thumbhash"?"thumbhash":"dominant-color",Q=await m(q,{strategy:C,width:C==="thumbhash"?void 0:32});if(K==="dominant-color"&&Q.dominantColor)return Q.dominantColor;if(Q.dataURL)return Q.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await U.promises.unlink(q).catch(()=>{})}}function KJ(J,K){return(K?J.filter(($)=>$.format===K):J).sort(($,q)=>$.width-q.width).map(($)=>`${$.url} ${$.width}w`).join(", ")}function ZJ(J){if(!J||Object.keys(J).length===0)return"100vw";return Object.entries(J).sort((Z,$)=>{let q=Number.parseInt(Z[0].replace(/\D/g,""))||0;return(Number.parseInt($[0].replace(/\D/g,""))||0)-q}).map(([Z,$])=>`(max-width: ${Z}) ${$}`).join(", ")+", 100vw"}function $J(J){let K=J.filter(($)=>$.format==="jpeg");if(K.length===0)return J[Math.floor(J.length/2)];let Z=K.sort(($,q)=>$.width-q.width);return Z[Math.floor(Z.length/2)]}function qJ(J){let K=new Map;for(let Z of J){let $=K.get(Z.format)||[];$.push(Z),K.set(Z.format,$)}return K}function CJ(J){let K=G.extname(J).toLowerCase();return u.includes(K)}function QJ(J){return P[J]||"application/octet-stream"}function VJ(J){return J.reduce((K,Z)=>K+Z.size,0)}function XJ(J){if(J<1024)return`${J} B`;if(J<1048576)return`${(J/1024).toFixed(1)} KB`;return`${(J/1048576).toFixed(2)} MB`}class L extends Error{code;constructor(J,K){super(J);this.name="ImageProcessingError",this.code=K}}
|
|
3
|
+
export{d as Fh,h as Gh,b as Hh,e as Ih,t as Jh,JJ as Kh,O as Lh,n as Mh,KJ as Nh,ZJ as Oh,$J as Ph,qJ as Qh,CJ as Rh,QJ as Sh,VJ as Th,XJ as Uh,L as Vh};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ao as g,Bo as h,Co as i,Do as j,uo as a,vo as b,wo as c,xo as d,yo as e,zo as f}from"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.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{At as
|
|
2
|
+
import{At as j,Bt as k,Ct as l,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}from"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-6bcw8twx.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 G from"path";var L=new Set([".jpg",".jpeg",".png",".gif"]),O=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function M(j,z){let H=z.formats??O;if(!z.publicDir)return j;let C=N(j),J=[],Y=/<img\b[^>]*?>/gi,K=[],Q;while((Q=Y.exec(j))!==null){let q=Q[0],y=q.match(/\bsrc=["']([^"']+)["']/i);if(!y)continue;if(_(Q.index,C))continue;K.push({idx:Q.index,length:q.length,src:y[1],raw:q})}if(K.length===0)return j;let Z=await Promise.all(K.map(async(q)=>{let y=await X(q.src,z.publicDir,H);return{match:q,sources:y}}));for(let{match:q,sources:y}of Z){if(y.length===0)continue;let I=`<picture>${y.map(($)=>`<source type="${$.mime}" srcset="${w($.url)}">`).join("")}${q.raw}</picture>`;J.push({start:q.idx,end:q.idx+q.length,replacement:I})}if(J.length===0)return j;let V="",W=0;for(let q of J)V+=j.slice(W,q.start),V+=q.replacement,W=q.end;return V+=j.slice(W),V}async function X(j,z,H){if(!F(j))return[];let C=G.extname(j).toLowerCase();if(!L.has(C))return[];if(!j.startsWith("/"))return[];let J=G.join(z,j.slice(1)),Y=G.dirname(J),K=G.basename(J,C),Q=G.resolve(Y),Z=G.resolve(z);if(!Q.startsWith(Z))return[];let V=G.posix.dirname(j),W=H.map(async(y)=>{let k=G.join(Y,`${K}${y.ext}`);if(!await Bun.file(k).exists())return null;return{url:G.posix.join(V,`${K}${y.ext}`),mime:y.mime}});return(await Promise.all(W)).filter((y)=>y!==null)}function F(j){if(!j)return!1;if(j.startsWith("http://")||j.startsWith("https://"))return!1;if(j.startsWith("//"))return!1;if(j.startsWith("data:"))return!1;return!0}function N(j){let z=[],H=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,C;while((C=H.exec(j))!==null)z.push([C.index,C.index+C[0].length]);return z}function _(j,z){for(let[H,C]of z)if(j>=H&&j<C)return!0;return!1}function w(j){return j.replace(/&/g,"&").replace(/"/g,""")}
|
|
3
|
-
export{M as
|
|
3
|
+
export{M as ri};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Go as a,Ho as b,Io as c,Jo as d,Ko as e,Lo as f}from"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.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{Wf as a}from"./chunk-k4v9k7vj.js";import"./chunk-trpmf02p.js";import"./chunk-yq903p32.js";import"./chunk-mq0vtxe6.js";import"./chunk-w8yac9xp.js";import"./chunk-7eea1cse.js";import"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{a as buildForProduction};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{M as
|
|
2
|
+
import{ir as E}from"./chunk-17389q0t.js";import{ov as D}from"./chunk-6bcw8twx.js";import I from"path";async function M(k={}){let G=performance.now(),J=k.root||process.cwd(),j=await E(),q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let A,B;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");A=await z({pagesDir:I.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-yjvd2p32.js");B=await z({outputDir:".output",debug:k.debug,...k.ssr})}let H=Math.round(performance.now()-G);return{mode:q,ssg:A,ssr:B,duration:H}}
|
|
3
|
+
export{M as Ng};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ul as C}from"./chunk-17389q0t.js";import{bt as Y}from"./chunk-1zyqv8p8.js";import{cu as D}from"./chunk-ze3qgdaf.js";import u from"path";var S=/<script(\s[^>]*)?>([\s\S]*?)<\/script>/gi;function h(K){let J=(Q)=>Q.replace(/[^\n]/g," ");return K.replace(/<!--[\s\S]*?-->/g,J).replace(/\{\{--[\s\S]*?--\}\}/g,J)}function m(K){let J=[],Q=h(K);S.lastIndex=0;let $;while(($=S.exec(Q))!==null){let j=($[1]||"").trim(),F=($[0].match(/^<script(?:\s[^>]*)?>/i)?.[0]??"<script>").length,z=($[0].match(/<\/script\s*>$/i)?.[0]??"</script>").length,W=$.index+F,Z=$.index+$[0].length-z,G=K.slice(W,Z);if(/\bsrc\s*=/.test(j))continue;let q=j.match(/\btype\s*=\s*["']([^"']+)["']/i);if(q&&!/^(?:module|text\/(?:javascript|typescript))$/i.test(q[1]))continue;let X=/\bserver\b/.test(j)?"server":/\bclient\b/.test(j)?"client":"plain",U=B(K,W);J.push({kind:X,code:G,startLine:U,attrs:j})}return J}function B(K,J){let Q=1;for(let $=0;$<J&&$<K.length;$++)if(K.charCodeAt($)===10)Q++;return Q}function N(K,J){let Q=K.lastIndexOf(`
|
|
3
3
|
`,J-1)+1;return J-Q+1}function g(K){let J=K.split(""),Q=(j,F)=>{for(let z=j;z<F&&z<J.length;z++)if(J[z]!==`
|
|
4
4
|
`)J[z]=" "},$=[/<script(?:\s[^>]*)?>[\s\S]*?<\/script>/gi,/<style(?:\s[^>]*)?>[\s\S]*?<\/style>/gi,/<!--[\s\S]*?-->/g,/\{\{--[\s\S]*?--\}\}/g,/@verbatim\b[\s\S]*?@endverbatim\b/g];for(let j of $){j.lastIndex=0;let F;while((F=j.exec(K))!==null)Q(F.index,F.index+F[0].length)}return J.join("")}function p(K){let J=0,Q="";for(let $=0;$<K.length;$++){let j=K[$];if(Q){if(j==="\\"){$++;continue}if(j===Q)Q="";continue}if(j==='"'||j==="'"||j==="`"){Q=j;continue}if(j==="("||j==="["||j==="{"){J++;continue}if(j===")"||j==="]"||j==="}"){J--;continue}if(j==="|"&&J===0){if(K[$+1]==="|"){$++;continue}if(K[$-1]==="|")continue;return K.slice(0,$)}}return K}var R=new Set([":for","x-for","v-for"]),w=/(?:^|\s)((?::|x-|v-|@)[\w.:-]+)\s*=\s*(["'])([\s\S]*?)\2/g,O="__stx_interpolated",y="__StxElement",f="__StxTemplateValue",l=`type ${f}<T> = T extends { readonly _isSignal: true } | { readonly _isDerived: true } ? (T extends () => infer V ? T & V : T) : T`;function L(K){return K.replace(/\{\{[\s\S]*?\}\}/g,O).replace(/\{!![\s\S]*?!!\}/g,O)}function Vj(K){return K.replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}/g,(J)=>{let Q=J.split(`
|
|
5
5
|
`).length-1,$=J.length-Q;return`0${" ".repeat(Math.max(0,$-1))}${`
|
|
@@ -19,4 +19,4 @@ import{Tl as C}from"./chunk-6z04mpxz.js";import{at as Y}from"./chunk-c5rehxqy.js
|
|
|
19
19
|
`))z(Z);for(let Z of t().split(`
|
|
20
20
|
`))z(Z);for(let Z of C)z(`declare var ${Z}: any`);for(let Z of Zj)z(`declare var ${Z}: any`);z(`declare var ${O}: any`);let W=new Set(Q.flatMap((Z)=>V(Z.code)));z(`type ${y}<T> = T extends readonly (infer E)[] ? E : T extends Iterable<infer E2> ? E2 : any`);for(let Z of n(K)){if(W.has(Z.name))continue;let G=Z.iterable&&W.has(Z.iterable)?`${y}<typeof ${Z.iterable}>`:"any";z(`declare var ${Z.name}: ${G}`)}}if(J.templateExpressions!==!1){let W=c(K).map((Z)=>({expression:Z,statement:Wj(Z)})).filter((Z)=>Z.statement!==null);if(W.length>0){let Z=g(K),q=[...new Set(Q.flatMap((U)=>V(U.code)))].filter((U)=>/^[A-Z_$][\w$]*$/i.test(U)),X=0;if(q.length>0){z(l);for(let U of q)z(`type __StxT_${U} = ${f}<typeof ${U}>`);z(`;((${q.map((U)=>`${U}: __StxT_${U}`).join(", ")}) => {`),X=1}for(let{expression:U,statement:H}of W){let P=" ".repeat(X),M=U.offset===void 0?[]:zj(Z,U.offset),v=M.length>0?`${M.map((b)=>`if (${b}) `).join("")}{ `:"",E=M.length>0?" }":"";z(P+v+H.text+E,{line:U.line,column:U.column,expression:U,prefixLength:H.prefixLength+P.length+v.length})}if(X>0)z("});")}}return z("export {}"),{text:j.join(`
|
|
21
21
|
`),lineMap:F,sourceLineCount:$.length}}function Nj(K,J,Q){let $=K.lineMap.get(J);if(!$)return J<=K.sourceLineCount?{line:J,column:Q}:null;let j=Math.max(0,Q-1-($.prefixLength??0));return{line:$.line,column:$.column+j,expression:$.expression}}
|
|
22
|
-
export{m as
|
|
22
|
+
export{m as og,Vj as pg,Yj as qg,c as rg,V as sg,t as tg,Bj as ug,wj as vg,Uj as wg,Mj as xg,Nj as yg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Og as a,Pg as b,Qg as c,Rg as d,Sg as e,Tg as f}from"./chunk-p2aa1ak4.js";import"./chunk-17389q0t.js";import"./chunk-6xbscz34.js";import"./chunk-bkbr9yz2.js";import"./chunk-nn4k6hvv.js";import"./chunk-1zyqv8p8.js";import"./chunk-1zvyq6jj.js";import"./chunk-snsb8nm6.js";import"./chunk-v4vvm7mz.js";import"./chunk-s710wybv.js";import"./chunk-00mag1n0.js";import"./chunk-d3r5pdz7.js";import"./chunk-ze3qgdaf.js";import"./chunk-54fnvfp1.js";import"./chunk-42b81qv3.js";import"./chunk-6bcw8twx.js";export{c as renderSlot,d as processSlots,a as parseSlots,b as parseSlotElement,e as extractSlotContent,f as applySlots};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import y from"fs";import V from"path";var B=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect)\s*(?:<[^<>()]*>)?\s*\(/,X=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,D=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],g=3;function H(j,q){let J=V.resolve(V.dirname(q),j);for(let Q of D){let z=J+Q;try{if(y.statSync(z).isFile())return z}catch{}}return null}function K(j,q,J=0,Q=new Set){if(!q||J>=g)return!1;for(let z of j.matchAll(X)){let Z=H(z[1],q);if(!Z||Q.has(Z))continue;Q.add(Z);let $;try{$=y.readFileSync(Z,"utf8")}catch{continue}if(B.test($))return!0;if(K($,Z,J+1,Q))return!0}return!1}var Y=["batch","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],R=["onMount","onDestroy"];function A(j="const",q=[],J){let Q=q.length?Y.filter((z)=>!q.includes(z)):Y;if(J!==void 0)Q=Q.filter((z)=>{let Z=z.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${Z}(?![\\w$])`).test(J)});return`${j} { ${Q.join(", ")} } = window.stx;`}var k=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"],E={redirect:{category:"server-only",reason:"returns an HTTP Response for <script server>/edge/build; use navigate() on the client."},useAsyncData:{category:"browser-composable",reason:"inlined on demand from src/composables when a script references it; reachable, not a bare global."},Teleport:{category:"compile-time-directive",reason:"template tag resolved by processTeleportDirectives; not a script callable."},StxModalBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; drive open/close from the modal store."},StxToastBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; push toasts via the toast store."},useForm:{category:"browser-composable",reason:"reactive form primitive; lives in src/composables/use-form.ts and is inlined on demand when a <script client> references it (#1846)."},defineForm:{category:"browser-composable",reason:"deprecated alias of useForm, kept for a minor (#1843). Same delivery path \u2014 inlined on demand from src/composables/use-form.ts."},validateFields:{category:"isomorphic-import",reason:"pure validation helper; import it directly, not auto-delivered to <script client> (per client-api-delivery.test.ts)."},validateField:{category:"isomorphic-import",reason:"singular pure validation helper; same explicit-import boundary as validateFields."}},x=Y.filter((j)=>!k.includes(j));function O(j){if(!j)return!1;return x.some((q)=>new RegExp(`\\b${q}\\s*(?:<[^>]*>)?\\s*\\(`).test(j))}var M=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],C=/\s@[a-z][\w.:-]*\s*=/i;function T(j,q){if(!j)return!1;let J=U(j);return F(J,q)}function F(j,q){if(M.some((J)=>J.test(j)))return!0;if(O(j))return!0;return P(j,q)}function P(j,q){if(!q)return!1;for(let J of j.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(K(J[1],q))return!0;return!1}function d(j,q){if(!j)return!1;let J=U(j);return C.test(J)||F(J,q)}var u=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function _(j){return u.includes(j.toLowerCase())}var G=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],b=["x-init","x-transition","x-effect","x-on"],p=[...G,...b];function c(){return`{${G.map((j)=>`'${j}':1`).join(",")}}`}var v=65536,S=4,w=new Map;function r(){w.clear()}function U(j){if(!j)return j;if(!j.includes("<!--")&&!/<(?:pre|code)\b/i.test(j))return j;let q=j.length>=v;if(q){let z=w.get(j);if(z!==void 0)return z}let J=(z)=>z.replace(/(<[^>]*>)|([^<]+)/g,(Z,$,W)=>$??" ".repeat(W.length)),Q=j.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/<!--[\s\S]*?-->/g,(z)=>" ".repeat(z.length));if(q){while(w.size>=S){let z=w.keys().next();if(z.done)break;w.delete(z.value)}w.set(j,Q)}return Q}
|
|
3
|
-
export{K as
|
|
3
|
+
export{K as bu,Y as cu,R as du,A as eu,k as fu,E as gu,x as hu,O as iu,T as ju,d as ku,u as lu,_ as mu,G as nu,b as ou,p as pu,c as qu,r as ru,U as su};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{bh as a,ch as b,dh as c,eh as d,fh as e,gh as f,hh as g,ih as h,jh as i,kh as j,lh as k}from"./chunk-5c8f2rt7.js";import"./chunk-6rzwef28.js";import"./chunk-6bcw8twx.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
|