@stacksjs/stx 0.2.645 → 0.2.648

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 (264) hide show
  1. package/dist/builtins/attrs.js +6 -6
  2. package/dist/builtins/escape.d.ts +0 -11
  3. package/dist/builtins/escape.js +2 -1
  4. package/dist/builtins/safe-image.js +1 -3
  5. package/dist/builtins/stx-image.js +1 -3
  6. package/dist/builtins/stx-link.d.ts +3 -0
  7. package/dist/builtins/stx-link.js +1 -3
  8. package/dist/{chunk-apeyn69a.js → chunk-04kg16qs.js} +4 -4
  9. package/dist/chunk-06w0z1cm.js +31 -0
  10. package/dist/chunk-0en5jwjy.js +2 -0
  11. package/dist/{chunk-ph8dqgr5.js → chunk-0h8tg21j.js} +14 -14
  12. package/dist/{chunk-g2mcw1r4.js → chunk-0jhdrgpr.js} +2 -2
  13. package/dist/chunk-0vkawews.js +21 -0
  14. package/dist/{chunk-hpggz2t4.js → chunk-120ze5ms.js} +3 -3
  15. package/dist/chunk-2a4szpje.js +3 -0
  16. package/dist/chunk-2f17h17f.js +2 -0
  17. package/dist/{chunk-a0ygyftk.js → chunk-2h8ea0we.js} +2 -2
  18. package/dist/{chunk-3ns5k9nf.js → chunk-2jh21f1n.js} +2 -2
  19. package/dist/chunk-2n3pa5gm.js +2 -0
  20. package/dist/{chunk-ktvr45qg.js → chunk-2qbvsvwc.js} +2 -2
  21. package/dist/chunk-354jmw2k.js +3 -0
  22. package/dist/chunk-3b5bphcn.js +2 -0
  23. package/dist/chunk-3p7mk3mw.js +2 -0
  24. package/dist/chunk-3q163st5.js +1312 -0
  25. package/dist/chunk-3zyjqvsq.js +42 -0
  26. package/dist/{chunk-mfd3fca7.js → chunk-481d4kr9.js} +11 -11
  27. package/dist/chunk-4q2dtxdk.js +2 -0
  28. package/dist/{chunk-1t0m4pwg.js → chunk-4yf1w261.js} +2 -2
  29. package/dist/chunk-4yt8tg4j.js +2 -0
  30. package/dist/chunk-52gp2xxk.js +2 -0
  31. package/dist/chunk-55zaxb4s.js +61 -0
  32. package/dist/chunk-57md41g9.js +2 -0
  33. package/dist/chunk-67kj14at.js +2 -0
  34. package/dist/chunk-67xhsacd.js +12 -0
  35. package/dist/{chunk-me1tdtzz.js → chunk-6ajahb2x.js} +3 -3
  36. package/dist/chunk-6ea6az61.js +4 -0
  37. package/dist/chunk-6vh8s0pg.js +2 -0
  38. package/dist/chunk-6vzktvyw.js +2 -0
  39. package/dist/{chunk-r2seygb5.js → chunk-7rta163c.js} +2 -2
  40. package/dist/chunk-84djpte6.js +3 -0
  41. package/dist/chunk-864qtx7y.js +2 -0
  42. package/dist/chunk-88z4wkrj.js +6 -0
  43. package/dist/chunk-89yj6tcd.js +2 -0
  44. package/dist/chunk-8d2f2e42.js +2 -0
  45. package/dist/chunk-8fsq2ynj.js +2 -0
  46. package/dist/chunk-8p9kpfk8.js +4 -0
  47. package/dist/chunk-8tpmz4as.js +2 -0
  48. package/dist/chunk-9121nkpj.js +11 -0
  49. package/dist/{chunk-rmj0n3ss.js → chunk-9p6efb17.js} +1 -1
  50. package/dist/chunk-9szxxgv5.js +2 -0
  51. package/dist/{chunk-4g8zase6.js → chunk-9txn4rvb.js} +2 -2
  52. package/dist/chunk-9x0zt65f.js +2 -0
  53. package/dist/chunk-a2bw46t9.js +2 -0
  54. package/dist/{chunk-gvr10eqb.js → chunk-a3d0g4mr.js} +2 -2
  55. package/dist/chunk-a4sggwcz.js +2 -0
  56. package/dist/chunk-ab7zqtax.js +3 -0
  57. package/dist/{chunk-v1mvbf82.js → chunk-aprhqxky.js} +5 -5
  58. package/dist/chunk-b0hpshvk.js +2 -0
  59. package/dist/chunk-b4fd2dtk.js +2 -0
  60. package/dist/chunk-c1479y92.js +2 -0
  61. package/dist/{chunk-kchphxkm.js → chunk-c1dkh0es.js} +3 -3
  62. package/dist/chunk-c9k40352.js +2 -0
  63. package/dist/{chunk-ahyq08mp.js → chunk-ce6zddpf.js} +3 -3
  64. package/dist/{chunk-9wbtj6tj.js → chunk-dgb4z4kw.js} +2 -2
  65. package/dist/chunk-e87xa4r3.js +4 -0
  66. package/dist/chunk-egg54kd0.js +12 -0
  67. package/dist/chunk-embejqx4.js +2 -0
  68. package/dist/chunk-er60h3j3.js +2 -0
  69. package/dist/{chunk-pp6ycfay.js → chunk-ewcrsyr7.js} +2 -2
  70. package/dist/chunk-eyfxw7ds.js +2 -0
  71. package/dist/chunk-f3y4fnaa.js +2 -0
  72. package/dist/chunk-f46ht5kq.js +20 -0
  73. package/dist/chunk-f7930sce.js +2 -0
  74. package/dist/chunk-fcn71bq1.js +2 -0
  75. package/dist/{chunk-38ngmh6h.js → chunk-fg3jw17w.js} +48 -48
  76. package/dist/chunk-fsbjat59.js +2 -0
  77. package/dist/chunk-g2jmwh7p.js +2 -0
  78. package/dist/chunk-g8r0km7g.js +106 -0
  79. package/dist/{chunk-qa625vwc.js → chunk-gv793yqq.js} +4 -4
  80. package/dist/chunk-gz90fqn8.js +2 -0
  81. package/dist/chunk-h15xb2vd.js +2 -0
  82. package/dist/chunk-h5nmf98w.js +2 -0
  83. package/dist/{chunk-w9zxb26s.js → chunk-hfpv56cp.js} +1 -1
  84. package/dist/chunk-hhmj9gpk.js +2 -0
  85. package/dist/chunk-hjm69qnj.js +2 -0
  86. package/dist/chunk-hvtzw1jh.js +2 -0
  87. package/dist/{chunk-4n24jbfs.js → chunk-hvzzhkhr.js} +2 -2
  88. package/dist/chunk-j0v970k3.js +2 -0
  89. package/dist/chunk-j393gsfd.js +20 -0
  90. package/dist/chunk-j5gd0e53.js +2 -0
  91. package/dist/chunk-jk41jwsc.js +2 -0
  92. package/dist/{chunk-kvn23sz5.js → chunk-jkaszw24.js} +4 -4
  93. package/dist/{chunk-6mnwvn9v.js → chunk-jkvr7e91.js} +2 -2
  94. package/dist/{chunk-2zcbx82x.js → chunk-jxda11cg.js} +2 -2
  95. package/dist/chunk-k2pa44rf.js +2 -0
  96. package/dist/{chunk-kad2cp0z.js → chunk-k79x96ra.js} +37 -37
  97. package/dist/{chunk-75c46b62.js → chunk-kgfgb971.js} +4 -4
  98. package/dist/chunk-m6qfqkbh.js +2 -0
  99. package/dist/{chunk-r7haw6r7.js → chunk-mmwedr93.js} +5 -5
  100. package/dist/chunk-mnp8ecj9.js +2 -0
  101. package/dist/{chunk-dyg6sadv.js → chunk-mrrrngzd.js} +1 -1
  102. package/dist/{chunk-fk1rs7jb.js → chunk-n38yb274.js} +6 -6
  103. package/dist/chunk-ncqh5qe5.js +2 -0
  104. package/dist/chunk-nj1t4g3a.js +25 -0
  105. package/dist/{chunk-3cqxtkqv.js → chunk-np4zm2ph.js} +7 -7
  106. package/dist/{chunk-7jgtphhg.js → chunk-nrvwejdw.js} +5 -5
  107. package/dist/{chunk-c96f3eq5.js → chunk-nt0n0vjm.js} +8 -8
  108. package/dist/chunk-p44kmbdg.js +65 -0
  109. package/dist/chunk-pbtkbe48.js +888 -0
  110. package/dist/{chunk-pf5s5gjp.js → chunk-pg0xzsss.js} +2 -2
  111. package/dist/{chunk-pvfx0dgz.js → chunk-prf164ct.js} +2 -2
  112. package/dist/chunk-pxs7sgnp.js +3 -0
  113. package/dist/chunk-qfe7ps3v.js +18 -0
  114. package/dist/chunk-qm4672dj.js +18 -0
  115. package/dist/{chunk-2bsrmqr8.js → chunk-qv6axke4.js} +2 -2
  116. package/dist/chunk-r1r6311d.js +14 -0
  117. package/dist/{chunk-n54c06wt.js → chunk-r3e6x87d.js} +3 -3
  118. package/dist/chunk-radggg3p.js +49 -0
  119. package/dist/{chunk-zm4s3n4p.js → chunk-rcadtv3x.js} +1 -1
  120. package/dist/{chunk-vbqts5sf.js → chunk-rjh2jwxx.js} +9 -9
  121. package/dist/chunk-sf0wsq74.js +2 -0
  122. package/dist/{chunk-kfq594fh.js → chunk-sgptbhrc.js} +2 -2
  123. package/dist/chunk-shpc1ttk.js +2 -0
  124. package/dist/chunk-sszhz1zh.js +2 -0
  125. package/dist/chunk-szyqxcfj.js +3 -0
  126. package/dist/{chunk-392pj66x.js → chunk-t1k9160w.js} +29 -29
  127. package/dist/{chunk-22hdbqad.js → chunk-t2pzy3x1.js} +3 -3
  128. package/dist/chunk-t6yjxhn8.js +2 -0
  129. package/dist/chunk-t82be9yf.js +2 -0
  130. package/dist/{chunk-g06qzkmp.js → chunk-tre98h62.js} +2 -2
  131. package/dist/{chunk-bsts9pr5.js → chunk-v2x9vzgw.js} +2 -2
  132. package/dist/chunk-vdxjy7j2.js +4 -0
  133. package/dist/{chunk-xbdbn3bf.js → chunk-vmwdt8fr.js} +5 -5
  134. package/dist/{chunk-fqg0espy.js → chunk-vqc4h16r.js} +2 -2
  135. package/dist/chunk-w2zceynt.js +2 -0
  136. package/dist/chunk-weqc0ssb.js +2 -0
  137. package/dist/chunk-wjt0kej9.js +3 -0
  138. package/dist/{chunk-9yk5rasj.js → chunk-wpm58d6p.js} +3 -3
  139. package/dist/{chunk-0zr1zxar.js → chunk-wpmrz872.js} +2 -2
  140. package/dist/chunk-wq6j2h32.js +33 -0
  141. package/dist/chunk-wq712sw1.js +2 -0
  142. package/dist/chunk-x34scshq.js +3 -0
  143. package/dist/{chunk-fb17t651.js → chunk-x5tjb4y4.js} +2 -2
  144. package/dist/chunk-xaa36b0x.js +3 -0
  145. package/dist/chunk-xfzcv0jc.js +2 -0
  146. package/dist/{chunk-dmg8dpah.js → chunk-xm2mee4a.js} +169 -169
  147. package/dist/chunk-xvs04cnp.js +2 -0
  148. package/dist/chunk-y9x4pyp2.js +2 -0
  149. package/dist/chunk-ye8tgmd3.js +2 -0
  150. package/dist/{chunk-febtq3xj.js → chunk-ym41ybz2.js} +6 -6
  151. package/dist/chunk-ymymwzt5.js +3 -0
  152. package/dist/{chunk-wpc04ygt.js → chunk-yq021b3r.js} +11 -11
  153. package/dist/chunk-z8p6tk5z.js +2 -0
  154. package/dist/chunk-zdnc7a4t.js +127 -0
  155. package/dist/chunk-zhf01af3.js +3 -0
  156. package/dist/chunk-zmh9p9aa.js +2 -0
  157. package/dist/{chunk-jtvcxbwd.js → chunk-zqtbtqbq.js} +2 -2
  158. package/dist/chunk-zsgcsqat.js +406 -0
  159. package/dist/chunk-zyqs6a3p.js +2 -0
  160. package/dist/cli.js +62 -62
  161. package/dist/craft-entry.js +2 -2
  162. package/dist/craft.js +2 -2
  163. package/dist/expressions.d.ts +6 -21
  164. package/dist/expressions.js +12 -41
  165. package/dist/forms-validation.d.ts +0 -16
  166. package/dist/forms-validation.js +4 -2
  167. package/dist/forms.js +8 -6
  168. package/dist/i18n.js +6 -4
  169. package/dist/interpolation-context.js +173 -29
  170. package/dist/loops.js +70 -90
  171. package/dist/mustache-span.d.ts +21 -0
  172. package/dist/mustache-span.js +35 -0
  173. package/dist/process.js +4 -3
  174. package/dist/pwa.js +3 -3
  175. package/dist/runtime-injection.js +9 -3
  176. package/dist/server-bindings.js +12 -6
  177. package/dist/ssg.js +28 -28
  178. package/dist/utils.js +1 -2
  179. package/package.json +5 -5
  180. package/dist/chunk-1jgsst0v.js +0 -2
  181. package/dist/chunk-1vrqmdfe.js +0 -2
  182. package/dist/chunk-1vx1ha9v.js +0 -2
  183. package/dist/chunk-1y9jphbg.js +0 -2
  184. package/dist/chunk-22kgdhxy.js +0 -2
  185. package/dist/chunk-2etamr31.js +0 -4
  186. package/dist/chunk-2s49ggrz.js +0 -12
  187. package/dist/chunk-2zbnc6jq.js +0 -2
  188. package/dist/chunk-39beqd1g.js +0 -2
  189. package/dist/chunk-3q5yn5r0.js +0 -6
  190. package/dist/chunk-3tcy2hdt.js +0 -2
  191. package/dist/chunk-3ycbhpa2.js +0 -2
  192. package/dist/chunk-3yqs2ekt.js +0 -2
  193. package/dist/chunk-4mm9ttc7.js +0 -2
  194. package/dist/chunk-4q4vy4g6.js +0 -2
  195. package/dist/chunk-4zapx8zt.js +0 -20
  196. package/dist/chunk-5zkwems4.js +0 -2
  197. package/dist/chunk-6e4es31t.js +0 -3
  198. package/dist/chunk-6hmbzqt8.js +0 -2
  199. package/dist/chunk-7a3kffqy.js +0 -2
  200. package/dist/chunk-7mkw98cr.js +0 -3
  201. package/dist/chunk-7xks65hg.js +0 -3
  202. package/dist/chunk-8k38mddf.js +0 -2
  203. package/dist/chunk-8q05cxzd.js +0 -2
  204. package/dist/chunk-a7y0fk20.js +0 -12
  205. package/dist/chunk-abwxa3tj.js +0 -2
  206. package/dist/chunk-ayjje1hk.js +0 -2
  207. package/dist/chunk-c93291jk.js +0 -2
  208. package/dist/chunk-cf6d5kgb.js +0 -65
  209. package/dist/chunk-crahn5xa.js +0 -4
  210. package/dist/chunk-d1jyxxcm.js +0 -3
  211. package/dist/chunk-d365tseq.js +0 -20
  212. package/dist/chunk-d67qvrzc.js +0 -24
  213. package/dist/chunk-dwnvqy3f.js +0 -4
  214. package/dist/chunk-dxb7jw7g.js +0 -2
  215. package/dist/chunk-e8483tnk.js +0 -2
  216. package/dist/chunk-eaphbqqx.js +0 -2
  217. package/dist/chunk-em0chjea.js +0 -18
  218. package/dist/chunk-ercd4pqc.js +0 -2
  219. package/dist/chunk-ewj4gqwe.js +0 -31
  220. package/dist/chunk-f7bgg2e4.js +0 -2
  221. package/dist/chunk-g6s0xdgb.js +0 -4
  222. package/dist/chunk-jxsgky4v.js +0 -2
  223. package/dist/chunk-k90yzxwp.js +0 -2
  224. package/dist/chunk-kfx4cte8.js +0 -127
  225. package/dist/chunk-kxbw0e2f.js +0 -3
  226. package/dist/chunk-ky043mkv.js +0 -2
  227. package/dist/chunk-mbqqc20a.js +0 -2
  228. package/dist/chunk-mq2kpg6w.js +0 -2
  229. package/dist/chunk-n58ky78d.js +0 -2
  230. package/dist/chunk-n80wh9b5.js +0 -2
  231. package/dist/chunk-p7sfjgtm.js +0 -2
  232. package/dist/chunk-ps9htxmp.js +0 -2
  233. package/dist/chunk-qhaw7f32.js +0 -2
  234. package/dist/chunk-rh33ra9e.js +0 -2
  235. package/dist/chunk-rzs2hpqa.js +0 -2
  236. package/dist/chunk-s3sckkvv.js +0 -2
  237. package/dist/chunk-s89pq4v1.js +0 -2
  238. package/dist/chunk-sdqgmcbk.js +0 -2
  239. package/dist/chunk-srmm69d4.js +0 -2852
  240. package/dist/chunk-t00y30w3.js +0 -2
  241. package/dist/chunk-t1a39rpd.js +0 -2
  242. package/dist/chunk-tj4rzy69.js +0 -2
  243. package/dist/chunk-tme51pg1.js +0 -2
  244. package/dist/chunk-tv1qtqab.js +0 -3
  245. package/dist/chunk-twh5ck5w.js +0 -2
  246. package/dist/chunk-v4tt3t1y.js +0 -2
  247. package/dist/chunk-v5ekdsw0.js +0 -2
  248. package/dist/chunk-vdsrae92.js +0 -2
  249. package/dist/chunk-w88mpbxk.js +0 -11
  250. package/dist/chunk-wg6n7txf.js +0 -2
  251. package/dist/chunk-wj4rf7sb.js +0 -2
  252. package/dist/chunk-wrd5me1w.js +0 -33
  253. package/dist/chunk-xbevgwks.js +0 -2
  254. package/dist/chunk-y2k3ynr2.js +0 -2
  255. package/dist/chunk-y51ndrdb.js +0 -2
  256. package/dist/chunk-y9wqzvxt.js +0 -2
  257. package/dist/chunk-yn2d8x8m.js +0 -3
  258. package/dist/chunk-ysmt4jpn.js +0 -2
  259. package/dist/chunk-zmccfvbf.js +0 -2
  260. package/dist/chunk-ztpqxs72.js +0 -2
  261. package/dist/chunk-ztwnn466.js +0 -2
  262. package/dist/chunk-zx7v6a4g.js +0 -40
  263. package/dist/chunk-zx94g4pg.js +0 -2
  264. package/dist/chunk-zze1ez1c.js +0 -2
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Sd,Qc,Ae,Li,kd,Ls,js,Bs}from"./chunk-srmm69d4.js";import"./chunk-2etamr31.js";import"./chunk-gvr10eqb.js";import"./chunk-apeyn69a.js";import"./chunk-fb17t651.js";import"./chunk-a0ygyftk.js";import"./chunk-cf6d5kgb.js";import"./chunk-d67qvrzc.js";import"./chunk-zx7v6a4g.js";import"./chunk-ahyq08mp.js";import"./chunk-r2seygb5.js";import"./chunk-qa625vwc.js";import"./chunk-pvfx0dgz.js";export{kd as clearOnceStore,Li as onceStore,Ae as partialsCache,Ls as processIncludes,js as processStackPushDirectives,Bs as processStackReplacements,Sd as resetUnscopedSignalWarnings,Qc as topLevelElements};
@@ -1,12 +0,0 @@
1
- // @bun
2
- import"./chunk-r2seygb5.js";import"./chunk-ahyq08mp.js";import{m,h,w,B}from"./chunk-srmm69d4.js";import"./chunk-zx7v6a4g.js";import"./chunk-gvr10eqb.js";import"./chunk-qa625vwc.js";import"./chunk-d67qvrzc.js";import"./chunk-cf6d5kgb.js";import"./chunk-apeyn69a.js";import"./chunk-a0ygyftk.js";import"./chunk-fb17t651.js";import"./chunk-pvfx0dgz.js";import"./chunk-2etamr31.js";import f from"path";var S=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAnimationFrame","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useBroadcastStream","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],L=new Set(S);var l=new Map,x=m(64),y=new Set,O=0,R=new Set(S);function A(){l.clear(),x.clear()}function P(n){let o=new Map;for(let r of n){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=o.get(t);if(i&&!i.endsWith(".js"))continue;o.set(t,r)}return[...o.values()].sort()}function I(n,o){let r=o.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(n)}function M(n){if(!n)return[];let o=h(n,O),r=x.get(o);if(r)return r.slice();let a=n.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(y.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),x.set(o,t),t.slice()}async function W(n,o){let r=M(n);if(r.length===0)return null;let a=o??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=B({loader:"ts",target:"browser",define:w()}),C=new Set(r),d=[],g=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let b=[];try{b=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!b.some((c)=>C.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),d.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
3
- ${u.transformSync(e).trim()}`);for(let c of b)g.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let v=r.filter((s)=>!g.has(s)&&!I(n,s));if(v.length>0)console.warn(`[stx] could not bundle ${v.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(d.length===0)return l.set(t,""),null;let E=[...g].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
4
- `),k=`<script data-stx-scoped data-stx-run="always" data-stx-framework-composables>
5
- ;(function(){
6
- var __s = window.stx = window.stx || {};
7
- ${d.join(`
8
-
9
- `)}
10
- ${E}
11
- })();
12
- </script>`;return l.set(t,k),k}function U(n){y.clear();for(let o of n)y.add(o);O++}export{U as __setRuntimeOwnedForTest,A as clearFrameworkComposableCache,W as getFrameworkComposableScript,M as referencedFrameworkComposables,P as selectComposableFiles};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Vo,Uo,Wa,qa,Ga,Ka,ru}from"./chunk-febtq3xj.js";export{Vo as createVirtualList,ru as default,Wa as generateVirtualListCSS,Ga as processInfiniteListDirectives,Ka as processVirtualGridDirectives,Uo as processVirtualListDirectives,qa as useVirtualList};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{or,qe,di,bc}from"./chunk-kvn23sz5.js";export{or as generateServiceWorker,bc as generateServiceWorkerAuto,qe as getServiceWorkerFileName,di as isWorkboxEnabled};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{ll,qs}from"./chunk-gvr10eqb.js";export{ll as looksLikeGlob,qs as resolveStxTargets};
@@ -1,65 +0,0 @@
1
- // @bun
2
- import{t,i}from"./chunk-zx7v6a4g.js";import{ct,lt,ut,we,Ie,_,_r,Mn,Se}from"./chunk-d67qvrzc.js";var I=/(?<![\w$@])@meta\s*\(/g,C=/(?<![\w$@])@metaTag\s*\(/g,k=/(?<![\w$@])@structuredData\s*\(/g,N=/(?<![\w$@])@seo\s*\(/g;function D(e,r){return(n)=>_(e,n,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX)}function j(e){return"property"in e?`<meta property="${l(e.property)}" content="${l(e.content)}">`:`<meta name="${l(e.name)}" content="${l(e.content)}">`}function Js(e,r,n,g){if(!e.includes("@meta"))return e;let a=ct(e,I,(s,c)=>{let o=Mn(lt(s),r);if(o.kind==="tag")return j(o.tag);if(o.kind==="empty")return"";return _("Meta",c,o.message,n,o.code)},D("Meta",n));return a=ct(a,C,(s,c)=>{let o=ut(s,r);if(!o.ok)return _("MetaTag",c,o.message,n,o.code);if(o.value===void 0||o.value===null)return"";if(!Ie(o.value))return _("MetaTag",c,`expected an object such as { name, content }, got ${we(o.value)}`,n,t.TYPE_ERROR);let u=o.value;if(!u.name&&!u.property&&!u.httpEquiv)return _("MetaTag",c,"the tag needs a name, property or httpEquiv",n,t.INVALID_DIRECTIVE_SYNTAX);if(u.content===void 0||u.content===null||u.content===""||u.content===!1)return"";let p="<meta";if(u.name)p+=` name="${l(u.name)}"`;if(u.property)p+=` property="${l(u.property)}"`;if(u.httpEquiv)p+=` http-equiv="${l(u.httpEquiv)}"`;return p+=` content="${l(u.content)}">`,p},D("MetaTag",n)),a}function v(e){let r=(n)=>n["@context"]?{...n}:{...n,"@context":"https://schema.org"};if(Ie(e))return r(e);if(Array.isArray(e)&&e.length>0&&e.every(Ie))return e.map(r);return null}function A(e){return`<script type="application/ld+json">${JSON.stringify(e).replace(/<\//g,"<\\/")}</script>`}function Ys(e,r,n){if(!e.includes("@structuredData"))return e;return ct(e,k,(g,a)=>{let s=ut(g,r);if(!s.ok)return _("StructuredData",a,s.message,n,s.code);if(s.value===void 0||s.value===null)return"";let c=v(s.value);if(!c)return _("StructuredData",a,`expected an object or an array of objects, got ${we(s.value)}`,n,t.TYPE_ERROR);try{return A(c)}catch(o){let u=o instanceof Error?o.message:String(o);return _("StructuredData",a,`the data cannot be written as JSON: ${u}`,n,t.EVALUATION_ERROR)}},D("StructuredData",n))}var L=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),R={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Zs(e,r,n,g){if(!e.includes("@seo"))return e;return ct(e,N,(a,s)=>{if(!a.trim())return _("SEO",s,"expected an object: @seo({ title, description }) or @seo(seoVariable)",n,t.INVALID_DIRECTIVE_SYNTAX);let c=ut(a,r);if(!c.ok)return _("SEO",s,c.message,n,c.code);if(c.value===void 0||c.value===null)return"";if(!Ie(c.value))return _("SEO",s,`expected an object such as { title, description }, got ${we(c.value)}`,n,t.TYPE_ERROR);try{return q(c.value,s,n)}catch(o){let u=o instanceof Error?o.message:String(o);return _("SEO",s,`Error processing @seo directive: ${u}`,n,t.EVALUATION_ERROR)}},D("SEO",n))}function b(e,r,n,g){let a=e[r];if(a===void 0||a===null||a===!1)return;if(Ie(a))return a;_r(n,`${r} must be an object, got ${we(a)}; its tags were left out`,g);return}function q(e,r,n){let g=Object.keys(e).filter((o)=>!L.has(o));if(g.length>0){let o=g.map((u)=>R[u]?`${u} (use ${R[u]})`:u).join(", ");_r(r,`@seo does not read ${o}; ${g.length===1?"it was":"they were"} ignored`,n)}let a="";if(e.title)a+=`<title>${l(e.title)}</title>
3
- `,a+=`<meta name="title" content="${l(e.title)}">
4
- `;if(e.description)a+=`<meta name="description" content="${l(e.description)}">
5
- `;if(e.keywords){let o=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;a+=`<meta name="keywords" content="${l(o)}">
6
- `}if(e.robots)a+=`<meta name="robots" content="${l(e.robots)}">
7
- `;if(e.canonical)a+=`<link rel="canonical" href="${l(e.canonical)}">
8
- `;let s=b(e,"openGraph",r,n);if(s){if(a+=`<meta property="og:type" content="${l(s.type||"website")}">
9
- `,s.title||e.title){let o=s.title||e.title||"";a+=`<meta property="og:title" content="${l(o)}">
10
- `}if(s.description||e.description){let o=s.description||e.description||"";a+=`<meta property="og:description" content="${l(o)}">
11
- `}if(s.url||e.canonical){let o=s.url||e.canonical||"";a+=`<meta property="og:url" content="${l(o)}">
12
- `}if(s.image){if(a+=`<meta property="og:image" content="${l(s.image)}">
13
- `,s.imageAlt)a+=`<meta property="og:image:alt" content="${l(s.imageAlt)}">
14
- `;if(s.imageWidth)a+=`<meta property="og:image:width" content="${l(String(s.imageWidth))}">
15
- `;if(s.imageHeight)a+=`<meta property="og:image:height" content="${l(String(s.imageHeight))}">
16
- `;if(s.imageType)a+=`<meta property="og:image:type" content="${l(s.imageType)}">
17
- `}if(s.siteName)a+=`<meta property="og:site_name" content="${l(s.siteName)}">
18
- `;if(s.locale)a+=`<meta property="og:locale" content="${l(s.locale)}">
19
- `;if(s.profile){let o=[["first_name",s.profile.firstName],["last_name",s.profile.lastName],["username",s.profile.username],["gender",s.profile.gender]];for(let[u,p]of o)if(p)a+=`<meta property="profile:${u}" content="${l(p)}">
20
- `}}let c=b(e,"twitter",r,n);if(c){if(a+=`<meta name="twitter:card" content="${l(c.card||"summary_large_image")}">
21
- `,c.title||e.title){let o=c.title||e.title||"";a+=`<meta name="twitter:title" content="${l(o)}">
22
- `}if(c.description||e.description){let o=c.description||e.description||"";a+=`<meta name="twitter:description" content="${l(o)}">
23
- `}if(c.image||s&&s.image){let o=c.image||(s?s.image:"")||"";a+=`<meta name="twitter:image" content="${l(o)}">
24
- `;let u=c.imageAlt||(!c.image&&s?s.imageAlt:void 0);if(u)a+=`<meta name="twitter:image:alt" content="${l(u)}">
25
- `}if(c.site)a+=`<meta name="twitter:site" content="${l(c.site)}">
26
- `;if(c.creator)a+=`<meta name="twitter:creator" content="${l(c.creator)}">
27
- `}if(e.structuredData!==void 0&&e.structuredData!==null){let o=v(e.structuredData);if(o)a+=`${A(o)}
28
- `;else _r(r,`structuredData must be an object or an array of objects, got ${we(e.structuredData)}; it was left out`,n)}return a.trim()}function Qs(e,r,n){if(n.seo?.enabled===!1)return e;if(e.includes("<!-- stx SEO Tags -->")||r.__stx_seo_staged===!0||n.skipDefaultSeoTags===!0)return e;let g=r.__stx_runtime_head;if(!!(g?.title||g?.meta?.some((S)=>S.property==="og:title"||S.name==="og:title"||S.name==="twitter:title"||S.name==="description")))return e;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(e)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(e))return e;if(!e.includes("<head>")&&!e.includes("<head "))return e;let s=e.includes("<title>")||e.includes("</title>"),c=M(e),o=V(c),u=U(c),p="";if(r.title)p=r.title;else if(r.meta&&r.meta.title)p=r.meta.title;else if(o)p=o;else if(n.seo?.defaultConfig?.title)p=n.seo.defaultConfig.title;else p=n.defaultTitle||"stx Project";let m="";if(r.description)m=r.description;else if(r.meta&&r.meta.description)m=r.meta.description;else if(u)m=u;else if(n.seo?.defaultConfig?.description)m=n.seo.defaultConfig.description;else m=n.defaultDescription||"A website built with stx templating engine";let d="";if(r.image)d=r.image;else if(r.meta&&r.meta.image)d=r.meta.image;else if(r.openGraph&&r.openGraph.image)d=r.openGraph.image;else if(n.seo?.defaultImage)d=n.seo.defaultImage;else if(n.defaultImage)d=n.defaultImage;let f=s?"":`
29
- <meta name="title" content="${l(p)}">`,E=G(c)?"":`
30
- <meta name="description" content="${l(m)}">`,y=`
31
- <!-- stx SEO Tags -->${f}${E}
32
- <meta property="og:title" content="${l(p)}">
33
- <meta property="og:description" content="${l(m)}">
34
- <meta property="og:type" content="website">
35
- <meta name="twitter:card" content="summary_large_image">
36
- <meta name="twitter:title" content="${l(p)}">
37
- <meta name="twitter:description" content="${l(m)}">
38
- `;if(d)y+=`
39
- <meta property="og:image" content="${l(d)}">
40
- <meta name="twitter:image" content="${l(d)}">
41
- `;let h=e;if(!s)h=h.replace(/<head[^>]*>/,`$&
42
- <title>${l(p)}</title>`);let w=r.__stx_head_injections;if(w)return r.__stx_seo_staged=!0,w.afterOpen.push(`
43
- ${y}
44
- `),h;return h.replace(/<head[^>]*>/,`$&
45
- ${y}
46
- `)}function M(e){let r=e.search(/<\/head\s*>/i);return r===-1?e:e.slice(0,r)}function x(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function V(e){let r=e.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return r?x(r[1].trim()):""}function O(e){return(e.match(/<meta\s[^>]*>/gi)||[]).filter((r)=>/\sname\s*=\s*["']description["']/i.test(r))}function G(e){return O(e).length>0}function U(e){for(let r of O(e)){let n=r.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),g=(n?.[1]??n?.[2]??"").trim();if(g)return x(g)}return""}function l(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var Sr={name:"meta",rawParams:!0,handler:(e,r,n,g)=>{let a=Mn(r,n??{});if(a.kind==="error")return _("Meta",`@meta(${r.join(", ")})`,a.message,g,a.code);if(a.kind==="empty")return"";if(n)n.__stx_runtime_head=Se(n.__stx_runtime_head??{},{meta:[a.tag]});return""},hasEndTag:!1},kr={name:"structuredData",handler:(e,r,n,g)=>{if(e.trim()==="")return i("StructuredData","structuredData directive requires JSON-LD content",t.INVALID_DIRECTIVE_SYNTAX);try{let a=JSON.parse(e);if(!a["@context"])a["@context"]="https://schema.org";if(!a["@type"])return i("StructuredData","structuredData requires @type property",t.INVALID_DIRECTIVE_SYNTAX);return A(a)}catch(a){let s=a instanceof Error?a.message:String(a);return i("StructuredData",s,t.EVALUATION_ERROR)}},hasEndTag:!0};function Td(){return[Sr,kr]}function $d(e,r){let{baseUrl:n,defaultChangefreq:g="weekly",defaultPriority:a=0.5,includeLastmod:s=!0}=r,c=n.replace(/\/$/,""),o=(m)=>m.startsWith("http")?m:`${c}${m.startsWith("/")?"":"/"}${m}`,u=e.map((m)=>{let d=o(m.loc),f=m.lastmod||(s?new Date().toISOString().split("T")[0]:void 0),E=m.changefreq||g,y=m.priority??a,h=` <url>
47
- <loc>${T(d)}</loc>`;for(let w of m.alternates??[])h+=`
48
- <xhtml:link rel="alternate" hreflang="${T(w.hreflang)}" href="${T(o(w.href))}"/>`;if(f)h+=`
49
- <lastmod>${f}</lastmod>`;return h+=`
50
- <changefreq>${E}</changefreq>`,h+=`
51
- <priority>${y.toFixed(1)}</priority>`,h+=`
52
- </url>`,h});return`<?xml version="1.0" encoding="UTF-8"?>
53
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"${e.some((m)=>m.alternates?.length)?' xmlns:xhtml="http://www.w3.org/1999/xhtml"':""}>
54
- ${u.join(`
55
- `)}
56
- </urlset>`}function Rd(e,r){let n=r.replace(/\/$/,""),g=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
57
- <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
58
- ${e.map((s)=>{let c=s.startsWith("http")?s:`${n}${s.startsWith("/")?"":"/"}${s}`;return` <sitemap>
59
- <loc>${T(c)}</loc>
60
- <lastmod>${g}</lastmod>
61
- </sitemap>`}).join(`
62
- `)}
63
- </sitemapindex>`}async function Ad(e,r){let{extensions:n=[".stx",".html",".htm"],ignore:g=["_*",".*","node_modules","components","partials","layouts"]}=r,a=[],s=n.length===1?`*${n[0]}`:`*{${n.join(",")}}`,c=new Bun.Glob(`**/${s}`);for await(let o of c.scan(e)){if(g.some((f)=>{if(f.startsWith("*"))return o.includes(f.slice(1));return o.startsWith(f)||o.includes(`/${f}`)}))continue;let p=o.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!p.startsWith("/"))p=`/${p}`;if(p!=="/"&&p.endsWith("/"))p=p.slice(0,-1);let m=`${e}/${o}`,d;try{let f=await Bun.file(m).stat();if(f)d=new Date(f.mtime).toISOString().split("T")[0]}catch{}a.push({loc:p||"/",lastmod:d,priority:p==="/"?1:0.5})}return a.sort((o,u)=>o.loc.localeCompare(u.loc)),a}function Cr(e){let r=[];for(let n of e.rules){if(r.push(`User-agent: ${n.userAgent}`),n.allow)for(let g of n.allow)r.push(`Allow: ${g}`);if(n.disallow)for(let g of n.disallow)r.push(`Disallow: ${g}`);if(n.crawlDelay!==void 0)r.push(`Crawl-delay: ${n.crawlDelay}`);r.push("")}if(e.sitemap){let n=Array.isArray(e.sitemap)?e.sitemap:[e.sitemap];for(let g of n)r.push(`Sitemap: ${g}`)}if(e.host)r.push(`Host: ${e.host}`);return r.join(`
64
- `).trim()}function Pd(e){return Cr({rules:[{userAgent:"*",allow:["/"]}],sitemap:e})}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
65
- export{Js,Ys,Zs,Qs,Sr,kr,Td,$d,Rd,Ad,Cr,Pd};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{Me}from"./chunk-qa625vwc.js";import{We,un}from"./chunk-38ngmh6h.js";import{hi,yi,f,Ft,he,j,n,A,o}from"./chunk-srmm69d4.js";import{C}from"./chunk-a0ygyftk.js";import{Ks}from"./chunk-fb17t651.js";import{On,Nn,Dn,Ln,xe}from"./chunk-d67qvrzc.js";import{Xi}from"./chunk-apeyn69a.js";import{ke,le,Do,Mo,Jt}from"./chunk-ewj4gqwe.js";import{Ot,hs}from"./chunk-3q5yn5r0.js";import{Yt}from"./chunk-fqg0espy.js";import{Et,mn,hn}from"./chunk-kxbw0e2f.js";import m from"fs";import c from"path";import{createHash as Q}from"crypto";function J(i){return Q("sha256").update(i).digest("hex").slice(0,8)}function U(i=!1){let l=i?un():We(),a=J(l);return{content:l,filename:`runtime.${a}.js`,hash:a}}function V(){let i=Me(),l=J(i);return{content:i,filename:`router.${l}.js`,hash:l}}import q from"path";import{createHash as ee}from"crypto";function te(i={}){let l=new Set;return{context:new Proxy(i,{get(r,e){if(e in r)return r[e];if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return},has(r,e){if(e in r)return!0;if(typeof e==="string"&&!e.startsWith("__"))l.add(e);return!1}}),accessedKeys:l}}async function X(i,l,a={}){let r=q.resolve(i),e=await Bun.file(r).text(),S=ee("sha256").update(e).digest("hex").slice(0,16);hi();let _={};try{_=await o(a.configDir)}catch{}let y=[],d=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,g;while((g=d.exec(e))!==null){let R=g[1];if(/\bserver\b/.test(R))y.push(g[2])}let u=new Set(y.flatMap((R)=>he(R))),{context:D}=te({__filename:r,__dirname:q.dirname(r),__stx_serverDeclared:u}),w=new Set,B={...A,..._,...a,buildMode:"compile",strict:!1},b=await n(e,D,r,B,w),T=ke(b),M=yi();return{route:l,sourceFile:i,html:b,fragment:T,placeholders:M,hasServerScripts:y.length>0,serverScriptContent:y,dependencies:Array.from(w),contentHash:S,status:Ft(e),streamTemplates:D.__streamTemplates}}var re=new Set([".DS_Store","Thumbs.db","desktop.ini",".gitkeep",".gitignore"]);function Z(i,l){let a=0,r=0;if(!m.existsSync(i))return{copied:a,bytes:r};m.mkdirSync(l,{recursive:!0});function e(S,_){let y=m.readdirSync(S,{withFileTypes:!0});for(let d of y){if(re.has(d.name))continue;let g=c.join(S,d.name),u=c.join(_,d.name);if(d.isDirectory())m.mkdirSync(u,{recursive:!0}),e(g,u);else if(d.isFile()){if(m.existsSync(u))continue;m.copyFileSync(g,u),a++,r+=m.statSync(u).size}}}return e(i,l),{copied:a,bytes:r}}async function Ol(i={}){let l=Date.now(),a=c.resolve(i.root||process.cwd()),r=c.resolve(a,i.outputDir||".output");console.log("[stx build] Starting production build...");let e=await o(a),S=c.resolve(a,i.componentsDir??e.componentsDir??"components"),_=c.resolve(a,i.partialsDir??e.partialsDir??"partials"),y=c.resolve(a,i.layoutsDir??e.layoutsDir??"layouts"),d=i.publicDir??e.publicDir??"public",g=xe(e.app?.head,{known:Ln,source:"app.head"}),u=e.app?.colorMode,D=e.router?.container||"main",w=i.routeRules??e.routeRules??{},B=Yt(w),b=i.serverApi??e.serverApi,T=typeof b==="object"?b:{};if(b)Ot(a,T);if(e.runtimeConfig)C(e.runtimeConfig,{});if(m.existsSync(r))m.rmSync(r,{recursive:!0});let M=[c.join(r,"public","__stx"),c.join(r,"public","assets"),c.join(r,"server","pages"),c.join(r,"server","fragments")];for(let s of M)m.mkdirSync(s,{recursive:!0});console.log("[stx build] Discovering routes...");let R=j(a,{pagesDirs:e._layerPageDirs}),Y=["components","layouts","partials"],O=R.filter((s)=>!Y.some((h)=>s.pattern.startsWith(`/${h}/`)||s.pattern===`/${h}`));console.log(`[stx build] Found ${O.length} page routes (${R.length-O.length} non-page files excluded)`),console.log("[stx build] Generating shared assets...");let v=U(i.debug),x=V();await Bun.write(c.join(r,"public","__stx",v.filename),v.content),await Bun.write(c.join(r,"public","__stx",x.filename),x.content),console.log(`[stx build] Runtime: ${v.filename} (${(v.content.length/1024).toFixed(1)}KB)`),console.log(`[stx build] Router: ${x.filename} (${(x.content.length/1024).toFixed(1)}KB)`),console.log("[stx build] Compiling templates...");let k=[],H=[];for(let s of O){let h=B(s.pattern),E=h.rendering==="prerender";if(E&&(s.pattern.includes(":")||s.pattern.includes("[")))throw Error(`Cannot prerender parameter route ${s.pattern}; use dynamic rendering (explicit path enumeration is not supported here)`);try{let t=await X(s.filePath,s.pattern,{configDir:a,componentsDir:S,partialsDir:_,layoutsDir:y,debug:i.debug});if(k.push(t),t.html=t.html.replace(/runtime\.__STX_HASH__\.js/g,v.filename).replace(/router\.__STX_HASH__\.js/g,x.filename),t.html=Dn(t.html,g,{bodyScripts:[`<script src="/__stx/${x.filename}"></script>`],...u&&{colorMode:u}}),u)t.html=On(t.html,u);if(g.htmlAttrs)t.html=Nn(t.html,g.htmlAttrs);if(!/<body[^>]*\bdata-stx=/.test(t.html)){let p=t.html.match(/<(?!body\b)[a-zA-Z][a-zA-Z0-9-]*\b[^>]*?\s(data-stx="[^"]+")[^>]*>/);if(p&&p[1]){let W=p[1];t.html=t.html.replace(" "+W,""),t.html=t.html.replace(/<body([^>]*)>/,`<body$1 ${W}>`)}}if(t.html=t.html.replace(/<style data-css="generated">[\s\S]*?<\/style>\s*/g,""),t.html=await f(t.html),E){let p=await Jt(t,{params:{},request:new Request(`http://stx.build${s.pattern}`),method:"GET",__stx_strict_hydration:!0});if(p.redirect||p.cookies?.length||p.boundaries?.length||p.headers&&Object.keys(p.headers).length)throw Error(`Prerendered route ${s.pattern} cannot set response headers/cookies, redirect or stream`);t.html=p.html,t.status=p.status??t.status,t.hasServerScripts=!1,t.serverScriptContent=[],t.placeholders={}}t.fragment=le(t.html,D);let z=s.pattern==="/"?"index":s.pattern.slice(1).replace(/\//g,"-").replace(/[[\]]/g,"_"),G=c.join("server","pages",`${z}.compiled.json`),I=c.join("server","fragments",`${z}.html`);await Bun.write(c.join(r,G),JSON.stringify(t,null,2)),await Bun.write(c.join(r,I),t.fragment),H.push({pattern:s.pattern,compiledPath:G,fragmentPath:I,isDynamic:t.hasServerScripts,hasParams:s.pattern.includes(":")||s.pattern.includes("["),prerendered:E}),console.log(`[stx build] \u2713 ${s.pattern}`)}catch(t){if(Object.keys(h).length)throw t;console.error(`[stx build] \u2717 ${s.pattern}:`,t instanceof Error?t.message:t)}}let F=c.resolve(a,d);if(m.existsSync(F)){let{copied:s,bytes:h}=Z(F,c.join(r,"public"));if(s>0)console.log(`[stx build] Copied ${s} public asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${d}/`)}let N=hn(a);if(N){let{copied:s,bytes:h}=Z(N,c.join(r,"public",mn));if(s>0)console.log(`[stx build] Copied ${s} asset${s===1?"":"s"} (${(h/1024).toFixed(1)}KB) from ${Et}/`)}let K={runtime:v.filename,router:x.filename},P=Do(H,K,r);if(P.routeRules=w,P.routerContainer=D,b)P.apiRoutes=await hs(a,r,T);if(e.runtimeConfig)await Bun.write(c.join(r,"server/runtime-config.json"),JSON.stringify(e.runtimeConfig)),await Ks(a,e.runtimeConfig);if(e._layerGraph)await Bun.write(c.join(r,"server/layers.json"),JSON.stringify(Xi(e._layerGraph),null,2));Mo(P,r);let L=Date.now()-l;return console.log(`
3
- [stx build] Done in ${L}ms \u2014 ${k.length} pages compiled`),{pageCount:k.length,assets:K,outputDir:r,duration:L}}
4
- export{Ol};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import i from"path";var Ht=".stx",o="STX_DIR",e=null;function Ji(t){e=t?.trim()||null}function Rn(){return process.env[o]?.trim()||e||Ht}function a(t=process.cwd(),...n){let r=Rn();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function An(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==Ht&&!n.startsWith(`${Ht}/`))return t;let r=n.slice(Ht.length+1);return r?i.join(Rn(),r):Rn()}
3
- export{Ht,Ji,Rn,a,An};
@@ -1,20 +0,0 @@
1
- // @bun
2
- import{y}from"./chunk-r2seygb5.js";import{Y,tt,Ts,$s,ki,Ci,_i,Ei,fr,Rs,Ti,$i,Ri,zt,o}from"./chunk-srmm69d4.js";import{is}from"./chunk-wrd5me1w.js";import{a}from"./chunk-d1jyxxcm.js";import{existsSync as M,readFileSync as K}from"fs";import h from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=zt.filter((e)=>!me.has(e)).sort(),ne=[...y].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ie(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let m of l[1].matchAll(/[^,]+/g)){let S=m[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let r=x[1];if(!xe.has(r)||i.has(r))continue;let f=u.offset+g+m.index+x[0].length-r.length,p=e.slice(0,f),w=p.split(`
3
- `).length;s.push({line:w,column:f-(p.lastIndexOf(`
4
- `)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:Se(r,u.kind)})}}}return s}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let s=T.resolve(e);for(;;){let u=T.join(s,"tsconfig.json");if(t(u))return u;let i=T.dirname(s);if(i===s)return;s=i}}function se(e,t,s){let u=we(e,s);if(!u)return;let i=new Set,l=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let S=m.compilerOptions?.plugins;if(Array.isArray(S)){let r=S.find((p)=>p?.name===ke),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...x].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=T.resolve(T.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function Ta(e,t="",s=""){let u=e.startLine>1?`
5
- `.repeat(e.startLine-1):"",i=Rs(e)+$s(Ts(e.code)),l=e.kind==="client"||e.kind==="plain"?_i(t,e.code):"";return fr(`${u+i}
6
- ${l}
7
- export {}
8
- `,s)}var $e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function ve(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],s=new Set(y),u=[];for(let{file:i,names:l}of e){let g=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));u.push(` export * from ${g}`);for(let m of l){if(s.has(m)||$e.has(m))continue;s.add(m),t.push(`declare const ${m}: typeof import(${g})[${JSON.stringify(m)}]`)}}return t.push("declare module '@composables' {",...u,"}"),t.join(`
9
- `)}function Ao(e,t,s){return`${e}.__stx_${t}${s}.ts`}function Rl(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function $a(){return re("stx.d.ts")}function Ra(){return re("stx-module.d.ts")}function re(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(M(t))return t;return null}var Te=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function De(e){return e>=1000&&e<2000}function oe(e){let t="",s=!1,u=!1;for(let i=0;i<e.length;i++){let l=e[i];if(s){if(t+=l,u)u=!1;else if(l==="\\")u=!0;else if(l==='"')s=!1;continue}if(l==='"'){s=!0,t+=l;continue}if(l==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
10
- `)i++;t+=`
11
- `;continue}if(l==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=l}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(oe(K(e,"utf8")))}catch{return}}function Oe(e){let t=h.resolve(e),s;for(;;){let r=h.join(t,"tsconfig.json");if(M(r)){s=r;break}let f=h.dirname(t);if(f===t)break;t=f}if(!s)return{};let u=new Set,i=s,l,g,m=s;while(i&&!u.has(i)){u.add(i);let r;try{r=JSON.parse(oe(K(i,"utf8")))}catch{break}let f=r?.compilerOptions??{};if(!l&&f.paths&&typeof f.paths==="object")l=f.paths,m=i;if(!g&&typeof f.baseUrl==="string")g=h.resolve(h.dirname(i),f.baseUrl);if(l&&g)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!l)return{};let S=g??h.dirname(m),x={};for(let[r,f]of Object.entries(l)){if(!Array.isArray(f))continue;x[r]=f.map((p)=>typeof p==="string"&&!h.isAbsolute(p)?h.resolve(S,p):p)}return{paths:x}}async function Al(e,t={}){let s=t.client!==!1,u=t.server!==!1,i=t.templates!==!1,l=t.componentsDir??(i?(await o()).componentsDir:void 0),g=new Map,m=new Map,S=[],x=[],r=0,f=0,p=$a();for(let n of e){let c=await Bun.file(n).text(),b=tt(c).filter((d)=>{if(d.kind==="server")return u;return s}),k=tt(c).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
12
- `);for(let d of ie(c,b))S.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(s&&k){let d=b.filter((O)=>O.kind!=="server"),E=[...new Set(d.flatMap((O)=>Ei(k,O.code)))];if(E.length>0)m.set(n,{names:E,line:d[0].startLine,kind:d[0].kind})}let D=h.dirname(h.resolve(n)),v=i?Ti(c,{runtimeGlobals:!p,originDir:D,filePath:h.resolve(n),componentsDir:l}):null,R=v?[...v.lineMap.values()].filter((d)=>d.expression).length:0;if(b.length===0&&R===0)continue;if(x.push(n),r+=b.length,f+=R,b.forEach((d,E)=>{g.set(Ao(n,d.kind,E),{source:Ta(d,k,D),origin:n,kind:d.kind})}),v&&R>0)g.set(Ao(n,"template",0),{source:v.text,origin:n,kind:"template",virtual:v})}if(g.size===0)return{diagnostics:S,checkedFiles:x,blockCount:0,expressionCount:0};let w=(t.extraLibs??[]).map((n)=>h.resolve(n)),ce=se(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),Ee,M);for(let n of ce?.libs??[])if(!w.includes(n)&&M(n))w.push(n);if(p)w.push(p);let G=p?Ra():null;if(G)w.push(G);let X=`${a()}/typecheck/__stx_globals.d.ts`,ae=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",ki(p?Ci(K(p,"utf8")):void 0),...p?[]:["declare const window: any",...y.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...Y.map((n)=>`declare const ${n}: any`)].join(`
13
- `),ve(await is())].filter(Boolean).join(`
14
- `),_=`${a()}/typecheck`;await Bun.$`rm -rf ${_}`.quiet().nothrow(),await Bun.$`mkdir -p ${_}`.quiet().nothrow(),await Bun.write(X,ae);let N=new Map,le=0;for(let[n,c]of g){let b=`${le++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${_}/${b}`,c.source),N.set(b,c)}let ue={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Oe(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},F=async(n,c)=>{let b=`${_}/tsconfig${c===1?"":`.${c}`}.json`;await Bun.write(b,JSON.stringify({compilerOptions:ue,files:n.map((D)=>`${_}/${D}`).concat(X,...w)},null,2));let k=Bun.spawnSync(["bun","x","tsc","-p",b,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(k.stdout)+new TextDecoder().decode(k.stderr),exitCode:k.exitCode??0}},V=await F([...N.keys()],1),J=V.output,I=[],U=V.exitCode,W=0,pe=new Set(w.map((n)=>n.split("/").pop())),z=0,B=new Set,q=(n)=>{for(let c of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
15
- `)){let b=c.match(Te);if(!b)continue;if(W++,pe.has(b[1].split("/").pop()))z++;let[,k,D,v,R,d,E]=b,O=k.split("/").pop(),C=N.get(O);if(!C)continue;if(De(Number(d)))B.add(O);let A=Number(D),L=Number(v),Q;if(C.virtual){let P=Ri(C.virtual,A,L);if(!P?.expression)continue;if($i(P,Number(d)))continue;A=P.line,L=P.column,Q=P.expression.code.trim()}I.push({file:C.origin,line:A,column:L,code:Number(d),message:E,category:R==="error"?"error":"warning",blockKind:C.kind,expression:Q})}};q(J);let de=W,fe=z;if(B.size>0&&B.size<N.size){let n=[...N.keys()].filter((c)=>!B.has(c));q((await F(n,2)).output)}if(s)for(let[n,c]of m){if(c.names.length===0)continue;I.push({file:n,line:c.line,column:1,code:0,message:`${c.names.length===1?"1 value reaches":`${c.names.length} values reach`} this block on the implicit bridge and ${c.names.length===1?"is":"are"} untyped: ${c.names.join(", ")}. Declare them with defineClientPayload({ ${c.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:c.kind})}I.push(...S);let H=new Set,j=I.filter((n)=>{let c=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(H.has(c))return!1;return H.add(c),!0});j.sort((n,c)=>n.file.localeCompare(c.file)||n.line-c.line||n.column-c.column);let Z=fe>0&&j.length===0,ge=Z||U!==0&&de===0?`${Z?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${U} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
16
- ${J.trim().split(`
17
- `).slice(0,12).join(`
18
- `)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:x,blockCount:r,expressionCount:f,failure:ge}}function Pl(e){return e.map((t)=>{let s=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${s}`}).join(`
19
- `)}
20
- export{Ta,Ao,Rl,$a,Ra,Al,Pl};
@@ -1,24 +0,0 @@
1
- // @bun
2
- import{t,i,Bn,Rr,Ne,c}from"./chunk-zx7v6a4g.js";import U from"path";function S(e,n,r,s=0){let a=0,o=s,l=null,u=0,p=!1;while(o<e.length){let d=e[o];if(l&&p){p=!1,o++;continue}if(l&&d==="\\"){p=!0,o++;continue}if(p=!1,(d==='"'||d==="'"||d==="`")&&!l){l=d,o++;continue}if(d===l&&l!=="`"){l=null,o++;continue}if(l==="`"&&d==="$"&&e[o+1]==="{"){u++,o+=2;continue}if(u>0&&d==="}"){u--,o++;continue}if(d==="`"&&l==="`"&&u===0){l=null,o++;continue}if(l){o++;continue}if(d===n)a++;else if(d===r){if(a--,a===0)return o}o++}return-1}function eo(e,n){let r=[];n.lastIndex=0;let s;while((s=n.exec(e))!==null){let a=s.index,o=a+s[0].length-1,l=S(e,"(",")",o);if(l===-1){r.push({start:a,end:-1,args:"",call:e.slice(a,Math.min(e.length,a+80))}),n.lastIndex=o+1;continue}r.push({start:a,end:l+1,args:e.slice(o+1,l),call:e.slice(a,l+1)}),n.lastIndex=l+1}return r}function ct(e,n,r,s){let a="",o=0;for(let l of eo(e,n)){if(a+=e.slice(o,l.start),l.end===-1){a+=s(l.call),o=l.start;continue}a+=r(l.args,l.call),o=l.end}return a+e.slice(o)}function lt(e){let n=[],r=0,s=null,a="";for(let o=0;o<e.length;o++){let l=e[o];if(s){if(a+=l,l==="\\"&&o+1<e.length){a+=e[++o];continue}if(l===s)s=null;continue}if(l==="'"||l==='"'||l==="`")s=l;else if(l==="("||l==="["||l==="{")r++;else if(l===")"||l==="]"||l==="}")r--;else if(l===","&&r===0){n.push(a.trim()),a="";continue}a+=l}if(a.trim())n.push(a.trim());return n}function O(e){let n=e.trim(),r=n[0];if(r!=="'"&&r!=='"'&&r!=="`"||n.length<2||n.at(-1)!==r)return null;let s="";for(let a=1;a<n.length-1;a++){let o=n[a];if(o==="\\"&&a+1<n.length-1){let l=n[++a];s+=l==="n"?`
3
- `:l==="t"?"\t":l;continue}if(o===r)return null;if(r==="`"&&o==="$"&&n[a+1]==="{")return null;s+=o}return s}var ue=new Set(["true","false","null","undefined","typeof","void","new","in","of","instanceof","this","delete","await","async","function","return","NaN","Infinity"]);function ut(e,n){let r=e.trim();if(!r)return{ok:!1,message:"the argument is empty",code:t.INVALID_DIRECTIVE_SYNTAX};let s=Bn(r);if(s)return{ok:!1,message:`the expression is not allowed (${s})`,code:t.UNSAFE_EXPRESSION};let a=Rr(n),o;try{o=c(r,Object.keys(a))(...Object.values(a))}catch(u){return{ok:!1,message:`the expression could not be evaluated: ${u instanceof Error?u.message:String(u)}`,code:t.EVALUATION_ERROR}}if(o!==void 0&&o!==null)return{ok:!0,value:o};let l=[...new Set(Ne(r))].filter((u)=>!ue.has(u)&&!(u in a)&&!(u in globalThis));if(l.length>0)return{ok:!1,message:`${l.map((p)=>`"${p}"`).join(", ")} ${l.length===1?"is":"are"} not defined here. Values a directive reads must come from <script server> or the render context; a plain <script> runs in the browser. To pass literal text, quote it.`,code:t.UNDEFINED_VARIABLE};if(o===void 0&&(r.startsWith("{")||r.startsWith("[")))return{ok:!1,message:"the expression threw while it was evaluated",code:t.EVALUATION_ERROR};return{ok:!0,value:o}}function we(e){if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e==="object")return"an object";if(typeof e==="string")return`a string ("${e.length>40?`${e.slice(0,40)}...`:e}")`;return`${/^[aeiou]/.test(typeof e)?"an":"a"} ${typeof e}`}function Ie(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function V(e){if(!e)return"";return U.isAbsolute(e)?U.relative(process.cwd(),e)||e:e}function M(e){let n=e.replace(/\s+/g," ").trim();return n.length>80?`${n.slice(0,77)}...`:n}function _(e,n,r,s,a=t.EVALUATION_ERROR){let o=s?` in ${V(s)}`:"";return console.warn(`[stx] ${M(n)}${o}: ${r}`),i(e,`${M(n)}: ${r}`,a)}function _r(e,n,r){let s=r?` in ${V(r)}`:"";console.warn(`[stx] ${M(e)}${s}: ${n}`)}function to(){return{afterOpen:[],beforeClose:[]}}function pe(e){return e.afterOpen.length>0||e.beforeClose.length>0}function Yi(e,n){if(!pe(n))return e;let r=n.afterOpen.join(""),s=n.beforeClose.join(""),a=e.lastIndexOf("</head>"),o=r?In(e):null,l=s&&a!==-1?a:null;if(o===null&&l===null)return e;if(o!==null&&l!==null)return`${e.slice(0,o)}${r}${e.slice(o,l)}${s}${e.slice(l)}`;if(o!==null)return`${e.slice(0,o)}${r}${e.slice(o)}`;return`${e.slice(0,l)}${s}${e.slice(l)}`}var K=/\s*<meta\b[^>]*\bcharset\b[^>]*>/iy;function In(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return null;let r=n.index+n[0].length;K.lastIndex=r;let s=K.exec(e);return s?r+s[0].length:r}var L="data-stx-color-mode-boot",F="__STX_COLOR_MODE__",de=new Set(["light","dark","auto","system"]),ge=new Set(["auto","system"]),fe=/^[a-z][\w:-]*$/i,he=/^[\w-]+$/;function me(e){let n=e.storageKey??"stx-color-mode",r=e.initialMode??"auto",s=e.darkClass===void 0?"dark":e.darkClass,a=e.attribute??null,o=e.autoValue??null,l=e.respectExisting===!0;if(typeof n!=="string"||n.length===0)throw Error("colorMode.storageKey must be a non-empty string");if(!de.has(r))throw Error(`colorMode.initialMode must be one of light, dark, auto, system \u2014 got ${JSON.stringify(r)}`);if(s!==null&&(typeof s!=="string"||!he.test(s)))throw Error(`colorMode.darkClass must be a single CSS class name, or null to opt out \u2014 got ${JSON.stringify(s)}`);if(a!==null&&(typeof a!=="string"||!fe.test(a)))throw Error(`colorMode.attribute must be a valid HTML attribute name \u2014 got ${JSON.stringify(a)}`);if(o!==null&&!ge.has(o))throw Error(`colorMode.autoValue must be 'auto' or 'system' \u2014 got ${JSON.stringify(o)}`);if(s===null&&a===null)throw Error("colorMode needs at least one of darkClass or attribute \u2014 with both null nothing would mark the mode on <html>");if(l&&a===null)throw Error("colorMode.respectExisting needs an attribute to read \u2014 the dark class alone cannot say whether a mode was chosen");return{storageKey:n,initialMode:r==="system"?"auto":r,darkClass:s,attribute:a,autoValue:o,respectExisting:l}}function ye(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function D(e={}){let n=me(e),r=ye(n),s=`(function(){"use strict";var o=window.${F};if(o&&typeof o.sync==="function"){o.sync();return}var c=${r};var r=document.documentElement;function read(){var p=c.initialMode,a=c.autoValue;try{var v=localStorage.getItem(c.storageKey);if(v==="light"||v==="dark"){p=v}else if(v==="auto"||v==="system"){p="auto";if(!a)a=v}}catch(e){}return{p:p,a:a}}function sys(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return"light"}}function stamp(m){if(c.attribute)r.setAttribute(c.attribute,m);if(c.darkClass){if(m==="dark")r.classList.add(c.darkClass);else r.classList.remove(c.darkClass)}}var s=read();var f=null;if(c.respectExisting&&c.attribute){var x=r.getAttribute(c.attribute);if(x==="light"||x==="dark")f=x}var m=f||(s.p==="auto"?sys():s.p);var p=s.p;stamp(m);var g=null;function sync(){var t=read(),n=f||(t.p==="auto"?sys():t.p);var moved=n!==m,chose=t.p!==p;if(moved){r.style.setProperty("transition","none","important");stamp(n);void r.offsetHeight;r.style.removeProperty("transition")}else stamp(n);m=n;p=t.p;if(g){g.mode=n;g.preference=t.p;if(t.a)g.autoValue=t.a}if(moved||chose){try{window.dispatchEvent(new CustomEvent("stx:color-mode",{detail:{mode:n,preference:t.p}}))}catch(e){}}}try{g=window.${F}={storageKey:c.storageKey,initialMode:c.initialMode,darkClass:c.darkClass,attribute:c.attribute,autoValue:s.a||"auto",respectExisting:c.respectExisting,forced:f,preference:p,mode:m,watching:true,sync:sync}}catch(e){}try{var q=matchMedia("(prefers-color-scheme: dark)");if(q.addEventListener)q.addEventListener("change",sync);else if(q.addListener)q.addListener(sync)}catch(e){}try{addEventListener("pageshow",sync);addEventListener("storage",function(e){if(e.key===null||e.key===c.storageKey)sync()});document.addEventListener("visibilitychange",function(){if(document.visibilityState==="visible")sync()})}catch(e){}}());`;return`<script ${L}>${s}</script>`}function On(e,n={}){if(e.includes(L))return e;let r=N(e);if(r===null)return e;let s=D(n);return`${e.slice(0,r)}
4
- ${s}${e.slice(r)}`}var N=In,be=new RegExp(`<script\\b[^>]*\\b${L}\\b[^>]*>[\\s\\S]*?<\\/script>`,"i"),W=/<meta\b[^>]*\bcharset\b[^>]*>/gi,q=/<\/head>/gi;function ke(e){let n=/<head\b[^>]*>/i.exec(e);if(!n)return e;let r=n.index+n[0].length;q.lastIndex=r;let s=q.exec(e),a=s?s.index:e.length;W.lastIndex=r;let o=W.exec(e);if(!o||o.index>=a)return e;if(e.slice(r,o.index).trim()==="")return e;let l=o.index+o[0].length;return`${e.slice(0,r)}
5
- ${o[0]}${e.slice(r,o.index)}${e.slice(l,a)}${e.slice(a)}`}function Zi(e){return Te(ke(e))}function Te(e){let n=be.exec(e);if(!n)return e;let r=N(e);if(r===null)return e;if(n.index<=r||e.slice(r,n.index).trim()==="")return e;let s=e.slice(0,n.index)+e.slice(n.index+n[0].length),a=N(s);if(a===null)return e;return`${s.slice(0,a)}
6
- ${n[0]}${s.slice(a)}`}var Y="<style data-stx-cloak>[x-cloak]{display:none !important}</style>",w="data-stx-html-attrs",C="data-stx-html-class",G=/^[A-Za-z_:][\w:.-]*$/;function y(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ve(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Oe(e){if(e.name)return`name="${e.name}"`;if(e.property)return`property="${e.property}"`;if(e.charset!=null)return"charset=";if(e["http-equiv"])return`http-equiv="${e["http-equiv"]}"`;return""}function Ee(e){let n=/^\s*<meta\b([^>]*)>/i.exec(e);if(!n)return null;let r={};for(let s of n[1].matchAll(/([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g))r[s[1].toLowerCase()]=s[2]??s[3]??s[4]??"";return r}function k(e,n){return Object.entries(e).filter(([r])=>!n?.(r)).map(([r,s])=>`${r}="${y(String(s))}"`).join(" ")}function R(e){let n=String(e.content),r=typeof e.type==="string"?e.type.trim().toLowerCase():"";return/json$|^importmap$/.test(r)?n.replace(/<\//g,"<\\/"):n}function J(e){let n=k(e,(r)=>r==="content");return`<script${n?` ${n}`:""}>${R(e)}</script>`}function Ae(e={},n="en"){let r=[],s=[],a="",o=n;for(let[u,p]of Object.entries(e||{})){if(p==null)continue;let d=u.trim();if(!G.test(d))continue;let f=d.toLowerCase();if(f==="lang"){o=String(p);continue}if(f==="class"){a=String(p).trim();continue}r.push(` ${d}="${y(String(p))}"`),s.push(d)}let l=` lang="${y(o)}"`;if(a)l+=` class="${y(a)}"`;if(l+=r.join(""),a)l+=` ${C}="${y(a)}"`;if(s.length)l+=` ${w}="${y(s.join(" "))}"`;return l}function Qi(e={},n={}){let r={...e,...n};if(e.class&&n.class){let s=e.class.split(/\s+/).filter(Boolean);for(let a of n.class.split(/\s+/).filter(Boolean))if(!s.includes(a))s.push(a);r.class=s.join(" ")}return r}function Nn(e,n={}){if(!n||Object.keys(n).length===0)return e;let r=e.match(/<html\b([^>]*)>/i);if(!r)return e;let s={},a=[],o=/([A-Za-z_:][\w:.-]*)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,l;while((l=o.exec(r[1]))!==null){let f=l[1];if(!(f in s))a.push(f);s[f]=l[2]??l[3]??l[4]??""}let u=[],p=[];for(let[f,h]of Object.entries(n)){if(h==null)continue;let m=f.trim();if(!G.test(m))continue;let A=m.toLowerCase();if(A==="class"){let E=(s.class||"").split(/\s+/).filter(Boolean);for(let x of String(h).split(/\s+/).filter(Boolean))if(!E.includes(x))E.push(x),u.push(x);if(!("class"in s))a.push("class");s.class=E.join(" ");continue}if(!(m in s))a.push(m);if(s[m]=String(h),A!=="lang")p.push(m)}if(u.length){if(!(C in s))a.push(C);s[C]=u.join(" ")}if(p.length){if(!(w in s))a.push(w);s[w]=p.join(" ")}let d=a.map((f)=>` ${f}="${y(s[f])}"`).join("");return e.replace(r[0],()=>`<html${d}>`)}function ea(e){if(e.includes("data-stx-cloak"))return null;if(e.lastIndexOf("</head>")===-1)return null;return`${Y}
7
- `}function Ce(e){let n=[],r=0;while(r<e.length){let o=e.slice(r),l=o.match(/^\s+/);if(l){r+=l[0].length;continue}if(o.startsWith("<!--")){let h=e.indexOf("-->",r);if(h===-1)break;r=h+3;continue}let u=o.match(/^<script\b[^>]*>/i);if(u){let h=e.toLowerCase().indexOf("</script>",r+u[0].length);if(h===-1)break;r=h+9;continue}let p=o.match(/^<link\b[^>]*>/i);if(p){n.push(p[0]),r+=p[0].length;continue}let d=o.match(/^<meta\b[^>]*>/i);if(d){n.push(d[0]),r+=d[0].length;continue}let f=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(f){n.push(f[0]),r+=f[0].length;continue}break}if(n.length===0)return{body:e,hoisted:n};let s="",a=0;while(a<e.length&&a<r){let o=e.slice(a),l=o.match(/^<link\b[^>]*>/i);if(l&&n.includes(l[0])){a+=l[0].length;continue}let u=o.match(/^<meta\b[^>]*>/i);if(u&&n.includes(u[0])){a+=u[0].length;continue}let p=o.match(/^<style\b[^>]*>[\s\S]*?<\/style>/i);if(p&&n.includes(p[0])){a+=p[0].length;continue}s+=e[a],a++}return s+=e.slice(r),{body:s,hoisted:n}}function $e(e,n={},r={}){let{title:s="stx App",lang:a="en",meta:o=[],link:l=[],script:u=[],headRaw:p="",htmlAttrs:d={},bodyClass:f="",bodyAttrs:h={}}=n,m=r.title||s,A=[{charset:"UTF-8"},{name:"viewport",content:"width=device-width, initial-scale=1.0"}],E=new Set(o.map(Oe).filter(Boolean)),{body:x,hoisted:B}=Ce(e),te=new Set(B.flatMap((g)=>{let v=Ee(g);return v?[Oe(v)].filter(Boolean):[]})),ne=[...A.filter((g)=>!E.has(Oe(g))),...o].filter((g)=>!te.has(Oe(g))).map((g)=>` <meta ${k(g)}>`).join(`
8
- `),re=l.map((g)=>` <link ${k(g)}>`).join(`
9
- `),ie=u.map((g)=>{if(g.src)return` <script ${k(g,(v)=>v==="content")}></script>`;if(g.content)return` ${J(g)}`;return""}).filter(Boolean).join(`
10
- `),se=Ae(d,a),oe=Object.entries(h).map(([g,v])=>` ${g}="${y(String(v))}"`).join(""),ae=f?` class="${y(f)}"`:"",le=[ne,r.colorMode?` ${D(r.colorMode)}`:"",` <title>${r.titleIsHtml?m:ve(m)}</title>`,` ${Y}`,re,ie,p?` ${p}`:"",...(r.styles||[]).map((g)=>` ${g}`),...B.map((g)=>` ${g}`),...(r.headScripts||[]).map((g)=>` ${g}`),r.headStack||""].filter(Boolean),ce=[x,...(r.bodyScripts||[]).map((g)=>g),r.bodyStack||""].filter(Boolean);return`<!DOCTYPE html>
11
- <html${se}>
12
- <head>
13
- ${le.join(`
14
- `)}
15
- </head>
16
- <body${ae}${oe}>
17
- ${ce.join(`
18
- `)}
19
- </body>
20
- </html>`}var H=/\s+/y,j=/<(script|style)\b[^>]*>/iy,Re=/<\/script>/gi,_e=/<\/style>/gi,z=/<!DOCTYPE\b/iy,X=/<html[\s>]/iy;function Ut(e){let n=0;while(n<e.length){if(H.lastIndex=n,H.exec(e)){n=H.lastIndex;continue}if(e.startsWith("<!--",n)){let a=e.indexOf("-->",n);if(a===-1)return!1;n=a+3;continue}j.lastIndex=n;let s=j.exec(e);if(s){let a=s[1].toLowerCase()==="script"?Re:_e;a.lastIndex=j.lastIndex;let o=a.exec(e);if(o===null)return!1;n=o.index+o[0].length;continue}if(z.lastIndex=n,z.test(e))return!0;return X.lastIndex=n,X.test(e)}return!1}function no(e){return Ut(e)}function ta(e,n={}){let r=e.lastIndexOf("</head>");if(r===-1)return e;let{meta:s=[],link:a=[],script:o=[],headRaw:l=""}=n,u=e.slice(0,r),p=[];for(let d of s){let f=Oe(d);if(f&&u.includes(f))continue;p.push(` <meta ${k(d)}>`)}for(let d of a){if(d.href&&u.includes(`href="${d.href}"`))continue;p.push(` <link ${k(d)}>`)}for(let d of o)if(d.src){if(u.includes(`src="${d.src}"`))continue;p.push(` <script ${k(d,(f)=>f==="content")}></script>`)}else if(d.content){if(u.includes(R(d)))continue;p.push(` ${J(d)}`)}if(l&&!u.includes(l))p.push(` ${l}`);if(p.length===0)return e;return`${e.slice(0,r)}${p.join(`
21
- `)}
22
- ${e.slice(r)}`}function Dn(e,n={},r={},s){if(s??no(e))return e;return $e(e,n,r)}var Me=["og:","article:","book:","profile:","fb:","music:","video:"],Le=/^[a-z][\w-]*(?::[\w:-]+)?$/i;function Mn(e,n){if(e.length<1)return{kind:"error",message:"meta directive requires at least the meta name",code:t.INVALID_DIRECTIVE_SYNTAX};if(e.length>2)return{kind:"error",message:`@meta takes a name and a value, got ${e.length} arguments`,code:t.INVALID_DIRECTIVE_SYNTAX};let r=De(e[0],n);if(typeof r!=="string")return r;let s;if(e.length===2){let o=He(e[1],n);if(typeof o!=="string")return o;s=o}else{let o=r.includes(":")?r.slice(r.indexOf(":")+1):r,l=n.openGraph,u=n[o]??(Ie(l)?l[o]:void 0);s=u===void 0||u===null||typeof u==="object"?"":String(u)}if(!s)return{kind:"empty"};return{kind:"tag",tag:Me.some((o)=>r.startsWith(o))?{property:r,content:s}:{name:r,content:s}}}function De(e,n){let r=O(e);if(r!==null)return r.trim()?r:{kind:"error",message:"the meta name is empty",code:t.INVALID_DIRECTIVE_SYNTAX};if(Le.test(e.trim()))return e.trim();let s=ut(e,n);if(!s.ok)return{kind:"error",message:`meta name: ${s.message}`,code:s.code};if(typeof s.value!=="string"||!s.value.trim())return{kind:"error",message:`the meta name must be a non-empty string, got ${we(s.value)}`,code:t.TYPE_ERROR};return s.value}function He(e,n){let r=O(e);if(r!==null)return r;let s=ut(e,n);if(!s.ok)return{kind:"error",message:s.message,code:s.code};let a=s.value;if(a===void 0||a===null||a===!1)return"";if(Array.isArray(a))return a.filter((o)=>o!==void 0&&o!==null&&o!=="").map(String).join(", ");if(typeof a==="object"&&!(a instanceof Date))return{kind:"error",message:`the content must be text, got ${we(a)}`,code:t.TYPE_ERROR};return String(a)}var Ln=["title","lang","meta","link","script","headRaw","htmlAttrs","bodyClass","bodyAttrs"],Er=["title","titleTemplate","base","meta","link","script","style","htmlAttrs","bodyAttrs"],ee={links:"link",metas:"meta",scripts:"script",styles:"style"},Z=new Set,Q=new WeakMap;function P(e){if(Z.has(e))return;Z.add(e),console.warn(e)}function je(e,n){let r=Array.from({length:n.length+1},(s,a)=>a);for(let s=1;s<=e.length;s++){let a=r[0];r[0]=s;for(let o=1;o<=n.length;o++){let l=r[o];r[o]=Math.min(r[o]+1,r[o-1]+1,a+(e[s-1]===n[o-1]?0:1)),a=l}}return r[n.length]}function Pe(e,n){let r=e.toLowerCase(),s=n.find((p)=>p.toLowerCase()===r);if(s)return s;let a=ee[r];if(a&&n.includes(a))return a;let o,l=1/0;for(let p of n){let d=je(r,p.toLowerCase());if(d<l)o=p,l=d}let u=Math.min(e.length,o?.length??0)<=4?1:2;return l<=u?o:void 0}function xe(e,n){if(!e||typeof e!=="object"||Array.isArray(e))return e||{};let r=Q.get(e);if(r)return r;let{known:s,source:a}=n,o=e;for(let l of Object.keys(e)){if(s.includes(l))continue;let u=ee[l];if(u&&s.includes(u)&&Array.isArray(e[l])){if(o===e)o={...e};let d=Array.isArray(o[u])?o[u]:[];o[u]=[...d,...e[l]],delete o[l],P(`[stx] ${a}.${l} is not a head key; reading it as ${a}.${u}. Rename it to \`${u}\`.`);continue}if(/^styles?$/.test(l)&&!s.includes("style")){P(`[stx] ${a}.${l} is not a head key and is ignored. Use \`link\` with rel: 'stylesheet', or \`headRaw\` for an inline <style>.`);continue}let p=Pe(l,s);P(p?`[stx] ${a}.${l} is not a head key and is ignored. Did you mean \`${p}\`?`:`[stx] ${a}.${l} is not a head key and is ignored. Known keys: ${s.join(", ")}.`)}return Q.set(e,o),o}var b={},Be=[],I={};function ro(){return b}function Id(){return I}function Od(){b={},Be.length=0,I={}}function na(e){b=Se(b,xe(e,{known:Er,source:"useHead()"}))}function Se(e,n){return{title:n.title??e.title,titleTemplate:n.titleTemplate??e.titleTemplate,base:n.base??e.base,meta:[...e.meta||[],...n.meta||[]],link:[...e.link||[],...n.link||[]],script:[...e.script||[],...n.script||[]],style:[...e.style||[],...n.style||[]],htmlAttrs:{...e.htmlAttrs,...n.htmlAttrs},bodyAttrs:{...e.bodyAttrs,...n.bodyAttrs}}}function ul(e){na(Tr(e))}function Tr(e){let n=[];if(e.description)n.push({name:"description",content:e.description});if(e.keywords){let p=Array.isArray(e.keywords)?e.keywords.join(", "):e.keywords;n.push({name:"keywords",content:p})}if(e.author)n.push({name:"author",content:e.author});if(e.robots)n.push({name:"robots",content:e.robots});let r=e.ogTitle??e.title,s=e.ogDescription??e.description;if(r)n.push({property:"og:title",content:r});if(s)n.push({property:"og:description",content:s});if(e.ogImage){if(n.push({property:"og:image",content:e.ogImage}),e.ogImageType)n.push({property:"og:image:type",content:e.ogImageType});if(e.ogImageWidth)n.push({property:"og:image:width",content:String(e.ogImageWidth)});if(e.ogImageHeight)n.push({property:"og:image:height",content:String(e.ogImageHeight)});if(e.ogImageAlt)n.push({property:"og:image:alt",content:e.ogImageAlt})}if(e.ogUrl)n.push({property:"og:url",content:e.ogUrl});if(e.ogType)n.push({property:"og:type",content:e.ogType});if(e.ogSiteName)n.push({property:"og:site_name",content:e.ogSiteName});if(e.ogLocale)n.push({property:"og:locale",content:e.ogLocale});if(e.profileFirstName)n.push({property:"profile:first_name",content:e.profileFirstName});if(e.profileLastName)n.push({property:"profile:last_name",content:e.profileLastName});if(e.profileUsername)n.push({property:"profile:username",content:e.profileUsername});let a=e.twitterTitle??e.title,o=e.twitterDescription??e.description,l=e.twitterImage??e.ogImage;if(e.twitterCard)n.push({name:"twitter:card",content:e.twitterCard});if(a)n.push({name:"twitter:title",content:a});if(o)n.push({name:"twitter:description",content:o});if(l){n.push({name:"twitter:image",content:l});let p=e.twitterImageAlt??(e.twitterImage?void 0:e.ogImageAlt);if(p)n.push({name:"twitter:image:alt",content:p})}if(e.twitterSite)n.push({name:"twitter:site",content:e.twitterSite});if(e.twitterCreator)n.push({name:"twitter:creator",content:e.twitterCreator});if(e.articleAuthor)n.push({property:"article:author",content:e.articleAuthor});if(e.articlePublishedTime)n.push({property:"article:published_time",content:e.articlePublishedTime});if(e.articleModifiedTime)n.push({property:"article:modified_time",content:e.articleModifiedTime});if(e.articleSection)n.push({property:"article:section",content:e.articleSection});if(e.articleTags)for(let p of e.articleTags)n.push({property:"article:tag",content:p});let u=[];if(e.canonical)u.push({rel:"canonical",href:e.canonical});return{title:e.title,titleTemplate:e.titleTemplate,meta:n,link:u}}function Nd(e){if(I={...I,...e},e.title||e.description)ul({title:e.title,description:e.description})}function Dd(e){let n=typeof e==="function"?e():e;na({title:n})}function Md(e=b){let n=[];if(e.title){let r=e.title;if(e.titleTemplate)r=typeof e.titleTemplate==="function"?e.titleTemplate(r):e.titleTemplate.replace("%s",r);n.push(`<title>${T(r)}</title>`)}if(e.base){let r=Object.entries(e.base).map(([s,a])=>`${s}="${T(a)}"`).join(" ");n.push(`<base ${r}>`)}for(let r of e.meta||[]){let s=Object.entries(r).filter(([a,o])=>o!==void 0).map(([a,o])=>`${a==="httpEquiv"?"http-equiv":a}="${T(String(o))}"`).join(" ");n.push(`<meta ${s}>`)}for(let r of e.link||[]){let s=Object.entries(r).filter(([a,o])=>o!==void 0).map(([a,o])=>`${a}="${T(String(o))}"`).join(" ");n.push(`<link ${s}>`)}for(let r of e.script||[]){let{content:s,...a}=r,o=Object.entries(a).filter(([l,u])=>u!==void 0).map(([l,u])=>{if(typeof u==="boolean")return u?l:"";return`${l}="${T(String(u))}"`}).filter(Boolean).join(" ");if(s)n.push(`<script ${o}>${R(r)}</script>`);else n.push(`<script ${o}></script>`)}for(let r of e.style||[]){let s=r.type?` type="${r.type}"`:"";n.push(`<style${s}>${r.content}</style>`)}return n.join(`
23
- `)}function Ld(e=b){if(!e.htmlAttrs)return"";return Object.entries(e.htmlAttrs).map(([n,r])=>`${n}="${T(r)}"`).join(" ")}function jd(e=b){if(!e.bodyAttrs)return"";return Object.entries(e.bodyAttrs).map(([n,r])=>`${n}="${T(r)}"`).join(" ")}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Bd(e=b){if(typeof document>"u")return;if(e.title){let n=e.title;if(e.titleTemplate)n=typeof e.titleTemplate==="function"?e.titleTemplate(n):e.titleTemplate.replace("%s",n);document.title=n}for(let n of e.meta||[]){let r=n.name?`meta[name="${n.name}"]`:n.property?`meta[property="${n.property}"]`:null;if(r){let s=document.querySelector(r);if(!s){if(s=document.createElement("meta"),n.name)s.setAttribute("name",n.name);if(n.property)s.setAttribute("property",n.property);document.head.appendChild(s)}s.setAttribute("content",n.content)}}for(let n of e.link||[]){let r=`link[rel="${n.rel}"]${n.href?`[href="${n.href}"]`:""}`,s=document.querySelector(r);if(!s)s=document.createElement("link"),document.head.appendChild(s);for(let[a,o]of Object.entries(n))if(o!==void 0)s.setAttribute(a,String(o))}if(e.htmlAttrs)for(let[n,r]of Object.entries(e.htmlAttrs))if(n==="class")for(let s of String(r).split(/\s+/).filter(Boolean))document.documentElement.classList.add(s);else document.documentElement.setAttribute(n,r);if(e.bodyAttrs)for(let[n,r]of Object.entries(e.bodyAttrs))document.body.setAttribute(n,r)}function Fd(e){let n="";return{content:e.replace(/@head\s*([\s\S]*?)@endhead/g,(s,a)=>(n+=a.trim()+`
24
- `,"")),headContent:n.trim()}}function zd(e,n){return e.replace(/@title\s*\(\s*(?:(['"`])(.+?)\1|([^)]+))\s*\)/g,(r,s,a,o)=>{let l=s?a:n[(o||"").trim()]??o,u=n.__stx_runtime_head??{};return n.__stx_runtime_head=Se(u,{title:l}),""})}function Hd(e,n,r=""){if(!e.includes("@meta"))return e;return ct(e,/(?<![\w$@])@meta\s*\(/g,(s,a)=>{let o=Mn(lt(s),n);if(o.kind==="error")return _("Meta",a,o.message,r,o.code);if(o.kind==="tag"){let l=n.__stx_runtime_head??{};n.__stx_runtime_head=Se(l,{meta:[o.tag]})}return""},(s)=>_("Meta",s,"the call has no closing parenthesis",r,t.INVALID_DIRECTIVE_SYNTAX))}export{S,eo,ct,lt,ut,we,Ie,_,_r,to,Yi,In,On,Zi,Oe,Qi,Nn,ea,Ut,no,ta,Dn,Mn,Ln,Er,xe,ro,Id,Od,na,Se,ul,Tr,Nd,Dd,Md,Ld,jd,Bd,Fd,zd,Hd};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{X}from"./chunk-6e4es31t.js";function g(e,t){let r={};for(let n of e)r[n]=X(t(n));return new Proxy({},{get:(n,a)=>r[a]?.(),set:(n,a,o)=>{if(r[a])r[a].set(o);else r[a]=X(o);return!0},has:(n,a)=>(a in r),deleteProperty:(n,a)=>(delete r[a],!0),ownKeys:()=>Reflect.ownKeys(r),getOwnPropertyDescriptor:(n,a)=>(a in r)?{enumerable:!0,configurable:!0,writable:!0,value:r[a]()}:void 0})}function v(e,t){let r={};for(let n of t)r[n]=e[n];return r}function Wo(e,t){let r=Object.keys(e),n=g(r,(i)=>t?.[i]??e[i].getDefaultValue()),a=g(r,()=>[]),o=g(r,()=>!1),c=g(r,()=>!1),f=g(r,()=>!1),s=X(!1);async function u(i){f[i]=!0;let d=await e[i].validate(n[i],n);return a[i]=d,f[i]=!1,d.length===0}async function l(){s.set(!0);let i=await Promise.all(r.map(u));return s.set(!1),i.every(Boolean)}function m(){for(let i of r)n[i]=t?.[i]??e[i].getDefaultValue(),a[i]=[],o[i]=!1,c[i]=!1}function h(i){for(let d of r)if(d in i)n[d]=i[d],c[d]=!0}function b(i,d){n[i]=d,c[i]=!0}function y(i,d=!0){if(o[i]=d,d)u(i)}function p(i){return{value:n[i],errors:a[i],touched:o[i],dirty:c[i],valid:a[i].length===0,validating:f[i]}}function V(i){return async(d)=>{d?.preventDefault?.();for(let w of r)o[w]=!0;if(await l())await i(v(n,r))}}return{values:n,errors:a,touched:o,dirty:c,get isValid(){return r.every((i)=>a[i].length===0)},get isValidating(){return s()||r.some((i)=>f[i])},get isDirty(){return r.some((i)=>c[i])},validate:l,validateField:u,reset:m,setValues:h,setFieldValue:b,setFieldTouched:y,getFieldState:p,handleSubmit:V}}var oc=Wo;class cn{rules=[];defaultValue="";addRule(e){let t=new cn;return t.rules=[...this.rules,e],t.defaultValue=this.defaultValue,t}required(e="This field is required"){return this.addRule({name:"required",message:e,validate:(t)=>{if(t===null||t===void 0)return e;if(typeof t==="string"&&t.trim()==="")return e;if(Array.isArray(t)&&t.length===0)return e;return!0}})}email(e="Please enter a valid email"){return this.addRule({name:"email",message:e,validate:(t)=>{if(!t)return!0;return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t))||e}})}url(e="Please enter a valid URL"){return this.addRule({name:"url",message:e,validate:(t)=>{if(!t)return!0;try{return new URL(String(t)),!0}catch{return e}}})}min(e,t){let r=t||`Must be at least ${e} characters`;return this.addRule({name:"min",message:r,validate:(n)=>{if(!n)return!0;return String(n).length>=e||r}})}max(e,t){let r=t||`Must be no more than ${e} characters`;return this.addRule({name:"max",message:r,validate:(n)=>{if(!n)return!0;return String(n).length<=e||r}})}length(e,t,r){let n=r||`Must be between ${e} and ${t} characters`;return this.addRule({name:"length",message:n,validate:(a)=>{if(!a)return!0;let o=String(a).length;return o>=e&&o<=t||n}})}pattern(e,t="Invalid format"){return this.addRule({name:"pattern",message:t,validate:(r)=>{if(!r)return!0;return e.test(String(r))||t}})}hasUppercase(e="Must contain an uppercase letter"){return this.pattern(/[A-Z]/,e)}hasLowercase(e="Must contain a lowercase letter"){return this.pattern(/[a-z]/,e)}hasNumber(e="Must contain a number"){return this.pattern(/\d/,e)}hasSpecial(e="Must contain a special character"){return this.pattern(/[!@#$%^&*(),.?":{}|<>]/,e)}alphanumeric(e="Only letters and numbers allowed"){return this.pattern(/^[a-zA-Z0-9]+$/,e)}startsWithLetter(e="Must start with a letter"){return this.pattern(/^[a-zA-Z]/,e)}noSpaces(e="Spaces are not allowed"){return this.addRule({name:"noSpaces",message:e,validate:(t)=>{if(!t)return!0;return!String(t).includes(" ")||e}})}number(e="Must be a number"){let t=this.addRule({name:"number",message:e,validate:(r)=>{if(!r&&r!==0)return!0;return!Number.isNaN(Number(r))||e}});return t.defaultValue=0,t}integer(e="Must be a whole number"){return this.addRule({name:"integer",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number.isInteger(Number(t))||e}})}positive(e="Must be a positive number"){return this.addRule({name:"positive",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)>0||e}})}negative(e="Must be a negative number"){return this.addRule({name:"negative",message:e,validate:(t)=>{if(!t&&t!==0)return!0;return Number(t)<0||e}})}minValue(e,t){let r=t||`Must be at least ${e}`;return this.addRule({name:"minValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)>=e||r}})}maxValue(e,t){let r=t||`Must be no more than ${e}`;return this.addRule({name:"maxValue",message:r,validate:(n)=>{if(!n&&n!==0)return!0;return Number(n)<=e||r}})}between(e,t,r){let n=r||`Must be between ${e} and ${t}`;return this.addRule({name:"between",message:n,validate:(a)=>{if(!a&&a!==0)return!0;let o=Number(a);return o>=e&&o<=t||n}})}matches(e,t){let r=t||`Must match ${e}`;return this.addRule({name:"matches",message:r,validate:(n,a)=>{if(!a)return!0;return n===a[e]||r}})}oneOf(e,t){let r=t||`Must be one of: ${e.join(", ")}`;return this.addRule({name:"oneOf",message:r,validate:(n)=>{if(!n)return!0;return e.includes(n)||r}})}notOneOf(e,t){let r=t||`Cannot be one of: ${e.join(", ")}`;return this.addRule({name:"notOneOf",message:r,validate:(n)=>{if(!n)return!0;return!e.includes(n)||r}})}date(e="Must be a valid date"){return this.addRule({name:"date",message:e,validate:(t)=>{if(!t)return!0;let r=new Date(String(t));return!Number.isNaN(r.getTime())||e}})}before(e,t){let r=new Date(e),n=t||`Must be before ${r.toLocaleDateString()}`;return this.addRule({name:"before",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))<r||n}})}after(e,t){let r=new Date(e),n=t||`Must be after ${r.toLocaleDateString()}`;return this.addRule({name:"after",message:n,validate:(a)=>{if(!a)return!0;return new Date(String(a))>r||n}})}custom(e,t="Invalid value"){return this.addRule({name:"custom",message:t,validate:e})}async(e,t="Invalid value"){return this.addRule({name:"async",message:t,async:!0,validate:e})}when(e,t){let r=new cn;r.rules=[...this.rules],r.defaultValue=this.defaultValue;for(let n of t.getRules())r.rules.push({...n,validate:(a,o)=>{if(!e(a,o||{}))return!0;return n.validate(a,o)}});return r}getRules(){return this.rules}getDefaultValue(){return this.defaultValue}default(e){let t=new cn;return t.rules=[...this.rules],t.defaultValue=e,t}async validate(e,t){let r=[];for(let n of this.rules){let a=await n.validate(e,t);if(a!==!0)r.push(a)}return r}validateSync(e,t){let r=[];for(let n of this.rules){if(n.async)continue;let a=n.validate(e,t);if(a!==!0)r.push(a)}return r}}var ou=new cn;function ic(e,t,r){let n=/@error\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderror/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
3
- `)}catch{return""}})}function ac(e,t,r){let n=/@errors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@enderrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return u.map((l)=>c.replace(/\{\{\s*message\s*\}\}/g,l)).join(`
4
- `)}catch{return""}})}function cc(e,t,r){let n=/@hasErrors\s*\(\s*([^)]+)\s*\)([\s\S]*?)@endhasErrors/g;return e.replace(n,(a,o,c)=>{try{let f=o.trim().split("."),s=t;for(let l of f)if(s&&typeof s==="object"&&l in s)s=s[l];else return"";let u=s;if(!u||!Array.isArray(u)||u.length===0)return"";return c}catch{return""}})}function iu(e,t,r){let n=e;return n=ic(n,t,r),n=ac(n,t,r),n=cc(n,t,r),n}export{Wo,oc,cn,ou,ic,ac,cc,iu};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qr,es,ts,Ha,ns,rs,Va,ss,os,Ho,Ua}from"./chunk-22hdbqad.js";export{Qr as VideoProcessorCache,Ho as analyzeVideo,Ha as clearVideoCache,os as generateDASHManifest,ss as generateHLSManifest,ns as generatePoster,Va as generateSpriteSheet,rs as generateThumbnails,es as getCachedVideoResult,Ua as processVideo,ts as setCachedVideoResult};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ot,ms,hs,ys,td,bs}from"./chunk-3q5yn5r0.js";import"./chunk-apeyn69a.js";import"./chunk-a0ygyftk.js";import"./chunk-qa625vwc.js";export{hs as buildServerApi,td as createServerApi,Ot as discoverServerApi,ms as generateApiTypes,bs as isServerApiSource,ys as productionApiDispatcher};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Wo,oc,cn,ou,ic,ac,cc,iu}from"./chunk-dwnvqy3f.js";export{cn as Validator,oc as defineForm,ic as processErrorDirective,ac as processErrorsDirective,iu as processFormValidationDirectives,cc as processHasErrorsDirective,Wo as useForm,ou as v};
@@ -1,18 +0,0 @@
1
- // @bun
2
- import{ir,Ge,_e,Ee,Si,dr,oe,Q,Tn,u,$n,n,A}from"./chunk-srmm69d4.js";function b(o){return o.endsWith(".md")||o.endsWith(".markdown")}function C(o){let e=[];m(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let s=[...e];m(/<code\b[^>]*>[\s\S]*?<\/code>/gi,s);function m(r,p){let g;while((g=r.exec(o))!==null){let t=g.index,i=t+g[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((r,p)=>r.start-p.start);let a="",c=0;for(let r of e){if(r.start<c)continue;a+=o.slice(c,r.start),a+=`@raw${o.slice(r.start,r.end)}@endraw`,c=r.end}return a+=o.slice(c),a}async function R(o,e={}){let{data:s,content:m}=ir(o),c=await(e.renderer??((r)=>Ge(r)))(m);return{html:C(c),frontmatter:s??{}}}import{dirname as k,resolve as _}from"path";function v(o){let e=o,s=oe(o);if(s)e=s.content.trim();let m=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,a=[],c=[],r=[],p=(i)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(i),g;while((g=m.exec(o))!==null){let i=g[1],l=g[2],d=g[0],f=i.includes("server");if(p(l))r.push(d);else if(f)c.push(l);else a.push(d)}let t=e;{let i=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,l,d=[];while((l=i.exec(t))!==null){let f=l.index+l[0].length,w=t.indexOf("</script>",f);if(w===-1)continue;d.push({start:l.index,end:w+9}),i.lastIndex=w+9}for(let f=d.length-1;f>=0;f--)t=t.substring(0,d[f].start)+t.substring(d[f].end)}for(let i of a)t=t.replace(i,"");return{templateContent:t,serverScripts:c,clientScripts:a,signalsScripts:r}}function M(o,e){return`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>${(e||"stx").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</title>
8
- </head>
9
- <body>
10
- ${o}
11
- </body>
12
- </html>`}async function ri(o,e={}){let s=_(o),m=Bun.file(s);if(!await m.exists())throw Error(`Template file not found: ${s}`);let a=await m.text(),c=null;if(b(s)){let r=await R(a,{renderer:e.markdownRenderer});a=r.html,c=r.frontmatter}if(c)e={...e,context:{...c,...e.context||{}}};if(e.layout){let r=_(e.layout),p=Bun.file(r);if(!await p.exists())throw Error(`Layout template not found: ${r}`);let{layout:g,injectCSS:t,...i}=e,l={...e.context||{}};Tn(l);let d=await x(a,s,{...i,context:{...l,__stx_defer_server_data:!0},injectCSS:!1}),f=await p.text(),w={...l,content:d},S={...i,context:w,injectCSS:t};return x(f,r,S)}return x(a,s,e)}async function x(o,e,s={}){let{templateContent:m,serverScripts:a,clientScripts:c}=v(o),r={...A,...s.options},p={__filename:e,__dirname:k(e),__stx:{},__stx_options:r,__stx_sfc_mode:!0,__stx_inject_css:s.injectCSS===!0,__stxServeContext:void 0,...dr(s.context??{}),definePageMeta:()=>{},...s.context||{}};for(let i of a)await u(i,p,e);let g=new Set,t=m;if(t=await n(t,p,e,r,g),Si(p,s.context),s.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
- ${c.join(`
14
- `)}`}else{if(s.processClientScripts!==!1&&c.length>0){let i=p.__stx_event_bindings||[],l=_e(p),d=await Promise.all(c.map(async(y)=>{let h=y.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!h)return y;return await Ee(h[1],{eventBindings:i,templateContent:t,serverData:l,filePath:e})})),w=[await $n(d,{...r,buildMode:"compile"}),...d].filter(Boolean).join(`
15
- `);if(t.match(/(<\/body>)/i))t=t.replace(/(<\/body>)/i,`${w}
16
- $1`);else t+=`
17
- ${w}`}t=await Q(t)}if(s.wrapInDocument){if(!t.trim().toLowerCase().startsWith("<!doctype")&&!t.trim().toLowerCase().startsWith("<html"))t=M(t,s.title)}if(s.injectCSS)try{let{injectCss:i}=await import("./chunk-wg6n7txf.js");t=await i(t)}catch{}return t}
18
- export{ri};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ta,Ao,Rl,$a,Ra,Al,Pl}from"./chunk-d365tseq.js";import"./chunk-wrd5me1w.js";import"./chunk-4zapx8zt.js";import"./chunk-3q5yn5r0.js";import"./chunk-bsts9pr5.js";import{tt,zc}from"./chunk-srmm69d4.js";import"./chunk-2etamr31.js";import"./chunk-gvr10eqb.js";import"./chunk-apeyn69a.js";import"./chunk-fb17t651.js";import"./chunk-a0ygyftk.js";import"./chunk-cf6d5kgb.js";import"./chunk-d67qvrzc.js";import"./chunk-zx7v6a4g.js";import"./chunk-ahyq08mp.js";import"./chunk-r2seygb5.js";import"./chunk-qa625vwc.js";import"./chunk-pvfx0dgz.js";export{Ta as buildVirtualSource,tt as extractScriptBlocks,zc as extractTemplateExpressions,$a as findRuntimeTypeDeclarations,Ra as findStxModuleDeclarations,Pl as formatTypecheckDiagnostics,Rl as sourcePathFor,Al as typecheckStxFiles,Ao as virtualPathFor};
@@ -1,31 +0,0 @@
1
- // @bun
2
- import{Ut}from"./chunk-d67qvrzc.js";import{bi,Ss,W,Xe,ne,Lt,x,Ze,Qe,mr,u}from"./chunk-srmm69d4.js";import{D}from"./chunk-7mkw98cr.js";var H=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function V(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(H.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var B=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function Po(t){let n=[],e=[],r=[],i=0;while(i<t.length){let s=t.indexOf("<",i);if(s===-1)break;let a=Xe(t,s);if(a>s){i=a;continue}let o=W(t,s);if(o>s){let c=t.slice(s,o),f=B.exec(c);if(f){let l=V(f[1],f[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}i=o;continue}i=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var q=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function z(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function G(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,i=r.match(/^[a-z][\w-]*/i);if(i)e.tag=i[0].toLowerCase(),r=r.slice(i[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let o=r.match(/^\.([\w-]+)/);if(o){e.className=o[1],r=r.slice(o[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function U(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function O(t,n="main"){let e=G(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,i=z(t),s;while((s=r.exec(t))!==null){if(P(s.index,i))continue;let a=s[1].toLowerCase(),o=s[2]||"";if(o.trimEnd().endsWith("/")||q.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!U(o,e))continue;let c=s[0],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,m;while((m=l.exec(t))!==null){if(P(m.index,i))continue;let S=m[1]==="/";if(!S&&(m[2]||"").trimEnd().endsWith("/"))continue;if(g+=S?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:m.index,tagName:a}}return null}return null}var He="private, no-store";function Io(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/g,"'").replace(/&amp;/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function ce(t){return t.headers.get("X-STX-Router")==="true"}function X(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function T(t){return{Vary:X(t,"X-STX-Router")}}import E from"path";var J="stx-page-head:",K=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,v={dev:null,prod:null};function Y(){let t=D()?"dev":"prod",n=v[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-tj4rzy69.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;v[t]=`<script>${r()}</script>`}catch{v[t]=""}return v[t]}async function Oo(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=E.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=E.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Gr(t,n){try{let e=await Bun.file(t).text(),r=e,i=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(i)r=i[1].trim();let s=Po(e),a=[...s.client.map((d)=>d.fullTag),...s.signals.map((d)=>d.fullTag)],o=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)o.push(f[0]);let l=r;for(let d of s.server)l=l.replace(d.fullTag,"");for(let d of s.client)l=l.replace(d.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:m,extractVariables:S,defaultConfig:b,loadStxConfig:w}=await import("./chunk-tme51pg1.js"),y=await w(),p={__filename:t,__dirname:E.dirname(t)};for(let d of a){let C=d.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!d.includes("client")&&!d.includes('type="module"'))await S(C[1],p,t)}let R=await m(l,p,t,{...b,...y,...n},new Set),h=R.indexOf(g);if(h===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:R.substring(0,h),afterSlot:R.substring(h+g.length),filePath:t,shellScripts:a,shellStyles:o}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function Zn(t,n,e){let r,i="",s=n.match(K);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();i=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",o=Y(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
3
- <html lang="en">
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>${a}</title>
8
- ${i?` ${i}
9
- `:""} ${t.shellStyles.join(`
10
- `)}
11
- </head>
12
- <body>
13
- ${t.beforeSlot}
14
- <div data-stx-content>${n}</div>
15
- ${t.afterSlot}
16
- ${t.shellScripts.filter((l)=>!l.includes("server")).join(`
17
- `)}
18
- ${c}
19
- ${o}
20
- </body>
21
- </html>`}function ke(t,n={}){let e=t.trim();if(!Ut(e))return t;let r=[],i=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(i){let c=i[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=f.exec(c))!==null)r.push(l[0]);let g=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(g)r.push(g[0]);let m=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(m)r.push(m[0])}if(n.preserveHead&&i){let c=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=f.exec(i[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${J}${Buffer.from(c.join(`
22
- `),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,f=e.slice(c,a).trim();if(r.length>0)return r.join(`
23
- `)+`
24
- `+f;return f}let o=e;if(o=o.replace(/<!DOCTYPE\b[^>]*>/i,""),o=o.replace(/<html\b[^>]*>/i,""),o=o.replace(/<\/html\s*>/i,""),i)o=o.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
25
- `));return o=o.replace(/<body\b[^>]*>/i,""),o=o.replace(/<\/body\s*>/i,""),o.trim()}var j=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function N(t,n,e,r){if(!j.test(n))return!1;let i=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(i)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let o=t.indexOf(a);o!==-1;o=t.indexOf(a,o+a.length))if(o>=e&&o<r)return!1;return!0}function No(t){return ce(t)}function Z(t,n){let e=[],r=new Set;for(let i of ne(t,W)){if(i.start>=n.start&&i.start<n.end)continue;let s=i.token.match(/^<script\b((?:"[^"]*"|'[^']*'|[^'">])*)>/i)?.[1]??"",a=new Map;for(let f of s.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/g))a.set(f[1].toLowerCase(),f[2]??f[3]??f[4]??"");let o=a.get("src")?.trim(),c=a.get("type")?.trim().toLowerCase();if(!o||a.has("server")||c&&!["module","text/javascript","application/javascript"].includes(c))continue;if(a.has("data-stx-runtime")||a.has("data-stx-router")||/^\/_stx\/(?:runtime|router)(?:\.[a-f0-9]{16})?\.js(?:[?#]|$)/i.test(o))continue;if(N(t,i.token,n.start,n.end)||r.has(i.token))continue;r.add(i.token),e.push(i.token)}return e}function le(t,n="main"){let e=t.trim(),r=[],i=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let p=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,h;while((h=R.exec(p))!==null)r.push(h[0]);let d=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((h=d.exec(p))!==null){if(j.test(h[0])||h[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(h[0]))continue;i.push(h[0])}}let a=O(e,n);if(!a)return ke(t);let o=Z(e,a),c=new Set(o),{tagName:f,start:l,end:g}=a,m=e.slice(l,g).trim(),S=[],b=e.match(/<body\b[^>]*>/i),w=e.lastIndexOf("</body>");if(b&&b.index!==void 0&&w!==-1){let R=[[b.index+b[0].length,a.openIndex],[g+`</${f}>`.length,w]],h=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[d,C]of R){if(d>=C)continue;let L=e.slice(d,C),A;h.lastIndex=0;while((A=h.exec(L))!==null){if(N(e,A[0],l,g))continue;S.push(A[0])}}}let y=[];if(r.length>0)y.push(r.join(`
26
- `));if(o.length>0)y.push(o.join(`
27
- `));if(i.length>0)y.push(i.filter((p)=>!c.has(p)).join(`
28
- `));if(S.length>0)y.push(S.filter((p)=>!c.has(p)).join(`
29
- `));return y.push(m),y.join(`
30
- `)}import k from"fs";import I from"path";function Do(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function Mo(t,n){let e=I.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function Lo(t){let n=I.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}function _(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function Q(t){let n=t.headers.get("content-type")||"",e={},r=(i,s)=>{let a=e[i];if(a===void 0)e[i]=s;else if(Array.isArray(a))a.push(s);else e[i]=[a,s]};if(n.includes("multipart/form-data")){let i=await t.formData();for(let[s,a]of i.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[i,s]of new URLSearchParams(await t.text()).entries())r(i,s);return e}return e}function Kr(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function F(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Kr(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let i={};try{i=await Q(e)}catch{}let s=await t.action({request:e,form:i,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,o=tt(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...o.length>0?{cookies:o}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),o.length>0)return{ran:!0,cookies:o}}return{ran:!0}}function tt(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(_(e,r));continue}if(r&&typeof r==="object"){let i=r;if(typeof i.value!=="string")continue;n.push(_(e,i.value,i))}}return n}function jo(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let i of n)r.append("Set-Cookie",i);for(let[i,s]of Object.entries(e??{}))if(i.toLowerCase()!=="location")r.set(i,s);return new Response(null,{status:303,headers:r})}async function Jt(t,n={}){let{html:e,context:r,redirect:i,cookies:s}=await et(t,n),a=Ze(r),o=Qe(r);if(i)return{html:e,redirect:i,cookies:s,status:a,headers:o};let{extractStreamBoundaries:c}=await import("./chunk-t00y30w3.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-1vrqmdfe.js"),{defaultConfig:m}=await import("./chunk-39beqd1g.js"),S=r.streamBoundaries||{},b={...m,autoShell:!1},w=Object.keys(l).map((p)=>({id:p,render:async()=>{let R=typeof S[p]==="function"?await S[p]():void 0;return g(l[p],{...r,$boundary:R},t.sourceFile,b,new Set)}})),y=new Set(w.map((p)=>p.id));f=[...(f||[]).filter((p)=>!y.has(p.id)),...w]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:s,status:a,headers:o}}async function et(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!Ss(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(a,e,t.sourceFile)}catch(o){if(n.__stx_strict_hydration)throw o;console.warn(`[stx] Server script error in ${t.sourceFile}:`,o)}let r=await F(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),i=(a)=>{let o=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=mr(e);if(!c)return o;let f=o.indexOf("</head>");return f<0?c+o:o.slice(0,f)+c+o.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Ss(t.html))return{html:i(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,o]of Object.entries(t.placeholders))if(o.expression)try{let c=x(o.expression,e);if(o.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?Lt(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:i(bi(t.html,s)),context:e,cookies:r.cookies}}
31
- export{Po,He,Io,ce,T,Oo,Gr,Zn,ke,No,le,Do,Mo,Lo,Kr,jo,Jt};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{sr,ds,mc,hc,yc}from"./chunk-3cqxtkqv.js";import"./chunk-kvn23sz5.js";export{hc as generateManifestLink,sr as generatePwaTags,mc as generateSwRegistrationScript,yc as generateThemeColorMeta,ds as injectPwaTags};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import a from"fs";function Ue(r){return o(r)}var g=1000,i=new Map;function ln(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
3
- `)}function _t(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function K(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
4
- export{Ue,ln,_t,K};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Aa,Il}from"./chunk-jtvcxbwd.js";export{Aa as captureScreenshot,Il as captureScreenshots};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Wl}from"./chunk-4g8zase6.js";import"./chunk-srmm69d4.js";import"./chunk-2etamr31.js";import"./chunk-gvr10eqb.js";import"./chunk-apeyn69a.js";import"./chunk-fb17t651.js";import"./chunk-a0ygyftk.js";import"./chunk-cf6d5kgb.js";import"./chunk-d67qvrzc.js";import"./chunk-zx7v6a4g.js";import"./chunk-ahyq08mp.js";import"./chunk-r2seygb5.js";import"./chunk-qa625vwc.js";import"./chunk-pvfx0dgz.js";export{Wl as buildApp};