@pinkaphant/kolmo 0.1.0 → 0.1.1

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.
@@ -2,26 +2,27 @@ import { a as e, d as t, i as n, l as r, o as i, r as a, s as o } from "./kolmoS
2
2
  import { g as s } from "./shaders-GS71Ek1A.js";
3
3
  import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
4
4
  import * as p from "three";
5
- import { Canvas as m, useFrame as h } from "@react-three/fiber";
6
- import { Bounds as g, Bvh as _, Grid as v, Line as y, OrbitControls as b } from "@react-three/drei";
7
- import { KhrAssembly as x, cloneKhrBundle as S, exportKhrGlb as C, loadKhrGlb as w, patchGlbJsonChunk as T } from "@khr3/core";
8
- import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
9
- import { CuboidCollider as k, Physics as A, RigidBody as j, useBeforePhysicsStep as ee, useRevoluteJoint as M } from "@react-three/rapier";
10
- import { easing as te } from "maath";
11
- import { KhrVehicle as ne } from "@khr3/core/vehicle";
12
- import { ENGINE_TORQUE_CURVES as re, STEER_SPEED_CURVES as ie, TIRE_ARCHETYPES as ae, tireGripForSurface as oe } from "@khr3/core/curves";
13
- import { DOOR_HINGE_SPEC as se } from "@khr3/c12";
14
- import { GLTFLoader as ce } from "three/examples/jsm/loaders/GLTFLoader.js";
15
- import { BODY_SI as le } from "@khr3/body";
16
- import { VAULT_CATALOG as N, createAssetVault as ue } from "@khr3/assets";
17
- import { KOLMOGOROV_CARBINE as P, KOLMOGOROV_PISTOL as de, KOLMOGOROV_SHOTGUN as fe, LAUNCHER_RECIPES as pe, findLauncherRecipe as me, planLauncher as he } from "@khr3/launchers";
18
- import { create as ge } from "zustand";
19
- import { ALL_PANELS_ATTACHED_MASK as _e, PaperShellMassMemo as F, buildPaperShellAssembly as ve, exportPaperShellKhrGlb as ye } from "@khr3/vehicles/paper-shell";
20
- import { EcctrlVehicle as be, ShapeCastWheel as xe } from "@pinkaphant/ecctrl/vehicle";
21
- import { unzipSync as Se, zipSync as Ce } from "three/examples/jsm/libs/fflate.module.js";
22
- import { USDLoader as we } from "three/examples/jsm/loaders/USDLoader.js";
5
+ import { Canvas as m, useFrame as h, useThree as g } from "@react-three/fiber";
6
+ import { Bounds as _, Bvh as v, Grid as y, Line as b, OrbitControls as x } from "@react-three/drei";
7
+ import { KhrAssembly as S, cloneKhrBundle as C, exportKhrGlb as w, loadKhrGlb as T, patchGlbJsonChunk as E } from "@khr3/core";
8
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
9
+ import { CuboidCollider as A, Physics as j, RigidBody as ee, useBeforePhysicsStep as te, useRevoluteJoint as ne } from "@react-three/rapier";
10
+ import { easing as re } from "maath";
11
+ import { KhrVehicle as ie } from "@khr3/core/vehicle";
12
+ import { ENGINE_TORQUE_CURVES as ae, STEER_SPEED_CURVES as oe, TIRE_ARCHETYPES as se, tireGripForSurface as ce } from "@khr3/core/curves";
13
+ import { DOOR_HINGE_SPEC as le } from "@khr3/c12";
14
+ import { GLTFLoader as ue } from "three/examples/jsm/loaders/GLTFLoader.js";
15
+ import { BODY_SI as M } from "@khr3/body";
16
+ import { VAULT_CATALOG as N, createAssetVault as P } from "@khr3/assets";
17
+ import { KOLMOGOROV_CARBINE as de, KOLMOGOROV_PISTOL as fe, KOLMOGOROV_SHOTGUN as pe, LAUNCHER_RECIPES as me, findLauncherRecipe as he, planLauncher as ge } from "@khr3/launchers";
18
+ import { create as _e } from "zustand";
19
+ import { ALL_PANELS_ATTACHED_MASK as F, PaperShellMassMemo as ve, buildPaperShellAssembly as ye, exportPaperShellKhrGlb as be } from "@khr3/vehicles/paper-shell";
20
+ import { Container as xe, Root as Se, Text as Ce } from "@react-three/uikit";
21
+ import { EcctrlVehicle as we, ShapeCastWheel as Te } from "@pinkaphant/ecctrl/vehicle";
22
+ import { unzipSync as I, zipSync as Ee } from "three/examples/jsm/libs/fflate.module.js";
23
+ import { USDLoader as De } from "three/examples/jsm/loaders/USDLoader.js";
23
24
  // src/importer/wheelAxlePairing.ts
