motionary 10.1.0 → 10.3.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 (290) hide show
  1. package/AGENTS.md +61 -0
  2. package/CHANGELOG.md +36 -0
  3. package/README.md +69 -0
  4. package/dist/chunks/{keyframes-CyH_abhI.js → keyframes-DVAC5sQI.js} +2 -2
  5. package/dist/chunks/{keyframes-CyH_abhI.js.map → keyframes-DVAC5sQI.js.map} +1 -1
  6. package/dist/chunks/{keyframes-cUdsXSXQ.cjs → keyframes-Dw9zwVQa.cjs} +2 -2
  7. package/dist/chunks/{keyframes-cUdsXSXQ.cjs.map → keyframes-Dw9zwVQa.cjs.map} +1 -1
  8. package/dist/chunks/{registry-jF8VIA_9.js → registry-46AAzyeC.js} +2 -2
  9. package/dist/chunks/{registry-jF8VIA_9.js.map → registry-46AAzyeC.js.map} +1 -1
  10. package/dist/chunks/{registry-C0xLNq3-.cjs → registry-CSVil2qJ.cjs} +2 -2
  11. package/dist/chunks/{registry-C0xLNq3-.cjs.map → registry-CSVil2qJ.cjs.map} +1 -1
  12. package/dist/chunks/ticker-COOYAyQy.js +70 -0
  13. package/dist/chunks/ticker-COOYAyQy.js.map +1 -0
  14. package/dist/chunks/ticker-gHv6pNfx.cjs +72 -0
  15. package/dist/chunks/ticker-gHv6pNfx.cjs.map +1 -0
  16. package/dist/chunks/{tween-JEthWrjo.cjs → tween-CFN0WcOb.cjs} +16 -73
  17. package/dist/chunks/tween-CFN0WcOb.cjs.map +1 -0
  18. package/dist/chunks/{tween-DDObu9iA.js → tween-CGyolmzB.js} +16 -72
  19. package/dist/chunks/tween-CGyolmzB.js.map +1 -0
  20. package/dist/components/core.cjs +106 -0
  21. package/dist/components/core.cjs.map +1 -1
  22. package/dist/components/core.d.cts +44 -2
  23. package/dist/components/core.d.ts +44 -2
  24. package/dist/components/core.js +105 -1
  25. package/dist/components/core.js.map +1 -1
  26. package/dist/components/widgets.cjs +602 -198
  27. package/dist/components/widgets.cjs.map +1 -1
  28. package/dist/components/widgets.d.cts +186 -2
  29. package/dist/components/widgets.d.ts +186 -2
  30. package/dist/components/widgets.js +598 -199
  31. package/dist/components/widgets.js.map +1 -1
  32. package/dist/llms-full.txt +194 -1
  33. package/dist/llms.txt +10 -2
  34. package/dist/manifest.json +492 -1
  35. package/dist/runtime/format-css.cjs +4 -3
  36. package/dist/runtime/format-css.cjs.map +1 -1
  37. package/dist/runtime/format-css.js +4 -3
  38. package/dist/runtime/format-css.js.map +1 -1
  39. package/dist/runtime/format-motion.cjs +4 -3
  40. package/dist/runtime/format-motion.cjs.map +1 -1
  41. package/dist/runtime/format-motion.js +4 -3
  42. package/dist/runtime/format-motion.js.map +1 -1
  43. package/dist/runtime/format-sprite.cjs +225 -0
  44. package/dist/runtime/format-sprite.cjs.map +1 -0
  45. package/dist/runtime/format-sprite.d.cts +224 -0
  46. package/dist/runtime/format-sprite.d.ts +224 -0
  47. package/dist/runtime/format-sprite.iife.js +2 -0
  48. package/dist/runtime/format-sprite.iife.js.map +1 -0
  49. package/dist/runtime/format-sprite.js +215 -0
  50. package/dist/runtime/format-sprite.js.map +1 -0
  51. package/dist/runtime/format-svg.cjs +457 -0
  52. package/dist/runtime/format-svg.cjs.map +1 -0
  53. package/dist/runtime/format-svg.d.cts +214 -0
  54. package/dist/runtime/format-svg.d.ts +214 -0
  55. package/dist/runtime/format-svg.iife.js +2 -0
  56. package/dist/runtime/format-svg.iife.js.map +1 -0
  57. package/dist/runtime/format-svg.js +446 -0
  58. package/dist/runtime/format-svg.js.map +1 -0
  59. package/dist/runtime/scroll.cjs +301 -0
  60. package/dist/runtime/scroll.cjs.map +1 -0
  61. package/dist/runtime/scroll.d.cts +236 -0
  62. package/dist/runtime/scroll.d.ts +236 -0
  63. package/dist/runtime/scroll.iife.js +2 -0
  64. package/dist/runtime/scroll.iife.js.map +1 -0
  65. package/dist/runtime/scroll.js +292 -0
  66. package/dist/runtime/scroll.js.map +1 -0
  67. package/dist/runtime/text.cjs +147 -0
  68. package/dist/runtime/text.cjs.map +1 -0
  69. package/dist/runtime/text.d.cts +65 -0
  70. package/dist/runtime/text.d.ts +65 -0
  71. package/dist/runtime/text.iife.js +2 -0
  72. package/dist/runtime/text.iife.js.map +1 -0
  73. package/dist/runtime/text.js +143 -0
  74. package/dist/runtime/text.js.map +1 -0
  75. package/dist/runtime.cjs +5 -4
  76. package/dist/runtime.cjs.map +1 -1
  77. package/dist/runtime.d.cts +9 -2
  78. package/dist/runtime.d.ts +9 -2
  79. package/dist/runtime.iife.js +1 -1
  80. package/dist/runtime.iife.js.map +1 -1
  81. package/dist/runtime.js +5 -4
  82. package/dist/runtime.js.map +1 -1
  83. package/dist/widgets.umd.js +1 -1
  84. package/dist/widgets.umd.js.map +1 -1
  85. package/docs/ROADMAP.md +2 -2
  86. package/docs/ai-prompt-guide.md +54 -0
  87. package/docs/components/README.md +255 -0
  88. package/docs/components/usa-accordion.md +38 -0
  89. package/docs/components/usa-acrylic.md +38 -0
  90. package/docs/components/usa-add-to-cart.md +40 -0
  91. package/docs/components/usa-ambient.md +32 -0
  92. package/docs/components/usa-anim-icon.md +34 -0
  93. package/docs/components/usa-audio.md +38 -0
  94. package/docs/components/usa-aurora.md +36 -0
  95. package/docs/components/usa-auto-animate.md +44 -0
  96. package/docs/components/usa-auto-skeleton.md +38 -0
  97. package/docs/components/usa-avatar-stack.md +38 -0
  98. package/docs/components/usa-back-to-top.md +32 -0
  99. package/docs/components/usa-badge-wall.md +39 -0
  100. package/docs/components/usa-badge.md +36 -0
  101. package/docs/components/usa-bar-chart.md +33 -0
  102. package/docs/components/usa-bg-generator.md +32 -0
  103. package/docs/components/usa-blobs.md +32 -0
  104. package/docs/components/usa-bottom-sheet.md +32 -0
  105. package/docs/components/usa-button.md +78 -0
  106. package/docs/components/usa-card-stack.md +40 -0
  107. package/docs/components/usa-card.md +94 -0
  108. package/docs/components/usa-carousel-3d.md +40 -0
  109. package/docs/components/usa-carousel.md +40 -0
  110. package/docs/components/usa-cart-drawer.md +33 -0
  111. package/docs/components/usa-chapter-nav.md +40 -0
  112. package/docs/components/usa-chat-composer.md +33 -0
  113. package/docs/components/usa-check.md +32 -0
  114. package/docs/components/usa-checkbox.md +32 -0
  115. package/docs/components/usa-click.md +36 -0
  116. package/docs/components/usa-clock-control.md +37 -0
  117. package/docs/components/usa-code-export.md +36 -0
  118. package/docs/components/usa-color-picker.md +32 -0
  119. package/docs/components/usa-command-palette.md +39 -0
  120. package/docs/components/usa-compare.md +38 -0
  121. package/docs/components/usa-countdown.md +32 -0
  122. package/docs/components/usa-counter.md +32 -0
  123. package/docs/components/usa-cube-gallery.md +40 -0
  124. package/docs/components/usa-cube.md +36 -0
  125. package/docs/components/usa-cursor.md +32 -0
  126. package/docs/components/usa-date-picker.md +32 -0
  127. package/docs/components/usa-depth.md +44 -0
  128. package/docs/components/usa-dialog.md +40 -0
  129. package/docs/components/usa-disclosure.md +38 -0
  130. package/docs/components/usa-distort.md +36 -0
  131. package/docs/components/usa-dock.md +40 -0
  132. package/docs/components/usa-dot-network.md +32 -0
  133. package/docs/components/usa-double-tap.md +36 -0
  134. package/docs/components/usa-draggable.md +38 -0
  135. package/docs/components/usa-draw.md +36 -0
  136. package/docs/components/usa-drawer.md +34 -0
  137. package/docs/components/usa-equalizer.md +33 -0
  138. package/docs/components/usa-fab.md +40 -0
  139. package/docs/components/usa-festival-banner.md +32 -0
  140. package/docs/components/usa-field.md +34 -0
  141. package/docs/components/usa-file-drop.md +35 -0
  142. package/docs/components/usa-fullpage.md +38 -0
  143. package/docs/components/usa-fx.md +851 -0
  144. package/docs/components/usa-gauge.md +32 -0
  145. package/docs/components/usa-gen-art.md +32 -0
  146. package/docs/components/usa-gesture-fx.md +36 -0
  147. package/docs/components/usa-gesture-sticker.md +36 -0
  148. package/docs/components/usa-glitch.md +32 -0
  149. package/docs/components/usa-globe.md +33 -0
  150. package/docs/components/usa-gradient-text.md +32 -0
  151. package/docs/components/usa-grain.md +36 -0
  152. package/docs/components/usa-grid-glow.md +36 -0
  153. package/docs/components/usa-gyro-card.md +38 -0
  154. package/docs/components/usa-handwriting.md +32 -0
  155. package/docs/components/usa-hero-video.md +38 -0
  156. package/docs/components/usa-hold.md +32 -0
  157. package/docs/components/usa-hud-panel.md +38 -0
  158. package/docs/components/usa-hydrate.md +42 -0
  159. package/docs/components/usa-icon-morph.md +34 -0
  160. package/docs/components/usa-install-button.md +32 -0
  161. package/docs/components/usa-kanban.md +46 -0
  162. package/docs/components/usa-keyframe-editor.md +37 -0
  163. package/docs/components/usa-kpi.md +32 -0
  164. package/docs/components/usa-leaderboard.md +41 -0
  165. package/docs/components/usa-like.md +32 -0
  166. package/docs/components/usa-liquid-nav.md +36 -0
  167. package/docs/components/usa-liquid.md +36 -0
  168. package/docs/components/usa-loading-bar.md +35 -0
  169. package/docs/components/usa-location-card.md +34 -0
  170. package/docs/components/usa-lottie-icon.md +34 -0
  171. package/docs/components/usa-lottie.md +32 -0
  172. package/docs/components/usa-lyrics.md +38 -0
  173. package/docs/components/usa-magnetic.md +32 -0
  174. package/docs/components/usa-marquee.md +38 -0
  175. package/docs/components/usa-mask-reveal.md +36 -0
  176. package/docs/components/usa-masonry-flow.md +42 -0
  177. package/docs/components/usa-masonry.md +38 -0
  178. package/docs/components/usa-menu-toggle.md +34 -0
  179. package/docs/components/usa-menu.md +44 -0
  180. package/docs/components/usa-message-list.md +39 -0
  181. package/docs/components/usa-milestones.md +40 -0
  182. package/docs/components/usa-modal.md +42 -0
  183. package/docs/components/usa-morph.md +34 -0
  184. package/docs/components/usa-motion-inspector.md +32 -0
  185. package/docs/components/usa-motion-prefs.md +32 -0
  186. package/docs/components/usa-motion-spec.md +32 -0
  187. package/docs/components/usa-motion-switch.md +34 -0
  188. package/docs/components/usa-motion-theme.md +40 -0
  189. package/docs/components/usa-motion.md +42 -0
  190. package/docs/components/usa-music-player.md +36 -0
  191. package/docs/components/usa-native-preview.md +36 -0
  192. package/docs/components/usa-nav-morph.md +40 -0
  193. package/docs/components/usa-navbar.md +36 -0
  194. package/docs/components/usa-notification-bell.md +37 -0
  195. package/docs/components/usa-odometer.md +34 -0
  196. package/docs/components/usa-organic-card.md +36 -0
  197. package/docs/components/usa-otp.md +33 -0
  198. package/docs/components/usa-overscroll.md +36 -0
  199. package/docs/components/usa-pack.md +111 -0
  200. package/docs/components/usa-pagination.md +32 -0
  201. package/docs/components/usa-panorama.md +32 -0
  202. package/docs/components/usa-particles.md +32 -0
  203. package/docs/components/usa-pause-all.md +32 -0
  204. package/docs/components/usa-perf-monitor.md +32 -0
  205. package/docs/components/usa-pinch-zoom.md +36 -0
  206. package/docs/components/usa-player.md +38 -0
  207. package/docs/components/usa-plugin-card.md +61 -0
  208. package/docs/components/usa-plugin-store.md +36 -0
  209. package/docs/components/usa-popover.md +38 -0
  210. package/docs/components/usa-post-fx.md +36 -0
  211. package/docs/components/usa-presence.md +36 -0
  212. package/docs/components/usa-press.md +32 -0
  213. package/docs/components/usa-prize-wheel.md +32 -0
  214. package/docs/components/usa-product-gallery.md +40 -0
  215. package/docs/components/usa-progress-ring.md +38 -0
  216. package/docs/components/usa-progress.md +34 -0
  217. package/docs/components/usa-prop-panel.md +34 -0
  218. package/docs/components/usa-pull-cord.md +32 -0
  219. package/docs/components/usa-pull-refresh.md +37 -0
  220. package/docs/components/usa-radar.md +32 -0
  221. package/docs/components/usa-reactions.md +32 -0
  222. package/docs/components/usa-red-envelope.md +32 -0
  223. package/docs/components/usa-retro-button.md +34 -0
  224. package/docs/components/usa-reveal.md +36 -0
  225. package/docs/components/usa-ripple.md +32 -0
  226. package/docs/components/usa-route-transition.md +38 -0
  227. package/docs/components/usa-scene.md +38 -0
  228. package/docs/components/usa-scramble.md +32 -0
  229. package/docs/components/usa-scroll-highlight.md +34 -0
  230. package/docs/components/usa-scroll-progress.md +36 -0
  231. package/docs/components/usa-scroll-scene.md +66 -0
  232. package/docs/components/usa-scrolly.md +40 -0
  233. package/docs/components/usa-segmented.md +40 -0
  234. package/docs/components/usa-shader.md +74 -0
  235. package/docs/components/usa-sheet.md +42 -0
  236. package/docs/components/usa-shimmer-text.md +32 -0
  237. package/docs/components/usa-shortcut.md +34 -0
  238. package/docs/components/usa-skeleton-reveal.md +42 -0
  239. package/docs/components/usa-skeleton.md +36 -0
  240. package/docs/components/usa-sketch-chart.md +32 -0
  241. package/docs/components/usa-slider.md +32 -0
  242. package/docs/components/usa-sparkline.md +32 -0
  243. package/docs/components/usa-spatial-card.md +40 -0
  244. package/docs/components/usa-spinner.md +34 -0
  245. package/docs/components/usa-splash.md +36 -0
  246. package/docs/components/usa-split-text.md +32 -0
  247. package/docs/components/usa-spotlight.md +40 -0
  248. package/docs/components/usa-spring.md +42 -0
  249. package/docs/components/usa-stagger.md +40 -0
  250. package/docs/components/usa-star-rating.md +34 -0
  251. package/docs/components/usa-stepper.md +42 -0
  252. package/docs/components/usa-sticky-stack.md +40 -0
  253. package/docs/components/usa-sticky-wall.md +40 -0
  254. package/docs/components/usa-stories.md +38 -0
  255. package/docs/components/usa-story.md +80 -0
  256. package/docs/components/usa-suggestion-chips.md +32 -0
  257. package/docs/components/usa-swipe-deck.md +40 -0
  258. package/docs/components/usa-swipeable.md +36 -0
  259. package/docs/components/usa-switch.md +32 -0
  260. package/docs/components/usa-tab-bar.md +46 -0
  261. package/docs/components/usa-tabs.md +40 -0
  262. package/docs/components/usa-terminal.md +38 -0
  263. package/docs/components/usa-text-rotate.md +32 -0
  264. package/docs/components/usa-text-splitter.md +60 -0
  265. package/docs/components/usa-theme-surface.md +36 -0
  266. package/docs/components/usa-theme-switcher.md +32 -0
  267. package/docs/components/usa-tilt.md +36 -0
  268. package/docs/components/usa-timeline.md +40 -0
  269. package/docs/components/usa-tip.md +44 -0
  270. package/docs/components/usa-toast-stack.md +36 -0
  271. package/docs/components/usa-toaster.md +36 -0
  272. package/docs/components/usa-typewriter.md +32 -0
  273. package/docs/components/usa-upload-progress.md +33 -0
  274. package/docs/components/usa-video-card.md +40 -0
  275. package/docs/components/usa-view-switch.md +38 -0
  276. package/docs/components/usa-voice-button.md +33 -0
  277. package/docs/components/usa-volume-knob.md +32 -0
  278. package/docs/components/usa-water-ripple.md +36 -0
  279. package/docs/components/usa-wave-text.md +32 -0
  280. package/docs/components/usa-weather-card.md +32 -0
  281. package/docs/components/usa-worker-canvas.md +32 -0
  282. package/docs/components/usa-xp-bar.md +33 -0
  283. package/docs/components.md +95 -0
  284. package/docs/runtime/format-sprite.md +60 -0
  285. package/docs/runtime/format-svg.md +62 -0
  286. package/docs/runtime/scroll.md +61 -0
  287. package/docs/runtime/text.md +59 -0
  288. package/package.json +45 -3
  289. package/dist/chunks/tween-DDObu9iA.js.map +0 -1
  290. package/dist/chunks/tween-JEthWrjo.cjs.map +0 -1
