quantum-component-library 1.4.48-dev.3 → 1.4.48-dev.5

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