@instructure/platform-modules 1.13.0 → 1.15.0

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 (64) hide show
  1. package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
  2. package/dist/adapters/canvasGraphql/normalize.d.ts +1 -0
  3. package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
  4. package/dist/adapters/canvasGraphql/queries.d.ts +13 -1
  5. package/dist/adapters/canvasGraphql/queries.d.ts.map +1 -1
  6. package/dist/adapters/inMemory.d.ts.map +1 -1
  7. package/dist/chunks/ModulesProgressBar-DOUI1JeK.js +2532 -0
  8. package/dist/components/FilterSelect.d.ts.map +1 -1
  9. package/dist/components/ModuleCard.d.ts.map +1 -1
  10. package/dist/components/ModuleItemRow.d.ts +3 -4
  11. package/dist/components/ModuleItemRow.d.ts.map +1 -1
  12. package/dist/components/ModulesList.stories.d.ts +1 -1
  13. package/dist/components/ModulesList.stories.d.ts.map +1 -1
  14. package/dist/components/ModulesProgressBar.d.ts +5 -1
  15. package/dist/components/ModulesProgressBar.d.ts.map +1 -1
  16. package/dist/edit/EditModuleCard.d.ts +19 -0
  17. package/dist/edit/EditModuleCard.d.ts.map +1 -0
  18. package/dist/edit/EditModuleItemRow.d.ts +10 -0
  19. package/dist/edit/EditModuleItemRow.d.ts.map +1 -0
  20. package/dist/edit/ModulesEditActions.d.ts +7 -0
  21. package/dist/edit/ModulesEditActions.d.ts.map +1 -0
  22. package/dist/edit/ModulesEditView.d.ts +10 -0
  23. package/dist/edit/ModulesEditView.d.ts.map +1 -0
  24. package/dist/edit/ModulesEditView.stories.d.ts +17 -0
  25. package/dist/edit/ModulesEditView.stories.d.ts.map +1 -0
  26. package/dist/edit/controls/AddItemMenu.d.ts +6 -0
  27. package/dist/edit/controls/AddItemMenu.d.ts.map +1 -0
  28. package/dist/edit/controls/AddModuleButton.d.ts +6 -0
  29. package/dist/edit/controls/AddModuleButton.d.ts.map +1 -0
  30. package/dist/edit/controls/DragHandle.d.ts +12 -0
  31. package/dist/edit/controls/DragHandle.d.ts.map +1 -0
  32. package/dist/edit/controls/InlineRename.d.ts +5 -0
  33. package/dist/edit/controls/InlineRename.d.ts.map +1 -0
  34. package/dist/edit/controls/ItemActionsMenu.d.ts +7 -0
  35. package/dist/edit/controls/ItemActionsMenu.d.ts.map +1 -0
  36. package/dist/edit/controls/ItemPublishToggle.d.ts +6 -0
  37. package/dist/edit/controls/ItemPublishToggle.d.ts.map +1 -0
  38. package/dist/edit/controls/ModuleActionsMenu.d.ts +6 -0
  39. package/dist/edit/controls/ModuleActionsMenu.d.ts.map +1 -0
  40. package/dist/edit/controls/ModulePublishMenu.d.ts +6 -0
  41. package/dist/edit/controls/ModulePublishMenu.d.ts.map +1 -0
  42. package/dist/edit/controls/ModuleSettingsModal.d.ts +6 -0
  43. package/dist/edit/controls/ModuleSettingsModal.d.ts.map +1 -0
  44. package/dist/edit/controls/PublishAllMenu.d.ts +6 -0
  45. package/dist/edit/controls/PublishAllMenu.d.ts.map +1 -0
  46. package/dist/edit/controls/ViewAsLearnerButton.d.ts +6 -0
  47. package/dist/edit/controls/ViewAsLearnerButton.d.ts.map +1 -0
  48. package/dist/edit/dnd/EditDndProvider.d.ts +18 -0
  49. package/dist/edit/dnd/EditDndProvider.d.ts.map +1 -0
  50. package/dist/edit/dnd/announcements.d.ts +24 -0
  51. package/dist/edit/dnd/announcements.d.ts.map +1 -0
  52. package/dist/edit/dnd/ids.d.ts +41 -0
  53. package/dist/edit/dnd/ids.d.ts.map +1 -0
  54. package/dist/edit/index.d.ts +6 -0
  55. package/dist/edit/index.d.ts.map +1 -1
  56. package/dist/edit.js +794 -131
  57. package/dist/hooks/useModulesPageData.d.ts.map +1 -1
  58. package/dist/index.js +1223 -1986
  59. package/dist/types/domain.d.ts +2 -0
  60. package/dist/types/domain.d.ts.map +1 -1
  61. package/dist/types/schemas.d.ts.map +1 -1
  62. package/locales/en.json +23 -1
  63. package/package.json +1 -1
  64. package/dist/chunks/useModulesPageData-BFCZuChP.js +0 -1639
