@algorisys/tinyfly 0.89.0 → 0.91.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.
@@ -1,14 +1,14 @@
1
- function Ee(t) {
1
+ function Fe(t) {
2
2
  return typeof t == "object" && t !== null && t.type === "cubic-bezier";
3
3
  }
4
4
  function xt(t) {
5
5
  return typeof t == "object" && t !== null && t.type !== "cubic-bezier";
6
6
  }
7
- const Xt = 2;
8
- function ne(t) {
7
+ const Nt = 2;
8
+ function re(t) {
9
9
  return t.some((e) => e.interpolation !== void 0) ? 2 : 1;
10
10
  }
11
- function $t(t) {
11
+ function Rt(t) {
12
12
  return t.property === "text" && "textConfig" in t;
13
13
  }
14
14
  function V(t) {
@@ -17,16 +17,16 @@ function V(t) {
17
17
  function j(t) {
18
18
  return t.kind === "spring" && "spring" in t;
19
19
  }
20
- function re(t) {
20
+ function se(t) {
21
21
  return t.property === "motionPath" && "motionPathConfig" in t;
22
22
  }
23
- function Sr(t) {
23
+ function Pr(t) {
24
24
  return typeof t == "object" && t !== null && "x" in t && "y" in t && "angle" in t;
25
25
  }
26
- function Le(t) {
26
+ function Xe(t) {
27
27
  return "keyframes" in t;
28
28
  }
29
- class Ar {
29
+ class Rr {
30
30
  _currentTime = 0;
31
31
  _isRunning = !1;
32
32
  onTick = null;
@@ -52,7 +52,7 @@ class Ar {
52
52
  this._currentTime = e;
53
53
  }
54
54
  }
55
- class wr {
55
+ class $r {
56
56
  _currentTime = 0;
57
57
  _isRunning = !1;
58
58
  _lastFrameTime = null;
@@ -99,12 +99,12 @@ class wr {
99
99
  }
100
100
  }
101
101
  }
102
- function vr(t, e) {
102
+ function Ne(t, e) {
103
103
  if (!(e > 0)) return t;
104
104
  const n = 1e3 / e;
105
105
  return Math.floor(t / n + 1e-9) * n;
106
106
  }
107
- function se(t, e, n = "start") {
107
+ function oe(t, e, n = "start") {
108
108
  if (e <= 1) return 0;
109
109
  if (typeof n == "number") {
110
110
  const r = Math.max(0, Math.min(e - 1, n));
@@ -121,27 +121,27 @@ function se(t, e, n = "start") {
121
121
  return t;
122
122
  }
123
123
  }
124
- function Oe(t, e = "start") {
124
+ function Ye(t, e = "start") {
125
125
  if (t <= 1) return 0;
126
126
  let n = 0;
127
127
  for (let r = 0; r < t; r++)
128
- n = Math.max(n, se(r, t, e));
128
+ n = Math.max(n, oe(r, t, e));
129
129
  return n;
130
130
  }
131
- function oe(t, e, n) {
131
+ function ae(t, e, n) {
132
132
  if (n.offsets) return n.offsets[t] ?? 0;
133
- const r = n.from ?? "start", s = se(t, e, r);
133
+ const r = n.from ?? "start", s = oe(t, e, r);
134
134
  if (n.amount !== void 0) {
135
- const o = Oe(e, r);
135
+ const o = Ye(e, r);
136
136
  return o === 0 ? 0 : n.amount * s / o;
137
137
  }
138
138
  return n.each !== void 0 ? n.each * s : 0;
139
139
  }
140
- function Fe(t, e) {
141
- return Array.from({ length: t }, (n, r) => oe(r, t, e));
140
+ function ze(t, e) {
141
+ return Array.from({ length: t }, (n, r) => ae(r, t, e));
142
142
  }
143
- function Rt(t, e) {
144
- return t <= 1 ? 0 : Math.max(...Fe(t, e));
143
+ function $t(t, e) {
144
+ return t <= 1 ? 0 : Math.max(...ze(t, e));
145
145
  }
146
146
  const tt = 1, ie = 6e4, st = ie / tt, L = {
147
147
  stiffness: 180,
@@ -150,7 +150,7 @@ const tt = 1, ie = 6e4, st = ie / tt, L = {
150
150
  velocity: 0,
151
151
  restDelta: 0.01,
152
152
  restSpeed: 0.1
153
- }, Pr = {
153
+ }, Dr = {
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 },
@@ -219,10 +219,10 @@ class ut {
219
219
  if (this.settledStep !== null) return;
220
220
  const n = Math.min(e, st + 1), r = tt / 1e3;
221
221
  for (; this.samples.length < n; ) {
222
- const s = this.samples[this.samples.length - 1], o = s - this.to, i = -this.stiffness * o, a = -this.damping * this.velocity, c = (i + a) / this.mass;
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
223
  this.velocity += c * r;
224
- const u = s + this.velocity * r;
225
- if (this.samples.push(u), this.isAtRest(u)) {
224
+ const l = s + this.velocity * r;
225
+ if (this.samples.push(l), this.isAtRest(l)) {
226
226
  this.settledStep = this.samples.length - 1;
227
227
  return;
228
228
  }
@@ -230,29 +230,29 @@ class ut {
230
230
  this.samples.length > st && (this.settledStep = st);
231
231
  }
232
232
  }
233
- function $r(t, e) {
233
+ function Cr(t, e) {
234
234
  return new ut(t).valueAt(e);
235
235
  }
236
- function Rr(t) {
236
+ function Ir(t) {
237
237
  return new ut(t).settleTime();
238
238
  }
239
- function Dr(t) {
239
+ function Er(t) {
240
240
  const e = t.stiffness ?? L.stiffness, n = t.damping ?? L.damping, r = t.mass ?? L.mass;
241
241
  return n < 2 * Math.sqrt(e * r);
242
242
  }
243
- function Cr(t) {
243
+ function Lr(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 zt = 4, Ne = 2e-3, Xe = 1e-4, ze = 6e4;
247
+ const Yt = 4, Ue = 2e-3, Ve = 1e-4, je = 6e4;
248
248
  function lt(t) {
249
- const e = t.friction ?? zt;
250
- return e > 0 ? e : zt;
249
+ const e = t.friction ?? Yt;
250
+ return e > 0 ? e : Yt;
251
251
  }
252
- function Ye(t) {
252
+ function He(t) {
253
253
  return t.from + t.velocity / lt(t);
254
254
  }
255
- function Ue(t, e) {
255
+ function Be(t, e) {
256
256
  if (e === void 0) return t;
257
257
  if (typeof e == "number")
258
258
  return e > 0 ? Math.round(t / e) * e : t;
@@ -263,16 +263,16 @@ function Ue(t, e) {
263
263
  return n;
264
264
  }
265
265
  function ht(t) {
266
- let e = Ue(Ye(t), t.end);
266
+ let e = Be(He(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 ft(t) {
270
270
  const e = Math.abs(ht(t) - t.from);
271
271
  if (e === 0) return 0;
272
- const n = t.restDelta ?? Math.max(Xe, e * Ne);
272
+ const n = t.restDelta ?? Math.max(Ve, e * Ue);
273
273
  if (n >= e) return 0;
274
274
  const r = Math.log(e / n) / lt(t);
275
- return Math.min(ze, r * 1e3);
275
+ return Math.min(je, r * 1e3);
276
276
  }
277
277
  function kt(t, e) {
278
278
  if (e <= 0) return t.from;
@@ -281,47 +281,47 @@ function kt(t, e) {
281
281
  const r = lt(t);
282
282
  return t.from + (n - t.from) * (1 - Math.exp(-r * e / 1e3));
283
283
  }
284
- function Ir(t, e) {
284
+ function Or(t, e) {
285
285
  const n = lt(t), r = ht(t);
286
286
  return e >= ft(t) ? 0 : (r - t.from) * n * Math.exp(-n * Math.max(0, e) / 1e3);
287
287
  }
288
- const St = (t) => t, Ve = (t) => t * t, je = (t) => 1 - (1 - t) * (1 - t), He = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ae = (t) => t * t * t, ce = (t) => 1 - Math.pow(1 - t, 3), ue = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Be = ae, We = ce, Qe = ue, Ge = {
289
- linear: St,
290
- "ease-in": Be,
291
- "ease-out": We,
292
- "ease-in-out": Qe,
293
- "ease-in-quad": Ve,
294
- "ease-out-quad": je,
295
- "ease-in-out-quad": He,
296
- "ease-in-cubic": ae,
297
- "ease-out-cubic": ce,
298
- "ease-in-out-cubic": ue
288
+ const wt = (t) => t, We = (t) => t * t, Qe = (t) => 1 - (1 - t) * (1 - t), Ge = (t) => t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2, ce = (t) => t * t * t, ue = (t) => 1 - Math.pow(1 - t, 3), le = (t) => t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2, Ke = ce, Ze = ue, qe = le, Je = {
289
+ linear: wt,
290
+ "ease-in": Ke,
291
+ "ease-out": Ze,
292
+ "ease-in-out": qe,
293
+ "ease-in-quad": We,
294
+ "ease-out-quad": Qe,
295
+ "ease-in-out-quad": Ge,
296
+ "ease-in-cubic": ce,
297
+ "ease-out-cubic": ue,
298
+ "ease-in-out-cubic": le
299
299
  };
300
- function Ke(t) {
301
- const [e, n, r, s] = t, o = 3 * e, i = 3 * (r - e) - o, a = 1 - o - i, c = 3 * n, u = 3 * (s - n) - c, l = 1 - c - u, h = (d) => ((a * d + i) * d + o) * d, f = (d) => ((l * d + u) * d + c) * d, p = (d) => (3 * a * d + 2 * i) * d + o, M = (d) => {
302
- let g = d;
300
+ function tn(t) {
301
+ const [e, n, r, s] = t, o = 3 * e, a = 3 * (r - e) - o, i = 1 - o - a, c = 3 * n, l = 3 * (s - n) - c, h = 1 - c - l, u = (p) => ((i * p + a) * p + o) * p, f = (p) => ((h * p + l) * p + c) * p, d = (p) => (3 * i * p + 2 * a) * p + o, m = (p) => {
302
+ let g = p;
303
303
  for (let k = 0; k < 8; k++) {
304
- const w = h(g) - d;
304
+ const w = u(g) - p;
305
305
  if (Math.abs(w) < 1e-7)
306
306
  return g;
307
- const y = p(g);
308
- if (Math.abs(y) < 1e-7)
307
+ const b = d(g);
308
+ if (Math.abs(b) < 1e-7)
309
309
  break;
310
- g -= w / y;
310
+ g -= w / b;
311
311
  }
312
- let _ = 0, b = 1;
313
- for (g = d; _ < b; ) {
314
- const k = h(g);
315
- if (Math.abs(k - d) < 1e-7)
312
+ let M = 0, y = 1;
313
+ for (g = p; M < y; ) {
314
+ const k = u(g);
315
+ if (Math.abs(k - p) < 1e-7)
316
316
  return g;
317
- d > k ? _ = g : b = g, g = (_ + b) / 2;
317
+ p > k ? M = g : y = g, g = (M + y) / 2;
318
318
  }
319
319
  return g;
320
320
  };
321
- return (d) => {
322
- if (d <= 0) return 0;
323
- if (d >= 1) return 1;
324
- const g = M(d);
321
+ return (p) => {
322
+ if (p <= 0) return 0;
323
+ if (p >= 1) return 1;
324
+ const g = m(p);
325
325
  return f(g);
326
326
  };
327
327
  }
@@ -330,11 +330,11 @@ function gt(t, e = "out") {
330
330
  const n = (r) => 1 - t(1 - r);
331
331
  return e === "in" ? n : (r) => r < 0.5 ? n(r * 2) / 2 : t(r * 2 - 1) / 2 + 0.5;
332
332
  }
333
- function Ze(t = 1, e = 0.3) {
333
+ function en(t = 1, e = 0.3) {
334
334
  const n = Math.max(1, t), r = e / (2 * Math.PI) * Math.asin(1 / n);
335
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 qe = (t) => {
337
+ const nn = (t) => {
338
338
  if (t <= 0) return 0;
339
339
  if (t >= 1) return 1;
340
340
  if (t < 1 / 2.75) return 7.5625 * t * t;
@@ -349,7 +349,7 @@ const qe = (t) => {
349
349
  const r = t - 2.625 / 2.75;
350
350
  return 7.5625 * r * r + 0.984375;
351
351
  };
352
- function Je(t = 1.70158) {
352
+ function rn(t = 1.70158) {
353
353
  return (e) => {
354
354
  if (e <= 0) return 0;
355
355
  if (e >= 1) return 1;
@@ -357,7 +357,7 @@ function Je(t = 1.70158) {
357
357
  return n * n * ((t + 1) * n + t) + 1;
358
358
  };
359
359
  }
360
- function tn(t, e = "end") {
360
+ function sn(t, e = "end") {
361
361
  const n = Math.max(1, Math.floor(t));
362
362
  return (r) => {
363
363
  if (r >= 1) return 1;
@@ -375,22 +375,22 @@ function tn(t, e = "end") {
375
375
  }
376
376
  };
377
377
  }
378
- function en(t) {
378
+ function on(t) {
379
379
  switch (t.type) {
380
380
  case "steps":
381
- return tn(t.count, t.position);
381
+ return sn(t.count, t.position);
382
382
  case "elastic":
383
- return gt(Ze(t.amplitude, t.period), t.mode);
383
+ return gt(en(t.amplitude, t.period), t.mode);
384
384
  case "bounce":
385
- return gt(qe, t.mode);
385
+ return gt(nn, t.mode);
386
386
  case "back":
387
- return gt(Je(t.overshoot), t.mode);
387
+ return gt(rn(t.overshoot), t.mode);
388
388
  }
389
389
  }
390
- function le(t) {
391
- return t === void 0 ? St : Ee(t) ? Ke(t.points) : xt(t) ? en(t) : Ge[t] ?? St;
390
+ function he(t) {
391
+ return t === void 0 ? wt : Fe(t) ? tn(t.points) : xt(t) ? on(t) : Je[t] ?? wt;
392
392
  }
393
- const Yt = 32, nn = 256, W = /* @__PURE__ */ new Map(), rn = /[MmLlHhVvCcSsQqTtAaZz]/, sn = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, on = {
393
+ const zt = 32, an = 256, W = /* @__PURE__ */ new Map(), cn = /[MmLlHhVvCcSsQqTtAaZz]/, un = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/, ln = {
394
394
  M: 2,
395
395
  L: 2,
396
396
  H: 1,
@@ -402,7 +402,7 @@ const Yt = 32, nn = 256, W = /* @__PURE__ */ new Map(), rn = /[MmLlHhVvCcSsQqTtA
402
402
  A: 7,
403
403
  Z: 0
404
404
  };
405
- function an(t) {
405
+ function hn(t) {
406
406
  const e = [];
407
407
  let n = 0, r = null;
408
408
  const s = () => {
@@ -410,52 +410,52 @@ function an(t) {
410
410
  };
411
411
  for (; n < t.length && (s(), !(n >= t.length)); ) {
412
412
  const o = t[n];
413
- if (rn.test(o)) {
413
+ if (cn.test(o)) {
414
414
  r = { type: o, args: [] }, e.push(r), n++;
415
415
  continue;
416
416
  }
417
417
  if (!r) break;
418
- const i = r.type === "A" || r.type === "a", a = r.args.length % 7;
419
- if (i && (a === 3 || a === 4)) {
418
+ const a = r.type === "A" || r.type === "a", i = r.args.length % 7;
419
+ if (a && (i === 3 || i === 4)) {
420
420
  if (o !== "0" && o !== "1") break;
421
421
  r.args.push(o === "1" ? 1 : 0), n++;
422
422
  continue;
423
423
  }
424
- const c = sn.exec(t.slice(n));
424
+ const c = un.exec(t.slice(n));
425
425
  if (!c) break;
426
426
  r.args.push(parseFloat(c[0])), n += c[0].length;
427
427
  }
428
428
  return e;
429
429
  }
430
- function cn(t, e, n, r, s, o, i, a, c) {
431
- if (t === a && e === c) return [];
432
- let u = Math.abs(n), l = Math.abs(r);
433
- if (u === 0 || l === 0) return [[t, e, a, c, a, c]];
434
- const h = s * Math.PI / 180, f = Math.cos(h), p = Math.sin(h), M = (t - a) / 2, d = (e - c) / 2, g = f * M + p * d, _ = -p * M + f * d, b = g * g / (u * u) + _ * _ / (l * l);
435
- if (b > 1) {
436
- const R = Math.sqrt(b);
437
- u *= R, l *= R;
438
- }
439
- const k = o === i ? -1 : 1, w = u * u * l * l - u * u * _ * _ - l * l * g * g, y = u * u * _ * _ + l * l * g * g, v = k * Math.sqrt(Math.max(0, w / y)), A = v * u * _ / l, D = -v * l * g / u, m = f * A - p * D + (t + a) / 2, T = p * A + f * D + (e + c) / 2, x = (R, I, E, H) => {
440
- const dt = R * E + I * H, rt = Math.sqrt((R * R + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, dt / rt)));
441
- return R * H - I * E < 0 ? -Z : Z;
442
- }, S = x(1, 0, (g - A) / u, (_ - D) / l);
443
- let $ = x((g - A) / u, (_ - D) / l, (-g - A) / u, (-_ - D) / l);
444
- !i && $ > 0 && ($ -= 2 * Math.PI), i && $ < 0 && ($ += 2 * Math.PI);
445
- const P = Math.max(1, Math.ceil(Math.abs($) / (Math.PI / 2))), pt = $ / P, nt = 4 / 3 * Math.tan(pt / 4), Ot = (R) => {
446
- const I = u * Math.cos(R), E = l * Math.sin(R);
447
- return [f * I - p * E + m, p * I + f * E + T];
448
- }, Ft = (R) => {
449
- const I = -u * Math.sin(R), E = l * Math.cos(R);
450
- return [f * I - p * E, p * I + f * E];
451
- }, Nt = [];
452
- for (let R = 0; R < P; R++) {
453
- const I = S + R * pt, E = I + pt, [H, dt] = Ot(I), [rt, Z] = R === P - 1 ? [a, c] : Ot(E), [Re, De] = Ft(I), [Ce, Ie] = Ft(E);
454
- Nt.push([H + nt * Re, dt + nt * De, rt - nt * Ce, Z - nt * Ie, rt, Z]);
455
- }
456
- return Nt;
457
- }
458
- function z(t, e, n, r, s) {
430
+ function fn(t, e, n, r, s, o, a, i, c) {
431
+ if (t === i && e === c) return [];
432
+ let l = Math.abs(n), h = Math.abs(r);
433
+ if (l === 0 || h === 0) return [[t, e, i, c, i, c]];
434
+ const u = s * Math.PI / 180, f = Math.cos(u), d = Math.sin(u), m = (t - i) / 2, p = (e - c) / 2, g = f * m + d * p, M = -d * m + f * p, y = g * g / (l * l) + M * M / (h * h);
435
+ if (y > 1) {
436
+ const $ = Math.sqrt(y);
437
+ l *= $, h *= $;
438
+ }
439
+ const k = o === a ? -1 : 1, w = l * l * h * h - l * l * M * M - h * h * g * g, b = l * l * M * M + h * h * g * g, v = k * Math.sqrt(Math.max(0, w / b)), A = v * l * M / h, D = -v * h * g / l, _ = f * A - d * D + (t + i) / 2, T = d * A + f * D + (e + c) / 2, x = ($, I, E, H) => {
440
+ const pt = $ * E + I * H, rt = Math.sqrt(($ * $ + I * I) * (E * E + H * H)), Z = Math.acos(Math.max(-1, Math.min(1, pt / rt)));
441
+ return $ * H - I * E < 0 ? -Z : Z;
442
+ }, S = x(1, 0, (g - A) / l, (M - D) / h);
443
+ let R = x((g - A) / l, (M - D) / h, (-g - A) / l, (-M - D) / h);
444
+ !a && R > 0 && (R -= 2 * Math.PI), a && R < 0 && (R += 2 * Math.PI);
445
+ const P = Math.max(1, Math.ceil(Math.abs(R) / (Math.PI / 2))), dt = R / P, nt = 4 / 3 * Math.tan(dt / 4), Ot = ($) => {
446
+ const I = l * Math.cos($), E = h * Math.sin($);
447
+ return [f * I - d * E + _, d * I + f * E + T];
448
+ }, Ft = ($) => {
449
+ const I = -l * Math.sin($), E = h * Math.cos($);
450
+ return [f * I - d * E, d * I + f * E];
451
+ }, Xt = [];
452
+ for (let $ = 0; $ < P; $++) {
453
+ const I = S + $ * dt, E = I + dt, [H, pt] = Ot(I), [rt, Z] = $ === P - 1 ? [i, c] : Ot(E), [Ie, Ee] = Ft(I), [Le, Oe] = Ft(E);
454
+ Xt.push([H + nt * Ie, pt + nt * Ee, rt - nt * Le, Z - nt * Oe, rt, Z]);
455
+ }
456
+ return Xt;
457
+ }
458
+ function Y(t, e, n, r, s) {
459
459
  const o = 1 - s;
460
460
  return o * o * o * t + 3 * o * o * s * e + 3 * o * s * s * n + s * s * s * r;
461
461
  }
@@ -476,172 +476,172 @@ function q(t, e, n, r) {
476
476
  };
477
477
  }
478
478
  function ot(t, e, n) {
479
- const [r, s, o, i, a, c] = n, u = [0];
480
- let l = t, h = e, f = 0;
481
- for (let p = 1; p <= Yt; p++) {
482
- const M = p / Yt, d = z(t, r, o, a, M), g = z(e, s, i, c, M);
483
- f += Math.hypot(d - l, g - h), u.push(f), l = d, h = g;
479
+ const [r, s, o, a, i, c] = n, l = [0];
480
+ let h = t, u = e, f = 0;
481
+ for (let d = 1; d <= zt; d++) {
482
+ const m = d / zt, p = Y(t, r, o, i, m), g = Y(e, s, a, c, m);
483
+ f += Math.hypot(p - h, g - u), l.push(f), h = p, u = g;
484
484
  }
485
485
  return {
486
486
  subpath: 0,
487
487
  type: "C",
488
- points: [r, s, o, i, a, c],
488
+ points: [r, s, o, a, i, c],
489
489
  startX: t,
490
490
  startY: e,
491
- endX: a,
491
+ endX: i,
492
492
  endY: c,
493
493
  length: f,
494
- lengths: u
494
+ lengths: l
495
495
  };
496
496
  }
497
497
  function G(t) {
498
498
  const e = W.get(t);
499
499
  if (e) return e;
500
500
  const n = [];
501
- let r = 0, s = 0, o = 0, i = 0, a = null, c = null, u = -1;
502
- const l = /* @__PURE__ */ new Set(), h = (d) => {
503
- u < 0 && (u = 0), d.subpath = u, n.push(d);
501
+ let r = 0, s = 0, o = 0, a = 0, i = null, c = null, l = -1;
502
+ const h = /* @__PURE__ */ new Set(), u = (p) => {
503
+ l < 0 && (l = 0), p.subpath = l, n.push(p);
504
504
  };
505
- for (const { type: d, args: g } of an(t)) {
506
- const _ = d.toUpperCase(), b = d !== _, k = on[_];
507
- if (_ === "Z") {
508
- (r !== o || s !== i) && h(q(r, s, o, i)), u >= 0 && l.add(u), r = o, s = i, a = c = null;
505
+ for (const { type: p, args: g } of hn(t)) {
506
+ const M = p.toUpperCase(), y = p !== M, k = ln[M];
507
+ if (M === "Z") {
508
+ (r !== o || s !== a) && u(q(r, s, o, a)), l >= 0 && h.add(l), r = o, s = a, i = c = null;
509
509
  continue;
510
510
  }
511
511
  for (let w = 0; w + k <= g.length; w += k) {
512
- const y = g.slice(w, w + k), v = b ? r : 0, A = b ? s : 0;
513
- let D = null, m = null;
514
- switch (_) {
512
+ const b = g.slice(w, w + k), v = y ? r : 0, A = y ? s : 0;
513
+ let D = null, _ = null;
514
+ switch (M) {
515
515
  case "M":
516
- w === 0 ? (r = y[0] + v, s = y[1] + A, o = r, i = s, (u < 0 || n[n.length - 1]?.subpath === u) && u++) : (h(q(r, s, y[0] + v, y[1] + A)), r = y[0] + v, s = y[1] + A);
516
+ w === 0 ? (r = b[0] + v, s = b[1] + A, o = r, a = s, (l < 0 || n[n.length - 1]?.subpath === l) && l++) : (u(q(r, s, b[0] + v, b[1] + A)), r = b[0] + v, s = b[1] + A);
517
517
  break;
518
518
  case "L":
519
- h(q(r, s, y[0] + v, y[1] + A)), r = y[0] + v, s = y[1] + A;
519
+ u(q(r, s, b[0] + v, b[1] + A)), r = b[0] + v, s = b[1] + A;
520
520
  break;
521
521
  case "H":
522
- h(q(r, s, y[0] + v, s)), r = y[0] + v;
522
+ u(q(r, s, b[0] + v, s)), r = b[0] + v;
523
523
  break;
524
524
  case "V":
525
- h(q(r, s, r, y[0] + A)), s = y[0] + A;
525
+ u(q(r, s, r, b[0] + A)), s = b[0] + A;
526
526
  break;
527
527
  case "C": {
528
- const T = [y[0] + v, y[1] + A, y[2] + v, y[3] + A, y[4] + v, y[5] + A];
529
- h(ot(r, s, T)), D = [T[2], T[3]], r = T[4], s = T[5];
528
+ const T = [b[0] + v, b[1] + A, b[2] + v, b[3] + A, b[4] + v, b[5] + A];
529
+ u(ot(r, s, T)), D = [T[2], T[3]], r = T[4], s = T[5];
530
530
  break;
531
531
  }
532
532
  case "S": {
533
- const [T, x] = a ? [2 * r - a[0], 2 * s - a[1]] : [r, s], S = [T, x, y[0] + v, y[1] + A, y[2] + v, y[3] + A];
534
- h(ot(r, s, S)), D = [S[2], S[3]], r = S[4], s = S[5];
533
+ const [T, x] = i ? [2 * r - i[0], 2 * s - i[1]] : [r, s], S = [T, x, b[0] + v, b[1] + A, b[2] + v, b[3] + A];
534
+ u(ot(r, s, S)), D = [S[2], S[3]], r = S[4], s = S[5];
535
535
  break;
536
536
  }
537
537
  case "Q":
538
538
  case "T": {
539
539
  let T = r, x = s;
540
- _ === "Q" ? (T = y[0] + v, x = y[1] + A) : c && (T = 2 * r - c[0], x = 2 * s - c[1]);
541
- const S = _ === "Q" ? y[2] + v : y[0] + v, $ = _ === "Q" ? y[3] + A : y[1] + A;
542
- h(
540
+ M === "Q" ? (T = b[0] + v, x = b[1] + A) : c && (T = 2 * r - c[0], x = 2 * s - c[1]);
541
+ const S = M === "Q" ? b[2] + v : b[0] + v, R = M === "Q" ? b[3] + A : b[1] + A;
542
+ u(
543
543
  ot(r, s, [
544
544
  r + 2 / 3 * (T - r),
545
545
  s + 2 / 3 * (x - s),
546
546
  S + 2 / 3 * (T - S),
547
- $ + 2 / 3 * (x - $),
547
+ R + 2 / 3 * (x - R),
548
548
  S,
549
- $
549
+ R
550
550
  ])
551
- ), m = [T, x], r = S, s = $;
551
+ ), _ = [T, x], r = S, s = R;
552
552
  break;
553
553
  }
554
554
  case "A": {
555
- const T = y[5] + v, x = y[6] + A;
556
- let S = r, $ = s;
557
- for (const P of cn(r, s, y[0], y[1], y[2], y[3], y[4], T, x))
558
- h(ot(S, $, P)), S = P[4], $ = P[5];
555
+ const T = b[5] + v, x = b[6] + A;
556
+ let S = r, R = s;
557
+ for (const P of fn(r, s, b[0], b[1], b[2], b[3], b[4], T, x))
558
+ u(ot(S, R, P)), S = P[4], R = P[5];
559
559
  r = T, s = x;
560
560
  break;
561
561
  }
562
562
  }
563
- a = D, c = m;
563
+ i = D, c = _;
564
564
  }
565
565
  }
566
- const f = n.reduce((d, g) => d + g.length, 0), p = [];
567
- for (let d = 0; d < n.length; ) {
568
- const g = n[d].subpath;
569
- let _ = d, b = 0;
570
- for (; _ < n.length && n[_].subpath === g; ) b += n[_++].length;
571
- const k = n[d], w = n[_ - 1], y = l.has(g) || Math.abs(w.endX - k.startX) < 1e-9 && Math.abs(w.endY - k.startY) < 1e-9;
572
- p.push({ start: d, end: _, length: b, closed: y }), d = _;
566
+ const f = n.reduce((p, g) => p + g.length, 0), d = [];
567
+ for (let p = 0; p < n.length; ) {
568
+ const g = n[p].subpath;
569
+ let M = p, y = 0;
570
+ for (; M < n.length && n[M].subpath === g; ) y += n[M++].length;
571
+ const k = n[p], w = n[M - 1], b = h.has(g) || Math.abs(w.endX - k.startX) < 1e-9 && Math.abs(w.endY - k.startY) < 1e-9;
572
+ d.push({ start: p, end: M, length: y, closed: b }), p = M;
573
573
  }
574
- const M = { segments: n, totalLength: f, subpaths: p };
575
- return W.size >= nn && W.delete(W.keys().next().value), W.set(t, M), M;
574
+ const m = { segments: n, totalLength: f, subpaths: d };
575
+ return W.size >= an && W.delete(W.keys().next().value), W.set(t, m), m;
576
576
  }
577
- function un(t, e) {
577
+ function dn(t, e) {
578
578
  const n = t.lengths;
579
579
  if (e <= 0) return 0;
580
580
  if (e >= t.length) return 1;
581
581
  let r = 0, s = n.length - 1;
582
582
  for (; r < s - 1; ) {
583
- const a = r + s >> 1;
584
- n[a] < e ? r = a : s = a;
583
+ const i = r + s >> 1;
584
+ n[i] < e ? r = i : s = i;
585
585
  }
586
- const o = n[s] - n[r], i = o > 0 ? (e - n[r]) / o : 0;
587
- return (r + i) / (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 ln(t, e) {
589
+ function pn(t, e) {
590
590
  if (t.type === "L") {
591
- const h = t.length > 0 ? Math.max(0, Math.min(1, e / t.length)) : 0;
591
+ const u = t.length > 0 ? Math.max(0, Math.min(1, e / t.length)) : 0;
592
592
  return {
593
- x: t.startX + (t.endX - t.startX) * h,
594
- y: t.startY + (t.endY - t.startY) * h,
593
+ x: t.startX + (t.endX - t.startX) * u,
594
+ y: t.startY + (t.endY - t.startY) * u,
595
595
  angle: Math.atan2(t.endY - t.startY, t.endX - t.startX) * 180 / Math.PI
596
596
  };
597
597
  }
598
- const [n, r, s, o, i, a] = t.points, c = un(t, e);
599
- let u = Ut(t.startX, n, s, i, c), l = Ut(t.startY, r, o, a, c);
600
- if (Math.hypot(u, l) < 1e-9) {
601
- const h = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = z(t.startX, n, s, i, h), p = z(t.startY, r, o, a, h), M = z(t.startX, n, s, i, c), d = z(t.startY, r, o, a, c);
602
- u = c < 0.5 ? f - M : M - f, l = c < 0.5 ? p - d : d - p;
598
+ const [n, r, s, o, a, i] = t.points, c = dn(t, e);
599
+ let l = Ut(t.startX, n, s, a, c), h = Ut(t.startY, r, o, i, c);
600
+ if (Math.hypot(l, h) < 1e-9) {
601
+ const u = c < 0.5 ? Math.min(1, c + 1e-3) : Math.max(0, c - 1e-3), f = Y(t.startX, n, s, a, u), d = Y(t.startY, r, o, i, u), m = Y(t.startX, n, s, a, c), p = Y(t.startY, r, o, i, c);
602
+ l = c < 0.5 ? f - m : m - f, h = c < 0.5 ? d - p : p - d;
603
603
  }
604
604
  return {
605
- x: z(t.startX, n, s, i, c),
606
- y: z(t.startY, r, o, a, c),
607
- angle: Math.atan2(l, u) * 180 / Math.PI
605
+ x: Y(t.startX, n, s, a, c),
606
+ y: Y(t.startY, r, o, i, c),
607
+ angle: Math.atan2(h, l) * 180 / Math.PI
608
608
  };
609
609
  }
610
- function he(t, e, n = 0, r = t.length) {
610
+ function fe(t, e, n = 0, r = t.length) {
611
611
  if (r <= n) return { x: 0, y: 0, angle: 0 };
612
612
  let s = 0;
613
613
  for (let o = n; o < r; o++) {
614
- const i = t[o];
615
- if (s + i.length >= e || o === r - 1)
616
- return ln(i, e - s);
617
- s += i.length;
614
+ const a = t[o];
615
+ if (s + a.length >= e || o === r - 1)
616
+ return pn(a, e - s);
617
+ s += a.length;
618
618
  }
619
619
  return { x: 0, y: 0, angle: 0 };
620
620
  }
621
- function hn(t, e) {
621
+ function gn(t, e) {
622
622
  const { segments: n, totalLength: r } = G(t);
623
- return he(n, Math.max(0, Math.min(1, e)) * r);
623
+ return fe(n, Math.max(0, Math.min(1, e)) * r);
624
624
  }
625
- function Er() {
625
+ function Fr() {
626
626
  W.clear();
627
627
  }
628
- function Lr(t) {
628
+ function Xr(t) {
629
629
  return G(t).totalLength;
630
630
  }
631
- const fn = 24, pn = 320, dn = 2.5, J = 72, Or = 64, gn = 0.2, mn = 128, et = /* @__PURE__ */ new Map();
632
- let it = 0, X;
631
+ const mn = 24, yn = 320, Mn = 2.5, J = 72, Nr = 64, _n = 0.2, bn = 128, et = /* @__PURE__ */ new Map();
632
+ let at = 0, N;
633
633
  const Vt = (t) => Math.round(t * 100) / 100;
634
634
  function jt(t, e) {
635
635
  const { segments: n, subpaths: r, totalLength: s } = G(t);
636
636
  if (n.length === 0) return [];
637
637
  if (e) {
638
- const o = r.every((i) => i.closed);
638
+ const o = r.every((a) => a.closed);
639
639
  return [{ segments: n, start: 0, end: n.length, length: s, closed: o }];
640
640
  }
641
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
- function At(t, e) {
644
- const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r = he(t.segments, n * t.length, t.start, t.end);
643
+ function St(t, e) {
644
+ const n = t.closed ? (e % 1 + 1) % 1 : Math.max(0, Math.min(1, e)), r = fe(t.segments, n * t.length, t.start, t.end);
645
645
  return [r.x, r.y];
646
646
  }
647
647
  function Ht(t) {
@@ -654,7 +654,7 @@ function Ht(t) {
654
654
  function Bt(t, e) {
655
655
  const n = [];
656
656
  for (let r = 0; r < e; r++)
657
- n.push(At(t, t.closed ? r / e : r / (e - 1)));
657
+ n.push(St(t, t.closed ? r / e : r / (e - 1)));
658
658
  return n;
659
659
  }
660
660
  function Wt(t) {
@@ -663,184 +663,184 @@ function Wt(t) {
663
663
  e += r, n += s;
664
664
  return e /= t.length, n /= t.length, t.map(([r, s]) => [r - e, s - n]);
665
665
  }
666
- function yn(t, e, n) {
666
+ function Tn(t, e, n) {
667
667
  const r = t.closed && e.closed;
668
668
  if (n !== void 0)
669
669
  return { offset: r ? Math.abs(n) % J / J : 0, reversed: n < 0 };
670
- const s = Wt(Bt(t, J)), o = Wt(Bt(e, J)), i = J;
671
- let a = { offset: 0, reversed: !1 }, c = 1 / 0;
672
- for (const u of [!1, !0]) {
673
- const l = r ? i : 1;
674
- for (let h = 0; h < l; h++) {
670
+ const s = Wt(Bt(t, J)), o = Wt(Bt(e, J)), a = J;
671
+ let i = { offset: 0, reversed: !1 }, c = 1 / 0;
672
+ for (const l of [!1, !0]) {
673
+ const h = r ? a : 1;
674
+ for (let u = 0; u < h; u++) {
675
675
  let f = 0;
676
- for (let p = 0; p < i && f < c; p++) {
677
- const M = r ? u ? (h - p + i) % i : (p + h) % i : u ? i - 1 - p : p, d = s[p][0] - o[M][0], g = s[p][1] - o[M][1];
678
- f += d * d + g * g;
676
+ for (let d = 0; d < a && f < c; d++) {
677
+ const m = r ? l ? (u - d + a) % a : (d + u) % a : l ? a - 1 - d : d, p = s[d][0] - o[m][0], g = s[d][1] - o[m][1];
678
+ f += p * p + g * g;
679
679
  }
680
- f < c && (c = f, a = { offset: r ? h / i : 0, reversed: u });
680
+ f < c && (c = f, i = { offset: r ? u / a : 0, reversed: l });
681
681
  }
682
682
  }
683
- return a;
683
+ return i;
684
684
  }
685
- function Mn(t, e, n) {
685
+ function xn(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 _n(t, e, n) {
688
+ function kn(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 bn(t, e, n) {
692
- const r = t.closed && e.closed, s = yn(t, e, n.shapeIndex), o = Math.max(
693
- fn,
694
- Math.min(pn, Math.ceil(Math.max(t.length, e.length) / dn))
695
- ), i = /* @__PURE__ */ new Set(), a = (h) => i.add(Math.round(h * 1e7) / 1e7);
696
- for (let h = 0; h <= o; h++) a(h / o);
697
- for (const h of Ht(t)) a(h);
698
- for (const h of Ht(e)) a(_n(h, s, r));
699
- let c = [...i].sort((h, f) => h - f);
700
- r && (c = c.filter((h) => h < 1));
701
- const u = [], l = [];
702
- for (const h of c)
703
- u.push(...At(t, h)), l.push(...At(e, Mn(h, s, r)));
704
- return Tn({ from: u, to: l, closed: r });
705
- }
706
- function Tn(t) {
691
+ function wn(t, e, n) {
692
+ const r = t.closed && e.closed, s = Tn(t, e, n.shapeIndex), o = Math.max(
693
+ mn,
694
+ Math.min(yn, Math.ceil(Math.max(t.length, e.length) / Mn))
695
+ ), a = /* @__PURE__ */ new Set(), i = (u) => a.add(Math.round(u * 1e7) / 1e7);
696
+ for (let u = 0; u <= o; u++) i(u / o);
697
+ for (const u of Ht(t)) i(u);
698
+ for (const u of Ht(e)) i(kn(u, s, r));
699
+ let c = [...a].sort((u, f) => u - f);
700
+ r && (c = c.filter((u) => u < 1));
701
+ const l = [], h = [];
702
+ for (const u of c)
703
+ l.push(...St(t, u)), h.push(...St(e, xn(u, s, r)));
704
+ return Sn({ from: l, to: h, closed: r });
705
+ }
706
+ function Sn(t) {
707
707
  const e = t.from.length / 2;
708
708
  if (e <= 3) return t;
709
709
  const n = new Uint8Array(e);
710
710
  n[0] = 1, n[e - 1] = 1;
711
711
  const r = [[0, e - 1]];
712
712
  for (; r.length > 0; ) {
713
- const [i, a] = r.pop();
714
- let c = -1, u = gn;
715
- for (let l = i + 1; l < a; l++) {
716
- const h = Math.max(Qt(t.from, i, a, l), Qt(t.to, i, a, l));
717
- h > u && (u = h, c = l);
713
+ const [a, i] = r.pop();
714
+ let c = -1, l = _n;
715
+ for (let h = a + 1; h < i; h++) {
716
+ const u = Math.max(Qt(t.from, a, i, h), Qt(t.to, a, i, h));
717
+ u > l && (l = u, c = h);
718
718
  }
719
- c !== -1 && (n[c] = 1, r.push([i, c], [c, a]));
719
+ c !== -1 && (n[c] = 1, r.push([a, c], [c, i]));
720
720
  }
721
721
  const s = [], o = [];
722
- for (let i = 0; i < e; i++)
723
- n[i] && (s.push(t.from[i * 2], t.from[i * 2 + 1]), o.push(t.to[i * 2], t.to[i * 2 + 1]));
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
724
  return { from: s, to: o, closed: t.closed };
725
725
  }
726
726
  function Qt(t, e, n, r) {
727
- const s = t[e * 2], o = t[e * 2 + 1], i = t[n * 2] - s, a = t[n * 2 + 1] - o, c = t[r * 2] - s, u = t[r * 2 + 1] - o, l = i * i + a * a, h = l === 0 ? 0 : Math.max(0, Math.min(1, (c * i + u * a) / l));
728
- return Math.hypot(c - h * i, u - h * a);
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, l = t[r * 2 + 1] - o, h = a * a + i * i, u = h === 0 ? 0 : Math.max(0, Math.min(1, (c * a + l * i) / h));
728
+ return Math.hypot(c - u * a, l - u * i);
729
729
  }
730
- function xn(t, e, n) {
730
+ function An(t, e, n) {
731
731
  const r = n.shapeIndex;
732
- if (X && X.from === t && X.to === e && X.shapeIndex === r) return X.plan;
732
+ if (N && N.from === t && N.to === e && N.shapeIndex === r) return N.plan;
733
733
  const o = et.get(String(r ?? "auto"))?.get(t)?.get(e);
734
734
  if (o)
735
- return X = { from: t, to: e, shapeIndex: r, plan: o }, o;
736
- const i = G(t).subpaths.filter((p) => p.length > 0).length === G(e).subpaths.filter((p) => p.length > 0).length, a = jt(t, !i), c = jt(e, !i), u = {
737
- pairs: a.map((p, M) => bn(p, c[M], n))
735
+ return N = { from: t, to: e, shapeIndex: r, plan: o }, o;
736
+ const a = G(t).subpaths.filter((d) => d.length > 0).length === G(e).subpaths.filter((d) => d.length > 0).length, i = jt(t, !a), c = jt(e, !a), l = {
737
+ pairs: i.map((d, m) => wn(d, c[m], n))
738
738
  };
739
- it >= mn && (et.clear(), it = 0);
740
- const l = String(r ?? "auto"), h = et.get(l) ?? /* @__PURE__ */ new Map();
741
- et.set(l, h);
742
- const f = h.get(t) ?? /* @__PURE__ */ new Map();
743
- return h.set(t, f), f.set(e, u), it++, X = { from: t, to: e, shapeIndex: r, plan: u }, u;
739
+ at >= bn && (et.clear(), at = 0);
740
+ const h = String(r ?? "auto"), u = et.get(h) ?? /* @__PURE__ */ new Map();
741
+ et.set(h, u);
742
+ const f = u.get(t) ?? /* @__PURE__ */ new Map();
743
+ return u.set(t, f), f.set(e, l), at++, N = { from: t, to: e, shapeIndex: r, plan: l }, l;
744
744
  }
745
- function kn(t, e, n, r = {}) {
745
+ function vn(t, e, n, r = {}) {
746
746
  if (!t) return e;
747
747
  if (!e) return t;
748
748
  const s = Math.max(0, Math.min(1, n));
749
749
  if (s === 0) return t;
750
750
  if (s === 1) return e;
751
- const o = xn(t, e, r);
751
+ const o = An(t, e, r);
752
752
  if (o.pairs.length === 0) return s < 0.5 ? t : e;
753
- let i = "";
754
- for (const a of o.pairs) {
755
- for (let c = 0; c < a.from.length; c += 2) {
756
- const u = Vt(a.from[c] + (a.to[c] - a.from[c]) * s), l = Vt(a.from[c + 1] + (a.to[c + 1] - a.from[c + 1]) * s);
757
- i += `${c === 0 ? i ? " M" : "M" : " L"}${u} ${l}`;
753
+ let a = "";
754
+ for (const i of o.pairs) {
755
+ for (let c = 0; c < i.from.length; c += 2) {
756
+ const l = Vt(i.from[c] + (i.to[c] - i.from[c]) * s), h = Vt(i.from[c + 1] + (i.to[c + 1] - i.from[c + 1]) * s);
757
+ a += `${c === 0 ? a ? " M" : "M" : " L"}${l} ${h}`;
758
758
  }
759
- a.closed && (i += " Z");
759
+ i.closed && (a += " Z");
760
760
  }
761
- return i;
761
+ return a;
762
762
  }
763
- function Fr() {
764
- et.clear(), it = 0, X = void 0;
763
+ function Yr() {
764
+ et.clear(), at = 0, N = void 0;
765
765
  }
766
- function Sn(t) {
766
+ function Pn(t) {
767
767
  return /^\s*[Mm]\s*[-+]?(?:\d|\.\d)/.test(t);
768
768
  }
769
- const Q = Math.PI / 180, An = 0.9995;
769
+ const Q = Math.PI / 180, Rn = 0.9995;
770
770
  function Dt() {
771
771
  return [0, 0, 0, 1];
772
772
  }
773
- function at(t, e) {
773
+ function it(t, e) {
774
774
  const n = Math.hypot(t[0], t[1], t[2]);
775
775
  if (n === 0) return Dt();
776
776
  const r = e * Q / 2, s = Math.sin(r) / n;
777
777
  return [t[0] * s, t[1] * s, t[2] * s, Math.cos(r)];
778
778
  }
779
- function wn(t, e, n) {
780
- return wt(wt(at([0, 1, 0], e), at([1, 0, 0], t)), at([0, 0, 1], n));
779
+ function $n(t, e, n) {
780
+ return At(At(it([0, 1, 0], e), it([1, 0, 0], t)), it([0, 0, 1], n));
781
781
  }
782
- function vn(t) {
783
- const [e, n, r, s] = Y(t), o = 2 * (e * r + n * s), i = 2 * (e * n + r * s), a = 1 - 2 * (e * e + r * r), c = 2 * (n * r - e * s), u = 1 - 2 * (n * n + r * r), l = 2 * (e * r - n * s), h = 1 - 2 * (e * e + n * n), f = Math.asin(Math.max(-1, Math.min(1, -c)));
784
- return Math.abs(c) < 0.9999999 ? [f / Q, Math.atan2(o, h) / Q, Math.atan2(i, a) / Q] : [f / Q, Math.atan2(-l, u) / Q, 0];
782
+ function Dn(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), l = 1 - 2 * (n * n + r * r), h = 2 * (e * r - n * s), u = 1 - 2 * (e * e + n * n), f = Math.asin(Math.max(-1, Math.min(1, -c)));
784
+ return Math.abs(c) < 0.9999999 ? [f / Q, Math.atan2(o, u) / Q, Math.atan2(a, i) / Q] : [f / Q, Math.atan2(-h, l) / Q, 0];
785
785
  }
786
- function wt(t, e) {
787
- const [n, r, s, o] = t, [i, a, c, u] = e;
786
+ function At(t, e) {
787
+ const [n, r, s, o] = t, [a, i, c, l] = e;
788
788
  return [
789
- o * i + n * u + r * c - s * a,
790
- o * a - n * c + r * u + s * i,
791
- o * c + n * a - r * i + s * u,
792
- o * u - n * i - r * a - s * c
789
+ o * a + n * l + r * c - s * i,
790
+ o * i - n * c + r * l + s * a,
791
+ o * c + n * i - r * a + s * l,
792
+ o * l - n * a - r * i - s * c
793
793
  ];
794
794
  }
795
- function fe(t, e) {
795
+ function de(t, e) {
796
796
  return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] + t[3] * e[3];
797
797
  }
798
798
  function pe(t) {
799
799
  return Math.hypot(t[0], t[1], t[2], t[3]);
800
800
  }
801
- function Y(t) {
801
+ function z(t) {
802
802
  const e = pe(t);
803
803
  return e === 0 ? Dt() : [t[0] / e, t[1] / e, t[2] / e, t[3] / e];
804
804
  }
805
- function Pn(t) {
805
+ function Cn(t) {
806
806
  return [-t[0], -t[1], -t[2], t[3]];
807
807
  }
808
- function de(t, e, n) {
809
- const r = Y(t);
810
- let s = Y(e), o = fe(r, s);
811
- if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > An)
812
- return Y([
808
+ function ge(t, e, n) {
809
+ const r = z(t);
810
+ let s = z(e), o = de(r, s);
811
+ if (o < 0 && (s = [-s[0], -s[1], -s[2], -s[3]], o = -o), o > Rn)
812
+ return z([
813
813
  r[0] + (s[0] - r[0]) * n,
814
814
  r[1] + (s[1] - r[1]) * n,
815
815
  r[2] + (s[2] - r[2]) * n,
816
816
  r[3] + (s[3] - r[3]) * n
817
817
  ]);
818
- const i = Math.acos(o), a = Math.sin(i), c = Math.sin((1 - n) * i) / a, u = Math.sin(n * i) / a;
819
- return Y([
820
- r[0] * c + s[0] * u,
821
- r[1] * c + s[1] * u,
822
- r[2] * c + s[2] * u,
823
- r[3] * c + s[3] * u
818
+ const a = Math.acos(o), i = Math.sin(a), c = Math.sin((1 - n) * a) / i, l = Math.sin(n * a) / i;
819
+ return z([
820
+ r[0] * c + s[0] * l,
821
+ r[1] * c + s[1] * l,
822
+ r[2] * c + s[2] * l,
823
+ r[3] * c + s[3] * l
824
824
  ]);
825
825
  }
826
- function $n(t, e) {
827
- const [n, r, s, o] = Y(t), i = 2 * (r * e[2] - s * e[1]), a = 2 * (s * e[0] - n * e[2]), c = 2 * (n * e[1] - r * e[0]);
828
- return [e[0] + o * i + (r * c - s * a), e[1] + o * a + (s * i - n * c), e[2] + o * c + (n * a - r * i)];
826
+ function In(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 Nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
830
+ const zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
831
831
  __proto__: null,
832
- conjugate: Pn,
833
- dot: fe,
834
- fromAxisAngle: at,
835
- fromEuler: wn,
832
+ conjugate: Cn,
833
+ dot: de,
834
+ fromAxisAngle: it,
835
+ fromEuler: $n,
836
836
  identity: Dt,
837
837
  length: pe,
838
- multiply: wt,
839
- normalize: Y,
840
- rotateVec3: $n,
841
- slerp: de,
842
- toEuler: vn
843
- }, Symbol.toStringTag, { value: "Module" })), N = (t, e, n) => t + (e - t) * n, ge = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
838
+ multiply: At,
839
+ normalize: z,
840
+ rotateVec3: In,
841
+ slerp: ge,
842
+ toEuler: Dn
843
+ }, Symbol.toStringTag, { value: "Module" })), X = (t, e, n) => t + (e - t) * n, me = 512, mt = /* @__PURE__ */ new Map(), yt = /* @__PURE__ */ new Map();
844
844
  function Gt(t) {
845
845
  const e = mt.get(t);
846
846
  if (e) return e;
@@ -849,56 +849,56 @@ function Gt(t) {
849
849
  parseInt(n.slice(2, 4), 16),
850
850
  parseInt(n.slice(4, 6), 16)
851
851
  ];
852
- return mt.size < ge && mt.set(t, r), r;
852
+ return mt.size < me && mt.set(t, r), r;
853
853
  }
854
- const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"), Rn = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Mt = (t) => Math.round(t).toString(16).padStart(2, "0");
855
- function Dn(t, e, n) {
854
+ const Kt = (t) => t.charCodeAt(0) === 35, Zt = (t) => t.startsWith("rgb"), qt = (t) => t.startsWith("rgba"), En = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/, Mt = (t) => Math.round(t).toString(16).padStart(2, "0");
855
+ function Ln(t, e, n) {
856
856
  return `#${Mt(t)}${Mt(e)}${Mt(n)}`;
857
857
  }
858
858
  function Jt(t) {
859
859
  const e = yt.get(t);
860
860
  if (e) return e;
861
- const n = t.match(Rn);
861
+ const n = t.match(En);
862
862
  if (!n)
863
863
  throw new Error(`Invalid rgb color: ${t}`);
864
- const r = parseInt(n[1], 10), s = parseInt(n[2], 10), o = parseInt(n[3], 10), i = n[4] !== void 0 ? [r, s, o, parseFloat(n[4])] : [r, s, o];
865
- return yt.size < ge && yt.set(t, i), i;
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 yt.size < me && yt.set(t, a), a;
866
866
  }
867
- const Cn = (t, e, n) => {
867
+ const On = (t, e, n) => {
868
868
  if (Kt(t) && Kt(e)) {
869
- const [r, s, o] = Gt(t), [i, a, c] = Gt(e), u = N(r, i, n), l = N(s, a, n), h = N(o, c, n);
870
- return Dn(u, l, h);
869
+ const [r, s, o] = Gt(t), [a, i, c] = Gt(e), l = X(r, a, n), h = X(s, i, n), u = X(o, c, n);
870
+ return Ln(l, h, u);
871
871
  }
872
872
  if ((Zt(t) || qt(t)) && (Zt(e) || qt(e))) {
873
- const r = Jt(t), s = Jt(e), o = Math.round(N(r[0], s[0], n)), i = Math.round(N(r[1], s[1], n)), a = Math.round(N(r[2], s[2], n));
873
+ const r = Jt(t), s = Jt(e), o = Math.round(X(r[0], s[0], n)), a = Math.round(X(r[1], s[1], n)), i = Math.round(X(r[2], s[2], n));
874
874
  if (r.length === 4 || s.length === 4) {
875
- const c = r[3] ?? 1, u = s[3] ?? 1, l = N(c, u, n);
876
- return `rgba(${o}, ${i}, ${a}, ${l})`;
875
+ const c = r[3] ?? 1, l = s[3] ?? 1, h = X(c, l, n);
876
+ return `rgba(${o}, ${a}, ${i}, ${h})`;
877
877
  }
878
- return `rgb(${o}, ${i}, ${a})`;
878
+ return `rgb(${o}, ${a}, ${i})`;
879
879
  }
880
880
  return n < 1 ? t : e;
881
- }, In = (t, e, n) => {
881
+ }, Fn = (t, e, n) => {
882
882
  const r = Math.min(t.length, e.length), s = [];
883
883
  for (let o = 0; o < r; o++)
884
- s.push(N(t[o], e[o], n));
884
+ s.push(X(t[o], e[o], n));
885
885
  return s;
886
- }, En = (t, e, n) => de(t, e, n), te = (t, e, n) => n < 1 ? t : e, Ln = (t, e, n) => kn(t, e, n);
887
- function me(t, e) {
888
- return e === "slerp" ? En : typeof t == "number" ? N : Array.isArray(t) ? In : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? Cn : Sn(t) ? Ln : te : te;
886
+ }, Xn = (t, e, n) => ge(t, e, n), te = (t, e, n) => n < 1 ? t : e, Nn = (t, e, n) => vn(t, e, n);
887
+ function ye(t, e) {
888
+ return e === "slerp" ? Xn : typeof t == "number" ? X : Array.isArray(t) ? Fn : typeof t == "string" ? t.startsWith("#") || t.startsWith("rgb") ? On : Pn(t) ? Nn : te : te;
889
889
  }
890
- const ye = 1e3 / 60;
891
- function Me(t, e = {}) {
890
+ const Me = 1e3 / 60;
891
+ function _e(t, e = {}) {
892
892
  if (!j(t))
893
893
  throw new Error(`bakeSpringTrack: track "${t.id}" is not a spring track`);
894
894
  const n = new ut(t.spring);
895
- return be(t, (r) => n.valueAt(r), n.settleTime(), t.spring.from, t.spring.to, e);
895
+ return Te(t, (r) => n.valueAt(r), n.settleTime(), t.spring.from, t.spring.to, e);
896
896
  }
897
- function _e(t, e = {}) {
897
+ function be(t, e = {}) {
898
898
  if (!V(t))
899
899
  throw new Error(`bakeInertiaTrack: track "${t.id}" is not an inertia track`);
900
900
  const n = t.inertia;
901
- return be(
901
+ return Te(
902
902
  t,
903
903
  (r) => kt(n, r),
904
904
  ft(n),
@@ -907,66 +907,66 @@ function _e(t, e = {}) {
907
907
  e
908
908
  );
909
909
  }
910
- function be(t, e, n, r, s, o) {
911
- const i = o.intervalMs ?? ye, a = o.tolerance ?? 0.01, c = t.delay ?? 0, u = [];
912
- for (let h = 0; h <= n; h += i)
913
- u.push({ time: h + c, value: e(h), easing: "linear" });
914
- const l = u[u.length - 1];
915
- return !l || l.time < n + c ? u.push({ time: n + c, value: s, easing: "linear" }) : l.value = s, c > 0 && u.unshift({ time: 0, value: r, easing: "linear" }), {
910
+ function Te(t, e, n, r, s, o) {
911
+ const a = o.intervalMs ?? Me, i = o.tolerance ?? 0.01, c = t.delay ?? 0, l = [];
912
+ for (let u = 0; u <= n; u += a)
913
+ l.push({ time: u + c, value: e(u), easing: "linear" });
914
+ const h = l[l.length - 1];
915
+ return !h || h.time < n + c ? l.push({ time: n + c, value: s, easing: "linear" }) : h.value = s, c > 0 && l.unshift({ time: 0, value: r, easing: "linear" }), {
916
916
  id: t.id,
917
917
  target: t.target,
918
918
  property: t.property,
919
- keyframes: a > 0 ? Nn(u, a) : u,
919
+ keyframes: i > 0 ? Un(l, i) : l,
920
920
  ...t.targets && { targets: [...t.targets] },
921
921
  ...t.stagger && { stagger: { ...t.stagger } }
922
922
  };
923
923
  }
924
- function On(t, e, n, r = {}) {
925
- const s = r.intervalMs ?? ye, o = typeof n == "function" ? n : le(n), i = me(t.value, r.interpolation), a = e.time - t.time;
926
- if (a <= 0) return [e];
924
+ function Yn(t, e, n, r = {}) {
925
+ const s = r.intervalMs ?? Me, o = typeof n == "function" ? n : he(n), a = ye(t.value, r.interpolation), i = e.time - t.time;
926
+ if (i <= 0) return [e];
927
927
  const c = [];
928
- for (let l = s; l < a; l += s) {
929
- const h = l / a;
928
+ for (let h = s; h < i; h += s) {
929
+ const u = h / i;
930
930
  c.push({
931
- time: t.time + l,
932
- value: i(t.value, e.value, o(h)),
931
+ time: t.time + h,
932
+ value: a(t.value, e.value, o(u)),
933
933
  easing: "linear"
934
934
  });
935
935
  }
936
- const u = o(1);
937
- return c.push({ ...e, ...u !== 1 && { value: i(t.value, e.value, u) }, easing: "linear" }), c;
936
+ const l = o(1);
937
+ return c.push({ ...e, ...l !== 1 && { value: a(t.value, e.value, l) }, easing: "linear" }), c;
938
938
  }
939
- function Xr(t, e) {
940
- return j(t) ? Me(t, e) : V(t) ? _e(t, e) : t;
939
+ function Ur(t, e) {
940
+ return j(t) ? _e(t, e) : V(t) ? be(t, e) : t;
941
941
  }
942
- function Fn(t, e = {}) {
942
+ function zn(t, e = {}) {
943
943
  const n = t.keyframes;
944
944
  if (!n.some((o) => xt(o.easing))) return t;
945
945
  const r = n.length > 0 ? [n[0]] : [], s = { ...e, interpolation: t.interpolation ?? e.interpolation };
946
946
  for (let o = 1; o < n.length; o++) {
947
- const i = n[o];
948
- xt(i.easing) ? r.push(...On(n[o - 1], i, i.easing, s)) : r.push(i);
947
+ const a = n[o];
948
+ xt(a.easing) ? r.push(...Yn(n[o - 1], a, a.easing, s)) : r.push(a);
949
949
  }
950
950
  return { ...t, keyframes: r };
951
951
  }
952
- function zr(t, e) {
953
- return t.filter(Le).map((n) => Fn(n, e)).concat(
954
- t.filter(j).map((n) => Me(n, e)),
955
- t.filter(V).map((n) => _e(n, e))
952
+ function Vr(t, e) {
953
+ return t.filter(Xe).map((n) => zn(n, e)).concat(
954
+ t.filter(j).map((n) => _e(n, e)),
955
+ t.filter(V).map((n) => be(n, e))
956
956
  );
957
957
  }
958
- function Nn(t, e) {
958
+ function Un(t, e) {
959
959
  if (t.length <= 2) return t;
960
960
  const n = [t[0]];
961
961
  for (let r = 1; r < t.length - 1; r++) {
962
- const s = n[n.length - 1], o = t[r], i = t[r + 1], a = i.time - s.time;
963
- if (a <= 0) continue;
964
- const c = (o.time - s.time) / a, u = s.value + (i.value - s.value) * c;
965
- Math.abs(o.value - u) > e && n.push(o);
962
+ const s = n[n.length - 1], o = t[r], a = t[r + 1], i = a.time - s.time;
963
+ if (i <= 0) continue;
964
+ const c = (o.time - s.time) / i, l = s.value + (a.value - s.value) * c;
965
+ Math.abs(o.value - l) > e && n.push(o);
966
966
  }
967
967
  return n.push(t[t.length - 1]), n;
968
968
  }
969
- function Xn(t) {
969
+ function Vn(t) {
970
970
  const e = [...t.keyframes].sort((n, r) => n.time - r.time);
971
971
  return {
972
972
  ...t,
@@ -978,7 +978,7 @@ function U(t) {
978
978
  }
979
979
  function K(t, e, n, r) {
980
980
  const s = n ?? 0;
981
- return !r || e <= 1 ? s : s + oe(t, e, r);
981
+ return !r || e <= 1 ? s : s + ae(t, e, r);
982
982
  }
983
983
  class _t {
984
984
  track;
@@ -1004,8 +1004,8 @@ class _t {
1004
1004
  getTargetValues(e) {
1005
1005
  const n = this.targets.length, r = [];
1006
1006
  for (let s = 0; s < n; s++) {
1007
- const o = K(s, n, this.track.delay, this.track.stagger), i = this.valueForOffset(e - o);
1008
- i !== void 0 && r.push({ target: this.targets[s], value: i, start: o + this.track.keyframes[0].time });
1007
+ const o = K(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
1010
  return r;
1011
1011
  }
@@ -1017,7 +1017,7 @@ class _t {
1017
1017
  const { keyframes: e } = this.track;
1018
1018
  if (e.length === 0)
1019
1019
  return 0;
1020
- const n = e[e.length - 1].time, r = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1020
+ const n = e[e.length - 1].time, r = this.track.stagger ? $t(this.targets.length, this.track.stagger) : 0;
1021
1021
  return n + (this.track.delay ?? 0) + r + (this.track.endDelay ?? 0);
1022
1022
  }
1023
1023
  /**
@@ -1040,8 +1040,8 @@ class _t {
1040
1040
  return;
1041
1041
  if (r.time === e)
1042
1042
  return r.value;
1043
- const o = s.time - r.time, i = (e - r.time) / o, c = le(s.easing)(i);
1044
- return me(r.value, this.track.interpolation)(r.value, s.value, c);
1043
+ const o = s.time - r.time, a = (e - r.time) / o, c = he(s.easing)(a);
1044
+ return ye(r.value, this.track.interpolation)(r.value, s.value, c);
1045
1045
  }
1046
1046
  /**
1047
1047
  * Find the keyframes surrounding a given time.
@@ -1054,7 +1054,7 @@ class _t {
1054
1054
  return { from: null, to: null };
1055
1055
  }
1056
1056
  }
1057
- class zn {
1057
+ class jn {
1058
1058
  track;
1059
1059
  targets;
1060
1060
  sampler;
@@ -1074,14 +1074,14 @@ class zn {
1074
1074
  }
1075
1075
  /** Settle time plus delay and the widest stagger offset. */
1076
1076
  getDuration() {
1077
- const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1077
+ const e = this.track.stagger ? $t(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 Yn {
1084
+ class Hn {
1085
1085
  track;
1086
1086
  targets;
1087
1087
  duration;
@@ -1101,60 +1101,60 @@ class Yn {
1101
1101
  }
1102
1102
  /** Settle time plus delay and the widest stagger offset. */
1103
1103
  getDuration() {
1104
- const e = this.track.stagger ? Rt(this.targets.length, this.track.stagger) : 0;
1104
+ const e = this.track.stagger ? $t(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 Te(t, e) {
1112
- const n = { ...hn(t.pathData, e) };
1111
+ function xe(t, e) {
1112
+ const n = { ...gn(t.pathData, e) };
1113
1113
  if (t.matrix) {
1114
- const [r, s, o, i, a, c] = t.matrix, { x: u, y: l } = n;
1115
- n.x = r * u + o * l + a, n.y = s * u + i * l + c;
1116
- const h = n.angle * Math.PI / 180, f = Math.cos(h), p = Math.sin(h);
1117
- n.angle = Math.atan2(s * f + i * p, r * f + o * p) * 180 / Math.PI;
1114
+ const [r, s, o, a, i, c] = t.matrix, { x: l, y: h } = n;
1115
+ n.x = r * l + o * h + i, n.y = s * l + a * h + c;
1116
+ const u = n.angle * Math.PI / 180, f = Math.cos(u), d = Math.sin(u);
1117
+ n.angle = Math.atan2(s * f + a * d, r * f + o * d) * 180 / Math.PI;
1118
1118
  }
1119
1119
  return t.autoRotate && t.rotateOffset && (n.angle += t.rotateOffset), n;
1120
1120
  }
1121
- function Yr(t, e, n, r) {
1121
+ function jr(t, e, n, r) {
1122
1122
  const s = e + (n - e) * r;
1123
- return Te(t, s);
1123
+ return xe(t, s);
1124
1124
  }
1125
1125
  const bt = {
1126
1126
  upperCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
1127
1127
  lowerCase: "abcdefghijklmnopqrstuvwxyz",
1128
1128
  upperAndLowerCase: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
1129
1129
  numbers: "0123456789"
1130
- }, Un = 20;
1131
- function Vn(t) {
1130
+ }, Bn = 20;
1131
+ function Wn(t) {
1132
1132
  const e = bt[t ?? "upperCase"] ?? t ?? bt.upperCase, n = Array.from(e);
1133
1133
  return n.length > 0 ? n : Array.from(bt.upperCase);
1134
1134
  }
1135
- function jn(t, e, n) {
1135
+ function Qn(t, e, n) {
1136
1136
  let r = (t | 0) ^ Math.imul(e + 1, 2654435761) ^ Math.imul(n + 1, 2246822507);
1137
1137
  return r = Math.imul(r ^ r >>> 16, 2146121005), r = Math.imul(r ^ r >>> 15, 2221713035), (r ^ r >>> 16) >>> 0;
1138
1138
  }
1139
- function Hn(t, e, n = 0) {
1139
+ function Gn(t, e, n = 0) {
1140
1140
  const r = t.from ?? "", s = t.to, o = Math.max(0, Math.min(1, e));
1141
1141
  if (o <= 0) return r;
1142
1142
  if (o >= 1) return s;
1143
- const i = Array.from(r), a = Array.from(s), c = t.rightToLeft ?? !1;
1143
+ const a = Array.from(r), i = Array.from(s), c = t.rightToLeft ?? !1;
1144
1144
  if (t.mode === "type") {
1145
- const b = Math.round(o * Math.max(i.length, a.length));
1146
- return c ? i.slice(0, Math.max(0, i.length - b)).join("") + a.slice(Math.max(0, a.length - b)).join("") : a.slice(0, b).join("") + i.slice(b).join("");
1145
+ const y = Math.round(o * Math.max(a.length, i.length));
1146
+ return c ? a.slice(0, Math.max(0, a.length - y)).join("") + i.slice(Math.max(0, i.length - y)).join("") : i.slice(0, y).join("") + a.slice(y).join("");
1147
1147
  }
1148
- const u = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), l = Math.max(0, (o - u) / (1 - u)), h = Math.floor(l * a.length), f = t.tweenLength === !1 ? a.length : Math.round(i.length + (a.length - i.length) * o), p = Vn(t.chars), M = t.refreshRate ?? Un, d = M > 0 ? Math.floor(n * M / 1e3) : 0, g = t.seed ?? 1;
1149
- let _ = "";
1150
- for (let b = 0; b < f; b++) {
1151
- const k = c ? b >= f - h : b < h, w = c ? a[a.length - (f - b)] : a[b];
1148
+ const l = Math.max(0, Math.min(0.999, t.revealDelay ?? 0)), h = Math.max(0, (o - l) / (1 - l)), u = Math.floor(h * i.length), f = t.tweenLength === !1 ? i.length : Math.round(a.length + (i.length - a.length) * o), d = Wn(t.chars), m = t.refreshRate ?? Bn, p = m > 0 ? Math.floor(n * m / 1e3) : 0, g = t.seed ?? 1;
1149
+ let M = "";
1150
+ for (let y = 0; y < f; y++) {
1151
+ const k = c ? y >= f - u : y < u, w = c ? i[i.length - (f - y)] : i[y];
1152
1152
  k && w !== void 0 || w === " " || w === `
1153
- ` ? _ += w : _ += p[jn(g, b, d) % p.length];
1153
+ ` ? M += w : M += d[Qn(g, y, p) % d.length];
1154
1154
  }
1155
- return _;
1155
+ return M;
1156
1156
  }
1157
- class Bn {
1157
+ class ke {
1158
1158
  id;
1159
1159
  name;
1160
1160
  _captions;
@@ -1223,6 +1223,14 @@ class Bn {
1223
1223
  set speed(e) {
1224
1224
  this._config.speed = e;
1225
1225
  }
1226
+ /** Drawings per second (0: every frame); see `TimelineConfig.drawingRate`. */
1227
+ get drawingRate() {
1228
+ return this._config.drawingRate ?? 0;
1229
+ }
1230
+ set drawingRate(e) {
1231
+ const n = { ...this._config };
1232
+ e > 0 ? n.drawingRate = e : delete n.drawingRate, this._config = n;
1233
+ }
1226
1234
  /**
1227
1235
  * Start or resume playback.
1228
1236
  * If at the end and direction is forward, reset to beginning.
@@ -1269,15 +1277,15 @@ class Bn {
1269
1277
  return;
1270
1278
  let s = e * this.speed;
1271
1279
  if (this._repeatDelayRemaining > 0) {
1272
- const a = Math.min(this._repeatDelayRemaining, s);
1273
- if (this._repeatDelayRemaining -= a, s -= a, this._repeatDelayRemaining > 0) {
1280
+ const i = Math.min(this._repeatDelayRemaining, s);
1281
+ if (this._repeatDelayRemaining -= i, s -= i, this._repeatDelayRemaining > 0) {
1274
1282
  this.onUpdate?.(this.getStateAtTime(this._currentTime));
1275
1283
  return;
1276
1284
  }
1277
1285
  this._wrapAfterDelay && (this._wrapAfterDelay = !1, this._currentTime = 0);
1278
1286
  }
1279
1287
  const o = 1e3;
1280
- for (let a = 0; a < o && s > 0 && this._playbackState === "playing"; a++)
1288
+ for (let i = 0; i < o && s > 0 && this._playbackState === "playing"; i++)
1281
1289
  if (this._direction === "forward") {
1282
1290
  const c = n - this._currentTime;
1283
1291
  if (s >= c) {
@@ -1293,21 +1301,21 @@ class Bn {
1293
1301
  } else
1294
1302
  this._currentTime -= s, s = 0;
1295
1303
  }
1296
- const i = this.getStateAtTime(this._currentTime);
1297
- this.onUpdate?.(i);
1304
+ const a = this.getStateAtTime(this._currentTime);
1305
+ this.onUpdate?.(a);
1298
1306
  }
1299
1307
  /**
1300
1308
  * Get the animation state at a specific time.
1301
1309
  */
1302
1310
  getStateAtTime(e) {
1303
1311
  const n = /* @__PURE__ */ new Map();
1304
- if (this._hasSharedWrites())
1312
+ if (e = Ne(e, this._config.drawingRate ?? 0), this._hasSharedWrites())
1305
1313
  this._resolveShared(e, n);
1306
1314
  else
1307
1315
  for (const [r, s] of this._trackPlayers) {
1308
1316
  const o = s.getTrack().property;
1309
- for (const { target: i, value: a, start: c } of s.getTargetValues(e))
1310
- this._write(n, r, i, o, a, e - c);
1317
+ for (const { target: a, value: i, start: c } of s.getTargetValues(e))
1318
+ this._write(n, r, a, o, i, e - c);
1311
1319
  }
1312
1320
  return {
1313
1321
  values: n,
@@ -1333,35 +1341,35 @@ class Bn {
1333
1341
  _resolveShared(e, n) {
1334
1342
  const r = /* @__PURE__ */ new Map();
1335
1343
  for (const [s, o] of this._trackPlayers) {
1336
- const i = o.getTrack().property;
1337
- for (const { target: a, value: c, start: u } of o.getTargetValues(e)) {
1338
- const l = `${a}\0${i}`, h = u <= e, f = r.get(l);
1339
- (!f || (h !== f.started ? h : h ? u >= f.start : u <= f.start)) && r.set(l, { trackId: s, target: a, property: i, value: c, start: u, started: h });
1344
+ const a = o.getTrack().property;
1345
+ for (const { target: i, value: c, start: l } of o.getTargetValues(e)) {
1346
+ const h = `${i}\0${a}`, u = l <= e, f = r.get(h);
1347
+ (!f || (u !== f.started ? u : u ? l >= f.start : l <= f.start)) && r.set(h, { trackId: s, target: i, property: a, value: c, start: l, started: u });
1340
1348
  }
1341
1349
  }
1342
- for (const { trackId: s, target: o, property: i, value: a, start: c } of r.values())
1343
- this._write(n, s, o, i, a, 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);
1344
1352
  }
1345
1353
  /**
1346
1354
  * Write one track's value for a target, expanding the progress of motion paths
1347
1355
  * (into x/y/rotation) and text tracks (into the string). `elapsed` is the time
1348
1356
  * since this target's animation on the track started.
1349
1357
  */
1350
- _write(e, n, r, s, o, i) {
1358
+ _write(e, n, r, s, o, a) {
1351
1359
  if (o === void 0) return;
1352
- let a = e.get(r);
1353
- a || (a = /* @__PURE__ */ new Map(), e.set(r, a));
1360
+ let i = e.get(r);
1361
+ i || (i = /* @__PURE__ */ new Map(), e.set(r, i));
1354
1362
  const c = this._textTracks.get(n);
1355
1363
  if (c && typeof o == "number") {
1356
- a.set("text", Hn(c.textConfig, o, Math.max(0, i)));
1364
+ i.set("text", Gn(c.textConfig, o, Math.max(0, a)));
1357
1365
  return;
1358
1366
  }
1359
- const u = this._motionPathTracks.get(n);
1360
- if (u && typeof o == "number") {
1361
- const l = Te(u.motionPathConfig, o);
1362
- a.set("motionPathX", l.x), a.set("motionPathY", l.y), u.motionPathConfig.autoRotate && a.set("motionPathRotate", l.angle);
1367
+ const l = this._motionPathTracks.get(n);
1368
+ if (l && typeof o == "number") {
1369
+ const h = xe(l.motionPathConfig, o);
1370
+ i.set("motionPathX", h.x), i.set("motionPathY", h.y), l.motionPathConfig.autoRotate && i.set("motionPathRotate", h.angle);
1363
1371
  } else
1364
- a.set(s, o);
1372
+ i.set(s, o);
1365
1373
  }
1366
1374
  /** Cached: does any target+property have more than one track? */
1367
1375
  _sharedWrites = null;
@@ -1386,16 +1394,16 @@ class Bn {
1386
1394
  */
1387
1395
  addTrack(e) {
1388
1396
  if (this._tracks.push(e), this._sharedWrites = null, V(e)) {
1389
- this._trackPlayers.set(e.id, new Yn(e));
1397
+ this._trackPlayers.set(e.id, new Hn(e));
1390
1398
  return;
1391
1399
  }
1392
1400
  if (j(e)) {
1393
- this._trackPlayers.set(e.id, new zn(e)), this._springTracks.set(e.id, e);
1401
+ this._trackPlayers.set(e.id, new jn(e)), this._springTracks.set(e.id, e);
1394
1402
  return;
1395
1403
  }
1396
- if ($t(e))
1404
+ if (Rt(e))
1397
1405
  this._trackPlayers.set(e.id, new _t(e)), this._textTracks.set(e.id, e);
1398
- else if (re(e)) {
1406
+ else if (se(e)) {
1399
1407
  const n = {
1400
1408
  id: e.id,
1401
1409
  target: e.target,
@@ -1479,19 +1487,19 @@ class Bn {
1479
1487
  const r = this._tracks[n], s = this.getTrackSpan(r.id);
1480
1488
  if (s)
1481
1489
  for (let o = 0; o < n; o++) {
1482
- const i = this._tracks[o];
1483
- if (i.property !== r.property) continue;
1484
- const a = U(i).filter((h) => U(r).includes(h));
1485
- if (a.length === 0) continue;
1486
- const c = this.getTrackSpan(i.id);
1490
+ const a = this._tracks[o];
1491
+ if (a.property !== r.property) continue;
1492
+ const i = U(a).filter((u) => U(r).includes(u));
1493
+ if (i.length === 0) continue;
1494
+ const c = this.getTrackSpan(a.id);
1487
1495
  if (!c || !(c.from <= s.to && s.from <= c.to)) continue;
1488
- const l = s.from >= c.from;
1489
- for (const h of a)
1496
+ const h = s.from >= c.from;
1497
+ for (const u of i)
1490
1498
  e.push({
1491
- target: h,
1499
+ target: u,
1492
1500
  property: r.property,
1493
- losingTrackId: l ? i.id : r.id,
1494
- winningTrackId: l ? r.id : i.id
1501
+ losingTrackId: h ? a.id : r.id,
1502
+ winningTrackId: h ? r.id : a.id
1495
1503
  });
1496
1504
  }
1497
1505
  }
@@ -1510,7 +1518,7 @@ class Bn {
1510
1518
  */
1511
1519
  toDefinition() {
1512
1520
  return {
1513
- formatVersion: ne(this._tracks),
1521
+ formatVersion: re(this._tracks),
1514
1522
  id: this.id,
1515
1523
  name: this.name,
1516
1524
  config: { ...this._config },
@@ -1568,31 +1576,31 @@ class Bn {
1568
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);
1569
1577
  }
1570
1578
  }
1571
- const Wn = 100;
1572
- function Ur(t, e, n, r) {
1573
- const s = [], o = [], { duration: i, alternate: a } = r, c = (p, M, d, g) => {
1574
- o.push([p, M]);
1575
- const _ = [];
1576
- t.forEach((b, k) => {
1577
- (d === "forward" ? (g ? b >= p : b > p) && b <= M : (g ? b <= p : b < p) && b >= M) && _.push(k);
1578
- }), _.sort((b, k) => (d === "forward" ? t[b] - t[k] : t[k] - t[b]) || b - k);
1579
- for (const b of _) s.push({ kind: "event", index: b, direction: d });
1579
+ const Kn = 100;
1580
+ function Hr(t, e, n, r) {
1581
+ const s = [], o = [], { duration: a, alternate: i } = r, c = (d, m, p, g) => {
1582
+ o.push([d, m]);
1583
+ const M = [];
1584
+ t.forEach((y, k) => {
1585
+ (p === "forward" ? (g ? y >= d : y > d) && y <= m : (g ? y <= d : y < d) && y >= m) && M.push(k);
1586
+ }), M.sort((y, k) => (p === "forward" ? t[y] - t[k] : t[k] - t[y]) || y - k);
1587
+ for (const y of M) s.push({ kind: "event", index: y, direction: p });
1580
1588
  };
1581
- let u = e.time, l = e.direction, h = e.fresh === !0;
1582
- const f = Math.min(Wn, Math.max(0, n.iteration - e.iteration));
1583
- for (let p = 0; p < f; p++) {
1584
- const M = l === "forward" ? i : 0;
1585
- c(u, M, l, h), s.push({ kind: "repeat" }), a ? (l = l === "forward" ? "reverse" : "forward", u = M, h = !1) : (u = l === "forward" ? 0 : i, h = !0);
1589
+ let l = e.time, h = e.direction, u = e.fresh === !0;
1590
+ const f = Math.min(Kn, Math.max(0, n.iteration - e.iteration));
1591
+ for (let d = 0; d < f; d++) {
1592
+ const m = h === "forward" ? a : 0;
1593
+ c(l, m, h, u), s.push({ kind: "repeat" }), i ? (h = h === "forward" ? "reverse" : "forward", l = m, u = !1) : (l = h === "forward" ? 0 : a, u = !0);
1586
1594
  }
1587
- return f > 0 && r.holding && !a ? { crossings: s, passes: o } : (c(u, n.time, l, h), { crossings: s, passes: o });
1595
+ return f > 0 && r.holding && !i ? { crossings: s, passes: o } : (c(l, n.time, h, u), { crossings: s, passes: o });
1588
1596
  }
1589
- function Qn(t) {
1597
+ function Zn(t) {
1590
1598
  return V(t) ? {
1591
1599
  id: t.id,
1592
1600
  target: t.target,
1593
1601
  property: t.property,
1594
1602
  kind: "inertia",
1595
- inertia: xe(t.inertia),
1603
+ inertia: we(t.inertia),
1596
1604
  ...F(t)
1597
1605
  } : j(t) ? {
1598
1606
  id: t.id,
@@ -1601,14 +1609,14 @@ function Qn(t) {
1601
1609
  kind: "spring",
1602
1610
  spring: { ...t.spring },
1603
1611
  ...F(t)
1604
- } : $t(t) ? {
1612
+ } : Rt(t) ? {
1605
1613
  id: t.id,
1606
1614
  target: t.target,
1607
1615
  property: "text",
1608
1616
  textConfig: { ...t.textConfig },
1609
1617
  keyframes: t.keyframes.map(Tt),
1610
1618
  ...F(t)
1611
- } : re(t) ? {
1619
+ } : se(t) ? {
1612
1620
  id: t.id,
1613
1621
  target: t.target,
1614
1622
  property: "motionPath",
@@ -1624,7 +1632,7 @@ function Qn(t) {
1624
1632
  ...F(t)
1625
1633
  };
1626
1634
  }
1627
- function xe(t) {
1635
+ function we(t) {
1628
1636
  return { ...t, ...Array.isArray(t.end) && { end: [...t.end] } };
1629
1637
  }
1630
1638
  function Tt(t) {
@@ -1643,7 +1651,7 @@ function F(t) {
1643
1651
  ...t.stagger !== void 0 && { stagger: { ...t.stagger } }
1644
1652
  };
1645
1653
  }
1646
- function Gn(t) {
1654
+ function qn(t) {
1647
1655
  if (V(t)) {
1648
1656
  const e = t;
1649
1657
  return {
@@ -1651,7 +1659,7 @@ function Gn(t) {
1651
1659
  target: e.target,
1652
1660
  property: e.property,
1653
1661
  kind: "inertia",
1654
- inertia: xe(e.inertia),
1662
+ inertia: we(e.inertia),
1655
1663
  ...F(e)
1656
1664
  };
1657
1665
  }
@@ -1666,7 +1674,7 @@ function Gn(t) {
1666
1674
  ...F(e)
1667
1675
  };
1668
1676
  }
1669
- if ($t(t)) {
1677
+ if (Rt(t)) {
1670
1678
  const e = t;
1671
1679
  return {
1672
1680
  id: e.id,
@@ -1688,7 +1696,7 @@ function Gn(t) {
1688
1696
  ...F(e)
1689
1697
  };
1690
1698
  }
1691
- return Xn({
1699
+ return Vn({
1692
1700
  id: t.id,
1693
1701
  target: t.target,
1694
1702
  property: t.property,
@@ -1697,10 +1705,10 @@ function Gn(t) {
1697
1705
  ...F(t)
1698
1706
  });
1699
1707
  }
1700
- function Kn(t) {
1708
+ function Jn(t) {
1701
1709
  const e = t._config.markers;
1702
1710
  return {
1703
- formatVersion: ne(t.tracks),
1711
+ formatVersion: re(t.tracks),
1704
1712
  id: t.id,
1705
1713
  name: t.name,
1706
1714
  config: {
@@ -1709,40 +1717,41 @@ function Kn(t) {
1709
1717
  speed: t._config.speed,
1710
1718
  alternate: t._config.alternate,
1711
1719
  repeatDelay: t._config.repeatDelay,
1720
+ ...t._config.drawingRate ? { drawingRate: t._config.drawingRate } : {},
1712
1721
  ...e && { markers: e.map((n) => ({ ...n })) }
1713
1722
  },
1714
- tracks: t.tracks.map(Qn),
1723
+ tracks: t.tracks.map(Zn),
1715
1724
  ...t.captions && { captions: JSON.parse(JSON.stringify(t.captions)) }
1716
1725
  };
1717
1726
  }
1718
- function Zn(t) {
1727
+ function tr(t) {
1719
1728
  const e = t.formatVersion ?? 1;
1720
- if (e > Xt)
1729
+ if (e > Nt)
1721
1730
  throw new Error(
1722
- `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Xt}. Update tinyfly to play it.`
1731
+ `tinyfly: this animation uses format version ${e}, but this tinyfly reads up to version ${Nt}. Update tinyfly to play it.`
1723
1732
  );
1724
- return new Bn({
1733
+ return new ke({
1725
1734
  id: t.id,
1726
1735
  name: t.name,
1727
1736
  config: t.config,
1728
- tracks: t.tracks.map(Gn),
1737
+ tracks: t.tracks.map(qn),
1729
1738
  captions: t.captions
1730
1739
  });
1731
1740
  }
1732
- function Vr(t) {
1733
- return JSON.stringify(Kn(t));
1741
+ function Br(t) {
1742
+ return JSON.stringify(Jn(t));
1734
1743
  }
1735
- function jr(t) {
1744
+ function Wr(t) {
1736
1745
  const e = JSON.parse(t);
1737
- return Zn(e);
1746
+ return tr(e);
1738
1747
  }
1739
- function Hr(t) {
1748
+ function Qr(t) {
1740
1749
  let e = 2166136261;
1741
1750
  for (let n = 0; n < t.length; n++)
1742
1751
  e ^= t.charCodeAt(n), e = Math.imul(e, 16777619);
1743
1752
  return e >>> 0;
1744
1753
  }
1745
- function qn(t) {
1754
+ function Se(t) {
1746
1755
  let e = t >>> 0 || 2654435769;
1747
1756
  return {
1748
1757
  seed: t >>> 0,
@@ -1751,281 +1760,337 @@ function qn(t) {
1751
1760
  }
1752
1761
  };
1753
1762
  }
1754
- function ke(t, e, n) {
1763
+ function Ae(t, e, n) {
1755
1764
  return e + t.next() * (n - e);
1756
1765
  }
1757
- function Jn(t, e, n, r) {
1758
- if (r <= 0) return ke(t, e, n);
1766
+ function er(t, e, n, r) {
1767
+ if (r <= 0) return Ae(t, e, n);
1759
1768
  const s = Math.floor((n - e) / r), o = Math.round(t.next() * s);
1760
1769
  return e + o * r;
1761
1770
  }
1762
- function Br(t, e) {
1771
+ function Gr(t, e) {
1763
1772
  if (e.length !== 0)
1764
1773
  return e[Math.floor(t.next() * e.length)];
1765
1774
  }
1766
- const Se = /^([+\-*/])=\s*(-?[\d.]+)$/, Ae = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1767
- function Wr(t) {
1768
- return typeof t != "string" ? !1 : Se.test(t.trim()) || Ae.test(t.trim());
1775
+ const ve = /^([+\-*/])=\s*(-?[\d.]+)$/, Pe = /^random\(\s*(-?[\d.]+)\s*,\s*(-?[\d.]+)\s*(?:,\s*(-?[\d.]+)\s*)?\)$/i;
1776
+ function Kr(t) {
1777
+ return typeof t != "string" ? !1 : ve.test(t.trim()) || Pe.test(t.trim());
1769
1778
  }
1770
- function we(t, e = {}) {
1779
+ function Re(t, e = {}) {
1771
1780
  if (typeof t != "string") return t;
1772
- const n = t.trim(), r = Se.exec(n);
1781
+ const n = t.trim(), r = ve.exec(n);
1773
1782
  if (r) {
1774
- const [, o, i] = r, a = e.base ?? 0, c = Number.parseFloat(i);
1783
+ const [, o, a] = r, i = e.base ?? 0, c = Number.parseFloat(a);
1775
1784
  switch (o) {
1776
1785
  case "+":
1777
- return a + c;
1786
+ return i + c;
1778
1787
  case "-":
1779
- return a - c;
1788
+ return i - c;
1780
1789
  case "*":
1781
- return a * c;
1790
+ return i * c;
1782
1791
  case "/":
1783
- return c === 0 ? a : a / c;
1792
+ return c === 0 ? i : i / c;
1784
1793
  }
1785
1794
  }
1786
- const s = Ae.exec(n);
1795
+ const s = Pe.exec(n);
1787
1796
  if (s) {
1788
1797
  if (!e.random)
1789
1798
  throw new Error(
1790
1799
  `resolveValue: "${n}" needs a random source — pass one via context.random`
1791
1800
  );
1792
- const o = Number.parseFloat(s[1]), i = Number.parseFloat(s[2]), a = s[3] !== void 0 ? Number.parseFloat(s[3]) : void 0;
1793
- return a !== void 0 ? Jn(e.random, o, i, a) : ke(e.random, o, i);
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 ? er(e.random, o, a, i) : Ae(e.random, o, a);
1794
1803
  }
1795
1804
  return t;
1796
1805
  }
1797
- function tr(t, e = 0, n) {
1806
+ function nr(t, e = 0, n) {
1798
1807
  const r = [];
1799
1808
  let s = e;
1800
1809
  for (const o of t) {
1801
- const i = we(o, { base: s, random: n });
1802
- r.push(i), typeof i == "number" && (s = i);
1810
+ const a = Re(o, { base: s, random: n });
1811
+ r.push(a), typeof a == "number" && (s = a);
1803
1812
  }
1804
1813
  return r;
1805
1814
  }
1806
- class Qr {
1815
+ class Zr {
1807
1816
  random;
1808
1817
  constructor(e) {
1809
- this.random = qn(e);
1818
+ this.random = Se(e);
1810
1819
  }
1811
1820
  /** The seed, to be stored alongside the timeline so this can be reproduced. */
1812
1821
  get seed() {
1813
1822
  return this.random.seed;
1814
1823
  }
1815
1824
  resolve(e, n = 0) {
1816
- return we(e, { base: n, random: this.random });
1825
+ return Re(e, { base: n, random: this.random });
1817
1826
  }
1818
1827
  resolveSequence(e, n = 0) {
1819
- return tr(e, n, this.random);
1828
+ return nr(e, n, this.random);
1820
1829
  }
1821
1830
  }
1822
- const er = 600;
1823
- function Gr(t) {
1831
+ const rr = 600;
1832
+ function qr(t) {
1824
1833
  if (Array.isArray(t)) {
1825
- const [f, p, M, d] = t;
1826
- return { fn: ee(f, p, M, d), bezier: [f, p, M, d] };
1834
+ const [f, d, m, p] = t;
1835
+ return { fn: ee(f, d, m, p), bezier: [f, d, m, p] };
1827
1836
  }
1828
1837
  const { segments: e } = G(t);
1829
1838
  if (e.length === 0) throw new Error(`customEase: no curve in "${t}"`);
1830
- const n = e[0].startX, r = e[0].startY, s = e[e.length - 1], o = s.endX - n, i = s.endY - r;
1831
- if (o === 0 || i === 0) throw new Error(`customEase: "${t}" must move along both axes`);
1832
- const a = (f) => (f - n) / o, c = (f) => (f - r) / i;
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 = (f) => (f - n) / o, c = (f) => (f - r) / a;
1833
1842
  if (e.length === 1 && s.type === "C") {
1834
- const [f, p, M, d] = s.points, g = [a(f), c(p), a(M), c(d)];
1843
+ const [f, d, m, p] = s.points, g = [i(f), c(d), i(m), c(p)];
1835
1844
  return { fn: ee(...g), bezier: g };
1836
1845
  }
1837
- const u = [], l = [], h = Math.max(8, Math.ceil(er / e.length));
1846
+ const l = [], h = [], u = Math.max(8, Math.ceil(rr / e.length));
1838
1847
  for (const f of e)
1839
- for (let p = u.length === 0 ? 0 : 1; p <= h; p++) {
1840
- const [M, d] = nr(f, p / h);
1841
- u.push(a(M)), l.push(c(d));
1848
+ for (let d = l.length === 0 ? 0 : 1; d <= u; d++) {
1849
+ const [m, p] = sr(f, d / u);
1850
+ l.push(i(m)), h.push(c(p));
1842
1851
  }
1843
- return { fn: rr(u, l) };
1852
+ return { fn: or(l, h) };
1844
1853
  }
1845
- function Kr(t = {}) {
1854
+ function Jr(t = {}) {
1846
1855
  const n = 0.1 + Math.max(0, Math.min(1, t.strength ?? 0.7)) * 0.7, r = [1];
1847
1856
  for (let o = n; o > 2e-3; o *= n) r.push(2 * Math.sqrt(o));
1848
- const s = r.reduce((o, i) => o + i, 0);
1857
+ const s = r.reduce((o, a) => o + a, 0);
1849
1858
  return (o) => {
1850
1859
  if (o <= 0) return 0;
1851
1860
  if (o >= 1) return 1;
1852
- let i = o * s;
1853
- for (let a = 0; a < r.length; a++) {
1854
- if (i <= r[a]) {
1855
- if (a === 0) return (i / r[0]) ** 2;
1856
- const c = r[a] / 2, u = c * c, l = i - c;
1857
- return 1 - (u - l * l);
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, l = c * c, h = a - c;
1866
+ return 1 - (l - h * h);
1858
1867
  }
1859
- i -= r[a];
1868
+ a -= r[i];
1860
1869
  }
1861
1870
  return 1;
1862
1871
  };
1863
1872
  }
1864
- function Zr(t = {}) {
1873
+ function ts(t = {}) {
1865
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;
1866
1875
  return (s) => s <= 0 || s >= 1 ? 0 : Math.sin(s * e * Math.PI * 2) * r(s);
1867
1876
  }
1868
- function nr(t, e) {
1877
+ function sr(t, e) {
1869
1878
  if (t.type === "L") {
1870
- const [u, l] = t.points;
1871
- return [t.startX + (u - t.startX) * e, t.startY + (l - t.startY) * e];
1879
+ const [l, h] = t.points;
1880
+ return [t.startX + (l - t.startX) * e, t.startY + (h - t.startY) * e];
1872
1881
  }
1873
- const [n, r, s, o, i, a] = t.points, c = 1 - e;
1882
+ const [n, r, s, o, a, i] = t.points, c = 1 - e;
1874
1883
  return [
1875
- c * c * c * t.startX + 3 * c * c * e * n + 3 * c * e * e * s + e * e * e * i,
1876
- c * c * c * t.startY + 3 * c * c * e * r + 3 * c * e * e * o + e * e * e * a
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
1877
1886
  ];
1878
1887
  }
1879
- function rr(t, e) {
1888
+ function or(t, e) {
1880
1889
  return (n) => {
1881
1890
  if (n <= t[0]) return e[0];
1882
1891
  if (n >= t[t.length - 1]) return e[e.length - 1];
1883
1892
  let r = 0, s = t.length - 1;
1884
1893
  for (; s - r > 1; ) {
1885
- const i = r + s >> 1;
1886
- t[i] <= n ? r = i : s = i;
1894
+ const a = r + s >> 1;
1895
+ t[a] <= n ? r = a : s = a;
1887
1896
  }
1888
1897
  const o = t[s] - t[r];
1889
1898
  return o === 0 ? e[s] : e[r] + (n - t[r]) / o * (e[s] - e[r]);
1890
1899
  };
1891
1900
  }
1892
1901
  function ee(t, e, n, r) {
1893
- const s = (i, a, c) => 3 * (1 - i) * (1 - i) * i * a + 3 * (1 - i) * i * i * c + i * i * i, o = (i, a, c) => 3 * (1 - i) * (1 - i) * a + 6 * (1 - i) * i * (c - a) + 3 * i * i * (1 - c);
1894
- return (i) => {
1895
- if (i <= 0) return 0;
1896
- if (i >= 1) return 1;
1897
- let a = i;
1898
- for (let l = 0; l < 8; l++) {
1899
- const h = s(a, t, n) - i, f = o(a, t, n);
1900
- if (Math.abs(h) < 1e-6) return s(a, e, 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
+ for (let h = 0; h < 8; h++) {
1908
+ const u = s(i, t, n) - a, f = o(i, t, n);
1909
+ if (Math.abs(u) < 1e-6) return s(i, e, r);
1901
1910
  if (Math.abs(f) < 1e-6) break;
1902
- a -= h / f;
1911
+ i -= u / f;
1903
1912
  }
1904
- let c = 0, u = 1;
1905
- a = i;
1906
- for (let l = 0; l < 40; l++)
1907
- s(a, t, n) < i ? c = a : u = a, a = (c + u) / 2;
1908
- return s(a, e, r);
1913
+ let c = 0, l = 1;
1914
+ i = a;
1915
+ for (let h = 0; h < 40; h++)
1916
+ s(i, t, n) < a ? c = i : l = i, i = (c + l) / 2;
1917
+ return s(i, e, r);
1909
1918
  };
1910
1919
  }
1911
- const sr = 350, or = 300, ir = 550;
1912
- function qr(t, e = {}) {
1913
- const n = e.lead ?? sr, r = e.gap ?? or, s = e.tail ?? ir, o = [];
1914
- let i = 0;
1915
- return t.forEach((a, c) => {
1916
- const u = [];
1917
- let l = i + n;
1918
- a.lines.forEach((f, p) => {
1920
+ const ar = 350, ir = 300, cr = 550;
1921
+ function es(t, e = {}) {
1922
+ const n = e.lead ?? ar, r = e.gap ?? ir, s = e.tail ?? cr, o = [];
1923
+ let a = 0;
1924
+ return t.forEach((i, c) => {
1925
+ const l = [];
1926
+ let h = a + n;
1927
+ i.lines.forEach((f, d) => {
1919
1928
  if (!(f.duration >= 0))
1920
- throw new Error(`narration: scene ${c} line ${p} has an invalid duration (${f.duration})`);
1921
- p > 0 && (l += r), u.push({
1922
- id: f.id ?? `s${c}-l${p}`,
1929
+ throw new Error(`narration: scene ${c} line ${d} has an invalid duration (${f.duration})`);
1930
+ d > 0 && (h += r), l.push({
1931
+ id: f.id ?? `s${c}-l${d}`,
1923
1932
  scene: c,
1924
- line: p,
1925
- start: l,
1926
- end: l + f.duration,
1933
+ line: d,
1934
+ start: h,
1935
+ end: h + f.duration,
1927
1936
  text: f.text
1928
- }), l += f.duration;
1937
+ }), h += f.duration;
1929
1938
  });
1930
- const h = l + s + (a.tail ?? 0);
1931
- o.push({ id: a.id ?? `s${c}`, start: i, duration: h - i, cues: u }), i = h;
1932
- }), { duration: i, scenes: o, cues: o.flatMap((a) => a.cues) };
1939
+ const u = h + s + (i.tail ?? 0);
1940
+ o.push({ id: i.id ?? `s${c}`, start: a, duration: u - a, cues: l }), a = u;
1941
+ }), { duration: a, scenes: o, cues: o.flatMap((i) => i.cues) };
1933
1942
  }
1934
- function Jr(t) {
1943
+ function ns(t) {
1935
1944
  return t.cues.map((e) => ({ id: e.id, time: e.start, label: e.text }));
1936
1945
  }
1937
- function ts(t, e) {
1946
+ function rs(t, e) {
1938
1947
  let n = t.scenes[0];
1939
1948
  for (const r of t.scenes)
1940
1949
  if (e >= r.start) n = r;
1941
1950
  else break;
1942
1951
  return n;
1943
1952
  }
1944
- const ve = (t) => 6e4 / t.bpm;
1953
+ const $e = (t) => 6e4 / t.bpm;
1945
1954
  function Ct(t, e) {
1946
- return t.offset + e * ve(t);
1955
+ return t.offset + e * $e(t);
1947
1956
  }
1948
1957
  function It(t, e) {
1949
- return (e - t.offset) / ve(t);
1958
+ return (e - t.offset) / $e(t);
1950
1959
  }
1951
- function es(t, e) {
1960
+ function ss(t, e) {
1952
1961
  return Ct(t, Math.round(It(t, e)));
1953
1962
  }
1954
- function ns(t, e) {
1963
+ function os(t, e) {
1955
1964
  return Ct(t, Math.ceil(It(t, e) - 1e-9));
1956
1965
  }
1957
- function rs(t, e, n) {
1966
+ function as(t, e, n) {
1958
1967
  const r = Math.max(1, Math.round(t.beatsPerBar ?? 4)), s = [];
1959
1968
  if (!(t.bpm > 0) || n < e) return s;
1960
1969
  for (let o = Math.ceil(It(t, e) - 1e-9); ; o++) {
1961
- const i = Ct(t, o);
1962
- if (i > n + 1e-9) break;
1963
- s.push({ time: i, bar: (o % r + r) % r === 0, n: o });
1970
+ const a = Ct(t, o);
1971
+ if (a > n + 1e-9) break;
1972
+ s.push({ time: a, bar: (o % r + r) % r === 0, n: o });
1964
1973
  }
1965
1974
  return s;
1966
1975
  }
1967
1976
  const B = 100;
1968
- function ss(t, e, n = {}) {
1969
- const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), i = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), a = Math.floor(i / o);
1970
- if (a < 4) return { bpm: 120, offset: 0, confidence: 0 };
1971
- const c = new Float64Array(a);
1972
- for (let m = 0; m < a; m++) {
1977
+ function is(t, e, n = {}) {
1978
+ const r = n.minBpm ?? 70, s = n.maxBpm ?? 180, o = Math.max(1, Math.round(e / B)), a = Math.min(t.length, Math.round((n.maxSeconds ?? 60) * e)), i = Math.floor(a / o);
1979
+ if (i < 4) return { bpm: 120, offset: 0, confidence: 0 };
1980
+ const c = new Float64Array(i);
1981
+ for (let _ = 0; _ < i; _++) {
1973
1982
  let T = 0;
1974
- for (let x = m * o; x < (m + 1) * o; x++) T += t[x] * t[x];
1975
- c[m] = Math.log(1e-6 + T / o);
1976
- }
1977
- const u = new Float64Array(a);
1978
- for (let m = 1; m < a; m++) u[m] = Math.max(0, c[m] - c[m - 1]);
1979
- const l = u.reduce((m, T) => m + T, 0) / a;
1980
- for (let m = 0; m < a; m++) u[m] = Math.max(0, u[m] - l);
1981
- const h = Math.max(1, Math.floor(60 * B / s)), f = Math.min(a - 1, Math.ceil(60 * B / r)), p = (m) => {
1983
+ for (let x = _ * o; x < (_ + 1) * o; x++) T += t[x] * t[x];
1984
+ c[_] = Math.log(1e-6 + T / o);
1985
+ }
1986
+ const l = new Float64Array(i);
1987
+ for (let _ = 1; _ < i; _++) l[_] = Math.max(0, c[_] - c[_ - 1]);
1988
+ const h = l.reduce((_, T) => _ + T, 0) / i;
1989
+ for (let _ = 0; _ < i; _++) l[_] = Math.max(0, l[_] - h);
1990
+ const u = Math.max(1, Math.floor(60 * B / s)), f = Math.min(i - 1, Math.ceil(60 * B / r)), d = (_) => {
1982
1991
  let T = 0;
1983
- for (let x = m; x < a; x++) T += u[x] * u[x - m];
1984
- return T / (a - m);
1992
+ for (let x = _; x < i; x++) T += l[x] * l[x - _];
1993
+ return T / (i - _);
1985
1994
  };
1986
- let M = 0;
1987
- for (let m = 0; m < a; m++) M += u[m] * u[m];
1988
- M /= a;
1989
- let d = h, g = -1 / 0;
1990
- for (let m = h; m <= f; m++) {
1991
- const T = 60 * B / m, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = p(m) * x;
1992
- S > g && (g = S, d = m);
1993
- }
1994
- const _ = (m) => {
1995
- const T = Math.floor(m);
1996
- return T < 0 || T + 1 >= a ? 0 : u[T] + (u[T + 1] - u[T]) * (m - T);
1997
- }, b = (m, T) => {
1995
+ let m = 0;
1996
+ for (let _ = 0; _ < i; _++) m += l[_] * l[_];
1997
+ m /= i;
1998
+ let p = u, g = -1 / 0;
1999
+ for (let _ = u; _ <= f; _++) {
2000
+ const T = 60 * B / _, x = Math.exp(-0.5 * (Math.log2(T / 120) / 0.9) ** 2), S = d(_) * x;
2001
+ S > g && (g = S, p = _);
2002
+ }
2003
+ const M = (_) => {
2004
+ const T = Math.floor(_);
2005
+ return T < 0 || T + 1 >= i ? 0 : l[T] + (l[T + 1] - l[T]) * (_ - T);
2006
+ }, y = (_, T) => {
1998
2007
  let x = 0;
1999
- for (let S = T; S < a; S += m) x += _(S);
2008
+ for (let S = T; S < i; S += _) x += M(S);
2000
2009
  return x;
2001
2010
  };
2002
- let k = d, w = 0, y = -1 / 0;
2003
- for (let m = d - 0.6; m <= d + 0.6 + 1e-9; m += 0.02) {
2004
- if (m < 1) continue;
2005
- const T = Math.max(1, Math.round(m * 4));
2011
+ let k = p, w = 0, b = -1 / 0;
2012
+ for (let _ = p - 0.6; _ <= p + 0.6 + 1e-9; _ += 0.02) {
2013
+ if (_ < 1) continue;
2014
+ const T = Math.max(1, Math.round(_ * 4));
2006
2015
  for (let x = 0; x < T; x++) {
2007
- const S = x / T * m, $ = b(m, S);
2008
- $ > y && (y = $, w = S, k = m);
2016
+ const S = x / T * _, R = y(_, S);
2017
+ R > b && (b = R, w = S, k = _);
2009
2018
  }
2010
2019
  }
2011
- const v = 60 * B / k, A = M > 0 ? Math.max(0, Math.min(1, p(d) / M)) : 0, D = (w + 0.5) * 1e3 / B;
2020
+ const v = 60 * B / k, A = m > 0 ? Math.max(0, Math.min(1, d(p) / m)) : 0, D = (w + 0.5) * 1e3 / B;
2012
2021
  return { bpm: Math.round(v * 100) / 100, offset: Math.round(D % (6e4 / v)), confidence: A };
2013
2022
  }
2023
+ const ur = 600, lr = 250, ne = 1;
2024
+ function cs(t, e) {
2025
+ const n = e.target ?? "Camera", r = { x: e.stage.width / 2, y: e.stage.height / 2 }, s = {}, o = (u, f, d, m) => {
2026
+ const p = s[u] ??= [];
2027
+ for (; p.length > 0 && p[p.length - 1].time >= f; ) p.pop();
2028
+ p.push({ time: f, value: d, ...m ? { easing: m } : {} });
2029
+ }, a = (u) => {
2030
+ const f = u.rotate * Math.PI / 180, d = (u.focusX - r.x) * u.scale, m = (u.focusY - r.y) * u.scale;
2031
+ return {
2032
+ x: -(d * Math.cos(f) - m * Math.sin(f)),
2033
+ y: -(d * Math.sin(f) + m * Math.cos(f)),
2034
+ scale: u.scale,
2035
+ rotate: u.rotate
2036
+ };
2037
+ }, i = (u, f, d) => {
2038
+ const m = a(f);
2039
+ for (const p of ["x", "y", "scale", "rotate"]) o(p, u, m[p], d);
2040
+ };
2041
+ let c = { focusX: r.x, focusY: r.y, scale: 1, rotate: 0 };
2042
+ const l = [...t].sort((u, f) => u.at - f.at), h = l.filter((u) => !("shake" in u));
2043
+ h.length > 0 && i(0, c);
2044
+ for (const u of h)
2045
+ if ("frame" in u) {
2046
+ const f = Math.max(ne, u.duration ?? ur);
2047
+ i(u.at, c), c = {
2048
+ focusX: u.frame.focus?.x ?? r.x,
2049
+ focusY: u.frame.focus?.y ?? r.y,
2050
+ scale: u.frame.scale ?? 1,
2051
+ rotate: u.frame.rotate ?? 0
2052
+ }, i(u.at + f, c, u.easing ?? (f > ne ? "ease-in-out" : void 0));
2053
+ } else {
2054
+ const { follow: f } = u, d = f.lag ?? lr, m = new ke({ id: "follow", tracks: [{ id: "x", target: "s", property: "x", keyframes: f.x }] }), p = (y) => m.getStateAtTime(y).values.get("s")?.get("x") ?? c.focusX, g = [u.at, ...f.x.map((y) => y.time).filter((y) => y > u.at && y < u.until), u.until];
2055
+ i(u.at, c);
2056
+ const M = (y) => ({
2057
+ focusX: p(y) + (f.lead ?? 0),
2058
+ focusY: f.y ?? c.focusY,
2059
+ scale: f.scale ?? c.scale,
2060
+ rotate: c.rotate
2061
+ });
2062
+ for (const y of g) {
2063
+ const k = f.x.find((w) => w.time === y)?.easing;
2064
+ i(y + d, M(y), y === u.at ? "ease-in-out" : k);
2065
+ }
2066
+ c = M(u.until);
2067
+ }
2068
+ for (const u of l.filter((f) => "shake" in f)) {
2069
+ const f = u.shake.strength ?? 12, d = u.shake.roll ?? 1.5, m = 1e3 / (u.shake.frequency ?? 24), p = Se(u.shake.seed ?? Math.round(u.at) + 1), g = () => p.next() * 2 - 1;
2070
+ for (const M of ["shakeX", "shakeY", "shakeRotate"]) o(M, u.at, 0);
2071
+ for (let M = u.at + m; M < u.at + u.duration; M += m) {
2072
+ const y = 1 - (M - u.at) / u.duration;
2073
+ o("shakeX", M, g() * f * y), o("shakeY", M, g() * f * y), o("shakeRotate", M, g() * d * y);
2074
+ }
2075
+ for (const M of ["shakeX", "shakeY", "shakeRotate"]) o(M, u.at + u.duration, 0, "ease-out");
2076
+ }
2077
+ return Object.entries(s).map(([u, f]) => ({ id: `${n}-${u}`, target: n, property: u, keyframes: f }));
2078
+ }
2014
2079
  const O = (t) => Math.round(t * 1e3) / 1e3;
2015
- function os(t, e = {}) {
2080
+ function us(t, e = {}) {
2016
2081
  if (t.length === 0) return "";
2017
2082
  const n = e.curviness ?? 1, r = e.closed ?? !1, s = t.length;
2018
2083
  let o = `M${O(t[0].x)} ${O(t[0].y)}`;
2019
2084
  if (s === 1) return o;
2020
- const i = (c) => r ? t[(c % s + s) % s] : t[Math.max(0, Math.min(s - 1, c))], a = r ? s : s - 1;
2021
- for (let c = 0; c < a; c++) {
2022
- const u = i(c - 1), l = i(c), h = i(c + 1), f = i(c + 2);
2085
+ const a = (c) => r ? t[(c % s + s) % s] : t[Math.max(0, Math.min(s - 1, c))], i = r ? s : s - 1;
2086
+ for (let c = 0; c < i; c++) {
2087
+ const l = a(c - 1), h = a(c), u = a(c + 1), f = a(c + 2);
2023
2088
  if (n === 0) {
2024
- o += ` L${O(h.x)} ${O(h.y)}`;
2089
+ o += ` L${O(u.x)} ${O(u.y)}`;
2025
2090
  continue;
2026
2091
  }
2027
- const p = n / 6, M = l.x + (h.x - u.x) * p, d = l.y + (h.y - u.y) * p, g = h.x - (f.x - l.x) * p, _ = h.y - (f.y - l.y) * p;
2028
- o += ` C${O(M)} ${O(d)} ${O(g)} ${O(_)} ${O(h.x)} ${O(h.y)}`;
2092
+ const d = n / 6, m = h.x + (u.x - l.x) * d, p = h.y + (u.y - l.y) * d, g = u.x - (f.x - h.x) * d, M = u.y - (f.y - h.y) * d;
2093
+ o += ` C${O(m)} ${O(p)} ${O(g)} ${O(M)} ${O(u.x)} ${O(u.y)}`;
2029
2094
  }
2030
2095
  return r ? `${o} Z` : o;
2031
2096
  }
@@ -2033,12 +2098,12 @@ const C = (t, e = 0) => {
2033
2098
  const n = parseFloat(t ?? "");
2034
2099
  return Number.isFinite(n) ? n : e;
2035
2100
  };
2036
- function ar(t) {
2101
+ function hr(t) {
2037
2102
  const e = (t ?? "").trim().split(/[\s,]+/).filter(Boolean).map(Number), n = [];
2038
2103
  for (let r = 0; r + 1 < e.length; r += 2) n.push({ x: e[r], y: e[r + 1] });
2039
2104
  return n;
2040
2105
  }
2041
- function is(t) {
2106
+ function ls(t) {
2042
2107
  const e = t.attributes;
2043
2108
  switch (t.tag.toLowerCase()) {
2044
2109
  case "path":
@@ -2050,14 +2115,14 @@ function is(t) {
2050
2115
  }
2051
2116
  case "rect": {
2052
2117
  const n = C(e.x), r = C(e.y), s = C(e.width), o = C(e.height);
2053
- let i = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, a = e.ry != null ? C(e.ry) : i;
2054
- return i = Math.min(i, s / 2), a = Math.min(a, o / 2), i === 0 || a === 0 ? `M${n} ${r} H${n + s} V${r + o} H${n} Z` : `M${n + i} ${r} H${n + s - i} A${i} ${a} 0 0 1 ${n + s} ${r + a} V${r + o - a} A${i} ${a} 0 0 1 ${n + s - i} ${r + o} H${n + i} A${i} ${a} 0 0 1 ${n} ${r + o - a} V${r + a} A${i} ${a} 0 0 1 ${n + i} ${r} Z`;
2118
+ let a = e.rx != null ? C(e.rx) : e.ry != null ? C(e.ry) : 0, i = e.ry != null ? C(e.ry) : a;
2119
+ 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`;
2055
2120
  }
2056
2121
  case "line":
2057
2122
  return `M${C(e.x1)} ${C(e.y1)} L${C(e.x2)} ${C(e.y2)}`;
2058
2123
  case "polyline":
2059
2124
  case "polygon": {
2060
- const n = ar(e.points);
2125
+ const n = hr(e.points);
2061
2126
  if (n.length === 0) return null;
2062
2127
  const r = n.map((s, o) => `${o === 0 ? "M" : "L"}${s.x} ${s.y}`).join(" ");
2063
2128
  return t.tag.toLowerCase() === "polygon" ? `${r} Z` : r;
@@ -2066,53 +2131,53 @@ function is(t) {
2066
2131
  return null;
2067
2132
  }
2068
2133
  }
2069
- function as(t, e, n) {
2134
+ function hs(t, e, n) {
2070
2135
  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;
2071
2136
  if (o >= e) return [];
2072
- const i = n.period, a = [];
2137
+ const a = n.period, i = [];
2073
2138
  for (let c = 0; c < r; c++) {
2074
- const u = o + (e - o) * c / (r - 1), l = i && i > 0 && c < r - 1 ? (u % i + i) % i : u;
2075
- a.push({ at: t(l), time: u, age: s > 0 ? (e - u) / s : 0 });
2139
+ const l = o + (e - o) * c / (r - 1), h = a && a > 0 && c < r - 1 ? (l % a + a) % a : l;
2140
+ i.push({ at: t(h), time: l, age: s > 0 ? (e - l) / s : 0 });
2076
2141
  }
2077
- return a;
2142
+ return i;
2078
2143
  }
2079
- const cr = 2.5;
2080
- function cs(t) {
2081
- const e = [], n = [], r = t.length, s = (o, i) => {
2082
- for (let a = o + i; a >= 0 && a < r; a += i) {
2083
- const c = (t[a].x - t[o].x) * i, u = (t[a].y - t[o].y) * i, l = Math.hypot(c, u);
2084
- if (l > 1e-9) return [c / l, u / l];
2144
+ const fr = 2.5;
2145
+ function fs(t) {
2146
+ const e = [], n = [], r = t.length, s = (o, a) => {
2147
+ for (let i = o + a; i >= 0 && i < r; i += a) {
2148
+ const c = (t[i].x - t[o].x) * a, l = (t[i].y - t[o].y) * a, h = Math.hypot(c, l);
2149
+ if (h > 1e-9) return [c / h, l / h];
2085
2150
  }
2086
2151
  return null;
2087
2152
  };
2088
2153
  for (let o = 0; o < r; o++) {
2089
- const i = t[o], a = s(o, -1), c = s(o, 1), u = a ?? c ?? [1, 0], l = c ?? a ?? [1, 0];
2090
- let h = u[0] + l[0], f = u[1] + l[1];
2091
- const p = Math.hypot(h, f);
2092
- p < 1e-9 ? (h = u[0], f = u[1]) : (h /= p, f /= p);
2093
- const M = h * u[0] + f * u[1], d = Math.min(cr, 1 / Math.max(M, 1e-6)), g = i.width / 2 * d;
2094
- e.push({ x: i.x - f * g, y: i.y + h * g }), n.push({ x: i.x + f * g, y: i.y - h * g });
2154
+ const a = t[o], i = s(o, -1), c = s(o, 1), l = i ?? c ?? [1, 0], h = c ?? i ?? [1, 0];
2155
+ let u = l[0] + h[0], f = l[1] + h[1];
2156
+ const d = Math.hypot(u, f);
2157
+ d < 1e-9 ? (u = l[0], f = l[1]) : (u /= d, f /= d);
2158
+ const m = u * l[0] + f * l[1], p = Math.min(fr, 1 / Math.max(m, 1e-6)), g = a.width / 2 * p;
2159
+ e.push({ x: a.x - f * g, y: a.y + u * g }), n.push({ x: a.x + f * g, y: a.y - u * g });
2095
2160
  }
2096
2161
  return { left: e, right: n };
2097
2162
  }
2098
- function us(t) {
2163
+ function ds(t) {
2099
2164
  const e = t.length;
2100
2165
  if (e < 2) return null;
2101
2166
  const n = t[e - 1];
2102
2167
  for (let r = e - 2; r >= 0; r--) {
2103
- const s = n.x - t[r].x, o = n.y - t[r].y, i = Math.hypot(s, o);
2104
- if (i > 1e-9)
2105
- return { x: n.x, y: n.y, radius: n.width / 2, start: Math.atan2(s / i, -o / i) };
2168
+ const s = n.x - t[r].x, o = n.y - t[r].y, a = Math.hypot(s, o);
2169
+ if (a > 1e-9)
2170
+ return { x: n.x, y: n.y, radius: n.width / 2, start: Math.atan2(s / a, -o / a) };
2106
2171
  }
2107
2172
  return null;
2108
2173
  }
2109
- function ur(t, e) {
2174
+ function dr(t, e) {
2110
2175
  return [t[0] + e[0], t[1] + e[1], t[2] + e[2]];
2111
2176
  }
2112
2177
  function Et(t, e) {
2113
2178
  return [t[0] - e[0], t[1] - e[1], t[2] - e[2]];
2114
2179
  }
2115
- function Pe(t, e) {
2180
+ function De(t, e) {
2116
2181
  return [t[0] * e, t[1] * e, t[2] * e];
2117
2182
  }
2118
2183
  function ct(t, e) {
@@ -2124,48 +2189,48 @@ function vt(t, e) {
2124
2189
  function Lt(t) {
2125
2190
  return Math.hypot(t[0], t[1], t[2]);
2126
2191
  }
2127
- function lr(t, e) {
2192
+ function pr(t, e) {
2128
2193
  return Lt(Et(t, e));
2129
2194
  }
2130
2195
  function Pt(t) {
2131
2196
  const e = Lt(t);
2132
- return e === 0 ? [0, 0, 0] : Pe(t, 1 / e);
2197
+ return e === 0 ? [0, 0, 0] : De(t, 1 / e);
2133
2198
  }
2134
- function hr(t, e, n) {
2199
+ function gr(t, e, n) {
2135
2200
  return [t[0] + (e[0] - t[0]) * n, t[1] + (e[1] - t[1]) * n, t[2] + (e[2] - t[2]) * n];
2136
2201
  }
2137
- const ls = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2202
+ const ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2138
2203
  __proto__: null,
2139
- add: ur,
2204
+ add: dr,
2140
2205
  cross: vt,
2141
- distance: lr,
2206
+ distance: pr,
2142
2207
  dot: ct,
2143
2208
  length: Lt,
2144
- lerp: hr,
2209
+ lerp: gr,
2145
2210
  normalize: Pt,
2146
- scale: Pe,
2211
+ scale: De,
2147
2212
  subtract: Et
2148
- }, Symbol.toStringTag, { value: "Module" })), fr = Math.PI / 180;
2149
- function pr() {
2213
+ }, Symbol.toStringTag, { value: "Module" })), mr = Math.PI / 180;
2214
+ function yr() {
2150
2215
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
2151
2216
  }
2152
- function dr(t, e) {
2217
+ function Mr(t, e) {
2153
2218
  const n = new Array(16);
2154
2219
  for (let r = 0; r < 4; r++)
2155
2220
  for (let s = 0; s < 4; s++) {
2156
2221
  let o = 0;
2157
- for (let i = 0; i < 4; i++) o += t[i * 4 + s] * e[r * 4 + i];
2222
+ for (let a = 0; a < 4; a++) o += t[a * 4 + s] * e[r * 4 + a];
2158
2223
  n[r * 4 + s] = o;
2159
2224
  }
2160
2225
  return n;
2161
2226
  }
2162
- function gr(t) {
2227
+ function _r(t) {
2163
2228
  return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, t[0], t[1], t[2], 1];
2164
2229
  }
2165
- function mr(t) {
2230
+ function br(t) {
2166
2231
  return [t[0], 0, 0, 0, 0, t[1], 0, 0, 0, 0, t[2], 0, 0, 0, 0, 1];
2167
2232
  }
2168
- function $e(t) {
2233
+ function Ce(t) {
2169
2234
  const [e, n, r, s] = t;
2170
2235
  return [
2171
2236
  1 - 2 * (n * n + r * r),
@@ -2186,49 +2251,49 @@ function $e(t) {
2186
2251
  1
2187
2252
  ];
2188
2253
  }
2189
- function yr(t, e, n) {
2190
- const r = $e(e);
2254
+ function Tr(t, e, n) {
2255
+ const r = Ce(e);
2191
2256
  for (let s = 0; s < 3; s++)
2192
2257
  r[s] *= n[0], r[4 + s] *= n[1], r[8 + s] *= n[2];
2193
2258
  return r[12] = t[0], r[13] = t[1], r[14] = t[2], r;
2194
2259
  }
2195
- function Mr(t) {
2260
+ function xr(t) {
2196
2261
  const e = new Array(16);
2197
2262
  for (let n = 0; n < 4; n++) for (let r = 0; r < 4; r++) e[r * 4 + n] = t[n * 4 + r];
2198
2263
  return e;
2199
2264
  }
2200
- function _r(t) {
2201
- const [e, n, r, s, o, i, a, c, u, l, h, f, p, M, d, g] = t, _ = e * i - n * o, b = e * a - r * o, k = e * c - s * o, w = n * a - r * i, y = n * c - s * i, v = r * c - s * a, A = u * M - l * p, D = u * d - h * p, m = u * g - f * p, T = l * d - h * M, x = l * g - f * M, S = h * g - f * d, $ = _ * S - b * x + k * T + w * m - y * D + v * A;
2202
- if (Math.abs($) < 1e-12) return null;
2203
- const P = 1 / $;
2265
+ function kr(t) {
2266
+ const [e, n, r, s, o, a, i, c, l, h, u, f, d, m, p, g] = t, M = e * a - n * o, y = e * i - r * o, k = e * c - s * o, w = n * i - r * a, b = n * c - s * a, v = r * c - s * i, A = l * m - h * d, D = l * p - u * d, _ = l * g - f * d, T = h * p - u * m, x = h * g - f * m, S = u * g - f * p, R = M * S - y * x + k * T + w * _ - b * D + v * A;
2267
+ if (Math.abs(R) < 1e-12) return null;
2268
+ const P = 1 / R;
2204
2269
  return [
2205
- (i * S - a * x + c * T) * P,
2270
+ (a * S - i * x + c * T) * P,
2206
2271
  (r * x - n * S - s * T) * P,
2207
- (M * v - d * y + g * w) * P,
2208
- (h * y - l * v - f * w) * P,
2209
- (a * m - o * S - c * D) * P,
2210
- (e * S - r * m + s * D) * P,
2211
- (d * k - p * v - g * b) * P,
2212
- (u * v - h * k + f * b) * P,
2213
- (o * x - i * m + c * A) * P,
2214
- (n * m - e * x - s * A) * P,
2215
- (p * y - M * k + g * _) * P,
2216
- (l * k - u * y - f * _) * P,
2217
- (i * D - o * T - a * A) * P,
2272
+ (m * v - p * b + g * w) * P,
2273
+ (u * b - h * v - f * w) * P,
2274
+ (i * _ - o * S - c * D) * P,
2275
+ (e * S - r * _ + s * D) * P,
2276
+ (p * k - d * v - g * y) * P,
2277
+ (l * v - u * k + f * y) * P,
2278
+ (o * x - a * _ + c * A) * P,
2279
+ (n * _ - e * x - s * A) * P,
2280
+ (d * b - m * k + g * M) * P,
2281
+ (h * k - l * b - f * M) * P,
2282
+ (a * D - o * T - i * A) * P,
2218
2283
  (e * T - n * D + r * A) * P,
2219
- (M * b - p * w - d * _) * P,
2220
- (u * w - l * b + h * _) * P
2284
+ (m * y - d * w - p * M) * P,
2285
+ (l * w - h * y + u * M) * P
2221
2286
  ];
2222
2287
  }
2223
- function br(t, e, n, r) {
2224
- const s = 1 / Math.tan(t * fr / 2), o = 1 / (n - r);
2288
+ function wr(t, e, n, r) {
2289
+ const s = 1 / Math.tan(t * mr / 2), o = 1 / (n - r);
2225
2290
  return [s / e, 0, 0, 0, 0, s, 0, 0, 0, 0, (r + n) * o, -1, 0, 0, 2 * r * n * o, 0];
2226
2291
  }
2227
- function Tr(t, e, n, r, s, o) {
2228
- const i = 1 / (e - t), a = 1 / (r - n), c = 1 / (o - s);
2229
- return [2 * i, 0, 0, 0, 0, 2 * a, 0, 0, 0, 0, -2 * c, 0, -(e + t) * i, -(r + n) * a, -(o + s) * c, 1];
2292
+ function Sr(t, e, n, r, s, o) {
2293
+ const a = 1 / (e - t), i = 1 / (r - n), c = 1 / (o - s);
2294
+ 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];
2230
2295
  }
2231
- function xr(t, e, n = [0, 1, 0]) {
2296
+ function Ar(t, e, n = [0, 1, 0]) {
2232
2297
  const r = Pt(Et(t, e)), s = Pt(vt(n, r)), o = vt(r, s);
2233
2298
  return [
2234
2299
  s[0],
@@ -2249,146 +2314,147 @@ function xr(t, e, n = [0, 1, 0]) {
2249
2314
  1
2250
2315
  ];
2251
2316
  }
2252
- function kr(t, e) {
2317
+ function vr(t, e) {
2253
2318
  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];
2254
2319
  return o === 1 || o === 0 ? [n, r, s] : [n / o, r / o, s / o];
2255
2320
  }
2256
- const hs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2321
+ const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2257
2322
  __proto__: null,
2258
- compose: yr,
2259
- fromQuat: $e,
2260
- identity: pr,
2261
- invert: _r,
2262
- lookAt: xr,
2263
- multiply: dr,
2264
- orthographic: Tr,
2265
- perspective: br,
2266
- scaling: mr,
2267
- transformPoint: kr,
2268
- translation: gr,
2269
- transpose: Mr
2323
+ compose: Tr,
2324
+ fromQuat: Ce,
2325
+ identity: yr,
2326
+ invert: kr,
2327
+ lookAt: Ar,
2328
+ multiply: Mr,
2329
+ orthographic: Sr,
2330
+ perspective: wr,
2331
+ scaling: br,
2332
+ transformPoint: vr,
2333
+ translation: _r,
2334
+ transpose: xr
2270
2335
  }, Symbol.toStringTag, { value: "Module" }));
2271
2336
  export {
2272
- wr as Clock,
2273
- ye as DEFAULT_BAKE_INTERVAL_MS,
2274
- zt as DEFAULT_INERTIA_FRICTION,
2337
+ $r as Clock,
2338
+ Me as DEFAULT_BAKE_INTERVAL_MS,
2339
+ Yt as DEFAULT_INERTIA_FRICTION,
2275
2340
  L as DEFAULT_SPRING,
2276
- Xt as FORMAT_VERSION,
2277
- ze as INERTIA_MAX_DURATION_MS,
2278
- Yn as InertiaTrackPlayer,
2279
- Or as MORPH_SAMPLES,
2280
- Ar as ManualClock,
2341
+ Nt as FORMAT_VERSION,
2342
+ je as INERTIA_MAX_DURATION_MS,
2343
+ Hn as InertiaTrackPlayer,
2344
+ Nr as MORPH_SAMPLES,
2345
+ Rr as ManualClock,
2281
2346
  ie as SPRING_MAX_DURATION_MS,
2282
- Pr as SPRING_PRESETS,
2347
+ Dr as SPRING_PRESETS,
2283
2348
  tt as SPRING_STEP_MS,
2284
2349
  ut as SpringSampler,
2285
- zn as SpringTrackPlayer,
2286
- Bn as Timeline,
2350
+ jn as SpringTrackPlayer,
2351
+ ke as Timeline,
2287
2352
  _t as TrackPlayer,
2288
- Qr as ValueResolver,
2289
- Je as backOut,
2290
- On as bakeEasing,
2291
- _e as bakeInertiaTrack,
2292
- Me as bakeSpringTrack,
2353
+ Zr as ValueResolver,
2354
+ rn as backOut,
2355
+ Yn as bakeEasing,
2356
+ be as bakeInertiaTrack,
2357
+ _e as bakeSpringTrack,
2293
2358
  It as beatAtTime,
2294
- ve as beatLength,
2359
+ $e as beatLength,
2295
2360
  Ct as beatTime,
2296
- rs as beatsBetween,
2297
- qe as bounceOut,
2298
- Vn as charactersFor,
2299
- Fr as clearMorphCache,
2300
- Er as clearPathCache,
2301
- Ke as createCubicBezier,
2302
- qn as createRandom,
2303
- Xn as createTrack,
2304
- Cr as criticalDamping,
2305
- Kr as customBounce,
2306
- Gr as customEase,
2307
- Zr as customWiggle,
2308
- Zn as deserializeTimeline,
2309
- Gn as deserializeTrack,
2310
- ss as detectTempo,
2311
- Be as easeIn,
2312
- ae as easeInCubic,
2313
- Qe as easeInOut,
2314
- ue as easeInOutCubic,
2315
- He as easeInOutQuad,
2316
- Ve as easeInQuad,
2317
- We as easeOut,
2318
- ce as easeOutCubic,
2319
- je as easeOutQuad,
2320
- Ze as elasticOut,
2321
- Fn as expandParametricEasings,
2322
- ne as formatVersionFor,
2323
- jr as fromJSON,
2324
- le as getEasingFunction,
2325
- me as getInterpolator,
2326
- Te as getMotionPathPoint,
2327
- Lr as getPathLength,
2328
- hn as getPointAtProgress,
2329
- Le as hasKeyframes,
2330
- Hr as hashSeed,
2331
- vr as heldTime,
2361
+ as as beatsBetween,
2362
+ nn as bounceOut,
2363
+ cs as cameraTracks,
2364
+ Wn as charactersFor,
2365
+ Yr as clearMorphCache,
2366
+ Fr as clearPathCache,
2367
+ tn as createCubicBezier,
2368
+ Se as createRandom,
2369
+ Vn as createTrack,
2370
+ Lr as criticalDamping,
2371
+ Jr as customBounce,
2372
+ qr as customEase,
2373
+ ts as customWiggle,
2374
+ tr as deserializeTimeline,
2375
+ qn as deserializeTrack,
2376
+ is as detectTempo,
2377
+ Ke as easeIn,
2378
+ ce as easeInCubic,
2379
+ qe as easeInOut,
2380
+ le as easeInOutCubic,
2381
+ Ge as easeInOutQuad,
2382
+ We as easeInQuad,
2383
+ Ze as easeOut,
2384
+ ue as easeOutCubic,
2385
+ Qe as easeOutQuad,
2386
+ en as elasticOut,
2387
+ zn as expandParametricEasings,
2388
+ re as formatVersionFor,
2389
+ Wr as fromJSON,
2390
+ he as getEasingFunction,
2391
+ ye as getInterpolator,
2392
+ xe as getMotionPathPoint,
2393
+ Xr as getPathLength,
2394
+ gn as getPointAtProgress,
2395
+ Xe as hasKeyframes,
2396
+ Qr as hashSeed,
2397
+ Ne as heldTime,
2332
2398
  ft as inertiaDuration,
2333
2399
  ht as inertiaRest,
2334
2400
  kt as inertiaValueAt,
2335
- Ir as inertiaVelocityAt,
2336
- In as interpolateArray,
2337
- Cn as interpolateColor,
2338
- Yr as interpolateMotionPath,
2339
- N as interpolateNumber,
2340
- Ln as interpolatePathString,
2341
- En as interpolateQuaternion,
2401
+ Or as inertiaVelocityAt,
2402
+ Fn as interpolateArray,
2403
+ On as interpolateColor,
2404
+ jr as interpolateMotionPath,
2405
+ X as interpolateNumber,
2406
+ Nn as interpolatePathString,
2407
+ Xn as interpolateQuaternion,
2342
2408
  te as interpolateString,
2343
- Ee as isCubicBezierEasing,
2409
+ Fe as isCubicBezierEasing,
2344
2410
  V as isInertiaTrack,
2345
- Sr as isMotionPathPoint,
2346
- re as isMotionPathTrack,
2411
+ Pr as isMotionPathPoint,
2412
+ se as isMotionPathTrack,
2347
2413
  xt as isParametricEasing,
2348
- Sn as isPathData,
2414
+ Pn as isPathData,
2349
2415
  j as isSpringTrack,
2350
- $t as isTextTrack,
2351
- Dr as isUnderdamped,
2352
- Wr as isUnresolved,
2353
- St as linear,
2354
- hs as mat4,
2355
- Oe as maxStaggerDistance,
2356
- kn as morphPath,
2357
- Jr as narrationMarkers,
2358
- ts as narrationSceneAt,
2359
- Ye as naturalRest,
2360
- es as nearestBeat,
2361
- ns as nextBeat,
2362
- en as parametricEasing,
2416
+ Rt as isTextTrack,
2417
+ Er as isUnderdamped,
2418
+ Kr as isUnresolved,
2419
+ wt as linear,
2420
+ gs as mat4,
2421
+ Ye as maxStaggerDistance,
2422
+ vn as morphPath,
2423
+ ns as narrationMarkers,
2424
+ rs as narrationSceneAt,
2425
+ He as naturalRest,
2426
+ ss as nearestBeat,
2427
+ os as nextBeat,
2428
+ on as parametricEasing,
2363
2429
  G as parsePath,
2364
- qr as planNarration,
2365
- Ur as playheadCrossings,
2366
- he as pointAtDistance,
2367
- os as pointsToPath,
2368
- Nr as quat,
2369
- ke as randomBetween,
2370
- Br as randomChoice,
2371
- Jn as randomSnapped,
2372
- tr as resolveSequence,
2373
- we as resolveValue,
2374
- cs as ribbon,
2375
- us as ribbonHeadCap,
2376
- Kn as serializeTimeline,
2377
- Qn as serializeTrack,
2378
- is as shapeToPathData,
2379
- Nn as simplifyKeyframes,
2380
- Rr as springDuration,
2381
- $r as springValueAt,
2382
- se as staggerDistance,
2383
- oe as staggerOffset,
2384
- Fe as staggerOffsets,
2385
- Rt as staggerSpan,
2386
- tn as stepsEasing,
2387
- Hn as textAt,
2388
- Vr as toJSON,
2389
- Xr as toKeyframedTrack,
2390
- zr as toKeyframedTracks,
2430
+ es as planNarration,
2431
+ Hr as playheadCrossings,
2432
+ fe as pointAtDistance,
2433
+ us as pointsToPath,
2434
+ zr as quat,
2435
+ Ae as randomBetween,
2436
+ Gr as randomChoice,
2437
+ er as randomSnapped,
2438
+ nr as resolveSequence,
2439
+ Re as resolveValue,
2440
+ fs as ribbon,
2441
+ ds as ribbonHeadCap,
2442
+ Jn as serializeTimeline,
2443
+ Zn as serializeTrack,
2444
+ ls as shapeToPathData,
2445
+ Un as simplifyKeyframes,
2446
+ Ir as springDuration,
2447
+ Cr as springValueAt,
2448
+ oe as staggerDistance,
2449
+ ae as staggerOffset,
2450
+ ze as staggerOffsets,
2451
+ $t as staggerSpan,
2452
+ sn as stepsEasing,
2453
+ Gn as textAt,
2454
+ Br as toJSON,
2455
+ Ur as toKeyframedTrack,
2456
+ Vr as toKeyframedTracks,
2391
2457
  U as trackTargets,
2392
- as as trailSamples,
2393
- ls as vec3
2458
+ hs as trailSamples,
2459
+ ps as vec3
2394
2460
  };