@stacksjs/stx 0.2.645 → 0.2.648

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/dist/builtins/attrs.js +6 -6
  2. package/dist/builtins/escape.d.ts +0 -11
  3. package/dist/builtins/escape.js +2 -1
  4. package/dist/builtins/safe-image.js +1 -3
  5. package/dist/builtins/stx-image.js +1 -3
  6. package/dist/builtins/stx-link.d.ts +3 -0
  7. package/dist/builtins/stx-link.js +1 -3
  8. package/dist/{chunk-apeyn69a.js → chunk-04kg16qs.js} +4 -4
  9. package/dist/chunk-06w0z1cm.js +31 -0
  10. package/dist/chunk-0en5jwjy.js +2 -0
  11. package/dist/{chunk-ph8dqgr5.js → chunk-0h8tg21j.js} +14 -14
  12. package/dist/{chunk-g2mcw1r4.js → chunk-0jhdrgpr.js} +2 -2
  13. package/dist/chunk-0vkawews.js +21 -0
  14. package/dist/{chunk-hpggz2t4.js → chunk-120ze5ms.js} +3 -3
  15. package/dist/chunk-2a4szpje.js +3 -0
  16. package/dist/chunk-2f17h17f.js +2 -0
  17. package/dist/{chunk-a0ygyftk.js → chunk-2h8ea0we.js} +2 -2
  18. package/dist/{chunk-3ns5k9nf.js → chunk-2jh21f1n.js} +2 -2
  19. package/dist/chunk-2n3pa5gm.js +2 -0
  20. package/dist/{chunk-ktvr45qg.js → chunk-2qbvsvwc.js} +2 -2
  21. package/dist/chunk-354jmw2k.js +3 -0
  22. package/dist/chunk-3b5bphcn.js +2 -0
  23. package/dist/chunk-3p7mk3mw.js +2 -0
  24. package/dist/chunk-3q163st5.js +1312 -0
  25. package/dist/chunk-3zyjqvsq.js +42 -0
  26. package/dist/{chunk-mfd3fca7.js → chunk-481d4kr9.js} +11 -11
  27. package/dist/chunk-4q2dtxdk.js +2 -0
  28. package/dist/{chunk-1t0m4pwg.js → chunk-4yf1w261.js} +2 -2
  29. package/dist/chunk-4yt8tg4j.js +2 -0
  30. package/dist/chunk-52gp2xxk.js +2 -0
  31. package/dist/chunk-55zaxb4s.js +61 -0
  32. package/dist/chunk-57md41g9.js +2 -0
  33. package/dist/chunk-67kj14at.js +2 -0
  34. package/dist/chunk-67xhsacd.js +12 -0
  35. package/dist/{chunk-me1tdtzz.js → chunk-6ajahb2x.js} +3 -3
  36. package/dist/chunk-6ea6az61.js +4 -0
  37. package/dist/chunk-6vh8s0pg.js +2 -0
  38. package/dist/chunk-6vzktvyw.js +2 -0
  39. package/dist/{chunk-r2seygb5.js → chunk-7rta163c.js} +2 -2
  40. package/dist/chunk-84djpte6.js +3 -0
  41. package/dist/chunk-864qtx7y.js +2 -0
  42. package/dist/chunk-88z4wkrj.js +6 -0
  43. package/dist/chunk-89yj6tcd.js +2 -0
  44. package/dist/chunk-8d2f2e42.js +2 -0
  45. package/dist/chunk-8fsq2ynj.js +2 -0
  46. package/dist/chunk-8p9kpfk8.js +4 -0
  47. package/dist/chunk-8tpmz4as.js +2 -0
  48. package/dist/chunk-9121nkpj.js +11 -0
  49. package/dist/{chunk-rmj0n3ss.js → chunk-9p6efb17.js} +1 -1
  50. package/dist/chunk-9szxxgv5.js +2 -0
  51. package/dist/{chunk-4g8zase6.js → chunk-9txn4rvb.js} +2 -2
  52. package/dist/chunk-9x0zt65f.js +2 -0
  53. package/dist/chunk-a2bw46t9.js +2 -0
  54. package/dist/{chunk-gvr10eqb.js → chunk-a3d0g4mr.js} +2 -2
  55. package/dist/chunk-a4sggwcz.js +2 -0
  56. package/dist/chunk-ab7zqtax.js +3 -0
  57. package/dist/{chunk-v1mvbf82.js → chunk-aprhqxky.js} +5 -5
  58. package/dist/chunk-b0hpshvk.js +2 -0
  59. package/dist/chunk-b4fd2dtk.js +2 -0
  60. package/dist/chunk-c1479y92.js +2 -0
  61. package/dist/{chunk-kchphxkm.js → chunk-c1dkh0es.js} +3 -3
  62. package/dist/chunk-c9k40352.js +2 -0
  63. package/dist/{chunk-ahyq08mp.js → chunk-ce6zddpf.js} +3 -3
  64. package/dist/{chunk-9wbtj6tj.js → chunk-dgb4z4kw.js} +2 -2
  65. package/dist/chunk-e87xa4r3.js +4 -0
  66. package/dist/chunk-egg54kd0.js +12 -0
  67. package/dist/chunk-embejqx4.js +2 -0
  68. package/dist/chunk-er60h3j3.js +2 -0
  69. package/dist/{chunk-pp6ycfay.js → chunk-ewcrsyr7.js} +2 -2
  70. package/dist/chunk-eyfxw7ds.js +2 -0
  71. package/dist/chunk-f3y4fnaa.js +2 -0
  72. package/dist/chunk-f46ht5kq.js +20 -0
  73. package/dist/chunk-f7930sce.js +2 -0
  74. package/dist/chunk-fcn71bq1.js +2 -0
  75. package/dist/{chunk-38ngmh6h.js → chunk-fg3jw17w.js} +48 -48
  76. package/dist/chunk-fsbjat59.js +2 -0
  77. package/dist/chunk-g2jmwh7p.js +2 -0
  78. package/dist/chunk-g8r0km7g.js +106 -0
  79. package/dist/{chunk-qa625vwc.js → chunk-gv793yqq.js} +4 -4
  80. package/dist/chunk-gz90fqn8.js +2 -0
  81. package/dist/chunk-h15xb2vd.js +2 -0
  82. package/dist/chunk-h5nmf98w.js +2 -0
  83. package/dist/{chunk-w9zxb26s.js → chunk-hfpv56cp.js} +1 -1
  84. package/dist/chunk-hhmj9gpk.js +2 -0
  85. package/dist/chunk-hjm69qnj.js +2 -0
  86. package/dist/chunk-hvtzw1jh.js +2 -0
  87. package/dist/{chunk-4n24jbfs.js → chunk-hvzzhkhr.js} +2 -2
  88. package/dist/chunk-j0v970k3.js +2 -0
  89. package/dist/chunk-j393gsfd.js +20 -0
  90. package/dist/chunk-j5gd0e53.js +2 -0
  91. package/dist/chunk-jk41jwsc.js +2 -0
  92. package/dist/{chunk-kvn23sz5.js → chunk-jkaszw24.js} +4 -4
  93. package/dist/{chunk-6mnwvn9v.js → chunk-jkvr7e91.js} +2 -2
  94. package/dist/{chunk-2zcbx82x.js → chunk-jxda11cg.js} +2 -2
  95. package/dist/chunk-k2pa44rf.js +2 -0
  96. package/dist/{chunk-kad2cp0z.js → chunk-k79x96ra.js} +37 -37
  97. package/dist/{chunk-75c46b62.js → chunk-kgfgb971.js} +4 -4
  98. package/dist/chunk-m6qfqkbh.js +2 -0
  99. package/dist/{chunk-r7haw6r7.js → chunk-mmwedr93.js} +5 -5
  100. package/dist/chunk-mnp8ecj9.js +2 -0
  101. package/dist/{chunk-dyg6sadv.js → chunk-mrrrngzd.js} +1 -1
  102. package/dist/{chunk-fk1rs7jb.js → chunk-n38yb274.js} +6 -6
  103. package/dist/chunk-ncqh5qe5.js +2 -0
  104. package/dist/chunk-nj1t4g3a.js +25 -0
  105. package/dist/{chunk-3cqxtkqv.js → chunk-np4zm2ph.js} +7 -7
  106. package/dist/{chunk-7jgtphhg.js → chunk-nrvwejdw.js} +5 -5
  107. package/dist/{chunk-c96f3eq5.js → chunk-nt0n0vjm.js} +8 -8
  108. package/dist/chunk-p44kmbdg.js +65 -0
  109. package/dist/chunk-pbtkbe48.js +888 -0
  110. package/dist/{chunk-pf5s5gjp.js → chunk-pg0xzsss.js} +2 -2
  111. package/dist/{chunk-pvfx0dgz.js → chunk-prf164ct.js} +2 -2
  112. package/dist/chunk-pxs7sgnp.js +3 -0
  113. package/dist/chunk-qfe7ps3v.js +18 -0
  114. package/dist/chunk-qm4672dj.js +18 -0
  115. package/dist/{chunk-2bsrmqr8.js → chunk-qv6axke4.js} +2 -2
  116. package/dist/chunk-r1r6311d.js +14 -0
  117. package/dist/{chunk-n54c06wt.js → chunk-r3e6x87d.js} +3 -3
  118. package/dist/chunk-radggg3p.js +49 -0
  119. package/dist/{chunk-zm4s3n4p.js → chunk-rcadtv3x.js} +1 -1
  120. package/dist/{chunk-vbqts5sf.js → chunk-rjh2jwxx.js} +9 -9
  121. package/dist/chunk-sf0wsq74.js +2 -0
  122. package/dist/{chunk-kfq594fh.js → chunk-sgptbhrc.js} +2 -2
  123. package/dist/chunk-shpc1ttk.js +2 -0
  124. package/dist/chunk-sszhz1zh.js +2 -0
  125. package/dist/chunk-szyqxcfj.js +3 -0
  126. package/dist/{chunk-392pj66x.js → chunk-t1k9160w.js} +29 -29
  127. package/dist/{chunk-22hdbqad.js → chunk-t2pzy3x1.js} +3 -3
  128. package/dist/chunk-t6yjxhn8.js +2 -0
  129. package/dist/chunk-t82be9yf.js +2 -0
  130. package/dist/{chunk-g06qzkmp.js → chunk-tre98h62.js} +2 -2
  131. package/dist/{chunk-bsts9pr5.js → chunk-v2x9vzgw.js} +2 -2
  132. package/dist/chunk-vdxjy7j2.js +4 -0
  133. package/dist/{chunk-xbdbn3bf.js → chunk-vmwdt8fr.js} +5 -5
  134. package/dist/{chunk-fqg0espy.js → chunk-vqc4h16r.js} +2 -2
  135. package/dist/chunk-w2zceynt.js +2 -0
  136. package/dist/chunk-weqc0ssb.js +2 -0
  137. package/dist/chunk-wjt0kej9.js +3 -0
  138. package/dist/{chunk-9yk5rasj.js → chunk-wpm58d6p.js} +3 -3
  139. package/dist/{chunk-0zr1zxar.js → chunk-wpmrz872.js} +2 -2
  140. package/dist/chunk-wq6j2h32.js +33 -0
  141. package/dist/chunk-wq712sw1.js +2 -0
  142. package/dist/chunk-x34scshq.js +3 -0
  143. package/dist/{chunk-fb17t651.js → chunk-x5tjb4y4.js} +2 -2
  144. package/dist/chunk-xaa36b0x.js +3 -0
  145. package/dist/chunk-xfzcv0jc.js +2 -0
  146. package/dist/{chunk-dmg8dpah.js → chunk-xm2mee4a.js} +169 -169
  147. package/dist/chunk-xvs04cnp.js +2 -0
  148. package/dist/chunk-y9x4pyp2.js +2 -0
  149. package/dist/chunk-ye8tgmd3.js +2 -0
  150. package/dist/{chunk-febtq3xj.js → chunk-ym41ybz2.js} +6 -6
  151. package/dist/chunk-ymymwzt5.js +3 -0
  152. package/dist/{chunk-wpc04ygt.js → chunk-yq021b3r.js} +11 -11
  153. package/dist/chunk-z8p6tk5z.js +2 -0
  154. package/dist/chunk-zdnc7a4t.js +127 -0
  155. package/dist/chunk-zhf01af3.js +3 -0
  156. package/dist/chunk-zmh9p9aa.js +2 -0
  157. package/dist/{chunk-jtvcxbwd.js → chunk-zqtbtqbq.js} +2 -2
  158. package/dist/chunk-zsgcsqat.js +406 -0
  159. package/dist/chunk-zyqs6a3p.js +2 -0
  160. package/dist/cli.js +62 -62
  161. package/dist/craft-entry.js +2 -2
  162. package/dist/craft.js +2 -2
  163. package/dist/expressions.d.ts +6 -21
  164. package/dist/expressions.js +12 -41
  165. package/dist/forms-validation.d.ts +0 -16
  166. package/dist/forms-validation.js +4 -2
  167. package/dist/forms.js +8 -6
  168. package/dist/i18n.js +6 -4
  169. package/dist/interpolation-context.js +173 -29
  170. package/dist/loops.js +70 -90
  171. package/dist/mustache-span.d.ts +21 -0
  172. package/dist/mustache-span.js +35 -0
  173. package/dist/process.js +4 -3
  174. package/dist/pwa.js +3 -3
  175. package/dist/runtime-injection.js +9 -3
  176. package/dist/server-bindings.js +12 -6
  177. package/dist/ssg.js +28 -28
  178. package/dist/utils.js +1 -2
  179. package/package.json +5 -5
  180. package/dist/chunk-1jgsst0v.js +0 -2
  181. package/dist/chunk-1vrqmdfe.js +0 -2
  182. package/dist/chunk-1vx1ha9v.js +0 -2
  183. package/dist/chunk-1y9jphbg.js +0 -2
  184. package/dist/chunk-22kgdhxy.js +0 -2
  185. package/dist/chunk-2etamr31.js +0 -4
  186. package/dist/chunk-2s49ggrz.js +0 -12
  187. package/dist/chunk-2zbnc6jq.js +0 -2
  188. package/dist/chunk-39beqd1g.js +0 -2
  189. package/dist/chunk-3q5yn5r0.js +0 -6
  190. package/dist/chunk-3tcy2hdt.js +0 -2
  191. package/dist/chunk-3ycbhpa2.js +0 -2
  192. package/dist/chunk-3yqs2ekt.js +0 -2
  193. package/dist/chunk-4mm9ttc7.js +0 -2
  194. package/dist/chunk-4q4vy4g6.js +0 -2
  195. package/dist/chunk-4zapx8zt.js +0 -20
  196. package/dist/chunk-5zkwems4.js +0 -2
  197. package/dist/chunk-6e4es31t.js +0 -3
  198. package/dist/chunk-6hmbzqt8.js +0 -2
  199. package/dist/chunk-7a3kffqy.js +0 -2
  200. package/dist/chunk-7mkw98cr.js +0 -3
  201. package/dist/chunk-7xks65hg.js +0 -3
  202. package/dist/chunk-8k38mddf.js +0 -2
  203. package/dist/chunk-8q05cxzd.js +0 -2
  204. package/dist/chunk-a7y0fk20.js +0 -12
  205. package/dist/chunk-abwxa3tj.js +0 -2
  206. package/dist/chunk-ayjje1hk.js +0 -2
  207. package/dist/chunk-c93291jk.js +0 -2
  208. package/dist/chunk-cf6d5kgb.js +0 -65
  209. package/dist/chunk-crahn5xa.js +0 -4
  210. package/dist/chunk-d1jyxxcm.js +0 -3
  211. package/dist/chunk-d365tseq.js +0 -20
  212. package/dist/chunk-d67qvrzc.js +0 -24
  213. package/dist/chunk-dwnvqy3f.js +0 -4
  214. package/dist/chunk-dxb7jw7g.js +0 -2
  215. package/dist/chunk-e8483tnk.js +0 -2
  216. package/dist/chunk-eaphbqqx.js +0 -2
  217. package/dist/chunk-em0chjea.js +0 -18
  218. package/dist/chunk-ercd4pqc.js +0 -2
  219. package/dist/chunk-ewj4gqwe.js +0 -31
  220. package/dist/chunk-f7bgg2e4.js +0 -2
  221. package/dist/chunk-g6s0xdgb.js +0 -4
  222. package/dist/chunk-jxsgky4v.js +0 -2
  223. package/dist/chunk-k90yzxwp.js +0 -2
  224. package/dist/chunk-kfx4cte8.js +0 -127
  225. package/dist/chunk-kxbw0e2f.js +0 -3
  226. package/dist/chunk-ky043mkv.js +0 -2
  227. package/dist/chunk-mbqqc20a.js +0 -2
  228. package/dist/chunk-mq2kpg6w.js +0 -2
  229. package/dist/chunk-n58ky78d.js +0 -2
  230. package/dist/chunk-n80wh9b5.js +0 -2
  231. package/dist/chunk-p7sfjgtm.js +0 -2
  232. package/dist/chunk-ps9htxmp.js +0 -2
  233. package/dist/chunk-qhaw7f32.js +0 -2
  234. package/dist/chunk-rh33ra9e.js +0 -2
  235. package/dist/chunk-rzs2hpqa.js +0 -2
  236. package/dist/chunk-s3sckkvv.js +0 -2
  237. package/dist/chunk-s89pq4v1.js +0 -2
  238. package/dist/chunk-sdqgmcbk.js +0 -2
  239. package/dist/chunk-srmm69d4.js +0 -2852
  240. package/dist/chunk-t00y30w3.js +0 -2
  241. package/dist/chunk-t1a39rpd.js +0 -2
  242. package/dist/chunk-tj4rzy69.js +0 -2
  243. package/dist/chunk-tme51pg1.js +0 -2
  244. package/dist/chunk-tv1qtqab.js +0 -3
  245. package/dist/chunk-twh5ck5w.js +0 -2
  246. package/dist/chunk-v4tt3t1y.js +0 -2
  247. package/dist/chunk-v5ekdsw0.js +0 -2
  248. package/dist/chunk-vdsrae92.js +0 -2
  249. package/dist/chunk-w88mpbxk.js +0 -11
  250. package/dist/chunk-wg6n7txf.js +0 -2
  251. package/dist/chunk-wj4rf7sb.js +0 -2
  252. package/dist/chunk-wrd5me1w.js +0 -33
  253. package/dist/chunk-xbevgwks.js +0 -2
  254. package/dist/chunk-y2k3ynr2.js +0 -2
  255. package/dist/chunk-y51ndrdb.js +0 -2
  256. package/dist/chunk-y9wqzvxt.js +0 -2
  257. package/dist/chunk-yn2d8x8m.js +0 -3
  258. package/dist/chunk-ysmt4jpn.js +0 -2
  259. package/dist/chunk-zmccfvbf.js +0 -2
  260. package/dist/chunk-ztpqxs72.js +0 -2
  261. package/dist/chunk-ztwnn466.js +0 -2
  262. package/dist/chunk-zx7v6a4g.js +0 -40
  263. package/dist/chunk-zx94g4pg.js +0 -2
  264. package/dist/chunk-zze1ez1c.js +0 -2
