@stacksjs/stx 0.2.412 → 0.2.414

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 (350) hide show
  1. package/dist/appearance-bootstrap.js +1 -1
  2. package/dist/binding-manifest.d.ts +1 -1
  3. package/dist/builtins/image-delivery.d.ts +38 -0
  4. package/dist/builtins/image-delivery.js +17 -0
  5. package/dist/builtins/stx-image.js +1 -5
  6. package/dist/bundle-analyzer.js +20 -20
  7. package/dist/chunk-020xyn9q.js +3 -0
  8. package/dist/chunk-04jhmfbz.js +2 -0
  9. package/dist/chunk-10957mcb.js +2 -0
  10. package/dist/chunk-1098mas0.js +2 -0
  11. package/dist/chunk-169n1vpx.js +12 -0
  12. package/dist/chunk-1b6t12hd.js +2 -0
  13. package/dist/chunk-1chw8xsw.js +2 -0
  14. package/dist/chunk-1xdzcy9d.js +14 -0
  15. package/dist/chunk-2ce7f416.js +2 -0
  16. package/dist/chunk-2gr351s0.js +7 -0
  17. package/dist/chunk-2mkcjw08.js +2 -0
  18. package/dist/chunk-2v8wztd5.js +2 -0
  19. package/dist/chunk-340a824p.js +2 -0
  20. package/dist/chunk-39g1134q.js +2 -0
  21. package/dist/chunk-3c74vag1.js +2 -0
  22. package/dist/chunk-3kthfs03.js +3 -0
  23. package/dist/chunk-3qn1wcdg.js +2 -0
  24. package/dist/chunk-3s2vnqcf.js +2 -0
  25. package/dist/chunk-48bwk47q.js +2 -0
  26. package/dist/chunk-4bjravgk.js +2 -0
  27. package/dist/chunk-4jjme6a5.js +2 -0
  28. package/dist/chunk-5g3y8kym.js +2 -0
  29. package/dist/chunk-5gsxpaqk.js +2 -0
  30. package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
  31. package/dist/chunk-69mc2np8.js +2785 -0
  32. package/dist/chunk-6cfa3g0r.js +2 -0
  33. package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
  34. package/dist/chunk-6hc5vz20.js +3 -0
  35. package/dist/chunk-6q6g76vg.js +499 -0
  36. package/dist/{chunk-dbc5awz9.js → chunk-6sgswrqw.js} +29 -29
  37. package/dist/chunk-6y8hnymb.js +2 -0
  38. package/dist/chunk-74j18qk0.js +930 -0
  39. package/dist/chunk-752hw7cd.js +4 -0
  40. package/dist/{chunk-t5ja7qkn.js → chunk-765e1s44.js} +11 -76
  41. package/dist/chunk-7gkv67ky.js +4 -0
  42. package/dist/chunk-7z2ra0yf.js +2 -0
  43. package/dist/chunk-866n724v.js +2 -0
  44. package/dist/chunk-8nhshfz6.js +5 -0
  45. package/dist/chunk-92ps1xpk.js +2 -0
  46. package/dist/chunk-9g27ybyr.js +3 -0
  47. package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
  48. package/dist/{chunk-qvnbnsv9.js → chunk-9vrja6vp.js} +4 -4
  49. package/dist/chunk-9xrbve19.js +2 -0
  50. package/dist/chunk-a688m6js.js +3 -0
  51. package/dist/chunk-afhxw2t8.js +2 -0
  52. package/dist/chunk-ak1cgcah.js +5 -0
  53. package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
  54. package/dist/chunk-apg16xcn.js +2 -0
  55. package/dist/chunk-b52s5z0c.js +2 -0
  56. package/dist/chunk-b84h16er.js +61 -0
  57. package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
  58. package/dist/chunk-bmt7w2pk.js +2 -0
  59. package/dist/chunk-btmhj5t7.js +2 -0
  60. package/dist/chunk-ce1sejr3.js +3 -0
  61. package/dist/chunk-cg8hg6cs.js +3 -0
  62. package/dist/{chunk-8wp64mym.js → chunk-czxt605c.js} +4 -5
  63. package/dist/chunk-d44b9ktb.js +4 -0
  64. package/dist/chunk-daz5aqcf.js +24 -0
  65. package/dist/chunk-dgdm3hy3.js +2 -0
  66. package/dist/chunk-dvgv8nry.js +11 -0
  67. package/dist/chunk-dx7n22ed.js +2 -0
  68. package/dist/chunk-e57rhf65.js +3 -0
  69. package/dist/chunk-eed4fwps.js +3 -0
  70. package/dist/chunk-ej9j6k1q.js +3 -0
  71. package/dist/chunk-et0rr8c7.js +3 -0
  72. package/dist/chunk-f46qsp4m.js +4 -0
  73. package/dist/chunk-f6az0xj5.js +2 -0
  74. package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
  75. package/dist/chunk-fjs0a8h7.js +2 -0
  76. package/dist/chunk-fr2txj8q.js +829 -0
  77. package/dist/{chunk-vx86cf4r.js → chunk-ft4p6d28.js} +14 -14
  78. package/dist/chunk-fyzajkrx.js +2 -0
  79. package/dist/chunk-fzapbw9p.js +3 -0
  80. package/dist/chunk-g578mcb0.js +194 -0
  81. package/dist/chunk-gawrg4gb.js +216 -0
  82. package/dist/chunk-gw07qmjk.js +2 -0
  83. package/dist/chunk-h0atqq82.js +32 -0
  84. package/dist/chunk-h6zsqb9r.js +3 -0
  85. package/dist/{chunk-hdysywd8.js → chunk-h85hrwkq.js} +13 -13
  86. package/dist/chunk-hbxz85wy.js +2 -0
  87. package/dist/chunk-hjg3ndgh.js +2 -0
  88. package/dist/chunk-hkxsewzk.js +2 -0
  89. package/dist/chunk-hrbbbtbn.js +2 -0
  90. package/dist/chunk-j03revz2.js +8 -0
  91. package/dist/chunk-j9qcrwbg.js +2 -0
  92. package/dist/chunk-jk4njz0w.js +2 -0
  93. package/dist/chunk-jmabeqfq.js +2 -0
  94. package/dist/chunk-jt0n43mk.js +2 -0
  95. package/dist/chunk-kjbv8a3m.js +2 -0
  96. package/dist/chunk-m1vdghnx.js +2 -0
  97. package/dist/chunk-m4sk62wb.js +5 -0
  98. package/dist/chunk-md8rqn48.js +30 -0
  99. package/dist/chunk-mepdnezf.js +17 -0
  100. package/dist/chunk-mhq0pjws.js +2 -0
  101. package/dist/chunk-mp6hy8g4.js +2 -0
  102. package/dist/chunk-ngc2wke4.js +3 -0
  103. package/dist/chunk-nn2vstke.js +2 -0
  104. package/dist/chunk-p2v2a68k.js +2 -0
  105. package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
  106. package/dist/chunk-pdt69hpb.js +2 -0
  107. package/dist/chunk-pgzvyrv6.js +29 -0
  108. package/dist/chunk-pj1wg7jg.js +2 -0
  109. package/dist/chunk-pqxzp1bb.js +3 -0
  110. package/dist/chunk-px7fvbj6.js +3 -0
  111. package/dist/chunk-q4c06e8x.js +20 -0
  112. package/dist/chunk-q6vrb2pe.js +2 -0
  113. package/dist/chunk-q7qchkvk.js +2 -0
  114. package/dist/chunk-q9bdh4s5.js +8 -0
  115. package/dist/chunk-qet5gc6s.js +2033 -0
  116. package/dist/chunk-qz519eyp.js +2 -0
  117. package/dist/chunk-r3f9jcf7.js +5 -0
  118. package/dist/chunk-rs4v4fha.js +4 -0
  119. package/dist/chunk-s2x4wcrz.js +2 -0
  120. package/dist/chunk-s5xezjps.js +3 -0
  121. package/dist/chunk-scezfp0w.js +30 -0
  122. package/dist/chunk-sd321bn3.js +2 -0
  123. package/dist/{chunk-eenk6s3t.js → chunk-sd47dzs0.js} +79 -79
  124. package/dist/chunk-se7mwqd1.js +2 -0
  125. package/dist/chunk-shr559s7.js +3 -0
  126. package/dist/chunk-syaw6b75.js +2 -0
  127. package/dist/chunk-t4hzprsm.js +3 -0
  128. package/dist/{chunk-s9za1vvd.js → chunk-t61vdbje.js} +89 -89
  129. package/dist/chunk-tfexmdkt.js +3 -0
  130. package/dist/chunk-thyt8ed8.js +6 -0
  131. package/dist/chunk-v091jft4.js +12 -0
  132. package/dist/chunk-v4vaqxrf.js +33 -0
  133. package/dist/chunk-vgvtnwxa.js +4 -0
  134. package/dist/chunk-x0q32ees.js +3 -0
  135. package/dist/chunk-x5bpeb4a.js +2 -0
  136. package/dist/chunk-x72tv2cg.js +3 -0
  137. package/dist/chunk-xfp7k0v8.js +64 -0
  138. package/dist/chunk-xtdw3692.js +6 -0
  139. package/dist/chunk-y1cmjvk3.js +43 -0
  140. package/dist/chunk-y5310237.js +311 -0
  141. package/dist/chunk-ya0qecph.js +27 -0
  142. package/dist/chunk-yazk54jr.js +8 -0
  143. package/dist/chunk-ydjfar14.js +2 -0
  144. package/dist/chunk-ym95v4nc.js +3 -0
  145. package/dist/chunk-ynvdvbat.js +18 -0
  146. package/dist/chunk-yvx1ap9b.js +3 -0
  147. package/dist/chunk-z0g9jvv0.js +40 -0
  148. package/dist/chunk-z6d0jmjb.js +2 -0
  149. package/dist/{chunk-fpwzacpm.js → chunk-zhxdpzga.js} +4 -4
  150. package/dist/cli.js +110 -110
  151. package/dist/craft-entry.js +7 -7
  152. package/dist/craft.js +7 -7
  153. package/dist/database.js +2 -2
  154. package/dist/image-optimization/component.js +4 -4
  155. package/dist/index.d.ts +2 -0
  156. package/dist/index.js +1 -0
  157. package/dist/media/image/component.js +5 -5
  158. package/dist/media/protected/component.js +2 -2
  159. package/dist/media/video/index.js +4 -4
  160. package/dist/native/bridge/protocol.d.ts +325 -0
  161. package/dist/native/bridge/protocol.js +219 -0
  162. package/dist/native/cli.d.ts +24 -0
  163. package/dist/native/cli.js +52 -0
  164. package/dist/native/compiler/bundle.d.ts +41 -0
  165. package/dist/native/compiler/bundle.js +90 -0
  166. package/dist/native/compiler/client-script.d.ts +8 -0
  167. package/dist/native/compiler/client-script.js +31 -0
  168. package/dist/native/compiler/codegen.d.ts +10 -0
  169. package/dist/native/compiler/codegen.js +145 -0
  170. package/dist/native/compiler/headwind-to-style.d.ts +395 -0
  171. package/dist/native/compiler/headwind-to-style.js +1163 -0
  172. package/dist/native/compiler/html-to-ir.d.ts +41 -0
  173. package/dist/native/compiler/html-to-ir.js +411 -0
  174. package/dist/native/compiler/icons.d.ts +220 -0
  175. package/dist/native/compiler/icons.js +208 -0
  176. package/dist/native/compiler/ir.d.ts +234 -0
  177. package/dist/native/compiler/ir.js +15 -0
  178. package/dist/native/compiler/parser.d.ts +88 -0
  179. package/dist/native/compiler/parser.js +753 -0
  180. package/dist/native/compiler/render-screen.d.ts +26 -0
  181. package/dist/native/compiler/render-screen.js +31 -0
  182. package/dist/native/components/primitives.d.ts +291 -0
  183. package/dist/native/components/primitives.js +22 -0
  184. package/dist/native/hot-reload/client.d.ts +62 -0
  185. package/dist/native/hot-reload/client.js +324 -0
  186. package/dist/native/index.d.ts +90 -0
  187. package/dist/native/index.js +34 -0
  188. package/dist/native/primitives/ActivityIndicator.stx +5 -0
  189. package/dist/native/primitives/Button.stx +5 -0
  190. package/dist/native/primitives/DatePicker.stx +5 -0
  191. package/dist/native/primitives/FlatList.stx +5 -0
  192. package/dist/native/primitives/Image.stx +5 -0
  193. package/dist/native/primitives/ImageBackground.stx +5 -0
  194. package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
  195. package/dist/native/primitives/Modal.stx +5 -0
  196. package/dist/native/primitives/Picker.stx +5 -0
  197. package/dist/native/primitives/Pressable.stx +5 -0
  198. package/dist/native/primitives/RefreshControl.stx +5 -0
  199. package/dist/native/primitives/SafeAreaView.stx +5 -0
  200. package/dist/native/primitives/ScrollView.stx +5 -0
  201. package/dist/native/primitives/SectionList.stx +5 -0
  202. package/dist/native/primitives/Slider.stx +5 -0
  203. package/dist/native/primitives/StatusBar.stx +5 -0
  204. package/dist/native/primitives/Switch.stx +5 -0
  205. package/dist/native/primitives/Text.stx +5 -0
  206. package/dist/native/primitives/TextInput.stx +5 -0
  207. package/dist/native/primitives/TouchableHighlight.stx +5 -0
  208. package/dist/native/primitives/TouchableOpacity.stx +5 -0
  209. package/dist/native/primitives/View.stx +5 -0
  210. package/dist/native/runtime/craft.d.ts +75 -0
  211. package/dist/native/runtime/craft.js +0 -0
  212. package/dist/native/runtime/entry.d.ts +1 -0
  213. package/dist/native/runtime/entry.js +3 -0
  214. package/dist/native/runtime/index.d.ts +45 -0
  215. package/dist/native/runtime/index.js +165 -0
  216. package/dist/native/runtime/native-host.d.ts +33 -0
  217. package/dist/native/runtime/native-host.js +184 -0
  218. package/dist/native/runtime/screen.d.ts +43 -0
  219. package/dist/native/runtime/screen.js +808 -0
  220. package/dist/pwa/service-worker.js +1 -1
  221. package/dist/pwa/workbox.js +1 -1
  222. package/dist/pwa.js +8 -8
  223. package/dist/site-url.d.ts +1 -1
  224. package/dist/ssg.js +53 -53
  225. package/dist/visual-testing.js +42 -42
  226. package/dist/web-components/reactive-generator.js +2 -2
  227. package/package.json +9 -5
  228. package/dist/chunk-00g9x6w2.js +0 -2
  229. package/dist/chunk-04tgatyy.js +0 -2
  230. package/dist/chunk-097jnwd5.js +0 -2
  231. package/dist/chunk-0btmm4m2.js +0 -147
  232. package/dist/chunk-0c2h69k2.js +0 -4
  233. package/dist/chunk-0pkk226n.js +0 -2
  234. package/dist/chunk-0we9nw1d.js +0 -3
  235. package/dist/chunk-0y46fbkx.js +0 -3
  236. package/dist/chunk-18n1ftn0.js +0 -33
  237. package/dist/chunk-1a0v39k5.js +0 -3
  238. package/dist/chunk-1fs9jvpb.js +0 -2
  239. package/dist/chunk-1qq26zt0.js +0 -2
  240. package/dist/chunk-1te8k8gp.js +0 -3
  241. package/dist/chunk-1ws3xcea.js +0 -1199
  242. package/dist/chunk-213jwgpx.js +0 -3
  243. package/dist/chunk-24w86pek.js +0 -32
  244. package/dist/chunk-27fgag95.js +0 -4
  245. package/dist/chunk-2fw05hs2.js +0 -3
  246. package/dist/chunk-2tbez006.js +0 -2
  247. package/dist/chunk-38wvkv3s.js +0 -2
  248. package/dist/chunk-3rkejwjp.js +0 -2
  249. package/dist/chunk-3t65wb35.js +0 -2
  250. package/dist/chunk-3w6z6tw9.js +0 -2
  251. package/dist/chunk-4q1c6fw2.js +0 -7
  252. package/dist/chunk-50pszj17.js +0 -2
  253. package/dist/chunk-563shnkz.js +0 -3
  254. package/dist/chunk-5h104qh1.js +0 -2
  255. package/dist/chunk-5qjk7drw.js +0 -20
  256. package/dist/chunk-603x5gb2.js +0 -2
  257. package/dist/chunk-6kd5jjwc.js +0 -2
  258. package/dist/chunk-6kdrncsx.js +0 -30
  259. package/dist/chunk-6zggmce7.js +0 -4422
  260. package/dist/chunk-72rwcbp6.js +0 -3
  261. package/dist/chunk-76w34xne.js +0 -3
  262. package/dist/chunk-7dmgt8at.js +0 -2
  263. package/dist/chunk-82pd4b5w.js +0 -2
  264. package/dist/chunk-8d7nf67s.js +0 -2
  265. package/dist/chunk-8w2mqdnv.js +0 -2
  266. package/dist/chunk-90b2vt2n.js +0 -2
  267. package/dist/chunk-9e8t0twa.js +0 -3
  268. package/dist/chunk-9fqp72ze.js +0 -5
  269. package/dist/chunk-9xew0kgf.js +0 -2
  270. package/dist/chunk-a7bnvz91.js +0 -24
  271. package/dist/chunk-akwd34xt.js +0 -29
  272. package/dist/chunk-anydpa34.js +0 -3
  273. package/dist/chunk-aq1xq0r4.js +0 -16
  274. package/dist/chunk-bbt3tp6f.js +0 -499
  275. package/dist/chunk-bn1edb1y.js +0 -47
  276. package/dist/chunk-btd7ds3x.js +0 -2
  277. package/dist/chunk-c4511wng.js +0 -2
  278. package/dist/chunk-c4h579e3.js +0 -2
  279. package/dist/chunk-cj3adc77.js +0 -5
  280. package/dist/chunk-cs54ek9m.js +0 -6
  281. package/dist/chunk-ct1jwd4r.js +0 -2
  282. package/dist/chunk-cxrgxzxc.js +0 -2
  283. package/dist/chunk-de8t7sc9.js +0 -17
  284. package/dist/chunk-fcnrgxck.js +0 -2
  285. package/dist/chunk-fqzcft9d.js +0 -2
  286. package/dist/chunk-gbmeh7jg.js +0 -3
  287. package/dist/chunk-gc06g35w.js +0 -2
  288. package/dist/chunk-gs18069g.js +0 -194
  289. package/dist/chunk-gvbf1mhs.js +0 -930
  290. package/dist/chunk-h564hgzt.js +0 -2
  291. package/dist/chunk-h83jrhfq.js +0 -3
  292. package/dist/chunk-hj4vpyhp.js +0 -2
  293. package/dist/chunk-hrkvsj5c.js +0 -11
  294. package/dist/chunk-hyr4ag1k.js +0 -2
  295. package/dist/chunk-jxvmf02k.js +0 -2
  296. package/dist/chunk-k5ptvy0b.js +0 -4
  297. package/dist/chunk-k80sn8d1.js +0 -2
  298. package/dist/chunk-k8t2cmyd.js +0 -2
  299. package/dist/chunk-kmsyvaex.js +0 -8
  300. package/dist/chunk-kq4b6cwj.js +0 -2
  301. package/dist/chunk-kvmx7dnb.js +0 -2
  302. package/dist/chunk-kxc2h5vn.js +0 -5
  303. package/dist/chunk-mbxehgrq.js +0 -2
  304. package/dist/chunk-mgnq5de2.js +0 -2
  305. package/dist/chunk-mgrckqww.js +0 -2
  306. package/dist/chunk-mq5ewmz6.js +0 -2
  307. package/dist/chunk-mrahwn5v.js +0 -8
  308. package/dist/chunk-n2swas11.js +0 -3
  309. package/dist/chunk-n4299xgy.js +0 -2
  310. package/dist/chunk-naw4jt7j.js +0 -2
  311. package/dist/chunk-ny67c03k.js +0 -3
  312. package/dist/chunk-p4jb9v0w.js +0 -2
  313. package/dist/chunk-p4zrvt5f.js +0 -14
  314. package/dist/chunk-p5wp0ce6.js +0 -43
  315. package/dist/chunk-pcxp4r9n.js +0 -3
  316. package/dist/chunk-pjrn29gg.js +0 -2
  317. package/dist/chunk-prxwsp7n.js +0 -2
  318. package/dist/chunk-py2r6wtv.js +0 -2
  319. package/dist/chunk-q738pwv6.js +0 -2
  320. package/dist/chunk-q9n5swx7.js +0 -3
  321. package/dist/chunk-qmmp5kb5.js +0 -2
  322. package/dist/chunk-qqpqgwvb.js +0 -30
  323. package/dist/chunk-rcv2ehpq.js +0 -18
  324. package/dist/chunk-rq414kn5.js +0 -3
  325. package/dist/chunk-rz9f3zqz.js +0 -7
  326. package/dist/chunk-s6g8wksg.js +0 -2
  327. package/dist/chunk-s8jd13nb.js +0 -3
  328. package/dist/chunk-spxsw4mp.js +0 -2
  329. package/dist/chunk-strcy64y.js +0 -2
  330. package/dist/chunk-t1htzg9e.js +0 -4
  331. package/dist/chunk-t1tdjjht.js +0 -216
  332. package/dist/chunk-tat1cjec.js +0 -2
  333. package/dist/chunk-td08rnk3.js +0 -3
  334. package/dist/chunk-tgadbsd4.js +0 -2
  335. package/dist/chunk-tgrpp58r.js +0 -2
  336. package/dist/chunk-tkyrk66a.js +0 -3
  337. package/dist/chunk-tp8pzf94.js +0 -3
  338. package/dist/chunk-twz64kvy.js +0 -2
  339. package/dist/chunk-v3nwkveg.js +0 -12
  340. package/dist/chunk-vsbmc9kt.js +0 -2
  341. package/dist/chunk-vzgzaw66.js +0 -12
  342. package/dist/chunk-wc66mcn4.js +0 -4367
  343. package/dist/chunk-wkanrfb3.js +0 -2
  344. package/dist/chunk-x8f6wqxd.js +0 -2
  345. package/dist/chunk-xsng1mtq.js +0 -3
  346. package/dist/chunk-xwts5yky.js +0 -4
  347. package/dist/chunk-z5rwnnk1.js +0 -3
  348. package/dist/chunk-zcz9rs6p.js +0 -3
  349. package/dist/chunk-zpcnbdhn.js +0 -64
  350. package/dist/chunk-zq4ssxj9.js +0 -8
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{pi as a}from"./chunk-bwsxym3d.js";import"./chunk-2fw05hs2.js";export{a as processDeferDirectives};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Al as c,Bl as d,Cl as e,Dl as f,El as g,yl as a,zl as b}from"./chunk-cs54ek9m.js";import"./chunk-9fqp72ze.js";import"./chunk-tkyrk66a.js";import"./chunk-1te8k8gp.js";import"./chunk-8wp64mym.js";import"./chunk-2fw05hs2.js";export{e as productionApiDispatcher,g as isServerApiSource,b as generateApiTypes,a as discoverServerApi,f as createServerApi,d as createApiDispatcher,c as buildServerApi};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Broadcast as D,BroadcastServer as U}from"ts-broadcasting";import{channel as b}from"ts-broadcasting";import{Broadcast as N,BroadcastServer as p}from"ts-broadcasting";var z=null,H=[];function X(){return z}async function Y(j){if(z)return z;let k=j.driver??"bun",q=j.host??"0.0.0.0",G=j.port??6001,J=j.scheme??"ws",E={verbose:j.verbose??!1,driver:k,default:k,connections:{[k]:{driver:k,host:q,port:G,scheme:J}}};return z=new U(E),D.setServer(z),await z.start(),z}async function Z(){for(let j of H)clearInterval(j);if(H.length=0,!z)return;await z.stop(),z=null}async function $(j){let k=await import(j),q=k.default??k;if(typeof q!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof q}`);let G=0;return q({channel(E,A){if(G++,A.authorize&&z)z.channels.channel(E,A.authorize);if(A.interval&&A.data){let L=A.event??`${E}.updated`,M=A.data,Q=setInterval(async()=>{try{let T=await M();V(E,L,T)}catch{}},A.interval);H.push(Q)}}}),G}var K=!1;function F(){if(z)return!0;if(!K)K=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function V(j,k,q){if(!F())return;D.send(j,k,q)}function x(j,k,q){if(!F())return;D.toUser(j,k,q)}function C(j,k,q){if(!F())return;D.toUsers(j,k,q)}function S(j,k,q){if(!F())return;D.send(`private-${j}`,k,q)}function w(j,k,q){if(!F())return;D.presence(j,k,q)}
3
- export{X as Gg,Y as Hg,Z as Ig,$ as Jg,V as Kg,x as Lg,C as Mg,S as Ng,w as Og,b as Pg,N as Qg,p as Rg};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import{ix as H}from"./chunk-2fw05hs2.js";import P from"path";var $=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function G(...w){let v=new Set;for(let q of w){if(!q||!q.includes("__stxModules["))continue;for(let z of q.matchAll($))try{v.add(JSON.parse(`"${z[1]}"`))}catch{}}return[...v].sort()}async function T(w,v={}){if(w.length===0)return null;let q=process.cwd(),z=[],J=[];w.forEach((j,X)=>{let Z=j.startsWith("npm:")?j.slice(4):P.resolve(q,j),N=`__stxRegistered${X}`,O=JSON.stringify(j);z.push(`import * as ${N} from ${JSON.stringify(Z)};`),J.push(`if (!globalThis.__stxModules[${O}]) globalThis.__stxModules[${O}] = ${N};`)});let L=[...z,"globalThis.__stxModules = globalThis.__stxModules || {};",...J].join(`
3
- `),B;try{let{bundleClientScript:j}=await import("./chunk-k8t2cmyd.js");B=await j(L,P.join(q,".stx-module-registry.ts"),{projectRoot:q,minify:v.minify,externalizeUserModules:!1,collectInputs:v.collectInputs})}catch(j){return console.warn("[stx] could not build the page module registry (#1957):",j),null}let{transformAutoImports:Q,generateAutoImportDestructuring:U}=await import("./chunk-prxwsp7n.js"),F=Q(B),V=U(F.stxImports,F.browserImports),{transformStoreImports:W}=await import("./chunk-q738pwv6.js");B=W(F.code);let M=JSON.stringify(new Bun.CryptoHasher("md5").update(L).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${M}]) return;`,` __stxBundles[${M}] = true;`,V,B,"})();"].join(`
4
- `)}export{G as registeredModuleIdsIn,T as buildModuleRegistryScript};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{ix as l}from"./chunk-2fw05hs2.js";import U from"fs";import G from"path";import I from"os";import H from"crypto";import{generatePlaceholder as m,processImage as g}from"ts-images";var d=[320,640,768,1024,1280,1536,1920],h=["webp","jpeg"],b=80,u=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],P={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},N=null,W=!1;async function Y(){if(W)return N;W=!0;try{let J=await import("sharp");return N=J.default||J,N}catch{return null}}async function e(){return await Y()!==null}async function t(){return!0}async function JJ(J,K={}){let{widths:Z=d,formats:$=h,quality:q=b,fit:C="cover",placeholder:X="none",outputDir:Q=".stx/images",baseUrl:_="/images"}=K,j,x;if(typeof J==="string"){if(x=J,!await Bun.file(J).exists())throw new L(`Image not found: ${J}`,"NOT_FOUND");j=await Bun.file(J).arrayBuffer().then((V)=>Buffer.from(V))}else x="buffer-input",j=J;let w=H.createHash("sha256").update(j).digest("hex").slice(0,12),y=await O(j),{width:B,height:D}=y,A=B/D;await U.promises.mkdir(Q,{recursive:!0});let T=[],v=G.basename(x,G.extname(x)),z=Z.filter((V)=>V<=B);if(!z.includes(B)&&B<=Math.max(...Z))z.push(B);z.sort((V,R)=>V-R);for(let V of z){let R=Math.round(V/A);for(let F of $){let S=`${v}-${V}w-${w}.${F}`,k=G.join(Q,S),c=`${_}/${S}`,E=await n(j,{width:V,height:R,format:F,quality:q,fit:C});await Bun.write(k,E),T.push({path:k,url:c,width:V,height:R,format:F,size:E.length})}}let M;if(X!=="none")M=await o(j,X);return{src:x,variants:T,placeholder:M,width:B,height:D,aspectRatio:A,hash:w}}async function O(J){let K=typeof J==="string"?Buffer.from(await Bun.file(J).arrayBuffer()):J,Z=await Y();if(Z){let q=await Z(K).metadata();return{width:q.width||0,height:q.height||0,format:q.format||"unknown",hasAlpha:q.hasAlpha}}return p(K)}function p(J){if(J[0]===137&&J[1]===80&&J[2]===78&&J[3]===71){let K=J.readUInt32BE(16),Z=J.readUInt32BE(20);return{width:K,height:Z,format:"png",hasAlpha:!0}}if(J[0]===255&&J[1]===216){let K=2;while(K<J.length){if(J[K]!==255)break;let Z=J[K+1];if(Z>=192&&Z<=207&&Z!==196&&Z!==200&&Z!==204){let q=J.readUInt16BE(K+5);return{width:J.readUInt16BE(K+7),height:q,format:"jpeg",hasAlpha:!1}}let $=J.readUInt16BE(K+2);K+=2+$}}if(J.toString("utf8",0,4)==="RIFF"&&J.toString("utf8",8,12)==="WEBP"){let K=J.toString("utf8",12,16);if(K==="VP8 "){let Z=J.readUInt16LE(26)&16383,$=J.readUInt16LE(28)&16383;return{width:Z,height:$,format:"webp",hasAlpha:!1}}if(K==="VP8L"){let Z=J.readUInt32LE(21),$=(Z&16383)+1,q=(Z>>14&16383)+1;return{width:$,height:q,format:"webp",hasAlpha:!0}}}if(J.toString("utf8",0,3)==="GIF"){let K=J.readUInt16LE(6),Z=J.readUInt16LE(8);return{width:K,height:Z,format:"gif",hasAlpha:!0}}throw new L("Unable to parse image dimensions","PARSE_ERROR")}async function n(J,K){let Z=await Y();if(Z){let q=Z(J).resize(K.width,K.height,{fit:K.fit});switch(K.format){case"webp":q=q.webp({quality:K.quality});break;case"avif":q=q.avif({quality:K.quality});break;case"jpeg":q=q.jpeg({quality:K.quality});break;case"png":q=q.png({quality:K.quality});break}return q.toBuffer()}let $=G.join(I.tmpdir(),`stx-img-${H.randomBytes(8).toString("hex")}.${K.format}`);try{return await g({input:J,output:$,format:K.format,quality:K.quality,resize:{width:K.width,height:K.height,fit:K.fit}}),Buffer.from(await Bun.file($).arrayBuffer())}finally{await U.promises.unlink($).catch(()=>{})}}async function o(J,K){let Z=await Y();if(K==="blur"&&Z){let X=(await Z(J).resize(20).blur(10).toBuffer()).toString("base64"),Q=await O(J);return`data:${P[Q.format]||"image/jpeg"};base64,${X}`}if(K==="dominant-color"&&Z){let{dominant:C}=await Z(J).resize(1,1).toBuffer().then(async(X)=>{let Q=await Z(X).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${C.r}, ${C.g}, ${C.b})`}let $=await O(J),q=G.join(I.tmpdir(),`stx-ph-${H.randomBytes(8).toString("hex")}.${$.format==="unknown"?"bin":$.format}`);try{await Bun.write(q,J);let C=K==="blur"?"blur":K==="thumbhash"?"thumbhash":"dominant-color",Q=await m(q,{strategy:C,width:C==="thumbhash"?void 0:32});if(K==="dominant-color"&&Q.dominantColor)return Q.dominantColor;if(Q.dataURL)return Q.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await U.promises.unlink(q).catch(()=>{})}}function KJ(J,K){return(K?J.filter(($)=>$.format===K):J).sort(($,q)=>$.width-q.width).map(($)=>`${$.url} ${$.width}w`).join(", ")}function ZJ(J){if(!J||Object.keys(J).length===0)return"100vw";return Object.entries(J).sort((Z,$)=>{let q=Number.parseInt(Z[0].replace(/\D/g,""))||0;return(Number.parseInt($[0].replace(/\D/g,""))||0)-q}).map(([Z,$])=>`(max-width: ${Z}) ${$}`).join(", ")+", 100vw"}function $J(J){let K=J.filter(($)=>$.format==="jpeg");if(K.length===0)return J[Math.floor(J.length/2)];let Z=K.sort(($,q)=>$.width-q.width);return Z[Math.floor(Z.length/2)]}function qJ(J){let K=new Map;for(let Z of J){let $=K.get(Z.format)||[];$.push(Z),K.set(Z.format,$)}return K}function CJ(J){let K=G.extname(J).toLowerCase();return u.includes(K)}function QJ(J){return P[J]||"application/octet-stream"}function VJ(J){return J.reduce((K,Z)=>K+Z.size,0)}function XJ(J){if(J<1024)return`${J} B`;if(J<1048576)return`${(J/1024).toFixed(1)} KB`;return`${(J/1048576).toFixed(2)} MB`}class L extends Error{code;constructor(J,K){super(J);this.name="ImageProcessingError",this.code=K}}
3
- export{d as Hf,h as If,b as Jf,e as Kf,t as Lf,JJ as Mf,O as Nf,n as Of,KJ as Pf,ZJ as Qf,$J as Rf,qJ as Sf,CJ as Tf,QJ as Uf,VJ as Vf,XJ as Wf,L as Xf};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{existsSync as U,statSync as V}from"fs";import z from"path";var W=/[*?[\]{}]/;function X(D){return W.test(D)}async function $(D,E={}){let H=E.cwd??process.cwd(),N=E.recursive!==!1,Q=E.ignorePaths??[],J=globalThis.Bun.Glob,K=new Set,F=(j)=>{if(j.includes(`${z.sep}node_modules${z.sep}`)||j.includes(`${z.sep}dist${z.sep}`))return;if(Q.some((q)=>q&&j.includes(z.normalize(q))))return;K.add(j)},R=async(j)=>{try{for await(let q of new J(j).scan({cwd:H,absolute:!0}))F(q)}catch{}};for(let j of D){if(!j)continue;if(X(j)){await R(j);continue}let q=z.resolve(H,j);if(!U(q))continue;if(V(q).isDirectory()){for await(let T of new J(N?"**/*.stx":"*.stx").scan({cwd:q,absolute:!0}))F(T);continue}F(q)}return[...K].sort()}
3
- export{X as Es,$ as Fs};
@@ -1,64 +0,0 @@
1
- // @bun
2
- import{Au as K,Bu as S,Cu as C,Hu as T,vu as _,wu as H,xu as A,yu as X,zu as U}from"./chunk-rz9f3zqz.js";import{Zu as I,kv as L}from"./chunk-bn1edb1y.js";var h=/(?<![\w$@])@meta\s*\(/g,u=/(?<![\w$@])@metaTag\s*\(/g,f=/(?<![\w$@])@structuredData\s*\(/g,p=/(?<![\w$@])@seo\s*\(/g;function b(z,J){return(Q)=>K(z,Q,"the call has no closing parenthesis",J,I.INVALID_DIRECTIVE_SYNTAX)}function g(z){return"property"in z?`<meta property="${B(z.property)}" content="${B(z.content)}">`:`<meta name="${B(z.name)}" content="${B(z.content)}">`}function Qz(z,J,Q,N){if(!z.includes("@meta"))return z;let W=_(z,h,(Z,G)=>{let $=C(H(Z),J);if($.kind==="tag")return g($.tag);if($.kind==="empty")return"";return K("Meta",G,$.message,Q,$.code)},b("Meta",Q));return W=_(W,u,(Z,G)=>{let $=A(Z,J);if(!$.ok)return K("MetaTag",G,$.message,Q,$.code);if($.value===void 0||$.value===null)return"";if(!U($.value))return K("MetaTag",G,`expected an object such as { name, content }, got ${X($.value)}`,Q,I.TYPE_ERROR);let q=$.value;if(!q.name&&!q.property&&!q.httpEquiv)return K("MetaTag",G,"the tag needs a name, property or httpEquiv",Q,I.INVALID_DIRECTIVE_SYNTAX);if(q.content===void 0||q.content===null||q.content===""||q.content===!1)return"";let j="<meta";if(q.name)j+=` name="${B(q.name)}"`;if(q.property)j+=` property="${B(q.property)}"`;if(q.httpEquiv)j+=` http-equiv="${B(q.httpEquiv)}"`;return j+=` content="${B(q.content)}">`,j},b("MetaTag",Q)),W}function v(z){let J=(Q)=>Q["@context"]?{...Q}:{...Q,"@context":"https://schema.org"};if(U(z))return J(z);if(Array.isArray(z)&&z.length>0&&z.every(U))return z.map(J);return null}function E(z){return`<script type="application/ld+json">${JSON.stringify(z).replace(/<\//g,"<\\/")}</script>`}function Wz(z,J,Q){if(!z.includes("@structuredData"))return z;return _(z,f,(N,W)=>{let Z=A(N,J);if(!Z.ok)return K("StructuredData",W,Z.message,Q,Z.code);if(Z.value===void 0||Z.value===null)return"";let G=v(Z.value);if(!G)return K("StructuredData",W,`expected an object or an array of objects, got ${X(Z.value)}`,Q,I.TYPE_ERROR);try{return E(G)}catch($){let q=$ instanceof Error?$.message:String($);return K("StructuredData",W,`the data cannot be written as JSON: ${q}`,Q,I.EVALUATION_ERROR)}},b("StructuredData",Q))}var m=new Set(["title","description","keywords","robots","canonical","openGraph","twitter","structuredData"]),D={image:"openGraph.image",url:"canonical or openGraph.url",type:"openGraph.type",siteName:"openGraph.siteName",locale:"openGraph.locale",og:"openGraph",author:"@meta('author', ...)"};function Zz(z,J,Q,N){if(!z.includes("@seo"))return z;return _(z,p,(W,Z)=>{if(!W.trim())return K("SEO",Z,"expected an object: @seo({ title, description }) or @seo(seoVariable)",Q,I.INVALID_DIRECTIVE_SYNTAX);let G=A(W,J);if(!G.ok)return K("SEO",Z,G.message,Q,G.code);if(G.value===void 0||G.value===null)return"";if(!U(G.value))return K("SEO",Z,`expected an object such as { title, description }, got ${X(G.value)}`,Q,I.TYPE_ERROR);try{return c(G.value,Z,Q)}catch($){let q=$ instanceof Error?$.message:String($);return K("SEO",Z,`Error processing @seo directive: ${q}`,Q,I.EVALUATION_ERROR)}},b("SEO",Q))}function y(z,J,Q,N){let W=z[J];if(W===void 0||W===null||W===!1)return;if(U(W))return W;S(Q,`${J} must be an object, got ${X(W)}; its tags were left out`,N);return}function c(z,J,Q){let N=Object.keys(z).filter(($)=>!m.has($));if(N.length>0){let $=N.map((q)=>D[q]?`${q} (use ${D[q]})`:q).join(", ");S(J,`@seo does not read ${$}; ${N.length===1?"it was":"they were"} ignored`,Q)}let W="";if(z.title)W+=`<title>${B(z.title)}</title>
3
- `,W+=`<meta name="title" content="${B(z.title)}">
4
- `;if(z.description)W+=`<meta name="description" content="${B(z.description)}">
5
- `;if(z.keywords){let $=Array.isArray(z.keywords)?z.keywords.join(", "):z.keywords;W+=`<meta name="keywords" content="${B($)}">
6
- `}if(z.robots)W+=`<meta name="robots" content="${B(z.robots)}">
7
- `;if(z.canonical)W+=`<link rel="canonical" href="${B(z.canonical)}">
8
- `;let Z=y(z,"openGraph",J,Q);if(Z){if(W+=`<meta property="og:type" content="${B(Z.type||"website")}">
9
- `,Z.title||z.title){let $=Z.title||z.title||"";W+=`<meta property="og:title" content="${B($)}">
10
- `}if(Z.description||z.description){let $=Z.description||z.description||"";W+=`<meta property="og:description" content="${B($)}">
11
- `}if(Z.url||z.canonical){let $=Z.url||z.canonical||"";W+=`<meta property="og:url" content="${B($)}">
12
- `}if(Z.image){if(W+=`<meta property="og:image" content="${B(Z.image)}">
13
- `,Z.imageAlt)W+=`<meta property="og:image:alt" content="${B(Z.imageAlt)}">
14
- `;if(Z.imageWidth)W+=`<meta property="og:image:width" content="${B(String(Z.imageWidth))}">
15
- `;if(Z.imageHeight)W+=`<meta property="og:image:height" content="${B(String(Z.imageHeight))}">
16
- `;if(Z.imageType)W+=`<meta property="og:image:type" content="${B(Z.imageType)}">
17
- `}if(Z.siteName)W+=`<meta property="og:site_name" content="${B(Z.siteName)}">
18
- `;if(Z.locale)W+=`<meta property="og:locale" content="${B(Z.locale)}">
19
- `;if(Z.profile){let $=[["first_name",Z.profile.firstName],["last_name",Z.profile.lastName],["username",Z.profile.username],["gender",Z.profile.gender]];for(let[q,j]of $)if(j)W+=`<meta property="profile:${q}" content="${B(j)}">
20
- `}}let G=y(z,"twitter",J,Q);if(G){if(W+=`<meta name="twitter:card" content="${B(G.card||"summary_large_image")}">
21
- `,G.title||z.title){let $=G.title||z.title||"";W+=`<meta name="twitter:title" content="${B($)}">
22
- `}if(G.description||z.description){let $=G.description||z.description||"";W+=`<meta name="twitter:description" content="${B($)}">
23
- `}if(G.image||Z&&Z.image){let $=G.image||(Z?Z.image:"")||"";W+=`<meta name="twitter:image" content="${B($)}">
24
- `;let q=G.imageAlt||(!G.image&&Z?Z.imageAlt:void 0);if(q)W+=`<meta name="twitter:image:alt" content="${B(q)}">
25
- `}if(G.site)W+=`<meta name="twitter:site" content="${B(G.site)}">
26
- `;if(G.creator)W+=`<meta name="twitter:creator" content="${B(G.creator)}">
27
- `}if(z.structuredData!==void 0&&z.structuredData!==null){let $=v(z.structuredData);if($)W+=`${E($)}
28
- `;else S(J,`structuredData must be an object or an array of objects, got ${X(z.structuredData)}; it was left out`,Q)}return W.trim()}function $z(z,J,Q){if(Q.seo?.enabled===!1)return z;if(z.includes("<!-- stx SEO Tags -->")||J.__stx_seo_staged===!0||Q.skipDefaultSeoTags===!0)return z;let N=J.__stx_runtime_head;if(!!(N?.title||N?.meta?.some((F)=>F.property==="og:title"||F.name==="og:title"||F.name==="twitter:title"||F.name==="description")))return z;if(/<meta\s+(?:[^>]*\s)?property=["']og:title["']/i.test(z)||/<meta\s+(?:[^>]*\s)?name=["']og:title["']/i.test(z)||/<meta\s+(?:[^>]*\s)?name=["']twitter:title["']/i.test(z))return z;if(!z.includes("<head>")&&!z.includes("<head "))return z;let Z=z.includes("<title>")||z.includes("</title>"),G=n(z),$=s(G),q=o(G),j="";if(J.title)j=J.title;else if(J.meta&&J.meta.title)j=J.meta.title;else if($)j=$;else if(Q.seo?.defaultConfig?.title)j=Q.seo.defaultConfig.title;else j=Q.defaultTitle||"stx Project";let Y="";if(J.description)Y=J.description;else if(J.meta&&J.meta.description)Y=J.meta.description;else if(q)Y=q;else if(Q.seo?.defaultConfig?.description)Y=Q.seo.defaultConfig.description;else Y=Q.defaultDescription||"A website built with stx templating engine";let O="";if(J.image)O=J.image;else if(J.meta&&J.meta.image)O=J.meta.image;else if(J.openGraph&&J.openGraph.image)O=J.openGraph.image;else if(Q.seo?.defaultImage)O=Q.seo.defaultImage;else if(Q.defaultImage)O=Q.defaultImage;let V=Z?"":`
29
- <meta name="title" content="${B(j)}">`,R=r(G)?"":`
30
- <meta name="description" content="${B(Y)}">`,k=`
31
- <!-- stx SEO Tags -->${V}${R}
32
- <meta property="og:title" content="${B(j)}">
33
- <meta property="og:description" content="${B(Y)}">
34
- <meta property="og:type" content="website">
35
- <meta name="twitter:card" content="summary_large_image">
36
- <meta name="twitter:title" content="${B(j)}">
37
- <meta name="twitter:description" content="${B(Y)}">
38
- `;if(O)k+=`
39
- <meta property="og:image" content="${B(O)}">
40
- <meta name="twitter:image" content="${B(O)}">
41
- `;let M=z;if(!Z)M=M.replace(/<head[^>]*>/,`$&
42
- <title>${B(j)}</title>`);let w=J.__stx_head_injections;if(w)return J.__stx_seo_staged=!0,w.afterOpen.push(`
43
- ${k}
44
- `),M;return M.replace(/<head[^>]*>/,`$&
45
- ${k}
46
- `)}function n(z){let J=z.search(/<\/head\s*>/i);return J===-1?z:z.slice(0,J)}function P(z){return z.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#0*39;|&apos;/g,"'").replace(/&amp;/g,"&")}function s(z){let J=z.match(/<title(?:\s[^>]*)?>([\s\S]*?)<\/title\s*>/i);return J?P(J[1].trim()):""}function x(z){return(z.match(/<meta\s[^>]*>/gi)||[]).filter((J)=>/\sname\s*=\s*["']description["']/i.test(J))}function r(z){return x(z).length>0}function o(z){for(let J of x(z)){let Q=J.match(/\scontent\s*=\s*(?:"([^"]*)"|'([^']*)')/i),N=(Q?.[1]??Q?.[2]??"").trim();if(N)return P(N)}return""}function B(z){return String(z).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}var i={name:"meta",rawParams:!0,handler:(z,J,Q,N)=>{let W=C(J,Q??{});if(W.kind==="error")return K("Meta",`@meta(${J.join(", ")})`,W.message,N,W.code);if(W.kind==="empty")return"";if(Q)Q.__stx_runtime_head=T(Q.__stx_runtime_head??{},{meta:[W.tag]});return""},hasEndTag:!1},l={name:"structuredData",handler:(z,J,Q,N)=>{if(z.trim()==="")return L("StructuredData","structuredData directive requires JSON-LD content",I.INVALID_DIRECTIVE_SYNTAX);try{let W=JSON.parse(z);if(!W["@context"])W["@context"]="https://schema.org";if(!W["@type"])return L("StructuredData","structuredData requires @type property",I.INVALID_DIRECTIVE_SYNTAX);return E(W)}catch(W){let Z=W instanceof Error?W.message:String(W);return L("StructuredData",Z,I.EVALUATION_ERROR)}},hasEndTag:!0};function Gz(){return[i,l]}function qz(z,J){let{baseUrl:Q,defaultChangefreq:N="weekly",defaultPriority:W=0.5,includeLastmod:Z=!0}=J,G=Q.replace(/\/$/,"");return`<?xml version="1.0" encoding="UTF-8"?>
47
- <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
48
- ${z.map((q)=>{let j=q.loc.startsWith("http")?q.loc:`${G}${q.loc.startsWith("/")?"":"/"}${q.loc}`,Y=q.lastmod||(Z?new Date().toISOString().split("T")[0]:void 0),O=q.changefreq||N,V=q.priority??W,R=` <url>
49
- <loc>${d(j)}</loc>`;if(Y)R+=`
50
- <lastmod>${Y}</lastmod>`;return R+=`
51
- <changefreq>${O}</changefreq>`,R+=`
52
- <priority>${V.toFixed(1)}</priority>`,R+=`
53
- </url>`,R}).join(`
54
- `)}
55
- </urlset>`}function Bz(z,J){let Q=J.replace(/\/$/,""),N=new Date().toISOString().split("T")[0];return`<?xml version="1.0" encoding="UTF-8"?>
56
- <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
57
- ${z.map((Z)=>{let G=Z.startsWith("http")?Z:`${Q}${Z.startsWith("/")?"":"/"}${Z}`;return` <sitemap>
58
- <loc>${d(G)}</loc>
59
- <lastmod>${N}</lastmod>
60
- </sitemap>`}).join(`
61
- `)}
62
- </sitemapindex>`}async function Nz(z,J){let{extensions:Q=[".stx",".html",".htm"],ignore:N=["_*",".*","node_modules","components","partials","layouts"]}=J,W=[],Z=Q.length===1?`*${Q[0]}`:`*{${Q.join(",")}}`,G=new Bun.Glob(`**/${Z}`);for await(let $ of G.scan(z)){if(N.some((V)=>{if(V.startsWith("*"))return $.includes(V.slice(1));return $.startsWith(V)||$.includes(`/${V}`)}))continue;let j=$.replace(/\\/g,"/").replace(/index\.(stx|html|htm)$/,"").replace(/\.(stx|html|htm)$/,"");if(!j.startsWith("/"))j=`/${j}`;if(j!=="/"&&j.endsWith("/"))j=j.slice(0,-1);let Y=`${z}/${$}`,O;try{let V=await Bun.file(Y).stat();if(V)O=new Date(V.mtime).toISOString().split("T")[0]}catch{}W.push({loc:j||"/",lastmod:O,priority:j==="/"?1:0.5})}return W.sort(($,q)=>$.loc.localeCompare(q.loc)),W}function a(z){let J=[];for(let Q of z.rules){if(J.push(`User-agent: ${Q.userAgent}`),Q.allow)for(let N of Q.allow)J.push(`Allow: ${N}`);if(Q.disallow)for(let N of Q.disallow)J.push(`Disallow: ${N}`);if(Q.crawlDelay!==void 0)J.push(`Crawl-delay: ${Q.crawlDelay}`);J.push("")}if(z.sitemap){let Q=Array.isArray(z.sitemap)?z.sitemap:[z.sitemap];for(let N of Q)J.push(`Sitemap: ${N}`)}if(z.host)J.push(`Host: ${z.host}`);return J.join(`
63
- `).trim()}function jz(z){return a({rules:[{userAgent:"*",allow:["/"]}],sitemap:z})}function d(z){return z.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}
64
- export{Qz as eu,Wz as fu,Zz as gu,$z as hu,i as iu,l as ju,Gz as ku,qz as lu,Bz as mu,Nz as nu,a as ou,jz as pu};
@@ -1,8 +0,0 @@
1
- // @bun
2
- import{Hs as _}from"./chunk-v3nwkveg.js";import"./chunk-2fw05hs2.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
3
- `)H++;return H}function P(j,G){let H=j.lastIndexOf(`
4
- `,G)+1,Q=j.indexOf(`
5
- `,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
6
- ${z.reason}`)}if(X.length>0){M.push("",`An stx primitive already covers this \u2014 ${X.length} site(s):`);for(let z of X)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
7
- use ${z.reason}`)}return M.join(`
8
- `)}export{A as formatCodemodFindings,k as codemodSource};