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