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