quantum-component-library 1.4.47-dev.7 → 1.4.47-dev.9

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