@wandelbots/wandelbots-js-react-components 4.7.1 → 4.7.2-pr.feat-RB-3348-remove-v1-usage.553.eede090

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 (88) hide show
  1. package/README.md +0 -21
  2. package/dist/3d.cjs.js +1 -1
  3. package/dist/3d.es.js +1 -1
  4. package/dist/{MotionGroupVisualizer-7Mw9PINy.js → MotionGroupVisualizer--j-KhrNT.js} +529 -567
  5. package/dist/MotionGroupVisualizer--j-KhrNT.js.map +1 -0
  6. package/dist/MotionGroupVisualizer-TrHq4Etp.cjs +2 -0
  7. package/dist/MotionGroupVisualizer-TrHq4Etp.cjs.map +1 -0
  8. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +1 -1
  9. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts.map +1 -1
  10. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +1 -2
  11. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
  12. package/dist/components/3d-viewport/TrajectoryRenderer.d.ts +2 -2
  13. package/dist/components/3d-viewport/TrajectoryRenderer.d.ts.map +1 -1
  14. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts +1 -1
  15. package/dist/components/3d-viewport/collider/ColliderElement.d.ts +1 -1
  16. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts +2 -2
  17. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts.map +1 -1
  18. package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts +1 -1
  19. package/dist/core.cjs.js +1 -1
  20. package/dist/core.es.js +37 -39
  21. package/dist/core.es.js.map +1 -1
  22. package/dist/index.cjs.js +1 -1
  23. package/dist/index.d.ts +0 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.es.js +51 -55
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/interpolation-7jeNXp6c.cjs +42 -0
  28. package/dist/interpolation-7jeNXp6c.cjs.map +1 -0
  29. package/dist/{interpolation-B8AcxfdD.js → interpolation-DbcWWD5r.js} +3635 -3115
  30. package/dist/interpolation-DbcWWD5r.js.map +1 -0
  31. package/dist/lib/ConnectedMotionGroup.d.ts +0 -1
  32. package/dist/lib/ConnectedMotionGroup.d.ts.map +1 -1
  33. package/dist/lib/MotionStreamConnection.d.ts +0 -1
  34. package/dist/lib/MotionStreamConnection.d.ts.map +1 -1
  35. package/dist/themes/createDarkTheme.d.ts.map +1 -1
  36. package/dist/themes/themeTypes.d.ts +0 -4
  37. package/dist/themes/themeTypes.d.ts.map +1 -1
  38. package/dist/{theming-BKpqgTRM.js → theming-CljdqiO8.js} +2745 -2703
  39. package/dist/theming-CljdqiO8.js.map +1 -0
  40. package/dist/theming-DgOebzEE.cjs +115 -0
  41. package/dist/theming-DgOebzEE.cjs.map +1 -0
  42. package/package.json +1 -6
  43. package/src/components/3d-viewport/CoordinateSystemTransform.tsx +29 -18
  44. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +12 -95
  45. package/src/components/3d-viewport/TrajectoryRenderer.tsx +11 -11
  46. package/src/components/3d-viewport/collider/ColliderCollection.tsx +1 -1
  47. package/src/components/3d-viewport/collider/ColliderElement.tsx +1 -1
  48. package/src/components/3d-viewport/collider/CollisionSceneRenderer.tsx +2 -2
  49. package/src/components/3d-viewport/collider/colliderShapeToBufferGeometry.ts +1 -1
  50. package/src/index.ts +0 -1
  51. package/src/lib/ConnectedMotionGroup.ts +0 -5
  52. package/src/lib/MotionStreamConnection.ts +0 -5
  53. package/src/themes/createDarkTheme.ts +1 -22
  54. package/src/themes/themeTypes.ts +0 -3
  55. package/dist/LoadingCover-B3UN1lnU.js +0 -81
  56. package/dist/LoadingCover-B3UN1lnU.js.map +0 -1
  57. package/dist/LoadingCover-DXcsXWDy.cjs +0 -2
  58. package/dist/LoadingCover-DXcsXWDy.cjs.map +0 -1
  59. package/dist/MotionGroupVisualizer-7Mw9PINy.js.map +0 -1
  60. package/dist/MotionGroupVisualizer-C0ll-LQF.cjs +0 -2
  61. package/dist/MotionGroupVisualizer-C0ll-LQF.cjs.map +0 -1
  62. package/dist/WandelscriptEditor-6sAoniLC.cjs +0 -2
  63. package/dist/WandelscriptEditor-6sAoniLC.cjs.map +0 -1
  64. package/dist/WandelscriptEditor-kWC2VyG_.js +0 -140
  65. package/dist/WandelscriptEditor-kWC2VyG_.js.map +0 -1
  66. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts +0 -16
  67. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts.map +0 -1
  68. package/dist/components/wandelscript-editor/wandelscript.tmLanguage.d.ts +0 -45
  69. package/dist/components/wandelscript-editor/wandelscript.tmLanguage.d.ts.map +0 -1
  70. package/dist/externalizeComponent-B98tgTPP.cjs +0 -24
  71. package/dist/externalizeComponent-B98tgTPP.cjs.map +0 -1
  72. package/dist/externalizeComponent-BOqKMZMc.js +0 -526
  73. package/dist/externalizeComponent-BOqKMZMc.js.map +0 -1
  74. package/dist/interpolation-B8AcxfdD.js.map +0 -1
  75. package/dist/interpolation-SWzo5zr4.cjs +0 -20
  76. package/dist/interpolation-SWzo5zr4.cjs.map +0 -1
  77. package/dist/theming-BKpqgTRM.js.map +0 -1
  78. package/dist/theming-CatQaIl_.cjs +0 -115
  79. package/dist/theming-CatQaIl_.cjs.map +0 -1
  80. package/dist/wandelscript.cjs.js +0 -2
  81. package/dist/wandelscript.cjs.js.map +0 -1
  82. package/dist/wandelscript.d.ts +0 -2
  83. package/dist/wandelscript.d.ts.map +0 -1
  84. package/dist/wandelscript.es.js +0 -5
  85. package/dist/wandelscript.es.js.map +0 -1
  86. package/src/components/wandelscript-editor/WandelscriptEditor.tsx +0 -142
  87. package/src/components/wandelscript-editor/wandelscript.tmLanguage.ts +0 -62
  88. package/src/wandelscript.ts +0 -2
@@ -1,19 +1,18 @@
1
- import { j as e, d as Te, v as Z, o as Se, e as U } from "./externalizeComponent-BOqKMZMc.js";
1
+ import { j as e, g as Me, v as _e, o as Te, N as ke, V as ne, c as se, h as U, b as X, M as v, J as O } from "./interpolation-DbcWWD5r.js";
2
2
  import * as g from "three";
