@algorisys/tinyfly 0.82.0 → 0.86.2

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 (60) hide show
  1. package/README.md +11 -4
  2. package/lib/addons/adapters.js +363 -248
  3. package/lib/addons/characters.js +1652 -1470
  4. package/lib/addons/dom-adapter-Cphr2HZn.js +372 -0
  5. package/lib/addons/gsap-compat.js +197 -187
  6. package/lib/addons/load-scene-vp14_Jj-.js +324 -0
  7. package/lib/addons/scene-3d-webgl.js +237 -0
  8. package/lib/addons/scene-3d.js +306 -0
  9. package/lib/addons/shading-ByG9UXd0.js +85 -0
  10. package/lib/browser/tinyfly-scene-3d-webgl.iife.js +114 -0
  11. package/lib/browser/tinyfly-scene-3d.iife.js +3 -0
  12. package/lib/browser/tinyfly.iife.js +4 -4
  13. package/lib/browser/tinyfly.js +3028 -2480
  14. package/lib/browser/tinyfly.umd.js +4 -4
  15. package/lib/cli/tools.js +137 -22
  16. package/lib/embed/tinyfly-embed.iife.js +4 -4
  17. package/lib/embed/tinyfly-embed.js +921 -833
  18. package/lib/engine/tinyfly-engine.js +1022 -776
  19. package/lib/engine/tinyfly-engine.umd.cjs +2 -2
  20. package/lib/headless/headless.js +264 -7
  21. package/lib/player/tinyfly-player.es.js +459 -371
  22. package/lib/player/tinyfly-player.iife.js +2 -2
  23. package/lib/player/tinyfly-player.umd.js +2 -2
  24. package/lib/types/adapters/canvas/canvas-adapter.d.ts +36 -0
  25. package/lib/types/adapters/transform-3d.d.ts +99 -0
  26. package/lib/types/adapters/webgl/webgl-adapter.d.ts +17 -0
  27. package/lib/types/characters/character.d.ts +20 -1
  28. package/lib/types/characters/index.d.ts +2 -0
  29. package/lib/types/characters/rig/body-plan.d.ts +3 -1
  30. package/lib/types/characters/rig/skeleton.d.ts +57 -0
  31. package/lib/types/characters/scene-objects.d.ts +2 -0
  32. package/lib/types/compat/gsap/vars.d.ts +8 -0
  33. package/lib/types/engine/core/bake.d.ts +3 -1
  34. package/lib/types/engine/index.d.ts +1 -0
  35. package/lib/types/engine/interpolation/interpolators.d.ts +10 -3
  36. package/lib/types/engine/math/index.d.ts +11 -0
  37. package/lib/types/engine/math/mat4.d.ts +37 -0
  38. package/lib/types/engine/math/quat.d.ts +39 -0
  39. package/lib/types/engine/math/vec3.d.ts +16 -0
  40. package/lib/types/engine/types.d.ts +23 -2
  41. package/lib/types/scene-3d/camera.d.ts +27 -0
  42. package/lib/types/scene-3d/canvas-2d-renderer.d.ts +21 -0
  43. package/lib/types/scene-3d/geometry/extrude.d.ts +17 -0
  44. package/lib/types/scene-3d/geometry/mesh.d.ts +36 -0
  45. package/lib/types/scene-3d/geometry/primitives.d.ts +16 -0
  46. package/lib/types/scene-3d/geometry/triangulate.d.ts +24 -0
  47. package/lib/types/scene-3d/index.d.ts +20 -0
  48. package/lib/types/scene-3d/load-scene.d.ts +31 -0
  49. package/lib/types/scene-3d/object-kind.d.ts +54 -0
  50. package/lib/types/scene-3d/resolve-scene.d.ts +122 -0
  51. package/lib/types/scene-3d/scene-3d-adapter.d.ts +46 -0
  52. package/lib/types/scene-3d/scene-types.d.ts +191 -0
  53. package/lib/types/scene-3d/shading.d.ts +20 -0
  54. package/lib/types/scene-3d/validate-scene.d.ts +11 -0
  55. package/lib/types/scene-3d/webgl/gl-data.d.ts +28 -0
  56. package/lib/types/scene-3d/webgl/index.d.ts +16 -0
  57. package/lib/types/scene-3d/webgl/shaders.d.ts +29 -0
  58. package/lib/types/scene-3d/webgl/webgl2-renderer.d.ts +33 -0
  59. package/package.json +10 -2
  60. package/lib/addons/dom-adapter-CrNwoomd.js +0 -243
