@algorisys/tinyfly 0.113.0 → 0.114.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,13 +1,13 @@
1
- import { H as we, A as bt, R as ce, B as Pe, D as Xt, E as on, F as at, G as ta, I as ye, J as oa, K as zo, L as nn, M as na, N as sa, O as Gs, P as sn, Q as Ys, S as ra, T as aa, U as ia, V as _e, W as la, X as Ke, Y as Us, Z as Xs, _ as Pn, $ as ha, a0 as xe, a1 as Le, a2 as Oe, a3 as ca, a4 as da, a5 as fa, a6 as Vs, a7 as Ae, a8 as $e, a9 as Js, aa as ua, ab as Lo, ac as je, ad as Zs, ae as ga, af as pa, ag as Qs, ah as ma, ai as ya, aj as ba, ak as wa, al as ka, i as va, h as Sa, c as Ma, j as $a, f as Ea, d as Aa, b as Ta, e as Pa, C as Oa, am as Ha, an as Ia, ao as xa, ap as ja, aq as _a, ar as Ka, as as Ca } from "./cricket-play-DQqoiwTG.js";
2
- import { at as $f, au as Ef, av as Af, aw as Tf, ax as Pf, ay as Of, az as Hf, aA as If, aB as xf, aC as jf, aD as _f, aE as Kf, aF as Cf, aG as Nf, aH as Rf, aI as Wf, aJ as zf, aK as Lf, aL as Df, aM as Ff, aN as qf, aO as Bf, aP as Gf, aQ as Yf, aR as Uf, aS as Xf, aT as Vf, aU as Jf, aV as Zf, aW as Qf, aX as eu, aY as tu, aZ as ou, a_ as nu, a$ as su, b0 as ru, b1 as au, b2 as iu, b3 as lu, b4 as hu, b5 as cu, b6 as du, b7 as fu, b8 as uu, b9 as gu, ba as pu, bb as mu, bc as yu, bd as bu, be as wu, bf as ku, bg as vu, bh as Su, bi as Mu, bj as $u, bk as Eu, bl as Au, bm as Tu, bn as Pu } from "./cricket-play-DQqoiwTG.js";
3
- import { getEasingFunction as mt, hashSeed as De, mat4 as ne, vec3 as ke, quat as We, Timeline as ve, unknownName as fe, createRandom as rn, springFollow as Bt, closestName as Do } from "@algorisys/tinyfly";
4
- import { f as Vt, h as Na, a as er } from "./load-scene-oWNsYYC1.js";
1
+ import { H as we, A as bt, R as ce, B as Pe, D as Xt, E as on, F as at, G as ta, I as ye, J as oa, K as zo, L as nn, M as na, N as sa, O as Gs, P as sn, Q as Ys, S as ra, T as aa, U as ia, V as _e, W as la, X as Ke, Y as Us, Z as Xs, _ as Pn, $ as ha, a0 as xe, a1 as Le, a2 as Oe, a3 as ca, a4 as da, a5 as fa, a6 as Vs, a7 as Ae, a8 as $e, a9 as Js, aa as ua, ab as Lo, ac as je, ad as Zs, ae as ga, af as pa, ag as Qs, ah as ma, ai as ya, aj as ba, ak as wa, al as ka, i as va, h as Sa, c as Ma, j as $a, f as Ea, d as Aa, b as Ta, e as Pa, C as Oa, am as Ha, an as Ia, ao as xa, ap as ja, aq as _a, ar as Ka, as as Ca, at as Na } from "./cricket-play-BZNhfgOK.js";
2
+ import { au as Ef, av as Af, aw as Tf, ax as Pf, ay as Of, az as Hf, aA as If, aB as xf, aC as jf, aD as _f, aE as Kf, aF as Cf, aG as Nf, aH as Rf, aI as Wf, aJ as zf, aK as Lf, aL as Ff, aM as Df, aN as qf, aO as Bf, aP as Gf, aQ as Yf, aR as Uf, aS as Xf, aT as Vf, aU as Jf, aV as Zf, aW as Qf, aX as eu, aY as tu, aZ as ou, a_ as nu, a$ as su, b0 as ru, b1 as au, b2 as iu, b3 as lu, b4 as hu, b5 as cu, b6 as du, b7 as fu, b8 as uu, b9 as gu, ba as pu, bb as mu, bc as yu, bd as bu, be as wu, bf as ku, bg as vu, bh as Su, bi as Mu, bj as $u, bk as Eu, bl as Au, bm as Tu, bn as Pu, bo as Ou, bp as Hu, bq as Iu, br as xu } from "./cricket-play-BZNhfgOK.js";
3
+ import { getEasingFunction as mt, hashSeed as Fe, mat4 as ne, vec3 as ke, quat as We, Timeline as ve, unknownName as fe, createRandom as rn, springFollow as Bt, closestName as Fo } from "@algorisys/tinyfly";
4
+ import { f as Vt, h as Ra, a as er } from "./load-scene-oWNsYYC1.js";
5
5
  import { l as tr, f as or } from "./shading-0lPgnXmD.js";
6
- import { s as Ra, p as nr, b as an } from "./sketch-CYPUbk3Q.js";
7
- import { c as Hu, a as Iu } from "./sketch-CYPUbk3Q.js";
8
- import { C as Wa } from "./target-properties-BtN9skb-.js";
9
- import { I as ju, a as _u, b as Ku, c as Cu, d as Nu, e as Ru, f as Wu } from "./target-properties-BtN9skb-.js";
10
- const bo = 0.5, Fo = {
6
+ import { s as Wa, p as nr, b as an } from "./sketch-CYPUbk3Q.js";
7
+ import { c as _u, a as Ku } from "./sketch-CYPUbk3Q.js";
8
+ import { C as za } from "./target-properties-BtN9skb-.js";
9
+ import { I as Nu, a as Ru, b as Wu, c as zu, d as Lu, e as Fu, f as Du } from "./target-properties-BtN9skb-.js";
10
+ const bo = 0.5, Do = {
11
11
  /** Flag: fingers together and straight, thumb bent in */
12
12
  pataka: bt({ "thumb.curl": 0.3, "thumb.across": 0.6, "index.curl": 0, "middle.curl": 0, "ring.curl": 0, "pinky.curl": 0, spread: 0, turn: 2 }),
13
13
  /** Pataka with the ring finger bent */
@@ -24,7 +24,7 @@ const bo = 0.5, Fo = {
24
24
  katakamukha: bt({ "thumb.curl": 0.2, "thumb.across": 0.6, "index.curl": 0.65, "middle.curl": 0.7, "ring.curl": 0, "pinky.curl": 0, spread: 0.4, turn: 2 })
25
25
  };
26
26
  function Jt(e) {
27
- return typeof e != "string" ? e : e in Fo ? Fo[e] : we[e];
27
+ return typeof e != "string" ? e : e in Do ? Do[e] : we[e];
28
28
  }
29
29
  function sr(e, t, o) {
30
30
  const n = [];
@@ -41,7 +41,7 @@ function sr(e, t, o) {
41
41
  return n;
42
42
  }
43
43
  const ln = (e, t) => (e % t + t) % t;
44
- function za(e, t, o, n) {
44
+ function La(e, t, o, n) {
45
45
  const a = sr(e, o, n);
46
46
  if (a.length === 0) return { pose: o, hands: n };
47
47
  const r = ln(t, e.beats);
@@ -53,7 +53,7 @@ function za(e, t, o, n) {
53
53
  hands: { left: Xt(i.left, h.left, f), right: Xt(i.right, h.right, f) }
54
54
  };
55
55
  }
56
- const La = [
56
+ const Fa = [
57
57
  ["leftShoulder", "rightShoulder"],
58
58
  ["leftElbow", "rightElbow"],
59
59
  ["leftWrist", "rightWrist"],
@@ -63,19 +63,19 @@ const La = [
63
63
  ["leftFootOut", "rightFootOut"],
64
64
  ["leftEye", "rightEye"],
65
65
  ["leftBrow", "rightBrow"]
66
- ], Da = ["lean", "headTilt", "lookX", "spin"], Fa = /* @__PURE__ */ new Set(["leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee"]);
67
- function qa(e) {
66
+ ], Da = ["lean", "headTilt", "lookX", "spin"], qa = /* @__PURE__ */ new Set(["leftShoulder", "rightShoulder", "leftElbow", "rightElbow", "leftWrist", "rightWrist", "leftHip", "rightHip", "leftKnee", "rightKnee"]);
67
+ function Ba(e) {
68
68
  const t = { ...e }, o = (e.turn ?? 0) >= 0.5;
69
- for (const [n, a] of La) {
70
- const r = o && Fa.has(n) ? -1 : 1;
69
+ for (const [n, a] of Fa) {
70
+ const r = o && qa.has(n) ? -1 : 1;
71
71
  t[n] = r * e[a], t[a] = r * e[n];
72
72
  }
73
73
  if (!o) for (const n of Da) t[n] = -e[n];
74
74
  return t;
75
75
  }
76
- const Ba = (e) => Math.min(1, Math.max(-1, (0.5 - e) * 4));
77
- function Ga(e, t, o) {
78
- const n = ln(o, 1), a = (1 + Math.cos(2 * Math.PI * n)) / 2, r = t.bounce * (t.accent === "up" ? 1 - a : a), s = Math.min(1, Math.max(0, e.turn ?? 0)), i = Ba(s);
76
+ const Ga = (e) => Math.min(1, Math.max(-1, (0.5 - e) * 4));
77
+ function Ya(e, t, o) {
78
+ const n = ln(o, 1), a = (1 + Math.cos(2 * Math.PI * n)) / 2, r = t.bounce * (t.accent === "up" ? 1 - a : a), s = Math.min(1, Math.max(0, e.turn ?? 0)), i = Ga(s);
79
79
  return {
80
80
  ...e,
81
81
  leftHip: e.leftHip + i * r / 2,
@@ -98,8 +98,8 @@ function rr(e) {
98
98
  function wo(e, t, o) {
99
99
  const n = e.moves[t.move];
100
100
  if (!n) throw new Error(`dance: "${e.label}" has no move "${t.move}"`);
101
- const a = za(n, o, qo(e), rr(e));
102
- return t.mirror ? { pose: qa(a.pose), hands: { left: a.hands?.right, right: a.hands?.left } } : a;
101
+ const a = La(n, o, qo(e), rr(e));
102
+ return t.mirror ? { pose: Ba(a.pose), hands: { left: a.hands?.right, right: a.hands?.left } } : a;
103
103
  }
104
104
  function hn(e, t, o = {}) {
105
105
  const n = typeof e == "string" ? Je[e] : e;
@@ -119,24 +119,24 @@ function hn(e, t, o = {}) {
119
119
  };
120
120
  }
121
121
  }
122
- return { ...a, pose: Ga(a.pose, n.groove, t) };
122
+ return { ...a, pose: Ya(a.pose, n.groove, t) };
123
123
  }
124
- function wd(e, t, o = {}) {
124
+ function kd(e, t, o = {}) {
125
125
  return hn(e, t, o).pose;
126
126
  }
127
127
  function cn(e) {
128
128
  return (typeof e == "string" ? Je[e] : e).routine.reduce((o, n) => o + n.beats, 0);
129
129
  }
130
- const Ya = { leftToe: "rightToe", rightToe: "leftToe", leftHeel: "rightHeel", rightHeel: "leftHeel" };
130
+ const Ua = { leftToe: "rightToe", rightToe: "leftToe", leftHeel: "rightHeel", rightHeel: "leftHeel" };
131
131
  function On(e, t, o, n, a, r, s) {
132
132
  for (let i = 0; i * e.beats < o; i++)
133
133
  for (const h of e.keys) {
134
134
  const c = i * e.beats + h.beat, l = t + c;
135
135
  if (!(c >= o || l < r || l >= s))
136
- for (const d of h.taps ?? []) a.push({ beat: l, tap: n ? Ya[d] : d });
136
+ for (const d of h.taps ?? []) a.push({ beat: l, tap: n ? Ua[d] : d });
137
137
  }
138
138
  }
139
- function kd(e, t, o, n = {}) {
139
+ function vd(e, t, o, n = {}) {
140
140
  const a = typeof e == "string" ? Je[e] : e, r = [];
141
141
  if (o <= t) return r;
142
142
  if (n.move) {
@@ -170,18 +170,18 @@ function ko(e, t, o = {}) {
170
170
  }
171
171
  return h;
172
172
  }
173
- function Ua(e, t, o) {
173
+ function Xa(e, t, o) {
174
174
  const n = ar(e, o), a = [0];
175
175
  let r = 0;
176
176
  for (let s = 0; r < t; s = (s + 1) % n.length)
177
177
  r += n[s].beats, a.push(Math.min(r, t));
178
178
  return a;
179
179
  }
180
- const Xa = 8;
181
- function Va(e, t, o) {
182
- const n = typeof t == "string" ? Je[t] : t, a = o.bpm ?? n.bpm, r = o.beats ?? (o.move ? n.moves[o.move].beats : cn(n)), s = Ua(n, r, o);
180
+ const Va = 8;
181
+ function Ja(e, t, o) {
182
+ const n = typeof t == "string" ? Je[t] : t, a = o.bpm ?? n.bpm, r = o.beats ?? (o.move ? n.moves[o.move].beats : cn(n)), s = Xa(n, r, o);
183
183
  if (s.every((T) => ko(n, T, o) === 0)) return;
184
- const i = Math.min(o.fade ?? 1, r / 2), h = mt("ease-in-out"), c = (T) => i <= 0 ? 1 : Math.min(h(Math.min(1, T / i)), h(Math.min(1, (r - T) / i))), l = Math.ceil(i * Xa), d = i <= 0 ? [] : Array.from({ length: l + 1 }, (T, H) => [H / l * i, r - H / l * i]).flat(), f = [.../* @__PURE__ */ new Set([...s, ...d])].sort((T, H) => T - H);
184
+ const i = Math.min(o.fade ?? 1, r / 2), h = mt("ease-in-out"), c = (T) => i <= 0 ? 1 : Math.min(h(Math.min(1, T / i)), h(Math.min(1, (r - T) / i))), l = Math.ceil(i * Va), d = i <= 0 ? [] : Array.from({ length: l + 1 }, (T, H) => [H / l * i, r - H / l * i]).flat(), f = [.../* @__PURE__ */ new Set([...s, ...d])].sort((T, H) => T - H);
185
185
  let u = 0;
186
186
  const p = f.map((T, H) => {
187
187
  if (H > 0) {
@@ -200,13 +200,13 @@ function Va(e, t, o) {
200
200
  keyframes: p.map((T) => ({ time: g + T.beat * 6e4 / a, value: b + o.height * T.travel, easing: "linear" }))
201
201
  };
202
202
  }
203
- function vd(e, t, o = 0) {
203
+ function Sd(e, t, o = 0) {
204
204
  return (e - o) * t / 6e4;
205
205
  }
206
- function Sd(e, t = {}) {
206
+ function Md(e, t = {}) {
207
207
  return (o) => hn(e, o, t);
208
208
  }
209
- function Md(e, t) {
209
+ function $d(e, t) {
210
210
  const o = t.start ?? 0, n = 6e4 / t.bpm, a = o + t.beats * n, r = Math.min((t.fade ?? 1) * n, (a - o) / 2);
211
211
  return [
212
212
  {
@@ -231,7 +231,7 @@ function Md(e, t) {
231
231
  }
232
232
  ];
233
233
  }
234
- function $d(e, t, o = {}) {
234
+ function Ed(e, t, o = {}) {
235
235
  const n = typeof t == "string" ? Je[t] : t, a = o.bpm ?? n.bpm, r = o.beats ?? (o.move ? n.moves[o.move].beats : cn(n)), s = o.samplesPerBeat ?? 4, i = o.start ?? 0, h = Math.round(r * s), c = Array.from({ length: h + 1 }, (g, b) => {
236
236
  const T = b / s;
237
237
  return { time: i + T * 6e4 / a, frame: hn(n, T, o) };
@@ -240,7 +240,7 @@ function $d(e, t, o = {}) {
240
240
  target: e,
241
241
  property: g,
242
242
  keyframes: c.map((T) => ({ time: T.time, value: b(T.frame) }))
243
- }), f = Object.keys(ce).filter((g) => c.some((b) => b.frame.pose[g] !== c[0].frame.pose[g]) || c[0].frame.pose[g] !== ce[g]).map((g) => l(g, (b) => b.pose[g])), u = o.height === void 0 ? void 0 : Va(e, n, { ...o, bpm: a, beats: r, start: i, height: o.height, fade: 0 });
243
+ }), f = Object.keys(ce).filter((g) => c.some((b) => b.frame.pose[g] !== c[0].frame.pose[g]) || c[0].frame.pose[g] !== ce[g]).map((g) => l(g, (b) => b.pose[g])), u = o.height === void 0 ? void 0 : Ja(e, n, { ...o, bpm: a, beats: r, start: i, height: o.height, fade: 0 });
244
244
  if (u && f.push(u), o.hands === !1) return f;
245
245
  const p = [];
246
246
  for (const g of ["left", "right"])
@@ -250,7 +250,7 @@ function $d(e, t, o = {}) {
250
250
  }
251
251
  return [...f, ...p];
252
252
  }
253
- const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic", Ja = {
253
+ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic", Za = {
254
254
  label: "Disco",
255
255
  bpm: 120,
256
256
  stance: { leftHip: 10, rightHip: 10, leftKnee: 6, rightKnee: 6 },
@@ -298,7 +298,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
298
298
  { move: "point", beats: 8, mirror: !0 },
299
299
  { move: "bump", beats: 8 }
300
300
  ]
301
- }, Za = {
301
+ }, Qa = {
302
302
  label: "Hip hop",
303
303
  bpm: 95,
304
304
  stance: { leftHip: 14, rightHip: 14, leftKnee: 20, rightKnee: 20, leftShoulder: 22, rightShoulder: 22, leftElbow: -30, rightElbow: -30, leftFootOut: 0.15, rightFootOut: 0.15 },
@@ -350,7 +350,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
350
350
  { move: "armWave", beats: 8 },
351
351
  { move: "bounce", beats: 4 }
352
352
  ]
353
- }, Qa = {
353
+ }, ei = {
354
354
  label: "Breaking (toprock)",
355
355
  bpm: 110,
356
356
  stance: { leftHip: 14, rightHip: 14, leftKnee: 14, rightKnee: 14, leftShoulder: 35, rightShoulder: 35, leftElbow: -90, rightElbow: -90 },
@@ -392,7 +392,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
392
392
  { move: "kick", beats: 4, mirror: !0 },
393
393
  { move: "freeze", beats: 4 }
394
394
  ]
395
- }, ei = {
395
+ }, ti = {
396
396
  label: "Jazz",
397
397
  bpm: 130,
398
398
  stance: { leftHip: 10, rightHip: 10 },
@@ -453,7 +453,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
453
453
  { move: "jazzHands", beats: 4 },
454
454
  { move: "splitDrop", beats: 8 }
455
455
  ]
456
- }, ti = {
456
+ }, oi = {
457
457
  label: "K-pop",
458
458
  bpm: 125,
459
459
  stance: { leftHip: 9, rightHip: 9, leftKnee: 4, rightKnee: 4 },
@@ -500,7 +500,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
500
500
  { move: "pointCombo", beats: 8, mirror: !0 },
501
501
  { move: "isolations", beats: 4 }
502
502
  ]
503
- }, oi = {
503
+ }, ni = {
504
504
  label: "Bollywood",
505
505
  bpm: 120,
506
506
  stance: { leftHip: 10, rightHip: 10 },
@@ -545,7 +545,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
545
545
  { move: "thumka", beats: 4, mirror: !0 },
546
546
  { move: "lightBulb", beats: 8, mirror: !0 }
547
547
  ]
548
- }, ni = {
548
+ }, si = {
549
549
  label: "Bhangra",
550
550
  bpm: 100,
551
551
  stance: { leftShoulder: 150, rightShoulder: 150, leftElbow: 18, rightElbow: 18, leftHip: 10, rightHip: 10 },
@@ -580,11 +580,11 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
580
580
  { move: "basic", beats: 8 },
581
581
  { move: "dhamaal", beats: 4 }
582
582
  ]
583
- }, si = { leftHip: 42, rightHip: 42, leftKnee: 82, rightKnee: 82, leftFootOut: 0.3, rightFootOut: 0.3 }, ri = {
583
+ }, ri = { leftHip: 42, rightHip: 42, leftKnee: 82, rightKnee: 82, leftFootOut: 0.3, rightFootOut: 0.3 }, ai = {
584
584
  label: "Bharatanatyam",
585
585
  bpm: 80,
586
586
  // Natyarambhe: arms out at shoulder height, hands raised in pataka.
587
- stance: { ...si, leftShoulder: 90, rightShoulder: 90, leftElbow: 0, rightElbow: 0, leftWrist: 75, rightWrist: 75 },
587
+ stance: { ...ri, leftShoulder: 90, rightShoulder: 90, leftElbow: 0, rightElbow: 0, leftWrist: 75, rightWrist: 75 },
588
588
  expression: { smile: 0.5, leftEye: 1.2, rightEye: 1.2, leftBrow: 0.3, rightBrow: 0.3 },
589
589
  hands: { left: "pataka", right: "pataka" },
590
590
  groove: { bounce: 0 },
@@ -626,7 +626,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
626
626
  { move: "alapadma", beats: 8 },
627
627
  { move: "tatta", beats: 4 }
628
628
  ]
629
- }, ai = {
629
+ }, ii = {
630
630
  label: "Charleston",
631
631
  bpm: 150,
632
632
  stance: { leftHip: 10, rightHip: 10, leftKnee: 10, rightKnee: 10, leftShoulder: 30, rightShoulder: 30, leftElbow: 20, rightElbow: 20 },
@@ -676,7 +676,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
676
676
  { move: "basic", beats: 8, mirror: !0 },
677
677
  { move: "twist", beats: 4 }
678
678
  ]
679
- }, ii = {
679
+ }, li = {
680
680
  label: "Tap",
681
681
  bpm: 120,
682
682
  // Three-quarters to side-on, so shuffles read as brushes forward and back. Side-on,
@@ -774,7 +774,7 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
774
774
  { move: "heelToe", beats: 8 },
775
775
  { move: "crampRoll", beats: 4 }
776
776
  ]
777
- }, li = {
777
+ }, hi = {
778
778
  label: "Popping (glides, moonwalk)",
779
779
  bpm: 100,
780
780
  stance: { leftHip: 9, rightHip: 9, leftShoulder: 16, rightShoulder: 16, leftElbow: -24, rightElbow: -24 },
@@ -848,18 +848,18 @@ const $t = { type: "back", mode: "out", overshoot: 1.1 }, Se = "ease-out-cubic",
848
848
  { move: "toeStand", beats: 4 }
849
849
  ]
850
850
  }, Je = {
851
- disco: Ja,
852
- hipHop: Za,
853
- breaking: Qa,
854
- jazz: ei,
855
- kpop: ti,
856
- bollywood: oi,
857
- bhangra: ni,
858
- bharatanatyam: ri,
859
- charleston: ai,
860
- tap: ii,
861
- popping: li
862
- }, it = (e, t) => (e % t + t) % t, In = (e) => e * e * (3 - 2 * e), hi = (e) => Object.fromEntries(
851
+ disco: Za,
852
+ hipHop: Qa,
853
+ breaking: ei,
854
+ jazz: ti,
855
+ kpop: oi,
856
+ bollywood: ni,
857
+ bhangra: si,
858
+ bharatanatyam: ai,
859
+ charleston: ii,
860
+ tap: li,
861
+ popping: hi
862
+ }, it = (e, t) => (e % t + t) % t, In = (e) => e * e * (3 - 2 * e), ci = (e) => Object.fromEntries(
863
863
  ["left", "right"].flatMap((t) => Object.entries(we[e]).map(([o, n]) => [`hand.${t}.${o}`, n]))
864
864
  );
865
865
  function vo(e, t = !1) {
@@ -885,7 +885,7 @@ function vo(e, t = !1) {
885
885
  "arm.left.bend": -35 * f,
886
886
  "arm.right.bend": -35 * f,
887
887
  smile: 0.9,
888
- ...hi(t ? "hold" : "spread")
888
+ ...ci(t ? "hold" : "spread")
889
889
  };
890
890
  if (!t)
891
891
  for (const p of Object.keys(a)) p.startsWith("arm.") && (u[p] += (a[p] - u[p]) * f);
@@ -917,7 +917,7 @@ function Zt(e, t, o = ye) {
917
917
  const f = Math.floor(t), u = t - f, p = u <= 0.6 ? 1 : 1 - In((u - 0.6) / 0.4), g = Math.max(0, ...n.strikes.map((b) => 1 - Math.min(it(a - b, n.beats), it(b - a, n.beats)) / 0.25));
918
918
  return { pose: d, contact: { side: it(f, 2) === 0 ? "left" : "right", start: f, weight: p }, strike: g };
919
919
  }
920
- function Ed(e, t) {
920
+ function Ad(e, t) {
921
921
  const o = ir(t.style), n = t.bpm ?? o.bpm, a = t.beats ?? o.beats, r = t.samplesPerBeat ?? 16;
922
922
  if (![n, a, r].every((h) => Number.isFinite(h) && h > 0)) throw new Error("humanDanceTracks: bpm, beats and samplesPerBeat must be positive and finite");
923
923
  if (!Number.isFinite(t.start ?? 0)) throw new Error("humanDanceTracks: start must be finite");
@@ -937,7 +937,7 @@ function hr(e, t, o) {
937
937
  const n = lo(e.pose), a = fn(e).hip, r = na(e.character.plan, n, e.character.height), s = Te(Te(o, e.position), a), i = sa(s, (n.roll ?? 0) * Math.PI / 180), h = io(r.root, Gs(i, -(n.turn ?? 0) * Math.PI / 2));
938
938
  return zo(e.character.plan, n, t, h, { height: e.character.height });
939
939
  }
940
- function ci(e, t, o, n = "toe") {
940
+ function di(e, t, o, n = "toe") {
941
941
  const a = `leg.${t}`, r = n === "toe" ? 3 : 2;
942
942
  let s = { ...e, pose: lo(e.pose), position: [...e.position] };
943
943
  for (let h = 0; h < 6; h++) {
@@ -953,7 +953,7 @@ function xn(e, t) {
953
953
  const o = ut(e, `arm.${t}`, 2), n = ut(e, `arm.${t}`, 1);
954
954
  return io(o, Qt(lr(Te(o, n)), e.character.lineWidth * 0.5));
955
955
  }
956
- function Ad(e, t, o = {}) {
956
+ function Td(e, t, o = {}) {
957
957
  const n = Math.min(e.character.height, t.character.height), a = o.length ?? n * 0.22;
958
958
  if (!(a > 0) || !Number.isFinite(a)) throw new Error("meetDandiya: stick length must be positive and finite");
959
959
  const r = o.point ?? [(e.position[0] + t.position[0]) / 2, Math.max(e.position[1], t.position[1]) + n * 0.62, (e.position[2] + t.position[2]) / 2], s = (c, l) => {
@@ -975,7 +975,7 @@ function Ad(e, t, o = {}) {
975
975
  reached: [i.stick, h.stick].every((c) => dn(Te(c.tip, r)) < n * 2e-3)
976
976
  };
977
977
  }
978
- function di(e, t) {
978
+ function fi(e, t) {
979
979
  const o = t.count ?? 8, n = t.beatsPerTurn ?? 32;
980
980
  if (!Number.isFinite(e) || !Number.isFinite(t.radius) || t.radius <= 0 || !Number.isInteger(o) || o < 1 || !Number.isFinite(n) || n <= 0) throw new Error("danceCircleAt: finite beat, positive radius/beatsPerTurn and a positive integer count are required");
981
981
  const a = t.center ?? [0, 0], r = t.direction ?? 1;
@@ -987,7 +987,7 @@ function di(e, t) {
987
987
  return Array.from({ length: o }, (l, d) => {
988
988
  const f = h(e, d);
989
989
  if (t.plantFeet === !1) return { ...f, planted: !1 };
990
- const u = h(c.start, d), p = ut(u, `leg.${c.side}`, 3), g = ci(f, c.side, p);
990
+ const u = h(c.start, d), p = ut(u, `leg.${c.side}`, 3), g = di(f, c.side, p);
991
991
  return {
992
992
  ...f,
993
993
  pose: Ys(f.pose, g.pose, c.weight),
@@ -996,12 +996,12 @@ function di(e, t) {
996
996
  };
997
997
  });
998
998
  }
999
- function Td(e, t) {
999
+ function Pd(e, t) {
1000
1000
  if (t.count !== void 0 && t.count !== e.length) throw new Error("danceCircleTracks: count must match targets.length");
1001
1001
  const o = t.bpm ?? 120, n = t.samplesPerBeat ?? 16;
1002
1002
  if (!e.length || ![o, t.beats, n].every((h) => Number.isFinite(h) && h > 0)) throw new Error("danceCircleTracks: targets and positive finite bpm, beats and samplesPerBeat are required");
1003
1003
  if (!Number.isFinite(t.start ?? 0)) throw new Error("danceCircleTracks: start must be finite");
1004
- const a = Math.max(1, Math.ceil(t.beats * n)), r = Array.from({ length: a + 1 }, (h, c) => ({ time: (t.start ?? 0) + t.beats * c / a * 6e4 / o, members: di(t.beats * c / a, { ...t, count: e.length }) })), s = r.some((h) => h.members.some((c) => c.pose.roll !== 0)), i = /* @__PURE__ */ new Set(["x", "y", "z", "rotateY", ...s ? ["turn", "roll"] : []]);
1004
+ const a = Math.max(1, Math.ceil(t.beats * n)), r = Array.from({ length: a + 1 }, (h, c) => ({ time: (t.start ?? 0) + t.beats * c / a * 6e4 / o, members: fi(t.beats * c / a, { ...t, count: e.length }) })), s = r.some((h) => h.members.some((c) => c.pose.roll !== 0)), i = /* @__PURE__ */ new Set(["x", "y", "z", "rotateY", ...s ? ["turn", "roll"] : []]);
1005
1005
  return e.flatMap((h, c) => {
1006
1006
  const l = r.map((d) => {
1007
1007
  const f = d.members[c], { turn: u, ...p } = f.pose;
@@ -1016,7 +1016,7 @@ function Td(e, t) {
1016
1016
  });
1017
1017
  }
1018
1018
  const eo = (e) => Math.min(1, Math.max(0, e));
1019
- function fi(e) {
1019
+ function ui(e) {
1020
1020
  const t = { ...ce, turn: e.view }, o = [];
1021
1021
  for (const n of e.keys) {
1022
1022
  const a = o[o.length - 1], r = !a || n.reset ? t : a.pose;
@@ -1024,33 +1024,33 @@ function fi(e) {
1024
1024
  }
1025
1025
  return o;
1026
1026
  }
1027
- function ui(e) {
1028
- return e - gi * Math.sin(2 * Math.PI * e) / (2 * Math.PI);
1027
+ function gi(e) {
1028
+ return e - pi * Math.sin(2 * Math.PI * e) / (2 * Math.PI);
1029
1029
  }
1030
- const gi = 0.5;
1031
- function pi(e, t) {
1030
+ const pi = 0.5;
1031
+ function mi(e, t) {
1032
1032
  if (!(t <= e.takeoff || t >= e.landing))
1033
1033
  return (t - e.takeoff) / (e.landing - e.takeoff);
1034
1034
  }
1035
- function mi(e, t) {
1036
- const o = typeof e == "string" ? ho[e] : e, n = fi(o), a = eo(t);
1035
+ function yi(e, t) {
1036
+ const o = typeof e == "string" ? ho[e] : e, n = ui(o), a = eo(t);
1037
1037
  let r = 0;
1038
1038
  for (let d = 0; d < n.length; d++) n[d].at <= a && (r = d);
1039
- const s = n[r], i = n[Math.min(r + 1, n.length - 1)], h = i.at > s.at ? (a - s.at) / (i.at - s.at) : 0, c = on(s.pose, i.pose, mt(i.easing ?? "ease-in-out")(eo(h))), l = pi(o, a);
1039
+ const s = n[r], i = n[Math.min(r + 1, n.length - 1)], h = i.at > s.at ? (a - s.at) / (i.at - s.at) : 0, c = on(s.pose, i.pose, mt(i.easing ?? "ease-in-out")(eo(h))), l = mi(o, a);
1040
1040
  return l === void 0 ? { ...c, spin: 0, rise: 0 } : {
1041
1041
  ...c,
1042
- spin: o.spin * ui(l),
1042
+ spin: o.spin * gi(l),
1043
1043
  rise: 4 * o.height * l * (1 - l)
1044
1044
  };
1045
1045
  }
1046
- function yi(e, t, o) {
1046
+ function bi(e, t, o) {
1047
1047
  const n = typeof e == "string" ? ho[e] : e, a = eo(t), r = eo((a - n.takeoff) / (n.landing - n.takeoff));
1048
1048
  return n.travel * o * r;
1049
1049
  }
1050
- function Pd(e, t, o = {}) {
1050
+ function Od(e, t, o = {}) {
1051
1051
  const n = typeof t == "string" ? ho[t] : t, a = o.start ?? 0, r = o.duration ?? n.duration, s = o.samples ?? 48, i = Array.from({ length: s + 1 }, (l, d) => {
1052
1052
  const f = d / s;
1053
- return { time: a + f * r, progress: f, pose: mi(n, f) };
1053
+ return { time: a + f * r, progress: f, pose: yi(n, f) };
1054
1054
  }), c = Object.keys(ce).filter((l) => i.some((d) => d.pose[l] !== ce[l])).map((l) => ({
1055
1055
  id: `${e}-${l}`,
1056
1056
  target: e,
@@ -1063,12 +1063,12 @@ function Pd(e, t, o = {}) {
1063
1063
  id: `${e}-x`,
1064
1064
  target: e,
1065
1065
  property: "x",
1066
- keyframes: i.map((d) => ({ time: d.time, value: (o.x ?? 0) + l * yi(n, d.progress, o.height) }))
1066
+ keyframes: i.map((d) => ({ time: d.time, value: (o.x ?? 0) + l * bi(n, d.progress, o.height) }))
1067
1067
  });
1068
1068
  }
1069
1069
  return c;
1070
1070
  }
1071
- const bi = {
1071
+ const wi = {
1072
1072
  leftHip: -55,
1073
1073
  leftKnee: -95,
1074
1074
  rightHip: 55,
@@ -1080,7 +1080,7 @@ const bi = {
1080
1080
  lean: 22,
1081
1081
  stretch: 0.94,
1082
1082
  headTilt: 6
1083
- }, wi = {
1083
+ }, ki = {
1084
1084
  leftHip: 0,
1085
1085
  leftKnee: 0,
1086
1086
  rightHip: 0,
@@ -1108,7 +1108,7 @@ const bi = {
1108
1108
  lean: 26,
1109
1109
  stretch: 1,
1110
1110
  headTilt: 14
1111
- }, ki = {
1111
+ }, vi = {
1112
1112
  leftHip: -22,
1113
1113
  leftKnee: -30,
1114
1114
  rightHip: 22,
@@ -1121,7 +1121,7 @@ const bi = {
1121
1121
  rightElbow: 0,
1122
1122
  lean: 8,
1123
1123
  headTilt: 0
1124
- }, vi = {
1124
+ }, Si = {
1125
1125
  leftHip: -58,
1126
1126
  leftKnee: -100,
1127
1127
  rightHip: 58,
@@ -1147,11 +1147,11 @@ function et(e, t, o, n, a, r = 1300) {
1147
1147
  duration: r,
1148
1148
  keys: [
1149
1149
  { at: 0, reset: !0 },
1150
- { at: 0.16, pose: bi },
1151
- { at: 0.27, pose: wi, easing: "ease-out-quad" },
1150
+ { at: 0.16, pose: wi },
1151
+ { at: 0.27, pose: ki, easing: "ease-out-quad" },
1152
1152
  ...a,
1153
- { at: 0.76, pose: ki },
1154
- { at: 0.86, pose: vi, easing: "ease-out-quad" },
1153
+ { at: 0.76, pose: vi },
1154
+ { at: 0.86, pose: Si, easing: "ease-out-quad" },
1155
1155
  { at: 1, reset: !0 }
1156
1156
  ]
1157
1157
  };
@@ -1248,7 +1248,7 @@ const ho = {
1248
1248
  { at: 0.6, pose: { leftHip: -40, rightHip: 40, leftKnee: -20, rightKnee: 20, lean: 6, headTilt: 0 } }
1249
1249
  ], 1200)
1250
1250
  };
1251
- function Si(e, t) {
1251
+ function Mi(e, t) {
1252
1252
  const o = Math.min(1, Math.max(0, e.turn ?? 0)), n = 1 - o, a = { ...ye, turn: o }, r = [
1253
1253
  { stick: "right", human: "left", s: 1 },
1254
1254
  { stick: "left", human: "right", s: -1 }
@@ -1257,23 +1257,23 @@ function Si(e, t) {
1257
1257
  const l = e[`${i}Shoulder`], d = e[`${i}Elbow`];
1258
1258
  a[`arm.${h}.spread`] = l * n, a[`arm.${h}.swing`] = c * l * o, a[`arm.${h}.bend`] = d * n, a[`arm.${h}.elbow`] = c * d * o;
1259
1259
  const f = e[`${i}Hip`], u = e[`${i}Knee`], p = n + c * o;
1260
- a[`leg.${h}.rotate`] = 90 * n, a[`leg.${h}.spread`] = 0, a[`leg.${h}.swing`] = f * p, a[`leg.${h}.knee`] = u * p, a[`leg.${h}.ankle`] = -(e[`${i}Ankle`] ?? 0), a[`leg.${h}.toeOut`] = (e[`${i}FootOut`] ?? 0) * Mi, a[`eye.${h}`] = e[`${i}Eye`], a[`brow.${h}`] = e[`${i}Brow`], t && Object.assign(a, $i(h, t[i] ?? Pe, e[`${i}Wrist`] ?? 0, o));
1260
+ a[`leg.${h}.rotate`] = 90 * n, a[`leg.${h}.spread`] = 0, a[`leg.${h}.swing`] = f * p, a[`leg.${h}.knee`] = u * p, a[`leg.${h}.ankle`] = -(e[`${i}Ankle`] ?? 0), a[`leg.${h}.toeOut`] = (e[`${i}FootOut`] ?? 0) * $i, a[`eye.${h}`] = e[`${i}Eye`], a[`brow.${h}`] = e[`${i}Brow`], t && Object.assign(a, Ei(h, t[i] ?? Pe, e[`${i}Wrist`] ?? 0, o));
1261
1261
  }
1262
1262
  const s = e.bend ?? 0;
1263
1263
  a.lean = e.lean * o, a.bend = s * o, a.side = (e.lean + s * 0.5) * n, a["head.tilt"] = (e.headTilt + s * 0.5) * n, a["head.nod"] = e.headTilt * o;
1264
1264
  for (const i of ["mouth", "smile", "mouthWidth", "blink", "browTilt", "lookX", "lookY", "stretch"]) a[i] = e[i];
1265
1265
  return a.lift = e.rise ?? 0, a.roll = e.spin ?? 0, a;
1266
1266
  }
1267
- const Mi = 70;
1268
- function $i(e, t, o, n) {
1267
+ const $i = 70;
1268
+ function Ei(e, t, o, n) {
1269
1269
  const a = e === "right" ? 1 - n : 1 + n, r = {};
1270
1270
  for (const s of Object.keys(Pe)) r[`hand.${e}.${s}`] = t[s] ?? Pe[s];
1271
1271
  return r[`hand.${e}.turn`] = (t.turn ?? 0) - a, r[`hand.${e}.roll`] = (t.roll ?? 0) + o, r;
1272
1272
  }
1273
1273
  function cr(e, t, o = {}) {
1274
- e.save(), Ei(e, t, o), e.restore();
1274
+ e.save(), Ai(e, t, o), e.restore();
1275
1275
  }
1276
- function Ei(e, t, o) {
1276
+ function Ai(e, t, o) {
1277
1277
  const n = dr(t, o);
1278
1278
  o.shadow !== !1 && fr(e, t, o);
1279
1279
  for (const a of t.under) jn(e, a, n, o);
@@ -1309,10 +1309,10 @@ function dr(e, t = {}) {
1309
1309
  function fr(e, t, o = {}) {
1310
1310
  t.shadow.opacity <= 0 || t.shadow.points.length < 3 || (e.save(), e.globalAlpha = t.shadow.opacity, co(e, t.shadow.points, o.ink ?? "#26262b", !1), e.restore());
1311
1311
  }
1312
- function Od(e, t, o, n = {}) {
1312
+ function Hd(e, t, o, n = {}) {
1313
1313
  e.save(), Bo(e, t, o, n), e.restore();
1314
1314
  }
1315
- function Ai(e, t, o, n = {}) {
1315
+ function Ti(e, t, o, n = {}) {
1316
1316
  const a = n.style === "stick", r = t.flatMap((l) => {
1317
1317
  if (a && l.part.solidOnly) return [];
1318
1318
  const d = l.part.layer ?? 0;
@@ -1347,7 +1347,7 @@ function Ai(e, t, o, n = {}) {
1347
1347
  const f = h(l);
1348
1348
  if (!d) f.line(l.spine, o * 1.15);
1349
1349
  else {
1350
- const u = a ? ur(l, n) : d.light ? Ti(l, d, n) : gn(l);
1350
+ const u = a ? ur(l, n) : d.light ? Pi(l, d, n) : gn(l);
1351
1351
  u && (!a && n.look === "silhouette" ? f.shape(d.points, u, 0) : co(e, d.points, a || d.light ? u : mn(u, d.tone), !0, l.cut ? 1.6 : 0.8));
1352
1352
  const p = (l.part.outline ?? 1) * o;
1353
1353
  if (p > 0)
@@ -1363,7 +1363,7 @@ function un(e, t, o, n) {
1363
1363
  look: n.look ?? "clean",
1364
1364
  ink: t.part.ink ?? n.ink ?? "#26262b",
1365
1365
  lineWidth: o,
1366
- seed: De(`${n.seed ?? 0}:${t.part.id}`),
1366
+ seed: Fe(`${n.seed ?? 0}:${t.part.id}`),
1367
1367
  time: n.time ?? 0,
1368
1368
  pencil: { construction: !1, rubbedOut: 0, ...n.pencil }
1369
1369
  });
@@ -1372,7 +1372,7 @@ function gn(e) {
1372
1372
  const { part: t } = e;
1373
1373
  return t.glow && e.glow > 0 && t.fill ? pr(t.fill, t.glow.color, e.glow) : t.fill;
1374
1374
  }
1375
- function Ti(e, t, o) {
1375
+ function Pi(e, t, o) {
1376
1376
  const { part: n } = e;
1377
1377
  if (!n.fill) return;
1378
1378
  const a = gr(n.fill, t.light, t.fog ?? 0, o.fog);
@@ -1380,13 +1380,13 @@ function Ti(e, t, o) {
1380
1380
  }
1381
1381
  function ur(e, t) {
1382
1382
  const o = gn(e);
1383
- return o && (Oi(o) || e.glow > 0) ? o : t.paper ?? "#fbf8ef";
1383
+ return o && (Hi(o) || e.glow > 0) ? o : t.paper ?? "#fbf8ef";
1384
1384
  }
1385
1385
  function Bo(e, t, o, n) {
1386
1386
  t.opacity < 1 ? (e.save(), e.globalAlpha *= t.opacity, Kn(e, t, o, n), e.restore()) : Kn(e, t, o, n);
1387
1387
  }
1388
1388
  function Kn(e, t, o, n) {
1389
- if (n.style === "stick") return Pi(e, t, o, n);
1389
+ if (n.style === "stick") return Oi(e, t, o, n);
1390
1390
  const { part: a } = t, r = un(e, t, o, n), s = gn(t), i = n.look === "silhouette";
1391
1391
  for (const c of t.faces)
1392
1392
  s && (i ? r.shape(c.points, s, 0) : co(e, c.points, mn(s, c.tone)));
@@ -1395,7 +1395,7 @@ function Kn(e, t, o, n) {
1395
1395
  for (const c of t.edges) c.length > 1 && r.line(c, h);
1396
1396
  for (const c of t.marks) r.line(c, o * 0.7);
1397
1397
  }
1398
- function Pi(e, t, o, n) {
1398
+ function Oi(e, t, o, n) {
1399
1399
  const { part: a } = t;
1400
1400
  if (a.solidOnly) return;
1401
1401
  const r = un(e, t, o, n);
@@ -1410,7 +1410,7 @@ function Pi(e, t, o, n) {
1410
1410
  for (const h of t.edges) h.length > 1 && r.line(h, i);
1411
1411
  for (const h of t.marks) r.line(h, o * 0.7);
1412
1412
  }
1413
- function Oi(e) {
1413
+ function Hi(e) {
1414
1414
  const t = gt(e);
1415
1415
  return t ? (0.299 * t[0] + 0.587 * t[1] + 0.114 * t[2]) / 255 < 0.3 : !1;
1416
1416
  }
@@ -1441,7 +1441,7 @@ function pr(e, t, o) {
1441
1441
  const n = gt(e), a = gt(t);
1442
1442
  return !n || !a ? o < 0.5 ? e : t : pn(n.map((r, s) => r + (a[s] - r) * o));
1443
1443
  }
1444
- const Hi = /* @__PURE__ */ new Set([
1444
+ const Ii = /* @__PURE__ */ new Set([
1445
1445
  "x",
1446
1446
  "y",
1447
1447
  "z",
@@ -1457,29 +1457,29 @@ const Hi = /* @__PURE__ */ new Set([
1457
1457
  "visible",
1458
1458
  "opacity",
1459
1459
  "color"
1460
- ]), Ii = /* @__PURE__ */ new Set(["walk", "walking", "gait"]), Cn = (e) => typeof e == "number" ? e : void 0, xi = 1.7;
1461
- function ji(e, t, o) {
1460
+ ]), xi = /* @__PURE__ */ new Set(["walk", "walking", "gait"]), Cn = (e) => typeof e == "number" ? e : void 0, ji = 1.7;
1461
+ function _i(e, t, o) {
1462
1462
  const n = Array.from({ length: 24 }, (a, r) => {
1463
1463
  const s = r / 24 * Math.PI * 2, i = t.toView([Math.cos(s) * o, 0, Math.sin(s) * o * 0.8]);
1464
1464
  return i[2] < -1e-3 ? t.toScreen(i) : null;
1465
1465
  });
1466
1466
  n.some((a) => a === null) || (e.beginPath(), n.forEach((a, r) => r === 0 ? e.moveTo(a.x, a.y) : e.lineTo(a.x, a.y)), e.closePath(), e.fillStyle = "rgba(0, 0, 0, 0.22)", e.fill());
1467
1467
  }
1468
- function _i(e) {
1468
+ function Ki(e) {
1469
1469
  const t = ke.dot([0, 1, 0], e);
1470
1470
  if (t > 0.999999) return ne.identity();
1471
1471
  if (t < -0.999999) return ne.fromQuat(We.fromAxisAngle([1, 0, 0], 180));
1472
1472
  const o = ke.cross([0, 1, 0], e);
1473
1473
  return ne.fromQuat(We.fromAxisAngle(o, Math.acos(t) * 180 / Math.PI));
1474
1474
  }
1475
- function Ki(e, t, o, n, a) {
1475
+ function Ci(e, t, o, n, a) {
1476
1476
  const r = e.solid ?? {}, s = r.outline === !1 ? void 0 : r.outline ?? { width: 2, color: "#0f172a" }, i = { color: r.color ?? "#475569", shading: r.shading ?? "toon", outline: s }, h = { color: r.skin ?? "#f2c49b", shading: r.shading ?? "toon", outline: s }, c = { color: "#0f172a", shading: "unlit" }, l = n.height * 0.034, d = [], f = (M, m, P) => d.push({ mesh: M, world: ne.multiply(a, m), material: P }), u = (M, m, P) => f(t.sphere, ne.compose(M, [0, 0, 0, 1], [m, m, m]), P);
1477
1477
  for (const M of o.chains) {
1478
1478
  const m = n.chains[M.id], P = M.id === "spine" ? 1.9 : 1;
1479
1479
  M.bones.forEach((A, k) => {
1480
1480
  const y = m[k], v = m[k + 1], w = ke.distance(y, v), [E, O] = A.width ?? [1, 1], j = l * P * (E + O) / 2;
1481
1481
  if (w > 1e-6) {
1482
- const x = ke.lerp(y, v, 0.5), W = _i(ke.normalize(ke.subtract(v, y)));
1482
+ const x = ke.lerp(y, v, 0.5), W = Ki(ke.normalize(ke.subtract(v, y)));
1483
1483
  f(t.cylinder, ne.multiply(ne.translation(x), ne.multiply(W, ne.scaling([j, w, j]))), i);
1484
1484
  }
1485
1485
  u(y, l * P * E, i), u(v, l * P * O, i);
@@ -1493,7 +1493,7 @@ function Ki(e, t, o, n, a) {
1493
1493
  }
1494
1494
  return d;
1495
1495
  }
1496
- const Hd = {
1496
+ const Id = {
1497
1497
  kind: "character",
1498
1498
  validate(e) {
1499
1499
  const t = e;
@@ -1503,7 +1503,7 @@ const Hd = {
1503
1503
  return {
1504
1504
  who: sn({ ...e.character, height: 1 }),
1505
1505
  cylinder: Vt(er(1, 1, 16)),
1506
- sphere: Vt(Na(1, 20))
1506
+ sphere: Vt(Ra(1, 20))
1507
1507
  };
1508
1508
  },
1509
1509
  // `lights` may be missing from a scene entry older than this add-on: treated as none.
@@ -1511,21 +1511,21 @@ const Hd = {
1511
1511
  const h = e, c = t, l = c.who;
1512
1512
  let d = { ...ye, ...h.pose };
1513
1513
  for (const [y, v] of o)
1514
- typeof v == "number" && !Hi.has(y) && !Ii.has(y) && (d[y] = v);
1514
+ typeof v == "number" && !Ii.has(y) && !xi.has(y) && (d[y] = v);
1515
1515
  const f = Math.max(0, Math.min(1, Cn(o.get("walking")) ?? h.walking ?? 0));
1516
1516
  if (f > 0) {
1517
1517
  const y = typeof o.get("gait") == "string" ? o.get("gait") : h.gait, v = aa(y, Cn(o.get("walk")) ?? 0, d);
1518
1518
  d = Object.fromEntries(Object.keys({ ...d, ...v }).map((w) => [w, (d[w] ?? 0) + ((v[w] ?? 0) - (d[w] ?? 0)) * f]));
1519
1519
  }
1520
- const u = h.height ?? xi, p = ne.multiply(a.view, n), g = {
1520
+ const u = h.height ?? ji, p = ne.multiply(a.view, n), g = {
1521
1521
  toView: (y) => ne.transformPoint(p, y),
1522
1522
  toScreen: (y) => i(y)
1523
1523
  }, T = -g.toView([0, u / 2, 0])[2];
1524
1524
  if (T <= a.near) return null;
1525
- const H = h.shadow === !1 ? [] : [{ depth: T + u, draw: (y) => ji(y, g, u * 0.18) }];
1525
+ const H = h.shadow === !1 ? [] : [{ depth: T + u, draw: (y) => _i(y, g, u * 0.18) }];
1526
1526
  if (h.look === "solid") {
1527
1527
  const y = nn(l.plan, d, { height: u, contact: l.contact });
1528
- return { meshes: Ki(h, c, l.plan, y, n), drawables: H };
1528
+ return { meshes: Ci(h, c, l.plan, y, n), drawables: H };
1529
1529
  }
1530
1530
  const M = ne.transformPoint(n, [0, u * 0.6, 0]), m = ke.normalize(ke.subtract(a.position, M)), P = tr(M, m, r).map((y) => Math.min(1, y));
1531
1531
  let A = l;
@@ -1563,7 +1563,7 @@ const Hd = {
1563
1563
  l: { mouth: 0.3, mouthWidth: 1 },
1564
1564
  /** Other consonants: slightly open */
1565
1565
  c: { mouth: 0.2, mouthWidth: 1 }
1566
- }, wt = 1, Ct = 0.55, Nn = 0.35, Ci = 1.6, Rn = { a: "a", e: "e", i: "i", y: "i", o: "o", u: "u" }, Wn = { m: "m", b: "m", p: "m", f: "f", v: "f", w: "u", q: "u", l: "l", n: "l", d: "l", t: "l" }, zn = {
1566
+ }, wt = 1, Ct = 0.55, Nn = 0.35, Ni = 1.6, Rn = { a: "a", e: "e", i: "i", y: "i", o: "o", u: "u" }, Wn = { m: "m", b: "m", p: "m", f: "f", v: "f", w: "u", q: "u", l: "l", n: "l", d: "l", t: "l" }, zn = {
1567
1567
  अ: "a",
1568
1568
  आ: "a",
1569
1569
  इ: "i",
@@ -1590,15 +1590,15 @@ const Hd = {
1590
1590
  "ौ": "o",
1591
1591
  "ॅ": "e",
1592
1592
  "ॉ": "o"
1593
- }, Ni = { प: "m", फ: "m", ब: "m", भ: "m", म: "m", व: "u" }, Ri = "्", Dn = "़", Wi = (e) => e >= "क" && e <= "ह", Fn = /* @__PURE__ */ new Set([".", ",", "!", "?", ";", ":", "…", "।", "॥", "—", "-"]);
1594
- function zi(e) {
1593
+ }, Ri = { प: "m", फ: "m", ब: "m", भ: "m", म: "m", व: "u" }, Wi = "्", Fn = "़", zi = (e) => e >= "क" && e <= "ह", Dn = /* @__PURE__ */ new Set([".", ",", "!", "?", ";", ":", "…", "।", "॥", "—", "-"]);
1594
+ function Li(e) {
1595
1595
  const t = [], o = Array.from(e.toLowerCase()), n = (a, r) => {
1596
1596
  const s = t[t.length - 1];
1597
1597
  s && s.viseme === a ? s.weight += r * 0.5 : t.push({ viseme: a, weight: r });
1598
1598
  };
1599
1599
  for (let a = 0; a < o.length; a++) {
1600
1600
  const r = o[a], s = o[a + 1];
1601
- if (Fn.has(r)) n("rest", Ci);
1601
+ if (Dn.has(r)) n("rest", Ni);
1602
1602
  else if (/\s/.test(r)) {
1603
1603
  const i = t[t.length - 1];
1604
1604
  i && i.viseme !== "rest" && t.push({ viseme: "c", weight: Nn });
@@ -1610,13 +1610,13 @@ function zi(e) {
1610
1610
  if (r === "h") continue;
1611
1611
  if (/[a-z]/.test(r)) n("c", Ct);
1612
1612
  else if (r in zn) n(zn[r], wt);
1613
- else if (Wi(r)) {
1614
- const i = s === Dn ? r === "फ" ? "f" : void 0 : Ni[r];
1613
+ else if (zi(r)) {
1614
+ const i = s === Fn ? r === "फ" ? "f" : void 0 : Ri[r];
1615
1615
  n(i ?? "c", Ct);
1616
1616
  let h = a + 1;
1617
- o[h] === Dn && h++;
1617
+ o[h] === Fn && h++;
1618
1618
  const c = o[h];
1619
- c === Ri ? a = h : c && c in Ln ? (n(Ln[c], wt), a = h) : (!c || /\s/.test(c) || Fn.has(c) || n("a", wt * 0.6), a = h - 1);
1619
+ c === Wi ? a = h : c && c in Ln ? (n(Ln[c], wt), a = h) : (!c || /\s/.test(c) || Dn.has(c) || n("a", wt * 0.6), a = h - 1);
1620
1620
  } else (r === "ं" || r === "ँ") && n("l", Ct * 0.6);
1621
1621
  }
1622
1622
  }
@@ -1624,7 +1624,7 @@ function zi(e) {
1624
1624
  return t;
1625
1625
  }
1626
1626
  function mr(e, t = {}) {
1627
- const o = t.fields?.mouth ?? "mouth", n = t.fields?.mouthWidth ?? "mouthWidth", a = t.energy ?? 1, r = zi(e.text), s = [{ time: e.start, value: Be.rest.mouth }], i = [{ time: e.start, value: Be.rest.mouthWidth }], h = r.reduce((l, d) => l + d.weight, 0), c = e.end - e.start;
1627
+ const o = t.fields?.mouth ?? "mouth", n = t.fields?.mouthWidth ?? "mouthWidth", a = t.energy ?? 1, r = Li(e.text), s = [{ time: e.start, value: Be.rest.mouth }], i = [{ time: e.start, value: Be.rest.mouthWidth }], h = r.reduce((l, d) => l + d.weight, 0), c = e.end - e.start;
1628
1628
  if (h > 0 && c > 0) {
1629
1629
  let l = e.start;
1630
1630
  for (const d of r) {
@@ -1638,7 +1638,7 @@ function mr(e, t = {}) {
1638
1638
  }
1639
1639
  return e.end > s[s.length - 1].time && (s.push({ time: e.end, value: Be.rest.mouth, easing: "ease-in-out" }), i.push({ time: e.end, value: Be.rest.mouthWidth, easing: "ease-in-out" })), { [o]: s, [n]: i };
1640
1640
  }
1641
- function Id(e, t, o = {}) {
1641
+ function xd(e, t, o = {}) {
1642
1642
  const n = {};
1643
1643
  for (const a of [...t].sort((r, s) => r.start - s.start))
1644
1644
  for (const [r, s] of Object.entries(mr(a, o))) {
@@ -1665,7 +1665,7 @@ const Et = ([e, t, o]) => {
1665
1665
  const n = Math.hypot(e, t, o) || 1;
1666
1666
  return [e / n, t / n, o / n];
1667
1667
  };
1668
- function Li([e, t, o]) {
1668
+ function Fi([e, t, o]) {
1669
1669
  const [n, a, r] = [e / 2, t / 2, o / 2];
1670
1670
  return {
1671
1671
  vertices: [
@@ -1715,7 +1715,7 @@ function Di(e, t, o = "x", n = 20, a = 0) {
1715
1715
  }
1716
1716
  return { vertices: r, faces: i, marks: h, creases: !0 };
1717
1717
  }
1718
- function Fi([e, t, o], n = 16) {
1718
+ function qi([e, t, o], n = 16) {
1719
1719
  const a = Math.max(4, Math.round(n / 2)), r = [[0, t, 0]];
1720
1720
  for (let l = 1; l < a; l++) {
1721
1721
  const d = Math.PI * l / a;
@@ -1740,12 +1740,12 @@ function Fi([e, t, o], n = 16) {
1740
1740
  }
1741
1741
  return { vertices: r, faces: c, creases: !1 };
1742
1742
  }
1743
- const qi = (e) => e.reduce((t, [o, n], a) => {
1743
+ const Bi = (e) => e.reduce((t, [o, n], a) => {
1744
1744
  const [r, s] = e[(a + 1) % e.length];
1745
1745
  return t + o * s - r * n;
1746
1746
  }, 0) / 2;
1747
- function Bi(e, t) {
1748
- const o = qi(e) < 0 ? [...e].reverse() : e, n = o.length, a = t / 2, r = [...o.map(([i, h]) => [a, h, i]), ...o.map(([i, h]) => [-a, h, i])], s = [
1747
+ function Gi(e, t) {
1748
+ const o = Bi(e) < 0 ? [...e].reverse() : e, n = o.length, a = t / 2, r = [...o.map(([i, h]) => [a, h, i]), ...o.map(([i, h]) => [-a, h, i])], s = [
1749
1749
  // Seen from +x, (forward, up) = (z, y) runs anticlockwise when z points left on screen: so reverse for the left cap.
1750
1750
  { corners: Array.from({ length: n }, (i, h) => n - 1 - h), normal: [1, 0, 0] },
1751
1751
  { corners: Array.from({ length: n }, (i, h) => n + h), normal: [-1, 0, 0] }
@@ -1756,7 +1756,7 @@ function Bi(e, t) {
1756
1756
  }
1757
1757
  return { vertices: r, faces: s, creases: !0 };
1758
1758
  }
1759
- function Gi(e, t) {
1759
+ function Yi(e, t) {
1760
1760
  const o = {
1761
1761
  left: ([a, r]) => [0, r, a],
1762
1762
  right: ([a, r]) => [0, r, a],
@@ -1766,7 +1766,7 @@ function Gi(e, t) {
1766
1766
  }, n = { left: [1, 0, 0], right: [-1, 0, 0], front: [0, 0, 1], back: [0, 0, -1], up: [0, 1, 0] };
1767
1767
  return { vertices: e.map(o[t]), faces: [{ corners: e.map((a, r) => r), normal: n[t] }] };
1768
1768
  }
1769
- function Yi(e, t, o = 8) {
1769
+ function Ui(e, t, o = 8) {
1770
1770
  const n = (s) => Array.isArray(t) ? t[Math.min(s, t.length - 1)] : t, a = [], r = [];
1771
1771
  e.forEach((s, i) => {
1772
1772
  const h = e[Math.min(i + 1, e.length - 1)], c = e[Math.max(i - 1, 0)], l = Et([h[0] - c[0], h[1] - c[1], h[2] - c[2]]), d = Math.abs(l[1]) < 0.9 ? [0, 1, 0] : [1, 0, 0], f = Et(qn(l, d)), u = qn(f, l);
@@ -1785,20 +1785,20 @@ function Yi(e, t, o = 8) {
1785
1785
  function qn(e, t) {
1786
1786
  return [e[1] * t[2] - e[2] * t[1], e[2] * t[0] - e[0] * t[2], e[0] * t[1] - e[1] * t[0]];
1787
1787
  }
1788
- function Ui(e) {
1788
+ function Xi(e) {
1789
1789
  switch (e.type) {
1790
1790
  case "box":
1791
- return Li(e.size);
1791
+ return Fi(e.size);
1792
1792
  case "cylinder":
1793
1793
  return Di(e.radius, e.length, e.axis, e.segments, e.spokes);
1794
1794
  case "ellipsoid":
1795
- return Fi(e.radii, e.segments);
1795
+ return qi(e.radii, e.segments);
1796
1796
  case "extrude":
1797
- return Bi(e.profile, e.width);
1797
+ return Gi(e.profile, e.width);
1798
1798
  case "panel":
1799
- return Gi(e.points, e.facing);
1799
+ return Yi(e.points, e.facing);
1800
1800
  case "tube":
1801
- return { ...Yi(e.points, e.radius, e.segments), joined: e.joined };
1801
+ return { ...Ui(e.points, e.radius, e.segments), joined: e.joined };
1802
1802
  }
1803
1803
  }
1804
1804
  function yr(e, t) {
@@ -1849,7 +1849,7 @@ function vr(e, t) {
1849
1849
  }
1850
1850
  return (o + n) / 2;
1851
1851
  }
1852
- const kt = 520, Bn = ["do", "at", "for", "to", "through", "toward", "speed", "pose", "gag", "say", "look", "turns", "dance", "bpm", "beats"], Xi = (e) => Math.max(700, Array.from(e).length * 65), Gn = 70, Yn = 35;
1852
+ const kt = 520, Bn = ["do", "at", "for", "to", "through", "toward", "speed", "pose", "gag", "say", "look", "turns", "dance", "bpm", "beats"], Vi = (e) => Math.max(700, Array.from(e).length * 65), Gn = 70, Yn = 35;
1853
1853
  function Sr(e, t) {
1854
1854
  const o = t[0] - e.x, n = t[1] - e.eyeHeight, a = t[2] - e.z, r = e.heading * Math.PI / 180, s = o * Math.cos(r) - a * Math.sin(r), i = o * Math.sin(r) + a * Math.cos(r), h = Math.atan2(s, i) * 180 / Math.PI, c = Math.hypot(s, i), l = -Math.atan2(n, c) * 180 / Math.PI, d = Math.max(-Gn, Math.min(Gn, h * 0.75)), f = Math.max(-Yn, Math.min(Yn, l * 0.7));
1855
1855
  return {
@@ -1859,7 +1859,7 @@ function Sr(e, t) {
1859
1859
  lookY: Math.max(-1, Math.min(1, (l - f) / 30))
1860
1860
  };
1861
1861
  }
1862
- const Vi = {
1862
+ const Ji = {
1863
1863
  walk: 1.3,
1864
1864
  bouncy: 1.4,
1865
1865
  doubleBounce: 1.2,
@@ -1868,8 +1868,8 @@ const Vi = {
1868
1868
  tired: 0.8,
1869
1869
  run: 3.6,
1870
1870
  shove: 0.7
1871
- }, Go = Object.keys(Ke), So = Object.keys(_e), Mo = Object.keys(Xs), Ji = 0.25, Zi = 700 / 180, Qi = 200, el = 300;
1872
- function tl(e) {
1871
+ }, Go = Object.keys(Ke), So = Object.keys(_e), Mo = Object.keys(Xs), Zi = 0.25, Qi = 700 / 180, el = 200, tl = 300;
1872
+ function ol(e) {
1873
1873
  if (!Array.isArray(e)) return [{ beat: -1, message: `Beats must be an array of { do: … } objects (got ${typeof e}).` }];
1874
1874
  const t = [...Go, "face", "spin", "dance", "hold", "pose", "gag", "place", "say", "look"], o = [];
1875
1875
  return e.forEach((n, a) => {
@@ -1890,8 +1890,8 @@ function tl(e) {
1890
1890
  s.do === "pose" && !(typeof s.pose == "object" && s.pose !== null) && !So.includes(s.pose) && r(fe("pose", s.pose, So)), s.do === "gag" && !Mo.includes(s.gag) && r(fe("gag", s.gag, Mo));
1891
1891
  }), o;
1892
1892
  }
1893
- function xd(e, t, o) {
1894
- const n = tl(t);
1893
+ function jd(e, t, o) {
1894
+ const n = ol(t);
1895
1895
  if (n.length > 0) throw new Error(`characterScript3D: ${n.length} problem(s) in the beats:
1896
1896
  ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1897
1897
  `)}`);
@@ -1917,7 +1917,7 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1917
1917
  const w = to(c, y);
1918
1918
  if (Math.abs(w) < 1)
1919
1919
  return v !== void 0 && (p("rotateY", k, c), u("rotateY", k + v, c)), k + (v ?? 0);
1920
- const E = v ?? Math.max(Qi, Math.abs(w) * Zi);
1920
+ const E = v ?? Math.max(el, Math.abs(w) * Qi);
1921
1921
  return p("rotateY", k, c), c += w, u("rotateY", k + E, c, "ease-in-out"), k + E;
1922
1922
  }, b = (k, y, v, w = "ease-in-out") => {
1923
1923
  for (const [E, O] of Object.entries(v))
@@ -1925,11 +1925,11 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1925
1925
  }, T = (k, y, v) => {
1926
1926
  const w = wr([[i, h], ...y.through ?? [y.to]]);
1927
1927
  if (w.length < 2) return v;
1928
- const E = g(v, lt(w[0].point, w[1].point)), O = w[w.length - 1].at, j = y.speed ?? Vi[k] * Math.sqrt(a / 1.7), x = y.for ?? O / j * 1e3, W = Us(k, a), G = mt("ease-in-out"), Y = Math.min(el, x / 4);
1928
+ const E = g(v, lt(w[0].point, w[1].point)), O = w[w.length - 1].at, j = y.speed ?? Ji[k] * Math.sqrt(a / 1.7), x = y.for ?? O / j * 1e3, W = Us(k, a), G = mt("ease-in-out"), Y = Math.min(tl, x / 4);
1929
1929
  f.push({ time: E, value: k }), p("walking", E, 0), u("walking", E + Y, 1, "ease-out"), u("walking", E + x - Y, 1), u("walking", E + x, 0, "ease-in");
1930
1930
  const oe = l;
1931
1931
  let q = c;
1932
- for (let I = 0; ; I = Math.min(O, I + Ji)) {
1932
+ for (let I = 0; ; I = Math.min(O, I + Zi)) {
1933
1933
  const C = E + vr(G, I / O) * x, { point: N, direction: S } = kr(w, I);
1934
1934
  q += to(q, lt([0, 0], S));
1935
1935
  const _ = I === 0 ? p : u;
@@ -1970,7 +1970,7 @@ ${n.map((k) => ` beat ${k.beat}: ${k.message}`).join(`
1970
1970
  b(E.time, O.time, Object.fromEntries(Object.entries(O.pose).filter(([j, x]) => r[j] !== x)), O.easing ?? "ease-in-out"), E = O;
1971
1971
  v = E.time;
1972
1972
  } else if (k.do === "say") {
1973
- v = y + (k.for ?? Xi(k.say)), M.push({ text: k.say, start: y, end: v });
1973
+ v = y + (k.for ?? Vi(k.say)), M.push({ text: k.say, start: y, end: v });
1974
1974
  const w = { tilt: r["head.tilt"] ?? 0, left: r["brow.left"] ?? 0, right: r["brow.right"] ?? 0 };
1975
1975
  let E = 0;
1976
1976
  for (let O = y + kt; O < v - kt / 2; O += kt, E++) {
@@ -2000,7 +2000,7 @@ function Un(e, t, o = [0, 0, 0]) {
2000
2000
  return [h("x", o[0]), h("y", o[1]), h("z", o[2])];
2001
2001
  };
2002
2002
  }
2003
- function jd(e, t) {
2003
+ function _d(e, t) {
2004
2004
  const o = `${t.scene}/${t.character}`, n = t.height ?? 1.7, a = Math.max(1, t.every ?? 66), r = t.objects?.[t.character] ?? [0, 0, 0], s = new ve({ id: `${o}-own`, tracks: e.filter((d) => d.target === o) }), i = t.at, h = typeof i == "function" ? i : Array.isArray(i) ? () => i : "camera" in i ? Un(e, `${t.scene}/${i.camera}`, t.objects?.[i.camera] ?? [0, 1.6, 8]) : (() => {
2005
2005
  const d = Un(e, `${t.scene}/${i.object}`, t.objects?.[i.object] ?? [0, 0, 0]), f = i.eyeHeight ?? n * 0.9;
2006
2006
  return (u) => {
@@ -2018,7 +2018,7 @@ function jd(e, t) {
2018
2018
  }
2019
2019
  return c.map((d) => ({ id: `${o}-lookAt-${d}`, target: o, property: d, keyframes: l[d] }));
2020
2020
  }
2021
- function _d(e) {
2021
+ function Kd(e) {
2022
2022
  const t = Math.max(1, Math.round(e.count)), [o, n] = e.centre ?? [0, 0], a = e.spacing ?? 1.2, r = e.shape ?? "line", s = [];
2023
2023
  if (r === "circle") {
2024
2024
  const l = t < 2 ? 0 : Math.max(a, a * t / (Math.PI * 2));
@@ -2053,7 +2053,7 @@ function _d(e) {
2053
2053
  }
2054
2054
  return s;
2055
2055
  }
2056
- function ol(e, t, o = {}, n) {
2056
+ function nl(e, t, o = {}, n) {
2057
2057
  const a = o.length ?? 240, r = 9, s = 28, i = a - 22;
2058
2058
  e.save(), e.translate(t.x, t.y), e.rotate((o.angle ?? -30) * Math.PI / 180), e.fillStyle = o.color ?? "#f4c542", e.fillRect(s, -r, i - s, 2 * r), e.fillStyle = "#e8b4a0", e.fillRect(i, -r, a - i, 2 * r), e.fillStyle = "#f1dcbf", e.beginPath(), e.moveTo(0, 0), e.lineTo(s, -r), e.lineTo(s, r), e.closePath(), e.fill(), e.fillStyle = o.outline ?? "#2f2f33", e.beginPath(), e.moveTo(0, 0), e.lineTo(s * 0.35, -r * 0.35), e.lineTo(s * 0.35, r * 0.35), e.closePath(), e.fill(), e.strokeStyle = o.outline ?? "#2f2f33", e.lineWidth = 3, e.lineJoin = "round", e.lineCap = "round";
2059
2059
  const h = [
@@ -2086,15 +2086,15 @@ function Mr(e, t, o = {}, n) {
2086
2086
  }
2087
2087
  e.restore();
2088
2088
  }
2089
- const $r = 150, nl = { pencil: 44, eraser: 30 };
2089
+ const $r = 150, sl = { pencil: 44, eraser: 30 };
2090
2090
  function Er(e, t, o = {}, n) {
2091
2091
  const a = o.tool ?? "pencil", r = o.skin ?? "#f1c9a5", s = o.outline ?? "#2f2f33", i = o.scale ?? 1, h = Math.min(1, Math.max(0, o.lift ?? 0)), c = (o.angle ?? -30) * Math.PI / 180, l = n ? n.nudge(0.6) : { x: 0, y: 0 }, d = $r * i * (1 + 0.05 * h);
2092
2092
  h > 0 && (e.save(), e.fillStyle = s, e.globalAlpha = 0.15 * h, e.beginPath(), e.ellipse(t.x, t.y, 9 * i, 4 * i, 0, 0, Math.PI * 2), e.fill(), e.restore());
2093
2093
  const f = { x: t.x + l.x + 6 * h * i, y: t.y + l.y - 18 * h * i }, u = we.pencilGrip, p = (k) => {
2094
2094
  const y = k.fingers.thumb, v = k.fingers.index, w = k.fingers.middle, E = Xn([y.points[3], v.points[3], w.points[3]]), O = Xn([y.points[1], v.points[0]]), j = (y.depths[3] + v.depths[3] + w.depths[3]) / 3;
2095
2095
  return { pinch: E, direction: Math.atan2(O.y - E.y, O.x - E.x), depth: j };
2096
- }, g = Pn(u, { size: d }), b = c - p(g).direction, T = Pn(u, { size: d, angle: b * 180 / Math.PI }), H = p(T), M = nl[a] * i, m = { x: H.pinch.x - Math.cos(c) * M, y: H.pinch.y - Math.sin(c) * M }, P = { x: f.x - m.x, y: f.y - m.y }, A = T.axes.up;
2097
- sl(e, P, { x: -A.x, y: -A.y }, d, o.arm ?? 300 * i, r, o.sleeve ?? "#5b7db1", s), ha(e, P, u, {
2096
+ }, g = Pn(u, { size: d }), b = c - p(g).direction, T = Pn(u, { size: d, angle: b * 180 / Math.PI }), H = p(T), M = sl[a] * i, m = { x: H.pinch.x - Math.cos(c) * M, y: H.pinch.y - Math.sin(c) * M }, P = { x: f.x - m.x, y: f.y - m.y }, A = T.axes.up;
2097
+ rl(e, P, { x: -A.x, y: -A.y }, d, o.arm ?? 300 * i, r, o.sleeve ?? "#5b7db1", s), ha(e, P, u, {
2098
2098
  size: d,
2099
2099
  angle: b * 180 / Math.PI,
2100
2100
  skin: r,
@@ -2103,7 +2103,7 @@ function Er(e, t, o = {}, n) {
2103
2103
  prop: {
2104
2104
  depth: H.depth,
2105
2105
  draw: () => {
2106
- e.save(), e.translate(f.x, f.y), e.scale(i, i), a === "eraser" ? Mr(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: s }, n) : ol(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: s }, n), e.restore();
2106
+ e.save(), e.translate(f.x, f.y), e.scale(i, i), a === "eraser" ? Mr(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, outline: s }, n) : nl(e, { x: 0, y: 0 }, { angle: c * 180 / Math.PI, length: 190, outline: s }, n), e.restore();
2107
2107
  }
2108
2108
  }
2109
2109
  });
@@ -2112,19 +2112,19 @@ const Xn = (e) => ({
2112
2112
  x: e.reduce((t, o) => t + o.x, 0) / e.length,
2113
2113
  y: e.reduce((t, o) => t + o.y, 0) / e.length
2114
2114
  });
2115
- function sl(e, t, o, n, a, r, s, i) {
2115
+ function rl(e, t, o, n, a, r, s, i) {
2116
2116
  const h = { x: -o.y, y: o.x }, c = n * 0.15, l = (g, b, T) => ({
2117
2117
  x: t.x + o.x * g + h.x * b * T,
2118
2118
  y: t.y + o.y * g + h.y * b * T
2119
2119
  }), d = l(a, 0, 0), f = (g) => {
2120
2120
  const b = e.createLinearGradient(t.x, t.y, d.x, d.y);
2121
- return b.addColorStop(0, g), b.addColorStop(0.6, g), b.addColorStop(1, rl(g)), b;
2121
+ return b.addColorStop(0, g), b.addColorStop(0.6, g), b.addColorStop(1, al(g)), b;
2122
2122
  }, u = Math.min(n * 0.55, a * 0.35);
2123
2123
  e.save(), e.lineJoin = "round", e.lineCap = "round", e.lineWidth = 3 * (n / $r), e.beginPath(), e.moveTo(l(-n * 0.1, -1, c).x, l(-n * 0.1, -1, c).y), e.lineTo(l(u + 4, -1, c * 1.1).x, l(u + 4, -1, c * 1.1).y), e.lineTo(l(u + 4, 1, c * 1.1).x, l(u + 4, 1, c * 1.1).y), e.lineTo(l(-n * 0.1, 1, c).x, l(-n * 0.1, 1, c).y), e.closePath(), e.fillStyle = r, e.fill(), e.strokeStyle = i, e.beginPath(), e.moveTo(l(0, -1, c).x, l(0, -1, c).y), e.lineTo(l(u, -1, c * 1.1).x, l(u, -1, c * 1.1).y), e.moveTo(l(0, 1, c).x, l(0, 1, c).y), e.lineTo(l(u, 1, c * 1.1).x, l(u, 1, c * 1.1).y), e.stroke();
2124
2124
  const p = [l(u, -1, c * 1.3), l(a, -1, c * 1.5), l(a, 1, c * 1.5), l(u, 1, c * 1.3)];
2125
2125
  e.beginPath(), p.forEach((g, b) => b ? e.lineTo(g.x, g.y) : e.moveTo(g.x, g.y)), e.closePath(), e.fillStyle = f(s), e.fill(), e.strokeStyle = f(i), e.beginPath(), e.moveTo(p[1].x, p[1].y), e.lineTo(p[0].x, p[0].y), e.lineTo(p[3].x, p[3].y), e.lineTo(p[2].x, p[2].y), e.stroke(), e.restore();
2126
2126
  }
2127
- function Kd(e, t, o = {}) {
2127
+ function Cd(e, t, o = {}) {
2128
2128
  const n = o.offstage ?? { x: 2e3, y: 1400 }, a = o.enter ?? 450, r = o.exit ?? 450, s = o.linger ?? 1500, i = [...e].filter((g) => g.path.length > 0).sort((g, b) => g.start - b.start), h = (g) => g.tool ?? "pencil", c = (g) => {
2129
2129
  const b = Math.min(1, Math.max(0, g));
2130
2130
  return b * b * (3 - 2 * b);
@@ -2148,7 +2148,7 @@ function Kd(e, t, o = {}) {
2148
2148
  }
2149
2149
  return null;
2150
2150
  }
2151
- function Cd(e, t, o, n = 0.08, a = 32) {
2151
+ function Nd(e, t, o, n = 0.08, a = 32) {
2152
2152
  const r = Math.PI * 2 * (1 + n), s = [];
2153
2153
  for (let i = 0; i <= a; i++) {
2154
2154
  const h = -Math.PI / 2 + r * i / a;
@@ -2156,7 +2156,7 @@ function Cd(e, t, o, n = 0.08, a = 32) {
2156
2156
  }
2157
2157
  return s;
2158
2158
  }
2159
- function Nd(e) {
2159
+ function Rd(e) {
2160
2160
  const { path: t } = e, o = t.map((i) => i.x), n = t.map((i) => i.y), a = Math.min(...o), r = Math.min(...n), s = e.hand === !1 ? void 0 : e.hand === !0 || e.hand === void 0 ? {} : e.hand;
2161
2161
  return {
2162
2162
  type: "custom",
@@ -2168,12 +2168,12 @@ function Nd(e) {
2168
2168
  draw(i, h, c) {
2169
2169
  const l = Math.min(1, Math.max(0, Number(h.props?.draw ?? 0)));
2170
2170
  i.translate(-a, -r), i.strokeStyle = e.color ?? "#2f2f33", i.lineWidth = e.lineWidth ?? 5, i.lineCap = "round", i.lineJoin = "round";
2171
- const d = e.sketch ? Ra(i, e.sketch, c) : void 0;
2171
+ const d = e.sketch ? Wa(i, e.sketch, c) : void 0;
2172
2172
  l > 0 && (d ? e.smooth ? d.curve(t, l) : d.line(t, l) : Ar(i, nr(t, l))), s && l > 0 && l < 1 && Er(i, an(t, l), s, d);
2173
2173
  }
2174
2174
  };
2175
2175
  }
2176
- function rl(e) {
2176
+ function al(e) {
2177
2177
  const t = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
2178
2178
  if (!t) return "rgba(0, 0, 0, 0)";
2179
2179
  const o = t[1].length === 3 ? [...t[1]].map((s) => s + s).join("") : t[1], [n, a, r] = [0, 2, 4].map((s) => parseInt(o.slice(s, s + 2), 16));
@@ -2188,7 +2188,7 @@ function Ar(e, t, o) {
2188
2188
  }
2189
2189
  }
2190
2190
  const Nt = 1e5;
2191
- function Rd(e, t, o, n, a = 6) {
2191
+ function Wd(e, t, o, n, a = 6) {
2192
2192
  const r = [], s = Math.max(1, Math.round(a));
2193
2193
  for (let i = 0; i <= s; i++)
2194
2194
  r.push({ x: i % 2 === 0 ? e : e + o, y: t + n * i / s });
@@ -2212,10 +2212,10 @@ function Tr(e, t, o, n) {
2212
2212
  });
2213
2213
  }
2214
2214
  }
2215
- function Wd(e, t, o, n, a) {
2215
+ function zd(e, t, o, n, a) {
2216
2216
  e.save(), Tr(e, t, o, n), a(), e.restore();
2217
2217
  }
2218
- function zd(e, t) {
2218
+ function Ld(e, t) {
2219
2219
  const o = t.width ?? 40, n = t.hand === !0 ? {} : t.hand || void 0, a = t.eraser === !1 ? void 0 : t.eraser === !0 || t.eraser === void 0 ? {} : t.eraser;
2220
2220
  return {
2221
2221
  ...e,
@@ -2249,7 +2249,7 @@ function It() {
2249
2249
  id: `${o}-${n}`,
2250
2250
  target: o,
2251
2251
  property: n,
2252
- keyframes: al(a)
2252
+ keyframes: il(a)
2253
2253
  }));
2254
2254
  }
2255
2255
  };
@@ -2269,10 +2269,10 @@ function Pt(e) {
2269
2269
  const t = [...e ?? []].sort((o, n) => o.time - n.time);
2270
2270
  return t.slice(1).flatMap((o, n) => o.value !== t[n].value ? [{ start: t[n].time, end: o.time }] : []);
2271
2271
  }
2272
- function al(e) {
2272
+ function il(e) {
2273
2273
  return [...e].sort((o, n) => o.time - n.time).map((o) => ({ time: o.time, value: o.value, ...o.easing ? { easing: o.easing } : {} }));
2274
2274
  }
2275
- const il = 16e-4, ll = 0.6, Ye = 33;
2275
+ const ll = 16e-4, hl = 0.6, Ye = 33;
2276
2276
  function fo(e) {
2277
2277
  const t = (r, s) => `piece.${r.id}.${s}`, o = (r, s) => ({
2278
2278
  x: r.home.x + e.valueAt(t(r, "x"), s),
@@ -2291,7 +2291,7 @@ function fo(e) {
2291
2291
  e.push(t(r, "x"), { time: i.time, value: i.x - r.home.x }), e.push(t(r, "y"), { time: i.time, value: i.y - r.home.y });
2292
2292
  },
2293
2293
  fling(r, s) {
2294
- const i = o(r, s.at), h = s.velocity ?? n(r, s.at) ?? { x: 0.5, y: -0.6 }, c = s.gravity ?? il, l = s.duration ?? 900, d = (s.spin ?? ll) * (h.x < 0 ? -1 : 1), f = e.valueAt(t(r, "rotate"), s.at);
2294
+ const i = o(r, s.at), h = s.velocity ?? n(r, s.at) ?? { x: 0.5, y: -0.6 }, c = s.gravity ?? ll, l = s.duration ?? 900, d = (s.spin ?? hl) * (h.x < 0 ? -1 : 1), f = e.valueAt(t(r, "rotate"), s.at);
2295
2295
  a(r, s.at);
2296
2296
  for (let u = 0; u <= l; u += Ye) {
2297
2297
  const p = i.x + h.x * u, g = i.y + h.y * u + 0.5 * c * u * u;
@@ -2354,7 +2354,7 @@ function me(e, t, o, n) {
2354
2354
  height: n
2355
2355
  };
2356
2356
  }
2357
- const hl = {
2357
+ const cl = {
2358
2358
  background: "#1e1e2e",
2359
2359
  gutter: "#6c7086",
2360
2360
  text: "#cdd6f4",
@@ -2385,12 +2385,12 @@ const hl = {
2385
2385
  move: "a token; { at, to: an anchor name or { x, y }, duration? }: move the word there",
2386
2386
  fling: "a token; { at, velocity?, spin?, gravity?, duration? }: throw or kick the word away on a spinning arc"
2387
2387
  }
2388
- }, cl = 0.9, dl = 8;
2389
- function Ld(e) {
2390
- const t = { ...hl, ...e.theme }, o = e.code.replace(/\t/g, " ").replace(/\n$/, "").split(`
2388
+ }, dl = 0.9, fl = 8;
2389
+ function Fd(e) {
2390
+ const t = { ...cl, ...e.theme }, o = e.code.replace(/\t/g, " ").replace(/\n$/, "").split(`
2391
2391
  `), n = e.fontSize ?? 16, a = (e.lineHeight ?? 1.6) * n, r = (e.charWidth ?? 0.6) * n, s = e.padding ?? 12, i = e.lineNumbers === !1 ? 0 : (String(o.length).length + 2) * r, h = Math.max(1, ...o.map((I) => I.length)), c = e.width ?? s * 2 + i + h * r, l = s * 2 + o.length * a, d = e.x + s + i, f = new Set(e.hidden ?? []), u = e.language ?? "plain";
2392
2392
  if (!Uo.includes(u)) throw new Error(`codePanel: ${fe("language", u, Uo)}`);
2393
- const p = o.map((I) => pl(I, u).flatMap((C) => Array.from(C.text, () => t[C.kind]))), g = It(), b = fo(g), T = [], H = /* @__PURE__ */ new Map(), M = [], m = [], P = (I) => {
2393
+ const p = o.map((I) => ml(I, u).flatMap((C) => Array.from(C.text, () => t[C.kind]))), g = It(), b = fo(g), T = [], H = /* @__PURE__ */ new Map(), M = [], m = [], P = (I) => {
2394
2394
  if (!Number.isInteger(I) || I < 1 || I > o.length) throw new Error(`codePanel: no line ${I} (it has ${o.length})`);
2395
2395
  }, A = g.tween, k = g.last, y = (I, C, N, S, _, V = 300) => {
2396
2396
  P(I), A(`line.${I}.${C}`, N, S, _, V);
@@ -2416,7 +2416,7 @@ function Ld(e) {
2416
2416
  summary: `${o.length} lines of ${u} code. Its lines and words are places in the scene (line(), token(), spot()); its edits are methods that record tracks (tracks()).`,
2417
2417
  // Pieces and inserts add props as they are made; these describe them by pattern.
2418
2418
  get props() {
2419
- return ul(Object.keys(x));
2419
+ return gl(Object.keys(x));
2420
2420
  },
2421
2421
  actions: Pr
2422
2422
  },
@@ -2424,36 +2424,36 @@ function Ld(e) {
2424
2424
  const N = C.props ?? {}, S = (L) => Number(N[L] ?? x[L]), _ = s + i, V = (L) => s + (L - 1) * a - S(`line.${L}.shift`) * a;
2425
2425
  I.fillStyle = t.background, Vn(I, 0, 0, c, l, 8), I.fill(), I.font = `${n}px ${t.font}`, I.textBaseline = "middle", I.textAlign = "left";
2426
2426
  const ee = (L, Q, re, K, X) => {
2427
- const D = o[L - 1];
2427
+ const F = o[L - 1];
2428
2428
  for (let Z = Q; Z < re; Z++)
2429
- D[Z] !== " " && (I.fillStyle = p[L - 1][Z], I.fillText(D[Z], K + (Z - Q) * r, X));
2429
+ F[Z] !== " " && (I.fillStyle = p[L - 1][Z], I.fillText(F[Z], K + (Z - Q) * r, X));
2430
2430
  };
2431
2431
  I.save(), Vn(I, 0, 0, c, l, 8), I.clip(), o.forEach((L, Q) => {
2432
2432
  const re = Q + 1, K = S(`line.${re}.wipe`);
2433
2433
  if (K >= 1) return;
2434
- const X = V(re), D = X + a / 2, Z = Math.max(1, L.length) * r, se = Math.round(S(`line.${re}.reveal`) * L.length), ae = H.get(re) ?? { style: "wipe", from: "left" };
2435
- I.save(), K > 0 && fl(I, ae, K, { left: _ - i, top: X, width: i + Z + r, height: a }, c);
2434
+ const X = V(re), F = X + a / 2, Z = Math.max(1, L.length) * r, se = Math.round(S(`line.${re}.reveal`) * L.length), ae = H.get(re) ?? { style: "wipe", from: "left" };
2435
+ I.save(), K > 0 && ul(I, ae, K, { left: _ - i, top: X, width: i + Z + r, height: a }, c);
2436
2436
  const ie = S(`line.${re}.highlight`);
2437
- ie > 0 && (I.globalAlpha *= Math.min(1, ie), I.fillStyle = t.highlight, I.fillRect(_ - r / 2, X, Z + r, a), I.globalAlpha /= Math.min(1, ie)), i > 0 && se > 0 && (I.fillStyle = t.gutter, I.textAlign = "right", I.fillText(String(re), _ - r, D), I.textAlign = "left");
2437
+ ie > 0 && (I.globalAlpha *= Math.min(1, ie), I.fillStyle = t.highlight, I.fillRect(_ - r / 2, X, Z + r, a), I.globalAlpha /= Math.min(1, ie)), i > 0 && se > 0 && (I.fillStyle = t.gutter, I.textAlign = "right", I.fillText(String(re), _ - r, F), I.textAlign = "left");
2438
2438
  const $ = [
2439
2439
  ...M.filter((B) => B.line === re).map((B) => ({ column: B.column, length: B.text.length, piece: B, insert: void 0 })),
2440
2440
  ...m.filter((B) => B.line === re).map((B) => ({ column: B.column, length: 0, piece: void 0, insert: B }))
2441
2441
  ].sort((B, le) => B.column - le.column || B.length - le.length);
2442
2442
  let z = 0, U = _;
2443
2443
  for (const B of $) {
2444
- ee(re, z, Math.min(B.column, se), U, D), U += (B.column - z) * r;
2445
- let le = B.length, F = "";
2444
+ ee(re, z, Math.min(B.column, se), U, F), U += (B.column - z) * r;
2445
+ let le = B.length, D = "";
2446
2446
  if (B.piece) {
2447
2447
  const R = B.piece.written ?? "", J = S(`piece.${B.piece.id}.write`);
2448
- R && J > 0 ? (F = R.slice(0, Math.round(J * R.length)), le = B.length + (R.length - B.length) * Math.min(1, J * 2)) : le = B.length * (1 - S(`piece.${B.piece.id}.away`));
2449
- } else B.insert && (le = B.insert.chars * S(`insert.${B.insert.id}.open`), B.insert.text && (F = B.insert.text.slice(0, Math.round(S(`insert.${B.insert.id}.type`) * B.insert.text.length))));
2448
+ R && J > 0 ? (D = R.slice(0, Math.round(J * R.length)), le = B.length + (R.length - B.length) * Math.min(1, J * 2)) : le = B.length * (1 - S(`piece.${B.piece.id}.away`));
2449
+ } else B.insert && (le = B.insert.chars * S(`insert.${B.insert.id}.open`), B.insert.text && (D = B.insert.text.slice(0, Math.round(S(`insert.${B.insert.id}.type`) * B.insert.text.length))));
2450
2450
  I.fillStyle = t.text;
2451
- for (let R = 0; R < F.length; R++) F[R] !== " " && I.fillText(F[R], U + R * r, D);
2451
+ for (let R = 0; R < D.length; R++) D[R] !== " " && I.fillText(D[R], U + R * r, F);
2452
2452
  U += le * r, z = B.column + B.length;
2453
2453
  }
2454
- ee(re, z, Math.max(z, se), U, D);
2454
+ ee(re, z, Math.max(z, se), U, F);
2455
2455
  const te = S(`line.${re}.strike`);
2456
- te > 0 && (I.strokeStyle = t.strike, I.lineWidth = Math.max(1.5, n / 10), I.beginPath(), I.moveTo(_, D), I.lineTo(_ + Z * Math.min(1, te), D), I.stroke()), I.restore();
2456
+ te > 0 && (I.strokeStyle = t.strike, I.lineWidth = Math.max(1.5, n / 10), I.beginPath(), I.moveTo(_, F), I.lineTo(_ + Z * Math.min(1, te), F), I.stroke()), I.restore();
2457
2457
  });
2458
2458
  for (const L of M) {
2459
2459
  const Q = S(`piece.${L.id}.opacity`);
@@ -2632,15 +2632,15 @@ function Ld(e) {
2632
2632
  };
2633
2633
  return q;
2634
2634
  }
2635
- function fl(e, t, o, n, a) {
2635
+ function ul(e, t, o, n, a) {
2636
2636
  if (t.style === "wipe") {
2637
2637
  e.beginPath(), t.from === "right" ? e.rect(n.left, n.top, n.width * (1 - o), n.height) : e.rect(n.left + o * n.width, n.top, n.width * (1 - o), n.height), e.clip();
2638
2638
  return;
2639
2639
  }
2640
- const r = dl * o;
2640
+ const r = fl * o;
2641
2641
  if (r > 0.2 && "filter" in e && (e.filter = `blur(${r.toFixed(1)}px)`), e.globalAlpha *= 1 - o, t.style === "fly") {
2642
2642
  const s = t.from === "right" ? -1 : 1;
2643
- e.translate(s * o * cl * a, 0), e.rotate(s * o * 0.08);
2643
+ e.translate(s * o * dl * a, 0), e.rotate(s * o * 0.08);
2644
2644
  } else {
2645
2645
  const s = 1 + 0.08 * o, i = n.left + n.width / 2, h = n.top + n.height / 2;
2646
2646
  e.translate(i, h), e.scale(s, s), e.translate(-i, -h);
@@ -2660,7 +2660,7 @@ const Pr = {
2660
2660
  drop: "drop(piece, n, column, { at, duration? }): put a piece into a line (into its own line it slides, the text closing behind it)",
2661
2661
  ride: "ride(tracks, figureId, { ground }): a figure’s tracks with it carried by the line it stands on"
2662
2662
  };
2663
- function ul(e) {
2663
+ function gl(e) {
2664
2664
  const t = [
2665
2665
  [/^line\.\d+\.highlight$/, { description: "How much the line is tinted", unit: "0..1", min: 0, max: 1 }],
2666
2666
  [/^line\.\d+\.strike$/, { description: "How far the strike-through has drawn", unit: "0..1", min: 0, max: 1 }],
@@ -2694,7 +2694,7 @@ const oo = {
2694
2694
  plain: []
2695
2695
  };
2696
2696
  oo.typescript = [...oo.javascript, "enum", "interface", "type", "implements", "private", "public", "readonly", "keyof", "as", "declare", "namespace"];
2697
- const Uo = Object.keys(oo), gl = {
2697
+ const Uo = Object.keys(oo), pl = {
2698
2698
  go: "//",
2699
2699
  rust: "//",
2700
2700
  csharp: "//",
@@ -2703,8 +2703,8 @@ const Uo = Object.keys(oo), gl = {
2703
2703
  python: "#",
2704
2704
  plain: null
2705
2705
  };
2706
- function pl(e, t) {
2707
- const o = new Set(oo[t]), n = gl[t], a = [], r = (i, h) => {
2706
+ function ml(e, t) {
2707
+ const o = new Set(oo[t]), n = pl[t], a = [], r = (i, h) => {
2708
2708
  const c = a[a.length - 1];
2709
2709
  c && c.kind === h ? c.text += i : a.push({ text: i, kind: h });
2710
2710
  };
@@ -2781,7 +2781,7 @@ const $o = '"Patrick Hand", "Segoe Print", "Bradley Hand", "Comic Sans MS", "Cha
2781
2781
  move: "a term; { at, to: an anchor name or { x, y }, duration? }: move the term there",
2782
2782
  fling: "a term; { at, velocity?, spin?, gravity?, duration? }: throw or knock the term off on a spinning arc"
2783
2783
  }
2784
- }, Zn = 90, Qn = 300, ml = 0.3;
2784
+ }, Zn = 90, Qn = 300, yl = 0.3;
2785
2785
  function Dd(e) {
2786
2786
  const t = typeof e.theme == "string" ? e.theme : "whiteboard";
2787
2787
  if (!(t in Rt)) throw new Error(`whiteboard: ${fe("theme", t, Object.keys(Rt))}`);
@@ -2832,8 +2832,8 @@ function Dd(e) {
2832
2832
  if (!Jn.includes(m.mark)) throw new Error(`whiteboard: mark "${m.id}": ${fe("mark", m.mark, Jn)}`);
2833
2833
  const P = m.mark === "arrow" ? ["from", "to"] : ["around"];
2834
2834
  for (const v of P) if (typeof m[v] != "string") throw new Error(`whiteboard: ${m.mark} "${m.id}" needs \`${v}\`, a place on the board (an item before it)`);
2835
- const A = new Set([m.from, m.to].filter((v) => typeof v == "string").map((v) => v.split(":")[1])), k = m.mark === "arrow" ? [...l.values()].filter((v) => v.kind === "text" && !A.has(v.item.id)).map((v) => v.box) : [], y = yl(m, b, n, k);
2836
- l.set(m.id, { kind: "mark", item: m, color: r(m.color), points: y, box: kl(y) }), c[`mark.${m.id}.draw`] = m.hidden ? 0 : 1, c[`mark.${m.id}.erase`] = 0;
2835
+ const A = new Set([m.from, m.to].filter((v) => typeof v == "string").map((v) => v.split(":")[1])), k = m.mark === "arrow" ? [...l.values()].filter((v) => v.kind === "text" && !A.has(v.item.id)).map((v) => v.box) : [], y = bl(m, b, n, k);
2836
+ l.set(m.id, { kind: "mark", item: m, color: r(m.color), points: y, box: vl(y) }), c[`mark.${m.id}.draw`] = m.hidden ? 0 : 1, c[`mark.${m.id}.erase`] = 0;
2837
2837
  }
2838
2838
  const T = (m) => d.filter((P) => P.item === m), H = {
2839
2839
  type: "custom",
@@ -2846,7 +2846,7 @@ function Dd(e) {
2846
2846
  kind: "whiteboard",
2847
2847
  summary: `A board with ${l.size} items. Its texts, terms and marks are places in the scene (anchor()); its edits record tracks (edit(), tracks()).`,
2848
2848
  get props() {
2849
- return vl(Object.keys(c));
2849
+ return Sl(Object.keys(c));
2850
2850
  },
2851
2851
  actions: Ne.edits
2852
2852
  },
@@ -2985,14 +2985,14 @@ function Dd(e) {
2985
2985
  };
2986
2986
  return M;
2987
2987
  }
2988
- function yl(e, t, o, n = []) {
2989
- const a = rn(De(e.id)), r = (g) => (a.next() * 2 - 1) * g, s = o * ml;
2988
+ function bl(e, t, o, n = []) {
2989
+ const a = rn(Fe(e.id)), r = (g) => (a.next() * 2 - 1) * g, s = o * yl;
2990
2990
  if (e.mark === "arrow") {
2991
- const g = t(e.from), b = t(e.to), T = es(g, b, s * 0.6), H = es(b, g, s * 0.6), M = Math.hypot(H.x - T.x, H.y - T.y), m = wl(T, H);
2991
+ const g = t(e.from), b = t(e.to), T = es(g, b, s * 0.6), H = es(b, g, s * 0.6), M = Math.hypot(H.x - T.x, H.y - T.y), m = kl(T, H);
2992
2992
  let P = M * (0.06 + r(0.04));
2993
2993
  if (e.bend !== void 0) P = M * e.bend;
2994
2994
  else {
2995
- const y = bl(T, H, m, n, s);
2995
+ const y = wl(T, H, m, n, s);
2996
2996
  y !== 0 && (P = y);
2997
2997
  }
2998
2998
  const A = { x: (T.x + H.x) / 2 + m.x * P, y: (T.y + H.y) / 2 + m.y * P }, k = [];
@@ -3022,7 +3022,7 @@ function yl(e, t, o, n = []) {
3022
3022
  }
3023
3023
  return p;
3024
3024
  }
3025
- function bl(e, t, o, n, a) {
3025
+ function wl(e, t, o, n, a) {
3026
3026
  const r = Math.hypot(t.x - e.x, t.y - e.y);
3027
3027
  if (r < 1e-6) return 0;
3028
3028
  const s = { x: (t.x - e.x) / r, y: (t.y - e.y) / r };
@@ -3044,11 +3044,11 @@ function es(e, t, o) {
3044
3044
  const r = Math.min(n === 0 ? 1 / 0 : (e.width / 2 + o) / Math.abs(n), a === 0 ? 1 / 0 : (e.height / 2 + o) / Math.abs(a));
3045
3045
  return { x: e.x + n * r, y: e.y + a * r };
3046
3046
  }
3047
- function wl(e, t) {
3047
+ function kl(e, t) {
3048
3048
  const o = Math.hypot(t.x - e.x, t.y - e.y) || 1;
3049
3049
  return { x: -(t.y - e.y) / o, y: (t.x - e.x) / o };
3050
3050
  }
3051
- function kl(e) {
3051
+ function vl(e) {
3052
3052
  const t = e.map((r) => r.x), o = e.map((r) => r.y), n = Math.min(...t), a = Math.min(...o);
3053
3053
  return me(n, a, Math.max(...t) - n, Math.max(...o) - a);
3054
3054
  }
@@ -3082,7 +3082,7 @@ function Eo(e, t, o) {
3082
3082
  function os(e, t, o, n, a, r) {
3083
3083
  e.beginPath(), e.moveTo(t + r, o), e.arcTo(t + n, o, t + n, o + a, r), e.arcTo(t + n, o + a, t, o + a, r), e.arcTo(t, o + a, t, o, r), e.arcTo(t, o, t + n, o, r), e.closePath();
3084
3084
  }
3085
- function vl(e) {
3085
+ function Sl(e) {
3086
3086
  const t = [
3087
3087
  [/^text\..+\.write$/, { description: "How much of the text is written", unit: "0..1", min: 0, max: 1 }],
3088
3088
  [/^(text|mark)\..+\.erase$/, { description: "How far it has been wiped off, left to right", unit: "0..1", min: 0, max: 1 }],
@@ -3137,8 +3137,8 @@ const ns = ["bar", "line", "pie", "donut"], ss = 'system-ui, -apple-system, "Seg
3137
3137
  highlight: "bar, point or slice anchors; { at, duration?, on? }: colour it out (on: false clears)",
3138
3138
  pull: "slice anchors; { at, duration?, on? }: pull the slice out from the centre (on: false puts it back)"
3139
3139
  }
3140
- }, Sl = 600, Ml = 500, $l = 200, El = 400, Al = 0.14, Tl = Math.PI * 2;
3141
- function Fd(e) {
3140
+ }, Ml = 600, $l = 500, El = 200, Al = 400, Tl = 0.14, Pl = Math.PI * 2;
3141
+ function qd(e) {
3142
3142
  if (!ns.includes(e.kind)) throw new Error(`chart: ${fe("kind", e.kind, ns)}`);
3143
3143
  const t = typeof e.theme == "string" ? e.theme : "light";
3144
3144
  if (!(t in Wt)) throw new Error(`chart: ${fe("theme", t, Object.keys(Wt))}`);
@@ -3164,7 +3164,7 @@ function Fd(e) {
3164
3164
  for (const z of s) d($, z);
3165
3165
  l.add($.id);
3166
3166
  }
3167
- const f = n === "bar" ? "bar" : n === "line" ? "point" : "slice", u = Math.max(...e.data.flatMap(($) => s.map((z) => d($, z)))), p = a ? e.data.reduce(($, z) => $ + d(z, s[0]), 0) : e.max ?? Pl(u * 1.1);
3167
+ const f = n === "bar" ? "bar" : n === "line" ? "point" : "slice", u = Math.max(...e.data.flatMap(($) => s.map((z) => d($, z)))), p = a ? e.data.reduce(($, z) => $ + d(z, s[0]), 0) : e.max ?? Ol(u * 1.1);
3168
3168
  if (!a && !(p > 0)) throw new Error(`chart: \`max\` must be above 0 (got ${p})`);
3169
3169
  const g = Math.max(10, Math.min(16, e.height / 20)), b = r && e.legend !== !1, T = a ? void 0 : e.axis?.x, H = a ? void 0 : e.axis?.y, M = e.title ? g * 2.3 : g * 0.5, m = {
3170
3170
  left: g * 3.6 + (H ? g * 1.5 : 0),
@@ -3188,11 +3188,11 @@ function Fd(e) {
3188
3188
  for (const z of s)
3189
3189
  N[S($.id, z.id, "value")] = d($, z), N[S($.id, z.id, "show")] = $.hidden ? 0 : 1, N[S($.id, z.id, "highlight")] = 0, a && (N[S($.id, z.id, "pull")] = 0);
3190
3190
  const _ = ($, z) => I.keys($)?.length ? bn(I.keys($), z) : N[$], V = ($, z, U) => _(S($, z, "value"), U) * (n === "bar" ? _(S($, z, "show"), U) : 1) * w, ee = ($) => {
3191
- const z = s[0].id, U = e.data.map((F) => Math.max(0, $(S(F.id, z, "value"))) * Math.max(0, Math.min(1, $(S(F.id, z, "show"))))), te = U.reduce((F, R) => F + R, 0), B = /* @__PURE__ */ new Map();
3191
+ const z = s[0].id, U = e.data.map((D) => Math.max(0, $(S(D.id, z, "value"))) * Math.max(0, Math.min(1, $(S(D.id, z, "show"))))), te = U.reduce((D, R) => D + R, 0), B = /* @__PURE__ */ new Map();
3192
3192
  let le = -Math.PI / 2;
3193
- return e.data.forEach((F, R) => {
3194
- const J = te > 0 ? Tl * U[R] / te : 0, he = le + J / 2, de = Math.max(0, Math.min(1, $(S(F.id, z, "pull")))) * G.r * Al;
3195
- B.set(F.id, {
3193
+ return e.data.forEach((D, R) => {
3194
+ const J = te > 0 ? Pl * U[R] / te : 0, he = le + J / 2, de = Math.max(0, Math.min(1, $(S(D.id, z, "pull")))) * G.r * Tl;
3195
+ B.set(D.id, {
3196
3196
  start: le,
3197
3197
  sweep: J,
3198
3198
  mid: he,
@@ -3212,22 +3212,22 @@ function Fd(e) {
3212
3212
  }
3213
3213
  if (z === "bar" || z === "point" || z === "slice" || z === "label" || z === "value") {
3214
3214
  if (!U) throw te(`write it ${z}:ID`);
3215
- const B = U.indexOf(":"), le = B < 0 ? U : U.slice(0, B), F = B < 0 ? s[0].id : U.slice(B + 1);
3215
+ const B = U.indexOf(":"), le = B < 0 ? U : U.slice(0, B), D = B < 0 ? s[0].id : U.slice(B + 1);
3216
3216
  if (!E.has(le)) throw te(`there is no "${le}" (data: ${[...E.keys()].join(", ")})`);
3217
- if (!i.has(F)) throw te(`there is no series "${F}" (series: ${s.map((R) => R.id).join(", ")})`);
3217
+ if (!i.has(D)) throw te(`there is no series "${D}" (series: ${s.map((R) => R.id).join(", ")})`);
3218
3218
  if (z === "label" && B >= 0) throw te("a label is one per datum: label:ID");
3219
3219
  if ((z === "bar" || z === "point" || z === "slice") && z !== f) throw te(`a ${n} chart has ${f}s, not ${z}s: ${f}:${le}`);
3220
- return { kind: z, id: le, series: F };
3220
+ return { kind: z, id: le, series: D };
3221
3221
  }
3222
3222
  throw te();
3223
3223
  }, re = ($, z) => {
3224
3224
  if ($.kind === "box") return me(0, 0, e.width, e.height);
3225
3225
  if ($.kind === "legend") return q.get($.series);
3226
3226
  if (a) {
3227
- const F = L(z).get($.id), R = Math.max(g * 1.5, G.r * 0.42);
3228
- if ($.kind === "slice") return me(F.centre.x - R / 2, F.centre.y - R / 2, R, R);
3229
- const J = K(F);
3230
- return $.kind === "label" ? J : F.sweep >= 0.3 ? me(F.centre.x - g * 1.6, F.centre.y - g * 0.65, g * 3.2, g * 1.3) : me(J.left, J.bottom, J.width, g * 1.3);
3227
+ const D = L(z).get($.id), R = Math.max(g * 1.5, G.r * 0.42);
3228
+ if ($.kind === "slice") return me(D.centre.x - R / 2, D.centre.y - R / 2, R, R);
3229
+ const J = K(D);
3230
+ return $.kind === "label" ? J : D.sweep >= 0.3 ? me(D.centre.x - g * 1.6, D.centre.y - g * 0.65, g * 3.2, g * 1.3) : me(J.left, J.bottom, J.width, g * 1.3);
3231
3231
  }
3232
3232
  const U = $.kind === "label" ? O($.id) : x($.id, $.series), te = m.bottom - V($.id, $.series, z);
3233
3233
  if ($.kind === "bar") return me(U - y / 2, te, y, m.bottom - te);
@@ -3238,7 +3238,7 @@ function Fd(e) {
3238
3238
  }, K = ($) => {
3239
3239
  const z = G.r + $.out + g * 0.9, U = { x: G.cx + Math.cos($.mid) * z, y: G.cy + Math.sin($.mid) * z }, te = g * 4.2, B = Math.cos($.mid), le = B > 0.2 ? U.x : B < -0.2 ? U.x - te : U.x - te / 2;
3240
3240
  return me(le, U.y - g * 0.7, te, g * 1.4);
3241
- }, X = ($) => me(e.x + $.left, e.y + $.top, $.width, $.height), D = ($) => `${e.prefix ?? ""}${$.toFixed(e.decimals ?? 0)}${e.suffix ?? ""}`, Z = /* @__PURE__ */ new Map(), se = {
3241
+ }, X = ($) => me(e.x + $.left, e.y + $.top, $.width, $.height), F = ($) => `${e.prefix ?? ""}${$.toFixed(e.decimals ?? 0)}${e.suffix ?? ""}`, Z = /* @__PURE__ */ new Map(), se = {
3242
3242
  type: "custom",
3243
3243
  x: e.x,
3244
3244
  y: e.y,
@@ -3248,16 +3248,16 @@ function Fd(e) {
3248
3248
  about: {
3249
3249
  kind: `${n} chart`,
3250
3250
  summary: `A ${n} chart of ${e.data.length} values (${e.data.map(($) => $.id).join(", ")})${r ? ` in ${s.length} series (${s.map(($) => $.id).join(", ")})` : ""}${a ? "" : `, scaled to ${p}`}. Its ${f}s and labels are places in the scene (anchor()); its edits record tracks (edit(), tracks()).`,
3251
- props: Object.fromEntries(Object.keys(N).map(($) => [$, Il($)])),
3251
+ props: Object.fromEntries(Object.keys(N).map(($) => [$, xl($)])),
3252
3252
  actions: st.edits
3253
3253
  },
3254
3254
  draw($, z) {
3255
- const U = z.props ?? {}, te = (F) => Number(U[F] ?? N[F] ?? 0);
3255
+ const U = z.props ?? {}, te = (D) => Number(U[D] ?? N[D] ?? 0);
3256
3256
  if ($.save(), $.fillStyle = o.background, rs($, 0, 0, e.width, e.height, 8), $.fill(), $.font = `${g}px ${o.font}`, $.textBaseline = "middle", e.title && ($.fillStyle = o.text, $.textAlign = "left", $.font = `600 ${g * 1.2}px ${o.font}`, $.fillText(e.title, a ? g : m.left, g * 1.5), $.font = `${g}px ${o.font}`), b) {
3257
3257
  $.textAlign = "left";
3258
- for (const F of s) {
3259
- const R = q.get(F.id);
3260
- $.fillStyle = c(F.id), rs($, R.left, R.top + g * 0.25, g * 0.9, g * 0.9, 2), $.fill(), $.fillStyle = o.text, $.fillText(F.label ?? F.id, R.left + g * 1.3, R.top + R.height / 2);
3258
+ for (const D of s) {
3259
+ const R = q.get(D.id);
3260
+ $.fillStyle = c(D.id), rs($, R.left, R.top + g * 0.25, g * 0.9, g * 0.9, 2), $.fill(), $.fillStyle = o.text, $.fillText(D.label ?? D.id, R.left + g * 1.3, R.top + R.height / 2);
3261
3261
  }
3262
3262
  }
3263
3263
  if (a) {
@@ -3265,38 +3265,38 @@ function Fd(e) {
3265
3265
  return;
3266
3266
  }
3267
3267
  $.lineWidth = 1, $.textAlign = "right";
3268
- for (let F = 0; F <= 4; F++) {
3269
- const R = m.bottom - P * F / 4;
3270
- $.strokeStyle = o.grid, $.beginPath(), $.moveTo(m.left, R), $.lineTo(m.right, R), $.stroke(), $.fillStyle = o.text, $.globalAlpha = 0.7, $.fillText(Ol(p * F / 4), m.left - g * 0.5, R), $.globalAlpha = 1;
3268
+ for (let D = 0; D <= 4; D++) {
3269
+ const R = m.bottom - P * D / 4;
3270
+ $.strokeStyle = o.grid, $.beginPath(), $.moveTo(m.left, R), $.lineTo(m.right, R), $.stroke(), $.fillStyle = o.text, $.globalAlpha = 0.7, $.fillText(Hl(p * D / 4), m.left - g * 0.5, R), $.globalAlpha = 1;
3271
3271
  }
3272
3272
  (H || T) && ($.fillStyle = o.text, $.textAlign = "center", $.globalAlpha = 0.85, H && ($.save(), $.translate(g * 0.9, (m.top + m.bottom) / 2), $.rotate(-Math.PI / 2), $.fillText(H, 0, 0), $.restore()), T && $.fillText(T, (m.left + m.right) / 2, m.bottom + g * 2.3), $.globalAlpha = 1);
3273
- const B = (F, R) => te(S(F, R, "value")) * (n === "bar" ? te(S(F, R, "show")) : 1) * w, le = (F, R) => Ao(c(R), o.highlight, te(S(F, R, "highlight")));
3273
+ const B = (D, R) => te(S(D, R, "value")) * (n === "bar" ? te(S(D, R, "show")) : 1) * w, le = (D, R) => Ao(c(R), o.highlight, te(S(D, R, "highlight")));
3274
3274
  if (n === "line") {
3275
3275
  $.lineWidth = Math.max(2, g * 0.2), $.lineJoin = "round", $.lineCap = "round";
3276
- for (const F of s)
3277
- $.strokeStyle = c(F.id), $.beginPath(), e.data.forEach((R, J) => {
3278
- const he = { x: O(R.id), y: m.bottom - B(R.id, F.id) }, de = te(S(R.id, F.id, "show"));
3276
+ for (const D of s)
3277
+ $.strokeStyle = c(D.id), $.beginPath(), e.data.forEach((R, J) => {
3278
+ const he = { x: O(R.id), y: m.bottom - B(R.id, D.id) }, de = te(S(R.id, D.id, "show"));
3279
3279
  if (J === 0) {
3280
3280
  de > 0 && $.moveTo(he.x, he.y);
3281
3281
  return;
3282
3282
  }
3283
3283
  const pe = e.data[J - 1];
3284
- if (te(S(pe.id, F.id, "show")) < 1 || de <= 0) return;
3285
- const ge = { x: O(pe.id), y: m.bottom - B(pe.id, F.id) };
3284
+ if (te(S(pe.id, D.id, "show")) < 1 || de <= 0) return;
3285
+ const ge = { x: O(pe.id), y: m.bottom - B(pe.id, D.id) };
3286
3286
  $.lineTo(ge.x + (he.x - ge.x) * de, ge.y + (he.y - ge.y) * de);
3287
3287
  }), $.stroke();
3288
3288
  }
3289
3289
  $.textAlign = "center";
3290
- for (const F of e.data) {
3290
+ for (const D of e.data) {
3291
3291
  for (const R of s) {
3292
- const J = n === "bar" ? x(F.id, R.id) : O(F.id), he = B(F.id, R.id), de = te(S(F.id, R.id, "show"));
3293
- if ($.fillStyle = le(F.id, R.id), n === "bar" ? he > 0.5 && (Hl($, J - y / 2, m.bottom - he, y, he, Math.min(6, y / 4)), $.fill()) : de > 0 && ($.beginPath(), $.arc(J, m.bottom - he, v * Math.min(1, de * 1.5) * (1 + 0.3 * te(S(F.id, R.id, "highlight"))), 0, Math.PI * 2), $.fill()), e.values !== !1 && de > 0) {
3294
- $.globalAlpha = Math.min(1, de * 2), $.font = `600 ${r ? g * 0.85 : g}px ${o.font}`, $.fillStyle = Ao(o.text, o.highlight, te(S(F.id, R.id, "highlight")));
3292
+ const J = n === "bar" ? x(D.id, R.id) : O(D.id), he = B(D.id, R.id), de = te(S(D.id, R.id, "show"));
3293
+ if ($.fillStyle = le(D.id, R.id), n === "bar" ? he > 0.5 && (Il($, J - y / 2, m.bottom - he, y, he, Math.min(6, y / 4)), $.fill()) : de > 0 && ($.beginPath(), $.arc(J, m.bottom - he, v * Math.min(1, de * 1.5) * (1 + 0.3 * te(S(D.id, R.id, "highlight"))), 0, Math.PI * 2), $.fill()), e.values !== !1 && de > 0) {
3294
+ $.globalAlpha = Math.min(1, de * 2), $.font = `600 ${r ? g * 0.85 : g}px ${o.font}`, $.fillStyle = Ao(o.text, o.highlight, te(S(D.id, R.id, "highlight")));
3295
3295
  const pe = m.bottom - he - (n === "line" ? v : 0) - g * 0.95;
3296
- $.fillText(D(te(S(F.id, R.id, "value"))), J, pe), $.font = `${g}px ${o.font}`, $.globalAlpha = 1;
3296
+ $.fillText(F(te(S(D.id, R.id, "value"))), J, pe), $.font = `${g}px ${o.font}`, $.globalAlpha = 1;
3297
3297
  }
3298
3298
  }
3299
- $.fillStyle = o.text, $.fillText(F.label ?? F.id, O(F.id), m.bottom + g * 1.1);
3299
+ $.fillStyle = o.text, $.fillText(D.label ?? D.id, O(D.id), m.bottom + g * 1.1);
3300
3300
  }
3301
3301
  $.strokeStyle = o.text, $.lineWidth = 1.5, $.beginPath(), $.moveTo(m.left, m.bottom), $.lineTo(m.right, m.bottom), $.stroke(), $.restore();
3302
3302
  }
@@ -3304,17 +3304,17 @@ function Fd(e) {
3304
3304
  function ae($, z) {
3305
3305
  const U = s[0].id, te = ee(z);
3306
3306
  e.data.forEach((B, le) => {
3307
- const F = te.get(B.id);
3308
- if (F.sweep <= 1e-4) return;
3307
+ const D = te.get(B.id);
3308
+ if (D.sweep <= 1e-4) return;
3309
3309
  const R = Z.get(B.id), J = R ? { x: z(`piece.${R.id}.x`), y: z(`piece.${R.id}.y`) } : { x: 0, y: 0 }, he = R ? z(`piece.${R.id}.rotate`) * Math.PI / 180 : 0, de = R ? z(`piece.${R.id}.opacity`) : 1;
3310
3310
  if (de <= 0) return;
3311
3311
  $.save(), $.globalAlpha = de;
3312
- const pe = { x: G.cx + Math.cos(F.mid) * F.out, y: G.cy + Math.sin(F.mid) * F.out };
3313
- $.translate(F.centre.x + J.x, F.centre.y + J.y), $.rotate(he), $.translate(-F.centre.x, -F.centre.y), $.beginPath(), $.arc(pe.x, pe.y, G.r, F.start, F.start + F.sweep), Y > 0 ? $.arc(pe.x, pe.y, Y, F.start + F.sweep, F.start, !0) : $.lineTo(pe.x, pe.y), $.closePath(), $.fillStyle = Ao(o.palette[le % o.palette.length], o.highlight, z(S(B.id, U, "highlight"))), $.fill(), $.strokeStyle = o.background, $.lineWidth = Math.max(1.5, g * 0.15), $.stroke(), e.values !== !1 && F.sweep >= 0.3 && ($.fillStyle = o.background, $.font = `600 ${g}px ${o.font}`, $.textAlign = "center", $.fillText(D(z(S(B.id, U, "value"))), F.centre.x, F.centre.y), $.font = `${g}px ${o.font}`), $.restore();
3314
- const ge = K(F), Me = Math.cos(F.mid);
3312
+ const pe = { x: G.cx + Math.cos(D.mid) * D.out, y: G.cy + Math.sin(D.mid) * D.out };
3313
+ $.translate(D.centre.x + J.x, D.centre.y + J.y), $.rotate(he), $.translate(-D.centre.x, -D.centre.y), $.beginPath(), $.arc(pe.x, pe.y, G.r, D.start, D.start + D.sweep), Y > 0 ? $.arc(pe.x, pe.y, Y, D.start + D.sweep, D.start, !0) : $.lineTo(pe.x, pe.y), $.closePath(), $.fillStyle = Ao(o.palette[le % o.palette.length], o.highlight, z(S(B.id, U, "highlight"))), $.fill(), $.strokeStyle = o.background, $.lineWidth = Math.max(1.5, g * 0.15), $.stroke(), e.values !== !1 && D.sweep >= 0.3 && ($.fillStyle = o.background, $.font = `600 ${g}px ${o.font}`, $.textAlign = "center", $.fillText(F(z(S(B.id, U, "value"))), D.centre.x, D.centre.y), $.font = `${g}px ${o.font}`), $.restore();
3314
+ const ge = K(D), Me = Math.cos(D.mid);
3315
3315
  $.globalAlpha = de, $.fillStyle = o.text, $.textAlign = Me > 0.2 ? "left" : Me < -0.2 ? "right" : "center";
3316
3316
  const yt = Me > 0.2 ? ge.left : Me < -0.2 ? ge.right : ge.left + ge.width / 2;
3317
- $.fillText(B.label ?? B.id, yt, ge.top + ge.height / 2), e.values !== !1 && F.sweep < 0.3 && ($.globalAlpha = de * 0.8, $.fillText(D(z(S(B.id, U, "value"))), yt, ge.bottom + g * 0.65)), $.globalAlpha = 1;
3317
+ $.fillText(B.label ?? B.id, yt, ge.top + ge.height / 2), e.values !== !1 && D.sweep < 0.3 && ($.globalAlpha = de * 0.8, $.fillText(F(z(S(B.id, U, "value"))), yt, ge.bottom + g * 0.65)), $.globalAlpha = 1;
3318
3318
  });
3319
3319
  }
3320
3320
  const ie = {
@@ -3344,16 +3344,16 @@ function Fd(e) {
3344
3344
  if (!($ in st.edits)) throw uo("chart", $, st);
3345
3345
  if ($ === "pull" && !a) throw new Error(`chart.edit: pull takes slice anchors of a pie or donut; a ${n} chart has ${f}s`);
3346
3346
  const B = te.map((le) => {
3347
- const F = Q(le);
3348
- if (F.kind !== f) throw new Error(`chart.edit: ${$} takes ${f} anchors (${f}:ID), not "${le}"`);
3349
- return F;
3347
+ const D = Q(le);
3348
+ if (D.kind !== f) throw new Error(`chart.edit: ${$} takes ${f} anchors (${f}:ID), not "${le}"`);
3349
+ return D;
3350
3350
  });
3351
- for (const { id: le, series: F } of B) {
3352
- const R = (J) => S(le, F, J);
3351
+ for (const { id: le, series: D } of B) {
3352
+ const R = (J) => S(le, D, J);
3353
3353
  if ($ === "set") {
3354
3354
  if (typeof U.value != "number" || !Number.isFinite(U.value)) throw new Error("chart.edit: set needs `value`, a number");
3355
- I.tween(R("value"), _(R("value"), U.at), U.value, U, Sl);
3356
- } else $ === "show" ? I.tween(R("show"), _(R("show"), U.at), U.on === !1 ? 0 : 1, U, Ml) : $ === "pull" ? I.tween(R("pull"), _(R("pull"), U.at), U.on === !1 ? 0 : 1, U, El) : I.tween(R("highlight"), _(R("highlight"), U.at), U.on === !1 ? 0 : 1, U, $l);
3355
+ I.tween(R("value"), _(R("value"), U.at), U.value, U, Ml);
3356
+ } else $ === "show" ? I.tween(R("show"), _(R("show"), U.at), U.on === !1 ? 0 : 1, U, $l) : $ === "pull" ? I.tween(R("pull"), _(R("pull"), U.at), U.on === !1 ? 0 : 1, U, Al) : I.tween(R("highlight"), _(R("highlight"), U.at), U.on === !1 ? 0 : 1, U, El);
3357
3357
  }
3358
3358
  return ie;
3359
3359
  },
@@ -3370,8 +3370,8 @@ function Fd(e) {
3370
3370
  if (n !== "bar") return $;
3371
3371
  const te = e.data.flatMap(
3372
3372
  (B) => s.map((le) => {
3373
- const F = V(B.id, le.id, 0), R = [...Pt(I.keys(S(B.id, le.id, "value"))), ...Pt(I.keys(S(B.id, le.id, "show")))];
3374
- return { top: e.y + m.bottom - F, offset: (J) => F - V(B.id, le.id, J), windows: R };
3373
+ const D = V(B.id, le.id, 0), R = [...Pt(I.keys(S(B.id, le.id, "value"))), ...Pt(I.keys(S(B.id, le.id, "show")))];
3374
+ return { top: e.y + m.bottom - D, offset: (J) => D - V(B.id, le.id, J), windows: R };
3375
3375
  })
3376
3376
  );
3377
3377
  return wn($, z, { ground: U.ground, every: U.every ?? Ye, floors: te });
@@ -3380,13 +3380,13 @@ function Fd(e) {
3380
3380
  };
3381
3381
  return ie;
3382
3382
  }
3383
- function Pl(e) {
3383
+ function Ol(e) {
3384
3384
  if (!(e > 0)) return 1;
3385
3385
  const t = 10 ** Math.floor(Math.log10(e));
3386
3386
  for (const o of [1, 2, 2.5, 5, 10]) if (o * t >= e - 1e-9) return o * t;
3387
3387
  return 10 * t;
3388
3388
  }
3389
- function Ol(e) {
3389
+ function Hl(e) {
3390
3390
  return Number.isInteger(e) ? String(e) : String(Number(e.toFixed(2)));
3391
3391
  }
3392
3392
  function Ao(e, t, o) {
@@ -3400,14 +3400,14 @@ function Ao(e, t, o) {
3400
3400
  function rs(e, t, o, n, a, r) {
3401
3401
  e.beginPath(), e.moveTo(t + r, o), e.arcTo(t + n, o, t + n, o + a, r), e.arcTo(t + n, o + a, t, o + a, r), e.arcTo(t, o + a, t, o, r), e.arcTo(t, o, t + n, o, r), e.closePath();
3402
3402
  }
3403
- function Hl(e, t, o, n, a, r) {
3403
+ function Il(e, t, o, n, a, r) {
3404
3404
  const s = Math.min(r, a);
3405
3405
  e.beginPath(), e.moveTo(t, o + a), e.lineTo(t, o + s), e.arcTo(t, o, t + s, o, s), e.lineTo(t + n - s, o), e.arcTo(t + n, o, t + n, o + s, s), e.lineTo(t + n, o + a), e.closePath();
3406
3406
  }
3407
- function Il(e) {
3407
+ function xl(e) {
3408
3408
  return e.endsWith(".value") ? { description: "Its value (the bar’s height, the point’s, or the slice’s share, and its value label)", unit: "value" } : e.endsWith(".show") ? { description: "How much of it is shown: a bar grown in from the axis, the line drawn out to the point, a slice opened", unit: "0..1", min: 0, max: 1 } : e.endsWith(".pull") ? { description: "How far the slice is pulled out from the centre", unit: "0..1", min: 0, max: 1 } : e.startsWith("piece.") ? { description: e.endsWith(".opacity") ? "The loose slice’s opacity" : e.endsWith(".rotate") ? "The loose slice’s turn, degrees" : "The loose slice’s offset from home, px", unit: e.endsWith(".rotate") ? "degrees" : e.endsWith(".opacity") ? "0..1" : "px" } : { description: "How much it is coloured out", unit: "0..1", min: 0, max: 1 };
3409
3409
  }
3410
- const xl = {
3410
+ const jl = {
3411
3411
  animeBoy: {
3412
3412
  label: "Anime boy",
3413
3413
  group: "anime",
@@ -3569,7 +3569,7 @@ const xl = {
3569
3569
  outfit: { shirt: "#6d9b93", trousers: "#66597a", sleeves: "long", over: "cardigan", overColor: "#6d9b93", shoes: "boots" }
3570
3570
  }
3571
3571
  }
3572
- }, jl = {
3572
+ }, _l = {
3573
3573
  mangaYoungMan: {
3574
3574
  label: "Manga young man",
3575
3575
  group: "manga",
@@ -3746,10 +3746,10 @@ const xl = {
3746
3746
  scale: 0.97,
3747
3747
  options: { build: "stocky", hair: { style: "shoulderStraight", color: xe.blond }, hat: "sunHat", ears: !0, outfit: { shirt: "#d64535", trousers: "#4f6b3a", sleeves: "long" } }
3748
3748
  },
3749
- ...xl,
3750
- ...jl
3749
+ ...jl,
3750
+ ..._l
3751
3751
  };
3752
- function qd(e, t = 300, o = {}) {
3752
+ function Bd(e, t = 300, o = {}) {
3753
3753
  const n = Or[e];
3754
3754
  if (!n) throw new Error(`castMember: unknown cast member '${e}'`);
3755
3755
  return { ...n.options, height: Math.round(t * n.scale), ...o };
@@ -3760,11 +3760,11 @@ const no = {
3760
3760
  fistBump: { height: 0.55, spacing: 0.44, lean: 6 },
3761
3761
  handOver: { height: 0.52, spacing: 0.46, lean: 8 }
3762
3762
  };
3763
- function Bd(e, t, o) {
3763
+ function Gd(e, t, o) {
3764
3764
  return no[e].spacing * Math.min(t.height, o.height);
3765
3765
  }
3766
3766
  const as = 0.075;
3767
- function Gd(e, t, o, n = {}) {
3767
+ function Yd(e, t, o, n = {}) {
3768
3768
  const a = no[e];
3769
3769
  if (!a) throw new Error(`meetHands: unknown meeting '${e}' (one of ${Object.keys(no).join(", ")})`);
3770
3770
  const [r, s] = t.x <= o.x ? [t, o] : [o, t], i = n.view === "side", h = Math.min(r.character.height, s.character.height), c = { x: (r.x + s.x) / 2, y: -(n.height ?? a.height) * h }, l = (b, T) => {
@@ -3786,10 +3786,10 @@ function Gd(e, t, o, n = {}) {
3786
3786
  return t.x <= o.x ? { a: d, b: f, point: c, reached: g } : { a: f, b: d, point: c, reached: g };
3787
3787
  }
3788
3788
  const Xo = { spacing: 0.3, lean: 10, tilt: 8 };
3789
- function Yd(e, t) {
3789
+ function Ud(e, t) {
3790
3790
  return Xo.spacing * Math.min(e.height, t.height);
3791
3791
  }
3792
- function Ud(e, t, o = {}) {
3792
+ function Xd(e, t, o = {}) {
3793
3793
  const [n, a] = e.x <= t.x ? [e, t] : [t, e], r = o.view === "side", s = Math.min(n.character.height, a.character.height), i = (p, g, b) => ({
3794
3794
  over: { x: g.x - b * 0.02 * s - p.x, y: -0.72 * s, depth: -0.08 * s },
3795
3795
  round: { x: g.x - b * 0.04 * s - p.x, y: -0.5 * s, depth: 0.06 * s }
@@ -3805,10 +3805,10 @@ function Ud(e, t, o = {}) {
3805
3805
  return e.x <= t.x ? { a: c, b: l, reached: u } : { a: l, b: c, reached: u };
3806
3806
  }
3807
3807
  const rt = { spacing: 0.32, low: 0.3, high: 0.5, helperLean: 40, helperBend: 16 };
3808
- function Xd(e, t) {
3808
+ function Vd(e, t) {
3809
3809
  return rt.spacing * Math.min(e.height, t.height);
3810
3810
  }
3811
- function Vd(e, t, o, n = {}) {
3811
+ function Jd(e, t, o, n = {}) {
3812
3812
  const a = Math.max(0, Math.min(1, o)), r = n.view === "side", s = e.x <= t.x, i = Math.min(e.character.height, t.character.height), h = { x: (e.x + t.x) / 2, y: -(rt.low + (rt.high - rt.low) * a) * i }, c = (b) => b ? r ? 1 : 0.62 : r ? 3 : 3.38;
3813
3813
  let l = { ...ye, ...e.pose, turn: c(s), lean: (e.pose?.lean ?? 0) + rt.helperLean * (1 - a) + 4, bend: (e.pose?.bend ?? 0) + rt.helperBend * (1 - a), "head.nod": 18 * (1 - a) };
3814
3814
  l = Le(e.character, l, "arm.right", { x: h.x - e.x, y: h.y });
@@ -3821,8 +3821,8 @@ function Vd(e, t, o, n = {}) {
3821
3821
  };
3822
3822
  return { helper: l, sitter: u, point: h, reached: g(e, l) && g(t, u) };
3823
3823
  }
3824
- const _l = 0.7, Kl = 50, Cl = 1.2, Nl = 0.8, Rl = 3, Wl = 30, zl = 0.8, Ll = 0.6, To = (e, t) => Math.max(-t, Math.min(t, e)), Dl = ["hair.swing", "hair.trail", "hair.lift"];
3825
- function Fl(e, t) {
3824
+ const Kl = 0.7, Cl = 50, Nl = 1.2, Rl = 0.8, Wl = 3, zl = 30, Ll = 0.8, Fl = 0.6, To = (e, t) => Math.max(-t, Math.min(t, e)), Dl = ["hair.swing", "hair.trail", "hair.lift"];
3825
+ function ql(e, t) {
3826
3826
  const o = t.start ?? 0, n = t.amount ?? 1, a = Math.max(1e-6, t.headRadius);
3827
3827
  let r = NaN, s = { x: 0, y: 0, turn: 0 };
3828
3828
  const i = (u) => (u !== r && (s = e(u), r = u), s), h = (u) => {
@@ -3830,16 +3830,16 @@ function Fl(e, t) {
3830
3830
  return p.turn * 90 + (p.headTurn ?? 0);
3831
3831
  }, c = { start: o, end: t.end, step: t.step, stiffness: t.stiffness ?? 70, damping: t.damping ?? 6 }, l = Bt(h, c), d = Bt((u) => i(u).x, c), f = Bt((u) => i(u).y, c);
3832
3832
  return l.map((u, p) => {
3833
- const g = i(u.time), b = u.value - h(u.time), T = d[p].value - g.x - (t.wind ?? 0) * _l * a, H = f[p].value - g.y, M = Math.sin(g.turn * Math.PI / 2), m = Math.cos(g.turn * Math.PI / 2), P = b * Rl + T * m / a * Wl, A = -T * M / a * zl, k = -H / a * Ll;
3833
+ const g = i(u.time), b = u.value - h(u.time), T = d[p].value - g.x - (t.wind ?? 0) * Kl * a, H = f[p].value - g.y, M = Math.sin(g.turn * Math.PI / 2), m = Math.cos(g.turn * Math.PI / 2), P = b * Wl + T * m / a * zl, A = -T * M / a * Ll, k = -H / a * Fl;
3834
3834
  return {
3835
3835
  time: u.time,
3836
- swing: To(P * n, Kl),
3837
- trail: To(A * n, Cl),
3838
- lift: To(k * n, Nl)
3836
+ swing: To(P * n, Cl),
3837
+ trail: To(A * n, Nl),
3838
+ lift: To(k * n, Rl)
3839
3839
  };
3840
3840
  });
3841
3841
  }
3842
- function Jd(e, t) {
3842
+ function Zd(e, t) {
3843
3843
  if (e.length === 0) return { "hair.swing": 0, "hair.trail": 0, "hair.lift": 0 };
3844
3844
  if (t <= e[0].time) return is(e[0]);
3845
3845
  if (t >= e[e.length - 1].time) return is(e[e.length - 1]);
@@ -3855,8 +3855,8 @@ function Jd(e, t) {
3855
3855
  "hair.lift": a.lift + (r.lift - a.lift) * s
3856
3856
  };
3857
3857
  }
3858
- const is = (e) => ({ "hair.swing": e.swing, "hair.trail": e.trail, "hair.lift": e.lift }), ot = 16, ql = 1500;
3859
- function Zd(e, t, o, n = {}) {
3858
+ const is = (e) => ({ "hair.swing": e.swing, "hair.trail": e.trail, "hair.lift": e.lift }), ot = 16, Bl = 1500;
3859
+ function Qd(e, t, o, n = {}) {
3860
3860
  const a = o.head.hair;
3861
3861
  if (!a || !ca(a)) return [];
3862
3862
  const r = t.filter((H) => H.target === e), s = r.reduce((H, M) => M.keyframes.reduce((m, P) => Math.max(m, P.time), H), 0), i = ye, h = /* @__PURE__ */ new Set(["x", "y", "turn", "head.turn"]), c = new ve({ id: `${e}-hair-follow`, tracks: r.filter((H) => h.has(H.property)) }), l = (H, M, m) => {
@@ -3875,7 +3875,7 @@ function Zd(e, t, o, n = {}) {
3875
3875
  }, g = (H) => {
3876
3876
  const M = Math.floor(H / ot), m = H / ot - M, P = p(M * ot), A = p((M + 1) * ot);
3877
3877
  return { x: P.x + (A.x - P.x) * m, y: P.y + (A.y - P.y) * m };
3878
- }, b = Fl(
3878
+ }, b = ql(
3879
3879
  (H) => {
3880
3880
  const M = g(H);
3881
3881
  return {
@@ -3887,7 +3887,7 @@ function Zd(e, t, o, n = {}) {
3887
3887
  },
3888
3888
  {
3889
3889
  start: 0,
3890
- end: s + (n.settle ?? ql),
3890
+ end: s + (n.settle ?? Bl),
3891
3891
  headRadius: Oe(o, ye).head.rx,
3892
3892
  step: n.step,
3893
3893
  stiffness: n.stiffness,
@@ -3977,25 +3977,25 @@ function Hr(e) {
3977
3977
  const { base: t, ...o } = e;
3978
3978
  return { ...ht[t ?? "full"], ...o };
3979
3979
  }
3980
- const Vo = 160, Bl = 120, Gl = 700, Po = 60, Yl = 90, zt = 3200, ct = 1, Xe = 1e-6;
3980
+ const Vo = 160, Gl = 120, Yl = 700, Po = 60, Ul = 90, zt = 3200, ct = 1, Xe = 1e-6;
3981
3981
  function kn(e, t, o = {}) {
3982
3982
  const n = Hr(o.style), a = o.seed ?? 1, r = {};
3983
3983
  if (e.length === 0) return r;
3984
3984
  const s = Object.keys(e[0].pose).filter((d) => e.some((f) => Math.abs(f.pose[d] - e[0].pose[d]) > Xe));
3985
- for (const d of s) r[d] = Ul(d, e, t, n, a);
3985
+ for (const d of s) r[d] = Xl(d, e, t, n, a);
3986
3986
  const i = t.blink, h = i !== void 0 && s.includes(i);
3987
3987
  if (n.blinks && i !== void 0 && !h && i in e[0].pose) {
3988
- const d = Xl(e, t, n, a, e[0].pose[i]);
3988
+ const d = Vl(e, t, n, a, e[0].pose[i]);
3989
3989
  d.length > 0 && (r[i] = d);
3990
3990
  }
3991
3991
  const { lift: c, stretch: l } = t;
3992
3992
  if (n.jumpSquash > 0 && c && l && s.includes(c) && !s.includes(l) && l in e[0].pose) {
3993
- const d = Vl(e, c, e[0].pose[l], n.jumpSquash);
3993
+ const d = Jl(e, c, e[0].pose[l], n.jumpSquash);
3994
3994
  d.length > 0 && (r[l] = d);
3995
3995
  }
3996
3996
  return r;
3997
3997
  }
3998
- function Ul(e, t, o, n, a) {
3998
+ function Xl(e, t, o, n, a) {
3999
3999
  const r = o.eyes.includes(e), s = o.limits[e], i = s !== void 0, h = r ? -n.eyeLead : (o.depth[e] ?? 1) * n.overlap, c = (u) => {
4000
4000
  const p = (t[u].time - t[u - 1].time) / 2;
4001
4001
  return Math.max(-p, Math.min(p, h));
@@ -4014,8 +4014,8 @@ function Ul(e, t, o, n, a) {
4014
4014
  const E = p.time + (M ? c(u) : 0);
4015
4015
  if (u === t.length - 1)
4016
4016
  Math.abs(f - b) > Xe && d(Math.max(E, H + Vo), b, "ease-in-out"), f = b;
4017
- else if (M && i && n.drift > 0 && o.drift.includes(e) && E - H >= Gl) {
4018
- const O = De(`${a}:${e}:${u}`) % 2 === 0 ? 1 : -1;
4017
+ else if (M && i && n.drift > 0 && o.drift.includes(e) && E - H >= Yl) {
4018
+ const O = Fe(`${a}:${e}:${u}`) % 2 === 0 ? 1 : -1;
4019
4019
  f = b + O * n.drift * s, d(E, f, "ease-in-out");
4020
4020
  }
4021
4021
  continue;
@@ -4039,7 +4039,7 @@ function Ul(e, t, o, n, a) {
4039
4039
  d(O, E, "ease-in-out"), n.hold > 0 && d(O + k * n.hold, E);
4040
4040
  }
4041
4041
  const v = u + 1 < t.length ? t[u + 1].time - p.time : 1 / 0, w = Math.min(n.settle, v / 2);
4042
- if (i && n.overshoot > 0 && s > 0 && k >= Bl && w > ct) {
4042
+ if (i && n.overshoot > 0 && s > 0 && k >= Gl && w > ct) {
4043
4043
  const E = Math.min(Math.abs(T) * n.overshoot, s);
4044
4044
  d(A, b + y * E, p.easing ?? n.actionEase), d(A + w, b, n.settleEase);
4045
4045
  } else
@@ -4048,8 +4048,8 @@ function Ul(e, t, o, n, a) {
4048
4048
  }
4049
4049
  return l;
4050
4050
  }
4051
- function Xl(e, t, o, n, a) {
4052
- const r = [], s = Po + Yl;
4051
+ function Vl(e, t, o, n, a) {
4052
+ const r = [], s = Po + Ul;
4053
4053
  for (let u = 1; u < e.length; u++) {
4054
4054
  const p = e[u - 1].pose, g = e[u].pose;
4055
4055
  Object.entries(t.headTurns).some(([T, H]) => Math.abs((g[T] ?? 0) - (p[T] ?? 0)) > H) && e[u].act !== !1 && r.push(Math.max(e[0].time, e[u - 1].time - o.eyeLead));
@@ -4058,7 +4058,7 @@ function Xl(e, t, o, n, a) {
4058
4058
  let l = i + zt * 0.6, d = 0;
4059
4059
  for (; l < h; ) {
4060
4060
  c.some((g) => Math.abs(g - l) < zt / 2) || r.push(l);
4061
- const p = (De(`${n}:blink:${d++}`) % 1e3 / 1e3 - 0.5) * (zt * 0.66);
4061
+ const p = (Fe(`${n}:blink:${d++}`) % 1e3 / 1e3 - 0.5) * (zt * 0.66);
4062
4062
  l += zt + p;
4063
4063
  }
4064
4064
  r.sort((u, p) => u - p);
@@ -4069,7 +4069,7 @@ function Xl(e, t, o, n, a) {
4069
4069
  }
4070
4070
  return f.length > 1 ? f : [];
4071
4071
  }
4072
- function Vl(e, t, o, n) {
4072
+ function Jl(e, t, o, n) {
4073
4073
  const a = o * (1 - 0.18 * n), r = o * (1 + 0.14 * n), s = [{ time: e[0].time, value: o }], i = (h, c, l) => {
4074
4074
  const d = s[s.length - 1];
4075
4075
  h <= d.time + ct || s.push({ time: h, value: c, ...l ? { easing: l } : {} });
@@ -4087,7 +4087,7 @@ function Vl(e, t, o, n) {
4087
4087
  }
4088
4088
  return s.length > 1 ? s : [];
4089
4089
  }
4090
- const Jl = {
4090
+ const Zl = {
4091
4091
  depth: {
4092
4092
  lean: 0,
4093
4093
  bend: 0,
@@ -4153,13 +4153,13 @@ const Jl = {
4153
4153
  lift: "rise",
4154
4154
  stretch: "stretch"
4155
4155
  };
4156
- function Zl(e) {
4156
+ function Ql(e) {
4157
4157
  return /^(turn|lean|bend|side|lift|roll|stretch)$/.test(e) ? { depth: 0, limit: { turn: 0.06, lean: 10, bend: 10, side: 8, lift: 0, roll: 25, stretch: 0.08 }[e] } : /^leg\.\w+\.(swing|spread|rotate)$/.test(e) ? { depth: 0, limit: 12 } : /^head\./.test(e) ? { depth: 1, limit: 12 } : /^arm\.\w+\.(swing|spread)$/.test(e) ? { depth: 1, limit: 20 } : /^leg\.\w+\.knee$/.test(e) ? { depth: 1, limit: 15 } : /^(brow\.|browTilt$)/.test(e) ? { depth: 1, limit: e === "browTilt" ? void 0 : 0.25 } : /^eye\./.test(e) ? { depth: 1, limit: 0.15 } : /^arm\.\w+\.(elbow|bend)$/.test(e) ? { depth: 2, limit: 18 } : /^leg\.\w+\.(ankle|toeOut)$/.test(e) ? { depth: 2, limit: 10 } : /^(mouth|smile|mouthWidth)$/.test(e) ? { depth: 2 } : /^hand\./.test(e) ? { depth: 3 } : { depth: 1 };
4158
4158
  }
4159
- function Ql() {
4159
+ function eh() {
4160
4160
  const e = {}, t = {};
4161
4161
  for (const o of Object.keys(ye)) {
4162
- const n = Zl(o);
4162
+ const n = Ql(o);
4163
4163
  e[o] = n.depth, n.limit !== void 0 && (t[o] = n.limit);
4164
4164
  }
4165
4165
  return {
@@ -4173,19 +4173,19 @@ function Ql() {
4173
4173
  stretch: "stretch"
4174
4174
  };
4175
4175
  }
4176
- const eh = Ql();
4176
+ const th = eh();
4177
4177
  function Ir(e, t) {
4178
4178
  return Object.entries(t).map(([o, n]) => ({ id: `${e}-${o}`, target: e, property: o, keyframes: n }));
4179
4179
  }
4180
- function th(e, t, o = {}) {
4180
+ function oh(e, t, o = {}) {
4181
4181
  const n = Vs(t), a = t.map((r, s) => ({ time: r.time, pose: { ...n[s] }, easing: r.easing, act: r.act }));
4182
- return Ir(e, kn(a, o.rig ?? Jl, o));
4182
+ return Ir(e, kn(a, o.rig ?? Zl, o));
4183
4183
  }
4184
- function oh(e, t, o = {}) {
4184
+ function nh(e, t, o = {}) {
4185
4185
  const n = o.rest ?? ye, a = fa(t, n), r = t.map((s, i) => ({ time: s.time, pose: { ...n, ...a[i] }, easing: s.easing, act: s.act }));
4186
- return Ir(e, kn(r, o.rig ?? eh, o));
4186
+ return Ir(e, kn(r, o.rig ?? th, o));
4187
4187
  }
4188
- const ls = $e.shocked, nh = $e.scared, Ve = {
4188
+ const ls = $e.shocked, sh = $e.scared, Ve = {
4189
4189
  /** The classic take: squash down in a squint, then shoot up stretched with eyes popping, hang, and land squashed. */
4190
4190
  take: (e) => [
4191
4191
  { after: 140, pose: { stretch: 0.8, bend: 10, lean: e.lean - 4, leftShoulder: 8, rightShoulder: 8, leftEye: 0.35, rightEye: 0.35, leftBrow: -0.6, rightBrow: -0.6, mouth: 0 }, easing: "ease-in-out" },
@@ -4219,7 +4219,7 @@ const ls = $e.shocked, nh = $e.scared, Ve = {
4219
4219
  ],
4220
4220
  /** A frightened shiver: small, fast shakes with wide eyes, then still. */
4221
4221
  tremble: (e) => {
4222
- const t = [{ after: 80, pose: { ...nh, bend: e.bend + 8, leftShoulder: 40, rightShoulder: 40, leftElbow: 110, rightElbow: 110, stretch: 0.94 }, easing: "ease-out" }];
4222
+ const t = [{ after: 80, pose: { ...sh, bend: e.bend + 8, leftShoulder: 40, rightShoulder: 40, leftElbow: 110, rightElbow: 110, stretch: 0.94 }, easing: "ease-out" }];
4223
4223
  for (let o = 1; o <= 14; o++) t.push({ after: 80 + o * 45, pose: { lean: e.lean + (o % 2 === 0 ? 2.5 : -2.5), headTilt: e.headTilt + (o % 2 === 0 ? -2 : 2) } });
4224
4224
  return t.push({ after: 755, pose: { lean: e.lean, headTilt: e.headTilt, bend: e.bend } }), t;
4225
4225
  },
@@ -4245,7 +4245,7 @@ function so(e, t = 1) {
4245
4245
  const o = Ve[e](ce);
4246
4246
  return o[o.length - 1].after * t;
4247
4247
  }
4248
- function sh(e, t, o = {}) {
4248
+ function rh(e, t, o = {}) {
4249
4249
  if (t.length < 2) return;
4250
4250
  const n = Math.max(1, Math.round(o.lines ?? 3)), a = o.spacing ?? 5, r = o.lineWidth ?? 2, s = o.opacity ?? 0.7;
4251
4251
  e.save(), e.strokeStyle = o.color ?? "#222", e.lineCap = "round";
@@ -4258,7 +4258,7 @@ function sh(e, t, o = {}) {
4258
4258
  }
4259
4259
  e.restore();
4260
4260
  }
4261
- const rh = {
4261
+ const ah = {
4262
4262
  hands: [
4263
4263
  { name: "left hand", at: (e) => e.hands.left },
4264
4264
  { name: "right hand", at: (e) => e.hands.right }
@@ -4273,7 +4273,7 @@ const rh = {
4273
4273
  { name: "neck", at: (e) => e.neck }
4274
4274
  ]
4275
4275
  };
4276
- function Qd(e, t, o, n, a = {}) {
4276
+ function ef(e, t, o, n, a = {}) {
4277
4277
  const r = o.stateAt;
4278
4278
  if (!r) return;
4279
4279
  const s = a.length ?? 120, i = Math.max(2, Math.round(a.samples ?? 8)), h = Math.max(0, o.time - s);
@@ -4283,7 +4283,7 @@ function Qd(e, t, o, n, a = {}) {
4283
4283
  const p = h + (o.time - h) * u / (i - 1);
4284
4284
  c.push(Js(t, { time: p, state: r(p) }, n).joints);
4285
4285
  }
4286
- const l = c[c.length - 1].height, d = (a.threshold ?? 1.2) * l, f = (a.parts ?? ["hands", "toes", "head"]).flatMap((u) => rh[u]);
4286
+ const l = c[c.length - 1].height, d = (a.threshold ?? 1.2) * l, f = (a.parts ?? ["hands", "toes", "head"]).flatMap((u) => ah[u]);
4287
4287
  for (const u of f) {
4288
4288
  const p = c.map(u.at);
4289
4289
  let g = 0;
@@ -4291,30 +4291,30 @@ function Qd(e, t, o, n, a = {}) {
4291
4291
  const b = g / ((o.time - h) / 1e3);
4292
4292
  if (b <= d) continue;
4293
4293
  const T = Math.min(1, (b - d) / (d * 0.5));
4294
- sh(e, p, { ...a, opacity: (a.opacity ?? 0.7) * T, spacing: a.spacing ?? l * 0.02 });
4294
+ rh(e, p, { ...a, opacity: (a.opacity ?? 0.7) * T, spacing: a.spacing ?? l * 0.02 });
4295
4295
  }
4296
4296
  }
4297
- function ah(e, t, o, n = {}) {
4297
+ function ih(e, t, o, n = {}) {
4298
4298
  if (o <= 0 || o >= 1) return;
4299
4299
  const a = n.size ?? 40, r = n.seed ?? 1, s = 0.45 + 0.55 * (1 - (1 - o) ** 3);
4300
4300
  e.save(), e.strokeStyle = n.color ?? "#555", e.lineWidth = Math.max(1, a * 0.03), e.globalAlpha = Math.min(1, o / 0.08) * (1 - o);
4301
4301
  for (let i = 0; i < 5; i++) {
4302
- const h = De(`${r}:puff:${i}`) % 1e3 / 1e3, c = i - 2, l = t.x + c * a * 0.3 * s, d = t.y - a * (0.06 + 0.12 * h) * s + Math.abs(c) * a * 0.03, f = a * (0.11 + 0.07 * h) * s;
4302
+ const h = Fe(`${r}:puff:${i}`) % 1e3 / 1e3, c = i - 2, l = t.x + c * a * 0.3 * s, d = t.y - a * (0.06 + 0.12 * h) * s + Math.abs(c) * a * 0.03, f = a * (0.11 + 0.07 * h) * s;
4303
4303
  e.beginPath(), e.arc(l, d, f, Math.PI * 0.95, Math.PI * 2.05), e.stroke();
4304
4304
  }
4305
4305
  e.restore();
4306
4306
  }
4307
- function ef(e, t, o, n = {}) {
4307
+ function tf(e, t, o, n = {}) {
4308
4308
  if (o <= 0 || o >= 1) return;
4309
4309
  const a = n.size ?? 40, r = 5, s = 1 - (1 - o) ** 2;
4310
4310
  e.save(), e.strokeStyle = n.color ?? "#222", e.lineWidth = Math.max(1, a * 0.035), e.lineJoin = "round", e.globalAlpha = o < 0.7 ? 1 : (1 - o) / 0.3;
4311
4311
  for (let i = 0; i < r; i++) {
4312
4312
  const h = -Math.PI / 2 + (i - (r - 1) / 2) * Math.PI / (r + 1), c = a * (0.3 + 0.7 * s), l = t.x + Math.cos(h) * c, d = t.y + Math.sin(h) * c;
4313
- ih(e, l, d, a * 0.14, o * Math.PI + i), e.stroke();
4313
+ lh(e, l, d, a * 0.14, o * Math.PI + i), e.stroke();
4314
4314
  }
4315
4315
  e.restore();
4316
4316
  }
4317
- function ih(e, t, o, n, a) {
4317
+ function lh(e, t, o, n, a) {
4318
4318
  e.beginPath();
4319
4319
  for (let r = 0; r < 10; r++) {
4320
4320
  const s = r % 2 === 0 ? n : n * 0.45, i = a + r * Math.PI / 5 - Math.PI / 2, h = t + Math.cos(i) * s, c = o + Math.sin(i) * s;
@@ -4367,7 +4367,7 @@ function Kr(e = {}) {
4367
4367
  for (const [o, n] of Object.entries(e.actions ?? {})) t[o] = n.summary;
4368
4368
  return t;
4369
4369
  }
4370
- const Jo = ["do", "at", "for", "to", "toward", "mood", "say", "pose", "target", "onto"], lh = {
4370
+ const Jo = ["do", "at", "for", "to", "toward", "mood", "say", "pose", "target", "onto"], hh = {
4371
4371
  action: "do",
4372
4372
  type: "do",
4373
4373
  verb: "do",
@@ -4408,7 +4408,7 @@ function ro(e, t = {}) {
4408
4408
  }
4409
4409
  const f = h;
4410
4410
  for (const g of Object.keys(f))
4411
- Jo.includes(g) || l(fe("beat field", g, Jo, lh[g.toLowerCase()]));
4411
+ Jo.includes(g) || l(fe("beat field", g, Jo, hh[g.toLowerCase()]));
4412
4412
  const u = f.do;
4413
4413
  if (u === void 0) {
4414
4414
  l(`A beat needs \`do\` (what happens). Actions: ${n.join(", ")}`);
@@ -4436,7 +4436,7 @@ function ro(e, t = {}) {
4436
4436
  const b = f[g];
4437
4437
  b !== void 0 && !qe(b) && l(`\`${g}\` is a scene ${g === "to" ? "x" : "y"} in px, a number (got ${JSON.stringify(b)}).`);
4438
4438
  }
4439
- if (f.toward !== void 0 && !qe(f.toward) && !Lt.includes(f.toward) && l(`\`toward\` is a scene x or one of ${Lt.join(", ")}${typeof f.toward == "string" && Do(f.toward, Lt) ? ` (did you mean "${Do(f.toward, Lt)}"?)` : ""} (got ${JSON.stringify(f.toward)}).`), f.say !== void 0 && typeof f.say != "string" && l(`\`say\` is the line spoken, a string (got ${JSON.stringify(f.say)}).`), f.target !== void 0) {
4439
+ if (f.toward !== void 0 && !qe(f.toward) && !Lt.includes(f.toward) && l(`\`toward\` is a scene x or one of ${Lt.join(", ")}${typeof f.toward == "string" && Fo(f.toward, Lt) ? ` (did you mean "${Fo(f.toward, Lt)}"?)` : ""} (got ${JSON.stringify(f.toward)}).`), f.say !== void 0 && typeof f.say != "string" && l(`\`say\` is the line spoken, a string (got ${JSON.stringify(f.say)}).`), f.target !== void 0) {
4440
4440
  const g = f.target;
4441
4441
  (!g || typeof g != "object" || !qe(g.x) || !qe(g.y)) && l("`target` is a point or box in scene px: { x, y } (a code panel’s line(), token() or spot() fits).");
4442
4442
  }
@@ -4450,13 +4450,13 @@ ${n.map((a) => ` ${a.beat >= 0 ? `beat ${a.beat}: ` : ""}${a.message}`).join(`
4450
4450
  `)}`);
4451
4451
  }
4452
4452
  ua(Kr);
4453
- function tf(e) {
4453
+ function of(e) {
4454
4454
  const t = "steps" in e && typeof e.steps == "function", o = "beats" in e && typeof e.beats == "function";
4455
4455
  if (t === o) throw new Error("defineAction: give either `steps: (from, beat) => [...]` or `beats: (beat) => [...]`");
4456
4456
  if (!e.summary) throw new Error("defineAction: give a `summary`: one line on what the figure does");
4457
4457
  return e;
4458
4458
  }
4459
- function of(e) {
4459
+ function nf(e) {
4460
4460
  for (const t of ["swing", "knee", "arm", "elbow", "lean"])
4461
4461
  if (typeof e[t] != "number") throw new Error(`defineGait: \`${t}\` must be a number (degrees)`);
4462
4462
  if (e.cycle !== void 0 && !(e.cycle > 0)) throw new Error("defineGait: `cycle` is ms per two steps, above 0");
@@ -4474,7 +4474,7 @@ function vn(e, t = {}, o = 0) {
4474
4474
  return vn(r, t, o + 1);
4475
4475
  });
4476
4476
  }
4477
- function hh(e) {
4477
+ function ch(e) {
4478
4478
  return e.length === 0 ? 0 : Math.max(...e.map((t) => t.after));
4479
4479
  }
4480
4480
  const fs = {
@@ -4486,9 +4486,9 @@ const fs = {
4486
4486
  tired: 1500,
4487
4487
  shove: 1300,
4488
4488
  run: 560
4489
- }, ch = 450, dh = 2.4, fh = 160, us = 2.5, uh = 200, gh = 340, ph = 1.1, gs = [380, 900], mh = 0.35, Dt = 300, Oo = 150, yh = 260, bh = 1.2, Ho = 160, ps = 400, vt = 300, wh = 450, ms = 500, Io = 350, ys = 150, kh = 120, xo = 180, bs = 420, vh = 300, ws = 300, Sh = 140, jo = 150, ks = 450, Mh = 450, _o = 150, vs = 350, Ss = 400, $h = 12, Eh = 600, Ms = 90, $s = 400, Ah = 200, Th = 0.09, Es = 350, He = 450, Ko = 1200, Ph = 700, nt = 320, Ie = 220, Oh = 65, Hh = 700, As = (e) => e in Ve, Ih = (e) => e in Ae;
4490
- function xh(e) {
4491
- return Math.max(Hh, Array.from(e).length * Oh);
4489
+ }, dh = 450, fh = 2.4, uh = 160, us = 2.5, gh = 200, ph = 340, mh = 1.1, gs = [380, 900], yh = 0.35, Ft = 300, Oo = 150, bh = 260, wh = 1.2, Ho = 160, ps = 400, vt = 300, kh = 450, ms = 500, Io = 350, ys = 150, vh = 120, xo = 180, bs = 420, Sh = 300, ws = 300, Mh = 140, jo = 150, ks = 450, $h = 450, _o = 150, vs = 350, Ss = 400, Eh = 12, Ah = 600, Ms = 90, $s = 400, Th = 200, Ph = 0.09, Es = 350, He = 450, Ko = 1200, Oh = 700, nt = 320, Ie = 220, Hh = 65, Ih = 700, As = (e) => e in Ve, xh = (e) => e in Ae;
4490
+ function jh(e) {
4491
+ return Math.max(Ih, Array.from(e).length * Hh);
4492
4492
  }
4493
4493
  function Sn(e, t, o = {}) {
4494
4494
  const n = { actions: o.actions, gaits: o.gaits };
@@ -4506,17 +4506,17 @@ function Sn(e, t, o = {}) {
4506
4506
  const L = ee === "arm", Q = je({ ...S, ...L ? { rightShoulder: 0, rightElbow: 0 } : { rightHip: 0, rightKnee: 0 } }, { height: d, facing: p }), re = L ? Q.shoulders.right : Q.hip, K = L ? Q.elbows.right : Q.knees.right, X = (se, ae) => Math.atan2(p * se, ae) * 180 / Math.PI, Z = ((X(_ - (f + re.x), V - (u + re.y)) - X(K.x - re.x, K.y - re.y)) % 360 + 360) % 360;
4507
4507
  return Z > 270 ? Z - 360 : Z;
4508
4508
  }, Y = (S, _, V, ee) => {
4509
- const L = ee === "arm", Q = je({ ...S, ...L ? { rightShoulder: 90, rightElbow: 0, rightWrist: 0 } : { rightHip: 90, rightKnee: 0 } }, { height: d, facing: p }), re = L ? Q.shoulders.right : Q.hip, K = L ? { x: (Q.hands.right.x + Q.fingertips.right.x) / 2, y: (Q.hands.right.y + Q.fingertips.right.y) / 2 } : Q.feet.right, X = Math.hypot(K.x - re.x, K.y - re.y) * ((L ? o.reach?.arm : o.reach?.leg) ?? 1), D = V - (u + re.y), Z = Math.abs(D) < X ? Math.sqrt(X * X - D * D) : X * 0.1;
4509
+ const L = ee === "arm", Q = je({ ...S, ...L ? { rightShoulder: 90, rightElbow: 0, rightWrist: 0 } : { rightHip: 90, rightKnee: 0 } }, { height: d, facing: p }), re = L ? Q.shoulders.right : Q.hip, K = L ? { x: (Q.hands.right.x + Q.fingertips.right.x) / 2, y: (Q.hands.right.y + Q.fingertips.right.y) / 2 } : Q.feet.right, X = Math.hypot(K.x - re.x, K.y - re.y) * ((L ? o.reach?.arm : o.reach?.leg) ?? 1), F = V - (u + re.y), Z = Math.abs(F) < X ? Math.sqrt(X * X - F * F) : X * 0.1;
4510
4510
  return _ - re.x - p * Z;
4511
4511
  }, oe = (S) => {
4512
4512
  const _ = je(S, { height: d, facing: p });
4513
4513
  return { x: f + (_.hands.right.x + _.fingertips.right.x) / 2, y: u + (_.hands.right.y + _.fingertips.right.y) / 2 };
4514
4514
  }, q = (S, _, V) => {
4515
- const ee = { ...S, rightWrist: 0, rightElbow: 0, rightShoulder: G(S, _, V) }, L = je(ee, { height: d, facing: p }), Q = { x: f + L.shoulders.right.x, y: u + L.shoulders.right.y }, re = { x: f + L.elbows.right.x, y: u + L.elbows.right.y }, K = oe(ee), X = Math.hypot(re.x - Q.x, re.y - Q.y), D = Math.hypot(K.x - re.x, K.y - re.y), Z = Math.min(X + D - 0.01, Math.max(Math.abs(X - D) + 0.01, Math.hypot(_ - Q.x, V - Q.y))), se = (U) => U * 180 / Math.PI, ae = se(Math.acos((X * X + Z * Z - D * D) / (2 * X * Z))), ie = 180 - se(Math.acos((X * X + D * D - Z * Z) / (2 * X * D)));
4515
+ const ee = { ...S, rightWrist: 0, rightElbow: 0, rightShoulder: G(S, _, V) }, L = je(ee, { height: d, facing: p }), Q = { x: f + L.shoulders.right.x, y: u + L.shoulders.right.y }, re = { x: f + L.elbows.right.x, y: u + L.elbows.right.y }, K = oe(ee), X = Math.hypot(re.x - Q.x, re.y - Q.y), F = Math.hypot(K.x - re.x, K.y - re.y), Z = Math.min(X + F - 0.01, Math.max(Math.abs(X - F) + 0.01, Math.hypot(_ - Q.x, V - Q.y))), se = (U) => U * 180 / Math.PI, ae = se(Math.acos((X * X + Z * Z - F * F) / (2 * X * Z))), ie = 180 - se(Math.acos((X * X + F * F - Z * Z) / (2 * X * F)));
4516
4516
  let $ = { rightShoulder: ee.rightShoulder, rightElbow: 0 }, z = 1 / 0;
4517
4517
  for (const U of [1, -1])
4518
4518
  for (const te of [1, -1]) {
4519
- const B = { rightShoulder: ee.rightShoulder + U * ae, rightElbow: te * ie }, le = { ...S, rightWrist: 0, ...B }, F = oe(le), J = Math.hypot(F.x - _, F.y - V) - je(le, { height: d, facing: p }).elbows.right.y * 1e-3;
4519
+ const B = { rightShoulder: ee.rightShoulder + U * ae, rightElbow: te * ie }, le = { ...S, rightWrist: 0, ...B }, D = oe(le), J = Math.hypot(D.x - _, D.y - V) - je(le, { height: d, facing: p }).elbows.right.y * 1e-3;
4520
4520
  J < z && (z = J, $ = B);
4521
4521
  }
4522
4522
  return $;
@@ -4527,67 +4527,67 @@ function Sn(e, t, o = {}) {
4527
4527
  const Q = S.pose ?? {}, re = h(S.do);
4528
4528
  if (s(S.do)) {
4529
4529
  const K = S.to ?? f, X = K === f ? p : x(K);
4530
- let D = _;
4531
- X !== p ? D = j(_, X, S.mood) : g.turn < 1 ? (D = _ + Ie, O(D, { turn: 1, ...Q }, S.mood)) : (S.mood || S.pose) && O(_ + Ie, Q, S.mood);
4532
- const se = Math.abs(K - f) / Lo(s(S.do), d), ae = S.for ?? Math.max(Ie * 2, se * i(S.do)), ie = D + ae;
4533
- k.push({ time: D, value: S.do }), A.push({ time: D, value: 0 }, { time: D + Ie, value: 1, easing: "ease-out" }), A.push({ time: ie - Ie, value: 1 }, { time: ie, value: 0, easing: "ease-in" }), P.push({ time: D, value: b }, { time: ie, value: b + se }), M.push({ time: D, value: f - c }, { time: ie, value: K - c }), b += se, f = K, O(ie, {}), V = ie;
4530
+ let F = _;
4531
+ X !== p ? F = j(_, X, S.mood) : g.turn < 1 ? (F = _ + Ie, O(F, { turn: 1, ...Q }, S.mood)) : (S.mood || S.pose) && O(_ + Ie, Q, S.mood);
4532
+ const se = Math.abs(K - f) / Lo(s(S.do), d), ae = S.for ?? Math.max(Ie * 2, se * i(S.do)), ie = F + ae;
4533
+ k.push({ time: F, value: S.do }), A.push({ time: F, value: 0 }, { time: F + Ie, value: 1, easing: "ease-out" }), A.push({ time: ie - Ie, value: 1 }, { time: ie, value: 0, easing: "ease-in" }), P.push({ time: F, value: b }, { time: ie, value: b + se }), M.push({ time: F, value: f - c }, { time: ie, value: K - c }), b += se, f = K, O(ie, {}), V = ie;
4534
4534
  } else if (S.do === "zip") {
4535
4535
  const K = S.to ?? f, X = K === f ? p : x(K);
4536
- let D = _;
4537
- X !== p ? D = j(_, X, S.mood) : g.turn < 1 && (D = _ + Ie, O(D, { turn: 1 }, S.mood));
4538
- const Z = hs("windUp", { at: D, from: S.mood ? at(g, S.mood) : g });
4536
+ let F = _;
4537
+ X !== p ? F = j(_, X, S.mood) : g.turn < 1 && (F = _ + Ie, O(F, { turn: 1 }, S.mood));
4538
+ const Z = hs("windUp", { at: F, from: S.mood ? at(g, S.mood) : g });
4539
4539
  H.push(...Z), g = Z[Z.length - 1].pose;
4540
- const se = D + so("windUp"), ae = se + ch, ie = ae + Math.max(fh, Math.abs(K - f) / dh);
4540
+ const se = F + so("windUp"), ae = se + dh, ie = ae + Math.max(uh, Math.abs(K - f) / fh);
4541
4541
  k.push({ time: se, value: "run" }), A.push({ time: se, value: 0 }, { time: se + 80, value: 1, easing: "ease-out" }, { time: ie, value: 1 }, { time: ie + 120, value: 0 }), P.push({ time: se, value: b }, { time: ae, value: b + us, easing: "ease-in" }), b += us + (ie - ae) / fs.run * 1.5, P.push({ time: ie, value: b }), M.push({ time: ae, value: f - c }, { time: ie, value: K - c, easing: "ease-in" }), E.push({ kind: "dust", time: ae, x: f, y: u, length: 900 }), f = K, O(ie, {}), V = ie;
4542
4542
  } else if (S.do === "leap") {
4543
4543
  const K = S.to ?? f, X = S.onto ?? u;
4544
- let D = K === f ? _ : W(_, K, S.mood);
4545
- g.turn < 1 && (D += Ie, O(D, { turn: 1 }, S.mood));
4544
+ let F = K === f ? _ : W(_, K, S.mood);
4545
+ g.turn < 1 && (F += Ie, O(F, { turn: 1 }, S.mood));
4546
4546
  const Z = { leftShoulder: 35, rightShoulder: 35, leftElbow: -50, rightElbow: -50 };
4547
- O(D + uh, { stretch: 0.75, bend: 12, leftHip: 22, rightHip: 22, ...Z }, S.mood, !1);
4548
- const se = D + gh;
4547
+ O(F + gh, { stretch: 0.75, bend: 12, leftHip: 22, rightHip: 22, ...Z }, S.mood, !1);
4548
+ const se = F + ph;
4549
4549
  O(se - 40, { stretch: 0.72 }, void 0, !1), O(se, { stretch: 1.2, bend: -6, leftShoulder: 140, rightShoulder: 140, leftElbow: 20, rightElbow: 20, leftHip: 4, rightHip: 4 }, void 0, !1);
4550
- const ae = Math.hypot(K - f, X - u), ie = S.for ?? Math.min(gs[1], Math.max(gs[0], 300 + ae * ph)), $ = Math.min(u, X) - mh * d, z = Math.sqrt(u - $), U = Math.sqrt(X - $), te = se + ie * z / (z + U), B = se + ie;
4550
+ const ae = Math.hypot(K - f, X - u), ie = S.for ?? Math.min(gs[1], Math.max(gs[0], 300 + ae * mh)), $ = Math.min(u, X) - yh * d, z = Math.sqrt(u - $), U = Math.sqrt(X - $), te = se + ie * z / (z + U), B = se + ie;
4551
4551
  O(te, { stretch: 1, bend: 4, leftHip: -55, leftKnee: -80, rightHip: 55, rightKnee: 80, leftShoulder: 110, rightShoulder: 110 }, void 0, !1), O(B, { stretch: 0.72, bend: 12, leftShoulder: 75, rightShoulder: 75, leftElbow: 0, rightElbow: 0, leftHip: 18, rightHip: 18, leftKnee: 0, rightKnee: 0 }, void 0, !1), O(B + 180, { stretch: 1.05, bend: -3 }, void 0, !1), O(B + 340, { stretch: 1, bend: 0, leftHip: ce.leftHip, rightHip: ce.rightHip, leftShoulder: ce.leftShoulder, rightShoulder: ce.rightShoulder, leftElbow: ce.leftElbow, rightElbow: ce.rightElbow }, void 0, !1), M.push({ time: se, value: f - c }, { time: B, value: K - c }), m.push(
4552
4552
  { time: se, value: u - l },
4553
4553
  { time: te, value: $ - l, easing: "ease-out-quad" },
4554
4554
  { time: B, value: X - l, easing: "ease-in-quad" }
4555
4555
  ), f = K, u = X, E.push({ kind: "dust", time: B, x: f, y: u, length: 500 }), V = B + 340, ee = B;
4556
4556
  } else if (S.do === "point" && S.target) {
4557
- const K = S.target, X = W(_, K.x, S.mood), D = { ...g, ...S.mood ? $e[S.mood] : {}, turn: Math.max(g.turn, 0.6), rightElbow: 0, rightWrist: 0, ...Q }, Z = je(D, { height: d, facing: p }).head.center, se = Math.abs(K.x - (f + Z.x)), ae = K.y - (u + Z.y), ie = X + He;
4558
- O(ie, { ...D, rightShoulder: G(D, K.x, K.y), lookX: 1, lookY: jh(ae / Math.max(1, Math.hypot(se, ae))) * 0.8 }), V = ie + (S.for ?? Ko), ee = ie, L = V;
4557
+ const K = S.target, X = W(_, K.x, S.mood), F = { ...g, ...S.mood ? $e[S.mood] : {}, turn: Math.max(g.turn, 0.6), rightElbow: 0, rightWrist: 0, ...Q }, Z = je(F, { height: d, facing: p }).head.center, se = Math.abs(K.x - (f + Z.x)), ae = K.y - (u + Z.y), ie = X + He;
4558
+ O(ie, { ...F, rightShoulder: G(F, K.x, K.y), lookX: 1, lookY: _h(ae / Math.max(1, Math.hypot(se, ae))) * 0.8 }), V = ie + (S.for ?? Ko), ee = ie, L = V;
4559
4559
  } else if (S.do === "swipe") {
4560
- const K = S.target ?? { x: f + p * d * 0.5, y: u - d * 0.6 }, X = x(K.x), D = W(_, K.x, S.mood), Z = X === 1 ? K.left ?? K.x : K.right ?? K.x, se = X === 1 ? K.right ?? K.x : K.left ?? K.x, ae = { ...g, turn: 1, lean: -10, bend: -8, rightElbow: 40, lookX: 1, ...Q };
4561
- O(D + Dt, { ...ae, rightShoulder: G(ae, f - p * d * 0.3, u - d * 1.1) }, S.mood, !1);
4560
+ const K = S.target ?? { x: f + p * d * 0.5, y: u - d * 0.6 }, X = x(K.x), F = W(_, K.x, S.mood), Z = X === 1 ? K.left ?? K.x : K.right ?? K.x, se = X === 1 ? K.right ?? K.x : K.left ?? K.x, ae = { ...g, turn: 1, lean: -10, bend: -8, rightElbow: 40, lookX: 1, ...Q };
4561
+ O(F + Ft, { ...ae, rightShoulder: G(ae, f - p * d * 0.3, u - d * 1.1) }, S.mood, !1);
4562
4562
  const ie = { ...g, lean: 6, bend: 4, rightElbow: 0, rightWrist: 0 }, $ = { ...g, lean: 14, bend: 12, rightElbow: 0, rightWrist: 0 };
4563
- I(D, Y(ie, Z, K.y, "arm"), Dt + Oo), O(D + Dt + Oo, { lean: -12 }, void 0, !1);
4564
- const z = D + Dt + Oo + 80;
4563
+ I(F, Y(ie, Z, K.y, "arm"), Ft + Oo), O(F + Ft + Oo, { lean: -12 }, void 0, !1);
4564
+ const z = F + Ft + Oo + 80;
4565
4565
  O(z, { ...ie, rightShoulder: G(ie, Z, K.y) }, void 0, !1);
4566
- const U = z + (S.for ?? Math.max(yh, Math.abs(se - Z) / bh));
4566
+ const U = z + (S.for ?? Math.max(bh, Math.abs(se - Z) / wh));
4567
4567
  M.push({ time: z, value: f - c }), f = Y($, se, K.y, "arm"), M.push({ time: U, value: f - c }), O(U, { ...$, rightShoulder: G($, se, K.y) }, void 0, !1), O(U + Ho, { lean: 16, bend: 14, rightShoulder: G(g, se + X * d * 0.4, K.y + d * 0.25) }, void 0, !1), O(U + Ho + ps, { lean: 0, bend: 0, rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow }), V = U + Ho + ps, ee = z, L = U;
4568
4568
  } else if (S.do === "grab" && S.target) {
4569
- const K = S.target, X = W(_, K.x, S.mood), D = K.y > u - d * 0.5, Z = {
4569
+ const K = S.target, X = W(_, K.x, S.mood), F = K.y > u - d * 0.5, Z = {
4570
4570
  ...g,
4571
4571
  turn: 1,
4572
4572
  rightElbow: 0,
4573
- bend: D ? 35 : 0,
4574
- lean: D ? 12 : 0,
4575
- stretch: D ? 0.75 : 1,
4573
+ bend: F ? 35 : 0,
4574
+ lean: F ? 12 : 0,
4575
+ stretch: F ? 0.75 : 1,
4576
4576
  lookX: 1,
4577
- lookY: D ? 0.8 : 0,
4577
+ lookY: F ? 0.8 : 0,
4578
4578
  ...Q
4579
- }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + wh;
4579
+ }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + kh;
4580
4580
  O(ae, { ...Z, rightShoulder: G(Z, K.x, K.y) }, S.mood, !1), O(ae + 120, {}, void 0, !1), O(ae + ms, { bend: 0, lean: -3, stretch: 1, rightShoulder: 165, rightElbow: 20, lookY: -0.6 }), V = ae + ms + 150, ee = ae;
4581
4581
  } else if (S.do === "throw") {
4582
- const K = S.target?.x ?? S.to ?? f + p * d, X = W(_, K, S.mood), D = { ...g, turn: 1, lean: -12, bend: -10, rightElbow: 60, stretch: 0.95, lookX: 1, lookY: -0.3, ...Q };
4583
- O(X + Io, { ...D, rightShoulder: G(D, f - p * d * 0.4, u - d * 1.05) }, S.mood, !1), O(X + Io + ys, { lean: -14 }, void 0, !1);
4584
- const Z = X + Io + ys + kh, se = { ...g, lean: 14, bend: 12, rightElbow: 0, stretch: 1.04 };
4582
+ const K = S.target?.x ?? S.to ?? f + p * d, X = W(_, K, S.mood), F = { ...g, turn: 1, lean: -12, bend: -10, rightElbow: 60, stretch: 0.95, lookX: 1, lookY: -0.3, ...Q };
4583
+ O(X + Io, { ...F, rightShoulder: G(F, f - p * d * 0.4, u - d * 1.05) }, S.mood, !1), O(X + Io + ys, { lean: -14 }, void 0, !1);
4584
+ const Z = X + Io + ys + vh, se = { ...g, lean: 14, bend: 12, rightElbow: 0, stretch: 1.04 };
4585
4585
  H.push({ time: Z, pose: g = { ...se, rightShoulder: G(se, f + p * d, u - d * 1.1) }, easing: "ease-in", act: !1 }), O(Z + xo, { lean: 18, bend: 14, rightShoulder: 55, stretch: 1 }, void 0, !1), O(Z + xo + bs, { lean: 0, bend: 0, rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, lookY: 0 }), V = Z + xo + bs, ee = Z, L = Z;
4586
4586
  } else if (S.do === "kick" && S.target) {
4587
- const K = S.target, X = W(_, K.x, S.mood), D = { ...g, turn: 1, lean: -12, bend: -6, rightKnee: 0, leftShoulder: 100, rightShoulder: 70 }, Z = I(X, Y(D, K.x, K.y, "leg"), vh), se = { leftShoulder: 70, rightShoulder: 50, leftElbow: -20, rightElbow: 20 };
4587
+ const K = S.target, X = W(_, K.x, S.mood), F = { ...g, turn: 1, lean: -12, bend: -6, rightKnee: 0, leftShoulder: 100, rightShoulder: 70 }, Z = I(X, Y(F, K.x, K.y, "leg"), Sh), se = { leftShoulder: 70, rightShoulder: 50, leftElbow: -20, rightElbow: 20 };
4588
4588
  O(Z + ws, { turn: 1, lean: 8, bend: 6, rightHip: -40, rightKnee: 80, lookX: 1, lookY: 0.7, ...se, ...Q }, S.mood, !1);
4589
- const ae = Z + ws + Sh, ie = G(D, K.x, K.y, "leg");
4590
- H.push({ time: ae, pose: g = { ...g, ...D, rightHip: ie }, easing: "ease-in", act: !1 }), O(ae + jo, { lean: -15, rightHip: ie + 20 }, void 0, !1), O(ae + jo + ks, {
4589
+ const ae = Z + ws + Mh, ie = G(F, K.x, K.y, "leg");
4590
+ H.push({ time: ae, pose: g = { ...g, ...F, rightHip: ie }, easing: "ease-in", act: !1 }), O(ae + jo, { lean: -15, rightHip: ie + 20 }, void 0, !1), O(ae + jo + ks, {
4591
4591
  lean: 0,
4592
4592
  bend: 0,
4593
4593
  rightHip: ce.rightHip,
@@ -4599,59 +4599,59 @@ function Sn(e, t, o = {}) {
4599
4599
  lookY: 0
4600
4600
  }), V = ae + jo + ks, ee = ae;
4601
4601
  } else if (S.do === "put" && S.target) {
4602
- const K = S.target, X = W(_, K.x, S.mood), D = K.y > u - d * 0.5, Z = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, bend: D ? 35 : 0, lean: D ? 12 : 0, stretch: D ? 0.75 : 1, lookX: 1, lookY: D ? 0.8 : 0, ...Q }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + Mh;
4602
+ const K = S.target, X = W(_, K.x, S.mood), F = K.y > u - d * 0.5, Z = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, bend: F ? 35 : 0, lean: F ? 12 : 0, stretch: F ? 0.75 : 1, lookX: 1, lookY: F ? 0.8 : 0, ...Q }, ae = I(X, Y(Z, K.x, K.y, "arm"), vt) + $h;
4603
4603
  O(ae, { ...Z, rightShoulder: G(Z, K.x, K.y) }, S.mood, !1), O(ae + _o, {}, void 0, !1), O(ae + _o + vs, { bend: 0, lean: 0, stretch: 1, rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, lookY: 0 }), V = ae + _o + vs, ee = ae;
4604
4604
  } else if (S.do === "write" && S.target) {
4605
- const K = S.target, X = K.left ?? K.x, D = K.right ?? K.x, Z = W(_, (X + D) / 2, S.mood), se = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, ...$e.thinking, lookX: 1, lookY: 0, ...Q }, ae = (F) => Y(se, F, K.y, "arm") + p * d * 0.08, ie = (F) => {
4606
- const R = oe({ ...se, ...q(se, F, K.y), rightWrist: 0 });
4607
- return Math.hypot(R.x - F, R.y - K.y) < 2;
4608
- }, $ = p === 1 ? X : D, z = I(Z, ae((X + D) / 2), vt), U = !ie(X) || !ie(D), te = U ? I(z, ae(X), vt) + Ss : z + Ss;
4605
+ const K = S.target, X = K.left ?? K.x, F = K.right ?? K.x, Z = W(_, (X + F) / 2, S.mood), se = { ...g, turn: 1, rightElbow: 0, rightWrist: 0, ...$e.thinking, lookX: 1, lookY: 0, ...Q }, ae = (D) => Y(se, D, K.y, "arm") + p * d * 0.08, ie = (D) => {
4606
+ const R = oe({ ...se, ...q(se, D, K.y), rightWrist: 0 });
4607
+ return Math.hypot(R.x - D, R.y - K.y) < 2;
4608
+ }, $ = p === 1 ? X : F, z = I(Z, ae((X + F) / 2), vt), U = !ie(X) || !ie(F), te = U ? I(z, ae(X), vt) + Ss : z + Ss;
4609
4609
  O(te, { ...se, ...q(se, U ? X : $, K.y) }, S.mood, !1);
4610
- const B = S.for ?? Math.max(Eh, Math.abs(D - X) * $h);
4610
+ const B = S.for ?? Math.max(Ah, Math.abs(F - X) * Eh);
4611
4611
  U && M.push({ time: te, value: f - c });
4612
- for (let F = Ms, R = 0; F <= B; F += Ms, R++) {
4613
- const J = X + (D - X) * Math.min(F, B) / B;
4614
- U && (f = ae(J), M.push({ time: te + F, value: f - c }));
4612
+ for (let D = Ms, R = 0; D <= B; D += Ms, R++) {
4613
+ const J = X + (F - X) * Math.min(D, B) / B;
4614
+ U && (f = ae(J), M.push({ time: te + D, value: f - c }));
4615
4615
  const he = (R % 2 === 0 ? -1 : 1) * d * 0.02;
4616
- O(te + F, q(se, J, K.y + he), void 0, !1);
4616
+ O(te + D, q(se, J, K.y + he), void 0, !1);
4617
4617
  }
4618
4618
  const le = te + B;
4619
- O(le, q(se, D, K.y), void 0, !1), O(le + $s, { rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, ...$e.happy }), V = le + $s, ee = te, L = le;
4619
+ O(le, q(se, F, K.y), void 0, !1), O(le + $s, { rightShoulder: ce.rightShoulder, rightElbow: ce.rightElbow, ...$e.happy }), V = le + $s, ee = te, L = le;
4620
4620
  } else if (S.do === "push" && S.target) {
4621
- const K = S.target, X = S.to ?? K.x, D = W(_, f + (X >= K.x ? 1 : -1), S.mood), Z = p === 1 ? K.left ?? K.x : K.right ?? K.x, se = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...Q }, ae = Y(se, Z, K.y, "arm"), ie = I(D, ae + p * d * 0.06, vt), $ = q(se, Z, K.y), z = { ...se, ...$, leftShoulder: -$.rightShoulder, leftElbow: -$.rightElbow }, U = ie + Ah;
4621
+ const K = S.target, X = S.to ?? K.x, F = W(_, f + (X >= K.x ? 1 : -1), S.mood), Z = p === 1 ? K.left ?? K.x : K.right ?? K.x, se = { ...g, turn: 1, lean: 16, bend: 8, rightWrist: 0, leftWrist: 0, lookX: 1, ...Q }, ae = Y(se, Z, K.y, "arm"), ie = I(F, ae + p * d * 0.06, vt), $ = q(se, Z, K.y), z = { ...se, ...$, leftShoulder: -$.rightShoulder, leftElbow: -$.rightElbow }, U = ie + Th;
4622
4622
  O(U, z, S.mood, !1);
4623
- const te = Math.abs(X - K.x), B = U + (S.for ?? Math.max(600, te / Th)), le = te / Lo("shove", d);
4623
+ const te = Math.abs(X - K.x), B = U + (S.for ?? Math.max(600, te / Ph)), le = te / Lo("shove", d);
4624
4624
  k.push({ time: U, value: "shove" }), A.push({ time: U, value: 0 }, { time: U + Ie, value: 1, easing: "ease-out" }, { time: B - Ie, value: 1 }, { time: B, value: 0, easing: "ease-in" }), P.push({ time: U, value: b }, { time: B, value: b + le }), b += le, M.push({ time: U, value: f - c }, { time: B, value: f + (X - K.x) - c }), f += X - K.x, O(B, {}, void 0, !1), O(B + Es, { lean: 0, bend: 0, rightShoulder: ce.rightShoulder, leftShoulder: ce.leftShoulder, rightElbow: ce.rightElbow, leftElbow: ce.leftElbow }), V = B + Es, ee = U, L = B;
4625
4625
  } else if (re) {
4626
- const K = S.mood ? at(g, S.mood) : g, X = re.steps(K, S), D = xr(X, { at: _, from: K });
4627
- H.push(...D), g = D[D.length - 1].pose, V = _ + Math.max(hh(X), S.for ?? 0);
4626
+ const K = S.mood ? at(g, S.mood) : g, X = re.steps(K, S), F = xr(X, { at: _, from: K });
4627
+ H.push(...F), g = F[F.length - 1].pose, V = _ + Math.max(ch(X), S.for ?? 0);
4628
4628
  } else if (As(S.do)) {
4629
4629
  const K = hs(S.do, { at: _, from: S.mood ? at(g, S.mood) : g });
4630
4630
  H.push(...K), g = K[K.length - 1].pose, V = _ + so(S.do), S.do === "take" && E.push({ kind: "dust", time: _ + 900, x: f, y: u, length: 500 }), S.do === "land" && E.push({ kind: "dust", time: _ + 120, x: f, y: u, length: 500 });
4631
4631
  } else if (S.do === "look" || S.do === "face") {
4632
- const K = S.toward ?? "viewer", X = S.for ?? Ph;
4632
+ const K = S.toward ?? "viewer", X = S.for ?? Oh;
4633
4633
  if (K === "viewer") O(_ + He, { turn: 0, lookX: 0, lookY: 0, ...Q }, S.mood);
4634
4634
  else if (K === "ahead") O(_ + He, { turn: S.do === "face" ? 1 : 0.6, lookX: 1, ...Q }, S.mood);
4635
4635
  else if (K === "back") O(_ + He, { turn: 0.2, lookX: -1, ...Q }, S.mood);
4636
4636
  else {
4637
- const D = x(K);
4638
- D !== p && S.do === "face" ? (j(_, D, S.mood), O(_ + nt + 1, { lookX: 1, ...Q })) : D !== p ? O(_ + He, { turn: 0.25, lookX: -1, ...Q }, S.mood) : O(_ + He, { turn: S.do === "face" ? 1 : 0.6, lookX: 1, ...Q }, S.mood);
4637
+ const F = x(K);
4638
+ F !== p && S.do === "face" ? (j(_, F, S.mood), O(_ + nt + 1, { lookX: 1, ...Q })) : F !== p ? O(_ + He, { turn: 0.25, lookX: -1, ...Q }, S.mood) : O(_ + He, { turn: S.do === "face" ? 1 : 0.6, lookX: 1, ...Q }, S.mood);
4639
4639
  }
4640
4640
  V = _ + Math.max(X, He);
4641
- } else if (Ih(S.do) || S.do === "stand") {
4642
- const K = S.do === "stand" ? o.rest ?? ce : Ae[S.do], X = K.turn !== ce.turn ? K.turn : g.turn, D = S.mood ? $e[S.mood] : { lookX: g.lookX, lookY: g.lookY };
4643
- O(_ + He, { ...K, turn: X, ...D, ...Q }), V = _ + (S.for ?? Ko);
4641
+ } else if (xh(S.do) || S.do === "stand") {
4642
+ const K = S.do === "stand" ? o.rest ?? ce : Ae[S.do], X = K.turn !== ce.turn ? K.turn : g.turn, F = S.mood ? $e[S.mood] : { lookX: g.lookX, lookY: g.lookY };
4643
+ O(_ + He, { ...K, turn: X, ...F, ...Q }), V = _ + (S.for ?? Ko);
4644
4644
  } else {
4645
- const K = S.for ?? (S.say ? xh(S.say) : Ko);
4645
+ const K = S.for ?? (S.say ? jh(S.say) : Ko);
4646
4646
  (S.mood || S.pose) && O(_ + Math.min(He, K / 2), Q, S.mood), V = _ + K;
4647
4647
  }
4648
4648
  if (S.say) {
4649
4649
  const K = s(S.do) || As(S.do) || re ? _ : _ + Math.min(150, (V - _) / 4), X = s(S.do) ? V : Math.max(K + 200, V - 100);
4650
- v.push({ text: S.say, start: K, end: X }), S.do === "say" && Ch(H, g, K, X);
4650
+ v.push({ text: S.say, start: K, end: X }), S.do === "say" && Nh(H, g, K, X);
4651
4651
  }
4652
4652
  S.onto !== void 0 && S.do !== "leap" && S.onto !== u && (m.push({ time: _, value: u - l }, { time: V, value: S.onto - l, easing: "ease-in-out" }), u = S.onto), V > H[H.length - 1].time && H.push({ time: V, pose: g }), w.push({ start: _, end: V, ...ee !== void 0 ? { contact: ee } : {}, ...L !== void 0 ? { release: L } : {} }), T = V;
4653
4653
  }
4654
- const C = th(e, Kh(H), o), N = [
4654
+ const C = oh(e, Ch(H), o), N = [
4655
4655
  { id: `${e}-x`, target: e, property: "x", keyframes: M },
4656
4656
  { id: `${e}-y`, target: e, property: "y", keyframes: m },
4657
4657
  { id: `${e}-walk`, target: e, property: "walk", keyframes: P },
@@ -4671,16 +4671,16 @@ function Sn(e, t, o = {}) {
4671
4671
  effects: E
4672
4672
  };
4673
4673
  }
4674
- const jh = (e) => Math.max(-1, Math.min(1, e)), _h = 30;
4675
- function Kh(e) {
4674
+ const _h = (e) => Math.max(-1, Math.min(1, e)), Kh = 30;
4675
+ function Ch(e) {
4676
4676
  const t = [];
4677
4677
  for (const o of e) {
4678
4678
  const n = t[t.length - 1];
4679
- n && o.time - n.time < _h ? t[t.length - 1] = { ...o, time: n.time } : t.push(o);
4679
+ n && o.time - n.time < Kh ? t[t.length - 1] = { ...o, time: n.time } : t.push(o);
4680
4680
  }
4681
4681
  return t;
4682
4682
  }
4683
- function Ch(e, t, o, n) {
4683
+ function Nh(e, t, o, n) {
4684
4684
  const r = e.filter((h) => h.time > o), s = e.filter((h) => h.time <= o), i = [];
4685
4685
  for (let h = o + 520, c = 0; h < n - 520 / 2; h += 520, c++) {
4686
4686
  const l = c % 2 === 0 ? 3 : -2;
@@ -4696,16 +4696,16 @@ function Cr(e, t, o) {
4696
4696
  }
4697
4697
  return i;
4698
4698
  }
4699
- const At = ["start", "contact", "release", "end"], Nh = ["surface", "edit", "anchor", "at", "until"], Rh = ["carry"], Yt = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "surface" in e && "anchor" in e, Wh = (e) => e.then === void 0 ? [] : Array.isArray(e.then) ? e.then : [e.then];
4700
- function nf(e, t, o, n = {}) {
4701
- const a = zh(o, t, n).filter((f) => f.level === "error");
4699
+ const At = ["start", "contact", "release", "end"], Rh = ["surface", "edit", "anchor", "at", "until"], Wh = ["carry"], Yt = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "surface" in e && "anchor" in e, zh = (e) => e.then === void 0 ? [] : Array.isArray(e.then) ? e.then : [e.then];
4700
+ function sf(e, t, o, n = {}) {
4701
+ const a = Lh(o, t, n).filter((f) => f.level === "error");
4702
4702
  if (a.length > 0)
4703
4703
  throw new Error(`surfaceScript: ${a.length} problem(s) in the beats:
4704
4704
  ${a.map((f) => ` ${f.beat >= 0 ? `beat ${f.beat}: ` : ""}${f.message}`).join(`
4705
4705
  `)}`);
4706
- const r = o.map((f) => Nr(f, t)), s = Sn(e, r, n), i = Lh(r, s.beats, n), h = n.ground ?? 0, c = (f) => n.ride === !1 ? f : Object.values(t).reduce((u, p) => p.ride(u, e, { ground: h }), f);
4706
+ const r = o.map((f) => Nr(f, t)), s = Sn(e, r, n), i = Fh(r, s.beats, n), h = n.ground ?? 0, c = (f) => n.ride === !1 ? f : Object.values(t).reduce((u, p) => p.ride(u, e, { ground: h }), f);
4707
4707
  o.forEach((f, u) => {
4708
- for (const p of Wh(f)) {
4708
+ for (const p of zh(f)) {
4709
4709
  const g = (m) => new Error(`surfaceScript: beat ${u} (${f.do}), ${p.edit} on ${p.surface}: ${m}`), b = (m, P) => {
4710
4710
  const A = typeof m == "object" ? m.beat : u, k = (typeof m == "object" ? m.at : m) ?? P ?? "start", y = i[A][k];
4711
4711
  if (y === void 0) {
@@ -4728,7 +4728,7 @@ ${a.map((f) => ` ${f.beat >= 0 ? `beat ${f.beat}: ` : ""}${f.message}`).join(`
4728
4728
  T.follow(P, A);
4729
4729
  continue;
4730
4730
  }
4731
- const m = Object.fromEntries(Object.entries(p).filter(([P]) => !Nh.includes(P)));
4731
+ const m = Object.fromEntries(Object.entries(p).filter(([P]) => !Rh.includes(P)));
4732
4732
  T.edit(p.edit, p.anchor, { ...m, at: H, ...M !== void 0 ? { duration: M - H } : {} });
4733
4733
  } catch (m) {
4734
4734
  throw g(m.message);
@@ -4738,7 +4738,7 @@ ${a.map((f) => ` ${f.beat >= 0 ? `beat ${f.beat}: ` : ""}${f.message}`).join(`
4738
4738
  const l = c(s.tracks), d = Object.entries(t).flatMap(([f, u]) => u.tracks(f));
4739
4739
  return { ...s, tracks: [...l, ...d], figureTracks: l };
4740
4740
  }
4741
- function zh(e, t, o = {}) {
4741
+ function Lh(e, t, o = {}) {
4742
4742
  if (!Array.isArray(e)) return ro(e, o);
4743
4743
  const n = [], a = Object.keys(t), r = (c, l, d) => {
4744
4744
  const f = typeof l == "string" ? t[l] : void 0;
@@ -4777,7 +4777,7 @@ function zh(e, t, o = {}) {
4777
4777
  }
4778
4778
  const p = u, g = r(l, p.surface, "`then`");
4779
4779
  if (!g) return;
4780
- const b = `\`then\` (${String(p.edit)} on ${String(p.surface)})`, T = [...Object.keys(g.about.edits), ...Rh];
4780
+ const b = `\`then\` (${String(p.edit)} on ${String(p.surface)})`, T = [...Object.keys(g.about.edits), ...Wh];
4781
4781
  if (typeof p.edit != "string" || !T.includes(p.edit)) {
4782
4782
  n.push({ level: "error", beat: l, message: `\`then\`: ${fe("edit", p.edit, T)}` });
4783
4783
  return;
@@ -4800,7 +4800,7 @@ function Nr(e, t, o = !1) {
4800
4800
  }, s = { ...a };
4801
4801
  return Yt(e.target) && (s.target = r(e.target)), Yt(e.to) && (s.to = r(e.to).x), Yt(e.onto) && (s.onto = r(e.onto).top), s;
4802
4802
  }
4803
- function Lh(e, t, o) {
4803
+ function Fh(e, t, o) {
4804
4804
  let n = 0;
4805
4805
  return e.map((a) => {
4806
4806
  const r = vn([a], o.actions).length, s = t.slice(n, n + r);
@@ -4814,7 +4814,7 @@ function Lh(e, t, o) {
4814
4814
  };
4815
4815
  });
4816
4816
  }
4817
- function sf(e) {
4817
+ function rf(e) {
4818
4818
  const t = { actions: e.actions, gaits: e.gaits }, o = _r(t);
4819
4819
  if (o.length > 0) throw new Error(`persona "${e.name}": ${o.join(" ")}`);
4820
4820
  const n = [...Object.keys(Ke), ...Object.keys(e.gaits ?? {})], a = e.gait ?? "walk";
@@ -4861,17 +4861,17 @@ function sf(e) {
4861
4861
  };
4862
4862
  }
4863
4863
  const Dh = /* @__PURE__ */ new Set(["x", "y", "walking", "gait"]), Ts = 0.215 + 0.205;
4864
- function Fh(e, t, o = 1) {
4864
+ function qh(e, t, o = 1) {
4865
4865
  const { points: n } = Oe(e, ye), a = n["hip.left"], r = n["knee.left"], s = n["ankle.left"], i = a && r && s ? Math.hypot(r.x - a.x, r.y - a.y) + Math.hypot(s.x - r.x, s.y - r.y) : Ts * e.height;
4866
4866
  return Us(t, i / Ts, o);
4867
4867
  }
4868
- function rf(e, t, o, n = {}) {
4869
- const a = Sn(e, o, { ...n, height: t.height, reach: n.reach ?? qh(t) }), r = a.tracks.find((T) => T.property === "facing")?.keyframes ?? [], s = (T) => {
4868
+ function af(e, t, o, n = {}) {
4869
+ const a = Sn(e, o, { ...n, height: t.height, reach: n.reach ?? Bh(t) }), r = a.tracks.find((T) => T.property === "facing")?.keyframes ?? [], s = (T) => {
4870
4870
  let H = n.facing ?? 1;
4871
4871
  for (const M of r) M.time <= T && (H = M.value);
4872
4872
  return H;
4873
4873
  }, i = Vs(a.keys), h = a.keys.map((T, H) => {
4874
- const M = Si(i[H]);
4874
+ const M = Mi(i[H]);
4875
4875
  return {
4876
4876
  time: T.time,
4877
4877
  pose: s(T.time) < 0 ? pa(M) : M,
@@ -4879,16 +4879,16 @@ function rf(e, t, o, n = {}) {
4879
4879
  ...T.act === !1 ? { act: !1 } : {}
4880
4880
  };
4881
4881
  }), { rest: c, start: l, ...d } = n;
4882
- Yh(h, i, o, a, t, s, n);
4883
- const f = oh(e, h, d), u = yn(e, f, a.lines, { energy: n.energy }), p = a.tracks.filter((T) => Dh.has(T.property)), g = a.tracks.find((T) => T.property === "walk");
4884
- return { tracks: g ? [...u, ...p, Qh(e, g, a.tracks, t, n)] : [...u, ...p], duration: a.duration, lines: a.lines, keys: h, beats: a.beats, effects: a.effects };
4882
+ Uh(h, i, o, a, t, s, n);
4883
+ const f = nh(e, h, d), u = yn(e, f, a.lines, { energy: n.energy }), p = a.tracks.filter((T) => Dh.has(T.property)), g = a.tracks.find((T) => T.property === "walk");
4884
+ return { tracks: g ? [...u, ...p, ec(e, g, a.tracks, t, n)] : [...u, ...p], duration: a.duration, lines: a.lines, keys: h, beats: a.beats, effects: a.effects };
4885
4885
  }
4886
- function qh(e) {
4886
+ function Bh(e) {
4887
4887
  const t = Qs({ "arm.left.spread": 90, "arm.left.elbow": 0, "arm.left.bend": 0, "leg.left.knee": 0 }), o = Oe(e, t).points, n = Math.hypot(o["hand.left"].x - o["shoulder.left"].x, o["hand.left"].y - o["shoulder.left"].y), a = Math.hypot(o["toe.left"].x - o["hip.left"].x, o["toe.left"].y - o["hip.left"].y), r = je({ ...ce, rightShoulder: 90, rightElbow: 0, rightWrist: 0 }, { height: e.height, facing: 1 }), s = je({ ...ce, rightHip: 90, rightKnee: 0 }, { height: e.height, facing: 1 }), i = { x: (r.hands.right.x + r.fingertips.right.x) / 2, y: (r.hands.right.y + r.fingertips.right.y) / 2 }, h = Math.hypot(i.x - r.shoulders.right.x, i.y - r.shoulders.right.y), c = Math.hypot(s.feet.right.x - s.hip.x, s.feet.right.y - s.hip.y);
4888
4888
  return { arm: h > 0 ? n / h : 1, leg: c > 0 ? a / c : 1 };
4889
4889
  }
4890
- const Bh = { point: "arm", grab: "arm", put: "arm", write: "arm", swipe: "arm", push: "arm", kick: "leg" }, Gh = /* @__PURE__ */ new Set(["point", "grab", "put", "kick"]);
4891
- function Yh(e, t, o, n, a, r, s) {
4890
+ const Gh = { point: "arm", grab: "arm", put: "arm", write: "arm", swipe: "arm", push: "arm", kick: "leg" }, Yh = /* @__PURE__ */ new Set(["point", "grab", "put", "kick"]);
4891
+ function Uh(e, t, o, n, a, r, s) {
4892
4892
  const i = n.beats;
4893
4893
  if (o.length !== i.length) return;
4894
4894
  const h = new ve({ id: "placed", tracks: n.tracks.filter((l) => l.property === "x" || l.property === "y") }), c = (l) => {
@@ -4896,17 +4896,17 @@ function Yh(e, t, o, n, a, r, s) {
4896
4896
  return { x: (s.from ?? 0) + Number(d?.get("x") ?? 0), y: (s.ground ?? 0) + Number(d?.get("y") ?? 0) };
4897
4897
  };
4898
4898
  o.forEach((l, d) => {
4899
- const f = Bh[l.do], u = i[d];
4899
+ const f = Gh[l.do], u = i[d];
4900
4900
  if (!f || u.contact === void 0 || l.do !== "swipe" && !l.target) return;
4901
4901
  const p = u.contact, g = u.release ?? u.contact;
4902
4902
  e.forEach((b, T) => {
4903
4903
  if (b.time < p - 1 || b.time > g + 1) return;
4904
- const H = r(b.time), M = je(t[T], { height: a.height, facing: H < 0 ? -1 : 1 }), m = c(b.time), P = Gh.has(l.do) && l.target ? { x: l.target.x - m.x, y: l.target.y - m.y } : void 0, A = { x: (M.hands.right.x + M.fingertips.right.x) / 2, y: (M.hands.right.y + M.fingertips.right.y) / 2 }, k = P ?? (f === "arm" ? A : M.toes.right), y = H < 0 ? "right" : "left", v = `${f}.${y}`;
4904
+ const H = r(b.time), M = je(t[T], { height: a.height, facing: H < 0 ? -1 : 1 }), m = c(b.time), P = Yh.has(l.do) && l.target ? { x: l.target.x - m.x, y: l.target.y - m.y } : void 0, A = { x: (M.hands.right.x + M.fingertips.right.x) / 2, y: (M.hands.right.y + M.fingertips.right.y) / 2 }, k = P ?? (f === "arm" ? A : M.toes.right), y = H < 0 ? "right" : "left", v = `${f}.${y}`;
4905
4905
  let w = b.pose;
4906
4906
  if (l.do === "point")
4907
4907
  w = Le(a, w, v, k);
4908
4908
  else if (f === "arm")
4909
- w = Le(a, Zh(a, w, y, k), v, k);
4909
+ w = Le(a, Qh(a, w, y, k), v, k);
4910
4910
  else
4911
4911
  for (let E = 0; E < 3; E++) {
4912
4912
  const O = Oe(a, w).points, j = O[`ankle.${y}`], x = O[`toe.${y}`];
@@ -4916,23 +4916,23 @@ function Yh(e, t, o, n, a, r, s) {
4916
4916
  });
4917
4917
  });
4918
4918
  }
4919
- function Uh(e, t) {
4919
+ function Xh(e, t) {
4920
4920
  const o = Qs({ [`arm.${t}.spread`]: 90, [`arm.${t}.elbow`]: 0, [`arm.${t}.bend`]: 0 }), n = Oe(e, o).points;
4921
4921
  return Math.hypot(n[`hand.${t}`].x - n[`shoulder.${t}`].x, n[`hand.${t}`].y - n[`shoulder.${t}`].y);
4922
4922
  }
4923
- const Xh = 5, Vh = 4, Jh = 8;
4924
- function Zh(e, t, o, n) {
4925
- const a = Uh(e, o) * 0.9, r = (i) => {
4923
+ const Vh = 5, Jh = 4, Zh = 8;
4924
+ function Qh(e, t, o, n) {
4925
+ const a = Xh(e, o) * 0.9, r = (i) => {
4926
4926
  const h = Oe(e, i).points[`shoulder.${o}`];
4927
4927
  return Math.hypot(n.x - h.x, n.y - h.y) <= a;
4928
4928
  };
4929
4929
  if (r(t)) return t;
4930
4930
  let s = t;
4931
- for (let i = 1; i <= Jh; i++)
4932
- if (s = { ...t, lean: (t.lean ?? 0) + Xh * i, bend: (t.bend ?? 0) + Vh * i }, r(s)) return s;
4931
+ for (let i = 1; i <= Zh; i++)
4932
+ if (s = { ...t, lean: (t.lean ?? 0) + Vh * i, bend: (t.bend ?? 0) + Jh * i }, r(s)) return s;
4933
4933
  return s;
4934
4934
  }
4935
- function Qh(e, t, o, n, a) {
4935
+ function ec(e, t, o, n, a) {
4936
4936
  const r = o.find((d) => d.property === "gait"), s = r ? new ve({ id: `${e}-gait-of`, tracks: [r] }) : void 0, i = (d) => {
4937
4937
  const f = s?.getStateAtTime(d).values.get(e)?.get("gait");
4938
4938
  if (typeof f == "string")
@@ -4941,7 +4941,7 @@ function Qh(e, t, o, n, a) {
4941
4941
  let l = h[0]?.value ?? 0;
4942
4942
  return h.forEach((d, f) => {
4943
4943
  if (f > 0) {
4944
- const u = h[f - 1], p = i((u.time + d.time) / 2), g = Lo(p, n.height), b = Fh(n, p);
4944
+ const u = h[f - 1], p = i((u.time + d.time) / 2), g = Lo(p, n.height), b = qh(n, p);
4945
4945
  l += (d.value - u.value) * (b > 0 ? g / b : 1);
4946
4946
  } else
4947
4947
  l = d.value;
@@ -4961,7 +4961,7 @@ function Ps(e, t) {
4961
4961
  s !== i && o.push(Zo(r, n, t)), s && o.push(n);
4962
4962
  }), o.length >= 3 ? o : [];
4963
4963
  }
4964
- function ec(e, t) {
4964
+ function tc(e, t) {
4965
4965
  if (e.every((a) => dt(a, t))) return [e];
4966
4966
  const o = [];
4967
4967
  let n = [];
@@ -4980,18 +4980,18 @@ function Os(e, t, o) {
4980
4980
  const a = Math.round(n / o);
4981
4981
  return Array.from({ length: a + 1 }, (r, s) => e + n * s / a);
4982
4982
  }
4983
- function tc(e, t, o) {
4983
+ function oc(e, t, o) {
4984
4984
  const n = (a, r) => Math.max(0, Math.min(a.length - 2, a.findIndex((s, i) => i > 0 && r <= s) - 1));
4985
4985
  return [n(e, o[0]), n(t, o[2])];
4986
4986
  }
4987
- function oc(e, t) {
4987
+ function nc(e, t) {
4988
4988
  const o = (n) => {
4989
4989
  const a = [t[0] * n[0] + t[4] * n[1] + t[8] * n[2], t[1] * n[0] + t[5] * n[1] + t[9] * n[2], t[2] * n[0] + t[6] * n[1] + t[10] * n[2]], r = Math.hypot(...a) || 1;
4990
4990
  return [a[0] / r, a[1] / r, a[2] / r];
4991
4991
  };
4992
4992
  return { ...e, vertices: e.vertices.map((n) => ne.transformPoint(t, n)), faces: e.faces.map((n) => ({ corners: n.corners, normal: o(n.normal) })) };
4993
4993
  }
4994
- function Ft(e, t, o, n) {
4994
+ function Dt(e, t, o, n) {
4995
4995
  const a = (s) => (s[t] - o) * n >= 0;
4996
4996
  if (e.every(a)) return e;
4997
4997
  const r = [];
@@ -5004,7 +5004,7 @@ function Ft(e, t, o, n) {
5004
5004
  a(s) && r.push(s);
5005
5005
  }), r.length >= 3 ? r : [];
5006
5006
  }
5007
- function nc(e, t, o) {
5007
+ function sc(e, t, o) {
5008
5008
  const n = e.faces.map((s) => ({ points: s.corners.map((i) => e.vertices[i]), normal: s.normal })), a = [], r = { x: t.slice(1, -1), z: o.slice(1, -1) };
5009
5009
  for (let s = 0; s + 1 < t.length; s++)
5010
5010
  for (let i = 0; i + 1 < o.length; i++) {
@@ -5015,43 +5015,43 @@ function nc(e, t, o) {
5015
5015
  }, d = [], f = (p) => p === 0, u = (p, g) => p + 2 === g.length;
5016
5016
  for (const p of n) {
5017
5017
  let g = p.points;
5018
- f(s) || (g = Ft(g, 0, t[s], 1)), g.length && !u(s, t) && (g = Ft(g, 0, t[s + 1], -1)), g.length && !f(i) && (g = Ft(g, 2, o[i], 1)), g.length && !u(i, o) && (g = Ft(g, 2, o[i + 1], -1)), g.length >= 3 && d.push({ corners: g.map(l), normal: p.normal });
5018
+ f(s) || (g = Dt(g, 0, t[s], 1)), g.length && !u(s, t) && (g = Dt(g, 0, t[s + 1], -1)), g.length && !f(i) && (g = Dt(g, 2, o[i], 1)), g.length && !u(i, o) && (g = Dt(g, 2, o[i + 1], -1)), g.length >= 3 && d.push({ corners: g.map(l), normal: p.normal });
5019
5019
  }
5020
5020
  d.length > 0 && a.push({ cell: [s, i], mesh: { vertices: h, faces: d, creases: e.creases, joined: e.joined, walls: r } });
5021
5021
  }
5022
5022
  return a;
5023
5023
  }
5024
- const sc = /* @__PURE__ */ new WeakMap(), rc = /* @__PURE__ */ new WeakMap(), ac = 48, Rr = (e) => e.map((t) => Math.round(t * 1e5)).join(",");
5024
+ const rc = /* @__PURE__ */ new WeakMap(), ac = /* @__PURE__ */ new WeakMap(), ic = 48, Rr = (e) => e.map((t) => Math.round(t * 1e5)).join(",");
5025
5025
  function Wr(e, t, o, n) {
5026
5026
  let a = e.get(t);
5027
5027
  a || e.set(t, a = /* @__PURE__ */ new Map());
5028
5028
  let r = a.get(o);
5029
- return r === void 0 && (a.size >= ac && a.clear(), a.set(o, r = n())), r;
5029
+ return r === void 0 && (a.size >= ic && a.clear(), a.set(o, r = n())), r;
5030
5030
  }
5031
5031
  function Mn(e, t) {
5032
5032
  const o = Rr(t);
5033
- return Wr(sc, e, o, () => {
5034
- const n = oc(e, t), a = [1 / 0, 1 / 0, 1 / 0], r = [-1 / 0, -1 / 0, -1 / 0];
5033
+ return Wr(rc, e, o, () => {
5034
+ const n = nc(e, t), a = [1 / 0, 1 / 0, 1 / 0], r = [-1 / 0, -1 / 0, -1 / 0];
5035
5035
  for (const s of n.vertices) for (const i of [0, 1, 2])
5036
5036
  a[i] = Math.min(a[i], s[i]), r[i] = Math.max(r[i], s[i]);
5037
5037
  return { key: o, inSpace: n, low: a, high: r };
5038
5038
  });
5039
5039
  }
5040
- function ic(e, t) {
5040
+ function lc(e, t) {
5041
5041
  const o = e.map((l) => ({ ...l, ...Mn(l.mesh, l.local) })), n = [1 / 0, 1 / 0, 1 / 0], a = [-1 / 0, -1 / 0, -1 / 0];
5042
5042
  for (const l of o) for (const d of [0, 1, 2])
5043
5043
  n[d] = Math.min(n[d], l.low[d]), a[d] = Math.max(a[d], l.high[d]);
5044
5044
  const r = Os(n[0], a[0], t), s = Os(n[2], a[2], t), i = `${r.join(",")}|${s.join(",")}`, h = o.flatMap((l) => {
5045
5045
  if (l.high[0] - l.low[0] <= t * 2.5 && l.high[2] - l.low[2] <= t * 2.5 || l.whole || l.mesh.joined || (l.mesh.marks?.length ?? 0) > 0) {
5046
5046
  const f = [(l.low[0] + l.high[0]) / 2, (l.low[1] + l.high[1]) / 2, (l.low[2] + l.high[2]) / 2];
5047
- return [{ part: l.part, mesh: l.mesh, cut: !1, cell: tc(r, s, f) }];
5047
+ return [{ part: l.part, mesh: l.mesh, cut: !1, cell: oc(r, s, f) }];
5048
5048
  }
5049
- return Wr(rc, l.inSpace, i, () => nc(l.inSpace, r, s)).map((f) => ({ part: l.part, mesh: f.mesh, cut: !0, cell: f.cell }));
5049
+ return Wr(ac, l.inSpace, i, () => sc(l.inSpace, r, s)).map((f) => ({ part: l.part, mesh: f.mesh, cut: !0, cell: f.cell }));
5050
5050
  }), c = (n[1] + a[1]) / 2;
5051
5051
  return { pieces: h, middle: ([l, d]) => [(r[l] + r[l + 1]) / 2, c, (s[d] + s[d + 1]) / 2] };
5052
5052
  }
5053
5053
  const Hs = 4e-3, Co = 0.05, Is = /* @__PURE__ */ new WeakMap();
5054
- function lc(e) {
5054
+ function hc(e) {
5055
5055
  let t = Is.get(e);
5056
5056
  return t === void 0 && (t = !e.joined && !e.walls && e.faces.length >= 4 && e.faces.every((o) => {
5057
5057
  const n = e.vertices[o.corners[0]];
@@ -5060,7 +5060,7 @@ function lc(e) {
5060
5060
  }
5061
5061
  const xs = /* @__PURE__ */ new WeakMap();
5062
5062
  function zr(e) {
5063
- return e.filter(({ mesh: t }) => lc(t)).map(({ part: t, key: o, inSpace: n, low: a, high: r }) => {
5063
+ return e.filter(({ mesh: t }) => hc(t)).map(({ part: t, key: o, inSpace: n, low: a, high: r }) => {
5064
5064
  let s = xs.get(n);
5065
5065
  return s || (s = n.faces.map((i) => {
5066
5066
  const h = n.vertices[i.corners[0]];
@@ -5068,7 +5068,7 @@ function zr(e) {
5068
5068
  }), xs.set(n, s)), { part: t, key: o, planes: s, low: a, high: r };
5069
5069
  });
5070
5070
  }
5071
- function hc(e, t, o, n) {
5071
+ function cc(e, t, o, n) {
5072
5072
  const a = t.reduce((r, s) => [r[0] + s[0] / t.length, r[1] + s[1] / t.length, r[2] + s[2] / t.length], [0, 0, 0]);
5073
5073
  for (const r of n) {
5074
5074
  if (r.part === e || [0, 1, 2].some((i) => a[i] < r.low[i] - Co || a[i] > r.high[i] + Co)) continue;
@@ -5093,7 +5093,7 @@ function Lr(e, t, o, n, a) {
5093
5093
  const d = [o[0] * l[0] + o[4] * l[1] + o[8] * l[2], o[1] * l[0] + o[5] * l[1] + o[9] * l[2], o[2] * l[0] + o[6] * l[1] + o[10] * l[2]], f = Math.hypot(...d) || 1;
5094
5094
  return [d[0] / f, d[1] / f, d[2] / f];
5095
5095
  }, c = t.vertices.map((l) => ne.transformPoint(o, l));
5096
- i = t.faces.map((l) => hc(e, l.corners.map((d) => c[d]), h(l.normal), a)), s.set(r, i);
5096
+ i = t.faces.map((l) => cc(e, l.corners.map((d) => c[d]), h(l.normal), a)), s.set(r, i);
5097
5097
  }
5098
5098
  return i;
5099
5099
  }
@@ -5107,7 +5107,7 @@ const xt = {
5107
5107
  lean: { description: "The top sheared forward (+) or back (−): speed and drag", unit: "shear" },
5108
5108
  size: { description: "Its size, about the ground: 1 as built, 0 gone (pop it in or out)", unit: "factor", default: 1, min: 0 }
5109
5109
  }, Qo = Math.PI / 180;
5110
- function cc(e, t, o) {
5110
+ function dc(e, t, o) {
5111
5111
  return {
5112
5112
  toView: (n) => ma(Gs(n, e * 90 * Qo), -t * Qo),
5113
5113
  toScreen: (n) => ({ x: n[0] * o, y: -n[1] * o })
@@ -5115,7 +5115,7 @@ function cc(e, t, o) {
5115
5115
  }
5116
5116
  const _s = /* @__PURE__ */ new WeakMap(), ao = (e) => Ut(e), Ut = (e) => {
5117
5117
  let t = _s.get(e);
5118
- return t || _s.set(e, t = Ui(e)), t;
5118
+ return t || _s.set(e, t = Xi(e)), t;
5119
5119
  };
5120
5120
  function be(e, t, o) {
5121
5121
  return t[o] ?? e.controls[o]?.default ?? xt[o]?.default ?? 0;
@@ -5158,10 +5158,10 @@ function $n(e, t) {
5158
5158
  const No = (() => {
5159
5159
  const e = [-0.45, 0.75, 0.5], t = Math.hypot(...e);
5160
5160
  return [e[0] / t, e[1] / t, e[2] / t];
5161
- })(), dc = Math.cos(35 * Qo);
5162
- function Dr(e, t, o, n, a = {}) {
5163
- const r = e.derive ? { ...t, ...e.derive(t) } : t, s = $n(e, r), i = o.toView([0, 0, 0]), h = (x) => (W) => [x[0] * W[0] + x[4] * W[1] + x[8] * W[2], x[1] * W[0] + x[5] * W[1] + x[9] * W[2], x[2] * W[0] + x[6] * W[1] + x[10] * W[2]], c = Ot(e, r), l = a.slice === void 0 ? null : ne.invert(c), d = l ? e.parts.map((x) => ({ part: x, mesh: Ut(x.shape), local: ne.multiply(l, s.get(x.id)), whole: x.shape.type === "tube" })) : void 0, f = d ? ic(d, a.slice) : void 0, u = d ? zr(d.map((x) => ({ part: x.part.id, mesh: x.mesh, ...Mn(x.mesh, x.local) }))) : void 0, p = (x, W, G, Y) => {
5164
- const oe = (R) => o.toView(ne.transformPoint(G, R)), q = W.vertices.map(oe), I = q.map((R) => o.toScreen(R)), C = a.perspective ? a.near : void 0, N = (R) => R.map((J) => o.toScreen(J)), S = (R) => C === void 0 ? R : Ps(R, C), _ = (R) => C === void 0 ? [R] : ec(R, C), V = h(G), ee = W.faces.map((R) => {
5161
+ })(), fc = Math.cos(35 * Qo);
5162
+ function Fr(e, t, o, n, a = {}) {
5163
+ const r = e.derive ? { ...t, ...e.derive(t) } : t, s = $n(e, r), i = o.toView([0, 0, 0]), h = (x) => (W) => [x[0] * W[0] + x[4] * W[1] + x[8] * W[2], x[1] * W[0] + x[5] * W[1] + x[9] * W[2], x[2] * W[0] + x[6] * W[1] + x[10] * W[2]], c = Ot(e, r), l = a.slice === void 0 ? null : ne.invert(c), d = l ? e.parts.map((x) => ({ part: x, mesh: Ut(x.shape), local: ne.multiply(l, s.get(x.id)), whole: x.shape.type === "tube" })) : void 0, f = d ? lc(d, a.slice) : void 0, u = d ? zr(d.map((x) => ({ part: x.part.id, mesh: x.mesh, ...Mn(x.mesh, x.local) }))) : void 0, p = (x, W, G, Y) => {
5164
+ const oe = (R) => o.toView(ne.transformPoint(G, R)), q = W.vertices.map(oe), I = q.map((R) => o.toScreen(R)), C = a.perspective ? a.near : void 0, N = (R) => R.map((J) => o.toScreen(J)), S = (R) => C === void 0 ? R : Ps(R, C), _ = (R) => C === void 0 ? [R] : tc(R, C), V = h(G), ee = W.faces.map((R) => {
5165
5165
  const J = o.toView(V(R.normal)), he = [J[0] - i[0], J[1] - i[1], J[2] - i[2]], de = Math.hypot(...he) || 1;
5166
5166
  return [he[0] / de, he[1] / de, he[2] / de];
5167
5167
  }), L = u && Y ? Lr(x.id, W, Y, Rr(Y), u) : void 0, Q = (R) => L?.[R] ?? !1, re = ee.map((R, J) => {
@@ -5187,14 +5187,14 @@ function Dr(e, t, o, n, a = {}) {
5187
5187
  he.light = yt.light, he.fog = yt.fog;
5188
5188
  }
5189
5189
  }
5190
- const D = X.map((R) => R.solved), Z = fc(W), se = [], ae = [];
5190
+ const F = X.map((R) => R.solved), Z = uc(W), se = [], ae = [];
5191
5191
  for (const [R, J] of Z) {
5192
5192
  const he = J.filter((pe) => re[pe]).length;
5193
5193
  if (he === 0) continue;
5194
- const de = J.length === 2 && he === 2 && W.creases !== !1 && ee[J[0]][0] * ee[J[1]][0] + ee[J[0]][1] * ee[J[1]][1] + ee[J[0]][2] * ee[J[1]][2] < dc;
5195
- J.length === 1 && (W.joined || pc(W, R)) || (J.length === 1 || he === 1 || de) && (se.push(R.split("-").map(Number)), ae.push(J.filter((pe) => re[pe]).reduce((pe, ge) => K(ge) > K(pe) ? ge : pe)));
5194
+ const de = J.length === 2 && he === 2 && W.creases !== !1 && ee[J[0]][0] * ee[J[1]][0] + ee[J[0]][1] * ee[J[1]][1] + ee[J[0]][2] * ee[J[1]][2] < fc;
5195
+ J.length === 1 && (W.joined || mc(W, R)) || (J.length === 1 || he === 1 || de) && (se.push(R.split("-").map(Number)), ae.push(J.filter((pe) => re[pe]).reduce((pe, ge) => K(ge) > K(pe) ? ge : pe)));
5196
5196
  }
5197
- const ie = (R) => W.faces.findIndex((J) => J.corners.length > 4 && Math.sign(yc(W.vertices[R], J.normal)) > 0), $ = (W.marks ?? []).filter(([R]) => ie(R) < 0 || re[ie(R)]), z = ([R, J]) => C === void 0 ? [[I[R], I[J]]] : _([q[R], q[J]]).map(N), U = $.flatMap(z), te = (R) => C === void 0 ? [R.map((J) => I[J])] : _(R.map((J) => q[J])).map(N);
5197
+ const ie = (R) => W.faces.findIndex((J) => J.corners.length > 4 && Math.sign(bc(W.vertices[R], J.normal)) > 0), $ = (W.marks ?? []).filter(([R]) => ie(R) < 0 || re[ie(R)]), z = ([R, J]) => C === void 0 ? [[I[R], I[J]]] : _([q[R], q[J]]).map(N), U = $.flatMap(z), te = (R) => C === void 0 ? [R.map((J) => I[J])] : _(R.map((J) => q[J])).map(N);
5198
5198
  if (a.slice !== void 0) {
5199
5199
  const R = /* @__PURE__ */ new Map();
5200
5200
  se.forEach((J, he) => R.set(ae[he], [...R.get(ae[he]) ?? [], J]));
@@ -5206,16 +5206,16 @@ function Dr(e, t, o, n, a = {}) {
5206
5206
  he.marks = $.filter(([ge]) => (ie(ge) >= 0 ? ie(ge) : pe) === J).flatMap(z);
5207
5207
  }
5208
5208
  }
5209
- const B = x.glow ? Math.max(0, Math.min(1, be(e, r, x.glow.control))) : 0, le = x.fade ? Math.max(0, Math.min(1, be(e, r, x.fade.control))) : 0, F = x.fade ? Math.max(0, Math.min(1, x.fade.from + (x.fade.to - x.fade.from) * le)) : 1;
5209
+ const B = x.glow ? Math.max(0, Math.min(1, be(e, r, x.glow.control))) : 0, le = x.fade ? Math.max(0, Math.min(1, be(e, r, x.fade.control))) : 0, D = x.fade ? Math.max(0, Math.min(1, x.fade.from + (x.fade.to - x.fade.from) * le)) : 1;
5210
5210
  return {
5211
5211
  part: x,
5212
5212
  depth: q.reduce((R, J) => R + J[2], 0) / Math.max(1, q.length),
5213
- faces: D,
5213
+ faces: F,
5214
5214
  edges: Cs(se).flatMap(te),
5215
5215
  marks: U,
5216
5216
  glow: B,
5217
- opacity: F,
5218
- ...x.shape.type === "tube" ? { spine: mc(_(x.shape.points.map(oe)).map(N)) } : {},
5217
+ opacity: D,
5218
+ ...x.shape.type === "tube" ? { spine: yc(_(x.shape.points.map(oe)).map(N)) } : {},
5219
5219
  ...W.walls ? { cut: !0 } : {}
5220
5220
  };
5221
5221
  }, g = new Map(d?.map((x) => [x.part.id, x.local])), T = (f ? f.pieces.map((x) => ({
@@ -5255,7 +5255,7 @@ function Dr(e, t, o, n, a = {}) {
5255
5255
  return { under: M(H.filter((x) => !x.part.overRider)), over: M(H.filter((x) => x.part.overRider)), ...m ? { cells: m } : {}, anchors: P, openings: j, shadow: O, pxPerUnit: n, sizePx: e.height * n };
5256
5256
  }
5257
5257
  const Ks = /* @__PURE__ */ new WeakMap();
5258
- function fc(e) {
5258
+ function uc(e) {
5259
5259
  let t = Ks.get(e);
5260
5260
  if (!t) {
5261
5261
  t = /* @__PURE__ */ new Map();
@@ -5270,7 +5270,7 @@ function fc(e) {
5270
5270
  }
5271
5271
  return t;
5272
5272
  }
5273
- function uc(e, t) {
5273
+ function gc(e, t) {
5274
5274
  const o = e.derive ? { ...t, ...e.derive(t) } : t, n = $n(e, o), a = ne.invert(Ot(e, o)) ?? ne.identity(), r = (s) => Math.max(0, Math.min(1, s));
5275
5275
  return e.parts.map((s) => {
5276
5276
  const i = s.fade ? r(be(e, o, s.fade.control)) : 0;
@@ -5283,7 +5283,7 @@ function uc(e, t) {
5283
5283
  };
5284
5284
  });
5285
5285
  }
5286
- function gc(e, t) {
5286
+ function pc(e, t) {
5287
5287
  const o = e.derive ? { ...t, ...e.derive(t) } : t, n = $n(e, o), a = Ot(e, o), r = {};
5288
5288
  for (const [s, i] of Object.entries(e.anchors ?? {})) {
5289
5289
  const h = i.part ? n.get(i.part) : a;
@@ -5292,15 +5292,15 @@ function gc(e, t) {
5292
5292
  }
5293
5293
  return r;
5294
5294
  }
5295
- function pc(e, t) {
5295
+ function mc(e, t) {
5296
5296
  if (!e.walls) return !1;
5297
5297
  const [o, n] = t.split("-").map((r) => e.vertices[Number(r)]), a = (r, s) => s.some((i) => Math.abs(o[r] - i) < 1e-6 && Math.abs(n[r] - i) < 1e-6);
5298
5298
  return a(0, e.walls.x) || a(2, e.walls.z);
5299
5299
  }
5300
- function mc(e) {
5300
+ function yc(e) {
5301
5301
  return e.reduce((t, o) => !t || o.length > t.length ? o : t, void 0);
5302
5302
  }
5303
- const yc = (e, t) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
5303
+ const bc = (e, t) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2];
5304
5304
  function Cs(e) {
5305
5305
  const t = e.map((n) => [...n]), o = [];
5306
5306
  for (; t.length > 0; ) {
@@ -5323,7 +5323,7 @@ function Cs(e) {
5323
5323
  }
5324
5324
  return o;
5325
5325
  }
5326
- function Fr(e, t) {
5326
+ function Dr(e, t) {
5327
5327
  if (!e.loose?.size) return;
5328
5328
  const o = {};
5329
5329
  for (const [n, a] of e.loose)
@@ -5338,7 +5338,7 @@ function qr(e) {
5338
5338
  }
5339
5339
  return t;
5340
5340
  }
5341
- function bc(e) {
5341
+ function wc(e) {
5342
5342
  const { prop: t } = e, o = e.scale ?? 60, n = t.rig.length * o * 1.4, a = t.rig.height * o * 1.6, r = qr(t), s = {};
5343
5343
  for (const [h, c] of Object.entries(r)) s[h] = e.values?.[h] ?? c.default ?? 0;
5344
5344
  const i = { look: e.look, ink: e.ink, lineWidth: e.lineWidth, pencil: e.pencil, seed: e.seed, style: e.style, paper: e.paper };
@@ -5360,13 +5360,13 @@ function bc(e) {
5360
5360
  },
5361
5361
  draw(h, c, l) {
5362
5362
  const d = c.props ?? {};
5363
- h.translate(n / 2, a), cr(h, jt(t, d, o), { ...i, time: l, loose: Fr(c, d) });
5363
+ h.translate(n / 2, a), cr(h, jt(t, d, o), { ...i, time: l, loose: Dr(c, d) });
5364
5364
  }
5365
5365
  };
5366
5366
  }
5367
5367
  function jt(e, t, o) {
5368
- const n = cc(be(e.rig, t, "turn"), be(e.rig, t, "tilt"), o);
5369
- return Dr(e.rig, t, n, o);
5368
+ const n = dc(be(e.rig, t, "turn"), be(e.rig, t, "tilt"), o);
5369
+ return Fr(e.rig, t, n, o);
5370
5370
  }
5371
5371
  function En(e, t, o) {
5372
5372
  const n = { ...e.props };
@@ -5385,12 +5385,12 @@ function En(e, t, o) {
5385
5385
  }
5386
5386
  };
5387
5387
  }
5388
- function af(e, t, o, n, a = {}) {
5388
+ function lf(e, t, o, n, a = {}) {
5389
5389
  const r = En(t, o, n);
5390
5390
  return e.save(), e.translate(r.origin.x, r.origin.y), cr(e, r.solved, {
5391
5391
  ...t.propDraw,
5392
5392
  time: o.time,
5393
- loose: Fr(t, r.values),
5393
+ loose: Dr(t, r.values),
5394
5394
  // The rider is drawn in scene px.
5395
5395
  rider: a.rider ? (s) => {
5396
5396
  s.save(), s.translate(-r.origin.x, -r.origin.y), a.rider(s), s.restore();
@@ -5412,8 +5412,8 @@ const Mt = {
5412
5412
  move: "a part; { at, to: an anchor name or { x, y }, duration? }: carry the part there, loose",
5413
5413
  fling: "a part; { at, velocity?, spin?, gravity?, duration? }: knock the part off on a spinning arc"
5414
5414
  }
5415
- }, wc = 400, kc = 0.2;
5416
- function lf(e, t = {}) {
5415
+ }, kc = 400, vc = 0.2;
5416
+ function hf(e, t = {}) {
5417
5417
  const { prop: o } = e, n = qr(o), a = Object.keys(n), r = Object.keys(o.rig.anchors ?? {}), s = o.rig.parts.map((A) => A.id), i = It(), h = fo(i), c = t.tracks?.length ? new ve({ id: `${o.kind}-surface`, tracks: t.tracks }) : void 0, l = Math.max(0, ...(t.tracks ?? []).flatMap((A) => A.keyframes.map((k) => k.time))), d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
5418
5418
  e.loose = f;
5419
5419
  const u = e.props, p = (A) => {
@@ -5460,7 +5460,7 @@ function lf(e, t = {}) {
5460
5460
  const y = g(A), { values: v, origin: w, solved: E } = H(k);
5461
5461
  if (y.kind === "box") return me(w.x - e.width / 2, w.y - e.height, e.width, e.height);
5462
5462
  if (y.kind === "anchor") {
5463
- const x = E.anchors[y.name].point, W = kc * e.propScale;
5463
+ const x = E.anchors[y.name].point, W = vc * e.propScale;
5464
5464
  return me(w.x + x.x - W / 2, w.y + x.y - W / 2, W, W);
5465
5465
  }
5466
5466
  if (y.kind === "part") return j(/* @__PURE__ */ new Set([y.name]), `part "${y.name}" is`);
@@ -5527,7 +5527,7 @@ function lf(e, t = {}) {
5527
5527
  j = y.value;
5528
5528
  } else
5529
5529
  j = y.on === !1 ? O.default ?? O.min ?? 0 : O.max ?? 1;
5530
- i.tween(E.name, p(y.at).values[E.name], j, y, wc);
5530
+ i.tween(E.name, p(y.at).values[E.name], j, y, kc);
5531
5531
  }
5532
5532
  return P;
5533
5533
  },
@@ -5556,9 +5556,9 @@ function lf(e, t = {}) {
5556
5556
  };
5557
5557
  return P;
5558
5558
  }
5559
- const vc = { body: "#e8574a", trim: "#3b3b44", glass: "#bfe3f2", tyre: "#2c2c33", hub: "#c9ccd3", light: "#fff4b8", tail: "#ff5a4f", inside: "#3b3640", seat: "#6d5d55" };
5560
- function Fe(e) {
5561
- const t = { ...vc, ...e.colors }, o = [], { forwardMost: n, backMost: a, top: r } = Br(e);
5559
+ const Sc = { body: "#e8574a", trim: "#3b3b44", glass: "#bfe3f2", tyre: "#2c2c33", hub: "#c9ccd3", light: "#fff4b8", tail: "#ff5a4f", inside: "#3b3640", seat: "#6d5d55" };
5560
+ function De(e) {
5561
+ const t = { ...Sc, ...e.colors }, o = [], { forwardMost: n, backMost: a, top: r } = Br(e);
5562
5562
  e.body && o.push({ id: "body", shape: { type: "extrude", profile: e.body, width: e.width }, fill: t.body });
5563
5563
  for (const [l, d] of (e.frame ?? []).entries())
5564
5564
  o.push({ id: `frame-${l}`, shape: { type: "tube", points: d.points, radius: d.radius ?? 0.035, segments: 6 }, fill: d.color ?? t.body, outline: 0.7 });
@@ -5685,8 +5685,8 @@ function Fe(e) {
5685
5685
  family: "vehicle",
5686
5686
  summary: e.summary ?? "A wheeled vehicle",
5687
5687
  rig: c,
5688
- actions: Mc(e),
5689
- acting: Sc,
5688
+ actions: $c(e),
5689
+ acting: Mc,
5690
5690
  colors: { body: t.body, ink: "#26262b" },
5691
5691
  follow: e.antenna ? [{ control: "antenna", of: "x", per: 0.9, stiffness: 140, damping: 7, limit: 35 }] : void 0,
5692
5692
  wheelRadius: s,
@@ -5707,7 +5707,7 @@ function Br(e) {
5707
5707
  ];
5708
5708
  return { forwardMost: Math.max(...t), backMost: Math.min(...t), top: Math.max(...o) };
5709
5709
  }
5710
- const Sc = {
5710
+ const Mc = {
5711
5711
  depth: { turn: 0, lift: 0, lights: 0, pitch: 1, roll: 1, squash: 1, lean: 1, door: 2 },
5712
5712
  limits: { turn: 0.08, pitch: 5, roll: 4, lean: 0.1, squash: 0.06, door: 0.12, lift: 0 },
5713
5713
  eyes: [],
@@ -5719,7 +5719,7 @@ function qt(e, t, o, n, a, r, s = !1) {
5719
5719
  e.set("wheelSpin", t, h), e.move(t, o, n, { easing: a }), e.set("wheelSpin", o, s ? h : h + c / r * (180 / Math.PI), a);
5720
5720
  }
5721
5721
  const Ns = 0.4;
5722
- function Mc(e) {
5722
+ function $c(e) {
5723
5723
  const t = e.wheels[0]?.radius ?? 0.4, { forwardMost: o, backMost: n } = Br(e), a = (o - n) / 2, r = (i, h, c) => {
5724
5724
  const l = i.exaggeration;
5725
5725
  let d = h;
@@ -5788,8 +5788,8 @@ function Mc(e) {
5788
5788
  } : {}
5789
5789
  };
5790
5790
  }
5791
- function $c(e = {}) {
5792
- return Fe({
5791
+ function Ec(e = {}) {
5792
+ return De({
5793
5793
  kind: "car",
5794
5794
  summary: "A cartoon car: drives, brakes, bumps, honks, opens its doors, lights up, and turns toward the camera.",
5795
5795
  body: [[-2, 0.32], [2, 0.32], [2.08, 0.52], [1.98, 0.82], [1.05, 0.95], [-1.72, 0.98], [-2.02, 0.86], [-2.08, 0.5]],
@@ -5806,8 +5806,8 @@ function $c(e = {}) {
5806
5806
  colors: e.colors
5807
5807
  });
5808
5808
  }
5809
- function Ec(e = {}) {
5810
- return Fe({
5809
+ function Ac(e = {}) {
5810
+ return De({
5811
5811
  kind: "truck",
5812
5812
  summary: "A box truck: drives, brakes, bumps, honks, opens its cab doors, lights up, turns toward the camera.",
5813
5813
  body: [[-3.2, 0.5], [3.1, 0.5], [3.15, 0.95], [3, 1.85], [2.3, 2.25], [1.2, 2.25], [1.2, 1], [-3.2, 1]],
@@ -5825,8 +5825,8 @@ function Ec(e = {}) {
5825
5825
  colors: { body: "#2f6fb7", ...e.colors }
5826
5826
  });
5827
5827
  }
5828
- function Ac(e = {}) {
5829
- return Fe({
5828
+ function Tc(e = {}) {
5829
+ return De({
5830
5830
  kind: "bus",
5831
5831
  summary: "A bus: drives, brakes, bumps, honks, opens its front doors, lights its windows, turns toward the camera.",
5832
5832
  body: [[-4.5, 0.45], [4.5, 0.45], [4.6, 0.9], [4.55, 2.9], [4.3, 3], [-4.4, 3], [-4.55, 2.75], [-4.55, 0.6]],
@@ -5843,8 +5843,8 @@ function Ac(e = {}) {
5843
5843
  colors: { body: "#f2c230", ...e.colors }
5844
5844
  });
5845
5845
  }
5846
- function Tc(e = {}) {
5847
- return Fe({
5846
+ function Pc(e = {}) {
5847
+ return De({
5848
5848
  kind: "tractor",
5849
5849
  summary: "A tractor: big rear wheels and small front ones turning at their own rates; drives, brakes, bumps, honks.",
5850
5850
  body: [[-0.5, 0.75], [2, 0.75], [2.12, 1.25], [1.9, 1.52], [-0.5, 1.52]],
@@ -5863,9 +5863,9 @@ function Tc(e = {}) {
5863
5863
  colors: { body: "#3f9b47", hub: "#e9c64a", ...e.colors }
5864
5864
  });
5865
5865
  }
5866
- function Pc(e = {}) {
5866
+ function Oc(e = {}) {
5867
5867
  const t = e.colors?.body ?? "#a8743f";
5868
- return Fe({
5868
+ return De({
5869
5869
  kind: "cart",
5870
5870
  summary: "A wooden cart on spoked wheels with shafts: rolls when pulled (drive), bumps, tips.",
5871
5871
  body: [[-1.25, 0.78], [1.25, 0.78], [1.35, 1.18], [-1.35, 1.18]],
@@ -5880,8 +5880,8 @@ function Pc(e = {}) {
5880
5880
  colors: { body: t, tyre: "#5a3a1f", ...e.colors }
5881
5881
  });
5882
5882
  }
5883
- function Oc(e = {}) {
5884
- return Fe({
5883
+ function Hc(e = {}) {
5884
+ return De({
5885
5885
  kind: "train carriage",
5886
5886
  summary: "A railway carriage: rolls along (drive), brakes, lights its windows, turns toward the camera.",
5887
5887
  body: [[-4, 0.72], [4, 0.72], [4, 2.8], [3.6, 3.12], [-3.6, 3.12], [-4, 2.8]],
@@ -5898,9 +5898,9 @@ function Oc(e = {}) {
5898
5898
  colors: { body: "#2f7d6d", ...e.colors }
5899
5899
  });
5900
5900
  }
5901
- function Hc(e = {}) {
5901
+ function Ic(e = {}) {
5902
5902
  const t = e.colors?.body ?? "#e0473b", o = [0, 0.32, -0.05], n = [0, 0.86, -0.22], a = [0, 0.9, 0.42], r = [0, 0.34, 0.56], s = [0, 0.34, -0.56];
5903
- return Fe({
5903
+ return De({
5904
5904
  kind: "bike",
5905
5905
  summary: "A bicycle: rides (drive) with its wire wheels turning, brakes, bumps, rings its bell (honk).",
5906
5906
  width: 0.5,
@@ -5923,8 +5923,8 @@ function Hc(e = {}) {
5923
5923
  colors: { body: t, tyre: "#2c2c33", ...e.colors }
5924
5924
  });
5925
5925
  }
5926
- function Ic(e = {}) {
5927
- return Fe({
5926
+ function xc(e = {}) {
5927
+ return De({
5928
5928
  kind: "motorbike",
5929
5929
  summary: "A motorbike: rides (drive) with a lunge, brakes into a skid, bumps, honks, lights up.",
5930
5930
  body: [[-0.62, 0.62], [0.42, 0.62], [0.55, 0.95], [0.3, 1.02], [-0.1, 0.92], [-0.8, 0.88], [-0.86, 0.72]],
@@ -5944,7 +5944,7 @@ function Ic(e = {}) {
5944
5944
  colors: { body: "#1f1f26", hub: "#c9ccd3", ...e.colors }
5945
5945
  });
5946
5946
  }
5947
- function xc(e = {}) {
5947
+ function jc(e = {}) {
5948
5948
  const t = e.height ?? 2.4, o = e.trunkRadius ?? 0.16, n = e.canopy?.radius ?? 1.1, a = e.canopy?.shape === "tall", r = { trunk: "#8a5a3b", leaves: "#5cae5a", ...e.colors }, s = rn(e.canopy?.seed ?? 7), i = [
5949
5949
  { id: "trunk", shape: { type: "tube", points: [[0, 0, 0], [0.06, t * 0.5, 0], [-0.02, t, 0]], radius: o, segments: 8 }, fill: r.trunk },
5950
5950
  { id: "branch", parent: "trunk", shape: { type: "tube", points: [[0, 0, 0], [0.45, 0.4, 0.1]], radius: o * 0.45, segments: 6 }, at: [0.04, t * 0.62, 0], fill: r.trunk },
@@ -5975,19 +5975,19 @@ function xc(e = {}) {
5975
5975
  family: "plant",
5976
5976
  summary: e.summary ?? "A tree: sways in the wind with its canopy trailing, shakes, sheds leaves, pops up.",
5977
5977
  rig: c,
5978
- actions: _c(),
5979
- acting: jc,
5978
+ actions: Kc(),
5979
+ acting: _c,
5980
5980
  colors: { body: r.leaves }
5981
5981
  };
5982
5982
  }
5983
- const jc = {
5983
+ const _c = {
5984
5984
  depth: { sway: 1, canopySway: 2, size: 0, squash: 1 },
5985
5985
  limits: { sway: 2, canopySway: 3, squash: 0.08 },
5986
5986
  eyes: [],
5987
5987
  headTurns: {},
5988
5988
  drift: []
5989
5989
  };
5990
- function _c() {
5990
+ function Kc() {
5991
5991
  const e = (t, o, n, a) => {
5992
5992
  const r = t.anchor("canopy");
5993
5993
  t.effect({ kind: "leaves", time: o, x: r.x, y: r.y, length: n, direction: a, toY: t.floor });
@@ -6030,7 +6030,7 @@ function _c() {
6030
6030
  }
6031
6031
  };
6032
6032
  }
6033
- function Kc(e = {}) {
6033
+ function Cc(e = {}) {
6034
6034
  const t = e.width ?? 4, o = e.depth ?? 3.2, n = e.wallHeight ?? 2.5, a = e.roofHeight ?? 1.5, r = e.overhang ?? 0.25, s = { walls: "#f1d9a8", roof: "#b8433a", door: "#7a4b2a", doorway: "#3a2a22", glass: "#bfe3f2", lit: "#ffd66b", chimney: "#9b5a45", ...e.colors }, i = o / 2 + 0.01, h = e.door?.width ?? 0.9, c = e.door?.height ?? 1.9, l = e.door?.at ?? 0, d = e.windows ?? [
6035
6035
  { at: -1.25, low: 1, width: 0.8, height: 0.8 },
6036
6036
  { at: 1.25, low: 1, width: 0.8, height: 0.8 }
@@ -6095,19 +6095,19 @@ function Kc(e = {}) {
6095
6095
  family: "building",
6096
6096
  summary: e.summary ?? "A house: opens its door, lights its windows, puffs chimney smoke, shakes, pops up.",
6097
6097
  rig: p,
6098
- actions: Nc(!!u),
6099
- acting: Cc,
6098
+ actions: Rc(!!u),
6099
+ acting: Nc,
6100
6100
  colors: { body: s.walls }
6101
6101
  };
6102
6102
  }
6103
- const Cc = {
6103
+ const Nc = {
6104
6104
  depth: { door: 1, lights: 0, roll: 1, squash: 1, size: 0 },
6105
6105
  limits: { door: 0.1, roll: 1.5, squash: 0.05 },
6106
6106
  eyes: [],
6107
6107
  headTurns: {},
6108
6108
  drift: []
6109
6109
  };
6110
- function Nc(e) {
6110
+ function Rc(e) {
6111
6111
  return {
6112
6112
  door: {
6113
6113
  summary: "Opens the front door (`open: true`) or shuts it (`open: false`).",
@@ -6148,7 +6148,7 @@ function Nc(e) {
6148
6148
  } : {}
6149
6149
  };
6150
6150
  }
6151
- function Rc(e = {}) {
6151
+ function Wc(e = {}) {
6152
6152
  const t = e.width ?? 0.46, o = e.depth ?? 0.46, n = e.seatHeight ?? 0.46, a = e.backHeight ?? 0.95, r = { wood: "#8a5a3b", seat: "#c48a4a", ...e.colors }, s = 0.05, i = 0.025, h = [
6153
6153
  { id: "seat", shape: { type: "box", size: [t, s, o] }, at: [0, n - s / 2, 0], fill: r.seat },
6154
6154
  { id: "back", shape: { type: "box", size: [t, a - n, s] }, at: [0, (a + n) / 2, -o / 2 + s / 2], fill: r.wood }
@@ -6174,19 +6174,19 @@ function Rc(e = {}) {
6174
6174
  family: "furniture",
6175
6175
  summary: e.summary ?? "A chair: a seat to sit on (`seat`), tips back on its rear legs and settles, or falls over.",
6176
6176
  rig: c,
6177
- actions: zc(),
6178
- acting: Wc,
6177
+ actions: Lc(),
6178
+ acting: zc,
6179
6179
  colors: { body: r.seat }
6180
6180
  };
6181
6181
  }
6182
- const Wc = {
6182
+ const zc = {
6183
6183
  depth: { tip: 1, roll: 1, squash: 1, size: 0 },
6184
6184
  limits: { tip: 2, roll: 1, squash: 0.05 },
6185
6185
  eyes: [],
6186
6186
  headTurns: {},
6187
6187
  drift: []
6188
6188
  };
6189
- function zc() {
6189
+ function Lc() {
6190
6190
  return {
6191
6191
  tip: {
6192
6192
  summary: "Tips back on its rear legs for `for` ms (default 1200), rocking a little, then settles down.",
@@ -6206,7 +6206,7 @@ function zc() {
6206
6206
  }
6207
6207
  };
6208
6208
  }
6209
- function Lc(e = {}) {
6209
+ function Fc(e = {}) {
6210
6210
  const t = e.width ?? 1.4, o = e.depth ?? 0.7, n = e.height ?? 0.75, a = { wood: "#8a5a3b", top: "#a9754a", knob: "#2b2b2b", ...e.colors }, r = 0.04, s = 0.03, i = 0.14, h = t * 0.4, c = [
6211
6211
  { id: "top", shape: { type: "box", size: [t, r, o] }, at: [0, n - r / 2, 0], fill: a.top },
6212
6212
  // The drawer: a box under the top on the left, sliding forward on its control.
@@ -6255,7 +6255,7 @@ const Dc = {
6255
6255
  headTurns: {},
6256
6256
  drift: []
6257
6257
  };
6258
- function Fc(e = {}) {
6258
+ function qc(e = {}) {
6259
6259
  const t = e.length ?? 2, o = e.width ?? 1, n = e.height ?? 0.55, a = e.headboard ?? 0.95, r = { wood: "#8a5a3b", mattress: "#f1ece2", blanket: "#5b7fb0", pillow: "#fbf8f2", ...e.colors }, s = 0.3, i = n - s, c = {
6260
6260
  parts: [
6261
6261
  { id: "frame", shape: { type: "box", size: [o, s, t] }, at: [0, s / 2, 0], fill: r.wood },
@@ -6292,18 +6292,18 @@ function Fc(e = {}) {
6292
6292
  }
6293
6293
  }
6294
6294
  },
6295
- acting: qc,
6295
+ acting: Bc,
6296
6296
  colors: { body: r.blanket }
6297
6297
  };
6298
6298
  }
6299
- const qc = {
6299
+ const Bc = {
6300
6300
  depth: { give: 1, roll: 1, squash: 1, size: 0 },
6301
6301
  limits: { give: 0.03, roll: 0.5, squash: 0.03 },
6302
6302
  eyes: [],
6303
6303
  headTurns: {},
6304
6304
  drift: []
6305
6305
  };
6306
- function Bc(e = {}) {
6306
+ function Gc(e = {}) {
6307
6307
  const t = e.width ?? 0.9, o = e.height ?? 2.05, n = e.hinge ?? "left", a = { frame: "#d9d2c3", door: "#7a4b2a", handle: "#c9a227", beyond: "#2a2f3a", ...e.colors }, r = 0.1, s = n === "left" ? 1 : -1, i = s > 0 ? [[0, 0], [-t, 0], [-t, o], [0, o]] : [[0, 0], [t, 0], [t, o], [0, o]], c = {
6308
6308
  parts: [
6309
6309
  { id: "post-left", shape: { type: "box", size: [r, o + r, r] }, at: [t / 2 + r / 2, (o + r) / 2, 0], fill: a.frame },
@@ -6331,19 +6331,19 @@ function Bc(e = {}) {
6331
6331
  family: "furniture",
6332
6332
  summary: e.summary ?? "A door in its frame: opens and shuts on its hinge (`open`), slams, rattles when knocked; a figure goes through the `doorway` from `front` to `beyond`.",
6333
6333
  rig: c,
6334
- actions: Yc(),
6335
- acting: Gc,
6334
+ actions: Uc(),
6335
+ acting: Yc,
6336
6336
  colors: { body: a.door }
6337
6337
  };
6338
6338
  }
6339
- const Gc = {
6339
+ const Yc = {
6340
6340
  depth: { open: 1, roll: 1, squash: 1, size: 0 },
6341
6341
  limits: { open: 0.08, roll: 0.6, squash: 0.03 },
6342
6342
  eyes: [],
6343
6343
  headTurns: {},
6344
6344
  drift: []
6345
6345
  };
6346
- function Yc() {
6346
+ function Uc() {
6347
6347
  return {
6348
6348
  open: {
6349
6349
  summary: "Opens the door (`open: true`, default) or shuts it (`open: false`), over `for` ms (default 600).",
@@ -6377,7 +6377,7 @@ function Yc() {
6377
6377
  };
6378
6378
  }
6379
6379
  const Gr = 1.4;
6380
- function Uc(e = {}) {
6380
+ function Xc(e = {}) {
6381
6381
  const t = e.width ?? 0.5, o = e.seatHeight ?? 0.5, n = e.wheelRadius ?? 0.3, a = 0.08, r = { frame: "#2b2f36", seat: "#3c6ea5", tyre: "#1f2328", ...e.colors }, s = 0.04, i = 0.018, h = 0.44, c = o + 0.5, l = -0.08, d = t / 2 + 0.06, f = [
6382
6382
  { id: "seat", shape: { type: "box", size: [t, s, h] }, at: [0, o - s / 2, 0], fill: r.seat },
6383
6383
  { id: "back", shape: { type: "box", size: [t, c - o - 0.02, s] }, at: [0, (c + o) / 2, -h / 2 + s / 2], fill: r.seat },
@@ -6435,14 +6435,14 @@ function Uc(e = {}) {
6435
6435
  family: "furniture",
6436
6436
  summary: e.summary ?? "A wheelchair: rolls to `to` with its wheels turning the distance (roll), brakes, tips back on its big wheels (wheelie); its `seat` is ridden in the `wheeling` pose and a pusher stands at `handles`.",
6437
6437
  rig: p,
6438
- actions: Vc(n),
6439
- acting: Xc,
6438
+ actions: Jc(n),
6439
+ acting: Vc,
6440
6440
  colors: { body: r.seat, ink: r.frame },
6441
6441
  wheelRadius: n,
6442
6442
  moves: { roll: { speed: Gr, perMetre: { wheelSpin: 180 / (Math.PI * n) } } }
6443
6443
  };
6444
6444
  }
6445
- const Xc = {
6445
+ const Vc = {
6446
6446
  depth: { wheelSpin: 0, tip: 1, roll: 1, squash: 1, size: 0 },
6447
6447
  limits: { tip: 2, roll: 1, squash: 0.03 },
6448
6448
  eyes: [],
@@ -6453,7 +6453,7 @@ function Rs(e, t, o, n, a, r, s = !1) {
6453
6453
  const i = e.facing() || Math.sign(n - e.x) || 1, h = e.values.wheelSpin ?? 0, c = (n - e.x) * i / e.scale;
6454
6454
  e.set("wheelSpin", t, h), e.move(t, o, n, { easing: a }), e.set("wheelSpin", o, s ? h : h + c / r * (180 / Math.PI), a);
6455
6455
  }
6456
- function Vc(e) {
6456
+ function Jc(e) {
6457
6457
  return {
6458
6458
  roll: {
6459
6459
  summary: "Rolls to `to` at `speed` px/ms (or over `for` ms): a small push-off, the wheels turning exactly the distance, and a gentle stop.",
@@ -6488,7 +6488,7 @@ function Vc(e) {
6488
6488
  }
6489
6489
  };
6490
6490
  }
6491
- function Jc(e = {}) {
6491
+ function Zc(e = {}) {
6492
6492
  const t = { body: "#3f86c8", glass: "#cfeaf5", trim: "#2c2c33", rotor: "#3b3b44", ...e.colors }, o = 2.15, a = {
6493
6493
  parts: [
6494
6494
  {
@@ -6541,7 +6541,7 @@ function Jc(e = {}) {
6541
6541
  family: "aircraft",
6542
6542
  summary: e.summary ?? "A cartoon helicopter: spools up and takes off, flies nose-down banking into its moves, hovers with a bob, and lands with a squash.",
6543
6543
  rig: a,
6544
- actions: Zc(),
6544
+ actions: Qc(),
6545
6545
  acting: Yr,
6546
6546
  colors: { body: t.body, ink: "#26262b" },
6547
6547
  // In world metres: flies with its rotor spinning (a blur), at the height a beat gives.
@@ -6555,7 +6555,7 @@ const Yr = {
6555
6555
  headTurns: {},
6556
6556
  drift: []
6557
6557
  }, Re = 2.6;
6558
- function Zc() {
6558
+ function Qc() {
6559
6559
  const e = (o, n, a, r, s) => {
6560
6560
  const i = o.values.rotor ?? 0;
6561
6561
  o.set("rotor", n, i);
@@ -6604,7 +6604,7 @@ function Zc() {
6604
6604
  }
6605
6605
  };
6606
6606
  }
6607
- function Qc(e = {}) {
6607
+ function e0(e = {}) {
6608
6608
  const t = { body: "#e9e4d8", wings: "#d9483b", glass: "#cfeaf5", trim: "#2c2c33", ...e.colors }, o = 3.15, a = {
6609
6609
  parts: [
6610
6610
  { id: "fuselage", shape: { type: "extrude", profile: [[-3.7, 1.55], [-2.6, 1.05], [2.4, 0.85], [3, 1], [3.1, 1.4], [2.7, 1.75], [1.4, 1.9], [-2.9, 1.85]], width: 1 }, fill: t.body },
@@ -6645,17 +6645,17 @@ function Qc(e = {}) {
6645
6645
  family: "aircraft",
6646
6646
  summary: e.summary ?? "A propeller plane: takes off from a run, flies banked, loops the loop, and lands with a flare and a squash.",
6647
6647
  rig: a,
6648
- actions: t0(),
6648
+ actions: o0(),
6649
6649
  acting: Yr,
6650
6650
  colors: { body: t.body, ink: "#26262b" },
6651
6651
  moves: { fly: { speed: 30, flies: !0, hold: { blur: 1 }, perSecond: { rotor: Re * 1e3 } } }
6652
6652
  };
6653
6653
  }
6654
- const e0 = 3.2;
6655
- function t0() {
6654
+ const t0 = 3.2;
6655
+ function o0() {
6656
6656
  const e = (o, n, a, r) => {
6657
6657
  const s = o.values.rotor ?? 0;
6658
- o.set("rotor", n, s), o.set("rotor", a, s + e0 * (a - n) * (r ? 0.5 : 1), r);
6658
+ o.set("rotor", n, s), o.set("rotor", a, s + t0 * (a - n) * (r ? 0.5 : 1), r);
6659
6659
  }, t = (o, n, a) => {
6660
6660
  const r = Math.sign(a - o.x);
6661
6661
  return r !== 0 && o.facing() !== r ? o.turnTo(n, r > 0 ? "right" : "left") : n;
@@ -6704,7 +6704,7 @@ function t0() {
6704
6704
  }
6705
6705
  };
6706
6706
  }
6707
- const _t = ["walk", "trot", "canter", "gallop"], hf = _t, Ur = ["fl", "fr", "hl", "hr"], po = {
6707
+ const _t = ["walk", "trot", "canter", "gallop"], cf = _t, Ur = ["fl", "fr", "hl", "hr"], po = {
6708
6708
  walk: { offsets: { hl: 0, fl: 0.25, hr: 0.5, fr: 0.75 }, swing: 16, lift: 45, bob: 0.02, rock: 0, cycle: 1100 },
6709
6709
  trot: { offsets: { fl: 0, hr: 0, fr: 0.5, hl: 0.5 }, swing: 22, lift: 75, bob: 0.05, rock: 0, cycle: 640 },
6710
6710
  canter: { offsets: { hr: 0, hl: 0.33, fr: 0.33, fl: 0.66 }, swing: 30, lift: 70, bob: 0.08, rock: 5, cycle: 560 },
@@ -6719,7 +6719,7 @@ function Ze(e) {
6719
6719
  // The neck tapers from the shoulders up to the head.
6720
6720
  { id: "neck", shape: { type: "tube", points: e.neck.points, radius: e.neck.points.map((d, f, u) => e.neck.radius * (1.25 - 0.4 * f / Math.max(1, u.length - 1))), segments: 12 }, at: e.neck.at, fill: o.coat },
6721
6721
  { id: "head", parent: "neck", shape: { type: "ellipsoid", radii: e.head.radii, segments: 14 }, at: e.head.at, rotate: e.head.rotate, fill: o.coat },
6722
- ...n0(e, o, a)
6722
+ ...s0(e, o, a)
6723
6723
  ];
6724
6724
  e.mane && s.push({ id: "mane", parent: "neck", shape: { type: "tube", points: e.mane.points, radius: e.mane.radius, segments: 6 }, fill: o.dark, outline: 0.7 }), e.muzzle && s.push({ id: "muzzle", parent: "head", shape: { type: "ellipsoid", radii: e.muzzle.radii, segments: 10 }, at: e.muzzle.at, fill: o.muzzle, outline: 0.8 });
6725
6725
  for (const d of [1, -1]) {
@@ -6766,7 +6766,7 @@ function Ze(e) {
6766
6766
  front: { at: [0, a, e.body.radii[2]] },
6767
6767
  ...e.anchors
6768
6768
  },
6769
- derive: (d) => s0(d, e, n)
6769
+ derive: (d) => r0(d, e, n)
6770
6770
  }, l = {
6771
6771
  legLength: n,
6772
6772
  upper: t.upper,
@@ -6785,17 +6785,17 @@ function Ze(e) {
6785
6785
  family: "animal",
6786
6786
  summary: e.summary,
6787
6787
  rig: c,
6788
- actions: { ...a0(e, l), ...e.actions?.(l) },
6788
+ actions: { ...i0(e, l), ...e.actions?.(l) },
6789
6789
  acting: Xr,
6790
6790
  colors: { body: o.coat, ink: "#26262b" },
6791
6791
  follow: [
6792
6792
  { control: "tail", of: "x", per: 0.6, stiffness: 90, damping: 6, limit: 40 },
6793
6793
  { control: "ears", of: "x", per: 1.4, stiffness: 150, damping: 8, limit: 45 }
6794
6794
  ],
6795
- moves: o0(e, n)
6795
+ moves: n0(e, n)
6796
6796
  };
6797
6797
  }
6798
- function o0(e, t) {
6798
+ function n0(e, t) {
6799
6799
  const o = (a) => {
6800
6800
  const r = An(t, a);
6801
6801
  return {
@@ -6808,7 +6808,7 @@ function o0(e, t) {
6808
6808
  return e.gaits.includes("gallop") && !n.gallop && (n.gallop = o("gallop")), n;
6809
6809
  }
6810
6810
  const Ee = Array.from({ length: 7 }, (e, t) => t === 0 ? "tail" : `tail-${t}`);
6811
- function n0(e, t, o) {
6811
+ function s0(e, t, o) {
6812
6812
  const n = yr(e.tail.points, Ee.length + 1), [, a, r] = e.body.radii, s = (e.tail.at[1] - o) / a, i = Math.abs(s) < 1 ? -r * Math.sqrt(1 - s * s) : e.tail.at[2], h = [e.tail.at[0], e.tail.at[1], i + Math.min(0.04, r * 0.08)], c = (u) => e.tail.radius * (1 - 0.5 * u / Ee.length), l = Ee.map((u, p) => {
6813
6813
  const g = n[p], b = n[p + 1], T = [b[0] - g[0], b[1] - g[1], b[2] - g[2]], H = p === 0 ? void 0 : n[p - 1];
6814
6814
  return {
@@ -6831,7 +6831,7 @@ function n0(e, t, o) {
6831
6831
  solidOnly: !0
6832
6832
  }), l;
6833
6833
  }
6834
- function s0(e, t, o) {
6834
+ function r0(e, t, o) {
6835
6835
  const n = Math.max(0, Math.min(1, e.walking ?? 0));
6836
6836
  if (n === 0) return {};
6837
6837
  const a = _t[Math.max(0, Math.min(3, Math.round(e.gait ?? 0)))], r = po[t.gaits.includes(a) ? a : t.gaits[0]], s = e.walk ?? 0, i = {};
@@ -6864,8 +6864,8 @@ const Xr = {
6864
6864
  eyes: [],
6865
6865
  headTurns: {},
6866
6866
  drift: []
6867
- }, cf = Xr;
6868
- function r0(e) {
6867
+ }, df = Xr;
6868
+ function a0(e) {
6869
6869
  const t = (e.upper + e.lower) * 0.32, o = Math.asin(Math.min(1, t / (e.upper + e.lower + e.foot))) / ze, n = {
6870
6870
  pitch: 0,
6871
6871
  lift: t - e.legLength,
@@ -6882,7 +6882,7 @@ function r0(e) {
6882
6882
  n[`${a}.swing`] = 70, n[`${a}.knee`] = -155, n[`${a}.ankle`] = 85;
6883
6883
  return n;
6884
6884
  }
6885
- function a0(e, t) {
6885
+ function i0(e, t) {
6886
6886
  const o = e.cycleScale ?? 1, n = (s) => ({
6887
6887
  summary: {
6888
6888
  walk: "Walks to `to` (four beats), its head bobbing.",
@@ -6928,7 +6928,7 @@ function a0(e, t) {
6928
6928
  summary: "Lies down for `for` ms (default 2000), head up and front paws forward (sinking back onto its haunches first), then gets up.",
6929
6929
  uses: ["for"],
6930
6930
  run(s, i, h) {
6931
- const c = r0(t), l = { ...Ws(t) }, d = h + 400, f = d + 450;
6931
+ const c = a0(t), l = { ...Ws(t) }, d = h + 400, f = d + 450;
6932
6932
  s.key(d, l, { act: !1, easing: "ease-in-out" }), s.key(f, c, { act: !1, easing: "ease-in-out" }), s.key(f + (i.for ?? 2e3), c, { act: !1 });
6933
6933
  const u = f + (i.for ?? 2e3) + 600, p = {};
6934
6934
  for (const g of /* @__PURE__ */ new Set([...Object.keys(c), ...Object.keys(l)])) p[g] = 0;
@@ -6974,7 +6974,7 @@ function a0(e, t) {
6974
6974
  }
6975
6975
  }), r;
6976
6976
  }
6977
- function i0(e = {}) {
6977
+ function l0(e = {}) {
6978
6978
  return Ze({
6979
6979
  kind: e.kind ?? "horse",
6980
6980
  summary: e.summary ?? "A cartoon horse: walks, trots, canters and gallops with its hooves in step with the ground, rears, bucks, neighs, grazes and swishes its tail.",
@@ -7014,7 +7014,7 @@ function i0(e = {}) {
7014
7014
  })
7015
7015
  });
7016
7016
  }
7017
- function l0(e = {}) {
7017
+ function h0(e = {}) {
7018
7018
  return Ze({
7019
7019
  kind: e.kind ?? "dog",
7020
7020
  summary: e.summary ?? "A cartoon dog: walks, trots and runs, barks, wags its tail, sits, jumps, sniffs the ground.",
@@ -7056,7 +7056,7 @@ function l0(e = {}) {
7056
7056
  })
7057
7057
  });
7058
7058
  }
7059
- function h0(e = {}) {
7059
+ function c0(e = {}) {
7060
7060
  return Ze({
7061
7061
  kind: e.kind ?? "cat",
7062
7062
  summary: e.summary ?? "A cartoon cat: walks, trots and runs, meows, arches its back, pounces, sits and swishes its tail.",
@@ -7101,7 +7101,7 @@ function h0(e = {}) {
7101
7101
  })
7102
7102
  });
7103
7103
  }
7104
- function c0(e = {}) {
7104
+ function d0(e = {}) {
7105
7105
  return Ze({
7106
7106
  kind: e.kind ?? "cow",
7107
7107
  summary: e.summary ?? "A cartoon cow: walks and trots, moos, grazes, sits and swishes its tail.",
@@ -7128,10 +7128,10 @@ function c0(e = {}) {
7128
7128
  grazes: !0
7129
7129
  });
7130
7130
  }
7131
- function df(e) {
7131
+ function ff(e) {
7132
7132
  return An(1, e);
7133
7133
  }
7134
- function d0(e = {}) {
7134
+ function f0(e = {}) {
7135
7135
  return Ze({
7136
7136
  kind: e.kind ?? "goat",
7137
7137
  summary: e.summary ?? "A goat: walks, trots and gallops, bleats, grazes, sits, lies, jumps, and swishes its stubby tail.",
@@ -7157,7 +7157,7 @@ function d0(e = {}) {
7157
7157
  grazes: !0
7158
7158
  });
7159
7159
  }
7160
- function f0(e = {}) {
7160
+ function u0(e = {}) {
7161
7161
  return Ze({
7162
7162
  kind: e.kind ?? "rabbit",
7163
7163
  summary: e.summary ?? "A rabbit: walks and hops (gallop), squeaks, nibbles the ground (graze), sits, lies and jumps; long ears and a puff of a tail.",
@@ -7178,7 +7178,7 @@ function f0(e = {}) {
7178
7178
  grazes: !0
7179
7179
  });
7180
7180
  }
7181
- function u0(e = {}) {
7181
+ function g0(e = {}) {
7182
7182
  return Ze({
7183
7183
  kind: e.kind ?? "squirrel",
7184
7184
  summary: e.summary ?? "A squirrel: scampers (gallop) and walks, chatters, sits up, nibbles (graze), with a bushy tail curled over its back.",
@@ -7318,24 +7318,24 @@ function Qe(e) {
7318
7318
  family: "bird",
7319
7319
  summary: e.summary,
7320
7320
  rig: c,
7321
- actions: m0(e),
7322
- acting: p0,
7321
+ actions: y0(e),
7322
+ acting: m0,
7323
7323
  colors: { body: t.body, ink: "#26262b" },
7324
- moves: g0(e)
7324
+ moves: p0(e)
7325
7325
  };
7326
7326
  }
7327
- function g0(e) {
7327
+ function p0(e) {
7328
7328
  const t = e.legs.length * 1.2, o = { walk: { speed: t / 0.42, hold: { stepping: 1 }, perMetre: { step: 0.5 / t } } };
7329
7329
  return e.flies !== !1 && (o.fly = { speed: 4 + e.wing.span * 12, flies: !0, hold: { flapping: 1, spread: 1 }, perSecond: { wingbeat: e.beatsPerSecond ?? 4 } }), o;
7330
7330
  }
7331
- const p0 = {
7331
+ const m0 = {
7332
7332
  depth: { turn: 0, lift: 0, pitch: 1, roll: 1, squash: 1, spread: 1, flap: 2, peck: 2 },
7333
7333
  limits: { pitch: 6, roll: 6, squash: 0.06, peck: 8, flap: 10, lift: 0 },
7334
7334
  eyes: [],
7335
7335
  headTurns: {},
7336
7336
  drift: []
7337
7337
  };
7338
- function m0(e) {
7338
+ function y0(e) {
7339
7339
  const t = (e.beatsPerSecond ?? 4) / 1e3, o = (s, i, h) => {
7340
7340
  const c = s.values.wingbeat ?? 0;
7341
7341
  s.set("wingbeat", i, c), s.set("wingbeat", h, c + (h - i) * t);
@@ -7431,7 +7431,7 @@ function m0(e) {
7431
7431
  }
7432
7432
  }, r;
7433
7433
  }
7434
- function y0(e = {}) {
7434
+ function b0(e = {}) {
7435
7435
  return Qe({
7436
7436
  kind: "songbird",
7437
7437
  summary: "A small songbird: hops, pecks, tweets, flaps, flies and lands (on the ground, a branch or a roof).",
@@ -7446,7 +7446,7 @@ function y0(e = {}) {
7446
7446
  beatsPerSecond: 9
7447
7447
  });
7448
7448
  }
7449
- function b0(e = {}) {
7449
+ function w0(e = {}) {
7450
7450
  return Qe({
7451
7451
  kind: "crow",
7452
7452
  summary: "A crow: walks and hops, pecks, caws, flaps, flies and lands (on the ground, a branch or a roof).",
@@ -7461,7 +7461,7 @@ function b0(e = {}) {
7461
7461
  beatsPerSecond: 4
7462
7462
  });
7463
7463
  }
7464
- function w0(e = {}) {
7464
+ function k0(e = {}) {
7465
7465
  return Qe({
7466
7466
  kind: "chicken",
7467
7467
  summary: "A chicken: walks with a bobbing head, pecks, clucks, and flutters up and down (it cannot really fly).",
@@ -7479,7 +7479,7 @@ function w0(e = {}) {
7479
7479
  flies: !1
7480
7480
  });
7481
7481
  }
7482
- function k0(e = {}) {
7482
+ function v0(e = {}) {
7483
7483
  return Qe({
7484
7484
  kind: "pigeon",
7485
7485
  summary: "A pigeon: walks with a bobbing head, pecks at crumbs, coos, flaps, flies and lands (on the ground, a ledge or a branch).",
@@ -7495,7 +7495,7 @@ function k0(e = {}) {
7495
7495
  stoop: 16
7496
7496
  });
7497
7497
  }
7498
- function v0(e = {}) {
7498
+ function S0(e = {}) {
7499
7499
  return Qe({
7500
7500
  kind: "duck",
7501
7501
  summary: "A duck: waddles, dabbles with its bill (peck), quacks, flaps, flies and lands (on the ground or the water’s edge).",
@@ -7512,7 +7512,7 @@ function v0(e = {}) {
7512
7512
  neckReach: 0.04
7513
7513
  });
7514
7514
  }
7515
- function S0(e = {}) {
7515
+ function M0(e = {}) {
7516
7516
  return Qe({
7517
7517
  kind: "owl",
7518
7518
  summary: "An owl: a big round head, slow silent wingbeats; hoots, turns its head, flies and lands on a branch.",
@@ -7528,7 +7528,7 @@ function S0(e = {}) {
7528
7528
  stoop: 6
7529
7529
  });
7530
7530
  }
7531
- function M0(e = {}) {
7531
+ function $0(e = {}) {
7532
7532
  return Qe({
7533
7533
  kind: "parrot",
7534
7534
  summary: "A parrot: bright, with a big hooked beak and a long tail; squawks, bobs, flies and lands on a perch, gripping it.",
@@ -7544,13 +7544,13 @@ function M0(e = {}) {
7544
7544
  stoop: 10
7545
7545
  });
7546
7546
  }
7547
- const Ht = { car: $c, truck: Ec, bus: Ac, tractor: Tc, cart: Pc, trainCar: Oc, bike: Hc, motorbike: Ic, tree: xc, house: Kc, chair: Rc, desk: Lc, bed: Fc, door: Bc, wheelchair: Uc, helicopter: Jc, airplane: Qc, horse: i0, dog: l0, cat: h0, cow: c0, goat: d0, rabbit: f0, squirrel: u0, songbird: y0, crow: b0, chicken: w0, pigeon: k0, duck: v0, owl: S0, parrot: M0 };
7547
+ const Ht = { car: Ec, truck: Ac, bus: Tc, tractor: Pc, cart: Oc, trainCar: Hc, bike: Ic, motorbike: xc, tree: jc, house: Cc, chair: Wc, desk: Fc, bed: qc, door: Gc, wheelchair: Xc, helicopter: Zc, airplane: e0, horse: l0, dog: h0, cat: c0, cow: d0, goat: f0, rabbit: u0, squirrel: g0, songbird: b0, crow: w0, chicken: k0, pigeon: v0, duck: S0, owl: M0, parrot: $0 };
7548
7548
  function Jr(e, t = {}) {
7549
7549
  const o = Ht[e];
7550
7550
  if (!o) throw new Error(fe("prop preset", e, Object.keys(Ht)));
7551
7551
  return o(t);
7552
7552
  }
7553
- const en = ["do", "at", "for", "to", "toward", "speed", "open", "on", "height", "wind"], tn = { viewer: 0, right: 1, away: 2, left: 3 }, $0 = 420, Zr = {
7553
+ const en = ["do", "at", "for", "to", "toward", "speed", "open", "on", "height", "wind"], tn = { viewer: 0, right: 1, away: 2, left: 3 }, E0 = 420, Zr = {
7554
7554
  hold: {
7555
7555
  summary: "Holds still (`for` ms, default 1000).",
7556
7556
  run: (e, t, o) => ({ end: o + (t.for ?? 1e3) })
@@ -7581,7 +7581,7 @@ function Tn(e) {
7581
7581
  return { ...Zr, ...e.actions };
7582
7582
  }
7583
7583
  const Wo = (e) => typeof e == "number" && Number.isFinite(e);
7584
- function E0(e, t) {
7584
+ function A0(e, t) {
7585
7585
  if (!Array.isArray(e)) return [{ level: "error", beat: -1, message: `Beats must be an array of { do: … } objects (got ${typeof e}).` }];
7586
7586
  const o = Tn(t), n = Object.keys(o), a = [];
7587
7587
  return e.forEach((r, s) => {
@@ -7595,15 +7595,15 @@ function E0(e, t) {
7595
7595
  for (const c of ["at", "for", "speed", "height", "wind"])
7596
7596
  h[c] !== void 0 && !(Wo(h[c]) && h[c] >= 0) && i(`\`${c}\` must be a number ≥ 0 (got ${JSON.stringify(h[c])}).`);
7597
7597
  if (h.to !== void 0 && !Wo(h.to) && i(`\`to\` is a scene x in px (got ${JSON.stringify(h.to)}).`), h.toward !== void 0 && !Wo(h.toward) && !(typeof h.toward == "string" && h.toward in tn)) {
7598
- const c = typeof h.toward == "string" ? Do(h.toward, Object.keys(tn)) : void 0;
7598
+ const c = typeof h.toward == "string" ? Fo(h.toward, Object.keys(tn)) : void 0;
7599
7599
  i(`\`toward\` is viewer, right, away, left or a quarter-turn number${c ? ` (did you mean "${c}"?)` : ""} (got ${JSON.stringify(h.toward)}).`);
7600
7600
  }
7601
7601
  for (const c of ["open", "on"])
7602
7602
  h[c] !== void 0 && typeof h[c] != "boolean" && i(`\`${c}\` is true or false (got ${JSON.stringify(h[c])}).`);
7603
7603
  }), a;
7604
7604
  }
7605
- function A0(e, t, o, n = {}) {
7606
- const a = E0(o, t).filter((v) => v.level === "error");
7605
+ function T0(e, t, o, n = {}) {
7606
+ const a = A0(o, t).filter((v) => v.level === "error");
7607
7607
  if (a.length > 0) throw new Error(`propScript (${t.kind}): ${a.length} problem(s) in the beats:
7608
7608
  ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7609
7609
  `)}`);
@@ -7644,7 +7644,7 @@ ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7644
7644
  turnTo(v, w) {
7645
7645
  const E = typeof w == "number" ? w : tn[w], O = l.turn, x = [E - 4, E, E + 4].map((G) => ({ t: G, d: Math.abs(G - O) })).sort((G, Y) => G.d - Y.d || Math.abs(G.t) - Math.abs(Y.t))[0];
7646
7646
  if (x.d < 1e-3) return v;
7647
- const W = v + $0 * Math.max(1, x.d);
7647
+ const W = v + E0 * Math.max(1, x.d);
7648
7648
  return H.key(W, { turn: x.t }), W;
7649
7649
  },
7650
7650
  effect(v) {
@@ -7661,12 +7661,12 @@ ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7661
7661
  const w = Math.max(v.at ?? m, d[d.length - 1].time), E = c[v.do].run(H, v, w);
7662
7662
  E.end > d[d.length - 1].time && d.push({ time: E.end, pose: { ...l } }), M.push({ start: w, end: E.end, ...E.contact !== void 0 ? { contact: E.contact } : {}, ...E.release !== void 0 ? { release: E.release } : {} }), m = E.end;
7663
7663
  }
7664
- const P = Hr(n.style ?? "snappy"), A = { ...P, anticipation: P.anticipation * h, overshoot: P.overshoot * h }, k = kn(H0(d), t.acting, { style: A }), y = [
7664
+ const P = Hr(n.style ?? "snappy"), A = { ...P, anticipation: P.anticipation * h, overshoot: P.overshoot * h }, k = kn(I0(d), t.acting, { style: A }), y = [
7665
7665
  // Controls keyed exactly (wheels, rotors) are not acted.
7666
7666
  ...Object.entries(k).filter(([v]) => !f.has(v)).map(([v, w]) => ({ id: `${e}-${v}`, target: e, property: v, keyframes: w })),
7667
- ...[...f].map(([v, w]) => ({ id: `${e}-${v}`, target: e, property: v, keyframes: I0(w) }))
7667
+ ...[...f].map(([v, w]) => ({ id: `${e}-${v}`, target: e, property: v, keyframes: x0(w) }))
7668
7668
  ];
7669
- for (const v of P0(e, t, y, m, d[0].pose)) {
7669
+ for (const v of O0(e, t, y, m, d[0].pose)) {
7670
7670
  const w = y.findIndex((j) => j.property === v.property);
7671
7671
  if (w < 0) {
7672
7672
  y.push(v);
@@ -7677,37 +7677,37 @@ ${a.map((v) => ` beat ${v.beat}: ${v.message}`).join(`
7677
7677
  }
7678
7678
  return { tracks: y, duration: m, beats: M, effects: u };
7679
7679
  }
7680
- const T0 = 1500;
7681
- function P0(e, t, o, n, a) {
7680
+ const P0 = 1500;
7681
+ function O0(e, t, o, n, a) {
7682
7682
  if (!t.follow?.length) return [];
7683
7683
  const r = new ve({ id: `${e}-follow`, tracks: o.filter((i) => i.property === "turn" || t.follow.some((h) => h.of === i.property)) }), s = (i, h) => {
7684
7684
  const c = r.getStateAtTime(i).values.get(e)?.get(h);
7685
7685
  return typeof c == "number" ? c : a[h] ?? 0;
7686
7686
  };
7687
7687
  return t.follow.map((i) => {
7688
- const h = n + T0, c = Bt((f) => s(f, i.of), { start: 0, end: h, stiffness: i.stiffness, damping: i.damping }), l = i.limit ?? 1 / 0, d = c.map(({ time: f, value: u }) => {
7688
+ const h = n + P0, c = Bt((f) => s(f, i.of), { start: 0, end: h, stiffness: i.stiffness, damping: i.damping }), l = i.limit ?? 1 / 0, d = c.map(({ time: f, value: u }) => {
7689
7689
  const p = Math.sin(s(f, "turn") * Math.PI / 2), g = (u - s(f, i.of)) * p;
7690
7690
  return { time: f, value: Math.max(-l, Math.min(l, g * i.per)) };
7691
7691
  });
7692
7692
  return { id: `${e}-${i.control}`, target: e, property: i.control, keyframes: d };
7693
7693
  });
7694
7694
  }
7695
- const O0 = 20;
7696
- function H0(e) {
7695
+ const H0 = 20;
7696
+ function I0(e) {
7697
7697
  const t = [...e].sort((n, a) => n.time - a.time), o = [];
7698
7698
  for (const n of t) {
7699
7699
  const a = o[o.length - 1];
7700
- a && n.time - a.time < O0 ? o[o.length - 1] = { ...n, time: a.time } : o.push(n);
7700
+ a && n.time - a.time < H0 ? o[o.length - 1] = { ...n, time: a.time } : o.push(n);
7701
7701
  }
7702
7702
  return o;
7703
7703
  }
7704
- function I0(e) {
7704
+ function x0(e) {
7705
7705
  const t = e.map((n, a) => ({ k: n, i: a })).sort((n, a) => n.k.time - a.k.time || n.i - a.i), o = [];
7706
7706
  for (const { k: n } of t)
7707
7707
  o.length > 0 && o[o.length - 1].time === n.time ? o[o.length - 1] = n : o.push(n);
7708
7708
  return o;
7709
7709
  }
7710
- const x0 = {
7710
+ const j0 = {
7711
7711
  linear: !0,
7712
7712
  "ease-in": !0,
7713
7713
  "ease-out": !0,
@@ -7719,7 +7719,7 @@ const x0 = {
7719
7719
  "ease-out-cubic": !0,
7720
7720
  "ease-in-out-cubic": !0
7721
7721
  };
7722
- function j0(e, t = {}) {
7722
+ function _0(e, t = {}) {
7723
7723
  const o = {};
7724
7724
  for (const n of Object.keys(Ke)) o[n] = { summary: `Walks to \`to\` in the ${n} gait.`, needs: ["to"] };
7725
7725
  for (const n of Object.keys(Ae)) o[n] = { summary: `Moves into the ${n} pose and holds it (\`for\` ms).` };
@@ -7730,7 +7730,7 @@ function j0(e, t = {}) {
7730
7730
  ...e ? { version: e } : {},
7731
7731
  timing: "JSON timelines and tracks are in milliseconds; the GSAP-style API (live.to, tf.timeline) takes seconds. Scene x grows right, y grows down, in px.",
7732
7732
  easings: {
7733
- named: Object.keys(x0),
7733
+ named: Object.keys(j0),
7734
7734
  parametric: {
7735
7735
  "cubic-bezier": '{ type: "cubic-bezier", points: [x1, y1, x2, y2] }',
7736
7736
  steps: '{ type: "steps", count, position?: start | end | none | both }',
@@ -7746,7 +7746,7 @@ function j0(e, t = {}) {
7746
7746
  motionPath: '{ property: "motionPath", path, align? }: moves along an SVG path',
7747
7747
  text: '{ property: "text", … }: types or scrambles text'
7748
7748
  },
7749
- canvasProperties: Wa,
7749
+ canvasProperties: za,
7750
7750
  stickFigure: {
7751
7751
  poseFields: ka,
7752
7752
  props: wa,
@@ -7761,7 +7761,7 @@ function j0(e, t = {}) {
7761
7761
  dances: Object.fromEntries(Object.entries(Je).map(([n, a]) => [n, Object.keys(a.moves)])),
7762
7762
  flips: Object.fromEntries(Object.entries(ho).map(([n, a]) => [n, a.label])),
7763
7763
  handShapes: Object.keys(we),
7764
- mudras: Object.keys(Fo)
7764
+ mudras: Object.keys(Do)
7765
7765
  },
7766
7766
  props: {
7767
7767
  api: {
@@ -7819,6 +7819,8 @@ function j0(e, t = {}) {
7819
7819
  figureStyles: ["fluid", "stick", "organic"],
7820
7820
  body: {
7821
7821
  "body.torso · body.arm · body.leg · body.neck": "Organic half-width profiles: [{ at: 0..1, width: fractionOfHeight }], increasing from 0 to 1; independent of ink width.",
7822
+ "body.measurements": `Organic torso from tape-measure girths { height, bust, underbust?, waist, hip } in any one unit, or a named shape (${Object.keys(Na).join(" | ")}). Sets the front width, the side depth (bust forward, seat back, belly) and the hip and thigh spacing; reads correctly at every turn. An explicit torso / torsoFront / torsoBack / hipWidth still wins.`,
7823
+ "body.torsoFront · body.torsoBack": "Organic side-view depth from the spine line toward the chest/belly and toward the back/seat, same profile format; default torso × depth.",
7822
7824
  "body.fill · body.outline · body.shading": "Shared skin fill, outline { color, width }, cel material { mode: cel | none, light: [x,y], shadow, opacity, highlight }.",
7823
7825
  "softCartoonCharacter(name, options?)": "Original youngMan / youngWoman / childBoy / childGirl story presets. Children have larger head proportions, shorter limbs and rounded torsos; every face, hair, build, hand, clothing and material option can be overridden.",
7824
7826
  "face.projection": "Organic default volume follows the head axes, keeps both eyes in three-quarter views and projects a small nose above the mouth; opaque hair covers features. cartoon keeps the classic face slide.",
@@ -7884,8 +7886,8 @@ function j0(e, t = {}) {
7884
7886
  }
7885
7887
  const ue = (e) => e.map((t) => `\`${t}\``).join(", "), zs = (e) => Object.entries(e).map(([t, o]) => `| \`${t}\` | ${o.unit ?? o.kind ?? ""} | ${o.description} |`).join(`
7886
7888
  `);
7887
- function ff(e, t = {}) {
7888
- const o = j0(e, t), n = o.stickFigure;
7889
+ function uf(e, t = {}) {
7890
+ const o = _0(e, t), n = o.stickFigure;
7889
7891
  return [
7890
7892
  `# tinyfly capabilities${o.version ? ` (v${o.version})` : ""}`,
7891
7893
  "",
@@ -8073,16 +8075,16 @@ function ff(e, t = {}) {
8073
8075
  ].join(`
8074
8076
  `);
8075
8077
  }
8076
- function uf(e, t, o, n = {}) {
8078
+ function gf(e, t, o, n = {}) {
8077
8079
  const a = n.color ?? "#555", r = n.size ?? 60;
8078
8080
  for (const s of t) {
8079
8081
  const i = (o - s.time) / s.length;
8080
8082
  if (i <= 0 || i >= 1) continue;
8081
- const h = De(`${s.kind}:${s.time}:${s.x}`);
8082
- s.kind === "dust" ? ah(e, { x: s.x, y: s.y }, i, { size: r, color: a, seed: h }) : s.kind === "exhaust" ? C0(e, s, i, r, a, h) : s.kind === "skid" ? N0(e, s, i, o, a) : s.kind === "honk" ? R0(e, s, i, r, a) : s.kind === "smoke" ? _0(e, s, o, r, a) : s.kind === "leaves" && K0(e, s, i, r, n.leafColor ?? "#5cae5a", a, h);
8083
+ const h = Fe(`${s.kind}:${s.time}:${s.x}`);
8084
+ s.kind === "dust" ? ih(e, { x: s.x, y: s.y }, i, { size: r, color: a, seed: h }) : s.kind === "exhaust" ? N0(e, s, i, r, a, h) : s.kind === "skid" ? R0(e, s, i, o, a) : s.kind === "honk" ? W0(e, s, i, r, a) : s.kind === "smoke" ? K0(e, s, o, r, a) : s.kind === "leaves" && C0(e, s, i, r, n.leafColor ?? "#5cae5a", a, h);
8083
8085
  }
8084
8086
  }
8085
- function _0(e, t, o, n, a, r) {
8087
+ function K0(e, t, o, n, a, r) {
8086
8088
  const s = t.direction ?? 1, i = 380, h = 1500;
8087
8089
  e.save(), e.strokeStyle = a, e.lineWidth = Math.max(1, n * 0.025);
8088
8090
  for (let c = t.time; c <= t.time + t.length - h; c += i) {
@@ -8093,34 +8095,34 @@ function _0(e, t, o, n, a, r) {
8093
8095
  }
8094
8096
  e.restore();
8095
8097
  }
8096
- function K0(e, t, o, n, a, r, s) {
8098
+ function C0(e, t, o, n, a, r, s) {
8097
8099
  const i = t.direction ?? 1, h = t.toY ?? t.y + n * 3;
8098
8100
  e.save(), e.lineWidth = Math.max(1, n * 0.02), e.strokeStyle = r, e.fillStyle = a;
8099
8101
  for (let c = 0; c < 4; c++) {
8100
- const l = De(`${s}:${c}`) % 1e3 / 1e3, d = Math.min(1, o * (1.1 + l * 0.4)), f = t.x + (l - 0.5) * n * 1.2, u = t.y + (l - 0.3) * n * 0.4, p = d * d * 0.4 + d * 0.6, g = f + i * d * n * (0.6 + l) + Math.sin(d * 9 + l * 6) * n * 0.18, b = Math.min(h - 2, u + (h - u) * p);
8102
+ const l = Fe(`${s}:${c}`) % 1e3 / 1e3, d = Math.min(1, o * (1.1 + l * 0.4)), f = t.x + (l - 0.5) * n * 1.2, u = t.y + (l - 0.3) * n * 0.4, p = d * d * 0.4 + d * 0.6, g = f + i * d * n * (0.6 + l) + Math.sin(d * 9 + l * 6) * n * 0.18, b = Math.min(h - 2, u + (h - u) * p);
8101
8103
  e.globalAlpha = o > 0.85 ? (1 - o) / 0.15 : 1, e.save(), e.translate(g, b), e.rotate(Math.sin(d * 7 + l * 5) * 1.2), e.beginPath(), e.ellipse(0, 0, n * 0.07, n * 0.035, 0, 0, Math.PI * 2), e.fill(), e.stroke(), e.restore();
8102
8104
  }
8103
8105
  e.restore();
8104
8106
  }
8105
- function C0(e, t, o, n, a, r) {
8107
+ function N0(e, t, o, n, a, r) {
8106
8108
  const s = t.direction ?? -1;
8107
8109
  e.save(), e.strokeStyle = a, e.lineWidth = Math.max(1, n * 0.025);
8108
8110
  for (let i = 0; i < 3; i++) {
8109
8111
  const h = o * 1.6 - i * 0.25;
8110
8112
  if (h <= 0 || h >= 1) continue;
8111
- const c = (De(`${r}:${i}`) % 100 / 100 - 0.5) * n * 0.1, l = t.x + s * h * n * 0.9, d = t.y - h * n * 0.45 + c;
8113
+ const c = (Fe(`${r}:${i}`) % 100 / 100 - 0.5) * n * 0.1, l = t.x + s * h * n * 0.9, d = t.y - h * n * 0.45 + c;
8112
8114
  e.globalAlpha = (1 - h) * 0.9, e.beginPath(), e.arc(l, d, n * (0.06 + h * 0.14), 0, Math.PI * 2), e.stroke();
8113
8115
  }
8114
8116
  e.restore();
8115
8117
  }
8116
- function N0(e, t, o, n, a) {
8118
+ function R0(e, t, o, n, a) {
8117
8119
  const r = t.toX ?? t.x, s = Math.min(1, (n - t.time) / t.length * 3), i = t.x + (r - t.x) * s;
8118
8120
  e.save(), e.strokeStyle = a, e.lineCap = "round", e.globalAlpha = o < 0.6 ? 0.8 : 0.8 * (1 - (o - 0.6) / 0.4), e.lineWidth = 3;
8119
8121
  for (const h of [-2, 4])
8120
8122
  e.beginPath(), e.moveTo(t.x, t.y + h), e.lineTo(i, t.y + h), e.stroke();
8121
8123
  e.restore();
8122
8124
  }
8123
- function R0(e, t, o, n, a) {
8125
+ function W0(e, t, o, n, a) {
8124
8126
  const r = t.direction ?? 1;
8125
8127
  e.save(), e.strokeStyle = a, e.lineWidth = Math.max(1.5, n * 0.04), e.lineCap = "round", e.globalAlpha = o < 0.7 ? 1 : (1 - o) / 0.3;
8126
8128
  const s = n * (0.15 + 0.5 * (1 - (1 - o) ** 2));
@@ -8130,7 +8132,7 @@ function R0(e, t, o, n, a) {
8130
8132
  }
8131
8133
  e.restore();
8132
8134
  }
8133
- function gf(e) {
8135
+ function pf(e) {
8134
8136
  const t = new ve({ id: `${e.propId}-ride`, tracks: e.propTracks.filter((l) => l.target === e.propId) }), o = e.every ?? 33, n = [], a = [], r = [], s = [];
8135
8137
  let i = 1;
8136
8138
  for (let l = e.start; ; l = Math.min(e.end, l + o)) {
@@ -8143,9 +8145,9 @@ function gf(e) {
8143
8145
  { id: `${h}-x`, target: h, property: "x", keyframes: n },
8144
8146
  { id: `${h}-y`, target: h, property: "y", keyframes: a }
8145
8147
  ];
8146
- return e.turn !== !1 && c.push({ id: `${h}-turn`, target: h, property: "turn", keyframes: r }, { id: `${h}-facing`, target: h, property: "facing", keyframes: W0(s) }), c;
8148
+ return e.turn !== !1 && c.push({ id: `${h}-turn`, target: h, property: "turn", keyframes: r }, { id: `${h}-facing`, target: h, property: "facing", keyframes: z0(s) }), c;
8147
8149
  }
8148
- function W0(e) {
8150
+ function z0(e) {
8149
8151
  const t = [];
8150
8152
  for (const o of e) {
8151
8153
  const n = t[t.length - 1];
@@ -8153,7 +8155,7 @@ function W0(e) {
8153
8155
  }
8154
8156
  return t;
8155
8157
  }
8156
- function pf(e, t, o) {
8158
+ function mf(e, t, o) {
8157
8159
  const n = (s) => `${s.target}\0${s.property}`, a = new Map(t.map((s) => [n(s), s]));
8158
8160
  return [...e.map((s) => {
8159
8161
  const i = a.get(n(s));
@@ -8163,7 +8165,7 @@ function pf(e, t, o) {
8163
8165
  return { ...s, keyframes: c };
8164
8166
  }), ...a.values()];
8165
8167
  }
8166
- function mf(e) {
8168
+ function yf(e) {
8167
8169
  const t = new ve({ id: `${e.leaderId}-tow`, tracks: e.leaderTracks.filter((u) => u.target === e.leaderId) }), o = e.every ?? 33, n = e.towed, a = n.x + n.width / 2, r = n.props, s = n.prop.wheelRadius, i = [], h = [], c = [];
8168
8170
  let l = r.wheelSpin ?? 0, d;
8169
8171
  for (let u = e.start; ; u = Math.min(e.end, u + o)) {
@@ -8184,7 +8186,7 @@ function mf(e) {
8184
8186
  ];
8185
8187
  }
8186
8188
  const Ls = /* @__PURE__ */ new WeakMap();
8187
- function z0(e, t) {
8189
+ function L0(e, t) {
8188
8190
  const o = t?.some(Boolean) ? t.map((f) => f ? 1 : 0).join("") : "";
8189
8191
  let n = Ls.get(e);
8190
8192
  n || Ls.set(e, n = /* @__PURE__ */ new Map());
@@ -8205,7 +8207,7 @@ function z0(e, t) {
8205
8207
  }), d = Vt({ positions: i, normals: l, indices: c });
8206
8208
  return n.size >= 16 && n.clear(), n.set(o, d), d;
8207
8209
  }
8208
- function L0(e, t, o = {}) {
8210
+ function F0(e, t, o = {}) {
8209
8211
  const n = e.ink ?? o.ink ?? "#26262b", a = (o.outline ?? 2) * (e.outline ?? 1), r = e.glow && t.glow > 0 ? D0(e.glow.color, t.glow) : void 0;
8210
8212
  return {
8211
8213
  // A part with no fill (a spoked wheel's wire) is drawn in its ink.
@@ -8222,16 +8224,16 @@ function D0(e, t) {
8222
8224
  const o = /^#([0-9a-f]{6})$/i.exec(e.trim());
8223
8225
  return o ? `#${[0, 2, 4].map((a) => Math.round(parseInt(o[1].slice(a, a + 2), 16) * Math.max(0, Math.min(1, t)))).map((a) => a.toString(16).padStart(2, "0")).join("")}` : e;
8224
8226
  }
8225
- const F0 = Vt(er(1, 2e-3, 28));
8226
- function q0(e, t, o) {
8227
+ const q0 = Vt(er(1, 2e-3, 28));
8228
+ function B0(e, t, o) {
8227
8229
  const n = e.rig, [a, r] = n.footprint ?? [n.length * 0.45, n.length], s = Math.max(0, be(n, t, "lift")), i = Math.max(0, be(n, t, "size")) / (1 + s * 0.8);
8228
8230
  return {
8229
- mesh: F0,
8231
+ mesh: q0,
8230
8232
  world: ne.multiply(o, ne.compose([0, 4e-3, 0], [0, 0, 0, 1], [a * 0.55 * i || 1e-4, 1, r * 0.55 * i || 1e-4])),
8231
8233
  material: { color: "#000000", shading: "unlit", opacity: 0.16 * i }
8232
8234
  };
8233
8235
  }
8234
- const B0 = /* @__PURE__ */ new Set([
8236
+ const G0 = /* @__PURE__ */ new Set([
8235
8237
  "x",
8236
8238
  "y",
8237
8239
  "z",
@@ -8247,7 +8249,7 @@ const B0 = /* @__PURE__ */ new Set([
8247
8249
  "visible",
8248
8250
  "opacity",
8249
8251
  "color"
8250
- ]), G0 = 1, yf = {
8252
+ ]), Y0 = 1, bf = {
8251
8253
  kind: "prop",
8252
8254
  validate(e) {
8253
8255
  const t = e, o = typeof t.prop == "string" && t.prop in Ht ? [] : [fe("prop preset", t.prop, Object.keys(Ht))];
@@ -8263,7 +8265,7 @@ const B0 = /* @__PURE__ */ new Set([
8263
8265
  resolve({ object: e, prepared: t, values: o, world: n, camera: a, lights: r = [], fog: s, toScreen: i }) {
8264
8266
  const h = e, c = t, l = { ...h.values };
8265
8267
  for (const [k, y] of o)
8266
- typeof y == "number" && !B0.has(k) && (l[k] = y);
8268
+ typeof y == "number" && !G0.has(k) && (l[k] = y);
8267
8269
  l.turn = 0, l.tilt = 0;
8268
8270
  const d = ne.multiply(a.view, n), f = {
8269
8271
  toView: (k) => ne.transformPoint(d, k),
@@ -8271,42 +8273,42 @@ const B0 = /* @__PURE__ */ new Set([
8271
8273
  }, u = f.toView([0, c.rig.height / 2, 0]);
8272
8274
  if (-u[2] <= a.near) return null;
8273
8275
  if (h.look === "mesh") {
8274
- const k = uc(c.rig, l), y = k.map(({ part: E, local: O }) => ({ part: E.id, mesh: ao(E.shape), ...Mn(ao(E.shape), O) })), v = zr(y), w = k.map((E, O) => ({ ...E, hidden: Lr(E.part.id, y[O].mesh, E.local, y[O].key, v) })).filter(({ opacity: E }) => E > 0.01).map(({ part: E, matrix: O, glow: j, opacity: x, hidden: W }) => ({
8275
- mesh: z0(E.shape, W),
8276
+ const k = gc(c.rig, l), y = k.map(({ part: E, local: O }) => ({ part: E.id, mesh: ao(E.shape), ...Mn(ao(E.shape), O) })), v = zr(y), w = k.map((E, O) => ({ ...E, hidden: Lr(E.part.id, y[O].mesh, E.local, y[O].key, v) })).filter(({ opacity: E }) => E > 0.01).map(({ part: E, matrix: O, glow: j, opacity: x, hidden: W }) => ({
8277
+ mesh: L0(E.shape, W),
8276
8278
  world: ne.multiply(n, O),
8277
- material: L0(E, { glow: j, opacity: x }, { shading: h.shading, ink: h.ink, outline: h.outline })
8279
+ material: F0(E, { glow: j, opacity: x }, { shading: h.shading, ink: h.ink, outline: h.outline })
8278
8280
  }));
8279
- return { meshes: h.shadow === !1 ? w : [q0(c, l, n), ...w] };
8281
+ return { meshes: h.shadow === !1 ? w : [B0(c, l, n), ...w] };
8280
8282
  }
8281
8283
  const p = i(u), g = i(f.toView([0, c.rig.height / 2 + 1, 0])), b = Math.hypot(g.x - p.x, g.y - p.y), T = r.length === 0 ? void 0 : (k, y) => {
8282
8284
  const v = ne.transformPoint(n, k), w = [n[0] * y[0] + n[4] * y[1] + n[8] * y[2], n[1] * y[0] + n[5] * y[1] + n[9] * y[2], n[2] * y[0] + n[6] * y[1] + n[10] * y[2]], E = Math.hypot(...w) || 1;
8283
8285
  return { light: tr(v, [w[0] / E, w[1] / E, w[2] / E], r), fog: or(s, Math.hypot(v[0] - a.position[0], v[1] - a.position[1], v[2] - a.position[2])) };
8284
- }, H = Dr(c.rig, l, f, b, { perspective: !0, near: a.near, slice: G0, light: T }), M = { look: h.look, style: h.style, ink: h.ink, paper: h.paper, fog: s?.color }, m = dr(H), P = H.cells ?? [], A = Math.max(...P.map((k) => -k.depth), -u[2]);
8286
+ }, H = Fr(c.rig, l, f, b, { perspective: !0, near: a.near, slice: Y0, light: T }), M = { look: h.look, style: h.style, ink: h.ink, paper: h.paper, fog: s?.color }, m = dr(H), P = H.cells ?? [], A = Math.max(...P.map((k) => -k.depth), -u[2]);
8285
8287
  return {
8286
8288
  drawables: [
8287
8289
  ...h.shadow === !1 ? [] : [{ depth: A + c.rig.length, draw: (k) => fr(k, H, M) }],
8288
8290
  ...P.map((k) => ({
8289
8291
  depth: -k.depth,
8290
8292
  draw(y, v) {
8291
- y.lineCap = "round", y.lineJoin = "round", Ai(y, k.parts, m, { ...M, time: v.time });
8293
+ y.lineCap = "round", y.lineJoin = "round", Ti(y, k.parts, m, { ...M, time: v.time });
8292
8294
  }
8293
8295
  }))
8294
8296
  ]
8295
8297
  };
8296
8298
  }
8297
- }, Ds = ["do", "at", "for", "to", "through", "toward", "speed", "height", "open", "on", "wind"], Y0 = 0.25, U0 = 800 / 180, X0 = 220, V0 = 300, J0 = ["turn"];
8298
- function Z0(e) {
8299
+ }, Fs = ["do", "at", "for", "to", "through", "toward", "speed", "height", "open", "on", "wind"], U0 = 0.25, X0 = 800 / 180, V0 = 220, J0 = 300, Z0 = ["turn"];
8300
+ function Q0(e) {
8299
8301
  const t = Tn(e), o = Object.keys(e.moves ?? {});
8300
- return Object.keys(t).filter((n) => !o.includes(n) && !J0.includes(n) && !(t[n].needs ?? []).includes("to"));
8302
+ return Object.keys(t).filter((n) => !o.includes(n) && !Z0.includes(n) && !(t[n].needs ?? []).includes("to"));
8301
8303
  }
8302
- function Q0(e, t) {
8304
+ function ed(e, t) {
8303
8305
  if (!Array.isArray(e)) return [{ beat: -1, message: `Beats must be an array of { do: … } objects (got ${typeof e}).` }];
8304
- const o = Object.keys(t.moves ?? {}), n = Z0(t), a = [...o, "face", "hold", ...n.filter((s) => s !== "hold")], r = [];
8306
+ const o = Object.keys(t.moves ?? {}), n = Q0(t), a = [...o, "face", "hold", ...n.filter((s) => s !== "hold")], r = [];
8305
8307
  return e.forEach((s, i) => {
8306
8308
  const h = (d) => r.push({ beat: i, message: d });
8307
8309
  if (!s || typeof s != "object" || Array.isArray(s)) return h(`Each beat must be an object like { do: '${a[0] ?? "hold"}' }.`);
8308
8310
  const c = s, l = { duration: "for", path: "through", points: "through", position: "to", heading: "toward", direction: "toward" };
8309
- for (const d of Object.keys(c)) Ds.includes(d) || h(fe("beat field", d, Ds, l[d]));
8311
+ for (const d of Object.keys(c)) Fs.includes(d) || h(fe("beat field", d, Fs, l[d]));
8310
8312
  if (typeof c.do != "string" || !a.includes(c.do)) {
8311
8313
  const d = c.do === "turn" ? "face" : void 0;
8312
8314
  return h(fe(`${t.kind} 3D beat`, c.do, a, d));
@@ -8314,8 +8316,8 @@ function Q0(e, t) {
8314
8316
  o.includes(c.do) && (c.to === void 0 && c.through === void 0 && h(`\`${c.do}\` needs \`to\` ([x, z] metres) or \`through\` (a list of them).`), c.to !== void 0 && !Ge(c.to) && h(`\`to\` is a point on the ground, [x, z] metres (got ${JSON.stringify(c.to)}).`), c.through !== void 0 && !(Array.isArray(c.through) && c.through.length > 0 && c.through.every(Ge)) && h("`through` is a list of points on the ground, each [x, z] metres.")), c.do === "face" && !(Ge(c.toward) || typeof c.toward == "number") && h("`face` needs `toward`: a point [x, z] or a heading in degrees.");
8315
8317
  }), r;
8316
8318
  }
8317
- function bf(e, t, o, n) {
8318
- const a = Q0(o, t);
8319
+ function wf(e, t, o, n) {
8320
+ const a = ed(o, t);
8319
8321
  if (a.length > 0) throw new Error(`propScript3D (${t.kind}): ${a.length} problem(s) in the beats:
8320
8322
  ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8321
8323
  `)}`);
@@ -8330,12 +8332,12 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8330
8332
  const f = (M, m) => {
8331
8333
  const P = to(h, m);
8332
8334
  if (Math.abs(P) < 1) return M;
8333
- const A = Math.max(X0, Math.abs(P) * U0);
8335
+ const A = Math.max(V0, Math.abs(P) * X0);
8334
8336
  return d("rotateY", M, h), h += P, l("rotateY", M + A, h, "ease-in-out"), M + A;
8335
8337
  }, u = (M, m, P) => {
8336
8338
  const A = wr([[s, i], ...m.through ?? [m.to]]);
8337
8339
  if (A.length < 2) return P;
8338
- const k = f(P, lt(A[0].point, A[1].point)), y = A[A.length - 1].at, v = m.for ?? y / (m.speed ?? M.speed) * 1e3, w = mt("ease-in-out"), E = Math.min(V0, v / 4);
8340
+ const k = f(P, lt(A[0].point, A[1].point)), y = A[A.length - 1].at, v = m.for ?? y / (m.speed ?? M.speed) * 1e3, w = mt("ease-in-out"), E = Math.min(J0, v / 4);
8339
8341
  for (const [Y, oe] of Object.entries(M.set ?? {}))
8340
8342
  d(Y, k, r[Y]), l(Y, k + 1, oe), r[Y] = oe;
8341
8343
  const O = M.flies ? m.height ?? (r.lift > 0.05 ? r.lift : 2) : void 0, j = O !== void 0 && O > 0.05;
@@ -8344,7 +8346,7 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8344
8346
  O !== void 0 && (d("lift", k, r.lift), l("lift", k + Math.min(v * 0.35, 1400), O, "ease-out"), l("lift", k + v, O), r.lift = O);
8345
8347
  const x = { ...r };
8346
8348
  let W = h;
8347
- for (let Y = 0; ; Y = Math.min(y, Y + Y0)) {
8349
+ for (let Y = 0; ; Y = Math.min(y, Y + U0)) {
8348
8350
  const oe = k + vr(w, Y / y) * v, { point: q, direction: I } = kr(A, Y);
8349
8351
  W += to(W, lt([0, 0], I)), l("x", oe, q[0]), l("z", oe, q[1]), l("rotateY", oe, W);
8350
8352
  for (const [C, N] of Object.entries(M.perMetre ?? {})) l(C, oe, x[C] + Y * N);
@@ -8355,9 +8357,9 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8355
8357
  for (const [Y, oe] of Object.entries(M.perSecond ?? {})) r[Y] = x[Y] + v / 1e3 * oe;
8356
8358
  return [s, i] = A[A.length - 1].point, h = W, k + v;
8357
8359
  }, p = (M, m) => {
8358
- const P = Object.fromEntries(Object.entries(M).filter(([k]) => !["at", "to", "through", "toward"].includes(k))), A = A0(e, t, [P], { start: { ...r, turn: 1 }, scale: 100, style: n.style, exaggeration: n.exaggeration });
8360
+ const P = Object.fromEntries(Object.entries(M).filter(([k]) => !["at", "to", "through", "toward"].includes(k))), A = T0(e, t, [P], { start: { ...r, turn: 1 }, scale: 100, style: n.style, exaggeration: n.exaggeration });
8359
8361
  for (const k of A.tracks) {
8360
- if (ed.includes(k.property)) continue;
8362
+ if (td.includes(k.property)) continue;
8361
8363
  const y = k.keyframes ?? [], v = r[k.property];
8362
8364
  if (!y.every((w) => w.value === v)) {
8363
8365
  d(k.property, m, v);
@@ -8382,18 +8384,18 @@ ${a.map((M) => ` beat ${M.beat}: ${M.message}`).join(`
8382
8384
  keyframes: br(m)
8383
8385
  })), duration: b, beats: g, end: { position: [s, i], heading: h, values: { ...r } } };
8384
8386
  }
8385
- const ed = ["x", "y", "turn", "facing", "tilt"], td = 0.35, Qr = {
8387
+ const td = ["x", "y", "turn", "facing", "tilt"], od = 0.35, Qr = {
8386
8388
  seated: _e.sit,
8387
8389
  astride: { ..._e.sit, "leg.left.spread": 26, "leg.right.spread": 26, "leg.left.swing": 40, "leg.right.swing": 40, "leg.left.knee": 70, "leg.right.knee": 70 },
8388
8390
  driving: { ..._e.sit, "arm.left.swing": 52, "arm.right.swing": 52, "arm.left.spread": 8, "arm.right.spread": 8, "arm.left.elbow": 38, "arm.right.elbow": 38, lean: 4 },
8389
8391
  wheeling: { ..._e.sit, "arm.left.swing": -6, "arm.right.swing": -6, "arm.left.spread": 16, "arm.right.spread": 16, "arm.left.elbow": 28, "arm.right.elbow": 28, "leg.left.knee": 80, "leg.right.knee": 80 },
8390
8392
  cycling: { ..._e.sit, lean: 22, bend: 10, "head.nod": -14, "arm.left.swing": 58, "arm.right.swing": 58, "arm.left.spread": 10, "arm.right.spread": 10, "arm.left.elbow": 22, "arm.right.elbow": 22, "leg.left.spread": 6, "leg.right.spread": 6 }
8391
- }, od = 22, Fs = 38;
8393
+ }, nd = 22, Ds = 38;
8392
8394
  function qs(e, t = Qr.cycling) {
8393
8395
  const o = e * Math.PI * 2, n = (s) => ({
8394
- swing: (t["leg.left.swing"] ?? 40) + od * Math.cos(o + s),
8396
+ swing: (t["leg.left.swing"] ?? 40) + nd * Math.cos(o + s),
8395
8397
  // The knee straightens as the foot pushes down and over the bottom of the stroke.
8396
- knee: (t["leg.left.knee"] ?? 70) + Fs * (0.5 + 0.5 * Math.cos(o + s)) - Fs * 0.5,
8398
+ knee: (t["leg.left.knee"] ?? 70) + Ds * (0.5 + 0.5 * Math.cos(o + s)) - Ds * 0.5,
8397
8399
  ankle: 12 * Math.sin(o + s)
8398
8400
  }), a = n(0), r = n(Math.PI);
8399
8401
  return {
@@ -8406,7 +8408,7 @@ function qs(e, t = Qr.cycling) {
8406
8408
  "leg.right.ankle": r.ankle
8407
8409
  };
8408
8410
  }
8409
- function wf(e) {
8411
+ function kf(e) {
8410
8412
  const t = e.cadence ?? 1.2, o = Math.max(2, e.samplesPerTurn ?? 8), n = 1e3 / t / o, a = [];
8411
8413
  for (let r = e.start, s = 0; r < e.end; r += n, s++)
8412
8414
  a.push({ time: Math.round(r), pose: qs((r - e.start) / 1e3 * t, e.base), ...s > 0 ? { act: !1 } : {} });
@@ -8416,7 +8418,7 @@ const Bs = (e, t) => {
8416
8418
  const o = t * Math.PI / 180;
8417
8419
  return [e[0] * Math.cos(o) + e[2] * Math.sin(o), e[1], -e[0] * Math.sin(o) + e[2] * Math.cos(o)];
8418
8420
  };
8419
- function kf(e) {
8421
+ function vf(e) {
8420
8422
  const t = `${e.scene}/${e.propId}`, o = new ve({ id: `${e.propId}-ride-3d`, tracks: e.propTracks.filter((b) => b.target === t) }), n = e.placement ?? {}, [a, r, s] = n.position ?? [0, 0, 0], i = e.prop.rig, h = sn({ ...e.character, height: 1 }), c = { ...ye, ...e.pose ?? Qr.seated }, l = nn(h.plan, c, { height: e.height ?? 1.7, contact: h.contact }).hip, d = e.facing ?? 0, f = e.every ?? 33, u = { x: [], y: [], z: [], rotateY: [] };
8421
8423
  for (let b = e.start; ; b = Math.min(e.end, b + f)) {
8422
8424
  const T = o.getStateAtTime(b).values.get(t) ?? /* @__PURE__ */ new Map(), H = (x, W) => {
@@ -8425,20 +8427,20 @@ function kf(e) {
8425
8427
  }, M = { ...n.values };
8426
8428
  for (const x of Object.keys(i.controls)) M[x] = H(x, n.values?.[x] ?? be(i, {}, x));
8427
8429
  for (const x of ["pitch", "roll", "squash", "lift", "lean", "size"]) M[x] = H(x, n.values?.[x] ?? be(i, {}, x));
8428
- const m = gc(i, M)[e.anchor];
8430
+ const m = pc(i, M)[e.anchor];
8429
8431
  if (!m) throw new Error(`propRide3D: ${e.prop.kind} has no anchor "${e.anchor}" (it has ${Object.keys(i.anchors ?? {}).join(", ") || "none"})`);
8430
8432
  const P = H("rotateY", n.heading ?? 0), A = Bs(m, P), k = [H("x", a) + A[0], H("y", r) + A[1], H("z", s) + A[2]], y = P + d, v = Bs(l, y);
8431
8433
  let w = [k[0] - v[0], k[1] - v[1], k[2] - v[2]];
8432
8434
  const E = (x, W) => {
8433
8435
  const G = W * W * (3 - 2 * W);
8434
- return [x[0] + (w[0] - x[0]) * G, w[1] * G + td * Math.sin(Math.PI * W), x[1] + (w[2] - x[1]) * G];
8436
+ return [x[0] + (w[0] - x[0]) * G, w[1] * G + od * Math.sin(Math.PI * W), x[1] + (w[2] - x[1]) * G];
8435
8437
  }, O = e.mount ? Math.max(1, e.mount.for ?? 450) : 0, j = e.dismount ? Math.max(1, e.dismount.for ?? 450) : 0;
8436
8438
  if (e.mount && b < e.start + O ? w = E(e.mount.from, (b - e.start) / O) : e.dismount && b > e.end - j && (w = E(e.dismount.to, (e.end - b) / j)), u.x.push({ time: b, value: w[0] }), u.y.push({ time: b, value: w[1] }), u.z.push({ time: b, value: w[2] }), u.rotateY.push({ time: b, value: y }), b >= e.end) break;
8437
8439
  }
8438
8440
  const p = e.riderId, g = `${e.scene}/${p}`;
8439
8441
  return Object.keys(u).map((b) => ({ id: `${p}-${b}`, target: g, property: b, keyframes: u[b] }));
8440
8442
  }
8441
- const nd = {
8443
+ const sd = {
8442
8444
  ground: "#7fb56a",
8443
8445
  hills: "#5f9a58",
8444
8446
  city: "#4b5468",
@@ -8464,11 +8466,11 @@ const nd = {
8464
8466
  ], Tt = (e, t, o) => {
8465
8467
  const n = (s) => [1, 3, 5].map((i) => parseInt(s.slice(i, i + 2), 16)), [a, r] = [n(e), n(t)];
8466
8468
  return `#${a.map((s, i) => Math.round(s + (r[i] - s) * o).toString(16).padStart(2, "0")).join("")}`;
8467
- }, sd = (e) => {
8469
+ }, rd = (e) => {
8468
8470
  const t = (e % 24 + 24) % 24;
8469
8471
  return t < 5 || t > 20 ? 0 : t < 7 ? (t - 5) / 2 : t > 18 ? (20 - t) / 2 : 1;
8470
8472
  };
8471
- function rd(e) {
8473
+ function ad(e) {
8472
8474
  const t = (e % 24 + 24) % 24;
8473
8475
  for (let o = 1; o < St.length; o++) {
8474
8476
  const [n, a, r] = St[o - 1], [s, i, h] = St[o];
@@ -8479,24 +8481,24 @@ function rd(e) {
8479
8481
  }
8480
8482
  return { top: St[0][1], bottom: St[0][2] };
8481
8483
  }
8482
- const ad = (e, t) => {
8484
+ const id = (e, t) => {
8483
8485
  const o = ((e - t) % 24 + 24) % 24;
8484
8486
  return o <= 12 ? o / 12 : -1;
8485
- }, id = 9, ld = 55, hd = 28;
8486
- function cd(e) {
8487
- const { x: t, y: o, width: n, height: a } = e, r = e.kind ?? "sky", s = e.ground ?? o + a * 0.85, i = { ...nd, ...e.colors }, h = e.horizon ?? "hills", c = e.window !== !1, l = rn(e.seed ?? 1), d = n * a / 1e5, f = Array.from({ length: Math.ceil(id * d) + 2 }, () => ({ u: l.next(), v: l.next(), size: 0.6 + l.next() * 0.8, puffs: 2 + Math.floor(l.next() * 3) })), u = Array.from({ length: Math.ceil(ld * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.8 + l.next() * 0.5 })), p = Array.from({ length: Math.ceil(hd * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.7 + l.next() * 0.6, sway: l.next() * Math.PI * 2, size: 1.5 + l.next() * 2 })), g = Array.from({ length: Math.ceil(30 * d) + 10 }, () => ({ u: l.next(), v: l.next() * 0.6, size: 0.6 + l.next() * 1.2 })), b = Array.from({ length: 6 }, () => ({ phase: l.next() * Math.PI * 2, amp: 0.5 + l.next() })), T = Array.from({ length: 24 }, () => ({ h: 0.35 + l.next() * 0.65, w: 0.6 + l.next() * 0.8, windows: l.next() > 0.3 })), H = {
8487
+ }, ld = 9, hd = 55, cd = 28;
8488
+ function dd(e) {
8489
+ const { x: t, y: o, width: n, height: a } = e, r = e.kind ?? "sky", s = e.ground ?? o + a * 0.85, i = { ...sd, ...e.colors }, h = e.horizon ?? "hills", c = e.window !== !1, l = rn(e.seed ?? 1), d = n * a / 1e5, f = Array.from({ length: Math.ceil(ld * d) + 2 }, () => ({ u: l.next(), v: l.next(), size: 0.6 + l.next() * 0.8, puffs: 2 + Math.floor(l.next() * 3) })), u = Array.from({ length: Math.ceil(hd * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.8 + l.next() * 0.5 })), p = Array.from({ length: Math.ceil(cd * d) + 4 }, () => ({ u: l.next(), v: l.next(), speed: 0.7 + l.next() * 0.6, sway: l.next() * Math.PI * 2, size: 1.5 + l.next() * 2 })), g = Array.from({ length: Math.ceil(30 * d) + 10 }, () => ({ u: l.next(), v: l.next() * 0.6, size: 0.6 + l.next() * 1.2 })), b = Array.from({ length: 6 }, () => ({ phase: l.next() * Math.PI * 2, amp: 0.5 + l.next() })), T = Array.from({ length: 24 }, () => ({ h: 0.35 + l.next() * 0.65, w: 0.6 + l.next() * 0.8, windows: l.next() > 0.3 })), H = {
8488
8490
  hour: e.hour ?? 12,
8489
8491
  clouds: e.clouds ?? 0.3,
8490
8492
  wind: e.wind ?? 0,
8491
8493
  rain: e.rain ?? 0,
8492
8494
  snow: e.snow ?? 0
8493
8495
  }, M = It(), m = (w, E) => M.keys(w)?.length ? M.valueAt(w, E) : H[w], P = (w, E) => {
8494
- const O = ad(w, E), j = O < 0 ? 0.5 : O, x = s - o;
8496
+ const O = id(w, E), j = O < 0 ? 0.5 : O, x = s - o;
8495
8497
  return { x: 0.1 * n + 0.8 * n * j, y: O < 0 ? x + a * 0.2 : x - Math.sin(j * Math.PI) * x * 0.8, up: O >= 0 };
8496
8498
  }, A = (w, E, O, j, x) => {
8497
- const W = E("hour"), { top: G, bottom: Y } = rd(W), oe = w.createLinearGradient(0, j.y, 0, j.ground);
8499
+ const W = E("hour"), { top: G, bottom: Y } = ad(W), oe = w.createLinearGradient(0, j.y, 0, j.ground);
8498
8500
  oe.addColorStop(0, G), oe.addColorStop(1, Y), w.fillStyle = oe, w.fillRect(j.x, j.y, j.w, j.ground - j.y);
8499
- const q = sd(W);
8501
+ const q = rd(W);
8500
8502
  if (q < 0.6) {
8501
8503
  w.fillStyle = "#ffffff", w.globalAlpha = (0.6 - q) / 0.6 * 0.9;
8502
8504
  for (const L of g)
@@ -8511,9 +8513,9 @@ function cd(e) {
8511
8513
  const S = Math.max(0, Math.min(1, E("clouds"))), _ = Math.max(-1, Math.min(1, E("wind"))), V = Math.round(S * f.length);
8512
8514
  w.fillStyle = Tt("#ffffff", i.cloud === "#ffffff" ? "#ffffff" : i.cloud, 1), w.globalAlpha = 0.55 + 0.4 * q;
8513
8515
  for (let L = 0; L < V; L++) {
8514
- const Q = f[L], re = ((Q.u * j.w + _ * O * 0.012 * (0.6 + Q.size * 0.5)) % (j.w * 1.4) + j.w * 1.4) % (j.w * 1.4) - j.w * 0.2, K = j.x + re, X = j.y + (0.08 + Q.v * 0.42) * (j.ground - j.y), D = Math.min(j.w, j.h) * 0.07 * Q.size;
8516
+ const Q = f[L], re = ((Q.u * j.w + _ * O * 0.012 * (0.6 + Q.size * 0.5)) % (j.w * 1.4) + j.w * 1.4) % (j.w * 1.4) - j.w * 0.2, K = j.x + re, X = j.y + (0.08 + Q.v * 0.42) * (j.ground - j.y), F = Math.min(j.w, j.h) * 0.07 * Q.size;
8515
8517
  for (let Z = 0; Z < Q.puffs; Z++)
8516
- w.beginPath(), w.ellipse(K + (Z - (Q.puffs - 1) / 2) * D * 0.9, X + Z % 2 * D * 0.25, D * (Z % 2 ? 0.8 : 1), D * 0.62, 0, 0, Math.PI * 2), w.fill();
8518
+ w.beginPath(), w.ellipse(K + (Z - (Q.puffs - 1) / 2) * F * 0.9, X + Z % 2 * F * 0.25, F * (Z % 2 ? 0.8 : 1), F * 0.62, 0, 0, Math.PI * 2), w.fill();
8517
8519
  }
8518
8520
  w.globalAlpha = 1;
8519
8521
  const ee = (L) => Tt(Tt(L, "#0b1530", 0.65), L, q);
@@ -8523,7 +8525,7 @@ function cd(e) {
8523
8525
  for (let Q = 0; Q <= L; Q++) {
8524
8526
  const re = Q / L;
8525
8527
  let K = 0;
8526
- b.forEach((X, D) => K += Math.sin(re * Math.PI * (1.5 + D * 0.7) + X.phase) * X.amp), w.lineTo(j.x + re * j.w, j.ground - Math.max(0, K) * j.h * 0.045 - j.h * 0.03);
8528
+ b.forEach((X, F) => K += Math.sin(re * Math.PI * (1.5 + F * 0.7) + X.phase) * X.amp), w.lineTo(j.x + re * j.w, j.ground - Math.max(0, K) * j.h * 0.045 - j.h * 0.03);
8527
8529
  }
8528
8530
  w.lineTo(j.x + j.w, j.ground), w.closePath(), w.fill();
8529
8531
  } else if (h === "city") {
@@ -8535,7 +8537,7 @@ function cd(e) {
8535
8537
  const K = Q * re.w, X = j.h * 0.22 * re.h;
8536
8538
  if (w.fillRect(L, j.ground - X, K, X), re.windows && q < 0.5) {
8537
8539
  w.fillStyle = "#ffd66b", w.globalAlpha = 0.5 - q;
8538
- for (let D = j.ground - X + 6; D < j.ground - 8; D += 9) for (let Z = L + 4; Z < L + K - 4; Z += 8) w.fillRect(Z, D, 3, 4);
8540
+ for (let F = j.ground - X + 6; F < j.ground - 8; F += 9) for (let Z = L + 4; Z < L + K - 4; Z += 8) w.fillRect(Z, F, 3, 4);
8539
8541
  w.globalAlpha = 1, w.fillStyle = ee(i.city);
8540
8542
  }
8541
8543
  L += K + Q * 0.15;
@@ -8575,7 +8577,7 @@ function cd(e) {
8575
8577
  about: {
8576
8578
  kind: r === "room" ? "room" : "sky",
8577
8579
  summary: r === "room" ? "A room: a wall, a floor and a window on the sky. Its values are tracks: hour, clouds, wind, rain, snow (seen through the window)." : `A sky over ${h === "flat" ? "the ground" : h}: the sun and moon on their arcs, stars, clouds on the wind, rain and snow. Its values are tracks: hour (0–24), clouds, wind (−1..1), rain, snow (0..1).`,
8578
- props: Object.fromEntries(Object.keys(H).map((w) => [w, dd(w)]))
8580
+ props: Object.fromEntries(Object.keys(H).map((w) => [w, fd(w)]))
8579
8581
  },
8580
8582
  draw(w, E, O) {
8581
8583
  const j = E.props ?? {}, x = (G) => Number(j[G] ?? H[G] ?? 0);
@@ -8610,7 +8612,7 @@ function cd(e) {
8610
8612
  };
8611
8613
  return v;
8612
8614
  }
8613
- function dd(e) {
8615
+ function fd(e) {
8614
8616
  switch (e) {
8615
8617
  case "hour":
8616
8618
  return { description: "The time of day, 0–24: the sky’s colours, the sun and the moon on their arcs, stars at night", unit: "hours", min: 0, max: 24 };
@@ -8624,7 +8626,7 @@ function dd(e) {
8624
8626
  return { description: "How hard it snows", unit: "0..1", min: 0, max: 1 };
8625
8627
  }
8626
8628
  }
8627
- function fd(e, t) {
8629
+ function ud(e, t) {
8628
8630
  const { width: o, height: n } = t, a = t.ground ?? n * 0.85, r = t.scale ?? n / 4.5, s = { x: 0, y: 0, width: o, height: n, ground: a }, i = (h, c, l = {}) => ({ preset: h, x: o * c, scale: r, ...l });
8629
8631
  switch (e) {
8630
8632
  case "park":
@@ -8651,40 +8653,41 @@ function fd(e, t) {
8651
8653
  throw new Error(fe("scene preset", e, ["park", "street", "office", "home"]));
8652
8654
  }
8653
8655
  }
8654
- function vf(e, t) {
8655
- const o = fd(e, t), n = cd(o.scenery), a = o.props.map((r) => bc({ x: r.x, y: n.ground, prop: Jr(r.preset), scale: r.scale, values: { turn: r.turn ?? 0, ...r.values } }));
8656
+ function Sf(e, t) {
8657
+ const o = ud(e, t), n = dd(o.scenery), a = o.props.map((r) => wc({ x: r.x, y: n.ground, prop: Jr(r.preset), scale: r.scale, values: { turn: r.turn ?? 0, ...r.values } }));
8656
8658
  return { scenery: n, props: a, ground: n.ground };
8657
8659
  }
8658
8660
  export {
8659
8661
  ht as ACTING_STYLES,
8660
8662
  Yr as AIRCRAFT_ACTING,
8661
8663
  _t as ANIMAL_GAITS,
8662
- xl as ANIME_CAST,
8664
+ jl as ANIME_CAST,
8663
8665
  Jo as BEAT_FIELDS,
8664
8666
  At as BEAT_MOMENTS,
8665
- qc as BED_ACTING,
8666
- p0 as BIRD_ACTING,
8667
+ Bc as BED_ACTING,
8668
+ m0 as BIRD_ACTING,
8667
8669
  Jn as BOARD_MARKS,
8668
8670
  Rt as BOARD_THEMES,
8669
- Wa as CANVAS_PROPERTIES,
8670
- Wc as CHAIR_ACTING,
8671
+ Na as BODY_SHAPES,
8672
+ za as CANVAS_PROPERTIES,
8673
+ zc as CHAIR_ACTING,
8671
8674
  Bn as CHARACTER_BEAT_3D_FIELDS,
8672
8675
  Or as CHARACTER_CAST,
8673
- Vi as CHARACTER_GAIT_SPEEDS,
8676
+ Ji as CHARACTER_GAIT_SPEEDS,
8674
8677
  ns as CHART_KINDS,
8675
8678
  st as CHART_SURFACE,
8676
8679
  Wt as CHART_THEMES,
8677
8680
  Uo as CODE_LANGUAGES,
8678
8681
  Pr as CODE_PANEL_EDITS,
8679
8682
  Gt as CODE_SURFACE,
8680
- hl as CODE_THEME,
8683
+ cl as CODE_THEME,
8681
8684
  Je as DANCE_STYLES,
8682
8685
  Dc as DESK_ACTING,
8683
- Gc as DOOR_ACTING,
8686
+ Yc as DOOR_ACTING,
8684
8687
  Xo as EMBRACE,
8685
8688
  $e as EXPRESSIONS,
8686
8689
  ja as FACIAL_HAIR_STYLES,
8687
- $f as FINGERS,
8690
+ Ef as FINGERS,
8688
8691
  ho as FLIPS,
8689
8692
  ya as FOOT_SHAPES,
8690
8693
  Ve as GAGS,
@@ -8692,7 +8695,7 @@ export {
8692
8695
  fs as GAIT_CYCLE_MS,
8693
8696
  xa as GLASSES_STYLES,
8694
8697
  xe as HAIR_COLORS,
8695
- Ef as HAIR_STILL,
8698
+ Af as HAIR_STILL,
8696
8699
  _a as HAIR_STYLES,
8697
8700
  no as HAND_MEETINGS,
8698
8701
  Pe as HAND_REST,
@@ -8700,23 +8703,23 @@ export {
8700
8703
  Ia as HAT_STYLES,
8701
8704
  Ha as HELD_ITEMS,
8702
8705
  rt as HELP_UP,
8703
- cf as HORSE_ACTING,
8704
- hf as HORSE_GAITS,
8705
- Cc as HOUSE_ACTING,
8706
- eh as HUMAN_ACTING_RIG,
8706
+ df as HORSE_ACTING,
8707
+ cf as HORSE_GAITS,
8708
+ Nc as HOUSE_ACTING,
8709
+ th as HUMAN_ACTING_RIG,
8707
8710
  Ka as HUMAN_BUILDS,
8708
- Af as HUMAN_CYCLES,
8711
+ Tf as HUMAN_CYCLES,
8709
8712
  ft as HUMAN_DANCES,
8710
8713
  Ca as HUMAN_EXPRESSIONS,
8711
8714
  Xs as HUMAN_GAGS,
8712
8715
  _e as HUMAN_POSES,
8713
8716
  ye as HUMAN_REST,
8714
- ju as IDENTITY_CAMERA,
8715
- jl as MANGA_CAST,
8716
- Fo as MUDRAS,
8717
- Tf as OUTFIT_PRESETS,
8717
+ Nu as IDENTITY_CAMERA,
8718
+ _l as MANGA_CAST,
8719
+ Do as MUDRAS,
8720
+ Pf as OUTFIT_PRESETS,
8718
8721
  Ae as POSES,
8719
- Ds as PROP_BEAT_3D_FIELDS,
8722
+ Fs as PROP_BEAT_3D_FIELDS,
8720
8723
  en as PROP_BEAT_FIELDS,
8721
8724
  Zr as PROP_COMMON_ACTIONS,
8722
8725
  xt as PROP_COMMON_CONTROLS,
@@ -8727,294 +8730,297 @@ export {
8727
8730
  ce as REST_POSE,
8728
8731
  Qr as RIDING_POSES,
8729
8732
  Ye as SAMPLE_STEP,
8730
- nd as SCENERY_COLORS,
8733
+ sd as SCENERY_COLORS,
8731
8734
  go as SCRIPT_ACTIONS,
8732
- Pf as SOFT_CARTOON_CAST,
8733
- Jl as STICK_ACTING_RIG,
8734
- jc as TREE_ACTING,
8735
- Sc as VEHICLE_ACTING,
8735
+ Of as SOFT_CARTOON_CAST,
8736
+ Zl as STICK_ACTING_RIG,
8737
+ _c as TREE_ACTING,
8738
+ Mc as VEHICLE_ACTING,
8736
8739
  Be as VISEMES,
8737
- Xc as WHEELCHAIR_ACTING,
8740
+ Vc as WHEELCHAIR_ACTING,
8738
8741
  Ne as WHITEBOARD_SURFACE,
8739
- oh as actCharacterTracks,
8742
+ nh as actCharacterTracks,
8740
8743
  kn as actKeyframes,
8741
- th as actTracks,
8744
+ oh as actTracks,
8742
8745
  jr as actionNames,
8743
- Qc as airplane,
8746
+ e0 as airplane,
8744
8747
  Ue as anchorError,
8745
8748
  An as animalStrideLength,
8746
- _u as animatableProperties,
8747
- Ku as applyCamera,
8748
- Ga as applyGroove,
8749
+ Ru as animatableProperties,
8750
+ Wu as applyCamera,
8751
+ Ya as applyGroove,
8749
8752
  cs as assertBeats,
8750
- $d as bakeDanceTracks,
8751
- Of as basicOutfit,
8752
- vd as beatAt,
8753
- Fc as bed,
8754
- Hc as bike,
8753
+ Ed as bakeDanceTracks,
8754
+ Hf as basicOutfit,
8755
+ Sd as beatAt,
8756
+ qc as bed,
8757
+ Ic as bike,
8755
8758
  Qe as bird,
8756
8759
  on as blendPose,
8757
- Hf as bodyProfileWidth,
8758
- Hu as boilFrame,
8759
- Li as boxMesh,
8760
- If as brushingPose,
8761
- vf as buildScene,
8762
- Ac as bus,
8763
- Cu as cameraFromValues,
8764
- Nu as cameraPoint,
8765
- j0 as capabilities,
8766
- ff as capabilitiesMarkdown,
8767
- $c as car,
8768
- Pc as cart,
8769
- qd as castMember,
8770
- h0 as cat,
8771
- Rc as chair,
8760
+ If as bodyProfileWidth,
8761
+ xf as bodyShapeProfiles,
8762
+ _u as boilFrame,
8763
+ Fi as boxMesh,
8764
+ jf as brushingPose,
8765
+ Sf as buildScene,
8766
+ Tc as bus,
8767
+ zu as cameraFromValues,
8768
+ Lu as cameraPoint,
8769
+ _0 as capabilities,
8770
+ uf as capabilitiesMarkdown,
8771
+ Ec as car,
8772
+ Oc as cart,
8773
+ Bd as castMember,
8774
+ c0 as cat,
8775
+ Wc as chair,
8772
8776
  Pt as changingWindows,
8773
8777
  sn as character,
8774
- xf as characterAt,
8775
- jf as characterHandPose,
8778
+ _f as characterAt,
8779
+ Kf as characterHandPose,
8776
8780
  Oe as characterJoints,
8777
- _f as characterJointsInView,
8778
- jd as characterLookAtTracks,
8779
- Hd as characterObjects,
8781
+ Cf as characterJointsInView,
8782
+ _d as characterLookAtTracks,
8783
+ Id as characterObjects,
8780
8784
  ia as characterPartsInView,
8781
8785
  da as characterPoseOf,
8782
- Kf as characterPoseTracks,
8783
- rf as characterScript,
8784
- xd as characterScript3D,
8785
- Fh as characterStrideLength,
8786
- Cf as characterTarget,
8787
- Fd as chart,
8786
+ Nf as characterPoseTracks,
8787
+ af as characterScript,
8788
+ jd as characterScript3D,
8789
+ qh as characterStrideLength,
8790
+ Rf as characterTarget,
8791
+ qd as chart,
8788
8792
  ro as checkBeats,
8789
8793
  _r as checkCast,
8790
- tl as checkCharacterBeats3D,
8791
- E0 as checkPropBeats,
8792
- Q0 as checkPropBeats3D,
8793
- zh as checkSurfaceBeats,
8794
- Ru as checkTracks,
8795
- w0 as chicken,
8796
- Cd as circlePath,
8794
+ ol as checkCharacterBeats3D,
8795
+ A0 as checkPropBeats,
8796
+ ed as checkPropBeats3D,
8797
+ Lh as checkSurfaceBeats,
8798
+ Fu as checkTracks,
8799
+ k0 as chicken,
8800
+ Nd as circlePath,
8797
8801
  Tr as clipErased,
8798
- Ld as codePanel,
8799
- pl as codeTokens,
8802
+ Fd as codePanel,
8803
+ ml as codeTokens,
8800
8804
  be as controlValue,
8801
- c0 as cow,
8805
+ d0 as cow,
8802
8806
  ra as createPen,
8803
- b0 as crow,
8807
+ w0 as crow,
8804
8808
  Di as cylinderMesh,
8805
- di as danceCircleAt,
8806
- Td as danceCircleTracks,
8809
+ fi as danceCircleAt,
8810
+ Pd as danceCircleTracks,
8807
8811
  hn as danceFrame,
8808
8812
  ut as danceJoint,
8809
- wd as dancePose,
8813
+ kd as dancePose,
8810
8814
  qo as danceStance,
8811
- kd as danceTaps,
8812
- Md as danceTracks,
8815
+ vd as danceTaps,
8816
+ $d as danceTracks,
8813
8817
  ko as danceTravel,
8814
- Va as danceTravelTrack,
8815
- Sd as dancer,
8816
- tf as defineAction,
8817
- of as defineGait,
8818
- Wu as describeTarget,
8819
- Lc as desk,
8820
- l0 as dog,
8821
- Bc as door,
8818
+ Ja as danceTravelTrack,
8819
+ Md as dancer,
8820
+ of as defineAction,
8821
+ nf as defineGait,
8822
+ Du as describeTarget,
8823
+ Fc as desk,
8824
+ h0 as dog,
8825
+ Gc as door,
8822
8826
  ha as drawCartoonHand,
8823
- Nf as drawCharacter,
8824
- Rf as drawCharacterHead,
8825
- Wf as drawCharacterInView,
8826
- ah as drawDustPuff,
8827
+ Wf as drawCharacter,
8828
+ zf as drawCharacterHead,
8829
+ Lf as drawCharacterInView,
8830
+ ih as drawDustPuff,
8827
8831
  Mr as drawEraser,
8828
8832
  Er as drawHand,
8829
- zf as drawHeldItem,
8830
- ef as drawImpactStars,
8831
- ol as drawPencil,
8832
- af as drawProp,
8833
- uf as drawPropEffects,
8833
+ Ff as drawHeldItem,
8834
+ tf as drawImpactStars,
8835
+ nl as drawPencil,
8836
+ lf as drawProp,
8837
+ gf as drawPropEffects,
8834
8838
  fr as drawPropShadow,
8835
- Ai as drawSolvedFaces,
8836
- Od as drawSolvedPart,
8839
+ Ti as drawSolvedFaces,
8840
+ Hd as drawSolvedPart,
8837
8841
  cr as drawSolvedProp,
8838
- sh as drawSpeedLines,
8839
- Lf as drawStickFigure,
8840
- Qd as drawStickSmear,
8841
- Nd as drawnPathTarget,
8842
- v0 as duck,
8842
+ rh as drawSpeedLines,
8843
+ Df as drawStickFigure,
8844
+ ef as drawStickSmear,
8845
+ Rd as drawnPathTarget,
8846
+ S0 as duck,
8843
8847
  uo as editError,
8844
8848
  It as editLog,
8845
- Df as ellipsePoints,
8846
- Fi as ellipsoidMesh,
8847
- Ud as embrace,
8848
- Yd as embraceSpacing,
8849
- zd as erasable,
8849
+ qf as ellipsePoints,
8850
+ qi as ellipsoidMesh,
8851
+ Xd as embrace,
8852
+ Ud as embraceSpacing,
8853
+ Ld as erasable,
8850
8854
  vn as expandBeats,
8851
- Bi as extrudeMesh,
8852
- mi as flipPose,
8853
- Pd as flipTracks,
8854
- yi as flipTravel,
8855
+ Gi as extrudeMesh,
8856
+ yi as flipPose,
8857
+ Od as flipTracks,
8858
+ bi as flipTravel,
8855
8859
  hs as gag,
8856
8860
  so as gagDuration,
8857
- Ff as gaitPose,
8861
+ Bf as gaitPose,
8858
8862
  Lo as gaitStrideLength,
8859
- d0 as goat,
8860
- Fl as hairFollow,
8861
- Zd as hairFollowTracks,
8863
+ f0 as goat,
8864
+ ql as hairFollow,
8865
+ Qd as hairFollowTracks,
8862
8866
  ca as hairHangs,
8863
- Jd as hairMotionAt,
8864
- qf as hairMotionOf,
8865
- Bf as hairlineAt,
8866
- Kd as handAt,
8867
- Gf as handGrip,
8867
+ Zd as hairMotionAt,
8868
+ Gf as hairMotionOf,
8869
+ Yf as hairlineAt,
8870
+ Cd as handAt,
8871
+ Uf as handGrip,
8868
8872
  Pn as handJoints,
8869
- Yf as handJointsAt,
8873
+ Xf as handJointsAt,
8870
8874
  Cr as handPath,
8871
8875
  bt as handPose,
8872
8876
  ta as handProp,
8873
- Uf as headPoint,
8874
- Jc as helicopter,
8875
- Vd as helpUp,
8876
- Xd as helpUpSpacing,
8877
- Xf as holdingLayers,
8878
- i0 as horse,
8879
- df as horseStrideLength,
8880
- Kc as house,
8881
- Vf as humanCyclePose,
8877
+ Vf as headPoint,
8878
+ Zc as helicopter,
8879
+ Jd as helpUp,
8880
+ Vd as helpUpSpacing,
8881
+ Jf as holdingLayers,
8882
+ l0 as horse,
8883
+ ff as horseStrideLength,
8884
+ Cc as house,
8885
+ Zf as humanCyclePose,
8882
8886
  Zt as humanDanceFrame,
8883
- Ed as humanDanceTracks,
8884
- Jf as humanFieldLabel,
8887
+ Ad as humanDanceTracks,
8888
+ Qf as humanFieldLabel,
8885
8889
  la as humanGag,
8886
8890
  aa as humanGaitPose,
8887
8891
  Us as humanGaitStrideLength,
8888
8892
  oa as humanPlan,
8889
8893
  Qs as humanPose,
8890
- Zf as isHeld,
8891
- Qf as jointsInScene,
8892
- eu as jointsToScene,
8893
- tu as leafOutfit,
8894
- ou as leafOutfitContours,
8894
+ eu as isHeld,
8895
+ tu as jointsInScene,
8896
+ ou as jointsToScene,
8897
+ nu as leafOutfit,
8898
+ su as leafOutfitContours,
8895
8899
  mr as lipSyncKeyframes,
8896
8900
  yn as lipSyncOver,
8897
- Id as lipSyncTracks,
8901
+ xd as lipSyncTracks,
8898
8902
  gr as lit,
8899
8903
  Sr as lookFields,
8900
- Fr as loosePartsOf,
8901
- r0 as lyingPose,
8902
- Ad as meetDandiya,
8903
- Gd as meetHands,
8904
- Bd as meetingSpacing,
8904
+ Dr as loosePartsOf,
8905
+ a0 as lyingPose,
8906
+ ru as measuredHipWidth,
8907
+ Td as meetDandiya,
8908
+ Yd as meetHands,
8909
+ Gd as meetingSpacing,
8905
8910
  pa as mirrorHumanPose,
8906
- qa as mirrorPose,
8911
+ Ba as mirrorPose,
8907
8912
  pr as mixColors,
8908
8913
  Xt as mixHandPoses,
8909
8914
  Ys as mixPoses,
8910
- Ic as motorbike,
8911
- Pl as niceCeiling,
8915
+ xc as motorbike,
8916
+ Ol as niceCeiling,
8912
8917
  Un as objectPositionAt,
8913
- nu as organicBodyContours,
8914
- su as organicCenterLine,
8915
- ru as outfitPreset,
8916
- S0 as owl,
8917
- Gi as panelMesh,
8918
- M0 as parrot,
8918
+ au as organicBodyContours,
8919
+ iu as organicCenterLine,
8920
+ lu as outfitPreset,
8921
+ M0 as owl,
8922
+ Yi as panelMesh,
8923
+ $0 as parrot,
8919
8924
  pt as parseAnchor,
8920
8925
  nr as partialPath,
8921
- Iu as pathLength,
8922
- wf as pedallingKeys,
8926
+ Ku as pathLength,
8927
+ kf as pedallingKeys,
8923
8928
  qs as pedallingPose,
8924
- sf as persona,
8929
+ rf as persona,
8925
8930
  fo as pieceMotion,
8926
- k0 as pigeon,
8927
- ci as plantDanceFoot,
8931
+ v0 as pigeon,
8932
+ di as plantDanceFoot,
8928
8933
  an as pointAlong,
8929
- au as pointOnHead,
8934
+ hu as pointOnHead,
8930
8935
  ga as pose,
8931
- iu as poseTracks,
8936
+ cu as poseTracks,
8932
8937
  Tn as propActions,
8933
- gc as propAnchors3D,
8938
+ pc as propAnchors3D,
8934
8939
  En as propAt,
8935
8940
  qr as propControls,
8936
8941
  dr as propLineWidth,
8937
- yf as propObjects,
8938
- uc as propPartsInSpace,
8942
+ bf as propObjects,
8943
+ gc as propPartsInSpace,
8939
8944
  Jr as propPreset,
8940
- gf as propRide,
8941
- kf as propRide3D,
8942
- A0 as propScript,
8943
- bf as propScript3D,
8945
+ pf as propRide,
8946
+ vf as propRide3D,
8947
+ T0 as propScript,
8948
+ wf as propScript3D,
8944
8949
  ao as propShapeMesh,
8945
- lf as propSurface,
8946
- bc as propTarget,
8947
- mf as propTow,
8948
- cc as propView,
8950
+ hf as propSurface,
8951
+ wc as propTarget,
8952
+ yf as propTow,
8953
+ dc as propView,
8949
8954
  Ze as quadruped,
8950
- f0 as rabbit,
8955
+ u0 as rabbit,
8951
8956
  Le as reachCharacter,
8952
- qh as reachOf,
8957
+ Bh as reachOf,
8953
8958
  Hr as resolveActingStyle,
8954
8959
  fa as resolveCharacterPoseKeys,
8955
- lu as resolveFacialHair,
8956
- hu as resolveGait,
8957
- cu as resolveGlasses,
8958
- du as resolveHair,
8959
- fu as resolveHat,
8960
- uu as resolveHeadLook,
8961
- gu as resolveHolding,
8962
- pu as resolveOrganicBody,
8960
+ du as resolveFacialHair,
8961
+ fu as resolveGait,
8962
+ uu as resolveGlasses,
8963
+ gu as resolveHair,
8964
+ pu as resolveHat,
8965
+ mu as resolveHeadLook,
8966
+ yu as resolveHolding,
8967
+ bu as resolveMeasurements,
8968
+ wu as resolveOrganicBody,
8963
8969
  Vs as resolvePoseKeys,
8964
- mu as resolveStickFrame,
8965
- yu as resolveStickPose,
8970
+ ku as resolveStickFrame,
8971
+ vu as resolveStickPose,
8966
8972
  wn as rideFloors,
8967
- bu as rotateAbout,
8973
+ Su as rotateAbout,
8968
8974
  cn as routineBeats,
8969
- wu as rubberLimb,
8970
- fd as scenePreset,
8971
- cd as scenery,
8975
+ Mu as rubberLimb,
8976
+ ud as scenePreset,
8977
+ dd as scenery,
8972
8978
  Kr as scriptActionSummaries,
8973
8979
  Sn as scriptTracks,
8974
- Rd as scrubPath,
8975
- ku as seatHeight,
8980
+ Wd as scrubPath,
8981
+ $u as seatHeight,
8976
8982
  mn as shade,
8977
- Ui as shapeMesh,
8983
+ Xi as shapeMesh,
8978
8984
  Ws as sittingPose,
8979
- vu as skeletonInView,
8980
- Ra as sketchPen,
8981
- rd as skyColors,
8985
+ Eu as skeletonInView,
8986
+ Wa as sketchPen,
8987
+ ad as skyColors,
8982
8988
  yr as smoothPath,
8983
- Su as softCartoonCharacter,
8989
+ Au as softCartoonCharacter,
8984
8990
  jt as solveAt,
8985
8991
  na as solvePlanSpace,
8986
- Dr as solveProp,
8987
- y0 as songbird,
8988
- zi as soundsOf,
8989
- xh as speechDuration,
8990
- Xi as speechLength,
8991
- pf as spliceTracks,
8992
- u0 as squirrel,
8992
+ Fr as solveProp,
8993
+ b0 as songbird,
8994
+ Li as soundsOf,
8995
+ jh as speechDuration,
8996
+ Vi as speechLength,
8997
+ mf as spliceTracks,
8998
+ g0 as squirrel,
8993
8999
  nn as stagePlanSpace,
8994
- _d as stageSpots,
8995
- hh as stepsDuration,
9000
+ Kd as stageSpots,
9001
+ ch as stepsDuration,
8996
9002
  xr as stepsToKeys,
8997
9003
  Js as stickFigureAt,
8998
9004
  je as stickFigureJoints,
8999
9005
  Zs as stickFigureTarget,
9000
- Si as stickToHuman,
9001
- Mu as strideLength,
9006
+ Mi as stickToHuman,
9007
+ Tu as strideLength,
9002
9008
  me as surfaceBox,
9003
- nf as surfaceScript,
9004
- $u as sweepingPose,
9005
- Eu as talkingMouth,
9006
- Au as taperedLine,
9007
- Tu as taperedOutline,
9008
- Tc as tractor,
9009
- Oc as trainCar,
9010
- xc as tree,
9011
- Ec as truck,
9012
- Yi as tubeMesh,
9009
+ sf as surfaceScript,
9010
+ Pu as sweepingPose,
9011
+ Ou as talkingMouth,
9012
+ Hu as taperedLine,
9013
+ Iu as taperedOutline,
9014
+ Pc as tractor,
9015
+ Hc as trainCar,
9016
+ jc as tree,
9017
+ Ac as truck,
9018
+ Ui as tubeMesh,
9013
9019
  bn as valueAt,
9014
- Fe as vehicle,
9015
- Pu as walkPose,
9016
- Uc as wheelchair,
9020
+ De as vehicle,
9021
+ xu as walkPose,
9022
+ Xc as wheelchair,
9017
9023
  Dd as whiteboard,
9018
- Wd as withErased,
9024
+ zd as withErased,
9019
9025
  at as withExpression
9020
9026
  };