@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,32 +1,32 @@
1
1
  // @bun
2
- import"./chunk-2fw05hs2.js";import B from"fs";import $ from"path";import k from"crypto";var V=[{name:"mobile",width:375,height:667,isMobile:!0,hasTouch:!0},{name:"tablet",width:768,height:1024,isMobile:!0,hasTouch:!0},{name:"desktop",width:1280,height:800,isMobile:!1,hasTouch:!1},{name:"wide",width:1920,height:1080,isMobile:!1,hasTouch:!1}];function J(N={}){let Y={snapshotDir:N.snapshotDir||"__snapshots__",screenshotDir:N.screenshotDir||"__screenshots__",updateSnapshots:N.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true",threshold:N.threshold??0.01,viewports:N.viewports||V,generateDiff:N.generateDiff??!0,diffDir:N.diffDir||"__diffs__",compare:N.compare||b,ci:N.ci??process.env.CI==="true",retries:N.retries??(N.ci?3:1)};return{async snapshot(M,X){let q=$.join(Y.snapshotDir,`${X}.html`),G=C(M),Q=K(G);if(await Bun.file(q).exists()){let W=await Bun.file(q).text(),Z=K(C(W));if(Q===Z)return{passed:!0,snapshotPath:q,message:"Snapshot matches"};if(Y.updateSnapshots)return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};let F=$.join(Y.diffDir,`${X}.actual.html`),U=$.join(Y.diffDir,`${X}.diff.html`);return await B.promises.mkdir(Y.diffDir,{recursive:!0}),await Bun.write(F,G),await Bun.write(U,I(W,G)),{passed:!1,snapshotPath:q,actualPath:F,diffPath:U,message:"Snapshot does not match"}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},async snapshotJson(M,X){let q=$.join(Y.snapshotDir,`${X}.json`),G=JSON.stringify(M,null,2);if(await Bun.file(q).exists()){let Q=await Bun.file(q).text();if(G===Q)return{passed:!0,snapshotPath:q};if(Y.updateSnapshots)return await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"Snapshot updated"};return{passed:!1,snapshotPath:q,message:`JSON snapshot mismatch:
3
- ${z(Q,G)}`}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun.write(q,G),{passed:!0,snapshotPath:q,message:"New snapshot created"}},matchInlineSnapshot(M,X){let q=C(M);if(X===void 0)return{passed:!0,expected:q};let G=C(X);return{passed:q===G,expected:q}},getConfig(){return Y}}}function D(N={}){let Y=J(N),M=Y.getConfig();return{async compareScreenshots(X,q,G="desktop"){let Q=$.join(M.screenshotDir,G,`${X}.png`),W=$.join(M.diffDir,G,`${X}.actual.png`),Z=$.join(M.diffDir,G,`${X}.diff.png`);if(await Bun.file(Q).exists()){let F=await Bun.file(Q).arrayBuffer(),U=Buffer.from(F),_=await M.compare(q,U);if(_.match||_.diffPercentage<=M.threshold)return{viewport:G,passed:!0,baselinePath:Q};if(M.updateSnapshots)return await B.promises.mkdir($.dirname(Q),{recursive:!0}),await Bun.write(Q,q),{viewport:G,passed:!0,baselinePath:Q};if(await B.promises.mkdir($.dirname(W),{recursive:!0}),await Bun.write(W,q),_.diffImage&&M.generateDiff)await Bun.write(Z,_.diffImage);return{viewport:G,passed:!1,baselinePath:Q,actualPath:W,diffPath:M.generateDiff?Z:void 0,diffPercentage:_.diffPercentage}}return await B.promises.mkdir($.dirname(Q),{recursive:!0}),await Bun.write(Q,q),{viewport:G,passed:!0,baselinePath:Q}},async testViewports(X,q,G=M.viewports){let Q=[];for(let W of G){let Z=null;for(let F=0;F<M.retries;F++)try{let U=await q(W),_=await this.compareScreenshots(X,U,W.name);Q.push(_),Z=null;break}catch(U){if(Z=U,F<M.retries-1)await new Promise((_)=>setTimeout(_,100*(F+1)))}if(Z)Q.push({viewport:W.name,passed:!1,baselinePath:"",diffPercentage:100})}return Q},getSnapshotTester(){return Y}}}function L(N={}){let M=D(N).getSnapshotTester(),X=new Map;return{addStory(q){X.set(`${q.component}/${q.name}`,q)},addStories(q){for(let G of q)this.addStory(G)},getStories(){return Array.from(X.values())},getStoriesForComponent(q){return Array.from(X.values()).filter((G)=>G.component===q)},async testStory(q){let G=X.get(q);if(!G)return{name:q,passed:!1,duration:0,snapshots:[],screenshots:[],errors:[Error(`Story not found: ${q}`)]};let Q=Date.now(),W={name:q,passed:!0,duration:0,snapshots:[],screenshots:[],errors:[]};try{let Z=await G.render(),F=await M.snapshot(Z,q.replace(/\//g,"-"));if(W.snapshots.push(F),!F.passed)W.passed=!1}catch(Z){W.passed=!1,W.errors.push(Z)}return W.duration=Date.now()-Q,W},async testAllStories(){let q=[];for(let G of X.keys()){let Q=await this.testStory(G);q.push(Q)}return q},async generateStoryIndex(){let q={};for(let G of X.values()){if(!q[G.component])q[G.component]=[];q[G.component].push({name:G.name,args:G.args})}return JSON.stringify(q,null,2)}}}async function S(N,Y={}){let M={outputDir:Y.outputDir||"visual-test-report",format:Y.format||"html",title:Y.title||"Visual Test Report",includeScreenshots:Y.includeScreenshots??!0};await B.promises.mkdir(M.outputDir,{recursive:!0});let X=N.length,q=N.filter((F)=>F.passed).length,G=X-q,Q=N.reduce((F,U)=>F+U.duration,0);if(M.format==="json"){let F={title:M.title,summary:{total:X,passed:q,failed:G,duration:Q},results:N,generatedAt:new Date().toISOString()},U=$.join(M.outputDir,"report.json");return await Bun.write(U,JSON.stringify(F,null,2)),U}if(M.format==="markdown"){let F=`# ${M.title}
2
+ import c from"fs";import p from"path";import T from"crypto";var y=[{name:"mobile",width:375,height:667,isMobile:!0,hasTouch:!0},{name:"tablet",width:768,height:1024,isMobile:!0,hasTouch:!0},{name:"desktop",width:1280,height:800,isMobile:!1,hasTouch:!1},{name:"wide",width:1920,height:1080,isMobile:!1,hasTouch:!1}];function w(n={}){let d={snapshotDir:n.snapshotDir||"__snapshots__",screenshotDir:n.screenshotDir||"__screenshots__",updateSnapshots:n.updateSnapshots||process.env.UPDATE_SNAPSHOTS==="true",threshold:n.threshold??0.01,viewports:n.viewports||y,generateDiff:n.generateDiff??!0,diffDir:n.diffDir||"__diffs__",compare:n.compare||V,ci:n.ci??process.env.CI==="true",retries:n.retries??(n.ci?3:1)};return{async snapshot(r,l){let e=p.join(d.snapshotDir,`${l}.html`),s=g(r),i=S(s);if(await Bun.file(e).exists()){let o=await Bun.file(e).text(),u=S(g(o));if(i===u)return{passed:!0,snapshotPath:e,message:"Snapshot matches"};if(d.updateSnapshots)return await c.promises.mkdir(p.dirname(e),{recursive:!0}),await Bun.write(e,s),{passed:!0,snapshotPath:e,message:"Snapshot updated"};let t=p.join(d.diffDir,`${l}.actual.html`),a=p.join(d.diffDir,`${l}.diff.html`);return await c.promises.mkdir(d.diffDir,{recursive:!0}),await Bun.write(t,s),await Bun.write(a,k(o,s)),{passed:!1,snapshotPath:e,actualPath:t,diffPath:a,message:"Snapshot does not match"}}return await c.promises.mkdir(p.dirname(e),{recursive:!0}),await Bun.write(e,s),{passed:!0,snapshotPath:e,message:"New snapshot created"}},async snapshotJson(r,l){let e=p.join(d.snapshotDir,`${l}.json`),s=JSON.stringify(r,null,2);if(await Bun.file(e).exists()){let i=await Bun.file(e).text();if(s===i)return{passed:!0,snapshotPath:e};if(d.updateSnapshots)return await Bun.write(e,s),{passed:!0,snapshotPath:e,message:"Snapshot updated"};return{passed:!1,snapshotPath:e,message:`JSON snapshot mismatch:
3
+ ${B(i,s)}`}}return await c.promises.mkdir(p.dirname(e),{recursive:!0}),await Bun.write(e,s),{passed:!0,snapshotPath:e,message:"New snapshot created"}},matchInlineSnapshot(r,l){let e=g(r);if(l===void 0)return{passed:!0,expected:e};let s=g(l);return{passed:e===s,expected:e}},getConfig(){return d}}}function b(n={}){let d=w(n),r=d.getConfig();return{async compareScreenshots(l,e,s="desktop"){let i=p.join(r.screenshotDir,s,`${l}.png`),o=p.join(r.diffDir,s,`${l}.actual.png`),u=p.join(r.diffDir,s,`${l}.diff.png`);if(await Bun.file(i).exists()){let t=await Bun.file(i).arrayBuffer(),a=Buffer.from(t),f=await r.compare(e,a);if(f.match||f.diffPercentage<=r.threshold)return{viewport:s,passed:!0,baselinePath:i};if(r.updateSnapshots)return await c.promises.mkdir(p.dirname(i),{recursive:!0}),await Bun.write(i,e),{viewport:s,passed:!0,baselinePath:i};if(await c.promises.mkdir(p.dirname(o),{recursive:!0}),await Bun.write(o,e),f.diffImage&&r.generateDiff)await Bun.write(u,f.diffImage);return{viewport:s,passed:!1,baselinePath:i,actualPath:o,diffPath:r.generateDiff?u:void 0,diffPercentage:f.diffPercentage}}return await c.promises.mkdir(p.dirname(i),{recursive:!0}),await Bun.write(i,e),{viewport:s,passed:!0,baselinePath:i}},async testViewports(l,e,s=r.viewports){let i=[];for(let o of s){let u=null;for(let t=0;t<r.retries;t++)try{let a=await e(o),f=await this.compareScreenshots(l,a,o.name);i.push(f),u=null;break}catch(a){if(u=a,t<r.retries-1)await new Promise((f)=>setTimeout(f,100*(t+1)))}if(u)i.push({viewport:o.name,passed:!1,baselinePath:"",diffPercentage:100})}return i},getSnapshotTester(){return d}}}function D(n={}){let r=b(n).getSnapshotTester(),l=new Map;return{addStory(e){l.set(`${e.component}/${e.name}`,e)},addStories(e){for(let s of e)this.addStory(s)},getStories(){return Array.from(l.values())},getStoriesForComponent(e){return Array.from(l.values()).filter((s)=>s.component===e)},async testStory(e){let s=l.get(e);if(!s)return{name:e,passed:!1,duration:0,snapshots:[],screenshots:[],errors:[Error(`Story not found: ${e}`)]};let i=Date.now(),o={name:e,passed:!0,duration:0,snapshots:[],screenshots:[],errors:[]};try{let u=await s.render(),t=await r.snapshot(u,e.replace(/\//g,"-"));if(o.snapshots.push(t),!t.passed)o.passed=!1}catch(u){o.passed=!1,o.errors.push(u)}return o.duration=Date.now()-i,o},async testAllStories(){let e=[];for(let s of l.keys()){let i=await this.testStory(s);e.push(i)}return e},async generateStoryIndex(){let e={};for(let s of l.values()){if(!e[s.component])e[s.component]=[];e[s.component].push({name:s.name,args:s.args})}return JSON.stringify(e,null,2)}}}async function R(n,d={}){let r={outputDir:d.outputDir||"visual-test-report",format:d.format||"html",title:d.title||"Visual Test Report",includeScreenshots:d.includeScreenshots??!0};await c.promises.mkdir(r.outputDir,{recursive:!0});let l=n.length,e=n.filter((t)=>t.passed).length,s=l-e,i=n.reduce((t,a)=>t+a.duration,0);if(r.format==="json"){let t={title:r.title,summary:{total:l,passed:e,failed:s,duration:i},results:n,generatedAt:new Date().toISOString()},a=p.join(r.outputDir,"report.json");return await Bun.write(a,JSON.stringify(t,null,2)),a}if(r.format==="markdown"){let t=`# ${r.title}
4
4
 
5
- `;F+=`## Summary
5
+ `;t+=`## Summary
6
6
 
7
- `,F+=`- Total: ${X}
8
- `,F+=`- Passed: ${q}
9
- `,F+=`- Failed: ${G}
10
- `,F+=`- Duration: ${Q}ms
7
+ `,t+=`- Total: ${l}
8
+ `,t+=`- Passed: ${e}
9
+ `,t+=`- Failed: ${s}
10
+ `,t+=`- Duration: ${i}ms
11
11
 
12
- `,F+=`## Results
12
+ `,t+=`## Results
13
13
 
14
- `;for(let _ of N){let R=_.passed?"\u2705":"\u274C";if(F+=`### ${R} ${_.name}
14
+ `;for(let f of n){let P=f.passed?"\u2705":"\u274C";if(t+=`### ${P} ${f.name}
15
15
 
16
- `,F+=`Duration: ${_.duration}ms
16
+ `,t+=`Duration: ${f.duration}ms
17
17
 
18
- `,_.errors.length>0){F+=`**Errors:**
19
- `;for(let A of _.errors)F+=`- ${A.message}
20
- `;F+=`
21
- `}if(_.snapshots.length>0){F+=`**Snapshots:**
22
- `;for(let A of _.snapshots){let j=A.passed?"\u2705":"\u274C";F+=`- ${j} ${A.snapshotPath}
23
- `}F+=`
24
- `}}let U=$.join(M.outputDir,"report.md");return await Bun.write(U,F),U}let W=`<!DOCTYPE html>
18
+ `,f.errors.length>0){t+=`**Errors:**
19
+ `;for(let h of f.errors)t+=`- ${h.message}
20
+ `;t+=`
21
+ `}if(f.snapshots.length>0){t+=`**Snapshots:**
22
+ `;for(let h of f.snapshots){let x=h.passed?"\u2705":"\u274C";t+=`- ${x} ${h.snapshotPath}
23
+ `}t+=`
24
+ `}}let a=p.join(r.outputDir,"report.md");return await Bun.write(a,t),a}let o=`<!DOCTYPE html>
25
25
  <html lang="en">
26
26
  <head>
27
27
  <meta charset="UTF-8">
28
28
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
29
- <title>${M.title}</title>
29
+ <title>${r.title}</title>
30
30
  <style>
31
31
  * { box-sizing: border-box; margin: 0; padding: 0; }
32
32
  body { font-family: system-ui, sans-serif; line-height: 1.6; color: #333; max-width: 1200px; margin: 0 auto; padding: 2rem; }
@@ -53,60 +53,60 @@ ${z(Q,G)}`}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun
53
53
  </style>
54
54
  </head>
55
55
  <body>
56
- <h1>${M.title}</h1>
56
+ <h1>${r.title}</h1>
57
57
 
58
58
  <div class="summary">
59
59
  <div class="stat">
60
- <div class="stat-value">${X}</div>
60
+ <div class="stat-value">${l}</div>
61
61
  <div class="stat-label">Total Tests</div>
62
62
  </div>
63
63
  <div class="stat">
64
- <div class="stat-value passed">${q}</div>
64
+ <div class="stat-value passed">${e}</div>
65
65
  <div class="stat-label">Passed</div>
66
66
  </div>
67
67
  <div class="stat">
68
- <div class="stat-value failed">${G}</div>
68
+ <div class="stat-value failed">${s}</div>
69
69
  <div class="stat-label">Failed</div>
70
70
  </div>
71
71
  <div class="stat">
72
- <div class="stat-value">${Q}ms</div>
72
+ <div class="stat-value">${i}ms</div>
73
73
  <div class="stat-label">Duration</div>
74
74
  </div>
75
75
  </div>
76
76
 
77
77
  <div class="results">
78
- ${N.map((F)=>`
79
- <div class="result ${F.passed?"":"expanded"}">
78
+ ${n.map((t)=>`
79
+ <div class="result ${t.passed?"":"expanded"}">
80
80
  <div class="result-header" onclick="this.parentElement.classList.toggle('expanded')">
81
- <span>${F.name}</span>
82
- <span class="status ${F.passed?"pass":"fail"}">${F.passed?"PASS":"FAIL"}</span>
81
+ <span>${t.name}</span>
82
+ <span class="status ${t.passed?"pass":"fail"}">${t.passed?"PASS":"FAIL"}</span>
83
83
  </div>
84
84
  <div class="result-body">
85
- <p>Duration: ${F.duration}ms</p>
86
- ${F.errors.length>0?`
85
+ <p>Duration: ${t.duration}ms</p>
86
+ ${t.errors.length>0?`
87
87
  <div class="error">
88
- ${F.errors.map((U)=>`<div>${E(U.message)}</div>`).join("")}
88
+ ${t.errors.map((a)=>`<div>${v(a.message)}</div>`).join("")}
89
89
  </div>
90
90
  `:""}
91
- ${F.snapshots.filter((U)=>!U.passed).map((U)=>`
91
+ ${t.snapshots.filter((a)=>!a.passed).map((a)=>`
92
92
  <div class="snapshot-diff">
93
- <p>Snapshot: ${U.snapshotPath}</p>
94
- ${U.diffPath?`<p><a href="file://${U.diffPath}">View diff</a></p>`:""}
93
+ <p>Snapshot: ${a.snapshotPath}</p>
94
+ ${a.diffPath?`<p><a href="file://${a.diffPath}">View diff</a></p>`:""}
95
95
  </div>
96
96
  `).join("")}
97
- ${F.screenshots.filter((U)=>!U.passed).map((U)=>`
97
+ ${t.screenshots.filter((a)=>!a.passed).map((a)=>`
98
98
  <div class="diff-view">
99
99
  <div>
100
100
  <div class="diff-label">Baseline</div>
101
- ${M.includeScreenshots?`<img src="file://${U.baselinePath}" alt="baseline">`:`<p>${U.baselinePath}</p>`}
101
+ ${r.includeScreenshots?`<img src="file://${a.baselinePath}" alt="baseline">`:`<p>${a.baselinePath}</p>`}
102
102
  </div>
103
103
  <div>
104
104
  <div class="diff-label">Actual</div>
105
- ${M.includeScreenshots&&U.actualPath?`<img src="file://${U.actualPath}" alt="actual">`:`<p>${U.actualPath||"N/A"}</p>`}
105
+ ${r.includeScreenshots&&a.actualPath?`<img src="file://${a.actualPath}" alt="actual">`:`<p>${a.actualPath||"N/A"}</p>`}
106
106
  </div>
107
107
  <div>
108
- <div class="diff-label">Diff (${(U.diffPercentage||0).toFixed(2)}%)</div>
109
- ${M.includeScreenshots&&U.diffPath?`<img src="file://${U.diffPath}" alt="diff">`:`<p>${U.diffPath||"N/A"}</p>`}
108
+ <div class="diff-label">Diff (${(a.diffPercentage||0).toFixed(2)}%)</div>
109
+ ${r.includeScreenshots&&a.diffPath?`<img src="file://${a.diffPath}" alt="diff">`:`<p>${a.diffPath||"N/A"}</p>`}
110
110
  </div>
111
111
  </div>
112
112
  `).join("")}
@@ -120,7 +120,7 @@ ${z(Q,G)}`}}return await B.promises.mkdir($.dirname(q),{recursive:!0}),await Bun
120
120
  document.querySelectorAll('.result.fail').forEach(el => el.classList.add('expanded'));
121
121
  </script>
122
122
  </body>
123
- </html>`,Z=$.join(M.outputDir,"report.html");return await Bun.write(Z,W),Z}function C(N){return N.replace(/<!--[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/"/g,'"').replace(/"/g,'"').trim()}function K(N){return k.createHash("md5").update(N).digest("hex")}function I(N,Y){let M=N.split(`
124
- `),X=Y.split(`
125
- `),q="<html><head><style>";q+=".diff { font-family: monospace; white-space: pre; }",q+=".add { background: #dcfce7; }",q+=".remove { background: #fee2e2; }",q+=".line-num { color: #888; width: 3em; display: inline-block; }",q+='</style></head><body><div class="diff">';let G=Math.max(M.length,X.length);for(let Q=0;Q<G;Q++){let W=M[Q]||"",Z=X[Q]||"";if(W===Z)q+=`<div><span class="line-num">${Q+1}</span> ${E(W)}</div>`;else{if(W)q+=`<div class="remove"><span class="line-num">${Q+1}</span>-${E(W)}</div>`;if(Z)q+=`<div class="add"><span class="line-num">${Q+1}</span>+${E(Z)}</div>`}}return q+="</div></body></html>",q}function z(N,Y){let M=JSON.parse(N),X=JSON.parse(Y),q=[];function G(Q,W,Z){if(typeof W!==typeof Z){q.push(`${Q}: type changed from ${typeof W} to ${typeof Z}`);return}if(W===null||Z===null){if(W!==Z)q.push(`${Q}: ${JSON.stringify(W)} \u2192 ${JSON.stringify(Z)}`);return}if(typeof W==="object"){let F=Object.keys(W),U=Object.keys(Z);for(let _ of F)if(!U.includes(_))q.push(`${Q}.${_}: removed`);else G(`${Q}.${_}`,W[_],Z[_]);for(let _ of U)if(!F.includes(_))q.push(`${Q}.${_}: added`)}else if(W!==Z)q.push(`${Q}: ${JSON.stringify(W)} \u2192 ${JSON.stringify(Z)}`)}return G("root",M,X),q.join(`
126
- `)}function E(N){return N.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}async function b(N,Y){if(N.length!==Y.length)return{match:!1,diffPercentage:100,diffPixels:Math.max(N.length,Y.length)};let M=0;for(let q=0;q<N.length;q++)if(N[q]!==Y[q])M++;let X=M/N.length*100;return{match:M===0,diffPercentage:X,diffPixels:M}}var O=null;async function H(N,Y){if(!O)O=J();return O.snapshot(N,Y)}async function v(N,Y){if(!O)O=J();return O.snapshotJson(N,Y)}function P(){O=null}var x={createSnapshotTester:J,createVisualRegressionTester:D,createStoryTester:L,generateReport:S,snapshot:H,snapshotJson:v,defaultViewports:V};export{v as snapshotJson,H as snapshot,P as resetDefaultTester,S as generateReport,V as defaultViewports,x as default,D as createVisualRegressionTester,L as createStoryTester,J as createSnapshotTester};
123
+ </html>`,u=p.join(r.outputDir,"report.html");return await Bun.write(u,o),u}function g(n){return n.replace(/<!--[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/>\s+/g,">").replace(/\s+</g,"<").replace(/"/g,'"').replace(/"/g,'"').trim()}function S(n){return T.createHash("md5").update(n).digest("hex")}function k(n,d){let r=n.split(`
124
+ `),l=d.split(`
125
+ `),e="<html><head><style>";e+=".diff { font-family: monospace; white-space: pre; }",e+=".add { background: #dcfce7; }",e+=".remove { background: #fee2e2; }",e+=".line-num { color: #888; width: 3em; display: inline-block; }",e+='</style></head><body><div class="diff">';let s=Math.max(r.length,l.length);for(let i=0;i<s;i++){let o=r[i]||"",u=l[i]||"";if(o===u)e+=`<div><span class="line-num">${i+1}</span> ${v(o)}</div>`;else{if(o)e+=`<div class="remove"><span class="line-num">${i+1}</span>-${v(o)}</div>`;if(u)e+=`<div class="add"><span class="line-num">${i+1}</span>+${v(u)}</div>`}}return e+="</div></body></html>",e}function B(n,d){let r=JSON.parse(n),l=JSON.parse(d),e=[];function s(i,o,u){if(typeof o!==typeof u){e.push(`${i}: type changed from ${typeof o} to ${typeof u}`);return}if(o===null||u===null){if(o!==u)e.push(`${i}: ${JSON.stringify(o)} \u2192 ${JSON.stringify(u)}`);return}if(typeof o==="object"){let t=Object.keys(o),a=Object.keys(u);for(let f of t)if(!a.includes(f))e.push(`${i}.${f}: removed`);else s(`${i}.${f}`,o[f],u[f]);for(let f of a)if(!t.includes(f))e.push(`${i}.${f}: added`)}else if(o!==u)e.push(`${i}: ${JSON.stringify(o)} \u2192 ${JSON.stringify(u)}`)}return s("root",r,l),e.join(`
126
+ `)}function v(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}async function V(n,d){if(n.length!==d.length)return{match:!1,diffPercentage:100,diffPixels:Math.max(n.length,d.length)};let r=0;for(let e=0;e<n.length;e++)if(n[e]!==d[e])r++;let l=r/n.length*100;return{match:r===0,diffPercentage:l,diffPixels:r}}var m=null;async function j(n,d){if(!m)m=w();return m.snapshot(n,d)}async function C(n,d){if(!m)m=w();return m.snapshotJson(n,d)}function N(){m=null}var _={createSnapshotTester:w,createVisualRegressionTester:b,createStoryTester:D,generateReport:R,snapshot:j,snapshotJson:C,defaultViewports:y};export{w as createSnapshotTester,D as createStoryTester,b as createVisualRegressionTester,_ as default,y as defaultViewports,R as generateReport,N as resetDefaultTester,j as snapshot,C as snapshotJson};
@@ -157,7 +157,7 @@ finally {
157
157
  `;
158
158
  }
159
159
  export function generateReactiveComponentJS(component, template, options = {}) {
160
- const { properties = [], computed = [], watchers = [], methods = {}, lifecycle = {} } = options, className = component.name, tagName = component.tag, useShadow = component.shadowDOM !== !1, propsDefinition = properties.map((prop) => {
160
+ const { properties = [], computed = [], watchers = [], methods = {}, lifecycle = {} } = options, { name: className, tag: tagName } = component, useShadow = component.shadowDOM !== !1, propsDefinition = properties.map((prop) => {
161
161
  const defaultValue = prop.default !== void 0 ? JSON.stringify(prop.default) : getDefaultForType(prop.type);
162
162
  return ` ${prop.name}: { type: '${prop.type}', default: ${defaultValue}, reflect: ${!!prop.reflect} }`;
163
163
  }).join(`,
@@ -266,7 +266,7 @@ export { ${className} };
266
266
  `;
267
267
  }
268
268
  export function generateReactiveComponentTS(component, template, options = {}) {
269
- const { properties = [], computed = [], watchers = [], methods = {}, lifecycle = {} } = options, className = component.name, tagName = component.tag, useShadow = component.shadowDOM !== !1, propsInterface = properties.map((prop) => {
269
+ const { properties = [], computed = [], watchers = [], methods = {}, lifecycle = {} } = options, { name: className, tag: tagName } = component, useShadow = component.shadowDOM !== !1, propsInterface = properties.map((prop) => {
270
270
  const tsType = getTypeScriptType(prop.type);
271
271
  return ` ${prop.name}: ${tsType};`;
272
272
  }).join(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.412",
4
+ "version": "0.2.414",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -56,6 +56,10 @@
56
56
  "types": "./dist/visual-testing.d.ts",
57
57
  "import": "./dist/visual-testing.js"
58
58
  },
59
+ "./native": {
60
+ "types": "./dist/native/index.d.ts",
61
+ "import": "./dist/native/index.js"
62
+ },
59
63
  "./bundle-analyzer": {
60
64
  "types": "./dist/bundle-analyzer/index.d.ts",
61
65
  "import": "./dist/bundle-analyzer.js"
@@ -118,12 +122,12 @@
118
122
  "dependencies": {
119
123
  "@stacksjs/ts-css": "^0.3.2",
120
124
  "@stacksjs/clapp": "^0.2.16",
121
- "@stacksjs/desktop": "0.2.412",
122
- "@stacksjs/sanitizer": "0.2.412",
125
+ "@stacksjs/desktop": "0.2.414",
126
+ "@stacksjs/sanitizer": "0.2.414",
123
127
  "@stacksjs/ts-i18n": "^0.1.11",
124
- "bun-plugin-stx": "0.2.412",
128
+ "bun-plugin-stx": "0.2.414",
125
129
  "bunfig": "^0.15.19",
126
- "stx-router": "0.2.412",
130
+ "stx-router": "0.2.414",
127
131
  "ts-broadcasting": "^0.0.11",
128
132
  "ts-images": "^0.2.22",
129
133
  "ts-syntax-highlighter": "^0.2.1"
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ai as c,Bi as d,Ci as e,yi as a,zi as b}from"./chunk-bjcsc6wx.js";import"./chunk-2fw05hs2.js";export{c as renderSSRSuspense,a as processSuspenseDirectives,e as generateSuspenseRuntime,d as generateSuspenseCSS,b as createSSRSuspense};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Es as a,Fs as b}from"./chunk-zcz9rs6p.js";import"./chunk-2fw05hs2.js";export{b as resolveStxTargets,a as looksLikeGlob};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{$o as l,Qo as a,Ro as b,So as c,To as d,Uo as e,Vo as f,Wo as g,Xo as h,Yo as i,Zo as j,_o as k}from"./chunk-wc66mcn4.js";import"./chunk-aq1xq0r4.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-24w86pek.js";import"./chunk-tkyrk66a.js";import"./chunk-213jwgpx.js";import"./chunk-4q1c6fw2.js";import"./chunk-1te8k8gp.js";import"./chunk-zpcnbdhn.js";import"./chunk-rz9f3zqz.js";import"./chunk-bn1edb1y.js";import"./chunk-cj3adc77.js";import"./chunk-t1htzg9e.js";import"./chunk-gbmeh7jg.js";import"./chunk-8wp64mym.js";import"./chunk-vx86cf4r.js";import"./chunk-563shnkz.js";import"./chunk-2fw05hs2.js";export{c as withoutStxReferrer,b as stripTypeScript,j as splitDeclaration,e as isSyntaxFailure,d as isModuleResolutionFailure,f as isMissingBindingFailure,h as isCompleteImport,l as hasVariables,g as extractVariables,k as extractScriptFromTemplate,i as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
@@ -1,147 +0,0 @@
1
- // @bun
2
- var N=new Map,Q=new Map;function T(A){if(N.set(A.name,A),A.client)Q.set(A.name,A.client)}function V(A){return N.get(A)}function W(){return Array.from(N.values())}function X(A){return Q.delete(A),N.delete(A)}function G(A){return T(A),{name:A.name,hasEndTag:A.hasEndTag??!0,description:A.description,handler:async(C,F,H,L)=>{let J=U(F,A.defaults);if(A.validate){let E=A.validate(J);if(E!==!0){let M=typeof E==="string"?E:`Invalid parameters for @${A.name}`;throw Error(M)}}let K=C;if(A.transform)K=await A.transform(C,J,H,L);if(A.clientScript){let E=A.clientScript(J);K+=`<script>${E}</script>`}if(A.css){let E=A.css(J);K+=`<style>${E}</style>`}return K}}}function Y(A,B){let C=typeof B==="function"?{mounted:B}:B;return Q.set(A,C),C}function U(A,B){let C={...B};for(let F of A){let H=F.indexOf(":"),L=F.indexOf("="),J=H>=0&&(L<0||H<L)?H:L;if(J>=0){let K=F.slice(0,J).trim(),E=F.slice(J+1).trim();if(E==="true")E=!0;else if(E==="false")E=!1;else if(E==="null")E=null;else if(!Number.isNaN(Number(E)))E=Number(E);else if(typeof E==="string"&&E.startsWith("{"))try{E=JSON.parse(E)}catch{}C[K]=E}else{let K=Object.keys(C).filter((E)=>!B||!(E in B)).length;C[K===0?"value":`arg${K}`]=F}}return C}function Z(){return[G({name:"uppercase",description:"Convert content to uppercase",transform:(A)=>A.toUpperCase()}),G({name:"lowercase",description:"Convert content to lowercase",transform:(A)=>A.toLowerCase()}),G({name:"capitalize",description:"Capitalize first letter of content",transform:(A)=>A.charAt(0).toUpperCase()+A.slice(1)}),G({name:"trim",description:"Remove leading and trailing whitespace",transform:(A)=>A.trim()}),G({name:"truncate",description:"Truncate content to specified length",defaults:{length:100,suffix:"..."},transform:(A,{length:B,suffix:C})=>A.length>B?A.slice(0,B)+C:A}),G({name:"highlight",description:"Highlight content with background color",defaults:{color:"yellow"},transform:(A,{color:B})=>`<mark style="background-color: ${B}; padding: 0.1em 0.2em; border-radius: 0.2em;">${A}</mark>`}),G({name:"badge",description:"Create a badge/tag",defaults:{variant:"default",color:""},transform:(A,{variant:B,color:C})=>{let F={default:"background: #e5e7eb; color: #374151;",primary:"background: #3b82f6; color: white;",success:"background: #10b981; color: white;",warning:"background: #f59e0b; color: white;",danger:"background: #ef4444; color: white;",info:"background: #06b6d4; color: white;"};return`<span style="${C?`background: ${C}; color: white;`:F[B]||F.default} padding: 0.25em 0.5em; border-radius: 9999px; font-size: 0.875em; font-weight: 500;">${A}</span>`}}),G({name:"code",description:"Style content as inline code",transform:(A)=>`<code style="background: #f3f4f6; padding: 0.2em 0.4em; border-radius: 0.25em; font-family: ui-monospace, monospace; font-size: 0.875em;">${A}</code>`}),G({name:"tooltip",description:"Add a tooltip to content",defaults:{text:"",position:"top"},hasEndTag:!0,transform:(A,{text:B,position:C})=>`<span class="stx-tooltip" data-tooltip="${B}" data-tooltip-position="${C}" style="position: relative; cursor: help;">${A}</span>`,css:()=>`
3
- .stx-tooltip::after {
4
- content: attr(data-tooltip);
5
- position: absolute;
6
- bottom: 100%;
7
- left: 50%;
8
- transform: translateX(-50%);
9
- padding: 0.5em 0.75em;
10
- background: #1f2937;
11
- color: white;
12
- font-size: 0.75rem;
13
- border-radius: 0.25rem;
14
- white-space: nowrap;
15
- opacity: 0;
16
- visibility: hidden;
17
- transition: opacity 0.2s, visibility 0.2s;
18
- z-index: 1000;
19
- margin-bottom: 0.25rem;
20
- }
21
- .stx-tooltip:hover::after {
22
- opacity: 1;
23
- visibility: visible;
24
- }
25
- `}),G({name:"clipboard",description:"Add copy to clipboard functionality",defaults:{label:"Copy"},transform:(A,{label:B})=>{let C=`clipboard-${Date.now()}-${Math.random().toString(36).slice(2)}`;return`
26
- <span class="stx-clipboard" data-clipboard-id="${C}">
27
- <span class="stx-clipboard-content">${A}</span>
28
- <button type="button" class="stx-clipboard-btn" onclick="navigator.clipboard.writeText(document.querySelector('[data-clipboard-id=\\'${C}\\'] .stx-clipboard-content').textContent).then(() => { this.textContent = 'Copied!'; setTimeout(() => this.textContent = '${B}', 2000); })">${B}</button>
29
- </span>
30
- `},css:()=>`
31
- .stx-clipboard {
32
- display: inline-flex;
33
- align-items: center;
34
- gap: 0.5em;
35
- }
36
- .stx-clipboard-btn {
37
- padding: 0.25em 0.5em;
38
- font-size: 0.75em;
39
- background: #e5e7eb;
40
- border: none;
41
- border-radius: 0.25em;
42
- cursor: pointer;
43
- }
44
- .stx-clipboard-btn:hover {
45
- background: #d1d5db;
46
- }
47
- `}),G({name:"time",description:"Display relative time",defaults:{date:""},hasEndTag:!1,transform:(A,{date:B})=>{let C=B?new Date(B).getTime():Date.now();return`<time datetime="${new Date(C).toISOString()}" data-stx-relative-time="${C}"></time>`},clientScript:()=>`
48
- document.querySelectorAll('[data-stx-relative-time]').forEach(el => {
49
- const timestamp = parseInt(el.dataset.stxRelativeTime);
50
- const rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' });
51
- const diff = timestamp - Date.now();
52
- const seconds = Math.floor(diff / 1000);
53
- const minutes = Math.floor(seconds / 60);
54
- const hours = Math.floor(minutes / 60);
55
- const days = Math.floor(hours / 24);
56
-
57
- if (Math.abs(days) > 0) el.textContent = rtf.format(days, 'day');
58
- else if (Math.abs(hours) > 0) el.textContent = rtf.format(hours, 'hour');
59
- else if (Math.abs(minutes) > 0) el.textContent = rtf.format(minutes, 'minute');
60
- else el.textContent = rtf.format(seconds, 'second');
61
- });
62
- `}),G({name:"currency",description:"Format number as currency",defaults:{amount:0,currency:"USD",locale:"en-US"},hasEndTag:!1,transform:(A,{amount:B,currency:C,locale:F})=>{return new Intl.NumberFormat(F,{style:"currency",currency:C}).format(B)}}),G({name:"number",description:"Format number with locale",defaults:{value:0,decimals:2,locale:"en-US"},hasEndTag:!1,transform:(A,{value:B,decimals:C,locale:F})=>{return new Intl.NumberFormat(F,{minimumFractionDigits:C,maximumFractionDigits:C}).format(B)}}),G({name:"pluralize",description:"Pluralize text based on count",defaults:{count:0,singular:"",plural:""},hasEndTag:!1,transform:(A,{count:B,singular:C,plural:F})=>{let H=B===1?C:F||C+"s";return`${B} ${H}`}})]}function _(){return`
63
- // STX Directive Runtime
64
- (function() {
65
- if (typeof window === 'undefined') return;
66
-
67
- window.STX = window.STX || {};
68
- window.STX.directives = window.STX.directives || {};
69
-
70
- // Register a client-side directive
71
- window.STX.directive = function(name, definition) {
72
- if (typeof definition === 'function') {
73
- definition = { mounted: definition };
74
- }
75
- window.STX.directives[name] = definition;
76
- };
77
-
78
- // Apply directive to element
79
- window.STX.applyDirective = function(el, name, value, arg, modifiers) {
80
- const directive = window.STX.directives[name];
81
- if (!directive) {
82
- console.warn('[stx] Unknown directive:', name);
83
- return;
84
- }
85
-
86
- const binding = {
87
- value: value,
88
- arg: arg,
89
- modifiers: modifiers || {},
90
- dir: directive
91
- };
92
-
93
- // Store binding on element for updates
94
- el.__stx_directives__ = el.__stx_directives__ || {};
95
- el.__stx_directives__[name] = binding;
96
-
97
- // Call lifecycle hooks
98
- if (directive.created) directive.created(el, binding);
99
- if (directive.beforeMount) directive.beforeMount(el, binding);
100
-
101
- // Defer mounted until DOM is ready
102
- requestAnimationFrame(function() {
103
- if (directive.mounted) directive.mounted(el, binding);
104
- });
105
- };
106
-
107
- // Update directive on element
108
- window.STX.updateDirective = function(el, name, newValue) {
109
- const binding = el.__stx_directives__ && el.__stx_directives__[name];
110
- if (!binding) return;
111
-
112
- const directive = binding.dir;
113
- const oldValue = binding.value;
114
- binding.oldValue = oldValue;
115
- binding.value = newValue;
116
-
117
- if (directive.beforeUpdate) directive.beforeUpdate(el, binding);
118
- if (directive.updated) directive.updated(el, binding);
119
- };
120
-
121
- // Remove directive from element
122
- window.STX.removeDirective = function(el, name) {
123
- const binding = el.__stx_directives__ && el.__stx_directives__[name];
124
- if (!binding) return;
125
-
126
- const directive = binding.dir;
127
- if (directive.beforeUnmount) directive.beforeUnmount(el, binding);
128
- if (directive.unmounted) directive.unmounted(el, binding);
129
-
130
- delete el.__stx_directives__[name];
131
- };
132
-
133
- // Auto-apply directives on page load
134
- document.addEventListener('DOMContentLoaded', function() {
135
- document.querySelectorAll('[data-stx-directive]').forEach(function(el) {
136
- const directives = el.dataset.stxDirective.split(';');
137
- directives.forEach(function(d) {
138
- const [name, value] = d.split(':').map(s => s.trim());
139
- window.STX.applyDirective(el, name, value);
140
- });
141
- });
142
- });
143
-
144
- console.log('[stx] Directive runtime initialized');
145
- })();
146
- `}function $(A){let B=/v-(\w+)(?::(\w+))?(?:\.([\w.]+))?="([^"]*)"/g;return A.replace(B,(C,F,H,L,J)=>{let E=(L?L.split("."):[]).reduce((M,S)=>{return M[S]=!0,M},{});return`data-stx-directive="${F}:${J}" data-stx-directive-arg="${H||""}" data-stx-directive-modifiers='${JSON.stringify(E)}'`})}
147
- export{T as Ps,V as Qs,W as Rs,X as Ss,G as Ts,Y as Us,Z as Vs,_ as Ws,$ as Xs};
@@ -1,4 +0,0 @@
1
- // @bun
2
- import z from"fs";function B(x){return[...x].sort().map((b)=>{try{let j=z.statSync(b);return`${b}:${j.size}:${j.mtimeMs}`}catch{return`${b}:missing`}}).join(`
3
- `)}function C(x,b,j){let q=x.get(b);return q!==void 0&&q.signature===j?q.value:void 0}function D(x,b,j,q){return x.set(b,{signature:j,value:q}),q}
4
- export{B as Ri,C as Si,D as Ti};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{qh as x,vh as M,wh as C,xh as v,yh as P}from"./chunk-pcxp4r9n.js";import{ix as y}from"./chunk-2fw05hs2.js";import{resolve as h,basename as f,extname as u,join as m}from"path";import{mkdir as l}from"fs/promises";var I={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500,cacheVariants:!0,cachePlaceholders:!0};class z{config;constructor(J={}){this.config={...I,...J}}async get(J,Z){return C(J,Z,"image",this.config)}async set(J,Z,Y){return v(J,Z,Y,"image",this.config)}async clear(){return P("image",this.config)}updateConfig(J){this.config={...this.config,...J}}}var H=null;function S(J){if(!H)H=new z(J);else if(J)H.updateConfig(J);return H}async function w(J,Z,Y){let K=Y?{directory:`${Y.outputDir}/../.cache`}:{};return S(K).get(J,Z)}async function Q(J,Z,Y,K){let X=K?{directory:`${K.outputDir}/../.cache`}:{};return S(X).set(J,Z,Y)}async function d(){return S().clear()}async function R(){try{return await import("ts-images")}catch{return null}}function b(J){switch(J){case"quality":return{jpeg:{quality:90,mozjpeg:!0,progressive:!0},png:{compressionLevel:6,palette:!1},webp:{quality:90,effort:6,smartSubsample:!0},avif:{quality:85,effort:6}};case"performance":return{jpeg:{quality:70,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!0},webp:{quality:70,effort:4,smartSubsample:!0},avif:{quality:60,effort:2}};case"web":default:return{jpeg:{quality:82,mozjpeg:!0,progressive:!0},png:{compressionLevel:8,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4}}}}function p(J,Z){let Y=Z?b(Z):b("web"),K=J.formatQuality||{};return{jpeg:{...Y.jpeg,...K.jpeg},png:{...Y.png,...K.png},webp:{...Y.webp,...K.webp},avif:{...Y.avif,...K.avif}}}async function g(J,Z,Y){let K=await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping optimization"),{src:J,processed:!1};let X=await w(J,Z,Y);if(X)return X;try{let N=h(J);if(!await M(N))return{src:J,processed:!1,errors:[`Source file not found: ${J}`]};let L=p(Y,Z.preset),V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await l(V,{recursive:!0});let q=await x(N),U=f(J,u(J)),E=Z.outputFormat?[Z.outputFormat]:Y.defaultFormats||["avif","webp","jpeg"],G={src:J,processed:!0,variants:[],hash:q},j=null;if(Z.transformations&&Z.transformations.length>0)j=await D(N,Z.transformations,K);for(let $ of E){let A=L[$]||{},W=`${U}-${q}.${$}`,_=m(V,W);try{let O=await K.optimizeImage({input:j||N,output:_,format:$,quality:A.quality,progressive:A.progressive});if(O){if(G.variants.push({path:_,url:`${F}/${W}`,width:O.width||0,height:O.height||0,format:$,size:O.outputSize||0}),!G.originalWidth&&O.width)G.originalWidth=O.width,G.originalHeight=O.height}}catch(O){G.errors=G.errors||[],G.errors.push(`Failed to optimize ${$}: ${O}`)}}if(Z.embedThumbhash||Z.placeholder==="thumbhash")try{let $=await K.generateThumbHash(N);G.placeholder=$.dataUrl}catch($){G.errors=G.errors||[],G.errors.push(`Failed to generate thumbhash: ${$}`)}if(Z.useDominantColor)try{let $=await K.generatePlaceholder(N,{strategy:"dominant-color"});G.dominantColor=$.dominantColor}catch($){G.errors=G.errors||[],G.errors.push(`Failed to extract dominant color: ${$}`)}return await Q(J,Z,G,Y),G}catch(N){return{src:J,processed:!1,errors:[`Processing failed: ${N}`]}}}async function n(J,Z,Y,K){let X=await R();if(!X)return{success:!1,error:"ts-images not installed"};try{return{success:!0,size:(await X.optimizeImage({input:J,output:K,format:Z,quality:Y}))?.outputSize}}catch(N){return{success:!1,error:String(N)}}}async function D(J,Z,Y){let K=Y||await R();if(!K)return console.warn("[stx-media] ts-images not installed, skipping transformations"),null;try{let X=await K.decode(J);for(let N of Z){let L=N.options||{};switch(N.type){case"resize":if(L.width||L.height)X=await K.resize(X,{width:L.width,height:L.height,fit:L.fit});break;case"blur":if(L.sigma!==void 0)X=await K.blur(X,L.sigma);break;case"sharpen":if(L.amount!==void 0)X=await K.sharpen(X,L.amount);break;case"grayscale":X=await K.grayscale(X);break;case"rotate":if(L.angle!==void 0)X=await K.rotate(X,L.angle);break;case"flip":X=await K.flip(X);break;case"flop":X=await K.flop(X);break;case"brightness":if(L.value!==void 0)X=await K.brightness(X,L.value);break;case"contrast":if(L.value!==void 0)X=await K.contrast(X,L.value);break;case"saturation":if(L.value!==void 0)X=await K.saturation(X,L.value);break}}return await K.encode(X,"png")}catch(X){return console.error(`[stx-media] Transformation failed: ${X}`),null}}import{resolve as c,basename as i,extname as r,join as o}from"path";import{mkdir as a}from"fs/promises";async function e(){try{return await import("ts-images")}catch{return null}}var s=[320,480,640,768,1024,1280,1536,1920];async function t(J,Z,Y){let K=await e();if(!K)return console.warn("[stx-media] ts-images not installed, skipping responsive generation"),null;let X=c(J);if(!await M(X))return console.warn(`[stx-media] Source file not found: ${J}`),null;try{let N=Z.responsiveWidths||Y.breakpoints||s,L=Z.formats||Y.defaultFormats||["avif","webp","jpeg"],V=Y.outputDir||"dist/images",F=Y.baseUrl||"/images";await a(V,{recursive:!0});let q=await x(X),U=i(J,r(J)),E=Y.formatQuality||{jpeg:{quality:82},png:{quality:80},webp:{quality:82},avif:{quality:75}},G={src:J,byFormat:{},srcsets:{}};for(let $ of L){G.byFormat[$]=[];let A=[];for(let W of N){let _=`${U}-${W}w-${q}.${$}`,O=o(V,_),B=`${F}/${_}`;try{let T=E[$]?.quality||80;if(await M(O)){G.byFormat[$].push({path:O,url:B,width:W,height:0,format:$,size:0}),A.push(`${B} ${W}w`);continue}let k=await K.processImage({input:X,output:O,format:$,quality:T,resize:{width:W}});if(k)G.byFormat[$].push({path:O,url:B,width:W,height:k.height||Math.round(W*(k.height||1)/(k.width||1)),format:$,size:k.outputSize||0}),A.push(`${B} ${W}w`)}catch(T){console.warn(`[stx-media] Failed to generate ${$} at ${W}w: ${T}`)}}G.srcsets[$]=A.join(", ")}let j=Z.placeholder||Y.placeholderStrategy||"thumbhash";if(j!=="none")try{if(j==="thumbhash"){let $=await K.generateThumbHash(X);G.placeholder={dataURL:$.dataUrl,width:$.width||32,height:$.height||32,strategy:"thumbhash"}}else{let $=await K.generatePlaceholder(X,{strategy:j,width:20});G.placeholder={dataURL:$.dataURL,width:$.width,height:$.height,strategy:j}}}catch($){console.warn(`[stx-media] Failed to generate placeholder: ${$}`)}return G.sizes=Z.sizes||JJ(N),G}catch(N){return console.error(`[stx-media] Responsive generation failed: ${N}`),null}}function JJ(J){let Z=[...J].sort((K,X)=>K-X),Y=[];for(let K=0;K<Z.length-1;K++){let X=Z[K];Y.push(`(max-width: ${X}px) ${X}px`)}return Y.push(`${Z[Z.length-1]}px`),Y.join(", ")}function KJ(J,Z="width"){if(!J||J.length===0)return"";if(Z==="dpr")return J.filter((Y)=>Y.dpr).map((Y)=>`${Y.url} ${Y.dpr}x`).join(", ");return J.map((Y)=>`${Y.url} ${Y.width}w`).join(", ")}export{z as Yg,w as Zg,Q as _g,d as $g,g as ah,n as bh,D as ch,t as dh,KJ as eh};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import G from"path";var L=new Set([".jpg",".jpeg",".png",".gif"]),O=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function M(j,z){let H=z.formats??O;if(!z.publicDir)return j;let C=N(j),J=[],Y=/<img\b[^>]*?>/gi,K=[],Q;while((Q=Y.exec(j))!==null){let q=Q[0],y=q.match(/\bsrc=["']([^"']+)["']/i);if(!y)continue;if(_(Q.index,C))continue;K.push({idx:Q.index,length:q.length,src:y[1],raw:q})}if(K.length===0)return j;let Z=await Promise.all(K.map(async(q)=>{let y=await X(q.src,z.publicDir,H);return{match:q,sources:y}}));for(let{match:q,sources:y}of Z){if(y.length===0)continue;let I=`<picture>${y.map(($)=>`<source type="${$.mime}" srcset="${w($.url)}">`).join("")}${q.raw}</picture>`;J.push({start:q.idx,end:q.idx+q.length,replacement:I})}if(J.length===0)return j;let V="",W=0;for(let q of J)V+=j.slice(W,q.start),V+=q.replacement,W=q.end;return V+=j.slice(W),V}async function X(j,z,H){if(!F(j))return[];let C=G.extname(j).toLowerCase();if(!L.has(C))return[];if(!j.startsWith("/"))return[];let J=G.join(z,j.slice(1)),Y=G.dirname(J),K=G.basename(J,C),Q=G.resolve(Y),Z=G.resolve(z);if(!Q.startsWith(Z))return[];let V=G.posix.dirname(j),W=H.map(async(y)=>{let k=G.join(Y,`${K}${y.ext}`);if(!await Bun.file(k).exists())return null;return{url:G.posix.join(V,`${K}${y.ext}`),mime:y.mime}});return(await Promise.all(W)).filter((y)=>y!==null)}function F(j){if(!j)return!1;if(j.startsWith("http://")||j.startsWith("https://"))return!1;if(j.startsWith("//"))return!1;if(j.startsWith("data:"))return!1;return!0}function N(j){let z=[],H=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,C;while((C=H.exec(j))!==null)z.push([C.index,C.index+C[0].length]);return z}function _(j,z){for(let[H,C]of z)if(j>=H&&j<C)return!0;return!1}function w(j){return j.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}
3
- export{M as li};
@@ -1,3 +0,0 @@
1
- // @bun
2
- var G={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",brightRed:"\x1B[91m",brightGreen:"\x1B[92m",brightYellow:"\x1B[93m",brightBlue:"\x1B[94m",brightMagenta:"\x1B[95m",brightCyan:"\x1B[96m",brightWhite:"\x1B[97m"},N={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",inverse:"\x1B[7m",strikethrough:"\x1B[9m"};function W(q,B){return`${G[B]}${q}\x1B[0m`}function O(q,B){return`${N[B]}${q}\x1B[0m`}var I=(q)=>W(q,"red"),E=(q)=>W(q,"green"),R=(q)=>W(q,"yellow"),T=(q)=>W(q,"blue");var Y=(q)=>W(q,"cyan");var $=(q)=>O(q,"bold"),M=(q)=>O(q,"dim");function v(){console.log(""),console.log(Y(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(Y(" \u2551")+$(" \uD83D\uDCD6 STX Story ")+Y("\u2551")),console.log(Y(" \u2551")+M(" Component Showcase & Testing ")+Y("\u2551")),console.log(Y(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log("")}function p(q,B){if(console.log($(" Server running at:")),console.log(""),console.log(` ${M("\u279C")} ${$("Local:")} ${Y(q)}`),B)console.log(` ${M("\u279C")} ${$("Network:")} ${Y(B)}`);console.log("")}function x(q){let B=q>0?"\u2713":"\u25CB",H=q>0?E:R;console.log(` ${H(B)} Found ${$(String(q))} story ${q===1?"file":"files"}`)}function b(q,B){if(console.log(""),console.log(` ${I("\u2717")} ${$(I("Error:"))} ${q}`),B)console.log(` ${M(B)}`);console.log("")}function m(q){console.log(` ${R("\u26A0")} ${R("Warning:")} ${q}`)}function h(q){console.log(` ${T("\u2139")} ${q}`)}function g(q,B,H){console.log(""),console.log(Y(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")),console.log(Y(" \u2551")+$(" Build Complete ")+Y("\u2551")),console.log(Y(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")),console.log(""),console.log(` ${E("\u2713")} Stories: ${$(String(q))}`),console.log(` ${E("\u2713")} Output: ${$(B)}`),console.log(` ${E("\u2713")} Time: ${$(`${H}ms`)}`),console.log("")}function y(){console.log(""),console.log($(" Keyboard Shortcuts:")),console.log(""),console.log(` ${Y("h")} Show this help`),console.log(` ${Y("o")} Open in browser`),console.log(` ${Y("r")} Restart server`),console.log(` ${Y("c")} Clear console`),console.log(` ${Y("q")} Quit`),console.log("")}import _ from"fs";import z from"path";async function c(q){let{root:B,config:H}=q,J=[],L=await w(B,H.storyMatch,H.storyIgnored);for(let Q of L){let K=z.resolve(B,Q),X=U(Q,K);J.push(X)}return J}async function w(q,B,H){let J=[];async function L(Q,K){let X=await _.promises.readdir(Q,{withFileTypes:!0});for(let Z of X){let V=z.join(Q,Z.name),A=z.relative(K,V);if(S(A,H))continue;if(Z.isDirectory())await L(V,K);else if(Z.isFile()){if(C(A,B))J.push(A)}}}return await L(q,q),J}function S(q,B){for(let H of B)if(D(q,H))return!0;return!1}function C(q,B){for(let H of B)if(D(q,H))return!0;return!1}function D(q,B){let H=q.replace(/\\/g,"/"),L=B.replace(/\\/g,"/").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"{{GLOBSTAR}}").replace(/\*/g,"[^/]*").replace(/\?/g,".").replace(/\{\{GLOBSTAR\}\}/g,".*");return L=`^${L}$`,new RegExp(L).test(H)}function U(q,B){let H=z.basename(q,".story.stx");return{id:q.toLowerCase().replace(/\.story\.stx$/,"").replace(/[/\\]/g,"-").replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),path:B,relativePath:q,fileName:H,treeFile:{title:H,path:q}}}function s(q,B){let{root:H,config:J}=q,L=[],Q=_.watch(H,{recursive:!0},async(K,X)=>{if(!X)return;let Z=X.replace(/\\/g,"/");if(!C(Z,J.storyMatch))return;if(S(Z,J.storyIgnored))return;let V=z.resolve(H,Z);try{await _.promises.access(V);let A=U(Z,V);B(K==="rename"?"add":"change",A)}catch{let A=U(Z,V);B("unlink",A)}});return L.push(Q),()=>{for(let K of L)K.close()}}function k(q,B){let H=B.treeFile||{title:B.fileName,path:B.relativePath};if(q.tree.file==="title")return H.title.split("/");if(q.tree.file==="path")return[...B.relativePath.split("/").slice(0,-1),H.title];if(typeof q.tree.file==="function")return q.tree.file(H);return[H.title]}function l(q,B){for(let K of B)K.treePath=k(q,K);let H=(q.tree.groups||[]).map((K)=>({groupConfig:{id:K.id||K.title,title:K.title,include:K.include},treeObject:{}})),J={treeObject:{}};H.push(J);for(let K=0;K<B.length;K++){let X=B[K],Z=F(X,H,J);P(X.treePath,K,Z.treeObject)}let L=q.tree.order==="asc"?(K,X)=>K.localeCompare(X):q.tree.order,Q=[];for(let K of H)if(K===J)Q.push(...j(K.treeObject,L));else if(K.groupConfig&&Object.keys(K.treeObject).length>0)Q.push({group:!0,id:K.groupConfig.id,title:K.groupConfig.title,children:j(K.treeObject,L)});return Q}function F(q,B,H){let J=q.treeFile||{title:q.fileName,path:q.relativePath};for(let L of B)if(L.groupConfig?.include&&L.groupConfig.include(J))return L;return H}function P(q,B,H){let J=H;for(let L=0;L<q.length;L++){let Q=q[L];if(L===q.length-1)if(J[Q]!==void 0){let X=1;while(J[`${Q}-${X}`]!==void 0)X++;J[`${Q}-${X}`]=B}else J[Q]=B;else{if(J[Q]===void 0)J[Q]={};else if(typeof J[Q]==="number"){let X=J[Q];J[Q]={"":X}}J=J[Q]}}}function j(q,B){let H=[];for(let[J,L]of Object.entries(q))if(typeof L==="number")H.push({title:J,index:L});else H.push({title:J,children:j(L,B)});return H.sort((J,L)=>B(J.title,L.title)),H}
3
- export{v as a,p as b,x as c,b as d,m as e,h as f,g,y as h,c as i,s as j,l as k};
@@ -1,33 +0,0 @@
1
- // @bun
2
- import{Ri as T,Si as u,Ti as A}from"./chunk-0c2h69k2.js";import{jl as g,ql as h,wl as b}from"./chunk-de8t7sc9.js";import{Mo as f,Or as I,mm as k,wq as B}from"./chunk-wc66mcn4.js";import{Jv as D,Kv as S}from"./chunk-cj3adc77.js";import{Ov as F}from"./chunk-gbmeh7jg.js";import P from"path";var j=new Map,K=new Map,n=["composables","functions"];function p(z){let H=P.basename(z,".ts");return H==="index"||H==="types"||z.endsWith(".d.ts")}async function r(z){if(z)return P.resolve(z);let H=`<default>:${process.cwd()}`,Y=K.get(H);if(Y!==void 0)return Y;let J=await l();if(J!==null)K.set(H,J);return J}async function l(){let z=await I(),H=z.root||process.cwd(),Y=z.composablesDir;if(Y)return P.resolve(H,Y);for(let J of n){let V=P.resolve(H,J);try{let Z=new Bun.Glob("**/*.ts");for await(let W of Z.scan({cwd:V,absolute:!0}))if(!p(W))return V}catch{}}return null}async function m(z){let H=Array.isArray(z)?z:z?[P.resolve(z)]:(await I())._layerComposableDirs??[await r()].filter((J)=>!!J),Y=new Map;for(let J of H){let V=new Bun.Glob("**/*.ts");try{for await(let Z of V.scan({cwd:J,absolute:!0})){let W=P.relative(J,Z);if(!p(Z)&&!Y.has(W))Y.set(W,Z)}}catch{}}return{key:H.join("\x00"),files:[...Y.values()].sort()}}async function Wq(z){let{files:H}=await m(z),Y=B({loader:"ts",target:"browser",define:k()}),J=[];for(let V of H)try{let Z=await Bun.file(V).text(),W=Y.scan(Z).exports.filter((G)=>G!=="default");if(W.length>0)J.push({file:V,names:W})}catch{}return J}function c(z,H){return new RegExp(`\\b${H.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`).test(z)}function a(z,H,Y){let J=new Map;for(let{file:G,names:$}of z)for(let O of $)if(!J.has(O))J.set(O,G);let V=(G)=>{let $=[];for(let[O,w]of J)if(c(G,O))$.push(w);return $},Z=new Set,W=Y.flatMap(V);while(W.length>0){let G=[];for(let $ of W){if(Z.has($))continue;Z.add($);for(let O of V(H.get($)??""))if(!Z.has(O))G.push(O)}W=G}return Z}async function Yq(z,H,Y){let{key:J,files:V}=await m(z);if(!J)return null;let Z=()=>[...new Set([...V,...V.flatMap((q)=>g(q))])],W=T(Z());if(V.length===0)return A(j,J,W,""),null;V.sort();let G=B({loader:"ts",target:"browser",define:k()}),$=new Map,O=[];for(let q of V)try{let Q=await Bun.file(q).text();$.set(q,Q);let U=G.scan(Q).exports.filter((X)=>X!=="default");if(U.length>0)O.push({file:q,names:U})}catch{$.set(q,"")}let w=H===void 0?new Set(V):a(O,$,Y?[H,...Y]:[H]);if(w.size===0)return null;let _=V.filter((q)=>w.has(q)),M=`${J}\x00${_.join("\x00")}`,v=u(j,M,W);if(v!==void 0)return v||null;let R=[],L=new Set,C=new Set;for(let q of _)try{let Q=$.get(q)??await Bun.file(q).text(),U=P.basename(q,".ts");for(let X of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(X[1])C.add(X[1]);try{for(let X of G.scan(Q).exports)if(X!=="default")L.add(X)}catch{}if(Q=D(Q),h(Q))Q=await b(Q,q,{projectRoot:process.cwd(),externalizeUserModules:!1}),Q=f(Q);Q=S(Q),Q=Q.replace(/^export\s+(default\s+)?/gm,""),Q=G.transformSync(Q),R.push(`// Composable: ${U}
3
- ${Q.trim()}`)}catch(Q){console.warn(`[stx] Failed to load composable ${q}:`,Q)}if(R.length===0||L.size===0)return A(j,M,W,""),null;let t=[...L].map((q)=>` try { if (!(${JSON.stringify(q)} in __c)) __c[${JSON.stringify(q)}] = ${q}; } catch (e) {}`).join(`
4
- `),N=JSON.stringify([...L]),E=R.join(`
5
-
6
- `),d=F.filter((q)=>!C.has(q)&&new RegExp(`\\b${q}\\b`).test(E)).map((q)=>`var ${q} = __stx[${JSON.stringify(q)}];`).join(`
7
- `),y=JSON.stringify(new Bun.CryptoHasher("md5").update(`${N}\x00${E}`).digest("hex").slice(0,12)),x=`;(function(){
8
- var __bundles = window.__stxComposableBundles || (window.__stxComposableBundles = {});
9
- if (__bundles[${y}]) return;
10
- __bundles[${y}] = true;
11
- var __published = window.__stxComposableGlobals || (window.__stxComposableGlobals = {});
12
- window.__composables = window.__composables || {};
13
- var __c = window.__composables;
14
- var __stx = window.stx || {};
15
- ${d}
16
- ${E}
17
- ${t}
18
- var __names = ${N};
19
- for (var __i = 0; __i < __names.length; __i++) {
20
- var __n = __names[__i];
21
- if (!(__n in __c) || __published[__n]) continue;
22
- var __takenByBuiltin = !!(window.stx && __n in window.stx);
23
- if (__takenByBuiltin || __n in window) {
24
- console.warn('[stx] composable "' + __n + '" is not available as a bare identifier: '
25
- + (__takenByBuiltin ? 'a built-in of that name already exists' : 'window already defines that property')
26
- + '. Rename it, or use: import { ' + __n + ' } from "@composables"');
27
- continue;
28
- }
29
- window[__n] = __c[__n];
30
- __published[__n] = true;
31
- }
32
- })();`;return W=T(Z()),A(j,M,W,x),x}function Zq(){j.clear(),K.clear()}
33
- export{Wq as mi,Yq as ni,Zq as oi};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{Eg as I}from"./chunk-ny67c03k.js";import{Or as H}from"./chunk-wc66mcn4.js";import{ix as G}from"./chunk-2fw05hs2.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-h564hgzt.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
3
- export{Q as $e};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Hf as a,If as b,Jf as c,Kf as d,Lf as e,Mf as f,Nf as g,Of as h,Pf as i,Qf as j,Rf as k,Sf as l,Tf as m,Uf as n,Vf as o,Wf as p,Xf as q}from"./chunk-z5rwnnk1.js";import"./chunk-2fw05hs2.js";export{h as resizeAndConvert,f as processImage,d as isSharpAvailable,m as isImageFile,e as isImageBackendAvailable,l as groupVariantsByFormat,o as getTotalSize,n as getMimeType,g as getImageMetadata,k as getFallbackVariant,i as generateSrcSet,j as generateSizes,p as formatSize,q as ImageProcessingError,a as DEFAULT_WIDTHS,c as DEFAULT_QUALITY,b as DEFAULT_FORMATS};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{di as a,ei as b,fi as c,gi as d,hi as e,ii as f,ji as g,ki as h}from"./chunk-27fgag95.js";import"./chunk-9e8t0twa.js";import"./chunk-2fw05hs2.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
@@ -1,3 +0,0 @@
1
- // @bun
2
- import{AsyncLocalStorage as U}from"async_hooks";var V=Symbol.for("stx.runtime-config.scope"),W=globalThis,Q=W[V]??=new U;function b(x,H){return Q.run(x,H)}function A(){return Q.getStore()}function X(){let x=Q.getStore();if(!x)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:x.public},"private",{value:x.private}))}function N(){return X().public}function O(x={},H=process.env){let I=new Set;function E(j,z){if(z===null)return j===null;if(Array.isArray(z))return Array.isArray(j)&&(!z.length||j.every((B)=>z.some((F)=>E(B,F))));if(typeof z==="object")return j!==null&&typeof j==="object"&&!Array.isArray(j)&&Object.entries(z).every(([B,F])=>Object.hasOwn(j,B)&&E(j[B],F));return typeof j===typeof z}function J(j,z){if(j&&typeof j==="object"&&!Array.isArray(j)){if(Object.getPrototypeOf(j)!==Object.prototype&&Object.getPrototypeOf(j)!==null)throw TypeError(`Runtime config ${z.join(".")} must contain JSON values`);let q=Object.create(null);for(let[G,P]of Object.entries(j)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(G)||["constructor","prototype","__proto__"].includes(G))throw TypeError(`Invalid runtime config key: ${G}`);q[G]=J(P,[...z,G])}return Object.freeze(q)}let B=`STX_RUNTIME_${z.map((q)=>q.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(I.has(B))throw TypeError(`Ambiguous runtime config environment key: ${B}`);I.add(B);let F=H[B],K=j;if(F!==void 0){try{K=typeof j==="string"?F:JSON.parse(F)}catch{throw TypeError(`Invalid runtime config override: ${B}`)}if(!E(K,j))throw TypeError(`Wrong runtime config override type: ${B}`)}function M(q){if(q===null||typeof q==="string"||typeof q==="boolean")return q;if(typeof q==="number"&&Number.isFinite(q))return q;if(Array.isArray(q))return Object.freeze(q.map(M));if(q&&typeof q==="object"&&(Object.getPrototypeOf(q)===Object.prototype||Object.getPrototypeOf(q)===null))return Object.freeze(Object.fromEntries(Object.entries(q).map(([G,P])=>[G,M(P)])));throw TypeError(`Runtime config ${z.join(".")} must contain JSON values`)}return M(K)}return Object.freeze({public:J(x.public??{},["public"]),private:J(x.private??{},["private"])})}function Z(x){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(x.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function T(x,H){let I=x.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),E=/<head\b[^>]*>/i.exec(I),J=E?E.index+E[0].length:0;return I.slice(0,J)+Z(H)+I.slice(J)}
3
- export{b as Zt,A as _t,X as $t,N as au,O as bu,Z as cu,T as du};