@algorisys/tinyfly 0.99.0 → 0.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +9 -9
  2. package/bin/tinyfly.mjs +7 -3
  3. package/docs/acting.md +10 -6
  4. package/docs/character-appearance.md +71 -7
  5. package/docs/editor-guide.md +38 -3
  6. package/docs/examples.md +1 -1
  7. package/docs/getting-started.md +1 -1
  8. package/docs/gsap-compat.md +1 -1
  9. package/docs/llm-guide.md +34 -9
  10. package/docs/maps.md +2 -2
  11. package/docs/props.md +61 -1
  12. package/docs/scene-3d.md +23 -4
  13. package/docs/teaching.md +1 -1
  14. package/docs/video-rendering.md +154 -0
  15. package/lib/addons/adapters.js +387 -333
  16. package/lib/addons/characters.js +4795 -3752
  17. package/lib/addons/load-scene-oWNsYYC1.js +372 -0
  18. package/lib/addons/scene-3d-webgl.js +1 -1
  19. package/lib/addons/scene-3d.js +323 -277
  20. package/lib/addons/shading-0lPgnXmD.js +96 -0
  21. package/lib/browser/tinyfly-scene-3d.iife.js +2 -2
  22. package/lib/browser/tinyfly.iife.js +14 -14
  23. package/lib/browser/tinyfly.js +7294 -5893
  24. package/lib/browser/tinyfly.umd.js +14 -14
  25. package/lib/engine/tinyfly-engine.js +1389 -1031
  26. package/lib/engine/tinyfly-engine.umd.cjs +2 -2
  27. package/lib/headless/headless.js +39 -0
  28. package/lib/types/adapters/canvas/impossible.d.ts +15 -0
  29. package/lib/types/adapters/canvas/index.d.ts +3 -0
  30. package/lib/types/adapters/canvas/nested-zoom.d.ts +40 -0
  31. package/lib/types/adapters/canvas/zoom-blur.d.ts +49 -0
  32. package/lib/types/characters/acting/character-script.d.ts +14 -2
  33. package/lib/types/characters/acting/script.d.ts +9 -0
  34. package/lib/types/characters/capabilities.d.ts +2 -0
  35. package/lib/types/characters/character.d.ts +28 -1
  36. package/lib/types/characters/hair-follow.d.ts +12 -6
  37. package/lib/types/characters/hands/held-items.d.ts +6 -2
  38. package/lib/types/characters/head/face.d.ts +23 -1
  39. package/lib/types/characters/index.d.ts +3 -2
  40. package/lib/types/characters/interactions.d.ts +60 -0
  41. package/lib/types/characters/props/families/animals.d.ts +6 -0
  42. package/lib/types/characters/props/families/birds.d.ts +16 -0
  43. package/lib/types/characters/props/families/furniture.d.ts +102 -0
  44. package/lib/types/characters/props/index.d.ts +1 -0
  45. package/lib/types/characters/props/presets.d.ts +15 -2
  46. package/lib/types/characters/props/ride-3d.d.ts +4 -1
  47. package/lib/types/characters/scenery.d.ts +126 -0
  48. package/lib/types/characters/species/human-motion.d.ts +17 -0
  49. package/lib/types/characters/species/human.d.ts +6 -0
  50. package/lib/types/characters/wardrobe/basic-outfit.d.ts +16 -5
  51. package/lib/types/engine/authoring/beat-loop.d.ts +46 -0
  52. package/lib/types/engine/authoring/curve.d.ts +26 -0
  53. package/lib/types/engine/authoring/index.d.ts +3 -0
  54. package/lib/types/engine/authoring/periodic.d.ts +89 -0
  55. package/lib/types/engine/path/goo.d.ts +103 -0
  56. package/lib/types/engine/path/impossible.d.ts +92 -0
  57. package/lib/types/engine/path/index.d.ts +6 -0
  58. package/lib/types/engine/path/similarity.d.ts +48 -0
  59. package/lib/types/headless/index.d.ts +1 -0
  60. package/lib/types/headless/loop-audio.d.ts +21 -0
  61. package/lib/types/headless/node-audio.d.ts +20 -0
  62. package/lib/types/headless/video-scene.d.ts +9 -0
  63. package/lib/types/scene-3d/camera.d.ts +11 -2
  64. package/lib/types/scene-3d/geometry/mesh.d.ts +2 -0
  65. package/lib/types/scene-3d/geometry/primitives.d.ts +7 -0
  66. package/lib/types/scene-3d/impossible-3d.d.ts +29 -0
  67. package/lib/types/scene-3d/index.d.ts +4 -3
  68. package/lib/types/scene-3d/resolve-scene.d.ts +13 -1
  69. package/lib/types/scene-3d/scene-3d-adapter.d.ts +2 -0
  70. package/lib/types/scene-3d/scene-types.d.ts +29 -4
  71. package/lib/types/scene-3d/shading.d.ts +2 -0
  72. package/llms-full.txt +423 -47
  73. package/llms.txt +29 -29
  74. package/package.json +2 -2
  75. package/skills/tinyfly/SKILL.md +20 -6
  76. package/lib/addons/load-scene-CQvcFWGJ.js +0 -331
  77. package/lib/addons/shading-o5T_v9DT.js +0 -89
