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