quantum-component-library 1.4.47-qa → 1.4.48-1

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