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