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