@instructure/platform-modules 1.1.0 → 1.2.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.
- package/dist/adapters/canvasGraphql/index.d.ts +7 -0
- package/dist/adapters/canvasGraphql/index.d.ts.map +1 -1
- package/dist/adapters/canvasGraphql/normalize.d.ts +12 -7
- package/dist/adapters/canvasGraphql/normalize.d.ts.map +1 -1
- package/dist/components/StatusPill.d.ts.map +1 -1
- package/dist/fixtures/generate.d.ts.map +1 -1
- package/dist/index.js +865 -890
- package/dist/types/enums.d.ts +5 -3
- package/dist/types/enums.d.ts.map +1 -1
- package/locales/en.json +2 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { z as c } from "zod";
|
|
2
|
-
import { gql as
|
|
3
|
-
import { jsx as i, jsxs as
|
|
4
|
-
import { createContext as
|
|
5
|
-
import { PlugInstUIIcon as
|
|
6
|
-
import { useInfiniteQuery as
|
|
7
|
-
import
|
|
8
|
-
import { Button as
|
|
9
|
-
import { Flex as
|
|
2
|
+
import { gql as ge } from "graphql-tag";
|
|
3
|
+
import { jsx as i, jsxs as _ } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as St, useContext as yt, useMemo as R, isValidElement as _t, useCallback as k, useRef as U, useState as pe, useEffect as Le, useId as Be, memo as Tt, Fragment as Et } from "react";
|
|
5
|
+
import { PlugInstUIIcon as gn, ExternalLinkInstUIIcon as hn, FileInstUIIcon as In, FileTextInstUIIcon as bn, MessagesSquareInstUIIcon as Mn, RocketInstUIIcon as Sn, FilePenLineInstUIIcon as yn, LockInstUIIcon as Pt, TriangleAlertInstUIIcon as de, CircleCheckInstUIIcon as Ct, ClockFadingInstUIIcon as wt, IconArrowNestLine as _n, IconArrowOpenUpLine as Tn, IconArrowOpenDownLine as vt, IconSearchLine as En } from "@instructure/ui-icons";
|
|
6
|
+
import { useInfiniteQuery as He, useQueryClient as Lt, InfiniteQueryObserver as Pn } from "@tanstack/react-query";
|
|
7
|
+
import Cn from "p-limit";
|
|
8
|
+
import { Button as me, IconButton as wn } from "@instructure/ui-buttons/v11_7";
|
|
9
|
+
import { Flex as S } from "@instructure/ui-flex/v11_7";
|
|
10
10
|
import { Text as P } from "@instructure/ui-text/v11_7";
|
|
11
|
-
import { View as
|
|
12
|
-
import { TruncateWithTooltip as
|
|
11
|
+
import { View as T } from "@instructure/ui-view/v11_7";
|
|
12
|
+
import { TruncateWithTooltip as vn, politeAnnounce as At, getLiveRegion as xt } from "@instructure/platform-instui-bindings";
|
|
13
13
|
import { Alert as Rt } from "@instructure/ui-alerts/v11_7";
|
|
14
|
-
import { Heading as
|
|
14
|
+
import { Heading as Nt } from "@instructure/ui-heading/v11_7";
|
|
15
15
|
import { ProgressBar as Ln } from "@instructure/ui-progress/v11_7";
|
|
16
|
-
import { Spinner as
|
|
17
|
-
import { useTheme as
|
|
16
|
+
import { Spinner as qt } from "@instructure/ui-spinner/v11_7";
|
|
17
|
+
import { useTheme as Dt } from "@instructure/emotion";
|
|
18
18
|
import { ScreenReaderContent as nt } from "@instructure/ui-a11y-content";
|
|
19
|
-
import { Link as
|
|
20
|
-
import { Pill as
|
|
21
|
-
import { WithBreakpoints as
|
|
22
|
-
import { Menu as
|
|
23
|
-
import { TextInput as
|
|
24
|
-
const
|
|
19
|
+
import { Link as An } from "@instructure/ui-link/v11_7";
|
|
20
|
+
import { Pill as xn } from "@instructure/ui-pill/v11_7";
|
|
21
|
+
import { WithBreakpoints as Rn } from "@instructure/platform-with-breakpoints";
|
|
22
|
+
import { Menu as ze } from "@instructure/ui-menu/v11_7";
|
|
23
|
+
import { TextInput as Nn } from "@instructure/ui-text-input/v11_7";
|
|
24
|
+
const qn = c.object({
|
|
25
25
|
target: c.enum(["module", "item"]),
|
|
26
26
|
field: c.string(),
|
|
27
27
|
op: c.enum(["eq", "contains"]),
|
|
28
28
|
value: c.union([c.string(), c.boolean()])
|
|
29
29
|
}).strict();
|
|
30
|
-
function
|
|
30
|
+
function Dn(e, t) {
|
|
31
31
|
const n = e == null ? void 0 : e[t.target];
|
|
32
32
|
return !n || !Object.prototype.hasOwnProperty.call(n, t.field) ? !1 : n[t.field].includes(t.op);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const kn = c.enum([
|
|
35
35
|
"assignment",
|
|
36
36
|
"quiz",
|
|
37
37
|
"discussion",
|
|
@@ -40,16 +40,7 @@ const qn = c.enum([
|
|
|
40
40
|
"external_url",
|
|
41
41
|
"external_tool",
|
|
42
42
|
"sub_header"
|
|
43
|
-
]),
|
|
44
|
-
"not_started",
|
|
45
|
-
"in_progress",
|
|
46
|
-
"complete",
|
|
47
|
-
"submitted",
|
|
48
|
-
"graded",
|
|
49
|
-
"excused",
|
|
50
|
-
"missing",
|
|
51
|
-
"locked"
|
|
52
|
-
]), On = c.enum([
|
|
43
|
+
]), On = c.enum(["not_started", "in_progress", "complete", "incomplete", "missing", "locked"]), Fn = c.enum([
|
|
53
44
|
"not_started",
|
|
54
45
|
"in_progress",
|
|
55
46
|
"complete",
|
|
@@ -57,7 +48,7 @@ const qn = c.enum([
|
|
|
57
48
|
"incomplete",
|
|
58
49
|
"missing_and_incomplete",
|
|
59
50
|
"locked"
|
|
60
|
-
]),
|
|
51
|
+
]), Un = c.enum([
|
|
61
52
|
"must_view",
|
|
62
53
|
"must_mark_done",
|
|
63
54
|
"must_contribute",
|
|
@@ -65,8 +56,8 @@ const qn = c.enum([
|
|
|
65
56
|
"min_score",
|
|
66
57
|
"min_percentage",
|
|
67
58
|
"unknown"
|
|
68
|
-
]),
|
|
69
|
-
status:
|
|
59
|
+
]), zn = c.object({
|
|
60
|
+
status: Fn.optional(),
|
|
70
61
|
requirementsMet: c.number(),
|
|
71
62
|
requirementCount: c.number(),
|
|
72
63
|
percentComplete: c.number().min(0).max(100),
|
|
@@ -75,14 +66,14 @@ const qn = c.enum([
|
|
|
75
66
|
incompleteCount: c.number()
|
|
76
67
|
}), kt = c.object({
|
|
77
68
|
itemId: c.string(),
|
|
78
|
-
type:
|
|
69
|
+
type: Un,
|
|
79
70
|
minScore: c.number().nullish(),
|
|
80
71
|
minPercentage: c.number().nullish()
|
|
81
72
|
}), Ot = c.object({
|
|
82
73
|
id: c.string(),
|
|
83
74
|
moduleId: c.string(),
|
|
84
75
|
title: c.string(),
|
|
85
|
-
type:
|
|
76
|
+
type: kn,
|
|
86
77
|
position: c.number(),
|
|
87
78
|
indent: c.number(),
|
|
88
79
|
published: c.boolean(),
|
|
@@ -90,13 +81,13 @@ const qn = c.enum([
|
|
|
90
81
|
newTab: c.boolean().nullish(),
|
|
91
82
|
completionRequirement: kt.nullish(),
|
|
92
83
|
dueAt: c.string().nullish(),
|
|
93
|
-
status:
|
|
84
|
+
status: On.optional(),
|
|
94
85
|
pointsPossible: c.number().nullish(),
|
|
95
86
|
extensions: c.record(c.unknown()).optional()
|
|
96
|
-
}),
|
|
87
|
+
}), $n = c.object({
|
|
97
88
|
id: c.string(),
|
|
98
89
|
name: c.string()
|
|
99
|
-
}),
|
|
90
|
+
}), Bn = c.object({
|
|
100
91
|
id: c.string(),
|
|
101
92
|
name: c.string(),
|
|
102
93
|
position: c.number(),
|
|
@@ -104,11 +95,11 @@ const qn = c.enum([
|
|
|
104
95
|
itemCount: c.number(),
|
|
105
96
|
items: c.array(Ot).optional(),
|
|
106
97
|
unlockAt: c.string().nullish(),
|
|
107
|
-
prerequisiteModules: c.array(
|
|
98
|
+
prerequisiteModules: c.array($n),
|
|
108
99
|
requirementCount: c.number().nullish(),
|
|
109
100
|
requireSequentialProgress: c.boolean(),
|
|
110
101
|
completionRequirements: c.array(kt).optional(),
|
|
111
|
-
progress:
|
|
102
|
+
progress: zn.optional(),
|
|
112
103
|
extensions: c.record(c.unknown()).optional()
|
|
113
104
|
}), Ft = c.object({
|
|
114
105
|
hasNextPage: c.boolean(),
|
|
@@ -116,30 +107,30 @@ const qn = c.enum([
|
|
|
116
107
|
}).refine((e) => !e.hasNextPage || e.endCursor !== null, {
|
|
117
108
|
message: 'hasNextPage is true but endCursor is null: there is another page and no cursor to ask for it with, which renders a "Load more" that can never load.',
|
|
118
109
|
path: ["endCursor"]
|
|
119
|
-
}), Bn = c.object({
|
|
120
|
-
modules: c.array($n),
|
|
121
|
-
pageInfo: Ft
|
|
122
110
|
}), jn = c.object({
|
|
111
|
+
modules: c.array(Bn),
|
|
112
|
+
pageInfo: Ft
|
|
113
|
+
}), Gn = c.object({
|
|
123
114
|
items: c.array(Ot),
|
|
124
115
|
pageInfo: Ft
|
|
125
116
|
}), Ut = "career.estimatedDurationMinutes";
|
|
126
|
-
function
|
|
117
|
+
function Yn(e) {
|
|
127
118
|
var n;
|
|
128
119
|
const t = (n = e.extensions) == null ? void 0 : n[Ut];
|
|
129
120
|
return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? null : t;
|
|
130
121
|
}
|
|
131
|
-
function
|
|
122
|
+
function Ve(e, t) {
|
|
132
123
|
return t == null ? e : { ...e, [Ut]: t };
|
|
133
124
|
}
|
|
134
|
-
const
|
|
135
|
-
class
|
|
125
|
+
const je = 100, Ke = 2e3;
|
|
126
|
+
class Wn extends Error {
|
|
136
127
|
constructor(t, n) {
|
|
137
128
|
super(
|
|
138
129
|
`This in-memory adapter was built for course ${t} but was asked for course ${n}. A fixture serves exactly one course.`
|
|
139
130
|
), this.name = "InMemoryCourseMismatchError", this.expected = t, this.received = n;
|
|
140
131
|
}
|
|
141
132
|
}
|
|
142
|
-
const
|
|
133
|
+
const Qn = (e) => `offset:${e}`, Hn = (e) => {
|
|
143
134
|
if (!e) return 0;
|
|
144
135
|
const t = Number.parseInt(e.replace("offset:", ""), 10);
|
|
145
136
|
return Number.isFinite(t) && t >= 0 ? t : 0;
|
|
@@ -148,13 +139,13 @@ const Wn = (e) => `offset:${e}`, Qn = (e) => {
|
|
|
148
139
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
149
140
|
};
|
|
150
141
|
function rt(e, t, n) {
|
|
151
|
-
const o =
|
|
142
|
+
const o = Hn(t), r = e.slice(o, o + n), s = o + r.length, l = s < e.length;
|
|
152
143
|
return {
|
|
153
144
|
slice: r,
|
|
154
|
-
pageInfo: { hasNextPage: l, endCursor: l ?
|
|
145
|
+
pageInfo: { hasNextPage: l, endCursor: l ? Qn(s) : null }
|
|
155
146
|
};
|
|
156
147
|
}
|
|
157
|
-
const
|
|
148
|
+
const Vn = /* @__PURE__ */ new Map([
|
|
158
149
|
["COMPLETED", (e) => {
|
|
159
150
|
var t;
|
|
160
151
|
return ((t = e.progress) == null ? void 0 : t.status) === "complete";
|
|
@@ -174,51 +165,51 @@ const Hn = /* @__PURE__ */ new Map([
|
|
|
174
165
|
return ((t = e.progress) == null ? void 0 : t.status) !== "complete" && ((n = e.progress) == null ? void 0 : n.status) !== "in_progress";
|
|
175
166
|
}
|
|
176
167
|
]
|
|
177
|
-
]),
|
|
178
|
-
function
|
|
168
|
+
]), Kn = { module: { completionStatus: ["eq"] } };
|
|
169
|
+
function Zn(e) {
|
|
179
170
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
180
171
|
throw new Error(
|
|
181
172
|
`in-memory adapter cannot compile ${e.target}.${e.field} ${e.op}`
|
|
182
173
|
);
|
|
183
|
-
const t = typeof e.value == "string" ?
|
|
174
|
+
const t = typeof e.value == "string" ? Vn.get(e.value) : void 0;
|
|
184
175
|
if (!t) throw new Error(`unknown completionStatus "${String(e.value)}"`);
|
|
185
176
|
return t;
|
|
186
177
|
}
|
|
187
|
-
function
|
|
178
|
+
function yl(e, t = {}) {
|
|
188
179
|
const n = (r) => e.itemsByModuleId[r] ?? [], o = (r) => {
|
|
189
180
|
if (r !== e.courseId)
|
|
190
|
-
throw new
|
|
181
|
+
throw new Wn(e.courseId, r);
|
|
191
182
|
};
|
|
192
183
|
return {
|
|
193
|
-
capabilities:
|
|
184
|
+
capabilities: Kn,
|
|
194
185
|
async listModules({
|
|
195
186
|
courseId: r,
|
|
196
187
|
cursor: s,
|
|
197
188
|
pageSize: l,
|
|
198
189
|
includeItems: a,
|
|
199
|
-
filter:
|
|
200
|
-
inlineItemsFirst:
|
|
190
|
+
filter: m,
|
|
191
|
+
inlineItemsFirst: d,
|
|
201
192
|
signal: u
|
|
202
193
|
}) {
|
|
203
194
|
var w;
|
|
204
195
|
ot(u), o(r), (w = t.onRequest) == null || w.call(t, "listModules", { operation: "listModules", courseId: r });
|
|
205
|
-
const p =
|
|
206
|
-
return { modules: f.map((
|
|
207
|
-
const y = n(
|
|
208
|
-
return { ...
|
|
209
|
-
}), pageInfo:
|
|
196
|
+
const p = m ? e.modules.filter(Zn(m)) : e.modules, { slice: f, pageInfo: M } = rt(p, s, l), g = Math.min(d ?? je, je);
|
|
197
|
+
return { modules: f.map((E) => {
|
|
198
|
+
const y = n(E.id), N = a && y.length <= g;
|
|
199
|
+
return { ...E, itemCount: y.length, items: N ? y : void 0 };
|
|
200
|
+
}), pageInfo: M };
|
|
210
201
|
},
|
|
211
202
|
async listModuleItems({
|
|
212
203
|
courseId: r,
|
|
213
204
|
moduleId: s,
|
|
214
205
|
cursor: l,
|
|
215
206
|
pageSize: a,
|
|
216
|
-
signal:
|
|
207
|
+
signal: m
|
|
217
208
|
}) {
|
|
218
209
|
var p;
|
|
219
|
-
ot(
|
|
220
|
-
const { slice:
|
|
221
|
-
return { items:
|
|
210
|
+
ot(m), o(r), (p = t.onRequest) == null || p.call(t, "listModuleItems", { operation: "listModuleItems", courseId: r, moduleId: s });
|
|
211
|
+
const { slice: d, pageInfo: u } = rt(n(s), l, a);
|
|
212
|
+
return { items: d, pageInfo: u };
|
|
222
213
|
}
|
|
223
214
|
};
|
|
224
215
|
}
|
|
@@ -234,7 +225,7 @@ function $t(e, t, n) {
|
|
|
234
225
|
if (e != null) return e;
|
|
235
226
|
throw new zt(t, n, "published");
|
|
236
227
|
}
|
|
237
|
-
function
|
|
228
|
+
function Xn(e, t) {
|
|
238
229
|
if (e.onUnsupportedItem) {
|
|
239
230
|
e.onUnsupportedItem(t);
|
|
240
231
|
return;
|
|
@@ -243,7 +234,7 @@ function Zn(e, t) {
|
|
|
243
234
|
`[platform-modules] dropped module item ${t.id}: content type "${t.typename ?? "null"}" is outside the closed ModuleItemType enum. Pass \`onUnsupportedItem\` to handle these yourself.`
|
|
244
235
|
);
|
|
245
236
|
}
|
|
246
|
-
const
|
|
237
|
+
const Jn = {
|
|
247
238
|
Assignment: "assignment",
|
|
248
239
|
Quiz: "quiz",
|
|
249
240
|
Discussion: "discussion",
|
|
@@ -255,21 +246,21 @@ const Xn = {
|
|
|
255
246
|
SubHeader: "sub_header",
|
|
256
247
|
PeerReviewSubAssignment: "assignment"
|
|
257
248
|
};
|
|
258
|
-
function
|
|
249
|
+
function eo(e) {
|
|
259
250
|
const t = e == null ? void 0 : e.__typename;
|
|
260
251
|
if (!t) return null;
|
|
261
|
-
const n =
|
|
252
|
+
const n = Jn[t];
|
|
262
253
|
return n ? n === "assignment" && (e == null ? void 0 : e.isNewQuiz) === !0 ? "quiz" : n : null;
|
|
263
254
|
}
|
|
264
|
-
const
|
|
265
|
-
function
|
|
255
|
+
const to = /^P(?!$)(?:(\d+(?:\.\d+)?)W)?(?:(\d+(?:\.\d+)?)D)?(?:T(?!$)(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?)?$/;
|
|
256
|
+
function no(e) {
|
|
266
257
|
if (!e) return null;
|
|
267
|
-
const t =
|
|
258
|
+
const t = to.exec(e);
|
|
268
259
|
if (!t) return null;
|
|
269
260
|
const [, n, o, r, s, l] = t, a = Number(n ?? 0) * 7 * 24 * 60 + Number(o ?? 0) * 24 * 60 + Number(r ?? 0) * 60 + Number(s ?? 0) + Number(l ?? 0) / 60;
|
|
270
261
|
return Math.round(a);
|
|
271
262
|
}
|
|
272
|
-
const
|
|
263
|
+
const oo = /* @__PURE__ */ new Set([
|
|
273
264
|
"must_view",
|
|
274
265
|
"must_mark_done",
|
|
275
266
|
"must_contribute",
|
|
@@ -277,13 +268,13 @@ const no = /* @__PURE__ */ new Set([
|
|
|
277
268
|
"min_score",
|
|
278
269
|
"min_percentage"
|
|
279
270
|
]);
|
|
280
|
-
function oo(e) {
|
|
281
|
-
return no.has(e) ? e : "unknown";
|
|
282
|
-
}
|
|
283
271
|
function ro(e) {
|
|
272
|
+
return oo.has(e) ? e : "unknown";
|
|
273
|
+
}
|
|
274
|
+
function so(e) {
|
|
284
275
|
return {
|
|
285
276
|
itemId: String(e.id),
|
|
286
|
-
type:
|
|
277
|
+
type: ro(e.type),
|
|
287
278
|
minScore: e.minScore ?? null,
|
|
288
279
|
minPercentage: e.minPercentage ?? null
|
|
289
280
|
};
|
|
@@ -294,7 +285,7 @@ function Bt(e) {
|
|
|
294
285
|
endCursor: (e == null ? void 0 : e.endCursor) ?? null
|
|
295
286
|
};
|
|
296
287
|
}
|
|
297
|
-
const
|
|
288
|
+
const io = /* @__PURE__ */ new Set(["min_score", "min_percentage"]);
|
|
298
289
|
function jt(e) {
|
|
299
290
|
var t;
|
|
300
291
|
for (const n of ((t = e == null ? void 0 : e.submissionsConnection) == null ? void 0 : t.nodes) ?? [])
|
|
@@ -303,17 +294,16 @@ function jt(e) {
|
|
|
303
294
|
}
|
|
304
295
|
function Gt(e, t) {
|
|
305
296
|
if (!e) return;
|
|
306
|
-
const n = new Map(t.map((s) => [s.itemId, s.type])), o = /* @__PURE__ */ new Set();
|
|
297
|
+
const n = new Map(t.map((s) => [s.itemId, s.type])), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
|
|
307
298
|
for (const s of e.requirementsMet ?? []) {
|
|
308
299
|
if (!s) continue;
|
|
309
300
|
const l = String(s.id);
|
|
310
301
|
n.get(l) === s.type && o.add(l);
|
|
311
302
|
}
|
|
312
|
-
const r = /* @__PURE__ */ new Set();
|
|
313
303
|
for (const s of e.incompleteRequirements ?? []) {
|
|
314
|
-
if (!s
|
|
304
|
+
if (!s) continue;
|
|
315
305
|
const l = String(s.id);
|
|
316
|
-
n.get(l) === s.type && r.
|
|
306
|
+
n.get(l) === s.type && io.has(s.type) && r.set(l, s.score ?? null);
|
|
317
307
|
}
|
|
318
308
|
return {
|
|
319
309
|
locked: e.locked === !0 || e.workflowState === "locked",
|
|
@@ -321,24 +311,17 @@ function Gt(e, t) {
|
|
|
321
311
|
completed: e.completed === !0 || e.workflowState === "completed",
|
|
322
312
|
started: e.started === !0 || e.workflowState === "started",
|
|
323
313
|
requirementsMetItemIds: o,
|
|
324
|
-
|
|
314
|
+
incompleteRequirementScores: r
|
|
325
315
|
};
|
|
326
316
|
}
|
|
327
|
-
function
|
|
317
|
+
function lo(e, t, n, o) {
|
|
318
|
+
var r;
|
|
328
319
|
if (n.locked) return "locked";
|
|
329
|
-
|
|
330
|
-
if (
|
|
331
|
-
|
|
332
|
-
if (r.missing === !0) return "missing";
|
|
333
|
-
if (so.has(r.state ?? "") || lo.has(r.gradingStatus ?? ""))
|
|
334
|
-
return "graded";
|
|
335
|
-
if (r.submittedAt != null || io.has(r.state ?? ""))
|
|
336
|
-
return "submitted";
|
|
337
|
-
if ((r.attempt ?? 0) > 0) return "in_progress";
|
|
338
|
-
}
|
|
339
|
-
return n.requirementsMetItemIds.has(t) ? o ? "complete" : "in_progress" : "not_started";
|
|
320
|
+
if (((r = jt(e)) == null ? void 0 : r.missing) === !0) return "missing";
|
|
321
|
+
if (o)
|
|
322
|
+
return n.requirementsMetItemIds.has(t) ? "complete" : n.incompleteRequirementScores.has(t) ? n.incompleteRequirementScores.get(t) == null ? "in_progress" : "incomplete" : "not_started";
|
|
340
323
|
}
|
|
341
|
-
const
|
|
324
|
+
const ao = {
|
|
342
325
|
LOCKED: "locked",
|
|
343
326
|
MISSING: "missing",
|
|
344
327
|
MISSING_AND_INCOMPLETE: "missing_and_incomplete",
|
|
@@ -347,30 +330,32 @@ const uo = {
|
|
|
347
330
|
IN_PROGRESS: "in_progress",
|
|
348
331
|
NOT_STARTED: "not_started"
|
|
349
332
|
};
|
|
350
|
-
function
|
|
333
|
+
function uo(e) {
|
|
351
334
|
if (e != null)
|
|
352
|
-
return
|
|
335
|
+
return ao[e];
|
|
353
336
|
}
|
|
354
|
-
function
|
|
355
|
-
var a,
|
|
337
|
+
function co(e, t, n) {
|
|
338
|
+
var a, m;
|
|
356
339
|
if (!n) return;
|
|
357
|
-
const o = e.requirementCount ?? t.length, r = Math.min(n.requirementsMetItemIds.size, o), s = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, l = n.
|
|
340
|
+
const o = e.requirementCount ?? t.length, r = Math.min(n.requirementsMetItemIds.size, o), s = ((a = e.submissionStatistics) == null ? void 0 : a.missingAssignmentCount) ?? 0, l = [...n.incompleteRequirementScores.values()].filter(
|
|
341
|
+
(d) => d != null
|
|
342
|
+
).length;
|
|
358
343
|
return {
|
|
359
|
-
status:
|
|
344
|
+
status: uo(e.moduleStatus) ?? (n.locked ? "locked" : void 0),
|
|
360
345
|
requirementsMet: r,
|
|
361
346
|
requirementCount: o,
|
|
362
347
|
percentComplete: o > 0 ? Math.round(r / o * 100) : 0,
|
|
363
|
-
latestDueAt: ((
|
|
348
|
+
latestDueAt: ((m = e.submissionStatistics) == null ? void 0 : m.latestDueAt) ?? null,
|
|
364
349
|
missingCount: s,
|
|
365
350
|
incompleteCount: l
|
|
366
351
|
};
|
|
367
352
|
}
|
|
368
|
-
function
|
|
369
|
-
var d,
|
|
370
|
-
const s = String(e._id), l =
|
|
353
|
+
function mo(e, t, n, o = {}, r) {
|
|
354
|
+
var d, u, p;
|
|
355
|
+
const s = String(e._id), l = eo(e.content);
|
|
371
356
|
if (!l)
|
|
372
|
-
return
|
|
373
|
-
const a = jt(e.content);
|
|
357
|
+
return Xn(o, { id: s, typename: ((d = e.content) == null ? void 0 : d.__typename) ?? null }), null;
|
|
358
|
+
const a = jt(e.content), m = n.get(s) ?? null;
|
|
374
359
|
return {
|
|
375
360
|
id: s,
|
|
376
361
|
moduleId: t,
|
|
@@ -381,13 +366,13 @@ function po(e, t, n, o = {}, r) {
|
|
|
381
366
|
published: $t(e.published, "moduleItem", s),
|
|
382
367
|
url: e.url ?? null,
|
|
383
368
|
newTab: e.newTab ?? !1,
|
|
384
|
-
completionRequirement:
|
|
385
|
-
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((
|
|
386
|
-
status: r ?
|
|
387
|
-
pointsPossible: ((
|
|
388
|
-
extensions:
|
|
369
|
+
completionRequirement: m,
|
|
370
|
+
dueAt: (a == null ? void 0 : a.cachedDueDate) ?? ((u = e.content) == null ? void 0 : u.dueAt) ?? null,
|
|
371
|
+
status: r ? lo(e.content, s, r, m) : void 0,
|
|
372
|
+
pointsPossible: ((p = e.content) == null ? void 0 : p.pointsPossible) ?? null,
|
|
373
|
+
extensions: Ve(
|
|
389
374
|
void 0,
|
|
390
|
-
|
|
375
|
+
no(e.estimatedDuration)
|
|
391
376
|
)
|
|
392
377
|
};
|
|
393
378
|
}
|
|
@@ -395,7 +380,7 @@ function Yt(e, t, n, o, r) {
|
|
|
395
380
|
const s = [];
|
|
396
381
|
for (const l of e ?? []) {
|
|
397
382
|
if (!l) continue;
|
|
398
|
-
const a =
|
|
383
|
+
const a = mo(
|
|
399
384
|
l,
|
|
400
385
|
t,
|
|
401
386
|
n,
|
|
@@ -410,24 +395,24 @@ function Wt(e) {
|
|
|
410
395
|
const t = [], n = /* @__PURE__ */ new Map();
|
|
411
396
|
for (const o of e ?? []) {
|
|
412
397
|
if (!o) continue;
|
|
413
|
-
const r =
|
|
398
|
+
const r = so(o);
|
|
414
399
|
t.push(r), n.set(r.itemId, r);
|
|
415
400
|
}
|
|
416
401
|
return { list: t, byItemId: n };
|
|
417
402
|
}
|
|
418
|
-
function
|
|
419
|
-
var
|
|
403
|
+
function po(e, t = {}) {
|
|
404
|
+
var d;
|
|
420
405
|
const n = String(e._id);
|
|
421
406
|
if (e.moduleItemsTotalCount == null)
|
|
422
407
|
throw new zt("module", n, "moduleItemsTotalCount");
|
|
423
|
-
const { list: o, byItemId: r } = Wt(e.completionRequirements), s = e.moduleItemsConnection, l = s != null && !((
|
|
408
|
+
const { list: o, byItemId: r } = Wt(e.completionRequirements), s = e.moduleItemsConnection, l = s != null && !((d = s.pageInfo) != null && d.hasNextPage), a = Gt(e.progression, o), m = l ? Yt(s.nodes, n, r, t, a) : void 0;
|
|
424
409
|
return {
|
|
425
410
|
id: n,
|
|
426
411
|
name: e.name ?? "",
|
|
427
412
|
position: e.position ?? 0,
|
|
428
413
|
published: $t(e.published, "module", n),
|
|
429
414
|
itemCount: e.moduleItemsTotalCount,
|
|
430
|
-
items:
|
|
415
|
+
items: m,
|
|
431
416
|
unlockAt: e.unlockAt ?? null,
|
|
432
417
|
prerequisiteModules: (e.prerequisites ?? []).filter(
|
|
433
418
|
(u) => u != null
|
|
@@ -435,34 +420,30 @@ function fo(e, t = {}) {
|
|
|
435
420
|
requirementCount: e.requirementCount ?? null,
|
|
436
421
|
requireSequentialProgress: e.requireSequentialProgress ?? !1,
|
|
437
422
|
completionRequirements: o,
|
|
438
|
-
progress:
|
|
423
|
+
progress: co(e, o, a)
|
|
439
424
|
};
|
|
440
425
|
}
|
|
441
|
-
function
|
|
426
|
+
function fo(e, t = {}) {
|
|
442
427
|
var r;
|
|
443
428
|
const n = (r = e == null ? void 0 : e.legacyNode) == null ? void 0 : r.modulesConnection, o = [];
|
|
444
429
|
for (const s of (n == null ? void 0 : n.nodes) ?? [])
|
|
445
|
-
s && o.push(
|
|
430
|
+
s && o.push(po(s, t));
|
|
446
431
|
return { modules: o, pageInfo: Bt(n == null ? void 0 : n.pageInfo) };
|
|
447
432
|
}
|
|
448
|
-
function
|
|
433
|
+
function go(e, t, n = {}) {
|
|
449
434
|
const o = e == null ? void 0 : e.legacyNode, { list: r, byItemId: s } = Wt(o == null ? void 0 : o.completionRequirements), l = o == null ? void 0 : o.moduleItemsConnection, a = Gt(o == null ? void 0 : o.progression, r);
|
|
450
435
|
return {
|
|
451
436
|
items: Yt(l == null ? void 0 : l.nodes, t, s, n, a),
|
|
452
437
|
pageInfo: Bt(l == null ? void 0 : l.pageInfo)
|
|
453
438
|
};
|
|
454
439
|
}
|
|
455
|
-
const
|
|
440
|
+
const ho = ge`
|
|
456
441
|
fragment PlatformModulesSubmissionFields on Submission {
|
|
457
442
|
_id
|
|
458
|
-
state
|
|
459
|
-
gradingStatus
|
|
460
|
-
submittedAt
|
|
461
|
-
attempt
|
|
462
443
|
missing
|
|
463
444
|
cachedDueDate
|
|
464
445
|
}
|
|
465
|
-
`, Qt =
|
|
446
|
+
`, Qt = ge`
|
|
466
447
|
fragment PlatformModulesItemFields on ModuleItem {
|
|
467
448
|
_id
|
|
468
449
|
title
|
|
@@ -509,8 +490,8 @@ const Io = fe`
|
|
|
509
490
|
}
|
|
510
491
|
}
|
|
511
492
|
}
|
|
512
|
-
${
|
|
513
|
-
`, Ht =
|
|
493
|
+
${ho}
|
|
494
|
+
`, Ht = ge`
|
|
514
495
|
fragment PlatformModulesProgressionFields on ModuleProgression {
|
|
515
496
|
workflowState
|
|
516
497
|
completed
|
|
@@ -530,7 +511,7 @@ const Io = fe`
|
|
|
530
511
|
score
|
|
531
512
|
}
|
|
532
513
|
}
|
|
533
|
-
`,
|
|
514
|
+
`, Io = ge`
|
|
534
515
|
query PlatformModulesGetModules(
|
|
535
516
|
$courseId: ID!
|
|
536
517
|
$first: Int!
|
|
@@ -591,7 +572,7 @@ const Io = fe`
|
|
|
591
572
|
}
|
|
592
573
|
${Qt}
|
|
593
574
|
${Ht}
|
|
594
|
-
`,
|
|
575
|
+
`, bo = ge`
|
|
595
576
|
query PlatformModulesGetModuleItems(
|
|
596
577
|
$moduleId: ID!
|
|
597
578
|
$first: Int!
|
|
@@ -628,7 +609,7 @@ const Io = fe`
|
|
|
628
609
|
function Vt() {
|
|
629
610
|
return new DOMException("The operation was aborted.", "AbortError");
|
|
630
611
|
}
|
|
631
|
-
function
|
|
612
|
+
function Ce(e) {
|
|
632
613
|
if (e != null && e.aborted) throw Vt();
|
|
633
614
|
}
|
|
634
615
|
function st(e, t) {
|
|
@@ -645,7 +626,7 @@ const it = [
|
|
|
645
626
|
], Mo = {
|
|
646
627
|
module: { completionStatus: ["eq"] }
|
|
647
628
|
};
|
|
648
|
-
function
|
|
629
|
+
function So(e) {
|
|
649
630
|
if (!e) return null;
|
|
650
631
|
if (e.target !== "module" || e.field !== "completionStatus" || e.op !== "eq")
|
|
651
632
|
throw new Error(
|
|
@@ -658,57 +639,57 @@ function yo(e) {
|
|
|
658
639
|
);
|
|
659
640
|
return { completionStatus: t };
|
|
660
641
|
}
|
|
661
|
-
function
|
|
642
|
+
function _l({
|
|
662
643
|
executeQuery: e,
|
|
663
|
-
inlineItemLimit: t =
|
|
664
|
-
nodeBudget: n =
|
|
644
|
+
inlineItemLimit: t = je,
|
|
645
|
+
nodeBudget: n = Ke,
|
|
665
646
|
onUnsupportedItem: o,
|
|
666
647
|
studentId: r,
|
|
667
648
|
validate: s = !0,
|
|
668
649
|
capabilities: l = Mo
|
|
669
650
|
}) {
|
|
670
|
-
const a = r != null,
|
|
651
|
+
const a = r != null, m = { onUnsupportedItem: o };
|
|
671
652
|
return {
|
|
672
653
|
inlineNodeBudget: n,
|
|
673
654
|
capabilities: l,
|
|
674
655
|
async listModules({
|
|
675
|
-
courseId:
|
|
656
|
+
courseId: d,
|
|
676
657
|
cursor: u,
|
|
677
658
|
pageSize: p,
|
|
678
659
|
includeItems: f,
|
|
679
|
-
filter:
|
|
680
|
-
inlineItemsFirst:
|
|
681
|
-
inlineFirst:
|
|
660
|
+
filter: M,
|
|
661
|
+
inlineItemsFirst: g,
|
|
662
|
+
inlineFirst: h,
|
|
682
663
|
signal: w
|
|
683
664
|
}) {
|
|
684
|
-
|
|
685
|
-
const
|
|
686
|
-
e(
|
|
687
|
-
courseId:
|
|
688
|
-
first:
|
|
665
|
+
Ce(w);
|
|
666
|
+
const E = f ? Math.min(h ?? p, p) : p, y = Math.min(g ?? t, t), N = Math.max(1, Math.min(y, Math.floor(n / E))), D = await st(
|
|
667
|
+
e(Io, {
|
|
668
|
+
courseId: d,
|
|
669
|
+
first: E,
|
|
689
670
|
after: u ?? null,
|
|
690
671
|
includeItems: f,
|
|
691
|
-
itemsFirst:
|
|
672
|
+
itemsFirst: N,
|
|
692
673
|
includeSubmissions: a,
|
|
693
674
|
studentId: r ?? null,
|
|
694
|
-
filter:
|
|
675
|
+
filter: So(M)
|
|
695
676
|
}),
|
|
696
677
|
w
|
|
697
678
|
);
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
return s ?
|
|
679
|
+
Ce(w);
|
|
680
|
+
const q = fo(D, m);
|
|
681
|
+
return s ? jn.parse(q) : q;
|
|
701
682
|
},
|
|
702
683
|
async listModuleItems({
|
|
703
|
-
moduleId:
|
|
684
|
+
moduleId: d,
|
|
704
685
|
cursor: u,
|
|
705
686
|
pageSize: p,
|
|
706
687
|
signal: f
|
|
707
688
|
}) {
|
|
708
|
-
|
|
709
|
-
const
|
|
710
|
-
e(
|
|
711
|
-
moduleId:
|
|
689
|
+
Ce(f);
|
|
690
|
+
const M = await st(
|
|
691
|
+
e(bo, {
|
|
692
|
+
moduleId: d,
|
|
712
693
|
first: p,
|
|
713
694
|
after: u ?? null,
|
|
714
695
|
includeSubmissions: a,
|
|
@@ -716,119 +697,117 @@ function El({
|
|
|
716
697
|
}),
|
|
717
698
|
f
|
|
718
699
|
);
|
|
719
|
-
|
|
720
|
-
const
|
|
721
|
-
return s ?
|
|
700
|
+
Ce(f);
|
|
701
|
+
const g = go(M, d, m);
|
|
702
|
+
return s ? Gn.parse(g) : g;
|
|
722
703
|
}
|
|
723
704
|
};
|
|
724
705
|
}
|
|
725
|
-
const
|
|
726
|
-
pageTitle:
|
|
727
|
-
modulesLoadedAnnouncement:
|
|
728
|
-
moduleSearchLabel:
|
|
729
|
-
searchPlaceholder:
|
|
730
|
-
expandCollapseTrigger:
|
|
731
|
-
expandAll:
|
|
732
|
-
collapseAll:
|
|
706
|
+
const yo = "Course modules", _o = { one: "%{count} module loaded", other: "%{count} modules loaded" }, To = "Search by name", Eo = "Search…", Po = "Expand / collapse", Co = "Expand all", wo = "Collapse all", vo = "Search matches module names only — items of collapsed modules are not loaded.", Lo = "This filter runs on the modules loaded so far — load more to filter the rest of the course.", Ao = "Modules failed to load: %{message}", xo = "Loading modules", Ro = "This course has no modules.", No = { one: "The only loaded module does not match this filter.", other: "None of the %{count} loaded modules match this filter." }, qo = "No modules match this filter.", Do = "Clear filters", ko = "Loading more modules…", Oo = "Load more modules (%{count} loaded)", Fo = { one: "The only module in this course is loaded.", other: "All %{count} modules in this course are loaded." }, Uo = "Filter", zo = "All", $o = "In progress", Bo = "Complete", jo = "Due this week", Go = "Missing", Yo = "Locked until prerequisites are met", Wo = "%{name} progress", Qo = { one: "%{loaded} of %{count} item loaded in %{name}", other: "%{loaded} of %{count} items loaded in %{name}" }, Ho = "Items failed to load: %{message}", Vo = "Loading items", Ko = "Loading…", Zo = "No items.", Xo = "Loading more items…", Jo = "Load more items (%{loaded} of %{count} loaded)", er = "(unpublished)", tr = "Collapse %{name}", nr = "Expand %{name}", or = "Not started", rr = "In progress", sr = "All completed", ir = "%{count} Missing", lr = "%{count} Incomplete", ar = "%{missing} & %{incomplete}", ur = "Locked", cr = "Not started", dr = "In progress", mr = "Completed", pr = "Incomplete", fr = "Missing", gr = "Locked", hr = "Assignment", Ir = "Quiz", br = "Discussion", Mr = "Page", Sr = "File", yr = "External URL", _r = "External tool", Tr = "Text header", Er = "Item type", Pr = "Due date", Cr = "Points", wr = "Requirement", vr = "Estimated duration", Lr = "Publish state", Ar = "View the item", xr = "Submit the assignment", Rr = "Contribute to the page", Nr = "Mark as done", qr = "Score at least the minimum", Dr = "Score at least %{count}", kr = "Score at least the minimum percentage", Or = "Score at least %{count}%", Fr = "Complete the requirement", Ur = "today, %{time}", zr = "yesterday, %{time}", $r = "tomorrow, %{time}", Br = "%{date}, %{time}", jr = "%{time} (%{zone})", Gr = "Due %{when}", Yr = "Will unlock on %{when}", Wr = { one: "%{count} pt", other: "%{count} pts" }, Qr = { one: "%{percent}% | %{met} of %{count} requirement met", other: "%{percent}% | %{met} of %{count} requirements met" }, Hr = { one: "%{percent}% complete, %{met} of %{count} requirement met", other: "%{percent}% complete, %{met} of %{count} requirements met" }, Vr = "%{count} min", Kr = "Unpublished", Zr = "Untitled item", Xr = "opens in a new window", Jr = {
|
|
707
|
+
pageTitle: yo,
|
|
708
|
+
modulesLoadedAnnouncement: _o,
|
|
709
|
+
moduleSearchLabel: To,
|
|
710
|
+
searchPlaceholder: Eo,
|
|
711
|
+
expandCollapseTrigger: Po,
|
|
712
|
+
expandAll: Co,
|
|
713
|
+
collapseAll: wo,
|
|
733
714
|
searchScopeHint: vo,
|
|
734
|
-
filterScopeHint:
|
|
735
|
-
modulesLoadErrorAlert:
|
|
736
|
-
modulesLoadingSpinnerLabel:
|
|
737
|
-
noModulesEmptyState:
|
|
715
|
+
filterScopeHint: Lo,
|
|
716
|
+
modulesLoadErrorAlert: Ao,
|
|
717
|
+
modulesLoadingSpinnerLabel: xo,
|
|
718
|
+
noModulesEmptyState: Ro,
|
|
738
719
|
filteredEmptyState: No,
|
|
739
720
|
noFilterMatches: qo,
|
|
740
|
-
clearFilters:
|
|
741
|
-
loadMoreModulesLoading:
|
|
742
|
-
loadMoreModules:
|
|
743
|
-
allModulesLoaded:
|
|
744
|
-
filterGroupLabel:
|
|
745
|
-
filterAll:
|
|
746
|
-
filterInProgress:
|
|
747
|
-
filterComplete:
|
|
748
|
-
filterDueThisWeek:
|
|
749
|
-
filterMissing:
|
|
750
|
-
lockedByline:
|
|
751
|
-
moduleProgressScreenReaderLabel:
|
|
752
|
-
itemsLoadedAnnouncement:
|
|
753
|
-
itemsLoadErrorAlert:
|
|
754
|
-
itemsLoadingSpinnerLabel:
|
|
755
|
-
itemsLoadingText:
|
|
756
|
-
noItemsEmptyState:
|
|
757
|
-
loadMoreItemsLoading:
|
|
758
|
-
loadMoreItems:
|
|
759
|
-
moduleUnpublishedBadge:
|
|
760
|
-
collapseModule:
|
|
761
|
-
expandModule:
|
|
762
|
-
moduleStatusNotStarted:
|
|
763
|
-
moduleStatusInProgress:
|
|
764
|
-
moduleStatusComplete:
|
|
765
|
-
moduleStatusMissing:
|
|
766
|
-
moduleStatusIncomplete:
|
|
767
|
-
moduleStatusMissingAndIncomplete:
|
|
768
|
-
moduleStatusLocked:
|
|
769
|
-
itemStatusNotStarted:
|
|
770
|
-
itemStatusInProgress:
|
|
771
|
-
itemStatusComplete:
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
opensInNewWindow: ts
|
|
814
|
-
}, os = /%\{(\w+)\}/g, rs = ns, te = "en-US", ss = /* @__PURE__ */ new Map(), is = /* @__PURE__ */ new Map();
|
|
721
|
+
clearFilters: Do,
|
|
722
|
+
loadMoreModulesLoading: ko,
|
|
723
|
+
loadMoreModules: Oo,
|
|
724
|
+
allModulesLoaded: Fo,
|
|
725
|
+
filterGroupLabel: Uo,
|
|
726
|
+
filterAll: zo,
|
|
727
|
+
filterInProgress: $o,
|
|
728
|
+
filterComplete: Bo,
|
|
729
|
+
filterDueThisWeek: jo,
|
|
730
|
+
filterMissing: Go,
|
|
731
|
+
lockedByline: Yo,
|
|
732
|
+
moduleProgressScreenReaderLabel: Wo,
|
|
733
|
+
itemsLoadedAnnouncement: Qo,
|
|
734
|
+
itemsLoadErrorAlert: Ho,
|
|
735
|
+
itemsLoadingSpinnerLabel: Vo,
|
|
736
|
+
itemsLoadingText: Ko,
|
|
737
|
+
noItemsEmptyState: Zo,
|
|
738
|
+
loadMoreItemsLoading: Xo,
|
|
739
|
+
loadMoreItems: Jo,
|
|
740
|
+
moduleUnpublishedBadge: er,
|
|
741
|
+
collapseModule: tr,
|
|
742
|
+
expandModule: nr,
|
|
743
|
+
moduleStatusNotStarted: or,
|
|
744
|
+
moduleStatusInProgress: rr,
|
|
745
|
+
moduleStatusComplete: sr,
|
|
746
|
+
moduleStatusMissing: ir,
|
|
747
|
+
moduleStatusIncomplete: lr,
|
|
748
|
+
moduleStatusMissingAndIncomplete: ar,
|
|
749
|
+
moduleStatusLocked: ur,
|
|
750
|
+
itemStatusNotStarted: cr,
|
|
751
|
+
itemStatusInProgress: dr,
|
|
752
|
+
itemStatusComplete: mr,
|
|
753
|
+
itemStatusIncomplete: pr,
|
|
754
|
+
itemStatusMissing: fr,
|
|
755
|
+
itemStatusLocked: gr,
|
|
756
|
+
itemTypeAssignment: hr,
|
|
757
|
+
itemTypeQuiz: Ir,
|
|
758
|
+
itemTypeDiscussion: br,
|
|
759
|
+
itemTypePage: Mr,
|
|
760
|
+
itemTypeFile: Sr,
|
|
761
|
+
itemTypeExternalUrl: yr,
|
|
762
|
+
itemTypeExternalTool: _r,
|
|
763
|
+
itemTypeSubHeader: Tr,
|
|
764
|
+
metaFieldTypeLabel: Er,
|
|
765
|
+
metaFieldDueAtLabel: Pr,
|
|
766
|
+
metaFieldPointsLabel: Cr,
|
|
767
|
+
metaFieldRequirementLabel: wr,
|
|
768
|
+
metaFieldDurationLabel: vr,
|
|
769
|
+
metaFieldPublishStateLabel: Lr,
|
|
770
|
+
requirementMustView: Ar,
|
|
771
|
+
requirementMustSubmit: xr,
|
|
772
|
+
requirementMustContribute: Rr,
|
|
773
|
+
requirementMustMarkDone: Nr,
|
|
774
|
+
requirementMinScoreUnknown: qr,
|
|
775
|
+
requirementMinScore: Dr,
|
|
776
|
+
requirementMinPercentageUnknown: kr,
|
|
777
|
+
requirementMinPercentage: Or,
|
|
778
|
+
requirementUnknown: Fr,
|
|
779
|
+
dateTimeToday: Ur,
|
|
780
|
+
dateTimeYesterday: zr,
|
|
781
|
+
dateTimeTomorrow: $r,
|
|
782
|
+
dateTimeWithDate: Br,
|
|
783
|
+
timeWithZone: jr,
|
|
784
|
+
dueByline: Gr,
|
|
785
|
+
unlockByline: Yr,
|
|
786
|
+
pointsAbbreviated: Wr,
|
|
787
|
+
progressSummary: Qr,
|
|
788
|
+
progressScreenReaderValue: Hr,
|
|
789
|
+
durationMinutes: Vr,
|
|
790
|
+
itemUnpublishedLabel: Kr,
|
|
791
|
+
itemUntitled: Zr,
|
|
792
|
+
opensInNewWindow: Xr
|
|
793
|
+
}, es = /%\{(\w+)\}/g, ts = Jr, te = "en-US", ns = /* @__PURE__ */ new Map(), os = /* @__PURE__ */ new Map();
|
|
815
794
|
function Kt(e, t, n) {
|
|
816
795
|
const o = e.get(t);
|
|
817
796
|
if (o) return o;
|
|
818
797
|
const r = n();
|
|
819
798
|
return e.set(t, r), r;
|
|
820
799
|
}
|
|
821
|
-
function
|
|
822
|
-
return n ? e.replace(
|
|
800
|
+
function rs(e, t, n) {
|
|
801
|
+
return n ? e.replace(es, (o, r) => {
|
|
823
802
|
if (!Object.prototype.hasOwnProperty.call(n, r)) return o;
|
|
824
803
|
const s = n[r];
|
|
825
|
-
return typeof s == "number" && Number.isFinite(s) ? Kt(
|
|
804
|
+
return typeof s == "number" && Number.isFinite(s) ? Kt(os, t, () => new Intl.NumberFormat(t)).format(s) : String(s);
|
|
826
805
|
}) : e;
|
|
827
806
|
}
|
|
828
|
-
function
|
|
807
|
+
function ss(e, t, n) {
|
|
829
808
|
const o = n == null ? void 0 : n.count;
|
|
830
809
|
if (typeof o == "number" && Number.isFinite(o)) {
|
|
831
|
-
const r = Kt(
|
|
810
|
+
const r = Kt(ns, t, () => new Intl.PluralRules(t)).select(o), s = e[r];
|
|
832
811
|
if (typeof s == "string") return s;
|
|
833
812
|
}
|
|
834
813
|
return typeof e.other == "string" ? e.other : void 0;
|
|
@@ -836,25 +815,25 @@ function as(e, t, n) {
|
|
|
836
815
|
function lt(e, t, n) {
|
|
837
816
|
if (typeof e == "string") return e;
|
|
838
817
|
if (e !== null && typeof e == "object")
|
|
839
|
-
return
|
|
818
|
+
return ss(e, t, n);
|
|
840
819
|
}
|
|
841
820
|
const at = /* @__PURE__ */ new Set();
|
|
842
|
-
function
|
|
821
|
+
function is(e) {
|
|
843
822
|
at.has(e) || (at.add(e), console.warn(
|
|
844
823
|
`[platform-modules] no translation for "${e}"; it will render as itself. Add it to the catalog passed to ModulesI18nProvider.`
|
|
845
824
|
));
|
|
846
825
|
}
|
|
847
|
-
function
|
|
826
|
+
function ls(e, t, n, o, r) {
|
|
848
827
|
const s = lt(e == null ? void 0 : e[t], n, r);
|
|
849
828
|
if (typeof s == "string") return s;
|
|
850
|
-
const l = lt(
|
|
851
|
-
return typeof l == "string" ? l : (o &&
|
|
829
|
+
const l = lt(ts[t], n, r);
|
|
830
|
+
return typeof l == "string" ? l : (o && is(t), t);
|
|
852
831
|
}
|
|
853
832
|
function Zt(e, t = te, n = !1) {
|
|
854
|
-
return (o, r) => ls(
|
|
833
|
+
return (o, r) => rs(ls(e, o, t, n, r), t, r);
|
|
855
834
|
}
|
|
856
|
-
const
|
|
857
|
-
function
|
|
835
|
+
const as = Zt(), us = { t: as, locale: te }, Xt = St(null);
|
|
836
|
+
function Tl({
|
|
858
837
|
translations: e,
|
|
859
838
|
locale: t,
|
|
860
839
|
timezone: n,
|
|
@@ -872,10 +851,10 @@ function Pl({
|
|
|
872
851
|
return /* @__PURE__ */ i(Xt.Provider, { value: s, children: r });
|
|
873
852
|
}
|
|
874
853
|
function O() {
|
|
875
|
-
return
|
|
854
|
+
return yt(Xt) ?? us;
|
|
876
855
|
}
|
|
877
|
-
const
|
|
878
|
-
function
|
|
856
|
+
const cs = 864e5, ds = "en-US", ut = /* @__PURE__ */ new Map(), ct = /* @__PURE__ */ new Map();
|
|
857
|
+
function ms(e) {
|
|
879
858
|
const t = ct.get(e);
|
|
880
859
|
if (t) return t;
|
|
881
860
|
const n = new Intl.NumberFormat(e, { minimumIntegerDigits: 2, useGrouping: !1 });
|
|
@@ -896,7 +875,7 @@ function dt(e, t) {
|
|
|
896
875
|
timeZone: t
|
|
897
876
|
}),
|
|
898
877
|
zone: t ? new Intl.DateTimeFormat(e, { timeZone: t, timeZoneName: "short" }) : void 0,
|
|
899
|
-
civilDay: new Intl.DateTimeFormat(
|
|
878
|
+
civilDay: new Intl.DateTimeFormat(ds, {
|
|
900
879
|
year: "numeric",
|
|
901
880
|
month: "numeric",
|
|
902
881
|
day: "numeric",
|
|
@@ -918,43 +897,43 @@ function Jt(e, t) {
|
|
|
918
897
|
return ut.set(o, s), s;
|
|
919
898
|
}
|
|
920
899
|
function mt(e, t) {
|
|
921
|
-
return new Date(
|
|
900
|
+
return new Date(Ge(e, t)).getUTCFullYear();
|
|
922
901
|
}
|
|
923
|
-
function
|
|
902
|
+
function ps(e, t) {
|
|
924
903
|
var o;
|
|
925
904
|
const n = (o = e.zone) == null ? void 0 : o.formatToParts(t).find((r) => r.type === "timeZoneName");
|
|
926
905
|
return (n == null ? void 0 : n.value) ?? null;
|
|
927
906
|
}
|
|
928
|
-
function
|
|
907
|
+
function Ge(e, t) {
|
|
929
908
|
const n = e.civilDay.formatToParts(t), o = (r) => {
|
|
930
909
|
var s;
|
|
931
910
|
return Number((s = n.find((l) => l.type === r)) == null ? void 0 : s.value);
|
|
932
911
|
};
|
|
933
912
|
return Date.UTC(o("year"), o("month") - 1, o("day"));
|
|
934
913
|
}
|
|
935
|
-
function
|
|
914
|
+
function fs(e, t, n) {
|
|
936
915
|
return en(Jt(te, n), e, t);
|
|
937
916
|
}
|
|
938
917
|
function en(e, t, n) {
|
|
939
|
-
return Math.round((
|
|
918
|
+
return Math.round((Ge(e, t) - Ge(e, n)) / cs);
|
|
940
919
|
}
|
|
941
|
-
function
|
|
920
|
+
function gs(e, t, n, { locale: o = te, timezone: r } = {}) {
|
|
942
921
|
const s = new Date(t);
|
|
943
922
|
if (Number.isNaN(s.getTime())) return t;
|
|
944
|
-
const l = Jt(o, r), a =
|
|
945
|
-
if (u === 0) return e("dateTimeToday", { time:
|
|
946
|
-
if (u === -1) return e("dateTimeYesterday", { time:
|
|
947
|
-
if (u === 1) return e("dateTimeTomorrow", { time:
|
|
923
|
+
const l = Jt(o, r), a = ps(l, s), m = l.time.format(s), d = a ? e("timeWithZone", { time: m, zone: a }) : m, u = en(l, s, n);
|
|
924
|
+
if (u === 0) return e("dateTimeToday", { time: d });
|
|
925
|
+
if (u === -1) return e("dateTimeYesterday", { time: d });
|
|
926
|
+
if (u === 1) return e("dateTimeTomorrow", { time: d });
|
|
948
927
|
const f = mt(l, s) === mt(l, n) ? l.day.format(s) : l.dayYear.format(s);
|
|
949
|
-
return e("dateTimeWithDate", { date: f, time:
|
|
928
|
+
return e("dateTimeWithDate", { date: f, time: d });
|
|
950
929
|
}
|
|
951
|
-
function
|
|
952
|
-
return !Number.isInteger(e) || e < 1 ? null :
|
|
930
|
+
function hs(e, t = te) {
|
|
931
|
+
return !Number.isInteger(e) || e < 1 ? null : ms(t).format(e);
|
|
953
932
|
}
|
|
954
|
-
function
|
|
933
|
+
function Is(e, t) {
|
|
955
934
|
return t == null ? null : e("pointsAbbreviated", { count: t });
|
|
956
935
|
}
|
|
957
|
-
function
|
|
936
|
+
function bs(e, t) {
|
|
958
937
|
switch (t.type) {
|
|
959
938
|
case "must_view":
|
|
960
939
|
return e("requirementMustView");
|
|
@@ -972,17 +951,17 @@ function ys(e, t) {
|
|
|
972
951
|
return e("requirementUnknown");
|
|
973
952
|
}
|
|
974
953
|
}
|
|
975
|
-
function
|
|
954
|
+
function Ms(e, t, n, o) {
|
|
976
955
|
return e("progressSummary", { percent: t, met: n, count: o });
|
|
977
956
|
}
|
|
978
|
-
function
|
|
957
|
+
function Ss(e, t, n, o) {
|
|
979
958
|
return e("progressScreenReaderValue", { percent: t, met: n, count: o });
|
|
980
959
|
}
|
|
981
|
-
function
|
|
960
|
+
function ys(e, t, n) {
|
|
982
961
|
const o = t.trim().toLocaleLowerCase(n);
|
|
983
962
|
return o === "" ? !0 : e.name.toLocaleLowerCase(n).includes(o);
|
|
984
963
|
}
|
|
985
|
-
const J = "all",
|
|
964
|
+
const J = "all", _s = 7, Ts = {
|
|
986
965
|
all: {
|
|
987
966
|
label: "filterAll",
|
|
988
967
|
order: 10,
|
|
@@ -1016,8 +995,8 @@ const J = "all", Ps = 7, Cs = {
|
|
|
1016
995
|
if (!o) return !1;
|
|
1017
996
|
const r = new Date(o);
|
|
1018
997
|
if (Number.isNaN(r.getTime())) return !1;
|
|
1019
|
-
const s =
|
|
1020
|
-
return s >= 0 && s <=
|
|
998
|
+
const s = fs(r, t, n);
|
|
999
|
+
return s >= 0 && s <= _s;
|
|
1021
1000
|
}
|
|
1022
1001
|
},
|
|
1023
1002
|
missing: {
|
|
@@ -1029,38 +1008,38 @@ const J = "all", Ps = 7, Cs = {
|
|
|
1029
1008
|
}
|
|
1030
1009
|
}
|
|
1031
1010
|
};
|
|
1032
|
-
function
|
|
1011
|
+
function Ze(e) {
|
|
1033
1012
|
if (!(!e || e.clientOnly))
|
|
1034
1013
|
return e.query;
|
|
1035
1014
|
}
|
|
1036
|
-
function
|
|
1037
|
-
return e !== void 0 &&
|
|
1038
|
-
}
|
|
1039
|
-
const
|
|
1040
|
-
moduleLabel: (e, t, { locale: n }) =>
|
|
1041
|
-
dateTime: (e, t, { t: n, locale: o, timezone: r }) =>
|
|
1042
|
-
points: (e, { t }) =>
|
|
1043
|
-
progress: (e, t, n, { t: o }) =>
|
|
1044
|
-
},
|
|
1045
|
-
function
|
|
1015
|
+
function Ye(e) {
|
|
1016
|
+
return e !== void 0 && Ze(e) === void 0;
|
|
1017
|
+
}
|
|
1018
|
+
const Es = {
|
|
1019
|
+
moduleLabel: (e, t, { locale: n }) => hs(e, n),
|
|
1020
|
+
dateTime: (e, t, { t: n, locale: o, timezone: r }) => gs(n, e, t, { locale: o, timezone: r }),
|
|
1021
|
+
points: (e, { t }) => Is(t, e),
|
|
1022
|
+
progress: (e, t, n, { t: o }) => Ms(o, e, t, n)
|
|
1023
|
+
}, Ae = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
|
|
1024
|
+
function xe(e, t) {
|
|
1046
1025
|
const n = Object.entries(t ?? {}).filter(([, o]) => o !== void 0);
|
|
1047
1026
|
return { ...e, ...Object.fromEntries(n) };
|
|
1048
1027
|
}
|
|
1049
1028
|
function Z(e, t = {}) {
|
|
1050
1029
|
const n = Object.keys(e).map((r) => [
|
|
1051
1030
|
r,
|
|
1052
|
-
|
|
1053
|
-
]), o = Object.keys(t).filter((r) => !
|
|
1031
|
+
xe(e[r], Ae(t, r) ? t[r] : void 0)
|
|
1032
|
+
]), o = Object.keys(t).filter((r) => !Ae(e, r)).sort().map((r) => [r, xe({}, t[r])]);
|
|
1054
1033
|
return Object.fromEntries([...n, ...o]);
|
|
1055
1034
|
}
|
|
1056
1035
|
function ee(e, t) {
|
|
1057
|
-
if (!(!
|
|
1036
|
+
if (!(!Ae(e, t) || e[t].hidden))
|
|
1058
1037
|
return e[t];
|
|
1059
1038
|
}
|
|
1060
|
-
function
|
|
1039
|
+
function Xe(e) {
|
|
1061
1040
|
return Object.keys(e).filter((t) => ee(e, t) !== void 0).map((t) => ({ ...e[t], key: t })).sort((t, n) => t.order - n.order);
|
|
1062
1041
|
}
|
|
1063
|
-
const
|
|
1042
|
+
const Ps = "type", Cs = {
|
|
1064
1043
|
type: {
|
|
1065
1044
|
label: "metaFieldTypeLabel",
|
|
1066
1045
|
order: 10,
|
|
@@ -1082,13 +1061,13 @@ const Ls = "type", vs = {
|
|
|
1082
1061
|
requirement: {
|
|
1083
1062
|
label: "metaFieldRequirementLabel",
|
|
1084
1063
|
order: 40,
|
|
1085
|
-
render: ({ item: e, t }) => e.completionRequirement ?
|
|
1064
|
+
render: ({ item: e, t }) => e.completionRequirement ? bs(t, e.completionRequirement) : null
|
|
1086
1065
|
},
|
|
1087
1066
|
estimatedDuration: {
|
|
1088
1067
|
label: "metaFieldDurationLabel",
|
|
1089
1068
|
order: 50,
|
|
1090
1069
|
render: ({ item: e, t }) => {
|
|
1091
|
-
const n =
|
|
1070
|
+
const n = Yn(e);
|
|
1092
1071
|
return n === null ? null : t("durationMinutes", { count: n });
|
|
1093
1072
|
}
|
|
1094
1073
|
},
|
|
@@ -1097,57 +1076,57 @@ const Ls = "type", vs = {
|
|
|
1097
1076
|
order: 60,
|
|
1098
1077
|
render: ({ item: e, t }) => e.published ? null : t("itemUnpublishedLabel")
|
|
1099
1078
|
}
|
|
1100
|
-
}, W = { size: "md", color: "mutedColor" },
|
|
1079
|
+
}, W = { size: "md", color: "mutedColor" }, ws = {
|
|
1101
1080
|
assignment: {
|
|
1102
1081
|
label: "itemTypeAssignment",
|
|
1103
1082
|
order: 10,
|
|
1104
|
-
icon: /* @__PURE__ */ i(
|
|
1083
|
+
icon: /* @__PURE__ */ i(yn, { ...W })
|
|
1105
1084
|
},
|
|
1106
1085
|
quiz: { label: "itemTypeQuiz", order: 20, icon: /* @__PURE__ */ i(Sn, { ...W }) },
|
|
1107
1086
|
discussion: {
|
|
1108
1087
|
label: "itemTypeDiscussion",
|
|
1109
1088
|
order: 30,
|
|
1110
|
-
icon: /* @__PURE__ */ i(
|
|
1089
|
+
icon: /* @__PURE__ */ i(Mn, { ...W })
|
|
1111
1090
|
},
|
|
1112
|
-
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(
|
|
1113
|
-
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(
|
|
1091
|
+
page: { label: "itemTypePage", order: 40, icon: /* @__PURE__ */ i(bn, { ...W }) },
|
|
1092
|
+
file: { label: "itemTypeFile", order: 50, icon: /* @__PURE__ */ i(In, { ...W }) },
|
|
1114
1093
|
external_url: {
|
|
1115
1094
|
label: "itemTypeExternalUrl",
|
|
1116
1095
|
order: 60,
|
|
1117
|
-
icon: /* @__PURE__ */ i(
|
|
1096
|
+
icon: /* @__PURE__ */ i(hn, { ...W })
|
|
1118
1097
|
},
|
|
1119
1098
|
external_tool: {
|
|
1120
1099
|
label: "itemTypeExternalTool",
|
|
1121
1100
|
order: 70,
|
|
1122
|
-
icon: /* @__PURE__ */ i(
|
|
1101
|
+
icon: /* @__PURE__ */ i(gn, { ...W })
|
|
1123
1102
|
},
|
|
1124
1103
|
sub_header: { label: "itemTypeSubHeader", order: 80, icon: null }
|
|
1125
|
-
},
|
|
1126
|
-
formatters:
|
|
1127
|
-
itemTypes:
|
|
1104
|
+
}, qe = {
|
|
1105
|
+
formatters: Es,
|
|
1106
|
+
itemTypes: ws,
|
|
1128
1107
|
itemStatuses: {},
|
|
1129
|
-
itemMeta:
|
|
1130
|
-
filters:
|
|
1108
|
+
itemMeta: Cs,
|
|
1109
|
+
filters: Ts,
|
|
1131
1110
|
moduleActions: {},
|
|
1132
1111
|
itemActions: {},
|
|
1133
1112
|
navigation: {}
|
|
1134
1113
|
};
|
|
1135
|
-
Object.freeze(
|
|
1136
|
-
for (const e of Object.values(
|
|
1114
|
+
Object.freeze(qe);
|
|
1115
|
+
for (const e of Object.values(qe)) {
|
|
1137
1116
|
Object.freeze(e);
|
|
1138
1117
|
for (const t of Object.values(e)) Object.freeze(t);
|
|
1139
1118
|
}
|
|
1140
|
-
function
|
|
1141
|
-
return
|
|
1142
|
-
const o =
|
|
1143
|
-
return o !== void 0 && !
|
|
1119
|
+
function vs(e, t) {
|
|
1120
|
+
return Xe(e).filter((n) => {
|
|
1121
|
+
const o = Ze(n);
|
|
1122
|
+
return o !== void 0 && !Dn(t, o);
|
|
1144
1123
|
}).map((n) => n.key);
|
|
1145
1124
|
}
|
|
1146
1125
|
function pt(e) {
|
|
1147
1126
|
return `[platform-modules] the adapter cannot serve filter(s): ${e.join(", ")}. Add the field to the adapter's capabilities, or set clientOnly on the entry.`;
|
|
1148
1127
|
}
|
|
1149
|
-
function
|
|
1150
|
-
const n =
|
|
1128
|
+
function Ls(e, t) {
|
|
1129
|
+
const n = vs(e, t);
|
|
1151
1130
|
if (n.length === 0) return e;
|
|
1152
1131
|
if (process.env.NODE_ENV !== "production")
|
|
1153
1132
|
throw new Error(pt(n));
|
|
@@ -1155,17 +1134,17 @@ function Rs(e, t) {
|
|
|
1155
1134
|
const o = Object.fromEntries(n.map((r) => [r, { ...e[r], hidden: !0 }]));
|
|
1156
1135
|
return { ...e, ...o };
|
|
1157
1136
|
}
|
|
1158
|
-
const tn =
|
|
1159
|
-
function
|
|
1137
|
+
const tn = St(null);
|
|
1138
|
+
function El({ value: e, children: t }) {
|
|
1160
1139
|
return /* @__PURE__ */ i(tn.Provider, { value: e, children: t });
|
|
1161
1140
|
}
|
|
1162
|
-
function
|
|
1163
|
-
return
|
|
1141
|
+
function he() {
|
|
1142
|
+
return yt(tn) ?? qe;
|
|
1164
1143
|
}
|
|
1165
|
-
function
|
|
1166
|
-
return ee(
|
|
1144
|
+
function Pl(e) {
|
|
1145
|
+
return ee(he().itemMeta, e) !== void 0;
|
|
1167
1146
|
}
|
|
1168
|
-
const
|
|
1147
|
+
const De = c.object({
|
|
1169
1148
|
label: c.string(),
|
|
1170
1149
|
order: c.number(),
|
|
1171
1150
|
hidden: c.boolean().optional()
|
|
@@ -1173,68 +1152,68 @@ const qe = c.object({
|
|
|
1173
1152
|
function ve(e) {
|
|
1174
1153
|
return c.record(c.string(), e);
|
|
1175
1154
|
}
|
|
1176
|
-
const
|
|
1155
|
+
const $e = ve(De.strict()), nn = (e) => e == null || typeof e == "string" || typeof e == "number" || typeof e == "bigint" || typeof e == "boolean" || _t(e) || Array.isArray(e) && e.every(nn), As = (e) => {
|
|
1177
1156
|
var t;
|
|
1178
1157
|
return e == null || typeof e == "function" && !((t = e.prototype) != null && t.isReactComponent);
|
|
1179
|
-
},
|
|
1158
|
+
}, xs = De.extend({
|
|
1180
1159
|
icon: c.custom(nn, { message: "icon must be a ReactNode" }),
|
|
1181
|
-
renderIcon: c.custom(
|
|
1160
|
+
renderIcon: c.custom(As, {
|
|
1182
1161
|
message: "renderIcon must be a function of the item, not a React component"
|
|
1183
1162
|
})
|
|
1184
1163
|
}).strict();
|
|
1185
|
-
function
|
|
1164
|
+
function we() {
|
|
1186
1165
|
return c.custom((e) => typeof e == "function", {
|
|
1187
1166
|
message: "Expected a function"
|
|
1188
1167
|
});
|
|
1189
1168
|
}
|
|
1190
|
-
const
|
|
1169
|
+
const Rs = De.extend({
|
|
1191
1170
|
render: c.custom((e) => typeof e == "function", {
|
|
1192
1171
|
message: "render must be a function taking a MetaFieldContext"
|
|
1193
1172
|
})
|
|
1194
|
-
}).strict(),
|
|
1173
|
+
}).strict(), Ns = De.extend({
|
|
1195
1174
|
predicate: c.custom((e) => typeof e == "function", {
|
|
1196
1175
|
message: "predicate must be a function of the module and a FilterContext"
|
|
1197
1176
|
}),
|
|
1198
|
-
query:
|
|
1177
|
+
query: qn.optional(),
|
|
1199
1178
|
clientOnly: c.boolean().optional()
|
|
1200
|
-
}).strict(),
|
|
1179
|
+
}).strict(), qs = c.object({
|
|
1201
1180
|
formatters: c.object({
|
|
1202
|
-
moduleLabel:
|
|
1203
|
-
dateTime:
|
|
1204
|
-
points:
|
|
1205
|
-
progress:
|
|
1181
|
+
moduleLabel: we(),
|
|
1182
|
+
dateTime: we(),
|
|
1183
|
+
points: we(),
|
|
1184
|
+
progress: we()
|
|
1206
1185
|
}).strict(),
|
|
1207
|
-
itemTypes: ve(
|
|
1208
|
-
itemStatuses:
|
|
1209
|
-
itemMeta: ve(
|
|
1210
|
-
filters: ve(
|
|
1211
|
-
moduleActions:
|
|
1212
|
-
itemActions:
|
|
1186
|
+
itemTypes: ve(xs),
|
|
1187
|
+
itemStatuses: $e,
|
|
1188
|
+
itemMeta: ve(Rs),
|
|
1189
|
+
filters: ve(Ns),
|
|
1190
|
+
moduleActions: $e,
|
|
1191
|
+
itemActions: $e,
|
|
1213
1192
|
navigation: c.object({}).strict()
|
|
1214
1193
|
});
|
|
1215
|
-
function
|
|
1216
|
-
const n = Object.keys(t).filter((r) => !
|
|
1194
|
+
function Ds(e, t = {}) {
|
|
1195
|
+
const n = Object.keys(t).filter((r) => !Ae(e, r));
|
|
1217
1196
|
if (n.length > 0)
|
|
1218
1197
|
throw new Error(
|
|
1219
1198
|
`Unknown modules config key(s): ${n.join(", ")}. Known keys are ${Object.keys(e).join(", ")}.`
|
|
1220
1199
|
);
|
|
1221
1200
|
const o = {
|
|
1222
|
-
formatters:
|
|
1201
|
+
formatters: xe(e.formatters, t.formatters),
|
|
1223
1202
|
itemTypes: Z(e.itemTypes, t.itemTypes),
|
|
1224
1203
|
itemStatuses: Z(e.itemStatuses, t.itemStatuses),
|
|
1225
1204
|
itemMeta: Z(e.itemMeta, t.itemMeta),
|
|
1226
1205
|
filters: Z(e.filters, t.filters),
|
|
1227
1206
|
moduleActions: Z(e.moduleActions, t.moduleActions),
|
|
1228
1207
|
itemActions: Z(e.itemActions, t.itemActions),
|
|
1229
|
-
navigation:
|
|
1208
|
+
navigation: xe(e.navigation, t.navigation)
|
|
1230
1209
|
};
|
|
1231
|
-
return
|
|
1210
|
+
return qs.parse(o), o;
|
|
1232
1211
|
}
|
|
1233
|
-
function
|
|
1234
|
-
return
|
|
1212
|
+
function Cl(e = {}) {
|
|
1213
|
+
return Ds(qe, e);
|
|
1235
1214
|
}
|
|
1236
1215
|
function ke() {
|
|
1237
|
-
const { formatters: e } =
|
|
1216
|
+
const { formatters: e } = he(), { t, locale: n, timezone: o } = O();
|
|
1238
1217
|
return R(() => {
|
|
1239
1218
|
const r = { t, locale: n, timezone: o }, s = (l, a) => e.dateTime(l, a, r);
|
|
1240
1219
|
return {
|
|
@@ -1242,17 +1221,17 @@ function ke() {
|
|
|
1242
1221
|
dueByline: (l, a) => t("dueByline", { when: s(l, a) }),
|
|
1243
1222
|
unlockByline: (l, a) => t("unlockByline", { when: s(l, a) }),
|
|
1244
1223
|
points: (l) => e.points(l, r),
|
|
1245
|
-
progress: (l, a,
|
|
1224
|
+
progress: (l, a, m) => e.progress(l, a, m, r)
|
|
1246
1225
|
};
|
|
1247
1226
|
}, [e, t, n, o]);
|
|
1248
1227
|
}
|
|
1249
|
-
const
|
|
1228
|
+
const Je = 100, on = 100, rn = 100, ks = 4, Oe = 5 * 60 * 1e3, sn = 20, Re = { hasNextPage: !1, endCursor: null }, X = ["platform-modules"], Ie = {
|
|
1250
1229
|
all: X,
|
|
1251
1230
|
course: (e) => [...X, e],
|
|
1252
1231
|
list: (e, t = {}) => [...X, e, "list", t],
|
|
1253
1232
|
items: (e, t, n = {}) => [...X, e, "module", t, "items", n]
|
|
1254
1233
|
};
|
|
1255
|
-
function
|
|
1234
|
+
function Os(e) {
|
|
1256
1235
|
return [...X, e, "list"];
|
|
1257
1236
|
}
|
|
1258
1237
|
function ln(e, t) {
|
|
@@ -1270,13 +1249,13 @@ function un(e) {
|
|
|
1270
1249
|
filter: s,
|
|
1271
1250
|
inlineItemsFirst: l,
|
|
1272
1251
|
inlineFirst: a,
|
|
1273
|
-
view:
|
|
1274
|
-
staleTime:
|
|
1252
|
+
view: m,
|
|
1253
|
+
staleTime: d,
|
|
1275
1254
|
enabled: u
|
|
1276
1255
|
} = e;
|
|
1277
1256
|
return {
|
|
1278
1257
|
// `inlineItemsFirst` is deliberately out of the key: it is derived from this very list.
|
|
1279
|
-
queryKey:
|
|
1258
|
+
queryKey: Ie.list(t, { view: m, pageSize: o, includeItems: r, filter: s }),
|
|
1280
1259
|
initialPageParam: null,
|
|
1281
1260
|
queryFn: ({ pageParam: p, signal: f }) => n.listModules({
|
|
1282
1261
|
courseId: t,
|
|
@@ -1290,18 +1269,18 @@ function un(e) {
|
|
|
1290
1269
|
}),
|
|
1291
1270
|
getNextPageParam: an,
|
|
1292
1271
|
enabled: u,
|
|
1293
|
-
staleTime:
|
|
1272
|
+
staleTime: d,
|
|
1294
1273
|
refetchOnWindowFocus: !1
|
|
1295
1274
|
};
|
|
1296
1275
|
}
|
|
1297
1276
|
function cn(e) {
|
|
1298
|
-
const { courseId: t, moduleId: n, adapter: o, pageSize: r, view: s, staleTime: l, enabled: a, limit:
|
|
1277
|
+
const { courseId: t, moduleId: n, adapter: o, pageSize: r, view: s, staleTime: l, enabled: a, limit: m } = e;
|
|
1299
1278
|
return {
|
|
1300
|
-
queryKey:
|
|
1279
|
+
queryKey: Ie.items(t, n, { view: s, pageSize: r }),
|
|
1301
1280
|
initialPageParam: null,
|
|
1302
|
-
queryFn: ({ pageParam:
|
|
1303
|
-
const p = () => o.listModuleItems({ courseId: t, moduleId: n, cursor:
|
|
1304
|
-
return
|
|
1281
|
+
queryFn: ({ pageParam: d, signal: u }) => {
|
|
1282
|
+
const p = () => o.listModuleItems({ courseId: t, moduleId: n, cursor: d, pageSize: r, signal: u });
|
|
1283
|
+
return m ? m(() => {
|
|
1305
1284
|
if (u.aborted)
|
|
1306
1285
|
throw new DOMException("The operation was aborted.", "AbortError");
|
|
1307
1286
|
return p();
|
|
@@ -1313,20 +1292,20 @@ function cn(e) {
|
|
|
1313
1292
|
refetchOnWindowFocus: !1
|
|
1314
1293
|
};
|
|
1315
1294
|
}
|
|
1316
|
-
function
|
|
1317
|
-
var
|
|
1295
|
+
function Fs(e) {
|
|
1296
|
+
var E;
|
|
1318
1297
|
const {
|
|
1319
1298
|
courseId: t,
|
|
1320
1299
|
adapter: n,
|
|
1321
|
-
pageSize: o =
|
|
1300
|
+
pageSize: o = Je,
|
|
1322
1301
|
includeItems: r = !1,
|
|
1323
1302
|
filter: s,
|
|
1324
1303
|
inlineItemsFirst: l,
|
|
1325
1304
|
inlineFirst: a,
|
|
1326
|
-
view:
|
|
1327
|
-
staleTime:
|
|
1305
|
+
view: m,
|
|
1306
|
+
staleTime: d = Oe,
|
|
1328
1307
|
enabled: u = !0
|
|
1329
|
-
} = e, p =
|
|
1308
|
+
} = e, p = He(
|
|
1330
1309
|
un({
|
|
1331
1310
|
courseId: t,
|
|
1332
1311
|
adapter: n,
|
|
@@ -1335,17 +1314,17 @@ function $s(e) {
|
|
|
1335
1314
|
filter: s,
|
|
1336
1315
|
inlineItemsFirst: l,
|
|
1337
1316
|
inlineFirst: a,
|
|
1338
|
-
view:
|
|
1339
|
-
staleTime:
|
|
1317
|
+
view: m,
|
|
1318
|
+
staleTime: d,
|
|
1340
1319
|
enabled: u
|
|
1341
1320
|
})
|
|
1342
|
-
), f = (
|
|
1343
|
-
|
|
1344
|
-
}, [
|
|
1321
|
+
), f = (E = p.data) == null ? void 0 : E.pages, M = R(() => (f ?? []).flatMap((y) => y.modules), [f]), g = f && f.length > 0 ? f[f.length - 1].pageInfo : Re, h = p.fetchNextPage, w = k(() => {
|
|
1322
|
+
h();
|
|
1323
|
+
}, [h]);
|
|
1345
1324
|
return {
|
|
1346
|
-
modules:
|
|
1347
|
-
pageInfo:
|
|
1348
|
-
hasNextPage:
|
|
1325
|
+
modules: M,
|
|
1326
|
+
pageInfo: g,
|
|
1327
|
+
hasNextPage: g.hasNextPage,
|
|
1349
1328
|
fetchNextPage: w,
|
|
1350
1329
|
isLoading: p.isLoading,
|
|
1351
1330
|
isFetchingNextPage: p.isFetchingNextPage,
|
|
@@ -1353,8 +1332,8 @@ function $s(e) {
|
|
|
1353
1332
|
error: p.error
|
|
1354
1333
|
};
|
|
1355
1334
|
}
|
|
1356
|
-
function
|
|
1357
|
-
var
|
|
1335
|
+
function wl(e) {
|
|
1336
|
+
var h;
|
|
1358
1337
|
const {
|
|
1359
1338
|
courseId: t,
|
|
1360
1339
|
moduleId: n,
|
|
@@ -1363,8 +1342,8 @@ function vl(e) {
|
|
|
1363
1342
|
view: s,
|
|
1364
1343
|
enabled: l = !0,
|
|
1365
1344
|
staleTime: a = Oe,
|
|
1366
|
-
limit:
|
|
1367
|
-
} = e,
|
|
1345
|
+
limit: m
|
|
1346
|
+
} = e, d = He(
|
|
1368
1347
|
cn({
|
|
1369
1348
|
courseId: t,
|
|
1370
1349
|
moduleId: n,
|
|
@@ -1373,22 +1352,22 @@ function vl(e) {
|
|
|
1373
1352
|
view: s,
|
|
1374
1353
|
staleTime: a,
|
|
1375
1354
|
enabled: l,
|
|
1376
|
-
limit:
|
|
1355
|
+
limit: m
|
|
1377
1356
|
})
|
|
1378
|
-
), u = (
|
|
1379
|
-
|
|
1380
|
-
}, [
|
|
1357
|
+
), u = (h = d.data) == null ? void 0 : h.pages, p = R(() => (u ?? []).flatMap((w) => w.items), [u]), f = u && u.length > 0 ? u[u.length - 1].pageInfo : Re, M = d.fetchNextPage, g = k(() => {
|
|
1358
|
+
M();
|
|
1359
|
+
}, [M]);
|
|
1381
1360
|
return {
|
|
1382
1361
|
items: p,
|
|
1383
1362
|
pageInfo: f,
|
|
1384
1363
|
hasNextPage: f.hasNextPage,
|
|
1385
|
-
fetchNextPage:
|
|
1386
|
-
isLoading:
|
|
1387
|
-
isFetchingNextPage:
|
|
1388
|
-
error:
|
|
1364
|
+
fetchNextPage: g,
|
|
1365
|
+
isLoading: d.isLoading,
|
|
1366
|
+
isFetchingNextPage: d.isFetchingNextPage,
|
|
1367
|
+
error: d.error
|
|
1389
1368
|
};
|
|
1390
1369
|
}
|
|
1391
|
-
function
|
|
1370
|
+
function Us(e, t, n = Ke) {
|
|
1392
1371
|
if (e.pageInfo.hasNextPage) return "onDemand";
|
|
1393
1372
|
let o = 0, r = 0;
|
|
1394
1373
|
for (const s of e.modules) {
|
|
@@ -1397,27 +1376,27 @@ function Bs(e, t, n = Ze) {
|
|
|
1397
1376
|
}
|
|
1398
1377
|
return o > t * 2 ? "onDemand" : Math.max(e.modules.length, 1) * Math.max(r, 1) <= n ? "inline" : "onDemand";
|
|
1399
1378
|
}
|
|
1400
|
-
function
|
|
1401
|
-
var
|
|
1379
|
+
function zs(e) {
|
|
1380
|
+
var M;
|
|
1402
1381
|
const {
|
|
1403
1382
|
courseId: t,
|
|
1404
1383
|
adapter: n,
|
|
1405
1384
|
mode: o = "auto",
|
|
1406
1385
|
inlineThreshold: r = rn,
|
|
1407
|
-
nodeBudget: s = n.inlineNodeBudget ??
|
|
1408
|
-
pageSize: l =
|
|
1386
|
+
nodeBudget: s = n.inlineNodeBudget ?? Ke,
|
|
1387
|
+
pageSize: l = Je,
|
|
1409
1388
|
filter: a,
|
|
1410
|
-
view:
|
|
1411
|
-
staleTime:
|
|
1412
|
-
} = e, u = o === "auto", p =
|
|
1389
|
+
view: m,
|
|
1390
|
+
staleTime: d = Oe
|
|
1391
|
+
} = e, u = o === "auto", p = He(
|
|
1413
1392
|
un({
|
|
1414
1393
|
courseId: t,
|
|
1415
1394
|
adapter: n,
|
|
1416
1395
|
pageSize: l,
|
|
1417
1396
|
includeItems: !1,
|
|
1418
1397
|
filter: a,
|
|
1419
|
-
view:
|
|
1420
|
-
staleTime:
|
|
1398
|
+
view: m,
|
|
1399
|
+
staleTime: d,
|
|
1421
1400
|
enabled: u
|
|
1422
1401
|
})
|
|
1423
1402
|
);
|
|
@@ -1437,238 +1416,238 @@ function js(e) {
|
|
|
1437
1416
|
error: p.error,
|
|
1438
1417
|
inlineShape: null
|
|
1439
1418
|
};
|
|
1440
|
-
const f = (
|
|
1419
|
+
const f = (M = p.data) == null ? void 0 : M.pages[0];
|
|
1441
1420
|
return f ? {
|
|
1442
|
-
resolvedMode:
|
|
1421
|
+
resolvedMode: Us(f, r, s),
|
|
1443
1422
|
isResolving: !1,
|
|
1444
1423
|
probed: !0,
|
|
1445
1424
|
error: null,
|
|
1446
|
-
inlineShape:
|
|
1425
|
+
inlineShape: $s(f)
|
|
1447
1426
|
} : { resolvedMode: null, isResolving: !0, probed: !0, error: null, inlineShape: null };
|
|
1448
1427
|
}
|
|
1449
|
-
function
|
|
1428
|
+
function $s(e) {
|
|
1450
1429
|
let t = 1;
|
|
1451
1430
|
for (const n of e.modules)
|
|
1452
1431
|
n.itemCount > t && (t = n.itemCount);
|
|
1453
1432
|
return { moduleCount: Math.max(e.modules.length, 1), maxItemCount: t };
|
|
1454
1433
|
}
|
|
1455
|
-
const ft = "\0",
|
|
1456
|
-
function
|
|
1457
|
-
const o =
|
|
1458
|
-
|
|
1434
|
+
const ft = "\0", Bs = /* @__PURE__ */ new Map();
|
|
1435
|
+
function js(e, t, n = sn) {
|
|
1436
|
+
const o = Lt(), r = U(/* @__PURE__ */ new Map()), [s, l] = pe(Bs), a = e.join(ft), m = R(() => a === "" ? [] : a.split(ft), [a]);
|
|
1437
|
+
Le(() => {
|
|
1459
1438
|
const u = r.current, p = () => {
|
|
1460
|
-
l((
|
|
1461
|
-
const
|
|
1462
|
-
let w =
|
|
1463
|
-
for (const [
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1439
|
+
l((g) => {
|
|
1440
|
+
const h = /* @__PURE__ */ new Map();
|
|
1441
|
+
let w = g.size !== u.size;
|
|
1442
|
+
for (const [E, y] of u) {
|
|
1443
|
+
const N = y.getCurrentResult();
|
|
1444
|
+
h.set(E, N), !w && g.get(E) !== N && (w = !0);
|
|
1466
1445
|
}
|
|
1467
|
-
return w ?
|
|
1446
|
+
return w ? h : g;
|
|
1468
1447
|
});
|
|
1469
|
-
}, f = new Set(
|
|
1470
|
-
for (const
|
|
1471
|
-
if (u.has(
|
|
1472
|
-
const
|
|
1448
|
+
}, f = new Set(m);
|
|
1449
|
+
for (const g of m) {
|
|
1450
|
+
if (u.has(g)) continue;
|
|
1451
|
+
const h = new Pn(
|
|
1473
1452
|
o,
|
|
1474
|
-
t(
|
|
1453
|
+
t(g, !0)
|
|
1475
1454
|
);
|
|
1476
|
-
u.set(
|
|
1455
|
+
u.set(g, h), h.subscribe(p);
|
|
1477
1456
|
}
|
|
1478
|
-
for (const [
|
|
1479
|
-
|
|
1480
|
-
for (const
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1457
|
+
for (const [g, h] of u)
|
|
1458
|
+
h.setOptions(t(g, f.has(g)));
|
|
1459
|
+
for (const g of m) {
|
|
1460
|
+
const h = u.get(g);
|
|
1461
|
+
h && (u.delete(g), u.set(g, h));
|
|
1483
1462
|
}
|
|
1484
|
-
let
|
|
1485
|
-
if (
|
|
1486
|
-
for (const [
|
|
1487
|
-
if (
|
|
1488
|
-
f.has(
|
|
1463
|
+
let M = u.size - f.size;
|
|
1464
|
+
if (M > n)
|
|
1465
|
+
for (const [g, h] of u) {
|
|
1466
|
+
if (M <= n) break;
|
|
1467
|
+
f.has(g) || (h.destroy(), u.delete(g), M -= 1);
|
|
1489
1468
|
}
|
|
1490
1469
|
p();
|
|
1491
|
-
}, [o, t,
|
|
1470
|
+
}, [o, t, m, n]), Le(() => {
|
|
1492
1471
|
const u = r.current;
|
|
1493
1472
|
return () => {
|
|
1494
1473
|
for (const p of u.values()) p.destroy();
|
|
1495
1474
|
u.clear();
|
|
1496
1475
|
};
|
|
1497
1476
|
}, []);
|
|
1498
|
-
const
|
|
1477
|
+
const d = k((u) => {
|
|
1499
1478
|
var p;
|
|
1500
1479
|
(p = r.current.get(u)) == null || p.fetchNextPage();
|
|
1501
1480
|
}, []);
|
|
1502
|
-
return { results: s, fetchNextPage:
|
|
1481
|
+
return { results: s, fetchNextPage: d };
|
|
1503
1482
|
}
|
|
1504
|
-
const
|
|
1483
|
+
const Gs = [], Ys = () => {
|
|
1505
1484
|
};
|
|
1506
|
-
function
|
|
1507
|
-
var Y,
|
|
1485
|
+
function vl(e) {
|
|
1486
|
+
var Y, Te;
|
|
1508
1487
|
const {
|
|
1509
1488
|
courseId: t,
|
|
1510
1489
|
adapter: n,
|
|
1511
1490
|
view: o,
|
|
1512
1491
|
itemsMode: r = "auto",
|
|
1513
1492
|
inlineThreshold: s = rn,
|
|
1514
|
-
pageSize: l =
|
|
1493
|
+
pageSize: l = Je,
|
|
1515
1494
|
itemPageSize: a = on,
|
|
1516
|
-
itemConcurrency:
|
|
1517
|
-
retainCollapsedLimit:
|
|
1495
|
+
itemConcurrency: m = ks,
|
|
1496
|
+
retainCollapsedLimit: d = sn,
|
|
1518
1497
|
staleTime: u = Oe,
|
|
1519
1498
|
initialExpandedModuleIds: p,
|
|
1520
1499
|
initialFilter: f = J
|
|
1521
|
-
} = e,
|
|
1522
|
-
() =>
|
|
1523
|
-
[
|
|
1524
|
-
), y = ee(
|
|
1500
|
+
} = e, M = Lt(), g = he(), [h, w] = pe(f), E = R(
|
|
1501
|
+
() => Ls(g.filters, n.capabilities),
|
|
1502
|
+
[g.filters, n.capabilities]
|
|
1503
|
+
), y = ee(E, h), N = Ze(y), D = zs({
|
|
1525
1504
|
courseId: t,
|
|
1526
1505
|
adapter: n,
|
|
1527
1506
|
mode: r,
|
|
1528
1507
|
inlineThreshold: s,
|
|
1529
1508
|
pageSize: l,
|
|
1530
|
-
filter:
|
|
1509
|
+
filter: N,
|
|
1531
1510
|
view: o,
|
|
1532
1511
|
staleTime: u
|
|
1533
|
-
}),
|
|
1512
|
+
}), q = D.resolvedMode, x = Fs({
|
|
1534
1513
|
courseId: t,
|
|
1535
1514
|
adapter: n,
|
|
1536
1515
|
pageSize: l,
|
|
1537
|
-
filter:
|
|
1516
|
+
filter: N,
|
|
1538
1517
|
view: o,
|
|
1539
1518
|
staleTime: u,
|
|
1540
|
-
includeItems:
|
|
1541
|
-
inlineItemsFirst: (Y =
|
|
1542
|
-
inlineFirst: (
|
|
1543
|
-
enabled:
|
|
1544
|
-
}), [
|
|
1519
|
+
includeItems: q === "inline",
|
|
1520
|
+
inlineItemsFirst: (Y = D.inlineShape) == null ? void 0 : Y.maxItemCount,
|
|
1521
|
+
inlineFirst: (Te = D.inlineShape) == null ? void 0 : Te.moduleCount,
|
|
1522
|
+
enabled: q !== null
|
|
1523
|
+
}), [v, z] = pe(
|
|
1545
1524
|
() => p ?? []
|
|
1546
1525
|
), G = R(() => {
|
|
1547
|
-
const
|
|
1548
|
-
for (const
|
|
1549
|
-
return
|
|
1526
|
+
const I = /* @__PURE__ */ new Map();
|
|
1527
|
+
for (const b of x.modules) I.set(b.id, b);
|
|
1528
|
+
return I;
|
|
1550
1529
|
}, [x.modules]), oe = R(
|
|
1551
|
-
() =>
|
|
1552
|
-
const
|
|
1553
|
-
return
|
|
1530
|
+
() => v.filter((I) => {
|
|
1531
|
+
const b = G.get(I);
|
|
1532
|
+
return b !== void 0 && b.items === void 0;
|
|
1554
1533
|
}),
|
|
1555
|
-
[
|
|
1556
|
-
),
|
|
1557
|
-
(
|
|
1534
|
+
[v, G]
|
|
1535
|
+
), be = R(() => new Set(oe), [oe]), Me = R(() => Cn(m), [m]), Ue = k(
|
|
1536
|
+
(I, b) => cn({
|
|
1558
1537
|
courseId: t,
|
|
1559
|
-
moduleId:
|
|
1538
|
+
moduleId: I,
|
|
1560
1539
|
adapter: n,
|
|
1561
1540
|
pageSize: a,
|
|
1562
1541
|
view: o,
|
|
1563
1542
|
staleTime: u,
|
|
1564
|
-
enabled:
|
|
1565
|
-
limit:
|
|
1543
|
+
enabled: b,
|
|
1544
|
+
limit: Me
|
|
1566
1545
|
}),
|
|
1567
|
-
[t, n, a, o, u,
|
|
1568
|
-
), re =
|
|
1569
|
-
(
|
|
1570
|
-
let
|
|
1571
|
-
return
|
|
1546
|
+
[t, n, a, o, u, Me]
|
|
1547
|
+
), re = js(oe, Ue, d), se = re.fetchNextPage, Se = U(/* @__PURE__ */ new Map()), Q = k(
|
|
1548
|
+
(I) => {
|
|
1549
|
+
let b = Se.current.get(I);
|
|
1550
|
+
return b || (b = () => se(I), Se.current.set(I, b)), b;
|
|
1572
1551
|
},
|
|
1573
1552
|
[se]
|
|
1574
|
-
), H = k((
|
|
1553
|
+
), H = k((I) => {
|
|
1575
1554
|
z(
|
|
1576
|
-
(
|
|
1555
|
+
(b) => b.includes(I) ? b : [...b, I]
|
|
1577
1556
|
);
|
|
1578
1557
|
}, []), C = k(
|
|
1579
|
-
(
|
|
1580
|
-
z((
|
|
1558
|
+
(I) => {
|
|
1559
|
+
z((b) => b.filter((L) => L !== I)), M.cancelQueries({ queryKey: ln(t, I) });
|
|
1581
1560
|
},
|
|
1582
|
-
[
|
|
1583
|
-
), $ = U(
|
|
1584
|
-
$.current =
|
|
1585
|
-
const V = U(
|
|
1586
|
-
V.current =
|
|
1561
|
+
[M, t]
|
|
1562
|
+
), $ = U(v);
|
|
1563
|
+
$.current = v;
|
|
1564
|
+
const V = U(h);
|
|
1565
|
+
V.current = h;
|
|
1587
1566
|
const F = U(null), K = k(
|
|
1588
|
-
(
|
|
1589
|
-
if (
|
|
1590
|
-
if (V.current =
|
|
1567
|
+
(I) => {
|
|
1568
|
+
if (I === V.current) return;
|
|
1569
|
+
if (V.current = I, I !== J && ee(E, I) !== void 0) {
|
|
1591
1570
|
F.current === null && (F.current = $.current);
|
|
1592
|
-
for (const
|
|
1571
|
+
for (const L of $.current) C(L);
|
|
1593
1572
|
} else F.current !== null && (z(F.current), $.current = F.current, F.current = null);
|
|
1594
|
-
w(
|
|
1573
|
+
w(I);
|
|
1595
1574
|
},
|
|
1596
|
-
[
|
|
1597
|
-
),
|
|
1598
|
-
(
|
|
1599
|
-
$.current.includes(
|
|
1575
|
+
[E, C]
|
|
1576
|
+
), ye = k(
|
|
1577
|
+
(I) => {
|
|
1578
|
+
$.current.includes(I) ? C(I) : H(I);
|
|
1600
1579
|
},
|
|
1601
1580
|
[C, H]
|
|
1602
|
-
), ie = re.results, le = U(/* @__PURE__ */ new Map()),
|
|
1603
|
-
(
|
|
1581
|
+
), ie = re.results, le = U(/* @__PURE__ */ new Map()), _e = k(
|
|
1582
|
+
(I) => {
|
|
1604
1583
|
var tt;
|
|
1605
|
-
const
|
|
1606
|
-
if (B && B.items === (
|
|
1584
|
+
const b = G.get(I), L = ie.get(I), ae = be.has(I), B = le.current.get(I);
|
|
1585
|
+
if (B && B.items === (b == null ? void 0 : b.items) && B.result === L && B.active === ae)
|
|
1607
1586
|
return B.value;
|
|
1608
|
-
const ue = (
|
|
1609
|
-
if ((
|
|
1587
|
+
const ue = (Pe) => (le.current.set(I, { items: b == null ? void 0 : b.items, result: L, active: ae, value: Pe }), Pe);
|
|
1588
|
+
if ((b == null ? void 0 : b.items) !== void 0)
|
|
1610
1589
|
return ue({
|
|
1611
|
-
items:
|
|
1612
|
-
pageInfo:
|
|
1590
|
+
items: b.items,
|
|
1591
|
+
pageInfo: Re,
|
|
1613
1592
|
hasNextPage: !1,
|
|
1614
|
-
fetchNextPage:
|
|
1593
|
+
fetchNextPage: Ys,
|
|
1615
1594
|
isLoading: !1,
|
|
1616
1595
|
isFetchingNextPage: !1,
|
|
1617
1596
|
error: null,
|
|
1618
1597
|
source: "inline"
|
|
1619
1598
|
});
|
|
1620
|
-
const j = (tt =
|
|
1599
|
+
const j = (tt = L == null ? void 0 : L.data) == null ? void 0 : tt.pages, A = j ? j.flatMap((Pe) => Pe.items) : Gs, Ee = j && j.length > 0 ? j[j.length - 1].pageInfo : Re;
|
|
1621
1600
|
return ue({
|
|
1622
1601
|
items: A,
|
|
1623
|
-
pageInfo:
|
|
1624
|
-
hasNextPage:
|
|
1625
|
-
fetchNextPage: Q(
|
|
1626
|
-
isLoading:
|
|
1627
|
-
isFetchingNextPage: (
|
|
1628
|
-
error: (
|
|
1602
|
+
pageInfo: Ee,
|
|
1603
|
+
hasNextPage: Ee.hasNextPage,
|
|
1604
|
+
fetchNextPage: Q(I),
|
|
1605
|
+
isLoading: L ? L.isLoading : ae,
|
|
1606
|
+
isFetchingNextPage: (L == null ? void 0 : L.isFetchingNextPage) ?? !1,
|
|
1607
|
+
error: (L == null ? void 0 : L.error) ?? null,
|
|
1629
1608
|
source: "onDemand"
|
|
1630
1609
|
});
|
|
1631
1610
|
},
|
|
1632
|
-
[G, ie, Q,
|
|
1611
|
+
[G, ie, Q, be]
|
|
1633
1612
|
);
|
|
1634
1613
|
return {
|
|
1635
1614
|
modules: x.modules,
|
|
1636
1615
|
pageInfo: x.pageInfo,
|
|
1637
1616
|
hasNextPage: x.hasNextPage,
|
|
1638
1617
|
fetchNextPage: x.fetchNextPage,
|
|
1639
|
-
isLoading:
|
|
1618
|
+
isLoading: D.isResolving || x.isPending,
|
|
1640
1619
|
isFetchingNextPage: x.isFetchingNextPage,
|
|
1641
|
-
error: x.error ??
|
|
1642
|
-
itemsMode:
|
|
1643
|
-
getItems:
|
|
1620
|
+
error: x.error ?? D.error,
|
|
1621
|
+
itemsMode: q,
|
|
1622
|
+
getItems: _e,
|
|
1644
1623
|
expandModule: H,
|
|
1645
1624
|
collapseModule: C,
|
|
1646
|
-
toggleModule:
|
|
1647
|
-
expandedModuleIds:
|
|
1648
|
-
filter:
|
|
1625
|
+
toggleModule: ye,
|
|
1626
|
+
expandedModuleIds: v,
|
|
1627
|
+
filter: h,
|
|
1649
1628
|
setFilter: K,
|
|
1650
1629
|
filterEntry: y,
|
|
1651
|
-
filterPredicate:
|
|
1652
|
-
filterResultsArePartial:
|
|
1630
|
+
filterPredicate: Ye(y) ? y == null ? void 0 : y.predicate : void 0,
|
|
1631
|
+
filterResultsArePartial: h !== J && Ye(y) && x.hasNextPage
|
|
1653
1632
|
};
|
|
1654
1633
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const r = o ?
|
|
1634
|
+
function Ll(e, t, n, o) {
|
|
1635
|
+
const r = o ? Ie.items(t, n, o) : ln(t, n);
|
|
1657
1636
|
return e.invalidateQueries({ queryKey: r });
|
|
1658
1637
|
}
|
|
1659
|
-
function
|
|
1660
|
-
const o = n ?
|
|
1638
|
+
function Al(e, t, n) {
|
|
1639
|
+
const o = n ? Ie.list(t, n) : Os(t);
|
|
1661
1640
|
return e.invalidateQueries({ queryKey: o });
|
|
1662
1641
|
}
|
|
1663
|
-
function
|
|
1664
|
-
return e.invalidateQueries({ queryKey:
|
|
1642
|
+
function xl(e, t) {
|
|
1643
|
+
return e.invalidateQueries({ queryKey: Ie.course(t) });
|
|
1665
1644
|
}
|
|
1666
|
-
function
|
|
1667
|
-
const { t: o } = O(), r =
|
|
1668
|
-
return /* @__PURE__ */ T
|
|
1669
|
-
/* @__PURE__ */ i(
|
|
1645
|
+
function Ws({ value: e, onChange: t, describedBy: n }) {
|
|
1646
|
+
const { t: o } = O(), r = he(), s = R(() => Xe(r.filters), [r.filters]), l = Be();
|
|
1647
|
+
return /* @__PURE__ */ _(T, { as: "div", margin: "medium 0 0 0", children: [
|
|
1648
|
+
/* @__PURE__ */ i(T, { as: "div", margin: "0 0 x-small 0", children: /* @__PURE__ */ i(P, { size: "medium", weight: "bold", id: l, children: o("filterGroupLabel") }) }),
|
|
1670
1649
|
/* @__PURE__ */ i(
|
|
1671
|
-
|
|
1650
|
+
S,
|
|
1672
1651
|
{
|
|
1673
1652
|
gap: "space4",
|
|
1674
1653
|
wrap: "wrap",
|
|
@@ -1677,14 +1656,14 @@ function Vs({ value: e, onChange: t, describedBy: n }) {
|
|
|
1677
1656
|
"aria-labelledby": l,
|
|
1678
1657
|
"data-testid": "filter-chips",
|
|
1679
1658
|
children: s.map((a) => {
|
|
1680
|
-
const
|
|
1681
|
-
return /* @__PURE__ */ i(
|
|
1682
|
-
|
|
1659
|
+
const m = a.key === e;
|
|
1660
|
+
return /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
|
|
1661
|
+
me,
|
|
1683
1662
|
{
|
|
1684
1663
|
size: "medium",
|
|
1685
|
-
color:
|
|
1686
|
-
"aria-pressed":
|
|
1687
|
-
"aria-describedby": a.key !== J &&
|
|
1664
|
+
color: m ? "primary" : "secondary",
|
|
1665
|
+
"aria-pressed": m,
|
|
1666
|
+
"aria-describedby": a.key !== J && Ye(a) ? n : void 0,
|
|
1688
1667
|
onClick: () => t(a.key),
|
|
1689
1668
|
"data-testid": `filter-chip-${a.key}`,
|
|
1690
1669
|
themeOverride: { borderRadius: "0.5rem" },
|
|
@@ -1696,31 +1675,29 @@ function Vs({ value: e, onChange: t, describedBy: n }) {
|
|
|
1696
1675
|
)
|
|
1697
1676
|
] });
|
|
1698
1677
|
}
|
|
1699
|
-
const
|
|
1678
|
+
const Qs = "#586874", Hs = "#D7DADE", dn = (e, t) => {
|
|
1700
1679
|
var n, o, r, s;
|
|
1701
1680
|
return {
|
|
1702
|
-
baseTextColor: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey5782) ??
|
|
1703
|
-
baseBorderColor: ((s = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : s.grey1424) ??
|
|
1681
|
+
baseTextColor: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey5782) ?? Qs,
|
|
1682
|
+
baseBorderColor: ((s = (r = t.colors) == null ? void 0 : r.contrasts) == null ? void 0 : s.grey1424) ?? Hs
|
|
1704
1683
|
};
|
|
1705
|
-
},
|
|
1684
|
+
}, Vs = {
|
|
1706
1685
|
not_started: {},
|
|
1707
|
-
in_progress: { color: "info", icon: /* @__PURE__ */ i(wt, {}) },
|
|
1708
|
-
complete: { color: "success", icon: /* @__PURE__ */ i(
|
|
1709
|
-
missing: { color: "error", icon: /* @__PURE__ */ i(
|
|
1710
|
-
incomplete: { color: "error", icon: /* @__PURE__ */ i(
|
|
1711
|
-
missing_and_incomplete: { color: "error", icon: /* @__PURE__ */ i(
|
|
1712
|
-
locked: { icon: /* @__PURE__ */ i(
|
|
1713
|
-
},
|
|
1686
|
+
in_progress: { color: "info", icon: /* @__PURE__ */ i(wt, { size: "sm" }) },
|
|
1687
|
+
complete: { color: "success", icon: /* @__PURE__ */ i(Ct, { size: "sm" }) },
|
|
1688
|
+
missing: { color: "error", icon: /* @__PURE__ */ i(de, { size: "sm" }) },
|
|
1689
|
+
incomplete: { color: "error", icon: /* @__PURE__ */ i(de, { size: "sm" }) },
|
|
1690
|
+
missing_and_incomplete: { color: "error", icon: /* @__PURE__ */ i(de, { size: "sm" }) },
|
|
1691
|
+
locked: { icon: /* @__PURE__ */ i(Pt, { size: "sm" }), themeOverride: dn }
|
|
1692
|
+
}, Ks = {
|
|
1714
1693
|
not_started: {},
|
|
1715
|
-
in_progress: { color: "info", icon: /* @__PURE__ */ i(wt, {}) },
|
|
1716
|
-
complete: { color: "success", icon: /* @__PURE__ */ i(
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
missing: { color: "error", icon: /* @__PURE__ */ i(we, {}) },
|
|
1721
|
-
locked: { icon: /* @__PURE__ */ i(Ct, {}), themeOverride: dn }
|
|
1694
|
+
in_progress: { color: "info", icon: /* @__PURE__ */ i(wt, { size: "sm" }) },
|
|
1695
|
+
complete: { color: "success", icon: /* @__PURE__ */ i(Ct, { size: "sm" }) },
|
|
1696
|
+
incomplete: { color: "error", icon: /* @__PURE__ */ i(de, { size: "sm" }) },
|
|
1697
|
+
missing: { color: "error", icon: /* @__PURE__ */ i(de, { size: "sm" }) },
|
|
1698
|
+
locked: { icon: /* @__PURE__ */ i(Pt, { size: "sm" }), themeOverride: dn }
|
|
1722
1699
|
};
|
|
1723
|
-
function
|
|
1700
|
+
function Zs(e, t, n, o) {
|
|
1724
1701
|
switch (t) {
|
|
1725
1702
|
case "not_started":
|
|
1726
1703
|
return e("moduleStatusNotStarted");
|
|
@@ -1741,7 +1718,7 @@ function ei(e, t, n, o) {
|
|
|
1741
1718
|
return e("moduleStatusLocked");
|
|
1742
1719
|
}
|
|
1743
1720
|
}
|
|
1744
|
-
function
|
|
1721
|
+
function Xs(e, t) {
|
|
1745
1722
|
switch (t) {
|
|
1746
1723
|
case "not_started":
|
|
1747
1724
|
return e("itemStatusNotStarted");
|
|
@@ -1749,12 +1726,8 @@ function ti(e, t) {
|
|
|
1749
1726
|
return e("itemStatusInProgress");
|
|
1750
1727
|
case "complete":
|
|
1751
1728
|
return e("itemStatusComplete");
|
|
1752
|
-
case "
|
|
1753
|
-
return e("
|
|
1754
|
-
case "graded":
|
|
1755
|
-
return e("itemStatusGraded");
|
|
1756
|
-
case "excused":
|
|
1757
|
-
return e("itemStatusExcused");
|
|
1729
|
+
case "incomplete":
|
|
1730
|
+
return e("itemStatusIncomplete");
|
|
1758
1731
|
case "missing":
|
|
1759
1732
|
return e("itemStatusMissing");
|
|
1760
1733
|
case "locked":
|
|
@@ -1763,7 +1736,7 @@ function ti(e, t) {
|
|
|
1763
1736
|
}
|
|
1764
1737
|
function mn(e, t, n) {
|
|
1765
1738
|
return /* @__PURE__ */ i(
|
|
1766
|
-
|
|
1739
|
+
xn,
|
|
1767
1740
|
{
|
|
1768
1741
|
color: e.color,
|
|
1769
1742
|
renderIcon: e.icon,
|
|
@@ -1773,56 +1746,56 @@ function mn(e, t, n) {
|
|
|
1773
1746
|
}
|
|
1774
1747
|
);
|
|
1775
1748
|
}
|
|
1776
|
-
function
|
|
1749
|
+
function Js({
|
|
1777
1750
|
status: e,
|
|
1778
1751
|
missingCount: t,
|
|
1779
1752
|
incompleteCount: n
|
|
1780
1753
|
}) {
|
|
1781
1754
|
const { t: o } = O();
|
|
1782
1755
|
return mn(
|
|
1783
|
-
|
|
1784
|
-
|
|
1756
|
+
Vs[e],
|
|
1757
|
+
Zs(o, e, t, n),
|
|
1785
1758
|
"module-status-pill"
|
|
1786
1759
|
);
|
|
1787
1760
|
}
|
|
1788
|
-
function
|
|
1761
|
+
function ei({ status: e }) {
|
|
1789
1762
|
const { t } = O();
|
|
1790
1763
|
return mn(
|
|
1791
|
-
|
|
1792
|
-
|
|
1764
|
+
Ks[e],
|
|
1765
|
+
Xs(t, e),
|
|
1793
1766
|
"item-status-pill"
|
|
1794
1767
|
);
|
|
1795
1768
|
}
|
|
1796
|
-
const
|
|
1769
|
+
const ti = 1.75, gt = "2.75rem", ni = { lineHeight: 0, display: "block" }, oi = {
|
|
1797
1770
|
display: "inline-block",
|
|
1798
1771
|
paddingLeft: "0.5rem",
|
|
1799
1772
|
marginLeft: "0.5rem"
|
|
1800
|
-
},
|
|
1801
|
-
function
|
|
1802
|
-
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(
|
|
1773
|
+
}, ri = "#D7DADE", si = { fontSize: 0 };
|
|
1774
|
+
function We(e) {
|
|
1775
|
+
return e == null || typeof e == "boolean" || e === "" ? !0 : Array.isArray(e) ? e.every(We) : _t(e) && e.type === Et ? We(e.props.children) : !1;
|
|
1803
1776
|
}
|
|
1804
|
-
const
|
|
1777
|
+
const ii = {
|
|
1805
1778
|
contentVisibility: "auto",
|
|
1806
1779
|
containIntrinsicSize: "auto 3.75rem"
|
|
1807
1780
|
};
|
|
1808
|
-
function
|
|
1809
|
-
const e =
|
|
1781
|
+
function li() {
|
|
1782
|
+
const e = Dt();
|
|
1810
1783
|
return "key" in e && e.key === "canvas-high-contrast" ? "inline" : "standalone";
|
|
1811
1784
|
}
|
|
1812
|
-
function
|
|
1785
|
+
function ai() {
|
|
1813
1786
|
var t, n;
|
|
1814
|
-
const e =
|
|
1815
|
-
return ("colors" in e ? (n = (t = e.colors) == null ? void 0 : t.contrasts) == null ? void 0 : n.grey1424 : void 0) ??
|
|
1787
|
+
const e = Dt();
|
|
1788
|
+
return ("colors" in e ? (n = (t = e.colors) == null ? void 0 : t.contrasts) == null ? void 0 : n.grey1424 : void 0) ?? ri;
|
|
1816
1789
|
}
|
|
1817
|
-
function
|
|
1790
|
+
function ui({ item: e, today: t, navigation: n }) {
|
|
1818
1791
|
var x;
|
|
1819
|
-
const { t: o, locale: r, timezone: s } = O(), l =
|
|
1820
|
-
() => ({ ...
|
|
1792
|
+
const { t: o, locale: r, timezone: s } = O(), l = li(), a = ai(), m = R(
|
|
1793
|
+
() => ({ ...oi, borderLeft: `1px solid ${a}` }),
|
|
1821
1794
|
[a]
|
|
1822
|
-
),
|
|
1795
|
+
), d = ke(), u = he(), p = R(() => Xe(u.itemMeta), [u.itemMeta]), f = e.title || o("itemUntitled");
|
|
1823
1796
|
if (e.type === "sub_header")
|
|
1824
1797
|
return /* @__PURE__ */ i(
|
|
1825
|
-
|
|
1798
|
+
T,
|
|
1826
1799
|
{
|
|
1827
1800
|
as: "div",
|
|
1828
1801
|
padding: "x-small small",
|
|
@@ -1842,9 +1815,9 @@ function mi({ item: e, today: t, navigation: n }) {
|
|
|
1842
1815
|
)
|
|
1843
1816
|
}
|
|
1844
1817
|
);
|
|
1845
|
-
const
|
|
1846
|
-
return /* @__PURE__ */ i("div", { style: { marginLeft: `${e.indent *
|
|
1847
|
-
|
|
1818
|
+
const M = ((x = n == null ? void 0 : n.getItemHref) == null ? void 0 : x.call(n, e)) ?? e.url ?? null, g = e.status === "locked", h = n == null ? void 0 : n.onItemClick, w = h ? (v) => h(e, v) : void 0, E = ee(u.itemTypes, e.type), y = E != null && E.renderIcon ? E.renderIcon({ item: e }) : E == null ? void 0 : E.icon, N = { item: e, t: o, today: t, locale: r, timezone: s, formatters: d, config: u }, D = p.map((v) => ({ key: v.key, node: v.render(N) })).filter((v) => !We(v.node)), q = D.some((v) => v.key === Ps);
|
|
1819
|
+
return /* @__PURE__ */ i("div", { style: { marginLeft: `${e.indent * ti}rem`, ...ii }, children: /* @__PURE__ */ i(
|
|
1820
|
+
T,
|
|
1848
1821
|
{
|
|
1849
1822
|
as: "div",
|
|
1850
1823
|
background: "secondary",
|
|
@@ -1852,10 +1825,10 @@ function mi({ item: e, today: t, navigation: n }) {
|
|
|
1852
1825
|
padding: "x-small small",
|
|
1853
1826
|
margin: "x-small 0 0 0",
|
|
1854
1827
|
"data-testid": `module-item-${e.id}`,
|
|
1855
|
-
children: /* @__PURE__ */
|
|
1856
|
-
e.indent > 0 ? /* @__PURE__ */ i(
|
|
1857
|
-
/* @__PURE__ */ i(
|
|
1858
|
-
|
|
1828
|
+
children: /* @__PURE__ */ _(S, { alignItems: "center", gap: "small", children: [
|
|
1829
|
+
e.indent > 0 ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(P, { color: "secondary", children: /* @__PURE__ */ i(_n, {}) }) }) : null,
|
|
1830
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
|
|
1831
|
+
T,
|
|
1859
1832
|
{
|
|
1860
1833
|
as: "div",
|
|
1861
1834
|
background: "primary",
|
|
@@ -1863,27 +1836,27 @@ function mi({ item: e, today: t, navigation: n }) {
|
|
|
1863
1836
|
borderRadius: "large",
|
|
1864
1837
|
width: gt,
|
|
1865
1838
|
height: gt,
|
|
1866
|
-
children: /* @__PURE__ */ i(
|
|
1867
|
-
/* @__PURE__ */ i("span", { style:
|
|
1868
|
-
|
|
1839
|
+
children: /* @__PURE__ */ i(S, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ _(S.Item, { children: [
|
|
1840
|
+
/* @__PURE__ */ i("span", { style: ni, "data-testid": "item-type-icon", children: y }),
|
|
1841
|
+
E && !q ? /* @__PURE__ */ i(nt, { children: o(E.label) }) : null
|
|
1869
1842
|
] }) })
|
|
1870
1843
|
}
|
|
1871
1844
|
) }),
|
|
1872
|
-
/* @__PURE__ */
|
|
1873
|
-
/* @__PURE__ */ i(
|
|
1845
|
+
/* @__PURE__ */ _(S.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
1846
|
+
/* @__PURE__ */ i(T, { as: "div", children: g || !M ? /* @__PURE__ */ i(
|
|
1874
1847
|
P,
|
|
1875
1848
|
{
|
|
1876
1849
|
weight: "bold",
|
|
1877
1850
|
size: "small",
|
|
1878
|
-
color:
|
|
1851
|
+
color: g ? "secondary" : "primary",
|
|
1879
1852
|
"data-testid": "module-item-title",
|
|
1880
|
-
"data-locked":
|
|
1853
|
+
"data-locked": g ? "true" : void 0,
|
|
1881
1854
|
children: f
|
|
1882
1855
|
}
|
|
1883
|
-
) : /* @__PURE__ */
|
|
1884
|
-
|
|
1856
|
+
) : /* @__PURE__ */ _(
|
|
1857
|
+
An,
|
|
1885
1858
|
{
|
|
1886
|
-
href:
|
|
1859
|
+
href: M,
|
|
1887
1860
|
onClick: w,
|
|
1888
1861
|
forceButtonRole: !1,
|
|
1889
1862
|
variant: l,
|
|
@@ -1895,23 +1868,23 @@ function mi({ item: e, today: t, navigation: n }) {
|
|
|
1895
1868
|
]
|
|
1896
1869
|
}
|
|
1897
1870
|
) }),
|
|
1898
|
-
/* @__PURE__ */ i(
|
|
1899
|
-
z > 0 ? /* @__PURE__ */ i("span", { style:
|
|
1900
|
-
/* @__PURE__ */ i("span", { style: z > 0 ?
|
|
1901
|
-
] },
|
|
1871
|
+
/* @__PURE__ */ i(T, { as: "div", children: /* @__PURE__ */ i(P, { size: "x-small", color: "secondary", "data-testid": "module-item-meta", children: D.map((v, z) => /* @__PURE__ */ _(Et, { children: [
|
|
1872
|
+
z > 0 ? /* @__PURE__ */ i("span", { style: si, children: " " }) : null,
|
|
1873
|
+
/* @__PURE__ */ i("span", { style: z > 0 ? m : void 0, children: v.node })
|
|
1874
|
+
] }, v.key)) }) })
|
|
1902
1875
|
] }),
|
|
1903
|
-
e.status ? /* @__PURE__ */ i(
|
|
1876
|
+
e.status ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(ei, { status: e.status }) }) : null
|
|
1904
1877
|
] })
|
|
1905
1878
|
}
|
|
1906
1879
|
) });
|
|
1907
1880
|
}
|
|
1908
|
-
const
|
|
1909
|
-
function
|
|
1881
|
+
const ci = Tt(ui), ht = "3rem";
|
|
1882
|
+
function di({
|
|
1910
1883
|
label: e,
|
|
1911
1884
|
dimmed: t = !1
|
|
1912
1885
|
}) {
|
|
1913
1886
|
return e === null ? null : /* @__PURE__ */ i(
|
|
1914
|
-
|
|
1887
|
+
T,
|
|
1915
1888
|
{
|
|
1916
1889
|
as: "div",
|
|
1917
1890
|
display: "inline-block",
|
|
@@ -1922,36 +1895,36 @@ function fi({
|
|
|
1922
1895
|
height: ht,
|
|
1923
1896
|
padding: "0 xx-small",
|
|
1924
1897
|
"data-testid": "module-number",
|
|
1925
|
-
children: /* @__PURE__ */ i(
|
|
1898
|
+
children: /* @__PURE__ */ i(S, { height: "100%", alignItems: "center", justifyItems: "center", children: /* @__PURE__ */ i(P, { weight: "bold", size: "medium", color: t ? "secondary" : "primary", children: e }) })
|
|
1926
1899
|
}
|
|
1927
1900
|
);
|
|
1928
1901
|
}
|
|
1929
|
-
function
|
|
1902
|
+
function mi({ module: e, today: t }) {
|
|
1930
1903
|
var a;
|
|
1931
1904
|
const { t: n } = O(), o = ke(), r = ((a = e.progress) == null ? void 0 : a.status) === "locked", s = e.unlockAt;
|
|
1932
1905
|
let l = null;
|
|
1933
|
-
return r && s ? l = o.unlockByline(s, t) : r ? l = n("lockedByline") : !e.progress && s && (l = o.unlockByline(s, t)), l === null ? null : /* @__PURE__ */ i(
|
|
1906
|
+
return r && s ? l = o.unlockByline(s, t) : r ? l = n("lockedByline") : !e.progress && s && (l = o.unlockByline(s, t)), l === null ? null : /* @__PURE__ */ i(T, { as: "div", margin: "xxx-small 0 0 0", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", "data-testid": "module-byline", children: l }) });
|
|
1934
1907
|
}
|
|
1935
|
-
const
|
|
1908
|
+
const pi = "#273540", fi = "#D7DADE", gi = "0.5rem", hi = (e, t) => {
|
|
1936
1909
|
var n, o, r, s, l;
|
|
1937
1910
|
return {
|
|
1938
|
-
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ??
|
|
1939
|
-
borderRadius: String(((r = t.borders) == null ? void 0 : r.radiusLarge) ??
|
|
1940
|
-
borderColor: ((l = (s = t.colors) == null ? void 0 : s.contrasts) == null ? void 0 : l.grey1424) ??
|
|
1911
|
+
meterColorBrand: ((o = (n = t.colors) == null ? void 0 : n.contrasts) == null ? void 0 : o.grey125125) ?? pi,
|
|
1912
|
+
borderRadius: String(((r = t.borders) == null ? void 0 : r.radiusLarge) ?? gi),
|
|
1913
|
+
borderColor: ((l = (s = t.colors) == null ? void 0 : s.contrasts) == null ? void 0 : l.grey1424) ?? fi,
|
|
1941
1914
|
trackBottomBorderColor: "transparent"
|
|
1942
1915
|
};
|
|
1943
|
-
},
|
|
1944
|
-
function
|
|
1916
|
+
}, Ii = "66.667%", bi = "8rem", Mi = 2;
|
|
1917
|
+
function Si({
|
|
1945
1918
|
module: e,
|
|
1946
1919
|
breakpoints: t
|
|
1947
1920
|
}) {
|
|
1948
1921
|
const { t: n } = O(), o = ke(), r = e.progress;
|
|
1949
1922
|
if (!r || r.status === "locked" || r.requirementCount <= 0) return null;
|
|
1950
1923
|
const s = t.mobileOnly, l = Object.keys(t).length === 0 || t.desktop === !0;
|
|
1951
|
-
return /* @__PURE__ */
|
|
1952
|
-
|
|
1924
|
+
return /* @__PURE__ */ _(
|
|
1925
|
+
S,
|
|
1953
1926
|
{
|
|
1954
|
-
width: l ?
|
|
1927
|
+
width: l ? Ii : "100%",
|
|
1955
1928
|
direction: s ? "column" : "row",
|
|
1956
1929
|
alignItems: s ? "stretch" : "center",
|
|
1957
1930
|
wrap: "wrap",
|
|
@@ -1959,7 +1932,7 @@ function Ti({
|
|
|
1959
1932
|
margin: "small 0 0 0",
|
|
1960
1933
|
"data-testid": "module-progress",
|
|
1961
1934
|
children: [
|
|
1962
|
-
/* @__PURE__ */ i(
|
|
1935
|
+
/* @__PURE__ */ i(S.Item, { size: s ? void 0 : bi, shouldGrow: !0, children: /* @__PURE__ */ i(
|
|
1963
1936
|
Ln,
|
|
1964
1937
|
{
|
|
1965
1938
|
size: "x-small",
|
|
@@ -1968,16 +1941,16 @@ function Ti({
|
|
|
1968
1941
|
valueMax: r.requirementCount,
|
|
1969
1942
|
shouldAnimate: !1,
|
|
1970
1943
|
screenReaderLabel: n("moduleProgressScreenReaderLabel", { name: e.name }),
|
|
1971
|
-
formatScreenReaderValue: () =>
|
|
1944
|
+
formatScreenReaderValue: () => Ss(
|
|
1972
1945
|
n,
|
|
1973
1946
|
r.percentComplete,
|
|
1974
1947
|
r.requirementsMet,
|
|
1975
1948
|
r.requirementCount
|
|
1976
1949
|
),
|
|
1977
|
-
themeOverride:
|
|
1950
|
+
themeOverride: hi
|
|
1978
1951
|
}
|
|
1979
1952
|
) }),
|
|
1980
|
-
/* @__PURE__ */ i(
|
|
1953
|
+
/* @__PURE__ */ i(S.Item, { shouldShrink: !0, "aria-hidden": "true", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: o.progress(
|
|
1981
1954
|
r.percentComplete,
|
|
1982
1955
|
r.requirementsMet,
|
|
1983
1956
|
r.requirementCount
|
|
@@ -1987,23 +1960,23 @@ function Ti({
|
|
|
1987
1960
|
);
|
|
1988
1961
|
}
|
|
1989
1962
|
const It = (e) => `platform-modules-panel-${e}`;
|
|
1990
|
-
function
|
|
1963
|
+
function yi({
|
|
1991
1964
|
module: e,
|
|
1992
1965
|
state: t,
|
|
1993
1966
|
today: n,
|
|
1994
1967
|
navigation: o,
|
|
1995
1968
|
showDiagnostics: r
|
|
1996
1969
|
}) {
|
|
1997
|
-
const { t: s } = O(), l = U(null), a = t.items.length,
|
|
1998
|
-
return
|
|
1999
|
-
!
|
|
1970
|
+
const { t: s } = O(), l = U(null), a = t.items.length, m = !t.isLoading && !t.isFetchingNextPage;
|
|
1971
|
+
return Le(() => {
|
|
1972
|
+
!m || a === 0 || l.current !== a && (l.current = a, At(
|
|
2000
1973
|
s("itemsLoadedAnnouncement", {
|
|
2001
1974
|
loaded: a,
|
|
2002
1975
|
count: e.itemCount,
|
|
2003
1976
|
name: e.name
|
|
2004
1977
|
})
|
|
2005
1978
|
));
|
|
2006
|
-
}, [
|
|
1979
|
+
}, [m, a, e.itemCount, e.name, s]), t.error ? /* @__PURE__ */ i(T, { as: "div", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2007
1980
|
Rt,
|
|
2008
1981
|
{
|
|
2009
1982
|
variant: "error",
|
|
@@ -2013,12 +1986,12 @@ function Ei({
|
|
|
2013
1986
|
"data-testid": "items-error",
|
|
2014
1987
|
children: s("itemsLoadErrorAlert", { message: t.error.message })
|
|
2015
1988
|
}
|
|
2016
|
-
) }) : t.isLoading ? /* @__PURE__ */ T
|
|
2017
|
-
/* @__PURE__ */ i(
|
|
1989
|
+
) }) : t.isLoading ? /* @__PURE__ */ _(T, { as: "div", margin: "small 0 0 0", "data-testid": "items-loading", children: [
|
|
1990
|
+
/* @__PURE__ */ i(qt, { size: "x-small", renderTitle: s("itemsLoadingSpinnerLabel") }),
|
|
2018
1991
|
" ",
|
|
2019
1992
|
/* @__PURE__ */ i(P, { size: "small", color: "secondary", children: s("itemsLoadingText") })
|
|
2020
|
-
] }) : /* @__PURE__ */ T
|
|
2021
|
-
r ? /* @__PURE__ */
|
|
1993
|
+
] }) : /* @__PURE__ */ _(T, { as: "div", margin: "small 0 0 0", children: [
|
|
1994
|
+
r ? /* @__PURE__ */ _(P, { size: "x-small", color: "secondary", "data-testid": "items-source", children: [
|
|
2022
1995
|
"items source: ",
|
|
2023
1996
|
t.source,
|
|
2024
1997
|
" · loaded ",
|
|
@@ -2026,9 +1999,9 @@ function Ei({
|
|
|
2026
1999
|
" of ",
|
|
2027
2000
|
e.itemCount
|
|
2028
2001
|
] }) : null,
|
|
2029
|
-
t.items.length === 0 ? /* @__PURE__ */ i(
|
|
2030
|
-
t.hasNextPage ? /* @__PURE__ */ i(
|
|
2031
|
-
|
|
2002
|
+
t.items.length === 0 ? /* @__PURE__ */ i(T, { as: "div", padding: "small", "data-testid": "items-empty", children: /* @__PURE__ */ i(P, { size: "small", color: "secondary", children: s("noItemsEmptyState") }) }) : /* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "items-list", children: t.items.map((d) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(ci, { item: d, today: n, navigation: o }) }, d.id)) }),
|
|
2003
|
+
t.hasNextPage ? /* @__PURE__ */ i(T, { as: "div", margin: "small 0 0 0", textAlign: "center", children: /* @__PURE__ */ i(
|
|
2004
|
+
me,
|
|
2032
2005
|
{
|
|
2033
2006
|
size: "small",
|
|
2034
2007
|
onClick: t.fetchNextPage,
|
|
@@ -2042,7 +2015,7 @@ function Ei({
|
|
|
2042
2015
|
) }) : null
|
|
2043
2016
|
] });
|
|
2044
2017
|
}
|
|
2045
|
-
function
|
|
2018
|
+
function _i({
|
|
2046
2019
|
module: e,
|
|
2047
2020
|
expanded: t,
|
|
2048
2021
|
onToggle: n,
|
|
@@ -2051,13 +2024,13 @@ function Pi({
|
|
|
2051
2024
|
navigation: s,
|
|
2052
2025
|
showDiagnostics: l = !1,
|
|
2053
2026
|
headingLevel: a = "h3",
|
|
2054
|
-
moduleLabel:
|
|
2055
|
-
breakpoints:
|
|
2027
|
+
moduleLabel: m,
|
|
2028
|
+
breakpoints: d = {}
|
|
2056
2029
|
}) {
|
|
2057
|
-
var
|
|
2058
|
-
const { t: u } = O(), p = ke(), f = ((
|
|
2059
|
-
return /* @__PURE__ */
|
|
2060
|
-
|
|
2030
|
+
var g, h;
|
|
2031
|
+
const { t: u } = O(), p = ke(), f = ((g = e.progress) == null ? void 0 : g.status) === "locked", M = m === void 0 ? p.moduleLabel(e.position, e) : m;
|
|
2032
|
+
return /* @__PURE__ */ _(
|
|
2033
|
+
T,
|
|
2061
2034
|
{
|
|
2062
2035
|
as: "div",
|
|
2063
2036
|
background: "primary",
|
|
@@ -2068,39 +2041,39 @@ function Pi({
|
|
|
2068
2041
|
margin: "0 0 small 0",
|
|
2069
2042
|
"data-testid": `module-card-${e.id}`,
|
|
2070
2043
|
children: [
|
|
2071
|
-
/* @__PURE__ */
|
|
2072
|
-
|
|
2073
|
-
/* @__PURE__ */
|
|
2074
|
-
/* @__PURE__ */ T
|
|
2044
|
+
/* @__PURE__ */ _(S, { alignItems: "start", gap: "mediumSmall", "data-testid": "module-header", children: [
|
|
2045
|
+
M !== null ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(di, { label: M, dimmed: f }) }) : null,
|
|
2046
|
+
/* @__PURE__ */ _(S.Item, { shouldGrow: !0, shouldShrink: !0, children: [
|
|
2047
|
+
/* @__PURE__ */ _(T, { as: "div", children: [
|
|
2075
2048
|
/* @__PURE__ */ i(
|
|
2076
|
-
|
|
2049
|
+
Nt,
|
|
2077
2050
|
{
|
|
2078
2051
|
level: a,
|
|
2079
2052
|
variant: "titleCardRegular",
|
|
2080
2053
|
color: f ? "secondary" : "primary",
|
|
2081
2054
|
"data-testid": "module-name",
|
|
2082
|
-
children: /* @__PURE__ */ i(
|
|
2055
|
+
children: /* @__PURE__ */ i(vn, { linesAllowed: Mi, children: e.name })
|
|
2083
2056
|
}
|
|
2084
2057
|
),
|
|
2085
|
-
e.published ? null : /* @__PURE__ */
|
|
2058
|
+
e.published ? null : /* @__PURE__ */ _(P, { size: "x-small", color: "secondary", children: [
|
|
2086
2059
|
" ",
|
|
2087
2060
|
u("moduleUnpublishedBadge")
|
|
2088
2061
|
] })
|
|
2089
2062
|
] }),
|
|
2090
|
-
/* @__PURE__ */ i(
|
|
2091
|
-
/* @__PURE__ */ i(
|
|
2063
|
+
/* @__PURE__ */ i(mi, { module: e, today: r }),
|
|
2064
|
+
/* @__PURE__ */ i(Si, { module: e, breakpoints: d })
|
|
2092
2065
|
] }),
|
|
2093
|
-
/* @__PURE__ */ i(
|
|
2094
|
-
(
|
|
2095
|
-
|
|
2066
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(S, { alignItems: "center", gap: "mediumSmall", children: [
|
|
2067
|
+
(h = e.progress) != null && h.status ? /* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
|
|
2068
|
+
Js,
|
|
2096
2069
|
{
|
|
2097
2070
|
status: e.progress.status,
|
|
2098
2071
|
missingCount: e.progress.missingCount,
|
|
2099
2072
|
incompleteCount: e.progress.incompleteCount
|
|
2100
2073
|
}
|
|
2101
2074
|
) }) : null,
|
|
2102
|
-
/* @__PURE__ */ i(
|
|
2103
|
-
|
|
2075
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(
|
|
2076
|
+
wn,
|
|
2104
2077
|
{
|
|
2105
2078
|
size: "medium",
|
|
2106
2079
|
withBorder: !0,
|
|
@@ -2110,13 +2083,13 @@ function Pi({
|
|
|
2110
2083
|
"aria-controls": It(e.id),
|
|
2111
2084
|
onClick: () => n(e.id),
|
|
2112
2085
|
"data-testid": `toggle-module-${e.id}`,
|
|
2113
|
-
children: t ? /* @__PURE__ */ i(
|
|
2086
|
+
children: t ? /* @__PURE__ */ i(Tn, {}) : /* @__PURE__ */ i(vt, {})
|
|
2114
2087
|
}
|
|
2115
2088
|
) })
|
|
2116
2089
|
] }) })
|
|
2117
2090
|
] }),
|
|
2118
2091
|
/* @__PURE__ */ i("div", { id: It(e.id), role: "group", "aria-label": e.name, hidden: !t, children: t ? /* @__PURE__ */ i(
|
|
2119
|
-
|
|
2092
|
+
yi,
|
|
2120
2093
|
{
|
|
2121
2094
|
module: e,
|
|
2122
2095
|
state: o,
|
|
@@ -2129,15 +2102,15 @@ function Pi({
|
|
|
2129
2102
|
}
|
|
2130
2103
|
);
|
|
2131
2104
|
}
|
|
2132
|
-
const
|
|
2133
|
-
function
|
|
2105
|
+
const Ti = Tt(_i);
|
|
2106
|
+
function Ei({
|
|
2134
2107
|
counts: e,
|
|
2135
2108
|
itemsMode: t,
|
|
2136
2109
|
loadedModules: n
|
|
2137
2110
|
}) {
|
|
2138
2111
|
const o = e.listModules + e.listModuleItems;
|
|
2139
2112
|
return /* @__PURE__ */ i(
|
|
2140
|
-
|
|
2113
|
+
T,
|
|
2141
2114
|
{
|
|
2142
2115
|
as: "div",
|
|
2143
2116
|
background: "secondary",
|
|
@@ -2146,25 +2119,25 @@ function wi({
|
|
|
2146
2119
|
padding: "x-small small",
|
|
2147
2120
|
margin: "0 0 small 0",
|
|
2148
2121
|
"data-testid": "dev-diagnostics",
|
|
2149
|
-
children: /* @__PURE__ */
|
|
2150
|
-
/* @__PURE__ */ i(
|
|
2151
|
-
/* @__PURE__ */ i(
|
|
2122
|
+
children: /* @__PURE__ */ _(S, { gap: "medium", wrap: "wrap", children: [
|
|
2123
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ i(P, { size: "x-small", weight: "bold", children: "Adapter requests" }) }),
|
|
2124
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "request-count-list-modules", children: [
|
|
2152
2125
|
"listModules: ",
|
|
2153
2126
|
e.listModules
|
|
2154
2127
|
] }) }),
|
|
2155
|
-
/* @__PURE__ */ i(
|
|
2128
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "request-count-list-module-items", children: [
|
|
2156
2129
|
"listModuleItems: ",
|
|
2157
2130
|
e.listModuleItems
|
|
2158
2131
|
] }) }),
|
|
2159
|
-
/* @__PURE__ */ i(
|
|
2132
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", weight: "bold", "data-testid": "request-count-total", children: [
|
|
2160
2133
|
"total: ",
|
|
2161
2134
|
o
|
|
2162
2135
|
] }) }),
|
|
2163
|
-
/* @__PURE__ */ i(
|
|
2136
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "resolved-items-mode", children: [
|
|
2164
2137
|
"itemsMode: ",
|
|
2165
2138
|
t ?? "probing…"
|
|
2166
2139
|
] }) }),
|
|
2167
|
-
/* @__PURE__ */ i(
|
|
2140
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(P, { size: "x-small", "data-testid": "modules-loaded-count", children: [
|
|
2168
2141
|
"modules loaded: ",
|
|
2169
2142
|
n
|
|
2170
2143
|
] }) })
|
|
@@ -2172,7 +2145,7 @@ function wi({
|
|
|
2172
2145
|
}
|
|
2173
2146
|
);
|
|
2174
2147
|
}
|
|
2175
|
-
function
|
|
2148
|
+
function Pi({
|
|
2176
2149
|
data: e,
|
|
2177
2150
|
courseName: t,
|
|
2178
2151
|
courseContext: n,
|
|
@@ -2181,111 +2154,111 @@ function Li({
|
|
|
2181
2154
|
showDiagnostics: s = r !== void 0,
|
|
2182
2155
|
navigation: l,
|
|
2183
2156
|
as: a = "div",
|
|
2184
|
-
headingLevel:
|
|
2185
|
-
breakpoints:
|
|
2157
|
+
headingLevel: m = "h2",
|
|
2158
|
+
breakpoints: d = {}
|
|
2186
2159
|
}) {
|
|
2187
|
-
const { miniTablet: u, tablet: p, desktop: f, desktopNavOpen:
|
|
2188
|
-
() => ({ miniTablet: u, tablet: p, desktop: f, desktopNavOpen:
|
|
2189
|
-
[u, p, f, g, h,
|
|
2160
|
+
const { miniTablet: u, tablet: p, desktop: f, desktopNavOpen: M, desktopOnly: g, mobileOnly: h, ICEDesktop: w } = d, E = R(
|
|
2161
|
+
() => ({ miniTablet: u, tablet: p, desktop: f, desktopNavOpen: M, desktopOnly: g, mobileOnly: h, ICEDesktop: w }),
|
|
2162
|
+
[u, p, f, M, g, h, w]
|
|
2190
2163
|
), {
|
|
2191
2164
|
modules: y,
|
|
2192
|
-
hasNextPage:
|
|
2193
|
-
fetchNextPage:
|
|
2194
|
-
isFetchingNextPage:
|
|
2165
|
+
hasNextPage: N,
|
|
2166
|
+
fetchNextPage: D,
|
|
2167
|
+
isFetchingNextPage: q,
|
|
2195
2168
|
isLoading: x,
|
|
2196
|
-
error:
|
|
2169
|
+
error: v,
|
|
2197
2170
|
itemsMode: z,
|
|
2198
2171
|
expandedModuleIds: G,
|
|
2199
2172
|
toggleModule: oe,
|
|
2200
|
-
expandModule:
|
|
2201
|
-
collapseModule:
|
|
2202
|
-
getItems:
|
|
2173
|
+
expandModule: be,
|
|
2174
|
+
collapseModule: Me,
|
|
2175
|
+
getItems: Ue,
|
|
2203
2176
|
filter: re,
|
|
2204
2177
|
setFilter: se,
|
|
2205
2178
|
filterEntry: Se,
|
|
2206
2179
|
filterPredicate: Q,
|
|
2207
2180
|
filterResultsArePartial: H
|
|
2208
|
-
} = e, { t: C, locale: $, timezone: V } = O(), F = t ?? C("pageTitle"), [K,
|
|
2209
|
-
|
|
2181
|
+
} = e, { t: C, locale: $, timezone: V } = O(), F = t ?? C("pageTitle"), [K, ye] = pe(""), ie = U(null), le = Be(), _e = Be(), Y = U(!1), [Te] = pe(() => /* @__PURE__ */ new Date()), I = o ?? Te;
|
|
2182
|
+
Le(() => {
|
|
2210
2183
|
var A;
|
|
2211
|
-
!Y.current ||
|
|
2212
|
-
}, [
|
|
2213
|
-
const
|
|
2184
|
+
!Y.current || q || (Y.current = !1, At(C("modulesLoadedAnnouncement", { count: y.length })), (A = ie.current) == null || A.focus());
|
|
2185
|
+
}, [q, y.length, C]);
|
|
2186
|
+
const b = R(
|
|
2214
2187
|
() => y.filter(
|
|
2215
|
-
(A) =>
|
|
2188
|
+
(A) => ys(A, K, $) && (Q === void 0 || Q(A, { today: I, timezone: V }))
|
|
2216
2189
|
),
|
|
2217
|
-
[y, K, Q,
|
|
2218
|
-
),
|
|
2219
|
-
for (const A of
|
|
2190
|
+
[y, K, Q, I, $, V]
|
|
2191
|
+
), L = () => {
|
|
2192
|
+
for (const A of b) be(A.id);
|
|
2220
2193
|
}, ae = () => {
|
|
2221
|
-
for (const A of G)
|
|
2222
|
-
}, B = K.trim() !== "" || Se !== void 0 && re !== J, ue =
|
|
2223
|
-
return /* @__PURE__ */ T
|
|
2224
|
-
n ? /* @__PURE__ */ T
|
|
2194
|
+
for (const A of G) Me(A);
|
|
2195
|
+
}, B = K.trim() !== "" || Se !== void 0 && re !== J, ue = b.length === 0 && !x && !v, j = ue && B;
|
|
2196
|
+
return /* @__PURE__ */ _(T, { as: a, display: "block", "data-testid": "modules-list", children: [
|
|
2197
|
+
n ? /* @__PURE__ */ _(T, { as: "div", children: [
|
|
2225
2198
|
/* @__PURE__ */ i(P, { size: "small", color: "brand", children: n }),
|
|
2226
|
-
/* @__PURE__ */
|
|
2199
|
+
/* @__PURE__ */ _(P, { size: "small", color: "secondary", children: [
|
|
2227
2200
|
" ",
|
|
2228
2201
|
"/",
|
|
2229
2202
|
" "
|
|
2230
2203
|
] }),
|
|
2231
2204
|
/* @__PURE__ */ i(P, { size: "small", color: "secondary", children: F })
|
|
2232
2205
|
] }) : null,
|
|
2233
|
-
/* @__PURE__ */ i(
|
|
2206
|
+
/* @__PURE__ */ i(Nt, { level: m, margin: "x-small 0 medium 0", children: F }),
|
|
2234
2207
|
r ? /* @__PURE__ */ i(
|
|
2235
|
-
|
|
2208
|
+
Ei,
|
|
2236
2209
|
{
|
|
2237
2210
|
counts: r,
|
|
2238
2211
|
itemsMode: z,
|
|
2239
2212
|
loadedModules: y.length
|
|
2240
2213
|
}
|
|
2241
2214
|
) : null,
|
|
2242
|
-
/* @__PURE__ */
|
|
2243
|
-
/* @__PURE__ */ i(
|
|
2244
|
-
|
|
2215
|
+
/* @__PURE__ */ _(S, { gap: "small", wrap: "wrap", alignItems: "end", children: [
|
|
2216
|
+
/* @__PURE__ */ i(S.Item, { size: "24rem", shouldShrink: !0, children: /* @__PURE__ */ i(
|
|
2217
|
+
Nn,
|
|
2245
2218
|
{
|
|
2246
2219
|
renderLabel: C("moduleSearchLabel"),
|
|
2247
2220
|
placeholder: C("searchPlaceholder"),
|
|
2248
2221
|
"aria-describedby": le,
|
|
2249
2222
|
value: K,
|
|
2250
|
-
onChange: (A,
|
|
2251
|
-
renderBeforeInput: /* @__PURE__ */ i(
|
|
2223
|
+
onChange: (A, Ee) => ye(Ee),
|
|
2224
|
+
renderBeforeInput: /* @__PURE__ */ i(En, { inline: !1 }),
|
|
2252
2225
|
"data-testid": "modules-search"
|
|
2253
2226
|
}
|
|
2254
2227
|
) }),
|
|
2255
|
-
/* @__PURE__ */ i(
|
|
2256
|
-
/* @__PURE__ */ i(
|
|
2257
|
-
|
|
2228
|
+
/* @__PURE__ */ i(S.Item, { shouldGrow: !0 }),
|
|
2229
|
+
/* @__PURE__ */ i(S.Item, { children: /* @__PURE__ */ _(
|
|
2230
|
+
ze,
|
|
2258
2231
|
{
|
|
2259
2232
|
placement: "bottom end",
|
|
2260
|
-
trigger: /* @__PURE__ */ i(
|
|
2233
|
+
trigger: /* @__PURE__ */ i(me, { renderIcon: /* @__PURE__ */ i(vt, {}), "data-testid": "expand-collapse-trigger", children: C("expandCollapseTrigger") }),
|
|
2261
2234
|
children: [
|
|
2262
|
-
/* @__PURE__ */ i(
|
|
2263
|
-
/* @__PURE__ */ i(
|
|
2235
|
+
/* @__PURE__ */ i(ze.Item, { onSelect: L, "data-testid": "expand-all", children: C("expandAll") }),
|
|
2236
|
+
/* @__PURE__ */ i(ze.Item, { onSelect: ae, "data-testid": "collapse-all", children: C("collapseAll") })
|
|
2264
2237
|
]
|
|
2265
2238
|
}
|
|
2266
2239
|
) })
|
|
2267
2240
|
] }),
|
|
2268
|
-
/* @__PURE__ */ i(
|
|
2241
|
+
/* @__PURE__ */ i(T, { as: "div", margin: "xx-small 0 0 0", children: /* @__PURE__ */ i(P, { size: "x-small", color: "secondary", id: le, children: C("searchScopeHint") }) }),
|
|
2269
2242
|
/* @__PURE__ */ i(
|
|
2270
|
-
|
|
2243
|
+
Ws,
|
|
2271
2244
|
{
|
|
2272
2245
|
value: re,
|
|
2273
2246
|
onChange: se,
|
|
2274
|
-
describedBy: H ?
|
|
2247
|
+
describedBy: H ? _e : void 0
|
|
2275
2248
|
}
|
|
2276
2249
|
),
|
|
2277
|
-
H ? /* @__PURE__ */ i(
|
|
2250
|
+
H ? /* @__PURE__ */ i(T, { as: "div", margin: "x-small 0 0 0", children: /* @__PURE__ */ i(
|
|
2278
2251
|
P,
|
|
2279
2252
|
{
|
|
2280
2253
|
size: "x-small",
|
|
2281
2254
|
color: "secondary",
|
|
2282
|
-
id:
|
|
2255
|
+
id: _e,
|
|
2283
2256
|
"data-testid": "filter-partial-hint",
|
|
2284
2257
|
children: C("filterScopeHint")
|
|
2285
2258
|
}
|
|
2286
2259
|
) }) : null,
|
|
2287
|
-
/* @__PURE__ */ T
|
|
2288
|
-
|
|
2260
|
+
/* @__PURE__ */ _(T, { as: "div", margin: "medium 0 0 0", children: [
|
|
2261
|
+
v ? /* @__PURE__ */ i(
|
|
2289
2262
|
Rt,
|
|
2290
2263
|
{
|
|
2291
2264
|
variant: "error",
|
|
@@ -2293,12 +2266,12 @@ function Li({
|
|
|
2293
2266
|
liveRegion: xt,
|
|
2294
2267
|
liveRegionPoliteness: "assertive",
|
|
2295
2268
|
"data-testid": "modules-error",
|
|
2296
|
-
children: C("modulesLoadErrorAlert", { message:
|
|
2269
|
+
children: C("modulesLoadErrorAlert", { message: v.message })
|
|
2297
2270
|
}
|
|
2298
2271
|
) : null,
|
|
2299
|
-
x ? /* @__PURE__ */ i(
|
|
2272
|
+
x ? /* @__PURE__ */ i(T, { as: "div", padding: "large", textAlign: "center", "data-testid": "modules-loading", children: /* @__PURE__ */ i(qt, { renderTitle: C("modulesLoadingSpinnerLabel") }) }) : null,
|
|
2300
2273
|
ue && !B ? /* @__PURE__ */ i(
|
|
2301
|
-
|
|
2274
|
+
T,
|
|
2302
2275
|
{
|
|
2303
2276
|
as: "div",
|
|
2304
2277
|
background: "secondary",
|
|
@@ -2309,8 +2282,8 @@ function Li({
|
|
|
2309
2282
|
children: /* @__PURE__ */ i(P, { color: "secondary", children: C("noModulesEmptyState") })
|
|
2310
2283
|
}
|
|
2311
2284
|
) : null,
|
|
2312
|
-
j ? /* @__PURE__ */
|
|
2313
|
-
|
|
2285
|
+
j ? /* @__PURE__ */ _(
|
|
2286
|
+
T,
|
|
2314
2287
|
{
|
|
2315
2288
|
as: "div",
|
|
2316
2289
|
background: "secondary",
|
|
@@ -2319,13 +2292,13 @@ function Li({
|
|
|
2319
2292
|
textAlign: "center",
|
|
2320
2293
|
"data-testid": "modules-filtered-empty",
|
|
2321
2294
|
children: [
|
|
2322
|
-
/* @__PURE__ */ i(
|
|
2295
|
+
/* @__PURE__ */ i(T, { as: "div", margin: "0 0 small 0", children: /* @__PURE__ */ i(P, { color: "secondary", children: y.length === 0 ? C("noFilterMatches") : C("filteredEmptyState", { count: y.length }) }) }),
|
|
2323
2296
|
/* @__PURE__ */ i(
|
|
2324
|
-
|
|
2297
|
+
me,
|
|
2325
2298
|
{
|
|
2326
2299
|
size: "small",
|
|
2327
2300
|
onClick: () => {
|
|
2328
|
-
se(J),
|
|
2301
|
+
se(J), ye(""), Y.current = !0;
|
|
2329
2302
|
},
|
|
2330
2303
|
children: C("clearFilters")
|
|
2331
2304
|
}
|
|
@@ -2333,33 +2306,33 @@ function Li({
|
|
|
2333
2306
|
]
|
|
2334
2307
|
}
|
|
2335
2308
|
) : null,
|
|
2336
|
-
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children:
|
|
2337
|
-
|
|
2309
|
+
/* @__PURE__ */ i("ul", { style: { listStyle: "none", margin: 0, padding: 0 }, "data-testid": "modules-stack", children: b.map((A) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
2310
|
+
Ti,
|
|
2338
2311
|
{
|
|
2339
2312
|
module: A,
|
|
2340
2313
|
expanded: G.includes(A.id),
|
|
2341
2314
|
onToggle: oe,
|
|
2342
|
-
itemsState:
|
|
2343
|
-
today:
|
|
2315
|
+
itemsState: Ue(A.id),
|
|
2316
|
+
today: I,
|
|
2344
2317
|
showDiagnostics: s,
|
|
2345
2318
|
navigation: l,
|
|
2346
|
-
headingLevel:
|
|
2347
|
-
breakpoints:
|
|
2319
|
+
headingLevel: m === "h1" ? "h2" : "h3",
|
|
2320
|
+
breakpoints: E
|
|
2348
2321
|
}
|
|
2349
2322
|
) }, A.id)) })
|
|
2350
2323
|
] }),
|
|
2351
|
-
|
|
2352
|
-
|
|
2324
|
+
N ? /* @__PURE__ */ i(T, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2325
|
+
me,
|
|
2353
2326
|
{
|
|
2354
2327
|
color: "primary",
|
|
2355
2328
|
onClick: () => {
|
|
2356
|
-
Y.current = !0,
|
|
2329
|
+
Y.current = !0, D();
|
|
2357
2330
|
},
|
|
2358
|
-
interaction:
|
|
2331
|
+
interaction: q ? "disabled" : "enabled",
|
|
2359
2332
|
"data-testid": "load-more-modules",
|
|
2360
|
-
children:
|
|
2333
|
+
children: q ? C("loadMoreModulesLoading") : C("loadMoreModules", { count: y.length })
|
|
2361
2334
|
}
|
|
2362
|
-
) }) : y.length > 0 ? /* @__PURE__ */ i(
|
|
2335
|
+
) }) : y.length > 0 ? /* @__PURE__ */ i(T, { as: "div", textAlign: "center", margin: "small 0 0 0", children: /* @__PURE__ */ i(
|
|
2363
2336
|
P,
|
|
2364
2337
|
{
|
|
2365
2338
|
size: "x-small",
|
|
@@ -2374,9 +2347,9 @@ function Li({
|
|
|
2374
2347
|
) }) : null
|
|
2375
2348
|
] });
|
|
2376
2349
|
}
|
|
2377
|
-
const
|
|
2378
|
-
|
|
2379
|
-
),
|
|
2350
|
+
const Rl = Rn(
|
|
2351
|
+
Pi
|
|
2352
|
+
), fe = [
|
|
2380
2353
|
"assignment",
|
|
2381
2354
|
"quiz",
|
|
2382
2355
|
"discussion",
|
|
@@ -2385,7 +2358,7 @@ const Nl = xn(
|
|
|
2385
2358
|
"external_url",
|
|
2386
2359
|
"external_tool",
|
|
2387
2360
|
"sub_header"
|
|
2388
|
-
],
|
|
2361
|
+
], Qe = [
|
|
2389
2362
|
"not_started",
|
|
2390
2363
|
"in_progress",
|
|
2391
2364
|
"complete",
|
|
@@ -2393,73 +2366,75 @@ const Nl = xn(
|
|
|
2393
2366
|
"incomplete",
|
|
2394
2367
|
"missing_and_incomplete",
|
|
2395
2368
|
"locked"
|
|
2396
|
-
],
|
|
2369
|
+
], pn = [
|
|
2397
2370
|
"must_view",
|
|
2398
2371
|
"must_submit",
|
|
2399
2372
|
"must_contribute",
|
|
2400
2373
|
"must_mark_done",
|
|
2401
2374
|
"min_score",
|
|
2402
2375
|
"min_percentage"
|
|
2403
|
-
],
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2376
|
+
], Ci = ["assignment", "quiz", "discussion"], wi = ["external_url", "external_tool"], vi = ["assignment", "quiz", "discussion"], Li = Date.UTC(2025, 0, 6), Ai = 864e5, ne = "1", fn = (e) => new Date(Li + e * Ai).toISOString(), Ne = [
|
|
2377
|
+
"min_score",
|
|
2378
|
+
"min_percentage"
|
|
2379
|
+
], xi = pn.filter(
|
|
2380
|
+
(e) => !Ne.includes(e)
|
|
2381
|
+
), Ri = [
|
|
2382
|
+
"in_progress",
|
|
2383
|
+
"incomplete",
|
|
2384
|
+
"missing_and_incomplete"
|
|
2385
|
+
], Ni = (e, t, n, o) => {
|
|
2386
|
+
const r = n ? pn : xi, s = n && o ? Ne[t % Ne.length] : r[Math.floor(t / 3) % r.length];
|
|
2387
|
+
return s === "min_score" ? { itemId: e, type: s, minScore: 10 } : s === "min_percentage" ? { itemId: e, type: s, minPercentage: 80 } : { itemId: e, type: s };
|
|
2388
|
+
}, qi = (e, t, n, o) => e === "sub_header" ? !1 : n && o || t % 3 === 0, et = (e) => Qe[(e - 1) % Qe.length], Di = (e, t) => !vi.includes(e) || e === "discussion" && Math.floor(t / fe.length) % 2 === 1 ? null : 5 + t % 4 * 5, ki = (e, t, n, o) => t ? e === "missing" ? n != null || o % 2 === 0 : e === "missing_and_incomplete" ? o % 2 === 1 : !1 : !1, Oi = (e, t, n, o) => {
|
|
2389
|
+
if (e === "locked") return "locked";
|
|
2390
|
+
if (ki(e, t, n, o)) return "missing";
|
|
2391
|
+
if (!n) return;
|
|
2392
|
+
const r = t && Ne.includes(n.type);
|
|
2408
2393
|
switch (e) {
|
|
2409
|
-
case "locked":
|
|
2410
|
-
return "locked";
|
|
2411
2394
|
case "not_started":
|
|
2395
|
+
case "missing":
|
|
2412
2396
|
return "not_started";
|
|
2413
2397
|
case "complete":
|
|
2414
|
-
return
|
|
2415
|
-
case "missing":
|
|
2416
|
-
return n ? t ? "missing" : "not_started" : t ? o % 2 === 0 ? "missing" : "graded" : "not_started";
|
|
2398
|
+
return "complete";
|
|
2417
2399
|
case "incomplete":
|
|
2418
|
-
return n ? t ? "graded" : r : t ? o % 2 === 0 ? "graded" : "submitted" : "not_started";
|
|
2419
2400
|
case "missing_and_incomplete":
|
|
2420
|
-
return
|
|
2401
|
+
return r && o % 2 === 0 ? "incomplete" : "complete";
|
|
2421
2402
|
case "in_progress":
|
|
2422
|
-
return
|
|
2403
|
+
return r ? o % 3 === 0 ? "complete" : o % 3 === 1 ? "in_progress" : "not_started" : o % 2 === 0 ? "complete" : "not_started";
|
|
2404
|
+
default:
|
|
2405
|
+
return e;
|
|
2423
2406
|
}
|
|
2424
|
-
}, Fi =
|
|
2425
|
-
"
|
|
2426
|
-
"graded",
|
|
2427
|
-
"excused",
|
|
2428
|
-
"complete"
|
|
2429
|
-
]), Ui = (e) => e.status !== void 0 && Fi.has(e.status), zi = (e) => {
|
|
2430
|
-
var t, n;
|
|
2431
|
-
return ((t = e.completionRequirement) == null ? void 0 : t.type) === "min_score" || ((n = e.completionRequirement) == null ? void 0 : n.type) === "min_percentage";
|
|
2432
|
-
}, $i = (e, t, n, o, r, s, l, a) => {
|
|
2433
|
-
const d = String(e), m = pe[o % pe.length], u = m === "sub_header", p = vi.includes(m) && (o % 4 === 0 || r === "missing");
|
|
2407
|
+
}, Fi = (e) => e.status === "complete", Ui = (e, t, n, o, r, s, l, a) => {
|
|
2408
|
+
const m = String(e), d = fe[o % fe.length], u = d === "sub_header", p = Ci.includes(d) && (o % 4 === 0 || r === "missing");
|
|
2434
2409
|
return {
|
|
2435
2410
|
id: n,
|
|
2436
|
-
moduleId:
|
|
2437
|
-
title: `${
|
|
2438
|
-
type:
|
|
2411
|
+
moduleId: m,
|
|
2412
|
+
title: `${d} ${t + 1}`,
|
|
2413
|
+
type: d,
|
|
2439
2414
|
position: t + 1,
|
|
2440
2415
|
indent: t % 5 === 4 ? 1 : 0,
|
|
2441
2416
|
published: a === "teacher" ? o % 7 !== 0 : !0,
|
|
2442
2417
|
url: u ? null : `/courses/${ne}/modules/items/${n}`,
|
|
2443
|
-
newTab:
|
|
2418
|
+
newTab: wi.includes(d) && o % 2 === 0,
|
|
2444
2419
|
completionRequirement: l,
|
|
2445
|
-
dueAt: p ?
|
|
2420
|
+
dueAt: p ? fn(o % 90) : null,
|
|
2446
2421
|
status: r,
|
|
2447
2422
|
pointsPossible: s,
|
|
2448
|
-
extensions:
|
|
2423
|
+
extensions: Ve(
|
|
2449
2424
|
void 0,
|
|
2450
2425
|
o % 37 === 0 ? 5 + o % 4 * 10 : null
|
|
2451
2426
|
)
|
|
2452
2427
|
};
|
|
2453
|
-
},
|
|
2454
|
-
const r =
|
|
2455
|
-
let
|
|
2456
|
-
for (let
|
|
2457
|
-
const d = n +
|
|
2458
|
-
|
|
2428
|
+
}, zi = (e, t, n, o) => {
|
|
2429
|
+
const r = et(e), s = Ri.includes(r), l = [];
|
|
2430
|
+
let a = 0;
|
|
2431
|
+
for (let m = 0; m < t; m += 1) {
|
|
2432
|
+
const d = n + m, u = fe[d % fe.length], p = Di(u, d), f = p !== null, M = f ? a++ : m, g = String(e * 1e3 + m + 1), h = qi(u, d, f, s) ? Ni(g, d, f, s) : null, w = Oi(r, f, h, M);
|
|
2433
|
+
l.push(Ui(e, m, g, d, w, p, h, o));
|
|
2459
2434
|
}
|
|
2460
|
-
return
|
|
2461
|
-
},
|
|
2462
|
-
const r =
|
|
2435
|
+
return l;
|
|
2436
|
+
}, $i = (e, t, n, o) => {
|
|
2437
|
+
const r = et(e);
|
|
2463
2438
|
if (r === "locked" || r === "not_started") return r;
|
|
2464
2439
|
if (t.length === 0) return "not_started";
|
|
2465
2440
|
if (!t.some((s) => s.pointsPossible != null) || r === "missing" && n === 0 || r === "incomplete" && o === 0) return "in_progress";
|
|
@@ -2469,39 +2444,39 @@ const Nl = xn(
|
|
|
2469
2444
|
if (o === 0) return "missing";
|
|
2470
2445
|
}
|
|
2471
2446
|
return r;
|
|
2472
|
-
},
|
|
2447
|
+
}, Bi = (e) => {
|
|
2473
2448
|
const t = e.map((n) => n.dueAt).filter((n) => typeof n == "string").sort();
|
|
2474
2449
|
return t.length > 0 ? t[t.length - 1] : null;
|
|
2475
|
-
},
|
|
2476
|
-
const o =
|
|
2450
|
+
}, ji = (e, t, n) => {
|
|
2451
|
+
const o = t.filter((d) => d.completionRequirement), r = n ?? o.length, s = Math.min(o.filter(Fi).length, r), l = t.filter((d) => d.status === "missing").length, a = t.filter((d) => d.status === "incomplete").length;
|
|
2477
2452
|
return {
|
|
2478
|
-
status:
|
|
2479
|
-
requirementsMet:
|
|
2480
|
-
requirementCount:
|
|
2481
|
-
percentComplete:
|
|
2482
|
-
latestDueAt:
|
|
2483
|
-
missingCount:
|
|
2484
|
-
incompleteCount:
|
|
2453
|
+
status: $i(e, t, l, a),
|
|
2454
|
+
requirementsMet: s,
|
|
2455
|
+
requirementCount: r,
|
|
2456
|
+
percentComplete: r > 0 ? Math.round(s / r * 100) : 0,
|
|
2457
|
+
latestDueAt: Bi(t),
|
|
2458
|
+
missingCount: l,
|
|
2459
|
+
incompleteCount: a
|
|
2485
2460
|
};
|
|
2486
|
-
},
|
|
2487
|
-
const o =
|
|
2461
|
+
}, Gi = (e, t, n) => {
|
|
2462
|
+
const o = et(e), r = e % 2 !== 0 && o !== "incomplete" && o !== "missing_and_incomplete" ? 1 : null;
|
|
2488
2463
|
return {
|
|
2489
2464
|
id: String(e),
|
|
2490
2465
|
name: `Module ${e}`,
|
|
2491
2466
|
position: e,
|
|
2492
2467
|
published: n === "teacher" ? e % 4 !== 0 : !0,
|
|
2493
2468
|
itemCount: t.length,
|
|
2494
|
-
unlockAt: e % 5 === 0 ?
|
|
2469
|
+
unlockAt: e % 5 === 0 ? fn(e) : null,
|
|
2495
2470
|
prerequisiteModules: e > 1 && e % 3 === 0 ? [{ id: String(e - 1), name: `Module ${e - 1}` }] : [],
|
|
2496
2471
|
requirementCount: r,
|
|
2497
2472
|
requireSequentialProgress: e % 6 === 0,
|
|
2498
2473
|
completionRequirements: t.flatMap(
|
|
2499
2474
|
(s) => s.completionRequirement ? [s.completionRequirement] : []
|
|
2500
2475
|
),
|
|
2501
|
-
progress:
|
|
2476
|
+
progress: ji(e, t, r)
|
|
2502
2477
|
};
|
|
2503
2478
|
};
|
|
2504
|
-
function
|
|
2479
|
+
function Yi(e) {
|
|
2505
2480
|
return {
|
|
2506
2481
|
courseId: e.courseId,
|
|
2507
2482
|
modules: e.modules.map(({ progress: t, ...n }) => n),
|
|
@@ -2513,31 +2488,31 @@ function Qi(e) {
|
|
|
2513
2488
|
)
|
|
2514
2489
|
};
|
|
2515
2490
|
}
|
|
2516
|
-
function
|
|
2491
|
+
function Fe(e, t = {}) {
|
|
2517
2492
|
const n = t.view ?? "student", o = t.courseId ?? ne, r = [], s = {};
|
|
2518
2493
|
let l = 0;
|
|
2519
|
-
e.forEach((
|
|
2520
|
-
const u =
|
|
2521
|
-
l +=
|
|
2494
|
+
e.forEach((m, d) => {
|
|
2495
|
+
const u = d + 1, p = zi(u, m, l, n);
|
|
2496
|
+
l += m, r.push(Gi(u, p, n)), s[String(u)] = p;
|
|
2522
2497
|
});
|
|
2523
2498
|
const a = { courseId: o, modules: r, itemsByModuleId: s };
|
|
2524
|
-
return n === "teacher" ?
|
|
2499
|
+
return n === "teacher" ? Yi(a) : a;
|
|
2525
2500
|
}
|
|
2526
|
-
const ce = (e) => `/courses/${ne}/modules/items/${e}`,
|
|
2527
|
-
function
|
|
2528
|
-
return
|
|
2501
|
+
const ce = (e) => `/courses/${ne}/modules/items/${e}`, bt = "2099-08-31T06:59:00Z", Wi = "2020-01-06T07:00:00Z", Qi = Qe.length, Hi = 8, Vi = 120, Ki = 25, Zi = 250, Mt = 8;
|
|
2502
|
+
function Nl() {
|
|
2503
|
+
return Fe(Array.from({ length: Qi }, () => Hi));
|
|
2529
2504
|
}
|
|
2530
|
-
function
|
|
2531
|
-
return
|
|
2505
|
+
function ql() {
|
|
2506
|
+
return Fe(Array.from({ length: Vi }, () => Ki));
|
|
2532
2507
|
}
|
|
2533
|
-
function
|
|
2534
|
-
return
|
|
2508
|
+
function Dl() {
|
|
2509
|
+
return Fe([
|
|
2535
2510
|
Mt,
|
|
2536
|
-
|
|
2511
|
+
Zi,
|
|
2537
2512
|
Mt
|
|
2538
2513
|
]);
|
|
2539
2514
|
}
|
|
2540
|
-
function
|
|
2515
|
+
function kl() {
|
|
2541
2516
|
const e = (r, s, l) => ({
|
|
2542
2517
|
id: String(r),
|
|
2543
2518
|
name: s,
|
|
@@ -2556,16 +2531,16 @@ function Fl() {
|
|
|
2556
2531
|
},
|
|
2557
2532
|
...l
|
|
2558
2533
|
}), t = { id: "101", name: "Week 1: Foundations" }, n = { id: "102", name: "Week 2: Derivatives" }, o = [
|
|
2559
|
-
e(1, "Locked by a future date", { unlockAt:
|
|
2534
|
+
e(1, "Locked by a future date", { unlockAt: bt }),
|
|
2560
2535
|
e(2, "Locked by one prerequisite", { prerequisiteModules: [t] }),
|
|
2561
2536
|
e(3, "Locked by several prerequisites", {
|
|
2562
2537
|
prerequisiteModules: [t, n]
|
|
2563
2538
|
}),
|
|
2564
2539
|
e(4, "Locked by a date and a prerequisite", {
|
|
2565
|
-
unlockAt:
|
|
2540
|
+
unlockAt: bt,
|
|
2566
2541
|
prerequisiteModules: [t]
|
|
2567
2542
|
}),
|
|
2568
|
-
e(5, "Locked, and the unlock date has passed", { unlockAt:
|
|
2543
|
+
e(5, "Locked, and the unlock date has passed", { unlockAt: Wi })
|
|
2569
2544
|
];
|
|
2570
2545
|
return {
|
|
2571
2546
|
courseId: ne,
|
|
@@ -2573,10 +2548,10 @@ function Fl() {
|
|
|
2573
2548
|
itemsByModuleId: Object.fromEntries(o.map((r) => [r.id, []]))
|
|
2574
2549
|
};
|
|
2575
2550
|
}
|
|
2576
|
-
function
|
|
2577
|
-
return
|
|
2551
|
+
function Ol() {
|
|
2552
|
+
return Fe([]);
|
|
2578
2553
|
}
|
|
2579
|
-
function
|
|
2554
|
+
function Fl() {
|
|
2580
2555
|
const t = [
|
|
2581
2556
|
{
|
|
2582
2557
|
title: "Every fact: type, due date, points, requirement",
|
|
@@ -2605,7 +2580,7 @@ function zl() {
|
|
|
2605
2580
|
title: "Career item carrying an estimated duration",
|
|
2606
2581
|
type: "external_tool",
|
|
2607
2582
|
completionRequirement: { itemId: "5", type: "must_view" },
|
|
2608
|
-
extensions:
|
|
2583
|
+
extensions: Ve(void 0, 45)
|
|
2609
2584
|
},
|
|
2610
2585
|
{ title: "A file, ungradeable, so no points at all", type: "file" },
|
|
2611
2586
|
{ title: "External link, opens in a new tab", type: "external_url", newTab: !0 },
|
|
@@ -2641,7 +2616,7 @@ function zl() {
|
|
|
2641
2616
|
itemsByModuleId: { 1: t }
|
|
2642
2617
|
};
|
|
2643
2618
|
}
|
|
2644
|
-
function
|
|
2619
|
+
function Ul() {
|
|
2645
2620
|
const t = [
|
|
2646
2621
|
{ title: "Reading: limits from the left and the right", type: "page", url: ce(1) },
|
|
2647
2622
|
{
|
|
@@ -2687,90 +2662,90 @@ function $l() {
|
|
|
2687
2662
|
export {
|
|
2688
2663
|
J as ALL_FILTER,
|
|
2689
2664
|
kt as CompletionRequirementSchema,
|
|
2690
|
-
|
|
2665
|
+
Un as CompletionRequirementTypeSchema,
|
|
2691
2666
|
rn as DEFAULT_INLINE_THRESHOLD,
|
|
2692
|
-
|
|
2667
|
+
ks as DEFAULT_ITEM_CONCURRENCY,
|
|
2693
2668
|
on as DEFAULT_ITEM_PAGE_SIZE,
|
|
2694
2669
|
te as DEFAULT_LOCALE,
|
|
2695
|
-
|
|
2670
|
+
Je as DEFAULT_PAGE_SIZE,
|
|
2696
2671
|
sn as DEFAULT_RETAIN_COLLAPSED_LIMIT,
|
|
2697
2672
|
Oe as DEFAULT_STALE_TIME_MS,
|
|
2698
|
-
|
|
2673
|
+
_s as DUE_THIS_WEEK_DAYS,
|
|
2699
2674
|
Ut as EXT_CAREER_ESTIMATED_DURATION_MINUTES,
|
|
2700
2675
|
ne as FIXTURE_COURSE_ID,
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2676
|
+
Ws as FilterChips,
|
|
2677
|
+
qn as FilterClauseSchema,
|
|
2678
|
+
Ns as FilterEntrySchema,
|
|
2679
|
+
Io as GET_MODULES,
|
|
2680
|
+
bo as GET_MODULE_ITEMS,
|
|
2681
|
+
je as INLINE_ITEM_LIMIT,
|
|
2682
|
+
Ke as INLINE_QUERY_NODE_BUDGET,
|
|
2683
|
+
Wn as InMemoryCourseMismatchError,
|
|
2684
|
+
xs as ItemTypeEntrySchema,
|
|
2685
|
+
Rs as MetaFieldEntrySchema,
|
|
2686
|
+
Ti as ModuleCard,
|
|
2687
|
+
ci as ModuleItemRow,
|
|
2713
2688
|
Ot as ModuleItemSchema,
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2689
|
+
ei as ModuleItemStatusPill,
|
|
2690
|
+
On as ModuleItemStatusSchema,
|
|
2691
|
+
kn as ModuleItemTypeSchema,
|
|
2692
|
+
Gn as ModuleItemsPageSchema,
|
|
2693
|
+
di as ModuleNumberBadge,
|
|
2694
|
+
zn as ModuleProgressSchema,
|
|
2695
|
+
Bn as ModuleSchema,
|
|
2696
|
+
Js as ModuleStatusPill,
|
|
2697
|
+
Fn as ModuleStatusSchema,
|
|
2698
|
+
El as ModulesConfigProvider,
|
|
2699
|
+
qs as ModulesConfigSchema,
|
|
2700
|
+
Tl as ModulesI18nProvider,
|
|
2701
|
+
Rl as ModulesList,
|
|
2702
|
+
jn as ModulesPageSchema,
|
|
2728
2703
|
Ft as PageInfoSchema,
|
|
2729
2704
|
zt as PartialCanvasResponseError,
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2705
|
+
$n as PrerequisiteModuleSchema,
|
|
2706
|
+
De as RegistryEntrySchema,
|
|
2707
|
+
Ps as TYPE_FIELD,
|
|
2708
|
+
Ts as baseFilters,
|
|
2709
|
+
qe as baseModulesConfig,
|
|
2710
|
+
Fe as buildFixture,
|
|
2711
|
+
Ol as courseEmpty,
|
|
2712
|
+
Dl as courseFatModule,
|
|
2713
|
+
Ul as courseItemLinks,
|
|
2714
|
+
Fl as courseItemRowVariants,
|
|
2715
|
+
ql as courseLarge,
|
|
2716
|
+
kl as courseLockReasons,
|
|
2717
|
+
Nl as courseSmall,
|
|
2718
|
+
_l as createCanvasGraphqlAdapter,
|
|
2719
|
+
yl as createInMemoryAdapter,
|
|
2745
2720
|
Zt as createTranslate,
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2721
|
+
Es as defaultFormatters,
|
|
2722
|
+
as as defaultTranslate,
|
|
2723
|
+
Ze as filterClauseOf,
|
|
2724
|
+
Yn as getEstimatedDurationMinutes,
|
|
2725
|
+
Ls as hideUnservableFilters,
|
|
2726
|
+
xl as invalidateCourse,
|
|
2727
|
+
Ll as invalidateModuleItems,
|
|
2728
|
+
Al as invalidateModuleList,
|
|
2729
|
+
Ye as isPredicateServed,
|
|
2755
2730
|
Z as mergeRegistry,
|
|
2756
|
-
|
|
2731
|
+
Xs as moduleItemStatusLabel,
|
|
2757
2732
|
ln as moduleItemsPrefix,
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2733
|
+
Zs as moduleStatusLabel,
|
|
2734
|
+
Ie as modulesKeys,
|
|
2735
|
+
Os as modulesListPrefix,
|
|
2736
|
+
Cl as partialModulesConfig,
|
|
2762
2737
|
ve as registrySchema,
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2738
|
+
Ds as resolveModulesConfig,
|
|
2739
|
+
Dn as servesClause,
|
|
2740
|
+
vs as unservableFilters,
|
|
2741
|
+
Pl as useFieldVisible,
|
|
2767
2742
|
ke as useFormatters,
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2743
|
+
wl as useModuleItems,
|
|
2744
|
+
Fs as useModules,
|
|
2745
|
+
he as useModulesConfig,
|
|
2771
2746
|
O as useModulesI18n,
|
|
2772
|
-
|
|
2773
|
-
|
|
2747
|
+
vl as useModulesPageData,
|
|
2748
|
+
Xe as visibleEntries,
|
|
2774
2749
|
ee as visibleEntry,
|
|
2775
|
-
|
|
2750
|
+
Ve as withEstimatedDurationMinutes
|
|
2776
2751
|
};
|