@@ -0,0 +1,457 @@
1
+ 'use strict';
2
+
3
+ var registry = require('../chunks/registry-CSVil2qJ.cjs');
4
+ var tween = require('../chunks/tween-CFN0WcOb.cjs');
5
+ require('../chunks/ticker-gHv6pNfx.cjs');
6
+
7
+ /**
8
+ * `motionary/runtime/format-svg` (10.2) — SVG animation with the runtime
9
+ * (original implementation):
10
+ *
11
+ * - **Path geometry** without the DOM (SSR / workers): `parsePath(d)` (all
12
+ * commands, relative + absolute, arcs), `flattenPath(d)`, `pathLength(d)`,
13
+ * `pointAtLength(d, len)`, `samplePath(d, n)`.
14
+ * - **Path morphing**: `morphPath(from, to, { points })` → `(p) => d` — both
15
+ * paths are resampled to the same number of points (any command mix, any
16
+ * point counts), aligned to the closest start point, then interpolated.
17
+ * - **SMIL playback**: `playSmil(svg)` reads `<animate>`, `<set>`,
18
+ * `<animateTransform>` (translate / scale / rotate / skewX / skewY) and
19
+ * `<animateMotion>` (`path` or `<mpath>`, `rotate="auto"`) — `from` / `to` /
20
+ * `by` / `values`, `keyTimes`, `keySplines` (`calcMode="spline"`),
21
+ * `calcMode="discrete"`, `dur`, numeric `begin` offsets, `repeatCount`
22
+ * (incl. `indefinite`), `fill="freeze"` — and replays them as a runtime
23
+ * timeline (seek, scrub, reverse, timeScale) instead of the browser's SMIL clock.
24
+ * - CSS-animated SVG: use `motionary/runtime/format-css` (`@keyframes` in the SVG's `<style>`).
25
+ *
26
+ * Not supported (documented): event / syncbase `begin` values (`click`,
27
+ * `a.end`), `accumulate` / `additive="sum"`, `<animateColor>` (deprecated).
28
+ */
29
+ const ARGS = { M: 2, L: 2, H: 1, V: 1, C: 6, S: 4, Q: 4, T: 2, A: 7, Z: 0 };
30
+ /** Parse path data into absolute commands (M L C Q A Z; H/V/S/T expanded). */
31
+ function parsePath(d) {
32
+ const toks = d.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g) || [];
33
+ const out = [];
34
+ let i = 0, cmd = '', x = 0, y = 0, sx = 0, sy = 0, lc = null, lq = null;
35
+ const num = () => parseFloat(toks[i++]);
36
+ while (i < toks.length) {
37
+ if (/[a-zA-Z]/.test(toks[i]))
38
+ cmd = toks[i++];
39
+ else if (!cmd)
40
+ throw new Error('[motionary] format-svg: path must start with a command');
41
+ const C = cmd.toUpperCase(), rel = cmd !== C;
42
+ const n = ARGS[C];
43
+ if (n === undefined)
44
+ throw new Error(`[motionary] format-svg: unknown path command "${cmd}"`);
45
+ if (C === 'Z') {
46
+ out.push(['Z']);
47
+ x = sx;
48
+ y = sy;
49
+ lc = lq = null;
50
+ continue;
51
+ }
52
+ const a = [];
53
+ for (let k = 0; k < n; k++)
54
+ a.push(num());
55
+ if (a.some((v) => Number.isNaN(v)))
56
+ break;
57
+ const ox = rel ? x : 0, oy = rel ? y : 0;
58
+ switch (C) {
59
+ case 'M':
60
+ x = a[0] + ox;
61
+ y = a[1] + oy;
62
+ sx = x;
63
+ sy = y;
64
+ out.push(['M', x, y]);
65
+ cmd = rel ? 'l' : 'L';
66
+ lc = lq = null;
67
+ break;
68
+ case 'L':
69
+ x = a[0] + ox;
70
+ y = a[1] + oy;
71
+ out.push(['L', x, y]);
72
+ lc = lq = null;
73
+ break;
74
+ case 'H':
75
+ x = a[0] + ox;
76
+ out.push(['L', x, y]);
77
+ lc = lq = null;
78
+ break;
79
+ case 'V':
80
+ y = a[0] + (rel ? y : 0);
81
+ out.push(['L', x, y]);
82
+ lc = lq = null;
83
+ break;
84
+ case 'C': {
85
+ const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy, a[4] + ox, a[5] + oy];
86
+ out.push(['C', ...c]);
87
+ lc = [c[2], c[3]];
88
+ x = c[4];
89
+ y = c[5];
90
+ lq = null;
91
+ break;
92
+ }
93
+ case 'S': {
94
+ const c1 = lc ? [2 * x - lc[0], 2 * y - lc[1]] : [x, y];
95
+ const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy];
96
+ out.push(['C', c1[0], c1[1], ...c]);
97
+ lc = [c[0], c[1]];
98
+ x = c[2];
99
+ y = c[3];
100
+ lq = null;
101
+ break;
102
+ }
103
+ case 'Q': {
104
+ const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy];
105
+ out.push(['Q', ...c]);
106
+ lq = [c[0], c[1]];
107
+ x = c[2];
108
+ y = c[3];
109
+ lc = null;
110
+ break;
111
+ }
112
+ case 'T': {
113
+ const c1 = lq ? [2 * x - lq[0], 2 * y - lq[1]] : [x, y];
114
+ x = a[0] + ox;
115
+ y = a[1] + oy;
116
+ out.push(['Q', c1[0], c1[1], x, y]);
117
+ lq = c1;
118
+ lc = null;
119
+ break;
120
+ }
121
+ case 'A': {
122
+ x = a[5] + ox;
123
+ y = a[6] + oy;
124
+ out.push(['A', a[0], a[1], a[2], a[3], a[4], x, y]);
125
+ lc = lq = null;
126
+ break;
127
+ }
128
+ }
129
+ }
130
+ return out;
131
+ }
132
+ /** Endpoint-parameterised arc → points (SVG spec F.6.5 conversion). */
133
+ function arcPoints(x1, y1, rx, ry, phiDeg, large, sweep, x2, y2, seg) {
134
+ if (!rx || !ry)
135
+ return [[x2, y2]];
136
+ rx = Math.abs(rx);
137
+ ry = Math.abs(ry);
138
+ const phi = (phiDeg * Math.PI) / 180, cos = Math.cos(phi), sin = Math.sin(phi);
139
+ const dx = (x1 - x2) / 2, dy = (y1 - y2) / 2;
140
+ const xp = cos * dx + sin * dy, yp = -sin * dx + cos * dy;
141
+ const lam = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);
142
+ if (lam > 1) {
143
+ rx *= Math.sqrt(lam);
144
+ ry *= Math.sqrt(lam);
145
+ }
146
+ const num = rx * rx * ry * ry - rx * rx * yp * yp - ry * ry * xp * xp;
147
+ const den = rx * rx * yp * yp + ry * ry * xp * xp;
148
+ let co = Math.sqrt(Math.max(0, num / den));
149
+ if (large === sweep)
150
+ co = -co;
151
+ const cxp = (co * rx * yp) / ry, cyp = (-co * ry * xp) / rx;
152
+ const cx = cos * cxp - sin * cyp + (x1 + x2) / 2, cy = sin * cxp + cos * cyp + (y1 + y2) / 2;
153
+ const ang = (ux, uy, vx, vy) => Math.atan2(ux * vy - uy * vx, ux * vx + uy * vy);
154
+ const t1 = ang(1, 0, (xp - cxp) / rx, (yp - cyp) / ry);
155
+ let dt = ang((xp - cxp) / rx, (yp - cyp) / ry, (-xp - cxp) / rx, (-yp - cyp) / ry);
156
+ if (!sweep && dt > 0)
157
+ dt -= 2 * Math.PI;
158
+ if (sweep && dt < 0)
159
+ dt += 2 * Math.PI;
160
+ const n = Math.max(2, Math.ceil((Math.abs(dt) / (Math.PI / 2)) * seg));
161
+ const pts = [];
162
+ for (let k = 1; k <= n; k++) {
163
+ const t = t1 + (dt * k) / n;
164
+ pts.push([cx + rx * Math.cos(t) * cos - ry * Math.sin(t) * sin, cy + rx * Math.cos(t) * sin + ry * Math.sin(t) * cos]);
165
+ }
166
+ return pts;
167
+ }
168
+ /** Flatten a path into polylines (one per subpath); `segments` points per curve. */
169
+ function flattenPath(d, segments = 16) {
170
+ const cmds = typeof d === 'string' ? parsePath(d) : d;
171
+ const subs = [];
172
+ let cur = [], x = 0, y = 0;
173
+ for (const c of cmds) {
174
+ const [k, ...a] = c;
175
+ if (k === 'M') {
176
+ if (cur.length)
177
+ subs.push(cur);
178
+ cur = [[a[0], a[1]]];
179
+ x = a[0];
180
+ y = a[1];
181
+ continue;
182
+ }
183
+ if (!cur.length)
184
+ cur = [[x, y]];
185
+ if (k === 'L')
186
+ cur.push([a[0], a[1]]);
187
+ else if (k === 'C')
188
+ for (let i = 1; i <= segments; i++) {
189
+ const t = i / segments, u = 1 - t;
190
+ cur.push([u * u * u * x + 3 * u * u * t * a[0] + 3 * u * t * t * a[2] + t * t * t * a[4], u * u * u * y + 3 * u * u * t * a[1] + 3 * u * t * t * a[3] + t * t * t * a[5]]);
191
+ }
192
+ else if (k === 'Q')
193
+ for (let i = 1; i <= segments; i++) {
194
+ const t = i / segments, u = 1 - t;
195
+ cur.push([u * u * x + 2 * u * t * a[0] + t * t * a[2], u * u * y + 2 * u * t * a[1] + t * t * a[3]]);
196
+ }
197
+ else if (k === 'A')
198
+ cur.push(...arcPoints(x, y, a[0], a[1], a[2], a[3], a[4], a[5], a[6], segments / 4));
199
+ else if (k === 'Z') {
200
+ cur.push([cur[0][0], cur[0][1]]);
201
+ subs.push(cur);
202
+ x = cur[0][0];
203
+ y = cur[0][1];
204
+ cur = [];
205
+ continue;
206
+ }
207
+ const last = cur[cur.length - 1];
208
+ x = last[0];
209
+ y = last[1];
210
+ }
211
+ if (cur.length)
212
+ subs.push(cur);
213
+ return subs;
214
+ }
215
+ const dist = (a, b) => Math.hypot(b[0] - a[0], b[1] - a[1]);
216
+ /** Total length of a path. */
217
+ function pathLength(d) {
218
+ return flattenPath(d, 48).reduce((s, pl) => s + pl.slice(1).reduce((t, p, i) => t + dist(pl[i], p), 0), 0);
219
+ }
220
+ /** Point (and tangent angle, degrees) at a distance along the path. */
221
+ function pointAtLength(d, len) {
222
+ const pl = flattenPath(d, 48).flat();
223
+ let acc = 0;
224
+ for (let i = 1; i < pl.length; i++) {
225
+ const s = dist(pl[i - 1], pl[i]);
226
+ if (acc + s >= len || i === pl.length - 1) {
227
+ const t = s ? Math.min(1, Math.max(0, (len - acc) / s)) : 0;
228
+ return { x: pl[i - 1][0] + (pl[i][0] - pl[i - 1][0]) * t, y: pl[i - 1][1] + (pl[i][1] - pl[i - 1][1]) * t, angle: (Math.atan2(pl[i][1] - pl[i - 1][1], pl[i][0] - pl[i - 1][0]) * 180) / Math.PI };
229
+ }
230
+ acc += s;
231
+ }
232
+ return { x: pl[0]?.[0] ?? 0, y: pl[0]?.[1] ?? 0, angle: 0 };
233
+ }
234
+ /** `n` points evenly spaced along the path (all subpaths joined). */
235
+ function samplePath(d, n = 64) {
236
+ const total = pathLength(d);
237
+ return Array.from({ length: n }, (_, i) => {
238
+ const p = pointAtLength(d, (total * i) / (n - 1 || 1));
239
+ return [p.x, p.y];
240
+ });
241
+ }
242
+ const r3 = (v) => Math.round(v * 1000) / 1000;
243
+ const closed = (d) => /z\s*$/i.test(d.trim());
244
+ /**
245
+ * Morph between two paths of any shape: `const f = morphPath(a, b); el.setAttribute('d', f(0.5))`.
246
+ * Closed paths are rotated so their start points line up (less twisting).
247
+ */
248
+ function morphPath(from, to, o = {}) {
249
+ const n = o.points ?? 64;
250
+ const A = samplePath(from, n);
251
+ let B = samplePath(to, n);
252
+ const isClosed = closed(from) && closed(to);
253
+ if (isClosed) {
254
+ let best = 0, bestD = Infinity;
255
+ for (let s = 0; s < n; s++) {
256
+ let sum = 0;
257
+ for (let i = 0; i < n; i += 4)
258
+ sum += dist(A[i], B[(i + s) % n]);
259
+ if (sum < bestD) {
260
+ bestD = sum;
261
+ best = s;
262
+ }
263
+ }
264
+ B = B.map((_, i) => B[(i + best) % n]);
265
+ }
266
+ return (p) => {
267
+ if (p <= 0)
268
+ return from;
269
+ if (p >= 1)
270
+ return to;
271
+ return 'M' + A.map((a, i) => `${r3(a[0] + (B[i][0] - a[0]) * p)} ${r3(a[1] + (B[i][1] - a[1]) * p)}`).join('L') + (isClosed ? 'Z' : '');
272
+ };
273
+ }
274
+ /* ------------------------------------------------------------------ SMIL */
275
+ /** '2s', '150ms', '1.5', 'indefinite' → ms (NaN for indefinite / unsupported). */
276
+ function smilTime(v) {
277
+ if (!v)
278
+ return NaN;
279
+ const s = v.trim();
280
+ const m = /^(-?[\d.]+)(ms|s|min|h)?$/.exec(s);
281
+ if (!m) {
282
+ const c = /^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/.exec(s);
283
+ return c ? ((+(c[1] || 0) * 60 + +c[2]) * 60 + +c[3]) * 1000 : NaN;
284
+ }
285
+ const n = parseFloat(m[1]);
286
+ return m[2] === 'ms' ? n : m[2] === 'min' ? n * 60000 : m[2] === 'h' ? n * 3600000 : n * 1000;
287
+ }
288
+ const numList = (s) => s.trim().split(/[\s,]+/).filter(Boolean).map(Number);
289
+ const lerpNumbers = (a, b, p) => {
290
+ const x = numList(a), y = numList(b);
291
+ return x.map((v, i) => r3(v + ((y[i] ?? v) - v) * p)).join(' ');
292
+ };
293
+ const lerpAny = (a, b, p) => {
294
+ try {
295
+ const x = tween.parseValue(a), y = tween.parseValue(b);
296
+ if (x.kind === 'str' || y.kind === 'str')
297
+ throw 0; // number lists / keywords: handled below
298
+ if (x.kind === 'col' || y.kind === 'col') {
299
+ const ca = x.kind === 'col' ? x.c : [0, 0, 0, 1], cb = y.kind === 'col' ? y.c : [0, 0, 0, 1];
300
+ const c = ca.map((v, i) => v + (cb[i] - v) * p);
301
+ return `rgba(${Math.round(c[0])},${Math.round(c[1])},${Math.round(c[2])},${r3(c[3])})`;
302
+ }
303
+ return `${r3(x.v + (y.v - x.v) * p)}${y.u || x.u}`;
304
+ }
305
+ catch {
306
+ if (/^[-\d.\s,e]+$/i.test(a) && /^[-\d.\s,e]+$/i.test(b))
307
+ return lerpNumbers(a, b, p);
308
+ return p < 0.5 ? a : b;
309
+ }
310
+ };
311
+ /** Read the SMIL animation elements of an SVG (without playing them). */
312
+ function readSmil(svg) {
313
+ const out = [];
314
+ svg.querySelectorAll('animate, set, animateTransform, animateMotion').forEach((el) => {
315
+ const kind = el.localName;
316
+ const href = el.getAttribute('href') || el.getAttribute('xlink:href');
317
+ const target = href ? svg.querySelector(href) : el.parentElement;
318
+ if (!target)
319
+ return;
320
+ const begin = smilTime((el.getAttribute('begin') || '0').split(';')[0]);
321
+ const dur = kind === 'set' ? smilTime(el.getAttribute('dur')) || 0 : smilTime(el.getAttribute('dur'));
322
+ const rc = el.getAttribute('repeatCount');
323
+ const rd = smilTime(el.getAttribute('repeatDur'));
324
+ let repeat = rc === 'indefinite' || el.getAttribute('repeatDur') === 'indefinite' ? -1 : rc ? Math.max(0, Math.ceil(parseFloat(rc)) - 1) : 0;
325
+ if (!rc && rd > 0 && dur > 0)
326
+ repeat = Math.ceil(rd / dur) - 1;
327
+ const attribute = kind === 'animateTransform' ? 'transform' : kind === 'animateMotion' ? 'transform' : el.getAttribute('attributeName') || '';
328
+ let values;
329
+ const v = el.getAttribute('values');
330
+ if (kind === 'set')
331
+ values = [el.getAttribute('to') || ''];
332
+ else if (kind === 'animateMotion') {
333
+ const mp = el.querySelector('mpath');
334
+ const ref = mp && (mp.getAttribute('href') || mp.getAttribute('xlink:href'));
335
+ values = [(ref && svg.querySelector(ref)?.getAttribute('d')) || el.getAttribute('path') || ''];
336
+ }
337
+ else if (v)
338
+ values = v.split(';').map((s) => s.trim()).filter((s) => s !== '');
339
+ else {
340
+ const base = target.getAttribute(attribute) || (attribute === 'opacity' ? '1' : '0');
341
+ const from = el.getAttribute('from') ?? base;
342
+ const by = el.getAttribute('by');
343
+ const to = el.getAttribute('to') ?? (by !== null ? numList(from).map((x, i) => x + (numList(by)[i] ?? 0)).join(' ') : base);
344
+ values = [from, to];
345
+ }
346
+ const kt = el.getAttribute('keyTimes');
347
+ out.push({ kind, target, attribute, begin: Number.isFinite(begin) ? begin : 0, dur: Number.isFinite(dur) ? dur : 0, repeat, freeze: el.getAttribute('fill') === 'freeze' || (kind === 'set' && !el.getAttribute('dur')) /* a <set> without dur holds its value */, values, keyTimes: kt ? kt.split(';').map(Number) : [], calcMode: el.getAttribute('calcMode') || (kind === 'animateMotion' ? 'paced' : 'linear'), type: el.getAttribute('type') || undefined, ...(el.getAttribute('rotate') ? { rotate: el.getAttribute('rotate') } : {}), ...(el.getAttribute('keySplines') ? { keySplines: el.getAttribute('keySplines') } : {}) });
348
+ });
349
+ return out;
350
+ }
351
+ /** One SMIL animation replayed as a runtime Playable. */
352
+ class SmilTrack extends tween.Playable {
353
+ constructor(info) {
354
+ super({ repeat: info.repeat });
355
+ this.info = info;
356
+ this.morphs = [];
357
+ this.base = info.target.getAttribute(info.attribute);
358
+ this.interp = info.attribute === 'd' ? (a, b, p) => this.morph(a, b)(p) : info.kind === 'animateTransform' ? lerpNumbers : lerpAny;
359
+ this.splines = (info.keySplines || '').split(';').filter((s) => s.trim()).map((s) => { const n = numList(s); return tween.cubicBezier(n[0], n[1], n[2], n[3]); });
360
+ }
361
+ morph(a, b) {
362
+ const key = a + '|' + b;
363
+ const hit = this.morphs[key];
364
+ return hit || (this.morphs[key] = morphPath(a, b));
365
+ }
366
+ get duration() {
367
+ return this.info.dur;
368
+ }
369
+ write(v) {
370
+ const { kind, target, type } = this.info;
371
+ if (kind === 'animateTransform')
372
+ target.setAttribute('transform', `${type || 'translate'}(${v})`);
373
+ else
374
+ target.setAttribute(this.info.attribute, v);
375
+ }
376
+ renderLocal(ms, ended) {
377
+ const i = this.info;
378
+ if (ended && ms >= i.dur && !i.freeze && this.repeat >= 0) {
379
+ if (this.base === null)
380
+ i.target.removeAttribute(i.attribute);
381
+ else
382
+ i.target.setAttribute(i.attribute, this.base);
383
+ return;
384
+ }
385
+ const p = i.dur ? Math.min(1, ms / i.dur) : 1;
386
+ if (i.kind === 'set')
387
+ return this.write(i.values[0]);
388
+ if (i.kind === 'animateMotion') {
389
+ const d = i.values[0];
390
+ const len = pathLength(d);
391
+ const pt = pointAtLength(d, len * p);
392
+ const rot = i.rotate;
393
+ const a = rot === 'auto' ? pt.angle : rot === 'auto-reverse' ? pt.angle + 180 : parseFloat(rot) || 0;
394
+ i.target.setAttribute('transform', `translate(${r3(pt.x)} ${r3(pt.y)})${a ? ` rotate(${r3(a)})` : ''}`);
395
+ return;
396
+ }
397
+ const vals = i.values;
398
+ if (vals.length === 1)
399
+ return this.write(vals[0]);
400
+ const kt = i.keyTimes.length === vals.length ? i.keyTimes : vals.map((_, k) => k / (vals.length - 1));
401
+ if (i.calcMode === 'discrete') {
402
+ const kd = i.keyTimes.length === vals.length ? i.keyTimes : vals.map((_, k) => k / vals.length);
403
+ let k = 0;
404
+ while (k < kd.length - 1 && p >= kd[k + 1])
405
+ k++;
406
+ return this.write(vals[k]);
407
+ }
408
+ let k = 0;
409
+ while (k < kt.length - 2 && p > kt[k + 1])
410
+ k++;
411
+ const span = kt[k + 1] - kt[k] || 1;
412
+ let local = Math.min(1, Math.max(0, (p - kt[k]) / span));
413
+ if (i.calcMode === 'spline' && this.splines[k])
414
+ local = this.splines[k](local);
415
+ this.write(this.interp(vals[k], vals[k + 1], local));
416
+ }
417
+ }
418
+ /**
419
+ * Replay an SVG's SMIL animations with the runtime. The SMIL elements are
420
+ * detached while the runtime drives the attributes (call `restore()` to put
421
+ * them back). Playing unless `paused: true`.
422
+ */
423
+ function playSmil(svg, o = {}) {
424
+ const animations = readSmil(svg);
425
+ const els = Array.from(svg.querySelectorAll('animate, set, animateTransform, animateMotion'));
426
+ const parents = els.map((e) => [e, e.parentNode, e.nextSibling]);
427
+ els.forEach((e) => e.remove());
428
+ const tl = new tween.Timeline({});
429
+ for (const a of animations)
430
+ tl.add(new SmilTrack(a), a.begin);
431
+ if (o.timeScale)
432
+ tl.timeScale = o.timeScale;
433
+ if (!o.paused)
434
+ tl.play();
435
+ return {
436
+ timeline: tl,
437
+ animations,
438
+ restore() {
439
+ tl.kill();
440
+ parents.forEach(([e, p, next]) => p?.insertBefore(e, next && next.parentNode === p ? next : null));
441
+ },
442
+ };
443
+ }
444
+ /** The module object for `use(formatSvg)`. */
445
+ const formatSvg = { id: 'format-svg', version: registry.RUNTIME_VERSION, requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };
446
+
447
+ exports.flattenPath = flattenPath;
448
+ exports.formatSvg = formatSvg;
449
+ exports.morphPath = morphPath;
450
+ exports.parsePath = parsePath;
451
+ exports.pathLength = pathLength;
452
+ exports.playSmil = playSmil;
453
+ exports.pointAtLength = pointAtLength;
454
+ exports.readSmil = readSmil;
455
+ exports.samplePath = samplePath;
456
+ exports.smilTime = smilTime;
457
+ //# sourceMappingURL=format-svg.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-svg.cjs","sources":["../../src/runtime/format-svg.ts"],"sourcesContent":["/**\n * `motionary/runtime/format-svg` (10.2) — SVG animation with the runtime\n * (original implementation):\n *\n * - **Path geometry** without the DOM (SSR / workers): `parsePath(d)` (all\n * commands, relative + absolute, arcs), `flattenPath(d)`, `pathLength(d)`,\n * `pointAtLength(d, len)`, `samplePath(d, n)`.\n * - **Path morphing**: `morphPath(from, to, { points })` → `(p) => d` — both\n * paths are resampled to the same number of points (any command mix, any\n * point counts), aligned to the closest start point, then interpolated.\n * - **SMIL playback**: `playSmil(svg)` reads `<animate>`, `<set>`,\n * `<animateTransform>` (translate / scale / rotate / skewX / skewY) and\n * `<animateMotion>` (`path` or `<mpath>`, `rotate=\"auto\"`) — `from` / `to` /\n * `by` / `values`, `keyTimes`, `keySplines` (`calcMode=\"spline\"`),\n * `calcMode=\"discrete\"`, `dur`, numeric `begin` offsets, `repeatCount`\n * (incl. `indefinite`), `fill=\"freeze\"` — and replays them as a runtime\n * timeline (seek, scrub, reverse, timeScale) instead of the browser's SMIL clock.\n * - CSS-animated SVG: use `motionary/runtime/format-css` (`@keyframes` in the SVG's `<style>`).\n *\n * Not supported (documented): event / syncbase `begin` values (`click`,\n * `a.end`), `accumulate` / `additive=\"sum\"`, `<animateColor>` (deprecated).\n */\nimport { RUNTIME_VERSION, type RuntimeModule } from './registry';\nimport { Playable, Timeline, parseValue } from './tween';\nimport { cubicBezier, type Ease } from './ease';\n\ntype Pt = [number, number];\nexport type PathCommand = [string, ...number[]];\n\nconst ARGS: Record<string, number> = { M: 2, L: 2, H: 1, V: 1, C: 6, S: 4, Q: 4, T: 2, A: 7, Z: 0 };\n\n/** Parse path data into absolute commands (M L C Q A Z; H/V/S/T expanded). */\nexport function parsePath(d: string): PathCommand[] {\n const toks = d.match(/[a-zA-Z]|[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?/g) || [];\n const out: PathCommand[] = [];\n let i = 0, cmd = '', x = 0, y = 0, sx = 0, sy = 0, lc: Pt | null = null, lq: Pt | null = null;\n const num = () => parseFloat(toks[i++]);\n while (i < toks.length) {\n if (/[a-zA-Z]/.test(toks[i])) cmd = toks[i++];\n else if (!cmd) throw new Error('[motionary] format-svg: path must start with a command');\n const C = cmd.toUpperCase(), rel = cmd !== C;\n const n = ARGS[C];\n if (n === undefined) throw new Error(`[motionary] format-svg: unknown path command \"${cmd}\"`);\n if (C === 'Z') {\n out.push(['Z']);\n x = sx; y = sy; lc = lq = null;\n continue;\n }\n const a: number[] = [];\n for (let k = 0; k < n; k++) a.push(num());\n if (a.some((v) => Number.isNaN(v))) break;\n const ox = rel ? x : 0, oy = rel ? y : 0;\n switch (C) {\n case 'M': x = a[0] + ox; y = a[1] + oy; sx = x; sy = y; out.push(['M', x, y]); cmd = rel ? 'l' : 'L'; lc = lq = null; break;\n case 'L': x = a[0] + ox; y = a[1] + oy; out.push(['L', x, y]); lc = lq = null; break;\n case 'H': x = a[0] + ox; out.push(['L', x, y]); lc = lq = null; break;\n case 'V': y = a[0] + (rel ? y : 0); out.push(['L', x, y]); lc = lq = null; break;\n case 'C': { const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy, a[4] + ox, a[5] + oy]; out.push(['C', ...c]); lc = [c[2], c[3]]; x = c[4]; y = c[5]; lq = null; break; }\n case 'S': { const c1: Pt = lc ? [2 * x - lc[0], 2 * y - lc[1]] : [x, y]; const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy]; out.push(['C', c1[0], c1[1], ...c]); lc = [c[0], c[1]]; x = c[2]; y = c[3]; lq = null; break; }\n case 'Q': { const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy]; out.push(['Q', ...c]); lq = [c[0], c[1]]; x = c[2]; y = c[3]; lc = null; break; }\n case 'T': { const c1: Pt = lq ? [2 * x - lq[0], 2 * y - lq[1]] : [x, y]; x = a[0] + ox; y = a[1] + oy; out.push(['Q', c1[0], c1[1], x, y]); lq = c1; lc = null; break; }\n case 'A': { x = a[5] + ox; y = a[6] + oy; out.push(['A', a[0], a[1], a[2], a[3], a[4], x, y]); lc = lq = null; break; }\n }\n }\n return out;\n}\n\n/** Endpoint-parameterised arc → points (SVG spec F.6.5 conversion). */\nfunction arcPoints(x1: number, y1: number, rx: number, ry: number, phiDeg: number, large: number, sweep: number, x2: number, y2: number, seg: number): Pt[] {\n if (!rx || !ry) return [[x2, y2]];\n rx = Math.abs(rx); ry = Math.abs(ry);\n const phi = (phiDeg * Math.PI) / 180, cos = Math.cos(phi), sin = Math.sin(phi);\n const dx = (x1 - x2) / 2, dy = (y1 - y2) / 2;\n const xp = cos * dx + sin * dy, yp = -sin * dx + cos * dy;\n const lam = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lam > 1) { rx *= Math.sqrt(lam); ry *= Math.sqrt(lam); }\n const num = rx * rx * ry * ry - rx * rx * yp * yp - ry * ry * xp * xp;\n const den = rx * rx * yp * yp + ry * ry * xp * xp;\n let co = Math.sqrt(Math.max(0, num / den));\n if (large === sweep) co = -co;\n const cxp = (co * rx * yp) / ry, cyp = (-co * ry * xp) / rx;\n const cx = cos * cxp - sin * cyp + (x1 + x2) / 2, cy = sin * cxp + cos * cyp + (y1 + y2) / 2;\n const ang = (ux: number, uy: number, vx: number, vy: number) => Math.atan2(ux * vy - uy * vx, ux * vx + uy * vy);\n const t1 = ang(1, 0, (xp - cxp) / rx, (yp - cyp) / ry);\n let dt = ang((xp - cxp) / rx, (yp - cyp) / ry, (-xp - cxp) / rx, (-yp - cyp) / ry);\n if (!sweep && dt > 0) dt -= 2 * Math.PI;\n if (sweep && dt < 0) dt += 2 * Math.PI;\n const n = Math.max(2, Math.ceil((Math.abs(dt) / (Math.PI / 2)) * seg));\n const pts: Pt[] = [];\n for (let k = 1; k <= n; k++) {\n const t = t1 + (dt * k) / n;\n pts.push([cx + rx * Math.cos(t) * cos - ry * Math.sin(t) * sin, cy + rx * Math.cos(t) * sin + ry * Math.sin(t) * cos]);\n }\n return pts;\n}\n\n/** Flatten a path into polylines (one per subpath); `segments` points per curve. */\nexport function flattenPath(d: string | PathCommand[], segments = 16): Pt[][] {\n const cmds = typeof d === 'string' ? parsePath(d) : d;\n const subs: Pt[][] = [];\n let cur: Pt[] = [], x = 0, y = 0;\n for (const c of cmds) {\n const [k, ...a] = c;\n if (k === 'M') { if (cur.length) subs.push(cur); cur = [[a[0], a[1]]]; x = a[0]; y = a[1]; continue; }\n if (!cur.length) cur = [[x, y]];\n if (k === 'L') cur.push([a[0], a[1]]);\n else if (k === 'C') for (let i = 1; i <= segments; i++) { const t = i / segments, u = 1 - t; cur.push([u * u * u * x + 3 * u * u * t * a[0] + 3 * u * t * t * a[2] + t * t * t * a[4], u * u * u * y + 3 * u * u * t * a[1] + 3 * u * t * t * a[3] + t * t * t * a[5]]); }\n else if (k === 'Q') for (let i = 1; i <= segments; i++) { const t = i / segments, u = 1 - t; cur.push([u * u * x + 2 * u * t * a[0] + t * t * a[2], u * u * y + 2 * u * t * a[1] + t * t * a[3]]); }\n else if (k === 'A') cur.push(...arcPoints(x, y, a[0], a[1], a[2], a[3], a[4], a[5], a[6], segments / 4));\n else if (k === 'Z') { cur.push([cur[0][0], cur[0][1]]); subs.push(cur); x = cur[0][0]; y = cur[0][1]; cur = []; continue; }\n const last = cur[cur.length - 1];\n x = last[0]; y = last[1];\n }\n if (cur.length) subs.push(cur);\n return subs;\n}\n\nconst dist = (a: Pt, b: Pt) => Math.hypot(b[0] - a[0], b[1] - a[1]);\n\n/** Total length of a path. */\nexport function pathLength(d: string | PathCommand[]): number {\n return flattenPath(d, 48).reduce((s, pl) => s + pl.slice(1).reduce((t, p, i) => t + dist(pl[i], p), 0), 0);\n}\n\n/** Point (and tangent angle, degrees) at a distance along the path. */\nexport function pointAtLength(d: string | PathCommand[], len: number): { x: number; y: number; angle: number } {\n const pl = flattenPath(d, 48).flat();\n let acc = 0;\n for (let i = 1; i < pl.length; i++) {\n const s = dist(pl[i - 1], pl[i]);\n if (acc + s >= len || i === pl.length - 1) {\n const t = s ? Math.min(1, Math.max(0, (len - acc) / s)) : 0;\n return { x: pl[i - 1][0] + (pl[i][0] - pl[i - 1][0]) * t, y: pl[i - 1][1] + (pl[i][1] - pl[i - 1][1]) * t, angle: (Math.atan2(pl[i][1] - pl[i - 1][1], pl[i][0] - pl[i - 1][0]) * 180) / Math.PI };\n }\n acc += s;\n }\n return { x: pl[0]?.[0] ?? 0, y: pl[0]?.[1] ?? 0, angle: 0 };\n}\n\n/** `n` points evenly spaced along the path (all subpaths joined). */\nexport function samplePath(d: string | PathCommand[], n = 64): Pt[] {\n const total = pathLength(d);\n return Array.from({ length: n }, (_, i) => {\n const p = pointAtLength(d, (total * i) / (n - 1 || 1));\n return [p.x, p.y] as Pt;\n });\n}\n\nconst r3 = (v: number) => Math.round(v * 1000) / 1000;\nconst closed = (d: string) => /z\\s*$/i.test(d.trim());\n\n/**\n * Morph between two paths of any shape: `const f = morphPath(a, b); el.setAttribute('d', f(0.5))`.\n * Closed paths are rotated so their start points line up (less twisting).\n */\nexport function morphPath(from: string, to: string, o: { points?: number } = {}): (p: number) => string {\n const n = o.points ?? 64;\n const A = samplePath(from, n);\n let B = samplePath(to, n);\n const isClosed = closed(from) && closed(to);\n if (isClosed) {\n let best = 0, bestD = Infinity;\n for (let s = 0; s < n; s++) {\n let sum = 0;\n for (let i = 0; i < n; i += 4) sum += dist(A[i], B[(i + s) % n]);\n if (sum < bestD) { bestD = sum; best = s; }\n }\n B = B.map((_, i) => B[(i + best) % n]);\n }\n return (p) => {\n if (p <= 0) return from;\n if (p >= 1) return to;\n return 'M' + A.map((a, i) => `${r3(a[0] + (B[i][0] - a[0]) * p)} ${r3(a[1] + (B[i][1] - a[1]) * p)}`).join('L') + (isClosed ? 'Z' : '');\n };\n}\n\n/* ------------------------------------------------------------------ SMIL */\n\n/** '2s', '150ms', '1.5', 'indefinite' → ms (NaN for indefinite / unsupported). */\nexport function smilTime(v: string | null | undefined): number {\n if (!v) return NaN;\n const s = v.trim();\n const m = /^(-?[\\d.]+)(ms|s|min|h)?$/.exec(s);\n if (!m) {\n const c = /^(?:(\\d+):)?(\\d+):(\\d+(?:\\.\\d+)?)$/.exec(s);\n return c ? ((+(c[1] || 0) * 60 + +c[2]) * 60 + +c[3]) * 1000 : NaN;\n }\n const n = parseFloat(m[1]);\n return m[2] === 'ms' ? n : m[2] === 'min' ? n * 60000 : m[2] === 'h' ? n * 3600000 : n * 1000;\n}\n\ntype Interp = (a: string, b: string, p: number) => string;\nconst numList = (s: string) => s.trim().split(/[\\s,]+/).filter(Boolean).map(Number);\nconst lerpNumbers: Interp = (a, b, p) => {\n const x = numList(a), y = numList(b);\n return x.map((v, i) => r3(v + ((y[i] ?? v) - v) * p)).join(' ');\n};\nconst lerpAny: Interp = (a, b, p) => {\n try {\n const x = parseValue(a), y = parseValue(b);\n if (x.kind === 'str' || y.kind === 'str') throw 0; // number lists / keywords: handled below\n if (x.kind === 'col' || y.kind === 'col') {\n const ca = x.kind === 'col' ? x.c : [0, 0, 0, 1], cb = y.kind === 'col' ? y.c : [0, 0, 0, 1];\n const c = ca.map((v, i) => v + (cb[i] - v) * p);\n return `rgba(${Math.round(c[0])},${Math.round(c[1])},${Math.round(c[2])},${r3(c[3])})`;\n }\n return `${r3(x.v + (y.v - x.v) * p)}${y.u || x.u}`;\n } catch {\n if (/^[-\\d.\\s,e]+$/i.test(a) && /^[-\\d.\\s,e]+$/i.test(b)) return lerpNumbers(a, b, p);\n return p < 0.5 ? a : b;\n }\n};\n\nexport interface SmilAnimationInfo {\n kind: 'animate' | 'set' | 'animateTransform' | 'animateMotion';\n target: Element;\n attribute: string;\n begin: number;\n dur: number;\n repeat: number;\n freeze: boolean;\n values: string[];\n keyTimes: number[];\n calcMode: string;\n type?: string;\n}\n\n/** Read the SMIL animation elements of an SVG (without playing them). */\nexport function readSmil(svg: Element): SmilAnimationInfo[] {\n const out: SmilAnimationInfo[] = [];\n svg.querySelectorAll('animate, set, animateTransform, animateMotion').forEach((el) => {\n const kind = el.localName as SmilAnimationInfo['kind'];\n const href = el.getAttribute('href') || el.getAttribute('xlink:href');\n const target = href ? svg.querySelector(href) : el.parentElement;\n if (!target) return;\n const begin = smilTime((el.getAttribute('begin') || '0').split(';')[0]);\n const dur = kind === 'set' ? smilTime(el.getAttribute('dur')) || 0 : smilTime(el.getAttribute('dur'));\n const rc = el.getAttribute('repeatCount');\n const rd = smilTime(el.getAttribute('repeatDur'));\n let repeat = rc === 'indefinite' || el.getAttribute('repeatDur') === 'indefinite' ? -1 : rc ? Math.max(0, Math.ceil(parseFloat(rc)) - 1) : 0;\n if (!rc && rd > 0 && dur > 0) repeat = Math.ceil(rd / dur) - 1;\n const attribute = kind === 'animateTransform' ? 'transform' : kind === 'animateMotion' ? 'transform' : el.getAttribute('attributeName') || '';\n let values: string[];\n const v = el.getAttribute('values');\n if (kind === 'set') values = [el.getAttribute('to') || ''];\n else if (kind === 'animateMotion') {\n const mp = el.querySelector('mpath');\n const ref = mp && (mp.getAttribute('href') || mp.getAttribute('xlink:href'));\n values = [(ref && svg.querySelector(ref)?.getAttribute('d')) || el.getAttribute('path') || ''];\n } else if (v) values = v.split(';').map((s) => s.trim()).filter((s) => s !== '');\n else {\n const base = target.getAttribute(attribute) || (attribute === 'opacity' ? '1' : '0');\n const from = el.getAttribute('from') ?? base;\n const by = el.getAttribute('by');\n const to = el.getAttribute('to') ?? (by !== null ? numList(from).map((x, i) => x + (numList(by)[i] ?? 0)).join(' ') : base);\n values = [from, to];\n }\n const kt = el.getAttribute('keyTimes');\n out.push({ kind, target, attribute, begin: Number.isFinite(begin) ? begin : 0, dur: Number.isFinite(dur) ? dur : 0, repeat, freeze: el.getAttribute('fill') === 'freeze' || (kind === 'set' && !el.getAttribute('dur')) /* a <set> without dur holds its value */, values, keyTimes: kt ? kt.split(';').map(Number) : [], calcMode: el.getAttribute('calcMode') || (kind === 'animateMotion' ? 'paced' : 'linear'), type: el.getAttribute('type') || undefined, ...(el.getAttribute('rotate') ? { rotate: el.getAttribute('rotate') } : {}), ...(el.getAttribute('keySplines') ? { keySplines: el.getAttribute('keySplines') } : {}) } as SmilAnimationInfo);\n });\n return out;\n}\n\n/** One SMIL animation replayed as a runtime Playable. */\nclass SmilTrack extends Playable {\n private interp: Interp;\n private splines: Ease[];\n private base: string | null;\n private morphs: ((p: number) => string)[] = [];\n constructor(private info: SmilAnimationInfo & { rotate?: string; keySplines?: string }) {\n super({ repeat: info.repeat });\n this.base = info.target.getAttribute(info.attribute);\n this.interp = info.attribute === 'd' ? (a, b, p) => this.morph(a, b)(p) : info.kind === 'animateTransform' ? lerpNumbers : lerpAny;\n this.splines = (info.keySplines || '').split(';').filter((s) => s.trim()).map((s) => { const n = numList(s); return cubicBezier(n[0], n[1], n[2], n[3]); });\n }\n private morph(a: string, b: string): (p: number) => string {\n const key = a + '|' + b;\n const hit = (this.morphs as any)[key];\n return hit || ((this.morphs as any)[key] = morphPath(a, b));\n }\n get duration(): number {\n return this.info.dur;\n }\n private write(v: string): void {\n const { kind, target, type } = this.info;\n if (kind === 'animateTransform') target.setAttribute('transform', `${type || 'translate'}(${v})`);\n else target.setAttribute(this.info.attribute, v);\n }\n protected renderLocal(ms: number, ended: boolean): void {\n const i = this.info;\n if (ended && ms >= i.dur && !i.freeze && this.repeat >= 0) {\n if (this.base === null) i.target.removeAttribute(i.attribute);\n else i.target.setAttribute(i.attribute, this.base);\n return;\n }\n const p = i.dur ? Math.min(1, ms / i.dur) : 1;\n if (i.kind === 'set') return this.write(i.values[0]);\n if (i.kind === 'animateMotion') {\n const d = i.values[0];\n const len = pathLength(d);\n const pt = pointAtLength(d, len * p);\n const rot = (i as any).rotate;\n const a = rot === 'auto' ? pt.angle : rot === 'auto-reverse' ? pt.angle + 180 : parseFloat(rot) || 0;\n i.target.setAttribute('transform', `translate(${r3(pt.x)} ${r3(pt.y)})${a ? ` rotate(${r3(a)})` : ''}`);\n return;\n }\n const vals = i.values;\n if (vals.length === 1) return this.write(vals[0]);\n const kt = i.keyTimes.length === vals.length ? i.keyTimes : vals.map((_, k) => k / (vals.length - 1));\n if (i.calcMode === 'discrete') {\n const kd = i.keyTimes.length === vals.length ? i.keyTimes : vals.map((_, k) => k / vals.length);\n let k = 0;\n while (k < kd.length - 1 && p >= kd[k + 1]) k++;\n return this.write(vals[k]);\n }\n let k = 0;\n while (k < kt.length - 2 && p > kt[k + 1]) k++;\n const span = kt[k + 1] - kt[k] || 1;\n let local = Math.min(1, Math.max(0, (p - kt[k]) / span));\n if (i.calcMode === 'spline' && this.splines[k]) local = this.splines[k](local);\n this.write(this.interp(vals[k], vals[k + 1], local));\n }\n}\n\nexport interface SmilPlayer {\n timeline: Timeline;\n animations: SmilAnimationInfo[];\n /** Put the original SMIL elements back (the browser's clock takes over again). */\n restore(): void;\n}\n\n/**\n * Replay an SVG's SMIL animations with the runtime. The SMIL elements are\n * detached while the runtime drives the attributes (call `restore()` to put\n * them back). Playing unless `paused: true`.\n */\nexport function playSmil(svg: Element, o: { paused?: boolean; timeScale?: number } = {}): SmilPlayer {\n const animations = readSmil(svg);\n const els = Array.from(svg.querySelectorAll('animate, set, animateTransform, animateMotion'));\n const parents = els.map((e) => [e, e.parentNode, e.nextSibling] as const);\n els.forEach((e) => e.remove());\n const tl = new Timeline({});\n for (const a of animations) tl.add(new SmilTrack(a), a.begin);\n if (o.timeScale) tl.timeScale = o.timeScale;\n if (!o.paused) tl.play();\n return {\n timeline: tl,\n animations,\n restore() {\n tl.kill();\n parents.forEach(([e, p, next]) => p?.insertBefore(e, next && next.parentNode === p ? next : null));\n },\n };\n}\n\nexport interface FormatSvgApi {\n parsePath: typeof parsePath;\n flattenPath: typeof flattenPath;\n pathLength: typeof pathLength;\n pointAtLength: typeof pointAtLength;\n samplePath: typeof samplePath;\n morphPath: typeof morphPath;\n readSmil: typeof readSmil;\n playSmil: typeof playSmil;\n smilTime: typeof smilTime;\n}\n\n/** The module object for `use(formatSvg)`. */\nexport const formatSvg: RuntimeModule<FormatSvgApi> = { id: 'format-svg', version: RUNTIME_VERSION, requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };\n"],"names":["parseValue","Playable","cubicBezier","Timeline","RUNTIME_VERSION"],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAQH,MAAM,IAAI,GAA2B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE;AAEnG;AACM,SAAU,SAAS,CAAC,CAAS,EAAA;IACjC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,qDAAqD,CAAC,IAAI,EAAE;IACjF,MAAM,GAAG,GAAkB,EAAE;AAC7B,IAAA,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,GAAc,IAAI,EAAE,EAAE,GAAc,IAAI;AAC7F,IAAA,MAAM,G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