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