quantum-component-library 1.4.47-dev.7 → 1.4.47-dev.9
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.
- package/dist/components/activity-list/index.d.ts +26 -2
- package/dist/components/parameter-edit-list/index.d.ts +2 -1
- package/dist/components/upsert-activity-form/index.d.ts +3 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1082 -1012
- package/dist/quantum-component-library.css +1 -1
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,246 +1,246 @@
|
|
|
1
1
|
import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
|
-
import { Flex as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { u as
|
|
2
|
+
import { Flex as he, InputGroup as Fe, InputLeftElement as ct, Icon as Ue, Input as je, FormLabel as Be, Box as Y, TableContainer as qe, Table as He, Thead as Ye, Tr as Se, Th as ue, Tbody as Je, Td as ge, ButtonGroup as xe, Tooltip as Le, Button as J, RangeSlider as dt, RangeSliderMark as Ne, Text as x, RangeSliderTrack as ut, RangeSliderFilledTrack as ht, RangeSliderThumb as ke, Select as Re, NumberInput as Ee, NumberInputField as ze, HStack as te, Tag as fe, Checkbox as mt, Image as pt, useToast as Xe, VStack as ee, FormControl as q, RadioGroup as Ke, Radio as Ae, Alert as Te, AlertIcon as Me, Spinner as Ze, useDisclosure as gt, Modal as xt, ModalOverlay as jt, ModalContent as ft, ModalHeader as vt, ModalCloseButton as yt, ModalBody as bt, ModalFooter as Ct, IconButton as wt, Textarea as $e } from "@chakra-ui/react";
|
|
3
|
+
import { useMemo as F, useState as P, useCallback as R, useRef as St, useEffect as ne, memo as Oe } from "react";
|
|
4
|
+
import { u as At } from "./ufuzzy-vendor-Dl0ZI6Av.js";
|
|
5
5
|
import { s as se } from "./react-select-vendor-BlY9Il4Q.js";
|
|
6
|
-
import { F as
|
|
6
|
+
import { F as Tt, a as Mt } from "./react-icons-vendor-TETORdU9.js";
|
|
7
7
|
import { u as le, a as oe } from "./graphql-vendor-B0NjgbDB.js";
|
|
8
|
-
import { getFragmentData as
|
|
9
|
-
import { M as
|
|
10
|
-
import { D as Rt, H as
|
|
11
|
-
import { ThresholdKind as we, SensorLocation as
|
|
12
|
-
import { getSegmentNameWithPlane as
|
|
13
|
-
import { availablePlanes as
|
|
14
|
-
import { thresholdsToParameters as
|
|
15
|
-
import { usePartOptionsForSensorLocations as
|
|
16
|
-
const
|
|
8
|
+
import { getFragmentData as U } from "./generated.js";
|
|
9
|
+
import { M as me, A as ae, G as Ve, a as Ot, C as De, b as et, c as tt, d as Ce, e as nt, f as It, U as st, g as ot, h as Nt, i as Lt, j as rt, k as Dt, l as Ft, m as kt } from "./graphql-CvUc6Vdv.js";
|
|
10
|
+
import { D as Rt, H as Et, u as zt, a as $t } from "./react-dnd-vendor-D4nn9Mqx.js";
|
|
11
|
+
import { ThresholdKind as we, SensorLocation as W, SessionType as Pt, ActionLaterality as _t, ActivityType as Gt } from "./generated-graphql.js";
|
|
12
|
+
import { getSegmentNameWithPlane as it, getJointNameWithPlane as lt, getJointAngleDirectionName as Wt, getSegmentAngleDirectionName as Qt, getNormativeJointRange as Ut, mapSessionTypeEnumToLabel as Pe, getActivityKindFromActivityType as Bt, mapActivityTypeEnumToLabel as _e } from "./services.js";
|
|
13
|
+
import { availablePlanes as Ge, getAnalysisPartIdNoSide as ve } from "./types.js";
|
|
14
|
+
import { thresholdsToParameters as qt, parametersToThresholds as We, cn as Ht } from "./utils.js";
|
|
15
|
+
import { usePartOptionsForSensorLocations as Yt } from "./hooks.js";
|
|
16
|
+
const Jt = ({
|
|
17
17
|
setSearch: s,
|
|
18
18
|
actions: n,
|
|
19
|
-
updateUseCases:
|
|
20
|
-
hideUseCaseFilter:
|
|
19
|
+
updateUseCases: i,
|
|
20
|
+
hideUseCaseFilter: c = !1
|
|
21
21
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
() => n?.flatMap((
|
|
24
|
-
label:
|
|
25
|
-
value:
|
|
22
|
+
const u = F(
|
|
23
|
+
() => n?.flatMap((l) => l.useCases).filter((l, d, v) => v.findIndex((o) => o.id === l.id) === d).map((l) => ({
|
|
24
|
+
label: l.name,
|
|
25
|
+
value: l.id
|
|
26
26
|
})) || [],
|
|
27
27
|
[n]
|
|
28
28
|
);
|
|
29
|
-
return /* @__PURE__ */ e.jsxs(
|
|
30
|
-
/* @__PURE__ */ e.jsxs(
|
|
31
|
-
/* @__PURE__ */ e.jsx(
|
|
29
|
+
return /* @__PURE__ */ e.jsxs(he, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
|
|
30
|
+
/* @__PURE__ */ e.jsxs(Fe, { size: "md", flex: 1, children: [
|
|
31
|
+
/* @__PURE__ */ e.jsx(ct, { children: /* @__PURE__ */ e.jsx(Ue, { as: Tt, color: "gray.300" }) }),
|
|
32
32
|
/* @__PURE__ */ e.jsx(
|
|
33
33
|
je,
|
|
34
34
|
{
|
|
35
35
|
placeholder: "Search by name...",
|
|
36
36
|
width: "100%",
|
|
37
|
-
maxW:
|
|
38
|
-
onChange: (
|
|
37
|
+
maxW: c ? void 0 : "30rem",
|
|
38
|
+
onChange: (l) => s(l.target.value)
|
|
39
39
|
}
|
|
40
40
|
)
|
|
41
41
|
] }),
|
|
42
|
-
!
|
|
42
|
+
!c && /* @__PURE__ */ e.jsx(Fe, { size: "md", children: /* @__PURE__ */ e.jsx(
|
|
43
43
|
se,
|
|
44
44
|
{
|
|
45
45
|
size: "md",
|
|
46
46
|
chakraStyles: {
|
|
47
|
-
container: (
|
|
48
|
-
...
|
|
47
|
+
container: (l) => ({
|
|
48
|
+
...l,
|
|
49
49
|
width: "100%"
|
|
50
50
|
})
|
|
51
51
|
},
|
|
52
52
|
menuPortalTarget: document.body,
|
|
53
53
|
placeholder: "Filter use case",
|
|
54
54
|
isMulti: !0,
|
|
55
|
-
options:
|
|
56
|
-
onChange: (
|
|
55
|
+
options: u,
|
|
56
|
+
onChange: (l) => i(l.map((d) => d.value))
|
|
57
57
|
}
|
|
58
58
|
) })
|
|
59
59
|
] });
|
|
60
60
|
}, re = ({
|
|
61
61
|
children: s
|
|
62
|
-
}) => /* @__PURE__ */ e.jsx(
|
|
63
|
-
const
|
|
62
|
+
}) => /* @__PURE__ */ e.jsx(Be, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), Xt = ({ value: s, onChange: n }) => {
|
|
63
|
+
const i = P(
|
|
64
64
|
() => Math.random().toString(36).substring(2, 15)
|
|
65
|
-
)[0],
|
|
66
|
-
(
|
|
65
|
+
)[0], c = R(
|
|
66
|
+
(u, l) => {
|
|
67
67
|
n((d) => {
|
|
68
|
-
const
|
|
69
|
-
return
|
|
68
|
+
const v = [...d], [o] = v.splice(u, 1);
|
|
69
|
+
return v.splice(l, 0, o), v;
|
|
70
70
|
});
|
|
71
71
|
},
|
|
72
72
|
[n]
|
|
73
73
|
);
|
|
74
|
-
return /* @__PURE__ */ e.jsx(
|
|
75
|
-
/* @__PURE__ */ e.jsx(
|
|
76
|
-
/* @__PURE__ */ e.jsx(
|
|
77
|
-
/* @__PURE__ */ e.jsx(
|
|
74
|
+
return /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx(Rt, { backend: Et, children: /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(He, { variant: "simple", size: "md", children: [
|
|
75
|
+
/* @__PURE__ */ e.jsx(Ye, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
76
|
+
/* @__PURE__ */ e.jsx(ue, { children: "Order" }),
|
|
77
|
+
/* @__PURE__ */ e.jsx(ue, { children: "Name" })
|
|
78
78
|
] }) }),
|
|
79
|
-
/* @__PURE__ */ e.jsx(
|
|
80
|
-
|
|
79
|
+
/* @__PURE__ */ e.jsx(Je, { children: s.map((u, l) => /* @__PURE__ */ e.jsx(
|
|
80
|
+
Kt,
|
|
81
81
|
{
|
|
82
|
-
listKey:
|
|
83
|
-
index:
|
|
84
|
-
id:
|
|
85
|
-
name:
|
|
86
|
-
move:
|
|
82
|
+
listKey: i,
|
|
83
|
+
index: l,
|
|
84
|
+
id: u.id,
|
|
85
|
+
name: u.name,
|
|
86
|
+
move: c
|
|
87
87
|
},
|
|
88
|
-
|
|
88
|
+
u.id
|
|
89
89
|
)) })
|
|
90
90
|
] }) }) }) });
|
|
91
|
-
},
|
|
92
|
-
const
|
|
91
|
+
}, Kt = ({ listKey: s, index: n, id: i, name: c, move: u }) => {
|
|
92
|
+
const l = St(null), [{ handlerId: d }, v] = zt({
|
|
93
93
|
accept: s,
|
|
94
|
-
collect: (
|
|
95
|
-
handlerId:
|
|
94
|
+
collect: (h) => ({
|
|
95
|
+
handlerId: h.getHandlerId()?.toString() ?? ""
|
|
96
96
|
}),
|
|
97
|
-
hover: (
|
|
98
|
-
if (!
|
|
97
|
+
hover: (h, S) => {
|
|
98
|
+
if (!l.current)
|
|
99
99
|
return;
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
100
|
+
const r = h.index, a = n;
|
|
101
|
+
if (r === a)
|
|
102
102
|
return;
|
|
103
|
-
const p =
|
|
104
|
-
|
|
103
|
+
const p = l.current?.getBoundingClientRect(), g = (p.bottom - p.top) / 2, C = S.getClientOffset().y - p.top;
|
|
104
|
+
r < a && C < g || r > a && C > g || (u(r, a), h.index = a);
|
|
105
105
|
}
|
|
106
|
-
}), [{ isDragging:
|
|
106
|
+
}), [{ isDragging: o }, I] = $t({
|
|
107
107
|
type: s,
|
|
108
|
-
item: () => ({ id:
|
|
109
|
-
collect: (
|
|
110
|
-
isDragging:
|
|
108
|
+
item: () => ({ id: i, index: n }),
|
|
109
|
+
collect: (h) => ({
|
|
110
|
+
isDragging: h.isDragging()
|
|
111
111
|
})
|
|
112
|
-
}),
|
|
113
|
-
return
|
|
114
|
-
/* @__PURE__ */ e.jsx(
|
|
115
|
-
/* @__PURE__ */ e.jsx(
|
|
112
|
+
}), j = o ? 0.6 : 1, A = o ? "grabbing" : "grab";
|
|
113
|
+
return I(v(l)), /* @__PURE__ */ e.jsxs(Se, { ref: l, style: { opacity: j, cursor: A }, "data-handler-id": d, children: [
|
|
114
|
+
/* @__PURE__ */ e.jsx(ge, { children: n + 1 }),
|
|
115
|
+
/* @__PURE__ */ e.jsx(ge, { children: c })
|
|
116
116
|
] });
|
|
117
|
-
},
|
|
117
|
+
}, Zt = ({
|
|
118
118
|
items: s,
|
|
119
119
|
onChange: n,
|
|
120
|
-
selectedItem:
|
|
121
|
-
isDisabled:
|
|
122
|
-
selectedProps:
|
|
123
|
-
buttonProps:
|
|
120
|
+
selectedItem: i,
|
|
121
|
+
isDisabled: c,
|
|
122
|
+
selectedProps: u,
|
|
123
|
+
buttonProps: l
|
|
124
124
|
}) => {
|
|
125
|
-
const d = (
|
|
126
|
-
return /* @__PURE__ */ e.jsx(
|
|
127
|
-
|
|
125
|
+
const d = (o) => o === i || o.value === i, v = (o) => d(o) ? { ...l, ...u } : l;
|
|
126
|
+
return /* @__PURE__ */ e.jsx(xe, { isAttached: !0, isDisabled: c, children: s.map((o, I) => /* @__PURE__ */ e.jsx(
|
|
127
|
+
Le,
|
|
128
128
|
{
|
|
129
|
-
label:
|
|
129
|
+
label: o.tooltip,
|
|
130
130
|
openDelay: 50,
|
|
131
131
|
closeDelay: 200,
|
|
132
132
|
placement: "top",
|
|
133
|
-
visibility:
|
|
133
|
+
visibility: o.tooltip ? "visible" : "hidden",
|
|
134
134
|
hasArrow: !0,
|
|
135
135
|
children: /* @__PURE__ */ e.jsx(
|
|
136
|
-
|
|
136
|
+
J,
|
|
137
137
|
{
|
|
138
|
-
onClick: () => d(
|
|
139
|
-
isDisabled:
|
|
140
|
-
...
|
|
141
|
-
children:
|
|
138
|
+
onClick: () => d(o) ? null : n(o, I),
|
|
139
|
+
isDisabled: o.disabled,
|
|
140
|
+
...v(o),
|
|
141
|
+
children: o.label
|
|
142
142
|
}
|
|
143
143
|
)
|
|
144
144
|
},
|
|
145
|
-
|
|
145
|
+
I
|
|
146
146
|
)) });
|
|
147
|
-
}, ye = (s, n) => n < 0 ? -1 * Math.abs(s) : Math.abs(s),
|
|
147
|
+
}, ye = (s, n) => n < 0 ? -1 * Math.abs(s) : Math.abs(s), Vt = ({
|
|
148
148
|
isReversed: s,
|
|
149
149
|
min: n,
|
|
150
|
-
max:
|
|
151
|
-
value:
|
|
152
|
-
onChange:
|
|
153
|
-
inputProps:
|
|
150
|
+
max: i,
|
|
151
|
+
value: c,
|
|
152
|
+
onChange: u,
|
|
153
|
+
inputProps: l,
|
|
154
154
|
size: d,
|
|
155
|
-
zeroMarker:
|
|
156
|
-
formatValue:
|
|
157
|
-
valueLabel:
|
|
158
|
-
positiveNegativeLabels:
|
|
159
|
-
isDisabled:
|
|
160
|
-
...
|
|
155
|
+
zeroMarker: v,
|
|
156
|
+
formatValue: o,
|
|
157
|
+
valueLabel: I,
|
|
158
|
+
positiveNegativeLabels: j,
|
|
159
|
+
isDisabled: A,
|
|
160
|
+
...h
|
|
161
161
|
}) => {
|
|
162
|
-
const [
|
|
162
|
+
const [S, r] = P([void 0, void 0]), a = S[0], p = S[1], g = v && n < -5 && i > 5, y = Number(c?.[0] ?? p ?? n) > 0 ? 1 : -1, C = Number(c?.[1] ?? p ?? i) < 0 ? -1 : 1, G = j?.[0] === j?.[1], k = c?.[0], T = c?.[1];
|
|
163
163
|
ne(() => {
|
|
164
|
-
|
|
165
|
-
}, [
|
|
166
|
-
const
|
|
167
|
-
([b,
|
|
168
|
-
b <
|
|
164
|
+
k !== void 0 && T !== void 0 && r([k.toFixed(0), T.toFixed(0)]);
|
|
165
|
+
}, [k, T, r]);
|
|
166
|
+
const N = R(
|
|
167
|
+
([b, z]) => {
|
|
168
|
+
b < z && r([b.toFixed(0), z.toFixed(0)]);
|
|
169
169
|
},
|
|
170
|
-
[
|
|
171
|
-
),
|
|
172
|
-
([b,
|
|
173
|
-
b <
|
|
170
|
+
[r]
|
|
171
|
+
), E = R(
|
|
172
|
+
([b, z]) => {
|
|
173
|
+
b < z && u([b, z]);
|
|
174
174
|
},
|
|
175
|
-
[
|
|
176
|
-
),
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
return
|
|
175
|
+
[u]
|
|
176
|
+
), _ = R(() => {
|
|
177
|
+
r(([b, z]) => {
|
|
178
|
+
const Z = isNaN(Number(b)) ? n : Number(b), t = isNaN(Number(z)) ? i : Number(z), m = ye(Number(Z), y), w = ye(Number(t), C), D = y < 0 ? Math.max(m, n) : Math.min(m, i), $ = C < 0 ? Math.max(w, n) : Math.min(w, i);
|
|
179
|
+
return D > $ ? (u([$, D]), [$.toFixed(0), D.toFixed(0)]) : (u([D, $]), [D.toFixed(0), $.toFixed(0)]);
|
|
180
180
|
});
|
|
181
|
-
}, [
|
|
181
|
+
}, [u, r, y, C, n, i]), f = R(
|
|
182
182
|
(b) => {
|
|
183
|
-
const
|
|
184
|
-
|
|
183
|
+
const z = b === "" || isNaN(Number(b)) ? b : ye(Number(b), y);
|
|
184
|
+
r(([Z, t]) => [z.toString(), t]);
|
|
185
185
|
},
|
|
186
|
-
[
|
|
187
|
-
),
|
|
186
|
+
[r, y]
|
|
187
|
+
), M = R(
|
|
188
188
|
(b) => {
|
|
189
|
-
const
|
|
190
|
-
|
|
189
|
+
const z = b === "" || isNaN(Number(b)) ? b : ye(Number(b), C);
|
|
190
|
+
r(([Z, t]) => [Z, z.toString()]);
|
|
191
191
|
},
|
|
192
|
-
[
|
|
193
|
-
),
|
|
192
|
+
[r, C]
|
|
193
|
+
), L = F(
|
|
194
194
|
() => d === "xs" ? "0.75rem" : void 0,
|
|
195
195
|
[d]
|
|
196
|
-
),
|
|
197
|
-
(b,
|
|
198
|
-
const
|
|
199
|
-
if (!
|
|
196
|
+
), X = R(
|
|
197
|
+
(b, z) => {
|
|
198
|
+
const Z = Number(z.target.value);
|
|
199
|
+
if (!a || !p || ![-1, 1].includes(Z))
|
|
200
200
|
return;
|
|
201
|
-
const t = (
|
|
202
|
-
m >
|
|
201
|
+
const t = (D) => Z < 0 ? -1 * Math.abs(D) : Math.abs(D), m = b ? t(Number(a)) : Number(a), w = b ? Number(p) : t(Number(p));
|
|
202
|
+
m > w ? u([w, m]) : u([m, w]);
|
|
203
203
|
},
|
|
204
|
-
[
|
|
204
|
+
[a, p, u]
|
|
205
205
|
);
|
|
206
|
-
return /* @__PURE__ */ e.jsxs(
|
|
207
|
-
/* @__PURE__ */ e.jsx(
|
|
208
|
-
|
|
206
|
+
return /* @__PURE__ */ e.jsxs(he, { direction: "column", ...h, children: [
|
|
207
|
+
/* @__PURE__ */ e.jsx(Y, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
|
|
208
|
+
dt,
|
|
209
209
|
{
|
|
210
210
|
"aria-label": ["min", "max"],
|
|
211
211
|
isReversed: s,
|
|
212
|
-
value: [Number(
|
|
213
|
-
max:
|
|
212
|
+
value: [Number(a ?? n), Number(p ?? i)],
|
|
213
|
+
max: i,
|
|
214
214
|
min: n,
|
|
215
215
|
minStepsBetweenThumbs: 3,
|
|
216
216
|
step: 1,
|
|
217
|
-
onChange:
|
|
218
|
-
onChangeEnd:
|
|
219
|
-
isDisabled:
|
|
217
|
+
onChange: N,
|
|
218
|
+
onChangeEnd: E,
|
|
219
|
+
isDisabled: A,
|
|
220
220
|
children: [
|
|
221
221
|
/* @__PURE__ */ e.jsx(Ne, { value: n, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
222
|
-
|
|
222
|
+
x,
|
|
223
223
|
{
|
|
224
224
|
fontSize: d ?? "sm",
|
|
225
225
|
fontWeight: "semibold",
|
|
226
226
|
whiteSpace: "nowrap",
|
|
227
|
-
children:
|
|
227
|
+
children: o ? o?.(n) : n
|
|
228
228
|
}
|
|
229
229
|
) }),
|
|
230
|
-
/* @__PURE__ */ e.jsx(Ne, { value:
|
|
231
|
-
|
|
230
|
+
/* @__PURE__ */ e.jsx(Ne, { value: i, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
231
|
+
x,
|
|
232
232
|
{
|
|
233
233
|
fontSize: d ?? "sm",
|
|
234
234
|
fontWeight: "semibold",
|
|
235
235
|
style: { transform: "translateX(-100%)" },
|
|
236
236
|
whiteSpace: "nowrap",
|
|
237
|
-
children:
|
|
237
|
+
children: o ? o(i) : i
|
|
238
238
|
}
|
|
239
239
|
) }),
|
|
240
240
|
g && /* @__PURE__ */ e.jsxs(Ne, { value: 0, top: "-1em", pos: "relative", children: [
|
|
241
|
-
/* @__PURE__ */ e.jsx(
|
|
241
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: d, fontWeight: "semibold", children: o?.(0) ?? "0" }),
|
|
242
242
|
/* @__PURE__ */ e.jsx(
|
|
243
|
-
|
|
243
|
+
Y,
|
|
244
244
|
{
|
|
245
245
|
position: "absolute",
|
|
246
246
|
width: "2px",
|
|
@@ -251,79 +251,79 @@ const Ht = ({
|
|
|
251
251
|
}
|
|
252
252
|
)
|
|
253
253
|
] }),
|
|
254
|
-
/* @__PURE__ */ e.jsx(
|
|
255
|
-
/* @__PURE__ */ e.jsx(
|
|
256
|
-
/* @__PURE__ */ e.jsx(
|
|
254
|
+
/* @__PURE__ */ e.jsx(ut, { children: /* @__PURE__ */ e.jsx(ht, {}) }),
|
|
255
|
+
/* @__PURE__ */ e.jsx(ke, { index: 0, w: L, h: L }),
|
|
256
|
+
/* @__PURE__ */ e.jsx(ke, { index: 1, w: L, h: L })
|
|
257
257
|
]
|
|
258
258
|
}
|
|
259
259
|
) }),
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
I && /* @__PURE__ */ e.jsxs(
|
|
261
|
+
he,
|
|
262
262
|
{
|
|
263
263
|
direction: s ? "row-reverse" : "row",
|
|
264
264
|
justifyContent: "space-between",
|
|
265
265
|
children: [
|
|
266
266
|
/* @__PURE__ */ e.jsx(
|
|
267
|
-
|
|
267
|
+
x,
|
|
268
268
|
{
|
|
269
269
|
fontSize: d ?? "sm",
|
|
270
270
|
fontWeight: "semibold",
|
|
271
271
|
whiteSpace: "nowrap",
|
|
272
|
-
children:
|
|
272
|
+
children: I(n)
|
|
273
273
|
}
|
|
274
274
|
),
|
|
275
275
|
/* @__PURE__ */ e.jsx(
|
|
276
|
-
|
|
276
|
+
x,
|
|
277
277
|
{
|
|
278
278
|
fontSize: d ?? "sm",
|
|
279
279
|
fontWeight: "semibold",
|
|
280
280
|
whiteSpace: "nowrap",
|
|
281
|
-
children:
|
|
281
|
+
children: I(i)
|
|
282
282
|
}
|
|
283
283
|
)
|
|
284
284
|
]
|
|
285
285
|
}
|
|
286
286
|
),
|
|
287
287
|
/* @__PURE__ */ e.jsxs(
|
|
288
|
-
|
|
288
|
+
he,
|
|
289
289
|
{
|
|
290
290
|
direction: s ? "row-reverse" : "row",
|
|
291
291
|
justifyContent: "center",
|
|
292
292
|
alignItems: "center",
|
|
293
293
|
gap: "0.125em",
|
|
294
294
|
children: [
|
|
295
|
-
|
|
295
|
+
j && /* @__PURE__ */ e.jsxs(
|
|
296
296
|
Re,
|
|
297
297
|
{
|
|
298
298
|
width: "auto",
|
|
299
299
|
size: d,
|
|
300
300
|
fontWeight: "bold",
|
|
301
301
|
value: y,
|
|
302
|
-
onChange: (b) =>
|
|
303
|
-
isDisabled:
|
|
302
|
+
onChange: (b) => X(!0, b),
|
|
303
|
+
isDisabled: G || A,
|
|
304
304
|
children: [
|
|
305
|
-
/* @__PURE__ */ e.jsx("option", { value: -1, children:
|
|
306
|
-
/* @__PURE__ */ e.jsx("option", { value: 1, children:
|
|
305
|
+
/* @__PURE__ */ e.jsx("option", { value: -1, children: j[0] }),
|
|
306
|
+
/* @__PURE__ */ e.jsx("option", { value: 1, children: j[1] })
|
|
307
307
|
]
|
|
308
308
|
}
|
|
309
309
|
),
|
|
310
310
|
/* @__PURE__ */ e.jsx(
|
|
311
|
-
|
|
311
|
+
Ee,
|
|
312
312
|
{
|
|
313
313
|
precision: 0,
|
|
314
314
|
size: d ?? "sm",
|
|
315
315
|
min: 0,
|
|
316
|
-
max: y < 0 ? Math.abs(n) :
|
|
317
|
-
value:
|
|
318
|
-
onChange:
|
|
319
|
-
onBlur:
|
|
316
|
+
max: y < 0 ? Math.abs(n) : T ?? i,
|
|
317
|
+
value: a === "" ? "" : Math.abs(Number(a ?? n)),
|
|
318
|
+
onChange: f,
|
|
319
|
+
onBlur: _,
|
|
320
320
|
borderWidth: 1,
|
|
321
321
|
borderRadius: 3,
|
|
322
322
|
borderColor: "#ccc",
|
|
323
|
-
isDisabled:
|
|
324
|
-
...
|
|
323
|
+
isDisabled: A,
|
|
324
|
+
...l,
|
|
325
325
|
children: /* @__PURE__ */ e.jsx(
|
|
326
|
-
|
|
326
|
+
ze,
|
|
327
327
|
{
|
|
328
328
|
backgroundColor: "#fff",
|
|
329
329
|
paddingRight: 0,
|
|
@@ -333,22 +333,22 @@ const Ht = ({
|
|
|
333
333
|
}
|
|
334
334
|
),
|
|
335
335
|
/* @__PURE__ */ e.jsx(
|
|
336
|
-
|
|
336
|
+
Ee,
|
|
337
337
|
{
|
|
338
338
|
size: d ?? "sm",
|
|
339
339
|
min: 0,
|
|
340
|
-
max:
|
|
340
|
+
max: C < 0 ? Math.abs(k ?? n) : i,
|
|
341
341
|
precision: 0,
|
|
342
|
-
value: p === "" ? "" : Math.abs(Number(p ??
|
|
343
|
-
onChange:
|
|
344
|
-
onBlur:
|
|
342
|
+
value: p === "" ? "" : Math.abs(Number(p ?? i)),
|
|
343
|
+
onChange: M,
|
|
344
|
+
onBlur: _,
|
|
345
345
|
borderWidth: 1,
|
|
346
346
|
borderRadius: 3,
|
|
347
347
|
borderColor: "#ccc",
|
|
348
|
-
isDisabled:
|
|
349
|
-
...
|
|
348
|
+
isDisabled: A,
|
|
349
|
+
...l,
|
|
350
350
|
children: /* @__PURE__ */ e.jsx(
|
|
351
|
-
|
|
351
|
+
ze,
|
|
352
352
|
{
|
|
353
353
|
backgroundColor: "#fff",
|
|
354
354
|
paddingRight: 0,
|
|
@@ -357,18 +357,18 @@ const Ht = ({
|
|
|
357
357
|
)
|
|
358
358
|
}
|
|
359
359
|
),
|
|
360
|
-
|
|
360
|
+
j && /* @__PURE__ */ e.jsxs(
|
|
361
361
|
Re,
|
|
362
362
|
{
|
|
363
363
|
width: "auto",
|
|
364
364
|
size: d,
|
|
365
365
|
fontWeight: "bold",
|
|
366
|
-
value:
|
|
367
|
-
onChange: (b) =>
|
|
368
|
-
isDisabled:
|
|
366
|
+
value: C,
|
|
367
|
+
onChange: (b) => X(!1, b),
|
|
368
|
+
isDisabled: G || A,
|
|
369
369
|
children: [
|
|
370
|
-
/* @__PURE__ */ e.jsx("option", { value: -1, children:
|
|
371
|
-
/* @__PURE__ */ e.jsx("option", { value: 1, children:
|
|
370
|
+
/* @__PURE__ */ e.jsx("option", { value: -1, children: j[0] }),
|
|
371
|
+
/* @__PURE__ */ e.jsx("option", { value: 1, children: j[1] })
|
|
372
372
|
]
|
|
373
373
|
}
|
|
374
374
|
)
|
|
@@ -376,196 +376,247 @@ const Ht = ({
|
|
|
376
376
|
}
|
|
377
377
|
)
|
|
378
378
|
] });
|
|
379
|
-
},
|
|
379
|
+
}, en = ({ tags: s, containerProps: n, ...i }) => /* @__PURE__ */ e.jsx(te, { ...n, children: s.map((c, u) => /* @__PURE__ */ e.jsx(fe, { ...i, children: c }, u)) }), tn = new At({}), nn = ({
|
|
380
|
+
action: s,
|
|
381
|
+
quantumIconSrc: n
|
|
382
|
+
}) => s.quantumOwned ? /* @__PURE__ */ e.jsx(
|
|
383
|
+
Le,
|
|
384
|
+
{
|
|
385
|
+
label: "This activity is owned by Quantum",
|
|
386
|
+
"aria-label": "Quantum owned",
|
|
387
|
+
children: /* @__PURE__ */ e.jsx(
|
|
388
|
+
Y,
|
|
389
|
+
{
|
|
390
|
+
boxSize: "1.5em",
|
|
391
|
+
borderRadius: "full",
|
|
392
|
+
bg: "black",
|
|
393
|
+
display: "flex",
|
|
394
|
+
alignItems: "center",
|
|
395
|
+
justifyContent: "center",
|
|
396
|
+
children: /* @__PURE__ */ e.jsx(pt, { src: n, boxSize: "1em" })
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
) : null, sn = (s, n) => {
|
|
380
401
|
if (!n || !n.trim().length)
|
|
381
402
|
return s;
|
|
382
|
-
const
|
|
383
|
-
return
|
|
384
|
-
},
|
|
403
|
+
const i = s.map((u) => u.name ?? "");
|
|
404
|
+
return tn.filter(i, n)?.map((u) => s[u]) ?? [];
|
|
405
|
+
}, on = (s) => !s || s.length === 0 ? "None" : s.map(
|
|
385
406
|
(n) => (
|
|
386
407
|
// Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
|
|
387
408
|
n.replace(/([A-Z])/g, " $1").trim()
|
|
388
409
|
)
|
|
389
|
-
).join(", "),
|
|
390
|
-
(
|
|
391
|
-
),
|
|
410
|
+
).join(", "), rn = (s, n) => !n || n.length == 0 ? s : s.filter(
|
|
411
|
+
(i) => i.useCases.some((c) => n.includes(c.id))
|
|
412
|
+
), ln = ({
|
|
392
413
|
actions: s,
|
|
393
414
|
totalActions: n,
|
|
394
|
-
onCreate:
|
|
395
|
-
onDelete:
|
|
396
|
-
onEdit:
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
415
|
+
onCreate: i,
|
|
416
|
+
onDelete: c,
|
|
417
|
+
onEdit: u,
|
|
418
|
+
onView: l,
|
|
419
|
+
onSelected: d,
|
|
420
|
+
onDuplicate: v,
|
|
421
|
+
disableMultiSelect: o,
|
|
422
|
+
disableDelete: I,
|
|
423
|
+
disableEdit: j,
|
|
424
|
+
disableCreate: A,
|
|
403
425
|
hideUseCase: h = !0,
|
|
404
|
-
tableProps:
|
|
405
|
-
|
|
426
|
+
tableProps: S,
|
|
427
|
+
containerProps: r,
|
|
428
|
+
quantumIconSrc: a = "/favicon.ico"
|
|
406
429
|
}) => {
|
|
407
|
-
const [
|
|
430
|
+
const [p, g] = P(""), [y, C] = P(), G = F(() => {
|
|
408
431
|
if (!s)
|
|
409
432
|
return;
|
|
410
|
-
const
|
|
411
|
-
return
|
|
412
|
-
}, [s,
|
|
413
|
-
if (!
|
|
433
|
+
const f = sn(s, p);
|
|
434
|
+
return h ? f : rn(f, y);
|
|
435
|
+
}, [s, p, y, h]), k = R(() => {
|
|
436
|
+
if (!c)
|
|
414
437
|
return;
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
438
|
+
const M = s.filter(
|
|
439
|
+
(L) => L.selected && !L.quantumOwned
|
|
440
|
+
).map((L) => L.id);
|
|
441
|
+
c(M);
|
|
442
|
+
}, [s, c]), T = R(() => {
|
|
443
|
+
if (!v)
|
|
419
444
|
return;
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
}, [s, d,
|
|
423
|
-
return /* @__PURE__ */ e.jsxs(
|
|
424
|
-
/* @__PURE__ */ e.jsxs(
|
|
425
|
-
(
|
|
426
|
-
|
|
427
|
-
|
|
445
|
+
const f = s.filter((M) => M.selected);
|
|
446
|
+
v(f.map((M) => M.id)), d && f.forEach((M) => d(M, !1));
|
|
447
|
+
}, [s, v, d]), N = F(() => s.some((f) => f.selected && !f.quantumOwned), [s]), E = F(() => s.some((f) => f.selected), [s]), _ = F(() => s.some((f) => f.selected && f.quantumOwned), [s]);
|
|
448
|
+
return /* @__PURE__ */ e.jsxs(Y, { ...r, children: [
|
|
449
|
+
/* @__PURE__ */ e.jsxs(he, { alignContent: "space-between", gap: 4, children: [
|
|
450
|
+
(i || c || v) && /* @__PURE__ */ e.jsxs(xe, { mb: "1rem", gap: 4, children: [
|
|
451
|
+
i && /* @__PURE__ */ e.jsx(
|
|
452
|
+
J,
|
|
428
453
|
{
|
|
429
|
-
isDisabled: !
|
|
454
|
+
isDisabled: !i || A,
|
|
430
455
|
colorScheme: "blackAlpha",
|
|
431
456
|
backgroundColor: "gray.700",
|
|
432
|
-
onClick:
|
|
457
|
+
onClick: i,
|
|
433
458
|
children: "Create New Activity"
|
|
434
459
|
}
|
|
435
460
|
),
|
|
436
|
-
|
|
437
|
-
|
|
461
|
+
c && !o && /* @__PURE__ */ e.jsx(
|
|
462
|
+
Le,
|
|
438
463
|
{
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
464
|
+
label: _ ? N ? "Quantum-owned activities are selected and will be skipped" : "Selected activities are quantum-owned and cannot be deleted" : void 0,
|
|
465
|
+
children: /* @__PURE__ */ e.jsx(
|
|
466
|
+
J,
|
|
467
|
+
{
|
|
468
|
+
colorScheme: "gray",
|
|
469
|
+
isDisabled: !N || !c || I,
|
|
470
|
+
onClick: k,
|
|
471
|
+
children: "Delete Selected"
|
|
472
|
+
}
|
|
473
|
+
)
|
|
443
474
|
}
|
|
444
475
|
),
|
|
445
|
-
|
|
446
|
-
|
|
476
|
+
v && !o && /* @__PURE__ */ e.jsx(
|
|
477
|
+
J,
|
|
447
478
|
{
|
|
448
479
|
colorScheme: "gray",
|
|
449
|
-
isDisabled:
|
|
450
|
-
onClick:
|
|
480
|
+
isDisabled: !E,
|
|
481
|
+
onClick: T,
|
|
451
482
|
children: "Duplicate Selected"
|
|
452
483
|
}
|
|
453
484
|
)
|
|
454
485
|
] }),
|
|
455
486
|
/* @__PURE__ */ e.jsx(
|
|
456
|
-
|
|
487
|
+
Jt,
|
|
457
488
|
{
|
|
458
|
-
setSearch:
|
|
489
|
+
setSearch: g,
|
|
459
490
|
actions: s,
|
|
460
|
-
updateUseCases:
|
|
491
|
+
updateUseCases: C,
|
|
461
492
|
hideUseCaseFilter: h
|
|
462
493
|
}
|
|
463
494
|
)
|
|
464
495
|
] }),
|
|
465
|
-
/* @__PURE__ */ e.jsx(
|
|
466
|
-
/* @__PURE__ */ e.jsx(
|
|
467
|
-
/* @__PURE__ */ e.jsxs(
|
|
496
|
+
/* @__PURE__ */ e.jsx(qe, { mr: "2rem", overflowX: "hidden", ...S, children: /* @__PURE__ */ e.jsxs(He, { size: "md", variant: "simple", children: [
|
|
497
|
+
/* @__PURE__ */ e.jsx(Ye, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(Se, { children: [
|
|
498
|
+
/* @__PURE__ */ e.jsxs(ue, { fontWeight: "normal", children: [
|
|
468
499
|
"(showing ",
|
|
469
|
-
|
|
500
|
+
G?.length ?? 0,
|
|
470
501
|
" of",
|
|
471
502
|
" ",
|
|
472
503
|
n ?? s.length,
|
|
473
504
|
")"
|
|
474
505
|
] }),
|
|
475
|
-
/* @__PURE__ */ e.jsx(
|
|
476
|
-
/* @__PURE__ */ e.jsx(
|
|
477
|
-
!h && /* @__PURE__ */ e.jsx(
|
|
478
|
-
/* @__PURE__ */ e.jsx(
|
|
506
|
+
/* @__PURE__ */ e.jsx(ue, { children: "Name" }),
|
|
507
|
+
/* @__PURE__ */ e.jsx(ue, { children: "Sensor Locations" }),
|
|
508
|
+
!h && /* @__PURE__ */ e.jsx(ue, { children: "Use Case" }),
|
|
509
|
+
/* @__PURE__ */ e.jsx(ue, {})
|
|
479
510
|
] }) }),
|
|
480
|
-
/* @__PURE__ */ e.jsx(
|
|
511
|
+
/* @__PURE__ */ e.jsx(Je, { children: G?.map((f) => /* @__PURE__ */ e.jsxs(
|
|
481
512
|
Se,
|
|
482
513
|
{
|
|
483
|
-
title:
|
|
484
|
-
bg:
|
|
514
|
+
title: o && f.selected ? "This activity is selected. Click it again to deselect." : void 0,
|
|
515
|
+
bg: o && f.selected ? "gray.200" : void 0,
|
|
485
516
|
_hover: {
|
|
486
|
-
bg:
|
|
517
|
+
bg: o && !f.selected ? "#f7f7f7" : void 0
|
|
487
518
|
},
|
|
488
|
-
cursor:
|
|
489
|
-
onClick: () =>
|
|
519
|
+
cursor: o ? "pointer" : "default",
|
|
520
|
+
onClick: () => o ? d?.(f, !f.selected) : void 0,
|
|
490
521
|
children: [
|
|
491
|
-
/* @__PURE__ */ e.jsx(
|
|
492
|
-
|
|
493
|
-
|
|
522
|
+
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs(he, { children: [
|
|
523
|
+
d && !o && /* @__PURE__ */ e.jsx(
|
|
524
|
+
mt,
|
|
494
525
|
{
|
|
495
|
-
isChecked:
|
|
496
|
-
onChange: (
|
|
526
|
+
isChecked: f.selected,
|
|
527
|
+
onChange: (M) => d(f, M.target.checked)
|
|
497
528
|
}
|
|
498
529
|
),
|
|
499
|
-
|
|
500
|
-
|
|
530
|
+
(f.quantumOwned || !u) && l && /* @__PURE__ */ e.jsx(
|
|
531
|
+
J,
|
|
501
532
|
{
|
|
502
|
-
disabled: S,
|
|
503
533
|
ml: "1em",
|
|
504
534
|
size: "sm",
|
|
505
535
|
variant: "link",
|
|
506
536
|
colorScheme: "blue",
|
|
507
|
-
onClick: () =>
|
|
508
|
-
children: "
|
|
537
|
+
onClick: () => l(f.id),
|
|
538
|
+
children: "View"
|
|
539
|
+
}
|
|
540
|
+
),
|
|
541
|
+
!f.quantumOwned && u && /* @__PURE__ */ e.jsx(
|
|
542
|
+
J,
|
|
543
|
+
{
|
|
544
|
+
disabled: j,
|
|
545
|
+
ml: "1em",
|
|
546
|
+
size: "sm",
|
|
547
|
+
variant: "link",
|
|
548
|
+
colorScheme: "blue",
|
|
549
|
+
onClick: () => u(f.id),
|
|
550
|
+
children: "Edit"
|
|
509
551
|
}
|
|
510
552
|
)
|
|
511
553
|
] }) }),
|
|
512
|
-
/* @__PURE__ */ e.jsx(
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
554
|
+
/* @__PURE__ */ e.jsx(ge, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(he, { align: "center", gap: 2, children: [
|
|
555
|
+
/* @__PURE__ */ e.jsx(
|
|
556
|
+
nn,
|
|
557
|
+
{
|
|
558
|
+
action: f,
|
|
559
|
+
quantumIconSrc: a
|
|
560
|
+
}
|
|
561
|
+
),
|
|
562
|
+
f.name
|
|
563
|
+
] }) }),
|
|
564
|
+
/* @__PURE__ */ e.jsx(ge, { maxW: "20rem", whiteSpace: "break-spaces", children: on(f.sensorLocations) }),
|
|
565
|
+
!h && /* @__PURE__ */ e.jsx(ge, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
|
|
566
|
+
en,
|
|
516
567
|
{
|
|
517
568
|
containerProps: { flexWrap: "wrap" },
|
|
518
|
-
tags:
|
|
569
|
+
tags: f.useCases?.map((M) => M.name) ?? []
|
|
519
570
|
}
|
|
520
571
|
) })
|
|
521
572
|
]
|
|
522
573
|
},
|
|
523
|
-
|
|
574
|
+
f.id
|
|
524
575
|
)) })
|
|
525
576
|
] }) })
|
|
526
577
|
] });
|
|
527
|
-
},
|
|
578
|
+
}, kn = ({
|
|
528
579
|
onSave: s,
|
|
529
580
|
onCancel: n,
|
|
530
|
-
onError:
|
|
531
|
-
hideButtons:
|
|
532
|
-
setButtonDisabled:
|
|
533
|
-
setButtonOnClick:
|
|
581
|
+
onError: i,
|
|
582
|
+
hideButtons: c = !1,
|
|
583
|
+
setButtonDisabled: u,
|
|
584
|
+
setButtonOnClick: l,
|
|
534
585
|
quantumOwned: d
|
|
535
586
|
}) => {
|
|
536
|
-
const
|
|
537
|
-
query:
|
|
587
|
+
const v = Xe(), [o, I] = P("copy"), [j, A] = P(""), [h, S] = P([]), [r, a] = P(!1), [p] = le({
|
|
588
|
+
query: Ve
|
|
538
589
|
}), [g] = le({
|
|
539
|
-
query:
|
|
540
|
-
variables: { groupId:
|
|
541
|
-
pause: !
|
|
590
|
+
query: Ot,
|
|
591
|
+
variables: { groupId: j },
|
|
592
|
+
pause: !j
|
|
542
593
|
// Only run when group is selected
|
|
543
|
-
}), [, y] = oe(
|
|
544
|
-
|
|
545
|
-
),
|
|
546
|
-
(t) =>
|
|
547
|
-
) : [], [p.data]),
|
|
548
|
-
(m) =>
|
|
549
|
-
) : [], [g.data]),
|
|
550
|
-
(t) =>
|
|
551
|
-
), [
|
|
594
|
+
}), [, y] = oe(De), [, C] = oe(
|
|
595
|
+
et
|
|
596
|
+
), G = F(() => p.data?.groups ? p.data.groups.map(
|
|
597
|
+
(t) => U(tt, t)
|
|
598
|
+
) : [], [p.data]), k = F(() => g.data ? g.data.actions.map(
|
|
599
|
+
(m) => U(ae, m)
|
|
600
|
+
) : [], [g.data]), T = F(() => k.filter(
|
|
601
|
+
(t) => h.includes(t.id)
|
|
602
|
+
), [k, h]), N = R(
|
|
552
603
|
(t) => {
|
|
553
604
|
const m = t?.value || "";
|
|
554
|
-
|
|
605
|
+
A(m), S([]);
|
|
555
606
|
},
|
|
556
607
|
[]
|
|
557
|
-
),
|
|
608
|
+
), E = R(
|
|
558
609
|
(t) => {
|
|
559
|
-
const m = t.map((
|
|
560
|
-
|
|
610
|
+
const m = t.map((w) => w.value);
|
|
611
|
+
S(m);
|
|
561
612
|
},
|
|
562
613
|
[]
|
|
563
|
-
),
|
|
614
|
+
), _ = R(
|
|
564
615
|
async (t) => {
|
|
565
|
-
const m =
|
|
566
|
-
|
|
616
|
+
const m = U(
|
|
617
|
+
me,
|
|
567
618
|
t.categories
|
|
568
|
-
),
|
|
619
|
+
), w = {
|
|
569
620
|
...t,
|
|
570
621
|
name: `${t.name} (Copy)`,
|
|
571
622
|
// Add "(Copy)" suffix to distinguish
|
|
@@ -575,202 +626,202 @@ const Ht = ({
|
|
|
575
626
|
laterality: t.laterality,
|
|
576
627
|
activityKind: t.activityKind,
|
|
577
628
|
sensorLocations: t.sensorLocations,
|
|
578
|
-
thresholds: t.thresholds.map((
|
|
579
|
-
|
|
629
|
+
thresholds: t.thresholds.map(($) => ({
|
|
630
|
+
...$,
|
|
580
631
|
id: void 0
|
|
581
632
|
})),
|
|
582
|
-
categories: m?.map((
|
|
633
|
+
categories: m?.map(($) => $.id),
|
|
583
634
|
quantumOwned: d,
|
|
584
635
|
id: void 0
|
|
585
|
-
},
|
|
586
|
-
if (
|
|
587
|
-
throw new Error(
|
|
588
|
-
if (
|
|
589
|
-
return
|
|
636
|
+
}, D = await y({ fields: w });
|
|
637
|
+
if (D.error)
|
|
638
|
+
throw new Error(D.error.message);
|
|
639
|
+
if (D.data?.createAction)
|
|
640
|
+
return U(ae, D.data.createAction);
|
|
590
641
|
throw new Error("No action data returned");
|
|
591
642
|
},
|
|
592
643
|
[y, d]
|
|
593
|
-
),
|
|
644
|
+
), f = R(
|
|
594
645
|
async (t) => {
|
|
595
|
-
const m = await
|
|
646
|
+
const m = await C({ id: t.id });
|
|
596
647
|
if (m.error)
|
|
597
648
|
throw new Error(m.error.message);
|
|
598
649
|
if (m.data?.convertActionToQuantumOwned)
|
|
599
|
-
return
|
|
650
|
+
return U(
|
|
600
651
|
ae,
|
|
601
652
|
m.data.convertActionToQuantumOwned
|
|
602
653
|
);
|
|
603
654
|
throw new Error("No action data returned");
|
|
604
655
|
},
|
|
605
|
-
[
|
|
606
|
-
),
|
|
607
|
-
if (
|
|
656
|
+
[C]
|
|
657
|
+
), M = R(async () => {
|
|
658
|
+
if (a(!0), !T.length) {
|
|
608
659
|
const t = new Error(
|
|
609
|
-
`No activities selected for ${
|
|
660
|
+
`No activities selected for ${o === "copy" ? "copying" : "converting"}`
|
|
610
661
|
);
|
|
611
|
-
|
|
662
|
+
i?.(t), a(!1);
|
|
612
663
|
return;
|
|
613
664
|
}
|
|
614
665
|
try {
|
|
615
666
|
const t = [];
|
|
616
667
|
let m = 0;
|
|
617
|
-
const
|
|
618
|
-
for (const
|
|
668
|
+
const w = o === "copy" ? _ : f, D = o === "copy" ? "copy" : "convert";
|
|
669
|
+
for (const $ of T)
|
|
619
670
|
try {
|
|
620
|
-
const
|
|
621
|
-
t.push(
|
|
622
|
-
} catch (
|
|
671
|
+
const Q = await w($);
|
|
672
|
+
t.push(Q);
|
|
673
|
+
} catch (Q) {
|
|
623
674
|
console.error(
|
|
624
|
-
`Failed to ${
|
|
625
|
-
|
|
675
|
+
`Failed to ${D} activity "${$.name}":`,
|
|
676
|
+
Q
|
|
626
677
|
), m++;
|
|
627
678
|
}
|
|
628
679
|
if (t.length > 0) {
|
|
629
|
-
const
|
|
630
|
-
|
|
631
|
-
title: m > 0 ? `Partial ${
|
|
632
|
-
description: m > 0 ? `${
|
|
680
|
+
const $ = t.length, Q = T.length, K = o === "copy" ? "copied" : "converted", B = o === "copy" ? "copy" : "convert";
|
|
681
|
+
v({
|
|
682
|
+
title: m > 0 ? `Partial ${B} completed` : `Activities ${K} successfully`,
|
|
683
|
+
description: m > 0 ? `${$} of ${Q} activities ${K} successfully` : `${$} activit${$ > 1 ? "ies" : "y"} ${K} successfully`,
|
|
633
684
|
status: m > 0 ? "warning" : "success",
|
|
634
685
|
duration: 3e3,
|
|
635
686
|
isClosable: !0
|
|
636
|
-
}), s?.(),
|
|
687
|
+
}), s?.(), A(""), S([]);
|
|
637
688
|
} else
|
|
638
|
-
throw new Error(`Failed to ${
|
|
689
|
+
throw new Error(`Failed to ${D} any activities`);
|
|
639
690
|
} catch (t) {
|
|
640
|
-
const m =
|
|
641
|
-
|
|
642
|
-
title: `${
|
|
643
|
-
description:
|
|
691
|
+
const m = o === "copy" ? "copy" : "convert", w = t instanceof Error ? t.message : `Failed to ${m} activities`;
|
|
692
|
+
v({
|
|
693
|
+
title: `${o === "copy" ? "Copy" : "Convert"} failed`,
|
|
694
|
+
description: w,
|
|
644
695
|
status: "error",
|
|
645
696
|
duration: 5e3,
|
|
646
697
|
isClosable: !0
|
|
647
|
-
}),
|
|
698
|
+
}), i?.(t instanceof Error ? t : new Error(w));
|
|
648
699
|
} finally {
|
|
649
|
-
|
|
700
|
+
a(!1);
|
|
650
701
|
}
|
|
651
702
|
}, [
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
703
|
+
T,
|
|
704
|
+
o,
|
|
705
|
+
_,
|
|
706
|
+
f,
|
|
707
|
+
v,
|
|
657
708
|
s,
|
|
658
|
-
|
|
659
|
-
]),
|
|
660
|
-
|
|
709
|
+
i
|
|
710
|
+
]), L = R(() => {
|
|
711
|
+
A(""), S([]), I("copy"), n?.();
|
|
661
712
|
}, [n]);
|
|
662
713
|
ne(() => {
|
|
663
|
-
|
|
714
|
+
u && u({
|
|
664
715
|
cancelButton: !1,
|
|
665
|
-
saveButton:
|
|
716
|
+
saveButton: T.length === 0 || r
|
|
666
717
|
});
|
|
667
|
-
}, [
|
|
668
|
-
|
|
669
|
-
cancelButton:
|
|
670
|
-
saveButton:
|
|
718
|
+
}, [T.length, r, u]), ne(() => {
|
|
719
|
+
l && l({
|
|
720
|
+
cancelButton: L,
|
|
721
|
+
saveButton: M
|
|
671
722
|
});
|
|
672
|
-
}, [
|
|
673
|
-
const
|
|
723
|
+
}, [l, L, M]);
|
|
724
|
+
const X = F(() => G.map((t) => ({
|
|
674
725
|
value: t.id,
|
|
675
726
|
label: t.name
|
|
676
|
-
})), [
|
|
727
|
+
})), [G]), b = F(() => k.filter((t) => o === "copy" ? !0 : !t.quantumOwned).map((t) => ({
|
|
677
728
|
value: t.id,
|
|
678
729
|
label: t.name,
|
|
679
730
|
// Add custom data to identify quantum-owned actions for UI display
|
|
680
731
|
isQuantumOwned: t.quantumOwned
|
|
681
|
-
})), [
|
|
682
|
-
return /* @__PURE__ */ e.jsx(
|
|
683
|
-
d && /* @__PURE__ */ e.jsxs(
|
|
732
|
+
})), [k, o]), z = p.fetching, Z = g.fetching;
|
|
733
|
+
return /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
|
|
734
|
+
d && /* @__PURE__ */ e.jsxs(q, { children: [
|
|
684
735
|
/* @__PURE__ */ e.jsx(re, { children: "Operation Mode" }),
|
|
685
736
|
/* @__PURE__ */ e.jsx(
|
|
686
|
-
|
|
737
|
+
Ke,
|
|
687
738
|
{
|
|
688
|
-
value:
|
|
739
|
+
value: o,
|
|
689
740
|
onChange: (t) => {
|
|
690
|
-
|
|
741
|
+
I(t), S([]);
|
|
691
742
|
},
|
|
692
743
|
children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, children: [
|
|
693
744
|
/* @__PURE__ */ e.jsx(Ae, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
|
|
694
|
-
/* @__PURE__ */ e.jsx(
|
|
695
|
-
/* @__PURE__ */ e.jsx(
|
|
745
|
+
/* @__PURE__ */ e.jsx(x, { fontWeight: "medium", children: "Copy Activities" }),
|
|
746
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.600", children: "Create new activities based on selected ones" })
|
|
696
747
|
] }) }),
|
|
697
748
|
/* @__PURE__ */ e.jsx(Ae, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
|
|
698
|
-
/* @__PURE__ */ e.jsx(
|
|
699
|
-
/* @__PURE__ */ e.jsx(
|
|
749
|
+
/* @__PURE__ */ e.jsx(x, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
|
|
750
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.600", children: "Convert existing activities to quantum-owned" })
|
|
700
751
|
] }) })
|
|
701
752
|
] })
|
|
702
753
|
}
|
|
703
754
|
)
|
|
704
755
|
] }),
|
|
705
|
-
/* @__PURE__ */ e.jsxs(
|
|
756
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
706
757
|
/* @__PURE__ */ e.jsx(re, { children: "Select Source Group" }),
|
|
707
758
|
/* @__PURE__ */ e.jsx(
|
|
708
759
|
se,
|
|
709
760
|
{
|
|
710
761
|
placeholder: "Choose a group...",
|
|
711
|
-
options:
|
|
712
|
-
value:
|
|
713
|
-
onChange:
|
|
714
|
-
isLoading:
|
|
715
|
-
isDisabled:
|
|
762
|
+
options: X,
|
|
763
|
+
value: X.find((t) => t.value === j) || null,
|
|
764
|
+
onChange: N,
|
|
765
|
+
isLoading: z,
|
|
766
|
+
isDisabled: z,
|
|
716
767
|
isClearable: !0
|
|
717
768
|
}
|
|
718
769
|
),
|
|
719
770
|
p.error && /* @__PURE__ */ e.jsxs(Te, { status: "error", mt: 2, children: [
|
|
720
771
|
/* @__PURE__ */ e.jsx(Me, {}),
|
|
721
|
-
/* @__PURE__ */ e.jsxs(
|
|
772
|
+
/* @__PURE__ */ e.jsxs(x, { fontSize: "sm", children: [
|
|
722
773
|
"Failed to load groups: ",
|
|
723
774
|
p.error.message
|
|
724
775
|
] })
|
|
725
776
|
] })
|
|
726
777
|
] }),
|
|
727
|
-
|
|
778
|
+
j && /* @__PURE__ */ e.jsxs(q, { children: [
|
|
728
779
|
/* @__PURE__ */ e.jsxs(re, { children: [
|
|
729
780
|
"Select Activities to",
|
|
730
781
|
" ",
|
|
731
|
-
|
|
782
|
+
o === "copy" ? "Copy" : "Convert"
|
|
732
783
|
] }),
|
|
733
|
-
|
|
734
|
-
/* @__PURE__ */ e.jsx(
|
|
735
|
-
/* @__PURE__ */ e.jsx(
|
|
784
|
+
Z ? /* @__PURE__ */ e.jsxs(te, { children: [
|
|
785
|
+
/* @__PURE__ */ e.jsx(Ze, { size: "sm" }),
|
|
786
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.600", children: "Loading activities..." })
|
|
736
787
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
737
788
|
/* @__PURE__ */ e.jsx(
|
|
738
789
|
se,
|
|
739
790
|
{
|
|
740
|
-
placeholder: `Choose activities to ${
|
|
791
|
+
placeholder: `Choose activities to ${o}...`,
|
|
741
792
|
options: b,
|
|
742
793
|
value: b.filter(
|
|
743
|
-
(t) =>
|
|
794
|
+
(t) => h.includes(t.value)
|
|
744
795
|
),
|
|
745
|
-
onChange:
|
|
796
|
+
onChange: E,
|
|
746
797
|
isDisabled: b.length === 0,
|
|
747
798
|
isClearable: !0,
|
|
748
799
|
isMulti: !0,
|
|
749
800
|
closeMenuOnSelect: !1,
|
|
750
801
|
formatOptionLabel: (t, { context: m }) => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", w: "100%", children: [
|
|
751
802
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
752
|
-
/* @__PURE__ */ e.jsx(
|
|
753
|
-
m === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(
|
|
803
|
+
/* @__PURE__ */ e.jsx(x, { children: t.label }),
|
|
804
|
+
m === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(x, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
754
805
|
] }),
|
|
755
806
|
t.isQuantumOwned && m === "menu" && /* @__PURE__ */ e.jsx(fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
756
807
|
] })
|
|
757
808
|
}
|
|
758
809
|
),
|
|
759
|
-
b.length === 0 && /* @__PURE__ */ e.jsx(
|
|
810
|
+
b.length === 0 && /* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.500", mt: 2, children: "No activities found" })
|
|
760
811
|
] }),
|
|
761
812
|
g.error && /* @__PURE__ */ e.jsxs(Te, { status: "error", mt: 2, children: [
|
|
762
813
|
/* @__PURE__ */ e.jsx(Me, {}),
|
|
763
|
-
/* @__PURE__ */ e.jsxs(
|
|
814
|
+
/* @__PURE__ */ e.jsxs(x, { fontSize: "sm", children: [
|
|
764
815
|
"Failed to load activities: ",
|
|
765
816
|
g.error.message
|
|
766
817
|
] })
|
|
767
818
|
] })
|
|
768
819
|
] }),
|
|
769
|
-
|
|
770
|
-
/* @__PURE__ */ e.jsx(
|
|
820
|
+
T.length > 0 && /* @__PURE__ */ e.jsxs(Y, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
821
|
+
/* @__PURE__ */ e.jsx(x, { fontWeight: "semibold", mb: 3, children: T.length === 1 ? `Activity to ${o === "copy" ? "Copy" : "Convert"}:` : `${T.length} Activities to ${o === "copy" ? "Copy" : "Convert"}:` }),
|
|
771
822
|
/* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 3, children: [
|
|
772
|
-
|
|
773
|
-
|
|
823
|
+
T.map((t, m) => /* @__PURE__ */ e.jsxs(
|
|
824
|
+
Y,
|
|
774
825
|
{
|
|
775
826
|
w: "100%",
|
|
776
827
|
p: 3,
|
|
@@ -780,7 +831,7 @@ const Ht = ({
|
|
|
780
831
|
borderColor: "gray.200",
|
|
781
832
|
children: [
|
|
782
833
|
/* @__PURE__ */ e.jsxs(te, { justify: "space-between", align: "start", mb: 2, children: [
|
|
783
|
-
/* @__PURE__ */ e.jsxs(
|
|
834
|
+
/* @__PURE__ */ e.jsxs(x, { fontWeight: "medium", fontSize: "sm", children: [
|
|
784
835
|
m + 1,
|
|
785
836
|
". ",
|
|
786
837
|
t.name
|
|
@@ -795,35 +846,35 @@ const Ht = ({
|
|
|
795
846
|
fontSize: "sm",
|
|
796
847
|
color: "gray.600",
|
|
797
848
|
children: [
|
|
798
|
-
t.description && /* @__PURE__ */ e.jsxs(
|
|
849
|
+
t.description && /* @__PURE__ */ e.jsxs(x, { children: [
|
|
799
850
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
800
851
|
" ",
|
|
801
852
|
t.description
|
|
802
853
|
] }),
|
|
803
|
-
/* @__PURE__ */ e.jsxs(
|
|
854
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
804
855
|
/* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
|
|
805
856
|
" ",
|
|
806
857
|
t.activityKind
|
|
807
858
|
] }),
|
|
808
|
-
/* @__PURE__ */ e.jsxs(
|
|
859
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
809
860
|
/* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
|
|
810
861
|
" ",
|
|
811
862
|
t.laterality
|
|
812
863
|
] }),
|
|
813
|
-
/* @__PURE__ */ e.jsxs(
|
|
864
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
814
865
|
/* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
|
|
815
866
|
" ",
|
|
816
867
|
t.sensorLocations.length
|
|
817
868
|
] }),
|
|
818
|
-
/* @__PURE__ */ e.jsxs(
|
|
869
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
819
870
|
/* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
|
|
820
871
|
" ",
|
|
821
872
|
t.thresholds.length
|
|
822
873
|
] }),
|
|
823
|
-
/* @__PURE__ */ e.jsxs(
|
|
874
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
824
875
|
/* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
|
|
825
876
|
" ",
|
|
826
|
-
t.useCases.map((
|
|
877
|
+
t.useCases.map((w) => w.name).join(", ") || "None"
|
|
827
878
|
] })
|
|
828
879
|
]
|
|
829
880
|
}
|
|
@@ -832,8 +883,8 @@ const Ht = ({
|
|
|
832
883
|
},
|
|
833
884
|
t.id
|
|
834
885
|
)),
|
|
835
|
-
|
|
836
|
-
|
|
886
|
+
T.length > 1 && /* @__PURE__ */ e.jsx(
|
|
887
|
+
Y,
|
|
837
888
|
{
|
|
838
889
|
w: "100%",
|
|
839
890
|
p: 2,
|
|
@@ -841,336 +892,336 @@ const Ht = ({
|
|
|
841
892
|
borderRadius: "md",
|
|
842
893
|
border: "1px solid",
|
|
843
894
|
borderColor: "blue.200",
|
|
844
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
895
|
+
children: /* @__PURE__ */ e.jsxs(x, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
845
896
|
"Total: ",
|
|
846
|
-
|
|
897
|
+
T.length,
|
|
847
898
|
" activities will be",
|
|
848
899
|
" ",
|
|
849
|
-
|
|
900
|
+
o === "copy" ? "copied" : "converted"
|
|
850
901
|
] })
|
|
851
902
|
}
|
|
852
903
|
)
|
|
853
904
|
] })
|
|
854
905
|
] }),
|
|
855
|
-
!
|
|
906
|
+
!c && /* @__PURE__ */ e.jsxs(xe, { spacing: 4, justifyContent: "flex-end", children: [
|
|
856
907
|
/* @__PURE__ */ e.jsx(
|
|
857
|
-
|
|
908
|
+
J,
|
|
858
909
|
{
|
|
859
910
|
variant: "outline",
|
|
860
|
-
onClick:
|
|
861
|
-
isDisabled:
|
|
911
|
+
onClick: L,
|
|
912
|
+
isDisabled: r,
|
|
862
913
|
children: "Cancel"
|
|
863
914
|
}
|
|
864
915
|
),
|
|
865
916
|
/* @__PURE__ */ e.jsxs(
|
|
866
|
-
|
|
917
|
+
J,
|
|
867
918
|
{
|
|
868
|
-
colorScheme:
|
|
869
|
-
onClick:
|
|
870
|
-
isDisabled:
|
|
871
|
-
isLoading:
|
|
872
|
-
loadingText: `${
|
|
919
|
+
colorScheme: o === "copy" ? "blue" : "green",
|
|
920
|
+
onClick: M,
|
|
921
|
+
isDisabled: T.length === 0 || r,
|
|
922
|
+
isLoading: r,
|
|
923
|
+
loadingText: `${o === "copy" ? "Copying" : "Converting"}...`,
|
|
873
924
|
children: [
|
|
874
|
-
|
|
925
|
+
o === "copy" ? "Copy" : "Convert",
|
|
875
926
|
" ",
|
|
876
|
-
|
|
927
|
+
T.length === 1 ? "Activity" : `${T.length} Activities`
|
|
877
928
|
]
|
|
878
929
|
}
|
|
879
930
|
)
|
|
880
931
|
] })
|
|
881
932
|
] }) });
|
|
882
|
-
},
|
|
933
|
+
}, Rn = ({
|
|
883
934
|
onSave: s,
|
|
884
935
|
onCancel: n,
|
|
885
|
-
onError:
|
|
886
|
-
hideButtons:
|
|
887
|
-
setButtonDisabled:
|
|
888
|
-
setButtonOnClick:
|
|
936
|
+
onError: i,
|
|
937
|
+
hideButtons: c = !1,
|
|
938
|
+
setButtonDisabled: u,
|
|
939
|
+
setButtonOnClick: l,
|
|
889
940
|
quantumOwned: d
|
|
890
941
|
}) => {
|
|
891
|
-
const
|
|
892
|
-
query:
|
|
942
|
+
const v = Xe(), [o, I] = P(""), [j, A] = P([]), [h, S] = P(!1), [r, a] = P("copy"), [p] = le({
|
|
943
|
+
query: Ve
|
|
893
944
|
}), [g] = le({
|
|
894
|
-
query:
|
|
895
|
-
variables: { groupId:
|
|
896
|
-
pause: !
|
|
945
|
+
query: It,
|
|
946
|
+
variables: { groupId: o },
|
|
947
|
+
pause: !o
|
|
897
948
|
// Only run when group is selected
|
|
898
|
-
}), [, y] = oe(
|
|
899
|
-
|
|
900
|
-
),
|
|
901
|
-
(t) =>
|
|
902
|
-
) : [], [p.data]),
|
|
949
|
+
}), [, y] = oe(ot), [, C] = oe(st), [, G] = oe(De), [, k] = oe(
|
|
950
|
+
et
|
|
951
|
+
), T = F(() => p.data?.groups ? p.data.groups.map(
|
|
952
|
+
(t) => U(tt, t)
|
|
953
|
+
) : [], [p.data]), N = F(() => g.data?.modules ? U(
|
|
903
954
|
Ce,
|
|
904
955
|
g.data?.modules
|
|
905
956
|
).map((m) => {
|
|
906
|
-
const
|
|
907
|
-
|
|
957
|
+
const w = U(
|
|
958
|
+
nt,
|
|
908
959
|
m.moduleActions
|
|
909
960
|
);
|
|
910
961
|
return {
|
|
911
962
|
...m,
|
|
912
|
-
moduleActions:
|
|
913
|
-
...
|
|
914
|
-
action:
|
|
963
|
+
moduleActions: w.map((D) => ({
|
|
964
|
+
...D,
|
|
965
|
+
action: U(ae, D.action)
|
|
915
966
|
})),
|
|
916
|
-
categories:
|
|
917
|
-
|
|
967
|
+
categories: U(
|
|
968
|
+
me,
|
|
918
969
|
m.categories
|
|
919
970
|
)
|
|
920
971
|
};
|
|
921
|
-
}) : [], [g.data]),
|
|
922
|
-
(t) =>
|
|
923
|
-
), [
|
|
972
|
+
}) : [], [g.data]), E = F(() => N.filter(
|
|
973
|
+
(t) => j.includes(t.id)
|
|
974
|
+
), [N, j]), _ = R(
|
|
924
975
|
(t) => {
|
|
925
976
|
const m = t?.value || "";
|
|
926
|
-
|
|
977
|
+
I(m), A([]);
|
|
927
978
|
},
|
|
928
979
|
[]
|
|
929
|
-
),
|
|
980
|
+
), f = R(
|
|
930
981
|
(t) => {
|
|
931
|
-
const m = t.map((
|
|
932
|
-
|
|
982
|
+
const m = t.map((w) => w.value);
|
|
983
|
+
A(m);
|
|
933
984
|
},
|
|
934
985
|
[]
|
|
935
|
-
),
|
|
936
|
-
if (
|
|
937
|
-
|
|
986
|
+
), M = R(async () => {
|
|
987
|
+
if (S(!0), !E.length) {
|
|
988
|
+
S(!1);
|
|
938
989
|
const t = new Error(
|
|
939
|
-
`No modules selected for ${
|
|
990
|
+
`No modules selected for ${r === "convert" ? "converting" : "copying"}`
|
|
940
991
|
);
|
|
941
|
-
|
|
992
|
+
i?.(t);
|
|
942
993
|
return;
|
|
943
994
|
}
|
|
944
995
|
try {
|
|
945
996
|
const t = [];
|
|
946
997
|
let m = 0;
|
|
947
|
-
for (const
|
|
998
|
+
for (const w of E)
|
|
948
999
|
try {
|
|
949
|
-
let
|
|
1000
|
+
let D = w.moduleActions.map(($) => $.actionId);
|
|
950
1001
|
if (d) {
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
953
|
-
if (
|
|
954
|
-
const
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
),
|
|
958
|
-
...
|
|
1002
|
+
const $ = w.moduleActions.map((B) => B.action), Q = async (B) => {
|
|
1003
|
+
if (r === "copy") {
|
|
1004
|
+
if (B.quantumOwned) return B;
|
|
1005
|
+
const Ie = U(
|
|
1006
|
+
me,
|
|
1007
|
+
B.categories
|
|
1008
|
+
), pe = {
|
|
1009
|
+
...B,
|
|
959
1010
|
quantumOwned: !0,
|
|
960
|
-
thresholds:
|
|
961
|
-
...
|
|
1011
|
+
thresholds: B.thresholds.map((O) => ({
|
|
1012
|
+
...O,
|
|
962
1013
|
id: void 0
|
|
963
1014
|
})),
|
|
964
|
-
categories:
|
|
1015
|
+
categories: Ie?.map((O) => O.id),
|
|
965
1016
|
id: void 0
|
|
966
|
-
},
|
|
967
|
-
return
|
|
1017
|
+
}, de = await G({ fields: pe });
|
|
1018
|
+
return de.error || !de.data?.createAction ? null : U(
|
|
968
1019
|
ae,
|
|
969
|
-
|
|
1020
|
+
de.data.createAction
|
|
970
1021
|
);
|
|
971
1022
|
}
|
|
972
|
-
if (
|
|
973
|
-
const
|
|
974
|
-
id:
|
|
1023
|
+
if (B.quantumOwned) return B;
|
|
1024
|
+
const ce = await k({
|
|
1025
|
+
id: B.id
|
|
975
1026
|
});
|
|
976
|
-
return
|
|
1027
|
+
return ce.error || !ce.data?.convertActionToQuantumOwned ? null : U(
|
|
977
1028
|
ae,
|
|
978
|
-
|
|
1029
|
+
ce.data.convertActionToQuantumOwned
|
|
979
1030
|
);
|
|
980
1031
|
};
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
)).filter((
|
|
1032
|
+
D = (await Promise.all(
|
|
1033
|
+
$.map(Q)
|
|
1034
|
+
)).filter((B) => !!B).map((B) => B.id);
|
|
984
1035
|
}
|
|
985
|
-
if (
|
|
986
|
-
const
|
|
987
|
-
name:
|
|
988
|
-
description:
|
|
989
|
-
actions:
|
|
990
|
-
categories:
|
|
1036
|
+
if (r === "convert") {
|
|
1037
|
+
const $ = {
|
|
1038
|
+
name: w.name,
|
|
1039
|
+
description: w.description || void 0,
|
|
1040
|
+
actions: D,
|
|
1041
|
+
categories: w.categories.map((K) => K.id),
|
|
991
1042
|
quantumOwned: !0
|
|
992
|
-
},
|
|
993
|
-
id:
|
|
994
|
-
input:
|
|
1043
|
+
}, Q = await C({
|
|
1044
|
+
id: w.id,
|
|
1045
|
+
input: $
|
|
995
1046
|
});
|
|
996
|
-
if (
|
|
997
|
-
if (
|
|
998
|
-
const
|
|
1047
|
+
if (Q.error) throw new Error(Q.error.message);
|
|
1048
|
+
if (Q.data?.updateModule) {
|
|
1049
|
+
const K = U(
|
|
999
1050
|
Ce,
|
|
1000
|
-
|
|
1051
|
+
Q.data.updateModule
|
|
1001
1052
|
);
|
|
1002
|
-
t.push(
|
|
1053
|
+
t.push(K);
|
|
1003
1054
|
}
|
|
1004
1055
|
} else {
|
|
1005
|
-
const
|
|
1006
|
-
name: `${
|
|
1007
|
-
description:
|
|
1008
|
-
actions:
|
|
1009
|
-
categories:
|
|
1056
|
+
const $ = {
|
|
1057
|
+
name: `${w.name} (Copy)`,
|
|
1058
|
+
description: w.description || void 0,
|
|
1059
|
+
actions: D,
|
|
1060
|
+
categories: w.categories.map((K) => K.id),
|
|
1010
1061
|
quantumOwned: d
|
|
1011
|
-
},
|
|
1012
|
-
if (
|
|
1013
|
-
if (
|
|
1014
|
-
const
|
|
1062
|
+
}, Q = await y({ input: $ });
|
|
1063
|
+
if (Q.error) throw new Error(Q.error.message);
|
|
1064
|
+
if (Q.data?.createModule) {
|
|
1065
|
+
const K = U(
|
|
1015
1066
|
Ce,
|
|
1016
|
-
|
|
1067
|
+
Q.data.createModule
|
|
1017
1068
|
);
|
|
1018
|
-
t.push(
|
|
1069
|
+
t.push(K);
|
|
1019
1070
|
}
|
|
1020
1071
|
}
|
|
1021
|
-
} catch (
|
|
1072
|
+
} catch (D) {
|
|
1022
1073
|
console.error(
|
|
1023
|
-
`Failed to ${
|
|
1024
|
-
|
|
1074
|
+
`Failed to ${r === "convert" ? "convert" : "copy"} module "${w.name}":`,
|
|
1075
|
+
D
|
|
1025
1076
|
), m++;
|
|
1026
1077
|
}
|
|
1027
1078
|
if (t.length > 0) {
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1030
|
-
title: m > 0 ? `Partial ${
|
|
1031
|
-
description: m > 0 ? `${
|
|
1079
|
+
const w = t.length, D = E.length;
|
|
1080
|
+
v({
|
|
1081
|
+
title: m > 0 ? `Partial ${r === "convert" ? "convert" : "copy"} completed` : `Modules ${r === "convert" ? "converted" : "copied"} successfully`,
|
|
1082
|
+
description: m > 0 ? `${w} of ${D} modules ${r === "convert" ? "converted" : "copied"} successfully` : `${w} module${w > 1 ? "s" : ""} ${r === "convert" ? "converted" : "copied"} successfully`,
|
|
1032
1083
|
status: m > 0 ? "warning" : "success",
|
|
1033
1084
|
duration: 3e3,
|
|
1034
1085
|
isClosable: !0
|
|
1035
|
-
}), t.length > 0 && s?.(),
|
|
1086
|
+
}), t.length > 0 && s?.(), I(""), A([]);
|
|
1036
1087
|
} else
|
|
1037
1088
|
throw new Error(
|
|
1038
|
-
`Failed to ${
|
|
1089
|
+
`Failed to ${r === "convert" ? "convert" : "copy"} any modules`
|
|
1039
1090
|
);
|
|
1040
1091
|
} catch (t) {
|
|
1041
|
-
const m = t instanceof Error ? t.message : `Failed to ${
|
|
1042
|
-
|
|
1043
|
-
title:
|
|
1092
|
+
const m = t instanceof Error ? t.message : `Failed to ${r === "convert" ? "convert" : "copy"} modules`;
|
|
1093
|
+
v({
|
|
1094
|
+
title: r === "convert" ? "Convert failed" : "Copy failed",
|
|
1044
1095
|
description: m,
|
|
1045
1096
|
status: "error",
|
|
1046
1097
|
duration: 5e3,
|
|
1047
1098
|
isClosable: !0
|
|
1048
|
-
}),
|
|
1099
|
+
}), i?.(t instanceof Error ? t : new Error(m));
|
|
1049
1100
|
} finally {
|
|
1050
|
-
|
|
1101
|
+
S(!1);
|
|
1051
1102
|
}
|
|
1052
1103
|
}, [
|
|
1053
|
-
|
|
1104
|
+
E,
|
|
1054
1105
|
y,
|
|
1055
|
-
|
|
1056
|
-
|
|
1106
|
+
C,
|
|
1107
|
+
v,
|
|
1057
1108
|
s,
|
|
1058
|
-
|
|
1109
|
+
i,
|
|
1059
1110
|
d,
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
]),
|
|
1064
|
-
|
|
1111
|
+
G,
|
|
1112
|
+
k,
|
|
1113
|
+
r
|
|
1114
|
+
]), L = R(() => {
|
|
1115
|
+
I(""), A([]), a("copy"), n?.();
|
|
1065
1116
|
}, [n]);
|
|
1066
1117
|
ne(() => {
|
|
1067
|
-
|
|
1118
|
+
u && u({
|
|
1068
1119
|
cancelButton: !1,
|
|
1069
|
-
saveButton:
|
|
1120
|
+
saveButton: E.length === 0 || h
|
|
1070
1121
|
});
|
|
1071
|
-
}, [
|
|
1072
|
-
|
|
1073
|
-
cancelButton:
|
|
1074
|
-
saveButton:
|
|
1122
|
+
}, [E.length, h, u]), ne(() => {
|
|
1123
|
+
l && l({
|
|
1124
|
+
cancelButton: L,
|
|
1125
|
+
saveButton: M
|
|
1075
1126
|
});
|
|
1076
|
-
}, [
|
|
1077
|
-
const
|
|
1127
|
+
}, [l, L, M]);
|
|
1128
|
+
const X = F(() => T.map((t) => ({
|
|
1078
1129
|
value: t.id,
|
|
1079
1130
|
label: t.name
|
|
1080
|
-
})), [
|
|
1131
|
+
})), [T]), b = F(() => N.filter((t) => r === "copy" ? !0 : !t.quantumOwned).map((t) => ({
|
|
1081
1132
|
value: t.id,
|
|
1082
1133
|
label: t.name,
|
|
1083
1134
|
// Add custom data to identify quantum-owned modules
|
|
1084
1135
|
isQuantumOwned: t.quantumOwned
|
|
1085
|
-
})), [
|
|
1086
|
-
return /* @__PURE__ */ e.jsx(
|
|
1087
|
-
d && /* @__PURE__ */ e.jsxs(
|
|
1136
|
+
})), [N, r]), z = p.fetching, Z = g.fetching;
|
|
1137
|
+
return /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
|
|
1138
|
+
d && /* @__PURE__ */ e.jsxs(q, { children: [
|
|
1088
1139
|
/* @__PURE__ */ e.jsx(re, { children: "Operation Mode" }),
|
|
1089
1140
|
/* @__PURE__ */ e.jsx(
|
|
1090
|
-
|
|
1141
|
+
Ke,
|
|
1091
1142
|
{
|
|
1092
|
-
value:
|
|
1143
|
+
value: r,
|
|
1093
1144
|
onChange: (t) => {
|
|
1094
|
-
|
|
1145
|
+
a(t), A([]);
|
|
1095
1146
|
},
|
|
1096
1147
|
children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, children: [
|
|
1097
1148
|
/* @__PURE__ */ e.jsx(Ae, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
|
|
1098
|
-
/* @__PURE__ */ e.jsx(
|
|
1099
|
-
/* @__PURE__ */ e.jsx(
|
|
1149
|
+
/* @__PURE__ */ e.jsx(x, { fontWeight: "medium", children: "Copy Modules" }),
|
|
1150
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.600", children: "Create new modules based on selected ones" })
|
|
1100
1151
|
] }) }),
|
|
1101
1152
|
/* @__PURE__ */ e.jsx(Ae, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 1, children: [
|
|
1102
|
-
/* @__PURE__ */ e.jsx(
|
|
1103
|
-
/* @__PURE__ */ e.jsx(
|
|
1153
|
+
/* @__PURE__ */ e.jsx(x, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
|
|
1154
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.600", children: "Convert existing modules to quantum-owned" })
|
|
1104
1155
|
] }) })
|
|
1105
1156
|
] })
|
|
1106
1157
|
}
|
|
1107
1158
|
)
|
|
1108
1159
|
] }),
|
|
1109
|
-
/* @__PURE__ */ e.jsxs(
|
|
1160
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1110
1161
|
/* @__PURE__ */ e.jsx(re, { children: "Select Source Group" }),
|
|
1111
1162
|
/* @__PURE__ */ e.jsx(
|
|
1112
1163
|
se,
|
|
1113
1164
|
{
|
|
1114
1165
|
placeholder: "Choose a group...",
|
|
1115
|
-
options:
|
|
1116
|
-
value:
|
|
1117
|
-
onChange:
|
|
1118
|
-
isLoading:
|
|
1119
|
-
isDisabled:
|
|
1166
|
+
options: X,
|
|
1167
|
+
value: X.find((t) => t.value === o) || null,
|
|
1168
|
+
onChange: _,
|
|
1169
|
+
isLoading: z,
|
|
1170
|
+
isDisabled: z,
|
|
1120
1171
|
isClearable: !0
|
|
1121
1172
|
}
|
|
1122
1173
|
),
|
|
1123
1174
|
p.error && /* @__PURE__ */ e.jsxs(Te, { status: "error", mt: 2, children: [
|
|
1124
1175
|
/* @__PURE__ */ e.jsx(Me, {}),
|
|
1125
|
-
/* @__PURE__ */ e.jsxs(
|
|
1176
|
+
/* @__PURE__ */ e.jsxs(x, { fontSize: "sm", children: [
|
|
1126
1177
|
"Failed to load groups: ",
|
|
1127
1178
|
p.error.message
|
|
1128
1179
|
] })
|
|
1129
1180
|
] })
|
|
1130
1181
|
] }),
|
|
1131
|
-
|
|
1132
|
-
/* @__PURE__ */ e.jsx(re, { children:
|
|
1133
|
-
|
|
1134
|
-
/* @__PURE__ */ e.jsx(
|
|
1135
|
-
/* @__PURE__ */ e.jsx(
|
|
1182
|
+
o && /* @__PURE__ */ e.jsxs(q, { children: [
|
|
1183
|
+
/* @__PURE__ */ e.jsx(re, { children: r === "convert" ? "Select Module to Convert" : "Select Module to Copy" }),
|
|
1184
|
+
Z ? /* @__PURE__ */ e.jsxs(te, { children: [
|
|
1185
|
+
/* @__PURE__ */ e.jsx(Ze, { size: "sm" }),
|
|
1186
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.600", children: "Loading modules..." })
|
|
1136
1187
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1137
1188
|
/* @__PURE__ */ e.jsx(
|
|
1138
1189
|
se,
|
|
1139
1190
|
{
|
|
1140
|
-
placeholder:
|
|
1191
|
+
placeholder: r === "convert" ? "Choose modules to convert..." : "Choose modules to copy...",
|
|
1141
1192
|
options: b,
|
|
1142
1193
|
value: b.filter(
|
|
1143
|
-
(t) =>
|
|
1194
|
+
(t) => j.includes(t.value)
|
|
1144
1195
|
),
|
|
1145
|
-
onChange:
|
|
1196
|
+
onChange: f,
|
|
1146
1197
|
isDisabled: b.length === 0,
|
|
1147
1198
|
isClearable: !0,
|
|
1148
1199
|
isMulti: !0,
|
|
1149
1200
|
closeMenuOnSelect: !1,
|
|
1150
1201
|
formatOptionLabel: (t, { context: m }) => /* @__PURE__ */ e.jsxs(te, { justify: "space-between", w: "100%", children: [
|
|
1151
1202
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1152
|
-
/* @__PURE__ */ e.jsx(
|
|
1153
|
-
m === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(
|
|
1203
|
+
/* @__PURE__ */ e.jsx(x, { children: t.label }),
|
|
1204
|
+
m === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(x, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
1154
1205
|
] }),
|
|
1155
1206
|
t.isQuantumOwned && m === "menu" && /* @__PURE__ */ e.jsx(fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1156
1207
|
] })
|
|
1157
1208
|
}
|
|
1158
1209
|
),
|
|
1159
|
-
b.length === 0 && /* @__PURE__ */ e.jsx(
|
|
1210
|
+
b.length === 0 && /* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.500", mt: 2, children: "No modules found in this group" })
|
|
1160
1211
|
] }),
|
|
1161
1212
|
g.error && /* @__PURE__ */ e.jsxs(Te, { status: "error", mt: 2, children: [
|
|
1162
1213
|
/* @__PURE__ */ e.jsx(Me, {}),
|
|
1163
|
-
/* @__PURE__ */ e.jsxs(
|
|
1214
|
+
/* @__PURE__ */ e.jsxs(x, { fontSize: "sm", children: [
|
|
1164
1215
|
"Failed to load modules: ",
|
|
1165
1216
|
g.error.message
|
|
1166
1217
|
] })
|
|
1167
1218
|
] })
|
|
1168
1219
|
] }),
|
|
1169
|
-
|
|
1170
|
-
/* @__PURE__ */ e.jsx(
|
|
1220
|
+
E.length > 0 && /* @__PURE__ */ e.jsxs(Y, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
1221
|
+
/* @__PURE__ */ e.jsx(x, { fontWeight: "semibold", mb: 3, children: E.length === 1 ? `Module to ${r === "copy" ? "Copy" : "Convert"}` : `${E.length} Modules to ${r === "copy" ? "Copy" : "Convert"}` }),
|
|
1171
1222
|
/* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 3, children: [
|
|
1172
|
-
|
|
1173
|
-
|
|
1223
|
+
E.map((t, m) => /* @__PURE__ */ e.jsxs(
|
|
1224
|
+
Y,
|
|
1174
1225
|
{
|
|
1175
1226
|
w: "100%",
|
|
1176
1227
|
p: 3,
|
|
@@ -1180,7 +1231,7 @@ const Ht = ({
|
|
|
1180
1231
|
borderColor: "gray.200",
|
|
1181
1232
|
children: [
|
|
1182
1233
|
/* @__PURE__ */ e.jsxs(te, { justify: "space-between", align: "start", mb: 2, children: [
|
|
1183
|
-
/* @__PURE__ */ e.jsxs(
|
|
1234
|
+
/* @__PURE__ */ e.jsxs(x, { fontWeight: "medium", fontSize: "sm", children: [
|
|
1184
1235
|
m + 1,
|
|
1185
1236
|
". ",
|
|
1186
1237
|
t.name
|
|
@@ -1195,20 +1246,20 @@ const Ht = ({
|
|
|
1195
1246
|
fontSize: "sm",
|
|
1196
1247
|
color: "gray.600",
|
|
1197
1248
|
children: [
|
|
1198
|
-
t.description && /* @__PURE__ */ e.jsxs(
|
|
1249
|
+
t.description && /* @__PURE__ */ e.jsxs(x, { children: [
|
|
1199
1250
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
1200
1251
|
" ",
|
|
1201
1252
|
t.description
|
|
1202
1253
|
] }),
|
|
1203
|
-
/* @__PURE__ */ e.jsxs(
|
|
1254
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
1204
1255
|
/* @__PURE__ */ e.jsx("strong", { children: "Actions:" }),
|
|
1205
1256
|
" ",
|
|
1206
1257
|
t.moduleActions.length
|
|
1207
1258
|
] }),
|
|
1208
|
-
/* @__PURE__ */ e.jsxs(
|
|
1259
|
+
/* @__PURE__ */ e.jsxs(x, { children: [
|
|
1209
1260
|
/* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
|
|
1210
1261
|
" ",
|
|
1211
|
-
t.categories.map((
|
|
1262
|
+
t.categories.map((w) => w.name).join(", ") || "None"
|
|
1212
1263
|
] })
|
|
1213
1264
|
]
|
|
1214
1265
|
}
|
|
@@ -1217,8 +1268,8 @@ const Ht = ({
|
|
|
1217
1268
|
},
|
|
1218
1269
|
t.id
|
|
1219
1270
|
)),
|
|
1220
|
-
|
|
1221
|
-
|
|
1271
|
+
E.length > 1 && /* @__PURE__ */ e.jsx(
|
|
1272
|
+
Y,
|
|
1222
1273
|
{
|
|
1223
1274
|
w: "100%",
|
|
1224
1275
|
p: 2,
|
|
@@ -1226,133 +1277,133 @@ const Ht = ({
|
|
|
1226
1277
|
borderRadius: "md",
|
|
1227
1278
|
border: "1px solid",
|
|
1228
1279
|
borderColor: "blue.200",
|
|
1229
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1280
|
+
children: /* @__PURE__ */ e.jsxs(x, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1230
1281
|
"Total: ",
|
|
1231
|
-
|
|
1282
|
+
E.length,
|
|
1232
1283
|
" modules will be",
|
|
1233
1284
|
" ",
|
|
1234
|
-
|
|
1285
|
+
r === "copy" ? "copied" : "converted"
|
|
1235
1286
|
] })
|
|
1236
1287
|
}
|
|
1237
1288
|
),
|
|
1238
|
-
d &&
|
|
1239
|
-
|
|
1289
|
+
d && E.filter((t) => t.moduleActions.some((m) => !m.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
|
|
1290
|
+
Y,
|
|
1240
1291
|
{
|
|
1241
1292
|
p: 2,
|
|
1242
1293
|
bg: "yellow.50",
|
|
1243
1294
|
borderRadius: "md",
|
|
1244
1295
|
border: "1px solid",
|
|
1245
1296
|
borderColor: "yellow.200",
|
|
1246
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1297
|
+
children: /* @__PURE__ */ e.jsx(x, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: r === "convert" ? "Converting Modules will convert non QM-Owned Actions to QM-Owned" : "Copying Modules with Non QM-Owned Actions will create corresponding QM-Owned Actions" })
|
|
1247
1298
|
}
|
|
1248
1299
|
)
|
|
1249
1300
|
] })
|
|
1250
1301
|
] }),
|
|
1251
|
-
!
|
|
1302
|
+
!c && /* @__PURE__ */ e.jsxs(xe, { spacing: 4, justifyContent: "flex-end", children: [
|
|
1252
1303
|
/* @__PURE__ */ e.jsx(
|
|
1253
|
-
|
|
1304
|
+
J,
|
|
1254
1305
|
{
|
|
1255
1306
|
variant: "outline",
|
|
1256
|
-
onClick:
|
|
1257
|
-
isDisabled:
|
|
1307
|
+
onClick: L,
|
|
1308
|
+
isDisabled: h,
|
|
1258
1309
|
children: "Cancel"
|
|
1259
1310
|
}
|
|
1260
1311
|
),
|
|
1261
1312
|
/* @__PURE__ */ e.jsxs(
|
|
1262
|
-
|
|
1313
|
+
J,
|
|
1263
1314
|
{
|
|
1264
|
-
colorScheme:
|
|
1265
|
-
onClick:
|
|
1266
|
-
isDisabled:
|
|
1267
|
-
isLoading:
|
|
1268
|
-
loadingText: `${
|
|
1315
|
+
colorScheme: r === "copy" ? "blue" : "green",
|
|
1316
|
+
onClick: M,
|
|
1317
|
+
isDisabled: E.length === 0 || h,
|
|
1318
|
+
isLoading: h,
|
|
1319
|
+
loadingText: `${r === "copy" ? "Copying" : "Converting"}...`,
|
|
1269
1320
|
children: [
|
|
1270
|
-
|
|
1321
|
+
r === "copy" ? "Copy" : "Convert",
|
|
1271
1322
|
" ",
|
|
1272
|
-
|
|
1323
|
+
E.length === 1 ? "Module" : `${E.length} Modules`
|
|
1273
1324
|
]
|
|
1274
1325
|
}
|
|
1275
1326
|
)
|
|
1276
1327
|
] })
|
|
1277
1328
|
] }) });
|
|
1278
|
-
},
|
|
1329
|
+
}, an = ({
|
|
1279
1330
|
name: s,
|
|
1280
1331
|
setName: n,
|
|
1281
|
-
actions:
|
|
1282
|
-
selectedActionIds:
|
|
1283
|
-
setSelectedActionIds:
|
|
1284
|
-
availableCategories:
|
|
1332
|
+
actions: i,
|
|
1333
|
+
selectedActionIds: c,
|
|
1334
|
+
setSelectedActionIds: u,
|
|
1335
|
+
availableCategories: l,
|
|
1285
1336
|
selectedCategoryIds: d,
|
|
1286
|
-
setSelectedCategoryIds:
|
|
1287
|
-
description:
|
|
1288
|
-
setDescription:
|
|
1289
|
-
...
|
|
1337
|
+
setSelectedCategoryIds: v,
|
|
1338
|
+
description: o,
|
|
1339
|
+
setDescription: I,
|
|
1340
|
+
...j
|
|
1290
1341
|
}) => {
|
|
1291
|
-
const
|
|
1342
|
+
const A = gt(), h = F(() => i.map((y) => ({
|
|
1292
1343
|
...y,
|
|
1293
|
-
selected:
|
|
1294
|
-
})), [
|
|
1295
|
-
() =>
|
|
1296
|
-
[
|
|
1297
|
-
),
|
|
1298
|
-
(y,
|
|
1299
|
-
|
|
1344
|
+
selected: c.includes(y.id)
|
|
1345
|
+
})), [i, c]), S = F(() => i.reduce((y, C) => (y[C.id] = C, y), {}), [i]), r = F(
|
|
1346
|
+
() => c.map((y) => S[y]),
|
|
1347
|
+
[h, c]
|
|
1348
|
+
), a = R(
|
|
1349
|
+
(y, C) => {
|
|
1350
|
+
u(C ? [...c, y.id] : c.filter((G) => G !== y.id));
|
|
1300
1351
|
},
|
|
1301
|
-
[
|
|
1302
|
-
), p =
|
|
1352
|
+
[c, u]
|
|
1353
|
+
), p = R(
|
|
1303
1354
|
(y) => {
|
|
1304
1355
|
n(y.target.value);
|
|
1305
1356
|
},
|
|
1306
1357
|
[n]
|
|
1307
|
-
), g =
|
|
1358
|
+
), g = R(
|
|
1308
1359
|
(y) => {
|
|
1309
|
-
|
|
1360
|
+
I?.(y.target.value);
|
|
1310
1361
|
},
|
|
1311
|
-
[
|
|
1362
|
+
[I]
|
|
1312
1363
|
);
|
|
1313
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1364
|
+
return /* @__PURE__ */ e.jsxs(Y, { ...j, children: [
|
|
1314
1365
|
/* @__PURE__ */ e.jsxs(te, { gap: "2rem", children: [
|
|
1315
|
-
/* @__PURE__ */ e.jsx(
|
|
1366
|
+
/* @__PURE__ */ e.jsx(cn, { name: s ?? "", onInputChange: p }),
|
|
1316
1367
|
/* @__PURE__ */ e.jsx(
|
|
1317
|
-
|
|
1368
|
+
dn,
|
|
1318
1369
|
{
|
|
1319
|
-
availableCategories:
|
|
1370
|
+
availableCategories: l,
|
|
1320
1371
|
value: d,
|
|
1321
|
-
onChange:
|
|
1372
|
+
onChange: v
|
|
1322
1373
|
}
|
|
1323
1374
|
)
|
|
1324
1375
|
] }),
|
|
1325
1376
|
/* @__PURE__ */ e.jsx(
|
|
1326
|
-
|
|
1377
|
+
un,
|
|
1327
1378
|
{
|
|
1328
|
-
description:
|
|
1379
|
+
description: o ?? "",
|
|
1329
1380
|
onInputChange: g
|
|
1330
1381
|
}
|
|
1331
1382
|
),
|
|
1332
1383
|
/* @__PURE__ */ e.jsx(
|
|
1333
|
-
|
|
1384
|
+
hn,
|
|
1334
1385
|
{
|
|
1335
|
-
value:
|
|
1336
|
-
onChange:
|
|
1337
|
-
onAdjustActivities: () =>
|
|
1386
|
+
value: r,
|
|
1387
|
+
onChange: u,
|
|
1388
|
+
onAdjustActivities: () => A.onOpen()
|
|
1338
1389
|
}
|
|
1339
1390
|
),
|
|
1340
1391
|
/* @__PURE__ */ e.jsxs(
|
|
1341
|
-
|
|
1392
|
+
xt,
|
|
1342
1393
|
{
|
|
1343
|
-
isOpen:
|
|
1344
|
-
onClose:
|
|
1394
|
+
isOpen: A.isOpen,
|
|
1395
|
+
onClose: A.onClose,
|
|
1345
1396
|
size: "6xl",
|
|
1346
1397
|
children: [
|
|
1347
|
-
/* @__PURE__ */ e.jsx(
|
|
1348
|
-
/* @__PURE__ */ e.jsxs(
|
|
1349
|
-
/* @__PURE__ */ e.jsx(
|
|
1350
|
-
/* @__PURE__ */ e.jsx(
|
|
1351
|
-
/* @__PURE__ */ e.jsx(
|
|
1352
|
-
|
|
1398
|
+
/* @__PURE__ */ e.jsx(jt, {}),
|
|
1399
|
+
/* @__PURE__ */ e.jsxs(ft, { children: [
|
|
1400
|
+
/* @__PURE__ */ e.jsx(vt, { children: "Select Activities" }),
|
|
1401
|
+
/* @__PURE__ */ e.jsx(yt, {}),
|
|
1402
|
+
/* @__PURE__ */ e.jsx(bt, { children: /* @__PURE__ */ e.jsx(
|
|
1403
|
+
ln,
|
|
1353
1404
|
{
|
|
1354
|
-
actions:
|
|
1355
|
-
onSelected:
|
|
1405
|
+
actions: h,
|
|
1406
|
+
onSelected: a,
|
|
1356
1407
|
disableCreate: !0,
|
|
1357
1408
|
disableDelete: !0,
|
|
1358
1409
|
tableProps: {
|
|
@@ -1361,12 +1412,12 @@ const Ht = ({
|
|
|
1361
1412
|
}
|
|
1362
1413
|
}
|
|
1363
1414
|
) }),
|
|
1364
|
-
/* @__PURE__ */ e.jsx(
|
|
1365
|
-
|
|
1415
|
+
/* @__PURE__ */ e.jsx(Ct, { children: /* @__PURE__ */ e.jsx(
|
|
1416
|
+
J,
|
|
1366
1417
|
{
|
|
1367
1418
|
colorScheme: "blue",
|
|
1368
|
-
onClick:
|
|
1369
|
-
isDisabled:
|
|
1419
|
+
onClick: A.onClose,
|
|
1420
|
+
isDisabled: c.length === 0,
|
|
1370
1421
|
children: "Done"
|
|
1371
1422
|
}
|
|
1372
1423
|
) })
|
|
@@ -1375,11 +1426,11 @@ const Ht = ({
|
|
|
1375
1426
|
}
|
|
1376
1427
|
)
|
|
1377
1428
|
] });
|
|
1378
|
-
},
|
|
1429
|
+
}, cn = Oe(
|
|
1379
1430
|
({
|
|
1380
1431
|
name: s,
|
|
1381
1432
|
onInputChange: n
|
|
1382
|
-
}) => /* @__PURE__ */ e.jsxs(
|
|
1433
|
+
}) => /* @__PURE__ */ e.jsxs(q, { mb: 4, children: [
|
|
1383
1434
|
/* @__PURE__ */ e.jsx(re, { children: "Module Name" }),
|
|
1384
1435
|
/* @__PURE__ */ e.jsx(
|
|
1385
1436
|
je,
|
|
@@ -1391,48 +1442,48 @@ const Ht = ({
|
|
|
1391
1442
|
}
|
|
1392
1443
|
)
|
|
1393
1444
|
] })
|
|
1394
|
-
),
|
|
1445
|
+
), dn = Oe(
|
|
1395
1446
|
({
|
|
1396
1447
|
availableCategories: s,
|
|
1397
1448
|
value: n,
|
|
1398
|
-
onChange:
|
|
1449
|
+
onChange: i
|
|
1399
1450
|
}) => {
|
|
1400
|
-
const
|
|
1451
|
+
const c = F(() => [
|
|
1401
1452
|
...s,
|
|
1402
1453
|
{
|
|
1403
1454
|
id: "other",
|
|
1404
1455
|
name: "Other"
|
|
1405
1456
|
}
|
|
1406
|
-
], [s]),
|
|
1407
|
-
value:
|
|
1408
|
-
label:
|
|
1409
|
-
})), [
|
|
1410
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1457
|
+
], [s]), u = F(() => c.map((l) => ({
|
|
1458
|
+
value: l.id,
|
|
1459
|
+
label: l.name
|
|
1460
|
+
})), [c]);
|
|
1461
|
+
return /* @__PURE__ */ e.jsxs(q, { mb: 4, children: [
|
|
1411
1462
|
/* @__PURE__ */ e.jsx(re, { children: "Module Category" }),
|
|
1412
1463
|
/* @__PURE__ */ e.jsx(
|
|
1413
1464
|
se,
|
|
1414
1465
|
{
|
|
1415
1466
|
isDisabled: s.length === 0,
|
|
1416
1467
|
isClearable: !0,
|
|
1417
|
-
options:
|
|
1418
|
-
value:
|
|
1419
|
-
value:
|
|
1420
|
-
label:
|
|
1468
|
+
options: u,
|
|
1469
|
+
value: c.filter((l) => n.includes(l.id)).map((l) => ({
|
|
1470
|
+
value: l.id,
|
|
1471
|
+
label: l.name
|
|
1421
1472
|
})),
|
|
1422
|
-
onChange: (
|
|
1473
|
+
onChange: (l) => i(l ? [l.value] : []),
|
|
1423
1474
|
placeholder: "Select category"
|
|
1424
1475
|
}
|
|
1425
1476
|
)
|
|
1426
1477
|
] });
|
|
1427
1478
|
}
|
|
1428
|
-
),
|
|
1479
|
+
), un = Oe(
|
|
1429
1480
|
({
|
|
1430
1481
|
description: s,
|
|
1431
1482
|
onInputChange: n
|
|
1432
|
-
}) => /* @__PURE__ */ e.jsxs(
|
|
1483
|
+
}) => /* @__PURE__ */ e.jsxs(q, { mb: 4, children: [
|
|
1433
1484
|
/* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1434
1485
|
"Description",
|
|
1435
|
-
/* @__PURE__ */ e.jsx(
|
|
1486
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.500", children: "Briefly describe the objective of this module. Max 40 words." })
|
|
1436
1487
|
] }) }),
|
|
1437
1488
|
/* @__PURE__ */ e.jsx(
|
|
1438
1489
|
je,
|
|
@@ -1443,127 +1494,130 @@ const Ht = ({
|
|
|
1443
1494
|
}
|
|
1444
1495
|
)
|
|
1445
1496
|
] })
|
|
1446
|
-
),
|
|
1497
|
+
), hn = Oe(
|
|
1447
1498
|
({
|
|
1448
1499
|
value: s,
|
|
1449
1500
|
onChange: n,
|
|
1450
|
-
onAdjustActivities:
|
|
1501
|
+
onAdjustActivities: i
|
|
1451
1502
|
}) => {
|
|
1452
|
-
const
|
|
1453
|
-
() => s.map((
|
|
1454
|
-
id:
|
|
1455
|
-
name:
|
|
1503
|
+
const c = F(
|
|
1504
|
+
() => s.map((u) => ({
|
|
1505
|
+
id: u.id,
|
|
1506
|
+
name: u.name
|
|
1456
1507
|
})),
|
|
1457
1508
|
[s]
|
|
1458
1509
|
);
|
|
1459
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1510
|
+
return /* @__PURE__ */ e.jsxs(q, { mb: 4, children: [
|
|
1460
1511
|
/* @__PURE__ */ e.jsxs(te, { justifyContent: "space-between", children: [
|
|
1461
1512
|
/* @__PURE__ */ e.jsx(re, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1462
1513
|
"Activities",
|
|
1463
|
-
/* @__PURE__ */ e.jsx(
|
|
1514
|
+
/* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.500", children: "Drag and drop to reorder the activities in this module." })
|
|
1464
1515
|
] }) }),
|
|
1465
1516
|
/* @__PURE__ */ e.jsx(
|
|
1466
|
-
|
|
1517
|
+
J,
|
|
1467
1518
|
{
|
|
1468
1519
|
size: "sm",
|
|
1469
1520
|
variant: "solid",
|
|
1470
1521
|
colorScheme: "blue",
|
|
1471
|
-
onClick:
|
|
1522
|
+
onClick: i,
|
|
1472
1523
|
children: "Add / Remove Activities"
|
|
1473
1524
|
}
|
|
1474
1525
|
)
|
|
1475
1526
|
] }),
|
|
1476
|
-
|
|
1527
|
+
c.length === 0 ? /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(x, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
|
|
1477
1528
|
"No activities selected for this module.",
|
|
1478
1529
|
/* @__PURE__ */ e.jsx(
|
|
1479
|
-
|
|
1530
|
+
J,
|
|
1480
1531
|
{
|
|
1481
1532
|
ml: "0.5em",
|
|
1482
1533
|
size: "sm",
|
|
1483
1534
|
variant: "link",
|
|
1484
1535
|
colorScheme: "blue",
|
|
1485
|
-
onClick:
|
|
1536
|
+
onClick: i,
|
|
1486
1537
|
children: "Add activities."
|
|
1487
1538
|
}
|
|
1488
1539
|
)
|
|
1489
1540
|
] }) }) : /* @__PURE__ */ e.jsx(
|
|
1490
|
-
|
|
1541
|
+
Xt,
|
|
1491
1542
|
{
|
|
1492
|
-
value:
|
|
1493
|
-
onChange: (
|
|
1494
|
-
const
|
|
1495
|
-
n(
|
|
1543
|
+
value: c,
|
|
1544
|
+
onChange: (u) => {
|
|
1545
|
+
const l = u(c);
|
|
1546
|
+
n(l.map((d) => d.id));
|
|
1496
1547
|
}
|
|
1497
1548
|
}
|
|
1498
1549
|
)
|
|
1499
1550
|
] });
|
|
1500
1551
|
}
|
|
1501
|
-
),
|
|
1552
|
+
), mn = ({
|
|
1502
1553
|
value: s,
|
|
1503
1554
|
onChange: n,
|
|
1504
|
-
forceKind:
|
|
1505
|
-
disableRemove:
|
|
1506
|
-
disableKind:
|
|
1507
|
-
|
|
1508
|
-
|
|
1555
|
+
forceKind: i,
|
|
1556
|
+
disableRemove: c,
|
|
1557
|
+
disableKind: u,
|
|
1558
|
+
isDisabled: l,
|
|
1559
|
+
lockRanges: d,
|
|
1560
|
+
...v
|
|
1509
1561
|
}) => {
|
|
1510
|
-
const
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
1513
|
-
}), [s]),
|
|
1514
|
-
(h,
|
|
1515
|
-
const
|
|
1516
|
-
(
|
|
1562
|
+
const o = F(() => [...s].sort((h, S) => {
|
|
1563
|
+
const r = Ge.indexOf(h.plane), a = Ge.indexOf(S.plane);
|
|
1564
|
+
return r - a;
|
|
1565
|
+
}), [s]), I = R((h) => "segment" in h.id ? it(h.id.segment, h.plane, !0) ?? "Unknown" : lt(h.id.joint, h.plane, !0) ?? "Unknown", []), j = R(
|
|
1566
|
+
(h, S) => {
|
|
1567
|
+
const r = o.findIndex(
|
|
1568
|
+
(p) => p.id === S.id && p.plane === S.plane
|
|
1517
1569
|
);
|
|
1518
|
-
let
|
|
1519
|
-
|
|
1520
|
-
...
|
|
1521
|
-
min:
|
|
1522
|
-
max:
|
|
1523
|
-
}))), n(
|
|
1570
|
+
let a = [...o];
|
|
1571
|
+
i && (S = { ...S, kind: i }), a[r] = S, d && (a = a.map((p) => ({
|
|
1572
|
+
...p,
|
|
1573
|
+
min: S.min,
|
|
1574
|
+
max: S.max
|
|
1575
|
+
}))), n(a);
|
|
1524
1576
|
},
|
|
1525
|
-
[n,
|
|
1526
|
-
),
|
|
1577
|
+
[n, o, i, d]
|
|
1578
|
+
), A = R(
|
|
1527
1579
|
(h) => {
|
|
1528
|
-
const
|
|
1529
|
-
(
|
|
1580
|
+
const S = o.filter(
|
|
1581
|
+
(r) => r.id !== h.id || r.plane !== h.plane
|
|
1530
1582
|
);
|
|
1531
|
-
n(
|
|
1583
|
+
n(S);
|
|
1532
1584
|
},
|
|
1533
|
-
[n,
|
|
1585
|
+
[n, o]
|
|
1534
1586
|
);
|
|
1535
|
-
return /* @__PURE__ */ e.jsx(ee, { alignItems: "flex-start", overflowY: "auto", ...
|
|
1536
|
-
|
|
1587
|
+
return /* @__PURE__ */ e.jsx(ee, { alignItems: "flex-start", overflowY: "auto", ...v, children: o.map((h, S) => /* @__PURE__ */ e.jsx(
|
|
1588
|
+
pn,
|
|
1537
1589
|
{
|
|
1538
|
-
label:
|
|
1590
|
+
label: I(h),
|
|
1539
1591
|
parameter: h,
|
|
1540
|
-
onChange: (
|
|
1541
|
-
onRemove:
|
|
1542
|
-
forceKind:
|
|
1543
|
-
disableKind:
|
|
1592
|
+
onChange: (r) => j(S, r),
|
|
1593
|
+
onRemove: c || l ? void 0 : () => A(h),
|
|
1594
|
+
forceKind: i,
|
|
1595
|
+
disableKind: u || l,
|
|
1596
|
+
isDisabled: l
|
|
1544
1597
|
},
|
|
1545
1598
|
`${JSON.stringify(h.id)}-${h.plane}`
|
|
1546
1599
|
)) });
|
|
1547
|
-
},
|
|
1600
|
+
}, pn = ({
|
|
1548
1601
|
label: s,
|
|
1549
1602
|
parameter: n,
|
|
1550
|
-
onChange:
|
|
1551
|
-
onRemove:
|
|
1552
|
-
forceKind:
|
|
1553
|
-
disableKind:
|
|
1603
|
+
onChange: i,
|
|
1604
|
+
onRemove: c,
|
|
1605
|
+
forceKind: u,
|
|
1606
|
+
disableKind: l,
|
|
1607
|
+
isDisabled: d
|
|
1554
1608
|
}) => {
|
|
1555
|
-
const
|
|
1556
|
-
(
|
|
1609
|
+
const v = R(
|
|
1610
|
+
(j) => "joint" in n.id ? Wt(
|
|
1557
1611
|
n.id.joint,
|
|
1558
1612
|
n.plane,
|
|
1559
|
-
|
|
1560
|
-
) :
|
|
1613
|
+
j < 0 ? -1 : 1
|
|
1614
|
+
) : Qt(
|
|
1561
1615
|
n.id.segment,
|
|
1562
1616
|
n.plane,
|
|
1563
|
-
|
|
1617
|
+
j < 0 ? -1 : 1
|
|
1564
1618
|
),
|
|
1565
1619
|
[n]
|
|
1566
|
-
), { min:
|
|
1620
|
+
), { min: o, max: I } = "joint" in n.id ? Ut(n.id.joint, n.plane) : { min: -180, max: 180 };
|
|
1567
1621
|
return /* @__PURE__ */ e.jsxs(
|
|
1568
1622
|
ee,
|
|
1569
1623
|
{
|
|
@@ -1577,7 +1631,7 @@ const Ht = ({
|
|
|
1577
1631
|
children: [
|
|
1578
1632
|
/* @__PURE__ */ e.jsxs(te, { w: "100%", children: [
|
|
1579
1633
|
/* @__PURE__ */ e.jsx(
|
|
1580
|
-
|
|
1634
|
+
x,
|
|
1581
1635
|
{
|
|
1582
1636
|
fontSize: "sm",
|
|
1583
1637
|
flex: 1,
|
|
@@ -1586,22 +1640,22 @@ const Ht = ({
|
|
|
1586
1640
|
children: s
|
|
1587
1641
|
}
|
|
1588
1642
|
),
|
|
1589
|
-
|
|
1590
|
-
|
|
1643
|
+
c && !d && /* @__PURE__ */ e.jsx(
|
|
1644
|
+
wt,
|
|
1591
1645
|
{
|
|
1592
1646
|
size: "xs",
|
|
1593
1647
|
variant: "ghost",
|
|
1594
1648
|
"aria-label": "delete",
|
|
1595
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1596
|
-
onClick:
|
|
1649
|
+
icon: /* @__PURE__ */ e.jsx(Ue, { as: Mt }),
|
|
1650
|
+
onClick: c
|
|
1597
1651
|
}
|
|
1598
1652
|
),
|
|
1599
|
-
!
|
|
1600
|
-
|
|
1653
|
+
!u && /* @__PURE__ */ e.jsx(
|
|
1654
|
+
Zt,
|
|
1601
1655
|
{
|
|
1602
1656
|
selectedItem: n?.kind ?? we.Limit,
|
|
1603
|
-
onChange: ({ value:
|
|
1604
|
-
isDisabled:
|
|
1657
|
+
onChange: ({ value: j }) => i({ ...n, kind: j }),
|
|
1658
|
+
isDisabled: l || d,
|
|
1605
1659
|
buttonProps: {
|
|
1606
1660
|
size: "sm",
|
|
1607
1661
|
variant: "outline",
|
|
@@ -1619,414 +1673,427 @@ const Ht = ({
|
|
|
1619
1673
|
)
|
|
1620
1674
|
] }),
|
|
1621
1675
|
/* @__PURE__ */ e.jsx(
|
|
1622
|
-
|
|
1676
|
+
Vt,
|
|
1623
1677
|
{
|
|
1624
1678
|
w: "100%",
|
|
1625
1679
|
size: "xs",
|
|
1626
|
-
min:
|
|
1627
|
-
max:
|
|
1680
|
+
min: o,
|
|
1681
|
+
max: I,
|
|
1628
1682
|
zeroMarker: !0,
|
|
1629
1683
|
value: [n.min, n.max],
|
|
1630
|
-
onChange: (
|
|
1631
|
-
formatValue: (
|
|
1632
|
-
valueLabel: (
|
|
1633
|
-
positiveNegativeLabels:
|
|
1684
|
+
onChange: (j) => i({ ...n, min: j[0], max: j[1] }),
|
|
1685
|
+
formatValue: (j) => `${Math.abs(j)}°`,
|
|
1686
|
+
valueLabel: (j) => v(j) ?? "",
|
|
1687
|
+
positiveNegativeLabels: v(0) ? [v(-1) ?? "", v(1) ?? ""] : void 0,
|
|
1688
|
+
isDisabled: d
|
|
1634
1689
|
}
|
|
1635
1690
|
)
|
|
1636
1691
|
]
|
|
1637
1692
|
}
|
|
1638
1693
|
);
|
|
1639
|
-
}, be = (s, n) => "segment" in s && "segment" in n && s.segment === n.segment || "joint" in s && "joint" in n && s.joint === n.joint,
|
|
1694
|
+
}, be = (s, n) => "segment" in s && "segment" in n && s.segment === n.segment || "joint" in s && "joint" in n && s.joint === n.joint, gn = ({
|
|
1640
1695
|
options: s,
|
|
1641
1696
|
value: n,
|
|
1642
|
-
onChange:
|
|
1643
|
-
forceKind:
|
|
1644
|
-
singleValue:
|
|
1645
|
-
singleValueSideless:
|
|
1697
|
+
onChange: i,
|
|
1698
|
+
forceKind: c,
|
|
1699
|
+
singleValue: u,
|
|
1700
|
+
singleValueSideless: l,
|
|
1646
1701
|
editOnly: d,
|
|
1647
|
-
disableKind:
|
|
1648
|
-
maxParameters:
|
|
1649
|
-
...
|
|
1702
|
+
disableKind: v,
|
|
1703
|
+
maxParameters: o,
|
|
1704
|
+
...I
|
|
1650
1705
|
}) => {
|
|
1651
|
-
const
|
|
1652
|
-
() => s.map((
|
|
1653
|
-
label: "segment" in
|
|
1654
|
-
value:
|
|
1655
|
-
plane:
|
|
1706
|
+
const j = l ? 2 : o, A = F(
|
|
1707
|
+
() => s.map((a) => ({
|
|
1708
|
+
label: "segment" in a.id ? it(a.id.segment, a.plane, !0) ?? "Unknown" : lt(a.id.joint, a.plane, !0) ?? "Unknown",
|
|
1709
|
+
value: a.id,
|
|
1710
|
+
plane: a.plane
|
|
1656
1711
|
})),
|
|
1657
1712
|
[s]
|
|
1658
|
-
),
|
|
1659
|
-
if (!
|
|
1660
|
-
return
|
|
1661
|
-
const
|
|
1662
|
-
return
|
|
1663
|
-
(p) => ve(p.value) === ve(
|
|
1713
|
+
), h = F(() => {
|
|
1714
|
+
if (!l || n.length === 0)
|
|
1715
|
+
return A;
|
|
1716
|
+
const a = n[0];
|
|
1717
|
+
return A.filter(
|
|
1718
|
+
(p) => ve(p.value) === ve(a.id) && p.plane === a.plane
|
|
1664
1719
|
);
|
|
1665
|
-
}, [
|
|
1666
|
-
() =>
|
|
1667
|
-
(
|
|
1720
|
+
}, [A, n, l]), S = F(
|
|
1721
|
+
() => A.filter(
|
|
1722
|
+
(a) => n.some((p) => be(p.id, a.value) && p.plane === a.plane)
|
|
1668
1723
|
),
|
|
1669
|
-
[
|
|
1670
|
-
),
|
|
1671
|
-
(
|
|
1672
|
-
const p =
|
|
1724
|
+
[A, n]
|
|
1725
|
+
), r = R(
|
|
1726
|
+
(a) => {
|
|
1727
|
+
const p = a.map((g) => {
|
|
1673
1728
|
const y = n.find(
|
|
1674
|
-
(
|
|
1675
|
-
),
|
|
1676
|
-
(
|
|
1677
|
-
),
|
|
1678
|
-
(
|
|
1679
|
-
) : void 0,
|
|
1729
|
+
(N) => be(N.id, g.value) && N.plane === g.plane
|
|
1730
|
+
), C = s.find(
|
|
1731
|
+
(N) => be(N.id, g.value) && N.plane === g.plane
|
|
1732
|
+
), G = l ? n.find(
|
|
1733
|
+
(N) => ve(N.id) === ve(g.value) && N.plane === g.plane
|
|
1734
|
+
) : void 0, k = G && !y ? G.min : C && C.min ? C.min : 0, T = G && !y ? G.max : C && C.max ? C.max : 0;
|
|
1680
1735
|
return y ?? {
|
|
1681
1736
|
id: g.value,
|
|
1682
1737
|
plane: g.plane,
|
|
1683
|
-
min:
|
|
1684
|
-
max:
|
|
1685
|
-
kind:
|
|
1738
|
+
min: k,
|
|
1739
|
+
max: T,
|
|
1740
|
+
kind: c ?? we.Limit
|
|
1686
1741
|
};
|
|
1687
1742
|
});
|
|
1688
|
-
|
|
1743
|
+
i(p);
|
|
1689
1744
|
},
|
|
1690
|
-
[
|
|
1745
|
+
[i, n, s, c, l]
|
|
1691
1746
|
);
|
|
1692
1747
|
return ne(() => {
|
|
1693
|
-
const
|
|
1748
|
+
const a = n.filter(
|
|
1694
1749
|
(p) => s.some((g) => be(g.id, p.id) && g.plane === p.plane)
|
|
1695
1750
|
);
|
|
1696
|
-
|
|
1697
|
-
}, [s,
|
|
1751
|
+
a.length !== n.length && i(a);
|
|
1752
|
+
}, [s, i]), /* @__PURE__ */ e.jsxs(Y, { ...I, children: [
|
|
1698
1753
|
/* @__PURE__ */ e.jsx(
|
|
1699
1754
|
se,
|
|
1700
1755
|
{
|
|
1701
|
-
isMulti: !
|
|
1756
|
+
isMulti: !u,
|
|
1702
1757
|
placeholder: n.length ? `${n.length} selected` : "Search...",
|
|
1703
|
-
value:
|
|
1704
|
-
isDisabled: d ||
|
|
1705
|
-
onChange: (
|
|
1706
|
-
options:
|
|
1758
|
+
value: S,
|
|
1759
|
+
isDisabled: d || S.length >= (j ?? 1 / 0),
|
|
1760
|
+
onChange: (a) => Array.isArray(a) ? r([...a]) : r(a !== null ? [a] : []),
|
|
1761
|
+
options: h,
|
|
1707
1762
|
controlShouldRenderValue: !1
|
|
1708
1763
|
}
|
|
1709
1764
|
),
|
|
1710
1765
|
/* @__PURE__ */ e.jsx(
|
|
1711
|
-
|
|
1766
|
+
mn,
|
|
1712
1767
|
{
|
|
1713
1768
|
marginTop: 2,
|
|
1714
1769
|
maxH: "28rem",
|
|
1715
1770
|
value: n,
|
|
1716
|
-
onChange:
|
|
1717
|
-
forceKind:
|
|
1718
|
-
disableKind:
|
|
1719
|
-
|
|
1771
|
+
onChange: i,
|
|
1772
|
+
forceKind: c,
|
|
1773
|
+
disableKind: v,
|
|
1774
|
+
isDisabled: d,
|
|
1775
|
+
lockRanges: l
|
|
1720
1776
|
}
|
|
1721
1777
|
)
|
|
1722
1778
|
] });
|
|
1723
|
-
},
|
|
1779
|
+
}, at = (s) => {
|
|
1724
1780
|
switch (s) {
|
|
1725
|
-
case
|
|
1781
|
+
case W.Thorax:
|
|
1726
1782
|
return "Thorax";
|
|
1727
|
-
case
|
|
1783
|
+
case W.CenterBack:
|
|
1728
1784
|
return "Center Back";
|
|
1729
|
-
case
|
|
1785
|
+
case W.Pelvis:
|
|
1730
1786
|
return "Pelvis";
|
|
1731
|
-
case
|
|
1787
|
+
case W.LeftThigh:
|
|
1732
1788
|
return "Left Thigh";
|
|
1733
|
-
case
|
|
1789
|
+
case W.RightThigh:
|
|
1734
1790
|
return "Right Thigh";
|
|
1735
|
-
case
|
|
1791
|
+
case W.LeftShank:
|
|
1736
1792
|
return "Left Shank";
|
|
1737
|
-
case
|
|
1793
|
+
case W.RightShank:
|
|
1738
1794
|
return "Right Shank";
|
|
1739
|
-
case
|
|
1795
|
+
case W.LeftFoot:
|
|
1740
1796
|
return "Left Foot";
|
|
1741
|
-
case
|
|
1797
|
+
case W.RightFoot:
|
|
1742
1798
|
return "Right Foot";
|
|
1743
|
-
case
|
|
1799
|
+
case W.LeftUpperArm:
|
|
1744
1800
|
return "Left Upper Arm";
|
|
1745
|
-
case
|
|
1801
|
+
case W.RightUpperArm:
|
|
1746
1802
|
return "Right Upper Arm";
|
|
1747
|
-
case
|
|
1803
|
+
case W.LeftForearm:
|
|
1748
1804
|
return "Left Forearm";
|
|
1749
|
-
case
|
|
1805
|
+
case W.RightForearm:
|
|
1750
1806
|
return "Right Forearm";
|
|
1751
|
-
case
|
|
1807
|
+
case W.Head:
|
|
1752
1808
|
return "Head";
|
|
1753
1809
|
}
|
|
1754
1810
|
return console.warn(`Unknown sensor location: ${s}`), "Unknown";
|
|
1755
|
-
},
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
],
|
|
1767
|
-
label:
|
|
1811
|
+
}, xn = 6, jn = [
|
|
1812
|
+
W.LeftFoot,
|
|
1813
|
+
W.LeftShank,
|
|
1814
|
+
W.LeftThigh,
|
|
1815
|
+
W.Pelvis,
|
|
1816
|
+
W.RightFoot,
|
|
1817
|
+
W.RightShank,
|
|
1818
|
+
W.RightThigh,
|
|
1819
|
+
W.Thorax,
|
|
1820
|
+
W.CenterBack,
|
|
1821
|
+
W.Head
|
|
1822
|
+
], fn = jn.map((s) => ({
|
|
1823
|
+
label: at(s),
|
|
1768
1824
|
value: s
|
|
1769
|
-
})),
|
|
1825
|
+
})), Qe = (s, n) => s.map((i) => ({ label: n ? n(i) : i, value: i })), En = ({
|
|
1770
1826
|
id: s,
|
|
1771
1827
|
onError: n,
|
|
1772
|
-
onCancel:
|
|
1773
|
-
onSave:
|
|
1774
|
-
hideButtons:
|
|
1775
|
-
setButtonOnClick:
|
|
1828
|
+
onCancel: i,
|
|
1829
|
+
onSave: c,
|
|
1830
|
+
hideButtons: u,
|
|
1831
|
+
setButtonOnClick: l,
|
|
1776
1832
|
setButtonDisabled: d,
|
|
1777
|
-
quantumOwned:
|
|
1833
|
+
quantumOwned: v,
|
|
1834
|
+
isView: o
|
|
1778
1835
|
}) => {
|
|
1779
|
-
const [{ fetching:
|
|
1780
|
-
query:
|
|
1836
|
+
const [{ fetching: I }, j] = oe(De), [{ fetching: A }, h] = oe(Nt), [{ data: S }] = le({
|
|
1837
|
+
query: Lt,
|
|
1781
1838
|
variables: { id: s ?? "" },
|
|
1782
1839
|
pause: !s
|
|
1783
|
-
}),
|
|
1840
|
+
}), r = U(
|
|
1784
1841
|
ae,
|
|
1785
|
-
|
|
1786
|
-
),
|
|
1787
|
-
() =>
|
|
1788
|
-
[
|
|
1789
|
-
),
|
|
1790
|
-
query:
|
|
1791
|
-
}),
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
)?.map((
|
|
1795
|
-
label:
|
|
1796
|
-
value:
|
|
1797
|
-
})), [
|
|
1798
|
-
() =>
|
|
1842
|
+
S?.getActionById
|
|
1843
|
+
), a = I || A, p = !!r && !!s, [g, y] = P(""), [C, G] = P(""), [k, T] = P(""), [N, E] = P(""), [_, f] = P(), [M, L] = P([]), [X, b] = P([]), [z, Z] = P([]), t = F(
|
|
1844
|
+
() => X.map((O) => O.value),
|
|
1845
|
+
[X]
|
|
1846
|
+
), m = Yt(t), [{ data: w }] = le({
|
|
1847
|
+
query: rt
|
|
1848
|
+
}), D = F(() => U(
|
|
1849
|
+
me,
|
|
1850
|
+
w?.moduleCategories
|
|
1851
|
+
)?.map((H) => ({
|
|
1852
|
+
label: H.name,
|
|
1853
|
+
value: H.id
|
|
1854
|
+
})), [w?.moduleCategories]), $ = F(
|
|
1855
|
+
() => Qe(Object.values(Pt), Pe),
|
|
1799
1856
|
[]
|
|
1800
|
-
), [
|
|
1857
|
+
), [Q, K] = P([]), B = g.length > 0, [ce, Ie] = P({});
|
|
1801
1858
|
ne(() => {
|
|
1802
|
-
if (
|
|
1803
|
-
const O =
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
),
|
|
1807
|
-
name:
|
|
1808
|
-
activityType:
|
|
1809
|
-
description:
|
|
1810
|
-
cameraPlacement:
|
|
1811
|
-
videoLink:
|
|
1812
|
-
sessionType:
|
|
1813
|
-
label:
|
|
1859
|
+
if (r) {
|
|
1860
|
+
const O = U(
|
|
1861
|
+
me,
|
|
1862
|
+
r.categories
|
|
1863
|
+
), H = {
|
|
1864
|
+
name: r.name,
|
|
1865
|
+
activityType: r.activityType ?? void 0,
|
|
1866
|
+
description: r.description || "",
|
|
1867
|
+
cameraPlacement: r.cameraPlacement || "",
|
|
1868
|
+
videoLink: r.videoLink || "",
|
|
1869
|
+
sessionType: r.sessionType.map((V) => ({
|
|
1870
|
+
label: Pe(V),
|
|
1814
1871
|
value: V
|
|
1815
1872
|
})),
|
|
1816
1873
|
categories: O?.map((V) => V.id) || [],
|
|
1817
|
-
sensorLocations:
|
|
1818
|
-
label:
|
|
1874
|
+
sensorLocations: r.sensorLocations.map((V) => ({
|
|
1875
|
+
label: at(V),
|
|
1819
1876
|
value: V
|
|
1820
1877
|
})),
|
|
1821
|
-
thresholds:
|
|
1878
|
+
thresholds: qt(r.thresholds)
|
|
1822
1879
|
};
|
|
1823
|
-
|
|
1880
|
+
y(H.name), f(H.activityType ?? void 0), G(H.description), T(H.cameraPlacement), E(H.videoLink), L(H.sessionType), Z(O?.map((V) => V.id) || []), b(H.sensorLocations), K(H.thresholds), Ie(H);
|
|
1824
1881
|
}
|
|
1825
|
-
}, [
|
|
1826
|
-
const
|
|
1827
|
-
() => JSON.stringify(
|
|
1828
|
-
name:
|
|
1829
|
-
description:
|
|
1830
|
-
cameraPlacement:
|
|
1831
|
-
videoLink:
|
|
1832
|
-
activityType:
|
|
1833
|
-
sessionType:
|
|
1834
|
-
categories:
|
|
1835
|
-
sensorLocations:
|
|
1836
|
-
thresholds:
|
|
1882
|
+
}, [r]);
|
|
1883
|
+
const pe = F(
|
|
1884
|
+
() => JSON.stringify(ce) !== JSON.stringify({
|
|
1885
|
+
name: g,
|
|
1886
|
+
description: C,
|
|
1887
|
+
cameraPlacement: k,
|
|
1888
|
+
videoLink: N,
|
|
1889
|
+
activityType: _,
|
|
1890
|
+
sessionType: M.map((O) => O.value),
|
|
1891
|
+
categories: z,
|
|
1892
|
+
sensorLocations: t,
|
|
1893
|
+
thresholds: We(Q)
|
|
1837
1894
|
}),
|
|
1838
1895
|
[
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1896
|
+
ce,
|
|
1897
|
+
g,
|
|
1898
|
+
t,
|
|
1899
|
+
C,
|
|
1900
|
+
k,
|
|
1901
|
+
N,
|
|
1902
|
+
_,
|
|
1845
1903
|
M,
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
I
|
|
1904
|
+
z,
|
|
1905
|
+
Q
|
|
1849
1906
|
]
|
|
1850
|
-
),
|
|
1907
|
+
), de = R(() => {
|
|
1851
1908
|
const O = {
|
|
1852
|
-
name:
|
|
1853
|
-
description:
|
|
1854
|
-
cameraPlacement:
|
|
1855
|
-
videoLink:
|
|
1856
|
-
activityType:
|
|
1857
|
-
activityKind:
|
|
1858
|
-
sessionType:
|
|
1859
|
-
categories:
|
|
1860
|
-
sensorLocations:
|
|
1861
|
-
thresholds:
|
|
1909
|
+
name: g,
|
|
1910
|
+
description: C,
|
|
1911
|
+
cameraPlacement: k,
|
|
1912
|
+
videoLink: N,
|
|
1913
|
+
activityType: _,
|
|
1914
|
+
activityKind: Bt(_),
|
|
1915
|
+
sessionType: M.map((V) => V.value),
|
|
1916
|
+
categories: z,
|
|
1917
|
+
sensorLocations: t,
|
|
1918
|
+
thresholds: We(Q),
|
|
1862
1919
|
// Backend requires laterality; keep existing default since UI no longer edits it
|
|
1863
|
-
laterality:
|
|
1864
|
-
quantumOwned:
|
|
1920
|
+
laterality: _t.Either,
|
|
1921
|
+
quantumOwned: v
|
|
1865
1922
|
};
|
|
1866
|
-
let
|
|
1867
|
-
|
|
1923
|
+
let H;
|
|
1924
|
+
p && s ? H = h({
|
|
1868
1925
|
id: s,
|
|
1869
1926
|
fields: O
|
|
1870
|
-
}) :
|
|
1927
|
+
}) : H = j({
|
|
1871
1928
|
fields: O
|
|
1872
|
-
}),
|
|
1873
|
-
V ? n(V) :
|
|
1929
|
+
}), H.then(({ error: V }) => {
|
|
1930
|
+
V ? n(V) : c();
|
|
1874
1931
|
});
|
|
1875
1932
|
}, [
|
|
1933
|
+
v,
|
|
1876
1934
|
j,
|
|
1877
|
-
S,
|
|
1878
1935
|
h,
|
|
1879
1936
|
s,
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1937
|
+
g,
|
|
1938
|
+
t,
|
|
1939
|
+
C,
|
|
1940
|
+
k,
|
|
1941
|
+
N,
|
|
1942
|
+
_,
|
|
1885
1943
|
M,
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
a,
|
|
1944
|
+
z,
|
|
1945
|
+
p,
|
|
1946
|
+
Q,
|
|
1947
|
+
c,
|
|
1891
1948
|
n
|
|
1892
1949
|
]);
|
|
1893
1950
|
return ne(() => {
|
|
1894
1951
|
d && d({
|
|
1895
|
-
cancelButton:
|
|
1896
|
-
saveButton:
|
|
1952
|
+
cancelButton: a,
|
|
1953
|
+
saveButton: o ? !0 : a || !B || !pe
|
|
1897
1954
|
});
|
|
1898
|
-
}, [
|
|
1899
|
-
|
|
1900
|
-
cancelButton:
|
|
1901
|
-
saveButton:
|
|
1955
|
+
}, [a, d, B, pe, o]), ne(() => {
|
|
1956
|
+
l && l({
|
|
1957
|
+
cancelButton: i,
|
|
1958
|
+
saveButton: o ? () => {
|
|
1959
|
+
} : de
|
|
1902
1960
|
});
|
|
1903
|
-
}, [
|
|
1961
|
+
}, [l, i, de, o]), console.log(B, pe, a, ce), /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-2 gap-4 w-full", children: [
|
|
1904
1962
|
/* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
|
|
1905
|
-
/* @__PURE__ */ e.jsxs(
|
|
1963
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1906
1964
|
/* @__PURE__ */ e.jsx(ie, { children: "Name" }),
|
|
1907
1965
|
/* @__PURE__ */ e.jsx(
|
|
1908
1966
|
je,
|
|
1909
1967
|
{
|
|
1910
|
-
value:
|
|
1911
|
-
onChange: (O) =>
|
|
1968
|
+
value: g,
|
|
1969
|
+
onChange: (O) => y(O.target.value),
|
|
1912
1970
|
type: "text",
|
|
1913
|
-
placeholder: "i.e. Lunge & Return"
|
|
1971
|
+
placeholder: "i.e. Lunge & Return",
|
|
1972
|
+
isDisabled: o
|
|
1914
1973
|
}
|
|
1915
1974
|
)
|
|
1916
1975
|
] }),
|
|
1917
|
-
/* @__PURE__ */ e.jsxs(
|
|
1976
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1918
1977
|
/* @__PURE__ */ e.jsx(ie, { children: "Activity Type" }),
|
|
1919
1978
|
/* @__PURE__ */ e.jsx(
|
|
1920
1979
|
se,
|
|
1921
1980
|
{
|
|
1922
1981
|
isClearable: !0,
|
|
1923
1982
|
isMulti: !1,
|
|
1924
|
-
value:
|
|
1925
|
-
label:
|
|
1926
|
-
value:
|
|
1983
|
+
value: _ ? {
|
|
1984
|
+
label: _e(_),
|
|
1985
|
+
value: _
|
|
1927
1986
|
} : null,
|
|
1928
|
-
onChange: (O) =>
|
|
1929
|
-
options:
|
|
1930
|
-
Object.values(
|
|
1931
|
-
|
|
1987
|
+
onChange: (O) => f(O?.value),
|
|
1988
|
+
options: Qe(
|
|
1989
|
+
Object.values(Gt),
|
|
1990
|
+
_e
|
|
1932
1991
|
),
|
|
1933
|
-
placeholder: "(optional) Select activity type"
|
|
1992
|
+
placeholder: "(optional) Select activity type",
|
|
1993
|
+
isDisabled: o
|
|
1934
1994
|
}
|
|
1935
1995
|
)
|
|
1936
1996
|
] }),
|
|
1937
|
-
/* @__PURE__ */ e.jsxs(
|
|
1997
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1938
1998
|
/* @__PURE__ */ e.jsx(ie, { children: "Camera Placement" }),
|
|
1939
1999
|
/* @__PURE__ */ e.jsx(
|
|
1940
|
-
|
|
2000
|
+
$e,
|
|
1941
2001
|
{
|
|
1942
|
-
value:
|
|
1943
|
-
onChange: (O) =>
|
|
2002
|
+
value: k,
|
|
2003
|
+
onChange: (O) => T(O.target.value),
|
|
1944
2004
|
rows: 2,
|
|
1945
|
-
placeholder: "(optional) Describe camera setup, placement, angles"
|
|
2005
|
+
placeholder: "(optional) Describe camera setup, placement, angles",
|
|
2006
|
+
isDisabled: o
|
|
1946
2007
|
}
|
|
1947
2008
|
)
|
|
1948
2009
|
] }),
|
|
1949
|
-
/* @__PURE__ */ e.jsxs(
|
|
2010
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1950
2011
|
/* @__PURE__ */ e.jsx(ie, { children: "Video Link" }),
|
|
1951
2012
|
/* @__PURE__ */ e.jsx(
|
|
1952
2013
|
je,
|
|
1953
2014
|
{
|
|
1954
|
-
value:
|
|
2015
|
+
value: N,
|
|
1955
2016
|
onChange: (O) => E(O.target.value),
|
|
1956
2017
|
type: "url",
|
|
1957
|
-
placeholder: "(optional) https://..."
|
|
2018
|
+
placeholder: "(optional) https://...",
|
|
2019
|
+
isDisabled: o
|
|
1958
2020
|
}
|
|
1959
2021
|
)
|
|
1960
2022
|
] }),
|
|
1961
|
-
/* @__PURE__ */ e.jsxs(
|
|
2023
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1962
2024
|
/* @__PURE__ */ e.jsx(ie, { children: "Description" }),
|
|
1963
2025
|
/* @__PURE__ */ e.jsx(
|
|
1964
|
-
|
|
2026
|
+
$e,
|
|
1965
2027
|
{
|
|
1966
|
-
value:
|
|
1967
|
-
onChange: (O) =>
|
|
2028
|
+
value: C,
|
|
2029
|
+
onChange: (O) => G(O.target.value),
|
|
1968
2030
|
rows: 2,
|
|
1969
|
-
placeholder: "(optional) Describe how to perform the test or exercise"
|
|
2031
|
+
placeholder: "(optional) Describe how to perform the test or exercise",
|
|
2032
|
+
isDisabled: o
|
|
1970
2033
|
}
|
|
1971
2034
|
)
|
|
1972
2035
|
] }),
|
|
1973
|
-
/* @__PURE__ */ e.jsxs(
|
|
2036
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1974
2037
|
/* @__PURE__ */ e.jsx(ie, { children: "Link to Category" }),
|
|
1975
2038
|
/* @__PURE__ */ e.jsx(
|
|
1976
2039
|
se,
|
|
1977
2040
|
{
|
|
1978
2041
|
isMulti: !0,
|
|
1979
|
-
value:
|
|
1980
|
-
(O) =>
|
|
2042
|
+
value: D?.filter(
|
|
2043
|
+
(O) => z.includes(O.value)
|
|
1981
2044
|
),
|
|
1982
|
-
onChange: (O) =>
|
|
2045
|
+
onChange: (O) => Z(
|
|
1983
2046
|
(O ?? []).map(
|
|
1984
|
-
(
|
|
2047
|
+
(H) => H.value
|
|
1985
2048
|
)
|
|
1986
2049
|
),
|
|
1987
|
-
options:
|
|
1988
|
-
placeholder: "Select one or more categories"
|
|
2050
|
+
options: D,
|
|
2051
|
+
placeholder: "Select one or more categories",
|
|
2052
|
+
isDisabled: o
|
|
1989
2053
|
}
|
|
1990
2054
|
)
|
|
1991
2055
|
] }),
|
|
1992
|
-
/* @__PURE__ */ e.jsxs(
|
|
2056
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
1993
2057
|
/* @__PURE__ */ e.jsx(ie, { children: "Session Types" }),
|
|
1994
2058
|
/* @__PURE__ */ e.jsx(
|
|
1995
2059
|
se,
|
|
1996
2060
|
{
|
|
1997
2061
|
isMulti: !0,
|
|
1998
|
-
value:
|
|
1999
|
-
onChange: (O) =>
|
|
2062
|
+
value: M,
|
|
2063
|
+
onChange: (O) => L(
|
|
2000
2064
|
O ?? []
|
|
2001
2065
|
),
|
|
2002
|
-
options:
|
|
2003
|
-
placeholder: "Select one or more session types"
|
|
2066
|
+
options: $,
|
|
2067
|
+
placeholder: "Select one or more session types",
|
|
2068
|
+
isDisabled: o
|
|
2004
2069
|
}
|
|
2005
2070
|
)
|
|
2006
2071
|
] })
|
|
2007
2072
|
] }),
|
|
2008
2073
|
/* @__PURE__ */ e.jsxs("div", { className: "col-span-2 lg:col-span-1 flex flex-col gap-4", children: [
|
|
2009
|
-
/* @__PURE__ */ e.jsxs(
|
|
2074
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
2010
2075
|
/* @__PURE__ */ e.jsx(ie, { children: "Sensor Locations" }),
|
|
2011
2076
|
/* @__PURE__ */ e.jsx(
|
|
2012
2077
|
se,
|
|
2013
2078
|
{
|
|
2014
2079
|
isMulti: !0,
|
|
2015
|
-
value:
|
|
2016
|
-
onChange: (O) =>
|
|
2017
|
-
options:
|
|
2018
|
-
isOptionDisabled: () =>
|
|
2080
|
+
value: X,
|
|
2081
|
+
onChange: (O) => b([...O]),
|
|
2082
|
+
options: fn,
|
|
2083
|
+
isOptionDisabled: () => X.length >= xn,
|
|
2084
|
+
isDisabled: o
|
|
2019
2085
|
}
|
|
2020
2086
|
)
|
|
2021
2087
|
] }),
|
|
2022
|
-
/* @__PURE__ */ e.jsxs(
|
|
2088
|
+
/* @__PURE__ */ e.jsxs(q, { children: [
|
|
2023
2089
|
/* @__PURE__ */ e.jsx(ie, { children: "Default Parameters" }),
|
|
2024
2090
|
/* @__PURE__ */ e.jsx(
|
|
2025
|
-
|
|
2091
|
+
gn,
|
|
2026
2092
|
{
|
|
2027
|
-
options:
|
|
2028
|
-
value:
|
|
2029
|
-
onChange:
|
|
2093
|
+
options: m,
|
|
2094
|
+
value: Q,
|
|
2095
|
+
onChange: K,
|
|
2096
|
+
editOnly: o
|
|
2030
2097
|
}
|
|
2031
2098
|
)
|
|
2032
2099
|
] })
|
|
@@ -2034,16 +2101,19 @@ const Ht = ({
|
|
|
2034
2101
|
/* @__PURE__ */ e.jsx(
|
|
2035
2102
|
"div",
|
|
2036
2103
|
{
|
|
2037
|
-
className:
|
|
2038
|
-
|
|
2039
|
-
|
|
2104
|
+
className: Ht(
|
|
2105
|
+
"col-span-2 flex justify-end",
|
|
2106
|
+
(u || o) && "hidden"
|
|
2107
|
+
),
|
|
2108
|
+
children: /* @__PURE__ */ e.jsxs(xe, { mt: 16, gap: 4, children: [
|
|
2109
|
+
/* @__PURE__ */ e.jsx(J, { colorScheme: "gray", isDisabled: a, onClick: i, children: "Cancel" }),
|
|
2040
2110
|
/* @__PURE__ */ e.jsx(
|
|
2041
|
-
|
|
2111
|
+
J,
|
|
2042
2112
|
{
|
|
2043
2113
|
colorScheme: "blue",
|
|
2044
|
-
isDisabled:
|
|
2045
|
-
isLoading:
|
|
2046
|
-
onClick:
|
|
2114
|
+
isDisabled: a || !B || !pe,
|
|
2115
|
+
isLoading: a,
|
|
2116
|
+
onClick: de,
|
|
2047
2117
|
children: "Save changes"
|
|
2048
2118
|
}
|
|
2049
2119
|
)
|
|
@@ -2051,111 +2121,111 @@ const Ht = ({
|
|
|
2051
2121
|
}
|
|
2052
2122
|
)
|
|
2053
2123
|
] });
|
|
2054
|
-
}, ie = ({ children: s }) => /* @__PURE__ */ e.jsx(
|
|
2124
|
+
}, ie = ({ children: s }) => /* @__PURE__ */ e.jsx(Be, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), zn = ({
|
|
2055
2125
|
id: s,
|
|
2056
2126
|
onCancel: n,
|
|
2057
|
-
onSave:
|
|
2058
|
-
onError:
|
|
2059
|
-
hideButtons:
|
|
2060
|
-
quantumOwned:
|
|
2127
|
+
onSave: i,
|
|
2128
|
+
onError: c,
|
|
2129
|
+
hideButtons: u,
|
|
2130
|
+
quantumOwned: l,
|
|
2061
2131
|
setButtonOnClick: d,
|
|
2062
|
-
setButtonDisabled:
|
|
2132
|
+
setButtonDisabled: v
|
|
2063
2133
|
}) => {
|
|
2064
|
-
const [{ data:
|
|
2065
|
-
query:
|
|
2066
|
-
}), [{ data:
|
|
2067
|
-
query:
|
|
2134
|
+
const [{ data: o }] = le({
|
|
2135
|
+
query: l ? Dt : Ft
|
|
2136
|
+
}), [{ data: I }] = le({
|
|
2137
|
+
query: kt,
|
|
2068
2138
|
variables: { id: s },
|
|
2069
2139
|
pause: !s
|
|
2070
|
-
}), [{ data:
|
|
2071
|
-
query:
|
|
2072
|
-
}),
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
), [{ fetching:
|
|
2140
|
+
}), [{ data: j }] = le({
|
|
2141
|
+
query: rt
|
|
2142
|
+
}), A = U(
|
|
2143
|
+
me,
|
|
2144
|
+
j?.moduleCategories
|
|
2145
|
+
), [{ fetching: h }, S] = oe(st), [{ fetching: r }, a] = oe(ot), p = U(
|
|
2076
2146
|
ae,
|
|
2077
|
-
|
|
2078
|
-
) ?? [], g =
|
|
2079
|
-
...y.map((
|
|
2080
|
-
]), [
|
|
2147
|
+
l ? o?.quantumOwnedActions : o?.actions
|
|
2148
|
+
) ?? [], g = U(Ce, I?.module), y = U(nt, g?.moduleActions) ?? [], [C, G] = P([
|
|
2149
|
+
...y.map((L) => L.actionId) ?? []
|
|
2150
|
+
]), [k, T] = P(g?.name ?? ""), [N, E] = P([]), [_, f] = P(g?.description ?? "");
|
|
2081
2151
|
ne(() => {
|
|
2082
|
-
g && (
|
|
2152
|
+
g && (G(y.map((L) => L.actionId)), T(g.name), f(g.description ?? ""), E(
|
|
2083
2153
|
g.categories.map(
|
|
2084
|
-
(
|
|
2154
|
+
(L) => U(me, L).id
|
|
2085
2155
|
) ?? []
|
|
2086
2156
|
));
|
|
2087
2157
|
}, [g, y]);
|
|
2088
|
-
const
|
|
2089
|
-
let
|
|
2090
|
-
const
|
|
2091
|
-
actions:
|
|
2092
|
-
name:
|
|
2093
|
-
categories:
|
|
2094
|
-
description:
|
|
2095
|
-
quantumOwned:
|
|
2158
|
+
const M = R(() => {
|
|
2159
|
+
let L;
|
|
2160
|
+
const X = {
|
|
2161
|
+
actions: C,
|
|
2162
|
+
name: k,
|
|
2163
|
+
categories: N.filter((b) => b !== "other"),
|
|
2164
|
+
description: _,
|
|
2165
|
+
quantumOwned: l
|
|
2096
2166
|
};
|
|
2097
|
-
g ?
|
|
2167
|
+
g ? L = S({
|
|
2098
2168
|
id: g.id,
|
|
2099
|
-
input:
|
|
2100
|
-
}) :
|
|
2101
|
-
input:
|
|
2102
|
-
}),
|
|
2103
|
-
b ?
|
|
2169
|
+
input: X
|
|
2170
|
+
}) : L = a({
|
|
2171
|
+
input: X
|
|
2172
|
+
}), L.then(({ error: b }) => {
|
|
2173
|
+
b ? c(b) : i();
|
|
2104
2174
|
});
|
|
2105
2175
|
}, [
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
T,
|
|
2176
|
+
a,
|
|
2177
|
+
S,
|
|
2109
2178
|
C,
|
|
2110
|
-
|
|
2111
|
-
|
|
2179
|
+
k,
|
|
2180
|
+
_,
|
|
2181
|
+
N,
|
|
2112
2182
|
g,
|
|
2113
|
-
|
|
2114
|
-
|
|
2183
|
+
i,
|
|
2184
|
+
c
|
|
2115
2185
|
]);
|
|
2116
2186
|
return ne(() => {
|
|
2117
|
-
|
|
2118
|
-
cancelButton:
|
|
2119
|
-
saveButton:
|
|
2187
|
+
v && v({
|
|
2188
|
+
cancelButton: h || r,
|
|
2189
|
+
saveButton: h || r || !k || _.trim().split(/\s+/).filter(Boolean).length > 40
|
|
2120
2190
|
});
|
|
2121
|
-
}, [
|
|
2191
|
+
}, [v, h, r, C, k, _]), ne(() => {
|
|
2122
2192
|
d && d({
|
|
2123
2193
|
cancelButton: n,
|
|
2124
|
-
saveButton:
|
|
2194
|
+
saveButton: M
|
|
2125
2195
|
});
|
|
2126
|
-
}, [d, n,
|
|
2196
|
+
}, [d, n, M]), /* @__PURE__ */ e.jsxs(Y, { width: "100%", children: [
|
|
2127
2197
|
/* @__PURE__ */ e.jsx(
|
|
2128
|
-
|
|
2198
|
+
an,
|
|
2129
2199
|
{
|
|
2130
|
-
name:
|
|
2131
|
-
setName:
|
|
2200
|
+
name: k,
|
|
2201
|
+
setName: T,
|
|
2132
2202
|
actions: p,
|
|
2133
|
-
selectedActionIds:
|
|
2134
|
-
setSelectedActionIds:
|
|
2135
|
-
availableCategories:
|
|
2136
|
-
selectedCategoryIds:
|
|
2137
|
-
setSelectedCategoryIds:
|
|
2138
|
-
description:
|
|
2139
|
-
setDescription:
|
|
2203
|
+
selectedActionIds: C,
|
|
2204
|
+
setSelectedActionIds: G,
|
|
2205
|
+
availableCategories: A ?? [],
|
|
2206
|
+
selectedCategoryIds: N,
|
|
2207
|
+
setSelectedCategoryIds: E,
|
|
2208
|
+
description: _,
|
|
2209
|
+
setDescription: f
|
|
2140
2210
|
}
|
|
2141
2211
|
),
|
|
2142
|
-
!
|
|
2212
|
+
!u && /* @__PURE__ */ e.jsx(te, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(xe, { mt: 16, gap: 4, children: [
|
|
2143
2213
|
/* @__PURE__ */ e.jsx(
|
|
2144
|
-
|
|
2214
|
+
J,
|
|
2145
2215
|
{
|
|
2146
2216
|
colorScheme: "gray",
|
|
2147
|
-
isDisabled:
|
|
2217
|
+
isDisabled: h || r,
|
|
2148
2218
|
onClick: n,
|
|
2149
2219
|
children: "Cancel"
|
|
2150
2220
|
}
|
|
2151
2221
|
),
|
|
2152
2222
|
/* @__PURE__ */ e.jsx(
|
|
2153
|
-
|
|
2223
|
+
J,
|
|
2154
2224
|
{
|
|
2155
2225
|
colorScheme: "blue",
|
|
2156
|
-
isDisabled:
|
|
2157
|
-
isLoading:
|
|
2158
|
-
onClick:
|
|
2226
|
+
isDisabled: h || r || !k || _.trim().split(/\s+/).filter(Boolean).length > 40,
|
|
2227
|
+
isLoading: h || r,
|
|
2228
|
+
onClick: M,
|
|
2159
2229
|
children: "Save"
|
|
2160
2230
|
}
|
|
2161
2231
|
)
|
|
@@ -2163,12 +2233,12 @@ const Ht = ({
|
|
|
2163
2233
|
] });
|
|
2164
2234
|
};
|
|
2165
2235
|
export {
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2236
|
+
ln as ActivityList,
|
|
2237
|
+
kn as CopyActivityForm,
|
|
2238
|
+
Rn as CopyModuleForm,
|
|
2239
|
+
an as ModuleForm,
|
|
2240
|
+
mn as ParameterEditList,
|
|
2241
|
+
gn as ParameterEditSelect,
|
|
2242
|
+
En as UpsertActivityForm,
|
|
2243
|
+
zn as UpsertModuleForm
|
|
2174
2244
|
};
|