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