quantum-component-library 1.4.51-dev.3 → 1.4.51

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,9 +1,9 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
2
  import "./moment-vendor-DMLRxgRE.js";
3
- import { Flex as we, InputGroup as at, InputLeftElement as $t, Icon as bt, Input as Le, FormLabel as Xe, ButtonGroup as Me, Tooltip as tt, Button as se, Box as te, RangeSlider as Ft, RangeSliderMark as et, Text as C, RangeSliderTrack as Dt, RangeSliderFilledTrack as Gt, RangeSliderThumb as it, Select as lt, NumberInput as ct, NumberInputField as dt, HStack as re, Tag as Ne, FormControl as X, TableContainer as Pt, Table as Et, Thead as _t, Tr as ut, Th as Re, Tbody as zt, Td as _e, Image as Bt, useToast as yt, VStack as le, RadioGroup as vt, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as Ct, useDisclosure as Wt, Modal as Ut, ModalOverlay as Qt, ModalContent as qt, ModalHeader as Kt, ModalCloseButton as Yt, ModalBody as Ht, ModalFooter as Jt, Badge as wt, IconButton as Xt, Tabs as Zt, TabList as Vt, Tab as mt, TabPanels as en, TabPanel as ht, Textarea as ze } from "@chakra-ui/react";
4
- import { useMemo as k, useState as B, useEffect as ie, useCallback as P, createContext as tn, useContext as nn, memo as Se, useRef as sn } from "react";
5
- import { getFragmentData as L } from "./generated.js";
6
- import { G as nt, M as je, a as be, b as St, c as rn, C as st, d as Lt, e as It, R as Ze, f as $e, T as Ie, A as ve, g as on, h as Mt, U as Ot, i as Qe, j as At, k as an, l as ln, m as cn, n as dn, o as un, p as mn } from "./graphql-B-0IK2pU.js";
3
+ import { Flex as we, InputGroup as at, InputLeftElement as $t, Icon as bt, Input as Le, FormLabel as Xe, ButtonGroup as Me, Tooltip as tt, Button as se, Box as te, RangeSlider as Ft, RangeSliderMark as et, Text as S, RangeSliderTrack as Dt, RangeSliderFilledTrack as Pt, RangeSliderThumb as it, Select as lt, NumberInput as ct, NumberInputField as dt, HStack as re, Tag as Ne, FormControl as X, TableContainer as Gt, Table as Et, Thead as _t, Tr as ut, Th as Re, Tbody as zt, Td as _e, Image as Bt, useToast as yt, VStack as le, RadioGroup as vt, Radio as Ye, Alert as He, AlertIcon as Je, Spinner as Ct, useDisclosure as Wt, Modal as Ut, ModalOverlay as Qt, ModalContent as qt, ModalHeader as Kt, ModalCloseButton as Yt, ModalBody as Ht, ModalFooter as Jt, Badge as wt, IconButton as Xt, Tabs as Zt, TabList as Vt, Tab as mt, TabPanels as en, TabPanel as ht, Textarea as ze } from "@chakra-ui/react";
4
+ import { useMemo as k, useState as B, useEffect as ie, useCallback as G, createContext as tn, useContext as nn, memo as Se, useRef as sn } from "react";
5
+ import { getFragmentData as I } from "./generated.js";
6
+ import { G as nt, M as je, a as be, b as St, c as rn, C as st, d as Lt, e as It, R as Ze, f as $e, T as Ie, A as ve, g as on, h as Mt, U as Ot, i as Qe, j as At, k as an, l as ln, m as cn, n as dn, o as un, p as mn } from "./graphql-BOkP_KIq.js";
7
7
  import { c as qe } from "./utils-cn-CgdSr4hO.js";
8
8
  import "./lodash-vendor-B-xpwrnm.js";
9
9
  import { useClient as rt, useQuery as Ce, useMutation as fe } from "urql";
