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