package/dist/edit.js CHANGED
@@ -1,110 +1,128 @@
1
- import { C as P, X as w, D as C, u as E, ae as A, i as q, c as B } from "./chunks/useModulesPageData-BFCZuChP.js";
2
- import { useQueryClient as S, useMutation as $ } from "@tanstack/react-query";
3
- import { useMemo as j } from "react";
4
- const b = (o) => o.map((a, r) => ({ ...a, position: r + 1 })), f = (o, a, r) => {
5
- const l = r === void 0 ? o.length : Math.min(Math.max(r - 1, 0), o.length);
6
- return [...o.slice(0, l), a, ...o.slice(l)];
7
- }, v = (o, a) => {
8
- const r = new Map(a.map((l, u) => [l, u]));
9
- return [...o].sort((l, u) => (r.get(l.id) ?? a.length) - (r.get(u.id) ?? a.length));
1
+ import { P as fe, a7 as Ie, Q as Me, k as K, aw as ve, i as be, c as ye, u as w, q as Y, y as G, v as Pe, an as ke, ak as Ce, aH as B, A as De, B as V, n as Q, aI as Ae, aJ as Le, z as we, p as Re } from "./chunks/ModulesProgressBar-DOUI1JeK.js";
2
+ import { useQueryClient as Se, useMutation as Ee } from "@tanstack/react-query";
3
+ import { useMemo as T, createContext as Oe, useState as X, useContext as Te, Fragment as J } from "react";
4
+ import { jsx as n, jsxs as v, Fragment as Z } from "react/jsx-runtime";
5
+ import { politeAnnounce as ee, TruncateWithTooltip as Be, getLiveRegion as te } from "@instructure/platform-instui-bindings";
6
+ import { Alert as ne } from "@instructure/ui-alerts/v11_7";
7
+ import { Heading as ie } from "@instructure/ui-heading/v11_7";
8
+ import { Pagination as oe } from "@instructure/ui-pagination/v11_7";
9
+ import { Spinner as re } from "@instructure/ui-spinner/v11_7";
10
+ import { Text as L } from "@instructure/ui-text/v11_7";
11
+ import { View as C } from "@instructure/ui-view/v11_7";
12
+ import { useSensors as Ne, useSensor as $, PointerSensor as qe, KeyboardSensor as xe, DndContext as Fe, DragOverlay as _e, rectIntersection as $e, closestCenter as He } from "@dnd-kit/core";
13
+ import { SortableContext as de, verticalListSortingStrategy as se, useSortable as ze, sortableKeyboardCoordinates as Ue, arrayMove as H } from "@dnd-kit/sortable";
14
+ import { CSS as je } from "@dnd-kit/utilities";
15
+ import { ScreenReaderContent as We } from "@instructure/ui-a11y-content";
16
+ import { IconButton as ae, Button as Ke } from "@instructure/ui-buttons/v11_7";
17
+ import { Flex as b } from "@instructure/ui-flex/v11_7";
18
+ import { IconDragHandleLine as Ye, CornerDownRightInstUIIcon as Ge, IconArrowOpenUpLine as Ve, IconArrowOpenDownLine as Qe, LayersInstUIIcon as Xe, ListChecksInstUIIcon as Je, ClockInstUIIcon as Ze, LockInstUIIcon as et } from "@instructure/ui-icons";
19
+ import { List as tt, ListItem as nt } from "@instructure/ui-list/v11_7";
20
+ import { Pill as it } from "@instructure/ui-pill/v11_7";
21
+ import { Link as ot } from "@instructure/ui-link/v11_7";
22
+ const S = (e) => e.map((t, i) => ({ ...t, position: i + 1 })), E = (e, t, i) => {
23
+ const a = i === void 0 ? e.length : Math.min(Math.max(i - 1, 0), e.length);
24
+ return [...e.slice(0, a), t, ...e.slice(a)];
25
+ }, z = (e, t) => {
26
+ const i = new Map(t.map((a, o) => [a, o]));
27
+ return [...e].sort((a, o) => (i.get(a.id) ?? t.length) - (i.get(o.id) ?? t.length));
10
28
  };
11
- function k(o, a = {}) {
12
- const r = (t) => {
13
- if (t !== o.courseId)
14
- throw new w(o.courseId, t);
15
- }, l = (t) => {
16
- const e = o.modules.findIndex((s) => s.id === t);
17
- if (e === -1) throw new Error(`in-memory adapter has no module ${t}`);
18
- return e;
19
- }, u = (t) => o.itemsByModuleId[t] ?? [], M = (t, e) => {
20
- o.itemsByModuleId[t] = b(e.map((s) => ({ ...s, moduleId: t })));
21
- }, m = (t) => String(t.reduce((e, s) => Math.max(e, Number(s) || 0), 0) + 1);
29
+ function Jt(e, t = {}) {
30
+ const i = (r) => {
31
+ if (r !== e.courseId)
32
+ throw new Ie(e.courseId, r);
33
+ }, a = (r) => {
34
+ const d = e.modules.findIndex((l) => l.id === r);
35
+ if (d === -1) throw new Error(`in-memory adapter has no module ${r}`);
36
+ return d;
37
+ }, o = (r) => e.itemsByModuleId[r] ?? [], u = (r, d) => {
38
+ e.itemsByModuleId[r] = S(d.map((l) => ({ ...l, moduleId: r })));
39
+ }, s = (r) => String(r.reduce((d, l) => Math.max(d, Number(l) || 0), 0) + 1);
22
40
  return {
23
- ...P(o, a),
24
- async createModule({ courseId: t, name: e, position: s }) {
25
- r(t);
26
- const i = {
27
- id: m(o.modules.map((d) => d.id)),
28
- name: e,
41
+ ...fe(e, t),
42
+ async createModule({ courseId: r, name: d, position: l }) {
43
+ i(r);
44
+ const p = {
45
+ id: s(e.modules.map((c) => c.id)),
46
+ name: d,
29
47
  position: 0,
30
48
  published: !1,
31
49
  itemCount: 0,
32
50
  prerequisiteModules: [],
33
51
  requireSequentialProgress: !1
34
52
  };
35
- return o.modules = b(f(o.modules, i, s)), o.itemsByModuleId[i.id] = [], o.modules[l(i.id)];
53
+ return e.modules = S(E(e.modules, p, l)), e.itemsByModuleId[p.id] = [], e.modules[a(p.id)];
36
54
  },
37
- async updateModule({ courseId: t, moduleId: e, patch: s }) {
38
- r(t);
39
- const { prerequisiteModuleIds: i, position: d, ...n } = s, p = o.modules[l(e)], h = { ...p, ...n };
40
- i && (h.prerequisiteModules = i.map((c) => ({
41
- id: c,
42
- name: o.modules[l(c)].name
55
+ async updateModule({ courseId: r, moduleId: d, patch: l }) {
56
+ i(r);
57
+ const { prerequisiteModuleIds: p, position: c, ...m } = l, M = e.modules[a(d)], f = { ...M, ...m };
58
+ p && (f.prerequisiteModules = p.map((g) => ({
59
+ id: g,
60
+ name: e.modules[a(g)].name
43
61
  })));
44
- const g = o.modules.filter((c) => c.id !== e);
45
- return o.modules = b(f(g, h, d ?? p.position)), o.modules[l(e)];
62
+ const I = e.modules.filter((g) => g.id !== d);
63
+ return e.modules = S(E(I, f, c ?? M.position)), e.modules[a(d)];
46
64
  },
47
- async deleteModule({ courseId: t, moduleId: e }) {
48
- r(t), l(e), o.modules = b(o.modules.filter((s) => s.id !== e)), delete o.itemsByModuleId[e];
65
+ async deleteModule({ courseId: r, moduleId: d }) {
66
+ i(r), a(d), e.modules = S(e.modules.filter((l) => l.id !== d)), delete e.itemsByModuleId[d];
49
67
  },
50
- async reorderModules({ courseId: t, moduleIds: e }) {
51
- r(t), o.modules = b(v(o.modules, e));
68
+ async reorderModules({ courseId: r, moduleIds: d }) {
69
+ i(r), e.modules = S(z(e.modules, d));
52
70
  },
53
- async setModulesPublished({ courseId: t, moduleIds: e, published: s, includeItems: i }) {
54
- r(t);
55
- const d = new Set(
56
- e === "all" ? o.modules.map((n) => n.id) : e
71
+ async setModulesPublished({ courseId: r, moduleIds: d, published: l, includeItems: p }) {
72
+ i(r);
73
+ const c = new Set(
74
+ d === "all" ? e.modules.map((m) => m.id) : d
57
75
  );
58
- if (o.modules = o.modules.map(
59
- (n) => d.has(n.id) ? { ...n, published: s } : n
60
- ), !!i)
61
- for (const n of d)
62
- M(
63
- n,
64
- u(n).map((p) => ({ ...p, published: s }))
76
+ if (e.modules = e.modules.map(
77
+ (m) => c.has(m.id) ? { ...m, published: l } : m
78
+ ), !!p)
79
+ for (const m of c)
80
+ u(
81
+ m,
82
+ o(m).map((M) => ({ ...M, published: l }))
65
83
  );
66
84
  },
67
- async createModuleItem({ courseId: t, moduleId: e, type: s, title: i, position: d, indent: n = 0, extensions: p }) {
68
- r(t), l(e);
69
- const h = Object.values(o.itemsByModuleId).flatMap(
70
- (c) => c.map((y) => y.id)
71
- ), g = {
72
- id: m(h),
73
- moduleId: e,
74
- title: i,
75
- type: s,
85
+ async createModuleItem({ courseId: r, moduleId: d, type: l, title: p, position: c, indent: m = 0, extensions: M }) {
86
+ i(r), a(d);
87
+ const f = Object.values(e.itemsByModuleId).flatMap(
88
+ (g) => g.map((h) => h.id)
89
+ ), I = {
90
+ id: s(f),
91
+ moduleId: d,
92
+ title: p,
93
+ type: l,
76
94
  position: 0,
77
- indent: n,
95
+ indent: m,
78
96
  published: !1,
79
- ...p ? { extensions: p } : {}
97
+ ...M ? { extensions: M } : {}
80
98
  };
81
- return M(e, f(u(e), g, d)), u(e).find((c) => c.id === g.id);
99
+ return u(d, E(o(d), I, c)), o(d).find((g) => g.id === I.id);
82
100
  },
83
- async updateModuleItem({ courseId: t, moduleId: e, itemId: s, patch: i }) {
84
- r(t);
85
- const { moduleId: d = e, position: n, ...p } = i;
86
- l(d);
87
- const h = u(e).find((y) => y.id === s);
88
- if (!h) throw new Error(`in-memory adapter has no item ${s} in module ${e}`);
89
- M(
90
- e,
91
- u(e).filter((y) => y.id !== s)
101
+ async updateModuleItem({ courseId: r, moduleId: d, itemId: l, patch: p }) {
102
+ i(r);
103
+ const { moduleId: c = d, position: m, ...M } = p;
104
+ a(c);
105
+ const f = o(d).find((h) => h.id === l);
106
+ if (!f) throw new Error(`in-memory adapter has no item ${l} in module ${d}`);
107
+ u(
108
+ d,
109
+ o(d).filter((h) => h.id !== l)
92
110
  );
93
- const c = n ?? (d !== e ? void 0 : h.position);
94
- return M(d, f(u(d), { ...h, ...p }, c)), u(d).find((y) => y.id === s);
111
+ const g = m ?? (c !== d ? void 0 : f.position);
112
+ return u(c, E(o(c), { ...f, ...M }, g)), o(c).find((h) => h.id === l);
95
113
  },
96
- async deleteModuleItem({ courseId: t, moduleId: e, itemId: s }) {
97
- r(t), M(
98
- e,
99
- u(e).filter((i) => i.id !== s)
114
+ async deleteModuleItem({ courseId: r, moduleId: d, itemId: l }) {
115
+ i(r), u(
116
+ d,
117
+ o(d).filter((p) => p.id !== l)
100
118
  );
101
119
  },
102
- async reorderModuleItems({ courseId: t, moduleId: e, itemIds: s }) {
103
- r(t), M(e, v(u(e), s));
120
+ async reorderModuleItems({ courseId: r, moduleId: d, itemIds: l }) {
121
+ i(r), u(d, z(o(d), l));
104
122
  }
105
123
  };
106
124
  }
107
- const D = [
125
+ const rt = [
108
126
  "createModule",
109
127
  "updateModule",
110
128
  "deleteModule",
@@ -115,75 +133,720 @@ const D = [
115
133
  "deleteModuleItem",
116
134
  "reorderModuleItems"
117
135
  ];
118
- function I(o, a, r, l, u) {
119
- return $({
120
- mutationFn: (M) => !a[o] || !l ? Promise.reject(new Error(`${o} is not available to this editor`)) : l({ ...M, courseId: r }),
136
+ function A(e, t, i, a, o) {
137
+ return Ee({
138
+ mutationFn: (u) => !t[e] || !a ? Promise.reject(new Error(`${e} is not available to this editor`)) : a({ ...u, courseId: i }),
121
139
  // Settled, not success: a bulk write that fails partway has still committed part of itself.
122
- onSettled: (M, m, t) => u(t)
140
+ onSettled: (u, s, r) => o(r)
123
141
  });
124
142
  }
125
- function F(o) {
126
- const { adapter: a, courseId: r } = o, l = C({ ...o, view: "teacher" }), u = S(), { permissions: M } = E(), m = j(
143
+ function Zt(e) {
144
+ const { adapter: t, courseId: i } = e, a = Me({ ...e, view: "teacher" }), o = Se(), { permissions: u } = K(), s = T(
127
145
  () => Object.fromEntries(
128
- D.map((d) => [
129
- d,
130
- typeof a[d] == "function" && M[d] !== !1
146
+ rt.map((c) => [
147
+ c,
148
+ typeof t[c] == "function" && u[c] !== !1
131
149
  ])
132
150
  ),
133
- [a, M]
134
- ), t = () => q(u, r), e = (...d) => Promise.all([
135
- t(),
136
- ...d.map((n) => B(u, r, n))
137
- ]), s = (d) => {
138
- var n;
139
- return (n = a[d]) == null ? void 0 : n.bind(a);
140
- }, i = {
141
- createModule: I("createModule", m, r, s("createModule"), t),
142
- updateModule: I("updateModule", m, r, s("updateModule"), t),
143
- deleteModule: I("deleteModule", m, r, s("deleteModule"), t),
144
- reorderModules: I("reorderModules", m, r, s("reorderModules"), t),
145
- setModulesPublished: I(
151
+ [t, u]
152
+ ), r = () => be(o, i), d = (...c) => Promise.all([
153
+ r(),
154
+ ...c.map((m) => ye(o, i, m))
155
+ ]), l = (c) => {
156
+ var m;
157
+ return (m = t[c]) == null ? void 0 : m.bind(t);
158
+ }, p = {
159
+ createModule: A("createModule", s, i, l("createModule"), r),
160
+ updateModule: A("updateModule", s, i, l("updateModule"), r),
161
+ deleteModule: A("deleteModule", s, i, l("deleteModule"), r),
162
+ reorderModules: A("reorderModules", s, i, l("reorderModules"), r),
163
+ setModulesPublished: A(
146
164
  "setModulesPublished",
147
- m,
148
- r,
149
- s("setModulesPublished"),
150
- ({ includeItems: d }) => d ? A(u, r) : t()
165
+ s,
166
+ i,
167
+ l("setModulesPublished"),
168
+ ({ includeItems: c }) => c ? ve(o, i) : r()
151
169
  ),
152
- createModuleItem: I(
170
+ createModuleItem: A(
153
171
  "createModuleItem",
154
- m,
155
- r,
156
- s("createModuleItem"),
157
- ({ moduleId: d }) => e(d)
172
+ s,
173
+ i,
174
+ l("createModuleItem"),
175
+ ({ moduleId: c }) => d(c)
158
176
  ),
159
- updateModuleItem: I(
177
+ updateModuleItem: A(
160
178
  "updateModuleItem",
161
- m,
162
- r,
163
- s("updateModuleItem"),
164
- ({ moduleId: d, patch: n }) => e(
165
- d,
166
- ...n.moduleId && n.moduleId !== d ? [n.moduleId] : []
179
+ s,
180
+ i,
181
+ l("updateModuleItem"),
182
+ ({ moduleId: c, patch: m }) => d(
183
+ c,
184
+ ...m.moduleId && m.moduleId !== c ? [m.moduleId] : []
167
185
  )
168
186
  ),
169
- deleteModuleItem: I(
187
+ deleteModuleItem: A(
170
188
  "deleteModuleItem",
171
- m,
172
- r,
173
- s("deleteModuleItem"),
174
- ({ moduleId: d }) => e(d)
189
+ s,
190
+ i,
191
+ l("deleteModuleItem"),
192
+ ({ moduleId: c }) => d(c)
175
193
  ),
176
- reorderModuleItems: I(
194
+ reorderModuleItems: A(
177
195
  "reorderModuleItems",
178
- m,
179
- r,
180
- s("reorderModuleItems"),
181
- ({ moduleId: d }) => e(d)
196
+ s,
197
+ i,
198
+ l("reorderModuleItems"),
199
+ ({ moduleId: c }) => d(c)
182
200
  )
183
201
  };
184
- return { ...l, can: m, mutations: i };
202
+ return { ...a, can: s, mutations: p };
203
+ }
204
+ const le = (e) => `module:${e}`, ce = (e) => `item:${e}`, en = (e) => `external:${e}`, dt = (e) => `items:${e}`;
205
+ function D(e) {
206
+ const t = e == null ? void 0 : e.data.current, i = t == null ? void 0 : t.kind;
207
+ return i === "module" || i === "item" || i === "external" ? t : void 0;
208
+ }
209
+ function ue(e) {
210
+ var t;
211
+ return (t = e == null ? void 0 : e.data.current) == null ? void 0 : t.sortable;
212
+ }
213
+ const me = (e, t) => (e == null ? void 0 : e.kind) === "item" && (t == null ? void 0 : t.kind) === "item" && e.moduleId !== t.moduleId, U = (e) => e.top + e.height / 2, q = (e, t) => e !== null && U(e) > U(t.rect);
214
+ function j(e, t) {
215
+ const i = D(t), a = ue(t);
216
+ if (!(!t || !i || !a))
217
+ return i.kind === "item" && me(D(e), i) ? {
218
+ position: a.index + (q(e.rect.current.translated, t) ? 2 : 1),
219
+ count: a.items.length + 1,
220
+ module: i.moduleName
221
+ } : {
222
+ position: a.index + 1,
223
+ count: a.items.length,
224
+ module: i.kind === "item" ? i.moduleName : void 0
225
+ };
226
+ }
227
+ function st(e) {
228
+ const t = (s) => (r) => {
229
+ var l;
230
+ const d = (l = D(r.active)) == null ? void 0 : l.name;
231
+ return d === void 0 ? void 0 : s(d, r);
232
+ }, i = t((s, { active: r, over: d }) => {
233
+ const l = j(r, d);
234
+ if (!l) return e("dragOverNothing", { name: s });
235
+ const { position: p, count: c, module: m } = l;
236
+ return m === void 0 ? e("dragOverPosition", { name: s, position: p, count: c }) : e("dragOverPositionInModule", { name: s, position: p, count: c, module: m });
237
+ });
238
+ let a = !1, o, u;
239
+ return {
240
+ onDragStart: t((s) => (a = !0, e("dragPickedUp", { name: s }))),
241
+ onDragOver: (s) => {
242
+ var d, l;
243
+ const r = a && ((d = s.over) == null ? void 0 : d.id) === s.active.id;
244
+ return a = !1, o = (l = s.over) == null ? void 0 : l.id, u = i(s), r ? void 0 : u;
245
+ },
246
+ // Crossing the middle of an item in another module changes where it lands, but not `over`.
247
+ onDragMove: (s) => {
248
+ if (!s.over || s.over.id !== o) return;
249
+ const r = i(s);
250
+ if (r !== u)
251
+ return u = r, r;
252
+ },
253
+ onDragEnd: t((s, { active: r, over: d }) => {
254
+ const l = j(r, d);
255
+ if (!l) return e("dragDroppedNowhere", { name: s });
256
+ const { position: p, count: c, module: m } = l;
257
+ return m === void 0 ? e("dragDroppedPosition", { name: s, position: p, count: c }) : e("dragDroppedPositionInModule", { name: s, position: p, count: c, module: m });
258
+ }),
259
+ onDragCancel: t((s) => e("dragCanceled", { name: s }))
260
+ };
261
+ }
262
+ function at(e) {
263
+ const t = st(e), i = (a) => (o) => {
264
+ const u = a(o);
265
+ u && ee(u);
266
+ };
267
+ return {
268
+ announcements: {
269
+ onDragStart: i(t.onDragStart),
270
+ onDragOver: i(t.onDragOver),
271
+ onDragMove: i(t.onDragMove),
272
+ onDragEnd: i(t.onDragEnd),
273
+ onDragCancel: i(t.onDragCancel)
274
+ },
275
+ screenReaderInstructions: { draggable: e("dragInstructions") }
276
+ };
277
+ }
278
+ const ge = Oe(null);
279
+ function lt() {
280
+ return Te(ge);
281
+ }
282
+ function pe(e, t, i) {
283
+ const { t: a } = w(), o = ze({
284
+ id: e,
285
+ data: { ...t },
286
+ disabled: !i,
287
+ attributes: { roleDescription: a("dragRoleDescription") }
288
+ }), u = {
289
+ transform: je.Translate.toString(o.transform),
290
+ transition: o.transition,
291
+ opacity: o.isDragging ? ct : void 0
292
+ };
293
+ return { ...o, style: u };
294
+ }
295
+ const ct = 0.4, ut = (e) => e === "module" ? "module" : "item", mt = (e) => {
296
+ var a;
297
+ const t = ut((a = D(e.active)) == null ? void 0 : a.kind), i = {
298
+ ...e,
299
+ droppableContainers: e.droppableContainers.filter(
300
+ (o) => {
301
+ var u;
302
+ return ((u = D(o)) == null ? void 0 : u.kind) === t;
303
+ }
304
+ )
305
+ };
306
+ return t === "item" && $e(i).length === 0 ? [] : He(i);
307
+ }, gt = (e, t) => {
308
+ const { active: i, over: a, collisionRect: o } = t.context, u = ue(a);
309
+ if (a !== null && o !== null && u !== void 0 && u.index === u.items.length - 1 && me(D(i), D(a))) {
310
+ const r = q(o, a);
311
+ if (e.code === "ArrowDown" && !r)
312
+ return e.preventDefault(), { x: a.rect.left, y: a.rect.bottom - o.height / 2 };
313
+ if (e.code === "ArrowUp" && r)
314
+ return e.preventDefault(), { x: a.rect.left, y: a.rect.top };
315
+ }
316
+ return Ue(e, t);
317
+ }, pt = { cursor: "grabbing" };
318
+ function ht({ data: e, children: t }) {
319
+ const { t: i } = w(), { modules: a, getItems: o, can: u, mutations: s } = e, [r, d] = X(null), l = T(() => at(i), [i]), p = Ne(
320
+ $(qe, { activationConstraint: { distance: 8 } }),
321
+ $(xe, { coordinateGetter: gt })
322
+ ), c = T(() => a.map((f) => le(f.id)), [a]), m = ({ active: f }) => {
323
+ d(D(f) ?? null);
324
+ }, M = ({ active: f, over: I }) => {
325
+ d(null);
326
+ const g = D(f), h = D(I);
327
+ if (!g || !h || !I) return;
328
+ if (g.kind === "module" && h.kind === "module") {
329
+ if (g.moduleId === h.moduleId) return;
330
+ const k = a.map((y) => y.id);
331
+ s.reorderModules.mutate({
332
+ moduleIds: H(k, k.indexOf(g.moduleId), k.indexOf(h.moduleId))
333
+ });
334
+ return;
335
+ }
336
+ if (g.kind !== "item" || h.kind !== "item" || g.itemId === h.itemId) return;
337
+ if (g.moduleId === h.moduleId) {
338
+ const k = o(g.moduleId).items.map((y) => y.id);
339
+ s.reorderModuleItems.mutate({
340
+ moduleId: g.moduleId,
341
+ itemIds: H(k, k.indexOf(g.itemId), k.indexOf(h.itemId))
342
+ });
343
+ return;
344
+ }
345
+ if (!u.updateModuleItem) return;
346
+ const R = q(f.rect.current.translated, I);
347
+ s.updateModuleItem.mutate({
348
+ moduleId: g.moduleId,
349
+ itemId: g.itemId,
350
+ patch: { moduleId: h.moduleId, position: h.position + (R ? 1 : 0) }
351
+ });
352
+ };
353
+ return /* @__PURE__ */ n(ge.Provider, { value: (r == null ? void 0 : r.kind) ?? null, children: /* @__PURE__ */ v(
354
+ Fe,
355
+ {
356
+ sensors: p,
357
+ collisionDetection: mt,
358
+ accessibility: l,
359
+ onDragStart: m,
360
+ onDragEnd: M,
361
+ onDragCancel: () => d(null),
362
+ children: [
363
+ /* @__PURE__ */ n(de, { items: c, strategy: se, children: t }),
364
+ /* @__PURE__ */ n(_e, { children: r ? /* @__PURE__ */ n("div", { style: pt, children: /* @__PURE__ */ n(
365
+ C,
366
+ {
367
+ as: "div",
368
+ background: "primary",
369
+ borderRadius: "card.sm",
370
+ borderWidth: "small",
371
+ shadow: "topmost",
372
+ padding: "small",
373
+ "data-testid": "edit-drag-overlay",
374
+ children: /* @__PURE__ */ n(L, { weight: "bold", children: r.name })
375
+ }
376
+ ) }) : null })
377
+ ]
378
+ }
379
+ ) });
380
+ }
381
+ function ft(e) {
382
+ return null;
383
+ }
384
+ function he({
385
+ label: e,
386
+ attributes: t,
387
+ listeners: i,
388
+ activatorRef: a,
389
+ color: o = "primary",
390
+ "data-testid": u
391
+ }) {
392
+ return /* @__PURE__ */ n(
393
+ ae,
394
+ {
395
+ ...t,
396
+ ...i,
397
+ elementRef: (s) => a(s),
398
+ size: "small",
399
+ withBackground: !1,
400
+ withBorder: !1,
401
+ color: o,
402
+ cursor: "grab",
403
+ screenReaderLabel: e,
404
+ "data-testid": u,
405
+ children: /* @__PURE__ */ n(Ye, {})
406
+ }
407
+ );
408
+ }
409
+ function N(e) {
410
+ return null;
411
+ }
412
+ function It(e) {
413
+ return null;
414
+ }
415
+ function Mt(e) {
416
+ return null;
417
+ }
418
+ function vt(e) {
419
+ return null;
420
+ }
421
+ function bt(e) {
422
+ return null;
423
+ }
424
+ function yt(e) {
425
+ return null;
426
+ }
427
+ function Pt({
428
+ item: e,
429
+ module: t,
430
+ today: i,
431
+ canReorder: a
432
+ }) {
433
+ var x, F;
434
+ const { t: o, locale: u, timezone: s } = w(), r = Y(), d = K(), l = G(), p = T(() => Pe(d.itemMeta), [d.itemMeta]), c = e.title || o("itemUntitled"), m = pe(
435
+ ce(e.id),
436
+ {
437
+ kind: "item",
438
+ moduleId: t.id,
439
+ moduleName: t.name,
440
+ itemId: e.id,
441
+ name: c,
442
+ position: e.position
443
+ },
444
+ a
445
+ ), M = a ? /* @__PURE__ */ n(b.Item, { children: /* @__PURE__ */ n(
446
+ he,
447
+ {
448
+ label: o("dragHandleLabel", { name: c }),
449
+ attributes: m.attributes,
450
+ listeners: m.listeners,
451
+ activatorRef: m.setActivatorNodeRef,
452
+ "data-testid": `item-drag-handle-${e.id}`
453
+ }
454
+ ) }) : null, f = /* @__PURE__ */ v(Z, { children: [
455
+ /* @__PURE__ */ n(bt, { module: t, item: e }),
456
+ /* @__PURE__ */ n(yt, { item: e })
457
+ ] });
458
+ if (e.type === "sub_header")
459
+ return /* @__PURE__ */ n("div", { ref: m.setNodeRef, style: m.style, children: /* @__PURE__ */ n(
460
+ C,
461
+ {
462
+ as: "div",
463
+ padding: "x-small small",
464
+ borderWidth: "small 0 0 0",
465
+ "data-testid": `edit-item-${e.id}`,
466
+ children: /* @__PURE__ */ v(b, { alignItems: "center", gap: "small", children: [
467
+ M,
468
+ /* @__PURE__ */ v(b.Item, { shouldGrow: !0, shouldShrink: !0, children: [
469
+ /* @__PURE__ */ n(L, { weight: "bold", "data-testid": "edit-item-title", children: c }),
470
+ /* @__PURE__ */ n(N, { name: c })
471
+ ] }),
472
+ f
473
+ ] })
474
+ }
475
+ ) });
476
+ const I = ke(d.itemTypes, e.type), g = I != null && I.renderIcon ? I.renderIcon({ item: e }) : I == null ? void 0 : I.icon, h = ((F = (x = d.navigation).getItemEditHref) == null ? void 0 : F.call(x, e)) ?? null, R = { item: e, t: o, today: i, locale: u, timezone: s, formatters: r, config: d }, k = p.map((P) => ({
477
+ key: P.key,
478
+ node: P.render(R),
479
+ icon: P.key === Ce ? null : P.renderIcon ? P.renderIcon(R) : P.icon
480
+ })).filter((P) => !B(P.node)), y = /* @__PURE__ */ n(L, { weight: "bold", "data-testid": "edit-item-title", children: c });
481
+ return /* @__PURE__ */ n("div", { ref: m.setNodeRef, style: m.style, children: /* @__PURE__ */ n(C, { as: "div", padding: "small", borderWidth: "small 0 0 0", "data-testid": `edit-item-${e.id}`, children: /* @__PURE__ */ n("div", { style: { paddingInlineStart: `${Math.max(e.indent - 1, 0) * Ae}rem` }, children: /* @__PURE__ */ v(b, { alignItems: "center", gap: "small", children: [
482
+ M,
483
+ e.indent > 0 ? /* @__PURE__ */ n(b.Item, { "data-testid": "edit-item-nest-arrow", children: /* @__PURE__ */ n(Ge, { size: "md", color: "mutedColor" }) }) : null,
484
+ B(g) ? null : /* @__PURE__ */ n(b.Item, { "aria-hidden": "true", children: g }),
485
+ /* @__PURE__ */ v(b.Item, { shouldGrow: !0, shouldShrink: !0, children: [
486
+ h ? /* @__PURE__ */ n(ot, { href: h, forceButtonRole: !1, "data-testid": "edit-item-link", children: y }) : y,
487
+ /* @__PURE__ */ n(N, { name: c }),
488
+ k.length > 0 ? /* @__PURE__ */ n("div", { style: De, children: /* @__PURE__ */ n(
489
+ L,
490
+ {
491
+ size: "small",
492
+ lineHeight: "default",
493
+ color: "secondary",
494
+ "data-testid": "edit-item-meta",
495
+ children: k.map((P, _) => /* @__PURE__ */ v(J, { children: [
496
+ _ > 0 ? /* @__PURE__ */ n("span", { style: V, children: " " }) : null,
497
+ /* @__PURE__ */ v("span", { style: _ > 0 ? l : void 0, children: [
498
+ B(P.icon) ? null : /* @__PURE__ */ n("span", { style: Q, "aria-hidden": "true", children: P.icon }),
499
+ P.node
500
+ ] })
501
+ ] }, P.key))
502
+ }
503
+ ) }) : null
504
+ ] }),
505
+ /* @__PURE__ */ n(b.Item, { children: /* @__PURE__ */ n(it, { "data-testid": "edit-item-requirement", children: e.completionRequirement ? o("itemRequiredTag") : o("itemOptionalTag") }) }),
506
+ f
507
+ ] }) }) }) });
508
+ }
509
+ const kt = Le("grey"), W = (e) => `platform-modules-edit-panel-${e}`, O = { size: "sm", color: "onColor" };
510
+ function Ct(e, t, i, a) {
511
+ const o = [
512
+ {
513
+ key: "items",
514
+ icon: /* @__PURE__ */ n(Xe, { ...O }),
515
+ text: i("moduleItemCount", { count: e.itemCount })
516
+ }
517
+ ], u = [];
518
+ e.unlockAt && new Date(e.unlockAt) > t && u.push(a.unlockByline(e.unlockAt, t));
519
+ const s = e.prerequisiteModules.map((d) => d.name.trim()).filter(Boolean);
520
+ s.length === 1 ? u.push(i("lockedByPrerequisiteByline", { name: s[0] })) : s.length > 1 && u.push(
521
+ i("lockedByPrerequisitesByline", {
522
+ count: s.length,
523
+ prerequisites: s.join(", ")
524
+ })
525
+ ), u.length > 0 && o.push({ key: "lock", icon: /* @__PURE__ */ n(et, { ...O }), text: u.join(" ") }), e.completionRequirements && e.completionRequirements.length > 0 && o.push({
526
+ key: "requirement",
527
+ icon: /* @__PURE__ */ n(Je, { ...O }),
528
+ text: e.requireSequentialProgress ? i("moduleRequirementAllInOrder") : e.requirementCount === 1 ? i("moduleRequirementOne") : i("moduleRequirementAll")
529
+ });
530
+ const r = we(e.items);
531
+ return r !== null && o.push({
532
+ key: "duration",
533
+ icon: /* @__PURE__ */ n(Ze, { ...O }),
534
+ text: a.estimatedDurationByline(r)
535
+ }), o;
536
+ }
537
+ function Dt({
538
+ module: e,
539
+ state: t,
540
+ today: i,
541
+ canReorder: a
542
+ }) {
543
+ const { t: o } = w();
544
+ if (t.error)
545
+ return /* @__PURE__ */ n(C, { as: "div", padding: "small", children: /* @__PURE__ */ n(
546
+ ne,
547
+ {
548
+ variant: "error",
549
+ margin: "0",
550
+ liveRegion: te,
551
+ liveRegionPoliteness: "assertive",
552
+ "data-testid": "edit-items-error",
553
+ children: o("itemsLoadErrorAlert", { message: t.error.message })
554
+ }
555
+ ) });
556
+ if (t.isLoading)
557
+ return /* @__PURE__ */ n(C, { as: "div", padding: "small", "data-testid": "edit-items-loading", children: /* @__PURE__ */ n(re, { size: "x-small", renderTitle: o("itemsLoadingSpinnerLabel") }) });
558
+ if (t.items.length === 0)
559
+ return /* @__PURE__ */ n(C, { as: "div", padding: "small", "data-testid": "edit-items-empty", children: /* @__PURE__ */ n(L, { size: "small", color: "secondary", children: o("noItemsEmptyState") }) });
560
+ const u = (s) => {
561
+ s === 1 ? t.goToFirstPage() : s === t.page - 1 ? t.goToPreviousPage() : s === t.page + 1 ? t.goToNextPage() : s === t.pageCount && t.goToLastPage();
562
+ };
563
+ return /* @__PURE__ */ v(Z, { children: [
564
+ /* @__PURE__ */ n(
565
+ de,
566
+ {
567
+ id: dt(e.id),
568
+ items: t.items.map((s) => ce(s.id)),
569
+ strategy: se,
570
+ children: /* @__PURE__ */ n(tt, { isUnstyled: !0, margin: "none", "data-testid": "edit-items-list", children: t.items.map((s) => /* @__PURE__ */ n(nt, { children: /* @__PURE__ */ n(
571
+ Pt,
572
+ {
573
+ item: s,
574
+ module: e,
575
+ today: i,
576
+ canReorder: a
577
+ }
578
+ ) }, s.id)) })
579
+ }
580
+ ),
581
+ t.pageCount > 1 ? /* @__PURE__ */ n(
582
+ oe,
583
+ {
584
+ as: "nav",
585
+ variant: "compact",
586
+ withFirstAndLastButton: !0,
587
+ margin: "small",
588
+ label: /* @__PURE__ */ n(We, { children: o("itemsPaginationLabel", { name: e.name }) }),
589
+ labelFirst: o("paginationFirstPage"),
590
+ labelPrev: o("paginationPreviousPage"),
591
+ labelNext: o("paginationNextPage"),
592
+ labelLast: o("paginationLastPage"),
593
+ screenReaderLabelPageButton: (s) => o("paginationPageLabel", { page: s }),
594
+ ellipsis: o("paginationEllipsis"),
595
+ totalPageNumber: t.pageCount,
596
+ currentPage: t.page,
597
+ disabled: t.isRefreshing,
598
+ onPageChange: u,
599
+ "data-testid": "edit-items-pagination"
600
+ }
601
+ ) : null
602
+ ] });
603
+ }
604
+ function At({
605
+ module: e,
606
+ expanded: t,
607
+ onToggle: i,
608
+ itemsState: a,
609
+ today: o,
610
+ canReorderModules: u,
611
+ canReorderItems: s,
612
+ headingLevel: r = "h3"
613
+ }) {
614
+ var I;
615
+ const { t: d } = w(), l = Y(), p = G(), c = pe(
616
+ le(e.id),
617
+ { kind: "module", moduleId: e.id, name: e.name },
618
+ u
619
+ ), m = ((I = l.moduleLabel(e.position, e)) == null ? void 0 : I.trim()) || null, M = m ? d("moduleNameWithLabel", { label: m, name: e.name }) : e.name, f = Ct(e, o, d, l);
620
+ return /* @__PURE__ */ n("div", { ref: c.setNodeRef, style: c.style, children: /* @__PURE__ */ v(
621
+ C,
622
+ {
623
+ as: "div",
624
+ background: "primary",
625
+ borderRadius: "card.sm",
626
+ borderWidth: "small",
627
+ shadow: "resting",
628
+ margin: "0 0 small 0",
629
+ overflowX: "hidden",
630
+ overflowY: "hidden",
631
+ "data-testid": `edit-module-card-${e.id}`,
632
+ children: [
633
+ /* @__PURE__ */ n(
634
+ C,
635
+ {
636
+ as: "div",
637
+ background: e.published ? "success" : "primary-inverse",
638
+ themeOverride: e.published ? void 0 : kt,
639
+ padding: "small",
640
+ "data-testid": "edit-module-header",
641
+ "data-published": e.published ? "true" : "false",
642
+ children: /* @__PURE__ */ v(b, { alignItems: "start", gap: "small", children: [
643
+ u ? /* @__PURE__ */ n(b.Item, { children: /* @__PURE__ */ n(
644
+ he,
645
+ {
646
+ label: d("dragHandleLabel", { name: e.name }),
647
+ attributes: c.attributes,
648
+ listeners: c.listeners,
649
+ activatorRef: c.setActivatorNodeRef,
650
+ color: "primary-inverse",
651
+ "data-testid": `module-drag-handle-${e.id}`
652
+ }
653
+ ) }) : null,
654
+ /* @__PURE__ */ n(b.Item, { children: /* @__PURE__ */ n(
655
+ ae,
656
+ {
657
+ size: "small",
658
+ withBackground: !1,
659
+ withBorder: !1,
660
+ color: "primary-inverse",
661
+ screenReaderLabel: t ? d("collapseModule", { name: e.name }) : d("expandModule", { name: e.name }),
662
+ "aria-expanded": t,
663
+ "aria-controls": W(e.id),
664
+ onClick: () => i(e.id),
665
+ "data-testid": `edit-toggle-module-${e.id}`,
666
+ children: t ? /* @__PURE__ */ n(Ve, {}) : /* @__PURE__ */ n(Qe, {})
667
+ }
668
+ ) }),
669
+ /* @__PURE__ */ v(b.Item, { shouldGrow: !0, shouldShrink: !0, children: [
670
+ /* @__PURE__ */ n(
671
+ ie,
672
+ {
673
+ level: r,
674
+ variant: "titleCardMini",
675
+ color: "primary-on",
676
+ "aria-label": M,
677
+ "data-testid": "edit-module-name",
678
+ children: /* @__PURE__ */ n(Be, { linesAllowed: 2, children: M })
679
+ }
680
+ ),
681
+ /* @__PURE__ */ n(N, { name: e.name }),
682
+ /* @__PURE__ */ n(C, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ n(L, { size: "small", color: "primary-on", "data-testid": "edit-module-meta", children: f.map((g, h) => /* @__PURE__ */ v(J, { children: [
683
+ h > 0 ? /* @__PURE__ */ n("span", { style: V, children: " " }) : null,
684
+ /* @__PURE__ */ v("span", { style: h > 0 ? p : void 0, children: [
685
+ /* @__PURE__ */ n("span", { style: Q, "aria-hidden": "true", children: g.icon }),
686
+ g.text
687
+ ] })
688
+ ] }, g.key)) }) })
689
+ ] }),
690
+ /* @__PURE__ */ n(ft, { module: e }),
691
+ /* @__PURE__ */ n(vt, { module: e }),
692
+ /* @__PURE__ */ n(It, { module: e }),
693
+ /* @__PURE__ */ n(Mt, { module: e })
694
+ ] })
695
+ }
696
+ ),
697
+ /* @__PURE__ */ n("div", { id: W(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ n(
698
+ Dt,
699
+ {
700
+ module: e,
701
+ state: a,
702
+ today: o,
703
+ canReorder: s
704
+ }
705
+ ) : null })
706
+ ]
707
+ }
708
+ ) });
709
+ }
710
+ function Lt({
711
+ data: e,
712
+ today: t,
713
+ cardHeadingLevel: i
714
+ }) {
715
+ const { modules: a, expandedModuleIds: o, toggleModule: u, getItems: s, can: r } = e, d = lt() === "module";
716
+ return /* @__PURE__ */ n("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "edit-modules-stack", children: a.map((l) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
717
+ At,
718
+ {
719
+ module: l,
720
+ expanded: !d && o.includes(l.id),
721
+ onToggle: u,
722
+ itemsState: s(l.id),
723
+ today: t,
724
+ canReorderModules: r.reorderModules,
725
+ canReorderItems: r.reorderModuleItems,
726
+ headingLevel: i
727
+ }
728
+ ) }, l.id)) });
729
+ }
730
+ function tn({
731
+ data: e,
732
+ today: t,
733
+ as: i = "div",
734
+ headingLevel: a = "h2"
735
+ }) {
736
+ const { t: o } = w(), {
737
+ modules: u,
738
+ page: s,
739
+ pageCount: r,
740
+ goToFirstPage: d,
741
+ goToPreviousPage: l,
742
+ goToNextPage: p,
743
+ goToLastPage: c,
744
+ isLoading: m,
745
+ isRefreshing: M,
746
+ error: f
747
+ } = e, [I] = X(() => /* @__PURE__ */ new Date()), g = a === "h1" ? "h2" : "h3", h = m || M && u.length === 0, R = u.length === 0 && !h && !f, k = (y) => {
748
+ y === 1 ? d() : y === s - 1 ? l() : y === s + 1 ? p() : y === r && c();
749
+ };
750
+ return /* @__PURE__ */ v(C, { as: i, display: "block", "data-testid": "modules-edit-view", children: [
751
+ f ? /* @__PURE__ */ n(
752
+ ne,
753
+ {
754
+ variant: "error",
755
+ margin: "0 0 small 0",
756
+ liveRegion: te,
757
+ liveRegionPoliteness: "assertive",
758
+ "data-testid": "edit-modules-error",
759
+ children: o("modulesLoadErrorAlert", { message: f.message })
760
+ }
761
+ ) : null,
762
+ h ? /* @__PURE__ */ n(C, { as: "div", padding: "large", textAlign: "center", "data-testid": "edit-modules-loading", children: /* @__PURE__ */ n(re, { renderTitle: o("modulesLoadingSpinnerLabel") }) }) : null,
763
+ R ? /* @__PURE__ */ v(
764
+ C,
765
+ {
766
+ as: "div",
767
+ background: "primary",
768
+ borderRadius: "card.lg",
769
+ borderWidth: "small",
770
+ shadow: "resting",
771
+ padding: "medium",
772
+ textAlign: "center",
773
+ "data-testid": "edit-modules-empty",
774
+ children: [
775
+ /* @__PURE__ */ n(ie, { level: g, variant: "titleCardLarge", margin: "0 0 x-small 0", children: o("editNoModulesTitle") }),
776
+ /* @__PURE__ */ n(L, { color: "secondary", children: o("editNoModulesDescription") })
777
+ ]
778
+ }
779
+ ) : null,
780
+ /* @__PURE__ */ n(ht, { data: e, children: /* @__PURE__ */ n(
781
+ Lt,
782
+ {
783
+ data: e,
784
+ today: t ?? I,
785
+ cardHeadingLevel: g
786
+ }
787
+ ) }),
788
+ r > 1 && !h ? /* @__PURE__ */ n(
789
+ oe,
790
+ {
791
+ as: "nav",
792
+ variant: "compact",
793
+ withFirstAndLastButton: !0,
794
+ margin: "small 0 0 0",
795
+ labelFirst: o("paginationFirstPage"),
796
+ labelPrev: o("paginationPreviousPage"),
797
+ labelNext: o("paginationNextPage"),
798
+ labelLast: o("paginationLastPage"),
799
+ screenReaderLabelPageButton: (y) => o("paginationPageLabel", { page: y }),
800
+ ellipsis: o("paginationEllipsis"),
801
+ totalPageNumber: r,
802
+ currentPage: s,
803
+ disabled: M,
804
+ onPageChange: k,
805
+ "data-testid": "edit-modules-pagination"
806
+ }
807
+ ) : null
808
+ ] });
809
+ }
810
+ function wt(e) {
811
+ return null;
812
+ }
813
+ function Rt(e) {
814
+ return null;
815
+ }
816
+ function St(e) {
817
+ return null;
818
+ }
819
+ function nn({ data: e }) {
820
+ const { t } = w(), i = Re(), { expandedModuleIds: a, collapseAllModules: o, isPersistingCollapsed: u } = e, s = a.length, r = () => {
821
+ i("collapse-all"), o(), ee(t("modulesCollapsedAnnouncement", { count: s }));
822
+ };
823
+ return /* @__PURE__ */ v(b, { gap: "x-small", wrap: "wrap", justifyItems: "end", "data-testid": "modules-edit-actions", children: [
824
+ /* @__PURE__ */ n(b.Item, { children: /* @__PURE__ */ n(
825
+ Ke,
826
+ {
827
+ size: "small",
828
+ onClick: r,
829
+ interaction: s === 0 || u ? "disabled" : "enabled",
830
+ "data-testid": "edit-collapse-all",
831
+ children: t("collapseAllModules")
832
+ }
833
+ ) }),
834
+ /* @__PURE__ */ n(St, { data: e }),
835
+ /* @__PURE__ */ n(wt, { data: e }),
836
+ /* @__PURE__ */ n(Rt, { data: e })
837
+ ] });
185
838
  }
186
839
  export {
187
- k as createInMemoryEditAdapter,
188
- F as useModulesEditData
840
+ ht as EditDndProvider,
841
+ At as EditModuleCard,
842
+ Pt as EditModuleItemRow,
843
+ nn as ModulesEditActions,
844
+ tn as ModulesEditView,
845
+ Jt as createInMemoryEditAdapter,
846
+ D as dragDataOf,
847
+ en as externalDragId,
848
+ ce as itemDragId,
849
+ le as moduleDragId,
850
+ lt as useActiveDragKind,
851
+ Zt as useModulesEditData
189
852
  };