quantum-component-library 1.4.69 → 1.4.70

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.
Files changed (41) hide show
  1. package/dist/components.cjs +1 -1
  2. package/dist/components.js +450 -443
  3. package/dist/{dnd-core-vendor-Dpm8Ha_h.cjs → dnd-core-vendor-BQo1WiA6.cjs} +1 -1
  4. package/dist/{dnd-core-vendor-BvkN08kD.js → dnd-core-vendor-NmXYCL5j.js} +2 -2
  5. package/dist/generated/graphql.d.ts +584 -6
  6. package/dist/generated-graphql.cjs +1 -1
  7. package/dist/generated-graphql.js +82 -76
  8. package/dist/{graphql-vendor-ipMKtdBu.js → graphql-vendor-BOwWQmc4.js} +1 -1
  9. package/dist/{graphql-vendor-CSrUjvOC.cjs → graphql-vendor-CMjSICJP.cjs} +1 -1
  10. package/dist/hooks.cjs +1 -1
  11. package/dist/hooks.js +3 -3
  12. package/dist/index.cjs +1 -1
  13. package/dist/index.js +47 -46
  14. package/dist/lib/types/sensor-info.test.d.ts +1 -0
  15. package/dist/lib/utils/parameters.d.ts +14 -1
  16. package/dist/lib/utils/parameters.test.d.ts +1 -0
  17. package/dist/{lodash-vendor-CfNg9qwP.cjs → lodash-vendor-CGEP7jch.cjs} +1 -1
  18. package/dist/{lodash-vendor-CY4G3-79.js → lodash-vendor-Deq42ySR.js} +1 -1
  19. package/dist/{other-CPHWCRXi.js → other-Bp68Uzz1.js} +3 -3
  20. package/dist/{other-B_xypnnb.cjs → other-Bsl3n3tj.cjs} +1 -1
  21. package/dist/{react-dnd-vendor-DvbjNa5U.cjs → react-dnd-vendor-CPQdLxxA.cjs} +1 -1
  22. package/dist/{react-dnd-vendor-DYesaYGm.js → react-dnd-vendor-D7ujbWN2.js} +2 -2
  23. package/dist/{react-select-vendor-B0QF8gkj.js → react-select-vendor-B-vWCyYj.js} +1 -1
  24. package/dist/{react-select-vendor-BLLqfZvd.cjs → react-select-vendor-Dletsq31.cjs} +1 -1
  25. package/dist/services-human-Cl36G8mV.cjs +1 -0
  26. package/dist/{services-human-D5IllQkM.js → services-human-mjbBM3xQ.js} +2 -2
  27. package/dist/services.cjs +1 -1
  28. package/dist/services.js +1 -1
  29. package/dist/types.cjs +1 -1
  30. package/dist/types.js +13 -13
  31. package/dist/{utils-conversion-DFO1UVSN.cjs → utils-conversion-CBAxJ_Vx.cjs} +1 -1
  32. package/dist/{utils-conversion-BQfLNP0g.js → utils-conversion-Dmt0JwSC.js} +1 -1
  33. package/dist/{utils-parameters-DkefNhWo.js → utils-parameters-BiyUnm5t.js} +17 -7
  34. package/dist/utils-parameters-Bx16_6xw.cjs +1 -0
  35. package/dist/utils.cjs +1 -1
  36. package/dist/utils.js +19 -18
  37. package/dist/{vendor-DeYnrakH.cjs → vendor-CNEuzHxC.cjs} +1 -1
  38. package/dist/{vendor-BSFJsa1P.js → vendor-D_9BWGCW.js} +1 -1
  39. package/package.json +1 -1
  40. package/dist/services-human-DFPelsei.cjs +0 -1
  41. package/dist/utils-parameters-dwKmz1VU.cjs +0 -1
@@ -1,22 +1,23 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
2
  import "./moment-vendor-DMLRxgRE.js";
3
- import { Flex as Me, InputGroup as ct, InputLeftElement as Pt, Icon as Ct, Input as ye, FormLabel as _e, ButtonGroup as Ne, Tooltip as rt, Button as te, Box as se, RangeSlider as _t, RangeSliderMark as st, Text as M, RangeSliderTrack as Et, RangeSliderFilledTrack as zt, RangeSliderThumb as dt, Select as ut, NumberInput as mt, NumberInputField as ht, HStack as V, Tag as Ge, FormControl as X, TableContainer as Bt, Table as Ut, Thead as Wt, Tr as pt, Th as De, Tbody as Qt, Td as We, IconButton as ot, Image as qt, useToast as wt, VStack as ue, RadioGroup as It, Radio as Ze, Alert as Ve, AlertIcon as et, Spinner as St, useDisclosure as Kt, Modal as Ht, ModalOverlay as Yt, ModalContent as Jt, ModalHeader as Xt, ModalCloseButton as Zt, ModalBody as Vt, ModalFooter as en, Badge as Oe, Tabs as tn, TabList as nn, Tab as gt, TabPanels as sn, TabPanel as xt, Textarea as Qe, Switch as on } from "@chakra-ui/react";
4
- import { useMemo as $, useState as q, useEffect as ce, useCallback as _, createContext as rn, useContext as an, memo as Ae, useRef as ln } from "react";
3
+ import { Flex as Me, InputGroup as dt, InputLeftElement as _t, Icon as wt, Input as ye, FormLabel as _e, ButtonGroup as Ne, Tooltip as at, Button as ne, Box as se, RangeSlider as Et, RangeSliderMark as st, Text as M, RangeSliderTrack as zt, RangeSliderFilledTrack as Bt, RangeSliderThumb as ut, Select as mt, NumberInput as ht, NumberInputField as pt, HStack as V, Tag as Fe, FormControl as X, TableContainer as Ut, Table as Wt, Thead as Qt, Tr as gt, Th as De, Tbody as qt, Td as We, IconButton as rt, Image as Kt, useToast as It, VStack as ue, RadioGroup as St, Radio as Ze, Alert as Ve, AlertIcon as et, Spinner as Lt, useDisclosure as Ht, Modal as Yt, ModalOverlay as Jt, ModalContent as Xt, ModalHeader as Zt, ModalCloseButton as Vt, ModalBody as en, ModalFooter as tn, Badge as Oe, Tabs as nn, TabList as sn, Tab as xt, TabPanels as on, TabPanel as ft, Textarea as Qe, Switch as rn } from "@chakra-ui/react";
4
+ import { useMemo as $, useState as q, useEffect as ce, useCallback as E, createContext as an, useContext as ln, memo as Ae, useRef as cn } from "react";
5
5
  import { getFragmentData as A } from "./generated.js";
6
- import { G as at, M as je, a as be, b as Lt, c as cn, C as it, d as kt, e as Mt, R as Fe, f as Pe, T as Te, A as ve, g as dn, h as At, U as Ot, i as Ye, j as Tt, k as un, l as mn, m as hn, n as pn, o as gn, p as xn } from "./graphql-DFQnN0la.js";
6
+ import { G as it, M as je, a as be, b as kt, c as dn, C as lt, d as Mt, e as At, R as Ge, f as Pe, T as Te, A as ve, g as un, h as Ot, U as Tt, i as Ye, j as Nt, k as mn, l as hn, m as pn, n as gn, o as xn, p as fn } from "./graphql-DFQnN0la.js";
7
7
  import { c as Je } from "./utils-cn-CgdSr4hO.js";