@@ -0,0 +1,1312 @@
1
+ // @bun
2
+ import{t,a}from"./chunk-55zaxb4s.js";import{n,pn,g}from"./chunk-zsgcsqat.js";import{Je}from"./chunk-gv793yqq.js";import{Xr,Jr}from"./chunk-p44kmbdg.js";import{va,go,Gr,Kr}from"./chunk-04kg16qs.js";import{ha,ya}from"./chunk-e87xa4r3.js";import{yt}from"./chunk-ewcrsyr7.js";import{nn,Ca,tr,nr}from"./chunk-zhf01af3.js";import{p}from"./chunk-2a4szpje.js";import{Ts}from"./chunk-qv6axke4.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,r={}){let{duration:o,delay:l,ease:s,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
3
+ @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
4
+ @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
5
+ @keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
6
+ @keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(20px); opacity: 0; } }`;case"scale":return`${c==="in"?"transform: scale(0.95); opacity: 0; animation: scaleIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: scale(1); opacity: 1; animation: scaleOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: scale(1); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
7
+ @keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
8
+ @keyframes scaleOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.95); opacity: 0; } }`;case"flip":return`${c==="in"?"transform: perspective(400px) rotateX(-90deg); opacity: 0; animation: flipIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: perspective(400px) rotateX(0); opacity: 1; animation: flipOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: perspective(400px) rotateX(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
9
+ @keyframes flipIn { from { transform: perspective(400px) rotateX(-90deg); opacity: 0; } to { transform: perspective(400px) rotateX(0); opacity: 1; } }
10
+ @keyframes flipOut { from { transform: perspective(400px) rotateX(0); opacity: 1; } to { transform: perspective(400px) rotateX(90deg); opacity: 0; } }`;case"rotate":return`${c==="in"?"transform: rotate(-90deg); opacity: 0; animation: rotateIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: rotate(0); opacity: 1; animation: rotateOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: rotate(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
11
+ @keyframes rotateIn { from { transform: rotate(-90deg); opacity: 0; } to { transform: rotate(0); opacity: 1; } }
12
+ @keyframes rotateOut { from { transform: rotate(0); opacity: 1; } to { transform: rotate(90deg); opacity: 0; } }`;default:return""}}function it(){return`
13
+ <script data-stx-scoped data-stx-run="once">
14
+ // Motion preferences handling
15
+ (function() {
16
+ const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
17
+
18
+ if (prefersReducedMotion) {
19
+ // Apply reduced motion settings
20
+ document.documentElement.style.setProperty('--stx-transition-duration', '0ms');
21
+ document.documentElement.setAttribute('data-reduced-motion', 'true');
22
+ }
23
+ else {
24
+ document.documentElement.setAttribute('data-reduced-motion', 'false');
25
+ }
26
+
27
+ // Listen for changes in preference
28
+ window.matchMedia('(prefers-reduced-motion: reduce)').addEventListener('change', (e) => {
29
+ if (e.matches) {
30
+ document.documentElement.style.setProperty('--stx-transition-duration', '0ms');
31
+ document.documentElement.setAttribute('data-reduced-motion', 'true');
32
+ }
33
+ else {
34
+ document.documentElement.style.setProperty('--stx-transition-duration', '');
35
+ document.documentElement.setAttribute('data-reduced-motion', 'false');
36
+ }
37
+ });
38
+ })();
39
+ </script>
40
+ `}function at(e){return[/@animate\b/,/@transition\b/,/@scroll(?:Animate)?\b/,/@staggered\b/,/@sequence\b/,/@motion\b/,/@animationGroup\b/,/\bstx-transition\b/,/\bstx-(?:fade|scale|flip|rotate|slide|from-|observe)\b/,/data-animate=['"](?:auto|true|false)['"]/].some((o)=>o.test(e))}function ot(e=0.1,r="0px"){return`
41
+ <script data-stx-scoped data-stx-run="always">
42
+ // Intersection Observer for scroll animations
43
+ (function() {
44
+ const initObserver = () => {
45
+ if (!('IntersectionObserver' in window)) {
46
+ // For browsers that don't support IntersectionObserver, show all elements immediately
47
+ const elements = document.querySelectorAll('.stx-observe');
48
+ elements.forEach(el => el.classList.remove('stx-out'));
49
+ return;
50
+ }
51
+
52
+ // Create the observer
53
+ const options = {
54
+ root: null, // Use viewport
55
+ rootMargin: '${r}',
56
+ threshold: ${e}
57
+ };
58
+
59
+ const observer = new IntersectionObserver((entries) => {
60
+ entries.forEach(entry => {
61
+ if (entry.isIntersecting) {
62
+ entry.target.classList.remove('stx-out');
63
+ // Stop observing after animation is triggered
64
+ observer.unobserve(entry.target);
65
+ }
66
+ });
67
+ }, options);
68
+
69
+ // Start observing elements
70
+ const elements = document.querySelectorAll('.stx-observe');
71
+ elements.forEach(el => observer.observe(el));
72
+ };
73
+
74
+ // Initialize observer when DOM is ready
75
+ if (document.readyState === 'loading') {
76
+ document.addEventListener('DOMContentLoaded', initObserver);
77
+ }
78
+ else {
79
+ initObserver();
80
+ }
81
+ })();
82
+ </script>
83
+ `}function lt(){return`
84
+ <style id="stx-animation-base">
85
+ :root {
86
+ --stx-transition-duration: 300ms;
87
+ --stx-transition-delay: 0ms;
88
+ --stx-transition-ease: ease;
89
+ }
90
+
91
+ @media (prefers-reduced-motion: reduce) {
92
+ :root {
93
+ --stx-transition-duration: 0ms;
94
+ }
95
+ }
96
+
97
+ [data-animate="false"] * {
98
+ --stx-transition-duration: 0ms !important;
99
+ animation-duration: 0ms !important;
100
+ transition-duration: 0ms !important;
101
+ }
102
+
103
+ /* Base transition classes */
104
+ .stx-transition {
105
+ transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
106
+ transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
107
+ backface-visibility: hidden; /* Improve animation performance */
108
+ transform-style: preserve-3d; /* Better 3D transforms */
109
+ }
110
+
111
+ /* Fade animations */
112
+ .stx-fade {
113
+ transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
114
+ }
115
+
116
+ .stx-fade.stx-out {
117
+ opacity: 0 !important;
118
+ }
119
+
120
+ /* Scale animations */
121
+ .stx-scale {
122
+ transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
123
+ opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
124
+ }
125
+
126
+ .stx-scale.stx-out {
127
+ transform: scale(0.85) !important;
128
+ opacity: 0 !important;
129
+ }
130
+
131
+ /* Flip animations */
132
+ .stx-flip {
133
+ transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
134
+ opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
135
+ perspective: 600px;
136
+ }
137
+
138
+ .stx-flip.stx-out {
139
+ transform: perspective(600px) rotateX(-90deg) !important;
140
+ opacity: 0 !important;
141
+ }
142
+
143
+ /* Rotate animations */
144
+ .stx-rotate {
145
+ transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
146
+ opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
147
+ }
148
+
149
+ .stx-rotate.stx-out {
150
+ transform: rotate(-90deg) !important;
151
+ opacity: 0 !important;
152
+ }
153
+
154
+ /* Direction-based animations */
155
+ .stx-from-left, .stx-from-right, .stx-from-top, .stx-from-bottom {
156
+ transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
157
+ opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
158
+ }
159
+
160
+ .stx-from-left.stx-out {
161
+ transform: translateX(-30px) !important;
162
+ opacity: 0 !important;
163
+ }
164
+
165
+ .stx-from-right.stx-out {
166
+ transform: translateX(30px) !important;
167
+ opacity: 0 !important;
168
+ }
169
+
170
+ .stx-from-top.stx-out {
171
+ transform: translateY(-30px) !important;
172
+ opacity: 0 !important;
173
+ }
174
+
175
+ .stx-from-bottom.stx-out {
176
+ transform: translateY(30px) !important;
177
+ opacity: 0 !important;
178
+ }
179
+
180
+ /* Generic slide animations */
181
+ .stx-slide {
182
+ transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
183
+ opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
184
+ }
185
+
186
+ .stx-slide.stx-out {
187
+ transform: translateY(30px) !important;
188
+ opacity: 0 !important;
189
+ }
190
+
191
+ /* Scroll animation observer class */
192
+ .stx-observe {
193
+ will-change: opacity, transform;
194
+ transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms),
195
+ transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);
196
+ }
197
+ </style>
198
+ `}function ct(e,r,o={}){let{staggerDelay:l=50,sequence:s=!1}=o;return`
199
+ <script data-stx-scoped data-stx-run="always">
200
+ // Animation Group: ${e}
201
+ (function() {
202
+ const elements = ${JSON.stringify(r)};
203
+ const staggerDelay = ${l};
204
+ const sequence = ${s};
205
+
206
+ function animateGroup() {
207
+ elements.forEach((selector, index) => {
208
+ const element = document.querySelector(selector);
209
+ if (!element) return;
210
+
211
+ const delay = sequence ? index * staggerDelay : 0;
212
+ element.style.setProperty('--stx-transition-delay', delay + 'ms');
213
+
214
+ // For elements using animation keyframes
215
+ element.style.animationDelay = delay + 'ms';
216
+
217
+ // If the element is initially hidden, show it
218
+ if (element.classList.contains('stx-out')) {
219
+ setTimeout(() => {
220
+ element.classList.remove('stx-out');
221
+ }, 10); // Small delay to ensure styles are applied
222
+ }
223
+ });
224
+ }
225
+
226
+ // Run when DOM is fully loaded
227
+ if (document.readyState === 'loading') {
228
+ document.addEventListener('DOMContentLoaded', animateGroup);
229
+ }
230
+ else {
231
+ animateGroup();
232
+ }
233
+ })();
234
+ </script>
235
+ `}var De={name:"transition",handler:(e,r,o,l)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let s=r[0],c=r.length>1?Number.parseInt(r[1],10)||B.duration:B.duration,d=r.length>2?r[2]||B.ease:B.ease,m=r.length>3?Number.parseInt(r[3],10)||B.delay:B.delay,u=r.length>4?r[4]||B.direction:B.direction,f=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=nt(s,{duration:c,delay:m,ease:d,direction:u}),h="stx-transition",v="";if(s==="fade")v="stx-fade";else if(s==="slide")v="stx-slide";else if(s==="scale")v="stx-scale";else if(s==="flip")v="stx-flip";else if(s==="rotate")v="stx-rotate";return`<div id="${f}" class="${h} ${v} ${u==="out"?"stx-out":""}"
236
+ style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${m}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},Pe={name:"scrollAnimate",handler:(e,r,o,l)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let s=r[0],c=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",m=r.length>3?Number.parseFloat(r[3])||0.2:0.2,u=r.length>4?Number.parseInt(r[4],10)||0:0,f=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,h="stx-transition stx-observe stx-out";if(s==="fade")h+=" stx-fade";else if(s==="slide-up"||s==="slide")h+=" stx-from-bottom";else if(s==="slide-down")h+=" stx-from-top";else if(s==="slide-left")h+=" stx-from-right";else if(s==="slide-right")h+=" stx-from-left";else if(s==="scale")h+=" stx-scale";else if(s.includes("-"))h+=` stx-${s}`;else h+=` stx-${s}`;return`<div id="${f}" class="${h}" style="${y}" data-threshold="${m}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},ke={name:"animationGroup",handler:(e,r,o,l)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let s=r[0],c=r.slice(1).map((f)=>f.startsWith("#")||f.startsWith(".")?f:`#${f}`),d=o.staggerDelay||50,m=o.sequence||!0,u=ct(s,c,{staggerDelay:d,sequence:m});return`${e}
237
+ ${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,r,o,l)=>{let s=r.length>0?r[0].toLowerCase()==="true":!0,c=it();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function ua(e,r,o,l){let s=e;if(l.animation?.enabled===!1)return s;let c=o.includes("test")&&o.includes("animation");if(!at(s)&&!c)return s;if(!s.includes('<style id="stx-animation-base">')){let m=lt();s=s.replace("</head>",`${m}
238
+ </head>`)}if(s.includes("stx-observe")){if(!s.includes("Intersection Observer for scroll animations")){let u=ot(),f=s.lastIndexOf("</body>");if(f!==-1)s=s.slice(0,f)+u+`
239
+ `+s.slice(f)}}return s}async function dt(e,r,o,l){let s=r[0]?.replace(/['"]/g,"")||"main",c=Je();if(s!=="main")c=c.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${c}</script>`}var _e={name:"stxRouter",handler:dt,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var ut={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Re(e){let r=e.heatmap;if(!r?.enabled)return"";let o={...ut,...r};return`
240
+ <!-- stx Heatmap - Privacy-Compliant Tracking -->
241
+ <script>
242
+ (function() {
243
+ 'use strict';
244
+
245
+ // Configuration
246
+ var config = ${JSON.stringify({trackMouse:o.trackMouse,trackClicks:o.trackClicks,trackScroll:o.trackScroll,samplingRate:o.samplingRate,honorDnt:o.honorDnt,endpoint:o.endpoint,batchSize:o.batchSize,maxDataPoints:o.maxDataPoints,sessionTimeout:o.sessionTimeout,persistData:o.persistData,storagePrefix:o.storagePrefix,captureAttributes:o.captureAttributes,ignoreSelectors:o.ignoreSelectors,zones:o.zones,debugOverlay:o.debugOverlay,minViewportWidth:o.minViewportWidth,maxViewportWidth:o.maxViewportWidth})};
247
+
248
+ // Check Do Not Track
249
+ if (config.honorDnt && navigator.doNotTrack === '1') {
250
+ return;
251
+ }
252
+
253
+ // Check viewport constraints
254
+ var vw = window.innerWidth;
255
+ if (config.minViewportWidth && vw < config.minViewportWidth) return;
256
+ if (config.maxViewportWidth && vw > config.maxViewportWidth) return;
257
+
258
+ // Session management (anonymous, no cookies)
259
+ var session = {
260
+ sid: Math.random().toString(36).slice(2) + Date.now().toString(36),
261
+ page: location.pathname,
262
+ vw: window.innerWidth,
263
+ vh: window.innerHeight,
264
+ points: [],
265
+ started: Date.now(),
266
+ lastActivity: Date.now()
267
+ };
268
+
269
+ // Throttle helper
270
+ var lastMove = 0;
271
+ function throttle(fn, wait) {
272
+ return function() {
273
+ var now = Date.now();
274
+ if (now - lastMove >= wait) {
275
+ lastMove = now;
276
+ fn.apply(this, arguments);
277
+ }
278
+ };
279
+ }
280
+
281
+ // Get relative coordinates (percentage)
282
+ function getRelativeCoords(e) {
283
+ return {
284
+ x: Math.round((e.clientX / window.innerWidth) * 10000) / 100,
285
+ y: Math.round((e.clientY / window.innerHeight) * 10000) / 100
286
+ };
287
+ }
288
+
289
+ // Check if element should be ignored
290
+ function shouldIgnore(el) {
291
+ if (!el || !config.ignoreSelectors) return false;
292
+ for (var i = 0; i < config.ignoreSelectors.length; i++) {
293
+ if (el.matches && el.matches(config.ignoreSelectors[i])) return true;
294
+ if (el.closest && el.closest(config.ignoreSelectors[i])) return true;
295
+ }
296
+ return false;
297
+ }
298
+
299
+ // Get element selector (simplified, no IDs to preserve privacy)
300
+ function getSelector(el) {
301
+ if (!el || !el.tagName) return null;
302
+ var tag = el.tagName.toLowerCase();
303
+ var classes = el.className && typeof el.className === 'string'
304
+ ? '.' + el.className.trim().split(/\\s+/).slice(0, 2).join('.')
305
+ : '';
306
+ return tag + classes;
307
+ }
308
+
309
+ // Find zone for element
310
+ function findZone(el) {
311
+ if (!config.zones || !el) return null;
312
+ for (var i = 0; i < config.zones.length; i++) {
313
+ var zone = config.zones[i];
314
+ if (el.closest && el.closest(zone.selector)) {
315
+ return zone.id;
316
+ }
317
+ }
318
+ return null;
319
+ }
320
+
321
+ // Capture custom attributes
322
+ function captureAttributes(el) {
323
+ if (!config.captureAttributes || !el) return null;
324
+ var attrs = {};
325
+ var hasAttrs = false;
326
+ for (var i = 0; i < config.captureAttributes.length; i++) {
327
+ var attr = config.captureAttributes[i];
328
+ var value = el.getAttribute && el.getAttribute(attr);
329
+ if (value) {
330
+ attrs[attr] = value;
331
+ hasAttrs = true;
332
+ }
333
+ }
334
+ return hasAttrs ? attrs : null;
335
+ }
336
+
337
+ // Add data point
338
+ function addPoint(point) {
339
+ session.lastActivity = Date.now();
340
+ if (session.points.length >= config.maxDataPoints) {
341
+ session.points.shift();
342
+ }
343
+ session.points.push(point);
344
+
345
+ // Send batch if threshold reached
346
+ if (config.endpoint && session.points.length >= config.batchSize) {
347
+ sendData();
348
+ }
349
+ }
350
+
351
+ // Send data to endpoint
352
+ function sendData() {
353
+ if (!config.endpoint || session.points.length === 0) return;
354
+
355
+ var data = {
356
+ sid: session.sid,
357
+ page: session.page,
358
+ vw: session.vw,
359
+ vh: session.vh,
360
+ points: session.points.splice(0, config.batchSize)
361
+ };
362
+
363
+ // Use sendBeacon for reliability
364
+ if (navigator.sendBeacon) {
365
+ navigator.sendBeacon(config.endpoint, JSON.stringify(data));
366
+ }
367
+ else {
368
+ var xhr = new XMLHttpRequest();
369
+ xhr.open('POST', config.endpoint, true);
370
+ xhr.setRequestHeader('Content-Type', 'application/json');
371
+ xhr.send(JSON.stringify(data));
372
+ }
373
+ }
374
+
375
+ // Mouse move handler
376
+ if (config.trackMouse) {
377
+ document.addEventListener('mousemove', throttle(function(e) {
378
+ if (shouldIgnore(e.target)) return;
379
+ var coords = getRelativeCoords(e);
380
+ addPoint({
381
+ x: coords.x,
382
+ y: coords.y,
383
+ type: 'move',
384
+ t: Date.now(),
385
+ zone: findZone(e.target)
386
+ });
387
+ }, config.samplingRate), { passive: true });
388
+ }
389
+
390
+ // Click handler
391
+ if (config.trackClicks) {
392
+ document.addEventListener('click', function(e) {
393
+ if (shouldIgnore(e.target)) return;
394
+ var coords = getRelativeCoords(e);
395
+ var point = {
396
+ x: coords.x,
397
+ y: coords.y,
398
+ type: 'click',
399
+ t: Date.now(),
400
+ el: getSelector(e.target),
401
+ zone: findZone(e.target)
402
+ };
403
+ var attrs = captureAttributes(e.target);
404
+ if (attrs) point.attrs = attrs;
405
+ addPoint(point);
406
+ }, { passive: true });
407
+ }
408
+
409
+ // Scroll handler
410
+ if (config.trackScroll) {
411
+ var lastScrollDepth = 0;
412
+ document.addEventListener('scroll', throttle(function() {
413
+ var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
414
+ var scrollHeight = document.documentElement.scrollHeight - window.innerHeight;
415
+ var depth = scrollHeight > 0 ? Math.round((scrollTop / scrollHeight) * 100) : 0;
416
+
417
+ // Only track significant scroll changes (every 10%)
418
+ if (Math.abs(depth - lastScrollDepth) >= 10) {
419
+ lastScrollDepth = depth;
420
+ addPoint({
421
+ x: 50,
422
+ y: depth,
423
+ type: 'scroll',
424
+ t: Date.now(),
425
+ depth: depth
426
+ });
427
+ }
428
+ }, config.samplingRate * 2), { passive: true });
429
+ }
430
+
431
+ // Send remaining data on page unload
432
+ window.addEventListener('beforeunload', sendData);
433
+ window.addEventListener('visibilitychange', function() {
434
+ if (document.visibilityState === 'hidden') {
435
+ sendData();
436
+ }
437
+ });
438
+
439
+ // Persist data to localStorage if enabled
440
+ if (config.persistData) {
441
+ var storageKey = config.storagePrefix + '_' + session.page.replace(/\\//g, '_');
442
+
443
+ // Load existing data
444
+ try {
445
+ var stored = localStorage.getItem(storageKey);
446
+ if (stored) {
447
+ var parsed = JSON.parse(stored);
448
+ if (Date.now() - parsed.lastActivity < config.sessionTimeout * 60000) {
449
+ session.points = parsed.points || [];
450
+ }
451
+ }
452
+ }
453
+ catch (e) {}
454
+
455
+ // Save periodically
456
+ setInterval(function() {
457
+ try {
458
+ localStorage.setItem(storageKey, JSON.stringify({
459
+ points: session.points,
460
+ lastActivity: session.lastActivity
461
+ }));
462
+ }
463
+ catch (e) {}
464
+ }, 5000);
465
+ }
466
+
467
+ // Debug overlay
468
+ if (config.debugOverlay) {
469
+ var overlay = document.createElement('div');
470
+ overlay.id = 'stx-heatmap-overlay';
471
+ overlay.style.cssText = 'position:fixed;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:999999;';
472
+ document.body.appendChild(overlay);
473
+
474
+ var canvas = document.createElement('canvas');
475
+ canvas.width = window.innerWidth;
476
+ canvas.height = window.innerHeight;
477
+ canvas.style.cssText = 'width:100%;height:100%;';
478
+ overlay.appendChild(canvas);
479
+ var ctx = canvas.getContext('2d');
480
+
481
+ function renderOverlay() {
482
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
483
+ session.points.forEach(function(p) {
484
+ var x = (p.x / 100) * canvas.width;
485
+ var y = (p.y / 100) * canvas.height;
486
+ ctx.beginPath();
487
+ ctx.arc(x, y, p.type === 'click' ? 8 : 3, 0, Math.PI * 2);
488
+ ctx.fillStyle = p.type === 'click' ? 'rgba(255,0,0,0.5)' : 'rgba(0,0,255,0.2)';
489
+ ctx.fill();
490
+ });
491
+ requestAnimationFrame(renderOverlay);
492
+ }
493
+ renderOverlay();
494
+
495
+ window.addEventListener('resize', function() {
496
+ canvas.width = window.innerWidth;
497
+ canvas.height = window.innerHeight;
498
+ });
499
+ }
500
+
501
+ // Expose API for manual tracking and data export
502
+ window.stxHeatmap = {
503
+ // Get current session data
504
+ getData: function() {
505
+ return {
506
+ sid: session.sid,
507
+ page: session.page,
508
+ vw: session.vw,
509
+ vh: session.vh,
510
+ points: session.points.slice(),
511
+ started: session.started,
512
+ lastActivity: session.lastActivity
513
+ };
514
+ },
515
+ // Export data as JSON
516
+ exportJSON: function() {
517
+ return JSON.stringify(this.getData(), null, 2);
518
+ },
519
+ // Export data as CSV
520
+ exportCSV: function() {
521
+ var data = this.getData();
522
+ var lines = ['x,y,type,timestamp,element,zone,depth'];
523
+ data.points.forEach(function(p) {
524
+ lines.push([p.x, p.y, p.type, p.t, p.el || '', p.zone || '', p.depth || ''].join(','));
525
+ });
526
+ return lines.join('\\n');
527
+ },
528
+ // Manual data send
529
+ flush: function() {
530
+ sendData();
531
+ },
532
+ // Clear data
533
+ clear: function() {
534
+ session.points = [];
535
+ if (config.persistData) {
536
+ var storageKey = config.storagePrefix + '_' + session.page.replace(/\\//g, '_');
537
+ try { localStorage.removeItem(storageKey); }
538
+ catch (e) {}
539
+ }
540
+ },
541
+ // Add custom event
542
+ track: function(type, data) {
543
+ addPoint({
544
+ x: data && data.x || 0,
545
+ y: data && data.y || 0,
546
+ type: type,
547
+ t: Date.now(),
548
+ attrs: data
549
+ });
550
+ },
551
+ // Generate heatmap visualization
552
+ visualize: function(options) {
553
+ options = options || {};
554
+ var data = this.getData();
555
+ var width = options.width || data.vw;
556
+ var height = options.height || data.vh;
557
+ var radius = options.radius || 20;
558
+ var blur = options.blur || 15;
559
+ var maxOpacity = options.maxOpacity || 0.6;
560
+
561
+ var canvas = document.createElement('canvas');
562
+ canvas.width = width;
563
+ canvas.height = height;
564
+ var ctx = canvas.getContext('2d');
565
+
566
+ // Create heat points
567
+ data.points.forEach(function(p) {
568
+ var x = (p.x / 100) * width;
569
+ var y = (p.y / 100) * height;
570
+ var intensity = p.type === 'click' ? 1 : 0.3;
571
+
572
+ var gradient = ctx.createRadialGradient(x, y, 0, x, y, radius);
573
+ gradient.addColorStop(0, 'rgba(255,0,0,' + intensity + ')');
574
+ gradient.addColorStop(1, 'rgba(255,0,0,0)');
575
+ ctx.fillStyle = gradient;
576
+ ctx.fillRect(x - radius, y - radius, radius * 2, radius * 2);
577
+ });
578
+
579
+ // Apply blur
580
+ ctx.filter = 'blur(' + blur + 'px)';
581
+ ctx.drawImage(canvas, 0, 0);
582
+ ctx.filter = 'none';
583
+
584
+ // Colorize
585
+ var imageData = ctx.getImageData(0, 0, width, height);
586
+ var pixels = imageData.data;
587
+ for (var i = 0; i < pixels.length; i += 4) {
588
+ var alpha = pixels[i + 3];
589
+ if (alpha > 0) {
590
+ var ratio = alpha / 255;
591
+ // Gradient: blue -> cyan -> green -> yellow -> red
592
+ if (ratio < 0.25) {
593
+ pixels[i] = 0;
594
+ pixels[i + 1] = Math.round(ratio * 4 * 255);
595
+ pixels[i + 2] = 255;
596
+ }
597
+ else if (ratio < 0.5) {
598
+ pixels[i] = 0;
599
+ pixels[i + 1] = 255;
600
+ pixels[i + 2] = Math.round((1 - (ratio - 0.25) * 4) * 255);
601
+ }
602
+ else if (ratio < 0.75) {
603
+ pixels[i] = Math.round((ratio - 0.5) * 4 * 255);
604
+ pixels[i + 1] = 255;
605
+ pixels[i + 2] = 0;
606
+ }
607
+ else {
608
+ pixels[i] = 255;
609
+ pixels[i + 1] = Math.round((1 - (ratio - 0.75) * 4) * 255);
610
+ pixels[i + 2] = 0;
611
+ }
612
+ pixels[i + 3] = Math.round(alpha * maxOpacity);
613
+ }
614
+ }
615
+ ctx.putImageData(imageData, 0, 0);
616
+
617
+ return canvas;
618
+ }
619
+ };
620
+ })();
621
+ </script>
622
+ `}function da(e,r){let o=Re(r);if(!o)return e;let l=e.lastIndexOf("</body>");if(l!==-1)return e.slice(0,l)+o+e.slice(l);return e+o}var Oe={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,o,l)=>{let s=o.__stx_config||{};if(r.length>0){let c=pt(r.join(" "));s.heatmap={...s.heatmap,...c,enabled:!0}}return Re(s)}};function pt(e){let r={},o=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let l of o){let[s,c]=l.split("="),d=c?.replace(/["']/g,"");switch(s){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Ee(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function Yn(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,o=e.match(r);if(!o)return{data:{},content:e.trim()};let l=o[1],s=e.slice(o[0].length),c={};for(let d of l.split(`
623
+ `)){let m=d.trim();if(!m||m.startsWith("#"))continue;let u=m.indexOf(":");if(u===-1)continue;let f=m.slice(0,u).trim(),y=m.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[f]=y}return{data:c,content:s.trim()}}function Ke(e,r={}){let{gfm:o=!0,breaks:l=!1}=r,s=e,c=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,h,v)=>{let b=c.length,x=h?` class="language-${J(h)}"`:"";return c.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),s=s.replace(/`([^`]*)`/g,(y,h)=>`<code>${J(h)}</code>`),s=s.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),s=s.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),s=s.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),s=s.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),s=s.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),s=s.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),s=s.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),s=s.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/__(.+?)__/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),o)s=s.replace(/~~(.+?)~~/g,"<del>$1</del>");if(s=s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,h,v)=>`<img src="${Ee(v)?J(v):""}" alt="${J(h)}" />`),s=s.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,h,v)=>`<a href="${Ee(v)?J(v):""}">${h}</a>`),s=s.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),s=s.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),s=s.replace(/<\/blockquote>\n<blockquote>/g,`
624
+ `),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),o)s=s.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,h,v)=>{let x=`<tr>${h.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,P=v.trim().split(`
625
+ `).map((S)=>`<tr>${S.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<td>${J(k)}</td>`).join("")}</tr>`).join(`
626
+ `);return`<table>
627
+ <thead>
628
+ ${x}
629
+ </thead>
630
+ <tbody>
631
+ ${P}
632
+ </tbody>
633
+ </table>`});if(o)s=s.replace(/<li>\s*\[\s*\]\s*/g,'<li><input type="checkbox" disabled /> '),s=s.replace(/<li>\s*\[x\]\s*/gi,'<li><input type="checkbox" checked disabled /> ');let d=s.split(`
634
+ `),m=[],u=!1,f=[];for(let y of d){let h=y.trim();if(/^<(?:h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|th|td|hr|div|p)/.test(h)||/^\0CODEBLOCK\d+\0$/.test(h)||h===""){if(u&&f.length>0)m.push(`<p>${f.join(l?`<br />
635
+ `:`
636
+ `)}</p>`),f=[],u=!1;m.push(y)}else u=!0,f.push(h)}if(u&&f.length>0)m.push(`<p>${f.join(l?`<br />
637
+ `:`
638
+ `)}</p>`);if(s=m.join(`
639
+ `),l)s=s.replace(/\n/g,`<br />
640
+ `);for(let y=0;y<c.length;y++)s=s.replace(`\x00CODEBLOCK${y}\x00`,c[y]);return s=s.replace(/<p>\s*<\/p>/g,""),s.trim()}async function pa(e,r,o=""){let l=e,s=[],c=/@markdown(?:\([^)]*\))?/g,d;while((d=c.exec(e))!==null){let m=d.index,u=d[0].match(/@markdown\(([^)]*)\)/),f=u?u[1]:"",y=m+d[0].length,h=1,v=y,b=-1;while(h>0&&v<e.length){let S=e.indexOf("@markdown",v),A=e.indexOf("@endmarkdown",v);if(A===-1)break;if(S!==-1&&S<A&&S!==m){let k=e[S+9];if(k==="("||k===`
641
+ `||k==="\r"||k===" "||k===void 0)h++;v=S+9}else{if(h--,h===0){b=A;break}v=A+12}}if(b===-1)continue;let x=e.slice(y,b),P=e.slice(m,b+12);s.push({fullMatch:P,options:f,content:x,index:m}),c.lastIndex=b+12}for(let{fullMatch:m,options:u,content:f,index:y}of s)try{let h={};if(u)u.split(",").forEach((x)=>{let P=x.trim();if(P)h[P]=!0});let v={gfm:h.gfm??!0,breaks:h.breaks??!1},b=Ke(f.trim(),v);l=l.split(m).join(b)}catch(h){let v=h instanceof Error?h.message:String(h),b=g("Markdown Directive",`Error processing markdown: ${v}`,o,e,y,m);l=l.split(m).join(b)}return l}async function Ie(e,r,o,l){let s={gfm:!0,breaks:!1};return r.forEach((c)=>{let d=c.trim().replace(/['"]/g,"");if(d==="breaks")s.breaks=!0;if(d==="no-gfm")s.gfm=!1}),Ke(e.trim(),s)}var Z=[320,480,640,768,1024,1280,1536,1920,2560],mt=[1,1.5,2,3],te=["avif","webp","jpeg"],gt={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"};function pe(e,r=Z,o={},l){return r.sort((s,c)=>s-c).map((s)=>`${re(e,{...o,w:s,fm:l})} ${s}w`).join(", ")}function Te(e,r,o=mt,l={},s){return o.sort((c,d)=>c-d).map((c)=>{let d=Math.round(r*c);return`${re(e,{...l,w:d,dpr:c,fm:s})} ${c}x`}).join(", ")}function me(e,r="100vw"){if(!e||Object.keys(e).length===0)return r;let l=Object.entries(e).map(([s,c])=>{let d=/^\d+$/.test(s)?`${s}px`:s;return{bp:d,size:c,numericBp:Number.parseInt(d)||0}}).sort((s,c)=>s.numericBp-c.numericBp).map(({bp:s,size:c})=>`(max-width: ${s}) ${c}`);return l.push(r),l.join(", ")}function re(e,r={}){let o=Object.entries(r).filter(([,c])=>c!==void 0&&c!==null).map(([c,d])=>{if(Array.isArray(d))return[c,d.join(",")];return[c,String(d)]});if(o.length===0)return e;let l=o.map(([c,d])=>`${c}=${encodeURIComponent(d)}`).join("&"),s=e.includes("?")?"&":"?";return`${e}${s}${l}`}function ge(e){return gt[e]||"application/octet-stream"}var ft={strategy:"thumbhash",width:20,quality:50,blurLevel:40,transitionDuration:300,easing:"ease-out"},he=`
642
+ .stx-img-placeholder {
643
+ position: relative;
644
+ overflow: hidden;
645
+ background-size: cover;
646
+ background-position: center;
647
+ background-repeat: no-repeat;
648
+ }
649
+
650
+ .stx-img-placeholder img {
651
+ opacity: 0;
652
+ transition: opacity var(--stx-img-transition-duration, 300ms) var(--stx-img-transition-easing, ease-out);
653
+ }
654
+
655
+ .stx-img-placeholder.stx-img-loaded img {
656
+ opacity: 1;
657
+ }
658
+
659
+ .stx-img-blur {
660
+ filter: blur(20px);
661
+ transform: scale(1.1);
662
+ transition: filter var(--stx-img-transition-duration, 300ms) var(--stx-img-transition-easing, ease-out),
663
+ transform var(--stx-img-transition-duration, 300ms) var(--stx-img-transition-easing, ease-out);
664
+ }
665
+
666
+ .stx-img-loaded .stx-img-blur {
667
+ filter: blur(0);
668
+ transform: scale(1);
669
+ }
670
+ `.trim();async function ht(){try{return await import("ts-images")}catch{return null}}async function vt(e,r={}){let o={...ft,...r},l=await ht();if(l)try{return await bt(e,o,l)}catch(s){console.warn(`[stx-media] ts-images placeholder generation failed, using fallback: ${s}`)}return xt(e,o)}async function bt(e,r,o){let{generatePlaceholder:l,generateThumbHash:s}=o,d={blur:"blur",thumbhash:"thumbhash",blurhash:"thumbhash",pixelate:"pixelate","dominant-color":"dominant-color",none:"blur"}[r.strategy]||"blur";if(r.strategy==="thumbhash")return{dataURL:(await s(e)).dataUrl,width:32,height:32,aspectRatio:1,originalWidth:0,originalHeight:0,strategy:"thumbhash"};let m=await l(e,{width:r.width,height:r.height,quality:r.quality,blurLevel:r.blurLevel,strategy:d,base64Encode:!0});return{dataURL:m.dataURL,width:m.width,height:m.height,aspectRatio:m.aspectRatio,originalWidth:m.originalWidth,originalHeight:m.originalHeight,strategy:r.strategy,dominantColor:m.dominantColor,css:m.css}}function xt(e,r){let o=r.width||20,l=r.height||o,s="#e5e7eb",c=`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${l}" viewBox="0 0 ${o} ${l}"><rect fill="#e5e7eb" width="${o}" height="${l}"/></svg>`;return{dataURL:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(c)}`,width:o,height:l,aspectRatio:o/l,originalWidth:0,originalHeight:0,strategy:r.strategy,dominantColor:"#e5e7eb"}}function Me(e,r,o={}){let l=o.transitionDuration||300,s=o.easing||"ease-out";return`
671
+ #${e} {
672
+ --stx-img-transition-duration: ${l}ms;
673
+ --stx-img-transition-easing: ${s};
674
+ background-image: url('${r.dataURL}');
675
+ background-size: cover;
676
+ background-position: center;
677
+ }
678
+
679
+ #${e} img {
680
+ opacity: 0;
681
+ transition: opacity var(--stx-img-transition-duration) var(--stx-img-transition-easing);
682
+ }
683
+
684
+ #${e}.stx-img-loaded img {
685
+ opacity: 1;
686
+ }
687
+ `.trim()}var fe=new Map;async function Ne(e,r={}){let o=`${e}:${JSON.stringify(r)}`;if(fe.has(o))return fe.get(o);let l=await vt(e,r);return fe.set(o,l),l}async function wt(){try{return await import("./chunk-4yt8tg4j.js")}catch(e){if(!je)console.warn("[stx-media] Image processor not available, some features disabled:",e),je=!0;return null}}var je=!1,ye=80,oe="async",le="lazy",Ve=!1;async function ae(e,r={}){let o=r,l=e;if(l.process&&!l.skipOptimization){if(o.tsImagesConfig?.enabled&&!o.isDev)return Dt(l,o)}if(o.processedResult?.processed)return xe(e,o.processedResult,r);if(o.responsiveVariants)return We(e,o.responsiveVariants,r);let{src:s,alt:c,width:d,height:m,sizes:u,widths:f=Z,dpr:y,formats:h=te,quality:v=ye,params:b={},placeholder:x="none",placeholderOptions:P={},lazy:S=!0,priority:A=!1,loading:k=A?"eager":le,decoding:E=oe,fetchpriority:I,objectFit:w,objectPosition:C,crossorigin:D,referrerpolicy:L}=e,{class:W,style:T,id:V}=e,_=e.data||{},{isDev:z=!1,baseUrl:G=""}=r;if(z&&!r.optimize)return Ct(e);let F,O,H=V||`stx-img-${Math.random().toString(36).slice(2,8)}`;if(x!=="none"&&!A)try{F=await Ne(s,{strategy:x,...P}),O=Me(H,F,P)}catch{}let ne=y!==void 0&&d!==void 0,X;if(ne)X=St(e,H,F,r);else X=await $t(e,H,F,r);let ee;if(A){let Ce=h.includes("webp")?"webp":h[0],rt=pe(s,f,{...b,q:v},Ce),st=typeof u==="object"?me(u):u||"100vw";ee=`<link rel="preload" as="image" imagesrcset="${rt}" imagesizes="${st}" />`}let ie=[];if(!Ve&&x!=="none")ie.push(he),Ve=!0;if(O)ie.push(O);let tt=S?Le(H):void 0;return{html:X,preloadLink:ee,css:ie.length>0?ie.join(`
688
+ `):void 0,script:tt}}async function $t(e,r,o,l){let{src:s,alt:c,width:d,height:m,sizes:u,widths:f=Z,formats:y=te,quality:h=ye,params:v={},lazy:b=!0,priority:x=!1,loading:P=x?"eager":le,decoding:S=oe,fetchpriority:A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w}=e,{class:C,style:D}=e,L=e.data||{},W=typeof u==="object"?me(u):u||"100vw",T=[];for(let z of y){let G=pe(s,f,{...v,q:h},z),F=ge(z);if(b&&!x)T.push(` <source type="${F}" data-srcset="${G}" data-sizes="${W}" />`);else T.push(` <source type="${F}" srcset="${G}" sizes="${W}" />`)}let V=ve({src:re(s,{...v,q:h}),alt:c,width:d,height:m,loading:x?void 0:P,decoding:S,fetchpriority:x?"high":A,objectFit:k,objectPosition:E,crossorigin:I,referrerpolicy:w,className:ze(C,o),style:be(D,k,E,o),lazy:b&&!x,data:L}),_;if(o){let z=`background-image: url('${o.dataURL}'); background-size: cover; background-position: center;`;_=`<div id="${r}" class="stx-img-placeholder" style="${z}">
689
+ <picture>
690
+ ${T.join(`
691
+ `)}
692
+ <img ${V} />
693
+ </picture>
694
+ </div>`}else _=`<picture${r?` id="${r}"`:""}>
695
+ ${T.join(`
696
+ `)}
697
+ <img ${V} />
698
+ </picture>`;return _}function St(e,r,o,l){let{src:s,alt:c,width:d,height:m,dpr:u=[1,2,3],quality:f=ye,params:y={},lazy:h=!0,priority:v=!1,loading:b=v?"eager":le,decoding:x=oe,fetchpriority:P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:E}=e,{class:I,style:w}=e,C=e.data||{},D=typeof d==="number"?d:Number.parseInt(String(d),10),L=Te(s,D,u,{...y,q:f}),W=ve({src:re(s,{...y,w:D,q:f}),alt:c,width:d,height:m,loading:v?void 0:b,decoding:x,fetchpriority:v?"high":P,objectFit:S,objectPosition:A,crossorigin:k,referrerpolicy:E,className:ze(I,o),style:be(w,S,A,o),lazy:h&&!v,data:C}),T=h&&!v?`data-srcset="${L}"`:`srcset="${L}"`;if(o){let V=`background-image: url('${o.dataURL}'); background-size: cover; background-position: center;`;return`<div id="${r}" class="stx-img-placeholder" style="${V}">
699
+ <img ${W} ${T} />
700
+ </div>`}return`<img ${r?`id="${r}" `:""}${W} ${T} />`}function Ct(e){let{src:r,alt:o,width:l,height:s,loading:c=le,decoding:d=oe,fetchpriority:m,objectFit:u,objectPosition:f,crossorigin:y,referrerpolicy:h,priority:v=!1}=e,{class:b,style:x,id:P}=e,S=e.data||{};return{html:`<img ${ve({src:r,alt:o,width:l,height:s,loading:v?"eager":c,decoding:d,fetchpriority:v?"high":m,objectFit:u,objectPosition:f,crossorigin:y,referrerpolicy:h,className:b,style:be(x,u,f),id:P,data:S})} />`}}function ve(e){let r=[];if(e.lazy)r.push(`data-src="${U(e.src)}"`),r.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"');else r.push(`src="${U(e.src)}"`);if(r.push(`alt="${U(e.alt)}"`),e.width)r.push(`width="${e.width}"`);if(e.height)r.push(`height="${e.height}"`);if(e.loading)r.push(`loading="${e.loading}"`);if(e.decoding)r.push(`decoding="${e.decoding}"`);if(e.fetchpriority)r.push(`fetchpriority="${e.fetchpriority}"`);if(e.crossorigin)r.push(`crossorigin="${e.crossorigin}"`);if(e.referrerpolicy)r.push(`referrerpolicy="${e.referrerpolicy}"`);if(e.className)r.push(`class="${U(e.className)}"`);if(e.style)r.push(`style="${U(e.style)}"`);if(e.id)r.push(`id="${U(e.id)}"`);if(e.data)for(let[o,l]of Object.entries(e.data))r.push(`data-${o}="${U(l)}"`);if(e.lazy)r.push("data-stx-lazy");return r.join(" ")}function ze(e,r){let o=[];if(e)o.push(e);if(r)o.push("stx-img-blur");return o.join(" ")||""}function be(e,r,o,l){let s=[];if(r)s.push(`object-fit: ${r}`);if(o)s.push(`object-position: ${o}`);if(l)s.push("opacity: 0; transition: opacity 300ms ease-out");if(e)s.push(e);return s.join("; ")}function U(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Le(e){return`
701
+ (function() {
702
+ const container = document.getElementById('${e}');
703
+ if (!container) return;
704
+
705
+ const img = container.querySelector('img[data-stx-lazy]') || container;
706
+ if (!img.dataset.src && !img.dataset.srcset) return;
707
+
708
+ const observer = new IntersectionObserver((entries) => {
709
+ entries.forEach(entry => {
710
+ if (entry.isIntersecting) {
711
+ // Load image
712
+ if (img.dataset.src) img.src = img.dataset.src;
713
+ if (img.dataset.srcset) img.srcset = img.dataset.srcset;
714
+
715
+ // Load sources
716
+ const sources = container.querySelectorAll('source[data-srcset]');
717
+ sources.forEach(source => {
718
+ if (source.dataset.srcset) source.srcset = source.dataset.srcset;
719
+ if (source.dataset.sizes) source.sizes = source.dataset.sizes;
720
+ });
721
+
722
+ // Handle load completion
723
+ img.onload = () => {
724
+ img.style.opacity = '1';
725
+ if (container.classList.contains('stx-img-placeholder')) {
726
+ container.classList.add('stx-img-loaded');
727
+ }
728
+ };
729
+
730
+ observer.disconnect();
731
+ }
732
+ });
733
+ }, { rootMargin: '50px' });
734
+
735
+ observer.observe(container);
736
+ })();
737
+ `.trim()}async function Dt(e,r){let o=await wt();if(!o)return ae({...e,process:!1},r);let l=r.tsImagesConfig;if(e.responsiveWidths&&e.responsiveWidths.length>0||e.widths&&e.widths.length>0||!e.width&&!e.dpr){let c=await o.generateResponsiveVariants(e.src,e,l);if(c)return We(e,c,r)}else{let c=await o.processImage(e.src,e,l);if(c.processed)return xe(e,c,r)}return ae({...e,process:!1},r)}async function xe(e,r,o){let{alt:l,width:s,height:c,lazy:d=!0,priority:m=!1,objectFit:u,objectPosition:f,crossorigin:y,referrerpolicy:h}=e,{class:v,style:b}=e,x=e.id||`stx-img-${Math.random().toString(36).slice(2,8)}`,P=e.data||{},S=r.variants||[],A=S.find((O)=>O.format==="jpeg")||S.find((O)=>O.format==="webp")||S[0],k=A?.url||e.src,E=S.filter((O)=>O.format===(A?.format||"jpeg")).map((O)=>`${O.url} ${O.width}w`).join(", "),I=new Map;for(let O of S){if(!I.has(O.format))I.set(O.format,[]);I.get(O.format).push(O)}let w=[],C=["avif","webp","jpeg","png"];for(let O of C){let H=I.get(O);if(H&&H.length>0){let ne=H.map((ee)=>`${ee.url} ${ee.width}w`).join(", "),X=ge(O);if(d&&!m)w.push(` <source type="${X}" data-srcset="${ne}" />`);else w.push(` <source type="${X}" srcset="${ne}" />`)}}let D=[];if(d&&!m){if(D.push(`data-src="${U(k)}"`),D.push('src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"'),E)D.push(`data-srcset="${E}"`)}else if(D.push(`src="${U(k)}"`),E)D.push(`srcset="${E}"`);D.push(`alt="${U(l)}"`);let L=s||r.originalWidth,W=c||r.originalHeight;if(L)D.push(`width="${L}"`);if(W)D.push(`height="${W}"`);if(!m)D.push(`loading="${d?"lazy":"eager"}"`);if(D.push('decoding="async"'),m)D.push('fetchpriority="high"');if(y)D.push(`crossorigin="${y}"`);if(h)D.push(`referrerpolicy="${h}"`);let T=[];if(u)T.push(`object-fit: ${u}`);if(f)T.push(`object-position: ${f}`);if(r.placeholder&&d)T.push("opacity: 0; transition: opacity 300ms ease-out");if(b)T.push(b);if(T.length>0)D.push(`style="${T.join("; ")}"`);let V=[];if(v)V.push(v);if(r.placeholder)V.push("stx-img-blur");if(V.length>0)D.push(`class="${V.join(" ")}"`);if(d&&!m)D.push("data-stx-lazy");for(let[O,H]of Object.entries(P))D.push(`data-${O}="${U(H)}"`);let _;if(r.placeholder||r.dominantColor&&e.useDominantColor){let O=r.placeholder?`background-image: url('${r.placeholder}'); background-size: cover; background-position: center;`:`background-color: ${r.dominantColor};`;_=`<div id="${x}" class="stx-img-placeholder" style="${O}">
738
+ <picture>
739
+ ${w.join(`
740
+ `)}
741
+ <img ${D.join(" ")} />
742
+ </picture>
743
+ </div>`}else _=`<picture${x?` id="${x}"`:""}>
744
+ ${w.join(`
745
+ `)}
746
+ <img ${D.join(" ")} />
747
+ </picture>`;let z=[];if(r.placeholder)z.push(he);let G=d?Le(x):void 0,F;if(m&&E)F=`<link rel="preload" as="image" imagesrcset="${E}" />`;return{html:_,preloadLink:F,css:z.length>0?z.join(`
748
+ `):void 0,script:G}}async function We(e,r,o){let l={src:r.src,processed:!0,variants:[],placeholder:r.placeholder?.dataURL,originalWidth:r.placeholder?.width,originalHeight:r.placeholder?.height};for(let[s,c]of Object.entries(r.byFormat))if(c)l.variants.push(...c);return xe(e,l,o)}function Pt(){return yt({name:"img",hasEndTag:!1,description:"Render an optimized responsive image with srcset and lazy loading",transform:async(e,r,o,l)=>{let{src:s,alt:c,options:d}=kt(e,r,o);if(!s)return console.warn("@img directive: missing src argument"),"<!-- @img: missing src -->";let m={src:s,alt:c||"",widths:d.widths||Z,formats:d.formats||te,quality:d.quality,sizes:d.sizes,dpr:d.dpr,params:d.params,placeholder:d.placeholder,placeholderOptions:d.placeholderOptions,lazy:d.lazy!==!1,priority:d.priority||!1,loading:d.loading,decoding:d.decoding,fetchpriority:d.fetchpriority,objectFit:d.objectFit,objectPosition:d.objectPosition,class:d.class,style:d.style,id:d.id,width:d.width,height:d.height},u=o.__isDev||!1,f=await ae(m,{isDev:u}),y=f.html;if(f.preloadLink)y=f.preloadLink+`
749
+ `+y;if(f.css)y+=`
750
+ <style>${f.css}</style>`;if(f.script)y+=`
751
+ <script>${f.script}</script>`;return y},defaults:{src:"",alt:"",options:{lazy:!0,placeholder:"none"}}})}function kt(e,r,o){if(r.src)return{src:String(r.src),alt:String(r.alt||""),options:r.options||{}};let l=e.trim();if(l.startsWith("@img(")||l.startsWith("("))l=l.replace(/^@img\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=At(l),c=we(s[0],o)||"",d=we(s[1],o)||"",m={};if(s[2]){let u=we(s[2],o);if(typeof u==="object"&&u!==null)m=u;else if(typeof s[2]==="string")try{m=JSON.parse(s[2])}catch{}}return{src:c,alt:d,options:m}}function At(e){let r=[],o="",l=!1,s="",c=0,d=0;for(let m=0;m<e.length;m++){let u=e[m],f=m>0?e[m-1]:"";if((u==='"'||u==="'"||u==="`")&&f!=="\\"){if(!l)l=!0,s=u;else if(u===s)l=!1,s="";else o+=u;continue}if(!l){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(o.trim()),o="";continue}}o+=u}if(o.trim())r.push(o.trim());return r}function we(e,r){if(typeof e!=="string")return e;let o=e.trim();if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))return o.slice(1,-1);if(!o.startsWith("/")&&!o.startsWith(".")&&!o.startsWith("http")&&!o.startsWith("{")){let l=r[o];if(l!==void 0)return l}if(o.startsWith("{")||o.startsWith("["))try{return JSON.parse(o)}catch{}return o}var Fe=Pt();async function He(){try{return await import("./chunk-b4fd2dtk.js")}catch(e){if(!qe)console.warn("[stx-media] Video processor not available, some features disabled:",e),qe=!0;return null}}var qe=!1,Ue=!0,Be="metadata",_t="https://cdn.jsdelivr.net/npm/ts-video-player@latest/dist/index.min.js";async function ce(e,r={}){let o=r,l=e;if(l.process&&!l.skipProcessing){if(o.tsVideosConfig?.enabled&&!o.isDev)return Tt(l,o)}if(o.processedResult?.processed)return Ye(e,o.processedResult,r);let s;if(l.generatePoster&&l.src&&!e.poster)s=await Mt(l,o);let{src:c,sources:d=[],poster:m,posterPlaceholder:u,controls:f=Ue,autoplay:y=!1,muted:h=!1,loop:v=!1,preload:b=Be,playsinline:x=!0,lazy:P=!0,player:S="native",type:A,width:k,height:E,crossorigin:I,disablePictureInPicture:w=!1,disableRemotePlayback:C=!1}=e,D=s||m,{class:L,style:W}=e,T=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`;if(S==="ts-video")return Ot(e,r);if(A&&A!=="video")return Rt(c||"",A,e);let V=d.length>0?d:c?[{src:c,type:Ge(c)}]:[],_=[`id="${T}"`];if(f)_.push("controls");if(y)_.push("autoplay");if(h)_.push("muted");if(v)_.push("loop");if(x)_.push("playsinline");if(w)_.push("disablepictureinpicture");if(C)_.push("disableremoteplayback");if(I)_.push(`crossorigin="${I}"`);if(P){if(_.push(`data-preload="${b}"`),_.push('preload="none"'),D)_.push(`data-poster="${M(D)}"`);_.push("data-stx-lazy")}else if(_.push(`preload="${b}"`),D)_.push(`poster="${M(D)}"`);if(k)_.push(`width="${k}"`);if(E)_.push(`height="${E}"`);if(L)_.push(`class="${M(L)}"`);if(W)_.push(`style="${M(W)}"`);let z=V.map((O)=>` <source ${P?`data-src="${M(O.src)}"`:`src="${M(O.src)}"`} type="${O.type}"${O.media?` media="${O.media}"`:""} />`).join(`
752
+ `),G=`<video ${_.join(" ")}>
753
+ ${z}
754
+ Your browser does not support the video tag.
755
+ </video>`,F;if(P)F=`
756
+ (function() {
757
+ var video = document.getElementById('${T}');
758
+ if (!video) return;
759
+
760
+ var observer = new IntersectionObserver(function(entries) {
761
+ entries.forEach(function(entry) {
762
+ if (entry.isIntersecting) {
763
+ // Load poster
764
+ if (video.dataset.poster) {
765
+ video.poster = video.dataset.poster;
766
+ delete video.dataset.poster;
767
+ }
768
+
769
+ // Load sources
770
+ var sources = video.querySelectorAll('source[data-src]');
771
+ sources.forEach(function(source) {
772
+ source.src = source.dataset.src;
773
+ delete source.dataset.src;
774
+ });
775
+
776
+ // Set preload
777
+ if (video.dataset.preload) {
778
+ video.preload = video.dataset.preload;
779
+ delete video.dataset.preload;
780
+ }
781
+
782
+ video.load();
783
+ observer.disconnect();
784
+ }
785
+ });
786
+ }, { rootMargin: '50px' });
787
+
788
+ observer.observe(video);
789
+ })();
790
+ `.trim();return{html:G,script:F}}function Rt(e,r,o){let{width:l=640,height:s=360}=o,{class:c,style:d}=o,m=o.id||`stx-embed-${Math.random().toString(36).slice(2,8)}`,u,f=null;switch(r){case"youtube":f=Et(e),u=f?`https://www.youtube-nocookie.com/embed/${f}`:e;break;case"vimeo":f=It(e),u=f?`https://player.vimeo.com/video/${f}`:e;break;case"dailymotion":f=e.split("/").pop()||"",u=`https://www.dailymotion.com/embed/video/${f}`;break;case"twitch":f=e.split("/").pop()||"",u=`https://player.twitch.tv/?video=${f}&parent=${typeof window<"u"?window.location.hostname:"localhost"}`;break;default:u=e}let y=[`id="${m}"`,`src="${M(u)}"`,`width="${l}"`,`height="${s}"`,'frameborder="0"',"allowfullscreen",'allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"'];if(c)y.push(`class="${M(c)}"`);if(d)y.push(`style="${M(d)}"`);if(o.lazy)y.push('loading="lazy"');return{html:`<div class="stx-video-embed" style="position:relative;padding-bottom:56.25%;height:0;overflow:hidden;">
791
+ <iframe ${y.join(" ")} style="position:absolute;top:0;left:0;width:100%;height:100%;"></iframe>
792
+ </div>`}}function Ot(e,r={}){let{src:o,sources:l=[],poster:s,controls:c=!0,autoplay:d=!1,muted:m=!1,loop:u=!1,preload:f="metadata",playsinline:y=!0,lazy:h=!0,width:v,height:b}=e,{class:x,style:P}=e,S=e.id||`ts-video-${Math.random().toString(36).slice(2,8)}`,A={src:l.length>0?l:o,autoplay:d,loop:u,muted:m,playsinline:y,preload:f,poster:s,controls:c,title:e.title},k=["position: relative",v?`width: ${typeof v==="number"?v+"px":v}`:"width: 100%",b?`height: ${typeof b==="number"?b+"px":b}`:"",P||""].filter(Boolean).join("; "),E=`
793
+ <div
794
+ id="${S}"
795
+ class="ts-video-player${x?" "+M(x):""}"
796
+ style="${k}"
797
+ data-ts-video-player
798
+ data-config='${JSON.stringify(A)}'
799
+ ${h?"data-lazy":""}
800
+ >
801
+ <div class="ts-video-player__container">
802
+ ${s?`
803
+ <div class="ts-video-player__placeholder" style="background-image: url('${M(s)}');">
804
+ <button class="ts-video-player__play-button" aria-label="Play video">
805
+ <svg viewBox="0 0 24 24" fill="currentColor" width="64" height="64">
806
+ <path d="M8 5v14l11-7z"/>
807
+ </svg>
808
+ </button>
809
+ </div>
810
+ `:""}
811
+ </div>
812
+ </div>
813
+ `.trim(),I=`
814
+ (function() {
815
+ var container = document.getElementById('${S}');
816
+ if (!container) return;
817
+
818
+ var config = JSON.parse(container.dataset.config || '{}');
819
+ var isLazy = container.hasAttribute('data-lazy');
820
+
821
+ function loadPlayer() {
822
+ if (typeof TSVideoPlayer !== 'undefined') {
823
+ initPlayer();
824
+ return;
825
+ }
826
+
827
+ // Load ts-video-player from CDN
828
+ var script = document.createElement('script');
829
+ script.src = '${_t}';
830
+ script.onload = initPlayer;
831
+ script.onerror = function() {
832
+ console.error('[stx] Failed to load ts-video-player');
833
+ fallbackToNative();
834
+ };
835
+ document.head.appendChild(script);
836
+ }
837
+
838
+ function initPlayer() {
839
+ var player = TSVideoPlayer.createPlayer(container, config);
840
+ if (config.src) {
841
+ player.setSrc(config.src);
842
+ }
843
+ container.__tsVideoPlayer = player;
844
+
845
+ // Remove placeholder
846
+ var placeholder = container.querySelector('.ts-video-player__placeholder');
847
+ if (placeholder) {
848
+ placeholder.style.display = 'none';
849
+ }
850
+ }
851
+
852
+ function fallbackToNative() {
853
+ // Fallback to native video element
854
+ var video = document.createElement('video');
855
+ video.controls = config.controls !== false;
856
+ video.autoplay = config.autoplay;
857
+ video.muted = config.muted;
858
+ video.loop = config.loop;
859
+ video.playsInline = config.playsinline;
860
+ video.preload = config.preload || 'metadata';
861
+ if (config.poster) video.poster = config.poster;
862
+ if (config.src) video.src = typeof config.src === 'string' ? config.src : config.src[0]?.src || config.src[0];
863
+ video.style.width = '100%';
864
+ video.style.height = '100%';
865
+
866
+ var containerEl = container.querySelector('.ts-video-player__container');
867
+ if (containerEl) {
868
+ containerEl.innerHTML = '';
869
+ containerEl.appendChild(video);
870
+ }
871
+ }
872
+
873
+ if (isLazy) {
874
+ var observer = new IntersectionObserver(function(entries) {
875
+ entries.forEach(function(entry) {
876
+ if (entry.isIntersecting) {
877
+ loadPlayer();
878
+ observer.disconnect();
879
+ }
880
+ });
881
+ }, { rootMargin: '50px' });
882
+ observer.observe(container);
883
+ }
884
+ else {
885
+ if (document.readyState === 'loading') {
886
+ document.addEventListener('DOMContentLoaded', loadPlayer);
887
+ }
888
+ else {
889
+ loadPlayer();
890
+ }
891
+ }
892
+
893
+ // Handle play button click
894
+ var playButton = container.querySelector('.ts-video-player__play-button');
895
+ if (playButton) {
896
+ playButton.addEventListener('click', function() {
897
+ loadPlayer();
898
+ var check = setInterval(function() {
899
+ if (container.__tsVideoPlayer && container.__tsVideoPlayer.ready) {
900
+ container.__tsVideoPlayer.play();
901
+ clearInterval(check);
902
+ }
903
+ }, 100);
904
+ });
905
+ }
906
+ })();
907
+ `.trim(),w=`
908
+ .ts-video-player {
909
+ position: relative;
910
+ background: #000;
911
+ }
912
+
913
+ .ts-video-player__container {
914
+ position: relative;
915
+ width: 100%;
916
+ padding-bottom: 56.25%;
917
+ }
918
+
919
+ .ts-video-player__container > * {
920
+ position: absolute;
921
+ top: 0;
922
+ left: 0;
923
+ width: 100%;
924
+ height: 100%;
925
+ }
926
+
927
+ .ts-video-player__placeholder {
928
+ display: flex;
929
+ align-items: center;
930
+ justify-content: center;
931
+ background-color: #1a1a1a;
932
+ background-size: cover;
933
+ background-position: center;
934
+ cursor: pointer;
935
+ }
936
+
937
+ .ts-video-player__play-button {
938
+ display: flex;
939
+ align-items: center;
940
+ justify-content: center;
941
+ width: 80px;
942
+ height: 80px;
943
+ background: rgba(0, 0, 0, 0.7);
944
+ border: none;
945
+ border-radius: 50%;
946
+ color: white;
947
+ cursor: pointer;
948
+ transition: transform 0.2s, background 0.2s;
949
+ }
950
+
951
+ .ts-video-player__play-button:hover {
952
+ transform: scale(1.1);
953
+ background: rgba(0, 0, 0, 0.9);
954
+ }
955
+
956
+ .ts-video-player__play-button svg {
957
+ margin-left: 4px;
958
+ }
959
+ `.trim();return{html:E,script:I,css:w}}function Ge(e){switch(e.split(".").pop()?.toLowerCase()){case"mp4":return"video/mp4";case"webm":return"video/webm";case"ogg":case"ogv":return"video/ogg";case"mov":return"video/quicktime";case"avi":return"video/x-msvideo";case"mkv":return"video/x-matroska";case"m3u8":return"application/x-mpegURL";default:return"video/mp4"}}function Et(e){let r=[/youtube\.com\/watch\?v=([^&]+)/,/youtube\.com\/embed\/([^?]+)/,/youtu\.be\/([^?]+)/,/youtube\.com\/v\/([^?]+)/];for(let o of r){let l=e.match(o);if(l)return l[1]}return null}function It(e){let r=e.match(/vimeo\.com\/(\d+)/);return r?r[1]:null}function M(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}async function Tt(e,r){let o=await He();if(!o)return ce({...e,process:!1},r);let l=r.tsVideosConfig,s=await o.processVideo(e.src,e,l,e.onProcessProgress);if(s.processed)return Ye(e,s,r);return ce({...e,process:!1},r)}async function Mt(e,r){let o=await He();if(!o||!e.src)return;let l=typeof e.generatePoster==="object"?e.generatePoster:{timestamp:0},s=r.tsVideosConfig||{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos"};return(await o.generatePoster(e.src,l,s.outputDir,s.baseUrl||"/videos"))?.url}function Ye(e,r,o){let{controls:l=Ue,autoplay:s=!1,muted:c=!1,loop:d=!1,preload:m=Be,playsinline:u=!0,lazy:f=!0,width:y,height:h,crossorigin:v,disablePictureInPicture:b=!1,disableRemotePlayback:x=!1}=e,{class:P,style:S}=e,A=e.id||`stx-video-${Math.random().toString(36).slice(2,8)}`,k=e.src,E=Ge(k);if(r.transcoded)k=r.transcoded.url,E="video/mp4";let I=r.streaming?.hls||r.streaming?.dash;if(I){if(r.streaming?.hls)k=r.streaming.hls.manifestUrl,E="application/x-mpegURL";else if(r.streaming?.dash)k=r.streaming.dash.manifestUrl,E="application/dash+xml"}let w=r.poster?.url||e.poster,C=[`id="${A}"`];if(l)C.push("controls");if(s)C.push("autoplay");if(c)C.push("muted");if(d)C.push("loop");if(u)C.push("playsinline");if(b)C.push("disablepictureinpicture");if(x)C.push("disableremoteplayback");if(v)C.push(`crossorigin="${v}"`);if(f){if(C.push(`data-preload="${m}"`),C.push('preload="none"'),w)C.push(`data-poster="${M(w)}"`);C.push("data-stx-lazy")}else if(C.push(`preload="${m}"`),w)C.push(`poster="${M(w)}"`);let D=y||r.metadata?.width,L=h||r.metadata?.height;if(D)C.push(`width="${D}"`);if(L)C.push(`height="${L}"`);if(P)C.push(`class="${M(P)}"`);if(S)C.push(`style="${M(S)}"`);let T=` <source ${f?`data-src="${M(k)}"`:`src="${M(k)}"`} type="${E}" />`,V=`<video ${C.join(" ")}>
960
+ ${T}
961
+ Your browser does not support the video tag.
962
+ </video>`;if(r.spriteSheet)V=`<div class="stx-video-wrapper" data-sprite-sheet="${M(r.spriteSheet.url)}" data-sprite-cols="${r.spriteSheet.columns}" data-sprite-interval="${r.spriteSheet.interval}">
963
+ ${V}
964
+ </div>`;let _;if(f)_=`
965
+ (function() {
966
+ var video = document.getElementById('${A}');
967
+ if (!video) return;
968
+
969
+ var observer = new IntersectionObserver(function(entries) {
970
+ entries.forEach(function(entry) {
971
+ if (entry.isIntersecting) {
972
+ // Load poster
973
+ if (video.dataset.poster) {
974
+ video.poster = video.dataset.poster;
975
+ delete video.dataset.poster;
976
+ }
977
+
978
+ // Load sources
979
+ var sources = video.querySelectorAll('source[data-src]');
980
+ sources.forEach(function(source) {
981
+ source.src = source.dataset.src;
982
+ delete source.dataset.src;
983
+ });
984
+
985
+ // Set preload
986
+ if (video.dataset.preload) {
987
+ video.preload = video.dataset.preload;
988
+ delete video.dataset.preload;
989
+ }
990
+
991
+ video.load();
992
+ observer.disconnect();
993
+ }
994
+ });
995
+ }, { rootMargin: '50px' });
996
+
997
+ observer.observe(video);
998
+ })();
999
+ `.trim();let z;if(I)z=`
1000
+ .stx-video-wrapper {
1001
+ position: relative;
1002
+ width: 100%;
1003
+ }
1004
+ .stx-video-wrapper video {
1005
+ width: 100%;
1006
+ height: auto;
1007
+ }
1008
+ `.trim();return{html:V,script:_,css:z}}function Xe(){return yt({name:"video",hasEndTag:!1,description:"Render a video with optional ts-videos processing, streaming, and poster generation",transform:async(e,r,o,l)=>{let{src:s,options:c}=Nt(e,r,o);if(!s)return console.warn("@video directive: missing src argument"),"<!-- @video: missing src -->";let d={src:s,poster:c.poster,controls:c.controls!==!1,autoplay:c.autoplay||!1,muted:c.muted||!1,loop:c.loop||!1,preload:c.preload||"metadata",playsinline:c.playsinline!==!1,lazy:c.lazy!==!1,player:c.player||"native",type:c.type,width:c.width,height:c.height,class:c.class,style:c.style,id:c.id,crossorigin:c.crossorigin,disablePictureInPicture:c.disablePictureInPicture,disableRemotePlayback:c.disableRemotePlayback,title:c.title,quality:c.quality,platform:c.platform,process:c.process,generatePoster:c.generatePoster,streaming:c.streaming,transcode:c.transcode,spriteSheet:c.spriteSheet,waveform:c.waveform},u={isDev:o.__isDev||!1,tsVideosConfig:o.__tsVideosConfig},f=await ce(d,u),y=f.html;if(f.css)y+=`
1009
+ <style>${f.css}</style>`;if(f.script)y+=`
1010
+ <script>${f.script}</script>`;return y},defaults:{src:"",options:{controls:!0,lazy:!0,preload:"metadata"}}})}function Nt(e,r,o){if(r.src)return{src:String(r.src),options:r.options||{}};let l=e.trim();if(l.startsWith("@video(")||l.startsWith("("))l=l.replace(/^@video\(/,"").replace(/^\(/,"").replace(/\)$/,"");let s=jt(l),c=Ze(s[0],o)||"",d={};if(s[1]){let m=Ze(s[1],o);if(typeof m==="object"&&m!==null)d=m;else if(typeof s[1]==="string")try{d=JSON.parse(s[1])}catch{}}return{src:c,options:d}}function jt(e){let r=[],o="",l=!1,s="",c=0,d=0;for(let m=0;m<e.length;m++){let u=e[m],f=m>0?e[m-1]:"";if((u==='"'||u==="'"||u==="`")&&f!=="\\"){if(!l)l=!0,s=u;else if(u===s)l=!1,s="";else o+=u;continue}if(!l){if(u==="{")c++;if(u==="}")c--;if(u==="[")d++;if(u==="]")d--;if(u===","&&c===0&&d===0){r.push(o.trim()),o="";continue}}o+=u}if(o.trim())r.push(o.trim());return r}function Ze(e,r){if(typeof e!=="string")return e;let o=e.trim();if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))return o.slice(1,-1);if(!o.startsWith("/")&&!o.startsWith(".")&&!o.startsWith("http")&&!o.startsWith("{")){let l=r[o];if(l!==void 0)return l}if(o.startsWith("{")||o.startsWith("["))try{return JSON.parse(o)}catch{}return o}var $e=Xe();import Vt from"fs";import q from"path";async function qr(e,r){if(!e.webComponents?.enabled)return[];let o=e.webComponents.components||[],l=[];if(o.length>0){if(e.debug)console.log(`Building ${o.length} web components...`);for(let s of o)try{let c=await zt(s,e,r);if(c)l.push(c)}catch(c){if(console.error(`Error building web component ${s.name}:`,c),e.debug)throw c}}return l}async function zt(e,r,o){let{name:l,file:s,tag:c,extends:d}=e;if(!l||!s||!c)return console.error("Invalid web component configuration, missing required fields:",e),null;let m=null;if(q.isAbsolute(s)&&await n(s))m=s;else if(r.componentsDir){let P=q.join(r.componentsDir,s);if(await n(P))m=P}if(!m)m=await pn(s,process.cwd(),r,o);if(!m)return console.error(`Web component source file not found: ${s}`),null;let u=await Bun.file(m).text();o.add(m);let y=(e.outputFormat||"js")==="ts",h=y?Wt({name:l,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[],attributeTypes:e.attributeTypes||{}}):Lt({name:l,tag:c,baseElement:d,source:u,shadowDOM:e.shadowDOM??!0,template:e.template??!0,styleSource:e.styleSource,attributes:e.attributes||[]}),v=r.webComponents?.outputDir||"dist/web-components";await Vt.promises.mkdir(v,{recursive:!0});let b=y?"ts":"js",x=q.join(v,`${c}.${b}`);if(await Bun.write(x,h),r.debug)console.log(`Built web component ${l} -> ${x}`);return x}function Lt(e){let{name:r,tag:o,baseElement:l="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:m,attributes:u=[]}=e,f=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)f=f.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),f=f.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),f=f.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),f=f.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");let y="";if(m)y=`<link rel="stylesheet" href="${m}">`;return`/**
1011
+ * ${r} Web Component
1012
+ * Auto-generated from stx component
1013
+ */
1014
+ class ${r.replace(/\W/g,"")} extends ${l} {
1015
+ constructor() {
1016
+ super()
1017
+ this._initialized = false
1018
+ ${c?"":"this._slotContent = []"}
1019
+ ${c?'this.attachShadow({ mode: "open" })':""}
1020
+ }
1021
+
1022
+ ${d?`
1023
+ _createTemplate() {
1024
+ const template = document.createElement('template')
1025
+ template.innerHTML = \`${y}${f}\`
1026
+ ${c?"this.shadowRoot.appendChild(template.content.cloneNode(true))":"this.appendChild(template.content.cloneNode(true))"}
1027
+ this._processSlots()
1028
+ }
1029
+ `:`
1030
+ _render() {
1031
+ ${c?"this.shadowRoot.innerHTML":"this.innerHTML"} = \`${y}${f}\`
1032
+ this._processSlots()
1033
+ }
1034
+ `}
1035
+
1036
+ _processSlots() {
1037
+ ${c?`// Shadow DOM handles slot assignment automatically
1038
+ // Listen for slot changes if needed
1039
+ const slots = this.shadowRoot.querySelectorAll('slot')
1040
+ slots.forEach(slot => {
1041
+ slot.addEventListener('slotchange', (e) => {
1042
+ const assignedNodes = slot.assignedNodes()
1043
+ this.dispatchEvent(new CustomEvent('slot-changed', {
1044
+ detail: { slotName: slot.name || 'default', assignedNodes }
1045
+ }))
1046
+ })
1047
+ })`:`// Manual slot processing for non-shadow DOM mode
1048
+ const slots = this.querySelectorAll('[data-slot]')
1049
+
1050
+ // Process named slots
1051
+ slots.forEach(slotEl => {
1052
+ const slotName = slotEl.getAttribute('data-slot')
1053
+ const slottedContent = this._slotContent.filter(
1054
+ node => node.nodeType === Node.ELEMENT_NODE && node.getAttribute('slot') === slotName
1055
+ )
1056
+ if (slottedContent.length > 0) {
1057
+ slotEl.innerHTML = ''
1058
+ slottedContent.forEach(content => slotEl.appendChild(content))
1059
+ }
1060
+ })
1061
+
1062
+ // Process default slot
1063
+ const defaultSlot = this.querySelector('[data-slot=""]') || this.querySelector('[data-default-slot]')
1064
+ if (defaultSlot) {
1065
+ const unslottedContent = this._slotContent.filter(
1066
+ node => node.nodeType !== Node.ELEMENT_NODE || !node.hasAttribute('slot')
1067
+ )
1068
+ if (unslottedContent.length > 0) {
1069
+ defaultSlot.innerHTML = ''
1070
+ unslottedContent.forEach(content => defaultSlot.appendChild(content))
1071
+ }
1072
+ }`}
1073
+ }
1074
+
1075
+ ${u.length>0?`
1076
+ static get observedAttributes() {
1077
+ return [${u.map((h)=>`'${h}'`).join(", ")}]
1078
+ }
1079
+
1080
+ attributeChangedCallback(name, oldValue, newValue) {
1081
+ if (oldValue !== newValue) {
1082
+ this[name] = newValue
1083
+ ${d?"":"if (this._initialized) this._render()"}
1084
+ }
1085
+ }
1086
+ `:""}
1087
+
1088
+ connectedCallback() {
1089
+ if (this._initialized) return
1090
+ ${c?"":"this._slotContent = Array.from(this.childNodes)"}
1091
+ this._initialized = true
1092
+ ${d?"this._createTemplate()":"this._render()"}
1093
+ }
1094
+
1095
+ disconnectedCallback() {
1096
+ // Component removed from the DOM
1097
+ }
1098
+ }
1099
+
1100
+ // Register the web component
1101
+ customElements.define('${o}', ${r.replace(/\W/g,"")})
1102
+ `}function Wt(e){let{name:r,tag:o,baseElement:l="HTMLElement",source:s,shadowDOM:c,template:d,styleSource:m,attributes:u=[],attributeTypes:f={}}=e,y=r.replace(/\W/g,""),h=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,"").trim();if(!c)h=h.replace(/<slot\s+name=["']([^"']+)["']\s*>([\s\S]*?)<\/slot>/gi,'<div data-slot="$1">$2</div>'),h=h.replace(/<slot\s+name=["']([^"']+)["']\s*\/>/gi,'<div data-slot="$1"></div>'),h=h.replace(/<slot\s*>([\s\S]*?)<\/slot>/gi,"<div data-default-slot>$1</div>"),h=h.replace(/<slot\s*\/>/gi,"<div data-default-slot></div>");h=h.replace(/`/g,"\\`").replace(/\$\{/g,"\\${");let v=m?`<link rel="stylesheet" href="${m}">`:"",b=(w)=>{switch(f[w]){case"number":return"number";case"boolean":return"boolean";case"object":return"Record<string, unknown>";default:return"string"}},x=(w)=>w.replace(/-([a-z])/g,(C,D)=>D.toUpperCase()),P=u.map((w)=>` private _${x(w)}: ${b(w)} | null = null;`).join(`
1103
+ `),S=u.map((w)=>{let C=b(w),D=x(w);return`
1104
+ get ${D}(): ${C} | null {
1105
+ return this._${D};
1106
+ }
1107
+
1108
+ set ${D}(value: ${C} | null) {
1109
+ this._${D} = value;
1110
+ if (value !== null) {
1111
+ this.setAttribute('${w}', String(value));
1112
+ }
1113
+ else {
1114
+ this.removeAttribute('${w}');
1115
+ }
1116
+ }`}).join(`
1117
+ `),A=u.length>0?`/**
1118
+ * Props interface for ${r}
1119
+ */
1120
+ export interface ${y}Props {
1121
+ ${u.map((w)=>{let C=b(w);return` ${x(w)}?: ${C};`}).join(`
1122
+ `)}
1123
+ }
1124
+ `:"",k=u.length>0?`
1125
+ static get observedAttributes(): string[] {
1126
+ return [${u.map((w)=>`'${w}'`).join(", ")}];
1127
+ }
1128
+
1129
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {
1130
+ if (oldValue !== newValue) {
1131
+ const camelCase = name.replace(/-([a-z])/g, (_: string, letter: string) => letter.toUpperCase());
1132
+ (this as unknown as Record<string, unknown>)[\`_\${camelCase}\`] = this._parseAttributeValue(name, newValue);
1133
+ ${d?"":"if (this._initialized) this._render();"}
1134
+ }
1135
+ }
1136
+
1137
+ private _parseAttributeValue(name: string, value: string | null): unknown {
1138
+ if (value === null) return null;
1139
+ const typeMap: Record<string, string> = ${JSON.stringify(f)};
1140
+ const type = typeMap[name] || 'string';
1141
+ switch (type) {
1142
+ case 'number': return Number(value);
1143
+ case 'boolean': return value !== 'false' && value !== '0';
1144
+ case 'object': try { return JSON.parse(value); }
1145
+ catch { return value; }
1146
+ default: return value;
1147
+ }
1148
+ }
1149
+ `:"",E=d?`
1150
+ private _createTemplate(): void {
1151
+ const template = document.createElement('template');
1152
+ template.innerHTML = \`${v}${h}\`;
1153
+ ${c?"this.shadowRoot!.appendChild(template.content.cloneNode(true));":"this.appendChild(template.content.cloneNode(true));"}
1154
+ this._processSlots();
1155
+ }`:`
1156
+ private _render(): void {
1157
+ ${c?"this.shadowRoot!.innerHTML":"this.innerHTML"} = \`${v}${h}\`;
1158
+ this._processSlots();
1159
+ }`;return`/**
1160
+ * ${r} Web Component
1161
+ * Auto-generated from stx component (TypeScript)
1162
+ *
1163
+ * @example
1164
+ * \`\`\`html
1165
+ * <${o}></${o}>
1166
+ * \`\`\`
1167
+ */
1168
+
1169
+ /**
1170
+ * Detail type for slot-changed event
1171
+ */
1172
+ interface SlotChangeDetail {
1173
+ slotName: string;
1174
+ assignedNodes: Node[];
1175
+ }
1176
+
1177
+ ${A}
1178
+ /**
1179
+ * ${r} custom element class
1180
+ * @customElement ${o}
1181
+ */
1182
+ export class ${y} extends ${l} {
1183
+ ${P}
1184
+ private _initialized = false;
1185
+ ${c?"":"private _slotContent: Node[] = [];"}
1186
+
1187
+ constructor() {
1188
+ super();
1189
+ ${c?'this.attachShadow({ mode: "open" });':""}
1190
+ }
1191
+ ${E}
1192
+ ${c?`
1193
+ private _processSlots(): void {
1194
+ const slots = this.shadowRoot!.querySelectorAll('slot');
1195
+ slots.forEach((slot) => {
1196
+ slot.addEventListener('slotchange', () => {
1197
+ const assignedNodes = (slot as HTMLSlotElement).assignedNodes();
1198
+ this.dispatchEvent(new CustomEvent<SlotChangeDetail>('slot-changed', {
1199
+ detail: { slotName: slot.getAttribute('name') || 'default', assignedNodes }
1200
+ }));
1201
+ });
1202
+ });
1203
+ }`:`
1204
+ private _processSlots(): void {
1205
+ const slots = this.querySelectorAll('[data-slot]');
1206
+ slots.forEach((slotEl) => {
1207
+ const slotName = slotEl.getAttribute('data-slot');
1208
+ if (slotName) {
1209
+ const slottedContent = this._slotContent.filter(
1210
+ node => node.nodeType === Node.ELEMENT_NODE && (node as Element).getAttribute('slot') === slotName
1211
+ );
1212
+ if (slottedContent.length > 0) {
1213
+ slotEl.innerHTML = '';
1214
+ slottedContent.forEach(content => slotEl.appendChild(content));
1215
+ }
1216
+ }
1217
+ });
1218
+ const defaultSlot = this.querySelector('[data-slot=""]') || this.querySelector('[data-default-slot]');
1219
+ if (defaultSlot) {
1220
+ const unslottedContent = this._slotContent.filter(
1221
+ node => node.nodeType !== Node.ELEMENT_NODE || !(node as Element).hasAttribute('slot')
1222
+ );
1223
+ if (unslottedContent.length > 0) {
1224
+ defaultSlot.innerHTML = '';
1225
+ unslottedContent.forEach(content => defaultSlot.appendChild(content));
1226
+ }
1227
+ }
1228
+ }`}
1229
+ ${k}
1230
+ ${S}
1231
+
1232
+ connectedCallback(): void {
1233
+ if (this._initialized) return;
1234
+ ${c?"":"this._slotContent = Array.from(this.childNodes);"}
1235
+ this._initialized = true;
1236
+ ${d?"this._createTemplate();":"this._render();"}
1237
+ }
1238
+
1239
+ disconnectedCallback(): void {
1240
+ // Component removed from the DOM
1241
+ }
1242
+
1243
+ adoptedCallback(): void {
1244
+ // Component moved to a new document
1245
+ }
1246
+ }
1247
+
1248
+ // Type augmentation for HTMLElementTagNameMap
1249
+ declare global {
1250
+ interface HTMLElementTagNameMap {
1251
+ '${o}': ${y};
1252
+ }
1253
+ }
1254
+
1255
+ // Register the web component
1256
+ customElements.define('${o}', ${y});
1257
+ `}function Ft(e,r){let o=e.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i),l=o?o[1].trim():"",s=r,c=[],d=!0;if(l){let h=l.match(/export\s+default\s+({[\s\S]*})/);if(h)try{let v=h[1],b=v.match(/tag\s*:\s*['"`]([^'"`]+)['"`]/);if(b)s=b[1];let x=v.match(/props\s*:\s*\[([\s\S]*?)\]/);if(x)c=x[1].split(",").map((S)=>S.trim().replace(/['"`]/g,"")).filter((S)=>S.length>0);let P=v.match(/shadowDOM\s*:\s*(true|false)/);if(P)d=P[1]==="true"}catch{}}let m=e.match(/<template\b(?![^>]*\bid\s*=)[^>]*>([\s\S]*?)<\/template>/i),u=m?m[1].trim():"",f=e.match(/<style\b[^>]*>([\s\S]*?)<\/style>/i),y=f?f[1].trim():"";return{tag:s,props:c,template:u,styles:y,script:l,shadowDOM:d}}function qt(e){let{tag:r,props:o,template:l,styles:s,shadowDOM:c}=e,d=r.split("-").map((h)=>h.charAt(0).toUpperCase()+h.slice(1)).join(""),m=l.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${"),u=s.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),f=o.map((h)=>`'${h}'`).join(", "),y=o.map((h)=>`
1258
+ get ${h}() {
1259
+ return this.getAttribute('${h}') || '';
1260
+ }
1261
+ set ${h}(value) {
1262
+ if (value) {
1263
+ this.setAttribute('${h}', value);
1264
+ }
1265
+ else {
1266
+ this.removeAttribute('${h}');
1267
+ }
1268
+ }`).join(`
1269
+ `);return`/**
1270
+ * ${d} Web Component
1271
+ * Auto-generated from SFC
1272
+ */
1273
+ class ${d} extends HTMLElement {
1274
+ constructor() {
1275
+ super();
1276
+ ${c?"this.attachShadow({ mode: 'open' });":""}
1277
+ this._render();
1278
+ }
1279
+
1280
+ static get observedAttributes() {
1281
+ return [${f}];
1282
+ }
1283
+
1284
+ attributeChangedCallback(name, oldValue, newValue) {
1285
+ if (oldValue !== newValue) {
1286
+ this._render();
1287
+ }
1288
+ }
1289
+ ${y}
1290
+
1291
+ _render() {
1292
+ const template = \`${u?`<style>${u}</style>`:""}${m}\`;
1293
+
1294
+ // Interpolate {{ prop }} with attribute values
1295
+ const rendered = template.replace(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (match, prop) => {
1296
+ return this.getAttribute(prop) || '';
1297
+ });
1298
+
1299
+ ${c?"this.shadowRoot.innerHTML = rendered;":"this.innerHTML = rendered;"}
1300
+ }
1301
+
1302
+ connectedCallback() {
1303
+ this._render();
1304
+ }
1305
+ }
1306
+
1307
+ customElements.define('${r}', ${d});
1308
+ `}async function Qe(e,r,o,l){if(r.length<1)return a("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=r[0].replace(/['"]/g,""),d=(o.__stx_options||{}).componentsDir||"components",m=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)]:[q.join(q.dirname(l),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)],u=null;for(let h of m)if(await n(h)){u=await Bun.file(h).text();break}if(!u)return a("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let f=Ft(u,s);return`<script type="module">
1309
+ ${qt(f)}
1310
+ </script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:nn,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},ha,ya,Xr,Jr,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Ts],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let m=j.join(s,"resources","views","pages");if(Q.existsSync(m))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function Rl(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,m=e.root,u=!!m&&m!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${m}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(Ca(e.stateDir),e.stateDir=tr(),e.cachePath=nr(e.cachePath),e.build)e.build.cacheDir=nr(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=nr(e.media.cache.directory);if(e.story)e.story.outDir=nr(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function po(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==Gr(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-zmh9p9aa.js"),{partialsCache:m}=await import("./chunk-f7930sce.js");if(d(),m.clear(),c&&o.configSignature===Kr(o.graph)){let u=c.then(async(f)=>{let y={...o.graph};await go(y,r),de.set(r,{graph:y,signature:Gr(y),configSignature:Kr(y)});let h={...f,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),m=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&m){let v=await po({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await po({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await po({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await va(r,N);u=v.config,de.set(r,{graph:v.graph,signature:Gr(v.graph),configSignature:Kr(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-hhmj9gpk.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-xvs04cnp.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),Rl(u,r),Jt(u,r);let f=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{p.resolve(b,{paths:[r]}),f.push(b)}catch{}}let h=[...u.plugins??[],...f];if(h.length>0){let{pluginManager:v}=await import("./chunk-fcn71bq1.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=p.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
1311
+ `)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(r,s),s.catch(()=>{if(Y.get(r)===s)Y.delete(r)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var R=new Proxy(N,{get(e,r){if(K&&r in K)return K[r];if(!se)i().catch((o)=>{console.warn("[stx] Failed to load config file:",o?.message||o)});return e[r]}});function xp(e){return e}function Sp(e){let r=[],o=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let l=["auto","manual","sections"];if(!l.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let l=["json","yaml","yml","js"];if(!l.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let l=["AA","AAA"];if(!l.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let l=["progressive","islands"];if(!l.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${l.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let l=["none","eager","lazy"];if(!l.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!l.timing||!["before","after"].includes(l.timing))r.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)o.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)o.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let l=["fullscreen","standalone","minimal-ui","browser"];if(!l.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let l=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!l.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.routes){let l=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!l.includes(s.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${l.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let l=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!l.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)o.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)o.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:o}}
1312
+ export{ua,da,Yn,Ke,pa,qr,N,Rl,po,i,R,xp,Sp};