@wandelbots/wandelbots-js-react-components 6.4.0-pr.revamp.667.bd2ec84 → 6.4.0-pr.revamp.667.ca77f09

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 (154) hide show
  1. package/README.md +172 -40
  2. package/dist/3d.cjs +1 -1
  3. package/dist/3d.d.ts +3 -4
  4. package/dist/3d.js +35 -38
  5. package/dist/CurrentPose/index.cjs +1 -1
  6. package/dist/CurrentPose/index.js +2 -2
  7. package/dist/CurrentPoseBar/index.cjs +1 -1
  8. package/dist/CurrentPoseBar/index.js +1 -1
  9. package/dist/JoggingButtons/index.cjs +1 -1
  10. package/dist/JoggingButtons/index.js +1 -1
  11. package/dist/JoggingGizmo/index.cjs +1 -1
  12. package/dist/JoggingGizmo/index.js +2 -2
  13. package/dist/JoggingJointSlider/index.cjs +1 -1
  14. package/dist/JoggingJointSlider/index.js +1 -1
  15. package/dist/RobotControl/index.cjs +1 -1
  16. package/dist/RobotControl/index.js +2 -2
  17. package/dist/RobotControlPanel/index.cjs +1 -1
  18. package/dist/RobotControlPanel/index.d.ts +1 -1
  19. package/dist/RobotControlPanel/index.js +1 -1
  20. package/dist/RobotHeader/index.cjs +1 -1
  21. package/dist/RobotHeader/index.d.ts +3 -5
  22. package/dist/RobotHeader/index.js +6 -7
  23. package/dist/RobotScene/index.cjs +1 -1
  24. package/dist/RobotScene/index.js +3 -3
  25. package/dist/RobotView/index.cjs +1 -1
  26. package/dist/RobotView/index.js +2 -2
  27. package/dist/SafetyBar/IndicatorWithExplanation.d.ts +12 -1
  28. package/dist/SafetyBar/SafetyBar.d.ts +15 -1
  29. package/dist/SafetyBar/index.cjs +1 -1
  30. package/dist/SafetyBar/index.d.ts +0 -1
  31. package/dist/SafetyBar/index.js +3 -4
  32. package/dist/SafetyBar/robotSafetyOf.d.ts +1 -0
  33. package/dist/chunks/{ConnectedMotionGroup-BifrgwV1.js → ConnectedMotionGroup-DNYakgxy.js} +6 -5
  34. package/dist/chunks/ConnectedMotionGroup-IRTsTxwB.cjs +3 -0
  35. package/dist/chunks/{CurrentPose-CMqO8oqX.cjs → CurrentPose-CAq9e9JY.cjs} +1 -1
  36. package/dist/chunks/{CurrentPose-CdD2ZB7B.js → CurrentPose-CgdINEh2.js} +3 -3
  37. package/dist/chunks/{CurrentPoseBar-CX1xFBtm.js → CurrentPoseBar--HkZBGnN.js} +11 -11
  38. package/dist/chunks/{CurrentPoseBar-BTBAwIO4.cjs → CurrentPoseBar-DoOUfRRs.cjs} +1 -1
  39. package/dist/chunks/{JoggingButtons-aijK-3g6.js → JoggingButtons-BNOnpcTH.js} +1 -1
  40. package/dist/chunks/{JoggingButtons-BOHl7hVq.cjs → JoggingButtons-Boaym2hQ.cjs} +1 -1
  41. package/dist/chunks/{JoggingGizmo-CoKYUtXq.cjs → JoggingGizmo-CNFjpWDv.cjs} +1 -1
  42. package/dist/chunks/{JoggingGizmo-DHvrJouR.js → JoggingGizmo-RDiEVQes.js} +1 -1
  43. package/dist/chunks/{JoggingGizmoOrientation-CIvIAIeO.js → JoggingGizmoOrientation-Dzzz2gEz.js} +1 -1
  44. package/dist/chunks/{JoggingGizmoOrientation-DVcagPRJ.cjs → JoggingGizmoOrientation-laUrgY0N.cjs} +1 -1
  45. package/dist/chunks/{JoggingJointSlider-DQtt4-pa.js → JoggingJointSlider-BY-Tof8G.js} +1 -1
  46. package/dist/chunks/{JoggingJointSlider-CTFYKzsU.cjs → JoggingJointSlider-Dm3vILd3.cjs} +1 -1
  47. package/dist/chunks/{JoggingRefusedError-BIkUM6-g.js → JoggingRefusedError-C4D8_YR_.js} +5 -3
  48. package/dist/chunks/JoggingRefusedError-DqyrfUcc.cjs +1 -0
  49. package/dist/chunks/Pose3-BfBNPRDM.cjs +1 -0
  50. package/dist/chunks/{Pose3-B_fLR-Wv.js → Pose3-DWxfC6Dj.js} +1 -2
  51. package/dist/chunks/{Robot-C-IWfxP9.js → Robot-B-VAYuAr.js} +5 -5
  52. package/dist/chunks/{Robot-Cfhjv9Z8.cjs → Robot-DRf8T9Zf.cjs} +1 -1
  53. package/dist/chunks/RobotActivation-CRVxXvlx.cjs +1 -0
  54. package/dist/chunks/RobotActivation-oR-8Y0iq.js +143 -0
  55. package/dist/chunks/RobotControl-Dbe50ZKM.cjs +1 -0
  56. package/dist/chunks/RobotControl-Ms1F7fFe.js +332 -0
  57. package/dist/chunks/RobotControlPanel-B7NxoHsO.cjs +1 -0
  58. package/dist/chunks/RobotControlPanel-CkQlkq8x.js +1029 -0
  59. package/dist/chunks/RobotHeader-CjOaf9s6.cjs +1 -0
  60. package/dist/chunks/RobotHeader-LSuRTDFB.js +395 -0
  61. package/dist/chunks/RobotScene-Au6zpHH1.cjs +1 -0
  62. package/dist/chunks/RobotScene-C6XEgaVR.js +1284 -0
  63. package/dist/chunks/RobotSessionProvider-CoF_tX0O.cjs +1 -0
  64. package/dist/chunks/RobotSessionProvider-DuHi-dtw.js +30 -0
  65. package/dist/chunks/{RobotView-BGYlAWj-.cjs → RobotView-Cg6JfGiY.cjs} +1 -1
  66. package/dist/chunks/{RobotView-D-v8jCM7.js → RobotView-CrAxNkyG.js} +3 -3
  67. package/dist/chunks/{robotSafetyOf-DuKKma1_.js → SafetyBar-C85BAKsL.js} +244 -215
  68. package/dist/chunks/SafetyBar-D2l81Omq.cjs +1 -0
  69. package/dist/chunks/externalizeComponent-CA_sHzyH.cjs +2 -0
  70. package/dist/chunks/{externalizeComponent-4juwPKL5.js → externalizeComponent-CChY_1bN.js} +34 -8
  71. package/dist/chunks/{useSmoothedMotionState-BSSV8aZN.js → hooks-BWoeBWLV.js} +43 -87
  72. package/dist/chunks/hooks-BXe2bNMo.cjs +1 -0
  73. package/dist/chunks/loadRobotSession-BzY9H3F8.cjs +1 -0
  74. package/dist/chunks/{loadRobotSession-GHHtv5dv.js → loadRobotSession-Ts2MumBB.js} +1065 -679
  75. package/dist/chunks/poseText-BxG4Caa-.js +48 -0
  76. package/dist/chunks/poseText-CwplkbDM.cjs +1 -0
  77. package/dist/chunks/useSmoothedMotionState-CCXmMZ0S.cjs +1 -0
  78. package/dist/chunks/useSmoothedMotionState-CELh-YJa.js +50 -0
  79. package/dist/components/VelocitySlider.d.ts +14 -1
  80. package/dist/components/connectionWarning/ConnectionWarning.d.ts +18 -4
  81. package/dist/components/connectionWarning/connectionWarningOf.d.ts +1 -11
  82. package/dist/components/jogging/JoggingCartesianAxisControl.d.ts +7 -1
  83. package/dist/components/jogging/JoggingCartesianTab.d.ts +6 -0
  84. package/dist/components/jogging/JoggingJointTab.d.ts +5 -0
  85. package/dist/components/jogging/JoggingJointValueControl.d.ts +7 -1
  86. package/dist/components/jogging/JoggingPanel.d.ts +11 -0
  87. package/dist/components/jogging/JoggingRefusedError.d.ts +8 -3
  88. package/dist/components/jogging/JoggingStore.d.ts +206 -17
  89. package/dist/components/jogging/joggingColors.d.ts +6 -0
  90. package/dist/components/robotControl/CartesianJogTab.d.ts +14 -3
  91. package/dist/components/robotControl/JogArea.d.ts +6 -3
  92. package/dist/components/robotControl/JogDisabledReason.d.ts +15 -0
  93. package/dist/components/robotControl/JointJogTab.d.ts +10 -2
  94. package/dist/components/robotControl/MoveToTab.d.ts +24 -3
  95. package/dist/components/robotControl/PoseField.d.ts +3 -1
  96. package/dist/components/robotControl/RobotControl.d.ts +3 -0
  97. package/dist/components/robotControl/RobotControlPanel.d.ts +91 -22
  98. package/dist/components/robotControl/VelocityRow.d.ts +8 -2
  99. package/dist/components/robotControl/atPose.d.ts +6 -0
  100. package/dist/components/robotControl/poseText.d.ts +13 -1
  101. package/dist/components/robotControl/units.d.ts +10 -2
  102. package/dist/components/robotControl/useRobotControlProps.d.ts +7 -4
  103. package/dist/components/robotControl/velocityText.d.ts +18 -0
  104. package/dist/components/robotHeader/ActivationSwitch.d.ts +13 -2
  105. package/dist/components/robotHeader/RobotHeader.d.ts +25 -4
  106. package/dist/components/robotHeader/robotActivationOf.d.ts +1 -8
  107. package/dist/components/robotScene/RobotScene.d.ts +7 -1
  108. package/dist/components/robots/MotionGroupVisualizer.d.ts +6 -4
  109. package/dist/components/robots/SupportedLinearAxis.d.ts +6 -4
  110. package/dist/components/robots/SupportedRobot.d.ts +7 -5
  111. package/dist/components/robots/useFrameSmoothedMotionState.d.ts +25 -0
  112. package/dist/components/utils/useSmoothedMotionState.d.ts +11 -2
  113. package/dist/core.cjs +1 -1
  114. package/dist/core.d.ts +8 -10
  115. package/dist/core.js +60 -69
  116. package/dist/index.cjs +1 -1
  117. package/dist/index.js +100 -113
  118. package/dist/lib/ConnectedMotionGroup.d.ts +11 -0
  119. package/dist/lib/ControllerStateStream.d.ts +9 -9
  120. package/dist/lib/JoggerConnection.d.ts +48 -13
  121. package/dist/lib/MotionStreamConnection.d.ts +3 -2
  122. package/dist/lib/TrajectoryExecutionStore.d.ts +58 -20
  123. package/dist/lib/controllerStateSource.d.ts +6 -5
  124. package/dist/lib/robotSession/RobotActivation.d.ts +52 -21
  125. package/dist/lib/robotSession/RobotSession.d.ts +27 -8
  126. package/dist/lib/robotSession/RobotTargetPose.d.ts +4 -2
  127. package/dist/lib/robotSession/loadRobotSession.d.ts +1 -1
  128. package/dist/lib/robotSession/robotPose.d.ts +0 -6
  129. package/dist/session.cjs +1 -1
  130. package/dist/session.d.ts +6 -6
  131. package/dist/session.js +30 -38
  132. package/package.json +22 -1
  133. package/dist/chunks/ConnectedMotionGroup-CybwJHkh.cjs +0 -3
  134. package/dist/chunks/JoggingRefusedError-BuCGsVsa.cjs +0 -1
  135. package/dist/chunks/Pose3-Ch4xVeXV.cjs +0 -1
  136. package/dist/chunks/RobotActivation-Bb0oNSBN.cjs +0 -1
  137. package/dist/chunks/RobotActivation-C0rrwpQZ.js +0 -115
  138. package/dist/chunks/RobotControl-Cv6Sr1Ni.js +0 -289
  139. package/dist/chunks/RobotControl-DFnOYMAa.cjs +0 -1
  140. package/dist/chunks/RobotControlPanel-B1_9g9D-.js +0 -850
  141. package/dist/chunks/RobotControlPanel-BpTpRBgy.cjs +0 -1
  142. package/dist/chunks/RobotScene-0ZJzXL50.cjs +0 -1
  143. package/dist/chunks/RobotScene-DpFeFpnx.js +0 -1255
  144. package/dist/chunks/RobotSessionProvider--AekyPqD.cjs +0 -1
  145. package/dist/chunks/RobotSessionProvider-TVaKGzqa.js +0 -25
  146. package/dist/chunks/externalizeComponent-Br_U-QAr.cjs +0 -2
  147. package/dist/chunks/loadRobotSession-DYbeNnTI.cjs +0 -1
  148. package/dist/chunks/poseText-BXUaQWnK.cjs +0 -1
  149. package/dist/chunks/poseText-pg4cxE8R.js +0 -41
  150. package/dist/chunks/robotActivationOf-B4oV10Za.cjs +0 -1
  151. package/dist/chunks/robotActivationOf-EzcT9g07.js +0 -368
  152. package/dist/chunks/robotSafetyOf-Dxm6s7Pp.cjs +0 -1
  153. package/dist/chunks/useSmoothedMotionState-B9WO73k0.cjs +0 -1
  154. package/dist/components/robotHeader/robotSafetyOf.d.ts +0 -11
