@instructure/platform-assignment-review 0.0.1 → 0.1.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 (30) hide show
  1. package/dist/components/AttemptCard.d.ts +10 -0
  2. package/dist/components/AttemptCard.d.ts.map +1 -0
  3. package/dist/components/AttemptView.d.ts +10 -0
  4. package/dist/components/AttemptView.d.ts.map +1 -0
  5. package/dist/components/AttemptsHistory.d.ts +10 -0
  6. package/dist/components/AttemptsHistory.d.ts.map +1 -0
  7. package/dist/components/CommentCard.d.ts +9 -0
  8. package/dist/components/CommentCard.d.ts.map +1 -0
  9. package/dist/components/DownloadButtons.d.ts +7 -0
  10. package/dist/components/DownloadButtons.d.ts.map +1 -0
  11. package/dist/components/FileUploadSubmissionForm.d.ts +14 -0
  12. package/dist/components/FileUploadSubmissionForm.d.ts.map +1 -0
  13. package/dist/components/LearningContentHeader.d.ts +20 -0
  14. package/dist/components/LearningContentHeader.d.ts.map +1 -0
  15. package/dist/components/ModuleNavigation.d.ts +17 -0
  16. package/dist/components/ModuleNavigation.d.ts.map +1 -0
  17. package/dist/components/MyProgressPanel.d.ts +14 -0
  18. package/dist/components/MyProgressPanel.d.ts.map +1 -0
  19. package/dist/components/SubmissionComments.d.ts +13 -0
  20. package/dist/components/SubmissionComments.d.ts.map +1 -0
  21. package/dist/components/TextEntrySubmissionForm.d.ts +9 -0
  22. package/dist/components/TextEntrySubmissionForm.d.ts.map +1 -0
  23. package/dist/components/UnreadCommentsBadge.d.ts +5 -0
  24. package/dist/components/UnreadCommentsBadge.d.ts.map +1 -0
  25. package/dist/hooks/useModuleItemSequence.d.ts +16 -0
  26. package/dist/hooks/useModuleItemSequence.d.ts.map +1 -0
  27. package/dist/index.d.ts +27 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +1604 -428
  30. package/package.json +16 -1
package/dist/index.js CHANGED
@@ -1,178 +1,66 @@
1
- import m from "graphql-tag";
2
- import { z as e } from "zod";
3
- import { useQueryClient as c, useMutation as g, useQuery as l } from "@tanstack/react-query";
4
- const I = m`
5
- mutation CreateSubmissionComment(
6
- $id: ID!
7
- $submissionAttempt: Int!
8
- $comment: String!
9
- $fileIds: [ID!]
10
- $mediaObjectId: ID
11
- $mediaObjectType: String
12
- $reviewerSubmissionId: ID
13
- ) {
14
- createSubmissionComment(
15
- input: {
16
- submissionId: $id
17
- attempt: $submissionAttempt
18
- comment: $comment
19
- fileIds: $fileIds
20
- mediaObjectId: $mediaObjectId
21
- mediaObjectType: $mediaObjectType
22
- reviewerSubmissionId: $reviewerSubmissionId
23
- }
24
- ) {
25
- submissionComment {
26
- ...SubmissionHtmlComment
27
- }
28
- errors {
29
- ...Error
30
- }
31
- }
32
- }
33
-
34
- fragment Error on ValidationError {
35
- attribute
36
- message
37
- }
38
-
39
- fragment SubmissionHtmlComment on SubmissionComment {
40
- _id
41
- attachments {
42
- ...SubmissionCommentFile
43
- }
44
- author {
45
- ...SubmissionCommentAuthor
46
- }
47
- htmlComment
48
- mediaObject {
49
- ...MediaObject
50
- }
51
- read
52
- updatedAt
53
- }
54
-
55
- fragment MediaObject on MediaObject {
56
- id
57
- _id
58
- mediaSources {
59
- ...MediaSource
60
- }
61
- mediaTracks {
62
- ...MediaTrack
63
- }
64
- mediaType
65
- title
66
- }
67
-
68
- fragment MediaSource on MediaSource {
69
- height
70
- src: url
71
- type: contentType
72
- width
73
- }
74
-
75
- fragment MediaTrack on MediaTrack {
76
- _id
77
- locale
78
- content
79
- kind
80
- }
81
-
82
- fragment SubmissionCommentAuthor on User {
83
- avatarUrl
84
- shortName
85
- }
86
-
87
- fragment SubmissionCommentFile on File {
88
- _id
89
- displayName
90
- id
91
- mimeClass
92
- url
93
- }
94
- `, f = m`
95
- mutation MarkSubmissionCommentsRead(
96
- $submissionId: ID!
97
- $submissionCommentIds: [ID!]!
98
- ) {
99
- markSubmissionCommentsRead(
100
- input: {
101
- submissionCommentIds: $submissionCommentIds
102
- submissionId: $submissionId
103
- }
104
- ) {
105
- errors {
106
- attribute
107
- message
108
- }
109
- }
110
- }
111
- `, q = m`
112
- mutation CreateSubmission(
113
- $assignmentLid: ID!
114
- $submissionType: OnlineSubmissionType!
115
- $body: String
116
- $fileIds: [ID!]
117
- ) {
118
- createSubmission(
119
- input: {
120
- assignmentLid: $assignmentLid
121
- submissionType: $submissionType
122
- body: $body
123
- fileIds: $fileIds
124
- }
125
- ) {
126
- submission {
127
- _id
128
- createdAt
129
- attempt
130
- submittedAt
131
- score
132
- }
133
- errors {
134
- attribute
135
- message
136
- }
137
- }
138
- }
139
- `, k = m`
140
- mutation CreateSubmissionDraft(
141
- $submissionId: ID!
142
- $submissionType: DraftableSubmissionType!
143
- $attempt: Int!
144
- $body: String
145
- $fileIds: [ID!]
146
- ) {
147
- createSubmissionDraft(
148
- input: {
149
- submissionId: $submissionId
150
- activeSubmissionType: $submissionType
151
- attempt: $attempt
152
- body: $body
153
- fileIds: $fileIds
154
- }
155
- ) {
156
- submissionDraft {
157
- _id
158
- }
159
- errors {
160
- attribute
161
- message
162
- }
163
- }
164
- }
165
- `, G = m`
166
- mutation DeleteSubmissionDraft($submissionId: ID!) {
167
- deleteSubmissionDraft(input: { submissionId: $submissionId }) {
168
- submissionDraftIds
169
- errors {
170
- attribute
171
- message
172
- }
1
+ import { jsx as r, jsxs as S } from "react/jsx-runtime";
2
+ import { Flex as g } from "@instructure/ui-flex";
3
+ import { Pill as lt } from "@instructure/ui-pill";
4
+ import { Text as y } from "@instructure/ui-text";
5
+ import { View as Z } from "@instructure/ui-view";
6
+ import { useTranslation as B } from "react-i18next";
7
+ import { Spinner as ct } from "@instructure/ui-spinner";
8
+ import { useQuery as Ue, useQueryClient as Bt, useMutation as Wt } from "@tanstack/react-query";
9
+ import J from "graphql-tag";
10
+ import { z as n } from "zod";
11
+ import { Heading as qt } from "@instructure/ui-heading";
12
+ import { IconDownloadLine as An, IconCheckMarkSolid as En, IconTrashLine as In, IconArrowOpenStartLine as Yt, IconArrowOpenEndLine as Xt, IconXLine as Cn, IconLockLine as Kt, IconDocumentLine as kt, IconLinkLine as Dn, IconDiscussionLine as Rn, IconQuizLine as wn, IconAssignmentLine as vn, IconArrowStartLine as Ln, IconArrowEndLine as Nn } from "@instructure/ui-icons";
13
+ import { useMemo as ot, useState as Fe, useRef as On, useEffect as Mn } from "react";
14
+ import { ScreenReaderContent as mt } from "@instructure/ui-a11y-content";
15
+ import { Link as xn } from "@instructure/ui-link";
16
+ import { TruncateText as Vt } from "@instructure/ui-truncate-text";
17
+ import { Badge as Zt } from "@instructure/ui-badge";
18
+ import { Button as P, IconButton as kn } from "@instructure/ui-buttons";
19
+ import { Tooltip as Pn } from "@instructure/ui-tooltip";
20
+ import { TextArea as Qt } from "@instructure/ui-text-area";
21
+ function Fn(t) {
22
+ if (!t) return "";
23
+ const i = new Date(t);
24
+ return Number.isNaN(i.getTime()) ? "" : i.toLocaleDateString();
25
+ }
26
+ function Un({
27
+ submission: t,
28
+ isSelected: i,
29
+ isDraft: o = !1,
30
+ pointsPossible: a,
31
+ onClick: l
32
+ }) {
33
+ const { t: c } = B("assignment-review"), f = o ? c("submission.currentAttempt", "Current attempt") : `${c("comments.attempt", { number: t.attempt })}`, b = t.score != null && a != null ? `${t.score}/${a}` : null;
34
+ return /* @__PURE__ */ r(
35
+ Z,
36
+ {
37
+ as: "div",
38
+ padding: "small medium",
39
+ borderWidth: "small",
40
+ borderColor: i ? "brand" : "primary",
41
+ borderRadius: "medium",
42
+ background: i ? "secondary" : "primary",
43
+ cursor: "pointer",
44
+ onClick: l,
45
+ role: "button",
46
+ tabIndex: 0,
47
+ onKeyDown: (u) => {
48
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), l());
49
+ },
50
+ children: /* @__PURE__ */ S(g, { justifyItems: "space-between", alignItems: "center", children: [
51
+ /* @__PURE__ */ S(g, { direction: "column", gap: "xx-small", children: [
52
+ /* @__PURE__ */ S(g, { gap: "small", alignItems: "center", children: [
53
+ /* @__PURE__ */ r(y, { weight: "bold", children: f }),
54
+ o && /* @__PURE__ */ r(lt, { color: "info", children: c("submission.draft", "Draft") })
55
+ ] }),
56
+ !o && t.submittedAt && /* @__PURE__ */ r(y, { size: "small", color: "secondary", children: Fn(t.submittedAt) })
57
+ ] }),
58
+ b && /* @__PURE__ */ r(y, { weight: "bold", children: b })
59
+ ] })
173
60
  }
174
- }
175
- `, $ = m`
61
+ );
62
+ }
63
+ const zn = J`
176
64
  query GetAssignment($courseId: ID!, $assignmentId: ID!, $userId: ID!) {
177
65
  legacyNode(_id: $assignmentId, type: Assignment) {
178
66
  ... on Assignment {
@@ -231,7 +119,7 @@ const I = m`
231
119
  contentType
232
120
  submissionPreviewUrl
233
121
  }
234
- `, T = m`
122
+ `, jn = J`
235
123
  query GetSubmissionComments(
236
124
  $submissionId: ID!
237
125
  $courseId: String
@@ -280,7 +168,7 @@ const I = m`
280
168
  }
281
169
  }
282
170
  }