@@ -1,32 +1,32 @@
1
- function Fe(t) {
1
+ function We(t) {
2
2
  return typeof t == "object" && t !== null && t.type === "cubic-bezier";
3
3
  }
4
- function xt(t) {
4
+ function At(t) {
5
5
  return typeof t == "object" && t !== null && t.type !== "cubic-bezier";
6
6
  }
7
- const Xt = 2;
8
- function se(t) {
7
+ const Vt = 2;
8
+ function ue(t) {
9
9
  return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
10
10
  }
11
- function $t(t) {
11
+ function Dt(t) {
12
12
  return t.property === "text" && "textConfig" in t;
13
13
  }
14
- function j(t) {
14
+ function U(t) {
15
15
  return t.kind === "inertia" && "inertia" in t;
16
16
  }
17
17
  function V(t) {
18
18
  return t.kind === "spring" && "spring" in t;
19
19
  }
20
- function re(t) {
20
+ function he(t) {
21
21
  return t.property === "motionPath" && "motionPathConfig" in t;
22
22
  }
23
- function Rs(t) {
23
+ function Ws(t) {
24
24
  return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
25
25
  }
26
- function Ne(t) {
26
+ function Qe(t) {
27
27
  return "keyframes" in t;
28
28
  }
29
- class Cs {
29
+ class Qs {
30
30
  _currentTime = 0;
31
31
  _isRunning = !1;
32
32
  onTick = null;
@@ -52,7 +52,7 @@ class Cs {
52
52
  this._currentTime = e;
53
53
  }
54
54
  }
55
- class Ds {
55
+ class Gs {
56
56
  _currentTime = 0;
57
57
  _isRunning = !1;
58
58
  _lastFrameTime = null;
@@ -99,12 +99,12 @@ class Ds {
99
99
  }
100
100
  }
101
101
  }
102
- function Xe(t, e) {
102
+ function Ge(t, e) {
103
103
  if (!(e > 0)) return t;
104
104
  const n = 1e3 / e;
105
105
  return Math.floor(t / n + 1e-9) * n;
106
106
  }
107
- function oe(t, e, n = "start") {
107
+ function le(t, e, n = "start") {
108
108
  if (e <= 1) return 0;
109
109
  if (typeof n == "number") {
110
110
  const s = Math.max(0, Math.min(e - 1, n));
@@ -121,36 +121,36 @@ function oe(t, e, n = "start") {
121
121
  return t;
122
122
  }
123
123
  }
124
- function Ye(t, e = "start") {
124
+ function Ke(t, e = "start") {
125
125
  if (t <= 1) return 0;
126
126
  let n = 0;
127
127
  for (let s = 0; s < t; s++)
128
- n = Math.max(n, oe(s, t, e));
128
+ n = Math.max(n, le(s, t, e));
129
129
  return n;
130
130
  }
131
- function ae(t, e, n) {
131
+ function fe(t, e, n) {
132
132
  if (n.offsets) return n.offsets[t] ?? 0;
133
- const s = n.from ?? "start", r = oe(t, e, s);
133
+ const s = n.from ?? "start", r = le(t, e, s);
134
134
  if (n.amount !== void 0) {
135
- const o = Ye(e, s);
136
- return o === 0 ? 0 : n.amount * r / o;
135
+ const a = Ke(e, s);
136
+ return a === 0 ? 0 : n.amount * r / a;
137
137
  }
138
138
  return n.each !== void 0 ? n.each * r : 0;
139
139
  }
140
- function ze(t, e) {
141
- return Array.from({ length: t }, (n, s) => ae(s, t, e));
140
+ function Ze(t, e) {
141
+ return Array.from({ length: t }, (n, s) => fe(s, t, e));
142
142
  }
143
- function Rt(t, e) {
144
- return t <= 1 ? 0 : Math.max(...ze(t, e));
143
+ function Et(t, e) {
144
+ return t <= 1 ? 0 : Math.max(...Ze(t, e));
145
145
  }
146
- const tt = 1, ie = 6e4, rt = ie / tt, L = {
146
+ const et = 1, de = 6e4, at = de / et, L = {
147
147
  stiffness: 180,
148
148
  damping: 12,
149
149
  mass: 1,
150
150
  velocity: 0,
151
151
  restDelta: 0.01,
152
152
  restSpeed: 0.1
153
- }, Is = {
153
+ }, Ks = {
154
154
  gentle: { stiffness: 120, damping: 18, mass: 1 },
155
155
  default: { stiffness: 180, damping: 12, mass: 1 },
156
156
  snappy: { stiffness: 280, damping: 20, mass: 1 },
@@ -158,7 +158,7 @@ const tt = 1, ie = 6e4, rt = ie / tt, L = {
158
158
  wobbly: { stiffness: 180, damping: 5, mass: 1 },
159
159
  stiff: { stiffness: 400, damping: 30, mass: 1 }
160
160
  };
161
- class ut {
161
+ class lt {
162
162
  from;
163
163
  to;
164
164
  stiffness;
@@ -201,58 +201,58 @@ class ut {
201
201
  */
202
202
  valueAt(e) {
203
203
  if (e <= 0) return this.from;
204
- const n = Math.floor(e / tt);
204
+ const n = Math.floor(e / et);
205
205
  if (this.simulateTo(n + 1), this.settledStep !== null && n >= this.settledStep)
206
206
  return this.to;
207
- const s = this.samples[Math.min(n, this.samples.length - 1)], r = this.samples[Math.min(n + 1, this.samples.length - 1)], o = e / tt - n;
208
- return s + (r - s) * o;
207
+ const s = this.samples[Math.min(n, this.samples.length - 1)], r = this.samples[Math.min(n + 1, this.samples.length - 1)], a = e / et - n;
208
+ return s + (r - s) * a;
209
209
  }
210
210
  /**
211
211
  * How long the spring takes to settle, in milliseconds — the natural duration
212
212
  * of a spring track. Runs the simulation to completion once.
213
213
  */
214
214
  settleTime() {
215
- return this.simulateTo(rt + 1), this.settledStep !== null ? this.settledStep * tt : ie;
215
+ return this.simulateTo(at + 1), this.settledStep !== null ? this.settledStep * et : de;
216
216
  }
217
217
  /** Advance the cached simulation until it holds at least `steps` samples. */
218
218
  simulateTo(e) {
219
219
  if (this.settledStep !== null) return;
220
- const n = Math.min(e, rt + 1), s = tt / 1e3;
220
+ const n = Math.min(e, at + 1), s = et / 1e3;
221
221
  for (; this.samples.length < n; ) {
222
- const r = this.samples[this.samples.length - 1], o = r - this.to, a = -this.stiffness * o, i = -this.damping * this.velocity, c = (a + i) / this.mass;
222
+ const r = this.samples[this.samples.length - 1], a = r - this.to, o = -this.stiffness * a, i = -this.damping * this.velocity, c = (o + i) / this.mass;
223
223
  this.velocity += c * s;
224
- const l = r + this.velocity * s;
225
- if (this.samples.push(l), this.isAtRest(l)) {
224
+ const h = r + this.velocity * s;
225
+ if (this.samples.push(h), this.isAtRest(h)) {
226
226
  this.settledStep = this.samples.length - 1;
227
227
  return;
228
228
  }
229
229
  }
230
- this.samples.length > rt && (this.settledStep = rt);
230
+ this.samples.length > at && (this.settledStep = at);
231
231
  }
232
232
  }
233
- function Es(t, e) {
234
- return new ut(t).valueAt(e);
233
+ function Zs(t, e) {
234
+ return new lt(t).valueAt(e);
235
235
  }
236
- function Ls(t) {
237
- return new ut(t).settleTime();
236
+ function Js(t) {
237
+ return new lt(t).settleTime();
238
238
  }
239
- function Os(t) {
239
+ function tr(t) {
240
240
  const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, s = t.mass ?? L.mass;
241
241
  return n < 2 * Math.sqrt(e * s);
242
242
  }
243
- function Fs(t) {
243
+ function er(t) {
244
244
  const e = t.stiffness ?? L.stiffness, n = t.mass ?? L.mass;
245
245
  return 2 * Math.sqrt(e * n);
246
246
  }
247
- const Yt = 4, Ue = 2e-3, je = 1e-4, Ve = 6e4;
248
- function lt(t) {
249
- const e = t.friction ?? Yt;
250
- return e > 0 ? e : Yt;
247
+ const Bt = 4, Je = 2e-3, tn = 1e-4, en = 6e4;
248
+ function ft(t) {
249
+ const e = t.friction ?? Bt;
250
+ return e > 0 ? e : Bt;
251
251
  }
252
- function He(t) {
253
- return t.from + t.velocity / lt(t);
252
+ function nn(t) {
253
+ return t.from + t.velocity / ft(t);
254
254
  }
255
- function Be(t, e) {
255
+ function sn(t, e) {
256
256
  if (e === void 0) return t;
257
257
  if (typeof e == "number")
258
258
  return e > 0 ? Math.round(t / e) * e : t;
@@ -262,79 +262,79 @@ function Be(t, e) {
262
262
  Math.abs(s - t) < Math.abs(n - t) && (n = s);
263
263
  return n;
264
264
  }
265
- function ht(t) {
266
- let e = Be(He(t), t.end);
265
+ function dt(t) {
266
+ let e = sn(nn(t), t.end);
267
267
  return t.min !== void 0 && (e = Math.max(t.min, e)), t.max !== void 0 && (e = Math.min(t.max, e)), e;
268
268
  }
269
- function ft(t) {
270
- const e = Math.abs(ht(t) - t.from);
269
+ function mt(t) {
270
+ const e = Math.abs(dt(t) - t.from);
271
271
  if (e === 0) return 0;
272
- const n = t.restDelta ?? Math.max(je, e * Ue);
272
+ const n = t.restDelta ?? Math.max(tn, e * Je);
273
273
  if (n >= e) return 0;
274
- const s = Math.log(e / n) / lt(t);
275
- return Math.min(Ve, s * 1e3);
274
+ const s = Math.log(e / n) / ft(t);
275
+ return Math.min(en, s * 1e3);
276
276
  }
277
- function kt(t, e) {
277
+ function St(t, e) {
278
278
  if (e <= 0) return t.from;
279
- const n = ht(t);
280
- if (e >= ft(t)) return n;
281
- const s = lt(t);
279
+ const n = dt(t);
280
+ if (e >= mt(t)) return n;
281
+ const s = ft(t);
282
282
  return t.from + (n - t.from) * (1 - Math.exp(-s * e / 1e3));
283
283
  }
284
- function Ns(t, e) {
285
- const n = lt(t), s = ht(t);
286
- return e >= ft(t) ? 0 : (s - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
287
- }
288
- const wt = (t) => t, We = (t) => t * t, Qe = (t) => 1 - (1 - t) * (1 - t), Ge = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ce = (t) => t * t * t, ue = (t) => 1 - Math.pow(1 - t, 3), le = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Ke = ce, Ze = ue, qe = le, Je = {
289
- linear: wt,
290
- "ease-in": Ke,
291
- "ease-out": Ze,
292
- "ease-in-out": qe,
293
- "ease-in-quad": We,
294
- "ease-out-quad": Qe,
295
- "ease-in-out-quad": Ge,
296
- "ease-in-cubic": ce,
297
- "ease-out-cubic": ue,
298
- "ease-in-out-cubic": le
284
+ function nr(t, e) {
285
+ const n = ft(t), s = dt(t);
286
+ return e >= mt(t) ? 0 : (s - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
287
+ }
288
+ const Pt = (t) => t, rn = (t) => t * t, an = (t) => 1 - (1 - t) * (1 - t), on = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, me = (t) => t * t * t, pe = (t) => 1 - Math.pow(1 - t, 3), ge = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, cn = me, un = pe, hn = ge, ln = {
289
+ linear: Pt,
290
+ "ease-in": cn,
291
+ "ease-out": un,
292
+ "ease-in-out": hn,
293
+ "ease-in-quad": rn,
294
+ "ease-out-quad": an,
295
+ "ease-in-out-quad": on,
296
+ "ease-in-cubic": me,
297
+ "ease-out-cubic": pe,
298
+ "ease-in-out-cubic": ge
299
299
  };
300
- function tn(t) {
301
- const [e, n, s, r] = t, o = 3 * e, a = 3 * (s - e) - o, i = 1 - o - a, c = 3 * n, l = 3 * (r - n) - c, h = 1 - c - l, u = (p) => ((i * p + a) * p + o) * p, f = (p) => ((h * p + l) * p + c) * p, d = (p) => (3 * i * p + 2 * a) * p + o, m = (p) => {
302
- let g = p;
303
- for (let k = 0; k < 8; k++) {
304
- const w = u(g) - p;
305
- if (Math.abs(w) < 1e-7)
306
- return g;
307
- const b = d(g);
308
- if (Math.abs(b) < 1e-7)
300
+ function fn(t) {
301
+ const [e, n, s, r] = t, a = 3 * e, o = 3 * (s - e) - a, i = 1 - a - o, c = 3 * n, h = 3 * (r - n) - c, l = 1 - c - h, u = (m) => ((i * m + o) * m + a) * m, d = (m) => ((l * m + h) * m + c) * m, f = (m) => (3 * i * m + 2 * o) * m + a, p = (m) => {
302
+ let M = m;
303
+ for (let _ = 0; _ < 8; _++) {
304
+ const k = u(M) - m;
305
+ if (Math.abs(k) < 1e-7)
306
+ return M;
307
+ const x = f(M);
308
+ if (Math.abs(x) < 1e-7)
309
309
  break;
310
- g -= w / b;
310
+ M -= k / x;
311
311
  }
312
- let M = 0, y = 1;
313
- for (g = p; M < y; ) {
314
- const k = u(g);
315
- if (Math.abs(k - p) < 1e-7)
316
- return g;
317
- p > k ? M = g : y = g, g = (M + y) / 2;
312
+ let y = 0, g = 1;
313
+ for (M = m; y < g; ) {
314
+ const _ = u(M);
315
+ if (Math.abs(_ - m) < 1e-7)
316
+ return M;
317
+ m > _ ? y = M : g = M, M = (y + g) / 2;
318
318
  }
319
- return g;
319
+ return M;
320
320
  };
321
- return (p) => {
322
- if (p <= 0) return 0;
323
- if (p >= 1) return 1;
324
- const g = m(p);
325
- return f(g);
321
+ return (m) => {
322
+ if (m <= 0) return 0;
323
+ if (m >= 1) return 1;
324
+ const M = p(m);
325
+ return d(M);
326
326
  };
327
327
  }
328
- function gt(t, e = "out") {
328
+ function _t(t, e = "out") {
329
329
  if (e === "out") return t;
330
330
  const n = (s) => 1 - t(1 - s);
331
331
  return e === "in" ? n : (s) => s < 0.5 ? n(s * 2) / 2 : t(s * 2 - 1) / 2 + 0.5;
332
332
  }
333
- function en(t = 1, e = 0.3) {
333
+ function dn(t = 1, e = 0.3) {
334
334
  const n = Math.max(1, t), s = e / (2 * Math.PI) * Math.asin(1 / n);
335
335
  return (r) => r <= 0 ? 0 : r >= 1 ? 1 : n * Math.pow(2, -10 * r) * Math.sin((r - s) * (2 * Math.PI) / e) + 1;
336
336
  }
337
- const nn = (t) => {
337
+ const mn = (t) => {
338
338
  if (t <= 0) return 0;
339
339
  if (t >= 1) return 1;
340
340
  if (t < 1 / 2.75) return 7.5625 * t * t;
@@ -349,7 +349,7 @@ const nn = (t) => {
349
349
  const s = t - 2.625 / 2.75;
350
350
  return 7.5625 * s * s + 0.984375;
351
351
  };
352
- function sn(t = 1.70158) {
352
+ function pn(t = 1.70158) {
353
353
  return (e) => {
354
354
  if (e <= 0) return 0;
355
355
  if (e >= 1) return 1;
@@ -357,7 +357,7 @@ function sn(t = 1.70158) {
357
357
  return n * n * ((t + 1) * n + t) + 1;
358
358
  };
359
359
  }
360
- function rn(t, e = "end") {
360
+ function gn(t, e = "end") {
361
361
  const n = Math.max(1, Math.floor(t));
362
362
  return (s) => {
363
363
  if (s >= 1) return 1;
@@ -375,22 +375,22 @@ function rn(t, e = "end") {
375
375
  }
376
376
  };
377
377
  }
378
- function on(t) {
378
+ function yn(t) {
379
379
  switch (t.type) {
380
380
  case "steps":
381
- return rn(t.count, t.position);
381
+ return gn(t.count, t.position);
382
382
  case "elastic":
383
- return gt(en(t.amplitude, t.period), t.mode);
383
+ return _t(dn(t.amplitude, t.period), t.mode);
384
384
  case "bounce":
385
- return gt(nn, t.mode);
385
+ return _t(mn, t.mode);
386
386
  case "back":
387
- return gt(sn(t.overshoot), t.mode);
387
+ return _t(pn(t.overshoot), t.mode);
388
388
  }
389
389
  }
390
- function he(t) {
391
- return t === void 0 ? wt : Fe(t) ? tn(t.points) : xt(t) ? on(t) : Je[t] ?? wt;
390
+ function Lt(t) {
391
+ return t === void 0 ? Pt : We(t) ? fn(t.points) : At(t) ? yn(t) : ln[t] ?? Pt;
392
392
  }
393
- const zt = 32, an = 256, W = /* @__PURE__ */ new Map(), cn = /[MmLlHhVvCcSsQqTtAaZz]/, un = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, ln = {
393
+ const Ht = 32, Mn = 256, q = /* @__PURE__ */ new Map(), xn = /[MmLlHhVvCcSsQqTtAaZz]/, _n = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, bn = {
394
394
  M: 2,
395
395
  L: 2,
396
396
  H: 1,
@@ -402,68 +402,68 @@ const zt = 32, an = 256, W = /* @__PURE__ */ new Map(), cn = /[MmLlHhVvCcSsQqTtA
402
402
  A: 7,
403
403
  Z: 0
404
404
  };
405
- function hn(t) {
405
+ function Tn(t) {
406
406
  const e = [];
407
407
  let n = 0, s = null;
408
408
  const r = () => {
409
409
  for (; n < t.length && /[\s,]/.test(t[n]); ) n++;
410
410
  };
411
411
  for (; n < t.length && (r(), !(n >= t.length)); ) {
412
- const o = t[n];
413
- if (cn.test(o)) {
414
- s = { type: o, args: [] }, e.push(s), n++;
412
+ const a = t[n];
413
+ if (xn.test(a)) {
414
+ s = { type: a, args: [] }, e.push(s), n++;
415
415
  continue;
416
416
  }
417
417
  if (!s) break;
418
- const a = s.type === "A" || s.type === "a", i = s.args.length % 7;
419
- if (a && (i === 3 || i === 4)) {
420
- if (o !== "0" && o !== "1") break;
421
- s.args.push(o === "1" ? 1 : 0), n++;
418
+ const o = s.type === "A" || s.type === "a", i = s.args.length % 7;
419
+ if (o && (i === 3 || i === 4)) {
420
+ if (a !== "0" && a !== "1") break;
421
+ s.args.push(a === "1" ? 1 : 0), n++;
422
422
  continue;
423
423
  }
424
- const c = un.exec(t.slice(n));
424
+ const c = _n.exec(t.slice(n));
425
425
  if (!c) break;
426
426
  s.args.push(parseFloat(c[0])), n += c[0].length;
427
427
  }
428
428
  return e;
429
429
  }
430
- function fn(t, e, n, s, r, o, a, i, c) {
430
+ function kn(t, e, n, s, r, a, o, i, c) {
431
431
  if (t === i && e === c) return [];
432
- let l = Math.abs(n), h = Math.abs(s);
433
- if (l === 0 || h === 0) return [[t, e, i, c, i, c]];
434
- const u = r * Math.PI / 180, f = Math.cos(u), d = Math.sin(u), m = (t - i) / 2, p = (e - c) / 2, g = f * m + d * p, M = -d * m + f * p, y = g * g / (l * l) + M * M / (h * h);
435
- if (y > 1) {
436
- const R = Math.sqrt(y);
437
- l *= R, h *= R;
438
- }
439
- const k = o === a ? -1 : 1, w = l * l * h * h - l * l * M * M - h * h * g * g, b = l * l * M * M + h * h * g * g, v = k * Math.sqrt(Math.max(0, w / b)), A = v * l * M / h, C = -v * h * g / l, _ = f * A - d * C + (t + i) / 2, T = d * A + f * C + (e + c) / 2, x = (R, I, E, H) => {
440
- const pt = R * E + I * H, st = Math.sqrt((R * R + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, pt / st)));
441
- return R * H - I * E < 0 ? -Z : Z;
442
- }, S = x(1, 0, (g - A) / l, (M - C) / h);
443
- let $ = x((g - A) / l, (M - C) / h, (-g - A) / l, (-M - C) / h);
444
- !a && $ > 0 && ($ -= 2 * Math.PI), a && $ < 0 && ($ += 2 * Math.PI);
445
- const P = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), dt = $ / P, nt = 4 / 3 * Math.tan(dt / 4), Ot = (R) => {
446
- const I = l * Math.cos(R), E = h * Math.sin(R);
447
- return [f * I - d * E + _, d * I + f * E + T];
448
- }, Ft = (R) => {
449
- const I = -l * Math.sin(R), E = h * Math.cos(R);
450
- return [f * I - d * E, d * I + f * E];
451
- }, Nt = [];
452
- for (let R = 0; R < P; R++) {
453
- const I = S + R * dt, E = I + dt, [H, pt] = Ot(I), [st, Z] = R === P - 1 ? [i, c] : Ot(E), [Ie, Ee] = Ft(I), [Le, Oe] = Ft(E);
454
- Nt.push([H + nt * Ie, pt + nt * Ee, st - nt * Le, Z - nt * Oe, st, Z]);
455
- }
456
- return Nt;
432
+ let h = Math.abs(n), l = Math.abs(s);
433
+ if (h === 0 || l === 0) return [[t, e, i, c, i, c]];
434
+ const u = r * Math.PI / 180, d = Math.cos(u), f = Math.sin(u), p = (t - i) / 2, m = (e - c) / 2, M = d * p + f * m, y = -f * p + d * m, g = M * M / (h * h) + y * y / (l * l);
435
+ if (g > 1) {
436
+ const R = Math.sqrt(g);
437
+ h *= R, l *= R;
438
+ }
439
+ const _ = a === o ? -1 : 1, k = h * h * l * l - h * h * y * y - l * l * M * M, x = h * h * y * y + l * l * M * M, A = _ * Math.sqrt(Math.max(0, k / x)), w = A * h * y / l, P = -A * l * M / h, b = d * w - f * P + (t + i) / 2, T = f * w + d * P + (e + c) / 2, v = (R, D, E, B) => {
440
+ const xt = R * E + D * B, rt = Math.sqrt((R * R + D * D) * (E * E + B * B)), Z = Math.acos(Math.max(-1, Math.min(1, xt / rt)));
441
+ return R * B - D * E < 0 ? -Z : Z;
442
+ }, S = v(1, 0, (M - w) / h, (y - P) / l);
443
+ let $ = v((M - w) / h, (y - P) / l, (-M - w) / h, (-y - P) / l);
444
+ !o && $ > 0 && ($ -= 2 * Math.PI), o && $ < 0 && ($ += 2 * Math.PI);
445
+ const I = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), Mt = $ / I, st = 4 / 3 * Math.tan(Mt / 4), zt = (R) => {
446
+ const D = h * Math.cos(R), E = l * Math.sin(R);
447
+ return [d * D - f * E + b, f * D + d * E + T];
448
+ }, jt = (R) => {
449
+ const D = -h * Math.sin(R), E = l * Math.cos(R);
450
+ return [d * D - f * E, f * D + d * E];
451
+ }, Ut = [];
452
+ for (let R = 0; R < I; R++) {
453
+ const D = S + R * Mt, E = D + Mt, [B, xt] = zt(D), [rt, Z] = R === I - 1 ? [i, c] : zt(E), [Ve, Be] = jt(D), [He, qe] = jt(E);
454
+ Ut.push([B + st * Ve, xt + st * Be, rt - st * He, Z - st * qe, rt, Z]);
455
+ }
456
+ return Ut;
457
457
  }
458
458
  function Y(t, e, n, s, r) {
459
- const o = 1 - r;
460
- return o * o * o * t + 3 * o * o * r * e + 3 * o * r * r * n + r * r * r * s;
459
+ const a = 1 - r;
460
+ return a * a * a * t + 3 * a * a * r * e + 3 * a * r * r * n + r * r * r * s;
461
461
  }
462
- function Ut(t, e, n, s, r) {
463
- const o = 1 - r;
464
- return 3 * o * o * (e - t) + 6 * o * r * (n - e) + 3 * r * r * (s - n);
462
+ function qt(t, e, n, s, r) {
463
+ const a = 1 - r;
464
+ return 3 * a * a * (e - t) + 6 * a * r * (n - e) + 3 * r * r * (s - n);
465
465
  }
466
- function q(t, e, n, s) {
466
+ function J(t, e, n, s) {
467
467
  return {
468
468
  subpath: 0,
469
469
  type: "L",
@@ -476,105 +476,105 @@ function q(t, e, n, s) {
476
476
  };
477
477
  }
478
478
  function ot(t, e, n) {
479
- const [s, r, o, a, i, c] = n, l = [0];
480
- let h = t, u = e, f = 0;
481
- for (let d = 1; d <= zt; d++) {
482
- const m = d / zt, p = Y(t, s, o, i, m), g = Y(e, r, a, c, m);
483
- f += Math.hypot(p - h, g - u), l.push(f), h = p, u = g;
479
+ const [s, r, a, o, i, c] = n, h = [0];
480
+ let l = t, u = e, d = 0;
481
+ for (let f = 1; f <= Ht; f++) {
482
+ const p = f / Ht, m = Y(t, s, a, i, p), M = Y(e, r, o, c, p);
483
+ d += Math.hypot(m - l, M - u), h.push(d), l = m, u = M;
484
484
  }
485
485
  return {
486
486
  subpath: 0,
487
487
  type: "C",
488
- points: [s, r, o, a, i, c],
488
+ points: [s, r, a, o, i, c],
489
489
  startX: t,
490
490
  startY: e,
491
491
  endX: i,
492
492
  endY: c,
493
- length: f,
494
- lengths: l
493
+ length: d,
494
+ lengths: h
495
495
  };
496
496
  }
497
- function G(t) {
498
- const e = W.get(t);
497
+ function Q(t) {
498
+ const e = q.get(t);
499
499
  if (e) return e;
500
500
  const n = [];
501
- let s = 0, r = 0, o = 0, a = 0, i = null, c = null, l = -1;
502
- const h = /* @__PURE__ */ new Set(), u = (p) => {
503
- l < 0 && (l = 0), p.subpath = l, n.push(p);
501
+ let s = 0, r = 0, a = 0, o = 0, i = null, c = null, h = -1;
502
+ const l = /* @__PURE__ */ new Set(), u = (m) => {
503
+ h < 0 && (h = 0), m.subpath = h, n.push(m);
504
504
  };
505
- for (const { type: p, args: g } of hn(t)) {
506
- const M = p.toUpperCase(), y = p !== M, k = ln[M];
507
- if (M === "Z") {
508
- (s !== o || r !== a) && u(q(s, r, o, a)), l >= 0 && h.add(l), s = o, r = a, i = c = null;
505
+ for (const { type: m, args: M } of Tn(t)) {
506
+ const y = m.toUpperCase(), g = m !== y, _ = bn[y];
507
+ if (y === "Z") {
508
+ (s !== a || r !== o) && u(J(s, r, a, o)), h >= 0 && l.add(h), s = a, r = o, i = c = null;
509
509
  continue;
510
510
  }
511
- for (let w = 0; w + k <= g.length; w += k) {
512
- const b = g.slice(w, w + k), v = y ? s : 0, A = y ? r : 0;
513
- let C = null, _ = null;
514
- switch (M) {
511
+ for (let k = 0; k + _ <= M.length; k += _) {
512
+ const x = M.slice(k, k + _), A = g ? s : 0, w = g ? r : 0;
513
+ let P = null, b = null;
514
+ switch (y) {
515
515
  case "M":
516
- w === 0 ? (s = b[0] + v, r = b[1] + A, o = s, a = r, (l < 0 || n[n.length - 1]?.subpath === l) && l++) : (u(q(s, r, b[0] + v, b[1] + A)), s = b[0] + v, r = b[1] + A);
516
+ k === 0 ? (s = x[0] + A, r = x[1] + w, a = s, o = r, (h < 0 || n[n.length - 1]?.subpath === h) && h++) : (u(J(s, r, x[0] + A, x[1] + w)), s = x[0] + A, r = x[1] + w);
517
517
  break;
518
518
  case "L":
519
- u(q(s, r, b[0] + v, b[1] + A)), s = b[0] + v, r = b[1] + A;
519
+ u(J(s, r, x[0] + A, x[1] + w)), s = x[0] + A, r = x[1] + w;
520
520
  break;
521
521
  case "H":
522
- u(q(s, r, b[0] + v, r)), s = b[0] + v;
522
+ u(J(s, r, x[0] + A, r)), s = x[0] + A;
523
523
  break;
524
524
  case "V":
525
- u(q(s, r, s, b[0] + A)), r = b[0] + A;
525
+ u(J(s, r, s, x[0] + w)), r = x[0] + w;
526
526
  break;
527
527
  case "C": {
528
- const T = [b[0] + v, b[1] + A, b[2] + v, b[3] + A, b[4] + v, b[5] + A];
529
- u(ot(s, r, T)), C = [T[2], T[3]], s = T[4], r = T[5];
528
+ const T = [x[0] + A, x[1] + w, x[2] + A, x[3] + w, x[4] + A, x[5] + w];
529
+ u(ot(s, r, T)), P = [T[2], T[3]], s = T[4], r = T[5];
530
530
  break;
531
531
  }
532
532
  case "S": {
533
- const [T, x] = i ? [2 * s - i[0], 2 * r - i[1]] : [s, r], S = [T, x, b[0] + v, b[1] + A, b[2] + v, b[3] + A];
534
- u(ot(s, r, S)), C = [S[2], S[3]], s = S[4], r = S[5];
533
+ const [T, v] = i ? [2 * s - i[0], 2 * r - i[1]] : [s, r], S = [T, v, x[0] + A, x[1] + w, x[2] + A, x[3] + w];
534
+ u(ot(s, r, S)), P = [S[2], S[3]], s = S[4], r = S[5];
535
535
  break;
536
536
  }
537
537
  case "Q":
538
538
  case "T": {
539
- let T = s, x = r;
540
- M === "Q" ? (T = b[0] + v, x = b[1] + A) : c && (T = 2 * s - c[0], x = 2 * r - c[1]);
541
- const S = M === "Q" ? b[2] + v : b[0] + v, $ = M === "Q" ? b[3] + A : b[1] + A;
539
+ let T = s, v = r;
540
+ y === "Q" ? (T = x[0] + A, v = x[1] + w) : c && (T = 2 * s - c[0], v = 2 * r - c[1]);
541
+ const S = y === "Q" ? x[2] + A : x[0] + A, $ = y === "Q" ? x[3] + w : x[1] + w;
542
542
  u(
543
543
  ot(s, r, [
544
544
  s + 2 / 3 * (T - s),
545
- r + 2 / 3 * (x - r),
545
+ r + 2 / 3 * (v - r),
546
546
  S + 2 / 3 * (T - S),
547
- $ + 2 / 3 * (x - $),
547
+ $ + 2 / 3 * (v - $),
548
548
  S,
549
549
  $
550
550
  ])
551
- ), _ = [T, x], s = S, r = $;
551
+ ), b = [T, v], s = S, r = $;
552
552
  break;
553
553
  }
554
554
  case "A": {
555
- const T = b[5] + v, x = b[6] + A;
555
+ const T = x[5] + A, v = x[6] + w;
556
556
  let S = s, $ = r;
557
- for (const P of fn(s, r, b[0], b[1], b[2], b[3], b[4], T, x))
558
- u(ot(S, $, P)), S = P[4], $ = P[5];
559
- s = T, r = x;
557
+ for (const I of kn(s, r, x[0], x[1], x[2], x[3], x[4], T, v))
558
+ u(ot(S, $, I)), S = I[4], $ = I[5];
559
+ s = T, r = v;
560
560
  break;
561
561
  }
562
562
  }
563
- i = C, c = _;
563
+ i = P, c = b;
564
564
  }
565
565
  }
566
- const f = n.reduce((p, g) => p + g.length, 0), d = [];
567
- for (let p = 0; p < n.length; ) {
568
- const g = n[p].subpath;
569
- let M = p, y = 0;
570
- for (; M < n.length && n[M].subpath === g; ) y += n[M++].length;
571
- const k = n[p], w = n[M - 1], b = h.has(g) || Math.abs(w.endX - k.startX) < 1e-9 && Math.abs(w.endY - k.startY) < 1e-9;
572
- d.push({ start: p, end: M, length: y, closed: b }), p = M;
566
+ const d = n.reduce((m, M) => m + M.length, 0), f = [];
567
+ for (let m = 0; m < n.length; ) {
568
+ const M = n[m].subpath;
569
+ let y = m, g = 0;
570
+ for (; y < n.length && n[y].subpath === M; ) g += n[y++].length;
571
+ const _ = n[m], k = n[y - 1], x = l.has(M) || Math.abs(k.endX - _.startX) < 1e-9 && Math.abs(k.endY - _.startY) < 1e-9;
572
+ f.push({ start: m, end: y, length: g, closed: x }), m = y;
573
573
  }
574
- const m = { segments: n, totalLength: f, subpaths: d };
575
- return W.size >= an && W.delete(W.keys().next().value), W.set(t, m), m;
574
+ const p = { segments: n, totalLength: d, subpaths: f };
575
+ return q.size >= Mn && q.delete(q.keys().next().value), q.set(t, p), p;
576
576
  }
577
- function dn(t, e) {
577
+ function wn(t, e) {
578
578
  const n = t.lengths;
579
579
  if (e <= 0) return 0;
580
580
  if (e >= t.length) return 1;
@@ -583,10 +583,10 @@ function dn(t, e) {
583
583
  const i = s + r >> 1;
584
584
  n[i] < e ? s = i : r = i;
585
585
  }
586
- const o = n[r] - n[s], a = o > 0 ? (e - n[s]) / o : 0;
587
- return (s + a) / (n.length - 1);
586
+ const a = n[r] - n[s], o = a > 0 ? (e - n[s]) / a : 0;
587
+ return (s + o) / (n.length - 1);
588
588
  }
589
- function pn(t, e) {
589
+ function vn(t, e) {
590
590
  if (t.type === "L") {
591
591
  const u = t.length > 0 ? Math.max(0, Math.min(1, e / t.length)) : 0;
592
592
  return {
@@ -595,396 +595,396 @@ function pn(t, e) {
595
595
  angle: Math.atan2(t.endY - t.startY, t.endX - t.startX) * 180 / Math.PI
596
596
  };
597
597
  }
598
- const [n, s, r, o, a, i] = t.points, c = dn(t, e);
599
- let l = Ut(t.startX, n, r, a, c), h = Ut(t.startY, s, o, i, c);
600
- if (Math.hypot(l, h) < 1e-9) {
601
- const u = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = Y(t.startX, n, r, a, u), d = Y(t.startY, s, o, i, u), m = Y(t.startX, n, r, a, c), p = Y(t.startY, s, o, i, c);
602
- l = c < 0.5 ? f - m : m - f, h = c < 0.5 ? d - p : p - d;
598
+ const [n, s, r, a, o, i] = t.points, c = wn(t, e);
599
+ let h = qt(t.startX, n, r, o, c), l = qt(t.startY, s, a, i, c);
600
+ if (Math.hypot(h, l) < 1e-9) {
601
+ const u = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), d = Y(t.startX, n, r, o, u), f = Y(t.startY, s, a, i, u), p = Y(t.startX, n, r, o, c), m = Y(t.startY, s, a, i, c);
602
+ h = c < 0.5 ? d - p : p - d, l = c < 0.5 ? f - m : m - f;
603
603
  }
604
604
  return {
605
- x: Y(t.startX, n, r, a, c),
606
- y: Y(t.startY, s, o, i, c),
607
- angle: Math.atan2(h, l) * 180 / Math.PI
605
+ x: Y(t.startX, n, r, o, c),
606
+ y: Y(t.startY, s, a, i, c),
607
+ angle: Math.atan2(l, h) * 180 / Math.PI
608
608
  };
609
609
  }
610
- function fe(t, e, n = 0, s = t.length) {
610
+ function ye(t, e, n = 0, s = t.length) {
611
611
  if (s <= n) return { x: 0, y: 0, angle: 0 };
612
612
  let r = 0;
613
- for (let o = n; o < s; o++) {
614
- const a = t[o];
615
- if (r + a.length >= e || o === s - 1)
616
- return pn(a, e - r);
617
- r += a.length;
613
+ for (let a = n; a < s; a++) {
614
+ const o = t[a];
615
+ if (r + o.length >= e || a === s - 1)
616
+ return vn(o, e - r);
617
+ r += o.length;
618
618
  }
619
619
  return { x: 0, y: 0, angle: 0 };
620
620
  }
621
- function gn(t, e) {
622
- const { segments: n, totalLength: s } = G(t);
623
- return fe(n, Math.max(0, Math.min(1, e)) * s);
621
+ function An(t, e) {
622
+ const { segments: n, totalLength: s } = Q(t);
623
+ return ye(n, Math.max(0, Math.min(1, e)) * s);
624
624
  }
625
- function Xs() {
626
- W.clear();
625
+ function sr() {
626
+ q.clear();
627
627
  }
628
- function Ys(t) {
629
- return G(t).totalLength;
628
+ function rr(t) {
629
+ return Q(t).totalLength;
630
630
  }
631
- const mn = 24, yn = 320, Mn = 2.5, J = 72, zs = 64, _n = 0.2, bn = 128, et = /* @__PURE__ */ new Map();
632
- let at = 0, X;
633
- const jt = (t) => Math.round(t * 100) / 100;
634
- function Vt(t, e) {
635
- const { segments: n, subpaths: s, totalLength: r } = G(t);
631
+ const Sn = 24, Pn = 320, In = 2.5, tt = 72, ar = 64, $n = 0.2, Rn = 128, nt = /* @__PURE__ */ new Map();
632
+ let it = 0, X;
633
+ const Wt = (t) => Math.round(t * 100) / 100;
634
+ function Qt(t, e) {
635
+ const { segments: n, subpaths: s, totalLength: r } = Q(t);
636
636
  if (n.length === 0) return [];
637
637
  if (e) {
638
- const o = s.every((a) => a.closed);
639
- return [{ segments: n, start: 0, end: n.length, length: r, closed: o }];
638
+ const a = s.every((o) => o.closed);
639
+ return [{ segments: n, start: 0, end: n.length, length: r, closed: a }];
640
640
  }
641
- return s.filter((o) => o.length > 0).map((o) => ({ segments: n, start: o.start, end: o.end, length: o.length, closed: o.closed }));
641
+ return s.filter((a) => a.length > 0).map((a) => ({ segments: n, start: a.start, end: a.end, length: a.length, closed: a.closed }));
642
642
  }
643
- function St(t, e) {
644
- const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), s = fe(t.segments, n * t.length, t.start, t.end);
643
+ function It(t, e) {
644
+ const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), s = ye(t.segments, n * t.length, t.start, t.end);
645
645
  return [s.x, s.y];
646
646
  }
647
- function Ht(t) {
647
+ function Gt(t) {
648
648
  const e = [];
649
649
  let n = 0;
650
650
  for (let s = t.start; s < t.end; s++)
651
651
  n += t.segments[s].length, t.length > 0 && e.push(n / t.length);
652
652
  return e;
653
653
  }
654
- function Bt(t, e) {
654
+ function Kt(t, e) {
655
655
  const n = [];
656
656
  for (let s = 0; s < e; s++)
657
- n.push(St(t, t.closed ? s / e : s / (e - 1)));
657
+ n.push(It(t, t.closed ? s / e : s / (e - 1)));
658
658
  return n;
659
659
  }
660
- function Wt(t) {
660
+ function Zt(t) {
661
661
  let e = 0, n = 0;
662
662
  for (const [s, r] of t)
663
663
  e += s, n += r;
664
664
  return e /= t.length, n /= t.length, t.map(([s, r]) => [s - e, r - n]);
665
665
  }
666
- function Tn(t, e, n) {
666
+ function Cn(t, e, n) {
667
667
  const s = t.closed && e.closed;
668
668
  if (n !== void 0)
669
- return { offset: s ? Math.abs(n) % J / J : 0, reversed: n < 0 };
670
- const r = Wt(Bt(t, J)), o = Wt(Bt(e, J)), a = J;
669
+ return { offset: s ? Math.abs(n) % tt / tt : 0, reversed: n < 0 };
670
+ const r = Zt(Kt(t, tt)), a = Zt(Kt(e, tt)), o = tt;
671
671
  let i = { offset: 0, reversed: !1 }, c = 1 / 0;
672
- for (const l of [!1, !0]) {
673
- const h = s ? a : 1;
674
- for (let u = 0; u < h; u++) {
675
- let f = 0;
676
- for (let d = 0; d < a && f < c; d++) {
677
- const m = s ? l ? (u - d + a) % a : (d + u) % a : l ? a - 1 - d : d, p = r[d][0] - o[m][0], g = r[d][1] - o[m][1];
678
- f += p * p + g * g;
672
+ for (const h of [!1, !0]) {
673
+ const l = s ? o : 1;
674
+ for (let u = 0; u < l; u++) {
675
+ let d = 0;
676
+ for (let f = 0; f < o && d < c; f++) {
677
+ const p = s ? h ? (u - f + o) % o : (f + u) % o : h ? o - 1 - f : f, m = r[f][0] - a[p][0], M = r[f][1] - a[p][1];
678
+ d += m * m + M * M;
679
679
  }
680
- f < c && (c = f, i = { offset: s ? u / a : 0, reversed: l });
680
+ d < c && (c = d, i = { offset: s ? u / o : 0, reversed: h });
681
681
  }
682
682
  }
683
683
  return i;
684
684
  }
685
- function xn(t, e, n) {
685
+ function Dn(t, e, n) {
686
686
  return n ? ((e.reversed ? e.offset - t : t + e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
687
687
  }
688
- function kn(t, e, n) {
688
+ function En(t, e, n) {
689
689
  return n ? ((e.reversed ? e.offset - t : t - e.offset) % 1 + 1) % 1 : e.reversed ? 1 - t : t;
690
690
  }
691
- function wn(t, e, n) {
692
- const s = t.closed && e.closed, r = Tn(t, e, n.shapeIndex), o = Math.max(
693
- mn,
694
- Math.min(yn, Math.ceil(Math.max(t.length, e.length) / Mn))
695
- ), a = /* @__PURE__ */ new Set(), i = (u) => a.add(Math.round(u * 1e7) / 1e7);
696
- for (let u = 0; u <= o; u++) i(u / o);
697
- for (const u of Ht(t)) i(u);
698
- for (const u of Ht(e)) i(kn(u, r, s));
699
- let c = [...a].sort((u, f) => u - f);
691
+ function Ln(t, e, n) {
692
+ const s = t.closed && e.closed, r = Cn(t, e, n.shapeIndex), a = Math.max(
693
+ Sn,
694
+ Math.min(Pn, Math.ceil(Math.max(t.length, e.length) / In))
695
+ ), o = /* @__PURE__ */ new Set(), i = (u) => o.add(Math.round(u * 1e7) / 1e7);
696
+ for (let u = 0; u <= a; u++) i(u / a);
697
+ for (const u of Gt(t)) i(u);
698
+ for (const u of Gt(e)) i(En(u, r, s));
699
+ let c = [...o].sort((u, d) => u - d);
700
700
  s && (c = c.filter((u) => u < 1));
701
- const l = [], h = [];
701
+ const h = [], l = [];
702
702
  for (const u of c)
703
- l.push(...St(t, u)), h.push(...St(e, xn(u, r, s)));
704
- return Sn({ from: l, to: h, closed: s });
703
+ h.push(...It(t, u)), l.push(...It(e, Dn(u, r, s)));
704
+ return Fn({ from: h, to: l, closed: s });
705
705
  }
706
- function Sn(t) {
706
+ function Fn(t) {
707
707
  const e = t.from.length / 2;
708
708
  if (e <= 3) return t;
709
709
  const n = new Uint8Array(e);
710
710
  n[0] = 1, n[e - 1] = 1;
711
711
  const s = [[0, e - 1]];
712
712
  for (; s.length > 0; ) {
713
- const [a, i] = s.pop();
714
- let c = -1, l = _n;
715
- for (let h = a + 1; h < i; h++) {
716
- const u = Math.max(Qt(t.from, a, i, h), Qt(t.to, a, i, h));
717
- u > l && (l = u, c = h);
713
+ const [o, i] = s.pop();
714
+ let c = -1, h = $n;
715
+ for (let l = o + 1; l < i; l++) {
716
+ const u = Math.max(Jt(t.from, o, i, l), Jt(t.to, o, i, l));
717
+ u > h && (h = u, c = l);
718
718
  }
719
- c !== -1 && (n[c] = 1, s.push([a, c], [c, i]));
719
+ c !== -1 && (n[c] = 1, s.push([o, c], [c, i]));
720
720
  }
721
- const r = [], o = [];
722
- for (let a = 0; a < e; a++)
723
- n[a] && (r.push(t.from[a * 2], t.from[a * 2 + 1]), o.push(t.to[a * 2], t.to[a * 2 + 1]));
724
- return { from: r, to: o, closed: t.closed };
721
+ const r = [], a = [];
722
+ for (let o = 0; o < e; o++)
723
+ n[o] && (r.push(t.from[o * 2], t.from[o * 2 + 1]), a.push(t.to[o * 2], t.to[o * 2 + 1]));
724
+ return { from: r, to: a, closed: t.closed };
725
725
  }
726
- function Qt(t, e, n, s) {
727
- const r = t[e * 2], o = t[e * 2 + 1], a = t[n * 2] - r, i = t[n * 2 + 1] - o, c = t[s * 2] - r, l = t[s * 2 + 1] - o, h = a * a + i * i, u = h === 0 ? 0 : Math.max(0, Math.min(1, (c * a + l * i) / h));
728
- return Math.hypot(c - u * a, l - u * i);
726
+ function Jt(t, e, n, s) {
727
+ const r = t[e * 2], a = t[e * 2 + 1], o = t[n * 2] - r, i = t[n * 2 + 1] - a, c = t[s * 2] - r, h = t[s * 2 + 1] - a, l = o * o + i * i, u = l === 0 ? 0 : Math.max(0, Math.min(1, (c * o + h * i) / l));
728
+ return Math.hypot(c - u * o, h - u * i);
729
729
  }
730
- function An(t, e, n) {
730
+ function On(t, e, n) {
731
731
  const s = n.shapeIndex;
732
732
  if (X && X.from === t && X.to === e && X.shapeIndex === s) return X.plan;
733
- const o = et.get(String(s ?? "auto"))?.get(t)?.get(e);
734
- if (o)
735
- return X = { from: t, to: e, shapeIndex: s, plan: o }, o;
736
- const a = G(t).subpaths.filter((d) => d.length > 0).length === G(e).subpaths.filter((d) => d.length > 0).length, i = Vt(t, !a), c = Vt(e, !a), l = {
737
- pairs: i.map((d, m) => wn(d, c[m], n))
733
+ const a = nt.get(String(s ?? "auto"))?.get(t)?.get(e);
734
+ if (a)
735
+ return X = { from: t, to: e, shapeIndex: s, plan: a }, a;
736
+ const o = Q(t).subpaths.filter((f) => f.length > 0).length === Q(e).subpaths.filter((f) => f.length > 0).length, i = Qt(t, !o), c = Qt(e, !o), h = {
737
+ pairs: i.map((f, p) => Ln(f, c[p], n))
738
738
  };
739
- at >= bn && (et.clear(), at = 0);
740
- const h = String(s ?? "auto"), u = et.get(h) ?? /* @__PURE__ */ new Map();
741
- et.set(h, u);
742
- const f = u.get(t) ?? /* @__PURE__ */ new Map();
743
- return u.set(t, f), f.set(e, l), at++, X = { from: t, to: e, shapeIndex: s, plan: l }, l;
739
+ it >= Rn && (nt.clear(), it = 0);
740
+ const l = String(s ?? "auto"), u = nt.get(l) ?? /* @__PURE__ */ new Map();
741
+ nt.set(l, u);
742
+ const d = u.get(t) ?? /* @__PURE__ */ new Map();
743
+ return u.set(t, d), d.set(e, h), it++, X = { from: t, to: e, shapeIndex: s, plan: h }, h;
744
744
  }
745
- function vn(t, e, n, s = {}) {
745
+ function Nn(t, e, n, s = {}) {
746
746
  if (!t) return e;
747
747
  if (!e) return t;
748
748
  const r = Math.max(0, Math.min(1, n));
749
749
  if (r === 0) return t;
750
750
  if (r === 1) return e;
751
- const o = An(t, e, s);
752
- if (o.pairs.length === 0) return r < 0.5 ? t : e;
753
- let a = "";
754
- for (const i of o.pairs) {
751
+ const a = On(t, e, s);
752
+ if (a.pairs.length === 0) return r < 0.5 ? t : e;
753
+ let o = "";
754
+ for (const i of a.pairs) {
755
755
  for (let c = 0; c < i.from.length; c += 2) {
756
- const l = jt(i.from[c] + (i.to[c] - i.from[c]) * r), h = jt(i.from[c + 1] + (i.to[c + 1] - i.from[c + 1]) * r);
757
- a += `${c === 0 ? a ? " M" : "M" : " L"}${l} ${h}`;
756
+ const h = Wt(i.from[c] + (i.to[c] - i.from[c]) * r), l = Wt(i.from[c + 1] + (i.to[c + 1] - i.from[c + 1]) * r);
757
+ o += `${c === 0 ? o ? " M" : "M" : " L"}${h} ${l}`;
758
758
  }
759
- i.closed && (a += " Z");
759
+ i.closed && (o += " Z");
760
760
  }
761
- return a;
761
+ return o;
762
762
  }
763
- function Us() {
764
- et.clear(), at = 0, X = void 0;
763
+ function or() {
764
+ nt.clear(), it = 0, X = void 0;
765
765
  }
766
- function Pn(t) {
766
+ function Xn(t) {
767
767
  return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
768
768
  }
769
- const Q = Math.PI / 180, $n = 0.9995;
770
- function Ct() {
769
+ const W = Math.PI / 180, Yn = 0.9995;
770
+ function Ft() {
771
771
  return [0, 0, 0, 1];
772
772
  }
773
- function it(t, e) {
773
+ function ct(t, e) {
774
774
  const n = Math.hypot(t[0], t[1], t[2]);
775
- if (n === 0) return Ct();
776
- const s = e * Q / 2, r = Math.sin(s) / n;
775
+ if (n === 0) return Ft();
776
+ const s = e * W / 2, r = Math.sin(s) / n;
777
777
  return [t[0] * r, t[1] * r, t[2] * r, Math.cos(s)];
778
778
  }
779
- function Rn(t, e, n) {
780
- return At(At(it([0, 1, 0], e), it([1, 0, 0], t)), it([0, 0, 1], n));
779
+ function zn(t, e, n) {
780
+ return $t($t(ct([0, 1, 0], e), ct([1, 0, 0], t)), ct([0, 0, 1], n));
781
781
  }
782
- function Cn(t) {
783
- const [e, n, s, r] = z(t), o = 2 * (e * s + n * r), a = 2 * (e * n + s * r), i = 1 - 2 * (e * e + s * s), c = 2 * (n * s - e * r), l = 1 - 2 * (n * n + s * s), h = 2 * (e * s - n * r), u = 1 - 2 * (e * e + n * n), f = Math.asin(Math.max(-1, Math.min(1, -c)));
784
- return Math.abs(c) < 0.9999999 ? [f / Q, Math.atan2(o, u) / Q, Math.atan2(a, i) / Q] : [f / Q, Math.atan2(-h, l) / Q, 0];
782
+ function jn(t) {
783
+ const [e, n, s, r] = z(t), a = 2 * (e * s + n * r), o = 2 * (e * n + s * r), i = 1 - 2 * (e * e + s * s), c = 2 * (n * s - e * r), h = 1 - 2 * (n * n + s * s), l = 2 * (e * s - n * r), u = 1 - 2 * (e * e + n * n), d = Math.asin(Math.max(-1, Math.min(1, -c)));
784
+ return Math.abs(c) < 0.9999999 ? [d / W, Math.atan2(a, u) / W, Math.atan2(o, i) / W] : [d / W, Math.atan2(-l, h) / W, 0];
785
785
  }
786
- function At(t, e) {
787
- const [n, s, r, o] = t, [a, i, c, l] = e;
786
+ function $t(t, e) {
787
+ const [n, s, r, a] = t, [o, i, c, h] = e;
788
788
  return [
789
- o * a + n * l + s * c - r * i,
790
- o * i - n * c + s * l + r * a,
791
- o * c + n * i - s * a + r * l,
792
- o * l - n * a - s * i - r * c
789
+ a * o + n * h + s * c - r * i,
790
+ a * i - n * c + s * h + r * o,
791
+ a * c + n * i - s * o + r * h,
792
+ a * h - n * o - s * i - r * c
793
793
  ];
794
794
  }
795
- function de(t, e) {
795
+ function Me(t, e) {
796
796
  return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] + t[3] * e[3];
797
797
  }
798
- function pe(t) {
798
+ function xe(t) {
799
799
  return Math.hypot(t[0], t[1], t[2], t[3]);
800
800
  }
801
801
  function z(t) {
802
- const e = pe(t);
803
- return e === 0 ? Ct() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
802
+ const e = xe(t);
803
+ return e === 0 ? Ft() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
804
804
  }
805
- function Dn(t) {
805
+ function Un(t) {
806
806
  return [-t[0], -t[1], -t[2], t[3]];
807
807
  }
808
- function ge(t, e, n) {
808
+ function _e(t, e, n) {
809
809
  const s = z(t);
810
- let r = z(e), o = de(s, r);
811
- if (o < 0 && (r = [-r[0], -r[1], -r[2], -r[3]], o = -o), o > $n)
810
+ let r = z(e), a = Me(s, r);
811
+ if (a < 0 && (r = [-r[0], -r[1], -r[2], -r[3]], a = -a), a > Yn)
812
812
  return z([
813
813
  s[0] + (r[0] - s[0]) * n,
814
814
  s[1] + (r[1] - s[1]) * n,
815
815
  s[2] + (r[2] - s[2]) * n,
816
816
  s[3] + (r[3] - s[3]) * n
817
817
  ]);
818
- const a = Math.acos(o), i = Math.sin(a), c = Math.sin((1 - n) * a) / i, l = Math.sin(n * a) / i;
818
+ const o = Math.acos(a), i = Math.sin(o), c = Math.sin((1 - n) * o) / i, h = Math.sin(n * o) / i;
819
819
  return z([
820
- s[0] * c + r[0] * l,
821
- s[1] * c + r[1] * l,
822
- s[2] * c + r[2] * l,
823
- s[3] * c + r[3] * l
820
+ s[0] * c + r[0] * h,
821
+ s[1] * c + r[1] * h,
822
+ s[2] * c + r[2] * h,
823
+ s[3] * c + r[3] * h
824
824
  ]);
825
825
  }
826
- function In(t, e) {
827
- const [n, s, r, o] = z(t), a = 2 * (s * e[2] - r * e[1]), i = 2 * (r * e[0] - n * e[2]), c = 2 * (n * e[1] - s * e[0]);
828
- return [e[0] + o * a + (s * c - r * i), e[1] + o * i + (r * a - n * c), e[2] + o * c + (n * i - s * a)];
826
+ function Vn(t, e) {
827
+ const [n, s, r, a] = z(t), o = 2 * (s * e[2] - r * e[1]), i = 2 * (r * e[0] - n * e[2]), c = 2 * (n * e[1] - s * e[0]);
828
+ return [e[0] + a * o + (s * c - r * i), e[1] + a * i + (r * o - n * c), e[2] + a * c + (n * i - s * o)];
829
829
  }
830
- const js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
830
+ const ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
831
831
  __proto__: null,
832
- conjugate: Dn,
833
- dot: de,
834
- fromAxisAngle: it,
835
- fromEuler: Rn,
836
- identity: Ct,
837
- length: pe,
838
- multiply: At,
832
+ conjugate: Un,
833
+ dot: Me,
834
+ fromAxisAngle: ct,
835
+ fromEuler: zn,
836
+ identity: Ft,
837
+ length: xe,
838
+ multiply: $t,
839
839
  normalize: z,
840
- rotateVec3: In,
841
- slerp: ge,
842
- toEuler: Cn
843
- }, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, me = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
844
- function Gt(t) {
845
- const e = mt.get(t);
840
+ rotateVec3: Vn,
841
+ slerp: _e,
842
+ toEuler: jn
843
+ }, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, be = 512, bt = /* @__PURE__ */ new Map(), Tt = /* @__PURE__ */ new Map();
844
+ function te(t) {
845
+ const e = bt.get(t);
846
846
  if (e) return e;
847
847
  const n = t.replace("#", ""), s = [
848
848
  parseInt(n.slice(0, 2), 16),
849
849
  parseInt(n.slice(2, 4), 16),
850
850
  parseInt(n.slice(4, 6), 16)
851
851
  ];
852
- return mt.size < me && mt.set(t, s), s;
852
+ return bt.size < be && bt.set(t, s), s;
853
853
  }
854
- const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"), En = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Mt = (t) => Math.round(t).toString(16).padStart(2, "0");
855
- function Ln(t, e, n) {
856
- return `#${Mt(t)}${Mt(e)}${Mt(n)}`;
854
+ const ee = (t) => t.charCodeAt(0) === 35, ne = (t) => t.startsWith("rgb"), se = (t) => t.startsWith("rgba"), Bn = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, kt = (t) => Math.round(t).toString(16).padStart(2, "0");
855
+ function Hn(t, e, n) {
856
+ return `#${kt(t)}${kt(e)}${kt(n)}`;
857
857
  }
858
- function Jt(t) {
859
- const e = yt.get(t);
858
+ function re(t) {
859
+ const e = Tt.get(t);
860
860
  if (e) return e;
861
- const n = t.match(En);
861
+ const n = t.match(Bn);
862
862
  if (!n)
863
863
  throw new Error(`Invalid rgb color: ${t}`);
864
- const s = parseInt(n[1], 10), r = parseInt(n[2], 10), o = parseInt(n[3], 10), a = n[4] !== void 0 ? [s, r, o, parseFloat(n[4])] : [s, r, o];
865
- return yt.size < me && yt.set(t, a), a;
864
+ const s = parseInt(n[1], 10), r = parseInt(n[2], 10), a = parseInt(n[3], 10), o = n[4] !== void 0 ? [s, r, a, parseFloat(n[4])] : [s, r, a];
865
+ return Tt.size < be && Tt.set(t, o), o;
866
866
  }
867
- const On = (t, e, n) => {
868
- if (Kt(t) && Kt(e)) {
869
- const [s, r, o] = Gt(t), [a, i, c] = Gt(e), l = N(s, a, n), h = N(r, i, n), u = N(o, c, n);
870
- return Ln(l, h, u);
867
+ const qn = (t, e, n) => {
868
+ if (ee(t) && ee(e)) {
869
+ const [s, r, a] = te(t), [o, i, c] = te(e), h = N(s, o, n), l = N(r, i, n), u = N(a, c, n);
870
+ return Hn(h, l, u);
871
871
  }
872
- if ((Zt(t) || qt(t)) && (Zt(e) || qt(e))) {
873
- const s = Jt(t), r = Jt(e), o = Math.round(N(s[0], r[0], n)), a = Math.round(N(s[1], r[1], n)), i = Math.round(N(s[2], r[2], n));
872
+ if ((ne(t) || se(t)) && (ne(e) || se(e))) {
873
+ const s = re(t), r = re(e), a = Math.round(N(s[0], r[0], n)), o = Math.round(N(s[1], r[1], n)), i = Math.round(N(s[2], r[2], n));
874
874
  if (s.length === 4 || r.length === 4) {
875
- const c = s[3] ?? 1, l = r[3] ?? 1, h = N(c, l, n);
876
- return `rgba(${o}, ${a}, ${i}, ${h})`;
875
+ const c = s[3] ?? 1, h = r[3] ?? 1, l = N(c, h, n);
876
+ return `rgba(${a}, ${o}, ${i}, ${l})`;
877
877
  }
878
- return `rgb(${o}, ${a}, ${i})`;
878
+ return `rgb(${a}, ${o}, ${i})`;
879
879
  }
880
880
  return n < 1 ? t : e;
881
- }, Fn = (t, e, n) => {
881
+ }, Wn = (t, e, n) => {
882
882
  const s = Math.min(t.length, e.length), r = [];
883
- for (let o = 0; o < s; o++)
884
- r.push(N(t[o], e[o], n));
883
+ for (let a = 0; a < s; a++)
884
+ r.push(N(t[a], e[a], n));
885
885
  return r;
886
- }, Nn = (t, e, n) => ge(t, e, n), te = (t, e, n) => n < 1 ? t : e, Xn = (t, e, n) => vn(t, e, n);
887
- function ye(t, e) {
888
- return e === "slerp" ? Nn : typeof t == "number" ? N : Array.isArray(t) ? Fn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? On : Pn(t) ? Xn : te : te;
886
+ }, Qn = (t, e, n) => _e(t, e, n), ae = (t, e, n) => n < 1 ? t : e, Gn = (t, e, n) => Nn(t, e, n);
887
+ function Te(t, e) {
888
+ return e === "slerp" ? Qn : typeof t == "number" ? N : Array.isArray(t) ? Wn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? qn : Xn(t) ? Gn : ae : ae;
889
889
  }
890
- const Me = 1e3 / 60;
891
- function _e(t, e = {}) {
890
+ const ke = 1e3 / 60;
891
+ function we(t, e = {}) {
892
892
  if (!V(t))
893
893
  throw new Error(`bakeSpringTrack: track "${t.id}" is not a spring track`);
894
- const n = new ut(t.spring);
895
- return Te(t, (s) => n.valueAt(s), n.settleTime(), t.spring.from, t.spring.to, e);
894
+ const n = new lt(t.spring);
895
+ return Ae(t, (s) => n.valueAt(s), n.settleTime(), t.spring.from, t.spring.to, e);
896
896
  }
897
- function be(t, e = {}) {
898
- if (!j(t))
897
+ function ve(t, e = {}) {
898
+ if (!U(t))
899
899
  throw new Error(`bakeInertiaTrack: track "${t.id}" is not an inertia track`);
900
900
  const n = t.inertia;
901
- return Te(
901
+ return Ae(
902
902
  t,
903
- (s) => kt(n, s),
904
- ft(n),
903
+ (s) => St(n, s),
904
+ mt(n),
905
905
  n.from,
906
- ht(n),
906
+ dt(n),
907
907
  e
908
908
  );
909
909
  }
910
- function Te(t, e, n, s, r, o) {
911
- const a = o.intervalMs ?? Me, i = o.tolerance ?? 0.01, c = t.delay ?? 0, l = [];
912
- for (let u = 0; u <= n; u += a)
913
- l.push({ time: u + c, value: e(u), easing: "linear" });
914
- const h = l[l.length - 1];
915
- return !h || h.time < n + c ? l.push({ time: n + c, value: r, easing: "linear" }) : h.value = r, c > 0 && l.unshift({ time: 0, value: s, easing: "linear" }), {
910
+ function Ae(t, e, n, s, r, a) {
911
+ const o = a.intervalMs ?? ke, i = a.tolerance ?? 0.01, c = t.delay ?? 0, h = [];
912
+ for (let u = 0; u <= n; u += o)
913
+ h.push({ time: u + c, value: e(u), easing: "linear" });
914
+ const l = h[h.length - 1];
915
+ return !l || l.time < n + c ? h.push({ time: n + c, value: r, easing: "linear" }) : l.value = r, c > 0 && h.unshift({ time: 0, value: s, easing: "linear" }), {
916
916
  id: t.id,
917
917
  target: t.target,
918
918
  property: t.property,
919
- keyframes: i > 0 ? Un(l, i) : l,
919
+ keyframes: i > 0 ? Jn(h, i) : h,
920
920
  ...t.targets && { targets: [...t.targets] },
921
921
  ...t.stagger && { stagger: { ...t.stagger } }
922
922
  };
923
923
  }
924
- function Yn(t, e, n, s = {}) {
925
- const r = s.intervalMs ?? Me, o = typeof n == "function" ? n : he(n), a = ye(t.value, s.interpolation), i = e.time - t.time;
924
+ function Kn(t, e, n, s = {}) {
925
+ const r = s.intervalMs ?? ke, a = typeof n == "function" ? n : Lt(n), o = Te(t.value, s.interpolation), i = e.time - t.time;
926
926
  if (i <= 0) return [e];
927
927
  const c = [];
928
- for (let h = r; h < i; h += r) {
929
- const u = h / i;
928
+ for (let l = r; l < i; l += r) {
929
+ const u = l / i;
930
930
  c.push({
931
- time: t.time + h,
932
- value: a(t.value, e.value, o(u)),
931
+ time: t.time + l,
932
+ value: o(t.value, e.value, a(u)),
933
933
  easing: "linear"
934
934
  });
935
935
  }
936
- const l = o(1);
937
- return c.push({ ...e, ...l !== 1 && { value: a(t.value, e.value, l) }, easing: "linear" }), c;
936
+ const h = a(1);
937
+ return c.push({ ...e, ...h !== 1 && { value: o(t.value, e.value, h) }, easing: "linear" }), c;
938
938
  }
939
- function Vs(t, e) {
940
- return V(t) ? _e(t, e) : j(t) ? be(t, e) : t;
939
+ function cr(t, e) {
940
+ return V(t) ? we(t, e) : U(t) ? ve(t, e) : t;
941
941
  }
942
- function zn(t, e = {}) {
942
+ function Zn(t, e = {}) {
943
943
  const n = t.keyframes;
944
- if (!n.some((o) => xt(o.easing))) return t;
944
+ if (!n.some((a) => At(a.easing))) return t;
945
945
  const s = n.length > 0 ? [n[0]] : [], r = { ...e, interpolation: t.interpolation ?? e.interpolation };
946
- for (let o = 1; o < n.length; o++) {
947
- const a = n[o];
948
- xt(a.easing) ? s.push(...Yn(n[o - 1], a, a.easing, r)) : s.push(a);
946
+ for (let a = 1; a < n.length; a++) {
947
+ const o = n[a];
948
+ At(o.easing) ? s.push(...Kn(n[a - 1], o, o.easing, r)) : s.push(o);
949
949
  }
950
950
  return { ...t, keyframes: s };
951
951
  }
952
- function Hs(t, e) {
953
- return t.filter(Ne).map((n) => zn(n, e)).concat(
954
- t.filter(V).map((n) => _e(n, e)),
955
- t.filter(j).map((n) => be(n, e))
952
+ function ur(t, e) {
953
+ return t.filter(Qe).map((n) => Zn(n, e)).concat(
954
+ t.filter(V).map((n) => we(n, e)),
955
+ t.filter(U).map((n) => ve(n, e))
956
956
  );
957
957
  }
958
- function Un(t, e) {
958
+ function Jn(t, e) {
959
959
  if (t.length <= 2) return t;
960
960
  const n = [t[0]];
961
961
  for (let s = 1; s < t.length - 1; s++) {
962
- const r = n[n.length - 1], o = t[s], a = t[s + 1], i = a.time - r.time;
962
+ const r = n[n.length - 1], a = t[s], o = t[s + 1], i = o.time - r.time;
963
963
  if (i <= 0) continue;
964
- const c = (o.time - r.time) / i, l = r.value + (a.value - r.value) * c;
965
- Math.abs(o.value - l) > e && n.push(o);
964
+ const c = (a.time - r.time) / i, h = r.value + (o.value - r.value) * c;
965
+ Math.abs(a.value - h) > e && n.push(a);
966
966
  }
967
967
  return n.push(t[t.length - 1]), n;
968
968
  }
969
- function jn(t) {
969
+ function ts(t) {
970
970
  const e = [...t.keyframes].sort((n, s) => n.time - s.time);
971
971
  return {
972
972
  ...t,
973
973
  keyframes: e
974
974
  };
975
975
  }
976
- function U(t) {
976
+ function j(t) {
977
977
  return t.targets && t.targets.length > 0 ? t.targets : [t.target];
978
978
  }
979
- function K(t, e, n, s) {
979
+ function G(t, e, n, s) {
980
980
  const r = n ?? 0;
981
- return !s || e <= 1 ? r : r + ae(t, e, s);
981
+ return !s || e <= 1 ? r : r + fe(t, e, s);
982
982
  }
983
- class _t {
983
+ class ut {
984
984
  track;
985
985
  targets;
986
986
  constructor(e) {
987
- this.track = e, this.targets = U(e);
987
+ this.track = e, this.targets = j(e);
988
988
  }
989
989
  /**
990
990
  * Get the interpolated value at a specific time.
@@ -993,7 +993,7 @@ class _t {
993
993
  * that need every target should use `getTargetValues`.
994
994
  */
995
995
  getValueAtTime(e) {
996
- return this.valueForOffset(e - K(0, this.targets.length, this.track.delay, this.track.stagger));
996
+ return this.valueForOffset(e - G(0, this.targets.length, this.track.delay, this.track.stagger));
997
997
  }
998
998
  /**
999
999
  * Every target's value at a specific time, in target order.
@@ -1004,8 +1004,8 @@ class _t {
1004
1004
  getTargetValues(e) {
1005
1005
  const n = this.targets.length, s = [];
1006
1006
  for (let r = 0; r < n; r++) {
1007
- const o = K(r, n, this.track.delay, this.track.stagger), a = this.valueForOffset(e - o);
1008
- a !== void 0 && s.push({ target: this.targets[r], value: a, start: o + this.track.keyframes[0].time });
1007
+ const a = G(r, n, this.track.delay, this.track.stagger), o = this.valueForOffset(e - a);
1008
+ o !== void 0 && s.push({ target: this.targets[r], value: o, start: a + this.track.keyframes[0].time });
1009
1009
  }
1010
1010
  return s;
1011
1011
  }
@@ -1017,7 +1017,7 @@ class _t {
1017
1017
  const { keyframes: e } = this.track;
1018
1018
  if (e.length === 0)
1019
1019
  return 0;
1020
- const n = e[e.length - 1].time, s = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1020
+ const n = e[e.length - 1].time, s = this.track.stagger ? Et(this.targets.length, this.track.stagger) : 0;
1021
1021
  return n + (this.track.delay ?? 0) + s + (this.track.endDelay ?? 0);
1022
1022
  }
1023
1023
  /**
@@ -1040,8 +1040,8 @@ class _t {
1040
1040
  return;
1041
1041
  if (s.time === e)
1042
1042
  return s.value;
1043
- const o = r.time - s.time, a = (e - s.time) / o, c = he(r.easing)(a);
1044
- return ye(s.value, this.track.interpolation)(s.value, r.value, c);
1043
+ const a = r.time - s.time, o = (e - s.time) / a, c = Lt(r.easing)(o);
1044
+ return Te(s.value, this.track.interpolation)(s.value, r.value, c);
1045
1045
  }
1046
1046
  /**
1047
1047
  * Find the keyframes surrounding a given time.
@@ -1054,107 +1054,107 @@ class _t {
1054
1054
  return { from: null, to: null };
1055
1055
  }
1056
1056
  }
1057
- class Vn {
1057
+ class es {
1058
1058
  track;
1059
1059
  targets;
1060
1060
  sampler;
1061
1061
  constructor(e) {
1062
- this.track = e, this.targets = U(e), this.sampler = new ut(e.spring);
1062
+ this.track = e, this.targets = j(e), this.sampler = new lt(e.spring);
1063
1063
  }
1064
1064
  getValueAtTime(e) {
1065
- return this.sampler.valueAt(e - K(0, this.targets.length, this.track.delay, this.track.stagger));
1065
+ return this.sampler.valueAt(e - G(0, this.targets.length, this.track.delay, this.track.stagger));
1066
1066
  }
1067
1067
  getTargetValues(e) {
1068
1068
  const n = this.targets.length, s = [];
1069
1069
  for (let r = 0; r < n; r++) {
1070
- const o = K(r, n, this.track.delay, this.track.stagger);
1071
- s.push({ target: this.targets[r], value: this.sampler.valueAt(e - o), start: o });
1070
+ const a = G(r, n, this.track.delay, this.track.stagger);
1071
+ s.push({ target: this.targets[r], value: this.sampler.valueAt(e - a), start: a });
1072
1072
  }
1073
1073
  return s;
1074
1074
  }
1075
1075
  /** Settle time plus delay and the widest stagger offset. */
1076
1076
  getDuration() {
1077
- const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1077
+ const e = this.track.stagger ? Et(this.targets.length, this.track.stagger) : 0;
1078
1078
  return this.sampler.settleTime() + (this.track.delay ?? 0) + e;
1079
1079
  }
1080
1080
  getTrack() {
1081
1081
  return this.track;
1082
1082
  }
1083
1083
  }
1084
- class Hn {
1084
+ class ns {
1085
1085
  track;
1086
1086
  targets;
1087
1087
  duration;
1088
1088
  constructor(e) {
1089
- this.track = e, this.targets = U(e), this.duration = ft(e.inertia);
1089
+ this.track = e, this.targets = j(e), this.duration = mt(e.inertia);
1090
1090
  }
1091
1091
  getValueAtTime(e) {
1092
- return kt(this.track.inertia, e - K(0, this.targets.length, this.track.delay, this.track.stagger));
1092
+ return St(this.track.inertia, e - G(0, this.targets.length, this.track.delay, this.track.stagger));
1093
1093
  }
1094
1094
  getTargetValues(e) {
1095
1095
  const n = this.targets.length, s = [];
1096
1096
  for (let r = 0; r < n; r++) {
1097
- const o = K(r, n, this.track.delay, this.track.stagger);
1098
- s.push({ target: this.targets[r], value: kt(this.track.inertia, e - o), start: o });
1097
+ const a = G(r, n, this.track.delay, this.track.stagger);
1098
+ s.push({ target: this.targets[r], value: St(this.track.inertia, e - a), start: a });
1099
1099
  }
1100
1100
  return s;
1101
1101
  }
1102
1102
  /** Settle time plus delay and the widest stagger offset. */
1103
1103
  getDuration() {
1104
- const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1104
+ const e = this.track.stagger ? Et(this.targets.length, this.track.stagger) : 0;
1105
1105
  return this.duration + (this.track.delay ?? 0) + e;
1106
1106
  }
1107
1107
  getTrack() {
1108
1108
  return this.track;
1109
1109
  }
1110
1110
  }
1111
- function xe(t, e) {
1112
- const n = { ...gn(t.pathData, e) };
1111
+ function Se(t, e) {
1112
+ const n = { ...An(t.pathData, e) };
1113
1113
  if (t.matrix) {
1114
- const [s, r, o, a, i, c] = t.matrix, { x: l, y: h } = n;
1115
- n.x = s * l + o * h + i, n.y = r * l + a * h + c;
1116
- const u = n.angle * Math.PI / 180, f = Math.cos(u), d = Math.sin(u);
1117
- n.angle = Math.atan2(r * f + a * d, s * f + o * d) * 180 / Math.PI;
1114
+ const [s, r, a, o, i, c] = t.matrix, { x: h, y: l } = n;
1115
+ n.x = s * h + a * l + i, n.y = r * h + o * l + c;
1116
+ const u = n.angle * Math.PI / 180, d = Math.cos(u), f = Math.sin(u);
1117
+ n.angle = Math.atan2(r * d + o * f, s * d + a * f) * 180 / Math.PI;
1118
1118
  }
1119
1119
  return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
1120
1120
  }
1121
- function Bs(t, e, n, s) {
1121
+ function hr(t, e, n, s) {
1122
1122
  const r = e + (n - e) * s;
1123
- return xe(t, r);
1123
+ return Se(t, r);
1124
1124
  }
1125
- const bt = {
1125
+ const wt = {
1126
1126
  upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
1127
1127
  lowerCase: "abcdefghijklmnopqrstuvwxyz",
1128
1128
  upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
1129
1129
  numbers: "0123456789"
1130
- }, Bn = 20;
1131
- function Wn(t) {
1132
- const e = bt[t ?? "upperCase"] ?? t ?? bt.upperCase, n = Array.from(e);
1133
- return n.length > 0 ? n : Array.from(bt.upperCase);
1130
+ }, ss = 20;
1131
+ function rs(t) {
1132
+ const e = wt[t ?? "upperCase"] ?? t ?? wt.upperCase, n = Array.from(e);
1133
+ return n.length > 0 ? n : Array.from(wt.upperCase);
1134
1134
  }
1135
- function Qn(t, e, n) {
1135
+ function as(t, e, n) {
1136
1136
  let s = (t | 0) ^ Math.imul(e + 1, 2654435761) ^ Math.imul(n + 1, 2246822507);
1137
1137
  return s = Math.imul(s ^ s >>> 16, 2146121005), s = Math.imul(s ^ s >>> 15, 2221713035), (s ^ s >>> 16) >>> 0;
1138
1138
  }
1139
- function Gn(t, e, n = 0) {
1140
- const s = t.from ?? "", r = t.to, o = Math.max(0, Math.min(1, e));
1141
- if (o <= 0) return s;
1142
- if (o >= 1) return r;
1143
- const a = Array.from(s), i = Array.from(r), c = t.rightToLeft ?? !1;
1139
+ function os(t, e, n = 0) {
1140
+ const s = t.from ?? "", r = t.to, a = Math.max(0, Math.min(1, e));
1141
+ if (a <= 0) return s;
1142
+ if (a >= 1) return r;
1143
+ const o = Array.from(s), i = Array.from(r), c = t.rightToLeft ?? !1;
1144
1144
  if (t.mode === "type") {
1145
- const y = Math.round(o * Math.max(a.length, i.length));
1146
- return c ? a.slice(0, Math.max(0, a.length - y)).join("") + i.slice(Math.max(0, i.length - y)).join("") : i.slice(0, y).join("") + a.slice(y).join("");
1145
+ const g = Math.round(a * Math.max(o.length, i.length));
1146
+ return c ? o.slice(0, Math.max(0, o.length - g)).join("") + i.slice(Math.max(0, i.length - g)).join("") : i.slice(0, g).join("") + o.slice(g).join("");
1147
1147
  }
1148
- const l = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), h = Math.max(0, (o - l) / (1 - l)), u = Math.floor(h * i.length), f = t.tweenLength === !1 ? i.length : Math.round(a.length + (i.length - a.length) * o), d = Wn(t.chars), m = t.refreshRate ?? Bn, p = m > 0 ? Math.floor(n * m / 1e3) : 0, g = t.seed ?? 1;
1149
- let M = "";
1150
- for (let y = 0; y < f; y++) {
1151
- const k = c ? y >= f - u : y < u, w = c ? i[i.length - (f - y)] : i[y];
1152
- k && w !== void 0 || w === " " || w === `
1153
- ` ? M += w : M += d[Qn(g, y, p) % d.length];
1148
+ const h = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (a - h) / (1 - h)), u = Math.floor(l * i.length), d = t.tweenLength === !1 ? i.length : Math.round(o.length + (i.length - o.length) * a), f = rs(t.chars), p = t.refreshRate ?? ss, m = p > 0 ? Math.floor(n * p / 1e3) : 0, M = t.seed ?? 1;
1149
+ let y = "";
1150
+ for (let g = 0; g < d; g++) {
1151
+ const _ = c ? g >= d - u : g < u, k = c ? i[i.length - (d - g)] : i[g];
1152
+ _ && k !== void 0 || k === " " || k === `
1153
+ ` ? y += k : y += f[as(M, g, m) % f.length];
1154
1154
  }
1155
- return M;
1155
+ return y;
1156
1156
  }
1157
- class ke {
1157
+ class Pe {
1158
1158
  id;
1159
1159
  name;
1160
1160
  _captions;
@@ -1284,8 +1284,8 @@ class ke {
1284
1284
  }
1285
1285
  this._wrapAfterDelay && (this._wrapAfterDelay = !1, this._currentTime = 0);
1286
1286
  }
1287
- const o = 1e3;
1288
- for (let i = 0; i < o && r > 0 && this._playbackState === "playing"; i++)
1287
+ const a = 1e3;
1288
+ for (let i = 0; i < a && r > 0 && this._playbackState === "playing"; i++)
1289
1289
  if (this._direction === "forward") {
1290
1290
  const c = n - this._currentTime;
1291
1291
  if (r >= c) {
@@ -1301,21 +1301,21 @@ class ke {
1301
1301
  } else
1302
1302
  this._currentTime -= r, r = 0;
1303
1303
  }
1304
- const a = this.getStateAtTime(this._currentTime);
1305
- this.onUpdate?.(a);
1304
+ const o = this.getStateAtTime(this._currentTime);
1305
+ this.onUpdate?.(o);
1306
1306
  }
1307
1307
  /**
1308
1308
  * Get the animation state at a specific time.
1309
1309
  */
1310
1310
  getStateAtTime(e) {
1311
1311
  const n = /* @__PURE__ */ new Map();
1312
- if (e = Xe(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
1312
+ if (e = Ge(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
1313
1313
  this._resolveShared(e, n);
1314
1314
  else
1315
1315
  for (const [s, r] of this._trackPlayers) {
1316
- const o = r.getTrack().property;
1317
- for (const { target: a, value: i, start: c } of r.getTargetValues(e))
1318
- this._write(n, s, a, o, i, e - c);
1316
+ const a = r.getTrack().property;
1317
+ for (const { target: o, value: i, start: c } of r.getTargetValues(e))
1318
+ this._write(n, s, o, a, i, e - c);
1319
1319
  }
1320
1320
  return {
1321
1321
  values: n,
@@ -1340,36 +1340,36 @@ class ke {
1340
1340
  */
1341
1341
  _resolveShared(e, n) {
1342
1342
  const s = /* @__PURE__ */ new Map();
1343
- for (const [r, o] of this._trackPlayers) {
1344
- const a = o.getTrack().property;
1345
- for (const { target: i, value: c, start: l } of o.getTargetValues(e)) {
1346
- const h = `${i}\0${a}`, u = l <= e, f = s.get(h);
1347
- (!f || (u !== f.started ? u : u ? l >= f.start : l <= f.start)) && s.set(h, { trackId: r, target: i, property: a, value: c, start: l, started: u });
1343
+ for (const [r, a] of this._trackPlayers) {
1344
+ const o = a.getTrack().property;
1345
+ for (const { target: i, value: c, start: h } of a.getTargetValues(e)) {
1346
+ const l = `${i}\0${o}`, u = h <= e, d = s.get(l);
1347
+ (!d || (u !== d.started ? u : u ? h >= d.start : h <= d.start)) && s.set(l, { trackId: r, target: i, property: o, value: c, start: h, started: u });
1348
1348
  }
1349
1349
  }
1350
- for (const { trackId: r, target: o, property: a, value: i, start: c } of s.values())
1351
- this._write(n, r, o, a, i, e - c);
1350
+ for (const { trackId: r, target: a, property: o, value: i, start: c } of s.values())
1351
+ this._write(n, r, a, o, i, e - c);
1352
1352
  }
1353
1353
  /**
1354
1354
  * Write one track's value for a target, expanding the progress of motion paths
1355
1355
  * (into x/y/rotation) and text tracks (into the string). `elapsed` is the time
1356
1356
  * since this target's animation on the track started.
1357
1357
  */
1358
- _write(e, n, s, r, o, a) {
1359
- if (o === void 0) return;
1358
+ _write(e, n, s, r, a, o) {
1359
+ if (a === void 0) return;
1360
1360
  let i = e.get(s);
1361
1361
  i || (i = /* @__PURE__ */ new Map(), e.set(s, i));
1362
1362
  const c = this._textTracks.get(n);
1363
- if (c && typeof o == "number") {
1364
- i.set("text", Gn(c.textConfig, o, Math.max(0, a)));
1363
+ if (c && typeof a == "number") {
1364
+ i.set("text", os(c.textConfig, a, Math.max(0, o)));
1365
1365
  return;
1366
1366
  }
1367
- const l = this._motionPathTracks.get(n);
1368
- if (l && typeof o == "number") {
1369
- const h = xe(l.motionPathConfig, o);
1370
- i.set("motionPathX", h.x), i.set("motionPathY", h.y), l.motionPathConfig.autoRotate && i.set("motionPathRotate", h.angle);
1367
+ const h = this._motionPathTracks.get(n);
1368
+ if (h && typeof a == "number") {
1369
+ const l = Se(h.motionPathConfig, a);
1370
+ i.set("motionPathX", l.x), i.set("motionPathY", l.y), h.motionPathConfig.autoRotate && i.set("motionPathRotate", l.angle);
1371
1371
  } else
1372
- i.set(r, o);
1372
+ i.set(r, a);
1373
1373
  }
1374
1374
  /** Cached: does any target+property have more than one track? */
1375
1375
  _sharedWrites = null;
@@ -1378,7 +1378,7 @@ class ke {
1378
1378
  const e = /* @__PURE__ */ new Set();
1379
1379
  this._sharedWrites = !1;
1380
1380
  t: for (const n of this._tracks)
1381
- for (const s of U(n)) {
1381
+ for (const s of j(n)) {
1382
1382
  const r = `${s}\0${n.property}`;
1383
1383
  if (e.has(r)) {
1384
1384
  this._sharedWrites = !0;
@@ -1393,17 +1393,17 @@ class ke {
1393
1393
  * Add a track to the timeline.
1394
1394
  */
1395
1395
  addTrack(e) {
1396
- if (this._tracks.push(e), this._sharedWrites = null, j(e)) {
1397
- this._trackPlayers.set(e.id, new Hn(e));
1396
+ if (this._tracks.push(e), this._sharedWrites = null, U(e)) {
1397
+ this._trackPlayers.set(e.id, new ns(e));
1398
1398
  return;
1399
1399
  }
1400
1400
  if (V(e)) {
1401
- this._trackPlayers.set(e.id, new Vn(e)), this._springTracks.set(e.id, e);
1401
+ this._trackPlayers.set(e.id, new es(e)), this._springTracks.set(e.id, e);
1402
1402
  return;
1403
1403
  }
1404
- if ($t(e))
1405
- this._trackPlayers.set(e.id, new _t(e)), this._textTracks.set(e.id, e);
1406
- else if (re(e)) {
1404
+ if (Dt(e))
1405
+ this._trackPlayers.set(e.id, new ut(e)), this._textTracks.set(e.id, e);
1406
+ else if (he(e)) {
1407
1407
  const n = {
1408
1408
  id: e.id,
1409
1409
  target: e.target,
@@ -1414,9 +1414,9 @@ class ke {
1414
1414
  targets: e.targets,
1415
1415
  stagger: e.stagger
1416
1416
  };
1417
- this._trackPlayers.set(e.id, new _t(n)), this._motionPathTracks.set(e.id, e);
1417
+ this._trackPlayers.set(e.id, new ut(n)), this._motionPathTracks.set(e.id, e);
1418
1418
  } else
1419
- this._trackPlayers.set(e.id, new _t(e));
1419
+ this._trackPlayers.set(e.id, new ut(e));
1420
1420
  }
1421
1421
  /**
1422
1422
  * Replace a track with a new version, keeping its place in the track order
@@ -1424,13 +1424,13 @@ class ke {
1424
1424
  * different id. Does nothing if no track has `trackId`.
1425
1425
  */
1426
1426
  replaceTrack(e, n) {
1427
- const s = this._tracks.findIndex((o) => o.id === e);
1427
+ const s = this._tracks.findIndex((a) => a.id === e);
1428
1428
  if (s < 0) return;
1429
1429
  const r = this._tracks.slice(s + 1);
1430
1430
  this.removeTrack(e);
1431
- for (const o of r) this.removeTrack(o.id);
1431
+ for (const a of r) this.removeTrack(a.id);
1432
1432
  this.addTrack(n);
1433
- for (const o of r) this.addTrack(o);
1433
+ for (const a of r) this.addTrack(a);
1434
1434
  }
1435
1435
  /**
1436
1436
  * Remove a track by its ID.
@@ -1467,11 +1467,11 @@ class ke {
1467
1467
  const n = this._trackPlayers.get(e);
1468
1468
  if (!n) return;
1469
1469
  const s = n.getTrack(), r = s.delay ?? 0;
1470
- if (V(s) || j(s))
1470
+ if (V(s) || U(s))
1471
1471
  return { from: r, to: n.getDuration() };
1472
- const o = s.keyframes;
1473
- if (!(!o || o.length === 0))
1474
- return { from: o[0].time + r, to: n.getDuration() };
1472
+ const a = s.keyframes;
1473
+ if (!(!a || a.length === 0))
1474
+ return { from: a[0].time + r, to: n.getDuration() };
1475
1475
  }
1476
1476
  /**
1477
1477
  * Overlapping writes to the same target+property.
@@ -1486,27 +1486,27 @@ class ke {
1486
1486
  for (let n = 0; n < this._tracks.length; n++) {
1487
1487
  const s = this._tracks[n], r = this.getTrackSpan(s.id);
1488
1488
  if (r)
1489
- for (let o = 0; o < n; o++) {
1490
- const a = this._tracks[o];
1491
- if (a.property !== s.property) continue;
1492
- const i = U(a).filter((u) => U(s).includes(u));
1489
+ for (let a = 0; a < n; a++) {
1490
+ const o = this._tracks[a];
1491
+ if (o.property !== s.property) continue;
1492
+ const i = j(o).filter((u) => j(s).includes(u));
1493
1493
  if (i.length === 0) continue;
1494
- const c = this.getTrackSpan(a.id);
1494
+ const c = this.getTrackSpan(o.id);
1495
1495
  if (!c || !(c.from <= r.to && r.from <= c.to)) continue;
1496
- const h = r.from >= c.from;
1496
+ const l = r.from >= c.from;
1497
1497
  for (const u of i)
1498
1498
  e.push({
1499
1499
  target: u,
1500
1500
  property: s.property,
1501
- losingTrackId: h ? a.id : s.id,
1502
- winningTrackId: h ? s.id : a.id
1501
+ losingTrackId: l ? o.id : s.id,
1502
+ winningTrackId: l ? s.id : o.id
1503
1503
  });
1504
1504
  }
1505
1505
  }
1506
1506
  return e;
1507
1507
  }
1508
1508
  _matches(e, n) {
1509
- if (n.id !== void 0 && e.id !== n.id || n.property !== void 0 && e.property !== n.property || n.target !== void 0 && !U(e).includes(n.target)) return !1;
1509
+ if (n.id !== void 0 && e.id !== n.id || n.property !== void 0 && e.property !== n.property || n.target !== void 0 && !j(e).includes(n.target)) return !1;
1510
1510
  if (n.timeRange) {
1511
1511
  const s = this.getTrackSpan(e.id);
1512
1512
  if (!s || s.to < n.timeRange.from || s.from > n.timeRange.to) return !1;
@@ -1518,7 +1518,7 @@ class ke {
1518
1518
  */
1519
1519
  toDefinition() {
1520
1520
  return {
1521
- formatVersion: se(this._tracks),
1521
+ formatVersion: ue(this._tracks),
1522
1522
  id: this.id,
1523
1523
  name: this.name,
1524
1524
  config: { ...this._config },
@@ -1536,7 +1536,7 @@ class ke {
1536
1536
  }
1537
1537
  /** Replace the markers (kept in time order); an empty list removes them. */
1538
1538
  setMarkers(e) {
1539
- const n = e && e.length > 0 ? [...e].sort((r, o) => r.time - o.time).map((r) => ({ ...r })) : void 0, s = { ...this._config };
1539
+ const n = e && e.length > 0 ? [...e].sort((r, a) => r.time - a.time).map((r) => ({ ...r })) : void 0, s = { ...this._config };
1540
1540
  n ? s.markers = n : delete s.markers, this._config = s;
1541
1541
  }
1542
1542
  /** Caption text per language, per marker id */
@@ -1576,73 +1576,73 @@ class ke {
1576
1576
  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);
1577
1577
  }
1578
1578
  }
1579
- const Kn = 100;
1580
- function Ws(t, e, n, s) {
1581
- const r = [], o = [], { duration: a, alternate: i } = s, c = (d, m, p, g) => {
1582
- o.push([d, m]);
1583
- const M = [];
1584
- t.forEach((y, k) => {
1585
- (p === "forward" ? (g ? y >= d : y > d) && y <= m : (g ? y <= d : y < d) && y >= m) && M.push(k);
1586
- }), M.sort((y, k) => (p === "forward" ? t[y] - t[k] : t[k] - t[y]) || y - k);
1587
- for (const y of M) r.push({ kind: "event", index: y, direction: p });
1579
+ const is = 100;
1580
+ function lr(t, e, n, s) {
1581
+ const r = [], a = [], { duration: o, alternate: i } = s, c = (f, p, m, M) => {
1582
+ a.push([f, p]);
1583
+ const y = [];
1584
+ t.forEach((g, _) => {
1585
+ (m === "forward" ? (M ? g >= f : g > f) && g <= p : (M ? g <= f : g < f) && g >= p) && y.push(_);
1586
+ }), y.sort((g, _) => (m === "forward" ? t[g] - t[_] : t[_] - t[g]) || g - _);
1587
+ for (const g of y) r.push({ kind: "event", index: g, direction: m });
1588
1588
  };
1589
- let l = e.time, h = e.direction, u = e.fresh === !0;
1590
- const f = Math.min(Kn, Math.max(0, n.iteration - e.iteration));
1591
- for (let d = 0; d < f; d++) {
1592
- const m = h === "forward" ? a : 0;
1593
- c(l, m, h, u), r.push({ kind: "repeat" }), i ? (h = h === "forward" ? "reverse" : "forward", l = m, u = !1) : (l = h === "forward" ? 0 : a, u = !0);
1589
+ let h = e.time, l = e.direction, u = e.fresh === !0;
1590
+ const d = Math.min(is, Math.max(0, n.iteration - e.iteration));
1591
+ for (let f = 0; f < d; f++) {
1592
+ const p = l === "forward" ? o : 0;
1593
+ c(h, p, l, u), r.push({ kind: "repeat" }), i ? (l = l === "forward" ? "reverse" : "forward", h = p, u = !1) : (h = l === "forward" ? 0 : o, u = !0);
1594
1594
  }
1595
- return f > 0 && s.holding && !i ? { crossings: r, passes: o } : (c(l, n.time, h, u), { crossings: r, passes: o });
1595
+ return d > 0 && s.holding && !i ? { crossings: r, passes: a } : (c(h, n.time, l, u), { crossings: r, passes: a });
1596
1596
  }
1597
- function Zn(t) {
1598
- return j(t) ? {
1597
+ function cs(t) {
1598
+ return U(t) ? {
1599
1599
  id: t.id,
1600
1600
  target: t.target,
1601
1601
  property: t.property,
1602
1602
  kind: "inertia",
1603
- inertia: we(t.inertia),
1604
- ...F(t)
1603
+ inertia: Ie(t.inertia),
1604
+ ...O(t)
1605
1605
  } : V(t) ? {
1606
1606
  id: t.id,
1607
1607
  target: t.target,
1608
1608
  property: t.property,
1609
1609
  kind: "spring",
1610
1610
  spring: { ...t.spring },
1611
- ...F(t)
1612
- } : $t(t) ? {
1611
+ ...O(t)
1612
+ } : Dt(t) ? {
1613
1613
  id: t.id,
1614
1614
  target: t.target,
1615
1615
  property: "text",
1616
1616
  textConfig: { ...t.textConfig },
1617
- keyframes: t.keyframes.map(Tt),
1618
- ...F(t)
1619
- } : re(t) ? {
1617
+ keyframes: t.keyframes.map(vt),
1618
+ ...O(t)
1619
+ } : he(t) ? {
1620
1620
  id: t.id,
1621
1621
  target: t.target,
1622
1622
  property: "motionPath",
1623
1623
  motionPathConfig: { ...t.motionPathConfig },
1624
- keyframes: t.keyframes.map(Tt),
1625
- ...F(t)
1624
+ keyframes: t.keyframes.map(vt),
1625
+ ...O(t)
1626
1626
  } : {
1627
1627
  id: t.id,
1628
1628
  target: t.target,
1629
1629
  property: t.property,
1630
- keyframes: t.keyframes.map(Tt),
1630
+ keyframes: t.keyframes.map(vt),
1631
1631
  ...t.interpolation !== void 0 && { interpolation: t.interpolation },
1632
- ...F(t)
1632
+ ...O(t)
1633
1633
  };
1634
1634
  }
1635
- function we(t) {
1635
+ function Ie(t) {
1636
1636
  return { ...t, ...Array.isArray(t.end) && { end: [...t.end] } };
1637
1637
  }
1638
- function Tt(t) {
1638
+ function vt(t) {
1639
1639
  return {
1640
1640
  time: t.time,
1641
1641
  value: t.value,
1642
1642
  ...t.easing && { easing: t.easing }
1643
1643
  };
1644
1644
  }
1645
- function F(t) {
1645
+ function O(t) {
1646
1646
  const e = t.endDelay;
1647
1647
  return {
1648
1648
  ...t.delay !== void 0 && { delay: t.delay },
@@ -1651,16 +1651,16 @@ function F(t) {
1651
1651
  ...t.stagger !== void 0 && { stagger: { ...t.stagger } }
1652
1652
  };
1653
1653
  }
1654
- function qn(t) {
1655
- if (j(t)) {
1654
+ function us(t) {
1655
+ if (U(t)) {
1656
1656
  const e = t;
1657
1657
  return {
1658
1658
  id: e.id,
1659
1659
  target: e.target,
1660
1660
  property: e.property,
1661
1661
  kind: "inertia",
1662
- inertia: we(e.inertia),
1663
- ...F(e)
1662
+ inertia: Ie(e.inertia),
1663
+ ...O(e)
1664
1664
  };
1665
1665
  }
1666
1666
  if (V(t)) {
@@ -1671,10 +1671,10 @@ function qn(t) {
1671
1671
  property: e.property,
1672
1672
  kind: "spring",
1673
1673
  spring: { ...e.spring },
1674
- ...F(e)
1674
+ ...O(e)
1675
1675
  };
1676
1676
  }
1677
- if ($t(t)) {
1677
+ if (Dt(t)) {
1678
1678
  const e = t;
1679
1679
  return {
1680
1680
  id: e.id,
@@ -1682,7 +1682,7 @@ function qn(t) {
1682
1682
  property: "text",
1683
1683
  textConfig: { ...e.textConfig },
1684
1684
  keyframes: [...e.keyframes].sort((n, s) => n.time - s.time),
1685
- ...F(e)
1685
+ ...O(e)
1686
1686
  };
1687
1687
  }
1688
1688
  if (t.property === "motionPath" && "motionPathConfig" in t) {
@@ -1693,22 +1693,22 @@ function qn(t) {
1693
1693
  property: "motionPath",
1694
1694
  motionPathConfig: { ...e.motionPathConfig },
1695
1695
  keyframes: n,
1696
- ...F(e)
1696
+ ...O(e)
1697
1697
  };
1698
1698
  }
1699
- return jn({
1699
+ return ts({
1700
1700
  id: t.id,
1701
1701
  target: t.target,
1702
1702
  property: t.property,
1703
1703
  keyframes: t.keyframes,
1704
1704
  ...t.interpolation !== void 0 && { interpolation: t.interpolation },
1705
- ...F(t)
1705
+ ...O(t)
1706
1706
  });
1707
1707
  }
1708
- function Jn(t) {
1708
+ function hs(t) {
1709
1709
  const e = t._config.markers;
1710
1710
  return {
1711
- formatVersion: se(t.tracks),
1711
+ formatVersion: ue(t.tracks),
1712
1712
  id: t.id,
1713
1713
  name: t.name,
1714
1714
  config: {
@@ -1720,38 +1720,38 @@ function Jn(t) {
1720
1720
  ...t._config.drawingRate ? { drawingRate: t._config.drawingRate } : {},
1721
1721
  ...e && { markers: e.map((n) => ({ ...n })) }
1722
1722
  },
1723
- tracks: t.tracks.map(Zn),
1723
+ tracks: t.tracks.map(cs),
1724
1724
  ...t.captions && { captions: JSON.parse(JSON.stringify(t.captions)) }
1725
1725
  };
1726
1726
  }
1727
- function ts(t) {
1727
+ function ls(t) {
1728
1728
  const e = t.formatVersion ?? 1;
1729
- if (e > Xt)
1729
+ if (e > Vt)
1730
1730
  throw new Error(
1731
- `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Xt}. Update tinyfly to play it.`
1731
+ `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Vt}. Update tinyfly to play it.`
1732
1732
  );
1733
- return new ke({
1733
+ return new Pe({
1734
1734
  id: t.id,
1735
1735
  name: t.name,
1736
1736
  config: t.config,
1737
- tracks: t.tracks.map(qn),
1737
+ tracks: t.tracks.map(us),
1738
1738
  captions: t.captions
1739
1739
  });
1740
1740
  }
1741
- function Qs(t) {
1742
- return JSON.stringify(Jn(t));
1741
+ function fr(t) {
1742
+ return JSON.stringify(hs(t));
1743
1743
  }
1744
- function Gs(t) {
1744
+ function dr(t) {
1745
1745
  const e = JSON.parse(t);
1746
- return ts(e);
1746
+ return ls(e);
1747
1747
  }
1748
- function Ks(t) {
1748
+ function fs(t) {
1749
1749
  let e = 2166136261;
1750
1750
  for (let n = 0; n < t.length; n++)
1751
1751
  e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
1752
1752
  return e >>> 0;
1753
1753
  }
1754
- function Se(t) {
1754
+ function $e(t) {
1755
1755
  let e = t >>> 0 || 2654435769;
1756
1756
  return {
1757
1757
  seed: t >>> 0,
@@ -1760,28 +1760,28 @@ function Se(t) {
1760
1760
  }
1761
1761
  };
1762
1762
  }
1763
- function Ae(t, e, n) {
1763
+ function Re(t, e, n) {
1764
1764
  return e + t.next() * (n - e);
1765
1765
  }
1766
- function es(t, e, n, s) {
1767
- if (s <= 0) return Ae(t, e, n);
1768
- const r = Math.floor((n - e) / s), o = Math.round(t.next() * r);
1769
- return e + o * s;
1766
+ function ds(t, e, n, s) {
1767
+ if (s <= 0) return Re(t, e, n);
1768
+ const r = Math.floor((n - e) / s), a = Math.round(t.next() * r);
1769
+ return e + a * s;
1770
1770
  }
1771
- function Zs(t, e) {
1771
+ function mr(t, e) {
1772
1772
  if (e.length !== 0)
1773
1773
  return e[Math.floor(t.next() * e.length)];
1774
1774
  }
1775
- const ve = /^([+\-*/])=\s*(-?[\d.]+)$/, Pe = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1776
- function qs(t) {
1777
- return typeof t != "string" ? !1 : ve.test(t.trim()) || Pe.test(t.trim());
1775
+ const Ce = /^([+\-*/])=\s*(-?[\d.]+)$/, De = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1776
+ function pr(t) {
1777
+ return typeof t != "string" ? !1 : Ce.test(t.trim()) || De.test(t.trim());
1778
1778
  }
1779
- function $e(t, e = {}) {
1779
+ function Ee(t, e = {}) {
1780
1780
  if (typeof t != "string") return t;
1781
- const n = t.trim(), s = ve.exec(n);
1781
+ const n = t.trim(), s = Ce.exec(n);
1782
1782
  if (s) {
1783
- const [, o, a] = s, i = e.base ?? 0, c = Number.parseFloat(a);
1784
- switch (o) {
1783
+ const [, a, o] = s, i = e.base ?? 0, c = Number.parseFloat(o);
1784
+ switch (a) {
1785
1785
  case "+":
1786
1786
  return i + c;
1787
1787
  case "-":
@@ -1792,481 +1792,805 @@ function $e(t, e = {}) {
1792
1792
  return c === 0 ? i : i / c;
1793
1793
  }
1794
1794
  }
1795
- const r = Pe.exec(n);
1795
+ const r = De.exec(n);
1796
1796
  if (r) {
1797
1797
  if (!e.random)
1798
1798
  throw new Error(
1799
1799
  `resolveValue: "${n}" needs a random source — pass one via context.random`
1800
1800
  );
1801
- const o = Number.parseFloat(r[1]), a = Number.parseFloat(r[2]), i = r[3] !== void 0 ? Number.parseFloat(r[3]) : void 0;
1802
- return i !== void 0 ? es(e.random, o, a, i) : Ae(e.random, o, a);
1801
+ const a = Number.parseFloat(r[1]), o = Number.parseFloat(r[2]), i = r[3] !== void 0 ? Number.parseFloat(r[3]) : void 0;
1802
+ return i !== void 0 ? ds(e.random, a, o, i) : Re(e.random, a, o);
1803
1803
  }
1804
1804
  return t;
1805
1805
  }
1806
- function ns(t, e = 0, n) {
1806
+ function ms(t, e = 0, n) {
1807
1807
  const s = [];
1808
1808
  let r = e;
1809
- for (const o of t) {
1810
- const a = $e(o, { base: r, random: n });
1811
- s.push(a), typeof a == "number" && (r = a);
1809
+ for (const a of t) {
1810
+ const o = Ee(a, { base: r, random: n });
1811
+ s.push(o), typeof o == "number" && (r = o);
1812
1812
  }
1813
1813
  return s;
1814
1814
  }
1815
- class Js {
1815
+ class gr {
1816
1816
  random;
1817
1817
  constructor(e) {
1818
- this.random = Se(e);
1818
+ this.random = $e(e);
1819
1819
  }
1820
1820
  /** The seed, to be stored alongside the timeline so this can be reproduced. */
1821
1821
  get seed() {
1822
1822
  return this.random.seed;
1823
1823
  }
1824
1824
  resolve(e, n = 0) {
1825
- return $e(e, { base: n, random: this.random });
1825
+ return Ee(e, { base: n, random: this.random });
1826
1826
  }
1827
1827
  resolveSequence(e, n = 0) {
1828
- return ns(e, n, this.random);
1828
+ return ms(e, n, this.random);
1829
1829
  }
1830
1830
  }
1831
- const ss = 600;
1832
- function tr(t) {
1831
+ const ps = 600;
1832
+ function yr(t) {
1833
1833
  if (Array.isArray(t)) {
1834
- const [f, d, m, p] = t;
1835
- return { fn: ee(f, d, m, p), bezier: [f, d, m, p] };
1834
+ const [d, f, p, m] = t;
1835
+ return { fn: oe(d, f, p, m), bezier: [d, f, p, m] };
1836
1836
  }
1837
- const { segments: e } = G(t);
1837
+ const { segments: e } = Q(t);
1838
1838
  if (e.length === 0) throw new Error(`customEase: no curve in "${t}"`);
1839
- const n = e[0].startX, s = e[0].startY, r = e[e.length - 1], o = r.endX - n, a = r.endY - s;
1840
- if (o === 0 || a === 0) throw new Error(`customEase: "${t}" must move along both axes`);
1841
- const i = (f) => (f - n) / o, c = (f) => (f - s) / a;
1839
+ const n = e[0].startX, s = e[0].startY, r = e[e.length - 1], a = r.endX - n, o = r.endY - s;
1840
+ if (a === 0 || o === 0) throw new Error(`customEase: "${t}" must move along both axes`);
1841
+ const i = (d) => (d - n) / a, c = (d) => (d - s) / o;
1842
1842
  if (e.length === 1 && r.type === "C") {
1843
- const [f, d, m, p] = r.points, g = [i(f), c(d), i(m), c(p)];
1844
- return { fn: ee(...g), bezier: g };
1845
- }
1846
- const l = [], h = [], u = Math.max(8, Math.ceil(ss / e.length));
1847
- for (const f of e)
1848
- for (let d = l.length === 0 ? 0 : 1; d <= u; d++) {
1849
- const [m, p] = rs(f, d / u);
1850
- l.push(i(m)), h.push(c(p));
1843
+ const [d, f, p, m] = r.points, M = [i(d), c(f), i(p), c(m)];
1844
+ return { fn: oe(...M), bezier: M };
1845
+ }
1846
+ const h = [], l = [], u = Math.max(8, Math.ceil(ps / e.length));
1847
+ for (const d of e)
1848
+ for (let f = h.length === 0 ? 0 : 1; f <= u; f++) {
1849
+ const [p, m] = gs(d, f / u);
1850
+ h.push(i(p)), l.push(c(m));
1851
1851
  }
1852
- return { fn: os(l, h) };
1852
+ return { fn: ys(h, l) };
1853
1853
  }
1854
- function er(t = {}) {
1854
+ function Mr(t = {}) {
1855
1855
  const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, s = [1];
1856
- for (let o = n; o > 2e-3; o *= n) s.push(2 * Math.sqrt(o));
1857
- const r = s.reduce((o, a) => o + a, 0);
1858
- return (o) => {
1859
- if (o <= 0) return 0;
1860
- if (o >= 1) return 1;
1861
- let a = o * r;
1856
+ for (let a = n; a > 2e-3; a *= n) s.push(2 * Math.sqrt(a));
1857
+ const r = s.reduce((a, o) => a + o, 0);
1858
+ return (a) => {
1859
+ if (a <= 0) return 0;
1860
+ if (a >= 1) return 1;
1861
+ let o = a * r;
1862
1862
  for (let i = 0; i < s.length; i++) {
1863
- if (a <= s[i]) {
1864
- if (i === 0) return (a / s[0]) ** 2;
1865
- const c = s[i] / 2, l = c * c, h = a - c;
1866
- return 1 - (l - h * h);
1863
+ if (o <= s[i]) {
1864
+ if (i === 0) return (o / s[0]) ** 2;
1865
+ const c = s[i] / 2, h = c * c, l = o - c;
1866
+ return 1 - (h - l * l);
1867
1867
  }
1868
- a -= s[i];
1868
+ o -= s[i];
1869
1869
  }
1870
1870
  return 1;
1871
1871
  };
1872
1872
  }
1873
- function nr(t = {}) {
1873
+ function xr(t = {}) {
1874
1874
  const e = Math.max(1, t.wiggles ?? 10), n = t.type ?? "easeOut", s = (r) => n === "uniform" ? 1 : n === "easeInOut" ? Math.sin(Math.PI * r) : (1 - r) ** 2;
1875
1875
  return (r) => r <= 0 || r >= 1 ? 0 : Math.sin(r * e * Math.PI * 2) * s(r);
1876
1876
  }
1877
- function rs(t, e) {
1877
+ function gs(t, e) {
1878
1878
  if (t.type === "L") {
1879
- const [l, h] = t.points;
1880
- return [t.startX + (l - t.startX) * e, t.startY + (h - t.startY) * e];
1879
+ const [h, l] = t.points;
1880
+ return [t.startX + (h - t.startX) * e, t.startY + (l - t.startY) * e];
1881
1881
  }
1882
- const [n, s, r, o, a, i] = t.points, c = 1 - e;
1882
+ const [n, s, r, a, o, i] = t.points, c = 1 - e;
1883
1883
  return [
1884
- c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * r + e * e * e * a,
1885
- c * c * c * t.startY + 3 * c * c * e * s + 3 * c * e * e * o + e * e * e * i
1884
+ c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * r + e * e * e * o,
1885
+ c * c * c * t.startY + 3 * c * c * e * s + 3 * c * e * e * a + e * e * e * i
1886
1886
  ];
1887
1887
  }
1888
- function os(t, e) {
1888
+ function ys(t, e) {
1889
1889
  return (n) => {
1890
1890
  if (n <= t[0]) return e[0];
1891
1891
  if (n >= t[t.length - 1]) return e[e.length - 1];
1892
1892
  let s = 0, r = t.length - 1;
1893
1893
  for (; r - s > 1; ) {
1894
- const a = s + r >> 1;
1895
- t[a] <= n ? s = a : r = a;
1894
+ const o = s + r >> 1;
1895
+ t[o] <= n ? s = o : r = o;
1896
1896
  }
1897
- const o = t[r] - t[s];
1898
- return o === 0 ? e[r] : e[s] + (n - t[s]) / o * (e[r] - e[s]);
1897
+ const a = t[r] - t[s];
1898
+ return a === 0 ? e[r] : e[s] + (n - t[s]) / a * (e[r] - e[s]);
1899
1899
  };
1900
1900
  }
1901
- function ee(t, e, n, s) {
1902
- const r = (a, i, c) => 3 * (1 - a) * (1 - a) * a * i + 3 * (1 - a) * a * a * c + a * a * a, o = (a, i, c) => 3 * (1 - a) * (1 - a) * i + 6 * (1 - a) * a * (c - i) + 3 * a * a * (1 - c);
1903
- return (a) => {
1904
- if (a <= 0) return 0;
1905
- if (a >= 1) return 1;
1906
- let i = a;
1907
- for (let h = 0; h < 8; h++) {
1908
- const u = r(i, t, n) - a, f = o(i, t, n);
1901
+ function oe(t, e, n, s) {
1902
+ const r = (o, i, c) => 3 * (1 - o) * (1 - o) * o * i + 3 * (1 - o) * o * o * c + o * o * o, a = (o, i, c) => 3 * (1 - o) * (1 - o) * i + 6 * (1 - o) * o * (c - i) + 3 * o * o * (1 - c);
1903
+ return (o) => {
1904
+ if (o <= 0) return 0;
1905
+ if (o >= 1) return 1;
1906
+ let i = o;
1907
+ for (let l = 0; l < 8; l++) {
1908
+ const u = r(i, t, n) - o, d = a(i, t, n);
1909
1909
  if (Math.abs(u) < 1e-6) return r(i, e, s);
1910
- if (Math.abs(f) < 1e-6) break;
1911
- i -= u / f;
1910
+ if (Math.abs(d) < 1e-6) break;
1911
+ i -= u / d;
1912
1912
  }
1913
- let c = 0, l = 1;
1914
- i = a;
1915
- for (let h = 0; h < 40; h++)
1916
- r(i, t, n) < a ? c = i : l = i, i = (c + l) / 2;
1913
+ let c = 0, h = 1;
1914
+ i = o;
1915
+ for (let l = 0; l < 40; l++)
1916
+ r(i, t, n) < o ? c = i : h = i, i = (c + h) / 2;
1917
1917
  return r(i, e, s);
1918
1918
  };
1919
1919
  }
1920
- const as = 350, is = 300, cs = 550;
1921
- function sr(t, e = {}) {
1922
- const n = e.lead ?? as, s = e.gap ?? is, r = e.tail ?? cs, o = [];
1923
- let a = 0;
1920
+ const Ms = 350, xs = 300, _s = 550;
1921
+ function _r(t, e = {}) {
1922
+ const n = e.lead ?? Ms, s = e.gap ?? xs, r = e.tail ?? _s, a = [];
1923
+ let o = 0;
1924
1924
  return t.forEach((i, c) => {
1925
- const l = [];
1926
- let h = a + n;
1927
- i.lines.forEach((f, d) => {
1928
- if (!(f.duration >= 0))
1929
- throw new Error(`narration: scene ${c} line ${d} has an invalid duration (${f.duration})`);
1930
- d > 0 && (h += s), l.push({
1931
- id: f.id ?? `s${c}-l${d}`,
1925
+ const h = [];
1926
+ let l = o + n;
1927
+ i.lines.forEach((d, f) => {
1928
+ if (!(d.duration >= 0))
1929
+ throw new Error(`narration: scene ${c} line ${f} has an invalid duration (${d.duration})`);
1930
+ f > 0 && (l += s), h.push({
1931
+ id: d.id ?? `s${c}-l${f}`,
1932
1932
  scene: c,
1933
- line: d,
1934
- start: h,
1935
- end: h + f.duration,
1936
- text: f.text
1937
- }), h += f.duration;
1933
+ line: f,
1934
+ start: l,
1935
+ end: l + d.duration,
1936
+ text: d.text
1937
+ }), l += d.duration;
1938
1938
  });
1939
- const u = h + r + (i.tail ?? 0);
1940
- o.push({ id: i.id ?? `s${c}`, start: a, duration: u - a, cues: l }), a = u;
1941
- }), { duration: a, scenes: o, cues: o.flatMap((i) => i.cues) };
1939
+ const u = l + r + (i.tail ?? 0);
1940
+ a.push({ id: i.id ?? `s${c}`, start: o, duration: u - o, cues: h }), o = u;
1941
+ }), { duration: o, scenes: a, cues: a.flatMap((i) => i.cues) };
1942
1942
  }
1943
- function rr(t) {
1943
+ function br(t) {
1944
1944
  return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
1945
1945
  }
1946
- function or(t, e) {
1946
+ function Tr(t, e) {
1947
1947
  let n = t.scenes[0];
1948
1948
  for (const s of t.scenes)
1949
1949
  if (e >= s.start) n = s;
1950
1950
  else break;
1951
1951
  return n;
1952
1952
  }
1953
- const Re = (t) => 6e4 / t.bpm;
1954
- function Dt(t, e) {
1955
- return t.offset + e * Re(t);
1953
+ const pt = (t) => 6e4 / t.bpm;
1954
+ function Ot(t, e) {
1955
+ return t.offset + e * pt(t);
1956
1956
  }
1957
- function It(t, e) {
1958
- return (e - t.offset) / Re(t);
1957
+ function gt(t, e) {
1958
+ return (e - t.offset) / pt(t);
1959
1959
  }
1960
- function ar(t, e) {
1961
- return Dt(t, Math.round(It(t, e)));
1960
+ function kr(t, e) {
1961
+ return Ot(t, Math.round(gt(t, e)));
1962
1962
  }
1963
- function ir(t, e) {
1964
- return Dt(t, Math.ceil(It(t, e) - 1e-9));
1963
+ function wr(t, e) {
1964
+ return Ot(t, Math.ceil(gt(t, e) - 1e-9));
1965
1965
  }
1966
- function cr(t, e, n) {
1966
+ function vr(t, e, n) {
1967
1967
  const s = Math.max(1, Math.round(t.beatsPerBar ?? 4)), r = [];
1968
1968
  if (!(t.bpm > 0) || n < e) return r;
1969
- for (let o = Math.ceil(It(t, e) - 1e-9); ; o++) {
1970
- const a = Dt(t, o);
1971
- if (a > n + 1e-9) break;
1972
- r.push({ time: a, bar: (o % s + s) % s === 0, n: o });
1969
+ for (let a = Math.ceil(gt(t, e) - 1e-9); ; a++) {
1970
+ const o = Ot(t, a);
1971
+ if (o > n + 1e-9) break;
1972
+ r.push({ time: o, bar: (a % s + s) % s === 0, n: a });
1973
1973
  }
1974
1974
  return r;
1975
1975
  }
1976
- const B = 100;
1977
- function ur(t, e, n = {}) {
1978
- const s = n.minBpm ?? 70, r = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), a = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), i = Math.floor(a / o);
1976
+ const H = 100;
1977
+ function Ar(t, e, n = {}) {
1978
+ const s = n.minBpm ?? 70, r = n.maxBpm ?? 180, a = Math.max(1, Math.round(e / H)), o = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), i = Math.floor(o / a);
1979
1979
  if (i < 4) return { bpm: 120, offset: 0, confidence: 0 };
1980
1980
  const c = new Float64Array(i);
1981
- for (let _ = 0; _ < i; _++) {
1981
+ for (let b = 0; b < i; b++) {
1982
1982
  let T = 0;
1983
- for (let x = _ * o; x < (_ + 1) * o; x++) T += t[x] * t[x];
1984
- c[_] = Math.log(1e-6 + T / o);
1985
- }
1986
- const l = new Float64Array(i);
1987
- for (let _ = 1; _ < i; _++) l[_] = Math.max(0, c[_] - c[_ - 1]);
1988
- const h = l.reduce((_, T) => _ + T, 0) / i;
1989
- for (let _ = 0; _ < i; _++) l[_] = Math.max(0, l[_] - h);
1990
- const u = Math.max(1, Math.floor(60 * B / r)), f = Math.min(i - 1, Math.ceil(60 * B / s)), d = (_) => {
1983
+ for (let v = b * a; v < (b + 1) * a; v++) T += t[v] * t[v];
1984
+ c[b] = Math.log(1e-6 + T / a);
1985
+ }
1986
+ const h = new Float64Array(i);
1987
+ for (let b = 1; b < i; b++) h[b] = Math.max(0, c[b] - c[b - 1]);
1988
+ const l = h.reduce((b, T) => b + T, 0) / i;
1989
+ for (let b = 0; b < i; b++) h[b] = Math.max(0, h[b] - l);
1990
+ const u = Math.max(1, Math.floor(60 * H / r)), d = Math.min(i - 1, Math.ceil(60 * H / s)), f = (b) => {
1991
1991
  let T = 0;
1992
- for (let x = _; x < i; x++) T += l[x] * l[x - _];
1993
- return T / (i - _);
1992
+ for (let v = b; v < i; v++) T += h[v] * h[v - b];
1993
+ return T / (i - b);
1994
1994
  };
1995
- let m = 0;
1996
- for (let _ = 0; _ < i; _++) m += l[_] * l[_];
1997
- m /= i;
1998
- let p = u, g = -1 / 0;
1999
- for (let _ = u; _ <= f; _++) {
2000
- const T = 60 * B / _, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = d(_) * x;
2001
- S > g && (g = S, p = _);
2002
- }
2003
- const M = (_) => {
2004
- const T = Math.floor(_);
2005
- return T < 0 || T + 1 >= i ? 0 : l[T] + (l[T + 1] - l[T]) * (_ - T);
2006
- }, y = (_, T) => {
2007
- let x = 0;
2008
- for (let S = T; S < i; S += _) x += M(S);
2009
- return x;
1995
+ let p = 0;
1996
+ for (let b = 0; b < i; b++) p += h[b] * h[b];
1997
+ p /= i;
1998
+ let m = u, M = -1 / 0;
1999
+ for (let b = u; b <= d; b++) {
2000
+ const T = 60 * H / b, v = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = f(b) * v;
2001
+ S > M && (M = S, m = b);
2002
+ }
2003
+ const y = (b) => {
2004
+ const T = Math.floor(b);
2005
+ return T < 0 || T + 1 >= i ? 0 : h[T] + (h[T + 1] - h[T]) * (b - T);
2006
+ }, g = (b, T) => {
2007
+ let v = 0;
2008
+ for (let S = T; S < i; S += b) v += y(S);
2009
+ return v;
2010
2010
  };
2011
- let k = p, w = 0, b = -1 / 0;
2012
- for (let _ = p - 0.6; _ <= p + 0.6 + 1e-9; _ += 0.02) {
2013
- if (_ < 1) continue;
2014
- const T = Math.max(1, Math.round(_ * 4));
2015
- for (let x = 0; x < T; x++) {
2016
- const S = x / T * _, $ = y(_, S);
2017
- $ > b && (b = $, w = S, k = _);
2011
+ let _ = m, k = 0, x = -1 / 0;
2012
+ for (let b = m - 0.6; b <= m + 0.6 + 1e-9; b += 0.02) {
2013
+ if (b < 1) continue;
2014
+ const T = Math.max(1, Math.round(b * 4));
2015
+ for (let v = 0; v < T; v++) {
2016
+ const S = v / T * b, $ = g(b, S);
2017
+ $ > x && (x = $, k = S, _ = b);
2018
2018
  }
2019
2019
  }
2020
- const v = 60 * B / k, A = m > 0 ? Math.max(0, Math.min(1, d(p) / m)) : 0, C = (w + 0.5) * 1e3 / B;
2021
- return { bpm: Math.round(v * 100) / 100, offset: Math.round(C % (6e4 / v)), confidence: A };
2022
- }
2023
- const us = 600, ls = 250, ne = 1;
2024
- function lr(t, e) {
2025
- const n = e.target ?? "Camera", s = { x: e.stage.width / 2, y: e.stage.height / 2 }, r = {}, o = (u, f, d, m) => {
2026
- const p = r[u] ??= [];
2027
- for (; p.length > 0 && p[p.length - 1].time >= f; ) p.pop();
2028
- p.push({ time: f, value: d, ...m ? { easing: m } : {} });
2029
- }, a = (u) => {
2030
- const f = u.rotate * Math.PI / 180, d = (u.focusX - s.x) * u.scale, m = (u.focusY - s.y) * u.scale;
2020
+ const A = 60 * H / _, w = p > 0 ? Math.max(0, Math.min(1, f(m) / p)) : 0, P = (k + 0.5) * 1e3 / H;
2021
+ return { bpm: Math.round(A * 100) / 100, offset: Math.round(P % (6e4 / A)), confidence: w };
2022
+ }
2023
+ const bs = 600, Ts = 250, ie = 1;
2024
+ function Sr(t, e) {
2025
+ const n = e.target ?? "Camera", s = { x: e.stage.width / 2, y: e.stage.height / 2 }, r = {}, a = (u, d, f, p) => {
2026
+ const m = r[u] ??= [];
2027
+ for (; m.length > 0 && m[m.length - 1].time >= d; ) m.pop();
2028
+ m.push({ time: d, value: f, ...p ? { easing: p } : {} });
2029
+ }, o = (u) => {
2030
+ const d = u.rotate * Math.PI / 180, f = (u.focusX - s.x) * u.scale, p = (u.focusY - s.y) * u.scale;
2031
2031
  return {
2032
- x: -(d * Math.cos(f) - m * Math.sin(f)),
2033
- y: -(d * Math.sin(f) + m * Math.cos(f)),
2032
+ x: -(f * Math.cos(d) - p * Math.sin(d)),
2033
+ y: -(f * Math.sin(d) + p * Math.cos(d)),
2034
2034
  scale: u.scale,
2035
2035
  rotate: u.rotate
2036
2036
  };
2037
- }, i = (u, f, d) => {
2038
- const m = a(f);
2039
- for (const p of ["x", "y", "scale", "rotate"]) o(p, u, m[p], d);
2037
+ }, i = (u, d, f) => {
2038
+ const p = o(d);
2039
+ for (const m of ["x", "y", "scale", "rotate"]) a(m, u, p[m], f);
2040
2040
  };
2041
2041
  let c = { focusX: s.x, focusY: s.y, scale: 1, rotate: 0 };
2042
- const l = [...t].sort((u, f) => u.at - f.at), h = l.filter((u) => !("shake" in u));
2043
- h.length > 0 && i(0, c);
2044
- for (const u of h)
2042
+ const h = [...t].sort((u, d) => u.at - d.at), l = h.filter((u) => !("shake" in u));
2043
+ l.length > 0 && i(0, c);
2044
+ for (const u of l)
2045
2045
  if ("frame" in u) {
2046
- const f = Math.max(ne, u.duration ?? us);
2046
+ const d = Math.max(ie, u.duration ?? bs);
2047
2047
  i(u.at, c), c = {
2048
2048
  focusX: u.frame.focus?.x ?? s.x,
2049
2049
  focusY: u.frame.focus?.y ?? s.y,
2050
2050
  scale: u.frame.scale ?? 1,
2051
2051
  rotate: u.frame.rotate ?? 0
2052
- }, i(u.at + f, c, u.easing ?? (f > ne ? "ease-in-out" : void 0));
2052
+ }, i(u.at + d, c, u.easing ?? (d > ie ? "ease-in-out" : void 0));
2053
2053
  } else {
2054
- const { follow: f } = u, d = f.lag ?? ls, m = new ke({ id: "follow", tracks: [{ id: "x", target: "s", property: "x", keyframes: f.x }] }), p = (y) => m.getStateAtTime(y).values.get("s")?.get("x") ?? c.focusX, g = [u.at, ...f.x.map((y) => y.time).filter((y) => y > u.at && y < u.until), u.until];
2054
+ const { follow: d } = u, f = d.lag ?? Ts, p = new Pe({ id: "follow", tracks: [{ id: "x", target: "s", property: "x", keyframes: d.x }] }), m = (g) => p.getStateAtTime(g).values.get("s")?.get("x") ?? c.focusX, M = [u.at, ...d.x.map((g) => g.time).filter((g) => g > u.at && g < u.until), u.until];
2055
2055
  i(u.at, c);
2056
- const M = (y) => ({
2057
- focusX: p(y) + (f.lead ?? 0),
2058
- focusY: f.y ?? c.focusY,
2059
- scale: f.scale ?? c.scale,
2056
+ const y = (g) => ({
2057
+ focusX: m(g) + (d.lead ?? 0),
2058
+ focusY: d.y ?? c.focusY,
2059
+ scale: d.scale ?? c.scale,
2060
2060
  rotate: c.rotate
2061
2061
  });
2062
- for (const y of g) {
2063
- const k = f.x.find((w) => w.time === y)?.easing;
2064
- i(y + d, M(y), y === u.at ? "ease-in-out" : k);
2062
+ for (const g of M) {
2063
+ const _ = d.x.find((k) => k.time === g)?.easing;
2064
+ i(g + f, y(g), g === u.at ? "ease-in-out" : _);
2065
2065
  }
2066
- c = M(u.until);
2066
+ c = y(u.until);
2067
2067
  }
2068
- for (const u of l.filter((f) => "shake" in f)) {
2069
- const f = u.shake.strength ?? 12, d = u.shake.roll ?? 1.5, m = 1e3 / (u.shake.frequency ?? 24), p = Se(u.shake.seed ?? Math.round(u.at) + 1), g = () => p.next() * 2 - 1;
2070
- for (const M of ["shakeX", "shakeY", "shakeRotate"]) o(M, u.at, 0);
2071
- for (let M = u.at + m; M < u.at + u.duration; M += m) {
2072
- const y = 1 - (M - u.at) / u.duration;
2073
- o("shakeX", M, g() * f * y), o("shakeY", M, g() * f * y), o("shakeRotate", M, g() * d * y);
2068
+ for (const u of h.filter((d) => "shake" in d)) {
2069
+ const d = u.shake.strength ?? 12, f = u.shake.roll ?? 1.5, p = 1e3 / (u.shake.frequency ?? 24), m = $e(u.shake.seed ?? Math.round(u.at) + 1), M = () => m.next() * 2 - 1;
2070
+ for (const y of ["shakeX", "shakeY", "shakeRotate"]) a(y, u.at, 0);
2071
+ for (let y = u.at + p; y < u.at + u.duration; y += p) {
2072
+ const g = 1 - (y - u.at) / u.duration;
2073
+ a("shakeX", y, M() * d * g), a("shakeY", y, M() * d * g), a("shakeRotate", y, M() * f * g);
2074
2074
  }
2075
- for (const M of ["shakeX", "shakeY", "shakeRotate"]) o(M, u.at + u.duration, 0, "ease-out");
2075
+ for (const y of ["shakeX", "shakeY", "shakeRotate"]) a(y, u.at + u.duration, 0, "ease-out");
2076
2076
  }
2077
- return Object.entries(r).map(([u, f]) => ({ id: `${n}-${u}`, target: n, property: u, keyframes: f }));
2077
+ return Object.entries(r).map(([u, d]) => ({ id: `${n}-${u}`, target: n, property: u, keyframes: d }));
2078
2078
  }
2079
- function hs(t, e) {
2079
+ function ks(t, e) {
2080
2080
  const n = t.toLowerCase(), s = e.toLowerCase();
2081
- let r = Array.from({ length: s.length + 1 }, (o, a) => a);
2082
- for (let o = 1; o <= n.length; o++) {
2083
- const a = [o];
2081
+ let r = Array.from({ length: s.length + 1 }, (a, o) => o);
2082
+ for (let a = 1; a <= n.length; a++) {
2083
+ const o = [a];
2084
2084
  for (let i = 1; i <= s.length; i++)
2085
- a[i] = Math.min(r[i] + 1, a[i - 1] + 1, r[i - 1] + (n[o - 1] === s[i - 1] ? 0 : 1));
2086
- r = a;
2085
+ o[i] = Math.min(r[i] + 1, o[i - 1] + 1, r[i - 1] + (n[a - 1] === s[i - 1] ? 0 : 1));
2086
+ r = o;
2087
2087
  }
2088
2088
  return r[s.length];
2089
2089
  }
2090
- function fs(t, e) {
2091
- const n = t.toLowerCase(), s = e.find((a) => a.toLowerCase().includes(n) || n.includes(a.toLowerCase()));
2090
+ function ws(t, e) {
2091
+ const n = t.toLowerCase(), s = e.find((o) => o.toLowerCase().includes(n) || n.includes(o.toLowerCase()));
2092
2092
  if (s && Math.min(t.length, s.length) >= 3) return s;
2093
- let r, o = 1 / 0;
2094
- for (const a of e) {
2095
- const i = hs(t, a);
2096
- i < o && (o = i, r = a);
2093
+ let r, a = 1 / 0;
2094
+ for (const o of e) {
2095
+ const i = ks(t, o);
2096
+ i < a && (a = i, r = o);
2097
2097
  }
2098
- return r !== void 0 && o <= Math.max(2, Math.floor(t.length / 3)) ? r : void 0;
2098
+ return r !== void 0 && a <= Math.max(2, Math.floor(t.length / 3)) ? r : void 0;
2099
2099
  }
2100
- function hr(t, e, n, s) {
2101
- const r = typeof e == "string" ? s ?? fs(e, n) : void 0;
2100
+ function Pr(t, e, n, s) {
2101
+ const r = typeof e == "string" ? s ?? ws(e, n) : void 0;
2102
2102
  return `Unknown ${t} ${JSON.stringify(e)}${r ? `: did you mean "${r}"?` : "."} Known: ${n.join(", ")}`;
2103
2103
  }
2104
- function fr(t, e) {
2105
- const n = e.step ?? 33, s = e.stiffness ?? 120, r = e.damping ?? 9, o = e.mass ?? 1;
2106
- let a = t(e.start), i = 0;
2107
- const c = [{ time: e.start, value: a }];
2108
- let l = e.start + n;
2109
- for (let h = e.start + 1; h <= e.end; h++) {
2110
- const f = s * (t(h) - a) - r * i;
2111
- i += f / o * 1e-3, a += i * 1e-3, (h >= l || h === e.end) && (c.push({ time: h, value: a }), l += n);
2104
+ function Ir(t, e) {
2105
+ const n = e.step ?? 33, s = e.stiffness ?? 120, r = e.damping ?? 9, a = e.mass ?? 1;
2106
+ let o = t(e.start), i = 0;
2107
+ const c = [{ time: e.start, value: o }];
2108
+ let h = e.start + n;
2109
+ for (let l = e.start + 1; l <= e.end; l++) {
2110
+ const d = s * (t(l) - o) - r * i;
2111
+ i += d / a * 1e-3, o += i * 1e-3, (l >= h || l === e.end) && (c.push({ time: l, value: o }), h += n);
2112
2112
  }
2113
2113
  return c;
2114
2114
  }
2115
- const O = (t) => Math.round(t * 1e3) / 1e3;
2116
- function dr(t, e = {}) {
2115
+ function K(t, e, n = 1) {
2116
+ if (!(e > 0)) return 0;
2117
+ const s = t * n / e;
2118
+ return s - Math.floor(s);
2119
+ }
2120
+ function Le(t) {
2121
+ const e = t - Math.floor(t);
2122
+ return 1 - Math.abs(e * 2 - 1);
2123
+ }
2124
+ function $r(t, e) {
2125
+ const n = Math.max(1, Math.round(e.cycles ?? 1)), s = e.amplitude ?? 1, r = K(t, e.period, n) + (e.phase ?? 0), a = r - Math.floor(r);
2126
+ switch (e.shape ?? "sine") {
2127
+ case "triangle":
2128
+ return s * (Le(a + 0.25) * 2 - 1);
2129
+ case "square":
2130
+ return a < 0.5 ? s : -s;
2131
+ default:
2132
+ return s * Math.sin(a * Math.PI * 2);
2133
+ }
2134
+ }
2135
+ function Rr(t, e) {
2136
+ const n = Math.max(1, Math.round(e.cycles ?? 1)), s = typeof e.easing == "function" ? e.easing : Lt(e.easing ?? "ease-in-out"), r = K(t, e.period, n) + (e.phase ?? 0);
2137
+ return s(Le(r));
2138
+ }
2139
+ function Cr(t, e) {
2140
+ const n = Fe(e.seed), s = Math.max(1, Math.round(e.cycles ?? 1)), r = (K(t, e.period, 1) + (e.phase ?? 0)) * Math.PI * 2, a = s / Math.PI;
2141
+ return Oe([Math.cos(r) * a + 7.31, Math.sin(r) * a + 3.17], n, e.octaves ?? 1);
2142
+ }
2143
+ function Dr(t, e, n) {
2144
+ const s = Fe(n.seed), r = Math.max(1, Math.round(n.cycles ?? 1)), a = Math.max(1, Math.round(n.cyclesAlong ?? 1)), o = K(t, n.period, 1) * Math.PI * 2, i = K(e, n.periodAlong, 1) * Math.PI * 2, c = r / Math.PI, h = a / Math.PI;
2145
+ return Oe([Math.cos(o) * c + 5.13, Math.sin(o) * c + 9.47, Math.cos(i) * h + 2.71, Math.sin(i) * h + 6.29], s, n.octaves ?? 1);
2146
+ }
2147
+ const Fe = (t) => typeof t == "string" ? fs(t) : (t ?? 0) >>> 0;
2148
+ function Oe(t, e, n) {
2149
+ const s = Math.max(1, Math.min(6, Math.round(n)));
2150
+ let r = 0, a = 1, o = 0;
2151
+ for (let i = 0; i < s; i++) {
2152
+ const c = 2 ** i;
2153
+ r += a * vs(t.map((h) => h * c), e + i * 1013), o += a, a *= 0.5;
2154
+ }
2155
+ return r / o;
2156
+ }
2157
+ function vs(t, e) {
2158
+ const n = t.length, s = t.map(Math.floor), a = t.map((i, c) => i - s[c]).map((i) => i * i * (3 - 2 * i));
2159
+ let o = 0;
2160
+ for (let i = 0; i < 1 << n; i++) {
2161
+ let c = 1;
2162
+ const h = [];
2163
+ for (let l = 0; l < n; l++) {
2164
+ const u = i >> l & 1;
2165
+ c *= u ? a[l] : 1 - a[l], h.push(s[l] + u);
2166
+ }
2167
+ c !== 0 && (o += c * As(h, e));
2168
+ }
2169
+ return o;
2170
+ }
2171
+ function As(t, e) {
2172
+ let n = (e ^ 2654435769) >>> 0;
2173
+ for (const s of t)
2174
+ n = Math.imul(n ^ (s | 0), 2246822507) >>> 0, n = (n ^ n >>> 13) >>> 0, n = Math.imul(n, 3266489909) >>> 0, n = (n ^ n >>> 16) >>> 0;
2175
+ return n / 4294967296 * 2 - 1;
2176
+ }
2177
+ function Er(t, e = {}) {
2178
+ if (t.length === 0) throw new Error("curve: needs at least one key");
2179
+ const s = { id: "curve", target: "curve", property: "value", keyframes: t.map((a) => ({ time: a.at, value: a.value, easing: a.easing })).sort((a, o) => a.time - o.time), interpolation: e.interpolation }, r = new ut(s);
2180
+ return (a) => r.getValueAtTime(a);
2181
+ }
2182
+ function Lr(t, e) {
2183
+ return e * pt({ bpm: t.bpm });
2184
+ }
2185
+ function Fr(t, e) {
2186
+ const n = Math.max(1, Math.round(t / pt(e)));
2187
+ return { beats: n, grid: { ...e, bpm: n * 6e4 / t } };
2188
+ }
2189
+ function Or(t, e, n = {}) {
2190
+ const s = Math.max(1e-6, n.attack ?? 0.05), r = Math.max(1e-6, n.decay ?? 0.4), a = gt(e, t), o = a - Math.floor(a), i = o < s ? o / s : Math.max(0, 1 - (o - s) / r), c = n.barAccent ?? 0;
2191
+ if (c <= 0) return i;
2192
+ const h = Math.max(1, Math.round(e.beatsPerBar ?? 4)), u = (Math.floor(a) % h + h) % h === 0;
2193
+ return i * (u ? 1 + c : 1) / (1 + c);
2194
+ }
2195
+ function Nr(t, e, n = {}) {
2196
+ const s = n.fps ?? 30, r = Math.max(1, Math.round(e / s)), a = Math.max(1, Math.ceil(t.length / r)), o = new Float32Array(a), i = Math.min(0.99, Math.max(0, n.smoothing ?? 0.5));
2197
+ let c = 0, h = 0;
2198
+ for (let l = 0; l < a; l++) {
2199
+ let u = 0;
2200
+ const d = l * r, f = Math.min(t.length, d + r);
2201
+ for (let m = d; m < f; m++) u += t[m] * t[m];
2202
+ const p = f > d ? Math.sqrt(u / (f - d)) : 0;
2203
+ c = p > c ? p : c * i + p * (1 - i), o[l] = c, h = Math.max(h, c);
2204
+ }
2205
+ if (n.normalize !== !1 && h > 0) for (let l = 0; l < a; l++) o[l] /= h;
2206
+ return o;
2207
+ }
2208
+ function Xr(t, e, n = 30, s) {
2209
+ if (t.length === 0) return 0;
2210
+ const a = (s ? K(e, s) * s : e) * n / 1e3, o = Math.floor(a), i = t[Math.min(t.length - 1, Math.max(0, o))], c = t[Math.min(t.length - 1, Math.max(0, o + 1))];
2211
+ return i + (c - i) * (a - o);
2212
+ }
2213
+ const F = (t) => Math.round(t * 1e3) / 1e3;
2214
+ function Yr(t, e = {}) {
2117
2215
  if (t.length === 0) return "";
2118
2216
  const n = e.curviness ?? 1, s = e.closed ?? !1, r = t.length;
2119
- let o = `M${O(t[0].x)} ${O(t[0].y)}`;
2120
- if (r === 1) return o;
2121
- const a = (c) => s ? t[(c % r + r) % r] : t[Math.max(0, Math.min(r - 1, c))], i = s ? r : r - 1;
2217
+ let a = `M${F(t[0].x)} ${F(t[0].y)}`;
2218
+ if (r === 1) return a;
2219
+ const o = (c) => s ? t[(c % r + r) % r] : t[Math.max(0, Math.min(r - 1, c))], i = s ? r : r - 1;
2122
2220
  for (let c = 0; c < i; c++) {
2123
- const l = a(c - 1), h = a(c), u = a(c + 1), f = a(c + 2);
2221
+ const h = o(c - 1), l = o(c), u = o(c + 1), d = o(c + 2);
2124
2222
  if (n === 0) {
2125
- o += ` L${O(u.x)} ${O(u.y)}`;
2223
+ a += ` L${F(u.x)} ${F(u.y)}`;
2126
2224
  continue;
2127
2225
  }
2128
- const d = n / 6, m = h.x + (u.x - l.x) * d, p = h.y + (u.y - l.y) * d, g = u.x - (f.x - h.x) * d, M = u.y - (f.y - h.y) * d;
2129
- o += ` C${O(m)} ${O(p)} ${O(g)} ${O(M)} ${O(u.x)} ${O(u.y)}`;
2226
+ const f = n / 6, p = l.x + (u.x - h.x) * f, m = l.y + (u.y - h.y) * f, M = u.x - (d.x - l.x) * f, y = u.y - (d.y - l.y) * f;
2227
+ a += ` C${F(p)} ${F(m)} ${F(M)} ${F(y)} ${F(u.x)} ${F(u.y)}`;
2130
2228
  }
2131
- return s ? `${o} Z` : o;
2229
+ return s ? `${a} Z` : a;
2132
2230
  }
2133
- const D = (t, e = 0) => {
2231
+ const C = (t, e = 0) => {
2134
2232
  const n = parseFloat(t ?? "");
2135
2233
  return Number.isFinite(n) ? n : e;
2136
2234
  };
2137
- function ds(t) {
2235
+ function Ss(t) {
2138
2236
  const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
2139
2237
  for (let s = 0; s + 1 < e.length; s += 2) n.push({ x: e[s], y: e[s + 1] });
2140
2238
  return n;
2141
2239
  }
2142
- function pr(t) {
2240
+ function zr(t) {
2143
2241
  const e = t.attributes;
2144
2242
  switch (t.tag.toLowerCase()) {
2145
2243
  case "path":
2146
2244
  return e.d ?? null;
2147
2245
  case "circle":
2148
2246
  case "ellipse": {
2149
- const n = D(e.cx), s = D(e.cy), r = t.tag.toLowerCase() === "circle" ? D(e.r) : D(e.rx), o = t.tag.toLowerCase() === "circle" ? D(e.r) : D(e.ry);
2150
- return `M${n + r} ${s} A${r} ${o} 0 1 1 ${n - r} ${s} A${r} ${o} 0 1 1 ${n + r} ${s} Z`;
2247
+ const n = C(e.cx), s = C(e.cy), r = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.rx), a = t.tag.toLowerCase() === "circle" ? C(e.r) : C(e.ry);
2248
+ return `M${n + r} ${s} A${r} ${a} 0 1 1 ${n - r} ${s} A${r} ${a} 0 1 1 ${n + r} ${s} Z`;
2151
2249
  }
2152
2250
  case "rect": {
2153
- const n = D(e.x), s = D(e.y), r = D(e.width), o = D(e.height);
2154
- let a = e.rx != null ? D(e.rx) : e.ry != null ? D(e.ry) : 0, i = e.ry != null ? D(e.ry) : a;
2155
- return a = Math.min(a, r / 2), i = Math.min(i, o / 2), a === 0 || i === 0 ? `M${n} ${s} H${n + r} V${s + o} H${n} Z` : `M${n + a} ${s} H${n + r - a} A${a} ${i} 0 0 1 ${n + r} ${s + i} V${s + o - i} A${a} ${i} 0 0 1 ${n + r - a} ${s + o} H${n + a} A${a} ${i} 0 0 1 ${n} ${s + o - i} V${s + i} A${a} ${i} 0 0 1 ${n + a} ${s} Z`;
2251
+ const n = C(e.x), s = C(e.y), r = C(e.width), a = C(e.height);
2252
+ let o = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, i = e.ry != null ? C(e.ry) : o;
2253
+ return o = Math.min(o, r / 2), i = Math.min(i, a / 2), o === 0 || i === 0 ? `M${n} ${s} H${n + r} V${s + a} H${n} Z` : `M${n + o} ${s} H${n + r - o} A${o} ${i} 0 0 1 ${n + r} ${s + i} V${s + a - i} A${o} ${i} 0 0 1 ${n + r - o} ${s + a} H${n + o} A${o} ${i} 0 0 1 ${n} ${s + a - i} V${s + i} A${o} ${i} 0 0 1 ${n + o} ${s} Z`;
2156
2254
  }
2157
2255
  case "line":
2158
- return `M${D(e.x1)} ${D(e.y1)} L${D(e.x2)} ${D(e.y2)}`;
2256
+ return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
2159
2257
  case "polyline":
2160
2258
  case "polygon": {
2161
- const n = ds(e.points);
2259
+ const n = Ss(e.points);
2162
2260
  if (n.length === 0) return null;
2163
- const s = n.map((r, o) => `${o === 0 ? "M" : "L"}${r.x} ${r.y}`).join(" ");
2261
+ const s = n.map((r, a) => `${a === 0 ? "M" : "L"}${r.x} ${r.y}`).join(" ");
2164
2262
  return t.tag.toLowerCase() === "polygon" ? `${s} Z` : s;
2165
2263
  }
2166
2264
  default:
2167
2265
  return null;
2168
2266
  }
2169
2267
  }
2170
- function gr(t, e, n) {
2171
- const s = Math.max(2, Math.round(n.samples ?? 32)), r = Math.max(0, n.length), o = n.since !== void 0 ? Math.max(e - r, n.since) : e - r;
2172
- if (o >= e) return [];
2173
- const a = n.period, i = [];
2268
+ function jr(t, e, n) {
2269
+ const s = Math.max(2, Math.round(n.samples ?? 32)), r = Math.max(0, n.length), a = n.since !== void 0 ? Math.max(e - r, n.since) : e - r;
2270
+ if (a >= e) return [];
2271
+ const o = n.period, i = [];
2174
2272
  for (let c = 0; c < s; c++) {
2175
- const l = o + (e - o) * c / (s - 1), h = a && a > 0 && c < s - 1 ? (l % a + a) % a : l;
2176
- i.push({ at: t(h), time: l, age: r > 0 ? (e - l) / r : 0 });
2273
+ const h = a + (e - a) * c / (s - 1), l = o && o > 0 && c < s - 1 ? (h % o + o) % o : h;
2274
+ i.push({ at: t(l), time: h, age: r > 0 ? (e - h) / r : 0 });
2177
2275
  }
2178
2276
  return i;
2179
2277
  }
2180
- const ps = 2.5;
2181
- function mr(t) {
2182
- const e = [], n = [], s = t.length, r = (o, a) => {
2183
- for (let i = o + a; i >= 0 && i < s; i += a) {
2184
- const c = (t[i].x - t[o].x) * a, l = (t[i].y - t[o].y) * a, h = Math.hypot(c, l);
2185
- if (h > 1e-9) return [c / h, l / h];
2278
+ const Ps = 2.5;
2279
+ function Ur(t) {
2280
+ const e = [], n = [], s = t.length, r = (a, o) => {
2281
+ for (let i = a + o; i >= 0 && i < s; i += o) {
2282
+ const c = (t[i].x - t[a].x) * o, h = (t[i].y - t[a].y) * o, l = Math.hypot(c, h);
2283
+ if (l > 1e-9) return [c / l, h / l];
2186
2284
  }
2187
2285
  return null;
2188
2286
  };
2189
- for (let o = 0; o < s; o++) {
2190
- const a = t[o], i = r(o, -1), c = r(o, 1), l = i ?? c ?? [1, 0], h = c ?? i ?? [1, 0];
2191
- let u = l[0] + h[0], f = l[1] + h[1];
2192
- const d = Math.hypot(u, f);
2193
- d < 1e-9 ? (u = l[0], f = l[1]) : (u /= d, f /= d);
2194
- const m = u * l[0] + f * l[1], p = Math.min(ps, 1 / Math.max(m, 1e-6)), g = a.width / 2 * p;
2195
- e.push({ x: a.x - f * g, y: a.y + u * g }), n.push({ x: a.x + f * g, y: a.y - u * g });
2287
+ for (let a = 0; a < s; a++) {
2288
+ const o = t[a], i = r(a, -1), c = r(a, 1), h = i ?? c ?? [1, 0], l = c ?? i ?? [1, 0];
2289
+ let u = h[0] + l[0], d = h[1] + l[1];
2290
+ const f = Math.hypot(u, d);
2291
+ f < 1e-9 ? (u = h[0], d = h[1]) : (u /= f, d /= f);
2292
+ const p = u * h[0] + d * h[1], m = Math.min(Ps, 1 / Math.max(p, 1e-6)), M = o.width / 2 * m;
2293
+ e.push({ x: o.x - d * M, y: o.y + u * M }), n.push({ x: o.x + d * M, y: o.y - u * M });
2196
2294
  }
2197
2295
  return { left: e, right: n };
2198
2296
  }
2199
- function yr(t) {
2297
+ function Vr(t) {
2200
2298
  const e = t.length;
2201
2299
  if (e < 2) return null;
2202
2300
  const n = t[e - 1];
2203
2301
  for (let s = e - 2; s >= 0; s--) {
2204
- const r = n.x - t[s].x, o = n.y - t[s].y, a = Math.hypot(r, o);
2205
- if (a > 1e-9)
2206
- return { x: n.x, y: n.y, radius: n.width / 2, start: Math.atan2(r / a, -o / a) };
2302
+ const r = n.x - t[s].x, a = n.y - t[s].y, o = Math.hypot(r, a);
2303
+ if (o > 1e-9)
2304
+ return { x: n.x, y: n.y, radius: n.width / 2, start: Math.atan2(r / o, -a / o) };
2207
2305
  }
2208
2306
  return null;
2209
2307
  }
2210
- function gs(t, e) {
2308
+ const Br = { scale: 1, turn: 0, x: 0, y: 0 };
2309
+ function Hr(t = {}) {
2310
+ return { scale: t.scale ?? 1, turn: t.turn ?? 0, x: t.x ?? 0, y: t.y ?? 0 };
2311
+ }
2312
+ function Is(t, e, n) {
2313
+ const { ax: s, ay: r } = yt(t, e);
2314
+ return { scale: t, turn: e, x: n.x - (s * n.x - r * n.y), y: n.y - (r * n.x + s * n.y) };
2315
+ }
2316
+ function Ne(t, e) {
2317
+ const { ax: n, ay: s } = yt(t.scale, t.turn);
2318
+ return { x: n * e.x - s * e.y + t.x, y: s * e.x + n * e.y + t.y };
2319
+ }
2320
+ function qr(t, e) {
2321
+ const n = Ne(e, { x: t.x, y: t.y });
2322
+ return { scale: t.scale * e.scale, turn: t.turn + e.turn, x: n.x, y: n.y };
2323
+ }
2324
+ function Wr(t) {
2325
+ if (t.scale === 0) throw new Error("invertSimilarity: a scale of 0 cannot be undone");
2326
+ const e = { scale: 1 / t.scale, turn: -t.turn, x: 0, y: 0 }, n = Ne(e, { x: t.x, y: t.y });
2327
+ return { ...e, x: -n.x, y: -n.y };
2328
+ }
2329
+ function $s(t) {
2330
+ const { ax: e, ay: n } = yt(t.scale, t.turn), s = 1 - e, r = -n, a = s * s + r * r;
2331
+ return a < 1e-18 ? null : { x: (t.x * s + t.y * r) / a, y: (t.y * s - t.x * r) / a };
2332
+ }
2333
+ function Qr(t, e) {
2334
+ if (t.scale <= 0) throw new Error("powSimilarity: the scale must be positive");
2335
+ const n = Math.pow(t.scale, e), s = t.turn * e, r = $s(t);
2336
+ return r ? Is(n, s, r) : { scale: n, turn: s, x: t.x * e, y: t.y * e };
2337
+ }
2338
+ function Gr(t) {
2339
+ const { ax: e, ay: n } = yt(t.scale, t.turn);
2340
+ return [e, n, -n, e, t.x, t.y];
2341
+ }
2342
+ const yt = (t, e) => {
2343
+ const n = e * Math.PI / 180;
2344
+ return { ax: t * Math.cos(n), ay: t * Math.sin(n) };
2345
+ };
2346
+ function Nt([t, e, n], s = {}) {
2347
+ const r = s.scale ?? 1, a = s.centre ?? { x: 0, y: 0 }, o = Math.sqrt(3) / 2;
2348
+ return { x: a.x + (t - e) * o * r, y: a.y + ((t + e) * 0.5 - n) * r };
2349
+ }
2350
+ const Xe = ([t, e, n]) => t + e + n;
2351
+ function Ye(t, e = {}) {
2352
+ const [n, s, r] = t.min, [a, o, i] = t.max, c = (d) => Nt(d, e), h = [(n + a) / 2, (s + o) / 2, (r + i) / 2], l = Xe(h), u = [
2353
+ { side: "top", depth: l, tag: t.tag, points: [c([n, s, i]), c([a, s, i]), c([a, o, i]), c([n, o, i])] },
2354
+ { side: "left", depth: l, tag: t.tag, points: [c([n, o, r]), c([a, o, r]), c([a, o, i]), c([n, o, i])] },
2355
+ { side: "right", depth: l, tag: t.tag, points: [c([a, s, r]), c([a, o, r]), c([a, o, i]), c([a, s, i])] }
2356
+ ];
2357
+ return t.hide ? u.filter((d) => !t.hide.includes(d.side)) : u;
2358
+ }
2359
+ function ze(t, e = {}) {
2360
+ return t.map((n) => ({ box: n, depth: Xe([(n.min[0] + n.max[0]) / 2, (n.min[1] + n.max[1]) / 2, (n.min[2] + n.max[2]) / 2]) })).sort((n, s) => n.depth - s.depth).flatMap(({ box: n }) => Ye(n, e));
2361
+ }
2362
+ function Kr(t = {}) {
2363
+ const e = t.size ?? 10, s = (t.thickness ?? 2) / 2, r = [
2364
+ { tag: 0, min: [-s, -s, -s], max: [e - s, s, s] },
2365
+ { tag: 1, min: [e - s, -s, -s], max: [e + s, e - s, s] },
2366
+ { tag: 2, min: [e - s, e - s, -s], max: [e + s, e + s, e] }
2367
+ ], a = t.centre ?? { x: 0, y: 0 }, o = Nt([2 * e / 3, e / 3, e / 3], { scale: t.scale }), i = { centre: { x: a.x - o.x, y: a.y - o.y }, scale: t.scale };
2368
+ return { boxes: r, faces: [...ze(r, i), ...Ye({ ...r[0], hide: ["right"] }, i)] };
2369
+ }
2370
+ function Zr(t = {}) {
2371
+ const e = Math.max(2, Math.round(t.steps ?? 8)), n = t.tread ?? 1.5, s = t.rise ?? 0.25, r = t.width ?? 3, a = t.base ?? 1.5, o = Math.max(1, Math.round(e * (n - 2 * s) / (n + 2 * s))), i = 2 * (e + o), c = n * (e - o) / i, h = [
2372
+ { dir: [1, 0, 0], across: [0, 1, 0], count: e },
2373
+ { dir: [0, 1, 0], across: [-1, 0, 0], count: e },
2374
+ { dir: [-1, 0, 0], across: [0, -1, 0], count: o },
2375
+ { dir: [0, -1, 0], across: [1, 0, 0], count: o }
2376
+ ], l = [];
2377
+ let u = [0, 0, 0], d = 0;
2378
+ for (const y of h) {
2379
+ for (let g = 0; g < y.count; g++) {
2380
+ const _ = d * c, k = [u[0] + y.dir[0] * g * n, u[1] + y.dir[1] * g * n, 0], x = [k[0] + y.dir[0] * n + y.across[0] * r, k[1] + y.dir[1] * n + y.across[1] * r, 0];
2381
+ l.push({
2382
+ tag: d,
2383
+ min: [Math.min(k[0], x[0]), Math.min(k[1], x[1]), 0],
2384
+ max: [Math.max(k[0], x[0]), Math.max(k[1], x[1]), _ + a]
2385
+ }), d++;
2386
+ }
2387
+ u = [u[0] + y.dir[0] * y.count * n, u[1] + y.dir[1] * y.count * n, 0];
2388
+ }
2389
+ const f = i * c, p = t.centre ?? { x: 0, y: 0 }, m = Nt([e * n / 2, e * n / 2, f / 2 + a], { scale: t.scale }), M = { centre: { x: p.x - m.x, y: p.y - m.y }, scale: t.scale };
2390
+ return { boxes: l, faces: ze(l, M), rise: c };
2391
+ }
2392
+ function Rs(t, e, n) {
2393
+ let s = 0;
2394
+ for (const r of t) {
2395
+ const a = (e - r.x) ** 2 + (n - r.y) ** 2;
2396
+ s += a > 1e-9 ? r.r * r.r / a : 1e9;
2397
+ }
2398
+ return s;
2399
+ }
2400
+ function Jr(t, e = {}) {
2401
+ if (t.length === 0) return [];
2402
+ const n = e.threshold ?? 1, s = Math.max(0.5, e.cell ?? 4), r = Math.sqrt(1 / n) * 1.6, a = e.bounds ?? {
2403
+ x: Math.min(...t.map((f) => f.x - f.r * r)),
2404
+ y: Math.min(...t.map((f) => f.y - f.r * r)),
2405
+ width: Math.max(...t.map((f) => f.x + f.r * r)) - Math.min(...t.map((f) => f.x - f.r * r)),
2406
+ height: Math.max(...t.map((f) => f.y + f.r * r)) - Math.min(...t.map((f) => f.y - f.r * r))
2407
+ }, o = Math.max(2, Math.ceil(a.width / s) + 1), i = Math.max(2, Math.ceil(a.height / s) + 1), c = new Float64Array(o * i);
2408
+ for (let f = 0; f < i; f++) for (let p = 0; p < o; p++) c[f * o + p] = Rs(t, a.x + p * s, a.y + f * s) - n;
2409
+ const h = (f, p) => c[p * o + f], l = (f, p, m, M, y, g) => {
2410
+ const _ = m === g ? 0.5 : m / (m - g);
2411
+ return { x: f + (M - f) * _, y: p + (y - p) * _ };
2412
+ }, u = [];
2413
+ for (let f = 0; f + 1 < i; f++)
2414
+ for (let p = 0; p + 1 < o; p++) {
2415
+ const m = a.x + p * s, M = a.y + f * s, y = m + s, g = M + s, _ = [h(p, f), h(p + 1, f), h(p + 1, f + 1), h(p, f + 1)], k = (_[0] > 0 ? 1 : 0) | (_[1] > 0 ? 2 : 0) | (_[2] > 0 ? 4 : 0) | (_[3] > 0 ? 8 : 0);
2416
+ if (k === 0 || k === 15) continue;
2417
+ const x = () => l(m, M, _[0], y, M, _[1]), A = () => l(y, M, _[1], y, g, _[2]), w = () => l(m, g, _[3], y, g, _[2]), P = () => l(m, M, _[0], m, g, _[3]), b = (_[0] + _[1] + _[2] + _[3]) / 4 > 0;
2418
+ switch (k) {
2419
+ case 1:
2420
+ case 14:
2421
+ u.push([P(), x()]);
2422
+ break;
2423
+ case 2:
2424
+ case 13:
2425
+ u.push([x(), A()]);
2426
+ break;
2427
+ case 3:
2428
+ case 12:
2429
+ u.push([P(), A()]);
2430
+ break;
2431
+ case 4:
2432
+ case 11:
2433
+ u.push([A(), w()]);
2434
+ break;
2435
+ case 6:
2436
+ case 9:
2437
+ u.push([x(), w()]);
2438
+ break;
2439
+ case 7:
2440
+ case 8:
2441
+ u.push([P(), w()]);
2442
+ break;
2443
+ case 5:
2444
+ b ? u.push([P(), w()], [x(), A()]) : u.push([P(), x()], [A(), w()]);
2445
+ break;
2446
+ case 10:
2447
+ b ? u.push([P(), x()], [A(), w()]) : u.push([P(), w()], [x(), A()]);
2448
+ break;
2449
+ }
2450
+ }
2451
+ const d = Cs(u);
2452
+ return e.smooth === !1 ? d : d.map((f) => ce(ce(f)));
2453
+ }
2454
+ function Cs(t) {
2455
+ const e = (a) => `${Math.round(a.x * 1e3)},${Math.round(a.y * 1e3)}`, n = /* @__PURE__ */ new Map();
2456
+ t.forEach(([a, o], i) => {
2457
+ for (const c of [a, o]) {
2458
+ const h = e(c);
2459
+ n.has(h) || n.set(h, []), n.get(h).push(i);
2460
+ }
2461
+ });
2462
+ const s = new Array(t.length).fill(!1), r = [];
2463
+ for (let a = 0; a < t.length; a++) {
2464
+ if (s[a]) continue;
2465
+ s[a] = !0;
2466
+ const o = [t[a][0], t[a][1]];
2467
+ let i = t[a][1];
2468
+ for (; ; ) {
2469
+ const c = (n.get(e(i)) ?? []).find((u) => !s[u]);
2470
+ if (c === void 0) break;
2471
+ s[c] = !0;
2472
+ const [h, l] = t[c];
2473
+ if (i = e(h) === e(i) ? l : h, e(i) === e(o[0])) break;
2474
+ o.push(i);
2475
+ }
2476
+ o.length >= 3 && r.push(o);
2477
+ }
2478
+ return r;
2479
+ }
2480
+ function ce(t) {
2481
+ const e = [];
2482
+ for (let n = 0; n < t.length; n++) {
2483
+ const s = t[n], r = t[(n + 1) % t.length];
2484
+ e.push({ x: s.x * 0.75 + r.x * 0.25, y: s.y * 0.75 + r.y * 0.25 }, { x: s.x * 0.25 + r.x * 0.75, y: s.y * 0.25 + r.y * 0.75 });
2485
+ }
2486
+ return e;
2487
+ }
2488
+ function ta(t) {
2489
+ const e = Math.min(1, Math.max(0, t.progress));
2490
+ if (e <= 0) return [];
2491
+ const n = t.width / 2, s = n * (0.55 + 0.75 * e), r = Math.max(t.length * e, s * 1.2), a = t.x, o = t.y + r - s, i = Math.max(0.1, n * (0.35 - 0.3 * e)), c = o - Math.sqrt(Math.max(0, s * s - i * i)), h = Math.max(0, c - t.y), l = 8, u = [], d = [];
2492
+ for (let g = 0; g <= l; g++) {
2493
+ const _ = g / l, k = i + (n - i) * Math.pow(1 - _, 1.6 + 1.4 * e);
2494
+ u.push({ x: a - k, y: t.y + h * _ }), d.push({ x: a + k, y: t.y + h * _ });
2495
+ }
2496
+ const f = Math.max(8, Math.round(t.segments ?? 12)), p = Math.acos(Math.min(1, i / s)), m = -p, M = Math.PI + p, y = [];
2497
+ for (let g = 1; g < f; g++) {
2498
+ const _ = m + (M - m) * g / f;
2499
+ y.push({ x: a + Math.cos(_) * s, y: o + Math.sin(_) * s });
2500
+ }
2501
+ return [...d, ...y, ...u.reverse()];
2502
+ }
2503
+ function ea(t) {
2504
+ const e = Math.min(1, Math.max(0, t.grow ?? 1)), n = e >= 1 ? 1 : 1 - Math.pow(1 - e, 3) + 0.08 * Math.sin(e * Math.PI) * e, s = t.r * Math.max(0, n);
2505
+ if (s <= 0) return [];
2506
+ const r = Math.max(12, Math.round(t.segments ?? 48)), a = t.wobble ?? 0.05, o = t.time ?? 0, i = t.period ? o / t.period : o / 2500, c = (i - Math.floor(i)) * Math.PI * 2, h = t.seed ?? 0, l = [];
2507
+ for (let u = 0; u < r; u++) {
2508
+ const d = u / r * Math.PI * 2, f = 1 + a * (Math.sin(2 * d + c + h) * 0.6 + Math.sin(3 * d - 2 * c + h * 1.7) * 0.4);
2509
+ l.push({ x: t.x + Math.cos(d) * s * f, y: t.y + Math.sin(d) * s * f });
2510
+ }
2511
+ return l;
2512
+ }
2513
+ function na(t) {
2514
+ const e = t.progress;
2515
+ if (e <= 0 || e >= 1) return [];
2516
+ const n = Math.max(3, Math.round(t.pieces ?? 8)), s = [], r = t.r * (1 + 1.2 * e), a = Math.PI * 2 / n * 0.6 * (1 - e);
2517
+ for (let o = 0; o < n; o++) {
2518
+ const i = o / n * Math.PI * 2 + 0.3, c = [];
2519
+ for (let h = 0; h <= 4; h++) {
2520
+ const l = i - a / 2 + a * h / 4;
2521
+ c.push({ x: t.x + Math.cos(l) * r, y: t.y + Math.sin(l) * r });
2522
+ }
2523
+ s.push(c);
2524
+ }
2525
+ return s;
2526
+ }
2527
+ function sa(t, e = {}) {
2528
+ const n = Math.max(0.05, 1 + t);
2529
+ return { sx: e.keep === "volume" ? 1 / Math.sqrt(n) : 1 / n, sy: n };
2530
+ }
2531
+ function ra(t, e, n = { x: 0, y: 0 }) {
2532
+ return t.map((s) => ({ x: n.x + (s.x - n.x) * e.sx, y: n.y + (s.y - n.y) * e.sy }));
2533
+ }
2534
+ function Ds(t, e) {
2211
2535
  return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
2212
2536
  }
2213
- function Et(t, e) {
2537
+ function Xt(t, e) {
2214
2538
  return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
2215
2539
  }
2216
- function Ce(t, e) {
2540
+ function je(t, e) {
2217
2541
  return [t[0] * e, t[1] * e, t[2] * e];
2218
2542
  }
2219
- function ct(t, e) {
2543
+ function ht(t, e) {
2220
2544
  return t[0] * e[0] + t[1] * e[1] + t[2] * e[2];
2221
2545
  }
2222
- function vt(t, e) {
2546
+ function Rt(t, e) {
2223
2547
  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]];
2224
2548
  }
2225
- function Lt(t) {
2549
+ function Yt(t) {
2226
2550
  return Math.hypot(t[0], t[1], t[2]);
2227
2551
  }
2228
- function ms(t, e) {
2229
- return Lt(Et(t, e));
2552
+ function Es(t, e) {
2553
+ return Yt(Xt(t, e));
2230
2554
  }
2231
- function Pt(t) {
2232
- const e = Lt(t);
2233
- return e === 0 ? [0, 0, 0] : Ce(t, 1 / e);
2555
+ function Ct(t) {
2556
+ const e = Yt(t);
2557
+ return e === 0 ? [0, 0, 0] : je(t, 1 / e);
2234
2558
  }
2235
- function ys(t, e, n) {
2559
+ function Ls(t, e, n) {
2236
2560
  return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
2237
2561
  }
2238
- const Mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2562
+ const aa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2239
2563
  __proto__: null,
2240
- add: gs,
2241
- cross: vt,
2242
- distance: ms,
2243
- dot: ct,
2244
- length: Lt,
2245
- lerp: ys,
2246
- normalize: Pt,
2247
- scale: Ce,
2248
- subtract: Et
2249
- }, Symbol.toStringTag, { value: "Module" })), Ms = Math.PI / 180;
2250
- function _s() {
2564
+ add: Ds,
2565
+ cross: Rt,
2566
+ distance: Es,
2567
+ dot: ht,
2568
+ length: Yt,
2569
+ lerp: Ls,
2570
+ normalize: Ct,
2571
+ scale: je,
2572
+ subtract: Xt
2573
+ }, Symbol.toStringTag, { value: "Module" })), Fs = Math.PI / 180;
2574
+ function Os() {
2251
2575
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
2252
2576
  }
2253
- function bs(t, e) {
2577
+ function Ns(t, e) {
2254
2578
  const n = new Array(16);
2255
2579
  for (let s = 0; s < 4; s++)
2256
2580
  for (let r = 0; r < 4; r++) {
2257
- let o = 0;
2258
- for (let a = 0; a < 4; a++) o += t[a * 4 + r] * e[s * 4 + a];
2259
- n[s * 4 + r] = o;
2581
+ let a = 0;
2582
+ for (let o = 0; o < 4; o++) a += t[o * 4 + r] * e[s * 4 + o];
2583
+ n[s * 4 + r] = a;
2260
2584
  }
2261
2585
  return n;
2262
2586
  }
2263
- function Ts(t) {
2587
+ function Xs(t) {
2264
2588
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
2265
2589
  }
2266
- function xs(t) {
2590
+ function Ys(t) {
2267
2591
  return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
2268
2592
  }
2269
- function De(t) {
2593
+ function Ue(t) {
2270
2594
  const [e, n, s, r] = t;
2271
2595
  return [
2272
2596
  1 - 2 * (n * n + s * s),
@@ -2287,214 +2611,248 @@ function De(t) {
2287
2611
  1
2288
2612
  ];
2289
2613
  }
2290
- function ks(t, e, n) {
2291
- const s = De(e);
2614
+ function zs(t, e, n) {
2615
+ const s = Ue(e);
2292
2616
  for (let r = 0; r < 3; r++)
2293
2617
  s[r] *= n[0], s[4 + r] *= n[1], s[8 + r] *= n[2];
2294
2618
  return s[12] = t[0], s[13] = t[1], s[14] = t[2], s;
2295
2619
  }
2296
- function ws(t) {
2620
+ function js(t) {
2297
2621
  const e = new Array(16);
2298
2622
  for (let n = 0; n < 4; n++) for (let s = 0; s < 4; s++) e[s * 4 + n] = t[n * 4 + s];
2299
2623
  return e;
2300
2624
  }
2301
- function Ss(t) {
2302
- const [e, n, s, r, o, a, i, c, l, h, u, f, d, m, p, g] = t, M = e * a - n * o, y = e * i - s * o, k = e * c - r * o, w = n * i - s * a, b = n * c - r * a, v = s * c - r * i, A = l * m - h * d, C = l * p - u * d, _ = l * g - f * d, T = h * p - u * m, x = h * g - f * m, S = u * g - f * p, $ = M * S - y * x + k * T + w * _ - b * C + v * A;
2625
+ function Us(t) {
2626
+ const [e, n, s, r, a, o, i, c, h, l, u, d, f, p, m, M] = t, y = e * o - n * a, g = e * i - s * a, _ = e * c - r * a, k = n * i - s * o, x = n * c - r * o, A = s * c - r * i, w = h * p - l * f, P = h * m - u * f, b = h * M - d * f, T = l * m - u * p, v = l * M - d * p, S = u * M - d * m, $ = y * S - g * v + _ * T + k * b - x * P + A * w;
2303
2627
  if (Math.abs($) < 1e-12) return null;
2304
- const P = 1 / $;
2628
+ const I = 1 / $;
2305
2629
  return [
2306
- (a * S - i * x + c * T) * P,
2307
- (s * x - n * S - r * T) * P,
2308
- (m * v - p * b + g * w) * P,
2309
- (u * b - h * v - f * w) * P,
2310
- (i * _ - o * S - c * C) * P,
2311
- (e * S - s * _ + r * C) * P,
2312
- (p * k - d * v - g * y) * P,
2313
- (l * v - u * k + f * y) * P,
2314
- (o * x - a * _ + c * A) * P,
2315
- (n * _ - e * x - r * A) * P,
2316
- (d * b - m * k + g * M) * P,
2317
- (h * k - l * b - f * M) * P,
2318
- (a * C - o * T - i * A) * P,
2319
- (e * T - n * C + s * A) * P,
2320
- (m * y - d * w - p * M) * P,
2321
- (l * w - h * y + u * M) * P
2630
+ (o * S - i * v + c * T) * I,
2631
+ (s * v - n * S - r * T) * I,
2632
+ (p * A - m * x + M * k) * I,
2633
+ (u * x - l * A - d * k) * I,
2634
+ (i * b - a * S - c * P) * I,
2635
+ (e * S - s * b + r * P) * I,
2636
+ (m * _ - f * A - M * g) * I,
2637
+ (h * A - u * _ + d * g) * I,
2638
+ (a * v - o * b + c * w) * I,
2639
+ (n * b - e * v - r * w) * I,
2640
+ (f * x - p * _ + M * y) * I,
2641
+ (l * _ - h * x - d * y) * I,
2642
+ (o * P - a * T - i * w) * I,
2643
+ (e * T - n * P + s * w) * I,
2644
+ (p * g - f * k - m * y) * I,
2645
+ (h * k - l * g + u * y) * I
2322
2646
  ];
2323
2647
  }
2324
- function As(t, e, n, s) {
2325
- const r = 1 / Math.tan(t * Ms / 2), o = 1 / (n - s);
2326
- return [r / e, 0, 0, 0, 0, r, 0, 0, 0, 0, (s + n) * o, -1, 0, 0, 2 * s * n * o, 0];
2648
+ function Vs(t, e, n, s) {
2649
+ const r = 1 / Math.tan(t * Fs / 2), a = 1 / (n - s);
2650
+ return [r / e, 0, 0, 0, 0, r, 0, 0, 0, 0, (s + n) * a, -1, 0, 0, 2 * s * n * a, 0];
2327
2651
  }
2328
- function vs(t, e, n, s, r, o) {
2329
- const a = 1 / (e - t), i = 1 / (s - n), c = 1 / (o - r);
2330
- return [2 * a, 0, 0, 0, 0, 2 * i, 0, 0, 0, 0, -2 * c, 0, -(e + t) * a, -(s + n) * i, -(o + r) * c, 1];
2652
+ function Bs(t, e, n, s, r, a) {
2653
+ const o = 1 / (e - t), i = 1 / (s - n), c = 1 / (a - r);
2654
+ return [2 * o, 0, 0, 0, 0, 2 * i, 0, 0, 0, 0, -2 * c, 0, -(e + t) * o, -(s + n) * i, -(a + r) * c, 1];
2331
2655
  }
2332
- function Ps(t, e, n = [0, 1, 0]) {
2333
- const s = Pt(Et(t, e)), r = Pt(vt(n, s)), o = vt(s, r);
2656
+ function Hs(t, e, n = [0, 1, 0]) {
2657
+ const s = Ct(Xt(t, e)), r = Ct(Rt(n, s)), a = Rt(s, r);
2334
2658
  return [
2335
2659
  r[0],
2336
- o[0],
2660
+ a[0],
2337
2661
  s[0],
2338
2662
  0,
2339
2663
  r[1],
2340
- o[1],
2664
+ a[1],
2341
2665
  s[1],
2342
2666
  0,
2343
2667
  r[2],
2344
- o[2],
2668
+ a[2],
2345
2669
  s[2],
2346
2670
  0,
2347
- -ct(r, t),
2348
- -ct(o, t),
2349
- -ct(s, t),
2671
+ -ht(r, t),
2672
+ -ht(a, t),
2673
+ -ht(s, t),
2350
2674
  1
2351
2675
  ];
2352
2676
  }
2353
- function $s(t, e) {
2354
- const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], s = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], r = 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];
2355
- return o === 1 || o === 0 ? [n, s, r] : [n / o, s / o, r / o];
2677
+ function qs(t, e) {
2678
+ const n = t[0] * e[0] + t[4] * e[1] + t[8] * e[2] + t[12], s = t[1] * e[0] + t[5] * e[1] + t[9] * e[2] + t[13], r = t[2] * e[0] + t[6] * e[1] + t[10] * e[2] + t[14], a = t[3] * e[0] + t[7] * e[1] + t[11] * e[2] + t[15];
2679
+ return a === 1 || a === 0 ? [n, s, r] : [n / a, s / a, r / a];
2356
2680
  }
2357
- const _r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2681
+ const oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2358
2682
  __proto__: null,
2359
- compose: ks,
2360
- fromQuat: De,
2361
- identity: _s,
2362
- invert: Ss,
2363
- lookAt: Ps,
2364
- multiply: bs,
2365
- orthographic: vs,
2366
- perspective: As,
2367
- scaling: xs,
2368
- transformPoint: $s,
2369
- translation: Ts,
2370
- transpose: ws
2683
+ compose: zs,
2684
+ fromQuat: Ue,
2685
+ identity: Os,
2686
+ invert: Us,
2687
+ lookAt: Hs,
2688
+ multiply: Ns,
2689
+ orthographic: Bs,
2690
+ perspective: Vs,
2691
+ scaling: Ys,
2692
+ transformPoint: qs,
2693
+ translation: Xs,
2694
+ transpose: js
2371
2695
  }, Symbol.toStringTag, { value: "Module" }));
2372
2696
  export {
2373
- Ds as Clock,
2374
- Me as DEFAULT_BAKE_INTERVAL_MS,
2375
- Yt as DEFAULT_INERTIA_FRICTION,
2697
+ Gs as Clock,
2698
+ ke as DEFAULT_BAKE_INTERVAL_MS,
2699
+ Bt as DEFAULT_INERTIA_FRICTION,
2376
2700
  L as DEFAULT_SPRING,
2377
- Xt as FORMAT_VERSION,
2378
- Ve as INERTIA_MAX_DURATION_MS,
2379
- Hn as InertiaTrackPlayer,
2380
- zs as MORPH_SAMPLES,
2381
- Cs as ManualClock,
2382
- ie as SPRING_MAX_DURATION_MS,
2383
- Is as SPRING_PRESETS,
2384
- tt as SPRING_STEP_MS,
2385
- ut as SpringSampler,
2386
- Vn as SpringTrackPlayer,
2387
- ke as Timeline,
2388
- _t as TrackPlayer,
2389
- Js as ValueResolver,
2390
- sn as backOut,
2391
- Yn as bakeEasing,
2392
- be as bakeInertiaTrack,
2393
- _e as bakeSpringTrack,
2394
- It as beatAtTime,
2395
- Re as beatLength,
2396
- Dt as beatTime,
2397
- cr as beatsBetween,
2398
- nn as bounceOut,
2399
- lr as cameraTracks,
2400
- Wn as charactersFor,
2401
- Us as clearMorphCache,
2402
- Xs as clearPathCache,
2403
- fs as closestName,
2404
- tn as createCubicBezier,
2405
- Se as createRandom,
2406
- jn as createTrack,
2407
- Fs as criticalDamping,
2408
- er as customBounce,
2409
- tr as customEase,
2410
- nr as customWiggle,
2411
- ts as deserializeTimeline,
2412
- qn as deserializeTrack,
2413
- ur as detectTempo,
2414
- Ke as easeIn,
2415
- ce as easeInCubic,
2416
- qe as easeInOut,
2417
- le as easeInOutCubic,
2418
- Ge as easeInOutQuad,
2419
- We as easeInQuad,
2420
- Ze as easeOut,
2421
- ue as easeOutCubic,
2422
- Qe as easeOutQuad,
2423
- hs as editDistance,
2424
- en as elasticOut,
2425
- zn as expandParametricEasings,
2426
- se as formatVersionFor,
2427
- Gs as fromJSON,
2428
- he as getEasingFunction,
2429
- ye as getInterpolator,
2430
- xe as getMotionPathPoint,
2431
- Ys as getPathLength,
2432
- gn as getPointAtProgress,
2433
- Ne as hasKeyframes,
2434
- Ks as hashSeed,
2435
- Xe as heldTime,
2436
- ft as inertiaDuration,
2437
- ht as inertiaRest,
2438
- kt as inertiaValueAt,
2439
- Ns as inertiaVelocityAt,
2440
- Fn as interpolateArray,
2441
- On as interpolateColor,
2442
- Bs as interpolateMotionPath,
2701
+ Vt as FORMAT_VERSION,
2702
+ Br as IDENTITY_SIMILARITY,
2703
+ en as INERTIA_MAX_DURATION_MS,
2704
+ ns as InertiaTrackPlayer,
2705
+ ar as MORPH_SAMPLES,
2706
+ Qs as ManualClock,
2707
+ de as SPRING_MAX_DURATION_MS,
2708
+ Ks as SPRING_PRESETS,
2709
+ et as SPRING_STEP_MS,
2710
+ lt as SpringSampler,
2711
+ es as SpringTrackPlayer,
2712
+ Pe as Timeline,
2713
+ ut as TrackPlayer,
2714
+ gr as ValueResolver,
2715
+ Ne as applySimilarity,
2716
+ Nr as audioEnvelope,
2717
+ pn as backOut,
2718
+ Kn as bakeEasing,
2719
+ ve as bakeInertiaTrack,
2720
+ we as bakeSpringTrack,
2721
+ gt as beatAtTime,
2722
+ pt as beatLength,
2723
+ Lr as beatPeriod,
2724
+ Or as beatPulse,
2725
+ Ot as beatTime,
2726
+ vr as beatsBetween,
2727
+ mn as bounceOut,
2728
+ ea as bubblePath,
2729
+ na as bubblePop,
2730
+ Sr as cameraTracks,
2731
+ rs as charactersFor,
2732
+ or as clearMorphCache,
2733
+ sr as clearPathCache,
2734
+ ws as closestName,
2735
+ qr as composeSimilarity,
2736
+ fn as createCubicBezier,
2737
+ $e as createRandom,
2738
+ ts as createTrack,
2739
+ er as criticalDamping,
2740
+ Er as curve,
2741
+ Mr as customBounce,
2742
+ yr as customEase,
2743
+ xr as customWiggle,
2744
+ ls as deserializeTimeline,
2745
+ us as deserializeTrack,
2746
+ Ar as detectTempo,
2747
+ ta as dripPath,
2748
+ cn as easeIn,
2749
+ me as easeInCubic,
2750
+ hn as easeInOut,
2751
+ ge as easeInOutCubic,
2752
+ on as easeInOutQuad,
2753
+ rn as easeInQuad,
2754
+ un as easeOut,
2755
+ pe as easeOutCubic,
2756
+ an as easeOutQuad,
2757
+ ks as editDistance,
2758
+ dn as elasticOut,
2759
+ Xr as envelopeAt,
2760
+ Zn as expandParametricEasings,
2761
+ ue as formatVersionFor,
2762
+ dr as fromJSON,
2763
+ Lt as getEasingFunction,
2764
+ Te as getInterpolator,
2765
+ Se as getMotionPathPoint,
2766
+ rr as getPathLength,
2767
+ An as getPointAtProgress,
2768
+ Qe as hasKeyframes,
2769
+ fs as hashSeed,
2770
+ Ge as heldTime,
2771
+ mt as inertiaDuration,
2772
+ dt as inertiaRest,
2773
+ St as inertiaValueAt,
2774
+ nr as inertiaVelocityAt,
2775
+ Wn as interpolateArray,
2776
+ qn as interpolateColor,
2777
+ hr as interpolateMotionPath,
2443
2778
  N as interpolateNumber,
2444
- Xn as interpolatePathString,
2445
- Nn as interpolateQuaternion,
2446
- te as interpolateString,
2447
- Fe as isCubicBezierEasing,
2448
- j as isInertiaTrack,
2449
- Rs as isMotionPathPoint,
2450
- re as isMotionPathTrack,
2451
- xt as isParametricEasing,
2452
- Pn as isPathData,
2779
+ Gn as interpolatePathString,
2780
+ Qn as interpolateQuaternion,
2781
+ ae as interpolateString,
2782
+ Wr as invertSimilarity,
2783
+ We as isCubicBezierEasing,
2784
+ U as isInertiaTrack,
2785
+ Ws as isMotionPathPoint,
2786
+ he as isMotionPathTrack,
2787
+ At as isParametricEasing,
2788
+ Xn as isPathData,
2453
2789
  V as isSpringTrack,
2454
- $t as isTextTrack,
2455
- Os as isUnderdamped,
2456
- qs as isUnresolved,
2457
- wt as linear,
2458
- _r as mat4,
2459
- Ye as maxStaggerDistance,
2460
- vn as morphPath,
2461
- rr as narrationMarkers,
2462
- or as narrationSceneAt,
2463
- He as naturalRest,
2464
- ar as nearestBeat,
2465
- ir as nextBeat,
2466
- on as parametricEasing,
2467
- G as parsePath,
2468
- sr as planNarration,
2469
- Ws as playheadCrossings,
2470
- fe as pointAtDistance,
2471
- dr as pointsToPath,
2472
- js as quat,
2473
- Ae as randomBetween,
2474
- Zs as randomChoice,
2475
- es as randomSnapped,
2476
- ns as resolveSequence,
2477
- $e as resolveValue,
2478
- mr as ribbon,
2479
- yr as ribbonHeadCap,
2480
- Jn as serializeTimeline,
2481
- Zn as serializeTrack,
2482
- pr as shapeToPathData,
2483
- Un as simplifyKeyframes,
2484
- Ls as springDuration,
2485
- fr as springFollow,
2486
- Es as springValueAt,
2487
- oe as staggerDistance,
2488
- ae as staggerOffset,
2489
- ze as staggerOffsets,
2490
- Rt as staggerSpan,
2491
- rn as stepsEasing,
2492
- Gn as textAt,
2493
- Qs as toJSON,
2494
- Vs as toKeyframedTrack,
2495
- Hs as toKeyframedTracks,
2496
- U as trackTargets,
2497
- gr as trailSamples,
2498
- hr as unknownName,
2499
- Mr as vec3
2790
+ Dt as isTextTrack,
2791
+ tr as isUnderdamped,
2792
+ pr as isUnresolved,
2793
+ Xe as isoDepth,
2794
+ Ye as isometricBoxFaces,
2795
+ ze as isometricFaces,
2796
+ Pt as linear,
2797
+ Fr as loopBeats,
2798
+ Rr as loopEase,
2799
+ Cr as loopNoise,
2800
+ oa as mat4,
2801
+ Ke as maxStaggerDistance,
2802
+ Jr as metaballContours,
2803
+ Rs as metaballField,
2804
+ Nn as morphPath,
2805
+ br as narrationMarkers,
2806
+ Tr as narrationSceneAt,
2807
+ nn as naturalRest,
2808
+ kr as nearestBeat,
2809
+ wr as nextBeat,
2810
+ yn as parametricEasing,
2811
+ Q as parsePath,
2812
+ Zr as penroseStairs,
2813
+ Kr as penroseTriangle,
2814
+ K as phaseOf,
2815
+ Le as pingPong,
2816
+ _r as planNarration,
2817
+ lr as playheadCrossings,
2818
+ ye as pointAtDistance,
2819
+ Yr as pointsToPath,
2820
+ Qr as powSimilarity,
2821
+ Nt as projectIsometric,
2822
+ ir as quat,
2823
+ Re as randomBetween,
2824
+ mr as randomChoice,
2825
+ ds as randomSnapped,
2826
+ ms as resolveSequence,
2827
+ Ee as resolveValue,
2828
+ Ur as ribbon,
2829
+ Vr as ribbonHeadCap,
2830
+ ra as scalePoints,
2831
+ hs as serializeTimeline,
2832
+ cs as serializeTrack,
2833
+ zr as shapeToPathData,
2834
+ Hr as similarity,
2835
+ Is as similarityAbout,
2836
+ $s as similarityFixedPoint,
2837
+ Gr as similarityMatrix,
2838
+ Jn as simplifyKeyframes,
2839
+ Js as springDuration,
2840
+ Ir as springFollow,
2841
+ Zs as springValueAt,
2842
+ sa as squashStretch,
2843
+ le as staggerDistance,
2844
+ fe as staggerOffset,
2845
+ Ze as staggerOffsets,
2846
+ Et as staggerSpan,
2847
+ gn as stepsEasing,
2848
+ os as textAt,
2849
+ fr as toJSON,
2850
+ cr as toKeyframedTrack,
2851
+ ur as toKeyframedTracks,
2852
+ Dr as torusNoise,
2853
+ j as trackTargets,
2854
+ jr as trailSamples,
2855
+ Pr as unknownName,
2856
+ aa as vec3,
2857
+ $r as wobble
2500
2858
  };