@stacksjs/stx 0.2.503 → 0.2.506

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 (198) hide show
  1. package/dist/browser-core-imports.d.ts +1 -1
  2. package/dist/browser-core-imports.js +1 -2
  3. package/dist/builtins/attrs.d.ts +2 -0
  4. package/dist/builtins/attrs.js +102 -0
  5. package/dist/{chunk-3mynjdqr.js → chunk-068ank60.js} +3 -3
  6. package/dist/{chunk-yvt8zszz.js → chunk-06v0c3fz.js} +1 -1
  7. package/dist/chunk-0eptxhzy.js +2 -0
  8. package/dist/{chunk-15w4adyd.js → chunk-0vnr7mz7.js} +8 -8
  9. package/dist/{chunk-bv7bsdfe.js → chunk-1149d93e.js} +2 -2
  10. package/dist/chunk-1b7dd8rn.js +2 -0
  11. package/dist/{chunk-0egg3666.js → chunk-1verz406.js} +5 -5
  12. package/dist/{chunk-7cbtcdqw.js → chunk-2etevws0.js} +2 -2
  13. package/dist/chunk-2h4bf7m4.js +2 -0
  14. package/dist/{chunk-z9fz5dby.js → chunk-2j04bc8c.js} +2 -2
  15. package/dist/{chunk-40jd0b4h.js → chunk-2wr0sk42.js} +1 -1
  16. package/dist/chunk-36rwfhnb.js +2 -0
  17. package/dist/{chunk-b5mcvm6y.js → chunk-38xtsdk9.js} +6 -6
  18. package/dist/chunk-3c9t71pc.js +2 -0
  19. package/dist/chunk-3pczp9c0.js +2 -0
  20. package/dist/{chunk-jwjggr91.js → chunk-3ynfz6h8.js} +2 -2
  21. package/dist/{chunk-1v86h5vn.js → chunk-46wre9ep.js} +3 -3
  22. package/dist/{chunk-rhrv2j36.js → chunk-4hz4g5ym.js} +2 -2
  23. package/dist/chunk-4w358hpx.js +2 -0
  24. package/dist/{chunk-33snwgdy.js → chunk-5dh041x0.js} +3 -3
  25. package/dist/{chunk-802qf0vz.js → chunk-5q9rmcp7.js} +1 -1
  26. package/dist/{chunk-qmcmjdy7.js → chunk-5tbqdz94.js} +7 -7
  27. package/dist/{chunk-zv0vgamy.js → chunk-5tkzfw4s.js} +3 -3
  28. package/dist/{chunk-25m2wqsd.js → chunk-5zm23zrb.js} +38 -12
  29. package/dist/{chunk-szry3s17.js → chunk-68tzytfz.js} +3 -3
  30. package/dist/chunk-76g4jw9g.js +2 -0
  31. package/dist/{chunk-93sr9q8g.js → chunk-7p6y0b47.js} +1 -1
  32. package/dist/chunk-7sjmpfwy.js +18 -0
  33. package/dist/chunk-7z28hk7r.js +2 -0
  34. package/dist/chunk-8nx5asjr.js +2 -0
  35. package/dist/chunk-8ptefdpy.js +2 -0
  36. package/dist/{chunk-cp7hph6f.js → chunk-8xpyzcq2.js} +1 -1
  37. package/dist/chunk-8zj1ebs5.js +2 -0
  38. package/dist/{chunk-c8psbk2e.js → chunk-91y360rc.js} +1 -1
  39. package/dist/chunk-96kr2xrt.js +2828 -0
  40. package/dist/{chunk-b77v56fz.js → chunk-9p3rtfbv.js} +9 -9
  41. package/dist/chunk-9xw416q3.js +2 -0
  42. package/dist/chunk-9z76qhdm.js +2 -0
  43. package/dist/{chunk-zqxqdns1.js → chunk-9z8mxp15.js} +1 -1
  44. package/dist/chunk-ag1j84s6.js +2 -0
  45. package/dist/{chunk-d4k4nyj0.js → chunk-ba88n1j7.js} +2 -2
  46. package/dist/chunk-c2vwq6gr.js +2 -0
  47. package/dist/{chunk-2kyfaa0p.js → chunk-c322rrge.js} +2 -2
  48. package/dist/chunk-cb1c9mvc.js +2 -0
  49. package/dist/chunk-ces3vdjp.js +2 -0
  50. package/dist/{chunk-stvqwzen.js → chunk-cprcfp0j.js} +2 -2
  51. package/dist/chunk-dn4tww9q.js +2 -0
  52. package/dist/chunk-dne8n6h3.js +3 -0
  53. package/dist/chunk-dv94gdv4.js +2 -0
  54. package/dist/chunk-e4zks32s.js +2 -0
  55. package/dist/{chunk-h0sd5cda.js → chunk-ea19gveh.js} +5 -5
  56. package/dist/{chunk-tvag2s5a.js → chunk-eacd5755.js} +1 -1
  57. package/dist/{chunk-8fb1mqw1.js → chunk-ej46bkaw.js} +1 -1
  58. package/dist/{chunk-1hpttjgq.js → chunk-fh5rp6wb.js} +1 -1
  59. package/dist/chunk-fkv8jmse.js +2 -0
  60. package/dist/{chunk-vtn0gmen.js → chunk-fwvqbx49.js} +8 -8
  61. package/dist/chunk-g1r4v0mc.js +3 -0
  62. package/dist/{chunk-2pph3dh0.js → chunk-g495xx4v.js} +5 -5
  63. package/dist/{chunk-vp827ah7.js → chunk-g7wgpys2.js} +4 -4
  64. package/dist/chunk-gw9ax7xx.js +2 -0
  65. package/dist/{chunk-4ssg2hn4.js → chunk-h37bbgg8.js} +1 -1
  66. package/dist/chunk-h3rrsq05.js +2 -0
  67. package/dist/{chunk-z6nm6rf1.js → chunk-h6z4s5p3.js} +1 -1
  68. package/dist/chunk-h87zhtw8.js +2 -0
  69. package/dist/chunk-h9reptxv.js +45 -0
  70. package/dist/{chunk-vs0ebfg5.js → chunk-hka18tmt.js} +1 -1
  71. package/dist/chunk-j08y5n2k.js +2 -0
  72. package/dist/chunk-j7nd8zfe.js +2 -0
  73. package/dist/{chunk-z9tvn738.js → chunk-jcmgj8kk.js} +1 -1
  74. package/dist/chunk-jtwx2xte.js +2 -0
  75. package/dist/{chunk-gvkfydq5.js → chunk-k2331dfx.js} +1 -1
  76. package/dist/chunk-k5syze27.js +2 -0
  77. package/dist/{chunk-258qj7pt.js → chunk-km9g9drp.js} +1 -1
  78. package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
  79. package/dist/chunk-kxvtyh05.js +2 -0
  80. package/dist/chunk-mq6expbd.js +2 -0
  81. package/dist/chunk-mvqhf6dn.js +2 -0
  82. package/dist/chunk-mz7snf2b.js +2 -0
  83. package/dist/chunk-n1hd2fx6.js +2 -0
  84. package/dist/{chunk-298s08st.js → chunk-n34kagea.js} +2 -2
  85. package/dist/chunk-nnrtwpvy.js +2 -0
  86. package/dist/chunk-pecwdp57.js +2 -0
  87. package/dist/{chunk-tdetcthb.js → chunk-ph1xz7k5.js} +2 -2
  88. package/dist/chunk-pj562qnx.js +2 -0
  89. package/dist/chunk-pzcw3trh.js +2 -0
  90. package/dist/{chunk-4mrgy3ve.js → chunk-qt31at4s.js} +4 -4
  91. package/dist/{chunk-4c1afy15.js → chunk-qv57r0fa.js} +1 -1
  92. package/dist/{chunk-qhnpc3ac.js → chunk-r14mvycg.js} +22 -22
  93. package/dist/chunk-r5fzxtbc.js +2 -0
  94. package/dist/{chunk-vg9dyc4y.js → chunk-rvwtyrj4.js} +1 -1
  95. package/dist/{chunk-dve4q9tg.js → chunk-s87qrma5.js} +3 -3
  96. package/dist/chunk-spg0fzyv.js +2 -0
  97. package/dist/{chunk-hqvdm4h9.js → chunk-t77pz252.js} +1 -1
  98. package/dist/chunk-t7djn7zd.js +2 -0
  99. package/dist/{chunk-tse7jzmz.js → chunk-tf239jvd.js} +1 -1
  100. package/dist/{chunk-gzt3ghgq.js → chunk-tkagcknf.js} +2 -2
  101. package/dist/{chunk-xevnx24r.js → chunk-tnxprz69.js} +2 -2
  102. package/dist/{chunk-81t6zr3m.js → chunk-v74acg2k.js} +2 -2
  103. package/dist/{chunk-f0prq6yw.js → chunk-vc1m5fr9.js} +1 -1
  104. package/dist/{chunk-jbvg29t0.js → chunk-vftdacyb.js} +1 -1
  105. package/dist/{chunk-hktvv0hd.js → chunk-vtxzaj1h.js} +2 -2
  106. package/dist/chunk-w925gtgg.js +2 -0
  107. package/dist/chunk-w9kj6t7s.js +2 -0
  108. package/dist/{chunk-b90y5phw.js → chunk-w9mxt96c.js} +78 -78
  109. package/dist/{chunk-d19vgjjt.js → chunk-x81vcxzs.js} +2 -2
  110. package/dist/{chunk-rmavqxd8.js → chunk-xd4zvm4x.js} +2 -2
  111. package/dist/{chunk-x8mp9yvn.js → chunk-xemsypk7.js} +4 -4
  112. package/dist/{chunk-71bbv43t.js → chunk-xx2pk2ay.js} +3 -3
  113. package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
  114. package/dist/chunk-yn2d8x8m.js +3 -0
  115. package/dist/{chunk-hmyyq2hh.js → chunk-z2775k8r.js} +1 -1
  116. package/dist/{chunk-1erc0vrb.js → chunk-zz5b1g50.js} +2 -2
  117. package/dist/cli.js +44 -44
  118. package/dist/component-renderer.js +84 -36
  119. package/dist/composables/index.d.ts +4 -0
  120. package/dist/composables/index.js +5 -1
  121. package/dist/composables/use-timer.d.ts +8 -0
  122. package/dist/composables/use-timer.js +4 -0
  123. package/dist/config.js +24 -7
  124. package/dist/craft-entry.js +2 -2
  125. package/dist/craft.js +2 -2
  126. package/dist/native/bridge/protocol.d.ts +3 -0
  127. package/dist/native/cli.d.ts +1 -0
  128. package/dist/native/cli.js +7 -2
  129. package/dist/native/compiler/bundle.d.ts +1 -0
  130. package/dist/native/compiler/bundle.js +27 -7
  131. package/dist/native/compiler/html-to-ir.d.ts +3 -1
  132. package/dist/native/compiler/html-to-ir.js +13 -0
  133. package/dist/native/runtime/craft-bridge.js +9 -1
  134. package/dist/native/runtime/craft.d.ts +2 -0
  135. package/dist/native/runtime/native-host.d.ts +1 -0
  136. package/dist/native/runtime/native-host.js +1 -0
  137. package/dist/native/runtime/shared-screen.d.ts +21 -0
  138. package/dist/native/runtime/shared-screen.js +43 -0
  139. package/dist/pwa.js +3 -3
  140. package/dist/runtime-globals.js +4 -0
  141. package/dist/signals.js +34 -8
  142. package/dist/ssg.js +2 -2
  143. package/dist/stx-module.d.ts +4 -0
  144. package/dist/stx.d.ts +8 -0
  145. package/dist/utils.d.ts +3 -1
  146. package/dist/utils.js +12 -2
  147. package/package.json +6 -6
  148. package/stx-module.d.ts +4 -0
  149. package/stx.d.ts +8 -0
  150. package/dist/chunk-0adrp7qd.js +0 -2
  151. package/dist/chunk-0vdxchfw.js +0 -2
  152. package/dist/chunk-1mrn5s5z.js +0 -2
  153. package/dist/chunk-2gr5zcm3.js +0 -2
  154. package/dist/chunk-2grygc4b.js +0 -2
  155. package/dist/chunk-379nn8yc.js +0 -2
  156. package/dist/chunk-3vqabd10.js +0 -2
  157. package/dist/chunk-490f2x2r.js +0 -2
  158. package/dist/chunk-4j2ej7er.js +0 -2
  159. package/dist/chunk-4rmdngzw.js +0 -2
  160. package/dist/chunk-52saa2nj.js +0 -2
  161. package/dist/chunk-69dc3tyz.js +0 -2
  162. package/dist/chunk-6v3p6cx1.js +0 -2
  163. package/dist/chunk-78vfptph.js +0 -2
  164. package/dist/chunk-7e6sxdp6.js +0 -2
  165. package/dist/chunk-7wxmsv41.js +0 -2
  166. package/dist/chunk-8qdvhbv7.js +0 -18
  167. package/dist/chunk-9mh1qq3g.js +0 -2
  168. package/dist/chunk-9z70zv10.js +0 -33
  169. package/dist/chunk-b0bgprzs.js +0 -2
  170. package/dist/chunk-c7cajwd2.js +0 -2
  171. package/dist/chunk-cg8hg6cs.js +0 -3
  172. package/dist/chunk-ckrpk6ak.js +0 -2
  173. package/dist/chunk-en0atzsp.js +0 -2
  174. package/dist/chunk-fxppbahx.js +0 -2
  175. package/dist/chunk-hhj1txvj.js +0 -2
  176. package/dist/chunk-j2q2pp0x.js +0 -2
  177. package/dist/chunk-jbj6xh7f.js +0 -3
  178. package/dist/chunk-jh385m2w.js +0 -2
  179. package/dist/chunk-kxg9q64a.js +0 -2
  180. package/dist/chunk-m9nr12a1.js +0 -2828
  181. package/dist/chunk-mdfrm5hv.js +0 -2
  182. package/dist/chunk-mq7vvaf4.js +0 -2
  183. package/dist/chunk-nfffn3s0.js +0 -2
  184. package/dist/chunk-nw7qvyek.js +0 -2
  185. package/dist/chunk-ny64ezsj.js +0 -2
  186. package/dist/chunk-qjba655t.js +0 -2
  187. package/dist/chunk-qjxxd4a0.js +0 -2
  188. package/dist/chunk-qsy7phd4.js +0 -2
  189. package/dist/chunk-rfq1jfhf.js +0 -2
  190. package/dist/chunk-rr41gk8b.js +0 -2
  191. package/dist/chunk-snyq0jj6.js +0 -2
  192. package/dist/chunk-sybzayv3.js +0 -2
  193. package/dist/chunk-v7vkqg8f.js +0 -3
  194. package/dist/chunk-v8m2khkq.js +0 -2
  195. package/dist/chunk-vbhykx9z.js +0 -2
  196. package/dist/chunk-xfxrh6vx.js +0 -2
  197. package/dist/chunk-xk2mwk61.js +0 -2
  198. package/dist/chunk-zbzmfqmk.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{en,ae}from"./chunk-2hc5mbw8.js";import{m,tn,w,Ne,o,R}from"./chunk-m9nr12a1.js";import{Xr}from"./chunk-4mrgy3ve.js";import{s,we}from"./chunk-x8mp9yvn.js";import{a}from"./chunk-jbj6xh7f.js";import h from"path";import v from"fs";var pe=10;function V(e,n,i){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||Xr(e,n,i)}var ne=1,re=new Map,W=600,fe=100,P=new Map;async function me(e){let n=P.get(e)??0;if(n>0&&n<fe){P.set(e,n+1);return}P.set(e,1);try{let i=(await v.promises.readdir(e)).filter((u)=>u.endsWith(".js"));if(i.length<=W)return;let g=(await Promise.all(i.map(async(u)=>{try{return{name:u,at:(await v.promises.stat(h.join(e,u))).mtimeMs}}catch{return null}}))).filter((u)=>u!==null);g.sort((u,l)=>l.at-u.at);for(let u of g.slice(W)){let l=u.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}I("pruned bundle cache to",W,"entries")}catch{}}function ie(e){return re.get(e)??[]}function X(e,n){if(e)re.set(e,n)}function qa(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function I(...e){if(qa())console.log("[stx:bundler]",...e)}var Z=[];function Fo(e,n,i){Z.push({filePath:e||"<inline>",message:n,details:i})}function mt(){return Z.slice()}function ht(){Z.length=0}var q;function _u(e){q=e}function zo(){if(q)return q;try{let e=R.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var H=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yt(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,i;while((i=n.exec(e))!==null){let g=i[1];if(!H.some((l)=>l.test(g)))return I("detected user import:",g),!0}let c=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((i=c.exec(e))!==null){let g=i[1];if(/\.css(?:\?.*)?$/.test(g))continue;if(!H.some((l)=>l.test(g)))return I("detected side-effect import:",g),!0}return!1}var Qt="stx-module:",ge=/\.(?:[cm]?[jt]sx?|json)$/i;function Ka(e,n){return h.relative(e,n).split(h.sep).join("/")}function Xa(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(i,c,g,u)=>{let l=n.get(u);return l&&!u.startsWith(Qt)?`${c}${g}${l}${g}`:i})}function Ga(e,n){let i=0,c=(u)=>{let l=`__stxMod${i++}`,S=JSON.stringify(u);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${S}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(S)} + " is not registered on this page (#1957)");`),l},g=(u,l)=>{for(let S of u.split(",")){let M=S.trim();if(!M)continue;let f=M.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;let t=f[1].startsWith('"')?JSON.parse(f[1]):f[1],r=f[2]??t;n.push(`var ${r} = ${l}[${JSON.stringify(t)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l,S)=>{let M=S.slice(Qt.length),f=c(M),t=l.trim(),r=t.match(/^([\w$]+)\s*(?:,\s*|$)/);if(r&&!t.startsWith("{")&&!t.startsWith("*"))n.push(`var ${r[1]} = ${f}.default;`),t=t.slice(r[0].length).trim();let d=t.match(/^\*\s*as\s+([\w$]+)$/);if(d)n.push(`var ${d[1]} = ${f};`);else if(t.startsWith("{"))g(t.replace(/^\{|\}$/g,""),f);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l)=>(c(l.slice(Qt.length)),"")),e}function ee(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let i of n)try{if(v.existsSync(i)&&v.statSync(i,{throwIfNoEntry:!1})?.isFile())return i}catch{}return}function he(e,n,i,c,g,u=new Map,l){let S=(f,t,r)=>{if(V(t,e,l))return null;if(!g||f!==i||!ge.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(t);let d=`${Qt}${Ka(process.cwd(),t)}`;return u.set(r,d),{path:d,external:!0}},M=(f,t)=>{let r=f===i?n:h.dirname(f),d=h.resolve(r,t);return ee(d)??d};return{name:"stx-client-bundle",setup(f){if(f.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^\//},(t)=>{let r=ee(t.path);if(r){let d=S(t.importer,r,t.path);if(d)return d;if(r!==i)c.add(r);return{path:r}}return{path:t.path,external:!0}}),f.onResolve({filter:/^\.\.?\//},(t)=>{let r=M(t.importer,t.path),d=S(t.importer,r,t.path);if(d)return d;return c.add(r),{path:r}}),f.onResolve({filter:/^[@~]\//},(t)=>{let r=h.resolve(e,t.path.slice(2)),d=[r,`${r}.ts`,`${r}.tsx`,`${r}.js`,`${r}.mjs`,`${r}.jsx`,h.join(r,"index.ts"),h.join(r,"index.tsx"),h.join(r,"index.js"),h.join(r,"index.mjs")];for(let E of d)if(v.existsSync(E)&&v.statSync(E,{throwIfNoEntry:!1})?.isFile()){let C=S(t.importer,E,t.path);if(C)return C;return I(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",E),c.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:r}}),g)f.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==i)return;let r=`${Qt}npm:${t.path}`;return u.set(t.path,r),{path:r,external:!0}});f.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(V(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let r=h.extname(t.path).toLowerCase(),d=r===".json"?"json":r===".tsx"?"tsx":r===".jsx"?"jsx":r===".ts"||r===".mts"||r===".cts"?"ts":"js";if(t.path!==i)c.add(t.path);return{contents:v.readFileSync(t.path,"utf8"),loader:d}})}}}var G=new Map,L=m(64),te=Symbol.for("stx.client-bundle-build-queue");function Ja(e){let n=globalThis,c=(n[te]??Promise.resolve()).then(e,e);return n[te]=c.then(()=>{return},()=>{return}),c}async function bt(e,n,i={}){let c=i.projectRoot||process.cwd(),g=(await o(c)).serverApi,u=i.minify??!1,l=i.externalizeUserModules??!0,S=i.expose?.length?[...new Set(i.expose)].sort():void 0,M=i.cacheDir||a(c,"bundle-cache"),f=new Bun.CryptoHasher("md5");f.update(`${pe}\x00${Ne()}\x00${JSON.stringify(g??!1)}\x00${l?"registry":"inline"}\x00${S?S.join(","):"*"}\x00${e}\x00${n}`);let t=f.digest("hex").slice(0,12),r=h.join(M,`${t}.js`),d=L.get(r);if(d){if(tn(d.files)&&d.files.every((A)=>!V(A.path,c,g))){I("memo hit:",t);let A=d.files.map((B)=>B.path);return X(n,A),i.collectInputs?.push(...A),d.code}L.delete(r),I("memo invalidated by dep change:",t)}let E=h.join(M,`${t}.deps.json`),C=Bun.file(r);if(await C.exists()){let A=Bun.file(E),B=!1,N=null;if(await A.exists())try{let O=JSON.parse(await A.text());if(O.metadataVersion!==ne||!Array.isArray(O.files))B=!1;else N=O.files,B=!0;if(N&&(!tn(N)||N.some((D)=>V(D.path,c,g))))B=!1}catch{B=!1}if(B){if(I("cache hit:",t),N)X(n,N.map((D)=>D.path)),i.collectInputs?.push(...N.map((D)=>D.path));let O=await C.text();if(N)L.set(r,{code:O,files:N});return O}I("cache invalidated by dep change:",t)}let _=G.get(t);if(_){let A=await _;if(i.collectInputs)i.collectInputs.push(...(L.get(r)?.files??[]).map((B)=>B.path));return A}let z=Ja(()=>$e(e,n,{projectRoot:c,minify:u,cacheDir:M,hash:t,cachePath:r,depsPath:E,collectInputs:i.collectInputs,externalizeUserModules:l,serverApi:g,expose:S,throwOnFailure:i.throwOnFailure}));G.set(t,z);try{return await z}finally{G.delete(t)}}var xe=0;function Ya(e){return`${e}-${process.pid}-${++xe}`}async function $e(e,n,i){let{projectRoot:c,minify:g,cacheDir:u,hash:l,cachePath:S,depsPath:M,externalizeUserModules:f}=i,t=a(c,"bundle-tmp"),r=Ya(l),d=h.join(t,`${r}.ts`),E=h.join(t,"out",r);v.mkdirSync(t,{recursive:!0}),v.mkdirSync(E,{recursive:!0});let C=h.dirname(n),_=new Set,z=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,A=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:N,balanced:O}=we(B),D=(j)=>!O||N[j]===0,y;while((y=z.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;if(y[2])y[2].split(",").forEach((j)=>{let p=ye(j);if(p)_.add(p)});else if(y[3])_.add(y[3])}while((y=A.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;_.add(y[2])}let se=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((y=se.exec(B))!==null){if(!D(y.index))continue;let j=/^\s*['"]([^'"]+)['"]/.exec(e.slice(y.index+y[0].length))?.[1];if(j&&H.some((p)=>p.test(j)))continue;if(y[1])_.add(y[1]);if(y[2])_.add(y[2]);for(let p of(y[3]??"").split(",")){let b=p.trim();if(!b||/^type\s/.test(b))continue;let U=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(U)_.add(U)}}for(let j of B.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let p of j[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(p)?.[1]??/^\s*(\w+)\s*$/.exec(p)?.[1];if(b)_.delete(b)}let oe=_.size>0?`
2
+ import{en,ae}from"./chunk-2hc5mbw8.js";import{m,tn,w,Ne,o,A}from"./chunk-96kr2xrt.js";import{Xr}from"./chunk-qt31at4s.js";import{s,ve}from"./chunk-xemsypk7.js";import{a}from"./chunk-dne8n6h3.js";import h from"path";import v from"fs";var pe=10;function V(e,n,i){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||Xr(e,n,i)}var ne=1,re=new Map,W=600,fe=100,P=new Map;async function me(e){let n=P.get(e)??0;if(n>0&&n<fe){P.set(e,n+1);return}P.set(e,1);try{let i=(await v.promises.readdir(e)).filter((u)=>u.endsWith(".js"));if(i.length<=W)return;let g=(await Promise.all(i.map(async(u)=>{try{return{name:u,at:(await v.promises.stat(h.join(e,u))).mtimeMs}}catch{return null}}))).filter((u)=>u!==null);g.sort((u,l)=>l.at-u.at);for(let u of g.slice(W)){let l=u.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}I("pruned bundle cache to",W,"entries")}catch{}}function ie(e){return re.get(e)??[]}function X(e,n){if(e)re.set(e,n)}function qa(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function I(...e){if(qa())console.log("[stx:bundler]",...e)}var Z=[];function Fo(e,n,i){Z.push({filePath:e||"<inline>",message:n,details:i})}function mt(){return Z.slice()}function ht(){Z.length=0}var q;function Td(e){q=e}function zo(){if(q)return q;try{let e=A.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var H=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yt(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,i;while((i=n.exec(e))!==null){let g=i[1];if(!H.some((l)=>l.test(g)))return I("detected user import:",g),!0}let c=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((i=c.exec(e))!==null){let g=i[1];if(/\.css(?:\?.*)?$/.test(g))continue;if(!H.some((l)=>l.test(g)))return I("detected side-effect import:",g),!0}return!1}var Qt="stx-module:",ge=/\.(?:[cm]?[jt]sx?|json)$/i;function Ka(e,n){return h.relative(e,n).split(h.sep).join("/")}function Xa(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(i,c,g,u)=>{let l=n.get(u);return l&&!u.startsWith(Qt)?`${c}${g}${l}${g}`:i})}function Ga(e,n){let i=0,c=(u)=>{let l=`__stxMod${i++}`,S=JSON.stringify(u);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${S}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(S)} + " is not registered on this page (#1957)");`),l},g=(u,l)=>{for(let S of u.split(",")){let M=S.trim();if(!M)continue;let f=M.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;let t=f[1].startsWith('"')?JSON.parse(f[1]):f[1],r=f[2]??t;n.push(`var ${r} = ${l}[${JSON.stringify(t)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l,S)=>{let M=S.slice(Qt.length),f=c(M),t=l.trim(),r=t.match(/^([\w$]+)\s*(?:,\s*|$)/);if(r&&!t.startsWith("{")&&!t.startsWith("*"))n.push(`var ${r[1]} = ${f}.default;`),t=t.slice(r[0].length).trim();let d=t.match(/^\*\s*as\s+([\w$]+)$/);if(d)n.push(`var ${d[1]} = ${f};`);else if(t.startsWith("{"))g(t.replace(/^\{|\}$/g,""),f);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l)=>(c(l.slice(Qt.length)),"")),e}function ee(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let i of n)try{if(v.existsSync(i)&&v.statSync(i,{throwIfNoEntry:!1})?.isFile())return i}catch{}return}function he(e,n,i,c,g,u=new Map,l){let S=(f,t,r)=>{if(V(t,e,l))return null;if(!g||f!==i||!ge.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(t);let d=`${Qt}${Ka(process.cwd(),t)}`;return u.set(r,d),{path:d,external:!0}},M=(f,t)=>{let r=f===i?n:h.dirname(f),d=h.resolve(r,t);return ee(d)??d};return{name:"stx-client-bundle",setup(f){if(f.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^\//},(t)=>{let r=ee(t.path);if(r){let d=S(t.importer,r,t.path);if(d)return d;if(r!==i)c.add(r);return{path:r}}return{path:t.path,external:!0}}),f.onResolve({filter:/^\.\.?\//},(t)=>{let r=M(t.importer,t.path),d=S(t.importer,r,t.path);if(d)return d;return c.add(r),{path:r}}),f.onResolve({filter:/^[@~]\//},(t)=>{let r=h.resolve(e,t.path.slice(2)),d=[r,`${r}.ts`,`${r}.tsx`,`${r}.js`,`${r}.mjs`,`${r}.jsx`,h.join(r,"index.ts"),h.join(r,"index.tsx"),h.join(r,"index.js"),h.join(r,"index.mjs")];for(let E of d)if(v.existsSync(E)&&v.statSync(E,{throwIfNoEntry:!1})?.isFile()){let C=S(t.importer,E,t.path);if(C)return C;return I(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",E),c.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:r}}),g)f.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==i)return;let r=`${Qt}npm:${t.path}`;return u.set(t.path,r),{path:r,external:!0}});f.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(V(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let r=h.extname(t.path).toLowerCase(),d=r===".json"?"json":r===".tsx"?"tsx":r===".jsx"?"jsx":r===".ts"||r===".mts"||r===".cts"?"ts":"js";if(t.path!==i)c.add(t.path);return{contents:v.readFileSync(t.path,"utf8"),loader:d}})}}}var G=new Map,L=m(64),te=Symbol.for("stx.client-bundle-build-queue");function Ja(e){let n=globalThis,c=(n[te]??Promise.resolve()).then(e,e);return n[te]=c.then(()=>{return},()=>{return}),c}async function bt(e,n,i={}){let c=i.projectRoot||process.cwd(),g=(await o(c)).serverApi,u=i.minify??!1,l=i.externalizeUserModules??!0,S=i.expose?.length?[...new Set(i.expose)].sort():void 0,M=i.cacheDir||a(c,"bundle-cache"),f=new Bun.CryptoHasher("md5");f.update(`${pe}\x00${Ne()}\x00${JSON.stringify(g??!1)}\x00${l?"registry":"inline"}\x00${S?S.join(","):"*"}\x00${e}\x00${n}`);let t=f.digest("hex").slice(0,12),r=h.join(M,`${t}.js`),d=L.get(r);if(d){if(tn(d.files)&&d.files.every((N)=>!V(N.path,c,g))){I("memo hit:",t);let N=d.files.map((B)=>B.path);return X(n,N),i.collectInputs?.push(...N),d.code}L.delete(r),I("memo invalidated by dep change:",t)}let E=h.join(M,`${t}.deps.json`),C=Bun.file(r);if(await C.exists()){let N=Bun.file(E),B=!1,R=null;if(await N.exists())try{let O=JSON.parse(await N.text());if(O.metadataVersion!==ne||!Array.isArray(O.files))B=!1;else R=O.files,B=!0;if(R&&(!tn(R)||R.some((D)=>V(D.path,c,g))))B=!1}catch{B=!1}if(B){if(I("cache hit:",t),R)X(n,R.map((D)=>D.path)),i.collectInputs?.push(...R.map((D)=>D.path));let O=await C.text();if(R)L.set(r,{code:O,files:R});return O}I("cache invalidated by dep change:",t)}let _=G.get(t);if(_){let N=await _;if(i.collectInputs)i.collectInputs.push(...(L.get(r)?.files??[]).map((B)=>B.path));return N}let z=Ja(()=>$e(e,n,{projectRoot:c,minify:u,cacheDir:M,hash:t,cachePath:r,depsPath:E,collectInputs:i.collectInputs,externalizeUserModules:l,serverApi:g,expose:S,throwOnFailure:i.throwOnFailure}));G.set(t,z);try{return await z}finally{G.delete(t)}}var xe=0;function Ya(e){return`${e}-${process.pid}-${++xe}`}async function $e(e,n,i){let{projectRoot:c,minify:g,cacheDir:u,hash:l,cachePath:S,depsPath:M,externalizeUserModules:f}=i,t=a(c,"bundle-tmp"),r=Ya(l),d=h.join(t,`${r}.ts`),E=h.join(t,"out",r);v.mkdirSync(t,{recursive:!0}),v.mkdirSync(E,{recursive:!0});let C=h.dirname(n),_=new Set,z=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,N=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:R,balanced:O}=ve(B),D=(j)=>!O||R[j]===0,y;while((y=z.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;if(y[2])y[2].split(",").forEach((j)=>{let p=we(j);if(p)_.add(p)});else if(y[3])_.add(y[3])}while((y=N.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;_.add(y[2])}let se=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((y=se.exec(B))!==null){if(!D(y.index))continue;let j=/^\s*['"]([^'"]+)['"]/.exec(e.slice(y.index+y[0].length))?.[1];if(j&&H.some((p)=>p.test(j)))continue;if(y[1])_.add(y[1]);if(y[2])_.add(y[2]);for(let p of(y[3]??"").split(",")){let b=p.trim();if(!b||/^type\s/.test(b))continue;let U=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(U)_.add(U)}}for(let j of B.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let p of j[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(p)?.[1]??/^\s*(\w+)\s*$/.exec(p)?.[1];if(b)_.delete(b)}let oe=_.size>0?`
3
3
  export { ${[..._].join(", ")} }`:"";await Bun.write(d,e+oe),I("bundling:",l,"from:",h.basename(n));let Y=new Set,Q=new Map;try{let j=await Bun.build({entrypoints:[d],outdir:E,target:"browser",format:"esm",minify:g?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[he(c,C,d,Y,f,Q,i.serverApi)],define:{"process.env.NODE_ENV":g?'"production"':'"development"',...w()},root:c});if(!j.success){let F=j.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${h.basename(n)}`,k=en(j.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",F),Fo(n||"",F,k),i.throwOnFailure||zo()==="error")throw Error(F);return e}let p="";for(let x of j.outputs){p=await x.text();break}let b=[];for(let x of p.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let k=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(k){b.push([k[2],k[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))b.push([T,T])}if(i.expose){let x=new Set(i.expose);for(let F=b.length-1;F>=0;F--)if(!x.has(b[F][0]))b.splice(F,1)}let U=[];p=Ga(Xa(p,Q),U);let le=p.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(p=p.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),g&&p)try{p=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(p)}catch{}let K=`__stxBundle_${l}`,ce=b.map(([x,F])=>`${JSON.stringify(x)}: ${F}`).join(", "),ue=b.map(([x])=>`var ${x} = undefined;`).join(`
4
4
  `),de=b.map(([x])=>`${x} = ${K}[${JSON.stringify(x)}];`).join(`
5
5
  `);if(p=`${le.join(`
@@ -11,5 +11,5 @@ ${U.join(`
11
11
  ${p}
12
12
  return { ${ce} };
13
13
  })();
14
- ${de}`.trim(),I("bundled:",l,"output:",p.length,"bytes"),_.size>0&&b.length===0)return console.warn(`[stx:bundler] dropped every binding for ${h.basename(n)} (${l}); serving the unbundled source and not caching this result`),e;v.mkdirSync(u,{recursive:!0}),await Bun.write(S,p);let J=Array.from(Y).map((x)=>{try{return{path:x,mtimeMs:v.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:ne,files:J})),X(n,J.map((x)=>x.path)),i.collectInputs?.push(...J.map((x)=>x.path)),L.set(S,{code:p,files:J}),await me(u),p}catch(j){let p=en(j,n||void 0),b=ae(j,n||void 0);if(console.warn(`[stx:bundler] error: ${b}`),Fo(n||"",b,p),i.throwOnFailure||zo()==="error")throw j;return e}finally{try{v.rmSync(d,{force:!0}),v.rmSync(E,{recursive:!0,force:!0})}catch{}}}function ye(e){let n=e.trim();if(!n)return null;let i=n.indexOf("=");if(i!==-1)n=n.slice(0,i).trim();let c=n.indexOf(":");if(c!==-1)n=n.slice(c+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
15
- export{ie,qa,Fo,mt,ht,_u,zo,yt,Qt,Ka,Xa,Ga,Ja,bt,Ya};
14
+ ${de}`.trim(),I("bundled:",l,"output:",p.length,"bytes"),_.size>0&&b.length===0)return console.warn(`[stx:bundler] dropped every binding for ${h.basename(n)} (${l}); serving the unbundled source and not caching this result`),e;v.mkdirSync(u,{recursive:!0}),await Bun.write(S,p);let J=Array.from(Y).map((x)=>{try{return{path:x,mtimeMs:v.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:ne,files:J})),X(n,J.map((x)=>x.path)),i.collectInputs?.push(...J.map((x)=>x.path)),L.set(S,{code:p,files:J}),await me(u),p}catch(j){let p=en(j,n||void 0),b=ae(j,n||void 0);if(console.warn(`[stx:bundler] error: ${b}`),Fo(n||"",b,p),i.throwOnFailure||zo()==="error")throw j;return e}finally{try{v.rmSync(d,{force:!0}),v.rmSync(E,{recursive:!0,force:!0})}catch{}}}function we(e){let n=e.trim();if(!n)return null;let i=n.indexOf("=");if(i!==-1)n=n.slice(0,i).trim();let c=n.indexOf(":");if(c!==-1)n=n.slice(c+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
15
+ export{ie,qa,Fo,mt,ht,Td,zo,yt,Qt,Ka,Xa,Ga,Ja,bt,Ya};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{To,_o,Ro,Ed}from"./chunk-r14mvycg.js";import"./chunk-7sjmpfwy.js";import"./chunk-96kr2xrt.js";import"./chunk-68tzytfz.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-v74acg2k.js";import"./chunk-zz5b1g50.js";import"./chunk-5tbqdz94.js";import"./chunk-9p3rtfbv.js";import"./chunk-g495xx4v.js";import"./chunk-ba88n1j7.js";import"./chunk-g1r4v0mc.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{To as buildNative,Ed as default,Ro as getAvailableFormats,_o as getAvailableTargets};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{oe,gt}from"./chunk-hkjqqx92.js";import{ge}from"./chunk-hktvv0hd.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
2
+ import{oe,gt}from"./chunk-hkjqqx92.js";import{ge}from"./chunk-vtxzaj1h.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
3
3
  maxEntries: ${o},
4
4
  ${u?`maxAgeSeconds: ${u},`:""}
5
5
  purgeOnQuotaError: true,
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{vo,wo,ba,va,wa,xa,Pl}from"./chunk-g7wgpys2.js";export{vo as createVirtualList,Pl as default,ba as generateVirtualListCSS,wa as processInfiniteListDirectives,xa as processVirtualGridDirectives,wo as processVirtualListDirectives,va as useVirtualList};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{xo,Ia,Wt,Dl,Da,Oa,Ma,Ol}from"./chunk-cp7hph6f.js";export{Wt as Validator,Ia as defineForm,Da as processErrorDirective,Oa as processErrorsDirective,Ol as processFormValidationDirectives,Ma as processHasErrorsDirective,xo as useForm,Dl as v};
2
+ import{xo,Ia,Wt,Dl,Da,Oa,Ma,Ol}from"./chunk-8xpyzcq2.js";export{Wt as Validator,Ia as defineForm,Da as processErrorDirective,Oa as processErrorsDirective,Ol as processFormValidationDirectives,Ma as processHasErrorsDirective,xo as useForm,Dl as v};
@@ -4,5 +4,5 @@ var Hr=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{na
4
4
  `)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
5
5
  ${r} [${o.join(`,
6
6
  ${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
7
- `)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Po(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Ao,createHotReloadServer:Po,NATIVE_COMPONENTS:Hr},Eu=K;
8
- export{Hr,Ao,Po,Eu};
7
+ `)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Po(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Ao,createHotReloadServer:Po,NATIVE_COMPONENTS:Hr},$d=K;
8
+ export{Hr,Ao,Po,$d};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function T(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function k(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as H,rm as D,stat as O}from"fs/promises";import{join as w,dirname as E}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function S(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function Ht(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await k(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function Vt(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await T(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await S(E(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function Ut(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await D(n,{recursive:!0,force:!0})}catch{}}}
3
- export{T,k,Ht,Vt,Ut};
2
+ import{createHash as g}from"crypto";import{readFile as b,stat as y}from"fs/promises";async function _(e){try{let t=await b(e);return g("sha256").update(t).digest("hex").slice(0,16)}catch{return""}}function l(e){return g("sha256").update(e).digest("hex").slice(0,16)}function m(e,t){let r=JSON.stringify(t,Object.keys(t).sort());return`${l(e)}-${l(r)}`}async function h(e){try{return(await y(e)).mtimeMs}catch{return 0}}async function k(e){try{return await y(e),!0}catch{return!1}}import{mkdir as v,readFile as A,writeFile as P,readdir as B,rm as D,stat as H}from"fs/promises";import{join as w,dirname as E}from"path";var c=new Map,d={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function S(e){try{await v(e,{recursive:!0})}catch{}}function p(e,t,r){return w(e,r,`${t}.json`)}async function C(e,t,r){if((Date.now()-e.createdAt)/86400000>r)return!1;if(await h(t)!==e.srcMtime)return!1;return!0}async function Ht(e,t,r,a=d){if(!a.enabled)return null;let n=m(e,t),i=c.get(n);if(i){if(await C(i,e,a.maxAge))return i.lastAccessedAt=Date.now(),i.data;c.delete(n)}let o=p(a.directory,n,r);if(await k(o))try{let u=await A(o,"utf-8"),s=JSON.parse(u);if(await C(s,e,a.maxAge))return s.lastAccessedAt=Date.now(),c.set(n,s),s.data}catch{}return null}async function Vt(e,t,r,a,n=d){if(!n.enabled)return;let i=m(e,t),o=await _(e),u=await h(e),s={key:i,src:e,srcHash:o,srcMtime:u,optionsHash:m("",t),data:r,createdAt:Date.now(),lastAccessedAt:Date.now()};c.set(i,s);let f=p(n.directory,i,a);try{await S(E(f)),await P(f,JSON.stringify(s,null,2))}catch(x){console.warn(`[stx-media] Failed to write cache: ${x}`)}}async function Ut(e,t=d){if(e==="all")c.clear();else c.clear();let r=e==="all"?["image","video"]:[e];for(let a of r){let n=w(t.directory,a);try{await D(n,{recursive:!0,force:!0})}catch{}}}
3
+ export{_,k,Ht,Vt,Ut};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import{_t,C}from"./chunk-1erc0vrb.js";import m from"fs";import e from"path";async function un(r,o,i){if(r.__stx_runtime_config)return;let n=_t();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-6v3p6cx1.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Cs(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
2
+ import{Tt,C}from"./chunk-zz5b1g50.js";import m from"fs";import e from"path";async function dn(r,o,i){if(r.__stx_runtime_config)return;let n=Tt();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-dv94gdv4.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Cs(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
3
3
  declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
4
4
  `),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
5
5
  declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
6
6
  `)}
7
- export{un,Cs};
7
+ export{dn,Cs};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{mo,oa}from"./chunk-z9tvn738.js";import"./chunk-298s08st.js";export{oa as createImageHandler,mo as handleImageRequest};
2
+ import{mo,oa}from"./chunk-jcmgj8kk.js";import"./chunk-n34kagea.js";export{oa as createImageHandler,mo as handleImageRequest};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Oe}from"./chunk-4c1afy15.js";function Nn(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Oe(e),i=`
2
+ import{Oe}from"./chunk-qv57r0fa.js";function Nn(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Oe(e),i=`
3
3
  <!-- stx PWA Meta Tags -->
4
4
  <link rel="manifest" href="/manifest.json">
5
5
  <meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- function ge(){let{NODE_ENV:o}=process.env;return o==="production"}function O(){let{STX_DEBUG:o}=process.env;return!ge()||o==="true"}function wn(){let{NODE_ENV:o}=process.env;return o==="test"}
3
- export{ge,O,wn};
2
+ function ge(){let{NODE_ENV:o}=process.env;return o==="production"}function O(){let{STX_DEBUG:o}=process.env;return!ge()||o==="true"}function vn(){let{NODE_ENV:o}=process.env;return o==="test"}
3
+ export{ge,O,vn};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Et,bc,vc,wc,xc,Sc,u,kc,ps,Cc,ci,li}from"./chunk-96kr2xrt.js";import"./chunk-68tzytfz.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-v74acg2k.js";import"./chunk-zz5b1g50.js";import"./chunk-5tbqdz94.js";import"./chunk-9p3rtfbv.js";import"./chunk-g495xx4v.js";import"./chunk-ba88n1j7.js";import"./chunk-g1r4v0mc.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Et as STX_ENGINE_BINDING_NAMES,ps as convertToCommonJS,ci as extractScriptFromTemplate,u as extractVariables,li as hasVariables,kc as isCompleteImport,Sc as isMissingBindingFailure,wc as isModuleResolutionFailure,xc as isSyntaxFailure,Cc as splitDeclaration,bc as stripTypeScript,vc as withoutStxReferrer};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{de,Tt,Qn,Es,C,Xe}from"./chunk-zz5b1g50.js";export{Tt as currentRuntimeConfig,Xe as injectRuntimeConfig,C as resolveRuntimeConfig,Es as useRuntimeConfig,Qn as useServerRuntimeConfig,de as withRuntimeConfig};