@@ -19,12 +19,12 @@ const Mn = ({
19
19
  setSearch: r,
20
20
  actions: n,
21
21
  updateUseCases: a,
22
- hideUseCaseFilter: p = !1
22
+ hideUseCaseFilter: h = !1
23
23
  }) => {
24
24
  const x = k(
25
- () => n?.flatMap((d) => d.useCases).filter((d, u, h) => h.findIndex((s) => s.id === d.id) === u).map((d) => ({
26
- label: d.name,
27
- value: d.id
25
+ () => n?.flatMap((u) => u.useCases).filter((u, d, p) => p.findIndex((s) => s.id === u.id) === d).map((u) => ({
26
+ label: u.name,
27
+ value: u.id
28
28
  })) || [],
29
29
  [n]
30
30
  );
@@ -36,18 +36,18 @@ const Mn = ({
36
36
  {
37
37
  placeholder: "Search by name...",
38
38
  width: "100%",
39
- maxW: p ? void 0 : "30rem",
40
- onChange: (d) => r(d.target.value)
39
+ maxW: h ? void 0 : "30rem",
40
+ onChange: (u) => r(u.target.value)
41
41
  }
42
42
  )
43
43
  ] }),
44
- !p && /* @__PURE__ */ e.jsx(at, { size: "md", children: /* @__PURE__ */ e.jsx(
44
+ !h && /* @__PURE__ */ e.jsx(at, { size: "md", children: /* @__PURE__ */ e.jsx(
45
45
  ue,
46
46
  {
47
47
  size: "md",
48
48
  chakraStyles: {
49
- container: (d) => ({
50
- ...d,
49
+ container: (u) => ({
50
+ ...u,
51
51
  width: "100%"
52
52
  })
53
53
  },
@@ -55,7 +55,7 @@ const Mn = ({
55
55
  placeholder: "Filter use case",
56
56
  isMulti: !0,
57
57
  options: x,
58
- onChange: (d) => a(d.map((u) => u.value))
58
+ onChange: (u) => a(u.map((d) => d.value))
59
59
  }
60
60
  ) })
61
61
  ] });
@@ -65,12 +65,12 @@ const Mn = ({
65
65
  items: r,
66
66
  onChange: n,
67
67
  selectedItem: a,
68
- isDisabled: p,
68
+ isDisabled: h,
69
69
  selectedProps: x,
70
- buttonProps: d
70
+ buttonProps: u
71
71
  }) => {
72
- const u = (s) => s === a || s.value === a, h = (s) => u(s) ? { ...d, ...x } : d;
73
- return /* @__PURE__ */ e.jsx(Me, { isAttached: !0, isDisabled: p, children: r.map((s, i) => /* @__PURE__ */ e.jsx(
72
+ const d = (s) => s === a || s.value === a, p = (s) => d(s) ? { ...u, ...x } : u;
73
+ return /* @__PURE__ */ e.jsx(Me, { isAttached: !0, isDisabled: h, children: r.map((s, i) => /* @__PURE__ */ e.jsx(
74
74
  tt,
75
75
  {
76
76
  label: s.tooltip,
@@ -82,9 +82,9 @@ const Mn = ({
82
82
  children: /* @__PURE__ */ e.jsx(
83
83
  se,
84
84
  {
85
- onClick: () => u(s) ? null : n(s, i),
85
+ onClick: () => d(s) ? null : n(s, i),
86
86
  isDisabled: s.disabled,
87
- ...h(s),
87
+ ...p(s),
88
88
  children: s.label
89
89
  }
90
90
  )
@@ -95,52 +95,52 @@ const Mn = ({
95
95
  isReversed: r,
96
96
  min: n,
97
97
  max: a,
98
- value: p,
98
+ value: h,
99
99
  onChange: x,
100
- inputProps: d,
101
- size: u,
102
- zeroMarker: h,
100
+ inputProps: u,
101
+ size: d,
102
+ zeroMarker: p,
103
103
  formatValue: s,
104
104
  valueLabel: i,
105
105
  positiveNegativeLabels: g,
106
- isDisabled: w,
107
- ...S
106
+ isDisabled: C,
107
+ ...L
108
108
  }) => {
109
- const [M, I] = B([void 0, void 0]), y = M[0], c = M[1], m = h && n < -5 && a > 5, v = Number(p?.[0] ?? c ?? n) > 0 ? 1 : -1, j = Number(p?.[1] ?? c ?? a) < 0 ? -1 : 1, A = g?.[0] === g?.[1], $ = p?.[0], F = p?.[1];
109
+ const [M, w] = B([void 0, void 0]), y = M[0], c = M[1], m = p && n < -5 && a > 5, v = Number(h?.[0] ?? c ?? n) > 0 ? 1 : -1, j = Number(h?.[1] ?? c ?? a) < 0 ? -1 : 1, A = g?.[0] === g?.[1], $ = h?.[0], F = h?.[1];
110
110
  ie(() => {
111
- $ !== void 0 && F !== void 0 && I([$.toFixed(0), F.toFixed(0)]);
112
- }, [$, F, I]);
113
- const O = P(
111
+ $ !== void 0 && F !== void 0 && w([$.toFixed(0), F.toFixed(0)]);
112
+ }, [$, F, w]);
113
+ const O = G(
114
114
  ([T, _]) => {
115
- T < _ && I([T.toFixed(0), _.toFixed(0)]);
115
+ T < _ && w([T.toFixed(0), _.toFixed(0)]);
116
116
  },
117
- [I]
118
- ), N = P(
117
+ [w]
118
+ ), N = G(
119
119
  ([T, _]) => {
120
120
  T < _ && x([T, _]);
121
121
  },
122
122
  [x]
123
- ), H = P(() => {
124
- I(([T, _]) => {
123
+ ), H = G(() => {
124
+ w(([T, _]) => {
125
125
  const J = isNaN(Number(T)) ? n : Number(T), W = isNaN(Number(_)) ? a : Number(_), K = We(Number(J), v), l = We(Number(W), j), t = v < 0 ? Math.max(K, n) : Math.min(K, a), o = j < 0 ? Math.max(l, n) : Math.min(l, a);
126
126
  return t > o ? (x([o, t]), [o.toFixed(0), t.toFixed(0)]) : (x([t, o]), [t.toFixed(0), o.toFixed(0)]);
127
127
  });
128
- }, [x, I, v, j, n, a]), oe = P(
128
+ }, [x, w, v, j, n, a]), oe = G(
129
129
  (T) => {
130
130
  const _ = T === "" || isNaN(Number(T)) ? T : We(Number(T), v);
131
- I(([J, W]) => [_.toString(), W]);
131
+ w(([J, W]) => [_.toString(), W]);
132
132
  },
133
- [I, v]
134
- ), R = P(
133
+ [w, v]
134
+ ), R = G(
135
135
  (T) => {
136
136
  const _ = T === "" || isNaN(Number(T)) ? T : We(Number(T), j);
137
- I(([J, W]) => [J, _.toString()]);
137
+ w(([J, W]) => [J, _.toString()]);
138
138
  },
139
- [I, j]
139
+ [w, j]
140
140
  ), Z = k(
141
- () => u === "xs" ? "0.75rem" : void 0,
142
- [u]
143
- ), V = P(
141
+ () => d === "xs" ? "0.75rem" : void 0,
142
+ [d]
143
+ ), V = G(
144
144
  (T, _) => {
145
145
  const J = Number(_.target.value);
146
146
  if (!y || !c || ![-1, 1].includes(J))
@@ -150,7 +150,7 @@ const Mn = ({
150
150
  },
151
151
  [y, c, x]
152
152
  );
153
- return /* @__PURE__ */ e.jsxs(we, { direction: "column", ...S, children: [
153
+ return /* @__PURE__ */ e.jsxs(we, { direction: "column", ...L, children: [
154
154
  /* @__PURE__ */ e.jsx(te, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
155
155
  Ft,
156
156
  {
@@ -163,21 +163,21 @@ const Mn = ({
163
163
  step: 1,
164
164
  onChange: O,
165
165
  onChangeEnd: N,
166
- isDisabled: w,
166
+ isDisabled: C,
167
167
  children: [
168
168
  /* @__PURE__ */ e.jsx(et, { value: n, top: "-1em", children: /* @__PURE__ */ e.jsx(
169
- C,
169
+ S,
170
170
  {
171
- fontSize: u ?? "sm",
171
+ fontSize: d ?? "sm",
172
172
  fontWeight: "semibold",
173
173
  whiteSpace: "nowrap",
174
174
  children: s ? s?.(n) : n
175
175
  }
176
176
  ) }),
177
177
  /* @__PURE__ */ e.jsx(et, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
178
- C,
178
+ S,
179
179
  {
180
- fontSize: u ?? "sm",
180
+ fontSize: d ?? "sm",
181
181
  fontWeight: "semibold",
182
182
  style: { transform: "translateX(-100%)" },
183
183
  whiteSpace: "nowrap",
@@ -185,7 +185,7 @@ const Mn = ({
185
185
  }
186
186
  ) }),
187
187
  m && /* @__PURE__ */ e.jsxs(et, { value: 0, top: "-1em", pos: "relative", children: [
188
- /* @__PURE__ */ e.jsx(C, { fontSize: u, fontWeight: "semibold", children: s?.(0) ?? "0" }),
188
+ /* @__PURE__ */ e.jsx(S, { fontSize: d, fontWeight: "semibold", children: s?.(0) ?? "0" }),
189
189
  /* @__PURE__ */ e.jsx(
190
190
  te,
191
191
  {
@@ -198,7 +198,7 @@ const Mn = ({
198
198
  }
199
199
  )
200
200
  ] }),
201
- /* @__PURE__ */ e.jsx(Dt, { children: /* @__PURE__ */ e.jsx(Gt, {}) }),
201
+ /* @__PURE__ */ e.jsx(Dt, { children: /* @__PURE__ */ e.jsx(Pt, {}) }),
202
202
  /* @__PURE__ */ e.jsx(it, { index: 0, w: Z, h: Z }),
203
203
  /* @__PURE__ */ e.jsx(it, { index: 1, w: Z, h: Z })
204
204
  ]
@@ -211,18 +211,18 @@ const Mn = ({
211
211
  justifyContent: "space-between",
212
212
  children: [
213
213
  /* @__PURE__ */ e.jsx(
214
- C,
214
+ S,
215
215
  {
216
- fontSize: u ?? "sm",
216
+ fontSize: d ?? "sm",
217
217
  fontWeight: "semibold",
218
218
  whiteSpace: "nowrap",
219
219
  children: i(n)
220
220
  }
221
221
  ),
222
222
  /* @__PURE__ */ e.jsx(
223
- C,
223
+ S,
224
224
  {
225
- fontSize: u ?? "sm",
225
+ fontSize: d ?? "sm",
226
226
  fontWeight: "semibold",
227
227
  whiteSpace: "nowrap",
228
228
  children: i(a)
@@ -243,11 +243,11 @@ const Mn = ({
243
243
  lt,
244
244
  {
245
245
  width: "auto",
246
- size: u,
246
+ size: d,
247
247
  fontWeight: "bold",
248
248
  value: v,
249
249
  onChange: (T) => V(!0, T),
250
- isDisabled: A || w,
250
+ isDisabled: A || C,
251
251
  children: [
252
252
  /* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
253
253
  /* @__PURE__ */ e.jsx("option", { value: 1, children: g[1] })
@@ -258,7 +258,7 @@ const Mn = ({
258
258
  ct,
259
259
  {
260
260
  precision: 0,
261
- size: u ?? "sm",
261
+ size: d ?? "sm",
262
262
  min: 0,
263
263
  max: v < 0 ? Math.abs(n) : F ?? a,
264
264
  value: y === "" ? "" : Math.abs(Number(y ?? n)),
@@ -267,8 +267,8 @@ const Mn = ({
267
267
  borderWidth: 1,
268
268
  borderRadius: 3,
269
269
  borderColor: "#ccc",
270
- isDisabled: w,
271
- ...d,
270
+ isDisabled: C,
271
+ ...u,
272
272
  children: /* @__PURE__ */ e.jsx(
273
273
  dt,
274
274
  {
@@ -282,7 +282,7 @@ const Mn = ({
282
282
  /* @__PURE__ */ e.jsx(
283
283
  ct,
284
284
  {
285
- size: u ?? "sm",
285
+ size: d ?? "sm",
286
286
  min: 0,
287
287
  max: j < 0 ? Math.abs($ ?? n) : a,
288
288
  precision: 0,
@@ -292,8 +292,8 @@ const Mn = ({
292
292
  borderWidth: 1,
293
293
  borderRadius: 3,
294
294
  borderColor: "#ccc",
295
- isDisabled: w,
296
- ...d,
295
+ isDisabled: C,
296
+ ...u,
297
297
  children: /* @__PURE__ */ e.jsx(
298
298
  dt,
299
299
  {
@@ -308,11 +308,11 @@ const Mn = ({
308
308
  lt,
309
309
  {
310
310
  width: "auto",
311
- size: u,
311
+ size: d,
312
312
  fontWeight: "bold",
313
313
  value: j,
314
314
  onChange: (T) => V(!1, T),
315
- isDisabled: A || w,
315
+ isDisabled: A || C,
316
316
  children: [
317
317
  /* @__PURE__ */ e.jsx("option", { value: -1, children: g[0] }),
318
318
  /* @__PURE__ */ e.jsx("option", { value: 1, children: g[1] })
@@ -323,17 +323,17 @@ const Mn = ({
323
323
  }
324
324
  )
325
325
  ] });
326
- }, kn = ({ tags: r, containerProps: n, ...a }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((p, x) => /* @__PURE__ */ e.jsx(Ne, { ...a, children: p }, x)) }), Tn = new pn({}), Rn = ({
326
+ }, kn = ({ tags: r, containerProps: n, ...a }) => /* @__PURE__ */ e.jsx(re, { ...n, children: r.map((h, x) => /* @__PURE__ */ e.jsx(Ne, { ...a, children: h }, x)) }), Tn = new pn({}), Rn = ({
327
327
  action: r,
328
328
  quantumIconSrc: n
329
329
  }) => {
330
- const { getLabel: a } = pe(), p = k(() => ({
330
+ const { getLabel: a } = pe(), h = k(() => ({
331
331
  actionLowerCase: a("action").toLocaleLowerCase()
332
332
  }), [a]);
333
333
  return r.quantumOwned ? /* @__PURE__ */ e.jsx(
334
334
  tt,
335
335
  {
336
- label: `This ${p.actionLowerCase} is owned by Quantum`,
336
+ label: `This ${h.actionLowerCase} is owned by Quantum`,
337
337
  "aria-label": "Quantum owned",
338
338
  children: /* @__PURE__ */ e.jsx(
339
339
  te,
@@ -349,7 +349,7 @@ const Mn = ({
349
349
  {
350
350
  src: n,
351
351
  boxSize: "1em",
352
- alt: `Quantum-owned ${p.actionLowerCase}`
352
+ alt: `Quantum-owned ${h.actionLowerCase}`
353
353
  }
354
354
  )
355
355
  }
@@ -367,48 +367,48 @@ const Mn = ({
367
367
  n.replace(/([A-Z])/g, " $1").trim()
368
368
  )
369
369
  ).join(", "), Fn = (r, n) => !n || n.length == 0 ? r : r.filter(
370
- (a) => a.useCases?.some((p) => n.includes(p.id)) ?? !1
371
- ), Dn = (r, n, a) => !n || n.length === 0 ? r : r.filter((p) => {
370
+ (a) => a.useCases?.some((h) => n.includes(h.id)) ?? !1
371
+ ), Dn = (r, n, a) => !n || n.length === 0 ? r : r.filter((h) => {
372
372
  const x = {};
373
- return n.forEach((d) => {
374
- for (const [u, h] of Object.entries(a || {}))
375
- if (h.some((s) => s.id === d)) {
376
- x[u] || (x[u] = []), x[u].push(d);
373
+ return n.forEach((u) => {
374
+ for (const [d, p] of Object.entries(a || {}))
375
+ if (p.some((s) => s.id === u)) {
376
+ x[d] || (x[d] = []), x[d].push(u);
377
377
  break;
378
378
  }
379
379
  }), Object.entries(x).every(
380
- ([d, u]) => {
381
- const h = p.metadataGroups?.find((w) => L(je, w).key === d);
382
- if (!h)
380
+ ([u, d]) => {
381
+ const p = h.metadataGroups?.find((C) => I(je, C).key === u);
382
+ if (!p)
383
383
  return !1;
384
- const s = L(
384
+ const s = I(
385
385
  je,
386
- h
387
- ), g = L(
386
+ p
387
+ ), g = I(
388
388
  be,
389
389
  s.data
390
- ).map((w) => w.id);
391
- return u.some(
392
- (w) => g.includes(w)
390
+ ).map((C) => C.id);
391
+ return d.some(
392
+ (C) => g.includes(C)
393
393
  );
394
394
  }
395
395
  );
396
- }), Gn = ({
396
+ }), Pn = ({
397
397
  actions: r,
398
398
  totalActions: n,
399
399
  onCreate: a,
400
- onDelete: p,
400
+ onDelete: h,
401
401
  onEdit: x,
402
- onView: d,
403
- onSelected: u,
404
- onDuplicate: h,
402
+ onView: u,
403
+ onSelected: d,
404
+ onDuplicate: p,
405
405
  disableMultiSelect: s,
406
406
  disableDelete: i,
407
407
  disableEdit: g,
408
- disableCreate: w,
409
- hideUseCase: S = !0,
408
+ disableCreate: C,
409
+ hideUseCase: L = !0,
410
410
  showMetadataFilters: M = !0,
411
- tableProps: I,
411
+ tableProps: w,
412
412
  containerProps: y,
413
413
  quantumIconSrc: c = "/favicon.ico"
414
414
  }) => {
@@ -434,10 +434,10 @@ const Mn = ({
434
434
  const b = {};
435
435
  o.forEach((U) => {
436
436
  if (U.error || !U.data) return;
437
- const q = L(
437
+ const q = I(
438
438
  je,
439
439
  U.data.getMetadataByKey
440
- ), E = L(
440
+ ), E = I(
441
441
  be,
442
442
  q.data
443
443
  );
@@ -452,7 +452,7 @@ const Mn = ({
452
452
  const V = k(() => {
453
453
  if (!r)
454
454
  return;
455
- const t = Nn(r, m), o = S ? t : Fn(t, j);
455
+ const t = Nn(r, m), o = L ? t : Fn(t, j);
456
456
  return M ? Dn(
457
457
  o,
458
458
  $,
@@ -462,23 +462,23 @@ const Mn = ({
462
462
  r,
463
463
  m,
464
464
  j,
465
- S,
465
+ L,
466
466
  M,
467
467
  $,
468
468
  O
469
- ]), T = P(() => {
470
- if (!p)
469
+ ]), T = G(() => {
470
+ if (!h)
471
471
  return;
472
472
  const o = r.filter(
473
473
  (b) => b.selected && !b.quantumOwned
474
474
  ).map((b) => b.id);
475
- p(o);
476
- }, [r, p]), _ = P(() => {
477
- if (!h)
475
+ h(o);
476
+ }, [r, h]), _ = G(() => {
477
+ if (!p)
478
478
  return;
479
479
  const t = r.filter((o) => o.selected);
480
- h(t.map((o) => o.id)), u && t.forEach((o) => u(o, !1));
481
- }, [r, h, u]), J = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), K = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), l = P(
480
+ p(t.map((o) => o.id)), d && t.forEach((o) => d(o, !1));
481
+ }, [r, p, d]), J = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), K = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), l = G(
482
482
  (t, o) => {
483
483
  const b = Z.find((q) => q.key === t);
484
484
  if (!b) return;
@@ -493,11 +493,11 @@ const Mn = ({
493
493
  );
494
494
  return /* @__PURE__ */ e.jsxs(te, { ...y, children: [
495
495
  /* @__PURE__ */ e.jsxs(we, { alignContent: "space-between", gap: 4, children: [
496
- (a || p || h) && /* @__PURE__ */ e.jsxs(Me, { mb: "1rem", gap: 4, children: [
496
+ (a || h || p) && /* @__PURE__ */ e.jsxs(Me, { mb: "1rem", gap: 4, children: [
497
497
  a && /* @__PURE__ */ e.jsxs(
498
498
  se,
499
499
  {
500
- isDisabled: !a || w,
500
+ isDisabled: !a || C,
501
501
  colorScheme: "blackAlpha",
502
502
  backgroundColor: "gray.700",
503
503
  onClick: a,
@@ -507,7 +507,7 @@ const Mn = ({
507
507
  ]
508
508
  }
509
509
  ),
510
- p && !s && /* @__PURE__ */ e.jsx(
510
+ h && !s && /* @__PURE__ */ e.jsx(
511
511
  tt,
512
512
  {
513
513
  label: K ? J ? `Quantum-owned ${R.actionPluralLowerCase} are selected and will be skipped` : `Selected ${R.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
@@ -516,14 +516,14 @@ const Mn = ({
516
516
  se,
517
517
  {
518
518
  colorScheme: "gray",
519
- isDisabled: !J || !p || i,
519
+ isDisabled: !J || !h || i,
520
520
  onClick: T,
521
521
  children: "Delete Selected"
522
522
  }
523
523
  )
524
524
  }
525
525
  ),
526
- h && !s && /* @__PURE__ */ e.jsx(
526
+ p && !s && /* @__PURE__ */ e.jsx(
527
527
  se,
528
528
  {
529
529
  colorScheme: "gray",
@@ -539,7 +539,7 @@ const Mn = ({
539
539
  setSearch: v,
540
540
  actions: r,
541
541
  updateUseCases: A,
542
- hideUseCaseFilter: S
542
+ hideUseCaseFilter: L
543
543
  }
544
544
  )
545
545
  ] }),
@@ -570,7 +570,7 @@ const Mn = ({
570
570
  }
571
571
  )
572
572
  ] }, t.key)) }) }),
573
- /* @__PURE__ */ e.jsx(Pt, { mr: "2rem", overflowX: "hidden", ...I, children: /* @__PURE__ */ e.jsxs(Et, { size: "md", variant: "simple", children: [
573
+ /* @__PURE__ */ e.jsx(Gt, { mr: "2rem", overflowX: "hidden", ...w, children: /* @__PURE__ */ e.jsxs(Et, { size: "md", variant: "simple", children: [
574
574
  /* @__PURE__ */ e.jsx(_t, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(ut, { children: [
575
575
  /* @__PURE__ */ e.jsxs(Re, { fontWeight: "normal", children: [
576
576
  "(showing ",
@@ -582,7 +582,7 @@ const Mn = ({
582
582
  ] }),
583
583
  /* @__PURE__ */ e.jsx(Re, { children: "Name" }),
584
584
  /* @__PURE__ */ e.jsx(Re, { children: "Sensor Locations" }),
585
- !S && /* @__PURE__ */ e.jsx(Re, { children: "Use Case" }),
585
+ !L && /* @__PURE__ */ e.jsx(Re, { children: "Use Case" }),
586
586
  /* @__PURE__ */ e.jsx(Re, {})
587
587
  ] }) }),
588
588
  /* @__PURE__ */ e.jsx(zt, { children: V?.map((t) => /* @__PURE__ */ e.jsxs(
@@ -594,12 +594,12 @@ const Mn = ({
594
594
  t.selected && "bg-gray-200"
595
595
  ),
596
596
  onClick: () => {
597
- s || u?.(t, !t.selected);
597
+ s || d?.(t, !t.selected);
598
598
  },
599
599
  children: [
600
600
  /* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsxs(we, { children: [
601
601
  !s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(xn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(fn, { className: "text-gray-400" }) }),
602
- (t.quantumOwned || !x) && d && /* @__PURE__ */ e.jsx(
602
+ (t.quantumOwned || !x) && u && /* @__PURE__ */ e.jsx(
603
603
  se,
604
604
  {
605
605
  ml: "1em",
@@ -607,7 +607,7 @@ const Mn = ({
607
607
  variant: "link",
608
608
  colorScheme: "blue",
609
609
  onClick: (o) => {
610
- o.stopPropagation(), d(t.id);
610
+ o.stopPropagation(), u(t.id);
611
611
  },
612
612
  children: "View"
613
613
  }
@@ -638,7 +638,7 @@ const Mn = ({
638
638
  t.name
639
639
  ] }) }),
640
640
  /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", whiteSpace: "break-spaces", children: $n(t.sensorLocations) }),
641
- !S && /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
641
+ !L && /* @__PURE__ */ e.jsx(_e, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
642
642
  kn,
643
643
  {
644
644
  containerProps: { flexWrap: "wrap" },
@@ -655,66 +655,66 @@ const Mn = ({
655
655
  onSave: r,
656
656
  onCancel: n,
657
657
  onError: a,
658
- hideButtons: p = !1,
658
+ hideButtons: h = !1,
659
659
  setButtonDisabled: x,
660
- setButtonOnClick: d,
661
- quantumOwned: u
660
+ setButtonOnClick: u,
661
+ quantumOwned: d
662
662
  }) => {
663
- const h = yt(), { getLabel: s } = pe(), i = k(() => ({
663
+ const p = yt(), { getLabel: s } = pe(), i = k(() => ({
664
664
  singular: s("action"),
665
665
  plural: s("action_plural"),
666
666
  pluralLowerCase: s("action_plural").toLowerCase(),
667
667
  singularLowerCase: s("action").toLowerCase()
668
- }), [s]), [g, w] = B("copy"), [S, M] = B(""), [I, y] = B([]), [c, m] = B(!1), [v] = Ce({
668
+ }), [s]), [g, C] = B("copy"), [L, M] = B(""), [w, y] = B([]), [c, m] = B(!1), [v] = Ce({
669
669
  query: St
670
670
  }), [j] = Ce({
671
671
  query: rn,
672
- variables: { groupId: S },
673
- pause: !S
672
+ variables: { groupId: L },
673
+ pause: !L
674
674
  // Only run when group is selected
675
675
  }), [, A] = fe(st), [, $] = fe(
676
676
  Lt
677
677
  ), F = k(() => v.data?.groups ? v.data.groups.map(
678
- (l) => L(It, l)
678
+ (l) => I(It, l)
679
679
  ) : [], [v.data]), O = k(() => j.data ? j.data.actions.map((t) => {
680
- const o = L(ve, t), b = L(
680
+ const o = I(ve, t), b = I(
681
681
  Ze,
682
682
  o.reports
683
- ), U = L(
683
+ ), U = I(
684
684
  $e,
685
685
  o.categories
686
- ), E = L(
686
+ ), E = I(
687
687
  je,
688
688
  o.metadataGroups
689
689
  ).map((D) => ({
690
690
  ...D,
691
- data: D.data.map((Y) => L(be, Y))
691
+ data: D.data.map((Y) => I(be, Y))
692
692
  }));
693
693
  return {
694
694
  ...o,
695
- thresholds: L(Ie, o.thresholds),
695
+ thresholds: I(Ie, o.thresholds),
696
696
  reports: b.map((D) => ({
697
697
  ...D,
698
- thresholds: L(Ie, D.thresholds)
698
+ thresholds: I(Ie, D.thresholds)
699
699
  })),
700
700
  categories: U,
701
701
  metadataGroups: E
702
702
  };
703
703
  }) : [], [j.data]), N = k(() => O.filter(
704
- (l) => I.includes(l.id)
705
- ), [O, I]), H = P(
704
+ (l) => w.includes(l.id)
705
+ ), [O, w]), H = G(
706
706
  (l) => {
707
707
  const t = l?.value || "";
708
708
  M(t), y([]);
709
709
  },
710
710
  []
711
- ), oe = P(
711
+ ), oe = G(
712
712
  (l) => {
713
713
  const t = l.map((o) => o.value);
714
714
  y(t);
715
715
  },
716
716
  []
717
- ), R = P(
717
+ ), R = G(
718
718
  async (l) => {
719
719
  const t = {
720
720
  ...l,
@@ -731,7 +731,7 @@ const Mn = ({
731
731
  id: void 0
732
732
  })),
733
733
  categories: l.categories.map((b) => b.id),
734
- quantumOwned: u,
734
+ quantumOwned: d,
735
735
  metadataItemIds: l.metadataGroups.flatMap((b) => b.data.map((U) => U.id)).filter((b) => b !== void 0),
736
736
  reports: l.reports.map((b) => ({
737
737
  ...b,
@@ -745,24 +745,24 @@ const Mn = ({
745
745
  }, o = await A({ fields: t });
746
746
  if (o.error) throw new Error(o.error.message);
747
747
  if (o.data?.createAction)
748
- return L(ve, o.data.createAction);
748
+ return I(ve, o.data.createAction);
749
749
  throw new Error("No action data returned");
750
750
  },
751
- [A, u]
752
- ), Z = P(
751
+ [A, d]
752
+ ), Z = G(
753
753
  async (l) => {
754
754
  const t = await $({ id: l.id });
755
755
  if (t.error)
756
756
  throw new Error(t.error.message);
757
757
  if (t.data?.convertActionToQuantumOwned)
758
- return L(
758
+ return I(
759
759
  ve,
760
760
  t.data.convertActionToQuantumOwned
761
761
  );
762
762
  throw new Error("No action data returned");
763
763
  },
764
764
  [$]
765
- ), V = P(async () => {
765
+ ), V = G(async () => {
766
766
  if (m(!0), !N.length) {
767
767
  const l = new Error(
768
768
  `No ${i.pluralLowerCase} selected for ${g === "copy" ? "copying" : "converting"}`
@@ -786,7 +786,7 @@ const Mn = ({
786
786
  }
787
787
  if (l.length > 0) {
788
788
  const U = l.length, q = N.length, E = g === "copy" ? "copied" : "converted", D = g === "copy" ? "copy" : "convert";
789
- h({
789
+ p({
790
790
  title: t > 0 ? `Partial ${D} completed` : `${i.plural} ${E} successfully`,
791
791
  description: t > 0 ? `${U} of ${q} ${i.pluralLowerCase} ${E} successfully` : `${U} ${U > 1 ? i.pluralLowerCase : i.singularLowerCase} ${E} successfully`,
792
792
  status: t > 0 ? "warning" : "success",
@@ -799,7 +799,7 @@ const Mn = ({
799
799
  );
800
800
  } catch (l) {
801
801
  const t = g === "copy" ? "copy" : "convert", o = l instanceof Error ? l.message : `Failed to ${t} ${i.pluralLowerCase}`;
802
- h({
802
+ p({
803
803
  title: `${g === "copy" ? "Copy" : "Convert"} failed`,
804
804
  description: o,
805
805
  status: "error",
@@ -814,12 +814,12 @@ const Mn = ({
814
814
  g,
815
815
  R,
816
816
  Z,
817
- h,
817
+ p,
818
818
  r,
819
819
  a,
820
820
  i
821
- ]), T = P(() => {
822
- M(""), y([]), w("copy"), n?.();
821
+ ]), T = G(() => {
822
+ M(""), y([]), C("copy"), n?.();
823
823
  }, [n]);
824
824
  ie(() => {
825
825
  x && x({
@@ -827,11 +827,11 @@ const Mn = ({
827
827
  saveButton: N.length === 0 || c
828
828
  });
829
829
  }, [N.length, c, x]), ie(() => {
830
- d && d({
830
+ u && u({
831
831
  cancelButton: T,
832
832
  saveButton: V
833
833
  });
834
- }, [d, T, V]);
834
+ }, [u, T, V]);
835
835
  const _ = k(() => F.map((l) => ({
836
836
  value: l.id,
837
837
  label: l.name
@@ -842,22 +842,22 @@ const Mn = ({
842
842
  isQuantumOwned: l.quantumOwned
843
843
  })), [O, g]), W = v.fetching, K = j.fetching;
844
844
  return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
845
- u && /* @__PURE__ */ e.jsxs(X, { children: [
845
+ d && /* @__PURE__ */ e.jsxs(X, { children: [
846
846
  /* @__PURE__ */ e.jsx(he, { children: "Operation Mode" }),
847
847
  /* @__PURE__ */ e.jsx(
848
848
  vt,
849
849
  {
850
850
  value: g,
851
851
  onChange: (l) => {
852
- w(l), y([]);
852
+ C(l), y([]);
853
853
  },
854
854
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
855
855
  /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
856
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", children: [
856
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
857
857
  "Copy ",
858
858
  i.plural
859
859
  ] }),
860
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
860
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
861
861
  "Create new ",
862
862
  i.plural.toLocaleLowerCase(),
863
863
  " ",
@@ -865,11 +865,11 @@ const Mn = ({
865
865
  ] })
866
866
  ] }) }),
867
867
  /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
868
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", children: [
868
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
869
869
  "Convert to Quantum Owned ",
870
870
  i.singular
871
871
  ] }),
872
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
872
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
873
873
  "Convert existing",
874
874
  " ",
875
875
  i.plural.toLocaleLowerCase(),
@@ -887,7 +887,7 @@ const Mn = ({
887
887
  {
888
888
  placeholder: "Choose a group...",
889
889
  options: _,
890
- value: _.find((l) => l.value === S) || null,
890
+ value: _.find((l) => l.value === L) || null,
891
891
  onChange: H,
892
892
  isLoading: W,
893
893
  isDisabled: W,
@@ -896,13 +896,13 @@ const Mn = ({
896
896
  ),
897
897
  v.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
898
898
  /* @__PURE__ */ e.jsx(Je, {}),
899
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
899
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
900
900
  "Failed to load groups: ",
901
901
  v.error.message
902
902
  ] })
903
903
  ] })
904
904
  ] }),
905
- S && /* @__PURE__ */ e.jsxs(X, { children: [
905
+ L && /* @__PURE__ */ e.jsxs(X, { children: [
906
906
  /* @__PURE__ */ e.jsxs(he, { children: [
907
907
  "Select ",
908
908
  i.plural,
@@ -912,7 +912,7 @@ const Mn = ({
912
912
  ] }),
913
913
  K ? /* @__PURE__ */ e.jsxs(re, { children: [
914
914
  /* @__PURE__ */ e.jsx(Ct, { size: "sm" }),
915
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
915
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
916
916
  "Loading ",
917
917
  i.pluralLowerCase,
918
918
  "..."
@@ -924,7 +924,7 @@ const Mn = ({
924
924
  placeholder: `Choose ${i.pluralLowerCase} to ${g}...`,
925
925
  options: J,
926
926
  value: J.filter(
927
- (l) => I.includes(l.value)
927
+ (l) => w.includes(l.value)
928
928
  ),
929
929
  onChange: oe,
930
930
  isDisabled: J.length === 0,
@@ -933,14 +933,14 @@ const Mn = ({
933
933
  closeMenuOnSelect: !1,
934
934
  formatOptionLabel: (l, { context: t }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
935
935
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
936
- /* @__PURE__ */ e.jsx(C, { children: l.label }),
937
- t === "value" && l.isQuantumOwned && /* @__PURE__ */ e.jsx(C, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
936
+ /* @__PURE__ */ e.jsx(S, { children: l.label }),
937
+ t === "value" && l.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
938
938
  ] }),
939
939
  l.isQuantumOwned && t === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
940
940
  ] })
941
941
  }
942
942
  ),
943
- J.length === 0 && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", mt: 2, children: [
943
+ J.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
944
944
  "No ",
945
945
  i.pluralLowerCase,
946
946
  " found"
@@ -948,7 +948,7 @@ const Mn = ({
948
948
  ] }),
949
949
  j.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
950
950
  /* @__PURE__ */ e.jsx(Je, {}),
951
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
951
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
952
952
  "Failed to load ",
953
953
  i.pluralLowerCase,
954
954
  ":",
@@ -958,7 +958,7 @@ const Mn = ({
958
958
  ] })
959
959
  ] }),
960
960
  N.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
961
- /* @__PURE__ */ e.jsx(C, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${i.singular} to ${g === "copy" ? "Copy" : "Convert"}:` : `${N.length} ${i.plural} to ${g === "copy" ? "Copy" : "Convert"}:` }),
961
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${i.singular} to ${g === "copy" ? "Copy" : "Convert"}:` : `${N.length} ${i.plural} to ${g === "copy" ? "Copy" : "Convert"}:` }),
962
962
  /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
963
963
  N.map((l, t) => /* @__PURE__ */ e.jsxs(
964
964
  te,
@@ -971,7 +971,7 @@ const Mn = ({
971
971
  borderColor: "gray.200",
972
972
  children: [
973
973
  /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "start", mb: 2, children: [
974
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", fontSize: "sm", children: [
974
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
975
975
  t + 1,
976
976
  ". ",
977
977
  l.name
@@ -986,32 +986,32 @@ const Mn = ({
986
986
  fontSize: "sm",
987
987
  color: "gray.600",
988
988
  children: [
989
- l.description && /* @__PURE__ */ e.jsxs(C, { children: [
989
+ l.description && /* @__PURE__ */ e.jsxs(S, { children: [
990
990
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
991
991
  " ",
992
992
  l.description
993
993
  ] }),
994
- /* @__PURE__ */ e.jsxs(C, { children: [
994
+ /* @__PURE__ */ e.jsxs(S, { children: [
995
995
  /* @__PURE__ */ e.jsx("strong", { children: "Type:" }),
996
996
  " ",
997
997
  l.activityKind
998
998
  ] }),
999
- /* @__PURE__ */ e.jsxs(C, { children: [
999
+ /* @__PURE__ */ e.jsxs(S, { children: [
1000
1000
  /* @__PURE__ */ e.jsx("strong", { children: "Laterality:" }),
1001
1001
  " ",
1002
1002
  l.laterality
1003
1003
  ] }),
1004
- /* @__PURE__ */ e.jsxs(C, { children: [
1004
+ /* @__PURE__ */ e.jsxs(S, { children: [
1005
1005
  /* @__PURE__ */ e.jsx("strong", { children: "Sensor Locations:" }),
1006
1006
  " ",
1007
1007
  l.sensorLocations.length
1008
1008
  ] }),
1009
- /* @__PURE__ */ e.jsxs(C, { children: [
1009
+ /* @__PURE__ */ e.jsxs(S, { children: [
1010
1010
  /* @__PURE__ */ e.jsx("strong", { children: "Thresholds:" }),
1011
1011
  " ",
1012
1012
  l.thresholds.length
1013
1013
  ] }),
1014
- /* @__PURE__ */ e.jsxs(C, { children: [
1014
+ /* @__PURE__ */ e.jsxs(S, { children: [
1015
1015
  /* @__PURE__ */ e.jsx("strong", { children: "Use Cases:" }),
1016
1016
  " ",
1017
1017
  l.useCases.map((o) => o.name).join(", ") || "None"
@@ -1032,7 +1032,7 @@ const Mn = ({
1032
1032
  borderRadius: "md",
1033
1033
  border: "1px solid",
1034
1034
  borderColor: "blue.200",
1035
- children: /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1035
+ children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1036
1036
  "Total: ",
1037
1037
  N.length,
1038
1038
  " ",
@@ -1045,7 +1045,7 @@ const Mn = ({
1045
1045
  )
1046
1046
  ] })
1047
1047
  ] }),
1048
- !p && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1048
+ !h && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1049
1049
  /* @__PURE__ */ e.jsx(
1050
1050
  se,
1051
1051
  {
@@ -1076,12 +1076,12 @@ const Mn = ({
1076
1076
  onSave: r,
1077
1077
  onCancel: n,
1078
1078
  onError: a,
1079
- hideButtons: p = !1,
1079
+ hideButtons: h = !1,
1080
1080
  setButtonDisabled: x,
1081
- setButtonOnClick: d,
1082
- quantumOwned: u
1081
+ setButtonOnClick: u,
1082
+ quantumOwned: d
1083
1083
  }) => {
1084
- const h = yt(), { getLabel: s } = pe(), i = k(() => ({
1084
+ const p = yt(), { getLabel: s } = pe(), i = k(() => ({
1085
1085
  singular: s("module"),
1086
1086
  plural: s("module_plural"),
1087
1087
  pluralLowerCase: s("module_plural").toLowerCase(),
@@ -1091,35 +1091,35 @@ const Mn = ({
1091
1091
  plural: s("action_plural"),
1092
1092
  pluralLowerCase: s("action_plural").toLowerCase(),
1093
1093
  singularLowerCase: s("action").toLowerCase()
1094
- }), [s]), [w, S] = B(""), [M, I] = B([]), [y, c] = B(!1), [m, v] = B("copy"), [j] = Ce({
1094
+ }), [s]), [C, L] = B(""), [M, w] = B([]), [y, c] = B(!1), [m, v] = B("copy"), [j] = Ce({
1095
1095
  query: St
1096
1096
  }), [A] = Ce({
1097
1097
  query: on,
1098
- variables: { groupId: w },
1099
- pause: !w
1098
+ variables: { groupId: C },
1099
+ pause: !C
1100
1100
  // Only run when group is selected
1101
1101
  }), [, $] = fe(Mt), [, F] = fe(Ot), [, O] = fe(st), [, N] = fe(
1102
1102
  Lt
1103
1103
  ), H = k(() => j.data?.groups ? j.data.groups.map(
1104
- (t) => L(It, t)
1105
- ) : [], [j.data]), oe = k(() => A.data?.modules ? L(
1104
+ (t) => I(It, t)
1105
+ ) : [], [j.data]), oe = k(() => A.data?.modules ? I(
1106
1106
  Qe,
1107
1107
  A.data?.modules
1108
1108
  ).map((o) => {
1109
- const b = L(
1109
+ const b = I(
1110
1110
  At,
1111
1111
  o.moduleActions
1112
- ), q = L(
1112
+ ), q = I(
1113
1113
  je,
1114
1114
  o.metadataGroups
1115
- ).map((E) => L(be, E.data)).flat();
1115
+ ).map((E) => I(be, E.data)).flat();
1116
1116
  return {
1117
1117
  ...o,
1118
1118
  moduleActions: b.map((E) => ({
1119
1119
  ...E,
1120
- action: L(ve, E.action)
1120
+ action: I(ve, E.action)
1121
1121
  })),
1122
- categories: L(
1122
+ categories: I(
1123
1123
  $e,
1124
1124
  o.categories
1125
1125
  ),
@@ -1127,19 +1127,19 @@ const Mn = ({
1127
1127
  };
1128
1128
  }) : [], [A.data]), R = k(() => oe.filter(
1129
1129
  (t) => M.includes(t.id)
1130
- ), [oe, M]), Z = P(
1130
+ ), [oe, M]), Z = G(
1131
1131
  (t) => {
1132
1132
  const o = t?.value || "";
1133
- S(o), I([]);
1133
+ L(o), w([]);
1134
1134
  },
1135
1135
  []
1136
- ), V = P(
1136
+ ), V = G(
1137
1137
  (t) => {
1138
1138
  const o = t.map((b) => b.value);
1139
- I(o);
1139
+ w(o);
1140
1140
  },
1141
1141
  []
1142
- ), T = P(async () => {
1142
+ ), T = G(async () => {
1143
1143
  if (c(!0), !R.length) {
1144
1144
  c(!1);
1145
1145
  const t = new Error(
@@ -1154,48 +1154,48 @@ const Mn = ({
1154
1154
  for (const b of R)
1155
1155
  try {
1156
1156
  let U = b.moduleActions.map((q) => q.actionId);
1157
- if (u) {
1157
+ if (d) {
1158
1158
  const q = b.moduleActions.map((Y) => Y.action), E = async (Y) => {
1159
1159
  if (m === "copy") {
1160
1160
  if (Y.quantumOwned) return Y;
1161
- const ye = L(
1161
+ const ye = I(
1162
1162
  $e,
1163
1163
  Y.categories
1164
- ), Ge = L(
1164
+ ), Pe = I(
1165
1165
  je,
1166
1166
  Y.metadataGroups
1167
- ).map((xe) => L(
1167
+ ).map((xe) => I(
1168
1168
  be,
1169
1169
  xe.data
1170
- ).map((Te) => Te.id)).flat(), Oe = L(
1170
+ ).map((Te) => Te.id)).flat(), Oe = I(
1171
1171
  Ze,
1172
1172
  Y.reports
1173
1173
  ).map((xe) => ({
1174
1174
  ...xe,
1175
1175
  id: void 0,
1176
- thresholds: L(
1176
+ thresholds: I(
1177
1177
  Ie,
1178
1178
  xe.thresholds
1179
1179
  ).map((Te) => ({
1180
1180
  ...Te,
1181
1181
  id: void 0
1182
1182
  }))
1183
- })), Ae = L(
1183
+ })), Ae = I(
1184
1184
  Ie,
1185
1185
  Y.thresholds
1186
1186
  ).map((xe) => ({
1187
1187
  ...xe,
1188
1188
  id: void 0
1189
- })), Pe = {
1189
+ })), Ge = {
1190
1190
  ...Y,
1191
1191
  quantumOwned: !0,
1192
1192
  thresholds: Ae,
1193
1193
  categories: ye?.map((xe) => xe.id),
1194
1194
  reports: Oe,
1195
- metadataIds: Ge,
1195
+ metadataIds: Pe,
1196
1196
  id: void 0
1197
- }, ke = await O({ fields: Pe });
1198
- return ke.error || !ke.data?.createAction ? null : L(
1197
+ }, ke = await O({ fields: Ge });
1198
+ return ke.error || !ke.data?.createAction ? null : I(
1199
1199
  ve,
1200
1200
  ke.data.createAction
1201
1201
  );
@@ -1204,7 +1204,7 @@ const Mn = ({
1204
1204
  const ge = await N({
1205
1205
  id: Y.id
1206
1206
  });
1207
- return ge.error || !ge.data?.convertActionToQuantumOwned ? null : L(
1207
+ return ge.error || !ge.data?.convertActionToQuantumOwned ? null : I(
1208
1208
  ve,
1209
1209
  ge.data.convertActionToQuantumOwned
1210
1210
  );
@@ -1226,7 +1226,7 @@ const Mn = ({
1226
1226
  });
1227
1227
  if (E.error) throw new Error(E.error.message);
1228
1228
  if (E.data?.updateModule) {
1229
- const D = L(
1229
+ const D = I(
1230
1230
  Qe,
1231
1231
  E.data.updateModule
1232
1232
  );
@@ -1238,7 +1238,7 @@ const Mn = ({
1238
1238
  description: b.description || void 0,
1239
1239
  actions: U,
1240
1240
  categories: b.categories.map((D) => D.id),
1241
- quantumOwned: u,
1241
+ quantumOwned: d,
1242
1242
  metadataItemIds: b.metadataItems.map((D) => D.id),
1243
1243
  actionReports: b.moduleActions.filter((D) => !!D.reportId).map((D) => ({
1244
1244
  actionId: D.actionId,
@@ -1247,7 +1247,7 @@ const Mn = ({
1247
1247
  }, E = await $({ input: q });
1248
1248
  if (E.error) throw new Error(E.error.message);
1249
1249
  if (E.data?.createModule) {
1250
- const D = L(
1250
+ const D = I(
1251
1251
  Qe,
1252
1252
  E.data.createModule
1253
1253
  );
@@ -1262,20 +1262,20 @@ const Mn = ({
1262
1262
  }
1263
1263
  if (t.length > 0) {
1264
1264
  const b = t.length, U = R.length;
1265
- h({
1265
+ p({
1266
1266
  title: o > 0 ? `Partial ${m === "convert" ? "convert" : "copy"} completed` : `${i.plural} ${m === "convert" ? "converted" : "copied"} successfully`,
1267
1267
  description: o > 0 ? `${b} of ${U} ${i.plural} ${m === "convert" ? "converted" : "copied"} successfully` : `${b} ${b > 1 ? i.plural : i.singular} ${m === "convert" ? "converted" : "copied"} successfully`,
1268
1268
  status: o > 0 ? "warning" : "success",
1269
1269
  duration: 3e3,
1270
1270
  isClosable: !0
1271
- }), t.length > 0 && r?.(), S(""), I([]);
1271
+ }), t.length > 0 && r?.(), L(""), w([]);
1272
1272
  } else
1273
1273
  throw new Error(
1274
1274
  `Failed to ${m === "convert" ? "convert" : "copy"} any modules`
1275
1275
  );
1276
1276
  } catch (t) {
1277
1277
  const o = t instanceof Error ? t.message : `Failed to ${m === "convert" ? "convert" : "copy"} modules`;
1278
- h({
1278
+ p({
1279
1279
  title: m === "convert" ? "Convert failed" : "Copy failed",
1280
1280
  description: o,
1281
1281
  status: "error",
@@ -1289,16 +1289,16 @@ const Mn = ({
1289
1289
  R,
1290
1290
  $,
1291
1291
  F,
1292
- h,
1292
+ p,
1293
1293
  r,
1294
1294
  a,
1295
- u,
1295
+ d,
1296
1296
  O,
1297
1297
  N,
1298
1298
  m,
1299
1299
  i
1300
- ]), _ = P(() => {
1301
- S(""), I([]), v("copy"), n?.();
1300
+ ]), _ = G(() => {
1301
+ L(""), w([]), v("copy"), n?.();
1302
1302
  }, [n]);
1303
1303
  ie(() => {
1304
1304
  x && x({
@@ -1306,11 +1306,11 @@ const Mn = ({
1306
1306
  saveButton: R.length === 0 || y
1307
1307
  });
1308
1308
  }, [R.length, y, x]), ie(() => {
1309
- d && d({
1309
+ u && u({
1310
1310
  cancelButton: _,
1311
1311
  saveButton: T
1312
1312
  });
1313
- }, [d, _, T]);
1313
+ }, [u, _, T]);
1314
1314
  const J = k(() => H.map((t) => ({
1315
1315
  value: t.id,
1316
1316
  label: t.name
@@ -1321,30 +1321,30 @@ const Mn = ({
1321
1321
  isQuantumOwned: t.quantumOwned
1322
1322
  })), [oe, m]), K = j.fetching, l = A.fetching;
1323
1323
  return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
1324
- u && /* @__PURE__ */ e.jsxs(X, { children: [
1324
+ d && /* @__PURE__ */ e.jsxs(X, { children: [
1325
1325
  /* @__PURE__ */ e.jsx(he, { children: "Operation Mode" }),
1326
1326
  /* @__PURE__ */ e.jsx(
1327
1327
  vt,
1328
1328
  {
1329
1329
  value: m,
1330
1330
  onChange: (t) => {
1331
- v(t), I([]);
1331
+ v(t), w([]);
1332
1332
  },
1333
1333
  children: /* @__PURE__ */ e.jsxs(re, { spacing: 6, children: [
1334
1334
  /* @__PURE__ */ e.jsx(Ye, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
1335
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", children: [
1335
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
1336
1336
  "Copy ",
1337
1337
  i.plural
1338
1338
  ] }),
1339
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1339
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1340
1340
  "Create new ",
1341
1341
  i.pluralLowerCase,
1342
1342
  " based on selected ones"
1343
1343
  ] })
1344
1344
  ] }) }),
1345
1345
  /* @__PURE__ */ e.jsx(Ye, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
1346
- /* @__PURE__ */ e.jsx(C, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1347
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1346
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1347
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1348
1348
  "Convert existing ",
1349
1349
  i.pluralLowerCase,
1350
1350
  " to quantum-owned"
@@ -1361,7 +1361,7 @@ const Mn = ({
1361
1361
  {
1362
1362
  placeholder: "Choose a group...",
1363
1363
  options: J,
1364
- value: J.find((t) => t.value === w) || null,
1364
+ value: J.find((t) => t.value === C) || null,
1365
1365
  onChange: Z,
1366
1366
  isLoading: K,
1367
1367
  isDisabled: K,
@@ -1370,17 +1370,17 @@ const Mn = ({
1370
1370
  ),
1371
1371
  j.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1372
1372
  /* @__PURE__ */ e.jsx(Je, {}),
1373
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
1373
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1374
1374
  "Failed to load groups: ",
1375
1375
  j.error.message
1376
1376
  ] })
1377
1377
  ] })
1378
1378
  ] }),
1379
- w && /* @__PURE__ */ e.jsxs(X, { children: [
1379
+ C && /* @__PURE__ */ e.jsxs(X, { children: [
1380
1380
  /* @__PURE__ */ e.jsx(he, { children: m === "convert" ? `Select ${i.plural} to Convert` : `Select ${i.plural} to Copy` }),
1381
1381
  l ? /* @__PURE__ */ e.jsxs(re, { children: [
1382
1382
  /* @__PURE__ */ e.jsx(Ct, { size: "sm" }),
1383
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1383
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1384
1384
  "Loading ",
1385
1385
  i.pluralLowerCase,
1386
1386
  "..."
@@ -1401,14 +1401,14 @@ const Mn = ({
1401
1401
  closeMenuOnSelect: !1,
1402
1402
  formatOptionLabel: (t, { context: o }) => /* @__PURE__ */ e.jsxs(re, { justify: "space-between", w: "100%", children: [
1403
1403
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1404
- /* @__PURE__ */ e.jsx(C, { children: t.label }),
1405
- o === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(C, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1404
+ /* @__PURE__ */ e.jsx(S, { children: t.label }),
1405
+ o === "value" && t.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1406
1406
  ] }),
1407
1407
  t.isQuantumOwned && o === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1408
1408
  ] })
1409
1409
  }
1410
1410
  ),
1411
- W.length === 0 && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1411
+ W.length === 0 && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1412
1412
  "No ",
1413
1413
  i.pluralLowerCase,
1414
1414
  " found in this group"
@@ -1416,7 +1416,7 @@ const Mn = ({
1416
1416
  ] }),
1417
1417
  A.error && /* @__PURE__ */ e.jsxs(He, { status: "error", mt: 2, children: [
1418
1418
  /* @__PURE__ */ e.jsx(Je, {}),
1419
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", children: [
1419
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1420
1420
  "Failed to load ",
1421
1421
  i.pluralLowerCase,
1422
1422
  ":",
@@ -1426,7 +1426,7 @@ const Mn = ({
1426
1426
  ] })
1427
1427
  ] }),
1428
1428
  R.length > 0 && /* @__PURE__ */ e.jsxs(te, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1429
- /* @__PURE__ */ e.jsx(C, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${i.singular} to ${m === "copy" ? "Copy" : "Convert"}` : `${R.length} ${i.plural} to ${m === "copy" ? "Copy" : "Convert"}` }),
1429
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: R.length === 1 ? `${i.singular} to ${m === "copy" ? "Copy" : "Convert"}` : `${R.length} ${i.plural} to ${m === "copy" ? "Copy" : "Convert"}` }),
1430
1430
  /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
1431
1431
  R.map((t, o) => /* @__PURE__ */ e.jsxs(
1432
1432
  te,
@@ -1439,7 +1439,7 @@ const Mn = ({
1439
1439
  borderColor: "gray.200",
1440
1440
  children: [
1441
1441
  /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "start", mb: 2, children: [
1442
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "medium", fontSize: "sm", children: [
1442
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
1443
1443
  o + 1,
1444
1444
  ". ",
1445
1445
  t.name
@@ -1454,17 +1454,17 @@ const Mn = ({
1454
1454
  fontSize: "sm",
1455
1455
  color: "gray.600",
1456
1456
  children: [
1457
- t.description && /* @__PURE__ */ e.jsxs(C, { children: [
1457
+ t.description && /* @__PURE__ */ e.jsxs(S, { children: [
1458
1458
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
1459
1459
  " ",
1460
1460
  t.description
1461
1461
  ] }),
1462
- /* @__PURE__ */ e.jsxs(C, { children: [
1462
+ /* @__PURE__ */ e.jsxs(S, { children: [
1463
1463
  /* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
1464
1464
  " ",
1465
1465
  t.moduleActions.length
1466
1466
  ] }),
1467
- /* @__PURE__ */ e.jsxs(C, { children: [
1467
+ /* @__PURE__ */ e.jsxs(S, { children: [
1468
1468
  /* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
1469
1469
  " ",
1470
1470
  t.categories.map((b) => b.name).join(", ") || "None"
@@ -1485,7 +1485,7 @@ const Mn = ({
1485
1485
  borderRadius: "md",
1486
1486
  border: "1px solid",
1487
1487
  borderColor: "blue.200",
1488
- children: /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1488
+ children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1489
1489
  "Total: ",
1490
1490
  R.length,
1491
1491
  " ",
@@ -1496,7 +1496,7 @@ const Mn = ({
1496
1496
  ] })
1497
1497
  }
1498
1498
  ),
1499
- u && R.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1499
+ d && R.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1500
1500
  te,
1501
1501
  {
1502
1502
  p: 2,
@@ -1504,12 +1504,12 @@ const Mn = ({
1504
1504
  borderRadius: "md",
1505
1505
  border: "1px solid",
1506
1506
  borderColor: "yellow.200",
1507
- children: /* @__PURE__ */ e.jsx(C, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: m === "convert" ? `Converting ${i.plural} will convert non QM-Owned ${g.plural} to QM-Owned ${g.plural}` : `Copying ${i.plural} with Non QM-Owned ${g.plural} will create corresponding QM-Owned ${g.plural}` })
1507
+ children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: m === "convert" ? `Converting ${i.plural} will convert non QM-Owned ${g.plural} to QM-Owned ${g.plural}` : `Copying ${i.plural} with Non QM-Owned ${g.plural} will create corresponding QM-Owned ${g.plural}` })
1508
1508
  }
1509
1509
  )
1510
1510
  ] })
1511
1511
  ] }),
1512
- !p && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1512
+ !h && /* @__PURE__ */ e.jsxs(Me, { spacing: 4, justifyContent: "flex-end", children: [
1513
1513
  /* @__PURE__ */ e.jsx(
1514
1514
  se,
1515
1515
  {
@@ -1543,54 +1543,54 @@ const Mn = ({
1543
1543
  "useUpsertModuleFormContext must be used within a UpsertModuleFormProvider"
1544
1544
  );
1545
1545
  return r;
1546
- }, Pn = ({
1546
+ }, Gn = ({
1547
1547
  name: r,
1548
1548
  setName: n,
1549
1549
  actions: a,
1550
- selectedActionIds: p,
1550
+ selectedActionIds: h,
1551
1551
  setSelectedActionIds: x,
1552
- availableCategories: d,
1553
- selectedCategoryIds: u,
1554
- setSelectedCategoryIds: h,
1552
+ availableCategories: u,
1553
+ selectedCategoryIds: d,
1554
+ setSelectedCategoryIds: p,
1555
1555
  description: s,
1556
1556
  setDescription: i,
1557
1557
  selectedMetadataIds: g,
1558
- setSelectedMetadataIds: w,
1559
- actionReportIds: S,
1558
+ setSelectedMetadataIds: C,
1559
+ actionReportIds: L,
1560
1560
  setActionReportIds: M,
1561
- ...I
1561
+ ...w
1562
1562
  }) => {
1563
1563
  const y = Wt(), c = k(() => a.map((F) => ({
1564
1564
  ...F,
1565
- selected: p.includes(F.id)
1566
- })), [a, p]), m = k(() => a.reduce((F, O) => (F[O.id] = O, F), {}), [a]), v = k(
1567
- () => p.map((F) => m[F]),
1568
- [p, m]
1569
- ), j = P(
1565
+ selected: h.includes(F.id)
1566
+ })), [a, h]), m = k(() => a.reduce((F, O) => (F[O.id] = O, F), {}), [a]), v = k(
1567
+ () => h.map((F) => m[F]),
1568
+ [h, m]
1569
+ ), j = G(
1570
1570
  (F, O) => {
1571
- x(O ? [...p, F.id] : p.filter((N) => N !== F.id));
1571
+ x(O ? [...h, F.id] : h.filter((N) => N !== F.id));
1572
1572
  },
1573
- [p, x]
1574
- ), A = P(
1573
+ [h, x]
1574
+ ), A = G(
1575
1575
  (F) => {
1576
1576
  n(F.target.value);
1577
1577
  },
1578
1578
  [n]
1579
- ), $ = P(
1579
+ ), $ = G(
1580
1580
  (F) => {
1581
1581
  i?.(F.target.value);
1582
1582
  },
1583
1583
  [i]
1584
1584
  );
1585
- return /* @__PURE__ */ e.jsxs(te, { ...I, children: [
1585
+ return /* @__PURE__ */ e.jsxs(te, { ...w, children: [
1586
1586
  /* @__PURE__ */ e.jsxs(re, { gap: "2rem", children: [
1587
1587
  /* @__PURE__ */ e.jsx(En, { name: r ?? "", onInputChange: A }),
1588
1588
  /* @__PURE__ */ e.jsx(
1589
1589
  _n,
1590
1590
  {
1591
- availableCategories: d,
1592
- value: u,
1593
- onChange: h
1591
+ availableCategories: u,
1592
+ value: d,
1593
+ onChange: p
1594
1594
  }
1595
1595
  )
1596
1596
  ] }),
@@ -1605,7 +1605,7 @@ const Mn = ({
1605
1605
  Qn,
1606
1606
  {
1607
1607
  selectedMetadataIds: g,
1608
- setSelectedMetadataIds: w
1608
+ setSelectedMetadataIds: C
1609
1609
  }
1610
1610
  ),
1611
1611
  /* @__PURE__ */ e.jsx(
@@ -1614,7 +1614,7 @@ const Mn = ({
1614
1614
  value: v,
1615
1615
  onChange: x,
1616
1616
  onAdjustActivities: () => y.onOpen(),
1617
- actionReportIds: S,
1617
+ actionReportIds: L,
1618
1618
  setActionReportIds: M
1619
1619
  }
1620
1620
  ),
@@ -1630,7 +1630,7 @@ const Mn = ({
1630
1630
  /* @__PURE__ */ e.jsx(Kt, { children: "Select Activities" }),
1631
1631
  /* @__PURE__ */ e.jsx(Yt, {}),
1632
1632
  /* @__PURE__ */ e.jsx(Ht, { children: /* @__PURE__ */ e.jsx(
1633
- Gn,
1633
+ Pn,
1634
1634
  {
1635
1635
  actions: c,
1636
1636
  onSelected: j,
@@ -1647,7 +1647,7 @@ const Mn = ({
1647
1647
  {
1648
1648
  colorScheme: "blue",
1649
1649
  onClick: y.onClose,
1650
- isDisabled: p.length === 0,
1650
+ isDisabled: h.length === 0,
1651
1651
  children: "Done"
1652
1652
  }
1653
1653
  ) })
@@ -1661,10 +1661,10 @@ const Mn = ({
1661
1661
  name: r,
1662
1662
  onInputChange: n
1663
1663
  }) => {
1664
- const { getLabel: a } = pe(), p = a("module"), { isView: x } = Fe();
1664
+ const { getLabel: a } = pe(), h = a("module"), { isView: x } = Fe();
1665
1665
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1666
1666
  /* @__PURE__ */ e.jsxs(he, { children: [
1667
- p,
1667
+ h,
1668
1668
  " Name"
1669
1669
  ] }),
1670
1670
  /* @__PURE__ */ e.jsx(
@@ -1685,16 +1685,16 @@ const Mn = ({
1685
1685
  value: n,
1686
1686
  onChange: a
1687
1687
  }) => {
1688
- const { getLabel: p } = pe(), x = p("module"), { isView: d } = Fe(), u = k(() => [
1688
+ const { getLabel: h } = pe(), x = h("module"), { isView: u } = Fe(), d = k(() => [
1689
1689
  ...r,
1690
1690
  {
1691
1691
  id: "other",
1692
1692
  name: "Other"
1693
1693
  }
1694
- ], [r]), h = k(() => u.map((s) => ({
1694
+ ], [r]), p = k(() => d.map((s) => ({
1695
1695
  value: s.id,
1696
1696
  label: s.name
1697
- })), [u]);
1697
+ })), [d]);
1698
1698
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1699
1699
  /* @__PURE__ */ e.jsxs(he, { children: [
1700
1700
  x,
@@ -1703,9 +1703,9 @@ const Mn = ({
1703
1703
  /* @__PURE__ */ e.jsx(
1704
1704
  ue,
1705
1705
  {
1706
- isDisabled: r.length === 0 || d,
1707
- options: h,
1708
- value: n.length === 0 ? { value: "other", label: "Other" } : u.filter((s) => n.includes(s.id)).map((s) => ({
1706
+ isDisabled: r.length === 0 || u,
1707
+ options: p,
1708
+ value: n.length === 0 ? { value: "other", label: "Other" } : d.filter((s) => n.includes(s.id)).map((s) => ({
1709
1709
  value: s.id,
1710
1710
  label: s.name
1711
1711
  }))[0],
@@ -1720,14 +1720,14 @@ const Mn = ({
1720
1720
  description: r,
1721
1721
  onInputChange: n
1722
1722
  }) => {
1723
- const { getLabel: a } = pe(), p = a("module"), { isView: x } = Fe();
1723
+ const { getLabel: a } = pe(), h = a("module"), { isView: x } = Fe();
1724
1724
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1725
1725
  /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1726
1726
  "Description",
1727
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", children: [
1727
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1728
1728
  "Briefly describe the objective of this",
1729
1729
  " ",
1730
- p.toLocaleLowerCase(),
1730
+ h.toLocaleLowerCase(),
1731
1731
  ". Max 40 words."
1732
1732
  ] })
1733
1733
  ] }) }),
@@ -1747,38 +1747,38 @@ const Mn = ({
1747
1747
  value: r,
1748
1748
  onChange: n,
1749
1749
  onAdjustActivities: a,
1750
- actionReportIds: p,
1750
+ actionReportIds: h,
1751
1751
  setActionReportIds: x
1752
1752
  }) => {
1753
- const { getLabel: d } = pe(), { isView: u } = Fe(), h = k(() => ({
1754
- module: d("module"),
1755
- moduleLowerCase: d("module").toLocaleLowerCase(),
1756
- action: d("action"),
1757
- actionPlural: d("action_plural"),
1758
- actionPluralLowerCase: d("action_plural").toLocaleLowerCase()
1759
- }), [d]), s = k(
1753
+ const { getLabel: u } = pe(), { isView: d } = Fe(), p = k(() => ({
1754
+ module: u("module"),
1755
+ moduleLowerCase: u("module").toLocaleLowerCase(),
1756
+ action: u("action"),
1757
+ actionPlural: u("action_plural"),
1758
+ actionPluralLowerCase: u("action_plural").toLocaleLowerCase()
1759
+ }), [u]), s = k(
1760
1760
  () => r.map((i) => ({
1761
1761
  id: i.id,
1762
1762
  name: i.name,
1763
- reports: L(Ze, i.reports) || [],
1764
- selectedReportId: p[i.id] || null
1763
+ reports: I(Ze, i.reports) || [],
1764
+ selectedReportId: h[i.id] || null
1765
1765
  })),
1766
- [r, p]
1766
+ [r, h]
1767
1767
  );
1768
1768
  return /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1769
1769
  /* @__PURE__ */ e.jsxs(re, { justifyContent: "space-between", children: [
1770
1770
  /* @__PURE__ */ e.jsx(he, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1771
- h.actionPlural,
1772
- !u && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.500", children: [
1771
+ p.actionPlural,
1772
+ !d && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.500", children: [
1773
1773
  "Drag and drop to reorder the ",
1774
- h.actionPluralLowerCase,
1774
+ p.actionPluralLowerCase,
1775
1775
  " ",
1776
1776
  "in this ",
1777
- h.moduleLowerCase,
1777
+ p.moduleLowerCase,
1778
1778
  "."
1779
1779
  ] })
1780
1780
  ] }) }),
1781
- !u && /* @__PURE__ */ e.jsxs(
1781
+ !d && /* @__PURE__ */ e.jsxs(
1782
1782
  se,
1783
1783
  {
1784
1784
  size: "sm",
@@ -1787,19 +1787,19 @@ const Mn = ({
1787
1787
  onClick: a,
1788
1788
  children: [
1789
1789
  "Add / Remove ",
1790
- h.actionPlural
1790
+ p.actionPlural
1791
1791
  ]
1792
1792
  }
1793
1793
  )
1794
1794
  ] }),
1795
- s.length === 0 ? /* @__PURE__ */ e.jsx(le, { children: /* @__PURE__ */ e.jsxs(C, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1795
+ s.length === 0 ? /* @__PURE__ */ e.jsx(le, { children: /* @__PURE__ */ e.jsxs(S, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1796
1796
  "No ",
1797
- h.actionPluralLowerCase,
1797
+ p.actionPluralLowerCase,
1798
1798
  " selected for this",
1799
1799
  " ",
1800
- h.moduleLowerCase,
1800
+ p.moduleLowerCase,
1801
1801
  ".",
1802
- !u && /* @__PURE__ */ e.jsxs(
1802
+ !d && /* @__PURE__ */ e.jsxs(
1803
1803
  se,
1804
1804
  {
1805
1805
  ml: "0.5em",
@@ -1809,7 +1809,7 @@ const Mn = ({
1809
1809
  onClick: a,
1810
1810
  children: [
1811
1811
  "Add ",
1812
- h.actionPluralLowerCase,
1812
+ p.actionPluralLowerCase,
1813
1813
  "."
1814
1814
  ]
1815
1815
  }
@@ -1820,10 +1820,10 @@ const Mn = ({
1820
1820
  value: s,
1821
1821
  onChange: (i) => {
1822
1822
  const g = i(s);
1823
- n(g.map((w) => w.id));
1823
+ n(g.map((C) => C.id));
1824
1824
  },
1825
- disabled: u,
1826
- actionReportIds: p,
1825
+ disabled: d,
1826
+ actionReportIds: h,
1827
1827
  setActionReportIds: x
1828
1828
  }
1829
1829
  )
@@ -1834,36 +1834,36 @@ const Mn = ({
1834
1834
  value: r,
1835
1835
  onChange: n,
1836
1836
  disabled: a,
1837
- actionReportIds: p,
1837
+ actionReportIds: h,
1838
1838
  setActionReportIds: x
1839
1839
  }) => {
1840
- const [d] = B(
1840
+ const [u] = B(
1841
1841
  () => Math.random().toString(36).substring(2, 15)
1842
- ), u = P(
1843
- (h, s) => {
1842
+ ), d = G(
1843
+ (p, s) => {
1844
1844
  a || n((i) => {
1845
- const g = [...i], [w] = g.splice(h, 1);
1846
- return g.splice(s, 0, w), g;
1845
+ const g = [...i], [C] = g.splice(p, 1);
1846
+ return g.splice(s, 0, C), g;
1847
1847
  });
1848
1848
  },
1849
1849
  [n, a]
1850
1850
  );
1851
- return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(bn, { backend: yn, children: /* @__PURE__ */ e.jsx(le, { spacing: 3, align: "stretch", children: r.map((h, s) => /* @__PURE__ */ e.jsx(
1851
+ return /* @__PURE__ */ e.jsx(te, { children: /* @__PURE__ */ e.jsx(bn, { backend: yn, children: /* @__PURE__ */ e.jsx(le, { spacing: 3, align: "stretch", children: r.map((p, s) => /* @__PURE__ */ e.jsx(
1852
1852
  Un,
1853
1853
  {
1854
- listKey: d,
1855
- item: h,
1854
+ listKey: u,
1855
+ item: p,
1856
1856
  index: s,
1857
1857
  disabled: !!a,
1858
- move: u,
1858
+ move: d,
1859
1859
  onReportChange: (i) => {
1860
1860
  x({
1861
- ...p,
1862
- [h.id]: i
1861
+ ...h,
1862
+ [p.id]: i
1863
1863
  });
1864
1864
  }
1865
1865
  },
1866
- h.id
1866
+ p.id
1867
1867
  )) }) }) });
1868
1868
  }
1869
1869
  ), Un = Se(
@@ -1871,59 +1871,59 @@ const Mn = ({
1871
1871
  listKey: r,
1872
1872
  item: n,
1873
1873
  index: a,
1874
- disabled: p,
1874
+ disabled: h,
1875
1875
  move: x,
1876
- onReportChange: d
1876
+ onReportChange: u
1877
1877
  }) => {
1878
- const u = sn(null), { getLabel: h } = pe(), s = h("action"), [{ handlerId: i }, g] = vn({
1878
+ const d = sn(null), { getLabel: p } = pe(), s = p("action"), [{ handlerId: i }, g] = vn({
1879
1879
  accept: r,
1880
1880
  collect: (c) => ({
1881
1881
  handlerId: c.getHandlerId()?.toString() ?? ""
1882
1882
  }),
1883
1883
  hover: (c, m) => {
1884
- if (!u.current)
1884
+ if (!d.current)
1885
1885
  return;
1886
1886
  const v = c.index, j = a;
1887
1887
  if (v === j)
1888
1888
  return;
1889
- const A = u.current?.getBoundingClientRect(), $ = (A.bottom - A.top) / 2, O = m.getClientOffset().y - A.top;
1889
+ const A = d.current?.getBoundingClientRect(), $ = (A.bottom - A.top) / 2, O = m.getClientOffset().y - A.top;
1890
1890
  v < j && O < $ || v > j && O > $ || (x(v, j), c.index = j);
1891
1891
  }
1892
- }), [{ isDragging: w }, S] = Cn({
1892
+ }), [{ isDragging: C }, L] = Cn({
1893
1893
  type: r,
1894
1894
  item: () => ({ id: n.id, index: a }),
1895
1895
  collect: (c) => ({
1896
1896
  isDragging: c.isDragging()
1897
1897
  }),
1898
- canDrag: !p
1898
+ canDrag: !h
1899
1899
  }), M = k(() => [
1900
1900
  { value: null, label: "No Report" },
1901
1901
  ...n.reports.map((c) => ({
1902
1902
  value: c.id,
1903
1903
  label: c.reportKind || "Report"
1904
1904
  }))
1905
- ], [n.reports]), I = w ? 0.6 : 1, y = p ? "default" : w ? "grabbing" : "grab";
1906
- return S(g(u)), /* @__PURE__ */ e.jsx(
1905
+ ], [n.reports]), w = C ? 0.6 : 1, y = h ? "default" : C ? "grabbing" : "grab";
1906
+ return L(g(d)), /* @__PURE__ */ e.jsx(
1907
1907
  te,
1908
1908
  {
1909
- ref: u,
1909
+ ref: d,
1910
1910
  p: 3,
1911
1911
  border: "1px solid",
1912
1912
  borderColor: "gray.200",
1913
1913
  borderRadius: "md",
1914
1914
  bg: "gray.50",
1915
- style: { opacity: I, cursor: y },
1915
+ style: { opacity: w, cursor: y },
1916
1916
  "data-handler-id": i,
1917
1917
  children: /* @__PURE__ */ e.jsxs(re, { justify: "space-between", align: "center", children: [
1918
1918
  /* @__PURE__ */ e.jsxs(re, { spacing: 3, children: [
1919
- /* @__PURE__ */ e.jsxs(C, { fontWeight: "semibold", minW: "2rem", children: [
1919
+ /* @__PURE__ */ e.jsxs(S, { fontWeight: "semibold", minW: "2rem", children: [
1920
1920
  a + 1,
1921
1921
  "."
1922
1922
  ] }),
1923
- /* @__PURE__ */ e.jsx(C, { fontWeight: "medium", children: n.name })
1923
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: n.name })
1924
1924
  ] }),
1925
1925
  /* @__PURE__ */ e.jsxs(re, { spacing: 3, align: "center", children: [
1926
- /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", children: [
1926
+ /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1927
1927
  s,
1928
1928
  " Report:"
1929
1929
  ] }),
@@ -1934,11 +1934,11 @@ const Mn = ({
1934
1934
  (c) => c.value === n.selectedReportId
1935
1935
  ),
1936
1936
  onChange: (c) => {
1937
- d(c?.value || null);
1937
+ u(c?.value || null);
1938
1938
  },
1939
1939
  options: M,
1940
1940
  placeholder: "Select report...",
1941
- isDisabled: p
1941
+ isDisabled: h
1942
1942
  }
1943
1943
  ) })
1944
1944
  ] })
@@ -1951,7 +1951,7 @@ const Mn = ({
1951
1951
  selectedMetadataIds: r,
1952
1952
  setSelectedMetadataIds: n
1953
1953
  }) => {
1954
- const { getLabel: a } = pe(), { isView: p, metadataOptions: x } = Fe(), d = k(() => [
1954
+ const { getLabel: a } = pe(), { isView: h, metadataOptions: x } = Fe(), u = k(() => [
1955
1955
  {
1956
1956
  key: "activity_type",
1957
1957
  label: `${a("action")} Type`,
@@ -1960,103 +1960,103 @@ const Mn = ({
1960
1960
  { key: "session_type", label: "Session Type", multi: !0 },
1961
1961
  { key: "body_region", label: "Body Region", multi: !0 },
1962
1962
  { key: "sport", label: "Sport", multi: !0 }
1963
- ], [a]), u = P(
1964
- (h, s) => {
1965
- const i = d.find((w) => w.key === h);
1963
+ ], [a]), d = G(
1964
+ (p, s) => {
1965
+ const i = u.find((C) => C.key === p);
1966
1966
  if (!i) return;
1967
- const g = i.multi ? (s ?? []).map((w) => w.id) : s ? [s.id] : [];
1968
- n((w) => [...w.filter((M) => Object.values(x || {}).flat().find((y) => y.id === M) && !Object.keys(x || {}).find(
1967
+ const g = i.multi ? (s ?? []).map((C) => C.id) : s ? [s.id] : [];
1968
+ n((C) => [...C.filter((M) => Object.values(x || {}).flat().find((y) => y.id === M) && !Object.keys(x || {}).find(
1969
1969
  (y) => x?.[y]?.some(
1970
- (c) => c.id === M && y === h
1970
+ (c) => c.id === M && y === p
1971
1971
  )
1972
1972
  )), ...g]);
1973
1973
  },
1974
- [d, x, n]
1974
+ [u, x, n]
1975
1975
  );
1976
1976
  return x ? /* @__PURE__ */ e.jsxs(X, { mb: 4, children: [
1977
1977
  /* @__PURE__ */ e.jsx(he, { children: "Metadata Tags" }),
1978
- /* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children: d.map((h) => /* @__PURE__ */ e.jsxs(X, { flex: "1", children: [
1979
- /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: h.label }),
1978
+ /* @__PURE__ */ e.jsx(re, { gap: "1rem", align: "start", children: u.map((p) => /* @__PURE__ */ e.jsxs(X, { flex: "1", children: [
1979
+ /* @__PURE__ */ e.jsx(Xe, { fontSize: "sm", children: p.label }),
1980
1980
  /* @__PURE__ */ e.jsx(
1981
1981
  ue,
1982
1982
  {
1983
- isMulti: h.multi,
1984
- value: x[h.key]?.filter(
1983
+ isMulti: p.multi,
1984
+ value: x[p.key]?.filter(
1985
1985
  (s) => r.includes(s.id)
1986
1986
  ),
1987
1987
  onChange: (s) => {
1988
- u(
1989
- h.key,
1988
+ d(
1989
+ p.key,
1990
1990
  s
1991
1991
  );
1992
1992
  },
1993
- options: x[h.key],
1994
- placeholder: `Select ${h.multi ? "one or more" : "one"} ${h.label.toLowerCase()}`,
1995
- isDisabled: p,
1996
- isClearable: h.multi
1993
+ options: x[p.key],
1994
+ placeholder: `Select ${p.multi ? "one or more" : "one"} ${p.label.toLowerCase()}`,
1995
+ isDisabled: h,
1996
+ isClearable: p.multi
1997
1997
  }
1998
1998
  )
1999
- ] }, h.key)) })
1999
+ ] }, p.key)) })
2000
2000
  ] }) : null;
2001
2001
  }
2002
2002
  ), qn = ({
2003
2003
  value: r,
2004
2004
  onChange: n,
2005
2005
  forceKind: a,
2006
- disableRemove: p,
2006
+ disableRemove: h,
2007
2007
  disableKind: x,
2008
- isDisabled: d,
2009
- lockRanges: u,
2010
- ...h
2008
+ isDisabled: u,
2009
+ lockRanges: d,
2010
+ ...p
2011
2011
  }) => {
2012
- const s = k(() => [...r].sort((S, M) => {
2013
- const I = xt.indexOf(S.plane), y = xt.indexOf(M.plane);
2014
- return I - y;
2015
- }), [r]), i = P((S) => "segment" in S.id ? kt(S.id.segment, S.plane, !0) ?? "Unknown" : Tt(S.id.joint, S.plane, !0) ?? "Unknown", []), g = P(
2016
- (S, M) => {
2017
- const I = s.findIndex(
2012
+ const s = k(() => [...r].sort((L, M) => {
2013
+ const w = xt.indexOf(L.plane), y = xt.indexOf(M.plane);
2014
+ return w - y;
2015
+ }), [r]), i = G((L) => "segment" in L.id ? kt(L.id.segment, L.plane, !0) ?? "Unknown" : Tt(L.id.joint, L.plane, !0) ?? "Unknown", []), g = G(
2016
+ (L, M) => {
2017
+ const w = s.findIndex(
2018
2018
  (c) => c.id === M.id && c.plane === M.plane
2019
2019
  );
2020
2020
  let y = [...s];
2021
- a && (M = { ...M, kind: a }), y[I] = M, u && (y = y.map((c) => ({
2021
+ a && (M = { ...M, kind: a }), y[w] = M, d && (y = y.map((c) => ({
2022
2022
  ...c,
2023
2023
  min: M.min,
2024
2024
  max: M.max
2025
2025
  }))), n(y);
2026
2026
  },
2027
- [n, s, a, u]
2028
- ), w = P(
2029
- (S) => {
2027
+ [n, s, a, d]
2028
+ ), C = G(
2029
+ (L) => {
2030
2030
  const M = s.filter(
2031
- (I) => I.id !== S.id || I.plane !== S.plane
2031
+ (w) => w.id !== L.id || w.plane !== L.plane
2032
2032
  );
2033
2033
  n(M);
2034
2034
  },
2035
2035
  [n, s]
2036
2036
  );
2037
- return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...h, children: s.map((S, M) => /* @__PURE__ */ e.jsx(
2037
+ return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...p, children: s.map((L, M) => /* @__PURE__ */ e.jsx(
2038
2038
  Kn,
2039
2039
  {
2040
- label: i(S),
2041
- parameter: S,
2042
- onChange: (I) => g(M, I),
2043
- onRemove: p || d ? void 0 : () => w(S),
2040
+ label: i(L),
2041
+ parameter: L,
2042
+ onChange: (w) => g(M, w),
2043
+ onRemove: h || u ? void 0 : () => C(L),
2044
2044
  forceKind: a,
2045
- disableKind: x || d,
2046
- isDisabled: d
2045
+ disableKind: x || u,
2046
+ isDisabled: u
2047
2047
  },
2048
- `${JSON.stringify(S.id)}-${S.plane}`
2048
+ `${JSON.stringify(L.id)}-${L.plane}`
2049
2049
  )) });
2050
2050
  }, Kn = ({
2051
2051
  label: r,
2052
2052
  parameter: n,
2053
2053
  onChange: a,
2054
- onRemove: p,
2054
+ onRemove: h,
2055
2055
  forceKind: x,
2056
- disableKind: d,
2057
- isDisabled: u
2056
+ disableKind: u,
2057
+ isDisabled: d
2058
2058
  }) => {
2059
- const h = P(
2059
+ const p = G(
2060
2060
  (g) => "joint" in n.id ? wn(
2061
2061
  n.id.joint,
2062
2062
  n.plane,
@@ -2081,7 +2081,7 @@ const Mn = ({
2081
2081
  children: [
2082
2082
  /* @__PURE__ */ e.jsxs(re, { w: "100%", children: [
2083
2083
  /* @__PURE__ */ e.jsx(
2084
- C,
2084
+ S,
2085
2085
  {
2086
2086
  fontSize: "sm",
2087
2087
  flex: 1,
@@ -2091,14 +2091,14 @@ const Mn = ({
2091
2091
  }
2092
2092
  ),
2093
2093
  n.sensorOnly && /* @__PURE__ */ e.jsx(wt, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" }),
2094
- p && !u && /* @__PURE__ */ e.jsx(
2094
+ h && !d && /* @__PURE__ */ e.jsx(
2095
2095
  Xt,
2096
2096
  {
2097
2097
  size: "xs",
2098
2098
  variant: "ghost",
2099
2099
  "aria-label": "delete",
2100
2100
  icon: /* @__PURE__ */ e.jsx(bt, { as: jn }),
2101
- onClick: p
2101
+ onClick: h
2102
2102
  }
2103
2103
  ),
2104
2104
  !x && /* @__PURE__ */ e.jsx(
@@ -2106,7 +2106,7 @@ const Mn = ({
2106
2106
  {
2107
2107
  selectedItem: n?.kind ?? Ke.Limit,
2108
2108
  onChange: ({ value: g }) => a({ ...n, kind: g }),
2109
- isDisabled: d || u,
2109
+ isDisabled: u || d,
2110
2110
  buttonProps: {
2111
2111
  size: "sm",
2112
2112
  variant: "outline",
@@ -2134,9 +2134,9 @@ const Mn = ({
2134
2134
  value: [n.min, n.max],
2135
2135
  onChange: (g) => a({ ...n, min: g[0], max: g[1] }),
2136
2136
  formatValue: (g) => `${Math.abs(g)}°`,
2137
- valueLabel: (g) => h(g) ?? "",
2138
- positiveNegativeLabels: h(0) ? [h(-1) ?? "", h(1) ?? ""] : void 0,
2139
- isDisabled: u
2137
+ valueLabel: (g) => p(g) ?? "",
2138
+ positiveNegativeLabels: p(0) ? [p(-1) ?? "", p(1) ?? ""] : void 0,
2139
+ isDisabled: d
2140
2140
  }
2141
2141
  )
2142
2142
  ]
@@ -2146,15 +2146,15 @@ const Mn = ({
2146
2146
  options: r,
2147
2147
  value: n,
2148
2148
  onChange: a,
2149
- forceKind: p,
2149
+ forceKind: h,
2150
2150
  singleValue: x,
2151
- singleValueSideless: d,
2152
- editOnly: u,
2153
- disableKind: h,
2151
+ singleValueSideless: u,
2152
+ editOnly: d,
2153
+ disableKind: p,
2154
2154
  maxParameters: s,
2155
2155
  ...i
2156
2156
  }) => {
2157
- const g = d ? 2 : s, w = k(() => {
2157
+ const g = u ? 2 : s, C = k(() => {
2158
2158
  const c = /* @__PURE__ */ new Map();
2159
2159
  return r.forEach((m) => {
2160
2160
  const v = "joint" in m.id;
@@ -2173,7 +2173,7 @@ const Mn = ({
2173
2173
  ].filter(Boolean).map((O) => String(O).toLowerCase().replace(/\s+|_/g, ""));
2174
2174
  $.options.push({
2175
2175
  label: /* @__PURE__ */ e.jsxs(re, { spacing: 2, justify: "space-between", w: "100%", pl: 3, children: [
2176
- /* @__PURE__ */ e.jsx(C, { children: j }),
2176
+ /* @__PURE__ */ e.jsx(S, { children: j }),
2177
2177
  m.sensorOnly && /* @__PURE__ */ e.jsx(wt, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
2178
2178
  ] }),
2179
2179
  value: m.id,
@@ -2182,32 +2182,32 @@ const Mn = ({
2182
2182
  searchTokens: F
2183
2183
  });
2184
2184
  }), Array.from(c.values());
2185
- }, [r]), S = k(() => {
2186
- if (!d || n.length === 0)
2187
- return w;
2185
+ }, [r]), L = k(() => {
2186
+ if (!u || n.length === 0)
2187
+ return C;
2188
2188
  const c = n[0];
2189
- return w.map((m) => ({
2189
+ return C.map((m) => ({
2190
2190
  ...m,
2191
2191
  options: m.options.filter(
2192
2192
  (v) => Be(v.value) === Be(c.id) && v.plane === c.plane
2193
2193
  )
2194
2194
  })).filter((m) => m.options.length > 0);
2195
- }, [w, n, d]), M = k(() => w.flatMap((m) => m.options).filter(
2195
+ }, [C, n, u]), M = k(() => C.flatMap((m) => m.options).filter(
2196
2196
  (m) => n.some((v) => Ue(v.id, m.value) && v.plane === m.plane)
2197
- ), [w, n]), I = P((c, m) => {
2197
+ ), [C, n]), w = G((c, m) => {
2198
2198
  if (!m) return !0;
2199
2199
  const v = m.toLowerCase().replace(/\s+|_/g, ""), j = c.data;
2200
2200
  return !j || !j.searchTokens ? !1 : j.searchTokens.some(
2201
2201
  (A) => A.includes(v)
2202
2202
  );
2203
- }, []), y = P(
2203
+ }, []), y = G(
2204
2204
  (c) => {
2205
2205
  const m = c.map((v) => {
2206
2206
  const j = n.find(
2207
2207
  (N) => Ue(N.id, v.value) && N.plane === v.plane
2208
2208
  ), A = r.find(
2209
2209
  (N) => Ue(N.id, v.value) && N.plane === v.plane
2210
- ), $ = d ? n.find(
2210
+ ), $ = u ? n.find(
2211
2211
  (N) => Be(N.id) === Be(v.value) && N.plane === v.plane
2212
2212
  ) : void 0, F = $ && !j ? $.min : A && A.min ? A.min : 0, O = $ && !j ? $.max : A && A.max ? A.max : 0;
2213
2213
  return j ?? {
@@ -2216,12 +2216,12 @@ const Mn = ({
2216
2216
  min: F,
2217
2217
  max: O,
2218
2218
  sensorOnly: v.sensorOnly,
2219
- kind: p ?? Ke.Limit
2219
+ kind: h ?? Ke.Limit
2220
2220
  };
2221
2221
  });
2222
2222
  a(m);
2223
2223
  },
2224
- [a, n, r, p, d]
2224
+ [a, n, r, h, u]
2225
2225
  );
2226
2226
  return ie(() => {
2227
2227
  const c = n.filter(
@@ -2235,12 +2235,12 @@ const Mn = ({
2235
2235
  isMulti: !x,
2236
2236
  placeholder: n.length ? `${n.length} selected` : "Search...",
2237
2237
  value: M,
2238
- isDisabled: u || M.length >= (g ?? 1 / 0),
2238
+ isDisabled: d || M.length >= (g ?? 1 / 0),
2239
2239
  onChange: (c) => Array.isArray(c) ? y([...c]) : y(c !== null ? [c] : []),
2240
- options: S,
2240
+ options: L,
2241
2241
  controlShouldRenderValue: !1,
2242
2242
  formatOptionLabel: (c) => c.label,
2243
- filterOption: I,
2243
+ filterOption: w,
2244
2244
  isSearchable: !0
2245
2245
  }
2246
2246
  ),
@@ -2251,10 +2251,10 @@ const Mn = ({
2251
2251
  maxH: "28rem",
2252
2252
  value: n,
2253
2253
  onChange: a,
2254
- forceKind: p,
2255
- disableKind: h,
2256
- isDisabled: u,
2257
- lockRanges: d
2254
+ forceKind: h,
2255
+ disableKind: p,
2256
+ isDisabled: d,
2257
+ lockRanges: u
2258
2258
  }
2259
2259
  )
2260
2260
  ] });
@@ -2306,33 +2306,33 @@ const Mn = ({
2306
2306
  id: r,
2307
2307
  onError: n,
2308
2308
  onCancel: a,
2309
- onSave: p,
2309
+ onSave: h,
2310
2310
  hideButtons: x,
2311
- setButtonOnClick: d,
2312
- setButtonDisabled: u,
2313
- quantumOwned: h,
2311
+ setButtonOnClick: u,
2312
+ setButtonDisabled: d,
2313
+ quantumOwned: p,
2314
2314
  isView: s
2315
2315
  }) => {
2316
- const i = rt(), [{ fetching: g }, w] = fe(st), [{ fetching: S }, M] = fe(an), [{ data: I }] = Ce({
2316
+ const i = rt(), [{ fetching: g }, C] = fe(st), [{ fetching: L }, M] = fe(an), [{ data: w }] = Ce({
2317
2317
  query: ln,
2318
2318
  variables: { id: r ?? "" },
2319
2319
  pause: !r
2320
2320
  }), y = k(() => {
2321
- const f = L(
2321
+ const f = I(
2322
2322
  ve,
2323
- I?.getActionById
2323
+ w?.getActionById
2324
2324
  );
2325
2325
  if (!f) return null;
2326
- const G = L(Ze, f.reports).map((Q) => ({
2326
+ const P = I(Ze, f.reports).map((Q) => ({
2327
2327
  ...Q,
2328
- thresholds: L(Ie, Q.thresholds)
2328
+ thresholds: I(Ie, Q.thresholds)
2329
2329
  }));
2330
2330
  return {
2331
2331
  ...f,
2332
- thresholds: L(Ie, f.thresholds),
2333
- reports: G
2332
+ thresholds: I(Ie, f.thresholds),
2333
+ reports: P
2334
2334
  };
2335
- }, [I]), c = g || S, m = !!y && !!r, { getLabel: v } = pe(), j = k(() => ({
2335
+ }, [w]), c = g || L, m = !!y && !!r, { getLabel: v } = pe(), j = k(() => ({
2336
2336
  action: v("action")
2337
2337
  }), [v]), A = k(() => [
2338
2338
  { key: "module_category", label: "Link Category", multi: !0 },
@@ -2350,41 +2350,41 @@ const Mn = ({
2350
2350
  { label: "Point of Interest", value: ae.PointOfInterest },
2351
2351
  { label: "Range", value: ae.Range },
2352
2352
  { label: "Stability Balance", value: ae.StabilityBalance }
2353
- ], z = E.map((G) => G.kind);
2353
+ ], z = E.map((P) => P.kind);
2354
2354
  return f.filter(
2355
- (G) => !z.includes(G.value)
2355
+ (P) => !z.includes(P.value)
2356
2356
  );
2357
- }, [E]), De = $.length > 0, [Ge, ot] = B({});
2357
+ }, [E]), De = $.length > 0, [Pe, ot] = B({});
2358
2358
  ie(() => {
2359
2359
  const f = A.map(
2360
2360
  (z) => i.query(nt, { key: z.key })
2361
2361
  );
2362
2362
  Promise.all(f).then((z) => {
2363
- const G = {};
2363
+ const P = {};
2364
2364
  z.forEach((Q) => {
2365
2365
  if (Q.error || !Q.data) return;
2366
- const ee = L(
2366
+ const ee = I(
2367
2367
  je,
2368
2368
  Q.data.getMetadataByKey
2369
- ), ne = L(
2369
+ ), ne = I(
2370
2370
  be,
2371
2371
  ee.data
2372
2372
  );
2373
- G[ee.key] = ne.map((me) => ({
2373
+ P[ee.key] = ne.map((me) => ({
2374
2374
  label: me.label || me.value,
2375
2375
  value: me.value,
2376
2376
  id: me.id
2377
2377
  }));
2378
- }), J(G);
2378
+ }), J(P);
2379
2379
  });
2380
2380
  }, [i, A]), ie(() => {
2381
2381
  if (y) {
2382
- const z = L(
2382
+ const z = I(
2383
2383
  je,
2384
2384
  y.metadataGroups
2385
2385
  ).map(
2386
- (ee) => ee.data.map((ne) => L(be, ne).id)
2387
- ), G = y.reports.map((ee) => ({
2386
+ (ee) => ee.data.map((ne) => I(be, ne).id)
2387
+ ), P = y.reports.map((ee) => ({
2388
2388
  id: ee.id,
2389
2389
  instructions: ee.instructions ?? "",
2390
2390
  kind: ee.reportKind,
@@ -2409,13 +2409,13 @@ const Mn = ({
2409
2409
  cameraPlacement: y.cameraPlacement || "",
2410
2410
  videoLink: y.videoLink || "",
2411
2411
  metadataIds: z.flat(),
2412
- reports: G
2412
+ reports: P
2413
2413
  };
2414
- F(Q.name), N(Q.description), oe(Q.cameraPlacement), Z(Q.videoLink), T(Q.metadataIds), D(G), ot(Q);
2414
+ F(Q.name), N(Q.description), oe(Q.cameraPlacement), Z(Q.videoLink), T(Q.metadataIds), D(P), ot(Q);
2415
2415
  }
2416
2416
  }, [y]);
2417
2417
  const Oe = k(
2418
- () => JSON.stringify(Ge) !== JSON.stringify({
2418
+ () => JSON.stringify(Pe) !== JSON.stringify({
2419
2419
  name: $,
2420
2420
  description: O,
2421
2421
  cameraPlacement: H,
@@ -2424,7 +2424,7 @@ const Mn = ({
2424
2424
  reports: E
2425
2425
  }),
2426
2426
  [
2427
- Ge,
2427
+ Pe,
2428
2428
  $,
2429
2429
  O,
2430
2430
  H,
@@ -2432,7 +2432,7 @@ const Mn = ({
2432
2432
  V,
2433
2433
  E
2434
2434
  ]
2435
- ), Ae = P(() => {
2435
+ ), Ae = G(() => {
2436
2436
  const f = {
2437
2437
  name: $,
2438
2438
  description: O,
@@ -2441,18 +2441,18 @@ const Mn = ({
2441
2441
  metadataItemIds: V,
2442
2442
  // Backend requires laterality; keep existing default since UI no longer edits it
2443
2443
  laterality: In.Either,
2444
- quantumOwned: h,
2444
+ quantumOwned: p,
2445
2445
  //Backend requires session type; keep existing default since UI no longer edits it
2446
2446
  sessionType: [],
2447
2447
  // Backend requires thresholds; use empty array since reports handle parameters now
2448
2448
  thresholds: [],
2449
2449
  // Include reports data
2450
- reports: E.map((G) => ({
2451
- id: G.isNew ? void 0 : G.id,
2452
- reportKind: G.kind,
2453
- sensorLocations: G.sensorLocations,
2454
- instructions: G.instructions,
2455
- thresholds: G.parameters.map((Q) => ({
2450
+ reports: E.map((P) => ({
2451
+ id: P.isNew ? void 0 : P.id,
2452
+ reportKind: P.kind,
2453
+ sensorLocations: P.sensorLocations,
2454
+ instructions: P.instructions,
2455
+ thresholds: P.parameters.map((Q) => ({
2456
2456
  id: Q.oldId,
2457
2457
  kind: Q.kind,
2458
2458
  min: Q.min,
@@ -2467,14 +2467,14 @@ const Mn = ({
2467
2467
  m && r ? z = M({
2468
2468
  id: r,
2469
2469
  fields: f
2470
- }) : z = w({
2470
+ }) : z = C({
2471
2471
  fields: f
2472
- }), z.then(({ error: G }) => {
2473
- G ? n(G) : p();
2472
+ }), z.then(({ error: P }) => {
2473
+ P ? n(P) : h();
2474
2474
  });
2475
2475
  }, [
2476
- h,
2477
- w,
2476
+ p,
2477
+ C,
2478
2478
  M,
2479
2479
  r,
2480
2480
  $,
@@ -2484,26 +2484,26 @@ const Mn = ({
2484
2484
  V,
2485
2485
  E,
2486
2486
  m,
2487
- p,
2487
+ h,
2488
2488
  n
2489
2489
  ]);
2490
2490
  ie(() => {
2491
- u && u({
2491
+ d && d({
2492
2492
  cancelButton: c,
2493
2493
  saveButton: s ? !0 : c || !De || !Oe
2494
2494
  });
2495
- }, [c, u, De, Oe, s]), ie(() => {
2496
- d && d({
2495
+ }, [c, d, De, Oe, s]), ie(() => {
2496
+ u && u({
2497
2497
  cancelButton: a,
2498
2498
  saveButton: s ? () => {
2499
2499
  } : Ae
2500
2500
  });
2501
- }, [d, a, Ae, s]);
2502
- const Pe = P(
2501
+ }, [u, a, Ae, s]);
2502
+ const Ge = G(
2503
2503
  (f) => {
2504
2504
  const z = gt(
2505
2505
  f.map(
2506
- (G) => "joint" in G.id ? G.id.joint : G.id.segment
2506
+ (P) => "joint" in P.id ? P.id.joint : P.id.segment
2507
2507
  )
2508
2508
  );
2509
2509
  b(z);
@@ -2511,9 +2511,9 @@ const Mn = ({
2511
2511
  []
2512
2512
  );
2513
2513
  ie(() => {
2514
- Pe(l);
2515
- }, [l, Pe]);
2516
- const ke = P(() => {
2514
+ Ge(l);
2515
+ }, [l, Ge]);
2516
+ const ke = G(() => {
2517
2517
  if (!W)
2518
2518
  return;
2519
2519
  const f = W === ae.PointOfInterest, z = {
@@ -2525,18 +2525,18 @@ const Mn = ({
2525
2525
  instructions: f ? U : "",
2526
2526
  isNew: !0
2527
2527
  };
2528
- D((G) => [...G, z]), K(null), t([]), b([]), q("");
2528
+ D((P) => [...P, z]), K(null), t([]), b([]), q("");
2529
2529
  }, [
2530
2530
  W,
2531
2531
  l,
2532
2532
  o,
2533
2533
  U
2534
- ]), xe = P((f) => {
2535
- D((z) => z.filter((G) => G.id !== f));
2534
+ ]), xe = G((f) => {
2535
+ D((z) => z.filter((P) => P.id !== f));
2536
2536
  }, []), Te = (f, z) => {
2537
- const G = A.find((ee) => ee.key === f);
2538
- if (!G) return;
2539
- const Q = G.multi ? (z ?? []).map(
2537
+ const P = A.find((ee) => ee.key === f);
2538
+ if (!P) return;
2539
+ const Q = P.multi ? (z ?? []).map(
2540
2540
  (ee) => ee.id
2541
2541
  ) : z ? [z.id] : [];
2542
2542
  T((ee) => [...ee.filter((me) => Object.values(_).flat().find((Ee) => Ee.id === me) && !Object.keys(_).find(
@@ -2642,7 +2642,7 @@ const Mn = ({
2642
2642
  /* @__PURE__ */ e.jsx(de, { children: "Add New Report" }),
2643
2643
  /* @__PURE__ */ e.jsxs(X, { children: [
2644
2644
  /* @__PURE__ */ e.jsx(de, { children: "Report Kind" }),
2645
- ye.length === 0 ? /* @__PURE__ */ e.jsx(C, { fontSize: "sm", color: "gray.500", p: 2, children: "All report kinds have been used. Remove an existing report to add a new one." }) : /* @__PURE__ */ e.jsx(
2645
+ ye.length === 0 ? /* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.500", p: 2, children: "All report kinds have been used. Remove an existing report to add a new one." }) : /* @__PURE__ */ e.jsx(
2646
2646
  ue,
2647
2647
  {
2648
2648
  value: W ? ye.find(
@@ -2708,13 +2708,13 @@ const Mn = ({
2708
2708
  ] }),
2709
2709
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2710
2710
  /* @__PURE__ */ e.jsx(de, { children: "Configured Reports" }),
2711
- E.length === 0 ? /* @__PURE__ */ e.jsx(C, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: E.map((f) => /* @__PURE__ */ e.jsxs(
2711
+ E.length === 0 ? /* @__PURE__ */ e.jsx(S, { fontSize: "sm", color: "gray.500", children: "No reports created yet" }) : /* @__PURE__ */ e.jsx("div", { className: "space-y-3", children: E.map((f) => /* @__PURE__ */ e.jsxs(
2712
2712
  "div",
2713
2713
  {
2714
2714
  className: "p-3 border border-gray-200 rounded-md bg-gray-50",
2715
2715
  children: [
2716
2716
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start mb-2", children: [
2717
- /* @__PURE__ */ e.jsx(C, { fontWeight: "semibold", children: Yn(f.kind) }),
2717
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", children: Yn(f.kind) }),
2718
2718
  !s && /* @__PURE__ */ e.jsx(
2719
2719
  se,
2720
2720
  {
@@ -2733,7 +2733,7 @@ const Mn = ({
2733
2733
  {
2734
2734
  value: f.instructions,
2735
2735
  onChange: (z) => D(
2736
- (G) => G.map(
2736
+ (P) => P.map(
2737
2737
  (Q) => Q.id === f.id ? { ...Q, instructions: z.target.value } : Q
2738
2738
  )
2739
2739
  ),
@@ -2749,9 +2749,9 @@ const Mn = ({
2749
2749
  options: Y,
2750
2750
  value: f.parameters,
2751
2751
  onChange: (z) => {
2752
- const G = z.map(
2752
+ const P = z.map(
2753
2753
  (ee) => ee.id.joint ?? ee.id.segment
2754
- ), Q = gt(G);
2754
+ ), Q = gt(P);
2755
2755
  D(
2756
2756
  (ee) => ee.map(
2757
2757
  (ne) => ne.id === f.id ? { ...ne, parameters: z, sensorLocations: Q } : ne
@@ -2761,7 +2761,7 @@ const Mn = ({
2761
2761
  editOnly: s
2762
2762
  }
2763
2763
  ),
2764
- f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(C, { fontSize: "sm", color: "gray.600", mt: 2, children: [
2764
+ f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", mt: 2, children: [
2765
2765
  "Sensors:",
2766
2766
  " ",
2767
2767
  f.sensorLocations.map(
@@ -2804,70 +2804,72 @@ const Mn = ({
2804
2804
  isView: n,
2805
2805
  metadataKeys: a
2806
2806
  }) => {
2807
- const [p, x] = B({}), d = rt();
2807
+ const [h, x] = B({}), u = rt();
2808
2808
  return ie(() => {
2809
- const u = (a ?? []).map(
2810
- (h) => d.query(nt, { key: h })
2811
- );
2812
- Promise.all(u).then((h) => {
2813
- const s = {};
2814
- h.forEach((i) => {
2815
- if (i.error || !i.data) return;
2816
- const g = L(
2809
+ let d = !1;
2810
+ return (async () => {
2811
+ const s = (a ?? []).map(
2812
+ (C) => u.query(nt, { key: C }).toPromise()
2813
+ ), i = await Promise.all(s), g = {};
2814
+ for (const C of i) {
2815
+ if (C.error || !C.data?.getMetadataByKey) continue;
2816
+ const L = I(
2817
2817
  je,
2818
- i.data.getMetadataByKey
2819
- ), w = L(
2820
- be,
2821
- g.data
2818
+ C.data.getMetadataByKey
2822
2819
  );
2823
- s[g.key] = w.map((S) => ({
2824
- label: S.label || S.value,
2825
- value: S.value,
2826
- id: S.id
2820
+ if (!L) continue;
2821
+ const M = I(be, L.data) ?? [];
2822
+ g[L.key] = M.map((w) => ({
2823
+ label: w.label || w.value,
2824
+ value: w.value,
2825
+ id: w.id
2827
2826
  }));
2828
- }), x(s);
2829
- });
2830
- }, [d, a]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: p }, children: r });
2827
+ }
2828
+ d || x(g);
2829
+ })(), () => {
2830
+ d = !0;
2831
+ };
2832
+ }, [u, a]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: h }, children: r });
2831
2833
  }, xs = ({
2832
2834
  id: r,
2833
2835
  onCancel: n,
2834
2836
  onSave: a,
2835
- onError: p,
2837
+ onError: h,
2836
2838
  hideButtons: x,
2837
- quantumOwned: d,
2838
- setButtonOnClick: u,
2839
- setButtonDisabled: h,
2839
+ quantumOwned: u,
2840
+ setButtonOnClick: d,
2841
+ setButtonDisabled: p,
2840
2842
  isView: s
2841
2843
  }) => {
2842
2844
  const [{ data: i, fetching: g }] = Ce({
2843
- query: d ? cn : dn
2844
- }), [{ data: w }] = Ce({
2845
+ query: u ? cn : dn
2846
+ }), [{ data: C }] = Ce({
2845
2847
  query: un,
2846
2848
  variables: { id: r },
2847
2849
  pause: !r
2848
- }), [{ data: S }] = Ce({
2850
+ }), [{ data: L }] = Ce({
2849
2851
  query: mn
2850
- }), M = L(
2852
+ }), M = I(
2851
2853
  $e,
2852
- S?.moduleCategories
2853
- ), [{ fetching: I }, y] = fe(Ot), [{ fetching: c }, m] = fe(Mt), v = k(() => !i || g ? [] : L(
2854
+ L?.moduleCategories
2855
+ ), [{ fetching: w }, y] = fe(Ot), [{ fetching: c }, m] = fe(Mt), v = k(() => !i || g ? [] : I(
2854
2856
  ve,
2855
- d ? i?.quantumOwnedActions ?? [] : i?.actions ?? []
2856
- ).filter((l) => !!l?.id), [i, d, g]), j = L(Qe, w?.module), A = k(() => L(At, j?.moduleActions) ?? [], [j?.moduleActions]), [$, F] = B([
2857
+ u ? i?.quantumOwnedActions ?? [] : i?.actions ?? []
2858
+ ).filter((l) => !!l?.id), [i, u, g]), j = I(Qe, C?.module), A = k(() => I(At, j?.moduleActions) ?? [], [j?.moduleActions]), [$, F] = B([
2857
2859
  ...A.map((K) => K.actionId) ?? []
2858
2860
  ]), [O, N] = B(j?.name ?? ""), [H, oe] = B([]), [R, Z] = B(j?.description ?? ""), [V, T] = B([]), [_, J] = B({});
2859
2861
  ie(() => {
2860
2862
  if (j) {
2861
2863
  F(A.map((o) => o.actionId)), N(j.name), Z(j.description ?? ""), oe(
2862
2864
  j.categories.map(
2863
- (o) => L($e, o).id
2865
+ (o) => I($e, o).id
2864
2866
  ) ?? []
2865
2867
  );
2866
- const l = L(
2868
+ const l = I(
2867
2869
  je,
2868
2870
  j.metadataGroups
2869
2871
  ).map(
2870
- (o) => o.data.map((b) => L(be, b).id)
2872
+ (o) => o.data.map((b) => I(be, b).id)
2871
2873
  );
2872
2874
  T(l.flat());
2873
2875
  const t = {};
@@ -2876,22 +2878,19 @@ const Mn = ({
2876
2878
  }), J(t);
2877
2879
  }
2878
2880
  }, [j, A]);
2879
- const W = P(() => {
2881
+ const W = G(() => {
2880
2882
  let K;
2881
- const l = Object.entries(_).map(([o, b]) => ({
2883
+ const l = Object.entries(_).filter(([, o]) => o !== null).map(([o, b]) => ({
2882
2884
  actionId: o,
2883
2885
  reportId: b
2884
- })).filter(({ reportId: o }) => o !== null), t = {
2886
+ })), t = {
2885
2887
  actions: $,
2886
2888
  name: O,
2887
2889
  categories: H.filter((o) => o !== "other"),
2888
2890
  description: R,
2889
- quantumOwned: d,
2891
+ quantumOwned: u,
2890
2892
  metadataItemIds: V,
2891
- actionReports: l.filter(({ reportId: o }) => o !== null).map(({ actionId: o, reportId: b }) => ({
2892
- actionId: o,
2893
- reportId: b
2894
- }))
2893
+ actionReports: l
2895
2894
  };
2896
2895
  j ? K = y({
2897
2896
  id: j.id,
@@ -2899,7 +2898,7 @@ const Mn = ({
2899
2898
  }) : K = m({
2900
2899
  input: t
2901
2900
  }), K.then(({ error: o }) => {
2902
- o ? p(o instanceof Error ? o : new Error(String(o))) : a();
2901
+ o ? h(o instanceof Error ? o : new Error(String(o))) : a();
2903
2902
  });
2904
2903
  }, [
2905
2904
  m,
@@ -2912,27 +2911,27 @@ const Mn = ({
2912
2911
  _,
2913
2912
  j,
2914
2913
  a,
2915
- p,
2916
- d
2914
+ h,
2915
+ u
2917
2916
  ]);
2918
2917
  return ie(() => {
2919
- h && h({
2920
- cancelButton: I || c,
2921
- saveButton: I || c || !O || R.trim().split(/\s+/).filter(Boolean).length > 40
2918
+ p && p({
2919
+ cancelButton: w || c,
2920
+ saveButton: w || c || !O || R.trim().split(/\s+/).filter(Boolean).length > 40
2922
2921
  });
2923
- }, [h, I, c, $, O, R]), ie(() => {
2924
- u && u({
2922
+ }, [p, w, c, $, O, R]), ie(() => {
2923
+ d && d({
2925
2924
  cancelButton: n,
2926
2925
  saveButton: W
2927
2926
  });
2928
- }, [u, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2927
+ }, [d, n, W]), /* @__PURE__ */ e.jsx(te, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2929
2928
  Hn,
2930
2929
  {
2931
2930
  isView: s,
2932
2931
  metadataKeys: ["activity_type", "session_type", "body_region", "sport"],
2933
2932
  children: [
2934
2933
  /* @__PURE__ */ e.jsx(
2935
- Pn,
2934
+ Gn,
2936
2935
  {
2937
2936
  name: O,
2938
2937
  setName: N,
@@ -2955,7 +2954,7 @@ const Mn = ({
2955
2954
  se,
2956
2955
  {
2957
2956
  colorScheme: "gray",
2958
- isDisabled: I || c,
2957
+ isDisabled: w || c,
2959
2958
  onClick: n,
2960
2959
  children: "Cancel"
2961
2960
  }
@@ -2964,8 +2963,8 @@ const Mn = ({
2964
2963
  se,
2965
2964
  {
2966
2965
  colorScheme: "blue",
2967
- isDisabled: I || c || !O || R.trim().split(/\s+/).filter(Boolean).length > 40,
2968
- isLoading: I || c,
2966
+ isDisabled: w || c || !O || R.trim().split(/\s+/).filter(Boolean).length > 40,
2967
+ isLoading: w || c,
2969
2968
  onClick: W,
2970
2969
  children: "Save"
2971
2970
  }
@@ -2976,10 +2975,10 @@ const Mn = ({
2976
2975
  ) });
2977
2976
  };
2978
2977
  export {
2979
- Gn as ActivityList,
2978
+ Pn as ActivityList,
2980
2979
  hs as CopyActivityForm,
2981
2980
  ps as CopyModuleForm,
2982
- Pn as ModuleForm,
2981
+ Gn as ModuleForm,
2983
2982
  qn as ParameterEditList,
2984
2983
  ft as ParameterEditSelect,
2985
2984
  gs as UpsertActivityForm,