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