motionary 0.0.0-stage → 6.2.0

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 (374) hide show
  1. package/CHANGELOG.md +803 -0
  2. package/LICENSE +21 -0
  3. package/README.md +218 -2
  4. package/README_ja.md +219 -0
  5. package/README_zh.md +219 -0
  6. package/bin/usa-codemod-5.mjs +79 -0
  7. package/bin/usa-codemod-6.mjs +146 -0
  8. package/dist/chunks/base-BaQV-2ha.cjs +436 -0
  9. package/dist/chunks/base-BaQV-2ha.cjs.map +1 -0
  10. package/dist/chunks/base-C_3cAoRz.js +404 -0
  11. package/dist/chunks/base-C_3cAoRz.js.map +1 -0
  12. package/dist/chunks/bind-B_CTL6Qn.js +22 -0
  13. package/dist/chunks/bind-B_CTL6Qn.js.map +1 -0
  14. package/dist/chunks/bind-Ui43-n2d.cjs +25 -0
  15. package/dist/chunks/bind-Ui43-n2d.cjs.map +1 -0
  16. package/dist/chunks/core-B5T0dhFH.cjs +920 -0
  17. package/dist/chunks/core-B5T0dhFH.cjs.map +1 -0
  18. package/dist/chunks/core-BGAyaY6L.cjs +265 -0
  19. package/dist/chunks/core-BGAyaY6L.cjs.map +1 -0
  20. package/dist/chunks/core-D7cVumUu.js +909 -0
  21. package/dist/chunks/core-D7cVumUu.js.map +1 -0
  22. package/dist/chunks/core-VEBw36QK.js +260 -0
  23. package/dist/chunks/core-VEBw36QK.js.map +1 -0
  24. package/dist/chunks/core-ps8uvYuN.js +181 -0
  25. package/dist/chunks/core-ps8uvYuN.js.map +1 -0
  26. package/dist/chunks/core-zq17EeCI.cjs +185 -0
  27. package/dist/chunks/core-zq17EeCI.cjs.map +1 -0
  28. package/dist/chunks/fx-Bs6IrV4Q.js +109 -0
  29. package/dist/chunks/fx-Bs6IrV4Q.js.map +1 -0
  30. package/dist/chunks/fx-lBGVtQO1.cjs +114 -0
  31. package/dist/chunks/fx-lBGVtQO1.cjs.map +1 -0
  32. package/dist/chunks/generative-D2YyhaeO.js +336 -0
  33. package/dist/chunks/generative-D2YyhaeO.js.map +1 -0
  34. package/dist/chunks/generative-DzIZq-_g.cjs +348 -0
  35. package/dist/chunks/generative-DzIZq-_g.cjs.map +1 -0
  36. package/dist/chunks/gpu-Bu7qwugO.js +380 -0
  37. package/dist/chunks/gpu-Bu7qwugO.js.map +1 -0
  38. package/dist/chunks/gpu-CenK2l6b.cjs +387 -0
  39. package/dist/chunks/gpu-CenK2l6b.cjs.map +1 -0
  40. package/dist/chunks/index-tags-DucKMQr_.js +26 -0
  41. package/dist/chunks/index-tags-DucKMQr_.js.map +1 -0
  42. package/dist/chunks/index-tags-wv0R_vkO.cjs +28 -0
  43. package/dist/chunks/index-tags-wv0R_vkO.cjs.map +1 -0
  44. package/dist/chunks/presets-BYBVJVeP.js +226 -0
  45. package/dist/chunks/presets-BYBVJVeP.js.map +1 -0
  46. package/dist/chunks/presets-CUHys3sK.cjs +233 -0
  47. package/dist/chunks/presets-CUHys3sK.cjs.map +1 -0
  48. package/dist/chunks/registry-CKNLQpwd.js +121 -0
  49. package/dist/chunks/registry-CKNLQpwd.js.map +1 -0
  50. package/dist/chunks/registry-DehBVRDV.cjs +131 -0
  51. package/dist/chunks/registry-DehBVRDV.cjs.map +1 -0
  52. package/dist/chunks/spring-CbvHfVtP.js +219 -0
  53. package/dist/chunks/spring-CbvHfVtP.js.map +1 -0
  54. package/dist/chunks/spring-Dgx187Vh.cjs +232 -0
  55. package/dist/chunks/spring-Dgx187Vh.cjs.map +1 -0
  56. package/dist/chunks/stagger-CCFyhzSw.cjs +86 -0
  57. package/dist/chunks/stagger-CCFyhzSw.cjs.map +1 -0
  58. package/dist/chunks/stagger-DtMKo2SK.js +84 -0
  59. package/dist/chunks/stagger-DtMKo2SK.js.map +1 -0
  60. package/dist/chunks/variants-BhjyddG8.cjs +39 -0
  61. package/dist/chunks/variants-BhjyddG8.cjs.map +1 -0
  62. package/dist/chunks/variants-DRlKVHvu.js +35 -0
  63. package/dist/chunks/variants-DRlKVHvu.js.map +1 -0
  64. package/dist/components/a11y.cjs +276 -0
  65. package/dist/components/a11y.cjs.map +1 -0
  66. package/dist/components/a11y.d.cts +131 -0
  67. package/dist/components/a11y.d.ts +131 -0
  68. package/dist/components/a11y.js +259 -0
  69. package/dist/components/a11y.js.map +1 -0
  70. package/dist/components/angular.cjs +76 -0
  71. package/dist/components/angular.cjs.map +1 -0
  72. package/dist/components/angular.d.cts +1734 -0
  73. package/dist/components/angular.d.ts +1734 -0
  74. package/dist/components/angular.js +70 -0
  75. package/dist/components/angular.js.map +1 -0
  76. package/dist/components/background.cjs +659 -0
  77. package/dist/components/background.cjs.map +1 -0
  78. package/dist/components/background.css +9 -0
  79. package/dist/components/background.d.cts +166 -0
  80. package/dist/components/background.d.ts +166 -0
  81. package/dist/components/background.js +647 -0
  82. package/dist/components/background.js.map +1 -0
  83. package/dist/components/bridge.cjs +154 -0
  84. package/dist/components/bridge.cjs.map +1 -0
  85. package/dist/components/bridge.d.cts +63 -0
  86. package/dist/components/bridge.d.ts +63 -0
  87. package/dist/components/bridge.js +147 -0
  88. package/dist/components/bridge.js.map +1 -0
  89. package/dist/components/cards.cjs +561 -0
  90. package/dist/components/cards.cjs.map +1 -0
  91. package/dist/components/cards.css +6 -0
  92. package/dist/components/cards.d.cts +115 -0
  93. package/dist/components/cards.d.ts +115 -0
  94. package/dist/components/cards.js +554 -0
  95. package/dist/components/cards.js.map +1 -0
  96. package/dist/components/click.cjs +877 -0
  97. package/dist/components/click.cjs.map +1 -0
  98. package/dist/components/click.css +9 -0
  99. package/dist/components/click.d.cts +218 -0
  100. package/dist/components/click.d.ts +218 -0
  101. package/dist/components/click.js +863 -0
  102. package/dist/components/click.js.map +1 -0
  103. package/dist/components/depth.cjs +250 -0
  104. package/dist/components/depth.cjs.map +1 -0
  105. package/dist/components/depth.css +3 -0
  106. package/dist/components/depth.d.cts +86 -0
  107. package/dist/components/depth.d.ts +86 -0
  108. package/dist/components/depth.js +242 -0
  109. package/dist/components/depth.js.map +1 -0
  110. package/dist/components/effects.cjs +2258 -0
  111. package/dist/components/effects.cjs.map +1 -0
  112. package/dist/components/effects.d.cts +545 -0
  113. package/dist/components/effects.d.ts +545 -0
  114. package/dist/components/effects.js +2200 -0
  115. package/dist/components/effects.js.map +1 -0
  116. package/dist/components/feedback.cjs +442 -0
  117. package/dist/components/feedback.cjs.map +1 -0
  118. package/dist/components/feedback.css +7 -0
  119. package/dist/components/feedback.d.cts +144 -0
  120. package/dist/components/feedback.d.ts +144 -0
  121. package/dist/components/feedback.js +433 -0
  122. package/dist/components/feedback.js.map +1 -0
  123. package/dist/components/fx-gpu.cjs +12 -0
  124. package/dist/components/fx-gpu.cjs.map +1 -0
  125. package/dist/components/fx-gpu.d.cts +63 -0
  126. package/dist/components/fx-gpu.d.ts +63 -0
  127. package/dist/components/fx-gpu.js +5 -0
  128. package/dist/components/fx-gpu.js.map +1 -0
  129. package/dist/components/fx.cjs +169 -0
  130. package/dist/components/fx.cjs.map +1 -0
  131. package/dist/components/fx.css +3 -0
  132. package/dist/components/fx.d.cts +114 -0
  133. package/dist/components/fx.d.ts +114 -0
  134. package/dist/components/fx.js +156 -0
  135. package/dist/components/fx.js.map +1 -0
  136. package/dist/components/fx2.cjs +25 -0
  137. package/dist/components/fx2.cjs.map +1 -0
  138. package/dist/components/fx2.d.cts +136 -0
  139. package/dist/components/fx2.d.ts +136 -0
  140. package/dist/components/fx2.js +17 -0
  141. package/dist/components/fx2.js.map +1 -0
  142. package/dist/components/gesture.cjs +209 -0
  143. package/dist/components/gesture.cjs.map +1 -0
  144. package/dist/components/gesture.css +3 -0
  145. package/dist/components/gesture.d.cts +134 -0
  146. package/dist/components/gesture.d.ts +134 -0
  147. package/dist/components/gesture.js +203 -0
  148. package/dist/components/gesture.js.map +1 -0
  149. package/dist/components/interaction.cjs +424 -0
  150. package/dist/components/interaction.cjs.map +1 -0
  151. package/dist/components/interaction.css +8 -0
  152. package/dist/components/interaction.d.cts +115 -0
  153. package/dist/components/interaction.d.ts +115 -0
  154. package/dist/components/interaction.js +416 -0
  155. package/dist/components/interaction.js.map +1 -0
  156. package/dist/components/jsx.cjs +3 -0
  157. package/dist/components/jsx.cjs.map +1 -0
  158. package/dist/components/jsx.d.cts +53 -0
  159. package/dist/components/jsx.d.ts +53 -0
  160. package/dist/components/jsx.js +2 -0
  161. package/dist/components/jsx.js.map +1 -0
  162. package/dist/components/layout.cjs +257 -0
  163. package/dist/components/layout.cjs.map +1 -0
  164. package/dist/components/layout.css +3 -0
  165. package/dist/components/layout.d.cts +99 -0
  166. package/dist/components/layout.d.ts +99 -0
  167. package/dist/components/layout.js +249 -0
  168. package/dist/components/layout.js.map +1 -0
  169. package/dist/components/lazy.cjs +92 -0
  170. package/dist/components/lazy.cjs.map +1 -0
  171. package/dist/components/lazy.d.cts +48 -0
  172. package/dist/components/lazy.d.ts +48 -0
  173. package/dist/components/lazy.js +87 -0
  174. package/dist/components/lazy.js.map +1 -0
  175. package/dist/components/lite.cjs +11095 -0
  176. package/dist/components/lite.cjs.map +1 -0
  177. package/dist/components/lite.d.cts +4 -0
  178. package/dist/components/lite.d.ts +4 -0
  179. package/dist/components/lite.js +10827 -0
  180. package/dist/components/lite.js.map +1 -0
  181. package/dist/components/packs.cjs +192 -0
  182. package/dist/components/packs.cjs.map +1 -0
  183. package/dist/components/packs.css +3 -0
  184. package/dist/components/packs.d.cts +72 -0
  185. package/dist/components/packs.d.ts +72 -0
  186. package/dist/components/packs.js +184 -0
  187. package/dist/components/packs.js.map +1 -0
  188. package/dist/components/page.cjs +824 -0
  189. package/dist/components/page.cjs.map +1 -0
  190. package/dist/components/page.css +11 -0
  191. package/dist/components/page.d.cts +249 -0
  192. package/dist/components/page.d.ts +249 -0
  193. package/dist/components/page.js +799 -0
  194. package/dist/components/page.js.map +1 -0
  195. package/dist/components/perf.cjs +120 -0
  196. package/dist/components/perf.cjs.map +1 -0
  197. package/dist/components/perf.d.cts +98 -0
  198. package/dist/components/perf.d.ts +98 -0
  199. package/dist/components/perf.js +110 -0
  200. package/dist/components/perf.js.map +1 -0
  201. package/dist/components/physics.cjs +448 -0
  202. package/dist/components/physics.cjs.map +1 -0
  203. package/dist/components/physics.css +5 -0
  204. package/dist/components/physics.d.cts +189 -0
  205. package/dist/components/physics.d.ts +189 -0
  206. package/dist/components/physics.js +430 -0
  207. package/dist/components/physics.js.map +1 -0
  208. package/dist/components/react.cjs +96 -0
  209. package/dist/components/react.cjs.map +1 -0
  210. package/dist/components/react.d.cts +18 -0
  211. package/dist/components/react.d.ts +18 -0
  212. package/dist/components/react.js +91 -0
  213. package/dist/components/react.js.map +1 -0
  214. package/dist/components/reveal.cjs +362 -0
  215. package/dist/components/reveal.cjs.map +1 -0
  216. package/dist/components/reveal.css +5 -0
  217. package/dist/components/reveal.d.cts +105 -0
  218. package/dist/components/reveal.d.ts +105 -0
  219. package/dist/components/reveal.js +353 -0
  220. package/dist/components/reveal.js.map +1 -0
  221. package/dist/components/solid.cjs +86 -0
  222. package/dist/components/solid.cjs.map +1 -0
  223. package/dist/components/solid.d.cts +1751 -0
  224. package/dist/components/solid.d.ts +1751 -0
  225. package/dist/components/solid.js +82 -0
  226. package/dist/components/solid.js.map +1 -0
  227. package/dist/components/svelte.cjs +68 -0
  228. package/dist/components/svelte.cjs.map +1 -0
  229. package/dist/components/svelte.d.cts +1733 -0
  230. package/dist/components/svelte.d.ts +1733 -0
  231. package/dist/components/svelte.js +64 -0
  232. package/dist/components/svelte.js.map +1 -0
  233. package/dist/components/svg.cjs +359 -0
  234. package/dist/components/svg.cjs.map +1 -0
  235. package/dist/components/svg.css +3 -0
  236. package/dist/components/svg.d.cts +113 -0
  237. package/dist/components/svg.d.ts +113 -0
  238. package/dist/components/svg.js +347 -0
  239. package/dist/components/svg.js.map +1 -0
  240. package/dist/components/text.cjs +968 -0
  241. package/dist/components/text.cjs.map +1 -0
  242. package/dist/components/text.css +8 -0
  243. package/dist/components/text.d.cts +342 -0
  244. package/dist/components/text.d.ts +342 -0
  245. package/dist/components/text.js +947 -0
  246. package/dist/components/text.js.map +1 -0
  247. package/dist/components/timeline.cjs +109 -0
  248. package/dist/components/timeline.cjs.map +1 -0
  249. package/dist/components/timeline.css +3 -0
  250. package/dist/components/timeline.d.cts +155 -0
  251. package/dist/components/timeline.d.ts +155 -0
  252. package/dist/components/timeline.js +103 -0
  253. package/dist/components/timeline.js.map +1 -0
  254. package/dist/components/tokens.cjs +226 -0
  255. package/dist/components/tokens.cjs.map +1 -0
  256. package/dist/components/tokens.d.cts +74 -0
  257. package/dist/components/tokens.d.ts +74 -0
  258. package/dist/components/tokens.js +211 -0
  259. package/dist/components/tokens.js.map +1 -0
  260. package/dist/components/transitions.cjs +430 -0
  261. package/dist/components/transitions.cjs.map +1 -0
  262. package/dist/components/transitions.css +5 -0
  263. package/dist/components/transitions.d.cts +126 -0
  264. package/dist/components/transitions.d.ts +126 -0
  265. package/dist/components/transitions.js +423 -0
  266. package/dist/components/transitions.js.map +1 -0
  267. package/dist/components/ui.cjs +1050 -0
  268. package/dist/components/ui.cjs.map +1 -0
  269. package/dist/components/ui.css +14 -0
  270. package/dist/components/ui.d.cts +224 -0
  271. package/dist/components/ui.d.ts +224 -0
  272. package/dist/components/ui.js +1034 -0
  273. package/dist/components/ui.js.map +1 -0
  274. package/dist/components/vue.cjs +67 -0
  275. package/dist/components/vue.cjs.map +1 -0
  276. package/dist/components/vue.d.cts +1722 -0
  277. package/dist/components/vue.d.ts +1722 -0
  278. package/dist/components/vue.js +64 -0
  279. package/dist/components/vue.js.map +1 -0
  280. package/dist/components/webgl.cjs +459 -0
  281. package/dist/components/webgl.cjs.map +1 -0
  282. package/dist/components/webgl.css +3 -0
  283. package/dist/components/webgl.d.cts +133 -0
  284. package/dist/components/webgl.d.ts +133 -0
  285. package/dist/components/webgl.js +442 -0
  286. package/dist/components/webgl.js.map +1 -0
  287. package/dist/components/widgets.cjs +591 -0
  288. package/dist/components/widgets.cjs.map +1 -0
  289. package/dist/components/widgets.d.cts +110 -0
  290. package/dist/components/widgets.d.ts +110 -0
  291. package/dist/components/widgets.js +581 -0
  292. package/dist/components/widgets.js.map +1 -0
  293. package/dist/components.cjs +351 -0
  294. package/dist/components.cjs.map +1 -0
  295. package/dist/components.css +75 -0
  296. package/dist/components.d.cts +2997 -0
  297. package/dist/components.d.ts +2997 -0
  298. package/dist/components.js +106 -0
  299. package/dist/components.js.map +1 -0
  300. package/dist/components.umd.js +23 -0
  301. package/dist/components.umd.js.map +1 -0
  302. package/dist/element.cjs +97 -0
  303. package/dist/element.cjs.map +1 -0
  304. package/dist/element.d.cts +215 -0
  305. package/dist/element.d.ts +215 -0
  306. package/dist/element.js +95 -0
  307. package/dist/element.js.map +1 -0
  308. package/dist/element.umd.js +2 -0
  309. package/dist/element.umd.js.map +1 -0
  310. package/dist/index.cjs +149 -0
  311. package/dist/index.cjs.map +1 -0
  312. package/dist/index.d.cts +425 -0
  313. package/dist/index.d.ts +425 -0
  314. package/dist/index.js +131 -0
  315. package/dist/index.js.map +1 -0
  316. package/dist/index.umd.js +15 -0
  317. package/dist/index.umd.js.map +1 -0
  318. package/dist/presets/extended.cjs +243 -0
  319. package/dist/presets/extended.cjs.map +1 -0
  320. package/dist/presets/extended.d.cts +37 -0
  321. package/dist/presets/extended.d.ts +37 -0
  322. package/dist/presets/extended.js +239 -0
  323. package/dist/presets/extended.js.map +1 -0
  324. package/dist/presets-extended.umd.js +2 -0
  325. package/dist/presets-extended.umd.js.map +1 -0
  326. package/dist/react.cjs +68 -0
  327. package/dist/react.cjs.map +1 -0
  328. package/dist/react.d.cts +158 -0
  329. package/dist/react.d.ts +158 -0
  330. package/dist/react.js +65 -0
  331. package/dist/react.js.map +1 -0
  332. package/dist/solid.cjs +93 -0
  333. package/dist/solid.cjs.map +1 -0
  334. package/dist/solid.d.cts +249 -0
  335. package/dist/solid.d.ts +249 -0
  336. package/dist/solid.js +89 -0
  337. package/dist/solid.js.map +1 -0
  338. package/dist/svelte.cjs +66 -0
  339. package/dist/svelte.cjs.map +1 -0
  340. package/dist/svelte.d.cts +243 -0
  341. package/dist/svelte.d.ts +243 -0
  342. package/dist/svelte.js +63 -0
  343. package/dist/svelte.js.map +1 -0
  344. package/dist/vue.cjs +62 -0
  345. package/dist/vue.cjs.map +1 -0
  346. package/dist/vue.d.cts +158 -0
  347. package/dist/vue.d.ts +158 -0
  348. package/dist/vue.js +60 -0
  349. package/dist/vue.js.map +1 -0
  350. package/dist/widgets.umd.js +2 -0
  351. package/dist/widgets.umd.js.map +1 -0
  352. package/docs/API.md +147 -0
  353. package/docs/ROADMAP.md +14 -0
  354. package/docs/accessibility.md +60 -0
  355. package/docs/components.md +564 -0
  356. package/docs/deprecations.md +30 -0
  357. package/docs/frameworks-ssr.md +100 -0
  358. package/docs/hybrid-apps.md +145 -0
  359. package/docs/images/showcase-detail.png +0 -0
  360. package/docs/images/showcase-grid.png +0 -0
  361. package/docs/images/showcase-mobile.png +0 -0
  362. package/docs/migration-from-aos.md +67 -0
  363. package/docs/migration-from-gsap-scrolltrigger.md +80 -0
  364. package/docs/motion-tokens.css +31 -0
  365. package/docs/motion-tokens.md +46 -0
  366. package/docs/motion.tokens.json +132 -0
  367. package/docs/performance.md +24 -0
  368. package/docs/presets.md +310 -0
  369. package/docs/upgrading-3.md +21 -0
  370. package/docs/upgrading-4.md +65 -0
  371. package/docs/upgrading-5.md +31 -0
  372. package/docs/upgrading-6.md +32 -0
  373. package/docs/windows-apps.md +119 -0
  374. package/package.json +562 -4
