@stacksjs/stx 0.2.264 → 0.2.266

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.
Files changed (163) hide show
  1. package/dist/caching.js +2 -0
  2. package/dist/{chunk-25de1sj7.js → chunk-0athjw48.js} +2 -2
  3. package/dist/{chunk-38ykv2gd.js → chunk-135mme4g.js} +1 -1
  4. package/dist/{chunk-gpt6ggxj.js → chunk-1hhxj2r5.js} +1 -1
  5. package/dist/{chunk-f0rjjfk0.js → chunk-1j77d7fw.js} +1 -1
  6. package/dist/{chunk-sr49fd8p.js → chunk-1m4sa11y.js} +1 -1
  7. package/dist/{chunk-nteg247p.js → chunk-278yw67q.js} +1 -1
  8. package/dist/{chunk-0mk858ne.js → chunk-2ed60g20.js} +2 -2
  9. package/dist/{chunk-qpsj28s2.js → chunk-2qsa4h1t.js} +2 -2
  10. package/dist/{chunk-3rnc94mp.js → chunk-2x9s5z8x.js} +1 -1
  11. package/dist/{chunk-va2wwrpf.js → chunk-455pgdzh.js} +1 -1
  12. package/dist/{chunk-k6st4606.js → chunk-4ay1ymgp.js} +1 -1
  13. package/dist/{chunk-x7pp10qb.js → chunk-4cr21p7m.js} +1 -1
  14. package/dist/chunk-4mvpapjz.js +2 -0
  15. package/dist/{chunk-7exqxjx5.js → chunk-4mw2kfqd.js} +1 -1
  16. package/dist/chunk-4wnnet1k.js +12 -0
  17. package/dist/{chunk-jt8as8j8.js → chunk-52wr95ps.js} +1 -1
  18. package/dist/chunk-5htqgzbb.js +2 -0
  19. package/dist/chunk-5jcsg2mc.js +2 -0
  20. package/dist/{chunk-z0aygs4h.js → chunk-5k0j7bjy.js} +1 -1
  21. package/dist/{chunk-aw651z2y.js → chunk-5wkwhjjn.js} +54 -20
  22. package/dist/{chunk-xr1758xj.js → chunk-6746wmsf.js} +1 -1
  23. package/dist/{chunk-0bm5enna.js → chunk-6g4mnrr0.js} +1 -1
  24. package/dist/{chunk-new80es4.js → chunk-6g7m08rv.js} +1 -1
  25. package/dist/{chunk-4zkv1vqh.js → chunk-6yphtg3q.js} +1 -1
  26. package/dist/{chunk-p1rswnys.js → chunk-73yr54sg.js} +1 -1
  27. package/dist/{chunk-2pavh1yg.js → chunk-78bm61kd.js} +1 -1
  28. package/dist/chunk-7cts329z.js +2 -0
  29. package/dist/chunk-7kkc13rc.js +2 -0
  30. package/dist/chunk-8evws5cc.js +11 -0
  31. package/dist/{chunk-zr4emtxf.js → chunk-8jvmjzmr.js} +1 -1
  32. package/dist/{chunk-zr6m5k3t.js → chunk-987kjtg8.js} +1 -1
  33. package/dist/{chunk-3fa6t4fw.js → chunk-9gzmcxzg.js} +1 -1
  34. package/dist/{chunk-b3f5dwzz.js → chunk-9rdg7x9h.js} +1 -1
  35. package/dist/chunk-9rkcrzj4.js +2 -0
  36. package/dist/{chunk-8pvymy12.js → chunk-9y175wxc.js} +1 -1
  37. package/dist/{chunk-7a7jy8yr.js → chunk-a78tzerx.js} +1 -1
  38. package/dist/{chunk-5qngxbmv.js → chunk-a7x7dmtf.js} +1 -1
  39. package/dist/{chunk-3txrk37v.js → chunk-a95rrp0j.js} +1 -1
  40. package/dist/{chunk-s44edj8s.js → chunk-aagn8j9e.js} +10 -10
  41. package/dist/{chunk-dnhckx52.js → chunk-bby4emay.js} +1 -1
  42. package/dist/{chunk-j59pkkzn.js → chunk-behbakfv.js} +1 -1
  43. package/dist/chunk-c1r9q5pk.js +15 -0
  44. package/dist/chunk-cd4v7xyr.js +2 -0
  45. package/dist/chunk-d3v3p15c.js +2 -0
  46. package/dist/{chunk-jq375v8t.js → chunk-dhe8sp1a.js} +1 -1
  47. package/dist/chunk-dpgp6rzq.js +2 -0
  48. package/dist/{chunk-g8tce9rr.js → chunk-f1jd5qjb.js} +1 -1
  49. package/dist/chunk-f3k5xbhk.js +2 -0
  50. package/dist/{chunk-4qq5wj04.js → chunk-f3m0q482.js} +1 -1
  51. package/dist/{chunk-wb7dfcnc.js → chunk-f8g0zbm3.js} +1 -1
  52. package/dist/{chunk-0y6f4037.js → chunk-f8wjdg40.js} +1 -1
  53. package/dist/chunk-fcv00xs9.js +2 -0
  54. package/dist/{chunk-sne7938g.js → chunk-fn9yw31x.js} +1 -1
  55. package/dist/chunk-g4z7gah7.js +2 -0
  56. package/dist/{chunk-ph5f8eev.js → chunk-gej3rmfy.js} +1 -1
  57. package/dist/{chunk-a90d3xne.js → chunk-gn48cpgb.js} +1 -1
  58. package/dist/{chunk-1qnyvw5w.js → chunk-hhyf0s7s.js} +1 -1
  59. package/dist/{chunk-x84g0m0p.js → chunk-j24k071e.js} +1 -1
  60. package/dist/chunk-jb7h4qgh.js +22 -0
  61. package/dist/{chunk-a8mnhryz.js → chunk-jnbhyzkv.js} +2 -2
  62. package/dist/{chunk-nqy2v6vh.js → chunk-k4m48h62.js} +1 -1
  63. package/dist/chunk-k5c19t7e.js +2 -0
  64. package/dist/{chunk-6vqb54c8.js → chunk-k7n88ess.js} +1 -1
  65. package/dist/{chunk-wj2trgsn.js → chunk-krgth3gf.js} +1 -1
  66. package/dist/chunk-mb0kqnwf.js +2 -0
  67. package/dist/{chunk-r7dd7c7y.js → chunk-mbvkvac6.js} +332 -343
  68. package/dist/{chunk-4w3gg4g7.js → chunk-mcn9mwzv.js} +1 -1
  69. package/dist/{chunk-bjj27mf3.js → chunk-mv0syvrg.js} +1 -1
  70. package/dist/{chunk-rp0m678g.js → chunk-n2r83qwt.js} +1 -1
  71. package/dist/{chunk-j6e4vwv5.js → chunk-n3jgypjf.js} +1 -1
  72. package/dist/{chunk-ksm4b1cx.js → chunk-nfykda12.js} +1 -1
  73. package/dist/chunk-ng1wyd2v.js +2 -0
  74. package/dist/{chunk-xhq2a50x.js → chunk-nswz1rkm.js} +1 -1
  75. package/dist/{chunk-1n16xphq.js → chunk-nwq01xh0.js} +1 -1
  76. package/dist/chunk-p9ase2nx.js +2 -0
  77. package/dist/{chunk-s2wm8qwg.js → chunk-q4n8a7sf.js} +1 -1
  78. package/dist/chunk-q5et8k2d.js +2 -0
  79. package/dist/chunk-qf5grrg1.js +2 -0
  80. package/dist/{chunk-k1e72asa.js → chunk-qh6223a0.js} +1 -1
  81. package/dist/{chunk-gg2en16q.js → chunk-qkbrbys7.js} +1 -1
  82. package/dist/{chunk-yjk7vyd8.js → chunk-r4nkpr60.js} +1 -1
  83. package/dist/{chunk-c17txgm7.js → chunk-r9z71gj0.js} +1 -1
  84. package/dist/{chunk-c59rkxwf.js → chunk-rc4zrsw3.js} +1 -1
  85. package/dist/chunk-rgh4njyv.js +2 -0
  86. package/dist/{chunk-10tcqry1.js → chunk-rwb4nztb.js} +1 -1
  87. package/dist/chunk-scdxk8nn.js +2 -0
  88. package/dist/{chunk-5h5ydexj.js → chunk-sde45gh3.js} +1 -1
  89. package/dist/{chunk-chsfdfqm.js → chunk-shtemwbq.js} +1 -1
  90. package/dist/chunk-tc01rmwh.js +2 -0
  91. package/dist/{chunk-wx73fmky.js → chunk-tv6ds16a.js} +1 -1
  92. package/dist/chunk-tybdapd3.js +2 -0
  93. package/dist/chunk-v9crchhq.js +2 -0
  94. package/dist/{chunk-95mj2e8x.js → chunk-vrskjx64.js} +1 -1
  95. package/dist/{chunk-4svmpj7y.js → chunk-w7gpyx2k.js} +1 -1
  96. package/dist/{chunk-gyga6sjp.js → chunk-wacr03x4.js} +1 -1
  97. package/dist/chunk-x2mke7a1.js +2 -0
  98. package/dist/chunk-xkb16kmv.js +2 -0
  99. package/dist/chunk-xpsxwbw0.js +2 -0
  100. package/dist/{chunk-yb3nrbqz.js → chunk-yhtq662h.js} +1 -1
  101. package/dist/chunk-ykxs16y7.js +2 -0
  102. package/dist/chunk-yxp7wv61.js +3 -0
  103. package/dist/{chunk-x0t0ndxd.js → chunk-z66a9nnd.js} +1 -1
  104. package/dist/cli.js +14 -14
  105. package/dist/client-script-bundler.d.ts +14 -0
  106. package/dist/client-script-bundler.js +37 -21
  107. package/dist/client-script.d.ts +1 -0
  108. package/dist/client-script.js +4 -2
  109. package/dist/color-mode-boot.js +6 -3
  110. package/dist/component-client-factories.d.ts +29 -0
  111. package/dist/component-client-factories.js +24 -0
  112. package/dist/craft-entry.js +1 -1
  113. package/dist/craft.js +1 -1
  114. package/dist/database.js +1 -1
  115. package/dist/dev-server/crosswind.d.ts +0 -3
  116. package/dist/dev-server/crosswind.js +13 -0
  117. package/dist/framework-composables.js +12 -2
  118. package/dist/performance-utils.d.ts +22 -1
  119. package/dist/performance-utils.js +30 -5
  120. package/dist/pwa.js +2 -2
  121. package/dist/render-memo.d.ts +40 -0
  122. package/dist/render-memo.js +33 -0
  123. package/dist/script-validation.js +25 -11
  124. package/dist/ssg.js +3 -3
  125. package/dist/store-loader.js +10 -1
  126. package/dist/style-scoping.js +18 -7
  127. package/dist/utils.js +108 -58
  128. package/dist/variable-extractor.js +14 -8
  129. package/dist/visual-testing.js +1 -1
  130. package/package.json +5 -5
  131. package/dist/chunk-0ha9e1wt.js +0 -5
  132. package/dist/chunk-0x022m9m.js +0 -2
  133. package/dist/chunk-14cps421.js +0 -2
  134. package/dist/chunk-1r8c2wws.js +0 -2
  135. package/dist/chunk-2p4v6ed7.js +0 -2
  136. package/dist/chunk-2qbde7w2.js +0 -2
  137. package/dist/chunk-3wwnx5d4.js +0 -2
  138. package/dist/chunk-6gc8phhe.js +0 -2
  139. package/dist/chunk-7qgnd7z8.js +0 -2
  140. package/dist/chunk-85wgtm01.js +0 -2
  141. package/dist/chunk-8raem8ng.js +0 -2
  142. package/dist/chunk-a5sn113x.js +0 -12
  143. package/dist/chunk-b3zes539.js +0 -11
  144. package/dist/chunk-c2mvr9z1.js +0 -2
  145. package/dist/chunk-fenb3cqw.js +0 -2
  146. package/dist/chunk-g4t9zc0a.js +0 -2
  147. package/dist/chunk-gayjne01.js +0 -2
  148. package/dist/chunk-gd9gfw08.js +0 -2
  149. package/dist/chunk-gyf9fky4.js +0 -2
  150. package/dist/chunk-h44qqffw.js +0 -2
  151. package/dist/chunk-k6wnmjhf.js +0 -3
  152. package/dist/chunk-m116b3d9.js +0 -2
  153. package/dist/chunk-m8hggrdc.js +0 -2
  154. package/dist/chunk-mjbsb088.js +0 -2
  155. package/dist/chunk-p8ppbq1a.js +0 -2
  156. package/dist/chunk-ptcpaeem.js +0 -11
  157. package/dist/chunk-rs5w6cm5.js +0 -2
  158. package/dist/chunk-s5pd0ec9.js +0 -2
  159. package/dist/chunk-tn2kwwy4.js +0 -13
  160. package/dist/chunk-venjrj7g.js +0 -2
  161. package/dist/chunk-xezfdh27.js +0 -2
  162. package/dist/chunk-xmrwskw2.js +0 -2
  163. package/dist/chunk-zcz486dz.js +0 -2
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import{st as jJ}from"./chunk-bby4emay.js";import{Yu as NJ}from"./chunk-f8wjdg40.js";import O from"path";import{hasLocalConfig as AJ}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 m(Q){return`--stx-${Q}`}function u(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=u(Q,$.light);if(Z===void 0)continue;J[Y]=`var(${m(Y)}, ${Z})`}return J}function YJ(Q){let J=[],Y=[];for(let[$,Z]of Object.entries(JJ)){let q=u(Q,Z.light),U=u(Q,Z.dark);if(q===void 0)continue;if(J.push(` ${m($)}: ${q};`),U!==void 0)Y.push(` ${m($)}: ${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
+ `)}function $J(Q){return typeof Q==="object"&&Q!==null&&!Array.isArray(Q)}function d(Q,J){let Y={...Q};for(let[$,Z]of Object.entries(J))Y[$]=$J(Z)&&$J(Y[$])?d(Y[$],Z):Z;return Y}function ZJ(Q={},J={}){let Y=Q.theme||{},$=J.theme||{},{extend:Z,...q}=$,{extend:U,...W}=Y,G=W.colors||{};W.colors={...G,...QJ(G)};let X=d(W,q),V=d(U||{},Z||{});if(Object.keys(V).length>0)X.extend=V;let A=[...Q.safelist||[],...J.safelist||[]],T={...Q.shortcuts||{},...J.shortcuts||{}},R=[...Q.preflights||[],...J.preflights||[]];return{config:{...Q,...J,theme:X,safelist:A,shortcuts:T,...R.length>0?{preflights:R}:{},content:[],output:""},safelist:A,shortcuts:T,includePreflight:J.preflight!==!1,minify:J.minify===!0,tokenCSS:YJ(G)}}var F={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 c{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}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 CJ(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((W)=>W.context.join(",")===Y);if($)return $.func;let Z=this.fnCache,q=this.fnCacheMaxSize,U=(...W)=>{return(G)=>{try{let X=`${Y}:${G}`,V=Z.get(X);if(!V){if(Z.size>=q){let A=Z.keys().next().value;if(A)Z.delete(A)}V=Function(...J,`
4
+ 'use strict';
5
+ try {
6
+ return ${G};
7
+ }
8
+ catch (e) {
9
+ if (e instanceof ReferenceError || e instanceof TypeError) {
10
+ return undefined;
11
+ }
12
+ throw e;
13
+ }
14
+ `),Z.set(X,V)}return V(...W)}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 pJ=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 G of this.violationHandlers)try{G(U)}catch{}let W=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(W);break;case"warn":console.warn(W);break;case"error":console.error(W);break;case"throw":if(q)throw Error(W);else console.warn(W);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 h=null;function zJ(){if(!h)h=new UJ;return h}var gJ=new Proxy({},{get(Q,J){return zJ()[J]}});var WJ=[];function FJ(Q){let J=new c(Q);return WJ.push(J),J}function hJ(){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 cJ(Q){let J=[];for(let Y of new Set(Q))try{J.push({path:Y,mtimeMs:OJ.statSync(Y).mtimeMs})}catch{}return J}function iJ(Q){for(let J of Q)try{if(OJ.statSync(J.path).mtimeMs!==J.mtimeMs)return!1}catch{return!1}return!0}var L=null,n=!1,I=null,M="",K=!1,IJ=256,z=new Map,j=new Map,H=null,w=null;function k(Q){return Bun.hash(Q).toString(16).padStart(16,"0").slice(0,16)}function l(Q,J){if(z.has(Q))z.delete(Q);else if(z.size>=IJ)z.delete(z.keys().next().value);z.set(Q,J)}function HJ(Q){let J=k(Q);if(j.has(J))j.delete(J);else if(j.size>=IJ)j.delete(j.keys().next().value);return j.set(J,Q),J}function eJ(Q){let J=j.get(Q);if(J===void 0)return;return j.delete(Q),j.set(Q,J),J}async function TJ(Q){if(!H)return null;try{let J=Bun.file(O.join(H,`cw-${k(Q)}.css`));if(!await J.exists())return null;return await J.text()}catch{return null}}async function BJ(Q,J){if(!H)return;try{if(!fs.existsSync(H))fs.mkdirSync(H,{recursive:!0});await Bun.write(O.join(H,`cw-${k(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}function KJ(){let Q=[],J=process.cwd();while(J!==O.dirname(J))Q.push(O.join(J,"node_modules","@cwcss","crosswind","dist","index.js")),Q.push(O.join(J,"node_modules","@cwcss","crosswind","src","index.ts")),Q.push(O.join(J,"pantry","@cwcss","crosswind","dist","index.js")),Q.push(O.join(J,"pantry","@cwcss","crosswind","src","index.ts")),Q.push(O.join(J,"node_modules","@stacksjs","crosswind","dist","index.js")),Q.push(O.join(J,"pantry","@stacksjs","crosswind","dist","index.js")),J=O.dirname(J);return Q}function RJ(){let Q=[],J=process.env.HOME||process.env.USERPROFILE||"";if(J){let Y=[O.join(J,"Code","Tools","crosswind","packages","crosswind","dist","index.js"),O.join(J,"Code","Tools","crosswind","packages","crosswind","src","index.ts"),O.join(J,"repos","stacks-org","crosswind","packages","crosswind","dist","index.js"),O.join(J,"repos","stacks-org","crosswind","packages","crosswind","src","index.ts"),O.join(J,"Code","Tools","stx","packages","stx","node_modules","@cwcss","crosswind","dist","index.js"),O.join(J,"Code","Tools","stx","packages","stx","node_modules","@stacksjs","crosswind","dist","index.js")];Q.push(...Y)}return Q.push(O.join(process.cwd(),"..","crosswind","packages","crosswind","dist","index.js")),Q.push(O.join(process.cwd(),"..","crosswind","packages","crosswind","src","index.ts")),Q}async function XJ(){if(n)return L;n=!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(`${F.green}[Crosswind]${F.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 Crosswind module: ${Z}`);return L=q,L}let J=await Q(KJ());if(J)return L=J,L;let Y=["@cwcss/crosswind","@cwcss/crosswind/dist/index.js","@stacksjs/crosswind","@stacksjs/crosswind/dist/index.js"];for(let Z of Y){let q=await GJ(Z);if(q){if(L=q,!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} CSS engine loaded`);return L}}let $=await Q(RJ());if($)return L=$,L;throw Error("Crosswind CSSGenerator not found in any location")}catch{return console.warn(`${F.yellow}[Crosswind] CSS engine not available, Tailwind styles will not be generated${F.reset}`),console.warn(`${F.yellow}Run 'bun add @stacksjs/crosswind' to enable CSS generation${F.reset}`),null}}function JQ(){x.clear(),z.clear(),j.clear()}function QQ(){x.clear(),L=null,n=!1,I=null,M="",z.clear(),j.clear(),w=null}async function VJ(Q){try{if(!AJ({name:"crosswind",cwd:Q}))return null;let{loadConfigWithResult:J}=await import("bunfig"),Y=await J({name:"crosswind",cwd:Q,defaultConfig:{},checkEnv:!1,verbose:!1});if(!Y?.path||!Y.config||Object.keys(Y.config).length===0)return null;let $=O.relative(Q,Y.path);if(!process.env.STACKS_DEV_QUIET)console.log(`${F.green}[Crosswind]${F.reset} Loaded config from ${$||Y.path}`);return Y.config}catch(J){if(J instanceof Error&&J.name==="ConfigNotFoundError")return null;return console.warn(`${F.yellow}[Crosswind]${F.reset} Failed to load crosswind config:`,J instanceof Error?J.message:J),null}}async function PJ(Q){let J=null;try{let{loadStxConfig:Y}=await import("./chunk-k5c19t7e.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(`${F.green}[Crosswind]${F.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(`${F.green}[Crosswind]${F.reset} Using inline CSS config from stx.config.ts`)}}catch{}return J||await VJ(Q)}function EJ(Q){try{let J=new WeakSet;return k(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 DJ(Q){if(K)return M;K=!0;try{let J=await XJ();if(!J||!J.build)return K=!1,"";if(!I)I=await VJ(Q);if(!I)return K=!1,"";let Y=J.defaultConfig?.theme||{},$=I.theme||{},Z={...J.defaultConfig,...I,theme:{...Y,...$,extend:{...Y.extend||{},...$.extend||{}}}},q=performance.now(),U=await J.build(Z),W=performance.now()-q;if(M=U.css,console.log(`${F.cyan}[Crosswind]${F.reset} Built ${U.classes.size} classes in ${W.toFixed(1)}ms`),Z.output){let G=O.isAbsolute(Z.output)?Z.output:O.join(Q,Z.output),X=O.dirname(G);if(!fs.existsSync(X))fs.mkdirSync(X,{recursive:!0});await Bun.write(G,U.css)}return K=!1,U.css}catch(J){return console.error(`${F.red}[Crosswind]${F.reset} Build error:`,J),K=!1,M}}async function YQ(Q){I=null,await DJ(Q)}function $Q(){return M}function MJ(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 W of U)for(let G of W.slice(1,-1).split(/\s+/))if(G.trim())J.add(G.trim())}q=Z.exec(Q)}return J}var x=FJ(64);async function wJ(Q,J){let Y=x.get(i(Q,J,w));if(Y!==void 0)return Y;let $=await SJ(Q,J);if($)x.set(i(Q,J,w),$);return $}async function SJ(Q,J){try{let Y=await XJ();if(!Y)return"";let $=typeof Y.extractClasses==="function"?Y.extractClasses(Q):MJ(Q);if($.size===0)return"";let Z=J?O.resolve(J):process.cwd();if(!H)H=jJ(Z,"cache");let q=[...$].sort().join(" "),U=`${w||"default"}::${q}`,W=z.get(U);if(W!==void 0)return l(U,W),W;let G=await TJ(U);if(G!==null)return l(U,G),G;if(!I)I=await PJ(Z),w=EJ(I);let X=Y.defaultConfig||Y.config,V=I||{},A=ZJ(X,V),{safelist:T,includePreflight:R,minify:b,tokenCSS:LJ}=A,o=A.config,P=new Y.CSSGenerator(o);for(let N of T)P.generate(N);for(let N of $)P.generate(N);let _=P.toCSS(R,b),r=o.shortcuts||V.shortcuts||{};for(let[N,y]of Object.entries(r)){if(!$.has(N)&&!T.includes(N))continue;let f=y.split(/\s+/).filter(Boolean);for(let D of f)P.generate(D)}_=P.toCSS(R,b);let E=_.split(`
15
+ `);for(let[N,y]of Object.entries(r)){if(!$.has(N)&&!T.includes(N))continue;let f=y.split(/\s+/).filter(Boolean),D=[],C=[];for(let p of f){let a=p.startsWith("dark:"),s=`.${(a?p.slice(5):p).replace(/\//g,"\\/").replace(/:/g,"\\:").replace(/\./g,"\\.").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/%/g,"\\%")}`;for(let S=0;S<E.length;S++){let t=E[S].trim();if(t===`${s} {`||t.startsWith(`${s} {`)){let v=S,e="";while(v<E.length){if(e+=E[v],E[v].includes("}"))break;v++}let g=e.match(/\{([^}]+)\}/);if(g)if(a)C.push(g[1].trim());else D.push(g[1].trim());break}}}if(D.length)_+=`
16
+ .${N} { ${D.join(" ")} }`;if(C.length)_+=`
17
+ @media (prefers-color-scheme: dark) { .dark .${N} { ${C.join(" ")} } }`}return _=LJ+_,l(U,_),BJ(U,_),_}catch(Y){return console.warn("Failed to generate Crosswind CSS:",Y),""}}async function ZQ(Q,J,Y=!1){let $=await wJ(Q,J);if(!$)return Q;let Z=Y?`<link data-crosswind="generated" rel="stylesheet" href="/_stx/crosswind.${HJ($)}.css">`:`<style data-crosswind="generated">
18
+ ${$}
19
+ </style>`,q=/(?:<style\b[^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*>[\s\S]*?<\/style>|<link\b[^>]*\bdata-crosswind=(?:"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
+ </head>`);if(Q.includes("<body"))return Q.replace(/<body([^>]*)>/,`<body$1>
21
+ ${Z}`);return Z+Q}
22
+ export{c as Ls,CJ as Ms,gJ as Ns,FJ as Os,hJ as Ps,i as Qs,cJ as Rs,iJ as Ss,d as Ts,ZJ as Us,F as Vs,eJ as Ws,XJ as Xs,JQ as Ys,QQ as Zs,VJ as _s,PJ as $s,EJ as at,DJ as bt,YQ as ct,$Q as dt,MJ as et,wJ as ft,ZQ as gt};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Su as E}from"./chunk-0y6f4037.js";import G from"fs";import S from"path";var N=new Set([".jpg",".jpeg",".png",".webp",".avif"]),W=new Map,B=!1;function x(j){if(!j)return;let k=j.split("?")[0].split("#")[0];return W.get(k)}function n(){return B}function w(){W.clear(),B=!1}function y(j,k){W.set(j,k),B=!0}function I(j){let k=0,F=0,J=0,z=0;for(let q=0;q<j.length;q+=4)k+=j[q],F+=j[q+1],J+=j[q+2],z++;if(z===0)return"#e5e7eb";let H=(q)=>Math.round(q/z).toString(16).padStart(2,"0");return`#${H(k)}${H(F)}${H(J)}`}function U(j,k,F,J=4,z=3){let H=[];for(let q=0;q<z;q++)for(let Q=0;Q<J;Q++){let M=Math.floor(Q*k/J),Y=Math.max(M+1,Math.floor((Q+1)*k/J)),O=Math.floor(q*F/z),K=Math.max(O+1,Math.floor((q+1)*F/z)),T=0,L=0,V=0,X=0;for(let Z=O;Z<K;Z++)for(let _=M;_<Y;_++){let A=(Z*k+_)*4;T+=j[A],L+=j[A+1],V+=j[A+2],X++}let $=(Z)=>Math.round(Z/X).toString(16).padStart(2,"0");H.push(`<rect x="${Q}" y="${q}" width="1" height="1" fill="#${$(T)}${$(L)}${$(V)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${J} ${z}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${H.join("")}</g></svg>`}function C(j){return`data:image/svg+xml;base64,${Buffer.from(j,"utf8").toString("base64")}`}function D(j){try{return JSON.parse(G.readFileSync(j,"utf8"))}catch{return{}}}function v(j,k){try{G.mkdirSync(S.dirname(j),{recursive:!0}),G.writeFileSync(j,JSON.stringify(k))}catch{}}function R(j,k,F=[]){let J;try{J=G.readdirSync(j,{withFileTypes:!0})}catch{return F}for(let z of J){let H=S.join(j,z.name);if(z.isDirectory()){R(H,`${k}/${z.name}`,F);continue}if(!N.has(S.extname(z.name).toLowerCase()))continue;F.push([`${k}/${z.name}`,H])}return F}async function P(j,k={}){let{cachePath:F,maxBytes:J=33554432,limit:z=2000}=k;if(!j||!G.existsSync(j))return B=!0,W.size;let H;try{H=await import("ts-images")}catch{return B=!0,W.size}let q=F?D(F):{},Q=!1,M=R(j,"").slice(0,z),Y=8,O=async([K,T])=>{let L;try{L=G.statSync(T)}catch{return}if(L.size>J)return;let V=q[K];if(V&&V.mtimeMs===L.mtimeMs&&V.size===L.size){W.set(K,{dataUrl:V.dataUrl,color:V.color});return}try{let{hash:X}=await H.generateThumbHash(T);if(!X)return;let{rgba:$,w:Z,h:_}=H.thumbHashToRGBA(X),A={dataUrl:C(U($,Z,_)),color:I($)};W.set(K,A),q[K]={mtimeMs:L.mtimeMs,size:L.size,...A},Q=!0}catch{}};for(let K=0;K<M.length;K+=Y)await Promise.all(M.slice(K,K+Y).map(O));if(F&&Q)v(F,q);return B=!0,W.size}
3
- export{x as bt,n as ct,w as dt,y as et,U as ft,C as gt,P as ht};
2
+ import{Yu as E}from"./chunk-f8wjdg40.js";import G from"fs";import S from"path";var N=new Set([".jpg",".jpeg",".png",".webp",".avif"]),W=new Map,B=!1;function x(j){if(!j)return;let k=j.split("?")[0].split("#")[0];return W.get(k)}function n(){return B}function w(){W.clear(),B=!1}function y(j,k){W.set(j,k),B=!0}function I(j){let k=0,F=0,J=0,z=0;for(let q=0;q<j.length;q+=4)k+=j[q],F+=j[q+1],J+=j[q+2],z++;if(z===0)return"#e5e7eb";let H=(q)=>Math.round(q/z).toString(16).padStart(2,"0");return`#${H(k)}${H(F)}${H(J)}`}function U(j,k,F,J=4,z=3){let H=[];for(let q=0;q<z;q++)for(let Q=0;Q<J;Q++){let M=Math.floor(Q*k/J),Y=Math.max(M+1,Math.floor((Q+1)*k/J)),O=Math.floor(q*F/z),K=Math.max(O+1,Math.floor((q+1)*F/z)),T=0,L=0,V=0,X=0;for(let Z=O;Z<K;Z++)for(let _=M;_<Y;_++){let A=(Z*k+_)*4;T+=j[A],L+=j[A+1],V+=j[A+2],X++}let $=(Z)=>Math.round(Z/X).toString(16).padStart(2,"0");H.push(`<rect x="${Q}" y="${q}" width="1" height="1" fill="#${$(T)}${$(L)}${$(V)}"/>`)}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${J} ${z}" preserveAspectRatio="none"><filter id="b"><feGaussianBlur stdDeviation=".6"/></filter><g filter="url(#b)">${H.join("")}</g></svg>`}function C(j){return`data:image/svg+xml;base64,${Buffer.from(j,"utf8").toString("base64")}`}function D(j){try{return JSON.parse(G.readFileSync(j,"utf8"))}catch{return{}}}function v(j,k){try{G.mkdirSync(S.dirname(j),{recursive:!0}),G.writeFileSync(j,JSON.stringify(k))}catch{}}function R(j,k,F=[]){let J;try{J=G.readdirSync(j,{withFileTypes:!0})}catch{return F}for(let z of J){let H=S.join(j,z.name);if(z.isDirectory()){R(H,`${k}/${z.name}`,F);continue}if(!N.has(S.extname(z.name).toLowerCase()))continue;F.push([`${k}/${z.name}`,H])}return F}async function P(j,k={}){let{cachePath:F,maxBytes:J=33554432,limit:z=2000}=k;if(!j||!G.existsSync(j))return B=!0,W.size;let H;try{H=await import("ts-images")}catch{return B=!0,W.size}let q=F?D(F):{},Q=!1,M=R(j,"").slice(0,z),Y=8,O=async([K,T])=>{let L;try{L=G.statSync(T)}catch{return}if(L.size>J)return;let V=q[K];if(V&&V.mtimeMs===L.mtimeMs&&V.size===L.size){W.set(K,{dataUrl:V.dataUrl,color:V.color});return}try{let{hash:X}=await H.generateThumbHash(T);if(!X)return;let{rgba:$,w:Z,h:_}=H.thumbHashToRGBA(X),A={dataUrl:C(U($,Z,_)),color:I($)};W.set(K,A),q[K]={mtimeMs:L.mtimeMs,size:L.size,...A},Q=!0}catch{}};for(let K=0;K<M.length;K+=Y)await Promise.all(M.slice(K,K+Y).map(O));if(F&&Q)v(F,q);return B=!0,W.size}
3
+ export{x as ht,n as it,w as jt,y as kt,U as lt,C as mt,P as nt};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Nf as v,Of as i,Pf as t,Sf as e,Tf as HH,Uf as KH,Vf as QH,Wf as YH,Xf as ZH}from"./chunk-4zkv1vqh.js";import{Xi as s}from"./chunk-new80es4.js";import{Rl as a}from"./chunk-r7dd7c7y.js";import{mt as h}from"./chunk-dnhckx52.js";import{Ht as f}from"./chunk-5h5ydexj.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
2
+ import{Nf as v,Of as i,Pf as t,Sf as e,Tf as HH,Uf as KH,Vf as QH,Wf as YH,Xf as ZH}from"./chunk-6yphtg3q.js";import{Xi as s}from"./chunk-6g7m08rv.js";import{Ql as a}from"./chunk-mbvkvac6.js";import{st as h}from"./chunk-bby4emay.js";import{Nt as f}from"./chunk-sde45gh3.js";import{existsSync as $H,readFileSync as qH}from"fs";import J from"path";function GH(K,Q="",V=""){let L=K.startLine>1?`
3
3
  `.repeat(K.startLine-1):"",N=t(i(K.code)),X=K.kind==="client"||K.kind==="plain"?HH(Q,K.code):"";return QH(`${L+N}
4
4
  ${X}
5
5
  export {}
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{as as a,bs as b,cs as c,ds as d,es as e,fs as f}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ci as a,di as b,ei as c,fi as d,gi as e,hi as f}from"./chunk-wcm80anz.js";import"./chunk-0y6f4037.js";export{c as processTransitionDirectives,f as processTransitionAttributes,b as performLeave,a as performEnter,e as generateTransitionRuntime,d as generateTransitionCSS};
2
+ import{ci as a,di as b,ei as c,fi as d,gi as e,hi as f}from"./chunk-wcm80anz.js";import"./chunk-f8wjdg40.js";export{c as processTransitionDirectives,f as processTransitionAttributes,b as performLeave,a as performEnter,e as generateTransitionRuntime,d as generateTransitionCSS};
@@ -299,4 +299,4 @@ catch (error) {
299
299
  }
300
300
  })();
301
301
  </script>`}var N={name:"pwa.installButton",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return H(j,q)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Q={name:"pwa.updatePrompt",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return J(j,q)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},T={name:"pwa.offlineIndicator",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return L(j,q)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},V={name:"pwa.pushSubscribe",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return M(j,q)},hasEndTag:!0,description:"Renders a push notification subscription button"},X=[N,Q,T,V];function Z(j){return[...j,...X]}
302
- export{N as Ju,Q as Ku,T as Lu,V as Mu,X as Nu,Z as Ou};
302
+ export{N as Pu,Q as Qu,T as Ru,V as Su,X as Tu,Z as Uu};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Zo as b,_o as c,dm as a}from"./chunk-mbvkvac6.js";import"./chunk-0athjw48.js";import"./chunk-135mme4g.js";import"./chunk-f3m0q482.js";import"./chunk-f1jd5qjb.js";import"./chunk-jb7h4qgh.js";import"./chunk-jnbhyzkv.js";import"./chunk-bby4emay.js";import"./chunk-52wr95ps.js";import"./chunk-j24k071e.js";import"./chunk-sde45gh3.js";import"./chunk-5wkwhjjn.js";import"./chunk-krgth3gf.js";import"./chunk-f8wjdg40.js";export{b as processESImports,c as processComponents,a as freeIdentifiers};