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