@stacksjs/stx 0.2.340 → 0.2.342

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 (177) hide show
  1. package/README.md +1 -1
  2. package/dist/browser-core-imports.js +0 -1
  3. package/dist/build-views.js +12 -1
  4. package/dist/caching.d.ts +4 -0
  5. package/dist/caching.js +34 -0
  6. package/dist/{chunk-hrdd26r4.js → chunk-01ggk8k8.js} +1 -1
  7. package/dist/chunk-025z2btp.js +2 -0
  8. package/dist/{chunk-x4vhn880.js → chunk-0sq5mdrh.js} +1 -1
  9. package/dist/chunk-19fp0z9s.js +2 -0
  10. package/dist/{chunk-d3kjaae0.js → chunk-1gwbw81h.js} +1 -1
  11. package/dist/{chunk-vaggjvsm.js → chunk-1spzqjve.js} +1 -1
  12. package/dist/{chunk-t00ga194.js → chunk-1t3j8a0q.js} +1 -1
  13. package/dist/{chunk-shtg7kah.js → chunk-1xwfws06.js} +2 -2
  14. package/dist/{chunk-x48crnwa.js → chunk-23sv24cm.js} +1 -1
  15. package/dist/{chunk-7r79j1hs.js → chunk-25b8z7xa.js} +1 -1
  16. package/dist/{chunk-hq9fa4pe.js → chunk-25f0s8t1.js} +2 -2
  17. package/dist/chunk-2p68bkza.js +2 -0
  18. package/dist/{chunk-r10fypcd.js → chunk-2swnc8kg.js} +1 -1
  19. package/dist/chunk-3b0mgxbk.js +2 -0
  20. package/dist/{chunk-nvp546bb.js → chunk-48x5bsqv.js} +1 -1
  21. package/dist/{chunk-fx07kyz7.js → chunk-4ecv1e3w.js} +1 -1
  22. package/dist/{chunk-ppp84wry.js → chunk-4vcyf1kh.js} +2 -2
  23. package/dist/{chunk-r5kr6jk4.js → chunk-4wpxbkbe.js} +2 -2
  24. package/dist/{chunk-p7ntrtaj.js → chunk-567g1ttv.js} +1 -1
  25. package/dist/{chunk-7a21q2q4.js → chunk-5g9vbhbt.js} +1 -1
  26. package/dist/chunk-5grrqaqs.js +2 -0
  27. package/dist/chunk-6jx4r94x.js +2 -0
  28. package/dist/{chunk-0xgc5t3y.js → chunk-6nvm939g.js} +1 -1
  29. package/dist/{chunk-tr1174hz.js → chunk-6nxq8rcw.js} +1 -1
  30. package/dist/{chunk-7r80apc5.js → chunk-6p6b01kp.js} +1 -1
  31. package/dist/{chunk-xe6zmdfq.js → chunk-74r1zw2h.js} +1 -1
  32. package/dist/{chunk-97ej3abh.js → chunk-8tsr51hj.js} +1 -1
  33. package/dist/chunk-a1rt1fms.js +2 -0
  34. package/dist/{chunk-aved735s.js → chunk-ahpmjg3f.js} +2 -2
  35. package/dist/chunk-akp89n3w.js +2 -0
  36. package/dist/{chunk-b4cabzk9.js → chunk-anf2y2h5.js} +1 -1
  37. package/dist/{chunk-d6yyzpsv.js → chunk-beextc84.js} +53 -20
  38. package/dist/chunk-bqhrryqs.js +2 -0
  39. package/dist/{chunk-799s9mwc.js → chunk-bt8w146r.js} +2 -2
  40. package/dist/{chunk-fa2mg49t.js → chunk-byjy9far.js} +2 -2
  41. package/dist/{chunk-axqfm9b4.js → chunk-c0n802j1.js} +1 -1
  42. package/dist/{chunk-vxt5c5aq.js → chunk-c33y19bn.js} +1 -1
  43. package/dist/{chunk-2gc4cevb.js → chunk-c73pyeak.js} +1 -1
  44. package/dist/{chunk-6av24ywm.js → chunk-cqw3c1xg.js} +1 -1
  45. package/dist/chunk-czvzaa42.js +3 -0
  46. package/dist/{chunk-yxpr7h26.js → chunk-d389vyyz.js} +2 -2
  47. package/dist/chunk-da0tfpa2.js +2 -0
  48. package/dist/chunk-de2cfcf5.js +2 -0
  49. package/dist/{chunk-756dqqn1.js → chunk-drs93sry.js} +1 -1
  50. package/dist/{chunk-t8ctvjqe.js → chunk-e0kzyf1g.js} +1 -1
  51. package/dist/{chunk-3b9sxnty.js → chunk-ebd3z4j9.js} +1 -1
  52. package/dist/{chunk-rkykwy3z.js → chunk-evtrctj9.js} +1 -1
  53. package/dist/chunk-exhbc57n.js +2 -0
  54. package/dist/{chunk-q9ckfwhh.js → chunk-f2qbjr3z.js} +1 -1
  55. package/dist/{chunk-xy4jt4ek.js → chunk-f5cw54q3.js} +1 -1
  56. package/dist/chunk-fhhp6pmx.js +2 -0
  57. package/dist/{chunk-yne23w3c.js → chunk-fm5211ec.js} +1 -1
  58. package/dist/chunk-fqsrft0a.js +2 -0
  59. package/dist/{chunk-mjf3xmxn.js → chunk-fvsefztj.js} +1 -1
  60. package/dist/{chunk-m46edxtt.js → chunk-fx29n4vc.js} +1 -1
  61. package/dist/{chunk-f476c9fb.js → chunk-gbkq5qnw.js} +3 -3
  62. package/dist/{chunk-6zsc0z5a.js → chunk-ghd80w8a.js} +3 -3
  63. package/dist/{chunk-7xjm1zqa.js → chunk-gkq323fg.js} +1 -1
  64. package/dist/chunk-gqzccw30.js +2 -0
  65. package/dist/{chunk-5ggt2ryn.js → chunk-gwc54hjc.js} +2 -2
  66. package/dist/chunk-h47e1c03.js +2 -0
  67. package/dist/{chunk-ay336sqb.js → chunk-hk8j3eps.js} +1 -1
  68. package/dist/{chunk-86v2rps7.js → chunk-hnffkdzc.js} +1 -1
  69. package/dist/{chunk-mb7rn0bf.js → chunk-hrmxxs0w.js} +1 -1
  70. package/dist/{chunk-d964bsxm.js → chunk-j82hfkcf.js} +280 -280
  71. package/dist/chunk-jcbj3xp4.js +2 -0
  72. package/dist/{chunk-h0y4mb2m.js → chunk-k3w3gwm3.js} +1 -1
  73. package/dist/{chunk-jx03a693.js → chunk-k5b9471y.js} +1 -1
  74. package/dist/{chunk-apa2v787.js → chunk-k9ep24bd.js} +1 -1
  75. package/dist/chunk-kbemcvp1.js +2 -0
  76. package/dist/chunk-ks4j8fjz.js +2 -0
  77. package/dist/{chunk-zj039s33.js → chunk-kznb3hdj.js} +1 -1
  78. package/dist/{chunk-m11pb9cx.js → chunk-m39hb2a2.js} +1 -1
  79. package/dist/chunk-mbstfjnj.js +2 -0
  80. package/dist/{chunk-95e1m9p8.js → chunk-mkgbrbr9.js} +1 -1
  81. package/dist/{chunk-dekxwgc2.js → chunk-mznr9nyp.js} +1 -1
  82. package/dist/{chunk-284ag6fs.js → chunk-ntm1761b.js} +130 -130
  83. package/dist/{chunk-5qsg9q46.js → chunk-p52cm7ch.js} +1 -1
  84. package/dist/{chunk-5g6rprcy.js → chunk-p5d8sb50.js} +1 -1
  85. package/dist/chunk-pbct6nxk.js +2 -0
  86. package/dist/chunk-peerbcwj.js +2 -0
  87. package/dist/chunk-pt1w6vq2.js +2 -0
  88. package/dist/{chunk-kdhrk7x5.js → chunk-q4cemvkw.js} +1 -1
  89. package/dist/{chunk-k3dtvay1.js → chunk-r1rfwm01.js} +1 -1
  90. package/dist/{chunk-q0srntf6.js → chunk-r46cg4qa.js} +1 -1
  91. package/dist/{chunk-22hch2me.js → chunk-reskzmsb.js} +1 -1
  92. package/dist/chunk-rgda0gwf.js +2 -0
  93. package/dist/{chunk-d7zxg9bp.js → chunk-rh7mwwb4.js} +2 -2
  94. package/dist/{chunk-pxw0cpxe.js → chunk-rr49zrz6.js} +1 -1
  95. package/dist/chunk-rwa10jm4.js +2 -0
  96. package/dist/{chunk-w72v0ab1.js → chunk-s4mmmwj4.js} +1 -1
  97. package/dist/{chunk-zg2hvb1j.js → chunk-saqbtgqr.js} +21 -2
  98. package/dist/chunk-snsh9ye4.js +2 -0
  99. package/dist/{chunk-a26hcag1.js → chunk-sytwy0mg.js} +1 -1
  100. package/dist/chunk-td39mtts.js +2 -0
  101. package/dist/{chunk-tr41gn5j.js → chunk-thrv2nbz.js} +1 -1
  102. package/dist/{chunk-066yt1hy.js → chunk-tmj45xq5.js} +1 -1
  103. package/dist/chunk-trncnwem.js +2 -0
  104. package/dist/{chunk-y8vj3rtt.js → chunk-ts3wfjh9.js} +1 -1
  105. package/dist/chunk-vk2j3vvs.js +2 -0
  106. package/dist/chunk-vph6zpeq.js +2 -0
  107. package/dist/chunk-wa3ks5zv.js +2 -0
  108. package/dist/chunk-wv8h3d68.js +3 -0
  109. package/dist/{chunk-28q3vycz.js → chunk-wvc7t11n.js} +1 -1
  110. package/dist/{chunk-2tjk867y.js → chunk-x7dv5rq7.js} +1 -1
  111. package/dist/{chunk-3agx4hyd.js → chunk-xe93ae3r.js} +3 -3
  112. package/dist/{chunk-mys0rat0.js → chunk-xec226zb.js} +1 -1
  113. package/dist/chunk-xer5kn26.js +2 -0
  114. package/dist/{chunk-tr9ynxdw.js → chunk-y956wapy.js} +1 -1
  115. package/dist/{chunk-stbns4bg.js → chunk-yhvrq2qd.js} +1 -1
  116. package/dist/{chunk-eq2j7w8p.js → chunk-yq7fc8sa.js} +1 -1
  117. package/dist/{chunk-wb90259a.js → chunk-yr7camcd.js} +1 -1
  118. package/dist/{chunk-8de19dmw.js → chunk-ys56ecvx.js} +1 -1
  119. package/dist/{chunk-5t8ersrw.js → chunk-ytx17bg2.js} +1 -1
  120. package/dist/{chunk-64qg8jes.js → chunk-yzv702kk.js} +2 -2
  121. package/dist/chunk-zv4gb3wb.js +2 -0
  122. package/dist/{chunk-6nde3nmc.js → chunk-zv4nf0x2.js} +1 -1
  123. package/dist/chunk-zx2krbqf.js +2 -0
  124. package/dist/cli.js +14 -14
  125. package/dist/client-script.js +2 -2
  126. package/dist/craft-entry.js +1 -1
  127. package/dist/craft.js +1 -1
  128. package/dist/database.js +1 -1
  129. package/dist/events.d.ts +14 -0
  130. package/dist/events.js +12 -1
  131. package/dist/hydration.d.ts +0 -39
  132. package/dist/hydration.js +7 -1
  133. package/dist/process.js +4 -0
  134. package/dist/pwa.js +2 -2
  135. package/dist/runtime-globals.js +1 -0
  136. package/dist/signals.js +20 -1
  137. package/dist/ssg.js +2 -2
  138. package/dist/stx.d.ts +4 -0
  139. package/dist/visual-testing.js +1 -1
  140. package/package.json +5 -5
  141. package/stx.d.ts +4 -0
  142. package/dist/chunk-0pje0pjq.js +0 -2
  143. package/dist/chunk-1w8bpytb.js +0 -2
  144. package/dist/chunk-58j32d7n.js +0 -2
  145. package/dist/chunk-605955nh.js +0 -2
  146. package/dist/chunk-6es5r4az.js +0 -3
  147. package/dist/chunk-6j6ek3j1.js +0 -2
  148. package/dist/chunk-82h5rp34.js +0 -2
  149. package/dist/chunk-9pv7gcey.js +0 -2
  150. package/dist/chunk-a2mj88c6.js +0 -2
  151. package/dist/chunk-b3pn6dh5.js +0 -2
  152. package/dist/chunk-cjcj2gsq.js +0 -2
  153. package/dist/chunk-deqnt1w5.js +0 -3
  154. package/dist/chunk-dy9xs2q0.js +0 -2
  155. package/dist/chunk-eb1v7f55.js +0 -2
  156. package/dist/chunk-fx5m9d3t.js +0 -2
  157. package/dist/chunk-g0059g3p.js +0 -2
  158. package/dist/chunk-gf6t4419.js +0 -2
  159. package/dist/chunk-h7hnzwd0.js +0 -2
  160. package/dist/chunk-hkgnpf6v.js +0 -2
  161. package/dist/chunk-hvw4mwee.js +0 -2
  162. package/dist/chunk-jwa2jhd8.js +0 -2
  163. package/dist/chunk-kwxcertb.js +0 -2
  164. package/dist/chunk-nwz43t6d.js +0 -2
  165. package/dist/chunk-p1cddybx.js +0 -2
  166. package/dist/chunk-rceawm7w.js +0 -2
  167. package/dist/chunk-t3mh10z3.js +0 -2
  168. package/dist/chunk-vhzc08aa.js +0 -2
  169. package/dist/chunk-vz0ebk4j.js +0 -2
  170. package/dist/chunk-wjcrcbd1.js +0 -2
  171. package/dist/chunk-x80ahcnw.js +0 -2
  172. package/dist/chunk-x81z8m6a.js +0 -2
  173. package/dist/chunk-y07fna67.js +0 -2
  174. package/dist/chunk-yz0d60px.js +0 -2
  175. package/dist/chunk-z19pk2pn.js +0 -2
  176. package/dist/chunk-z7vb3mgn.js +0 -2
  177. package/dist/chunk-zzfpwxpp.js +0 -2
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Bh as a,Ch as b,Dh as c,Eh as d,Fh as e,Gh as f,Hh as g}from"./chunk-7r9vgzg4.js";import"./chunk-5g6rprcy.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
2
+ import{Bh as a,Ch as b,Dh as c,Eh as d,Fh as e,Gh as f,Hh as g}from"./chunk-7r9vgzg4.js";import"./chunk-p5d8sb50.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
@@ -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 kw,Q as lw,T as mw,V as nw,X as ow,Z as pw};
302
+ export{N as ow,Q as pw,T as qw,V as rw,X as sw,Z as tw};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ji as O,Ki as w,Li as Z}from"./chunk-7we3xfde.js";import{Xk as R,cl as U,il as T}from"./chunk-r5kr6jk4.js";import{Yl as M,aq as k,rr as C,yo as W}from"./chunk-d964bsxm.js";import{bv as E,cv as L}from"./chunk-2tjk867y.js";import{gv as B}from"./chunk-deqnt1w5.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
2
+ import{Ji as O,Ki as w,Li as Z}from"./chunk-7we3xfde.js";import{Zk as R,el as U,kl as T}from"./chunk-4wpxbkbe.js";import{Co as W,am as M,eq as k,vr as C}from"./chunk-j82hfkcf.js";import{fv as E,gv as L}from"./chunk-x7dv5rq7.js";import{kv as B}from"./chunk-wv8h3d68.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
3
3
  ${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
4
4
 
5
5
  `),x=`;(function(){
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ho as R,Jp as H,kq as x,pr as g,wm as O}from"./chunk-d964bsxm.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
2
+ import{Am as O,Lo as R,Np as H,oq as x,tr as g}from"./chunk-j82hfkcf.js";import b from"path";var v={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},M=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var T=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function f(q){let B=[],Q=0,G;T.lastIndex=0;while((G=T.exec(q))!==null){if(G.index>Q){let X=q.slice(Q,G.index);if(X.trim())B.push({type:B.length===0?"shell":"content",content:X})}let J=G[1],K=G[2];B.push({type:"suspense",name:J,content:K}),Q=G.index+G[0].length}if(Q<q.length){let J=q.slice(Q);if(J.trim())B.push({type:B.length===0?"shell":"content",content:J})}if(B.length===0)B.push({type:"shell",content:q});return B}async function r(q,B={},Q={}){let G={...g,...Q,streaming:{...v,...Q.streaming}},J=G.streaming?.bufferSize||16384;return new ReadableStream({async start(K){try{let X=await Bun.file(q).text(),z=X.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),L=z?z[1]:"",Y=X.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),j={...B,__filename:q,__dirname:b.dirname(q)};if(L.trim())await R(L,j,q);let D=f(Y),$=new Set;if(!D.some((w)=>w.type==="suspense")){let w=G.streaming?.strategy||"auto",U=new RegExp(M.source,"g");if(!(w!=="manual"&&U.test(Y))){let F=await H(Y,j,q,G,$);for(let V=0;V<F.length;V+=J)K.enqueue(F.slice(V,V+J)),await new Promise((W)=>setTimeout(W,0))}else{let F=[],V=new RegExp(M.source,"g"),W;while((W=V.exec(Y))!==null)F.push({name:W[1],content:W[2],start:W.index,end:W.index+W[0].length});let y=0;for(let A of F){if(A.start>y){let k=Y.slice(y,A.start);if(k.trim()){let E=await H(k,j,q,G,$);K.enqueue(E),await new Promise((S)=>setTimeout(S,0))}}let I=await H(A.content,j,q,G,$);K.enqueue(I),await new Promise((k)=>setTimeout(k,0)),y=A.end}if(y<Y.length){let A=Y.slice(y);if(A.trim()){let I=await H(A,j,q,G,$);K.enqueue(I)}}}}else{let w=new Map;for(let Z of D)if(Z.type==="shell"||Z.type==="content"){let F=await H(Z.content,j,q,G,$);K.enqueue(F)}else if(Z.type==="suspense"&&Z.name){let F=`stx-suspense-${Z.name}`;K.enqueue(`<div id="${F}" data-suspense="${Z.name}" style="display:contents;">
3
3
  <template data-suspense-fallback>Loading...</template>
4
4
  </div>`),w.set(Z.name,H(Z.content,j,q,G,$))}K.enqueue(`
5
5
  <script>
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{qw as W,rw as k,sw as G}from"./chunk-5g6rprcy.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
2
+ import{uw as W,vw as k,ww as G}from"./chunk-p5d8sb50.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
3
3
  ${j.entries.map((K)=>` { url: '${K.url}', revision: '${K.revision}' }`).join(`,
4
4
  `)}
5
5
  ]`}function E(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var l;var F=G(()=>{l={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});function g(j){let q={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return q[j]||q["network-first"]}function R(j){return g(j).className}function M(j){let q=j.pwa;if(!q?.enabled)return"";let K=q.routes||[],Q=q.cacheStorage,Y=[];for(let X of K){let Z=R(X.strategy),O=[];if(X.maxAgeSeconds||X.maxEntries||Q?.maxEntries){let $=X.maxEntries||Q?.maxEntries||100,L=X.maxAgeSeconds||(Q?.maxAge?Q.maxAge*24*60*60:void 0);O.push(`new ExpirationPlugin({
@@ -1191,4 +1191,4 @@ if ('serviceWorker' in navigator) {
1191
1191
  });
1192
1192
  }
1193
1193
  </script>`}function Vj(){return'<link rel="manifest" href="/manifest.json">'}function Aj(j){return`<meta name="theme-color" content="${N(j)}">`}function N(j){return j.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}
1194
- export{U as Ik,J as Jk,E as Kk,F as Lk,w as Mk,z as Nk,y as Ok,qj as Pk,H as Qk,I as Rk,Lj as Sk,Uj as Tk,Vj as Uk,Aj as Vk};
1194
+ export{U as Kk,J as Lk,E as Mk,F as Nk,w as Ok,z as Pk,y as Qk,qj as Rk,H as Sk,I as Tk,Lj as Uk,Uj as Vk,Vj as Wk,Aj as Xk};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{$ as dm,$a as go,$b as qp,$c as qq,$d as qr,A as Pk,Aa as rn,Ab as Lo,Ac as Rp,Ad as Rq,Ae as Xr,B as Qk,Ba as sn,Bb as Mo,Bc as Sp,Bd as Sq,Be as Yr,C as Rk,Ca as Fn,Cb as No,Cc as Tp,Cd as Tq,Ce as Zr,D as Sk,Da as Gn,Db as Oo,Dc as Up,Dd as Uq,De as _r,E as Il,Ea as Hn,Eb as Po,Ec as Vp,Ed as Vq,Ee as $r,F as Jl,Fa as In,Fb as Qo,Fc as Wp,Fd as Wq,Fe as as,G as Kl,Ga as Jn,Gb as Ro,Gc as Xp,Gd as Xq,Ge as bs,H as Ll,Ha as Kn,Hb as So,Hc as Yp,Hd as Yq,He as cs,I as Ml,Ia as On,Ib as To,Ic as Zp,Id as Zq,Ie as ds,J as Nl,Ja as Pn,Jb as Uo,Jc as _p,Jd as _q,Je as es,K as Ol,Ka as Qn,Kb as Vo,Kc as $p,Kd as $q,Ke as fs,L as Pl,La as Rn,Lb as Wo,Lc as aq,Ld as ar,M as Ql,Ma as Sn,Mb as Xo,Mc as bq,Md as br,N as Rl,Na as Tn,Nb as cp,Nc as cq,Nd as cr,O as Sl,Oa as Un,Ob as dp,Oc as dq,Od as dr,P as Tl,Pa as Vn,Pb as ep,Pc as eq,Pd as er,Q as Ul,Qa as Wn,Qb as fp,Qc as fq,Qd as fr,R as Vl,Ra as Xn,Rb as gp,Rc as gq,Rd as gr,S as Wl,Sa as Yn,Sb as hp,Sc as hq,Sd as hr,T as Xl,Ta as Zn,Tb as ip,Tc as iq,Td as ir,U as Yl,Ua as _n,Ub as jp,Uc as jq,Ud as jr,V as Zl,Va as $n,Vb as kp,Vc as kq,Vd as kr,W as _l,Wa as ao,Wb as lp,Wc as lq,Wd as lr,X as $l,Xa as bo,Xb as mp,Xc as mq,Xd as mr,Y as am,Ya as co,Yb as np,Yc as nq,Yd as nr,Z as bm,Za as eo,Zb as op,Zc as oq,Zd as or,_ as cm,_a as fo,_b as pp,_c as pq,_d as pr,aa as em,ab as ho,ac as rp,ad as rq,ae as rr,ba as fm,bb as io,bc as sp,bd as sq,be as yr,ca as gm,cb as jo,cc as tp,cd as tq,ce as zr,da as hm,db as ko,dc as up,dd as uq,de as Ar,ea as im,eb as lo,ec as vp,ed as vq,ee as Br,fa as jm,fb as mo,fc as wp,fd as wq,fe as Cr,ga as km,gb as no,gc as xp,gd as xq,ge as Dr,ha as lm,hb as oo,hc as yp,hd as yq,he as Er,ia as mm,ib as po,ic as zp,id as zq,ie as Fr,ja as nm,jb as qo,jc as Ap,jd as Aq,je as Gr,ka as om,kb as ro,kc as Bp,kd as Bq,ke as Hr,la as pm,lb as so,lc as Cp,ld as Cq,le as Ir,ma as qm,mb as to,mc as Dp,md as Dq,me as Jr,na as rm,nb as wo,nc as Ep,nd as Eq,ne as Kr,o as a,oa as sm,ob as xo,oc as Fp,od as Fq,oe as Lr,p as Ak,pa as fn,pb as yo,pc as Gp,pd as Gq,pe as Mr,q as Bk,qa as gn,qb as zo,qc as Hp,qd as Hq,qe as Nr,r as Ck,ra as hn,rb as Bo,rc as Ip,rd as Iq,re as Or,s as Dk,sa as jn,sb as Co,sc as Jp,sd as Jq,se as Pr,t as Ek,ta as kn,tb as Do,tc as Kp,td as Kq,te as Qr,u as Fk,ua as ln,ub as Eo,uc as Lp,ud as Lq,ue as Rr,v as Gk,va as mn,vb as Go,vc as Mp,vd as Mq,ve as Sr,w as Hk,wa as nn,wb as Ho,wc as Np,wd as Nq,we as Tr,x as Ik,xa as on,xb as Io,xc as Op,xd as Oq,xe as Ur,y as Nk,ya as pn,yb as Jo,yc as Pp,yd as Pq,ye as Vr,z as Ok,za as qn,zb as Ko,zc as Qp,zd as Qq,ze as Wr}from"./chunk-ntm1761b.js";import{Le as Yo,Me as Zo,Ne as _o,Oe as $o,Pe as ap,Qe as bp}from"./chunk-drs93sry.js";import{Re as uo,Se as vo}from"./chunk-2ver2s2y.js";import{Te as Ao}from"./chunk-ebd3z4j9.js";import{Ue as en}from"./chunk-k9ep24bd.js";import{Ve as Ln,We as Mn,Xe as Nn,Ye as Fo}from"./chunk-567g1ttv.js";import{$e as Vk,Ze as Tk,_e as Uk,af as Wk,bf as Xk,cf as Yk,df as Zk,ef as _k,ff as $k,gf as al,hf as bl,if as cl,jf as dl,kf as el,lf as fl}from"./chunk-ym3r8ktq.js";import{mf as wl,nf as xl,of as yl,pf as zl,qf as Al,rf as Bl,sf as Cl,tf as Dl,uf as El,vf as Fl,wf as Gl,xf as Hl}from"./chunk-y956wapy.js";import{yf as ul,zf as vl}from"./chunk-m39hb2a2.js";import{Af as gl,Bf as hl,Cf as il,Df as jl,Ef as kl,Ff as ll,Gf as ml,If as nl,Jf as ol,Kf as pl,Lf as ql,Mf as rl,Nf as sl,Qf as tl}from"./chunk-74r1zw2h.js";import{Rf as Pm,Sf as Qm,Tf as Rm,Uf as Sm,Vf as Tm,Wf as dn}from"./chunk-4ecv1e3w.js";import{$f as xm,Xf as tm,Yf as um,Zf as vm,_f as wm,ag as ym,bg as zm,cg as Am,dg as Bm,eg as Cm,fg as Dm,gg as Em,hg as Fm,ig as Gm,jg as Hm,kg as Im,lg as Um,mg as Vm,ng as Wm,og as Xm,pg as Ym,qg as Zm,rg as _m,sg as $m,tg as an,ug as bn,vg as cn}from"./chunk-4vcyf1kh.js";import{wg as Jm,xg as Km}from"./chunk-57atgbyq.js";import{Ag as vn,Bg as wn,Cg as xn,Dg as yn,Eg as zn,Fg as An,Gg as Bn,Hg as Cn,Ig as Dn,Jg as En,yg as tn,zg as un}from"./chunk-8bxtvsgm.js";import{Kg as ki,Lg as li,Mg as mi,Ng as ni,Og as oi,Pg as pi}from"./chunk-mkgbrbr9.js";import{Qg as Ej,Rg as Fj,Sg as Gj,Wg as Hj,Xg as Ij,Yg as Jj}from"./chunk-fm5211ec.js";import{$g as Rj,Zg as Pj,_g as Qj,ah as Sj,bh as Tj,ch as Uj,dh as Vj,eh as Wj,fh as Xj,gh as Yj,hh as Zj}from"./chunk-s4mmmwj4.js";import{ih as uj,jh as vj,kh as wj,lh as xj,mh as yj,oh as zj,ph as Aj,qh as Bj,rh as Cj,sh as Dj}from"./chunk-18018jkn.js";import{th as pk,vh as qk}from"./chunk-sqvqwd0p.js";import{Bh as Fh,Ch as Gh,Dh as Hh,Eh as Ih,Fh as Jh,Gh as Kh}from"./chunk-7r9vgzg4.js";import{Ih as Lh,Jh as Mh,Kh as Nh,Lh as Oh,Mh as Ph,Nh as Qh,Oh as Rh,Ph as Sh,Qh as Th,Rh as Uh,Sh as Vh,Th as Wh,Uh as Xh,Vh as Yh}from"./chunk-a959m68j.js";import{Xh as Zh,Yh as _h,Zh as $h,_h as ai}from"./chunk-1vb2rj09.js";import{di as bi}from"./chunk-g6czgcg4.js";import{gi as eh}from"./chunk-zv4nf0x2.js";import{hi as fh}from"./chunk-1z1efvtw.js";import{ii as gh,ji as hh}from"./chunk-vgfd9582.js";import{ki as ih,li as jh,mi as kh,ni as lh,oi as mh,pi as nh}from"./chunk-qsbjtp60.js";import{qi as oh,ri as ph,si as qh,ti as rh,ui as sh}from"./chunk-nf7k53ap.js";import{vi as th,wi as uh,xi as vh,yi as wh,zi as xh}from"./chunk-zk6ghjnj.js";import{Ai as yh,Bi as zh,Ci as Ah,Di as Bh,Ei as Ch,Fi as Dh,Gi as Eh}from"./chunk-bgrkxzr7.js";import{Hi as ch,Ii as dh}from"./chunk-ys56ecvx.js";import"./chunk-7we3xfde.js";import{Mi as Je,Ni as Ke,Oi as Le,Pi as Me,Qi as Ne,Ri as Oe,Si as Pe,Ti as Qe,Ui as Re,Vi as Se,Wi as Te,Xi as Ue,Yi as Ve,Zi as We}from"./chunk-ytx17bg2.js";import{$i as nf,_i as mf,aj as of,bj as pf,cj as qf,dj as rf,ej as sf,fj as tf,gj as uf,hj as vf,ij as wf,jj as xf,kj as yf,lj as zf,mj as Af,nj as Bf,oj as Cf}from"./chunk-saqbtgqr.js";import{Aj as cf,Bj as df,Cj as ef,Dj as ff,Ej as gf,Fj as hf,Gj as jf,Hj as kf,Ij as lf,vj as Ze,wj as _e,xj as $e,yj as af,zj as bf}from"./chunk-e4g8wz6t.js";import{Jj as Df,Kj as Ef,Lj as Ff,Mj as Gf,Nj as Hf,Oj as If,Pj as Jf,Qj as Kf,Rj as Lf,Sj as Mf,Tj as Nf,Uj as Of,Vj as Pf,Wj as Qf}from"./chunk-czvzaa42.js";import{ok as sr,pk as tr,qk as ur,rk as vr,sk as wr,tk as xr}from"./chunk-ghd80w8a.js";import{Ak as Nm,Bk as Om,uk as Jk,vk as Kk,wk as Lk,xk as Mk,yk as Lm,zk as Mm}from"./chunk-byjy9far.js";import"./chunk-c0n802j1.js";import"./chunk-4wpxbkbe.js";import{ml as $b,nl as ac,rl as bc}from"./chunk-gbkq5qnw.js";import{tl as Yb}from"./chunk-fvsefztj.js";import{$l as Pb,$m as hd,$n as xe,$o as qg,$p as hi,$q as Mj,Al as Da,Am as Ac,An as Id,Ap as Rg,Aq as Xi,Ar as yk,Bl as Ea,Bm as Bc,Bn as Jd,Bp as Sg,Bq as Yi,Br as zk,Cl as Fa,Cm as Cc,Cn as Kd,Cp as Tg,Cq as Zi,Dl as Ga,Dm as Dc,Dn as Ld,Dp as Ug,Dq as _i,El as Ha,Em as Ec,En as Md,Eo as Sf,Ep as Vg,Eq as $i,Fl as Ia,Fm as Fc,Fn as Nd,Fp as Wg,Fq as aj,Gl as Ja,Gm as Gc,Gn as Od,Gp as Xg,Gq as bj,Hl as Ka,Hm as Hc,Hn as Pd,Hp as Yg,Hq as cj,Il as La,Im as Ic,In as Qd,Ip as Zg,Iq as dj,Jl as Ma,Jm as Jc,Jn as Rd,Jp as _g,Jq as ej,Kl as Na,Km as Kc,Kn as Sd,Kp as $g,Kq as fj,Ll as Oa,Lm as Uc,Ln as Td,Lo as Tf,Lp as ah,Lq as gj,Ml as ib,Mm as Vc,Mn as Ud,Mp as bh,Mq as hj,Nl as jb,Nm as Wc,Nn as Vd,No as Uf,Np as ci,Nq as ij,Ol as kb,Om as Xc,On as Wd,Op as di,Oq as jj,Pl as lb,Pm as Yc,Pn as le,Po as Vf,Pq as kj,Ql as mb,Qm as Zc,Qn as me,Qo as Wf,Qq as lj,Rl as nb,Rm as _c,Rn as ne,Ro as Xf,Rp as ei,Rq as mj,Sn as oe,So as Yf,Sq as nj,Tm as $c,Tn as pe,To as Zf,Tq as oj,Ul as Fb,Um as ad,Un as qe,Uo as jg,Uq as pj,Vl as Gb,Vm as bd,Vn as re,Vo as kg,Vq as qj,Wl as Hb,Wm as cd,Wn as se,Wo as lg,Wq as rj,Xl as Ib,Xm as dd,Xn as te,Xo as mg,Xq as sj,Yl as Jb,Ym as ed,Yn as ue,Yo as ng,Yq as tj,Zl as Kb,Zm as fd,Zn as ve,Zo as og,Zp as fi,Zq as Kj,_l as Lb,_m as gd,_n as we,_o as pg,_p as gi,_q as Lj,am as Qb,an as id,ao as ye,ap as rg,aq as ii,ar as Nj,bm as Rb,bn as jd,bp as sg,bq as ji,br as Oj,cm as cc,cn as kd,co as Ce,cp as tg,cq as qi,cr as _j,dm as dc,dn as ld,do as De,dp as ug,dq as ri,dr as $j,em as ec,en as md,eo as Ee,ep as vg,eq as si,er as ak,fm as fc,fn as nd,fo as Fe,fp as wg,fq as ti,fr as bk,gm as gc,gn as od,go as Ge,gp as xg,gq as ui,gr as ck,hm as hc,hn as pd,ho as He,hp as yg,hq as vi,hr as dk,im as ic,in as qd,io as Ie,ip as zg,iq as wi,ir as ek,jm as jc,jn as rd,jp as Ag,jq as xi,jr as fk,km as kc,kn as sd,kp as Bg,kq as yi,kr as gk,lm as lc,ln as td,lp as Cg,lq as zi,lr as hk,mm as mc,mn as ud,mo as Xe,mp as Dg,mq as Ai,mr as ik,nm as nc,nn as vd,no as Ye,np as Eg,nq as Bi,nr as jk,om as oc,on as wd,op as Fg,oq as Ci,or as kk,pm as pc,pn as xd,po as Rf,pp as Gg,pq as Di,pr as lk,qm as qc,qn as yd,qp as Hg,qq as Ei,qr as mk,rm as rc,rn as zd,rp as Ig,rq as Fi,rr as nk,sm as sc,sn as Ad,sp as Jg,sq as Gi,sr as ok,tm as tc,tn as Bd,tp as Kg,tq as Qi,tr as rk,ul as xa,um as uc,un as Cd,up as Lg,uq as Ri,ur as sk,vl as ya,vm as vc,vn as Dd,vp as Mg,vq as Si,vr as tk,wl as za,wm as wc,wn as Ed,wp as Ng,wq as Ti,wr as uk,xl as Aa,xm as xc,xn as Fd,xp as Og,xq as Ui,xr as vk,yl as Ba,ym as yc,yn as Gd,yp as Pg,yq as Vi,yr as wk,zl as Ca,zm as zc,zn as Hd,zp as Qg,zq as Wi,zr as xk}from"./chunk-j82hfkcf.js";import{$r as la,Cr as M,Dr as N,Er as O,Fr as P,Gr as Q,Hr as R,Ir as S,Jr as T,Kr as U,Lr as V,Mr as W,Nr as X,Or as Y,Pr as Z,Qr as _,Rr as $,Sr as aa,Tr as ba,Ur as ca,Vr as da,Wr as ea,Xr as fa,Yr as ia,Zr as ja,_r as ka,as as ma,bs as na,cs as oa,ds as pa,es as qa,fs as ra,gs as sa,hs as ta,is as ua,js as va,ks as wa}from"./chunk-rh7mwwb4.js";import{ls as ga,ms as ha}from"./chunk-1t3j8a0q.js";import{ns as Mb,os as Nb,ps as Ob}from"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import{As as Li,Bs as Mi,Cs as Ni,Ds as Oi,Es as Pi,ws as Hi,xs as Ii,ys as Ji,zs as Ki}from"./chunk-hk8j3eps.js";import{Ws as Lc,Xs as Mc,Ys as Nc,Zs as Oc,_s as Pc,at as Qc,jt as Rc,kt as Sc,lt as Tc}from"./chunk-xe93ae3r.js";import{mt as Sb,nt as Tb,ot as Ub,pt as Vb,qt as Wb,rt as Xb}from"./chunk-1spzqjve.js";import{At as Ae,Dt as Be,yt as ze}from"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import{It as Zb,Jt as _b}from"./chunk-r1rfwm01.js";import{Nt as _f,Ot as $f,Pt as ag,Qt as bg,Rt as cg,St as dg,Tt as eg,Vt as fg,Wt as gg,Xt as hg,Yt as ig}from"./chunk-ahpmjg3f.js";import{$t as d,Au as E,Bu as F,Cu as G,Du as H,Eu as I,Fu as J,Gu as K,Hu as L,Zt as b,_t as c,au as e,bu as f,cu as g,du as h,eu as i,fu as j,gu as k,hu as l,iu as m,ju as n,ku as o,lu as p,mu as q,nu as r,ou as s,pu as t,qu as u,ru as v,su as w,tu as x,uu as y,vu as z,wu as A,xu as B,yu as C,zu as D}from"./chunk-bt8w146r.js";import{$u as fe,Ru as Xd,Su as Yd,Tu as Zd,Uu as _d,Vu as $d,Wu as ae,Xu as be,Yu as ce,Zu as de,_u as ee,av as ge,bv as he,cv as ie,dv as je,ev as ke}from"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import{Av as Eb,kv as ob,lv as pb,mv as qb,nv as rb,ov as sb,pv as tb,qv as ub,rv as vb,sv as wb,tv as xb,uv as yb,vv as zb,wv as Ab,xv as Bb,yv as Cb,zv as Db}from"./chunk-wv8h3d68.js";import{$v as $a,Ev as Pa,Fv as Qa,Iv as Ra,Nv as Sa,Ov as Ta,Uv as Ua,Vv as Va,Wv as Wa,Xv as Xa,Yv as Ya,Zv as Za,_v as _a,aw as ab,bw as bb,cw as cb,dw as db,ew as eb,fw as fb,gw as gb,iw as hb}from"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{bl as writeNetlifyConfig,Vm as writeManifest,Gl as writeImageManifest,lp as wrapComponentForHMR,Ur as withDefaults,ok as webComponentDirectiveHandler,aq as watermark,cr as watchViews,Ql as watchMultiple,Rl as watchEffect,Pl as watch,Ge as warmImagePlaceholders,cm as waitForStore,X as waitForLocale,Zo as virtualPathFor,bk as videoDirective,G as validators,Yr as validated,we as validateValueEnhanced,fi as validateTemplate,Jm as validateRouteRules,fq as validateParams,xe as validateFormEnhanced,Tq as validateFile,se as validateFields,re as validateField,hi as validateDirective,Rd as validateCspDirectives,wk as validateConfig,gn as validateComponentScripts,Fn as validateComponentProps,bh as validateClientScript,ai as v,Cc as usesSignalsInScript,ub as usesReactiveRuntime,ui as userComponentFileExists,Ih as useVirtualList,de as useTitle,bm as useStoreOrThrow,Dp as useStore,Nk as useStorage,uf as useSlots,Pk as useSessionStorage,Zb as useServerRuntimeConfig,Sf as useServerData,ae as useSeoMeta,_b as useRuntimeConfig,dm as useRouteParams,fm as useRouteParamOrThrow,em as useRouteParam,de as usePageTitle,lf as useOptimistic,zf as useModel,hm as useMiddlewareValue,gm as useMiddlewareState,Ok as useLocalStorage,ep as useLoadingIndicator,_d as useHead,Zh as useForm,wf as useAttrs,Vq as uploadFiles,Uq as uploadFile,_l as updateInstance,jf as untrack,Ki as unregisterDirective,$l as unmountInstance,Kc as unescapeHtml,ap as typecheckStxFiles,ti as transpileTypeScript,Hr as translate,Ba as transitionDirective,gc as transformAutoImports,zn as toUsers,yn as toUser,Lp as thumbnail,Mq as thumbHashToRGBA,Nq as thumbHashToDataURL,wb as templateNeedsRuntime,vb as templateHasReactiveContext,Df as templateCache,hd as syncRecordedResponse,ip as stxClientHelpers,dg as structuredDataDirective,Kr as stripLocalePrefix,Gm as stripDocumentWrapper,Nb as stripCommentsAndLiterals,ko as stringToStream,Fd as strictCspPreset,Re as streamingSuspenseDirective,Ve as streamToResponse,Pe as streamTemplateSimple,Je as streamTemplate,Ik as stopHmrServer,vn as stopBroadcasting,Vb as stateDirName,Wb as stateDir,Ze as state,Xg as startsDocument,Fo as startProductionServer,Ao as startInteractive,un as startBroadcasting,Mr as stampLocaleLayoutGroup,Ia as staggerDirective,dq as srcsetUrls,Ja as springDirective,od as splitByPipe,Cm as spaNavVaryHeaders,_o as sourcePathFor,kq as smartBatchSign,wi as slotContentHasExpressions,iq as signUrl,ri as shouldTranspileTypeScript,Fk as shouldReloadOnChange,nq as shouldRefreshSignature,Gk as shouldIgnoreFile,Ah as shouldCacheComponent,Pp as sharpen,$r as shape,Ub as setStateDir,lm as setRouteParams,mm as setMiddlewareState,Fe as setImagePlaceholder,of as setGlobalProvide,b as setErrorLocale,Il as setCurrentInstance,Rj as setCachedVideoResult,Gj as setCachedImageResult,Aj as setCached,cs as serveStxFile,es as serveMultipleStxFiles,Ak as serveMarkdownFile,Qo as serveFile,fs as serveApp,Po as serve,op as serializeState,Xm as serializeSetCookie,Rp as sepia,be as seoMetaToHeadConfig,Ca as scrollAnimateDirective,va as screenReaderDirective,fk as scopeHTML,ek as scopeCSS,gg as scanForSitemapEntries,pa as scanA11yTargets,qa as scanA11yIssues,Vp as saturation,gq as sanitizeParams,I as sanitizeFilePath,J as sanitizeExpression,K as sanitizeDirectiveParams,H as sanitizeDirectiveParam,L as sanitizeComponentProps,B as safeExecuteAsync,A as safeExecute,Cb as runtimeHandledXAttrsLiteral,rg as runPreProcessingMiddleware,sg as runPostProcessingMiddleware,_m as runPageAction,df as runMountCallbacks,gb as runMiddleware,Yl as runHooks,Ar as runDoctor,ef as runDestroyCallbacks,vg as runComposers,Wp as rotate,bi as rewriteImagesWithSiblings,id as responseBindings,Ai as resolveTemplatePath,ha as resolveStxTargets,sk as resolveStxDirectories,Gr as resolveI18n,Jp as resize,jg as resetUnscopedSignalWarnings,Ic as resetRejectedExpressionWarnings,nc as resetPlaceholders,Zd as resetHead,np as resetHMRHandler,o as resetErrorConfig,Wr as required,Yf as reportDeferredLoopWarnings,rc as replacePlaceholders,zc as replaceInterpolations,ar as renderView,_j as renderVideoComponent,dc as renderVendorStyleTags,jr as renderToString,kr as renderToStream,lr as renderToDOM,Lq as renderThumbhashToCanvas,xr as renderTemplateString,vr as renderTemplate,wr as renderString,Me as renderStreamingPage,mi as renderSlot,qh as renderSSRSuspense,vq as renderProtectedVideo,uq as renderProtectedImg,hq as renderMediaUpload,ur as renderMarkdownView,Nm as renderLayoutTypes,Kj as renderImgComponent,wl as renderImageComponent,fe as renderHtmlAttrs,ee as renderHead,dr as renderEmail,yi as renderComponentWithSlot,ge as renderBodyAttrs,yp as render,Hd as relaxedCspPreset,qe as registerValidationRule,Te as registerStreamingDirectives,Fp as registerStoresClient,jm as registerStore,Lf as registerServeModuleBundle,eg as registerSeoDirectives,_a as registerMiddleware,vc as registerFilters,uc as registerFilter,d as registerErrorMessages,ve as registerEnhancedValidationRule,Hi as registerDirective,Qd as registerCspDirectives,In as registerComponentDirectives,Oa as registerAnimationDirectives,wa as registerA11yDirectives,hc as referencesName,Ml as ref,so as redirect,dd as recordResponseStatus,ed as recordResponseHeader,Xb as rebaseOntoStateDir,fd as readResponseStatus,gd as readResponseHeaders,yk as readMarkdownFile,Ef as readFileCached,Nl as reactive,_p as quality,sq as pruneSignatureCache,Dj as pruneCache,mf as provide,tr as protectCodeBlocks,Vr as prop,yg as processVueTemplate,Gh as processVirtualListDirectives,Kh as processVirtualGridDirectives,Zj as processVideo,te as processValidateDirective,ea as processTranslateDirective,kh as processTransitionDirectives,nh as processTransitionAttributes,je as processTitleDirective,Xc as processTemplateBindings,gh as processTeleportDirectives,oh as processSuspenseDirectives,$f as processStructuredData,Ne as processStreamDirectives,jd as processStatusDirective,Xh as processStaticDirectives,pg as processStackReplacements,og as processStackPushDirectives,ni as processSlots,Em as processShell,Ie as processServerBindings,ag as processSeoDirective,Ue as processSectionDirectives,Pc as processScopedStyles,Vc as processReactiveBindings,wq as processProtectedMedia,Qh as processPartialHydrationDirectives,ah as processOnceDirective,qg as processMiddleware,_f as processMetaDirectives,ke as processMetaDirective,zk as processMarkdownFileDirectives,Fi as processMarkdownDirectives,Zf as processLoops,yh as processKeepAliveDirectives,$g as processJsonDirective,Jh as processInfiniteListDirectives,ng as processIncludes,Mj as processImgComponents,yl as processImageComponents,ll as processImage,ie as processHeadDirective,me as processForms,oe as processFormInputDirectives,Gc as processExpressions,Kb as processEventDirectives,pe as processErrorDirective,zg as processDynamicComponents,ci as processDirectives,Pi as processDirectiveAttributes,fh as processDeferDirectives,Vd as processCustomDirectives,Nd as processCspDirectives,as as processComponentProps,mc as processClientScript,ne as processBasicFormDirectives,th as processAsyncDirectives,Wd as processAppearanceBootstrapDirective,Fa as processAnimationDirectives,ka as processA11yDirectives,Be as prepareImageDelivery,T as preloadTranslationsBackground,S as preloadTranslations,dp as preloadIslandHandlers,He as preloadIconCollection,qn as poolStrings,qk as pluginManager,De as placeholdersWarmed,jh as performLeave,ih as performEnter,ff as pendingLifecycleCounts,kf as peek,kg as partialsCache,$j as parseVideoDirectiveOptions,Hp as parseUrl,Oq as parseThumbhashString,ud as parseSwitchBlock,ki as parseSlots,li as parseSlotElement,zd as parseScriptDeclarations,mk as parseSFCComponent,xq as parseProtectedArgs,Xf as parseLoopBinding,Lj as parseImgComponent,bj as parseImageUrl,xl as parseImageComponent,Ym as parseFormBody,wd as parseExpressionWithFilters,Jn as parseDefaults,po as parseCookies,vm as parseContainerSelector,rd as parseConditionalBlock,xd as parseArguments,Ma as parseAnimationShorthand,Xr as optional,rn as optimizeTemplate,Dl as optimizeImage,El as optimizeDirectory,Zr as oneOf,lg as onceStore,Vl as onUpdated,Uc as onUpdate,Xl as onUnmounted,qm as onServer,Tl as onMounted,bf as onMount,Wh as onHydrated,sf as onErrorCaptured,cf as onDestroy,Eh as onDeactivated,pm as onClient,Ul as onBeforeUpdate,Wl as onBeforeUnmount,Sl as onBeforeMount,Dh as onActivated,Hq as observeElement,to as notFound,Eg as normalizeCriticalHeadOrder,rf as nextTick,Mn as negotiateEncoding,Ua as navigateTo,Zl as mountInstance,Ea as motionDirective,Gd as moderateCspPreset,pn as minifyHtml,cg as metaDirective,Pg as metaDedupKey,Ip as mergeParams,Rg as mergeHtmlAttrs,$d as mergeHeadConfigs,Mc as mergeCssConfig,Kd as mergeCspDirectives,Ra as matchRoute,Gi as markdownDirectiveHandler,xk as markdownCache,ga as looksLikeGlob,Jr as localizePath,U as loadTranslationLazy,_ as loadTranslation,tk as loadStxConfig,db as loadMiddlewareFromDirectory,Wm as loadManifest,Dq as loadElement,wn as loadChannels,Gb as listensPassively,Qr as lintStxStrict,Fq as lazyLoadAll,Eq as lazyLoad,Ha as keyframeDirective,hr as jsxs,ir as jsxDEV,gr as jsx,ro as jsonResponse,Se as islandDirective,l as isTest,Hm as isSpaNavigation,Am as isSpaNavRequest,lq as isSignatureValid,gf as isSignal,jl as isSharpAvailable,co as isServerEnvironment,nm as isServer,yb as isRuntimeOwnedColonAttr,da as isRtlLocale,j as isProduction,ia as isPresentationalRole,Aq as isNativeLazySupported,sr as isMarkdownPath,Q as isLoading,R as isLoaded,qi as isJavaScriptScript,Bq as isIntersectionObserverSupported,rl as isImageFile,kl as isImageBackendAvailable,aa as isICUFormat,Vh as isHydrated,vi as isHydrateTrigger,bd as isHttpStatus,bo as isEdgeEnvironment,Rr as isDirectiveKind,k as isDevelopment,hf as isDerived,Ek as isCssOnlyChange,Ln as isCompressible,om as isClient,vh as isAsyncComponent,Zm as isActionableMethod,Sp as invert,Gf as invalidateFileCacheByDir,Ff as invalidateFileCache,Fc as interpolateScriptsInTemplate,Dc as interpolateScriptExpressions,Ec as interpolateScriptAttributes,x as inlineError,Fr as injectThemeBootstrap,bg as injectSeoTags,Cr as injectSeo,Rf as injectRouterScript,Dk as injectHotReload,kb as injectHeatmap,Tc as injectCss,Ld as injectCspMetaTag,Zg as injectConfigHeadTags,Dg as injectColorModeBootScript,Tg as injectCloakStyle,Kg as injectBuildId,fc as injectBrowserCoreAutoImports,Zc as injectAnalytics,nf as inject,im as initStoreRegistry,el as initNetlify,fp as initLoadingIndicator,Cq as initLazyLoading,zo as initFile,Kq as initBlurUp,Qq as initAllBlurUp,Oj as imgDirective,Bl as imageDirective,bn as hydrateTemplateStream,an as hydrateTemplate,cp as hydrateIslands,Sh as hydrateIsland,cn as hydrateFragment,Th as hydrateByStrategy,Uh as hydrateAll,vp as hydrate,Oo as htmlResponse,Vg as hoistLeadingHeadTags,Fg as hoistColorModeBootScript,lb as heatmapDirective,wj as hashString,Qf as hashFilePath,uj as hashFile,vj as hashBuffer,xg as hasVueTemplateSyntax,Wf as hasVariables,Ap as hasStore,sc as hasPlaceholders,cl as hasNetlifyConfig,ab as hasMiddleware,Lb as hasEventDirectives,Yg as hasDocumentShell,ii as hasDirectives,ma as hasDOMSupport,ul as handleImageRequest,tf as handleError,pr as h,ql as groupVariantsByFormat,Qp as grayscale,Ho as gitHash,jn as getUnusedDirectives,V as getTranslationSync,O as getTranslationCacheStats,W as getTranslationAsync,ba as getTranslation,Zk as getTotalSize,mq as getTimeUntilExpiry,ch as getStoreScript,Bp as getStoreNames,zp as getStore,Sk as getStorageSize,Rk as getStorageKeys,Bi as getSourceLineInfo,si as getSharedTranspiler,Mf as getServeModuleBundle,Kf as getServeClientAsset,la as getScreenReaderOnlyStyle,gk as getScopeAttribute,Ye as getRouteParams,Qb as getPublicEnvDefine,Rb as getPublicEnv,gi as getPositionInfo,pc as getPlaceholderRegistry,tj as getPlaceholderCacheStats,Yd as getPageMeta,Bd as getNonce,sl as getMimeType,cb as getMiddlewareNames,$a as getMiddleware,ca as getLocaleDirection,P as getLoadingState,Y as getLoadingLocales,Ce as getImagePlaceholder,ml as getImageMetadata,ze as getImageDelivery,up as getHydrationRuntime,km as getHydratedStoreState,Hk as getHmrServer,Xd as getHead,mp as getHMRHandler,fj as getFormatExtension,yj as getFileMtime,pl as getFallbackVariant,f as getErrorMessage,c as getErrorLocale,n as getErrorConfig,i as getErrorCodeName,Ji as getDirectives,Ii as getDirective,Jl as getCurrentInstance,Qc as getCssServeAsset,Jd as getCspPreset,Sd as getCspHeaderName,Ei as getComponentCacheStats,Qj as getCachedVideoResult,qq as getCachedSignature,If as getCachedSignalsRuntime,Jf as getCachedRouterScript,rj as getCachedPlaceholder,Fj as getCachedImageResult,zj as getCached,Cj as getCacheStats,Ig as getBuildId,tn as getBroadcastServer,ej as getBestVariant,wc as getAllFilters,Ui as generateWidthSrcset,Hh as generateVirtualListCSS,Xq as generateVideoPreview,ye as generateValidationScript,Yq as generateUploadRuntime,kn as generateTreeShakenBundle,mh as generateTransitionRuntime,lh as generateTransitionCSS,Uj as generateThumbnails,kj as generateThumbhashPlaceholder,Vn as generateTemplatesDocs,sh as generateSuspenseRuntime,rh as generateSuspenseCSS,pp as generateStateScript,cj as generateSrcsetData,Jj as generateSrcset,nl as generateSrcSet,Vj as generateSpriteSheet,er as generateSpaShell,dj as generateSourceTags,_i as generateSizesFromBreakpoints,Zi as generateSizesAttribute,ol as generateSizes,fg as generateSitemapIndex,Dr as generateSitemap,zq as generateSimpleMediaPicker,tq as generateSignatureRuntime,Cf as generateSignalsRuntimeDev,Bf as generateSignalsRuntime,lc as generateServerDataBridge,dk as generateScopeId,nk as generateSFCWebComponent,Ib as generateRuntimeScript,Pa as generateRouteTypes,Qa as generateRouteManifest,hg as generateRobotsTxt,Er as generateRobots,Ij as generateResponsiveVariants,jk as generateReactiveWebComponentTS,ik as generateReactiveWebComponent,lk as generateReactiveRuntime,kk as generateReactiveMixin,Tj as generatePoster,qj as generatePlaceholderStyle,pj as generatePlaceholderCSS,jj as generatePlaceholder,Rh as generatePartialHydrationCSS,Ad as generateNonce,_k as generateNetlifyToml,_q as generateMinifiedMediaRuntime,Zq as generateMediaRuntime,yq as generateMediaManagerEmbed,Um as generateManifest,hp as generateLoadingIndicatorHtml,Jq as generateLazyLoadRuntime,Om as generateLayoutTypes,mj as generateLQIP,Ch as generateKeepAliveRuntime,Bh as generateKeepAliveCSS,Yh as generateIslandManifest,Wq as generateImagePreview,Fl as generateImageManifest,tp as generateHydrationScript,We as generateHydrationRuntime,wp as generateHydrationCSS,Lh as generateHydrationBootstrap,Ck as generateHotReloadScript,jb as generateHeatmapScript,kp as generateHMRClientScript,Wj as generateHLSManifest,qp as generateEventBindings,Yi as generateDprSrcsetWithVariableQuality,Xi as generateDprSrcset,Wg as generateDocumentShell,_n as generateDocs,Wn as generateDirectivesDocs,Oi as generateDirectiveRuntime,ig as generateDefaultRobotsTxt,Xj as generateDASHManifest,Sc as generateCss,Ed as generateCspMetaTag,Dd as generateCspHeader,yf as generateCompositionRuntime,Un as generateComponentsDocs,Mh as generateComponentManifest,Sn as generateComponentDoc,oj as generateColorPlaceholder,Cg as generateColorModeBootScript,am as generateClientRuntime,xj as generateCacheKey,jc as generateBrowserAutoImportDestructuring,Rq as generateBlurUpRuntime,Sq as generateBlurUpCSS,Wc as generateBindingsRuntime,Vi as generateAutoWidthSrcset,ic as generateAutoImportDestructuring,xh as generateAsyncComponentRuntime,wh as generateAsyncComponentCSS,ac as generateApiTypes,Na as generateAnimationRuntime,La as generateAnimationCSS,Yc as generateAnalyticsScript,bp as formatTypecheckDiagnostics,Xo as formatTypeErrors,wo as formatStxContent,Yk as formatSize,Ta as formatRoutes,xo as formatMarkdownContent,g as formatLocalizedError,$ as formatICU,p as formatFilePath,w as formatError,Br as formatDoctorReport,Xn as formatDocsAsMarkdown,Zn as formatDocsAsJson,Yn as formatDocsAsHtml,Zp as format,on as foldConstants,Yp as flipVertical,Xp as flipHorizontal,Pm as fingerprint,$o as findRuntimeTypeDeclarations,zr as findPantryPackage,yc as findMustacheEnd,qd as findMatchingEndTag,md as findMatchingDelimiter,Mb as findInterpolationEnd,sd as findIfBlocks,vd as findExpressions,Sa as findErrorPage,Nc as findDuplicateScopedStyleRanges,td as findDirectiveBlocks,ln as findDeadCode,ln as findDeadBranches,wm as findContainerRegion,Tn as findComponentFiles,ds as findCommonDir,Xk as filterRequiredFiles,zi as fileExists,Tf as extractVariables,ei as extractTemplateExpressions,Oe as extractStreamBoundaries,rp as extractState,oi as extractSlotContent,Vf as extractScriptFromTemplate,di as extractScriptBlocks,qc as extractPlaceholders,pd as extractParenthesizedExpression,cd as extractPageResponseStatus,hb as extractLayoutMetadata,nj as extractDominantColor,yd as extractDirectiveParams,ji as extractDirectiveNames,Im as extractContainerContent,Qn as extractComponentProps,Nh as extractComponentName,Rn as extractComponentDescription,Rc as extractClassNames,kc as extractBridgeData,Oh as extractBoundProps,nd as extractBalancedExpression,cc as extractAndStripCssImports,hk as extractAndScopeStyles,Jb as extractAndProcessEvents,Lk as externalizeSharedAssets,Mk as externalizeRepeatedAssets,Kk as externalizeHtml,Jc as evaluateExpression,nn as evaluateConstant,kd as evaluateAuthExpression,Bc as escapeHtmlValue,Ac as escapeHtml,C as errorRecovery,E as errorLogger,hh as ensureTeleportTargets,_g as ensureDocumentShell,ue as enhancedValidationRules,On as enableDevTools,mn as eliminateDeadCode,$e as effect,eq as dprUrls,$n as docsCommand,$b as discoverServerApi,Mm as discoverLayoutNames,Iq as disconnectObserver,Pn as disableDevTools,F as devHelpers,Dm as detectShell,ao as detectRuntime,$k as detectProjectConfig,gj as detectFormat,fn as detectBuildMode,_e as derived,dl as deploy,vk as defineStxConfig,Ep as defineStore,vf as defineSlots,Pr as defineSiteConfig,Tr as definePropsWithValidation,Sr as defineProps,pk as definePlugin,ce as definePageMeta,Wa as defineMiddleware,_h as defineForm,qf as defineExpose,pf as defineEmits,Li as defineDirective,rr as defineCustomElement,Eo as defineConfig,Mi as defineClientDirective,uh as defineAsyncComponent,Go as defineApiHandler,$q as defaultMediaConfig,Hl as defaultImageConfig,M as defaultI18nConfig,ib as defaultHeatmapConfig,le as defaultFormClasses,tc as defaultFilters,Ud as defaultCspConfig,rk as defaultConfig,bs as default,Lc as deepMergeThemes,Oc as dedupeScopedStyles,zm as decodeTitleEntities,lj as decodeThumbhash,Pd as cspNonceDirective,Od as cspDirective,Pq as crossfadeTransition,Kp as crop,Fh as createVirtualList,ak as createVideoDirective,no as createVercelHandler,Uo as createTypeChecker,fa as createTranslateFilter,jo as createTextEncoderStream,qr as createStxApp,io as createStreamingResponse,Qe as createStreamRenderer,Cp as createStore,Za as createStorageManager,Xa as createServerCookieManager,bc as createServerApi,Ll as createScope,ph as createSSRSuspense,Xe as createRouter,Km as createRouteRuleResolver,eb as createRouteLocation,So as createRoute,Ml as createRef,Nl as createReactive,xf as createProvideContext,Jo as createProject,Do as createProductionBuild,oc as createPlaceholder,sn as createOptimizedBuild,oo as createNetlifyHandler,Tk as createNetlifyClient,fb as createMiddlewareContext,Ro as createMiddleware,Gq as createLazyObserver,zh as createKeepAliveCache,fo as createKVNamespace,Ph as createIslandRegistry,Nj as createImgDirective,Cl as createImagePlugin,vl as createImageHandler,Al as createImageDirective,nb as createHeatmapAggregator,Wk as createFileManifest,eo as createEnvAccessor,z as createEnhancedError,ho as createEdgeHandler,go as createEdgeCache,Ci as createDetailedErrorMessage,mo as createDenoHandler,al as createDefaultNetlifyConfig,Td as createCspHeaders,qo as createCookie,Ol as createComputed,Kl as createComponentInstance,lo as createCloudflareHandler,Ya as createClientCookieManager,Ni as createBuiltinDirectives,qr as createApp,Ka as createAnimationTimeline,Np as cover,Uf as convertToCommonJS,Up as contrast,Mp as contain,y as consoleError,m as configureErrorHandling,uk as config,Ol as computed,Nn as compressResponse,ug as composerPattern,tg as composer,Fm as composeShellWithPage,Hn as componentDirective,xi as componentClientSignalNames,Tm as compileTemplate,a as collectRepeatedFlag,Vk as collectDeployFiles,Ug as cloakStyleFragment,Sj as clearVideoCache,N as clearTranslationCache,dh as clearStoreCache,Qk as clearStorage,rq as clearSignatureCache,Af as clearServerData,sj as clearPlaceholderCache,mg as clearOnceStore,Cd as clearNonce,bb as clearMiddleware,Ee as clearImagePlaceholders,Ae as clearImageDeliveryCatalog,zl as clearImageCache,e as clearErrorMessages,Nf as clearDevCaches,xc as clearCustomFilters,wg as clearComposers,eh as clearComposableCache,Di as clearComponentCache,Bj as clearCache,Db as clearBlankCache,gp as cleanupLoadingIndicator,tm as classifyScript,um as classifyAllScripts,Vo as checkTemplateFile,Wo as checkTemplate,Of as checkCache,oq as checkAuthAccess,na as checkA11yWithRegex,oa as checkA11y,Cn as channel,vo as captureScreenshots,uo as captureScreenshot,Z as cancelPendingLoads,Uk as calculateSha1,Wi as calculateOptimalWidths,Pf as cacheTemplate,Yb as cacheEngineFingerprint,ck as buildWebComponents,Yo as buildVirtualSource,br as buildViews,Gp as buildUrl,Ke as buildSuspenseResolveScript,Or as buildStaticSite,qb as buildRuntimeGlobalsDestructure,Qm as buildRuntimeAsset,Rm as buildRouterAsset,Nr as buildLangPickerScript,aj as buildImageUrl,Lg as buildIdFragment,Qg as buildHtmlAttrs,dn as buildForProduction,Kn as buildComponentLibrary,pq as buildAuthParams,en as buildApp,Lr as buildAlternateLinks,Co as build,An as broadcastPrivate,Bn as broadcastPresence,xn as broadcast,Tp as brightness,Ob as bracketDepths,Op as blur,Eb as blankInertHtmlRegions,jq as batchSignUrls,af as batch,sa as autoFixA11yFile,ta as autoFixA11yDirectory,ra as autoFixA11y,$p as auto,ja as attributeValue,Sm as assetTags,Hb as asInvocableStatement,_r as arrayOf,Ir as applyTranslations,Hj as applyTransformations,pi as applySlots,Gn as applyPropDefaults,cq as applyPreset,Sg as applyHtmlAttrs,he as applyHead,Hc as applyFilters,Bm as appendVary,Id as apiCspPreset,Da as animationGroupDirective,Yj as analyzeVideo,hn as analyzeUsage,rm as analyzeTemplate,sm as analyzeProject,hn as analyzeDirectiveUsage,_c as analyticsDirective,Mo as addStore,Lo as addPage,Md as addNonceToInlineContent,No as addLayout,Ko as addComponent,$m as actionRedirectResponse,Va as abortNavigation,ua as a11yDirective,Hf as __setSignalsGeneratorsForTest,Jg as __setBuildIdForTest,Pj as VideoProcessorCache,$h as Validator,xa as TransitionType,za as TransitionEase,ya as TransitionDirection,ld as Tokenizer,To as TemplateTypeChecker,yo as TEMPLATE_PRESETS,v as StxValidationError,r as StxSyntaxError,t as StxSecurityError,s as StxRuntimeError,u as StxFileError,q as StxError,mr as Show,Le as SUSPENSE_RESOLVER_RUNTIME,ob as STX_RUNTIME_GLOBALS,ec as STX_AUTO_IMPORTS,Tb as STATE_DIR_ENV_VAR,Ga as SPRING_PRESETS,xm as SPA_NAV_HEADER,Fb as SCROLL_BLOCKING_EVENTS,xb as RUNTIME_OWNED_COLON_ATTRS,zb as RUNTIME_HANDLED_X_ATTRS,$c as RESPONSE_STATUS_KEY,ad as RESPONSE_HEADERS_KEY,tb as REACTIVE_RUNTIME_GLOBALS,Bo as ProductionBuild,or as Portal,Io as PROJECT_TEMPLATES,bq as PRESETS,sb as NON_CLIENT_PRIMITIVES,xp as MemorySessionStore,Ti as MIME_TYPES,Qi as MEDIA_DEFAULT_WIDTHS,Si as MEDIA_DEFAULT_FORMATS,Lm as LAYOUT_TYPES_FILE,Ej as ImageProcessorCache,tl as ImageProcessingError,sp as HydrationRuntime,Bk as HotReloadServer,mb as HeatmapAggregator,Og as HTML_CLASS_MARKER,Ng as HTML_ATTRS_MARKER,fr as Fragment,nr as For,ym as FRAGMENT_CACHE_CONTROL,D as ErrorLogger,h as ErrorCodes,Jk as EXTERNALIZED_ASSET_DIR,fl as DeployError,gl as DEFAULT_WIDTHS,Aa as DEFAULT_TRANSITION_OPTIONS,Sb as DEFAULT_STATE_DIR,il as DEFAULT_QUALITY,hj as DEFAULT_PLACEHOLDER_OPTIONS,hl as DEFAULT_FORMATS,Ri as DEFAULT_DPR_VALUES,jp as ComponentHMRHandler,pb as COMPONENT_SCOPE_LOCAL_GLOBALS,Bb as COMPONENT_PASSTHROUGH_X_ATTRS,rb as COMPILE_TIME_ONLY_GLOBALS,$i as COMMON_SIZES,Ag as COLOR_MODE_BOOT_MARKER,Bg as COLOR_MODE_BOOT_GLOBAL,Mg as CLOAK_STYLE,En as BroadcastServer,Dn as Broadcast,Gg as BUILD_ID_META,Hg as BUILD_ID_HEADER,Pb as BROWSER_CORE_IMPORTS,ij as BLUR_UP_CSS,Ab as ALPINE_BRIDGE_X_ATTRS,yr as $path};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Ji as D,Ki as S,Li as R}from"./chunk-7we3xfde.js";import{Yl as I,aq as K,rr as k}from"./chunk-d964bsxm.js";import{bv as x,cv as F}from"./chunk-2tjk867y.js";import{gv as y}from"./chunk-deqnt1w5.js";import P from"path";var U=new Map,T=new Map,u=["composables","functions"];function b(q){let z=P.basename(q,".ts");return z==="index"||z==="types"||q.endsWith(".d.ts")}async function p(q){if(q)return P.resolve(q);let z=`<default>:${process.cwd()}`,W=T.get(z);if(W!==void 0)return W;let H=await m();if(H!==null)T.set(z,H);return H}async function m(){let q=await k(),z=q.root||process.cwd(),W=q.composablesDir;if(W)return P.resolve(z,W);for(let H of u){let Q=P.resolve(z,H);try{let V=new Bun.Glob("**/*.ts");for await(let Z of V.scan({cwd:Q,absolute:!0}))if(!b(Z))return Q}catch{}}return null}async function g(q){let z=Array.isArray(q)?q:q?[P.resolve(q)]:(await k())._layerComposableDirs??[await p()].filter((H)=>!!H),W=new Map;for(let H of z){let Q=new Bun.Glob("**/*.ts");try{for await(let V of Q.scan({cwd:H,absolute:!0})){let Z=P.relative(H,V);if(!b(V)&&!W.has(Z))W.set(Z,V)}}catch{}}return{key:z.join("\x00"),files:[...W.values()].sort()}}async function e(q){let{files:z}=await g(q),W=K({loader:"ts",target:"browser",define:I()}),H=[];for(let Q of z)try{let V=await Bun.file(Q).text(),Z=W.scan(V).exports.filter(($)=>$!=="default");if(Z.length>0)H.push({file:Q,names:Z})}catch{}return H}function t(q,z){return new RegExp(`\\b${z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(q)}function n(q,z,W){let H=new Map;for(let{file:$,names:G}of q)for(let O of G)if(!H.has(O))H.set(O,$);let Q=($)=>{let G=[];for(let[O,j]of H)if(t($,O))G.push(j);return G},V=new Set,Z=W.flatMap(Q);while(Z.length>0){let $=[];for(let G of Z){if(V.has(G))continue;V.add(G);for(let O of Q(z.get(G)??""))if(!V.has(O))$.push(O)}Z=$}return V}async function qq(q,z,W){let{key:H,files:Q}=await g(q);if(!H)return null;let V=D(Q);if(Q.length===0)return R(U,H,V,""),null;Q.sort();let Z=K({loader:"ts",target:"browser",define:I()}),$=new Map,G=[];for(let J of Q)try{let Y=await Bun.file(J).text();$.set(J,Y);let L=Z.scan(Y).exports.filter((X)=>X!=="default");if(L.length>0)G.push({file:J,names:L})}catch{$.set(J,"")}let O=z===void 0?new Set(Q):n(G,$,W?[z,...W]:[z]);if(O.size===0)return null;let j=Q.filter((J)=>O.has(J)),A=`${H}\x00${j.join("\x00")}`,B=S(U,A,V);if(B!==void 0)return B||null;let M=[],w=new Set,_=new Set;for(let J of j)try{let Y=$.get(J)??await Bun.file(J).text(),L=P.basename(J,".ts");for(let X of Y.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])_.add(X[1]);try{for(let X of Z.scan(Y).exports)if(X!=="default")w.add(X)}catch{}Y=x(Y),Y=F(Y),Y=Y.replace(/^export\s+(default\s+)?/gm,""),Y=Z.transformSync(Y),M.push(`// Composable: ${L}
2
+ import{Ji as D,Ki as S,Li as R}from"./chunk-7we3xfde.js";import{am as I,eq as K,vr as k}from"./chunk-j82hfkcf.js";import{fv as x,gv as F}from"./chunk-x7dv5rq7.js";import{kv as y}from"./chunk-wv8h3d68.js";import P from"path";var U=new Map,T=new Map,u=["composables","functions"];function b(q){let z=P.basename(q,".ts");return z==="index"||z==="types"||q.endsWith(".d.ts")}async function p(q){if(q)return P.resolve(q);let z=`<default>:${process.cwd()}`,W=T.get(z);if(W!==void 0)return W;let H=await m();if(H!==null)T.set(z,H);return H}async function m(){let q=await k(),z=q.root||process.cwd(),W=q.composablesDir;if(W)return P.resolve(z,W);for(let H of u){let Q=P.resolve(z,H);try{let V=new Bun.Glob("**/*.ts");for await(let Z of V.scan({cwd:Q,absolute:!0}))if(!b(Z))return Q}catch{}}return null}async function g(q){let z=Array.isArray(q)?q:q?[P.resolve(q)]:(await k())._layerComposableDirs??[await p()].filter((H)=>!!H),W=new Map;for(let H of z){let Q=new Bun.Glob("**/*.ts");try{for await(let V of Q.scan({cwd:H,absolute:!0})){let Z=P.relative(H,V);if(!b(V)&&!W.has(Z))W.set(Z,V)}}catch{}}return{key:z.join("\x00"),files:[...W.values()].sort()}}async function e(q){let{files:z}=await g(q),W=K({loader:"ts",target:"browser",define:I()}),H=[];for(let Q of z)try{let V=await Bun.file(Q).text(),Z=W.scan(V).exports.filter(($)=>$!=="default");if(Z.length>0)H.push({file:Q,names:Z})}catch{}return H}function t(q,z){return new RegExp(`\\b${z.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(q)}function n(q,z,W){let H=new Map;for(let{file:$,names:G}of q)for(let O of G)if(!H.has(O))H.set(O,$);let Q=($)=>{let G=[];for(let[O,j]of H)if(t($,O))G.push(j);return G},V=new Set,Z=W.flatMap(Q);while(Z.length>0){let $=[];for(let G of Z){if(V.has(G))continue;V.add(G);for(let O of Q(z.get(G)??""))if(!V.has(O))$.push(O)}Z=$}return V}async function qq(q,z,W){let{key:H,files:Q}=await g(q);if(!H)return null;let V=D(Q);if(Q.length===0)return R(U,H,V,""),null;Q.sort();let Z=K({loader:"ts",target:"browser",define:I()}),$=new Map,G=[];for(let J of Q)try{let Y=await Bun.file(J).text();$.set(J,Y);let L=Z.scan(Y).exports.filter((X)=>X!=="default");if(L.length>0)G.push({file:J,names:L})}catch{$.set(J,"")}let O=z===void 0?new Set(Q):n(G,$,W?[z,...W]:[z]);if(O.size===0)return null;let j=Q.filter((J)=>O.has(J)),A=`${H}\x00${j.join("\x00")}`,B=S(U,A,V);if(B!==void 0)return B||null;let M=[],w=new Set,_=new Set;for(let J of j)try{let Y=$.get(J)??await Bun.file(J).text(),L=P.basename(J,".ts");for(let X of Y.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])_.add(X[1]);try{for(let X of Z.scan(Y).exports)if(X!=="default")w.add(X)}catch{}Y=x(Y),Y=F(Y),Y=Y.replace(/^export\s+(default\s+)?/gm,""),Y=Z.transformSync(Y),M.push(`// Composable: ${L}
3
3
  ${Y.trim()}`)}catch(Y){console.warn(`[stx] Failed to load composable ${J}:`,Y)}if(M.length===0||w.size===0)return R(U,A,V,""),null;let h=[...w].map((J)=>` try { if (!(${JSON.stringify(J)} in __c)) __c[${JSON.stringify(J)}] = ${J}; } catch (e) {}`).join(`
4
4
  `),v=JSON.stringify([...w]),E=M.join(`
5
5
 
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Wf as a}from"./chunk-4ecv1e3w.js";import"./chunk-4vcyf1kh.js";import"./chunk-57atgbyq.js";import"./chunk-saqbtgqr.js";import"./chunk-e4g8wz6t.js";import"./chunk-c0n802j1.js";import"./chunk-gbkq5qnw.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";export{a as buildForProduction};
package/dist/cli.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-284ag6fs.js";import"./chunk-756dqqn1.js";import"./chunk-2ver2s2y.js";import"./chunk-3b9sxnty.js";import"./chunk-apa2v787.js";import"./chunk-p7ntrtaj.js";import"./chunk-ym3r8ktq.js";import"./chunk-tr9ynxdw.js";import"./chunk-m11pb9cx.js";import"./chunk-xe6zmdfq.js";import"./chunk-fx07kyz7.js";import"./chunk-ppp84wry.js";import"./chunk-57atgbyq.js";import"./chunk-8bxtvsgm.js";import"./chunk-95e1m9p8.js";import"./chunk-yne23w3c.js";import"./chunk-w72v0ab1.js";import"./chunk-18018jkn.js";import"./chunk-sqvqwd0p.js";import"./chunk-7r9vgzg4.js";import"./chunk-a959m68j.js";import"./chunk-1vb2rj09.js";import"./chunk-g6czgcg4.js";import"./chunk-6nde3nmc.js";import"./chunk-1z1efvtw.js";import"./chunk-vgfd9582.js";import"./chunk-qsbjtp60.js";import"./chunk-nf7k53ap.js";import"./chunk-zk6ghjnj.js";import"./chunk-bgrkxzr7.js";import"./chunk-8de19dmw.js";import"./chunk-7we3xfde.js";import"./chunk-5t8ersrw.js";import"./chunk-zg2hvb1j.js";import"./chunk-e4g8wz6t.js";import"./chunk-6es5r4az.js";import"./chunk-6zsc0z5a.js";import"./chunk-fa2mg49t.js";import"./chunk-axqfm9b4.js";import{$k as c,_k as u}from"./chunk-r5kr6jk4.js";import"./chunk-f476c9fb.js";import"./chunk-mjf3xmxn.js";import"./chunk-d964bsxm.js";import{$r as f}from"./chunk-d7zxg9bp.js";import"./chunk-t00ga194.js";import"./chunk-hrdd26r4.js";import"./chunk-7r79j1hs.js";import"./chunk-ay336sqb.js";import{Ds as A}from"./chunk-3agx4hyd.js";import"./chunk-vaggjvsm.js";import"./chunk-q9ckfwhh.js";import"./chunk-shtg7kah.js";import"./chunk-k3dtvay1.js";import"./chunk-aved735s.js";import"./chunk-799s9mwc.js";import"./chunk-7r80apc5.js";import"./chunk-2tjk867y.js";import"./chunk-t8ctvjqe.js";import"./chunk-deqnt1w5.js";import"./chunk-d6yyzpsv.js";import"./chunk-wb90259a.js";import{tw as B}from"./chunk-5g6rprcy.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.340";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
4
- Test run interrupted`),j.kill("SIGINT"),w.exit(1)})})}catch(K){return console.error("Error running tests:",K instanceof Error?K.message:String(K)),!1}}var Qb=w.argv.length>=3&&(jb(w.argv[2])&&L.existsSync(w.argv[2])||V(w.argv[2]));if(Qb){let J=w.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let K=3;K<w.argv.length;K++){let x=w.argv[K];if(x==="--port"&&K+1<w.argv.length){let b=h(w.argv[++K]);if(!b.isValid)S(b);Z.port=Number.parseInt(w.argv[K],10)}else if(x==="--no-watch")Z.watch=!1;else if(x==="--highlight-theme"&&K+1<w.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=w.argv[++K]}else if(x==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(x==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(x==="--no-cache")Z.cache=!1;else if(x==="--native")Z.native=!0}if(V(J))try{let K=await Array.fromAsync(new Bun.Glob(J).scan({onlyFiles:!0,absolute:!0})),x=J.endsWith(".stx")?K.filter((j)=>j.endsWith(".stx")):J.endsWith(".md")?K.filter((j)=>j.endsWith(".md")):K.filter((j)=>j.endsWith(".stx")||j.endsWith(".md")),b=J.split("*")[0].replace(/\/$/,"")||".",z=$.resolve(b);try{let j=new Bun.Glob("**/*.stx"),H=(await Array.fromAsync(j.scan({cwd:z,onlyFiles:!0,absolute:!0}))).filter((U)=>/\[.+\]/.test($.basename(U)));for(let U of H)if(!x.includes(U))x.push(U)}catch{}if(x.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${J}`),w.exit(1);if(!await v(x,Z))w.exit(1)}catch(K){console.error("Failed to process files:",K),w.exit(1)}else F(J,Z).catch((K)=>{console.error("Failed to start dev server:",K),w.exit(1)})}else{let J=function(x,b){let z=[];for(let k=0;k<=b.length;k++)z[k]=[k];for(let k=0;k<=x.length;k++)z[0][k]=k;for(let k=1;k<=b.length;k++)for(let j=1;j<=x.length;j++)if(b.charAt(k-1)===x.charAt(j-1))z[k][j]=z[k-1][j-1];else z[k][j]=Math.min(z[k-1][j-1]+1,z[k][j-1]+1,z[k-1][j]+1);return z[b.length][x.length]};E.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(x)=>{try{if(await r(x))console.log("Documentation generated successfully."),w.exit(0);else console.error("Documentation generation failed."),w.exit(1)}catch(b){console.error("Error generating documentation:",b),w.exit(1)}}),E.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(x,b)=>{try{let{fetchCollections:z,generatePackage:k}=await import("./chunk-7a21q2q4.js");if(x==="list"){console.log(`
3
+ import{Ha as a,He as F,Je as v,Ke as P,Va as r,de as s,ee as t,nb as n,o as m,oa as l,ob as p,qb as i,wb as e}from"./chunk-ntm1761b.js";import"./chunk-drs93sry.js";import"./chunk-2ver2s2y.js";import"./chunk-ebd3z4j9.js";import"./chunk-k9ep24bd.js";import"./chunk-567g1ttv.js";import"./chunk-ym3r8ktq.js";import"./chunk-y956wapy.js";import"./chunk-m39hb2a2.js";import"./chunk-74r1zw2h.js";import"./chunk-4ecv1e3w.js";import"./chunk-4vcyf1kh.js";import"./chunk-57atgbyq.js";import"./chunk-8bxtvsgm.js";import"./chunk-mkgbrbr9.js";import"./chunk-fm5211ec.js";import"./chunk-s4mmmwj4.js";import"./chunk-18018jkn.js";import"./chunk-sqvqwd0p.js";import"./chunk-7r9vgzg4.js";import"./chunk-a959m68j.js";import"./chunk-1vb2rj09.js";import"./chunk-g6czgcg4.js";import"./chunk-zv4nf0x2.js";import"./chunk-1z1efvtw.js";import"./chunk-vgfd9582.js";import"./chunk-qsbjtp60.js";import"./chunk-nf7k53ap.js";import"./chunk-zk6ghjnj.js";import"./chunk-bgrkxzr7.js";import"./chunk-ys56ecvx.js";import"./chunk-7we3xfde.js";import"./chunk-ytx17bg2.js";import"./chunk-saqbtgqr.js";import"./chunk-e4g8wz6t.js";import"./chunk-czvzaa42.js";import"./chunk-ghd80w8a.js";import"./chunk-byjy9far.js";import"./chunk-c0n802j1.js";import{al as u,bl as c}from"./chunk-4wpxbkbe.js";import"./chunk-gbkq5qnw.js";import"./chunk-fvsefztj.js";import"./chunk-j82hfkcf.js";import{ds as f}from"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import{Hs as A}from"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import{xw as B}from"./chunk-p5d8sb50.js";import{spawn as o}from"child_process";import L from"fs";import zb from"os";import $ from"path";import w from"process";import{CLI as wb}from"@stacksjs/clapp";var N="0.2.342";var __dirname="/home/runner/work/stx/stx/packages/stx/bin",E=new wb("stx");function h(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Port must be a valid number",suggestion:"Try using a number between 1024 and 65535"};if(Z<1024||Z>65535)return{isValid:!1,error:"Port must be between 1024 and 65535",suggestion:"Try using a port between 1024 and 65535"};return{isValid:!0}}function d(J){try{if(!L.existsSync(J)){let K=$.dirname(J),x=$.basename(J);if(L.existsSync(K)){let z=L.readdirSync(K).filter((j)=>j.toLowerCase().includes(x.toLowerCase().substring(0,3))||j.endsWith(".stx")||j.endsWith(".md")),k=z.length>0?`File not found. Similar files in ${K}: ${z.slice(0,3).join(", ")}`:`File not found. Directory ${K} exists but doesn't contain the specified file.`;return{isValid:!1,error:`File does not exist: ${J}`,suggestion:k}}return{isValid:!1,error:`File does not exist: ${J}`,suggestion:"Check the file path and try again"}}if(L.statSync(J).isDirectory())return{isValid:!1,error:`Expected file but got directory: ${J}`,suggestion:"Specify a .stx or .md file path"};return{isValid:!0}}catch(Z){return{isValid:!1,error:`Cannot access file: ${J}`,suggestion:"Check file permissions and path"}}}function y(J){let Z=typeof J==="string"?Number.parseInt(J,10):J;if(Number.isNaN(Z))return{isValid:!1,error:"Timeout must be a valid number",suggestion:"Specify timeout in milliseconds (e.g., 5000 for 5 seconds)"};if(Z<100)return{isValid:!1,error:"Timeout too short (minimum 100ms)",suggestion:"Use a timeout of at least 100ms"};if(Z>300000)return{isValid:!1,error:"Timeout too long (maximum 5 minutes)",suggestion:"Use a timeout of less than 300000ms (5 minutes)"};return{isValid:!0}}var V=(J)=>J.includes("*")||J.includes("?")||J.includes("{")||J.includes("["),jb=(J)=>J.endsWith(".stx")||J.endsWith(".md");function S(J,Z=1){if(console.error(`\u274C ${J.error}`),J.suggestion)console.error(`\uD83D\uDCA1 suggestion: ${J.suggestion}`);w.exit(Z)}function kb(J){if(!J)return;let Z;try{Z=JSON.parse(J)}catch(K){console.error(`\u274C --info-plist is not valid JSON: ${K.message}`),w.exit(1)}if(typeof Z!=="object"||Z===null||Array.isArray(Z))console.error(`\u274C --info-plist must be a JSON object, e.g. '{"NSFocusStatusUsageDescription":"\u2026"}'`),w.exit(1);for(let[K,x]of Object.entries(Z))if(typeof x!=="string"&&typeof x!=="number"&&typeof x!=="boolean")console.error(`\u274C --info-plist value for "${K}" must be a string, number or boolean`),w.exit(1);return Z}async function Hb(J,Z){try{let K=["test"],x=[];if(J&&J.length>0)for(let W of J)if(V(W))try{let H=await Array.fromAsync(new Bun.Glob(W).scan({onlyFiles:!0,absolute:!0}));if(H.length===0)console.warn(`Warning: No files found matching pattern: ${W}`);else if(x.push(...H),Z.verbose)console.log(`Found ${H.length} file(s) matching pattern: ${W}`)}catch(H){return console.error(`Error expanding glob pattern ${W}:`,H),!1}else x.push(W);if(x.length===0)return console.error("Error: No test files found matching the provided patterns."),!1;if(K.push(...x),Z.filter)K.push("--pattern",Z.filter);if(Z.timeout)K.push("--timeout",Z.timeout.toString());if(Z.reporter&&Z.reporter!=="default")if(Z.reporter==="junit"){let W=$.join(zb.tmpdir(),`stx-test-report-${Date.now()}.xml`);K.push("--reporter",Z.reporter),K.push("--reporter-outfile",W)}else console.warn(`Warning: Reporter '${Z.reporter}' is not supported. Using default reporter.`);if(Z.coverage)K.push("--coverage");if(Z.watch)K.push("--watch");K.push("--preload",$.join(__dirname,"../../../test-utils/happy-dom.ts"));let b={...w.env,STX_TEST_MODE:"true",STX_TEST_UI:Z.ui?"true":"false",STX_TEST_VERBOSE:Z.verbose?"true":"false"},z="bun";if(Z.verbose)console.log(`Running: ${z} ${K.join(" ")}`);let k=performance.now(),j=o(z,K,{stdio:"inherit",shell:!1,env:b});return new Promise((W)=>{j.on("close",(H)=>{let Y=((performance.now()-k)/1000).toFixed(2);if(H===0)W(!0);else W(!1)}),w.on("SIGINT",()=>{console.log(`
4
+ Test run interrupted`),j.kill("SIGINT"),w.exit(1)})})}catch(K){return console.error("Error running tests:",K instanceof Error?K.message:String(K)),!1}}var Qb=w.argv.length>=3&&(jb(w.argv[2])&&L.existsSync(w.argv[2])||V(w.argv[2]));if(Qb){let J=w.argv[2],Z={port:3000,watch:!0,cache:!0,markdown:{syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0}}};for(let K=3;K<w.argv.length;K++){let x=w.argv[K];if(x==="--port"&&K+1<w.argv.length){let b=h(w.argv[++K]);if(!b.isValid)S(b);Z.port=Number.parseInt(w.argv[K],10)}else if(x==="--no-watch")Z.watch=!1;else if(x==="--highlight-theme"&&K+1<w.argv.length){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.defaultTheme=w.argv[++K]}else if(x==="--no-highlight"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.enabled=!1}else if(x==="--no-highlight-unknown"){if(!Z.markdown)Z.markdown={};if(!Z.markdown.syntaxHighlighting)Z.markdown.syntaxHighlighting={};Z.markdown.syntaxHighlighting.highlightUnknownLanguages=!1}else if(x==="--no-cache")Z.cache=!1;else if(x==="--native")Z.native=!0}if(V(J))try{let K=await Array.fromAsync(new Bun.Glob(J).scan({onlyFiles:!0,absolute:!0})),x=J.endsWith(".stx")?K.filter((j)=>j.endsWith(".stx")):J.endsWith(".md")?K.filter((j)=>j.endsWith(".md")):K.filter((j)=>j.endsWith(".stx")||j.endsWith(".md")),b=J.split("*")[0].replace(/\/$/,"")||".",z=$.resolve(b);try{let j=new Bun.Glob("**/*.stx"),H=(await Array.fromAsync(j.scan({cwd:z,onlyFiles:!0,absolute:!0}))).filter((U)=>/\[.+\]/.test($.basename(U)));for(let U of H)if(!x.includes(U))x.push(U)}catch{}if(x.length===0)console.error(`Error: No STX or Markdown files found matching pattern: ${J}`),w.exit(1);if(!await v(x,Z))w.exit(1)}catch(K){console.error("Failed to process files:",K),w.exit(1)}else F(J,Z).catch((K)=>{console.error("Failed to start dev server:",K),w.exit(1)})}else{let J=function(x,b){let z=[];for(let k=0;k<=b.length;k++)z[k]=[k];for(let k=0;k<=x.length;k++)z[0][k]=k;for(let k=1;k<=b.length;k++)for(let j=1;j<=x.length;j++)if(b.charAt(k-1)===x.charAt(j-1))z[k][j]=z[k-1][j-1];else z[k][j]=Math.min(z[k-1][j-1]+1,z[k][j-1]+1,z[k-1][j]+1);return z[b.length][x.length]};E.command("docs","Generate documentation for components, templates, and directives").option("--output <dir>","Output directory for documentation",{default:"docs"}).option("--format <format>","Documentation format (markdown, html, json)",{default:"markdown"}).option("--components-dir <dir>","Components directory",{default:"components"}).option("--templates-dir <dir>","Templates directory",{default:"."}).option("--no-components","Disable components documentation").option("--no-templates","Disable templates documentation").option("--no-directives","Disable directives documentation").option("--extra-content <content>","Extra content to include in documentation").example("stx docs --output docs --format html").action(async(x)=>{try{if(await r(x))console.log("Documentation generated successfully."),w.exit(0);else console.error("Documentation generation failed."),w.exit(1)}catch(b){console.error("Error generating documentation:",b),w.exit(1)}}),E.command("iconify <command>","Generate Iconify icon packages").option("--output <dir>","Output directory for generated packages",{default:"packages"}).option("--icons <icons>","Comma-separated list of specific icons to generate").example("stx iconify list").example("stx iconify generate mdi").example("stx iconify generate lucide --icons home,settings,user").action(async(x,b)=>{try{let{fetchCollections:z,generatePackage:k}=await import("./chunk-5g9vbhbt.js");if(x==="list"){console.log(`
5
5
  \uD83D\uDCDA Fetching available icon collections...
6
6
  `);let j=await z(),W=Object.entries(j).sort((H,U)=>U[1].total-H[1].total);console.log(`Available collections:
7
7
  `);for(let[H,U]of W){let Y=U;console.log(` ${H.padEnd(30)} ${Y.name} (${Y.total} icons)`)}console.log(`
8
8
  Total: ${W.length} collections`)}else if(x.startsWith("generate")){let j=x==="generate"?"":x.replace("generate:","").replace("generate-","").replace("generate","").trim();if(!j)console.error("Error: Please specify a collection prefix"),console.error("Usage: stx iconify generate <prefix> [--icons icon1,icon2,...]"),w.exit(1);let W=b.output||$.join(w.cwd(),"packages/collections"),H=b.icons?b.icons.split(",").map((U)=>U.trim()):void 0;await k(j,W,H),console.log(`
9
9
  \u2713 Package generated successfully!`),console.log(`
10
- To use the package:`),console.log(` 1. cd packages/collections/iconify-${j}`),console.log(" 2. bun install"),console.log(" 3. bun run build")}else console.error(`Unknown iconify command: ${x}`),console.error("Available commands: list, generate"),w.exit(1)}catch(z){console.error("Error:",z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("pwa <command>","PWA tools - audit configuration and build output").option("--output <dir>","Build output directory to audit",{default:"dist"}).example("stx pwa audit").example("stx pwa audit --output build").action(async(x,b)=>{try{if(x==="audit"){let{runPwaAudit:z,formatAuditResult:k}=await import("./chunk-jwa2jhd8.js"),{loadConfig:j}=await import("./chunk-yz0d60px.js");console.log(`
10
+ To use the package:`),console.log(` 1. cd packages/collections/iconify-${j}`),console.log(" 2. bun install"),console.log(" 3. bun run build")}else console.error(`Unknown iconify command: ${x}`),console.error("Available commands: list, generate"),w.exit(1)}catch(z){console.error("Error:",z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("pwa <command>","PWA tools - audit configuration and build output").option("--output <dir>","Build output directory to audit",{default:"dist"}).example("stx pwa audit").example("stx pwa audit --output build").action(async(x,b)=>{try{if(x==="audit"){let{runPwaAudit:z,formatAuditResult:k}=await import("./chunk-mbstfjnj.js"),{loadConfig:j}=await import("./chunk-2p68bkza.js");console.log(`
11
11
  \uD83D\uDD0D Running PWA audit...
12
12
  `);let W=await j(),H=b.output||"dist",U=z(W,H);if(console.log(k(U)),U.failed>0)w.exit(1)}else console.error(`Unknown pwa command: ${x}`),console.error("Available commands: audit"),w.exit(1)}catch(z){console.error("Error:",z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("dev [file]","Start a development server for an STX app or file").option("--port <port>","Port to use for the dev server",{default:3000}).option("--pages <dir>",'Directory containing page templates (default: pagesDir from stx.config.ts, else "pages")').option("--no-watch","Disable file watching and auto-reload").option("--native","Open in a native desktop window using Zyte").option("--titlebar-hidden","Hide the native titlebar but keep the traffic-light buttons (web content draws under a transparent full-size titlebar). Implies --native.").option("--highlight-theme <theme>","Syntax highlighting theme for Markdown code blocks",{default:"github-dark"}).option("--no-highlight","Disable syntax highlighting for Markdown code blocks").option("--no-highlight-unknown","Disable syntax highlighting for unknown languages in Markdown").option("--no-cache","Disable caching of parsed files").option("--no-hmr","Disable HMR / live-reload script injection (useful for clean network traces)").option("--profile","Print per-directive timing for every page render via performanceMonitor").option("--debug-directives","Log directive ordering and intermediate template state during rendering").example("stx dev").example("stx dev --port 8080").example("stx dev --pages src/pages").example("stx dev template.stx").example("stx dev components/hero.stx --port 8080").example("stx dev **/*.stx").example("stx dev docs/guide.md").example("stx dev template.stx --native").action(async(x,b)=>{try{if(b.port!==void 0){let k=h(b.port);if(!k.isValid)S(k);b.port=Number.parseInt(String(b.port),10)}if(b.timeout!==void 0){let k=y(b.timeout);if(!k.isValid)S(k)}let z={syntaxHighlighting:{enabled:b.highlight!==!1,serverSide:!0,defaultTheme:b.highlightTheme||"github-dark",highlightUnknownLanguages:b.highlightUnknown!==!1}};if(!x){if(!await P(".",{port:b.port,watch:b.watch!==!1,native:b.native||b.titlebarHidden||!1,titlebarHidden:b.titlebarHidden===!0,cache:b.cache!==!1,hotReload:b.hmr!==!1,profile:b.profile===!0,debugDirectives:b.debugDirectives===!0,...b.pages&&{pagesDir:b.pages}}))w.exit(1);return}if(!V(x))try{let k=await import("fs");if(k.existsSync(x)&&k.statSync(x).isDirectory()){if(!await P(x,{port:b.port,watch:b.watch!==!1,native:b.native||b.titlebarHidden||!1,titlebarHidden:b.titlebarHidden===!0,cache:b.cache!==!1,hotReload:b.hmr!==!1,profile:b.profile===!0,debugDirectives:b.debugDirectives===!0,...b.pages&&{pagesDir:b.pages}}))w.exit(1);return}}catch{}if(V(x)){console.log(`Expanding glob pattern: ${x}`);let k=await A.timeAsync("glob-expansion",async()=>{return Array.fromAsync(new Bun.Glob(x).scan({onlyFiles:!0,absolute:!0}))}),j=x.endsWith(".stx")?k.filter((Y)=>Y.endsWith(".stx")):x.endsWith(".md")?k.filter((Y)=>Y.endsWith(".md")):k.filter((Y)=>Y.endsWith(".stx")||Y.endsWith(".md"));if(j.length===0)console.error(`No STX or Markdown files found matching pattern: ${x}`),console.error("Try using patterns like '*.stx' or 'components/**/*.stx'"),w.exit(1);let W=x.split("*")[0].replace(/\/$/,"")||".",H=$.resolve(W);try{let Y=new Bun.Glob("**/*.stx"),X=(await Array.fromAsync(Y.scan({cwd:H,onlyFiles:!0,absolute:!0}))).filter((_)=>/\[.+\]/.test($.basename(_)));for(let _ of X)if(!j.includes(_))j.push(_)}catch{}if(console.log(`Found ${j.length} ${j.length===1?"file":"files"} matching ${x}`),!await v(j,{port:b.port,watch:b.watch!==!1,native:b.native||b.titlebarHidden||!1,titlebarHidden:b.titlebarHidden===!0,markdown:z,cache:b.cache!==!1}))w.exit(1)}else{if(!V(x)){let j=d(x);if(!j.isValid)S(j)}if(!await F(x,{port:b.port,watch:b.watch!==!1,native:b.native||b.titlebarHidden||!1,titlebarHidden:b.titlebarHidden===!0,markdown:z,cache:b.cache!==!1}))w.exit(1)}}catch(z){console.error("Error starting dev server:",z),w.exit(1)}}),E.command("a11y [target]","Scan .stx files for accessibility issues (directory, file, or glob)").option("--no-recursive","Disable recursive scanning of directories").option("--ignore <paths>","Comma-separated paths to ignore",{default:""}).option("--json","Output results as JSON").option("--output <file>","Write results to a file instead of stdout").option("--fix","Automatically fix common accessibility issues").example("stx a11y ./templates").example('stx a11y "resources/**/*.stx"').example("stx a11y resources/emails/welcome.stx").example("stx a11y --json --output a11y-report.json").action(async(x=".",b)=>{try{console.log(`Scanning ${x} for accessibility issues...`);let z=b.ignore?b.ignore.split(",").map((U)=>U.trim()):[],{results:k,scannedFiles:j}=await f(x,{recursive:b.recursive!==!1,ignorePaths:z});if(j.length===0)console.log(`
13
13
  No .stx files matched ${x}
@@ -69,7 +69,7 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
69
69
  File not found: ${x}`),w.exit(1);if(!x.endsWith(".stx"))console.error(`
70
70
  File must have .stx extension: ${x}`),w.exit(1)}let k=$.resolve(b.pages),j=$.resolve(b.out);if(!x&&!L.existsSync(k))console.error(`
71
71
  Pages directory not found: ${k}`),console.log(`
72
- Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-6j6ek3j1.js");c();let H=await W({root:x?$.dirname(x):void 0,debug:b.verbose,ssg:{pagesDir:b.pages,outputDir:b.out,domain:b.domain,baseUrl:b.base,sitemap:b.sitemap,rss:b.rss,minify:b.minify,cache:b.cache!==!1,cleanOutput:b.clean,concurrency:Number.parseInt(b.concurrency,10)||10,publicDir:b.public,trailingSlash:b.trailingSlash,generate404:!0,hooks:b.verbose?{onPageStart:(Y)=>console.log(` Generating: ${Y}`),onPageEnd:(Y,Q)=>console.log(` Generated: ${Y} (${Q.length} bytes)`),onError:(Y,Q)=>console.error(` Error in ${Q}: ${Y.message}`)}:void 0},ssr:{outputDir:b.out==="dist"?".output":b.out,debug:b.verbose}}),U=((performance.now()-z)/1000).toFixed(2);if(H.mode==="ssr"&&H.ssr)console.log(`
72
+ Create a 'pages' directory with .stx files, or use --pages to specify a different directory.`),w.exit(1);let{buildApp:W}=await import("./chunk-ks4j8fjz.js");c();let H=await W({root:x?$.dirname(x):void 0,debug:b.verbose,ssg:{pagesDir:b.pages,outputDir:b.out,domain:b.domain,baseUrl:b.base,sitemap:b.sitemap,rss:b.rss,minify:b.minify,cache:b.cache!==!1,cleanOutput:b.clean,concurrency:Number.parseInt(b.concurrency,10)||10,publicDir:b.public,trailingSlash:b.trailingSlash,generate404:!0,hooks:b.verbose?{onPageStart:(Y)=>console.log(` Generating: ${Y}`),onPageEnd:(Y,Q)=>console.log(` Generated: ${Y} (${Q.length} bytes)`),onError:(Y,Q)=>console.error(` Error in ${Q}: ${Y.message}`)}:void 0},ssr:{outputDir:b.out==="dist"?".output":b.out,debug:b.verbose}}),U=((performance.now()-z)/1000).toFixed(2);if(H.mode==="ssr"&&H.ssr)console.log(`
73
73
  Build complete! (SSR)
74
74
  `),console.log(` Pages compiled: ${H.ssr.pageCount}`),console.log(` Output: ${H.ssr.outputDir}`),console.log(` Duration: ${U}s
75
75
  `);else if(H.ssg){if(console.log(`
@@ -84,8 +84,8 @@ Total: ${H} issues in ${W} files`),b.output){let U=`
84
84
  Build completed with ${H.ssg.failedCount} error(s). Fix the issues above and try again.
85
85
  `),w.exit(1);console.log(" To preview locally:"),console.log(` cd ${b.out||"dist"} && npx serve
86
86
  `)}}catch(z){console.error(`
87
- Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-g0059g3p.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){console.error(`
88
- Failed to start production server:`,b instanceof Error?b.message:String(b)),w.exit(1)}}),E.command("deploy [directory]","Deploy built site to Netlify").option("--site-id <id>","Netlify site ID (or set NETLIFY_SITE_ID env var)").option("--token <token>","Auth token (or set NETLIFY_AUTH_TOKEN env var)").option("--production","Deploy to production (default: draft preview)").option("--message <msg>","Deploy message/title").option("--no-build","Skip build step before deploy").option("--open","Open deployed URL in browser").option("--dry-run","Preview deployment without uploading").option("--init","Initialize Netlify configuration for this project").example("stx deploy").example("stx deploy --production").example("stx deploy dist --site-id my-site-abc123").example("stx deploy --init").example("stx deploy --dry-run").action(async(x,b)=>{try{let{deploy:z,initNetlify:k,DeployError:j}=await import("./chunk-b4cabzk9.js");if(console.log(`\x1B[1mstx deploy\x1B[0m \x1B[2mv${N}\x1B[0m`),b.init){console.log(`
87
+ Build failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("start","Start the production server (serves pre-built .output/)").option("--port <number>","Server port",{default:"3000"}).option("--output <dir>","Output directory from stx build",{default:".output"}).example("stx start").example("stx start --port 8080").action(async(x)=>{try{let b=$.resolve(x.output);if(!L.existsSync($.join(b,"manifest.json")))console.error("\n No production build found. Run `stx build --out .output` first.\n"),w.exit(1);let{startProductionServer:z}=await import("./chunk-exhbc57n.js");await z({outputDir:b,port:Number.parseInt(x.port,10)||3000})}catch(b){console.error(`
88
+ Failed to start production server:`,b instanceof Error?b.message:String(b)),w.exit(1)}}),E.command("deploy [directory]","Deploy built site to Netlify").option("--site-id <id>","Netlify site ID (or set NETLIFY_SITE_ID env var)").option("--token <token>","Auth token (or set NETLIFY_AUTH_TOKEN env var)").option("--production","Deploy to production (default: draft preview)").option("--message <msg>","Deploy message/title").option("--no-build","Skip build step before deploy").option("--open","Open deployed URL in browser").option("--dry-run","Preview deployment without uploading").option("--init","Initialize Netlify configuration for this project").example("stx deploy").example("stx deploy --production").example("stx deploy dist --site-id my-site-abc123").example("stx deploy --init").example("stx deploy --dry-run").action(async(x,b)=>{try{let{deploy:z,initNetlify:k,DeployError:j}=await import("./chunk-anf2y2h5.js");if(console.log(`\x1B[1mstx deploy\x1B[0m \x1B[2mv${N}\x1B[0m`),b.init){console.log(`
89
89
  \uD83D\uDCDD Initializing Netlify configuration...
90
90
  `);let H=await k({directory:x||w.cwd(),siteId:b.siteId});if(console.log(`\u2713 Created ${H.configPath}`),H.siteId)console.log("\u2713 Saved site ID to .env.local");console.log(`
91
91
  You can now deploy with: stx deploy`);return}if(b.build!==!1){if(console.log(`
@@ -97,7 +97,7 @@ You can now deploy with: stx deploy`);return}if(b.build!==!1){if(console.log(`
97
97
  `),console.log(` ${b.dryRun?"Would deploy":"Draft URL"}: ${W.url}`),W.siteUrl)console.log(` Site URL: ${W.siteUrl}`);if(!b.dryRun)console.log(`
98
98
  Deploy ID: ${W.deployId}`),console.log(` Duration: ${(W.duration/1000).toFixed(1)}s`),console.log(` Files: ${W.filesUploaded}`)}}catch(z){if(z instanceof Error&&z.name==="DeployError")console.error(`
99
99
  \u274C ${z.message}`),w.exit(1);console.error(`
100
- \u274C Deploy failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("images <input>","Optimize images for production").option("-o, --output <dir>","Output directory",{default:"dist/images"}).option("-w, --widths <sizes>","Output widths (comma-separated)",{default:"320,640,768,1024,1280,1536,1920"}).option("-f, --formats <types>","Output formats (comma-separated)",{default:"webp,jpeg"}).option("-q, --quality <n>","Output quality (1-100)",{default:"80"}).option("--placeholder <type>","Placeholder type: blur, dominant-color, none",{default:"none"}).option("--dry-run","Preview without processing").option("--verbose","Show detailed output").example("stx images public/images").example("stx images public/images -o dist/images").example("stx images public/images --widths 640,1024,1920").example("stx images public/images --formats webp,avif").example("stx images public/images --quality 85").example("stx images public/images --dry-run").action(async(x,b)=>{try{let{optimizeDirectory:z,isSharpAvailable:k,formatSize:j}=await import("./chunk-r10fypcd.js"),W=await import("fs"),H=await import("path");if(console.log(`\x1B[1mstx images\x1B[0m \x1B[2mv${N}\x1B[0m`),!await k())console.error(`
100
+ \u274C Deploy failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("images <input>","Optimize images for production").option("-o, --output <dir>","Output directory",{default:"dist/images"}).option("-w, --widths <sizes>","Output widths (comma-separated)",{default:"320,640,768,1024,1280,1536,1920"}).option("-f, --formats <types>","Output formats (comma-separated)",{default:"webp,jpeg"}).option("-q, --quality <n>","Output quality (1-100)",{default:"80"}).option("--placeholder <type>","Placeholder type: blur, dominant-color, none",{default:"none"}).option("--dry-run","Preview without processing").option("--verbose","Show detailed output").example("stx images public/images").example("stx images public/images -o dist/images").example("stx images public/images --widths 640,1024,1920").example("stx images public/images --formats webp,avif").example("stx images public/images --quality 85").example("stx images public/images --dry-run").action(async(x,b)=>{try{let{optimizeDirectory:z,isSharpAvailable:k,formatSize:j}=await import("./chunk-2swnc8kg.js"),W=await import("fs"),H=await import("path");if(console.log(`\x1B[1mstx images\x1B[0m \x1B[2mv${N}\x1B[0m`),!await k())console.error(`
101
101
  \u274C sharp is required for image optimization.`),console.log(`
102
102
  Install sharp with:`),console.log(" bun add sharp"),w.exit(1);let Y=b.widths.split(",").map((G)=>Number.parseInt(G.trim(),10)).filter((G)=>!Number.isNaN(G)),Q=b.formats.split(",").map((G)=>G.trim().toLowerCase()),X=Number.parseInt(b.quality,10)||80,_=b.placeholder,q=H.resolve(x);if(!W.existsSync(q))console.error(`
103
103
  \u274C Input directory not found: ${q}`),w.exit(1);if(!W.statSync(q).isDirectory())console.error(`
@@ -110,7 +110,7 @@ Would generate ~${bb} image variants`);return}console.log(`
110
110
  `);let M=await z(q,b.output,{widths:Y,formats:Q,quality:X,placeholder:_,verbose:b.verbose});if(console.log(`
111
111
  \u2713 Optimization complete!
112
112
  `),console.log(` Images processed: ${M.stats.optimizedImages}/${M.stats.totalImages}`),console.log(` Variants created: ${M.stats.variants}`),M.stats.savedBytes>0)console.log(` Estimated savings: ~${j(M.stats.savedBytes)}`)}catch(z){console.error(`
113
- \u274C Image optimization failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("bundle [directory]","Analyze bundle size and composition").option("-o, --output <file>","Output file path").option("--json","Output as JSON").option("--text","Output as text summary").option("--markdown","Output as Markdown").option("--no-open","Do not open HTML report in browser").option("--no-gzip","Do not show gzip sizes").option("--threshold <size>","Fail if total size exceeds threshold (e.g., 500KB, 1MB)").option("--top <n>","Number of top modules to show",{default:"20"}).example("stx bundle").example("stx bundle dist/").example("stx bundle dist/ --json").example("stx bundle dist/ --text").example("stx bundle dist/ --threshold 500KB").example("stx bundle dist/ --no-open").action(async(x,b)=>{try{let{analyze:z,formatBytes:k,parseSize:j}=await import("./chunk-066yt1hy.js"),W=await import("path");console.log(`\x1B[1mstx bundle\x1B[0m \x1B[2mv${N}\x1B[0m`);let H=x||"dist",U=W.resolve(H);if(!(await import("fs")).existsSync(U))console.error(`
113
+ \u274C Image optimization failed:`,z instanceof Error?z.message:String(z)),w.exit(1)}}),E.command("bundle [directory]","Analyze bundle size and composition").option("-o, --output <file>","Output file path").option("--json","Output as JSON").option("--text","Output as text summary").option("--markdown","Output as Markdown").option("--no-open","Do not open HTML report in browser").option("--no-gzip","Do not show gzip sizes").option("--threshold <size>","Fail if total size exceeds threshold (e.g., 500KB, 1MB)").option("--top <n>","Number of top modules to show",{default:"20"}).example("stx bundle").example("stx bundle dist/").example("stx bundle dist/ --json").example("stx bundle dist/ --text").example("stx bundle dist/ --threshold 500KB").example("stx bundle dist/ --no-open").action(async(x,b)=>{try{let{analyze:z,formatBytes:k,parseSize:j}=await import("./chunk-tmj45xq5.js"),W=await import("path");console.log(`\x1B[1mstx bundle\x1B[0m \x1B[2mv${N}\x1B[0m`);let H=x||"dist",U=W.resolve(H);if(!(await import("fs")).existsSync(U))console.error(`
114
114
  \u274C Directory not found: ${U}`),console.log("\nRun `stx build` first to generate build output."),w.exit(1);let Q="html";if(b.json)Q="json";else if(b.text)Q="text";else if(b.markdown)Q="markdown";console.log(`
115
115
  \uD83D\uDCE6 Analyzing: ${U}`);let X=await z({directory:U,output:b.output,format:Q,open:b.open!==!1&&Q==="html",gzip:b.gzip!==!1,threshold:b.threshold,topModules:Number.parseInt(b.top||"20",10),recommendations:!0});if(Q==="html"){if(console.log(`
116
116
  \u2713 Report generated: ${X.outputPath}`),b.open!==!1)console.log(" Opening in browser...")}else console.log(X.report);if(X.exceedsThreshold){let _=b.threshold;console.error(`
@@ -124,7 +124,7 @@ To view it in the development server:`),console.log(` stx dev ${x}
124
124
  \uD83D\uDCDD ${$.relative(w.cwd(),Q)}:`),console.log("--- Original"),console.log("+++ Formatted"),console.log(`@@ Changes in ${$.basename(Q)} @@`),console.log("+ Formatted content would be applied");else await Bun.write(Q,q),console.log(`\u2705 Formatted ${$.relative(w.cwd(),Q)}`),U++}catch(X){console.error(`\u274C Error formatting ${$.relative(w.cwd(),Q)}:`,X),Y++}if(b.check&&Y>0)console.log(`
125
125
  ${Y} files need formatting. Run 'stx format' to fix.`),w.exit(1);else if(!b.check&&!b.diff)console.log(`\u2728 Formatted ${U} files successfully`)}catch(z){console.error("Error formatting files:",z),w.exit(1)}}),E.command("perf [command...]","Show performance statistics for STX operations").option("--clear","Clear performance statistics").option("--json","Output as JSON").example("stx perf").example("stx perf --clear").example("stx perf --json").action(async(x,b)=>{try{if(b.clear){A.clear(),console.log("\u2705 Performance statistics cleared");return}let z=A.getStats();if(Object.keys(z).length===0){if(b.json){console.log(JSON.stringify({},null,2));return}console.log("No performance data available. Run some STX commands first.");return}if(b.json)console.log(JSON.stringify(z,null,2));else{console.log(`
126
126
  \uD83D\uDCCA STX Performance Statistics
127
- `);for(let[k,j]of Object.entries(z))console.log(`\uD83D\uDD27 ${k}:`),console.log(` Count: ${j.count}`),console.log(` Average: ${j.avgTime.toFixed(2)}ms`),console.log(` Total: ${j.totalTime.toFixed(2)}ms`),console.log(` Min: ${j.minTime.toFixed(2)}ms`),console.log(` Max: ${j.maxTime.toFixed(2)}ms`),console.log("")}}catch(z){console.error("Error showing performance stats:",z),w.exit(1)}}),E.command("typecheck [patterns...]","Type-check the TypeScript inside .stx script blocks").option("--no-client","Skip <script client> and bare <script> blocks").option("--no-server","Skip <script server> blocks").option("--no-templates","Skip {{ }} and directive expressions in the markup").option("--lib <path>","Extra ambient declaration file (repeatable)").example("stx typecheck").example('stx typecheck "resources/views/**/*.stx"').action(async(x,b)=>{let{formatTypecheckDiagnostics:z,typecheckStxFiles:k}=await import("./chunk-h7hnzwd0.js"),{resolveStxTargets:j}=await import("./chunk-zzfpwxpp.js"),W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx"],U=await j(H);if(U.length===0){console.log(`
127
+ `);for(let[k,j]of Object.entries(z))console.log(`\uD83D\uDD27 ${k}:`),console.log(` Count: ${j.count}`),console.log(` Average: ${j.avgTime.toFixed(2)}ms`),console.log(` Total: ${j.totalTime.toFixed(2)}ms`),console.log(` Min: ${j.minTime.toFixed(2)}ms`),console.log(` Max: ${j.maxTime.toFixed(2)}ms`),console.log("")}}catch(z){console.error("Error showing performance stats:",z),w.exit(1)}}),E.command("typecheck [patterns...]","Type-check the TypeScript inside .stx script blocks").option("--no-client","Skip <script client> and bare <script> blocks").option("--no-server","Skip <script server> blocks").option("--no-templates","Skip {{ }} and directive expressions in the markup").option("--lib <path>","Extra ambient declaration file (repeatable)").example("stx typecheck").example('stx typecheck "resources/views/**/*.stx"').action(async(x,b)=>{let{formatTypecheckDiagnostics:z,typecheckStxFiles:k}=await import("./chunk-h47e1c03.js"),{resolveStxTargets:j}=await import("./chunk-vk2j3vvs.js"),W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx"],U=await j(H);if(U.length===0){console.log(`
128
128
  No .stx files matched ${H.join(", ")}
129
129
  `);return}let Y=m(w.argv,"--lib"),Q=Y.length>0?Y:b.lib?Array.isArray(b.lib)?b.lib:[b.lib]:[],X=await k(U,{client:b.client!==!1,server:b.server!==!1,templates:b.templates!==!1,extraLibs:Q});if(X.failure)console.error(`
130
130
  Type-check did not run.
@@ -135,8 +135,8 @@ ${Y} files need formatting. Run 'stx format' to fix.`),w.exit(1);else if(!b.chec
135
135
  `),w.exit(2);let _=X.diagnostics.filter((q)=>q.category==="error");if(X.diagnostics.length>0)console.error(`
136
136
  ${z(X.diagnostics)}
137
137
  `);if(console.log(` Checked ${X.blockCount} script block(s) and ${X.expressionCount} template expression(s) in ${X.checkedFiles.length} file(s) \u2014 `+`${_.length} error(s), ${X.diagnostics.length-_.length} warning(s)
138
- `),_.length>0)w.exit(1)}),E.command("codemod [patterns...]","Find hand-rolled code that an stx primitive already covers").option("--fix","Write the safe rewrites (default is report-only)").option("--rule <rule>","Run one rule only: confirm | tooltip (rewritable) \xB7 alert | route-params | search-params | navigate | "+"fetch | polling | debounce | click-outside | focus | clipboard | watch (report-only)").example("stx codemod").example("stx codemod --rule route-params").example('stx codemod --fix "resources/views/**/*.stx"').action(async(x,b)=>{let{codemodSource:z,formatCodemodFindings:k}=await import("./chunk-d3kjaae0.js"),j=globalThis.Bun.Glob,W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx","**/*.ts"],U=b.rule?[b.rule]:void 0;if(b.rule&&b.rule!=="confirm"&&b.rule!=="tooltip")console.error(`Unknown rule "${b.rule}". Expected: confirm | tooltip`),w.exit(1);let Y=new Set,Q=[],X=0,_=new Set;try{let q=Bun.spawnSync(["git","ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:w.cwd(),stdout:"pipe",stderr:"pipe"});for(let O of new TextDecoder().decode(q.stdout).split("\x00"))if(O)_.add($.resolve(w.cwd(),O))}catch{}for(let q of H)for await(let O of new j(q).scan({cwd:w.cwd(),absolute:!0})){if(O.includes("/node_modules/")||O.includes("/dist/")||Y.has(O)||_.has(O))continue;Y.add(O);let M=await Bun.file(O).text(),G=z(M,{file:O,rules:U});if(Q.push(...G.findings),b.fix&&G.code!==M)await Bun.write(O,G.code),X++}if(console.error(k(Q,Boolean(b.fix))),b.fix)console.error(`
139
- ${X} file(s) written.`)}),E.command("doctor","Diagnose the stx framework-runtime resolution + staleness chain").option("--json","Output the report as JSON").example("stx doctor").example("stx doctor --json").action(async(x)=>{try{let b;try{b=(await import("./chunk-pxw0cpxe.js")).generateSignalsRuntime}catch{b=void 0}let z=await s({generateRuntime:b});if(x.json)console.log(JSON.stringify(z,null,2));else console.log(t(z));if(!z.ok)w.exit(1)}catch(b){console.error("Error running doctor:",b),w.exit(1)}}),E.command("debug <file>","Debug STX template processing step by step").option("--step","Step through processing stages interactively").option("--verbose","Show detailed processing information").option("--context <data>","JSON string of context data to use").option("--save-report <file>","Save debug report to file").example("stx debug template.stx").example("stx debug template.stx --step").example(`stx debug template.stx --context '{"name": "John", "items": [1,2,3]}'`).action(async(x,b)=>{try{let z=d(x);if(!z.isValid)S(z);console.log(`\uD83D\uDD0D Debugging stx template: ${x}
138
+ `),_.length>0)w.exit(1)}),E.command("codemod [patterns...]","Find hand-rolled code that an stx primitive already covers").option("--fix","Write the safe rewrites (default is report-only)").option("--rule <rule>","Run one rule only: confirm | tooltip (rewritable) \xB7 alert | route-params | search-params | navigate | "+"fetch | polling | debounce | click-outside | focus | clipboard | watch (report-only)").example("stx codemod").example("stx codemod --rule route-params").example('stx codemod --fix "resources/views/**/*.stx"').action(async(x,b)=>{let{codemodSource:z,formatCodemodFindings:k}=await import("./chunk-1gwbw81h.js"),j=globalThis.Bun.Glob,W=Array.isArray(x)?x:x?[x]:[],H=W.length?W:["**/*.stx","**/*.ts"],U=b.rule?[b.rule]:void 0;if(b.rule&&b.rule!=="confirm"&&b.rule!=="tooltip")console.error(`Unknown rule "${b.rule}". Expected: confirm | tooltip`),w.exit(1);let Y=new Set,Q=[],X=0,_=new Set;try{let q=Bun.spawnSync(["git","ls-files","--others","--ignored","--exclude-standard","-z"],{cwd:w.cwd(),stdout:"pipe",stderr:"pipe"});for(let O of new TextDecoder().decode(q.stdout).split("\x00"))if(O)_.add($.resolve(w.cwd(),O))}catch{}for(let q of H)for await(let O of new j(q).scan({cwd:w.cwd(),absolute:!0})){if(O.includes("/node_modules/")||O.includes("/dist/")||Y.has(O)||_.has(O))continue;Y.add(O);let M=await Bun.file(O).text(),G=z(M,{file:O,rules:U});if(Q.push(...G.findings),b.fix&&G.code!==M)await Bun.write(O,G.code),X++}if(console.error(k(Q,Boolean(b.fix))),b.fix)console.error(`
139
+ ${X} file(s) written.`)}),E.command("doctor","Diagnose the stx framework-runtime resolution + staleness chain").option("--json","Output the report as JSON").example("stx doctor").example("stx doctor --json").action(async(x)=>{try{let b;try{b=(await import("./chunk-rr49zrz6.js")).generateSignalsRuntime}catch{b=void 0}let z=await s({generateRuntime:b});if(x.json)console.log(JSON.stringify(z,null,2));else console.log(t(z));if(!z.ok)w.exit(1)}catch(b){console.error("Error running doctor:",b),w.exit(1)}}),E.command("debug <file>","Debug STX template processing step by step").option("--step","Step through processing stages interactively").option("--verbose","Show detailed processing information").option("--context <data>","JSON string of context data to use").option("--save-report <file>","Save debug report to file").example("stx debug template.stx").example("stx debug template.stx --step").example(`stx debug template.stx --context '{"name": "John", "items": [1,2,3]}'`).action(async(x,b)=>{try{let z=d(x);if(!z.isValid)S(z);console.log(`\uD83D\uDD0D Debugging stx template: ${x}
140
140
  `);let k={};if(b.context)try{k=JSON.parse(b.context)}catch(H){console.error("\u274C Invalid JSON in --context option"),w.exit(1)}let j=await Bun.file(x).text();console.log(`\uD83D\uDCC4 Template Content (${j.length} chars):`),console.log("\u2500".repeat(50)),console.log(j.substring(0,500)+(j.length>500?`
141
141
  ...
142
142
  `:"")),console.log("\u2500".repeat(50));let W=j.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(W)console.log(`
@@ -159,12 +159,12 @@ Press Ctrl+C to stop watching...
159
159
  \uD83D\uDCDD ${$.relative(w.cwd(),Q.file)}`),console.log(` Lines: ${Q.metrics.lines} | Complexity: ${Q.metrics.complexity}/10 | Estimated render: ${Q.performance.estimatedRenderTime}ms`),Q.issues.length>0){let X=Q.issues.filter((_)=>j[_.type]>=W);if(X.length>0)console.log(` Issues (${X.length}):`),X.forEach((_)=>{let q=_.type==="error"?"\u274C":_.type==="warning"?"\u26A0\uFE0F":"\u2139\uFE0F";if(console.log(` ${q} ${_.message}`),_.suggestion)console.log(` \uD83D\uDCA1 ${_.suggestion}`)})}if(Q.suggestions.length>0)console.log(` Suggestions (${Q.suggestions.length}):`),Q.suggestions.forEach((X)=>{let _=X.impact==="high"?"\uD83D\uDD25":X.impact==="medium"?"\u26A1":"\uD83D\uDCAB";console.log(` ${_} ${X.message} (${X.impact} impact, ${X.effort} effort)`)})}}else if(Y.length>0&&!b.onlyIssues)console.log(`
160
160
  \uD83D\uDCC4 Files with issues:`),Y.forEach((Q)=>{let X=Q.issues.filter((_)=>j[_.type]>=W).length;if(X>0)console.log(` ${$.relative(w.cwd(),Q.file)} (${X} issues)`)});if(b.saveReport){let Q={summary:U,results:Y,generatedAt:new Date().toISOString(),commandOptions:b};await Bun.write(b.saveReport,JSON.stringify(Q,null,2)),console.log(`
161
161
  \uD83D\uDCCB Analysis report saved to: ${b.saveReport}`)}console.log(`
162
- \u2728 Analysis complete! Use --detailed for more information.`)}catch(z){console.error("Error analyzing templates:",z),w.exit(1)}}),E.command("screenshot [input]","Capture PNG screenshot(s) of page(s) via Bun WebView \u2014 a file, URL, or dist directory").option("--out <dir>","Output directory",{default:"screenshots"}).option("--width <px>","Viewport width",{default:"1440"}).option("--height <px>","Viewport height",{default:"2200"}).option("--wait <ms>","Settle time after navigation before capture",{default:"800"}).option("--timeout <ms>","Hard cap on waiting for navigation",{default:"15000"}).option("--full-page","Capture the entire scrollable page, not just the viewport").option("--wait-selector <sel>","Wait until a CSS selector exists before capturing").option("--format <fmt>","Image format: png | jpeg | webp",{default:"png"}).option("--backend <name>","WebView backend: webkit (macOS, default) | chrome").action(async(x,b)=>{let{captureScreenshots:z}=await import("./chunk-zj039s33.js"),k=x||"dist";try{let j=await z(k,b.out,{width:Number.parseInt(b.width,10),height:Number.parseInt(b.height,10),waitMs:Number.parseInt(b.wait,10),timeoutMs:Number.parseInt(b.timeout,10),fullPage:Boolean(b.fullPage),waitSelector:b.waitSelector,format:b.format,backend:b.backend});for(let W of j)console.log(`\uD83D\uDCF8 ${W.output} (${(W.bytes/1024).toFixed(0)} KB)`);console.log(`
163
- \u2728 Captured ${j.length} screenshot(s) to ${b.out}/ via Bun WebView`)}catch(j){console.error(`Screenshot failed: ${j.message}`),w.exit(1)}}),E.command("version","Show the version of the CLI").action(()=>{console.log(N)}),E.command("interactive","Start interactive REPL mode for template development").alias("i").option("--context <file>","Load initial context from JSON file").option("--cwd <directory>","Set working directory").option("--verbose","Show verbose output").action(async(x)=>{let{startInteractive:b}=await import("./chunk-gf6t4419.js"),z={};if(x.context){let k=$.resolve(x.context);if(L.existsSync(k))try{let j=L.readFileSync(k,"utf-8");z=JSON.parse(j)}catch(j){console.error("Error loading context file:",j),w.exit(1)}else console.error(`Context file not found: ${k}`),w.exit(1)}await b({context:z,cwd:x.cwd?$.resolve(x.cwd):w.cwd(),verbose:x.verbose})}),E.command("build:native <input>","Build stx template into a native desktop/mobile app").option("--output <dir>","Output directory",{default:"dist/native"}).option("--target <platform>","Target platform: macos, windows, linux, ios, android").option("--format <format>","Output format: app, dmg, pkg, msi, zip, deb, rpm, appimage, ipa, apk").option("--name <name>","Application name (defaults to filename)").option("--version <version>","Application version",{default:"1.0.0"}).option("--description <desc>","Application description").option("--author <author>","Author/Maintainer name").option("--bundle-id <id>","Bundle identifier (macOS/iOS)").option("--icon <path>","Path to application icon").option("--width <width>","Window width",{default:"1200"}).option("--height <height>","Window height",{default:"800"}).option("--title <title>","Window title").option("--system-tray","Enable system tray/menubar mode").option("--menubar-only","Run without a dock icon (implied by --system-tray)").option("--category <type>","LSApplicationCategoryType (macOS)").option("--copyright <text>","NSHumanReadableCopyright (macOS)").option("--min-system-version <v>","LSMinimumSystemVersion (macOS)").option("--info-plist <json>","Extra Info.plist keys as a JSON object (macOS)").option("--dev-tools","Enable developer tools").option("--frameless","Create frameless window").option("--always-on-top","Keep window always on top").option("--craft-path <path>","Path to Craft binary").option("--verbose","Show verbose output").example("stx build:native app.stx --target macos").example("stx build:native app.stx --target macos --format dmg").example("stx build:native app.stx --target linux --format appimage").example('stx build:native app.stx --name "My App" --icon icon.png').action(async(x,b)=>{try{let{buildNative:z,getAvailableTargets:k,getAvailableFormats:j}=await import("./chunk-x80ahcnw.js"),W=$.resolve(x);if(!L.existsSync(W))console.error(`\u274C Input file not found: ${x}`),w.exit(1);let H=k();if(b.target&&!["macos","windows","linux","ios","android"].includes(b.target))console.error(`\u274C Invalid target: ${b.target}`),console.error("\uD83D\uDCA1 Available targets: macos, windows, linux, ios, android"),console.error(`\uD83D\uDCA1 Targets available on this machine: ${H.join(", ")}`),w.exit(1);let U=b.target||H[0],Y=j(U);if(b.format&&!Y.includes(b.format))console.error(`\u274C Invalid format for ${U}: ${b.format}`),console.error(`\uD83D\uDCA1 Available formats: ${Y.join(", ")}`),w.exit(1);console.log(`
162
+ \u2728 Analysis complete! Use --detailed for more information.`)}catch(z){console.error("Error analyzing templates:",z),w.exit(1)}}),E.command("screenshot [input]","Capture PNG screenshot(s) of page(s) via Bun WebView \u2014 a file, URL, or dist directory").option("--out <dir>","Output directory",{default:"screenshots"}).option("--width <px>","Viewport width",{default:"1440"}).option("--height <px>","Viewport height",{default:"2200"}).option("--wait <ms>","Settle time after navigation before capture",{default:"800"}).option("--timeout <ms>","Hard cap on waiting for navigation",{default:"15000"}).option("--full-page","Capture the entire scrollable page, not just the viewport").option("--wait-selector <sel>","Wait until a CSS selector exists before capturing").option("--format <fmt>","Image format: png | jpeg | webp",{default:"png"}).option("--backend <name>","WebView backend: webkit (macOS, default) | chrome").action(async(x,b)=>{let{captureScreenshots:z}=await import("./chunk-kznb3hdj.js"),k=x||"dist";try{let j=await z(k,b.out,{width:Number.parseInt(b.width,10),height:Number.parseInt(b.height,10),waitMs:Number.parseInt(b.wait,10),timeoutMs:Number.parseInt(b.timeout,10),fullPage:Boolean(b.fullPage),waitSelector:b.waitSelector,format:b.format,backend:b.backend});for(let W of j)console.log(`\uD83D\uDCF8 ${W.output} (${(W.bytes/1024).toFixed(0)} KB)`);console.log(`
163
+ \u2728 Captured ${j.length} screenshot(s) to ${b.out}/ via Bun WebView`)}catch(j){console.error(`Screenshot failed: ${j.message}`),w.exit(1)}}),E.command("version","Show the version of the CLI").action(()=>{console.log(N)}),E.command("interactive","Start interactive REPL mode for template development").alias("i").option("--context <file>","Load initial context from JSON file").option("--cwd <directory>","Set working directory").option("--verbose","Show verbose output").action(async(x)=>{let{startInteractive:b}=await import("./chunk-xer5kn26.js"),z={};if(x.context){let k=$.resolve(x.context);if(L.existsSync(k))try{let j=L.readFileSync(k,"utf-8");z=JSON.parse(j)}catch(j){console.error("Error loading context file:",j),w.exit(1)}else console.error(`Context file not found: ${k}`),w.exit(1)}await b({context:z,cwd:x.cwd?$.resolve(x.cwd):w.cwd(),verbose:x.verbose})}),E.command("build:native <input>","Build stx template into a native desktop/mobile app").option("--output <dir>","Output directory",{default:"dist/native"}).option("--target <platform>","Target platform: macos, windows, linux, ios, android").option("--format <format>","Output format: app, dmg, pkg, msi, zip, deb, rpm, appimage, ipa, apk").option("--name <name>","Application name (defaults to filename)").option("--version <version>","Application version",{default:"1.0.0"}).option("--description <desc>","Application description").option("--author <author>","Author/Maintainer name").option("--bundle-id <id>","Bundle identifier (macOS/iOS)").option("--icon <path>","Path to application icon").option("--width <width>","Window width",{default:"1200"}).option("--height <height>","Window height",{default:"800"}).option("--title <title>","Window title").option("--system-tray","Enable system tray/menubar mode").option("--menubar-only","Run without a dock icon (implied by --system-tray)").option("--category <type>","LSApplicationCategoryType (macOS)").option("--copyright <text>","NSHumanReadableCopyright (macOS)").option("--min-system-version <v>","LSMinimumSystemVersion (macOS)").option("--info-plist <json>","Extra Info.plist keys as a JSON object (macOS)").option("--dev-tools","Enable developer tools").option("--frameless","Create frameless window").option("--always-on-top","Keep window always on top").option("--craft-path <path>","Path to Craft binary").option("--verbose","Show verbose output").example("stx build:native app.stx --target macos").example("stx build:native app.stx --target macos --format dmg").example("stx build:native app.stx --target linux --format appimage").example('stx build:native app.stx --name "My App" --icon icon.png').action(async(x,b)=>{try{let{buildNative:z,getAvailableTargets:k,getAvailableFormats:j}=await import("./chunk-fhhp6pmx.js"),W=$.resolve(x);if(!L.existsSync(W))console.error(`\u274C Input file not found: ${x}`),w.exit(1);let H=k();if(b.target&&!["macos","windows","linux","ios","android"].includes(b.target))console.error(`\u274C Invalid target: ${b.target}`),console.error("\uD83D\uDCA1 Available targets: macos, windows, linux, ios, android"),console.error(`\uD83D\uDCA1 Targets available on this machine: ${H.join(", ")}`),w.exit(1);let U=b.target||H[0],Y=j(U);if(b.format&&!Y.includes(b.format))console.error(`\u274C Invalid format for ${U}: ${b.format}`),console.error(`\uD83D\uDCA1 Available formats: ${Y.join(", ")}`),w.exit(1);console.log(`
164
164
  \uD83D\uDD28 Building native app...`),console.log(` Input: ${x}`),console.log(` Target: ${U}`),console.log(` Format: ${b.format||"default"}`),console.log(` Output: ${b.output}
165
165
  `);let Q=await z({input:W,output:$.resolve(b.output),target:U,format:b.format,name:b.name,version:b.version,description:b.description,author:b.author,bundleId:b.bundleId,icon:b.icon?$.resolve(b.icon):void 0,window:{title:b.title,width:Number.parseInt(b.width,10),height:Number.parseInt(b.height,10),frameless:b.frameless,alwaysOnTop:b.alwaysOnTop},systemTray:b.systemTray,menubarOnly:b.menubarOnly,category:b.category,copyright:b.copyright,minimumSystemVersion:b.minSystemVersion,infoPlist:kb(b.infoPlist),devTools:b.devTools,craftPath:b.craftPath,verbose:b.verbose});if(Q.success){if(console.log("\u2705 Build successful!"),console.log(` Output: ${Q.outputPath}`),Q.duration)console.log(` Duration: ${(Q.duration/1000).toFixed(2)}s`);if(U==="macos"&&Q.format==="app")console.log(`
166
166
  \uD83D\uDCA1 To run: open "${Q.outputPath}"`);else if(U==="linux"&&Q.format==="appimage")console.log(`
167
- \uD83D\uDCA1 To run: chmod +x "${Q.outputPath}" && "${Q.outputPath}"`)}else console.error(`\u274C Build failed: ${Q.error}`),w.exit(1)}catch(z){console.error(`\u274C Build error: ${z.message}`),w.exit(1)}}),E.command("story","Start component showcase and testing server").option("-p, --port <port>","Server port",{default:"6006"}).option("-o, --open","Open browser automatically",{default:!1}).option("--host <host>","Host to bind to",{default:"localhost"}).example("stx story").example("stx story --port 3000 --open").action(async(x)=>{try{let{devCommand:b}=await import("./chunk-yxpr7h26.js");await b({port:x.port?Number.parseInt(x.port,10):6006,open:x.open,host:x.host})}catch(b){console.error(`\u274C Story error: ${b.message}`),w.exit(1)}}),E.command("story:build","Build static story site").option("-o, --outDir <dir>","Output directory",{default:".stx/dist/story"}).example("stx story:build").example("stx story:build --outDir ./docs/components").action(async(x)=>{try{let{buildCommand:b}=await import("./chunk-nvp546bb.js");await b({outDir:x.outDir})}catch(b){console.error(`\u274C Story build error: ${b.message}`),w.exit(1)}}),E.command("story:test","Run visual regression tests").option("-u, --update","Update snapshots",{default:!1}).option("-f, --filter <name>","Filter components by name").example("stx story:test").example("stx story:test --update").example("stx story:test --filter Button").action(async(x)=>{try{let{createContext:b}=await import("./chunk-vxt5c5aq.js"),{runVisualTests:z,updateSnapshots:k,formatTestResults:j}=await import("./chunk-m46edxtt.js"),W=await b({mode:"build"});if(x.update){let H=await k(W,{filter:x.filter?[x.filter]:void 0});console.log(`Updated ${H} snapshots`)}else{let H=await z(W,{filter:x.filter?[x.filter]:void 0});if(console.log(j(H)),H.failed>0)w.exit(1)}}catch(b){console.error(`\u274C Story test error: ${b.message}`),w.exit(1)}}),E.command("compile <input>","Compile stx template to native Craft component code").option("--target <platform>","Target platform: macos, windows, linux, ios, android, universal",{default:"universal"}).option("--format <format>","Output format: zig, typescript, json",{default:"zig"}).option("--output <path>","Output directory for compiled files",{default:"./dist"}).option("--optimize","Enable optimizations",{default:!0}).option("--tree-shake","Enable tree shaking",{default:!0}).option("--hot-reload","Enable hot reload support",{default:!1}).option("--sourcemaps","Generate source maps",{default:!1}).option("--bundle","Bundle all dependencies",{default:!0}).option("--minify","Minify output",{default:!1}).option("--verbose","Show detailed output",{default:!1}).example("stx compile app.stx").example("stx compile app.stx --target macos --format zig").example("stx compile app.stx --format typescript --output ./native").example("stx compile app.stx --optimize --tree-shake --minify").action(async(x,b)=>{try{let{compileToNative:z}=await import("./chunk-nwz43t6d.js"),k=$.resolve(x);if(!L.existsSync(k))console.error(`\u274C Input file not found: ${x}`),w.exit(1);let j=["macos","windows","linux","ios","android","universal"];if(!j.includes(b.target))console.error(`\u274C Invalid target: ${b.target}`),console.error(`\uD83D\uDCA1 Available targets: ${j.join(", ")}`),w.exit(1);let W=["zig","typescript","json"];if(!W.includes(b.format))console.error(`\u274C Invalid format: ${b.format}`),console.error(`\uD83D\uDCA1 Available formats: ${W.join(", ")}`),w.exit(1);console.log(`
167
+ \uD83D\uDCA1 To run: chmod +x "${Q.outputPath}" && "${Q.outputPath}"`)}else console.error(`\u274C Build failed: ${Q.error}`),w.exit(1)}catch(z){console.error(`\u274C Build error: ${z.message}`),w.exit(1)}}),E.command("story","Start component showcase and testing server").option("-p, --port <port>","Server port",{default:"6006"}).option("-o, --open","Open browser automatically",{default:!1}).option("--host <host>","Host to bind to",{default:"localhost"}).example("stx story").example("stx story --port 3000 --open").action(async(x)=>{try{let{devCommand:b}=await import("./chunk-d389vyyz.js");await b({port:x.port?Number.parseInt(x.port,10):6006,open:x.open,host:x.host})}catch(b){console.error(`\u274C Story error: ${b.message}`),w.exit(1)}}),E.command("story:build","Build static story site").option("-o, --outDir <dir>","Output directory",{default:".stx/dist/story"}).example("stx story:build").example("stx story:build --outDir ./docs/components").action(async(x)=>{try{let{buildCommand:b}=await import("./chunk-48x5bsqv.js");await b({outDir:x.outDir})}catch(b){console.error(`\u274C Story build error: ${b.message}`),w.exit(1)}}),E.command("story:test","Run visual regression tests").option("-u, --update","Update snapshots",{default:!1}).option("-f, --filter <name>","Filter components by name").example("stx story:test").example("stx story:test --update").example("stx story:test --filter Button").action(async(x)=>{try{let{createContext:b}=await import("./chunk-c33y19bn.js"),{runVisualTests:z,updateSnapshots:k,formatTestResults:j}=await import("./chunk-fx29n4vc.js"),W=await b({mode:"build"});if(x.update){let H=await k(W,{filter:x.filter?[x.filter]:void 0});console.log(`Updated ${H} snapshots`)}else{let H=await z(W,{filter:x.filter?[x.filter]:void 0});if(console.log(j(H)),H.failed>0)w.exit(1)}}catch(b){console.error(`\u274C Story test error: ${b.message}`),w.exit(1)}}),E.command("compile <input>","Compile stx template to native Craft component code").option("--target <platform>","Target platform: macos, windows, linux, ios, android, universal",{default:"universal"}).option("--format <format>","Output format: zig, typescript, json",{default:"zig"}).option("--output <path>","Output directory for compiled files",{default:"./dist"}).option("--optimize","Enable optimizations",{default:!0}).option("--tree-shake","Enable tree shaking",{default:!0}).option("--hot-reload","Enable hot reload support",{default:!1}).option("--sourcemaps","Generate source maps",{default:!1}).option("--bundle","Bundle all dependencies",{default:!0}).option("--minify","Minify output",{default:!1}).option("--verbose","Show detailed output",{default:!1}).example("stx compile app.stx").example("stx compile app.stx --target macos --format zig").example("stx compile app.stx --format typescript --output ./native").example("stx compile app.stx --optimize --tree-shake --minify").action(async(x,b)=>{try{let{compileToNative:z}=await import("./chunk-3b0mgxbk.js"),k=$.resolve(x);if(!L.existsSync(k))console.error(`\u274C Input file not found: ${x}`),w.exit(1);let j=["macos","windows","linux","ios","android","universal"];if(!j.includes(b.target))console.error(`\u274C Invalid target: ${b.target}`),console.error(`\uD83D\uDCA1 Available targets: ${j.join(", ")}`),w.exit(1);let W=["zig","typescript","json"];if(!W.includes(b.format))console.error(`\u274C Invalid format: ${b.format}`),console.error(`\uD83D\uDCA1 Available formats: ${W.join(", ")}`),w.exit(1);console.log(`
168
168
  \uD83D\uDD27 Compiling stx template to native code...`),console.log(` Input: ${x}`),console.log(` Target: ${b.target}`),console.log(` Format: ${b.format}`),console.log(` Output: ${b.output}
169
169
  `);let H=L.readFileSync(k,"utf-8"),U=await z(H,{target:b.target,format:b.format,optimize:b.optimize,treeShake:b.treeShake,hotReload:b.hotReload,debug:b.verbose,sourceMaps:b.sourcemaps,bundle:b.bundle,minify:b.minify}),Y=$.resolve(b.output);if(!L.existsSync(Y))L.mkdirSync(Y,{recursive:!0});let Q=$.basename(x,$.extname(x)),X=b.format==="typescript"?"ts":b.format==="json"?"json":"zig",_=$.join(Y,`${Q}.${X}`);L.writeFileSync(_,U.code);let q=$.join(Y,`${Q}.manifest.json`);if(L.writeFileSync(q,JSON.stringify(U.manifest,null,2)),b.sourcemaps&&U.sourceMaps){let O=$.join(Y,`${Q}.${X}.map`);L.writeFileSync(O,U.sourceMaps)}if(b.target==="universal"&&U.platformCode.size>0)for(let[O,M]of U.platformCode){let G=$.join(Y,`${Q}.${O}.${X}`);L.writeFileSync(G,M)}if(console.log("\u2705 Compilation successful!"),console.log(` Output: ${_}`),console.log(` Manifest: ${q}`),console.log(`
170
170
  \uD83D\uDCCA Statistics:`),console.log(` Compilation time: ${U.stats.compilationTime.toFixed(2)}ms`),console.log(` Total components: ${U.stats.totalComponents}`),console.log(` Native components: ${U.stats.nativeComponents}`),console.log(` Web fallback components: ${U.stats.webComponents}`),console.log(` Bundle size: ${(U.stats.bundleSize/1024).toFixed(2)}KB`),U.stats.warnings.length>0){console.log(`
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import fs from "node:fs";
3
- import { asInvocableStatement } from "./events.js";
3
+ import { asInvocableStatement, listensPassively } from "./events.js";
4
4
  import { transformStoreImports } from "./store-imports.js";
5
5
  import { bracketDepths, findInterpolationEnd, stripCommentsAndLiterals } from "./strip-literals.js";
6
6
  export { findInterpolationEnd, stripCommentsAndLiterals } from "./strip-literals.js";
@@ -520,7 +520,7 @@ function generateSingleEventBinding(binding, index) {
520
520
  options.push("once: true");
521
521
  if (modifiers.capture)
522
522
  options.push("capture: true");
523
- if (modifiers.passive)
523
+ if (listensPassively(event, modifiers))
524
524
  options.push("passive: true");
525
525
  const optionsStr = options.length > 0 ? `, { ${options.join(", ")} }` : "";
526
526
  let handlerBody = "";
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Vj as Nj,Wj as wj,Xj as Aj}from"./chunk-xy4jt4ek.js";import{$j as Yj,Zj as Uj,_j as Xj,ak as Zj,bk as _j,ck as $j,dk as qj,ek as Fj,fk as Oj,gk as Vj,hk as Ij,ik as Qj,jk as Wj,kk as Kj}from"./chunk-hq9fa4pe.js";import"./chunk-6zsc0z5a.js";import"./chunk-d964bsxm.js";import"./chunk-d7zxg9bp.js";import"./chunk-t00ga194.js";import"./chunk-hrdd26r4.js";import"./chunk-7r79j1hs.js";import"./chunk-ay336sqb.js";import"./chunk-3agx4hyd.js";import"./chunk-vaggjvsm.js";import"./chunk-q9ckfwhh.js";import"./chunk-shtg7kah.js";import"./chunk-k3dtvay1.js";import"./chunk-aved735s.js";import"./chunk-799s9mwc.js";import"./chunk-7r80apc5.js";import"./chunk-2tjk867y.js";import"./chunk-t8ctvjqe.js";import"./chunk-deqnt1w5.js";import"./chunk-d6yyzpsv.js";import"./chunk-wb90259a.js";import"./chunk-5g6rprcy.js";var I=new Map,Q=new Map;function L(j,B){let G=B?.id||g(j),J=h(j),U=I.get(G);if(U&&U.hash===J)return U;let X=S(j),Z=y(j),Y=T(j),_=v(X),{staticParts:q,dynamicParts:$}=C(X),F=u(j),O={id:G,hash:J,tree:X,scripts:Z,styles:Y,staticParts:q,dynamicParts:$,dependencies:F,metadata:_};return I.set(G,O),O}async function r(j,B={},G={}){let J=performance.now();if(G.cache){let Y=`${j.id}:${JSON.stringify(B)}`,_=Q.get(Y);if(_&&Date.now()-_.timestamp<(G.cacheTTL||60000))return{html:_.html,styles:j.styles.join(`
2
+ import{Xj as Nj,Yj as wj,Zj as Aj}from"./chunk-f5cw54q3.js";import{$j as Uj,ak as Xj,bk as Yj,ck as Zj,dk as _j,ek as $j,fk as qj,gk as Fj,hk as Oj,ik as Vj,jk as Ij,kk as Qj,lk as Wj,mk as Kj}from"./chunk-25f0s8t1.js";import"./chunk-ghd80w8a.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";var I=new Map,Q=new Map;function L(j,B){let G=B?.id||g(j),J=h(j),U=I.get(G);if(U&&U.hash===J)return U;let X=S(j),Z=y(j),Y=T(j),_=v(X),{staticParts:q,dynamicParts:$}=C(X),F=u(j),O={id:G,hash:J,tree:X,scripts:Z,styles:Y,staticParts:q,dynamicParts:$,dependencies:F,metadata:_};return I.set(G,O),O}async function r(j,B={},G={}){let J=performance.now();if(G.cache){let Y=`${j.id}:${JSON.stringify(B)}`,_=Q.get(Y);if(_&&Date.now()-_.timestamp<(G.cacheTTL||60000))return{html:_.html,styles:j.styles.join(`
3
3
  `),scripts:j.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:_.html.length,componentCount:j.metadata.componentCount}}}let U;if(G.streaming)U=await H(j.tree,B);else U=W(j.tree,B);let X;if(G.hydrate){let Y=k(U,j,B);U=Y.html,X=Y.data}if(G.minify)U=x(U);if(G.cache){let Y=`${j.id}:${JSON.stringify(B)}`;Q.set(Y,{html:U,timestamp:Date.now()})}let Z=performance.now()-J;return{html:U,styles:j.styles.join(`
5
5
  `),scripts:j.scripts.join(`
package/dist/craft.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Vj as Nj,Wj as wj,Xj as Aj}from"./chunk-xy4jt4ek.js";import{$j as Yj,Zj as Uj,_j as Xj,ak as Zj,bk as _j,ck as $j,dk as qj,ek as Fj,fk as Oj,gk as Vj,hk as Ij,ik as Qj,jk as Wj,kk as Kj}from"./chunk-hq9fa4pe.js";import"./chunk-6zsc0z5a.js";import"./chunk-d964bsxm.js";import"./chunk-d7zxg9bp.js";import"./chunk-t00ga194.js";import"./chunk-hrdd26r4.js";import"./chunk-7r79j1hs.js";import"./chunk-ay336sqb.js";import"./chunk-3agx4hyd.js";import"./chunk-vaggjvsm.js";import"./chunk-q9ckfwhh.js";import"./chunk-shtg7kah.js";import"./chunk-k3dtvay1.js";import"./chunk-aved735s.js";import"./chunk-799s9mwc.js";import"./chunk-7r80apc5.js";import"./chunk-2tjk867y.js";import"./chunk-t8ctvjqe.js";import"./chunk-deqnt1w5.js";import"./chunk-d6yyzpsv.js";import"./chunk-wb90259a.js";import"./chunk-5g6rprcy.js";var I=new Map,Q=new Map;function L(j,B){let G=B?.id||g(j),J=h(j),U=I.get(G);if(U&&U.hash===J)return U;let X=S(j),Z=y(j),Y=T(j),_=v(X),{staticParts:q,dynamicParts:$}=C(X),F=u(j),O={id:G,hash:J,tree:X,scripts:Z,styles:Y,staticParts:q,dynamicParts:$,dependencies:F,metadata:_};return I.set(G,O),O}async function r(j,B={},G={}){let J=performance.now();if(G.cache){let Y=`${j.id}:${JSON.stringify(B)}`,_=Q.get(Y);if(_&&Date.now()-_.timestamp<(G.cacheTTL||60000))return{html:_.html,styles:j.styles.join(`
2
+ import{Xj as Nj,Yj as wj,Zj as Aj}from"./chunk-f5cw54q3.js";import{$j as Uj,ak as Xj,bk as Yj,ck as Zj,dk as _j,ek as $j,fk as qj,gk as Fj,hk as Oj,ik as Vj,jk as Ij,kk as Qj,lk as Wj,mk as Kj}from"./chunk-25f0s8t1.js";import"./chunk-ghd80w8a.js";import"./chunk-j82hfkcf.js";import"./chunk-rh7mwwb4.js";import"./chunk-1t3j8a0q.js";import"./chunk-01ggk8k8.js";import"./chunk-25b8z7xa.js";import"./chunk-hk8j3eps.js";import"./chunk-xe93ae3r.js";import"./chunk-1spzqjve.js";import"./chunk-f2qbjr3z.js";import"./chunk-1xwfws06.js";import"./chunk-r1rfwm01.js";import"./chunk-ahpmjg3f.js";import"./chunk-bt8w146r.js";import"./chunk-6p6b01kp.js";import"./chunk-x7dv5rq7.js";import"./chunk-e0kzyf1g.js";import"./chunk-wv8h3d68.js";import"./chunk-beextc84.js";import"./chunk-yr7camcd.js";import"./chunk-p5d8sb50.js";var I=new Map,Q=new Map;function L(j,B){let G=B?.id||g(j),J=h(j),U=I.get(G);if(U&&U.hash===J)return U;let X=S(j),Z=y(j),Y=T(j),_=v(X),{staticParts:q,dynamicParts:$}=C(X),F=u(j),O={id:G,hash:J,tree:X,scripts:Z,styles:Y,staticParts:q,dynamicParts:$,dependencies:F,metadata:_};return I.set(G,O),O}async function r(j,B={},G={}){let J=performance.now();if(G.cache){let Y=`${j.id}:${JSON.stringify(B)}`,_=Q.get(Y);if(_&&Date.now()-_.timestamp<(G.cacheTTL||60000))return{html:_.html,styles:j.styles.join(`
3
3
  `),scripts:j.scripts.join(`
4
4
  `),metadata:{renderTime:0,cacheHit:!0,totalSize:_.html.length,componentCount:j.metadata.componentCount}}}let U;if(G.streaming)U=await H(j.tree,B);else U=W(j.tree,B);let X;if(G.hydrate){let Y=k(U,j,B);U=Y.html,X=Y.data}if(G.minify)U=x(U);if(G.cache){let Y=`${j.id}:${JSON.stringify(B)}`;Q.set(Y,{html:U,timestamp:Date.now()})}let Z=performance.now()-J;return{html:U,styles:j.styles.join(`
5
5
  `),scripts:j.scripts.join(`