quantum-component-library 1.4.50-dev.0 → 1.4.50-dev.2

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 (33) hide show
  1. package/dist/components.cjs +1 -1
  2. package/dist/components.js +549 -543
  3. package/dist/{dnd-core-vendor-BtUZf9Ev.cjs → dnd-core-vendor-CewhYmpg.cjs} +1 -1
  4. package/dist/{dnd-core-vendor-DLG1XK6O.js → dnd-core-vendor-MevRgDB0.js} +2 -2
  5. package/dist/{graphql-vendor-BYC3nhzS.cjs → graphql-vendor-BppBsUpc.cjs} +1 -1
  6. package/dist/{graphql-vendor-N74bYJtL.js → graphql-vendor-uvLTmCiR.js} +1 -1
  7. package/dist/hooks.cjs +1 -1
  8. package/dist/hooks.js +80 -98
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.js +3 -3
  11. package/dist/lib/hooks/use-all-part-parameters.d.ts +1 -8
  12. package/dist/lib/types/parameters.d.ts +1 -0
  13. package/dist/{lodash-vendor-l9HldpVa.js → lodash-vendor-B-xpwrnm.js} +1 -1
  14. package/dist/{lodash-vendor-C3e6C_PJ.cjs → lodash-vendor-CWf2psR2.cjs} +1 -1
  15. package/dist/{other-q0es350N.cjs → other-Cad4iUZr.cjs} +1 -1
  16. package/dist/{other-DE6uy3y4.js → other-OzryMihZ.js} +2 -2
  17. package/dist/{react-dnd-vendor-BDOGawvX.js → react-dnd-vendor-BYAS_HOo.js} +2 -2
  18. package/dist/{react-dnd-vendor-BGRUqrp9.cjs → react-dnd-vendor-BqsnzPKT.cjs} +1 -1
  19. package/dist/{react-select-vendor-C3wpaSL1.js → react-select-vendor-_26lPW2Z.js} +1 -1
  20. package/dist/{react-select-vendor-CZ69mhgt.cjs → react-select-vendor-sW1B_api.cjs} +1 -1
  21. package/dist/{services-human-CGLf7B6Q.cjs → services-human-B4_65njx.cjs} +1 -1
  22. package/dist/{services-human-CI19qLdG.js → services-human-BIz3wOu_.js} +6 -6
  23. package/dist/services.cjs +1 -1
  24. package/dist/services.js +1 -1
  25. package/dist/types.cjs +1 -1
  26. package/dist/types.js +3 -3
  27. package/dist/{utils-conversion-sLq5wEdq.cjs → utils-conversion-BYVStK4S.cjs} +1 -1
  28. package/dist/{utils-conversion-zKwO4dYF.js → utils-conversion-pcEG40AR.js} +1 -1
  29. package/dist/utils.cjs +1 -1
  30. package/dist/utils.js +1 -1
  31. package/dist/{vendor--D-cya0B.js → vendor-BHWxqW4x.js} +1 -1
  32. package/dist/{vendor-jpI6KZW2.cjs → vendor-Dj-hzYUa.cjs} +1 -1
  33. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
- import { Flex as ye, InputGroup as st, InputLeftElement as Ft, Icon as gt, Input as we, FormLabel as xt, Box as ne, TableContainer as jt, Table as ft, Thead as bt, Tr as Ue, Th as be, Tbody as yt, Td as Ce, ButtonGroup as Le, Tooltip as Ve, Button as V, RangeSlider as $t, RangeSliderMark as Ze, Text as S, RangeSliderTrack as Dt, RangeSliderFilledTrack as Pt, RangeSliderThumb as rt, Select as ot, NumberInput as at, NumberInputField as it, HStack as oe, Tag as Ne, Image as Et, useToast as vt, VStack as le, FormControl as X, RadioGroup as Ct, Radio as Qe, Alert as qe, AlertIcon as Ke, Spinner as wt, useDisclosure as Gt, Modal as _t, ModalOverlay as zt, ModalContent as Bt, ModalHeader as Wt, ModalCloseButton as Ut, ModalBody as Qt, ModalFooter as qt, Badge as St, IconButton as Kt, Tabs as Yt, TabList as Ht, Tab as lt, TabPanels as Jt, TabPanel as ct, Textarea as Pe } from "@chakra-ui/react";
3
- import { useMemo as T, useState as _, useCallback as P, useRef as Xt, useEffect as ce, memo as Je } from "react";
2
+ import { Flex as ye, InputGroup as st, InputLeftElement as Ft, Icon as gt, Input as we, FormLabel as xt, Box as se, TableContainer as jt, Table as ft, Thead as bt, Tr as Ue, Th as be, Tbody as yt, Td as Ce, ButtonGroup as Le, Tooltip as Ve, Button as V, RangeSlider as $t, RangeSliderMark as Ze, Text as S, RangeSliderTrack as Dt, RangeSliderFilledTrack as Pt, RangeSliderThumb as rt, Select as ot, NumberInput as at, NumberInputField as it, HStack as oe, Tag as Ne, Image as Et, useToast as vt, VStack as le, FormControl as X, RadioGroup as Ct, Radio as Qe, Alert as qe, AlertIcon as Ke, Spinner as wt, useDisclosure as _t, Modal as Gt, ModalOverlay as zt, ModalContent as Bt, ModalHeader as Wt, ModalCloseButton as Ut, ModalBody as Qt, ModalFooter as qt, Badge as St, IconButton as Kt, Tabs as Yt, TabList as Ht, Tab as lt, TabPanels as Jt, TabPanel as ct, Textarea as Pe } from "@chakra-ui/react";
3
+ import { useMemo as T, useState as G, useCallback as P, useRef as Xt, useEffect as ce, memo as Je } from "react";
4
4
  import { c as ze } from "./utils-cn-CgdSr4hO.js";
5
5
  import "./moment-vendor-DMLRxgRE.js";
6
- import "./lodash-vendor-l9HldpVa.js";
6
+ import "./lodash-vendor-B-xpwrnm.js";
7
7
  import { useQuery as je, useMutation as me, useClient as Zt } from "urql";
8
8
  import { useUiLabelContext as xe, useAllPartParameters as Vt } from "./hooks.js";
9
9
  import { u as en } from "./ufuzzy-vendor-Dl0ZI6Av.js";
10
10
  import { F as tn, a as nn, b as sn, c as rn } from "./react-icons-vendor-CMsTQrA0.js";
11
- import { s as ge } from "./react-select-vendor-C3wpaSL1.js";
11
+ import { s as ge } from "./react-select-vendor-_26lPW2Z.js";
12
12
  import { getFragmentData as A } from "./generated.js";
13
13
  import { G as Lt, a as on, C as et, b as Mt, R as tt, M as Re, c as Ye, T as Se, A as fe, d as He, e as It, f as an, g as Ot, U as At, h as Be, i as Tt, j as ln, k as cn, l as dn, m as un, n as hn, o as mn, p as pn } from "./graphql-BIKiRJ8I.js";
14
- import { D as gn, H as xn, u as jn, a as fn } from "./react-dnd-vendor-BDOGawvX.js";
15
- import { ThresholdKind as We, ReportKind as re, ActionLaterality as bn, SensorLocation as ie } from "./generated-graphql.js";
16
- import { g as Nt, a as Rt, b as yn, c as vn, d as Cn, e as dt, f as ut } from "./services-human-CI19qLdG.js";
14
+ import { D as gn, H as xn, u as jn, a as fn } from "./react-dnd-vendor-BYAS_HOo.js";
15
+ import { ThresholdKind as We, ReportKind as ne, ActionLaterality as bn, SensorLocation as ie } from "./generated-graphql.js";
16
+ import { g as Nt, a as Rt, b as yn, c as vn, d as Cn, e as dt, f as ut } from "./services-human-BIz3wOu_.js";
17
17
  import { availablePlanes as ht, getAnalysisPartIdNoSide as Ee } from "./types.js";