@@ -1,29 +1,32 @@
1
- function _e(t) {
1
+ function Ee(t) {
2
2
  return typeof t == "object" && t !== null && t.type === "cubic-bezier";
3
3
  }
4
- function Mt(t) {
4
+ function xt(t) {
5
5
  return typeof t == "object" && t !== null && t.type !== "cubic-bezier";
6
6
  }
7
- const it = 1;
8
- function kt(t) {
7
+ const Xt = 2;
8
+ function ne(t) {
9
+ return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
10
+ }
11
+ function $t(t) {
9
12
  return t.property === "text" && "textConfig" in t;
10
13
  }
11
14
  function V(t) {
12
15
  return t.kind === "inertia" && "inertia" in t;
13
16
  }
14
- function H(t) {
17
+ function j(t) {
15
18
  return t.kind === "spring" && "spring" in t;
16
19
  }
17
- function qt(t) {
20
+ function re(t) {
18
21
  return t.property === "motionPath" && "motionPathConfig" in t;
19
22
  }
20
- function Yn(t) {
23
+ function kr(t) {
21
24
  return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
22
25
  }
23
- function Me(t) {
26
+ function Le(t) {
24
27
  return "keyframes" in t;
25
28
  }
26
- class Un {
29
+ class Sr {
27
30
  _currentTime = 0;
28
31
  _isRunning = !1;
29
32
  onTick = null;
@@ -49,7 +52,7 @@ class Un {
49
52
  this._currentTime = e;
50
53
  }
51
54
  }
52
- class Vn {
55
+ class Ar {
53
56
  _currentTime = 0;
54
57
  _isRunning = !1;
55
58
  _lastFrameTime = null;
@@ -96,7 +99,7 @@ class Vn {
96
99
  }
97
100
  }
98
101
  }
99
- function Wt(t, e, n = "start") {
102
+ function se(t, e, n = "start") {
100
103
  if (e <= 1) return 0;
101
104
  if (typeof n == "number") {
102
105
  const r = Math.max(0, Math.min(e - 1, n));
@@ -113,36 +116,36 @@ function Wt(t, e, n = "start") {
113
116
  return t;
114
117
  }
115
118
  }
116
- function be(t, e = "start") {
119
+ function Oe(t, e = "start") {
117
120
  if (t <= 1) return 0;
118
121
  let n = 0;
119
122
  for (let r = 0; r < t; r++)
120
- n = Math.max(n, Wt(r, t, e));
123
+ n = Math.max(n, se(r, t, e));
121
124
  return n;
122
125
  }
123
- function jt(t, e, n) {
126
+ function oe(t, e, n) {
124
127
  if (n.offsets) return n.offsets[t] ?? 0;
125
- const r = n.from ?? "start", s = Wt(t, e, r);
128
+ const r = n.from ?? "start", s = se(t, e, r);
126
129
  if (n.amount !== void 0) {
127
- const i = be(e, r);
128
- return i === 0 ? 0 : n.amount * s / i;
130
+ const o = Oe(e, r);
131
+ return o === 0 ? 0 : n.amount * s / o;
129
132
  }
130
133
  return n.each !== void 0 ? n.each * s : 0;
131
134
  }
132
- function Te(t, e) {
133
- return Array.from({ length: t }, (n, r) => jt(r, t, e));
135
+ function Fe(t, e) {
136
+ return Array.from({ length: t }, (n, r) => oe(r, t, e));
134
137
  }
135
- function vt(t, e) {
136
- return t <= 1 ? 0 : Math.max(...Te(t, e));
138
+ function Rt(t, e) {
139
+ return t <= 1 ? 0 : Math.max(...Fe(t, e));
137
140
  }
138
- const Z = 1, Kt = 6e4, nt = Kt / Z, E = {
141
+ const tt = 1, ie = 6e4, st = ie / tt, L = {
139
142
  stiffness: 180,
140
143
  damping: 12,
141
144
  mass: 1,
142
145
  velocity: 0,
143
146
  restDelta: 0.01,
144
147
  restSpeed: 0.1
145
- }, Hn = {
148
+ }, wr = {
146
149
  gentle: { stiffness: 120, damping: 18, mass: 1 },
147
150
  default: { stiffness: 180, damping: 12, mass: 1 },
148
151
  snappy: { stiffness: 280, damping: 20, mass: 1 },
@@ -150,7 +153,7 @@ const Z = 1, Kt = 6e4, nt = Kt / Z, E = {
150
153
  wobbly: { stiffness: 180, damping: 5, mass: 1 },
151
154
  stiff: { stiffness: 400, damping: 30, mass: 1 }
152
155
  };
153
- class at {
156
+ class ut {
154
157
  from;
155
158
  to;
156
159
  stiffness;
@@ -175,7 +178,7 @@ class at {
175
178
  /** Once at rest we stop simulating; every later time returns `to`. */
176
179
  settledStep = null;
177
180
  constructor(e) {
178
- this.from = e.from, this.to = e.to, this.stiffness = e.stiffness ?? E.stiffness, this.damping = e.damping ?? E.damping, this.mass = e.mass ?? E.mass, this.restDelta = e.restDelta ?? E.restDelta, this.restSpeed = e.restSpeed ?? E.restSpeed, this.distance = Math.abs(this.to - this.from) || 1, this.samples = [this.from], this.velocity = e.velocity ?? E.velocity, this.isAtRest(this.from) && (this.settledStep = 0);
181
+ this.from = e.from, this.to = e.to, this.stiffness = e.stiffness ?? L.stiffness, this.damping = e.damping ?? L.damping, this.mass = e.mass ?? L.mass, this.restDelta = e.restDelta ?? L.restDelta, this.restSpeed = e.restSpeed ?? L.restSpeed, this.distance = Math.abs(this.to - this.from) || 1, this.samples = [this.from], this.velocity = e.velocity ?? L.velocity, this.isAtRest(this.from) && (this.settledStep = 0);
179
182
  }
180
183
  /**
181
184
  * Whether a position/velocity pair counts as settled.
@@ -193,25 +196,25 @@ class at {
193
196
  */
194
197
  valueAt(e) {
195
198
  if (e <= 0) return this.from;
196
- const n = Math.floor(e / Z);
199
+ const n = Math.floor(e / tt);
197
200
  if (this.simulateTo(n + 1), this.settledStep !== null && n >= this.settledStep)
198
201
  return this.to;
199
- const r = this.samples[Math.min(n, this.samples.length - 1)], s = this.samples[Math.min(n + 1, this.samples.length - 1)], i = e / Z - n;
200
- return r + (s - r) * i;
202
+ const r = this.samples[Math.min(n, this.samples.length - 1)], s = this.samples[Math.min(n + 1, this.samples.length - 1)], o = e / tt - n;
203
+ return r + (s - r) * o;
201
204
  }
202
205
  /**
203
206
  * How long the spring takes to settle, in milliseconds — the natural duration
204
207
  * of a spring track. Runs the simulation to completion once.
205
208
  */
206
209
  settleTime() {
207
- return this.simulateTo(nt + 1), this.settledStep !== null ? this.settledStep * Z : Kt;
210
+ return this.simulateTo(st + 1), this.settledStep !== null ? this.settledStep * tt : ie;
208
211
  }
209
212
  /** Advance the cached simulation until it holds at least `steps` samples. */
210
213
  simulateTo(e) {
211
214
  if (this.settledStep !== null) return;
212
- const n = Math.min(e, nt + 1), r = Z / 1e3;
215
+ const n = Math.min(e, st + 1), r = tt / 1e3;
213
216
  for (; this.samples.length < n; ) {
214
- const s = this.samples[this.samples.length - 1], i = s - this.to, a = -this.stiffness * i, o = -this.damping * this.velocity, c = (a + o) / this.mass;
217
+ const s = this.samples[this.samples.length - 1], o = s - this.to, i = -this.stiffness * o, a = -this.damping * this.velocity, c = (i + a) / this.mass;
215
218
  this.velocity += c * r;
216
219
  const u = s + this.velocity * r;
217
220
  if (this.samples.push(u), this.isAtRest(u)) {
@@ -219,32 +222,32 @@ class at {
219
222
  return;
220
223
  }
221
224
  }
222
- this.samples.length > nt && (this.settledStep = nt);
225
+ this.samples.length > st && (this.settledStep = st);
223
226
  }
224
227
  }
225
- function zn(t, e) {
226
- return new at(t).valueAt(e);
228
+ function vr(t, e) {
229
+ return new ut(t).valueAt(e);
227
230
  }
228
- function Bn(t) {
229
- return new at(t).settleTime();
231
+ function Pr(t) {
232
+ return new ut(t).settleTime();
230
233
  }
231
- function qn(t) {
232
- const e = t.stiffness ?? E.stiffness, n = t.damping ?? E.damping, r = t.mass ?? E.mass;
234
+ function $r(t) {
235
+ const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, r = t.mass ?? L.mass;
233
236
  return n < 2 * Math.sqrt(e * r);
234
237
  }
235
- function Wn(t) {
236
- const e = t.stiffness ?? E.stiffness, n = t.mass ?? E.mass;
238
+ function Rr(t) {
239
+ const e = t.stiffness ?? L.stiffness, n = t.mass ?? L.mass;
237
240
  return 2 * Math.sqrt(e * n);
238
241
  }
239
- const Rt = 4, xe = 2e-3, ke = 1e-4, ve = 6e4;
240
- function ot(t) {
241
- const e = t.friction ?? Rt;
242
- return e > 0 ? e : Rt;
242
+ const zt = 4, Ne = 2e-3, Xe = 1e-4, ze = 6e4;
243
+ function lt(t) {
244
+ const e = t.friction ?? zt;
245
+ return e > 0 ? e : zt;
243
246
  }
244
- function Se(t) {
245
- return t.from + t.velocity / ot(t);
247
+ function Ye(t) {
248
+ return t.from + t.velocity / lt(t);
246
249
  }
247
- function Ae(t, e) {
250
+ function Ue(t, e) {
248
251
  if (e === void 0) return t;
249
252
  if (typeof e == "number")
250
253
  return e > 0 ? Math.round(t / e) * e : t;
@@ -254,79 +257,79 @@ function Ae(t, e) {
254
257
  Math.abs(r - t) < Math.abs(n - t) && (n = r);
255
258
  return n;
256
259
  }
257
- function ct(t) {
258
- let e = Ae(Se(t), t.end);
260
+ function ht(t) {
261
+ let e = Ue(Ye(t), t.end);
259
262
  return t.min !== void 0 && (e = Math.max(t.min, e)), t.max !== void 0 && (e = Math.min(t.max, e)), e;
260
263
  }
261
- function ut(t) {
262
- const e = Math.abs(ct(t) - t.from);
264
+ function ft(t) {
265
+ const e = Math.abs(ht(t) - t.from);
263
266
  if (e === 0) return 0;
264
- const n = t.restDelta ?? Math.max(ke, e * xe);
267
+ const n = t.restDelta ?? Math.max(Xe, e * Ne);
265
268
  if (n >= e) return 0;
266
- const r = Math.log(e / n) / ot(t);
267
- return Math.min(ve, r * 1e3);
269
+ const r = Math.log(e / n) / lt(t);
270
+ return Math.min(ze, r * 1e3);
268
271
  }
269
- function bt(t, e) {
272
+ function kt(t, e) {
270
273
  if (e <= 0) return t.from;
271
- const n = ct(t);
272
- if (e >= ut(t)) return n;
273
- const r = ot(t);
274
+ const n = ht(t);
275
+ if (e >= ft(t)) return n;
276
+ const r = lt(t);
274
277
  return t.from + (n - t.from) * (1 - Math.exp(-r * e / 1e3));
275
278
  }
276
- function jn(t, e) {
277
- const n = ot(t), r = ct(t);
278
- return e >= ut(t) ? 0 : (r - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
279
- }
280
- const Tt = (t) => t, we = (t) => t * t, Pe = (t) => 1 - (1 - t) * (1 - t), $e = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, Qt = (t) => t * t * t, Gt = (t) => 1 - Math.pow(1 - t, 3), Zt = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Re = Qt, De = Gt, Ce = Zt, Ie = {
281
- linear: Tt,
282
- "ease-in": Re,
283
- "ease-out": De,
284
- "ease-in-out": Ce,
285
- "ease-in-quad": we,
286
- "ease-out-quad": Pe,
287
- "ease-in-out-quad": $e,
288
- "ease-in-cubic": Qt,
289
- "ease-out-cubic": Gt,
290
- "ease-in-out-cubic": Zt
279
+ function Dr(t, e) {
280
+ const n = lt(t), r = ht(t);
281
+ return e >= ft(t) ? 0 : (r - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
282
+ }
283
+ const St = (t) => t, Ve = (t) => t * t, je = (t) => 1 - (1 - t) * (1 - t), He = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ae = (t) => t * t * t, ce = (t) => 1 - Math.pow(1 - t, 3), ue = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Be = ae, We = ce, Qe = ue, Ge = {
284
+ linear: St,
285
+ "ease-in": Be,
286
+ "ease-out": We,
287
+ "ease-in-out": Qe,
288
+ "ease-in-quad": Ve,
289
+ "ease-out-quad": je,
290
+ "ease-in-out-quad": He,
291
+ "ease-in-cubic": ae,
292
+ "ease-out-cubic": ce,
293
+ "ease-in-out-cubic": ue
291
294
  };
292
- function Ee(t) {
293
- const [e, n, r, s] = t, i = 3 * e, a = 3 * (r - e) - i, o = 1 - i - a, c = 3 * n, u = 3 * (s - n) - c, l = 1 - c - u, h = (d) => ((o * d + a) * d + i) * d, p = (d) => ((l * d + u) * d + c) * d, f = (d) => (3 * o * d + 2 * a) * d + i, _ = (d) => {
295
+ function Ke(t) {
296
+ const [e, n, r, s] = t, o = 3 * e, i = 3 * (r - e) - o, a = 1 - o - i, c = 3 * n, u = 3 * (s - n) - c, l = 1 - c - u, h = (d) => ((a * d + i) * d + o) * d, f = (d) => ((l * d + u) * d + c) * d, p = (d) => (3 * a * d + 2 * i) * d + o, M = (d) => {
294
297
  let g = d;
295
298
  for (let k = 0; k < 8; k++) {
296
- const A = h(g) - d;
297
- if (Math.abs(A) < 1e-7)
299
+ const w = h(g) - d;
300
+ if (Math.abs(w) < 1e-7)
298
301
  return g;
299
- const y = f(g);
302
+ const y = p(g);
300
303
  if (Math.abs(y) < 1e-7)
301
304
  break;
302
- g -= A / y;
305
+ g -= w / y;
303
306
  }
304
- let M = 0, b = 1;
305
- for (g = d; M < b; ) {
307
+ let _ = 0, b = 1;
308
+ for (g = d; _ < b; ) {
306
309
  const k = h(g);
307
310
  if (Math.abs(k - d) < 1e-7)
308
311
  return g;
309
- d > k ? M = g : b = g, g = (M + b) / 2;
312
+ d > k ? _ = g : b = g, g = (_ + b) / 2;
310
313
  }
311
314
  return g;
312
315
  };
313
316
  return (d) => {
314
317
  if (d <= 0) return 0;
315
318
  if (d >= 1) return 1;
316
- const g = _(d);
317
- return p(g);
319
+ const g = M(d);
320
+ return f(g);
318
321
  };
319
322
  }
320
- function ft(t, e = "out") {
323
+ function gt(t, e = "out") {
321
324
  if (e === "out") return t;
322
325
  const n = (r) => 1 - t(1 - r);
323
326
  return e === "in" ? n : (r) => r < 0.5 ? n(r * 2) / 2 : t(r * 2 - 1) / 2 + 0.5;
324
327
  }
325
- function Le(t = 1, e = 0.3) {
328
+ function Ze(t = 1, e = 0.3) {
326
329
  const n = Math.max(1, t), r = e / (2 * Math.PI) * Math.asin(1 / n);
327
330
  return (s) => s <= 0 ? 0 : s >= 1 ? 1 : n * Math.pow(2, -10 * s) * Math.sin((s - r) * (2 * Math.PI) / e) + 1;
328
331
  }
329
- const Fe = (t) => {
332
+ const qe = (t) => {
330
333
  if (t <= 0) return 0;
331
334
  if (t >= 1) return 1;
332
335
  if (t < 1 / 2.75) return 7.5625 * t * t;
@@ -341,7 +344,7 @@ const Fe = (t) => {
341
344
  const r = t - 2.625 / 2.75;
342
345
  return 7.5625 * r * r + 0.984375;
343
346
  };
344
- function Oe(t = 1.70158) {
347
+ function Je(t = 1.70158) {
345
348
  return (e) => {
346
349
  if (e <= 0) return 0;
347
350
  if (e >= 1) return 1;
@@ -349,7 +352,7 @@ function Oe(t = 1.70158) {
349
352
  return n * n * ((t + 1) * n + t) + 1;
350
353
  };
351
354
  }
352
- function Ne(t, e = "end") {
355
+ function tn(t, e = "end") {
353
356
  const n = Math.max(1, Math.floor(t));
354
357
  return (r) => {
355
358
  if (r >= 1) return 1;
@@ -367,22 +370,22 @@ function Ne(t, e = "end") {
367
370
  }
368
371
  };
369
372
  }
370
- function Xe(t) {
373
+ function en(t) {
371
374
  switch (t.type) {
372
375
  case "steps":
373
- return Ne(t.count, t.position);
376
+ return tn(t.count, t.position);
374
377
  case "elastic":
375
- return ft(Le(t.amplitude, t.period), t.mode);
378
+ return gt(Ze(t.amplitude, t.period), t.mode);
376
379
  case "bounce":
377
- return ft(Fe, t.mode);
380
+ return gt(qe, t.mode);
378
381
  case "back":
379
- return ft(Oe(t.overshoot), t.mode);
382
+ return gt(Je(t.overshoot), t.mode);
380
383
  }
381
384
  }
382
- function Jt(t) {
383
- return t === void 0 ? Tt : _e(t) ? Ee(t.points) : Mt(t) ? Xe(t) : Ie[t] ?? Tt;
385
+ function le(t) {
386
+ return t === void 0 ? St : Ee(t) ? Ke(t.points) : xt(t) ? en(t) : Ge[t] ?? St;
384
387
  }
385
- const Dt = 32, Ye = 256, q = /* @__PURE__ */ new Map(), Ue = /[MmLlHhVvCcSsQqTtAaZz]/, Ve = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, He = {
388
+ const Yt = 32, nn = 256, W = /* @__PURE__ */ new Map(), rn = /[MmLlHhVvCcSsQqTtAaZz]/, sn = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, on = {
386
389
  M: 2,
387
390
  L: 2,
388
391
  H: 1,
@@ -394,68 +397,68 @@ const Dt = 32, Ye = 256, q = /* @__PURE__ */ new Map(), Ue = /[MmLlHhVvCcSsQqTtA
394
397
  A: 7,
395
398
  Z: 0
396
399
  };
397
- function ze(t) {
400
+ function an(t) {
398
401
  const e = [];
399
402
  let n = 0, r = null;
400
403
  const s = () => {
401
404
  for (; n < t.length && /[\s,]/.test(t[n]); ) n++;
402
405
  };
403
406
  for (; n < t.length && (s(), !(n >= t.length)); ) {
404
- const i = t[n];
405
- if (Ue.test(i)) {
406
- r = { type: i, args: [] }, e.push(r), n++;
407
+ const o = t[n];
408
+ if (rn.test(o)) {
409
+ r = { type: o, args: [] }, e.push(r), n++;
407
410
  continue;
408
411
  }
409
412
  if (!r) break;
410
- const a = r.type === "A" || r.type === "a", o = r.args.length % 7;
411
- if (a && (o === 3 || o === 4)) {
412
- if (i !== "0" && i !== "1") break;
413
- r.args.push(i === "1" ? 1 : 0), n++;
413
+ const i = r.type === "A" || r.type === "a", a = r.args.length % 7;
414
+ if (i && (a === 3 || a === 4)) {
415
+ if (o !== "0" && o !== "1") break;
416
+ r.args.push(o === "1" ? 1 : 0), n++;
414
417
  continue;
415
418
  }
416
- const c = Ve.exec(t.slice(n));
419
+ const c = sn.exec(t.slice(n));
417
420
  if (!c) break;
418
421
  r.args.push(parseFloat(c[0])), n += c[0].length;
419
422
  }
420
423
  return e;
421
424
  }
422
- function Be(t, e, n, r, s, i, a, o, c) {
423
- if (t === o && e === c) return [];
425
+ function cn(t, e, n, r, s, o, i, a, c) {
426
+ if (t === a && e === c) return [];
424
427
  let u = Math.abs(n), l = Math.abs(r);
425
- if (u === 0 || l === 0) return [[t, e, o, c, o, c]];
426
- const h = s * Math.PI / 180, p = Math.cos(h), f = Math.sin(h), _ = (t - o) / 2, d = (e - c) / 2, g = p * _ + f * d, M = -f * _ + p * d, b = g * g / (u * u) + M * M / (l * l);
428
+ if (u === 0 || l === 0) return [[t, e, a, c, a, c]];
429
+ const h = s * Math.PI / 180, f = Math.cos(h), p = Math.sin(h), M = (t - a) / 2, d = (e - c) / 2, g = f * M + p * d, _ = -p * M + f * d, b = g * g / (u * u) + _ * _ / (l * l);
427
430
  if (b > 1) {
428
- const P = Math.sqrt(b);
429
- u *= P, l *= P;
430
- }
431
- const k = i === a ? -1 : 1, A = u * u * l * l - u * u * M * M - l * l * g * g, y = u * u * M * M + l * l * g * g, w = k * Math.sqrt(Math.max(0, A / y)), S = w * u * M / l, I = -w * l * g / u, m = p * S - f * I + (t + o) / 2, T = f * S + p * I + (e + c) / 2, x = (P, D, C, z) => {
432
- const ht = P * C + D * z, et = Math.sqrt((P * P + D * D) * (C * C + z * z)), K = Math.acos(Math.max(-1, Math.min(1, ht / et)));
433
- return P * z - D * C < 0 ? -K : K;
434
- }, v = x(1, 0, (g - S) / u, (M - I) / l);
435
- let $ = x((g - S) / u, (M - I) / l, (-g - S) / u, (-M - I) / l);
436
- !a && $ > 0 && ($ -= 2 * Math.PI), a && $ < 0 && ($ += 2 * Math.PI);
437
- const Y = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), lt = $ / Y, tt = 4 / 3 * Math.tan(lt / 4), wt = (P) => {
438
- const D = u * Math.cos(P), C = l * Math.sin(P);
439
- return [p * D - f * C + m, f * D + p * C + T];
440
- }, Pt = (P) => {
441
- const D = -u * Math.sin(P), C = l * Math.cos(P);
442
- return [p * D - f * C, f * D + p * C];
443
- }, $t = [];
444
- for (let P = 0; P < Y; P++) {
445
- const D = v + P * lt, C = D + lt, [z, ht] = wt(D), [et, K] = P === Y - 1 ? [o, c] : wt(C), [de, ge] = Pt(D), [me, ye] = Pt(C);
446
- $t.push([z + tt * de, ht + tt * ge, et - tt * me, K - tt * ye, et, K]);
447
- }
448
- return $t;
449
- }
450
- function X(t, e, n, r, s) {
451
- const i = 1 - s;
452
- return i * i * i * t + 3 * i * i * s * e + 3 * i * s * s * n + s * s * s * r;
453
- }
454
- function Ct(t, e, n, r, s) {
455
- const i = 1 - s;
456
- return 3 * i * i * (e - t) + 6 * i * s * (n - e) + 3 * s * s * (r - n);
457
- }
458
- function Q(t, e, n, r) {
431
+ const R = Math.sqrt(b);
432
+ u *= R, l *= R;
433
+ }
434
+ const k = o === i ? -1 : 1, w = u * u * l * l - u * u * _ * _ - l * l * g * g, y = u * u * _ * _ + l * l * g * g, v = k * Math.sqrt(Math.max(0, w / y)), A = v * u * _ / l, D = -v * l * g / u, m = f * A - p * D + (t + a) / 2, T = p * A + f * D + (e + c) / 2, x = (R, I, E, H) => {
435
+ const dt = R * E + I * H, rt = Math.sqrt((R * R + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, dt / rt)));
436
+ return R * H - I * E < 0 ? -Z : Z;
437
+ }, S = x(1, 0, (g - A) / u, (_ - D) / l);
438
+ let $ = x((g - A) / u, (_ - D) / l, (-g - A) / u, (-_ - D) / l);
439
+ !i && $ > 0 && ($ -= 2 * Math.PI), i && $ < 0 && ($ += 2 * Math.PI);
440
+ const P = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), pt = $ / P, nt = 4 / 3 * Math.tan(pt / 4), Ot = (R) => {
441
+ const I = u * Math.cos(R), E = l * Math.sin(R);
442
+ return [f * I - p * E + m, p * I + f * E + T];
443
+ }, Ft = (R) => {
444
+ const I = -u * Math.sin(R), E = l * Math.cos(R);
445
+ return [f * I - p * E, p * I + f * E];
446
+ }, Nt = [];
447
+ for (let R = 0; R < P; R++) {
448
+ const I = S + R * pt, E = I + pt, [H, dt] = Ot(I), [rt, Z] = R === P - 1 ? [a, c] : Ot(E), [Re, De] = Ft(I), [Ce, Ie] = Ft(E);
449
+ Nt.push([H + nt * Re, dt + nt * De, rt - nt * Ce, Z - nt * Ie, rt, Z]);
450
+ }
451
+ return Nt;
452
+ }
453
+ function z(t, e, n, r, s) {
454
+ const o = 1 - s;
455
+ return o * o * o * t + 3 * o * o * s * e + 3 * o * s * s * n + s * s * s * r;
456
+ }
457
+ function Ut(t, e, n, r, s) {
458
+ const o = 1 - s;
459
+ return 3 * o * o * (e - t) + 6 * o * s * (n - e) + 3 * s * s * (r - n);
460
+ }
461
+ function q(t, e, n, r) {
459
462
  return {
460
463
  subpath: 0,
461
464
  type: "L",
@@ -467,118 +470,118 @@ function Q(t, e, n, r) {
467
470
  length: Math.hypot(n - t, r - e)
468
471
  };
469
472
  }
470
- function rt(t, e, n) {
471
- const [r, s, i, a, o, c] = n, u = [0];
472
- let l = t, h = e, p = 0;
473
- for (let f = 1; f <= Dt; f++) {
474
- const _ = f / Dt, d = X(t, r, i, o, _), g = X(e, s, a, c, _);
475
- p += Math.hypot(d - l, g - h), u.push(p), l = d, h = g;
473
+ function ot(t, e, n) {
474
+ const [r, s, o, i, a, c] = n, u = [0];
475
+ let l = t, h = e, f = 0;
476
+ for (let p = 1; p <= Yt; p++) {
477
+ const M = p / Yt, d = z(t, r, o, a, M), g = z(e, s, i, c, M);
478
+ f += Math.hypot(d - l, g - h), u.push(f), l = d, h = g;
476
479
  }
477
480
  return {
478
481
  subpath: 0,
479
482
  type: "C",
480
- points: [r, s, i, a, o, c],
483
+ points: [r, s, o, i, a, c],
481
484
  startX: t,
482
485
  startY: e,
483
- endX: o,
486
+ endX: a,
484
487
  endY: c,
485
- length: p,
488
+ length: f,
486
489
  lengths: u
487
490
  };
488
491
  }
489
- function W(t) {
490
- const e = q.get(t);
492
+ function G(t) {
493
+ const e = W.get(t);
491
494
  if (e) return e;
492
495
  const n = [];
493
- let r = 0, s = 0, i = 0, a = 0, o = null, c = null, u = -1;
496
+ let r = 0, s = 0, o = 0, i = 0, a = null, c = null, u = -1;
494
497
  const l = /* @__PURE__ */ new Set(), h = (d) => {
495
498
  u < 0 && (u = 0), d.subpath = u, n.push(d);
496
499
  };
497
- for (const { type: d, args: g } of ze(t)) {
498
- const M = d.toUpperCase(), b = d !== M, k = He[M];
499
- if (M === "Z") {
500
- (r !== i || s !== a) && h(Q(r, s, i, a)), u >= 0 && l.add(u), r = i, s = a, o = c = null;
500
+ for (const { type: d, args: g } of an(t)) {
501
+ const _ = d.toUpperCase(), b = d !== _, k = on[_];
502
+ if (_ === "Z") {
503
+ (r !== o || s !== i) && h(q(r, s, o, i)), u >= 0 && l.add(u), r = o, s = i, a = c = null;
501
504
  continue;
502
505
  }
503
- for (let A = 0; A + k <= g.length; A += k) {
504
- const y = g.slice(A, A + k), w = b ? r : 0, S = b ? s : 0;
505
- let I = null, m = null;
506
- switch (M) {
506
+ for (let w = 0; w + k <= g.length; w += k) {
507
+ const y = g.slice(w, w + k), v = b ? r : 0, A = b ? s : 0;
508
+ let D = null, m = null;
509
+ switch (_) {
507
510
  case "M":
508
- A === 0 ? (r = y[0] + w, s = y[1] + S, i = r, a = s, (u < 0 || n[n.length - 1]?.subpath === u) && u++) : (h(Q(r, s, y[0] + w, y[1] + S)), r = y[0] + w, s = y[1] + S);
511
+ w === 0 ? (r = y[0] + v, s = y[1] + A, o = r, i = s, (u < 0 || n[n.length - 1]?.subpath === u) && u++) : (h(q(r, s, y[0] + v, y[1] + A)), r = y[0] + v, s = y[1] + A);
509
512
  break;
510
513
  case "L":
511
- h(Q(r, s, y[0] + w, y[1] + S)), r = y[0] + w, s = y[1] + S;
514
+ h(q(r, s, y[0] + v, y[1] + A)), r = y[0] + v, s = y[1] + A;
512
515
  break;
513
516
  case "H":
514
- h(Q(r, s, y[0] + w, s)), r = y[0] + w;
517
+ h(q(r, s, y[0] + v, s)), r = y[0] + v;
515
518
  break;
516
519
  case "V":
517
- h(Q(r, s, r, y[0] + S)), s = y[0] + S;
520
+ h(q(r, s, r, y[0] + A)), s = y[0] + A;
518
521
  break;
519
522
  case "C": {
520
- const T = [y[0] + w, y[1] + S, y[2] + w, y[3] + S, y[4] + w, y[5] + S];
521
- h(rt(r, s, T)), I = [T[2], T[3]], r = T[4], s = T[5];
523
+ const T = [y[0] + v, y[1] + A, y[2] + v, y[3] + A, y[4] + v, y[5] + A];
524
+ h(ot(r, s, T)), D = [T[2], T[3]], r = T[4], s = T[5];
522
525
  break;
523
526
  }
524
527
  case "S": {
525
- const [T, x] = o ? [2 * r - o[0], 2 * s - o[1]] : [r, s], v = [T, x, y[0] + w, y[1] + S, y[2] + w, y[3] + S];
526
- h(rt(r, s, v)), I = [v[2], v[3]], r = v[4], s = v[5];
528
+ const [T, x] = a ? [2 * r - a[0], 2 * s - a[1]] : [r, s], S = [T, x, y[0] + v, y[1] + A, y[2] + v, y[3] + A];
529
+ h(ot(r, s, S)), D = [S[2], S[3]], r = S[4], s = S[5];
527
530
  break;
528
531
  }
529
532
  case "Q":
530
533
  case "T": {
531
534
  let T = r, x = s;
532
- M === "Q" ? (T = y[0] + w, x = y[1] + S) : c && (T = 2 * r - c[0], x = 2 * s - c[1]);
533
- const v = M === "Q" ? y[2] + w : y[0] + w, $ = M === "Q" ? y[3] + S : y[1] + S;
535
+ _ === "Q" ? (T = y[0] + v, x = y[1] + A) : c && (T = 2 * r - c[0], x = 2 * s - c[1]);
536
+ const S = _ === "Q" ? y[2] + v : y[0] + v, $ = _ === "Q" ? y[3] + A : y[1] + A;
534
537
  h(
535
- rt(r, s, [
538
+ ot(r, s, [
536
539
  r + 2 / 3 * (T - r),
537
540
  s + 2 / 3 * (x - s),
538
- v + 2 / 3 * (T - v),
541
+ S + 2 / 3 * (T - S),
539
542
  $ + 2 / 3 * (x - $),
540
- v,
543
+ S,
541
544
  $
542
545
  ])
543
- ), m = [T, x], r = v, s = $;
546
+ ), m = [T, x], r = S, s = $;
544
547
  break;
545
548
  }
546
549
  case "A": {
547
- const T = y[5] + w, x = y[6] + S;
548
- let v = r, $ = s;
549
- for (const Y of Be(r, s, y[0], y[1], y[2], y[3], y[4], T, x))
550
- h(rt(v, $, Y)), v = Y[4], $ = Y[5];
550
+ const T = y[5] + v, x = y[6] + A;
551
+ let S = r, $ = s;
552
+ for (const P of cn(r, s, y[0], y[1], y[2], y[3], y[4], T, x))
553
+ h(ot(S, $, P)), S = P[4], $ = P[5];
551
554
  r = T, s = x;
552
555
  break;
553
556
  }
554
557
  }
555
- o = I, c = m;
558
+ a = D, c = m;
556
559
  }
557
560
  }
558
- const p = n.reduce((d, g) => d + g.length, 0), f = [];
561
+ const f = n.reduce((d, g) => d + g.length, 0), p = [];
559
562
  for (let d = 0; d < n.length; ) {
560
563
  const g = n[d].subpath;
561
- let M = d, b = 0;
562
- for (; M < n.length && n[M].subpath === g; ) b += n[M++].length;
563
- const k = n[d], A = n[M - 1], y = l.has(g) || Math.abs(A.endX - k.startX) < 1e-9 && Math.abs(A.endY - k.startY) < 1e-9;
564
- f.push({ start: d, end: M, length: b, closed: y }), d = M;
564
+ let _ = d, b = 0;
565
+ for (; _ < n.length && n[_].subpath === g; ) b += n[_++].length;
566
+ const k = n[d], w = n[_ - 1], y = l.has(g) || Math.abs(w.endX - k.startX) < 1e-9 && Math.abs(w.endY - k.startY) < 1e-9;
567
+ p.push({ start: d, end: _, length: b, closed: y }), d = _;
565
568
  }
566
- const _ = { segments: n, totalLength: p, subpaths: f };
567
- return q.size >= Ye && q.delete(q.keys().next().value), q.set(t, _), _;
569
+ const M = { segments: n, totalLength: f, subpaths: p };
570
+ return W.size >= nn && W.delete(W.keys().next().value), W.set(t, M), M;
568
571
  }
569
- function qe(t, e) {
572
+ function un(t, e) {
570
573
  const n = t.lengths;
571
574
  if (e <= 0) return 0;
572
575
  if (e >= t.length) return 1;
573
576
  let r = 0, s = n.length - 1;
574
577
  for (; r < s - 1; ) {
575
- const o = r + s >> 1;
576
- n[o] < e ? r = o : s = o;
578
+ const a = r + s >> 1;
579
+ n[a] < e ? r = a : s = a;
577
580
  }
578
- const i = n[s] - n[r], a = i > 0 ? (e - n[r]) / i : 0;
579
- return (r + a) / (n.length - 1);
581
+ const o = n[s] - n[r], i = o > 0 ? (e - n[r]) / o : 0;
582
+ return (r + i) / (n.length - 1);
580
583
  }
581
- function We(t, e) {
584
+ function ln(t, e) {
582
585
  if (t.type === "L") {
583
586
  const h = t.length > 0 ? Math.max(0, Math.min(1, e / t.length)) : 0;
584
587
  return {
@@ -587,304 +590,378 @@ function We(t, e) {
587
590
  angle: Math.atan2(t.endY - t.startY, t.endX - t.startX) * 180 / Math.PI
588
591
  };
589
592
  }
590
- const [n, r, s, i, a, o] = t.points, c = qe(t, e);
591
- let u = Ct(t.startX, n, s, a, c), l = Ct(t.startY, r, i, o, c);
593
+ const [n, r, s, o, i, a] = t.points, c = un(t, e);
594
+ let u = Ut(t.startX, n, s, i, c), l = Ut(t.startY, r, o, a, c);
592
595
  if (Math.hypot(u, l) < 1e-9) {
593
- const h = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), p = X(t.startX, n, s, a, h), f = X(t.startY, r, i, o, h), _ = X(t.startX, n, s, a, c), d = X(t.startY, r, i, o, c);
594
- u = c < 0.5 ? p - _ : _ - p, l = c < 0.5 ? f - d : d - f;
596
+ const h = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = z(t.startX, n, s, i, h), p = z(t.startY, r, o, a, h), M = z(t.startX, n, s, i, c), d = z(t.startY, r, o, a, c);
597
+ u = c < 0.5 ? f - M : M - f, l = c < 0.5 ? p - d : d - p;
595
598
  }
596
599
  return {
597
- x: X(t.startX, n, s, a, c),
598
- y: X(t.startY, r, i, o, c),
600
+ x: z(t.startX, n, s, i, c),
601
+ y: z(t.startY, r, o, a, c),
599
602
  angle: Math.atan2(l, u) * 180 / Math.PI
600
603
  };
601
604
  }
602
- function te(t, e, n = 0, r = t.length) {
605
+ function he(t, e, n = 0, r = t.length) {
603
606
  if (r <= n) return { x: 0, y: 0, angle: 0 };
604
607
  let s = 0;
605
- for (let i = n; i < r; i++) {
606
- const a = t[i];
607
- if (s + a.length >= e || i === r - 1)
608
- return We(a, e - s);
609
- s += a.length;
608
+ for (let o = n; o < r; o++) {
609
+ const i = t[o];
610
+ if (s + i.length >= e || o === r - 1)
611
+ return ln(i, e - s);
612
+ s += i.length;
610
613
  }
611
614
  return { x: 0, y: 0, angle: 0 };
612
615
  }
613
- function je(t, e) {
614
- const { segments: n, totalLength: r } = W(t);
615
- return te(n, Math.max(0, Math.min(1, e)) * r);
616
+ function hn(t, e) {
617
+ const { segments: n, totalLength: r } = G(t);
618
+ return he(n, Math.max(0, Math.min(1, e)) * r);
616
619
  }
617
- function Kn() {
618
- q.clear();
620
+ function Cr() {
621
+ W.clear();
619
622
  }
620
- function Qn(t) {
621
- return W(t).totalLength;
623
+ function Ir(t) {
624
+ return G(t).totalLength;
622
625
  }
623
- const Ke = 24, Qe = 320, Ge = 2.5, G = 72, Gn = 64, Ze = 0.2, Je = 128, J = /* @__PURE__ */ new Map();
624
- let st = 0, N;
625
- const It = (t) => Math.round(t * 100) / 100;
626
- function Et(t, e) {
627
- const { segments: n, subpaths: r, totalLength: s } = W(t);
626
+ const fn = 24, pn = 320, dn = 2.5, J = 72, Er = 64, gn = 0.2, mn = 128, et = /* @__PURE__ */ new Map();
627
+ let it = 0, X;
628
+ const Vt = (t) => Math.round(t * 100) / 100;
629
+ function jt(t, e) {
630
+ const { segments: n, subpaths: r, totalLength: s } = G(t);
628
631
  if (n.length === 0) return [];
629
632
  if (e) {
630
- const i = r.every((a) => a.closed);
631
- return [{ segments: n, start: 0, end: n.length, length: s, closed: i }];
633
+ const o = r.every((i) => i.closed);
634
+ return [{ segments: n, start: 0, end: n.length, length: s, closed: o }];
632
635
  }
633
- return r.filter((i) => i.length > 0).map((i) => ({ segments: n, start: i.start, end: i.end, length: i.length, closed: i.closed }));
636
+ return r.filter((o) => o.length > 0).map((o) => ({ segments: n, start: o.start, end: o.end, length: o.length, closed: o.closed }));
634
637
  }
635
- function xt(t, e) {
636
- const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r = te(t.segments, n * t.length, t.start, t.end);
638
+ function At(t, e) {
639
+ const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r = he(t.segments, n * t.length, t.start, t.end);
637
640
  return [r.x, r.y];
638
641
  }
639
- function Lt(t) {
642
+ function Ht(t) {
640
643
  const e = [];
641
644
  let n = 0;
642
645
  for (let r = t.start; r < t.end; r++)
643
646
  n += t.segments[r].length, t.length > 0 && e.push(n / t.length);
644
647
  return e;
645
648
  }
646
- function Ft(t, e) {
649
+ function Bt(t, e) {
647
650
  const n = [];
648
651
  for (let r = 0; r < e; r++)
649
- n.push(xt(t, t.closed ? r / e : r / (e - 1)));
652
+ n.push(At(t, t.closed ? r / e : r / (e - 1)));
650
653
  return n;
651
654
  }
652
- function Ot(t) {
655
+ function Wt(t) {
653
656
  let e = 0, n = 0;
654
657
  for (const [r, s] of t)
655
658
  e += r, n += s;
656
659
  return e /= t.length, n /= t.length, t.map(([r, s]) => [r - e, s - n]);
657
660
  }
658
- function tn(t, e, n) {
661
+ function yn(t, e, n) {
659
662
  const r = t.closed && e.closed;
660
663
  if (n !== void 0)
661
- return { offset: r ? Math.abs(n) % G / G : 0, reversed: n < 0 };
662
- const s = Ot(Ft(t, G)), i = Ot(Ft(e, G)), a = G;
663
- let o = { offset: 0, reversed: !1 }, c = 1 / 0;
664
+ return { offset: r ? Math.abs(n) % J / J : 0, reversed: n < 0 };
665
+ const s = Wt(Bt(t, J)), o = Wt(Bt(e, J)), i = J;
666
+ let a = { offset: 0, reversed: !1 }, c = 1 / 0;
664
667
  for (const u of [!1, !0]) {
665
- const l = r ? a : 1;
668
+ const l = r ? i : 1;
666
669
  for (let h = 0; h < l; h++) {
667
- let p = 0;
668
- for (let f = 0; f < a && p < c; f++) {
669
- const _ = r ? u ? (h - f + a) % a : (f + h) % a : u ? a - 1 - f : f, d = s[f][0] - i[_][0], g = s[f][1] - i[_][1];
670
- p += d * d + g * g;
670
+ let f = 0;
671
+ for (let p = 0; p < i && f < c; p++) {
672
+ const M = r ? u ? (h - p + i) % i : (p + h) % i : u ? i - 1 - p : p, d = s[p][0] - o[M][0], g = s[p][1] - o[M][1];
673
+ f += d * d + g * g;
671
674
  }
672
- p < c && (c = p, o = { offset: r ? h / a : 0, reversed: u });
675
+ f < c && (c = f, a = { offset: r ? h / i : 0, reversed: u });
673
676
  }
674
677
  }
675
- return o;
678
+ return a;
676
679
  }
677
- function en(t, e, n) {
680
+ function Mn(t, e, n) {
678
681
  return n ? ((e.reversed ? e.offset - t : t + e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
679
682
  }
680
- function nn(t, e, n) {
683
+ function _n(t, e, n) {
681
684
  return n ? ((e.reversed ? e.offset - t : t - e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
682
685
  }
683
- function rn(t, e, n) {
684
- const r = t.closed && e.closed, s = tn(t, e, n.shapeIndex), i = Math.max(
685
- Ke,
686
- Math.min(Qe, Math.ceil(Math.max(t.length, e.length) / Ge))
687
- ), a = /* @__PURE__ */ new Set(), o = (h) => a.add(Math.round(h * 1e7) / 1e7);
688
- for (let h = 0; h <= i; h++) o(h / i);
689
- for (const h of Lt(t)) o(h);
690
- for (const h of Lt(e)) o(nn(h, s, r));
691
- let c = [...a].sort((h, p) => h - p);
686
+ function bn(t, e, n) {
687
+ const r = t.closed && e.closed, s = yn(t, e, n.shapeIndex), o = Math.max(
688
+ fn,
689
+ Math.min(pn, Math.ceil(Math.max(t.length, e.length) / dn))
690
+ ), i = /* @__PURE__ */ new Set(), a = (h) => i.add(Math.round(h * 1e7) / 1e7);
691
+ for (let h = 0; h <= o; h++) a(h / o);
692
+ for (const h of Ht(t)) a(h);
693
+ for (const h of Ht(e)) a(_n(h, s, r));
694
+ let c = [...i].sort((h, f) => h - f);
692
695
  r && (c = c.filter((h) => h < 1));
693
696
  const u = [], l = [];
694
697
  for (const h of c)
695
- u.push(...xt(t, h)), l.push(...xt(e, en(h, s, r)));
696
- return sn({ from: u, to: l, closed: r });
698
+ u.push(...At(t, h)), l.push(...At(e, Mn(h, s, r)));
699
+ return Tn({ from: u, to: l, closed: r });
697
700
  }
698
- function sn(t) {
701
+ function Tn(t) {
699
702
  const e = t.from.length / 2;
700
703
  if (e <= 3) return t;
701
704
  const n = new Uint8Array(e);
702
705
  n[0] = 1, n[e - 1] = 1;
703
706
  const r = [[0, e - 1]];
704
707
  for (; r.length > 0; ) {
705
- const [a, o] = r.pop();
706
- let c = -1, u = Ze;
707
- for (let l = a + 1; l < o; l++) {
708
- const h = Math.max(Nt(t.from, a, o, l), Nt(t.to, a, o, l));
708
+ const [i, a] = r.pop();
709
+ let c = -1, u = gn;
710
+ for (let l = i + 1; l < a; l++) {
711
+ const h = Math.max(Qt(t.from, i, a, l), Qt(t.to, i, a, l));
709
712
  h > u && (u = h, c = l);
710
713
  }
711
- c !== -1 && (n[c] = 1, r.push([a, c], [c, o]));
714
+ c !== -1 && (n[c] = 1, r.push([i, c], [c, a]));
712
715
  }
713
- const s = [], i = [];
714
- for (let a = 0; a < e; a++)
715
- n[a] && (s.push(t.from[a * 2], t.from[a * 2 + 1]), i.push(t.to[a * 2], t.to[a * 2 + 1]));
716
- return { from: s, to: i, closed: t.closed };
716
+ const s = [], o = [];
717
+ for (let i = 0; i < e; i++)
718
+ n[i] && (s.push(t.from[i * 2], t.from[i * 2 + 1]), o.push(t.to[i * 2], t.to[i * 2 + 1]));
719
+ return { from: s, to: o, closed: t.closed };
717
720
  }
718
- function Nt(t, e, n, r) {
719
- const s = t[e * 2], i = t[e * 2 + 1], a = t[n * 2] - s, o = t[n * 2 + 1] - i, c = t[r * 2] - s, u = t[r * 2 + 1] - i, l = a * a + o * o, h = l === 0 ? 0 : Math.max(0, Math.min(1, (c * a + u * o) / l));
720
- return Math.hypot(c - h * a, u - h * o);
721
+ function Qt(t, e, n, r) {
722
+ const s = t[e * 2], o = t[e * 2 + 1], i = t[n * 2] - s, a = t[n * 2 + 1] - o, c = t[r * 2] - s, u = t[r * 2 + 1] - o, l = i * i + a * a, h = l === 0 ? 0 : Math.max(0, Math.min(1, (c * i + u * a) / l));
723
+ return Math.hypot(c - h * i, u - h * a);
721
724
  }
722
- function an(t, e, n) {
725
+ function xn(t, e, n) {
723
726
  const r = n.shapeIndex;
724
- if (N && N.from === t && N.to === e && N.shapeIndex === r) return N.plan;
725
- const i = J.get(String(r ?? "auto"))?.get(t)?.get(e);
726
- if (i)
727
- return N = { from: t, to: e, shapeIndex: r, plan: i }, i;
728
- const a = W(t).subpaths.filter((f) => f.length > 0).length === W(e).subpaths.filter((f) => f.length > 0).length, o = Et(t, !a), c = Et(e, !a), u = {
729
- pairs: o.map((f, _) => rn(f, c[_], n))
727
+ if (X && X.from === t && X.to === e && X.shapeIndex === r) return X.plan;
728
+ const o = et.get(String(r ?? "auto"))?.get(t)?.get(e);
729
+ if (o)
730
+ return X = { from: t, to: e, shapeIndex: r, plan: o }, o;
731
+ const i = G(t).subpaths.filter((p) => p.length > 0).length === G(e).subpaths.filter((p) => p.length > 0).length, a = jt(t, !i), c = jt(e, !i), u = {
732
+ pairs: a.map((p, M) => bn(p, c[M], n))
730
733
  };
731
- st >= Je && (J.clear(), st = 0);
732
- const l = String(r ?? "auto"), h = J.get(l) ?? /* @__PURE__ */ new Map();
733
- J.set(l, h);
734
- const p = h.get(t) ?? /* @__PURE__ */ new Map();
735
- return h.set(t, p), p.set(e, u), st++, N = { from: t, to: e, shapeIndex: r, plan: u }, u;
734
+ it >= mn && (et.clear(), it = 0);
735
+ const l = String(r ?? "auto"), h = et.get(l) ?? /* @__PURE__ */ new Map();
736
+ et.set(l, h);
737
+ const f = h.get(t) ?? /* @__PURE__ */ new Map();
738
+ return h.set(t, f), f.set(e, u), it++, X = { from: t, to: e, shapeIndex: r, plan: u }, u;
736
739
  }
737
- function on(t, e, n, r = {}) {
740
+ function kn(t, e, n, r = {}) {
738
741
  if (!t) return e;
739
742
  if (!e) return t;
740
743
  const s = Math.max(0, Math.min(1, n));
741
744
  if (s === 0) return t;
742
745
  if (s === 1) return e;
743
- const i = an(t, e, r);
744
- if (i.pairs.length === 0) return s < 0.5 ? t : e;
745
- let a = "";
746
- for (const o of i.pairs) {
747
- for (let c = 0; c < o.from.length; c += 2) {
748
- const u = It(o.from[c] + (o.to[c] - o.from[c]) * s), l = It(o.from[c + 1] + (o.to[c + 1] - o.from[c + 1]) * s);
749
- a += `${c === 0 ? a ? " M" : "M" : " L"}${u} ${l}`;
746
+ const o = xn(t, e, r);
747
+ if (o.pairs.length === 0) return s < 0.5 ? t : e;
748
+ let i = "";
749
+ for (const a of o.pairs) {
750
+ for (let c = 0; c < a.from.length; c += 2) {
751
+ const u = Vt(a.from[c] + (a.to[c] - a.from[c]) * s), l = Vt(a.from[c + 1] + (a.to[c + 1] - a.from[c + 1]) * s);
752
+ i += `${c === 0 ? i ? " M" : "M" : " L"}${u} ${l}`;
750
753
  }
751
- o.closed && (a += " Z");
754
+ a.closed && (i += " Z");
752
755
  }
753
- return a;
756
+ return i;
754
757
  }
755
- function Zn() {
756
- J.clear(), st = 0, N = void 0;
758
+ function Lr() {
759
+ et.clear(), it = 0, X = void 0;
757
760
  }
758
- function cn(t) {
761
+ function Sn(t) {
759
762
  return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
760
763
  }
761
- const O = (t, e, n) => t + (e - t) * n, ee = 512, pt = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map();
762
- function Xt(t) {
763
- const e = pt.get(t);
764
+ const Q = Math.PI / 180, An = 0.9995;
765
+ function Dt() {
766
+ return [0, 0, 0, 1];
767
+ }
768
+ function at(t, e) {
769
+ const n = Math.hypot(t[0], t[1], t[2]);
770
+ if (n === 0) return Dt();
771
+ const r = e * Q / 2, s = Math.sin(r) / n;
772
+ return [t[0] * s, t[1] * s, t[2] * s, Math.cos(r)];
773
+ }
774
+ function wn(t, e, n) {
775
+ return wt(wt(at([0, 1, 0], e), at([1, 0, 0], t)), at([0, 0, 1], n));
776
+ }
777
+ function vn(t) {
778
+ const [e, n, r, s] = Y(t), o = 2 * (e * r + n * s), i = 2 * (e * n + r * s), a = 1 - 2 * (e * e + r * r), c = 2 * (n * r - e * s), u = 1 - 2 * (n * n + r * r), l = 2 * (e * r - n * s), h = 1 - 2 * (e * e + n * n), f = Math.asin(Math.max(-1, Math.min(1, -c)));
779
+ return Math.abs(c) < 0.9999999 ? [f / Q, Math.atan2(o, h) / Q, Math.atan2(i, a) / Q] : [f / Q, Math.atan2(-l, u) / Q, 0];
780
+ }
781
+ function wt(t, e) {
782
+ const [n, r, s, o] = t, [i, a, c, u] = e;
783
+ return [
784
+ o * i + n * u + r * c - s * a,
785
+ o * a - n * c + r * u + s * i,
786
+ o * c + n * a - r * i + s * u,
787
+ o * u - n * i - r * a - s * c
788
+ ];
789
+ }
790
+ function fe(t, e) {
791
+ return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] + t[3] * e[3];
792
+ }
793
+ function pe(t) {
794
+ return Math.hypot(t[0], t[1], t[2], t[3]);
795
+ }
796
+ function Y(t) {
797
+ const e = pe(t);
798
+ return e === 0 ? Dt() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
799
+ }
800
+ function Pn(t) {
801
+ return [-t[0], -t[1], -t[2], t[3]];
802
+ }
803
+ function de(t, e, n) {
804
+ const r = Y(t);
805
+ let s = Y(e), o = fe(r, s);
806
+ if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > An)
807
+ return Y([
808
+ r[0] + (s[0] - r[0]) * n,
809
+ r[1] + (s[1] - r[1]) * n,
810
+ r[2] + (s[2] - r[2]) * n,
811
+ r[3] + (s[3] - r[3]) * n
812
+ ]);
813
+ const i = Math.acos(o), a = Math.sin(i), c = Math.sin((1 - n) * i) / a, u = Math.sin(n * i) / a;
814
+ return Y([
815
+ r[0] * c + s[0] * u,
816
+ r[1] * c + s[1] * u,
817
+ r[2] * c + s[2] * u,
818
+ r[3] * c + s[3] * u
819
+ ]);
820
+ }
821
+ function $n(t, e) {
822
+ const [n, r, s, o] = Y(t), i = 2 * (r * e[2] - s * e[1]), a = 2 * (s * e[0] - n * e[2]), c = 2 * (n * e[1] - r * e[0]);
823
+ return [e[0] + o * i + (r * c - s * a), e[1] + o * a + (s * i - n * c), e[2] + o * c + (n * a - r * i)];
824
+ }
825
+ const Or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
826
+ __proto__: null,
827
+ conjugate: Pn,
828
+ dot: fe,
829
+ fromAxisAngle: at,
830
+ fromEuler: wn,
831
+ identity: Dt,
832
+ length: pe,
833
+ multiply: wt,
834
+ normalize: Y,
835
+ rotateVec3: $n,
836
+ slerp: de,
837
+ toEuler: vn
838
+ }, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, ge = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
839
+ function Gt(t) {
840
+ const e = mt.get(t);
764
841
  if (e) return e;
765
842
  const n = t.replace("#", ""), r = [
766
843
  parseInt(n.slice(0, 2), 16),
767
844
  parseInt(n.slice(2, 4), 16),
768
845
  parseInt(n.slice(4, 6), 16)
769
846
  ];
770
- return pt.size < ee && pt.set(t, r), r;
847
+ return mt.size < ge && mt.set(t, r), r;
771
848
  }
772
- const Yt = (t) => t.charCodeAt(0) === 35, Ut = (t) => t.startsWith("rgb"), Vt = (t) => t.startsWith("rgba"), un = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, gt = (t) => Math.round(t).toString(16).padStart(2, "0");
773
- function ln(t, e, n) {
774
- return `#${gt(t)}${gt(e)}${gt(n)}`;
849
+ const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"), Rn = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Mt = (t) => Math.round(t).toString(16).padStart(2, "0");
850
+ function Dn(t, e, n) {
851
+ return `#${Mt(t)}${Mt(e)}${Mt(n)}`;
775
852
  }
776
- function Ht(t) {
777
- const e = dt.get(t);
853
+ function Jt(t) {
854
+ const e = yt.get(t);
778
855
  if (e) return e;
779
- const n = t.match(un);
856
+ const n = t.match(Rn);
780
857
  if (!n)
781
858
  throw new Error(`Invalid rgb color: ${t}`);
782
- const r = parseInt(n[1], 10), s = parseInt(n[2], 10), i = parseInt(n[3], 10), a = n[4] !== void 0 ? [r, s, i, parseFloat(n[4])] : [r, s, i];
783
- return dt.size < ee && dt.set(t, a), a;
859
+ const r = parseInt(n[1], 10), s = parseInt(n[2], 10), o = parseInt(n[3], 10), i = n[4] !== void 0 ? [r, s, o, parseFloat(n[4])] : [r, s, o];
860
+ return yt.size < ge && yt.set(t, i), i;
784
861
  }
785
- const hn = (t, e, n) => {
786
- if (Yt(t) && Yt(e)) {
787
- const [r, s, i] = Xt(t), [a, o, c] = Xt(e), u = O(r, a, n), l = O(s, o, n), h = O(i, c, n);
788
- return ln(u, l, h);
862
+ const Cn = (t, e, n) => {
863
+ if (Kt(t) && Kt(e)) {
864
+ const [r, s, o] = Gt(t), [i, a, c] = Gt(e), u = N(r, i, n), l = N(s, a, n), h = N(o, c, n);
865
+ return Dn(u, l, h);
789
866
  }
790
- if ((Ut(t) || Vt(t)) && (Ut(e) || Vt(e))) {
791
- const r = Ht(t), s = Ht(e), i = Math.round(O(r[0], s[0], n)), a = Math.round(O(r[1], s[1], n)), o = Math.round(O(r[2], s[2], n));
867
+ if ((Zt(t) || qt(t)) && (Zt(e) || qt(e))) {
868
+ const r = Jt(t), s = Jt(e), o = Math.round(N(r[0], s[0], n)), i = Math.round(N(r[1], s[1], n)), a = Math.round(N(r[2], s[2], n));
792
869
  if (r.length === 4 || s.length === 4) {
793
- const c = r[3] ?? 1, u = s[3] ?? 1, l = O(c, u, n);
794
- return `rgba(${i}, ${a}, ${o}, ${l})`;
870
+ const c = r[3] ?? 1, u = s[3] ?? 1, l = N(c, u, n);
871
+ return `rgba(${o}, ${i}, ${a}, ${l})`;
795
872
  }
796
- return `rgb(${i}, ${a}, ${o})`;
873
+ return `rgb(${o}, ${i}, ${a})`;
797
874
  }
798
875
  return n < 1 ? t : e;
799
- }, fn = (t, e, n) => {
876
+ }, In = (t, e, n) => {
800
877
  const r = Math.min(t.length, e.length), s = [];
801
- for (let i = 0; i < r; i++)
802
- s.push(O(t[i], e[i], n));
878
+ for (let o = 0; o < r; o++)
879
+ s.push(N(t[o], e[o], n));
803
880
  return s;
804
- }, zt = (t, e, n) => n < 1 ? t : e, pn = (t, e, n) => on(t, e, n);
805
- function ne(t) {
806
- return typeof t == "number" ? O : Array.isArray(t) ? fn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? hn : cn(t) ? pn : zt : zt;
881
+ }, En = (t, e, n) => de(t, e, n), te = (t, e, n) => n < 1 ? t : e, Ln = (t, e, n) => kn(t, e, n);
882
+ function me(t, e) {
883
+ return e === "slerp" ? En : typeof t == "number" ? N : Array.isArray(t) ? In : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? Cn : Sn(t) ? Ln : te : te;
807
884
  }
808
- const re = 1e3 / 60;
809
- function se(t, e = {}) {
810
- if (!H(t))
885
+ const ye = 1e3 / 60;
886
+ function Me(t, e = {}) {
887
+ if (!j(t))
811
888
  throw new Error(`bakeSpringTrack: track "${t.id}" is not a spring track`);
812
- const n = new at(t.spring);
813
- return ae(t, (r) => n.valueAt(r), n.settleTime(), t.spring.from, t.spring.to, e);
889
+ const n = new ut(t.spring);
890
+ return be(t, (r) => n.valueAt(r), n.settleTime(), t.spring.from, t.spring.to, e);
814
891
  }
815
- function ie(t, e = {}) {
892
+ function _e(t, e = {}) {
816
893
  if (!V(t))
817
894
  throw new Error(`bakeInertiaTrack: track "${t.id}" is not an inertia track`);
818
895
  const n = t.inertia;
819
- return ae(
896
+ return be(
820
897
  t,
821
- (r) => bt(n, r),
822
- ut(n),
898
+ (r) => kt(n, r),
899
+ ft(n),
823
900
  n.from,
824
- ct(n),
901
+ ht(n),
825
902
  e
826
903
  );
827
904
  }
828
- function ae(t, e, n, r, s, i) {
829
- const a = i.intervalMs ?? re, o = i.tolerance ?? 0.01, c = t.delay ?? 0, u = [];
830
- for (let h = 0; h <= n; h += a)
905
+ function be(t, e, n, r, s, o) {
906
+ const i = o.intervalMs ?? ye, a = o.tolerance ?? 0.01, c = t.delay ?? 0, u = [];
907
+ for (let h = 0; h <= n; h += i)
831
908
  u.push({ time: h + c, value: e(h), easing: "linear" });
832
909
  const l = u[u.length - 1];
833
910
  return !l || l.time < n + c ? u.push({ time: n + c, value: s, easing: "linear" }) : l.value = s, c > 0 && u.unshift({ time: 0, value: r, easing: "linear" }), {
834
911
  id: t.id,
835
912
  target: t.target,
836
913
  property: t.property,
837
- keyframes: o > 0 ? mn(u, o) : u,
914
+ keyframes: a > 0 ? Nn(u, a) : u,
838
915
  ...t.targets && { targets: [...t.targets] },
839
916
  ...t.stagger && { stagger: { ...t.stagger } }
840
917
  };
841
918
  }
842
- function dn(t, e, n, r = {}) {
843
- const s = r.intervalMs ?? re, i = typeof n == "function" ? n : Jt(n), a = ne(t.value), o = e.time - t.time;
844
- if (o <= 0) return [e];
919
+ function On(t, e, n, r = {}) {
920
+ const s = r.intervalMs ?? ye, o = typeof n == "function" ? n : le(n), i = me(t.value, r.interpolation), a = e.time - t.time;
921
+ if (a <= 0) return [e];
845
922
  const c = [];
846
- for (let l = s; l < o; l += s) {
847
- const h = l / o;
923
+ for (let l = s; l < a; l += s) {
924
+ const h = l / a;
848
925
  c.push({
849
926
  time: t.time + l,
850
- value: a(t.value, e.value, i(h)),
927
+ value: i(t.value, e.value, o(h)),
851
928
  easing: "linear"
852
929
  });
853
930
  }
854
- const u = i(1);
855
- return c.push({ ...e, ...u !== 1 && { value: a(t.value, e.value, u) }, easing: "linear" }), c;
931
+ const u = o(1);
932
+ return c.push({ ...e, ...u !== 1 && { value: i(t.value, e.value, u) }, easing: "linear" }), c;
856
933
  }
857
- function Jn(t, e) {
858
- return H(t) ? se(t, e) : V(t) ? ie(t, e) : t;
934
+ function Fr(t, e) {
935
+ return j(t) ? Me(t, e) : V(t) ? _e(t, e) : t;
859
936
  }
860
- function gn(t, e = {}) {
937
+ function Fn(t, e = {}) {
861
938
  const n = t.keyframes;
862
- if (!n.some((s) => Mt(s.easing))) return t;
863
- const r = n.length > 0 ? [n[0]] : [];
864
- for (let s = 1; s < n.length; s++) {
865
- const i = n[s];
866
- Mt(i.easing) ? r.push(...dn(n[s - 1], i, i.easing, e)) : r.push(i);
939
+ if (!n.some((o) => xt(o.easing))) return t;
940
+ const r = n.length > 0 ? [n[0]] : [], s = { ...e, interpolation: t.interpolation ?? e.interpolation };
941
+ for (let o = 1; o < n.length; o++) {
942
+ const i = n[o];
943
+ xt(i.easing) ? r.push(...On(n[o - 1], i, i.easing, s)) : r.push(i);
867
944
  }
868
945
  return { ...t, keyframes: r };
869
946
  }
870
- function tr(t, e) {
871
- return t.filter(Me).map((n) => gn(n, e)).concat(
872
- t.filter(H).map((n) => se(n, e)),
873
- t.filter(V).map((n) => ie(n, e))
947
+ function Nr(t, e) {
948
+ return t.filter(Le).map((n) => Fn(n, e)).concat(
949
+ t.filter(j).map((n) => Me(n, e)),
950
+ t.filter(V).map((n) => _e(n, e))
874
951
  );
875
952
  }
876
- function mn(t, e) {
953
+ function Nn(t, e) {
877
954
  if (t.length <= 2) return t;
878
955
  const n = [t[0]];
879
956
  for (let r = 1; r < t.length - 1; r++) {
880
- const s = n[n.length - 1], i = t[r], a = t[r + 1], o = a.time - s.time;
881
- if (o <= 0) continue;
882
- const c = (i.time - s.time) / o, u = s.value + (a.value - s.value) * c;
883
- Math.abs(i.value - u) > e && n.push(i);
957
+ const s = n[n.length - 1], o = t[r], i = t[r + 1], a = i.time - s.time;
958
+ if (a <= 0) continue;
959
+ const c = (o.time - s.time) / a, u = s.value + (i.value - s.value) * c;
960
+ Math.abs(o.value - u) > e && n.push(o);
884
961
  }
885
962
  return n.push(t[t.length - 1]), n;
886
963
  }
887
- function yn(t) {
964
+ function Xn(t) {
888
965
  const e = [...t.keyframes].sort((n, r) => n.time - r.time);
889
966
  return {
890
967
  ...t,
@@ -894,11 +971,11 @@ function yn(t) {
894
971
  function U(t) {
895
972
  return t.targets && t.targets.length > 0 ? t.targets : [t.target];
896
973
  }
897
- function j(t, e, n, r) {
974
+ function K(t, e, n, r) {
898
975
  const s = n ?? 0;
899
- return !r || e <= 1 ? s : s + jt(t, e, r);
976
+ return !r || e <= 1 ? s : s + oe(t, e, r);
900
977
  }
901
- class mt {
978
+ class _t {
902
979
  track;
903
980
  targets;
904
981
  constructor(e) {
@@ -911,7 +988,7 @@ class mt {
911
988
  * that need every target should use `getTargetValues`.
912
989
  */
913
990
  getValueAtTime(e) {
914
- return this.valueForOffset(e - j(0, this.targets.length, this.track.delay, this.track.stagger));
991
+ return this.valueForOffset(e - K(0, this.targets.length, this.track.delay, this.track.stagger));
915
992
  }
916
993
  /**
917
994
  * Every target's value at a specific time, in target order.
@@ -922,8 +999,8 @@ class mt {
922
999
  getTargetValues(e) {
923
1000
  const n = this.targets.length, r = [];
924
1001
  for (let s = 0; s < n; s++) {
925
- const i = j(s, n, this.track.delay, this.track.stagger), a = this.valueForOffset(e - i);
926
- a !== void 0 && r.push({ target: this.targets[s], value: a, start: i + this.track.keyframes[0].time });
1002
+ const o = K(s, n, this.track.delay, this.track.stagger), i = this.valueForOffset(e - o);
1003
+ i !== void 0 && r.push({ target: this.targets[s], value: i, start: o + this.track.keyframes[0].time });
927
1004
  }
928
1005
  return r;
929
1006
  }
@@ -935,7 +1012,7 @@ class mt {
935
1012
  const { keyframes: e } = this.track;
936
1013
  if (e.length === 0)
937
1014
  return 0;
938
- const n = e[e.length - 1].time, r = this.track.stagger ? vt(this.targets.length, this.track.stagger) : 0;
1015
+ const n = e[e.length - 1].time, r = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
939
1016
  return n + (this.track.delay ?? 0) + r + (this.track.endDelay ?? 0);
940
1017
  }
941
1018
  /**
@@ -958,8 +1035,8 @@ class mt {
958
1035
  return;
959
1036
  if (r.time === e)
960
1037
  return r.value;
961
- const i = s.time - r.time, a = (e - r.time) / i, c = Jt(s.easing)(a);
962
- return ne(r.value)(r.value, s.value, c);
1038
+ const o = s.time - r.time, i = (e - r.time) / o, c = le(s.easing)(i);
1039
+ return me(r.value, this.track.interpolation)(r.value, s.value, c);
963
1040
  }
964
1041
  /**
965
1042
  * Find the keyframes surrounding a given time.
@@ -972,107 +1049,107 @@ class mt {
972
1049
  return { from: null, to: null };
973
1050
  }
974
1051
  }
975
- class _n {
1052
+ class zn {
976
1053
  track;
977
1054
  targets;
978
1055
  sampler;
979
1056
  constructor(e) {
980
- this.track = e, this.targets = U(e), this.sampler = new at(e.spring);
1057
+ this.track = e, this.targets = U(e), this.sampler = new ut(e.spring);
981
1058
  }
982
1059
  getValueAtTime(e) {
983
- return this.sampler.valueAt(e - j(0, this.targets.length, this.track.delay, this.track.stagger));
1060
+ return this.sampler.valueAt(e - K(0, this.targets.length, this.track.delay, this.track.stagger));
984
1061
  }
985
1062
  getTargetValues(e) {
986
1063
  const n = this.targets.length, r = [];
987
1064
  for (let s = 0; s < n; s++) {
988
- const i = j(s, n, this.track.delay, this.track.stagger);
989
- r.push({ target: this.targets[s], value: this.sampler.valueAt(e - i), start: i });
1065
+ const o = K(s, n, this.track.delay, this.track.stagger);
1066
+ r.push({ target: this.targets[s], value: this.sampler.valueAt(e - o), start: o });
990
1067
  }
991
1068
  return r;
992
1069
  }
993
1070
  /** Settle time plus delay and the widest stagger offset. */
994
1071
  getDuration() {
995
- const e = this.track.stagger ? vt(this.targets.length, this.track.stagger) : 0;
1072
+ const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
996
1073
  return this.sampler.settleTime() + (this.track.delay ?? 0) + e;
997
1074
  }
998
1075
  getTrack() {
999
1076
  return this.track;
1000
1077
  }
1001
1078
  }
1002
- class Mn {
1079
+ class Yn {
1003
1080
  track;
1004
1081
  targets;
1005
1082
  duration;
1006
1083
  constructor(e) {
1007
- this.track = e, this.targets = U(e), this.duration = ut(e.inertia);
1084
+ this.track = e, this.targets = U(e), this.duration = ft(e.inertia);
1008
1085
  }
1009
1086
  getValueAtTime(e) {
1010
- return bt(this.track.inertia, e - j(0, this.targets.length, this.track.delay, this.track.stagger));
1087
+ return kt(this.track.inertia, e - K(0, this.targets.length, this.track.delay, this.track.stagger));
1011
1088
  }
1012
1089
  getTargetValues(e) {
1013
1090
  const n = this.targets.length, r = [];
1014
1091
  for (let s = 0; s < n; s++) {
1015
- const i = j(s, n, this.track.delay, this.track.stagger);
1016
- r.push({ target: this.targets[s], value: bt(this.track.inertia, e - i), start: i });
1092
+ const o = K(s, n, this.track.delay, this.track.stagger);
1093
+ r.push({ target: this.targets[s], value: kt(this.track.inertia, e - o), start: o });
1017
1094
  }
1018
1095
  return r;
1019
1096
  }
1020
1097
  /** Settle time plus delay and the widest stagger offset. */
1021
1098
  getDuration() {
1022
- const e = this.track.stagger ? vt(this.targets.length, this.track.stagger) : 0;
1099
+ const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1023
1100
  return this.duration + (this.track.delay ?? 0) + e;
1024
1101
  }
1025
1102
  getTrack() {
1026
1103
  return this.track;
1027
1104
  }
1028
1105
  }
1029
- function oe(t, e) {
1030
- const n = { ...je(t.pathData, e) };
1106
+ function Te(t, e) {
1107
+ const n = { ...hn(t.pathData, e) };
1031
1108
  if (t.matrix) {
1032
- const [r, s, i, a, o, c] = t.matrix, { x: u, y: l } = n;
1033
- n.x = r * u + i * l + o, n.y = s * u + a * l + c;
1034
- const h = n.angle * Math.PI / 180, p = Math.cos(h), f = Math.sin(h);
1035
- n.angle = Math.atan2(s * p + a * f, r * p + i * f) * 180 / Math.PI;
1109
+ const [r, s, o, i, a, c] = t.matrix, { x: u, y: l } = n;
1110
+ n.x = r * u + o * l + a, n.y = s * u + i * l + c;
1111
+ const h = n.angle * Math.PI / 180, f = Math.cos(h), p = Math.sin(h);
1112
+ n.angle = Math.atan2(s * f + i * p, r * f + o * p) * 180 / Math.PI;
1036
1113
  }
1037
1114
  return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
1038
1115
  }
1039
- function er(t, e, n, r) {
1116
+ function Xr(t, e, n, r) {
1040
1117
  const s = e + (n - e) * r;
1041
- return oe(t, s);
1118
+ return Te(t, s);
1042
1119
  }
1043
- const yt = {
1120
+ const bt = {
1044
1121
  upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
1045
1122
  lowerCase: "abcdefghijklmnopqrstuvwxyz",
1046
1123
  upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
1047
1124
  numbers: "0123456789"
1048
- }, bn = 20;
1049
- function Tn(t) {
1050
- const e = yt[t ?? "upperCase"] ?? t ?? yt.upperCase, n = Array.from(e);
1051
- return n.length > 0 ? n : Array.from(yt.upperCase);
1125
+ }, Un = 20;
1126
+ function Vn(t) {
1127
+ const e = bt[t ?? "upperCase"] ?? t ?? bt.upperCase, n = Array.from(e);
1128
+ return n.length > 0 ? n : Array.from(bt.upperCase);
1052
1129
  }
1053
- function xn(t, e, n) {
1130
+ function jn(t, e, n) {
1054
1131
  let r = (t | 0) ^ Math.imul(e + 1, 2654435761) ^ Math.imul(n + 1, 2246822507);
1055
1132
  return r = Math.imul(r ^ r >>> 16, 2146121005), r = Math.imul(r ^ r >>> 15, 2221713035), (r ^ r >>> 16) >>> 0;
1056
1133
  }
1057
- function kn(t, e, n = 0) {
1058
- const r = t.from ?? "", s = t.to, i = Math.max(0, Math.min(1, e));
1059
- if (i <= 0) return r;
1060
- if (i >= 1) return s;
1061
- const a = Array.from(r), o = Array.from(s), c = t.rightToLeft ?? !1;
1134
+ function Hn(t, e, n = 0) {
1135
+ const r = t.from ?? "", s = t.to, o = Math.max(0, Math.min(1, e));
1136
+ if (o <= 0) return r;
1137
+ if (o >= 1) return s;
1138
+ const i = Array.from(r), a = Array.from(s), c = t.rightToLeft ?? !1;
1062
1139
  if (t.mode === "type") {
1063
- const b = Math.round(i * Math.max(a.length, o.length));
1064
- return c ? a.slice(0, Math.max(0, a.length - b)).join("") + o.slice(Math.max(0, o.length - b)).join("") : o.slice(0, b).join("") + a.slice(b).join("");
1140
+ const b = Math.round(o * Math.max(i.length, a.length));
1141
+ return c ? i.slice(0, Math.max(0, i.length - b)).join("") + a.slice(Math.max(0, a.length - b)).join("") : a.slice(0, b).join("") + i.slice(b).join("");
1065
1142
  }
1066
- const u = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (i - u) / (1 - u)), h = Math.floor(l * o.length), p = t.tweenLength === !1 ? o.length : Math.round(a.length + (o.length - a.length) * i), f = Tn(t.chars), _ = t.refreshRate ?? bn, d = _ > 0 ? Math.floor(n * _ / 1e3) : 0, g = t.seed ?? 1;
1067
- let M = "";
1068
- for (let b = 0; b < p; b++) {
1069
- const k = c ? b >= p - h : b < h, A = c ? o[o.length - (p - b)] : o[b];
1070
- k && A !== void 0 || A === " " || A === `
1071
- ` ? M += A : M += f[xn(g, b, d) % f.length];
1143
+ const u = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (o - u) / (1 - u)), h = Math.floor(l * a.length), f = t.tweenLength === !1 ? a.length : Math.round(i.length + (a.length - i.length) * o), p = Vn(t.chars), M = t.refreshRate ?? Un, d = M > 0 ? Math.floor(n * M / 1e3) : 0, g = t.seed ?? 1;
1144
+ let _ = "";
1145
+ for (let b = 0; b < f; b++) {
1146
+ const k = c ? b >= f - h : b < h, w = c ? a[a.length - (f - b)] : a[b];
1147
+ k && w !== void 0 || w === " " || w === `
1148
+ ` ? _ += w : _ += p[jn(g, b, d) % p.length];
1072
1149
  }
1073
- return M;
1150
+ return _;
1074
1151
  }
1075
- class vn {
1152
+ class Bn {
1076
1153
  id;
1077
1154
  name;
1078
1155
  _captions;
@@ -1187,15 +1264,15 @@ class vn {
1187
1264
  return;
1188
1265
  let s = e * this.speed;
1189
1266
  if (this._repeatDelayRemaining > 0) {
1190
- const o = Math.min(this._repeatDelayRemaining, s);
1191
- if (this._repeatDelayRemaining -= o, s -= o, this._repeatDelayRemaining > 0) {
1267
+ const a = Math.min(this._repeatDelayRemaining, s);
1268
+ if (this._repeatDelayRemaining -= a, s -= a, this._repeatDelayRemaining > 0) {
1192
1269
  this.onUpdate?.(this.getStateAtTime(this._currentTime));
1193
1270
  return;
1194
1271
  }
1195
1272
  this._wrapAfterDelay && (this._wrapAfterDelay = !1, this._currentTime = 0);
1196
1273
  }
1197
- const i = 1e3;
1198
- for (let o = 0; o < i && s > 0 && this._playbackState === "playing"; o++)
1274
+ const o = 1e3;
1275
+ for (let a = 0; a < o && s > 0 && this._playbackState === "playing"; a++)
1199
1276
  if (this._direction === "forward") {
1200
1277
  const c = n - this._currentTime;
1201
1278
  if (s >= c) {
@@ -1211,8 +1288,8 @@ class vn {
1211
1288
  } else
1212
1289
  this._currentTime -= s, s = 0;
1213
1290
  }
1214
- const a = this.getStateAtTime(this._currentTime);
1215
- this.onUpdate?.(a);
1291
+ const i = this.getStateAtTime(this._currentTime);
1292
+ this.onUpdate?.(i);
1216
1293
  }
1217
1294
  /**
1218
1295
  * Get the animation state at a specific time.
@@ -1223,9 +1300,9 @@ class vn {
1223
1300
  this._resolveShared(e, n);
1224
1301
  else
1225
1302
  for (const [r, s] of this._trackPlayers) {
1226
- const i = s.getTrack().property;
1227
- for (const { target: a, value: o, start: c } of s.getTargetValues(e))
1228
- this._write(n, r, a, i, o, e - c);
1303
+ const o = s.getTrack().property;
1304
+ for (const { target: i, value: a, start: c } of s.getTargetValues(e))
1305
+ this._write(n, r, i, o, a, e - c);
1229
1306
  }
1230
1307
  return {
1231
1308
  values: n,
@@ -1250,36 +1327,36 @@ class vn {
1250
1327
  */
1251
1328
  _resolveShared(e, n) {
1252
1329
  const r = /* @__PURE__ */ new Map();
1253
- for (const [s, i] of this._trackPlayers) {
1254
- const a = i.getTrack().property;
1255
- for (const { target: o, value: c, start: u } of i.getTargetValues(e)) {
1256
- const l = `${o}\0${a}`, h = u <= e, p = r.get(l);
1257
- (!p || (h !== p.started ? h : h ? u >= p.start : u <= p.start)) && r.set(l, { trackId: s, target: o, property: a, value: c, start: u, started: h });
1330
+ for (const [s, o] of this._trackPlayers) {
1331
+ const i = o.getTrack().property;
1332
+ for (const { target: a, value: c, start: u } of o.getTargetValues(e)) {
1333
+ const l = `${a}\0${i}`, h = u <= e, f = r.get(l);
1334
+ (!f || (h !== f.started ? h : h ? u >= f.start : u <= f.start)) && r.set(l, { trackId: s, target: a, property: i, value: c, start: u, started: h });
1258
1335
  }
1259
1336
  }
1260
- for (const { trackId: s, target: i, property: a, value: o, start: c } of r.values())
1261
- this._write(n, s, i, a, o, e - c);
1337
+ for (const { trackId: s, target: o, property: i, value: a, start: c } of r.values())
1338
+ this._write(n, s, o, i, a, e - c);
1262
1339
  }
1263
1340
  /**
1264
1341
  * Write one track's value for a target, expanding the progress of motion paths
1265
1342
  * (into x/y/rotation) and text tracks (into the string). `elapsed` is the time
1266
1343
  * since this target's animation on the track started.
1267
1344
  */
1268
- _write(e, n, r, s, i, a) {
1269
- if (i === void 0) return;
1270
- let o = e.get(r);
1271
- o || (o = /* @__PURE__ */ new Map(), e.set(r, o));
1345
+ _write(e, n, r, s, o, i) {
1346
+ if (o === void 0) return;
1347
+ let a = e.get(r);
1348
+ a || (a = /* @__PURE__ */ new Map(), e.set(r, a));
1272
1349
  const c = this._textTracks.get(n);
1273
- if (c && typeof i == "number") {
1274
- o.set("text", kn(c.textConfig, i, Math.max(0, a)));
1350
+ if (c && typeof o == "number") {
1351
+ a.set("text", Hn(c.textConfig, o, Math.max(0, i)));
1275
1352
  return;
1276
1353
  }
1277
1354
  const u = this._motionPathTracks.get(n);
1278
- if (u && typeof i == "number") {
1279
- const l = oe(u.motionPathConfig, i);
1280
- o.set("motionPathX", l.x), o.set("motionPathY", l.y), u.motionPathConfig.autoRotate && o.set("motionPathRotate", l.angle);
1355
+ if (u && typeof o == "number") {
1356
+ const l = Te(u.motionPathConfig, o);
1357
+ a.set("motionPathX", l.x), a.set("motionPathY", l.y), u.motionPathConfig.autoRotate && a.set("motionPathRotate", l.angle);
1281
1358
  } else
1282
- o.set(s, i);
1359
+ a.set(s, o);
1283
1360
  }
1284
1361
  /** Cached: does any target+property have more than one track? */
1285
1362
  _sharedWrites = null;
@@ -1304,16 +1381,16 @@ class vn {
1304
1381
  */
1305
1382
  addTrack(e) {
1306
1383
  if (this._tracks.push(e), this._sharedWrites = null, V(e)) {
1307
- this._trackPlayers.set(e.id, new Mn(e));
1384
+ this._trackPlayers.set(e.id, new Yn(e));
1308
1385
  return;
1309
1386
  }
1310
- if (H(e)) {
1311
- this._trackPlayers.set(e.id, new _n(e)), this._springTracks.set(e.id, e);
1387
+ if (j(e)) {
1388
+ this._trackPlayers.set(e.id, new zn(e)), this._springTracks.set(e.id, e);
1312
1389
  return;
1313
1390
  }
1314
- if (kt(e))
1315
- this._trackPlayers.set(e.id, new mt(e)), this._textTracks.set(e.id, e);
1316
- else if (qt(e)) {
1391
+ if ($t(e))
1392
+ this._trackPlayers.set(e.id, new _t(e)), this._textTracks.set(e.id, e);
1393
+ else if (re(e)) {
1317
1394
  const n = {
1318
1395
  id: e.id,
1319
1396
  target: e.target,
@@ -1324,9 +1401,9 @@ class vn {
1324
1401
  targets: e.targets,
1325
1402
  stagger: e.stagger
1326
1403
  };
1327
- this._trackPlayers.set(e.id, new mt(n)), this._motionPathTracks.set(e.id, e);
1404
+ this._trackPlayers.set(e.id, new _t(n)), this._motionPathTracks.set(e.id, e);
1328
1405
  } else
1329
- this._trackPlayers.set(e.id, new mt(e));
1406
+ this._trackPlayers.set(e.id, new _t(e));
1330
1407
  }
1331
1408
  /**
1332
1409
  * Replace a track with a new version, keeping its place in the track order
@@ -1334,13 +1411,13 @@ class vn {
1334
1411
  * different id. Does nothing if no track has `trackId`.
1335
1412
  */
1336
1413
  replaceTrack(e, n) {
1337
- const r = this._tracks.findIndex((i) => i.id === e);
1414
+ const r = this._tracks.findIndex((o) => o.id === e);
1338
1415
  if (r < 0) return;
1339
1416
  const s = this._tracks.slice(r + 1);
1340
1417
  this.removeTrack(e);
1341
- for (const i of s) this.removeTrack(i.id);
1418
+ for (const o of s) this.removeTrack(o.id);
1342
1419
  this.addTrack(n);
1343
- for (const i of s) this.addTrack(i);
1420
+ for (const o of s) this.addTrack(o);
1344
1421
  }
1345
1422
  /**
1346
1423
  * Remove a track by its ID.
@@ -1377,11 +1454,11 @@ class vn {
1377
1454
  const n = this._trackPlayers.get(e);
1378
1455
  if (!n) return;
1379
1456
  const r = n.getTrack(), s = r.delay ?? 0;
1380
- if (H(r) || V(r))
1457
+ if (j(r) || V(r))
1381
1458
  return { from: s, to: n.getDuration() };
1382
- const i = r.keyframes;
1383
- if (!(!i || i.length === 0))
1384
- return { from: i[0].time + s, to: n.getDuration() };
1459
+ const o = r.keyframes;
1460
+ if (!(!o || o.length === 0))
1461
+ return { from: o[0].time + s, to: n.getDuration() };
1385
1462
  }
1386
1463
  /**
1387
1464
  * Overlapping writes to the same target+property.
@@ -1396,20 +1473,20 @@ class vn {
1396
1473
  for (let n = 0; n < this._tracks.length; n++) {
1397
1474
  const r = this._tracks[n], s = this.getTrackSpan(r.id);
1398
1475
  if (s)
1399
- for (let i = 0; i < n; i++) {
1400
- const a = this._tracks[i];
1401
- if (a.property !== r.property) continue;
1402
- const o = U(a).filter((h) => U(r).includes(h));
1403
- if (o.length === 0) continue;
1404
- const c = this.getTrackSpan(a.id);
1476
+ for (let o = 0; o < n; o++) {
1477
+ const i = this._tracks[o];
1478
+ if (i.property !== r.property) continue;
1479
+ const a = U(i).filter((h) => U(r).includes(h));
1480
+ if (a.length === 0) continue;
1481
+ const c = this.getTrackSpan(i.id);
1405
1482
  if (!c || !(c.from <= s.to && s.from <= c.to)) continue;
1406
1483
  const l = s.from >= c.from;
1407
- for (const h of o)
1484
+ for (const h of a)
1408
1485
  e.push({
1409
1486
  target: h,
1410
1487
  property: r.property,
1411
- losingTrackId: l ? a.id : r.id,
1412
- winningTrackId: l ? r.id : a.id
1488
+ losingTrackId: l ? i.id : r.id,
1489
+ winningTrackId: l ? r.id : i.id
1413
1490
  });
1414
1491
  }
1415
1492
  }
@@ -1428,7 +1505,7 @@ class vn {
1428
1505
  */
1429
1506
  toDefinition() {
1430
1507
  return {
1431
- formatVersion: it,
1508
+ formatVersion: ne(this._tracks),
1432
1509
  id: this.id,
1433
1510
  name: this.name,
1434
1511
  config: { ...this._config },
@@ -1446,7 +1523,7 @@ class vn {
1446
1523
  }
1447
1524
  /** Replace the markers (kept in time order); an empty list removes them. */
1448
1525
  setMarkers(e) {
1449
- const n = e && e.length > 0 ? [...e].sort((s, i) => s.time - i.time).map((s) => ({ ...s })) : void 0, r = { ...this._config };
1526
+ const n = e && e.length > 0 ? [...e].sort((s, o) => s.time - o.time).map((s) => ({ ...s })) : void 0, r = { ...this._config };
1450
1527
  n ? r.markers = n : delete r.markers, this._config = r;
1451
1528
  }
1452
1529
  /** Caption text per language, per marker id */
@@ -1486,65 +1563,66 @@ class vn {
1486
1563
  return this._config.alternate && (e === -1 || this._loopIteration < e) ? (this._loopIteration++, this._armRepeatDelay(), this._direction = "forward", this._repeatDelayRemaining === 0) : (this._playbackState = "idle", this.onComplete?.(), !1);
1487
1564
  }
1488
1565
  }
1489
- const Sn = 100;
1490
- function nr(t, e, n, r) {
1491
- const s = [], i = [], { duration: a, alternate: o } = r, c = (f, _, d, g) => {
1492
- i.push([f, _]);
1493
- const M = [];
1566
+ const Wn = 100;
1567
+ function zr(t, e, n, r) {
1568
+ const s = [], o = [], { duration: i, alternate: a } = r, c = (p, M, d, g) => {
1569
+ o.push([p, M]);
1570
+ const _ = [];
1494
1571
  t.forEach((b, k) => {
1495
- (d === "forward" ? (g ? b >= f : b > f) && b <= _ : (g ? b <= f : b < f) && b >= _) && M.push(k);
1496
- }), M.sort((b, k) => (d === "forward" ? t[b] - t[k] : t[k] - t[b]) || b - k);
1497
- for (const b of M) s.push({ kind: "event", index: b, direction: d });
1572
+ (d === "forward" ? (g ? b >= p : b > p) && b <= M : (g ? b <= p : b < p) && b >= M) && _.push(k);
1573
+ }), _.sort((b, k) => (d === "forward" ? t[b] - t[k] : t[k] - t[b]) || b - k);
1574
+ for (const b of _) s.push({ kind: "event", index: b, direction: d });
1498
1575
  };
1499
1576
  let u = e.time, l = e.direction, h = e.fresh === !0;
1500
- const p = Math.min(Sn, Math.max(0, n.iteration - e.iteration));
1501
- for (let f = 0; f < p; f++) {
1502
- const _ = l === "forward" ? a : 0;
1503
- c(u, _, l, h), s.push({ kind: "repeat" }), o ? (l = l === "forward" ? "reverse" : "forward", u = _, h = !1) : (u = l === "forward" ? 0 : a, h = !0);
1577
+ const f = Math.min(Wn, Math.max(0, n.iteration - e.iteration));
1578
+ for (let p = 0; p < f; p++) {
1579
+ const M = l === "forward" ? i : 0;
1580
+ c(u, M, l, h), s.push({ kind: "repeat" }), a ? (l = l === "forward" ? "reverse" : "forward", u = M, h = !1) : (u = l === "forward" ? 0 : i, h = !0);
1504
1581
  }
1505
- return p > 0 && r.holding && !o ? { crossings: s, passes: i } : (c(u, n.time, l, h), { crossings: s, passes: i });
1582
+ return f > 0 && r.holding && !a ? { crossings: s, passes: o } : (c(u, n.time, l, h), { crossings: s, passes: o });
1506
1583
  }
1507
- function An(t) {
1584
+ function Qn(t) {
1508
1585
  return V(t) ? {
1509
1586
  id: t.id,
1510
1587
  target: t.target,
1511
1588
  property: t.property,
1512
1589
  kind: "inertia",
1513
- inertia: ce(t.inertia),
1590
+ inertia: xe(t.inertia),
1514
1591
  ...F(t)
1515
- } : H(t) ? {
1592
+ } : j(t) ? {
1516
1593
  id: t.id,
1517
1594
  target: t.target,
1518
1595
  property: t.property,
1519
1596
  kind: "spring",
1520
1597
  spring: { ...t.spring },
1521
1598
  ...F(t)
1522
- } : kt(t) ? {
1599
+ } : $t(t) ? {
1523
1600
  id: t.id,
1524
1601
  target: t.target,
1525
1602
  property: "text",
1526
1603
  textConfig: { ...t.textConfig },
1527
- keyframes: t.keyframes.map(_t),
1604
+ keyframes: t.keyframes.map(Tt),
1528
1605
  ...F(t)
1529
- } : qt(t) ? {
1606
+ } : re(t) ? {
1530
1607
  id: t.id,
1531
1608
  target: t.target,
1532
1609
  property: "motionPath",
1533
1610
  motionPathConfig: { ...t.motionPathConfig },
1534
- keyframes: t.keyframes.map(_t),
1611
+ keyframes: t.keyframes.map(Tt),
1535
1612
  ...F(t)
1536
1613
  } : {
1537
1614
  id: t.id,
1538
1615
  target: t.target,
1539
1616
  property: t.property,
1540
- keyframes: t.keyframes.map(_t),
1617
+ keyframes: t.keyframes.map(Tt),
1618
+ ...t.interpolation !== void 0 && { interpolation: t.interpolation },
1541
1619
  ...F(t)
1542
1620
  };
1543
1621
  }
1544
- function ce(t) {
1622
+ function xe(t) {
1545
1623
  return { ...t, ...Array.isArray(t.end) && { end: [...t.end] } };
1546
1624
  }
1547
- function _t(t) {
1625
+ function Tt(t) {
1548
1626
  return {
1549
1627
  time: t.time,
1550
1628
  value: t.value,
@@ -1560,7 +1638,7 @@ function F(t) {
1560
1638
  ...t.stagger !== void 0 && { stagger: { ...t.stagger } }
1561
1639
  };
1562
1640
  }
1563
- function wn(t) {
1641
+ function Gn(t) {
1564
1642
  if (V(t)) {
1565
1643
  const e = t;
1566
1644
  return {
@@ -1568,11 +1646,11 @@ function wn(t) {
1568
1646
  target: e.target,
1569
1647
  property: e.property,
1570
1648
  kind: "inertia",
1571
- inertia: ce(e.inertia),
1649
+ inertia: xe(e.inertia),
1572
1650
  ...F(e)
1573
1651
  };
1574
1652
  }
1575
- if (H(t)) {
1653
+ if (j(t)) {
1576
1654
  const e = t;
1577
1655
  return {
1578
1656
  id: e.id,
@@ -1583,7 +1661,7 @@ function wn(t) {
1583
1661
  ...F(e)
1584
1662
  };
1585
1663
  }
1586
- if (kt(t)) {
1664
+ if ($t(t)) {
1587
1665
  const e = t;
1588
1666
  return {
1589
1667
  id: e.id,
@@ -1605,18 +1683,19 @@ function wn(t) {
1605
1683
  ...F(e)
1606
1684
  };
1607
1685
  }
1608
- return yn({
1686
+ return Xn({
1609
1687
  id: t.id,
1610
1688
  target: t.target,
1611
1689
  property: t.property,
1612
1690
  keyframes: t.keyframes,
1691
+ ...t.interpolation !== void 0 && { interpolation: t.interpolation },
1613
1692
  ...F(t)
1614
1693
  });
1615
1694
  }
1616
- function Pn(t) {
1695
+ function Kn(t) {
1617
1696
  const e = t._config.markers;
1618
1697
  return {
1619
- formatVersion: it,
1698
+ formatVersion: ne(t.tracks),
1620
1699
  id: t.id,
1621
1700
  name: t.name,
1622
1701
  config: {
@@ -1627,38 +1706,38 @@ function Pn(t) {
1627
1706
  repeatDelay: t._config.repeatDelay,
1628
1707
  ...e && { markers: e.map((n) => ({ ...n })) }
1629
1708
  },
1630
- tracks: t.tracks.map(An),
1709
+ tracks: t.tracks.map(Qn),
1631
1710
  ...t.captions && { captions: JSON.parse(JSON.stringify(t.captions)) }
1632
1711
  };
1633
1712
  }
1634
- function $n(t) {
1713
+ function Zn(t) {
1635
1714
  const e = t.formatVersion ?? 1;
1636
- if (e > it)
1715
+ if (e > Xt)
1637
1716
  throw new Error(
1638
- `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${it}. Update tinyfly to play it.`
1717
+ `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Xt}. Update tinyfly to play it.`
1639
1718
  );
1640
- return new vn({
1719
+ return new Bn({
1641
1720
  id: t.id,
1642
1721
  name: t.name,
1643
1722
  config: t.config,
1644
- tracks: t.tracks.map(wn),
1723
+ tracks: t.tracks.map(Gn),
1645
1724
  captions: t.captions
1646
1725
  });
1647
1726
  }
1648
- function rr(t) {
1649
- return JSON.stringify(Pn(t));
1727
+ function Yr(t) {
1728
+ return JSON.stringify(Kn(t));
1650
1729
  }
1651
- function sr(t) {
1730
+ function Ur(t) {
1652
1731
  const e = JSON.parse(t);
1653
- return $n(e);
1732
+ return Zn(e);
1654
1733
  }
1655
- function ir(t) {
1734
+ function Vr(t) {
1656
1735
  let e = 2166136261;
1657
1736
  for (let n = 0; n < t.length; n++)
1658
1737
  e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
1659
1738
  return e >>> 0;
1660
1739
  }
1661
- function Rn(t) {
1740
+ function qn(t) {
1662
1741
  let e = t >>> 0 || 2654435769;
1663
1742
  return {
1664
1743
  seed: t >>> 0,
@@ -1667,433 +1746,600 @@ function Rn(t) {
1667
1746
  }
1668
1747
  };
1669
1748
  }
1670
- function ue(t, e, n) {
1749
+ function ke(t, e, n) {
1671
1750
  return e + t.next() * (n - e);
1672
1751
  }
1673
- function Dn(t, e, n, r) {
1674
- if (r <= 0) return ue(t, e, n);
1675
- const s = Math.floor((n - e) / r), i = Math.round(t.next() * s);
1676
- return e + i * r;
1752
+ function Jn(t, e, n, r) {
1753
+ if (r <= 0) return ke(t, e, n);
1754
+ const s = Math.floor((n - e) / r), o = Math.round(t.next() * s);
1755
+ return e + o * r;
1677
1756
  }
1678
- function ar(t, e) {
1757
+ function jr(t, e) {
1679
1758
  if (e.length !== 0)
1680
1759
  return e[Math.floor(t.next() * e.length)];
1681
1760
  }
1682
- const le = /^([+\-*/])=\s*(-?[\d.]+)$/, he = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1683
- function or(t) {
1684
- return typeof t != "string" ? !1 : le.test(t.trim()) || he.test(t.trim());
1761
+ const Se = /^([+\-*/])=\s*(-?[\d.]+)$/, Ae = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1762
+ function Hr(t) {
1763
+ return typeof t != "string" ? !1 : Se.test(t.trim()) || Ae.test(t.trim());
1685
1764
  }
1686
- function fe(t, e = {}) {
1765
+ function we(t, e = {}) {
1687
1766
  if (typeof t != "string") return t;
1688
- const n = t.trim(), r = le.exec(n);
1767
+ const n = t.trim(), r = Se.exec(n);
1689
1768
  if (r) {
1690
- const [, i, a] = r, o = e.base ?? 0, c = Number.parseFloat(a);
1691
- switch (i) {
1769
+ const [, o, i] = r, a = e.base ?? 0, c = Number.parseFloat(i);
1770
+ switch (o) {
1692
1771
  case "+":
1693
- return o + c;
1772
+ return a + c;
1694
1773
  case "-":
1695
- return o - c;
1774
+ return a - c;
1696
1775
  case "*":
1697
- return o * c;
1776
+ return a * c;
1698
1777
  case "/":
1699
- return c === 0 ? o : o / c;
1778
+ return c === 0 ? a : a / c;
1700
1779
  }
1701
1780
  }
1702
- const s = he.exec(n);
1781
+ const s = Ae.exec(n);
1703
1782
  if (s) {
1704
1783
  if (!e.random)
1705
1784
  throw new Error(
1706
1785
  `resolveValue: "${n}" needs a random source — pass one via context.random`
1707
1786
  );
1708
- const i = Number.parseFloat(s[1]), a = Number.parseFloat(s[2]), o = s[3] !== void 0 ? Number.parseFloat(s[3]) : void 0;
1709
- return o !== void 0 ? Dn(e.random, i, a, o) : ue(e.random, i, a);
1787
+ const o = Number.parseFloat(s[1]), i = Number.parseFloat(s[2]), a = s[3] !== void 0 ? Number.parseFloat(s[3]) : void 0;
1788
+ return a !== void 0 ? Jn(e.random, o, i, a) : ke(e.random, o, i);
1710
1789
  }
1711
1790
  return t;
1712
1791
  }
1713
- function Cn(t, e = 0, n) {
1792
+ function tr(t, e = 0, n) {
1714
1793
  const r = [];
1715
1794
  let s = e;
1716
- for (const i of t) {
1717
- const a = fe(i, { base: s, random: n });
1718
- r.push(a), typeof a == "number" && (s = a);
1795
+ for (const o of t) {
1796
+ const i = we(o, { base: s, random: n });
1797
+ r.push(i), typeof i == "number" && (s = i);
1719
1798
  }
1720
1799
  return r;
1721
1800
  }
1722
- class cr {
1801
+ class Br {
1723
1802
  random;
1724
1803
  constructor(e) {
1725
- this.random = Rn(e);
1804
+ this.random = qn(e);
1726
1805
  }
1727
1806
  /** The seed, to be stored alongside the timeline so this can be reproduced. */
1728
1807
  get seed() {
1729
1808
  return this.random.seed;
1730
1809
  }
1731
1810
  resolve(e, n = 0) {
1732
- return fe(e, { base: n, random: this.random });
1811
+ return we(e, { base: n, random: this.random });
1733
1812
  }
1734
1813
  resolveSequence(e, n = 0) {
1735
- return Cn(e, n, this.random);
1814
+ return tr(e, n, this.random);
1736
1815
  }
1737
1816
  }
1738
- const In = 600;
1739
- function ur(t) {
1817
+ const er = 600;
1818
+ function Wr(t) {
1740
1819
  if (Array.isArray(t)) {
1741
- const [p, f, _, d] = t;
1742
- return { fn: Bt(p, f, _, d), bezier: [p, f, _, d] };
1820
+ const [f, p, M, d] = t;
1821
+ return { fn: ee(f, p, M, d), bezier: [f, p, M, d] };
1743
1822
  }
1744
- const { segments: e } = W(t);
1823
+ const { segments: e } = G(t);
1745
1824
  if (e.length === 0) throw new Error(`customEase: no curve in "${t}"`);
1746
- const n = e[0].startX, r = e[0].startY, s = e[e.length - 1], i = s.endX - n, a = s.endY - r;
1747
- if (i === 0 || a === 0) throw new Error(`customEase: "${t}" must move along both axes`);
1748
- const o = (p) => (p - n) / i, c = (p) => (p - r) / a;
1825
+ const n = e[0].startX, r = e[0].startY, s = e[e.length - 1], o = s.endX - n, i = s.endY - r;
1826
+ if (o === 0 || i === 0) throw new Error(`customEase: "${t}" must move along both axes`);
1827
+ const a = (f) => (f - n) / o, c = (f) => (f - r) / i;
1749
1828
  if (e.length === 1 && s.type === "C") {
1750
- const [p, f, _, d] = s.points, g = [o(p), c(f), o(_), c(d)];
1751
- return { fn: Bt(...g), bezier: g };
1752
- }
1753
- const u = [], l = [], h = Math.max(8, Math.ceil(In / e.length));
1754
- for (const p of e)
1755
- for (let f = u.length === 0 ? 0 : 1; f <= h; f++) {
1756
- const [_, d] = En(p, f / h);
1757
- u.push(o(_)), l.push(c(d));
1829
+ const [f, p, M, d] = s.points, g = [a(f), c(p), a(M), c(d)];
1830
+ return { fn: ee(...g), bezier: g };
1831
+ }
1832
+ const u = [], l = [], h = Math.max(8, Math.ceil(er / e.length));
1833
+ for (const f of e)
1834
+ for (let p = u.length === 0 ? 0 : 1; p <= h; p++) {
1835
+ const [M, d] = nr(f, p / h);
1836
+ u.push(a(M)), l.push(c(d));
1758
1837
  }
1759
- return { fn: Ln(u, l) };
1838
+ return { fn: rr(u, l) };
1760
1839
  }
1761
- function lr(t = {}) {
1840
+ function Qr(t = {}) {
1762
1841
  const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, r = [1];
1763
- for (let i = n; i > 2e-3; i *= n) r.push(2 * Math.sqrt(i));
1764
- const s = r.reduce((i, a) => i + a, 0);
1765
- return (i) => {
1766
- if (i <= 0) return 0;
1767
- if (i >= 1) return 1;
1768
- let a = i * s;
1769
- for (let o = 0; o < r.length; o++) {
1770
- if (a <= r[o]) {
1771
- if (o === 0) return (a / r[0]) ** 2;
1772
- const c = r[o] / 2, u = c * c, l = a - c;
1842
+ for (let o = n; o > 2e-3; o *= n) r.push(2 * Math.sqrt(o));
1843
+ const s = r.reduce((o, i) => o + i, 0);
1844
+ return (o) => {
1845
+ if (o <= 0) return 0;
1846
+ if (o >= 1) return 1;
1847
+ let i = o * s;
1848
+ for (let a = 0; a < r.length; a++) {
1849
+ if (i <= r[a]) {
1850
+ if (a === 0) return (i / r[0]) ** 2;
1851
+ const c = r[a] / 2, u = c * c, l = i - c;
1773
1852
  return 1 - (u - l * l);
1774
1853
  }
1775
- a -= r[o];
1854
+ i -= r[a];
1776
1855
  }
1777
1856
  return 1;
1778
1857
  };
1779
1858
  }
1780
- function hr(t = {}) {
1859
+ function Gr(t = {}) {
1781
1860
  const e = Math.max(1, t.wiggles ?? 10), n = t.type ?? "easeOut", r = (s) => n === "uniform" ? 1 : n === "easeInOut" ? Math.sin(Math.PI * s) : (1 - s) ** 2;
1782
1861
  return (s) => s <= 0 || s >= 1 ? 0 : Math.sin(s * e * Math.PI * 2) * r(s);
1783
1862
  }
1784
- function En(t, e) {
1863
+ function nr(t, e) {
1785
1864
  if (t.type === "L") {
1786
1865
  const [u, l] = t.points;
1787
1866
  return [t.startX + (u - t.startX) * e, t.startY + (l - t.startY) * e];
1788
1867
  }
1789
- const [n, r, s, i, a, o] = t.points, c = 1 - e;
1868
+ const [n, r, s, o, i, a] = t.points, c = 1 - e;
1790
1869
  return [
1791
- c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * s + e * e * e * a,
1792
- c * c * c * t.startY + 3 * c * c * e * r + 3 * c * e * e * i + e * e * e * o
1870
+ c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * s + e * e * e * i,
1871
+ c * c * c * t.startY + 3 * c * c * e * r + 3 * c * e * e * o + e * e * e * a
1793
1872
  ];
1794
1873
  }
1795
- function Ln(t, e) {
1874
+ function rr(t, e) {
1796
1875
  return (n) => {
1797
1876
  if (n <= t[0]) return e[0];
1798
1877
  if (n >= t[t.length - 1]) return e[e.length - 1];
1799
1878
  let r = 0, s = t.length - 1;
1800
1879
  for (; s - r > 1; ) {
1801
- const a = r + s >> 1;
1802
- t[a] <= n ? r = a : s = a;
1880
+ const i = r + s >> 1;
1881
+ t[i] <= n ? r = i : s = i;
1803
1882
  }
1804
- const i = t[s] - t[r];
1805
- return i === 0 ? e[s] : e[r] + (n - t[r]) / i * (e[s] - e[r]);
1883
+ const o = t[s] - t[r];
1884
+ return o === 0 ? e[s] : e[r] + (n - t[r]) / o * (e[s] - e[r]);
1806
1885
  };
1807
1886
  }
1808
- function Bt(t, e, n, r) {
1809
- const s = (a, o, c) => 3 * (1 - a) * (1 - a) * a * o + 3 * (1 - a) * a * a * c + a * a * a, i = (a, o, c) => 3 * (1 - a) * (1 - a) * o + 6 * (1 - a) * a * (c - o) + 3 * a * a * (1 - c);
1810
- return (a) => {
1811
- if (a <= 0) return 0;
1812
- if (a >= 1) return 1;
1813
- let o = a;
1887
+ function ee(t, e, n, r) {
1888
+ const s = (i, a, c) => 3 * (1 - i) * (1 - i) * i * a + 3 * (1 - i) * i * i * c + i * i * i, o = (i, a, c) => 3 * (1 - i) * (1 - i) * a + 6 * (1 - i) * i * (c - a) + 3 * i * i * (1 - c);
1889
+ return (i) => {
1890
+ if (i <= 0) return 0;
1891
+ if (i >= 1) return 1;
1892
+ let a = i;
1814
1893
  for (let l = 0; l < 8; l++) {
1815
- const h = s(o, t, n) - a, p = i(o, t, n);
1816
- if (Math.abs(h) < 1e-6) return s(o, e, r);
1817
- if (Math.abs(p) < 1e-6) break;
1818
- o -= h / p;
1894
+ const h = s(a, t, n) - i, f = o(a, t, n);
1895
+ if (Math.abs(h) < 1e-6) return s(a, e, r);
1896
+ if (Math.abs(f) < 1e-6) break;
1897
+ a -= h / f;
1819
1898
  }
1820
1899
  let c = 0, u = 1;
1821
- o = a;
1900
+ a = i;
1822
1901
  for (let l = 0; l < 40; l++)
1823
- s(o, t, n) < a ? c = o : u = o, o = (c + u) / 2;
1824
- return s(o, e, r);
1902
+ s(a, t, n) < i ? c = a : u = a, a = (c + u) / 2;
1903
+ return s(a, e, r);
1825
1904
  };
1826
1905
  }
1827
- const Fn = 350, On = 300, Nn = 550;
1828
- function fr(t, e = {}) {
1829
- const n = e.lead ?? Fn, r = e.gap ?? On, s = e.tail ?? Nn, i = [];
1830
- let a = 0;
1831
- return t.forEach((o, c) => {
1906
+ const sr = 350, or = 300, ir = 550;
1907
+ function Kr(t, e = {}) {
1908
+ const n = e.lead ?? sr, r = e.gap ?? or, s = e.tail ?? ir, o = [];
1909
+ let i = 0;
1910
+ return t.forEach((a, c) => {
1832
1911
  const u = [];
1833
- let l = a + n;
1834
- o.lines.forEach((p, f) => {
1835
- if (!(p.duration >= 0))
1836
- throw new Error(`narration: scene ${c} line ${f} has an invalid duration (${p.duration})`);
1837
- f > 0 && (l += r), u.push({
1838
- id: p.id ?? `s${c}-l${f}`,
1912
+ let l = i + n;
1913
+ a.lines.forEach((f, p) => {
1914
+ if (!(f.duration >= 0))
1915
+ throw new Error(`narration: scene ${c} line ${p} has an invalid duration (${f.duration})`);
1916
+ p > 0 && (l += r), u.push({
1917
+ id: f.id ?? `s${c}-l${p}`,
1839
1918
  scene: c,
1840
- line: f,
1919
+ line: p,
1841
1920
  start: l,
1842
- end: l + p.duration,
1843
- text: p.text
1844
- }), l += p.duration;
1921
+ end: l + f.duration,
1922
+ text: f.text
1923
+ }), l += f.duration;
1845
1924
  });
1846
- const h = l + s + (o.tail ?? 0);
1847
- i.push({ id: o.id ?? `s${c}`, start: a, duration: h - a, cues: u }), a = h;
1848
- }), { duration: a, scenes: i, cues: i.flatMap((o) => o.cues) };
1925
+ const h = l + s + (a.tail ?? 0);
1926
+ o.push({ id: a.id ?? `s${c}`, start: i, duration: h - i, cues: u }), i = h;
1927
+ }), { duration: i, scenes: o, cues: o.flatMap((a) => a.cues) };
1849
1928
  }
1850
- function pr(t) {
1929
+ function Zr(t) {
1851
1930
  return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
1852
1931
  }
1853
- function dr(t, e) {
1932
+ function qr(t, e) {
1854
1933
  let n = t.scenes[0];
1855
1934
  for (const r of t.scenes)
1856
1935
  if (e >= r.start) n = r;
1857
1936
  else break;
1858
1937
  return n;
1859
1938
  }
1860
- const pe = (t) => 6e4 / t.bpm;
1861
- function St(t, e) {
1862
- return t.offset + e * pe(t);
1939
+ const ve = (t) => 6e4 / t.bpm;
1940
+ function Ct(t, e) {
1941
+ return t.offset + e * ve(t);
1863
1942
  }
1864
- function At(t, e) {
1865
- return (e - t.offset) / pe(t);
1943
+ function It(t, e) {
1944
+ return (e - t.offset) / ve(t);
1866
1945
  }
1867
- function gr(t, e) {
1868
- return St(t, Math.round(At(t, e)));
1946
+ function Jr(t, e) {
1947
+ return Ct(t, Math.round(It(t, e)));
1869
1948
  }
1870
- function mr(t, e) {
1871
- return St(t, Math.ceil(At(t, e) - 1e-9));
1949
+ function ts(t, e) {
1950
+ return Ct(t, Math.ceil(It(t, e) - 1e-9));
1872
1951
  }
1873
- function yr(t, e, n) {
1952
+ function es(t, e, n) {
1874
1953
  const r = Math.max(1, Math.round(t.beatsPerBar ?? 4)), s = [];
1875
1954
  if (!(t.bpm > 0) || n < e) return s;
1876
- for (let i = Math.ceil(At(t, e) - 1e-9); ; i++) {
1877
- const a = St(t, i);
1878
- if (a > n + 1e-9) break;
1879
- s.push({ time: a, bar: (i % r + r) % r === 0, n: i });
1955
+ for (let o = Math.ceil(It(t, e) - 1e-9); ; o++) {
1956
+ const i = Ct(t, o);
1957
+ if (i > n + 1e-9) break;
1958
+ s.push({ time: i, bar: (o % r + r) % r === 0, n: o });
1880
1959
  }
1881
1960
  return s;
1882
1961
  }
1883
1962
  const B = 100;
1884
- function _r(t, e, n = {}) {
1885
- const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, i = Math.max(1, Math.round(e / B)), a = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), o = Math.floor(a / i);
1886
- if (o < 4) return { bpm: 120, offset: 0, confidence: 0 };
1887
- const c = new Float64Array(o);
1888
- for (let m = 0; m < o; m++) {
1963
+ function ns(t, e, n = {}) {
1964
+ const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), i = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), a = Math.floor(i / o);
1965
+ if (a < 4) return { bpm: 120, offset: 0, confidence: 0 };
1966
+ const c = new Float64Array(a);
1967
+ for (let m = 0; m < a; m++) {
1889
1968
  let T = 0;
1890
- for (let x = m * i; x < (m + 1) * i; x++) T += t[x] * t[x];
1891
- c[m] = Math.log(1e-6 + T / i);
1892
- }
1893
- const u = new Float64Array(o);
1894
- for (let m = 1; m < o; m++) u[m] = Math.max(0, c[m] - c[m - 1]);
1895
- const l = u.reduce((m, T) => m + T, 0) / o;
1896
- for (let m = 0; m < o; m++) u[m] = Math.max(0, u[m] - l);
1897
- const h = Math.max(1, Math.floor(60 * B / s)), p = Math.min(o - 1, Math.ceil(60 * B / r)), f = (m) => {
1969
+ for (let x = m * o; x < (m + 1) * o; x++) T += t[x] * t[x];
1970
+ c[m] = Math.log(1e-6 + T / o);
1971
+ }
1972
+ const u = new Float64Array(a);
1973
+ for (let m = 1; m < a; m++) u[m] = Math.max(0, c[m] - c[m - 1]);
1974
+ const l = u.reduce((m, T) => m + T, 0) / a;
1975
+ for (let m = 0; m < a; m++) u[m] = Math.max(0, u[m] - l);
1976
+ const h = Math.max(1, Math.floor(60 * B / s)), f = Math.min(a - 1, Math.ceil(60 * B / r)), p = (m) => {
1898
1977
  let T = 0;
1899
- for (let x = m; x < o; x++) T += u[x] * u[x - m];
1900
- return T / (o - m);
1978
+ for (let x = m; x < a; x++) T += u[x] * u[x - m];
1979
+ return T / (a - m);
1901
1980
  };
1902
- let _ = 0;
1903
- for (let m = 0; m < o; m++) _ += u[m] * u[m];
1904
- _ /= o;
1981
+ let M = 0;
1982
+ for (let m = 0; m < a; m++) M += u[m] * u[m];
1983
+ M /= a;
1905
1984
  let d = h, g = -1 / 0;
1906
- for (let m = h; m <= p; m++) {
1907
- const T = 60 * B / m, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), v = f(m) * x;
1908
- v > g && (g = v, d = m);
1985
+ for (let m = h; m <= f; m++) {
1986
+ const T = 60 * B / m, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = p(m) * x;
1987
+ S > g && (g = S, d = m);
1909
1988
  }
1910
- const M = (m) => {
1989
+ const _ = (m) => {
1911
1990
  const T = Math.floor(m);
1912
- return T < 0 || T + 1 >= o ? 0 : u[T] + (u[T + 1] - u[T]) * (m - T);
1991
+ return T < 0 || T + 1 >= a ? 0 : u[T] + (u[T + 1] - u[T]) * (m - T);
1913
1992
  }, b = (m, T) => {
1914
1993
  let x = 0;
1915
- for (let v = T; v < o; v += m) x += M(v);
1994
+ for (let S = T; S < a; S += m) x += _(S);
1916
1995
  return x;
1917
1996
  };
1918
- let k = d, A = 0, y = -1 / 0;
1997
+ let k = d, w = 0, y = -1 / 0;
1919
1998
  for (let m = d - 0.6; m <= d + 0.6 + 1e-9; m += 0.02) {
1920
1999
  if (m < 1) continue;
1921
2000
  const T = Math.max(1, Math.round(m * 4));
1922
2001
  for (let x = 0; x < T; x++) {
1923
- const v = x / T * m, $ = b(m, v);
1924
- $ > y && (y = $, A = v, k = m);
2002
+ const S = x / T * m, $ = b(m, S);
2003
+ $ > y && (y = $, w = S, k = m);
1925
2004
  }
1926
2005
  }
1927
- const w = 60 * B / k, S = _ > 0 ? Math.max(0, Math.min(1, f(d) / _)) : 0, I = (A + 0.5) * 1e3 / B;
1928
- return { bpm: Math.round(w * 100) / 100, offset: Math.round(I % (6e4 / w)), confidence: S };
2006
+ const v = 60 * B / k, A = M > 0 ? Math.max(0, Math.min(1, p(d) / M)) : 0, D = (w + 0.5) * 1e3 / B;
2007
+ return { bpm: Math.round(v * 100) / 100, offset: Math.round(D % (6e4 / v)), confidence: A };
1929
2008
  }
1930
- const L = (t) => Math.round(t * 1e3) / 1e3;
1931
- function Mr(t, e = {}) {
2009
+ const O = (t) => Math.round(t * 1e3) / 1e3;
2010
+ function rs(t, e = {}) {
1932
2011
  if (t.length === 0) return "";
1933
2012
  const n = e.curviness ?? 1, r = e.closed ?? !1, s = t.length;
1934
- let i = `M${L(t[0].x)} ${L(t[0].y)}`;
1935
- if (s === 1) return i;
1936
- const a = (c) => r ? t[(c % s + s) % s] : t[Math.max(0, Math.min(s - 1, c))], o = r ? s : s - 1;
1937
- for (let c = 0; c < o; c++) {
1938
- const u = a(c - 1), l = a(c), h = a(c + 1), p = a(c + 2);
2013
+ let o = `M${O(t[0].x)} ${O(t[0].y)}`;
2014
+ if (s === 1) return o;
2015
+ const i = (c) => r ? t[(c % s + s) % s] : t[Math.max(0, Math.min(s - 1, c))], a = r ? s : s - 1;
2016
+ for (let c = 0; c < a; c++) {
2017
+ const u = i(c - 1), l = i(c), h = i(c + 1), f = i(c + 2);
1939
2018
  if (n === 0) {
1940
- i += ` L${L(h.x)} ${L(h.y)}`;
2019
+ o += ` L${O(h.x)} ${O(h.y)}`;
1941
2020
  continue;
1942
2021
  }
1943
- const f = n / 6, _ = l.x + (h.x - u.x) * f, d = l.y + (h.y - u.y) * f, g = h.x - (p.x - l.x) * f, M = h.y - (p.y - l.y) * f;
1944
- i += ` C${L(_)} ${L(d)} ${L(g)} ${L(M)} ${L(h.x)} ${L(h.y)}`;
2022
+ const p = n / 6, M = l.x + (h.x - u.x) * p, d = l.y + (h.y - u.y) * p, g = h.x - (f.x - l.x) * p, _ = h.y - (f.y - l.y) * p;
2023
+ o += ` C${O(M)} ${O(d)} ${O(g)} ${O(_)} ${O(h.x)} ${O(h.y)}`;
1945
2024
  }
1946
- return r ? `${i} Z` : i;
2025
+ return r ? `${o} Z` : o;
1947
2026
  }
1948
- const R = (t, e = 0) => {
2027
+ const C = (t, e = 0) => {
1949
2028
  const n = parseFloat(t ?? "");
1950
2029
  return Number.isFinite(n) ? n : e;
1951
2030
  };
1952
- function Xn(t) {
2031
+ function ar(t) {
1953
2032
  const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
1954
2033
  for (let r = 0; r + 1 < e.length; r += 2) n.push({ x: e[r], y: e[r + 1] });
1955
2034
  return n;
1956
2035
  }
1957
- function br(t) {
2036
+ function ss(t) {
1958
2037
  const e = t.attributes;
1959
2038
  switch (t.tag.toLowerCase()) {
1960
2039
  case "path":
1961
2040
  return e.d ?? null;
1962
2041
  case "circle":
1963
2042
  case "ellipse": {
1964
- const n = R(e.cx), r = R(e.cy), s = t.tag.toLowerCase() === "circle" ? R(e.r) : R(e.rx), i = t.tag.toLowerCase() === "circle" ? R(e.r) : R(e.ry);
1965
- return `M${n + s} ${r} A${s} ${i} 0 1 1 ${n - s} ${r} A${s} ${i} 0 1 1 ${n + s} ${r} Z`;
2043
+ const n = C(e.cx), r = C(e.cy), s = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.rx), o = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.ry);
2044
+ return `M${n + s} ${r} A${s} ${o} 0 1 1 ${n - s} ${r} A${s} ${o} 0 1 1 ${n + s} ${r} Z`;
1966
2045
  }
1967
2046
  case "rect": {
1968
- const n = R(e.x), r = R(e.y), s = R(e.width), i = R(e.height);
1969
- let a = e.rx != null ? R(e.rx) : e.ry != null ? R(e.ry) : 0, o = e.ry != null ? R(e.ry) : a;
1970
- return a = Math.min(a, s / 2), o = Math.min(o, i / 2), a === 0 || o === 0 ? `M${n} ${r} H${n + s} V${r + i} H${n} Z` : `M${n + a} ${r} H${n + s - a} A${a} ${o} 0 0 1 ${n + s} ${r + o} V${r + i - o} A${a} ${o} 0 0 1 ${n + s - a} ${r + i} H${n + a} A${a} ${o} 0 0 1 ${n} ${r + i - o} V${r + o} A${a} ${o} 0 0 1 ${n + a} ${r} Z`;
2047
+ const n = C(e.x), r = C(e.y), s = C(e.width), o = C(e.height);
2048
+ let i = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, a = e.ry != null ? C(e.ry) : i;
2049
+ return i = Math.min(i, s / 2), a = Math.min(a, o / 2), i === 0 || a === 0 ? `M${n} ${r} H${n + s} V${r + o} H${n} Z` : `M${n + i} ${r} H${n + s - i} A${i} ${a} 0 0 1 ${n + s} ${r + a} V${r + o - a} A${i} ${a} 0 0 1 ${n + s - i} ${r + o} H${n + i} A${i} ${a} 0 0 1 ${n} ${r + o - a} V${r + a} A${i} ${a} 0 0 1 ${n + i} ${r} Z`;
1971
2050
  }
1972
2051
  case "line":
1973
- return `M${R(e.x1)} ${R(e.y1)} L${R(e.x2)} ${R(e.y2)}`;
2052
+ return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
1974
2053
  case "polyline":
1975
2054
  case "polygon": {
1976
- const n = Xn(e.points);
2055
+ const n = ar(e.points);
1977
2056
  if (n.length === 0) return null;
1978
- const r = n.map((s, i) => `${i === 0 ? "M" : "L"}${s.x} ${s.y}`).join(" ");
2057
+ const r = n.map((s, o) => `${o === 0 ? "M" : "L"}${s.x} ${s.y}`).join(" ");
1979
2058
  return t.tag.toLowerCase() === "polygon" ? `${r} Z` : r;
1980
2059
  }
1981
2060
  default:
1982
2061
  return null;
1983
2062
  }
1984
2063
  }
2064
+ function cr(t, e) {
2065
+ return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
2066
+ }
2067
+ function Et(t, e) {
2068
+ return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
2069
+ }
2070
+ function Pe(t, e) {
2071
+ return [t[0] * e, t[1] * e, t[2] * e];
2072
+ }
2073
+ function ct(t, e) {
2074
+ return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
2075
+ }
2076
+ function vt(t, e) {
2077
+ return [t[1] * e[2] - t[2] * e[1], t[2] * e[0] - t[0] * e[2], t[0] * e[1] - t[1] * e[0]];
2078
+ }
2079
+ function Lt(t) {
2080
+ return Math.hypot(t[0], t[1], t[2]);
2081
+ }
2082
+ function ur(t, e) {
2083
+ return Lt(Et(t, e));
2084
+ }
2085
+ function Pt(t) {
2086
+ const e = Lt(t);
2087
+ return e === 0 ? [0, 0, 0] : Pe(t, 1 / e);
2088
+ }
2089
+ function lr(t, e, n) {
2090
+ return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
2091
+ }
2092
+ const os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2093
+ __proto__: null,
2094
+ add: cr,
2095
+ cross: vt,
2096
+ distance: ur,
2097
+ dot: ct,
2098
+ length: Lt,
2099
+ lerp: lr,
2100
+ normalize: Pt,
2101
+ scale: Pe,
2102
+ subtract: Et
2103
+ }, Symbol.toStringTag, { value: "Module" })), hr = Math.PI / 180;
2104
+ function fr() {
2105
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
2106
+ }
2107
+ function pr(t, e) {
2108
+ const n = new Array(16);
2109
+ for (let r = 0; r < 4; r++)
2110
+ for (let s = 0; s < 4; s++) {
2111
+ let o = 0;
2112
+ for (let i = 0; i < 4; i++) o += t[i * 4 + s] * e[r * 4 + i];
2113
+ n[r * 4 + s] = o;
2114
+ }
2115
+ return n;
2116
+ }
2117
+ function dr(t) {
2118
+ return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
2119
+ }
2120
+ function gr(t) {
2121
+ return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
2122
+ }
2123
+ function $e(t) {
2124
+ const [e, n, r, s] = t;
2125
+ return [
2126
+ 1 - 2 * (n * n + r * r),
2127
+ 2 * (e * n + r * s),
2128
+ 2 * (e * r - n * s),
2129
+ 0,
2130
+ 2 * (e * n - r * s),
2131
+ 1 - 2 * (e * e + r * r),
2132
+ 2 * (n * r + e * s),
2133
+ 0,
2134
+ 2 * (e * r + n * s),
2135
+ 2 * (n * r - e * s),
2136
+ 1 - 2 * (e * e + n * n),
2137
+ 0,
2138
+ 0,
2139
+ 0,
2140
+ 0,
2141
+ 1
2142
+ ];
2143
+ }
2144
+ function mr(t, e, n) {
2145
+ const r = $e(e);
2146
+ for (let s = 0; s < 3; s++)
2147
+ r[s] *= n[0], r[4 + s] *= n[1], r[8 + s] *= n[2];
2148
+ return r[12] = t[0], r[13] = t[1], r[14] = t[2], r;
2149
+ }
2150
+ function yr(t) {
2151
+ const e = new Array(16);
2152
+ for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) e[r * 4 + n] = t[n * 4 + r];
2153
+ return e;
2154
+ }
2155
+ function Mr(t) {
2156
+ const [e, n, r, s, o, i, a, c, u, l, h, f, p, M, d, g] = t, _ = e * i - n * o, b = e * a - r * o, k = e * c - s * o, w = n * a - r * i, y = n * c - s * i, v = r * c - s * a, A = u * M - l * p, D = u * d - h * p, m = u * g - f * p, T = l * d - h * M, x = l * g - f * M, S = h * g - f * d, $ = _ * S - b * x + k * T + w * m - y * D + v * A;
2157
+ if (Math.abs($) < 1e-12) return null;
2158
+ const P = 1 / $;
2159
+ return [
2160
+ (i * S - a * x + c * T) * P,
2161
+ (r * x - n * S - s * T) * P,
2162
+ (M * v - d * y + g * w) * P,
2163
+ (h * y - l * v - f * w) * P,
2164
+ (a * m - o * S - c * D) * P,
2165
+ (e * S - r * m + s * D) * P,
2166
+ (d * k - p * v - g * b) * P,
2167
+ (u * v - h * k + f * b) * P,
2168
+ (o * x - i * m + c * A) * P,
2169
+ (n * m - e * x - s * A) * P,
2170
+ (p * y - M * k + g * _) * P,
2171
+ (l * k - u * y - f * _) * P,
2172
+ (i * D - o * T - a * A) * P,
2173
+ (e * T - n * D + r * A) * P,
2174
+ (M * b - p * w - d * _) * P,
2175
+ (u * w - l * b + h * _) * P
2176
+ ];
2177
+ }
2178
+ function _r(t, e, n, r) {
2179
+ const s = 1 / Math.tan(t * hr / 2), o = 1 / (n - r);
2180
+ return [s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (r + n) * o, -1, 0, 0, 2 * r * n * o, 0];
2181
+ }
2182
+ function br(t, e, n, r, s, o) {
2183
+ const i = 1 / (e - t), a = 1 / (r - n), c = 1 / (o - s);
2184
+ return [2 * i, 0, 0, 0, 0, 2 * a, 0, 0, 0, 0, -2 * c, 0, -(e + t) * i, -(r + n) * a, -(o + s) * c, 1];
2185
+ }
2186
+ function Tr(t, e, n = [0, 1, 0]) {
2187
+ const r = Pt(Et(t, e)), s = Pt(vt(n, r)), o = vt(r, s);
2188
+ return [
2189
+ s[0],
2190
+ o[0],
2191
+ r[0],
2192
+ 0,
2193
+ s[1],
2194
+ o[1],
2195
+ r[1],
2196
+ 0,
2197
+ s[2],
2198
+ o[2],
2199
+ r[2],
2200
+ 0,
2201
+ -ct(s, t),
2202
+ -ct(o, t),
2203
+ -ct(r, t),
2204
+ 1
2205
+ ];
2206
+ }
2207
+ function xr(t, e) {
2208
+ const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], r = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], s = t[2] * e[0] + t[6] * e[1] + t[10] * e[2] + t[14], o = t[3] * e[0] + t[7] * e[1] + t[11] * e[2] + t[15];
2209
+ return o === 1 || o === 0 ? [n, r, s] : [n / o, r / o, s / o];
2210
+ }
2211
+ const is = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2212
+ __proto__: null,
2213
+ compose: mr,
2214
+ fromQuat: $e,
2215
+ identity: fr,
2216
+ invert: Mr,
2217
+ lookAt: Tr,
2218
+ multiply: pr,
2219
+ orthographic: br,
2220
+ perspective: _r,
2221
+ scaling: gr,
2222
+ transformPoint: xr,
2223
+ translation: dr,
2224
+ transpose: yr
2225
+ }, Symbol.toStringTag, { value: "Module" }));
1985
2226
  export {
1986
- Vn as Clock,
1987
- re as DEFAULT_BAKE_INTERVAL_MS,
1988
- Rt as DEFAULT_INERTIA_FRICTION,
1989
- E as DEFAULT_SPRING,
1990
- it as FORMAT_VERSION,
1991
- ve as INERTIA_MAX_DURATION_MS,
1992
- Mn as InertiaTrackPlayer,
1993
- Gn as MORPH_SAMPLES,
1994
- Un as ManualClock,
1995
- Kt as SPRING_MAX_DURATION_MS,
1996
- Hn as SPRING_PRESETS,
1997
- Z as SPRING_STEP_MS,
1998
- at as SpringSampler,
1999
- _n as SpringTrackPlayer,
2000
- vn as Timeline,
2001
- mt as TrackPlayer,
2002
- cr as ValueResolver,
2003
- Oe as backOut,
2004
- dn as bakeEasing,
2005
- ie as bakeInertiaTrack,
2006
- se as bakeSpringTrack,
2007
- At as beatAtTime,
2008
- pe as beatLength,
2009
- St as beatTime,
2010
- yr as beatsBetween,
2011
- Fe as bounceOut,
2012
- Tn as charactersFor,
2013
- Zn as clearMorphCache,
2014
- Kn as clearPathCache,
2015
- Ee as createCubicBezier,
2016
- Rn as createRandom,
2017
- yn as createTrack,
2018
- Wn as criticalDamping,
2019
- lr as customBounce,
2020
- ur as customEase,
2021
- hr as customWiggle,
2022
- $n as deserializeTimeline,
2023
- wn as deserializeTrack,
2024
- _r as detectTempo,
2025
- Re as easeIn,
2026
- Qt as easeInCubic,
2027
- Ce as easeInOut,
2028
- Zt as easeInOutCubic,
2029
- $e as easeInOutQuad,
2030
- we as easeInQuad,
2031
- De as easeOut,
2032
- Gt as easeOutCubic,
2033
- Pe as easeOutQuad,
2034
- Le as elasticOut,
2035
- gn as expandParametricEasings,
2036
- sr as fromJSON,
2037
- Jt as getEasingFunction,
2038
- ne as getInterpolator,
2039
- oe as getMotionPathPoint,
2040
- Qn as getPathLength,
2041
- je as getPointAtProgress,
2042
- Me as hasKeyframes,
2043
- ir as hashSeed,
2044
- ut as inertiaDuration,
2045
- ct as inertiaRest,
2046
- bt as inertiaValueAt,
2047
- jn as inertiaVelocityAt,
2048
- fn as interpolateArray,
2049
- hn as interpolateColor,
2050
- er as interpolateMotionPath,
2051
- O as interpolateNumber,
2052
- pn as interpolatePathString,
2053
- zt as interpolateString,
2054
- _e as isCubicBezierEasing,
2227
+ Ar as Clock,
2228
+ ye as DEFAULT_BAKE_INTERVAL_MS,
2229
+ zt as DEFAULT_INERTIA_FRICTION,
2230
+ L as DEFAULT_SPRING,
2231
+ Xt as FORMAT_VERSION,
2232
+ ze as INERTIA_MAX_DURATION_MS,
2233
+ Yn as InertiaTrackPlayer,
2234
+ Er as MORPH_SAMPLES,
2235
+ Sr as ManualClock,
2236
+ ie as SPRING_MAX_DURATION_MS,
2237
+ wr as SPRING_PRESETS,
2238
+ tt as SPRING_STEP_MS,
2239
+ ut as SpringSampler,
2240
+ zn as SpringTrackPlayer,
2241
+ Bn as Timeline,
2242
+ _t as TrackPlayer,
2243
+ Br as ValueResolver,
2244
+ Je as backOut,
2245
+ On as bakeEasing,
2246
+ _e as bakeInertiaTrack,
2247
+ Me as bakeSpringTrack,
2248
+ It as beatAtTime,
2249
+ ve as beatLength,
2250
+ Ct as beatTime,
2251
+ es as beatsBetween,
2252
+ qe as bounceOut,
2253
+ Vn as charactersFor,
2254
+ Lr as clearMorphCache,
2255
+ Cr as clearPathCache,
2256
+ Ke as createCubicBezier,
2257
+ qn as createRandom,
2258
+ Xn as createTrack,
2259
+ Rr as criticalDamping,
2260
+ Qr as customBounce,
2261
+ Wr as customEase,
2262
+ Gr as customWiggle,
2263
+ Zn as deserializeTimeline,
2264
+ Gn as deserializeTrack,
2265
+ ns as detectTempo,
2266
+ Be as easeIn,
2267
+ ae as easeInCubic,
2268
+ Qe as easeInOut,
2269
+ ue as easeInOutCubic,
2270
+ He as easeInOutQuad,
2271
+ Ve as easeInQuad,
2272
+ We as easeOut,
2273
+ ce as easeOutCubic,
2274
+ je as easeOutQuad,
2275
+ Ze as elasticOut,
2276
+ Fn as expandParametricEasings,
2277
+ ne as formatVersionFor,
2278
+ Ur as fromJSON,
2279
+ le as getEasingFunction,
2280
+ me as getInterpolator,
2281
+ Te as getMotionPathPoint,
2282
+ Ir as getPathLength,
2283
+ hn as getPointAtProgress,
2284
+ Le as hasKeyframes,
2285
+ Vr as hashSeed,
2286
+ ft as inertiaDuration,
2287
+ ht as inertiaRest,
2288
+ kt as inertiaValueAt,
2289
+ Dr as inertiaVelocityAt,
2290
+ In as interpolateArray,
2291
+ Cn as interpolateColor,
2292
+ Xr as interpolateMotionPath,
2293
+ N as interpolateNumber,
2294
+ Ln as interpolatePathString,
2295
+ En as interpolateQuaternion,
2296
+ te as interpolateString,
2297
+ Ee as isCubicBezierEasing,
2055
2298
  V as isInertiaTrack,
2056
- Yn as isMotionPathPoint,
2057
- qt as isMotionPathTrack,
2058
- Mt as isParametricEasing,
2059
- cn as isPathData,
2060
- H as isSpringTrack,
2061
- kt as isTextTrack,
2062
- qn as isUnderdamped,
2063
- or as isUnresolved,
2064
- Tt as linear,
2065
- be as maxStaggerDistance,
2066
- on as morphPath,
2067
- pr as narrationMarkers,
2068
- dr as narrationSceneAt,
2069
- Se as naturalRest,
2070
- gr as nearestBeat,
2071
- mr as nextBeat,
2072
- Xe as parametricEasing,
2073
- W as parsePath,
2074
- fr as planNarration,
2075
- nr as playheadCrossings,
2076
- te as pointAtDistance,
2077
- Mr as pointsToPath,
2078
- ue as randomBetween,
2079
- ar as randomChoice,
2080
- Dn as randomSnapped,
2081
- Cn as resolveSequence,
2082
- fe as resolveValue,
2083
- Pn as serializeTimeline,
2084
- An as serializeTrack,
2085
- br as shapeToPathData,
2086
- mn as simplifyKeyframes,
2087
- Bn as springDuration,
2088
- zn as springValueAt,
2089
- Wt as staggerDistance,
2090
- jt as staggerOffset,
2091
- Te as staggerOffsets,
2092
- vt as staggerSpan,
2093
- Ne as stepsEasing,
2094
- kn as textAt,
2095
- rr as toJSON,
2096
- Jn as toKeyframedTrack,
2097
- tr as toKeyframedTracks,
2098
- U as trackTargets
2299
+ kr as isMotionPathPoint,
2300
+ re as isMotionPathTrack,
2301
+ xt as isParametricEasing,
2302
+ Sn as isPathData,
2303
+ j as isSpringTrack,
2304
+ $t as isTextTrack,
2305
+ $r as isUnderdamped,
2306
+ Hr as isUnresolved,
2307
+ St as linear,
2308
+ is as mat4,
2309
+ Oe as maxStaggerDistance,
2310
+ kn as morphPath,
2311
+ Zr as narrationMarkers,
2312
+ qr as narrationSceneAt,
2313
+ Ye as naturalRest,
2314
+ Jr as nearestBeat,
2315
+ ts as nextBeat,
2316
+ en as parametricEasing,
2317
+ G as parsePath,
2318
+ Kr as planNarration,
2319
+ zr as playheadCrossings,
2320
+ he as pointAtDistance,
2321
+ rs as pointsToPath,
2322
+ Or as quat,
2323
+ ke as randomBetween,
2324
+ jr as randomChoice,
2325
+ Jn as randomSnapped,
2326
+ tr as resolveSequence,
2327
+ we as resolveValue,
2328
+ Kn as serializeTimeline,
2329
+ Qn as serializeTrack,
2330
+ ss as shapeToPathData,
2331
+ Nn as simplifyKeyframes,
2332
+ Pr as springDuration,
2333
+ vr as springValueAt,
2334
+ se as staggerDistance,
2335
+ oe as staggerOffset,
2336
+ Fe as staggerOffsets,
2337
+ Rt as staggerSpan,
2338
+ tn as stepsEasing,
2339
+ Hn as textAt,
2340
+ Yr as toJSON,
2341
+ Fr as toKeyframedTrack,
2342
+ Nr as toKeyframedTracks,
2343
+ U as trackTargets,
2344
+ os as vec3
2099
2345
  };