quantum-component-library 1.4.56 → 1.4.57

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,22 +1,22 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
2
  import "./moment-vendor-DMLRxgRE.js";
3
- import { Flex as Ie, InputGroup as lt, InputLeftElement as Ft, Icon as vt, Input as ve, FormLabel as Ze, ButtonGroup as ke, Tooltip as st, Button as re, Box as ne, RangeSlider as Gt, RangeSliderMark as nt, Text as S, RangeSliderTrack as Et, RangeSliderFilledTrack as _t, RangeSliderThumb as ct, Select as dt, NumberInput as ut, NumberInputField as mt, HStack as te, Tag as De, FormControl as Y, TableContainer as zt, Table as Bt, Thead as Wt, Tr as ht, Th as $e, Tbody as Ut, Td as ze, Image as Qt, useToast as Ct, VStack as ue, RadioGroup as wt, Radio as He, Alert as Je, AlertIcon as Xe, Spinner as St, useDisclosure as qt, Modal as Kt, ModalOverlay as Yt, ModalContent as Ht, ModalHeader as Jt, ModalCloseButton as Xt, ModalBody as Zt, ModalFooter as Vt, Badge as Oe, IconButton as en, Tabs as tn, TabList as nn, Tab as pt, TabPanels as sn, TabPanel as gt, Textarea as Be } from "@chakra-ui/react";
4
- import { useMemo as k, useState as _, useEffect as le, useCallback as G, createContext as rn, useContext as on, memo as Me, useRef as an } from "react";
3
+ import { Flex as Ie, InputGroup as lt, InputLeftElement as Ft, Icon as vt, Input as ve, FormLabel as Fe, ButtonGroup as ke, Tooltip as st, Button as re, Box as se, RangeSlider as Pt, RangeSliderMark as nt, Text as S, RangeSliderTrack as Et, RangeSliderFilledTrack as _t, RangeSliderThumb as ct, Select as dt, NumberInput as ut, NumberInputField as mt, HStack as te, Tag as De, FormControl as Y, TableContainer as zt, Table as Bt, Thead as Wt, Tr as ht, Th as $e, Tbody as Ut, Td as Be, Image as Qt, useToast as Ct, VStack as ue, RadioGroup as wt, Radio as Je, Alert as Xe, AlertIcon as Ze, Spinner as St, useDisclosure as qt, Modal as Kt, ModalOverlay as Yt, ModalContent as Ht, ModalHeader as Jt, ModalCloseButton as Xt, ModalBody as Zt, ModalFooter as Vt, Badge as Oe, IconButton as en, Tabs as tn, TabList as nn, Tab as pt, TabPanels as sn, TabPanel as gt, Textarea as We, Switch as rn } from "@chakra-ui/react";
4
+ import { useMemo as k, useState as z, useEffect as ce, useCallback as E, createContext as on, useContext as an, memo as Me, useRef as ln } from "react";
5
5
  import { getFragmentData as I } from "./generated.js";
6
- import { G as rt, M as je, a as be, b as Lt, c as ln, C as ot, d as It, e as Mt, R as Ve, f as Pe, T as Ae, A as Ce, g as cn, h as Ot, U as At, i as qe, j as kt, k as dn, l as un, m as mn, n as hn, o as pn, p as gn } from "./graphql-CN-pqRpK.js";
7
- import { c as Ke } from "./utils-cn-CgdSr4hO.js";
6
+ import { G as rt, M as je, a as be, b as Lt, c as cn, C as ot, d as It, e as Mt, R as Ve, f as Ge, T as Ae, A as Ce, g as dn, h as Ot, U as At, i as Ke, j as kt, k as un, l as mn, m as hn, n as pn, o as gn, p as xn } from "./graphql-BUh1K2c5.js";
7
+ import { c as Ye } from "./utils-cn-CgdSr4hO.js";
8
8
  import "./lodash-vendor-CY4G3-79.js";
9
9
  import { useClient as at, useQuery as we, useMutation as fe } from "urql";
