@wandelbots/wandelbots-js-react-components 4.1.1 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/3d.cjs.js +1 -1
  2. package/dist/3d.d.ts +1 -0
  3. package/dist/3d.d.ts.map +1 -1
  4. package/dist/3d.es.js +13 -12
  5. package/dist/MotionGroupVisualizer-C3CB-L2z.cjs +2 -0
  6. package/dist/MotionGroupVisualizer-C3CB-L2z.cjs.map +1 -0
  7. package/dist/{manufacturerHomePositions-DAaWLJKB.js → MotionGroupVisualizer-CrLamHYm.js} +408 -356
  8. package/dist/MotionGroupVisualizer-CrLamHYm.js.map +1 -0
  9. package/dist/components/robots/MotionGroupVisualizer.d.ts +9 -0
  10. package/dist/components/robots/MotionGroupVisualizer.d.ts.map +1 -0
  11. package/dist/components/robots/SupportedLinearAxis.d.ts +3 -2
  12. package/dist/components/robots/SupportedLinearAxis.d.ts.map +1 -1
  13. package/dist/components/robots/SupportedRobot.d.ts +3 -2
  14. package/dist/components/robots/SupportedRobot.d.ts.map +1 -1
  15. package/dist/components/robots/robotModelLogic.d.ts +1 -1
  16. package/dist/components/robots/robotModelLogic.d.ts.map +1 -1
  17. package/dist/core.cjs.js +1 -1
  18. package/dist/core.es.js +2 -2
  19. package/dist/index.cjs.js +1 -1
  20. package/dist/index.es.js +57 -56
  21. package/dist/{interpolation-DZhBKo-u.cjs → interpolation-C5OTEwAm.cjs} +3 -3
  22. package/dist/{interpolation-DZhBKo-u.cjs.map → interpolation-C5OTEwAm.cjs.map} +1 -1
  23. package/dist/{interpolation-baUmFLkh.js → interpolation-Cs2pC1zE.js} +694 -637
  24. package/dist/{interpolation-baUmFLkh.js.map → interpolation-Cs2pC1zE.js.map} +1 -1
  25. package/dist/{theming-BTlS2afw.js → theming-C-zvh022.js} +2 -2
  26. package/dist/{theming-BTlS2afw.js.map → theming-C-zvh022.js.map} +1 -1
  27. package/dist/{theming-DPoEjzxv.cjs → theming-Dk07SE2_.cjs} +2 -2
  28. package/dist/{theming-DPoEjzxv.cjs.map → theming-Dk07SE2_.cjs.map} +1 -1
  29. package/package.json +3 -3
  30. package/src/3d.ts +1 -0
  31. package/src/components/robots/MotionGroupVisualizer.tsx +113 -0
  32. package/src/components/robots/SupportedLinearAxis.tsx +4 -2
  33. package/src/components/robots/SupportedRobot.tsx +4 -2
  34. package/src/components/robots/robotModelLogic.ts +2 -2
  35. package/dist/manufacturerHomePositions-5E6JP4Zd.cjs +0 -2
  36. package/dist/manufacturerHomePositions-5E6JP4Zd.cjs.map +0 -1
  37. package/dist/manufacturerHomePositions-DAaWLJKB.js.map +0 -1
@@ -1,16 +1,16 @@
1
- import { j as t, e as z } from "./externalizeComponent-Dc3fViZA.js";
1
+ import { j as t, e as I } from "./externalizeComponent-Dc3fViZA.js";
2
2
  import * as x from "three";
3
- import { Matrix4 as w, Vector3 as T, Quaternion as U } from "three";
3
+ import { Matrix4 as w, Vector3 as F, Quaternion as z } from "three";
4
4
  import { ConvexGeometry as te } from "three-stdlib";
5
5
  import { useThree as ne, useFrame as re, Canvas as N } from "@react-three/fiber";