18
18
  const wn = ({
19
19
  setSearch: n,
@@ -22,7 +22,7 @@ const wn = ({
22
22
  hideUseCaseFilter: d = !1
23
23
  }) => {
24
24
  const p = T(
25
- () => t?.flatMap((c) => c.useCases).filter((c, m, j) => j.findIndex((r) => r.id === c.id) === m).map((c) => ({
25
+ () => t?.flatMap((c) => c.useCases).filter((c, m, j) => j.findIndex((o) => o.id === c.id) === m).map((c) => ({
26
26
  label: c.name,
27
27
  value: c.id
28
28
  })) || [],
@@ -62,18 +62,18 @@ const wn = ({
62
62
  }, pe = ({
63
63
  children: n
64
64
  }) => /* @__PURE__ */ e.jsx(xt, { fontWeight: "bold", fontFamily: "sans-serif", fontSize: "large", children: n }), Sn = ({ value: n, onChange: t }) => {
65
- const a = _(
65
+ const a = G(
66
66
  () => Math.random().toString(36).substring(2, 15)
67
67
  )[0], d = P(
68
68
  (p, c) => {
69
69
  t((m) => {
70
- const j = [...m], [r] = j.splice(p, 1);
71
- return j.splice(c, 0, r), j;
70
+ const j = [...m], [o] = j.splice(p, 1);
71
+ return j.splice(c, 0, o), j;
72
72
  });
73
73
  },
74
74
  [t]
75
75
  );
76
- return /* @__PURE__ */ e.jsx(ne, { children: /* @__PURE__ */ e.jsx(gn, { backend: xn, children: /* @__PURE__ */ e.jsx(jt, { children: /* @__PURE__ */ e.jsxs(ft, { variant: "simple", size: "md", children: [
76
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx(gn, { backend: xn, children: /* @__PURE__ */ e.jsx(jt, { children: /* @__PURE__ */ e.jsxs(ft, { variant: "simple", size: "md", children: [
77
77
  /* @__PURE__ */ e.jsx(bt, { children: /* @__PURE__ */ e.jsxs(Ue, { children: [
78
78
  /* @__PURE__ */ e.jsx(be, { children: "Order" }),
79
79
  /* @__PURE__ */ e.jsx(be, { children: "Name" })
@@ -99,20 +99,20 @@ const wn = ({
99
99
  hover: (f, I) => {
100
100
  if (!c.current)
101
101
  return;
102
- const w = f.index, y = t;
103
- if (w === y)
102
+ const w = f.index, b = t;
103
+ if (w === b)
104
104
  return;
105
- const h = c.current?.getBoundingClientRect(), o = (h.bottom - h.top) / 2, b = I.getClientOffset().y - h.top;
106
- w < y && b < o || w > y && b > o || (p(w, y), f.index = y);
105
+ const h = c.current?.getBoundingClientRect(), s = (h.bottom - h.top) / 2, y = I.getClientOffset().y - h.top;
106
+ w < b && y < s || w > b && y > s || (p(w, b), f.index = b);
107
107
  }
108
- }), [{ isDragging: r }, l] = fn({
108
+ }), [{ isDragging: o }, l] = fn({
109
109
  type: n,
110
110
  item: () => ({ id: a, index: t }),
111
111
  collect: (f) => ({
112
112
  isDragging: f.isDragging()
113
113
  })
114
- }), x = r ? 0.6 : 1, R = r ? "grabbing" : "grab";
115
- return l(j(c)), /* @__PURE__ */ e.jsxs(Ue, { ref: c, style: { opacity: x, cursor: R }, "data-handler-id": m, children: [
114
+ }), x = o ? 0.6 : 1, k = o ? "grabbing" : "grab";
115
+ return l(j(c)), /* @__PURE__ */ e.jsxs(Ue, { ref: c, style: { opacity: x, cursor: k }, "data-handler-id": m, children: [
116
116
  /* @__PURE__ */ e.jsx(Ce, { children: t + 1 }),
117
117
  /* @__PURE__ */ e.jsx(Ce, { children: d })
118
118
  ] });
@@ -124,29 +124,29 @@ const wn = ({
124
124
  selectedProps: p,
125
125
  buttonProps: c
126
126
  }) => {
127
- const m = (r) => r === a || r.value === a, j = (r) => m(r) ? { ...c, ...p } : c;
128
- return /* @__PURE__ */ e.jsx(Le, { isAttached: !0, isDisabled: d, children: n.map((r, l) => /* @__PURE__ */ e.jsx(
127
+ const m = (o) => o === a || o.value === a, j = (o) => m(o) ? { ...c, ...p } : c;
128
+ return /* @__PURE__ */ e.jsx(Le, { isAttached: !0, isDisabled: d, children: n.map((o, l) => /* @__PURE__ */ e.jsx(
129
129
  Ve,
130
130
  {
131
- label: r.tooltip,
131
+ label: o.tooltip,
132
132
  openDelay: 50,
133
133
  closeDelay: 200,
134
134
  placement: "top",
135
- visibility: r.tooltip ? "visible" : "hidden",
135
+ visibility: o.tooltip ? "visible" : "hidden",
136
136
  hasArrow: !0,
137
137
  children: /* @__PURE__ */ e.jsx(
138
138
  V,
139
139
  {
140
- onClick: () => m(r) ? null : t(r, l),
141
- isDisabled: r.disabled,
142
- ...j(r),
143
- children: r.label
140
+ onClick: () => m(o) ? null : t(o, l),
141
+ isDisabled: o.disabled,
142
+ ...j(o),
143
+ children: o.label
144
144
  }
145
145
  )
146
146
  },
147
147
  l
148
148
  )) });
149
- }, Ge = (n, t) => t < 0 ? -1 * Math.abs(n) : Math.abs(n), In = ({
149
+ }, _e = (n, t) => t < 0 ? -1 * Math.abs(n) : Math.abs(n), In = ({
150
150
  isReversed: n,
151
151
  min: t,
152
152
  max: a,
@@ -155,70 +155,70 @@ const wn = ({
155
155
  inputProps: c,
156
156
  size: m,
157
157
  zeroMarker: j,
158
- formatValue: r,
158
+ formatValue: o,
159
159
  valueLabel: l,
160
160
  positiveNegativeLabels: x,
161
- isDisabled: R,
161
+ isDisabled: k,
162
162
  ...f
163
163
  }) => {
164
- const [I, w] = _([void 0, void 0]), y = I[0], h = I[1], o = j && t < -5 && a > 5, u = Number(d?.[0] ?? h ?? t) > 0 ? 1 : -1, b = Number(d?.[1] ?? h ?? a) < 0 ? -1 : 1, M = x?.[0] === x?.[1], k = d?.[0], Q = d?.[1];
164
+ const [I, w] = G([void 0, void 0]), b = I[0], h = I[1], s = j && t < -5 && a > 5, u = Number(d?.[0] ?? h ?? t) > 0 ? 1 : -1, y = Number(d?.[1] ?? h ?? a) < 0 ? -1 : 1, M = x?.[0] === x?.[1], F = d?.[0], q = d?.[1];
165
165
  ce(() => {
166
- k !== void 0 && Q !== void 0 && w([k.toFixed(0), Q.toFixed(0)]);
167
- }, [k, Q, w]);
168
- const q = P(
169
- ([L, z]) => {
170
- L < z && w([L.toFixed(0), z.toFixed(0)]);
166
+ F !== void 0 && q !== void 0 && w([F.toFixed(0), q.toFixed(0)]);
167
+ }, [F, q, w]);
168
+ const z = P(
169
+ ([L, B]) => {
170
+ L < B && w([L.toFixed(0), B.toFixed(0)]);
171
171
  },
172
172
  [w]
173
173
  ), N = P(
174
- ([L, z]) => {
175
- L < z && p([L, z]);
174
+ ([L, B]) => {
175
+ L < B && p([L, B]);
176
176
  },
177
177
  [p]
178
178
  ), K = P(() => {
179
- w(([L, z]) => {
180
- const ee = isNaN(Number(L)) ? t : Number(L), U = isNaN(Number(z)) ? a : Number(z), ae = Ge(Number(ee), u), i = Ge(Number(U), b), s = u < 0 ? Math.max(ae, t) : Math.min(ae, a), v = b < 0 ? Math.max(i, t) : Math.min(i, a);
181
- return s > v ? (p([v, s]), [v.toFixed(0), s.toFixed(0)]) : (p([s, v]), [s.toFixed(0), v.toFixed(0)]);
179
+ w(([L, B]) => {
180
+ const ee = isNaN(Number(L)) ? t : Number(L), U = isNaN(Number(B)) ? a : Number(B), ae = _e(Number(ee), u), i = _e(Number(U), y), r = u < 0 ? Math.max(ae, t) : Math.min(ae, a), v = y < 0 ? Math.max(i, t) : Math.min(i, a);
181
+ return r > v ? (p([v, r]), [v.toFixed(0), r.toFixed(0)]) : (p([r, v]), [r.toFixed(0), v.toFixed(0)]);
182
182
  });
183
- }, [p, w, u, b, t, a]), se = P(
183
+ }, [p, w, u, y, t, a]), re = P(
184
184
  (L) => {
185
- const z = L === "" || isNaN(Number(L)) ? L : Ge(Number(L), u);
186
- w(([ee, U]) => [z.toString(), U]);
185
+ const B = L === "" || isNaN(Number(L)) ? L : _e(Number(L), u);
186
+ w(([ee, U]) => [B.toString(), U]);
187
187
  },
188
188
  [w, u]
189
- ), F = P(
189
+ ), $ = P(
190
190
  (L) => {
191
- const z = L === "" || isNaN(Number(L)) ? L : Ge(Number(L), b);
192
- w(([ee, U]) => [ee, z.toString()]);
191
+ const B = L === "" || isNaN(Number(L)) ? L : _e(Number(L), y);
192
+ w(([ee, U]) => [ee, B.toString()]);
193
193
  },
194
- [w, b]
194
+ [w, y]
195
195
  ), C = T(
196
196
  () => m === "xs" ? "0.75rem" : void 0,
197
197
  [m]
198
198
  ), E = P(
199
- (L, z) => {
200
- const ee = Number(z.target.value);
201
- if (!y || !h || ![-1, 1].includes(ee))
199
+ (L, B) => {
200
+ const ee = Number(B.target.value);
201
+ if (!b || !h || ![-1, 1].includes(ee))
202
202
  return;
203
- const U = (s) => ee < 0 ? -1 * Math.abs(s) : Math.abs(s), ae = L ? U(Number(y)) : Number(y), i = L ? Number(h) : U(Number(h));
203
+ const U = (r) => ee < 0 ? -1 * Math.abs(r) : Math.abs(r), ae = L ? U(Number(b)) : Number(b), i = L ? Number(h) : U(Number(h));
204
204
  ae > i ? p([i, ae]) : p([ae, i]);
205
205
  },
206
- [y, h, p]
206
+ [b, h, p]
207
207
  );
208
208
  return /* @__PURE__ */ e.jsxs(ye, { direction: "column", ...f, children: [
209
- /* @__PURE__ */ e.jsx(ne, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
209
+ /* @__PURE__ */ e.jsx(se, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
210
210
  $t,
211
211
  {
212
212
  "aria-label": ["min", "max"],
213
213
  isReversed: n,
214
- value: [Number(y ?? t), Number(h ?? a)],
214
+ value: [Number(b ?? t), Number(h ?? a)],
215
215
  max: a,
216
216
  min: t,
217
217
  minStepsBetweenThumbs: 3,
218
218
  step: 1,
219
- onChange: q,
219
+ onChange: z,
220
220
  onChangeEnd: N,
221
- isDisabled: R,
221
+ isDisabled: k,
222
222
  children: [
223
223
  /* @__PURE__ */ e.jsx(Ze, { value: t, top: "-1em", children: /* @__PURE__ */ e.jsx(
224
224
  S,
@@ -226,7 +226,7 @@ const wn = ({
226
226
  fontSize: m ?? "sm",
227
227
  fontWeight: "semibold",
228
228
  whiteSpace: "nowrap",
229
- children: r ? r?.(t) : t
229
+ children: o ? o?.(t) : t
230
230
  }
231
231
  ) }),
232
232
  /* @__PURE__ */ e.jsx(Ze, { value: a, top: "-1em", children: /* @__PURE__ */ e.jsx(
@@ -236,13 +236,13 @@ const wn = ({
236
236
  fontWeight: "semibold",
237
237
  style: { transform: "translateX(-100%)" },
238
238
  whiteSpace: "nowrap",
239
- children: r ? r(a) : a
239
+ children: o ? o(a) : a
240
240
  }
241
241
  ) }),
242
- o && /* @__PURE__ */ e.jsxs(Ze, { value: 0, top: "-1em", pos: "relative", children: [
243
- /* @__PURE__ */ e.jsx(S, { fontSize: m, fontWeight: "semibold", children: r?.(0) ?? "0" }),
242
+ s && /* @__PURE__ */ e.jsxs(Ze, { value: 0, top: "-1em", pos: "relative", children: [
243
+ /* @__PURE__ */ e.jsx(S, { fontSize: m, fontWeight: "semibold", children: o?.(0) ?? "0" }),
244
244
  /* @__PURE__ */ e.jsx(
245
- ne,
245
+ se,
246
246
  {
247
247
  position: "absolute",
248
248
  width: "2px",
@@ -302,7 +302,7 @@ const wn = ({
302
302
  fontWeight: "bold",
303
303
  value: u,
304
304
  onChange: (L) => E(!0, L),
305
- isDisabled: M || R,
305
+ isDisabled: M || k,
306
306
  children: [
307
307
  /* @__PURE__ */ e.jsx("option", { value: -1, children: x[0] }),
308
308
  /* @__PURE__ */ e.jsx("option", { value: 1, children: x[1] })
@@ -315,14 +315,14 @@ const wn = ({
315
315
  precision: 0,
316
316
  size: m ?? "sm",
317
317
  min: 0,
318
- max: u < 0 ? Math.abs(t) : Q ?? a,
319
- value: y === "" ? "" : Math.abs(Number(y ?? t)),
320
- onChange: se,
318
+ max: u < 0 ? Math.abs(t) : q ?? a,
319
+ value: b === "" ? "" : Math.abs(Number(b ?? t)),
320
+ onChange: re,
321
321
  onBlur: K,
322
322
  borderWidth: 1,
323
323
  borderRadius: 3,
324
324
  borderColor: "#ccc",
325
- isDisabled: R,
325
+ isDisabled: k,
326
326
  ...c,
327
327
  children: /* @__PURE__ */ e.jsx(
328
328
  it,
@@ -339,15 +339,15 @@ const wn = ({
339
339
  {
340
340
  size: m ?? "sm",
341
341
  min: 0,
342
- max: b < 0 ? Math.abs(k ?? t) : a,
342
+ max: y < 0 ? Math.abs(F ?? t) : a,
343
343
  precision: 0,
344
344
  value: h === "" ? "" : Math.abs(Number(h ?? a)),
345
- onChange: F,
345
+ onChange: $,
346
346
  onBlur: K,
347
347
  borderWidth: 1,
348
348
  borderRadius: 3,
349
349
  borderColor: "#ccc",
350
- isDisabled: R,
350
+ isDisabled: k,
351
351
  ...c,
352
352
  children: /* @__PURE__ */ e.jsx(
353
353
  it,
@@ -365,9 +365,9 @@ const wn = ({
365
365
  width: "auto",
366
366
  size: m,
367
367
  fontWeight: "bold",
368
- value: b,
368
+ value: y,
369
369
  onChange: (L) => E(!1, L),
370
- isDisabled: M || R,
370
+ isDisabled: M || k,
371
371
  children: [
372
372
  /* @__PURE__ */ e.jsx("option", { value: -1, children: x[0] }),
373
373
  /* @__PURE__ */ e.jsx("option", { value: 1, children: x[1] })
@@ -391,7 +391,7 @@ const wn = ({
391
391
  label: `This ${d.actionLowerCase} is owned by Quantum`,
392
392
  "aria-label": "Quantum owned",
393
393
  children: /* @__PURE__ */ e.jsx(
394
- ne,
394
+ se,
395
395
  {
396
396
  boxSize: "1.5em",
397
397
  borderRadius: "full",
@@ -432,26 +432,26 @@ const wn = ({
432
432
  onView: c,
433
433
  onSelected: m,
434
434
  onDuplicate: j,
435
- disableMultiSelect: r,
435
+ disableMultiSelect: o,
436
436
  disableDelete: l,
437
437
  disableEdit: x,
438
- disableCreate: R,
438
+ disableCreate: k,
439
439
  hideUseCase: f = !0,
440
440
  tableProps: I,
441
441
  containerProps: w,
442
- quantumIconSrc: y = "/favicon.ico"
442
+ quantumIconSrc: b = "/favicon.ico"
443
443
  }) => {
444
- const [h, o] = _(""), [u, b] = _(), { getLabel: M } = xe(), k = T(() => ({
444
+ const [h, s] = G(""), [u, y] = G(), { getLabel: M } = xe(), F = T(() => ({
445
445
  action: M("action"),
446
446
  actionPlural: M("action_plural"),
447
447
  actionLowerCase: M("action").toLocaleLowerCase(),
448
448
  actionPluralLowerCase: M("action_plural").toLocaleLowerCase()
449
- }), [M]), Q = T(() => {
449
+ }), [M]), q = T(() => {
450
450
  if (!n)
451
451
  return;
452
452
  const C = Nn(n, h);
453
453
  return f ? C : kn(C, u);
454
- }, [n, h, u, f]), q = P(() => {
454
+ }, [n, h, u, f]), z = P(() => {
455
455
  if (!d)
456
456
  return;
457
457
  const E = n.filter(
@@ -463,44 +463,44 @@ const wn = ({
463
463
  return;
464
464
  const C = n.filter((E) => E.selected);
465
465
  j(C.map((E) => E.id)), m && C.forEach((E) => m(E, !1));
466
- }, [n, j, m]), K = T(() => n.some((C) => C.selected && !C.quantumOwned), [n]), se = T(() => n.some((C) => C.selected), [n]), F = T(() => n.some((C) => C.selected && C.quantumOwned), [n]);
467
- return /* @__PURE__ */ e.jsxs(ne, { ...w, children: [
466
+ }, [n, j, m]), K = T(() => n.some((C) => C.selected && !C.quantumOwned), [n]), re = T(() => n.some((C) => C.selected), [n]), $ = T(() => n.some((C) => C.selected && C.quantumOwned), [n]);
467
+ return /* @__PURE__ */ e.jsxs(se, { ...w, children: [
468
468
  /* @__PURE__ */ e.jsxs(ye, { alignContent: "space-between", gap: 4, children: [
469
469
  (a || d || j) && /* @__PURE__ */ e.jsxs(Le, { mb: "1rem", gap: 4, children: [
470
470
  a && /* @__PURE__ */ e.jsxs(
471
471
  V,
472
472
  {
473
- isDisabled: !a || R,
473
+ isDisabled: !a || k,
474
474
  colorScheme: "blackAlpha",
475
475
  backgroundColor: "gray.700",
476
476
  onClick: a,
477
477
  children: [
478
478
  "Create New ",
479
- k.action
479
+ F.action
480
480
  ]
481
481
  }
482
482
  ),
483
- d && !r && /* @__PURE__ */ e.jsx(
483
+ d && !o && /* @__PURE__ */ e.jsx(
484
484
  Ve,
485
485
  {
486
- label: F ? K ? `Quantum-owned ${k.actionPluralLowerCase} are selected and will be skipped` : `Selected ${k.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
486
+ label: $ ? K ? `Quantum-owned ${F.actionPluralLowerCase} are selected and will be skipped` : `Selected ${F.actionPluralLowerCase} are quantum-owned and cannot be deleted` : void 0,
487
487
  shouldWrapChildren: !0,
488
488
  children: /* @__PURE__ */ e.jsx(
489
489
  V,
490
490
  {
491
491
  colorScheme: "gray",
492
492
  isDisabled: !K || !d || l,
493
- onClick: q,
493
+ onClick: z,
494
494
  children: "Delete Selected"
495
495
  }
496
496
  )
497
497
  }
498
498
  ),
499
- j && !r && /* @__PURE__ */ e.jsx(
499
+ j && !o && /* @__PURE__ */ e.jsx(
500
500
  V,
501
501
  {
502
502
  colorScheme: "gray",
503
- isDisabled: !se,
503
+ isDisabled: !re,
504
504
  onClick: N,
505
505
  children: "Duplicate Selected"
506
506
  }
@@ -509,9 +509,9 @@ const wn = ({
509
509
  /* @__PURE__ */ e.jsx(
510
510
  wn,
511
511
  {
512
- setSearch: o,
512
+ setSearch: s,
513
513
  actions: n,
514
- updateUseCases: b,
514
+ updateUseCases: y,
515
515
  hideUseCaseFilter: f
516
516
  }
517
517
  )
@@ -520,7 +520,7 @@ const wn = ({
520
520
  /* @__PURE__ */ e.jsx(bt, { position: "sticky", top: 0, bg: "white", zIndex: 1, children: /* @__PURE__ */ e.jsxs(Ue, { children: [
521
521
  /* @__PURE__ */ e.jsxs(be, { fontWeight: "normal", children: [
522
522
  "(showing ",
523
- Q?.length ?? 0,
523
+ q?.length ?? 0,
524
524
  " of",
525
525
  " ",
526
526
  t ?? n.length,
@@ -531,20 +531,20 @@ const wn = ({
531
531
  !f && /* @__PURE__ */ e.jsx(be, { children: "Use Case" }),
532
532
  /* @__PURE__ */ e.jsx(be, {})
533
533
  ] }) }),
534
- /* @__PURE__ */ e.jsx(yt, { children: Q?.map((C) => /* @__PURE__ */ e.jsxs(
534
+ /* @__PURE__ */ e.jsx(yt, { children: q?.map((C) => /* @__PURE__ */ e.jsxs(
535
535
  Ue,
536
536
  {
537
537
  className: ze(
538
538
  "hover:bg-[#f7f7f7]",
539
- !r && "cursor-pointer",
539
+ !o && "cursor-pointer",
540
540
  C.selected && "bg-gray-200"
541
541
  ),
542
542
  onClick: () => {
543
- r || m?.(C, !C.selected);
543
+ o || m?.(C, !C.selected);
544
544
  },
545
545
  children: [
546
546
  /* @__PURE__ */ e.jsx(Ce, { children: /* @__PURE__ */ e.jsxs(ye, { children: [
547
- !r && /* @__PURE__ */ e.jsx(e.Fragment, { children: C.selected ? /* @__PURE__ */ e.jsx(nn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(sn, { className: "text-gray-400" }) }),
547
+ !o && /* @__PURE__ */ e.jsx(e.Fragment, { children: C.selected ? /* @__PURE__ */ e.jsx(nn, { className: "text-blue-500" }) : /* @__PURE__ */ e.jsx(sn, { className: "text-gray-400" }) }),
548
548
  (C.quantumOwned || !p) && c && /* @__PURE__ */ e.jsx(
549
549
  V,
550
550
  {
@@ -578,7 +578,7 @@ const wn = ({
578
578
  Tn,
579
579
  {
580
580
  action: C,
581
- quantumIconSrc: y
581
+ quantumIconSrc: b
582
582
  }
583
583
  ),
584
584
  C.name
@@ -606,30 +606,30 @@ const wn = ({
606
606
  setButtonOnClick: c,
607
607
  quantumOwned: m
608
608
  }) => {
609
- const j = vt(), { getLabel: r } = xe(), l = T(() => ({
610
- singular: r("action"),
611
- plural: r("action_plural"),
612
- pluralLowerCase: r("action_plural").toLowerCase(),
613
- singularLowerCase: r("action").toLowerCase()
614
- }), [r]), [x, R] = _("copy"), [f, I] = _(""), [w, y] = _([]), [h, o] = _(!1), [u] = je({
609
+ const j = vt(), { getLabel: o } = xe(), l = T(() => ({
610
+ singular: o("action"),
611
+ plural: o("action_plural"),
612
+ pluralLowerCase: o("action_plural").toLowerCase(),
613
+ singularLowerCase: o("action").toLowerCase()
614
+ }), [o]), [x, k] = G("copy"), [f, I] = G(""), [w, b] = G([]), [h, s] = G(!1), [u] = je({
615
615
  query: Lt
616
- }), [b] = je({
616
+ }), [y] = je({
617
617
  query: on,
618
618
  variables: { groupId: f },
619
619
  pause: !f
620
620
  // Only run when group is selected
621
- }), [, M] = me(et), [, k] = me(
621
+ }), [, M] = me(et), [, F] = me(
622
622
  Mt
623
- ), Q = T(() => u.data?.groups ? u.data.groups.map(
623
+ ), q = T(() => u.data?.groups ? u.data.groups.map(
624
624
  (i) => A(It, i)
625
- ) : [], [u.data]), q = T(() => b.data ? b.data.actions.map((s) => {
626
- const v = A(fe, s), O = A(
625
+ ) : [], [u.data]), z = T(() => y.data ? y.data.actions.map((r) => {
626
+ const v = A(fe, r), O = A(
627
627
  tt,
628
628
  v.reports
629
- ), B = A(
629
+ ), W = A(
630
630
  Re,
631
631
  v.categories
632
- ), W = A(
632
+ ), Q = A(
633
633
  Ye,
634
634
  v.metadataGroups
635
635
  ).map((H) => ({
@@ -643,26 +643,26 @@ const wn = ({
643
643
  ...H,
644
644
  thresholds: A(Se, H.thresholds)
645
645
  })),
646
- categories: B,
647
- metadataGroups: W
646
+ categories: W,
647
+ metadataGroups: Q
648
648
  };
649
- }) : [], [b.data]), N = T(() => q.filter(
649
+ }) : [], [y.data]), N = T(() => z.filter(
650
650
  (i) => w.includes(i.id)
651
- ), [q, w]), K = P(
651
+ ), [z, w]), K = P(
652
652
  (i) => {
653
- const s = i?.value || "";
654
- I(s), y([]);
653
+ const r = i?.value || "";
654
+ I(r), b([]);
655
655
  },
656
656
  []
657
- ), se = P(
657
+ ), re = P(
658
658
  (i) => {
659
- const s = i.map((v) => v.value);
660
- y(s);
659
+ const r = i.map((v) => v.value);
660
+ b(r);
661
661
  },
662
662
  []
663
- ), F = P(
663
+ ), $ = P(
664
664
  async (i) => {
665
- const s = {
665
+ const r = {
666
666
  ...i,
667
667
  name: `${i.name} (Copy)`,
668
668
  // Add "(Copy)" suffix to distinguish
@@ -678,17 +678,17 @@ const wn = ({
678
678
  })),
679
679
  categories: i.categories.map((O) => O.id),
680
680
  quantumOwned: m,
681
- metadataItemIds: i.metadataGroups.flatMap((O) => O.data.map((B) => B.id)).filter((O) => O !== void 0),
681
+ metadataItemIds: i.metadataGroups.flatMap((O) => O.data.map((W) => W.id)).filter((O) => O !== void 0),
682
682
  reports: i.reports.map((O) => ({
683
683
  ...O,
684
684
  id: void 0,
685
- thresholds: O.thresholds.map((B) => ({
686
- ...B,
685
+ thresholds: O.thresholds.map((W) => ({
686
+ ...W,
687
687
  id: void 0
688
688
  }))
689
689
  })),
690
690
  id: void 0
691
- }, v = await M({ fields: s });
691
+ }, v = await M({ fields: r });
692
692
  if (v.error) throw new Error(v.error.message);
693
693
  if (v.data?.createAction)
694
694
  return A(fe, v.data.createAction);
@@ -697,54 +697,54 @@ const wn = ({
697
697
  [M, m]
698
698
  ), C = P(
699
699
  async (i) => {
700
- const s = await k({ id: i.id });
701
- if (s.error)
702
- throw new Error(s.error.message);
703
- if (s.data?.convertActionToQuantumOwned)
700
+ const r = await F({ id: i.id });
701
+ if (r.error)
702
+ throw new Error(r.error.message);
703
+ if (r.data?.convertActionToQuantumOwned)
704
704
  return A(
705
705
  fe,
706
- s.data.convertActionToQuantumOwned
706
+ r.data.convertActionToQuantumOwned
707
707
  );
708
708
  throw new Error("No action data returned");
709
709
  },
710
- [k]
710
+ [F]
711
711
  ), E = P(async () => {
712
- if (o(!0), !N.length) {
712
+ if (s(!0), !N.length) {
713
713
  const i = new Error(
714
714
  `No ${l.pluralLowerCase} selected for ${x === "copy" ? "copying" : "converting"}`
715
715
  );
716
- a?.(i), o(!1);
716
+ a?.(i), s(!1);
717
717
  return;
718
718
  }
719
719
  try {
720
720
  const i = [];
721
- let s = 0;
722
- const v = x === "copy" ? F : C, O = x === "copy" ? "copy" : "convert";
723
- for (const B of N)
721
+ let r = 0;
722
+ const v = x === "copy" ? $ : C, O = x === "copy" ? "copy" : "convert";
723
+ for (const W of N)
724
724
  try {
725
- const te = await v(B);
725
+ const te = await v(W);
726
726
  i.push(te);
727
727
  } catch (te) {
728
728
  console.error(
729
- `Failed to ${O} ${l.singularLowerCase} "${B.name}":`,
729
+ `Failed to ${O} ${l.singularLowerCase} "${W.name}":`,
730
730
  te
731
- ), s++;
731
+ ), r++;
732
732
  }
733
733
  if (i.length > 0) {
734
- const B = i.length, te = N.length, W = x === "copy" ? "copied" : "converted", H = x === "copy" ? "copy" : "convert";
734
+ const W = i.length, te = N.length, Q = x === "copy" ? "copied" : "converted", H = x === "copy" ? "copy" : "convert";
735
735
  j({
736
- title: s > 0 ? `Partial ${H} completed` : `${l.plural} ${W} successfully`,
737
- description: s > 0 ? `${B} of ${te} ${l.pluralLowerCase} ${W} successfully` : `${B} ${B > 1 ? l.pluralLowerCase : l.singularLowerCase} ${W} successfully`,
738
- status: s > 0 ? "warning" : "success",
736
+ title: r > 0 ? `Partial ${H} completed` : `${l.plural} ${Q} successfully`,
737
+ description: r > 0 ? `${W} of ${te} ${l.pluralLowerCase} ${Q} successfully` : `${W} ${W > 1 ? l.pluralLowerCase : l.singularLowerCase} ${Q} successfully`,
738
+ status: r > 0 ? "warning" : "success",
739
739
  duration: 3e3,
740
740
  isClosable: !0
741
- }), n?.(), I(""), y([]);
741
+ }), n?.(), I(""), b([]);
742
742
  } else
743
743
  throw new Error(
744
744
  `Failed to ${O} any ${l.pluralLowerCase}`
745
745
  );
746
746
  } catch (i) {
747
- const s = x === "copy" ? "copy" : "convert", v = i instanceof Error ? i.message : `Failed to ${s} ${l.pluralLowerCase}`;
747
+ const r = x === "copy" ? "copy" : "convert", v = i instanceof Error ? i.message : `Failed to ${r} ${l.pluralLowerCase}`;
748
748
  j({
749
749
  title: `${x === "copy" ? "Copy" : "Convert"} failed`,
750
750
  description: v,
@@ -753,19 +753,19 @@ const wn = ({
753
753
  isClosable: !0
754
754
  }), a?.(i instanceof Error ? i : new Error(v));
755
755
  } finally {
756
- o(!1);
756
+ s(!1);
757
757
  }
758
758
  }, [
759
759
  N,
760
760
  x,
761
- F,
761
+ $,
762
762
  C,
763
763
  j,
764
764
  n,
765
765
  a,
766
766
  l
767
767
  ]), L = P(() => {
768
- I(""), y([]), R("copy"), t?.();
768
+ I(""), b([]), k("copy"), t?.();
769
769
  }, [t]);
770
770
  ce(() => {
771
771
  p && p({
@@ -778,16 +778,16 @@ const wn = ({
778
778
  saveButton: E
779
779
  });
780
780
  }, [c, L, E]);
781
- const z = T(() => Q.map((i) => ({
781
+ const B = T(() => q.map((i) => ({
782
782
  value: i.id,
783
783
  label: i.name
784
- })), [Q]), ee = T(() => q.filter((i) => x === "copy" ? !0 : !i.quantumOwned).map((i) => ({
784
+ })), [q]), ee = T(() => z.filter((i) => x === "copy" ? !0 : !i.quantumOwned).map((i) => ({
785
785
  value: i.id,
786
786
  label: i.name,
787
787
  // Add custom data to identify quantum-owned actions for UI display
788
788
  isQuantumOwned: i.quantumOwned
789
- })), [q, x]), U = u.fetching, ae = b.fetching;
790
- return /* @__PURE__ */ e.jsx(ne, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
789
+ })), [z, x]), U = u.fetching, ae = y.fetching;
790
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
791
791
  m && /* @__PURE__ */ e.jsxs(X, { children: [
792
792
  /* @__PURE__ */ e.jsx(pe, { children: "Operation Mode" }),
793
793
  /* @__PURE__ */ e.jsx(
@@ -795,7 +795,7 @@ const wn = ({
795
795
  {
796
796
  value: x,
797
797
  onChange: (i) => {
798
- R(i), y([]);
798
+ k(i), b([]);
799
799
  },
800
800
  children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, children: [
801
801
  /* @__PURE__ */ e.jsx(Qe, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
@@ -832,8 +832,8 @@ const wn = ({
832
832
  ge,
833
833
  {
834
834
  placeholder: "Choose a group...",
835
- options: z,
836
- value: z.find((i) => i.value === f) || null,
835
+ options: B,
836
+ value: B.find((i) => i.value === f) || null,
837
837
  onChange: K,
838
838
  isLoading: U,
839
839
  isDisabled: U,
@@ -872,17 +872,17 @@ const wn = ({
872
872
  value: ee.filter(
873
873
  (i) => w.includes(i.value)
874
874
  ),
875
- onChange: se,
875
+ onChange: re,
876
876
  isDisabled: ee.length === 0,
877
877
  isClearable: !0,
878
878
  isMulti: !0,
879
879
  closeMenuOnSelect: !1,
880
- formatOptionLabel: (i, { context: s }) => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", w: "100%", children: [
880
+ formatOptionLabel: (i, { context: r }) => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", w: "100%", children: [
881
881
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
882
882
  /* @__PURE__ */ e.jsx(S, { children: i.label }),
883
- s === "value" && i.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
883
+ r === "value" && i.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
884
884
  ] }),
885
- i.isQuantumOwned && s === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
885
+ i.isQuantumOwned && r === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
886
886
  ] })
887
887
  }
888
888
  ),
@@ -892,22 +892,22 @@ const wn = ({
892
892
  " found"
893
893
  ] })
894
894
  ] }),
895
- b.error && /* @__PURE__ */ e.jsxs(qe, { status: "error", mt: 2, children: [
895
+ y.error && /* @__PURE__ */ e.jsxs(qe, { status: "error", mt: 2, children: [
896
896
  /* @__PURE__ */ e.jsx(Ke, {}),
897
897
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
898
898
  "Failed to load ",
899
899
  l.pluralLowerCase,
900
900
  ":",
901
901
  " ",
902
- b.error.message
902
+ y.error.message
903
903
  ] })
904
904
  ] })
905
905
  ] }),
906
- N.length > 0 && /* @__PURE__ */ e.jsxs(ne, { p: 4, bg: "gray.50", borderRadius: "md", children: [
906
+ N.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
907
907
  /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: N.length === 1 ? `${l.singular} to ${x === "copy" ? "Copy" : "Convert"}:` : `${N.length} ${l.plural} to ${x === "copy" ? "Copy" : "Convert"}:` }),
908
908
  /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
909
- N.map((i, s) => /* @__PURE__ */ e.jsxs(
910
- ne,
909
+ N.map((i, r) => /* @__PURE__ */ e.jsxs(
910
+ se,
911
911
  {
912
912
  w: "100%",
913
913
  p: 3,
@@ -918,7 +918,7 @@ const wn = ({
918
918
  children: [
919
919
  /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", align: "start", mb: 2, children: [
920
920
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
921
- s + 1,
921
+ r + 1,
922
922
  ". ",
923
923
  i.name
924
924
  ] }),
@@ -970,7 +970,7 @@ const wn = ({
970
970
  i.id
971
971
  )),
972
972
  N.length > 1 && /* @__PURE__ */ e.jsx(
973
- ne,
973
+ se,
974
974
  {
975
975
  w: "100%",
976
976
  p: 2,
@@ -1027,28 +1027,28 @@ const wn = ({
1027
1027
  setButtonOnClick: c,
1028
1028
  quantumOwned: m
1029
1029
  }) => {
1030
- const j = vt(), { getLabel: r } = xe(), l = T(() => ({
1031
- singular: r("module"),
1032
- plural: r("module_plural"),
1033
- pluralLowerCase: r("module_plural").toLowerCase(),
1034
- singularLowerCase: r("module").toLowerCase()
1035
- }), [r]), x = T(() => ({
1036
- singular: r("action"),
1037
- plural: r("action_plural"),
1038
- pluralLowerCase: r("action_plural").toLowerCase(),
1039
- singularLowerCase: r("action").toLowerCase()
1040
- }), [r]), [R, f] = _(""), [I, w] = _([]), [y, h] = _(!1), [o, u] = _("copy"), [b] = je({
1030
+ const j = vt(), { getLabel: o } = xe(), l = T(() => ({
1031
+ singular: o("module"),
1032
+ plural: o("module_plural"),
1033
+ pluralLowerCase: o("module_plural").toLowerCase(),
1034
+ singularLowerCase: o("module").toLowerCase()
1035
+ }), [o]), x = T(() => ({
1036
+ singular: o("action"),
1037
+ plural: o("action_plural"),
1038
+ pluralLowerCase: o("action_plural").toLowerCase(),
1039
+ singularLowerCase: o("action").toLowerCase()
1040
+ }), [o]), [k, f] = G(""), [I, w] = G([]), [b, h] = G(!1), [s, u] = G("copy"), [y] = je({
1041
1041
  query: Lt
1042
1042
  }), [M] = je({
1043
1043
  query: an,
1044
- variables: { groupId: R },
1045
- pause: !R
1044
+ variables: { groupId: k },
1045
+ pause: !k
1046
1046
  // Only run when group is selected
1047
- }), [, k] = me(Ot), [, Q] = me(At), [, q] = me(et), [, N] = me(
1047
+ }), [, F] = me(Ot), [, q] = me(At), [, z] = me(et), [, N] = me(
1048
1048
  Mt
1049
- ), K = T(() => b.data?.groups ? b.data.groups.map(
1050
- (s) => A(It, s)
1051
- ) : [], [b.data]), se = T(() => M.data?.modules ? A(
1049
+ ), K = T(() => y.data?.groups ? y.data.groups.map(
1050
+ (r) => A(It, r)
1051
+ ) : [], [y.data]), re = T(() => M.data?.modules ? A(
1052
1052
  Be,
1053
1053
  M.data?.modules
1054
1054
  ).map((v) => {
@@ -1058,47 +1058,47 @@ const wn = ({
1058
1058
  );
1059
1059
  return {
1060
1060
  ...v,
1061
- moduleActions: O.map((B) => ({
1062
- ...B,
1063
- action: A(fe, B.action)
1061
+ moduleActions: O.map((W) => ({
1062
+ ...W,
1063
+ action: A(fe, W.action)
1064
1064
  })),
1065
1065
  categories: A(
1066
1066
  Re,
1067
1067
  v.categories
1068
1068
  )
1069
1069
  };
1070
- }) : [], [M.data]), F = T(() => se.filter(
1071
- (s) => I.includes(s.id)
1072
- ), [se, I]), C = P(
1073
- (s) => {
1074
- const v = s?.value || "";
1070
+ }) : [], [M.data]), $ = T(() => re.filter(
1071
+ (r) => I.includes(r.id)
1072
+ ), [re, I]), C = P(
1073
+ (r) => {
1074
+ const v = r?.value || "";
1075
1075
  f(v), w([]);
1076
1076
  },
1077
1077
  []
1078
1078
  ), E = P(
1079
- (s) => {
1080
- const v = s.map((O) => O.value);
1079
+ (r) => {
1080
+ const v = r.map((O) => O.value);
1081
1081
  w(v);
1082
1082
  },
1083
1083
  []
1084
1084
  ), L = P(async () => {
1085
- if (h(!0), !F.length) {
1085
+ if (h(!0), !$.length) {
1086
1086
  h(!1);
1087
- const s = new Error(
1088
- `No modules selected for ${o === "convert" ? "converting" : "copying"}`
1087
+ const r = new Error(
1088
+ `No modules selected for ${s === "convert" ? "converting" : "copying"}`
1089
1089
  );
1090
- a?.(s);
1090
+ a?.(r);
1091
1091
  return;
1092
1092
  }
1093
1093
  try {
1094
- const s = [];
1094
+ const r = [];
1095
1095
  let v = 0;
1096
- for (const O of F)
1096
+ for (const O of $)
1097
1097
  try {
1098
- let B = O.moduleActions.map((te) => te.actionId);
1098
+ let W = O.moduleActions.map((te) => te.actionId);
1099
1099
  if (m) {
1100
- const te = O.moduleActions.map((Y) => Y.action), W = async (Y) => {
1101
- if (o === "copy") {
1100
+ const te = O.moduleActions.map((Y) => Y.action), Q = async (Y) => {
1101
+ if (s === "copy") {
1102
1102
  if (Y.quantumOwned) return Y;
1103
1103
  const ve = A(
1104
1104
  Re,
@@ -1136,7 +1136,7 @@ const wn = ({
1136
1136
  reports: Ie,
1137
1137
  metadataIds: Fe,
1138
1138
  id: void 0
1139
- }, Ae = await q({ fields: $e });
1139
+ }, Ae = await z({ fields: $e });
1140
1140
  return Ae.error || !Ae.data?.createAction ? null : A(
1141
1141
  fe,
1142
1142
  Ae.data.createAction
@@ -1151,121 +1151,121 @@ const wn = ({
1151
1151
  Me.data.convertActionToQuantumOwned
1152
1152
  );
1153
1153
  };
1154
- B = (await Promise.all(
1155
- te.map(W)
1154
+ W = (await Promise.all(
1155
+ te.map(Q)
1156
1156
  )).filter((Y) => !!Y).map((Y) => Y.id);
1157
1157
  }
1158
- if (o === "convert") {
1158
+ if (s === "convert") {
1159
1159
  const te = {
1160
1160
  name: O.name,
1161
1161
  description: O.description || void 0,
1162
- actions: B,
1162
+ actions: W,
1163
1163
  categories: O.categories.map((H) => H.id),
1164
1164
  quantumOwned: !0
1165
- }, W = await Q({
1165
+ }, Q = await q({
1166
1166
  id: O.id,
1167
1167
  input: te
1168
1168
  });
1169
- if (W.error) throw new Error(W.error.message);
1170
- if (W.data?.updateModule) {
1169
+ if (Q.error) throw new Error(Q.error.message);
1170
+ if (Q.data?.updateModule) {
1171
1171
  const H = A(
1172
1172
  Be,
1173
- W.data.updateModule
1173
+ Q.data.updateModule
1174
1174
  );
1175
- s.push(H);
1175
+ r.push(H);
1176
1176
  }
1177
1177
  } else {
1178
1178
  const te = {
1179
1179
  name: `${O.name} (Copy)`,
1180
1180
  description: O.description || void 0,
1181
- actions: B,
1181
+ actions: W,
1182
1182
  categories: O.categories.map((H) => H.id),
1183
1183
  quantumOwned: m
1184
- }, W = await k({ input: te });
1185
- if (W.error) throw new Error(W.error.message);
1186
- if (W.data?.createModule) {
1184
+ }, Q = await F({ input: te });
1185
+ if (Q.error) throw new Error(Q.error.message);
1186
+ if (Q.data?.createModule) {
1187
1187
  const H = A(
1188
1188
  Be,
1189
- W.data.createModule
1189
+ Q.data.createModule
1190
1190
  );
1191
- s.push(H);
1191
+ r.push(H);
1192
1192
  }
1193
1193
  }
1194
- } catch (B) {
1194
+ } catch (W) {
1195
1195
  console.error(
1196
- `Failed to ${o === "convert" ? "convert" : "copy"} module "${O.name}":`,
1197
- B
1196
+ `Failed to ${s === "convert" ? "convert" : "copy"} module "${O.name}":`,
1197
+ W
1198
1198
  ), v++;
1199
1199
  }
1200
- if (s.length > 0) {
1201
- const O = s.length, B = F.length;
1200
+ if (r.length > 0) {
1201
+ const O = r.length, W = $.length;
1202
1202
  j({
1203
- title: v > 0 ? `Partial ${o === "convert" ? "convert" : "copy"} completed` : `${l.plural} ${o === "convert" ? "converted" : "copied"} successfully`,
1204
- description: v > 0 ? `${O} of ${B} ${l.plural} ${o === "convert" ? "converted" : "copied"} successfully` : `${O} ${O > 1 ? l.plural : l.singular} ${o === "convert" ? "converted" : "copied"} successfully`,
1203
+ title: v > 0 ? `Partial ${s === "convert" ? "convert" : "copy"} completed` : `${l.plural} ${s === "convert" ? "converted" : "copied"} successfully`,
1204
+ description: v > 0 ? `${O} of ${W} ${l.plural} ${s === "convert" ? "converted" : "copied"} successfully` : `${O} ${O > 1 ? l.plural : l.singular} ${s === "convert" ? "converted" : "copied"} successfully`,
1205
1205
  status: v > 0 ? "warning" : "success",
1206
1206
  duration: 3e3,
1207
1207
  isClosable: !0
1208
- }), s.length > 0 && n?.(), f(""), w([]);
1208
+ }), r.length > 0 && n?.(), f(""), w([]);
1209
1209
  } else
1210
1210
  throw new Error(
1211
- `Failed to ${o === "convert" ? "convert" : "copy"} any modules`
1211
+ `Failed to ${s === "convert" ? "convert" : "copy"} any modules`
1212
1212
  );
1213
- } catch (s) {
1214
- const v = s instanceof Error ? s.message : `Failed to ${o === "convert" ? "convert" : "copy"} modules`;
1213
+ } catch (r) {
1214
+ const v = r instanceof Error ? r.message : `Failed to ${s === "convert" ? "convert" : "copy"} modules`;
1215
1215
  j({
1216
- title: o === "convert" ? "Convert failed" : "Copy failed",
1216
+ title: s === "convert" ? "Convert failed" : "Copy failed",
1217
1217
  description: v,
1218
1218
  status: "error",
1219
1219
  duration: 5e3,
1220
1220
  isClosable: !0
1221
- }), a?.(s instanceof Error ? s : new Error(v));
1221
+ }), a?.(r instanceof Error ? r : new Error(v));
1222
1222
  } finally {
1223
1223
  h(!1);
1224
1224
  }
1225
1225
  }, [
1226
+ $,
1226
1227
  F,
1227
- k,
1228
- Q,
1228
+ q,
1229
1229
  j,
1230
1230
  n,
1231
1231
  a,
1232
1232
  m,
1233
- q,
1233
+ z,
1234
1234
  N,
1235
- o,
1235
+ s,
1236
1236
  l
1237
- ]), z = P(() => {
1237
+ ]), B = P(() => {
1238
1238
  f(""), w([]), u("copy"), t?.();
1239
1239
  }, [t]);
1240
1240
  ce(() => {
1241
1241
  p && p({
1242
1242
  cancelButton: !1,
1243
- saveButton: F.length === 0 || y
1243
+ saveButton: $.length === 0 || b
1244
1244
  });
1245
- }, [F.length, y, p]), ce(() => {
1245
+ }, [$.length, b, p]), ce(() => {
1246
1246
  c && c({
1247
- cancelButton: z,
1247
+ cancelButton: B,
1248
1248
  saveButton: L
1249
1249
  });
1250
- }, [c, z, L]);
1251
- const ee = T(() => K.map((s) => ({
1252
- value: s.id,
1253
- label: s.name
1254
- })), [K]), U = T(() => se.filter((s) => o === "copy" ? !0 : !s.quantumOwned).map((s) => ({
1255
- value: s.id,
1256
- label: s.name,
1250
+ }, [c, B, L]);
1251
+ const ee = T(() => K.map((r) => ({
1252
+ value: r.id,
1253
+ label: r.name
1254
+ })), [K]), U = T(() => re.filter((r) => s === "copy" ? !0 : !r.quantumOwned).map((r) => ({
1255
+ value: r.id,
1256
+ label: r.name,
1257
1257
  // Add custom data to identify quantum-owned modules
1258
- isQuantumOwned: s.quantumOwned
1259
- })), [se, o]), ae = b.fetching, i = M.fetching;
1260
- return /* @__PURE__ */ e.jsx(ne, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
1258
+ isQuantumOwned: r.quantumOwned
1259
+ })), [re, s]), ae = y.fetching, i = M.fetching;
1260
+ return /* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs(le, { spacing: 6, align: "stretch", children: [
1261
1261
  m && /* @__PURE__ */ e.jsxs(X, { children: [
1262
1262
  /* @__PURE__ */ e.jsx(pe, { children: "Operation Mode" }),
1263
1263
  /* @__PURE__ */ e.jsx(
1264
1264
  Ct,
1265
1265
  {
1266
- value: o,
1267
- onChange: (s) => {
1268
- u(s), w([]);
1266
+ value: s,
1267
+ onChange: (r) => {
1268
+ u(r), w([]);
1269
1269
  },
1270
1270
  children: /* @__PURE__ */ e.jsxs(oe, { spacing: 6, children: [
1271
1271
  /* @__PURE__ */ e.jsx(Qe, { value: "copy", colorScheme: "blue", children: /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 1, children: [
@@ -1298,23 +1298,23 @@ const wn = ({
1298
1298
  {
1299
1299
  placeholder: "Choose a group...",
1300
1300
  options: ee,
1301
- value: ee.find((s) => s.value === R) || null,
1301
+ value: ee.find((r) => r.value === k) || null,
1302
1302
  onChange: C,
1303
1303
  isLoading: ae,
1304
1304
  isDisabled: ae,
1305
1305
  isClearable: !0
1306
1306
  }
1307
1307
  ),
1308
- b.error && /* @__PURE__ */ e.jsxs(qe, { status: "error", mt: 2, children: [
1308
+ y.error && /* @__PURE__ */ e.jsxs(qe, { status: "error", mt: 2, children: [
1309
1309
  /* @__PURE__ */ e.jsx(Ke, {}),
1310
1310
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", children: [
1311
1311
  "Failed to load groups: ",
1312
- b.error.message
1312
+ y.error.message
1313
1313
  ] })
1314
1314
  ] })
1315
1315
  ] }),
1316
- R && /* @__PURE__ */ e.jsxs(X, { children: [
1317
- /* @__PURE__ */ e.jsx(pe, { children: o === "convert" ? `Select ${l.plural} to Convert` : `Select ${l.plural} to Copy` }),
1316
+ k && /* @__PURE__ */ e.jsxs(X, { children: [
1317
+ /* @__PURE__ */ e.jsx(pe, { children: s === "convert" ? `Select ${l.plural} to Convert` : `Select ${l.plural} to Copy` }),
1318
1318
  i ? /* @__PURE__ */ e.jsxs(oe, { children: [
1319
1319
  /* @__PURE__ */ e.jsx(wt, { size: "sm" }),
1320
1320
  /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", children: [
@@ -1326,22 +1326,22 @@ const wn = ({
1326
1326
  /* @__PURE__ */ e.jsx(
1327
1327
  ge,
1328
1328
  {
1329
- placeholder: o === "convert" ? `Choose ${l.pluralLowerCase} to convert...` : `Choose ${l.pluralLowerCase} to copy...`,
1329
+ placeholder: s === "convert" ? `Choose ${l.pluralLowerCase} to convert...` : `Choose ${l.pluralLowerCase} to copy...`,
1330
1330
  options: U,
1331
1331
  value: U.filter(
1332
- (s) => I.includes(s.value)
1332
+ (r) => I.includes(r.value)
1333
1333
  ),
1334
1334
  onChange: E,
1335
1335
  isDisabled: U.length === 0,
1336
1336
  isClearable: !0,
1337
1337
  isMulti: !0,
1338
1338
  closeMenuOnSelect: !1,
1339
- formatOptionLabel: (s, { context: v }) => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", w: "100%", children: [
1339
+ formatOptionLabel: (r, { context: v }) => /* @__PURE__ */ e.jsxs(oe, { justify: "space-between", w: "100%", children: [
1340
1340
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
1341
- /* @__PURE__ */ e.jsx(S, { children: s.label }),
1342
- v === "value" && s.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1341
+ /* @__PURE__ */ e.jsx(S, { children: r.label }),
1342
+ v === "value" && r.isQuantumOwned && /* @__PURE__ */ e.jsx(S, { color: "blue", fontSize: "xs", children: "(Quantum Owned)" })
1343
1343
  ] }),
1344
- s.isQuantumOwned && v === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1344
+ r.isQuantumOwned && v === "menu" && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1345
1345
  ] })
1346
1346
  }
1347
1347
  ),
@@ -1362,11 +1362,11 @@ const wn = ({
1362
1362
  ] })
1363
1363
  ] })
1364
1364
  ] }),
1365
- F.length > 0 && /* @__PURE__ */ e.jsxs(ne, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1366
- /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: F.length === 1 ? `${l.singular} to ${o === "copy" ? "Copy" : "Convert"}` : `${F.length} ${l.plural} to ${o === "copy" ? "Copy" : "Convert"}` }),
1365
+ $.length > 0 && /* @__PURE__ */ e.jsxs(se, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1366
+ /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", mb: 3, children: $.length === 1 ? `${l.singular} to ${s === "copy" ? "Copy" : "Convert"}` : `${$.length} ${l.plural} to ${s === "copy" ? "Copy" : "Convert"}` }),
1367
1367
  /* @__PURE__ */ e.jsxs(le, { align: "start", spacing: 3, children: [
1368
- F.map((s, v) => /* @__PURE__ */ e.jsxs(
1369
- ne,
1368
+ $.map((r, v) => /* @__PURE__ */ e.jsxs(
1369
+ se,
1370
1370
  {
1371
1371
  w: "100%",
1372
1372
  p: 3,
@@ -1379,9 +1379,9 @@ const wn = ({
1379
1379
  /* @__PURE__ */ e.jsxs(S, { fontWeight: "medium", fontSize: "sm", children: [
1380
1380
  v + 1,
1381
1381
  ". ",
1382
- s.name
1382
+ r.name
1383
1383
  ] }),
1384
- s.quantumOwned && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1384
+ r.quantumOwned && /* @__PURE__ */ e.jsx(Ne, { size: "sm", colorScheme: "blue", variant: "solid", children: "Quantum Owned" })
1385
1385
  ] }),
1386
1386
  /* @__PURE__ */ e.jsxs(
1387
1387
  le,
@@ -1391,30 +1391,30 @@ const wn = ({
1391
1391
  fontSize: "sm",
1392
1392
  color: "gray.600",
1393
1393
  children: [
1394
- s.description && /* @__PURE__ */ e.jsxs(S, { children: [
1394
+ r.description && /* @__PURE__ */ e.jsxs(S, { children: [
1395
1395
  /* @__PURE__ */ e.jsx("strong", { children: "Description:" }),
1396
1396
  " ",
1397
- s.description
1397
+ r.description
1398
1398
  ] }),
1399
1399
  /* @__PURE__ */ e.jsxs(S, { children: [
1400
1400
  /* @__PURE__ */ e.jsx("strong", { children: "Activities:" }),
1401
1401
  " ",
1402
- s.moduleActions.length
1402
+ r.moduleActions.length
1403
1403
  ] }),
1404
1404
  /* @__PURE__ */ e.jsxs(S, { children: [
1405
1405
  /* @__PURE__ */ e.jsx("strong", { children: "Categories:" }),
1406
1406
  " ",
1407
- s.categories.map((O) => O.name).join(", ") || "None"
1407
+ r.categories.map((O) => O.name).join(", ") || "None"
1408
1408
  ] })
1409
1409
  ]
1410
1410
  }
1411
1411
  )
1412
1412
  ]
1413
1413
  },
1414
- s.id
1414
+ r.id
1415
1415
  )),
1416
- F.length > 1 && /* @__PURE__ */ e.jsx(
1417
- ne,
1416
+ $.length > 1 && /* @__PURE__ */ e.jsx(
1417
+ se,
1418
1418
  {
1419
1419
  w: "100%",
1420
1420
  p: 2,
@@ -1424,24 +1424,24 @@ const wn = ({
1424
1424
  borderColor: "blue.200",
1425
1425
  children: /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", fontWeight: "medium", color: "blue.800", children: [
1426
1426
  "Total: ",
1427
- F.length,
1427
+ $.length,
1428
1428
  " ",
1429
1429
  l.pluralLowerCase,
1430
1430
  " will be",
1431
1431
  " ",
1432
- o === "copy" ? "copied" : "converted"
1432
+ s === "copy" ? "copied" : "converted"
1433
1433
  ] })
1434
1434
  }
1435
1435
  ),
1436
- m && F.filter((s) => s.moduleActions.some((v) => !v.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1437
- ne,
1436
+ m && $.filter((r) => r.moduleActions.some((v) => !v.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1437
+ se,
1438
1438
  {
1439
1439
  p: 2,
1440
1440
  bg: "yellow.50",
1441
1441
  borderRadius: "md",
1442
1442
  border: "1px solid",
1443
1443
  borderColor: "yellow.200",
1444
- children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: o === "convert" ? `Converting ${l.plural} will convert non QM-Owned ${x.plural} to QM-Owned ${x.plural}` : `Copying ${l.plural} with Non QM-Owned ${x.plural} will create corresponding QM-Owned ${x.plural}` })
1444
+ children: /* @__PURE__ */ e.jsx(S, { fontSize: "sm", fontWeight: "medium", color: "yellow.800", children: s === "convert" ? `Converting ${l.plural} will convert non QM-Owned ${x.plural} to QM-Owned ${x.plural}` : `Copying ${l.plural} with Non QM-Owned ${x.plural} will create corresponding QM-Owned ${x.plural}` })
1445
1445
  }
1446
1446
  )
1447
1447
  ] })
@@ -1451,23 +1451,23 @@ const wn = ({
1451
1451
  V,
1452
1452
  {
1453
1453
  variant: "outline",
1454
- onClick: z,
1455
- isDisabled: y,
1454
+ onClick: B,
1455
+ isDisabled: b,
1456
1456
  children: "Cancel"
1457
1457
  }
1458
1458
  ),
1459
1459
  /* @__PURE__ */ e.jsxs(
1460
1460
  V,
1461
1461
  {
1462
- colorScheme: o === "copy" ? "blue" : "green",
1462
+ colorScheme: s === "copy" ? "blue" : "green",
1463
1463
  onClick: L,
1464
- isDisabled: F.length === 0 || y,
1465
- isLoading: y,
1466
- loadingText: `${o === "copy" ? "Copying" : "Converting"}...`,
1464
+ isDisabled: $.length === 0 || b,
1465
+ isLoading: b,
1466
+ loadingText: `${s === "copy" ? "Copying" : "Converting"}...`,
1467
1467
  children: [
1468
- o === "copy" ? "Copy" : "Convert",
1468
+ s === "copy" ? "Copy" : "Convert",
1469
1469
  " ",
1470
- F.length === 1 ? l.singular : `${F.length} ${l.plural}`
1470
+ $.length === 1 ? l.singular : `${$.length} ${l.plural}`
1471
1471
  ]
1472
1472
  }
1473
1473
  )
@@ -1482,19 +1482,19 @@ const wn = ({
1482
1482
  availableCategories: c,
1483
1483
  selectedCategoryIds: m,
1484
1484
  setSelectedCategoryIds: j,
1485
- description: r,
1485
+ description: o,
1486
1486
  setDescription: l,
1487
1487
  ...x
1488
1488
  }) => {
1489
- const R = Gt(), f = T(() => a.map((u) => ({
1489
+ const k = _t(), f = T(() => a.map((u) => ({
1490
1490
  ...u,
1491
1491
  selected: d.includes(u.id)
1492
- })), [a, d]), I = T(() => a.reduce((u, b) => (u[b.id] = b, u), {}), [a]), w = T(
1492
+ })), [a, d]), I = T(() => a.reduce((u, y) => (u[y.id] = y, u), {}), [a]), w = T(
1493
1493
  () => d.map((u) => I[u]),
1494
1494
  [d, I]
1495
- ), y = P(
1496
- (u, b) => {
1497
- p(b ? [...d, u.id] : d.filter((M) => M !== u.id));
1495
+ ), b = P(
1496
+ (u, y) => {
1497
+ p(y ? [...d, u.id] : d.filter((M) => M !== u.id));
1498
1498
  },
1499
1499
  [d, p]
1500
1500
  ), h = P(
@@ -1502,13 +1502,13 @@ const wn = ({
1502
1502
  t(u.target.value);
1503
1503
  },
1504
1504
  [t]
1505
- ), o = P(
1505
+ ), s = P(
1506
1506
  (u) => {
1507
1507
  l?.(u.target.value);
1508
1508
  },
1509
1509
  [l]
1510
1510
  );
1511
- return /* @__PURE__ */ e.jsxs(ne, { ...x, children: [
1511
+ return /* @__PURE__ */ e.jsxs(se, { ...x, children: [
1512
1512
  /* @__PURE__ */ e.jsxs(oe, { gap: "2rem", children: [
1513
1513
  /* @__PURE__ */ e.jsx(Dn, { name: n ?? "", onInputChange: h }),
1514
1514
  /* @__PURE__ */ e.jsx(
@@ -1523,23 +1523,23 @@ const wn = ({
1523
1523
  /* @__PURE__ */ e.jsx(
1524
1524
  En,
1525
1525
  {
1526
- description: r ?? "",
1527
- onInputChange: o
1526
+ description: o ?? "",
1527
+ onInputChange: s
1528
1528
  }
1529
1529
  ),
1530
1530
  /* @__PURE__ */ e.jsx(
1531
- Gn,
1531
+ _n,
1532
1532
  {
1533
1533
  value: w,
1534
1534
  onChange: p,
1535
- onAdjustActivities: () => R.onOpen()
1535
+ onAdjustActivities: () => k.onOpen()
1536
1536
  }
1537
1537
  ),
1538
1538
  /* @__PURE__ */ e.jsxs(
1539
- _t,
1539
+ Gt,
1540
1540
  {
1541
- isOpen: R.isOpen,
1542
- onClose: R.onClose,
1541
+ isOpen: k.isOpen,
1542
+ onClose: k.onClose,
1543
1543
  size: "6xl",
1544
1544
  children: [
1545
1545
  /* @__PURE__ */ e.jsx(zt, {}),
@@ -1550,7 +1550,7 @@ const wn = ({
1550
1550
  Fn,
1551
1551
  {
1552
1552
  actions: f,
1553
- onSelected: y,
1553
+ onSelected: b,
1554
1554
  disableCreate: !0,
1555
1555
  disableDelete: !0,
1556
1556
  tableProps: {
@@ -1563,7 +1563,7 @@ const wn = ({
1563
1563
  V,
1564
1564
  {
1565
1565
  colorScheme: "blue",
1566
- onClick: R.onClose,
1566
+ onClick: k.onClose,
1567
1567
  isDisabled: d.length === 0,
1568
1568
  children: "Done"
1569
1569
  }
@@ -1657,7 +1657,7 @@ const wn = ({
1657
1657
  )
1658
1658
  ] });
1659
1659
  }
1660
- ), Gn = Je(
1660
+ ), _n = Je(
1661
1661
  ({
1662
1662
  value: n,
1663
1663
  onChange: t,
@@ -1730,13 +1730,13 @@ const wn = ({
1730
1730
  value: c,
1731
1731
  onChange: (m) => {
1732
1732
  const j = m(c);
1733
- t(j.map((r) => r.id));
1733
+ t(j.map((o) => o.id));
1734
1734
  }
1735
1735
  }
1736
1736
  )
1737
1737
  ] });
1738
1738
  }
1739
- ), _n = ({
1739
+ ), Gn = ({
1740
1740
  value: n,
1741
1741
  onChange: t,
1742
1742
  forceKind: a,
@@ -1746,38 +1746,38 @@ const wn = ({
1746
1746
  lockRanges: m,
1747
1747
  ...j
1748
1748
  }) => {
1749
- const r = T(() => [...n].sort((f, I) => {
1750
- const w = ht.indexOf(f.plane), y = ht.indexOf(I.plane);
1751
- return w - y;
1749
+ const o = T(() => [...n].sort((f, I) => {
1750
+ const w = ht.indexOf(f.plane), b = ht.indexOf(I.plane);
1751
+ return w - b;
1752
1752
  }), [n]), l = P((f) => "segment" in f.id ? Nt(f.id.segment, f.plane, !0) ?? "Unknown" : Rt(f.id.joint, f.plane, !0) ?? "Unknown", []), x = P(
1753
1753
  (f, I) => {
1754
- const w = r.findIndex(
1754
+ const w = o.findIndex(
1755
1755
  (h) => h.id === I.id && h.plane === I.plane
1756
1756
  );
1757
- let y = [...r];
1758
- a && (I = { ...I, kind: a }), y[w] = I, m && (y = y.map((h) => ({
1757
+ let b = [...o];
1758
+ a && (I = { ...I, kind: a }), b[w] = I, m && (b = b.map((h) => ({
1759
1759
  ...h,
1760
1760
  min: I.min,
1761
1761
  max: I.max
1762
- }))), t(y);
1762
+ }))), t(b);
1763
1763
  },
1764
- [t, r, a, m]
1765
- ), R = P(
1764
+ [t, o, a, m]
1765
+ ), k = P(
1766
1766
  (f) => {
1767
- const I = r.filter(
1767
+ const I = o.filter(
1768
1768
  (w) => w.id !== f.id || w.plane !== f.plane
1769
1769
  );
1770
1770
  t(I);
1771
1771
  },
1772
- [t, r]
1772
+ [t, o]
1773
1773
  );
1774
- return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...j, children: r.map((f, I) => /* @__PURE__ */ e.jsx(
1774
+ return /* @__PURE__ */ e.jsx(le, { alignItems: "flex-start", overflowY: "auto", ...j, children: o.map((f, I) => /* @__PURE__ */ e.jsx(
1775
1775
  zn,
1776
1776
  {
1777
1777
  label: l(f),
1778
1778
  parameter: f,
1779
1779
  onChange: (w) => x(I, w),
1780
- onRemove: d || c ? void 0 : () => R(f),
1780
+ onRemove: d || c ? void 0 : () => k(f),
1781
1781
  forceKind: a,
1782
1782
  disableKind: p || c,
1783
1783
  isDisabled: c
@@ -1804,7 +1804,7 @@ const wn = ({
1804
1804
  x < 0 ? -1 : 1
1805
1805
  ),
1806
1806
  [t]
1807
- ), { min: r, max: l } = "joint" in t.id ? Cn(t.id.joint, t.plane) : { min: -180, max: 180 };
1807
+ ), { min: o, max: l } = "joint" in t.id ? Cn(t.id.joint, t.plane) : { min: -180, max: 180 };
1808
1808
  return /* @__PURE__ */ e.jsxs(
1809
1809
  le,
1810
1810
  {
@@ -1865,7 +1865,7 @@ const wn = ({
1865
1865
  {
1866
1866
  w: "100%",
1867
1867
  size: "xs",
1868
- min: r,
1868
+ min: o,
1869
1869
  max: l,
1870
1870
  zeroMarker: !0,
1871
1871
  value: [t.min, t.max],
@@ -1879,7 +1879,7 @@ const wn = ({
1879
1879
  ]
1880
1880
  }
1881
1881
  );
1882
- }, _e = (n, t) => "segment" in n && "segment" in t && n.segment === t.segment || "joint" in n && "joint" in t && n.joint === t.joint, mt = ({
1882
+ }, Ge = (n, t) => "segment" in n && "segment" in t && n.segment === t.segment || "joint" in n && "joint" in t && n.joint === t.joint, mt = ({
1883
1883
  options: n,
1884
1884
  value: t,
1885
1885
  onChange: a,
@@ -1888,79 +1888,84 @@ const wn = ({
1888
1888
  singleValueSideless: c,
1889
1889
  editOnly: m,
1890
1890
  disableKind: j,
1891
- maxParameters: r,
1891
+ maxParameters: o,
1892
1892
  ...l
1893
1893
  }) => {
1894
- const x = c ? 2 : r, R = T(() => {
1894
+ const x = c ? 2 : o, k = T(() => {
1895
1895
  const h = /* @__PURE__ */ new Map();
1896
- return n.forEach((o) => {
1897
- const u = "joint" in o.id;
1898
- let b, M;
1899
- if (u ? (b = Rt(o.id.joint, o.plane, !0) ?? "Unknown", M = `joint:${o.id.joint}`) : (b = Nt(o.id.segment, o.plane, !0) ?? "Unknown", M = `segment:${o.id.segment}`), !h.has(M)) {
1900
- const Q = u ? dt(o.id.joint) ?? "Unknown Joint" : dt(o.id.segment) ?? "Unknown Segment";
1896
+ return n.forEach((s) => {
1897
+ const u = "joint" in s.id;
1898
+ let y, M;
1899
+ if (u ? (y = Rt(s.id.joint, s.plane, !0) ?? "Unknown", M = `joint:${s.id.joint}`) : (y = Nt(s.id.segment, s.plane, !0) ?? "Unknown", M = `segment:${s.id.segment}`), !h.has(M)) {
1900
+ const z = u ? dt(s.id.joint) ?? "Unknown Joint" : dt(s.id.segment) ?? "Unknown Segment";
1901
1901
  h.set(M, {
1902
- label: Q,
1902
+ label: z,
1903
1903
  options: []
1904
1904
  });
1905
1905
  }
1906
- h.get(M).options.push({
1906
+ const F = h.get(M), q = [
1907
+ y,
1908
+ u ? s.id.joint : s.id.segment,
1909
+ s.plane
1910
+ ].filter(Boolean).map((z) => String(z).toLowerCase().replace(/\s+|_/g, ""));
1911
+ F.options.push({
1907
1912
  label: /* @__PURE__ */ e.jsxs(oe, { spacing: 2, justify: "space-between", w: "100%", pl: 3, children: [
1908
- /* @__PURE__ */ e.jsx(S, { children: b }),
1909
- o.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
1913
+ /* @__PURE__ */ e.jsx(S, { children: y }),
1914
+ s.sensorOnly && /* @__PURE__ */ e.jsx(St, { size: "sm", colorScheme: "orange", variant: "subtle", children: "Sensor Only" })
1910
1915
  ] }),
1911
- value: o.id,
1912
- plane: o.plane,
1913
- sensorOnly: o.sensorOnly
1916
+ value: s.id,
1917
+ plane: s.plane,
1918
+ sensorOnly: s.sensorOnly,
1919
+ searchTokens: q
1914
1920
  });
1915
1921
  }), Array.from(h.values());
1916
1922
  }, [n]), f = T(() => {
1917
1923
  if (!c || t.length === 0)
1918
- return R;
1924
+ return k;
1919
1925
  const h = t[0];
1920
- return R.map((o) => ({
1921
- ...o,
1922
- options: o.options.filter(
1926
+ return k.map((s) => ({
1927
+ ...s,
1928
+ options: s.options.filter(
1923
1929
  (u) => Ee(u.value) === Ee(h.id) && u.plane === h.plane
1924
1930
  )
1925
- })).filter((o) => o.options.length > 0);
1926
- }, [R, t, c]), I = T(() => R.flatMap((o) => o.options).filter(
1927
- (o) => t.some((u) => _e(u.id, o.value) && u.plane === o.plane)
1928
- ), [R, t]), w = P((h, o) => {
1929
- if (!o) return !0;
1930
- const u = o.toLowerCase().split(" ").join(""), b = h.data;
1931
- if (!b || !b.value)
1932
- return !1;
1933
- const M = b.value.joint ?? b.value.segment;
1934
- return !M || typeof M != "string" ? !1 : M.toLowerCase().includes(u) || b.plane && b.plane.toLowerCase().includes(u);
1935
- }, []), y = P(
1931
+ })).filter((s) => s.options.length > 0);
1932
+ }, [k, t, c]), I = T(() => k.flatMap((s) => s.options).filter(
1933
+ (s) => t.some((u) => Ge(u.id, s.value) && u.plane === s.plane)
1934
+ ), [k, t]), w = P((h, s) => {
1935
+ if (!s) return !0;
1936
+ const u = s.toLowerCase().replace(/\s+|_/g, ""), y = h.data;
1937
+ return !y || !y.searchTokens ? !1 : y.searchTokens.some(
1938
+ (M) => M.includes(u)
1939
+ );
1940
+ }, []), b = P(
1936
1941
  (h) => {
1937
- const o = h.map((u) => {
1938
- const b = t.find(
1939
- (N) => _e(N.id, u.value) && N.plane === u.plane
1942
+ const s = h.map((u) => {
1943
+ const y = t.find(
1944
+ (N) => Ge(N.id, u.value) && N.plane === u.plane
1940
1945
  ), M = n.find(
1941
- (N) => _e(N.id, u.value) && N.plane === u.plane
1942
- ), k = c ? t.find(
1946
+ (N) => Ge(N.id, u.value) && N.plane === u.plane
1947
+ ), F = c ? t.find(
1943
1948
  (N) => Ee(N.id) === Ee(u.value) && N.plane === u.plane
1944
- ) : void 0, Q = k && !b ? k.min : M && M.min ? M.min : 0, q = k && !b ? k.max : M && M.max ? M.max : 0;
1945
- return b ?? {
1949
+ ) : void 0, q = F && !y ? F.min : M && M.min ? M.min : 0, z = F && !y ? F.max : M && M.max ? M.max : 0;
1950
+ return y ?? {
1946
1951
  id: u.value,
1947
1952
  plane: u.plane,
1948
- min: Q,
1949
- max: q,
1953
+ min: q,
1954
+ max: z,
1950
1955
  sensorOnly: u.sensorOnly,
1951
1956
  kind: d ?? We.Limit
1952
1957
  };
1953
1958
  });
1954
- a(o);
1959
+ a(s);
1955
1960
  },
1956
1961
  [a, t, n, d, c]
1957
1962
  );
1958
1963
  return ce(() => {
1959
1964
  const h = t.filter(
1960
- (o) => n.some((u) => _e(u.id, o.id) && u.plane === o.plane)
1965
+ (s) => n.some((u) => Ge(u.id, s.id) && u.plane === s.plane)
1961
1966
  );
1962
1967
  h.length !== t.length && a(h);
1963
- }, [n, a, t]), /* @__PURE__ */ e.jsxs(ne, { ...l, children: [
1968
+ }, [n, a, t]), /* @__PURE__ */ e.jsxs(se, { ...l, children: [
1964
1969
  /* @__PURE__ */ e.jsx(
1965
1970
  ge,
1966
1971
  {
@@ -1968,7 +1973,7 @@ const wn = ({
1968
1973
  placeholder: t.length ? `${t.length} selected` : "Search...",
1969
1974
  value: I,
1970
1975
  isDisabled: m || I.length >= (x ?? 1 / 0),
1971
- onChange: (h) => Array.isArray(h) ? y([...h]) : y(h !== null ? [h] : []),
1976
+ onChange: (h) => Array.isArray(h) ? b([...h]) : b(h !== null ? [h] : []),
1972
1977
  options: f,
1973
1978
  controlShouldRenderValue: !1,
1974
1979
  formatOptionLabel: (h) => h.label,
@@ -1977,7 +1982,7 @@ const wn = ({
1977
1982
  }
1978
1983
  ),
1979
1984
  /* @__PURE__ */ e.jsx(
1980
- _n,
1985
+ Gn,
1981
1986
  {
1982
1987
  marginTop: 2,
1983
1988
  maxH: "28rem",
@@ -2023,15 +2028,15 @@ const wn = ({
2023
2028
  }
2024
2029
  }, Bn = (n) => {
2025
2030
  switch (n) {
2026
- case re.GeneralActivity:
2031
+ case ne.GeneralActivity:
2027
2032
  return "General Activity";
2028
- case re.MovementCoordination:
2033
+ case ne.MovementCoordination:
2029
2034
  return "Movement Coordination";
2030
- case re.PointOfInterest:
2035
+ case ne.PointOfInterest:
2031
2036
  return "Point of Interest";
2032
- case re.Range:
2037
+ case ne.Range:
2033
2038
  return "Range";
2034
- case re.StabilityBalance:
2039
+ case ne.StabilityBalance:
2035
2040
  return "Stability Balance";
2036
2041
  }
2037
2042
  }, ls = ({
@@ -2043,80 +2048,80 @@ const wn = ({
2043
2048
  setButtonOnClick: c,
2044
2049
  setButtonDisabled: m,
2045
2050
  quantumOwned: j,
2046
- isView: r
2051
+ isView: o
2047
2052
  }) => {
2048
- const l = Zt(), [{ fetching: x }, R] = me(et), [{ fetching: f }, I] = me(ln), [{ data: w }] = je({
2053
+ const l = Zt(), [{ fetching: x }, k] = me(et), [{ fetching: f }, I] = me(ln), [{ data: w }] = je({
2049
2054
  query: cn,
2050
2055
  variables: { id: n ?? "" },
2051
2056
  pause: !n
2052
- }), y = T(() => {
2057
+ }), b = T(() => {
2053
2058
  const g = A(
2054
2059
  fe,
2055
2060
  w?.getActionById
2056
2061
  );
2057
2062
  if (!g) return null;
2058
- const D = A(tt, g.reports).map((G) => ({
2059
- ...G,
2060
- thresholds: A(Se, G.thresholds)
2063
+ const R = A(tt, g.reports).map((_) => ({
2064
+ ..._,
2065
+ thresholds: A(Se, _.thresholds)
2061
2066
  }));
2062
2067
  return {
2063
2068
  ...g,
2064
2069
  thresholds: A(Se, g.thresholds),
2065
- reports: D
2070
+ reports: R
2066
2071
  };
2067
- }, [w]), h = x || f, o = !!y && !!n, { getLabel: u } = xe(), b = T(() => ({
2072
+ }, [w]), h = x || f, s = !!b && !!n, { getLabel: u } = xe(), y = T(() => ({
2068
2073
  action: u("action")
2069
2074
  }), [u]), M = T(() => [
2070
2075
  { key: "module_category", label: "Link Category", multi: !0 },
2071
- { key: "activity_type", label: `${b.action} Type`, multi: !1 },
2076
+ { key: "activity_type", label: `${y.action} Type`, multi: !1 },
2072
2077
  { key: "session_type", label: "Session Type", multi: !0 },
2073
2078
  { key: "body_region", label: "Body Region", multi: !0 },
2074
2079
  { key: "sport", label: "Sport", multi: !0 }
2075
- ], [b.action]), [k, Q] = _(""), [q, N] = _(""), [K, se] = _(""), [F, C] = _(""), [E, L] = _([]), [z, ee] = _({}), [U, ae] = _(null), [i, s] = _([]), [v, O] = _([]), [B, te] = _(""), [W, H] = _([]), Y = Vt(), Me = T(() => Y.filter((g) => g.sensorOnly), [Y]), ve = T(() => {
2080
+ ], [y.action]), [F, q] = G(""), [z, N] = G(""), [K, re] = G(""), [$, C] = G(""), [E, L] = G([]), [B, ee] = G({}), [U, ae] = G(null), [i, r] = G([]), [v, O] = G([]), [W, te] = G(""), [Q, H] = G([]), Y = Vt(), Me = T(() => Y.filter((g) => g.sensorOnly), [Y]), ve = T(() => {
2076
2081
  const g = [
2077
- { label: "General Activity", value: re.GeneralActivity },
2082
+ { label: "General Activity", value: ne.GeneralActivity },
2078
2083
  {
2079
2084
  label: "Movement Coordination",
2080
- value: re.MovementCoordination
2085
+ value: ne.MovementCoordination
2081
2086
  },
2082
- { label: "Point of Interest", value: re.PointOfInterest },
2083
- { label: "Range", value: re.Range },
2084
- { label: "Stability Balance", value: re.StabilityBalance }
2085
- ], $ = W.map((D) => D.kind);
2087
+ { label: "Point of Interest", value: ne.PointOfInterest },
2088
+ { label: "Range", value: ne.Range },
2089
+ { label: "Stability Balance", value: ne.StabilityBalance }
2090
+ ], D = Q.map((R) => R.kind);
2086
2091
  return g.filter(
2087
- (D) => !$.includes(D.value)
2092
+ (R) => !D.includes(R.value)
2088
2093
  );
2089
- }, [W]), ke = k.length > 0, [Fe, nt] = _({});
2094
+ }, [Q]), ke = F.length > 0, [Fe, nt] = G({});
2090
2095
  ce(() => {
2091
2096
  const g = M.map(
2092
- ($) => l.query(dn, { key: $.key })
2097
+ (D) => l.query(dn, { key: D.key })
2093
2098
  );
2094
- Promise.all(g).then(($) => {
2095
- const D = {};
2096
- $.forEach((G) => {
2097
- if (G.error || !G.data) return;
2099
+ Promise.all(g).then((D) => {
2100
+ const R = {};
2101
+ D.forEach((_) => {
2102
+ if (_.error || !_.data) return;
2098
2103
  const J = A(
2099
2104
  Ye,
2100
- G.data.getMetadataByKey
2105
+ _.data.getMetadataByKey
2101
2106
  ), Z = A(
2102
2107
  He,
2103
2108
  J.data
2104
2109
  );
2105
- D[J.key] = Z.map((ue) => ({
2110
+ R[J.key] = Z.map((ue) => ({
2106
2111
  label: ue.label || ue.value,
2107
2112
  value: ue.value,
2108
2113
  id: ue.id
2109
2114
  }));
2110
- }), ee(D);
2115
+ }), ee(R);
2111
2116
  });
2112
2117
  }, [l, M]), ce(() => {
2113
- if (y) {
2114
- const $ = A(
2118
+ if (b) {
2119
+ const D = A(
2115
2120
  Ye,
2116
- y.metadataGroups
2121
+ b.metadataGroups
2117
2122
  ).map(
2118
2123
  (J) => J.data.map((Z) => A(He, Z).id)
2119
- ), D = y.reports.map((J) => ({
2124
+ ), R = b.reports.map((J) => ({
2120
2125
  id: J.id,
2121
2126
  instructions: J.instructions ?? "",
2122
2127
  kind: J.reportKind,
@@ -2135,41 +2140,41 @@ const wn = ({
2135
2140
  })
2136
2141
  })),
2137
2142
  sensorLocations: J.sensorLocations
2138
- })), G = {
2139
- name: y.name,
2140
- description: y.description || "",
2141
- cameraPlacement: y.cameraPlacement || "",
2142
- videoLink: y.videoLink || "",
2143
- metadataIds: $.flat(),
2144
- reports: D
2143
+ })), _ = {
2144
+ name: b.name,
2145
+ description: b.description || "",
2146
+ cameraPlacement: b.cameraPlacement || "",
2147
+ videoLink: b.videoLink || "",
2148
+ metadataIds: D.flat(),
2149
+ reports: R
2145
2150
  };
2146
- Q(G.name), N(G.description), se(G.cameraPlacement), C(G.videoLink), L(G.metadataIds), H(D), nt(G);
2151
+ q(_.name), N(_.description), re(_.cameraPlacement), C(_.videoLink), L(_.metadataIds), H(R), nt(_);
2147
2152
  }
2148
- }, [y]);
2153
+ }, [b]);
2149
2154
  const Ie = T(
2150
2155
  () => JSON.stringify(Fe) !== JSON.stringify({
2151
- name: k,
2152
- description: q,
2156
+ name: F,
2157
+ description: z,
2153
2158
  cameraPlacement: K,
2154
- videoLink: F,
2159
+ videoLink: $,
2155
2160
  metadataIds: E,
2156
- reports: W
2161
+ reports: Q
2157
2162
  }),
2158
2163
  [
2159
2164
  Fe,
2160
- k,
2161
- q,
2162
- K,
2163
2165
  F,
2166
+ z,
2167
+ K,
2168
+ $,
2164
2169
  E,
2165
- W
2170
+ Q
2166
2171
  ]
2167
2172
  ), Oe = P(() => {
2168
2173
  const g = {
2169
- name: k,
2170
- description: q,
2174
+ name: F,
2175
+ description: z,
2171
2176
  cameraPlacement: K,
2172
- videoLink: F,
2177
+ videoLink: $,
2173
2178
  metadataItemIds: E,
2174
2179
  // Backend requires laterality; keep existing default since UI no longer edits it
2175
2180
  laterality: bn.Either,
@@ -2179,66 +2184,66 @@ const wn = ({
2179
2184
  // Backend requires thresholds; use empty array since reports handle parameters now
2180
2185
  thresholds: [],
2181
2186
  // Include reports data
2182
- reports: W.map((D) => ({
2183
- id: D.id,
2184
- reportKind: D.kind,
2185
- sensorLocations: D.sensorLocations,
2186
- instructions: D.instructions,
2187
- thresholds: D.parameters.map((G) => ({
2188
- id: G.oldId,
2189
- kind: G.kind,
2190
- min: G.min,
2191
- max: G.max,
2192
- partKind: "joint" in G.id ? "joint" : "segment",
2193
- partId: "joint" in G.id ? G.id.joint : G.id.segment,
2194
- partDimension: G.plane
2187
+ reports: Q.map((R) => ({
2188
+ id: R.isNew ? void 0 : R.id,
2189
+ reportKind: R.kind,
2190
+ sensorLocations: R.sensorLocations,
2191
+ instructions: R.instructions,
2192
+ thresholds: R.parameters.map((_) => ({
2193
+ id: _.oldId,
2194
+ kind: _.kind,
2195
+ min: _.min,
2196
+ max: _.max,
2197
+ partKind: "joint" in _.id ? "joint" : "segment",
2198
+ partId: "joint" in _.id ? _.id.joint : _.id.segment,
2199
+ partDimension: _.plane
2195
2200
  }))
2196
2201
  }))
2197
2202
  };
2198
- let $;
2199
- o && n ? $ = I({
2203
+ let D;
2204
+ s && n ? D = I({
2200
2205
  id: n,
2201
2206
  fields: g
2202
- }) : $ = R({
2207
+ }) : D = k({
2203
2208
  fields: g
2204
- }), $.then(({ error: D }) => {
2205
- D ? t(D) : d();
2209
+ }), D.then(({ error: R }) => {
2210
+ R ? t(R) : d();
2206
2211
  });
2207
2212
  }, [
2208
2213
  j,
2209
- R,
2214
+ k,
2210
2215
  I,
2211
2216
  n,
2212
- k,
2213
- q,
2214
- K,
2215
2217
  F,
2218
+ z,
2219
+ K,
2220
+ $,
2216
2221
  E,
2217
- W,
2218
- o,
2222
+ Q,
2223
+ s,
2219
2224
  d,
2220
2225
  t
2221
2226
  ]);
2222
2227
  ce(() => {
2223
2228
  m && m({
2224
2229
  cancelButton: h,
2225
- saveButton: r ? !0 : h || !ke || !Ie
2230
+ saveButton: o ? !0 : h || !ke || !Ie
2226
2231
  });
2227
- }, [h, m, ke, Ie, r]), ce(() => {
2232
+ }, [h, m, ke, Ie, o]), ce(() => {
2228
2233
  c && c({
2229
2234
  cancelButton: a,
2230
- saveButton: r ? () => {
2235
+ saveButton: o ? () => {
2231
2236
  } : Oe
2232
2237
  });
2233
- }, [c, a, Oe, r]);
2238
+ }, [c, a, Oe, o]);
2234
2239
  const $e = P(
2235
2240
  (g) => {
2236
- const $ = ut(
2241
+ const D = ut(
2237
2242
  g.map(
2238
- (D) => "joint" in D.id ? D.id.joint : D.id.segment
2243
+ (R) => "joint" in R.id ? R.id.joint : R.id.segment
2239
2244
  )
2240
2245
  );
2241
- O($);
2246
+ O(D);
2242
2247
  },
2243
2248
  []
2244
2249
  );
@@ -2248,33 +2253,34 @@ const wn = ({
2248
2253
  const Ae = P(() => {
2249
2254
  if (!U)
2250
2255
  return;
2251
- const g = {
2256
+ const g = U === ne.PointOfInterest, D = {
2252
2257
  id: Date.now().toString(),
2253
2258
  // Temporary ID
2254
2259
  kind: U,
2255
- parameters: i,
2256
- sensorLocations: v,
2257
- instructions: B
2260
+ parameters: g ? [] : i,
2261
+ sensorLocations: g ? [] : v,
2262
+ instructions: g ? W : "",
2263
+ isNew: !0
2258
2264
  };
2259
- H(($) => [...$, g]), ae(null), s([]), O([]), te("");
2265
+ H((R) => [...R, D]), ae(null), r([]), O([]), te("");
2260
2266
  }, [
2261
2267
  U,
2262
2268
  i,
2263
2269
  v,
2264
- B
2270
+ W
2265
2271
  ]), he = P((g) => {
2266
- H(($) => $.filter((D) => D.id !== g));
2267
- }, []), Te = (g, $) => {
2268
- const D = M.find((J) => J.key === g);
2269
- if (!D) return;
2270
- const G = D.multi ? ($ ?? []).map(
2272
+ H((D) => D.filter((R) => R.id !== g));
2273
+ }, []), Te = (g, D) => {
2274
+ const R = M.find((J) => J.key === g);
2275
+ if (!R) return;
2276
+ const _ = R.multi ? (D ?? []).map(
2271
2277
  (J) => J.id
2272
- ) : $ ? [$.id] : [];
2273
- L((J) => [...J.filter((ue) => Object.values(z).flat().find((De) => De.id === ue) && !Object.keys(z).find(
2274
- (De) => z[De]?.some(
2278
+ ) : D ? [D.id] : [];
2279
+ L((J) => [...J.filter((ue) => Object.values(B).flat().find((De) => De.id === ue) && !Object.keys(B).find(
2280
+ (De) => B[De]?.some(
2275
2281
  (kt) => kt.id === ue && De === g
2276
2282
  )
2277
- )), ...G]);
2283
+ )), ..._]);
2278
2284
  };
2279
2285
  return /* @__PURE__ */ e.jsxs(le, { spacing: 4, w: "full", align: "stretch", children: [
2280
2286
  /* @__PURE__ */ e.jsxs(Yt, { children: [
@@ -2290,11 +2296,11 @@ const wn = ({
2290
2296
  /* @__PURE__ */ e.jsx(
2291
2297
  we,
2292
2298
  {
2293
- value: k,
2294
- onChange: (g) => Q(g.target.value),
2299
+ value: F,
2300
+ onChange: (g) => q(g.target.value),
2295
2301
  type: "text",
2296
2302
  placeholder: "i.e. Lunge & Return",
2297
- isDisabled: r
2303
+ isDisabled: o
2298
2304
  }
2299
2305
  )
2300
2306
  ] }),
@@ -2304,10 +2310,10 @@ const wn = ({
2304
2310
  Pe,
2305
2311
  {
2306
2312
  value: K,
2307
- onChange: (g) => se(g.target.value),
2313
+ onChange: (g) => re(g.target.value),
2308
2314
  rows: 2,
2309
2315
  placeholder: "(optional) Describe camera setup, placement, angles",
2310
- isDisabled: r
2316
+ isDisabled: o
2311
2317
  }
2312
2318
  )
2313
2319
  ] }),
@@ -2316,11 +2322,11 @@ const wn = ({
2316
2322
  /* @__PURE__ */ e.jsx(
2317
2323
  we,
2318
2324
  {
2319
- value: F,
2325
+ value: $,
2320
2326
  onChange: (g) => C(g.target.value),
2321
2327
  type: "url",
2322
2328
  placeholder: "(optional) https://...",
2323
- isDisabled: r
2329
+ isDisabled: o
2324
2330
  }
2325
2331
  )
2326
2332
  ] }),
@@ -2329,11 +2335,11 @@ const wn = ({
2329
2335
  /* @__PURE__ */ e.jsx(
2330
2336
  Pe,
2331
2337
  {
2332
- value: q,
2338
+ value: z,
2333
2339
  onChange: (g) => N(g.target.value),
2334
2340
  rows: 2,
2335
2341
  placeholder: "(optional) Describe how to perform the test or exercise",
2336
- isDisabled: r
2342
+ isDisabled: o
2337
2343
  }
2338
2344
  )
2339
2345
  ] })
@@ -2346,15 +2352,15 @@ const wn = ({
2346
2352
  ge,
2347
2353
  {
2348
2354
  isMulti: g.multi,
2349
- value: z[g.key]?.filter(
2350
- ($) => E.includes($.id)
2355
+ value: B[g.key]?.filter(
2356
+ (D) => E.includes(D.id)
2351
2357
  ),
2352
- onChange: ($) => {
2353
- Te(g.key, $);
2358
+ onChange: (D) => {
2359
+ Te(g.key, D);
2354
2360
  },
2355
- options: z[g.key],
2361
+ options: B[g.key],
2356
2362
  placeholder: `Select ${g.multi ? "one or more" : "one"} ${g.label.toLowerCase()}`,
2357
- isDisabled: r,
2363
+ isDisabled: o,
2358
2364
  isClearable: g.multi
2359
2365
  }
2360
2366
  )
@@ -2366,10 +2372,10 @@ const wn = ({
2366
2372
  {
2367
2373
  className: ze(
2368
2374
  "grid grid-cols-1 gap-6",
2369
- !r && "md:grid-cols-2"
2375
+ !o && "md:grid-cols-2"
2370
2376
  ),
2371
2377
  children: [
2372
- /* @__PURE__ */ e.jsxs("div", { className: ze("space-y-4", r && "hidden"), children: [
2378
+ /* @__PURE__ */ e.jsxs("div", { className: ze("space-y-4", o && "hidden"), children: [
2373
2379
  /* @__PURE__ */ e.jsx(de, { children: "Add New Report" }),
2374
2380
  /* @__PURE__ */ e.jsxs(X, { children: [
2375
2381
  /* @__PURE__ */ e.jsx(de, { children: "Report Kind" }),
@@ -2382,12 +2388,12 @@ const wn = ({
2382
2388
  onChange: (g) => ae(g?.value || null),
2383
2389
  options: ve,
2384
2390
  placeholder: "Select report kind...",
2385
- isDisabled: r,
2391
+ isDisabled: o,
2386
2392
  isClearable: !0
2387
2393
  }
2388
2394
  )
2389
2395
  ] }),
2390
- U !== re.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2396
+ U !== ne.PointOfInterest && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2391
2397
  /* @__PURE__ */ e.jsxs(X, { children: [
2392
2398
  /* @__PURE__ */ e.jsx(de, { children: "Default Parameters" }),
2393
2399
  /* @__PURE__ */ e.jsx(
@@ -2395,8 +2401,8 @@ const wn = ({
2395
2401
  {
2396
2402
  options: Y,
2397
2403
  value: i,
2398
- onChange: s,
2399
- editOnly: r
2404
+ onChange: r,
2405
+ editOnly: o
2400
2406
  }
2401
2407
  )
2402
2408
  ] }),
@@ -2414,16 +2420,16 @@ const wn = ({
2414
2420
  )
2415
2421
  ] })
2416
2422
  ] }),
2417
- U === re.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
2423
+ U === ne.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
2418
2424
  /* @__PURE__ */ e.jsx(de, { children: "Instructions" }),
2419
2425
  /* @__PURE__ */ e.jsx(
2420
2426
  Pe,
2421
2427
  {
2422
- value: B,
2428
+ value: W,
2423
2429
  onChange: (g) => te(g.target.value),
2424
2430
  rows: 3,
2425
2431
  placeholder: "Enter specific instructions for this report...",
2426
- isDisabled: r
2432
+ isDisabled: o
2427
2433
  }
2428
2434
  )
2429
2435
  ] }),
@@ -2432,21 +2438,21 @@ const wn = ({
2432
2438
  {
2433
2439
  colorScheme: "blue",
2434
2440
  onClick: Ae,
2435
- isDisabled: !U || r || ve.length === 0 || U !== re.PointOfInterest && i.length === 0,
2441
+ isDisabled: !U || o || ve.length === 0 || U !== ne.PointOfInterest && i.length === 0,
2436
2442
  children: "Add Report"
2437
2443
  }
2438
2444
  ) })
2439
2445
  ] }),
2440
2446
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
2441
2447
  /* @__PURE__ */ e.jsx(de, { children: "Configured Reports" }),
2442
- W.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: W.map((g) => /* @__PURE__ */ e.jsxs(
2448
+ Q.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: Q.map((g) => /* @__PURE__ */ e.jsxs(
2443
2449
  "div",
2444
2450
  {
2445
2451
  className: "p-3 border border-gray-200 rounded-md bg-gray-50",
2446
2452
  children: [
2447
2453
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-start mb-2", children: [
2448
2454
  /* @__PURE__ */ e.jsx(S, { fontWeight: "semibold", children: Bn(g.kind) }),
2449
- !r && /* @__PURE__ */ e.jsx(
2455
+ !o && /* @__PURE__ */ e.jsx(
2450
2456
  V,
2451
2457
  {
2452
2458
  size: "xs",
@@ -2457,46 +2463,46 @@ const wn = ({
2457
2463
  }
2458
2464
  )
2459
2465
  ] }),
2460
- g.kind === re.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
2466
+ g.kind === ne.PointOfInterest && /* @__PURE__ */ e.jsxs(X, { children: [
2461
2467
  /* @__PURE__ */ e.jsx(de, { children: "Instructions" }),
2462
2468
  /* @__PURE__ */ e.jsx(
2463
2469
  Pe,
2464
2470
  {
2465
2471
  value: g.instructions,
2466
- onChange: ($) => H(
2467
- (D) => D.map(
2468
- (G) => G.id === g.id ? { ...G, instructions: $.target.value } : G
2472
+ onChange: (D) => H(
2473
+ (R) => R.map(
2474
+ (_) => _.id === g.id ? { ..._, instructions: D.target.value } : _
2469
2475
  )
2470
2476
  ),
2471
2477
  rows: 3,
2472
2478
  placeholder: "Enter specific instructions for this report...",
2473
- isDisabled: r
2479
+ isDisabled: o
2474
2480
  }
2475
2481
  )
2476
2482
  ] }),
2477
- g.kind !== re.PointOfInterest && /* @__PURE__ */ e.jsx(
2483
+ g.kind !== ne.PointOfInterest && /* @__PURE__ */ e.jsx(
2478
2484
  mt,
2479
2485
  {
2480
2486
  options: Y,
2481
2487
  value: g.parameters,
2482
- onChange: ($) => {
2483
- const D = $.map(
2488
+ onChange: (D) => {
2489
+ const R = D.map(
2484
2490
  (J) => J.id.joint ?? J.id.segment
2485
- ), G = ut(D);
2491
+ ), _ = ut(R);
2486
2492
  H(
2487
2493
  (J) => J.map(
2488
- (Z) => Z.id === g.id ? { ...Z, parameters: $, sensorLocations: G } : Z
2494
+ (Z) => Z.id === g.id ? { ...Z, parameters: D, sensorLocations: _ } : Z
2489
2495
  )
2490
2496
  );
2491
2497
  },
2492
- editOnly: r
2498
+ editOnly: o
2493
2499
  }
2494
2500
  ),
2495
- g.kind !== re.PointOfInterest && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", mt: 2, children: [
2501
+ g.kind !== ne.PointOfInterest && /* @__PURE__ */ e.jsxs(S, { fontSize: "sm", color: "gray.600", mt: 2, children: [
2496
2502
  "Sensors:",
2497
2503
  " ",
2498
2504
  g.sensorLocations.map(
2499
- ($) => pt($)
2505
+ (D) => pt(D)
2500
2506
  ).join(", ")
2501
2507
  ] })
2502
2508
  ]
@@ -2513,7 +2519,7 @@ const wn = ({
2513
2519
  oe,
2514
2520
  {
2515
2521
  justify: "end",
2516
- className: ze((p || r) && "!hidden"),
2522
+ className: ze((p || o) && "!hidden"),
2517
2523
  children: /* @__PURE__ */ e.jsxs(Le, { gap: 4, children: [
2518
2524
  /* @__PURE__ */ e.jsx(V, { colorScheme: "gray", isDisabled: h, onClick: a, children: "Cancel" }),
2519
2525
  /* @__PURE__ */ e.jsx(
@@ -2540,7 +2546,7 @@ const wn = ({
2540
2546
  setButtonOnClick: m,
2541
2547
  setButtonDisabled: j
2542
2548
  }) => {
2543
- const [{ data: r }] = je({
2549
+ const [{ data: o }] = je({
2544
2550
  query: c ? un : hn
2545
2551
  }), [{ data: l }] = je({
2546
2552
  query: mn,
@@ -2548,47 +2554,47 @@ const wn = ({
2548
2554
  pause: !n
2549
2555
  }), [{ data: x }] = je({
2550
2556
  query: pn
2551
- }), R = A(
2557
+ }), k = A(
2552
2558
  Re,
2553
2559
  x?.moduleCategories
2554
- ), [{ fetching: f }, I] = me(At), [{ fetching: w }, y] = me(Ot), h = A(
2560
+ ), [{ fetching: f }, I] = me(At), [{ fetching: w }, b] = me(Ot), h = A(
2555
2561
  fe,
2556
- c ? r?.quantumOwnedActions : r?.actions
2557
- ) ?? [], o = A(Be, l?.module), u = A(Tt, o?.moduleActions) ?? [], [b, M] = _([
2562
+ c ? o?.quantumOwnedActions : o?.actions
2563
+ ) ?? [], s = A(Be, l?.module), u = A(Tt, s?.moduleActions) ?? [], [y, M] = G([
2558
2564
  ...u.map((C) => C.actionId) ?? []
2559
- ]), [k, Q] = _(o?.name ?? ""), [q, N] = _([]), [K, se] = _(o?.description ?? "");
2565
+ ]), [F, q] = G(s?.name ?? ""), [z, N] = G([]), [K, re] = G(s?.description ?? "");
2560
2566
  ce(() => {
2561
- o && (M(u.map((C) => C.actionId)), Q(o.name), se(o.description ?? ""), N(
2562
- o.categories.map(
2567
+ s && (M(u.map((C) => C.actionId)), q(s.name), re(s.description ?? ""), N(
2568
+ s.categories.map(
2563
2569
  (C) => A(Re, C).id
2564
2570
  ) ?? []
2565
2571
  ));
2566
- }, [o, u]);
2567
- const F = P(() => {
2572
+ }, [s, u]);
2573
+ const $ = P(() => {
2568
2574
  let C;
2569
2575
  const E = {
2570
- actions: b,
2571
- name: k,
2572
- categories: q.filter((L) => L !== "other"),
2576
+ actions: y,
2577
+ name: F,
2578
+ categories: z.filter((L) => L !== "other"),
2573
2579
  description: K,
2574
2580
  quantumOwned: c
2575
2581
  };
2576
- o ? C = I({
2577
- id: o.id,
2582
+ s ? C = I({
2583
+ id: s.id,
2578
2584
  input: E
2579
- }) : C = y({
2585
+ }) : C = b({
2580
2586
  input: E
2581
2587
  }), C.then(({ error: L }) => {
2582
2588
  L ? d(L) : a();
2583
2589
  });
2584
2590
  }, [
2585
- y,
2586
- I,
2587
2591
  b,
2588
- k,
2592
+ I,
2593
+ y,
2594
+ F,
2589
2595
  K,
2590
- q,
2591
- o,
2596
+ z,
2597
+ s,
2592
2598
  a,
2593
2599
  d,
2594
2600
  c
@@ -2596,27 +2602,27 @@ const wn = ({
2596
2602
  return ce(() => {
2597
2603
  j && j({
2598
2604
  cancelButton: f || w,
2599
- saveButton: f || w || !k || K.trim().split(/\s+/).filter(Boolean).length > 40
2605
+ saveButton: f || w || !F || K.trim().split(/\s+/).filter(Boolean).length > 40
2600
2606
  });
2601
- }, [j, f, w, b, k, K]), ce(() => {
2607
+ }, [j, f, w, y, F, K]), ce(() => {
2602
2608
  m && m({
2603
2609
  cancelButton: t,
2604
- saveButton: F
2610
+ saveButton: $
2605
2611
  });
2606
- }, [m, t, F]), /* @__PURE__ */ e.jsxs(ne, { width: "100%", children: [
2612
+ }, [m, t, $]), /* @__PURE__ */ e.jsxs(se, { width: "100%", children: [
2607
2613
  /* @__PURE__ */ e.jsx(
2608
2614
  $n,
2609
2615
  {
2610
- name: k,
2611
- setName: Q,
2616
+ name: F,
2617
+ setName: q,
2612
2618
  actions: h,
2613
- selectedActionIds: b,
2619
+ selectedActionIds: y,
2614
2620
  setSelectedActionIds: M,
2615
- availableCategories: R ?? [],
2616
- selectedCategoryIds: q,
2621
+ availableCategories: k ?? [],
2622
+ selectedCategoryIds: z,
2617
2623
  setSelectedCategoryIds: N,
2618
2624
  description: K,
2619
- setDescription: se
2625
+ setDescription: re
2620
2626
  }
2621
2627
  ),
2622
2628
  !p && /* @__PURE__ */ e.jsx(oe, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(Le, { mt: 16, gap: 4, children: [
@@ -2633,9 +2639,9 @@ const wn = ({
2633
2639
  V,
2634
2640
  {
2635
2641
  colorScheme: "blue",
2636
- isDisabled: f || w || !k || K.trim().split(/\s+/).filter(Boolean).length > 40,
2642
+ isDisabled: f || w || !F || K.trim().split(/\s+/).filter(Boolean).length > 40,
2637
2643
  isLoading: f || w,
2638
- onClick: F,
2644
+ onClick: $,
2639
2645
  children: "Save"
2640
2646
  }
2641
2647
  )
@@ -2647,7 +2653,7 @@ export {
2647
2653
  as as CopyActivityForm,
2648
2654
  is as CopyModuleForm,
2649
2655
  $n as ModuleForm,
2650
- _n as ParameterEditList,
2656
+ Gn as ParameterEditList,
2651
2657
  mt as ParameterEditSelect,
2652
2658
  ls as UpsertActivityForm,
2653
2659
  cs as UpsertModuleForm