283
- `, h = m`
171
+ `, $n = J`
284
172
  query getSubmissions($submissionId: ID!) {
285
173
  node(id: $submissionId) {
286
174
  ... on Submission {
@@ -314,320 +202,1608 @@ const I = m`
314
202
  contentType
315
203
  submissionPreviewUrl
316
204
  }
317
- `, u = e.object({
318
- _id: e.string(),
319
- displayName: e.string(),
320
- id: e.string(),
321
- mimeClass: e.string(),
322
- url: e.string(),
323
- contentType: e.string(),
324
- submissionPreviewUrl: e.string().nullable()
325
- }), j = e.object({
326
- _id: e.string(),
327
- activeSubmissionType: e.string(),
328
- body: e.string().nullable(),
329
- attachments: e.array(u).nullable()
330
- }), D = e.object({
331
- id: e.string(),
332
- submittedAt: e.string(),
333
- body: e.string().nullable(),
334
- grade: e.string().nullable(),
335
- score: e.number().nullable(),
336
- submissionType: e.string(),
337
- attempt: e.number(),
338
- unreadCommentCount: e.number(),
339
- attachment: u.nullable(),
340
- attachments: e.array(u).nullable(),
341
- submissionDraft: j.nullable()
342
- }), A = e.object({
343
- _id: e.string(),
344
- name: e.string(),
345
- description: e.string().nullable(),
346
- allowedExtensions: e.array(e.string()).nullable(),
347
- allowedAttempts: e.number().nullable(),
348
- dueAt: e.string().nullable(),
349
- pointsPossible: e.number().nullable(),
350
- submissionTypes: e.array(e.string()),
351
- gradingType: e.string(),
352
- published: e.boolean().nullable().optional(),
353
- submissionsConnection: e.object({
354
- nodes: e.array(D)
205
+ `, _e = n.object({
206
+ _id: n.string(),
207
+ displayName: n.string(),
208
+ id: n.string(),
209
+ mimeClass: n.string(),
210
+ url: n.string(),
211
+ contentType: n.string(),
212
+ submissionPreviewUrl: n.string().nullable()
213
+ }), Hn = n.object({
214
+ _id: n.string(),
215
+ activeSubmissionType: n.string(),
216
+ body: n.string().nullable(),
217
+ attachments: n.array(_e).nullable()
218
+ }), Gn = n.object({
219
+ id: n.string(),
220
+ submittedAt: n.string(),
221
+ body: n.string().nullable(),
222
+ grade: n.string().nullable(),
223
+ score: n.number().nullable(),
224
+ submissionType: n.string(),
225
+ attempt: n.number(),
226
+ unreadCommentCount: n.number(),
227
+ attachment: _e.nullable(),
228
+ attachments: n.array(_e).nullable(),
229
+ submissionDraft: Hn.nullable()
230
+ }), Bn = n.object({
231
+ _id: n.string(),
232
+ name: n.string(),
233
+ description: n.string().nullable(),
234
+ allowedExtensions: n.array(n.string()).nullable(),
235
+ allowedAttempts: n.number().nullable(),
236
+ dueAt: n.string().nullable(),
237
+ pointsPossible: n.number().nullable(),
238
+ submissionTypes: n.array(n.string()),
239
+ gradingType: n.string(),
240
+ published: n.boolean().nullable().optional(),
241
+ submissionsConnection: n.object({
242
+ nodes: n.array(Gn)
355
243
  })
356
- }), _ = e.object({
357
- legacyNode: A,
358
- course: e.object({
359
- name: e.string()
244
+ }), Wn = n.object({
245
+ legacyNode: Bn,
246
+ course: n.object({
247
+ name: n.string()
360
248
  })
361
- }), S = e.object({
362
- startCursor: e.string(),
363
- endCursor: e.string(),
364
- hasPreviousPage: e.boolean(),
365
- hasNextPage: e.boolean()
366
- }), y = e.object({
367
- _id: e.string(),
368
- attempt: e.number(),
369
- author: e.object({
370
- avatarUrl: e.string().nullable(),
371
- shortName: e.string(),
372
- courseRoles: e.string().nullable()
249
+ }), Jt = n.object({
250
+ startCursor: n.string(),
251
+ endCursor: n.string(),
252
+ hasPreviousPage: n.boolean(),
253
+ hasNextPage: n.boolean()
254
+ }), en = n.object({
255
+ _id: n.string(),
256
+ attempt: n.number(),
257
+ author: n.object({
258
+ avatarUrl: n.string().nullable(),
259
+ shortName: n.string(),
260
+ courseRoles: n.string().nullable()
373
261
  }),
374
- htmlComment: e.string(),
375
- read: e.boolean(),
376
- updatedAt: e.string(),
377
- createdAt: e.string(),
378
- attachments: e.array(
379
- e.object({
380
- url: e.string(),
381
- mimeClass: e.string(),
382
- displayName: e.string(),
383
- contentType: e.string(),
384
- id: e.string()
262
+ htmlComment: n.string(),
263
+ read: n.boolean(),
264
+ updatedAt: n.string(),
265
+ createdAt: n.string(),
266
+ attachments: n.array(
267
+ n.object({
268
+ url: n.string(),
269
+ mimeClass: n.string(),
270
+ displayName: n.string(),
271
+ contentType: n.string(),
272
+ id: n.string()
385
273
  })
386
274
  ).nullable()
387
- }), v = e.object({
388
- submissionComments: e.object({
389
- commentsConnection: e.object({
390
- pageInfo: S,
391
- nodes: e.array(y)
275
+ }), qn = n.object({
276
+ submissionComments: n.object({
277
+ commentsConnection: n.object({
278
+ pageInfo: Jt,
279
+ nodes: n.array(en)
392
280
  })
393
281
  })
394
- }), B = e.object({
395
- comments: e.array(y),
396
- pageInfo: S
397
- }), N = e.object({
398
- submittedAt: e.string(),
399
- body: e.string().nullable(),
400
- grade: e.string().nullable(),
401
- score: e.number().nullable(),
402
- submissionType: e.string(),
403
- state: e.string(),
404
- attempt: e.number(),
405
- attachment: u.nullable(),
406
- attachments: e.array(u).nullable()
407
- }), M = e.object({
408
- node: e.object({
409
- submissionHistoriesConnection: e.object({
410
- nodes: e.array(N)
282
+ }), Qi = n.object({
283
+ comments: n.array(en),
284
+ pageInfo: Jt
285
+ }), Yn = n.object({
286
+ submittedAt: n.string(),
287
+ body: n.string().nullable(),
288
+ grade: n.string().nullable(),
289
+ score: n.number().nullable(),
290
+ submissionType: n.string(),
291
+ state: n.string(),
292
+ attempt: n.number(),
293
+ attachment: _e.nullable(),
294
+ attachments: n.array(_e).nullable()
295
+ }), Xn = n.object({
296
+ node: n.object({
297
+ submissionHistoriesConnection: n.object({
298
+ nodes: n.array(Yn)
411
299
  })
412
300
  })
413
- }), b = e.object({
414
- attribute: e.string(),
415
- message: e.string()
416
- }), w = e.object({
417
- createSubmissionComment: e.object({
418
- submissionComment: e.object({
419
- _id: e.string(),
420
- attachments: e.array(
421
- e.object({
422
- _id: e.string(),
423
- displayName: e.string(),
424
- id: e.string(),
425
- mimeClass: e.string(),
426
- url: e.string()
301
+ }), Se = n.object({
302
+ attribute: n.string(),
303
+ message: n.string()
304
+ }), Kn = n.object({
305
+ createSubmissionComment: n.object({
306
+ submissionComment: n.object({
307
+ _id: n.string(),
308
+ attachments: n.array(
309
+ n.object({
310
+ _id: n.string(),
311
+ displayName: n.string(),
312
+ id: n.string(),
313
+ mimeClass: n.string(),
314
+ url: n.string()
427
315
  })
428
316
  ).nullable(),
429
- author: e.object({
430
- avatarUrl: e.string().nullable(),
431
- shortName: e.string()
317
+ author: n.object({
318
+ avatarUrl: n.string().nullable(),
319
+ shortName: n.string()
432
320
  }),
433
- htmlComment: e.string(),
434
- mediaObject: e.object({
435
- id: e.string(),
436
- _id: e.string(),
437
- mediaSources: e.array(
438
- e.object({
439
- height: e.string(),
440
- src: e.string(),
441
- type: e.string(),
442
- width: e.string()
321
+ htmlComment: n.string(),
322
+ mediaObject: n.object({
323
+ id: n.string(),
324
+ _id: n.string(),
325
+ mediaSources: n.array(
326
+ n.object({
327
+ height: n.string(),
328
+ src: n.string(),
329
+ type: n.string(),
330
+ width: n.string()
443
331
  })
444
332
  ),
445
- mediaTracks: e.array(
446
- e.object({
447
- _id: e.string(),
448
- locale: e.string(),
449
- content: e.string(),
450
- kind: e.string()
333
+ mediaTracks: n.array(
334
+ n.object({
335
+ _id: n.string(),
336
+ locale: n.string(),
337
+ content: n.string(),
338
+ kind: n.string()
451
339
  })
452
340
  ),
453
- mediaType: e.string(),
454
- title: e.string()
341
+ mediaType: n.string(),
342
+ title: n.string()
455
343
  }).nullable(),
456
- read: e.boolean(),
457
- updatedAt: e.string()
344
+ read: n.boolean(),
345
+ updatedAt: n.string()
458
346
  }).nullable(),
459
- errors: e.array(b).nullable()
347
+ errors: n.array(Se).nullable()
460
348
  })
461
- }), O = e.object({
462
- markSubmissionCommentsRead: e.object({
463
- errors: e.array(b).nullable()
349
+ }), Vn = n.object({
350
+ markSubmissionCommentsRead: n.object({
351
+ errors: n.array(Se).nullable()
464
352
  })
465
- }), Z = e.object({
466
- createSubmission: e.object({
467
- submission: e.object({
468
- _id: e.string(),
469
- createdAt: e.string(),
470
- attempt: e.number(),
471
- submittedAt: e.string().nullable(),
472
- score: e.number().nullable()
353
+ }), Ji = n.object({
354
+ createSubmission: n.object({
355
+ submission: n.object({
356
+ _id: n.string(),
357
+ createdAt: n.string(),
358
+ attempt: n.number(),
359
+ submittedAt: n.string().nullable(),
360
+ score: n.number().nullable()
473
361
  }).nullable(),
474
- errors: e.array(b).nullable()
362
+ errors: n.array(Se).nullable()
475
363
  })
476
- }), x = e.object(
364
+ }), er = n.object(
477
365
  {
478
- createSubmissionDraft: e.object({
479
- submissionDraft: e.object({
480
- _id: e.string()
366
+ createSubmissionDraft: n.object({
367
+ submissionDraft: n.object({
368
+ _id: n.string()
481
369
  }).nullable(),
482
- errors: e.array(b).nullable()
370
+ errors: n.array(Se).nullable()
483
371
  })
484
372
  }
485
- ), K = e.object(
373
+ ), tr = n.object(
486
374
  {
487
- deleteSubmissionDraft: e.object({
488
- submissionDraftIds: e.array(e.string()).nullable(),
489
- errors: e.array(b).nullable()
375
+ deleteSubmissionDraft: n.object({
376
+ submissionDraftIds: n.array(n.string()).nullable(),
377
+ errors: n.array(Se).nullable()
490
378
  })
491
379
  }
492
380
  );
493
- function H({
494
- executeQuery: n
381
+ function Zn({
382
+ submissionId: t,
383
+ executeQuery: i,
384
+ enabled: o = !0
495
385
  }) {
496
- const i = c();
497
- return g({
498
- mutationFn: async ({ submissionId: s, attempt: t, comment: o, fileIds: a }) => {
499
- const r = await n(I, {
500
- id: s,
501
- submissionAttempt: t,
502
- comment: o,
503
- fileIds: a
504
- });
505
- return w.parse(r), r;
386
+ return Ue({
387
+ queryKey: ["assignment-review", "submissions", t],
388
+ queryFn: async () => {
389
+ const a = await i($n, { submissionId: t });
390
+ return Xn.parse(a).node.submissionHistoriesConnection.nodes.slice().sort(
391
+ (c, f) => new Date(f.submittedAt).getTime() - new Date(c.submittedAt).getTime()
392
+ );
506
393
  },
507
- onSuccess: (s, t) => {
508
- i.invalidateQueries({
509
- queryKey: ["assignment-review", "submission-comments", t.submissionId]
394
+ enabled: o
395
+ });
396
+ }
397
+ function nr({
398
+ submissionId: t,
399
+ selectedAttempt: i,
400
+ onAttemptSelect: o,
401
+ pointsPossible: a,
402
+ executeQuery: l
403
+ }) {
404
+ const { t: c } = B("assignment-review"), { data: f, isLoading: b, isError: u } = Zn({
405
+ submissionId: t,
406
+ executeQuery: l
407
+ });
408
+ if (b)
409
+ return /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(ct, { renderTitle: c("navigation.attempts"), size: "small" }) });
410
+ if (u)
411
+ return /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(y, { color: "danger", children: c("submission.loadAttemptsError", "Failed to load attempts") }) });
412
+ const p = (f == null ? void 0 : f.filter((_) => _.attempt > 0)) ?? [];
413
+ return p.length === 0 ? /* @__PURE__ */ r(g, { padding: "medium", children: /* @__PURE__ */ r(y, { color: "secondary", children: c(
414
+ "submission.noAttempts",
415
+ "This assignment allows multiple attempts. Once you've made a submission, you can view it here."
416
+ ) }) }) : /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", padding: "none none medium none", children: p.map((_) => /* @__PURE__ */ r(
417
+ Un,
418
+ {
419
+ submission: _,
420
+ isSelected: i === _.attempt,
421
+ pointsPossible: a,
422
+ onClick: () => o(_)
423
+ },
424
+ _.attempt
425
+ )) });
426
+ }
427
+ /*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
428
+ const {
429
+ entries: tn,
430
+ setPrototypeOf: Pt,
431
+ isFrozen: Qn,
432
+ getPrototypeOf: Jn,
433
+ getOwnPropertyDescriptor: ei
434
+ } = Object;
435
+ let {
436
+ freeze: F,
437
+ seal: G,
438
+ create: ke
439
+ } = Object, {
440
+ apply: st,
441
+ construct: at
442
+ } = typeof Reflect < "u" && Reflect;
443
+ F || (F = function(i) {
444
+ return i;
445
+ });
446
+ G || (G = function(i) {
447
+ return i;
448
+ });
449
+ st || (st = function(i, o) {
450
+ for (var a = arguments.length, l = new Array(a > 2 ? a - 2 : 0), c = 2; c < a; c++)
451
+ l[c - 2] = arguments[c];
452
+ return i.apply(o, l);
453
+ });
454
+ at || (at = function(i) {
455
+ for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
456
+ a[l - 1] = arguments[l];
457
+ return new i(...a);
458
+ });
459
+ const Me = U(Array.prototype.forEach), ti = U(Array.prototype.lastIndexOf), Ft = U(Array.prototype.pop), pe = U(Array.prototype.push), ni = U(Array.prototype.splice), Pe = U(String.prototype.toLowerCase), Je = U(String.prototype.toString), et = U(String.prototype.match), ge = U(String.prototype.replace), ii = U(String.prototype.indexOf), ri = U(String.prototype.trim), H = U(Object.prototype.hasOwnProperty), k = U(RegExp.prototype.test), he = oi(TypeError);
460
+ function U(t) {
461
+ return function(i) {
462
+ i instanceof RegExp && (i.lastIndex = 0);
463
+ for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
464
+ a[l - 1] = arguments[l];
465
+ return st(t, i, a);
466
+ };
467
+ }
468
+ function oi(t) {
469
+ return function() {
470
+ for (var i = arguments.length, o = new Array(i), a = 0; a < i; a++)
471
+ o[a] = arguments[a];
472
+ return at(t, o);
473
+ };
474
+ }
475
+ function h(t, i) {
476
+ let o = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Pe;
477
+ Pt && Pt(t, null);
478
+ let a = i.length;
479
+ for (; a--; ) {
480
+ let l = i[a];
481
+ if (typeof l == "string") {
482
+ const c = o(l);
483
+ c !== l && (Qn(i) || (i[a] = c), l = c);
484
+ }
485
+ t[l] = !0;
486
+ }
487
+ return t;
488
+ }
489
+ function si(t) {
490
+ for (let i = 0; i < t.length; i++)
491
+ H(t, i) || (t[i] = null);
492
+ return t;
493
+ }
494
+ function Y(t) {
495
+ const i = ke(null);
496
+ for (const [o, a] of tn(t))
497
+ H(t, o) && (Array.isArray(a) ? i[o] = si(a) : a && typeof a == "object" && a.constructor === Object ? i[o] = Y(a) : i[o] = a);
498
+ return i;
499
+ }
500
+ function be(t, i) {
501
+ for (; t !== null; ) {
502
+ const a = ei(t, i);
503
+ if (a) {
504
+ if (a.get)
505
+ return U(a.get);
506
+ if (typeof a.value == "function")
507
+ return U(a.value);
508
+ }
509
+ t = Jn(t);
510
+ }
511
+ function o() {
512
+ return null;
513
+ }
514
+ return o;
515
+ }
516
+ const Ut = F(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), tt = F(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), nt = F(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ai = F(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), it = F(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), li = F(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), zt = F(["#text"]), jt = F(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), rt = F(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), $t = F(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), xe = F(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ci = G(/\{\{[\w\W]*|[\w\W]*\}\}/gm), mi = G(/<%[\w\W]*|[\w\W]*%>/gm), ui = G(/\$\{[\w\W]*/gm), di = G(/^data-[\-\w.\u00B7-\uFFFF]+$/), fi = G(/^aria-[\-\w]+$/), nn = G(
517
+ /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
518
+ // eslint-disable-line no-useless-escape
519
+ ), pi = G(/^(?:\w+script|data):/i), gi = G(
520
+ /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
521
+ // eslint-disable-line no-control-regex
522
+ ), rn = G(/^html$/i), hi = G(/^[a-z][.\w]*(-[.\w]+)+$/i);
523
+ var Ht = /* @__PURE__ */ Object.freeze({
524
+ __proto__: null,
525
+ ARIA_ATTR: fi,
526
+ ATTR_WHITESPACE: gi,
527
+ CUSTOM_ELEMENT: hi,
528
+ DATA_ATTR: di,
529
+ DOCTYPE_NAME: rn,
530
+ ERB_EXPR: mi,
531
+ IS_ALLOWED_URI: nn,
532
+ IS_SCRIPT_OR_DATA: pi,
533
+ MUSTACHE_EXPR: ci,
534
+ TMPLIT_EXPR: ui
535
+ });
536
+ const Te = {
537
+ element: 1,
538
+ text: 3,
539
+ // Deprecated
540
+ progressingInstruction: 7,
541
+ comment: 8,
542
+ document: 9
543
+ }, bi = function() {
544
+ return typeof window > "u" ? null : window;
545
+ }, Ti = function(i, o) {
546
+ if (typeof i != "object" || typeof i.createPolicy != "function")
547
+ return null;
548
+ let a = null;
549
+ const l = "data-tt-policy-suffix";
550
+ o && o.hasAttribute(l) && (a = o.getAttribute(l));
551
+ const c = "dompurify" + (a ? "#" + a : "");
552
+ try {
553
+ return i.createPolicy(c, {
554
+ createHTML(f) {
555
+ return f;
556
+ },
557
+ createScriptURL(f) {
558
+ return f;
559
+ }
560
+ });
561
+ } catch {
562
+ return console.warn("TrustedTypes policy " + c + " could not be created."), null;
563
+ }
564
+ }, Gt = function() {
565
+ return {
566
+ afterSanitizeAttributes: [],
567
+ afterSanitizeElements: [],
568
+ afterSanitizeShadowDOM: [],
569
+ beforeSanitizeAttributes: [],
570
+ beforeSanitizeElements: [],
571
+ beforeSanitizeShadowDOM: [],
572
+ uponSanitizeAttribute: [],
573
+ uponSanitizeElement: [],
574
+ uponSanitizeShadowNode: []
575
+ };
576
+ };
577
+ function on() {
578
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bi();
579
+ const i = (d) => on(d);
580
+ if (i.version = "3.3.3", i.removed = [], !t || !t.document || t.document.nodeType !== Te.document || !t.Element)
581
+ return i.isSupported = !1, i;
582
+ let {
583
+ document: o
584
+ } = t;
585
+ const a = o, l = a.currentScript, {
586
+ DocumentFragment: c,
587
+ HTMLTemplateElement: f,
588
+ Node: b,
589
+ Element: u,
590
+ NodeFilter: p,
591
+ NamedNodeMap: _ = t.NamedNodeMap || t.MozNamedAttrMap,
592
+ HTMLFormElement: D,
593
+ DOMParser: I,
594
+ trustedTypes: A
595
+ } = t, T = u.prototype, me = be(T, "cloneNode"), ye = be(T, "remove"), Ae = be(T, "nextSibling"), Ee = be(T, "childNodes"), ie = be(T, "parentNode");
596
+ if (typeof f == "function") {
597
+ const d = o.createElement("template");
598
+ d.content && d.content.ownerDocument && (o = d.content.ownerDocument);
599
+ }
600
+ let L, ee = "";
601
+ const {
602
+ implementation: z,
603
+ createNodeIterator: $,
604
+ createDocumentFragment: Ie,
605
+ getElementsByTagName: ln
606
+ } = o, {
607
+ importNode: cn
608
+ } = a;
609
+ let x = Gt();
610
+ i.isSupported = typeof tn == "function" && typeof ie == "function" && z && z.createHTMLDocument !== void 0;
611
+ const {
612
+ MUSTACHE_EXPR: ze,
613
+ ERB_EXPR: je,
614
+ TMPLIT_EXPR: $e,
615
+ DATA_ATTR: mn,
616
+ ARIA_ATTR: un,
617
+ IS_SCRIPT_OR_DATA: dn,
618
+ ATTR_WHITESPACE: ut,
619
+ CUSTOM_ELEMENT: fn
620
+ } = Ht;
621
+ let {
622
+ IS_ALLOWED_URI: dt
623
+ } = Ht, v = null;
624
+ const ft = h({}, [...Ut, ...tt, ...nt, ...it, ...zt]);
625
+ let N = null;
626
+ const pt = h({}, [...jt, ...rt, ...$t, ...xe]);
627
+ let C = Object.seal(ke(null, {
628
+ tagNameCheck: {
629
+ writable: !0,
630
+ configurable: !1,
631
+ enumerable: !0,
632
+ value: null
633
+ },
634
+ attributeNameCheck: {
635
+ writable: !0,
636
+ configurable: !1,
637
+ enumerable: !0,
638
+ value: null
639
+ },
640
+ allowCustomizedBuiltInElements: {
641
+ writable: !0,
642
+ configurable: !1,
643
+ enumerable: !0,
644
+ value: !1
645
+ }
646
+ })), ue = null, Ce = null;
647
+ const Q = Object.seal(ke(null, {
648
+ tagCheck: {
649
+ writable: !0,
650
+ configurable: !1,
651
+ enumerable: !0,
652
+ value: null
653
+ },
654
+ attributeCheck: {
655
+ writable: !0,
656
+ configurable: !1,
657
+ enumerable: !0,
658
+ value: null
659
+ }
660
+ }));
661
+ let gt = !0, He = !0, ht = !1, bt = !0, re = !1, De = !0, te = !1, Ge = !1, Be = !1, oe = !1, Re = !1, we = !1, Tt = !0, _t = !1;
662
+ const pn = "user-content-";
663
+ let We = !0, de = !1, se = {}, W = null;
664
+ const qe = h({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
665
+ let St = null;
666
+ const yt = h({}, ["audio", "video", "img", "source", "image", "track"]);
667
+ let Ye = null;
668
+ const At = h({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ve = "http://www.w3.org/1998/Math/MathML", Le = "http://www.w3.org/2000/svg", X = "http://www.w3.org/1999/xhtml";
669
+ let ae = X, Xe = !1, Ke = null;
670
+ const gn = h({}, [ve, Le, X], Je);
671
+ let Ne = h({}, ["mi", "mo", "mn", "ms", "mtext"]), Oe = h({}, ["annotation-xml"]);
672
+ const hn = h({}, ["title", "style", "font", "a", "script"]);
673
+ let fe = null;
674
+ const bn = ["application/xhtml+xml", "text/html"], Tn = "text/html";
675
+ let w = null, le = null;
676
+ const _n = o.createElement("form"), Et = function(e) {
677
+ return e instanceof RegExp || e instanceof Function;
678
+ }, Ve = function() {
679
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
680
+ if (!(le && le === e)) {
681
+ if ((!e || typeof e != "object") && (e = {}), e = Y(e), fe = // eslint-disable-next-line unicorn/prefer-includes
682
+ bn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Tn : e.PARSER_MEDIA_TYPE, w = fe === "application/xhtml+xml" ? Je : Pe, v = H(e, "ALLOWED_TAGS") ? h({}, e.ALLOWED_TAGS, w) : ft, N = H(e, "ALLOWED_ATTR") ? h({}, e.ALLOWED_ATTR, w) : pt, Ke = H(e, "ALLOWED_NAMESPACES") ? h({}, e.ALLOWED_NAMESPACES, Je) : gn, Ye = H(e, "ADD_URI_SAFE_ATTR") ? h(Y(At), e.ADD_URI_SAFE_ATTR, w) : At, St = H(e, "ADD_DATA_URI_TAGS") ? h(Y(yt), e.ADD_DATA_URI_TAGS, w) : yt, W = H(e, "FORBID_CONTENTS") ? h({}, e.FORBID_CONTENTS, w) : qe, ue = H(e, "FORBID_TAGS") ? h({}, e.FORBID_TAGS, w) : Y({}), Ce = H(e, "FORBID_ATTR") ? h({}, e.FORBID_ATTR, w) : Y({}), se = H(e, "USE_PROFILES") ? e.USE_PROFILES : !1, gt = e.ALLOW_ARIA_ATTR !== !1, He = e.ALLOW_DATA_ATTR !== !1, ht = e.ALLOW_UNKNOWN_PROTOCOLS || !1, bt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, re = e.SAFE_FOR_TEMPLATES || !1, De = e.SAFE_FOR_XML !== !1, te = e.WHOLE_DOCUMENT || !1, oe = e.RETURN_DOM || !1, Re = e.RETURN_DOM_FRAGMENT || !1, we = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, Tt = e.SANITIZE_DOM !== !1, _t = e.SANITIZE_NAMED_PROPS || !1, We = e.KEEP_CONTENT !== !1, de = e.IN_PLACE || !1, dt = e.ALLOWED_URI_REGEXP || nn, ae = e.NAMESPACE || X, Ne = e.MATHML_TEXT_INTEGRATION_POINTS || Ne, Oe = e.HTML_INTEGRATION_POINTS || Oe, C = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && Et(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (C.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Et(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (C.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), re && (He = !1), Re && (oe = !0), se && (v = h({}, zt), N = ke(null), se.html === !0 && (h(v, Ut), h(N, jt)), se.svg === !0 && (h(v, tt), h(N, rt), h(N, xe)), se.svgFilters === !0 && (h(v, nt), h(N, rt), h(N, xe)), se.mathMl === !0 && (h(v, it), h(N, $t), h(N, xe))), H(e, "ADD_TAGS") || (Q.tagCheck = null), H(e, "ADD_ATTR") || (Q.attributeCheck = null), e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? Q.tagCheck = e.ADD_TAGS : (v === ft && (v = Y(v)), h(v, e.ADD_TAGS, w))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? Q.attributeCheck = e.ADD_ATTR : (N === pt && (N = Y(N)), h(N, e.ADD_ATTR, w))), e.ADD_URI_SAFE_ATTR && h(Ye, e.ADD_URI_SAFE_ATTR, w), e.FORBID_CONTENTS && (W === qe && (W = Y(W)), h(W, e.FORBID_CONTENTS, w)), e.ADD_FORBID_CONTENTS && (W === qe && (W = Y(W)), h(W, e.ADD_FORBID_CONTENTS, w)), We && (v["#text"] = !0), te && h(v, ["html", "head", "body"]), v.table && (h(v, ["tbody"]), delete ue.tbody), e.TRUSTED_TYPES_POLICY) {
683
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
684
+ throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
685
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
686
+ throw he('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
687
+ L = e.TRUSTED_TYPES_POLICY, ee = L.createHTML("");
688
+ } else
689
+ L === void 0 && (L = Ti(A, l)), L !== null && typeof ee == "string" && (ee = L.createHTML(""));
690
+ F && F(e), le = e;
691
+ }
692
+ }, It = h({}, [...tt, ...nt, ...ai]), Ct = h({}, [...it, ...li]), Sn = function(e) {
693
+ let s = ie(e);
694
+ (!s || !s.tagName) && (s = {
695
+ namespaceURI: ae,
696
+ tagName: "template"
697
+ });
698
+ const m = Pe(e.tagName), E = Pe(s.tagName);
699
+ return Ke[e.namespaceURI] ? e.namespaceURI === Le ? s.namespaceURI === X ? m === "svg" : s.namespaceURI === ve ? m === "svg" && (E === "annotation-xml" || Ne[E]) : !!It[m] : e.namespaceURI === ve ? s.namespaceURI === X ? m === "math" : s.namespaceURI === Le ? m === "math" && Oe[E] : !!Ct[m] : e.namespaceURI === X ? s.namespaceURI === Le && !Oe[E] || s.namespaceURI === ve && !Ne[E] ? !1 : !Ct[m] && (hn[m] || !It[m]) : !!(fe === "application/xhtml+xml" && Ke[e.namespaceURI]) : !1;
700
+ }, q = function(e) {
701
+ pe(i.removed, {
702
+ element: e
703
+ });
704
+ try {
705
+ ie(e).removeChild(e);
706
+ } catch {
707
+ ye(e);
708
+ }
709
+ }, ne = function(e, s) {
710
+ try {
711
+ pe(i.removed, {
712
+ attribute: s.getAttributeNode(e),
713
+ from: s
714
+ });
715
+ } catch {
716
+ pe(i.removed, {
717
+ attribute: null,
718
+ from: s
510
719
  });
511
720
  }
512
- });
721
+ if (s.removeAttribute(e), e === "is")
722
+ if (oe || Re)
723
+ try {
724
+ q(s);
725
+ } catch {
726
+ }
727
+ else
728
+ try {
729
+ s.setAttribute(e, "");
730
+ } catch {
731
+ }
732
+ }, Dt = function(e) {
733
+ let s = null, m = null;
734
+ if (Be)
735
+ e = "<remove></remove>" + e;
736
+ else {
737
+ const R = et(e, /^[\r\n\t ]+/);
738
+ m = R && R[0];
739
+ }
740
+ fe === "application/xhtml+xml" && ae === X && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
741
+ const E = L ? L.createHTML(e) : e;
742
+ if (ae === X)
743
+ try {
744
+ s = new I().parseFromString(E, fe);
745
+ } catch {
746
+ }
747
+ if (!s || !s.documentElement) {
748
+ s = z.createDocument(ae, "template", null);
749
+ try {
750
+ s.documentElement.innerHTML = Xe ? ee : E;
751
+ } catch {
752
+ }
753
+ }
754
+ const M = s.body || s.documentElement;
755
+ return e && m && M.insertBefore(o.createTextNode(m), M.childNodes[0] || null), ae === X ? ln.call(s, te ? "html" : "body")[0] : te ? s.documentElement : M;
756
+ }, Rt = function(e) {
757
+ return $.call(
758
+ e.ownerDocument || e,
759
+ e,
760
+ // eslint-disable-next-line no-bitwise
761
+ p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
762
+ null
763
+ );
764
+ }, Ze = function(e) {
765
+ return e instanceof D && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof _) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
766
+ }, wt = function(e) {
767
+ return typeof b == "function" && e instanceof b;
768
+ };
769
+ function K(d, e, s) {
770
+ Me(d, (m) => {
771
+ m.call(i, e, s, le);
772
+ });
773
+ }
774
+ const vt = function(e) {
775
+ let s = null;
776
+ if (K(x.beforeSanitizeElements, e, null), Ze(e))
777
+ return q(e), !0;
778
+ const m = w(e.nodeName);
779
+ if (K(x.uponSanitizeElement, e, {
780
+ tagName: m,
781
+ allowedTags: v
782
+ }), De && e.hasChildNodes() && !wt(e.firstElementChild) && k(/<[/\w!]/g, e.innerHTML) && k(/<[/\w!]/g, e.textContent) || e.nodeType === Te.progressingInstruction || De && e.nodeType === Te.comment && k(/<[/\w]/g, e.data))
783
+ return q(e), !0;
784
+ if (!(Q.tagCheck instanceof Function && Q.tagCheck(m)) && (!v[m] || ue[m])) {
785
+ if (!ue[m] && Nt(m) && (C.tagNameCheck instanceof RegExp && k(C.tagNameCheck, m) || C.tagNameCheck instanceof Function && C.tagNameCheck(m)))
786
+ return !1;
787
+ if (We && !W[m]) {
788
+ const E = ie(e) || e.parentNode, M = Ee(e) || e.childNodes;
789
+ if (M && E) {
790
+ const R = M.length;
791
+ for (let j = R - 1; j >= 0; --j) {
792
+ const V = me(M[j], !0);
793
+ V.__removalCount = (e.__removalCount || 0) + 1, E.insertBefore(V, Ae(e));
794
+ }
795
+ }
796
+ }
797
+ return q(e), !0;
798
+ }
799
+ return e instanceof u && !Sn(e) || (m === "noscript" || m === "noembed" || m === "noframes") && k(/<\/no(script|embed|frames)/i, e.innerHTML) ? (q(e), !0) : (re && e.nodeType === Te.text && (s = e.textContent, Me([ze, je, $e], (E) => {
800
+ s = ge(s, E, " ");
801
+ }), e.textContent !== s && (pe(i.removed, {
802
+ element: e.cloneNode()
803
+ }), e.textContent = s)), K(x.afterSanitizeElements, e, null), !1);
804
+ }, Lt = function(e, s, m) {
805
+ if (Ce[s] || Tt && (s === "id" || s === "name") && (m in o || m in _n))
806
+ return !1;
807
+ if (!(He && !Ce[s] && k(mn, s))) {
808
+ if (!(gt && k(un, s))) {
809
+ if (!(Q.attributeCheck instanceof Function && Q.attributeCheck(s, e))) {
810
+ if (!N[s] || Ce[s]) {
811
+ if (
812
+ // First condition does a very basic check if a) it's basically a valid custom element tagname AND
813
+ // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
814
+ // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
815
+ !(Nt(e) && (C.tagNameCheck instanceof RegExp && k(C.tagNameCheck, e) || C.tagNameCheck instanceof Function && C.tagNameCheck(e)) && (C.attributeNameCheck instanceof RegExp && k(C.attributeNameCheck, s) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(s, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
816
+ // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
817
+ s === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && k(C.tagNameCheck, m) || C.tagNameCheck instanceof Function && C.tagNameCheck(m)))
818
+ ) return !1;
819
+ } else if (!Ye[s]) {
820
+ if (!k(dt, ge(m, ut, ""))) {
821
+ if (!((s === "src" || s === "xlink:href" || s === "href") && e !== "script" && ii(m, "data:") === 0 && St[e])) {
822
+ if (!(ht && !k(dn, ge(m, ut, "")))) {
823
+ if (m)
824
+ return !1;
825
+ }
826
+ }
827
+ }
828
+ }
829
+ }
830
+ }
831
+ }
832
+ return !0;
833
+ }, Nt = function(e) {
834
+ return e !== "annotation-xml" && et(e, fn);
835
+ }, Ot = function(e) {
836
+ K(x.beforeSanitizeAttributes, e, null);
837
+ const {
838
+ attributes: s
839
+ } = e;
840
+ if (!s || Ze(e))
841
+ return;
842
+ const m = {
843
+ attrName: "",
844
+ attrValue: "",
845
+ keepAttr: !0,
846
+ allowedAttributes: N,
847
+ forceKeepAttr: void 0
848
+ };
849
+ let E = s.length;
850
+ for (; E--; ) {
851
+ const M = s[E], {
852
+ name: R,
853
+ namespaceURI: j,
854
+ value: V
855
+ } = M, ce = w(R), Qe = V;
856
+ let O = R === "value" ? Qe : ri(Qe);
857
+ if (m.attrName = ce, m.attrValue = O, m.keepAttr = !0, m.forceKeepAttr = void 0, K(x.uponSanitizeAttribute, e, m), O = m.attrValue, _t && (ce === "id" || ce === "name") && (ne(R, e), O = pn + O), De && k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, O)) {
858
+ ne(R, e);
859
+ continue;
860
+ }
861
+ if (ce === "attributename" && et(O, "href")) {
862
+ ne(R, e);
863
+ continue;
864
+ }
865
+ if (m.forceKeepAttr)
866
+ continue;
867
+ if (!m.keepAttr) {
868
+ ne(R, e);
869
+ continue;
870
+ }
871
+ if (!bt && k(/\/>/i, O)) {
872
+ ne(R, e);
873
+ continue;
874
+ }
875
+ re && Me([ze, je, $e], (xt) => {
876
+ O = ge(O, xt, " ");
877
+ });
878
+ const Mt = w(e.nodeName);
879
+ if (!Lt(Mt, ce, O)) {
880
+ ne(R, e);
881
+ continue;
882
+ }
883
+ if (L && typeof A == "object" && typeof A.getAttributeType == "function" && !j)
884
+ switch (A.getAttributeType(Mt, ce)) {
885
+ case "TrustedHTML": {
886
+ O = L.createHTML(O);
887
+ break;
888
+ }
889
+ case "TrustedScriptURL": {
890
+ O = L.createScriptURL(O);
891
+ break;
892
+ }
893
+ }
894
+ if (O !== Qe)
895
+ try {
896
+ j ? e.setAttributeNS(j, R, O) : e.setAttribute(R, O), Ze(e) ? q(e) : Ft(i.removed);
897
+ } catch {
898
+ ne(R, e);
899
+ }
900
+ }
901
+ K(x.afterSanitizeAttributes, e, null);
902
+ }, yn = function d(e) {
903
+ let s = null;
904
+ const m = Rt(e);
905
+ for (K(x.beforeSanitizeShadowDOM, e, null); s = m.nextNode(); )
906
+ K(x.uponSanitizeShadowNode, s, null), vt(s), Ot(s), s.content instanceof c && d(s.content);
907
+ K(x.afterSanitizeShadowDOM, e, null);
908
+ };
909
+ return i.sanitize = function(d) {
910
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = null, m = null, E = null, M = null;
911
+ if (Xe = !d, Xe && (d = "<!-->"), typeof d != "string" && !wt(d))
912
+ if (typeof d.toString == "function") {
913
+ if (d = d.toString(), typeof d != "string")
914
+ throw he("dirty is not a string, aborting");
915
+ } else
916
+ throw he("toString is not a function");
917
+ if (!i.isSupported)
918
+ return d;
919
+ if (Ge || Ve(e), i.removed = [], typeof d == "string" && (de = !1), de) {
920
+ if (d.nodeName) {
921
+ const V = w(d.nodeName);
922
+ if (!v[V] || ue[V])
923
+ throw he("root node is forbidden and cannot be sanitized in-place");
924
+ }
925
+ } else if (d instanceof b)
926
+ s = Dt("<!---->"), m = s.ownerDocument.importNode(d, !0), m.nodeType === Te.element && m.nodeName === "BODY" || m.nodeName === "HTML" ? s = m : s.appendChild(m);
927
+ else {
928
+ if (!oe && !re && !te && // eslint-disable-next-line unicorn/prefer-includes
929
+ d.indexOf("<") === -1)
930
+ return L && we ? L.createHTML(d) : d;
931
+ if (s = Dt(d), !s)
932
+ return oe ? null : we ? ee : "";
933
+ }
934
+ s && Be && q(s.firstChild);
935
+ const R = Rt(de ? d : s);
936
+ for (; E = R.nextNode(); )
937
+ vt(E), Ot(E), E.content instanceof c && yn(E.content);
938
+ if (de)
939
+ return d;
940
+ if (oe) {
941
+ if (Re)
942
+ for (M = Ie.call(s.ownerDocument); s.firstChild; )
943
+ M.appendChild(s.firstChild);
944
+ else
945
+ M = s;
946
+ return (N.shadowroot || N.shadowrootmode) && (M = cn.call(a, M, !0)), M;
947
+ }
948
+ let j = te ? s.outerHTML : s.innerHTML;
949
+ return te && v["!doctype"] && s.ownerDocument && s.ownerDocument.doctype && s.ownerDocument.doctype.name && k(rn, s.ownerDocument.doctype.name) && (j = "<!DOCTYPE " + s.ownerDocument.doctype.name + `>
950
+ ` + j), re && Me([ze, je, $e], (V) => {
951
+ j = ge(j, V, " ");
952
+ }), L && we ? L.createHTML(j) : j;
953
+ }, i.setConfig = function() {
954
+ let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
955
+ Ve(d), Ge = !0;
956
+ }, i.clearConfig = function() {
957
+ le = null, Ge = !1;
958
+ }, i.isValidAttribute = function(d, e, s) {
959
+ le || Ve({});
960
+ const m = w(d), E = w(e);
961
+ return Lt(m, E, s);
962
+ }, i.addHook = function(d, e) {
963
+ typeof e == "function" && pe(x[d], e);
964
+ }, i.removeHook = function(d, e) {
965
+ if (e !== void 0) {
966
+ const s = ti(x[d], e);
967
+ return s === -1 ? void 0 : ni(x[d], s, 1)[0];
968
+ }
969
+ return Ft(x[d]);
970
+ }, i.removeHooks = function(d) {
971
+ x[d] = [];
972
+ }, i.removeAllHooks = function() {
973
+ x = Gt();
974
+ }, i;
513
975
  }
514
- function Q({
515
- courseId: n,
516
- assignmentId: i,
517
- userId: s,
518
- executeQuery: t,
519
- enabled: o = !0
976
+ var sn = on();
977
+ function an({
978
+ attachments: t,
979
+ size: i = "medium"
520
980
  }) {
521
- return l({
522
- queryKey: ["assignment-review", "assignment", n, i, s],
523
- queryFn: async () => {
524
- const a = await t($, {
525
- courseId: n,
526
- assignmentId: i,
527
- userId: s
528
- }), r = _.parse(a);
529
- return {
530
- ...r.legacyNode,
531
- courseName: r.course.name
532
- };
981
+ return t.length === 0 ? null : /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", children: t.map((o) => /* @__PURE__ */ r(
982
+ Z,
983
+ {
984
+ as: "div",
985
+ padding: i === "small" ? "x-small" : "small medium",
986
+ borderColor: "primary",
987
+ borderWidth: "small",
988
+ borderRadius: "medium",
989
+ children: /* @__PURE__ */ S(g, { as: "div", gap: "small", width: "100%", justifyItems: "space-between", alignItems: "center", children: [
990
+ /* @__PURE__ */ r(g.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(Vt, { children: o.displayName }) }),
991
+ /* @__PURE__ */ r(xn, { href: o.url, isWithinText: !1, renderIcon: /* @__PURE__ */ r(An, {}), children: /* @__PURE__ */ r(mt, { children: `Download ${o.displayName}` }) })
992
+ ] })
533
993
  },
534
- enabled: o
994
+ o.id
995
+ )) });
996
+ }
997
+ function _i(t) {
998
+ return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: sn.sanitize(t) } });
999
+ }
1000
+ function ir({
1001
+ submission: t,
1002
+ isLastAttempt: i = !0,
1003
+ showAttemptLabel: o = !0,
1004
+ renderHTML: a
1005
+ }) {
1006
+ const { t: l } = B("assignment-review"), c = a ?? _i, f = (t == null ? void 0 : t.submissionType) === "online_text_entry", b = (t == null ? void 0 : t.submissionType) === "online_upload", u = l(f ? "submission.textHeading" : "submission.uploadHeading"), p = ot(() => {
1007
+ if (!t) return [];
1008
+ const D = [];
1009
+ if (t.attachment && D.push(t.attachment), t.attachments)
1010
+ for (const I of t.attachments)
1011
+ D.some((A) => A.id === I.id) || D.push(I);
1012
+ return D;
1013
+ }, [t]), _ = ot(() => c((t == null ? void 0 : t.body) ?? ""), [t == null ? void 0 : t.body, c]);
1014
+ return t ? /* @__PURE__ */ r(Z, { as: "div", children: /* @__PURE__ */ S(g, { direction: "column", gap: "small", children: [
1015
+ o && !i && t.attempt != null && /* @__PURE__ */ r(y, { size: "small", weight: "bold", color: "secondary", children: l("submission.viewingAttempt", { number: t.attempt }) }),
1016
+ /* @__PURE__ */ S(g, { gap: "x-small", alignItems: "center", children: [
1017
+ /* @__PURE__ */ r(En, { color: "success" }),
1018
+ /* @__PURE__ */ r(qt, { level: "h3", children: u })
1019
+ ] }),
1020
+ f && t.body && /* @__PURE__ */ S(g, { alignItems: "stretch", gap: "small", children: [
1021
+ /* @__PURE__ */ r(Z, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
1022
+ /* @__PURE__ */ r(Z, { as: "div", children: /* @__PURE__ */ r(y, { children: _ }) })
1023
+ ] }),
1024
+ b && p.length > 0 && /* @__PURE__ */ r(an, { attachments: p })
1025
+ ] }) }) : null;
1026
+ }
1027
+ function Si(t) {
1028
+ return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: sn.sanitize(t) } });
1029
+ }
1030
+ function yi(t) {
1031
+ const i = new Date(t);
1032
+ return Number.isNaN(i.getTime()) ? "" : i.toLocaleString();
1033
+ }
1034
+ function Ai({
1035
+ comment: t,
1036
+ isFullWidth: i,
1037
+ renderHTML: o
1038
+ }) {
1039
+ var u;
1040
+ const { t: a } = B("assignment-review"), l = o ?? Si, c = ((u = t.author.courseRoles) == null ? void 0 : u.includes("StudentEnrollment")) ?? !1, f = ot(() => l(t.htmlComment), [t.htmlComment, l]);
1041
+ return /* @__PURE__ */ r(
1042
+ Z,
1043
+ {
1044
+ as: "div",
1045
+ padding: "small medium",
1046
+ borderWidth: "small",
1047
+ borderColor: "primary",
1048
+ borderRadius: "medium",
1049
+ margin: i ? "none" : c ? "none none none medium" : "none medium none none",
1050
+ children: /* @__PURE__ */ S(g, { as: "div", direction: "column", gap: "small", children: [
1051
+ /* @__PURE__ */ S(g, { as: "div", direction: "column", gap: "xx-small", children: [
1052
+ /* @__PURE__ */ S(g, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
1053
+ /* @__PURE__ */ r(g.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(y, { weight: "bold", size: "medium", children: /* @__PURE__ */ r(Vt, { children: t.author.shortName }) }) }),
1054
+ !t.read && /* @__PURE__ */ r(Zt, { type: "notification", standalone: !0, children: /* @__PURE__ */ r(mt, { children: a("comments.unreadSingle") }) })
1055
+ ] }),
1056
+ /* @__PURE__ */ r(y, { size: "small", color: "secondary", children: yi(t.createdAt) }),
1057
+ t.attempt > 0 && /* @__PURE__ */ r(y, { size: "small", color: "secondary", children: a("comments.attempt", { number: t.attempt }) })
1058
+ ] }),
1059
+ /* @__PURE__ */ r(y, { size: "medium", children: f }),
1060
+ t.attachments && t.attachments.length > 0 && /* @__PURE__ */ r(
1061
+ an,
1062
+ {
1063
+ attachments: t.attachments.map((p) => ({
1064
+ ...p,
1065
+ _id: p._id ?? p.id,
1066
+ submissionPreviewUrl: null
1067
+ })),
1068
+ size: "small"
1069
+ }
1070
+ )
1071
+ ] })
1072
+ }
1073
+ );
1074
+ }
1075
+ function rr({
1076
+ existingFiles: t,
1077
+ onSubmit: i,
1078
+ onSaveDraft: o,
1079
+ onDiscardDraft: a,
1080
+ onSelectFiles: l,
1081
+ isSubmitting: c = !1
1082
+ }) {
1083
+ const { t: f } = B("assignment-review"), [b, u] = Fe(t ?? []), p = async () => {
1084
+ const A = await l();
1085
+ u((T) => [...T, ...A]);
1086
+ }, _ = (A) => {
1087
+ u((T) => T.filter((me) => me.id !== A));
1088
+ }, D = b.map((A) => A.id), I = b.length > 0 && !c;
1089
+ return /* @__PURE__ */ S(g, { direction: "column", gap: "medium", children: [
1090
+ b.length > 0 && /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", children: b.map((A) => /* @__PURE__ */ r(
1091
+ Z,
1092
+ {
1093
+ as: "div",
1094
+ padding: "small",
1095
+ borderWidth: "small",
1096
+ borderColor: "primary",
1097
+ borderRadius: "medium",
1098
+ children: /* @__PURE__ */ S(g, { justifyItems: "space-between", alignItems: "center", children: [
1099
+ /* @__PURE__ */ r(y, { children: A.name }),
1100
+ /* @__PURE__ */ r(
1101
+ P,
1102
+ {
1103
+ size: "small",
1104
+ renderIcon: () => /* @__PURE__ */ r(In, {}),
1105
+ onClick: () => _(A.id),
1106
+ children: /* @__PURE__ */ S("span", { className: "screenreader-only", children: [
1107
+ "Remove ",
1108
+ A.name
1109
+ ] })
1110
+ }
1111
+ )
1112
+ ] })
1113
+ },
1114
+ A.id
1115
+ )) }),
1116
+ /* @__PURE__ */ r(P, { onClick: p, children: f("submissionForm.addFiles", "Add Files") }),
1117
+ /* @__PURE__ */ S(g, { gap: "small", children: [
1118
+ /* @__PURE__ */ r(
1119
+ P,
1120
+ {
1121
+ color: "primary",
1122
+ onClick: () => i(D),
1123
+ interaction: I ? "enabled" : "disabled",
1124
+ children: f("submissionForm.submit")
1125
+ }
1126
+ ),
1127
+ o && /* @__PURE__ */ r(
1128
+ P,
1129
+ {
1130
+ onClick: () => o(D),
1131
+ interaction: b.length > 0 ? "enabled" : "disabled",
1132
+ children: f("submissionForm.saveDraft")
1133
+ }
1134
+ ),
1135
+ a && t && t.length > 0 && /* @__PURE__ */ r(P, { color: "primary-inverse", onClick: a, children: f("submissionForm.discardDraft") })
1136
+ ] })
1137
+ ] });
1138
+ }
1139
+ function Ei(t) {
1140
+ const i = new Date(t);
1141
+ return Number.isNaN(i.getTime()) ? "" : i.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
1142
+ }
1143
+ function Ii() {
1144
+ return /* @__PURE__ */ r(y, { color: "secondary", size: "small", children: "|" });
1145
+ }
1146
+ function or({
1147
+ score: t,
1148
+ pointsPossible: i,
1149
+ gradingType: o,
1150
+ dueAt: a,
1151
+ allowedAttempts: l,
1152
+ currentAttempt: c,
1153
+ isOverdue: f,
1154
+ estimatedDuration: b,
1155
+ labels: u
1156
+ }) {
1157
+ const { t: p } = B("assignment-review"), _ = [];
1158
+ return b && _.push(
1159
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.duration) ?? p("header.duration", { minutes: b }) }, "duration")
1160
+ ), t != null && i != null ? _.push(
1161
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.score) ?? p("header.score", { score: t, total: i }) }, "score")
1162
+ ) : i != null && o !== "not_graded" && _.push(
1163
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.pointsPossible) ?? p("header.pointsPossible", { points: i }) }, "points")
1164
+ ), l != null && (l === -1 ? _.push(
1165
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.attempts) ?? p("header.attemptsUnlimited") }, "attempts")
1166
+ ) : c != null ? _.push(
1167
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.attempts) ?? p("header.attemptOf", { current: c, total: l }) }, "attempts")
1168
+ ) : _.push(
1169
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.attempts) ?? p("header.attemptsAllowed", { count: l }) }, "attempts")
1170
+ )), a && _.push(
1171
+ /* @__PURE__ */ r(y, { size: "small", children: (u == null ? void 0 : u.dueDate) ?? p("header.dueDate", { date: Ei(a) }) }, "due")
1172
+ ), /* @__PURE__ */ S(g, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
1173
+ _.map((D, I) => /* @__PURE__ */ S(g, { gap: "small", alignItems: "center", children: [
1174
+ I > 0 && /* @__PURE__ */ r(Ii, {}),
1175
+ D
1176
+ ] }, `item-${String(I)}`)),
1177
+ f && /* @__PURE__ */ r(lt, { color: "danger", children: (u == null ? void 0 : u.overdue) ?? p("header.overdue") })
1178
+ ] });
1179
+ }
1180
+ function sr({
1181
+ prevItem: t,
1182
+ nextItem: i,
1183
+ onNavigatePrev: o,
1184
+ onNavigateNext: a,
1185
+ labels: l
1186
+ }) {
1187
+ const { t: c } = B("assignment-review");
1188
+ if (!t && !i)
1189
+ return null;
1190
+ const f = (l == null ? void 0 : l.previous) ?? c("navigation.previous"), b = (l == null ? void 0 : l.next) ?? c("navigation.next");
1191
+ return /* @__PURE__ */ S(g, { justifyItems: "space-between", padding: "small none", children: [
1192
+ t ? /* @__PURE__ */ r(
1193
+ P,
1194
+ {
1195
+ renderIcon: () => /* @__PURE__ */ r(Yt, {}),
1196
+ onClick: o,
1197
+ "aria-label": `${f}: ${t.title}`,
1198
+ children: f
1199
+ }
1200
+ ) : /* @__PURE__ */ r("div", {}),
1201
+ i ? /* @__PURE__ */ r(
1202
+ P,
1203
+ {
1204
+ renderIcon: () => /* @__PURE__ */ r(Xt, {}),
1205
+ onClick: a,
1206
+ "aria-label": `${b}: ${i.title}`,
1207
+ children: b
1208
+ }
1209
+ ) : /* @__PURE__ */ r("div", {})
1210
+ ] });
1211
+ }
1212
+ function Ci(t) {
1213
+ switch (t) {
1214
+ case "Assignment":
1215
+ return /* @__PURE__ */ r(vn, {});
1216
+ case "Quiz":
1217
+ return /* @__PURE__ */ r(wn, {});
1218
+ case "Discussion":
1219
+ return /* @__PURE__ */ r(Rn, {});
1220
+ case "Page":
1221
+ return /* @__PURE__ */ r(kt, {});
1222
+ case "ExternalUrl":
1223
+ case "ExternalTool":
1224
+ return /* @__PURE__ */ r(Dn, {});
1225
+ default:
1226
+ return /* @__PURE__ */ r(kt, {});
1227
+ }
1228
+ }
1229
+ function Di({
1230
+ item: t,
1231
+ isSelected: i,
1232
+ isLoadingItem: o,
1233
+ onClick: a
1234
+ }) {
1235
+ var u, p, _, D, I;
1236
+ const { t: l } = B("assignment-review"), c = ((u = t.content_details) == null ? void 0 : u.locked_for_user) ?? !1, f = (p = t.content_details) == null ? void 0 : p.lock_explanation, b = /* @__PURE__ */ r(
1237
+ Z,
1238
+ {
1239
+ as: "div",
1240
+ padding: "small",
1241
+ background: i ? "secondary" : "primary",
1242
+ borderRadius: "small",
1243
+ cursor: c ? "not-allowed" : "pointer",
1244
+ onClick: c ? void 0 : a,
1245
+ role: c ? void 0 : "button",
1246
+ tabIndex: c ? void 0 : 0,
1247
+ onKeyDown: c ? void 0 : (A) => {
1248
+ (A.key === "Enter" || A.key === " ") && (A.preventDefault(), a());
1249
+ },
1250
+ children: /* @__PURE__ */ S(g, { gap: "small", alignItems: "center", children: [
1251
+ /* @__PURE__ */ r(g.Item, { children: c ? /* @__PURE__ */ r(Kt, {}) : Ci(t.type) }),
1252
+ /* @__PURE__ */ r(g.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ S(g, { direction: "column", gap: "xx-small", children: [
1253
+ /* @__PURE__ */ r(y, { weight: i ? "bold" : "normal", size: "small", children: t.title }),
1254
+ ((_ = t.content_details) == null ? void 0 : _.due_at) && /* @__PURE__ */ r(y, { size: "x-small", color: "secondary", children: l("progress.dueDate", "Due {{date}}", {
1255
+ date: new Date(t.content_details.due_at).toLocaleDateString()
1256
+ }) }),
1257
+ ((D = t.content_details) == null ? void 0 : D.points_possible) != null && /* @__PURE__ */ r(y, { size: "x-small", color: "secondary", children: l("progress.points", "{{points}} pts", {
1258
+ points: t.content_details.points_possible
1259
+ }) })
1260
+ ] }) }),
1261
+ o && /* @__PURE__ */ r(ct, { size: "x-small", renderTitle: l("progress.loading", "Loading") }),
1262
+ ((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ r(y, { color: "success", size: "small", children: "✓" })
1263
+ ] })
1264
+ }
1265
+ );
1266
+ return c && f ? /* @__PURE__ */ r(Pn, { renderTip: f, placement: "end", children: b }) : b;
1267
+ }
1268
+ function ar({
1269
+ module: t,
1270
+ currentItemId: i,
1271
+ onItemClick: o,
1272
+ onClose: a,
1273
+ onNavigateModule: l,
1274
+ hasPrevModule: c = !1,
1275
+ hasNextModule: f = !1,
1276
+ isLoading: b = !1,
1277
+ title: u
1278
+ }) {
1279
+ var D;
1280
+ const { t: p } = B("assignment-review"), _ = u ?? p("navigation.myProgress");
1281
+ return /* @__PURE__ */ S(g, { direction: "column", height: "100%", children: [
1282
+ /* @__PURE__ */ S(g, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
1283
+ /* @__PURE__ */ r(qt, { level: "h3", children: _ }),
1284
+ /* @__PURE__ */ r(
1285
+ kn,
1286
+ {
1287
+ screenReaderLabel: p("navigation.closePanel", "Close"),
1288
+ onClick: a,
1289
+ size: "small",
1290
+ children: /* @__PURE__ */ r(Cn, {})
1291
+ }
1292
+ )
1293
+ ] }),
1294
+ /* @__PURE__ */ S(Z, { as: "div", padding: "none small", overflowY: "auto", children: [
1295
+ t.state === "locked" && /* @__PURE__ */ r(g, { padding: "none none small", children: /* @__PURE__ */ S(lt, { color: "warning", children: [
1296
+ /* @__PURE__ */ r(Kt, {}),
1297
+ " ",
1298
+ p("progress.locked", "Locked")
1299
+ ] }) }),
1300
+ /* @__PURE__ */ r(y, { weight: "bold", size: "medium", children: t.name }),
1301
+ /* @__PURE__ */ r(g, { direction: "column", gap: "xx-small", padding: "small none", children: (D = t.items) == null ? void 0 : D.map((I) => /* @__PURE__ */ r(
1302
+ Di,
1303
+ {
1304
+ item: I,
1305
+ isSelected: I.id === i,
1306
+ isLoadingItem: b && I.id === i,
1307
+ onClick: () => o(I)
1308
+ },
1309
+ I.id
1310
+ )) })
1311
+ ] }),
1312
+ l && /* @__PURE__ */ S(g, { justifyItems: "space-between", padding: "small", children: [
1313
+ /* @__PURE__ */ r(
1314
+ P,
1315
+ {
1316
+ renderIcon: () => /* @__PURE__ */ r(Yt, {}),
1317
+ size: "small",
1318
+ interaction: c ? "enabled" : "disabled",
1319
+ onClick: () => l("prev"),
1320
+ "aria-label": p("navigation.previousModule", "Previous module"),
1321
+ children: p("navigation.previous")
1322
+ }
1323
+ ),
1324
+ /* @__PURE__ */ r(
1325
+ P,
1326
+ {
1327
+ renderIcon: () => /* @__PURE__ */ r(Xt, {}),
1328
+ size: "small",
1329
+ interaction: f ? "enabled" : "disabled",
1330
+ onClick: () => l("next"),
1331
+ "aria-label": p("navigation.nextModule", "Next module"),
1332
+ children: p("navigation.next")
1333
+ }
1334
+ )
1335
+ ] })
1336
+ ] });
1337
+ }
1338
+ const Ri = J`
1339
+ mutation CreateSubmissionComment(
1340
+ $id: ID!
1341
+ $submissionAttempt: Int!
1342
+ $comment: String!
1343
+ $fileIds: [ID!]
1344
+ $mediaObjectId: ID
1345
+ $mediaObjectType: String
1346
+ $reviewerSubmissionId: ID
1347
+ ) {
1348
+ createSubmissionComment(
1349
+ input: {
1350
+ submissionId: $id
1351
+ attempt: $submissionAttempt
1352
+ comment: $comment
1353
+ fileIds: $fileIds
1354
+ mediaObjectId: $mediaObjectId
1355
+ mediaObjectType: $mediaObjectType
1356
+ reviewerSubmissionId: $reviewerSubmissionId
1357
+ }
1358
+ ) {
1359
+ submissionComment {
1360
+ ...SubmissionHtmlComment
1361
+ }
1362
+ errors {
1363
+ ...Error
1364
+ }
1365
+ }
1366
+ }
1367
+
1368
+ fragment Error on ValidationError {
1369
+ attribute
1370
+ message
1371
+ }
1372
+
1373
+ fragment SubmissionHtmlComment on SubmissionComment {
1374
+ _id
1375
+ attachments {
1376
+ ...SubmissionCommentFile
1377
+ }
1378
+ author {
1379
+ ...SubmissionCommentAuthor
1380
+ }
1381
+ htmlComment
1382
+ mediaObject {
1383
+ ...MediaObject
1384
+ }
1385
+ read
1386
+ updatedAt
1387
+ }
1388
+
1389
+ fragment MediaObject on MediaObject {
1390
+ id
1391
+ _id
1392
+ mediaSources {
1393
+ ...MediaSource
1394
+ }
1395
+ mediaTracks {
1396
+ ...MediaTrack
1397
+ }
1398
+ mediaType
1399
+ title
1400
+ }
1401
+
1402
+ fragment MediaSource on MediaSource {
1403
+ height
1404
+ src: url
1405
+ type: contentType
1406
+ width
1407
+ }
1408
+
1409
+ fragment MediaTrack on MediaTrack {
1410
+ _id
1411
+ locale
1412
+ content
1413
+ kind
1414
+ }
1415
+
1416
+ fragment SubmissionCommentAuthor on User {
1417
+ avatarUrl
1418
+ shortName
1419
+ }
1420
+
1421
+ fragment SubmissionCommentFile on File {
1422
+ _id
1423
+ displayName
1424
+ id
1425
+ mimeClass
1426
+ url
1427
+ }
1428
+ `, wi = J`
1429
+ mutation MarkSubmissionCommentsRead(
1430
+ $submissionId: ID!
1431
+ $submissionCommentIds: [ID!]!
1432
+ ) {
1433
+ markSubmissionCommentsRead(
1434
+ input: {
1435
+ submissionCommentIds: $submissionCommentIds
1436
+ submissionId: $submissionId
1437
+ }
1438
+ ) {
1439
+ errors {
1440
+ attribute
1441
+ message
1442
+ }
1443
+ }
1444
+ }
1445
+ `, lr = J`
1446
+ mutation CreateSubmission(
1447
+ $assignmentLid: ID!
1448
+ $submissionType: OnlineSubmissionType!
1449
+ $body: String
1450
+ $fileIds: [ID!]
1451
+ ) {
1452
+ createSubmission(
1453
+ input: {
1454
+ assignmentLid: $assignmentLid
1455
+ submissionType: $submissionType
1456
+ body: $body
1457
+ fileIds: $fileIds
1458
+ }
1459
+ ) {
1460
+ submission {
1461
+ _id
1462
+ createdAt
1463
+ attempt
1464
+ submittedAt
1465
+ score
1466
+ }
1467
+ errors {
1468
+ attribute
1469
+ message
1470
+ }
1471
+ }
1472
+ }
1473
+ `, cr = J`
1474
+ mutation CreateSubmissionDraft(
1475
+ $submissionId: ID!
1476
+ $submissionType: DraftableSubmissionType!
1477
+ $attempt: Int!
1478
+ $body: String
1479
+ $fileIds: [ID!]
1480
+ ) {
1481
+ createSubmissionDraft(
1482
+ input: {
1483
+ submissionId: $submissionId
1484
+ activeSubmissionType: $submissionType
1485
+ attempt: $attempt
1486
+ body: $body
1487
+ fileIds: $fileIds
1488
+ }
1489
+ ) {
1490
+ submissionDraft {
1491
+ _id
1492
+ }
1493
+ errors {
1494
+ attribute
1495
+ message
1496
+ }
1497
+ }
1498
+ }
1499
+ `, mr = J`
1500
+ mutation DeleteSubmissionDraft($submissionId: ID!) {
1501
+ deleteSubmissionDraft(input: { submissionId: $submissionId }) {
1502
+ submissionDraftIds
1503
+ errors {
1504
+ attribute
1505
+ message
1506
+ }
1507
+ }
1508
+ }
1509
+ `;
1510
+ function vi({
1511
+ executeQuery: t
1512
+ }) {
1513
+ const i = Bt();
1514
+ return Wt({
1515
+ mutationFn: async ({ submissionId: o, attempt: a, comment: l, fileIds: c }) => {
1516
+ const f = await t(Ri, {
1517
+ id: o,
1518
+ submissionAttempt: a,
1519
+ comment: l,
1520
+ fileIds: c
1521
+ });
1522
+ return Kn.parse(f), f;
1523
+ },
1524
+ onSuccess: (o, a) => {
1525
+ i.invalidateQueries({
1526
+ queryKey: ["assignment-review", "submission-comments", a.submissionId]
1527
+ });
1528
+ }
535
1529
  });
536
1530
  }
537
- function L({
538
- submissionId: n,
1531
+ function Li({
1532
+ submissionId: t,
539
1533
  courseId: i,
540
- pageParams: s,
541
- direction: t,
542
- executeQuery: o,
543
- enabled: a
1534
+ pageParams: o,
1535
+ direction: a,
1536
+ executeQuery: l,
1537
+ enabled: c
544
1538
  }) {
545
- return l({
1539
+ return Ue({
546
1540
  queryKey: [
547
1541
  "assignment-review",
548
1542
  "submission-comments",
549
- n,
1543
+ t,
550
1544
  i,
551
- s == null ? void 0 : s.startCursor,
552
- s == null ? void 0 : s.endCursor,
553
- t
1545
+ o == null ? void 0 : o.startCursor,
1546
+ o == null ? void 0 : o.endCursor,
1547
+ a
554
1548
  ],
555
1549
  queryFn: async () => {
556
- const r = await o(T, {
557
- submissionId: n,
1550
+ const f = await l(jn, {
1551
+ submissionId: t,
558
1552
  courseId: i,
559
- beforeCursor: t === "prev" ? (s == null ? void 0 : s.startCursor) ?? null : null,
560
- afterCursor: t === "next" ? (s == null ? void 0 : s.endCursor) ?? null : null,
561
- first: t === "next" ? 5 : null,
562
- last: t === "prev" || !t ? 5 : null
563
- }), d = v.parse(r);
1553
+ beforeCursor: a === "prev" ? (o == null ? void 0 : o.startCursor) ?? null : null,
1554
+ afterCursor: a === "next" ? (o == null ? void 0 : o.endCursor) ?? null : null,
1555
+ first: a === "next" ? 5 : null,
1556
+ last: a === "prev" || !a ? 5 : null
1557
+ }), b = qn.parse(f);
564
1558
  return {
565
- comments: [...d.submissionComments.commentsConnection.nodes].sort(
566
- (C, p) => new Date(C.createdAt).getTime() - new Date(p.createdAt).getTime()
1559
+ comments: [...b.submissionComments.commentsConnection.nodes].sort(
1560
+ (p, _) => new Date(p.createdAt).getTime() - new Date(_.createdAt).getTime()
567
1561
  ),
568
- pageInfo: d.submissionComments.commentsConnection.pageInfo
1562
+ pageInfo: b.submissionComments.commentsConnection.pageInfo
569
1563
  };
570
1564
  },
571
- enabled: a ?? !!n
1565
+ enabled: c ?? !!t
572
1566
  });
573
1567
  }
574
- function V({
575
- submissionId: n,
576
- executeQuery: i,
577
- enabled: s = !0
1568
+ function Ni({
1569
+ executeQuery: t
578
1570
  }) {
579
- return l({
580
- queryKey: ["assignment-review", "submissions", n],
581
- queryFn: async () => {
582
- const t = await i(h, { submissionId: n });
583
- return M.parse(t).node.submissionHistoriesConnection.nodes.slice().sort(
584
- (a, r) => new Date(r.submittedAt).getTime() - new Date(a.submittedAt).getTime()
1571
+ const i = Bt();
1572
+ return Wt({
1573
+ mutationFn: async ({ submissionId: o, submissionCommentIds: a }) => {
1574
+ const l = await t(
1575
+ wi,
1576
+ { submissionId: o, submissionCommentIds: a }
585
1577
  );
1578
+ return Vn.parse(l), l;
586
1579
  },
587
- enabled: s
588
- });
589
- }
590
- function z({
591
- executeQuery: n
592
- }) {
593
- const i = c();
594
- return g({
595
- mutationFn: async ({ submissionId: s, submissionCommentIds: t }) => {
596
- const o = await n(
597
- f,
598
- { submissionId: s, submissionCommentIds: t }
599
- );
600
- return O.parse(o), o;
601
- },
602
- onSuccess: (s, t) => {
1580
+ onSuccess: (o, a) => {
603
1581
  i.invalidateQueries({
604
1582
  queryKey: ["assignment-review", "assignment"],
605
- predicate: (o) => o.queryKey.includes(t.assignmentId)
1583
+ predicate: (l) => l.queryKey.includes(a.assignmentId)
606
1584
  });
607
1585
  }
608
1586
  });
609
1587
  }
1588
+ function ur({
1589
+ submissionId: t,
1590
+ courseId: i,
1591
+ assignmentId: o,
1592
+ attempt: a,
1593
+ canPostComment: l,
1594
+ onCommentPosted: c,
1595
+ renderHTML: f,
1596
+ executeQuery: b
1597
+ }) {
1598
+ const { t: u } = B("assignment-review"), [p, _] = Fe(""), [D, I] = Fe({}), A = On(/* @__PURE__ */ new Set()), { data: T, isLoading: me, isError: ye } = Li({
1599
+ submissionId: t,
1600
+ courseId: i,
1601
+ pageParams: D.pageParams,
1602
+ direction: D.direction,
1603
+ executeQuery: b
1604
+ }), Ae = vi({ executeQuery: b }), Ee = Ni({ executeQuery: b });
1605
+ Mn(() => {
1606
+ if (!(T != null && T.comments) || T.comments.length === 0) return;
1607
+ const z = T.comments.filter(($) => !$.read && !A.current.has($._id)).filter(($) => {
1608
+ var Ie;
1609
+ return !((Ie = $.author.courseRoles) != null && Ie.includes("StudentEnrollment"));
1610
+ }).map(($) => $._id);
1611
+ if (z.length > 0) {
1612
+ for (const $ of z)
1613
+ A.current.add($);
1614
+ Ee.mutate({ submissionId: t, assignmentId: o, submissionCommentIds: z });
1615
+ }
1616
+ }, [T == null ? void 0 : T.comments, t, o, Ee]);
1617
+ const ie = T == null ? void 0 : T.comments.some(
1618
+ (z) => {
1619
+ var $;
1620
+ return !(($ = z.author.courseRoles) != null && $.includes("StudentEnrollment"));
1621
+ }
1622
+ ), L = () => {
1623
+ p.trim() && Ae.mutate(
1624
+ { submissionId: t, attempt: a, comment: p },
1625
+ {
1626
+ onSuccess: () => {
1627
+ _(""), c == null || c();
1628
+ }
1629
+ }
1630
+ );
1631
+ }, ee = (T == null ? void 0 : T.pageInfo.hasNextPage) || (T == null ? void 0 : T.pageInfo.hasPreviousPage);
1632
+ return me || !T && !ye ? /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(ct, { renderTitle: u("comments.panelTitle"), size: "small" }) }) : ye ? /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(y, { color: "danger", children: u("comments.loadError", "Failed to load comments") }) }) : /* @__PURE__ */ S(g, { as: "div", direction: "column", justifyItems: "space-between", height: "100%", children: [
1633
+ /* @__PURE__ */ S(g, { as: "div", direction: "column", children: [
1634
+ T.comments.length === 0 ? /* @__PURE__ */ r(g, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(y, { color: "secondary", children: u("comments.empty") }) }) : /* @__PURE__ */ r(g, { direction: "column", gap: "x-small", children: T.comments.map((z) => /* @__PURE__ */ r(
1635
+ Ai,
1636
+ {
1637
+ comment: z,
1638
+ isFullWidth: !ie,
1639
+ renderHTML: f
1640
+ },
1641
+ z._id
1642
+ )) }),
1643
+ ee && /* @__PURE__ */ S(g, { justifyItems: "space-between", padding: "small none", children: [
1644
+ /* @__PURE__ */ r(
1645
+ P,
1646
+ {
1647
+ renderIcon: () => /* @__PURE__ */ r(Ln, {}),
1648
+ size: "small",
1649
+ interaction: T.pageInfo.hasPreviousPage ? "enabled" : "disabled",
1650
+ onClick: () => I({ pageParams: T.pageInfo, direction: "prev" }),
1651
+ children: u("comments.previousComments")
1652
+ }
1653
+ ),
1654
+ /* @__PURE__ */ r(
1655
+ P,
1656
+ {
1657
+ renderIcon: () => /* @__PURE__ */ r(Nn, {}),
1658
+ size: "small",
1659
+ interaction: T.pageInfo.hasNextPage ? "enabled" : "disabled",
1660
+ onClick: () => I({ pageParams: T.pageInfo, direction: "next" }),
1661
+ children: u("comments.nextComments")
1662
+ }
1663
+ )
1664
+ ] })
1665
+ ] }),
1666
+ l && /* @__PURE__ */ S(g, { as: "div", direction: "column", gap: "small", padding: "small none medium", children: [
1667
+ /* @__PURE__ */ r(
1668
+ Qt,
1669
+ {
1670
+ resize: "vertical",
1671
+ label: /* @__PURE__ */ r(y, { weight: "bold", size: "medium", children: u("comments.placeholder") }),
1672
+ value: p,
1673
+ onChange: (z) => _(z.target.value)
1674
+ }
1675
+ ),
1676
+ /* @__PURE__ */ r(
1677
+ P,
1678
+ {
1679
+ color: "primary",
1680
+ onClick: L,
1681
+ interaction: p.trim().length > 0 && !Ae.isPending ? "enabled" : "disabled",
1682
+ children: u("comments.post")
1683
+ }
1684
+ )
1685
+ ] })
1686
+ ] });
1687
+ }
1688
+ function dr({
1689
+ existingDraft: t,
1690
+ onSubmit: i,
1691
+ onSaveDraft: o,
1692
+ onDiscardDraft: a,
1693
+ isSubmitting: l = !1
1694
+ }) {
1695
+ const { t: c } = B("assignment-review"), [f, b] = Fe(t ?? ""), u = f.trim().length > 0 && !l;
1696
+ return /* @__PURE__ */ S(g, { direction: "column", gap: "medium", children: [
1697
+ /* @__PURE__ */ r(
1698
+ Qt,
1699
+ {
1700
+ label: c("submission.textHeading"),
1701
+ value: f,
1702
+ onChange: (p) => b(p.target.value),
1703
+ resize: "vertical",
1704
+ height: "200px"
1705
+ }
1706
+ ),
1707
+ /* @__PURE__ */ S(g, { gap: "small", children: [
1708
+ /* @__PURE__ */ r(
1709
+ P,
1710
+ {
1711
+ color: "primary",
1712
+ onClick: () => i(f),
1713
+ interaction: u ? "enabled" : "disabled",
1714
+ children: c("submissionForm.submit")
1715
+ }
1716
+ ),
1717
+ o && /* @__PURE__ */ r(
1718
+ P,
1719
+ {
1720
+ onClick: () => o(f),
1721
+ interaction: f.trim().length > 0 ? "enabled" : "disabled",
1722
+ children: c("submissionForm.saveDraft")
1723
+ }
1724
+ ),
1725
+ a && t && /* @__PURE__ */ r(P, { color: "primary-inverse", onClick: a, children: c("submissionForm.discardDraft") })
1726
+ ] })
1727
+ ] });
1728
+ }
1729
+ function fr({
1730
+ unreadCount: t
1731
+ }) {
1732
+ const { t: i } = B("assignment-review");
1733
+ if (t === 0)
1734
+ return null;
1735
+ const o = t === 1 ? i("comments.unreadSingle") : i("comments.unread", { count: t });
1736
+ return /* @__PURE__ */ r(Zt, { count: t, standalone: !0, children: /* @__PURE__ */ r(mt, { children: o }) });
1737
+ }
1738
+ function pr({
1739
+ courseId: t,
1740
+ assignmentId: i,
1741
+ userId: o,
1742
+ executeQuery: a,
1743
+ enabled: l = !0
1744
+ }) {
1745
+ return Ue({
1746
+ queryKey: ["assignment-review", "assignment", t, i, o],
1747
+ queryFn: async () => {
1748
+ const c = await a(zn, {
1749
+ courseId: t,
1750
+ assignmentId: i,
1751
+ userId: o
1752
+ }), f = Wn.parse(c);
1753
+ return {
1754
+ ...f.legacyNode,
1755
+ courseName: f.course.name
1756
+ };
1757
+ },
1758
+ enabled: l
1759
+ });
1760
+ }
1761
+ function gr({
1762
+ courseId: t,
1763
+ moduleItemId: i,
1764
+ fetchSequence: o,
1765
+ enabled: a = !0
1766
+ }) {
1767
+ return Ue({
1768
+ queryKey: ["assignment-review", "module-item-sequence", t, i],
1769
+ queryFn: () => o(t, i),
1770
+ enabled: a && !!i
1771
+ });
1772
+ }
610
1773
  export {
611
- _ as AssignmentResponseSchema,
612
- q as CREATE_SUBMISSION,
613
- I as CREATE_SUBMISSION_COMMENT,
614
- k as CREATE_SUBMISSION_DRAFT,
615
- w as CreateSubmissionCommentResponseSchema,
616
- x as CreateSubmissionDraftResponseSchema,
617
- Z as CreateSubmissionResponseSchema,
618
- G as DELETE_SUBMISSION_DRAFT,
619
- K as DeleteSubmissionDraftResponseSchema,
620
- $ as GET_ASSIGNMENT,
621
- h as GET_SUBMISSIONS,
622
- T as GET_SUBMISSION_COMMENTS,
623
- f as MARK_SUBMISSION_COMMENTS_READ,
624
- O as MarkSubmissionCommentsReadResponseSchema,
625
- B as SubmissionCommentsDataSchema,
626
- v as SubmissionCommentsQueryResponseSchema,
627
- M as SubmissionsQueryResponseSchema,
628
- H as useCreateSubmissionComment,
629
- Q as useGetAssignment,
630
- L as useGetSubmissionComments,
631
- V as useGetSubmissions,
632
- z as useMarkSubmissionCommentsRead
1774
+ Wn as AssignmentResponseSchema,
1775
+ Un as AttemptCard,
1776
+ ir as AttemptView,
1777
+ nr as AttemptsHistory,
1778
+ lr as CREATE_SUBMISSION,
1779
+ Ri as CREATE_SUBMISSION_COMMENT,
1780
+ cr as CREATE_SUBMISSION_DRAFT,
1781
+ Ai as CommentCard,
1782
+ Kn as CreateSubmissionCommentResponseSchema,
1783
+ er as CreateSubmissionDraftResponseSchema,
1784
+ Ji as CreateSubmissionResponseSchema,
1785
+ mr as DELETE_SUBMISSION_DRAFT,
1786
+ tr as DeleteSubmissionDraftResponseSchema,
1787
+ an as DownloadButtons,
1788
+ rr as FileUploadSubmissionForm,
1789
+ zn as GET_ASSIGNMENT,
1790
+ $n as GET_SUBMISSIONS,
1791
+ jn as GET_SUBMISSION_COMMENTS,
1792
+ or as LearningContentHeader,
1793
+ wi as MARK_SUBMISSION_COMMENTS_READ,
1794
+ Vn as MarkSubmissionCommentsReadResponseSchema,
1795
+ sr as ModuleNavigation,
1796
+ ar as MyProgressPanel,
1797
+ ur as SubmissionComments,
1798
+ Qi as SubmissionCommentsDataSchema,
1799
+ qn as SubmissionCommentsQueryResponseSchema,
1800
+ Xn as SubmissionsQueryResponseSchema,
1801
+ dr as TextEntrySubmissionForm,
1802
+ fr as UnreadCommentsBadge,
1803
+ vi as useCreateSubmissionComment,
1804
+ pr as useGetAssignment,
1805
+ Li as useGetSubmissionComments,
1806
+ Zn as useGetSubmissions,
1807
+ Ni as useMarkSubmissionCommentsRead,
1808
+ gr as useModuleItemSequence
633
1809
  };