@stacksjs/stx 0.2.630 → 0.2.632

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 (220) hide show
  1. package/dist/chunk-05zhvg8t.js +20 -0
  2. package/dist/chunk-0c31twby.js +2 -0
  3. package/dist/{chunk-0s1hpqas.js → chunk-0jeqp6yz.js} +2 -2
  4. package/dist/chunk-0nvb2x2f.js +2 -0
  5. package/dist/chunk-0whv8hnp.js +4 -0
  6. package/dist/{chunk-q1983d5e.js → chunk-179c1rdn.js} +2 -2
  7. package/dist/chunk-1e25xd0z.js +6 -0
  8. package/dist/{chunk-jp6yn9mj.js → chunk-1ma56c2h.js} +2 -2
  9. package/dist/{chunk-h9ymjtch.js → chunk-27h1xs4k.js} +12 -12
  10. package/dist/{chunk-5m0r0j79.js → chunk-2vqz7v37.js} +3 -3
  11. package/dist/{chunk-10s16tad.js → chunk-2wvz3fd2.js} +2 -2
  12. package/dist/chunk-3jda301z.js +2 -0
  13. package/dist/{chunk-gc1dzxee.js → chunk-3p2b88pd.js} +2 -2
  14. package/dist/chunk-46qg1tqe.js +2 -0
  15. package/dist/{chunk-66e4ga0z.js → chunk-4fv3jq16.js} +2 -2
  16. package/dist/{chunk-k1k2t4ez.js → chunk-4y06ekvt.js} +1 -1
  17. package/dist/chunk-5fjb6avv.js +2 -0
  18. package/dist/chunk-5kprybdd.js +2 -0
  19. package/dist/{chunk-n5xbv1a9.js → chunk-62kxavc5.js} +3 -3
  20. package/dist/{chunk-8q9b82ew.js → chunk-6684b8ym.js} +11 -11
  21. package/dist/{chunk-npvxq89e.js → chunk-6mtth8d1.js} +3 -3
  22. package/dist/chunk-6n6nnt33.js +2 -0
  23. package/dist/chunk-6per0k6j.js +2 -0
  24. package/dist/{chunk-hb46a5rr.js → chunk-70npkeh2.js} +2 -2
  25. package/dist/{chunk-y706tkyy.js → chunk-776f05vk.js} +4 -4
  26. package/dist/{chunk-szjgbjw1.js → chunk-7a8jkwah.js} +2 -2
  27. package/dist/{chunk-wbhzt74k.js → chunk-7cw0wkbx.js} +1 -1
  28. package/dist/chunk-7f1dw9r4.js +2 -0
  29. package/dist/{chunk-khzyc41k.js → chunk-7ky2ny63.js} +13 -13
  30. package/dist/{chunk-h431swg6.js → chunk-7mpv1a02.js} +9 -9
  31. package/dist/chunk-7zjv015g.js +2 -0
  32. package/dist/{chunk-q35z0cyg.js → chunk-85bbtv3m.js} +1 -1
  33. package/dist/{chunk-qb7a4am2.js → chunk-85g35me6.js} +2 -2
  34. package/dist/chunk-87nt0kty.js +2 -0
  35. package/dist/{chunk-3dth76ce.js → chunk-88d5s6v3.js} +3 -3
  36. package/dist/chunk-8a3sdg2y.js +2 -0
  37. package/dist/chunk-8e9hd2jq.js +4 -0
  38. package/dist/{chunk-0c7ss25y.js → chunk-8gksvwsm.js} +3 -3
  39. package/dist/chunk-8vbfbtke.js +2 -0
  40. package/dist/chunk-91ranpvz.js +2 -0
  41. package/dist/chunk-96ypgjm4.js +2 -0
  42. package/dist/{chunk-1gtrs8va.js → chunk-9b4e815s.js} +8 -8
  43. package/dist/chunk-9cg6q8mw.js +2 -0
  44. package/dist/{chunk-gd7vq083.js → chunk-a2ztn8cr.js} +1 -1
  45. package/dist/chunk-ag4eck6d.js +2 -0
  46. package/dist/chunk-aq02drjz.js +2 -0
  47. package/dist/{chunk-jsw5yby0.js → chunk-aqra0qcg.js} +3 -3
  48. package/dist/{chunk-cnvfh74t.js → chunk-av9zf0zb.js} +5 -5
  49. package/dist/chunk-ayt4qd82.js +2 -0
  50. package/dist/{chunk-m735gtc4.js → chunk-az1y9jks.js} +2 -2
  51. package/dist/chunk-b3mazye4.js +2 -0
  52. package/dist/chunk-b5cv9xp7.js +2852 -0
  53. package/dist/{chunk-dayjd2sj.js → chunk-b7p3yca7.js} +4 -4
  54. package/dist/chunk-bn6sarwd.js +2 -0
  55. package/dist/chunk-c7xt5gyb.js +2 -0
  56. package/dist/chunk-cac98pkx.js +2 -0
  57. package/dist/{chunk-q5w9cmr9.js → chunk-cbj2hmx5.js} +5 -5
  58. package/dist/chunk-czg6ewy3.js +2 -0
  59. package/dist/{chunk-sxpnpvt5.js → chunk-d1ya7f79.js} +4 -4
  60. package/dist/chunk-dcwmcqbr.js +2 -0
  61. package/dist/{chunk-19bhnbyn.js → chunk-dz4hrgw8.js} +83 -64
  62. package/dist/chunk-ed1qn902.js +2 -0
  63. package/dist/chunk-ev479f3z.js +2 -0
  64. package/dist/{chunk-x6pz1h3x.js → chunk-evs5gb3q.js} +10 -10
  65. package/dist/{chunk-w3c2c74q.js → chunk-fskpdva4.js} +46 -46
  66. package/dist/{chunk-5rtatjwq.js → chunk-gh34r6qb.js} +2 -2
  67. package/dist/chunk-gmg6aj7y.js +2 -0
  68. package/dist/{chunk-t455jpzx.js → chunk-h4ashx84.js} +1 -1
  69. package/dist/chunk-hc1m2psz.js +3 -0
  70. package/dist/{chunk-4hmdcmw1.js → chunk-hfe8g644.js} +6 -6
  71. package/dist/chunk-htaed68z.js +2 -0
  72. package/dist/{chunk-g8gzxhp8.js → chunk-j1rnhv0w.js} +3 -3
  73. package/dist/chunk-j2jm2nqz.js +2 -0
  74. package/dist/chunk-jb8d4n60.js +2 -0
  75. package/dist/{chunk-mktk70gq.js → chunk-k2nrx78c.js} +2 -2
  76. package/dist/chunk-kdnbxwkb.js +2 -0
  77. package/dist/{chunk-01hf94pa.js → chunk-kf2vas4j.js} +5 -5
  78. package/dist/chunk-kt5mzw2w.js +2 -0
  79. package/dist/chunk-kt994306.js +2 -0
  80. package/dist/{chunk-6qvskcwp.js → chunk-mer3aea0.js} +4 -4
  81. package/dist/chunk-mezphhpa.js +2 -0
  82. package/dist/{chunk-5wrmcbch.js → chunk-myhxapnn.js} +2 -2
  83. package/dist/chunk-n7d69a2q.js +2 -0
  84. package/dist/{chunk-z4te6223.js → chunk-nz6bzffm.js} +4 -4
  85. package/dist/{chunk-st71ar7s.js → chunk-pfas39mf.js} +9 -9
  86. package/dist/{chunk-j18z5nxq.js → chunk-phbnrw2h.js} +2 -2
  87. package/dist/{chunk-9g5sv1p6.js → chunk-q2p6y0cn.js} +7 -7
  88. package/dist/{chunk-6rxnh3th.js → chunk-qfppetcn.js} +1 -1
  89. package/dist/{chunk-wsbccxwy.js → chunk-qpbd2fwp.js} +9 -9
  90. package/dist/{chunk-y794qh69.js → chunk-qvqgbvfa.js} +6 -6
  91. package/dist/chunk-qz3tnvwm.js +2 -0
  92. package/dist/{chunk-dvbgbd06.js → chunk-rns21kkv.js} +2 -2
  93. package/dist/{chunk-08jyyegp.js → chunk-rq9cbw2y.js} +1 -1
  94. package/dist/{chunk-q7wj2ypd.js → chunk-s0ar60ng.js} +6 -6
  95. package/dist/chunk-sddytf9n.js +2 -0
  96. package/dist/chunk-spvr2vvh.js +2 -0
  97. package/dist/{chunk-0z189871.js → chunk-t84ww3qb.js} +2 -2
  98. package/dist/chunk-t91250ag.js +2 -0
  99. package/dist/{chunk-n8595zaf.js → chunk-tmbqz710.js} +1 -1
  100. package/dist/{chunk-hjp38m0w.js → chunk-tme29zh9.js} +2 -2
  101. package/dist/chunk-txkc9w9q.js +2 -0
  102. package/dist/chunk-ty1c2276.js +2 -0
  103. package/dist/{chunk-det49x62.js → chunk-v5500ews.js} +2 -2
  104. package/dist/chunk-vepjs3tg.js +2 -0
  105. package/dist/{chunk-v3anfm9d.js → chunk-vfbdxxbf.js} +2 -2
  106. package/dist/{chunk-7mehf3h5.js → chunk-w9c7z8p3.js} +2 -2
  107. package/dist/chunk-wfp754ya.js +2 -0
  108. package/dist/chunk-wp3qcfb4.js +3 -0
  109. package/dist/{chunk-ga48aas6.js → chunk-x17fpc0x.js} +6 -6
  110. package/dist/chunk-x3sbsxdq.js +2 -0
  111. package/dist/chunk-xdcvp8tt.js +2 -0
  112. package/dist/{chunk-ebkjpj5m.js → chunk-xh98er3b.js} +2 -2
  113. package/dist/{chunk-9z9f3d6b.js → chunk-xrj3tekf.js} +2 -2
  114. package/dist/chunk-xxnh7gv8.js +2 -0
  115. package/dist/{chunk-zswn0s45.js → chunk-y2t8xd39.js} +2 -2
  116. package/dist/chunk-y4egzqqf.js +2 -0
  117. package/dist/chunk-y4nm9wq4.js +2 -0
  118. package/dist/{chunk-ygkwp4sf.js → chunk-y5hdc1sb.js} +2 -2
  119. package/dist/chunk-ygx0akfn.js +2 -0
  120. package/dist/chunk-yn9fwnq2.js +2 -0
  121. package/dist/{chunk-3dcdgp1k.js → chunk-yq9rfnd6.js} +1 -1
  122. package/dist/chunk-z0gfb7b4.js +2 -0
  123. package/dist/chunk-z3e54btj.js +2 -0
  124. package/dist/{chunk-773vgw1k.js → chunk-z6fb4m1j.js} +3 -3
  125. package/dist/cli.js +21 -21
  126. package/dist/client/signals-class-runtime.js +1 -1
  127. package/dist/client/signals-component-hydration-runtime.js +1 -1
  128. package/dist/client/signals-component-props-runtime.js +3 -3
  129. package/dist/client/signals-container-cleanup-runtime.js +1 -1
  130. package/dist/client/signals-dom-ready-runtime.js +4 -4
  131. package/dist/client/signals-event-shorthand-runtime.js +2 -2
  132. package/dist/client/signals-expression-runtime.js +21 -2
  133. package/dist/client/signals-for-runtime.js +6 -6
  134. package/dist/client/signals-handler-runtime.js +1 -1
  135. package/dist/client/signals-hydration-audit-runtime.js +1 -1
  136. package/dist/client/signals-hydration-runtime.js +1 -1
  137. package/dist/client/signals-if-chain-runtime.js +3 -3
  138. package/dist/client/signals-if-runtime.js +7 -7
  139. package/dist/client/signals-lazy-hydration-runtime.js +1 -1
  140. package/dist/client/signals-manifest-hydration-runtime.js +1 -1
  141. package/dist/client/signals-model-runtime.js +1 -1
  142. package/dist/client/signals-mount-runtime.js +3 -3
  143. package/dist/client/signals-process-element-runtime.js +7 -7
  144. package/dist/client/signals-show-runtime.js +1 -1
  145. package/dist/client/signals-spa-load-runtime.js +5 -5
  146. package/dist/client/signals-style-runtime.js +1 -1
  147. package/dist/client-scope-bindings.d.ts +6 -0
  148. package/dist/client-scope-bindings.js +98 -0
  149. package/dist/client-script-bundler.js +9 -3
  150. package/dist/client-script.js +2 -1
  151. package/dist/craft-entry.js +2 -2
  152. package/dist/craft.js +2 -2
  153. package/dist/includes.js +4 -2
  154. package/dist/native/components/primitives.d.ts +1 -0
  155. package/dist/pwa.js +3 -3
  156. package/dist/signal-processing.d.ts +2 -6
  157. package/dist/signal-processing.js +4 -80
  158. package/dist/ssg.js +10 -10
  159. package/dist/utils.js +5 -3
  160. package/package.json +5 -5
  161. package/dist/chunk-0fgp13q4.js +0 -2
  162. package/dist/chunk-0v0q0960.js +0 -2
  163. package/dist/chunk-0xxjmnqc.js +0 -2
  164. package/dist/chunk-1peszdcc.js +0 -2
  165. package/dist/chunk-1v92x0we.js +0 -15
  166. package/dist/chunk-2340emvg.js +0 -2
  167. package/dist/chunk-2xy5p3n4.js +0 -2
  168. package/dist/chunk-6p57991f.js +0 -2
  169. package/dist/chunk-711zygzk.js +0 -2
  170. package/dist/chunk-74r2q9ab.js +0 -2
  171. package/dist/chunk-7h4mxhkh.js +0 -2
  172. package/dist/chunk-7zdefvrn.js +0 -2
  173. package/dist/chunk-847nyz30.js +0 -2
  174. package/dist/chunk-8898f767.js +0 -2
  175. package/dist/chunk-9c7wkq4t.js +0 -2
  176. package/dist/chunk-9g01gnz5.js +0 -6
  177. package/dist/chunk-9wbraw07.js +0 -2
  178. package/dist/chunk-apaqfgsx.js +0 -2
  179. package/dist/chunk-bdnahg9m.js +0 -2
  180. package/dist/chunk-bfste5zk.js +0 -2
  181. package/dist/chunk-by4ngspf.js +0 -4
  182. package/dist/chunk-c0yb755y.js +0 -2
  183. package/dist/chunk-chaee0vj.js +0 -2
  184. package/dist/chunk-cy1krwqy.js +0 -2
  185. package/dist/chunk-d57fh04e.js +0 -2
  186. package/dist/chunk-dcham5kg.js +0 -2
  187. package/dist/chunk-e876sg0j.js +0 -2
  188. package/dist/chunk-ekfmad19.js +0 -2
  189. package/dist/chunk-f0ghgkxs.js +0 -2
  190. package/dist/chunk-fnzv245x.js +0 -2
  191. package/dist/chunk-hjkm6k8c.js +0 -2
  192. package/dist/chunk-hpvkkke2.js +0 -2
  193. package/dist/chunk-jb683m9n.js +0 -2
  194. package/dist/chunk-jfqvmq5w.js +0 -2
  195. package/dist/chunk-k1vjhhd4.js +0 -2
  196. package/dist/chunk-k5kj93g7.js +0 -2
  197. package/dist/chunk-kp4j8vja.js +0 -2
  198. package/dist/chunk-mb8c650x.js +0 -2
  199. package/dist/chunk-mfcxhfhb.js +0 -2
  200. package/dist/chunk-mmqt6qkf.js +0 -2
  201. package/dist/chunk-n6ek151q.js +0 -2
  202. package/dist/chunk-ph3ttt90.js +0 -2
  203. package/dist/chunk-pk68a878.js +0 -2
  204. package/dist/chunk-ptas1qqx.js +0 -2850
  205. package/dist/chunk-pz5zh3tg.js +0 -2
  206. package/dist/chunk-q068mc46.js +0 -2
  207. package/dist/chunk-q4a2j4qr.js +0 -3
  208. package/dist/chunk-rfkrktt9.js +0 -2
  209. package/dist/chunk-rj0nyb2t.js +0 -2
  210. package/dist/chunk-smpyb21z.js +0 -2
  211. package/dist/chunk-swv69q75.js +0 -4
  212. package/dist/chunk-t9ww2z0r.js +0 -2
  213. package/dist/chunk-th9wcse5.js +0 -2
  214. package/dist/chunk-v1ck0wd3.js +0 -2
  215. package/dist/chunk-vgd3yq11.js +0 -3
  216. package/dist/chunk-w24zd7sj.js +0 -2
  217. package/dist/chunk-wfettff6.js +0 -2
  218. package/dist/chunk-xfvbm4pn.js +0 -2
  219. package/dist/chunk-z04480ar.js +0 -2
  220. package/dist/chunk-zemkt4kg.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{ue,_t,ls}from"./chunk-g8gzxhp8.js";function nr(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?ue(a,e):null,h=u?_t(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
2
+ import{de,Et,us}from"./chunk-j1rnhv0w.js";function rr(e,a){let t=e.pwa;if(!t?.enabled)return"";let c=t.serviceWorker||{},d=t.routes||[],i=c.cacheVersion||"1.0.0",o=t.offline,l=o?.page?"/offline.html":"/offline.html",{push:r,backgroundSync:s,cacheStorage:n}=t,u=a?de(a,e):null,h=u?Et(u):"[]",f=["/","/manifest.json",...o?.enabled?[l]:[],...o?.precacheAssets||[]];return`/**
3
3
  * Service Worker - Auto-generated by stx
4
4
  * Cache Version: ${i}
5
5
  *
@@ -13,7 +13,7 @@ import{ue,_t,ls}from"./chunk-g8gzxhp8.js";function nr(e,a){let t=e.pwa;if(!t?.en
13
13
  * Additional features:
14
14
  * - Push notifications: ${r?.enabled?"enabled":"disabled"}
15
15
  * - Background sync: ${s?.enabled?"enabled":"disabled"}
16
- * - Cache limits: ${n?.maxSize?`${ls(n.maxSize*1024*1024)}`:"unlimited"}
16
+ * - Cache limits: ${n?.maxSize?`${us(n.maxSize*1024*1024)}`:"unlimited"}
17
17
  */
18
18
 
19
19
  const CACHE_VERSION = '${i}';
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
825
825
  event.waitUntil(registerFormSync(event.data.payload));
826
826
  }
827
827
  });
828
- `}function Ue(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function ii(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function fc(e,a){if(!e.pwa?.enabled)return"";if(ii(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-0z189871.js");return t(e,a)}return nr(e,a)}
829
- export{nr,Ue,ii,fc};
828
+ `}function We(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function ai(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function gc(e,a){if(!e.pwa?.enabled)return"";if(ai(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-t84ww3qb.js");return t(e,a)}return rr(e,a)}
829
+ export{rr,We,ai,gc};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ve,ln,Cu}from"./chunk-dz4hrgw8.js";import{K,un,Eu,dn,os,Qn,er,Tu,$u,Ru,pn,fn,is,tr,Au}from"./chunk-0jeqp6yz.js";import"./chunk-rns21kkv.js";export{os as batch,Cu as default,un as derived,dn as effect,Ve as generateSignalsRuntime,ln as generateSignalsRuntimeDev,fn as isDerived,pn as isSignal,Eu as memo,er as onDestroy,Qn as onMount,tr as peek,Ru as pendingLifecycleCounts,$u as runDestroyCallbacks,Tu as runMountCallbacks,K as state,is as untrack,Au as useOptimistic};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{rr,We,ai,gc}from"./chunk-b7p3yca7.js";export{rr as generateServiceWorker,gc as generateServiceWorkerAuto,We as getServiceWorkerFileName,ai as isWorkboxEnabled};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Pu,Vo,ic,Iu,Ou,Nu,Du,Mu,ac,cc,Lu,ju,Bu,Fu}from"./chunk-qvqgbvfa.js";import"./chunk-b5cv9xp7.js";import"./chunk-62kxavc5.js";import"./chunk-2wvz3fd2.js";import"./chunk-nz6bzffm.js";import"./chunk-70npkeh2.js";import"./chunk-3p2b88pd.js";import"./chunk-7ky2ny63.js";import"./chunk-evs5gb3q.js";import"./chunk-9b4e815s.js";import"./chunk-4fv3jq16.js";import"./chunk-rns21kkv.js";import"./chunk-d1ya7f79.js";import"./chunk-1ma56c2h.js";export{ic as SUSPENSE_RESOLVER_RUNTIME,Vo as buildSuspenseResolveScript,Mu as createStreamRenderer,Nu as extractStreamBoundaries,Fu as generateHydrationRuntime,cc as islandDirective,ju as processSectionDirectives,Ou as processStreamDirectives,Lu as registerStreamingDirectives,Iu as renderStreamingPage,Pu as streamTemplate,Du as streamTemplateSimple,Bu as streamToResponse,ac as streamingSuspenseDirective};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{rr,We,Se,ke,yi,cr,se,Z,_n,u,n,A}from"./chunk-ptas1qqx.js";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(s,p){let m;while((m=s.exec(o))!==null){let t=m.index,i=t+m[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:g}=rr(o),c=await(e.renderer??((s)=>We(s)))(g);return{html:_(c),frontmatter:r??{}}}import{dirname as C,resolve as R}from"path";function k(o){let e=o,r=se(o);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),m;while((m=g.exec(o))!==null){let i=m[1],l=m[2],f=m[0],d=i.includes("server");if(p(l))s.push(f);else if(d)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let d=l.index+l[0].length,x=t.indexOf("</script>",d);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let d=f.length-1;d>=0;d--)t=t.substring(0,f[d].start)+t.substring(f[d].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
2
+ import{sr,qe,ke,_e,bi,lr,oe,Q,En,u,n,A}from"./chunk-b5cv9xp7.js";function h(o){return o.endsWith(".md")||o.endsWith(".markdown")}function _(o){let e=[];g(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let r=[...e];g(/<code\b[^>]*>[\s\S]*?<\/code>/gi,r);function g(s,p){let m;while((m=s.exec(o))!==null){let t=m.index,i=t+m[0].length;if(p?.some((l)=>t>=l.start&&i<=l.end))continue;e.push({start:t,end:i})}}if(e.length===0)return o;e.sort((s,p)=>s.start-p.start);let a="",c=0;for(let s of e){if(s.start<c)continue;a+=o.slice(c,s.start),a+=`@raw${o.slice(s.start,s.end)}@endraw`,c=s.end}return a+=o.slice(c),a}async function b(o,e={}){let{data:r,content:g}=sr(o),c=await(e.renderer??((s)=>qe(s)))(g);return{html:_(c),frontmatter:r??{}}}import{dirname as C,resolve as R}from"path";function k(o){let e=o,r=oe(o);if(r)e=r.content.trim();let g=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],s=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),m;while((m=g.exec(o))!==null){let i=m[1],l=m[2],f=m[0],d=i.includes("server");if(p(l))s.push(f);else if(d)c.push(l);else a.push(f)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,f=[];while((l=i.exec(t))!==null){let d=l.index+l[0].length,x=t.indexOf("</script>",d);if(x===-1)continue;f.push({start:l.index,end:x+9}),i.lastIndex=x+9}for(let d=f.length-1;d>=0;d--)t=t.substring(0,f[d].start)+t.substring(f[d].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:s}}function v(o,e){return`<!DOCTYPE html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="UTF-8">
@@ -9,10 +9,10 @@ import{rr,We,Se,ke,yi,cr,se,Z,_n,u,n,A}from"./chunk-ptas1qqx.js";function h(o){r
9
9
  <body>
10
10
  ${o}
11
11
  </body>
12
- </html>`}async function Zo(o,e={}){let r=R(o),g=Bun.file(r);if(!await g.exists())throw Error(`Template file not found: ${r}`);let a=await g.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:m,injectCSS:t,...i}=e,l={...e.context||{}};_n(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),d=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(d,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:g,serverScripts:a,clientScripts:c}=k(o),s={...A,...r.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...cr(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await u(i,p,e);let m=new Set,t=g;if(t=await n(t,p,e,s,m),yi(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
12
+ </html>`}async function Qo(o,e={}){let r=R(o),g=Bun.file(r);if(!await g.exists())throw Error(`Template file not found: ${r}`);let a=await g.text(),c=null;if(h(r)){let s=await b(a,{renderer:e.markdownRenderer});a=s.html,c=s.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let s=R(e.layout),p=Bun.file(s);if(!await p.exists())throw Error(`Layout template not found: ${s}`);let{layout:m,injectCSS:t,...i}=e,l={...e.context||{}};En(l);let f=await S(a,r,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),d=await p.text(),x={...l,content:f},w={...i,context:x,injectCSS:t};return S(d,s,w)}return S(a,r,e)}async function S(o,e,r={}){let{templateContent:g,serverScripts:a,clientScripts:c}=k(o),s={...A,...r.options},p={__filename:e,__dirname:C(e),__stx:{},__stx_options:s,__stx_sfc_mode:!0,__stx_inject_css:r.injectCSS===!0,__stxServeContext:void 0,...lr(r.context??{}),definePageMeta:()=>{},...r.context||{}};for(let i of a)await u(i,p,e);let m=new Set,t=g;if(t=await n(t,p,e,s,m),bi(p,r.context),r.templateOnly){if(t=t.replace(/<script data-stx-scoped>[\s\S]*?<\/script>\s*/gi,""),t=t.replace(/<!-- stx SEO Tags -->[\s\S]*?(?=<)/i,""),c.length>0)t+=`
13
13
  ${c.join(`
14
- `)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=Se(p),d=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await ke(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
14
+ `)}`}else{if(r.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=ke(p),d=(await Promise.all(c.map(async(w)=>{let y=w.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!y)return w;return await _e(y[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})}))).join(`
15
15
  `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${d}
16
16
  $1`);else t+=`
17
- ${d}`}t=await Z(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-bdnahg9m.js");t=await i(t)}catch{}return t}
18
- export{Zo};
17
+ ${d}`}t=await Q(t)}if(r.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=v(t,r.title)}if(r.injectCSS)try{let{injectCss:i}=await import("./chunk-t91250ag.js");t=await i(t)}catch{}return t}
18
+ export{Qo};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{wl}from"./chunk-hc1m2psz.js";import"./chunk-kf2vas4j.js";import"./chunk-1e25xd0z.js";import"./chunk-b5cv9xp7.js";import"./chunk-62kxavc5.js";import"./chunk-2wvz3fd2.js";import"./chunk-nz6bzffm.js";import"./chunk-70npkeh2.js";import"./chunk-3p2b88pd.js";import"./chunk-7ky2ny63.js";import"./chunk-evs5gb3q.js";import"./chunk-9b4e815s.js";import"./chunk-4fv3jq16.js";import"./chunk-rns21kkv.js";import"./chunk-d1ya7f79.js";import"./chunk-1ma56c2h.js";export{wl as startProductionServer};
@@ -1,7 +1,7 @@
1
1
  // @bun
2
- import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function P(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return P(e.replace(/^\//,""))}function oo(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
3
- `),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function io(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
4
- `))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function ut(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function Q(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function Fn(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Rr(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return Q(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function F(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...F(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class zn{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=F(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:H,params:M}=Q(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:H,params:M,filePath:h,isDynamic:M.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");oo(this.routes,s),io(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Ar(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Pr(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function il(e){k=e.replace(/\/$/,"")}function al(e,t,a={}){f[e]={path:t,name:e,params:a}}function cl(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function Hn(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function ll(){for(let e of Object.keys(f))delete f[e];k=""}import B from"fs";import U from"path";function ul(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function dl(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function pl(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function ca(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function la(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function ua(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function ao(e,t){v.set(e,t)}function da(e){return v.get(e)}function fl(e){return v.has(e)}function dt(){v.clear()}function pt(){return Array.from(v.keys())}async function ft(e,t="middleware"){let a=U.resolve(e,t);if(!B.existsSync(a))return;let r=B.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")ao(o,s);else if(typeof s==="function")ao(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function gt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function mt(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?ca(a,i):la(),storage:ua(),state:{},request:a,responseHeaders:i}}async function ht(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=da(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Ir(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function Ie(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Ir(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function q(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function X(){return`
2
+ import x from"fs";import u from"path";import p from"fs";import w from"path";var y=["components","layouts","partials","emails"];function P(e){return e.split(/[\\/]/).filter(Boolean).slice(0,-1).some((a)=>y.includes(a))}function b(e){return P(e.replace(/^\//,""))}function io(e,t){let a=e.filter((i)=>!b(i.pattern)),r=["// Auto-generated by STX - do not edit"];if(a.length===0)r.push("// No page routes found \u2014 route paths stay typed as string.","export {}","");else{r.push("declare module '@stacksjs/stx' {"," interface KnownRoutes {");for(let i of a){let c=[];for(let l of i.params){let d=i.pattern.includes(`:${l}?`)?"?":"";c.push(`${l}${d}: string`)}let s=c.join("; ");r.push(` '${i.pattern}': { ${s} }`)}r.push(" }","}","","export {}","")}let n=r.join(`
3
+ `),o=w.join(t,"route-types.d.ts");try{if(p.existsSync(o)&&p.readFileSync(o,"utf8")===n)return;p.mkdirSync(t,{recursive:!0}),p.writeFileSync(o,n)}catch{}}function ao(e,t,a){let r=process.cwd(),n=w.relative(r,a),o=e.filter((c)=>!b(c.pattern)),i=["// Auto-generated by stx \u2014 do not edit",`// Source: ${n||"pages"}/`,"","export const routes = ["];for(let c of o){let s=w.relative(r,c.filePath).replace(/\\/g,"/"),l=JSON.stringify(c.params),d=c.layout?`, layout: '${w.relative(r,c.layout).replace(/\\/g,"/")}'`:"";i.push(` { pattern: '${c.pattern}', filePath: '${s}', isDynamic: ${c.isDynamic}, params: ${l}${d} },`)}i.push("] as const",""),i.push("export type RouteName = typeof routes[number]['pattern']",""),p.mkdirSync(t,{recursive:!0}),p.writeFileSync(w.join(t,"routes.ts"),i.join(`
4
+ `))}import I from"path";var N=Object.freeze(["ico","png","jpg","jpeg","gif","webp","avif","svg","bmp","tif","tiff","heic","css","js","mjs","cjs","map","wasm","webmanifest","json","xml","txt","rss","atom","woff","woff2","ttf","otf","eot","mp3","mp4","m4a","m4v","mov","webm","ogg","ogv","oga","wav","flac","avi","mkv","pdf","csv","doc","docx","xls","xlsx","ppt","pptx","rtf","odt","zip","gz","tgz","tar","rar","7z","bz2","xz","php","phtml","asp","aspx","jsp","cgi","env","ini","yml","yaml","toml","sql","bak","old","swp","log","conf","cfg","exe","dmg","pkg","apk","ipa","msi","iso","bin","dll"]),D=N.flatMap((e)=>e===e.toUpperCase()?[e]:[e,e.toUpperCase()]).join("|"),G=new RegExp(`\\.(?:${D})$`),E=`(?![^/]*\\.(?:${D})$)`;function dt(e){let t=e,a=t.search(/[?#]/);if(a!==-1)t=t.slice(0,a);let r=t.slice(t.lastIndexOf("/")+1);return r.length>0&&G.test(r)}function R(e,t){let r=I.relative(t,e).replace(/\.(stx|md)$/,"");if(r=r.split(I.sep).join("/"),r==="index")return"/";if(r.endsWith("/index"))r=r.slice(0,-6);return r=r.replace(/\[\[([^\]]+)\]\]/g,":$1?"),r=r.replace(/\[([^\]]+)\]/g,":$1"),r=r.replace(/:\.\.\.([^/]+)/g,":$1*"),`/${r}`}function ee(e,t={}){let a=t.page?E:"",r=[],n="",o=0;while(o<e.length){let i=e.slice(o),c=/^\/:([^/?*]+)\?/.exec(i);if(c){r.push(c[1]);let d=o+c[0].length===e.length;n+=`(?:/${d?a:""}([^/]+))?`,o+=c[0].length;continue}let s=/^:([^/?*]+)\*/.exec(i);if(s){r.push(s[1]),n+="(.+)",o+=s[0].length;continue}let l=/^:([^/?*]+)/.exec(i);if(l){r.push(l[1]);let d=o+l[0].length===e.length;n+=`${d?a:""}([^/]+)`,o+=l[0].length;continue}n+=e[o].replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),o+=1}return{regex:new RegExp(`^${n}$`),params:r}}function zn(e,t){let a=e===""?"/":e;for(let r of t){let n=a.match(r.regex);if(n){let o={};return r.params.forEach((i,c)=>{o[i]=n[c+1]}),{route:r,params:o}}}return null}function Ar(e,t={}){let a=e.replace(/\[\[([^\]]+)\]\]/g,":$1?").replace(/\[([^\]]+)\]/g,":$1").replace(/:\.\.\.([^/]+)/g,":$1*");return ee(a,t)}import j from"fs";import L from"path";function _(e,t){let a=[],r=L.dirname(e);while(r.startsWith(t)||r===t){let n=L.join(r,"_layout.stx");if(j.existsSync(n))a.unshift(n);if(r===t)break;r=L.dirname(r)}return a}function F(e,t){let a=[];if(!x.existsSync(e))return a;let r=x.readdirSync(e,{withFileTypes:!0});for(let n of r){let o=u.join(e,n.name);if(n.isDirectory()){if(n.name.startsWith("."))continue;if(y.includes(n.name))continue;a.push(...F(o,t))}else if(n.isFile()){let i=u.extname(n.name);if(t.includes(i)){if(n.name.startsWith("_")&&n.name!=="_layout.stx")continue;if(n.name==="_layout.stx")continue;a.push(o)}}}return a}class Hn{routes;pagesDir;pagesDirs;config;constructor(e,t={}){this.config=t;let a=t.pagesDirs&&t.pagesDirs.length>0?t.pagesDirs:[t.pagesDir||"pages"];this.pagesDirs=a.map((s)=>u.resolve(e,s)),this.pagesDir=this.pagesDirs[0];let r=t.extensions||[".stx"],n=(s)=>{let l=u.resolve(e,s);try{return x.realpathSync(l)}catch{return l}},o=(t.exclude??[]).filter((s)=>typeof s==="string"&&s.trim()!=="").map(n),i=(s)=>{if(o.length===0)return!1;let l=n(s);return o.some((d)=>l===d||l.startsWith(`${d}${u.sep}`))},c=new Set;this.routes=[];for(let s of this.pagesDirs){let l=F(s,r).filter((h)=>!i(h)),d=new Map;for(let h of l){let g=R(h,s),m=t.pagesDirs?g.replace(/:[\w]+/g,":param"):g;if(t.pagesDirs&&d.has(m))throw Error(`Conflicting layer pages for ${g}: ${d.get(m)} and ${h}`);if(d.set(m,h),c.has(m))continue;c.add(m);let{regex:H,params:M}=ee(g,{page:!0}),C=t.layouts!==!1?_(h,s):[];this.routes.push({pattern:g,regex:H,params:M,filePath:h,isDynamic:M.length>0,layout:C.length>0?C[C.length-1]:void 0})}}if(this.routes.sort((s,l)=>{if(!s.isDynamic&&l.isDynamic)return-1;if(s.isDynamic&&!l.isDynamic)return 1;let d=s.pattern.split("/").length,h=l.pattern.split("/").length;if(d!==h)return h-d;return s.pattern.localeCompare(l.pattern)}),t.emit!==!1){let s=u.resolve(e,t.stateDir||process.env.STX_DIR?.trim()||".stx");io(this.routes,s),ao(this.routes,s,this.pagesDir)}}match(e){let t=e===""?"/":e;for(let a of this.routes){let r=t.match(a.regex);if(r){let n={};return a.params.forEach((o,i)=>{n[o]=r[i+1]}),{route:a,params:n}}}return null}resolve(e,t){let a=this.routes.find((n)=>n.pattern===e||n.filePath.includes(e));if(!a)return"#not-found";let r=a.pattern;if(t)for(let[n,o]of Object.entries(t))r=r.replace(`:${n}`,encodeURIComponent(o));return r}addRoute(e){this.routes.push(e),this.routes.sort((t,a)=>{if(!t.isDynamic&&a.isDynamic)return-1;if(t.isDynamic&&!a.isDynamic)return 1;return t.pattern.localeCompare(a.pattern)})}getLayout(e){return e.layout??null}}function Pr(e,t){let a=[`${t}.stx`,"error.stx"];for(let r of a){let n=u.join(e,r);if(x.existsSync(n))return n}return null}function Ir(e,t){return e.map((a)=>{let r=u.relative(t,a.filePath),n=a.isDynamic?" (dynamic)":"";return`${a.pattern} \u2192 ${r}${n}`})}var f={},k="";function il(e){k=e.replace(/\/$/,"")}function al(e,t,a={}){f[e]={path:t,name:e,params:a}}function cl(e){for(let[t,a]of Object.entries(e))if(typeof a==="string")f[t]={path:a,name:t};else f[t]={...a,name:t}}function Vn(e,t={},a=!1){let r=f[e];if(!r)return console.warn(`Route [${e}] not defined.`),"#undefined-route";let n={...r.params,...t},o=r.path;o=o.replace(/:(\w+)/g,(c,s)=>{let l=n[s];if(l===void 0)return console.warn(`Missing parameter [${s}] for route [${e}].`),`:${s}`;return delete n[s],encodeURIComponent(String(l))});let i=Object.entries(n);if(i.length>0){let c=i.map(([s,l])=>`${encodeURIComponent(s)}=${encodeURIComponent(String(l))}`).join("&");o+=(o.includes("?")?"&":"?")+c}return a&&k?`${k}${o}`:o}function ll(){for(let e of Object.keys(f))delete f[e];k=""}import B from"fs";import U from"path";function ul(e,t={}){return{type:"redirect",path:e,options:{replace:t.replace??!1,external:t.external??!1,redirectCode:t.redirectCode??302}}}function dl(e){return{type:"abort",error:typeof e==="string"?{statusCode:500,message:e}:e}}function pl(e,t={}){return{handler:e,mode:t.mode??"universal"}}function O(e){let t={};if(!e)return t;let a=e.split(";");for(let r of a){let[n,...o]=r.split("=");if(n){let i=n.trim(),c=o.join("=").trim();if(i)t[i]=decodeURIComponent(c)}}return t}function S(e,t,a={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(t)}`;if(a.expires){let n=typeof a.expires==="number"?new Date(Date.now()+a.expires*1000):a.expires;r+=`; Expires=${n.toUTCString()}`}if(a.path)r+=`; Path=${a.path}`;if(a.domain)r+=`; Domain=${a.domain}`;if(a.secure)r+="; Secure";if(a.httpOnly)r+="; HttpOnly";if(a.sameSite)r+=`; SameSite=${a.sameSite}`;return r}function la(e,t){let a=e.headers.get("cookie")||"",r=O(a);return{get(n){return r[n]},set(n,o,i={}){r[n]=o,t.append("Set-Cookie",S(n,o,i))},delete(n){delete r[n],t.append("Set-Cookie",S(n,"",{expires:new Date(0),path:"/"}))},getAll(){return{...r}}}}function ua(){return{get(e){if(typeof document>"u")return;return O(document.cookie)[e]},set(e,t,a={}){if(typeof document>"u")return;document.cookie=S(e,t,a)},delete(e){if(typeof document>"u")return;document.cookie=S(e,"",{expires:new Date(0),path:"/"})},getAll(){if(typeof document>"u")return{};return O(document.cookie)}}}function da(){let e=typeof window<"u"&&typeof window.localStorage<"u";return{get(t){if(!e)return null;try{return window.localStorage.getItem(t)}catch{return null}},set(t,a){if(!e)return;try{window.localStorage.setItem(t,a)}catch{}},remove(t){if(!e)return;try{window.localStorage.removeItem(t)}catch{}},isAvailable(){return e}}}var v=new Map;function co(e,t){v.set(e,t)}function pa(e){return v.get(e)}function fl(e){return v.has(e)}function pt(){v.clear()}function ft(){return Array.from(v.keys())}async function gt(e,t="middleware"){let a=U.resolve(e,t);if(!B.existsSync(a))return;let r=B.readdirSync(a);for(let n of r){if(!n.endsWith(".ts")&&!n.endsWith(".js"))continue;if(n.includes(".test.")||n.includes(".spec."))continue;let o=n.replace(/\.(ts|js)$/,""),i=U.join(a,n);try{let s=(await import(i)).default;if(s&&typeof s.handler==="function")co(o,s);else if(typeof s==="function")co(o,{handler:s,mode:"universal"})}catch(c){console.warn(`Failed to load middleware '${o}' from ${i}:`,c)}}}function K(e){let t={};if(!e)return t;let a=new URLSearchParams(e);for(let[r,n]of a)t[r]=n;return t}function mt(e,t,a,r=""){return{path:e,params:t,query:K(r),fullPath:r?`${e}?${r}`:e,meta:a}}function ht(e,t,a,r){let n=r?.isServer??typeof window>"u",o=!n,i=new Headers;return{to:e,from:t,isClient:o,isServer:n,cookies:n&&a?la(a,i):ua(),storage:da(),state:{},request:a,responseHeaders:i}}async function yt(e,t){let a=Array.isArray(e)?e:[e],r=t.isServer;for(let n of a){let o=pa(n);if(!o)return console.error(`Route middleware '${n}' is not registered \u2014 failing the guard closed.`),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:`Route middleware '${n}' is not registered`}},state:t.state,responseHeaders:t.responseHeaders};if(o.mode==="server"&&!r)continue;try{let i=await o.handler(t);if(i){if(i.type==="redirect")return{passed:!1,redirect:i,state:t.state,responseHeaders:t.responseHeaders};if(i.type==="abort")return{passed:!1,abort:i,state:t.state,responseHeaders:t.responseHeaders}}}catch(i){return console.error(`Error in middleware '${n}':`,i),{passed:!1,abort:{type:"abort",error:{statusCode:500,message:i instanceof Error?i.message:"Middleware error"}},state:t.state,responseHeaders:t.responseHeaders}}}return{passed:!0,state:t.state,responseHeaders:t.responseHeaders}}function Or(e){let a=e.replace(/\\/g,"/").split("/").filter(Boolean),r=a.lastIndexOf("layouts"),n=r>=0?a[r+1]:a.at(-1);if(!n)return"app";return n.replace(/\.stx$/i,"")||"app"}function Oe(e){let t=e.match(/<meta\b[^>]*name=["']stx-layout["'][^>]*content=["']([^"']+)["'][^>]*>/i),a=e.match(/<meta\b[^>]*name=["']stx-layout-group["'][^>]*content=["']([^"']+)["'][^>]*>/i),r=e.match(/<!--\s*stx-layout:\s*([^ ]+)\s*-->/i),n=t?.[1]||r?.[1]||"";return{layout:n,group:a?.[1]||Or(n)}}var A,T;function W(e){let t=[],a="log(",r=0;while(r<e.length){let n=e.indexOf("log(",r);if(n===-1){t.push(e.slice(r));break}let o=n>0?e[n-1]:" ",i=/\bfunction\s+$/.test(e.slice(Math.max(0,n-16),n));if(/[\w$.]/.test(o)||i){t.push(e.slice(r,n+4)),r=n+4;continue}t.push(e.slice(r,n));let c=1,s=n+4;while(s<e.length&&c>0){let l=e[s];if(l==='"'||l==="'"||l==="`"){let d=l;s++;while(s<e.length&&e[s]!==d){if(e[s]==="\\")s++;s++}s++;continue}if(l==="(")c++;else if(l===")")c--;s++}t.push("0"),r=s}return t.join("")}function q(e,t=!1){try{return new Bun.Transpiler(t?{loader:"js",minify:{whitespace:!0,identifiers:!0}}:{loader:"js",minifyWhitespace:!0}).transformSync(e).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return e}}function X(){return`
5
5
  ;(function(){
6
6
  'use strict';
7
7
  var ROUTER_REV=7;
@@ -3939,4 +3939,4 @@ else {
3939
3939
 
3940
3940
  if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',init);else init();
3941
3941
  })();
3942
- `}function Oe(){if(A)return A;return A=q(W(X()),!0),A}function gl(){if(T)return T;return T=q(X()),T}export{oo,io,ut,Q,Fn,Rr,zn,Ar,Pr,il,al,cl,Hn,ll,ul,dl,pl,ca,la,ua,ao,da,fl,dt,pt,ft,gt,mt,ht,Ir,Ie,Oe,gl};
3942
+ `}function Ne(){if(A)return A;return A=q(W(X()),!0),A}function gl(){if(T)return T;return T=q(X()),T}export{io,ao,dt,ee,zn,Ar,Hn,Pr,Ir,il,al,cl,Vn,ll,ul,dl,pl,la,ua,da,co,pa,fl,pt,ft,gt,mt,ht,yt,Or,Oe,Ne,gl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Cn,Lc,$s}from"./chunk-b5cv9xp7.js";import"./chunk-62kxavc5.js";import"./chunk-2wvz3fd2.js";import"./chunk-nz6bzffm.js";import"./chunk-70npkeh2.js";import"./chunk-3p2b88pd.js";import"./chunk-7ky2ny63.js";import"./chunk-evs5gb3q.js";import{Ie}from"./chunk-9b4e815s.js";import"./chunk-4fv3jq16.js";import"./chunk-rns21kkv.js";import"./chunk-d1ya7f79.js";import"./chunk-1ma56c2h.js";export{Ie as freeIdentifiers,$s as processComponents,Lc as processESImports,Cn as rendersAsElement};