quantum-component-library 1.4.66 → 1.4.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/activity-list/index.d.ts +10 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1615 -1561
- package/dist/generated/gql.d.ts +2 -2
- package/dist/generated/graphql.d.ts +29 -3
- package/dist/generated-graphql.cjs +1 -1
- package/dist/generated-graphql.js +66 -65
- package/dist/generated.cjs +1 -1
- package/dist/generated.js +5 -5
- package/dist/{graphql-kPu5QxaL.cjs → graphql-BEhru2G1.cjs} +1 -0
- package/dist/{graphql-DAkuEEbq.js → graphql-DFQnN0la.js} +5 -4
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/providers.cjs +1 -1
- package/dist/providers.js +1 -1
- package/dist/{react-icons-vendor-CMsTQrA0.js → react-icons-vendor-DqOJrTLA.js} +47 -39
- package/dist/react-icons-vendor-c4NUuwCE.cjs +1 -0
- package/package.json +1 -1
- package/dist/react-icons-vendor-BF_sZq07.cjs +0 -1
package/dist/components.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
2
|
import "./moment-vendor-DMLRxgRE.js";
|
|
3
|
-
import { Flex as
|
|
4
|
-
import { useMemo as
|
|
5
|
-
import { getFragmentData as
|
|
6
|
-
import { G as
|
|
7
|
-
import { c as
|
|
3
|
+
import { Flex as Me, InputGroup as ct, InputLeftElement as Pt, Icon as Ct, Input as ye, FormLabel as _e, ButtonGroup as Ne, Tooltip as rt, Button as te, Box as se, RangeSlider as _t, RangeSliderMark as st, Text as M, RangeSliderTrack as Et, RangeSliderFilledTrack as zt, RangeSliderThumb as dt, Select as ut, NumberInput as mt, NumberInputField as ht, HStack as V, Tag as Ge, FormControl as X, TableContainer as Bt, Table as Ut, Thead as Wt, Tr as pt, Th as De, Tbody as Qt, Td as We, IconButton as ot, Image as qt, useToast as wt, VStack as ue, RadioGroup as It, Radio as Ze, Alert as Ve, AlertIcon as et, Spinner as St, useDisclosure as Kt, Modal as Ht, ModalOverlay as Yt, ModalContent as Jt, ModalHeader as Xt, ModalCloseButton as Zt, ModalBody as Vt, ModalFooter as en, Badge as Oe, Tabs as tn, TabList as nn, Tab as gt, TabPanels as sn, TabPanel as xt, Textarea as Qe, Switch as on } from "@chakra-ui/react";
|
|
4
|
+
import { useMemo as $, useState as q, useEffect as ce, useCallback as _, createContext as rn, useContext as an, memo as Ae, useRef as ln } from "react";
|
|
5
|
+
import { getFragmentData as A } from "./generated.js";
|
|
6
|
+
import { G as at, M as je, a as be, b as Lt, c as cn, C as it, d as kt, e as Mt, R as Fe, f as Pe, T as Te, A as ve, g as dn, h as At, U as Ot, i as Ye, j as Tt, k as un, l as mn, m as hn, n as pn, o as gn, p as xn } from "./graphql-DFQnN0la.js";
|
|
7
|
+
import { c as Je } from "./utils-cn-CgdSr4hO.js";
|
|
8
8
|
import "./lodash-vendor-CY4G3-79.js";
|
|
9
|
-
import { useClient as
|
|
9
|
+
import { useClient as lt, useQuery as Ce, useMutation as fe } from "urql";
|
|
10
10
|
import { useUiLabelContext as xe, useAllPartParameters as fn } from "./hooks.js";
|
|
11
11
|
import { u as jn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
|
|
12
12
|
import { s as he } from "./react-select-vendor-B0QF8gkj.js";
|
|
13
|
-
import { F as bn, a as yn, b as vn, c as Cn } from "./react-icons-vendor-
|
|
14
|
-
import { reportKindName as
|
|
15
|
-
import { D as
|
|
16
|
-
import { g as
|
|
17
|
-
import { ThresholdKind as
|
|
18
|
-
import { availablePlanes as
|
|
19
|
-
const
|
|
20
|
-
setSearch:
|
|
21
|
-
actions:
|
|
22
|
-
updateUseCases:
|
|
13
|
+
import { F as bn, a as yn, b as vn, c as Cn, d as wn, e as In } from "./react-icons-vendor-DqOJrTLA.js";
|
|
14
|
+
import { reportKindName as ke } from "./services.js";
|
|
15
|
+
import { D as Sn, H as Ln, u as kn, a as Mn } from "./react-dnd-vendor-DYesaYGm.js";
|
|
16
|
+
import { g as Nt, a as Rt, b as An, c as On, d as Tn, e as ft, f as jt } from "./services-human-D5IllQkM.js";
|
|
17
|
+
import { ThresholdKind as Xe, ReportKind as ie, ActionLaterality as Nn, SensorLocation as me } from "./generated-graphql.js";
|
|
18
|
+
import { availablePlanes as bt, getAnalysisPartIdNoSide as qe } from "./types.js";
|
|
19
|
+
const Rn = ({
|
|
20
|
+
setSearch: s,
|
|
21
|
+
actions: t,
|
|
22
|
+
updateUseCases: r,
|
|
23
23
|
hideUseCaseFilter: p = !1
|
|
24
24
|
}) => {
|
|
25
|
-
const m =
|
|
26
|
-
() =>
|
|
25
|
+
const m = $(
|
|
26
|
+
() => t?.flatMap((h) => h.useCases).filter((h, d, g) => g.findIndex((n) => n.id === h.id) === d).map((h) => ({
|
|
27
27
|
label: h.name,
|
|
28
28
|
value: h.id
|
|
29
29
|
})) || [],
|
|
30
|
-
[
|
|
30
|
+
[t]
|
|
31
31
|
);
|
|
32
|
-
return /* @__PURE__ */ e.jsxs(
|
|
33
|
-
/* @__PURE__ */ e.jsxs(
|
|
34
|
-
/* @__PURE__ */ e.jsx(
|
|
32
|
+
return /* @__PURE__ */ e.jsxs(Me, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
|
|
33
|
+
/* @__PURE__ */ e.jsxs(ct, { size: "md", flex: 1, children: [
|
|
34
|
+
/* @__PURE__ */ e.jsx(Pt, { children: /* @__PURE__ */ e.jsx(Ct, { as: bn, color: "gray.300" }) }),
|
|
35
35
|
/* @__PURE__ */ e.jsx(
|
|
36
|
-
|
|
36
|
+
ye,
|
|
37
37
|
{
|
|
38
38
|
placeholder: "Search by name...",
|
|
39
39
|
width: "100%",
|
|
40
40
|
maxW: p ? void 0 : "30rem",
|
|
41
|
-
onChange: (h) =>
|
|
41
|
+
onChange: (h) => s(h.target.value)
|
|
42
42
|
}
|
|
43
43
|
)
|
|
44
44
|
] }),
|
|
45
|
-
!p && /* @__PURE__ */ e.jsx(
|
|
45
|
+
!p && /* @__PURE__ */ e.jsx(ct, { size: "md", children: /* @__PURE__ */ e.jsx(
|
|
46
46
|
he,
|
|
47
47
|
{
|
|
48
48
|
size: "md",
|
|
@@ -56,23 +56,23 @@ const Tn = ({
|
|
|
56
56
|
placeholder: "Filter use case",
|
|
57
57
|
isMulti: !0,
|
|
58
58
|
options: m,
|
|
59
|
-
onChange: (h) =>
|
|
59
|
+
onChange: (h) => r(h.map((d) => d.value))
|
|
60
60
|
}
|
|
61
61
|
) })
|
|
62
62
|
] });
|
|
63
63
|
}, ge = ({
|
|
64
|
-
children:
|
|
65
|
-
}) => /* @__PURE__ */ e.jsx(
|
|
66
|
-
items:
|
|
67
|
-
onChange:
|
|
68
|
-
selectedItem:
|
|
64
|
+
children: s
|
|
65
|
+
}) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), $n = ({
|
|
66
|
+
items: s,
|
|
67
|
+
onChange: t,
|
|
68
|
+
selectedItem: r,
|
|
69
69
|
isDisabled: p,
|
|
70
70
|
selectedProps: m,
|
|
71
71
|
buttonProps: h
|
|
72
72
|
}) => {
|
|
73
|
-
const
|
|
74
|
-
return /* @__PURE__ */ e.jsx(
|
|
75
|
-
|
|
73
|
+
const d = (n) => n === r || n.value === r, g = (n) => d(n) ? { ...h, ...m } : h;
|
|
74
|
+
return /* @__PURE__ */ e.jsx(Ne, { isAttached: !0, isDisabled: p, children: s.map((n, o) => /* @__PURE__ */ e.jsx(
|
|
75
|
+
rt,
|
|
76
76
|
{
|
|
77
77
|
label: n.tooltip,
|
|
78
78
|
openDelay: 50,
|
|
@@ -81,114 +81,114 @@ const Tn = ({
|
|
|
81
81
|
visibility: n.tooltip ? "visible" : "hidden",
|
|
82
82
|
hasArrow: !0,
|
|
83
83
|
children: /* @__PURE__ */ e.jsx(
|
|
84
|
-
|
|
84
|
+
te,
|
|
85
85
|
{
|
|
86
|
-
onClick: () =>
|
|
86
|
+
onClick: () => d(n) ? null : t(n, o),
|
|
87
87
|
isDisabled: n.disabled,
|
|
88
|
-
...
|
|
88
|
+
...g(n),
|
|
89
89
|
children: n.label
|
|
90
90
|
}
|
|
91
91
|
)
|
|
92
92
|
},
|
|
93
|
-
|
|
93
|
+
o
|
|
94
94
|
)) });
|
|
95
|
-
},
|
|
96
|
-
isReversed:
|
|
97
|
-
min:
|
|
98
|
-
max:
|
|
95
|
+
}, Ke = (s, t) => t < 0 ? -1 * Math.abs(s) : Math.abs(s), Dn = ({
|
|
96
|
+
isReversed: s,
|
|
97
|
+
min: t,
|
|
98
|
+
max: r,
|
|
99
99
|
value: p,
|
|
100
100
|
onChange: m,
|
|
101
101
|
inputProps: h,
|
|
102
|
-
size:
|
|
103
|
-
zeroMarker:
|
|
102
|
+
size: d,
|
|
103
|
+
zeroMarker: g,
|
|
104
104
|
formatValue: n,
|
|
105
|
-
valueLabel:
|
|
106
|
-
positiveNegativeLabels:
|
|
105
|
+
valueLabel: o,
|
|
106
|
+
positiveNegativeLabels: u,
|
|
107
107
|
isDisabled: y,
|
|
108
|
-
...
|
|
108
|
+
...b
|
|
109
109
|
}) => {
|
|
110
|
-
const [
|
|
110
|
+
const [w, I] = q([void 0, void 0]), L = w[0], f = w[1], c = g && t < -5 && r > 5, k = Number(p?.[0] ?? f ?? t) > 0 ? 1 : -1, x = Number(p?.[1] ?? f ?? r) < 0 ? -1 : 1, N = u?.[0] === u?.[1], v = p?.[0], E = p?.[1];
|
|
111
111
|
ce(() => {
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
const
|
|
115
|
-
([
|
|
116
|
-
|
|
112
|
+
v !== void 0 && E !== void 0 && I([v.toFixed(0), E.toFixed(0)]);
|
|
113
|
+
}, [v, E, I]);
|
|
114
|
+
const R = _(
|
|
115
|
+
([T, B]) => {
|
|
116
|
+
T < B && I([T.toFixed(0), B.toFixed(0)]);
|
|
117
117
|
},
|
|
118
|
-
[
|
|
119
|
-
),
|
|
120
|
-
([
|
|
121
|
-
|
|
118
|
+
[I]
|
|
119
|
+
), O = _(
|
|
120
|
+
([T, B]) => {
|
|
121
|
+
T < B && m([T, B]);
|
|
122
122
|
},
|
|
123
123
|
[m]
|
|
124
|
-
),
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
return
|
|
124
|
+
), K = _(() => {
|
|
125
|
+
I(([T, B]) => {
|
|
126
|
+
const J = isNaN(Number(T)) ? t : Number(T), U = isNaN(Number(B)) ? r : Number(B), Y = Ke(Number(J), k), i = Ke(Number(U), x), a = k < 0 ? Math.max(Y, t) : Math.min(Y, r), C = x < 0 ? Math.max(i, t) : Math.min(i, r);
|
|
127
|
+
return a > C ? (m([C, a]), [C.toFixed(0), a.toFixed(0)]) : (m([a, C]), [a.toFixed(0), C.toFixed(0)]);
|
|
128
128
|
});
|
|
129
|
-
}, [m,
|
|
130
|
-
(
|
|
131
|
-
const
|
|
132
|
-
|
|
129
|
+
}, [m, I, k, x, t, r]), oe = _(
|
|
130
|
+
(T) => {
|
|
131
|
+
const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), k);
|
|
132
|
+
I(([J, U]) => [B.toString(), U]);
|
|
133
133
|
},
|
|
134
|
-
[
|
|
135
|
-
), D =
|
|
136
|
-
(
|
|
137
|
-
const
|
|
138
|
-
|
|
134
|
+
[I, k]
|
|
135
|
+
), D = _(
|
|
136
|
+
(T) => {
|
|
137
|
+
const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), x);
|
|
138
|
+
I(([J, U]) => [J, B.toString()]);
|
|
139
139
|
},
|
|
140
|
-
[
|
|
141
|
-
),
|
|
142
|
-
() =>
|
|
143
|
-
[
|
|
144
|
-
),
|
|
145
|
-
(
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
140
|
+
[I, x]
|
|
141
|
+
), ae = $(
|
|
142
|
+
() => d === "xs" ? "0.75rem" : void 0,
|
|
143
|
+
[d]
|
|
144
|
+
), Z = _(
|
|
145
|
+
(T, B) => {
|
|
146
|
+
const J = Number(B.target.value);
|
|
147
|
+
if (!L || !f || ![-1, 1].includes(J))
|
|
148
148
|
return;
|
|
149
|
-
const
|
|
150
|
-
|
|
149
|
+
const U = (a) => J < 0 ? -1 * Math.abs(a) : Math.abs(a), Y = T ? U(Number(L)) : Number(L), i = T ? Number(f) : U(Number(f));
|
|
150
|
+
Y > i ? m([i, Y]) : m([Y, i]);
|
|
151
151
|
},
|
|
152
|
-
[
|
|
152
|
+
[L, f, m]
|
|
153
153
|
);
|
|
154
|
-
return /* @__PURE__ */ e.jsxs(
|
|
155
|
-
/* @__PURE__ */ e.jsx(
|
|
156
|
-
|
|
154
|
+
return /* @__PURE__ */ e.jsxs(Me, { direction: "column", ...b, children: [
|
|
155
|
+
/* @__PURE__ */ e.jsx(se, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
|
|
156
|
+
_t,
|
|
157
157
|
{
|
|
158
158
|
"aria-label": ["min", "max"],
|
|
159
|
-
isReversed:
|
|
160
|
-
value: [Number(
|
|
161
|
-
max:
|
|
162
|
-
min:
|
|
159
|
+
isReversed: s,
|
|
160
|
+
value: [Number(L ?? t), Number(f ?? r)],
|
|
161
|
+
max: r,
|
|
162
|
+
min: t,
|
|
163
163
|
minStepsBetweenThumbs: 3,
|
|
164
164
|
step: 1,
|
|
165
|
-
onChange:
|
|
166
|
-
onChangeEnd:
|
|
165
|
+
onChange: R,
|
|
166
|
+
onChangeEnd: O,
|
|
167
167
|
isDisabled: y,
|
|
168
168
|
children: [
|
|
169
|
-
/* @__PURE__ */ e.jsx(
|
|
170
|
-
|
|
169
|
+
/* @__PURE__ */ e.jsx(st, { value: t, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
170
|
+
M,
|
|
171
171
|
{
|
|
172
|
-
fontSize:
|
|
172
|
+
fontSize: d ?? "sm",
|
|
173
173
|
fontWeight: "semibold",
|
|
174
174
|
whiteSpace: "nowrap",
|
|
175
|
-
children: n ? n?.(
|
|
175
|
+
children: n ? n?.(t) : t
|
|
176
176
|
}
|
|
177
177
|
) }),
|
|
178
|
-
/* @__PURE__ */ e.jsx(
|
|
179
|
-
|
|
178
|
+
/* @__PURE__ */ e.jsx(st, { value: r, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
179
|
+
M,
|
|
180
180
|
{
|
|
181
|
-
fontSize:
|
|
181
|
+
fontSize: d ?? "sm",
|
|
182
182
|
fontWeight: "semibold",
|
|
183
183
|
style: { transform: "translateX(-100%)" },
|
|
184
184
|
whiteSpace: "nowrap",
|
|
185
|
-
children: n ? n(
|
|
185
|
+
children: n ? n(r) : r
|
|
186
186
|
}
|
|
187
187
|
) }),
|
|
188
|
-
|
|
189
|
-
/* @__PURE__ */ e.jsx(
|
|
188
|
+
c && /* @__PURE__ */ e.jsxs(st, { value: 0, top: "-1em", pos: "relative", children: [
|
|
189
|
+
/* @__PURE__ */ e.jsx(M, { fontSize: d, fontWeight: "semibold", children: n?.(0) ?? "0" }),
|
|
190
190
|
/* @__PURE__ */ e.jsx(
|
|
191
|
-
|
|
191
|
+
se,
|
|
192
192
|
{
|
|
193
193
|
position: "absolute",
|
|
194
194
|
width: "2px",
|
|
@@ -199,79 +199,79 @@ const Tn = ({
|
|
|
199
199
|
}
|
|
200
200
|
)
|
|
201
201
|
] }),
|
|
202
|
-
/* @__PURE__ */ e.jsx(
|
|
203
|
-
/* @__PURE__ */ e.jsx(
|
|
204
|
-
/* @__PURE__ */ e.jsx(
|
|
202
|
+
/* @__PURE__ */ e.jsx(Et, { children: /* @__PURE__ */ e.jsx(zt, {}) }),
|
|
203
|
+
/* @__PURE__ */ e.jsx(dt, { index: 0, w: ae, h: ae }),
|
|
204
|
+
/* @__PURE__ */ e.jsx(dt, { index: 1, w: ae, h: ae })
|
|
205
205
|
]
|
|
206
206
|
}
|
|
207
207
|
) }),
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
o && /* @__PURE__ */ e.jsxs(
|
|
209
|
+
Me,
|
|
210
210
|
{
|
|
211
|
-
direction:
|
|
211
|
+
direction: s ? "row-reverse" : "row",
|
|
212
212
|
justifyContent: "space-between",
|
|
213
213
|
children: [
|
|
214
214
|
/* @__PURE__ */ e.jsx(
|
|
215
|
-
|
|
215
|
+
M,
|
|
216
216
|
{
|
|
217
|
-
fontSize:
|
|
217
|
+
fontSize: d ?? "sm",
|
|
218
218
|
fontWeight: "semibold",
|
|
219
219
|
whiteSpace: "nowrap",
|
|
220
|
-
children:
|
|
220
|
+
children: o(t)
|
|
221
221
|
}
|
|
222
222
|
),
|
|
223
223
|
/* @__PURE__ */ e.jsx(
|
|
224
|
-
|
|
224
|
+
M,
|
|
225
225
|
{
|
|
226
|
-
fontSize:
|
|
226
|
+
fontSize: d ?? "sm",
|
|
227
227
|
fontWeight: "semibold",
|
|
228
228
|
whiteSpace: "nowrap",
|
|
229
|
-
children: r
|
|
229
|
+
children: o(r)
|
|
230
230
|
}
|
|
231
231
|
)
|
|
232
232
|
]
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
235
|
/* @__PURE__ */ e.jsxs(
|
|
236
|
-
|
|
236
|
+
Me,
|
|
237
237
|
{
|
|
238
|
-
direction:
|
|
238
|
+
direction: s ? "row-reverse" : "row",
|
|
239
239
|
justifyContent: "center",
|
|
240
240
|
alignItems: "center",
|
|
241
241
|
gap: "0.125em",
|
|
242
242
|
children: [
|
|
243
|
-
|
|
244
|
-
|
|
243
|
+
u && /* @__PURE__ */ e.jsxs(
|
|
244
|
+
ut,
|
|
245
245
|
{
|
|
246
246
|
width: "auto",
|
|
247
|
-
size:
|
|
247
|
+
size: d,
|
|
248
248
|
fontWeight: "bold",
|
|
249
|
-
value:
|
|
250
|
-
onChange: (
|
|
251
|
-
isDisabled:
|
|
249
|
+
value: k,
|
|
250
|
+
onChange: (T) => Z(!0, T),
|
|
251
|
+
isDisabled: N || y,
|
|
252
252
|
children: [
|
|
253
|
-
/* @__PURE__ */ e.jsx("option", { value: -1, children:
|
|
254
|
-
/* @__PURE__ */ e.jsx("option", { value: 1, children:
|
|
253
|
+
/* @__PURE__ */ e.jsx("option", { value: -1, children: u[0] }),
|
|
254
|
+
/* @__PURE__ */ e.jsx("option", { value: 1, children: u[1] })
|
|
255
255
|
]
|
|
256
256
|
}
|
|
257
257
|
),
|
|
258
258
|
/* @__PURE__ */ e.jsx(
|
|
259
|
-
|
|
259
|
+
mt,
|
|
260
260
|
{
|
|
261
261
|
precision: 0,
|
|
262
|
-
size:
|
|
262
|
+
size: d ?? "sm",
|
|
263
263
|
min: 0,
|
|
264
|
-
max:
|
|
265
|
-
value:
|
|
266
|
-
onChange:
|
|
267
|
-
onBlur:
|
|
264
|
+
max: k < 0 ? Math.abs(t) : E ?? r,
|
|
265
|
+
value: L === "" ? "" : Math.abs(Number(L ?? t)),
|
|
266
|
+
onChange: oe,
|
|
267
|
+
onBlur: K,
|
|
268
268
|
borderWidth: 1,
|
|
269
269
|
borderRadius: 3,
|
|
270
270
|
borderColor: "#ccc",
|
|
271
271
|
isDisabled: y,
|
|
272
272
|
...h,
|
|
273
273
|
children: /* @__PURE__ */ e.jsx(
|
|
274
|
-
|
|
274
|
+
ht,
|
|
275
275
|
{
|
|
276
276
|
backgroundColor: "#fff",
|
|
277
277
|
paddingRight: 0,
|
|
@@ -281,22 +281,22 @@ const Tn = ({
|
|
|
281
281
|
}
|
|
282
282
|
),
|
|
283
283
|
/* @__PURE__ */ e.jsx(
|
|
284
|
-
|
|
284
|
+
mt,
|
|
285
285
|
{
|
|
286
|
-
size:
|
|
286
|
+
size: d ?? "sm",
|
|
287
287
|
min: 0,
|
|
288
|
-
max:
|
|
288
|
+
max: x < 0 ? Math.abs(v ?? t) : r,
|
|
289
289
|
precision: 0,
|
|
290
|
-
value:
|
|
290
|
+
value: f === "" ? "" : Math.abs(Number(f ?? r)),
|
|
291
291
|
onChange: D,
|
|
292
|
-
onBlur:
|
|
292
|
+
onBlur: K,
|
|
293
293
|
borderWidth: 1,
|
|
294
294
|
borderRadius: 3,
|
|
295
295
|
borderColor: "#ccc",
|
|
296
296
|
isDisabled: y,
|
|
297
297
|
...h,
|
|
298
298
|
children: /* @__PURE__ */ e.jsx(
|
|
299
|
-
|
|
299
|
+
ht,
|
|
300
300
|
{
|
|
301
301
|
backgroundColor: "#fff",
|
|
302
302
|
paddingRight: 0,
|
|
@@ -305,18 +305,18 @@ const Tn = ({
|
|
|
305
305
|
)
|
|
306
306
|
}
|
|
307
307
|
),
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
u && /* @__PURE__ */ e.jsxs(
|
|
309
|
+
ut,
|
|
310
310
|
{
|
|
311
311
|
width: "auto",
|
|
312
|
-
size:
|
|
312
|
+
size: d,
|
|
313
313
|
fontWeight: "bold",
|
|
314
|
-
value:
|
|
315
|
-
onChange: (
|
|
316
|
-
isDisabled:
|
|
314
|
+
value: x,
|
|
315
|
+
onChange: (T) => Z(!1, T),
|
|
316
|
+
isDisabled: N || y,
|
|
317
317
|
children: [
|
|
318
|
-
/* @__PURE__ */ e.jsx("option", { value: -1, children:
|
|
319
|
-
/* @__PURE__ */ e.jsx("option", { value: 1, children:
|
|
318
|
+
/* @__PURE__ */ e.jsx("option", { value: -1, children: u[0] }),
|
|
319
|
+
/* @__PURE__ */ e.jsx("option", { value: 1, children: u[1] })
|
|
320
320
|
]
|
|
321
321
|
}
|
|
322
322
|
)
|
|
@@ -324,20 +324,20 @@ const Tn = ({
|
|
|
324
324
|
}
|
|
325
325
|
)
|
|
326
326
|
] });
|
|
327
|
-
},
|
|
328
|
-
action:
|
|
329
|
-
quantumIconSrc:
|
|
327
|
+
}, Gn = ({ tags: s, containerProps: t, ...r }) => /* @__PURE__ */ e.jsx(V, { ...t, children: s.map((p, m) => /* @__PURE__ */ e.jsx(Ge, { ...r, children: p }, m)) }), Fn = new jn({}), Pn = ({
|
|
328
|
+
action: s,
|
|
329
|
+
quantumIconSrc: t
|
|
330
330
|
}) => {
|
|
331
|
-
const { getLabel:
|
|
332
|
-
actionLowerCase:
|
|
333
|
-
}), [
|
|
334
|
-
return
|
|
335
|
-
|
|
331
|
+
const { getLabel: r } = xe(), p = $(() => ({
|
|
332
|
+
actionLowerCase: r("action").toLocaleLowerCase()
|
|
333
|
+
}), [r]);
|
|
334
|
+
return s.quantumOwned ? /* @__PURE__ */ e.jsx(
|
|
335
|
+
rt,
|
|
336
336
|
{
|
|
337
337
|
label: `This ${p.actionLowerCase} is owned by Quantum`,
|
|
338
338
|
"aria-label": "Quantum owned",
|
|
339
339
|
children: /* @__PURE__ */ e.jsx(
|
|
340
|
-
|
|
340
|
+
se,
|
|
341
341
|
{
|
|
342
342
|
boxSize: "1.5em",
|
|
343
343
|
borderRadius: "full",
|
|
@@ -346,9 +346,9 @@ const Tn = ({
|
|
|
346
346
|
alignItems: "center",
|
|
347
347
|
justifyContent: "center",
|
|
348
348
|
children: /* @__PURE__ */ e.jsx(
|
|
349
|
-
|
|
349
|
+
qt,
|
|
350
350
|
{
|
|
351
|
-
src:
|
|
351
|
+
src: t,
|
|
352
352
|
boxSize: "1em",
|
|
353
353
|
alt: `Quantum-owned ${p.actionLowerCase}`
|
|
354
354
|
}
|
|
@@ -357,367 +357,412 @@ const Tn = ({
|
|
|
357
357
|
)
|
|
358
358
|
}
|
|
359
359
|
) : null;
|
|
360
|
-
},
|
|
361
|
-
if (!
|
|
362
|
-
return
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
},
|
|
366
|
-
(
|
|
360
|
+
}, _n = (s, t) => {
|
|
361
|
+
if (!t || !t.trim().length)
|
|
362
|
+
return s;
|
|
363
|
+
const r = s.map((m) => m.name ?? "");
|
|
364
|
+
return Fn.filter(r, t)?.map((m) => s[m]) ?? [];
|
|
365
|
+
}, En = (s) => !s || s.length === 0 ? "None" : s.map(
|
|
366
|
+
(t) => (
|
|
367
367
|
// Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
|
|
368
|
-
|
|
368
|
+
t.replace(/([A-Z])/g, " $1").trim()
|
|
369
369
|
)
|
|
370
|
-
).join(", "),
|
|
371
|
-
(
|
|
372
|
-
),
|
|
370
|
+
).join(", "), zn = (s, t) => !t || t.length == 0 ? s : s.filter(
|
|
371
|
+
(r) => r.useCases?.some((p) => t.includes(p.id)) ?? !1
|
|
372
|
+
), Bn = (s, t, r) => !t || t.length === 0 ? s : s.filter((p) => {
|
|
373
373
|
const m = {};
|
|
374
|
-
return
|
|
375
|
-
for (const [
|
|
376
|
-
if (
|
|
377
|
-
m[
|
|
374
|
+
return t.forEach((h) => {
|
|
375
|
+
for (const [d, g] of Object.entries(r || {}))
|
|
376
|
+
if (g.some((n) => n.id === h)) {
|
|
377
|
+
m[d] || (m[d] = []), m[d].push(h);
|
|
378
378
|
break;
|
|
379
379
|
}
|
|
380
380
|
}), Object.entries(m).every(
|
|
381
|
-
([h,
|
|
382
|
-
const
|
|
383
|
-
if (!
|
|
381
|
+
([h, d]) => {
|
|
382
|
+
const g = p.metadataGroups?.find((y) => A(je, y).key === h);
|
|
383
|
+
if (!g)
|
|
384
384
|
return !1;
|
|
385
|
-
const n =
|
|
385
|
+
const n = A(
|
|
386
386
|
je,
|
|
387
|
-
|
|
388
|
-
),
|
|
387
|
+
g
|
|
388
|
+
), u = A(
|
|
389
389
|
be,
|
|
390
390
|
n.data
|
|
391
391
|
).map((y) => y.id);
|
|
392
|
-
return
|
|
393
|
-
(y) =>
|
|
392
|
+
return d.some(
|
|
393
|
+
(y) => u.includes(y)
|
|
394
394
|
);
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
|
-
}),
|
|
398
|
-
actions:
|
|
399
|
-
totalActions:
|
|
400
|
-
onCreate:
|
|
397
|
+
}), Un = ({
|
|
398
|
+
actions: s,
|
|
399
|
+
totalActions: t,
|
|
400
|
+
onCreate: r,
|
|
401
401
|
onDelete: p,
|
|
402
402
|
onEdit: m,
|
|
403
403
|
onView: h,
|
|
404
|
-
onSelected:
|
|
405
|
-
onDuplicate:
|
|
404
|
+
onSelected: d,
|
|
405
|
+
onDuplicate: g,
|
|
406
406
|
disableMultiSelect: n,
|
|
407
|
-
disableDelete:
|
|
408
|
-
disableEdit:
|
|
407
|
+
disableDelete: o,
|
|
408
|
+
disableEdit: u,
|
|
409
409
|
disableCreate: y,
|
|
410
|
-
hideUseCase:
|
|
411
|
-
showMetadataFilters:
|
|
412
|
-
tableProps:
|
|
413
|
-
containerProps:
|
|
414
|
-
quantumIconSrc:
|
|
410
|
+
hideUseCase: b = !0,
|
|
411
|
+
showMetadataFilters: w = !0,
|
|
412
|
+
tableProps: I,
|
|
413
|
+
containerProps: L,
|
|
414
|
+
quantumIconSrc: f = "/favicon.ico",
|
|
415
|
+
allowDuplicateSelection: c = !1,
|
|
416
|
+
getSelectedCount: k
|
|
415
417
|
}) => {
|
|
416
|
-
const [
|
|
417
|
-
action:
|
|
418
|
-
actionPlural:
|
|
419
|
-
actionLowerCase:
|
|
420
|
-
actionPluralLowerCase:
|
|
421
|
-
}), [
|
|
418
|
+
const [x, N] = q(""), [v, E] = q(), [R, O] = q([]), [K, oe] = q({}), { getLabel: D } = xe(), ae = lt(), Z = $(() => ({
|
|
419
|
+
action: D("action"),
|
|
420
|
+
actionPlural: D("action_plural"),
|
|
421
|
+
actionLowerCase: D("action").toLocaleLowerCase(),
|
|
422
|
+
actionPluralLowerCase: D("action_plural").toLocaleLowerCase()
|
|
423
|
+
}), [D]), T = $(() => [
|
|
422
424
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
423
|
-
{ key: "activity_type", label: `${
|
|
425
|
+
{ key: "activity_type", label: `${Z.action} Type`, multi: !0 },
|
|
424
426
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
425
427
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
426
428
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
427
|
-
], [
|
|
429
|
+
], [Z.action]);
|
|
428
430
|
ce(() => {
|
|
429
|
-
if (!
|
|
431
|
+
if (!w)
|
|
430
432
|
return;
|
|
431
|
-
const
|
|
432
|
-
(
|
|
433
|
+
const l = T.map(
|
|
434
|
+
(S) => ae.query(at, { key: S.key })
|
|
433
435
|
);
|
|
434
|
-
Promise.all(
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
if (
|
|
438
|
-
const
|
|
436
|
+
Promise.all(l).then((S) => {
|
|
437
|
+
const W = {};
|
|
438
|
+
S.forEach((G) => {
|
|
439
|
+
if (G.error || !G.data) return;
|
|
440
|
+
const Q = A(
|
|
439
441
|
je,
|
|
440
|
-
|
|
441
|
-
),
|
|
442
|
+
G.data.getMetadataByKey
|
|
443
|
+
), H = A(
|
|
442
444
|
be,
|
|
443
|
-
|
|
445
|
+
Q.data
|
|
444
446
|
);
|
|
445
|
-
|
|
446
|
-
label:
|
|
447
|
-
value:
|
|
448
|
-
id:
|
|
447
|
+
W[Q.key] = H.map((re) => ({
|
|
448
|
+
label: re.label || re.value,
|
|
449
|
+
value: re.value,
|
|
450
|
+
id: re.id
|
|
449
451
|
}));
|
|
450
|
-
}),
|
|
452
|
+
}), oe(W);
|
|
451
453
|
});
|
|
452
|
-
}, [
|
|
453
|
-
const
|
|
454
|
-
if (!
|
|
454
|
+
}, [ae, T, w]);
|
|
455
|
+
const B = $(() => {
|
|
456
|
+
if (!s)
|
|
455
457
|
return;
|
|
456
|
-
const
|
|
457
|
-
return
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
) :
|
|
458
|
+
const l = _n(s, x), S = b ? l : zn(l, v);
|
|
459
|
+
return w ? Bn(
|
|
460
|
+
S,
|
|
461
|
+
R,
|
|
462
|
+
K
|
|
463
|
+
) : S;
|
|
462
464
|
}, [
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
g,
|
|
466
|
-
j,
|
|
465
|
+
s,
|
|
466
|
+
x,
|
|
467
467
|
v,
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
468
|
+
b,
|
|
469
|
+
w,
|
|
470
|
+
R,
|
|
471
|
+
K
|
|
472
|
+
]), J = _(() => {
|
|
471
473
|
if (!p)
|
|
472
474
|
return;
|
|
473
|
-
const
|
|
474
|
-
(
|
|
475
|
-
).map((
|
|
476
|
-
p(
|
|
477
|
-
}, [
|
|
478
|
-
if (!
|
|
475
|
+
const S = s.filter(
|
|
476
|
+
(W) => W.selected && !W.quantumOwned
|
|
477
|
+
).map((W) => W.id);
|
|
478
|
+
p(S);
|
|
479
|
+
}, [s, p]), U = _(() => {
|
|
480
|
+
if (!g)
|
|
479
481
|
return;
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
}, [
|
|
483
|
-
(
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
(
|
|
489
|
-
(
|
|
482
|
+
const l = s.filter((S) => S.selected);
|
|
483
|
+
g(l.map((S) => S.id)), d && l.forEach((S) => d(S, !1));
|
|
484
|
+
}, [s, g, d]), Y = $(() => s.some((l) => l.selected && !l.quantumOwned), [s]), i = $(() => s.some((l) => l.selected), [s]), a = $(() => s.some((l) => l.selected && l.quantumOwned), [s]), C = _(
|
|
485
|
+
(l, S) => {
|
|
486
|
+
const W = T.find((Q) => Q.key === l);
|
|
487
|
+
if (!W) return;
|
|
488
|
+
const G = W.multi ? (S ?? []).map((Q) => Q.id) : S ? [S.id] : [];
|
|
489
|
+
O((Q) => [...Q.filter((re) => Object.values(K).flat().find((Ie) => Ie.id === re) && !Object.keys(K).find(
|
|
490
|
+
(Ie) => K[Ie]?.some(
|
|
491
|
+
(Se) => Se.id === re && Ie === l
|
|
490
492
|
)
|
|
491
|
-
)), ...
|
|
493
|
+
)), ...G]);
|
|
492
494
|
},
|
|
493
|
-
[
|
|
495
|
+
[T, K]
|
|
494
496
|
);
|
|
495
|
-
return /* @__PURE__ */ e.jsxs(
|
|
496
|
-
/* @__PURE__ */ e.jsxs(
|
|
497
|
-
(
|
|
498
|
-
|
|
499
|
-
|
|
497
|
+
return /* @__PURE__ */ e.jsxs(se, { ...L, children: [
|
|
498
|
+
/* @__PURE__ */ e.jsxs(Me, { alignContent: "space-between", gap: 4, children: [
|
|
499
|
+
(r || p || g) && /* @__PURE__ */ e.jsxs(Ne, { mb: "1rem", gap: 4, children: [
|
|
500
|
+
r && /* @__PURE__ */ e.jsxs(
|
|
501
|
+
te,
|
|
500
502
|
{
|
|
501
|
-
isDisabled: !
|
|
503
|
+
isDisabled: !r || y,
|
|
502
504
|
colorScheme: "blackAlpha",
|
|
503
505
|
backgroundColor: "gray.700",
|
|
504
|
-
onClick:
|
|
506
|
+
onClick: r,
|
|
505
507
|
children: [
|
|
506
508
|
"Create New ",
|
|
507
|
-
|
|
509
|
+
Z.action
|
|
508
510
|
]
|
|
509
511
|
}
|
|
510
512
|
),
|
|
511
513
|
p && !n && /* @__PURE__ */ e.jsx(
|
|
512
|
-
|
|
514
|
+
rt,
|
|
513
515
|
{
|
|
514
|
-
label:
|
|
516
|
+
label: a ? Y ? `Quantum-owned ${Z.actionPluralLowerCase} are selected and will be skipped` : `Selected ${Z.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
|
|
515
517
|
shouldWrapChildren: !0,
|
|
516
518
|
children: /* @__PURE__ */ e.jsx(
|
|
517
|
-
|
|
519
|
+
te,
|
|
518
520
|
{
|
|
519
521
|
colorScheme: "gray",
|
|
520
|
-
isDisabled: !Y || !p ||
|
|
521
|
-
onClick:
|
|
522
|
+
isDisabled: !Y || !p || o,
|
|
523
|
+
onClick: J,
|
|
522
524
|
children: "Delete Selected"
|
|
523
525
|
}
|
|
524
526
|
)
|
|
525
527
|
}
|
|
526
528
|
),
|
|
527
|
-
|
|
528
|
-
|
|
529
|
+
g && !n && /* @__PURE__ */ e.jsx(
|
|
530
|
+
te,
|
|
529
531
|
{
|
|
530
532
|
colorScheme: "gray",
|
|
531
|
-
isDisabled: !
|
|
532
|
-
onClick:
|
|
533
|
+
isDisabled: !i,
|
|
534
|
+
onClick: U,
|
|
533
535
|
children: "Duplicate Selected"
|
|
534
536
|
}
|
|
535
537
|
)
|
|
536
538
|
] }),
|
|
537
539
|
/* @__PURE__ */ e.jsx(
|
|
538
|
-
|
|
540
|
+
Rn,
|
|
539
541
|
{
|
|
540
|
-
setSearch:
|
|
541
|
-
actions:
|
|
542
|
-
updateUseCases:
|
|
543
|
-
hideUseCaseFilter:
|
|
542
|
+
setSearch: N,
|
|
543
|
+
actions: s,
|
|
544
|
+
updateUseCases: E,
|
|
545
|
+
hideUseCaseFilter: b
|
|
544
546
|
}
|
|
545
547
|
)
|
|
546
548
|
] }),
|
|
547
|
-
|
|
548
|
-
/* @__PURE__ */ e.jsx(
|
|
549
|
+
w && K && /* @__PURE__ */ e.jsx(se, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: T.map((l) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
550
|
+
/* @__PURE__ */ e.jsx(_e, { fontSize: "sm", children: l.label }),
|
|
549
551
|
/* @__PURE__ */ e.jsx(
|
|
550
552
|
he,
|
|
551
553
|
{
|
|
552
554
|
chakraStyles: {
|
|
553
|
-
menu: (
|
|
554
|
-
...
|
|
555
|
+
menu: (S) => ({
|
|
556
|
+
...S,
|
|
555
557
|
zIndex: 2
|
|
556
558
|
})
|
|
557
559
|
},
|
|
558
|
-
isMulti:
|
|
559
|
-
value:
|
|
560
|
-
(
|
|
560
|
+
isMulti: l.multi,
|
|
561
|
+
value: K[l.key]?.filter(
|
|
562
|
+
(S) => R.includes(S.id)
|
|
561
563
|
),
|
|
562
|
-
onChange: (
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
564
|
+
onChange: (S) => {
|
|
565
|
+
C(
|
|
566
|
+
l.key,
|
|
567
|
+
S
|
|
566
568
|
);
|
|
567
569
|
},
|
|
568
|
-
options:
|
|
569
|
-
placeholder: `Select ${
|
|
570
|
-
isClearable:
|
|
570
|
+
options: K[l.key],
|
|
571
|
+
placeholder: `Select ${l.multi ? "one or more" : "one"} ${l.label.toLowerCase()}`,
|
|
572
|
+
isClearable: l.multi
|
|
571
573
|
}
|
|
572
574
|
)
|
|
573
|
-
] },
|
|
574
|
-
/* @__PURE__ */ e.jsx(
|
|
575
|
-
/* @__PURE__ */ e.jsx(
|
|
575
|
+
] }, l.key)) }) }),
|
|
576
|
+
/* @__PURE__ */ e.jsx(Bt, { mr: "2rem", overflowX: "hidden", ...I, children: /* @__PURE__ */ e.jsxs(Ut, { size: "md", variant: "simple", children: [
|
|
577
|
+
/* @__PURE__ */ e.jsx(Wt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(pt, { children: [
|
|
576
578
|
/* @__PURE__ */ e.jsxs(De, { fontWeight: "normal", children: [
|
|
577
579
|
"(showing ",
|
|
578
|
-
|
|
580
|
+
B?.length ?? 0,
|
|
579
581
|
" of",
|
|
580
582
|
" ",
|
|
581
|
-
|
|
583
|
+
t ?? s.length,
|
|
582
584
|
")"
|
|
583
585
|
] }),
|
|
584
586
|
/* @__PURE__ */ e.jsx(De, { children: "Name" }),
|
|
585
587
|
/* @__PURE__ */ e.jsx(De, { children: "Sensor Locations" }),
|
|
586
|
-
!
|
|
588
|
+
!b && /* @__PURE__ */ e.jsx(De, { children: "Use Case" }),
|
|
587
589
|
/* @__PURE__ */ e.jsx(De, {})
|
|
588
590
|
] }) }),
|
|
589
|
-
/* @__PURE__ */ e.jsx(
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
591
|
+
/* @__PURE__ */ e.jsx(Qt, { children: B?.map((l) => {
|
|
592
|
+
const S = c ? k?.(l.id) ?? 0 : 0, W = c ? S > 0 : !!l.selected;
|
|
593
|
+
return /* @__PURE__ */ e.jsxs(
|
|
594
|
+
pt,
|
|
595
|
+
{
|
|
596
|
+
className: Je(
|
|
597
|
+
"hover:bg-[#f7f7f7]",
|
|
598
|
+
!n && !c && "cursor-pointer",
|
|
599
|
+
W && "bg-gray-200"
|
|
600
|
+
),
|
|
601
|
+
onClick: () => {
|
|
602
|
+
n || c || d?.(l, !l.selected);
|
|
603
|
+
},
|
|
604
|
+
children: [
|
|
605
|
+
/* @__PURE__ */ e.jsx(We, { children: /* @__PURE__ */ e.jsxs(Me, { alignItems: "center", children: [
|
|
606
|
+
!n && c ? /* @__PURE__ */ e.jsxs(
|
|
607
|
+
V,
|
|
608
|
+
{
|
|
609
|
+
spacing: 1,
|
|
610
|
+
onClick: (G) => G.stopPropagation(),
|
|
611
|
+
children: [
|
|
612
|
+
/* @__PURE__ */ e.jsx(
|
|
613
|
+
ot,
|
|
614
|
+
{
|
|
615
|
+
"aria-label": "Remove one instance",
|
|
616
|
+
icon: /* @__PURE__ */ e.jsx(yn, {}),
|
|
617
|
+
size: "xs",
|
|
618
|
+
variant: "outline",
|
|
619
|
+
isDisabled: S === 0,
|
|
620
|
+
onClick: () => d?.(l, !1)
|
|
621
|
+
}
|
|
622
|
+
),
|
|
623
|
+
/* @__PURE__ */ e.jsx(
|
|
624
|
+
M,
|
|
625
|
+
{
|
|
626
|
+
minW: "1.5rem",
|
|
627
|
+
textAlign: "center",
|
|
628
|
+
fontWeight: S > 0 ? "semibold" : "normal",
|
|
629
|
+
color: S > 0 ? "blue.600" : "gray.500",
|
|
630
|
+
children: S
|
|
631
|
+
}
|
|
632
|
+
),
|
|
633
|
+
/* @__PURE__ */ e.jsx(
|
|
634
|
+
ot,
|
|
635
|
+
{
|
|
636
|
+
"aria-label": "Add one instance",
|
|
637
|
+
icon: /* @__PURE__ */ e.jsx(vn, {}),
|
|
638
|
+
size: "xs",
|
|
639
|
+
variant: "outline",
|
|
640
|
+
colorScheme: "blue",
|
|
641
|
+
onClick: () => d?.(l, !0)
|
|
642
|
+
}
|
|
643
|
+
)
|
|
644
|
+
]
|
|
645
|
+
}
|
|
646
|
+
) : n ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: l.selected ? /* @__PURE__ */ e.jsx(Cn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(wn, { className: "text-gray-400" }) }),
|
|
647
|
+
(l.quantumOwned || !m) && h && /* @__PURE__ */ e.jsx(
|
|
648
|
+
te,
|
|
649
|
+
{
|
|
650
|
+
ml: "1em",
|
|
651
|
+
size: "sm",
|
|
652
|
+
variant: "link",
|
|
653
|
+
colorScheme: "blue",
|
|
654
|
+
onClick: (G) => {
|
|
655
|
+
G.stopPropagation(), h(l.id);
|
|
656
|
+
},
|
|
657
|
+
children: "View"
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
!l.quantumOwned && m && /* @__PURE__ */ e.jsx(
|
|
661
|
+
te,
|
|
662
|
+
{
|
|
663
|
+
isDisabled: u,
|
|
664
|
+
ml: "1em",
|
|
665
|
+
size: "sm",
|
|
666
|
+
variant: "link",
|
|
667
|
+
colorScheme: "blue",
|
|
668
|
+
onClick: (G) => {
|
|
669
|
+
G.stopPropagation(), m(l.id);
|
|
670
|
+
},
|
|
671
|
+
children: "Edit"
|
|
672
|
+
}
|
|
673
|
+
)
|
|
674
|
+
] }) }),
|
|
675
|
+
/* @__PURE__ */ e.jsx(We, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(Me, { align: "center", gap: 2, children: [
|
|
676
|
+
/* @__PURE__ */ e.jsx(
|
|
677
|
+
Pn,
|
|
678
|
+
{
|
|
679
|
+
action: l,
|
|
680
|
+
quantumIconSrc: f
|
|
681
|
+
}
|
|
682
|
+
),
|
|
683
|
+
l.name
|
|
684
|
+
] }) }),
|
|
685
|
+
/* @__PURE__ */ e.jsx(We, { maxW: "20rem", whiteSpace: "break-spaces", children: En(l.sensorLocations) }),
|
|
686
|
+
!b && /* @__PURE__ */ e.jsx(We, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
|
|
633
687
|
Gn,
|
|
634
688
|
{
|
|
635
|
-
|
|
636
|
-
|
|
689
|
+
containerProps: { flexWrap: "wrap" },
|
|
690
|
+
tags: l.useCases?.map((G) => G.name) ?? []
|
|
637
691
|
}
|
|
638
|
-
)
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
{
|
|
645
|
-
containerProps: { flexWrap: "wrap" },
|
|
646
|
-
tags: t.useCases?.map((l) => l.name) ?? []
|
|
647
|
-
}
|
|
648
|
-
) })
|
|
649
|
-
]
|
|
650
|
-
},
|
|
651
|
-
t.id
|
|
652
|
-
)) })
|
|
692
|
+
) })
|
|
693
|
+
]
|
|
694
|
+
},
|
|
695
|
+
l.id
|
|
696
|
+
);
|
|
697
|
+
}) })
|
|
653
698
|
] }) })
|
|
654
699
|
] });
|
|
655
|
-
},
|
|
656
|
-
onSave:
|
|
657
|
-
onCancel:
|
|
658
|
-
onError:
|
|
700
|
+
}, bs = ({
|
|
701
|
+
onSave: s,
|
|
702
|
+
onCancel: t,
|
|
703
|
+
onError: r,
|
|
659
704
|
hideButtons: p = !1,
|
|
660
705
|
setButtonDisabled: m,
|
|
661
706
|
setButtonOnClick: h,
|
|
662
|
-
quantumOwned:
|
|
707
|
+
quantumOwned: d
|
|
663
708
|
}) => {
|
|
664
|
-
const
|
|
709
|
+
const g = wt(), { getLabel: n } = xe(), o = $(() => ({
|
|
665
710
|
singular: n("action"),
|
|
666
711
|
plural: n("action_plural"),
|
|
667
712
|
pluralLowerCase: n("action_plural").toLowerCase(),
|
|
668
713
|
singularLowerCase: n("action").toLowerCase()
|
|
669
|
-
}), [n]), [
|
|
670
|
-
query:
|
|
671
|
-
}), [
|
|
714
|
+
}), [n]), [u, y] = q("copy"), [b, w] = q(""), [I, L] = q([]), [f, c] = q(!1), [k] = Ce({
|
|
715
|
+
query: Lt
|
|
716
|
+
}), [x] = Ce({
|
|
672
717
|
query: cn,
|
|
673
|
-
variables: { groupId:
|
|
674
|
-
pause: !
|
|
718
|
+
variables: { groupId: b },
|
|
719
|
+
pause: !b
|
|
675
720
|
// Only run when group is selected
|
|
676
|
-
}), [,
|
|
677
|
-
|
|
678
|
-
),
|
|
679
|
-
(i) =>
|
|
680
|
-
) : [], [
|
|
681
|
-
const
|
|
682
|
-
Ge,
|
|
683
|
-
l.reports
|
|
684
|
-
), W = M(
|
|
721
|
+
}), [, N] = fe(it), [, v] = fe(
|
|
722
|
+
kt
|
|
723
|
+
), E = $(() => k.data?.groups ? k.data.groups.map(
|
|
724
|
+
(i) => A(Mt, i)
|
|
725
|
+
) : [], [k.data]), R = $(() => x.data ? x.data.actions.map((a) => {
|
|
726
|
+
const C = A(ve, a), l = A(
|
|
685
727
|
Fe,
|
|
686
|
-
|
|
687
|
-
),
|
|
728
|
+
C.reports
|
|
729
|
+
), S = A(
|
|
730
|
+
Pe,
|
|
731
|
+
C.categories
|
|
732
|
+
), G = A(
|
|
688
733
|
je,
|
|
689
|
-
|
|
690
|
-
).map((
|
|
691
|
-
...
|
|
692
|
-
data:
|
|
734
|
+
C.metadataGroups
|
|
735
|
+
).map((Q) => ({
|
|
736
|
+
...Q,
|
|
737
|
+
data: Q.data.map((H) => A(be, H))
|
|
693
738
|
}));
|
|
694
739
|
return {
|
|
695
|
-
...
|
|
696
|
-
thresholds:
|
|
697
|
-
reports:
|
|
698
|
-
...
|
|
699
|
-
thresholds:
|
|
740
|
+
...C,
|
|
741
|
+
thresholds: A(Te, C.thresholds),
|
|
742
|
+
reports: l.map((Q) => ({
|
|
743
|
+
...Q,
|
|
744
|
+
thresholds: A(Te, Q.thresholds)
|
|
700
745
|
})),
|
|
701
|
-
categories:
|
|
702
|
-
metadataGroups:
|
|
746
|
+
categories: S,
|
|
747
|
+
metadataGroups: G
|
|
703
748
|
};
|
|
704
|
-
}) : [], [
|
|
705
|
-
(i) =>
|
|
706
|
-
), [
|
|
749
|
+
}) : [], [x.data]), O = $(() => R.filter(
|
|
750
|
+
(i) => I.includes(i.id)
|
|
751
|
+
), [R, I]), K = _(
|
|
707
752
|
(i) => {
|
|
708
|
-
const
|
|
709
|
-
|
|
753
|
+
const a = i?.value || "";
|
|
754
|
+
w(a), L([]);
|
|
710
755
|
},
|
|
711
756
|
[]
|
|
712
|
-
),
|
|
757
|
+
), oe = _(
|
|
713
758
|
(i) => {
|
|
714
|
-
const
|
|
715
|
-
|
|
759
|
+
const a = i.map((C) => C.value);
|
|
760
|
+
L(a);
|
|
716
761
|
},
|
|
717
762
|
[]
|
|
718
|
-
), D =
|
|
763
|
+
), D = _(
|
|
719
764
|
async (i) => {
|
|
720
|
-
const
|
|
765
|
+
const a = {
|
|
721
766
|
...i,
|
|
722
767
|
name: `${i.name} (Copy)`,
|
|
723
768
|
// Add "(Copy)" suffix to distinguish
|
|
@@ -727,153 +772,153 @@ const Tn = ({
|
|
|
727
772
|
laterality: i.laterality,
|
|
728
773
|
activityKind: i.activityKind,
|
|
729
774
|
sensorLocations: i.sensorLocations,
|
|
730
|
-
thresholds: i.thresholds.map((
|
|
731
|
-
...
|
|
775
|
+
thresholds: i.thresholds.map((l) => ({
|
|
776
|
+
...l,
|
|
732
777
|
id: void 0
|
|
733
778
|
})),
|
|
734
|
-
categories: i.categories.map((
|
|
735
|
-
quantumOwned:
|
|
736
|
-
metadataItemIds: i.metadataGroups.flatMap((
|
|
737
|
-
reports: i.reports.map((
|
|
738
|
-
...
|
|
779
|
+
categories: i.categories.map((l) => l.id),
|
|
780
|
+
quantumOwned: d,
|
|
781
|
+
metadataItemIds: i.metadataGroups.flatMap((l) => l.data.map((S) => S.id)).filter((l) => l !== void 0),
|
|
782
|
+
reports: i.reports.map((l) => ({
|
|
783
|
+
...l,
|
|
739
784
|
id: void 0,
|
|
740
|
-
thresholds:
|
|
741
|
-
...
|
|
785
|
+
thresholds: l.thresholds.map((S) => ({
|
|
786
|
+
...S,
|
|
742
787
|
id: void 0
|
|
743
788
|
}))
|
|
744
789
|
})),
|
|
745
790
|
id: void 0
|
|
746
|
-
},
|
|
747
|
-
if (
|
|
748
|
-
if (
|
|
749
|
-
return
|
|
791
|
+
}, C = await N({ fields: a });
|
|
792
|
+
if (C.error) throw new Error(C.error.message);
|
|
793
|
+
if (C.data?.createAction)
|
|
794
|
+
return A(ve, C.data.createAction);
|
|
750
795
|
throw new Error("No action data returned");
|
|
751
796
|
},
|
|
752
|
-
[
|
|
753
|
-
),
|
|
797
|
+
[N, d]
|
|
798
|
+
), ae = _(
|
|
754
799
|
async (i) => {
|
|
755
|
-
const
|
|
756
|
-
if (
|
|
757
|
-
throw new Error(
|
|
758
|
-
if (
|
|
759
|
-
return
|
|
760
|
-
|
|
761
|
-
|
|
800
|
+
const a = await v({ id: i.id });
|
|
801
|
+
if (a.error)
|
|
802
|
+
throw new Error(a.error.message);
|
|
803
|
+
if (a.data?.convertActionToQuantumOwned)
|
|
804
|
+
return A(
|
|
805
|
+
ve,
|
|
806
|
+
a.data.convertActionToQuantumOwned
|
|
762
807
|
);
|
|
763
808
|
throw new Error("No action data returned");
|
|
764
809
|
},
|
|
765
|
-
[
|
|
766
|
-
),
|
|
767
|
-
if (
|
|
810
|
+
[v]
|
|
811
|
+
), Z = _(async () => {
|
|
812
|
+
if (c(!0), !O.length) {
|
|
768
813
|
const i = new Error(
|
|
769
|
-
`No ${
|
|
814
|
+
`No ${o.pluralLowerCase} selected for ${u === "copy" ? "copying" : "converting"}`
|
|
770
815
|
);
|
|
771
|
-
|
|
816
|
+
r?.(i), c(!1);
|
|
772
817
|
return;
|
|
773
818
|
}
|
|
774
819
|
try {
|
|
775
820
|
const i = [];
|
|
776
|
-
let
|
|
777
|
-
const
|
|
778
|
-
for (const
|
|
821
|
+
let a = 0;
|
|
822
|
+
const C = u === "copy" ? D : ae, l = u === "copy" ? "copy" : "convert";
|
|
823
|
+
for (const S of O)
|
|
779
824
|
try {
|
|
780
|
-
const
|
|
781
|
-
i.push(
|
|
782
|
-
} catch (
|
|
825
|
+
const W = await C(S);
|
|
826
|
+
i.push(W);
|
|
827
|
+
} catch (W) {
|
|
783
828
|
console.error(
|
|
784
|
-
`Failed to ${
|
|
785
|
-
|
|
786
|
-
),
|
|
829
|
+
`Failed to ${l} ${o.singularLowerCase} "${S.name}":`,
|
|
830
|
+
W
|
|
831
|
+
), a++;
|
|
787
832
|
}
|
|
788
833
|
if (i.length > 0) {
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
title:
|
|
792
|
-
description:
|
|
793
|
-
status:
|
|
834
|
+
const S = i.length, W = O.length, G = u === "copy" ? "copied" : "converted", Q = u === "copy" ? "copy" : "convert";
|
|
835
|
+
g({
|
|
836
|
+
title: a > 0 ? `Partial ${Q} completed` : `${o.plural} ${G} successfully`,
|
|
837
|
+
description: a > 0 ? `${S} of ${W} ${o.pluralLowerCase} ${G} successfully` : `${S} ${S > 1 ? o.pluralLowerCase : o.singularLowerCase} ${G} successfully`,
|
|
838
|
+
status: a > 0 ? "warning" : "success",
|
|
794
839
|
duration: 3e3,
|
|
795
840
|
isClosable: !0
|
|
796
|
-
}),
|
|
841
|
+
}), s?.(), w(""), L([]);
|
|
797
842
|
} else
|
|
798
843
|
throw new Error(
|
|
799
|
-
`Failed to ${
|
|
844
|
+
`Failed to ${l} any ${o.pluralLowerCase}`
|
|
800
845
|
);
|
|
801
846
|
} catch (i) {
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
title: `${
|
|
805
|
-
description:
|
|
847
|
+
const a = u === "copy" ? "copy" : "convert", C = i instanceof Error ? i.message : `Failed to ${a} ${o.pluralLowerCase}`;
|
|
848
|
+
g({
|
|
849
|
+
title: `${u === "copy" ? "Copy" : "Convert"} failed`,
|
|
850
|
+
description: C,
|
|
806
851
|
status: "error",
|
|
807
852
|
duration: 5e3,
|
|
808
853
|
isClosable: !0
|
|
809
|
-
}),
|
|
854
|
+
}), r?.(i instanceof Error ? i : new Error(C));
|
|
810
855
|
} finally {
|
|
811
|
-
|
|
856
|
+
c(!1);
|
|
812
857
|
}
|
|
813
858
|
}, [
|
|
814
|
-
|
|
815
|
-
|
|
859
|
+
O,
|
|
860
|
+
u,
|
|
816
861
|
D,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
]),
|
|
823
|
-
|
|
824
|
-
}, [
|
|
862
|
+
ae,
|
|
863
|
+
g,
|
|
864
|
+
s,
|
|
865
|
+
r,
|
|
866
|
+
o
|
|
867
|
+
]), T = _(() => {
|
|
868
|
+
w(""), L([]), y("copy"), t?.();
|
|
869
|
+
}, [t]);
|
|
825
870
|
ce(() => {
|
|
826
871
|
m && m({
|
|
827
872
|
cancelButton: !1,
|
|
828
|
-
saveButton:
|
|
873
|
+
saveButton: O.length === 0 || f
|
|
829
874
|
});
|
|
830
|
-
}, [
|
|
875
|
+
}, [O.length, f, m]), ce(() => {
|
|
831
876
|
h && h({
|
|
832
|
-
cancelButton:
|
|
833
|
-
saveButton:
|
|
877
|
+
cancelButton: T,
|
|
878
|
+
saveButton: Z
|
|
834
879
|
});
|
|
835
|
-
}, [h,
|
|
836
|
-
const
|
|
880
|
+
}, [h, T, Z]);
|
|
881
|
+
const B = $(() => E.map((i) => ({
|
|
837
882
|
value: i.id,
|
|
838
883
|
label: i.name
|
|
839
|
-
})), [
|
|
884
|
+
})), [E]), J = $(() => R.filter((i) => u === "copy" ? !0 : !i.quantumOwned).map((i) => ({
|
|
840
885
|
value: i.id,
|
|
841
886
|
label: i.name,
|
|
842
887
|
// Add custom data to identify quantum-owned actions for UI display
|
|
843
888
|
isQuantumOwned: i.quantumOwned
|
|
844
|
-
})), [
|
|
845
|
-
return /* @__PURE__ */ e.jsx(
|
|
846
|
-
|
|
889
|
+
})), [R, u]), U = k.fetching, Y = x.fetching;
|
|
890
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
|
|
891
|
+
d && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
847
892
|
/* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
|
|
848
893
|
/* @__PURE__ */ e.jsx(
|
|
849
|
-
|
|
894
|
+
It,
|
|
850
895
|
{
|
|
851
|
-
value:
|
|
896
|
+
value: u,
|
|
852
897
|
onChange: (i) => {
|
|
853
|
-
y(i),
|
|
898
|
+
y(i), L([]);
|
|
854
899
|
},
|
|
855
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
856
|
-
/* @__PURE__ */ e.jsx(
|
|
857
|
-
/* @__PURE__ */ e.jsxs(
|
|
900
|
+
children: /* @__PURE__ */ e.jsxs(V, { spacing: 6, children: [
|
|
901
|
+
/* @__PURE__ */ e.jsx(Ze, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
|
|
902
|
+
/* @__PURE__ */ e.jsxs(M, { fontWeight: "medium", children: [
|
|
858
903
|
"Copy ",
|
|
859
|
-
|
|
904
|
+
o.plural
|
|
860
905
|
] }),
|
|
861
|
-
/* @__PURE__ */ e.jsxs(
|
|
906
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
862
907
|
"Create new ",
|
|
863
|
-
|
|
908
|
+
o.plural.toLocaleLowerCase(),
|
|
864
909
|
" ",
|
|
865
910
|
"based on selected ones"
|
|
866
911
|
] })
|
|
867
912
|
] }) }),
|
|
868
|
-
/* @__PURE__ */ e.jsx(
|
|
869
|
-
/* @__PURE__ */ e.jsxs(
|
|
913
|
+
/* @__PURE__ */ e.jsx(Ze, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
|
|
914
|
+
/* @__PURE__ */ e.jsxs(M, { fontWeight: "medium", children: [
|
|
870
915
|
"Convert to Quantum Owned ",
|
|
871
|
-
|
|
916
|
+
o.singular
|
|
872
917
|
] }),
|
|
873
|
-
/* @__PURE__ */ e.jsxs(
|
|
918
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
874
919
|
"Convert existing",
|
|
875
920
|
" ",
|
|
876
|
-
|
|
921
|
+
o.plural.toLocaleLowerCase(),
|
|
877
922
|
" to quantum-owned"
|
|
878
923
|
] })
|
|
879
924
|
] }) })
|
|
@@ -881,88 +926,88 @@ const Tn = ({
|
|
|
881
926
|
}
|
|
882
927
|
)
|
|
883
928
|
] }),
|
|
884
|
-
/* @__PURE__ */ e.jsxs(
|
|
929
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
885
930
|
/* @__PURE__ */ e.jsx(ge, { children: "Select Source Group" }),
|
|
886
931
|
/* @__PURE__ */ e.jsx(
|
|
887
932
|
he,
|
|
888
933
|
{
|
|
889
934
|
placeholder: "Choose a group...",
|
|
890
|
-
options:
|
|
891
|
-
value:
|
|
892
|
-
onChange:
|
|
893
|
-
isLoading:
|
|
894
|
-
isDisabled:
|
|
935
|
+
options: B,
|
|
936
|
+
value: B.find((i) => i.value === b) || null,
|
|
937
|
+
onChange: K,
|
|
938
|
+
isLoading: U,
|
|
939
|
+
isDisabled: U,
|
|
895
940
|
isClearable: !0
|
|
896
941
|
}
|
|
897
942
|
),
|
|
898
|
-
|
|
899
|
-
/* @__PURE__ */ e.jsx(
|
|
900
|
-
/* @__PURE__ */ e.jsxs(
|
|
943
|
+
k.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
944
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
945
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
901
946
|
"Failed to load groups: ",
|
|
902
|
-
|
|
947
|
+
k.error.message
|
|
903
948
|
] })
|
|
904
949
|
] })
|
|
905
950
|
] }),
|
|
906
|
-
|
|
951
|
+
b && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
907
952
|
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
908
953
|
"Select ",
|
|
909
|
-
|
|
954
|
+
o.plural,
|
|
910
955
|
" to",
|
|
911
956
|
" ",
|
|
912
|
-
|
|
957
|
+
u === "copy" ? "Copy" : "Convert"
|
|
913
958
|
] }),
|
|
914
|
-
|
|
915
|
-
/* @__PURE__ */ e.jsx(
|
|
916
|
-
/* @__PURE__ */ e.jsxs(
|
|
959
|
+
Y ? /* @__PURE__ */ e.jsxs(V, { children: [
|
|
960
|
+
/* @__PURE__ */ e.jsx(St, { size: "sm" }),
|
|
961
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
917
962
|
"Loading ",
|
|
918
|
-
|
|
963
|
+
o.pluralLowerCase,
|
|
919
964
|
"..."
|
|
920
965
|
] })
|
|
921
966
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
922
967
|
/* @__PURE__ */ e.jsx(
|
|
923
968
|
he,
|
|
924
969
|
{
|
|
925
|
-
placeholder: `Choose ${
|
|
926
|
-
options:
|
|
927
|
-
value:
|
|
928
|
-
(i) =>
|
|
970
|
+
placeholder: `Choose ${o.pluralLowerCase} to ${u}...`,
|
|
971
|
+
options: J,
|
|
972
|
+
value: J.filter(
|
|
973
|
+
(i) => I.includes(i.value)
|
|
929
974
|
),
|
|
930
|
-
onChange:
|
|
931
|
-
isDisabled:
|
|
975
|
+
onChange: oe,
|
|
976
|
+
isDisabled: J.length === 0,
|
|
932
977
|
isClearable: !0,
|
|
933
978
|
isMulti: !0,
|
|
934
979
|
closeMenuOnSelect: !1,
|
|
935
|
-
formatOptionLabel: (i, { context:
|
|
980
|
+
formatOptionLabel: (i, { context: a }) => /* @__PURE__ */ e.jsxs(V, { justify: "space-between", w: "100%", children: [
|
|
936
981
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
937
|
-
/* @__PURE__ */ e.jsx(
|
|
938
|
-
|
|
982
|
+
/* @__PURE__ */ e.jsx(M, { children: i.label }),
|
|
983
|
+
a === "value" && i.isQuantumOwned && /* @__PURE__ */ e.jsx(M, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
939
984
|
] }),
|
|
940
|
-
i.isQuantumOwned &&
|
|
985
|
+
i.isQuantumOwned && a === "menu" && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
941
986
|
] })
|
|
942
987
|
}
|
|
943
988
|
),
|
|
944
|
-
|
|
989
|
+
J.length === 0 && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", mt: 2, children: [
|
|
945
990
|
"No ",
|
|
946
|
-
|
|
991
|
+
o.pluralLowerCase,
|
|
947
992
|
" found"
|
|
948
993
|
] })
|
|
949
994
|
] }),
|
|
950
|
-
|
|
951
|
-
/* @__PURE__ */ e.jsx(
|
|
952
|
-
/* @__PURE__ */ e.jsxs(
|
|
995
|
+
x.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
996
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
997
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
953
998
|
"Failed to load ",
|
|
954
|
-
|
|
999
|
+
o.pluralLowerCase,
|
|
955
1000
|
":",
|
|
956
1001
|
" ",
|
|
957
|
-
|
|
1002
|
+
x.error.message
|
|
958
1003
|
] })
|
|
959
1004
|
] })
|
|
960
1005
|
] }),
|
|
961
|
-
|
|
962
|
-
/* @__PURE__ */ e.jsx(
|
|
1006
|
+
O.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
1007
|
+
/* @__PURE__ */ e.jsx(M, { fontWeight: "semibold", mb: 3, children: O.length === 1 ? `${o.singular} to ${u === "copy" ? "Copy" : "Convert"}:` : `${O.length} ${o.plural} to ${u === "copy" ? "Copy" : "Convert"}:` }),
|
|
963
1008
|
/* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
|
|
964
|
-
|
|
965
|
-
|
|
1009
|
+
O.map((i, a) => /* @__PURE__ */ e.jsxs(
|
|
1010
|
+
se,
|
|
966
1011
|
{
|
|
967
1012
|
w: "100%",
|
|
968
1013
|
p: 3,
|
|
@@ -971,13 +1016,13 @@ const Tn = ({
|
|
|
971
1016
|
border: "1px solid",
|
|
972
1017
|
borderColor: "gray.200",
|
|
973
1018
|
children: [
|
|
974
|
-
/* @__PURE__ */ e.jsxs(
|
|
975
|
-
/* @__PURE__ */ e.jsxs(
|
|
976
|
-
|
|
1019
|
+
/* @__PURE__ */ e.jsxs(V, { justify: "space-between", align: "start", mb: 2, children: [
|
|
1020
|
+
/* @__PURE__ */ e.jsxs(M, { fontWeight: "medium", fontSize: "sm", children: [
|
|
1021
|
+
a + 1,
|
|
977
1022
|
". ",
|
|
978
1023
|
i.name
|
|
979
1024
|
] }),
|
|
980
|
-
i.quantumOwned && /* @__PURE__ */ e.jsx(
|
|
1025
|
+
i.quantumOwned && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
981
1026
|
] }),
|
|
982
1027
|
/* @__PURE__ */ e.jsxs(
|
|
983
1028
|
ue,
|
|
@@ -987,35 +1032,35 @@ const Tn = ({
|
|
|
987
1032
|
fontSize: "sm",
|
|
988
1033
|
color: "gray.600",
|
|
989
1034
|
children: [
|
|
990
|
-
i.description && /* @__PURE__ */ e.jsxs(
|
|
1035
|
+
i.description && /* @__PURE__ */ e.jsxs(M, { children: [
|
|
991
1036
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
992
1037
|
" ",
|
|
993
1038
|
i.description
|
|
994
1039
|
] }),
|
|
995
|
-
/* @__PURE__ */ e.jsxs(
|
|
1040
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
996
1041
|
/* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
|
|
997
1042
|
" ",
|
|
998
1043
|
i.activityKind
|
|
999
1044
|
] }),
|
|
1000
|
-
/* @__PURE__ */ e.jsxs(
|
|
1045
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
1001
1046
|
/* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
|
|
1002
1047
|
" ",
|
|
1003
1048
|
i.laterality
|
|
1004
1049
|
] }),
|
|
1005
|
-
/* @__PURE__ */ e.jsxs(
|
|
1050
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
1006
1051
|
/* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
|
|
1007
1052
|
" ",
|
|
1008
1053
|
i.sensorLocations.length
|
|
1009
1054
|
] }),
|
|
1010
|
-
/* @__PURE__ */ e.jsxs(
|
|
1055
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
1011
1056
|
/* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
|
|
1012
1057
|
" ",
|
|
1013
1058
|
i.thresholds.length
|
|
1014
1059
|
] }),
|
|
1015
|
-
/* @__PURE__ */ e.jsxs(
|
|
1060
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
1016
1061
|
/* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
|
|
1017
1062
|
" ",
|
|
1018
|
-
i.useCases.map((
|
|
1063
|
+
i.useCases.map((C) => C.name).join(", ") || "None"
|
|
1019
1064
|
] })
|
|
1020
1065
|
]
|
|
1021
1066
|
}
|
|
@@ -1024,8 +1069,8 @@ const Tn = ({
|
|
|
1024
1069
|
},
|
|
1025
1070
|
i.id
|
|
1026
1071
|
)),
|
|
1027
|
-
|
|
1028
|
-
|
|
1072
|
+
O.length > 1 && /* @__PURE__ */ e.jsx(
|
|
1073
|
+
se,
|
|
1029
1074
|
{
|
|
1030
1075
|
w: "100%",
|
|
1031
1076
|
p: 2,
|
|
@@ -1033,320 +1078,320 @@ const Tn = ({
|
|
|
1033
1078
|
borderRadius: "md",
|
|
1034
1079
|
border: "1px solid",
|
|
1035
1080
|
borderColor: "blue.200",
|
|
1036
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1081
|
+
children: /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1037
1082
|
"Total: ",
|
|
1038
|
-
|
|
1083
|
+
O.length,
|
|
1039
1084
|
" ",
|
|
1040
|
-
|
|
1085
|
+
o.pluralLowerCase,
|
|
1041
1086
|
" will be",
|
|
1042
1087
|
" ",
|
|
1043
|
-
|
|
1088
|
+
u === "copy" ? "copied" : "converted"
|
|
1044
1089
|
] })
|
|
1045
1090
|
}
|
|
1046
1091
|
)
|
|
1047
1092
|
] })
|
|
1048
1093
|
] }),
|
|
1049
|
-
!p && /* @__PURE__ */ e.jsxs(
|
|
1094
|
+
!p && /* @__PURE__ */ e.jsxs(Ne, { spacing: 4, justifyContent: "flex-end", children: [
|
|
1050
1095
|
/* @__PURE__ */ e.jsx(
|
|
1051
|
-
|
|
1096
|
+
te,
|
|
1052
1097
|
{
|
|
1053
1098
|
variant: "outline",
|
|
1054
|
-
onClick:
|
|
1055
|
-
isDisabled:
|
|
1099
|
+
onClick: T,
|
|
1100
|
+
isDisabled: f,
|
|
1056
1101
|
children: "Cancel"
|
|
1057
1102
|
}
|
|
1058
1103
|
),
|
|
1059
1104
|
/* @__PURE__ */ e.jsxs(
|
|
1060
|
-
|
|
1105
|
+
te,
|
|
1061
1106
|
{
|
|
1062
|
-
colorScheme:
|
|
1063
|
-
onClick:
|
|
1064
|
-
isDisabled:
|
|
1065
|
-
isLoading:
|
|
1066
|
-
loadingText: `${
|
|
1107
|
+
colorScheme: u === "copy" ? "blue" : "green",
|
|
1108
|
+
onClick: Z,
|
|
1109
|
+
isDisabled: O.length === 0 || f,
|
|
1110
|
+
isLoading: f,
|
|
1111
|
+
loadingText: `${u === "copy" ? "Copying" : "Converting"}...`,
|
|
1067
1112
|
children: [
|
|
1068
|
-
|
|
1113
|
+
u === "copy" ? "Copy" : "Convert",
|
|
1069
1114
|
" ",
|
|
1070
|
-
|
|
1115
|
+
O.length === 1 ? o.singular : `${O.length} ${o.plural}`
|
|
1071
1116
|
]
|
|
1072
1117
|
}
|
|
1073
1118
|
)
|
|
1074
1119
|
] })
|
|
1075
1120
|
] }) });
|
|
1076
|
-
},
|
|
1077
|
-
onSave:
|
|
1078
|
-
onCancel:
|
|
1079
|
-
onError:
|
|
1121
|
+
}, ys = ({
|
|
1122
|
+
onSave: s,
|
|
1123
|
+
onCancel: t,
|
|
1124
|
+
onError: r,
|
|
1080
1125
|
hideButtons: p = !1,
|
|
1081
1126
|
setButtonDisabled: m,
|
|
1082
1127
|
setButtonOnClick: h,
|
|
1083
|
-
quantumOwned:
|
|
1128
|
+
quantumOwned: d
|
|
1084
1129
|
}) => {
|
|
1085
|
-
const
|
|
1130
|
+
const g = wt(), { getLabel: n } = xe(), o = $(() => ({
|
|
1086
1131
|
singular: n("module"),
|
|
1087
1132
|
plural: n("module_plural"),
|
|
1088
1133
|
pluralLowerCase: n("module_plural").toLowerCase(),
|
|
1089
1134
|
singularLowerCase: n("module").toLowerCase()
|
|
1090
|
-
}), [n]),
|
|
1135
|
+
}), [n]), u = $(() => ({
|
|
1091
1136
|
singular: n("action"),
|
|
1092
1137
|
plural: n("action_plural"),
|
|
1093
1138
|
pluralLowerCase: n("action_plural").toLowerCase(),
|
|
1094
1139
|
singularLowerCase: n("action").toLowerCase()
|
|
1095
|
-
}), [n]), [y,
|
|
1096
|
-
query:
|
|
1097
|
-
}), [
|
|
1140
|
+
}), [n]), [y, b] = q(""), [w, I] = q([]), [L, f] = q(!1), [c, k] = q("copy"), [x] = Ce({
|
|
1141
|
+
query: Lt
|
|
1142
|
+
}), [N] = Ce({
|
|
1098
1143
|
query: dn,
|
|
1099
1144
|
variables: { groupId: y },
|
|
1100
1145
|
pause: !y
|
|
1101
1146
|
// Only run when group is selected
|
|
1102
|
-
}), [,
|
|
1103
|
-
|
|
1104
|
-
),
|
|
1105
|
-
(
|
|
1106
|
-
) : [], [
|
|
1147
|
+
}), [, v] = fe(At), [, E] = fe(Ot), [, R] = fe(it), [, O] = fe(
|
|
1148
|
+
kt
|
|
1149
|
+
), K = $(() => x.data?.groups ? x.data.groups.map(
|
|
1150
|
+
(a) => A(Mt, a)
|
|
1151
|
+
) : [], [x.data]), oe = $(() => N.data?.modules ? A(
|
|
1107
1152
|
Ye,
|
|
1108
|
-
|
|
1109
|
-
).map((
|
|
1110
|
-
const
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
),
|
|
1153
|
+
N.data?.modules
|
|
1154
|
+
).map((C) => {
|
|
1155
|
+
const l = A(
|
|
1156
|
+
Tt,
|
|
1157
|
+
C.moduleActions
|
|
1158
|
+
), W = A(
|
|
1114
1159
|
je,
|
|
1115
|
-
|
|
1116
|
-
).map((
|
|
1160
|
+
C.metadataGroups
|
|
1161
|
+
).map((G) => A(be, G.data)).flat();
|
|
1117
1162
|
return {
|
|
1118
|
-
...
|
|
1119
|
-
moduleActions:
|
|
1120
|
-
...
|
|
1121
|
-
action:
|
|
1163
|
+
...C,
|
|
1164
|
+
moduleActions: l.map((G) => ({
|
|
1165
|
+
...G,
|
|
1166
|
+
action: A(ve, G.action)
|
|
1122
1167
|
})),
|
|
1123
|
-
categories:
|
|
1124
|
-
|
|
1125
|
-
|
|
1168
|
+
categories: A(
|
|
1169
|
+
Pe,
|
|
1170
|
+
C.categories
|
|
1126
1171
|
),
|
|
1127
|
-
metadataItems:
|
|
1172
|
+
metadataItems: W
|
|
1128
1173
|
};
|
|
1129
|
-
}) : [], [
|
|
1130
|
-
(
|
|
1131
|
-
), [
|
|
1132
|
-
(
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1174
|
+
}) : [], [N.data]), D = $(() => oe.filter(
|
|
1175
|
+
(a) => w.includes(a.id)
|
|
1176
|
+
), [oe, w]), ae = _(
|
|
1177
|
+
(a) => {
|
|
1178
|
+
const C = a?.value || "";
|
|
1179
|
+
b(C), I([]);
|
|
1135
1180
|
},
|
|
1136
1181
|
[]
|
|
1137
|
-
),
|
|
1138
|
-
(
|
|
1139
|
-
const
|
|
1140
|
-
C
|
|
1182
|
+
), Z = _(
|
|
1183
|
+
(a) => {
|
|
1184
|
+
const C = a.map((l) => l.value);
|
|
1185
|
+
I(C);
|
|
1141
1186
|
},
|
|
1142
1187
|
[]
|
|
1143
|
-
),
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
1146
|
-
const
|
|
1147
|
-
`No modules selected for ${
|
|
1188
|
+
), T = _(async () => {
|
|
1189
|
+
if (f(!0), !D.length) {
|
|
1190
|
+
f(!1);
|
|
1191
|
+
const a = new Error(
|
|
1192
|
+
`No modules selected for ${c === "convert" ? "converting" : "copying"}`
|
|
1148
1193
|
);
|
|
1149
|
-
|
|
1194
|
+
r?.(a);
|
|
1150
1195
|
return;
|
|
1151
1196
|
}
|
|
1152
1197
|
try {
|
|
1153
|
-
const
|
|
1154
|
-
let
|
|
1155
|
-
for (const
|
|
1198
|
+
const a = [];
|
|
1199
|
+
let C = 0;
|
|
1200
|
+
for (const l of D)
|
|
1156
1201
|
try {
|
|
1157
|
-
let
|
|
1158
|
-
if (
|
|
1159
|
-
const
|
|
1160
|
-
if (
|
|
1202
|
+
let S = l.moduleActions.map((W) => W.actionId);
|
|
1203
|
+
if (d) {
|
|
1204
|
+
const W = l.moduleActions.map((H) => H.action), G = async (H) => {
|
|
1205
|
+
if (c === "copy") {
|
|
1161
1206
|
if (H.quantumOwned) return H;
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1207
|
+
const we = A(
|
|
1208
|
+
Pe,
|
|
1164
1209
|
H.categories
|
|
1165
|
-
),
|
|
1210
|
+
), Se = A(
|
|
1166
1211
|
je,
|
|
1167
1212
|
H.metadataGroups
|
|
1168
|
-
).map((pe) =>
|
|
1213
|
+
).map((pe) => A(
|
|
1169
1214
|
be,
|
|
1170
1215
|
pe.data
|
|
1171
|
-
).map((
|
|
1172
|
-
|
|
1216
|
+
).map(($e) => $e.id)).flat(), Be = A(
|
|
1217
|
+
Fe,
|
|
1173
1218
|
H.reports
|
|
1174
1219
|
).map((pe) => ({
|
|
1175
1220
|
...pe,
|
|
1176
1221
|
id: void 0,
|
|
1177
|
-
thresholds:
|
|
1178
|
-
|
|
1222
|
+
thresholds: A(
|
|
1223
|
+
Te,
|
|
1179
1224
|
pe.thresholds
|
|
1180
|
-
).map((
|
|
1181
|
-
|
|
1225
|
+
).map(($e) => ({
|
|
1226
|
+
...$e,
|
|
1182
1227
|
id: void 0
|
|
1183
1228
|
}))
|
|
1184
|
-
})),
|
|
1185
|
-
|
|
1229
|
+
})), tt = A(
|
|
1230
|
+
Te,
|
|
1186
1231
|
H.thresholds
|
|
1187
1232
|
).map((pe) => ({
|
|
1188
1233
|
...pe,
|
|
1189
1234
|
id: void 0
|
|
1190
|
-
})),
|
|
1235
|
+
})), Re = {
|
|
1191
1236
|
...H,
|
|
1192
1237
|
quantumOwned: !0,
|
|
1193
|
-
thresholds:
|
|
1194
|
-
categories:
|
|
1195
|
-
reports:
|
|
1196
|
-
metadataIds:
|
|
1238
|
+
thresholds: tt,
|
|
1239
|
+
categories: we?.map((pe) => pe.id),
|
|
1240
|
+
reports: Be,
|
|
1241
|
+
metadataIds: Se,
|
|
1197
1242
|
id: void 0
|
|
1198
|
-
},
|
|
1199
|
-
return
|
|
1200
|
-
|
|
1201
|
-
|
|
1243
|
+
}, Le = await R({ fields: Re });
|
|
1244
|
+
return Le.error || !Le.data?.createAction ? null : A(
|
|
1245
|
+
ve,
|
|
1246
|
+
Le.data.createAction
|
|
1202
1247
|
);
|
|
1203
1248
|
}
|
|
1204
1249
|
if (H.quantumOwned) return H;
|
|
1205
|
-
const
|
|
1250
|
+
const re = await O({
|
|
1206
1251
|
id: H.id
|
|
1207
1252
|
});
|
|
1208
|
-
return
|
|
1209
|
-
|
|
1210
|
-
|
|
1253
|
+
return re.error || !re.data?.convertActionToQuantumOwned ? null : A(
|
|
1254
|
+
ve,
|
|
1255
|
+
re.data.convertActionToQuantumOwned
|
|
1211
1256
|
);
|
|
1212
1257
|
};
|
|
1213
|
-
|
|
1214
|
-
|
|
1258
|
+
S = (await Promise.all(
|
|
1259
|
+
W.map(G)
|
|
1215
1260
|
)).filter((H) => !!H?.id).map((H) => H.id);
|
|
1216
1261
|
}
|
|
1217
|
-
if (
|
|
1218
|
-
const
|
|
1219
|
-
name:
|
|
1220
|
-
description:
|
|
1221
|
-
actions:
|
|
1222
|
-
categories:
|
|
1262
|
+
if (c === "convert") {
|
|
1263
|
+
const W = {
|
|
1264
|
+
name: l.name,
|
|
1265
|
+
description: l.description || void 0,
|
|
1266
|
+
actions: S,
|
|
1267
|
+
categories: l.categories.map((Q) => Q.id),
|
|
1223
1268
|
quantumOwned: !0
|
|
1224
|
-
},
|
|
1225
|
-
id:
|
|
1226
|
-
input:
|
|
1269
|
+
}, G = await E({
|
|
1270
|
+
id: l.id,
|
|
1271
|
+
input: W
|
|
1227
1272
|
});
|
|
1228
|
-
if (
|
|
1229
|
-
if (
|
|
1230
|
-
const
|
|
1273
|
+
if (G.error) throw new Error(G.error.message);
|
|
1274
|
+
if (G.data?.updateModule) {
|
|
1275
|
+
const Q = A(
|
|
1231
1276
|
Ye,
|
|
1232
|
-
|
|
1277
|
+
G.data.updateModule
|
|
1233
1278
|
);
|
|
1234
|
-
|
|
1279
|
+
a.push(Q);
|
|
1235
1280
|
}
|
|
1236
1281
|
} else {
|
|
1237
|
-
const
|
|
1238
|
-
name: `${
|
|
1239
|
-
description:
|
|
1240
|
-
moduleActions:
|
|
1241
|
-
actionId:
|
|
1242
|
-
reportId:
|
|
1282
|
+
const W = {
|
|
1283
|
+
name: `${l.name} (Copy)`,
|
|
1284
|
+
description: l.description || void 0,
|
|
1285
|
+
moduleActions: l.moduleActions.map((Q) => ({
|
|
1286
|
+
actionId: Q.actionId,
|
|
1287
|
+
reportId: Q.reportId ?? void 0
|
|
1243
1288
|
})),
|
|
1244
|
-
categories:
|
|
1245
|
-
quantumOwned:
|
|
1246
|
-
metadataItemIds:
|
|
1247
|
-
},
|
|
1248
|
-
if (
|
|
1249
|
-
if (
|
|
1250
|
-
const
|
|
1289
|
+
categories: l.categories.map((Q) => Q.id),
|
|
1290
|
+
quantumOwned: d,
|
|
1291
|
+
metadataItemIds: l.metadataItems.map((Q) => Q.id)
|
|
1292
|
+
}, G = await v({ input: W });
|
|
1293
|
+
if (G.error) throw new Error(G.error.message);
|
|
1294
|
+
if (G.data?.createModule) {
|
|
1295
|
+
const Q = A(
|
|
1251
1296
|
Ye,
|
|
1252
|
-
|
|
1297
|
+
G.data.createModule
|
|
1253
1298
|
);
|
|
1254
|
-
|
|
1299
|
+
a.push(Q);
|
|
1255
1300
|
}
|
|
1256
1301
|
}
|
|
1257
|
-
} catch (
|
|
1302
|
+
} catch (S) {
|
|
1258
1303
|
console.error(
|
|
1259
|
-
`Failed to ${
|
|
1260
|
-
|
|
1261
|
-
),
|
|
1304
|
+
`Failed to ${c === "convert" ? "convert" : "copy"} module "${l.name}":`,
|
|
1305
|
+
S
|
|
1306
|
+
), C++;
|
|
1262
1307
|
}
|
|
1263
|
-
if (
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1266
|
-
title:
|
|
1267
|
-
description:
|
|
1268
|
-
status:
|
|
1308
|
+
if (a.length > 0) {
|
|
1309
|
+
const l = a.length, S = D.length;
|
|
1310
|
+
g({
|
|
1311
|
+
title: C > 0 ? `Partial ${c === "convert" ? "convert" : "copy"} completed` : `${o.plural} ${c === "convert" ? "converted" : "copied"} successfully`,
|
|
1312
|
+
description: C > 0 ? `${l} of ${S} ${o.plural} ${c === "convert" ? "converted" : "copied"} successfully` : `${l} ${l > 1 ? o.plural : o.singular} ${c === "convert" ? "converted" : "copied"} successfully`,
|
|
1313
|
+
status: C > 0 ? "warning" : "success",
|
|
1269
1314
|
duration: 3e3,
|
|
1270
1315
|
isClosable: !0
|
|
1271
|
-
}),
|
|
1316
|
+
}), a.length > 0 && s?.(), b(""), I([]);
|
|
1272
1317
|
} else
|
|
1273
1318
|
throw new Error(
|
|
1274
|
-
`Failed to ${
|
|
1319
|
+
`Failed to ${c === "convert" ? "convert" : "copy"} any modules`
|
|
1275
1320
|
);
|
|
1276
|
-
} catch (
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
title:
|
|
1280
|
-
description:
|
|
1321
|
+
} catch (a) {
|
|
1322
|
+
const C = a instanceof Error ? a.message : `Failed to ${c === "convert" ? "convert" : "copy"} modules`;
|
|
1323
|
+
g({
|
|
1324
|
+
title: c === "convert" ? "Convert failed" : "Copy failed",
|
|
1325
|
+
description: C,
|
|
1281
1326
|
status: "error",
|
|
1282
1327
|
duration: 5e3,
|
|
1283
1328
|
isClosable: !0
|
|
1284
|
-
}),
|
|
1329
|
+
}), r?.(a instanceof Error ? a : new Error(C));
|
|
1285
1330
|
} finally {
|
|
1286
|
-
|
|
1331
|
+
f(!1);
|
|
1287
1332
|
}
|
|
1288
1333
|
}, [
|
|
1289
1334
|
D,
|
|
1335
|
+
v,
|
|
1336
|
+
E,
|
|
1337
|
+
g,
|
|
1338
|
+
s,
|
|
1339
|
+
r,
|
|
1340
|
+
d,
|
|
1341
|
+
R,
|
|
1290
1342
|
O,
|
|
1291
|
-
B,
|
|
1292
|
-
b,
|
|
1293
|
-
o,
|
|
1294
|
-
a,
|
|
1295
1343
|
c,
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
]), E = F(() => {
|
|
1301
|
-
j(""), C([]), S("copy"), s?.();
|
|
1302
|
-
}, [s]);
|
|
1344
|
+
o
|
|
1345
|
+
]), B = _(() => {
|
|
1346
|
+
b(""), I([]), k("copy"), t?.();
|
|
1347
|
+
}, [t]);
|
|
1303
1348
|
ce(() => {
|
|
1304
1349
|
m && m({
|
|
1305
1350
|
cancelButton: !1,
|
|
1306
|
-
saveButton: D.length === 0 ||
|
|
1351
|
+
saveButton: D.length === 0 || L
|
|
1307
1352
|
});
|
|
1308
|
-
}, [D.length,
|
|
1353
|
+
}, [D.length, L, m]), ce(() => {
|
|
1309
1354
|
h && h({
|
|
1310
|
-
cancelButton:
|
|
1311
|
-
saveButton:
|
|
1355
|
+
cancelButton: B,
|
|
1356
|
+
saveButton: T
|
|
1312
1357
|
});
|
|
1313
|
-
}, [h,
|
|
1314
|
-
const
|
|
1315
|
-
value:
|
|
1316
|
-
label:
|
|
1317
|
-
})), [
|
|
1318
|
-
value:
|
|
1319
|
-
label:
|
|
1358
|
+
}, [h, B, T]);
|
|
1359
|
+
const J = $(() => K.map((a) => ({
|
|
1360
|
+
value: a.id,
|
|
1361
|
+
label: a.name
|
|
1362
|
+
})), [K]), U = $(() => oe.filter((a) => c === "copy" ? !0 : !a.quantumOwned).map((a) => ({
|
|
1363
|
+
value: a.id,
|
|
1364
|
+
label: a.name,
|
|
1320
1365
|
// Add custom data to identify quantum-owned modules
|
|
1321
|
-
isQuantumOwned:
|
|
1322
|
-
})), [
|
|
1323
|
-
return /* @__PURE__ */ e.jsx(
|
|
1324
|
-
|
|
1366
|
+
isQuantumOwned: a.quantumOwned
|
|
1367
|
+
})), [oe, c]), Y = x.fetching, i = N.fetching;
|
|
1368
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
|
|
1369
|
+
d && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1325
1370
|
/* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
|
|
1326
1371
|
/* @__PURE__ */ e.jsx(
|
|
1327
|
-
|
|
1372
|
+
It,
|
|
1328
1373
|
{
|
|
1329
|
-
value:
|
|
1330
|
-
onChange: (
|
|
1331
|
-
|
|
1374
|
+
value: c,
|
|
1375
|
+
onChange: (a) => {
|
|
1376
|
+
k(a), I([]);
|
|
1332
1377
|
},
|
|
1333
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1334
|
-
/* @__PURE__ */ e.jsx(
|
|
1335
|
-
/* @__PURE__ */ e.jsxs(
|
|
1378
|
+
children: /* @__PURE__ */ e.jsxs(V, { spacing: 6, children: [
|
|
1379
|
+
/* @__PURE__ */ e.jsx(Ze, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
|
|
1380
|
+
/* @__PURE__ */ e.jsxs(M, { fontWeight: "medium", children: [
|
|
1336
1381
|
"Copy ",
|
|
1337
|
-
|
|
1382
|
+
o.plural
|
|
1338
1383
|
] }),
|
|
1339
|
-
/* @__PURE__ */ e.jsxs(
|
|
1384
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
1340
1385
|
"Create new ",
|
|
1341
|
-
|
|
1386
|
+
o.pluralLowerCase,
|
|
1342
1387
|
" based on selected ones"
|
|
1343
1388
|
] })
|
|
1344
1389
|
] }) }),
|
|
1345
|
-
/* @__PURE__ */ e.jsx(
|
|
1346
|
-
/* @__PURE__ */ e.jsx(
|
|
1347
|
-
/* @__PURE__ */ e.jsxs(
|
|
1390
|
+
/* @__PURE__ */ e.jsx(Ze, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
|
|
1391
|
+
/* @__PURE__ */ e.jsx(M, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
|
|
1392
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
1348
1393
|
"Convert existing ",
|
|
1349
|
-
|
|
1394
|
+
o.pluralLowerCase,
|
|
1350
1395
|
" to quantum-owned"
|
|
1351
1396
|
] })
|
|
1352
1397
|
] }) })
|
|
@@ -1354,82 +1399,82 @@ const Tn = ({
|
|
|
1354
1399
|
}
|
|
1355
1400
|
)
|
|
1356
1401
|
] }),
|
|
1357
|
-
/* @__PURE__ */ e.jsxs(
|
|
1402
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
1358
1403
|
/* @__PURE__ */ e.jsx(ge, { children: "Select Source Group" }),
|
|
1359
1404
|
/* @__PURE__ */ e.jsx(
|
|
1360
1405
|
he,
|
|
1361
1406
|
{
|
|
1362
1407
|
placeholder: "Choose a group...",
|
|
1363
|
-
options:
|
|
1364
|
-
value:
|
|
1365
|
-
onChange:
|
|
1366
|
-
isLoading:
|
|
1367
|
-
isDisabled:
|
|
1408
|
+
options: J,
|
|
1409
|
+
value: J.find((a) => a.value === y) || null,
|
|
1410
|
+
onChange: ae,
|
|
1411
|
+
isLoading: Y,
|
|
1412
|
+
isDisabled: Y,
|
|
1368
1413
|
isClearable: !0
|
|
1369
1414
|
}
|
|
1370
1415
|
),
|
|
1371
|
-
|
|
1372
|
-
/* @__PURE__ */ e.jsx(
|
|
1373
|
-
/* @__PURE__ */ e.jsxs(
|
|
1416
|
+
x.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
1417
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
1418
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
1374
1419
|
"Failed to load groups: ",
|
|
1375
|
-
|
|
1420
|
+
x.error.message
|
|
1376
1421
|
] })
|
|
1377
1422
|
] })
|
|
1378
1423
|
] }),
|
|
1379
|
-
y && /* @__PURE__ */ e.jsxs(
|
|
1380
|
-
/* @__PURE__ */ e.jsx(ge, { children:
|
|
1381
|
-
i ? /* @__PURE__ */ e.jsxs(
|
|
1382
|
-
/* @__PURE__ */ e.jsx(
|
|
1383
|
-
/* @__PURE__ */ e.jsxs(
|
|
1424
|
+
y && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1425
|
+
/* @__PURE__ */ e.jsx(ge, { children: c === "convert" ? `Select ${o.plural} to Convert` : `Select ${o.plural} to Copy` }),
|
|
1426
|
+
i ? /* @__PURE__ */ e.jsxs(V, { children: [
|
|
1427
|
+
/* @__PURE__ */ e.jsx(St, { size: "sm" }),
|
|
1428
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
1384
1429
|
"Loading ",
|
|
1385
|
-
|
|
1430
|
+
o.pluralLowerCase,
|
|
1386
1431
|
"..."
|
|
1387
1432
|
] })
|
|
1388
1433
|
] }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1389
1434
|
/* @__PURE__ */ e.jsx(
|
|
1390
1435
|
he,
|
|
1391
1436
|
{
|
|
1392
|
-
placeholder:
|
|
1393
|
-
options:
|
|
1394
|
-
value:
|
|
1395
|
-
(
|
|
1437
|
+
placeholder: c === "convert" ? `Choose ${o.pluralLowerCase} to convert...` : `Choose ${o.pluralLowerCase} to copy...`,
|
|
1438
|
+
options: U,
|
|
1439
|
+
value: U.filter(
|
|
1440
|
+
(a) => w.includes(a.value)
|
|
1396
1441
|
),
|
|
1397
|
-
onChange:
|
|
1398
|
-
isDisabled:
|
|
1442
|
+
onChange: Z,
|
|
1443
|
+
isDisabled: U.length === 0,
|
|
1399
1444
|
isClearable: !0,
|
|
1400
1445
|
isMulti: !0,
|
|
1401
1446
|
closeMenuOnSelect: !1,
|
|
1402
|
-
formatOptionLabel: (
|
|
1447
|
+
formatOptionLabel: (a, { context: C }) => /* @__PURE__ */ e.jsxs(V, { justify: "space-between", w: "100%", children: [
|
|
1403
1448
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1404
|
-
/* @__PURE__ */ e.jsx(
|
|
1405
|
-
|
|
1449
|
+
/* @__PURE__ */ e.jsx(M, { children: a.label }),
|
|
1450
|
+
C === "value" && a.isQuantumOwned && /* @__PURE__ */ e.jsx(M, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
1406
1451
|
] }),
|
|
1407
|
-
|
|
1452
|
+
a.isQuantumOwned && C === "menu" && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1408
1453
|
] })
|
|
1409
1454
|
}
|
|
1410
1455
|
),
|
|
1411
|
-
|
|
1456
|
+
U.length === 0 && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", mt: 2, children: [
|
|
1412
1457
|
"No ",
|
|
1413
|
-
|
|
1458
|
+
o.pluralLowerCase,
|
|
1414
1459
|
" found in this group"
|
|
1415
1460
|
] })
|
|
1416
1461
|
] }),
|
|
1417
|
-
|
|
1418
|
-
/* @__PURE__ */ e.jsx(
|
|
1419
|
-
/* @__PURE__ */ e.jsxs(
|
|
1462
|
+
N.error && /* @__PURE__ */ e.jsxs(Ve, { status: "error", mt: 2, children: [
|
|
1463
|
+
/* @__PURE__ */ e.jsx(et, {}),
|
|
1464
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", children: [
|
|
1420
1465
|
"Failed to load ",
|
|
1421
|
-
|
|
1466
|
+
o.pluralLowerCase,
|
|
1422
1467
|
":",
|
|
1423
1468
|
" ",
|
|
1424
|
-
|
|
1469
|
+
N.error.message
|
|
1425
1470
|
] })
|
|
1426
1471
|
] })
|
|
1427
1472
|
] }),
|
|
1428
|
-
D.length > 0 && /* @__PURE__ */ e.jsxs(
|
|
1429
|
-
/* @__PURE__ */ e.jsx(
|
|
1473
|
+
D.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
1474
|
+
/* @__PURE__ */ e.jsx(M, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `${o.singular} to ${c === "copy" ? "Copy" : "Convert"}` : `${D.length} ${o.plural} to ${c === "copy" ? "Copy" : "Convert"}` }),
|
|
1430
1475
|
/* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
|
|
1431
|
-
D.map((
|
|
1432
|
-
|
|
1476
|
+
D.map((a, C) => /* @__PURE__ */ e.jsxs(
|
|
1477
|
+
se,
|
|
1433
1478
|
{
|
|
1434
1479
|
w: "100%",
|
|
1435
1480
|
p: 3,
|
|
@@ -1438,13 +1483,13 @@ const Tn = ({
|
|
|
1438
1483
|
border: "1px solid",
|
|
1439
1484
|
borderColor: "gray.200",
|
|
1440
1485
|
children: [
|
|
1441
|
-
/* @__PURE__ */ e.jsxs(
|
|
1442
|
-
/* @__PURE__ */ e.jsxs(
|
|
1443
|
-
|
|
1486
|
+
/* @__PURE__ */ e.jsxs(V, { justify: "space-between", align: "start", mb: 2, children: [
|
|
1487
|
+
/* @__PURE__ */ e.jsxs(M, { fontWeight: "medium", fontSize: "sm", children: [
|
|
1488
|
+
C + 1,
|
|
1444
1489
|
". ",
|
|
1445
|
-
|
|
1490
|
+
a.name
|
|
1446
1491
|
] }),
|
|
1447
|
-
|
|
1492
|
+
a.quantumOwned && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1448
1493
|
] }),
|
|
1449
1494
|
/* @__PURE__ */ e.jsxs(
|
|
1450
1495
|
ue,
|
|
@@ -1454,30 +1499,30 @@ const Tn = ({
|
|
|
1454
1499
|
fontSize: "sm",
|
|
1455
1500
|
color: "gray.600",
|
|
1456
1501
|
children: [
|
|
1457
|
-
|
|
1502
|
+
a.description && /* @__PURE__ */ e.jsxs(M, { children: [
|
|
1458
1503
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
1459
1504
|
" ",
|
|
1460
|
-
|
|
1505
|
+
a.description
|
|
1461
1506
|
] }),
|
|
1462
|
-
/* @__PURE__ */ e.jsxs(
|
|
1507
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
1463
1508
|
/* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
|
|
1464
1509
|
" ",
|
|
1465
|
-
|
|
1510
|
+
a.moduleActions.length
|
|
1466
1511
|
] }),
|
|
1467
|
-
/* @__PURE__ */ e.jsxs(
|
|
1512
|
+
/* @__PURE__ */ e.jsxs(M, { children: [
|
|
1468
1513
|
/* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
|
|
1469
1514
|
" ",
|
|
1470
|
-
|
|
1515
|
+
a.categories.map((l) => l.name).join(", ") || "None"
|
|
1471
1516
|
] })
|
|
1472
1517
|
]
|
|
1473
1518
|
}
|
|
1474
1519
|
)
|
|
1475
1520
|
]
|
|
1476
1521
|
},
|
|
1477
|
-
|
|
1522
|
+
a.id
|
|
1478
1523
|
)),
|
|
1479
1524
|
D.length > 1 && /* @__PURE__ */ e.jsx(
|
|
1480
|
-
|
|
1525
|
+
se,
|
|
1481
1526
|
{
|
|
1482
1527
|
w: "100%",
|
|
1483
1528
|
p: 2,
|
|
@@ -1485,159 +1530,174 @@ const Tn = ({
|
|
|
1485
1530
|
borderRadius: "md",
|
|
1486
1531
|
border: "1px solid",
|
|
1487
1532
|
borderColor: "blue.200",
|
|
1488
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1533
|
+
children: /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1489
1534
|
"Total: ",
|
|
1490
1535
|
D.length,
|
|
1491
1536
|
" ",
|
|
1492
|
-
|
|
1537
|
+
o.pluralLowerCase,
|
|
1493
1538
|
" will be",
|
|
1494
1539
|
" ",
|
|
1495
|
-
|
|
1540
|
+
c === "copy" ? "copied" : "converted"
|
|
1496
1541
|
] })
|
|
1497
1542
|
}
|
|
1498
1543
|
),
|
|
1499
|
-
|
|
1500
|
-
|
|
1544
|
+
d && D.filter((a) => a.moduleActions.some((C) => !C.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
|
|
1545
|
+
se,
|
|
1501
1546
|
{
|
|
1502
1547
|
p: 2,
|
|
1503
1548
|
bg: "yellow.50",
|
|
1504
1549
|
borderRadius: "md",
|
|
1505
1550
|
border: "1px solid",
|
|
1506
1551
|
borderColor: "yellow.200",
|
|
1507
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1552
|
+
children: /* @__PURE__ */ e.jsx(M, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: c === "convert" ? `Converting ${o.plural} will convert non QM-Owned ${u.plural} to QM-Owned ${u.plural}` : `Copying ${o.plural} with Non QM-Owned ${u.plural} will create corresponding QM-Owned ${u.plural}` })
|
|
1508
1553
|
}
|
|
1509
1554
|
)
|
|
1510
1555
|
] })
|
|
1511
1556
|
] }),
|
|
1512
|
-
!p && /* @__PURE__ */ e.jsxs(
|
|
1557
|
+
!p && /* @__PURE__ */ e.jsxs(Ne, { spacing: 4, justifyContent: "flex-end", children: [
|
|
1513
1558
|
/* @__PURE__ */ e.jsx(
|
|
1514
|
-
|
|
1559
|
+
te,
|
|
1515
1560
|
{
|
|
1516
1561
|
variant: "outline",
|
|
1517
|
-
onClick:
|
|
1518
|
-
isDisabled:
|
|
1562
|
+
onClick: B,
|
|
1563
|
+
isDisabled: L,
|
|
1519
1564
|
children: "Cancel"
|
|
1520
1565
|
}
|
|
1521
1566
|
),
|
|
1522
1567
|
/* @__PURE__ */ e.jsxs(
|
|
1523
|
-
|
|
1568
|
+
te,
|
|
1524
1569
|
{
|
|
1525
|
-
colorScheme:
|
|
1526
|
-
onClick:
|
|
1527
|
-
isDisabled: D.length === 0 ||
|
|
1528
|
-
isLoading:
|
|
1529
|
-
loadingText: `${
|
|
1570
|
+
colorScheme: c === "copy" ? "blue" : "green",
|
|
1571
|
+
onClick: T,
|
|
1572
|
+
isDisabled: D.length === 0 || L,
|
|
1573
|
+
isLoading: L,
|
|
1574
|
+
loadingText: `${c === "copy" ? "Copying" : "Converting"}...`,
|
|
1530
1575
|
children: [
|
|
1531
|
-
|
|
1576
|
+
c === "copy" ? "Copy" : "Convert",
|
|
1532
1577
|
" ",
|
|
1533
|
-
D.length === 1 ?
|
|
1578
|
+
D.length === 1 ? o.singular : `${D.length} ${o.plural}`
|
|
1534
1579
|
]
|
|
1535
1580
|
}
|
|
1536
1581
|
)
|
|
1537
1582
|
] })
|
|
1538
1583
|
] }) });
|
|
1539
|
-
},
|
|
1540
|
-
const
|
|
1541
|
-
if (!
|
|
1584
|
+
}, $t = rn(void 0), Ee = () => {
|
|
1585
|
+
const s = an($t);
|
|
1586
|
+
if (!s)
|
|
1542
1587
|
throw new Error(
|
|
1543
1588
|
"useUpsertModuleFormContext must be used within a UpsertModuleFormProvider"
|
|
1544
1589
|
);
|
|
1545
|
-
return
|
|
1546
|
-
},
|
|
1547
|
-
name:
|
|
1548
|
-
setName:
|
|
1549
|
-
actions:
|
|
1590
|
+
return s;
|
|
1591
|
+
}, Wn = ({
|
|
1592
|
+
name: s,
|
|
1593
|
+
setName: t,
|
|
1594
|
+
actions: r,
|
|
1550
1595
|
moduleActionEntries: p,
|
|
1551
1596
|
setModuleActionEntries: m,
|
|
1552
1597
|
availableCategories: h,
|
|
1553
|
-
selectedCategoryIds:
|
|
1554
|
-
setSelectedCategoryIds:
|
|
1598
|
+
selectedCategoryIds: d,
|
|
1599
|
+
setSelectedCategoryIds: g,
|
|
1555
1600
|
description: n,
|
|
1556
|
-
setDescription:
|
|
1557
|
-
selectedMetadataIds:
|
|
1601
|
+
setDescription: o,
|
|
1602
|
+
selectedMetadataIds: u,
|
|
1558
1603
|
setSelectedMetadataIds: y,
|
|
1559
|
-
...
|
|
1604
|
+
...b
|
|
1560
1605
|
}) => {
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1606
|
+
const w = Kt(), I = $(() => {
|
|
1607
|
+
const v = {};
|
|
1608
|
+
return p.forEach((E) => {
|
|
1609
|
+
v[E.actionId] = (v[E.actionId] ?? 0) + 1;
|
|
1610
|
+
}), v;
|
|
1611
|
+
}, [p]), L = _(
|
|
1612
|
+
(v) => I[v] ?? 0,
|
|
1613
|
+
[I]
|
|
1614
|
+
), f = $(() => r.map((v) => ({
|
|
1615
|
+
...v,
|
|
1616
|
+
selected: (I[v.id] ?? 0) > 0
|
|
1617
|
+
})), [r, I]), c = $(() => r.reduce((v, E) => (v[E.id] = E, v), {}), [r]), k = _(
|
|
1618
|
+
(v, E) => {
|
|
1619
|
+
if (E) {
|
|
1620
|
+
const R = {
|
|
1568
1621
|
key: crypto.randomUUID(),
|
|
1569
|
-
actionId:
|
|
1622
|
+
actionId: v.id,
|
|
1570
1623
|
reportId: null
|
|
1571
1624
|
};
|
|
1572
|
-
m((
|
|
1625
|
+
m((O) => [...O, R]);
|
|
1573
1626
|
} else
|
|
1574
|
-
m(
|
|
1575
|
-
(
|
|
1576
|
-
|
|
1627
|
+
m((R) => {
|
|
1628
|
+
for (let O = R.length - 1; O >= 0; O--)
|
|
1629
|
+
if (R[O].actionId === v.id) {
|
|
1630
|
+
const K = [...R];
|
|
1631
|
+
return K.splice(O, 1), K;
|
|
1632
|
+
}
|
|
1633
|
+
return R;
|
|
1634
|
+
});
|
|
1577
1635
|
},
|
|
1578
1636
|
[m]
|
|
1579
|
-
),
|
|
1580
|
-
(
|
|
1581
|
-
|
|
1637
|
+
), x = _(
|
|
1638
|
+
(v) => {
|
|
1639
|
+
t(v.target.value);
|
|
1582
1640
|
},
|
|
1583
|
-
[
|
|
1584
|
-
),
|
|
1585
|
-
(
|
|
1586
|
-
|
|
1641
|
+
[t]
|
|
1642
|
+
), N = _(
|
|
1643
|
+
(v) => {
|
|
1644
|
+
o?.(v.target.value);
|
|
1587
1645
|
},
|
|
1588
|
-
[
|
|
1646
|
+
[o]
|
|
1589
1647
|
);
|
|
1590
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1591
|
-
/* @__PURE__ */ e.jsxs(
|
|
1592
|
-
/* @__PURE__ */ e.jsx(
|
|
1648
|
+
return /* @__PURE__ */ e.jsxs(se, { ...b, children: [
|
|
1649
|
+
/* @__PURE__ */ e.jsxs(V, { gap: "2rem", children: [
|
|
1650
|
+
/* @__PURE__ */ e.jsx(Qn, { name: s ?? "", onInputChange: x }),
|
|
1593
1651
|
/* @__PURE__ */ e.jsx(
|
|
1594
|
-
|
|
1652
|
+
qn,
|
|
1595
1653
|
{
|
|
1596
1654
|
availableCategories: h,
|
|
1597
|
-
value:
|
|
1598
|
-
onChange:
|
|
1655
|
+
value: d,
|
|
1656
|
+
onChange: g
|
|
1599
1657
|
}
|
|
1600
1658
|
)
|
|
1601
1659
|
] }),
|
|
1602
1660
|
/* @__PURE__ */ e.jsx(
|
|
1603
|
-
|
|
1661
|
+
Kn,
|
|
1604
1662
|
{
|
|
1605
1663
|
description: n ?? "",
|
|
1606
|
-
onInputChange:
|
|
1664
|
+
onInputChange: N
|
|
1607
1665
|
}
|
|
1608
1666
|
),
|
|
1609
1667
|
/* @__PURE__ */ e.jsx(
|
|
1610
|
-
|
|
1668
|
+
Xn,
|
|
1611
1669
|
{
|
|
1612
|
-
selectedMetadataIds:
|
|
1670
|
+
selectedMetadataIds: u,
|
|
1613
1671
|
setSelectedMetadataIds: y
|
|
1614
1672
|
}
|
|
1615
1673
|
),
|
|
1616
1674
|
/* @__PURE__ */ e.jsx(
|
|
1617
|
-
|
|
1675
|
+
Hn,
|
|
1618
1676
|
{
|
|
1619
1677
|
moduleActionEntries: p,
|
|
1620
1678
|
setModuleActionEntries: m,
|
|
1621
|
-
actionsById:
|
|
1622
|
-
onAdjustActivities: () =>
|
|
1679
|
+
actionsById: c,
|
|
1680
|
+
onAdjustActivities: () => w.onOpen()
|
|
1623
1681
|
}
|
|
1624
1682
|
),
|
|
1625
1683
|
/* @__PURE__ */ e.jsxs(
|
|
1626
|
-
|
|
1684
|
+
Ht,
|
|
1627
1685
|
{
|
|
1628
|
-
isOpen:
|
|
1629
|
-
onClose:
|
|
1686
|
+
isOpen: w.isOpen,
|
|
1687
|
+
onClose: w.onClose,
|
|
1630
1688
|
size: "6xl",
|
|
1631
1689
|
children: [
|
|
1632
1690
|
/* @__PURE__ */ e.jsx(Yt, {}),
|
|
1633
|
-
/* @__PURE__ */ e.jsxs(
|
|
1634
|
-
/* @__PURE__ */ e.jsx(
|
|
1635
|
-
/* @__PURE__ */ e.jsx(
|
|
1636
|
-
/* @__PURE__ */ e.jsx(
|
|
1637
|
-
|
|
1691
|
+
/* @__PURE__ */ e.jsxs(Jt, { children: [
|
|
1692
|
+
/* @__PURE__ */ e.jsx(Xt, { children: "Select Activities" }),
|
|
1693
|
+
/* @__PURE__ */ e.jsx(Zt, {}),
|
|
1694
|
+
/* @__PURE__ */ e.jsx(Vt, { children: /* @__PURE__ */ e.jsx(
|
|
1695
|
+
Un,
|
|
1638
1696
|
{
|
|
1639
|
-
actions:
|
|
1640
|
-
onSelected:
|
|
1697
|
+
actions: f,
|
|
1698
|
+
onSelected: k,
|
|
1699
|
+
allowDuplicateSelection: !0,
|
|
1700
|
+
getSelectedCount: L,
|
|
1641
1701
|
disableCreate: !0,
|
|
1642
1702
|
disableDelete: !0,
|
|
1643
1703
|
tableProps: {
|
|
@@ -1646,11 +1706,11 @@ const Tn = ({
|
|
|
1646
1706
|
}
|
|
1647
1707
|
}
|
|
1648
1708
|
) }),
|
|
1649
|
-
/* @__PURE__ */ e.jsx(
|
|
1650
|
-
|
|
1709
|
+
/* @__PURE__ */ e.jsx(en, { children: /* @__PURE__ */ e.jsx(
|
|
1710
|
+
te,
|
|
1651
1711
|
{
|
|
1652
1712
|
colorScheme: "blue",
|
|
1653
|
-
onClick:
|
|
1713
|
+
onClick: w.onClose,
|
|
1654
1714
|
isDisabled: p.length === 0,
|
|
1655
1715
|
children: "Done"
|
|
1656
1716
|
}
|
|
@@ -1660,46 +1720,40 @@ const Tn = ({
|
|
|
1660
1720
|
}
|
|
1661
1721
|
)
|
|
1662
1722
|
] });
|
|
1663
|
-
},
|
|
1723
|
+
}, Qn = Ae(
|
|
1664
1724
|
({
|
|
1665
|
-
name:
|
|
1666
|
-
onInputChange:
|
|
1725
|
+
name: s,
|
|
1726
|
+
onInputChange: t
|
|
1667
1727
|
}) => {
|
|
1668
|
-
const { getLabel:
|
|
1669
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1728
|
+
const { getLabel: r } = xe(), p = r("module"), { isView: m } = Ee();
|
|
1729
|
+
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
1670
1730
|
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1671
1731
|
p,
|
|
1672
1732
|
" Name"
|
|
1673
1733
|
] }),
|
|
1674
1734
|
/* @__PURE__ */ e.jsx(
|
|
1675
|
-
|
|
1735
|
+
ye,
|
|
1676
1736
|
{
|
|
1677
1737
|
placeholder: "i.e. ACL RTP Test Battery",
|
|
1678
|
-
value:
|
|
1679
|
-
onChange:
|
|
1738
|
+
value: s,
|
|
1739
|
+
onChange: t,
|
|
1680
1740
|
isRequired: !0,
|
|
1681
1741
|
isDisabled: m
|
|
1682
1742
|
}
|
|
1683
1743
|
)
|
|
1684
1744
|
] });
|
|
1685
1745
|
}
|
|
1686
|
-
),
|
|
1746
|
+
), qn = Ae(
|
|
1687
1747
|
({
|
|
1688
|
-
availableCategories:
|
|
1689
|
-
value:
|
|
1690
|
-
onChange:
|
|
1748
|
+
availableCategories: s,
|
|
1749
|
+
value: t,
|
|
1750
|
+
onChange: r
|
|
1691
1751
|
}) => {
|
|
1692
|
-
const { getLabel: p } = xe(), m = p("module"), { isView: h } =
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
}
|
|
1698
|
-
], [o]), b = T(() => c.map((n) => ({
|
|
1699
|
-
value: n.id,
|
|
1700
|
-
label: n.name
|
|
1701
|
-
})), [c]);
|
|
1702
|
-
return /* @__PURE__ */ e.jsxs(J, { mb: 4, children: [
|
|
1752
|
+
const { getLabel: p } = xe(), m = p("module"), { isView: h } = Ee(), d = $(() => s.map((g) => ({
|
|
1753
|
+
value: g.id,
|
|
1754
|
+
label: g.name
|
|
1755
|
+
})), [s]);
|
|
1756
|
+
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
1703
1757
|
/* @__PURE__ */ e.jsxs(ge, { children: [
|
|
1704
1758
|
m,
|
|
1705
1759
|
" Category"
|
|
@@ -1707,28 +1761,28 @@ const Tn = ({
|
|
|
1707
1761
|
/* @__PURE__ */ e.jsx(
|
|
1708
1762
|
he,
|
|
1709
1763
|
{
|
|
1710
|
-
isDisabled:
|
|
1711
|
-
options:
|
|
1712
|
-
value: s.
|
|
1713
|
-
value:
|
|
1714
|
-
label:
|
|
1715
|
-
}))[0],
|
|
1716
|
-
onChange: (
|
|
1764
|
+
isDisabled: s.length === 0 || h,
|
|
1765
|
+
options: d,
|
|
1766
|
+
value: s.filter((g) => t.includes(g.id)).map((g) => ({
|
|
1767
|
+
value: g.id,
|
|
1768
|
+
label: g.name
|
|
1769
|
+
}))[0] ?? null,
|
|
1770
|
+
onChange: (g) => r(g ? [g.value] : []),
|
|
1717
1771
|
placeholder: "Select category"
|
|
1718
1772
|
}
|
|
1719
1773
|
)
|
|
1720
1774
|
] });
|
|
1721
1775
|
}
|
|
1722
|
-
),
|
|
1776
|
+
), Kn = Ae(
|
|
1723
1777
|
({
|
|
1724
|
-
description:
|
|
1725
|
-
onInputChange:
|
|
1778
|
+
description: s,
|
|
1779
|
+
onInputChange: t
|
|
1726
1780
|
}) => {
|
|
1727
|
-
const { getLabel:
|
|
1728
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1781
|
+
const { getLabel: r } = xe(), p = r("module"), { isView: m } = Ee();
|
|
1782
|
+
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
1729
1783
|
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1730
1784
|
"Description",
|
|
1731
|
-
/* @__PURE__ */ e.jsxs(
|
|
1785
|
+
/* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", children: [
|
|
1732
1786
|
"Briefly describe the objective of this",
|
|
1733
1787
|
" ",
|
|
1734
1788
|
p.toLocaleLowerCase(),
|
|
@@ -1736,57 +1790,57 @@ const Tn = ({
|
|
|
1736
1790
|
] })
|
|
1737
1791
|
] }) }),
|
|
1738
1792
|
/* @__PURE__ */ e.jsx(
|
|
1739
|
-
|
|
1793
|
+
ye,
|
|
1740
1794
|
{
|
|
1741
1795
|
placeholder: "i.e. Assess readiness to return to play post-ACL reconstruction",
|
|
1742
|
-
value:
|
|
1743
|
-
onChange:
|
|
1796
|
+
value: s,
|
|
1797
|
+
onChange: t,
|
|
1744
1798
|
isDisabled: m
|
|
1745
1799
|
}
|
|
1746
1800
|
)
|
|
1747
1801
|
] });
|
|
1748
1802
|
}
|
|
1749
|
-
),
|
|
1803
|
+
), Hn = Ae(
|
|
1750
1804
|
({
|
|
1751
|
-
moduleActionEntries:
|
|
1752
|
-
setModuleActionEntries:
|
|
1753
|
-
actionsById:
|
|
1805
|
+
moduleActionEntries: s,
|
|
1806
|
+
setModuleActionEntries: t,
|
|
1807
|
+
actionsById: r,
|
|
1754
1808
|
onAdjustActivities: p
|
|
1755
1809
|
}) => {
|
|
1756
|
-
const { getLabel: m } = xe(), { isView: h } =
|
|
1810
|
+
const { getLabel: m } = xe(), { isView: h } = Ee(), d = $(() => ({
|
|
1757
1811
|
module: m("module"),
|
|
1758
1812
|
moduleLowerCase: m("module").toLocaleLowerCase(),
|
|
1759
1813
|
action: m("action"),
|
|
1760
1814
|
actionPlural: m("action_plural"),
|
|
1761
1815
|
actionPluralLowerCase: m("action_plural").toLocaleLowerCase()
|
|
1762
|
-
}), [m]),
|
|
1763
|
-
() =>
|
|
1764
|
-
const
|
|
1765
|
-
return
|
|
1816
|
+
}), [m]), g = $(
|
|
1817
|
+
() => s.map((n) => {
|
|
1818
|
+
const o = r[n.actionId];
|
|
1819
|
+
return o ? {
|
|
1766
1820
|
key: n.key,
|
|
1767
1821
|
actionId: n.actionId,
|
|
1768
|
-
name:
|
|
1769
|
-
reports:
|
|
1822
|
+
name: o.name,
|
|
1823
|
+
reports: A(Fe, o.reports) || [],
|
|
1770
1824
|
selectedReportId: n.reportId
|
|
1771
1825
|
} : null;
|
|
1772
1826
|
}).filter(Boolean),
|
|
1773
|
-
[
|
|
1827
|
+
[s, r]
|
|
1774
1828
|
);
|
|
1775
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1776
|
-
/* @__PURE__ */ e.jsxs(
|
|
1829
|
+
return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
1830
|
+
/* @__PURE__ */ e.jsxs(V, { justifyContent: "space-between", children: [
|
|
1777
1831
|
/* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
|
|
1778
|
-
|
|
1779
|
-
!h && /* @__PURE__ */ e.jsxs(
|
|
1832
|
+
d.actionPlural,
|
|
1833
|
+
!h && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", children: [
|
|
1780
1834
|
"Drag and drop to reorder the ",
|
|
1781
|
-
|
|
1835
|
+
d.actionPluralLowerCase,
|
|
1782
1836
|
" ",
|
|
1783
1837
|
"in this ",
|
|
1784
|
-
|
|
1838
|
+
d.moduleLowerCase,
|
|
1785
1839
|
"."
|
|
1786
1840
|
] })
|
|
1787
1841
|
] }) }),
|
|
1788
1842
|
!h && /* @__PURE__ */ e.jsxs(
|
|
1789
|
-
|
|
1843
|
+
te,
|
|
1790
1844
|
{
|
|
1791
1845
|
size: "sm",
|
|
1792
1846
|
variant: "solid",
|
|
@@ -1794,20 +1848,20 @@ const Tn = ({
|
|
|
1794
1848
|
onClick: p,
|
|
1795
1849
|
children: [
|
|
1796
1850
|
"Add / Remove ",
|
|
1797
|
-
|
|
1851
|
+
d.actionPlural
|
|
1798
1852
|
]
|
|
1799
1853
|
}
|
|
1800
1854
|
)
|
|
1801
1855
|
] }),
|
|
1802
|
-
|
|
1856
|
+
g.length === 0 ? /* @__PURE__ */ e.jsx(ue, { children: /* @__PURE__ */ e.jsxs(M, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
|
|
1803
1857
|
"No ",
|
|
1804
|
-
|
|
1858
|
+
d.actionPluralLowerCase,
|
|
1805
1859
|
" selected for this",
|
|
1806
1860
|
" ",
|
|
1807
|
-
|
|
1861
|
+
d.moduleLowerCase,
|
|
1808
1862
|
".",
|
|
1809
1863
|
!h && /* @__PURE__ */ e.jsxs(
|
|
1810
|
-
|
|
1864
|
+
te,
|
|
1811
1865
|
{
|
|
1812
1866
|
ml: "0.5em",
|
|
1813
1867
|
size: "sm",
|
|
@@ -1816,144 +1870,144 @@ const Tn = ({
|
|
|
1816
1870
|
onClick: p,
|
|
1817
1871
|
children: [
|
|
1818
1872
|
"Add ",
|
|
1819
|
-
|
|
1873
|
+
d.actionPluralLowerCase,
|
|
1820
1874
|
"."
|
|
1821
1875
|
]
|
|
1822
1876
|
}
|
|
1823
1877
|
)
|
|
1824
1878
|
] }) }) : /* @__PURE__ */ e.jsx(
|
|
1825
|
-
|
|
1879
|
+
Yn,
|
|
1826
1880
|
{
|
|
1827
|
-
value:
|
|
1881
|
+
value: g,
|
|
1828
1882
|
onChange: (n) => {
|
|
1829
|
-
|
|
1830
|
-
const
|
|
1831
|
-
const
|
|
1832
|
-
return
|
|
1833
|
-
key:
|
|
1834
|
-
actionId:
|
|
1835
|
-
name:
|
|
1836
|
-
reports:
|
|
1837
|
-
selectedReportId:
|
|
1883
|
+
t((o) => {
|
|
1884
|
+
const u = o.map((b) => {
|
|
1885
|
+
const w = r[b.actionId];
|
|
1886
|
+
return w ? {
|
|
1887
|
+
key: b.key,
|
|
1888
|
+
actionId: b.actionId,
|
|
1889
|
+
name: w.name,
|
|
1890
|
+
reports: A(Fe, w.reports) || [],
|
|
1891
|
+
selectedReportId: b.reportId
|
|
1838
1892
|
} : null;
|
|
1839
1893
|
}).filter(Boolean);
|
|
1840
|
-
return n(
|
|
1841
|
-
key:
|
|
1842
|
-
actionId:
|
|
1843
|
-
reportId:
|
|
1894
|
+
return n(u).map((b) => ({
|
|
1895
|
+
key: b.key,
|
|
1896
|
+
actionId: b.actionId,
|
|
1897
|
+
reportId: b.selectedReportId
|
|
1844
1898
|
}));
|
|
1845
1899
|
});
|
|
1846
1900
|
},
|
|
1847
1901
|
disabled: h,
|
|
1848
|
-
setModuleActionEntries:
|
|
1902
|
+
setModuleActionEntries: t
|
|
1849
1903
|
}
|
|
1850
1904
|
)
|
|
1851
1905
|
] });
|
|
1852
1906
|
}
|
|
1853
|
-
),
|
|
1907
|
+
), Yn = Ae(
|
|
1854
1908
|
({
|
|
1855
|
-
value:
|
|
1856
|
-
onChange:
|
|
1857
|
-
disabled:
|
|
1909
|
+
value: s,
|
|
1910
|
+
onChange: t,
|
|
1911
|
+
disabled: r,
|
|
1858
1912
|
setModuleActionEntries: p
|
|
1859
1913
|
}) => {
|
|
1860
|
-
const [m] =
|
|
1914
|
+
const [m] = q(
|
|
1861
1915
|
() => Math.random().toString(36).substring(2, 15)
|
|
1862
|
-
), h =
|
|
1863
|
-
(n,
|
|
1864
|
-
|
|
1865
|
-
const y = [...
|
|
1866
|
-
return y.splice(
|
|
1916
|
+
), h = _(
|
|
1917
|
+
(n, o) => {
|
|
1918
|
+
r || t((u) => {
|
|
1919
|
+
const y = [...u], [b] = y.splice(n, 1);
|
|
1920
|
+
return y.splice(o, 0, b), y;
|
|
1867
1921
|
});
|
|
1868
1922
|
},
|
|
1869
|
-
[
|
|
1870
|
-
),
|
|
1923
|
+
[t, r]
|
|
1924
|
+
), d = _(
|
|
1871
1925
|
(n) => {
|
|
1872
|
-
p((
|
|
1873
|
-
const
|
|
1874
|
-
if (
|
|
1875
|
-
const y =
|
|
1926
|
+
p((o) => {
|
|
1927
|
+
const u = o.findIndex((I) => I.key === n);
|
|
1928
|
+
if (u === -1) return o;
|
|
1929
|
+
const y = o[u], b = {
|
|
1876
1930
|
key: crypto.randomUUID(),
|
|
1877
1931
|
actionId: y.actionId,
|
|
1878
1932
|
reportId: null
|
|
1879
|
-
},
|
|
1880
|
-
return
|
|
1933
|
+
}, w = [...o];
|
|
1934
|
+
return w.splice(u + 1, 0, b), w;
|
|
1881
1935
|
});
|
|
1882
1936
|
},
|
|
1883
1937
|
[p]
|
|
1884
|
-
),
|
|
1938
|
+
), g = _(
|
|
1885
1939
|
(n) => {
|
|
1886
1940
|
p(
|
|
1887
|
-
(
|
|
1941
|
+
(o) => o.filter((u) => u.key !== n)
|
|
1888
1942
|
);
|
|
1889
1943
|
},
|
|
1890
1944
|
[p]
|
|
1891
1945
|
);
|
|
1892
|
-
return /* @__PURE__ */ e.jsx(
|
|
1893
|
-
|
|
1946
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(Sn, { backend: Ln, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: s.map((n, o) => /* @__PURE__ */ e.jsx(
|
|
1947
|
+
Jn,
|
|
1894
1948
|
{
|
|
1895
1949
|
listKey: m,
|
|
1896
1950
|
item: n,
|
|
1897
|
-
index:
|
|
1898
|
-
disabled: !!
|
|
1951
|
+
index: o,
|
|
1952
|
+
disabled: !!r,
|
|
1899
1953
|
move: h,
|
|
1900
|
-
onReportChange: (
|
|
1954
|
+
onReportChange: (u) => {
|
|
1901
1955
|
p(
|
|
1902
1956
|
(y) => y.map(
|
|
1903
|
-
(
|
|
1957
|
+
(b) => b.key === n.key ? { ...b, reportId: u } : b
|
|
1904
1958
|
)
|
|
1905
1959
|
);
|
|
1906
1960
|
},
|
|
1907
|
-
onDuplicate: () =>
|
|
1908
|
-
onRemove: () =>
|
|
1961
|
+
onDuplicate: () => d(n.key),
|
|
1962
|
+
onRemove: () => g(n.key)
|
|
1909
1963
|
},
|
|
1910
1964
|
n.key
|
|
1911
1965
|
)) }) }) });
|
|
1912
1966
|
}
|
|
1913
|
-
),
|
|
1967
|
+
), Jn = Ae(
|
|
1914
1968
|
({
|
|
1915
|
-
listKey:
|
|
1916
|
-
item:
|
|
1917
|
-
index:
|
|
1969
|
+
listKey: s,
|
|
1970
|
+
item: t,
|
|
1971
|
+
index: r,
|
|
1918
1972
|
disabled: p,
|
|
1919
1973
|
move: m,
|
|
1920
1974
|
onReportChange: h,
|
|
1921
|
-
onDuplicate:
|
|
1922
|
-
onRemove:
|
|
1975
|
+
onDuplicate: d,
|
|
1976
|
+
onRemove: g
|
|
1923
1977
|
}) => {
|
|
1924
|
-
const n = ln(null), { getLabel:
|
|
1925
|
-
accept:
|
|
1926
|
-
collect: (
|
|
1927
|
-
handlerId:
|
|
1978
|
+
const n = ln(null), { getLabel: o } = xe(), u = o("action"), [{ handlerId: y }, b] = kn({
|
|
1979
|
+
accept: s,
|
|
1980
|
+
collect: (x) => ({
|
|
1981
|
+
handlerId: x.getHandlerId()?.toString() ?? ""
|
|
1928
1982
|
}),
|
|
1929
|
-
hover: (
|
|
1983
|
+
hover: (x, N) => {
|
|
1930
1984
|
if (!n.current)
|
|
1931
1985
|
return;
|
|
1932
|
-
const
|
|
1933
|
-
if (
|
|
1986
|
+
const v = x.index, E = r;
|
|
1987
|
+
if (v === E)
|
|
1934
1988
|
return;
|
|
1935
|
-
const
|
|
1936
|
-
|
|
1989
|
+
const R = n.current?.getBoundingClientRect(), O = (R.bottom - R.top) / 2, oe = N.getClientOffset().y - R.top;
|
|
1990
|
+
v < E && oe < O || v > E && oe > O || (m(v, E), x.index = E);
|
|
1937
1991
|
}
|
|
1938
|
-
}), [{ isDragging:
|
|
1939
|
-
type:
|
|
1940
|
-
item: () => ({ id:
|
|
1941
|
-
collect: (
|
|
1942
|
-
isDragging:
|
|
1992
|
+
}), [{ isDragging: w }, I] = Mn({
|
|
1993
|
+
type: s,
|
|
1994
|
+
item: () => ({ id: t.key, index: r }),
|
|
1995
|
+
collect: (x) => ({
|
|
1996
|
+
isDragging: x.isDragging()
|
|
1943
1997
|
}),
|
|
1944
1998
|
canDrag: !p
|
|
1945
|
-
}),
|
|
1999
|
+
}), L = $(() => `action-report-label-${t.key}`, [t.key]), f = $(() => [
|
|
1946
2000
|
{ value: null, label: "No Report" },
|
|
1947
|
-
...
|
|
1948
|
-
const
|
|
2001
|
+
...t.reports.map((x) => {
|
|
2002
|
+
const N = x.name && x.name.length > 0 ? x.name : "No Name", v = ke(x.reportKind);
|
|
1949
2003
|
return {
|
|
1950
|
-
value:
|
|
1951
|
-
label: `${
|
|
2004
|
+
value: x.id,
|
|
2005
|
+
label: `${N} (${v})`
|
|
1952
2006
|
};
|
|
1953
2007
|
})
|
|
1954
|
-
], [
|
|
1955
|
-
return
|
|
1956
|
-
|
|
2008
|
+
], [t.reports]), c = w ? 0.6 : 1, k = p ? "default" : w ? "grabbing" : "grab";
|
|
2009
|
+
return I(b(n)), /* @__PURE__ */ e.jsx(
|
|
2010
|
+
se,
|
|
1957
2011
|
{
|
|
1958
2012
|
ref: n,
|
|
1959
2013
|
p: 3,
|
|
@@ -1961,55 +2015,55 @@ const Tn = ({
|
|
|
1961
2015
|
borderColor: "gray.200",
|
|
1962
2016
|
borderRadius: "md",
|
|
1963
2017
|
bg: "gray.50",
|
|
1964
|
-
style: { opacity:
|
|
2018
|
+
style: { opacity: c, cursor: k },
|
|
1965
2019
|
"data-handler-id": y,
|
|
1966
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1967
|
-
/* @__PURE__ */ e.jsxs(
|
|
1968
|
-
/* @__PURE__ */ e.jsxs(
|
|
1969
|
-
|
|
2020
|
+
children: /* @__PURE__ */ e.jsxs(V, { justify: "space-between", align: "center", children: [
|
|
2021
|
+
/* @__PURE__ */ e.jsxs(V, { spacing: 3, children: [
|
|
2022
|
+
/* @__PURE__ */ e.jsxs(M, { fontWeight: "semibold", minW: "2rem", children: [
|
|
2023
|
+
r + 1,
|
|
1970
2024
|
"."
|
|
1971
2025
|
] }),
|
|
1972
|
-
/* @__PURE__ */ e.jsx(
|
|
2026
|
+
/* @__PURE__ */ e.jsx(M, { fontWeight: "medium", children: t.name })
|
|
1973
2027
|
] }),
|
|
1974
|
-
/* @__PURE__ */ e.jsxs(
|
|
1975
|
-
/* @__PURE__ */ e.jsxs(
|
|
1976
|
-
|
|
2028
|
+
/* @__PURE__ */ e.jsxs(V, { spacing: 3, align: "center", children: [
|
|
2029
|
+
/* @__PURE__ */ e.jsxs(M, { id: L, fontSize: "sm", color: "gray.600", children: [
|
|
2030
|
+
u,
|
|
1977
2031
|
" Report:"
|
|
1978
2032
|
] }),
|
|
1979
|
-
/* @__PURE__ */ e.jsx(
|
|
2033
|
+
/* @__PURE__ */ e.jsx(se, { width: { base: "100%", md: "350px" }, children: /* @__PURE__ */ e.jsx(
|
|
1980
2034
|
he,
|
|
1981
2035
|
{
|
|
1982
|
-
"aria-labelledby":
|
|
1983
|
-
value:
|
|
1984
|
-
(
|
|
2036
|
+
"aria-labelledby": L,
|
|
2037
|
+
value: f.find(
|
|
2038
|
+
(x) => x.value === t.selectedReportId
|
|
1985
2039
|
),
|
|
1986
|
-
onChange: (
|
|
1987
|
-
h(
|
|
2040
|
+
onChange: (x) => {
|
|
2041
|
+
h(x?.value || null);
|
|
1988
2042
|
},
|
|
1989
|
-
options:
|
|
2043
|
+
options: f,
|
|
1990
2044
|
placeholder: "Select report...",
|
|
1991
2045
|
isDisabled: p
|
|
1992
2046
|
}
|
|
1993
2047
|
) }),
|
|
1994
|
-
!p && /* @__PURE__ */ e.jsxs(
|
|
2048
|
+
!p && /* @__PURE__ */ e.jsxs(V, { spacing: 1, children: [
|
|
1995
2049
|
/* @__PURE__ */ e.jsx(
|
|
1996
|
-
|
|
2050
|
+
te,
|
|
1997
2051
|
{
|
|
1998
2052
|
size: "xs",
|
|
1999
2053
|
variant: "ghost",
|
|
2000
2054
|
colorScheme: "blue",
|
|
2001
|
-
onClick:
|
|
2055
|
+
onClick: d,
|
|
2002
2056
|
title: "Add another instance with a different report",
|
|
2003
2057
|
children: "+ Duplicate"
|
|
2004
2058
|
}
|
|
2005
2059
|
),
|
|
2006
2060
|
/* @__PURE__ */ e.jsx(
|
|
2007
|
-
|
|
2061
|
+
te,
|
|
2008
2062
|
{
|
|
2009
2063
|
size: "xs",
|
|
2010
2064
|
variant: "ghost",
|
|
2011
2065
|
colorScheme: "red",
|
|
2012
|
-
onClick:
|
|
2066
|
+
onClick: g,
|
|
2013
2067
|
title: "Remove this entry",
|
|
2014
2068
|
children: "Remove"
|
|
2015
2069
|
}
|
|
@@ -2020,128 +2074,128 @@ const Tn = ({
|
|
|
2020
2074
|
}
|
|
2021
2075
|
);
|
|
2022
2076
|
}
|
|
2023
|
-
),
|
|
2077
|
+
), Xn = Ae(
|
|
2024
2078
|
({
|
|
2025
|
-
selectedMetadataIds:
|
|
2026
|
-
setSelectedMetadataIds:
|
|
2079
|
+
selectedMetadataIds: s,
|
|
2080
|
+
setSelectedMetadataIds: t
|
|
2027
2081
|
}) => {
|
|
2028
|
-
const { getLabel:
|
|
2082
|
+
const { getLabel: r } = xe(), { isView: p, metadataOptions: m } = Ee(), h = $(() => [
|
|
2029
2083
|
{
|
|
2030
2084
|
key: "activity_type",
|
|
2031
|
-
label: `${
|
|
2085
|
+
label: `${r("action")} Type`,
|
|
2032
2086
|
multi: !0
|
|
2033
2087
|
},
|
|
2034
2088
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
2035
2089
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
2036
2090
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
2037
|
-
], [
|
|
2038
|
-
(
|
|
2039
|
-
const
|
|
2040
|
-
if (!
|
|
2041
|
-
const
|
|
2042
|
-
|
|
2043
|
-
(
|
|
2044
|
-
(
|
|
2091
|
+
], [r]), d = _(
|
|
2092
|
+
(g, n) => {
|
|
2093
|
+
const o = h.find((y) => y.key === g);
|
|
2094
|
+
if (!o) return;
|
|
2095
|
+
const u = o.multi ? (n ?? []).map((y) => y.id) : n ? [n.id] : [];
|
|
2096
|
+
t((y) => [...y.filter((w) => Object.values(m || {}).flat().find((L) => L.id === w) && !Object.keys(m || {}).find(
|
|
2097
|
+
(L) => m?.[L]?.some(
|
|
2098
|
+
(f) => f.id === w && L === g
|
|
2045
2099
|
)
|
|
2046
|
-
)), ...
|
|
2100
|
+
)), ...u]);
|
|
2047
2101
|
},
|
|
2048
|
-
[h, m,
|
|
2102
|
+
[h, m, t]
|
|
2049
2103
|
);
|
|
2050
|
-
return m ? /* @__PURE__ */ e.jsxs(
|
|
2104
|
+
return m ? /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
|
|
2051
2105
|
/* @__PURE__ */ e.jsx(ge, { children: "Metadata Tags" }),
|
|
2052
|
-
/* @__PURE__ */ e.jsx(
|
|
2053
|
-
/* @__PURE__ */ e.jsx(
|
|
2106
|
+
/* @__PURE__ */ e.jsx(V, { gap: "1rem", align: "start", children: h.map((g) => /* @__PURE__ */ e.jsxs(X, { flex: "1", children: [
|
|
2107
|
+
/* @__PURE__ */ e.jsx(_e, { fontSize: "sm", children: g.label }),
|
|
2054
2108
|
/* @__PURE__ */ e.jsx(
|
|
2055
2109
|
he,
|
|
2056
2110
|
{
|
|
2057
|
-
isMulti:
|
|
2058
|
-
value: m[
|
|
2059
|
-
(n) =>
|
|
2111
|
+
isMulti: g.multi,
|
|
2112
|
+
value: m[g.key]?.filter(
|
|
2113
|
+
(n) => s.includes(n.id)
|
|
2060
2114
|
),
|
|
2061
2115
|
onChange: (n) => {
|
|
2062
|
-
|
|
2063
|
-
|
|
2116
|
+
d(
|
|
2117
|
+
g.key,
|
|
2064
2118
|
n
|
|
2065
2119
|
);
|
|
2066
2120
|
},
|
|
2067
|
-
options: m[
|
|
2068
|
-
placeholder: `Select ${
|
|
2121
|
+
options: m[g.key],
|
|
2122
|
+
placeholder: `Select ${g.multi ? "one or more" : "one"} ${g.label.toLowerCase()}`,
|
|
2069
2123
|
isDisabled: p,
|
|
2070
|
-
isClearable:
|
|
2124
|
+
isClearable: g.multi
|
|
2071
2125
|
}
|
|
2072
2126
|
)
|
|
2073
|
-
] },
|
|
2127
|
+
] }, g.key)) })
|
|
2074
2128
|
] }) : null;
|
|
2075
2129
|
}
|
|
2076
|
-
),
|
|
2077
|
-
value:
|
|
2078
|
-
onChange:
|
|
2079
|
-
forceKind:
|
|
2130
|
+
), Zn = ({
|
|
2131
|
+
value: s,
|
|
2132
|
+
onChange: t,
|
|
2133
|
+
forceKind: r,
|
|
2080
2134
|
disableRemove: p,
|
|
2081
2135
|
disableKind: m,
|
|
2082
2136
|
isDisabled: h,
|
|
2083
|
-
lockRanges:
|
|
2084
|
-
...
|
|
2137
|
+
lockRanges: d,
|
|
2138
|
+
...g
|
|
2085
2139
|
}) => {
|
|
2086
|
-
const n =
|
|
2087
|
-
const
|
|
2088
|
-
return
|
|
2089
|
-
}), [
|
|
2090
|
-
(
|
|
2091
|
-
const
|
|
2092
|
-
(
|
|
2140
|
+
const n = $(() => [...s].sort((b, w) => {
|
|
2141
|
+
const I = bt.indexOf(b.plane), L = bt.indexOf(w.plane);
|
|
2142
|
+
return I - L;
|
|
2143
|
+
}), [s]), o = _((b) => "segment" in b.id ? Nt(b.id.segment, b.plane, !0) ?? "Unknown" : Rt(b.id.joint, b.plane, !0) ?? "Unknown", []), u = _(
|
|
2144
|
+
(b, w) => {
|
|
2145
|
+
const I = n.findIndex(
|
|
2146
|
+
(f) => f.id === w.id && f.plane === w.plane
|
|
2093
2147
|
);
|
|
2094
|
-
let
|
|
2095
|
-
|
|
2096
|
-
...
|
|
2097
|
-
min:
|
|
2098
|
-
max:
|
|
2099
|
-
}))),
|
|
2148
|
+
let L = [...n];
|
|
2149
|
+
r && (w = { ...w, kind: r }), L[I] = w, d && (L = L.map((f) => ({
|
|
2150
|
+
...f,
|
|
2151
|
+
min: w.min,
|
|
2152
|
+
max: w.max
|
|
2153
|
+
}))), t(L);
|
|
2100
2154
|
},
|
|
2101
|
-
[
|
|
2102
|
-
), y =
|
|
2103
|
-
(
|
|
2104
|
-
const
|
|
2105
|
-
(
|
|
2155
|
+
[t, n, r, d]
|
|
2156
|
+
), y = _(
|
|
2157
|
+
(b) => {
|
|
2158
|
+
const w = n.filter(
|
|
2159
|
+
(I) => I.id !== b.id || I.plane !== b.plane
|
|
2106
2160
|
);
|
|
2107
|
-
|
|
2161
|
+
t(w);
|
|
2108
2162
|
},
|
|
2109
|
-
[
|
|
2163
|
+
[t, n]
|
|
2110
2164
|
);
|
|
2111
|
-
return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...
|
|
2112
|
-
|
|
2165
|
+
return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...g, children: n.map((b, w) => /* @__PURE__ */ e.jsx(
|
|
2166
|
+
Vn,
|
|
2113
2167
|
{
|
|
2114
|
-
label:
|
|
2115
|
-
parameter:
|
|
2116
|
-
onChange: (
|
|
2117
|
-
onRemove: p || h ? void 0 : () => y(
|
|
2118
|
-
forceKind:
|
|
2168
|
+
label: o(b),
|
|
2169
|
+
parameter: b,
|
|
2170
|
+
onChange: (I) => u(w, I),
|
|
2171
|
+
onRemove: p || h ? void 0 : () => y(b),
|
|
2172
|
+
forceKind: r,
|
|
2119
2173
|
disableKind: m || h,
|
|
2120
2174
|
isDisabled: h
|
|
2121
2175
|
},
|
|
2122
|
-
`${JSON.stringify(
|
|
2176
|
+
`${JSON.stringify(b.id)}-${b.plane}`
|
|
2123
2177
|
)) });
|
|
2124
|
-
},
|
|
2125
|
-
label:
|
|
2126
|
-
parameter:
|
|
2127
|
-
onChange:
|
|
2178
|
+
}, Vn = ({
|
|
2179
|
+
label: s,
|
|
2180
|
+
parameter: t,
|
|
2181
|
+
onChange: r,
|
|
2128
2182
|
onRemove: p,
|
|
2129
2183
|
forceKind: m,
|
|
2130
2184
|
disableKind: h,
|
|
2131
|
-
isDisabled:
|
|
2185
|
+
isDisabled: d
|
|
2132
2186
|
}) => {
|
|
2133
|
-
const
|
|
2134
|
-
(
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
) :
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2187
|
+
const g = _(
|
|
2188
|
+
(u) => "joint" in t.id ? An(
|
|
2189
|
+
t.id.joint,
|
|
2190
|
+
t.plane,
|
|
2191
|
+
u < 0 ? -1 : 1
|
|
2192
|
+
) : On(
|
|
2193
|
+
t.id.segment,
|
|
2194
|
+
t.plane,
|
|
2195
|
+
u < 0 ? -1 : 1
|
|
2142
2196
|
),
|
|
2143
|
-
[
|
|
2144
|
-
), { min: n, max:
|
|
2197
|
+
[t]
|
|
2198
|
+
), { min: n, max: o } = "joint" in t.id ? Tn(t.id.joint, t.plane) : { min: -180, max: 180 };
|
|
2145
2199
|
return /* @__PURE__ */ e.jsxs(
|
|
2146
2200
|
ue,
|
|
2147
2201
|
{
|
|
@@ -2153,37 +2207,37 @@ const Tn = ({
|
|
|
2153
2207
|
overflow: "hidden",
|
|
2154
2208
|
flexShrink: "0",
|
|
2155
2209
|
children: [
|
|
2156
|
-
/* @__PURE__ */ e.jsxs(
|
|
2210
|
+
/* @__PURE__ */ e.jsxs(V, { w: "100%", alignItems: "center", children: [
|
|
2157
2211
|
/* @__PURE__ */ e.jsx(
|
|
2158
|
-
|
|
2212
|
+
M,
|
|
2159
2213
|
{
|
|
2160
2214
|
fontSize: "sm",
|
|
2161
2215
|
flex: 1,
|
|
2162
2216
|
textTransform: "capitalize",
|
|
2163
2217
|
fontWeight: "semibold",
|
|
2164
|
-
children:
|
|
2218
|
+
children: s
|
|
2165
2219
|
}
|
|
2166
2220
|
),
|
|
2167
|
-
|
|
2168
|
-
/* @__PURE__ */ e.jsx(
|
|
2169
|
-
/* @__PURE__ */ e.jsx(
|
|
2221
|
+
t.sensorOnly ? /* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" }) : /* @__PURE__ */ e.jsxs(V, { spacing: 1, children: [
|
|
2222
|
+
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "blue", variant: "subtle", children: "Pose" }),
|
|
2223
|
+
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" })
|
|
2170
2224
|
] }),
|
|
2171
|
-
p && !
|
|
2172
|
-
|
|
2225
|
+
p && !d && /* @__PURE__ */ e.jsx(
|
|
2226
|
+
ot,
|
|
2173
2227
|
{
|
|
2174
2228
|
size: "xs",
|
|
2175
2229
|
variant: "ghost",
|
|
2176
2230
|
"aria-label": "delete",
|
|
2177
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2231
|
+
icon: /* @__PURE__ */ e.jsx(Ct, { as: In }),
|
|
2178
2232
|
onClick: p
|
|
2179
2233
|
}
|
|
2180
2234
|
),
|
|
2181
2235
|
!m && /* @__PURE__ */ e.jsx(
|
|
2182
|
-
|
|
2236
|
+
$n,
|
|
2183
2237
|
{
|
|
2184
|
-
selectedItem:
|
|
2185
|
-
onChange: ({ value:
|
|
2186
|
-
isDisabled: h ||
|
|
2238
|
+
selectedItem: t?.kind ?? Xe.Limit,
|
|
2239
|
+
onChange: ({ value: u }) => r({ ...t, kind: u }),
|
|
2240
|
+
isDisabled: h || d,
|
|
2187
2241
|
buttonProps: {
|
|
2188
2242
|
size: "sm",
|
|
2189
2243
|
variant: "outline",
|
|
@@ -2194,63 +2248,63 @@ const Tn = ({
|
|
|
2194
2248
|
colorScheme: "teal"
|
|
2195
2249
|
},
|
|
2196
2250
|
items: [
|
|
2197
|
-
{ value:
|
|
2198
|
-
{ value:
|
|
2251
|
+
{ value: Xe.Limit, label: "limit" },
|
|
2252
|
+
{ value: Xe.Target, label: "target" }
|
|
2199
2253
|
]
|
|
2200
2254
|
}
|
|
2201
2255
|
)
|
|
2202
2256
|
] }),
|
|
2203
2257
|
/* @__PURE__ */ e.jsx(
|
|
2204
|
-
|
|
2258
|
+
Dn,
|
|
2205
2259
|
{
|
|
2206
2260
|
w: "100%",
|
|
2207
2261
|
size: "xs",
|
|
2208
2262
|
min: n,
|
|
2209
|
-
max:
|
|
2263
|
+
max: o,
|
|
2210
2264
|
zeroMarker: !0,
|
|
2211
|
-
value: [
|
|
2212
|
-
onChange: (
|
|
2213
|
-
formatValue: (
|
|
2214
|
-
valueLabel: (
|
|
2215
|
-
positiveNegativeLabels:
|
|
2216
|
-
isDisabled:
|
|
2265
|
+
value: [t.min, t.max],
|
|
2266
|
+
onChange: (u) => r({ ...t, min: u[0], max: u[1] }),
|
|
2267
|
+
formatValue: (u) => `${Math.abs(u)}°`,
|
|
2268
|
+
valueLabel: (u) => g(u) ?? "",
|
|
2269
|
+
positiveNegativeLabels: g(0) ? [g(-1) ?? "", g(1) ?? ""] : void 0,
|
|
2270
|
+
isDisabled: d
|
|
2217
2271
|
}
|
|
2218
2272
|
)
|
|
2219
2273
|
]
|
|
2220
2274
|
}
|
|
2221
2275
|
);
|
|
2222
|
-
},
|
|
2223
|
-
options:
|
|
2224
|
-
value:
|
|
2225
|
-
onChange:
|
|
2276
|
+
}, He = (s, t) => "segment" in s && "segment" in t && s.segment === t.segment || "joint" in s && "joint" in t && s.joint === t.joint, yt = ({
|
|
2277
|
+
options: s,
|
|
2278
|
+
value: t,
|
|
2279
|
+
onChange: r,
|
|
2226
2280
|
forceKind: p,
|
|
2227
2281
|
singleValue: m,
|
|
2228
2282
|
singleValueSideless: h,
|
|
2229
|
-
editOnly:
|
|
2230
|
-
disableKind:
|
|
2283
|
+
editOnly: d,
|
|
2284
|
+
disableKind: g,
|
|
2231
2285
|
maxParameters: n,
|
|
2232
|
-
...
|
|
2286
|
+
...o
|
|
2233
2287
|
}) => {
|
|
2234
|
-
const
|
|
2235
|
-
const
|
|
2236
|
-
return
|
|
2237
|
-
const
|
|
2238
|
-
let
|
|
2239
|
-
if (
|
|
2240
|
-
const
|
|
2241
|
-
|
|
2242
|
-
label:
|
|
2288
|
+
const u = h ? 2 : n, y = $(() => {
|
|
2289
|
+
const f = /* @__PURE__ */ new Map();
|
|
2290
|
+
return s.forEach((c) => {
|
|
2291
|
+
const k = "joint" in c.id;
|
|
2292
|
+
let x, N;
|
|
2293
|
+
if (k ? (x = Rt(c.id.joint, c.plane, !0) ?? "Unknown", N = `joint:${c.id.joint}`) : (x = Nt(c.id.segment, c.plane, !0) ?? "Unknown", N = `segment:${c.id.segment}`), !f.has(N)) {
|
|
2294
|
+
const R = k ? ft(c.id.joint) ?? "Unknown Joint" : ft(c.id.segment) ?? "Unknown Segment";
|
|
2295
|
+
f.set(N, {
|
|
2296
|
+
label: R,
|
|
2243
2297
|
options: []
|
|
2244
2298
|
});
|
|
2245
2299
|
}
|
|
2246
|
-
const
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
].filter(Boolean).map((
|
|
2251
|
-
|
|
2300
|
+
const v = f.get(N), E = [
|
|
2301
|
+
x,
|
|
2302
|
+
k ? c.id.joint : c.id.segment,
|
|
2303
|
+
c.plane
|
|
2304
|
+
].filter(Boolean).map((R) => String(R).toLowerCase().replace(/\s+|_/g, ""));
|
|
2305
|
+
v.options.push({
|
|
2252
2306
|
label: /* @__PURE__ */ e.jsxs(
|
|
2253
|
-
|
|
2307
|
+
V,
|
|
2254
2308
|
{
|
|
2255
2309
|
spacing: 2,
|
|
2256
2310
|
justify: "space-between",
|
|
@@ -2258,98 +2312,98 @@ const Tn = ({
|
|
|
2258
2312
|
w: "100%",
|
|
2259
2313
|
pl: 3,
|
|
2260
2314
|
children: [
|
|
2261
|
-
/* @__PURE__ */ e.jsx(
|
|
2262
|
-
|
|
2263
|
-
/* @__PURE__ */ e.jsx(
|
|
2264
|
-
/* @__PURE__ */ e.jsx(
|
|
2315
|
+
/* @__PURE__ */ e.jsx(M, { children: x }),
|
|
2316
|
+
c.sensorOnly ? /* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" }) : /* @__PURE__ */ e.jsxs(V, { spacing: 1, children: [
|
|
2317
|
+
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "blue", variant: "subtle", children: "Pose" }),
|
|
2318
|
+
/* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" })
|
|
2265
2319
|
] })
|
|
2266
2320
|
]
|
|
2267
2321
|
}
|
|
2268
2322
|
),
|
|
2269
|
-
value:
|
|
2270
|
-
plane:
|
|
2271
|
-
sensorOnly:
|
|
2272
|
-
searchTokens:
|
|
2323
|
+
value: c.id,
|
|
2324
|
+
plane: c.plane,
|
|
2325
|
+
sensorOnly: c.sensorOnly,
|
|
2326
|
+
searchTokens: E
|
|
2273
2327
|
});
|
|
2274
|
-
}), Array.from(
|
|
2275
|
-
}, [
|
|
2276
|
-
if (!h ||
|
|
2328
|
+
}), Array.from(f.values());
|
|
2329
|
+
}, [s]), b = $(() => {
|
|
2330
|
+
if (!h || t.length === 0)
|
|
2277
2331
|
return y;
|
|
2278
|
-
const
|
|
2279
|
-
return y.map((
|
|
2280
|
-
...
|
|
2281
|
-
options:
|
|
2282
|
-
(
|
|
2332
|
+
const f = t[0];
|
|
2333
|
+
return y.map((c) => ({
|
|
2334
|
+
...c,
|
|
2335
|
+
options: c.options.filter(
|
|
2336
|
+
(k) => qe(k.value) === qe(f.id) && k.plane === f.plane
|
|
2283
2337
|
)
|
|
2284
|
-
})).filter((
|
|
2285
|
-
}, [y,
|
|
2286
|
-
(
|
|
2287
|
-
), [y,
|
|
2288
|
-
if (!
|
|
2289
|
-
const
|
|
2290
|
-
return !
|
|
2291
|
-
(
|
|
2338
|
+
})).filter((c) => c.options.length > 0);
|
|
2339
|
+
}, [y, t, h]), w = $(() => y.flatMap((c) => c.options).filter(
|
|
2340
|
+
(c) => t.some((k) => He(k.id, c.value) && k.plane === c.plane)
|
|
2341
|
+
), [y, t]), I = _((f, c) => {
|
|
2342
|
+
if (!c) return !0;
|
|
2343
|
+
const k = c.toLowerCase().replace(/\s+|_/g, ""), x = f.data;
|
|
2344
|
+
return !x || !x.searchTokens ? !1 : x.searchTokens.some(
|
|
2345
|
+
(N) => N.includes(k)
|
|
2292
2346
|
);
|
|
2293
|
-
}, []),
|
|
2294
|
-
(
|
|
2295
|
-
const
|
|
2296
|
-
const
|
|
2297
|
-
(
|
|
2298
|
-
),
|
|
2299
|
-
(
|
|
2300
|
-
),
|
|
2301
|
-
(
|
|
2302
|
-
) : void 0,
|
|
2303
|
-
return
|
|
2304
|
-
id:
|
|
2305
|
-
plane:
|
|
2306
|
-
min:
|
|
2307
|
-
max:
|
|
2308
|
-
sensorOnly:
|
|
2309
|
-
kind: p ??
|
|
2347
|
+
}, []), L = _(
|
|
2348
|
+
(f) => {
|
|
2349
|
+
const c = f.map((k) => {
|
|
2350
|
+
const x = t.find(
|
|
2351
|
+
(O) => He(O.id, k.value) && O.plane === k.plane
|
|
2352
|
+
), N = s.find(
|
|
2353
|
+
(O) => He(O.id, k.value) && O.plane === k.plane
|
|
2354
|
+
), v = h ? t.find(
|
|
2355
|
+
(O) => qe(O.id) === qe(k.value) && O.plane === k.plane
|
|
2356
|
+
) : void 0, E = v && !x ? v.min : N && N.min ? N.min : 0, R = v && !x ? v.max : N && N.max ? N.max : 0;
|
|
2357
|
+
return x ?? {
|
|
2358
|
+
id: k.value,
|
|
2359
|
+
plane: k.plane,
|
|
2360
|
+
min: E,
|
|
2361
|
+
max: R,
|
|
2362
|
+
sensorOnly: k.sensorOnly,
|
|
2363
|
+
kind: p ?? Xe.Limit
|
|
2310
2364
|
};
|
|
2311
2365
|
});
|
|
2312
|
-
|
|
2366
|
+
r(c);
|
|
2313
2367
|
},
|
|
2314
|
-
[
|
|
2368
|
+
[r, t, s, p, h]
|
|
2315
2369
|
);
|
|
2316
2370
|
return ce(() => {
|
|
2317
|
-
const
|
|
2318
|
-
(
|
|
2371
|
+
const f = t.filter(
|
|
2372
|
+
(c) => s.some((k) => He(k.id, c.id) && k.plane === c.plane)
|
|
2319
2373
|
);
|
|
2320
|
-
|
|
2321
|
-
}, [
|
|
2374
|
+
f.length !== t.length && r(f);
|
|
2375
|
+
}, [s, r, t]), /* @__PURE__ */ e.jsxs(se, { ...o, children: [
|
|
2322
2376
|
/* @__PURE__ */ e.jsx(
|
|
2323
2377
|
he,
|
|
2324
2378
|
{
|
|
2325
2379
|
isMulti: !m,
|
|
2326
|
-
placeholder:
|
|
2327
|
-
value:
|
|
2328
|
-
isDisabled:
|
|
2329
|
-
onChange: (
|
|
2330
|
-
options:
|
|
2380
|
+
placeholder: t.length ? `${t.length} selected` : "Search...",
|
|
2381
|
+
value: w,
|
|
2382
|
+
isDisabled: d || w.length >= (u ?? 1 / 0),
|
|
2383
|
+
onChange: (f) => Array.isArray(f) ? L([...f]) : L(f !== null ? [f] : []),
|
|
2384
|
+
options: b,
|
|
2331
2385
|
controlShouldRenderValue: !1,
|
|
2332
|
-
formatOptionLabel: (
|
|
2333
|
-
filterOption:
|
|
2386
|
+
formatOptionLabel: (f) => f.label,
|
|
2387
|
+
filterOption: I,
|
|
2334
2388
|
isSearchable: !0
|
|
2335
2389
|
}
|
|
2336
2390
|
),
|
|
2337
2391
|
/* @__PURE__ */ e.jsx(
|
|
2338
|
-
|
|
2392
|
+
Zn,
|
|
2339
2393
|
{
|
|
2340
2394
|
marginTop: 2,
|
|
2341
2395
|
maxH: "28rem",
|
|
2342
|
-
value:
|
|
2343
|
-
onChange:
|
|
2396
|
+
value: t,
|
|
2397
|
+
onChange: r,
|
|
2344
2398
|
forceKind: p,
|
|
2345
|
-
disableKind:
|
|
2346
|
-
isDisabled:
|
|
2399
|
+
disableKind: g,
|
|
2400
|
+
isDisabled: d,
|
|
2347
2401
|
lockRanges: h
|
|
2348
2402
|
}
|
|
2349
2403
|
)
|
|
2350
2404
|
] });
|
|
2351
|
-
},
|
|
2352
|
-
switch (
|
|
2405
|
+
}, vt = (s) => {
|
|
2406
|
+
switch (s) {
|
|
2353
2407
|
case me.Thorax:
|
|
2354
2408
|
return "Thorax";
|
|
2355
2409
|
case me.CenterBack:
|
|
@@ -2379,41 +2433,41 @@ const Tn = ({
|
|
|
2379
2433
|
case me.Head:
|
|
2380
2434
|
return "Head";
|
|
2381
2435
|
}
|
|
2382
|
-
},
|
|
2383
|
-
id:
|
|
2384
|
-
onError:
|
|
2385
|
-
onCancel:
|
|
2436
|
+
}, vs = ({
|
|
2437
|
+
id: s,
|
|
2438
|
+
onError: t,
|
|
2439
|
+
onCancel: r,
|
|
2386
2440
|
onSave: p,
|
|
2387
2441
|
hideButtons: m,
|
|
2388
2442
|
setButtonOnClick: h,
|
|
2389
|
-
setButtonDisabled:
|
|
2390
|
-
quantumOwned:
|
|
2443
|
+
setButtonDisabled: d,
|
|
2444
|
+
quantumOwned: g,
|
|
2391
2445
|
isView: n
|
|
2392
2446
|
}) => {
|
|
2393
|
-
const
|
|
2447
|
+
const o = lt(), [{ fetching: u }, y] = fe(it), [{ fetching: b }, w] = fe(un), [{ data: I }] = Ce({
|
|
2394
2448
|
query: mn,
|
|
2395
|
-
variables: { id:
|
|
2396
|
-
pause: !
|
|
2397
|
-
}),
|
|
2398
|
-
const
|
|
2399
|
-
|
|
2400
|
-
|
|
2449
|
+
variables: { id: s ?? "" },
|
|
2450
|
+
pause: !s
|
|
2451
|
+
}), L = $(() => {
|
|
2452
|
+
const j = A(
|
|
2453
|
+
ve,
|
|
2454
|
+
I?.getActionById
|
|
2401
2455
|
);
|
|
2402
|
-
if (!
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2405
|
-
thresholds:
|
|
2456
|
+
if (!j) return null;
|
|
2457
|
+
const P = (A(Fe, j.reports) || []).map((F) => ({
|
|
2458
|
+
...F,
|
|
2459
|
+
thresholds: A(Te, F.thresholds)
|
|
2406
2460
|
}));
|
|
2407
2461
|
return {
|
|
2408
|
-
...
|
|
2409
|
-
thresholds:
|
|
2410
|
-
reports:
|
|
2462
|
+
...j,
|
|
2463
|
+
thresholds: A(Te, j.thresholds),
|
|
2464
|
+
reports: P
|
|
2411
2465
|
};
|
|
2412
|
-
}, [
|
|
2413
|
-
action:
|
|
2414
|
-
}), [
|
|
2466
|
+
}, [I]), f = u || b, c = !!L && !!s, { getLabel: k } = xe(), x = $(() => ({
|
|
2467
|
+
action: k("action")
|
|
2468
|
+
}), [k]), N = $(() => [
|
|
2415
2469
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
2416
|
-
{ key: "activity_type", label: `${
|
|
2470
|
+
{ key: "activity_type", label: `${x.action} Type`, multi: !1 },
|
|
2417
2471
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
2418
2472
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
2419
2473
|
{ key: "sport", label: "Sport", multi: !0 },
|
|
@@ -2422,277 +2476,277 @@ const Tn = ({
|
|
|
2422
2476
|
label: "Activity Motion Direction",
|
|
2423
2477
|
multi: !0
|
|
2424
2478
|
}
|
|
2425
|
-
], [
|
|
2479
|
+
], [x.action]), [v, E] = q(""), [R, O] = q(""), [K, oe] = q(""), [D, ae] = q(""), [Z, T] = q([]), [B, J] = q({}), [U, Y] = q(null), [i, a] = q(""), [C, l] = q([]), [S, W] = q([]), [G, Q] = q(""), [H, re] = q([]), we = fn(), Ie = $(() => we.filter((j) => j.sensorOnly), [we]), Se = [
|
|
2426
2480
|
{
|
|
2427
|
-
label:
|
|
2428
|
-
value:
|
|
2481
|
+
label: ke(ie.GeneralActivity),
|
|
2482
|
+
value: ie.GeneralActivity
|
|
2429
2483
|
},
|
|
2430
2484
|
{
|
|
2431
|
-
label:
|
|
2432
|
-
value:
|
|
2485
|
+
label: ke(ie.MovementCoordination),
|
|
2486
|
+
value: ie.MovementCoordination
|
|
2433
2487
|
},
|
|
2434
|
-
{ label:
|
|
2488
|
+
{ label: ke(ie.Range), value: ie.Range },
|
|
2435
2489
|
{
|
|
2436
|
-
label:
|
|
2437
|
-
value:
|
|
2490
|
+
label: ke(ie.StabilityBalance),
|
|
2491
|
+
value: ie.StabilityBalance
|
|
2438
2492
|
},
|
|
2439
2493
|
{
|
|
2440
|
-
label:
|
|
2441
|
-
value:
|
|
2494
|
+
label: ke(ie.PointOfInterest),
|
|
2495
|
+
value: ie.PointOfInterest
|
|
2442
2496
|
}
|
|
2443
|
-
],
|
|
2497
|
+
], ze = $(() => v.trim().length > 0, [v]), [Be, tt] = q({});
|
|
2444
2498
|
ce(() => {
|
|
2445
|
-
const
|
|
2446
|
-
(
|
|
2499
|
+
const j = N.map(
|
|
2500
|
+
(z) => o.query(at, { key: z.key })
|
|
2447
2501
|
);
|
|
2448
|
-
Promise.all(
|
|
2449
|
-
const
|
|
2450
|
-
|
|
2451
|
-
if (
|
|
2452
|
-
const
|
|
2502
|
+
Promise.all(j).then((z) => {
|
|
2503
|
+
const P = {};
|
|
2504
|
+
z.forEach((F) => {
|
|
2505
|
+
if (F.error || !F.data) return;
|
|
2506
|
+
const ne = A(
|
|
2453
2507
|
je,
|
|
2454
|
-
|
|
2455
|
-
),
|
|
2508
|
+
F.data.getMetadataByKey
|
|
2509
|
+
), ee = A(
|
|
2456
2510
|
be,
|
|
2457
|
-
|
|
2511
|
+
ne.data
|
|
2458
2512
|
);
|
|
2459
|
-
|
|
2513
|
+
P[ne.key] = ee.map((de) => ({
|
|
2460
2514
|
label: de.label || de.value,
|
|
2461
2515
|
value: de.value,
|
|
2462
2516
|
id: de.id
|
|
2463
2517
|
}));
|
|
2464
|
-
}),
|
|
2518
|
+
}), J(P);
|
|
2465
2519
|
});
|
|
2466
|
-
}, [
|
|
2467
|
-
if (
|
|
2468
|
-
const
|
|
2520
|
+
}, [o, N]), ce(() => {
|
|
2521
|
+
if (L) {
|
|
2522
|
+
const z = A(
|
|
2469
2523
|
je,
|
|
2470
|
-
|
|
2524
|
+
L.metadataGroups
|
|
2471
2525
|
).map(
|
|
2472
|
-
(
|
|
2473
|
-
),
|
|
2474
|
-
id:
|
|
2475
|
-
name:
|
|
2476
|
-
instructions:
|
|
2477
|
-
kind:
|
|
2478
|
-
autoGenerate:
|
|
2479
|
-
parameters:
|
|
2526
|
+
(ne) => ne.data.map((ee) => A(be, ee).id)
|
|
2527
|
+
), P = L.reports.map((ne) => ({
|
|
2528
|
+
id: ne.id,
|
|
2529
|
+
name: ne.name ?? "",
|
|
2530
|
+
instructions: ne.instructions ?? "",
|
|
2531
|
+
kind: ne.reportKind,
|
|
2532
|
+
autoGenerate: ne.autoGenerate ?? !1,
|
|
2533
|
+
parameters: ne.thresholds.map((ee) => ({
|
|
2480
2534
|
id: {
|
|
2481
|
-
[
|
|
2535
|
+
[ee.partKind]: ee.partId
|
|
2482
2536
|
},
|
|
2483
|
-
kind:
|
|
2484
|
-
min:
|
|
2485
|
-
max:
|
|
2486
|
-
plane:
|
|
2487
|
-
oldId:
|
|
2488
|
-
sensorOnly:
|
|
2489
|
-
const
|
|
2490
|
-
return
|
|
2537
|
+
kind: ee.kind,
|
|
2538
|
+
min: ee.min,
|
|
2539
|
+
max: ee.max,
|
|
2540
|
+
plane: ee.partDimension,
|
|
2541
|
+
oldId: ee.id,
|
|
2542
|
+
sensorOnly: Ie.some((de) => {
|
|
2543
|
+
const nt = de.id[ee.partKind];
|
|
2544
|
+
return nt ? nt === ee.partId && de.plane === ee.partDimension : !1;
|
|
2491
2545
|
})
|
|
2492
2546
|
})),
|
|
2493
|
-
sensorLocations:
|
|
2494
|
-
})),
|
|
2495
|
-
name:
|
|
2496
|
-
description:
|
|
2497
|
-
cameraPlacement:
|
|
2498
|
-
videoLink:
|
|
2499
|
-
metadataIds:
|
|
2500
|
-
reports:
|
|
2547
|
+
sensorLocations: ne.sensorLocations
|
|
2548
|
+
})), F = {
|
|
2549
|
+
name: L.name,
|
|
2550
|
+
description: L.description || "",
|
|
2551
|
+
cameraPlacement: L.cameraPlacement || "",
|
|
2552
|
+
videoLink: L.videoLink || "",
|
|
2553
|
+
metadataIds: z.flat(),
|
|
2554
|
+
reports: P
|
|
2501
2555
|
};
|
|
2502
|
-
|
|
2556
|
+
E(F.name), O(F.description), oe(F.cameraPlacement), ae(F.videoLink), T(F.metadataIds), re(P), tt(F);
|
|
2503
2557
|
}
|
|
2504
|
-
}, [
|
|
2505
|
-
const
|
|
2506
|
-
() => JSON.stringify(
|
|
2507
|
-
name:
|
|
2508
|
-
description:
|
|
2509
|
-
cameraPlacement:
|
|
2558
|
+
}, [L]);
|
|
2559
|
+
const Re = $(
|
|
2560
|
+
() => JSON.stringify(Be) !== JSON.stringify({
|
|
2561
|
+
name: v,
|
|
2562
|
+
description: R,
|
|
2563
|
+
cameraPlacement: K,
|
|
2510
2564
|
videoLink: D,
|
|
2511
|
-
metadataIds:
|
|
2565
|
+
metadataIds: Z,
|
|
2512
2566
|
reports: H
|
|
2513
2567
|
}),
|
|
2514
2568
|
[
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2569
|
+
Be,
|
|
2570
|
+
v,
|
|
2571
|
+
R,
|
|
2572
|
+
K,
|
|
2519
2573
|
D,
|
|
2520
|
-
|
|
2574
|
+
Z,
|
|
2521
2575
|
H
|
|
2522
2576
|
]
|
|
2523
|
-
),
|
|
2524
|
-
const
|
|
2525
|
-
name:
|
|
2526
|
-
description:
|
|
2527
|
-
cameraPlacement:
|
|
2577
|
+
), Le = _(() => {
|
|
2578
|
+
const j = {
|
|
2579
|
+
name: v,
|
|
2580
|
+
description: R,
|
|
2581
|
+
cameraPlacement: K,
|
|
2528
2582
|
videoLink: D,
|
|
2529
|
-
metadataItemIds:
|
|
2583
|
+
metadataItemIds: Z,
|
|
2530
2584
|
// Backend requires laterality; keep existing default since UI no longer edits it
|
|
2531
|
-
laterality:
|
|
2532
|
-
quantumOwned:
|
|
2585
|
+
laterality: Nn.Either,
|
|
2586
|
+
quantumOwned: g,
|
|
2533
2587
|
//Backend requires session type; keep existing default since UI no longer edits it
|
|
2534
2588
|
sessionType: [],
|
|
2535
2589
|
// Backend requires thresholds; use empty array since reports handle parameters now
|
|
2536
2590
|
thresholds: [],
|
|
2537
2591
|
// Include reports data
|
|
2538
|
-
reports: H.map((
|
|
2539
|
-
id:
|
|
2540
|
-
name:
|
|
2541
|
-
reportKind:
|
|
2542
|
-
sensorLocations:
|
|
2543
|
-
instructions:
|
|
2544
|
-
autoGenerate:
|
|
2545
|
-
thresholds:
|
|
2546
|
-
id:
|
|
2547
|
-
kind:
|
|
2548
|
-
min:
|
|
2549
|
-
max:
|
|
2550
|
-
partKind: "joint" in
|
|
2551
|
-
partId: "joint" in
|
|
2552
|
-
partDimension:
|
|
2592
|
+
reports: H.map((P) => ({
|
|
2593
|
+
id: P.isNew ? void 0 : P.id,
|
|
2594
|
+
name: P.name,
|
|
2595
|
+
reportKind: P.kind,
|
|
2596
|
+
sensorLocations: P.sensorLocations,
|
|
2597
|
+
instructions: P.instructions,
|
|
2598
|
+
autoGenerate: P.autoGenerate ?? !1,
|
|
2599
|
+
thresholds: P.parameters.map((F) => ({
|
|
2600
|
+
id: F.oldId,
|
|
2601
|
+
kind: F.kind,
|
|
2602
|
+
min: F.min,
|
|
2603
|
+
max: F.max,
|
|
2604
|
+
partKind: "joint" in F.id ? "joint" : "segment",
|
|
2605
|
+
partId: "joint" in F.id ? F.id.joint : F.id.segment,
|
|
2606
|
+
partDimension: F.plane
|
|
2553
2607
|
}))
|
|
2554
2608
|
}))
|
|
2555
2609
|
};
|
|
2556
|
-
let
|
|
2557
|
-
|
|
2558
|
-
id:
|
|
2559
|
-
fields:
|
|
2560
|
-
}) :
|
|
2561
|
-
fields:
|
|
2562
|
-
}),
|
|
2563
|
-
|
|
2610
|
+
let z;
|
|
2611
|
+
c && s ? z = w({
|
|
2612
|
+
id: s,
|
|
2613
|
+
fields: j
|
|
2614
|
+
}) : z = y({
|
|
2615
|
+
fields: j
|
|
2616
|
+
}), z.then(({ error: P }) => {
|
|
2617
|
+
P ? t(P) : p();
|
|
2564
2618
|
});
|
|
2565
2619
|
}, [
|
|
2566
|
-
|
|
2620
|
+
g,
|
|
2567
2621
|
y,
|
|
2622
|
+
w,
|
|
2623
|
+
s,
|
|
2568
2624
|
v,
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
A,
|
|
2572
|
-
X,
|
|
2625
|
+
R,
|
|
2626
|
+
K,
|
|
2573
2627
|
D,
|
|
2574
|
-
|
|
2628
|
+
Z,
|
|
2575
2629
|
H,
|
|
2576
|
-
|
|
2630
|
+
c,
|
|
2577
2631
|
p,
|
|
2578
|
-
|
|
2632
|
+
t
|
|
2579
2633
|
]);
|
|
2580
2634
|
ce(() => {
|
|
2581
|
-
|
|
2582
|
-
cancelButton:
|
|
2583
|
-
saveButton: n ? !0 :
|
|
2635
|
+
d && d({
|
|
2636
|
+
cancelButton: f,
|
|
2637
|
+
saveButton: n ? !0 : f || !ze || !Re
|
|
2584
2638
|
});
|
|
2585
|
-
}, [
|
|
2639
|
+
}, [f, d, ze, Re, n]), ce(() => {
|
|
2586
2640
|
h && h({
|
|
2587
|
-
cancelButton:
|
|
2641
|
+
cancelButton: r,
|
|
2588
2642
|
saveButton: n ? () => {
|
|
2589
|
-
} :
|
|
2643
|
+
} : Le
|
|
2590
2644
|
});
|
|
2591
|
-
}, [h,
|
|
2592
|
-
const pe =
|
|
2593
|
-
(
|
|
2594
|
-
const
|
|
2595
|
-
|
|
2596
|
-
(
|
|
2645
|
+
}, [h, r, Le, n]);
|
|
2646
|
+
const pe = _(
|
|
2647
|
+
(j) => {
|
|
2648
|
+
const z = jt(
|
|
2649
|
+
j.map(
|
|
2650
|
+
(P) => "joint" in P.id ? P.id.joint : P.id.segment
|
|
2597
2651
|
)
|
|
2598
2652
|
);
|
|
2599
|
-
|
|
2653
|
+
W(z);
|
|
2600
2654
|
},
|
|
2601
2655
|
[]
|
|
2602
2656
|
);
|
|
2603
2657
|
ce(() => {
|
|
2604
|
-
pe(
|
|
2605
|
-
}, [
|
|
2606
|
-
const
|
|
2607
|
-
if (!
|
|
2658
|
+
pe(C);
|
|
2659
|
+
}, [C, pe]);
|
|
2660
|
+
const $e = _(() => {
|
|
2661
|
+
if (!U || !i.trim())
|
|
2608
2662
|
return;
|
|
2609
|
-
const
|
|
2663
|
+
const j = U === ie.PointOfInterest, z = {
|
|
2610
2664
|
id: Date.now().toString(),
|
|
2611
2665
|
// Temporary ID
|
|
2612
2666
|
name: i.trim(),
|
|
2613
|
-
kind:
|
|
2614
|
-
parameters:
|
|
2615
|
-
sensorLocations:
|
|
2616
|
-
instructions:
|
|
2667
|
+
kind: U,
|
|
2668
|
+
parameters: j ? [] : C,
|
|
2669
|
+
sensorLocations: j ? [] : S,
|
|
2670
|
+
instructions: j ? G : "",
|
|
2617
2671
|
autoGenerate: !1,
|
|
2618
2672
|
isNew: !0
|
|
2619
2673
|
};
|
|
2620
|
-
|
|
2674
|
+
re((P) => [...P, z]), Y(null), a(""), l([]), W([]), Q("");
|
|
2621
2675
|
}, [
|
|
2622
|
-
|
|
2676
|
+
U,
|
|
2623
2677
|
i,
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
]), Dt =
|
|
2628
|
-
|
|
2629
|
-
}, []),
|
|
2630
|
-
const
|
|
2631
|
-
if (!
|
|
2632
|
-
const
|
|
2633
|
-
(
|
|
2634
|
-
) :
|
|
2635
|
-
|
|
2636
|
-
(
|
|
2637
|
-
(
|
|
2678
|
+
C,
|
|
2679
|
+
S,
|
|
2680
|
+
G
|
|
2681
|
+
]), Dt = _((j) => {
|
|
2682
|
+
re((z) => z.filter((P) => P.id !== j));
|
|
2683
|
+
}, []), Gt = (j, z) => {
|
|
2684
|
+
const P = N.find((ne) => ne.key === j);
|
|
2685
|
+
if (!P) return;
|
|
2686
|
+
const F = P.multi ? (z ?? []).map(
|
|
2687
|
+
(ne) => ne.id
|
|
2688
|
+
) : z ? [z.id] : [];
|
|
2689
|
+
T((ne) => [...ne.filter((de) => Object.values(B).flat().find((Ue) => Ue.id === de) && !Object.keys(B).find(
|
|
2690
|
+
(Ue) => B[Ue]?.some(
|
|
2691
|
+
(Ft) => Ft.id === de && Ue === j
|
|
2638
2692
|
)
|
|
2639
|
-
)),
|
|
2693
|
+
)), ...F]);
|
|
2640
2694
|
};
|
|
2641
2695
|
return /* @__PURE__ */ e.jsxs(ue, { spacing: 4, w: "full", align: "stretch", children: [
|
|
2642
2696
|
/* @__PURE__ */ e.jsxs(tn, { children: [
|
|
2643
2697
|
/* @__PURE__ */ e.jsxs(nn, { children: [
|
|
2644
|
-
/* @__PURE__ */ e.jsx(
|
|
2645
|
-
/* @__PURE__ */ e.jsx(
|
|
2698
|
+
/* @__PURE__ */ e.jsx(gt, { children: "Activity Configuration" }),
|
|
2699
|
+
/* @__PURE__ */ e.jsx(gt, { children: "Reports Configuration" })
|
|
2646
2700
|
] }),
|
|
2647
2701
|
/* @__PURE__ */ e.jsxs(sn, { children: [
|
|
2648
|
-
/* @__PURE__ */ e.jsx(
|
|
2702
|
+
/* @__PURE__ */ e.jsx(xt, { px: 0, children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
|
|
2649
2703
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2650
|
-
/* @__PURE__ */ e.jsxs(
|
|
2704
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2651
2705
|
/* @__PURE__ */ e.jsx(le, { children: "Name" }),
|
|
2652
2706
|
/* @__PURE__ */ e.jsx(
|
|
2653
|
-
|
|
2707
|
+
ye,
|
|
2654
2708
|
{
|
|
2655
|
-
value:
|
|
2656
|
-
onChange: (
|
|
2709
|
+
value: v,
|
|
2710
|
+
onChange: (j) => E(j.target.value),
|
|
2657
2711
|
type: "text",
|
|
2658
2712
|
placeholder: "i.e. Lunge & Return",
|
|
2659
2713
|
isDisabled: n
|
|
2660
2714
|
}
|
|
2661
2715
|
)
|
|
2662
2716
|
] }),
|
|
2663
|
-
/* @__PURE__ */ e.jsxs(
|
|
2717
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2664
2718
|
/* @__PURE__ */ e.jsx(le, { children: "Camera Placement" }),
|
|
2665
2719
|
/* @__PURE__ */ e.jsx(
|
|
2666
|
-
|
|
2720
|
+
Qe,
|
|
2667
2721
|
{
|
|
2668
|
-
value:
|
|
2669
|
-
onChange: (
|
|
2722
|
+
value: K,
|
|
2723
|
+
onChange: (j) => oe(j.target.value),
|
|
2670
2724
|
rows: 2,
|
|
2671
2725
|
placeholder: "(optional) Describe camera setup, placement, angles",
|
|
2672
2726
|
isDisabled: n
|
|
2673
2727
|
}
|
|
2674
2728
|
)
|
|
2675
2729
|
] }),
|
|
2676
|
-
/* @__PURE__ */ e.jsxs(
|
|
2730
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2677
2731
|
/* @__PURE__ */ e.jsx(le, { children: "Video Link" }),
|
|
2678
2732
|
/* @__PURE__ */ e.jsx(
|
|
2679
|
-
|
|
2733
|
+
ye,
|
|
2680
2734
|
{
|
|
2681
2735
|
value: D,
|
|
2682
|
-
onChange: (
|
|
2736
|
+
onChange: (j) => ae(j.target.value),
|
|
2683
2737
|
type: "url",
|
|
2684
2738
|
placeholder: "(optional) https://...",
|
|
2685
2739
|
isDisabled: n
|
|
2686
2740
|
}
|
|
2687
2741
|
)
|
|
2688
2742
|
] }),
|
|
2689
|
-
/* @__PURE__ */ e.jsxs(
|
|
2743
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2690
2744
|
/* @__PURE__ */ e.jsx(le, { children: "Description" }),
|
|
2691
2745
|
/* @__PURE__ */ e.jsx(
|
|
2692
|
-
|
|
2746
|
+
Qe,
|
|
2693
2747
|
{
|
|
2694
|
-
value:
|
|
2695
|
-
onChange: (
|
|
2748
|
+
value: R,
|
|
2749
|
+
onChange: (j) => O(j.target.value),
|
|
2696
2750
|
rows: 2,
|
|
2697
2751
|
placeholder: "(optional) Describe how to perform the test or exercise",
|
|
2698
2752
|
isDisabled: n
|
|
@@ -2702,44 +2756,44 @@ const Tn = ({
|
|
|
2702
2756
|
] }),
|
|
2703
2757
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2704
2758
|
/* @__PURE__ */ e.jsx(le, { children: "Metadata Tags" }),
|
|
2705
|
-
|
|
2706
|
-
/* @__PURE__ */ e.jsx(le, { children:
|
|
2759
|
+
N.map((j) => /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2760
|
+
/* @__PURE__ */ e.jsx(le, { children: j.label }),
|
|
2707
2761
|
/* @__PURE__ */ e.jsx(
|
|
2708
2762
|
he,
|
|
2709
2763
|
{
|
|
2710
|
-
isMulti:
|
|
2711
|
-
value:
|
|
2712
|
-
(
|
|
2764
|
+
isMulti: j.multi,
|
|
2765
|
+
value: B[j.key]?.filter(
|
|
2766
|
+
(z) => Z.includes(z.id)
|
|
2713
2767
|
),
|
|
2714
|
-
onChange: (
|
|
2715
|
-
|
|
2768
|
+
onChange: (z) => {
|
|
2769
|
+
Gt(j.key, z);
|
|
2716
2770
|
},
|
|
2717
|
-
options:
|
|
2718
|
-
placeholder: `Select ${
|
|
2771
|
+
options: B[j.key],
|
|
2772
|
+
placeholder: `Select ${j.multi ? "one or more" : "one"} ${j.label.toLowerCase()}`,
|
|
2719
2773
|
isDisabled: n,
|
|
2720
|
-
isClearable:
|
|
2774
|
+
isClearable: j.multi
|
|
2721
2775
|
}
|
|
2722
2776
|
)
|
|
2723
|
-
] },
|
|
2777
|
+
] }, j.key))
|
|
2724
2778
|
] })
|
|
2725
2779
|
] }) }),
|
|
2726
|
-
/* @__PURE__ */ e.jsx(
|
|
2780
|
+
/* @__PURE__ */ e.jsx(xt, { px: 0, children: /* @__PURE__ */ e.jsxs(
|
|
2727
2781
|
"div",
|
|
2728
2782
|
{
|
|
2729
|
-
className:
|
|
2783
|
+
className: Je(
|
|
2730
2784
|
"grid grid-cols-1 gap-6",
|
|
2731
2785
|
!n && "md:grid-cols-2"
|
|
2732
2786
|
),
|
|
2733
2787
|
children: [
|
|
2734
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
2788
|
+
/* @__PURE__ */ e.jsxs("div", { className: Je("space-y-4", n && "hidden"), children: [
|
|
2735
2789
|
/* @__PURE__ */ e.jsx(le, { children: "Add New Report" }),
|
|
2736
|
-
/* @__PURE__ */ e.jsxs(
|
|
2790
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2737
2791
|
/* @__PURE__ */ e.jsx(le, { children: "Report Name" }),
|
|
2738
2792
|
/* @__PURE__ */ e.jsx(
|
|
2739
|
-
|
|
2793
|
+
ye,
|
|
2740
2794
|
{
|
|
2741
2795
|
value: i,
|
|
2742
|
-
onChange: (
|
|
2796
|
+
onChange: (j) => a(j.target.value),
|
|
2743
2797
|
maxLength: 120,
|
|
2744
2798
|
type: "text",
|
|
2745
2799
|
placeholder: "Enter report name...",
|
|
@@ -2747,42 +2801,42 @@ const Tn = ({
|
|
|
2747
2801
|
}
|
|
2748
2802
|
)
|
|
2749
2803
|
] }),
|
|
2750
|
-
/* @__PURE__ */ e.jsxs(
|
|
2804
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2751
2805
|
/* @__PURE__ */ e.jsx(le, { children: "Report Type" }),
|
|
2752
2806
|
/* @__PURE__ */ e.jsx(
|
|
2753
2807
|
he,
|
|
2754
2808
|
{
|
|
2755
|
-
value:
|
|
2756
|
-
(
|
|
2809
|
+
value: U ? Se.find(
|
|
2810
|
+
(j) => j.value === U
|
|
2757
2811
|
) : null,
|
|
2758
|
-
onChange: (
|
|
2759
|
-
options:
|
|
2812
|
+
onChange: (j) => Y(j?.value || null),
|
|
2813
|
+
options: Se,
|
|
2760
2814
|
placeholder: "Select report type...",
|
|
2761
2815
|
isDisabled: n,
|
|
2762
2816
|
isClearable: !0
|
|
2763
2817
|
}
|
|
2764
2818
|
)
|
|
2765
2819
|
] }),
|
|
2766
|
-
|
|
2767
|
-
/* @__PURE__ */ e.jsxs(
|
|
2820
|
+
U !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2821
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2768
2822
|
/* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
|
|
2769
2823
|
/* @__PURE__ */ e.jsx(
|
|
2770
|
-
|
|
2824
|
+
yt,
|
|
2771
2825
|
{
|
|
2772
|
-
options:
|
|
2773
|
-
value:
|
|
2774
|
-
onChange:
|
|
2826
|
+
options: we,
|
|
2827
|
+
value: C,
|
|
2828
|
+
onChange: l,
|
|
2775
2829
|
editOnly: n
|
|
2776
2830
|
}
|
|
2777
2831
|
)
|
|
2778
2832
|
] }),
|
|
2779
|
-
/* @__PURE__ */ e.jsxs(
|
|
2833
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2780
2834
|
/* @__PURE__ */ e.jsx(le, { children: "Sensor Locations" }),
|
|
2781
2835
|
/* @__PURE__ */ e.jsx(
|
|
2782
|
-
|
|
2836
|
+
ye,
|
|
2783
2837
|
{
|
|
2784
|
-
value:
|
|
2785
|
-
(
|
|
2838
|
+
value: S.map(
|
|
2839
|
+
(j) => vt(j)
|
|
2786
2840
|
).join(", "),
|
|
2787
2841
|
placeholder: "Auto-filled based on parameters...",
|
|
2788
2842
|
isDisabled: !0
|
|
@@ -2790,13 +2844,13 @@ const Tn = ({
|
|
|
2790
2844
|
)
|
|
2791
2845
|
] })
|
|
2792
2846
|
] }),
|
|
2793
|
-
|
|
2847
|
+
U === ie.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2794
2848
|
/* @__PURE__ */ e.jsx(le, { children: "Instructions" }),
|
|
2795
2849
|
/* @__PURE__ */ e.jsx(
|
|
2796
|
-
|
|
2850
|
+
Qe,
|
|
2797
2851
|
{
|
|
2798
|
-
value:
|
|
2799
|
-
onChange: (
|
|
2852
|
+
value: G,
|
|
2853
|
+
onChange: (j) => Q(j.target.value),
|
|
2800
2854
|
rows: 3,
|
|
2801
2855
|
placeholder: "Enter specific instructions for this report...",
|
|
2802
2856
|
isDisabled: n
|
|
@@ -2804,44 +2858,44 @@ const Tn = ({
|
|
|
2804
2858
|
)
|
|
2805
2859
|
] }),
|
|
2806
2860
|
/* @__PURE__ */ e.jsx("div", { className: "w-full flex justify-end", children: /* @__PURE__ */ e.jsx(
|
|
2807
|
-
|
|
2861
|
+
te,
|
|
2808
2862
|
{
|
|
2809
2863
|
colorScheme: "blue",
|
|
2810
|
-
onClick:
|
|
2811
|
-
isDisabled: !
|
|
2864
|
+
onClick: $e,
|
|
2865
|
+
isDisabled: !U || !i.trim() || n || Se.length === 0 || U !== ie.PointOfInterest && C.length === 0,
|
|
2812
2866
|
children: "Add Report"
|
|
2813
2867
|
}
|
|
2814
2868
|
) })
|
|
2815
2869
|
] }),
|
|
2816
2870
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2817
2871
|
/* @__PURE__ */ e.jsx(le, { children: "Configured Reports" }),
|
|
2818
|
-
H.length === 0 ? /* @__PURE__ */ e.jsx(
|
|
2872
|
+
H.length === 0 ? /* @__PURE__ */ e.jsx(M, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: H.map((j) => /* @__PURE__ */ e.jsxs(
|
|
2819
2873
|
"div",
|
|
2820
2874
|
{
|
|
2821
2875
|
className: "p-3 border border-gray-200 rounded-md bg-gray-50 flex flex-col gap-2",
|
|
2822
2876
|
children: [
|
|
2823
2877
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start", children: [
|
|
2824
|
-
/* @__PURE__ */ e.jsx(
|
|
2878
|
+
/* @__PURE__ */ e.jsx(M, { fontSize: "sm", color: "gray.600", children: ke(j.kind) }),
|
|
2825
2879
|
!n && /* @__PURE__ */ e.jsx(
|
|
2826
|
-
|
|
2880
|
+
te,
|
|
2827
2881
|
{
|
|
2828
2882
|
size: "xs",
|
|
2829
2883
|
colorScheme: "red",
|
|
2830
2884
|
variant: "ghost",
|
|
2831
|
-
onClick: () => Dt(
|
|
2885
|
+
onClick: () => Dt(j.id),
|
|
2832
2886
|
children: "Remove"
|
|
2833
2887
|
}
|
|
2834
2888
|
)
|
|
2835
2889
|
] }),
|
|
2836
|
-
/* @__PURE__ */ e.jsxs(
|
|
2890
|
+
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2837
2891
|
/* @__PURE__ */ e.jsx(le, { children: "Report Name" }),
|
|
2838
2892
|
/* @__PURE__ */ e.jsx(
|
|
2839
|
-
|
|
2893
|
+
ye,
|
|
2840
2894
|
{
|
|
2841
|
-
value:
|
|
2842
|
-
onChange: (
|
|
2843
|
-
(
|
|
2844
|
-
(
|
|
2895
|
+
value: j.name,
|
|
2896
|
+
onChange: (z) => re(
|
|
2897
|
+
(P) => P.map(
|
|
2898
|
+
(F) => F.id === j.id ? { ...F, name: z.target.value } : F
|
|
2845
2899
|
)
|
|
2846
2900
|
),
|
|
2847
2901
|
placeholder: "Enter report name...",
|
|
@@ -2849,11 +2903,11 @@ const Tn = ({
|
|
|
2849
2903
|
}
|
|
2850
2904
|
)
|
|
2851
2905
|
] }),
|
|
2852
|
-
/* @__PURE__ */ e.jsxs(
|
|
2906
|
+
/* @__PURE__ */ e.jsxs(X, { display: "flex", alignItems: "center", children: [
|
|
2853
2907
|
/* @__PURE__ */ e.jsx(
|
|
2854
|
-
|
|
2908
|
+
_e,
|
|
2855
2909
|
{
|
|
2856
|
-
htmlFor: `auto-generate-${
|
|
2910
|
+
htmlFor: `auto-generate-${j.id}`,
|
|
2857
2911
|
mb: "0",
|
|
2858
2912
|
children: "Auto Generate"
|
|
2859
2913
|
}
|
|
@@ -2861,26 +2915,26 @@ const Tn = ({
|
|
|
2861
2915
|
/* @__PURE__ */ e.jsx(
|
|
2862
2916
|
on,
|
|
2863
2917
|
{
|
|
2864
|
-
id: `auto-generate-${
|
|
2865
|
-
isChecked:
|
|
2866
|
-
onChange: (
|
|
2867
|
-
(
|
|
2868
|
-
(
|
|
2918
|
+
id: `auto-generate-${j.id}`,
|
|
2919
|
+
isChecked: j.autoGenerate ?? !1,
|
|
2920
|
+
onChange: (z) => re(
|
|
2921
|
+
(P) => P.map(
|
|
2922
|
+
(F) => F.id === j.id ? { ...F, autoGenerate: z.target.checked } : F
|
|
2869
2923
|
)
|
|
2870
2924
|
),
|
|
2871
2925
|
isDisabled: n
|
|
2872
2926
|
}
|
|
2873
2927
|
)
|
|
2874
2928
|
] }),
|
|
2875
|
-
|
|
2929
|
+
j.kind === ie.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2876
2930
|
/* @__PURE__ */ e.jsx(le, { children: "Instructions" }),
|
|
2877
2931
|
/* @__PURE__ */ e.jsx(
|
|
2878
|
-
|
|
2932
|
+
Qe,
|
|
2879
2933
|
{
|
|
2880
|
-
value:
|
|
2881
|
-
onChange: (
|
|
2882
|
-
(
|
|
2883
|
-
(
|
|
2934
|
+
value: j.instructions,
|
|
2935
|
+
onChange: (z) => re(
|
|
2936
|
+
(P) => P.map(
|
|
2937
|
+
(F) => F.id === j.id ? { ...F, instructions: z.target.value } : F
|
|
2884
2938
|
)
|
|
2885
2939
|
),
|
|
2886
2940
|
rows: 3,
|
|
@@ -2889,18 +2943,18 @@ const Tn = ({
|
|
|
2889
2943
|
}
|
|
2890
2944
|
)
|
|
2891
2945
|
] }),
|
|
2892
|
-
|
|
2946
|
+
j.kind !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
|
|
2893
2947
|
/* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
|
|
2894
2948
|
/* @__PURE__ */ e.jsx(
|
|
2895
|
-
|
|
2949
|
+
yt,
|
|
2896
2950
|
{
|
|
2897
|
-
options:
|
|
2898
|
-
value:
|
|
2899
|
-
onChange: (
|
|
2900
|
-
const
|
|
2901
|
-
|
|
2902
|
-
(
|
|
2903
|
-
(de) => de.id ===
|
|
2951
|
+
options: we,
|
|
2952
|
+
value: j.parameters,
|
|
2953
|
+
onChange: (z) => {
|
|
2954
|
+
const P = (ee) => "joint" in ee.id ? ee.id.joint : ee.id.segment, F = z.map(P), ne = jt(F);
|
|
2955
|
+
re(
|
|
2956
|
+
(ee) => ee.map(
|
|
2957
|
+
(de) => de.id === j.id ? { ...de, parameters: z, sensorLocations: ne } : de
|
|
2904
2958
|
)
|
|
2905
2959
|
);
|
|
2906
2960
|
},
|
|
@@ -2908,16 +2962,16 @@ const Tn = ({
|
|
|
2908
2962
|
}
|
|
2909
2963
|
)
|
|
2910
2964
|
] }),
|
|
2911
|
-
|
|
2965
|
+
j.kind !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
|
|
2912
2966
|
"Sensors:",
|
|
2913
2967
|
" ",
|
|
2914
|
-
|
|
2915
|
-
(
|
|
2968
|
+
j.sensorLocations.map(
|
|
2969
|
+
(z) => vt(z)
|
|
2916
2970
|
).join(", ")
|
|
2917
2971
|
] })
|
|
2918
2972
|
]
|
|
2919
2973
|
},
|
|
2920
|
-
|
|
2974
|
+
j.id
|
|
2921
2975
|
)) })
|
|
2922
2976
|
] })
|
|
2923
2977
|
]
|
|
@@ -2926,19 +2980,19 @@ const Tn = ({
|
|
|
2926
2980
|
] })
|
|
2927
2981
|
] }),
|
|
2928
2982
|
/* @__PURE__ */ e.jsx(
|
|
2929
|
-
|
|
2983
|
+
V,
|
|
2930
2984
|
{
|
|
2931
2985
|
justify: "end",
|
|
2932
|
-
className:
|
|
2933
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
2934
|
-
/* @__PURE__ */ e.jsx(
|
|
2986
|
+
className: Je((m || n) && "!hidden"),
|
|
2987
|
+
children: /* @__PURE__ */ e.jsxs(Ne, { gap: 4, children: [
|
|
2988
|
+
/* @__PURE__ */ e.jsx(te, { colorScheme: "gray", isDisabled: f, onClick: r, children: "Cancel" }),
|
|
2935
2989
|
/* @__PURE__ */ e.jsx(
|
|
2936
|
-
|
|
2990
|
+
te,
|
|
2937
2991
|
{
|
|
2938
2992
|
colorScheme: "blue",
|
|
2939
|
-
isDisabled:
|
|
2940
|
-
isLoading:
|
|
2941
|
-
onClick:
|
|
2993
|
+
isDisabled: f || !ze || !Re,
|
|
2994
|
+
isLoading: f,
|
|
2995
|
+
onClick: Le,
|
|
2942
2996
|
children: "Save changes"
|
|
2943
2997
|
}
|
|
2944
2998
|
)
|
|
@@ -2946,168 +3000,168 @@ const Tn = ({
|
|
|
2946
3000
|
}
|
|
2947
3001
|
)
|
|
2948
3002
|
] });
|
|
2949
|
-
}, le = ({ children:
|
|
2950
|
-
children:
|
|
2951
|
-
isView:
|
|
2952
|
-
metadataKeys:
|
|
3003
|
+
}, le = ({ children: s }) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), es = ({
|
|
3004
|
+
children: s,
|
|
3005
|
+
isView: t,
|
|
3006
|
+
metadataKeys: r
|
|
2953
3007
|
}) => {
|
|
2954
|
-
const [p, m] =
|
|
3008
|
+
const [p, m] = q({}), h = lt();
|
|
2955
3009
|
return ce(() => {
|
|
2956
|
-
let
|
|
3010
|
+
let d = !1;
|
|
2957
3011
|
return (async () => {
|
|
2958
|
-
const n = (
|
|
2959
|
-
(y) => h.query(
|
|
2960
|
-
),
|
|
2961
|
-
for (const y of
|
|
3012
|
+
const n = (r ?? []).map(
|
|
3013
|
+
(y) => h.query(at, { key: y }).toPromise()
|
|
3014
|
+
), o = await Promise.all(n), u = {};
|
|
3015
|
+
for (const y of o) {
|
|
2962
3016
|
if (y.error || !y.data?.getMetadataByKey) continue;
|
|
2963
|
-
const
|
|
3017
|
+
const b = A(
|
|
2964
3018
|
je,
|
|
2965
3019
|
y.data.getMetadataByKey
|
|
2966
3020
|
);
|
|
2967
|
-
if (!
|
|
2968
|
-
const
|
|
2969
|
-
|
|
2970
|
-
label:
|
|
2971
|
-
value:
|
|
2972
|
-
id:
|
|
3021
|
+
if (!b) continue;
|
|
3022
|
+
const w = A(be, b.data) ?? [];
|
|
3023
|
+
u[b.key] = w.map((I) => ({
|
|
3024
|
+
label: I.label || I.value,
|
|
3025
|
+
value: I.value,
|
|
3026
|
+
id: I.id
|
|
2973
3027
|
}));
|
|
2974
3028
|
}
|
|
2975
|
-
|
|
3029
|
+
d || m(u);
|
|
2976
3030
|
})(), () => {
|
|
2977
|
-
|
|
3031
|
+
d = !0;
|
|
2978
3032
|
};
|
|
2979
|
-
}, [h,
|
|
2980
|
-
},
|
|
2981
|
-
id:
|
|
2982
|
-
onCancel:
|
|
2983
|
-
onSave:
|
|
3033
|
+
}, [h, r]), /* @__PURE__ */ e.jsx($t.Provider, { value: { isView: t, metadataOptions: p }, children: s });
|
|
3034
|
+
}, Cs = ({
|
|
3035
|
+
id: s,
|
|
3036
|
+
onCancel: t,
|
|
3037
|
+
onSave: r,
|
|
2984
3038
|
onError: p,
|
|
2985
3039
|
hideButtons: m,
|
|
2986
3040
|
quantumOwned: h,
|
|
2987
|
-
setButtonOnClick:
|
|
2988
|
-
setButtonDisabled:
|
|
3041
|
+
setButtonOnClick: d,
|
|
3042
|
+
setButtonDisabled: g,
|
|
2989
3043
|
isView: n
|
|
2990
3044
|
}) => {
|
|
2991
|
-
const [{ data:
|
|
3045
|
+
const [{ data: o, fetching: u }] = Ce({
|
|
2992
3046
|
query: h ? hn : pn
|
|
2993
|
-
}), [{ data: y }] =
|
|
3047
|
+
}), [{ data: y }] = Ce({
|
|
2994
3048
|
query: gn,
|
|
2995
|
-
variables: { id:
|
|
2996
|
-
pause: !
|
|
2997
|
-
}), [{ data:
|
|
3049
|
+
variables: { id: s },
|
|
3050
|
+
pause: !s
|
|
3051
|
+
}), [{ data: b }] = Ce({
|
|
2998
3052
|
query: xn
|
|
2999
|
-
}),
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
), [{ fetching:
|
|
3003
|
-
|
|
3004
|
-
h ?
|
|
3005
|
-
).filter((
|
|
3053
|
+
}), w = A(
|
|
3054
|
+
Pe,
|
|
3055
|
+
b?.moduleCategories
|
|
3056
|
+
), [{ fetching: I }, L] = fe(Ot), [{ fetching: f }, c] = fe(At), k = $(() => !o || u ? [] : A(
|
|
3057
|
+
ve,
|
|
3058
|
+
h ? o?.quantumOwnedActions ?? [] : o?.actions ?? []
|
|
3059
|
+
).filter((U) => !!U?.id), [o, h, u]), x = A(Ye, y?.module), N = $(() => A(Tt, x?.moduleActions) ?? [], [x?.moduleActions]), [v, E] = q([]), [R, O] = q(x?.name ?? ""), [K, oe] = q([]), [D, ae] = q(x?.description ?? ""), [Z, T] = q([]);
|
|
3006
3060
|
ce(() => {
|
|
3007
|
-
if (
|
|
3008
|
-
const
|
|
3009
|
-
key: i.id ?? `${i.actionId}-${
|
|
3061
|
+
if (x) {
|
|
3062
|
+
const J = N.map((i, a) => ({
|
|
3063
|
+
key: i.id ?? `${i.actionId}-${a}`,
|
|
3010
3064
|
actionId: i.actionId,
|
|
3011
3065
|
reportId: i.reportId || null
|
|
3012
3066
|
}));
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
(i) =>
|
|
3067
|
+
E(J), O(x.name), ae(x.description ?? ""), oe(
|
|
3068
|
+
x.categories.map(
|
|
3069
|
+
(i) => A(Pe, i).id
|
|
3016
3070
|
) ?? []
|
|
3017
3071
|
);
|
|
3018
|
-
const
|
|
3072
|
+
const Y = A(
|
|
3019
3073
|
je,
|
|
3020
|
-
|
|
3074
|
+
x.metadataGroups
|
|
3021
3075
|
).map(
|
|
3022
|
-
(i) => i.data.map((
|
|
3076
|
+
(i) => i.data.map((a) => A(be, a).id)
|
|
3023
3077
|
);
|
|
3024
|
-
|
|
3078
|
+
T(Y.flat());
|
|
3025
3079
|
}
|
|
3026
|
-
}, [
|
|
3027
|
-
const
|
|
3028
|
-
let
|
|
3029
|
-
const
|
|
3030
|
-
moduleActions:
|
|
3031
|
-
actionId:
|
|
3032
|
-
reportId:
|
|
3080
|
+
}, [x, N]);
|
|
3081
|
+
const B = _(() => {
|
|
3082
|
+
let J;
|
|
3083
|
+
const U = {
|
|
3084
|
+
moduleActions: v.map((Y) => ({
|
|
3085
|
+
actionId: Y.actionId,
|
|
3086
|
+
reportId: Y.reportId ?? void 0
|
|
3033
3087
|
})),
|
|
3034
|
-
name:
|
|
3035
|
-
categories:
|
|
3088
|
+
name: R,
|
|
3089
|
+
categories: K,
|
|
3036
3090
|
description: D,
|
|
3037
3091
|
quantumOwned: h,
|
|
3038
|
-
metadataItemIds:
|
|
3092
|
+
metadataItemIds: Z
|
|
3039
3093
|
};
|
|
3040
|
-
|
|
3041
|
-
id:
|
|
3042
|
-
input:
|
|
3043
|
-
}) :
|
|
3044
|
-
input:
|
|
3045
|
-
}),
|
|
3046
|
-
|
|
3094
|
+
x ? J = L({
|
|
3095
|
+
id: x.id,
|
|
3096
|
+
input: U
|
|
3097
|
+
}) : J = c({
|
|
3098
|
+
input: U
|
|
3099
|
+
}), J.then(({ error: Y }) => {
|
|
3100
|
+
Y ? p(Y instanceof Error ? Y : new Error(String(Y))) : r();
|
|
3047
3101
|
});
|
|
3048
3102
|
}, [
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3103
|
+
c,
|
|
3104
|
+
L,
|
|
3105
|
+
v,
|
|
3106
|
+
R,
|
|
3053
3107
|
D,
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3108
|
+
K,
|
|
3109
|
+
Z,
|
|
3110
|
+
x,
|
|
3111
|
+
r,
|
|
3058
3112
|
p,
|
|
3059
3113
|
h
|
|
3060
3114
|
]);
|
|
3061
3115
|
return ce(() => {
|
|
3062
|
-
|
|
3063
|
-
cancelButton:
|
|
3064
|
-
saveButton:
|
|
3116
|
+
g && g({
|
|
3117
|
+
cancelButton: I || f,
|
|
3118
|
+
saveButton: I || f || !R || D.trim().split(/\s+/).filter(Boolean).length > 40
|
|
3065
3119
|
});
|
|
3066
|
-
}, [
|
|
3067
|
-
|
|
3068
|
-
cancelButton:
|
|
3069
|
-
saveButton:
|
|
3120
|
+
}, [g, I, f, v, R, D]), ce(() => {
|
|
3121
|
+
d && d({
|
|
3122
|
+
cancelButton: t,
|
|
3123
|
+
saveButton: B
|
|
3070
3124
|
});
|
|
3071
|
-
}, [
|
|
3072
|
-
|
|
3125
|
+
}, [d, t, B]), /* @__PURE__ */ e.jsx(se, { width: "100%", children: /* @__PURE__ */ e.jsxs(
|
|
3126
|
+
es,
|
|
3073
3127
|
{
|
|
3074
3128
|
isView: n,
|
|
3075
3129
|
metadataKeys: ["activity_type", "session_type", "body_region", "sport"],
|
|
3076
3130
|
children: [
|
|
3077
3131
|
/* @__PURE__ */ e.jsx(
|
|
3078
|
-
|
|
3132
|
+
Wn,
|
|
3079
3133
|
{
|
|
3080
|
-
name:
|
|
3081
|
-
setName:
|
|
3082
|
-
actions:
|
|
3083
|
-
moduleActionEntries:
|
|
3084
|
-
setModuleActionEntries:
|
|
3085
|
-
availableCategories:
|
|
3086
|
-
selectedCategoryIds:
|
|
3087
|
-
setSelectedCategoryIds:
|
|
3134
|
+
name: R,
|
|
3135
|
+
setName: O,
|
|
3136
|
+
actions: k,
|
|
3137
|
+
moduleActionEntries: v,
|
|
3138
|
+
setModuleActionEntries: E,
|
|
3139
|
+
availableCategories: w ?? [],
|
|
3140
|
+
selectedCategoryIds: K,
|
|
3141
|
+
setSelectedCategoryIds: oe,
|
|
3088
3142
|
description: D,
|
|
3089
|
-
setDescription:
|
|
3090
|
-
selectedMetadataIds:
|
|
3091
|
-
setSelectedMetadataIds:
|
|
3143
|
+
setDescription: ae,
|
|
3144
|
+
selectedMetadataIds: Z,
|
|
3145
|
+
setSelectedMetadataIds: T
|
|
3092
3146
|
}
|
|
3093
3147
|
),
|
|
3094
|
-
!m && !n && /* @__PURE__ */ e.jsx(
|
|
3148
|
+
!m && !n && /* @__PURE__ */ e.jsx(V, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Ne, { mt: 16, gap: 4, children: [
|
|
3095
3149
|
/* @__PURE__ */ e.jsx(
|
|
3096
|
-
|
|
3150
|
+
te,
|
|
3097
3151
|
{
|
|
3098
3152
|
colorScheme: "gray",
|
|
3099
|
-
isDisabled:
|
|
3100
|
-
onClick:
|
|
3153
|
+
isDisabled: I || f,
|
|
3154
|
+
onClick: t,
|
|
3101
3155
|
children: "Cancel"
|
|
3102
3156
|
}
|
|
3103
3157
|
),
|
|
3104
3158
|
/* @__PURE__ */ e.jsx(
|
|
3105
|
-
|
|
3159
|
+
te,
|
|
3106
3160
|
{
|
|
3107
3161
|
colorScheme: "blue",
|
|
3108
|
-
isDisabled:
|
|
3109
|
-
isLoading:
|
|
3110
|
-
onClick:
|
|
3162
|
+
isDisabled: I || f || !R || D.trim().split(/\s+/).filter(Boolean).length > 40,
|
|
3163
|
+
isLoading: I || f,
|
|
3164
|
+
onClick: B,
|
|
3111
3165
|
children: "Save"
|
|
3112
3166
|
}
|
|
3113
3167
|
)
|
|
@@ -3117,12 +3171,12 @@ const Tn = ({
|
|
|
3117
3171
|
) });
|
|
3118
3172
|
};
|
|
3119
3173
|
export {
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3174
|
+
Un as ActivityList,
|
|
3175
|
+
bs as CopyActivityForm,
|
|
3176
|
+
ys as CopyModuleForm,
|
|
3177
|
+
Wn as ModuleForm,
|
|
3178
|
+
Zn as ParameterEditList,
|
|
3179
|
+
yt as ParameterEditSelect,
|
|
3180
|
+
vs as UpsertActivityForm,
|
|
3181
|
+
Cs as UpsertModuleForm
|
|
3128
3182
|
};
|