@instructure/platform-modules 0.4.0 → 1.0.0

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