6
- import { Environment as we, Lightformer as V, Line as O, useGLTF as be, Bounds as Y } from "@react-three/drei";
7
- import { useTheme as Re, Card as ve, Box as b, Typography as q, Divider as X, Button as K } from "@mui/material";
8
- import { observer as Me } from "mobx-react-lite";
9
- import _e, { useRef as R, useEffect as L, useCallback as _, useState as G, Suspense as oe } from "react";
10
- import { useTranslation as Le } from "react-i18next";
11
- import { N as Te, V as se, c as ie, b as Z, M as v } from "./interpolation-baUmFLkh.js";
12
- import { ErrorBoundary as ae } from "react-error-boundary";
13
- function Ve(e) {
6
+ import { Environment as ve, Lightformer as G, Line as O, useGLTF as Me, Bounds as H } from "@react-three/drei";
7
+ import { useTheme as _e, Card as Ae, Box as b, Typography as Y, Divider as q, Button as X } from "@mui/material";
8
+ import { observer as Te } from "mobx-react-lite";
9
+ import Fe, { useRef as R, useEffect as _, useCallback as M, useState as T, Suspense as oe, useMemo as Ge } from "react";
10
+ import { useTranslation as Se } from "react-i18next";
11
+ import { N as se, V as ie, c as ae, b as Z, M as v } from "./interpolation-Cs2pC1zE.js";
12
+ import { ErrorBoundary as le } from "react-error-boundary";
13
+ function ke(e) {
14
14
  switch (e.shape_type) {
15
15
  case "convex_hull":
16
16
  return new te(
@@ -47,36 +47,36 @@ function Ve(e) {
47
47
  return console.warn(`${e.shape_type} is not supported`), new x.BufferGeometry();
48
48
  }
49
49
  }
50
- function Ge({
50
+ function Le({
51
51
  name: e,
52
52
  collider: r,
53
53
  children: n
54
54
  }) {
55
55
  var u, a;
56
- const l = ((u = r.pose) == null ? void 0 : u.position) ?? [0, 0, 0], o = ((a = r.pose) == null ? void 0 : a.orientation) ?? [0, 0, 0];
56
+ const i = ((u = r.pose) == null ? void 0 : u.position) ?? [0, 0, 0], o = ((a = r.pose) == null ? void 0 : a.orientation) ?? [0, 0, 0];
57
57
  return r.margin && console.warn(`${e} margin is not supported`), /* @__PURE__ */ t.jsx(
58
58
  "mesh",
59
59
  {
60
60
  name: e,
61
61
  position: new x.Vector3(
62
- l[0],
63
- l[1],
64
- l[2]
62
+ i[0],
63
+ i[1],
64
+ i[2]
65
65
  ).divideScalar(1e3),
66
66
  rotation: new x.Euler(o[0], o[1], o[2], "XYZ"),
67
- geometry: Ve(r.shape),
67
+ geometry: ke(r.shape),
68
68
  children: n
69
69
  }
70
70
  );
71
71
  }
72
- function ke({
72
+ function Ve({
73
73
  name: e,
74
74
  colliders: r,
75
75
  meshChildrenProvider: n,
76
- ...l
76
+ ...i
77
77
  }) {
78
- return /* @__PURE__ */ t.jsx("group", { name: e, ...l, children: Object.entries(r).map(([o, u]) => /* @__PURE__ */ t.jsx(
79
- Ge,
78
+ return /* @__PURE__ */ t.jsx("group", { name: e, ...i, children: Object.entries(r).map(([o, u]) => /* @__PURE__ */ t.jsx(
79
+ Le,
80
80
  {
81
81
  name: o,
82
82
  collider: u,
@@ -85,13 +85,13 @@ function ke({
85
85
  o
86
86
  )) });
87
87
  }
88
- function nt({
88
+ function rt({
89
89
  scene: e,
90
90
  meshChildrenProvider: r
91
91
  }) {
92
92
  const n = e.colliders;
93
93
  return /* @__PURE__ */ t.jsx("group", { children: n && /* @__PURE__ */ t.jsx(
94
- ke,
94
+ Ve,
95
95
  {
96
96
  meshChildrenProvider: r,
97
97
  colliders: n
@@ -99,12 +99,12 @@ function nt({
99
99
  ) });
100
100
  }
101
101
  function Q() {
102
- return /* @__PURE__ */ t.jsx(we, { children: /* @__PURE__ */ t.jsx(Fe, {}) });
102
+ return /* @__PURE__ */ t.jsx(ve, { children: /* @__PURE__ */ t.jsx(Pe, {}) });
103
103
  }
104
- function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
104
+ function Pe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
105
105
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
106
106
  /* @__PURE__ */ t.jsx(
107
- V,
107
+ G,
108
108
  {
109
109
  intensity: 5,
110
110
  "rotation-x": Math.PI / 2,
@@ -113,7 +113,7 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
113
113
  }
114
114
  ),
115
115
  /* @__PURE__ */ t.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ t.jsx("group", { children: e.map((r, n) => /* @__PURE__ */ t.jsx(
116
- V,
116
+ G,
117
117
  {
118
118
  form: "circle",
119
119
  intensity: 5,
@@ -124,7 +124,7 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
124
124
  n
125
125
  )) }) }),
126
126
  /* @__PURE__ */ t.jsx(
127
- V,
127
+ G,
128
128
  {
129
129
  intensity: 40,
130
130
  "rotation-y": Math.PI / 2,
@@ -133,7 +133,7 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
133
133
  }
134
134
  ),
135
135
  /* @__PURE__ */ t.jsx(
136
- V,
136
+ G,
137
137
  {
138
138
  intensity: 20,
139
139
  "rotation-y": -Math.PI,
@@ -142,7 +142,7 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
142
142
  }
143
143
  ),
144
144
  /* @__PURE__ */ t.jsx(
145
- V,
145
+ G,
146
146
  {
147
147
  "rotation-y": Math.PI / 2,
148
148
  position: [-5, -1, -1],
@@ -151,7 +151,7 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
151
151
  }
152
152
  ),
153
153
  /* @__PURE__ */ t.jsx(
154
- V,
154
+ G,
155
155
  {
156
156
  "rotation-y": -Math.PI / 2,
157
157
  position: [10, 1, 0],
@@ -160,7 +160,7 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
160
160
  }
161
161
  ),
162
162
  /* @__PURE__ */ t.jsx(
163
- V,
163
+ G,
164
164
  {
165
165
  form: "ring",
166
166
  color: "white",
@@ -172,42 +172,42 @@ function Fe({ positions: e = [2, 0, 2, 0, 2, 0, 2, 0] }) {
172
172
  )
173
173
  ] });
174
174
  }
175
- function Ae(e) {
175
+ function Ie(e) {
176
176
  if (e.length < 3)
177
177
  return console.log("Not enough vertices to define a plane"), { isCoplanar: !1 };
178
- const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z), l = new x.Vector3(e[2].x, e[2].y, e[2].z), o = new x.Vector3().subVectors(n, r), u = new x.Vector3().subVectors(l, r), a = new x.Vector3().crossVectors(o, u).normalize();
178
+ const r = new x.Vector3(e[0].x, e[0].y, e[0].z), n = new x.Vector3(e[1].x, e[1].y, e[1].z), i = new x.Vector3(e[2].x, e[2].y, e[2].z), o = new x.Vector3().subVectors(n, r), u = new x.Vector3().subVectors(i, r), a = new x.Vector3().crossVectors(o, u).normalize();
179
179
  for (let f = 3; f < e.length; f++) {
180
- const c = new x.Vector3(e[f].x, e[f].y, e[f].z), m = new x.Vector3().subVectors(c, r), d = a.dot(m);
181
- if (Math.abs(d) > 1e-6)
180
+ const l = new x.Vector3(e[f].x, e[f].y, e[f].z), d = new x.Vector3().subVectors(l, r), m = a.dot(d);
181
+ if (Math.abs(m) > 1e-6)
182
182
  return console.log("Vertices are not on the same plane"), { isCoplanar: !1 };
183
183
  }
184
184
  return { isCoplanar: !0, normal: a };
185
185
  }
186
- function rt({
186
+ function ot({
187
187
  safetyZones: e,
188
188
  ...r
189
189
  }) {
190
- return /* @__PURE__ */ t.jsx("group", { ...r, children: e.map((n, l) => {
190
+ return /* @__PURE__ */ t.jsx("group", { ...r, children: e.map((n, i) => {
191
191
  let o = [];
192
192
  return n.geometry && (n.geometry.compound ? o = n.geometry.compound.child_geometries : n.geometry.convex_hull && (o = [n.geometry])), o.map((u, a) => {
193
193
  if (!u.convex_hull) return null;
194
194
  const f = u.convex_hull.vertices.map(
195
- (d) => new x.Vector3(d.x / 1e3, d.y / 1e3, d.z / 1e3)
196
- ), c = Ae(f);
197
- if (c.isCoplanar && c.normal) {
195
+ (m) => new x.Vector3(m.x / 1e3, m.y / 1e3, m.z / 1e3)
196
+ ), l = Ie(f);
197
+ if (l.isCoplanar && l.normal) {
198
198
  const s = new x.Vector3().addVectors(
199
199
  f[0],
200
- c.normal.multiplyScalar(1e-4)
200
+ l.normal.multiplyScalar(1e-4)
201
201
  );
202
202
  f.push(s);
203
203
  }
204
- let m;
204
+ let d;
205
205
  try {
206
- m = new te(f);
207
- } catch (d) {
208
- return console.log("Error creating ConvexGeometry:", d), null;
206
+ d = new te(f);
207
+ } catch (m) {
208
+ return console.log("Error creating ConvexGeometry:", m), null;
209
209
  }
210
- return /* @__PURE__ */ t.jsx("mesh", { geometry: m, children: /* @__PURE__ */ t.jsx(
210
+ return /* @__PURE__ */ t.jsx("mesh", { geometry: d, children: /* @__PURE__ */ t.jsx(
211
211
  "meshStandardMaterial",
212
212
  {
213
213
  attach: "material",
@@ -219,17 +219,17 @@ function rt({
219
219
  polygonOffset: !0,
220
220
  polygonOffsetFactor: -a
221
221
  },
222
- l
223
- ) }, `${l}-${a}`);
222
+ i
223
+ ) }, `${i}-${a}`);
224
224
  });
225
225
  }) });
226
226
  }
227
- function ot({
227
+ function st({
228
228
  trajectory: e,
229
229
  ...r
230
230
  }) {
231
- var l;
232
- const n = ((l = e.trajectory) == null ? void 0 : l.map((o) => o.tcp_pose ? new x.Vector3(
231
+ var i;
232
+ const n = ((i = e.trajectory) == null ? void 0 : i.map((o) => o.tcp_pose ? new x.Vector3(
233
233
  o.tcp_pose.position.x / 1e3,
234
234
  o.tcp_pose.position.z / 1e3,
235
235
  -o.tcp_pose.position.y / 1e3
@@ -245,89 +245,89 @@ function ot({
245
245
  }
246
246
  ) });
247
247
  }
248
- const D = /* @__PURE__ */ new Map();
249
- async function S(e) {
250
- if (D.has(e))
251
- return D.get(e);
252
- const r = (async () => {
253
- var u;
254
- const l = new Te({ instanceUrl: "" }), o = l.api.motionGroupModels;
255
- (u = o.axios) != null && u.interceptors && o.axios.interceptors.request.use((a) => {
256
- var f;
257
- return (f = a.url) != null && f.includes("/glb") && (a.responseType = "blob"), a;
248
+ const C = /* @__PURE__ */ new Map();
249
+ async function U(e, r) {
250
+ if (C.has(e))
251
+ return C.get(e);
252
+ const n = (async () => {
253
+ var a;
254
+ const i = r || "", o = new se({ instanceUrl: i }), u = o.api.motionGroupModels;
255
+ (a = u.axios) != null && a.interceptors && u.axios.interceptors.request.use((f) => {
256
+ var l;
257
+ return (l = f.url) != null && l.includes("/glb") && (f.responseType = "blob"), f;
258
258
  });
259
259
  try {
260
- const a = await l.api.motionGroupModels.getMotionGroupGlbModel(e);
261
- return URL.createObjectURL(a);
262
- } catch (a) {
263
- throw console.error("Failed to fetch model:", a), a;
260
+ const f = await o.api.motionGroupModels.getMotionGroupGlbModel(e);
261
+ return URL.createObjectURL(f);
262
+ } catch (f) {
263
+ throw console.error("Failed to fetch model:", f), f;
264
264
  }
265
265
  })();
266
- return D.set(e, r), r;
266
+ return C.set(e, n), n;
267
267
  }
268
- function le(e) {
268
+ function ce(e) {
269
269
  function r(n) {
270
- return n.children.length === 0 ? [n] : [n, ...n.children.flatMap((l) => r(l))];
270
+ return n.children.length === 0 ? [n] : [n, ...n.children.flatMap((i) => r(i))];
271
271
  }
272
- return r(e).filter((n) => ue(n));
272
+ return r(e).filter((n) => fe(n));
273
273
  }
274
- function ce(e) {
274
+ function ue(e) {
275
275
  return e.name.endsWith("_FLG");
276
276
  }
277
- function ue(e) {
277
+ function fe(e) {
278
278
  return /_J[0-9]+$/.test(e.name);
279
279
  }
280
- function Ie(e, r) {
280
+ function Ue(e, r) {
281
281
  let n;
282
- function l(o) {
283
- if (ce(o)) {
282
+ function i(o) {
283
+ if (ue(o)) {
284
284
  if (n)
285
285
  throw Error(
286
286
  `Found multiple flange groups in robot model ${r}; first ${n.name} then ${o.name}. Only one _FLG group is allowed.`
287
287
  );
288
288
  n = o;
289
289
  }
290
- ue(o), o.children.map(l);
290
+ fe(o), o.children.map(i);
291
291
  }
292
- if (l(e.scene), !n)
292
+ if (i(e.scene), !n)
293
293
  throw Error(
294
294
  `No flange group found in robot model ${r}. Flange must be identified with a name ending in _FLG.`
295
295
  );
296
296
  return { gltf: e };
297
297
  }
298
- function fe({
298
+ function de({
299
299
  rapidlyChangingMotionState: e,
300
300
  dhParameters: r,
301
301
  onRotationChanged: n,
302
- children: l
302
+ children: i
303
303
  }) {
304
304
  const o = R([]), u = R([]), a = R(null), { invalidate: f } = ne();
305
- L(() => {
305
+ _(() => {
306
306
  const s = e.joint_position.filter(
307
- (i) => i !== void 0
307
+ (c) => c !== void 0
308
308
  );
309
- return a.current = new se(s, {
309
+ return a.current = new ie(s, {
310
310
  tension: 120,
311
311
  // Controls spring stiffness - higher values create faster, more responsive motion
312
312
  friction: 20,
313
313
  // Controls damping - higher values reduce oscillation and create smoother settling
314
314
  threshold: 1e-3
315
315
  }), () => {
316
- var i;
317
- (i = a.current) == null || i.destroy();
316
+ var c;
317
+ (c = a.current) == null || c.destroy();
318
318
  };
319
- }, []), re((s, i) => {
319
+ }, []), re((s, c) => {
320
320
  if (a.current) {
321
- const h = a.current.update(i);
322
- m(), h || f();
321
+ const h = a.current.update(c);
322
+ d(), h || f();
323
323
  }
324
324
  });
325
- function c(s) {
326
- s && (u.current = le(s), m(), f());
325
+ function l(s) {
326
+ s && (u.current = ce(s), d(), f());
327
327
  }
328
- function m() {
329
- var i;
330
- const s = ((i = a.current) == null ? void 0 : i.getCurrentValues()) || [];
328
+ function d() {
329
+ var c;
330
+ const s = ((c = a.current) == null ? void 0 : c.getCurrentValues()) || [];
331
331
  if (n)
332
332
  n(u.current, s);
333
333
  else
@@ -336,80 +336,80 @@ function fe({
336
336
  g.rotation.y = y * (s[h] || 0) + j;
337
337
  }
338
338
  }
339
- const d = _(() => {
339
+ const m = M(() => {
340
340
  const s = e.joint_position.filter(
341
- (i) => i !== void 0
341
+ (c) => c !== void 0
342
342
  );
343
343
  requestAnimationFrame(() => {
344
- var i;
345
- o.current = s, (i = a.current) == null || i.setTarget(s);
344
+ var c;
345
+ o.current = s, (c = a.current) == null || c.setTarget(s);
346
346
  });
347
347
  }, [e]);
348
- return L(() => {
349
- d();
350
- }, [e, d]), ie(() => {
351
- d();
352
- }), /* @__PURE__ */ t.jsx("group", { ref: c, children: l });
348
+ return _(() => {
349
+ m();
350
+ }, [e, m]), ae(() => {
351
+ m();
352
+ }), /* @__PURE__ */ t.jsx("group", { ref: l, children: i });
353
353
  }
354
- const Pe = "line", Se = "mesh";
355
- function Ce({
354
+ const De = "line", Ce = "mesh";
355
+ function ze({
356
356
  rapidlyChangingMotionState: e,
357
357
  dhParameters: r,
358
358
  ...n
359
359
  }) {
360
- const l = new w(), o = R([]), u = R([]);
361
- _e.useEffect(() => {
360
+ const i = new w(), o = R([]), u = R([]);
361
+ Fe.useEffect(() => {
362
362
  o.current = new Array(r.length).fill(null), u.current = new Array(r.length).fill(null);
363
363
  }, [r.length]);
364
- function a(m, d) {
365
- const s = new T(), i = new U(), h = new T();
366
- l.decompose(s, i, h);
364
+ function a(d, m) {
365
+ const s = new F(), c = new z(), h = new F();
366
+ i.decompose(s, c, h);
367
367
  const g = s.clone(), p = new w().makeRotationY(
368
- m.theta + d * (m.reverse_rotation_direction ? -1 : 1)
369
- ).multiply(new w().makeTranslation(0, m.d / 1e3, 0)).multiply(new w().makeTranslation(m.a / 1e3, 0, 0)).multiply(new w().makeRotationX(m.alpha));
370
- return l.multiply(p), l.decompose(s, i, h), { a: g, b: s };
368
+ d.theta + m * (d.reverse_rotation_direction ? -1 : 1)
369
+ ).multiply(new w().makeTranslation(0, d.d / 1e3, 0)).multiply(new w().makeTranslation(d.a / 1e3, 0, 0)).multiply(new w().makeRotationX(d.alpha));
370
+ return i.multiply(p), i.decompose(s, c, h), { a: g, b: s };
371
371
  }
372
- function f(m, d, s, i) {
372
+ function f(d, m, s, c) {
373
373
  if (!r)
374
374
  return;
375
- const h = r[m];
375
+ const h = r[d];
376
376
  if (!h)
377
377
  return;
378
- const { a: g, b: p } = a(h, i);
379
- d.geometry.setPositions([g.toArray(), p.toArray()].flat()), s.position.set(p.x, p.y, p.z);
378
+ const { a: g, b: p } = a(h, c);
379
+ m.geometry.setPositions([g.toArray(), p.toArray()].flat()), s.position.set(p.x, p.y, p.z);
380
380
  }
381
- function c(m, d) {
382
- l.identity();
383
- for (let s = 0; s < Math.min(m.length, d.length); s++) {
384
- const i = o.current[s], h = u.current[s];
385
- i && h && f(s, i, h, d[s]);
381
+ function l(d, m) {
382
+ i.identity();
383
+ for (let s = 0; s < Math.min(d.length, m.length); s++) {
384
+ const c = o.current[s], h = u.current[s];
385
+ c && h && f(s, c, h, m[s]);
386
386
  }
387
387
  }
388
388
  return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
389
- fe,
389
+ de,
390
390
  {
391
391
  rapidlyChangingMotionState: e,
392
392
  dhParameters: r,
393
- onRotationChanged: c,
393
+ onRotationChanged: l,
394
394
  children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
395
395
  /* @__PURE__ */ t.jsxs("mesh", { children: [
396
396
  /* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
397
397
  /* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
398
398
  ] }),
399
- r.map((m, d) => {
400
- const { a: s, b: i } = a(
401
- m,
402
- e.joint_position[d] ?? 0
403
- ), h = `dhrobot_J0${d}`;
399
+ r.map((d, m) => {
400
+ const { a: s, b: c } = a(
401
+ d,
402
+ e.joint_position[m] ?? 0
403
+ ), h = `dhrobot_J0${m}`;
404
404
  return /* @__PURE__ */ t.jsxs("group", { name: h, children: [
405
405
  /* @__PURE__ */ t.jsx(
406
406
  O,
407
407
  {
408
408
  ref: (g) => {
409
- o.current[d] = g;
409
+ o.current[m] = g;
410
410
  },
411
- name: Pe,
412
- points: [s, i],
411
+ name: De,
412
+ points: [s, c],
413
413
  color: "white",
414
414
  lineWidth: 5
415
415
  }
@@ -418,16 +418,16 @@ function Ce({
418
418
  "mesh",
419
419
  {
420
420
  ref: (g) => {
421
- u.current[d] = g;
421
+ u.current[m] = g;
422
422
  },
423
- name: Se,
424
- position: i,
423
+ name: Ce,
424
+ position: c,
425
425
  children: [
426
426
  /* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
427
427
  /* @__PURE__ */ t.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
428
428
  ]
429
429
  },
430
- "mesh_" + d
430
+ "mesh_" + m
431
431
  )
432
432
  ] }, h);
433
433
  })
@@ -435,73 +435,73 @@ function Ce({
435
435
  }
436
436
  ) });
437
437
  }
438
- const De = console.warn;
439
- function de() {
440
- return L(() => {
438
+ const Oe = console.warn;
439
+ function me() {
440
+ return _(() => {
441
441
  console.warn = (e) => {
442
- e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && De(e);
442
+ e !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && Oe(e);
443
443
  };
444
444
  }, []), /* @__PURE__ */ t.jsx(t.Fragment, {});
445
445
  }
446
- function Ue(e) {
446
+ function Ee(e) {
447
447
  return e.type === "Mesh";
448
448
  }
449
- function ze({
449
+ function Be({
450
450
  url: e,
451
451
  flangeRef: r,
452
452
  postModelRender: n,
453
- ...l
453
+ ...i
454
454
  }) {
455
- const o = be(e);
455
+ const o = Me(e);
456
456
  let u;
457
457
  try {
458
- u = Ie(o, "robot.glb").gltf;
459
- } catch (c) {
460
- throw c;
458
+ u = Ue(o, "robot.glb").gltf;
459
+ } catch (l) {
460
+ throw l;
461
461
  }
462
- const a = _(
463
- (c) => {
464
- c && n && n();
462
+ const a = M(
463
+ (l) => {
464
+ l && n && n();
465
465
  },
466
466
  [n]
467
467
  );
468
- function f(c) {
468
+ function f(l) {
469
469
  try {
470
- return Ue(c) ? c.geometry ? /* @__PURE__ */ t.jsx(
470
+ return Ee(l) ? l.geometry ? /* @__PURE__ */ t.jsx(
471
471
  "mesh",
472
472
  {
473
- name: c.name,
474
- geometry: c.geometry,
475
- material: c.material,
476
- position: c.position,
477
- rotation: c.rotation
473
+ name: l.name,
474
+ geometry: l.geometry,
475
+ material: l.material,
476
+ position: l.position,
477
+ rotation: l.rotation
478
478
  },
479
- c.uuid
480
- ) : /* @__PURE__ */ t.jsx("group", { name: c.name, position: c.position, rotation: c.rotation }, c.uuid) : /* @__PURE__ */ t.jsx(
479
+ l.uuid
480
+ ) : /* @__PURE__ */ t.jsx("group", { name: l.name, position: l.position, rotation: l.rotation }, l.uuid) : /* @__PURE__ */ t.jsx(
481
481
  "group",
482
482
  {
483
- name: c.name,
484
- position: c.position,
485
- rotation: c.rotation,
486
- ref: ce(c) ? r : void 0,
487
- children: c.children.map(f)
483
+ name: l.name,
484
+ position: l.position,
485
+ rotation: l.rotation,
486
+ ref: ue(l) ? r : void 0,
487
+ children: l.children.map(f)
488
488
  },
489
- c.uuid
489
+ l.uuid
490
490
  );
491
- } catch (m) {
492
- return console.warn("Error rendering node", c.name, m), null;
491
+ } catch (d) {
492
+ return console.warn("Error rendering node", l.name, d), null;
493
493
  }
494
494
  }
495
- return /* @__PURE__ */ t.jsx("group", { ...l, dispose: null, ref: a, children: f(u.scene) });
495
+ return /* @__PURE__ */ t.jsx("group", { ...i, dispose: null, ref: a, children: f(u.scene) });
496
496
  }
497
- function me({
497
+ function he({
498
498
  modelURL: e,
499
499
  flangeRef: r,
500
500
  postModelRender: n,
501
- ...l
501
+ ...i
502
502
  }) {
503
- const [o, u] = G(null);
504
- return L(() => {
503
+ const [o, u] = T(null);
504
+ return _(() => {
505
505
  (async () => {
506
506
  try {
507
507
  if (typeof e == "string")
@@ -515,28 +515,28 @@ function me({
515
515
  }
516
516
  })();
517
517
  }, [e]), o ? /* @__PURE__ */ t.jsx(
518
- ze,
518
+ Be,
519
519
  {
520
520
  url: o,
521
521
  flangeRef: r,
522
522
  postModelRender: n,
523
- ...l
523
+ ...i
524
524
  }
525
525
  ) : null;
526
526
  }
527
- const he = (e, r) => {
527
+ const pe = (e, r) => {
528
528
  e.userData.isGhost || (e.traverse((n) => {
529
529
  if (n instanceof x.Mesh) {
530
530
  n.material instanceof x.Material && (n.material.colorWrite = !1);
531
- const l = n.clone(), o = n.clone();
532
- l.material = new x.MeshStandardMaterial({
531
+ const i = n.clone(), o = n.clone();
532
+ i.material = new x.MeshStandardMaterial({
533
533
  depthTest: !0,
534
534
  depthWrite: !0,
535
535
  colorWrite: !1,
536
536
  polygonOffset: !0,
537
537
  polygonOffsetFactor: -1,
538
538
  side: x.DoubleSide
539
- }), l.userData.isGhost = !0, o.material = new x.MeshStandardMaterial({
539
+ }), i.userData.isGhost = !0, o.material = new x.MeshStandardMaterial({
540
540
  color: r,
541
541
  opacity: 0.3,
542
542
  depthTest: !0,
@@ -545,146 +545,147 @@ const he = (e, r) => {
545
545
  polygonOffset: !0,
546
546
  polygonOffsetFactor: -2,
547
547
  side: x.DoubleSide
548
- }), o.userData.isGhost = !0, n.parent && (n.parent.add(l), n.parent.add(o));
548
+ }), o.userData.isGhost = !0, n.parent && (n.parent.add(i), n.parent.add(o));
549
549
  }
550
550
  }), e.userData.isGhost = !0);
551
- }, pe = (e) => {
551
+ }, xe = (e) => {
552
552
  if (!e.userData.isGhost) return;
553
553
  const r = [];
554
554
  e.traverse((n) => {
555
- var l;
556
- n instanceof x.Mesh && ((l = n.userData) != null && l.isGhost ? r.push(n) : n.material instanceof x.Material && (n.material.colorWrite = !0));
555
+ var i;
556
+ n instanceof x.Mesh && ((i = n.userData) != null && i.isGhost ? r.push(n) : n.material instanceof x.Material && (n.material.colorWrite = !0));
557
557
  }), r.forEach((n) => {
558
558
  n.parent && n.parent.remove(n);
559
559
  }), e.userData.isGhost = !1;
560
- }, Oe = z(
560
+ }, ge = I(
561
561
  ({
562
562
  rapidlyChangingMotionState: e,
563
563
  modelFromController: r,
564
564
  dhParameters: n,
565
- getModel: l = S,
565
+ getModel: i = U,
566
566
  flangeRef: o,
567
567
  postModelRender: u,
568
568
  transparentColor: a,
569
- ...f
569
+ instanceUrl: f,
570
+ ...l
570
571
  }) => {
571
- const [c, m] = G(null), d = _((i) => {
572
- m(i);
572
+ const [d, m] = T(null), s = M((h) => {
573
+ m(h);
573
574
  }, []);
574
- L(() => {
575
- c && (a ? he(c, a) : pe(c));
576
- }, [c, a]);
577
- const s = /* @__PURE__ */ t.jsx(
578
- Ce,
575
+ _(() => {
576
+ d && (a ? pe(d, a) : xe(d));
577
+ }, [d, a]);
578
+ const c = /* @__PURE__ */ t.jsx(
579
+ ze,
579
580
  {
580
581
  rapidlyChangingMotionState: e,
581
582
  dhParameters: n,
582
- ...f
583
+ ...l
583
584
  }
584
585
  );
585
586
  return /* @__PURE__ */ t.jsxs(
586
- ae,
587
+ le,
587
588
  {
588
- fallback: s,
589
- onError: (i) => {
590
- console.warn(i);
589
+ fallback: c,
590
+ onError: (h) => {
591
+ console.warn(h);
591
592
  },
592
593
  children: [
593
- /* @__PURE__ */ t.jsx(oe, { fallback: s, children: /* @__PURE__ */ t.jsx("group", { ref: d, children: /* @__PURE__ */ t.jsx(
594
- fe,
594
+ /* @__PURE__ */ t.jsx(oe, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
595
+ de,
595
596
  {
596
597
  rapidlyChangingMotionState: e,
597
598
  dhParameters: n,
598
599
  children: /* @__PURE__ */ t.jsx(
599
- me,
600
+ he,
600
601
  {
601
602
  modelURL: (() => {
602
- const i = l(r);
603
- if (!i) {
604
- const h = new Blob([], { type: "model/gltf-binary" }), g = new File([h], `${r}.glb`, { type: "model/gltf-binary" });
605
- return Promise.resolve(URL.createObjectURL(g));
603
+ const h = i(r, f);
604
+ if (!h) {
605
+ const g = new Blob([], { type: "model/gltf-binary" }), p = new File([g], `${r}.glb`, { type: "model/gltf-binary" });
606
+ return Promise.resolve(URL.createObjectURL(p));
606
607
  }
607
- return i;
608
+ return h;
608
609
  })(),
609
610
  postModelRender: u,
610
611
  flangeRef: o,
611
- ...f
612
+ ...l
612
613
  }
613
614
  )
614
615
  }
615
616
  ) }) }),
616
- /* @__PURE__ */ t.jsx(de, {})
617
+ /* @__PURE__ */ t.jsx(me, {})
617
618
  ]
618
619
  }
619
620
  );
620
621
  }
621
622
  );
622
- function Ee({
623
+ function We({
623
624
  connectedMotionGroup: e,
624
- getModel: r = S,
625
+ getModel: r = U,
625
626
  flangeRef: n,
626
- transparentColor: l,
627
+ transparentColor: i,
627
628
  postModelRender: o,
628
629
  ...u
629
630
  }) {
630
631
  return e.dhParameters ? /* @__PURE__ */ t.jsx(
631
- Oe,
632
+ ge,
632
633
  {
633
634
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
634
635
  modelFromController: e.modelFromController || "",
635
636
  dhParameters: e.dhParameters,
636
637
  getModel: r,
637
638
  flangeRef: n,
638
- transparentColor: l,
639
+ transparentColor: i,
639
640
  postModelRender: o,
640
641
  ...u
641
642
  }
642
643
  ) : null;
643
644
  }
644
- const st = z(
645
- Me(
645
+ const it = I(
646
+ Te(
646
647
  ({
647
648
  robotName: e,
648
649
  programState: r,
649
650
  safetyState: n,
650
- operationMode: l,
651
+ operationMode: i,
651
652
  driveToHomeEnabled: o = !1,
652
653
  onDriveToHomePress: u,
653
654
  onDriveToHomeRelease: a,
654
655
  connectedMotionGroup: f,
655
- robotComponent: c = Ee,
656
- customContentComponent: m,
657
- className: d
656
+ robotComponent: l = We,
657
+ customContentComponent: d,
658
+ className: m
658
659
  }) => {
659
660
  var W;
660
- const s = Re(), { t: i } = Le(), [h, g] = G(!1), p = R(null), j = R(null), [y, C] = G(!1), [k, ye] = G({ width: 400, height: 600 }), [Je, je] = G(0);
661
- L(() => {
661
+ const s = _e(), { t: c } = Se(), [h, g] = T(!1), p = R(null), j = R(null), [y, D] = T(!1), [S, be] = T({ width: 400, height: 600 }), [$e, Re] = T(0);
662
+ _(() => {
662
663
  const P = () => {
663
664
  if (j.current) {
664
- const { offsetWidth: $, offsetHeight: H } = j.current;
665
- C($ > H), ye({ width: $, height: H });
665
+ const { offsetWidth: $, offsetHeight: J } = j.current;
666
+ D($ > J), be({ width: $, height: J });
666
667
  }
667
668
  };
668
669
  P();
669
- const J = new ResizeObserver(P);
670
- return j.current && J.observe(j.current), () => {
671
- J.disconnect();
670
+ const K = new ResizeObserver(P);
671
+ return j.current && K.observe(j.current), () => {
672
+ K.disconnect();
672
673
  };
673
674
  }, []);
674
- const E = _(() => {
675
- je((P) => P + 1);
676
- }, []), F = _(() => {
675
+ const E = M(() => {
676
+ Re((P) => P + 1);
677
+ }, []), k = M(() => {
677
678
  !o || !u || (g(!0), u());
678
- }, [o, u]), A = _(() => {
679
+ }, [o, u]), L = M(() => {
679
680
  !o || !a || (g(!1), a());
680
- }, [o, a]), B = _(() => {
681
+ }, [o, a]), B = M(() => {
681
682
  h && a && (g(!1), a());
682
- }, [h, a]), M = y ? k.width < 350 : k.height < 200, I = y ? k.height < 310 : k.height < 450;
683
+ }, [h, a]), A = y ? S.width < 350 : S.height < 200, V = y ? S.height < 310 : S.height < 450;
683
684
  return /* @__PURE__ */ t.jsx(
684
- ve,
685
+ Ae,
685
686
  {
686
687
  ref: j,
687
- className: d,
688
+ className: m,
688
689
  sx: {
689
690
  width: "100%",
690
691
  height: "100%",
@@ -717,9 +718,9 @@ const st = z(
717
718
  mr: { xs: 0.75, sm: 1, md: 1.5 },
718
719
  overflow: "hidden",
719
720
  // Prevent content from affecting container size
720
- display: M ? "none" : "block"
721
+ display: A ? "none" : "block"
721
722
  },
722
- children: !M && /* @__PURE__ */ t.jsxs(
723
+ children: !A && /* @__PURE__ */ t.jsxs(
723
724
  N,
724
725
  {
725
726
  orthographic: !0,
@@ -742,8 +743,8 @@ const st = z(
742
743
  gl: { alpha: !0, antialias: !0 },
743
744
  children: [
744
745
  /* @__PURE__ */ t.jsx(Q, {}),
745
- /* @__PURE__ */ t.jsx(Y, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
746
- c,
746
+ /* @__PURE__ */ t.jsx(H, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
747
+ l,
747
748
  {
748
749
  connectedMotionGroup: f,
749
750
  postModelRender: E
@@ -762,7 +763,7 @@ const st = z(
762
763
  display: "flex",
763
764
  flexDirection: "column",
764
765
  justifyContent: "flex-start",
765
- width: M ? "100%" : "50%"
766
+ width: A ? "100%" : "50%"
766
767
  },
767
768
  children: [
768
769
  /* @__PURE__ */ t.jsxs(
@@ -774,13 +775,13 @@ const st = z(
774
775
  textAlign: "left"
775
776
  },
776
777
  children: [
777
- /* @__PURE__ */ t.jsx(q, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
778
+ /* @__PURE__ */ t.jsx(Y, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
778
779
  /* @__PURE__ */ t.jsx(
779
780
  Z,
780
781
  {
781
782
  programState: r,
782
783
  safetyState: n,
783
- operationMode: l
784
+ operationMode: i
784
785
  }
785
786
  )
786
787
  ]
@@ -798,10 +799,10 @@ const st = z(
798
799
  justifyContent: "space-between"
799
800
  },
800
801
  children: [
801
- !I && m && /* @__PURE__ */ t.jsxs(b, { children: [
802
- /* @__PURE__ */ t.jsx(m, {}),
802
+ !V && d && /* @__PURE__ */ t.jsxs(b, { children: [
803
+ /* @__PURE__ */ t.jsx(d, {}),
803
804
  /* @__PURE__ */ t.jsx(
804
- X,
805
+ q,
805
806
  {
806
807
  sx: {
807
808
  mt: 1,
@@ -816,7 +817,7 @@ const st = z(
816
817
  b,
817
818
  {
818
819
  sx: {
819
- mt: !I && m ? "auto" : 0
820
+ mt: !V && d ? "auto" : 0
820
821
  },
821
822
  children: /* @__PURE__ */ t.jsx(
822
823
  b,
@@ -828,24 +829,24 @@ const st = z(
828
829
  mb: { xs: 0.5, sm: 0.75, md: 1 }
829
830
  },
830
831
  children: /* @__PURE__ */ t.jsx(
831
- K,
832
+ X,
832
833
  {
833
834
  ref: p,
834
835
  variant: "contained",
835
836
  color: "secondary",
836
837
  size: "small",
837
838
  disabled: !o,
838
- onMouseDown: F,
839
- onMouseUp: A,
839
+ onMouseDown: k,
840
+ onMouseUp: L,
840
841
  onMouseLeave: B,
841
- onTouchStart: F,
842
- onTouchEnd: A,
842
+ onTouchStart: k,
843
+ onTouchEnd: L,
843
844
  sx: {
844
845
  textTransform: "none",
845
846
  px: 1.5,
846
847
  py: 0.5
847
848
  },
848
- children: i("RobotCard.DriveToHome.bt")
849
+ children: c("RobotCard.DriveToHome.bt")
849
850
  }
850
851
  )
851
852
  }
@@ -869,13 +870,13 @@ const st = z(
869
870
  },
870
871
  children: [
871
872
  /* @__PURE__ */ t.jsxs(b, { children: [
872
- /* @__PURE__ */ t.jsx(q, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
873
+ /* @__PURE__ */ t.jsx(Y, { variant: "h6", component: "h2", sx: { mb: 1 }, children: e }),
873
874
  /* @__PURE__ */ t.jsx(
874
875
  Z,
875
876
  {
876
877
  programState: r,
877
878
  safetyState: n,
878
- operationMode: l
879
+ operationMode: i
879
880
  }
880
881
  )
881
882
  ] }),
@@ -883,15 +884,15 @@ const st = z(
883
884
  b,
884
885
  {
885
886
  sx: {
886
- flex: M ? 0 : 1,
887
+ flex: A ? 0 : 1,
887
888
  position: "relative",
888
- minHeight: M ? 0 : { xs: 120, sm: 150, md: 200 },
889
- height: M ? 0 : "auto",
889
+ minHeight: A ? 0 : { xs: 120, sm: 150, md: 200 },
890
+ height: A ? 0 : "auto",
890
891
  borderRadius: 1,
891
892
  overflow: "hidden",
892
- display: M ? "none" : "block"
893
+ display: A ? "none" : "block"
893
894
  },
894
- children: !M && /* @__PURE__ */ t.jsxs(
895
+ children: !A && /* @__PURE__ */ t.jsxs(
895
896
  N,
896
897
  {
897
898
  orthographic: !0,
@@ -912,8 +913,8 @@ const st = z(
912
913
  gl: { alpha: !0, antialias: !0 },
913
914
  children: [
914
915
  /* @__PURE__ */ t.jsx(Q, {}),
915
- /* @__PURE__ */ t.jsx(Y, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
916
- c,
916
+ /* @__PURE__ */ t.jsx(H, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ t.jsx(
917
+ l,
917
918
  {
918
919
  connectedMotionGroup: f,
919
920
  postModelRender: E
@@ -925,10 +926,10 @@ const st = z(
925
926
  }
926
927
  ),
927
928
  /* @__PURE__ */ t.jsxs(b, { children: [
928
- !I && m && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
929
- /* @__PURE__ */ t.jsx(m, {}),
929
+ !V && d && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
930
+ /* @__PURE__ */ t.jsx(d, {}),
930
931
  /* @__PURE__ */ t.jsx(
931
- X,
932
+ q,
932
933
  {
933
934
  sx: {
934
935
  mt: 1,
@@ -945,28 +946,28 @@ const st = z(
945
946
  sx: {
946
947
  display: "flex",
947
948
  justifyContent: "flex-start",
948
- mt: !I && m ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
949
+ mt: !V && d ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
949
950
  mb: { xs: 0.5, sm: 0.75, md: 1 }
950
951
  },
951
952
  children: /* @__PURE__ */ t.jsx(
952
- K,
953
+ X,
953
954
  {
954
955
  ref: p,
955
956
  variant: "contained",
956
957
  color: "secondary",
957
958
  size: "small",
958
959
  disabled: !o,
959
- onMouseDown: F,
960
- onMouseUp: A,
960
+ onMouseDown: k,
961
+ onMouseUp: L,
961
962
  onMouseLeave: B,
962
- onTouchStart: F,
963
- onTouchEnd: A,
963
+ onTouchStart: k,
964
+ onTouchEnd: L,
964
965
  sx: {
965
966
  textTransform: "none",
966
967
  px: 1.5,
967
968
  py: 0.5
968
969
  },
969
- children: i("RobotCard.DriveToHome.bt")
970
+ children: c("RobotCard.DriveToHome.bt")
970
971
  }
971
972
  )
972
973
  }
@@ -979,40 +980,40 @@ const st = z(
979
980
  );
980
981
  }
981
982
  )
982
- ), it = Array(6).fill(2 * Math.PI);
983
- function xe({
983
+ ), at = Array(6).fill(2 * Math.PI);
984
+ function ye({
984
985
  rapidlyChangingMotionState: e,
985
986
  dhParameters: r,
986
987
  onTranslationChanged: n,
987
- children: l
988
+ children: i
988
989
  }) {
989
990
  const o = R([]), u = R([]), a = R(null), { invalidate: f } = ne();
990
- L(() => {
991
+ _(() => {
991
992
  const s = e.joint_position.filter(
992
- (i) => i !== void 0
993
+ (c) => c !== void 0
993
994
  );
994
- return a.current = new se(s, {
995
+ return a.current = new ie(s, {
995
996
  tension: 120,
996
997
  // Controls spring stiffness - higher values create faster, more responsive motion
997
998
  friction: 20,
998
999
  // Controls damping - higher values reduce oscillation and create smoother settling
999
1000
  threshold: 1e-3
1000
1001
  }), () => {
1001
- var i;
1002
- (i = a.current) == null || i.destroy();
1002
+ var c;
1003
+ (c = a.current) == null || c.destroy();
1003
1004
  };
1004
- }, []), re((s, i) => {
1005
+ }, []), re((s, c) => {
1005
1006
  if (a.current) {
1006
- const h = a.current.update(i);
1007
- m(), h || f();
1007
+ const h = a.current.update(c);
1008
+ d(), h || f();
1008
1009
  }
1009
1010
  });
1010
- function c(s) {
1011
- s && (u.current = le(s), m(), f());
1011
+ function l(s) {
1012
+ s && (u.current = ce(s), d(), f());
1012
1013
  }
1013
- function m() {
1014
- var i;
1015
- const s = ((i = a.current) == null ? void 0 : i.getCurrentValues()) || [];
1014
+ function d() {
1015
+ var c;
1016
+ const s = ((c = a.current) == null ? void 0 : c.getCurrentValues()) || [];
1016
1017
  if (n)
1017
1018
  n(u.current, s);
1018
1019
  else
@@ -1021,68 +1022,68 @@ function xe({
1021
1022
  g.position.y = j * (s[h] || 0) / 1e3;
1022
1023
  }
1023
1024
  }
1024
- const d = _(() => {
1025
+ const m = M(() => {
1025
1026
  const s = e.joint_position.filter(
1026
- (i) => i !== void 0
1027
+ (c) => c !== void 0
1027
1028
  );
1028
1029
  requestAnimationFrame(() => {
1029
- var i;
1030
- o.current = s, (i = a.current) == null || i.setTarget(s);
1030
+ var c;
1031
+ o.current = s, (c = a.current) == null || c.setTarget(s);
1031
1032
  });
1032
1033
  }, [e]);
1033
- return L(() => {
1034
- d();
1035
- }, [e, d]), ie(() => {
1036
- d();
1037
- }), /* @__PURE__ */ t.jsx("group", { ref: c, children: l });
1034
+ return _(() => {
1035
+ m();
1036
+ }, [e, m]), ae(() => {
1037
+ m();
1038
+ }), /* @__PURE__ */ t.jsx("group", { ref: l, children: i });
1038
1039
  }
1039
- function ge({
1040
+ function je({
1040
1041
  rapidlyChangingMotionState: e,
1041
1042
  dhParameters: r,
1042
1043
  ...n
1043
1044
  }) {
1044
- const l = new w(), o = R(null), u = R(null);
1045
- function a(m) {
1046
- const d = new w();
1045
+ const i = new w(), o = R(null), u = R(null);
1046
+ function a(d) {
1047
+ const m = new w();
1047
1048
  for (let g = 0; g < r.length; g++) {
1048
- const p = r[g], j = m[g] ?? 0, y = new w().makeRotationY(p.theta).multiply(
1049
+ const p = r[g], j = d[g] ?? 0, y = new w().makeRotationY(p.theta).multiply(
1049
1050
  new w().makeTranslation(
1050
1051
  p.a / 1e3,
1051
1052
  (p.d + j * (p.reverse_rotation_direction ? -1 : 1)) / 1e3,
1052
1053
  0
1053
1054
  )
1054
1055
  ).multiply(new w().makeRotationX(p.alpha));
1055
- d.multiply(y);
1056
+ m.multiply(y);
1056
1057
  }
1057
- const s = new T(), i = new U(), h = new T();
1058
- return d.decompose(s, i, h), s;
1058
+ const s = new F(), c = new z(), h = new F();
1059
+ return m.decompose(s, c, h), s;
1059
1060
  }
1060
1061
  const f = a(e.joint_position);
1061
- function c(m, d) {
1062
- l.identity();
1063
- let s = new T();
1062
+ function l(d, m) {
1063
+ i.identity();
1064
+ let s = new F();
1064
1065
  for (let p = 0; p < r.length; p++) {
1065
- const j = d[p] ?? 0, y = r[p], C = new w().makeRotationY(y.theta).multiply(
1066
+ const j = m[p] ?? 0, y = r[p], D = new w().makeRotationY(y.theta).multiply(
1066
1067
  new w().makeTranslation(
1067
1068
  y.a / 1e3,
1068
1069
  (y.d + j * (y.reverse_rotation_direction ? -1 : 1)) / 1e3,
1069
1070
  0
1070
1071
  )
1071
1072
  ).multiply(new w().makeRotationX(y.alpha));
1072
- l.multiply(C);
1073
+ i.multiply(D);
1073
1074
  }
1074
- const i = new T(), h = new U(), g = new T();
1075
- if (l.decompose(i, h, g), s = i, o.current && o.current.position.set(s.x, s.y, s.z), u.current) {
1075
+ const c = new F(), h = new z(), g = new F();
1076
+ if (i.decompose(c, h, g), s = c, o.current && o.current.position.set(s.x, s.y, s.z), u.current) {
1076
1077
  const p = u.current.geometry;
1077
1078
  p && p.setPositions && p.setPositions([0, 0, 0, s.x, s.y, s.z]);
1078
1079
  }
1079
1080
  }
1080
1081
  return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsx(
1081
- xe,
1082
+ ye,
1082
1083
  {
1083
1084
  rapidlyChangingMotionState: e,
1084
1085
  dhParameters: r,
1085
- onTranslationChanged: c,
1086
+ onTranslationChanged: l,
1086
1087
  children: /* @__PURE__ */ t.jsxs("group", { ...n, name: "Scene", children: [
1087
1088
  /* @__PURE__ */ t.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
1088
1089
  /* @__PURE__ */ t.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
@@ -1092,7 +1093,7 @@ function ge({
1092
1093
  O,
1093
1094
  {
1094
1095
  ref: u,
1095
- points: [new T(0, 0, 0), f],
1096
+ points: [new F(0, 0, 0), f],
1096
1097
  color: "White",
1097
1098
  lineWidth: 5
1098
1099
  }
@@ -1105,73 +1106,74 @@ function ge({
1105
1106
  }
1106
1107
  ) });
1107
1108
  }
1108
- const Be = z(
1109
+ const we = I(
1109
1110
  ({
1110
1111
  rapidlyChangingMotionState: e,
1111
1112
  modelFromController: r,
1112
1113
  dhParameters: n,
1113
- getModel: l = S,
1114
+ getModel: i = U,
1114
1115
  flangeRef: o,
1115
1116
  postModelRender: u,
1116
1117
  transparentColor: a,
1117
- ...f
1118
+ instanceUrl: f,
1119
+ ...l
1118
1120
  }) => {
1119
- const [c, m] = G(null), d = _((i) => {
1120
- m(i);
1121
+ const [d, m] = T(null), s = M((h) => {
1122
+ m(h);
1121
1123
  }, []);
1122
- L(() => {
1123
- c && (a ? he(c, a) : pe(c));
1124
- }, [c, a]);
1125
- const s = /* @__PURE__ */ t.jsx(
1126
- ge,
1124
+ _(() => {
1125
+ d && (a ? pe(d, a) : xe(d));
1126
+ }, [d, a]);
1127
+ const c = /* @__PURE__ */ t.jsx(
1128
+ je,
1127
1129
  {
1128
1130
  rapidlyChangingMotionState: e,
1129
1131
  dhParameters: n,
1130
- ...f
1132
+ ...l
1131
1133
  }
1132
1134
  );
1133
1135
  return /* @__PURE__ */ t.jsxs(
1134
- ae,
1136
+ le,
1135
1137
  {
1136
- fallback: s,
1137
- onError: (i) => {
1138
- console.warn(i);
1138
+ fallback: c,
1139
+ onError: (h) => {
1140
+ console.warn(h);
1139
1141
  },
1140
1142
  children: [
1141
- /* @__PURE__ */ t.jsx(oe, { fallback: s, children: /* @__PURE__ */ t.jsx("group", { ref: d, children: /* @__PURE__ */ t.jsx(
1142
- xe,
1143
+ /* @__PURE__ */ t.jsx(oe, { fallback: c, children: /* @__PURE__ */ t.jsx("group", { ref: s, children: /* @__PURE__ */ t.jsx(
1144
+ ye,
1143
1145
  {
1144
1146
  rapidlyChangingMotionState: e,
1145
1147
  dhParameters: n,
1146
1148
  children: /* @__PURE__ */ t.jsx(
1147
- me,
1149
+ he,
1148
1150
  {
1149
1151
  modelURL: (() => {
1150
- const i = l(r);
1151
- if (!i) {
1152
- const h = new Blob([], { type: "model/gltf-binary" }), g = new File([h], `${r}.glb`, { type: "model/gltf-binary" });
1153
- return Promise.resolve(URL.createObjectURL(g));
1152
+ const h = i(r, f);
1153
+ if (!h) {
1154
+ const g = new Blob([], { type: "model/gltf-binary" }), p = new File([g], `${r}.glb`, { type: "model/gltf-binary" });
1155
+ return Promise.resolve(URL.createObjectURL(p));
1154
1156
  }
1155
- return i;
1157
+ return h;
1156
1158
  })(),
1157
1159
  postModelRender: u,
1158
1160
  flangeRef: o,
1159
- ...f
1161
+ ...l
1160
1162
  }
1161
1163
  )
1162
1164
  }
1163
1165
  ) }) }),
1164
- /* @__PURE__ */ t.jsx(de, {})
1166
+ /* @__PURE__ */ t.jsx(me, {})
1165
1167
  ]
1166
1168
  }
1167
1169
  );
1168
1170
  }
1169
1171
  );
1170
- function at({
1172
+ function lt({
1171
1173
  connectedMotionGroup: e,
1172
- getModel: r = S,
1174
+ getModel: r = U,
1173
1175
  flangeRef: n,
1174
- transparentColor: l,
1176
+ transparentColor: i,
1175
1177
  postModelRender: o,
1176
1178
  ...u
1177
1179
  }) {
@@ -1179,19 +1181,19 @@ function at({
1179
1181
  return null;
1180
1182
  const a = e.modelFromController || "";
1181
1183
  return a && r(a) ? /* @__PURE__ */ t.jsx(
1182
- Be,
1184
+ we,
1183
1185
  {
1184
1186
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1185
1187
  modelFromController: a,
1186
1188
  dhParameters: e.dhParameters,
1187
1189
  getModel: r,
1188
1190
  flangeRef: n,
1189
- transparentColor: l,
1191
+ transparentColor: i,
1190
1192
  postModelRender: o,
1191
1193
  ...u
1192
1194
  }
1193
1195
  ) : /* @__PURE__ */ t.jsx(
1194
- ge,
1196
+ je,
1195
1197
  {
1196
1198
  rapidlyChangingMotionState: e.rapidlyChangingMotionState,
1197
1199
  dhParameters: e.dhParameters,
@@ -1222,7 +1224,7 @@ const ee = {
1222
1224
  0
1223
1225
  ]
1224
1226
  };
1225
- function We(e) {
1227
+ function Ke(e) {
1226
1228
  const [r] = e.split("_");
1227
1229
  switch (r) {
1228
1230
  case "ABB":
@@ -1239,24 +1241,74 @@ function We(e) {
1239
1241
  return null;
1240
1242
  }
1241
1243
  }
1242
- function lt(e, r) {
1243
- const n = We(e);
1244
+ function ct(e, r) {
1245
+ const n = Ke(e);
1244
1246
  return n && n in ee ? ee[n] : r || null;
1245
1247
  }
1248
+ const ut = I((e) => {
1249
+ const {
1250
+ instanceUrl: r,
1251
+ inverseSolver: n,
1252
+ modelFromController: i,
1253
+ ...o
1254
+ } = e, [u, a] = T(
1255
+ n
1256
+ ), [, f] = T(!1), l = M(async () => {
1257
+ const m = new se({ instanceUrl: r });
1258
+ try {
1259
+ const s = await m.api.motionGroupModels.getMotionGroupKinematicModel(
1260
+ i
1261
+ );
1262
+ a(s.inverse_solver);
1263
+ } catch {
1264
+ console.warn(
1265
+ `Failed to fetch kinematic model from API for ${i}, falling back to local config`
1266
+ );
1267
+ } finally {
1268
+ setTimeout(() => f(!0), 0);
1269
+ }
1270
+ }, [i, r]);
1271
+ _(() => {
1272
+ n === void 0 && !!i && !!r && l();
1273
+ }, [n, i, l, r]);
1274
+ const d = Ge(() => [
1275
+ "KUKA_DKP250",
1276
+ "KUKA_DKP500_2",
1277
+ "YASKAWA_TURN1",
1278
+ "YASKAWA_TURN2",
1279
+ "YASKAWA_TURN3"
1280
+ ].includes(i), [i]);
1281
+ return u || d ? /* @__PURE__ */ t.jsx(
1282
+ ge,
1283
+ {
1284
+ instanceUrl: r,
1285
+ modelFromController: i,
1286
+ ...o
1287
+ }
1288
+ ) : u === null ? /* @__PURE__ */ t.jsx(
1289
+ we,
1290
+ {
1291
+ instanceUrl: r,
1292
+ modelFromController: i,
1293
+ ...o
1294
+ }
1295
+ ) : null;
1296
+ });
1246
1297
  export {
1247
- nt as C,
1248
- at as L,
1298
+ rt as C,
1299
+ lt as L,
1249
1300
  ee as M,
1250
1301
  Q as P,
1251
- Ee as R,
1252
- rt as S,
1253
- ot as T,
1254
- st as a,
1255
- Be as b,
1256
- Oe as c,
1257
- it as d,
1258
- S as e,
1259
- We as f,
1260
- lt as g
1302
+ We as R,
1303
+ ot as S,
1304
+ st as T,
1305
+ ut as a,
1306
+ it as b,
1307
+ we as c,
1308
+ ge as d,
1309
+ at as e,
1310
+ U as f,
1311
+ Ke as g,
1312
+ ct as h
1261
1313
  };
1262
- //# sourceMappingURL=manufacturerHomePositions-DAaWLJKB.js.map
1314
+ //# sourceMappingURL=MotionGroupVisualizer-CrLamHYm.js.map