3
- import { Matrix4 as R, Vector3 as k, Quaternion as B } from "three";
4
- import { ConvexGeometry as W, RoundedBoxGeometry as Ge } from "three-stdlib";
5
- import ke, { useEffect as M, useMemo as C, useRef as _, useCallback as G, useState as A, Suspense as ae } from "react";
6
- import { useThree as le, useFrame as ce, Canvas as z } from "@react-three/fiber";
7
- import { Environment as Ae, Lightformer as L, Line as $, useGLTF as Le, Bounds as ee } from "@react-three/drei";
8
- import { useTheme as Fe, Card as Pe, Box as v, Typography as te, Divider as re, Button as ne } from "@mui/material";
9
- import { observer as Ve } from "mobx-react-lite";
10
- import { useTranslation as Ie } from "react-i18next";
11
- import { N as De, V as ue, c as pe, b as se, M as T, J as O } from "./interpolation-B8AcxfdD.js";
12
- import { ErrorBoundary as de } from "react-error-boundary";
3
+ import { Matrix4 as w, Vector3 as k, Quaternion as J } from "three";
4
+ import { ConvexGeometry as oe, RoundedBoxGeometry as Ge } from "three-stdlib";
5
+ import Le, { useMemo as V, useRef as R, useEffect as M, useCallback as T, useState as G, Suspense as ie } from "react";
6
+ import { useThree as ae, useFrame as le, Canvas as K } from "@react-three/fiber";
7
+ import { Environment as Se, Lightformer as S, Line as B, useGLTF as Fe, Bounds as Z } from "@react-three/drei";
8
+ import { useTheme as Pe, Card as Ae, Box as b, Typography as Q, Divider as z, Button as ee } from "@mui/material";
9
+ import { observer as Ie } from "mobx-react-lite";
10
+ import { useTranslation as De } from "react-i18next";
11
+ import { ErrorBoundary as ce } from "react-error-boundary";
13
12
  function Oe(t) {
14
13
  switch (t.shape_type) {
15
14
  case "convex_hull":
16
- return new W(
15
+ return new oe(
17
16
  t.vertices.map(
18
17
  (r) => new g.Vector3(
19
18
  r[0] / 1e3,
@@ -47,64 +46,64 @@ function Oe(t) {
47
46
  return console.warn(`${t.shape_type} is not supported`), new g.BufferGeometry();
48
47
  }
49
48
  }
50
- function Ce({
49
+ function Ve({
51
50
  name: t,
52
- collider: n,
51
+ collider: s,
53
52
  children: r
54
53
  }) {
55
- var f, u;
56
- const l = ((f = n.pose) == null ? void 0 : f.position) ?? [0, 0, 0], s = ((u = n.pose) == null ? void 0 : u.orientation) ?? [0, 0, 0];
57
- return n.margin && console.warn(`${t} margin is not supported`), /* @__PURE__ */ e.jsx(
54
+ var u, c;
55
+ const a = ((u = s.pose) == null ? void 0 : u.position) ?? [0, 0, 0], i = ((c = s.pose) == null ? void 0 : c.orientation) ?? [0, 0, 0];
56
+ return s.margin && console.warn(`${t} margin is not supported`), /* @__PURE__ */ e.jsx(
58
57
  "mesh",
59
58
  {
60
59
  name: t,
61
60
  position: new g.Vector3(
62
- l[0],
63
- l[1],
64
- l[2]
61
+ a[0],
62
+ a[1],
63
+ a[2]
65
64
  ).divideScalar(1e3),
66
- rotation: new g.Euler(s[0], s[1], s[2], "XYZ"),
67
- geometry: Oe(n.shape),
65
+ rotation: new g.Euler(i[0], i[1], i[2], "XYZ"),
66
+ geometry: Oe(s.shape),
68
67
  children: r
69
68
  }
70
69
  );
71
70
  }
72
71
  function Ue({
73
72
  name: t,
74
- colliders: n,
73
+ colliders: s,
75
74
  meshChildrenProvider: r,
76
- ...l
75
+ ...a
77
76
  }) {
78
- return /* @__PURE__ */ e.jsx("group", { name: t, ...l, children: Object.entries(n).map(([s, f]) => /* @__PURE__ */ e.jsx(
79
- Ce,
77
+ return /* @__PURE__ */ e.jsx("group", { name: t, ...a, children: Object.entries(s).map(([i, u]) => /* @__PURE__ */ e.jsx(
78
+ Ve,
80
79
  {
81
- name: s,
82
- collider: f,
83
- children: r(s, f)
80
+ name: i,
81
+ collider: u,
82
+ children: r(i, u)
84
83
  },
85
- s
84
+ i
86
85
  )) });
87
86
  }
88
- function at({
87
+ function it({
89
88
  scene: t,
90
- meshChildrenProvider: n
89
+ meshChildrenProvider: s
91
90
  }) {
92
91
  const r = t.colliders;
93
92
  return /* @__PURE__ */ e.jsx("group", { children: r && /* @__PURE__ */ e.jsx(
94
93
  Ue,
95
94
  {
96
- meshChildrenProvider: n,
95
+ meshChildrenProvider: s,
97
96
  colliders: r
98
97
  }
99
98
  ) });
100
99
  }
101
- function oe() {
102
- return /* @__PURE__ */ e.jsx(Ae, { children: /* @__PURE__ */ e.jsx(Ee, {}) });
100
+ function te() {
101
+ return /* @__PURE__ */ e.jsx(Se, { children: /* @__PURE__ */ e.jsx(Ce, {}) });
103
102
  }
104
- function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
103
+ function Ce({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
105
104
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
106
105
  /* @__PURE__ */ e.jsx(
107
- L,
106
+ S,
108
107
  {
109
108
  intensity: 5,
110
109
  "rotation-x": Math.PI / 2,
@@ -112,19 +111,19 @@ function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
112
111
  scale: [10, 10, 1]
113
112
  }
114
113
  ),
115
- /* @__PURE__ */ e.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ e.jsx("group", { children: t.map((n, r) => /* @__PURE__ */ e.jsx(
116
- L,
114
+ /* @__PURE__ */ e.jsx("group", { rotation: [0, 0.5, 0], children: /* @__PURE__ */ e.jsx("group", { children: t.map((s, r) => /* @__PURE__ */ e.jsx(
115
+ S,
117
116
  {
118
117
  form: "circle",
119
118
  intensity: 5,
120
119
  rotation: [Math.PI / 2, 0, 0],
121
- position: [n, 4, r * 4],
120
+ position: [s, 4, r * 4],
122
121
  scale: [3, 1, 1]
123
122
  },
124
123
  r
125
124
  )) }) }),
126
125
  /* @__PURE__ */ e.jsx(
127
- L,
126
+ S,
128
127
  {
129
128
  intensity: 40,
130
129
  "rotation-y": Math.PI / 2,
@@ -133,7 +132,7 @@ function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
133
132
  }
134
133
  ),
135
134
  /* @__PURE__ */ e.jsx(
136
- L,
135
+ S,
137
136
  {
138
137
  intensity: 20,
139
138
  "rotation-y": -Math.PI,
@@ -142,7 +141,7 @@ function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
142
141
  }
143
142
  ),
144
143
  /* @__PURE__ */ e.jsx(
145
- L,
144
+ S,
146
145
  {
147
146
  "rotation-y": Math.PI / 2,
148
147
  position: [-5, -1, -1],
@@ -151,7 +150,7 @@ function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
151
150
  }
152
151
  ),
153
152
  /* @__PURE__ */ e.jsx(
154
- L,
153
+ S,
155
154
  {
156
155
  "rotation-y": -Math.PI / 2,
157
156
  position: [10, 1, 0],
@@ -160,7 +159,7 @@ function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
160
159
  }
161
160
  ),
162
161
  /* @__PURE__ */ e.jsx(
163
- L,
162
+ S,
164
163
  {
165
164
  form: "ring",
166
165
  color: "white",
@@ -172,12 +171,12 @@ function Ee({ positions: t = [2, 0, 2, 0, 2, 0, 2, 0] }) {
172
171
  )
173
172
  ] });
174
173
  }
175
- function lt({
174
+ function at({
176
175
  safetyZones: t,
177
- dhParameters: n,
176
+ dhParameters: s,
178
177
  ...r
179
178
  }) {
180
- const l = {
179
+ const a = {
181
180
  attach: "material",
182
181
  color: "#009f4d",
183
182
  opacity: 0.2,
@@ -185,38 +184,34 @@ function lt({
185
184
  depthWrite: !1,
186
185
  transparent: !0,
187
186
  polygonOffset: !0
188
- }, s = Te(n ?? []);
189
- M(() => {
190
- Array.isArray(t) && console.warn("SafetyZonesRenderer: The support of V1 safety zones is deprecated. Please migrate to V2 safety zones.");
191
- }, [t]);
192
- const f = (p, i) => {
193
- var m, j;
194
- if (!((m = i == null ? void 0 : i.pose) != null && m.position) || !((j = i == null ? void 0 : i.pose) != null && j.orientation))
187
+ }, i = Me(s ?? []), u = (h, n) => {
188
+ var d, x;
189
+ if (!((d = n == null ? void 0 : n.pose) != null && d.position) || !((x = n == null ? void 0 : n.pose) != null && x.orientation))
195
190
  return null;
196
- const o = new g.Vector3(i.pose.position[0] / 1e3, i.pose.position[1] / 1e3, i.pose.position[2] / 1e3), a = new g.Vector3(i.pose.orientation[0], i.pose.orientation[1], i.pose.orientation[2]);
197
- let c;
198
- const y = i.shape.shape_type === "plane" ? { ...l, side: g.DoubleSide } : { ...l, side: g.FrontSide };
199
- switch (i.shape.shape_type) {
191
+ const f = new g.Vector3(n.pose.position[0] / 1e3, n.pose.position[1] / 1e3, n.pose.position[2] / 1e3), m = new g.Vector3(n.pose.orientation[0], n.pose.orientation[1], n.pose.orientation[2]);
192
+ let o;
193
+ const l = n.shape.shape_type === "plane" ? { ...a, side: g.DoubleSide } : { ...a, side: g.FrontSide };
194
+ switch (n.shape.shape_type) {
200
195
  /**
201
196
  * Plane shape, uses DH parameters to calculate the size of the plane (reach distance of a robot)
202
197
  */
203
198
  case "plane":
204
- c = /* @__PURE__ */ e.jsx("planeGeometry", { args: [s, s] });
199
+ o = /* @__PURE__ */ e.jsx("planeGeometry", { args: [i, i] });
205
200
  break;
206
201
  /**
207
202
  * Sphere shape
208
203
  */
209
204
  case "sphere": {
210
- const x = (i == null ? void 0 : i.shape).radius / 1e3;
211
- c = /* @__PURE__ */ e.jsx("sphereGeometry", { args: [x] });
205
+ const p = (n == null ? void 0 : n.shape).radius / 1e3;
206
+ o = /* @__PURE__ */ e.jsx("sphereGeometry", { args: [p] });
212
207
  break;
213
208
  }
214
209
  /**
215
210
  * Capsule shape
216
211
  */
217
212
  case "capsule": {
218
- const x = (i == null ? void 0 : i.shape).radius / 1e3, w = (i == null ? void 0 : i.shape).cylinder_height / 1e3;
219
- c = /* @__PURE__ */ e.jsx("capsuleGeometry", { args: [x, w] });
213
+ const p = (n == null ? void 0 : n.shape).radius / 1e3, j = (n == null ? void 0 : n.shape).cylinder_height / 1e3;
214
+ o = /* @__PURE__ */ e.jsx("capsuleGeometry", { args: [p, j] });
220
215
  break;
221
216
  }
222
217
  /**
@@ -224,20 +219,20 @@ function lt({
224
219
  * renderer to be able to visualize the convex hull.
225
220
  */
226
221
  case "convex_hull": {
227
- const x = (i == null ? void 0 : i.shape).vertices.map(
228
- (b) => new g.Vector3(b[0] / 1e3, b[1] / 1e3, b[2] / 1e3)
229
- ), w = Z(x);
230
- if (w.isCoplanar && w.normal) {
231
- const F = new g.Vector3().addVectors(
232
- x[0],
233
- w.normal.multiplyScalar(1e-4)
222
+ const p = (n == null ? void 0 : n.shape).vertices.map(
223
+ (y) => new g.Vector3(y[0] / 1e3, y[1] / 1e3, y[2] / 1e3)
224
+ ), j = _e(p);
225
+ if (j.isCoplanar && j.normal) {
226
+ const L = new g.Vector3().addVectors(
227
+ p[0],
228
+ j.normal.multiplyScalar(1e-4)
234
229
  );
235
- x.push(F);
230
+ p.push(L);
236
231
  }
237
232
  try {
238
- c = /* @__PURE__ */ e.jsx("primitive", { object: new W(x), attach: "geometry" });
239
- } catch (b) {
240
- return console.log("Error creating ConvexGeometry:", b), null;
233
+ o = /* @__PURE__ */ e.jsx("primitive", { object: new oe(p), attach: "geometry" });
234
+ } catch (y) {
235
+ return console.log("Error creating ConvexGeometry:", y), null;
241
236
  }
242
237
  break;
243
238
  }
@@ -249,82 +244,49 @@ function lt({
249
244
  * Basically a rounded box with a rectangular cross-section.
250
245
  */
251
246
  case "rectangular_capsule": {
252
- const x = i.shape, w = x.radius / 1e3, b = x.sphere_center_distance_x / 1e3, F = x.sphere_center_distance_y / 1e3, H = w * 2;
253
- c = /* @__PURE__ */ e.jsx("primitive", { object: new Ge(b, F, H, 2, w), attach: "geometry" });
247
+ const p = n.shape, j = p.radius / 1e3, y = p.sphere_center_distance_x / 1e3, L = p.sphere_center_distance_y / 1e3, F = j * 2;
248
+ o = /* @__PURE__ */ e.jsx(
249
+ "primitive",
250
+ {
251
+ object: new Ge(y, L, F, 2, j),
252
+ attach: "geometry"
253
+ }
254
+ );
254
255
  break;
255
256
  }
256
257
  default:
257
- console.warn("Unsupported safety zone shape type:", i.shape.shape_type), c = null;
258
+ console.warn("Unsupported safety zone shape type:", n.shape.shape_type), o = null;
258
259
  }
259
260
  return /* @__PURE__ */ e.jsxs(
260
261
  "mesh",
261
262
  {
262
- renderOrder: p,
263
- position: o,
264
- quaternion: Se(a),
263
+ renderOrder: h,
264
+ position: f,
265
+ quaternion: Te(m),
265
266
  children: [
266
- c,
267
- /* @__PURE__ */ e.jsx(
268
- "meshStandardMaterial",
269
- {
270
- ...y,
271
- polygonOffsetFactor: -p
272
- }
273
- )
267
+ o,
268
+ /* @__PURE__ */ e.jsx("meshStandardMaterial", { ...l, polygonOffsetFactor: -h })
274
269
  ]
275
270
  },
276
- `safety-zone-${i.shape.shape_type}-${p}`
271
+ `safety-zone-${n.shape.shape_type}-${h}`
277
272
  );
278
- }, u = () => Object.values(t ?? {}).map((p, i) => f(i, p)), h = () => Array.isArray(t) ? t.map((p, i) => {
279
- let o = [];
280
- return p.geometry && (p.geometry.compound ? o = p.geometry.compound.child_geometries : p.geometry.convex_hull && (o = [p.geometry])), o.map((a, c) => {
281
- if (!a.convex_hull) return null;
282
- const y = a.convex_hull.vertices.map(
283
- (x) => new g.Vector3(x.x / 1e3, x.y / 1e3, x.z / 1e3)
284
- ), m = Z(y);
285
- if (m.isCoplanar && m.normal) {
286
- const w = new g.Vector3().addVectors(
287
- y[0],
288
- m.normal.multiplyScalar(1e-4)
289
- );
290
- y.push(w);
291
- }
292
- let j;
293
- try {
294
- j = new W(y);
295
- } catch (x) {
296
- return console.log("Error creating ConvexGeometry:", x), null;
297
- }
298
- return /* @__PURE__ */ e.jsx("mesh", { geometry: j, children: /* @__PURE__ */ e.jsx(
299
- "meshStandardMaterial",
300
- {
301
- attach: "material",
302
- color: "#009f4d",
303
- opacity: 0.2,
304
- depthTest: !1,
305
- depthWrite: !1,
306
- transparent: !0,
307
- polygonOffset: !0,
308
- polygonOffsetFactor: -c
309
- },
310
- i
311
- ) }, `${i}-${c}`);
312
- });
313
- }) : null, d = C(() => Array.isArray(t) ? h() : u(), [t, h, u]);
314
- return /* @__PURE__ */ e.jsx("group", { ...r, children: d });
273
+ }, c = V(() => Object.values(t ?? {}).map((h, n) => u(n, h)), [t]);
274
+ return /* @__PURE__ */ e.jsx("group", { ...r, children: c });
315
275
  }
316
- function ct({
276
+ function lt({
317
277
  trajectory: t,
318
- ...n
278
+ ...s
319
279
  }) {
320
- var l;
321
- const r = ((l = t.trajectory) == null ? void 0 : l.map((s) => s.tcp_pose ? new g.Vector3(
322
- s.tcp_pose.position.x / 1e3,
323
- s.tcp_pose.position.z / 1e3,
324
- -s.tcp_pose.position.y / 1e3
325
- ) : null).filter((s) => s !== null)) || [];
326
- return /* @__PURE__ */ e.jsx("group", { ...n, children: r.length > 0 && /* @__PURE__ */ e.jsx(
327
- $,
280
+ const r = (t == null ? void 0 : t.map((a) => {
281
+ var i;
282
+ return (i = a.position) != null && i.length ? new g.Vector3(
283
+ a.position[0] / 1e3,
284
+ a.position[2] / 1e3,
285
+ -a.position[1] / 1e3
286
+ ) : null;
287
+ }).filter((a) => a !== null)) || [];
288
+ return /* @__PURE__ */ e.jsx("group", { ...s, children: r.length > 0 && /* @__PURE__ */ e.jsx(
289
+ B,
328
290
  {
329
291
  points: r,
330
292
  lineWidth: 3,
@@ -334,171 +296,171 @@ function ct({
334
296
  }
335
297
  ) });
336
298
  }
337
- const J = /* @__PURE__ */ new Map();
338
- async function E(t, n) {
339
- if (J.has(t))
340
- return J.get(t);
299
+ const E = /* @__PURE__ */ new Map();
300
+ async function C(t, s) {
301
+ if (E.has(t))
302
+ return E.get(t);
341
303
  const r = (async () => {
342
- var u;
343
- const l = n || "", s = new De({ instanceUrl: l }), f = s.api.motionGroupModels;
344
- (u = f.axios) != null && u.interceptors && f.axios.interceptors.request.use((h) => {
345
- var d;
346
- return (d = h.url) != null && d.includes("/glb") && (h.responseType = "blob"), h;
304
+ var c;
305
+ const a = s || "", i = new ke({ instanceUrl: a }), u = i.api.motionGroupModels;
306
+ (c = u.axios) != null && c.interceptors && u.axios.interceptors.request.use((h) => {
307
+ var n;
308
+ return (n = h.url) != null && n.includes("/glb") && (h.responseType = "blob"), h;
347
309
  });
348
310
  try {
349
- const h = await s.api.motionGroupModels.getMotionGroupGlbModel(t);
311
+ const h = await i.api.motionGroupModels.getMotionGroupGlbModel(t);
350
312
  return URL.createObjectURL(h);
351
313
  } catch (h) {
352
314
  throw console.error("Failed to fetch model:", h), h;
353
315
  }
354
316
  })();
355
- return J.set(t, r), r;
317
+ return E.set(t, r), r;
356
318
  }
357
- function fe(t) {
358
- function n(r) {
359
- return r.children.length === 0 ? [r] : [r, ...r.children.flatMap((l) => n(l))];
319
+ function ue(t) {
320
+ function s(r) {
321
+ return r.children.length === 0 ? [r] : [r, ...r.children.flatMap((a) => s(a))];
360
322
  }
361
- return n(t).filter((r) => me(r));
323
+ return s(t).filter((r) => pe(r));
362
324
  }
363
- function he(t) {
325
+ function de(t) {
364
326
  return t.name.endsWith("_FLG");
365
327
  }
366
- function me(t) {
328
+ function pe(t) {
367
329
  return /_J[0-9]+$/.test(t.name);
368
330
  }
369
- function Je(t, n) {
331
+ function Ee(t, s) {
370
332
  let r;
371
- function l(s) {
372
- if (he(s)) {
333
+ function a(i) {
334
+ if (de(i)) {
373
335
  if (r)
374
336
  throw Error(
375
- `Found multiple flange groups in robot model ${n}; first ${r.name} then ${s.name}. Only one _FLG group is allowed.`
337
+ `Found multiple flange groups in robot model ${s}; first ${r.name} then ${i.name}. Only one _FLG group is allowed.`
376
338
  );
377
- r = s;
339
+ r = i;
378
340
  }
379
- me(s), s.children.map(l);
341
+ pe(i), i.children.map(a);
380
342
  }
381
- if (l(t.scene), !r)
343
+ if (a(t.scene), !r)
382
344
  throw Error(
383
- `No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`
345
+ `No flange group found in robot model ${s}. Flange must be identified with a name ending in _FLG.`
384
346
  );
385
347
  return { gltf: t };
386
348
  }
387
- function xe({
349
+ function he({
388
350
  rapidlyChangingMotionState: t,
389
- dhParameters: n,
351
+ dhParameters: s,
390
352
  onRotationChanged: r,
391
- children: l
353
+ children: a
392
354
  }) {
393
- const s = _([]), f = _([]), u = _(null), { invalidate: h } = le();
355
+ const i = R([]), u = R([]), c = R(null), { invalidate: h } = ae();
394
356
  M(() => {
395
357
  const o = t.joint_position.filter(
396
- (a) => a !== void 0
358
+ (l) => l !== void 0
397
359
  );
398
- return u.current = new ue(o, {
360
+ return c.current = new ne(o, {
399
361
  tension: 120,
400
362
  // Controls spring stiffness - higher values create faster, more responsive motion
401
363
  friction: 20,
402
364
  // Controls damping - higher values reduce oscillation and create smoother settling
403
365
  threshold: 1e-3
404
366
  }), () => {
405
- var a;
406
- (a = u.current) == null || a.destroy();
367
+ var l;
368
+ (l = c.current) == null || l.destroy();
407
369
  };
408
- }, []), ce((o, a) => {
409
- if (u.current) {
410
- const c = u.current.update(a);
411
- p(), c || h();
370
+ }, []), le((o, l) => {
371
+ if (c.current) {
372
+ const d = c.current.update(l);
373
+ f(), d || h();
412
374
  }
413
375
  });
414
- function d(o) {
415
- o && (f.current = fe(o), p(), h());
376
+ function n(o) {
377
+ o && (u.current = ue(o), f(), h());
416
378
  }
417
- function p() {
418
- var a;
419
- const o = ((a = u.current) == null ? void 0 : a.getCurrentValues()) || [];
379
+ function f() {
380
+ var l;
381
+ const o = ((l = c.current) == null ? void 0 : l.getCurrentValues()) || [];
420
382
  if (r)
421
- r(f.current, o);
383
+ r(u.current, o);
422
384
  else
423
- for (const [c, y] of f.current.entries()) {
424
- const m = n[c], j = m.theta || 0, x = m.reverse_rotation_direction ? -1 : 1;
425
- y.rotation.y = x * (o[c] || 0) + j;
385
+ for (const [d, x] of u.current.entries()) {
386
+ const p = s[d], j = p.theta || 0, y = p.reverse_rotation_direction ? -1 : 1;
387
+ x.rotation.y = y * (o[d] || 0) + j;
426
388
  }
427
389
  }
428
- const i = G(() => {
390
+ const m = T(() => {
429
391
  const o = t.joint_position.filter(
430
- (a) => a !== void 0
392
+ (l) => l !== void 0
431
393
  );
432
394
  requestAnimationFrame(() => {
433
- var a;
434
- s.current = o, (a = u.current) == null || a.setTarget(o);
395
+ var l;
396
+ i.current = o, (l = c.current) == null || l.setTarget(o);
435
397
  });
436
398
  }, [t]);
437
399
  return M(() => {
438
- i();
439
- }, [t, i]), pe(() => {
440
- i();
441
- }), /* @__PURE__ */ e.jsx("group", { ref: d, children: l });
400
+ m();
401
+ }, [t, m]), se(() => {
402
+ m();
403
+ }), /* @__PURE__ */ e.jsx("group", { ref: n, children: a });
442
404
  }
443
- const Be = "line", We = "mesh";
444
- function $e({
405
+ const Je = "line", Be = "mesh";
406
+ function We({
445
407
  rapidlyChangingMotionState: t,
446
- dhParameters: n,
408
+ dhParameters: s,
447
409
  ...r
448
410
  }) {
449
- const l = new R(), s = _([]), f = _([]);
450
- ke.useEffect(() => {
451
- s.current = new Array(n.length).fill(null), f.current = new Array(n.length).fill(null);
452
- }, [n.length]);
453
- function u(p, i) {
454
- const o = new k(), a = new B(), c = new k();
455
- l.decompose(o, a, c);
456
- const y = o.clone(), m = new R().makeRotationY(
457
- p.theta + i * (p.reverse_rotation_direction ? -1 : 1)
458
- ).multiply(new R().makeTranslation(0, p.d / 1e3, 0)).multiply(new R().makeTranslation(p.a / 1e3, 0, 0)).multiply(new R().makeRotationX(p.alpha));
459
- return l.multiply(m), l.decompose(o, a, c), { a: y, b: o };
411
+ const a = new w(), i = R([]), u = R([]);
412
+ Le.useEffect(() => {
413
+ i.current = new Array(s.length).fill(null), u.current = new Array(s.length).fill(null);
414
+ }, [s.length]);
415
+ function c(f, m) {
416
+ const o = new k(), l = new J(), d = new k();
417
+ a.decompose(o, l, d);
418
+ const x = o.clone(), p = new w().makeRotationY(
419
+ f.theta + m * (f.reverse_rotation_direction ? -1 : 1)
420
+ ).multiply(new w().makeTranslation(0, f.d / 1e3, 0)).multiply(new w().makeTranslation(f.a / 1e3, 0, 0)).multiply(new w().makeRotationX(f.alpha));
421
+ return a.multiply(p), a.decompose(o, l, d), { a: x, b: o };
460
422
  }
461
- function h(p, i, o, a) {
462
- if (!n)
423
+ function h(f, m, o, l) {
424
+ if (!s)
463
425
  return;
464
- const c = n[p];
465
- if (!c)
426
+ const d = s[f];
427
+ if (!d)
466
428
  return;
467
- const { a: y, b: m } = u(c, a);
468
- i.geometry.setPositions([y.toArray(), m.toArray()].flat()), o.position.set(m.x, m.y, m.z);
429
+ const { a: x, b: p } = c(d, l);
430
+ m.geometry.setPositions([x.toArray(), p.toArray()].flat()), o.position.set(p.x, p.y, p.z);
469
431
  }
470
- function d(p, i) {
471
- l.identity();
472
- for (let o = 0; o < Math.min(p.length, i.length); o++) {
473
- const a = s.current[o], c = f.current[o];
474
- a && c && h(o, a, c, i[o]);
432
+ function n(f, m) {
433
+ a.identity();
434
+ for (let o = 0; o < Math.min(f.length, m.length); o++) {
435
+ const l = i.current[o], d = u.current[o];
436
+ l && d && h(o, l, d, m[o]);
475
437
  }
476
438
  }
477
439
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
478
- xe,
440
+ he,
479
441
  {
480
442
  rapidlyChangingMotionState: t,
481
- dhParameters: n,
482
- onRotationChanged: d,
443
+ dhParameters: s,
444
+ onRotationChanged: n,
483
445
  children: /* @__PURE__ */ e.jsxs("group", { ...r, name: "Scene", children: [
484
446
  /* @__PURE__ */ e.jsxs("mesh", { children: [
485
447
  /* @__PURE__ */ e.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
486
448
  /* @__PURE__ */ e.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
487
449
  ] }),
488
- n.map((p, i) => {
489
- const { a: o, b: a } = u(
490
- p,
491
- t.joint_position[i] ?? 0
492
- ), c = `dhrobot_J0${i}`;
493
- return /* @__PURE__ */ e.jsxs("group", { name: c, children: [
450
+ s.map((f, m) => {
451
+ const { a: o, b: l } = c(
452
+ f,
453
+ t.joint_position[m] ?? 0
454
+ ), d = `dhrobot_J0${m}`;
455
+ return /* @__PURE__ */ e.jsxs("group", { name: d, children: [
494
456
  /* @__PURE__ */ e.jsx(
495
- $,
457
+ B,
496
458
  {
497
- ref: (y) => {
498
- s.current[i] = y;
459
+ ref: (x) => {
460
+ i.current[m] = x;
499
461
  },
500
- name: Be,
501
- points: [o, a],
462
+ name: Je,
463
+ points: [o, l],
502
464
  color: "white",
503
465
  lineWidth: 5
504
466
  }
@@ -506,127 +468,127 @@ function $e({
506
468
  /* @__PURE__ */ e.jsxs(
507
469
  "mesh",
508
470
  {
509
- ref: (y) => {
510
- f.current[i] = y;
471
+ ref: (x) => {
472
+ u.current[m] = x;
511
473
  },
512
- name: We,
513
- position: a,
474
+ name: Be,
475
+ position: l,
514
476
  children: [
515
477
  /* @__PURE__ */ e.jsx("sphereGeometry", { args: [0.01, 32, 32] }),
516
478
  /* @__PURE__ */ e.jsx("meshStandardMaterial", { color: "black", depthTest: !0 })
517
479
  ]
518
480
  },
519
- "mesh_" + i
481
+ "mesh_" + m
520
482
  )
521
- ] }, c);
483
+ ] }, d);
522
484
  })
523
485
  ] })
524
486
  }
525
487
  ) });
526
488
  }
527
- const He = console.warn;
528
- function ye() {
489
+ const $e = console.warn;
490
+ function fe() {
529
491
  return M(() => {
530
492
  console.warn = (t) => {
531
- t !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && He(t);
493
+ t !== "Cannot call the manual advancement of rafz whilst frameLoop is not set as demand" && $e(t);
532
494
  };
533
495
  }, []), /* @__PURE__ */ e.jsx(e.Fragment, {});
534
496
  }
535
- function Ne(t) {
497
+ function He(t) {
536
498
  return t.type === "Mesh";
537
499
  }
538
- function qe({
500
+ function Ne({
539
501
  url: t,
540
- flangeRef: n,
502
+ flangeRef: s,
541
503
  postModelRender: r,
542
- ...l
504
+ ...a
543
505
  }) {
544
- const s = Le(t);
545
- let f;
506
+ const i = Fe(t);
507
+ let u;
546
508
  try {
547
- f = Je(s, "robot.glb").gltf;
548
- } catch (d) {
549
- throw d;
509
+ u = Ee(i, "robot.glb").gltf;
510
+ } catch (n) {
511
+ throw n;
550
512
  }
551
- const u = G(
552
- (d) => {
553
- d && r && r();
513
+ const c = T(
514
+ (n) => {
515
+ n && r && r();
554
516
  },
555
517
  [r]
556
518
  );
557
- function h(d) {
519
+ function h(n) {
558
520
  try {
559
- return Ne(d) ? d.geometry ? /* @__PURE__ */ e.jsx(
521
+ return He(n) ? n.geometry ? /* @__PURE__ */ e.jsx(
560
522
  "mesh",
561
523
  {
562
- name: d.name,
563
- geometry: d.geometry,
564
- material: d.material,
565
- position: d.position,
566
- rotation: d.rotation
524
+ name: n.name,
525
+ geometry: n.geometry,
526
+ material: n.material,
527
+ position: n.position,
528
+ rotation: n.rotation
567
529
  },
568
- d.uuid
569
- ) : /* @__PURE__ */ e.jsx("group", { name: d.name, position: d.position, rotation: d.rotation }, d.uuid) : /* @__PURE__ */ e.jsx(
530
+ n.uuid
531
+ ) : /* @__PURE__ */ e.jsx("group", { name: n.name, position: n.position, rotation: n.rotation }, n.uuid) : /* @__PURE__ */ e.jsx(
570
532
  "group",
571
533
  {
572
- name: d.name,
573
- position: d.position,
574
- rotation: d.rotation,
575
- ref: he(d) ? n : void 0,
576
- children: d.children.map(h)
534
+ name: n.name,
535
+ position: n.position,
536
+ rotation: n.rotation,
537
+ ref: de(n) ? s : void 0,
538
+ children: n.children.map(h)
577
539
  },
578
- d.uuid
540
+ n.uuid
579
541
  );
580
- } catch (p) {
581
- return console.warn("Error rendering node", d.name, p), null;
542
+ } catch (f) {
543
+ return console.warn("Error rendering node", n.name, f), null;
582
544
  }
583
545
  }
584
- return /* @__PURE__ */ e.jsx("group", { ...l, dispose: null, ref: u, children: h(f.scene) });
546
+ return /* @__PURE__ */ e.jsx("group", { ...a, dispose: null, ref: c, children: h(u.scene) });
585
547
  }
586
- function ge({
548
+ function me({
587
549
  modelURL: t,
588
- flangeRef: n,
550
+ flangeRef: s,
589
551
  postModelRender: r,
590
- ...l
552
+ ...a
591
553
  }) {
592
- const [s, f] = A(null);
554
+ const [i, u] = G(null);
593
555
  return M(() => {
594
556
  (async () => {
595
557
  try {
596
558
  if (typeof t == "string")
597
- f(t);
559
+ u(t);
598
560
  else {
599
561
  const h = await t;
600
- f(h);
562
+ u(h);
601
563
  }
602
564
  } catch (h) {
603
565
  console.error("Failed to resolve model URL:", h);
604
566
  }
605
567
  })();
606
- }, [t]), s ? /* @__PURE__ */ e.jsx(
607
- qe,
568
+ }, [t]), i ? /* @__PURE__ */ e.jsx(
569
+ Ne,
608
570
  {
609
- url: s,
610
- flangeRef: n,
571
+ url: i,
572
+ flangeRef: s,
611
573
  postModelRender: r,
612
- ...l
574
+ ...a
613
575
  }
614
576
  ) : null;
615
577
  }
616
- const je = (t, n) => {
578
+ const xe = (t, s) => {
617
579
  t.userData.isGhost || (t.traverse((r) => {
618
580
  if (r instanceof g.Mesh) {
619
581
  r.material instanceof g.Material && (r.material.colorWrite = !1);
620
- const l = r.clone(), s = r.clone();
621
- l.material = new g.MeshStandardMaterial({
582
+ const a = r.clone(), i = r.clone();
583
+ a.material = new g.MeshStandardMaterial({
622
584
  depthTest: !0,
623
585
  depthWrite: !0,
624
586
  colorWrite: !1,
625
587
  polygonOffset: !0,
626
588
  polygonOffsetFactor: -1,
627
589
  side: g.DoubleSide
628
- }), l.userData.isGhost = !0, s.material = new g.MeshStandardMaterial({
629
- color: n,
590
+ }), a.userData.isGhost = !0, i.material = new g.MeshStandardMaterial({
591
+ color: s,
630
592
  opacity: 0.3,
631
593
  depthTest: !0,
632
594
  depthWrite: !1,
@@ -634,167 +596,167 @@ const je = (t, n) => {
634
596
  polygonOffset: !0,
635
597
  polygonOffsetFactor: -2,
636
598
  side: g.DoubleSide
637
- }), s.userData.isGhost = !0, r.parent && (r.parent.add(l), r.parent.add(s));
599
+ }), i.userData.isGhost = !0, r.parent && (r.parent.add(a), r.parent.add(i));
638
600
  }
639
601
  }), t.userData.isGhost = !0);
640
- }, we = (t) => {
602
+ }, ye = (t) => {
641
603
  if (!t.userData.isGhost) return;
642
- const n = [];
604
+ const s = [];
643
605
  t.traverse((r) => {
644
- var l;
645
- r instanceof g.Mesh && ((l = r.userData) != null && l.isGhost ? n.push(r) : r.material instanceof g.Material && (r.material.colorWrite = !0));
646
- }), n.forEach((r) => {
606
+ var a;
607
+ r instanceof g.Mesh && ((a = r.userData) != null && a.isGhost ? s.push(r) : r.material instanceof g.Material && (r.material.colorWrite = !0));
608
+ }), s.forEach((r) => {
647
609
  r.parent && r.parent.remove(r);
648
610
  }), t.userData.isGhost = !1;
649
- }, be = U(
611
+ }, ge = U(
650
612
  ({
651
613
  rapidlyChangingMotionState: t,
652
- modelFromController: n,
614
+ modelFromController: s,
653
615
  dhParameters: r,
654
- getModel: l = E,
655
- flangeRef: s,
656
- postModelRender: f,
657
- transparentColor: u,
616
+ getModel: a = C,
617
+ flangeRef: i,
618
+ postModelRender: u,
619
+ transparentColor: c,
658
620
  instanceUrl: h,
659
- ...d
621
+ ...n
660
622
  }) => {
661
- const [p, i] = A(null), o = G((c) => {
662
- i(c);
623
+ const [f, m] = G(null), o = T((d) => {
624
+ m(d);
663
625
  }, []);
664
626
  M(() => {
665
- p && (u ? je(p, u) : we(p));
666
- }, [p, u]);
667
- const a = /* @__PURE__ */ e.jsx(
668
- $e,
627
+ f && (c ? xe(f, c) : ye(f));
628
+ }, [f, c]);
629
+ const l = /* @__PURE__ */ e.jsx(
630
+ We,
669
631
  {
670
632
  rapidlyChangingMotionState: t,
671
633
  dhParameters: r,
672
- ...d
634
+ ...n
673
635
  }
674
636
  );
675
637
  return /* @__PURE__ */ e.jsxs(
676
- de,
638
+ ce,
677
639
  {
678
- fallback: a,
679
- onError: (c) => {
680
- console.warn(c);
640
+ fallback: l,
641
+ onError: (d) => {
642
+ console.warn(d);
681
643
  },
682
644
  children: [
683
- /* @__PURE__ */ e.jsx(ae, { fallback: a, children: /* @__PURE__ */ e.jsx("group", { ref: o, children: /* @__PURE__ */ e.jsx(
684
- xe,
645
+ /* @__PURE__ */ e.jsx(ie, { fallback: l, children: /* @__PURE__ */ e.jsx("group", { ref: o, children: /* @__PURE__ */ e.jsx(
646
+ he,
685
647
  {
686
648
  rapidlyChangingMotionState: t,
687
649
  dhParameters: r,
688
650
  children: /* @__PURE__ */ e.jsx(
689
- ge,
651
+ me,
690
652
  {
691
653
  modelURL: (() => {
692
- const c = l(n, h);
693
- if (!c) {
694
- const y = new Blob([], { type: "model/gltf-binary" }), m = new File([y], `${n}.glb`, { type: "model/gltf-binary" });
695
- return Promise.resolve(URL.createObjectURL(m));
654
+ const d = a(s, h);
655
+ if (!d) {
656
+ const x = new Blob([], { type: "model/gltf-binary" }), p = new File([x], `${s}.glb`, { type: "model/gltf-binary" });
657
+ return Promise.resolve(URL.createObjectURL(p));
696
658
  }
697
- return c;
659
+ return d;
698
660
  })(),
699
- postModelRender: f,
700
- flangeRef: s,
701
- ...d
661
+ postModelRender: u,
662
+ flangeRef: i,
663
+ ...n
702
664
  }
703
665
  )
704
666
  }
705
667
  ) }) }),
706
- /* @__PURE__ */ e.jsx(ye, {})
668
+ /* @__PURE__ */ e.jsx(fe, {})
707
669
  ]
708
670
  }
709
671
  );
710
672
  }
711
673
  );
712
- function Ye({
674
+ function qe({
713
675
  connectedMotionGroup: t,
714
- getModel: n = E,
676
+ getModel: s = C,
715
677
  flangeRef: r,
716
- transparentColor: l,
717
- postModelRender: s,
718
- ...f
678
+ transparentColor: a,
679
+ postModelRender: i,
680
+ ...u
719
681
  }) {
720
682
  return t.dhParameters ? /* @__PURE__ */ e.jsx(
721
- be,
683
+ ge,
722
684
  {
723
685
  rapidlyChangingMotionState: t.rapidlyChangingMotionState,
724
686
  modelFromController: t.modelFromController || "",
725
687
  dhParameters: t.dhParameters,
726
- getModel: n,
688
+ getModel: s,
727
689
  flangeRef: r,
728
- transparentColor: l,
729
- postModelRender: s,
730
- ...f
690
+ transparentColor: a,
691
+ postModelRender: i,
692
+ ...u
731
693
  }
732
694
  ) : null;
733
695
  }
734
- const ut = U(
735
- Ve(
696
+ const ct = U(
697
+ Ie(
736
698
  ({
737
699
  robotName: t,
738
- programState: n,
700
+ programState: s,
739
701
  safetyState: r,
740
- operationMode: l,
741
- driveToHomeEnabled: s = !1,
742
- onDriveToHomePress: f,
743
- onDriveToHomeRelease: u,
702
+ operationMode: a,
703
+ driveToHomeEnabled: i = !1,
704
+ onDriveToHomePress: u,
705
+ onDriveToHomeRelease: c,
744
706
  connectedMotionGroup: h,
745
- robotComponent: d = Ye,
746
- customContentComponent: p,
747
- className: i
707
+ robotComponent: n = qe,
708
+ customContentComponent: f,
709
+ className: m
748
710
  }) => {
749
- var Y;
750
- const o = Fe(), { t: a } = Ie(), [c, y] = A(!1), m = _(null), j = _(null), [x, w] = A(!1), [b, F] = A({ width: 400, height: 600 }), [H, Me] = A(0);
711
+ var H;
712
+ const o = Pe(), { t: l } = De(), [d, x] = G(!1), p = R(null), j = R(null), [y, L] = G(!1), [F, Re] = G({ width: 400, height: 600 }), [Xe, ve] = G(0);
751
713
  M(() => {
752
714
  const D = () => {
753
715
  if (j.current) {
754
- const { offsetWidth: K, offsetHeight: Q } = j.current;
755
- w(K > Q), F({ width: K, height: Q });
716
+ const { offsetWidth: q, offsetHeight: Y } = j.current;
717
+ L(q > Y), Re({ width: q, height: Y });
756
718
  }
757
719
  };
758
720
  D();
759
- const X = new ResizeObserver(D);
760
- return j.current && X.observe(j.current), () => {
761
- X.disconnect();
721
+ const N = new ResizeObserver(D);
722
+ return j.current && N.observe(j.current), () => {
723
+ N.disconnect();
762
724
  };
763
725
  }, []);
764
- const N = G(() => {
765
- Me((D) => D + 1);
766
- }, []), P = G(() => {
767
- !s || !f || (y(!0), f());
768
- }, [s, f]), V = G(() => {
769
- !s || !u || (y(!1), u());
770
- }, [s, u]), q = G(() => {
771
- c && u && (y(!1), u());
772
- }, [c, u]), S = x ? b.width < 350 : b.height < 200, I = x ? b.height < 310 : b.height < 450;
726
+ const W = T(() => {
727
+ ve((D) => D + 1);
728
+ }, []), P = T(() => {
729
+ !i || !u || (x(!0), u());
730
+ }, [i, u]), A = T(() => {
731
+ !i || !c || (x(!1), c());
732
+ }, [i, c]), $ = T(() => {
733
+ d && c && (x(!1), c());
734
+ }, [d, c]), _ = y ? F.width < 350 : F.height < 200, I = y ? F.height < 310 : F.height < 450;
773
735
  return /* @__PURE__ */ e.jsx(
774
- Pe,
736
+ Ae,
775
737
  {
776
738
  ref: j,
777
- className: i,
739
+ className: m,
778
740
  sx: {
779
741
  width: "100%",
780
742
  height: "100%",
781
743
  display: "flex",
782
- flexDirection: x ? "row" : "column",
744
+ flexDirection: y ? "row" : "column",
783
745
  position: "relative",
784
746
  overflow: "hidden",
785
747
  minWidth: { xs: 180, sm: 220, md: 250 },
786
- minHeight: x ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
748
+ minHeight: y ? { xs: 200, sm: 240, md: 260 } : { xs: 150, sm: 180, md: 220 },
787
749
  // Allow progressive hiding in portrait mode
788
750
  border: `1px solid ${o.palette.divider}`,
789
751
  borderRadius: "18px",
790
752
  boxShadow: "none",
791
- backgroundColor: ((Y = o.palette.backgroundPaperElevation) == null ? void 0 : Y[8]) || "#2A2A3F",
753
+ backgroundColor: ((H = o.palette.backgroundPaperElevation) == null ? void 0 : H[8]) || "#2A2A3F",
792
754
  backgroundImage: "none"
793
755
  // Override any gradient from elevation
794
756
  },
795
- children: x ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
757
+ children: y ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
796
758
  /* @__PURE__ */ e.jsx(
797
- v,
759
+ b,
798
760
  {
799
761
  sx: {
800
762
  flex: "0 0 50%",
@@ -807,10 +769,10 @@ const ut = U(
807
769
  mr: { xs: 0.75, sm: 1, md: 1.5 },
808
770
  overflow: "hidden",
809
771
  // Prevent content from affecting container size
810
- display: S ? "none" : "block"
772
+ display: _ ? "none" : "block"
811
773
  },
812
- children: !S && /* @__PURE__ */ e.jsxs(
813
- z,
774
+ children: !_ && /* @__PURE__ */ e.jsxs(
775
+ K,
814
776
  {
815
777
  orthographic: !0,
816
778
  camera: {
@@ -831,12 +793,12 @@ const ut = U(
831
793
  dpr: [1, 2],
832
794
  gl: { alpha: !0, antialias: !0 },
833
795
  children: [
834
- /* @__PURE__ */ e.jsx(oe, {}),
835
- /* @__PURE__ */ e.jsx(ee, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ e.jsx(
836
- d,
796
+ /* @__PURE__ */ e.jsx(te, {}),
797
+ /* @__PURE__ */ e.jsx(Z, { fit: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ e.jsx(
798
+ n,
837
799
  {
838
800
  connectedMotionGroup: h,
839
- postModelRender: N
801
+ postModelRender: W
840
802
  }
841
803
  ) })
842
804
  ]
@@ -845,18 +807,18 @@ const ut = U(
845
807
  }
846
808
  ),
847
809
  /* @__PURE__ */ e.jsxs(
848
- v,
810
+ b,
849
811
  {
850
812
  sx: {
851
813
  flex: "1",
852
814
  display: "flex",
853
815
  flexDirection: "column",
854
816
  justifyContent: "flex-start",
855
- width: S ? "100%" : "50%"
817
+ width: _ ? "100%" : "50%"
856
818
  },
857
819
  children: [
858
820
  /* @__PURE__ */ e.jsxs(
859
- v,
821
+ b,
860
822
  {
861
823
  sx: {
862
824
  p: { xs: 1.5, sm: 2, md: 3 },
@@ -864,20 +826,20 @@ const ut = U(
864
826
  textAlign: "left"
865
827
  },
866
828
  children: [
867
- /* @__PURE__ */ e.jsx(te, { variant: "h6", component: "h2", sx: { mb: 1 }, children: t }),
829
+ /* @__PURE__ */ e.jsx(Q, { variant: "h6", component: "h2", sx: { mb: 1 }, children: t }),
868
830
  /* @__PURE__ */ e.jsx(
869
- se,
831
+ X,
870
832
  {
871
- programState: n,
833
+ programState: s,
872
834
  safetyState: r,
873
- operationMode: l
835
+ operationMode: a
874
836
  }
875
837
  )
876
838
  ]
877
839
  }
878
840
  ),
879
841
  /* @__PURE__ */ e.jsxs(
880
- v,
842
+ b,
881
843
  {
882
844
  sx: {
883
845
  p: { xs: 1.5, sm: 2, md: 3 },
@@ -888,10 +850,10 @@ const ut = U(
888
850
  justifyContent: "space-between"
889
851
  },
890
852
  children: [
891
- !I && p && /* @__PURE__ */ e.jsxs(v, { children: [
892
- /* @__PURE__ */ e.jsx(p, {}),
853
+ !I && f && /* @__PURE__ */ e.jsxs(b, { children: [
854
+ /* @__PURE__ */ e.jsx(f, {}),
893
855
  /* @__PURE__ */ e.jsx(
894
- re,
856
+ z,
895
857
  {
896
858
  sx: {
897
859
  mt: 1,
@@ -903,13 +865,13 @@ const ut = U(
903
865
  )
904
866
  ] }),
905
867
  /* @__PURE__ */ e.jsx(
906
- v,
868
+ b,
907
869
  {
908
870
  sx: {
909
- mt: !I && p ? "auto" : 0
871
+ mt: !I && f ? "auto" : 0
910
872
  },
911
873
  children: /* @__PURE__ */ e.jsx(
912
- v,
874
+ b,
913
875
  {
914
876
  sx: {
915
877
  display: "flex",
@@ -918,24 +880,24 @@ const ut = U(
918
880
  mb: { xs: 0.5, sm: 0.75, md: 1 }
919
881
  },
920
882
  children: /* @__PURE__ */ e.jsx(
921
- ne,
883
+ ee,
922
884
  {
923
- ref: m,
885
+ ref: p,
924
886
  variant: "contained",
925
887
  color: "secondary",
926
888
  size: "small",
927
- disabled: !s,
889
+ disabled: !i,
928
890
  onMouseDown: P,
929
- onMouseUp: V,
930
- onMouseLeave: q,
891
+ onMouseUp: A,
892
+ onMouseLeave: $,
931
893
  onTouchStart: P,
932
- onTouchEnd: V,
894
+ onTouchEnd: A,
933
895
  sx: {
934
896
  textTransform: "none",
935
897
  px: 1.5,
936
898
  py: 0.5
937
899
  },
938
- children: a("RobotCard.DriveToHome.bt")
900
+ children: l("RobotCard.DriveToHome.bt")
939
901
  }
940
902
  )
941
903
  }
@@ -949,7 +911,7 @@ const ut = U(
949
911
  }
950
912
  )
951
913
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
952
- v,
914
+ b,
953
915
  {
954
916
  sx: {
955
917
  p: 3,
@@ -958,31 +920,31 @@ const ut = U(
958
920
  flexDirection: "column"
959
921
  },
960
922
  children: [
961
- /* @__PURE__ */ e.jsxs(v, { children: [
962
- /* @__PURE__ */ e.jsx(te, { variant: "h6", component: "h2", sx: { mb: 1 }, children: t }),
923
+ /* @__PURE__ */ e.jsxs(b, { children: [
924
+ /* @__PURE__ */ e.jsx(Q, { variant: "h6", component: "h2", sx: { mb: 1 }, children: t }),
963
925
  /* @__PURE__ */ e.jsx(
964
- se,
926
+ X,
965
927
  {
966
- programState: n,
928
+ programState: s,
967
929
  safetyState: r,
968
- operationMode: l
930
+ operationMode: a
969
931
  }
970
932
  )
971
933
  ] }),
972
934
  /* @__PURE__ */ e.jsx(
973
- v,
935
+ b,
974
936
  {
975
937
  sx: {
976
- flex: S ? 0 : 1,
938
+ flex: _ ? 0 : 1,
977
939
  position: "relative",
978
- minHeight: S ? 0 : { xs: 120, sm: 150, md: 200 },
979
- height: S ? 0 : "auto",
940
+ minHeight: _ ? 0 : { xs: 120, sm: 150, md: 200 },
941
+ height: _ ? 0 : "auto",
980
942
  borderRadius: 1,
981
943
  overflow: "hidden",
982
- display: S ? "none" : "block"
944
+ display: _ ? "none" : "block"
983
945
  },
984
- children: !S && /* @__PURE__ */ e.jsxs(
985
- z,
946
+ children: !_ && /* @__PURE__ */ e.jsxs(
947
+ K,
986
948
  {
987
949
  orthographic: !0,
988
950
  camera: {
@@ -1001,12 +963,12 @@ const ut = U(
1001
963
  dpr: [1, 2],
1002
964
  gl: { alpha: !0, antialias: !0 },
1003
965
  children: [
1004
- /* @__PURE__ */ e.jsx(oe, {}),
1005
- /* @__PURE__ */ e.jsx(ee, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ e.jsx(
1006
- d,
966
+ /* @__PURE__ */ e.jsx(te, {}),
967
+ /* @__PURE__ */ e.jsx(Z, { fit: !0, clip: !0, observe: !0, margin: 1, maxDuration: 1, children: /* @__PURE__ */ e.jsx(
968
+ n,
1007
969
  {
1008
970
  connectedMotionGroup: h,
1009
- postModelRender: N
971
+ postModelRender: W
1010
972
  }
1011
973
  ) })
1012
974
  ]
@@ -1014,11 +976,11 @@ const ut = U(
1014
976
  )
1015
977
  }
1016
978
  ),
1017
- /* @__PURE__ */ e.jsxs(v, { children: [
1018
- !I && p && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1019
- /* @__PURE__ */ e.jsx(p, {}),
979
+ /* @__PURE__ */ e.jsxs(b, { children: [
980
+ !I && f && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
981
+ /* @__PURE__ */ e.jsx(f, {}),
1020
982
  /* @__PURE__ */ e.jsx(
1021
- re,
983
+ z,
1022
984
  {
1023
985
  sx: {
1024
986
  mt: 1,
@@ -1030,33 +992,33 @@ const ut = U(
1030
992
  )
1031
993
  ] }),
1032
994
  /* @__PURE__ */ e.jsx(
1033
- v,
995
+ b,
1034
996
  {
1035
997
  sx: {
1036
998
  display: "flex",
1037
999
  justifyContent: "flex-start",
1038
- mt: !I && p ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
1000
+ mt: !I && f ? { xs: 1, sm: 2, md: 5 } : { xs: 0.5, sm: 1, md: 2 },
1039
1001
  mb: { xs: 0.5, sm: 0.75, md: 1 }
1040
1002
  },
1041
1003
  children: /* @__PURE__ */ e.jsx(
1042
- ne,
1004
+ ee,
1043
1005
  {
1044
- ref: m,
1006
+ ref: p,
1045
1007
  variant: "contained",
1046
1008
  color: "secondary",
1047
1009
  size: "small",
1048
- disabled: !s,
1010
+ disabled: !i,
1049
1011
  onMouseDown: P,
1050
- onMouseUp: V,
1051
- onMouseLeave: q,
1012
+ onMouseUp: A,
1013
+ onMouseLeave: $,
1052
1014
  onTouchStart: P,
1053
- onTouchEnd: V,
1015
+ onTouchEnd: A,
1054
1016
  sx: {
1055
1017
  textTransform: "none",
1056
1018
  px: 1.5,
1057
1019
  py: 0.5
1058
1020
  },
1059
- children: a("RobotCard.DriveToHome.bt")
1021
+ children: l("RobotCard.DriveToHome.bt")
1060
1022
  }
1061
1023
  )
1062
1024
  }
@@ -1069,125 +1031,125 @@ const ut = U(
1069
1031
  );
1070
1032
  }
1071
1033
  )
1072
- ), pt = Array(6).fill(2 * Math.PI);
1073
- function Re({
1034
+ ), ut = Array(6).fill(2 * Math.PI);
1035
+ function je({
1074
1036
  rapidlyChangingMotionState: t,
1075
- dhParameters: n,
1037
+ dhParameters: s,
1076
1038
  onTranslationChanged: r,
1077
- children: l
1039
+ children: a
1078
1040
  }) {
1079
- const s = _([]), f = _([]), u = _(null), { invalidate: h } = le();
1041
+ const i = R([]), u = R([]), c = R(null), { invalidate: h } = ae();
1080
1042
  M(() => {
1081
1043
  const o = t.joint_position.filter(
1082
- (a) => a !== void 0
1044
+ (l) => l !== void 0
1083
1045
  );
1084
- return u.current = new ue(o, {
1046
+ return c.current = new ne(o, {
1085
1047
  tension: 120,
1086
1048
  // Controls spring stiffness - higher values create faster, more responsive motion
1087
1049
  friction: 20,
1088
1050
  // Controls damping - higher values reduce oscillation and create smoother settling
1089
1051
  threshold: 1e-3
1090
1052
  }), () => {
1091
- var a;
1092
- (a = u.current) == null || a.destroy();
1053
+ var l;
1054
+ (l = c.current) == null || l.destroy();
1093
1055
  };
1094
- }, []), ce((o, a) => {
1095
- if (u.current) {
1096
- const c = u.current.update(a);
1097
- p(), c || h();
1056
+ }, []), le((o, l) => {
1057
+ if (c.current) {
1058
+ const d = c.current.update(l);
1059
+ f(), d || h();
1098
1060
  }
1099
1061
  });
1100
- function d(o) {
1101
- o && (f.current = fe(o), p(), h());
1062
+ function n(o) {
1063
+ o && (u.current = ue(o), f(), h());
1102
1064
  }
1103
- function p() {
1104
- var a;
1105
- const o = ((a = u.current) == null ? void 0 : a.getCurrentValues()) || [];
1065
+ function f() {
1066
+ var l;
1067
+ const o = ((l = c.current) == null ? void 0 : l.getCurrentValues()) || [];
1106
1068
  if (r)
1107
- r(f.current, o);
1069
+ r(u.current, o);
1108
1070
  else
1109
- for (const [c, y] of f.current.entries()) {
1110
- const j = n[c].reverse_rotation_direction ? -1 : 1;
1111
- y.position.y = j * (o[c] || 0) / 1e3;
1071
+ for (const [d, x] of u.current.entries()) {
1072
+ const j = s[d].reverse_rotation_direction ? -1 : 1;
1073
+ x.position.y = j * (o[d] || 0) / 1e3;
1112
1074
  }
1113
1075
  }
1114
- const i = G(() => {
1076
+ const m = T(() => {
1115
1077
  const o = t.joint_position.filter(
1116
- (a) => a !== void 0
1078
+ (l) => l !== void 0
1117
1079
  );
1118
1080
  requestAnimationFrame(() => {
1119
- var a;
1120
- s.current = o, (a = u.current) == null || a.setTarget(o);
1081
+ var l;
1082
+ i.current = o, (l = c.current) == null || l.setTarget(o);
1121
1083
  });
1122
1084
  }, [t]);
1123
1085
  return M(() => {
1124
- i();
1125
- }, [t, i]), pe(() => {
1126
- i();
1127
- }), /* @__PURE__ */ e.jsx("group", { ref: d, children: l });
1086
+ m();
1087
+ }, [t, m]), se(() => {
1088
+ m();
1089
+ }), /* @__PURE__ */ e.jsx("group", { ref: n, children: a });
1128
1090
  }
1129
- function ve({
1091
+ function we({
1130
1092
  rapidlyChangingMotionState: t,
1131
- dhParameters: n,
1093
+ dhParameters: s,
1132
1094
  ...r
1133
1095
  }) {
1134
- const l = new R(), s = _(null), f = _(null);
1135
- function u(p) {
1136
- const i = new R();
1137
- for (let y = 0; y < n.length; y++) {
1138
- const m = n[y], j = p[y] ?? 0, x = new R().makeRotationY(m.theta).multiply(
1139
- new R().makeTranslation(
1140
- m.a / 1e3,
1141
- (m.d + j * (m.reverse_rotation_direction ? -1 : 1)) / 1e3,
1096
+ const a = new w(), i = R(null), u = R(null);
1097
+ function c(f) {
1098
+ const m = new w();
1099
+ for (let x = 0; x < s.length; x++) {
1100
+ const p = s[x], j = f[x] ?? 0, y = new w().makeRotationY(p.theta).multiply(
1101
+ new w().makeTranslation(
1102
+ p.a / 1e3,
1103
+ (p.d + j * (p.reverse_rotation_direction ? -1 : 1)) / 1e3,
1142
1104
  0
1143
1105
  )
1144
- ).multiply(new R().makeRotationX(m.alpha));
1145
- i.multiply(x);
1106
+ ).multiply(new w().makeRotationX(p.alpha));
1107
+ m.multiply(y);
1146
1108
  }
1147
- const o = new k(), a = new B(), c = new k();
1148
- return i.decompose(o, a, c), o;
1109
+ const o = new k(), l = new J(), d = new k();
1110
+ return m.decompose(o, l, d), o;
1149
1111
  }
1150
- const h = u(t.joint_position);
1151
- function d(p, i) {
1152
- l.identity();
1112
+ const h = c(t.joint_position);
1113
+ function n(f, m) {
1114
+ a.identity();
1153
1115
  let o = new k();
1154
- for (let m = 0; m < n.length; m++) {
1155
- const j = i[m] ?? 0, x = n[m], w = new R().makeRotationY(x.theta).multiply(
1156
- new R().makeTranslation(
1157
- x.a / 1e3,
1158
- (x.d + j * (x.reverse_rotation_direction ? -1 : 1)) / 1e3,
1116
+ for (let p = 0; p < s.length; p++) {
1117
+ const j = m[p] ?? 0, y = s[p], L = new w().makeRotationY(y.theta).multiply(
1118
+ new w().makeTranslation(
1119
+ y.a / 1e3,
1120
+ (y.d + j * (y.reverse_rotation_direction ? -1 : 1)) / 1e3,
1159
1121
  0
1160
1122
  )
1161
- ).multiply(new R().makeRotationX(x.alpha));
1162
- l.multiply(w);
1123
+ ).multiply(new w().makeRotationX(y.alpha));
1124
+ a.multiply(L);
1163
1125
  }
1164
- const a = new k(), c = new B(), y = new k();
1165
- if (l.decompose(a, c, y), o = a, s.current && s.current.position.set(o.x, o.y, o.z), f.current) {
1166
- const m = f.current.geometry;
1167
- m && m.setPositions && m.setPositions([0, 0, 0, o.x, o.y, o.z]);
1126
+ const l = new k(), d = new J(), x = new k();
1127
+ if (a.decompose(l, d, x), o = l, i.current && i.current.position.set(o.x, o.y, o.z), u.current) {
1128
+ const p = u.current.geometry;
1129
+ p && p.setPositions && p.setPositions([0, 0, 0, o.x, o.y, o.z]);
1168
1130
  }
1169
1131
  }
1170
1132
  return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
1171
- Re,
1133
+ je,
1172
1134
  {
1173
1135
  rapidlyChangingMotionState: t,
1174
- dhParameters: n,
1175
- onTranslationChanged: d,
1136
+ dhParameters: s,
1137
+ onTranslationChanged: n,
1176
1138
  children: /* @__PURE__ */ e.jsxs("group", { ...r, name: "Scene", children: [
1177
1139
  /* @__PURE__ */ e.jsxs("mesh", { name: "Base", position: [0, 0, 0], children: [
1178
1140
  /* @__PURE__ */ e.jsx("sphereGeometry", { args: [0.02, 32, 32] }),
1179
1141
  /* @__PURE__ */ e.jsx("meshStandardMaterial", { color: "green", depthTest: !0 })
1180
1142
  ] }),
1181
1143
  /* @__PURE__ */ e.jsx(
1182
- $,
1144
+ B,
1183
1145
  {
1184
- ref: f,
1146
+ ref: u,
1185
1147
  points: [new k(0, 0, 0), h],
1186
1148
  color: "White",
1187
1149
  lineWidth: 5
1188
1150
  }
1189
1151
  ),
1190
- /* @__PURE__ */ e.jsxs("mesh", { ref: s, name: "TCP", position: h, children: [
1152
+ /* @__PURE__ */ e.jsxs("mesh", { ref: i, name: "TCP", position: h, children: [
1191
1153
  /* @__PURE__ */ e.jsx("sphereGeometry", { args: [0.025, 32, 32] }),
1192
1154
  /* @__PURE__ */ e.jsx("meshStandardMaterial", { color: "red", depthTest: !0 })
1193
1155
  ] })
@@ -1195,64 +1157,64 @@ function ve({
1195
1157
  }
1196
1158
  ) });
1197
1159
  }
1198
- const _e = U(
1160
+ const be = U(
1199
1161
  ({
1200
1162
  rapidlyChangingMotionState: t,
1201
- modelFromController: n,
1163
+ modelFromController: s,
1202
1164
  dhParameters: r,
1203
- getModel: l = E,
1204
- flangeRef: s,
1205
- postModelRender: f,
1206
- transparentColor: u,
1165
+ getModel: a = C,
1166
+ flangeRef: i,
1167
+ postModelRender: u,
1168
+ transparentColor: c,
1207
1169
  instanceUrl: h,
1208
- ...d
1170
+ ...n
1209
1171
  }) => {
1210
- const [p, i] = A(null), o = G((c) => {
1211
- i(c);
1172
+ const [f, m] = G(null), o = T((d) => {
1173
+ m(d);
1212
1174
  }, []);
1213
1175
  M(() => {
1214
- p && (u ? je(p, u) : we(p));
1215
- }, [p, u]);
1216
- const a = /* @__PURE__ */ e.jsx(
1217
- ve,
1176
+ f && (c ? xe(f, c) : ye(f));
1177
+ }, [f, c]);
1178
+ const l = /* @__PURE__ */ e.jsx(
1179
+ we,
1218
1180
  {
1219
1181
  rapidlyChangingMotionState: t,
1220
1182
  dhParameters: r,
1221
- ...d
1183
+ ...n
1222
1184
  }
1223
1185
  );
1224
1186
  return /* @__PURE__ */ e.jsxs(
1225
- de,
1187
+ ce,
1226
1188
  {
1227
- fallback: a,
1228
- onError: (c) => {
1229
- console.warn(c);
1189
+ fallback: l,
1190
+ onError: (d) => {
1191
+ console.warn(d);
1230
1192
  },
1231
1193
  children: [
1232
- /* @__PURE__ */ e.jsx(ae, { fallback: a, children: /* @__PURE__ */ e.jsx("group", { ref: o, children: /* @__PURE__ */ e.jsx(
1233
- Re,
1194
+ /* @__PURE__ */ e.jsx(ie, { fallback: l, children: /* @__PURE__ */ e.jsx("group", { ref: o, children: /* @__PURE__ */ e.jsx(
1195
+ je,
1234
1196
  {
1235
1197
  rapidlyChangingMotionState: t,
1236
1198
  dhParameters: r,
1237
1199
  children: /* @__PURE__ */ e.jsx(
1238
- ge,
1200
+ me,
1239
1201
  {
1240
1202
  modelURL: (() => {
1241
- const c = l(n, h);
1242
- if (!c) {
1243
- const y = new Blob([], { type: "model/gltf-binary" }), m = new File([y], `${n}.glb`, { type: "model/gltf-binary" });
1244
- return Promise.resolve(URL.createObjectURL(m));
1203
+ const d = a(s, h);
1204
+ if (!d) {
1205
+ const x = new Blob([], { type: "model/gltf-binary" }), p = new File([x], `${s}.glb`, { type: "model/gltf-binary" });
1206
+ return Promise.resolve(URL.createObjectURL(p));
1245
1207
  }
1246
- return c;
1208
+ return d;
1247
1209
  })(),
1248
- postModelRender: f,
1249
- flangeRef: s,
1250
- ...d
1210
+ postModelRender: u,
1211
+ flangeRef: i,
1212
+ ...n
1251
1213
  }
1252
1214
  )
1253
1215
  }
1254
1216
  ) }) }),
1255
- /* @__PURE__ */ e.jsx(ye, {})
1217
+ /* @__PURE__ */ e.jsx(fe, {})
1256
1218
  ]
1257
1219
  }
1258
1220
  );
@@ -1260,41 +1222,41 @@ const _e = U(
1260
1222
  );
1261
1223
  function dt({
1262
1224
  connectedMotionGroup: t,
1263
- getModel: n = E,
1225
+ getModel: s = C,
1264
1226
  flangeRef: r,
1265
- transparentColor: l,
1266
- postModelRender: s,
1267
- ...f
1227
+ transparentColor: a,
1228
+ postModelRender: i,
1229
+ ...u
1268
1230
  }) {
1269
1231
  if (!t.dhParameters)
1270
1232
  return null;
1271
- const u = t.modelFromController || "";
1272
- return u && n(u) ? /* @__PURE__ */ e.jsx(
1273
- _e,
1233
+ const c = t.modelFromController || "";
1234
+ return c && s(c) ? /* @__PURE__ */ e.jsx(
1235
+ be,
1274
1236
  {
1275
1237
  rapidlyChangingMotionState: t.rapidlyChangingMotionState,
1276
- modelFromController: u,
1238
+ modelFromController: c,
1277
1239
  dhParameters: t.dhParameters,
1278
- getModel: n,
1240
+ getModel: s,
1279
1241
  flangeRef: r,
1280
- transparentColor: l,
1281
- postModelRender: s,
1282
- ...f
1242
+ transparentColor: a,
1243
+ postModelRender: i,
1244
+ ...u
1283
1245
  }
1284
1246
  ) : /* @__PURE__ */ e.jsx(
1285
- ve,
1247
+ we,
1286
1248
  {
1287
1249
  rapidlyChangingMotionState: t.rapidlyChangingMotionState,
1288
1250
  dhParameters: t.dhParameters,
1289
- ...f
1251
+ ...u
1290
1252
  }
1291
1253
  );
1292
1254
  }
1293
- const ie = {
1294
- [T.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
1295
- [T.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1296
- [T.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1297
- [T.Kuka]: [
1255
+ const re = {
1256
+ [v.Abb]: [0, 0, 0, 0, Math.PI / 2, 0, 0],
1257
+ [v.Fanuc]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1258
+ [v.Yaskawa]: [0, 0, 0, 0, -Math.PI / 2, 0, 0],
1259
+ [v.Kuka]: [
1298
1260
  0,
1299
1261
  -Math.PI / 2,
1300
1262
  Math.PI / 2,
@@ -1303,7 +1265,7 @@ const ie = {
1303
1265
  0,
1304
1266
  0
1305
1267
  ],
1306
- [T.Universalrobots]: [
1268
+ [v.Universalrobots]: [
1307
1269
  0,
1308
1270
  -Math.PI / 2,
1309
1271
  -Math.PI / 2,
@@ -1313,54 +1275,54 @@ const ie = {
1313
1275
  0
1314
1276
  ]
1315
1277
  };
1316
- function Xe(t) {
1317
- const [n] = t.split("_");
1318
- switch (n) {
1278
+ function Ye(t) {
1279
+ const [s] = t.split("_");
1280
+ switch (s) {
1319
1281
  case "ABB":
1320
- return T.Abb;
1282
+ return v.Abb;
1321
1283
  case "FANUC":
1322
- return T.Fanuc;
1284
+ return v.Fanuc;
1323
1285
  case "YASKAWA":
1324
- return T.Yaskawa;
1286
+ return v.Yaskawa;
1325
1287
  case "KUKA":
1326
- return T.Kuka;
1288
+ return v.Kuka;
1327
1289
  case "UniversalRobots":
1328
- return T.Universalrobots;
1290
+ return v.Universalrobots;
1329
1291
  default:
1330
1292
  return null;
1331
1293
  }
1332
1294
  }
1333
- function ft(t, n) {
1334
- const r = Xe(t);
1335
- return r && r in ie ? ie[r] : n || null;
1295
+ function pt(t, s) {
1296
+ const r = Ye(t);
1297
+ return r && r in re ? re[r] : s || null;
1336
1298
  }
1337
1299
  const ht = U((t) => {
1338
1300
  const {
1339
- inverseSolver: n,
1301
+ inverseSolver: s,
1340
1302
  dhParameters: r,
1341
- ...l
1342
- } = t, [s, f] = A(O.RevoluteJoint);
1303
+ ...a
1304
+ } = t, [i, u] = G(O.RevoluteJoint);
1343
1305
  M(() => {
1344
- r.length && f(r[0].type ?? O.RevoluteJoint);
1306
+ r.length && u(r[0].type ?? O.RevoluteJoint);
1345
1307
  }, [r]);
1346
- const u = C(() => n === null && s === O.RevoluteJoint, [n, s]), h = C(() => n === null && s === O.PrismaticJoint, [n, s]);
1347
- return C(() => !!n, [n]) || u ? /* @__PURE__ */ e.jsx(be, { dhParameters: r, ...l }) : h ? /* @__PURE__ */ e.jsx(_e, { dhParameters: r, ...l }) : /* @__PURE__ */ e.jsx(e.Fragment, {});
1308
+ const c = V(() => s === null && i === O.RevoluteJoint, [s, i]), h = V(() => s === null && i === O.PrismaticJoint, [s, i]);
1309
+ return V(() => !!s, [s]) || c ? /* @__PURE__ */ e.jsx(ge, { dhParameters: r, ...a }) : h ? /* @__PURE__ */ e.jsx(be, { dhParameters: r, ...a }) : /* @__PURE__ */ e.jsx(e.Fragment, {});
1348
1310
  });
1349
1311
  export {
1350
- at as C,
1312
+ it as C,
1351
1313
  dt as L,
1352
- ie as M,
1353
- oe as P,
1354
- Ye as R,
1355
- lt as S,
1356
- ct as T,
1314
+ re as M,
1315
+ te as P,
1316
+ qe as R,
1317
+ at as S,
1318
+ lt as T,
1357
1319
  ht as a,
1358
- ut as b,
1359
- _e as c,
1360
- be as d,
1361
- pt as e,
1362
- E as f,
1363
- Xe as g,
1364
- ft as h
1320
+ ct as b,
1321
+ be as c,
1322
+ ge as d,
1323
+ ut as e,
1324
+ C as f,
1325
+ Ye as g,
1326
+ pt as h
1365
1327
  };
1366
- //# sourceMappingURL=MotionGroupVisualizer-7Mw9PINy.js.map
1328
+ //# sourceMappingURL=MotionGroupVisualizer--j-KhrNT.js.map