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,446 @@
1
+ import { R as RUNTIME_VERSION } from '../chunks/registry-46AAzyeC.js';
2
+ import { T as Timeline, P as Playable, c as cubicBezier, d as parseValue } from '../chunks/tween-CGyolmzB.js';
3
+ import '../chunks/ticker-COOYAyQy.js';
4
+
5
+ /**
6
+ * `motionary/runtime/format-svg` (10.2) — SVG animation with the runtime
7
+ * (original implementation):
8
+ *
9
+ * - **Path geometry** without the DOM (SSR / workers): `parsePath(d)` (all
10
+ * commands, relative + absolute, arcs), `flattenPath(d)`, `pathLength(d)`,
11
+ * `pointAtLength(d, len)`, `samplePath(d, n)`.
12
+ * - **Path morphing**: `morphPath(from, to, { points })` → `(p) => d` — both
13
+ * paths are resampled to the same number of points (any command mix, any
14
+ * point counts), aligned to the closest start point, then interpolated.
15
+ * - **SMIL playback**: `playSmil(svg)` reads `<animate>`, `<set>`,
16
+ * `<animateTransform>` (translate / scale / rotate / skewX / skewY) and
17
+ * `<animateMotion>` (`path` or `<mpath>`, `rotate="auto"`) — `from` / `to` /
18
+ * `by` / `values`, `keyTimes`, `keySplines` (`calcMode="spline"`),
19
+ * `calcMode="discrete"`, `dur`, numeric `begin` offsets, `repeatCount`
20
+ * (incl. `indefinite`), `fill="freeze"` — and replays them as a runtime
21
+ * timeline (seek, scrub, reverse, timeScale) instead of the browser's SMIL clock.
22
+ * - CSS-animated SVG: use `motionary/runtime/format-css` (`@keyframes` in the SVG's `<style>`).
23
+ *
24
+ * Not supported (documented): event / syncbase `begin` values (`click`,
25
+ * `a.end`), `accumulate` / `additive="sum"`, `<animateColor>` (deprecated).
26
+ */
27
+ const ARGS = { M: 2, L: 2, H: 1, V: 1, C: 6, S: 4, Q: 4, T: 2, A: 7, Z: 0 };
28
+ /** Parse path data into absolute commands (M L C Q A Z; H/V/S/T expanded). */
29
+ function parsePath(d) {
30
+ const toks = d.match(/[a-zA-Z]|[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?/g) || [];
31
+ const out = [];
32
+ let i = 0, cmd = '', x = 0, y = 0, sx = 0, sy = 0, lc = null, lq = null;
33
+ const num = () => parseFloat(toks[i++]);
34
+ while (i < toks.length) {
35
+ if (/[a-zA-Z]/.test(toks[i]))
36
+ cmd = toks[i++];
37
+ else if (!cmd)
38
+ throw new Error('[motionary] format-svg: path must start with a command');
39
+ const C = cmd.toUpperCase(), rel = cmd !== C;
40
+ const n = ARGS[C];
41
+ if (n === undefined)
42
+ throw new Error(`[motionary] format-svg: unknown path command "${cmd}"`);
43
+ if (C === 'Z') {
44
+ out.push(['Z']);
45
+ x = sx;
46
+ y = sy;
47
+ lc = lq = null;
48
+ continue;
49
+ }
50
+ const a = [];
51
+ for (let k = 0; k < n; k++)
52
+ a.push(num());
53
+ if (a.some((v) => Number.isNaN(v)))
54
+ break;
55
+ const ox = rel ? x : 0, oy = rel ? y : 0;
56
+ switch (C) {
57
+ case 'M':
58
+ x = a[0] + ox;
59
+ y = a[1] + oy;
60
+ sx = x;
61
+ sy = y;
62
+ out.push(['M', x, y]);
63
+ cmd = rel ? 'l' : 'L';
64
+ lc = lq = null;
65
+ break;
66
+ case 'L':
67
+ x = a[0] + ox;
68
+ y = a[1] + oy;
69
+ out.push(['L', x, y]);
70
+ lc = lq = null;
71
+ break;
72
+ case 'H':
73
+ x = a[0] + ox;
74
+ out.push(['L', x, y]);
75
+ lc = lq = null;
76
+ break;
77
+ case 'V':
78
+ y = a[0] + (rel ? y : 0);
79
+ out.push(['L', x, y]);
80
+ lc = lq = null;
81
+ break;
82
+ case 'C': {
83
+ const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy, a[4] + ox, a[5] + oy];
84
+ out.push(['C', ...c]);
85
+ lc = [c[2], c[3]];
86
+ x = c[4];
87
+ y = c[5];
88
+ lq = null;
89
+ break;
90
+ }
91
+ case 'S': {
92
+ const c1 = lc ? [2 * x - lc[0], 2 * y - lc[1]] : [x, y];
93
+ const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy];
94
+ out.push(['C', c1[0], c1[1], ...c]);
95
+ lc = [c[0], c[1]];
96
+ x = c[2];
97
+ y = c[3];
98
+ lq = null;
99
+ break;
100
+ }
101
+ case 'Q': {
102
+ const c = [a[0] + ox, a[1] + oy, a[2] + ox, a[3] + oy];
103
+ out.push(['Q', ...c]);
104
+ lq = [c[0], c[1]];
105
+ x = c[2];
106
+ y = c[3];
107
+ lc = null;
108
+ break;
109
+ }
110
+ case 'T': {
111
+ const c1 = lq ? [2 * x - lq[0], 2 * y - lq[1]] : [x, y];
112
+ x = a[0] + ox;
113
+ y = a[1] + oy;
114
+ out.push(['Q', c1[0], c1[1], x, y]);
115
+ lq = c1;
116
+ lc = null;
117
+ break;
118
+ }
119
+ case 'A': {
120
+ x = a[5] + ox;
121
+ y = a[6] + oy;
122
+ out.push(['A', a[0], a[1], a[2], a[3], a[4], x, y]);
123
+ lc = lq = null;
124
+ break;
125
+ }
126
+ }
127
+ }
128
+ return out;
129
+ }
130
+ /** Endpoint-parameterised arc → points (SVG spec F.6.5 conversion). */
131
+ function arcPoints(x1, y1, rx, ry, phiDeg, large, sweep, x2, y2, seg) {
132
+ if (!rx || !ry)
133
+ return [[x2, y2]];
134
+ rx = Math.abs(rx);
135
+ ry = Math.abs(ry);
136
+ const phi = (phiDeg * Math.PI) / 180, cos = Math.cos(phi), sin = Math.sin(phi);
137
+ const dx = (x1 - x2) / 2, dy = (y1 - y2) / 2;
138
+ const xp = cos * dx + sin * dy, yp = -sin * dx + cos * dy;
139
+ const lam = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);
140
+ if (lam > 1) {
141
+ rx *= Math.sqrt(lam);
142
+ ry *= Math.sqrt(lam);
143
+ }
144
+ const num = rx * rx * ry * ry - rx * rx * yp * yp - ry * ry * xp * xp;
145
+ const den = rx * rx * yp * yp + ry * ry * xp * xp;
146
+ let co = Math.sqrt(Math.max(0, num / den));
147
+ if (large === sweep)
148
+ co = -co;
149
+ const cxp = (co * rx * yp) / ry, cyp = (-co * ry * xp) / rx;
150
+ const cx = cos * cxp - sin * cyp + (x1 + x2) / 2, cy = sin * cxp + cos * cyp + (y1 + y2) / 2;
151
+ const ang = (ux, uy, vx, vy) => Math.atan2(ux * vy - uy * vx, ux * vx + uy * vy);
152
+ const t1 = ang(1, 0, (xp - cxp) / rx, (yp - cyp) / ry);
153
+ let dt = ang((xp - cxp) / rx, (yp - cyp) / ry, (-xp - cxp) / rx, (-yp - cyp) / ry);
154
+ if (!sweep && dt > 0)
155
+ dt -= 2 * Math.PI;
156
+ if (sweep && dt < 0)
157
+ dt += 2 * Math.PI;
158
+ const n = Math.max(2, Math.ceil((Math.abs(dt) / (Math.PI / 2)) * seg));
159
+ const pts = [];
160
+ for (let k = 1; k <= n; k++) {
161
+ const t = t1 + (dt * k) / n;
162
+ pts.push([cx + rx * Math.cos(t) * cos - ry * Math.sin(t) * sin, cy + rx * Math.cos(t) * sin + ry * Math.sin(t) * cos]);
163
+ }
164
+ return pts;
165
+ }
166
+ /** Flatten a path into polylines (one per subpath); `segments` points per curve. */
167
+ function flattenPath(d, segments = 16) {
168
+ const cmds = typeof d === 'string' ? parsePath(d) : d;
169
+ const subs = [];
170
+ let cur = [], x = 0, y = 0;
171
+ for (const c of cmds) {
172
+ const [k, ...a] = c;
173
+ if (k === 'M') {
174
+ if (cur.length)
175
+ subs.push(cur);
176
+ cur = [[a[0], a[1]]];
177
+ x = a[0];
178
+ y = a[1];
179
+ continue;
180
+ }
181
+ if (!cur.length)
182
+ cur = [[x, y]];
183
+ if (k === 'L')
184
+ cur.push([a[0], a[1]]);
185
+ else if (k === 'C')
186
+ for (let i = 1; i <= segments; i++) {
187
+ const t = i / segments, u = 1 - t;
188
+ 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]]);
189
+ }
190
+ else if (k === 'Q')
191
+ for (let i = 1; i <= segments; i++) {
192
+ const t = i / segments, u = 1 - t;
193
+ 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]]);
194
+ }
195
+ else if (k === 'A')
196
+ cur.push(...arcPoints(x, y, a[0], a[1], a[2], a[3], a[4], a[5], a[6], segments / 4));
197
+ else if (k === 'Z') {
198
+ cur.push([cur[0][0], cur[0][1]]);
199
+ subs.push(cur);
200
+ x = cur[0][0];
201
+ y = cur[0][1];
202
+ cur = [];
203
+ continue;
204
+ }
205
+ const last = cur[cur.length - 1];
206
+ x = last[0];
207
+ y = last[1];
208
+ }
209
+ if (cur.length)
210
+ subs.push(cur);
211
+ return subs;
212
+ }
213
+ const dist = (a, b) => Math.hypot(b[0] - a[0], b[1] - a[1]);
214
+ /** Total length of a path. */
215
+ function pathLength(d) {
216
+ return flattenPath(d, 48).reduce((s, pl) => s + pl.slice(1).reduce((t, p, i) => t + dist(pl[i], p), 0), 0);
217
+ }
218
+ /** Point (and tangent angle, degrees) at a distance along the path. */
219
+ function pointAtLength(d, len) {
220
+ const pl = flattenPath(d, 48).flat();
221
+ let acc = 0;
222
+ for (let i = 1; i < pl.length; i++) {
223
+ const s = dist(pl[i - 1], pl[i]);
224
+ if (acc + s >= len || i === pl.length - 1) {
225
+ const t = s ? Math.min(1, Math.max(0, (len - acc) / s)) : 0;
226
+ 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 };
227
+ }
228
+ acc += s;
229
+ }
230
+ return { x: pl[0]?.[0] ?? 0, y: pl[0]?.[1] ?? 0, angle: 0 };
231
+ }
232
+ /** `n` points evenly spaced along the path (all subpaths joined). */
233
+ function samplePath(d, n = 64) {
234
+ const total = pathLength(d);
235
+ return Array.from({ length: n }, (_, i) => {
236
+ const p = pointAtLength(d, (total * i) / (n - 1 || 1));
237
+ return [p.x, p.y];
238
+ });
239
+ }
240
+ const r3 = (v) => Math.round(v * 1000) / 1000;
241
+ const closed = (d) => /z\s*$/i.test(d.trim());
242
+ /**
243
+ * Morph between two paths of any shape: `const f = morphPath(a, b); el.setAttribute('d', f(0.5))`.
244
+ * Closed paths are rotated so their start points line up (less twisting).
245
+ */
246
+ function morphPath(from, to, o = {}) {
247
+ const n = o.points ?? 64;
248
+ const A = samplePath(from, n);
249
+ let B = samplePath(to, n);
250
+ const isClosed = closed(from) && closed(to);
251
+ if (isClosed) {
252
+ let best = 0, bestD = Infinity;
253
+ for (let s = 0; s < n; s++) {
254
+ let sum = 0;
255
+ for (let i = 0; i < n; i += 4)
256
+ sum += dist(A[i], B[(i + s) % n]);
257
+ if (sum < bestD) {
258
+ bestD = sum;
259
+ best = s;
260
+ }
261
+ }
262
+ B = B.map((_, i) => B[(i + best) % n]);
263
+ }
264
+ return (p) => {
265
+ if (p <= 0)
266
+ return from;
267
+ if (p >= 1)
268
+ return to;
269
+ 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' : '');
270
+ };
271
+ }
272
+ /* ------------------------------------------------------------------ SMIL */
273
+ /** '2s', '150ms', '1.5', 'indefinite' → ms (NaN for indefinite / unsupported). */
274
+ function smilTime(v) {
275
+ if (!v)
276
+ return NaN;
277
+ const s = v.trim();
278
+ const m = /^(-?[\d.]+)(ms|s|min|h)?$/.exec(s);
279
+ if (!m) {
280
+ const c = /^(?:(\d+):)?(\d+):(\d+(?:\.\d+)?)$/.exec(s);
281
+ return c ? ((+(c[1] || 0) * 60 + +c[2]) * 60 + +c[3]) * 1000 : NaN;
282
+ }
283
+ const n = parseFloat(m[1]);
284
+ return m[2] === 'ms' ? n : m[2] === 'min' ? n * 60000 : m[2] === 'h' ? n * 3600000 : n * 1000;
285
+ }
286
+ const numList = (s) => s.trim().split(/[\s,]+/).filter(Boolean).map(Number);
287
+ const lerpNumbers = (a, b, p) => {
288
+ const x = numList(a), y = numList(b);
289
+ return x.map((v, i) => r3(v + ((y[i] ?? v) - v) * p)).join(' ');
290
+ };
291
+ const lerpAny = (a, b, p) => {
292
+ try {
293
+ const x = parseValue(a), y = parseValue(b);
294
+ if (x.kind === 'str' || y.kind === 'str')
295
+ throw 0; // number lists / keywords: handled below
296
+ if (x.kind === 'col' || y.kind === 'col') {
297
+ const ca = x.kind === 'col' ? x.c : [0, 0, 0, 1], cb = y.kind === 'col' ? y.c : [0, 0, 0, 1];
298
+ const c = ca.map((v, i) => v + (cb[i] - v) * p);
299
+ return `rgba(${Math.round(c[0])},${Math.round(c[1])},${Math.round(c[2])},${r3(c[3])})`;
300
+ }
301
+ return `${r3(x.v + (y.v - x.v) * p)}${y.u || x.u}`;
302
+ }
303
+ catch {
304
+ if (/^[-\d.\s,e]+$/i.test(a) && /^[-\d.\s,e]+$/i.test(b))
305
+ return lerpNumbers(a, b, p);
306
+ return p < 0.5 ? a : b;
307
+ }
308
+ };
309
+ /** Read the SMIL animation elements of an SVG (without playing them). */
310
+ function readSmil(svg) {
311
+ const out = [];
312
+ svg.querySelectorAll('animate, set, animateTransform, animateMotion').forEach((el) => {
313
+ const kind = el.localName;
314
+ const href = el.getAttribute('href') || el.getAttribute('xlink:href');
315
+ const target = href ? svg.querySelector(href) : el.parentElement;
316
+ if (!target)
317
+ return;
318
+ const begin = smilTime((el.getAttribute('begin') || '0').split(';')[0]);
319
+ const dur = kind === 'set' ? smilTime(el.getAttribute('dur')) || 0 : smilTime(el.getAttribute('dur'));
320
+ const rc = el.getAttribute('repeatCount');
321
+ const rd = smilTime(el.getAttribute('repeatDur'));
322
+ let repeat = rc === 'indefinite' || el.getAttribute('repeatDur') === 'indefinite' ? -1 : rc ? Math.max(0, Math.ceil(parseFloat(rc)) - 1) : 0;
323
+ if (!rc && rd > 0 && dur > 0)
324
+ repeat = Math.ceil(rd / dur) - 1;
325
+ const attribute = kind === 'animateTransform' ? 'transform' : kind === 'animateMotion' ? 'transform' : el.getAttribute('attributeName') || '';
326
+ let values;
327
+ const v = el.getAttribute('values');
328
+ if (kind === 'set')
329
+ values = [el.getAttribute('to') || ''];
330
+ else if (kind === 'animateMotion') {
331
+ const mp = el.querySelector('mpath');
332
+ const ref = mp && (mp.getAttribute('href') || mp.getAttribute('xlink:href'));
333
+ values = [(ref && svg.querySelector(ref)?.getAttribute('d')) || el.getAttribute('path') || ''];
334
+ }
335
+ else if (v)
336
+ values = v.split(';').map((s) => s.trim()).filter((s) => s !== '');
337
+ else {
338
+ const base = target.getAttribute(attribute) || (attribute === 'opacity' ? '1' : '0');
339
+ const from = el.getAttribute('from') ?? base;
340
+ const by = el.getAttribute('by');
341
+ const to = el.getAttribute('to') ?? (by !== null ? numList(from).map((x, i) => x + (numList(by)[i] ?? 0)).join(' ') : base);
342
+ values = [from, to];
343
+ }
344
+ const kt = el.getAttribute('keyTimes');
345
+ 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') } : {}) });
346
+ });
347
+ return out;
348
+ }
349
+ /** One SMIL animation replayed as a runtime Playable. */
350
+ class SmilTrack extends Playable {
351
+ constructor(info) {
352
+ super({ repeat: info.repeat });
353
+ this.info = info;
354
+ this.morphs = [];
355
+ this.base = info.target.getAttribute(info.attribute);
356
+ this.interp = info.attribute === 'd' ? (a, b, p) => this.morph(a, b)(p) : info.kind === 'animateTransform' ? lerpNumbers : lerpAny;
357
+ 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]); });
358
+ }
359
+ morph(a, b) {
360
+ const key = a + '|' + b;
361
+ const hit = this.morphs[key];
362
+ return hit || (this.morphs[key] = morphPath(a, b));
363
+ }
364
+ get duration() {
365
+ return this.info.dur;
366
+ }
367
+ write(v) {
368
+ const { kind, target, type } = this.info;
369
+ if (kind === 'animateTransform')
370
+ target.setAttribute('transform', `${type || 'translate'}(${v})`);
371
+ else
372
+ target.setAttribute(this.info.attribute, v);
373
+ }
374
+ renderLocal(ms, ended) {
375
+ const i = this.info;
376
+ if (ended && ms >= i.dur && !i.freeze && this.repeat >= 0) {
377
+ if (this.base === null)
378
+ i.target.removeAttribute(i.attribute);
379
+ else
380
+ i.target.setAttribute(i.attribute, this.base);
381
+ return;
382
+ }
383
+ const p = i.dur ? Math.min(1, ms / i.dur) : 1;
384
+ if (i.kind === 'set')
385
+ return this.write(i.values[0]);
386
+ if (i.kind === 'animateMotion') {
387
+ const d = i.values[0];
388
+ const len = pathLength(d);
389
+ const pt = pointAtLength(d, len * p);
390
+ const rot = i.rotate;
391
+ const a = rot === 'auto' ? pt.angle : rot === 'auto-reverse' ? pt.angle + 180 : parseFloat(rot) || 0;
392
+ i.target.setAttribute('transform', `translate(${r3(pt.x)} ${r3(pt.y)})${a ? ` rotate(${r3(a)})` : ''}`);
393
+ return;
394
+ }
395
+ const vals = i.values;
396
+ if (vals.length === 1)
397
+ return this.write(vals[0]);
398
+ const kt = i.keyTimes.length === vals.length ? i.keyTimes : vals.map((_, k) => k / (vals.length - 1));
399
+ if (i.calcMode === 'discrete') {
400
+ const kd = i.keyTimes.length === vals.length ? i.keyTimes : vals.map((_, k) => k / vals.length);
401
+ let k = 0;
402
+ while (k < kd.length - 1 && p >= kd[k + 1])
403
+ k++;
404
+ return this.write(vals[k]);
405
+ }
406
+ let k = 0;
407
+ while (k < kt.length - 2 && p > kt[k + 1])
408
+ k++;
409
+ const span = kt[k + 1] - kt[k] || 1;
410
+ let local = Math.min(1, Math.max(0, (p - kt[k]) / span));
411
+ if (i.calcMode === 'spline' && this.splines[k])
412
+ local = this.splines[k](local);
413
+ this.write(this.interp(vals[k], vals[k + 1], local));
414
+ }
415
+ }
416
+ /**
417
+ * Replay an SVG's SMIL animations with the runtime. The SMIL elements are
418
+ * detached while the runtime drives the attributes (call `restore()` to put
419
+ * them back). Playing unless `paused: true`.
420
+ */
421
+ function playSmil(svg, o = {}) {
422
+ const animations = readSmil(svg);
423
+ const els = Array.from(svg.querySelectorAll('animate, set, animateTransform, animateMotion'));
424
+ const parents = els.map((e) => [e, e.parentNode, e.nextSibling]);
425
+ els.forEach((e) => e.remove());
426
+ const tl = new Timeline({});
427
+ for (const a of animations)
428
+ tl.add(new SmilTrack(a), a.begin);
429
+ if (o.timeScale)
430
+ tl.timeScale = o.timeScale;
431
+ if (!o.paused)
432
+ tl.play();
433
+ return {
434
+ timeline: tl,
435
+ animations,
436
+ restore() {
437
+ tl.kill();
438
+ parents.forEach(([e, p, next]) => p?.insertBefore(e, next && next.parentNode === p ? next : null));
439
+ },
440
+ };
441
+ }
442
+ /** The module object for `use(formatSvg)`. */
443
+ const formatSvg = { id: 'format-svg', version: RUNTIME_VERSION, requires: ['core'], api: { parsePath, flattenPath, pathLength, pointAtLength, samplePath, morphPath, readSmil, playSmil, smilTime } };
444
+
445
+ export { flattenPath, formatSvg, morphPath, parsePath, pathLength, playSmil, pointAtLength, readSmil, samplePath, smilTime };
446
+ //# sourceMappingURL=format-svg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-svg.js","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":[],"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,GAAG,GAAG,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;AACvC,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE;QACtB,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAAE,YAAA,GAAG,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