8
- import "./lodash-vendor-CY4G3-79.js";
9
- import { useClient as lt, useQuery as Ce, useMutation as fe } from "urql";
10
- import { useUiLabelContext as xe, useAllPartParameters as fn } from "./hooks.js";
11
- import { u as jn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
12
- import { s as he } from "./react-select-vendor-B0QF8gkj.js";
13
- import { F as bn, a as yn, b as vn, c as Cn, d as wn, e as In } from "./react-icons-vendor-DqOJrTLA.js";
8
+ import { sensorLocationName as jn, availablePlanes as jt, getAnalysisPartIdNoSide as qe } from "./types.js";
9
+ import "./lodash-vendor-Deq42ySR.js";
10
+ import { useClient as ct, useQuery as Ce, useMutation as fe } from "urql";
11
+ import { useUiLabelContext as xe, useAllPartParameters as bn } from "./hooks.js";
12
+ import { u as yn } from "./ufuzzy-vendor-Dl0ZI6Av.js";
13
+ import { s as he } from "./react-select-vendor-B-vWCyYj.js";
14
+ import { F as vn, a as Cn, b as wn, c as In, d as Sn, e as Ln } from "./react-icons-vendor-DqOJrTLA.js";
14
15
  import { reportKindName as ke } from "./services.js";
15
- import { D as Sn, H as Ln, u as kn, a as Mn } from "./react-dnd-vendor-DYesaYGm.js";
16
- import { g as Nt, a as Rt, b as An, c as On, d as Tn, e as ft, f as jt } from "./services-human-D5IllQkM.js";
17
- import { ThresholdKind as Xe, ReportKind as ie, ActionLaterality as Nn, SensorLocation as me } from "./generated-graphql.js";
18
- import { availablePlanes as bt, getAnalysisPartIdNoSide as qe } from "./types.js";
19
- const Rn = ({
16
+ import { D as kn, H as Mn, u as An, a as On } from "./react-dnd-vendor-D7ujbWN2.js";
17
+ import { g as Rt, a as $t, b as Tn, c as Nn, d as Rn, e as bt, f as yt } from "./services-human-mjbBM3xQ.js";
18
+ import { ThresholdKind as Xe, ReportKind as ie, ActionLaterality as $n, SensorLocation as me } from "./generated-graphql.js";
19
+ import { f as ot } from "./utils-parameters-BiyUnm5t.js";
20
+ const Dn = ({
20
21
  setSearch: s,
21
22
  actions: t,
22
23
  updateUseCases: r,
@@ -30,8 +31,8 @@ const Rn = ({
30
31
  [t]
31
32
  );
32
33
  return /* @__PURE__ */ e.jsxs(Me, { width: "100%", alignContent: "space-evenly", gap: 4, children: [
33
- /* @__PURE__ */ e.jsxs(ct, { size: "md", flex: 1, children: [
34
- /* @__PURE__ */ e.jsx(Pt, { children: /* @__PURE__ */ e.jsx(Ct, { as: bn, color: "gray.300" }) }),
34
+ /* @__PURE__ */ e.jsxs(dt, { size: "md", flex: 1, children: [
35
+ /* @__PURE__ */ e.jsx(_t, { children: /* @__PURE__ */ e.jsx(wt, { as: vn, color: "gray.300" }) }),
35
36
  /* @__PURE__ */ e.jsx(
36
37
  ye,
37
38
  {
@@ -42,7 +43,7 @@ const Rn = ({
42
43
  }
43
44
  )
44
45
  ] }),
45
- !p && /* @__PURE__ */ e.jsx(ct, { size: "md", children: /* @__PURE__ */ e.jsx(
46
+ !p && /* @__PURE__ */ e.jsx(dt, { size: "md", children: /* @__PURE__ */ e.jsx(
46
47
  he,
47
48
  {
48
49
  size: "md",
@@ -62,7 +63,7 @@ const Rn = ({
62
63
  ] });
63
64
  }, ge = ({
64
65
  children: s
65
- }) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), $n = ({
66
+ }) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), Fn = ({
66
67
  items: s,
67
68
  onChange: t,
68
69
  selectedItem: r,
@@ -72,7 +73,7 @@ const Rn = ({
72
73
  }) => {
73
74
  const d = (n) => n === r || n.value === r, g = (n) => d(n) ? { ...h, ...m } : h;
74
75
  return /* @__PURE__ */ e.jsx(Ne, { isAttached: !0, isDisabled: p, children: s.map((n, o) => /* @__PURE__ */ e.jsx(
75
- rt,
76
+ at,
76
77
  {
77
78
  label: n.tooltip,
78
79
  openDelay: 50,
@@ -81,7 +82,7 @@ const Rn = ({
81
82
  visibility: n.tooltip ? "visible" : "hidden",
82
83
  hasArrow: !0,
83
84
  children: /* @__PURE__ */ e.jsx(
84
- te,
85
+ ne,
85
86
  {
86
87
  onClick: () => d(n) ? null : t(n, o),
87
88
  isDisabled: n.disabled,
@@ -92,7 +93,7 @@ const Rn = ({
92
93
  },
93
94
  o
94
95
  )) });
95
- }, Ke = (s, t) => t < 0 ? -1 * Math.abs(s) : Math.abs(s), Dn = ({
96
+ }, Ke = (s, t) => t < 0 ? -1 * Math.abs(s) : Math.abs(s), Gn = ({
96
97
  isReversed: s,
97
98
  min: t,
98
99
  max: r,
@@ -107,53 +108,53 @@ const Rn = ({
107
108
  isDisabled: y,
108
109
  ...b
109
110
  }) => {
110
- const [w, I] = q([void 0, void 0]), L = w[0], f = w[1], c = g && t < -5 && r > 5, k = Number(p?.[0] ?? f ?? t) > 0 ? 1 : -1, x = Number(p?.[1] ?? f ?? r) < 0 ? -1 : 1, N = u?.[0] === u?.[1], v = p?.[0], E = p?.[1];
111
+ const [w, I] = q([void 0, void 0]), L = w[0], f = w[1], c = g && t < -5 && r > 5, k = Number(p?.[0] ?? f ?? t) > 0 ? 1 : -1, x = Number(p?.[1] ?? f ?? r) < 0 ? -1 : 1, N = u?.[0] === u?.[1], v = p?.[0], z = p?.[1];
111
112
  ce(() => {
112
- v !== void 0 && E !== void 0 && I([v.toFixed(0), E.toFixed(0)]);
113
- }, [v, E, I]);
114
- const R = _(
115
- ([T, B]) => {
116
- T < B && I([T.toFixed(0), B.toFixed(0)]);
113
+ v !== void 0 && z !== void 0 && I([v.toFixed(0), z.toFixed(0)]);
114
+ }, [v, z, I]);
115
+ const R = E(
116
+ ([T, U]) => {
117
+ T < U && I([T.toFixed(0), U.toFixed(0)]);
117
118
  },
118
119
  [I]
119
- ), O = _(
120
- ([T, B]) => {
121
- T < B && m([T, B]);
120
+ ), O = E(
121
+ ([T, U]) => {
122
+ T < U && m([T, U]);
122
123
  },
123
124
  [m]
124
- ), K = _(() => {
125
- I(([T, B]) => {
126
- const J = isNaN(Number(T)) ? t : Number(T), U = isNaN(Number(B)) ? r : Number(B), Y = Ke(Number(J), k), i = Ke(Number(U), x), a = k < 0 ? Math.max(Y, t) : Math.min(Y, r), C = x < 0 ? Math.max(i, t) : Math.min(i, r);
125
+ ), K = E(() => {
126
+ I(([T, U]) => {
127
+ const J = isNaN(Number(T)) ? t : Number(T), B = isNaN(Number(U)) ? r : Number(U), Y = Ke(Number(J), k), i = Ke(Number(B), x), a = k < 0 ? Math.max(Y, t) : Math.min(Y, r), C = x < 0 ? Math.max(i, t) : Math.min(i, r);
127
128
  return a > C ? (m([C, a]), [C.toFixed(0), a.toFixed(0)]) : (m([a, C]), [a.toFixed(0), C.toFixed(0)]);
128
129
  });
129
- }, [m, I, k, x, t, r]), oe = _(
130
+ }, [m, I, k, x, t, r]), oe = E(
130
131
  (T) => {
131
- const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), k);
132
- I(([J, U]) => [B.toString(), U]);
132
+ const U = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), k);
133
+ I(([J, B]) => [U.toString(), B]);
133
134
  },
134
135
  [I, k]
135
- ), D = _(
136
+ ), G = E(
136
137
  (T) => {
137
- const B = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), x);
138
- I(([J, U]) => [J, B.toString()]);
138
+ const U = T === "" || isNaN(Number(T)) ? T : Ke(Number(T), x);
139
+ I(([J, B]) => [J, U.toString()]);
139
140
  },
140
141
  [I, x]
141
142
  ), ae = $(
142
143
  () => d === "xs" ? "0.75rem" : void 0,
143
144
  [d]
144
- ), Z = _(
145
- (T, B) => {
146
- const J = Number(B.target.value);
145
+ ), Z = E(
146
+ (T, U) => {
147
+ const J = Number(U.target.value);
147
148
  if (!L || !f || ![-1, 1].includes(J))
148
149
  return;
149
- const U = (a) => J < 0 ? -1 * Math.abs(a) : Math.abs(a), Y = T ? U(Number(L)) : Number(L), i = T ? Number(f) : U(Number(f));
150
+ const B = (a) => J < 0 ? -1 * Math.abs(a) : Math.abs(a), Y = T ? B(Number(L)) : Number(L), i = T ? Number(f) : B(Number(f));
150
151
  Y > i ? m([i, Y]) : m([Y, i]);
151
152
  },
152
153
  [L, f, m]
153
154
  );
154
155
  return /* @__PURE__ */ e.jsxs(Me, { direction: "column", ...b, children: [
155
156
  /* @__PURE__ */ e.jsx(se, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
156
- _t,
157
+ Et,
157
158
  {
158
159
  "aria-label": ["min", "max"],
159
160
  isReversed: s,
@@ -199,9 +200,9 @@ const Rn = ({
199
200
  }
200
201
  )
201
202
  ] }),
202
- /* @__PURE__ */ e.jsx(Et, { children: /* @__PURE__ */ e.jsx(zt, {}) }),
203
- /* @__PURE__ */ e.jsx(dt, { index: 0, w: ae, h: ae }),
204
- /* @__PURE__ */ e.jsx(dt, { index: 1, w: ae, h: ae })
203
+ /* @__PURE__ */ e.jsx(zt, { children: /* @__PURE__ */ e.jsx(Bt, {}) }),
204
+ /* @__PURE__ */ e.jsx(ut, { index: 0, w: ae, h: ae }),
205
+ /* @__PURE__ */ e.jsx(ut, { index: 1, w: ae, h: ae })
205
206
  ]
206
207
  }
207
208
  ) }),
@@ -241,7 +242,7 @@ const Rn = ({
241
242
  gap: "0.125em",
242
243
  children: [
243
244
  u && /* @__PURE__ */ e.jsxs(
244
- ut,
245
+ mt,
245
246
  {
246
247
  width: "auto",
247
248
  size: d,
@@ -256,12 +257,12 @@ const Rn = ({
256
257
  }
257
258
  ),
258
259
  /* @__PURE__ */ e.jsx(
259
- mt,
260
+ ht,
260
261
  {
261
262
  precision: 0,
262
263
  size: d ?? "sm",
263
264
  min: 0,
264
- max: k < 0 ? Math.abs(t) : E ?? r,
265
+ max: k < 0 ? Math.abs(t) : z ?? r,
265
266
  value: L === "" ? "" : Math.abs(Number(L ?? t)),
266
267
  onChange: oe,
267
268
  onBlur: K,
@@ -271,7 +272,7 @@ const Rn = ({
271
272
  isDisabled: y,
272
273
  ...h,
273
274
  children: /* @__PURE__ */ e.jsx(
274
- ht,
275
+ pt,
275
276
  {
276
277
  backgroundColor: "#fff",
277
278
  paddingRight: 0,
@@ -281,14 +282,14 @@ const Rn = ({
281
282
  }
282
283
  ),
283
284
  /* @__PURE__ */ e.jsx(
284
- mt,
285
+ ht,
285
286
  {
286
287
  size: d ?? "sm",
287
288
  min: 0,
288
289
  max: x < 0 ? Math.abs(v ?? t) : r,
289
290
  precision: 0,
290
291
  value: f === "" ? "" : Math.abs(Number(f ?? r)),
291
- onChange: D,
292
+ onChange: G,
292
293
  onBlur: K,
293
294
  borderWidth: 1,
294
295
  borderRadius: 3,
@@ -296,7 +297,7 @@ const Rn = ({
296
297
  isDisabled: y,
297
298
  ...h,
298
299
  children: /* @__PURE__ */ e.jsx(
299
- ht,
300
+ pt,
300
301
  {
301
302
  backgroundColor: "#fff",
302
303
  paddingRight: 0,
@@ -306,7 +307,7 @@ const Rn = ({
306
307
  }
307
308
  ),
308
309
  u && /* @__PURE__ */ e.jsxs(
309
- ut,
310
+ mt,
310
311
  {
311
312
  width: "auto",
312
313
  size: d,
@@ -324,7 +325,7 @@ const Rn = ({
324
325
  }
325
326
  )
326
327
  ] });
327
- }, Gn = ({ tags: s, containerProps: t, ...r }) => /* @__PURE__ */ e.jsx(V, { ...t, children: s.map((p, m) => /* @__PURE__ */ e.jsx(Ge, { ...r, children: p }, m)) }), Fn = new jn({}), Pn = ({
328
+ }, Pn = ({ tags: s, containerProps: t, ...r }) => /* @__PURE__ */ e.jsx(V, { ...t, children: s.map((p, m) => /* @__PURE__ */ e.jsx(Fe, { ...r, children: p }, m)) }), _n = new yn({}), En = ({
328
329
  action: s,
329
330
  quantumIconSrc: t
330
331
  }) => {
@@ -332,7 +333,7 @@ const Rn = ({
332
333
  actionLowerCase: r("action").toLocaleLowerCase()
333
334
  }), [r]);
334
335
  return s.quantumOwned ? /* @__PURE__ */ e.jsx(
335
- rt,
336
+ at,
336
337
  {
337
338
  label: `This ${p.actionLowerCase} is owned by Quantum`,
338
339
  "aria-label": "Quantum owned",
@@ -346,7 +347,7 @@ const Rn = ({
346
347
  alignItems: "center",
347
348
  justifyContent: "center",
348
349
  children: /* @__PURE__ */ e.jsx(
349
- qt,
350
+ Kt,
350
351
  {
351
352
  src: t,
352
353
  boxSize: "1em",
@@ -357,19 +358,14 @@ const Rn = ({
357
358
  )
358
359
  }
359
360
  ) : null;
360
- }, _n = (s, t) => {
361
+ }, zn = (s, t) => {
361
362
  if (!t || !t.trim().length)
362
363
  return s;
363
364
  const r = s.map((m) => m.name ?? "");
364
- return Fn.filter(r, t)?.map((m) => s[m]) ?? [];
365
- }, En = (s) => !s || s.length === 0 ? "None" : s.map(
366
- (t) => (
367
- // Convert camelCase to separate words (e.g., 'LeftFoot' -> 'Left Foot')
368
- t.replace(/([A-Z])/g, " $1").trim()
369
- )
370
- ).join(", "), zn = (s, t) => !t || t.length == 0 ? s : s.filter(
365
+ return _n.filter(r, t)?.map((m) => s[m]) ?? [];
366
+ }, Bn = (s) => !s || s.length === 0 ? "None" : s.map((t) => jn(t)).join(", "), Un = (s, t) => !t || t.length == 0 ? s : s.filter(
371
367
  (r) => r.useCases?.some((p) => t.includes(p.id)) ?? !1
372
- ), Bn = (s, t, r) => !t || t.length === 0 ? s : s.filter((p) => {
368
+ ), Wn = (s, t, r) => !t || t.length === 0 ? s : s.filter((p) => {
373
369
  const m = {};
374
370
  return t.forEach((h) => {
375
371
  for (const [d, g] of Object.entries(r || {}))
@@ -394,7 +390,7 @@ const Rn = ({
394
390
  );
395
391
  }
396
392
  );
397
- }), Un = ({
393
+ }), Qn = ({
398
394
  actions: s,
399
395
  totalActions: t,
400
396
  onCreate: r,
@@ -415,12 +411,12 @@ const Rn = ({
415
411
  allowDuplicateSelection: c = !1,
416
412
  getSelectedCount: k
417
413
  }) => {
418
- const [x, N] = q(""), [v, E] = q(), [R, O] = q([]), [K, oe] = q({}), { getLabel: D } = xe(), ae = lt(), Z = $(() => ({
419
- action: D("action"),
420
- actionPlural: D("action_plural"),
421
- actionLowerCase: D("action").toLocaleLowerCase(),
422
- actionPluralLowerCase: D("action_plural").toLocaleLowerCase()
423
- }), [D]), T = $(() => [
414
+ const [x, N] = q(""), [v, z] = q(), [R, O] = q([]), [K, oe] = q({}), { getLabel: G } = xe(), ae = ct(), Z = $(() => ({
415
+ action: G("action"),
416
+ actionPlural: G("action_plural"),
417
+ actionLowerCase: G("action").toLocaleLowerCase(),
418
+ actionPluralLowerCase: G("action_plural").toLocaleLowerCase()
419
+ }), [G]), T = $(() => [
424
420
  { key: "module_category", label: "Link Category", multi: !0 },
425
421
  { key: "activity_type", label: `${Z.action} Type`, multi: !0 },
426
422
  { key: "session_type", label: "Session Type", multi: !0 },
@@ -431,15 +427,15 @@ const Rn = ({
431
427
  if (!w)
432
428
  return;
433
429
  const l = T.map(
434
- (S) => ae.query(at, { key: S.key })
430
+ (S) => ae.query(it, { key: S.key })
435
431
  );
436
432
  Promise.all(l).then((S) => {
437
433
  const W = {};
438
- S.forEach((G) => {
439
- if (G.error || !G.data) return;
434
+ S.forEach((P) => {
435
+ if (P.error || !P.data) return;
440
436
  const Q = A(
441
437
  je,
442
- G.data.getMetadataByKey
438
+ P.data.getMetadataByKey
443
439
  ), H = A(
444
440
  be,
445
441
  Q.data
@@ -452,11 +448,11 @@ const Rn = ({
452
448
  }), oe(W);
453
449
  });
454
450
  }, [ae, T, w]);
455
- const B = $(() => {
451
+ const U = $(() => {
456
452
  if (!s)
457
453
  return;
458
- const l = _n(s, x), S = b ? l : zn(l, v);
459
- return w ? Bn(
454
+ const l = zn(s, x), S = b ? l : Un(l, v);
455
+ return w ? Wn(
460
456
  S,
461
457
  R,
462
458
  K
@@ -469,28 +465,28 @@ const Rn = ({
469
465
  w,
470
466
  R,
471
467
  K
472
- ]), J = _(() => {
468
+ ]), J = E(() => {
473
469
  if (!p)
474
470
  return;
475
471
  const S = s.filter(
476
472
  (W) => W.selected && !W.quantumOwned
477
473
  ).map((W) => W.id);
478
474
  p(S);
479
- }, [s, p]), U = _(() => {
475
+ }, [s, p]), B = E(() => {
480
476
  if (!g)
481
477
  return;
482
478
  const l = s.filter((S) => S.selected);
483
479
  g(l.map((S) => S.id)), d && l.forEach((S) => d(S, !1));
484
- }, [s, g, d]), Y = $(() => s.some((l) => l.selected && !l.quantumOwned), [s]), i = $(() => s.some((l) => l.selected), [s]), a = $(() => s.some((l) => l.selected && l.quantumOwned), [s]), C = _(
480
+ }, [s, g, d]), Y = $(() => s.some((l) => l.selected && !l.quantumOwned), [s]), i = $(() => s.some((l) => l.selected), [s]), a = $(() => s.some((l) => l.selected && l.quantumOwned), [s]), C = E(
485
481
  (l, S) => {
486
482
  const W = T.find((Q) => Q.key === l);
487
483
  if (!W) return;
488
- const G = W.multi ? (S ?? []).map((Q) => Q.id) : S ? [S.id] : [];
484
+ const P = W.multi ? (S ?? []).map((Q) => Q.id) : S ? [S.id] : [];
489
485
  O((Q) => [...Q.filter((re) => Object.values(K).flat().find((Ie) => Ie.id === re) && !Object.keys(K).find(
490
486
  (Ie) => K[Ie]?.some(
491
487
  (Se) => Se.id === re && Ie === l
492
488
  )
493
- )), ...G]);
489
+ )), ...P]);
494
490
  },
495
491
  [T, K]
496
492
  );
@@ -498,7 +494,7 @@ const Rn = ({
498
494
  /* @__PURE__ */ e.jsxs(Me, { alignContent: "space-between", gap: 4, children: [
499
495
  (r || p || g) && /* @__PURE__ */ e.jsxs(Ne, { mb: "1rem", gap: 4, children: [
500
496
  r && /* @__PURE__ */ e.jsxs(
501
- te,
497
+ ne,
502
498
  {
503
499
  isDisabled: !r || y,
504
500
  colorScheme: "blackAlpha",
@@ -511,12 +507,12 @@ const Rn = ({
511
507
  }
512
508
  ),
513
509
  p && !n && /* @__PURE__ */ e.jsx(
514
- rt,
510
+ at,
515
511
  {
516
512
  label: a ? Y ? `Quantum-owned ${Z.actionPluralLowerCase} are selected and will be skipped` : `Selected ${Z.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
517
513
  shouldWrapChildren: !0,
518
514
  children: /* @__PURE__ */ e.jsx(
519
- te,
515
+ ne,
520
516
  {
521
517
  colorScheme: "gray",
522
518
  isDisabled: !Y || !p || o,
@@ -527,21 +523,21 @@ const Rn = ({
527
523
  }
528
524
  ),
529
525
  g && !n && /* @__PURE__ */ e.jsx(
530
- te,
526
+ ne,
531
527
  {
532
528
  colorScheme: "gray",
533
529
  isDisabled: !i,
534
- onClick: U,
530
+ onClick: B,
535
531
  children: "Duplicate Selected"
536
532
  }
537
533
  )
538
534
  ] }),
539
535
  /* @__PURE__ */ e.jsx(
540
- Rn,
536
+ Dn,
541
537
  {
542
538
  setSearch: N,
543
539
  actions: s,
544
- updateUseCases: E,
540
+ updateUseCases: z,
545
541
  hideUseCaseFilter: b
546
542
  }
547
543
  )
@@ -573,11 +569,11 @@ const Rn = ({
573
569
  }
574
570
  )
575
571
  ] }, l.key)) }) }),
576
- /* @__PURE__ */ e.jsx(Bt, { mr: "2rem", overflowX: "hidden", ...I, children: /* @__PURE__ */ e.jsxs(Ut, { size: "md", variant: "simple", children: [
577
- /* @__PURE__ */ e.jsx(Wt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(pt, { children: [
572
+ /* @__PURE__ */ e.jsx(Ut, { mr: "2rem", overflowX: "hidden", ...I, children: /* @__PURE__ */ e.jsxs(Wt, { size: "md", variant: "simple", children: [
573
+ /* @__PURE__ */ e.jsx(Qt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(gt, { children: [
578
574
  /* @__PURE__ */ e.jsxs(De, { fontWeight: "normal", children: [
579
575
  "(showing ",
580
- B?.length ?? 0,
576
+ U?.length ?? 0,
581
577
  " of",
582
578
  " ",
583
579
  t ?? s.length,
@@ -588,10 +584,10 @@ const Rn = ({
588
584
  !b && /* @__PURE__ */ e.jsx(De, { children: "Use Case" }),
589
585
  /* @__PURE__ */ e.jsx(De, {})
590
586
  ] }) }),
591
- /* @__PURE__ */ e.jsx(Qt, { children: B?.map((l) => {
587
+ /* @__PURE__ */ e.jsx(qt, { children: U?.map((l) => {
592
588
  const S = c ? k?.(l.id) ?? 0 : 0, W = c ? S > 0 : !!l.selected;
593
589
  return /* @__PURE__ */ e.jsxs(
594
- pt,
590
+ gt,
595
591
  {
596
592
  className: Je(
597
593
  "hover:bg-[#f7f7f7]",
@@ -607,13 +603,13 @@ const Rn = ({
607
603
  V,
608
604
  {
609
605
  spacing: 1,
610
- onClick: (G) => G.stopPropagation(),
606
+ onClick: (P) => P.stopPropagation(),
611
607
  children: [
612
608
  /* @__PURE__ */ e.jsx(
613
- ot,
609
+ rt,
614
610
  {
615
611
  "aria-label": "Remove one instance",
616
- icon: /* @__PURE__ */ e.jsx(yn, {}),
612
+ icon: /* @__PURE__ */ e.jsx(Cn, {}),
617
613
  size: "xs",
618
614
  variant: "outline",
619
615
  isDisabled: S === 0,
@@ -631,10 +627,10 @@ const Rn = ({
631
627
  }
632
628
  ),
633
629
  /* @__PURE__ */ e.jsx(
634
- ot,
630
+ rt,
635
631
  {
636
632
  "aria-label": "Add one instance",
637
- icon: /* @__PURE__ */ e.jsx(vn, {}),
633
+ icon: /* @__PURE__ */ e.jsx(wn, {}),
638
634
  size: "xs",
639
635
  variant: "outline",
640
636
  colorScheme: "blue",
@@ -643,30 +639,30 @@ const Rn = ({
643
639
  )
644
640
  ]
645
641
  }
646
- ) : n ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: l.selected ? /* @__PURE__ */ e.jsx(Cn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(wn, { className: "text-gray-400" }) }),
642
+ ) : n ? null : /* @__PURE__ */ e.jsx(e.Fragment, { children: l.selected ? /* @__PURE__ */ e.jsx(In, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(Sn, { className: "text-gray-400" }) }),
647
643
  (l.quantumOwned || !m) && h && /* @__PURE__ */ e.jsx(
648
- te,
644
+ ne,
649
645
  {
650
646
  ml: "1em",
651
647
  size: "sm",
652
648
  variant: "link",
653
649
  colorScheme: "blue",
654
- onClick: (G) => {
655
- G.stopPropagation(), h(l.id);
650
+ onClick: (P) => {
651
+ P.stopPropagation(), h(l.id);
656
652
  },
657
653
  children: "View"
658
654
  }
659
655
  ),
660
656
  !l.quantumOwned && m && /* @__PURE__ */ e.jsx(
661
- te,
657
+ ne,
662
658
  {
663
659
  isDisabled: u,
664
660
  ml: "1em",
665
661
  size: "sm",
666
662
  variant: "link",
667
663
  colorScheme: "blue",
668
- onClick: (G) => {
669
- G.stopPropagation(), m(l.id);
664
+ onClick: (P) => {
665
+ P.stopPropagation(), m(l.id);
670
666
  },
671
667
  children: "Edit"
672
668
  }
@@ -674,7 +670,7 @@ const Rn = ({
674
670
  ] }) }),
675
671
  /* @__PURE__ */ e.jsx(We, { whiteSpace: "break-spaces", children: /* @__PURE__ */ e.jsxs(Me, { align: "center", gap: 2, children: [
676
672
  /* @__PURE__ */ e.jsx(
677
- Pn,
673
+ En,
678
674
  {
679
675
  action: l,
680
676
  quantumIconSrc: f
@@ -682,12 +678,12 @@ const Rn = ({
682
678
  ),
683
679
  l.name
684
680
  ] }) }),
685
- /* @__PURE__ */ e.jsx(We, { maxW: "20rem", whiteSpace: "break-spaces", children: En(l.sensorLocations) }),
681
+ /* @__PURE__ */ e.jsx(We, { maxW: "20rem", whiteSpace: "break-spaces", children: Bn(l.sensorLocations) }),
686
682
  !b && /* @__PURE__ */ e.jsx(We, { maxW: "20rem", children: /* @__PURE__ */ e.jsx(
687
- Gn,
683
+ Pn,
688
684
  {
689
685
  containerProps: { flexWrap: "wrap" },
690
- tags: l.useCases?.map((G) => G.name) ?? []
686
+ tags: l.useCases?.map((P) => P.name) ?? []
691
687
  }
692
688
  ) })
693
689
  ]
@@ -697,7 +693,7 @@ const Rn = ({
697
693
  }) })
698
694
  ] }) })
699
695
  ] });
700
- }, bs = ({
696
+ }, Cs = ({
701
697
  onSave: s,
702
698
  onCancel: t,
703
699
  onError: r,
@@ -706,30 +702,30 @@ const Rn = ({
706
702
  setButtonOnClick: h,
707
703
  quantumOwned: d
708
704
  }) => {
709
- const g = wt(), { getLabel: n } = xe(), o = $(() => ({
705
+ const g = It(), { getLabel: n } = xe(), o = $(() => ({
710
706
  singular: n("action"),
711
707
  plural: n("action_plural"),
712
708
  pluralLowerCase: n("action_plural").toLowerCase(),
713
709
  singularLowerCase: n("action").toLowerCase()
714
710
  }), [n]), [u, y] = q("copy"), [b, w] = q(""), [I, L] = q([]), [f, c] = q(!1), [k] = Ce({
715
- query: Lt
711
+ query: kt
716
712
  }), [x] = Ce({
717
- query: cn,
713
+ query: dn,
718
714
  variables: { groupId: b },
719
715
  pause: !b
720
716
  // Only run when group is selected
721
- }), [, N] = fe(it), [, v] = fe(
722
- kt
723
- ), E = $(() => k.data?.groups ? k.data.groups.map(
724
- (i) => A(Mt, i)
717
+ }), [, N] = fe(lt), [, v] = fe(
718
+ Mt
719
+ ), z = $(() => k.data?.groups ? k.data.groups.map(
720
+ (i) => A(At, i)
725
721
  ) : [], [k.data]), R = $(() => x.data ? x.data.actions.map((a) => {
726
722
  const C = A(ve, a), l = A(
727
- Fe,
723
+ Ge,
728
724
  C.reports
729
725
  ), S = A(
730
726
  Pe,
731
727
  C.categories
732
- ), G = A(
728
+ ), P = A(
733
729
  je,
734
730
  C.metadataGroups
735
731
  ).map((Q) => ({
@@ -744,23 +740,23 @@ const Rn = ({
744
740
  thresholds: A(Te, Q.thresholds)
745
741
  })),
746
742
  categories: S,
747
- metadataGroups: G
743
+ metadataGroups: P
748
744
  };
749
745
  }) : [], [x.data]), O = $(() => R.filter(
750
746
  (i) => I.includes(i.id)
751
- ), [R, I]), K = _(
747
+ ), [R, I]), K = E(
752
748
  (i) => {
753
749
  const a = i?.value || "";
754
750
  w(a), L([]);
755
751
  },
756
752
  []
757
- ), oe = _(
753
+ ), oe = E(
758
754
  (i) => {
759
755
  const a = i.map((C) => C.value);
760
756
  L(a);
761
757
  },
762
758
  []
763
- ), D = _(
759
+ ), G = E(
764
760
  async (i) => {
765
761
  const a = {
766
762
  ...i,
@@ -795,7 +791,7 @@ const Rn = ({
795
791
  throw new Error("No action data returned");
796
792
  },
797
793
  [N, d]
798
- ), ae = _(
794
+ ), ae = E(
799
795
  async (i) => {
800
796
  const a = await v({ id: i.id });
801
797
  if (a.error)
@@ -808,7 +804,7 @@ const Rn = ({
808
804
  throw new Error("No action data returned");
809
805
  },
810
806
  [v]
811
- ), Z = _(async () => {
807
+ ), Z = E(async () => {
812
808
  if (c(!0), !O.length) {
813
809
  const i = new Error(
814
810
  `No ${o.pluralLowerCase} selected for ${u === "copy" ? "copying" : "converting"}`
@@ -819,7 +815,7 @@ const Rn = ({
819
815
  try {
820
816
  const i = [];
821
817
  let a = 0;
822
- const C = u === "copy" ? D : ae, l = u === "copy" ? "copy" : "convert";
818
+ const C = u === "copy" ? G : ae, l = u === "copy" ? "copy" : "convert";
823
819
  for (const S of O)
824
820
  try {
825
821
  const W = await C(S);
@@ -831,10 +827,10 @@ const Rn = ({
831
827
  ), a++;
832
828
  }
833
829
  if (i.length > 0) {
834
- const S = i.length, W = O.length, G = u === "copy" ? "copied" : "converted", Q = u === "copy" ? "copy" : "convert";
830
+ const S = i.length, W = O.length, P = u === "copy" ? "copied" : "converted", Q = u === "copy" ? "copy" : "convert";
835
831
  g({
836
- title: a > 0 ? `Partial ${Q} completed` : `${o.plural} ${G} successfully`,
837
- description: a > 0 ? `${S} of ${W} ${o.pluralLowerCase} ${G} successfully` : `${S} ${S > 1 ? o.pluralLowerCase : o.singularLowerCase} ${G} successfully`,
832
+ title: a > 0 ? `Partial ${Q} completed` : `${o.plural} ${P} successfully`,
833
+ description: a > 0 ? `${S} of ${W} ${o.pluralLowerCase} ${P} successfully` : `${S} ${S > 1 ? o.pluralLowerCase : o.singularLowerCase} ${P} successfully`,
838
834
  status: a > 0 ? "warning" : "success",
839
835
  duration: 3e3,
840
836
  isClosable: !0
@@ -858,13 +854,13 @@ const Rn = ({
858
854
  }, [
859
855
  O,
860
856
  u,
861
- D,
857
+ G,
862
858
  ae,
863
859
  g,
864
860
  s,
865
861
  r,
866
862
  o
867
- ]), T = _(() => {
863
+ ]), T = E(() => {
868
864
  w(""), L([]), y("copy"), t?.();
869
865
  }, [t]);
870
866
  ce(() => {
@@ -878,20 +874,20 @@ const Rn = ({
878
874
  saveButton: Z
879
875
  });
880
876
  }, [h, T, Z]);
881
- const B = $(() => E.map((i) => ({
877
+ const U = $(() => z.map((i) => ({
882
878
  value: i.id,
883
879
  label: i.name
884
- })), [E]), J = $(() => R.filter((i) => u === "copy" ? !0 : !i.quantumOwned).map((i) => ({
880
+ })), [z]), J = $(() => R.filter((i) => u === "copy" ? !0 : !i.quantumOwned).map((i) => ({
885
881
  value: i.id,
886
882
  label: i.name,
887
883
  // Add custom data to identify quantum-owned actions for UI display
888
884
  isQuantumOwned: i.quantumOwned
889
- })), [R, u]), U = k.fetching, Y = x.fetching;
885
+ })), [R, u]), B = k.fetching, Y = x.fetching;
890
886
  return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(ue, { spacing: 6, align: "stretch", children: [
891
887
  d && /* @__PURE__ */ e.jsxs(X, { children: [
892
888
  /* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
893
889
  /* @__PURE__ */ e.jsx(
894
- It,
890
+ St,
895
891
  {
896
892
  value: u,
897
893
  onChange: (i) => {
@@ -932,11 +928,11 @@ const Rn = ({
932
928
  he,
933
929
  {
934
930
  placeholder: "Choose a group...",
935
- options: B,
936
- value: B.find((i) => i.value === b) || null,
931
+ options: U,
932
+ value: U.find((i) => i.value === b) || null,
937
933
  onChange: K,
938
- isLoading: U,
939
- isDisabled: U,
934
+ isLoading: B,
935
+ isDisabled: B,
940
936
  isClearable: !0
941
937
  }
942
938
  ),
@@ -957,7 +953,7 @@ const Rn = ({
957
953
  u === "copy" ? "Copy" : "Convert"
958
954
  ] }),
959
955
  Y ? /* @__PURE__ */ e.jsxs(V, { children: [
960
- /* @__PURE__ */ e.jsx(St, { size: "sm" }),
956
+ /* @__PURE__ */ e.jsx(Lt, { size: "sm" }),
961
957
  /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
962
958
  "Loading ",
963
959
  o.pluralLowerCase,
@@ -982,7 +978,7 @@ const Rn = ({
982
978
  /* @__PURE__ */ e.jsx(M, { children: i.label }),
983
979
  a === "value" && i.isQuantumOwned && /* @__PURE__ */ e.jsx(M, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
984
980
  ] }),
985
- i.isQuantumOwned && a === "menu" && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
981
+ i.isQuantumOwned && a === "menu" && /* @__PURE__ */ e.jsx(Fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
986
982
  ] })
987
983
  }
988
984
  ),
@@ -1022,7 +1018,7 @@ const Rn = ({
1022
1018
  ". ",
1023
1019
  i.name
1024
1020
  ] }),
1025
- i.quantumOwned && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1021
+ i.quantumOwned && /* @__PURE__ */ e.jsx(Fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1026
1022
  ] }),
1027
1023
  /* @__PURE__ */ e.jsxs(
1028
1024
  ue,
@@ -1093,7 +1089,7 @@ const Rn = ({
1093
1089
  ] }),
1094
1090
  !p && /* @__PURE__ */ e.jsxs(Ne, { spacing: 4, justifyContent: "flex-end", children: [
1095
1091
  /* @__PURE__ */ e.jsx(
1096
- te,
1092
+ ne,
1097
1093
  {
1098
1094
  variant: "outline",
1099
1095
  onClick: T,
@@ -1102,7 +1098,7 @@ const Rn = ({
1102
1098
  }
1103
1099
  ),
1104
1100
  /* @__PURE__ */ e.jsxs(
1105
- te,
1101
+ ne,
1106
1102
  {
1107
1103
  colorScheme: u === "copy" ? "blue" : "green",
1108
1104
  onClick: Z,
@@ -1118,7 +1114,7 @@ const Rn = ({
1118
1114
  )
1119
1115
  ] })
1120
1116
  ] }) });
1121
- }, ys = ({
1117
+ }, ws = ({
1122
1118
  onSave: s,
1123
1119
  onCancel: t,
1124
1120
  onError: r,
@@ -1127,7 +1123,7 @@ const Rn = ({
1127
1123
  setButtonOnClick: h,
1128
1124
  quantumOwned: d
1129
1125
  }) => {
1130
- const g = wt(), { getLabel: n } = xe(), o = $(() => ({
1126
+ const g = It(), { getLabel: n } = xe(), o = $(() => ({
1131
1127
  singular: n("module"),
1132
1128
  plural: n("module_plural"),
1133
1129
  pluralLowerCase: n("module_plural").toLowerCase(),
@@ -1138,32 +1134,32 @@ const Rn = ({
1138
1134
  pluralLowerCase: n("action_plural").toLowerCase(),
1139
1135
  singularLowerCase: n("action").toLowerCase()
1140
1136
  }), [n]), [y, b] = q(""), [w, I] = q([]), [L, f] = q(!1), [c, k] = q("copy"), [x] = Ce({
1141
- query: Lt
1137
+ query: kt
1142
1138
  }), [N] = Ce({
1143
- query: dn,
1139
+ query: un,
1144
1140
  variables: { groupId: y },
1145
1141
  pause: !y
1146
1142
  // Only run when group is selected
1147
- }), [, v] = fe(At), [, E] = fe(Ot), [, R] = fe(it), [, O] = fe(
1148
- kt
1143
+ }), [, v] = fe(Ot), [, z] = fe(Tt), [, R] = fe(lt), [, O] = fe(
1144
+ Mt
1149
1145
  ), K = $(() => x.data?.groups ? x.data.groups.map(
1150
- (a) => A(Mt, a)
1146
+ (a) => A(At, a)
1151
1147
  ) : [], [x.data]), oe = $(() => N.data?.modules ? A(
1152
1148
  Ye,
1153
1149
  N.data?.modules
1154
1150
  ).map((C) => {
1155
1151
  const l = A(
1156
- Tt,
1152
+ Nt,
1157
1153
  C.moduleActions
1158
1154
  ), W = A(
1159
1155
  je,
1160
1156
  C.metadataGroups
1161
- ).map((G) => A(be, G.data)).flat();
1157
+ ).map((P) => A(be, P.data)).flat();
1162
1158
  return {
1163
1159
  ...C,
1164
- moduleActions: l.map((G) => ({
1165
- ...G,
1166
- action: A(ve, G.action)
1160
+ moduleActions: l.map((P) => ({
1161
+ ...P,
1162
+ action: A(ve, P.action)
1167
1163
  })),
1168
1164
  categories: A(
1169
1165
  Pe,
@@ -1171,22 +1167,22 @@ const Rn = ({
1171
1167
  ),
1172
1168
  metadataItems: W
1173
1169
  };
1174
- }) : [], [N.data]), D = $(() => oe.filter(
1170
+ }) : [], [N.data]), G = $(() => oe.filter(
1175
1171
  (a) => w.includes(a.id)
1176
- ), [oe, w]), ae = _(
1172
+ ), [oe, w]), ae = E(
1177
1173
  (a) => {
1178
1174
  const C = a?.value || "";
1179
1175
  b(C), I([]);
1180
1176
  },
1181
1177
  []
1182
- ), Z = _(
1178
+ ), Z = E(
1183
1179
  (a) => {
1184
1180
  const C = a.map((l) => l.value);
1185
1181
  I(C);
1186
1182
  },
1187
1183
  []
1188
- ), T = _(async () => {
1189
- if (f(!0), !D.length) {
1184
+ ), T = E(async () => {
1185
+ if (f(!0), !G.length) {
1190
1186
  f(!1);
1191
1187
  const a = new Error(
1192
1188
  `No modules selected for ${c === "convert" ? "converting" : "copying"}`
@@ -1197,11 +1193,11 @@ const Rn = ({
1197
1193
  try {
1198
1194
  const a = [];
1199
1195
  let C = 0;
1200
- for (const l of D)
1196
+ for (const l of G)
1201
1197
  try {
1202
1198
  let S = l.moduleActions.map((W) => W.actionId);
1203
1199
  if (d) {
1204
- const W = l.moduleActions.map((H) => H.action), G = async (H) => {
1200
+ const W = l.moduleActions.map((H) => H.action), P = async (H) => {
1205
1201
  if (c === "copy") {
1206
1202
  if (H.quantumOwned) return H;
1207
1203
  const we = A(
@@ -1214,7 +1210,7 @@ const Rn = ({
1214
1210
  be,
1215
1211
  pe.data
1216
1212
  ).map(($e) => $e.id)).flat(), Be = A(
1217
- Fe,
1213
+ Ge,
1218
1214
  H.reports
1219
1215
  ).map((pe) => ({
1220
1216
  ...pe,
@@ -1256,7 +1252,7 @@ const Rn = ({
1256
1252
  );
1257
1253
  };
1258
1254
  S = (await Promise.all(
1259
- W.map(G)
1255
+ W.map(P)
1260
1256
  )).filter((H) => !!H?.id).map((H) => H.id);
1261
1257
  }
1262
1258
  if (c === "convert") {
@@ -1266,15 +1262,15 @@ const Rn = ({
1266
1262
  actions: S,
1267
1263
  categories: l.categories.map((Q) => Q.id),
1268
1264
  quantumOwned: !0
1269
- }, G = await E({
1265
+ }, P = await z({
1270
1266
  id: l.id,
1271
1267
  input: W
1272
1268
  });
1273
- if (G.error) throw new Error(G.error.message);
1274
- if (G.data?.updateModule) {
1269
+ if (P.error) throw new Error(P.error.message);
1270
+ if (P.data?.updateModule) {
1275
1271
  const Q = A(
1276
1272
  Ye,
1277
- G.data.updateModule
1273
+ P.data.updateModule
1278
1274
  );
1279
1275
  a.push(Q);
1280
1276
  }
@@ -1289,12 +1285,12 @@ const Rn = ({
1289
1285
  categories: l.categories.map((Q) => Q.id),
1290
1286
  quantumOwned: d,
1291
1287
  metadataItemIds: l.metadataItems.map((Q) => Q.id)
1292
- }, G = await v({ input: W });
1293
- if (G.error) throw new Error(G.error.message);
1294
- if (G.data?.createModule) {
1288
+ }, P = await v({ input: W });
1289
+ if (P.error) throw new Error(P.error.message);
1290
+ if (P.data?.createModule) {
1295
1291
  const Q = A(
1296
1292
  Ye,
1297
- G.data.createModule
1293
+ P.data.createModule
1298
1294
  );
1299
1295
  a.push(Q);
1300
1296
  }
@@ -1306,7 +1302,7 @@ const Rn = ({
1306
1302
  ), C++;
1307
1303
  }
1308
1304
  if (a.length > 0) {
1309
- const l = a.length, S = D.length;
1305
+ const l = a.length, S = G.length;
1310
1306
  g({
1311
1307
  title: C > 0 ? `Partial ${c === "convert" ? "convert" : "copy"} completed` : `${o.plural} ${c === "convert" ? "converted" : "copied"} successfully`,
1312
1308
  description: C > 0 ? `${l} of ${S} ${o.plural} ${c === "convert" ? "converted" : "copied"} successfully` : `${l} ${l > 1 ? o.plural : o.singular} ${c === "convert" ? "converted" : "copied"} successfully`,
@@ -1331,9 +1327,9 @@ const Rn = ({
1331
1327
  f(!1);
1332
1328
  }
1333
1329
  }, [
1334
- D,
1330
+ G,
1335
1331
  v,
1336
- E,
1332
+ z,
1337
1333
  g,
1338
1334
  s,
1339
1335
  r,
@@ -1342,24 +1338,24 @@ const Rn = ({
1342
1338
  O,
1343
1339
  c,
1344
1340
  o
1345
- ]), B = _(() => {
1341
+ ]), U = E(() => {
1346
1342
  b(""), I([]), k("copy"), t?.();
1347
1343
  }, [t]);
1348
1344
  ce(() => {
1349
1345
  m && m({
1350
1346
  cancelButton: !1,
1351
- saveButton: D.length === 0 || L
1347
+ saveButton: G.length === 0 || L
1352
1348
  });
1353
- }, [D.length, L, m]), ce(() => {
1349
+ }, [G.length, L, m]), ce(() => {
1354
1350
  h && h({
1355
- cancelButton: B,
1351
+ cancelButton: U,
1356
1352
  saveButton: T
1357
1353
  });
1358
- }, [h, B, T]);
1354
+ }, [h, U, T]);
1359
1355
  const J = $(() => K.map((a) => ({
1360
1356
  value: a.id,
1361
1357
  label: a.name
1362
- })), [K]), U = $(() => oe.filter((a) => c === "copy" ? !0 : !a.quantumOwned).map((a) => ({
1358
+ })), [K]), B = $(() => oe.filter((a) => c === "copy" ? !0 : !a.quantumOwned).map((a) => ({
1363
1359
  value: a.id,
1364
1360
  label: a.name,
1365
1361
  // Add custom data to identify quantum-owned modules
@@ -1369,7 +1365,7 @@ const Rn = ({
1369
1365
  d && /* @__PURE__ */ e.jsxs(X, { children: [
1370
1366
  /* @__PURE__ */ e.jsx(ge, { children: "Operation Mode" }),
1371
1367
  /* @__PURE__ */ e.jsx(
1372
- It,
1368
+ St,
1373
1369
  {
1374
1370
  value: c,
1375
1371
  onChange: (a) => {
@@ -1424,7 +1420,7 @@ const Rn = ({
1424
1420
  y && /* @__PURE__ */ e.jsxs(X, { children: [
1425
1421
  /* @__PURE__ */ e.jsx(ge, { children: c === "convert" ? `Select ${o.plural} to Convert` : `Select ${o.plural} to Copy` }),
1426
1422
  i ? /* @__PURE__ */ e.jsxs(V, { children: [
1427
- /* @__PURE__ */ e.jsx(St, { size: "sm" }),
1423
+ /* @__PURE__ */ e.jsx(Lt, { size: "sm" }),
1428
1424
  /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.600", children: [
1429
1425
  "Loading ",
1430
1426
  o.pluralLowerCase,
@@ -1435,12 +1431,12 @@ const Rn = ({
1435
1431
  he,
1436
1432
  {
1437
1433
  placeholder: c === "convert" ? `Choose ${o.pluralLowerCase} to convert...` : `Choose ${o.pluralLowerCase} to copy...`,
1438
- options: U,
1439
- value: U.filter(
1434
+ options: B,
1435
+ value: B.filter(
1440
1436
  (a) => w.includes(a.value)
1441
1437
  ),
1442
1438
  onChange: Z,
1443
- isDisabled: U.length === 0,
1439
+ isDisabled: B.length === 0,
1444
1440
  isClearable: !0,
1445
1441
  isMulti: !0,
1446
1442
  closeMenuOnSelect: !1,
@@ -1449,11 +1445,11 @@ const Rn = ({
1449
1445
  /* @__PURE__ */ e.jsx(M, { children: a.label }),
1450
1446
  C === "value" && a.isQuantumOwned && /* @__PURE__ */ e.jsx(M, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1451
1447
  ] }),
1452
- a.isQuantumOwned && C === "menu" && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1448
+ a.isQuantumOwned && C === "menu" && /* @__PURE__ */ e.jsx(Fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1453
1449
  ] })
1454
1450
  }
1455
1451
  ),
1456
- U.length === 0 && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1452
+ B.length === 0 && /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", color: "gray.500", mt: 2, children: [
1457
1453
  "No ",
1458
1454
  o.pluralLowerCase,
1459
1455
  " found in this group"
@@ -1470,10 +1466,10 @@ const Rn = ({
1470
1466
  ] })
1471
1467
  ] })
1472
1468
  ] }),
1473
- D.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1474
- /* @__PURE__ */ e.jsx(M, { fontWeight: "semibold", mb: 3, children: D.length === 1 ? `${o.singular} to ${c === "copy" ? "Copy" : "Convert"}` : `${D.length} ${o.plural} to ${c === "copy" ? "Copy" : "Convert"}` }),
1469
+ G.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1470
+ /* @__PURE__ */ e.jsx(M, { fontWeight: "semibold", mb: 3, children: G.length === 1 ? `${o.singular} to ${c === "copy" ? "Copy" : "Convert"}` : `${G.length} ${o.plural} to ${c === "copy" ? "Copy" : "Convert"}` }),
1475
1471
  /* @__PURE__ */ e.jsxs(ue, { align: "start", spacing: 3, children: [
1476
- D.map((a, C) => /* @__PURE__ */ e.jsxs(
1472
+ G.map((a, C) => /* @__PURE__ */ e.jsxs(
1477
1473
  se,
1478
1474
  {
1479
1475
  w: "100%",
@@ -1489,7 +1485,7 @@ const Rn = ({
1489
1485
  ". ",
1490
1486
  a.name
1491
1487
  ] }),
1492
- a.quantumOwned && /* @__PURE__ */ e.jsx(Ge, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1488
+ a.quantumOwned && /* @__PURE__ */ e.jsx(Fe, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1493
1489
  ] }),
1494
1490
  /* @__PURE__ */ e.jsxs(
1495
1491
  ue,
@@ -1521,7 +1517,7 @@ const Rn = ({
1521
1517
  },
1522
1518
  a.id
1523
1519
  )),
1524
- D.length > 1 && /* @__PURE__ */ e.jsx(
1520
+ G.length > 1 && /* @__PURE__ */ e.jsx(
1525
1521
  se,
1526
1522
  {
1527
1523
  w: "100%",
@@ -1532,7 +1528,7 @@ const Rn = ({
1532
1528
  borderColor: "blue.200",
1533
1529
  children: /* @__PURE__ */ e.jsxs(M, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1534
1530
  "Total: ",
1535
- D.length,
1531
+ G.length,
1536
1532
  " ",
1537
1533
  o.pluralLowerCase,
1538
1534
  " will be",
@@ -1541,7 +1537,7 @@ const Rn = ({
1541
1537
  ] })
1542
1538
  }
1543
1539
  ),
1544
- d && D.filter((a) => a.moduleActions.some((C) => !C.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1540
+ d && G.filter((a) => a.moduleActions.some((C) => !C.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1545
1541
  se,
1546
1542
  {
1547
1543
  p: 2,
@@ -1556,39 +1552,39 @@ const Rn = ({
1556
1552
  ] }),
1557
1553
  !p && /* @__PURE__ */ e.jsxs(Ne, { spacing: 4, justifyContent: "flex-end", children: [
1558
1554
  /* @__PURE__ */ e.jsx(
1559
- te,
1555
+ ne,
1560
1556
  {
1561
1557
  variant: "outline",
1562
- onClick: B,
1558
+ onClick: U,
1563
1559
  isDisabled: L,
1564
1560
  children: "Cancel"
1565
1561
  }
1566
1562
  ),
1567
1563
  /* @__PURE__ */ e.jsxs(
1568
- te,
1564
+ ne,
1569
1565
  {
1570
1566
  colorScheme: c === "copy" ? "blue" : "green",
1571
1567
  onClick: T,
1572
- isDisabled: D.length === 0 || L,
1568
+ isDisabled: G.length === 0 || L,
1573
1569
  isLoading: L,
1574
1570
  loadingText: `${c === "copy" ? "Copying" : "Converting"}...`,
1575
1571
  children: [
1576
1572
  c === "copy" ? "Copy" : "Convert",
1577
1573
  " ",
1578
- D.length === 1 ? o.singular : `${D.length} ${o.plural}`
1574
+ G.length === 1 ? o.singular : `${G.length} ${o.plural}`
1579
1575
  ]
1580
1576
  }
1581
1577
  )
1582
1578
  ] })
1583
1579
  ] }) });
1584
- }, $t = rn(void 0), Ee = () => {
1585
- const s = an($t);
1580
+ }, Dt = an(void 0), Ee = () => {
1581
+ const s = ln(Dt);
1586
1582
  if (!s)
1587
1583
  throw new Error(
1588
1584
  "useUpsertModuleFormContext must be used within a UpsertModuleFormProvider"
1589
1585
  );
1590
1586
  return s;
1591
- }, Wn = ({
1587
+ }, qn = ({
1592
1588
  name: s,
1593
1589
  setName: t,
1594
1590
  actions: r,
@@ -1603,20 +1599,20 @@ const Rn = ({
1603
1599
  setSelectedMetadataIds: y,
1604
1600
  ...b
1605
1601
  }) => {
1606
- const w = Kt(), I = $(() => {
1602
+ const w = Ht(), I = $(() => {
1607
1603
  const v = {};
1608
- return p.forEach((E) => {
1609
- v[E.actionId] = (v[E.actionId] ?? 0) + 1;
1604
+ return p.forEach((z) => {
1605
+ v[z.actionId] = (v[z.actionId] ?? 0) + 1;
1610
1606
  }), v;
1611
- }, [p]), L = _(
1607
+ }, [p]), L = E(
1612
1608
  (v) => I[v] ?? 0,
1613
1609
  [I]
1614
1610
  ), f = $(() => r.map((v) => ({
1615
1611
  ...v,
1616
1612
  selected: (I[v.id] ?? 0) > 0
1617
- })), [r, I]), c = $(() => r.reduce((v, E) => (v[E.id] = E, v), {}), [r]), k = _(
1618
- (v, E) => {
1619
- if (E) {
1613
+ })), [r, I]), c = $(() => r.reduce((v, z) => (v[z.id] = z, v), {}), [r]), k = E(
1614
+ (v, z) => {
1615
+ if (z) {
1620
1616
  const R = {
1621
1617
  key: crypto.randomUUID(),
1622
1618
  actionId: v.id,
@@ -1634,12 +1630,12 @@ const Rn = ({
1634
1630
  });
1635
1631
  },
1636
1632
  [m]
1637
- ), x = _(
1633
+ ), x = E(
1638
1634
  (v) => {
1639
1635
  t(v.target.value);
1640
1636
  },
1641
1637
  [t]
1642
- ), N = _(
1638
+ ), N = E(
1643
1639
  (v) => {
1644
1640
  o?.(v.target.value);
1645
1641
  },
@@ -1647,9 +1643,9 @@ const Rn = ({
1647
1643
  );
1648
1644
  return /* @__PURE__ */ e.jsxs(se, { ...b, children: [
1649
1645
  /* @__PURE__ */ e.jsxs(V, { gap: "2rem", children: [
1650
- /* @__PURE__ */ e.jsx(Qn, { name: s ?? "", onInputChange: x }),
1646
+ /* @__PURE__ */ e.jsx(Kn, { name: s ?? "", onInputChange: x }),
1651
1647
  /* @__PURE__ */ e.jsx(
1652
- qn,
1648
+ Hn,
1653
1649
  {
1654
1650
  availableCategories: h,
1655
1651
  value: d,
@@ -1658,21 +1654,21 @@ const Rn = ({
1658
1654
  )
1659
1655
  ] }),
1660
1656
  /* @__PURE__ */ e.jsx(
1661
- Kn,
1657
+ Yn,
1662
1658
  {
1663
1659
  description: n ?? "",
1664
1660
  onInputChange: N
1665
1661
  }
1666
1662
  ),
1667
1663
  /* @__PURE__ */ e.jsx(
1668
- Xn,
1664
+ Vn,
1669
1665
  {
1670
1666
  selectedMetadataIds: u,
1671
1667
  setSelectedMetadataIds: y
1672
1668
  }
1673
1669
  ),
1674
1670
  /* @__PURE__ */ e.jsx(
1675
- Hn,
1671
+ Jn,
1676
1672
  {
1677
1673
  moduleActionEntries: p,
1678
1674
  setModuleActionEntries: m,
@@ -1681,18 +1677,18 @@ const Rn = ({
1681
1677
  }
1682
1678
  ),
1683
1679
  /* @__PURE__ */ e.jsxs(
1684
- Ht,
1680
+ Yt,
1685
1681
  {
1686
1682
  isOpen: w.isOpen,
1687
1683
  onClose: w.onClose,
1688
1684
  size: "6xl",
1689
1685
  children: [
1690
- /* @__PURE__ */ e.jsx(Yt, {}),
1691
- /* @__PURE__ */ e.jsxs(Jt, { children: [
1692
- /* @__PURE__ */ e.jsx(Xt, { children: "Select Activities" }),
1693
- /* @__PURE__ */ e.jsx(Zt, {}),
1694
- /* @__PURE__ */ e.jsx(Vt, { children: /* @__PURE__ */ e.jsx(
1695
- Un,
1686
+ /* @__PURE__ */ e.jsx(Jt, {}),
1687
+ /* @__PURE__ */ e.jsxs(Xt, { children: [
1688
+ /* @__PURE__ */ e.jsx(Zt, { children: "Select Activities" }),
1689
+ /* @__PURE__ */ e.jsx(Vt, {}),
1690
+ /* @__PURE__ */ e.jsx(en, { children: /* @__PURE__ */ e.jsx(
1691
+ Qn,
1696
1692
  {
1697
1693
  actions: f,
1698
1694
  onSelected: k,
@@ -1706,8 +1702,8 @@ const Rn = ({
1706
1702
  }
1707
1703
  }
1708
1704
  ) }),
1709
- /* @__PURE__ */ e.jsx(en, { children: /* @__PURE__ */ e.jsx(
1710
- te,
1705
+ /* @__PURE__ */ e.jsx(tn, { children: /* @__PURE__ */ e.jsx(
1706
+ ne,
1711
1707
  {
1712
1708
  colorScheme: "blue",
1713
1709
  onClick: w.onClose,
@@ -1720,7 +1716,7 @@ const Rn = ({
1720
1716
  }
1721
1717
  )
1722
1718
  ] });
1723
- }, Qn = Ae(
1719
+ }, Kn = Ae(
1724
1720
  ({
1725
1721
  name: s,
1726
1722
  onInputChange: t
@@ -1743,7 +1739,7 @@ const Rn = ({
1743
1739
  )
1744
1740
  ] });
1745
1741
  }
1746
- ), qn = Ae(
1742
+ ), Hn = Ae(
1747
1743
  ({
1748
1744
  availableCategories: s,
1749
1745
  value: t,
@@ -1773,7 +1769,7 @@ const Rn = ({
1773
1769
  )
1774
1770
  ] });
1775
1771
  }
1776
- ), Kn = Ae(
1772
+ ), Yn = Ae(
1777
1773
  ({
1778
1774
  description: s,
1779
1775
  onInputChange: t
@@ -1800,7 +1796,7 @@ const Rn = ({
1800
1796
  )
1801
1797
  ] });
1802
1798
  }
1803
- ), Hn = Ae(
1799
+ ), Jn = Ae(
1804
1800
  ({
1805
1801
  moduleActionEntries: s,
1806
1802
  setModuleActionEntries: t,
@@ -1820,7 +1816,7 @@ const Rn = ({
1820
1816
  key: n.key,
1821
1817
  actionId: n.actionId,
1822
1818
  name: o.name,
1823
- reports: A(Fe, o.reports) || [],
1819
+ reports: A(Ge, o.reports) || [],
1824
1820
  selectedReportId: n.reportId
1825
1821
  } : null;
1826
1822
  }).filter(Boolean),
@@ -1840,7 +1836,7 @@ const Rn = ({
1840
1836
  ] })
1841
1837
  ] }) }),
1842
1838
  !h && /* @__PURE__ */ e.jsxs(
1843
- te,
1839
+ ne,
1844
1840
  {
1845
1841
  size: "sm",
1846
1842
  variant: "solid",
@@ -1861,7 +1857,7 @@ const Rn = ({
1861
1857
  d.moduleLowerCase,
1862
1858
  ".",
1863
1859
  !h && /* @__PURE__ */ e.jsxs(
1864
- te,
1860
+ ne,
1865
1861
  {
1866
1862
  ml: "0.5em",
1867
1863
  size: "sm",
@@ -1876,7 +1872,7 @@ const Rn = ({
1876
1872
  }
1877
1873
  )
1878
1874
  ] }) }) : /* @__PURE__ */ e.jsx(
1879
- Yn,
1875
+ Xn,
1880
1876
  {
1881
1877
  value: g,
1882
1878
  onChange: (n) => {
@@ -1887,7 +1883,7 @@ const Rn = ({
1887
1883
  key: b.key,
1888
1884
  actionId: b.actionId,
1889
1885
  name: w.name,
1890
- reports: A(Fe, w.reports) || [],
1886
+ reports: A(Ge, w.reports) || [],
1891
1887
  selectedReportId: b.reportId
1892
1888
  } : null;
1893
1889
  }).filter(Boolean);
@@ -1904,7 +1900,7 @@ const Rn = ({
1904
1900
  )
1905
1901
  ] });
1906
1902
  }
1907
- ), Yn = Ae(
1903
+ ), Xn = Ae(
1908
1904
  ({
1909
1905
  value: s,
1910
1906
  onChange: t,
@@ -1913,7 +1909,7 @@ const Rn = ({
1913
1909
  }) => {
1914
1910
  const [m] = q(
1915
1911
  () => Math.random().toString(36).substring(2, 15)
1916
- ), h = _(
1912
+ ), h = E(
1917
1913
  (n, o) => {
1918
1914
  r || t((u) => {
1919
1915
  const y = [...u], [b] = y.splice(n, 1);
@@ -1921,7 +1917,7 @@ const Rn = ({
1921
1917
  });
1922
1918
  },
1923
1919
  [t, r]
1924
- ), d = _(
1920
+ ), d = E(
1925
1921
  (n) => {
1926
1922
  p((o) => {
1927
1923
  const u = o.findIndex((I) => I.key === n);
@@ -1935,7 +1931,7 @@ const Rn = ({
1935
1931
  });
1936
1932
  },
1937
1933
  [p]
1938
- ), g = _(
1934
+ ), g = E(
1939
1935
  (n) => {
1940
1936
  p(
1941
1937
  (o) => o.filter((u) => u.key !== n)
@@ -1943,8 +1939,8 @@ const Rn = ({
1943
1939
  },
1944
1940
  [p]
1945
1941
  );
1946
- return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(Sn, { backend: Ln, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: s.map((n, o) => /* @__PURE__ */ e.jsx(
1947
- Jn,
1942
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(kn, { backend: Mn, children: /* @__PURE__ */ e.jsx(ue, { spacing: 3, align: "stretch", children: s.map((n, o) => /* @__PURE__ */ e.jsx(
1943
+ Zn,
1948
1944
  {
1949
1945
  listKey: m,
1950
1946
  item: n,
@@ -1964,7 +1960,7 @@ const Rn = ({
1964
1960
  n.key
1965
1961
  )) }) }) });
1966
1962
  }
1967
- ), Jn = Ae(
1963
+ ), Zn = Ae(
1968
1964
  ({
1969
1965
  listKey: s,
1970
1966
  item: t,
@@ -1975,7 +1971,7 @@ const Rn = ({
1975
1971
  onDuplicate: d,
1976
1972
  onRemove: g
1977
1973
  }) => {
1978
- const n = ln(null), { getLabel: o } = xe(), u = o("action"), [{ handlerId: y }, b] = kn({
1974
+ const n = cn(null), { getLabel: o } = xe(), u = o("action"), [{ handlerId: y }, b] = An({
1979
1975
  accept: s,
1980
1976
  collect: (x) => ({
1981
1977
  handlerId: x.getHandlerId()?.toString() ?? ""
@@ -1983,13 +1979,13 @@ const Rn = ({
1983
1979
  hover: (x, N) => {
1984
1980
  if (!n.current)
1985
1981
  return;
1986
- const v = x.index, E = r;
1987
- if (v === E)
1982
+ const v = x.index, z = r;
1983
+ if (v === z)
1988
1984
  return;
1989
1985
  const R = n.current?.getBoundingClientRect(), O = (R.bottom - R.top) / 2, oe = N.getClientOffset().y - R.top;
1990
- v < E && oe < O || v > E && oe > O || (m(v, E), x.index = E);
1986
+ v < z && oe < O || v > z && oe > O || (m(v, z), x.index = z);
1991
1987
  }
1992
- }), [{ isDragging: w }, I] = Mn({
1988
+ }), [{ isDragging: w }, I] = On({
1993
1989
  type: s,
1994
1990
  item: () => ({ id: t.key, index: r }),
1995
1991
  collect: (x) => ({
@@ -2047,7 +2043,7 @@ const Rn = ({
2047
2043
  ) }),
2048
2044
  !p && /* @__PURE__ */ e.jsxs(V, { spacing: 1, children: [
2049
2045
  /* @__PURE__ */ e.jsx(
2050
- te,
2046
+ ne,
2051
2047
  {
2052
2048
  size: "xs",
2053
2049
  variant: "ghost",
@@ -2058,7 +2054,7 @@ const Rn = ({
2058
2054
  }
2059
2055
  ),
2060
2056
  /* @__PURE__ */ e.jsx(
2061
- te,
2057
+ ne,
2062
2058
  {
2063
2059
  size: "xs",
2064
2060
  variant: "ghost",
@@ -2074,7 +2070,7 @@ const Rn = ({
2074
2070
  }
2075
2071
  );
2076
2072
  }
2077
- ), Xn = Ae(
2073
+ ), Vn = Ae(
2078
2074
  ({
2079
2075
  selectedMetadataIds: s,
2080
2076
  setSelectedMetadataIds: t
@@ -2088,7 +2084,7 @@ const Rn = ({
2088
2084
  { key: "session_type", label: "Session Type", multi: !0 },
2089
2085
  { key: "body_region", label: "Body Region", multi: !0 },
2090
2086
  { key: "sport", label: "Sport", multi: !0 }
2091
- ], [r]), d = _(
2087
+ ], [r]), d = E(
2092
2088
  (g, n) => {
2093
2089
  const o = h.find((y) => y.key === g);
2094
2090
  if (!o) return;
@@ -2127,7 +2123,7 @@ const Rn = ({
2127
2123
  ] }, g.key)) })
2128
2124
  ] }) : null;
2129
2125
  }
2130
- ), Zn = ({
2126
+ ), es = ({
2131
2127
  value: s,
2132
2128
  onChange: t,
2133
2129
  forceKind: r,
@@ -2138,9 +2134,9 @@ const Rn = ({
2138
2134
  ...g
2139
2135
  }) => {
2140
2136
  const n = $(() => [...s].sort((b, w) => {
2141
- const I = bt.indexOf(b.plane), L = bt.indexOf(w.plane);
2137
+ const I = jt.indexOf(b.plane), L = jt.indexOf(w.plane);
2142
2138
  return I - L;
2143
- }), [s]), o = _((b) => "segment" in b.id ? Nt(b.id.segment, b.plane, !0) ?? "Unknown" : Rt(b.id.joint, b.plane, !0) ?? "Unknown", []), u = _(
2139
+ }), [s]), o = E((b) => "segment" in b.id ? Rt(b.id.segment, b.plane, !0) ?? "Unknown" : $t(b.id.joint, b.plane, !0) ?? "Unknown", []), u = E(
2144
2140
  (b, w) => {
2145
2141
  const I = n.findIndex(
2146
2142
  (f) => f.id === w.id && f.plane === w.plane
@@ -2153,7 +2149,7 @@ const Rn = ({
2153
2149
  }))), t(L);
2154
2150
  },
2155
2151
  [t, n, r, d]
2156
- ), y = _(
2152
+ ), y = E(
2157
2153
  (b) => {
2158
2154
  const w = n.filter(
2159
2155
  (I) => I.id !== b.id || I.plane !== b.plane
@@ -2163,7 +2159,7 @@ const Rn = ({
2163
2159
  [t, n]
2164
2160
  );
2165
2161
  return /* @__PURE__ */ e.jsx(ue, { alignItems: "flex-start", overflowY: "auto", ...g, children: n.map((b, w) => /* @__PURE__ */ e.jsx(
2166
- Vn,
2162
+ ts,
2167
2163
  {
2168
2164
  label: o(b),
2169
2165
  parameter: b,
@@ -2175,7 +2171,7 @@ const Rn = ({
2175
2171
  },
2176
2172
  `${JSON.stringify(b.id)}-${b.plane}`
2177
2173
  )) });
2178
- }, Vn = ({
2174
+ }, ts = ({
2179
2175
  label: s,
2180
2176
  parameter: t,
2181
2177
  onChange: r,
@@ -2184,18 +2180,18 @@ const Rn = ({
2184
2180
  disableKind: h,
2185
2181
  isDisabled: d
2186
2182
  }) => {
2187
- const g = _(
2188
- (u) => "joint" in t.id ? An(
2183
+ const g = E(
2184
+ (u) => "joint" in t.id ? Tn(
2189
2185
  t.id.joint,
2190
2186
  t.plane,
2191
2187
  u < 0 ? -1 : 1
2192
- ) : On(
2188
+ ) : Nn(
2193
2189
  t.id.segment,
2194
2190
  t.plane,
2195
2191
  u < 0 ? -1 : 1
2196
2192
  ),
2197
2193
  [t]
2198
- ), { min: n, max: o } = "joint" in t.id ? Tn(t.id.joint, t.plane) : { min: -180, max: 180 };
2194
+ ), { min: n, max: o } = "joint" in t.id ? Rn(t.id.joint, t.plane) : { min: -180, max: 180 };
2199
2195
  return /* @__PURE__ */ e.jsxs(
2200
2196
  ue,
2201
2197
  {
@@ -2223,17 +2219,17 @@ const Rn = ({
2223
2219
  /* @__PURE__ */ e.jsx(Oe, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor" })
2224
2220
  ] }),
2225
2221
  p && !d && /* @__PURE__ */ e.jsx(
2226
- ot,
2222
+ rt,
2227
2223
  {
2228
2224
  size: "xs",
2229
2225
  variant: "ghost",
2230
2226
  "aria-label": "delete",
2231
- icon: /* @__PURE__ */ e.jsx(Ct, { as: In }),
2227
+ icon: /* @__PURE__ */ e.jsx(wt, { as: Ln }),
2232
2228
  onClick: p
2233
2229
  }
2234
2230
  ),
2235
2231
  !m && /* @__PURE__ */ e.jsx(
2236
- $n,
2232
+ Fn,
2237
2233
  {
2238
2234
  selectedItem: t?.kind ?? Xe.Limit,
2239
2235
  onChange: ({ value: u }) => r({ ...t, kind: u }),
@@ -2255,7 +2251,7 @@ const Rn = ({
2255
2251
  )
2256
2252
  ] }),
2257
2253
  /* @__PURE__ */ e.jsx(
2258
- Dn,
2254
+ Gn,
2259
2255
  {
2260
2256
  w: "100%",
2261
2257
  size: "xs",
@@ -2273,7 +2269,7 @@ const Rn = ({
2273
2269
  ]
2274
2270
  }
2275
2271
  );
2276
- }, He = (s, t) => "segment" in s && "segment" in t && s.segment === t.segment || "joint" in s && "joint" in t && s.joint === t.joint, yt = ({
2272
+ }, He = (s, t) => "segment" in s && "segment" in t && s.segment === t.segment || "joint" in s && "joint" in t && s.joint === t.joint, vt = ({
2277
2273
  options: s,
2278
2274
  value: t,
2279
2275
  onChange: r,
@@ -2290,14 +2286,14 @@ const Rn = ({
2290
2286
  return s.forEach((c) => {
2291
2287
  const k = "joint" in c.id;
2292
2288
  let x, N;
2293
- if (k ? (x = Rt(c.id.joint, c.plane, !0) ?? "Unknown", N = `joint:${c.id.joint}`) : (x = Nt(c.id.segment, c.plane, !0) ?? "Unknown", N = `segment:${c.id.segment}`), !f.has(N)) {
2294
- const R = k ? ft(c.id.joint) ?? "Unknown Joint" : ft(c.id.segment) ?? "Unknown Segment";
2289
+ if (k ? (x = $t(c.id.joint, c.plane, !0) ?? "Unknown", N = `joint:${c.id.joint}`) : (x = Rt(c.id.segment, c.plane, !0) ?? "Unknown", N = `segment:${c.id.segment}`), !f.has(N)) {
2290
+ const R = k ? bt(c.id.joint) ?? "Unknown Joint" : bt(c.id.segment) ?? "Unknown Segment";
2295
2291
  f.set(N, {
2296
2292
  label: R,
2297
2293
  options: []
2298
2294
  });
2299
2295
  }
2300
- const v = f.get(N), E = [
2296
+ const v = f.get(N), z = [
2301
2297
  x,
2302
2298
  k ? c.id.joint : c.id.segment,
2303
2299
  c.plane
@@ -2323,7 +2319,7 @@ const Rn = ({
2323
2319
  value: c.id,
2324
2320
  plane: c.plane,
2325
2321
  sensorOnly: c.sensorOnly,
2326
- searchTokens: E
2322
+ searchTokens: z
2327
2323
  });
2328
2324
  }), Array.from(f.values());
2329
2325
  }, [s]), b = $(() => {
@@ -2338,13 +2334,13 @@ const Rn = ({
2338
2334
  })).filter((c) => c.options.length > 0);
2339
2335
  }, [y, t, h]), w = $(() => y.flatMap((c) => c.options).filter(
2340
2336
  (c) => t.some((k) => He(k.id, c.value) && k.plane === c.plane)
2341
- ), [y, t]), I = _((f, c) => {
2337
+ ), [y, t]), I = E((f, c) => {
2342
2338
  if (!c) return !0;
2343
2339
  const k = c.toLowerCase().replace(/\s+|_/g, ""), x = f.data;
2344
2340
  return !x || !x.searchTokens ? !1 : x.searchTokens.some(
2345
2341
  (N) => N.includes(k)
2346
2342
  );
2347
- }, []), L = _(
2343
+ }, []), L = E(
2348
2344
  (f) => {
2349
2345
  const c = f.map((k) => {
2350
2346
  const x = t.find(
@@ -2353,11 +2349,11 @@ const Rn = ({
2353
2349
  (O) => He(O.id, k.value) && O.plane === k.plane
2354
2350
  ), v = h ? t.find(
2355
2351
  (O) => qe(O.id) === qe(k.value) && O.plane === k.plane
2356
- ) : void 0, E = v && !x ? v.min : N && N.min ? N.min : 0, R = v && !x ? v.max : N && N.max ? N.max : 0;
2352
+ ) : void 0, z = v && !x ? v.min : N && N.min ? N.min : 0, R = v && !x ? v.max : N && N.max ? N.max : 0;
2357
2353
  return x ?? {
2358
2354
  id: k.value,
2359
2355
  plane: k.plane,
2360
- min: E,
2356
+ min: z,
2361
2357
  max: R,
2362
2358
  sensorOnly: k.sensorOnly,
2363
2359
  kind: p ?? Xe.Limit
@@ -2389,7 +2385,7 @@ const Rn = ({
2389
2385
  }
2390
2386
  ),
2391
2387
  /* @__PURE__ */ e.jsx(
2392
- Zn,
2388
+ es,
2393
2389
  {
2394
2390
  marginTop: 2,
2395
2391
  maxH: "28rem",
@@ -2402,7 +2398,7 @@ const Rn = ({
2402
2398
  }
2403
2399
  )
2404
2400
  ] });
2405
- }, vt = (s) => {
2401
+ }, Ct = (s) => {
2406
2402
  switch (s) {
2407
2403
  case me.Thorax:
2408
2404
  return "Thorax";
@@ -2415,9 +2411,9 @@ const Rn = ({
2415
2411
  case me.RightThigh:
2416
2412
  return "Right Thigh";
2417
2413
  case me.LeftShank:
2418
- return "Left Shank";
2414
+ return "Left Lower Leg";
2419
2415
  case me.RightShank:
2420
- return "Right Shank";
2416
+ return "Right Lower Leg";
2421
2417
  case me.LeftFoot:
2422
2418
  return "Left Foot";
2423
2419
  case me.RightFoot:
@@ -2433,7 +2429,7 @@ const Rn = ({
2433
2429
  case me.Head:
2434
2430
  return "Head";
2435
2431
  }
2436
- }, vs = ({
2432
+ }, Is = ({
2437
2433
  id: s,
2438
2434
  onError: t,
2439
2435
  onCancel: r,
@@ -2444,8 +2440,8 @@ const Rn = ({
2444
2440
  quantumOwned: g,
2445
2441
  isView: n
2446
2442
  }) => {
2447
- const o = lt(), [{ fetching: u }, y] = fe(it), [{ fetching: b }, w] = fe(un), [{ data: I }] = Ce({
2448
- query: mn,
2443
+ const o = ct(), [{ fetching: u }, y] = fe(lt), [{ fetching: b }, w] = fe(mn), [{ data: I }] = Ce({
2444
+ query: hn,
2449
2445
  variables: { id: s ?? "" },
2450
2446
  pause: !s
2451
2447
  }), L = $(() => {
@@ -2454,14 +2450,14 @@ const Rn = ({
2454
2450
  I?.getActionById
2455
2451
  );
2456
2452
  if (!j) return null;
2457
- const P = (A(Fe, j.reports) || []).map((F) => ({
2453
+ const D = (A(Ge, j.reports) || []).map((F) => ({
2458
2454
  ...F,
2459
2455
  thresholds: A(Te, F.thresholds)
2460
2456
  }));
2461
2457
  return {
2462
2458
  ...j,
2463
2459
  thresholds: A(Te, j.thresholds),
2464
- reports: P
2460
+ reports: D
2465
2461
  };
2466
2462
  }, [I]), f = u || b, c = !!L && !!s, { getLabel: k } = xe(), x = $(() => ({
2467
2463
  action: k("action")
@@ -2476,7 +2472,7 @@ const Rn = ({
2476
2472
  label: "Activity Motion Direction",
2477
2473
  multi: !0
2478
2474
  }
2479
- ], [x.action]), [v, E] = q(""), [R, O] = q(""), [K, oe] = q(""), [D, ae] = q(""), [Z, T] = q([]), [B, J] = q({}), [U, Y] = q(null), [i, a] = q(""), [C, l] = q([]), [S, W] = q([]), [G, Q] = q(""), [H, re] = q([]), we = fn(), Ie = $(() => we.filter((j) => j.sensorOnly), [we]), Se = [
2475
+ ], [x.action]), [v, z] = q(""), [R, O] = q(""), [K, oe] = q(""), [G, ae] = q(""), [Z, T] = q([]), [U, J] = q({}), [B, Y] = q(null), [i, a] = q(""), [C, l] = q([]), [S, W] = q([]), [P, Q] = q(""), [H, re] = q([]), we = bn(), Ie = $(() => we.filter((j) => j.sensorOnly), [we]), Se = [
2480
2476
  {
2481
2477
  label: ke(ie.GeneralActivity),
2482
2478
  value: ie.GeneralActivity
@@ -2497,63 +2493,63 @@ const Rn = ({
2497
2493
  ], ze = $(() => v.trim().length > 0, [v]), [Be, tt] = q({});
2498
2494
  ce(() => {
2499
2495
  const j = N.map(
2500
- (z) => o.query(at, { key: z.key })
2496
+ (_) => o.query(it, { key: _.key })
2501
2497
  );
2502
- Promise.all(j).then((z) => {
2503
- const P = {};
2504
- z.forEach((F) => {
2498
+ Promise.all(j).then((_) => {
2499
+ const D = {};
2500
+ _.forEach((F) => {
2505
2501
  if (F.error || !F.data) return;
2506
- const ne = A(
2502
+ const ee = A(
2507
2503
  je,
2508
2504
  F.data.getMetadataByKey
2509
- ), ee = A(
2505
+ ), te = A(
2510
2506
  be,
2511
- ne.data
2507
+ ee.data
2512
2508
  );
2513
- P[ne.key] = ee.map((de) => ({
2509
+ D[ee.key] = te.map((de) => ({
2514
2510
  label: de.label || de.value,
2515
2511
  value: de.value,
2516
2512
  id: de.id
2517
2513
  }));
2518
- }), J(P);
2514
+ }), J(D);
2519
2515
  });
2520
2516
  }, [o, N]), ce(() => {
2521
2517
  if (L) {
2522
- const z = A(
2518
+ const _ = A(
2523
2519
  je,
2524
2520
  L.metadataGroups
2525
2521
  ).map(
2526
- (ne) => ne.data.map((ee) => A(be, ee).id)
2527
- ), P = L.reports.map((ne) => ({
2528
- id: ne.id,
2529
- name: ne.name ?? "",
2530
- instructions: ne.instructions ?? "",
2531
- kind: ne.reportKind,
2532
- autoGenerate: ne.autoGenerate ?? !1,
2533
- parameters: ne.thresholds.map((ee) => ({
2522
+ (ee) => ee.data.map((te) => A(be, te).id)
2523
+ ), D = L.reports.map((ee) => ({
2524
+ id: ee.id,
2525
+ name: ee.name ?? "",
2526
+ instructions: ee.instructions ?? "",
2527
+ kind: ee.reportKind,
2528
+ autoGenerate: ee.autoGenerate ?? !1,
2529
+ parameters: ee.thresholds.map((te) => ({
2534
2530
  id: {
2535
- [ee.partKind]: ee.partId
2531
+ [te.partKind]: te.partId
2536
2532
  },
2537
- kind: ee.kind,
2538
- min: ee.min,
2539
- max: ee.max,
2540
- plane: ee.partDimension,
2541
- oldId: ee.id,
2533
+ kind: te.kind,
2534
+ min: te.min,
2535
+ max: te.max,
2536
+ plane: te.partDimension,
2537
+ oldId: te.id,
2542
2538
  sensorOnly: Ie.some((de) => {
2543
- const nt = de.id[ee.partKind];
2544
- return nt ? nt === ee.partId && de.plane === ee.partDimension : !1;
2539
+ const nt = de.id[te.partKind];
2540
+ return nt ? nt === te.partId && de.plane === te.partDimension : !1;
2545
2541
  })
2546
2542
  })),
2547
- sensorLocations: ne.sensorLocations
2543
+ sensorLocations: ee.sensorLocations
2548
2544
  })), F = {
2549
2545
  name: L.name,
2550
2546
  description: L.description || "",
2551
2547
  cameraPlacement: L.cameraPlacement || "",
2552
2548
  videoLink: L.videoLink || "",
2553
- metadataIds: z.flat(),
2554
- reports: P
2549
+ metadataIds: _.flat(),
2550
+ reports: D
2555
2551
  };
2556
- E(F.name), O(F.description), oe(F.cameraPlacement), ae(F.videoLink), T(F.metadataIds), re(P), tt(F);
2552
+ z(F.name), O(F.description), oe(F.cameraPlacement), ae(F.videoLink), T(F.metadataIds), re(D), tt(F);
2557
2553
  }
2558
2554
  }, [L]);
2559
2555
  const Re = $(
@@ -2561,7 +2557,7 @@ const Rn = ({
2561
2557
  name: v,
2562
2558
  description: R,
2563
2559
  cameraPlacement: K,
2564
- videoLink: D,
2560
+ videoLink: G,
2565
2561
  metadataIds: Z,
2566
2562
  reports: H
2567
2563
  }),
@@ -2570,33 +2566,33 @@ const Rn = ({
2570
2566
  v,
2571
2567
  R,
2572
2568
  K,
2573
- D,
2569
+ G,
2574
2570
  Z,
2575
2571
  H
2576
2572
  ]
2577
- ), Le = _(() => {
2573
+ ), Le = E(() => {
2578
2574
  const j = {
2579
2575
  name: v,
2580
2576
  description: R,
2581
2577
  cameraPlacement: K,
2582
- videoLink: D,
2578
+ videoLink: G,
2583
2579
  metadataItemIds: Z,
2584
2580
  // Backend requires laterality; keep existing default since UI no longer edits it
2585
- laterality: Nn.Either,
2581
+ laterality: $n.Either,
2586
2582
  quantumOwned: g,
2587
2583
  //Backend requires session type; keep existing default since UI no longer edits it
2588
2584
  sessionType: [],
2589
2585
  // Backend requires thresholds; use empty array since reports handle parameters now
2590
2586
  thresholds: [],
2591
2587
  // Include reports data
2592
- reports: H.map((P) => ({
2593
- id: P.isNew ? void 0 : P.id,
2594
- name: P.name,
2595
- reportKind: P.kind,
2596
- sensorLocations: P.sensorLocations,
2597
- instructions: P.instructions,
2598
- autoGenerate: P.autoGenerate ?? !1,
2599
- thresholds: P.parameters.map((F) => ({
2588
+ reports: H.map((D) => ({
2589
+ id: D.isNew ? void 0 : D.id,
2590
+ name: D.name,
2591
+ reportKind: D.kind,
2592
+ sensorLocations: D.sensorLocations,
2593
+ instructions: D.instructions,
2594
+ autoGenerate: D.autoGenerate ?? !1,
2595
+ thresholds: D.parameters.map((F) => ({
2600
2596
  id: F.oldId,
2601
2597
  kind: F.kind,
2602
2598
  min: F.min,
@@ -2607,14 +2603,14 @@ const Rn = ({
2607
2603
  }))
2608
2604
  }))
2609
2605
  };
2610
- let z;
2611
- c && s ? z = w({
2606
+ let _;
2607
+ c && s ? _ = w({
2612
2608
  id: s,
2613
2609
  fields: j
2614
- }) : z = y({
2610
+ }) : _ = y({
2615
2611
  fields: j
2616
- }), z.then(({ error: P }) => {
2617
- P ? t(P) : p();
2612
+ }), _.then(({ error: D }) => {
2613
+ D ? t(D) : p();
2618
2614
  });
2619
2615
  }, [
2620
2616
  g,
@@ -2624,7 +2620,7 @@ const Rn = ({
2624
2620
  v,
2625
2621
  R,
2626
2622
  K,
2627
- D,
2623
+ G,
2628
2624
  Z,
2629
2625
  H,
2630
2626
  c,
@@ -2643,63 +2639,63 @@ const Rn = ({
2643
2639
  } : Le
2644
2640
  });
2645
2641
  }, [h, r, Le, n]);
2646
- const pe = _(
2642
+ const pe = E(
2647
2643
  (j) => {
2648
- const z = jt(
2644
+ const _ = yt(
2649
2645
  j.map(
2650
- (P) => "joint" in P.id ? P.id.joint : P.id.segment
2646
+ (D) => "joint" in D.id ? D.id.joint : D.id.segment
2651
2647
  )
2652
2648
  );
2653
- W(z);
2649
+ W(_);
2654
2650
  },
2655
2651
  []
2656
2652
  );
2657
2653
  ce(() => {
2658
2654
  pe(C);
2659
2655
  }, [C, pe]);
2660
- const $e = _(() => {
2661
- if (!U || !i.trim())
2656
+ const $e = E(() => {
2657
+ if (!B || !i.trim())
2662
2658
  return;
2663
- const j = U === ie.PointOfInterest, z = {
2659
+ const j = B === ie.PointOfInterest, _ = {
2664
2660
  id: Date.now().toString(),
2665
2661
  // Temporary ID
2666
2662
  name: i.trim(),
2667
- kind: U,
2663
+ kind: B,
2668
2664
  parameters: j ? [] : C,
2669
2665
  sensorLocations: j ? [] : S,
2670
- instructions: j ? G : "",
2666
+ instructions: j ? P : "",
2671
2667
  autoGenerate: !1,
2672
2668
  isNew: !0
2673
2669
  };
2674
- re((P) => [...P, z]), Y(null), a(""), l([]), W([]), Q("");
2670
+ re((D) => [...D, _]), Y(null), a(""), l([]), W([]), Q("");
2675
2671
  }, [
2676
- U,
2672
+ B,
2677
2673
  i,
2678
2674
  C,
2679
2675
  S,
2680
- G
2681
- ]), Dt = _((j) => {
2682
- re((z) => z.filter((P) => P.id !== j));
2683
- }, []), Gt = (j, z) => {
2684
- const P = N.find((ne) => ne.key === j);
2685
- if (!P) return;
2686
- const F = P.multi ? (z ?? []).map(
2687
- (ne) => ne.id
2688
- ) : z ? [z.id] : [];
2689
- T((ne) => [...ne.filter((de) => Object.values(B).flat().find((Ue) => Ue.id === de) && !Object.keys(B).find(
2690
- (Ue) => B[Ue]?.some(
2691
- (Ft) => Ft.id === de && Ue === j
2676
+ P
2677
+ ]), Ft = E((j) => {
2678
+ re((_) => _.filter((D) => D.id !== j));
2679
+ }, []), Gt = (j, _) => {
2680
+ const D = N.find((ee) => ee.key === j);
2681
+ if (!D) return;
2682
+ const F = D.multi ? (_ ?? []).map(
2683
+ (ee) => ee.id
2684
+ ) : _ ? [_.id] : [];
2685
+ T((ee) => [...ee.filter((de) => Object.values(U).flat().find((Ue) => Ue.id === de) && !Object.keys(U).find(
2686
+ (Ue) => U[Ue]?.some(
2687
+ (Pt) => Pt.id === de && Ue === j
2692
2688
  )
2693
2689
  )), ...F]);
2694
2690
  };
2695
2691
  return /* @__PURE__ */ e.jsxs(ue, { spacing: 4, w: "full", align: "stretch", children: [
2696
- /* @__PURE__ */ e.jsxs(tn, { children: [
2697
- /* @__PURE__ */ e.jsxs(nn, { children: [
2698
- /* @__PURE__ */ e.jsx(gt, { children: "Activity Configuration" }),
2699
- /* @__PURE__ */ e.jsx(gt, { children: "Reports Configuration" })
2700
- ] }),
2692
+ /* @__PURE__ */ e.jsxs(nn, { children: [
2701
2693
  /* @__PURE__ */ e.jsxs(sn, { children: [
2702
- /* @__PURE__ */ e.jsx(xt, { px: 0, children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
2694
+ /* @__PURE__ */ e.jsx(xt, { children: "Activity Configuration" }),
2695
+ /* @__PURE__ */ e.jsx(xt, { children: "Reports Configuration" })
2696
+ ] }),
2697
+ /* @__PURE__ */ e.jsxs(on, { children: [
2698
+ /* @__PURE__ */ e.jsx(ft, { px: 0, children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [
2703
2699
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2704
2700
  /* @__PURE__ */ e.jsxs(X, { children: [
2705
2701
  /* @__PURE__ */ e.jsx(le, { children: "Name" }),
@@ -2707,7 +2703,7 @@ const Rn = ({
2707
2703
  ye,
2708
2704
  {
2709
2705
  value: v,
2710
- onChange: (j) => E(j.target.value),
2706
+ onChange: (j) => z(j.target.value),
2711
2707
  type: "text",
2712
2708
  placeholder: "i.e. Lunge & Return",
2713
2709
  isDisabled: n
@@ -2732,7 +2728,7 @@ const Rn = ({
2732
2728
  /* @__PURE__ */ e.jsx(
2733
2729
  ye,
2734
2730
  {
2735
- value: D,
2731
+ value: G,
2736
2732
  onChange: (j) => ae(j.target.value),
2737
2733
  type: "url",
2738
2734
  placeholder: "(optional) https://...",
@@ -2762,13 +2758,13 @@ const Rn = ({
2762
2758
  he,
2763
2759
  {
2764
2760
  isMulti: j.multi,
2765
- value: B[j.key]?.filter(
2766
- (z) => Z.includes(z.id)
2761
+ value: U[j.key]?.filter(
2762
+ (_) => Z.includes(_.id)
2767
2763
  ),
2768
- onChange: (z) => {
2769
- Gt(j.key, z);
2764
+ onChange: (_) => {
2765
+ Gt(j.key, _);
2770
2766
  },
2771
- options: B[j.key],
2767
+ options: U[j.key],
2772
2768
  placeholder: `Select ${j.multi ? "one or more" : "one"} ${j.label.toLowerCase()}`,
2773
2769
  isDisabled: n,
2774
2770
  isClearable: j.multi
@@ -2777,7 +2773,7 @@ const Rn = ({
2777
2773
  ] }, j.key))
2778
2774
  ] })
2779
2775
  ] }) }),
2780
- /* @__PURE__ */ e.jsx(xt, { px: 0, children: /* @__PURE__ */ e.jsxs(
2776
+ /* @__PURE__ */ e.jsx(ft, { px: 0, children: /* @__PURE__ */ e.jsxs(
2781
2777
  "div",
2782
2778
  {
2783
2779
  className: Je(
@@ -2806,10 +2802,17 @@ const Rn = ({
2806
2802
  /* @__PURE__ */ e.jsx(
2807
2803
  he,
2808
2804
  {
2809
- value: U ? Se.find(
2810
- (j) => j.value === U
2805
+ value: B ? Se.find(
2806
+ (j) => j.value === B
2811
2807
  ) : null,
2812
- onChange: (j) => Y(j?.value || null),
2808
+ onChange: (j) => {
2809
+ const _ = j?.value || null;
2810
+ Y(_);
2811
+ const D = ot(_);
2812
+ D && l(
2813
+ (F) => F.map((ee) => ({ ...ee, kind: D }))
2814
+ );
2815
+ },
2813
2816
  options: Se,
2814
2817
  placeholder: "Select report type...",
2815
2818
  isDisabled: n,
@@ -2817,15 +2820,16 @@ const Rn = ({
2817
2820
  }
2818
2821
  )
2819
2822
  ] }),
2820
- U !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2823
+ B !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2821
2824
  /* @__PURE__ */ e.jsxs(X, { children: [
2822
2825
  /* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
2823
2826
  /* @__PURE__ */ e.jsx(
2824
- yt,
2827
+ vt,
2825
2828
  {
2826
2829
  options: we,
2827
2830
  value: C,
2828
2831
  onChange: l,
2832
+ forceKind: ot(B),
2829
2833
  editOnly: n
2830
2834
  }
2831
2835
  )
@@ -2836,7 +2840,7 @@ const Rn = ({
2836
2840
  ye,
2837
2841
  {
2838
2842
  value: S.map(
2839
- (j) => vt(j)
2843
+ (j) => Ct(j)
2840
2844
  ).join(", "),
2841
2845
  placeholder: "Auto-filled based on parameters...",
2842
2846
  isDisabled: !0
@@ -2844,12 +2848,12 @@ const Rn = ({
2844
2848
  )
2845
2849
  ] })
2846
2850
  ] }),
2847
- U === ie.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
2851
+ B === ie.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
2848
2852
  /* @__PURE__ */ e.jsx(le, { children: "Instructions" }),
2849
2853
  /* @__PURE__ */ e.jsx(
2850
2854
  Qe,
2851
2855
  {
2852
- value: G,
2856
+ value: P,
2853
2857
  onChange: (j) => Q(j.target.value),
2854
2858
  rows: 3,
2855
2859
  placeholder: "Enter specific instructions for this report...",
@@ -2858,11 +2862,11 @@ const Rn = ({
2858
2862
  )
2859
2863
  ] }),
2860
2864
  /* @__PURE__ */ e.jsx("div", { className: "w-full flex justify-end", children: /* @__PURE__ */ e.jsx(
2861
- te,
2865
+ ne,
2862
2866
  {
2863
2867
  colorScheme: "blue",
2864
2868
  onClick: $e,
2865
- isDisabled: !U || !i.trim() || n || Se.length === 0 || U !== ie.PointOfInterest && C.length === 0,
2869
+ isDisabled: !B || !i.trim() || n || Se.length === 0 || B !== ie.PointOfInterest && C.length === 0,
2866
2870
  children: "Add Report"
2867
2871
  }
2868
2872
  ) })
@@ -2877,12 +2881,12 @@ const Rn = ({
2877
2881
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start", children: [
2878
2882
  /* @__PURE__ */ e.jsx(M, { fontSize: "sm", color: "gray.600", children: ke(j.kind) }),
2879
2883
  !n && /* @__PURE__ */ e.jsx(
2880
- te,
2884
+ ne,
2881
2885
  {
2882
2886
  size: "xs",
2883
2887
  colorScheme: "red",
2884
2888
  variant: "ghost",
2885
- onClick: () => Dt(j.id),
2889
+ onClick: () => Ft(j.id),
2886
2890
  children: "Remove"
2887
2891
  }
2888
2892
  )
@@ -2893,9 +2897,9 @@ const Rn = ({
2893
2897
  ye,
2894
2898
  {
2895
2899
  value: j.name,
2896
- onChange: (z) => re(
2897
- (P) => P.map(
2898
- (F) => F.id === j.id ? { ...F, name: z.target.value } : F
2900
+ onChange: (_) => re(
2901
+ (D) => D.map(
2902
+ (F) => F.id === j.id ? { ...F, name: _.target.value } : F
2899
2903
  )
2900
2904
  ),
2901
2905
  placeholder: "Enter report name...",
@@ -2913,13 +2917,13 @@ const Rn = ({
2913
2917
  }
2914
2918
  ),
2915
2919
  /* @__PURE__ */ e.jsx(
2916
- on,
2920
+ rn,
2917
2921
  {
2918
2922
  id: `auto-generate-${j.id}`,
2919
2923
  isChecked: j.autoGenerate ?? !1,
2920
- onChange: (z) => re(
2921
- (P) => P.map(
2922
- (F) => F.id === j.id ? { ...F, autoGenerate: z.target.checked } : F
2924
+ onChange: (_) => re(
2925
+ (D) => D.map(
2926
+ (F) => F.id === j.id ? { ...F, autoGenerate: _.target.checked } : F
2923
2927
  )
2924
2928
  ),
2925
2929
  isDisabled: n
@@ -2932,9 +2936,9 @@ const Rn = ({
2932
2936
  Qe,
2933
2937
  {
2934
2938
  value: j.instructions,
2935
- onChange: (z) => re(
2936
- (P) => P.map(
2937
- (F) => F.id === j.id ? { ...F, instructions: z.target.value } : F
2939
+ onChange: (_) => re(
2940
+ (D) => D.map(
2941
+ (F) => F.id === j.id ? { ...F, instructions: _.target.value } : F
2938
2942
  )
2939
2943
  ),
2940
2944
  rows: 3,
@@ -2946,15 +2950,18 @@ const Rn = ({
2946
2950
  j.kind !== ie.PointOfInterest && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
2947
2951
  /* @__PURE__ */ e.jsx(le, { children: "Default Parameters" }),
2948
2952
  /* @__PURE__ */ e.jsx(
2949
- yt,
2953
+ vt,
2950
2954
  {
2951
2955
  options: we,
2956
+ forceKind: ot(
2957
+ j.kind
2958
+ ),
2952
2959
  value: j.parameters,
2953
- onChange: (z) => {
2954
- const P = (ee) => "joint" in ee.id ? ee.id.joint : ee.id.segment, F = z.map(P), ne = jt(F);
2960
+ onChange: (_) => {
2961
+ const D = (te) => "joint" in te.id ? te.id.joint : te.id.segment, F = _.map(D), ee = yt(F);
2955
2962
  re(
2956
- (ee) => ee.map(
2957
- (de) => de.id === j.id ? { ...de, parameters: z, sensorLocations: ne } : de
2963
+ (te) => te.map(
2964
+ (de) => de.id === j.id ? { ...de, parameters: _, sensorLocations: ee } : de
2958
2965
  )
2959
2966
  );
2960
2967
  },
@@ -2966,7 +2973,7 @@ const Rn = ({
2966
2973
  "Sensors:",
2967
2974
  " ",
2968
2975
  j.sensorLocations.map(
2969
- (z) => vt(z)
2976
+ (_) => Ct(_)
2970
2977
  ).join(", ")
2971
2978
  ] })
2972
2979
  ]
@@ -2985,9 +2992,9 @@ const Rn = ({
2985
2992
  justify: "end",
2986
2993
  className: Je((m || n) && "!hidden"),
2987
2994
  children: /* @__PURE__ */ e.jsxs(Ne, { gap: 4, children: [
2988
- /* @__PURE__ */ e.jsx(te, { colorScheme: "gray", isDisabled: f, onClick: r, children: "Cancel" }),
2995
+ /* @__PURE__ */ e.jsx(ne, { colorScheme: "gray", isDisabled: f, onClick: r, children: "Cancel" }),
2989
2996
  /* @__PURE__ */ e.jsx(
2990
- te,
2997
+ ne,
2991
2998
  {
2992
2999
  colorScheme: "blue",
2993
3000
  isDisabled: f || !ze || !Re,
@@ -3000,17 +3007,17 @@ const Rn = ({
3000
3007
  }
3001
3008
  )
3002
3009
  ] });
3003
- }, le = ({ children: s }) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), es = ({
3010
+ }, le = ({ children: s }) => /* @__PURE__ */ e.jsx(_e, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: s }), ns = ({
3004
3011
  children: s,
3005
3012
  isView: t,
3006
3013
  metadataKeys: r
3007
3014
  }) => {
3008
- const [p, m] = q({}), h = lt();
3015
+ const [p, m] = q({}), h = ct();
3009
3016
  return ce(() => {
3010
3017
  let d = !1;
3011
3018
  return (async () => {
3012
3019
  const n = (r ?? []).map(
3013
- (y) => h.query(at, { key: y }).toPromise()
3020
+ (y) => h.query(it, { key: y }).toPromise()
3014
3021
  ), o = await Promise.all(n), u = {};
3015
3022
  for (const y of o) {
3016
3023
  if (y.error || !y.data?.getMetadataByKey) continue;
@@ -3030,8 +3037,8 @@ const Rn = ({
3030
3037
  })(), () => {
3031
3038
  d = !0;
3032
3039
  };
3033
- }, [h, r]), /* @__PURE__ */ e.jsx($t.Provider, { value: { isView: t, metadataOptions: p }, children: s });
3034
- }, Cs = ({
3040
+ }, [h, r]), /* @__PURE__ */ e.jsx(Dt.Provider, { value: { isView: t, metadataOptions: p }, children: s });
3041
+ }, Ss = ({
3035
3042
  id: s,
3036
3043
  onCancel: t,
3037
3044
  onSave: r,
@@ -3043,20 +3050,20 @@ const Rn = ({
3043
3050
  isView: n
3044
3051
  }) => {
3045
3052
  const [{ data: o, fetching: u }] = Ce({
3046
- query: h ? hn : pn
3053
+ query: h ? pn : gn
3047
3054
  }), [{ data: y }] = Ce({
3048
- query: gn,
3055
+ query: xn,
3049
3056
  variables: { id: s },
3050
3057
  pause: !s
3051
3058
  }), [{ data: b }] = Ce({
3052
- query: xn
3059
+ query: fn
3053
3060
  }), w = A(
3054
3061
  Pe,
3055
3062
  b?.moduleCategories
3056
- ), [{ fetching: I }, L] = fe(Ot), [{ fetching: f }, c] = fe(At), k = $(() => !o || u ? [] : A(
3063
+ ), [{ fetching: I }, L] = fe(Tt), [{ fetching: f }, c] = fe(Ot), k = $(() => !o || u ? [] : A(
3057
3064
  ve,
3058
3065
  h ? o?.quantumOwnedActions ?? [] : o?.actions ?? []
3059
- ).filter((U) => !!U?.id), [o, h, u]), x = A(Ye, y?.module), N = $(() => A(Tt, x?.moduleActions) ?? [], [x?.moduleActions]), [v, E] = q([]), [R, O] = q(x?.name ?? ""), [K, oe] = q([]), [D, ae] = q(x?.description ?? ""), [Z, T] = q([]);
3066
+ ).filter((B) => !!B?.id), [o, h, u]), x = A(Ye, y?.module), N = $(() => A(Nt, x?.moduleActions) ?? [], [x?.moduleActions]), [v, z] = q([]), [R, O] = q(x?.name ?? ""), [K, oe] = q([]), [G, ae] = q(x?.description ?? ""), [Z, T] = q([]);
3060
3067
  ce(() => {
3061
3068
  if (x) {
3062
3069
  const J = N.map((i, a) => ({
@@ -3064,7 +3071,7 @@ const Rn = ({
3064
3071
  actionId: i.actionId,
3065
3072
  reportId: i.reportId || null
3066
3073
  }));
3067
- E(J), O(x.name), ae(x.description ?? ""), oe(
3074
+ z(J), O(x.name), ae(x.description ?? ""), oe(
3068
3075
  x.categories.map(
3069
3076
  (i) => A(Pe, i).id
3070
3077
  ) ?? []
@@ -3078,24 +3085,24 @@ const Rn = ({
3078
3085
  T(Y.flat());
3079
3086
  }
3080
3087
  }, [x, N]);
3081
- const B = _(() => {
3088
+ const U = E(() => {
3082
3089
  let J;
3083
- const U = {
3090
+ const B = {
3084
3091
  moduleActions: v.map((Y) => ({
3085
3092
  actionId: Y.actionId,
3086
3093
  reportId: Y.reportId ?? void 0
3087
3094
  })),
3088
3095
  name: R,
3089
3096
  categories: K,
3090
- description: D,
3097
+ description: G,
3091
3098
  quantumOwned: h,
3092
3099
  metadataItemIds: Z
3093
3100
  };
3094
3101
  x ? J = L({
3095
3102
  id: x.id,
3096
- input: U
3103
+ input: B
3097
3104
  }) : J = c({
3098
- input: U
3105
+ input: B
3099
3106
  }), J.then(({ error: Y }) => {
3100
3107
  Y ? p(Y instanceof Error ? Y : new Error(String(Y))) : r();
3101
3108
  });
@@ -3104,7 +3111,7 @@ const Rn = ({
3104
3111
  L,
3105
3112
  v,
3106
3113
  R,
3107
- D,
3114
+ G,
3108
3115
  K,
3109
3116
  Z,
3110
3117
  x,
@@ -3115,31 +3122,31 @@ const Rn = ({
3115
3122
  return ce(() => {
3116
3123
  g && g({
3117
3124
  cancelButton: I || f,
3118
- saveButton: I || f || !R || D.trim().split(/\s+/).filter(Boolean).length > 40
3125
+ saveButton: I || f || !R || G.trim().split(/\s+/).filter(Boolean).length > 40
3119
3126
  });
3120
- }, [g, I, f, v, R, D]), ce(() => {
3127
+ }, [g, I, f, v, R, G]), ce(() => {
3121
3128
  d && d({
3122
3129
  cancelButton: t,
3123
- saveButton: B
3130
+ saveButton: U
3124
3131
  });
3125
- }, [d, t, B]), /* @__PURE__ */ e.jsx(se, { width: "100%", children: /* @__PURE__ */ e.jsxs(
3126
- es,
3132
+ }, [d, t, U]), /* @__PURE__ */ e.jsx(se, { width: "100%", children: /* @__PURE__ */ e.jsxs(
3133
+ ns,
3127
3134
  {
3128
3135
  isView: n,
3129
3136
  metadataKeys: ["activity_type", "session_type", "body_region", "sport"],
3130
3137
  children: [
3131
3138
  /* @__PURE__ */ e.jsx(
3132
- Wn,
3139
+ qn,
3133
3140
  {
3134
3141
  name: R,
3135
3142
  setName: O,
3136
3143
  actions: k,
3137
3144
  moduleActionEntries: v,
3138
- setModuleActionEntries: E,
3145
+ setModuleActionEntries: z,
3139
3146
  availableCategories: w ?? [],
3140
3147
  selectedCategoryIds: K,
3141
3148
  setSelectedCategoryIds: oe,
3142
- description: D,
3149
+ description: G,
3143
3150
  setDescription: ae,
3144
3151
  selectedMetadataIds: Z,
3145
3152
  setSelectedMetadataIds: T
@@ -3147,7 +3154,7 @@ const Rn = ({
3147
3154
  ),
3148
3155
  !m && !n && /* @__PURE__ */ e.jsx(V, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Ne, { mt: 16, gap: 4, children: [
3149
3156
  /* @__PURE__ */ e.jsx(
3150
- te,
3157
+ ne,
3151
3158
  {
3152
3159
  colorScheme: "gray",
3153
3160
  isDisabled: I || f,
@@ -3156,12 +3163,12 @@ const Rn = ({
3156
3163
  }
3157
3164
  ),
3158
3165
  /* @__PURE__ */ e.jsx(
3159
- te,
3166
+ ne,
3160
3167
  {
3161
3168
  colorScheme: "blue",
3162
- isDisabled: I || f || !R || D.trim().split(/\s+/).filter(Boolean).length > 40,
3169
+ isDisabled: I || f || !R || G.trim().split(/\s+/).filter(Boolean).length > 40,
3163
3170
  isLoading: I || f,
3164
- onClick: B,
3171
+ onClick: U,
3165
3172
  children: "Save"
3166
3173
  }
3167
3174
  )
@@ -3171,12 +3178,12 @@ const Rn = ({
3171
3178
  ) });
3172
3179
  };
3173
3180
  export {
3174
- Un as ActivityList,
3175
- bs as CopyActivityForm,
3176
- ys as CopyModuleForm,
3177
- Wn as ModuleForm,
3178
- Zn as ParameterEditList,
3179
- yt as ParameterEditSelect,
3180
- vs as UpsertActivityForm,
3181
- Cs as UpsertModuleForm
3181
+ Qn as ActivityList,
3182
+ Cs as CopyActivityForm,
3183
+ ws as CopyModuleForm,
3184
+ qn as ModuleForm,
3185
+ es as ParameterEditList,
3186
+ vt as ParameterEditSelect,
3187
+ Is as UpsertActivityForm,
3188
+ Ss as UpsertModuleForm
3182
3189
  };