quantum-component-library 1.4.47-dev.6 → 1.4.47-dev.8

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