quantum-component-library 1.4.50-dev.0 → 1.4.50-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.cjs +1 -1
- package/dist/components.js +549 -543
- package/dist/{dnd-core-vendor-BtUZf9Ev.cjs → dnd-core-vendor-CewhYmpg.cjs} +1 -1
- package/dist/{dnd-core-vendor-DLG1XK6O.js → dnd-core-vendor-MevRgDB0.js} +2 -2
- package/dist/{graphql-vendor-BYC3nhzS.cjs → graphql-vendor-BppBsUpc.cjs} +1 -1
- package/dist/{graphql-vendor-N74bYJtL.js → graphql-vendor-uvLTmCiR.js} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +80 -98
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/hooks/use-all-part-parameters.d.ts +1 -8
- package/dist/lib/types/parameters.d.ts +1 -0
- package/dist/{lodash-vendor-l9HldpVa.js → lodash-vendor-B-xpwrnm.js} +1 -1
- package/dist/{lodash-vendor-C3e6C_PJ.cjs → lodash-vendor-CWf2psR2.cjs} +1 -1
- package/dist/{other-q0es350N.cjs → other-Cad4iUZr.cjs} +1 -1
- package/dist/{other-DE6uy3y4.js → other-OzryMihZ.js} +2 -2
- package/dist/{react-dnd-vendor-BDOGawvX.js → react-dnd-vendor-BYAS_HOo.js} +2 -2
- package/dist/{react-dnd-vendor-BGRUqrp9.cjs → react-dnd-vendor-BqsnzPKT.cjs} +1 -1
- package/dist/{react-select-vendor-C3wpaSL1.js → react-select-vendor-_26lPW2Z.js} +1 -1
- package/dist/{react-select-vendor-CZ69mhgt.cjs → react-select-vendor-sW1B_api.cjs} +1 -1
- package/dist/{services-human-CGLf7B6Q.cjs → services-human-B4_65njx.cjs} +1 -1
- package/dist/{services-human-CI19qLdG.js → services-human-BIz3wOu_.js} +6 -6
- package/dist/services.cjs +1 -1
- package/dist/services.js +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.js +3 -3
- package/dist/{utils-conversion-sLq5wEdq.cjs → utils-conversion-BYVStK4S.cjs} +1 -1
- package/dist/{utils-conversion-zKwO4dYF.js → utils-conversion-pcEG40AR.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{vendor--D-cya0B.js → vendor-BHWxqW4x.js} +1 -1
- package/dist/{vendor-jpI6KZW2.cjs → vendor-Dj-hzYUa.cjs} +1 -1
- package/package.json +1 -1
package/dist/components.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
|
|
2
|
-
import { Flex as ye, InputGroup as st, InputLeftElement as Ft, Icon as gt, Input as we, FormLabel as xt, Box as
|
|
3
|
-
import { useMemo as T, useState as
|
|
2
|
+
import { Flex as ye, InputGroup as st, InputLeftElement as Ft, Icon as gt, Input as we, FormLabel as xt, Box as se, TableContainer as jt, Table as ft, Thead as bt, Tr as Ue, Th as be, Tbody as yt, Td as Ce, ButtonGroup as Le, Tooltip as Ve, Button as V, RangeSlider as $t, RangeSliderMark as Ze, Text as S, RangeSliderTrack as Dt, RangeSliderFilledTrack as Pt, RangeSliderThumb as rt, Select as ot, NumberInput as at, NumberInputField as it, HStack as oe, Tag as Ne, Image as Et, useToast as vt, VStack as le, FormControl as X, RadioGroup as Ct, Radio as Qe, Alert as qe, AlertIcon as Ke, Spinner as wt, useDisclosure as _t, Modal as Gt, ModalOverlay as zt, ModalContent as Bt, ModalHeader as Wt, ModalCloseButton as Ut, ModalBody as Qt, ModalFooter as qt, Badge as St, IconButton as Kt, Tabs as Yt, TabList as Ht, Tab as lt, TabPanels as Jt, TabPanel as ct, Textarea as Pe } from "@chakra-ui/react";
|
|
3
|
+
import { useMemo as T, useState as G, useCallback as P, useRef as Xt, useEffect as ce, memo as Je } from "react";
|
|
4
4
|
import { c as ze } from "./utils-cn-CgdSr4hO.js";
|
|
5
5
|
import "./moment-vendor-DMLRxgRE.js";
|
|
6
|
-
import "./lodash-vendor-
|
|
6
|
+
import "./lodash-vendor-B-xpwrnm.js";
|
|
7
7
|
import { useQuery as je, useMutation as me, useClient as Zt } from "urql";
|
|
8
8
|
import { useUiLabelContext as xe, useAllPartParameters as Vt } from "./hooks.js";
|
|
9
9
|
import { u as en } from "./ufuzzy-vendor-Dl0ZI6Av.js";
|
|
10
10
|
import { F as tn, a as nn, b as sn, c as rn } from "./react-icons-vendor-CMsTQrA0.js";
|
|
11
|
-
import { s as ge } from "./react-select-vendor-
|
|
11
|
+
import { s as ge } from "./react-select-vendor-_26lPW2Z.js";
|
|
12
12
|
import { getFragmentData as A } from "./generated.js";
|
|
13
13
|
import { G as Lt, a as on, C as et, b as Mt, R as tt, M as Re, c as Ye, T as Se, A as fe, d as He, e as It, f as an, g as Ot, U as At, h as Be, i as Tt, j as ln, k as cn, l as dn, m as un, n as hn, o as mn, p as pn } from "./graphql-BIKiRJ8I.js";
|
|
14
|
-
import { D as gn, H as xn, u as jn, a as fn } from "./react-dnd-vendor-
|
|
15
|
-
import { ThresholdKind as We, ReportKind as
|
|
16
|
-
import { g as Nt, a as Rt, b as yn, c as vn, d as Cn, e as dt, f as ut } from "./services-human-
|
|
14
|
+
import { D as gn, H as xn, u as jn, a as fn } from "./react-dnd-vendor-BYAS_HOo.js";
|
|
15
|
+
import { ThresholdKind as We, ReportKind as ne, ActionLaterality as bn, SensorLocation as ie } from "./generated-graphql.js";
|
|
16
|
+
import { g as Nt, a as Rt, b as yn, c as vn, d as Cn, e as dt, f as ut } from "./services-human-BIz3wOu_.js";
|
|
17
17
|
import { availablePlanes as ht, getAnalysisPartIdNoSide as Ee } from "./types.js";
|
|
18
18
|
const wn = ({
|
|
19
19
|
setSearch: n,
|
|
@@ -22,7 +22,7 @@ const wn = ({
|
|
|
22
22
|
hideUseCaseFilter: d = !1
|
|
23
23
|
}) => {
|
|
24
24
|
const p = T(
|
|
25
|
-
() => t?.flatMap((c) => c.useCases).filter((c, m, j) => j.findIndex((
|
|
25
|
+
() => t?.flatMap((c) => c.useCases).filter((c, m, j) => j.findIndex((o) => o.id === c.id) === m).map((c) => ({
|
|
26
26
|
label: c.name,
|
|
27
27
|
value: c.id
|
|
28
28
|
})) || [],
|
|
@@ -62,18 +62,18 @@ const wn = ({
|
|
|
62
62
|
}, pe = ({
|
|
63
63
|
children: n
|
|
64
64
|
}) => /* @__PURE__ */ e.jsx(xt, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Sn = ({ value: n, onChange: t }) => {
|
|
65
|
-
const a =
|
|
65
|
+
const a = G(
|
|
66
66
|
() => Math.random().toString(36).substring(2, 15)
|
|
67
67
|
)[0], d = P(
|
|
68
68
|
(p, c) => {
|
|
69
69
|
t((m) => {
|
|
70
|
-
const j = [...m], [
|
|
71
|
-
return j.splice(c, 0,
|
|
70
|
+
const j = [...m], [o] = j.splice(p, 1);
|
|
71
|
+
return j.splice(c, 0, o), j;
|
|
72
72
|
});
|
|
73
73
|
},
|
|
74
74
|
[t]
|
|
75
75
|
);
|
|
76
|
-
return /* @__PURE__ */ e.jsx(
|
|
76
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(gn, { backend: xn, children: /* @__PURE__ */ e.jsx(jt, { children: /* @__PURE__ */ e.jsxs(ft, { variant: "simple", size: "md", children: [
|
|
77
77
|
/* @__PURE__ */ e.jsx(bt, { children: /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
78
78
|
/* @__PURE__ */ e.jsx(be, { children: "Order" }),
|
|
79
79
|
/* @__PURE__ */ e.jsx(be, { children: "Name" })
|
|
@@ -99,20 +99,20 @@ const wn = ({
|
|
|
99
99
|
hover: (f, I) => {
|
|
100
100
|
if (!c.current)
|
|
101
101
|
return;
|
|
102
|
-
const w = f.index,
|
|
103
|
-
if (w ===
|
|
102
|
+
const w = f.index, b = t;
|
|
103
|
+
if (w === b)
|
|
104
104
|
return;
|
|
105
|
-
const h = c.current?.getBoundingClientRect(),
|
|
106
|
-
w <
|
|
105
|
+
const h = c.current?.getBoundingClientRect(), s = (h.bottom - h.top) / 2, y = I.getClientOffset().y - h.top;
|
|
106
|
+
w < b && y < s || w > b && y > s || (p(w, b), f.index = b);
|
|
107
107
|
}
|
|
108
|
-
}), [{ isDragging:
|
|
108
|
+
}), [{ isDragging: o }, l] = fn({
|
|
109
109
|
type: n,
|
|
110
110
|
item: () => ({ id: a, index: t }),
|
|
111
111
|
collect: (f) => ({
|
|
112
112
|
isDragging: f.isDragging()
|
|
113
113
|
})
|
|
114
|
-
}), x =
|
|
115
|
-
return l(j(c)), /* @__PURE__ */ e.jsxs(Ue, { ref: c, style: { opacity: x, cursor:
|
|
114
|
+
}), x = o ? 0.6 : 1, k = o ? "grabbing" : "grab";
|
|
115
|
+
return l(j(c)), /* @__PURE__ */ e.jsxs(Ue, { ref: c, style: { opacity: x, cursor: k }, "data-handler-id": m, children: [
|
|
116
116
|
/* @__PURE__ */ e.jsx(Ce, { children: t + 1 }),
|
|
117
117
|
/* @__PURE__ */ e.jsx(Ce, { children: d })
|
|
118
118
|
] });
|
|
@@ -124,29 +124,29 @@ const wn = ({
|
|
|
124
124
|
selectedProps: p,
|
|
125
125
|
buttonProps: c
|
|
126
126
|
}) => {
|
|
127
|
-
const m = (
|
|
128
|
-
return /* @__PURE__ */ e.jsx(Le, { isAttached: !0, isDisabled: d, children: n.map((
|
|
127
|
+
const m = (o) => o === a || o.value === a, j = (o) => m(o) ? { ...c, ...p } : c;
|
|
128
|
+
return /* @__PURE__ */ e.jsx(Le, { isAttached: !0, isDisabled: d, children: n.map((o, l) => /* @__PURE__ */ e.jsx(
|
|
129
129
|
Ve,
|
|
130
130
|
{
|
|
131
|
-
label:
|
|
131
|
+
label: o.tooltip,
|
|
132
132
|
openDelay: 50,
|
|
133
133
|
closeDelay: 200,
|
|
134
134
|
placement: "top",
|
|
135
|
-
visibility:
|
|
135
|
+
visibility: o.tooltip ? "visible" : "hidden",
|
|
136
136
|
hasArrow: !0,
|
|
137
137
|
children: /* @__PURE__ */ e.jsx(
|
|
138
138
|
V,
|
|
139
139
|
{
|
|
140
|
-
onClick: () => m(
|
|
141
|
-
isDisabled:
|
|
142
|
-
...j(
|
|
143
|
-
children:
|
|
140
|
+
onClick: () => m(o) ? null : t(o, l),
|
|
141
|
+
isDisabled: o.disabled,
|
|
142
|
+
...j(o),
|
|
143
|
+
children: o.label
|
|
144
144
|
}
|
|
145
145
|
)
|
|
146
146
|
},
|
|
147
147
|
l
|
|
148
148
|
)) });
|
|
149
|
-
},
|
|
149
|
+
}, _e = (n, t) => t < 0 ? -1 * Math.abs(n) : Math.abs(n), In = ({
|
|
150
150
|
isReversed: n,
|
|
151
151
|
min: t,
|
|
152
152
|
max: a,
|
|
@@ -155,70 +155,70 @@ const wn = ({
|
|
|
155
155
|
inputProps: c,
|
|
156
156
|
size: m,
|
|
157
157
|
zeroMarker: j,
|
|
158
|
-
formatValue:
|
|
158
|
+
formatValue: o,
|
|
159
159
|
valueLabel: l,
|
|
160
160
|
positiveNegativeLabels: x,
|
|
161
|
-
isDisabled:
|
|
161
|
+
isDisabled: k,
|
|
162
162
|
...f
|
|
163
163
|
}) => {
|
|
164
|
-
const [I, w] =
|
|
164
|
+
const [I, w] = G([void 0, void 0]), b = I[0], h = I[1], s = j && t < -5 && a > 5, u = Number(d?.[0] ?? h ?? t) > 0 ? 1 : -1, y = Number(d?.[1] ?? h ?? a) < 0 ? -1 : 1, M = x?.[0] === x?.[1], F = d?.[0], q = d?.[1];
|
|
165
165
|
ce(() => {
|
|
166
|
-
|
|
167
|
-
}, [
|
|
168
|
-
const
|
|
169
|
-
([L,
|
|
170
|
-
L <
|
|
166
|
+
F !== void 0 && q !== void 0 && w([F.toFixed(0), q.toFixed(0)]);
|
|
167
|
+
}, [F, q, w]);
|
|
168
|
+
const z = P(
|
|
169
|
+
([L, B]) => {
|
|
170
|
+
L < B && w([L.toFixed(0), B.toFixed(0)]);
|
|
171
171
|
},
|
|
172
172
|
[w]
|
|
173
173
|
), N = P(
|
|
174
|
-
([L,
|
|
175
|
-
L <
|
|
174
|
+
([L, B]) => {
|
|
175
|
+
L < B && p([L, B]);
|
|
176
176
|
},
|
|
177
177
|
[p]
|
|
178
178
|
), K = P(() => {
|
|
179
|
-
w(([L,
|
|
180
|
-
const ee = isNaN(Number(L)) ? t : Number(L), U = isNaN(Number(
|
|
181
|
-
return
|
|
179
|
+
w(([L, B]) => {
|
|
180
|
+
const ee = isNaN(Number(L)) ? t : Number(L), U = isNaN(Number(B)) ? a : Number(B), ae = _e(Number(ee), u), i = _e(Number(U), y), r = u < 0 ? Math.max(ae, t) : Math.min(ae, a), v = y < 0 ? Math.max(i, t) : Math.min(i, a);
|
|
181
|
+
return r > v ? (p([v, r]), [v.toFixed(0), r.toFixed(0)]) : (p([r, v]), [r.toFixed(0), v.toFixed(0)]);
|
|
182
182
|
});
|
|
183
|
-
}, [p, w, u,
|
|
183
|
+
}, [p, w, u, y, t, a]), re = P(
|
|
184
184
|
(L) => {
|
|
185
|
-
const
|
|
186
|
-
w(([ee, U]) => [
|
|
185
|
+
const B = L === "" || isNaN(Number(L)) ? L : _e(Number(L), u);
|
|
186
|
+
w(([ee, U]) => [B.toString(), U]);
|
|
187
187
|
},
|
|
188
188
|
[w, u]
|
|
189
|
-
),
|
|
189
|
+
), $ = P(
|
|
190
190
|
(L) => {
|
|
191
|
-
const
|
|
192
|
-
w(([ee, U]) => [ee,
|
|
191
|
+
const B = L === "" || isNaN(Number(L)) ? L : _e(Number(L), y);
|
|
192
|
+
w(([ee, U]) => [ee, B.toString()]);
|
|
193
193
|
},
|
|
194
|
-
[w,
|
|
194
|
+
[w, y]
|
|
195
195
|
), C = T(
|
|
196
196
|
() => m === "xs" ? "0.75rem" : void 0,
|
|
197
197
|
[m]
|
|
198
198
|
), E = P(
|
|
199
|
-
(L,
|
|
200
|
-
const ee = Number(
|
|
201
|
-
if (!
|
|
199
|
+
(L, B) => {
|
|
200
|
+
const ee = Number(B.target.value);
|
|
201
|
+
if (!b || !h || ![-1, 1].includes(ee))
|
|
202
202
|
return;
|
|
203
|
-
const U = (
|
|
203
|
+
const U = (r) => ee < 0 ? -1 * Math.abs(r) : Math.abs(r), ae = L ? U(Number(b)) : Number(b), i = L ? Number(h) : U(Number(h));
|
|
204
204
|
ae > i ? p([i, ae]) : p([ae, i]);
|
|
205
205
|
},
|
|
206
|
-
[
|
|
206
|
+
[b, h, p]
|
|
207
207
|
);
|
|
208
208
|
return /* @__PURE__ */ e.jsxs(ye, { direction: "column", ...f, children: [
|
|
209
|
-
/* @__PURE__ */ e.jsx(
|
|
209
|
+
/* @__PURE__ */ e.jsx(se, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
|
|
210
210
|
$t,
|
|
211
211
|
{
|
|
212
212
|
"aria-label": ["min", "max"],
|
|
213
213
|
isReversed: n,
|
|
214
|
-
value: [Number(
|
|
214
|
+
value: [Number(b ?? t), Number(h ?? a)],
|
|
215
215
|
max: a,
|
|
216
216
|
min: t,
|
|
217
217
|
minStepsBetweenThumbs: 3,
|
|
218
218
|
step: 1,
|
|
219
|
-
onChange:
|
|
219
|
+
onChange: z,
|
|
220
220
|
onChangeEnd: N,
|
|
221
|
-
isDisabled:
|
|
221
|
+
isDisabled: k,
|
|
222
222
|
children: [
|
|
223
223
|
/* @__PURE__ */ e.jsx(Ze, { value: t, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
224
224
|
S,
|
|
@@ -226,7 +226,7 @@ const wn = ({
|
|
|
226
226
|
fontSize: m ?? "sm",
|
|
227
227
|
fontWeight: "semibold",
|
|
228
228
|
whiteSpace: "nowrap",
|
|
229
|
-
children:
|
|
229
|
+
children: o ? o?.(t) : t
|
|
230
230
|
}
|
|
231
231
|
) }),
|
|
232
232
|
/* @__PURE__ */ e.jsx(Ze, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
|
|
@@ -236,13 +236,13 @@ const wn = ({
|
|
|
236
236
|
fontWeight: "semibold",
|
|
237
237
|
style: { transform: "translateX(-100%)" },
|
|
238
238
|
whiteSpace: "nowrap",
|
|
239
|
-
children:
|
|
239
|
+
children: o ? o(a) : a
|
|
240
240
|
}
|
|
241
241
|
) }),
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */ e.jsx(S, { fontSize: m, fontWeight: "semibold", children:
|
|
242
|
+
s && /* @__PURE__ */ e.jsxs(Ze, { value: 0, top: "-1em", pos: "relative", children: [
|
|
243
|
+
/* @__PURE__ */ e.jsx(S, { fontSize: m, fontWeight: "semibold", children: o?.(0) ?? "0" }),
|
|
244
244
|
/* @__PURE__ */ e.jsx(
|
|
245
|
-
|
|
245
|
+
se,
|
|
246
246
|
{
|
|
247
247
|
position: "absolute",
|
|
248
248
|
width: "2px",
|
|
@@ -302,7 +302,7 @@ const wn = ({
|
|
|
302
302
|
fontWeight: "bold",
|
|
303
303
|
value: u,
|
|
304
304
|
onChange: (L) => E(!0, L),
|
|
305
|
-
isDisabled: M ||
|
|
305
|
+
isDisabled: M || k,
|
|
306
306
|
children: [
|
|
307
307
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: x[0] }),
|
|
308
308
|
/* @__PURE__ */ e.jsx("option", { value: 1, children: x[1] })
|
|
@@ -315,14 +315,14 @@ const wn = ({
|
|
|
315
315
|
precision: 0,
|
|
316
316
|
size: m ?? "sm",
|
|
317
317
|
min: 0,
|
|
318
|
-
max: u < 0 ? Math.abs(t) :
|
|
319
|
-
value:
|
|
320
|
-
onChange:
|
|
318
|
+
max: u < 0 ? Math.abs(t) : q ?? a,
|
|
319
|
+
value: b === "" ? "" : Math.abs(Number(b ?? t)),
|
|
320
|
+
onChange: re,
|
|
321
321
|
onBlur: K,
|
|
322
322
|
borderWidth: 1,
|
|
323
323
|
borderRadius: 3,
|
|
324
324
|
borderColor: "#ccc",
|
|
325
|
-
isDisabled:
|
|
325
|
+
isDisabled: k,
|
|
326
326
|
...c,
|
|
327
327
|
children: /* @__PURE__ */ e.jsx(
|
|
328
328
|
it,
|
|
@@ -339,15 +339,15 @@ const wn = ({
|
|
|
339
339
|
{
|
|
340
340
|
size: m ?? "sm",
|
|
341
341
|
min: 0,
|
|
342
|
-
max:
|
|
342
|
+
max: y < 0 ? Math.abs(F ?? t) : a,
|
|
343
343
|
precision: 0,
|
|
344
344
|
value: h === "" ? "" : Math.abs(Number(h ?? a)),
|
|
345
|
-
onChange:
|
|
345
|
+
onChange: $,
|
|
346
346
|
onBlur: K,
|
|
347
347
|
borderWidth: 1,
|
|
348
348
|
borderRadius: 3,
|
|
349
349
|
borderColor: "#ccc",
|
|
350
|
-
isDisabled:
|
|
350
|
+
isDisabled: k,
|
|
351
351
|
...c,
|
|
352
352
|
children: /* @__PURE__ */ e.jsx(
|
|
353
353
|
it,
|
|
@@ -365,9 +365,9 @@ const wn = ({
|
|
|
365
365
|
width: "auto",
|
|
366
366
|
size: m,
|
|
367
367
|
fontWeight: "bold",
|
|
368
|
-
value:
|
|
368
|
+
value: y,
|
|
369
369
|
onChange: (L) => E(!1, L),
|
|
370
|
-
isDisabled: M ||
|
|
370
|
+
isDisabled: M || k,
|
|
371
371
|
children: [
|
|
372
372
|
/* @__PURE__ */ e.jsx("option", { value: -1, children: x[0] }),
|
|
373
373
|
/* @__PURE__ */ e.jsx("option", { value: 1, children: x[1] })
|
|
@@ -391,7 +391,7 @@ const wn = ({
|
|
|
391
391
|
label: `This ${d.actionLowerCase} is owned by Quantum`,
|
|
392
392
|
"aria-label": "Quantum owned",
|
|
393
393
|
children: /* @__PURE__ */ e.jsx(
|
|
394
|
-
|
|
394
|
+
se,
|
|
395
395
|
{
|
|
396
396
|
boxSize: "1.5em",
|
|
397
397
|
borderRadius: "full",
|
|
@@ -432,26 +432,26 @@ const wn = ({
|
|
|
432
432
|
onView: c,
|
|
433
433
|
onSelected: m,
|
|
434
434
|
onDuplicate: j,
|
|
435
|
-
disableMultiSelect:
|
|
435
|
+
disableMultiSelect: o,
|
|
436
436
|
disableDelete: l,
|
|
437
437
|
disableEdit: x,
|
|
438
|
-
disableCreate:
|
|
438
|
+
disableCreate: k,
|
|
439
439
|
hideUseCase: f = !0,
|
|
440
440
|
tableProps: I,
|
|
441
441
|
containerProps: w,
|
|
442
|
-
quantumIconSrc:
|
|
442
|
+
quantumIconSrc: b = "/favicon.ico"
|
|
443
443
|
}) => {
|
|
444
|
-
const [h,
|
|
444
|
+
const [h, s] = G(""), [u, y] = G(), { getLabel: M } = xe(), F = T(() => ({
|
|
445
445
|
action: M("action"),
|
|
446
446
|
actionPlural: M("action_plural"),
|
|
447
447
|
actionLowerCase: M("action").toLocaleLowerCase(),
|
|
448
448
|
actionPluralLowerCase: M("action_plural").toLocaleLowerCase()
|
|
449
|
-
}), [M]),
|
|
449
|
+
}), [M]), q = T(() => {
|
|
450
450
|
if (!n)
|
|
451
451
|
return;
|
|
452
452
|
const C = Nn(n, h);
|
|
453
453
|
return f ? C : kn(C, u);
|
|
454
|
-
}, [n, h, u, f]),
|
|
454
|
+
}, [n, h, u, f]), z = P(() => {
|
|
455
455
|
if (!d)
|
|
456
456
|
return;
|
|
457
457
|
const E = n.filter(
|
|
@@ -463,44 +463,44 @@ const wn = ({
|
|
|
463
463
|
return;
|
|
464
464
|
const C = n.filter((E) => E.selected);
|
|
465
465
|
j(C.map((E) => E.id)), m && C.forEach((E) => m(E, !1));
|
|
466
|
-
}, [n, j, m]), K = T(() => n.some((C) => C.selected && !C.quantumOwned), [n]),
|
|
467
|
-
return /* @__PURE__ */ e.jsxs(
|
|
466
|
+
}, [n, j, m]), K = T(() => n.some((C) => C.selected && !C.quantumOwned), [n]), re = T(() => n.some((C) => C.selected), [n]), $ = T(() => n.some((C) => C.selected && C.quantumOwned), [n]);
|
|
467
|
+
return /* @__PURE__ */ e.jsxs(se, { ...w, children: [
|
|
468
468
|
/* @__PURE__ */ e.jsxs(ye, { alignContent: "space-between", gap: 4, children: [
|
|
469
469
|
(a || d || j) && /* @__PURE__ */ e.jsxs(Le, { mb: "1rem", gap: 4, children: [
|
|
470
470
|
a && /* @__PURE__ */ e.jsxs(
|
|
471
471
|
V,
|
|
472
472
|
{
|
|
473
|
-
isDisabled: !a ||
|
|
473
|
+
isDisabled: !a || k,
|
|
474
474
|
colorScheme: "blackAlpha",
|
|
475
475
|
backgroundColor: "gray.700",
|
|
476
476
|
onClick: a,
|
|
477
477
|
children: [
|
|
478
478
|
"Create New ",
|
|
479
|
-
|
|
479
|
+
F.action
|
|
480
480
|
]
|
|
481
481
|
}
|
|
482
482
|
),
|
|
483
|
-
d && !
|
|
483
|
+
d && !o && /* @__PURE__ */ e.jsx(
|
|
484
484
|
Ve,
|
|
485
485
|
{
|
|
486
|
-
label:
|
|
486
|
+
label: $ ? K ? `Quantum-owned ${F.actionPluralLowerCase} are selected and will be skipped` : `Selected ${F.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
|
|
487
487
|
shouldWrapChildren: !0,
|
|
488
488
|
children: /* @__PURE__ */ e.jsx(
|
|
489
489
|
V,
|
|
490
490
|
{
|
|
491
491
|
colorScheme: "gray",
|
|
492
492
|
isDisabled: !K || !d || l,
|
|
493
|
-
onClick:
|
|
493
|
+
onClick: z,
|
|
494
494
|
children: "Delete Selected"
|
|
495
495
|
}
|
|
496
496
|
)
|
|
497
497
|
}
|
|
498
498
|
),
|
|
499
|
-
j && !
|
|
499
|
+
j && !o && /* @__PURE__ */ e.jsx(
|
|
500
500
|
V,
|
|
501
501
|
{
|
|
502
502
|
colorScheme: "gray",
|
|
503
|
-
isDisabled: !
|
|
503
|
+
isDisabled: !re,
|
|
504
504
|
onClick: N,
|
|
505
505
|
children: "Duplicate Selected"
|
|
506
506
|
}
|
|
@@ -509,9 +509,9 @@ const wn = ({
|
|
|
509
509
|
/* @__PURE__ */ e.jsx(
|
|
510
510
|
wn,
|
|
511
511
|
{
|
|
512
|
-
setSearch:
|
|
512
|
+
setSearch: s,
|
|
513
513
|
actions: n,
|
|
514
|
-
updateUseCases:
|
|
514
|
+
updateUseCases: y,
|
|
515
515
|
hideUseCaseFilter: f
|
|
516
516
|
}
|
|
517
517
|
)
|
|
@@ -520,7 +520,7 @@ const wn = ({
|
|
|
520
520
|
/* @__PURE__ */ e.jsx(bt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(Ue, { children: [
|
|
521
521
|
/* @__PURE__ */ e.jsxs(be, { fontWeight: "normal", children: [
|
|
522
522
|
"(showing ",
|
|
523
|
-
|
|
523
|
+
q?.length ?? 0,
|
|
524
524
|
" of",
|
|
525
525
|
" ",
|
|
526
526
|
t ?? n.length,
|
|
@@ -531,20 +531,20 @@ const wn = ({
|
|
|
531
531
|
!f && /* @__PURE__ */ e.jsx(be, { children: "Use Case" }),
|
|
532
532
|
/* @__PURE__ */ e.jsx(be, {})
|
|
533
533
|
] }) }),
|
|
534
|
-
/* @__PURE__ */ e.jsx(yt, { children:
|
|
534
|
+
/* @__PURE__ */ e.jsx(yt, { children: q?.map((C) => /* @__PURE__ */ e.jsxs(
|
|
535
535
|
Ue,
|
|
536
536
|
{
|
|
537
537
|
className: ze(
|
|
538
538
|
"hover:bg-[#f7f7f7]",
|
|
539
|
-
!
|
|
539
|
+
!o && "cursor-pointer",
|
|
540
540
|
C.selected && "bg-gray-200"
|
|
541
541
|
),
|
|
542
542
|
onClick: () => {
|
|
543
|
-
|
|
543
|
+
o || m?.(C, !C.selected);
|
|
544
544
|
},
|
|
545
545
|
children: [
|
|
546
546
|
/* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
|
|
547
|
-
!
|
|
547
|
+
!o && /* @__PURE__ */ e.jsx(e.Fragment, { children: C.selected ? /* @__PURE__ */ e.jsx(nn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(sn, { className: "text-gray-400" }) }),
|
|
548
548
|
(C.quantumOwned || !p) && c && /* @__PURE__ */ e.jsx(
|
|
549
549
|
V,
|
|
550
550
|
{
|
|
@@ -578,7 +578,7 @@ const wn = ({
|
|
|
578
578
|
Tn,
|
|
579
579
|
{
|
|
580
580
|
action: C,
|
|
581
|
-
quantumIconSrc:
|
|
581
|
+
quantumIconSrc: b
|
|
582
582
|
}
|
|
583
583
|
),
|
|
584
584
|
C.name
|
|
@@ -606,30 +606,30 @@ const wn = ({
|
|
|
606
606
|
setButtonOnClick: c,
|
|
607
607
|
quantumOwned: m
|
|
608
608
|
}) => {
|
|
609
|
-
const j = vt(), { getLabel:
|
|
610
|
-
singular:
|
|
611
|
-
plural:
|
|
612
|
-
pluralLowerCase:
|
|
613
|
-
singularLowerCase:
|
|
614
|
-
}), [
|
|
609
|
+
const j = vt(), { getLabel: o } = xe(), l = T(() => ({
|
|
610
|
+
singular: o("action"),
|
|
611
|
+
plural: o("action_plural"),
|
|
612
|
+
pluralLowerCase: o("action_plural").toLowerCase(),
|
|
613
|
+
singularLowerCase: o("action").toLowerCase()
|
|
614
|
+
}), [o]), [x, k] = G("copy"), [f, I] = G(""), [w, b] = G([]), [h, s] = G(!1), [u] = je({
|
|
615
615
|
query: Lt
|
|
616
|
-
}), [
|
|
616
|
+
}), [y] = je({
|
|
617
617
|
query: on,
|
|
618
618
|
variables: { groupId: f },
|
|
619
619
|
pause: !f
|
|
620
620
|
// Only run when group is selected
|
|
621
|
-
}), [, M] = me(et), [,
|
|
621
|
+
}), [, M] = me(et), [, F] = me(
|
|
622
622
|
Mt
|
|
623
|
-
),
|
|
623
|
+
), q = T(() => u.data?.groups ? u.data.groups.map(
|
|
624
624
|
(i) => A(It, i)
|
|
625
|
-
) : [], [u.data]),
|
|
626
|
-
const v = A(fe,
|
|
625
|
+
) : [], [u.data]), z = T(() => y.data ? y.data.actions.map((r) => {
|
|
626
|
+
const v = A(fe, r), O = A(
|
|
627
627
|
tt,
|
|
628
628
|
v.reports
|
|
629
|
-
),
|
|
629
|
+
), W = A(
|
|
630
630
|
Re,
|
|
631
631
|
v.categories
|
|
632
|
-
),
|
|
632
|
+
), Q = A(
|
|
633
633
|
Ye,
|
|
634
634
|
v.metadataGroups
|
|
635
635
|
).map((H) => ({
|
|
@@ -643,26 +643,26 @@ const wn = ({
|
|
|
643
643
|
...H,
|
|
644
644
|
thresholds: A(Se, H.thresholds)
|
|
645
645
|
})),
|
|
646
|
-
categories:
|
|
647
|
-
metadataGroups:
|
|
646
|
+
categories: W,
|
|
647
|
+
metadataGroups: Q
|
|
648
648
|
};
|
|
649
|
-
}) : [], [
|
|
649
|
+
}) : [], [y.data]), N = T(() => z.filter(
|
|
650
650
|
(i) => w.includes(i.id)
|
|
651
|
-
), [
|
|
651
|
+
), [z, w]), K = P(
|
|
652
652
|
(i) => {
|
|
653
|
-
const
|
|
654
|
-
I(
|
|
653
|
+
const r = i?.value || "";
|
|
654
|
+
I(r), b([]);
|
|
655
655
|
},
|
|
656
656
|
[]
|
|
657
|
-
),
|
|
657
|
+
), re = P(
|
|
658
658
|
(i) => {
|
|
659
|
-
const
|
|
660
|
-
|
|
659
|
+
const r = i.map((v) => v.value);
|
|
660
|
+
b(r);
|
|
661
661
|
},
|
|
662
662
|
[]
|
|
663
|
-
),
|
|
663
|
+
), $ = P(
|
|
664
664
|
async (i) => {
|
|
665
|
-
const
|
|
665
|
+
const r = {
|
|
666
666
|
...i,
|
|
667
667
|
name: `${i.name} (Copy)`,
|
|
668
668
|
// Add "(Copy)" suffix to distinguish
|
|
@@ -678,17 +678,17 @@ const wn = ({
|
|
|
678
678
|
})),
|
|
679
679
|
categories: i.categories.map((O) => O.id),
|
|
680
680
|
quantumOwned: m,
|
|
681
|
-
metadataItemIds: i.metadataGroups.flatMap((O) => O.data.map((
|
|
681
|
+
metadataItemIds: i.metadataGroups.flatMap((O) => O.data.map((W) => W.id)).filter((O) => O !== void 0),
|
|
682
682
|
reports: i.reports.map((O) => ({
|
|
683
683
|
...O,
|
|
684
684
|
id: void 0,
|
|
685
|
-
thresholds: O.thresholds.map((
|
|
686
|
-
...
|
|
685
|
+
thresholds: O.thresholds.map((W) => ({
|
|
686
|
+
...W,
|
|
687
687
|
id: void 0
|
|
688
688
|
}))
|
|
689
689
|
})),
|
|
690
690
|
id: void 0
|
|
691
|
-
}, v = await M({ fields:
|
|
691
|
+
}, v = await M({ fields: r });
|
|
692
692
|
if (v.error) throw new Error(v.error.message);
|
|
693
693
|
if (v.data?.createAction)
|
|
694
694
|
return A(fe, v.data.createAction);
|
|
@@ -697,54 +697,54 @@ const wn = ({
|
|
|
697
697
|
[M, m]
|
|
698
698
|
), C = P(
|
|
699
699
|
async (i) => {
|
|
700
|
-
const
|
|
701
|
-
if (
|
|
702
|
-
throw new Error(
|
|
703
|
-
if (
|
|
700
|
+
const r = await F({ id: i.id });
|
|
701
|
+
if (r.error)
|
|
702
|
+
throw new Error(r.error.message);
|
|
703
|
+
if (r.data?.convertActionToQuantumOwned)
|
|
704
704
|
return A(
|
|
705
705
|
fe,
|
|
706
|
-
|
|
706
|
+
r.data.convertActionToQuantumOwned
|
|
707
707
|
);
|
|
708
708
|
throw new Error("No action data returned");
|
|
709
709
|
},
|
|
710
|
-
[
|
|
710
|
+
[F]
|
|
711
711
|
), E = P(async () => {
|
|
712
|
-
if (
|
|
712
|
+
if (s(!0), !N.length) {
|
|
713
713
|
const i = new Error(
|
|
714
714
|
`No ${l.pluralLowerCase} selected for ${x === "copy" ? "copying" : "converting"}`
|
|
715
715
|
);
|
|
716
|
-
a?.(i),
|
|
716
|
+
a?.(i), s(!1);
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
719
|
try {
|
|
720
720
|
const i = [];
|
|
721
|
-
let
|
|
722
|
-
const v = x === "copy" ?
|
|
723
|
-
for (const
|
|
721
|
+
let r = 0;
|
|
722
|
+
const v = x === "copy" ? $ : C, O = x === "copy" ? "copy" : "convert";
|
|
723
|
+
for (const W of N)
|
|
724
724
|
try {
|
|
725
|
-
const te = await v(
|
|
725
|
+
const te = await v(W);
|
|
726
726
|
i.push(te);
|
|
727
727
|
} catch (te) {
|
|
728
728
|
console.error(
|
|
729
|
-
`Failed to ${O} ${l.singularLowerCase} "${
|
|
729
|
+
`Failed to ${O} ${l.singularLowerCase} "${W.name}":`,
|
|
730
730
|
te
|
|
731
|
-
),
|
|
731
|
+
), r++;
|
|
732
732
|
}
|
|
733
733
|
if (i.length > 0) {
|
|
734
|
-
const
|
|
734
|
+
const W = i.length, te = N.length, Q = x === "copy" ? "copied" : "converted", H = x === "copy" ? "copy" : "convert";
|
|
735
735
|
j({
|
|
736
|
-
title:
|
|
737
|
-
description:
|
|
738
|
-
status:
|
|
736
|
+
title: r > 0 ? `Partial ${H} completed` : `${l.plural} ${Q} successfully`,
|
|
737
|
+
description: r > 0 ? `${W} of ${te} ${l.pluralLowerCase} ${Q} successfully` : `${W} ${W > 1 ? l.pluralLowerCase : l.singularLowerCase} ${Q} successfully`,
|
|
738
|
+
status: r > 0 ? "warning" : "success",
|
|
739
739
|
duration: 3e3,
|
|
740
740
|
isClosable: !0
|
|
741
|
-
}), n?.(), I(""),
|
|
741
|
+
}), n?.(), I(""), b([]);
|
|
742
742
|
} else
|
|
743
743
|
throw new Error(
|
|
744
744
|
`Failed to ${O} any ${l.pluralLowerCase}`
|
|
745
745
|
);
|
|
746
746
|
} catch (i) {
|
|
747
|
-
const
|
|
747
|
+
const r = x === "copy" ? "copy" : "convert", v = i instanceof Error ? i.message : `Failed to ${r} ${l.pluralLowerCase}`;
|
|
748
748
|
j({
|
|
749
749
|
title: `${x === "copy" ? "Copy" : "Convert"} failed`,
|
|
750
750
|
description: v,
|
|
@@ -753,19 +753,19 @@ const wn = ({
|
|
|
753
753
|
isClosable: !0
|
|
754
754
|
}), a?.(i instanceof Error ? i : new Error(v));
|
|
755
755
|
} finally {
|
|
756
|
-
|
|
756
|
+
s(!1);
|
|
757
757
|
}
|
|
758
758
|
}, [
|
|
759
759
|
N,
|
|
760
760
|
x,
|
|
761
|
-
|
|
761
|
+
$,
|
|
762
762
|
C,
|
|
763
763
|
j,
|
|
764
764
|
n,
|
|
765
765
|
a,
|
|
766
766
|
l
|
|
767
767
|
]), L = P(() => {
|
|
768
|
-
I(""),
|
|
768
|
+
I(""), b([]), k("copy"), t?.();
|
|
769
769
|
}, [t]);
|
|
770
770
|
ce(() => {
|
|
771
771
|
p && p({
|
|
@@ -778,16 +778,16 @@ const wn = ({
|
|
|
778
778
|
saveButton: E
|
|
779
779
|
});
|
|
780
780
|
}, [c, L, E]);
|
|
781
|
-
const
|
|
781
|
+
const B = T(() => q.map((i) => ({
|
|
782
782
|
value: i.id,
|
|
783
783
|
label: i.name
|
|
784
|
-
})), [
|
|
784
|
+
})), [q]), ee = T(() => z.filter((i) => x === "copy" ? !0 : !i.quantumOwned).map((i) => ({
|
|
785
785
|
value: i.id,
|
|
786
786
|
label: i.name,
|
|
787
787
|
// Add custom data to identify quantum-owned actions for UI display
|
|
788
788
|
isQuantumOwned: i.quantumOwned
|
|
789
|
-
})), [
|
|
790
|
-
return /* @__PURE__ */ e.jsx(
|
|
789
|
+
})), [z, x]), U = u.fetching, ae = y.fetching;
|
|
790
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
|
|
791
791
|
m && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
792
792
|
/* @__PURE__ */ e.jsx(pe, { children: "Operation Mode" }),
|
|
793
793
|
/* @__PURE__ */ e.jsx(
|
|
@@ -795,7 +795,7 @@ const wn = ({
|
|
|
795
795
|
{
|
|
796
796
|
value: x,
|
|
797
797
|
onChange: (i) => {
|
|
798
|
-
|
|
798
|
+
k(i), b([]);
|
|
799
799
|
},
|
|
800
800
|
children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, children: [
|
|
801
801
|
/* @__PURE__ */ e.jsx(Qe, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
|
|
@@ -832,8 +832,8 @@ const wn = ({
|
|
|
832
832
|
ge,
|
|
833
833
|
{
|
|
834
834
|
placeholder: "Choose a group...",
|
|
835
|
-
options:
|
|
836
|
-
value:
|
|
835
|
+
options: B,
|
|
836
|
+
value: B.find((i) => i.value === f) || null,
|
|
837
837
|
onChange: K,
|
|
838
838
|
isLoading: U,
|
|
839
839
|
isDisabled: U,
|
|
@@ -872,17 +872,17 @@ const wn = ({
|
|
|
872
872
|
value: ee.filter(
|
|
873
873
|
(i) => w.includes(i.value)
|
|
874
874
|
),
|
|
875
|
-
onChange:
|
|
875
|
+
onChange: re,
|
|
876
876
|
isDisabled: ee.length === 0,
|
|
877
877
|
isClearable: !0,
|
|
878
878
|
isMulti: !0,
|
|
879
879
|
closeMenuOnSelect: !1,
|
|
880
|
-
formatOptionLabel: (i, { context:
|
|
880
|
+
formatOptionLabel: (i, { context: r }) => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", w: "100%", children: [
|
|
881
881
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
882
882
|
/* @__PURE__ */ e.jsx(S, { children: i.label }),
|
|
883
|
-
|
|
883
|
+
r === "value" && i.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
884
884
|
] }),
|
|
885
|
-
i.isQuantumOwned &&
|
|
885
|
+
i.isQuantumOwned && r === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
886
886
|
] })
|
|
887
887
|
}
|
|
888
888
|
),
|
|
@@ -892,22 +892,22 @@ const wn = ({
|
|
|
892
892
|
" found"
|
|
893
893
|
] })
|
|
894
894
|
] }),
|
|
895
|
-
|
|
895
|
+
y.error && /* @__PURE__ */ e.jsxs(qe, { status: "error", mt: 2, children: [
|
|
896
896
|
/* @__PURE__ */ e.jsx(Ke, {}),
|
|
897
897
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
|
|
898
898
|
"Failed to load ",
|
|
899
899
|
l.pluralLowerCase,
|
|
900
900
|
":",
|
|
901
901
|
" ",
|
|
902
|
-
|
|
902
|
+
y.error.message
|
|
903
903
|
] })
|
|
904
904
|
] })
|
|
905
905
|
] }),
|
|
906
|
-
N.length > 0 && /* @__PURE__ */ e.jsxs(
|
|
906
|
+
N.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
907
907
|
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${l.singular} to ${x === "copy" ? "Copy" : "Convert"}:` : `${N.length} ${l.plural} to ${x === "copy" ? "Copy" : "Convert"}:` }),
|
|
908
908
|
/* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
|
|
909
|
-
N.map((i,
|
|
910
|
-
|
|
909
|
+
N.map((i, r) => /* @__PURE__ */ e.jsxs(
|
|
910
|
+
se,
|
|
911
911
|
{
|
|
912
912
|
w: "100%",
|
|
913
913
|
p: 3,
|
|
@@ -918,7 +918,7 @@ const wn = ({
|
|
|
918
918
|
children: [
|
|
919
919
|
/* @__PURE__ */ e.jsxs(oe, { justify: "space-between", align: "start", mb: 2, children: [
|
|
920
920
|
/* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
|
|
921
|
-
|
|
921
|
+
r + 1,
|
|
922
922
|
". ",
|
|
923
923
|
i.name
|
|
924
924
|
] }),
|
|
@@ -970,7 +970,7 @@ const wn = ({
|
|
|
970
970
|
i.id
|
|
971
971
|
)),
|
|
972
972
|
N.length > 1 && /* @__PURE__ */ e.jsx(
|
|
973
|
-
|
|
973
|
+
se,
|
|
974
974
|
{
|
|
975
975
|
w: "100%",
|
|
976
976
|
p: 2,
|
|
@@ -1027,28 +1027,28 @@ const wn = ({
|
|
|
1027
1027
|
setButtonOnClick: c,
|
|
1028
1028
|
quantumOwned: m
|
|
1029
1029
|
}) => {
|
|
1030
|
-
const j = vt(), { getLabel:
|
|
1031
|
-
singular:
|
|
1032
|
-
plural:
|
|
1033
|
-
pluralLowerCase:
|
|
1034
|
-
singularLowerCase:
|
|
1035
|
-
}), [
|
|
1036
|
-
singular:
|
|
1037
|
-
plural:
|
|
1038
|
-
pluralLowerCase:
|
|
1039
|
-
singularLowerCase:
|
|
1040
|
-
}), [
|
|
1030
|
+
const j = vt(), { getLabel: o } = xe(), l = T(() => ({
|
|
1031
|
+
singular: o("module"),
|
|
1032
|
+
plural: o("module_plural"),
|
|
1033
|
+
pluralLowerCase: o("module_plural").toLowerCase(),
|
|
1034
|
+
singularLowerCase: o("module").toLowerCase()
|
|
1035
|
+
}), [o]), x = T(() => ({
|
|
1036
|
+
singular: o("action"),
|
|
1037
|
+
plural: o("action_plural"),
|
|
1038
|
+
pluralLowerCase: o("action_plural").toLowerCase(),
|
|
1039
|
+
singularLowerCase: o("action").toLowerCase()
|
|
1040
|
+
}), [o]), [k, f] = G(""), [I, w] = G([]), [b, h] = G(!1), [s, u] = G("copy"), [y] = je({
|
|
1041
1041
|
query: Lt
|
|
1042
1042
|
}), [M] = je({
|
|
1043
1043
|
query: an,
|
|
1044
|
-
variables: { groupId:
|
|
1045
|
-
pause: !
|
|
1044
|
+
variables: { groupId: k },
|
|
1045
|
+
pause: !k
|
|
1046
1046
|
// Only run when group is selected
|
|
1047
|
-
}), [,
|
|
1047
|
+
}), [, F] = me(Ot), [, q] = me(At), [, z] = me(et), [, N] = me(
|
|
1048
1048
|
Mt
|
|
1049
|
-
), K = T(() =>
|
|
1050
|
-
(
|
|
1051
|
-
) : [], [
|
|
1049
|
+
), K = T(() => y.data?.groups ? y.data.groups.map(
|
|
1050
|
+
(r) => A(It, r)
|
|
1051
|
+
) : [], [y.data]), re = T(() => M.data?.modules ? A(
|
|
1052
1052
|
Be,
|
|
1053
1053
|
M.data?.modules
|
|
1054
1054
|
).map((v) => {
|
|
@@ -1058,47 +1058,47 @@ const wn = ({
|
|
|
1058
1058
|
);
|
|
1059
1059
|
return {
|
|
1060
1060
|
...v,
|
|
1061
|
-
moduleActions: O.map((
|
|
1062
|
-
...
|
|
1063
|
-
action: A(fe,
|
|
1061
|
+
moduleActions: O.map((W) => ({
|
|
1062
|
+
...W,
|
|
1063
|
+
action: A(fe, W.action)
|
|
1064
1064
|
})),
|
|
1065
1065
|
categories: A(
|
|
1066
1066
|
Re,
|
|
1067
1067
|
v.categories
|
|
1068
1068
|
)
|
|
1069
1069
|
};
|
|
1070
|
-
}) : [], [M.data]),
|
|
1071
|
-
(
|
|
1072
|
-
), [
|
|
1073
|
-
(
|
|
1074
|
-
const v =
|
|
1070
|
+
}) : [], [M.data]), $ = T(() => re.filter(
|
|
1071
|
+
(r) => I.includes(r.id)
|
|
1072
|
+
), [re, I]), C = P(
|
|
1073
|
+
(r) => {
|
|
1074
|
+
const v = r?.value || "";
|
|
1075
1075
|
f(v), w([]);
|
|
1076
1076
|
},
|
|
1077
1077
|
[]
|
|
1078
1078
|
), E = P(
|
|
1079
|
-
(
|
|
1080
|
-
const v =
|
|
1079
|
+
(r) => {
|
|
1080
|
+
const v = r.map((O) => O.value);
|
|
1081
1081
|
w(v);
|
|
1082
1082
|
},
|
|
1083
1083
|
[]
|
|
1084
1084
|
), L = P(async () => {
|
|
1085
|
-
if (h(!0),
|
|
1085
|
+
if (h(!0), !$.length) {
|
|
1086
1086
|
h(!1);
|
|
1087
|
-
const
|
|
1088
|
-
`No modules selected for ${
|
|
1087
|
+
const r = new Error(
|
|
1088
|
+
`No modules selected for ${s === "convert" ? "converting" : "copying"}`
|
|
1089
1089
|
);
|
|
1090
|
-
a?.(
|
|
1090
|
+
a?.(r);
|
|
1091
1091
|
return;
|
|
1092
1092
|
}
|
|
1093
1093
|
try {
|
|
1094
|
-
const
|
|
1094
|
+
const r = [];
|
|
1095
1095
|
let v = 0;
|
|
1096
|
-
for (const O of
|
|
1096
|
+
for (const O of $)
|
|
1097
1097
|
try {
|
|
1098
|
-
let
|
|
1098
|
+
let W = O.moduleActions.map((te) => te.actionId);
|
|
1099
1099
|
if (m) {
|
|
1100
|
-
const te = O.moduleActions.map((Y) => Y.action),
|
|
1101
|
-
if (
|
|
1100
|
+
const te = O.moduleActions.map((Y) => Y.action), Q = async (Y) => {
|
|
1101
|
+
if (s === "copy") {
|
|
1102
1102
|
if (Y.quantumOwned) return Y;
|
|
1103
1103
|
const ve = A(
|
|
1104
1104
|
Re,
|
|
@@ -1136,7 +1136,7 @@ const wn = ({
|
|
|
1136
1136
|
reports: Ie,
|
|
1137
1137
|
metadataIds: Fe,
|
|
1138
1138
|
id: void 0
|
|
1139
|
-
}, Ae = await
|
|
1139
|
+
}, Ae = await z({ fields: $e });
|
|
1140
1140
|
return Ae.error || !Ae.data?.createAction ? null : A(
|
|
1141
1141
|
fe,
|
|
1142
1142
|
Ae.data.createAction
|
|
@@ -1151,121 +1151,121 @@ const wn = ({
|
|
|
1151
1151
|
Me.data.convertActionToQuantumOwned
|
|
1152
1152
|
);
|
|
1153
1153
|
};
|
|
1154
|
-
|
|
1155
|
-
te.map(
|
|
1154
|
+
W = (await Promise.all(
|
|
1155
|
+
te.map(Q)
|
|
1156
1156
|
)).filter((Y) => !!Y).map((Y) => Y.id);
|
|
1157
1157
|
}
|
|
1158
|
-
if (
|
|
1158
|
+
if (s === "convert") {
|
|
1159
1159
|
const te = {
|
|
1160
1160
|
name: O.name,
|
|
1161
1161
|
description: O.description || void 0,
|
|
1162
|
-
actions:
|
|
1162
|
+
actions: W,
|
|
1163
1163
|
categories: O.categories.map((H) => H.id),
|
|
1164
1164
|
quantumOwned: !0
|
|
1165
|
-
},
|
|
1165
|
+
}, Q = await q({
|
|
1166
1166
|
id: O.id,
|
|
1167
1167
|
input: te
|
|
1168
1168
|
});
|
|
1169
|
-
if (
|
|
1170
|
-
if (
|
|
1169
|
+
if (Q.error) throw new Error(Q.error.message);
|
|
1170
|
+
if (Q.data?.updateModule) {
|
|
1171
1171
|
const H = A(
|
|
1172
1172
|
Be,
|
|
1173
|
-
|
|
1173
|
+
Q.data.updateModule
|
|
1174
1174
|
);
|
|
1175
|
-
|
|
1175
|
+
r.push(H);
|
|
1176
1176
|
}
|
|
1177
1177
|
} else {
|
|
1178
1178
|
const te = {
|
|
1179
1179
|
name: `${O.name} (Copy)`,
|
|
1180
1180
|
description: O.description || void 0,
|
|
1181
|
-
actions:
|
|
1181
|
+
actions: W,
|
|
1182
1182
|
categories: O.categories.map((H) => H.id),
|
|
1183
1183
|
quantumOwned: m
|
|
1184
|
-
},
|
|
1185
|
-
if (
|
|
1186
|
-
if (
|
|
1184
|
+
}, Q = await F({ input: te });
|
|
1185
|
+
if (Q.error) throw new Error(Q.error.message);
|
|
1186
|
+
if (Q.data?.createModule) {
|
|
1187
1187
|
const H = A(
|
|
1188
1188
|
Be,
|
|
1189
|
-
|
|
1189
|
+
Q.data.createModule
|
|
1190
1190
|
);
|
|
1191
|
-
|
|
1191
|
+
r.push(H);
|
|
1192
1192
|
}
|
|
1193
1193
|
}
|
|
1194
|
-
} catch (
|
|
1194
|
+
} catch (W) {
|
|
1195
1195
|
console.error(
|
|
1196
|
-
`Failed to ${
|
|
1197
|
-
|
|
1196
|
+
`Failed to ${s === "convert" ? "convert" : "copy"} module "${O.name}":`,
|
|
1197
|
+
W
|
|
1198
1198
|
), v++;
|
|
1199
1199
|
}
|
|
1200
|
-
if (
|
|
1201
|
-
const O =
|
|
1200
|
+
if (r.length > 0) {
|
|
1201
|
+
const O = r.length, W = $.length;
|
|
1202
1202
|
j({
|
|
1203
|
-
title: v > 0 ? `Partial ${
|
|
1204
|
-
description: v > 0 ? `${O} of ${
|
|
1203
|
+
title: v > 0 ? `Partial ${s === "convert" ? "convert" : "copy"} completed` : `${l.plural} ${s === "convert" ? "converted" : "copied"} successfully`,
|
|
1204
|
+
description: v > 0 ? `${O} of ${W} ${l.plural} ${s === "convert" ? "converted" : "copied"} successfully` : `${O} ${O > 1 ? l.plural : l.singular} ${s === "convert" ? "converted" : "copied"} successfully`,
|
|
1205
1205
|
status: v > 0 ? "warning" : "success",
|
|
1206
1206
|
duration: 3e3,
|
|
1207
1207
|
isClosable: !0
|
|
1208
|
-
}),
|
|
1208
|
+
}), r.length > 0 && n?.(), f(""), w([]);
|
|
1209
1209
|
} else
|
|
1210
1210
|
throw new Error(
|
|
1211
|
-
`Failed to ${
|
|
1211
|
+
`Failed to ${s === "convert" ? "convert" : "copy"} any modules`
|
|
1212
1212
|
);
|
|
1213
|
-
} catch (
|
|
1214
|
-
const v =
|
|
1213
|
+
} catch (r) {
|
|
1214
|
+
const v = r instanceof Error ? r.message : `Failed to ${s === "convert" ? "convert" : "copy"} modules`;
|
|
1215
1215
|
j({
|
|
1216
|
-
title:
|
|
1216
|
+
title: s === "convert" ? "Convert failed" : "Copy failed",
|
|
1217
1217
|
description: v,
|
|
1218
1218
|
status: "error",
|
|
1219
1219
|
duration: 5e3,
|
|
1220
1220
|
isClosable: !0
|
|
1221
|
-
}), a?.(
|
|
1221
|
+
}), a?.(r instanceof Error ? r : new Error(v));
|
|
1222
1222
|
} finally {
|
|
1223
1223
|
h(!1);
|
|
1224
1224
|
}
|
|
1225
1225
|
}, [
|
|
1226
|
+
$,
|
|
1226
1227
|
F,
|
|
1227
|
-
|
|
1228
|
-
Q,
|
|
1228
|
+
q,
|
|
1229
1229
|
j,
|
|
1230
1230
|
n,
|
|
1231
1231
|
a,
|
|
1232
1232
|
m,
|
|
1233
|
-
|
|
1233
|
+
z,
|
|
1234
1234
|
N,
|
|
1235
|
-
|
|
1235
|
+
s,
|
|
1236
1236
|
l
|
|
1237
|
-
]),
|
|
1237
|
+
]), B = P(() => {
|
|
1238
1238
|
f(""), w([]), u("copy"), t?.();
|
|
1239
1239
|
}, [t]);
|
|
1240
1240
|
ce(() => {
|
|
1241
1241
|
p && p({
|
|
1242
1242
|
cancelButton: !1,
|
|
1243
|
-
saveButton:
|
|
1243
|
+
saveButton: $.length === 0 || b
|
|
1244
1244
|
});
|
|
1245
|
-
}, [
|
|
1245
|
+
}, [$.length, b, p]), ce(() => {
|
|
1246
1246
|
c && c({
|
|
1247
|
-
cancelButton:
|
|
1247
|
+
cancelButton: B,
|
|
1248
1248
|
saveButton: L
|
|
1249
1249
|
});
|
|
1250
|
-
}, [c,
|
|
1251
|
-
const ee = T(() => K.map((
|
|
1252
|
-
value:
|
|
1253
|
-
label:
|
|
1254
|
-
})), [K]), U = T(() =>
|
|
1255
|
-
value:
|
|
1256
|
-
label:
|
|
1250
|
+
}, [c, B, L]);
|
|
1251
|
+
const ee = T(() => K.map((r) => ({
|
|
1252
|
+
value: r.id,
|
|
1253
|
+
label: r.name
|
|
1254
|
+
})), [K]), U = T(() => re.filter((r) => s === "copy" ? !0 : !r.quantumOwned).map((r) => ({
|
|
1255
|
+
value: r.id,
|
|
1256
|
+
label: r.name,
|
|
1257
1257
|
// Add custom data to identify quantum-owned modules
|
|
1258
|
-
isQuantumOwned:
|
|
1259
|
-
})), [
|
|
1260
|
-
return /* @__PURE__ */ e.jsx(
|
|
1258
|
+
isQuantumOwned: r.quantumOwned
|
|
1259
|
+
})), [re, s]), ae = y.fetching, i = M.fetching;
|
|
1260
|
+
return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
|
|
1261
1261
|
m && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1262
1262
|
/* @__PURE__ */ e.jsx(pe, { children: "Operation Mode" }),
|
|
1263
1263
|
/* @__PURE__ */ e.jsx(
|
|
1264
1264
|
Ct,
|
|
1265
1265
|
{
|
|
1266
|
-
value:
|
|
1267
|
-
onChange: (
|
|
1268
|
-
u(
|
|
1266
|
+
value: s,
|
|
1267
|
+
onChange: (r) => {
|
|
1268
|
+
u(r), w([]);
|
|
1269
1269
|
},
|
|
1270
1270
|
children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, children: [
|
|
1271
1271
|
/* @__PURE__ */ e.jsx(Qe, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
|
|
@@ -1298,23 +1298,23 @@ const wn = ({
|
|
|
1298
1298
|
{
|
|
1299
1299
|
placeholder: "Choose a group...",
|
|
1300
1300
|
options: ee,
|
|
1301
|
-
value: ee.find((
|
|
1301
|
+
value: ee.find((r) => r.value === k) || null,
|
|
1302
1302
|
onChange: C,
|
|
1303
1303
|
isLoading: ae,
|
|
1304
1304
|
isDisabled: ae,
|
|
1305
1305
|
isClearable: !0
|
|
1306
1306
|
}
|
|
1307
1307
|
),
|
|
1308
|
-
|
|
1308
|
+
y.error && /* @__PURE__ */ e.jsxs(qe, { status: "error", mt: 2, children: [
|
|
1309
1309
|
/* @__PURE__ */ e.jsx(Ke, {}),
|
|
1310
1310
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
|
|
1311
1311
|
"Failed to load groups: ",
|
|
1312
|
-
|
|
1312
|
+
y.error.message
|
|
1313
1313
|
] })
|
|
1314
1314
|
] })
|
|
1315
1315
|
] }),
|
|
1316
|
-
|
|
1317
|
-
/* @__PURE__ */ e.jsx(pe, { children:
|
|
1316
|
+
k && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
1317
|
+
/* @__PURE__ */ e.jsx(pe, { children: s === "convert" ? `Select ${l.plural} to Convert` : `Select ${l.plural} to Copy` }),
|
|
1318
1318
|
i ? /* @__PURE__ */ e.jsxs(oe, { children: [
|
|
1319
1319
|
/* @__PURE__ */ e.jsx(wt, { size: "sm" }),
|
|
1320
1320
|
/* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
|
|
@@ -1326,22 +1326,22 @@ const wn = ({
|
|
|
1326
1326
|
/* @__PURE__ */ e.jsx(
|
|
1327
1327
|
ge,
|
|
1328
1328
|
{
|
|
1329
|
-
placeholder:
|
|
1329
|
+
placeholder: s === "convert" ? `Choose ${l.pluralLowerCase} to convert...` : `Choose ${l.pluralLowerCase} to copy...`,
|
|
1330
1330
|
options: U,
|
|
1331
1331
|
value: U.filter(
|
|
1332
|
-
(
|
|
1332
|
+
(r) => I.includes(r.value)
|
|
1333
1333
|
),
|
|
1334
1334
|
onChange: E,
|
|
1335
1335
|
isDisabled: U.length === 0,
|
|
1336
1336
|
isClearable: !0,
|
|
1337
1337
|
isMulti: !0,
|
|
1338
1338
|
closeMenuOnSelect: !1,
|
|
1339
|
-
formatOptionLabel: (
|
|
1339
|
+
formatOptionLabel: (r, { context: v }) => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", w: "100%", children: [
|
|
1340
1340
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1341
|
-
/* @__PURE__ */ e.jsx(S, { children:
|
|
1342
|
-
v === "value" &&
|
|
1341
|
+
/* @__PURE__ */ e.jsx(S, { children: r.label }),
|
|
1342
|
+
v === "value" && r.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
|
|
1343
1343
|
] }),
|
|
1344
|
-
|
|
1344
|
+
r.isQuantumOwned && v === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1345
1345
|
] })
|
|
1346
1346
|
}
|
|
1347
1347
|
),
|
|
@@ -1362,11 +1362,11 @@ const wn = ({
|
|
|
1362
1362
|
] })
|
|
1363
1363
|
] })
|
|
1364
1364
|
] }),
|
|
1365
|
-
|
|
1366
|
-
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children:
|
|
1365
|
+
$.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
|
|
1366
|
+
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: $.length === 1 ? `${l.singular} to ${s === "copy" ? "Copy" : "Convert"}` : `${$.length} ${l.plural} to ${s === "copy" ? "Copy" : "Convert"}` }),
|
|
1367
1367
|
/* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
|
|
1368
|
-
|
|
1369
|
-
|
|
1368
|
+
$.map((r, v) => /* @__PURE__ */ e.jsxs(
|
|
1369
|
+
se,
|
|
1370
1370
|
{
|
|
1371
1371
|
w: "100%",
|
|
1372
1372
|
p: 3,
|
|
@@ -1379,9 +1379,9 @@ const wn = ({
|
|
|
1379
1379
|
/* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
|
|
1380
1380
|
v + 1,
|
|
1381
1381
|
". ",
|
|
1382
|
-
|
|
1382
|
+
r.name
|
|
1383
1383
|
] }),
|
|
1384
|
-
|
|
1384
|
+
r.quantumOwned && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
|
|
1385
1385
|
] }),
|
|
1386
1386
|
/* @__PURE__ */ e.jsxs(
|
|
1387
1387
|
le,
|
|
@@ -1391,30 +1391,30 @@ const wn = ({
|
|
|
1391
1391
|
fontSize: "sm",
|
|
1392
1392
|
color: "gray.600",
|
|
1393
1393
|
children: [
|
|
1394
|
-
|
|
1394
|
+
r.description && /* @__PURE__ */ e.jsxs(S, { children: [
|
|
1395
1395
|
/* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
|
|
1396
1396
|
" ",
|
|
1397
|
-
|
|
1397
|
+
r.description
|
|
1398
1398
|
] }),
|
|
1399
1399
|
/* @__PURE__ */ e.jsxs(S, { children: [
|
|
1400
1400
|
/* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
|
|
1401
1401
|
" ",
|
|
1402
|
-
|
|
1402
|
+
r.moduleActions.length
|
|
1403
1403
|
] }),
|
|
1404
1404
|
/* @__PURE__ */ e.jsxs(S, { children: [
|
|
1405
1405
|
/* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
|
|
1406
1406
|
" ",
|
|
1407
|
-
|
|
1407
|
+
r.categories.map((O) => O.name).join(", ") || "None"
|
|
1408
1408
|
] })
|
|
1409
1409
|
]
|
|
1410
1410
|
}
|
|
1411
1411
|
)
|
|
1412
1412
|
]
|
|
1413
1413
|
},
|
|
1414
|
-
|
|
1414
|
+
r.id
|
|
1415
1415
|
)),
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
$.length > 1 && /* @__PURE__ */ e.jsx(
|
|
1417
|
+
se,
|
|
1418
1418
|
{
|
|
1419
1419
|
w: "100%",
|
|
1420
1420
|
p: 2,
|
|
@@ -1424,24 +1424,24 @@ const wn = ({
|
|
|
1424
1424
|
borderColor: "blue.200",
|
|
1425
1425
|
children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
|
|
1426
1426
|
"Total: ",
|
|
1427
|
-
|
|
1427
|
+
$.length,
|
|
1428
1428
|
" ",
|
|
1429
1429
|
l.pluralLowerCase,
|
|
1430
1430
|
" will be",
|
|
1431
1431
|
" ",
|
|
1432
|
-
|
|
1432
|
+
s === "copy" ? "copied" : "converted"
|
|
1433
1433
|
] })
|
|
1434
1434
|
}
|
|
1435
1435
|
),
|
|
1436
|
-
m &&
|
|
1437
|
-
|
|
1436
|
+
m && $.filter((r) => r.moduleActions.some((v) => !v.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
|
|
1437
|
+
se,
|
|
1438
1438
|
{
|
|
1439
1439
|
p: 2,
|
|
1440
1440
|
bg: "yellow.50",
|
|
1441
1441
|
borderRadius: "md",
|
|
1442
1442
|
border: "1px solid",
|
|
1443
1443
|
borderColor: "yellow.200",
|
|
1444
|
-
children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children:
|
|
1444
|
+
children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: s === "convert" ? `Converting ${l.plural} will convert non QM-Owned ${x.plural} to QM-Owned ${x.plural}` : `Copying ${l.plural} with Non QM-Owned ${x.plural} will create corresponding QM-Owned ${x.plural}` })
|
|
1445
1445
|
}
|
|
1446
1446
|
)
|
|
1447
1447
|
] })
|
|
@@ -1451,23 +1451,23 @@ const wn = ({
|
|
|
1451
1451
|
V,
|
|
1452
1452
|
{
|
|
1453
1453
|
variant: "outline",
|
|
1454
|
-
onClick:
|
|
1455
|
-
isDisabled:
|
|
1454
|
+
onClick: B,
|
|
1455
|
+
isDisabled: b,
|
|
1456
1456
|
children: "Cancel"
|
|
1457
1457
|
}
|
|
1458
1458
|
),
|
|
1459
1459
|
/* @__PURE__ */ e.jsxs(
|
|
1460
1460
|
V,
|
|
1461
1461
|
{
|
|
1462
|
-
colorScheme:
|
|
1462
|
+
colorScheme: s === "copy" ? "blue" : "green",
|
|
1463
1463
|
onClick: L,
|
|
1464
|
-
isDisabled:
|
|
1465
|
-
isLoading:
|
|
1466
|
-
loadingText: `${
|
|
1464
|
+
isDisabled: $.length === 0 || b,
|
|
1465
|
+
isLoading: b,
|
|
1466
|
+
loadingText: `${s === "copy" ? "Copying" : "Converting"}...`,
|
|
1467
1467
|
children: [
|
|
1468
|
-
|
|
1468
|
+
s === "copy" ? "Copy" : "Convert",
|
|
1469
1469
|
" ",
|
|
1470
|
-
|
|
1470
|
+
$.length === 1 ? l.singular : `${$.length} ${l.plural}`
|
|
1471
1471
|
]
|
|
1472
1472
|
}
|
|
1473
1473
|
)
|
|
@@ -1482,19 +1482,19 @@ const wn = ({
|
|
|
1482
1482
|
availableCategories: c,
|
|
1483
1483
|
selectedCategoryIds: m,
|
|
1484
1484
|
setSelectedCategoryIds: j,
|
|
1485
|
-
description:
|
|
1485
|
+
description: o,
|
|
1486
1486
|
setDescription: l,
|
|
1487
1487
|
...x
|
|
1488
1488
|
}) => {
|
|
1489
|
-
const
|
|
1489
|
+
const k = _t(), f = T(() => a.map((u) => ({
|
|
1490
1490
|
...u,
|
|
1491
1491
|
selected: d.includes(u.id)
|
|
1492
|
-
})), [a, d]), I = T(() => a.reduce((u,
|
|
1492
|
+
})), [a, d]), I = T(() => a.reduce((u, y) => (u[y.id] = y, u), {}), [a]), w = T(
|
|
1493
1493
|
() => d.map((u) => I[u]),
|
|
1494
1494
|
[d, I]
|
|
1495
|
-
),
|
|
1496
|
-
(u,
|
|
1497
|
-
p(
|
|
1495
|
+
), b = P(
|
|
1496
|
+
(u, y) => {
|
|
1497
|
+
p(y ? [...d, u.id] : d.filter((M) => M !== u.id));
|
|
1498
1498
|
},
|
|
1499
1499
|
[d, p]
|
|
1500
1500
|
), h = P(
|
|
@@ -1502,13 +1502,13 @@ const wn = ({
|
|
|
1502
1502
|
t(u.target.value);
|
|
1503
1503
|
},
|
|
1504
1504
|
[t]
|
|
1505
|
-
),
|
|
1505
|
+
), s = P(
|
|
1506
1506
|
(u) => {
|
|
1507
1507
|
l?.(u.target.value);
|
|
1508
1508
|
},
|
|
1509
1509
|
[l]
|
|
1510
1510
|
);
|
|
1511
|
-
return /* @__PURE__ */ e.jsxs(
|
|
1511
|
+
return /* @__PURE__ */ e.jsxs(se, { ...x, children: [
|
|
1512
1512
|
/* @__PURE__ */ e.jsxs(oe, { gap: "2rem", children: [
|
|
1513
1513
|
/* @__PURE__ */ e.jsx(Dn, { name: n ?? "", onInputChange: h }),
|
|
1514
1514
|
/* @__PURE__ */ e.jsx(
|
|
@@ -1523,23 +1523,23 @@ const wn = ({
|
|
|
1523
1523
|
/* @__PURE__ */ e.jsx(
|
|
1524
1524
|
En,
|
|
1525
1525
|
{
|
|
1526
|
-
description:
|
|
1527
|
-
onInputChange:
|
|
1526
|
+
description: o ?? "",
|
|
1527
|
+
onInputChange: s
|
|
1528
1528
|
}
|
|
1529
1529
|
),
|
|
1530
1530
|
/* @__PURE__ */ e.jsx(
|
|
1531
|
-
|
|
1531
|
+
_n,
|
|
1532
1532
|
{
|
|
1533
1533
|
value: w,
|
|
1534
1534
|
onChange: p,
|
|
1535
|
-
onAdjustActivities: () =>
|
|
1535
|
+
onAdjustActivities: () => k.onOpen()
|
|
1536
1536
|
}
|
|
1537
1537
|
),
|
|
1538
1538
|
/* @__PURE__ */ e.jsxs(
|
|
1539
|
-
|
|
1539
|
+
Gt,
|
|
1540
1540
|
{
|
|
1541
|
-
isOpen:
|
|
1542
|
-
onClose:
|
|
1541
|
+
isOpen: k.isOpen,
|
|
1542
|
+
onClose: k.onClose,
|
|
1543
1543
|
size: "6xl",
|
|
1544
1544
|
children: [
|
|
1545
1545
|
/* @__PURE__ */ e.jsx(zt, {}),
|
|
@@ -1550,7 +1550,7 @@ const wn = ({
|
|
|
1550
1550
|
Fn,
|
|
1551
1551
|
{
|
|
1552
1552
|
actions: f,
|
|
1553
|
-
onSelected:
|
|
1553
|
+
onSelected: b,
|
|
1554
1554
|
disableCreate: !0,
|
|
1555
1555
|
disableDelete: !0,
|
|
1556
1556
|
tableProps: {
|
|
@@ -1563,7 +1563,7 @@ const wn = ({
|
|
|
1563
1563
|
V,
|
|
1564
1564
|
{
|
|
1565
1565
|
colorScheme: "blue",
|
|
1566
|
-
onClick:
|
|
1566
|
+
onClick: k.onClose,
|
|
1567
1567
|
isDisabled: d.length === 0,
|
|
1568
1568
|
children: "Done"
|
|
1569
1569
|
}
|
|
@@ -1657,7 +1657,7 @@ const wn = ({
|
|
|
1657
1657
|
)
|
|
1658
1658
|
] });
|
|
1659
1659
|
}
|
|
1660
|
-
),
|
|
1660
|
+
), _n = Je(
|
|
1661
1661
|
({
|
|
1662
1662
|
value: n,
|
|
1663
1663
|
onChange: t,
|
|
@@ -1730,13 +1730,13 @@ const wn = ({
|
|
|
1730
1730
|
value: c,
|
|
1731
1731
|
onChange: (m) => {
|
|
1732
1732
|
const j = m(c);
|
|
1733
|
-
t(j.map((
|
|
1733
|
+
t(j.map((o) => o.id));
|
|
1734
1734
|
}
|
|
1735
1735
|
}
|
|
1736
1736
|
)
|
|
1737
1737
|
] });
|
|
1738
1738
|
}
|
|
1739
|
-
),
|
|
1739
|
+
), Gn = ({
|
|
1740
1740
|
value: n,
|
|
1741
1741
|
onChange: t,
|
|
1742
1742
|
forceKind: a,
|
|
@@ -1746,38 +1746,38 @@ const wn = ({
|
|
|
1746
1746
|
lockRanges: m,
|
|
1747
1747
|
...j
|
|
1748
1748
|
}) => {
|
|
1749
|
-
const
|
|
1750
|
-
const w = ht.indexOf(f.plane),
|
|
1751
|
-
return w -
|
|
1749
|
+
const o = T(() => [...n].sort((f, I) => {
|
|
1750
|
+
const w = ht.indexOf(f.plane), b = ht.indexOf(I.plane);
|
|
1751
|
+
return w - b;
|
|
1752
1752
|
}), [n]), l = P((f) => "segment" in f.id ? Nt(f.id.segment, f.plane, !0) ?? "Unknown" : Rt(f.id.joint, f.plane, !0) ?? "Unknown", []), x = P(
|
|
1753
1753
|
(f, I) => {
|
|
1754
|
-
const w =
|
|
1754
|
+
const w = o.findIndex(
|
|
1755
1755
|
(h) => h.id === I.id && h.plane === I.plane
|
|
1756
1756
|
);
|
|
1757
|
-
let
|
|
1758
|
-
a && (I = { ...I, kind: a }),
|
|
1757
|
+
let b = [...o];
|
|
1758
|
+
a && (I = { ...I, kind: a }), b[w] = I, m && (b = b.map((h) => ({
|
|
1759
1759
|
...h,
|
|
1760
1760
|
min: I.min,
|
|
1761
1761
|
max: I.max
|
|
1762
|
-
}))), t(
|
|
1762
|
+
}))), t(b);
|
|
1763
1763
|
},
|
|
1764
|
-
[t,
|
|
1765
|
-
),
|
|
1764
|
+
[t, o, a, m]
|
|
1765
|
+
), k = P(
|
|
1766
1766
|
(f) => {
|
|
1767
|
-
const I =
|
|
1767
|
+
const I = o.filter(
|
|
1768
1768
|
(w) => w.id !== f.id || w.plane !== f.plane
|
|
1769
1769
|
);
|
|
1770
1770
|
t(I);
|
|
1771
1771
|
},
|
|
1772
|
-
[t,
|
|
1772
|
+
[t, o]
|
|
1773
1773
|
);
|
|
1774
|
-
return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...j, children:
|
|
1774
|
+
return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...j, children: o.map((f, I) => /* @__PURE__ */ e.jsx(
|
|
1775
1775
|
zn,
|
|
1776
1776
|
{
|
|
1777
1777
|
label: l(f),
|
|
1778
1778
|
parameter: f,
|
|
1779
1779
|
onChange: (w) => x(I, w),
|
|
1780
|
-
onRemove: d || c ? void 0 : () =>
|
|
1780
|
+
onRemove: d || c ? void 0 : () => k(f),
|
|
1781
1781
|
forceKind: a,
|
|
1782
1782
|
disableKind: p || c,
|
|
1783
1783
|
isDisabled: c
|
|
@@ -1804,7 +1804,7 @@ const wn = ({
|
|
|
1804
1804
|
x < 0 ? -1 : 1
|
|
1805
1805
|
),
|
|
1806
1806
|
[t]
|
|
1807
|
-
), { min:
|
|
1807
|
+
), { min: o, max: l } = "joint" in t.id ? Cn(t.id.joint, t.plane) : { min: -180, max: 180 };
|
|
1808
1808
|
return /* @__PURE__ */ e.jsxs(
|
|
1809
1809
|
le,
|
|
1810
1810
|
{
|
|
@@ -1865,7 +1865,7 @@ const wn = ({
|
|
|
1865
1865
|
{
|
|
1866
1866
|
w: "100%",
|
|
1867
1867
|
size: "xs",
|
|
1868
|
-
min:
|
|
1868
|
+
min: o,
|
|
1869
1869
|
max: l,
|
|
1870
1870
|
zeroMarker: !0,
|
|
1871
1871
|
value: [t.min, t.max],
|
|
@@ -1879,7 +1879,7 @@ const wn = ({
|
|
|
1879
1879
|
]
|
|
1880
1880
|
}
|
|
1881
1881
|
);
|
|
1882
|
-
},
|
|
1882
|
+
}, Ge = (n, t) => "segment" in n && "segment" in t && n.segment === t.segment || "joint" in n && "joint" in t && n.joint === t.joint, mt = ({
|
|
1883
1883
|
options: n,
|
|
1884
1884
|
value: t,
|
|
1885
1885
|
onChange: a,
|
|
@@ -1888,79 +1888,84 @@ const wn = ({
|
|
|
1888
1888
|
singleValueSideless: c,
|
|
1889
1889
|
editOnly: m,
|
|
1890
1890
|
disableKind: j,
|
|
1891
|
-
maxParameters:
|
|
1891
|
+
maxParameters: o,
|
|
1892
1892
|
...l
|
|
1893
1893
|
}) => {
|
|
1894
|
-
const x = c ? 2 :
|
|
1894
|
+
const x = c ? 2 : o, k = T(() => {
|
|
1895
1895
|
const h = /* @__PURE__ */ new Map();
|
|
1896
|
-
return n.forEach((
|
|
1897
|
-
const u = "joint" in
|
|
1898
|
-
let
|
|
1899
|
-
if (u ? (
|
|
1900
|
-
const
|
|
1896
|
+
return n.forEach((s) => {
|
|
1897
|
+
const u = "joint" in s.id;
|
|
1898
|
+
let y, M;
|
|
1899
|
+
if (u ? (y = Rt(s.id.joint, s.plane, !0) ?? "Unknown", M = `joint:${s.id.joint}`) : (y = Nt(s.id.segment, s.plane, !0) ?? "Unknown", M = `segment:${s.id.segment}`), !h.has(M)) {
|
|
1900
|
+
const z = u ? dt(s.id.joint) ?? "Unknown Joint" : dt(s.id.segment) ?? "Unknown Segment";
|
|
1901
1901
|
h.set(M, {
|
|
1902
|
-
label:
|
|
1902
|
+
label: z,
|
|
1903
1903
|
options: []
|
|
1904
1904
|
});
|
|
1905
1905
|
}
|
|
1906
|
-
h.get(M)
|
|
1906
|
+
const F = h.get(M), q = [
|
|
1907
|
+
y,
|
|
1908
|
+
u ? s.id.joint : s.id.segment,
|
|
1909
|
+
s.plane
|
|
1910
|
+
].filter(Boolean).map((z) => String(z).toLowerCase().replace(/\s+|_/g, ""));
|
|
1911
|
+
F.options.push({
|
|
1907
1912
|
label: /* @__PURE__ */ e.jsxs(oe, { spacing: 2, justify: "space-between", w: "100%", pl: 3, children: [
|
|
1908
|
-
/* @__PURE__ */ e.jsx(S, { children:
|
|
1909
|
-
|
|
1913
|
+
/* @__PURE__ */ e.jsx(S, { children: y }),
|
|
1914
|
+
s.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
|
|
1910
1915
|
] }),
|
|
1911
|
-
value:
|
|
1912
|
-
plane:
|
|
1913
|
-
sensorOnly:
|
|
1916
|
+
value: s.id,
|
|
1917
|
+
plane: s.plane,
|
|
1918
|
+
sensorOnly: s.sensorOnly,
|
|
1919
|
+
searchTokens: q
|
|
1914
1920
|
});
|
|
1915
1921
|
}), Array.from(h.values());
|
|
1916
1922
|
}, [n]), f = T(() => {
|
|
1917
1923
|
if (!c || t.length === 0)
|
|
1918
|
-
return
|
|
1924
|
+
return k;
|
|
1919
1925
|
const h = t[0];
|
|
1920
|
-
return
|
|
1921
|
-
...
|
|
1922
|
-
options:
|
|
1926
|
+
return k.map((s) => ({
|
|
1927
|
+
...s,
|
|
1928
|
+
options: s.options.filter(
|
|
1923
1929
|
(u) => Ee(u.value) === Ee(h.id) && u.plane === h.plane
|
|
1924
1930
|
)
|
|
1925
|
-
})).filter((
|
|
1926
|
-
}, [
|
|
1927
|
-
(
|
|
1928
|
-
), [
|
|
1929
|
-
if (!
|
|
1930
|
-
const u =
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
}, []), y = P(
|
|
1931
|
+
})).filter((s) => s.options.length > 0);
|
|
1932
|
+
}, [k, t, c]), I = T(() => k.flatMap((s) => s.options).filter(
|
|
1933
|
+
(s) => t.some((u) => Ge(u.id, s.value) && u.plane === s.plane)
|
|
1934
|
+
), [k, t]), w = P((h, s) => {
|
|
1935
|
+
if (!s) return !0;
|
|
1936
|
+
const u = s.toLowerCase().replace(/\s+|_/g, ""), y = h.data;
|
|
1937
|
+
return !y || !y.searchTokens ? !1 : y.searchTokens.some(
|
|
1938
|
+
(M) => M.includes(u)
|
|
1939
|
+
);
|
|
1940
|
+
}, []), b = P(
|
|
1936
1941
|
(h) => {
|
|
1937
|
-
const
|
|
1938
|
-
const
|
|
1939
|
-
(N) =>
|
|
1942
|
+
const s = h.map((u) => {
|
|
1943
|
+
const y = t.find(
|
|
1944
|
+
(N) => Ge(N.id, u.value) && N.plane === u.plane
|
|
1940
1945
|
), M = n.find(
|
|
1941
|
-
(N) =>
|
|
1942
|
-
),
|
|
1946
|
+
(N) => Ge(N.id, u.value) && N.plane === u.plane
|
|
1947
|
+
), F = c ? t.find(
|
|
1943
1948
|
(N) => Ee(N.id) === Ee(u.value) && N.plane === u.plane
|
|
1944
|
-
) : void 0,
|
|
1945
|
-
return
|
|
1949
|
+
) : void 0, q = F && !y ? F.min : M && M.min ? M.min : 0, z = F && !y ? F.max : M && M.max ? M.max : 0;
|
|
1950
|
+
return y ?? {
|
|
1946
1951
|
id: u.value,
|
|
1947
1952
|
plane: u.plane,
|
|
1948
|
-
min:
|
|
1949
|
-
max:
|
|
1953
|
+
min: q,
|
|
1954
|
+
max: z,
|
|
1950
1955
|
sensorOnly: u.sensorOnly,
|
|
1951
1956
|
kind: d ?? We.Limit
|
|
1952
1957
|
};
|
|
1953
1958
|
});
|
|
1954
|
-
a(
|
|
1959
|
+
a(s);
|
|
1955
1960
|
},
|
|
1956
1961
|
[a, t, n, d, c]
|
|
1957
1962
|
);
|
|
1958
1963
|
return ce(() => {
|
|
1959
1964
|
const h = t.filter(
|
|
1960
|
-
(
|
|
1965
|
+
(s) => n.some((u) => Ge(u.id, s.id) && u.plane === s.plane)
|
|
1961
1966
|
);
|
|
1962
1967
|
h.length !== t.length && a(h);
|
|
1963
|
-
}, [n, a, t]), /* @__PURE__ */ e.jsxs(
|
|
1968
|
+
}, [n, a, t]), /* @__PURE__ */ e.jsxs(se, { ...l, children: [
|
|
1964
1969
|
/* @__PURE__ */ e.jsx(
|
|
1965
1970
|
ge,
|
|
1966
1971
|
{
|
|
@@ -1968,7 +1973,7 @@ const wn = ({
|
|
|
1968
1973
|
placeholder: t.length ? `${t.length} selected` : "Search...",
|
|
1969
1974
|
value: I,
|
|
1970
1975
|
isDisabled: m || I.length >= (x ?? 1 / 0),
|
|
1971
|
-
onChange: (h) => Array.isArray(h) ?
|
|
1976
|
+
onChange: (h) => Array.isArray(h) ? b([...h]) : b(h !== null ? [h] : []),
|
|
1972
1977
|
options: f,
|
|
1973
1978
|
controlShouldRenderValue: !1,
|
|
1974
1979
|
formatOptionLabel: (h) => h.label,
|
|
@@ -1977,7 +1982,7 @@ const wn = ({
|
|
|
1977
1982
|
}
|
|
1978
1983
|
),
|
|
1979
1984
|
/* @__PURE__ */ e.jsx(
|
|
1980
|
-
|
|
1985
|
+
Gn,
|
|
1981
1986
|
{
|
|
1982
1987
|
marginTop: 2,
|
|
1983
1988
|
maxH: "28rem",
|
|
@@ -2023,15 +2028,15 @@ const wn = ({
|
|
|
2023
2028
|
}
|
|
2024
2029
|
}, Bn = (n) => {
|
|
2025
2030
|
switch (n) {
|
|
2026
|
-
case
|
|
2031
|
+
case ne.GeneralActivity:
|
|
2027
2032
|
return "General Activity";
|
|
2028
|
-
case
|
|
2033
|
+
case ne.MovementCoordination:
|
|
2029
2034
|
return "Movement Coordination";
|
|
2030
|
-
case
|
|
2035
|
+
case ne.PointOfInterest:
|
|
2031
2036
|
return "Point of Interest";
|
|
2032
|
-
case
|
|
2037
|
+
case ne.Range:
|
|
2033
2038
|
return "Range";
|
|
2034
|
-
case
|
|
2039
|
+
case ne.StabilityBalance:
|
|
2035
2040
|
return "Stability Balance";
|
|
2036
2041
|
}
|
|
2037
2042
|
}, ls = ({
|
|
@@ -2043,80 +2048,80 @@ const wn = ({
|
|
|
2043
2048
|
setButtonOnClick: c,
|
|
2044
2049
|
setButtonDisabled: m,
|
|
2045
2050
|
quantumOwned: j,
|
|
2046
|
-
isView:
|
|
2051
|
+
isView: o
|
|
2047
2052
|
}) => {
|
|
2048
|
-
const l = Zt(), [{ fetching: x },
|
|
2053
|
+
const l = Zt(), [{ fetching: x }, k] = me(et), [{ fetching: f }, I] = me(ln), [{ data: w }] = je({
|
|
2049
2054
|
query: cn,
|
|
2050
2055
|
variables: { id: n ?? "" },
|
|
2051
2056
|
pause: !n
|
|
2052
|
-
}),
|
|
2057
|
+
}), b = T(() => {
|
|
2053
2058
|
const g = A(
|
|
2054
2059
|
fe,
|
|
2055
2060
|
w?.getActionById
|
|
2056
2061
|
);
|
|
2057
2062
|
if (!g) return null;
|
|
2058
|
-
const
|
|
2059
|
-
...
|
|
2060
|
-
thresholds: A(Se,
|
|
2063
|
+
const R = A(tt, g.reports).map((_) => ({
|
|
2064
|
+
..._,
|
|
2065
|
+
thresholds: A(Se, _.thresholds)
|
|
2061
2066
|
}));
|
|
2062
2067
|
return {
|
|
2063
2068
|
...g,
|
|
2064
2069
|
thresholds: A(Se, g.thresholds),
|
|
2065
|
-
reports:
|
|
2070
|
+
reports: R
|
|
2066
2071
|
};
|
|
2067
|
-
}, [w]), h = x || f,
|
|
2072
|
+
}, [w]), h = x || f, s = !!b && !!n, { getLabel: u } = xe(), y = T(() => ({
|
|
2068
2073
|
action: u("action")
|
|
2069
2074
|
}), [u]), M = T(() => [
|
|
2070
2075
|
{ key: "module_category", label: "Link Category", multi: !0 },
|
|
2071
|
-
{ key: "activity_type", label: `${
|
|
2076
|
+
{ key: "activity_type", label: `${y.action} Type`, multi: !1 },
|
|
2072
2077
|
{ key: "session_type", label: "Session Type", multi: !0 },
|
|
2073
2078
|
{ key: "body_region", label: "Body Region", multi: !0 },
|
|
2074
2079
|
{ key: "sport", label: "Sport", multi: !0 }
|
|
2075
|
-
], [
|
|
2080
|
+
], [y.action]), [F, q] = G(""), [z, N] = G(""), [K, re] = G(""), [$, C] = G(""), [E, L] = G([]), [B, ee] = G({}), [U, ae] = G(null), [i, r] = G([]), [v, O] = G([]), [W, te] = G(""), [Q, H] = G([]), Y = Vt(), Me = T(() => Y.filter((g) => g.sensorOnly), [Y]), ve = T(() => {
|
|
2076
2081
|
const g = [
|
|
2077
|
-
{ label: "General Activity", value:
|
|
2082
|
+
{ label: "General Activity", value: ne.GeneralActivity },
|
|
2078
2083
|
{
|
|
2079
2084
|
label: "Movement Coordination",
|
|
2080
|
-
value:
|
|
2085
|
+
value: ne.MovementCoordination
|
|
2081
2086
|
},
|
|
2082
|
-
{ label: "Point of Interest", value:
|
|
2083
|
-
{ label: "Range", value:
|
|
2084
|
-
{ label: "Stability Balance", value:
|
|
2085
|
-
],
|
|
2087
|
+
{ label: "Point of Interest", value: ne.PointOfInterest },
|
|
2088
|
+
{ label: "Range", value: ne.Range },
|
|
2089
|
+
{ label: "Stability Balance", value: ne.StabilityBalance }
|
|
2090
|
+
], D = Q.map((R) => R.kind);
|
|
2086
2091
|
return g.filter(
|
|
2087
|
-
(
|
|
2092
|
+
(R) => !D.includes(R.value)
|
|
2088
2093
|
);
|
|
2089
|
-
}, [
|
|
2094
|
+
}, [Q]), ke = F.length > 0, [Fe, nt] = G({});
|
|
2090
2095
|
ce(() => {
|
|
2091
2096
|
const g = M.map(
|
|
2092
|
-
(
|
|
2097
|
+
(D) => l.query(dn, { key: D.key })
|
|
2093
2098
|
);
|
|
2094
|
-
Promise.all(g).then((
|
|
2095
|
-
const
|
|
2096
|
-
|
|
2097
|
-
if (
|
|
2099
|
+
Promise.all(g).then((D) => {
|
|
2100
|
+
const R = {};
|
|
2101
|
+
D.forEach((_) => {
|
|
2102
|
+
if (_.error || !_.data) return;
|
|
2098
2103
|
const J = A(
|
|
2099
2104
|
Ye,
|
|
2100
|
-
|
|
2105
|
+
_.data.getMetadataByKey
|
|
2101
2106
|
), Z = A(
|
|
2102
2107
|
He,
|
|
2103
2108
|
J.data
|
|
2104
2109
|
);
|
|
2105
|
-
|
|
2110
|
+
R[J.key] = Z.map((ue) => ({
|
|
2106
2111
|
label: ue.label || ue.value,
|
|
2107
2112
|
value: ue.value,
|
|
2108
2113
|
id: ue.id
|
|
2109
2114
|
}));
|
|
2110
|
-
}), ee(
|
|
2115
|
+
}), ee(R);
|
|
2111
2116
|
});
|
|
2112
2117
|
}, [l, M]), ce(() => {
|
|
2113
|
-
if (
|
|
2114
|
-
const
|
|
2118
|
+
if (b) {
|
|
2119
|
+
const D = A(
|
|
2115
2120
|
Ye,
|
|
2116
|
-
|
|
2121
|
+
b.metadataGroups
|
|
2117
2122
|
).map(
|
|
2118
2123
|
(J) => J.data.map((Z) => A(He, Z).id)
|
|
2119
|
-
),
|
|
2124
|
+
), R = b.reports.map((J) => ({
|
|
2120
2125
|
id: J.id,
|
|
2121
2126
|
instructions: J.instructions ?? "",
|
|
2122
2127
|
kind: J.reportKind,
|
|
@@ -2135,41 +2140,41 @@ const wn = ({
|
|
|
2135
2140
|
})
|
|
2136
2141
|
})),
|
|
2137
2142
|
sensorLocations: J.sensorLocations
|
|
2138
|
-
})),
|
|
2139
|
-
name:
|
|
2140
|
-
description:
|
|
2141
|
-
cameraPlacement:
|
|
2142
|
-
videoLink:
|
|
2143
|
-
metadataIds:
|
|
2144
|
-
reports:
|
|
2143
|
+
})), _ = {
|
|
2144
|
+
name: b.name,
|
|
2145
|
+
description: b.description || "",
|
|
2146
|
+
cameraPlacement: b.cameraPlacement || "",
|
|
2147
|
+
videoLink: b.videoLink || "",
|
|
2148
|
+
metadataIds: D.flat(),
|
|
2149
|
+
reports: R
|
|
2145
2150
|
};
|
|
2146
|
-
|
|
2151
|
+
q(_.name), N(_.description), re(_.cameraPlacement), C(_.videoLink), L(_.metadataIds), H(R), nt(_);
|
|
2147
2152
|
}
|
|
2148
|
-
}, [
|
|
2153
|
+
}, [b]);
|
|
2149
2154
|
const Ie = T(
|
|
2150
2155
|
() => JSON.stringify(Fe) !== JSON.stringify({
|
|
2151
|
-
name:
|
|
2152
|
-
description:
|
|
2156
|
+
name: F,
|
|
2157
|
+
description: z,
|
|
2153
2158
|
cameraPlacement: K,
|
|
2154
|
-
videoLink:
|
|
2159
|
+
videoLink: $,
|
|
2155
2160
|
metadataIds: E,
|
|
2156
|
-
reports:
|
|
2161
|
+
reports: Q
|
|
2157
2162
|
}),
|
|
2158
2163
|
[
|
|
2159
2164
|
Fe,
|
|
2160
|
-
k,
|
|
2161
|
-
q,
|
|
2162
|
-
K,
|
|
2163
2165
|
F,
|
|
2166
|
+
z,
|
|
2167
|
+
K,
|
|
2168
|
+
$,
|
|
2164
2169
|
E,
|
|
2165
|
-
|
|
2170
|
+
Q
|
|
2166
2171
|
]
|
|
2167
2172
|
), Oe = P(() => {
|
|
2168
2173
|
const g = {
|
|
2169
|
-
name:
|
|
2170
|
-
description:
|
|
2174
|
+
name: F,
|
|
2175
|
+
description: z,
|
|
2171
2176
|
cameraPlacement: K,
|
|
2172
|
-
videoLink:
|
|
2177
|
+
videoLink: $,
|
|
2173
2178
|
metadataItemIds: E,
|
|
2174
2179
|
// Backend requires laterality; keep existing default since UI no longer edits it
|
|
2175
2180
|
laterality: bn.Either,
|
|
@@ -2179,66 +2184,66 @@ const wn = ({
|
|
|
2179
2184
|
// Backend requires thresholds; use empty array since reports handle parameters now
|
|
2180
2185
|
thresholds: [],
|
|
2181
2186
|
// Include reports data
|
|
2182
|
-
reports:
|
|
2183
|
-
id:
|
|
2184
|
-
reportKind:
|
|
2185
|
-
sensorLocations:
|
|
2186
|
-
instructions:
|
|
2187
|
-
thresholds:
|
|
2188
|
-
id:
|
|
2189
|
-
kind:
|
|
2190
|
-
min:
|
|
2191
|
-
max:
|
|
2192
|
-
partKind: "joint" in
|
|
2193
|
-
partId: "joint" in
|
|
2194
|
-
partDimension:
|
|
2187
|
+
reports: Q.map((R) => ({
|
|
2188
|
+
id: R.isNew ? void 0 : R.id,
|
|
2189
|
+
reportKind: R.kind,
|
|
2190
|
+
sensorLocations: R.sensorLocations,
|
|
2191
|
+
instructions: R.instructions,
|
|
2192
|
+
thresholds: R.parameters.map((_) => ({
|
|
2193
|
+
id: _.oldId,
|
|
2194
|
+
kind: _.kind,
|
|
2195
|
+
min: _.min,
|
|
2196
|
+
max: _.max,
|
|
2197
|
+
partKind: "joint" in _.id ? "joint" : "segment",
|
|
2198
|
+
partId: "joint" in _.id ? _.id.joint : _.id.segment,
|
|
2199
|
+
partDimension: _.plane
|
|
2195
2200
|
}))
|
|
2196
2201
|
}))
|
|
2197
2202
|
};
|
|
2198
|
-
let
|
|
2199
|
-
|
|
2203
|
+
let D;
|
|
2204
|
+
s && n ? D = I({
|
|
2200
2205
|
id: n,
|
|
2201
2206
|
fields: g
|
|
2202
|
-
}) :
|
|
2207
|
+
}) : D = k({
|
|
2203
2208
|
fields: g
|
|
2204
|
-
}),
|
|
2205
|
-
|
|
2209
|
+
}), D.then(({ error: R }) => {
|
|
2210
|
+
R ? t(R) : d();
|
|
2206
2211
|
});
|
|
2207
2212
|
}, [
|
|
2208
2213
|
j,
|
|
2209
|
-
|
|
2214
|
+
k,
|
|
2210
2215
|
I,
|
|
2211
2216
|
n,
|
|
2212
|
-
k,
|
|
2213
|
-
q,
|
|
2214
|
-
K,
|
|
2215
2217
|
F,
|
|
2218
|
+
z,
|
|
2219
|
+
K,
|
|
2220
|
+
$,
|
|
2216
2221
|
E,
|
|
2217
|
-
|
|
2218
|
-
|
|
2222
|
+
Q,
|
|
2223
|
+
s,
|
|
2219
2224
|
d,
|
|
2220
2225
|
t
|
|
2221
2226
|
]);
|
|
2222
2227
|
ce(() => {
|
|
2223
2228
|
m && m({
|
|
2224
2229
|
cancelButton: h,
|
|
2225
|
-
saveButton:
|
|
2230
|
+
saveButton: o ? !0 : h || !ke || !Ie
|
|
2226
2231
|
});
|
|
2227
|
-
}, [h, m, ke, Ie,
|
|
2232
|
+
}, [h, m, ke, Ie, o]), ce(() => {
|
|
2228
2233
|
c && c({
|
|
2229
2234
|
cancelButton: a,
|
|
2230
|
-
saveButton:
|
|
2235
|
+
saveButton: o ? () => {
|
|
2231
2236
|
} : Oe
|
|
2232
2237
|
});
|
|
2233
|
-
}, [c, a, Oe,
|
|
2238
|
+
}, [c, a, Oe, o]);
|
|
2234
2239
|
const $e = P(
|
|
2235
2240
|
(g) => {
|
|
2236
|
-
const
|
|
2241
|
+
const D = ut(
|
|
2237
2242
|
g.map(
|
|
2238
|
-
(
|
|
2243
|
+
(R) => "joint" in R.id ? R.id.joint : R.id.segment
|
|
2239
2244
|
)
|
|
2240
2245
|
);
|
|
2241
|
-
O(
|
|
2246
|
+
O(D);
|
|
2242
2247
|
},
|
|
2243
2248
|
[]
|
|
2244
2249
|
);
|
|
@@ -2248,33 +2253,34 @@ const wn = ({
|
|
|
2248
2253
|
const Ae = P(() => {
|
|
2249
2254
|
if (!U)
|
|
2250
2255
|
return;
|
|
2251
|
-
const g = {
|
|
2256
|
+
const g = U === ne.PointOfInterest, D = {
|
|
2252
2257
|
id: Date.now().toString(),
|
|
2253
2258
|
// Temporary ID
|
|
2254
2259
|
kind: U,
|
|
2255
|
-
parameters: i,
|
|
2256
|
-
sensorLocations: v,
|
|
2257
|
-
instructions:
|
|
2260
|
+
parameters: g ? [] : i,
|
|
2261
|
+
sensorLocations: g ? [] : v,
|
|
2262
|
+
instructions: g ? W : "",
|
|
2263
|
+
isNew: !0
|
|
2258
2264
|
};
|
|
2259
|
-
H((
|
|
2265
|
+
H((R) => [...R, D]), ae(null), r([]), O([]), te("");
|
|
2260
2266
|
}, [
|
|
2261
2267
|
U,
|
|
2262
2268
|
i,
|
|
2263
2269
|
v,
|
|
2264
|
-
|
|
2270
|
+
W
|
|
2265
2271
|
]), he = P((g) => {
|
|
2266
|
-
H((
|
|
2267
|
-
}, []), Te = (g,
|
|
2268
|
-
const
|
|
2269
|
-
if (!
|
|
2270
|
-
const
|
|
2272
|
+
H((D) => D.filter((R) => R.id !== g));
|
|
2273
|
+
}, []), Te = (g, D) => {
|
|
2274
|
+
const R = M.find((J) => J.key === g);
|
|
2275
|
+
if (!R) return;
|
|
2276
|
+
const _ = R.multi ? (D ?? []).map(
|
|
2271
2277
|
(J) => J.id
|
|
2272
|
-
) :
|
|
2273
|
-
L((J) => [...J.filter((ue) => Object.values(
|
|
2274
|
-
(De) =>
|
|
2278
|
+
) : D ? [D.id] : [];
|
|
2279
|
+
L((J) => [...J.filter((ue) => Object.values(B).flat().find((De) => De.id === ue) && !Object.keys(B).find(
|
|
2280
|
+
(De) => B[De]?.some(
|
|
2275
2281
|
(kt) => kt.id === ue && De === g
|
|
2276
2282
|
)
|
|
2277
|
-
)), ...
|
|
2283
|
+
)), ..._]);
|
|
2278
2284
|
};
|
|
2279
2285
|
return /* @__PURE__ */ e.jsxs(le, { spacing: 4, w: "full", align: "stretch", children: [
|
|
2280
2286
|
/* @__PURE__ */ e.jsxs(Yt, { children: [
|
|
@@ -2290,11 +2296,11 @@ const wn = ({
|
|
|
2290
2296
|
/* @__PURE__ */ e.jsx(
|
|
2291
2297
|
we,
|
|
2292
2298
|
{
|
|
2293
|
-
value:
|
|
2294
|
-
onChange: (g) =>
|
|
2299
|
+
value: F,
|
|
2300
|
+
onChange: (g) => q(g.target.value),
|
|
2295
2301
|
type: "text",
|
|
2296
2302
|
placeholder: "i.e. Lunge & Return",
|
|
2297
|
-
isDisabled:
|
|
2303
|
+
isDisabled: o
|
|
2298
2304
|
}
|
|
2299
2305
|
)
|
|
2300
2306
|
] }),
|
|
@@ -2304,10 +2310,10 @@ const wn = ({
|
|
|
2304
2310
|
Pe,
|
|
2305
2311
|
{
|
|
2306
2312
|
value: K,
|
|
2307
|
-
onChange: (g) =>
|
|
2313
|
+
onChange: (g) => re(g.target.value),
|
|
2308
2314
|
rows: 2,
|
|
2309
2315
|
placeholder: "(optional) Describe camera setup, placement, angles",
|
|
2310
|
-
isDisabled:
|
|
2316
|
+
isDisabled: o
|
|
2311
2317
|
}
|
|
2312
2318
|
)
|
|
2313
2319
|
] }),
|
|
@@ -2316,11 +2322,11 @@ const wn = ({
|
|
|
2316
2322
|
/* @__PURE__ */ e.jsx(
|
|
2317
2323
|
we,
|
|
2318
2324
|
{
|
|
2319
|
-
value:
|
|
2325
|
+
value: $,
|
|
2320
2326
|
onChange: (g) => C(g.target.value),
|
|
2321
2327
|
type: "url",
|
|
2322
2328
|
placeholder: "(optional) https://...",
|
|
2323
|
-
isDisabled:
|
|
2329
|
+
isDisabled: o
|
|
2324
2330
|
}
|
|
2325
2331
|
)
|
|
2326
2332
|
] }),
|
|
@@ -2329,11 +2335,11 @@ const wn = ({
|
|
|
2329
2335
|
/* @__PURE__ */ e.jsx(
|
|
2330
2336
|
Pe,
|
|
2331
2337
|
{
|
|
2332
|
-
value:
|
|
2338
|
+
value: z,
|
|
2333
2339
|
onChange: (g) => N(g.target.value),
|
|
2334
2340
|
rows: 2,
|
|
2335
2341
|
placeholder: "(optional) Describe how to perform the test or exercise",
|
|
2336
|
-
isDisabled:
|
|
2342
|
+
isDisabled: o
|
|
2337
2343
|
}
|
|
2338
2344
|
)
|
|
2339
2345
|
] })
|
|
@@ -2346,15 +2352,15 @@ const wn = ({
|
|
|
2346
2352
|
ge,
|
|
2347
2353
|
{
|
|
2348
2354
|
isMulti: g.multi,
|
|
2349
|
-
value:
|
|
2350
|
-
(
|
|
2355
|
+
value: B[g.key]?.filter(
|
|
2356
|
+
(D) => E.includes(D.id)
|
|
2351
2357
|
),
|
|
2352
|
-
onChange: (
|
|
2353
|
-
Te(g.key,
|
|
2358
|
+
onChange: (D) => {
|
|
2359
|
+
Te(g.key, D);
|
|
2354
2360
|
},
|
|
2355
|
-
options:
|
|
2361
|
+
options: B[g.key],
|
|
2356
2362
|
placeholder: `Select ${g.multi ? "one or more" : "one"} ${g.label.toLowerCase()}`,
|
|
2357
|
-
isDisabled:
|
|
2363
|
+
isDisabled: o,
|
|
2358
2364
|
isClearable: g.multi
|
|
2359
2365
|
}
|
|
2360
2366
|
)
|
|
@@ -2366,10 +2372,10 @@ const wn = ({
|
|
|
2366
2372
|
{
|
|
2367
2373
|
className: ze(
|
|
2368
2374
|
"grid grid-cols-1 gap-6",
|
|
2369
|
-
!
|
|
2375
|
+
!o && "md:grid-cols-2"
|
|
2370
2376
|
),
|
|
2371
2377
|
children: [
|
|
2372
|
-
/* @__PURE__ */ e.jsxs("div", { className: ze("space-y-4",
|
|
2378
|
+
/* @__PURE__ */ e.jsxs("div", { className: ze("space-y-4", o && "hidden"), children: [
|
|
2373
2379
|
/* @__PURE__ */ e.jsx(de, { children: "Add New Report" }),
|
|
2374
2380
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2375
2381
|
/* @__PURE__ */ e.jsx(de, { children: "Report Kind" }),
|
|
@@ -2382,12 +2388,12 @@ const wn = ({
|
|
|
2382
2388
|
onChange: (g) => ae(g?.value || null),
|
|
2383
2389
|
options: ve,
|
|
2384
2390
|
placeholder: "Select report kind...",
|
|
2385
|
-
isDisabled:
|
|
2391
|
+
isDisabled: o,
|
|
2386
2392
|
isClearable: !0
|
|
2387
2393
|
}
|
|
2388
2394
|
)
|
|
2389
2395
|
] }),
|
|
2390
|
-
U !==
|
|
2396
|
+
U !== ne.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2391
2397
|
/* @__PURE__ */ e.jsxs(X, { children: [
|
|
2392
2398
|
/* @__PURE__ */ e.jsx(de, { children: "Default Parameters" }),
|
|
2393
2399
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2395,8 +2401,8 @@ const wn = ({
|
|
|
2395
2401
|
{
|
|
2396
2402
|
options: Y,
|
|
2397
2403
|
value: i,
|
|
2398
|
-
onChange:
|
|
2399
|
-
editOnly:
|
|
2404
|
+
onChange: r,
|
|
2405
|
+
editOnly: o
|
|
2400
2406
|
}
|
|
2401
2407
|
)
|
|
2402
2408
|
] }),
|
|
@@ -2414,16 +2420,16 @@ const wn = ({
|
|
|
2414
2420
|
)
|
|
2415
2421
|
] })
|
|
2416
2422
|
] }),
|
|
2417
|
-
U ===
|
|
2423
|
+
U === ne.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2418
2424
|
/* @__PURE__ */ e.jsx(de, { children: "Instructions" }),
|
|
2419
2425
|
/* @__PURE__ */ e.jsx(
|
|
2420
2426
|
Pe,
|
|
2421
2427
|
{
|
|
2422
|
-
value:
|
|
2428
|
+
value: W,
|
|
2423
2429
|
onChange: (g) => te(g.target.value),
|
|
2424
2430
|
rows: 3,
|
|
2425
2431
|
placeholder: "Enter specific instructions for this report...",
|
|
2426
|
-
isDisabled:
|
|
2432
|
+
isDisabled: o
|
|
2427
2433
|
}
|
|
2428
2434
|
)
|
|
2429
2435
|
] }),
|
|
@@ -2432,21 +2438,21 @@ const wn = ({
|
|
|
2432
2438
|
{
|
|
2433
2439
|
colorScheme: "blue",
|
|
2434
2440
|
onClick: Ae,
|
|
2435
|
-
isDisabled: !U ||
|
|
2441
|
+
isDisabled: !U || o || ve.length === 0 || U !== ne.PointOfInterest && i.length === 0,
|
|
2436
2442
|
children: "Add Report"
|
|
2437
2443
|
}
|
|
2438
2444
|
) })
|
|
2439
2445
|
] }),
|
|
2440
2446
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
2441
2447
|
/* @__PURE__ */ e.jsx(de, { children: "Configured Reports" }),
|
|
2442
|
-
|
|
2448
|
+
Q.length === 0 ? /* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: Q.map((g) => /* @__PURE__ */ e.jsxs(
|
|
2443
2449
|
"div",
|
|
2444
2450
|
{
|
|
2445
2451
|
className: "p-3 border border-gray-200 rounded-md bg-gray-50",
|
|
2446
2452
|
children: [
|
|
2447
2453
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start mb-2", children: [
|
|
2448
2454
|
/* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", children: Bn(g.kind) }),
|
|
2449
|
-
!
|
|
2455
|
+
!o && /* @__PURE__ */ e.jsx(
|
|
2450
2456
|
V,
|
|
2451
2457
|
{
|
|
2452
2458
|
size: "xs",
|
|
@@ -2457,46 +2463,46 @@ const wn = ({
|
|
|
2457
2463
|
}
|
|
2458
2464
|
)
|
|
2459
2465
|
] }),
|
|
2460
|
-
g.kind ===
|
|
2466
|
+
g.kind === ne.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
|
|
2461
2467
|
/* @__PURE__ */ e.jsx(de, { children: "Instructions" }),
|
|
2462
2468
|
/* @__PURE__ */ e.jsx(
|
|
2463
2469
|
Pe,
|
|
2464
2470
|
{
|
|
2465
2471
|
value: g.instructions,
|
|
2466
|
-
onChange: (
|
|
2467
|
-
(
|
|
2468
|
-
(
|
|
2472
|
+
onChange: (D) => H(
|
|
2473
|
+
(R) => R.map(
|
|
2474
|
+
(_) => _.id === g.id ? { ..._, instructions: D.target.value } : _
|
|
2469
2475
|
)
|
|
2470
2476
|
),
|
|
2471
2477
|
rows: 3,
|
|
2472
2478
|
placeholder: "Enter specific instructions for this report...",
|
|
2473
|
-
isDisabled:
|
|
2479
|
+
isDisabled: o
|
|
2474
2480
|
}
|
|
2475
2481
|
)
|
|
2476
2482
|
] }),
|
|
2477
|
-
g.kind !==
|
|
2483
|
+
g.kind !== ne.PointOfInterest && /* @__PURE__ */ e.jsx(
|
|
2478
2484
|
mt,
|
|
2479
2485
|
{
|
|
2480
2486
|
options: Y,
|
|
2481
2487
|
value: g.parameters,
|
|
2482
|
-
onChange: (
|
|
2483
|
-
const
|
|
2488
|
+
onChange: (D) => {
|
|
2489
|
+
const R = D.map(
|
|
2484
2490
|
(J) => J.id.joint ?? J.id.segment
|
|
2485
|
-
),
|
|
2491
|
+
), _ = ut(R);
|
|
2486
2492
|
H(
|
|
2487
2493
|
(J) => J.map(
|
|
2488
|
-
(Z) => Z.id === g.id ? { ...Z, parameters:
|
|
2494
|
+
(Z) => Z.id === g.id ? { ...Z, parameters: D, sensorLocations: _ } : Z
|
|
2489
2495
|
)
|
|
2490
2496
|
);
|
|
2491
2497
|
},
|
|
2492
|
-
editOnly:
|
|
2498
|
+
editOnly: o
|
|
2493
2499
|
}
|
|
2494
2500
|
),
|
|
2495
|
-
g.kind !==
|
|
2501
|
+
g.kind !== ne.PointOfInterest && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", mt: 2, children: [
|
|
2496
2502
|
"Sensors:",
|
|
2497
2503
|
" ",
|
|
2498
2504
|
g.sensorLocations.map(
|
|
2499
|
-
(
|
|
2505
|
+
(D) => pt(D)
|
|
2500
2506
|
).join(", ")
|
|
2501
2507
|
] })
|
|
2502
2508
|
]
|
|
@@ -2513,7 +2519,7 @@ const wn = ({
|
|
|
2513
2519
|
oe,
|
|
2514
2520
|
{
|
|
2515
2521
|
justify: "end",
|
|
2516
|
-
className: ze((p ||
|
|
2522
|
+
className: ze((p || o) && "!hidden"),
|
|
2517
2523
|
children: /* @__PURE__ */ e.jsxs(Le, { gap: 4, children: [
|
|
2518
2524
|
/* @__PURE__ */ e.jsx(V, { colorScheme: "gray", isDisabled: h, onClick: a, children: "Cancel" }),
|
|
2519
2525
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2540,7 +2546,7 @@ const wn = ({
|
|
|
2540
2546
|
setButtonOnClick: m,
|
|
2541
2547
|
setButtonDisabled: j
|
|
2542
2548
|
}) => {
|
|
2543
|
-
const [{ data:
|
|
2549
|
+
const [{ data: o }] = je({
|
|
2544
2550
|
query: c ? un : hn
|
|
2545
2551
|
}), [{ data: l }] = je({
|
|
2546
2552
|
query: mn,
|
|
@@ -2548,47 +2554,47 @@ const wn = ({
|
|
|
2548
2554
|
pause: !n
|
|
2549
2555
|
}), [{ data: x }] = je({
|
|
2550
2556
|
query: pn
|
|
2551
|
-
}),
|
|
2557
|
+
}), k = A(
|
|
2552
2558
|
Re,
|
|
2553
2559
|
x?.moduleCategories
|
|
2554
|
-
), [{ fetching: f }, I] = me(At), [{ fetching: w },
|
|
2560
|
+
), [{ fetching: f }, I] = me(At), [{ fetching: w }, b] = me(Ot), h = A(
|
|
2555
2561
|
fe,
|
|
2556
|
-
c ?
|
|
2557
|
-
) ?? [],
|
|
2562
|
+
c ? o?.quantumOwnedActions : o?.actions
|
|
2563
|
+
) ?? [], s = A(Be, l?.module), u = A(Tt, s?.moduleActions) ?? [], [y, M] = G([
|
|
2558
2564
|
...u.map((C) => C.actionId) ?? []
|
|
2559
|
-
]), [
|
|
2565
|
+
]), [F, q] = G(s?.name ?? ""), [z, N] = G([]), [K, re] = G(s?.description ?? "");
|
|
2560
2566
|
ce(() => {
|
|
2561
|
-
|
|
2562
|
-
|
|
2567
|
+
s && (M(u.map((C) => C.actionId)), q(s.name), re(s.description ?? ""), N(
|
|
2568
|
+
s.categories.map(
|
|
2563
2569
|
(C) => A(Re, C).id
|
|
2564
2570
|
) ?? []
|
|
2565
2571
|
));
|
|
2566
|
-
}, [
|
|
2567
|
-
const
|
|
2572
|
+
}, [s, u]);
|
|
2573
|
+
const $ = P(() => {
|
|
2568
2574
|
let C;
|
|
2569
2575
|
const E = {
|
|
2570
|
-
actions:
|
|
2571
|
-
name:
|
|
2572
|
-
categories:
|
|
2576
|
+
actions: y,
|
|
2577
|
+
name: F,
|
|
2578
|
+
categories: z.filter((L) => L !== "other"),
|
|
2573
2579
|
description: K,
|
|
2574
2580
|
quantumOwned: c
|
|
2575
2581
|
};
|
|
2576
|
-
|
|
2577
|
-
id:
|
|
2582
|
+
s ? C = I({
|
|
2583
|
+
id: s.id,
|
|
2578
2584
|
input: E
|
|
2579
|
-
}) : C =
|
|
2585
|
+
}) : C = b({
|
|
2580
2586
|
input: E
|
|
2581
2587
|
}), C.then(({ error: L }) => {
|
|
2582
2588
|
L ? d(L) : a();
|
|
2583
2589
|
});
|
|
2584
2590
|
}, [
|
|
2585
|
-
y,
|
|
2586
|
-
I,
|
|
2587
2591
|
b,
|
|
2588
|
-
|
|
2592
|
+
I,
|
|
2593
|
+
y,
|
|
2594
|
+
F,
|
|
2589
2595
|
K,
|
|
2590
|
-
|
|
2591
|
-
|
|
2596
|
+
z,
|
|
2597
|
+
s,
|
|
2592
2598
|
a,
|
|
2593
2599
|
d,
|
|
2594
2600
|
c
|
|
@@ -2596,27 +2602,27 @@ const wn = ({
|
|
|
2596
2602
|
return ce(() => {
|
|
2597
2603
|
j && j({
|
|
2598
2604
|
cancelButton: f || w,
|
|
2599
|
-
saveButton: f || w || !
|
|
2605
|
+
saveButton: f || w || !F || K.trim().split(/\s+/).filter(Boolean).length > 40
|
|
2600
2606
|
});
|
|
2601
|
-
}, [j, f, w,
|
|
2607
|
+
}, [j, f, w, y, F, K]), ce(() => {
|
|
2602
2608
|
m && m({
|
|
2603
2609
|
cancelButton: t,
|
|
2604
|
-
saveButton:
|
|
2610
|
+
saveButton: $
|
|
2605
2611
|
});
|
|
2606
|
-
}, [m, t,
|
|
2612
|
+
}, [m, t, $]), /* @__PURE__ */ e.jsxs(se, { width: "100%", children: [
|
|
2607
2613
|
/* @__PURE__ */ e.jsx(
|
|
2608
2614
|
$n,
|
|
2609
2615
|
{
|
|
2610
|
-
name:
|
|
2611
|
-
setName:
|
|
2616
|
+
name: F,
|
|
2617
|
+
setName: q,
|
|
2612
2618
|
actions: h,
|
|
2613
|
-
selectedActionIds:
|
|
2619
|
+
selectedActionIds: y,
|
|
2614
2620
|
setSelectedActionIds: M,
|
|
2615
|
-
availableCategories:
|
|
2616
|
-
selectedCategoryIds:
|
|
2621
|
+
availableCategories: k ?? [],
|
|
2622
|
+
selectedCategoryIds: z,
|
|
2617
2623
|
setSelectedCategoryIds: N,
|
|
2618
2624
|
description: K,
|
|
2619
|
-
setDescription:
|
|
2625
|
+
setDescription: re
|
|
2620
2626
|
}
|
|
2621
2627
|
),
|
|
2622
2628
|
!p && /* @__PURE__ */ e.jsx(oe, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Le, { mt: 16, gap: 4, children: [
|
|
@@ -2633,9 +2639,9 @@ const wn = ({
|
|
|
2633
2639
|
V,
|
|
2634
2640
|
{
|
|
2635
2641
|
colorScheme: "blue",
|
|
2636
|
-
isDisabled: f || w || !
|
|
2642
|
+
isDisabled: f || w || !F || K.trim().split(/\s+/).filter(Boolean).length > 40,
|
|
2637
2643
|
isLoading: f || w,
|
|
2638
|
-
onClick:
|
|
2644
|
+
onClick: $,
|
|
2639
2645
|
children: "Save"
|
|
2640
2646
|
}
|
|
2641
2647
|
)
|
|
@@ -2647,7 +2653,7 @@ export {
|
|
|
2647
2653
|
as as CopyActivityForm,
|
|
2648
2654
|
is as CopyModuleForm,
|
|
2649
2655
|
$n as ModuleForm,
|
|
2650
|
-
|
|
2656
|
+
Gn as ParameterEditList,
|
|
2651
2657
|
mt as ParameterEditSelect,
|
|
2652
2658
|
ls as UpsertActivityForm,
|
|
2653
2659
|
cs as UpsertModuleForm
|