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