10
- import { useUiLabelContext as xe, useAllPartParameters as xn } from "./hooks.js";
11
- import { u as fn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
10
+ import { useUiLabelContext as xe, useAllPartParameters as fn } from "./hooks.js";
11
+ import { u as jn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
12
12
  import { s as he } from "./react-select-vendor-B0QF8gkj.js";
13
- import { F as jn, a as bn, b as yn, c as vn } from "./react-icons-vendor-CMsTQrA0.js";
13
+ import { F as bn, a as yn, b as vn, c as Cn } from "./react-icons-vendor-CMsTQrA0.js";
14
14
  import { reportKindName as Le } from "./services.js";
15
- import { D as Cn, H as wn, u as Sn, a as Ln } from "./react-dnd-vendor-DYesaYGm.js";
16
- import { g as Tt, a as Nt, b as In, c as Mn, d as On, e as xt, f as ft } from "./services-human-D5IllQkM.js";
17
- import { ThresholdKind as Ye, ReportKind as ae, ActionLaterality as An, SensorLocation as me } from "./generated-graphql.js";
18
- import { availablePlanes as jt, getAnalysisPartIdNoSide as We } from "./types.js";
19
- const kn = ({
15
+ import { D as wn, H as Sn, u as Ln, a as In } from "./react-dnd-vendor-DYesaYGm.js";
16
+ import { g as Tt, a as Nt, b as Mn, c as On, d as An, e as xt, f as ft } from "./services-human-D5IllQkM.js";
17
+ import { ThresholdKind as He, ReportKind as ae, ActionLaterality as kn, SensorLocation as me } from "./generated-graphql.js";
18
+ import { availablePlanes as jt, getAnalysisPartIdNoSide as Ue } from "./types.js";
19
+ const Tn = ({
20
20
  setSearch: r,
21
21
  actions: n,
22
22
  updateUseCases: i,
@@ -31,7 +31,7 @@ const kn = ({
31
31
  );
32
32
  return /* @__PURE__ */ e.jsxs(Ie, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
33
33
  /* @__PURE__ */ e.jsxs(lt, { size: "md", flex: 1, children: [
34
- /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsx(vt, { as: jn, color: "gray.300" }) }),
34
+ /* @__PURE__ */ e.jsx(Ft, { children: /* @__PURE__ */ e.jsx(vt, { as: bn, color: "gray.300" }) }),
35
35
  /* @__PURE__ */ e.jsx(
36
36
  ve,
37
37
  {
@@ -62,7 +62,7 @@ const kn = ({
62
62
  ] });
63
63
  }, ge = ({
64
64
  children: r
65
- }) => /* @__PURE__ */ e.jsx(Ze, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Tn = ({
65
+ }) => /* @__PURE__ */ e.jsx(Fe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Nn = ({
66
66
  items: r,
67
67
  onChange: n,
68
68
  selectedItem: i,
@@ -92,7 +92,7 @@ const kn = ({
92
92
  },
93
93
  l
94
94
  )) });
95
- }, Ue = (r, n) => n < 0 ? -1 * Math.abs(r) : Math.abs(r), Nn = ({
95
+ }, Qe = (r, n) => n < 0 ? -1 * Math.abs(r) : Math.abs(r), Rn = ({
96
96
  isReversed: r,
97
97
  min: n,
98
98
  max: i,
@@ -107,43 +107,43 @@ const kn = ({
107
107
  isDisabled: v,
108
108
  ...L
109
109
  }) => {
110
- const [M, w] = _([void 0, void 0]), y = M[0], x = M[1], a = h && n < -5 && i > 5, C = Number(m?.[0] ?? x ?? n) > 0 ? 1 : -1, j = Number(m?.[1] ?? x ?? i) < 0 ? -1 : 1, O = p?.[0] === p?.[1], R = m?.[0], $ = m?.[1];
111
- le(() => {
110
+ const [M, w] = z([void 0, void 0]), y = M[0], x = M[1], a = h && n < -5 && i > 5, C = Number(m?.[0] ?? x ?? n) > 0 ? 1 : -1, j = Number(m?.[1] ?? x ?? i) < 0 ? -1 : 1, O = p?.[0] === p?.[1], R = m?.[0], $ = m?.[1];
111
+ ce(() => {
112
112
  R !== void 0 && $ !== void 0 && w([R.toFixed(0), $.toFixed(0)]);
113
113
  }, [R, $, w]);
114
- const A = G(
115
- ([N, z]) => {
116
- N < z && w([N.toFixed(0), z.toFixed(0)]);
114
+ const A = E(
115
+ ([N, B]) => {
116
+ N < B && w([N.toFixed(0), B.toFixed(0)]);
117
117
  },
118
118
  [w]
119
- ), T = G(
120
- ([N, z]) => {
121
- N < z && g([N, z]);
119
+ ), T = E(
120
+ ([N, B]) => {
121
+ N < B && g([N, B]);
122
122
  },
123
123
  [g]
124
- ), J = G(() => {
125
- w(([N, z]) => {
126
- const X = isNaN(Number(N)) ? n : Number(N), W = isNaN(Number(z)) ? i : Number(z), H = Ue(Number(X), C), c = Ue(Number(W), j), t = C < 0 ? Math.max(H, n) : Math.min(H, i), o = j < 0 ? Math.max(c, n) : Math.min(c, i);
124
+ ), J = E(() => {
125
+ w(([N, B]) => {
126
+ const X = isNaN(Number(N)) ? n : Number(N), W = isNaN(Number(B)) ? i : Number(B), H = Qe(Number(X), C), c = Qe(Number(W), j), t = C < 0 ? Math.max(H, n) : Math.min(H, i), o = j < 0 ? Math.max(c, n) : Math.min(c, i);
127
127
  return t > o ? (g([o, t]), [o.toFixed(0), t.toFixed(0)]) : (g([t, o]), [t.toFixed(0), o.toFixed(0)]);
128
128
  });
129
- }, [g, w, C, j, n, i]), oe = G(
129
+ }, [g, w, C, j, n, i]), oe = E(
130
130
  (N) => {
131
- const z = N === "" || isNaN(Number(N)) ? N : Ue(Number(N), C);
132
- w(([X, W]) => [z.toString(), W]);
131
+ const B = N === "" || isNaN(Number(N)) ? N : Qe(Number(N), C);
132
+ w(([X, W]) => [B.toString(), W]);
133
133
  },
134
134
  [w, C]
135
- ), D = G(
135
+ ), D = E(
136
136
  (N) => {
137
- const z = N === "" || isNaN(Number(N)) ? N : Ue(Number(N), j);
138
- w(([X, W]) => [X, z.toString()]);
137
+ const B = N === "" || isNaN(Number(N)) ? N : Qe(Number(N), j);
138
+ w(([X, W]) => [X, B.toString()]);
139
139
  },
140
140
  [w, j]
141
141
  ), Z = k(
142
142
  () => d === "xs" ? "0.75rem" : void 0,
143
143
  [d]
144
- ), V = G(
145
- (N, z) => {
146
- const X = Number(z.target.value);
144
+ ), V = E(
145
+ (N, B) => {
146
+ const X = Number(B.target.value);
147
147
  if (!y || !x || ![-1, 1].includes(X))
148
148
  return;
149
149
  const W = (t) => X < 0 ? -1 * Math.abs(t) : Math.abs(t), H = N ? W(Number(y)) : Number(y), c = N ? Number(x) : W(Number(x));
@@ -152,8 +152,8 @@ const kn = ({
152
152
  [y, x, g]
153
153
  );
154
154
  return /* @__PURE__ */ e.jsxs(Ie, { direction: "column", ...L, children: [
155
- /* @__PURE__ */ e.jsx(ne, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
156
- Gt,
155
+ /* @__PURE__ */ e.jsx(se, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
156
+ Pt,
157
157
  {
158
158
  "aria-label": ["min", "max"],
159
159
  isReversed: r,
@@ -188,7 +188,7 @@ const kn = ({
188
188
  a && /* @__PURE__ */ e.jsxs(nt, { value: 0, top: "-1em", pos: "relative", children: [
189
189
  /* @__PURE__ */ e.jsx(S, { fontSize: d, fontWeight: "semibold", children: s?.(0) ?? "0" }),
190
190
  /* @__PURE__ */ e.jsx(
191
- ne,
191
+ se,
192
192
  {
193
193
  position: "absolute",
194
194
  width: "2px",
@@ -324,7 +324,7 @@ const kn = ({
324
324
  }
325
325
  )
326
326
  ] });
327
- }, Rn = ({ tags: r, containerProps: n, ...i }) => /* @__PURE__ */ e.jsx(te, { ...n, children: r.map((m, g) => /* @__PURE__ */ e.jsx(De, { ...i, children: m }, g)) }), $n = new fn({}), Dn = ({
327
+ }, $n = ({ tags: r, containerProps: n, ...i }) => /* @__PURE__ */ e.jsx(te, { ...n, children: r.map((m, g) => /* @__PURE__ */ e.jsx(De, { ...i, children: m }, g)) }), Dn = new jn({}), Gn = ({
328
328
  action: r,
329
329
  quantumIconSrc: n
330
330
  }) => {
@@ -337,7 +337,7 @@ const kn = ({
337
337
  label: `This ${m.actionLowerCase} is owned by Quantum`,
338
338
  "aria-label": "Quantum owned",
339
339
  children: /* @__PURE__ */ e.jsx(
340
- ne,
340
+ se,
341
341
  {
342
342
  boxSize: "1.5em",
343
343
  borderRadius: "full",
@@ -357,19 +357,19 @@ const kn = ({
357
357
  )
358
358
  }
359
359
  ) : null;
360
- }, Pn = (r, n) => {
360
+ }, Fn = (r, n) => {
361
361
  if (!n || !n.trim().length)
362
362
  return r;
363
363
  const i = r.map((g) => g.name ?? "");
364
- return $n.filter(i, n)?.map((g) => r[g]) ?? [];
365
- }, Fn = (r) => !r || r.length === 0 ? "None" : r.map(
364
+ return Dn.filter(i, n)?.map((g) => r[g]) ?? [];
365
+ }, Pn = (r) => !r || r.length === 0 ? "None" : r.map(
366
366
  (n) => (
367
367
  // Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
368
368
  n.replace(/([A-Z])/g, " $1").trim()
369
369
  )
370
- ).join(", "), Gn = (r, n) => !n || n.length == 0 ? r : r.filter(
370
+ ).join(", "), En = (r, n) => !n || n.length == 0 ? r : r.filter(
371
371
  (i) => i.useCases?.some((m) => n.includes(m.id)) ?? !1
372
- ), En = (r, n, i) => !n || n.length === 0 ? r : r.filter((m) => {
372
+ ), _n = (r, n, i) => !n || n.length === 0 ? r : r.filter((m) => {
373
373
  const g = {};
374
374
  return n.forEach((u) => {
375
375
  for (const [d, h] of Object.entries(i || {}))
@@ -394,7 +394,7 @@ const kn = ({
394
394
  );
395
395
  }
396
396
  );
397
- }), _n = ({
397
+ }), zn = ({
398
398
  actions: r,
399
399
  totalActions: n,
400
400
  onCreate: i,
@@ -413,7 +413,7 @@ const kn = ({
413
413
  containerProps: y,
414
414
  quantumIconSrc: x = "/favicon.ico"
415
415
  }) => {
416
- const [a, C] = _(""), [j, O] = _(), [R, $] = _([]), [A, T] = _({}), { getLabel: J } = xe(), oe = at(), D = k(() => ({
416
+ const [a, C] = z(""), [j, O] = z(), [R, $] = z([]), [A, T] = z({}), { getLabel: J } = xe(), oe = at(), D = k(() => ({
417
417
  action: J("action"),
418
418
  actionPlural: J("action_plural"),
419
419
  actionLowerCase: J("action").toLocaleLowerCase(),
@@ -425,7 +425,7 @@ const kn = ({
425
425
  { key: "body_region", label: "Body Region", multi: !0 },
426
426
  { key: "sport", label: "Sport", multi: !0 }
427
427
  ], [D.action]);
428
- le(() => {
428
+ ce(() => {
429
429
  if (!M)
430
430
  return;
431
431
  const t = Z.map(
@@ -442,10 +442,10 @@ const kn = ({
442
442
  be,
443
443
  q.data
444
444
  );
445
- b[q.key] = Q.map((E) => ({
446
- label: E.label || E.value,
447
- value: E.value,
448
- id: E.id
445
+ b[q.key] = Q.map((_) => ({
446
+ label: _.label || _.value,
447
+ value: _.value,
448
+ id: _.id
449
449
  }));
450
450
  }), T(b);
451
451
  });
@@ -453,8 +453,8 @@ const kn = ({
453
453
  const V = k(() => {
454
454
  if (!r)
455
455
  return;
456
- const t = Pn(r, a), o = L ? t : Gn(t, j);
457
- return M ? En(
456
+ const t = Fn(r, a), o = L ? t : En(t, j);
457
+ return M ? _n(
458
458
  o,
459
459
  R,
460
460
  A
@@ -467,32 +467,32 @@ const kn = ({
467
467
  M,
468
468
  R,
469
469
  A
470
- ]), N = G(() => {
470
+ ]), N = E(() => {
471
471
  if (!m)
472
472
  return;
473
473
  const o = r.filter(
474
474
  (b) => b.selected && !b.quantumOwned
475
475
  ).map((b) => b.id);
476
476
  m(o);
477
- }, [r, m]), z = G(() => {
477
+ }, [r, m]), B = E(() => {
478
478
  if (!h)
479
479
  return;
480
480
  const t = r.filter((o) => o.selected);
481
481
  h(t.map((o) => o.id)), d && t.forEach((o) => d(o, !1));
482
- }, [r, h, d]), X = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), H = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), c = G(
482
+ }, [r, h, d]), X = k(() => r.some((t) => t.selected && !t.quantumOwned), [r]), W = k(() => r.some((t) => t.selected), [r]), H = k(() => r.some((t) => t.selected && t.quantumOwned), [r]), c = E(
483
483
  (t, o) => {
484
484
  const b = Z.find((q) => q.key === t);
485
485
  if (!b) return;
486
486
  const U = b.multi ? (o ?? []).map((q) => q.id) : o ? [o.id] : [];
487
- $((q) => [...q.filter((E) => Object.values(A).flat().find((ce) => ce.id === E) && !Object.keys(A).find(
488
- (ce) => A[ce]?.some(
489
- (ye) => ye.id === E && ce === t
487
+ $((q) => [...q.filter((_) => Object.values(A).flat().find((ie) => ie.id === _) && !Object.keys(A).find(
488
+ (ie) => A[ie]?.some(
489
+ (ye) => ye.id === _ && ie === t
490
490
  )
491
491
  )), ...U]);
492
492
  },
493
493
  [Z, A]
494
494
  );
495
- return /* @__PURE__ */ e.jsxs(ne, { ...y, children: [
495
+ return /* @__PURE__ */ e.jsxs(se, { ...y, children: [
496
496
  /* @__PURE__ */ e.jsxs(Ie, { alignContent: "space-between", gap: 4, children: [
497
497
  (i || m || h) && /* @__PURE__ */ e.jsxs(ke, { mb: "1rem", gap: 4, children: [
498
498
  i && /* @__PURE__ */ e.jsxs(
@@ -529,13 +529,13 @@ const kn = ({
529
529
  {
530
530
  colorScheme: "gray",
531
531
  isDisabled: !W,
532
- onClick: z,
532
+ onClick: B,
533
533
  children: "Duplicate Selected"
534
534
  }
535
535
  )
536
536
  ] }),
537
537
  /* @__PURE__ */ e.jsx(
538
- kn,
538
+ Tn,
539
539
  {
540
540
  setSearch: C,
541
541
  actions: r,
@@ -544,8 +544,8 @@ const kn = ({
544
544
  }
545
545
  )
546
546
  ] }),
547
- M && A && /* @__PURE__ */ e.jsx(ne, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: Z.map((t) => /* @__PURE__ */ e.jsxs(Y, { children: [
548
- /* @__PURE__ */ e.jsx(Ze, { fontSize: "sm", children: t.label }),
547
+ M && A && /* @__PURE__ */ e.jsx(se, { my: 4, children: /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4", children: Z.map((t) => /* @__PURE__ */ e.jsxs(Y, { children: [
548
+ /* @__PURE__ */ e.jsx(Fe, { fontSize: "sm", children: t.label }),
549
549
  /* @__PURE__ */ e.jsx(
550
550
  he,
551
551
  {
@@ -589,7 +589,7 @@ const kn = ({
589
589
  /* @__PURE__ */ e.jsx(Ut, { children: V?.map((t) => /* @__PURE__ */ e.jsxs(
590
590
  ht,
591
591
  {
592
- className: Ke(
592
+ className: Ye(
593
593
  "hover:bg-[#f7f7f7]",
594
594
  !s && "cursor-pointer",
595
595
  t.selected && "bg-gray-200"
@@ -598,8 +598,8 @@ const kn = ({
598
598
  s || d?.(t, !t.selected);
599
599
  },
600
600
  children: [
601
- /* @__PURE__ */ e.jsx(ze, { children: /* @__PURE__ */ e.jsxs(Ie, { children: [
602
- !s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(bn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(yn, { className: "text-gray-400" }) }),
601
+ /* @__PURE__ */ e.jsx(Be, { children: /* @__PURE__ */ e.jsxs(Ie, { children: [
602
+ !s && /* @__PURE__ */ e.jsx(e.Fragment, { children: t.selected ? /* @__PURE__ */ e.jsx(yn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(vn, { className: "text-gray-400" }) }),
603
603
  (t.quantumOwned || !g) && u && /* @__PURE__ */ e.jsx(
604
604
  re,
605
605
  {
@@ -628,9 +628,9 @@ const kn = ({
628
628
  }
629
629
  )
630
630
  ] }) }),
631
- /* @__PURE__ */ e.jsx(ze, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(Ie, { align: "center", gap: 2, children: [
631
+ /* @__PURE__ */ e.jsx(Be, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(Ie, { align: "center", gap: 2, children: [
632
632
  /* @__PURE__ */ e.jsx(
633
- Dn,
633
+ Gn,
634
634
  {
635
635
  action: t,
636
636
  quantumIconSrc: x
@@ -638,9 +638,9 @@ const kn = ({
638
638
  ),
639
639
  t.name
640
640
  ] }) }),
641
- /* @__PURE__ */ e.jsx(ze, { maxW: "20rem", whiteSpace: "break-spaces", children: Fn(t.sensorLocations) }),
642
- !L && /* @__PURE__ */ e.jsx(ze, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
643
- Rn,
641
+ /* @__PURE__ */ e.jsx(Be, { maxW: "20rem", whiteSpace: "break-spaces", children: Pn(t.sensorLocations) }),
642
+ !L && /* @__PURE__ */ e.jsx(Be, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
643
+ $n,
644
644
  {
645
645
  containerProps: { flexWrap: "wrap" },
646
646
  tags: t.useCases?.map((o) => o.name) ?? []
@@ -652,7 +652,7 @@ const kn = ({
652
652
  )) })
653
653
  ] }) })
654
654
  ] });
655
- }, xs = ({
655
+ }, fs = ({
656
656
  onSave: r,
657
657
  onCancel: n,
658
658
  onError: i,
@@ -666,10 +666,10 @@ const kn = ({
666
666
  plural: s("action_plural"),
667
667
  pluralLowerCase: s("action_plural").toLowerCase(),
668
668
  singularLowerCase: s("action").toLowerCase()
669
- }), [s]), [p, v] = _("copy"), [L, M] = _(""), [w, y] = _([]), [x, a] = _(!1), [C] = we({
669
+ }), [s]), [p, v] = z("copy"), [L, M] = z(""), [w, y] = z([]), [x, a] = z(!1), [C] = we({
670
670
  query: Lt
671
671
  }), [j] = we({
672
- query: ln,
672
+ query: cn,
673
673
  variables: { groupId: L },
674
674
  pause: !L
675
675
  // Only run when group is selected
@@ -682,40 +682,40 @@ const kn = ({
682
682
  Ve,
683
683
  o.reports
684
684
  ), U = I(
685
- Pe,
685
+ Ge,
686
686
  o.categories
687
687
  ), Q = I(
688
688
  je,
689
689
  o.metadataGroups
690
- ).map((E) => ({
691
- ...E,
692
- data: E.data.map((K) => I(be, K))
690
+ ).map((_) => ({
691
+ ..._,
692
+ data: _.data.map((K) => I(be, K))
693
693
  }));
694
694
  return {
695
695
  ...o,
696
696
  thresholds: I(Ae, o.thresholds),
697
- reports: b.map((E) => ({
698
- ...E,
699
- thresholds: I(Ae, E.thresholds)
697
+ reports: b.map((_) => ({
698
+ ..._,
699
+ thresholds: I(Ae, _.thresholds)
700
700
  })),
701
701
  categories: U,
702
702
  metadataGroups: Q
703
703
  };
704
704
  }) : [], [j.data]), T = k(() => A.filter(
705
705
  (c) => w.includes(c.id)
706
- ), [A, w]), J = G(
706
+ ), [A, w]), J = E(
707
707
  (c) => {
708
708
  const t = c?.value || "";
709
709
  M(t), y([]);
710
710
  },
711
711
  []
712
- ), oe = G(
712
+ ), oe = E(
713
713
  (c) => {
714
714
  const t = c.map((o) => o.value);
715
715
  y(t);
716
716
  },
717
717
  []
718
- ), D = G(
718
+ ), D = E(
719
719
  async (c) => {
720
720
  const t = {
721
721
  ...c,
@@ -750,7 +750,7 @@ const kn = ({
750
750
  throw new Error("No action data returned");
751
751
  },
752
752
  [O, d]
753
- ), Z = G(
753
+ ), Z = E(
754
754
  async (c) => {
755
755
  const t = await R({ id: c.id });
756
756
  if (t.error)
@@ -763,7 +763,7 @@ const kn = ({
763
763
  throw new Error("No action data returned");
764
764
  },
765
765
  [R]
766
- ), V = G(async () => {
766
+ ), V = E(async () => {
767
767
  if (a(!0), !T.length) {
768
768
  const c = new Error(
769
769
  `No ${l.pluralLowerCase} selected for ${p === "copy" ? "copying" : "converting"}`
@@ -786,9 +786,9 @@ const kn = ({
786
786
  ), t++;
787
787
  }
788
788
  if (c.length > 0) {
789
- const U = c.length, q = T.length, Q = p === "copy" ? "copied" : "converted", E = p === "copy" ? "copy" : "convert";
789
+ const U = c.length, q = T.length, Q = p === "copy" ? "copied" : "converted", _ = p === "copy" ? "copy" : "convert";
790
790
  h({
791
- title: t > 0 ? `Partial ${E} completed` : `${l.plural} ${Q} successfully`,
791
+ title: t > 0 ? `Partial ${_} completed` : `${l.plural} ${Q} successfully`,
792
792
  description: t > 0 ? `${U} of ${q} ${l.pluralLowerCase} ${Q} successfully` : `${U} ${U > 1 ? l.pluralLowerCase : l.singularLowerCase} ${Q} successfully`,
793
793
  status: t > 0 ? "warning" : "success",
794
794
  duration: 3e3,
@@ -819,21 +819,21 @@ const kn = ({
819
819
  r,
820
820
  i,
821
821
  l
822
- ]), N = G(() => {
822
+ ]), N = E(() => {
823
823
  M(""), y([]), v("copy"), n?.();
824
824
  }, [n]);
825
- le(() => {
825
+ ce(() => {
826
826
  g && g({
827
827
  cancelButton: !1,
828
828
  saveButton: T.length === 0 || x
829
829
  });
830
- }, [T.length, x, g]), le(() => {
830
+ }, [T.length, x, g]), ce(() => {
831
831
  u && u({
832
832
  cancelButton: N,
833
833
  saveButton: V
834
834
  });
835
835
  }, [u, N, V]);
836
- const z = k(() => $.map((c) => ({
836
+ const B = k(() => $.map((c) => ({
837
837
  value: c.id,
838
838
  label: c.name
839
839
  })), [$]), X = k(() => A.filter((c) => p === "copy" ? !0 : !c.quantumOwned).map((c) => ({
@@ -842,7 +842,7 @@ const kn = ({
842
842
  // Add custom data to identify quantum-owned actions for UI display
843
843
  isQuantumOwned: c.quantumOwned
844
844
  })), [A, p]), W = C.fetching, H = j.fetching;
845
- return /* @__PURE__ */ e.jsx(ne, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
845
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
846
846
  d && /* @__PURE__ */ e.jsxs(Y, { children: [
847
847
  /* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
848
848
  /* @__PURE__ */ e.jsx(
@@ -853,7 +853,7 @@ const kn = ({
853
853
  v(c), y([]);
854
854
  },
855
855
  children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, children: [
856
- /* @__PURE__ */ e.jsx(He, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
856
+ /* @__PURE__ */ e.jsx(Je, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
857
857
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
858
858
  "Copy ",
859
859
  l.plural
@@ -865,7 +865,7 @@ const kn = ({
865
865
  "based on selected ones"
866
866
  ] })
867
867
  ] }) }),
868
- /* @__PURE__ */ e.jsx(He, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
868
+ /* @__PURE__ */ e.jsx(Je, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
869
869
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
870
870
  "Convert to Quantum Owned ",
871
871
  l.singular
@@ -887,16 +887,16 @@ const kn = ({
887
887
  he,
888
888
  {
889
889
  placeholder: "Choose a group...",
890
- options: z,
891
- value: z.find((c) => c.value === L) || null,
890
+ options: B,
891
+ value: B.find((c) => c.value === L) || null,
892
892
  onChange: J,
893
893
  isLoading: W,
894
894
  isDisabled: W,
895
895
  isClearable: !0
896
896
  }
897
897
  ),
898
- C.error && /* @__PURE__ */ e.jsxs(Je, { status: "error", mt: 2, children: [
899
- /* @__PURE__ */ e.jsx(Xe, {}),
898
+ C.error && /* @__PURE__ */ e.jsxs(Xe, { status: "error", mt: 2, children: [
899
+ /* @__PURE__ */ e.jsx(Ze, {}),
900
900
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
901
901
  "Failed to load groups: ",
902
902
  C.error.message
@@ -947,8 +947,8 @@ const kn = ({
947
947
  " found"
948
948
  ] })
949
949
  ] }),
950
- j.error && /* @__PURE__ */ e.jsxs(Je, { status: "error", mt: 2, children: [
951
- /* @__PURE__ */ e.jsx(Xe, {}),
950
+ j.error && /* @__PURE__ */ e.jsxs(Xe, { status: "error", mt: 2, children: [
951
+ /* @__PURE__ */ e.jsx(Ze, {}),
952
952
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
953
953
  "Failed to load ",
954
954
  l.pluralLowerCase,
@@ -958,11 +958,11 @@ const kn = ({
958
958
  ] })
959
959
  ] })
960
960
  ] }),
961
- T.length > 0 && /* @__PURE__ */ e.jsxs(ne, { p: 4, bg: "gray.50", borderRadius: "md", children: [
961
+ T.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
962
962
  /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: T.length === 1 ? `${l.singular} to ${p === "copy" ? "Copy" : "Convert"}:` : `${T.length} ${l.plural} to ${p === "copy" ? "Copy" : "Convert"}:` }),
963
963
  /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
964
964
  T.map((c, t) => /* @__PURE__ */ e.jsxs(
965
- ne,
965
+ se,
966
966
  {
967
967
  w: "100%",
968
968
  p: 3,
@@ -1025,7 +1025,7 @@ const kn = ({
1025
1025
  c.id
1026
1026
  )),
1027
1027
  T.length > 1 && /* @__PURE__ */ e.jsx(
1028
- ne,
1028
+ se,
1029
1029
  {
1030
1030
  w: "100%",
1031
1031
  p: 2,
@@ -1073,7 +1073,7 @@ const kn = ({
1073
1073
  )
1074
1074
  ] })
1075
1075
  ] }) });
1076
- }, fs = ({
1076
+ }, js = ({
1077
1077
  onSave: r,
1078
1078
  onCancel: n,
1079
1079
  onError: i,
@@ -1092,10 +1092,10 @@ const kn = ({
1092
1092
  plural: s("action_plural"),
1093
1093
  pluralLowerCase: s("action_plural").toLowerCase(),
1094
1094
  singularLowerCase: s("action").toLowerCase()
1095
- }), [s]), [v, L] = _(""), [M, w] = _([]), [y, x] = _(!1), [a, C] = _("copy"), [j] = we({
1095
+ }), [s]), [v, L] = z(""), [M, w] = z([]), [y, x] = z(!1), [a, C] = z("copy"), [j] = we({
1096
1096
  query: Lt
1097
1097
  }), [O] = we({
1098
- query: cn,
1098
+ query: dn,
1099
1099
  variables: { groupId: v },
1100
1100
  pause: !v
1101
1101
  // Only run when group is selected
@@ -1104,7 +1104,7 @@ const kn = ({
1104
1104
  ), J = k(() => j.data?.groups ? j.data.groups.map(
1105
1105
  (t) => I(Mt, t)
1106
1106
  ) : [], [j.data]), oe = k(() => O.data?.modules ? I(
1107
- qe,
1107
+ Ke,
1108
1108
  O.data?.modules
1109
1109
  ).map((o) => {
1110
1110
  const b = I(
@@ -1121,26 +1121,26 @@ const kn = ({
1121
1121
  action: I(Ce, Q.action)
1122
1122
  })),
1123
1123
  categories: I(
1124
- Pe,
1124
+ Ge,
1125
1125
  o.categories
1126
1126
  ),
1127
1127
  metadataItems: q
1128
1128
  };
1129
1129
  }) : [], [O.data]), D = k(() => oe.filter(
1130
1130
  (t) => M.includes(t.id)
1131
- ), [oe, M]), Z = G(
1131
+ ), [oe, M]), Z = E(
1132
1132
  (t) => {
1133
1133
  const o = t?.value || "";
1134
1134
  L(o), w([]);
1135
1135
  },
1136
1136
  []
1137
- ), V = G(
1137
+ ), V = E(
1138
1138
  (t) => {
1139
1139
  const o = t.map((b) => b.value);
1140
1140
  w(o);
1141
1141
  },
1142
1142
  []
1143
- ), N = G(async () => {
1143
+ ), N = E(async () => {
1144
1144
  if (x(!0), !D.length) {
1145
1145
  x(!1);
1146
1146
  const t = new Error(
@@ -1160,7 +1160,7 @@ const kn = ({
1160
1160
  if (a === "copy") {
1161
1161
  if (K.quantumOwned) return K;
1162
1162
  const ye = I(
1163
- Pe,
1163
+ Ge,
1164
1164
  K.categories
1165
1165
  ), Te = I(
1166
1166
  je,
@@ -1168,7 +1168,7 @@ const kn = ({
1168
1168
  ).map((pe) => I(
1169
1169
  be,
1170
1170
  pe.data
1171
- ).map((Re) => Re.id)).flat(), Ee = I(
1171
+ ).map((Re) => Re.id)).flat(), _e = I(
1172
1172
  Ve,
1173
1173
  K.reports
1174
1174
  ).map((pe) => ({
@@ -1192,7 +1192,7 @@ const kn = ({
1192
1192
  quantumOwned: !0,
1193
1193
  thresholds: et,
1194
1194
  categories: ye?.map((pe) => pe.id),
1195
- reports: Ee,
1195
+ reports: _e,
1196
1196
  metadataIds: Te,
1197
1197
  id: void 0
1198
1198
  }, Se = await A({ fields: Ne });
@@ -1202,12 +1202,12 @@ const kn = ({
1202
1202
  );
1203
1203
  }
1204
1204
  if (K.quantumOwned) return K;
1205
- const ce = await T({
1205
+ const ie = await T({
1206
1206
  id: K.id
1207
1207
  });
1208
- return ce.error || !ce.data?.convertActionToQuantumOwned ? null : I(
1208
+ return ie.error || !ie.data?.convertActionToQuantumOwned ? null : I(
1209
1209
  Ce,
1210
- ce.data.convertActionToQuantumOwned
1210
+ ie.data.convertActionToQuantumOwned
1211
1211
  );
1212
1212
  };
1213
1213
  U = (await Promise.all(
@@ -1219,7 +1219,7 @@ const kn = ({
1219
1219
  name: b.name,
1220
1220
  description: b.description || void 0,
1221
1221
  actions: U,
1222
- categories: b.categories.map((E) => E.id),
1222
+ categories: b.categories.map((_) => _.id),
1223
1223
  quantumOwned: !0
1224
1224
  }, Q = await $({
1225
1225
  id: b.id,
@@ -1227,32 +1227,32 @@ const kn = ({
1227
1227
  });
1228
1228
  if (Q.error) throw new Error(Q.error.message);
1229
1229
  if (Q.data?.updateModule) {
1230
- const E = I(
1231
- qe,
1230
+ const _ = I(
1231
+ Ke,
1232
1232
  Q.data.updateModule
1233
1233
  );
1234
- t.push(E);
1234
+ t.push(_);
1235
1235
  }
1236
1236
  } else {
1237
1237
  const q = {
1238
1238
  name: `${b.name} (Copy)`,
1239
1239
  description: b.description || void 0,
1240
1240
  actions: U,
1241
- categories: b.categories.map((E) => E.id),
1241
+ categories: b.categories.map((_) => _.id),
1242
1242
  quantumOwned: d,
1243
- metadataItemIds: b.metadataItems.map((E) => E.id),
1244
- actionReports: b.moduleActions.filter((E) => !!E.reportId).map((E) => ({
1245
- actionId: E.actionId,
1246
- reportId: E.reportId
1243
+ metadataItemIds: b.metadataItems.map((_) => _.id),
1244
+ actionReports: b.moduleActions.filter((_) => !!_.reportId).map((_) => ({
1245
+ actionId: _.actionId,
1246
+ reportId: _.reportId
1247
1247
  }))
1248
1248
  }, Q = await R({ input: q });
1249
1249
  if (Q.error) throw new Error(Q.error.message);
1250
1250
  if (Q.data?.createModule) {
1251
- const E = I(
1252
- qe,
1251
+ const _ = I(
1252
+ Ke,
1253
1253
  Q.data.createModule
1254
1254
  );
1255
- t.push(E);
1255
+ t.push(_);
1256
1256
  }
1257
1257
  }
1258
1258
  } catch (U) {
@@ -1298,20 +1298,20 @@ const kn = ({
1298
1298
  T,
1299
1299
  a,
1300
1300
  l
1301
- ]), z = G(() => {
1301
+ ]), B = E(() => {
1302
1302
  L(""), w([]), C("copy"), n?.();
1303
1303
  }, [n]);
1304
- le(() => {
1304
+ ce(() => {
1305
1305
  g && g({
1306
1306
  cancelButton: !1,
1307
1307
  saveButton: D.length === 0 || y
1308
1308
  });
1309
- }, [D.length, y, g]), le(() => {
1309
+ }, [D.length, y, g]), ce(() => {
1310
1310
  u && u({
1311
- cancelButton: z,
1311
+ cancelButton: B,
1312
1312
  saveButton: N
1313
1313
  });
1314
- }, [u, z, N]);
1314
+ }, [u, B, N]);
1315
1315
  const X = k(() => J.map((t) => ({
1316
1316
  value: t.id,
1317
1317
  label: t.name
@@ -1321,7 +1321,7 @@ const kn = ({
1321
1321
  // Add custom data to identify quantum-owned modules
1322
1322
  isQuantumOwned: t.quantumOwned
1323
1323
  })), [oe, a]), H = j.fetching, c = O.fetching;
1324
- return /* @__PURE__ */ e.jsx(ne, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
1324
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
1325
1325
  d && /* @__PURE__ */ e.jsxs(Y, { children: [
1326
1326
  /* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
1327
1327
  /* @__PURE__ */ e.jsx(
@@ -1332,7 +1332,7 @@ const kn = ({
1332
1332
  C(t), w([]);
1333
1333
  },
1334
1334
  children: /* @__PURE__ */ e.jsxs(te, { spacing: 6, children: [
1335
- /* @__PURE__ */ e.jsx(He, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
1335
+ /* @__PURE__ */ e.jsx(Je, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
1336
1336
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", children: [
1337
1337
  "Copy ",
1338
1338
  l.plural
@@ -1343,7 +1343,7 @@ const kn = ({
1343
1343
  " based on selected ones"
1344
1344
  ] })
1345
1345
  ] }) }),
1346
- /* @__PURE__ */ e.jsx(He, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
1346
+ /* @__PURE__ */ e.jsx(Je, { value: "convert", colorScheme: "green", children: /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 1, children: [
1347
1347
  /* @__PURE__ */ e.jsx(S, { fontWeight: "medium", children: "Convert to Quantum Owned" }),
1348
1348
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
1349
1349
  "Convert existing ",
@@ -1369,8 +1369,8 @@ const kn = ({
1369
1369
  isClearable: !0
1370
1370
  }
1371
1371
  ),
1372
- j.error && /* @__PURE__ */ e.jsxs(Je, { status: "error", mt: 2, children: [
1373
- /* @__PURE__ */ e.jsx(Xe, {}),
1372
+ j.error && /* @__PURE__ */ e.jsxs(Xe, { status: "error", mt: 2, children: [
1373
+ /* @__PURE__ */ e.jsx(Ze, {}),
1374
1374
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1375
1375
  "Failed to load groups: ",
1376
1376
  j.error.message
@@ -1415,8 +1415,8 @@ const kn = ({
1415
1415
  " found in this group"
1416
1416
  ] })
1417
1417
  ] }),
1418
- O.error && /* @__PURE__ */ e.jsxs(Je, { status: "error", mt: 2, children: [
1419
- /* @__PURE__ */ e.jsx(Xe, {}),
1418
+ O.error && /* @__PURE__ */ e.jsxs(Xe, { status: "error", mt: 2, children: [
1419
+ /* @__PURE__ */ e.jsx(Ze, {}),
1420
1420
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1421
1421
  "Failed to load ",
1422
1422
  l.pluralLowerCase,
@@ -1426,11 +1426,11 @@ const kn = ({
1426
1426
  ] })
1427
1427
  ] })
1428
1428
  ] }),
1429
- D.length > 0 && /* @__PURE__ */ e.jsxs(ne, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1429
+ D.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1430
1430
  /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `${l.singular} to ${a === "copy" ? "Copy" : "Convert"}` : `${D.length} ${l.plural} to ${a === "copy" ? "Copy" : "Convert"}` }),
1431
1431
  /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
1432
1432
  D.map((t, o) => /* @__PURE__ */ e.jsxs(
1433
- ne,
1433
+ se,
1434
1434
  {
1435
1435
  w: "100%",
1436
1436
  p: 3,
@@ -1478,7 +1478,7 @@ const kn = ({
1478
1478
  t.id
1479
1479
  )),
1480
1480
  D.length > 1 && /* @__PURE__ */ e.jsx(
1481
- ne,
1481
+ se,
1482
1482
  {
1483
1483
  w: "100%",
1484
1484
  p: 2,
@@ -1498,7 +1498,7 @@ const kn = ({
1498
1498
  }
1499
1499
  ),
1500
1500
  d && D.filter((t) => t.moduleActions.some((o) => !o.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1501
- ne,
1501
+ se,
1502
1502
  {
1503
1503
  p: 2,
1504
1504
  bg: "yellow.50",
@@ -1515,7 +1515,7 @@ const kn = ({
1515
1515
  re,
1516
1516
  {
1517
1517
  variant: "outline",
1518
- onClick: z,
1518
+ onClick: B,
1519
1519
  isDisabled: y,
1520
1520
  children: "Cancel"
1521
1521
  }
@@ -1537,14 +1537,14 @@ const kn = ({
1537
1537
  )
1538
1538
  ] })
1539
1539
  ] }) });
1540
- }, Rt = rn(void 0), Fe = () => {
1541
- const r = on(Rt);
1540
+ }, Rt = on(void 0), Pe = () => {
1541
+ const r = an(Rt);
1542
1542
  if (!r)
1543
1543
  throw new Error(
1544
1544
  "useUpsertModuleFormContext must be used within a UpsertModuleFormProvider"
1545
1545
  );
1546
1546
  return r;
1547
- }, zn = ({
1547
+ }, Bn = ({
1548
1548
  name: r,
1549
1549
  setName: n,
1550
1550
  actions: i,
@@ -1567,27 +1567,27 @@ const kn = ({
1567
1567
  })), [i, m]), a = k(() => i.reduce(($, A) => ($[A.id] = A, $), {}), [i]), C = k(
1568
1568
  () => m.map(($) => a[$]),
1569
1569
  [m, a]
1570
- ), j = G(
1570
+ ), j = E(
1571
1571
  ($, A) => {
1572
1572
  g(A ? [...m, $.id] : m.filter((T) => T !== $.id));
1573
1573
  },
1574
1574
  [m, g]
1575
- ), O = G(
1575
+ ), O = E(
1576
1576
  ($) => {
1577
1577
  n($.target.value);
1578
1578
  },
1579
1579
  [n]
1580
- ), R = G(
1580
+ ), R = E(
1581
1581
  ($) => {
1582
1582
  l?.($.target.value);
1583
1583
  },
1584
1584
  [l]
1585
1585
  );
1586
- return /* @__PURE__ */ e.jsxs(ne, { ...w, children: [
1586
+ return /* @__PURE__ */ e.jsxs(se, { ...w, children: [
1587
1587
  /* @__PURE__ */ e.jsxs(te, { gap: "2rem", children: [
1588
- /* @__PURE__ */ e.jsx(Bn, { name: r ?? "", onInputChange: O }),
1588
+ /* @__PURE__ */ e.jsx(Wn, { name: r ?? "", onInputChange: O }),
1589
1589
  /* @__PURE__ */ e.jsx(
1590
- Wn,
1590
+ Un,
1591
1591
  {
1592
1592
  availableCategories: u,
1593
1593
  value: d,
@@ -1596,21 +1596,21 @@ const kn = ({
1596
1596
  )
1597
1597
  ] }),
1598
1598
  /* @__PURE__ */ e.jsx(
1599
- Un,
1599
+ Qn,
1600
1600
  {
1601
1601
  description: s ?? "",
1602
1602
  onInputChange: R
1603
1603
  }
1604
1604
  ),
1605
1605
  /* @__PURE__ */ e.jsx(
1606
- Yn,
1606
+ Hn,
1607
1607
  {
1608
1608
  selectedMetadataIds: p,
1609
1609
  setSelectedMetadataIds: v
1610
1610
  }
1611
1611
  ),
1612
1612
  /* @__PURE__ */ e.jsx(
1613
- Qn,
1613
+ qn,
1614
1614
  {
1615
1615
  value: C,
1616
1616
  onChange: g,
@@ -1631,7 +1631,7 @@ const kn = ({
1631
1631
  /* @__PURE__ */ e.jsx(Jt, { children: "Select Activities" }),
1632
1632
  /* @__PURE__ */ e.jsx(Xt, {}),
1633
1633
  /* @__PURE__ */ e.jsx(Zt, { children: /* @__PURE__ */ e.jsx(
1634
- _n,
1634
+ zn,
1635
1635
  {
1636
1636
  actions: x,
1637
1637
  onSelected: j,
@@ -1657,12 +1657,12 @@ const kn = ({
1657
1657
  }
1658
1658
  )
1659
1659
  ] });
1660
- }, Bn = Me(
1660
+ }, Wn = Me(
1661
1661
  ({
1662
1662
  name: r,
1663
1663
  onInputChange: n
1664
1664
  }) => {
1665
- const { getLabel: i } = xe(), m = i("module"), { isView: g } = Fe();
1665
+ const { getLabel: i } = xe(), m = i("module"), { isView: g } = Pe();
1666
1666
  return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1667
1667
  /* @__PURE__ */ e.jsxs(ge, { children: [
1668
1668
  m,
@@ -1680,13 +1680,13 @@ const kn = ({
1680
1680
  )
1681
1681
  ] });
1682
1682
  }
1683
- ), Wn = Me(
1683
+ ), Un = Me(
1684
1684
  ({
1685
1685
  availableCategories: r,
1686
1686
  value: n,
1687
1687
  onChange: i
1688
1688
  }) => {
1689
- const { getLabel: m } = xe(), g = m("module"), { isView: u } = Fe(), d = k(() => [
1689
+ const { getLabel: m } = xe(), g = m("module"), { isView: u } = Pe(), d = k(() => [
1690
1690
  ...r,
1691
1691
  {
1692
1692
  id: "other",
@@ -1716,12 +1716,12 @@ const kn = ({
1716
1716
  )
1717
1717
  ] });
1718
1718
  }
1719
- ), Un = Me(
1719
+ ), Qn = Me(
1720
1720
  ({
1721
1721
  description: r,
1722
1722
  onInputChange: n
1723
1723
  }) => {
1724
- const { getLabel: i } = xe(), m = i("module"), { isView: g } = Fe();
1724
+ const { getLabel: i } = xe(), m = i("module"), { isView: g } = Pe();
1725
1725
  return /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1726
1726
  /* @__PURE__ */ e.jsx(ge, { children: /* @__PURE__ */ e.jsxs("span", { children: [
1727
1727
  "Description",
@@ -1743,7 +1743,7 @@ const kn = ({
1743
1743
  )
1744
1744
  ] });
1745
1745
  }
1746
- ), Qn = Me(
1746
+ ), qn = Me(
1747
1747
  ({
1748
1748
  value: r,
1749
1749
  onChange: n,
@@ -1751,7 +1751,7 @@ const kn = ({
1751
1751
  actionReportIds: m,
1752
1752
  setActionReportIds: g
1753
1753
  }) => {
1754
- const { getLabel: u } = xe(), { isView: d } = Fe(), h = k(() => ({
1754
+ const { getLabel: u } = xe(), { isView: d } = Pe(), h = k(() => ({
1755
1755
  module: u("module"),
1756
1756
  moduleLowerCase: u("module").toLocaleLowerCase(),
1757
1757
  action: u("action"),
@@ -1816,7 +1816,7 @@ const kn = ({
1816
1816
  }
1817
1817
  )
1818
1818
  ] }) }) : /* @__PURE__ */ e.jsx(
1819
- qn,
1819
+ Kn,
1820
1820
  {
1821
1821
  value: s,
1822
1822
  onChange: (l) => {
@@ -1830,7 +1830,7 @@ const kn = ({
1830
1830
  )
1831
1831
  ] });
1832
1832
  }
1833
- ), qn = Me(
1833
+ ), Kn = Me(
1834
1834
  ({
1835
1835
  value: r,
1836
1836
  onChange: n,
@@ -1838,9 +1838,9 @@ const kn = ({
1838
1838
  actionReportIds: m,
1839
1839
  setActionReportIds: g
1840
1840
  }) => {
1841
- const [u] = _(
1841
+ const [u] = z(
1842
1842
  () => Math.random().toString(36).substring(2, 15)
1843
- ), d = G(
1843
+ ), d = E(
1844
1844
  (h, s) => {
1845
1845
  i || n((l) => {
1846
1846
  const p = [...l], [v] = p.splice(h, 1);
@@ -1849,8 +1849,8 @@ const kn = ({
1849
1849
  },
1850
1850
  [n, i]
1851
1851
  );
1852
- return /* @__PURE__ */ e.jsx(ne, { children: /* @__PURE__ */ e.jsx(Cn, { backend: wn, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: r.map((h, s) => /* @__PURE__ */ e.jsx(
1853
- Kn,
1852
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(wn, { backend: Sn, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: r.map((h, s) => /* @__PURE__ */ e.jsx(
1853
+ Yn,
1854
1854
  {
1855
1855
  listKey: u,
1856
1856
  item: h,
@@ -1867,7 +1867,7 @@ const kn = ({
1867
1867
  h.id
1868
1868
  )) }) }) });
1869
1869
  }
1870
- ), Kn = Me(
1870
+ ), Yn = Me(
1871
1871
  ({
1872
1872
  listKey: r,
1873
1873
  item: n,
@@ -1876,7 +1876,7 @@ const kn = ({
1876
1876
  move: g,
1877
1877
  onReportChange: u
1878
1878
  }) => {
1879
- const d = an(null), { getLabel: h } = xe(), s = h("action"), [{ handlerId: l }, p] = Sn({
1879
+ const d = ln(null), { getLabel: h } = xe(), s = h("action"), [{ handlerId: l }, p] = Ln({
1880
1880
  accept: r,
1881
1881
  collect: (a) => ({
1882
1882
  handlerId: a.getHandlerId()?.toString() ?? ""
@@ -1890,7 +1890,7 @@ const kn = ({
1890
1890
  const R = d.current?.getBoundingClientRect(), $ = (R.bottom - R.top) / 2, T = C.getClientOffset().y - R.top;
1891
1891
  j < O && T < $ || j > O && T > $ || (g(j, O), a.index = O);
1892
1892
  }
1893
- }), [{ isDragging: v }, L] = Ln({
1893
+ }), [{ isDragging: v }, L] = In({
1894
1894
  type: r,
1895
1895
  item: () => ({ id: n.id, index: i }),
1896
1896
  collect: (a) => ({
@@ -1908,7 +1908,7 @@ const kn = ({
1908
1908
  })
1909
1909
  ], [n.reports]), y = v ? 0.6 : 1, x = m ? "default" : v ? "grabbing" : "grab";
1910
1910
  return L(p(d)), /* @__PURE__ */ e.jsx(
1911
- ne,
1911
+ se,
1912
1912
  {
1913
1913
  ref: d,
1914
1914
  p: 3,
@@ -1931,7 +1931,7 @@ const kn = ({
1931
1931
  s,
1932
1932
  " Report:"
1933
1933
  ] }),
1934
- /* @__PURE__ */ e.jsx(ne, { width: { base: "100%", md: "450px" }, children: /* @__PURE__ */ e.jsx(
1934
+ /* @__PURE__ */ e.jsx(se, { width: { base: "100%", md: "450px" }, children: /* @__PURE__ */ e.jsx(
1935
1935
  he,
1936
1936
  {
1937
1937
  "aria-labelledby": M,
@@ -1951,12 +1951,12 @@ const kn = ({
1951
1951
  }
1952
1952
  );
1953
1953
  }
1954
- ), Yn = Me(
1954
+ ), Hn = Me(
1955
1955
  ({
1956
1956
  selectedMetadataIds: r,
1957
1957
  setSelectedMetadataIds: n
1958
1958
  }) => {
1959
- const { getLabel: i } = xe(), { isView: m, metadataOptions: g } = Fe(), u = k(() => [
1959
+ const { getLabel: i } = xe(), { isView: m, metadataOptions: g } = Pe(), u = k(() => [
1960
1960
  {
1961
1961
  key: "activity_type",
1962
1962
  label: `${i("action")} Type`,
@@ -1965,7 +1965,7 @@ const kn = ({
1965
1965
  { key: "session_type", label: "Session Type", multi: !0 },
1966
1966
  { key: "body_region", label: "Body Region", multi: !0 },
1967
1967
  { key: "sport", label: "Sport", multi: !0 }
1968
- ], [i]), d = G(
1968
+ ], [i]), d = E(
1969
1969
  (h, s) => {
1970
1970
  const l = u.find((v) => v.key === h);
1971
1971
  if (!l) return;
@@ -1981,7 +1981,7 @@ const kn = ({
1981
1981
  return g ? /* @__PURE__ */ e.jsxs(Y, { mb: 4, children: [
1982
1982
  /* @__PURE__ */ e.jsx(ge, { children: "Metadata Tags" }),
1983
1983
  /* @__PURE__ */ e.jsx(te, { gap: "1rem", align: "start", children: u.map((h) => /* @__PURE__ */ e.jsxs(Y, { flex: "1", children: [
1984
- /* @__PURE__ */ e.jsx(Ze, { fontSize: "sm", children: h.label }),
1984
+ /* @__PURE__ */ e.jsx(Fe, { fontSize: "sm", children: h.label }),
1985
1985
  /* @__PURE__ */ e.jsx(
1986
1986
  he,
1987
1987
  {
@@ -2004,7 +2004,7 @@ const kn = ({
2004
2004
  ] }, h.key)) })
2005
2005
  ] }) : null;
2006
2006
  }
2007
- ), Hn = ({
2007
+ ), Jn = ({
2008
2008
  value: r,
2009
2009
  onChange: n,
2010
2010
  forceKind: i,
@@ -2017,7 +2017,7 @@ const kn = ({
2017
2017
  const s = k(() => [...r].sort((L, M) => {
2018
2018
  const w = jt.indexOf(L.plane), y = jt.indexOf(M.plane);
2019
2019
  return w - y;
2020
- }), [r]), l = G((L) => "segment" in L.id ? Tt(L.id.segment, L.plane, !0) ?? "Unknown" : Nt(L.id.joint, L.plane, !0) ?? "Unknown", []), p = G(
2020
+ }), [r]), l = E((L) => "segment" in L.id ? Tt(L.id.segment, L.plane, !0) ?? "Unknown" : Nt(L.id.joint, L.plane, !0) ?? "Unknown", []), p = E(
2021
2021
  (L, M) => {
2022
2022
  const w = s.findIndex(
2023
2023
  (x) => x.id === M.id && x.plane === M.plane
@@ -2030,7 +2030,7 @@ const kn = ({
2030
2030
  }))), n(y);
2031
2031
  },
2032
2032
  [n, s, i, d]
2033
- ), v = G(
2033
+ ), v = E(
2034
2034
  (L) => {
2035
2035
  const M = s.filter(
2036
2036
  (w) => w.id !== L.id || w.plane !== L.plane
@@ -2040,7 +2040,7 @@ const kn = ({
2040
2040
  [n, s]
2041
2041
  );
2042
2042
  return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...h, children: s.map((L, M) => /* @__PURE__ */ e.jsx(
2043
- Jn,
2043
+ Xn,
2044
2044
  {
2045
2045
  label: l(L),
2046
2046
  parameter: L,
@@ -2052,7 +2052,7 @@ const kn = ({
2052
2052
  },
2053
2053
  `${JSON.stringify(L.id)}-${L.plane}`
2054
2054
  )) });
2055
- }, Jn = ({
2055
+ }, Xn = ({
2056
2056
  label: r,
2057
2057
  parameter: n,
2058
2058
  onChange: i,
@@ -2061,18 +2061,18 @@ const kn = ({
2061
2061
  disableKind: u,
2062
2062
  isDisabled: d
2063
2063
  }) => {
2064
- const h = G(
2065
- (p) => "joint" in n.id ? In(
2064
+ const h = E(
2065
+ (p) => "joint" in n.id ? Mn(
2066
2066
  n.id.joint,
2067
2067
  n.plane,
2068
2068
  p < 0 ? -1 : 1
2069
- ) : Mn(
2069
+ ) : On(
2070
2070
  n.id.segment,
2071
2071
  n.plane,
2072
2072
  p < 0 ? -1 : 1
2073
2073
  ),
2074
2074
  [n]
2075
- ), { min: s, max: l } = "joint" in n.id ? On(n.id.joint, n.plane) : { min: -180, max: 180 };
2075
+ ), { min: s, max: l } = "joint" in n.id ? An(n.id.joint, n.plane) : { min: -180, max: 180 };
2076
2076
  return /* @__PURE__ */ e.jsxs(
2077
2077
  ue,
2078
2078
  {
@@ -2105,14 +2105,14 @@ const kn = ({
2105
2105
  size: "xs",
2106
2106
  variant: "ghost",
2107
2107
  "aria-label": "delete",
2108
- icon: /* @__PURE__ */ e.jsx(vt, { as: vn }),
2108
+ icon: /* @__PURE__ */ e.jsx(vt, { as: Cn }),
2109
2109
  onClick: m
2110
2110
  }
2111
2111
  ),
2112
2112
  !g && /* @__PURE__ */ e.jsx(
2113
- Tn,
2113
+ Nn,
2114
2114
  {
2115
- selectedItem: n?.kind ?? Ye.Limit,
2115
+ selectedItem: n?.kind ?? He.Limit,
2116
2116
  onChange: ({ value: p }) => i({ ...n, kind: p }),
2117
2117
  isDisabled: u || d,
2118
2118
  buttonProps: {
@@ -2125,14 +2125,14 @@ const kn = ({
2125
2125
  colorScheme: "teal"
2126
2126
  },
2127
2127
  items: [
2128
- { value: Ye.Limit, label: "limit" },
2129
- { value: Ye.Target, label: "target" }
2128
+ { value: He.Limit, label: "limit" },
2129
+ { value: He.Target, label: "target" }
2130
2130
  ]
2131
2131
  }
2132
2132
  )
2133
2133
  ] }),
2134
2134
  /* @__PURE__ */ e.jsx(
2135
- Nn,
2135
+ Rn,
2136
2136
  {
2137
2137
  w: "100%",
2138
2138
  size: "xs",
@@ -2150,7 +2150,7 @@ const kn = ({
2150
2150
  ]
2151
2151
  }
2152
2152
  );
2153
- }, Qe = (r, n) => "segment" in r && "segment" in n && r.segment === n.segment || "joint" in r && "joint" in n && r.joint === n.joint, bt = ({
2153
+ }, qe = (r, n) => "segment" in r && "segment" in n && r.segment === n.segment || "joint" in r && "joint" in n && r.joint === n.joint, bt = ({
2154
2154
  options: r,
2155
2155
  value: n,
2156
2156
  onChange: i,
@@ -2210,26 +2210,26 @@ const kn = ({
2210
2210
  return v.map((a) => ({
2211
2211
  ...a,
2212
2212
  options: a.options.filter(
2213
- (C) => We(C.value) === We(x.id) && C.plane === x.plane
2213
+ (C) => Ue(C.value) === Ue(x.id) && C.plane === x.plane
2214
2214
  )
2215
2215
  })).filter((a) => a.options.length > 0);
2216
2216
  }, [v, n, u]), M = k(() => v.flatMap((a) => a.options).filter(
2217
- (a) => n.some((C) => Qe(C.id, a.value) && C.plane === a.plane)
2218
- ), [v, n]), w = G((x, a) => {
2217
+ (a) => n.some((C) => qe(C.id, a.value) && C.plane === a.plane)
2218
+ ), [v, n]), w = E((x, a) => {
2219
2219
  if (!a) return !0;
2220
2220
  const C = a.toLowerCase().replace(/\s+|_/g, ""), j = x.data;
2221
2221
  return !j || !j.searchTokens ? !1 : j.searchTokens.some(
2222
2222
  (O) => O.includes(C)
2223
2223
  );
2224
- }, []), y = G(
2224
+ }, []), y = E(
2225
2225
  (x) => {
2226
2226
  const a = x.map((C) => {
2227
2227
  const j = n.find(
2228
- (T) => Qe(T.id, C.value) && T.plane === C.plane
2228
+ (T) => qe(T.id, C.value) && T.plane === C.plane
2229
2229
  ), O = r.find(
2230
- (T) => Qe(T.id, C.value) && T.plane === C.plane
2230
+ (T) => qe(T.id, C.value) && T.plane === C.plane
2231
2231
  ), R = u ? n.find(
2232
- (T) => We(T.id) === We(C.value) && T.plane === C.plane
2232
+ (T) => Ue(T.id) === Ue(C.value) && T.plane === C.plane
2233
2233
  ) : void 0, $ = R && !j ? R.min : O && O.min ? O.min : 0, A = R && !j ? R.max : O && O.max ? O.max : 0;
2234
2234
  return j ?? {
2235
2235
  id: C.value,
@@ -2237,19 +2237,19 @@ const kn = ({
2237
2237
  min: $,
2238
2238
  max: A,
2239
2239
  sensorOnly: C.sensorOnly,
2240
- kind: m ?? Ye.Limit
2240
+ kind: m ?? He.Limit
2241
2241
  };
2242
2242
  });
2243
2243
  i(a);
2244
2244
  },
2245
2245
  [i, n, r, m, u]
2246
2246
  );
2247
- return le(() => {
2247
+ return ce(() => {
2248
2248
  const x = n.filter(
2249
- (a) => r.some((C) => Qe(C.id, a.id) && C.plane === a.plane)
2249
+ (a) => r.some((C) => qe(C.id, a.id) && C.plane === a.plane)
2250
2250
  );
2251
2251
  x.length !== n.length && i(x);
2252
- }, [r, i, n]), /* @__PURE__ */ e.jsxs(ne, { ...l, children: [
2252
+ }, [r, i, n]), /* @__PURE__ */ e.jsxs(se, { ...l, children: [
2253
2253
  /* @__PURE__ */ e.jsx(
2254
2254
  he,
2255
2255
  {
@@ -2266,7 +2266,7 @@ const kn = ({
2266
2266
  }
2267
2267
  ),
2268
2268
  /* @__PURE__ */ e.jsx(
2269
- Hn,
2269
+ Jn,
2270
2270
  {
2271
2271
  marginTop: 2,
2272
2272
  maxH: "28rem",
@@ -2310,7 +2310,7 @@ const kn = ({
2310
2310
  case me.Head:
2311
2311
  return "Head";
2312
2312
  }
2313
- }, js = ({
2313
+ }, bs = ({
2314
2314
  id: r,
2315
2315
  onError: n,
2316
2316
  onCancel: i,
@@ -2321,8 +2321,8 @@ const kn = ({
2321
2321
  quantumOwned: h,
2322
2322
  isView: s
2323
2323
  }) => {
2324
- const l = at(), [{ fetching: p }, v] = fe(ot), [{ fetching: L }, M] = fe(dn), [{ data: w }] = we({
2325
- query: un,
2324
+ const l = at(), [{ fetching: p }, v] = fe(ot), [{ fetching: L }, M] = fe(un), [{ data: w }] = we({
2325
+ query: mn,
2326
2326
  variables: { id: r ?? "" },
2327
2327
  pause: !r
2328
2328
  }), y = k(() => {
@@ -2331,14 +2331,14 @@ const kn = ({
2331
2331
  w?.getActionById
2332
2332
  );
2333
2333
  if (!f) return null;
2334
- const P = (I(Ve, f.reports) || []).map((F) => ({
2335
- ...F,
2336
- thresholds: I(Ae, F.thresholds)
2334
+ const F = (I(Ve, f.reports) || []).map((G) => ({
2335
+ ...G,
2336
+ thresholds: I(Ae, G.thresholds)
2337
2337
  }));
2338
2338
  return {
2339
2339
  ...f,
2340
2340
  thresholds: I(Ae, f.thresholds),
2341
- reports: P
2341
+ reports: F
2342
2342
  };
2343
2343
  }, [w]), x = p || L, a = !!y && !!r, { getLabel: C } = xe(), j = k(() => ({
2344
2344
  action: C("action")
@@ -2353,7 +2353,7 @@ const kn = ({
2353
2353
  label: "Activity Motion Direction",
2354
2354
  multi: !0
2355
2355
  }
2356
- ], [j.action]), [R, $] = _(""), [A, T] = _(""), [J, oe] = _(""), [D, Z] = _(""), [V, N] = _([]), [z, X] = _({}), [W, H] = _(null), [c, t] = _(""), [o, b] = _([]), [U, q] = _([]), [Q, E] = _(""), [K, ce] = _([]), ye = xn(), it = k(() => ye.filter((f) => f.sensorOnly), [ye]), Te = [
2356
+ ], [j.action]), [R, $] = z(""), [A, T] = z(""), [J, oe] = z(""), [D, Z] = z(""), [V, N] = z([]), [B, X] = z({}), [W, H] = z(null), [c, t] = z(""), [o, b] = z([]), [U, q] = z([]), [Q, _] = z(""), [K, ie] = z([]), ye = fn(), it = k(() => ye.filter((f) => f.sensorOnly), [ye]), Te = [
2357
2357
  {
2358
2358
  label: Le(ae.GeneralActivity),
2359
2359
  value: ae.GeneralActivity
@@ -2371,42 +2371,43 @@ const kn = ({
2371
2371
  label: Le(ae.PointOfInterest),
2372
2372
  value: ae.PointOfInterest
2373
2373
  }
2374
- ], Ge = k(() => R.trim().length > 0, [R]), [Ee, et] = _({});
2375
- le(() => {
2374
+ ], Ee = k(() => R.trim().length > 0, [R]), [_e, et] = z({});
2375
+ ce(() => {
2376
2376
  const f = O.map(
2377
- (B) => l.query(rt, { key: B.key })
2377
+ (P) => l.query(rt, { key: P.key })
2378
2378
  );
2379
- Promise.all(f).then((B) => {
2380
- const P = {};
2381
- B.forEach((F) => {
2382
- if (F.error || !F.data) return;
2383
- const se = I(
2379
+ Promise.all(f).then((P) => {
2380
+ const F = {};
2381
+ P.forEach((G) => {
2382
+ if (G.error || !G.data) return;
2383
+ const ne = I(
2384
2384
  je,
2385
- F.data.getMetadataByKey
2385
+ G.data.getMetadataByKey
2386
2386
  ), ee = I(
2387
2387
  be,
2388
- se.data
2388
+ ne.data
2389
2389
  );
2390
- P[se.key] = ee.map((de) => ({
2390
+ F[ne.key] = ee.map((de) => ({
2391
2391
  label: de.label || de.value,
2392
2392
  value: de.value,
2393
2393
  id: de.id
2394
2394
  }));
2395
- }), X(P);
2395
+ }), X(F);
2396
2396
  });
2397
- }, [l, O]), le(() => {
2397
+ }, [l, O]), ce(() => {
2398
2398
  if (y) {
2399
- const B = I(
2399
+ const P = I(
2400
2400
  je,
2401
2401
  y.metadataGroups
2402
2402
  ).map(
2403
- (se) => se.data.map((ee) => I(be, ee).id)
2404
- ), P = y.reports.map((se) => ({
2405
- id: se.id,
2406
- name: se.name ?? "",
2407
- instructions: se.instructions ?? "",
2408
- kind: se.reportKind,
2409
- parameters: se.thresholds.map((ee) => ({
2403
+ (ne) => ne.data.map((ee) => I(be, ee).id)
2404
+ ), F = y.reports.map((ne) => ({
2405
+ id: ne.id,
2406
+ name: ne.name ?? "",
2407
+ instructions: ne.instructions ?? "",
2408
+ kind: ne.reportKind,
2409
+ autoGenerate: ne.autoGenerate ?? !1,
2410
+ parameters: ne.thresholds.map((ee) => ({
2410
2411
  id: {
2411
2412
  [ee.partKind]: ee.partId
2412
2413
  },
@@ -2420,20 +2421,20 @@ const kn = ({
2420
2421
  return tt ? tt === ee.partId && de.plane === ee.partDimension : !1;
2421
2422
  })
2422
2423
  })),
2423
- sensorLocations: se.sensorLocations
2424
- })), F = {
2424
+ sensorLocations: ne.sensorLocations
2425
+ })), G = {
2425
2426
  name: y.name,
2426
2427
  description: y.description || "",
2427
2428
  cameraPlacement: y.cameraPlacement || "",
2428
2429
  videoLink: y.videoLink || "",
2429
- metadataIds: B.flat(),
2430
- reports: P
2430
+ metadataIds: P.flat(),
2431
+ reports: F
2431
2432
  };
2432
- $(F.name), T(F.description), oe(F.cameraPlacement), Z(F.videoLink), N(F.metadataIds), ce(P), et(F);
2433
+ $(G.name), T(G.description), oe(G.cameraPlacement), Z(G.videoLink), N(G.metadataIds), ie(F), et(G);
2433
2434
  }
2434
2435
  }, [y]);
2435
2436
  const Ne = k(
2436
- () => JSON.stringify(Ee) !== JSON.stringify({
2437
+ () => JSON.stringify(_e) !== JSON.stringify({
2437
2438
  name: R,
2438
2439
  description: A,
2439
2440
  cameraPlacement: J,
@@ -2442,7 +2443,7 @@ const kn = ({
2442
2443
  reports: K
2443
2444
  }),
2444
2445
  [
2445
- Ee,
2446
+ _e,
2446
2447
  R,
2447
2448
  A,
2448
2449
  J,
@@ -2450,7 +2451,7 @@ const kn = ({
2450
2451
  V,
2451
2452
  K
2452
2453
  ]
2453
- ), Se = G(() => {
2454
+ ), Se = E(() => {
2454
2455
  const f = {
2455
2456
  name: R,
2456
2457
  description: A,
@@ -2458,38 +2459,39 @@ const kn = ({
2458
2459
  videoLink: D,
2459
2460
  metadataItemIds: V,
2460
2461
  // Backend requires laterality; keep existing default since UI no longer edits it
2461
- laterality: An.Either,
2462
+ laterality: kn.Either,
2462
2463
  quantumOwned: h,
2463
2464
  //Backend requires session type; keep existing default since UI no longer edits it
2464
2465
  sessionType: [],
2465
2466
  // Backend requires thresholds; use empty array since reports handle parameters now
2466
2467
  thresholds: [],
2467
2468
  // Include reports data
2468
- reports: K.map((P) => ({
2469
- id: P.isNew ? void 0 : P.id,
2470
- name: P.name,
2471
- reportKind: P.kind,
2472
- sensorLocations: P.sensorLocations,
2473
- instructions: P.instructions,
2474
- thresholds: P.parameters.map((F) => ({
2475
- id: F.oldId,
2476
- kind: F.kind,
2477
- min: F.min,
2478
- max: F.max,
2479
- partKind: "joint" in F.id ? "joint" : "segment",
2480
- partId: "joint" in F.id ? F.id.joint : F.id.segment,
2481
- partDimension: F.plane
2469
+ reports: K.map((F) => ({
2470
+ id: F.isNew ? void 0 : F.id,
2471
+ name: F.name,
2472
+ reportKind: F.kind,
2473
+ sensorLocations: F.sensorLocations,
2474
+ instructions: F.instructions,
2475
+ autoGenerate: F.autoGenerate ?? !1,
2476
+ thresholds: F.parameters.map((G) => ({
2477
+ id: G.oldId,
2478
+ kind: G.kind,
2479
+ min: G.min,
2480
+ max: G.max,
2481
+ partKind: "joint" in G.id ? "joint" : "segment",
2482
+ partId: "joint" in G.id ? G.id.joint : G.id.segment,
2483
+ partDimension: G.plane
2482
2484
  }))
2483
2485
  }))
2484
2486
  };
2485
- let B;
2486
- a && r ? B = M({
2487
+ let P;
2488
+ a && r ? P = M({
2487
2489
  id: r,
2488
2490
  fields: f
2489
- }) : B = v({
2491
+ }) : P = v({
2490
2492
  fields: f
2491
- }), B.then(({ error: P }) => {
2492
- P ? n(P) : m();
2493
+ }), P.then(({ error: F }) => {
2494
+ F ? n(F) : m();
2493
2495
  });
2494
2496
  }, [
2495
2497
  h,
@@ -2506,36 +2508,36 @@ const kn = ({
2506
2508
  m,
2507
2509
  n
2508
2510
  ]);
2509
- le(() => {
2511
+ ce(() => {
2510
2512
  d && d({
2511
2513
  cancelButton: x,
2512
- saveButton: s ? !0 : x || !Ge || !Ne
2514
+ saveButton: s ? !0 : x || !Ee || !Ne
2513
2515
  });
2514
- }, [x, d, Ge, Ne, s]), le(() => {
2516
+ }, [x, d, Ee, Ne, s]), ce(() => {
2515
2517
  u && u({
2516
2518
  cancelButton: i,
2517
2519
  saveButton: s ? () => {
2518
2520
  } : Se
2519
2521
  });
2520
2522
  }, [u, i, Se, s]);
2521
- const pe = G(
2523
+ const pe = E(
2522
2524
  (f) => {
2523
- const B = ft(
2525
+ const P = ft(
2524
2526
  f.map(
2525
- (P) => "joint" in P.id ? P.id.joint : P.id.segment
2527
+ (F) => "joint" in F.id ? F.id.joint : F.id.segment
2526
2528
  )
2527
2529
  );
2528
- q(B);
2530
+ q(P);
2529
2531
  },
2530
2532
  []
2531
2533
  );
2532
- le(() => {
2534
+ ce(() => {
2533
2535
  pe(o);
2534
2536
  }, [o, pe]);
2535
- const Re = G(() => {
2537
+ const Re = E(() => {
2536
2538
  if (!W || !c.trim())
2537
2539
  return;
2538
- const f = W === ae.PointOfInterest, B = {
2540
+ const f = W === ae.PointOfInterest, P = {
2539
2541
  id: Date.now().toString(),
2540
2542
  // Temporary ID
2541
2543
  name: c.trim(),
@@ -2543,28 +2545,29 @@ const kn = ({
2543
2545
  parameters: f ? [] : o,
2544
2546
  sensorLocations: f ? [] : U,
2545
2547
  instructions: f ? Q : "",
2548
+ autoGenerate: !1,
2546
2549
  isNew: !0
2547
2550
  };
2548
- ce((P) => [...P, B]), H(null), t(""), b([]), q([]), E("");
2551
+ ie((F) => [...F, P]), H(null), t(""), b([]), q([]), _("");
2549
2552
  }, [
2550
2553
  W,
2551
2554
  c,
2552
2555
  o,
2553
2556
  U,
2554
2557
  Q
2555
- ]), $t = G((f) => {
2556
- ce((B) => B.filter((P) => P.id !== f));
2557
- }, []), Dt = (f, B) => {
2558
- const P = O.find((se) => se.key === f);
2559
- if (!P) return;
2560
- const F = P.multi ? (B ?? []).map(
2561
- (se) => se.id
2562
- ) : B ? [B.id] : [];
2563
- N((se) => [...se.filter((de) => Object.values(z).flat().find((_e) => _e.id === de) && !Object.keys(z).find(
2564
- (_e) => z[_e]?.some(
2565
- (Pt) => Pt.id === de && _e === f
2558
+ ]), $t = E((f) => {
2559
+ ie((P) => P.filter((F) => F.id !== f));
2560
+ }, []), Dt = (f, P) => {
2561
+ const F = O.find((ne) => ne.key === f);
2562
+ if (!F) return;
2563
+ const G = F.multi ? (P ?? []).map(
2564
+ (ne) => ne.id
2565
+ ) : P ? [P.id] : [];
2566
+ N((ne) => [...ne.filter((de) => Object.values(B).flat().find((ze) => ze.id === de) && !Object.keys(B).find(
2567
+ (ze) => B[ze]?.some(
2568
+ (Gt) => Gt.id === de && ze === f
2566
2569
  )
2567
- )), ...F]);
2570
+ )), ...G]);
2568
2571
  };
2569
2572
  return /* @__PURE__ */ e.jsxs(ue, { spacing: 4, w: "full", align: "stretch", children: [
2570
2573
  /* @__PURE__ */ e.jsxs(tn, { children: [
@@ -2576,7 +2579,7 @@ const kn = ({
2576
2579
  /* @__PURE__ */ e.jsx(gt, { px: 0, children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
2577
2580
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2578
2581
  /* @__PURE__ */ e.jsxs(Y, { children: [
2579
- /* @__PURE__ */ e.jsx(ie, { children: "Name" }),
2582
+ /* @__PURE__ */ e.jsx(le, { children: "Name" }),
2580
2583
  /* @__PURE__ */ e.jsx(
2581
2584
  ve,
2582
2585
  {
@@ -2589,9 +2592,9 @@ const kn = ({
2589
2592
  )
2590
2593
  ] }),
2591
2594
  /* @__PURE__ */ e.jsxs(Y, { children: [
2592
- /* @__PURE__ */ e.jsx(ie, { children: "Camera Placement" }),
2595
+ /* @__PURE__ */ e.jsx(le, { children: "Camera Placement" }),
2593
2596
  /* @__PURE__ */ e.jsx(
2594
- Be,
2597
+ We,
2595
2598
  {
2596
2599
  value: J,
2597
2600
  onChange: (f) => oe(f.target.value),
@@ -2602,7 +2605,7 @@ const kn = ({
2602
2605
  )
2603
2606
  ] }),
2604
2607
  /* @__PURE__ */ e.jsxs(Y, { children: [
2605
- /* @__PURE__ */ e.jsx(ie, { children: "Video Link" }),
2608
+ /* @__PURE__ */ e.jsx(le, { children: "Video Link" }),
2606
2609
  /* @__PURE__ */ e.jsx(
2607
2610
  ve,
2608
2611
  {
@@ -2615,9 +2618,9 @@ const kn = ({
2615
2618
  )
2616
2619
  ] }),
2617
2620
  /* @__PURE__ */ e.jsxs(Y, { children: [
2618
- /* @__PURE__ */ e.jsx(ie, { children: "Description" }),
2621
+ /* @__PURE__ */ e.jsx(le, { children: "Description" }),
2619
2622
  /* @__PURE__ */ e.jsx(
2620
- Be,
2623
+ We,
2621
2624
  {
2622
2625
  value: A,
2623
2626
  onChange: (f) => T(f.target.value),
@@ -2629,20 +2632,20 @@ const kn = ({
2629
2632
  ] })
2630
2633
  ] }),
2631
2634
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2632
- /* @__PURE__ */ e.jsx(ie, { children: "Metadata Tags" }),
2635
+ /* @__PURE__ */ e.jsx(le, { children: "Metadata Tags" }),
2633
2636
  O.map((f) => /* @__PURE__ */ e.jsxs(Y, { children: [
2634
- /* @__PURE__ */ e.jsx(ie, { children: f.label }),
2637
+ /* @__PURE__ */ e.jsx(le, { children: f.label }),
2635
2638
  /* @__PURE__ */ e.jsx(
2636
2639
  he,
2637
2640
  {
2638
2641
  isMulti: f.multi,
2639
- value: z[f.key]?.filter(
2640
- (B) => V.includes(B.id)
2642
+ value: B[f.key]?.filter(
2643
+ (P) => V.includes(P.id)
2641
2644
  ),
2642
- onChange: (B) => {
2643
- Dt(f.key, B);
2645
+ onChange: (P) => {
2646
+ Dt(f.key, P);
2644
2647
  },
2645
- options: z[f.key],
2648
+ options: B[f.key],
2646
2649
  placeholder: `Select ${f.multi ? "one or more" : "one"} ${f.label.toLowerCase()}`,
2647
2650
  isDisabled: s,
2648
2651
  isClearable: f.multi
@@ -2654,15 +2657,15 @@ const kn = ({
2654
2657
  /* @__PURE__ */ e.jsx(gt, { px: 0, children: /* @__PURE__ */ e.jsxs(
2655
2658
  "div",
2656
2659
  {
2657
- className: Ke(
2660
+ className: Ye(
2658
2661
  "grid grid-cols-1 gap-6",
2659
2662
  !s && "md:grid-cols-2"
2660
2663
  ),
2661
2664
  children: [
2662
- /* @__PURE__ */ e.jsxs("div", { className: Ke("space-y-4", s && "hidden"), children: [
2663
- /* @__PURE__ */ e.jsx(ie, { children: "Add New Report" }),
2665
+ /* @__PURE__ */ e.jsxs("div", { className: Ye("space-y-4", s && "hidden"), children: [
2666
+ /* @__PURE__ */ e.jsx(le, { children: "Add New Report" }),
2664
2667
  /* @__PURE__ */ e.jsxs(Y, { children: [
2665
- /* @__PURE__ */ e.jsx(ie, { children: "Report Name" }),
2668
+ /* @__PURE__ */ e.jsx(le, { children: "Report Name" }),
2666
2669
  /* @__PURE__ */ e.jsx(
2667
2670
  ve,
2668
2671
  {
@@ -2676,7 +2679,7 @@ const kn = ({
2676
2679
  )
2677
2680
  ] }),
2678
2681
  /* @__PURE__ */ e.jsxs(Y, { children: [
2679
- /* @__PURE__ */ e.jsx(ie, { children: "Report Type" }),
2682
+ /* @__PURE__ */ e.jsx(le, { children: "Report Type" }),
2680
2683
  /* @__PURE__ */ e.jsx(
2681
2684
  he,
2682
2685
  {
@@ -2693,7 +2696,7 @@ const kn = ({
2693
2696
  ] }),
2694
2697
  W !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2695
2698
  /* @__PURE__ */ e.jsxs(Y, { children: [
2696
- /* @__PURE__ */ e.jsx(ie, { children: "Default Parameters" }),
2699
+ /* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
2697
2700
  /* @__PURE__ */ e.jsx(
2698
2701
  bt,
2699
2702
  {
@@ -2705,7 +2708,7 @@ const kn = ({
2705
2708
  )
2706
2709
  ] }),
2707
2710
  /* @__PURE__ */ e.jsxs(Y, { children: [
2708
- /* @__PURE__ */ e.jsx(ie, { children: "Sensor Locations" }),
2711
+ /* @__PURE__ */ e.jsx(le, { children: "Sensor Locations" }),
2709
2712
  /* @__PURE__ */ e.jsx(
2710
2713
  ve,
2711
2714
  {
@@ -2719,12 +2722,12 @@ const kn = ({
2719
2722
  ] })
2720
2723
  ] }),
2721
2724
  W === ae.PointOfInterest && /* @__PURE__ */ e.jsxs(Y, { children: [
2722
- /* @__PURE__ */ e.jsx(ie, { children: "Instructions" }),
2725
+ /* @__PURE__ */ e.jsx(le, { children: "Instructions" }),
2723
2726
  /* @__PURE__ */ e.jsx(
2724
- Be,
2727
+ We,
2725
2728
  {
2726
2729
  value: Q,
2727
- onChange: (f) => E(f.target.value),
2730
+ onChange: (f) => _(f.target.value),
2728
2731
  rows: 3,
2729
2732
  placeholder: "Enter specific instructions for this report...",
2730
2733
  isDisabled: s
@@ -2742,7 +2745,7 @@ const kn = ({
2742
2745
  ) })
2743
2746
  ] }),
2744
2747
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2745
- /* @__PURE__ */ e.jsx(ie, { children: "Configured Reports" }),
2748
+ /* @__PURE__ */ e.jsx(le, { children: "Configured Reports" }),
2746
2749
  K.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: K.map((f) => /* @__PURE__ */ e.jsxs(
2747
2750
  "div",
2748
2751
  {
@@ -2762,14 +2765,14 @@ const kn = ({
2762
2765
  )
2763
2766
  ] }),
2764
2767
  /* @__PURE__ */ e.jsxs(Y, { children: [
2765
- /* @__PURE__ */ e.jsx(ie, { children: "Report Name" }),
2768
+ /* @__PURE__ */ e.jsx(le, { children: "Report Name" }),
2766
2769
  /* @__PURE__ */ e.jsx(
2767
2770
  ve,
2768
2771
  {
2769
2772
  value: f.name,
2770
- onChange: (B) => ce(
2771
- (P) => P.map(
2772
- (F) => F.id === f.id ? { ...F, name: B.target.value } : F
2773
+ onChange: (P) => ie(
2774
+ (F) => F.map(
2775
+ (G) => G.id === f.id ? { ...G, name: P.target.value } : G
2773
2776
  )
2774
2777
  ),
2775
2778
  placeholder: "Enter report name...",
@@ -2777,15 +2780,38 @@ const kn = ({
2777
2780
  }
2778
2781
  )
2779
2782
  ] }),
2783
+ /* @__PURE__ */ e.jsxs(Y, { display: "flex", alignItems: "center", children: [
2784
+ /* @__PURE__ */ e.jsx(
2785
+ Fe,
2786
+ {
2787
+ htmlFor: `auto-generate-${f.id}`,
2788
+ mb: "0",
2789
+ children: "Auto Generate"
2790
+ }
2791
+ ),
2792
+ /* @__PURE__ */ e.jsx(
2793
+ rn,
2794
+ {
2795
+ id: `auto-generate-${f.id}`,
2796
+ isChecked: f.autoGenerate ?? !1,
2797
+ onChange: (P) => ie(
2798
+ (F) => F.map(
2799
+ (G) => G.id === f.id ? { ...G, autoGenerate: P.target.checked } : G
2800
+ )
2801
+ ),
2802
+ isDisabled: s
2803
+ }
2804
+ )
2805
+ ] }),
2780
2806
  f.kind === ae.PointOfInterest && /* @__PURE__ */ e.jsxs(Y, { children: [
2781
- /* @__PURE__ */ e.jsx(ie, { children: "Instructions" }),
2807
+ /* @__PURE__ */ e.jsx(le, { children: "Instructions" }),
2782
2808
  /* @__PURE__ */ e.jsx(
2783
- Be,
2809
+ We,
2784
2810
  {
2785
2811
  value: f.instructions,
2786
- onChange: (B) => ce(
2787
- (P) => P.map(
2788
- (F) => F.id === f.id ? { ...F, instructions: B.target.value } : F
2812
+ onChange: (P) => ie(
2813
+ (F) => F.map(
2814
+ (G) => G.id === f.id ? { ...G, instructions: P.target.value } : G
2789
2815
  )
2790
2816
  ),
2791
2817
  rows: 3,
@@ -2795,17 +2821,17 @@ const kn = ({
2795
2821
  )
2796
2822
  ] }),
2797
2823
  f.kind !== ae.PointOfInterest && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2798
- /* @__PURE__ */ e.jsx(ie, { children: "Default Parameters" }),
2824
+ /* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
2799
2825
  /* @__PURE__ */ e.jsx(
2800
2826
  bt,
2801
2827
  {
2802
2828
  options: ye,
2803
2829
  value: f.parameters,
2804
- onChange: (B) => {
2805
- const P = (ee) => "joint" in ee.id ? ee.id.joint : ee.id.segment, F = B.map(P), se = ft(F);
2806
- ce(
2830
+ onChange: (P) => {
2831
+ const F = (ee) => "joint" in ee.id ? ee.id.joint : ee.id.segment, G = P.map(F), ne = ft(G);
2832
+ ie(
2807
2833
  (ee) => ee.map(
2808
- (de) => de.id === f.id ? { ...de, parameters: B, sensorLocations: se } : de
2834
+ (de) => de.id === f.id ? { ...de, parameters: P, sensorLocations: ne } : de
2809
2835
  )
2810
2836
  );
2811
2837
  },
@@ -2817,7 +2843,7 @@ const kn = ({
2817
2843
  "Sensors:",
2818
2844
  " ",
2819
2845
  f.sensorLocations.map(
2820
- (B) => yt(B)
2846
+ (P) => yt(P)
2821
2847
  ).join(", ")
2822
2848
  ] })
2823
2849
  ]
@@ -2834,14 +2860,14 @@ const kn = ({
2834
2860
  te,
2835
2861
  {
2836
2862
  justify: "end",
2837
- className: Ke((g || s) && "!hidden"),
2863
+ className: Ye((g || s) && "!hidden"),
2838
2864
  children: /* @__PURE__ */ e.jsxs(ke, { gap: 4, children: [
2839
2865
  /* @__PURE__ */ e.jsx(re, { colorScheme: "gray", isDisabled: x, onClick: i, children: "Cancel" }),
2840
2866
  /* @__PURE__ */ e.jsx(
2841
2867
  re,
2842
2868
  {
2843
2869
  colorScheme: "blue",
2844
- isDisabled: x || !Ge || !Ne,
2870
+ isDisabled: x || !Ee || !Ne,
2845
2871
  isLoading: x,
2846
2872
  onClick: Se,
2847
2873
  children: "Save changes"
@@ -2851,13 +2877,13 @@ const kn = ({
2851
2877
  }
2852
2878
  )
2853
2879
  ] });
2854
- }, ie = ({ children: r }) => /* @__PURE__ */ e.jsx(Ze, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Xn = ({
2880
+ }, le = ({ children: r }) => /* @__PURE__ */ e.jsx(Fe, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: r }), Zn = ({
2855
2881
  children: r,
2856
2882
  isView: n,
2857
2883
  metadataKeys: i
2858
2884
  }) => {
2859
- const [m, g] = _({}), u = at();
2860
- return le(() => {
2885
+ const [m, g] = z({}), u = at();
2886
+ return ce(() => {
2861
2887
  let d = !1;
2862
2888
  return (async () => {
2863
2889
  const s = (i ?? []).map(
@@ -2882,7 +2908,7 @@ const kn = ({
2882
2908
  d = !0;
2883
2909
  };
2884
2910
  }, [u, i]), /* @__PURE__ */ e.jsx(Rt.Provider, { value: { isView: n, metadataOptions: m }, children: r });
2885
- }, bs = ({
2911
+ }, ys = ({
2886
2912
  id: r,
2887
2913
  onCancel: n,
2888
2914
  onSave: i,
@@ -2894,27 +2920,27 @@ const kn = ({
2894
2920
  isView: s
2895
2921
  }) => {
2896
2922
  const [{ data: l, fetching: p }] = we({
2897
- query: u ? mn : hn
2923
+ query: u ? hn : pn
2898
2924
  }), [{ data: v }] = we({
2899
- query: pn,
2925
+ query: gn,
2900
2926
  variables: { id: r },
2901
2927
  pause: !r
2902
2928
  }), [{ data: L }] = we({
2903
- query: gn
2929
+ query: xn
2904
2930
  }), M = I(
2905
- Pe,
2931
+ Ge,
2906
2932
  L?.moduleCategories
2907
2933
  ), [{ fetching: w }, y] = fe(At), [{ fetching: x }, a] = fe(Ot), C = k(() => !l || p ? [] : I(
2908
2934
  Ce,
2909
2935
  u ? l?.quantumOwnedActions ?? [] : l?.actions ?? []
2910
- ).filter((c) => !!c?.id), [l, u, p]), j = I(qe, v?.module), O = k(() => I(kt, j?.moduleActions) ?? [], [j?.moduleActions]), [R, $] = _([
2936
+ ).filter((c) => !!c?.id), [l, u, p]), j = I(Ke, v?.module), O = k(() => I(kt, j?.moduleActions) ?? [], [j?.moduleActions]), [R, $] = z([
2911
2937
  ...O.map((H) => H.actionId) ?? []
2912
- ]), [A, T] = _(j?.name ?? ""), [J, oe] = _([]), [D, Z] = _(j?.description ?? ""), [V, N] = _([]), [z, X] = _({});
2913
- le(() => {
2938
+ ]), [A, T] = z(j?.name ?? ""), [J, oe] = z([]), [D, Z] = z(j?.description ?? ""), [V, N] = z([]), [B, X] = z({});
2939
+ ce(() => {
2914
2940
  if (j) {
2915
2941
  $(O.map((o) => o.actionId)), T(j.name), Z(j.description ?? ""), oe(
2916
2942
  j.categories.map(
2917
- (o) => I(Pe, o).id
2943
+ (o) => I(Ge, o).id
2918
2944
  ) ?? []
2919
2945
  );
2920
2946
  const c = I(
@@ -2930,9 +2956,9 @@ const kn = ({
2930
2956
  }), X(t);
2931
2957
  }
2932
2958
  }, [j, O]);
2933
- const W = G(() => {
2959
+ const W = E(() => {
2934
2960
  let H;
2935
- const c = Object.entries(z).filter(([, o]) => o !== null).map(([o, b]) => ({
2961
+ const c = Object.entries(B).filter(([, o]) => o !== null).map(([o, b]) => ({
2936
2962
  actionId: o,
2937
2963
  reportId: b
2938
2964
  })), t = {
@@ -2960,30 +2986,30 @@ const kn = ({
2960
2986
  D,
2961
2987
  J,
2962
2988
  V,
2963
- z,
2989
+ B,
2964
2990
  j,
2965
2991
  i,
2966
2992
  m,
2967
2993
  u
2968
2994
  ]);
2969
- return le(() => {
2995
+ return ce(() => {
2970
2996
  h && h({
2971
2997
  cancelButton: w || x,
2972
2998
  saveButton: w || x || !A || D.trim().split(/\s+/).filter(Boolean).length > 40
2973
2999
  });
2974
- }, [h, w, x, R, A, D]), le(() => {
3000
+ }, [h, w, x, R, A, D]), ce(() => {
2975
3001
  d && d({
2976
3002
  cancelButton: n,
2977
3003
  saveButton: W
2978
3004
  });
2979
- }, [d, n, W]), /* @__PURE__ */ e.jsx(ne, { width: "100%", children: /* @__PURE__ */ e.jsxs(
2980
- Xn,
3005
+ }, [d, n, W]), /* @__PURE__ */ e.jsx(se, { width: "100%", children: /* @__PURE__ */ e.jsxs(
3006
+ Zn,
2981
3007
  {
2982
3008
  isView: s,
2983
3009
  metadataKeys: ["activity_type", "session_type", "body_region", "sport"],
2984
3010
  children: [
2985
3011
  /* @__PURE__ */ e.jsx(
2986
- zn,
3012
+ Bn,
2987
3013
  {
2988
3014
  name: A,
2989
3015
  setName: T,
@@ -2997,7 +3023,7 @@ const kn = ({
2997
3023
  setDescription: Z,
2998
3024
  selectedMetadataIds: V,
2999
3025
  setSelectedMetadataIds: N,
3000
- actionReportIds: z,
3026
+ actionReportIds: B,
3001
3027
  setActionReportIds: X
3002
3028
  }
3003
3029
  ),
@@ -3027,12 +3053,12 @@ const kn = ({
3027
3053
  ) });
3028
3054
  };
3029
3055
  export {
3030
- _n as ActivityList,
3031
- xs as CopyActivityForm,
3032
- fs as CopyModuleForm,
3033
- zn as ModuleForm,
3034
- Hn as ParameterEditList,
3056
+ zn as ActivityList,
3057
+ fs as CopyActivityForm,
3058
+ js as CopyModuleForm,
3059
+ Bn as ModuleForm,
3060
+ Jn as ParameterEditList,
3035
3061
  bt as ParameterEditSelect,
3036
- js as UpsertActivityForm,
3037
- bs as UpsertModuleForm
3062
+ bs as UpsertActivityForm,
3063
+ ys as UpsertModuleForm
3038
3064
  };