@@ -0,0 +1,1029 @@
1
+ import { jsxs as v, jsx as o, Fragment as X } from "react/jsx-runtime";
2
+ import ut from "@mui/material/IconButton";
3
+ import T from "@mui/material/Stack";
4
+ import U from "@mui/material/Tab";
5
+ import bt from "@mui/material/Tabs";
6
+ import W from "@mui/material/Typography";
7
+ import { CloseFilled as dt } from "@wandelbots/icons/CloseFilled";
8
+ import { useState as z, useId as nt, useRef as A, useEffect as L } from "react";
9
+ import { useTranslation as N } from "react-i18next";
10
+ import { e as gt } from "./externalizeComponent-CChY_1bN.js";
11
+ import Z from "@mui/material/Divider";
12
+ import H from "@mui/material/Tooltip";
13
+ import { Jog as ht } from "@wandelbots/icons/Jog";
14
+ import { ViewModuleFilled as mt } from "@wandelbots/icons/ViewModuleFilled";
15
+ import { J as Ct } from "./JoggingGizmo-RDiEVQes.js";
16
+ import { J as xt } from "./JoggingButtons-BNOnpcTH.js";
17
+ import { i as vt } from "./useWebGLRenderer-BozrbZz-.js";
18
+ import { styled as Rt } from "@mui/material/styles";
19
+ import et from "@mui/material/ToggleButton";
20
+ import yt from "@mui/material/ToggleButtonGroup";
21
+ import { P as K, I as Mt, a as Tt, u as rt } from "./useEveryFrame-D04ygIe7.js";
22
+ import St from "@mui/material/Box";
23
+ import kt from "@mui/material/FormHelperText";
24
+ import Jt from "@mui/material/InputAdornment";
25
+ import wt from "@mui/material/Slider";
26
+ import { AdornedTextField as pt, SecondaryButton as At, PrimaryButton as It, RoundedIconButton as F } from "@wandelbots/mui";
27
+ import { J as Et } from "./JoggingJointSlider-BY-Tof8G.js";
28
+ import { CachedFilled as Pt } from "@wandelbots/icons/CachedFilled";
29
+ import { Undo as Bt } from "@wandelbots/icons/Undo";
30
+ import { NorthEastFilled as Nt } from "@wandelbots/icons/NorthEastFilled";
31
+ import { d as Vt } from "./joggingColors-sb6IFdj2.js";
32
+ import { CheckFilled as lt } from "@wandelbots/icons/CheckFilled";
33
+ import { ContentCopyFilled as zt } from "@wandelbots/icons/ContentCopyFilled";
34
+ import { EditFilled as Ot } from "@wandelbots/icons/EditFilled";
35
+ import { j as at, p as it, a as Ft } from "./poseText-BxG4Caa-.js";
36
+ function Lt({
37
+ view: t,
38
+ onViewChange: n,
39
+ mode: e,
40
+ controls: l,
41
+ disabledReason: s,
42
+ gizmoOrientation: p,
43
+ gizmoFrameQuaternion: g
44
+ }) {
45
+ const { t: a } = N(), [m, i] = z(vt), r = p !== void 0 && m, c = t === "gizmo" && r, u = a(c ? e === "increment" ? "RobotControl.JogArea.Hint.ClickHandle.lb" : "RobotControl.JogArea.Hint.HoldHandle.lb" : e === "increment" ? "RobotControl.JogArea.Hint.ClickButton.lb" : "RobotControl.JogArea.Hint.HoldButton.lb"), f = a(c ? "RobotControl.JogArea.ShowButtons.bt" : "RobotControl.JogArea.ShowGizmo.bt");
46
+ return /* @__PURE__ */ v(
47
+ T,
48
+ {
49
+ "data-testid": "jog-area",
50
+ sx: { position: "relative", alignItems: "center", gap: "16px" },
51
+ children: [
52
+ r && /* @__PURE__ */ o(H, { title: f, placement: "left", children: /* @__PURE__ */ o(
53
+ ut,
54
+ {
55
+ "aria-label": f,
56
+ onClick: () => n(c ? "buttons" : "gizmo"),
57
+ size: "small",
58
+ sx: (C) => {
59
+ var d;
60
+ return {
61
+ position: "absolute",
62
+ top: 0,
63
+ right: 0,
64
+ zIndex: 1,
65
+ borderRadius: "8px",
66
+ border: `1px solid ${C.palette.divider}`,
67
+ background: (d = C.palette.backgroundPaperElevation) == null ? void 0 : d[11]
68
+ };
69
+ },
70
+ children: c ? /* @__PURE__ */ o(mt, {}) : /* @__PURE__ */ o(ht, {})
71
+ }
72
+ ) }),
73
+ c ? /* @__PURE__ */ o(
74
+ Ct,
75
+ {
76
+ ...l,
77
+ orientation: p,
78
+ frameQuaternion: g,
79
+ size: 180,
80
+ onWebGLUnavailable: () => i(!1)
81
+ }
82
+ ) : /* @__PURE__ */ o(xt, { ...l }),
83
+ s ?? /* @__PURE__ */ o(W, { variant: "body2", color: "text.secondary", textAlign: "center", children: u })
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ const Dt = Rt(yt)(({ theme: t }) => {
89
+ var n;
90
+ return {
91
+ gap: "4px",
92
+ "& .MuiToggleButton-root": {
93
+ border: "none",
94
+ borderRadius: "8px",
95
+ padding: "6px 16px",
96
+ textTransform: "none",
97
+ fontSize: "14px",
98
+ color: t.palette.text.secondary
99
+ },
100
+ "& .MuiToggleButton-root.Mui-selected": {
101
+ color: t.palette.text.primary,
102
+ background: (n = t.palette.backgroundPaperElevation) == null ? void 0 : n[11]
103
+ }
104
+ };
105
+ });
106
+ function Ht({
107
+ value: t,
108
+ onChange: n,
109
+ disabled: e
110
+ }) {
111
+ const { t: l } = N();
112
+ return /* @__PURE__ */ v(
113
+ Dt,
114
+ {
115
+ exclusive: !0,
116
+ value: t,
117
+ disabled: e,
118
+ "aria-label": l("RobotControl.JogMode.lb"),
119
+ onChange: (s, p) => {
120
+ p !== null && n(p);
121
+ },
122
+ children: [
123
+ /* @__PURE__ */ o(et, { value: "continuous", children: l("RobotControl.JogMode.Continuous.bt") }),
124
+ /* @__PURE__ */ o(et, { value: "increment", children: l("RobotControl.JogMode.Increment.bt") })
125
+ ]
126
+ }
127
+ );
128
+ }
129
+ function D({ children: t }) {
130
+ return /* @__PURE__ */ o(T, { sx: { padding: "16px 20px", gap: "16px" }, children: t });
131
+ }
132
+ function Gt(t) {
133
+ return t * 180 / Math.PI;
134
+ }
135
+ function _t(t) {
136
+ return t * Math.PI / 180;
137
+ }
138
+ function ft(t, n) {
139
+ return t === "rotate" ? Gt(n) : n;
140
+ }
141
+ function Xt(t, n) {
142
+ return t === "rotate" ? _t(n) : n;
143
+ }
144
+ function Wt(t, n) {
145
+ const e = String(Number(ft(t, n).toFixed(2)));
146
+ return t === "rotate" ? `${e}°` : `${e} mm`;
147
+ }
148
+ function q(t, n) {
149
+ return Number(ft(t, n).toFixed(2));
150
+ }
151
+ function $t(t) {
152
+ return t === "rotate" ? "°/s" : "mm/s";
153
+ }
154
+ function ct(t, n) {
155
+ return t === "rotate" ? `${n}°/s` : `${n} mm/s`;
156
+ }
157
+ const Ut = /^[+-]?(\d+([.,]\d*)?|[.,]\d+)$/;
158
+ function Kt(t, n, e) {
159
+ const l = t.trim();
160
+ if (l === "") return { kind: "empty" };
161
+ if (!Ut.test(l)) return { kind: "notANumber" };
162
+ const s = Number(l.replace(",", "."));
163
+ return Number.isFinite(s) ? s < n || s > e ? { kind: "outOfRange" } : { kind: "valid", value: s } : { kind: "notANumber" };
164
+ }
165
+ function j({
166
+ motion: t,
167
+ velocity: n,
168
+ onChange: e,
169
+ disabled: l
170
+ }) {
171
+ const { t: s } = N(), p = nt(), g = nt(), [a, m] = z(null), i = (a == null ? void 0 : a.motion) === t ? a.text : null, r = q(t, n.value), c = q(t, n.min), u = q(t, n.max), f = i === null ? null : Kt(i, c, u), C = f === null || f.kind === "valid" ? null : f.kind === "outOfRange" ? s("RobotControl.Velocity.OutOfRange.lb", {
172
+ min: ct(t, c),
173
+ max: ct(t, u),
174
+ // React escapes the text; i18next's escaping on top of it would
175
+ // show the "/" of "mm/s" as "&#x2F;"
176
+ interpolation: { escapeValue: !1 }
177
+ }) : s("RobotControl.Velocity.NotANumber.lb");
178
+ function d(b) {
179
+ e(
180
+ Math.min(n.max, Math.max(n.min, Xt(t, b)))
181
+ ), m(null);
182
+ }
183
+ function R() {
184
+ (f == null ? void 0 : f.kind) === "valid" && d(f.value);
185
+ }
186
+ return /* @__PURE__ */ v(T, { gap: "4px", children: [
187
+ /* @__PURE__ */ v(
188
+ T,
189
+ {
190
+ direction: "row",
191
+ sx: { alignItems: "center", justifyContent: "space-between", gap: 2 },
192
+ children: [
193
+ /* @__PURE__ */ o(W, { id: p, variant: "body2", color: "text.secondary", children: s("RobotControl.Velocity.lb") }),
194
+ /* @__PURE__ */ o(St, { sx: { width: "calc((100% - 12px) / 2)", flexShrink: 0 }, children: /* @__PURE__ */ o(
195
+ pt,
196
+ {
197
+ adornedSize: "small",
198
+ fullWidth: !0,
199
+ value: i ?? String(r),
200
+ error: C !== null,
201
+ disabled: l,
202
+ autoComplete: "off",
203
+ onChange: (b) => m({ motion: t, text: b.target.value }),
204
+ onFocus: (b) => b.target.select(),
205
+ onBlur: R,
206
+ onKeyDown: (b) => {
207
+ b.key === "Enter" ? R() : b.key === "Escape" && m(null);
208
+ },
209
+ slotProps: {
210
+ input: {
211
+ endAdornment: /* @__PURE__ */ o(Jt, { position: "end", children: $t(t) })
212
+ },
213
+ htmlInput: {
214
+ inputMode: "decimal",
215
+ "aria-labelledby": p,
216
+ "aria-describedby": C === null ? void 0 : g
217
+ }
218
+ },
219
+ sx: {
220
+ "& input": {
221
+ textAlign: "right",
222
+ fontVariantNumeric: "tabular-nums"
223
+ }
224
+ }
225
+ }
226
+ ) })
227
+ ]
228
+ }
229
+ ),
230
+ C !== null && // Not the field's own helper text: that is as narrow as the field
231
+ /* @__PURE__ */ o(
232
+ kt,
233
+ {
234
+ error: !0,
235
+ id: g,
236
+ sx: { margin: 0, textAlign: "right" },
237
+ children: C
238
+ }
239
+ ),
240
+ /* @__PURE__ */ o(
241
+ wt,
242
+ {
243
+ "aria-labelledby": p,
244
+ size: "small",
245
+ value: Math.round(r),
246
+ min: Math.ceil(c),
247
+ max: Math.floor(u),
248
+ disabled: l,
249
+ onChange: (b, y) => {
250
+ typeof y == "number" && d(y);
251
+ },
252
+ sx: (b) => {
253
+ var y;
254
+ return {
255
+ // The rail and the hollow thumb of the joint sliders, as in the
256
+ // design: a 4 px rail (the small slider's is 2 px)
257
+ height: 4,
258
+ "& .MuiSlider-rail": { opacity: 0.38 },
259
+ "& .MuiSlider-thumb": {
260
+ width: 16,
261
+ height: 16,
262
+ border: `3px solid ${b.palette.primary.main}`,
263
+ backgroundColor: (y = b.palette.backgroundPaperElevation) == null ? void 0 : y[5]
264
+ }
265
+ };
266
+ }
267
+ }
268
+ )
269
+ ] });
270
+ }
271
+ function Qt({
272
+ motion: t,
273
+ settings: n,
274
+ onSettingsChange: e,
275
+ disabled: l = !1,
276
+ jogDisabled: s = !1,
277
+ tcp: p,
278
+ jogFrame: g,
279
+ velocity: a,
280
+ onVelocityChange: m,
281
+ onJogStart: i,
282
+ onJogStop: r,
283
+ increments: c,
284
+ jogDisabledReason: u,
285
+ gizmoOrientation: f,
286
+ gizmoFrameQuaternion: C
287
+ }) {
288
+ const { t: d } = N(), R = c ? n.mode : "continuous", b = (c == null ? void 0 : c.steps[t]) ?? [], y = Math.min(n.step[t], b.length - 1), S = b[y], E = !!(c != null && c.running), k = l || s || E, J = A(!1);
289
+ function O(h, I) {
290
+ if (R === "increment") {
291
+ c && S !== void 0 && c.onStep(t, h, I, S);
292
+ return;
293
+ }
294
+ J.current = !0, i(t, h, I);
295
+ }
296
+ function P() {
297
+ J.current && (J.current = !1, r());
298
+ }
299
+ return /* @__PURE__ */ v(X, { children: [
300
+ (p || g) && /* @__PURE__ */ v(X, { children: [
301
+ /* @__PURE__ */ o(D, { children: /* @__PURE__ */ v(T, { direction: "row", sx: { gap: "12px" }, children: [
302
+ p && /* @__PURE__ */ o(
303
+ K,
304
+ {
305
+ label: d("RobotControl.Tcp.lb"),
306
+ ...p,
307
+ disabled: k
308
+ }
309
+ ),
310
+ g && /* @__PURE__ */ o(
311
+ K,
312
+ {
313
+ label: d("RobotControl.JogFrame.lb"),
314
+ ...g,
315
+ disabled: l
316
+ }
317
+ )
318
+ ] }) }),
319
+ /* @__PURE__ */ o(Z, { sx: { marginX: "20px" } })
320
+ ] }),
321
+ /* @__PURE__ */ v(D, { children: [
322
+ c && /* @__PURE__ */ o(
323
+ Ht,
324
+ {
325
+ value: R,
326
+ onChange: (h) => e({ ...n, mode: h }),
327
+ disabled: l
328
+ }
329
+ ),
330
+ /* @__PURE__ */ o(
331
+ j,
332
+ {
333
+ motion: t,
334
+ velocity: a[t],
335
+ onChange: (h) => m(t, h),
336
+ disabled: l
337
+ }
338
+ ),
339
+ R === "increment" && S !== void 0 && /* @__PURE__ */ o(
340
+ Mt,
341
+ {
342
+ label: d("RobotControl.StepSize.lb"),
343
+ value: String(y),
344
+ options: b.map((h, I) => ({
345
+ id: String(I),
346
+ label: Wt(t, h)
347
+ })),
348
+ onChange: (h) => e({
349
+ ...n,
350
+ step: { ...n.step, [t]: Number(h) }
351
+ }),
352
+ disabled: l
353
+ }
354
+ )
355
+ ] }),
356
+ /* @__PURE__ */ o(Z, { sx: { marginX: "20px" } }),
357
+ /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(
358
+ Lt,
359
+ {
360
+ view: n.view,
361
+ onViewChange: (h) => e({ ...n, view: h }),
362
+ mode: R,
363
+ controls: {
364
+ motion: t,
365
+ onJogStart: O,
366
+ onJogStop: P,
367
+ activeHandle: R === "increment" ? c == null ? void 0 : c.running : null,
368
+ disabled: k
369
+ },
370
+ disabledReason: u,
371
+ gizmoOrientation: f,
372
+ gizmoFrameQuaternion: C
373
+ },
374
+ R
375
+ ) })
376
+ ] });
377
+ }
378
+ function qt({
379
+ text: t,
380
+ onRetry: n,
381
+ disabled: e
382
+ }) {
383
+ const { t: l } = N();
384
+ return /* @__PURE__ */ v(
385
+ T,
386
+ {
387
+ "data-testid": "jog-disabled-reason",
388
+ sx: { alignItems: "center", gap: "8px" },
389
+ children: [
390
+ /* @__PURE__ */ o(
391
+ W,
392
+ {
393
+ role: "status",
394
+ variant: "body2",
395
+ color: "text.secondary",
396
+ textAlign: "center",
397
+ children: t
398
+ }
399
+ ),
400
+ n && /* @__PURE__ */ o(At, { size: "small", onClick: n, disabled: e, children: l("RobotControl.JogDisabled.Retry.bt") })
401
+ ]
402
+ }
403
+ );
404
+ }
405
+ function Yt({
406
+ joints: t,
407
+ disabled: n,
408
+ jogDisabled: e,
409
+ disabledReason: l
410
+ }) {
411
+ const s = A(null), [p, g] = z(null);
412
+ function a(i, r) {
413
+ s.current !== null && s.current !== i || (s.current = i, g(i), t.onJogStart(i, r));
414
+ }
415
+ function m(i) {
416
+ s.current === i && (s.current = null, g(null), t.onJogStop());
417
+ }
418
+ return /* @__PURE__ */ v(X, { children: [
419
+ /* @__PURE__ */ v(D, { children: [
420
+ /* @__PURE__ */ o(T, { sx: { gap: "8px", paddingX: "4px" }, children: t.joints.map((i, r) => /* @__PURE__ */ o(
421
+ Et,
422
+ {
423
+ label: `J${r + 1}`,
424
+ name: i.name,
425
+ value: i.value,
426
+ min: i.min,
427
+ max: i.max,
428
+ linear: t.linear,
429
+ onJogStart: (c) => a(r, c),
430
+ onJogStop: () => m(r),
431
+ disabled: n || e || p !== null && p !== r
432
+ },
433
+ r
434
+ )) }),
435
+ l
436
+ ] }),
437
+ /* @__PURE__ */ o(Z, { sx: { marginX: "20px" } }),
438
+ /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(
439
+ j,
440
+ {
441
+ motion: t.linear ? "translate" : "rotate",
442
+ velocity: t.velocity,
443
+ onChange: t.onVelocityChange,
444
+ disabled: n
445
+ }
446
+ ) })
447
+ ] });
448
+ }
449
+ const Zt = 0.5, jt = 0.01, to = 1e-3;
450
+ function oo(t, n) {
451
+ return t !== null && t.length === n.length && n.every(
452
+ (e, l) => Math.abs(e - (t[l] ?? 0)) <= to
453
+ );
454
+ }
455
+ function no(t, n) {
456
+ return t ? Math.hypot(
457
+ t.position[0] - n.position[0],
458
+ t.position[1] - n.position[1],
459
+ t.position[2] - n.position[2]
460
+ ) <= Zt && eo(t.orientation, n.orientation) <= jt : !1;
461
+ }
462
+ function st(t) {
463
+ const n = Math.hypot(...t);
464
+ if (n < 1e-12) return [1, 0, 0, 0];
465
+ const e = Math.sin(n / 2) / n;
466
+ return [
467
+ Math.cos(n / 2),
468
+ t[0] * e,
469
+ t[1] * e,
470
+ t[2] * e
471
+ ];
472
+ }
473
+ function eo(t, n) {
474
+ const e = st(t), l = st(n), s = Math.abs(e[0] * l[0] + e[1] * l[1] + e[2] * l[2] + e[3] * l[3]);
475
+ return 2 * Math.acos(Math.min(1, s));
476
+ }
477
+ const ro = "move", lo = 200;
478
+ function ao({
479
+ state: t,
480
+ ready: n,
481
+ atPose: e,
482
+ disabled: l,
483
+ onMoveStart: s,
484
+ onMoveStop: p,
485
+ stopRef: g
486
+ }) {
487
+ const { t: a } = N(), [m, i] = z(!1), r = A(void 0), c = A(!1), u = A({ onMoveStart: s, onMoveStop: p });
488
+ u.current = { onMoveStart: s, onMoveStop: p };
489
+ const f = t === "planned", C = f || t === "moving", { handlersFor: d, stop: R } = Vt({
490
+ onStart: () => {
491
+ i(!0), r.current = setTimeout(() => {
492
+ r.current = void 0, c.current = !0, u.current.onMoveStart();
493
+ }, lo);
494
+ },
495
+ onStop: () => {
496
+ i(!1), clearTimeout(r.current), r.current = void 0, c.current && (c.current = !1, u.current.onMoveStop());
497
+ },
498
+ disabled: m ? l || !n || !C : l || !n || e || !f,
499
+ isSame: () => !0
500
+ });
501
+ g && (g.current = R), L(() => () => clearTimeout(r.current), []);
502
+ const b = a(t === "moving" ? "RobotControl.MoveTo.Moving.bt" : t === "stopping" ? "RobotControl.MoveTo.Stopping.bt" : "RobotControl.MoveTo.MoveTo.bt");
503
+ return /* @__PURE__ */ o(
504
+ H,
505
+ {
506
+ title: a(e ? "RobotControl.MoveTo.AtPose.lb" : "RobotControl.MoveTo.HoldToMove.lb"),
507
+ placement: "top",
508
+ children: /* @__PURE__ */ o(
509
+ "span",
510
+ {
511
+ ...d(ro),
512
+ style: {
513
+ display: "block",
514
+ flexGrow: 1,
515
+ touchAction: "none",
516
+ userSelect: "none"
517
+ },
518
+ children: /* @__PURE__ */ o(
519
+ It,
520
+ {
521
+ fullWidth: !0,
522
+ disabled: l || !n || e || !C,
523
+ loading: t === "planning" || t === "stopping",
524
+ loadingPosition: "start",
525
+ startIcon: /* @__PURE__ */ o(Nt, {}),
526
+ "aria-pressed": m,
527
+ children: b
528
+ }
529
+ )
530
+ }
531
+ )
532
+ }
533
+ );
534
+ }
535
+ function io({
536
+ label: t,
537
+ text: n,
538
+ editing: e,
539
+ onEdit: l,
540
+ onDraftChange: s,
541
+ onCancel: p,
542
+ onConfirm: g,
543
+ canConfirm: a,
544
+ error: m,
545
+ disabled: i
546
+ }) {
547
+ const { t: r } = N(), c = A(null), { copied: u, copy: f } = Tt();
548
+ L(() => {
549
+ const d = c.current;
550
+ d && (e ? (d.focus(), d.setSelectionRange(d.value.length, d.value.length)) : document.activeElement === d && (d.blur(), d.scrollLeft = 0));
551
+ }, [e]);
552
+ function C() {
553
+ return f(n, () => {
554
+ var d;
555
+ return (d = c.current) == null ? void 0 : d.select();
556
+ });
557
+ }
558
+ return /* @__PURE__ */ v(T, { direction: "row", sx: { gap: "8px", alignItems: "flex-start" }, children: [
559
+ /* @__PURE__ */ o(
560
+ pt,
561
+ {
562
+ label: t,
563
+ value: n,
564
+ inputRef: c,
565
+ onChange: (d) => s(d.target.value),
566
+ onClick: () => {
567
+ !e && !i && l();
568
+ },
569
+ onKeyDown: (d) => {
570
+ e && (d.key === "Enter" && a ? g() : d.key === "Escape" && p());
571
+ },
572
+ error: !!m,
573
+ helperText: m ?? void 0,
574
+ fullWidth: !0,
575
+ autoComplete: "off",
576
+ slotProps: {
577
+ htmlInput: { readOnly: !e, spellCheck: !1 }
578
+ },
579
+ sx: {
580
+ "& input": {
581
+ fontVariantNumeric: "tabular-nums",
582
+ cursor: e || i ? void 0 : "text"
583
+ }
584
+ }
585
+ }
586
+ ),
587
+ /* @__PURE__ */ o(
588
+ T,
589
+ {
590
+ direction: "row",
591
+ sx: { gap: "8px", height: "56px", alignItems: "center" },
592
+ children: e ? /* @__PURE__ */ v(X, { children: [
593
+ /* @__PURE__ */ o(
594
+ F,
595
+ {
596
+ icon: /* @__PURE__ */ o(dt, {}),
597
+ ariaLabel: r("RobotControl.MoveTo.Cancel.bt"),
598
+ onClick: p
599
+ }
600
+ ),
601
+ /* @__PURE__ */ o(
602
+ H,
603
+ {
604
+ title: r("RobotControl.MoveTo.ConfirmEdit.lb"),
605
+ placement: "top",
606
+ disableInteractive: !0,
607
+ children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
608
+ F,
609
+ {
610
+ icon: /* @__PURE__ */ o(lt, {}),
611
+ ariaLabel: r("RobotControl.MoveTo.ConfirmEdit.lb"),
612
+ onClick: g,
613
+ disabled: !a,
614
+ sx: { color: "primary.main" }
615
+ }
616
+ ) })
617
+ }
618
+ )
619
+ ] }) : /* @__PURE__ */ v(X, { children: [
620
+ /* @__PURE__ */ o(
621
+ H,
622
+ {
623
+ title: r("RobotControl.MoveTo.Copied.lb"),
624
+ open: u,
625
+ disableHoverListener: !0,
626
+ disableInteractive: !0,
627
+ placement: "left",
628
+ children: /* @__PURE__ */ o(
629
+ F,
630
+ {
631
+ icon: u ? /* @__PURE__ */ o(lt, {}) : /* @__PURE__ */ o(zt, {}),
632
+ ariaLabel: r("RobotControl.MoveTo.Copy.bt"),
633
+ onClick: () => void C()
634
+ }
635
+ )
636
+ }
637
+ ),
638
+ /* @__PURE__ */ o(
639
+ F,
640
+ {
641
+ icon: /* @__PURE__ */ o(Ot, {}),
642
+ ariaLabel: r("RobotControl.MoveTo.Edit.bt"),
643
+ onClick: l,
644
+ disabled: i
645
+ }
646
+ )
647
+ ] })
648
+ }
649
+ )
650
+ ] });
651
+ }
652
+ const Y = (t) => "joints" in t;
653
+ function co({
654
+ moveTo: t,
655
+ tcp: n,
656
+ cartesian: e,
657
+ linear: l,
658
+ velocity: s,
659
+ onVelocityChange: p,
660
+ jointVelocity: g,
661
+ disabled: a,
662
+ jogDisabled: m
663
+ }) {
664
+ var G, V, _;
665
+ const { t: i } = N(), [r, c] = z(null), [u, f] = z(null), C = rt(
666
+ () => {
667
+ var tt;
668
+ if (!e) {
669
+ const ot = (tt = t.getCurrentJoints) == null ? void 0 : tt.call(t);
670
+ return ot ? at(ot) : "";
671
+ }
672
+ const w = t.getCurrentPose();
673
+ return w ? it(w) : "";
674
+ },
675
+ r === null && u === null
676
+ ), d = (r == null ? void 0 : r.text) ?? C, R = u !== null, b = u === null ? null : Ft(u, {
677
+ poses: e,
678
+ jointCount: ((V = (G = t.getCurrentJoints) == null ? void 0 : G.call(t)) == null ? void 0 : V.length) ?? null
679
+ }), y = t.notMoveableReason || t.error || null, S = r !== null && !y && !R, E = rt(
680
+ () => {
681
+ var w;
682
+ return r !== null && (Y(r.target) ? oo(
683
+ ((w = t.getCurrentJoints) == null ? void 0 : w.call(t)) ?? null,
684
+ r.target.joints
685
+ ) : no(t.getCurrentPose(), r.target));
686
+ },
687
+ S
688
+ ) && S, k = r ? Y(r.target) : !e, J = A(!1);
689
+ r === null ? J.current = !1 : t.state !== "idle" && (J.current = !0);
690
+ const O = S && J.current && t.state === "idle" && !E, P = A(!1), h = A(null);
691
+ function I() {
692
+ var w;
693
+ (w = h.current) == null || w.call(h), P.current = !1, c(null), f(null), t.onTargetChange(null);
694
+ }
695
+ function Q() {
696
+ b === null || a || (P.current = !1, J.current = !1, c({
697
+ target: b,
698
+ text: Y(b) ? at(b.joints) : it(b)
699
+ }), f(null), t.onTargetChange(b));
700
+ }
701
+ function $() {
702
+ r && t.onTargetChange(r.target);
703
+ }
704
+ L(() => {
705
+ if (S) {
706
+ if (t.state === "moving") {
707
+ P.current = !0;
708
+ return;
709
+ }
710
+ P.current && E && t.state !== "stopping" && I();
711
+ }
712
+ }, [S, t.state, E]);
713
+ const x = [n == null ? void 0 : n.value, (_ = t.frame) == null ? void 0 : _.value].join("\0");
714
+ L(() => {
715
+ r && I();
716
+ }, [x]);
717
+ const M = A({ target: r, onTargetChange: t.onTargetChange });
718
+ M.current = { target: r, onTargetChange: t.onTargetChange }, L(
719
+ () => () => {
720
+ var w;
721
+ (w = h.current) == null || w.call(h), M.current.target && M.current.onTargetChange(null);
722
+ },
723
+ []
724
+ );
725
+ const B = u !== null ? b === null ? i("RobotControl.MoveTo.InvalidPose.lb") : t.notMoveableReason || null : r ? y ?? (O ? i("RobotControl.MoveTo.PlanDropped.lb") : null) : null;
726
+ return /* @__PURE__ */ v(D, { children: [
727
+ n && /* @__PURE__ */ o(
728
+ K,
729
+ {
730
+ label: i("RobotControl.Tcp.lb"),
731
+ ...n,
732
+ disabled: a || m
733
+ }
734
+ ),
735
+ /* @__PURE__ */ o(W, { variant: "body1", color: "text.primary", children: i("RobotControl.MoveTo.TargetPose.lb") }),
736
+ /* @__PURE__ */ v(T, { sx: { gap: "8px" }, children: [
737
+ t.frame && /* @__PURE__ */ o(
738
+ K,
739
+ {
740
+ label: i("RobotControl.MoveTo.RelativeTo.lb"),
741
+ ...t.frame,
742
+ disabled: a
743
+ }
744
+ ),
745
+ /* @__PURE__ */ o(
746
+ io,
747
+ {
748
+ label: e ? i("RobotControl.MoveTo.Coordinates.lb") : i("RobotControl.MoveTo.JointPositions.lb", {
749
+ unit: l ? "mm" : "rad"
750
+ }),
751
+ text: u ?? d,
752
+ editing: R,
753
+ onEdit: () => {
754
+ a || f(d);
755
+ },
756
+ onDraftChange: f,
757
+ onCancel: () => f(null),
758
+ onConfirm: Q,
759
+ canConfirm: b !== null && !a && t.state !== "planning",
760
+ error: B,
761
+ disabled: a
762
+ }
763
+ )
764
+ ] }),
765
+ /* @__PURE__ */ o(
766
+ j,
767
+ {
768
+ motion: k && !l ? "rotate" : "translate",
769
+ velocity: k ? g.velocity : s,
770
+ onChange: k ? g.onChange : p,
771
+ disabled: a
772
+ }
773
+ ),
774
+ /* @__PURE__ */ v(T, { direction: "row", sx: { gap: "12px", alignItems: "center" }, children: [
775
+ r && !R && /* @__PURE__ */ o(H, { title: i("RobotControl.MoveTo.Reset.lb"), placement: "top", children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
776
+ F,
777
+ {
778
+ icon: /* @__PURE__ */ o(Bt, {}),
779
+ ariaLabel: i("RobotControl.MoveTo.Reset.lb"),
780
+ onClick: I
781
+ }
782
+ ) }) }),
783
+ r && !R && (y || O) && /* @__PURE__ */ o(
784
+ H,
785
+ {
786
+ title: i("RobotControl.MoveTo.PlanAgain.lb"),
787
+ placement: "top",
788
+ children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
789
+ F,
790
+ {
791
+ icon: /* @__PURE__ */ o(Pt, {}),
792
+ ariaLabel: i("RobotControl.MoveTo.PlanAgain.lb"),
793
+ onClick: $,
794
+ disabled: a || t.state === "planning"
795
+ }
796
+ ) })
797
+ }
798
+ ),
799
+ /* @__PURE__ */ o(
800
+ ao,
801
+ {
802
+ state: r ? t.state : "idle",
803
+ ready: S,
804
+ atPose: E,
805
+ disabled: a,
806
+ onMoveStart: () => {
807
+ r && t.onMoveStart(r.target);
808
+ },
809
+ onMoveStop: t.onMoveStop,
810
+ stopRef: h
811
+ }
812
+ )
813
+ ] })
814
+ ] });
815
+ }
816
+ const $o = gt(
817
+ ({
818
+ onClose: t,
819
+ sx: n,
820
+ joints: e,
821
+ moveTo: l,
822
+ jogDisabled: s = !1,
823
+ jogDisabledReason: p,
824
+ onJogRetry: g,
825
+ cartesian: a = !0,
826
+ tab: m,
827
+ onTabChange: i,
828
+ jogMode: r,
829
+ onJogModeChange: c,
830
+ ...u
831
+ }) => {
832
+ var $;
833
+ const { t: f } = N(), C = u.disabled ?? !1, [d, R] = z("translate"), [b, y] = z({
834
+ mode: "continuous",
835
+ view: "gizmo",
836
+ step: { translate: 0, rotate: 0 }
837
+ }), S = [
838
+ ...a ? ["translate", "rotate"] : [],
839
+ ...e ? ["joint"] : [],
840
+ ...l ? ["moveTo"] : []
841
+ ], E = m ?? d, k = S.includes(E) ? E : S[0], J = so(b, r, u.increments), O = f("RobotControl.Title.ti"), P = p ? /* @__PURE__ */ o(
842
+ qt,
843
+ {
844
+ text: p,
845
+ onRetry: g,
846
+ disabled: C
847
+ }
848
+ ) : void 0, h = A(u.increments);
849
+ h.current = u.increments, L(
850
+ () => () => {
851
+ var x, M, B;
852
+ (x = h.current) != null && x.running && ((B = (M = h.current).onStepStop) == null || B.call(M));
853
+ },
854
+ []
855
+ );
856
+ function I(x) {
857
+ R(x), i == null || i(x);
858
+ }
859
+ function Q(x) {
860
+ var M, B, G;
861
+ y(x), x.mode !== J.mode && (c == null || c(x.mode));
862
+ for (const V of ["translate", "rotate"]) {
863
+ const _ = (M = u.increments) == null ? void 0 : M.steps[V][x.step[V]];
864
+ x.step[V] !== J.step[V] && _ !== void 0 && ((G = (B = u.increments) == null ? void 0 : B.onStepChange) == null || G.call(B, V, _));
865
+ }
866
+ }
867
+ return /* @__PURE__ */ v(
868
+ T,
869
+ {
870
+ "data-testid": "robot-control-panel",
871
+ sx: [
872
+ (x) => {
873
+ var M;
874
+ return {
875
+ minHeight: 0,
876
+ overflow: "hidden",
877
+ borderRadius: "16px",
878
+ background: (M = x.palette.backgroundPaperElevation) == null ? void 0 : M[5]
879
+ };
880
+ },
881
+ ...Array.isArray(n) ? n : [n]
882
+ ],
883
+ children: [
884
+ /* @__PURE__ */ v(
885
+ T,
886
+ {
887
+ direction: "row",
888
+ sx: {
889
+ alignItems: "center",
890
+ justifyContent: "space-between",
891
+ padding: "20px 20px 8px"
892
+ },
893
+ children: [
894
+ /* @__PURE__ */ o(
895
+ W,
896
+ {
897
+ component: "h2",
898
+ color: "text.primary",
899
+ sx: { fontSize: "20px" },
900
+ children: O
901
+ }
902
+ ),
903
+ t && /* @__PURE__ */ o(
904
+ ut,
905
+ {
906
+ "aria-label": f("RobotControl.Close.bt"),
907
+ onClick: t,
908
+ size: "small",
909
+ children: /* @__PURE__ */ o(dt, {})
910
+ }
911
+ )
912
+ ]
913
+ }
914
+ ),
915
+ /* @__PURE__ */ v(
916
+ bt,
917
+ {
918
+ value: k ?? !1,
919
+ onChange: (x, M) => I(M),
920
+ "aria-label": O,
921
+ variant: "scrollable",
922
+ scrollButtons: !1,
923
+ sx: {
924
+ marginX: "20px",
925
+ borderBottom: 1,
926
+ borderColor: "divider",
927
+ // The theme gives tabs a background of their own; here they sit
928
+ // on the panel
929
+ background: "transparent"
930
+ },
931
+ children: [
932
+ a && /* @__PURE__ */ o(
933
+ U,
934
+ {
935
+ value: "translate",
936
+ label: f("RobotControl.Tab.Translate.bt"),
937
+ sx: { minWidth: 0, paddingX: "12px", textTransform: "none" }
938
+ }
939
+ ),
940
+ a && /* @__PURE__ */ o(
941
+ U,
942
+ {
943
+ value: "rotate",
944
+ label: f("RobotControl.Tab.Rotate.bt"),
945
+ sx: { minWidth: 0, paddingX: "12px", textTransform: "none" }
946
+ }
947
+ ),
948
+ e && /* @__PURE__ */ o(
949
+ U,
950
+ {
951
+ value: "joint",
952
+ label: f("RobotControl.Tab.Joint.bt"),
953
+ sx: { minWidth: 0, paddingX: "12px", textTransform: "none" }
954
+ }
955
+ ),
956
+ l && /* @__PURE__ */ o(
957
+ U,
958
+ {
959
+ value: "moveTo",
960
+ label: f("RobotControl.Tab.MoveTo.bt"),
961
+ sx: { minWidth: 0, paddingX: "12px", textTransform: "none" }
962
+ }
963
+ )
964
+ ]
965
+ }
966
+ ),
967
+ /* @__PURE__ */ o(T, { sx: { flexGrow: 1, overflowY: "auto", overflowX: "hidden" }, children: k === "joint" && e ? /* @__PURE__ */ o(
968
+ Yt,
969
+ {
970
+ joints: e,
971
+ disabled: C,
972
+ jogDisabled: s || !!(($ = u.increments) != null && $.running),
973
+ disabledReason: P
974
+ }
975
+ ) : k === "moveTo" && l ? /* @__PURE__ */ o(
976
+ co,
977
+ {
978
+ moveTo: l,
979
+ tcp: u.tcp,
980
+ cartesian: a,
981
+ velocity: u.velocity.translate,
982
+ onVelocityChange: (x) => u.onVelocityChange("translate", x),
983
+ linear: (e == null ? void 0 : e.linear) ?? !1,
984
+ jointVelocity: e ? {
985
+ velocity: e.velocity,
986
+ onChange: e.onVelocityChange
987
+ } : {
988
+ velocity: u.velocity.rotate,
989
+ onChange: (x) => u.onVelocityChange("rotate", x)
990
+ },
991
+ disabled: C,
992
+ jogDisabled: s
993
+ }
994
+ ) : k === "translate" || k === "rotate" ? /* @__PURE__ */ o(
995
+ Qt,
996
+ {
997
+ ...u,
998
+ disabled: C,
999
+ jogDisabled: s,
1000
+ jogDisabledReason: P,
1001
+ motion: k,
1002
+ settings: J,
1003
+ onSettingsChange: Q
1004
+ }
1005
+ ) : null })
1006
+ ]
1007
+ }
1008
+ );
1009
+ }
1010
+ );
1011
+ function so(t, n, e) {
1012
+ const l = (s) => {
1013
+ var a;
1014
+ const p = (a = e == null ? void 0 : e.step) == null ? void 0 : a[s];
1015
+ if (p === void 0) return t.step[s];
1016
+ const g = e == null ? void 0 : e.steps[s].findIndex(
1017
+ (m) => Math.abs(m - p) <= 1e-9 * Math.max(1, Math.abs(m))
1018
+ );
1019
+ return g === void 0 || g < 0 ? t.step[s] : g;
1020
+ };
1021
+ return {
1022
+ ...t,
1023
+ mode: n ?? t.mode,
1024
+ step: { translate: l("translate"), rotate: l("rotate") }
1025
+ };
1026
+ }
1027
+ export {
1028
+ $o as R
1029
+ };