24
- function I(e, t) {
25
+ function L(e, t) {
25
26
  let n = new Map(e.map((e) => [e.id, e])), r = [
26
27
  Infinity,
27
28
  Infinity,
@@ -51,14 +52,14 @@ function I(e, t) {
51
52
  halfWidth: (i[0] - r[0]) * .5
52
53
  };
53
54
  }
54
- function L(e) {
55
+ function Oe(e) {
55
56
  let t = Math.max(e.size[1], e.size[2], 1e-5), n = Math.min(e.size[1], e.size[2]) / t, r = t / Math.max(e.size[0], 1e-5);
56
57
  return n >= .56 && r >= 1.25;
57
58
  }
58
- function Te(e, t, n) {
59
+ function R(e, t, n) {
59
60
  let r = t, i = Math.max(t.size[1], t.size[2]);
60
61
  for (let a of e) {
61
- if (a.id === t.id || n?.has(a.id) || !L(a)) continue;
62
+ if (a.id === t.id || n?.has(a.id) || !Oe(a)) continue;
62
63
  let e = Math.max(a.size[1], a.size[2]);
63
64
  if (!(e <= i * 1.32 || e > 1.3) && Math.hypot(a.center[0] - t.center[0], a.center[1] - t.center[1], a.center[2] - t.center[2]) <= e * .45) {
64
65
  r = a;
@@ -77,13 +78,13 @@ function Te(e, t, n) {
77
78
  }
78
79
  return c;
79
80
  }
80
- function Ee(e) {
81
+ function ke(e) {
81
82
  if (e.length === 0) return [];
82
83
  let t = Infinity, n = Infinity, r = -Infinity;
83
84
  for (let i of e) t = Math.min(t, i.min[1]), n = Math.min(n, i.min[2]), r = Math.max(r, i.max[2]);
84
85
  let i = Math.max(r - n, 1e-6), a = (e) => Math.max(e.size[1], e.size[2]), o = e.filter((e) => {
85
86
  let n = a(e);
86
- return L(e) && n >= i * .06 && n <= i * .6 && e.min[1] <= t + n * .18 && Math.abs(e.center[0]) > e.size[0] * .45;
87
+ return Oe(e) && n >= i * .06 && n <= i * .6 && e.min[1] <= t + n * .18 && Math.abs(e.center[0]) > e.size[0] * .45;
87
88
  }).sort((e, t) => a(t) - a(e)), s = /* @__PURE__ */ new Set(), c = [];
88
89
  for (let t of o) {
89
90
  if (s.has(t.id)) continue;
@@ -93,7 +94,7 @@ function Ee(e) {
93
94
  })).filter((e) => e.s < .65).sort((e, t) => e.s - t.s)[0]?.c;
94
95
  if (!i) continue;
95
96
  s.add(t.id), s.add(i.id);
96
- let a = Te(e, t, s), l = Te(e, i, s);
97
+ let a = R(e, t, s), l = R(e, i, s);
97
98
  a.forEach((e) => s.add(e)), l.forEach((e) => s.add(e)), c.push(t.center[0] >= 0 ? {
98
99
  left: a,
99
100
  right: l
@@ -102,9 +103,9 @@ function Ee(e) {
102
103
  right: a
103
104
  });
104
105
  }
105
- return c.sort((t, n) => I(e, [...n.left, ...n.right]).center[2] - I(e, [...t.left, ...t.right]).center[2]);
106
+ return c.sort((t, n) => L(e, [...n.left, ...n.right]).center[2] - L(e, [...t.left, ...t.right]).center[2]);
106
107
  }
107
- function De(e) {
108
+ function Ae(e) {
108
109
  if (e.length === 0) return [];
109
110
  let t = Infinity, n = Infinity, r = -Infinity;
110
111
  for (let i of e) t = Math.min(t, i.min[1]), n = Math.min(n, i.min[2]), r = Math.max(r, i.max[2]);
@@ -113,7 +114,7 @@ function De(e) {
113
114
  return Math.abs(e.center[0]) < .15 * i && n >= i * .12 && n <= i * .55 && Math.abs(e.size[1] - e.size[2]) <= n * .25 && e.size[0] <= n * .85 && e.min[1] <= t + n * .24;
114
115
  }).sort((e, t) => a(t) - a(e)), s = o.find((e) => e.center[2] > 0), c = o.find((e) => e.center[2] < 0 && e.id !== s?.id), l = /* @__PURE__ */ new Set(), u = [];
115
116
  if (s) {
116
- let t = Te(e, s, l);
117
+ let t = R(e, s, l);
117
118
  t.forEach((e) => l.add(e)), u.push({
118
119
  left: t,
119
120
  right: [],
@@ -123,7 +124,7 @@ function De(e) {
123
124
  });
124
125
  }
125
126
  if (c) {
126
- let t = Te(e, c, l);
127
+ let t = R(e, c, l);
127
128
  t.forEach((e) => l.add(e)), u.push({
128
129
  left: t,
129
130
  right: [],
@@ -134,20 +135,20 @@ function De(e) {
134
135
  }
135
136
  return u;
136
137
  }
137
- function Oe(e, t, n, r) {
138
+ function je(e, t, n, r) {
138
139
  let i = t.findIndex((e) => e.left.includes(n) || e.right.includes(n));
139
140
  if (i >= 0) return t.filter((e, t) => t !== i);
140
141
  let a = e.find((e) => e.id === n);
141
142
  if (!a) return [...t];
142
- let o = Te(e, a), s = e.find((e) => e.id === o[0]) ?? a;
143
+ let o = R(e, a), s = e.find((e) => e.id === o[0]) ?? a;
143
144
  if (r === "motorcycle") return [...t, {
144
145
  left: o,
145
146
  right: [],
146
147
  steered: s.center[2] >= 0,
147
148
  driven: s.center[2] < 0,
148
149
  brake: !0
149
- }].sort((t, n) => I(e, n.left).center[2] - I(e, t.left).center[2]);
150
- let c = e.filter((e) => !o.includes(e.id)).sort((e, t) => Math.hypot(e.center[0] + s.center[0], e.center[1] - s.center[1], e.center[2] - s.center[2]) - Math.hypot(t.center[0] + s.center[0], t.center[1] - s.center[1], t.center[2] - s.center[2]))[0], l = c && Math.hypot(c.center[0] + s.center[0], c.center[1] - s.center[1], c.center[2] - s.center[2]) < Math.max(...s.size) * .45 ? Te(e, c) : [], u = l.length > 0 ? s.center[0] >= 0 ? {
150
+ }].sort((t, n) => L(e, n.left).center[2] - L(e, t.left).center[2]);
151
+ let c = e.filter((e) => !o.includes(e.id)).sort((e, t) => Math.hypot(e.center[0] + s.center[0], e.center[1] - s.center[1], e.center[2] - s.center[2]) - Math.hypot(t.center[0] + s.center[0], t.center[1] - s.center[1], t.center[2] - s.center[2]))[0], l = c && Math.hypot(c.center[0] + s.center[0], c.center[1] - s.center[1], c.center[2] - s.center[2]) < Math.max(...s.size) * .45 ? R(e, c) : [], u = l.length > 0 ? s.center[0] >= 0 ? {
151
152
  left: o,
152
153
  right: l
153
154
  } : {
@@ -157,10 +158,10 @@ function Oe(e, t, n, r) {
157
158
  left: o,
158
159
  right: []
159
160
  };
160
- return [...t, u].sort((t, n) => I(e, [...n.left, ...n.right]).center[2] - I(e, [...t.left, ...t.right]).center[2]);
161
+ return [...t, u].sort((t, n) => L(e, [...n.left, ...n.right]).center[2] - L(e, [...t.left, ...t.right]).center[2]);
161
162
  }
162
163
  // src/importer/meshIslands.ts
163
- var ke = class {
164
+ var z = class {
164
165
  p;
165
166
  constructor(e) {
166
167
  this.p = new Int32Array(e);
@@ -179,8 +180,8 @@ var ke = class {
179
180
  let n = this.find(e), r = this.find(t);
180
181
  n !== r && (this.p[r] = n);
181
182
  }
182
- }, Ae = (e) => (Array.isArray(e.material) ? e.material[0] : e.material) ?? new p.MeshStandardMaterial({ color: "#cbd5e1" });
183
- function je(e, t) {
183
+ }, B = (e) => (Array.isArray(e.material) ? e.material[0] : e.material) ?? new p.MeshStandardMaterial({ color: "#cbd5e1" });
184
+ function V(e, t) {
184
185
  let n = e.clone(), r = t.determinant() < 0;
185
186
  if (n.applyMatrix4(t), r) {
186
187
  let e = n.getIndex(), t = n.getAttribute("position")?.count ?? 0;
@@ -216,7 +217,7 @@ function Me(e, t) {
216
217
  i.traverse((e) => {
217
218
  if (e !== i) {
218
219
  if (e instanceof p.Mesh && e.geometry) {
219
- let t = new p.Mesh(je(e.geometry, m.multiplyMatrices(d, e.matrixWorld)), e.material);
220
+ let t = new p.Mesh(V(e.geometry, m.multiplyMatrices(d, e.matrixWorld)), e.material);
220
221
  t.name = e.name, t.userData = { ...e.userData }, f.add(t);
221
222
  } else if (e.children.length === 0 && e.name) {
222
223
  let t = new p.Object3D();
@@ -235,7 +236,7 @@ function Me(e, t) {
235
236
  scaleApplied: u
236
237
  };
237
238
  }
238
- function R(e, t, n = [
239
+ function H(e, t, n = [
239
240
  0,
240
241
  0,
241
242
  0
@@ -265,9 +266,9 @@ function Ne(e, t = 1e-4) {
265
266
  if (!(e instanceof p.Mesh) || !e.geometry) return;
266
267
  let t = e.geometry.getAttribute("position");
267
268
  if (!t || t.count < 3) return;
268
- let s = je(e.geometry, i.multiplyMatrices(r, e.matrixWorld)), c = s.getAttribute("position"), l = s.getIndex(), u = Math.floor(l ? l.count / 3 : c.count / 3);
269
+ let s = V(e.geometry, i.multiplyMatrices(r, e.matrixWorld)), c = s.getAttribute("position"), l = s.getIndex(), u = Math.floor(l ? l.count / 3 : c.count / 3);
269
270
  if (u === 0) return;
270
- let d = new ke(u), f = /* @__PURE__ */ new Map();
271
+ let d = new z(u), f = /* @__PURE__ */ new Map();
271
272
  for (let e = 0; e < u; e++) for (let t = 0; t < 3; t++) {
272
273
  let r = l ? l.getX(e * 3 + t) : e * 3 + t, i = `${Math.round(c.getX(r) * n)},${Math.round(c.getY(r) * n)},${Math.round(c.getZ(r) * n)}`, a = f.get(i);
273
274
  a === void 0 ? f.set(i, e) : d.union(e, a);
@@ -277,9 +278,9 @@ function Ne(e, t = 1e-4) {
277
278
  let t = d.find(e), n = m.get(t);
278
279
  n || (n = [], m.set(t, n)), n.push(e);
279
280
  }
280
- let h = Ae(e);
281
+ let h = B(e);
281
282
  for (let t of m.values()) {
282
- let n = new Uint32Array(t), r = R(s, n), i = r.boundingBox, c = [
283
+ let n = new Uint32Array(t), r = H(s, n), i = r.boundingBox, c = [
283
284
  i.min.x,
284
285
  i.min.y,
285
286
  i.min.z
@@ -310,11 +311,11 @@ function Ne(e, t = 1e-4) {
310
311
  }
311
312
  }), a;
312
313
  }
313
- function z(e, t, n, r = []) {
314
+ function Pe(e, t, n, r = []) {
314
315
  e.updateMatrixWorld(!0);
315
316
  let i = new p.Matrix4().copy(e.matrixWorld).invert(), a = new p.Matrix4(), o = new Map(t.map((e) => [e.id, e])), s = /* @__PURE__ */ new Map(), c = (e) => {
316
317
  let t = s.get(e);
317
- return t || (t = je(e.geometry, a.multiplyMatrices(i, e.matrixWorld)), s.set(e, t)), t;
318
+ return t || (t = V(e.geometry, a.multiplyMatrices(i, e.matrixWorld)), s.set(e, t)), t;
318
319
  }, l = /* @__PURE__ */ new Map(), u = [], d = [];
319
320
  for (let e of n) {
320
321
  let t = e.islandIds.map((e) => o.get(e)).filter((e) => !!e);
@@ -347,11 +348,11 @@ function z(e, t, n, r = []) {
347
348
  s.name = e.nodeName, s.position.set(a[0], a[1], a[2]);
348
349
  let d = 0;
349
350
  for (let [t, n] of i) {
350
- let r = new p.Mesh(R(c(t), n, [
351
+ let r = new p.Mesh(H(c(t), n, [
351
352
  -a[0],
352
353
  -a[1],
353
354
  -a[2]
354
- ]), Ae(t));
355
+ ]), B(t));
355
356
  r.name = `${e.nodeName}_mesh_${d++}`, s.add(r);
356
357
  }
357
358
  u.push({
@@ -395,11 +396,11 @@ function z(e, t, n, r = []) {
395
396
  h.name = e.nodeName, h.position.set(u, f, m);
396
397
  let g = 0;
397
398
  for (let [t, n] of i) {
398
- let r = new p.Mesh(R(c(t), n, [
399
+ let r = new p.Mesh(H(c(t), n, [
399
400
  -u,
400
401
  -f,
401
402
  -m
402
- ]), Ae(t));
403
+ ]), B(t));
403
404
  r.name = `${e.nodeName}_skin_${g++}`, h.add(r);
404
405
  }
405
406
  d.push({
@@ -424,7 +425,7 @@ function z(e, t, n, r = []) {
424
425
  let o = [];
425
426
  for (let e = 0; e < i; e++) a && a.has(e) || o.push(e);
426
427
  if (o.length > 0) {
427
- let n = new p.Mesh(R(t, o), Ae(e));
428
+ let n = new p.Mesh(H(t, o), B(e));
428
429
  n.name = `Body_mesh_${m++}`, f.add(n);
429
430
  }
430
431
  });
@@ -458,7 +459,7 @@ function z(e, t, n, r = []) {
458
459
  };
459
460
  }
460
461
  // src/importer/surfaceTopology.ts
461
- var Pe = [
462
+ var Fe = [
462
463
  {
463
464
  role: "wheel",
464
465
  label: "Wheel / Tire",
@@ -495,17 +496,17 @@ var Pe = [
495
496
  color: "#38BDF8",
496
497
  massKg: 12
497
498
  }
498
- ], B = 2 ** 26, V = .65, Fe = /* @__PURE__ */ new WeakMap(), Ie = (e, t) => e < t ? e * B + t : t * B + e, Le = (e, t, n) => `${Math.round(e * 1e4)},${Math.round(t * 1e4)},${Math.round(n * 1e4)}`;
499
- function Re(e) {
500
- let t = Fe.get(e.geometry);
499
+ ], Ie = 2 ** 26, Le = .65, Re = /* @__PURE__ */ new WeakMap(), ze = (e, t) => e < t ? e * Ie + t : t * Ie + e, Be = (e, t, n) => `${Math.round(e * 1e4)},${Math.round(t * 1e4)},${Math.round(n * 1e4)}`;
500
+ function Ve(e) {
501
+ let t = Re.get(e.geometry);
501
502
  if (t) return t;
502
- let n = ze(e.geometry);
503
- return Fe.set(e.geometry, n), n;
503
+ let n = He(e.geometry);
504
+ return Re.set(e.geometry, n), n;
504
505
  }
505
- function ze(e) {
506
+ function He(e) {
506
507
  let t = e.getAttribute("position"), n = e.getIndex(), r = t ? n ? n.count : t.count : 0, i = Math.floor(r / 3), a = new Uint32Array(i * 3), o = /* @__PURE__ */ new Map(), s = [];
507
508
  for (let e = 0; e < i * 3; e++) {
508
- let r = n ? n.getX(e) : e, i = t.getX(r), c = t.getY(r), l = t.getZ(r), u = Le(i, c, l), d = o.get(u);
509
+ let r = n ? n.getX(e) : e, i = t.getX(r), c = t.getY(r), l = t.getZ(r), u = Be(i, c, l), d = o.get(u);
509
510
  d === void 0 && (d = o.size, o.set(u, d), s.push(i, c, l)), a[e] = d;
510
511
  }
511
512
  let c = Float32Array.from(s), l = o.size, u = new Float32Array(i * 3), d = new Float32Array(i), f = /* @__PURE__ */ new Map(), m = Array.from({ length: l }, () => /* @__PURE__ */ new Set()), h = new p.Vector3(), g = new p.Vector3(), _ = new p.Vector3(), v = new p.Vector3();
@@ -520,7 +521,7 @@ function ze(e) {
520
521
  [r, t]
521
522
  ]) {
522
523
  if (i === a) continue;
523
- let t = Ie(i, a), n = f.get(t);
524
+ let t = ze(i, a), n = f.get(t);
524
525
  n ? n.push(e) : f.set(t, [e]), m[i].add(a), m[a].add(i);
525
526
  }
526
527
  }
@@ -536,7 +537,7 @@ function ze(e) {
536
537
  neighbors: m.map((e) => [...e])
537
538
  };
538
539
  }
539
- function Be(e, t, n) {
540
+ function Ue(e, t, n) {
540
541
  if (t < 0 || t >= e.triangleCount) return [];
541
542
  let r = new Uint8Array(e.triangleCount), i = [t];
542
543
  r[t] = 1;
@@ -545,17 +546,17 @@ function Be(e, t, n) {
545
546
  for (let t = 0; t < 3; t++) {
546
547
  let o = e.corners[a * 3 + t], s = e.corners[a * 3 + (t + 1) % 3];
547
548
  if (o === s) continue;
548
- let c = Ie(o, s);
549
+ let c = ze(o, s);
549
550
  for (let t of e.edgeTriangles.get(c) ?? []) !r[t] && n(c, a, t) && (r[t] = 1, i.push(t));
550
551
  }
551
552
  }
552
553
  return i.sort((e, t) => e - t);
553
554
  }
554
- function Ve(e, t, n = 32) {
555
+ function We(e, t, n = 32) {
555
556
  let r = Math.cos(n * Math.PI / 180), i = e.normals;
556
- return Be(e, t, (e, t, n) => i[t * 3] * i[n * 3] + i[t * 3 + 1] * i[n * 3 + 1] + i[t * 3 + 2] * i[n * 3 + 2] >= r);
557
+ return Ue(e, t, (e, t, n) => i[t * 3] * i[n * 3] + i[t * 3 + 1] * i[n * 3 + 1] + i[t * 3 + 2] * i[n * 3 + 2] >= r);
557
558
  }
558
- function He(e, t, n = .03) {
559
+ function Ge(e, t, n = .03) {
559
560
  let r = Math.max(n, 1e-4), i = (e, t, n) => `${Math.floor(e / r)},${Math.floor(t / r)},${Math.floor(n / r)}`, a = /* @__PURE__ */ new Map(), o = new Float32Array(e.triangleCount * 3);
560
561
  for (let t = 0; t < e.triangleCount; t++) {
561
562
  let n = 0, r = 0, s = 0;
@@ -579,19 +580,19 @@ function He(e, t, n = .03) {
579
580
  }
580
581
  return [...c].sort((e, t) => e - t);
581
582
  }
582
- function Ue(e, t, n) {
583
+ function Ke(e, t, n) {
583
584
  let r = e.points;
584
585
  return Math.hypot(r[t * 3] - r[n * 3], r[t * 3 + 1] - r[n * 3 + 1], r[t * 3 + 2] - r[n * 3 + 2]);
585
586
  }
586
- function We(e, t, n) {
587
- let r = e.edgeTriangles.get(Ie(t, n)), i = 1;
587
+ function qe(e, t, n) {
588
+ let r = e.edgeTriangles.get(ze(t, n)), i = 1;
588
589
  if (r && r.length === 2) {
589
590
  let t = e.normals, n = r[0], a = r[1], o = t[n * 3] * t[a * 3] + t[n * 3 + 1] * t[a * 3 + 1] + t[n * 3 + 2] * t[a * 3 + 2];
590
591
  i = Math.min(1, Math.acos(Math.max(-1, Math.min(1, o))) / (Math.PI / 2));
591
592
  }
592
- return Ue(e, t, n) * (1 - V * i);
593
+ return Ke(e, t, n) * (1 - Le * i);
593
594
  }
594
- function Ge(e, t) {
595
+ function Je(e, t) {
595
596
  let n = 0, r = Infinity;
596
597
  for (let i = 0; i < e.vertexCount; i++) {
597
598
  let a = (e.points[i * 3] - t[0]) ** 2 + (e.points[i * 3 + 1] - t[1]) ** 2 + (e.points[i * 3 + 2] - t[2]) ** 2;
@@ -599,7 +600,7 @@ function Ge(e, t) {
599
600
  }
600
601
  return n;
601
602
  }
602
- function Ke(e, t, n, r, i = We) {
603
+ function Ye(e, t, n, r, i = qe) {
603
604
  if (t === n) return [t];
604
605
  let a = new Float64Array(e.vertexCount).fill(Infinity), o = new Int32Array(e.vertexCount).fill(-1), s = [[0, t]];
605
606
  a[t] = 0;
@@ -639,7 +640,7 @@ function Ke(e, t, n, r, i = We) {
639
640
  return u.reverse();
640
641
  }
641
642
  // src/importer/surfaceCutter.ts
642
- function qe(e, t) {
643
+ function Xe(e, t) {
643
644
  let n = 0, r = 0;
644
645
  for (let i of t) {
645
646
  let t = e.areas[i];
@@ -648,28 +649,28 @@ function qe(e, t) {
648
649
  }
649
650
  return r > 0 ? n / r : 0;
650
651
  }
651
- function Je(e, t, n) {
652
- let r = Re(e), i = [...new Set(t)].sort((e, t) => e - t), a = n && Math.abs(qe(r, i)) > .08 ? He(r, i) : [];
652
+ function Ze(e, t, n) {
653
+ let r = Ve(e), i = [...new Set(t)].sort((e, t) => e - t), a = n && Math.abs(Xe(r, i)) > .08 ? Ge(r, i) : [];
653
654
  return {
654
655
  islandId: e.id,
655
656
  triangles: i,
656
657
  mirrored: a
657
658
  };
658
659
  }
659
- function Ye(e, t, n, r) {
660
- let i = Re(e), a = n === "crease" ? Ve(i, t, r.creaseDeg) : [t], o = r.current?.islandId === e.id ? new Set(r.current.triangles) : /* @__PURE__ */ new Set();
660
+ function Qe(e, t, n, r) {
661
+ let i = Ve(e), a = n === "crease" ? We(i, t, r.creaseDeg) : [t], o = r.current?.islandId === e.id ? new Set(r.current.triangles) : /* @__PURE__ */ new Set();
661
662
  for (let e of a) r.remove ? o.delete(e) : o.add(e);
662
- return Je(e, [...o], r.mirrorX);
663
+ return Ze(e, [...o], r.mirrorX);
663
664
  }
664
- function Xe(e, t) {
665
+ function $e(e, t) {
665
666
  if (t.length < 2) return t.map((e) => [
666
667
  e[0],
667
668
  e[1],
668
669
  e[2]
669
670
  ]);
670
- let n = Re(e), r = t.map((e) => Ge(n, e)), i = [], a = t.length >= 3 ? r.length : r.length - 1;
671
+ let n = Ve(e), r = t.map((e) => Je(n, e)), i = [], a = t.length >= 3 ? r.length : r.length - 1;
671
672
  for (let e = 0; e < a; e++) {
672
- let o = Ke(n, r[e], r[(e + 1) % r.length]) ?? [r[e], r[(e + 1) % r.length]];
673
+ let o = Ye(n, r[e], r[(e + 1) % r.length]) ?? [r[e], r[(e + 1) % r.length]];
673
674
  for (let r of o.slice(0, e === a - 1 && t.length < 3 ? void 0 : -1)) i.push([
674
675
  n.points[r * 3],
675
676
  n.points[r * 3 + 1],
@@ -678,26 +679,26 @@ function Xe(e, t) {
678
679
  }
679
680
  return t.length >= 3 && i.length > 0 && i.push([...i[0]]), i;
680
681
  }
681
- function Ze(e, t, n) {
682
+ function et(e, t, n) {
682
683
  if (t.length < 3) throw Error("Place at least 3 seam dots around the panel first.");
683
- let r = Re(e), i = t.map((e) => Ge(r, e));
684
+ let r = Ve(e), i = t.map((e) => Je(r, e));
684
685
  if (new Set(i).size !== i.length) throw Error("Two dots snapped to the same vertex — spread dots apart or enable Split Coarse Edges.");
685
686
  let a = [], o = /* @__PURE__ */ new Set();
686
687
  for (let e = 0; e < i.length; e++) {
687
- let t = Ke(r, i[e], i[(e + 1) % i.length], o, n.exact ? Ue : We);
688
+ let t = Ye(r, i[e], i[(e + 1) % i.length], o, n.exact ? Ke : qe);
688
689
  if (!t) throw Error(`No mesh edge path connects dot ${e + 1} to dot ${(e + 1) % i.length + 1}.`);
689
690
  for (let e of t.slice(0, -1)) a.push(e), o.add(e);
690
691
  }
691
692
  let s = /* @__PURE__ */ new Set();
692
- for (let e = 0; e < a.length; e++) s.add(Ie(a[e], a[(e + 1) % a.length]));
693
+ for (let e = 0; e < a.length; e++) s.add(ze(a[e], a[(e + 1) % a.length]));
693
694
  let c = [...s].map((e) => r.edgeTriangles.get(e) ?? []).find((e) => e.length === 2);
694
695
  if (!c) throw Error("Loop runs only along open mesh border — nothing enclosed to peel.");
695
- let l = Be(r, c[0], (e) => !s.has(e));
696
+ let l = Ue(r, c[0], (e) => !s.has(e));
696
697
  if (new Set(l).has(c[1])) throw Error("Loop didn't enclose an isolated patch — add another dot along the shutline.");
697
- let u = Be(r, c[1], (e) => !s.has(e)), d = (e) => e.reduce((e, t) => e + r.areas[t], 0);
698
- return Je(e, d(l) <= d(u) ? l : u, n.mirrorX);
698
+ let u = Ue(r, c[1], (e) => !s.has(e)), d = (e) => e.reduce((e, t) => e + r.areas[t], 0);
699
+ return Ze(e, d(l) <= d(u) ? l : u, n.mirrorX);
699
700
  }
700
- function Qe(e, t, n = .28) {
701
+ function tt(e, t, n = .28) {
701
702
  let r = e.index ? e.toNonIndexed() : e.clone(), i = Object.keys(r.attributes), a = i.map((e) => r.getAttribute(e).itemSize), o = i.slice(0, i.indexOf("position")).reduce((e, t, n) => e + a[n], 0), s = r.getAttribute("position").count, c = (e) => {
702
703
  let t = [];
703
704
  return i.forEach((n, i) => {
@@ -710,7 +711,7 @@ function Qe(e, t, n = .28) {
710
711
  c(e * 3 + 1),
711
712
  c(e * 3 + 2)
712
713
  ]);
713
- let u = l.length, d = (e) => new p.Vector3(e[o], e[o + 1], e[o + 2]), f = (e, t, n) => e.map((e, r) => e + (t[r] - e) * n), m = ze(r);
714
+ let u = l.length, d = (e) => new p.Vector3(e[o], e[o + 1], e[o + 2]), f = (e, t, n) => e.map((e, r) => e + (t[r] - e) * n), m = He(r);
714
715
  for (let e = 0; e < t.length; e++) {
715
716
  let r = new p.Vector3(...t[e]), i = new p.Vector3(...t[(e + 1) % t.length]), a = i.clone().sub(r), o = a.length();
716
717
  if (o < 1e-7) continue;
@@ -725,7 +726,7 @@ function Qe(e, t, n = .28) {
725
726
  if (g.lengthSq() < 1e-12) continue;
726
727
  g.normalize();
727
728
  let _ = (e) => g.dot(e) - g.dot(r), v = 1e-6, y = /* @__PURE__ */ new Map(), b = (e) => {
728
- let t = d(e), n = Le(t.x, t.y, t.z), r = y.get(n);
729
+ let t = d(e), n = Be(t.x, t.y, t.z), r = y.get(n);
729
730
  return r === void 0 && (r = y.size, y.set(n, r)), r;
730
731
  }, x = l.map((e) => {
731
732
  let t = e.map((e) => _(d(e))), n = t.filter((e) => e > v).length, r = t.filter((e) => e < -1e-6).length;
@@ -745,8 +746,8 @@ function Qe(e, t, n = .28) {
745
746
  c2: s,
746
747
  p01: p,
747
748
  p02: m,
748
- k01: p ? Ie(b(a), b(o)) : -1,
749
- k02: m ? Ie(b(a), b(s)) : -1,
749
+ k01: p ? ze(b(a), b(o)) : -1,
750
+ k02: m ? ze(b(a), b(s)) : -1,
750
751
  chord: [p ?? o, m ?? s]
751
752
  };
752
753
  }), S = /* @__PURE__ */ new Set();
@@ -809,18 +810,18 @@ function Qe(e, t, n = .28) {
809
810
  added: l.length - u
810
811
  };
811
812
  }
812
- function $e(e, t, n) {
813
+ function nt(e, t, n) {
813
814
  let r = e.mesh, i = r.parent;
814
815
  if (!i) throw Error("Selected island mesh has no parent scene.");
815
816
  let a = r.geometry, o = a.getAttribute("position"), s = a.getIndex(), c = o ? Math.floor((s ? s.count : o.count) / 3) : 0, l = (t) => t.map((t) => e.triangleIndices[t]), u = l(t.triangles), d = l(t.mirrored), f = /* @__PURE__ */ new Set([...u, ...d]), m = [], h = (e, t) => {
816
817
  if (e.length === 0) return;
817
- let n = new p.Mesh(R(a, e), r.material);
818
+ let n = new p.Mesh(H(a, e), r.material);
818
819
  n.name = t, n.position.copy(r.position), n.quaternion.copy(r.quaternion), n.scale.copy(r.scale), i.add(n), m.push(n);
819
820
  };
820
821
  h(u, n), h(d, `${n}_mirror`);
821
822
  let g = [];
822
823
  for (let e = 0; e < c; e++) f.has(e) || g.push(e);
823
- return r.geometry = g.length > 0 ? R(a, g) : new p.BufferGeometry(), {
824
+ return r.geometry = g.length > 0 ? H(a, g) : new p.BufferGeometry(), {
824
825
  mintedMeshes: m,
825
826
  undo: () => {
826
827
  r.geometry = a;
@@ -828,7 +829,7 @@ function $e(e, t, n) {
828
829
  }
829
830
  };
830
831
  }
831
- function et(e, t) {
832
+ function rt(e, t) {
832
833
  let n = (e) => `${e.mesh.uuid}|${e.triangleIndices.length}|${e.center.map((e) => e.toFixed(4)).join(",")}`, r = /* @__PURE__ */ new Map();
833
834
  for (let e of t) {
834
835
  let t = n(e), i = r.get(t);
@@ -838,7 +839,7 @@ function et(e, t) {
838
839
  for (let t of e) i.set(t.id, r.get(n(t))?.shift() ?? null);
839
840
  return i;
840
841
  }
841
- function tt(e, t, n) {
842
+ function it(e, t, n) {
842
843
  let r = e.find((e) => e.id === t);
843
844
  if (!r || Math.abs(r.center[0]) <= .08) return null;
844
845
  let i = Math.max(...r.size, .15), a = null, o = .55;
@@ -849,15 +850,15 @@ function tt(e, t, n) {
849
850
  }
850
851
  return a;
851
852
  }
852
- function nt(e, t, n = .004) {
853
- let r = R(e, t), i = r.getAttribute("position"), a = r.getAttribute("normal");
853
+ function at(e, t, n = .004) {
854
+ let r = H(e, t), i = r.getAttribute("position"), a = r.getAttribute("normal");
854
855
  if (i && a) {
855
856
  for (let e = 0; e < i.count; e++) i.setXYZ(e, i.getX(e) + a.getX(e) * n, i.getY(e) + a.getY(e) * n, i.getZ(e) + a.getZ(e) * n);
856
857
  i.needsUpdate = !0;
857
858
  }
858
859
  return r;
859
860
  }
860
- function rt(e, t, n = "Wheel_12gon") {
861
+ function ot(e, t, n = "Wheel_12gon") {
861
862
  let r = new p.Group();
862
863
  r.name = n;
863
864
  let i = new p.CylinderGeometry(e, e, t, 12, 1);
@@ -889,21 +890,21 @@ function rt(e, t, n = "Wheel_12gon") {
889
890
  return l.name = `${n}_hub`, r.add(s, c, l), r;
890
891
  }
891
892
  // src/importer/khrCompiler.ts
892
- var it = [
893
+ var st = [
893
894
  "map",
894
895
  "normalMap",
895
896
  "roughnessMap",
896
897
  "metalnessMap",
897
898
  "aoMap",
898
899
  "emissiveMap"
899
- ], H = (e) => Number(e.toFixed(4)), at = (e, t, n, r) => [
900
- H(e / 12 * (n * n + r * r)),
901
- H(e / 12 * (t * t + r * r)),
902
- H(e / 12 * (t * t + n * n))
900
+ ], U = (e) => Number(e.toFixed(4)), ct = (e, t, n, r) => [
901
+ U(e / 12 * (n * n + r * r)),
902
+ U(e / 12 * (t * t + r * r)),
903
+ U(e / 12 * (t * t + n * n))
903
904
  ];
904
- function ot(t, n, r) {
905
+ function lt(t, n, r) {
905
906
  if (!n) return [];
906
- let i = new Map(t.map((e) => [e.id, e])), a = (e) => Object.entries(n).filter(([t, n]) => n === e && !r.has(Number(t)) && i.has(Number(t))).map(([e]) => Number(e)), o = [], s = (e) => Pe.find((t) => t.role === e)?.massKg ?? 16;
907
+ let i = new Map(t.map((e) => [e.id, e])), a = (e) => Object.entries(n).filter(([t, n]) => n === e && !r.has(Number(t)) && i.has(Number(t))).map(([e]) => Number(e)), o = [], s = (e) => Fe.find((t) => t.role === e)?.massKg ?? 16;
907
908
  for (let n of [1, -1]) {
908
909
  let r = a("door").filter((e) => (i.get(e).center[0] >= 0 ? 1 : -1) === n);
909
910
  if (r.length === 0) continue;
@@ -915,7 +916,7 @@ function ot(t, n, r) {
915
916
  role: `door_${a.toLowerCase()}`,
916
917
  islandIds: r,
917
918
  massKg: s("door"),
918
- hinge: e(I(t, r), "door")
919
+ hinge: e(L(t, r), "door")
919
920
  });
920
921
  });
921
922
  }
@@ -926,7 +927,7 @@ function ot(t, n, r) {
926
927
  role: n,
927
928
  islandIds: r,
928
929
  massKg: s(n),
929
- hinge: e(I(t, r), n)
930
+ hinge: e(L(t, r), n)
930
931
  });
931
932
  }
932
933
  for (let n of ["fender", "bumper"]) a(n).forEach((r, i) => {
@@ -935,20 +936,20 @@ function ot(t, n, r) {
935
936
  role: n,
936
937
  islandIds: [r],
937
938
  massKg: s(n),
938
- hinge: e(I(t, [r]), n)
939
+ hinge: e(L(t, [r]), n)
939
940
  });
940
941
  });
941
942
  return o;
942
943
  }
943
- function st(e, t, n, r, i) {
944
+ function ut(e, t, n, r, i) {
944
945
  let a = t.filter((e) => e.left.length > 0);
945
946
  if (a.length > 0) {
946
947
  let t = a.map((t) => ({
947
948
  a: t,
948
- z: I(e, [...t.left, ...t.right]).center[2]
949
+ z: L(e, [...t.left, ...t.right]).center[2]
949
950
  })).sort((e, t) => t.z - e.z), i = t.length, o = [];
950
951
  return t.forEach(({ a: t }, a) => {
951
- let s = I(e, t.left), c = t.right.length > 0 ? I(e, t.right) : s, l = Math.max(.12, s.radius, c.radius), u = Math.max(.09, Math.max(s.halfWidth, c.halfWidth) * 2), d = n === "motorcycle" ? a > 0 : r === "AWD" || i === 1 ? !0 : r === "FWD" ? a === 0 : a > 0, f = t.steered ?? a === 0, p = t.driven ?? d, m = t.brake ?? !0, h = i === 2 ? a === 0 ? "F" : "R" : `A${a}`;
952
+ let s = L(e, t.left), c = t.right.length > 0 ? L(e, t.right) : s, l = Math.max(.12, s.radius, c.radius), u = Math.max(.09, Math.max(s.halfWidth, c.halfWidth) * 2), d = n === "motorcycle" ? a > 0 : r === "AWD" || i === 1 ? !0 : r === "FWD" ? a === 0 : a > 0, f = t.steered ?? a === 0, p = t.driven ?? d, m = t.brake ?? !0, h = i === 2 ? a === 0 ? "F" : "R" : `A${a}`;
952
953
  t.right.length === 0 ? o.push({
953
954
  nodeName: `Wheel_${h}C`,
954
955
  islandIds: [...t.left],
@@ -1067,17 +1068,17 @@ function st(e, t, n, r, i) {
1067
1068
  }
1068
1069
  ];
1069
1070
  }
1070
- async function ct(e, n) {
1071
+ async function dt(e, n) {
1071
1072
  e.updateMatrixWorld(!0);
1072
1073
  let r = new p.Box3().setFromObject(e), i = r.getSize(new p.Vector3()), a = r.getCenter(new p.Vector3()), o = Math.max(.25, i.x), s = Math.max(.25, i.y), c = Math.max(.25, i.z), l = Math.max(5, n.massKg || 1e3), u = new p.Group();
1073
1074
  u.name = n.name || e.name || `Kolmo_${n.archetype}`;
1074
1075
  let d = [], f;
1075
1076
  if (n.archetype === "car" || n.archetype === "motorcycle") {
1076
- let t = n.islands ?? Ne(e), i = n.axles ?? (n.archetype === "motorcycle" ? De(t) : Ee(t)), m = n.driveType ?? (n.archetype === "motorcycle" ? "RWD" : "AWD"), h = st(t, i, n.archetype, m, [
1077
+ let t = n.islands ?? Ne(e), i = n.axles ?? (n.archetype === "motorcycle" ? Ae(t) : ke(t)), m = n.driveType ?? (n.archetype === "motorcycle" ? "RWD" : "AWD"), h = ut(t, i, n.archetype, m, [
1077
1078
  o,
1078
1079
  s,
1079
1080
  c
1080
- ]), g = ot(t, n.partPicks, new Set(h.flatMap((e) => e.islandIds))), _ = z(e, t, h.filter((e) => e.islandIds.length > 0), g.map((e) => ({
1081
+ ]), g = lt(t, n.partPicks, new Set(h.flatMap((e) => e.islandIds))), _ = Pe(e, t, h.filter((e) => e.islandIds.length > 0), g.map((e) => ({
1081
1082
  nodeName: e.nodeName,
1082
1083
  islandIds: e.islandIds,
1083
1084
  anchor: e.hinge.anchor
@@ -1090,17 +1091,17 @@ async function ct(e, n) {
1090
1091
  0
1091
1092
  ];
1092
1093
  if (n.wheelSource === "fleet12" || !t) {
1093
- let t = rt(e.radius, e.width, e.nodeName);
1094
+ let t = ot(e.radius, e.width, e.nodeName);
1094
1095
  t.position.set(r[0], r[1], r[2]), u.add(t);
1095
1096
  } else u.add(t.group);
1096
1097
  }
1097
1098
  let y = Math.max(...h.map((e) => e.radius)), b = Math.max(.08, Math.min(.3, y * .68)), x = b * .4, S = Math.min(r.max.y - .2, Math.max(y * 1.15, b - x + .16)), C = Math.max(S + .26, r.max.y * .92), w = [
1098
- H(Math.max(n.archetype === "motorcycle" ? .26 : .45, o * (n.archetype === "motorcycle" ? .55 : .92))),
1099
- H(Math.max(.26, C - S)),
1100
- H(Math.max(.55, c * .92))
1099
+ U(Math.max(n.archetype === "motorcycle" ? .26 : .45, o * (n.archetype === "motorcycle" ? .55 : .92))),
1100
+ U(Math.max(.26, C - S)),
1101
+ U(Math.max(.55, c * .92))
1101
1102
  ], T = new p.Object3D();
1102
- T.name = "Chassis_Hull", T.position.set(H(a.x), H((S + C) * .5), H(a.z)), v.add(T);
1103
- let E = n.archetype === "motorcycle" ? Math.max(y * .95, s * .32) : Math.min(C, Math.max(y + .14, s * .36)), D = h.map((e) => _.wheels.find((t) => t.nodeName === e.nodeName)?.center[2] ?? e.fallbackPos?.[2] ?? 0), O = D.reduce((e, t) => e + t, 0) / Math.max(1, D.length), k = Math.max(80, l - g.reduce((e, t) => e + t.massKg, 0)), A = ae.streetDrift90s, j = oe(A.muPeakLng, .82);
1103
+ T.name = "Chassis_Hull", T.position.set(U(a.x), U((S + C) * .5), U(a.z)), v.add(T);
1104
+ let E = n.archetype === "motorcycle" ? Math.max(y * .95, s * .32) : Math.min(C, Math.max(y + .14, s * .36)), D = h.map((e) => _.wheels.find((t) => t.nodeName === e.nodeName)?.center[2] ?? e.fallbackPos?.[2] ?? 0), O = D.reduce((e, t) => e + t, 0) / Math.max(1, D.length), k = Math.max(80, l - g.reduce((e, t) => e + t.massKg, 0)), A = se.streetDrift90s, j = ce(A.muPeakLng, .82);
1104
1105
  d = [{
1105
1106
  nodeName: "Chassis",
1106
1107
  motion: {
@@ -1108,10 +1109,10 @@ async function ct(e, n) {
1108
1109
  mass: k,
1109
1110
  centerOfMass: [
1110
1111
  0,
1111
- H(E),
1112
- H(O)
1112
+ U(E),
1113
+ U(O)
1113
1114
  ],
1114
- inertiaDiagonal: at(k, o, Math.max(.45, s - y * .5), c)
1115
+ inertiaDiagonal: ct(k, o, Math.max(.45, s - y * .5), c)
1115
1116
  },
1116
1117
  extras: { role: "chassis" }
1117
1118
  }, {
@@ -1130,9 +1131,9 @@ async function ct(e, n) {
1130
1131
  if (!t) continue;
1131
1132
  v.add(t.group);
1132
1133
  let n = [
1133
- H(t.center[0] - t.anchor[0]),
1134
- H(t.center[1] - t.anchor[1]),
1135
- H(t.center[2] - t.anchor[2])
1134
+ U(t.center[0] - t.anchor[0]),
1135
+ U(t.center[1] - t.anchor[1]),
1136
+ U(t.center[2] - t.anchor[2])
1136
1137
  ], r = new p.Object3D();
1137
1138
  r.name = `${e.nodeName}_Panel`, r.position.set(n[0], n[1], n[2]), t.group.add(r), d.push({
1138
1139
  nodeName: r.name,
@@ -1140,9 +1141,9 @@ async function ct(e, n) {
1140
1141
  shape: {
1141
1142
  type: "box",
1142
1143
  size: [
1143
- H(t.size[0]),
1144
- H(t.size[1]),
1145
- H(t.size[2])
1144
+ U(t.size[0]),
1145
+ U(t.size[1]),
1146
+ U(t.size[2])
1146
1147
  ]
1147
1148
  },
1148
1149
  friction: .45
@@ -1153,7 +1154,7 @@ async function ct(e, n) {
1153
1154
  isKinematic: !1,
1154
1155
  mass: e.massKg,
1155
1156
  centerOfMass: n,
1156
- inertiaDiagonal: at(e.massKg, t.size[0], t.size[1], t.size[2])
1157
+ inertiaDiagonal: ct(e.massKg, t.size[0], t.size[1], t.size[2])
1157
1158
  },
1158
1159
  joint: {
1159
1160
  connectedNodeName: "Chassis",
@@ -1171,12 +1172,12 @@ async function ct(e, n) {
1171
1172
  });
1172
1173
  }
1173
1174
  for (let e of h) {
1174
- let t = H(Math.max(.08, Math.min(.3, e.radius * .68))), n = H(t * .4);
1175
+ let t = U(Math.max(.08, Math.min(.3, e.radius * .68))), n = U(t * .4);
1175
1176
  d.push({
1176
1177
  nodeName: e.nodeName,
1177
1178
  extras: { ecctrlWheel: {
1178
- radius: H(e.radius),
1179
- width: H(e.width),
1179
+ radius: U(e.radius),
1180
+ width: U(e.width),
1180
1181
  travel: t,
1181
1182
  sag: n,
1182
1183
  steer: e.steered,
@@ -1212,7 +1213,7 @@ async function ct(e, n) {
1212
1213
  maxLeanAngle: .78,
1213
1214
  leanOmega: 10,
1214
1215
  leanDampingRatio: .85,
1215
- engineTorqueCurveData: re.naScreamer
1216
+ engineTorqueCurveData: ae.naScreamer
1216
1217
  } : {
1217
1218
  engineHorsepower: ee,
1218
1219
  engineMaxRPM: 7e3,
@@ -1228,8 +1229,8 @@ async function ct(e, n) {
1228
1229
  maxSteerAngle: .55,
1229
1230
  rollCenterHeight: .12,
1230
1231
  antiRollStiffness: 14e3,
1231
- engineTorqueCurveData: re.naScreamer,
1232
- steerAngleCurveData: ie.driftCountersteer
1232
+ engineTorqueCurveData: ae.naScreamer,
1233
+ steerAngleCurveData: oe.driftCountersteer
1233
1234
  } };
1234
1235
  } else if (n.archetype === "starcraft") {
1235
1236
  for (let t of e.clone(!0).children) u.add(t);
@@ -1243,18 +1244,18 @@ async function ct(e, n) {
1243
1244
  mass: l,
1244
1245
  centerOfMass: [
1245
1246
  0,
1246
- H(-s * .06),
1247
+ U(-s * .06),
1247
1248
  0
1248
1249
  ],
1249
- inertiaDiagonal: at(l, o, s, c)
1250
+ inertiaDiagonal: ct(l, o, s, c)
1250
1251
  },
1251
1252
  collider: {
1252
1253
  shape: {
1253
1254
  type: "box",
1254
1255
  size: [
1255
- H(o * .86),
1256
- H(s * .78),
1257
- H(c * .9)
1256
+ U(o * .86),
1257
+ U(s * .78),
1258
+ U(c * .9)
1258
1259
  ]
1259
1260
  },
1260
1261
  friction: .35,
@@ -1318,11 +1319,11 @@ async function ct(e, n) {
1318
1319
  isKinematic: !1,
1319
1320
  mass: l,
1320
1321
  centerOfMass: [
1321
- H(a.x),
1322
- H(a.y),
1323
- H(a.z)
1322
+ U(a.x),
1323
+ U(a.y),
1324
+ U(a.z)
1324
1325
  ],
1325
- inertiaDiagonal: at(l, o, s, c)
1326
+ inertiaDiagonal: ct(l, o, s, c)
1326
1327
  },
1327
1328
  collider: r ? {
1328
1329
  meshNodeName: "PropBody",
@@ -1333,9 +1334,9 @@ async function ct(e, n) {
1333
1334
  shape: {
1334
1335
  type: "box",
1335
1336
  size: [
1336
- H(o),
1337
- H(s),
1338
- H(c)
1337
+ U(o),
1338
+ U(s),
1339
+ U(c)
1339
1340
  ]
1340
1341
  },
1341
1342
  friction: .6,
@@ -1347,7 +1348,7 @@ async function ct(e, n) {
1347
1348
  u.traverse((e) => {
1348
1349
  if (!(e instanceof p.Mesh) || !e.material) return;
1349
1350
  let t = e.material;
1350
- for (let e of it) {
1351
+ for (let e of st) {
1351
1352
  let n = t[e];
1352
1353
  n && !n.image && (m.push({
1353
1354
  rec: t,
@@ -1358,7 +1359,7 @@ async function ct(e, n) {
1358
1359
  });
1359
1360
  let h;
1360
1361
  try {
1361
- h = new Uint8Array(await C(u, d, f));
1362
+ h = new Uint8Array(await w(u, d, f));
1362
1363
  } finally {
1363
1364
  for (let e of m) e.rec[e.slot] = e.tex;
1364
1365
  }
@@ -1366,7 +1367,7 @@ async function ct(e, n) {
1366
1367
  return g instanceof Uint8Array ? g : new Uint8Array(g);
1367
1368
  }
1368
1369
  // src/importer/ChopShopPanel.tsx
1369
- var lt = [
1370
+ var ft = [
1370
1371
  {
1371
1372
  mode: "island",
1372
1373
  label: "1 · Bucket",
@@ -1387,7 +1388,7 @@ var lt = [
1387
1388
  label: "4 · Brush",
1388
1389
  hint: "Click or drag to paint faces. Alt / Right-click erases."
1389
1390
  }
1390
- ], ut = {
1391
+ ], pt = {
1391
1392
  position: "absolute",
1392
1393
  top: 52,
1393
1394
  right: 10,
@@ -1405,15 +1406,15 @@ var lt = [
1405
1406
  overflowY: "auto",
1406
1407
  zIndex: 18,
1407
1408
  backdropFilter: "blur(6px)"
1408
- }, dt = {
1409
+ }, mt = {
1409
1410
  border: "1px solid #1E293B",
1410
1411
  borderRadius: 4,
1411
1412
  padding: "7px 8px",
1412
1413
  display: "grid",
1413
1414
  gap: 6
1414
1415
  };
1415
- function U({ label: e, active: t = !1, disabled: n = !1, color: r = "#FFB000", onClick: i }) {
1416
- return /* @__PURE__ */ D("button", {
1416
+ function W({ label: e, active: t = !1, disabled: n = !1, color: r = "#FFB000", onClick: i }) {
1417
+ return /* @__PURE__ */ O("button", {
1417
1418
  type: "button",
1418
1419
  disabled: n,
1419
1420
  onClick: i,
@@ -1432,19 +1433,19 @@ function U({ label: e, active: t = !1, disabled: n = !1, color: r = "#FFB000", o
1432
1433
  children: e
1433
1434
  });
1434
1435
  }
1435
- function ft(e) {
1436
- let t = Pe.find((t) => t.role === e.activeRole) ?? Pe[0], n = (t) => t === "wheel" ? e.wheelCount : Object.values(e.partPicks).filter((e) => e === t).length, r = Object.keys(e.partPicks).length;
1437
- return /* @__PURE__ */ O("aside", {
1438
- style: ut,
1436
+ function ht(e) {
1437
+ let t = Fe.find((t) => t.role === e.activeRole) ?? Fe[0], n = (t) => t === "wheel" ? e.wheelCount : Object.values(e.partPicks).filter((e) => e === t).length, r = Object.keys(e.partPicks).length;
1438
+ return /* @__PURE__ */ k("aside", {
1439
+ style: pt,
1439
1440
  "aria-label": "Car Chop-Shop",
1440
1441
  children: [
1441
- /* @__PURE__ */ O("div", {
1442
+ /* @__PURE__ */ k("div", {
1442
1443
  style: {
1443
1444
  display: "flex",
1444
1445
  justifyContent: "space-between",
1445
1446
  alignItems: "center"
1446
1447
  },
1447
- children: [/* @__PURE__ */ D("span", {
1448
+ children: [/* @__PURE__ */ O("span", {
1448
1449
  style: {
1449
1450
  fontSize: 11.5,
1450
1451
  fontWeight: 800,
@@ -1452,7 +1453,7 @@ function ft(e) {
1452
1453
  letterSpacing: "0.05em"
1453
1454
  },
1454
1455
  children: "CHOP-SHOP · CUT & HINGE"
1455
- }), /* @__PURE__ */ D("span", {
1456
+ }), /* @__PURE__ */ O("span", {
1456
1457
  style: {
1457
1458
  fontSize: 10,
1458
1459
  color: "#38BDF8"
@@ -1460,23 +1461,23 @@ function ft(e) {
1460
1461
  children: `${e.wheelCount}W · ${r}P`
1461
1462
  })]
1462
1463
  }),
1463
- /* @__PURE__ */ O("div", {
1464
- style: dt,
1465
- children: [/* @__PURE__ */ O("div", {
1464
+ /* @__PURE__ */ k("div", {
1465
+ style: mt,
1466
+ children: [/* @__PURE__ */ k("div", {
1466
1467
  style: {
1467
1468
  display: "flex",
1468
1469
  justifyContent: "space-between",
1469
1470
  fontSize: 10.5,
1470
1471
  color: "#94A3B8"
1471
1472
  },
1472
- children: [/* @__PURE__ */ D("span", { children: "LENGTH (+Z SI)" }), /* @__PURE__ */ D("span", {
1473
+ children: [/* @__PURE__ */ O("span", { children: "LENGTH (+Z SI)" }), /* @__PURE__ */ O("span", {
1473
1474
  style: {
1474
1475
  color: "#00E5FF",
1475
1476
  fontWeight: 700
1476
1477
  },
1477
1478
  children: `${e.targetMeters.toFixed(2)} m`
1478
1479
  })]
1479
- }), /* @__PURE__ */ D("input", {
1480
+ }), /* @__PURE__ */ O("input", {
1480
1481
  type: "range",
1481
1482
  min: 1.6,
1482
1483
  max: 7.5,
@@ -1489,24 +1490,24 @@ function ft(e) {
1489
1490
  }
1490
1491
  })]
1491
1492
  }),
1492
- /* @__PURE__ */ O("div", {
1493
- style: dt,
1494
- children: [/* @__PURE__ */ D("span", {
1493
+ /* @__PURE__ */ k("div", {
1494
+ style: mt,
1495
+ children: [/* @__PURE__ */ O("span", {
1495
1496
  style: {
1496
1497
  fontSize: 10,
1497
1498
  color: "#94A3B8",
1498
1499
  letterSpacing: "0.06em"
1499
1500
  },
1500
1501
  children: "1. PICK PART ROLE TO TAG OR CUT"
1501
- }), /* @__PURE__ */ D("div", {
1502
+ }), /* @__PURE__ */ O("div", {
1502
1503
  style: {
1503
1504
  display: "grid",
1504
1505
  gridTemplateColumns: "1fr 1fr",
1505
1506
  gap: 5
1506
1507
  },
1507
- children: Pe.map((t) => {
1508
+ children: Fe.map((t) => {
1508
1509
  let r = n(t.role);
1509
- return /* @__PURE__ */ D(U, {
1510
+ return /* @__PURE__ */ O(W, {
1510
1511
  active: e.activeRole === t.role,
1511
1512
  color: t.color,
1512
1513
  label: `${t.label}${r > 0 ? ` (${r})` : ""}`,
@@ -1515,10 +1516,10 @@ function ft(e) {
1515
1516
  })
1516
1517
  })]
1517
1518
  }),
1518
- /* @__PURE__ */ O("div", {
1519
- style: dt,
1519
+ /* @__PURE__ */ k("div", {
1520
+ style: mt,
1520
1521
  children: [
1521
- /* @__PURE__ */ D("span", {
1522
+ /* @__PURE__ */ O("span", {
1522
1523
  style: {
1523
1524
  fontSize: 10,
1524
1525
  color: "#94A3B8",
@@ -1526,28 +1527,28 @@ function ft(e) {
1526
1527
  },
1527
1528
  children: "2. SURFACE CUTTER (FUSED MESHES)"
1528
1529
  }),
1529
- /* @__PURE__ */ D("div", {
1530
+ /* @__PURE__ */ O("div", {
1530
1531
  style: {
1531
1532
  display: "grid",
1532
1533
  gridTemplateColumns: "1fr 1fr",
1533
1534
  gap: 5
1534
1535
  },
1535
- children: lt.map((t) => /* @__PURE__ */ D(U, {
1536
+ children: ft.map((t) => /* @__PURE__ */ O(W, {
1536
1537
  label: t.label,
1537
1538
  active: e.surfaceMode === t.mode,
1538
1539
  color: "#00E5FF",
1539
1540
  onClick: () => e.onChangeSurfaceMode(t.mode)
1540
1541
  }, t.mode))
1541
1542
  }),
1542
- /* @__PURE__ */ D("div", {
1543
+ /* @__PURE__ */ O("div", {
1543
1544
  style: {
1544
1545
  fontSize: 10,
1545
1546
  color: "#94A3B8",
1546
1547
  lineHeight: 1.35
1547
1548
  },
1548
- children: lt.find((t) => t.mode === e.surfaceMode)?.hint
1549
+ children: ft.find((t) => t.mode === e.surfaceMode)?.hint
1549
1550
  }),
1550
- e.surfaceMode === "crease" && /* @__PURE__ */ O("label", {
1551
+ e.surfaceMode === "crease" && /* @__PURE__ */ k("label", {
1551
1552
  style: {
1552
1553
  display: "grid",
1553
1554
  gridTemplateColumns: "72px 1fr 36px",
@@ -1556,8 +1557,8 @@ function ft(e) {
1556
1557
  fontSize: 10.5
1557
1558
  },
1558
1559
  children: [
1559
- /* @__PURE__ */ D("span", { children: "Crease" }),
1560
- /* @__PURE__ */ D("input", {
1560
+ /* @__PURE__ */ O("span", { children: "Crease" }),
1561
+ /* @__PURE__ */ O("input", {
1561
1562
  type: "range",
1562
1563
  min: 12,
1563
1564
  max: 62,
@@ -1566,7 +1567,7 @@ function ft(e) {
1566
1567
  onChange: (t) => e.onChangeCreaseDeg(Number(t.target.value)),
1567
1568
  style: { accentColor: "#FFB000" }
1568
1569
  }),
1569
- /* @__PURE__ */ D("span", {
1570
+ /* @__PURE__ */ O("span", {
1570
1571
  style: {
1571
1572
  textAlign: "right",
1572
1573
  color: "#FFB000"
@@ -1575,7 +1576,7 @@ function ft(e) {
1575
1576
  })
1576
1577
  ]
1577
1578
  }),
1578
- /* @__PURE__ */ O("label", {
1579
+ /* @__PURE__ */ k("label", {
1579
1580
  style: {
1580
1581
  display: "flex",
1581
1582
  alignItems: "center",
@@ -1583,14 +1584,14 @@ function ft(e) {
1583
1584
  fontSize: 10.5,
1584
1585
  cursor: "pointer"
1585
1586
  },
1586
- children: [/* @__PURE__ */ D("input", {
1587
+ children: [/* @__PURE__ */ O("input", {
1587
1588
  type: "checkbox",
1588
1589
  checked: e.mirrorX,
1589
1590
  onChange: (t) => e.onToggleMirrorX(t.target.checked),
1590
1591
  style: { accentColor: "#00E5FF" }
1591
- }), /* @__PURE__ */ D("span", { children: "Mirror cut/tag across X = 0 (L + R)" })]
1592
+ }), /* @__PURE__ */ O("span", { children: "Mirror cut/tag across X = 0 (L + R)" })]
1592
1593
  }),
1593
- e.surfaceMode === "loop" && /* @__PURE__ */ O("label", {
1594
+ e.surfaceMode === "loop" && /* @__PURE__ */ k("label", {
1594
1595
  style: {
1595
1596
  display: "flex",
1596
1597
  alignItems: "center",
@@ -1598,59 +1599,59 @@ function ft(e) {
1598
1599
  fontSize: 10.5,
1599
1600
  cursor: "pointer"
1600
1601
  },
1601
- children: [/* @__PURE__ */ D("input", {
1602
+ children: [/* @__PURE__ */ O("input", {
1602
1603
  type: "checkbox",
1603
1604
  checked: e.splitCoarse,
1604
1605
  onChange: (t) => e.onToggleSplitCoarse(t.target.checked),
1605
1606
  style: { accentColor: "#FFB000" }
1606
- }), /* @__PURE__ */ D("span", { children: "Split coarse triangles under cut line" })]
1607
+ }), /* @__PURE__ */ O("span", { children: "Split coarse triangles under cut line" })]
1607
1608
  }),
1608
- e.surfaceMode !== "island" && /* @__PURE__ */ O("div", {
1609
+ e.surfaceMode !== "island" && /* @__PURE__ */ k("div", {
1609
1610
  style: {
1610
1611
  display: "flex",
1611
1612
  flexWrap: "wrap",
1612
1613
  gap: 5
1613
1614
  },
1614
1615
  children: [
1615
- e.surfaceMode === "loop" && /* @__PURE__ */ D(U, {
1616
+ e.surfaceMode === "loop" && /* @__PURE__ */ O(W, {
1616
1617
  label: `[ CLOSE LOOP (${e.loopDotCount}) ]`,
1617
1618
  disabled: e.loopDotCount < 3,
1618
1619
  color: "#00E5FF",
1619
1620
  onClick: e.onCloseLoop
1620
1621
  }),
1621
- /* @__PURE__ */ D(U, {
1622
+ /* @__PURE__ */ O(W, {
1622
1623
  label: `[ PEEL ${e.selectedFaces}${e.mirroredFaces > 0 ? `+${e.mirroredFaces}` : ""} FACES → ${e.activeRole.toUpperCase()} ]`,
1623
1624
  active: e.selectedFaces > 0,
1624
1625
  disabled: e.selectedFaces === 0,
1625
1626
  color: t.color,
1626
1627
  onClick: e.onPeel
1627
1628
  }),
1628
- (e.selectedFaces > 0 || e.loopDotCount > 0) && /* @__PURE__ */ D(U, {
1629
+ (e.selectedFaces > 0 || e.loopDotCount > 0) && /* @__PURE__ */ O(W, {
1629
1630
  label: "[ CLEAR ]",
1630
1631
  onClick: e.onClearSelection
1631
1632
  })
1632
1633
  ]
1633
1634
  }),
1634
- (e.undoCount > 0 || r > 0) && /* @__PURE__ */ O("div", {
1635
+ (e.undoCount > 0 || r > 0) && /* @__PURE__ */ k("div", {
1635
1636
  style: {
1636
1637
  display: "flex",
1637
1638
  gap: 5
1638
1639
  },
1639
- children: [e.undoCount > 0 && /* @__PURE__ */ D(U, {
1640
+ children: [e.undoCount > 0 && /* @__PURE__ */ O(W, {
1640
1641
  label: `[ UNDO CUT (${e.undoCount}) ]`,
1641
1642
  color: "#F43F5E",
1642
1643
  onClick: e.onUndoCut
1643
- }), r > 0 && /* @__PURE__ */ D(U, {
1644
+ }), r > 0 && /* @__PURE__ */ O(W, {
1644
1645
  label: "[ CLEAR TAGS ]",
1645
1646
  onClick: e.onClearTags
1646
1647
  })]
1647
1648
  })
1648
1649
  ]
1649
1650
  }),
1650
- /* @__PURE__ */ O("div", {
1651
- style: dt,
1651
+ /* @__PURE__ */ k("div", {
1652
+ style: mt,
1652
1653
  children: [
1653
- /* @__PURE__ */ D("span", {
1654
+ /* @__PURE__ */ O("span", {
1654
1655
  style: {
1655
1656
  fontSize: 10,
1656
1657
  color: "#94A3B8",
@@ -1658,7 +1659,7 @@ function ft(e) {
1658
1659
  },
1659
1660
  children: "3. HINGE & EXPLODE PREVIEW"
1660
1661
  }),
1661
- /* @__PURE__ */ O("label", {
1662
+ /* @__PURE__ */ k("label", {
1662
1663
  style: {
1663
1664
  display: "grid",
1664
1665
  gridTemplateColumns: "62px 1fr 42px",
@@ -1667,8 +1668,8 @@ function ft(e) {
1667
1668
  fontSize: 10.5
1668
1669
  },
1669
1670
  children: [
1670
- /* @__PURE__ */ D("span", { children: "Hinges" }),
1671
- /* @__PURE__ */ D("input", {
1671
+ /* @__PURE__ */ O("span", { children: "Hinges" }),
1672
+ /* @__PURE__ */ O("input", {
1672
1673
  type: "range",
1673
1674
  min: 0,
1674
1675
  max: 1,
@@ -1677,7 +1678,7 @@ function ft(e) {
1677
1678
  onChange: (t) => e.onChangeHingeScrub(Number(t.target.value)),
1678
1679
  style: { accentColor: "#10B981" }
1679
1680
  }),
1680
- /* @__PURE__ */ D("span", {
1681
+ /* @__PURE__ */ O("span", {
1681
1682
  style: {
1682
1683
  textAlign: "right",
1683
1684
  color: "#10B981"
@@ -1686,7 +1687,7 @@ function ft(e) {
1686
1687
  })
1687
1688
  ]
1688
1689
  }),
1689
- /* @__PURE__ */ O("label", {
1690
+ /* @__PURE__ */ k("label", {
1690
1691
  style: {
1691
1692
  display: "grid",
1692
1693
  gridTemplateColumns: "62px 1fr 42px",
@@ -1695,8 +1696,8 @@ function ft(e) {
1695
1696
  fontSize: 10.5
1696
1697
  },
1697
1698
  children: [
1698
- /* @__PURE__ */ D("span", { children: "Explode" }),
1699
- /* @__PURE__ */ D("input", {
1699
+ /* @__PURE__ */ O("span", { children: "Explode" }),
1700
+ /* @__PURE__ */ O("input", {
1700
1701
  type: "range",
1701
1702
  min: 0,
1702
1703
  max: 1.2,
@@ -1705,7 +1706,7 @@ function ft(e) {
1705
1706
  onChange: (t) => e.onChangeExplodeAmount(Number(t.target.value)),
1706
1707
  style: { accentColor: "#FFB000" }
1707
1708
  }),
1708
- /* @__PURE__ */ D("span", {
1709
+ /* @__PURE__ */ O("span", {
1709
1710
  style: {
1710
1711
  textAlign: "right",
1711
1712
  color: "#FFB000"
@@ -1716,10 +1717,10 @@ function ft(e) {
1716
1717
  })
1717
1718
  ]
1718
1719
  }),
1719
- /* @__PURE__ */ O("div", {
1720
- style: dt,
1720
+ /* @__PURE__ */ k("div", {
1721
+ style: mt,
1721
1722
  children: [
1722
- /* @__PURE__ */ D("span", {
1723
+ /* @__PURE__ */ O("span", {
1723
1724
  style: {
1724
1725
  fontSize: 10,
1725
1726
  color: "#94A3B8",
@@ -1727,25 +1728,25 @@ function ft(e) {
1727
1728
  },
1728
1729
  children: "4. WHEELS & POWERTRAIN"
1729
1730
  }),
1730
- /* @__PURE__ */ O("div", {
1731
+ /* @__PURE__ */ k("div", {
1731
1732
  style: {
1732
1733
  display: "grid",
1733
1734
  gridTemplateColumns: "1fr 1fr",
1734
1735
  gap: 5
1735
1736
  },
1736
- children: [/* @__PURE__ */ D(U, {
1737
+ children: [/* @__PURE__ */ O(W, {
1737
1738
  label: "Imported Tires",
1738
1739
  active: e.wheelSource === "imported",
1739
1740
  color: "#00E5FF",
1740
1741
  onClick: () => e.onChangeWheelSource("imported")
1741
- }), /* @__PURE__ */ D(U, {
1742
+ }), /* @__PURE__ */ O(W, {
1742
1743
  label: "12-Gon Fleet",
1743
1744
  active: e.wheelSource === "fleet12",
1744
1745
  color: "#10B981",
1745
1746
  onClick: () => e.onChangeWheelSource("fleet12")
1746
1747
  })]
1747
1748
  }),
1748
- /* @__PURE__ */ D("div", {
1749
+ /* @__PURE__ */ O("div", {
1749
1750
  style: {
1750
1751
  display: "grid",
1751
1752
  gridTemplateColumns: "repeat(3, 1fr)",
@@ -1755,14 +1756,14 @@ function ft(e) {
1755
1756
  "AWD",
1756
1757
  "RWD",
1757
1758
  "FWD"
1758
- ].map((t) => /* @__PURE__ */ D(U, {
1759
+ ].map((t) => /* @__PURE__ */ O(W, {
1759
1760
  label: t,
1760
1761
  active: e.driveType === t,
1761
1762
  color: "#FFB000",
1762
1763
  onClick: () => e.onChangeDriveType(t)
1763
1764
  }, t))
1764
1765
  }),
1765
- /* @__PURE__ */ O("label", {
1766
+ /* @__PURE__ */ k("label", {
1766
1767
  style: {
1767
1768
  display: "grid",
1768
1769
  gridTemplateColumns: "62px 1fr 46px",
@@ -1771,8 +1772,8 @@ function ft(e) {
1771
1772
  fontSize: 10.5
1772
1773
  },
1773
1774
  children: [
1774
- /* @__PURE__ */ D("span", { children: "Power" }),
1775
- /* @__PURE__ */ D("input", {
1775
+ /* @__PURE__ */ O("span", { children: "Power" }),
1776
+ /* @__PURE__ */ O("input", {
1776
1777
  type: "range",
1777
1778
  min: 90,
1778
1779
  max: 720,
@@ -1781,7 +1782,7 @@ function ft(e) {
1781
1782
  onChange: (t) => e.onChangeHorsepower(Number(t.target.value)),
1782
1783
  style: { accentColor: "#FFB000" }
1783
1784
  }),
1784
- /* @__PURE__ */ D("span", {
1785
+ /* @__PURE__ */ O("span", {
1785
1786
  style: {
1786
1787
  textAlign: "right",
1787
1788
  color: "#FFB000"
@@ -1792,7 +1793,7 @@ function ft(e) {
1792
1793
  })
1793
1794
  ]
1794
1795
  }),
1795
- e.statusNote && /* @__PURE__ */ D("div", {
1796
+ e.statusNote && /* @__PURE__ */ O("div", {
1796
1797
  style: {
1797
1798
  fontSize: 10.5,
1798
1799
  color: "#34D399",
@@ -1803,19 +1804,19 @@ function ft(e) {
1803
1804
  },
1804
1805
  children: e.statusNote
1805
1806
  }),
1806
- /* @__PURE__ */ O("div", {
1807
+ /* @__PURE__ */ k("div", {
1807
1808
  style: {
1808
1809
  display: "grid",
1809
1810
  gap: 6,
1810
1811
  marginTop: "auto"
1811
1812
  },
1812
- children: [/* @__PURE__ */ D(U, {
1813
+ children: [/* @__PURE__ */ O(W, {
1813
1814
  label: "[ -> STEP 2: COMPILE & TEST TRACK (WASD) ]",
1814
1815
  active: e.unlocked,
1815
1816
  disabled: !e.unlocked || e.busy,
1816
1817
  color: "#FFB000",
1817
1818
  onClick: e.onGoTestDrive
1818
- }), e.onSpawnWorld && /* @__PURE__ */ D(U, {
1819
+ }), e.onSpawnWorld && /* @__PURE__ */ O(W, {
1819
1820
  label: e.busy ? "[ COMPILING KHR3… ]" : "[ -> SPAWN & DRIVE ON LONG DRIVE ]",
1820
1821
  active: e.unlocked,
1821
1822
  disabled: !e.unlocked || e.busy,
@@ -1827,7 +1828,7 @@ function ft(e) {
1827
1828
  });
1828
1829
  }
1829
1830
  // src/importer/launcherBake.ts
1830
- var pt = {
1831
+ var gt = {
1831
1832
  receiver: "#334155",
1832
1833
  barrel: "#1e293b",
1833
1834
  bolt: "#94a3b8",
@@ -1837,14 +1838,14 @@ var pt = {
1837
1838
  stock: "#475569",
1838
1839
  screen_rect: "#38bdf8"
1839
1840
  };
1840
- function mt(e, t) {
1841
+ function _t(e, t) {
1841
1842
  let n = new p.Group();
1842
1843
  n.name = e.recipeId;
1843
1844
  let r = /* @__PURE__ */ new Map([["root", n]]);
1844
1845
  for (let i of e.nodes) {
1845
1846
  let a = r.get(i.parent) ?? n, o;
1846
1847
  if (i.size[0] > 0 && i.size[1] > 0 && i.size[2] > 0) {
1847
- let n = e.parts.find((e) => e.name === i.name || `${e.name}_Collider` === i.name), r = pt[n?.role ?? "receiver"] ?? "#475569", a = new p.MeshStandardMaterial({
1848
+ let n = e.parts.find((e) => e.name === i.name || `${e.name}_Collider` === i.name), r = gt[n?.role ?? "receiver"] ?? "#475569", a = new p.MeshStandardMaterial({
1848
1849
  color: r,
1849
1850
  roughness: .72,
1850
1851
  metalness: .28,
@@ -1860,20 +1861,20 @@ function mt(e, t) {
1860
1861
  }
1861
1862
  return n;
1862
1863
  }
1863
- async function ht(e = P, n, r = []) {
1864
- let i = typeof e == "string" ? pe.find((t) => t.id === e) ?? me("kolmogorov_carbine") : e, a = he(i), o = mt(a, n), s = new Uint8Array(await C(o, a.specs, {
1864
+ async function vt(e = de, n, r = []) {
1865
+ let i = typeof e == "string" ? me.find((t) => t.id === e) ?? he("kolmogorov_carbine") : e, a = ge(i), o = _t(a, n), s = new Uint8Array(await w(o, a.specs, {
1865
1866
  gateDomain: "launcher",
1866
1867
  launcher: a.spec,
1867
1868
  ikSockets: a.sockets
1868
1869
  })), c = t(s, r), l = c instanceof Uint8Array ? c : new Uint8Array(c), u = l.buffer.slice(l.byteOffset, l.byteOffset + l.byteLength);
1869
1870
  return {
1870
1871
  glbBytes: l,
1871
- bundle: await w(u),
1872
+ bundle: await T(u),
1872
1873
  plan: a
1873
1874
  };
1874
1875
  }
1875
1876
  // src/importer/DomainWorkshopPanel.tsx
1876
- var gt = {
1877
+ var yt = {
1877
1878
  position: "absolute",
1878
1879
  top: 52,
1879
1880
  left: 12,
@@ -1891,7 +1892,7 @@ var gt = {
1891
1892
  display: "flex",
1892
1893
  flexDirection: "column",
1893
1894
  gap: 8
1894
- }, W = {
1895
+ }, G = {
1895
1896
  padding: "5px 8px",
1896
1897
  background: "#11161C",
1897
1898
  border: "1px solid #00E5FF",
@@ -1902,7 +1903,7 @@ var gt = {
1902
1903
  cursor: "pointer",
1903
1904
  textAlign: "left"
1904
1905
  };
1905
- function _t(e) {
1906
+ function bt(e) {
1906
1907
  if (!e) return 0;
1907
1908
  let t = 0;
1908
1909
  return e.traverse((e) => {
@@ -1913,15 +1914,15 @@ function _t(e) {
1913
1914
  }
1914
1915
  }), t;
1915
1916
  }
1916
- function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r, onLoadVaultUrl: i, onForgeLauncherRecipe: a, onAddSocketPatch: o, onEnforceCrispyPerson: s, onUploadToVault: c }) {
1917
+ function xt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r, onLoadVaultUrl: i, onForgeLauncherRecipe: a, onAddSocketPatch: o, onEnforceCrispyPerson: s, onUploadToVault: c }) {
1917
1918
  let [l, u] = f(!1), [d, p] = f("cars"), [m, h] = f(""), [g, _] = f(null);
1918
1919
  if (e === "vehicle" && !l) return null;
1919
1920
  let v = Object.entries(N[d]);
1920
- return /* @__PURE__ */ O("aside", {
1921
- style: gt,
1921
+ return /* @__PURE__ */ k("aside", {
1922
+ style: yt,
1922
1923
  "aria-label": `${e.toUpperCase()} Workshop`,
1923
1924
  children: [
1924
- /* @__PURE__ */ O("div", {
1925
+ /* @__PURE__ */ k("div", {
1925
1926
  style: {
1926
1927
  display: "flex",
1927
1928
  justifyContent: "space-between",
@@ -1929,10 +1930,10 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
1929
1930
  color: "#FFB000",
1930
1931
  fontWeight: 700
1931
1932
  },
1932
- children: [/* @__PURE__ */ D("span", { children: `WORKSHOP :: ${e.toUpperCase()}` }), /* @__PURE__ */ D("button", {
1933
+ children: [/* @__PURE__ */ O("span", { children: `WORKSHOP :: ${e.toUpperCase()}` }), /* @__PURE__ */ O("button", {
1933
1934
  type: "button",
1934
1935
  style: {
1935
- ...W,
1936
+ ...G,
1936
1937
  padding: "2px 6px",
1937
1938
  borderColor: "#10B981"
1938
1939
  },
@@ -1940,34 +1941,34 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
1940
1941
  children: l ? "HIDE VAULT" : "R2 VAULT"
1941
1942
  })]
1942
1943
  }),
1943
- e === "c12" && /* @__PURE__ */ O(E, { children: [
1944
- /* @__PURE__ */ D("div", {
1944
+ e === "c12" && /* @__PURE__ */ k(D, { children: [
1945
+ /* @__PURE__ */ O("div", {
1945
1946
  style: { color: "#94A3B8" },
1946
1947
  children: "Exact 3.0m / 0.25m C12 Cyclotomic Lattice & Openings"
1947
1948
  }),
1948
- /* @__PURE__ */ D("button", {
1949
+ /* @__PURE__ */ O("button", {
1949
1950
  type: "button",
1950
- style: W,
1951
+ style: G,
1951
1952
  onClick: () => {
1952
1953
  n(3), r(), _("Snapped to 3.00 m C12 module (12 steps).");
1953
1954
  },
1954
1955
  children: "[ SNAP TO 3.00M C12 MODULE ]"
1955
1956
  }),
1956
- /* @__PURE__ */ D("button", {
1957
+ /* @__PURE__ */ O("button", {
1957
1958
  type: "button",
1958
- style: W,
1959
+ style: G,
1959
1960
  onClick: () => {
1960
1961
  o("Aperture_Doorway_900x2100", [
1961
1962
  0,
1962
- se.openingHeightM * .5,
1963
+ le.openingHeightM * .5,
1963
1964
  0
1964
- ]), o("Socket_DoorHinge", [...se.hingeOffsetLocal]), _("Stamped 900x2100 doorway + KHR revolute hinge socket.");
1965
+ ]), o("Socket_DoorHinge", [...le.hingeOffsetLocal]), _("Stamped 900x2100 doorway + KHR revolute hinge socket.");
1965
1966
  },
1966
1967
  children: "[ STAMP 0.9x2.1M HINGED DOORWAY ]"
1967
1968
  }),
1968
- /* @__PURE__ */ D("button", {
1969
+ /* @__PURE__ */ O("button", {
1969
1970
  type: "button",
1970
- style: W,
1971
+ style: G,
1971
1972
  onClick: () => {
1972
1973
  o("Aperture_Window", [
1973
1974
  0,
@@ -1977,45 +1978,45 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
1977
1978
  },
1978
1979
  children: "[ STAMP WINDOW APERTURE ]"
1979
1980
  }),
1980
- /* @__PURE__ */ D("button", {
1981
+ /* @__PURE__ */ O("button", {
1981
1982
  type: "button",
1982
- style: W,
1983
+ style: G,
1983
1984
  onClick: () => i(N.city.door_hinged_single, "door_hinged_900x2100"),
1984
1985
  children: "[ LOAD VAULT: HINGED DOOR .GLB ]"
1985
1986
  })
1986
1987
  ] }),
1987
- e === "launcher" && /* @__PURE__ */ O(E, { children: [
1988
- /* @__PURE__ */ D("div", {
1988
+ e === "launcher" && /* @__PURE__ */ k(D, { children: [
1989
+ /* @__PURE__ */ O("div", {
1989
1990
  style: { color: "#94A3B8" },
1990
1991
  children: "Articulated `@khr3/launchers` Forger (`Receiver_Root` + `Bolt`/`Pump`/`Trigger` KHR drives)"
1991
1992
  }),
1992
- /* @__PURE__ */ D("div", {
1993
+ /* @__PURE__ */ O("div", {
1993
1994
  style: {
1994
1995
  display: "flex",
1995
1996
  flexWrap: "wrap",
1996
1997
  gap: 4
1997
1998
  },
1998
- children: pe.map((e) => /* @__PURE__ */ D("button", {
1999
+ children: me.map((e) => /* @__PURE__ */ O("button", {
1999
2000
  type: "button",
2000
2001
  style: {
2001
- ...W,
2002
+ ...G,
2002
2003
  borderColor: "#FFB000",
2003
2004
  fontSize: 10
2004
2005
  },
2005
2006
  onClick: () => {
2006
- let t = he(e), n = Number((e.dims.receiverLength + e.dims.barrelLength + (e.dims.hasStock ? .22 : 0)).toFixed(2));
2007
- a?.(e.id, mt(t), n), _(`Forged ${e.label} (${t.parts.length} parts, ${e.spec.magazineCapacity} rd, ${e.spec.fireRateHz} Hz)`);
2007
+ let t = ge(e), n = Number((e.dims.receiverLength + e.dims.barrelLength + (e.dims.hasStock ? .22 : 0)).toFixed(2));
2008
+ a?.(e.id, _t(t), n), _(`Forged ${e.label} (${t.parts.length} parts, ${e.spec.magazineCapacity} rd, ${e.spec.fireRateHz} Hz)`);
2008
2009
  },
2009
2010
  children: `FORGE ${e.id.replace("kolmogorov_", "").toUpperCase()}`
2010
2011
  }, e.id))
2011
2012
  }),
2012
- /* @__PURE__ */ O("label", {
2013
+ /* @__PURE__ */ k("label", {
2013
2014
  style: {
2014
2015
  display: "flex",
2015
2016
  justifyContent: "space-between",
2016
2017
  alignItems: "center"
2017
2018
  },
2018
- children: [/* @__PURE__ */ D("span", { children: "Length (m):" }), /* @__PURE__ */ D("input", {
2019
+ children: [/* @__PURE__ */ O("span", { children: "Length (m):" }), /* @__PURE__ */ O("input", {
2019
2020
  type: "number",
2020
2021
  step: .05,
2021
2022
  min: .12,
@@ -2062,9 +2063,9 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2062
2063
  .07,
2063
2064
  -.12
2064
2065
  ]]
2065
- ].map(([e, t]) => /* @__PURE__ */ D("button", {
2066
+ ].map(([e, t]) => /* @__PURE__ */ O("button", {
2066
2067
  type: "button",
2067
- style: W,
2068
+ style: G,
2068
2069
  onClick: () => {
2069
2070
  o(e, [
2070
2071
  t[0],
@@ -2074,16 +2075,16 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2074
2075
  },
2075
2076
  children: `+ STAMP ${e}`
2076
2077
  }, e)),
2077
- /* @__PURE__ */ D("div", {
2078
+ /* @__PURE__ */ O("div", {
2078
2079
  style: {
2079
2080
  display: "flex",
2080
2081
  flexWrap: "wrap",
2081
2082
  gap: 4
2082
2083
  },
2083
- children: Object.entries(N.weapons).map(([e, t]) => /* @__PURE__ */ D("button", {
2084
+ children: Object.entries(N.weapons).map(([e, t]) => /* @__PURE__ */ O("button", {
2084
2085
  type: "button",
2085
2086
  style: {
2086
- ...W,
2087
+ ...G,
2087
2088
  borderColor: "#10B981",
2088
2089
  fontSize: 9.5
2089
2090
  },
@@ -2092,30 +2093,30 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2092
2093
  }, e))
2093
2094
  })
2094
2095
  ] }),
2095
- e === "person" && /* @__PURE__ */ O(E, { children: [
2096
- /* @__PURE__ */ D("div", {
2096
+ e === "person" && /* @__PURE__ */ k(D, { children: [
2097
+ /* @__PURE__ */ O("div", {
2097
2098
  style: { color: "#94A3B8" },
2098
2099
  children: "SI 1.75m Capsule (`BODY_SI`) & Faceted Mixamo Rig"
2099
2100
  }),
2100
- /* @__PURE__ */ D("button", {
2101
+ /* @__PURE__ */ O("button", {
2101
2102
  type: "button",
2102
- style: W,
2103
+ style: G,
2103
2104
  onClick: () => {
2104
- n(le.capsuleHalfHeight * 2 + le.capsuleRadius * 2 + le.floatHeight), _("Scaled character to exact 1.75 m SI standing height.");
2105
+ n(M.capsuleHalfHeight * 2 + M.capsuleRadius * 2 + M.floatHeight), _("Scaled character to exact 1.75 m SI standing height.");
2105
2106
  },
2106
2107
  children: "[ LOCK 1.75M SI STANDING HEIGHT ]"
2107
2108
  }),
2108
- /* @__PURE__ */ D("button", {
2109
+ /* @__PURE__ */ O("button", {
2109
2110
  type: "button",
2110
- style: W,
2111
+ style: G,
2111
2112
  onClick: () => {
2112
2113
  s(), _("Stripped normalMap/bumpMap + forced flatShading & NearestFilter.");
2113
2114
  },
2114
2115
  children: "[ ENFORCE FACETED RETRO SHADING ]"
2115
2116
  }),
2116
- /* @__PURE__ */ D("button", {
2117
+ /* @__PURE__ */ O("button", {
2117
2118
  type: "button",
2118
- style: W,
2119
+ style: G,
2119
2120
  onClick: () => {
2120
2121
  o("Socket_Hand_R", [
2121
2122
  .22,
@@ -2134,16 +2135,16 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2134
2135
  children: "[ STAMP HAND & BACK SOCKETS ]"
2135
2136
  })
2136
2137
  ] }),
2137
- (e === "prop" || e === "junk") && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D("div", {
2138
+ (e === "prop" || e === "junk") && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O("div", {
2138
2139
  style: { color: "#94A3B8" },
2139
2140
  children: e === "junk" ? "BVH Shatter & Local Decal Target" : "KHR Convex/Box Prop"
2140
- }), /* @__PURE__ */ D("button", {
2141
+ }), /* @__PURE__ */ O("button", {
2141
2142
  type: "button",
2142
- style: W,
2143
+ style: G,
2143
2144
  onClick: () => i(N.city.prop_arcade_cabinet, "prop_arcade_cabinet"),
2144
2145
  children: "[ LOAD VAULT: ARCADE CABINET ]"
2145
2146
  })] }),
2146
- l && /* @__PURE__ */ O("div", {
2147
+ l && /* @__PURE__ */ k("div", {
2147
2148
  style: {
2148
2149
  borderTop: "1px solid #1C2229",
2149
2150
  paddingTop: 8,
@@ -2152,7 +2153,7 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2152
2153
  gap: 6
2153
2154
  },
2154
2155
  children: [
2155
- /* @__PURE__ */ D("div", {
2156
+ /* @__PURE__ */ O("div", {
2156
2157
  style: {
2157
2158
  display: "flex",
2158
2159
  gap: 4
@@ -2161,17 +2162,17 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2161
2162
  "cars",
2162
2163
  "weapons",
2163
2164
  "city"
2164
- ].map((e) => /* @__PURE__ */ D("button", {
2165
+ ].map((e) => /* @__PURE__ */ O("button", {
2165
2166
  type: "button",
2166
2167
  style: {
2167
- ...W,
2168
+ ...G,
2168
2169
  borderColor: d === e ? "#FFB000" : "#1C2229"
2169
2170
  },
2170
2171
  onClick: () => p(e),
2171
2172
  children: e.toUpperCase()
2172
2173
  }, e))
2173
2174
  }),
2174
- /* @__PURE__ */ D("div", {
2175
+ /* @__PURE__ */ O("div", {
2175
2176
  style: {
2176
2177
  maxHeight: 120,
2177
2178
  overflowY: "auto",
@@ -2179,22 +2180,22 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2179
2180
  flexDirection: "column",
2180
2181
  gap: 3
2181
2182
  },
2182
- children: v.map(([e, t]) => /* @__PURE__ */ D("button", {
2183
+ children: v.map(([e, t]) => /* @__PURE__ */ O("button", {
2183
2184
  type: "button",
2184
2185
  style: {
2185
- ...W,
2186
+ ...G,
2186
2187
  fontSize: 10
2187
2188
  },
2188
2189
  onClick: () => i(t, e),
2189
2190
  children: `-> ${e}`
2190
2191
  }, e))
2191
2192
  }),
2192
- c && /* @__PURE__ */ O("div", {
2193
+ c && /* @__PURE__ */ k("div", {
2193
2194
  style: {
2194
2195
  display: "flex",
2195
2196
  gap: 4
2196
2197
  },
2197
- children: [/* @__PURE__ */ D("input", {
2198
+ children: [/* @__PURE__ */ O("input", {
2198
2199
  type: "password",
2199
2200
  placeholder: "VAULT_WRITE_TOKEN",
2200
2201
  value: m,
@@ -2207,21 +2208,21 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2207
2208
  padding: "3px 5px",
2208
2209
  fontSize: 10
2209
2210
  }
2210
- }), /* @__PURE__ */ D("button", {
2211
+ }), /* @__PURE__ */ O("button", {
2211
2212
  type: "button",
2212
2213
  style: {
2213
- ...W,
2214
+ ...G,
2214
2215
  borderColor: "#10B981"
2215
2216
  },
2216
2217
  onClick: () => {
2217
- c(d, m), _(`Uploading to ${ue().baseUrl}/assets/${d}…`);
2218
+ c(d, m), _(`Uploading to ${P().baseUrl}/assets/${d}…`);
2218
2219
  },
2219
2220
  children: "PUT R2"
2220
2221
  })]
2221
2222
  })
2222
2223
  ]
2223
2224
  }),
2224
- g && /* @__PURE__ */ D("div", {
2225
+ g && /* @__PURE__ */ O("div", {
2225
2226
  style: {
2226
2227
  color: "#10B981",
2227
2228
  fontSize: 10
@@ -2232,15 +2233,15 @@ function vt({ domain: e, targetMeters: t, onChangeTargetMeters: n, onSnapC12: r,
2232
2233
  });
2233
2234
  }
2234
2235
  // src/importer/gateStore.ts
2235
- var yt = Object.freeze({
2236
+ var St = Object.freeze({
2236
2237
  TRUCK: 1.4,
2237
2238
  STREET: 1.9,
2238
2239
  SPORT: 2.8
2239
- }), bt = Object.freeze({
2240
+ }), Ct = Object.freeze({
2240
2241
  PLUSH: .65,
2241
2242
  BALANCED: .75,
2242
2243
  STIFF: .85
2243
- }), G = {
2244
+ }), K = {
2244
2245
  massKg: 780,
2245
2246
  com: [
2246
2247
  0,
@@ -2254,7 +2255,7 @@ var yt = Object.freeze({
2254
2255
  sparkBurst: null,
2255
2256
  massDirty: !0
2256
2257
  };
2257
- function xt(e, t, n, r) {
2258
+ function wt(e, t, n, r) {
2258
2259
  let [i, a, o] = e.aabbSize, s = i >= .04 && a >= .04 && o >= .04 && Math.max(i, a, o) <= 120, c = Math.abs(e.minY) <= .005;
2259
2260
  if (!s || !c) return !1;
2260
2261
  if (t === "c12") return e.c12Aligned;
@@ -2264,7 +2265,7 @@ function xt(e, t, n, r) {
2264
2265
  }
2265
2266
  return !0;
2266
2267
  }
2267
- var K = ge((e) => ({
2268
+ var q = _e((e) => ({
2268
2269
  step: 1,
2269
2270
  domain: "vehicle",
2270
2271
  vehicleArchetype: "car",
@@ -2279,7 +2280,7 @@ var K = ge((e) => ({
2279
2280
  staticProp: !1,
2280
2281
  massKg: 1380,
2281
2282
  powerOrThrust: 240,
2282
- attachedMask: _e,
2283
+ attachedMask: F,
2283
2284
  unlatchedMask: 0,
2284
2285
  fuelLiters: 42,
2285
2286
  dropTrigger: 0,
@@ -2313,24 +2314,24 @@ var K = ge((e) => ({
2313
2314
  setCalibration: (t) => e({ calibration: t }),
2314
2315
  triggerDrop: () => e((e) => ({ dropTrigger: e.dropTrigger + 1 })),
2315
2316
  resetAllPanels: () => {
2316
- G.massDirty = !0, e({
2317
- attachedMask: _e,
2317
+ K.massDirty = !0, e({
2318
+ attachedMask: F,
2318
2319
  unlatchedMask: 0,
2319
2320
  detachedDebris: []
2320
2321
  });
2321
2322
  }
2322
- })), St = "#0A0C0E", Ct = "#1C2229", wt = "#FFB000", q = "#00E5FF", Tt = "#FF3B30", Et = "#10B981", Dt = "#E6EDF3";
2323
- function J({ label: e, active: t = !1, disabled: n = !1, accent: r = wt, onClick: i }) {
2324
- return /* @__PURE__ */ D("button", {
2323
+ })), Tt = "#0A0C0E", Et = "#1C2229", Dt = "#FFB000", J = "#00E5FF", Ot = "#FF3B30", kt = "#10B981", At = "#E6EDF3";
2324
+ function Y({ label: e, active: t = !1, disabled: n = !1, accent: r = Dt, onClick: i }) {
2325
+ return /* @__PURE__ */ O("button", {
2325
2326
  type: "button",
2326
2327
  disabled: n,
2327
2328
  onClick: i,
2328
2329
  style: {
2329
2330
  padding: "4px 8px",
2330
2331
  borderRadius: 2,
2331
- border: `1px solid ${n ? Ct : t ? r : q}`,
2332
- background: t ? r : St,
2333
- color: n ? "#55606E" : t ? St : Dt,
2332
+ border: `1px solid ${n ? Et : t ? r : J}`,
2333
+ background: t ? r : Tt,
2334
+ color: n ? "#55606E" : t ? Tt : At,
2334
2335
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
2335
2336
  fontSize: 10.5,
2336
2337
  fontWeight: t ? 700 : 500,
@@ -2340,23 +2341,23 @@ function J({ label: e, active: t = !1, disabled: n = !1, accent: r = wt, onClick
2340
2341
  children: e
2341
2342
  });
2342
2343
  }
2343
- var Ot = {
2344
+ var jt = {
2344
2345
  display: "flex",
2345
2346
  flexWrap: "wrap",
2346
2347
  justifyContent: "space-between",
2347
2348
  alignItems: "center",
2348
2349
  gap: 8,
2349
2350
  padding: "8px 12px",
2350
- background: St,
2351
- borderBottom: `1px solid ${Ct}`,
2351
+ background: Tt,
2352
+ borderBottom: `1px solid ${Et}`,
2352
2353
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
2353
2354
  zIndex: 20
2354
2355
  };
2355
- function kt(e) {
2356
- let t = K(), n = xt(t.calibration, t.domain, t.vehicleArchetype, t.usePaperShellProxy), r = d(null);
2356
+ function Mt(e) {
2357
+ let t = q(), n = wt(t.calibration, t.domain, t.vehicleArchetype, t.usePaperShellProxy), r = d(null);
2357
2358
  l(() => {
2358
2359
  let n = 0, i = "", a = () => {
2359
- let o = G.massKg.toFixed(0), s = G.com.map((e) => e.toFixed(2)).join(","), c = G.speedKmh.toFixed(0), l = G.rpm.toFixed(0), u = t.domain === "vehicle" ? `MASS=${o}KG COM=[${s}] HINGED=${e.choppedCount} ${l} RPM ${c} KM/H` : `MASS=${o}KG COM=[${s}] PATCHES=${e.patchCount} ${c} KM/H`;
2360
+ let o = K.massKg.toFixed(0), s = K.com.map((e) => e.toFixed(2)).join(","), c = K.speedKmh.toFixed(0), l = K.rpm.toFixed(0), u = t.domain === "vehicle" ? `MASS=${o}KG COM=[${s}] HINGED=${e.choppedCount} ${l} RPM ${c} KM/H` : `MASS=${o}KG COM=[${s}] PATCHES=${e.patchCount} ${c} KM/H`;
2360
2361
  u !== i && r.current && (r.current.textContent = u, i = u), n = requestAnimationFrame(a);
2361
2362
  };
2362
2363
  return n = requestAnimationFrame(a), () => cancelAnimationFrame(n);
@@ -2366,9 +2367,9 @@ function kt(e) {
2366
2367
  e.choppedCount
2367
2368
  ]);
2368
2369
  let i = t.calibration, a = t.domain === "c12" ? `C12=[${i.c12Ticks.join("x")}]TICKS (${i.c12Aligned ? "ALIGNED" : "OFF-GRID"}) MIN_Y=${i.minY.toFixed(4)}M AABB=[${i.aabbSize.join("x")}]M` : t.domain === "launcher" ? `ANCHORS=${i.detectedAnchors.length || 1} MIN_Y=${i.minY.toFixed(4)}M AABB=[${i.aabbSize.join("x")}]M` : `WB=${i.wheelbase.toFixed(2)}M MIN_Y=${i.minY.toFixed(4)}M AABB=[${i.aabbSize.join("x")}]M`;
2369
- return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ O("div", {
2370
- style: Ot,
2371
- children: [/* @__PURE__ */ O("div", {
2370
+ return /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ k("div", {
2371
+ style: jt,
2372
+ children: [/* @__PURE__ */ k("div", {
2372
2373
  style: {
2373
2374
  display: "flex",
2374
2375
  flexWrap: "wrap",
@@ -2376,10 +2377,10 @@ function kt(e) {
2376
2377
  alignItems: "center"
2377
2378
  },
2378
2379
  children: [
2379
- /* @__PURE__ */ D("span", {
2380
+ /* @__PURE__ */ O("span", {
2380
2381
  style: {
2381
2382
  fontSize: 11,
2382
- color: wt,
2383
+ color: Dt,
2383
2384
  fontWeight: 700
2384
2385
  },
2385
2386
  children: `KOLMO :: CAR CHOP-SHOP & GLB GATE · ${e.assetName.toUpperCase()}`
@@ -2391,36 +2392,36 @@ function kt(e) {
2391
2392
  "person",
2392
2393
  "prop",
2393
2394
  "junk"
2394
- ].map((n) => /* @__PURE__ */ D(J, {
2395
+ ].map((n) => /* @__PURE__ */ O(Y, {
2395
2396
  label: `[ ${n.toUpperCase()} ]`,
2396
2397
  active: t.domain === n,
2397
2398
  onClick: () => e.onSelectDomain(n)
2398
2399
  }, n)),
2399
- /* @__PURE__ */ D(J, {
2400
+ /* @__PURE__ */ O(Y, {
2400
2401
  label: e.hasCustomFile ? "[ REPLACE .GLB · .USD… ]" : "[ DROP / OPEN .GLB · .USD ]",
2401
- accent: q,
2402
+ accent: J,
2402
2403
  onClick: e.onChooseFile
2403
2404
  }),
2404
- !e.hasCustomFile && t.domain === "vehicle" && /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(J, {
2405
+ !e.hasCustomFile && t.domain === "vehicle" && /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(Y, {
2405
2406
  label: "BLANK: SOLID PICKUP",
2406
2407
  active: e.assetName === "pickup_truck",
2407
- accent: Et,
2408
+ accent: kt,
2408
2409
  onClick: () => e.onLoadStarterCar("/models/pickup-truck.glb", "pickup_truck")
2409
- }), /* @__PURE__ */ D(J, {
2410
+ }), /* @__PURE__ */ O(Y, {
2410
2411
  label: "BLANK: HATCHBACK",
2411
2412
  active: e.assetName === "hatchback_86",
2412
- accent: Et,
2413
+ accent: kt,
2413
2414
  onClick: () => e.onLoadStarterCar("/models/Hatchback-segmented.glb", "hatchback_86")
2414
2415
  })] }),
2415
- e.usdInfo && /* @__PURE__ */ D("span", {
2416
+ e.usdInfo && /* @__PURE__ */ O("span", {
2416
2417
  style: {
2417
2418
  fontSize: 10,
2418
- color: Et
2419
+ color: kt
2419
2420
  },
2420
2421
  children: e.usdInfo
2421
2422
  })
2422
2423
  ]
2423
- }), /* @__PURE__ */ O("div", {
2424
+ }), /* @__PURE__ */ k("div", {
2424
2425
  style: {
2425
2426
  display: "flex",
2426
2427
  flexWrap: "wrap",
@@ -2428,37 +2429,37 @@ function kt(e) {
2428
2429
  alignItems: "center"
2429
2430
  },
2430
2431
  children: [
2431
- /* @__PURE__ */ D(J, {
2432
+ /* @__PURE__ */ O(Y, {
2432
2433
  label: t.eraMode === "dreamcast-60" ? "[ ERA: DREAMCAST 60FPS ]" : "[ ERA: PSX 1/3 ]",
2433
2434
  active: t.eraMode === "psx-1-3",
2434
- accent: q,
2435
+ accent: J,
2435
2436
  onClick: () => t.setField("eraMode", t.eraMode === "dreamcast-60" ? "psx-1-3" : "dreamcast-60")
2436
2437
  }),
2437
- /* @__PURE__ */ D(J, {
2438
+ /* @__PURE__ */ O(Y, {
2438
2439
  label: "[ STEP 1: CHOP & CALIBRATE ]",
2439
2440
  active: t.step === 1,
2440
2441
  onClick: () => t.setField("step", 1)
2441
2442
  }),
2442
- /* @__PURE__ */ D(J, {
2443
+ /* @__PURE__ */ O(Y, {
2443
2444
  label: "[ -> STEP 2: LIVE DRIVE TRACK (WASD) ]",
2444
2445
  active: t.step === 2,
2445
2446
  disabled: !n,
2446
- accent: n ? wt : Tt,
2447
+ accent: n ? Dt : Ot,
2447
2448
  onClick: () => t.setField("step", 2)
2448
2449
  })
2449
2450
  ]
2450
2451
  })]
2451
- }), /* @__PURE__ */ O("div", {
2452
+ }), /* @__PURE__ */ k("div", {
2452
2453
  style: {
2453
- ...Ot,
2454
+ ...jt,
2454
2455
  position: "absolute",
2455
2456
  left: 0,
2456
2457
  right: 0,
2457
2458
  bottom: 0,
2458
2459
  borderBottom: "none",
2459
- borderTop: `1px solid ${Ct}`
2460
+ borderTop: `1px solid ${Et}`
2460
2461
  },
2461
- children: [t.step === 1 ? /* @__PURE__ */ O("div", {
2462
+ children: [t.step === 1 ? /* @__PURE__ */ k("div", {
2462
2463
  style: {
2463
2464
  display: "flex",
2464
2465
  flexWrap: "wrap",
@@ -2466,65 +2467,65 @@ function kt(e) {
2466
2467
  alignItems: "center"
2467
2468
  },
2468
2469
  children: [
2469
- /* @__PURE__ */ D(J, {
2470
+ /* @__PURE__ */ O(Y, {
2470
2471
  label: "[ ROT X +90° ]",
2471
2472
  onClick: () => e.onBumpTurn(0)
2472
2473
  }),
2473
- /* @__PURE__ */ D(J, {
2474
+ /* @__PURE__ */ O(Y, {
2474
2475
  label: "[ ROT Y +90° ]",
2475
2476
  onClick: () => e.onBumpTurn(1)
2476
2477
  }),
2477
- /* @__PURE__ */ D(J, {
2478
+ /* @__PURE__ */ O(Y, {
2478
2479
  label: "[ ROT Z +90° ]",
2479
2480
  onClick: () => e.onBumpTurn(2)
2480
2481
  }),
2481
- /* @__PURE__ */ D(J, {
2482
+ /* @__PURE__ */ O(Y, {
2482
2483
  label: "[ AUTO-SCALE SI ]",
2483
2484
  onClick: e.onAutoScaleSi
2484
2485
  }),
2485
- /* @__PURE__ */ D(J, {
2486
+ /* @__PURE__ */ O(Y, {
2486
2487
  label: "[ SNAP TIRES Y=0 ]",
2487
2488
  onClick: e.onSnapYZero
2488
2489
  }),
2489
- t.domain === "c12" && /* @__PURE__ */ D(J, {
2490
+ t.domain === "c12" && /* @__PURE__ */ O(Y, {
2490
2491
  label: "[ SNAP 1/12M C12 ]",
2491
- accent: Et,
2492
+ accent: kt,
2492
2493
  onClick: e.onSnapC12
2493
2494
  }),
2494
- t.domain === "vehicle" && /* @__PURE__ */ O(E, { children: [
2495
+ t.domain === "vehicle" && /* @__PURE__ */ k(D, { children: [
2495
2496
  [
2496
2497
  "car",
2497
2498
  "motorcycle",
2498
2499
  "starcraft"
2499
- ].map((n) => /* @__PURE__ */ D(J, {
2500
+ ].map((n) => /* @__PURE__ */ O(Y, {
2500
2501
  label: n.toUpperCase(),
2501
2502
  active: !t.usePaperShellProxy && t.vehicleArchetype === n,
2502
2503
  onClick: () => e.onSelectVehicleSub(n)
2503
2504
  }, n)),
2504
- !t.usePaperShellProxy && t.vehicleArchetype !== "starcraft" && /* @__PURE__ */ D(J, {
2505
+ !t.usePaperShellProxy && t.vehicleArchetype !== "starcraft" && /* @__PURE__ */ O(Y, {
2505
2506
  label: `[ AUTO-POP TIRES (${e.wheelCount}W) ]`,
2506
2507
  onClick: e.onAutoPopWheels
2507
2508
  }),
2508
- /* @__PURE__ */ D(J, {
2509
+ /* @__PURE__ */ O(Y, {
2509
2510
  label: "[ C0 CRASH PROXY ]",
2510
2511
  active: t.usePaperShellProxy,
2511
2512
  onClick: e.onWrapProxy
2512
2513
  })
2513
2514
  ] }),
2514
- t.domain === "prop" && /* @__PURE__ */ D(J, {
2515
+ t.domain === "prop" && /* @__PURE__ */ O(Y, {
2515
2516
  label: t.staticProp ? "[ STATIC HULL ]" : "[ DYNAMIC HULL ]",
2516
2517
  active: t.staticProp,
2517
2518
  onClick: () => t.setField("staticProp", !t.staticProp)
2518
2519
  }),
2519
- /* @__PURE__ */ D("span", {
2520
+ /* @__PURE__ */ O("span", {
2520
2521
  style: {
2521
2522
  fontSize: 10.5,
2522
- color: n ? q : Tt
2523
+ color: n ? J : Ot
2523
2524
  },
2524
2525
  children: a
2525
2526
  })
2526
2527
  ]
2527
- }) : /* @__PURE__ */ O("div", {
2528
+ }) : /* @__PURE__ */ k("div", {
2528
2529
  style: {
2529
2530
  display: "flex",
2530
2531
  flexWrap: "wrap",
@@ -2532,29 +2533,29 @@ function kt(e) {
2532
2533
  alignItems: "center"
2533
2534
  },
2534
2535
  children: [
2535
- /* @__PURE__ */ D(J, {
2536
+ /* @__PURE__ */ O(Y, {
2536
2537
  label: "[ RESET / DROP ]",
2537
- accent: wt,
2538
+ accent: Dt,
2538
2539
  onClick: () => t.triggerDrop()
2539
2540
  }),
2540
- t.domain === "vehicle" && /* @__PURE__ */ D(J, {
2541
+ t.domain === "vehicle" && /* @__PURE__ */ O(Y, {
2541
2542
  label: t.chaseCam ? "[ CAM: CHASE (WASD) ]" : "[ CAM: ORBIT ]",
2542
2543
  active: t.chaseCam,
2543
- accent: Et,
2544
+ accent: kt,
2544
2545
  onClick: () => t.setField("chaseCam", !t.chaseCam)
2545
2546
  }),
2546
- t.domain === "vehicle" && t.usePaperShellProxy ? /* @__PURE__ */ O(E, { children: [
2547
- /* @__PURE__ */ D(J, {
2547
+ t.domain === "vehicle" && t.usePaperShellProxy ? /* @__PURE__ */ k(D, { children: [
2548
+ /* @__PURE__ */ O(Y, {
2548
2549
  label: t.wrenchMode === "UNLATCH_200" ? "[ WRENCH: 200 N·S UNLATCH ]" : "[ WRENCH: 1800 N·S RIP OFF ]",
2549
2550
  active: t.wrenchMode === "RIP_1800",
2550
- accent: Tt,
2551
+ accent: Ot,
2551
2552
  onClick: () => t.setField("wrenchMode", t.wrenchMode === "UNLATCH_200" ? "RIP_1800" : "UNLATCH_200")
2552
2553
  }),
2553
2554
  [
2554
2555
  "TRUCK",
2555
2556
  "STREET",
2556
2557
  "SPORT"
2557
- ].map((e) => /* @__PURE__ */ D(J, {
2558
+ ].map((e) => /* @__PURE__ */ O(Y, {
2558
2559
  label: e,
2559
2560
  active: t.freqBucket === e,
2560
2561
  onClick: () => t.setField("freqBucket", e)
@@ -2563,31 +2564,31 @@ function kt(e) {
2563
2564
  "PLUSH",
2564
2565
  "BALANCED",
2565
2566
  "STIFF"
2566
- ].map((e) => /* @__PURE__ */ D(J, {
2567
+ ].map((e) => /* @__PURE__ */ O(Y, {
2567
2568
  label: e,
2568
2569
  active: t.dampBucket === e,
2569
- accent: q,
2570
+ accent: J,
2570
2571
  onClick: () => t.setField("dampBucket", e)
2571
2572
  }, e)),
2572
- /* @__PURE__ */ D(J, {
2573
+ /* @__PURE__ */ O(Y, {
2573
2574
  label: "[ RESET PANELS ]",
2574
2575
  onClick: () => t.resetAllPanels()
2575
2576
  })
2576
- ] }) : /* @__PURE__ */ O(E, { children: [
2577
- t.domain === "vehicle" && e.choppedCount > 0 && /* @__PURE__ */ O(E, { children: [
2578
- /* @__PURE__ */ D(J, {
2577
+ ] }) : /* @__PURE__ */ k(D, { children: [
2578
+ t.domain === "vehicle" && e.choppedCount > 0 && /* @__PURE__ */ k(D, { children: [
2579
+ /* @__PURE__ */ O(Y, {
2579
2580
  label: "[ SWING DOORS ]",
2580
- accent: wt,
2581
+ accent: Dt,
2581
2582
  onClick: () => e.onSwingPanelRole("door")
2582
2583
  }),
2583
- /* @__PURE__ */ D(J, {
2584
+ /* @__PURE__ */ O(Y, {
2584
2585
  label: "[ POP HOOD ]",
2585
- accent: Et,
2586
+ accent: kt,
2586
2587
  onClick: () => e.onSwingPanelRole("hood")
2587
2588
  }),
2588
- /* @__PURE__ */ D(J, {
2589
+ /* @__PURE__ */ O(Y, {
2589
2590
  label: "[ POP TRUNK ]",
2590
- accent: q,
2591
+ accent: J,
2591
2592
  onClick: () => e.onSwingPanelRole("trunk")
2592
2593
  })
2593
2594
  ] }),
@@ -2598,46 +2599,46 @@ function kt(e) {
2598
2599
  "brake_flare",
2599
2600
  "headlight",
2600
2601
  "seat"
2601
- ].map((t) => /* @__PURE__ */ D(J, {
2602
+ ].map((t) => /* @__PURE__ */ O(Y, {
2602
2603
  label: `STAMP:${t.toUpperCase()}`,
2603
2604
  active: e.stampTool === t,
2604
2605
  onClick: () => e.onSelectStampTool(t)
2605
2606
  }, t)),
2606
- e.patchCount > 0 && /* @__PURE__ */ D(J, {
2607
+ e.patchCount > 0 && /* @__PURE__ */ O(Y, {
2607
2608
  label: `[ UNDO (${e.patchCount}) ]`,
2608
2609
  onClick: e.onUndoPatch
2609
2610
  })
2610
2611
  ] }),
2611
- /* @__PURE__ */ D(J, {
2612
+ /* @__PURE__ */ O(Y, {
2612
2613
  label: "[ DOWNLOAD KHR3 .GLB ]",
2613
2614
  disabled: e.busy,
2614
- accent: q,
2615
+ accent: J,
2615
2616
  onClick: e.onDownloadGlb
2616
2617
  }),
2617
- e.onSpawnWorld && /* @__PURE__ */ D(J, {
2618
+ e.onSpawnWorld && /* @__PURE__ */ O(Y, {
2618
2619
  label: e.busy ? "[ SEALING… ]" : "[ DRIVE ON LONG DRIVE -> ]",
2619
2620
  disabled: e.busy,
2620
- accent: Et,
2621
+ accent: kt,
2621
2622
  onClick: e.onSpawnWorld
2622
2623
  })
2623
2624
  ]
2624
- }), /* @__PURE__ */ D("span", {
2625
+ }), /* @__PURE__ */ O("span", {
2625
2626
  ref: r,
2626
2627
  style: {
2627
2628
  fontSize: 10.5,
2628
- color: q
2629
+ color: J
2629
2630
  }
2630
2631
  })]
2631
2632
  })] });
2632
2633
  }
2633
2634
  // src/importer/importerWebMcp.ts
2634
- function At() {
2635
+ function Nt() {
2635
2636
  if (typeof navigator > "u") return null;
2636
2637
  let e = navigator.modelContext;
2637
2638
  return e && typeof e.registerTool == "function" ? e : null;
2638
2639
  }
2639
- function jt(e) {
2640
- let t = ue();
2640
+ function Pt(e) {
2641
+ let t = P();
2641
2642
  return [
2642
2643
  {
2643
2644
  name: "importer_state",
@@ -2648,7 +2649,7 @@ function jt(e) {
2648
2649
  },
2649
2650
  annotations: { readOnlyHint: !0 },
2650
2651
  execute: () => {
2651
- let t = K.getState();
2652
+ let t = q.getState();
2652
2653
  return {
2653
2654
  assetName: e.assetName,
2654
2655
  domain: t.domain,
@@ -2709,7 +2710,7 @@ function jt(e) {
2709
2710
  },
2710
2711
  execute: (e) => {
2711
2712
  let t = e.step === 2 ? 2 : 1;
2712
- return K.getState().setField("step", t), {
2713
+ return q.getState().setField("step", t), {
2713
2714
  ok: !0,
2714
2715
  step: t
2715
2716
  };
@@ -2860,11 +2861,11 @@ function jt(e) {
2860
2861
  }
2861
2862
  ];
2862
2863
  }
2863
- function Mt(e, t = !0) {
2864
- let n = At();
2864
+ function Ft(e, t = !0) {
2865
+ let n = Nt();
2865
2866
  return l(() => {
2866
2867
  if (!t || !n) return;
2867
- let r = new AbortController(), i = jt(e);
2868
+ let r = new AbortController(), i = Pt(e);
2868
2869
  for (let e of i) n.registerTool(e, { signal: r.signal });
2869
2870
  return () => {
2870
2871
  r.abort();
@@ -2876,12 +2877,8 @@ function Mt(e, t = !0) {
2876
2877
  e
2877
2878
  ]), !!(t && n);
2878
2879
  }
2879
- // src/importer/Step1CalibrationPlinth.tsx
2880
- function Nt(e, t) {
2881
- let n = new p.BufferGeometry();
2882
- return n.setAttribute("position", new p.BufferAttribute(e, 3)), n.setAttribute("normal", new p.BufferAttribute(t, 3)), n;
2883
- }
2884
- function Pt(e) {
2880
+ // src/importer/ImporterPlinthUikitTags.tsx
2881
+ function It(e) {
2885
2882
  let t = new p.Group();
2886
2883
  t.name = `Starter_${e}`;
2887
2884
  let n = e === "c12" ? new p.BoxGeometry(3, 3, 3) : e === "person" ? new p.CapsuleGeometry(.3, 1, 6, 12) : e === "launcher" ? new p.BoxGeometry(.14, .24, .92) : e === "junk" ? new p.CylinderGeometry(.32, .34, .85, 12) : new p.BoxGeometry(1.72, 1.25, 4.25), r = new p.Mesh(n, new p.MeshStandardMaterial({
@@ -2891,16 +2888,116 @@ function Pt(e) {
2891
2888
  }));
2892
2889
  return r.position.y = e === "c12" ? 1.5 : e === "person" ? .88 : .65, t.add(r), t;
2893
2890
  }
2894
- var Ft = Object.fromEntries(Pe.filter((e) => e.role !== "wheel").map((e) => [e.role, e.color]));
2895
- function It(t) {
2896
- let n = K((e) => e.calibration), r = d(!1), i = u(() => t.assembly.panels.map((e) => Nt(e.localPositions, e.localNormals)), [t.assembly]), a = u(() => Nt(t.assembly.wheels[0].positions, t.assembly.wheels[0].normals), [t.assembly]);
2891
+ new p.Vector3();
2892
+ function Lt({ position: e, label: t, sub: n, accent: r, onClick: i }) {
2893
+ let a = d(null), { camera: o } = g();
2894
+ return h(() => {
2895
+ a.current && a.current.quaternion.copy(o.quaternion);
2896
+ }), /* @__PURE__ */ O("group", {
2897
+ ref: a,
2898
+ position: [
2899
+ e[0],
2900
+ e[1],
2901
+ e[2]
2902
+ ],
2903
+ children: /* @__PURE__ */ O(Se, {
2904
+ pixelSize: .0022,
2905
+ children: /* @__PURE__ */ k(xe, {
2906
+ paddingX: 10,
2907
+ paddingY: 4,
2908
+ borderRadius: 999,
2909
+ backgroundColor: "rgba(9, 13, 24, 0.88)",
2910
+ borderWidth: 1.5,
2911
+ borderColor: r,
2912
+ flexDirection: "row",
2913
+ alignItems: "center",
2914
+ gap: 6,
2915
+ hover: { backgroundColor: "#1e293b" },
2916
+ onClick: i ? (e) => {
2917
+ e.stopPropagation(), i();
2918
+ } : void 0,
2919
+ children: [/* @__PURE__ */ O(Ce, {
2920
+ fontSize: 12,
2921
+ fontWeight: "bold",
2922
+ color: r,
2923
+ children: t
2924
+ }), /* @__PURE__ */ O(Ce, {
2925
+ fontSize: 11,
2926
+ color: "#cbd5e1",
2927
+ children: n
2928
+ })]
2929
+ })
2930
+ })
2931
+ });
2932
+ }
2933
+ function Rt({ cal: e, islands: t, wheelColors: n, partPicks: r, explodeAmount: i, onClickIsland: a }) {
2934
+ let o = u(() => `${e.aabbSize[0].toFixed(2)}m W × ${e.aabbSize[1].toFixed(2)}m H × ${e.aabbSize[2].toFixed(2)}m L`, [e.aabbSize]), s = u(() => `Ymin ${e.minY >= 0 ? "+" : ""}${e.minY.toFixed(3)}m`, [e.minY]), c = u(() => {
2935
+ let e = [];
2936
+ for (let a of t) {
2937
+ let t = n.get(a.id), o = r[a.id];
2938
+ if (!t && !o) continue;
2939
+ let s = Math.sign(a.center[0] || 1) * i * .65, c = [
2940
+ a.center[0] + s,
2941
+ a.center[1] + a.size[1] * .5 + .16,
2942
+ a.center[2]
2943
+ ];
2944
+ if (t) {
2945
+ let n = a.center[0] >= 0 ? "L" : "R", r = a.center[2] >= 0 ? "F" : "R";
2946
+ e.push({
2947
+ id: a.id,
2948
+ pos: c,
2949
+ label: `WHEEL ${r}${n}`,
2950
+ sub: `R ${(a.size[1] * .5).toFixed(2)}m`,
2951
+ accent: t
2952
+ });
2953
+ } else o && e.push({
2954
+ id: a.id,
2955
+ pos: c,
2956
+ label: o.toUpperCase(),
2957
+ sub: `${a.triangleIndices.length} tris`,
2958
+ accent: "#38bdf8"
2959
+ });
2960
+ if (e.length >= 12) break;
2961
+ }
2962
+ return e;
2963
+ }, [
2964
+ t,
2965
+ n,
2966
+ r,
2967
+ i
2968
+ ]);
2969
+ return /* @__PURE__ */ k("group", { children: [/* @__PURE__ */ O(Lt, {
2970
+ position: [
2971
+ 0,
2972
+ e.aabbSize[1] + e.minY + .34,
2973
+ 0
2974
+ ],
2975
+ label: "SI BOUNDS",
2976
+ sub: `${o} · ${s}`,
2977
+ accent: "#00e5ff"
2978
+ }), c.map((e) => /* @__PURE__ */ O(Lt, {
2979
+ position: e.pos,
2980
+ label: e.label,
2981
+ sub: e.sub,
2982
+ accent: e.accent,
2983
+ onClick: () => a(e.id)
2984
+ }, `pill_${e.id}`))] });
2985
+ }
2986
+ // src/importer/Step1CalibrationPlinth.tsx
2987
+ function zt(e, t) {
2988
+ let n = new p.BufferGeometry();
2989
+ return n.setAttribute("position", new p.BufferAttribute(e, 3)), n.setAttribute("normal", new p.BufferAttribute(t, 3)), n;
2990
+ }
2991
+ var Bt = Object.fromEntries(Fe.filter((e) => e.role !== "wheel").map((e) => [e.role, e.color]));
2992
+ function Vt(t) {
2993
+ let n = q((e) => e.calibration), r = d(!1), i = u(() => t.assembly.panels.map((e) => zt(e.localPositions, e.localNormals)), [t.assembly]), a = u(() => zt(t.assembly.wheels[0].positions, t.assembly.wheels[0].normals), [t.assembly]);
2897
2994
  l(() => {
2898
2995
  let e = () => {
2899
2996
  r.current = !1;
2900
2997
  };
2901
2998
  return window.addEventListener("pointerup", e), () => window.removeEventListener("pointerup", e);
2902
2999
  }, []);
2903
- let o = u(() => t.faceSelection ? t.islands.find((e) => e.id === t.faceSelection.islandId) ?? null : null, [t.faceSelection, t.islands]), s = u(() => o && t.faceSelection && t.faceSelection.triangles.length > 0 ? nt(o.geometry, t.faceSelection.triangles, .0045) : null, [o, t.faceSelection]), c = u(() => o && t.faceSelection && t.faceSelection.mirrored.length > 0 ? nt(o.geometry, t.faceSelection.mirrored, .0045) : null, [o, t.faceSelection]);
3000
+ let o = u(() => t.faceSelection ? t.islands.find((e) => e.id === t.faceSelection.islandId) ?? null : null, [t.faceSelection, t.islands]), s = u(() => o && t.faceSelection && t.faceSelection.triangles.length > 0 ? at(o.geometry, t.faceSelection.triangles, .0045) : null, [o, t.faceSelection]), c = u(() => o && t.faceSelection && t.faceSelection.mirrored.length > 0 ? at(o.geometry, t.faceSelection.mirrored, .0045) : null, [o, t.faceSelection]);
2904
3001
  l(() => () => {
2905
3002
  s?.dispose();
2906
3003
  }, [s]), l(() => () => {
@@ -2909,18 +3006,18 @@ function It(t) {
2909
3006
  let f = u(() => {
2910
3007
  if (!t.loopDots || t.loopDots.points.length < 2) return null;
2911
3008
  let e = t.islands.find((e) => e.id === t.loopDots.islandId);
2912
- return e ? Xe(e, t.loopDots.points) : null;
3009
+ return e ? $e(e, t.loopDots.points) : null;
2913
3010
  }, [t.loopDots, t.islands]), m = u(() => {
2914
3011
  if (t.wheelSource !== "fleet12" || t.islands.length === 0) return [];
2915
3012
  let e = [];
2916
3013
  return t.axles.forEach((n, r) => {
2917
3014
  for (let [i, a] of [["L", n.left], ["R", n.right]]) {
2918
3015
  if (a.length === 0) continue;
2919
- let n = I(t.islands, a), o = Math.max(.14, n.radius), s = Math.max(.1, n.halfWidth * 2);
3016
+ let n = L(t.islands, a), o = Math.max(.14, n.radius), s = Math.max(.1, n.halfWidth * 2);
2920
3017
  e.push({
2921
3018
  key: `f12_${r}_${i}`,
2922
3019
  pos: n.center,
2923
- group: rt(o, s)
3020
+ group: ot(o, s)
2924
3021
  });
2925
3022
  }
2926
3023
  }), e;
@@ -2941,175 +3038,186 @@ function It(t) {
2941
3038
  isDrag: r
2942
3039
  }));
2943
3040
  };
2944
- return /* @__PURE__ */ D(g, {
3041
+ return /* @__PURE__ */ O(_, {
2945
3042
  fit: !0,
2946
3043
  clip: !0,
2947
3044
  margin: 1.38,
2948
- children: /* @__PURE__ */ O(_, {
3045
+ children: /* @__PURE__ */ k(v, {
2949
3046
  firstHitOnly: !0,
2950
- children: [/* @__PURE__ */ O("group", {
3047
+ children: [/* @__PURE__ */ k("group", {
2951
3048
  ref: t.rootObjRef,
2952
- children: [t.useProxy ? /* @__PURE__ */ O(E, { children: [
2953
- t.previewScene && /* @__PURE__ */ D("primitive", { object: t.previewScene }),
2954
- t.assembly.panels.map((e, n) => /* @__PURE__ */ D("mesh", {
2955
- position: e.anchorChassis,
2956
- geometry: i[n],
2957
- children: /* @__PURE__ */ D("meshStandardMaterial", {
2958
- color: e.colorHex,
2959
- roughness: e.isGlass ? .15 : .88,
2960
- transparent: e.isGlass || !!t.previewScene,
2961
- opacity: t.previewScene ? .28 : e.isGlass ? .32 : 1,
2962
- wireframe: !!t.previewScene,
2963
- flatShading: t.assembly.shadingMode === "psx-flat"
2964
- })
2965
- }, e.partId)),
2966
- t.assembly.wheels.map((e) => /* @__PURE__ */ D("group", {
2967
- position: e.position,
2968
- children: /* @__PURE__ */ D("mesh", {
2969
- geometry: a,
2970
- children: /* @__PURE__ */ D("meshStandardMaterial", {
2971
- color: 1843753,
2972
- roughness: .9,
2973
- flatShading: !0
3049
+ children: [
3050
+ t.useProxy ? /* @__PURE__ */ k(D, { children: [
3051
+ t.previewScene && /* @__PURE__ */ O("primitive", { object: t.previewScene }),
3052
+ t.assembly.panels.map((e, n) => /* @__PURE__ */ O("mesh", {
3053
+ position: e.anchorChassis,
3054
+ geometry: i[n],
3055
+ children: /* @__PURE__ */ O("meshStandardMaterial", {
3056
+ color: e.colorHex,
3057
+ roughness: e.isGlass ? .15 : .88,
3058
+ transparent: e.isGlass || !!t.previewScene,
3059
+ opacity: t.previewScene ? .28 : e.isGlass ? .32 : 1,
3060
+ wireframe: !!t.previewScene,
3061
+ flatShading: t.assembly.shadingMode === "psx-flat"
2974
3062
  })
2975
- })
2976
- }, e.slotId))
2977
- ] }) : t.islands.length > 0 ? /* @__PURE__ */ O(E, { children: [
2978
- t.islands.map((n) => {
2979
- let i = t.wheelColors.get(n.id), a = i ? void 0 : t.partPicks[n.id], o = i ?? (a ? Ft[a] : void 0);
2980
- if (i && t.wheelSource === "fleet12") return null;
2981
- let s = [
2982
- 0,
2983
- 0,
2984
- 0
2985
- ], c = [
2986
- 0,
2987
- 0,
2988
- 0
2989
- ], l = new p.Quaternion();
2990
- if (a && (t.hingeScrub > 0 || t.explodeAmount > 0)) {
2991
- let r = e(n, a);
2992
- c = r.anchor, t.hingeScrub > 0 && l.setFromAxisAngle(new p.Vector3(...r.axis).normalize(), r.openAngle * t.hingeScrub), t.explodeAmount > 0 && (s = [
2993
- r.explodeDir[0] * t.explodeAmount,
2994
- r.explodeDir[1] * t.explodeAmount,
2995
- r.explodeDir[2] * t.explodeAmount
3063
+ }, e.partId)),
3064
+ t.assembly.wheels.map((e) => /* @__PURE__ */ O("group", {
3065
+ position: e.position,
3066
+ children: /* @__PURE__ */ O("mesh", {
3067
+ geometry: a,
3068
+ children: /* @__PURE__ */ O("meshStandardMaterial", {
3069
+ color: 1843753,
3070
+ roughness: .9,
3071
+ flatShading: !0
3072
+ })
3073
+ })
3074
+ }, e.slotId))
3075
+ ] }) : t.islands.length > 0 ? /* @__PURE__ */ k(D, { children: [
3076
+ t.islands.map((n) => {
3077
+ let i = t.wheelColors.get(n.id), a = i ? void 0 : t.partPicks[n.id], o = i ?? (a ? Bt[a] : void 0);
3078
+ if (i && t.wheelSource === "fleet12") return null;
3079
+ let s = [
3080
+ 0,
3081
+ 0,
3082
+ 0
3083
+ ], c = [
3084
+ 0,
3085
+ 0,
3086
+ 0
3087
+ ], l = new p.Quaternion();
3088
+ if (a && (t.hingeScrub > 0 || t.explodeAmount > 0)) {
3089
+ let r = e(n, a);
3090
+ c = r.anchor, t.hingeScrub > 0 && l.setFromAxisAngle(new p.Vector3(...r.axis).normalize(), r.openAngle * t.hingeScrub), t.explodeAmount > 0 && (s = [
3091
+ r.explodeDir[0] * t.explodeAmount,
3092
+ r.explodeDir[1] * t.explodeAmount,
3093
+ r.explodeDir[2] * t.explodeAmount
3094
+ ]);
3095
+ } else i && t.explodeAmount > 0 && (s = [
3096
+ Math.sign(n.center[0] || 1) * t.explodeAmount * .65,
3097
+ 0,
3098
+ 0
2996
3099
  ]);
2997
- } else i && t.explodeAmount > 0 && (s = [
2998
- Math.sign(n.center[0] || 1) * t.explodeAmount * .65,
2999
- 0,
3000
- 0
3001
- ]);
3002
- return /* @__PURE__ */ D("group", {
3003
- position: [
3004
- c[0] + s[0],
3005
- c[1] + s[1],
3006
- c[2] + s[2]
3007
- ],
3008
- quaternion: l,
3009
- children: /* @__PURE__ */ O("group", {
3100
+ return /* @__PURE__ */ O("group", {
3010
3101
  position: [
3011
- -c[0],
3012
- -c[1],
3013
- -c[2]
3102
+ c[0] + s[0],
3103
+ c[1] + s[1],
3104
+ c[2] + s[2]
3014
3105
  ],
3015
- children: [/* @__PURE__ */ D("mesh", {
3016
- geometry: n.geometry,
3017
- material: n.material,
3018
- onClick: (e) => {
3019
- e.delta > 5 || (t.surfaceMode === "island" ? (e.stopPropagation(), t.onClickIsland(n.id)) : t.surfaceMode !== "triangle" && h(e, n.id, !1));
3020
- },
3021
- onContextMenu: (e) => {
3022
- t.surfaceMode !== "island" && h(e, n.id, !1);
3023
- },
3024
- onPointerDown: (e) => {
3025
- t.surfaceMode === "triangle" && (e.button === 0 || e.button === 2) && (r.current = !0, h(e, n.id, !1));
3026
- },
3027
- onPointerMove: (e) => {
3028
- t.surfaceMode === "triangle" && r.current && h(e, n.id, !0);
3029
- }
3030
- }), o && /* @__PURE__ */ D("mesh", {
3031
- geometry: n.geometry,
3032
- raycast: () => null,
3033
- children: /* @__PURE__ */ D("meshBasicMaterial", {
3034
- color: o,
3035
- transparent: !0,
3036
- opacity: .38,
3037
- depthWrite: !1
3038
- })
3039
- })]
3106
+ quaternion: l,
3107
+ children: /* @__PURE__ */ k("group", {
3108
+ position: [
3109
+ -c[0],
3110
+ -c[1],
3111
+ -c[2]
3112
+ ],
3113
+ children: [/* @__PURE__ */ O("mesh", {
3114
+ geometry: n.geometry,
3115
+ material: n.material,
3116
+ onClick: (e) => {
3117
+ e.delta > 5 || (t.surfaceMode === "island" ? (e.stopPropagation(), t.onClickIsland(n.id)) : t.surfaceMode !== "triangle" && h(e, n.id, !1));
3118
+ },
3119
+ onContextMenu: (e) => {
3120
+ t.surfaceMode !== "island" && h(e, n.id, !1);
3121
+ },
3122
+ onPointerDown: (e) => {
3123
+ t.surfaceMode === "triangle" && (e.button === 0 || e.button === 2) && (r.current = !0, h(e, n.id, !1));
3124
+ },
3125
+ onPointerMove: (e) => {
3126
+ t.surfaceMode === "triangle" && r.current && h(e, n.id, !0);
3127
+ }
3128
+ }), o && /* @__PURE__ */ O("mesh", {
3129
+ geometry: n.geometry,
3130
+ raycast: () => null,
3131
+ children: /* @__PURE__ */ O("meshBasicMaterial", {
3132
+ color: o,
3133
+ transparent: !0,
3134
+ opacity: .38,
3135
+ depthWrite: !1
3136
+ })
3137
+ })]
3138
+ })
3139
+ }, n.id);
3140
+ }),
3141
+ m.map((e) => /* @__PURE__ */ O("primitive", {
3142
+ object: e.group,
3143
+ position: [
3144
+ e.pos[0] + Math.sign(e.pos[0] || 1) * t.explodeAmount * .65,
3145
+ e.pos[1],
3146
+ e.pos[2]
3147
+ ]
3148
+ }, e.key)),
3149
+ s && /* @__PURE__ */ O("mesh", {
3150
+ geometry: s,
3151
+ raycast: () => null,
3152
+ children: /* @__PURE__ */ O("meshBasicMaterial", {
3153
+ color: t.activeRoleColor,
3154
+ transparent: !0,
3155
+ opacity: .62,
3156
+ side: p.DoubleSide,
3157
+ depthWrite: !1
3040
3158
  })
3041
- }, n.id);
3042
- }),
3043
- m.map((e) => /* @__PURE__ */ D("primitive", {
3044
- object: e.group,
3045
- position: [
3046
- e.pos[0] + Math.sign(e.pos[0] || 1) * t.explodeAmount * .65,
3047
- e.pos[1],
3048
- e.pos[2]
3049
- ]
3050
- }, e.key)),
3051
- s && /* @__PURE__ */ D("mesh", {
3052
- geometry: s,
3053
- raycast: () => null,
3054
- children: /* @__PURE__ */ D("meshBasicMaterial", {
3055
- color: t.activeRoleColor,
3056
- transparent: !0,
3057
- opacity: .62,
3058
- side: p.DoubleSide,
3059
- depthWrite: !1
3060
- })
3061
- }),
3062
- c && /* @__PURE__ */ D("mesh", {
3063
- geometry: c,
3064
- raycast: () => null,
3065
- children: /* @__PURE__ */ D("meshBasicMaterial", {
3066
- color: "#00E5FF",
3067
- transparent: !0,
3068
- opacity: .48,
3069
- side: p.DoubleSide,
3070
- depthWrite: !1
3159
+ }),
3160
+ c && /* @__PURE__ */ O("mesh", {
3161
+ geometry: c,
3162
+ raycast: () => null,
3163
+ children: /* @__PURE__ */ O("meshBasicMaterial", {
3164
+ color: "#00E5FF",
3165
+ transparent: !0,
3166
+ opacity: .48,
3167
+ side: p.DoubleSide,
3168
+ depthWrite: !1
3169
+ })
3170
+ }),
3171
+ t.loopDots?.points.map((e, t) => /* @__PURE__ */ k("mesh", {
3172
+ position: [
3173
+ e[0],
3174
+ e[1],
3175
+ e[2]
3176
+ ],
3177
+ raycast: () => null,
3178
+ children: [/* @__PURE__ */ O("sphereGeometry", { args: [
3179
+ .032,
3180
+ 10,
3181
+ 10
3182
+ ] }), /* @__PURE__ */ O("meshBasicMaterial", {
3183
+ color: t === 0 ? "#10B981" : "#FFB000",
3184
+ depthTest: !1
3185
+ })]
3186
+ }, `dot_${t}`)),
3187
+ f && f.length >= 2 && /* @__PURE__ */ O(b, {
3188
+ points: f,
3189
+ color: "#FFB000",
3190
+ lineWidth: 2.5
3071
3191
  })
3072
- }),
3073
- t.loopDots?.points.map((e, t) => /* @__PURE__ */ O("mesh", {
3192
+ ] }) : t.previewScene && /* @__PURE__ */ O("primitive", { object: t.previewScene }),
3193
+ /* @__PURE__ */ k("mesh", {
3074
3194
  position: [
3075
- e[0],
3076
- e[1],
3077
- e[2]
3195
+ 0,
3196
+ n.aabbSize[1] * .5 + n.minY,
3197
+ 0
3078
3198
  ],
3079
3199
  raycast: () => null,
3080
- children: [/* @__PURE__ */ D("sphereGeometry", { args: [
3081
- .032,
3082
- 10,
3083
- 10
3084
- ] }), /* @__PURE__ */ D("meshBasicMaterial", {
3085
- color: t === 0 ? "#10B981" : "#FFB000",
3086
- depthTest: !1
3200
+ children: [/* @__PURE__ */ O("boxGeometry", { args: [
3201
+ n.aabbSize[0],
3202
+ n.aabbSize[1],
3203
+ n.aabbSize[2]
3204
+ ] }), /* @__PURE__ */ O("meshBasicMaterial", {
3205
+ color: 58879,
3206
+ wireframe: !0,
3207
+ transparent: !0,
3208
+ opacity: .28
3087
3209
  })]
3088
- }, `dot_${t}`)),
3089
- f && f.length >= 2 && /* @__PURE__ */ D(y, {
3090
- points: f,
3091
- color: "#FFB000",
3092
- lineWidth: 2.5
3210
+ }),
3211
+ /* @__PURE__ */ O(Rt, {
3212
+ cal: n,
3213
+ islands: t.islands,
3214
+ wheelColors: t.wheelColors,
3215
+ partPicks: t.partPicks,
3216
+ explodeAmount: t.explodeAmount,
3217
+ onClickIsland: t.onClickIsland
3093
3218
  })
3094
- ] }) : t.previewScene && /* @__PURE__ */ D("primitive", { object: t.previewScene }), /* @__PURE__ */ O("mesh", {
3095
- position: [
3096
- 0,
3097
- n.aabbSize[1] * .5 + n.minY,
3098
- 0
3099
- ],
3100
- raycast: () => null,
3101
- children: [/* @__PURE__ */ D("boxGeometry", { args: [
3102
- n.aabbSize[0],
3103
- n.aabbSize[1],
3104
- n.aabbSize[2]
3105
- ] }), /* @__PURE__ */ D("meshBasicMaterial", {
3106
- color: 58879,
3107
- wireframe: !0,
3108
- transparent: !0,
3109
- opacity: .28
3110
- })]
3111
- })]
3112
- }), /* @__PURE__ */ O("mesh", {
3219
+ ]
3220
+ }), /* @__PURE__ */ k("mesh", {
3113
3221
  position: [
3114
3222
  0,
3115
3223
  .01,
@@ -3121,11 +3229,11 @@ function It(t) {
3121
3229
  0
3122
3230
  ],
3123
3231
  raycast: () => null,
3124
- children: [/* @__PURE__ */ D("coneGeometry", { args: [
3232
+ children: [/* @__PURE__ */ O("coneGeometry", { args: [
3125
3233
  .25,
3126
3234
  .6,
3127
3235
  3
3128
- ] }), /* @__PURE__ */ D("meshBasicMaterial", {
3236
+ ] }), /* @__PURE__ */ O("meshBasicMaterial", {
3129
3237
  color: 58879,
3130
3238
  wireframe: !0
3131
3239
  })]
@@ -3134,7 +3242,7 @@ function It(t) {
3134
3242
  });
3135
3243
  }
3136
3244
  // src/importer/glbNormalizer.ts
3137
- var Lt = 1 / 12, Rt = Object.freeze([
3245
+ var Ht = 1 / 12, Ut = Object.freeze([
3138
3246
  "IK_Palm_Primary",
3139
3247
  "IK_Index_Trigger",
3140
3248
  "IK_Thumb_Safety",
@@ -3147,18 +3255,18 @@ var Lt = 1 / 12, Rt = Object.freeze([
3147
3255
  "Socket_Holster",
3148
3256
  "Socket_Seat",
3149
3257
  "Socket_Optic"
3150
- ]), Y = new p.Box3(), X = new p.Vector3();
3151
- function zt(e) {
3258
+ ]), Wt = new p.Box3(), X = new p.Vector3();
3259
+ function Gt(e) {
3152
3260
  return [
3153
3261
  e[0] * .5,
3154
3262
  e[1] * .5,
3155
3263
  e[2] * .5
3156
3264
  ];
3157
3265
  }
3158
- function Bt(e) {
3266
+ function Kt(e) {
3159
3267
  return Number((Math.max(1, Math.round(e * 12)) / 12).toFixed(6));
3160
3268
  }
3161
- function Vt(e) {
3269
+ function qt(e) {
3162
3270
  let t = [
3163
3271
  Math.round(e[0] * 12),
3164
3272
  Math.round(e[1] * 12),
@@ -3169,14 +3277,14 @@ function Vt(e) {
3169
3277
  c12Aligned: t.every((e) => e >= 1) && Math.abs(e[0] * 12 - t[0]) <= .06 && Math.abs(e[1] * 12 - t[1]) <= .06 && Math.abs(e[2] * 12 - t[2]) <= .06
3170
3278
  };
3171
3279
  }
3172
- function Ht(e) {
3280
+ function Jt(e) {
3173
3281
  if (!e) return [];
3174
3282
  let t = /* @__PURE__ */ new Set();
3175
3283
  return e.traverse((e) => {
3176
- e.name && (Rt.includes(e.name) || e.name.startsWith("IK_") || e.name.startsWith("Socket_") || e.name.startsWith("Kolmo_")) && t.add(e.name);
3284
+ e.name && (Ut.includes(e.name) || e.name.startsWith("IK_") || e.name.startsWith("Socket_") || e.name.startsWith("Kolmo_")) && t.add(e.name);
3177
3285
  }), [...t];
3178
3286
  }
3179
- function Ut(e, t) {
3287
+ function Yt(e, t) {
3180
3288
  return e === "c12" ? {
3181
3289
  len: 3,
3182
3290
  massKg: 0,
@@ -3211,12 +3319,12 @@ function Ut(e, t) {
3211
3319
  power: 260
3212
3320
  };
3213
3321
  }
3214
- function Wt(e, t = 1, n = 0, r = !1, i = null) {
3322
+ function Xt(e, t = 1, n = 0, r = !1, i = null) {
3215
3323
  let a = e.lattice.preset, o = a.wheelbase * t, s = a.trackWidth * t, c = Number((a.wheelRadius * t).toFixed(3)), l = (e.lattice.rings[e.lattice.rings.length - 1].z - e.lattice.rings[0].z) * t, u = [
3216
3324
  Number((a.halfWidth * 2 * t).toFixed(3)),
3217
3325
  Number((a.roofY * t).toFixed(3)),
3218
3326
  Number(l.toFixed(3))
3219
- ], { c12Ticks: d, c12Aligned: f } = Vt(u), p = {
3327
+ ], { c12Ticks: d, c12Aligned: f } = qt(u), p = {
3220
3328
  wheelbase: Number(o.toFixed(3)),
3221
3329
  trackWidth: Number(s.toFixed(3)),
3222
3330
  wheelRadii: [
@@ -3229,18 +3337,18 @@ function Wt(e, t = 1, n = 0, r = !1, i = null) {
3229
3337
  aabbSize: u,
3230
3338
  c12Ticks: d,
3231
3339
  c12Aligned: f,
3232
- detectedAnchors: Ht(i),
3340
+ detectedAnchors: Jt(i),
3233
3341
  isSingleMeshProxy: r
3234
3342
  };
3235
- return K.getState().setCalibration(p), p;
3343
+ return q.getState().setCalibration(p), p;
3236
3344
  }
3237
- function Gt(e, t = 0) {
3238
- e.updateMatrixWorld(!0), Y.setFromObject(e), Y.isEmpty() ? X.set(1, 1, 1) : Y.getSize(X);
3345
+ function Zt(e, t = 0) {
3346
+ e.updateMatrixWorld(!0), Wt.setFromObject(e), Wt.isEmpty() ? X.set(1, 1, 1) : Wt.getSize(X);
3239
3347
  let n = [
3240
3348
  Number(X.x.toFixed(3)),
3241
3349
  Number(X.y.toFixed(3)),
3242
3350
  Number(X.z.toFixed(3))
3243
- ], r = Number(Math.max(1.25, X.z * .62).toFixed(3)), i = Number(Math.max(.4, X.x * .82).toFixed(3)), a = Number(Math.max(.2, Math.min(.45, X.y * .24)).toFixed(3)), { c12Ticks: o, c12Aligned: s } = Vt(n), c = {
3351
+ ], r = Number(Math.max(1.25, X.z * .62).toFixed(3)), i = Number(Math.max(.4, X.x * .82).toFixed(3)), a = Number(Math.max(.2, Math.min(.45, X.y * .24)).toFixed(3)), { c12Ticks: o, c12Aligned: s } = qt(n), c = {
3244
3352
  wheelbase: r,
3245
3353
  trackWidth: i,
3246
3354
  wheelRadii: [
@@ -3249,36 +3357,36 @@ function Gt(e, t = 0) {
3249
3357
  a,
3250
3358
  a
3251
3359
  ],
3252
- minY: Number(((Y.isEmpty() ? 0 : Y.min.y) + t).toFixed(4)),
3360
+ minY: Number(((Wt.isEmpty() ? 0 : Wt.min.y) + t).toFixed(4)),
3253
3361
  aabbSize: n,
3254
3362
  c12Ticks: o,
3255
3363
  c12Aligned: s,
3256
- detectedAnchors: Ht(e),
3364
+ detectedAnchors: Jt(e),
3257
3365
  isSingleMeshProxy: !1
3258
3366
  };
3259
- return K.getState().setCalibration(c), c;
3367
+ return q.getState().setCalibration(c), c;
3260
3368
  }
3261
- function Kt(e, t = "coupe_86", n = "psx-flat") {
3262
- let r = ve(t, n);
3263
- if (!e) return Wt(r, 1, 0, !0, null), r;
3264
- if (Y.setFromObject(e), Y.isEmpty()) return Wt(r, 1, 0, !0, e), r;
3265
- Y.getSize(X);
3369
+ function Qt(e, t = "coupe_86", n = "psx-flat") {
3370
+ let r = ye(t, n);
3371
+ if (!e) return Xt(r, 1, 0, !0, null), r;
3372
+ if (Wt.setFromObject(e), Wt.isEmpty()) return Xt(r, 1, 0, !0, e), r;
3373
+ Wt.getSize(X);
3266
3374
  let i = r.lattice.rings[r.lattice.rings.length - 1].z - r.lattice.rings[0].z;
3267
- return Wt(r, X.z > .2 ? Math.max(.5, Math.min(2, X.z / i)) : 1, 0, !0, e), r;
3375
+ return Xt(r, X.z > .2 ? Math.max(.5, Math.min(2, X.z / i)) : 1, 0, !0, e), r;
3268
3376
  }
3269
3377
  // src/importer/ImperativeVehicleRig.tsx
3270
- var qt = new p.Vector3(), Jt = new p.Vector3(), Yt = new p.Vector3(), Xt = new p.Quaternion();
3271
- function Zt(e, t) {
3378
+ var $t = new p.Vector3(), en = new p.Vector3(), tn = new p.Vector3(), nn = new p.Quaternion();
3379
+ function rn(e, t) {
3272
3380
  let n = new p.BufferGeometry();
3273
3381
  return n.setAttribute("position", new p.BufferAttribute(e, 3)), n.setAttribute("normal", new p.BufferAttribute(t, 3)), n;
3274
3382
  }
3275
- function Qt({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit: i }) {
3383
+ function an({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit: i }) {
3276
3384
  let a = d(null), o = t.breakaway.hingeAxisLocal ?? [
3277
3385
  1,
3278
3386
  0,
3279
3387
  0
3280
3388
  ], s = t.breakaway.swingMinMaxRad ?? [-1.1, 1.1];
3281
- return M(e, a, [
3389
+ return ne(e, a, [
3282
3390
  t.anchorChassis,
3283
3391
  [
3284
3392
  0,
@@ -3287,18 +3395,18 @@ function Qt({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit:
3287
3395
  ],
3288
3396
  o,
3289
3397
  s
3290
- ]), /* @__PURE__ */ O(j, {
3398
+ ]), /* @__PURE__ */ k(ee, {
3291
3399
  ref: a,
3292
3400
  position: t.anchorChassis,
3293
3401
  mass: n,
3294
3402
  colliders: !1,
3295
3403
  canSleep: !1,
3296
- children: [/* @__PURE__ */ D(k, { args: zt(t.aabbSize) }), /* @__PURE__ */ D("mesh", {
3404
+ children: [/* @__PURE__ */ O(A, { args: Gt(t.aabbSize) }), /* @__PURE__ */ O("mesh", {
3297
3405
  geometry: r,
3298
3406
  onClick: (e) => {
3299
3407
  e.stopPropagation(), i(t);
3300
3408
  },
3301
- children: /* @__PURE__ */ D("meshStandardMaterial", {
3409
+ children: /* @__PURE__ */ O("meshStandardMaterial", {
3302
3410
  color: t.colorHex,
3303
3411
  roughness: .85,
3304
3412
  flatShading: !0
@@ -3306,16 +3414,16 @@ function Qt({ chassisBodyRef: e, panel: t, massKg: n, geometry: r, onWrenchHit:
3306
3414
  })]
3307
3415
  });
3308
3416
  }
3309
- function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3310
- let r = d(null), i = d(null), a = d(K.getState().dropTrigger), o = d({
3417
+ function on({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3418
+ let r = d(null), i = d(null), a = d(q.getState().dropTrigger), o = d({
3311
3419
  w: !1,
3312
3420
  s: !1,
3313
3421
  a: !1,
3314
3422
  d: !1,
3315
3423
  space: !1
3316
- }), s = K((e) => e.attachedMask), c = K((e) => e.unlatchedMask), f = K((e) => e.fuelLiters), p = K((e) => e.freqBucket), m = K((e) => e.dampBucket), g = K((e) => e.detachedDebris), _ = u(() => new F(e), [e]), v = u(() => _.getPanelIntrinsics(), [_]), y = u(() => e.panels.map((e) => Zt(e.localPositions, e.localNormals)), [e]), b = u(() => Zt(e.skateboardPositions, e.skateboardNormals), [e]), x = u(() => Zt(e.wheels[0].positions, e.wheels[0].normals), [e]), S = u(() => t ? t.clone(!0) : null, [t]);
3424
+ }), s = q((e) => e.attachedMask), c = q((e) => e.unlatchedMask), f = q((e) => e.fuelLiters), p = q((e) => e.freqBucket), m = q((e) => e.dampBucket), g = q((e) => e.detachedDebris), _ = u(() => new ve(e), [e]), v = u(() => _.getPanelIntrinsics(), [_]), y = u(() => e.panels.map((e) => rn(e.localPositions, e.localNormals)), [e]), b = u(() => rn(e.skateboardPositions, e.skateboardNormals), [e]), x = u(() => rn(e.wheels[0].positions, e.wheels[0].normals), [e]), S = u(() => t ? t.clone(!0) : null, [t]);
3317
3425
  l(() => {
3318
- G.massDirty = !0;
3426
+ K.massDirty = !0;
3319
3427
  let e = (e) => (t) => {
3320
3428
  (t.code === "KeyW" || t.code === "ArrowUp") && (o.current.w = e), (t.code === "KeyS" || t.code === "ArrowDown") && (o.current.s = e), (t.code === "KeyA" || t.code === "ArrowLeft") && (o.current.a = e), (t.code === "KeyD" || t.code === "ArrowRight") && (o.current.d = e), t.code === "Space" && (o.current.space = e);
3321
3429
  }, t = e(!0), n = e(!1);
@@ -3327,11 +3435,11 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3327
3435
  p,
3328
3436
  m
3329
3437
  ]);
3330
- let C = _.evaluate(s, f), w = 2 * Math.PI * yt[p], T = bt[m], A = C.totalMassKg * .5 * C.frontAxleRatio, M = C.totalMassKg * .5 - A, te = A * w * w, ne = M * w * w, re = 2 * T * Math.sqrt(te * A), ie = 2 * T * Math.sqrt(ne * M);
3331
- ee(() => {
3438
+ let C = _.evaluate(s, f), w = 2 * Math.PI * St[p], T = Ct[m], E = C.totalMassKg * .5 * C.frontAxleRatio, j = C.totalMassKg * .5 - E, ne = E * w * w, re = j * w * w, ie = 2 * T * Math.sqrt(ne * E), ae = 2 * T * Math.sqrt(re * j);
3439
+ te(() => {
3332
3440
  let e = r.current?.body ?? null;
3333
3441
  if (i.current = e, !e) return;
3334
- let t = K.getState().dropTrigger;
3442
+ let t = q.getState().dropTrigger;
3335
3443
  if (t !== a.current && (a.current = t, e.setTranslation({
3336
3444
  x: 0,
3337
3445
  y: 1.2,
@@ -3344,9 +3452,9 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3344
3452
  x: 0,
3345
3453
  y: 0,
3346
3454
  z: 0
3347
- }, !0)), G.massDirty) {
3348
- G.massDirty = !1;
3349
- let t = K.getState(), n = _.evaluate(t.attachedMask, t.fuelLiters);
3455
+ }, !0)), K.massDirty) {
3456
+ K.massDirty = !1;
3457
+ let t = q.getState(), n = _.evaluate(t.attachedMask, t.fuelLiters);
3350
3458
  e.setAdditionalMassProperties(n.totalMassKg, {
3351
3459
  x: n.centerOfMass[0],
3352
3460
  y: n.centerOfMass[1],
@@ -3360,7 +3468,7 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3360
3468
  y: n.inertiaOrientation[1],
3361
3469
  z: n.inertiaOrientation[2],
3362
3470
  w: n.inertiaOrientation[3]
3363
- }, !0), G.massKg = n.totalMassKg, G.com = [...n.centerOfMass], G.frontSplit = n.frontAxleRatio, G.cornerK = [te, ne];
3471
+ }, !0), K.massKg = n.totalMassKg, K.com = [...n.centerOfMass], K.frontSplit = n.frontAxleRatio, K.cornerK = [ne, re];
3364
3472
  }
3365
3473
  }), h(() => {
3366
3474
  let e = r.current;
@@ -3372,13 +3480,13 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3372
3480
  steerLeft: t.a,
3373
3481
  steerRight: t.d,
3374
3482
  brake: t.space
3375
- }), G.speedKmh = e.currLinVel.length() * 3.6, G.rpm = Math.max(850, e.engineRPM);
3483
+ }), K.speedKmh = e.currLinVel.length() * 3.6, K.rpm = Math.max(850, e.engineRPM);
3376
3484
  });
3377
- let ae = (e) => {
3378
- let t = K.getState(), n = 1 << e.bitIndex, i = t.wrenchMode === "UNLATCH_200" ? 200 : 1800, a = r.current?.body, o = v[e.bitIndex];
3485
+ let oe = (e) => {
3486
+ let t = q.getState(), n = 1 << e.bitIndex, i = t.wrenchMode === "UNLATCH_200" ? 200 : 1800, a = r.current?.body, o = v[e.bitIndex];
3379
3487
  if (a) {
3380
3488
  let t = a.translation();
3381
- G.sparkBurst = [
3489
+ K.sparkBurst = [
3382
3490
  t.x + e.anchorChassis[0],
3383
3491
  t.y + e.anchorChassis[1],
3384
3492
  t.z + e.anchorChassis[2]
@@ -3388,18 +3496,18 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3388
3496
  t.setField("unlatchedMask", t.unlatchedMask | n);
3389
3497
  return;
3390
3498
  }
3391
- if (t.setField("attachedMask", t.attachedMask & ~n), t.setField("unlatchedMask", t.unlatchedMask & ~n), G.massDirty = !0, !a) return;
3499
+ if (t.setField("attachedMask", t.attachedMask & ~n), t.setField("unlatchedMask", t.unlatchedMask & ~n), K.massDirty = !0, !a) return;
3392
3500
  let s = a.translation(), c = a.rotation(), l = a.linvel(), u = a.angvel(), d = a.worldCom();
3393
- Xt.set(c.x, c.y, c.z, c.w), qt.set(e.anchorChassis[0], e.anchorChassis[1], e.anchorChassis[2]).applyQuaternion(Xt).add(s), Jt.set(qt.x - d.x, qt.y - d.y, qt.z - d.z), Yt.set(u.x, u.y, u.z).cross(Jt);
3501
+ nn.set(c.x, c.y, c.z, c.w), $t.set(e.anchorChassis[0], e.anchorChassis[1], e.anchorChassis[2]).applyQuaternion(nn).add(s), en.set($t.x - d.x, $t.y - d.y, $t.z - d.z), tn.set(u.x, u.y, u.z).cross(en);
3394
3502
  let f = Math.min(8, i / Math.max(15, o.massKg * 18));
3395
3503
  t.setField("detachedDebris", [...t.detachedDebris, {
3396
3504
  id: `${e.partId}_${Date.now()}`,
3397
3505
  partId: e.partId,
3398
3506
  massKg: o.massKg,
3399
3507
  position: [
3400
- qt.x,
3401
- qt.y,
3402
- qt.z
3508
+ $t.x,
3509
+ $t.y,
3510
+ $t.z
3403
3511
  ],
3404
3512
  quaternion: [
3405
3513
  c.x,
@@ -3408,9 +3516,9 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3408
3516
  c.w
3409
3517
  ],
3410
3518
  linvel: [
3411
- l.x + Yt.x + (e.anchorChassis[0] >= 0 ? 1 : -1) * f,
3412
- l.y + Yt.y + .65 * f,
3413
- l.z + Yt.z + (e.anchorChassis[2] >= 0 ? .5 : -.5) * f
3519
+ l.x + tn.x + (e.anchorChassis[0] >= 0 ? 1 : -1) * f,
3520
+ l.y + tn.y + .65 * f,
3521
+ l.z + tn.z + (e.anchorChassis[2] >= 0 ? .5 : -.5) * f
3414
3522
  ],
3415
3523
  angvel: [
3416
3524
  u.x,
@@ -3420,7 +3528,7 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3420
3528
  aabbSize: e.aabbSize,
3421
3529
  colorHex: e.colorHex
3422
3530
  }]);
3423
- }, oe = u(() => ({
3531
+ }, se = u(() => ({
3424
3532
  engineHorsepower: 190,
3425
3533
  gearRatios: [
3426
3534
  3.5,
@@ -3432,8 +3540,8 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3432
3540
  rollCenterHeight: .24,
3433
3541
  antiRollStiffness: 2400
3434
3542
  }), []);
3435
- return /* @__PURE__ */ O(E, { children: [
3436
- /* @__PURE__ */ O(be, {
3543
+ return /* @__PURE__ */ k(D, { children: [
3544
+ /* @__PURE__ */ k(we, {
3437
3545
  ref: r,
3438
3546
  position: [
3439
3547
  0,
@@ -3441,20 +3549,20 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3441
3549
  0
3442
3550
  ],
3443
3551
  colliders: !1,
3444
- carConfig: oe,
3552
+ carConfig: se,
3445
3553
  canSleep: !1,
3446
3554
  children: [
3447
- /* @__PURE__ */ D(k, {
3448
- args: zt(e.skateboardBoxSize),
3555
+ /* @__PURE__ */ O(A, {
3556
+ args: Gt(e.skateboardBoxSize),
3449
3557
  position: e.skateboardBoxCenter
3450
3558
  }),
3451
- /* @__PURE__ */ O("group", {
3559
+ /* @__PURE__ */ k("group", {
3452
3560
  ref: n,
3453
3561
  children: [
3454
- S && /* @__PURE__ */ D("primitive", { object: S }),
3455
- /* @__PURE__ */ D("mesh", {
3562
+ S && /* @__PURE__ */ O("primitive", { object: S }),
3563
+ /* @__PURE__ */ O("mesh", {
3456
3564
  geometry: b,
3457
- children: /* @__PURE__ */ D("meshStandardMaterial", {
3565
+ children: /* @__PURE__ */ O("meshStandardMaterial", {
3458
3566
  color: 2304045,
3459
3567
  roughness: .9,
3460
3568
  flatShading: !0
@@ -3462,13 +3570,13 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3462
3570
  }),
3463
3571
  e.panels.map((t, n) => {
3464
3572
  let r = 1 << t.bitIndex;
3465
- return (s & r) === 0 || (c & r) !== 0 ? null : /* @__PURE__ */ D("mesh", {
3573
+ return (s & r) === 0 || (c & r) !== 0 ? null : /* @__PURE__ */ O("mesh", {
3466
3574
  position: t.anchorChassis,
3467
3575
  geometry: y[n],
3468
3576
  onClick: (e) => {
3469
- e.stopPropagation(), ae(t);
3577
+ e.stopPropagation(), oe(t);
3470
3578
  },
3471
- children: /* @__PURE__ */ D("meshStandardMaterial", {
3579
+ children: /* @__PURE__ */ O("meshStandardMaterial", {
3472
3580
  color: t.colorHex,
3473
3581
  roughness: t.isGlass ? .15 : .88,
3474
3582
  transparent: t.isGlass || !!S,
@@ -3482,7 +3590,7 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3482
3590
  }),
3483
3591
  e.wheels.map((e) => {
3484
3592
  let t = e.slotId.includes("_f"), n = e.omi.suspensionTravel ?? .2;
3485
- return /* @__PURE__ */ D(xe, {
3593
+ return /* @__PURE__ */ O(Te, {
3486
3594
  name: e.slotId,
3487
3595
  position: [
3488
3596
  e.position[0],
@@ -3493,15 +3601,15 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3493
3601
  rayShapeH: e.omi.width * .5,
3494
3602
  rayLength: n,
3495
3603
  wheelModelRadius: e.omi.radius,
3496
- springK: t ? te : ne,
3497
- dampingC: t ? re : ie,
3604
+ springK: t ? ne : re,
3605
+ dampingC: t ? ie : ae,
3498
3606
  steerWheel: e.omi.steering,
3499
3607
  driveWheel: e.omi.propulsion,
3500
3608
  brakeWheel: !0,
3501
3609
  maxBrakeTorque: 1600,
3502
- children: /* @__PURE__ */ D("mesh", {
3610
+ children: /* @__PURE__ */ O("mesh", {
3503
3611
  geometry: x,
3504
- children: /* @__PURE__ */ D("meshStandardMaterial", {
3612
+ children: /* @__PURE__ */ O("meshStandardMaterial", {
3505
3613
  color: 1843753,
3506
3614
  roughness: .9,
3507
3615
  flatShading: !0
@@ -3513,21 +3621,21 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3513
3621
  }),
3514
3622
  e.panels.map((e, t) => {
3515
3623
  let n = 1 << e.bitIndex;
3516
- return (s & n) === 0 || (c & n) === 0 ? null : /* @__PURE__ */ D(Qt, {
3624
+ return (s & n) === 0 || (c & n) === 0 ? null : /* @__PURE__ */ O(an, {
3517
3625
  chassisBodyRef: i,
3518
3626
  panel: e,
3519
3627
  massKg: v[t].massKg,
3520
3628
  geometry: y[t],
3521
- onWrenchHit: ae
3629
+ onWrenchHit: oe
3522
3630
  }, `unlatched_${e.partId}`);
3523
3631
  }),
3524
- g.map((e) => /* @__PURE__ */ O(j, {
3632
+ g.map((e) => /* @__PURE__ */ k(ee, {
3525
3633
  position: e.position,
3526
3634
  mass: e.massKg,
3527
3635
  linearVelocity: e.linvel,
3528
3636
  angularVelocity: e.angvel,
3529
3637
  colliders: !1,
3530
- children: [/* @__PURE__ */ D(k, { args: zt(e.aabbSize) }), /* @__PURE__ */ O("mesh", { children: [/* @__PURE__ */ D("boxGeometry", { args: e.aabbSize }), /* @__PURE__ */ D("meshStandardMaterial", {
3638
+ children: [/* @__PURE__ */ O(A, { args: Gt(e.aabbSize) }), /* @__PURE__ */ k("mesh", { children: [/* @__PURE__ */ O("boxGeometry", { args: e.aabbSize }), /* @__PURE__ */ O("meshStandardMaterial", {
3531
3639
  color: e.colorHex,
3532
3640
  roughness: .88,
3533
3641
  flatShading: !0
@@ -3536,9 +3644,9 @@ function $t({ assembly: e, importedRoot: t, chassisGroupRef: n }) {
3536
3644
  ] });
3537
3645
  }
3538
3646
  // src/importer/Step2UniversalPad.tsx
3539
- var en = new p.Vector3(), tn = new p.Vector3(0, 1, 0), nn = new p.Vector3(), rn = new p.Vector3(), an = new p.Vector3();
3540
- function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimRef: c, onStampSurface: f }) {
3541
- let m = d(null), g = K((e) => e.chaseCam), _ = d(K.getState().dropTrigger), v = d({
3647
+ var sn = new p.Vector3(), cn = new p.Vector3(0, 1, 0), ln = new p.Vector3(), un = new p.Vector3(), dn = new p.Vector3();
3648
+ function fn({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimRef: c, onStampSurface: f }) {
3649
+ let m = d(null), g = q((e) => e.chaseCam), _ = d(q.getState().dropTrigger), v = d({
3542
3650
  w: !1,
3543
3651
  s: !1,
3544
3652
  a: !1,
@@ -3552,11 +3660,11 @@ function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimR
3552
3660
  brake: 0,
3553
3661
  headlight: 1,
3554
3662
  always: 1
3555
- }), x = u(() => S(e), [e]), C = u(() => n(a), [a]), w = u(() => i(x), [x]);
3663
+ }), x = u(() => C(e), [e]), S = u(() => n(a), [a]), w = u(() => i(x), [x]);
3556
3664
  return l(() => (c.current = w, () => {
3557
3665
  c.current === w && (c.current = null);
3558
3666
  }), [w, c]), l(() => {
3559
- G.massKg = x.totalDynamicMass, G.com = [...x.centerOfMass];
3667
+ K.massKg = x.totalDynamicMass, K.com = [...x.centerOfMass];
3560
3668
  let e = (e) => (t) => {
3561
3669
  (t.code === "KeyW" || t.code === "ArrowUp") && (v.current.w = e), (t.code === "KeyS" || t.code === "ArrowDown") && (v.current.s = e), (t.code === "KeyA" || t.code === "ArrowLeft") && (v.current.a = e), (t.code === "KeyD" || t.code === "ArrowRight") && (v.current.d = e), t.code === "Space" && (v.current.space = e), (t.code === "ShiftLeft" || t.code === "ShiftRight") && (v.current.shift = e);
3562
3670
  }, t = e(!0), n = e(!1);
@@ -3568,7 +3676,7 @@ function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimR
3568
3676
  w.step(r);
3569
3677
  let i = m.current;
3570
3678
  if (!i?.body) return;
3571
- let a = K.getState().dropTrigger;
3679
+ let a = q.getState().dropTrigger;
3572
3680
  a !== _.current && (_.current = a, i.body.setTranslation({
3573
3681
  x: 0,
3574
3682
  y: 1.35,
@@ -3600,14 +3708,14 @@ function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimR
3600
3708
  steerLeft: s.a,
3601
3709
  steerRight: s.d,
3602
3710
  brake: s.space
3603
- }), s.shift && s.w && i.body.applyImpulse(an.copy(i.bodyZAxis).multiplyScalar(i.body.mass() * 6.2 * r), !0));
3711
+ }), s.shift && s.w && i.body.applyImpulse(dn.copy(i.bodyZAxis).multiplyScalar(i.body.mass() * 6.2 * r), !0));
3604
3712
  let c = b.current;
3605
- c.throttle = +!!s.w, c.boost = s.w && s.shift ? 1 : 0, c.brake = s.space || s.s ? 1 : 0, G.speedKmh = i.currLinVel.length() * 3.6, G.rpm = Math.max(850, i.engineRPM), g && !o && (en.copy(i.bodyZAxis).projectOnPlane(tn), en.lengthSq() < 1e-6 ? en.set(0, 0, 1) : en.normalize(), nn.copy(i.currPos).addScaledVector(en, -6.8).addScaledVector(tn, 2.25), rn.copy(i.currPos).addScaledVector(en, 3.5).addScaledVector(tn, .65), te.damp3(e.camera.position, nn, .14, r), te.damp3(y.current, rn, .08, r), e.camera.lookAt(y.current));
3606
- }), /* @__PURE__ */ D("group", {
3713
+ c.throttle = +!!s.w, c.boost = s.w && s.shift ? 1 : 0, c.brake = s.space || s.s ? 1 : 0, K.speedKmh = i.currLinVel.length() * 3.6, K.rpm = Math.max(850, i.engineRPM), g && !o && (sn.copy(i.bodyZAxis).projectOnPlane(cn), sn.lengthSq() < 1e-6 ? sn.set(0, 0, 1) : sn.normalize(), ln.copy(i.currPos).addScaledVector(sn, -6.8).addScaledVector(cn, 2.25), un.copy(i.currPos).addScaledVector(sn, 3.5).addScaledVector(cn, .65), re.damp3(e.camera.position, ln, .14, r), re.damp3(y.current, un, .08, r), e.camera.lookAt(y.current));
3714
+ }), /* @__PURE__ */ O("group", {
3607
3715
  onClick: (e) => {
3608
3716
  o ? f(e) : e.delta <= 5 && w.toggleHitObject(e.object) && e.stopPropagation();
3609
3717
  },
3610
- children: /* @__PURE__ */ D(ne, {
3718
+ children: /* @__PURE__ */ O(ie, {
3611
3719
  ref: m,
3612
3720
  bundle: x,
3613
3721
  position: [
@@ -3619,15 +3727,15 @@ function on({ bundle: e, subArchetype: t, patches: a, stampActive: o, panelAnimR
3619
3727
  twoWheelBalance: !0,
3620
3728
  maxLeanAngle: .78
3621
3729
  } : void 0,
3622
- children: /* @__PURE__ */ D(s, {
3623
- emitters: C,
3730
+ children: /* @__PURE__ */ O(s, {
3731
+ emitters: S,
3624
3732
  signalsRef: b
3625
3733
  })
3626
3734
  })
3627
3735
  });
3628
3736
  }
3629
- function sn({ bundle: e, domain: t, staticProp: i, patches: o, onStampSurface: c }) {
3630
- let f = d(null), p = d(!1), m = K((e) => e.dropTrigger), h = d({
3737
+ function pn({ bundle: e, domain: t, staticProp: i, patches: o, onStampSurface: c }) {
3738
+ let f = d(null), p = d(!1), m = q((e) => e.dropTrigger), h = d({
3631
3739
  ...r(),
3632
3740
  throttle: .9,
3633
3741
  boost: 1,
@@ -3635,14 +3743,14 @@ function sn({ bundle: e, domain: t, staticProp: i, patches: o, onStampSurface: c
3635
3743
  headlight: 1,
3636
3744
  fire: 1,
3637
3745
  always: 1
3638
- }), g = u(() => S(e), [e, m]), _ = u(() => n(o), [o]), v = t === "c12" || t === "prop" && i;
3746
+ }), g = u(() => C(e), [e, m]), _ = u(() => n(o), [o]), v = t === "c12" || t === "prop" && i;
3639
3747
  return l(() => {
3640
- G.massKg = g.totalDynamicMass, G.com = [...g.centerOfMass], G.speedKmh = 0;
3641
- }, [g]), /* @__PURE__ */ O("group", {
3748
+ K.massKg = g.totalDynamicMass, K.com = [...g.centerOfMass], K.speedKmh = 0;
3749
+ }, [g]), /* @__PURE__ */ k("group", {
3642
3750
  onClick: (e) => {
3643
3751
  c(e), p.current = a(f.current, g, p.current);
3644
3752
  },
3645
- children: [/* @__PURE__ */ D(x, {
3753
+ children: [/* @__PURE__ */ O(S, {
3646
3754
  ref: f,
3647
3755
  bundle: g,
3648
3756
  position: [
@@ -3651,19 +3759,19 @@ function sn({ bundle: e, domain: t, staticProp: i, patches: o, onStampSurface: c
3651
3759
  0
3652
3760
  ],
3653
3761
  fixedRoot: v
3654
- }, `asm_${m}`), /* @__PURE__ */ D(s, {
3762
+ }, `asm_${m}`), /* @__PURE__ */ O(s, {
3655
3763
  emitters: _,
3656
3764
  signalsRef: h
3657
3765
  })]
3658
3766
  });
3659
3767
  }
3660
- function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches: i, stampActive: a, panelAnimRef: o, onStampSurface: s }) {
3661
- let c = K((e) => e.domain), l = K((e) => e.vehicleArchetype), u = K((e) => e.usePaperShellProxy), d = K((e) => e.staticProp);
3662
- return /* @__PURE__ */ O(A, {
3768
+ function mn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patches: i, stampActive: a, panelAnimRef: o, onStampSurface: s }) {
3769
+ let c = q((e) => e.domain), l = q((e) => e.vehicleArchetype), u = q((e) => e.usePaperShellProxy), d = q((e) => e.staticProp);
3770
+ return /* @__PURE__ */ k(j, {
3663
3771
  interpolate: !0,
3664
3772
  timeStep: 1 / 60,
3665
3773
  children: [
3666
- /* @__PURE__ */ D(j, {
3774
+ /* @__PURE__ */ O(ee, {
3667
3775
  type: "fixed",
3668
3776
  position: [
3669
3777
  0,
@@ -3671,7 +3779,7 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
3671
3779
  0
3672
3780
  ],
3673
3781
  colliders: !1,
3674
- children: /* @__PURE__ */ D(k, {
3782
+ children: /* @__PURE__ */ O(A, {
3675
3783
  args: [
3676
3784
  180,
3677
3785
  .25,
@@ -3680,7 +3788,7 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
3680
3788
  friction: .92
3681
3789
  })
3682
3790
  }),
3683
- /* @__PURE__ */ O("mesh", {
3791
+ /* @__PURE__ */ k("mesh", {
3684
3792
  rotation: [
3685
3793
  -Math.PI * .5,
3686
3794
  0,
@@ -3692,12 +3800,12 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
3692
3800
  0
3693
3801
  ],
3694
3802
  receiveShadow: !0,
3695
- children: [/* @__PURE__ */ D("planeGeometry", { args: [360, 360] }), /* @__PURE__ */ D("meshStandardMaterial", {
3803
+ children: [/* @__PURE__ */ O("planeGeometry", { args: [360, 360] }), /* @__PURE__ */ O("meshStandardMaterial", {
3696
3804
  color: "#11161d",
3697
3805
  roughness: .95
3698
3806
  })]
3699
3807
  }),
3700
- /* @__PURE__ */ D(j, {
3808
+ /* @__PURE__ */ O(ee, {
3701
3809
  type: "fixed",
3702
3810
  position: [
3703
3811
  0,
@@ -3710,11 +3818,11 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
3710
3818
  0
3711
3819
  ],
3712
3820
  colliders: "cuboid",
3713
- children: /* @__PURE__ */ O("mesh", { children: [/* @__PURE__ */ D("boxGeometry", { args: [
3821
+ children: /* @__PURE__ */ k("mesh", { children: [/* @__PURE__ */ O("boxGeometry", { args: [
3714
3822
  4.4,
3715
3823
  .22,
3716
3824
  6.2
3717
- ] }), /* @__PURE__ */ D("meshStandardMaterial", {
3825
+ ] }), /* @__PURE__ */ O("meshStandardMaterial", {
3718
3826
  color: "#f59e0b",
3719
3827
  roughness: .75,
3720
3828
  flatShading: !0
@@ -3728,34 +3836,34 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
3728
3836
  24,
3729
3837
  36,
3730
3838
  48
3731
- ].map((t) => /* @__PURE__ */ O("mesh", {
3839
+ ].map((t) => /* @__PURE__ */ k("mesh", {
3732
3840
  position: [
3733
3841
  e,
3734
3842
  .35,
3735
3843
  t
3736
3844
  ],
3737
- children: [/* @__PURE__ */ D("coneGeometry", { args: [
3845
+ children: [/* @__PURE__ */ O("coneGeometry", { args: [
3738
3846
  .28,
3739
3847
  .7,
3740
3848
  8
3741
- ] }), /* @__PURE__ */ D("meshStandardMaterial", {
3849
+ ] }), /* @__PURE__ */ O("meshStandardMaterial", {
3742
3850
  color: "#ff5a1f",
3743
3851
  roughness: .6,
3744
3852
  flatShading: !0
3745
3853
  })]
3746
3854
  }, `cone_${e}_${t}`))),
3747
- c === "vehicle" && u ? /* @__PURE__ */ D($t, {
3855
+ c === "vehicle" && u ? /* @__PURE__ */ O(on, {
3748
3856
  assembly: e,
3749
3857
  importedRoot: t,
3750
3858
  chassisGroupRef: n
3751
- }) : r ? c === "vehicle" ? /* @__PURE__ */ D(on, {
3859
+ }) : r ? c === "vehicle" ? /* @__PURE__ */ O(fn, {
3752
3860
  bundle: r,
3753
3861
  subArchetype: l,
3754
3862
  patches: i,
3755
3863
  stampActive: a,
3756
3864
  panelAnimRef: o,
3757
3865
  onStampSurface: s
3758
- }) : /* @__PURE__ */ D(sn, {
3866
+ }) : /* @__PURE__ */ O(pn, {
3759
3867
  bundle: r,
3760
3868
  domain: c,
3761
3869
  staticProp: d,
@@ -3766,8 +3874,8 @@ function cn({ assembly: e, importedRoot: t, rootObjRef: n, liveBundle: r, patche
3766
3874
  });
3767
3875
  }
3768
3876
  // src/importer/VfxEmitterPool.tsx
3769
- var Z = 256, ln = new p.Vector3(), un = new p.Vector3(), Q = new p.Vector3(), dn = new p.Quaternion(), fn = new p.Matrix4(), pn = new p.Color();
3770
- function mn({ chassisObjRef: e, emitters: t }) {
3877
+ var Z = 256, hn = new p.Vector3(), gn = new p.Vector3(), Q = new p.Vector3(), _n = new p.Quaternion(), vn = new p.Matrix4(), yn = new p.Color();
3878
+ function bn({ chassisObjRef: e, emitters: t }) {
3771
3879
  let n = d(null), r = d(0), i = d(0), a = u(() => {
3772
3880
  let e = new Float32Array(Z * 3), t = new Float32Array(Z * 3), n = new Float32Array(Z), r = new Float32Array(Z), i = new Float32Array(Z * 2), a = new Float32Array(Z * 3), o = new Float32Array(Z * 3);
3773
3881
  return n.fill(999), r.fill(1), {
@@ -3789,8 +3897,8 @@ function mn({ chassisObjRef: e, emitters: t }) {
3789
3897
  l(() => {
3790
3898
  let e = n.current;
3791
3899
  if (e) {
3792
- fn.makeScale(0, 0, 0), pn.setRGB(1, 1, 1);
3793
- for (let t = 0; t < Z; t++) e.setMatrixAt(t, fn), e.setColorAt(t, pn);
3900
+ vn.makeScale(0, 0, 0), yn.setRGB(1, 1, 1);
3901
+ for (let t = 0; t < Z; t++) e.setMatrixAt(t, vn), e.setColorAt(t, yn);
3794
3902
  e.instanceMatrix.needsUpdate = !0, e.instanceColor && (e.instanceColor.needsUpdate = !0);
3795
3903
  }
3796
3904
  }, []);
@@ -3806,28 +3914,28 @@ function mn({ chassisObjRef: e, emitters: t }) {
3806
3914
  let s = n.current;
3807
3915
  if (!s) return;
3808
3916
  let l = Math.min(.05, o), u = e.current;
3809
- u ? (u.getWorldPosition(ln), u.getWorldQuaternion(dn)) : (ln.set(0, 0, 0), dn.identity());
3917
+ u ? (u.getWorldPosition(hn), u.getWorldQuaternion(_n)) : (hn.set(0, 0, 0), _n.identity());
3810
3918
  let d = t[0];
3811
3919
  if (d) {
3812
- let e = Math.max(.15, Math.min(1, G.rpm / 6500));
3920
+ let e = Math.max(.15, Math.min(1, K.rpm / 6500));
3813
3921
  for (i.current += d.desc.rateHz * e * l; i.current >= 1;) {
3814
- --i.current, un.set(d.position[0], d.position[1], d.position[2]).applyQuaternion(dn).add(ln), Q.set(0, 0, -1).applyQuaternion(dn);
3922
+ --i.current, gn.set(d.position[0], d.position[1], d.position[2]).applyQuaternion(_n).add(hn), Q.set(0, 0, -1).applyQuaternion(_n);
3815
3923
  let e = d.desc;
3816
- c(un.x, un.y, un.z, Q.x, Q.y, Q.z, e.speedMinMax[0], e.speedMinMax[1], e.coneOuterAngle, e.sizeStartEnd[0], e.sizeStartEnd[1], e.lifetimeSec, e.colorStart, e.colorEnd);
3924
+ c(gn.x, gn.y, gn.z, Q.x, Q.y, Q.z, e.speedMinMax[0], e.speedMinMax[1], e.coneOuterAngle, e.sizeStartEnd[0], e.sizeStartEnd[1], e.lifetimeSec, e.colorStart, e.colorEnd);
3817
3925
  }
3818
3926
  }
3819
- let f = G.sparkBurst;
3927
+ let f = K.sparkBurst;
3820
3928
  if (f && t[1]) {
3821
- G.sparkBurst = null;
3929
+ K.sparkBurst = null;
3822
3930
  let e = t[1].desc;
3823
- Q.set(0, 0, -1).applyQuaternion(dn);
3931
+ Q.set(0, 0, -1).applyQuaternion(_n);
3824
3932
  for (let t = 0; t < 18; t++) c(f[0], f[1], f[2], Q.x, Q.y + .4, Q.z, e.speedMinMax[0], e.speedMinMax[1], e.coneOuterAngle, e.sizeStartEnd[0], e.sizeStartEnd[1], e.lifetimeSec, e.colorStart, e.colorEnd);
3825
3933
  }
3826
3934
  let p = r.camera.quaternion;
3827
3935
  for (let e = 0; e < Z; e++) {
3828
3936
  let t = a.age[e], n = a.life[e];
3829
3937
  if (t >= n) {
3830
- fn.makeScale(0, 0, 0), s.setMatrixAt(e, fn);
3938
+ vn.makeScale(0, 0, 0), s.setMatrixAt(e, vn);
3831
3939
  continue;
3832
3940
  }
3833
3941
  let r = t + l;
@@ -3835,10 +3943,10 @@ function mn({ chassisObjRef: e, emitters: t }) {
3835
3943
  let i = Math.min(1, r / n), o = e * 3, c = e * 2;
3836
3944
  a.pos[o] += a.vel[o] * l, a.pos[o + 1] += a.vel[o + 1] * l, a.pos[o + 2] += a.vel[o + 2] * l;
3837
3945
  let u = a.sizeStartEnd[c] + (a.sizeStartEnd[c + 1] - a.sizeStartEnd[c]) * i;
3838
- un.set(a.pos[o], a.pos[o + 1], a.pos[o + 2]), Q.set(u, u, u), fn.compose(un, p, Q), s.setMatrixAt(e, fn), pn.setRGB(a.colorStart[o] + (a.colorEnd[o] - a.colorStart[o]) * i, a.colorStart[o + 1] + (a.colorEnd[o + 1] - a.colorStart[o + 1]) * i, a.colorStart[o + 2] + (a.colorEnd[o + 2] - a.colorStart[o + 2]) * i), s.setColorAt(e, pn);
3946
+ gn.set(a.pos[o], a.pos[o + 1], a.pos[o + 2]), Q.set(u, u, u), vn.compose(gn, p, Q), s.setMatrixAt(e, vn), yn.setRGB(a.colorStart[o] + (a.colorEnd[o] - a.colorStart[o]) * i, a.colorStart[o + 1] + (a.colorEnd[o + 1] - a.colorStart[o + 1]) * i, a.colorStart[o + 2] + (a.colorEnd[o + 2] - a.colorStart[o + 2]) * i), s.setColorAt(e, yn);
3839
3947
  }
3840
3948
  s.instanceMatrix.needsUpdate = !0, s.instanceColor && (s.instanceColor.needsUpdate = !0);
3841
- }), /* @__PURE__ */ D("instancedMesh", {
3949
+ }), /* @__PURE__ */ O("instancedMesh", {
3842
3950
  ref: n,
3843
3951
  args: [
3844
3952
  o,
@@ -3849,7 +3957,7 @@ function mn({ chassisObjRef: e, emitters: t }) {
3849
3957
  });
3850
3958
  }
3851
3959
  // src/importer/usdToGlb.ts
3852
- var hn = [
3960
+ var xn = [
3853
3961
  80,
3854
3962
  88,
3855
3963
  82,
@@ -3858,15 +3966,15 @@ var hn = [
3858
3966
  83,
3859
3967
  68,
3860
3968
  67
3861
- ], gn = [
3969
+ ], Sn = [
3862
3970
  "map",
3863
3971
  "normalMap",
3864
3972
  "roughnessMap",
3865
3973
  "metalnessMap",
3866
3974
  "aoMap",
3867
3975
  "emissiveMap"
3868
- ], _n = (e) => e.byteLength >= 8 && hn.every((t, n) => e[n] === t), vn = (e) => /\.(usd|usda|usdc|usdz)$/i.test(e.trim());
3869
- function yn(e) {
3976
+ ], Cn = (e) => e.byteLength >= 8 && xn.every((t, n) => e[n] === t), wn = (e) => /\.(usd|usda|usdc|usdz)$/i.test(e.trim());
3977
+ function Tn(e) {
3870
3978
  let t = /* @__PURE__ */ new Map(), n = (e, r, i, a) => {
3871
3979
  let o = r * e.scale.x, s = i * e.scale.y, c = a * e.scale.z;
3872
3980
  if (e.name && t.set(e.name, [
@@ -3891,12 +3999,12 @@ function yn(e) {
3891
3999
  };
3892
4000
  return n(e, 1, 1, 1), e.updateMatrixWorld(!0), t;
3893
4001
  }
3894
- function bn(e) {
4002
+ function En(e) {
3895
4003
  if (typeof e == "string") return [e];
3896
4004
  let t = e instanceof Uint8Array ? e : new Uint8Array(e), n = new TextDecoder();
3897
- return _n(t) ? [] : t.byteLength >= 2 && t[0] === 80 && t[1] === 75 ? Object.entries(Se(t)).filter(([e, t]) => /\.(usd|usda)$/i.test(e) && !_n(t)).map(([, e]) => n.decode(e)) : [n.decode(t)];
4005
+ return Cn(t) ? [] : t.byteLength >= 2 && t[0] === 80 && t[1] === 75 ? Object.entries(I(t)).filter(([e, t]) => /\.(usd|usda)$/i.test(e) && !Cn(t)).map(([, e]) => n.decode(e)) : [n.decode(t)];
3898
4006
  }
3899
- function xn(e, t) {
4007
+ function Dn(e, t) {
3900
4008
  for (let n of e.split(/\r?\n/)) {
3901
4009
  let e = n.indexOf("=");
3902
4010
  if (e >= 0) {
@@ -3905,13 +4013,13 @@ function xn(e, t) {
3905
4013
  }
3906
4014
  }
3907
4015
  }
3908
- function Sn(e) {
4016
+ function On(e) {
3909
4017
  let t = e.replace(/#[^\n]*/g, ""), n = [], r = [], i = /\b(?:def|over|class)\s+(?:([A-Za-z0-9_]+)\s+)?"([^"]+)"\s*(?:\(([\s\S]*?)\))?\s*\{/g, a = 0;
3910
4018
  for (; a < t.length;) {
3911
4019
  let e = t.indexOf("{", a), o = t.indexOf("}", a);
3912
4020
  if (o !== -1 && (e === -1 || o < e)) {
3913
4021
  let e = r.pop();
3914
- e && xn(t.slice(a, o), e.attrs), a = o + 1;
4022
+ e && Dn(t.slice(a, o), e.attrs), a = o + 1;
3915
4023
  continue;
3916
4024
  }
3917
4025
  if (e === -1) break;
@@ -3920,7 +4028,7 @@ function Sn(e) {
3920
4028
  let c = i.exec(s);
3921
4029
  if (c) {
3922
4030
  let e = r[r.length - 1];
3923
- e && xn(s.slice(0, c.index), e.attrs);
4031
+ e && Dn(s.slice(0, c.index), e.attrs);
3924
4032
  let t = [...r].reverse().find((e) => e !== null)?.path ?? "", i = (c[3] ?? "").match(/apiSchemas\s*=\s*\[([^\]]*)\]/), a = i ? Array.from(i[1].matchAll(/"([^"]+)"/g), (e) => e[1]) : [], o = {
3925
4033
  path: `${t}/${c[2]}`,
3926
4034
  name: c[2],
@@ -3934,18 +4042,18 @@ function Sn(e) {
3934
4042
  }
3935
4043
  return n;
3936
4044
  }
3937
- var Cn = (e) => e === void 0 ? void 0 : /^(true|1)$/i.test(e.trim()) ? !0 : !/^(false|0)$/i.test(e.trim()) && void 0, $ = (e) => {
4045
+ var kn = (e) => e === void 0 ? void 0 : /^(true|1)$/i.test(e.trim()) ? !0 : !/^(false|0)$/i.test(e.trim()) && void 0, $ = (e) => {
3938
4046
  let t = e === void 0 ? NaN : Number(e.replace(/[()"]/g, "").trim());
3939
4047
  return Number.isFinite(t) ? t : void 0;
3940
- }, wn = (e) => {
4048
+ }, An = (e) => {
3941
4049
  let t = e?.match(/\(\s*([^\s,)]+)\s*,\s*([^\s,)]+)\s*,\s*([^\s,)]+)\s*\)/), n = t ? [
3942
4050
  Number(t[1]),
3943
4051
  Number(t[2]),
3944
4052
  Number(t[3])
3945
4053
  ] : null;
3946
4054
  return n?.every(Number.isFinite) ? n : void 0;
3947
- }, Tn = (e) => e?.match(/<([^>]+)>/)?.[1]?.split("/").filter(Boolean).pop();
3948
- function En(e, t) {
4055
+ }, jn = (e) => e?.match(/<([^>]+)>/)?.[1]?.split("/").filter(Boolean).pop();
4056
+ function Mn(e, t) {
3949
4057
  if (e.typeName === "Cube") {
3950
4058
  let n = Math.max(.001, $(e.attrs.size) ?? 2);
3951
4059
  return {
@@ -3972,7 +4080,7 @@ function En(e, t) {
3972
4080
  }
3973
4081
  return null;
3974
4082
  }
3975
- function Dn(e, t, n, r) {
4083
+ function Nn(e, t, n, r) {
3976
4084
  let i = /* @__PURE__ */ new Set();
3977
4085
  for (let t of Object.keys(e)) {
3978
4086
  let e = t.match(/^drive:([^:]+):physics:/);
@@ -3993,8 +4101,8 @@ function Dn(e, t, n, r) {
3993
4101
  };
3994
4102
  });
3995
4103
  }
3996
- function On(e, t, n) {
3997
- let r = e.flatMap(Sn);
4104
+ function Pn(e, t, n) {
4105
+ let r = e.flatMap(On);
3998
4106
  if (r.length === 0) return [];
3999
4107
  let i = /* @__PURE__ */ new Map();
4000
4108
  t.traverse((e) => {
@@ -4015,9 +4123,9 @@ function On(e, t, n) {
4015
4123
  for (let e of r) {
4016
4124
  let t = i.get(e.name);
4017
4125
  if (!t) continue;
4018
- let r = (e.apiSchemas.includes("PhysicsRigidBodyAPI") || Cn(e.attrs["physics:rigidBodyEnabled"]) === !0) && Cn(e.attrs["physics:rigidBodyEnabled"]) !== !1, o = (e.apiSchemas.includes("PhysicsCollisionAPI") || e.apiSchemas.includes("PhysicsMeshCollisionAPI") || Cn(e.attrs["physics:collisionEnabled"]) === !0) && Cn(e.attrs["physics:collisionEnabled"]) !== !1;
4126
+ let r = (e.apiSchemas.includes("PhysicsRigidBodyAPI") || kn(e.attrs["physics:rigidBodyEnabled"]) === !0) && kn(e.attrs["physics:rigidBodyEnabled"]) !== !1, o = (e.apiSchemas.includes("PhysicsCollisionAPI") || e.apiSchemas.includes("PhysicsMeshCollisionAPI") || kn(e.attrs["physics:collisionEnabled"]) === !0) && kn(e.attrs["physics:collisionEnabled"]) !== !1;
4019
4127
  if (r) {
4020
- let n = Cn(e.attrs["physics:kinematicEnabled"]) === !0, r = $(e.attrs["physics:mass"]), i = n ? r !== void 0 && r >= 0 ? r : void 0 : r !== void 0 && r > 0 ? r : 1, a = wn(e.attrs["physics:centerOfMass"]), o = wn(e.attrs["physics:diagonalInertia"]);
4128
+ let n = kn(e.attrs["physics:kinematicEnabled"]) === !0, r = $(e.attrs["physics:mass"]), i = n ? r !== void 0 && r >= 0 ? r : void 0 : r !== void 0 && r > 0 ? r : 1, a = An(e.attrs["physics:centerOfMass"]), o = An(e.attrs["physics:diagonalInertia"]);
4021
4129
  s(t.name).motion = {
4022
4130
  isKinematic: n,
4023
4131
  ...i === void 0 ? {} : { mass: i },
@@ -4026,7 +4134,7 @@ function On(e, t, n) {
4026
4134
  };
4027
4135
  }
4028
4136
  if (o) {
4029
- let r = e.attrs["material:binding:physics"]?.match(/<([^>]+)>/)?.[1], i = (r ? a.get(r) : void 0) ?? a.get(e.path) ?? {}, o = En(e, n?.get(t.name) ?? [
4137
+ let r = e.attrs["material:binding:physics"]?.match(/<([^>]+)>/)?.[1], i = (r ? a.get(r) : void 0) ?? a.get(e.path) ?? {}, o = Mn(e, n?.get(t.name) ?? [
4030
4138
  1,
4031
4139
  1,
4032
4140
  1
@@ -4052,9 +4160,9 @@ function On(e, t, n) {
4052
4160
  }
4053
4161
  }
4054
4162
  for (let e of r) {
4055
- let n = e.typeName === "PhysicsRevoluteJoint" ? "revolute" : e.typeName === "PhysicsPrismaticJoint" ? "prismatic" : e.typeName === "PhysicsFixedJoint" ? "fixed" : null, r = n ? Tn(e.attrs["physics:body1"]) : void 0, a = r ? i.get(r) : void 0;
4163
+ let n = e.typeName === "PhysicsRevoluteJoint" ? "revolute" : e.typeName === "PhysicsPrismaticJoint" ? "prismatic" : e.typeName === "PhysicsFixedJoint" ? "fixed" : null, r = n ? jn(e.attrs["physics:body1"]) : void 0, a = r ? i.get(r) : void 0;
4056
4164
  if (!n || !a) continue;
4057
- let o = Tn(e.attrs["physics:body0"]);
4165
+ let o = jn(e.attrs["physics:body0"]);
4058
4166
  if (!o || !i.has(o)) {
4059
4167
  if (o = `${e.name}_WorldAnchor`, !i.has(o)) {
4060
4168
  let n = new p.Object3D();
@@ -4081,19 +4189,19 @@ function On(e, t, n) {
4081
4189
  1,
4082
4190
  0,
4083
4191
  0
4084
- ], d = n === "revolute" ? Math.PI / 180 : 1, f = $(e.attrs["physics:lowerLimit"]), m = $(e.attrs["physics:upperLimit"]), h = n === "fixed" ? [] : Dn(e.attrs, n, u, d);
4192
+ ], d = n === "revolute" ? Math.PI / 180 : 1, f = $(e.attrs["physics:lowerLimit"]), m = $(e.attrs["physics:upperLimit"]), h = n === "fixed" ? [] : Nn(e.attrs, n, u, d);
4085
4193
  c.joint = {
4086
4194
  connectedNodeName: o,
4087
4195
  kind: n,
4088
4196
  ...n === "fixed" ? {} : { axis: u },
4089
4197
  ...f !== void 0 && m !== void 0 && f <= m ? { limits: [f * d, m * d] } : {},
4090
- enableCollision: Cn(e.attrs["physics:collisionEnabled"]) === !0,
4198
+ enableCollision: kn(e.attrs["physics:collisionEnabled"]) === !0,
4091
4199
  ...h.length > 0 ? { drives: h } : {}
4092
4200
  };
4093
4201
  }
4094
4202
  return [...o.values()];
4095
4203
  }
4096
- function kn(e) {
4204
+ function Fn(e) {
4097
4205
  let t = "", n = !1, r = !1, i = 0, a = 0, o = !1;
4098
4206
  for (let s = 0; s < e.length; s++) {
4099
4207
  let c = e[s];
@@ -4101,24 +4209,24 @@ function kn(e) {
4101
4209
  }
4102
4210
  return t;
4103
4211
  }
4104
- async function An(e, t) {
4105
- let n = new we(), r = new TextEncoder(), i = new TextDecoder(), a;
4106
- if (typeof e == "string") a = n.parse(kn(e));
4212
+ async function In(e, t) {
4213
+ let n = new De(), r = new TextEncoder(), i = new TextDecoder(), a;
4214
+ if (typeof e == "string") a = n.parse(Fn(e));
4107
4215
  else {
4108
4216
  let t = e instanceof Uint8Array ? e : new Uint8Array(e);
4109
- if (_n(t)) a = n.parse(t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength));
4217
+ if (Cn(t)) a = n.parse(t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength));
4110
4218
  else if (t.byteLength >= 2 && t[0] === 80 && t[1] === 75) {
4111
- let e = Se(t);
4112
- for (let [t, n] of Object.entries(e)) /\.(usd|usda)$/i.test(t) && !_n(n) && (e[t] = r.encode(kn(i.decode(n))));
4113
- let o = Ce(e, { level: 0 });
4219
+ let e = I(t);
4220
+ for (let [t, n] of Object.entries(e)) /\.(usd|usda)$/i.test(t) && !Cn(n) && (e[t] = r.encode(Fn(i.decode(n))));
4221
+ let o = Ee(e, { level: 0 });
4114
4222
  a = n.parse(o.buffer.slice(o.byteOffset, o.byteOffset + o.byteLength));
4115
- } else a = n.parse(kn(i.decode(t)));
4223
+ } else a = n.parse(Fn(i.decode(t)));
4116
4224
  }
4117
- let o = On(bn(e), a, yn(a)), s = [];
4225
+ let o = Pn(En(e), a, Tn(a)), s = [];
4118
4226
  a.traverse((e) => {
4119
4227
  if (!(e instanceof p.Mesh) || !e.material) return;
4120
4228
  let t = e.material;
4121
- for (let e of gn) {
4229
+ for (let e of Sn) {
4122
4230
  let n = t[e];
4123
4231
  n && !n.image && (s.push({
4124
4232
  rec: t,
@@ -4129,7 +4237,7 @@ async function An(e, t) {
4129
4237
  });
4130
4238
  try {
4131
4239
  return {
4132
- glb: new Uint8Array(await C(a, o, t)),
4240
+ glb: new Uint8Array(await w(a, o, t)),
4133
4241
  scene: a,
4134
4242
  specs: o
4135
4243
  };
@@ -4138,14 +4246,14 @@ async function An(e, t) {
4138
4246
  }
4139
4247
  }
4140
4248
  // src/importer/chopShopActions.ts
4141
- function jn(e) {
4249
+ function Ln(e) {
4142
4250
  let t = e.islands.find((t) => t.id === e.loopDots.islandId);
4143
4251
  if (!t) throw Error("Loop island no longer exists.");
4144
4252
  let n, r;
4145
4253
  if (e.splitCoarse) {
4146
4254
  let i = t.mesh, a = i.geometry;
4147
- i.geometry = Qe(a, e.loopDots.points).geometry;
4148
- let o = Ne(e.workingScene), s = et(e.islands, o);
4255
+ i.geometry = tt(a, e.loopDots.points).geometry;
4256
+ let o = Ne(e.workingScene), s = rt(e.islands, o);
4149
4257
  n = () => {
4150
4258
  i.geometry = a;
4151
4259
  }, r = e.axles.map((e) => ({
@@ -4159,7 +4267,7 @@ function jn(e) {
4159
4267
  if (t = o.find((e) => e.mesh === i && c.every((t, n) => t >= e.min[n] - .01 && t <= e.max[n] + .01)) ?? o[0], !t) throw Error("Refined surface lost seam anchor.");
4160
4268
  }
4161
4269
  return {
4162
- selection: Ze(t, e.loopDots.points, {
4270
+ selection: et(t, e.loopDots.points, {
4163
4271
  mirrorX: e.mirrorX,
4164
4272
  exact: e.splitCoarse
4165
4273
  }),
@@ -4167,10 +4275,10 @@ function jn(e) {
4167
4275
  nextAxles: r
4168
4276
  };
4169
4277
  }
4170
- function Mn(e) {
4278
+ function Rn(e) {
4171
4279
  let t = e.islands.find((t) => t.id === e.faceSelection.islandId);
4172
4280
  if (!t) throw Error("Selected surface island no longer exists.");
4173
- let { mintedMeshes: n, undo: r } = $e(t, e.faceSelection, e.cutName), i = Ne(e.workingScene), a = et(e.islands, i), o = (e) => e.flatMap((e) => a.get(e) ?? []), s = e.prevAxles.map((e) => ({
4281
+ let { mintedMeshes: n, undo: r } = nt(t, e.faceSelection, e.cutName), i = Ne(e.workingScene), a = rt(e.islands, i), o = (e) => e.flatMap((e) => a.get(e) ?? []), s = e.prevAxles.map((e) => ({
4174
4282
  ...e,
4175
4283
  left: o(e.left),
4176
4284
  right: o(e.right)
@@ -4181,7 +4289,7 @@ function Mn(e) {
4181
4289
  }
4182
4290
  let l = new Set(n), u = i.filter((e) => l.has(e.mesh)).map((e) => e.id), d, f = !1;
4183
4291
  if (e.activeRole === "wheel") {
4184
- for (let t of u) s.some((e) => e.left.includes(t) || e.right.includes(t)) || (s = Oe(i, s, t, e.mode));
4292
+ for (let t of u) s.some((e) => e.left.includes(t) || e.right.includes(t)) || (s = je(i, s, t, e.mode));
4185
4293
  d = `Peeled ${u.length} wheel mesh(es) and paired axle!`;
4186
4294
  } else {
4187
4295
  for (let t of u) c[t] = e.activeRole;
@@ -4196,7 +4304,7 @@ function Mn(e) {
4196
4304
  bumpHinge: f
4197
4305
  };
4198
4306
  }
4199
- function Nn(e, t, n) {
4307
+ function zn(e, t, n) {
4200
4308
  if (t === "none" || e.delta > 5) return null;
4201
4309
  e.stopPropagation();
4202
4310
  let r = e.face ? e.face.normal.clone().transformDirection(e.object.matrixWorld).normalize() : new p.Vector3(0, 1, 0), i = e.point.clone().addScaledVector(r, .015), a = [
@@ -4266,10 +4374,10 @@ function Nn(e, t, n) {
4266
4374
  extension: { socket: t }
4267
4375
  };
4268
4376
  }
4269
- async function Pn(e) {
4377
+ async function Bn(e) {
4270
4378
  let t = await e.arrayBuffer(), n = e.name.replace(/\.[^.]+$/, "") || "ImportedCar";
4271
- if (vn(e.name)) {
4272
- let e = await An(t);
4379
+ if (wn(e.name)) {
4380
+ let e = await In(t);
4273
4381
  return {
4274
4382
  baseName: n,
4275
4383
  scene: e.scene,
@@ -4278,12 +4386,12 @@ async function Pn(e) {
4278
4386
  }
4279
4387
  return {
4280
4388
  baseName: n,
4281
- scene: await new Promise((e, n) => new ce().parse(t, "", (t) => e(t.scene), n)),
4389
+ scene: await new Promise((e, n) => new ue().parse(t, "", (t) => e(t.scene), n)),
4282
4390
  usdInfo: null
4283
4391
  };
4284
4392
  }
4285
4393
  // src/importer/universalGateBake.ts
4286
- var Fn = [
4394
+ var Vn = [
4287
4395
  "map",
4288
4396
  "normalMap",
4289
4397
  "roughnessMap",
@@ -4291,19 +4399,19 @@ var Fn = [
4291
4399
  "aoMap",
4292
4400
  "emissiveMap"
4293
4401
  ];
4294
- function In(e, t, n, r) {
4402
+ function Hn(e, t, n, r) {
4295
4403
  return [
4296
4404
  Number((e / 12 * (n * n + r * r)).toFixed(4)),
4297
4405
  Number((e / 12 * (t * t + r * r)).toFixed(4)),
4298
4406
  Number((e / 12 * (t * t + n * n)).toFixed(4))
4299
4407
  ];
4300
4408
  }
4301
- async function Ln(e, n, r, i) {
4409
+ async function Un(e, n, r, i) {
4302
4410
  let a = [];
4303
4411
  e.traverse((e) => {
4304
4412
  if (!(e instanceof p.Mesh) || !e.material) return;
4305
4413
  let t = e.material;
4306
- for (let e of Fn) {
4414
+ for (let e of Vn) {
4307
4415
  let n = t[e];
4308
4416
  n && !n.image && (a.push({
4309
4417
  rec: t,
@@ -4314,16 +4422,16 @@ async function Ln(e, n, r, i) {
4314
4422
  });
4315
4423
  let o;
4316
4424
  try {
4317
- o = new Uint8Array(await C(e, n, r));
4425
+ o = new Uint8Array(await w(e, n, r));
4318
4426
  } finally {
4319
4427
  for (let e of a) e.rec[e.slot] = e.tex;
4320
4428
  }
4321
4429
  let s = t(o, i);
4322
4430
  return s instanceof Uint8Array ? s : new Uint8Array(s);
4323
4431
  }
4324
- async function Rn(e) {
4432
+ async function Wn(e) {
4325
4433
  if (e.domain === "vehicle" && e.usePaperShellProxy) {
4326
- let { glb: n } = await ye(e.assembly, e.attachedMask, e.fuelLiters), r = new Uint8Array(T(n, (e) => {
4434
+ let { glb: n } = await be(e.assembly, e.attachedMask, e.fuelLiters), r = new Uint8Array(E(n, (e) => {
4327
4435
  let t = e.scenes?.[0];
4328
4436
  t && (t.extras = {
4329
4437
  ...t.extras ?? {},
@@ -4351,13 +4459,13 @@ async function Rn(e) {
4351
4459
  }, ...e.patches])), a = i.buffer.slice(i.byteOffset, i.byteOffset + i.byteLength);
4352
4460
  return {
4353
4461
  glbBytes: i,
4354
- bundle: await w(a),
4462
+ bundle: await T(a),
4355
4463
  worldKind: "car"
4356
4464
  };
4357
4465
  }
4358
4466
  let n = e.normalizedScene ?? new p.Group();
4359
4467
  if (e.domain === "vehicle") {
4360
- let t = await ct(n, {
4468
+ let t = await dt(n, {
4361
4469
  archetype: e.vehicleArchetype,
4362
4470
  massKg: e.massKg,
4363
4471
  powerOrThrust: e.powerOrThrust,
@@ -4371,12 +4479,12 @@ async function Rn(e) {
4371
4479
  }), r = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength);
4372
4480
  return {
4373
4481
  glbBytes: t,
4374
- bundle: await w(r),
4482
+ bundle: await T(r),
4375
4483
  worldKind: e.vehicleArchetype
4376
4484
  };
4377
4485
  }
4378
4486
  if (e.domain === "launcher") {
4379
- let t = e.name.toLowerCase(), { glbBytes: r, bundle: i } = await ht(t.includes("pistol") ? de : t.includes("shotgun") ? fe : P, e.normalizedScene && !e.normalizedScene.name.startsWith("Starter_") ? n : null, e.patches);
4487
+ let t = e.name.toLowerCase(), { glbBytes: r, bundle: i } = await vt(t.includes("pistol") ? fe : t.includes("shotgun") ? pe : de, e.normalizedScene && !e.normalizedScene.name.startsWith("Starter_") ? n : null, e.patches);
4380
4488
  return {
4381
4489
  glbBytes: r,
4382
4490
  bundle: i,
@@ -4397,13 +4505,13 @@ async function Rn(e) {
4397
4505
  Number(a.x.toFixed(4)),
4398
4506
  Number(a.y.toFixed(4)),
4399
4507
  Number(a.z.toFixed(4))
4400
- ], g = await Ln(l, [{
4508
+ ], g = await Un(l, [{
4401
4509
  nodeName: u.name,
4402
4510
  motion: f ? { isKinematic: !0 } : {
4403
4511
  isKinematic: !1,
4404
4512
  mass: m,
4405
4513
  centerOfMass: h,
4406
- inertiaDiagonal: In(m, o, s, c)
4514
+ inertiaDiagonal: Hn(m, o, s, c)
4407
4515
  },
4408
4516
  collider: d && !f ? {
4409
4517
  meshNodeName: u.name,
@@ -4433,30 +4541,30 @@ async function Rn(e) {
4433
4541
  }], { gateDomain: e.domain }, e.patches), _ = g.buffer.slice(g.byteOffset, g.byteOffset + g.byteLength);
4434
4542
  return {
4435
4543
  glbBytes: g,
4436
- bundle: await w(_),
4544
+ bundle: await T(_),
4437
4545
  worldKind: "prop"
4438
4546
  };
4439
4547
  }
4440
4548
  // src/importer/useChopShopController.ts
4441
- function zn(e) {
4442
- let t = K(), [n, r] = f("pickup_truck"), [i, a] = f(!1), [o, s] = f(null), [p, m] = f(null), [h, g] = f([
4549
+ function Gn(e) {
4550
+ let t = q(), [n, r] = f("pickup_truck"), [i, a] = f(!1), [o, s] = f(null), [p, m] = f(null), [h, g] = f([
4443
4551
  0,
4444
4552
  0,
4445
4553
  0
4446
- ]), [_, v] = f(4.65), [y, b] = f(0), [x, S] = f(null), [C, w] = f(0), [T, E] = f([]), [D, O] = f({}), [k, A] = f("imported"), [j, ee] = f("door"), [M, te] = f("crease"), [ne, re] = f(32), [ie, ae] = f(!0), [oe, se] = f(!1), [le, N] = f(null), [ue, P] = f(null), [de, fe] = f(0), [pe, me] = f(0), [he, ge] = f([]), [_e, F] = f("Click a door/hood face with Crease Flood or Tape Lasso, then Peel!"), [ye, be] = f("none"), [xe, Se] = f([]), [Ce, we] = f(null), [I, L] = f(!1), Te = d(null), ke = d(null), Ae = d(null), je = d(0), R = c((e, t) => {
4447
- L(!0), new ce().load(e, (e) => {
4554
+ ]), [_, v] = f(4.65), [y, b] = f(0), [x, S] = f(null), [C, w] = f(0), [T, E] = f([]), [D, O] = f({}), [k, A] = f("imported"), [j, ee] = f("door"), [te, ne] = f("crease"), [re, ie] = f(32), [ae, oe] = f(!0), [se, ce] = f(!1), [le, M] = f(null), [N, P] = f(null), [de, fe] = f(0), [pe, me] = f(0), [he, ge] = f([]), [_e, F] = f("Click a door/hood face with Crease Flood or Tape Lasso, then Peel!"), [ve, be] = f("none"), [xe, Se] = f([]), [Ce, we] = f(null), [Te, I] = f(!1), Ee = d(null), De = d(null), L = d(null), Oe = d(0), R = c((e, t) => {
4555
+ I(!0), new ue().load(e, (e) => {
4448
4556
  r(t), m(e.scene), g([
4449
4557
  0,
4450
4558
  0,
4451
4559
  0
4452
- ]), v(t.includes("pickup") ? 4.65 : 4.2), O({}), N(null), P(null), ge([]), fe(0), F(`Loaded ${t} — chop doors/hood/trunk or pop tires!`), L(!1);
4453
- }, void 0, () => L(!1));
4560
+ ]), v(t.includes("pickup") ? 4.65 : 4.2), O({}), M(null), P(null), ge([]), fe(0), F(`Loaded ${t} — chop doors/hood/trunk or pop tires!`), I(!1);
4561
+ }, void 0, () => I(!1));
4454
4562
  }, []);
4455
4563
  l(() => {
4456
4564
  R("/models/pickup-truck.glb", "pickup_truck");
4457
4565
  }, [R]);
4458
4566
  let z = u(() => {
4459
- let e = p ?? (t.domain === "vehicle" && t.usePaperShellProxy ? null : Pt(t.domain));
4567
+ let e = p ?? (t.domain === "vehicle" && t.usePaperShellProxy ? null : It(t.domain));
4460
4568
  if (!e) return null;
4461
4569
  try {
4462
4570
  return Me(e, {
@@ -4473,13 +4581,13 @@ function zn(e) {
4473
4581
  t.usePaperShellProxy,
4474
4582
  h,
4475
4583
  _
4476
- ]), B = u(() => x ?? ve(t.presetId, t.shadingMode), [
4584
+ ]), B = u(() => x ?? ye(t.presetId, t.shadingMode), [
4477
4585
  x,
4478
4586
  t.presetId,
4479
4587
  t.shadingMode
4480
4588
  ]);
4481
4589
  l(() => {
4482
- t.domain === "vehicle" && t.usePaperShellProxy ? Wt(B, 1, y, !!p, z) : z && Gt(z, y);
4590
+ t.domain === "vehicle" && t.usePaperShellProxy ? Xt(B, 1, y, !!p, z) : z && Zt(z, y);
4483
4591
  }, [
4484
4592
  t.domain,
4485
4593
  t.usePaperShellProxy,
@@ -4501,11 +4609,11 @@ function zn(e) {
4501
4609
  }, [V]), l(() => {
4502
4610
  if (!z) return;
4503
4611
  let e = Ne(z);
4504
- E(t.vehicleArchetype === "car" ? Ee(e) : t.vehicleArchetype === "motorcycle" ? De(e) : []);
4612
+ E(t.vehicleArchetype === "car" ? ke(e) : t.vehicleArchetype === "motorcycle" ? Ae(e) : []);
4505
4613
  for (let t of e) t.geometry.dispose();
4506
- O({}), N(null), P(null), ge([]);
4614
+ O({}), M(null), P(null), ge([]);
4507
4615
  }, [z, t.vehicleArchetype]);
4508
- let Fe = u(() => new Set(T.flatMap((e) => [...e.left, ...e.right])), [T]), Ie = u(() => {
4616
+ let H = u(() => new Set(T.flatMap((e) => [...e.left, ...e.right])), [T]), Pe = u(() => {
4509
4617
  let e = /* @__PURE__ */ new Map();
4510
4618
  return T.forEach((t, n) => {
4511
4619
  for (let r of [...t.left, ...t.right]) e.set(r, n === 0 ? "#00E5FF" : "#10B981");
@@ -4514,7 +4622,7 @@ function zn(e) {
4514
4622
  return l(() => {
4515
4623
  if (t.step !== 2 || t.domain === "vehicle" && t.usePaperShellProxy) return;
4516
4624
  let e = !0;
4517
- return Rn({
4625
+ return Wn({
4518
4626
  name: n,
4519
4627
  domain: t.domain,
4520
4628
  vehicleArchetype: t.vehicleArchetype,
@@ -4573,17 +4681,17 @@ function zn(e) {
4573
4681
  setWheelSource: A,
4574
4682
  activeRole: j,
4575
4683
  setActiveRole: ee,
4576
- surfaceMode: M,
4577
- setSurfaceMode: te,
4578
- creaseDeg: ne,
4579
- setCreaseDeg: re,
4580
- mirrorX: ie,
4581
- setMirrorX: ae,
4582
- splitCoarse: oe,
4583
- setSplitCoarse: se,
4684
+ surfaceMode: te,
4685
+ setSurfaceMode: ne,
4686
+ creaseDeg: re,
4687
+ setCreaseDeg: ie,
4688
+ mirrorX: ae,
4689
+ setMirrorX: oe,
4690
+ splitCoarse: se,
4691
+ setSplitCoarse: ce,
4584
4692
  faceSelection: le,
4585
- setFaceSelection: N,
4586
- loopDots: ue,
4693
+ setFaceSelection: M,
4694
+ loopDots: N,
4587
4695
  setLoopDots: P,
4588
4696
  hingeScrub: de,
4589
4697
  setHingeScrub: fe,
@@ -4591,45 +4699,45 @@ function zn(e) {
4591
4699
  setExplodeAmount: me,
4592
4700
  undoStack: he,
4593
4701
  statusNote: _e,
4594
- stampTool: ye,
4702
+ stampTool: ve,
4595
4703
  setStampTool: be,
4596
4704
  patches: xe,
4597
4705
  setPatches: Se,
4598
4706
  liveBundle: Ce,
4599
- busy: I,
4600
- fileRef: Te,
4601
- rootObjRef: ke,
4602
- panelAnimRef: Ae,
4707
+ busy: Te,
4708
+ fileRef: Ee,
4709
+ rootObjRef: De,
4710
+ panelAnimRef: L,
4603
4711
  workingScene: z,
4604
4712
  assembly: B,
4605
4713
  setProxyAssembly: S,
4606
4714
  islands: V,
4607
- wheelColors: Ie,
4715
+ wheelColors: Pe,
4608
4716
  loadStarterCar: R,
4609
4717
  ingestFile: async (e) => {
4610
- L(!0);
4718
+ I(!0);
4611
4719
  try {
4612
- let { baseName: n, scene: i, usdInfo: o } = await Pn(e);
4720
+ let { baseName: n, scene: i, usdInfo: o } = await Bn(e);
4613
4721
  r(n), a(!0), g([
4614
4722
  0,
4615
4723
  0,
4616
4724
  0
4617
- ]), b(0), Se([]), t.setField("step", 1), m(i), s(o), o ? t.setField("usePaperShellProxy", !1) : t.domain === "vehicle" && t.usePaperShellProxy && S(Kt(i, t.presetId, t.shadingMode)), F(`Imported "${n}" — orient/scale, pop wheels, and chop doors/hood!`);
4725
+ ]), b(0), Se([]), t.setField("step", 1), m(i), s(o), o ? t.setField("usePaperShellProxy", !1) : t.domain === "vehicle" && t.usePaperShellProxy && S(Qt(i, t.presetId, t.shadingMode)), F(`Imported "${n}" — orient/scale, pop wheels, and chop doors/hood!`);
4618
4726
  } finally {
4619
- L(!1);
4727
+ I(!1);
4620
4728
  }
4621
4729
  },
4622
4730
  applyDomainDefaults: (e, n, r) => {
4623
- let i = Ut(e, n);
4624
- t.setField("domain", e), t.setField("vehicleArchetype", n), t.setField("usePaperShellProxy", r), t.setField("massKg", i.massKg), t.setField("powerOrThrust", i.power), t.setField("step", 1), v(e === "c12" ? Bt(i.len) : i.len);
4731
+ let i = Yt(e, n);
4732
+ t.setField("domain", e), t.setField("vehicleArchetype", n), t.setField("usePaperShellProxy", r), t.setField("massKg", i.massKg), t.setField("powerOrThrust", i.power), t.setField("step", 1), v(e === "c12" ? Kt(i.len) : i.len);
4625
4733
  },
4626
4734
  handleBucketIsland: (e) => {
4627
4735
  if (t.vehicleArchetype === "starcraft") return;
4628
4736
  if (j === "wheel") {
4629
- E((n) => Oe(V, n, e, t.vehicleArchetype === "motorcycle" ? "motorcycle" : "car"));
4737
+ E((n) => je(V, n, e, t.vehicleArchetype === "motorcycle" ? "motorcycle" : "car"));
4630
4738
  return;
4631
4739
  }
4632
- if (Fe.has(e)) {
4740
+ if (H.has(e)) {
4633
4741
  F("That island is already paired as a wheel.");
4634
4742
  return;
4635
4743
  }
@@ -4638,7 +4746,7 @@ function zn(e) {
4638
4746
  F("Main body shell — switch to Crease Flood or Tape Lasso to cut a panel!");
4639
4747
  return;
4640
4748
  }
4641
- let r = ie && (j === "door" || j === "fender") ? tt(V, e, Fe) : null, i = r === null ? [e] : [e, r];
4749
+ let r = ae && (j === "door" || j === "fender") ? it(V, e, H) : null, i = r === null ? [e] : [e, r];
4642
4750
  O((t) => {
4643
4751
  let n = { ...t }, r = t[e] === j;
4644
4752
  for (let e of i) r ? delete n[e] : n[e] = j;
@@ -4647,7 +4755,7 @@ function zn(e) {
4647
4755
  },
4648
4756
  handlePickFace: (e) => {
4649
4757
  let t = V.find((t) => t.id === e.islandId);
4650
- t && (M === "loop" ? (N(null), P((n) => e.erase ? n && n.points.length > 1 ? {
4758
+ t && (te === "loop" ? (M(null), P((n) => e.erase ? n && n.points.length > 1 ? {
4651
4759
  ...n,
4652
4760
  points: n.points.slice(0, -1)
4653
4761
  } : null : n?.islandId === t.id ? {
@@ -4656,9 +4764,9 @@ function zn(e) {
4656
4764
  } : {
4657
4765
  islandId: t.id,
4658
4766
  points: [e.point]
4659
- })) : (M === "crease" && !e.isDrag || M === "triangle") && N((n) => Ye(t, e.faceIndex, M, {
4660
- creaseDeg: ne,
4661
- mirrorX: ie,
4767
+ })) : (te === "crease" && !e.isDrag || te === "triangle") && M((n) => Qe(t, e.faceIndex, te, {
4768
+ creaseDeg: re,
4769
+ mirrorX: ae,
4662
4770
  current: n,
4663
4771
  remove: e.erase
4664
4772
  })));
@@ -4671,32 +4779,32 @@ function zn(e) {
4671
4779
  ]), v(n), a(!0);
4672
4780
  },
4673
4781
  handleCloseLoop: () => {
4674
- if (z && ue) try {
4675
- let e = jn({
4782
+ if (z && N) try {
4783
+ let e = Ln({
4676
4784
  workingScene: z,
4677
4785
  islands: V,
4678
- loopDots: ue,
4679
- splitCoarse: oe,
4680
- mirrorX: ie,
4786
+ loopDots: N,
4787
+ splitCoarse: se,
4788
+ mirrorX: ae,
4681
4789
  axles: T
4682
4790
  });
4683
4791
  e.refinedUndo && e.nextAxles && (ge((t) => [...t, {
4684
4792
  undo: e.refinedUndo,
4685
4793
  axles: T,
4686
4794
  picks: D
4687
- }]), E(e.nextAxles), w((e) => e + 1)), N(e.selection), P(null), F("Loop closed — click PEEL to slice those faces into a real part!");
4795
+ }]), E(e.nextAxles), w((e) => e + 1)), M(e.selection), P(null), F("Loop closed — click PEEL to slice those faces into a real part!");
4688
4796
  } catch (e) {
4689
4797
  F(e instanceof Error ? e.message : "Could not close loop.");
4690
4798
  }
4691
4799
  },
4692
4800
  handlePeelSelection: () => {
4693
4801
  if (z && le && le.triangles.length !== 0) try {
4694
- let e = Mn({
4802
+ let e = Rn({
4695
4803
  workingScene: z,
4696
4804
  islands: V,
4697
4805
  faceSelection: le,
4698
4806
  activeRole: j,
4699
- cutName: `${j}_chop_${++je.current}`,
4807
+ cutName: `${j}_chop_${++Oe.current}`,
4700
4808
  prevAxles: T,
4701
4809
  prevPicks: D,
4702
4810
  mode: t.vehicleArchetype === "motorcycle" ? "motorcycle" : "car"
@@ -4705,23 +4813,23 @@ function zn(e) {
4705
4813
  undo: e.undo,
4706
4814
  axles: T,
4707
4815
  picks: D
4708
- }]), E(e.nextAxles), O(e.nextPicks), N(null), P(null), w((e) => e + 1), F(e.status);
4816
+ }]), E(e.nextAxles), O(e.nextPicks), M(null), P(null), w((e) => e + 1), F(e.status);
4709
4817
  } catch (e) {
4710
4818
  F(e instanceof Error ? e.message : "Peel failed.");
4711
4819
  }
4712
4820
  },
4713
4821
  handleUndoCut: () => {
4714
4822
  let e = he[he.length - 1];
4715
- e && (e.undo(), ge((e) => e.slice(0, -1)), E(e.axles), O(e.picks), N(null), P(null), w((e) => e + 1), F("Undid last cut."));
4823
+ e && (e.undo(), ge((e) => e.slice(0, -1)), E(e.axles), O(e.picks), M(null), P(null), w((e) => e + 1), F("Undid last cut."));
4716
4824
  },
4717
4825
  handleStampSurface: (e) => {
4718
- let t = Nn(e, ye, xe.length + 1);
4826
+ let t = zn(e, ve, xe.length + 1);
4719
4827
  t && Se((e) => [...e, t]);
4720
4828
  },
4721
4829
  sealAndExport: async (r) => {
4722
- L(!0);
4830
+ I(!0);
4723
4831
  try {
4724
- let i = await Rn({
4832
+ let i = await Wn({
4725
4833
  name: n,
4726
4834
  domain: t.domain,
4727
4835
  vehicleArchetype: t.vehicleArchetype,
@@ -4753,30 +4861,30 @@ function zn(e) {
4753
4861
  t.href = e, t.download = `${n}_khr3.glb`, t.click(), URL.revokeObjectURL(e);
4754
4862
  }
4755
4863
  } finally {
4756
- L(!1);
4864
+ I(!1);
4757
4865
  }
4758
4866
  },
4759
4867
  wheelCount: T.reduce((e, t) => e + +(t.left.length > 0) + +(t.right.length > 0), 0),
4760
4868
  choppedCount: Object.keys(D).length,
4761
- unlocked: xt(t.calibration, t.domain, t.vehicleArchetype, t.usePaperShellProxy),
4762
- activeRoleColor: Pe.find((e) => e.role === j)?.color ?? "#FFB000",
4869
+ unlocked: wt(t.calibration, t.domain, t.vehicleArchetype, t.usePaperShellProxy),
4870
+ activeRoleColor: Fe.find((e) => e.role === j)?.color ?? "#FFB000",
4763
4871
  bumpTurn: (e) => g((t) => {
4764
4872
  let n = [...t];
4765
4873
  return n[e] = (n[e] + 1) % 4, n;
4766
4874
  }),
4767
4875
  wrapProxy: () => {
4768
4876
  let e = !t.usePaperShellProxy;
4769
- t.setField("usePaperShellProxy", e), e && S(Kt(z, t.presetId, t.shadingMode));
4877
+ t.setField("usePaperShellProxy", e), e && S(Qt(z, t.presetId, t.shadingMode));
4770
4878
  },
4771
- autoPopWheels: () => E(t.vehicleArchetype === "car" ? Ee(V) : De(V)),
4772
- autoScaleSi: () => v(Ut(t.domain, t.vehicleArchetype).len),
4773
- snapC12: () => v((e) => Bt(e))
4879
+ autoPopWheels: () => E(t.vehicleArchetype === "car" ? ke(V) : Ae(V)),
4880
+ autoScaleSi: () => v(Yt(t.domain, t.vehicleArchetype).len),
4881
+ snapC12: () => v((e) => Kt(e))
4774
4882
  };
4775
4883
  }
4776
4884
  // src/importer/GlbImportGate.tsx
4777
- function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4778
- let n = zn(e), { st: r } = n, i = r.step === 1 && r.domain === "vehicle" && !r.usePaperShellProxy && r.vehicleArchetype !== "starcraft", a = !(r.step === 2 && r.domain === "vehicle" && !r.usePaperShellProxy && r.chaseCam && n.stampTool === "none");
4779
- return Mt(u(() => ({
4885
+ function Kn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4886
+ let n = Gn(e), { st: r } = n, i = r.step === 1 && r.domain === "vehicle" && !r.usePaperShellProxy && r.vehicleArchetype !== "starcraft", a = !(r.step === 2 && r.domain === "vehicle" && !r.usePaperShellProxy && r.chaseCam && n.stampTool === "none");
4887
+ return Ft(u(() => ({
4780
4888
  assetName: n.assetName,
4781
4889
  wheelCount: n.wheelCount,
4782
4890
  choppedCount: n.choppedCount,
@@ -4795,7 +4903,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4795
4903
  }]);
4796
4904
  },
4797
4905
  sealAndExport: n.sealAndExport
4798
- }), [n]), t), /* @__PURE__ */ O("div", {
4906
+ }), [n]), t), /* @__PURE__ */ k("div", {
4799
4907
  onDragOver: (e) => e.preventDefault(),
4800
4908
  onDrop: (e) => {
4801
4909
  e.preventDefault();
@@ -4813,7 +4921,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4813
4921
  imageRendering: r.eraMode === "psx-1-3" ? "pixelated" : "auto"
4814
4922
  },
4815
4923
  children: [
4816
- /* @__PURE__ */ D("input", {
4924
+ /* @__PURE__ */ O("input", {
4817
4925
  ref: n.fileRef,
4818
4926
  type: "file",
4819
4927
  accept: ".glb,.usd,.usda,.usdc,.usdz",
@@ -4823,7 +4931,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4823
4931
  t && n.ingestFile(t);
4824
4932
  }
4825
4933
  }),
4826
- /* @__PURE__ */ D(kt, {
4934
+ /* @__PURE__ */ O(Mt, {
4827
4935
  hasCustomFile: n.hasCustomFile,
4828
4936
  assetName: n.assetName,
4829
4937
  usdInfo: n.usdInfo,
@@ -4848,7 +4956,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4848
4956
  onDownloadGlb: () => void n.sealAndExport(!1),
4849
4957
  onSpawnWorld: e ? () => void n.sealAndExport(!0) : void 0
4850
4958
  }),
4851
- r.step === 1 && r.domain !== "vehicle" && /* @__PURE__ */ D(vt, {
4959
+ r.step === 1 && r.domain !== "vehicle" && /* @__PURE__ */ O(xt, {
4852
4960
  domain: r.domain,
4853
4961
  targetMeters: n.targetMeters,
4854
4962
  onChangeTargetMeters: n.setTargetMeters,
@@ -4861,9 +4969,9 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4861
4969
  extension: { socket: "optic" }
4862
4970
  }]),
4863
4971
  workingScene: n.workingScene,
4864
- onEnforceCrispyPerson: () => _t(n.workingScene)
4972
+ onEnforceCrispyPerson: () => bt(n.workingScene)
4865
4973
  }),
4866
- i && /* @__PURE__ */ D(ft, {
4974
+ i && /* @__PURE__ */ O(ht, {
4867
4975
  targetMeters: n.targetMeters,
4868
4976
  onChangeTargetMeters: n.setTargetMeters,
4869
4977
  activeRole: n.activeRole,
@@ -4909,12 +5017,12 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4909
5017
  onGoTestDrive: () => r.setField("step", 2),
4910
5018
  onSpawnWorld: e ? () => void n.sealAndExport(!0) : void 0
4911
5019
  }),
4912
- /* @__PURE__ */ D("div", {
5020
+ /* @__PURE__ */ O("div", {
4913
5021
  style: {
4914
5022
  flex: 1,
4915
5023
  minHeight: 0
4916
5024
  },
4917
- children: /* @__PURE__ */ O(m, {
5025
+ children: /* @__PURE__ */ k(m, {
4918
5026
  dpr: r.eraMode === "psx-1-3" ? .333 : [1, 1.5],
4919
5027
  gl: {
4920
5028
  localClippingEnabled: !0,
@@ -4929,12 +5037,12 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4929
5037
  fov: 45
4930
5038
  },
4931
5039
  children: [
4932
- /* @__PURE__ */ D("color", {
5040
+ /* @__PURE__ */ O("color", {
4933
5041
  attach: "background",
4934
5042
  args: ["#0A0C0E"]
4935
5043
  }),
4936
- /* @__PURE__ */ D("ambientLight", { intensity: .72 }),
4937
- /* @__PURE__ */ D("directionalLight", {
5044
+ /* @__PURE__ */ O("ambientLight", { intensity: .72 }),
5045
+ /* @__PURE__ */ O("directionalLight", {
4938
5046
  position: [
4939
5047
  6,
4940
5048
  10,
@@ -4942,7 +5050,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4942
5050
  ],
4943
5051
  intensity: 1.35
4944
5052
  }),
4945
- /* @__PURE__ */ D("directionalLight", {
5053
+ /* @__PURE__ */ O("directionalLight", {
4946
5054
  position: [
4947
5055
  -6,
4948
5056
  4,
@@ -4951,7 +5059,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4951
5059
  intensity: .45,
4952
5060
  color: "#00E5FF"
4953
5061
  }),
4954
- /* @__PURE__ */ D(v, {
5062
+ /* @__PURE__ */ O(y, {
4955
5063
  infiniteGrid: !0,
4956
5064
  cellSize: r.domain === "c12" ? 1 / 12 : .5,
4957
5065
  sectionSize: 3,
@@ -4959,12 +5067,12 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4959
5067
  cellColor: "#12161B",
4960
5068
  fadeDistance: 90
4961
5069
  }),
4962
- /* @__PURE__ */ D(b, {
5070
+ /* @__PURE__ */ O(x, {
4963
5071
  makeDefault: !0,
4964
5072
  enabled: a,
4965
5073
  enableDamping: !0
4966
5074
  }),
4967
- r.step === 1 ? /* @__PURE__ */ D(It, {
5075
+ r.step === 1 ? /* @__PURE__ */ O(Vt, {
4968
5076
  assembly: n.assembly,
4969
5077
  useProxy: r.domain === "vehicle" && r.usePaperShellProxy,
4970
5078
  previewScene: n.workingScene,
@@ -4982,7 +5090,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4982
5090
  rootObjRef: n.rootObjRef,
4983
5091
  onClickIsland: n.handleBucketIsland,
4984
5092
  onPickFace: n.handlePickFace
4985
- }) : /* @__PURE__ */ D(cn, {
5093
+ }) : /* @__PURE__ */ O(mn, {
4986
5094
  assembly: n.assembly,
4987
5095
  importedRoot: n.workingScene,
4988
5096
  rootObjRef: n.rootObjRef,
@@ -4992,7 +5100,7 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
4992
5100
  panelAnimRef: n.panelAnimRef,
4993
5101
  onStampSurface: n.handleStampSurface
4994
5102
  }),
4995
- r.domain === "vehicle" && r.usePaperShellProxy && /* @__PURE__ */ D(mn, {
5103
+ r.domain === "vehicle" && r.usePaperShellProxy && /* @__PURE__ */ O(bn, {
4996
5104
  chassisObjRef: n.rootObjRef,
4997
5105
  emitters: n.assembly.emitters
4998
5106
  })
@@ -5002,4 +5110,4 @@ function Bn({ onSpawnInWorld: e, enableWebMcp: t = !0 }) {
5002
5110
  ]
5003
5111
  });
5004
5112
  }
5005
- export { I as $, _t as A, Qe as B, kt as C, xt as D, G as E, nt as F, ze as G, Ye as H, rt as I, He as J, Ve as K, tt as L, mt as M, ft as N, K as O, ct as P, R as Q, $e as R, Mt as S, yt as T, Ze as U, et as V, Pe as W, Me as X, Ne as Y, z as Z, Kt as _, mn as a, jt as b, Lt as c, Ut as d, Ee as et, Ht as f, Bt as g, Gt as h, vn as i, ht as j, vt as k, Rt as l, Wt as m, Rn as n, Oe as nt, cn as o, zt as p, Re as q, An as r, $t as s, Bn as t, De as tt, Vt as u, It as v, bt as w, At as x, Pt as y, Xe as z };
5113
+ export { L as $, bt as A, tt as B, Mt as C, wt as D, K as E, at as F, He as G, Qe as H, ot as I, Ge as J, We as K, it as L, _t as M, ht as N, q as O, dt as P, H as Q, nt as R, Ft as S, St as T, et as U, rt as V, Fe as W, Me as X, Ne as Y, Pe as Z, Qt as _, bn as a, Pt as b, Ht as c, Yt as d, ke as et, Jt as f, Kt as g, Zt as h, wn as i, vt as j, xt as k, Ut as l, Xt as m, Wn as n, je as nt, mn as o, Gt as p, Ve as q, In as r, on as s, Kn as t, Ae as tt, qt as u, Vt as v, Ct as w, Nt as x, It as y, $e as z };