@@ -0,0 +1,824 @@
1
+ 'use strict';
2
+
3
+ var base = require('../chunks/base-BaQV-2ha.cjs');
4
+ var spring = require('../chunks/spring-Dgx187Vh.cjs');
5
+
6
+ var css$8 = "usa-cursor{--usa-cursor-color:var(--usa-accent,#7c5cff);--usa-cursor-size:28px;position:fixed;inset:0;pointer-events:none;z-index:2147483600;opacity:0;transition:opacity 0.2s ease;contain:strict}usa-cursor[data-active]{opacity:1}usa-cursor .usa-cursor-ring{position:absolute;left:0;top:0;width:var(--usa-cursor-size);height:var(--usa-cursor-size);margin:calc(var(--usa-cursor-size) / -2) 0 0 calc(var(--usa-cursor-size) / -2);border:1.5px solid var(--usa-cursor-color);border-radius:999px;box-sizing:border-box;transition:width 0.25s cubic-bezier(0.34,1.56,0.64,1),height 0.25s cubic-bezier(0.34,1.56,0.64,1),margin 0.25s ease,border-radius 0.25s ease,background-color 0.2s ease;will-change:transform}usa-cursor[data-hover] .usa-cursor-ring:first-child{width:calc(var(--usa-cursor-size) * 1.6);height:calc(var(--usa-cursor-size) * 1.6);margin:calc(var(--usa-cursor-size) * -0.8) 0 0 calc(var(--usa-cursor-size) * -0.8);background:color-mix(in srgb,var(--usa-cursor-color) 15%,transparent)}usa-cursor[data-snapped] .usa-cursor-ring{border-radius:12px;background:color-mix(in srgb,var(--usa-cursor-color) 12%,transparent);translate:-50% -50%;margin:0}usa-cursor[data-down] .usa-cursor-ring:first-child{scale:0.8}usa-cursor .usa-cursor-dot{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:var(--usa-cursor-color)}usa-cursor[data-snapped] .usa-cursor-dot{opacity:0}usa-cursor .usa-cursor-glow{position:absolute;left:-200px;top:-200px;width:400px;height:400px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--usa-cursor-color) 35%,transparent),transparent 65%);mix-blend-mode:screen}.usa-cursor-none,.usa-cursor-none *{cursor:none !important}@media (pointer:coarse),(prefers-reduced-motion:reduce){usa-cursor{display:none}.usa-cursor-none,.usa-cursor-none *{cursor:auto !important}}";
7
+
8
+ const CURSOR_MODES = ['dot', 'magnetic', 'glow'];
9
+ function defineCursor(tag = 'usa-cursor') {
10
+ return base.defineElement(tag, (Base) => class UsaCursor extends Base {
11
+ constructor() {
12
+ super(...arguments);
13
+ this._frame = 0;
14
+ }
15
+ static get observedAttributes() {
16
+ return ['mode', 'size', 'color', 'hide-native'];
17
+ }
18
+ get active() {
19
+ return this.hasAttribute('data-active');
20
+ }
21
+ mount() {
22
+ this.setAttribute('aria-hidden', 'true');
23
+ const fine = typeof matchMedia !== 'function' || matchMedia('(pointer: fine)').matches || matchMedia('(hover: hover)').matches;
24
+ if (this.reduced || !fine) {
25
+ // Decorative only: never leave (focusable) content inside aria-hidden (4.4 audit).
26
+ this.replaceChildren();
27
+ return;
28
+ }
29
+ const m = this.str('mode', 'dot');
30
+ const mode = CURSOR_MODES.includes(m) ? m : 'dot';
31
+ const n = 1;
32
+ this.innerHTML = Array.from({ length: n }, (_, i) => `<span class="usa-cursor-${mode === 'glow' ? 'glow' : 'ring'}" style="--i:${i}"></span>`).join('') + (mode === 'glow' ? '' : '<span class="usa-cursor-dot"></span>');
33
+ if (this.str('color'))
34
+ this.style.setProperty('--usa-cursor-color', this.str('color'));
35
+ this.style.setProperty('--usa-cursor-size', `${this.num('size', 28)}px`);
36
+ if (this.flag('hide-native'))
37
+ document.documentElement.classList.add('usa-cursor-none');
38
+ this.onCleanup(() => document.documentElement.classList.remove('usa-cursor-none'));
39
+ const parts = Array.from(this.querySelectorAll('.usa-cursor-ring, .usa-cursor-glow'));
40
+ const dot = this.querySelector('.usa-cursor-dot');
41
+ const pts = parts.map(() => ({ x: -100, y: -100 }));
42
+ let mx = -100;
43
+ let my = -100;
44
+ let snap = null;
45
+ const sel = this.str('targets', 'a, button, [role="button"], [data-cursor], input, select, textarea, label');
46
+ const loop = () => {
47
+ this._frame = 0;
48
+ let tx = mx;
49
+ let ty = my;
50
+ pts.forEach((p, i) => {
51
+ const k = mode === 'glow' ? 0.12 : 0.22;
52
+ const goalX = snap && i === 0 ? snap.left + snap.width / 2 : tx;
53
+ const goalY = snap && i === 0 ? snap.top + snap.height / 2 : ty;
54
+ p.x += (goalX - p.x) * k;
55
+ p.y += (goalY - p.y) * k;
56
+ parts[i].style.transform = `translate3d(${p.x.toFixed(1)}px, ${p.y.toFixed(1)}px, 0)`;
57
+ tx = p.x;
58
+ ty = p.y;
59
+ });
60
+ if (snap && parts[0]) {
61
+ parts[0].style.width = `${snap.width + 12}px`;
62
+ parts[0].style.height = `${snap.height + 12}px`;
63
+ }
64
+ else if (parts[0]) {
65
+ parts[0].style.width = parts[0].style.height = '';
66
+ }
67
+ if (dot)
68
+ dot.style.transform = `translate3d(${mx}px, ${my}px, 0)`;
69
+ const moving = pts.some((p, i) => Math.abs(p.x - (i === 0 && snap ? snap.left + snap.width / 2 : mx)) > 0.3);
70
+ if (moving)
71
+ this._frame = base.raf(loop);
72
+ };
73
+ const kick = () => {
74
+ if (!this._frame)
75
+ this._frame = base.raf(loop);
76
+ };
77
+ this.listen(document, 'pointermove', (e) => {
78
+ if (e.pointerType === 'touch')
79
+ return;
80
+ mx = e.clientX;
81
+ my = e.clientY;
82
+ this.setAttribute('data-active', '');
83
+ if (mode === 'magnetic') {
84
+ const t = e.target?.closest?.(sel);
85
+ snap = t ? t.getBoundingClientRect() : null;
86
+ this.toggleAttribute('data-snapped', !!t);
87
+ }
88
+ else {
89
+ this.toggleAttribute('data-hover', !!e.target?.closest?.(sel));
90
+ }
91
+ kick();
92
+ }, { passive: true });
93
+ this.listen(document, 'pointerdown', () => this.setAttribute('data-down', ''));
94
+ this.listen(document, 'pointerup', () => this.removeAttribute('data-down'));
95
+ this.listen(document.documentElement, 'pointerleave', () => this.removeAttribute('data-active'));
96
+ }
97
+ unmount() {
98
+ base.caf(this._frame);
99
+ this._frame = 0;
100
+ this.removeAttribute('data-active');
101
+ }
102
+ }, { id: 'cursor', text: css$8 });
103
+ }
104
+
105
+ function smoothScroll(options = {}) {
106
+ if (typeof window === 'undefined' || base.prefersReducedMotion())
107
+ return () => undefined;
108
+ const el = options.target || null;
109
+ const lerp = Math.min(1, Math.max(0.02, options.lerp ?? 0.12));
110
+ const mult = options.wheelMultiplier ?? 1;
111
+ const get = () => (el ? el.scrollTop : window.scrollY);
112
+ const max = () => (el ? el.scrollHeight - el.clientHeight : document.documentElement.scrollHeight - window.innerHeight);
113
+ const set = (y) => (el ? (el.scrollTop = y) : window.scrollTo(0, y));
114
+ let target = get();
115
+ let current = target;
116
+ let id = 0;
117
+ const loop = () => {
118
+ current += (target - current) * lerp;
119
+ if (Math.abs(target - current) < 0.5)
120
+ current = target;
121
+ set(current);
122
+ id = current === target ? 0 : base.raf(loop);
123
+ };
124
+ const onWheel = (e) => {
125
+ if (e.ctrlKey || e.defaultPrevented)
126
+ return;
127
+ if (!id)
128
+ target = current = get();
129
+ e.preventDefault();
130
+ const dy = e.deltaMode === 1 ? e.deltaY * 16 : e.deltaMode === 2 ? e.deltaY * (window.innerHeight || 800) : e.deltaY;
131
+ target = Math.max(0, Math.min(max(), target + dy * mult));
132
+ if (!id)
133
+ id = base.raf(loop);
134
+ };
135
+ const onScroll = () => {
136
+ if (!id)
137
+ target = current = get();
138
+ };
139
+ const host = el || window;
140
+ host.addEventListener('wheel', onWheel, { passive: false });
141
+ host.addEventListener('scroll', onScroll, { passive: true });
142
+ return () => {
143
+ host.removeEventListener('wheel', onWheel);
144
+ host.removeEventListener('scroll', onScroll);
145
+ if (id)
146
+ base.caf(id);
147
+ id = 0;
148
+ };
149
+ }
150
+ /**
151
+ * Scroll to a y position, element or selector with spring timing (or
152
+ * instantly under reduced motion). Resolves when done.
153
+ */
154
+ function scrollToTarget(to, options = {}) {
155
+ if (typeof window === 'undefined')
156
+ return Promise.resolve();
157
+ const el = options.target || null;
158
+ const start = el ? el.scrollTop : window.scrollY;
159
+ let y = typeof to === 'number' ? to : 0;
160
+ if (typeof to !== 'number') {
161
+ const node = typeof to === 'string' ? document.querySelector(to) : to;
162
+ if (!node)
163
+ return Promise.resolve();
164
+ const top = node.getBoundingClientRect().top;
165
+ y = start + top - (el ? el.getBoundingClientRect().top : 0);
166
+ }
167
+ y = Math.max(0, y - (options.offset ?? 0));
168
+ const set = (v) => (el ? (el.scrollTop = v) : window.scrollTo(0, v));
169
+ if (base.prefersReducedMotion()) {
170
+ set(y);
171
+ return Promise.resolve();
172
+ }
173
+ const { values, duration } = spring.springSamples(options.preset || 'slow');
174
+ const t0 = base.now();
175
+ return new Promise((resolve) => {
176
+ const step = () => {
177
+ const p = Math.min(1, (base.now() - t0) / Math.max(1, duration));
178
+ const v = values[Math.min(values.length - 1, Math.round(p * (values.length - 1)))];
179
+ set(start + (y - start) * v);
180
+ if (p < 1)
181
+ base.raf(step);
182
+ else
183
+ resolve();
184
+ };
185
+ base.raf(step);
186
+ });
187
+ }
188
+
189
+ var css$7 = "usa-fullpage{position:relative;display:block;height:100vh;height:100dvh;overflow-y:auto;scroll-snap-type:y mandatory;overscroll-behavior:contain;outline:none}usa-fullpage[axis=\"x\"]{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory}usa-fullpage .usa-fullpage-section{box-sizing:border-box;min-height:100%;scroll-snap-align:start;scroll-snap-stop:always}usa-fullpage[axis=\"x\"] .usa-fullpage-section{flex:0 0 100%}usa-fullpage .usa-fullpage-dots{position:sticky;float:right;top:50%;margin-right:16px;transform:translateY(-50%);display:grid;gap:10px;z-index:5}usa-fullpage .usa-fullpage-dots button{width:10px;height:10px;padding:0;border-radius:50%;border:0;cursor:pointer;background:color-mix(in srgb,currentColor 35%,transparent);transition:transform 0.3s cubic-bezier(0.34,1.56,0.64,1),background-color 0.2s ease}usa-fullpage .usa-fullpage-dots button[aria-current]{background:var(--usa-accent,#7c5cff);transform:scale(1.5)}";
190
+
191
+ function defineFullpage(tag = 'usa-fullpage') {
192
+ return base.defineElement(tag, (Base) => class UsaFullpage extends Base {
193
+ constructor() {
194
+ super(...arguments);
195
+ this._i = 0;
196
+ }
197
+ get index() {
198
+ return this._i;
199
+ }
200
+ sections() {
201
+ return Array.from(this.children).filter((c) => !c.classList.contains('usa-fullpage-dots'));
202
+ }
203
+ mount() {
204
+ if (!this.hasAttribute('tabindex'))
205
+ this.tabIndex = 0;
206
+ const secs = this.sections();
207
+ secs.forEach((s, i) => {
208
+ s.classList.add('usa-fullpage-section');
209
+ s.setAttribute('data-index', String(i));
210
+ });
211
+ let nav = null;
212
+ if (this.flag('dots')) {
213
+ nav = document.createElement('nav');
214
+ nav.className = 'usa-fullpage-dots';
215
+ nav.setAttribute('aria-label', 'Sections');
216
+ secs.forEach((s, i) => {
217
+ const b = document.createElement('button');
218
+ b.type = 'button';
219
+ b.setAttribute('aria-label', s.getAttribute('aria-label') || s.querySelector('h1,h2,h3')?.textContent?.trim() || `Section ${i + 1}`);
220
+ b.addEventListener('click', () => this.go(i));
221
+ nav.append(b);
222
+ });
223
+ this.append(nav);
224
+ this.onCleanup(() => nav?.remove());
225
+ }
226
+ this.mark(0);
227
+ if (typeof IntersectionObserver !== 'undefined') {
228
+ const io = new IntersectionObserver((entries) => {
229
+ for (const e of entries)
230
+ if (e.isIntersecting && e.intersectionRatio >= 0.6)
231
+ this.mark(Number(e.target.dataset.index));
232
+ }, { root: this, threshold: [0.6] });
233
+ secs.forEach((s) => io.observe(s));
234
+ this.onCleanup(() => io.disconnect());
235
+ }
236
+ this.listen(this, 'keydown', (e) => {
237
+ const n = this.sections().length;
238
+ const map = { PageDown: this._i + 1, ArrowDown: this._i + 1, ' ': this._i + 1, PageUp: this._i - 1, ArrowUp: this._i - 1, Home: 0, End: n - 1 };
239
+ if (this.str('axis') === 'x')
240
+ Object.assign(map, { ArrowRight: this._i + 1, ArrowLeft: this._i - 1 });
241
+ if (!(e.key in map) || e.target.closest?.('input, textarea, select'))
242
+ return;
243
+ e.preventDefault();
244
+ this.go(map[e.key]);
245
+ });
246
+ }
247
+ mark(i) {
248
+ if (i === this._i && this.hasAttribute('data-ready'))
249
+ return;
250
+ this.setAttribute('data-ready', '');
251
+ this._i = i;
252
+ this.sections().forEach((s, j) => s.toggleAttribute('data-current', j === i));
253
+ this.querySelectorAll('.usa-fullpage-dots button').forEach((b, j) => (j === i ? b.setAttribute('aria-current', 'true') : b.removeAttribute('aria-current')));
254
+ this.emit('section', { index: i });
255
+ }
256
+ go(i) {
257
+ const secs = this.sections();
258
+ const t = secs[Math.max(0, Math.min(secs.length - 1, i))];
259
+ if (!t)
260
+ return;
261
+ if (this.str('axis') === 'x')
262
+ this.scrollTo({ left: t.offsetLeft, behavior: this.reduced ? 'auto' : 'smooth' });
263
+ else
264
+ scrollToTarget(t.offsetTop, { target: this, preset: 'stiff' });
265
+ this.mark(secs.indexOf(t));
266
+ }
267
+ next() {
268
+ this.go(this._i + 1);
269
+ }
270
+ prev() {
271
+ this.go(this._i - 1);
272
+ }
273
+ }, { id: 'fullpage', text: css$7 });
274
+ }
275
+
276
+ var css$6 = "usa-loading-bar{--usa-loading:0;--usa-loading-h:3px;--usa-loading-color:var(--usa-accent,#7c5cff);position:fixed;left:0;right:0;top:0;height:var(--usa-loading-h);z-index:2147483500;pointer-events:none;opacity:0;transition:opacity 0.3s ease}usa-loading-bar[position=\"bottom\"]{top:auto;bottom:0}usa-loading-bar[data-active]{opacity:1}usa-loading-bar .usa-loading-bar-fill{position:absolute;inset:0;transform-origin:0 50%;transform:scaleX(var(--usa-loading));background:var(--usa-loading-color);box-shadow:0 0 10px var(--usa-loading-color);transition:transform 0.2s ease-out}@media (prefers-reduced-motion:reduce){usa-loading-bar .usa-loading-bar-fill{transition:none}}";
277
+
278
+ function defineLoadingBar(tag = 'usa-loading-bar') {
279
+ return base.defineElement(tag, (Base) => class UsaLoadingBar extends Base {
280
+ constructor() {
281
+ super(...arguments);
282
+ this._p = 0;
283
+ }
284
+ get progress() {
285
+ return this._p;
286
+ }
287
+ mount() {
288
+ if (!this.querySelector('.usa-loading-bar-fill'))
289
+ this.innerHTML = '<span class="usa-loading-bar-fill"></span>';
290
+ this.setAttribute('role', 'progressbar');
291
+ this.setAttribute('aria-label', this.str('label', 'Loading'));
292
+ this.setAttribute('aria-valuemin', '0');
293
+ this.setAttribute('aria-valuemax', '100');
294
+ if (this.str('color'))
295
+ this.style.setProperty('--usa-loading-color', this.str('color'));
296
+ this.style.setProperty('--usa-loading-h', `${this.num('height', 3)}px`);
297
+ this.paint();
298
+ }
299
+ unmount() {
300
+ clearInterval(this._t);
301
+ clearTimeout(this._h);
302
+ }
303
+ paint() {
304
+ this.style.setProperty('--usa-loading', this._p.toFixed(4));
305
+ this.setAttribute('aria-valuenow', String(Math.round(this._p * 100)));
306
+ }
307
+ start() {
308
+ clearTimeout(this._h);
309
+ clearInterval(this._t);
310
+ this.setAttribute('data-active', '');
311
+ this.setAttribute('aria-busy', 'true');
312
+ this._p = Math.max(this._p, 0.08);
313
+ this.paint();
314
+ this._t = setInterval(() => {
315
+ this._p += (0.9 - this._p) * (this.reduced ? 0.5 : 0.08);
316
+ this.paint();
317
+ }, 200);
318
+ }
319
+ set(p) {
320
+ this.setAttribute('data-active', '');
321
+ this._p = Math.max(0, Math.min(1, p));
322
+ this.paint();
323
+ }
324
+ done() {
325
+ clearInterval(this._t);
326
+ this._p = 1;
327
+ this.paint();
328
+ this.removeAttribute('aria-busy');
329
+ this._h = setTimeout(() => {
330
+ this.removeAttribute('data-active');
331
+ this._h = setTimeout(() => {
332
+ this._p = 0;
333
+ this.paint();
334
+ }, 300);
335
+ }, 250);
336
+ }
337
+ }, { id: 'loading-bar', text: css$6 });
338
+ }
339
+ function bar() {
340
+ if (typeof document === 'undefined')
341
+ return null;
342
+ let el = document.querySelector('usa-loading-bar');
343
+ if (!el) {
344
+ defineLoadingBar();
345
+ el = document.createElement('usa-loading-bar');
346
+ document.body.appendChild(el);
347
+ }
348
+ return typeof el.start === 'function' ? el : null;
349
+ }
350
+ /** Drive the page's `<usa-loading-bar>` (created on first use). */
351
+ const loadingBar = {
352
+ start: () => bar()?.start(),
353
+ set: (p) => bar()?.set(p),
354
+ done: () => bar()?.done(),
355
+ /** Run `task` with the bar shown; resolves with its result. */
356
+ async track(task) {
357
+ bar()?.start();
358
+ try {
359
+ return await (typeof task === 'function' ? task() : task);
360
+ }
361
+ finally {
362
+ bar()?.done();
363
+ }
364
+ },
365
+ };
366
+
367
+ var css$5 = "usa-back-to-top{--usa-btt:0;position:fixed;right:max(20px,env(safe-area-inset-right));bottom:max(20px,env(safe-area-inset-bottom));z-index:850;opacity:0;transform:translateY(16px) scale(0.8);pointer-events:none;transition:opacity 0.25s ease,transform 0.4s cubic-bezier(0.34,1.56,0.64,1)}usa-back-to-top[position=\"bottom-left\"]{right:auto;left:max(20px,env(safe-area-inset-left))}usa-back-to-top[data-visible]{opacity:1;transform:none;pointer-events:auto}usa-back-to-top button{width:48px;height:48px;padding:0;border:0;border-radius:50%;cursor:pointer;display:grid;place-items:center;color:var(--usa-accent,#7c5cff);background:var(--usa-surface,#1b1e27);box-shadow:var(--usa-shadow,0 8px 24px -10px rgb(0 0 0 / 0.5))}usa-back-to-top svg{width:44px;height:44px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}usa-back-to-top circle{stroke-dasharray:100;stroke-dashoffset:calc(100 - var(--usa-btt) * 100);transform:rotate(-90deg);transform-origin:50% 50%;opacity:0.85}usa-back-to-top button:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:3px}@media (prefers-reduced-motion:reduce){usa-back-to-top{transition:opacity 0.2s ease;transform:none}}";
368
+
369
+ function defineBackToTop(tag = 'usa-back-to-top') {
370
+ return base.defineElement(tag, (Base) => class UsaBackToTop extends Base {
371
+ constructor() {
372
+ super(...arguments);
373
+ this._frame = 0;
374
+ }
375
+ get visible() {
376
+ return this.hasAttribute('data-visible');
377
+ }
378
+ mount() {
379
+ if (!this.querySelector('button')) {
380
+ this.innerHTML = `<button type="button" aria-label="${this.str('label', 'Back to top')}"><svg viewBox="0 0 36 36" aria-hidden="true"><circle cx="18" cy="18" r="16" pathLength="100"/><path d="M12 20l6-6 6 6"/></svg></button>`;
381
+ }
382
+ const btn = this.querySelector('button');
383
+ const update = () => {
384
+ this._frame = 0;
385
+ const y = window.scrollY || document.documentElement.scrollTop || 0;
386
+ const max = Math.max(1, (document.documentElement.scrollHeight || 0) - (window.innerHeight || 0));
387
+ this.toggleAttribute('data-visible', y > this.num('offset', 300));
388
+ this.style.setProperty('--usa-btt', Math.min(1, y / max).toFixed(4));
389
+ };
390
+ this.listen(window, 'scroll', () => {
391
+ if (!this._frame)
392
+ this._frame = base.raf(update);
393
+ }, { passive: true });
394
+ this.listen(btn, 'click', async () => {
395
+ await scrollToTarget(0, { preset: 'slow' });
396
+ const f = document.querySelector(this.str('focus-target', '#main')) || document.body;
397
+ if (!f.hasAttribute('tabindex') && f !== document.body)
398
+ f.tabIndex = -1;
399
+ f.focus?.({ preventScroll: true });
400
+ });
401
+ update();
402
+ }
403
+ unmount() {
404
+ base.caf(this._frame);
405
+ this._frame = 0;
406
+ }
407
+ }, { id: 'back-to-top', text: css$5 });
408
+ }
409
+
410
+ var css$4 = "usa-ambient{--usa-ambient-opacity:0.6;--usa-ambient-p:0;position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:var(--usa-ambient-opacity);contain:strict}usa-ambient[layer=\"front\"]{z-index:2147483000}usa-ambient canvas{display:block}usa-ambient[effect=\"noise\"]{opacity:calc(var(--usa-ambient-opacity) * 0.25);background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\");animation:usa-ambient-grain 0.6s steps(4) infinite;mix-blend-mode:overlay}@keyframes usa-ambient-grain{25%{background-position:-40px 20px}50%{background-position:30px -50px}75%{background-position:-20px -30px}}usa-ambient[effect=\"gradient\"]{background:linear-gradient(135deg,hsl(calc(250 + var(--usa-ambient-p) * 140) 85% 60%),hsl(calc(190 + var(--usa-ambient-p) * 160) 85% 55%) 50%,hsl(calc(320 + var(--usa-ambient-p) * 90) 85% 62%))}@media (prefers-reduced-motion:reduce){usa-ambient[effect=\"noise\"]{animation:none}}";
411
+
412
+ const AMBIENT_EFFECTS = ['particles', 'snow', 'stars', 'noise', 'gradient'];
413
+ function defineAmbient(tag = 'usa-ambient') {
414
+ return base.defineElement(tag, (Base) => class UsaAmbient extends Base {
415
+ constructor() {
416
+ super(...arguments);
417
+ this._frame = 0;
418
+ }
419
+ static get observedAttributes() {
420
+ return ['effect', 'density', 'color'];
421
+ }
422
+ mount() {
423
+ this.setAttribute('aria-hidden', 'true');
424
+ const effect = this.str('effect', 'particles');
425
+ this.style.setProperty('--usa-ambient-opacity', String(this.num('opacity', 0.6)));
426
+ this.replaceChildren();
427
+ if (effect === 'noise')
428
+ return;
429
+ if (effect === 'gradient') {
430
+ const upd = () => {
431
+ this._frame = 0;
432
+ const max = Math.max(1, document.documentElement.scrollHeight - window.innerHeight);
433
+ this.style.setProperty('--usa-ambient-p', ((window.scrollY || 0) / max).toFixed(4));
434
+ };
435
+ if (!this.reduced)
436
+ this.listen(window, 'scroll', () => !this._frame && (this._frame = base.raf(upd)), { passive: true });
437
+ upd();
438
+ return;
439
+ }
440
+ const canvas = document.createElement('canvas');
441
+ this.append(canvas);
442
+ const ctx = canvas.getContext?.('2d');
443
+ if (!ctx)
444
+ return;
445
+ const dpr = Math.min(2, window.devicePixelRatio || 1);
446
+ let W = 0;
447
+ let H = 0;
448
+ const color = this.str('color', effect === 'snow' ? '#ffffff' : effect === 'stars' ? '#ffffff' : '#a78bfa');
449
+ const speed = this.num('speed', 1);
450
+ const resize = () => {
451
+ W = window.innerWidth || 800;
452
+ H = window.innerHeight || 600;
453
+ canvas.width = W * dpr;
454
+ canvas.height = H * dpr;
455
+ canvas.style.width = `${W}px`;
456
+ canvas.style.height = `${H}px`;
457
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
458
+ };
459
+ resize();
460
+ const base$1 = effect === 'stars' ? 140 : effect === 'snow' ? 90 : 60;
461
+ const n = Math.round(base$1 * Math.max(0.2, Math.min(3, this.num('density', 1))) * Math.min(1.5, (W * H) / (1280 * 800)));
462
+ const dots = Array.from({ length: n }, () => ({
463
+ x: Math.random() * W,
464
+ y: Math.random() * H,
465
+ r: effect === 'stars' ? Math.random() * 1.3 + 0.2 : effect === 'snow' ? Math.random() * 2.6 + 0.8 : Math.random() * 2 + 0.6,
466
+ vx: (Math.random() - 0.5) * 0.25,
467
+ vy: effect === 'snow' ? Math.random() * 0.8 + 0.4 : (Math.random() - 0.5) * 0.25,
468
+ t: Math.random() * Math.PI * 2,
469
+ }));
470
+ ctx.fillStyle = color;
471
+ const draw = (move) => {
472
+ ctx.clearRect(0, 0, W, H);
473
+ for (const d of dots) {
474
+ if (move) {
475
+ d.t += 0.02 * speed;
476
+ d.x += (d.vx + (effect === 'snow' ? Math.sin(d.t) * 0.3 : 0)) * speed;
477
+ d.y += d.vy * speed;
478
+ if (d.y > H + 5)
479
+ d.y = -5;
480
+ if (d.y < -5)
481
+ d.y = H + 5;
482
+ if (d.x > W + 5)
483
+ d.x = -5;
484
+ if (d.x < -5)
485
+ d.x = W + 5;
486
+ }
487
+ ctx.globalAlpha = effect === 'stars' ? 0.35 + 0.65 * Math.abs(Math.sin(d.t)) : 0.85;
488
+ ctx.beginPath();
489
+ ctx.arc(d.x, d.y, d.r, 0, Math.PI * 2);
490
+ ctx.fill();
491
+ }
492
+ };
493
+ this.listen(window, 'resize', () => {
494
+ resize();
495
+ ctx.fillStyle = color;
496
+ draw(false);
497
+ });
498
+ if (this.reduced) {
499
+ draw(false);
500
+ return;
501
+ }
502
+ const loop = () => {
503
+ if (!document.hidden)
504
+ draw(true);
505
+ this._frame = base.raf(loop);
506
+ };
507
+ this._frame = base.raf(loop);
508
+ }
509
+ unmount() {
510
+ base.caf(this._frame);
511
+ this._frame = 0;
512
+ }
513
+ }, { id: 'ambient', text: css$4 });
514
+ }
515
+
516
+ var css$3 = "usa-splash{position:fixed;inset:0;z-index:2147483400;display:grid;place-items:center;background:var(--usa-splash-bg,var(--usa-surface,#0b0d12));color:var(--usa-text,#fff)}usa-splash[hidden]{display:none}";
517
+
518
+ function defineSplash(tag = 'usa-splash') {
519
+ return base.defineElement(tag, (Base) => class UsaSplash extends Base {
520
+ constructor() {
521
+ super(...arguments);
522
+ this._t0 = 0;
523
+ this._gone = false;
524
+ }
525
+ mount() {
526
+ this._t0 = Date.now();
527
+ this.setAttribute('role', 'status');
528
+ this.setAttribute('aria-label', this.str('label', 'Loading'));
529
+ document.body?.setAttribute('aria-busy', 'true');
530
+ if (this.flag('manual'))
531
+ return;
532
+ if (document.readyState === 'complete')
533
+ this.done();
534
+ else
535
+ this.listen(window, 'load', () => this.done(), { once: true });
536
+ }
537
+ async done() {
538
+ if (this._gone)
539
+ return;
540
+ this._gone = true;
541
+ const wait = Math.max(0, this.num('min', 600) - (Date.now() - this._t0));
542
+ if (wait)
543
+ await new Promise((r) => setTimeout(r, wait));
544
+ const exit = this.reduced ? 'fade' : this.str('exit', 'fade');
545
+ const frames = {
546
+ fade: [{ opacity: 1 }, { opacity: 0 }],
547
+ scale: [{ opacity: 1, transform: 'scale(1)' }, { opacity: 0, transform: 'scale(1.15)' }],
548
+ 'slide-up': [{ transform: 'translateY(0)' }, { transform: 'translateY(-100%)' }],
549
+ circle: [{ clipPath: 'circle(150% at 50% 50%)' }, { clipPath: 'circle(0% at 50% 50%)' }],
550
+ };
551
+ const a = this.motion(this, frames[exit] || frames.fade, { duration: this.reduced ? 200 : 550, easing: 'cubic-bezier(0.65, 0, 0.35, 1)', fill: 'forwards' });
552
+ await a?.finished.catch(() => undefined);
553
+ document.body?.removeAttribute('aria-busy');
554
+ this.hidden = true;
555
+ this.emit('done');
556
+ }
557
+ }, { id: 'splash', text: css$3 });
558
+ }
559
+
560
+ var css$2 = "usa-auto-skeleton{display:block;--usa-skel-base:color-mix(in srgb,currentColor 10%,transparent);--usa-skel-shine:color-mix(in srgb,currentColor 18%,transparent)}usa-auto-skeleton[loading] :is(h1,h2,h3,h4,h5,h6,p,li,span,a,button,label,img,svg,video,input,select,textarea,td,th,figcaption,blockquote,[data-skeleton]):not([data-no-skeleton]):not(:has(:is(h1,h2,h3,h4,h5,h6,p,li,img,button,input))){color:transparent !important;border-color:transparent !important;box-shadow:none !important;user-select:none;pointer-events:none;background:linear-gradient(90deg,var(--usa-skel-base) 25%,var(--usa-skel-shine) 50%,var(--usa-skel-base) 75%) 0 0 / 300% 100% !important;border-radius:6px;animation:usa-skel-shimmer 1.4s ease-in-out infinite}usa-auto-skeleton[loading] :is(img,svg,video){opacity:0}usa-auto-skeleton[loading] :is(img,svg,video):not([data-no-skeleton]){opacity:1;object-position:-9999px}@keyframes usa-skel-shimmer{from{background-position:100% 0}to{background-position:0 0}}@media (prefers-reduced-motion:reduce){usa-auto-skeleton[loading] *{animation:none !important}}";
561
+
562
+ function defineAutoSkeleton(tag = 'usa-auto-skeleton') {
563
+ return base.defineElement(tag, (Base) => class UsaAutoSkeleton extends Base {
564
+ static get observedAttributes() {
565
+ return ['loading'];
566
+ }
567
+ get loading() {
568
+ return this.flag('loading');
569
+ }
570
+ set loading(v) {
571
+ this.setFlag('loading', v);
572
+ }
573
+ mount() {
574
+ this.sync(false);
575
+ }
576
+ changed() {
577
+ this.sync(true);
578
+ }
579
+ sync(animate) {
580
+ if (this.loading)
581
+ this.setAttribute('aria-busy', 'true');
582
+ else {
583
+ this.removeAttribute('aria-busy');
584
+ if (animate && !this.reduced)
585
+ this.motion(this, [{ opacity: 0.4 }, { opacity: 1 }], { duration: 300, easing: 'ease-out' });
586
+ }
587
+ }
588
+ }, { id: 'auto-skeleton', text: css$2 });
589
+ }
590
+
591
+ var css$1 = "usa-motion-switch{--usa-motion-i:2;position:relative;display:inline-grid;grid-auto-flow:column;grid-auto-columns:1fr;padding:3px;border-radius:999px;background:color-mix(in srgb,currentColor 9%,transparent);isolation:isolate}usa-motion-switch button{position:relative;z-index:1;padding:6px 12px;border:0;background:none;color:inherit;font:inherit;font-size:0.85em;border-radius:999px;cursor:pointer}usa-motion-switch button[aria-checked=\"true\"]{color:var(--usa-accent-text,#fff)}usa-motion-switch button:focus-visible{outline:2px solid var(--usa-accent,#7c5cff);outline-offset:1px}usa-motion-switch .usa-motion-thumb{position:absolute;z-index:0;top:3px;bottom:3px;left:3px;width:calc((100% - 6px) / 4);border-radius:999px;background:var(--usa-accent,#7c5cff);transform:translateX(calc(var(--usa-motion-i) * 100%));transition:transform 0.4s cubic-bezier(0.34,1.4,0.64,1)}@media (prefers-reduced-motion:reduce){usa-motion-switch .usa-motion-thumb{transition:none}}";
592
+
593
+ const INTENSITIES = ['low', 'normal', 'high'];
594
+ const LEVELS = ['off', 'low', 'normal', 'high'];
595
+ const KEY = 'usa:motion';
596
+ /**
597
+ * Set the global motion intensity for every `<usa-*>` component:
598
+ * `'low'`, `'normal'` (default), `'high'`. Sets `--usa-motion` and
599
+ * `data-usa-motion` on `<html>`; with `persist` the choice is remembered
600
+ * (localStorage) and restored by `restoreMotionIntensity()`.
601
+ * 5.0: `'off'` was removed — use `setMotionSensitivity('minimal')`.
602
+ */
603
+ function setMotionIntensity(level, persist = false) {
604
+ if (!INTENSITIES.includes(level))
605
+ return;
606
+ base.configureComponents({ motionIntensity: level });
607
+ store(level, persist);
608
+ }
609
+ function store(level, persist) {
610
+ if (persist) {
611
+ try {
612
+ localStorage.setItem(KEY, level);
613
+ }
614
+ catch {
615
+ /* private mode */
616
+ }
617
+ }
618
+ if (typeof document !== 'undefined')
619
+ document.dispatchEvent(new CustomEvent('usa:motion', { detail: { level } }));
620
+ }
621
+ /** Apply a switch level: `'off'` = motion sensitivity `minimal`, otherwise full motion at that intensity. */
622
+ function setMotionLevel(level, persist = false) {
623
+ if (!LEVELS.includes(level))
624
+ return;
625
+ if (level === 'off')
626
+ base.configureComponents({ motionSensitivity: 'minimal' });
627
+ else
628
+ base.configureComponents({ motionIntensity: level, ...(base.getMotionSensitivity() === 'minimal' ? { motionSensitivity: 'full' } : {}) });
629
+ store(level, persist);
630
+ }
631
+ /** The current switch level. */
632
+ function getMotionLevel() {
633
+ return base.getMotionSensitivity() === 'minimal' || base.getMotionSensitivity() === 'static' ? 'off' : base.getMotionIntensity();
634
+ }
635
+ /** Re-apply a persisted level (call early on page load). Returns the active intensity. */
636
+ function restoreMotionIntensity() {
637
+ try {
638
+ const v = localStorage.getItem(KEY);
639
+ if (v && LEVELS.includes(v))
640
+ setMotionLevel(v);
641
+ }
642
+ catch {
643
+ /* ignore */
644
+ }
645
+ return base.getMotionIntensity();
646
+ }
647
+ function defineMotionSwitch(tag = 'usa-motion-switch') {
648
+ return base.defineElement(tag, (Base) => class UsaMotionSwitch extends Base {
649
+ get value() {
650
+ return getMotionLevel();
651
+ }
652
+ set value(v) {
653
+ setMotionLevel(v, true);
654
+ this.sync();
655
+ }
656
+ mount() {
657
+ restoreMotionIntensity();
658
+ const labels = this.str('labels', 'Off,Low,Normal,High').split(',');
659
+ this.setAttribute('role', 'radiogroup');
660
+ this.setAttribute('aria-label', this.str('label', 'Motion'));
661
+ this.innerHTML = LEVELS.map((l, i) => `<button type="button" role="radio" data-level="${l}">${labels[i] || l}</button><span hidden></span>`.replace('<span hidden></span>', '')).join('') + '<span class="usa-motion-thumb" aria-hidden="true"></span>';
662
+ this.listen(this, 'click', (e) => {
663
+ const b = e.target.closest?.('[data-level]');
664
+ if (b)
665
+ this.pick(b.dataset.level);
666
+ });
667
+ this.listen(this, 'keydown', (e) => {
668
+ const i = LEVELS.indexOf(this.value);
669
+ const n = e.key === 'ArrowRight' || e.key === 'ArrowDown' ? i + 1 : e.key === 'ArrowLeft' || e.key === 'ArrowUp' ? i - 1 : null;
670
+ if (n === null)
671
+ return;
672
+ e.preventDefault();
673
+ this.pick(LEVELS[(n + LEVELS.length) % LEVELS.length]);
674
+ this.querySelector('[aria-checked="true"]')?.focus();
675
+ });
676
+ this.listen(document, 'usa:motion', () => this.sync());
677
+ this.sync();
678
+ }
679
+ pick(l) {
680
+ this.value = l;
681
+ this.emit('change', { level: l });
682
+ }
683
+ sync() {
684
+ const v = this.value;
685
+ const i = LEVELS.indexOf(v);
686
+ this.style.setProperty('--usa-motion-i', String(i));
687
+ this.querySelectorAll('[data-level]').forEach((b) => {
688
+ const on = b.dataset.level === v;
689
+ b.setAttribute('aria-checked', String(on));
690
+ b.tabIndex = on ? 0 : -1;
691
+ });
692
+ }
693
+ }, { id: 'motion-switch', text: css$1 });
694
+ }
695
+
696
+ var css = "::view-transition-group(root){animation-duration:var(--usa-pt-duration,600ms)}html[data-usa-pt] ::view-transition-old(root),html[data-usa-pt] ::view-transition-new(root){animation-duration:var(--usa-pt-duration,600ms);animation-timing-function:cubic-bezier(0.22,1,0.36,1);mix-blend-mode:normal}html[data-usa-pt=\"slide\"] ::view-transition-old(root),html[data-usa-pt=\"slide-left\"] ::view-transition-old(root){animation-name:usa-pt-out-left}html[data-usa-pt=\"slide\"] ::view-transition-new(root),html[data-usa-pt=\"slide-left\"] ::view-transition-new(root){animation-name:usa-pt-in-right}html[data-usa-pt=\"slide-right\"] ::view-transition-old(root){animation-name:usa-pt-out-right}html[data-usa-pt=\"slide-right\"] ::view-transition-new(root){animation-name:usa-pt-in-left}html[data-usa-pt=\"slide-up\"] ::view-transition-old(root){animation-name:usa-pt-out-up}html[data-usa-pt=\"slide-up\"] ::view-transition-new(root){animation-name:usa-pt-in-up}html[data-usa-pt=\"zoom\"] ::view-transition-old(root){animation-name:usa-pt-zoom-out}html[data-usa-pt=\"zoom\"] ::view-transition-new(root){animation-name:usa-pt-zoom-in}html[data-usa-pt=\"circle\"] ::view-transition-old(root){animation:none}html[data-usa-pt=\"circle\"] ::view-transition-new(root){animation-name:usa-pt-circle}html[data-usa-pt=\"blinds\"] ::view-transition-old(root){animation:none}html[data-usa-pt=\"blinds\"] ::view-transition-new(root){animation-name:usa-pt-blinds;-webkit-mask-image:repeating-linear-gradient(to bottom,#000 0 var(--usa-blind),transparent var(--usa-blind) 10vh);mask-image:repeating-linear-gradient(to bottom,#000 0 var(--usa-blind),transparent var(--usa-blind) 10vh)}html[data-usa-pt=\"pixel\"] ::view-transition-old(root){animation-name:usa-pt-pixel-out;animation-timing-function:steps(10,end)}html[data-usa-pt=\"pixel\"] ::view-transition-new(root){animation-name:usa-pt-pixel-in;animation-timing-function:steps(10,end)}@property --usa-blind{syntax:\"<length-percentage>\";inherits:false;initial-value:0vh}@keyframes usa-pt-out-left{to{transform:translateX(-30%);opacity:0}}@keyframes usa-pt-in-right{from{transform:translateX(30%);opacity:0}}@keyframes usa-pt-out-right{to{transform:translateX(30%);opacity:0}}@keyframes usa-pt-in-left{from{transform:translateX(-30%);opacity:0}}@keyframes usa-pt-out-up{to{transform:translateY(-12%);opacity:0}}@keyframes usa-pt-in-up{from{transform:translateY(12%);opacity:0}}@keyframes usa-pt-zoom-out{to{transform:scale(0.92);opacity:0}}@keyframes usa-pt-zoom-in{from{transform:scale(1.08);opacity:0}}@keyframes usa-pt-circle{from{clip-path:circle(0 at var(--usa-pt-x,50%) var(--usa-pt-y,50%))}to{clip-path:circle(var(--usa-pt-r,150vmax) at var(--usa-pt-x,50%) var(--usa-pt-y,50%))}}@keyframes usa-pt-blinds{from{--usa-blind:0vh}to{--usa-blind:10vh}}@keyframes usa-pt-pixel-out{to{opacity:0;filter:blur(6px) contrast(1.4)}}@keyframes usa-pt-pixel-in{from{opacity:0;filter:blur(6px) contrast(1.4)}}@media (prefers-reduced-motion:reduce){::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none !important}}";
697
+
698
+ /**
699
+ * Page & app-wide transitions (v2.7), built on the View Transitions API
700
+ * (Chromium: Chrome, Edge, Electron, WebView2) with graceful fallbacks.
701
+ *
702
+ * - `pageTransition(update, { effect })` — SPA route changes: `fade`,
703
+ * `slide` (`slide-left` / `slide-right` / `slide-up`), `circle` (reveal
704
+ * from `x`, `y`), `blinds`, `pixel` (stepped dissolve), `zoom`.
705
+ * - `enableMpaTransitions(effect)` — the same effects for multi-page sites
706
+ * (`@view-transition { navigation: auto }`); call it on every page.
707
+ * - `themeTransition(apply, { x, y })` — a circle-reveal theme switch.
708
+ *
709
+ * Without View Transitions (Firefox, older Safari) or under reduced motion
710
+ * the update runs immediately (`fade` falls back to a short cross-fade of
711
+ * `fallback` when given).
712
+ */
713
+ const PAGE_EFFECTS = ['fade', 'slide', 'slide-left', 'slide-right', 'slide-up', 'circle', 'blinds', 'pixel', 'zoom'];
714
+ let lastPointer = null;
715
+ function trackPointer() {
716
+ if (typeof document === 'undefined' || trackPointer.done)
717
+ return;
718
+ trackPointer.done = true;
719
+ document.addEventListener('pointerdown', (e) => (lastPointer = [e.clientX, e.clientY]), { capture: true, passive: true });
720
+ }
721
+ /** `true` when `document.startViewTransition` exists. */
722
+ const supportsViewTransitions = () => typeof document !== 'undefined' && typeof document.startViewTransition === 'function';
723
+ function setVars(o) {
724
+ const d = document.documentElement;
725
+ const W = window.innerWidth || 1024;
726
+ const H = window.innerHeight || 768;
727
+ const [x, y] = o.x !== undefined && o.y !== undefined ? [o.x, o.y] : lastPointer || [W / 2, H / 2];
728
+ const r = Math.hypot(Math.max(x, W - x), Math.max(y, H - y));
729
+ d.style.setProperty('--usa-pt-x', `${x}px`);
730
+ d.style.setProperty('--usa-pt-y', `${y}px`);
731
+ d.style.setProperty('--usa-pt-r', `${Math.ceil(r)}px`);
732
+ d.style.setProperty('--usa-pt-duration', `${o.duration ?? 600}ms`);
733
+ }
734
+ /** Run `update` (sync or async) as an animated page transition. Resolves when it is done. */
735
+ async function pageTransition(update, options = {}) {
736
+ if (typeof document === 'undefined') {
737
+ await update();
738
+ return;
739
+ }
740
+ base.adoptStyles('page-transitions', css);
741
+ trackPointer();
742
+ const effect = options.effect || 'fade';
743
+ if (base.prefersReducedMotion() || !supportsViewTransitions()) {
744
+ await update();
745
+ const f = options.fallback;
746
+ if (f && typeof f.animate === 'function' && !base.prefersReducedMotion())
747
+ await f.animate([{ opacity: 0 }, { opacity: 1 }], { duration: 200 }).finished.catch(() => undefined);
748
+ return;
749
+ }
750
+ const d = document.documentElement;
751
+ setVars(options);
752
+ d.setAttribute('data-usa-pt', effect);
753
+ try {
754
+ const vt = document.startViewTransition(() => update());
755
+ await vt.finished;
756
+ }
757
+ finally {
758
+ d.removeAttribute('data-usa-pt');
759
+ }
760
+ }
761
+ /** Opt a multi-page site into cross-document view transitions with `effect`. */
762
+ function enableMpaTransitions(effect = 'fade', duration = 450) {
763
+ if (typeof document === 'undefined')
764
+ return;
765
+ base.adoptStyles('page-transitions', css);
766
+ base.adoptStyles('mpa-transitions', base.prefersReducedMotion() ? '' : '@view-transition{navigation:auto}');
767
+ const d = document.documentElement;
768
+ d.setAttribute('data-usa-pt', effect);
769
+ setVars({ duration });
770
+ }
771
+ /**
772
+ * Switch theme with a circle reveal from (`x`, `y`) (default: last pointer).
773
+ * `apply` flips your theme (e.g. toggles a class / `data-theme`).
774
+ */
775
+ function themeTransition(apply, options = {}) {
776
+ return pageTransition(apply, { ...options, effect: 'circle', duration: options.duration ?? 650 });
777
+ }
778
+
779
+ /**
780
+ * motionary/components/page — page & app-wide effects (v2.7).
781
+ * Page transitions (`pageTransition()`, `enableMpaTransitions()`,
782
+ * `themeTransition()`), `<usa-cursor>`, `smoothScroll()` / `scrollToTarget()`,
783
+ * `<usa-fullpage>`, `<usa-loading-bar>` + `loadingBar`, `<usa-back-to-top>`,
784
+ * `<usa-ambient>`, `<usa-splash>`, `<usa-auto-skeleton>` and the global motion
785
+ * intensity (`setMotionIntensity()`, `<usa-motion-switch>`).
786
+ */
787
+ /** Register every component of this category under its default tag. */
788
+ function definePageComponents() {
789
+ defineCursor();
790
+ defineFullpage();
791
+ defineLoadingBar();
792
+ defineBackToTop();
793
+ defineAmbient();
794
+ defineSplash();
795
+ defineAutoSkeleton();
796
+ defineMotionSwitch();
797
+ }
798
+
799
+ exports.MOTION_SCALE = base.MOTION_SCALE;
800
+ exports.getMotionIntensity = base.getMotionIntensity;
801
+ exports.AMBIENT_EFFECTS = AMBIENT_EFFECTS;
802
+ exports.CURSOR_MODES = CURSOR_MODES;
803
+ exports.PAGE_EFFECTS = PAGE_EFFECTS;
804
+ exports.defineAmbient = defineAmbient;
805
+ exports.defineAutoSkeleton = defineAutoSkeleton;
806
+ exports.defineBackToTop = defineBackToTop;
807
+ exports.defineCursor = defineCursor;
808
+ exports.defineFullpage = defineFullpage;
809
+ exports.defineLoadingBar = defineLoadingBar;
810
+ exports.defineMotionSwitch = defineMotionSwitch;
811
+ exports.definePageComponents = definePageComponents;
812
+ exports.defineSplash = defineSplash;
813
+ exports.enableMpaTransitions = enableMpaTransitions;
814
+ exports.getMotionLevel = getMotionLevel;
815
+ exports.loadingBar = loadingBar;
816
+ exports.pageTransition = pageTransition;
817
+ exports.restoreMotionIntensity = restoreMotionIntensity;
818
+ exports.scrollToTarget = scrollToTarget;
819
+ exports.setMotionIntensity = setMotionIntensity;
820
+ exports.setMotionLevel = setMotionLevel;
821
+ exports.smoothScroll = smoothScroll;
822
+ exports.supportsViewTransitions = supportsViewTransitions;
823
+ exports.themeTransition = themeTransition;
824
+ //# sourceMappingURL=page.cjs.map