@instructure/platform-assignment-review 0.4.15 → 0.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +748 -698
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import { Flex as b } from "@instructure/ui-flex";
|
|
|
4
4
|
import { Heading as St } from "@instructure/ui-heading";
|
|
5
5
|
import { Spinner as Ye } from "@instructure/ui-spinner";
|
|
6
6
|
import { Text as _ } from "@instructure/ui-text";
|
|
7
|
-
import { View as
|
|
7
|
+
import { View as Z } from "@instructure/ui-view";
|
|
8
8
|
import { useQuery as Ve, useQueryClient as un, useMutation as dn } from "@tanstack/react-query";
|
|
9
9
|
import ae from "graphql-tag";
|
|
10
|
-
import { z as
|
|
10
|
+
import { z as o } from "zod";
|
|
11
11
|
import { Pill as _t } from "@instructure/ui-pill";
|
|
12
12
|
import { IconDownloadLine as Hn, IconCheckMarkSolid as $n, IconArrowStartLine as Bn, IconArrowEndLine as Gn, IconTrashLine as Wn, IconArrowOpenStartLine as fn, IconArrowOpenEndLine as pn, IconXLine as qn, IconLockLine as gn, IconDocumentLine as Kt, IconLinkLine as Yn, IconDiscussionLine as Vn, IconQuizLine as Xn, IconAssignmentLine as Kn } from "@instructure/ui-icons";
|
|
13
13
|
import { ScreenReaderContent as Et } from "@instructure/ui-a11y-content";
|
|
@@ -19,56 +19,56 @@ import { Badge as Tn } from "@instructure/ui-badge";
|
|
|
19
19
|
import { Tooltip as Jn } from "@instructure/ui-tooltip";
|
|
20
20
|
const yn = Fn(void 0);
|
|
21
21
|
function Fo({
|
|
22
|
-
translations:
|
|
22
|
+
translations: t,
|
|
23
23
|
children: n
|
|
24
24
|
}) {
|
|
25
|
-
return /* @__PURE__ */ r(yn.Provider, { value:
|
|
25
|
+
return /* @__PURE__ */ r(yn.Provider, { value: t, children: n });
|
|
26
26
|
}
|
|
27
27
|
function q() {
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
28
|
+
const t = Un(yn);
|
|
29
|
+
if (!t)
|
|
30
30
|
throw new Error("useTranslations must be used within TranslationsProvider");
|
|
31
|
-
return
|
|
31
|
+
return t;
|
|
32
32
|
}
|
|
33
33
|
/*! @license DOMPurify 3.4.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.5/LICENSE */
|
|
34
|
-
function Zt(
|
|
35
|
-
(n == null || n >
|
|
36
|
-
for (var
|
|
37
|
-
return
|
|
34
|
+
function Zt(t, n) {
|
|
35
|
+
(n == null || n > t.length) && (n = t.length);
|
|
36
|
+
for (var i = 0, s = Array(n); i < n; i++) s[i] = t[i];
|
|
37
|
+
return s;
|
|
38
38
|
}
|
|
39
|
-
function ei(
|
|
40
|
-
if (Array.isArray(
|
|
39
|
+
function ei(t) {
|
|
40
|
+
if (Array.isArray(t)) return t;
|
|
41
41
|
}
|
|
42
|
-
function ti(
|
|
43
|
-
var
|
|
44
|
-
if (
|
|
45
|
-
var
|
|
42
|
+
function ti(t, n) {
|
|
43
|
+
var i = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
44
|
+
if (i != null) {
|
|
45
|
+
var s, l, c, d, p = [], m = !0, f = !1;
|
|
46
46
|
try {
|
|
47
|
-
if (c = (
|
|
47
|
+
if (c = (i = i.call(t)).next, n !== 0) for (; !(m = (s = c.call(i)).done) && (p.push(s.value), p.length !== n); m = !0) ;
|
|
48
48
|
} catch (h) {
|
|
49
|
-
|
|
49
|
+
f = !0, l = h;
|
|
50
50
|
} finally {
|
|
51
51
|
try {
|
|
52
|
-
if (!m &&
|
|
52
|
+
if (!m && i.return != null && (d = i.return(), Object(d) !== d)) return;
|
|
53
53
|
} finally {
|
|
54
|
-
if (
|
|
54
|
+
if (f) throw l;
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return p;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
function ni() {
|
|
61
61
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
62
62
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
63
63
|
}
|
|
64
|
-
function ii(
|
|
65
|
-
return ei(
|
|
64
|
+
function ii(t, n) {
|
|
65
|
+
return ei(t) || ti(t, n) || oi(t, n) || ni();
|
|
66
66
|
}
|
|
67
|
-
function oi(
|
|
68
|
-
if (
|
|
69
|
-
if (typeof
|
|
70
|
-
var
|
|
71
|
-
return
|
|
67
|
+
function oi(t, n) {
|
|
68
|
+
if (t) {
|
|
69
|
+
if (typeof t == "string") return Zt(t, n);
|
|
70
|
+
var i = {}.toString.call(t).slice(8, -1);
|
|
71
|
+
return i === "Object" && t.constructor && (i = t.constructor.name), i === "Map" || i === "Set" ? Array.from(t) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Zt(t, n) : void 0;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
const An = Object.entries, Qt = Object.setPrototypeOf, ri = Object.isFrozen, si = Object.getPrototypeOf, ai = Object.getOwnPropertyDescriptor;
|
|
@@ -79,109 +79,109 @@ B || (B = function(n) {
|
|
|
79
79
|
Y || (Y = function(n) {
|
|
80
80
|
return n;
|
|
81
81
|
});
|
|
82
|
-
yt || (yt = function(n,
|
|
83
|
-
for (var
|
|
82
|
+
yt || (yt = function(n, i) {
|
|
83
|
+
for (var s = arguments.length, l = new Array(s > 2 ? s - 2 : 0), c = 2; c < s; c++)
|
|
84
84
|
l[c - 2] = arguments[c];
|
|
85
|
-
return n.apply(
|
|
85
|
+
return n.apply(i, l);
|
|
86
86
|
});
|
|
87
87
|
At || (At = function(n) {
|
|
88
|
-
for (var
|
|
89
|
-
|
|
90
|
-
return new n(...
|
|
88
|
+
for (var i = arguments.length, s = new Array(i > 1 ? i - 1 : 0), l = 1; l < i; l++)
|
|
89
|
+
s[l - 1] = arguments[l];
|
|
90
|
+
return new n(...s);
|
|
91
91
|
});
|
|
92
92
|
const Te = x(Array.prototype.forEach), li = x(Array.prototype.lastIndexOf), Jt = x(Array.prototype.pop), ye = x(Array.prototype.push), ci = x(Array.prototype.splice), H = Array.isArray, Ne = x(String.prototype.toLowerCase), dt = x(String.prototype.toString), en = x(String.prototype.match), Ae = x(String.prototype.replace), tn = x(String.prototype.indexOf), mi = x(String.prototype.trim), ui = x(Number.prototype.toString), di = x(Boolean.prototype.toString), nn = typeof BigInt > "u" ? null : x(BigInt.prototype.toString), on = typeof Symbol > "u" ? null : x(Symbol.prototype.toString), D = x(Object.prototype.hasOwnProperty), Oe = x(Object.prototype.toString), z = x(RegExp.prototype.test), Ge = fi(TypeError);
|
|
93
|
-
function x(
|
|
93
|
+
function x(t) {
|
|
94
94
|
return function(n) {
|
|
95
95
|
n instanceof RegExp && (n.lastIndex = 0);
|
|
96
|
-
for (var
|
|
97
|
-
|
|
98
|
-
return yt(
|
|
96
|
+
for (var i = arguments.length, s = new Array(i > 1 ? i - 1 : 0), l = 1; l < i; l++)
|
|
97
|
+
s[l - 1] = arguments[l];
|
|
98
|
+
return yt(t, n, s);
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function fi(
|
|
101
|
+
function fi(t) {
|
|
102
102
|
return function() {
|
|
103
|
-
for (var n = arguments.length,
|
|
104
|
-
|
|
105
|
-
return At(
|
|
103
|
+
for (var n = arguments.length, i = new Array(n), s = 0; s < n; s++)
|
|
104
|
+
i[s] = arguments[s];
|
|
105
|
+
return At(t, i);
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
-
function T(
|
|
109
|
-
let
|
|
110
|
-
if (Qt && Qt(
|
|
111
|
-
return
|
|
112
|
-
let
|
|
113
|
-
for (;
|
|
114
|
-
let l = n[
|
|
108
|
+
function T(t, n) {
|
|
109
|
+
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ne;
|
|
110
|
+
if (Qt && Qt(t, null), !H(n))
|
|
111
|
+
return t;
|
|
112
|
+
let s = n.length;
|
|
113
|
+
for (; s--; ) {
|
|
114
|
+
let l = n[s];
|
|
115
115
|
if (typeof l == "string") {
|
|
116
|
-
const c =
|
|
117
|
-
c !== l && (ri(n) || (n[
|
|
116
|
+
const c = i(l);
|
|
117
|
+
c !== l && (ri(n) || (n[s] = c), l = c);
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
t[l] = !0;
|
|
120
120
|
}
|
|
121
|
-
return
|
|
121
|
+
return t;
|
|
122
122
|
}
|
|
123
|
-
function pi(
|
|
124
|
-
for (let n = 0; n <
|
|
125
|
-
D(
|
|
126
|
-
return
|
|
123
|
+
function pi(t) {
|
|
124
|
+
for (let n = 0; n < t.length; n++)
|
|
125
|
+
D(t, n) || (t[n] = null);
|
|
126
|
+
return t;
|
|
127
127
|
}
|
|
128
|
-
function W(
|
|
128
|
+
function W(t) {
|
|
129
129
|
const n = _e(null);
|
|
130
|
-
for (const
|
|
131
|
-
var
|
|
132
|
-
const l =
|
|
133
|
-
D(
|
|
130
|
+
for (const s of An(t)) {
|
|
131
|
+
var i = ii(s, 2);
|
|
132
|
+
const l = i[0], c = i[1];
|
|
133
|
+
D(t, l) && (H(c) ? n[l] = pi(c) : c && typeof c == "object" && c.constructor === Object ? n[l] = W(c) : n[l] = c);
|
|
134
134
|
}
|
|
135
135
|
return n;
|
|
136
136
|
}
|
|
137
|
-
function gi(
|
|
138
|
-
switch (typeof
|
|
137
|
+
function gi(t) {
|
|
138
|
+
switch (typeof t) {
|
|
139
139
|
case "string":
|
|
140
|
-
return
|
|
140
|
+
return t;
|
|
141
141
|
case "number":
|
|
142
|
-
return ui(
|
|
142
|
+
return ui(t);
|
|
143
143
|
case "boolean":
|
|
144
|
-
return di(
|
|
144
|
+
return di(t);
|
|
145
145
|
case "bigint":
|
|
146
|
-
return nn ? nn(
|
|
146
|
+
return nn ? nn(t) : "0";
|
|
147
147
|
case "symbol":
|
|
148
|
-
return on ? on(
|
|
148
|
+
return on ? on(t) : "Symbol()";
|
|
149
149
|
case "undefined":
|
|
150
|
-
return Oe(
|
|
150
|
+
return Oe(t);
|
|
151
151
|
case "function":
|
|
152
152
|
case "object": {
|
|
153
|
-
if (
|
|
154
|
-
return Oe(
|
|
155
|
-
const n =
|
|
156
|
-
if (typeof
|
|
157
|
-
const
|
|
158
|
-
return typeof
|
|
153
|
+
if (t === null)
|
|
154
|
+
return Oe(t);
|
|
155
|
+
const n = t, i = de(n, "toString");
|
|
156
|
+
if (typeof i == "function") {
|
|
157
|
+
const s = i(n);
|
|
158
|
+
return typeof s == "string" ? s : Oe(s);
|
|
159
159
|
}
|
|
160
|
-
return Oe(
|
|
160
|
+
return Oe(t);
|
|
161
161
|
}
|
|
162
162
|
default:
|
|
163
|
-
return Oe(
|
|
163
|
+
return Oe(t);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
function de(
|
|
167
|
-
for (;
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
if (
|
|
171
|
-
return x(
|
|
172
|
-
if (typeof
|
|
173
|
-
return x(
|
|
166
|
+
function de(t, n) {
|
|
167
|
+
for (; t !== null; ) {
|
|
168
|
+
const s = ai(t, n);
|
|
169
|
+
if (s) {
|
|
170
|
+
if (s.get)
|
|
171
|
+
return x(s.get);
|
|
172
|
+
if (typeof s.value == "function")
|
|
173
|
+
return x(s.value);
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
t = si(t);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function i() {
|
|
178
178
|
return null;
|
|
179
179
|
}
|
|
180
|
-
return
|
|
180
|
+
return i;
|
|
181
181
|
}
|
|
182
|
-
function hi(
|
|
182
|
+
function hi(t) {
|
|
183
183
|
try {
|
|
184
|
-
return z(
|
|
184
|
+
return z(t, ""), !0;
|
|
185
185
|
} catch {
|
|
186
186
|
return !1;
|
|
187
187
|
}
|
|
@@ -201,13 +201,13 @@ const rn = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
201
201
|
document: 9
|
|
202
202
|
}, Ri = function() {
|
|
203
203
|
return typeof window > "u" ? null : window;
|
|
204
|
-
}, Oi = function(n,
|
|
204
|
+
}, Oi = function(n, i) {
|
|
205
205
|
if (typeof n != "object" || typeof n.createPolicy != "function")
|
|
206
206
|
return null;
|
|
207
|
-
let
|
|
207
|
+
let s = null;
|
|
208
208
|
const l = "data-tt-policy-suffix";
|
|
209
|
-
|
|
210
|
-
const c = "dompurify" + (
|
|
209
|
+
i && i.hasAttribute(l) && (s = i.getAttribute(l));
|
|
210
|
+
const c = "dompurify" + (s ? "#" + s : "");
|
|
211
211
|
try {
|
|
212
212
|
return n.createPolicy(c, {
|
|
213
213
|
createHTML(d) {
|
|
@@ -234,21 +234,21 @@ const rn = B(["a", "abbr", "acronym", "address", "area", "article", "aside", "au
|
|
|
234
234
|
};
|
|
235
235
|
};
|
|
236
236
|
function _n() {
|
|
237
|
-
let
|
|
237
|
+
let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ri();
|
|
238
238
|
const n = (g) => _n(g);
|
|
239
|
-
if (n.version = "3.4.5", n.removed = [], !
|
|
239
|
+
if (n.version = "3.4.5", n.removed = [], !t || !t.document || t.document.nodeType !== Se.document || !t.Element)
|
|
240
240
|
return n.isSupported = !1, n;
|
|
241
|
-
let
|
|
242
|
-
const
|
|
241
|
+
let i = t.document;
|
|
242
|
+
const s = i, l = s.currentScript, c = t.DocumentFragment, d = t.HTMLTemplateElement, p = t.Node, m = t.Element, f = t.NodeFilter, h = t.NamedNodeMap, C = h === void 0 ? t.NamedNodeMap || t.MozNamedAttrMap : h, I = t.HTMLFormElement, w = t.DOMParser, y = t.trustedTypes, V = m.prototype, fe = de(V, "cloneNode"), le = de(V, "remove"), M = de(V, "nextSibling"), ie = de(V, "childNodes"), O = de(V, "parentNode"), ce = p && p.prototype ? de(p.prototype, "nodeType") : null;
|
|
243
243
|
if (typeof d == "function") {
|
|
244
|
-
const g =
|
|
245
|
-
g.content && g.content.ownerDocument && (
|
|
244
|
+
const g = i.createElement("template");
|
|
245
|
+
g.content && g.content.ownerDocument && (i = g.content.ownerDocument);
|
|
246
246
|
}
|
|
247
247
|
let E, N = "";
|
|
248
|
-
const
|
|
248
|
+
const ee = i, Ie = ee.implementation, xe = ee.createNodeIterator, Xe = ee.createDocumentFragment, Ke = ee.getElementsByTagName, Ze = s.importNode;
|
|
249
249
|
let j = mn();
|
|
250
250
|
n.isSupported = typeof An == "function" && typeof O == "function" && Ie && Ie.createHTMLDocument !== void 0;
|
|
251
|
-
const
|
|
251
|
+
const ke = yi, Me = Ai, Pe = Si, Cn = _i, Dn = Ei, Rn = Ii, wt = wi, On = Di;
|
|
252
252
|
let Ct = cn, P = null;
|
|
253
253
|
const Dt = T({}, [...rn, ...ft, ...pt, ...gt, ...sn]);
|
|
254
254
|
let U = null;
|
|
@@ -273,7 +273,7 @@ function _n() {
|
|
|
273
273
|
value: !1
|
|
274
274
|
}
|
|
275
275
|
})), we = null, Fe = null;
|
|
276
|
-
const
|
|
276
|
+
const oe = Object.seal(_e(null, {
|
|
277
277
|
tagCheck: {
|
|
278
278
|
writable: !0,
|
|
279
279
|
configurable: !1,
|
|
@@ -287,191 +287,191 @@ function _n() {
|
|
|
287
287
|
value: null
|
|
288
288
|
}
|
|
289
289
|
}));
|
|
290
|
-
let Ot = !0, Qe = !0, Nt = !1, vt = !0,
|
|
291
|
-
const
|
|
292
|
-
let tt = !0, De = !1, ge = {},
|
|
290
|
+
let Ot = !0, Qe = !0, Nt = !1, vt = !0, re = !1, Ce = !0, me = !1, Je = !1, et = !1, pe = !1, Ue = !1, ze = !1, Lt = !0, xt = !1;
|
|
291
|
+
const kt = "user-content-";
|
|
292
|
+
let tt = !0, De = !1, ge = {}, Q = null;
|
|
293
293
|
const nt = T({}, ["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"]);
|
|
294
|
-
let
|
|
294
|
+
let Mt = null;
|
|
295
295
|
const Pt = T({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
296
296
|
let it = null;
|
|
297
|
-
const Ft = T({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), je = "http://www.w3.org/1998/Math/MathML", He = "http://www.w3.org/2000/svg",
|
|
298
|
-
let he =
|
|
299
|
-
const Nn = T({}, [je, He,
|
|
297
|
+
const Ft = T({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), je = "http://www.w3.org/1998/Math/MathML", He = "http://www.w3.org/2000/svg", J = "http://www.w3.org/1999/xhtml";
|
|
298
|
+
let he = J, ot = !1, rt = null;
|
|
299
|
+
const Nn = T({}, [je, He, J], dt);
|
|
300
300
|
let st = T({}, ["mi", "mo", "mn", "ms", "mtext"]), at = T({}, ["annotation-xml"]);
|
|
301
301
|
const vn = T({}, ["title", "style", "font", "a", "script"]);
|
|
302
302
|
let Re = null;
|
|
303
303
|
const Ln = ["application/xhtml+xml", "text/html"], xn = "text/html";
|
|
304
|
-
let
|
|
305
|
-
const
|
|
306
|
-
return
|
|
304
|
+
let k = null, be = null;
|
|
305
|
+
const kn = i.createElement("form"), Ut = function(e) {
|
|
306
|
+
return e instanceof RegExp || e instanceof Function;
|
|
307
307
|
}, lt = function() {
|
|
308
|
-
let
|
|
309
|
-
if (be && be ===
|
|
308
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
309
|
+
if (be && be === e)
|
|
310
310
|
return;
|
|
311
|
-
(!
|
|
312
|
-
Ln.indexOf(
|
|
313
|
-
const
|
|
314
|
-
if (R = _e(null), D(
|
|
315
|
-
if (typeof
|
|
311
|
+
(!e || typeof e != "object") && (e = {}), e = W(e), Re = // eslint-disable-next-line unicorn/prefer-includes
|
|
312
|
+
Ln.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? xn : e.PARSER_MEDIA_TYPE, k = Re === "application/xhtml+xml" ? dt : Ne, P = D(e, "ALLOWED_TAGS") && H(e.ALLOWED_TAGS) ? T({}, e.ALLOWED_TAGS, k) : Dt, U = D(e, "ALLOWED_ATTR") && H(e.ALLOWED_ATTR) ? T({}, e.ALLOWED_ATTR, k) : Rt, rt = D(e, "ALLOWED_NAMESPACES") && H(e.ALLOWED_NAMESPACES) ? T({}, e.ALLOWED_NAMESPACES, dt) : Nn, it = D(e, "ADD_URI_SAFE_ATTR") && H(e.ADD_URI_SAFE_ATTR) ? T(W(Ft), e.ADD_URI_SAFE_ATTR, k) : Ft, Mt = D(e, "ADD_DATA_URI_TAGS") && H(e.ADD_DATA_URI_TAGS) ? T(W(Pt), e.ADD_DATA_URI_TAGS, k) : Pt, Q = D(e, "FORBID_CONTENTS") && H(e.FORBID_CONTENTS) ? T({}, e.FORBID_CONTENTS, k) : nt, we = D(e, "FORBID_TAGS") && H(e.FORBID_TAGS) ? T({}, e.FORBID_TAGS, k) : W({}), Fe = D(e, "FORBID_ATTR") && H(e.FORBID_ATTR) ? T({}, e.FORBID_ATTR, k) : W({}), ge = D(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? W(e.USE_PROFILES) : e.USE_PROFILES : !1, Ot = e.ALLOW_ARIA_ATTR !== !1, Qe = e.ALLOW_DATA_ATTR !== !1, Nt = e.ALLOW_UNKNOWN_PROTOCOLS || !1, vt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, re = e.SAFE_FOR_TEMPLATES || !1, Ce = e.SAFE_FOR_XML !== !1, me = e.WHOLE_DOCUMENT || !1, pe = e.RETURN_DOM || !1, Ue = e.RETURN_DOM_FRAGMENT || !1, ze = e.RETURN_TRUSTED_TYPE || !1, et = e.FORCE_BODY || !1, Lt = e.SANITIZE_DOM !== !1, xt = e.SANITIZE_NAMED_PROPS || !1, tt = e.KEEP_CONTENT !== !1, De = e.IN_PLACE || !1, Ct = hi(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : cn, he = typeof e.NAMESPACE == "string" ? e.NAMESPACE : J, st = D(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? W(e.MATHML_TEXT_INTEGRATION_POINTS) : T({}, ["mi", "mo", "mn", "ms", "mtext"]), at = D(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? W(e.HTML_INTEGRATION_POINTS) : T({}, ["annotation-xml"]);
|
|
313
|
+
const a = D(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? W(e.CUSTOM_ELEMENT_HANDLING) : _e(null);
|
|
314
|
+
if (R = _e(null), D(a, "tagNameCheck") && Ut(a.tagNameCheck) && (R.tagNameCheck = a.tagNameCheck), D(a, "attributeNameCheck") && Ut(a.attributeNameCheck) && (R.attributeNameCheck = a.attributeNameCheck), D(a, "allowCustomizedBuiltInElements") && typeof a.allowCustomizedBuiltInElements == "boolean" && (R.allowCustomizedBuiltInElements = a.allowCustomizedBuiltInElements), re && (Qe = !1), Ue && (pe = !0), ge && (P = T({}, sn), U = _e(null), ge.html === !0 && (T(P, rn), T(U, an)), ge.svg === !0 && (T(P, ft), T(U, ht), T(U, We)), ge.svgFilters === !0 && (T(P, pt), T(U, ht), T(U, We)), ge.mathMl === !0 && (T(P, gt), T(U, ln), T(U, We))), oe.tagCheck = null, oe.attributeCheck = null, D(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? oe.tagCheck = e.ADD_TAGS : H(e.ADD_TAGS) && (P === Dt && (P = W(P)), T(P, e.ADD_TAGS, k))), D(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? oe.attributeCheck = e.ADD_ATTR : H(e.ADD_ATTR) && (U === Rt && (U = W(U)), T(U, e.ADD_ATTR, k))), D(e, "ADD_URI_SAFE_ATTR") && H(e.ADD_URI_SAFE_ATTR) && T(it, e.ADD_URI_SAFE_ATTR, k), D(e, "FORBID_CONTENTS") && H(e.FORBID_CONTENTS) && (Q === nt && (Q = W(Q)), T(Q, e.FORBID_CONTENTS, k)), D(e, "ADD_FORBID_CONTENTS") && H(e.ADD_FORBID_CONTENTS) && (Q === nt && (Q = W(Q)), T(Q, e.ADD_FORBID_CONTENTS, k)), tt && (P["#text"] = !0), me && T(P, ["html", "head", "body"]), P.table && (T(P, ["tbody"]), delete we.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
315
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
316
316
|
throw Ge('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
317
|
-
if (typeof
|
|
317
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
318
318
|
throw Ge('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
319
|
-
E =
|
|
319
|
+
E = e.TRUSTED_TYPES_POLICY, N = E.createHTML("");
|
|
320
320
|
} else
|
|
321
321
|
E === void 0 && (E = Oi(y, l)), E !== null && typeof N == "string" && (N = E.createHTML(""));
|
|
322
|
-
B && B(
|
|
323
|
-
}, zt = T({}, [...ft, ...pt, ...bi]), jt = T({}, [...gt, ...Ti]),
|
|
324
|
-
let
|
|
325
|
-
(!
|
|
322
|
+
B && B(e), be = e;
|
|
323
|
+
}, zt = T({}, [...ft, ...pt, ...bi]), jt = T({}, [...gt, ...Ti]), Mn = function(e) {
|
|
324
|
+
let a = O(e);
|
|
325
|
+
(!a || !a.tagName) && (a = {
|
|
326
326
|
namespaceURI: he,
|
|
327
327
|
tagName: "template"
|
|
328
328
|
});
|
|
329
|
-
const u = Ne(
|
|
330
|
-
return rt[
|
|
331
|
-
}, X = function(
|
|
329
|
+
const u = Ne(e.tagName), A = Ne(a.tagName);
|
|
330
|
+
return rt[e.namespaceURI] ? e.namespaceURI === He ? a.namespaceURI === J ? u === "svg" : a.namespaceURI === je ? u === "svg" && (A === "annotation-xml" || st[A]) : !!zt[u] : e.namespaceURI === je ? a.namespaceURI === J ? u === "math" : a.namespaceURI === He ? u === "math" && at[A] : !!jt[u] : e.namespaceURI === J ? a.namespaceURI === He && !at[A] || a.namespaceURI === je && !st[A] ? !1 : !jt[u] && (vn[u] || !zt[u]) : !!(Re === "application/xhtml+xml" && rt[e.namespaceURI]) : !1;
|
|
331
|
+
}, X = function(e) {
|
|
332
332
|
ye(n.removed, {
|
|
333
|
-
element:
|
|
333
|
+
element: e
|
|
334
334
|
});
|
|
335
335
|
try {
|
|
336
|
-
O(
|
|
336
|
+
O(e).removeChild(e);
|
|
337
337
|
} catch {
|
|
338
|
-
le(
|
|
338
|
+
le(e);
|
|
339
339
|
}
|
|
340
|
-
}, ue = function(
|
|
340
|
+
}, ue = function(e, a) {
|
|
341
341
|
try {
|
|
342
342
|
ye(n.removed, {
|
|
343
|
-
attribute:
|
|
344
|
-
from:
|
|
343
|
+
attribute: a.getAttributeNode(e),
|
|
344
|
+
from: a
|
|
345
345
|
});
|
|
346
346
|
} catch {
|
|
347
347
|
ye(n.removed, {
|
|
348
348
|
attribute: null,
|
|
349
|
-
from:
|
|
349
|
+
from: a
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
if (
|
|
352
|
+
if (a.removeAttribute(e), e === "is")
|
|
353
353
|
if (pe || Ue)
|
|
354
354
|
try {
|
|
355
|
-
X(
|
|
355
|
+
X(a);
|
|
356
356
|
} catch {
|
|
357
357
|
}
|
|
358
358
|
else
|
|
359
359
|
try {
|
|
360
|
-
|
|
360
|
+
a.setAttribute(e, "");
|
|
361
361
|
} catch {
|
|
362
362
|
}
|
|
363
|
-
}, Ht = function(
|
|
364
|
-
let
|
|
363
|
+
}, Ht = function(e) {
|
|
364
|
+
let a = null, u = null;
|
|
365
365
|
if (et)
|
|
366
|
-
|
|
366
|
+
e = "<remove></remove>" + e;
|
|
367
367
|
else {
|
|
368
|
-
const L = en(
|
|
368
|
+
const L = en(e, /^[\r\n\t ]+/);
|
|
369
369
|
u = L && L[0];
|
|
370
370
|
}
|
|
371
|
-
Re === "application/xhtml+xml" && he ===
|
|
372
|
-
const A = E ? E.createHTML(
|
|
373
|
-
if (he ===
|
|
371
|
+
Re === "application/xhtml+xml" && he === J && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
372
|
+
const A = E ? E.createHTML(e) : e;
|
|
373
|
+
if (he === J)
|
|
374
374
|
try {
|
|
375
|
-
|
|
375
|
+
a = new w().parseFromString(A, Re);
|
|
376
376
|
} catch {
|
|
377
377
|
}
|
|
378
|
-
if (!
|
|
379
|
-
|
|
378
|
+
if (!a || !a.documentElement) {
|
|
379
|
+
a = Ie.createDocument(he, "template", null);
|
|
380
380
|
try {
|
|
381
|
-
|
|
381
|
+
a.documentElement.innerHTML = ot ? N : A;
|
|
382
382
|
} catch {
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
const v =
|
|
386
|
-
return
|
|
387
|
-
}, $t = function(
|
|
385
|
+
const v = a.body || a.documentElement;
|
|
386
|
+
return e && u && v.insertBefore(i.createTextNode(u), v.childNodes[0] || null), he === J ? Ke.call(a, me ? "html" : "body")[0] : me ? a.documentElement : v;
|
|
387
|
+
}, $t = function(e) {
|
|
388
388
|
return xe.call(
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
e.ownerDocument || e,
|
|
390
|
+
e,
|
|
391
391
|
// eslint-disable-next-line no-bitwise
|
|
392
|
-
|
|
392
|
+
f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION,
|
|
393
393
|
null
|
|
394
394
|
);
|
|
395
|
-
}, Bt = function(
|
|
396
|
-
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
395
|
+
}, Bt = function(e) {
|
|
396
|
+
e.normalize();
|
|
397
|
+
const a = xe.call(
|
|
398
|
+
e.ownerDocument || e,
|
|
399
|
+
e,
|
|
400
400
|
// eslint-disable-next-line no-bitwise
|
|
401
|
-
|
|
401
|
+
f.SHOW_TEXT | f.SHOW_COMMENT | f.SHOW_CDATA_SECTION | f.SHOW_PROCESSING_INSTRUCTION,
|
|
402
402
|
null
|
|
403
403
|
);
|
|
404
|
-
let u =
|
|
404
|
+
let u = a.nextNode();
|
|
405
405
|
for (; u; ) {
|
|
406
406
|
let A = u.data;
|
|
407
|
-
Te([
|
|
407
|
+
Te([ke, Me, Pe], (v) => {
|
|
408
408
|
A = Ae(A, v, " ");
|
|
409
|
-
}), u.data = A, u =
|
|
409
|
+
}), u.data = A, u = a.nextNode();
|
|
410
410
|
}
|
|
411
|
-
}, ct = function(
|
|
412
|
-
return
|
|
413
|
-
}, $e = function(
|
|
414
|
-
if (!ce || typeof
|
|
411
|
+
}, ct = function(e) {
|
|
412
|
+
return e instanceof I && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof C) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
413
|
+
}, $e = function(e) {
|
|
414
|
+
if (!ce || typeof e != "object" || e === null)
|
|
415
415
|
return !1;
|
|
416
416
|
try {
|
|
417
|
-
return typeof ce(
|
|
417
|
+
return typeof ce(e) == "number";
|
|
418
418
|
} catch {
|
|
419
419
|
return !1;
|
|
420
420
|
}
|
|
421
421
|
};
|
|
422
|
-
function
|
|
422
|
+
function te(g, e, a) {
|
|
423
423
|
Te(g, (u) => {
|
|
424
|
-
u.call(n,
|
|
424
|
+
u.call(n, e, a, be);
|
|
425
425
|
});
|
|
426
426
|
}
|
|
427
|
-
const Gt = function(
|
|
428
|
-
let
|
|
429
|
-
if (
|
|
430
|
-
return X(
|
|
431
|
-
const u =
|
|
432
|
-
if (
|
|
427
|
+
const Gt = function(e) {
|
|
428
|
+
let a = null;
|
|
429
|
+
if (te(j.beforeSanitizeElements, e, null), ct(e))
|
|
430
|
+
return X(e), !0;
|
|
431
|
+
const u = k(e.nodeName);
|
|
432
|
+
if (te(j.uponSanitizeElement, e, {
|
|
433
433
|
tagName: u,
|
|
434
434
|
allowedTags: P
|
|
435
|
-
}), Ce &&
|
|
436
|
-
return X(
|
|
437
|
-
if (we[u] || !(
|
|
435
|
+
}), Ce && e.hasChildNodes() && !$e(e.firstElementChild) && z(/<[/\w!]/g, e.innerHTML) && z(/<[/\w!]/g, e.textContent) || Ce && e.namespaceURI === J && u === "style" && $e(e.firstElementChild) || e.nodeType === Se.progressingInstruction || Ce && e.nodeType === Se.comment && z(/<[/\w]/g, e.data))
|
|
436
|
+
return X(e), !0;
|
|
437
|
+
if (we[u] || !(oe.tagCheck instanceof Function && oe.tagCheck(u)) && !P[u]) {
|
|
438
438
|
if (!we[u] && qt(u) && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
|
|
439
439
|
return !1;
|
|
440
|
-
if (tt && !
|
|
441
|
-
const A = O(
|
|
440
|
+
if (tt && !Q[u]) {
|
|
441
|
+
const A = O(e) || e.parentNode, v = ie(e) || e.childNodes;
|
|
442
442
|
if (v && A) {
|
|
443
443
|
const L = v.length;
|
|
444
444
|
for (let G = L - 1; G >= 0; --G) {
|
|
445
|
-
const
|
|
446
|
-
A.insertBefore(
|
|
445
|
+
const se = fe(v[G], !0);
|
|
446
|
+
A.insertBefore(se, M(e));
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
return X(
|
|
450
|
+
return X(e), !0;
|
|
451
451
|
}
|
|
452
|
-
return
|
|
453
|
-
|
|
454
|
-
}),
|
|
455
|
-
element:
|
|
456
|
-
}),
|
|
457
|
-
}, Wt = function(
|
|
458
|
-
if (Fe[
|
|
452
|
+
return e instanceof m && !Mn(e) || (u === "noscript" || u === "noembed" || u === "noframes") && z(/<\/no(script|embed|frames)/i, e.innerHTML) ? (X(e), !0) : (re && e.nodeType === Se.text && (a = e.textContent, Te([ke, Me, Pe], (A) => {
|
|
453
|
+
a = Ae(a, A, " ");
|
|
454
|
+
}), e.textContent !== a && (ye(n.removed, {
|
|
455
|
+
element: e.cloneNode()
|
|
456
|
+
}), e.textContent = a)), te(j.afterSanitizeElements, e, null), !1);
|
|
457
|
+
}, Wt = function(e, a, u) {
|
|
458
|
+
if (Fe[a] || Lt && (a === "id" || a === "name") && (u in i || u in kn))
|
|
459
459
|
return !1;
|
|
460
|
-
const A = U[
|
|
461
|
-
if (!(Qe && !Fe[
|
|
462
|
-
if (!(Ot && z(Dn,
|
|
463
|
-
if (!A || Fe[
|
|
460
|
+
const A = U[a] || oe.attributeCheck instanceof Function && oe.attributeCheck(a, e);
|
|
461
|
+
if (!(Qe && !Fe[a] && z(Cn, a))) {
|
|
462
|
+
if (!(Ot && z(Dn, a))) {
|
|
463
|
+
if (!A || Fe[a]) {
|
|
464
464
|
if (
|
|
465
465
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
466
466
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
467
467
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
468
|
-
!(qt(
|
|
468
|
+
!(qt(e) && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, e) || R.tagNameCheck instanceof Function && R.tagNameCheck(e)) && (R.attributeNameCheck instanceof RegExp && z(R.attributeNameCheck, a) || R.attributeNameCheck instanceof Function && R.attributeNameCheck(a, e)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
469
469
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
470
|
-
|
|
470
|
+
a === "is" && R.allowCustomizedBuiltInElements && (R.tagNameCheck instanceof RegExp && z(R.tagNameCheck, u) || R.tagNameCheck instanceof Function && R.tagNameCheck(u)))
|
|
471
471
|
) return !1;
|
|
472
|
-
} else if (!it[
|
|
472
|
+
} else if (!it[a]) {
|
|
473
473
|
if (!z(Ct, Ae(u, wt, ""))) {
|
|
474
|
-
if (!((
|
|
474
|
+
if (!((a === "src" || a === "xlink:href" || a === "href") && e !== "script" && tn(u, "data:") === 0 && Mt[e])) {
|
|
475
475
|
if (!(Nt && !z(Rn, Ae(u, wt, "")))) {
|
|
476
476
|
if (u)
|
|
477
477
|
return !1;
|
|
@@ -482,12 +482,12 @@ function _n() {
|
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
return !0;
|
|
485
|
-
}, Pn = T({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), qt = function(
|
|
486
|
-
return !Pn[Ne(
|
|
487
|
-
}, Yt = function(
|
|
488
|
-
|
|
489
|
-
const
|
|
490
|
-
if (!
|
|
485
|
+
}, Pn = T({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), qt = function(e) {
|
|
486
|
+
return !Pn[Ne(e)] && z(On, e);
|
|
487
|
+
}, Yt = function(e) {
|
|
488
|
+
te(j.beforeSanitizeAttributes, e, null);
|
|
489
|
+
const a = e.attributes;
|
|
490
|
+
if (!a || ct(e))
|
|
491
491
|
return;
|
|
492
492
|
const u = {
|
|
493
493
|
attrName: "",
|
|
@@ -496,38 +496,38 @@ function _n() {
|
|
|
496
496
|
allowedAttributes: U,
|
|
497
497
|
forceKeepAttr: void 0
|
|
498
498
|
};
|
|
499
|
-
let A =
|
|
499
|
+
let A = a.length;
|
|
500
500
|
for (; A--; ) {
|
|
501
|
-
const v =
|
|
501
|
+
const v = a[A], L = v.name, G = v.namespaceURI, se = v.value, ne = k(L), ut = se;
|
|
502
502
|
let F = L === "value" ? ut : mi(ut);
|
|
503
|
-
if (u.attrName =
|
|
504
|
-
ue(L,
|
|
503
|
+
if (u.attrName = ne, u.attrValue = F, u.keepAttr = !0, u.forceKeepAttr = void 0, te(j.uponSanitizeAttribute, e, u), F = u.attrValue, xt && (ne === "id" || ne === "name") && tn(F, kt) !== 0 && (ue(L, e), F = kt + F), Ce && z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, F)) {
|
|
504
|
+
ue(L, e);
|
|
505
505
|
continue;
|
|
506
506
|
}
|
|
507
|
-
if (
|
|
508
|
-
ue(L,
|
|
507
|
+
if (ne === "attributename" && en(F, "href")) {
|
|
508
|
+
ue(L, e);
|
|
509
509
|
continue;
|
|
510
510
|
}
|
|
511
511
|
if (u.forceKeepAttr)
|
|
512
512
|
continue;
|
|
513
513
|
if (!u.keepAttr) {
|
|
514
|
-
ue(L,
|
|
514
|
+
ue(L, e);
|
|
515
515
|
continue;
|
|
516
516
|
}
|
|
517
517
|
if (!vt && z(/\/>/i, F)) {
|
|
518
|
-
ue(L,
|
|
518
|
+
ue(L, e);
|
|
519
519
|
continue;
|
|
520
520
|
}
|
|
521
|
-
|
|
521
|
+
re && Te([ke, Me, Pe], (Xt) => {
|
|
522
522
|
F = Ae(F, Xt, " ");
|
|
523
523
|
});
|
|
524
|
-
const Vt =
|
|
525
|
-
if (!Wt(Vt,
|
|
526
|
-
ue(L,
|
|
524
|
+
const Vt = k(e.nodeName);
|
|
525
|
+
if (!Wt(Vt, ne, F)) {
|
|
526
|
+
ue(L, e);
|
|
527
527
|
continue;
|
|
528
528
|
}
|
|
529
529
|
if (E && typeof y == "object" && typeof y.getAttributeType == "function" && !G)
|
|
530
|
-
switch (y.getAttributeType(Vt,
|
|
530
|
+
switch (y.getAttributeType(Vt, ne)) {
|
|
531
531
|
case "TrustedHTML": {
|
|
532
532
|
F = E.createHTML(F);
|
|
533
533
|
break;
|
|
@@ -539,90 +539,90 @@ function _n() {
|
|
|
539
539
|
}
|
|
540
540
|
if (F !== ut)
|
|
541
541
|
try {
|
|
542
|
-
G ?
|
|
542
|
+
G ? e.setAttributeNS(G, L, F) : e.setAttribute(L, F), ct(e) ? X(e) : Jt(n.removed);
|
|
543
543
|
} catch {
|
|
544
|
-
ue(L,
|
|
544
|
+
ue(L, e);
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
|
|
548
|
-
}, mt = function(
|
|
549
|
-
let
|
|
550
|
-
const u = $t(
|
|
551
|
-
for (
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
}, Be = function(
|
|
555
|
-
if (
|
|
556
|
-
const A =
|
|
547
|
+
te(j.afterSanitizeAttributes, e, null);
|
|
548
|
+
}, mt = function(e) {
|
|
549
|
+
let a = null;
|
|
550
|
+
const u = $t(e);
|
|
551
|
+
for (te(j.beforeSanitizeShadowDOM, e, null); a = u.nextNode(); )
|
|
552
|
+
te(j.uponSanitizeShadowNode, a, null), Gt(a), Yt(a), a.content instanceof c && mt(a.content);
|
|
553
|
+
te(j.afterSanitizeShadowDOM, e, null);
|
|
554
|
+
}, Be = function(e) {
|
|
555
|
+
if (e.nodeType === Se.element && e.shadowRoot instanceof c) {
|
|
556
|
+
const A = e.shadowRoot;
|
|
557
557
|
Be(A), mt(A);
|
|
558
558
|
}
|
|
559
|
-
const
|
|
560
|
-
if (!
|
|
559
|
+
const a = e.childNodes;
|
|
560
|
+
if (!a)
|
|
561
561
|
return;
|
|
562
562
|
const u = [];
|
|
563
|
-
Te(
|
|
563
|
+
Te(a, (A) => {
|
|
564
564
|
ye(u, A);
|
|
565
565
|
});
|
|
566
566
|
for (const A of u)
|
|
567
567
|
Be(A);
|
|
568
568
|
};
|
|
569
569
|
return n.sanitize = function(g) {
|
|
570
|
-
let
|
|
570
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = null, u = null, A = null, v = null;
|
|
571
571
|
if (ot = !g, ot && (g = "<!-->"), typeof g != "string" && !$e(g) && (g = gi(g), typeof g != "string"))
|
|
572
572
|
throw Ge("dirty is not a string, aborting");
|
|
573
573
|
if (!n.isSupported)
|
|
574
574
|
return g;
|
|
575
|
-
if (Je || lt(
|
|
576
|
-
const
|
|
577
|
-
if (typeof
|
|
578
|
-
const
|
|
579
|
-
if (!P[
|
|
575
|
+
if (Je || lt(e), n.removed = [], typeof g == "string" && (De = !1), De) {
|
|
576
|
+
const se = g.nodeName;
|
|
577
|
+
if (typeof se == "string") {
|
|
578
|
+
const ne = k(se);
|
|
579
|
+
if (!P[ne] || we[ne])
|
|
580
580
|
throw Ge("root node is forbidden and cannot be sanitized in-place");
|
|
581
581
|
}
|
|
582
582
|
Be(g);
|
|
583
583
|
} else if ($e(g))
|
|
584
|
-
|
|
584
|
+
a = Ht("<!---->"), u = a.ownerDocument.importNode(g, !0), u.nodeType === Se.element && u.nodeName === "BODY" || u.nodeName === "HTML" ? a = u : a.appendChild(u), Be(u);
|
|
585
585
|
else {
|
|
586
|
-
if (!pe && !
|
|
586
|
+
if (!pe && !re && !me && // eslint-disable-next-line unicorn/prefer-includes
|
|
587
587
|
g.indexOf("<") === -1)
|
|
588
588
|
return E && ze ? E.createHTML(g) : g;
|
|
589
|
-
if (
|
|
589
|
+
if (a = Ht(g), !a)
|
|
590
590
|
return pe ? null : ze ? N : "";
|
|
591
591
|
}
|
|
592
|
-
|
|
593
|
-
const L = $t(De ? g :
|
|
592
|
+
a && et && X(a.firstChild);
|
|
593
|
+
const L = $t(De ? g : a);
|
|
594
594
|
for (; A = L.nextNode(); )
|
|
595
595
|
Gt(A), Yt(A), A.content instanceof c && mt(A.content);
|
|
596
596
|
if (De)
|
|
597
|
-
return
|
|
597
|
+
return re && Bt(g), g;
|
|
598
598
|
if (pe) {
|
|
599
|
-
if (
|
|
600
|
-
for (v = Xe.call(
|
|
601
|
-
v.appendChild(
|
|
599
|
+
if (re && Bt(a), Ue)
|
|
600
|
+
for (v = Xe.call(a.ownerDocument); a.firstChild; )
|
|
601
|
+
v.appendChild(a.firstChild);
|
|
602
602
|
else
|
|
603
|
-
v =
|
|
604
|
-
return (U.shadowroot || U.shadowrootmode) && (v = Ze.call(
|
|
603
|
+
v = a;
|
|
604
|
+
return (U.shadowroot || U.shadowrootmode) && (v = Ze.call(s, v, !0)), v;
|
|
605
605
|
}
|
|
606
|
-
let G = me ?
|
|
607
|
-
return me && P["!doctype"] &&
|
|
608
|
-
` + G),
|
|
609
|
-
G = Ae(G,
|
|
606
|
+
let G = me ? a.outerHTML : a.innerHTML;
|
|
607
|
+
return me && P["!doctype"] && a.ownerDocument && a.ownerDocument.doctype && a.ownerDocument.doctype.name && z(Ci, a.ownerDocument.doctype.name) && (G = "<!DOCTYPE " + a.ownerDocument.doctype.name + `>
|
|
608
|
+
` + G), re && Te([ke, Me, Pe], (se) => {
|
|
609
|
+
G = Ae(G, se, " ");
|
|
610
610
|
}), E && ze ? E.createHTML(G) : G;
|
|
611
611
|
}, n.setConfig = function() {
|
|
612
612
|
let g = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
613
613
|
lt(g), Je = !0;
|
|
614
614
|
}, n.clearConfig = function() {
|
|
615
615
|
be = null, Je = !1;
|
|
616
|
-
}, n.isValidAttribute = function(g,
|
|
616
|
+
}, n.isValidAttribute = function(g, e, a) {
|
|
617
617
|
be || lt({});
|
|
618
|
-
const u =
|
|
619
|
-
return Wt(u, A,
|
|
620
|
-
}, n.addHook = function(g,
|
|
621
|
-
typeof
|
|
622
|
-
}, n.removeHook = function(g,
|
|
623
|
-
if (
|
|
624
|
-
const
|
|
625
|
-
return
|
|
618
|
+
const u = k(g), A = k(e);
|
|
619
|
+
return Wt(u, A, a);
|
|
620
|
+
}, n.addHook = function(g, e) {
|
|
621
|
+
typeof e == "function" && ye(j[g], e);
|
|
622
|
+
}, n.removeHook = function(g, e) {
|
|
623
|
+
if (e !== void 0) {
|
|
624
|
+
const a = li(j[g], e);
|
|
625
|
+
return a === -1 ? void 0 : ci(j[g], a, 1)[0];
|
|
626
626
|
}
|
|
627
627
|
return Jt(j[g]);
|
|
628
628
|
}, n.removeHooks = function(g) {
|
|
@@ -885,7 +885,7 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
885
885
|
"cite",
|
|
886
886
|
"longdesc",
|
|
887
887
|
"xlink:href"
|
|
888
|
-
]), Li = ["content"], xi = /url\s*\(\s*['"]?(?:[a-z][a-z0-9+\-.]*:|\/\/)/i,
|
|
888
|
+
]), Li = ["content"], xi = /url\s*\(\s*['"]?(?:[a-z][a-z0-9+\-.]*:|\/\/)/i, ki = /* @__PURE__ */ new Set([
|
|
889
889
|
"allow-downloads",
|
|
890
890
|
"allow-forms",
|
|
891
891
|
"allow-modals",
|
|
@@ -898,8 +898,41 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
898
898
|
"allow-scripts",
|
|
899
899
|
"allow-storage-access-by-user-activation",
|
|
900
900
|
"allow-top-navigation-by-user-activation"
|
|
901
|
-
]),
|
|
902
|
-
|
|
901
|
+
]), Mi = {
|
|
902
|
+
// semantics and annotation are re-allowed because DOMPurify blocks all of
|
|
903
|
+
// mathMlDisallowed by default. semantics is a safe structural wrapper;
|
|
904
|
+
// annotation carries LaTeX source text (e.g. \frac{1}{2}); Canvas emits
|
|
905
|
+
// text-only content here, and any child elements would be hoisted out of
|
|
906
|
+
// the MathML context and sanitized as ordinary HTML.
|
|
907
|
+
//
|
|
908
|
+
// annotation-xml is re-added here and filtered by an afterSanitizeElements
|
|
909
|
+
// hook below: it is stripped when its encoding makes it an HTML integration
|
|
910
|
+
// point ("text/html" or "application/xhtml+xml" per the WHATWG spec), which
|
|
911
|
+
// is the mXSS namespace-confusion vector. Semantic encodings used by external
|
|
912
|
+
// tools (MathML-Content, MathML-Presentation from MathType/Wolfram Alpha,
|
|
913
|
+
// application/x-tex, …) are not integration points and are preserved, so this
|
|
914
|
+
// layer no longer strips the benign annotation-xml the backend and TinyMCE
|
|
915
|
+
// already allow.
|
|
916
|
+
// object/embed/param re-enable PDF/SVG/media embedding in course content
|
|
917
|
+
// (e.g. <object data="file.pdf" type="application/pdf">). Their Flash/ActiveX
|
|
918
|
+
// attributes (classid, codebase, pluginspage, wmode, allowscriptaccess) are
|
|
919
|
+
// intentionally NOT added — dead tech, and ADD_ATTR is global in DOMPurify so
|
|
920
|
+
// re-allowing them would also reopen that surface on iframe. DOMPurify's URI
|
|
921
|
+
// filter blocks javascript:/data: on data/src, matching Canvas's
|
|
922
|
+
// http/https/relative protocol rule for these tags.
|
|
923
|
+
//
|
|
924
|
+
// SECURITY ASSUMPTION (same one iframe already relies on): object/embed load
|
|
925
|
+
// their resource as a *document*, not an image — a same-origin SVG/HTML file
|
|
926
|
+
// (e.g. <object data="/files/123/download" type="image/svg+xml">) executes any
|
|
927
|
+
// <script> it contains in the embedding page's origin. The javascript:/data:
|
|
928
|
+
// filter does not help here because the URL is a benign same-origin path; the
|
|
929
|
+
// payload lives in the fetched file. This is NOT new attack surface: <iframe>
|
|
930
|
+
// is already allowed and has the identical capability (its srcdoc is stripped —
|
|
931
|
+
// see test). The defense for all three is that Canvas serves user-uploaded
|
|
932
|
+
// files from a separate sandboxed origin. object/embed also have no usable
|
|
933
|
+
// sandbox attribute, so the sandbox-token hook cannot constrain them — again,
|
|
934
|
+
// parity with an unsandboxed iframe, which is already permitted.
|
|
935
|
+
ADD_TAGS: ["iframe", "semantics", "annotation", "annotation-xml", "object", "embed", "param"],
|
|
903
936
|
ADD_ATTR: [
|
|
904
937
|
"allowfullscreen",
|
|
905
938
|
"allow",
|
|
@@ -907,6 +940,12 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
907
940
|
"sandbox",
|
|
908
941
|
"data-media-id",
|
|
909
942
|
"data-media-type",
|
|
943
|
+
// <object>'s resource URL attribute — not in DOMPurify's defaults. src/type/
|
|
944
|
+
// name/value/width/height (used by object/embed/param) already are. Added
|
|
945
|
+
// globally (DOMPurify has no per-tag attr scoping), which is harmless: `data`
|
|
946
|
+
// is in URL_ATTRS so it is protocol-filtered, and it is not a DOM-clobbering
|
|
947
|
+
// or URI-safe attribute name.
|
|
948
|
+
"data",
|
|
910
949
|
// RCE produces target="_blank" for external links. Modern browsers treat
|
|
911
950
|
// target="_blank" as implicit rel="noopener", and the backend allowlist
|
|
912
951
|
// already includes target.
|
|
@@ -943,17 +982,18 @@ const Ni = /* @__PURE__ */ new Set([
|
|
|
943
982
|
// confusion attacks where fragments like <svg> could influence parse context.
|
|
944
983
|
FORCE_BODY: !0
|
|
945
984
|
};
|
|
946
|
-
let
|
|
985
|
+
let K = null;
|
|
947
986
|
function Pi() {
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
987
|
+
if (K) return K;
|
|
988
|
+
K = typeof bt == "function" ? bt(window) : bt, K.addHook("afterSanitizeAttributes", (n) => {
|
|
989
|
+
if (!(n instanceof Element) || !n.hasAttribute("style")) return;
|
|
990
|
+
const i = n.style, s = [];
|
|
991
|
+
for (let m = 0; m < i.length; m++) {
|
|
992
|
+
const f = i.item(m);
|
|
993
|
+
Ni.has(f) || s.push(f);
|
|
954
994
|
}
|
|
955
|
-
for (const
|
|
956
|
-
const
|
|
995
|
+
for (const m of s) i.removeProperty(m);
|
|
996
|
+
const l = /* @__PURE__ */ new Set([
|
|
957
997
|
"static",
|
|
958
998
|
"relative",
|
|
959
999
|
"absolute",
|
|
@@ -962,51 +1002,61 @@ function Pi() {
|
|
|
962
1002
|
"unset",
|
|
963
1003
|
"revert",
|
|
964
1004
|
"revert-layer"
|
|
965
|
-
]),
|
|
966
|
-
|
|
967
|
-
const
|
|
968
|
-
|
|
969
|
-
for (const
|
|
970
|
-
const
|
|
971
|
-
|
|
1005
|
+
]), c = i.getPropertyValue("position").trim().toLowerCase();
|
|
1006
|
+
c && !l.has(c) && i.removeProperty("position");
|
|
1007
|
+
const d = /* @__PURE__ */ new Set(["initial", "inherit", "unset", "revert", "revert-layer"]), p = i.getPropertyValue("opacity").trim().toLowerCase();
|
|
1008
|
+
p && !d.has(p) && (p.endsWith("%") ? parseFloat(p) / 100 : parseFloat(p)) < 0.05 && i.removeProperty("opacity");
|
|
1009
|
+
for (const m of Li) {
|
|
1010
|
+
const f = i.getPropertyValue(m);
|
|
1011
|
+
f && xi.test(f) && i.removeProperty(m);
|
|
972
1012
|
}
|
|
973
|
-
|
|
974
|
-
}),
|
|
975
|
-
if (!vi.has(
|
|
976
|
-
const
|
|
977
|
-
/^\s*\/\//.test(
|
|
978
|
-
}),
|
|
979
|
-
if (!(
|
|
980
|
-
const
|
|
981
|
-
if (
|
|
982
|
-
|
|
1013
|
+
i.length === 0 && n.removeAttribute("style");
|
|
1014
|
+
}), K.addHook("uponSanitizeAttribute", (n, i) => {
|
|
1015
|
+
if (!vi.has(i.attrName)) return;
|
|
1016
|
+
const s = i.attrValue;
|
|
1017
|
+
/^\s*\/\//.test(s) ? (i.attrValue = s.trimStart().replace(/^\/\//, "https://"), i.keepAttr = !0) : /^\s*\\/.test(s) && (i.keepAttr = !1);
|
|
1018
|
+
}), K.addHook("afterSanitizeAttributes", (n) => {
|
|
1019
|
+
if (!(n instanceof Element) || !n.hasAttribute("srcset")) return;
|
|
1020
|
+
const i = (n.getAttribute("srcset") ?? "").split(","), s = (d) => d.trim().split(/\s+/)[0];
|
|
1021
|
+
if (i.some((d) => /^\s*\\/.test(s(d)))) {
|
|
1022
|
+
n.removeAttribute("srcset");
|
|
983
1023
|
return;
|
|
984
1024
|
}
|
|
985
|
-
let
|
|
986
|
-
const
|
|
987
|
-
const
|
|
988
|
-
if (!
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
return
|
|
1025
|
+
let l = !1;
|
|
1026
|
+
const c = i.map((d) => {
|
|
1027
|
+
const p = s(d);
|
|
1028
|
+
if (!p.startsWith("//")) return d;
|
|
1029
|
+
l = !0;
|
|
1030
|
+
const m = d.indexOf(p);
|
|
1031
|
+
return d.slice(0, m) + "https://" + p.slice(2) + d.slice(m + p.length);
|
|
992
1032
|
});
|
|
993
|
-
|
|
994
|
-
}),
|
|
995
|
-
var
|
|
996
|
-
if (!(
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
}),
|
|
1000
|
-
if (!(
|
|
1001
|
-
const
|
|
1002
|
-
|
|
1003
|
-
}),
|
|
1033
|
+
l && n.setAttribute("srcset", c.join(","));
|
|
1034
|
+
}), K.addHook("afterSanitizeAttributes", (n) => {
|
|
1035
|
+
var i;
|
|
1036
|
+
if (!(n instanceof Element) || n.tagName !== "A" && n.tagName !== "AREA" || ((i = n.getAttribute("target")) == null ? void 0 : i.toLowerCase()) !== "_blank") return;
|
|
1037
|
+
const s = n.getAttribute("rel") ?? "", l = new Set(s.split(/\s+/).filter(Boolean));
|
|
1038
|
+
l.add("noopener"), n.setAttribute("rel", [...l].join(" "));
|
|
1039
|
+
}), K.addHook("afterSanitizeAttributes", (n) => {
|
|
1040
|
+
if (!(n instanceof Element) || n.tagName !== "IFRAME" || !n.hasAttribute("sandbox")) return;
|
|
1041
|
+
const i = (n.getAttribute("sandbox") ?? "").toLowerCase().split(/\s+/).filter(Boolean), s = i.filter((l) => ki.has(l));
|
|
1042
|
+
s.length !== i.length && n.setAttribute("sandbox", s.join(" "));
|
|
1043
|
+
}), K.addHook("afterSanitizeAttributes", (n) => {
|
|
1044
|
+
if (!(n instanceof Element) || n.tagName !== "PARAM") return;
|
|
1045
|
+
const i = n.getAttribute("value");
|
|
1046
|
+
i && /^\s*(?:javascript|vbscript):/i.test(i) && n.removeAttribute("value");
|
|
1047
|
+
});
|
|
1048
|
+
const t = /* @__PURE__ */ new Set(["text/html", "application/xhtml+xml"]);
|
|
1049
|
+
return K.addHook("afterSanitizeElements", (n) => {
|
|
1050
|
+
if (!(n instanceof Element) || n.tagName.toLowerCase() !== "annotation-xml") return;
|
|
1051
|
+
const i = (n.getAttribute("encoding") ?? "").toLowerCase().trim();
|
|
1052
|
+
t.has(i) && n.remove();
|
|
1053
|
+
}), K;
|
|
1004
1054
|
}
|
|
1005
|
-
function It(
|
|
1055
|
+
function It(t, n) {
|
|
1006
1056
|
if (typeof window > "u")
|
|
1007
1057
|
throw new Error("sanitizeHtml requires a DOM environment (window is not defined)");
|
|
1008
|
-
const
|
|
1009
|
-
return Pi().sanitize(
|
|
1058
|
+
const i = Mi;
|
|
1059
|
+
return Pi().sanitize(t ?? "", i);
|
|
1010
1060
|
}
|
|
1011
1061
|
const Fi = ae`
|
|
1012
1062
|
query GetAssignment($courseId: ID!, $assignmentId: ID!, $userId: ID!) {
|
|
@@ -1150,196 +1200,196 @@ const Fi = ae`
|
|
|
1150
1200
|
contentType
|
|
1151
1201
|
submissionPreviewUrl
|
|
1152
1202
|
}
|
|
1153
|
-
`, ve =
|
|
1154
|
-
_id:
|
|
1155
|
-
displayName:
|
|
1156
|
-
id:
|
|
1157
|
-
mimeClass:
|
|
1158
|
-
url:
|
|
1159
|
-
contentType:
|
|
1160
|
-
submissionPreviewUrl:
|
|
1161
|
-
}), ji =
|
|
1162
|
-
_id:
|
|
1163
|
-
activeSubmissionType:
|
|
1164
|
-
body:
|
|
1165
|
-
attachments:
|
|
1166
|
-
}), Hi =
|
|
1167
|
-
id:
|
|
1168
|
-
submittedAt:
|
|
1169
|
-
body:
|
|
1170
|
-
grade:
|
|
1171
|
-
score:
|
|
1172
|
-
submissionType:
|
|
1173
|
-
attempt:
|
|
1174
|
-
unreadCommentCount:
|
|
1203
|
+
`, ve = o.object({
|
|
1204
|
+
_id: o.string(),
|
|
1205
|
+
displayName: o.string(),
|
|
1206
|
+
id: o.string(),
|
|
1207
|
+
mimeClass: o.string(),
|
|
1208
|
+
url: o.string(),
|
|
1209
|
+
contentType: o.string(),
|
|
1210
|
+
submissionPreviewUrl: o.string().nullable()
|
|
1211
|
+
}), ji = o.object({
|
|
1212
|
+
_id: o.string(),
|
|
1213
|
+
activeSubmissionType: o.string(),
|
|
1214
|
+
body: o.string().nullable(),
|
|
1215
|
+
attachments: o.array(ve).nullable()
|
|
1216
|
+
}), Hi = o.object({
|
|
1217
|
+
id: o.string(),
|
|
1218
|
+
submittedAt: o.string(),
|
|
1219
|
+
body: o.string().nullable(),
|
|
1220
|
+
grade: o.string().nullable(),
|
|
1221
|
+
score: o.number().nullable(),
|
|
1222
|
+
submissionType: o.string(),
|
|
1223
|
+
attempt: o.number(),
|
|
1224
|
+
unreadCommentCount: o.number(),
|
|
1175
1225
|
attachment: ve.nullable(),
|
|
1176
|
-
attachments:
|
|
1226
|
+
attachments: o.array(ve).nullable(),
|
|
1177
1227
|
submissionDraft: ji.nullable()
|
|
1178
|
-
}), $i =
|
|
1179
|
-
_id:
|
|
1180
|
-
name:
|
|
1181
|
-
description:
|
|
1182
|
-
allowedExtensions:
|
|
1183
|
-
allowedAttempts:
|
|
1184
|
-
dueAt:
|
|
1185
|
-
pointsPossible:
|
|
1186
|
-
submissionTypes:
|
|
1187
|
-
gradingType:
|
|
1188
|
-
published:
|
|
1189
|
-
submissionsConnection:
|
|
1190
|
-
nodes:
|
|
1228
|
+
}), $i = o.object({
|
|
1229
|
+
_id: o.string(),
|
|
1230
|
+
name: o.string(),
|
|
1231
|
+
description: o.string().nullable(),
|
|
1232
|
+
allowedExtensions: o.array(o.string()).nullable(),
|
|
1233
|
+
allowedAttempts: o.number().nullable(),
|
|
1234
|
+
dueAt: o.string().nullable(),
|
|
1235
|
+
pointsPossible: o.number().nullable(),
|
|
1236
|
+
submissionTypes: o.array(o.string()),
|
|
1237
|
+
gradingType: o.string(),
|
|
1238
|
+
published: o.boolean().nullable().optional(),
|
|
1239
|
+
submissionsConnection: o.object({
|
|
1240
|
+
nodes: o.array(Hi)
|
|
1191
1241
|
})
|
|
1192
|
-
}), Bi =
|
|
1242
|
+
}), Bi = o.object({
|
|
1193
1243
|
legacyNode: $i,
|
|
1194
|
-
course:
|
|
1195
|
-
name:
|
|
1244
|
+
course: o.object({
|
|
1245
|
+
name: o.string()
|
|
1196
1246
|
})
|
|
1197
|
-
}), En =
|
|
1198
|
-
startCursor:
|
|
1199
|
-
endCursor:
|
|
1200
|
-
hasPreviousPage:
|
|
1201
|
-
hasNextPage:
|
|
1202
|
-
}), In =
|
|
1203
|
-
_id:
|
|
1204
|
-
attempt:
|
|
1205
|
-
author:
|
|
1206
|
-
avatarUrl:
|
|
1207
|
-
shortName:
|
|
1208
|
-
courseRoles:
|
|
1247
|
+
}), En = o.object({
|
|
1248
|
+
startCursor: o.string(),
|
|
1249
|
+
endCursor: o.string(),
|
|
1250
|
+
hasPreviousPage: o.boolean(),
|
|
1251
|
+
hasNextPage: o.boolean()
|
|
1252
|
+
}), In = o.object({
|
|
1253
|
+
_id: o.string(),
|
|
1254
|
+
attempt: o.number(),
|
|
1255
|
+
author: o.object({
|
|
1256
|
+
avatarUrl: o.string().nullable(),
|
|
1257
|
+
shortName: o.string(),
|
|
1258
|
+
courseRoles: o.string().nullable()
|
|
1209
1259
|
}),
|
|
1210
|
-
htmlComment:
|
|
1211
|
-
read:
|
|
1212
|
-
updatedAt:
|
|
1213
|
-
createdAt:
|
|
1214
|
-
attachments:
|
|
1215
|
-
|
|
1216
|
-
url:
|
|
1217
|
-
mimeClass:
|
|
1218
|
-
displayName:
|
|
1219
|
-
contentType:
|
|
1220
|
-
id:
|
|
1260
|
+
htmlComment: o.string(),
|
|
1261
|
+
read: o.boolean(),
|
|
1262
|
+
updatedAt: o.string(),
|
|
1263
|
+
createdAt: o.string(),
|
|
1264
|
+
attachments: o.array(
|
|
1265
|
+
o.object({
|
|
1266
|
+
url: o.string(),
|
|
1267
|
+
mimeClass: o.string(),
|
|
1268
|
+
displayName: o.string(),
|
|
1269
|
+
contentType: o.string(),
|
|
1270
|
+
id: o.string()
|
|
1221
1271
|
})
|
|
1222
1272
|
).nullable()
|
|
1223
|
-
}), Gi =
|
|
1224
|
-
submissionComments:
|
|
1225
|
-
commentsConnection:
|
|
1273
|
+
}), Gi = o.object({
|
|
1274
|
+
submissionComments: o.object({
|
|
1275
|
+
commentsConnection: o.object({
|
|
1226
1276
|
pageInfo: En,
|
|
1227
|
-
nodes:
|
|
1277
|
+
nodes: o.array(In)
|
|
1228
1278
|
})
|
|
1229
1279
|
})
|
|
1230
|
-
}), Uo =
|
|
1231
|
-
comments:
|
|
1280
|
+
}), Uo = o.object({
|
|
1281
|
+
comments: o.array(In),
|
|
1232
1282
|
pageInfo: En
|
|
1233
|
-
}), Wi =
|
|
1234
|
-
submittedAt:
|
|
1235
|
-
body:
|
|
1236
|
-
grade:
|
|
1237
|
-
score:
|
|
1238
|
-
submissionType:
|
|
1239
|
-
state:
|
|
1240
|
-
attempt:
|
|
1283
|
+
}), Wi = o.object({
|
|
1284
|
+
submittedAt: o.string(),
|
|
1285
|
+
body: o.string().nullable(),
|
|
1286
|
+
grade: o.string().nullable(),
|
|
1287
|
+
score: o.number().nullable(),
|
|
1288
|
+
submissionType: o.string(),
|
|
1289
|
+
state: o.string(),
|
|
1290
|
+
attempt: o.number(),
|
|
1241
1291
|
attachment: ve.nullable(),
|
|
1242
|
-
attachments:
|
|
1243
|
-
}), qi =
|
|
1244
|
-
node:
|
|
1245
|
-
submissionHistoriesConnection:
|
|
1246
|
-
nodes:
|
|
1292
|
+
attachments: o.array(ve).nullable()
|
|
1293
|
+
}), qi = o.object({
|
|
1294
|
+
node: o.object({
|
|
1295
|
+
submissionHistoriesConnection: o.object({
|
|
1296
|
+
nodes: o.array(Wi)
|
|
1247
1297
|
})
|
|
1248
1298
|
})
|
|
1249
|
-
}), Le =
|
|
1250
|
-
attribute:
|
|
1251
|
-
message:
|
|
1252
|
-
}), Yi =
|
|
1253
|
-
createSubmissionComment:
|
|
1254
|
-
submissionComment:
|
|
1255
|
-
_id:
|
|
1256
|
-
attachments:
|
|
1257
|
-
|
|
1258
|
-
_id:
|
|
1259
|
-
displayName:
|
|
1260
|
-
id:
|
|
1261
|
-
mimeClass:
|
|
1262
|
-
url:
|
|
1299
|
+
}), Le = o.object({
|
|
1300
|
+
attribute: o.string(),
|
|
1301
|
+
message: o.string()
|
|
1302
|
+
}), Yi = o.object({
|
|
1303
|
+
createSubmissionComment: o.object({
|
|
1304
|
+
submissionComment: o.object({
|
|
1305
|
+
_id: o.string(),
|
|
1306
|
+
attachments: o.array(
|
|
1307
|
+
o.object({
|
|
1308
|
+
_id: o.string(),
|
|
1309
|
+
displayName: o.string(),
|
|
1310
|
+
id: o.string(),
|
|
1311
|
+
mimeClass: o.string(),
|
|
1312
|
+
url: o.string()
|
|
1263
1313
|
})
|
|
1264
1314
|
).nullable(),
|
|
1265
|
-
author:
|
|
1266
|
-
avatarUrl:
|
|
1267
|
-
shortName:
|
|
1315
|
+
author: o.object({
|
|
1316
|
+
avatarUrl: o.string().nullable(),
|
|
1317
|
+
shortName: o.string()
|
|
1268
1318
|
}),
|
|
1269
|
-
htmlComment:
|
|
1270
|
-
mediaObject:
|
|
1271
|
-
id:
|
|
1272
|
-
_id:
|
|
1273
|
-
mediaSources:
|
|
1274
|
-
|
|
1275
|
-
height:
|
|
1276
|
-
src:
|
|
1277
|
-
type:
|
|
1278
|
-
width:
|
|
1319
|
+
htmlComment: o.string(),
|
|
1320
|
+
mediaObject: o.object({
|
|
1321
|
+
id: o.string(),
|
|
1322
|
+
_id: o.string(),
|
|
1323
|
+
mediaSources: o.array(
|
|
1324
|
+
o.object({
|
|
1325
|
+
height: o.string(),
|
|
1326
|
+
src: o.string(),
|
|
1327
|
+
type: o.string(),
|
|
1328
|
+
width: o.string()
|
|
1279
1329
|
})
|
|
1280
1330
|
),
|
|
1281
|
-
mediaTracks:
|
|
1282
|
-
|
|
1283
|
-
_id:
|
|
1284
|
-
locale:
|
|
1285
|
-
content:
|
|
1286
|
-
kind:
|
|
1331
|
+
mediaTracks: o.array(
|
|
1332
|
+
o.object({
|
|
1333
|
+
_id: o.string(),
|
|
1334
|
+
locale: o.string(),
|
|
1335
|
+
content: o.string(),
|
|
1336
|
+
kind: o.string()
|
|
1287
1337
|
})
|
|
1288
1338
|
),
|
|
1289
|
-
mediaType:
|
|
1290
|
-
title:
|
|
1339
|
+
mediaType: o.string(),
|
|
1340
|
+
title: o.string()
|
|
1291
1341
|
}).nullable(),
|
|
1292
|
-
read:
|
|
1293
|
-
updatedAt:
|
|
1342
|
+
read: o.boolean(),
|
|
1343
|
+
updatedAt: o.string()
|
|
1294
1344
|
}).nullable(),
|
|
1295
|
-
errors:
|
|
1345
|
+
errors: o.array(Le).nullable()
|
|
1296
1346
|
})
|
|
1297
|
-
}), Vi =
|
|
1298
|
-
markSubmissionCommentsRead:
|
|
1299
|
-
errors:
|
|
1347
|
+
}), Vi = o.object({
|
|
1348
|
+
markSubmissionCommentsRead: o.object({
|
|
1349
|
+
errors: o.array(Le).nullable()
|
|
1300
1350
|
})
|
|
1301
|
-
}), zo =
|
|
1302
|
-
createSubmission:
|
|
1303
|
-
submission:
|
|
1304
|
-
_id:
|
|
1305
|
-
createdAt:
|
|
1306
|
-
attempt:
|
|
1307
|
-
submittedAt:
|
|
1308
|
-
score:
|
|
1351
|
+
}), zo = o.object({
|
|
1352
|
+
createSubmission: o.object({
|
|
1353
|
+
submission: o.object({
|
|
1354
|
+
_id: o.string(),
|
|
1355
|
+
createdAt: o.string(),
|
|
1356
|
+
attempt: o.number(),
|
|
1357
|
+
submittedAt: o.string().nullable(),
|
|
1358
|
+
score: o.number().nullable()
|
|
1309
1359
|
}).nullable(),
|
|
1310
|
-
errors:
|
|
1360
|
+
errors: o.array(Le).nullable()
|
|
1311
1361
|
})
|
|
1312
|
-
}), jo =
|
|
1362
|
+
}), jo = o.object(
|
|
1313
1363
|
{
|
|
1314
|
-
createSubmissionDraft:
|
|
1315
|
-
submissionDraft:
|
|
1316
|
-
_id:
|
|
1364
|
+
createSubmissionDraft: o.object({
|
|
1365
|
+
submissionDraft: o.object({
|
|
1366
|
+
_id: o.string()
|
|
1317
1367
|
}).nullable(),
|
|
1318
|
-
errors:
|
|
1368
|
+
errors: o.array(Le).nullable()
|
|
1319
1369
|
})
|
|
1320
1370
|
}
|
|
1321
|
-
), Ho =
|
|
1371
|
+
), Ho = o.object(
|
|
1322
1372
|
{
|
|
1323
|
-
deleteSubmissionDraft:
|
|
1324
|
-
submissionDraftIds:
|
|
1325
|
-
errors:
|
|
1373
|
+
deleteSubmissionDraft: o.object({
|
|
1374
|
+
submissionDraftIds: o.array(o.string()).nullable(),
|
|
1375
|
+
errors: o.array(Le).nullable()
|
|
1326
1376
|
})
|
|
1327
1377
|
}
|
|
1328
1378
|
);
|
|
1329
1379
|
function Xi({
|
|
1330
|
-
courseId:
|
|
1380
|
+
courseId: t,
|
|
1331
1381
|
assignmentId: n,
|
|
1332
|
-
userId:
|
|
1333
|
-
executeQuery:
|
|
1382
|
+
userId: i,
|
|
1383
|
+
executeQuery: s,
|
|
1334
1384
|
enabled: l = !0
|
|
1335
1385
|
}) {
|
|
1336
1386
|
return Ve({
|
|
1337
|
-
queryKey: ["assignment-review", "assignment",
|
|
1387
|
+
queryKey: ["assignment-review", "assignment", t, n, i],
|
|
1338
1388
|
queryFn: async () => {
|
|
1339
|
-
const c = await
|
|
1340
|
-
courseId:
|
|
1389
|
+
const c = await s(Fi, {
|
|
1390
|
+
courseId: t,
|
|
1341
1391
|
assignmentId: n,
|
|
1342
|
-
userId:
|
|
1392
|
+
userId: i
|
|
1343
1393
|
}), d = Bi.parse(c);
|
|
1344
1394
|
return {
|
|
1345
1395
|
...d.legacyNode,
|
|
@@ -1350,36 +1400,36 @@ function Xi({
|
|
|
1350
1400
|
});
|
|
1351
1401
|
}
|
|
1352
1402
|
function Ki({
|
|
1353
|
-
submissionId:
|
|
1403
|
+
submissionId: t,
|
|
1354
1404
|
executeQuery: n,
|
|
1355
|
-
enabled:
|
|
1405
|
+
enabled: i = !0
|
|
1356
1406
|
}) {
|
|
1357
1407
|
return Ve({
|
|
1358
|
-
queryKey: ["assignment-review", "submissions",
|
|
1408
|
+
queryKey: ["assignment-review", "submissions", t],
|
|
1359
1409
|
queryFn: async () => {
|
|
1360
|
-
const
|
|
1361
|
-
return qi.parse(
|
|
1410
|
+
const s = await n(zi, { submissionId: t });
|
|
1411
|
+
return qi.parse(s).node.submissionHistoriesConnection.nodes.slice().sort(
|
|
1362
1412
|
(c, d) => new Date(d.submittedAt).getTime() - new Date(c.submittedAt).getTime()
|
|
1363
1413
|
);
|
|
1364
1414
|
},
|
|
1365
|
-
enabled:
|
|
1415
|
+
enabled: i
|
|
1366
1416
|
});
|
|
1367
1417
|
}
|
|
1368
|
-
function Zi(
|
|
1369
|
-
if (!
|
|
1370
|
-
const n = new Date(
|
|
1418
|
+
function Zi(t) {
|
|
1419
|
+
if (!t) return "";
|
|
1420
|
+
const n = new Date(t);
|
|
1371
1421
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString();
|
|
1372
1422
|
}
|
|
1373
1423
|
function Qi({
|
|
1374
|
-
submission:
|
|
1424
|
+
submission: t,
|
|
1375
1425
|
isSelected: n,
|
|
1376
|
-
isDraft:
|
|
1377
|
-
pointsPossible:
|
|
1426
|
+
isDraft: i = !1,
|
|
1427
|
+
pointsPossible: s,
|
|
1378
1428
|
onClick: l
|
|
1379
1429
|
}) {
|
|
1380
|
-
const c = q(), d =
|
|
1430
|
+
const c = q(), d = i ? c.submissionCurrentAttempt() : c.commentsAttempt({ number: t.attempt }), p = t.score != null && s != null ? `${t.score}/${s}` : null;
|
|
1381
1431
|
return /* @__PURE__ */ r(
|
|
1382
|
-
|
|
1432
|
+
Z,
|
|
1383
1433
|
{
|
|
1384
1434
|
as: "div",
|
|
1385
1435
|
padding: "small medium",
|
|
@@ -1398,48 +1448,48 @@ function Qi({
|
|
|
1398
1448
|
/* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
1399
1449
|
/* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1400
1450
|
/* @__PURE__ */ r(_, { weight: "bold", children: d }),
|
|
1401
|
-
|
|
1451
|
+
i && /* @__PURE__ */ r(_t, { color: "info", children: c.submissionDraft() })
|
|
1402
1452
|
] }),
|
|
1403
|
-
!
|
|
1453
|
+
!i && t.submittedAt && /* @__PURE__ */ r(_, { size: "small", color: "secondary", children: Zi(t.submittedAt) })
|
|
1404
1454
|
] }),
|
|
1405
|
-
|
|
1455
|
+
p && /* @__PURE__ */ r(_, { weight: "bold", children: p })
|
|
1406
1456
|
] })
|
|
1407
1457
|
}
|
|
1408
1458
|
);
|
|
1409
1459
|
}
|
|
1410
1460
|
function Ji({
|
|
1411
|
-
submissionId:
|
|
1461
|
+
submissionId: t,
|
|
1412
1462
|
selectedAttempt: n,
|
|
1413
|
-
onAttemptSelect:
|
|
1414
|
-
pointsPossible:
|
|
1463
|
+
onAttemptSelect: i,
|
|
1464
|
+
pointsPossible: s,
|
|
1415
1465
|
executeQuery: l
|
|
1416
1466
|
}) {
|
|
1417
|
-
const c = q(), { data: d, isLoading:
|
|
1418
|
-
submissionId:
|
|
1467
|
+
const c = q(), { data: d, isLoading: p, isError: m } = Ki({
|
|
1468
|
+
submissionId: t,
|
|
1419
1469
|
executeQuery: l
|
|
1420
1470
|
});
|
|
1421
|
-
if (
|
|
1471
|
+
if (p)
|
|
1422
1472
|
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(Ye, { renderTitle: c.navigationAttempts(), size: "small" }) });
|
|
1423
1473
|
if (m)
|
|
1424
1474
|
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "medium", children: /* @__PURE__ */ r(_, { color: "danger", children: c.submissionLoadAttemptsError() }) });
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1475
|
+
const f = (d == null ? void 0 : d.filter((h) => h.attempt > 0)) ?? [];
|
|
1476
|
+
return f.length === 0 ? /* @__PURE__ */ r(b, { padding: "medium", children: /* @__PURE__ */ r(_, { color: "secondary", children: c.submissionNoAttempts() }) }) : /* @__PURE__ */ r(b, { direction: "column", gap: "x-small", padding: "none none medium none", children: f.map((h) => /* @__PURE__ */ r(
|
|
1427
1477
|
Qi,
|
|
1428
1478
|
{
|
|
1429
1479
|
submission: h,
|
|
1430
1480
|
isSelected: n === h.attempt,
|
|
1431
|
-
pointsPossible:
|
|
1432
|
-
onClick: () =>
|
|
1481
|
+
pointsPossible: s,
|
|
1482
|
+
onClick: () => i(h)
|
|
1433
1483
|
},
|
|
1434
1484
|
h.attempt
|
|
1435
1485
|
)) });
|
|
1436
1486
|
}
|
|
1437
1487
|
function wn({
|
|
1438
|
-
attachments:
|
|
1488
|
+
attachments: t,
|
|
1439
1489
|
size: n = "medium"
|
|
1440
1490
|
}) {
|
|
1441
|
-
return
|
|
1442
|
-
|
|
1491
|
+
return t.length === 0 ? null : /* @__PURE__ */ r(b, { direction: "column", gap: "x-small", children: t.map((i) => /* @__PURE__ */ r(
|
|
1492
|
+
Z,
|
|
1443
1493
|
{
|
|
1444
1494
|
as: "div",
|
|
1445
1495
|
padding: n === "small" ? "x-small" : "small medium",
|
|
@@ -1447,82 +1497,82 @@ function wn({
|
|
|
1447
1497
|
borderWidth: "small",
|
|
1448
1498
|
borderRadius: "medium",
|
|
1449
1499
|
children: /* @__PURE__ */ S(b, { as: "div", gap: "small", width: "100%", justifyItems: "space-between", alignItems: "center", children: [
|
|
1450
|
-
/* @__PURE__ */ r(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(hn, { children:
|
|
1451
|
-
/* @__PURE__ */ r(Zn, { href:
|
|
1500
|
+
/* @__PURE__ */ r(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(hn, { children: i.displayName }) }),
|
|
1501
|
+
/* @__PURE__ */ r(Zn, { href: i.url, isWithinText: !1, renderIcon: /* @__PURE__ */ r(Hn, {}), children: /* @__PURE__ */ r(Et, { children: `Download ${i.displayName}` }) })
|
|
1452
1502
|
] })
|
|
1453
1503
|
},
|
|
1454
|
-
|
|
1504
|
+
i.id
|
|
1455
1505
|
)) });
|
|
1456
1506
|
}
|
|
1457
|
-
function eo(
|
|
1458
|
-
return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: It(
|
|
1507
|
+
function eo(t) {
|
|
1508
|
+
return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: It(t) } });
|
|
1459
1509
|
}
|
|
1460
1510
|
function to({
|
|
1461
|
-
submission:
|
|
1511
|
+
submission: t,
|
|
1462
1512
|
isLastAttempt: n = !0,
|
|
1463
|
-
showAttemptLabel:
|
|
1464
|
-
renderHTML:
|
|
1513
|
+
showAttemptLabel: i = !0,
|
|
1514
|
+
renderHTML: s
|
|
1465
1515
|
}) {
|
|
1466
|
-
const l = q(), c =
|
|
1467
|
-
if (!
|
|
1516
|
+
const l = q(), c = s ?? eo, d = (t == null ? void 0 : t.submissionType) === "online_text_entry", p = (t == null ? void 0 : t.submissionType) === "online_upload", m = d ? l.submissionTextHeading() : l.submissionUploadHeading(), f = qe(() => {
|
|
1517
|
+
if (!t) return [];
|
|
1468
1518
|
const C = [];
|
|
1469
|
-
if (
|
|
1470
|
-
for (const I of
|
|
1519
|
+
if (t.attachment && C.push(t.attachment), t.attachments)
|
|
1520
|
+
for (const I of t.attachments)
|
|
1471
1521
|
C.some((w) => w.id === I.id) || C.push(I);
|
|
1472
1522
|
return C;
|
|
1473
|
-
}, [
|
|
1474
|
-
return
|
|
1475
|
-
|
|
1523
|
+
}, [t]), h = qe(() => c((t == null ? void 0 : t.body) ?? ""), [t == null ? void 0 : t.body, c]);
|
|
1524
|
+
return t ? /* @__PURE__ */ r(Z, { as: "div", children: /* @__PURE__ */ S(b, { direction: "column", gap: "small", children: [
|
|
1525
|
+
i && !n && t.attempt != null && /* @__PURE__ */ r(_, { size: "small", weight: "bold", color: "secondary", children: l.submissionViewingAttempt({ number: t.attempt }) }),
|
|
1476
1526
|
/* @__PURE__ */ S(b, { gap: "x-small", alignItems: "center", children: [
|
|
1477
1527
|
/* @__PURE__ */ r($n, { color: "success" }),
|
|
1478
1528
|
/* @__PURE__ */ r(St, { level: "h3", children: m })
|
|
1479
1529
|
] }),
|
|
1480
|
-
d &&
|
|
1481
|
-
/* @__PURE__ */ r(
|
|
1482
|
-
/* @__PURE__ */ r(
|
|
1530
|
+
d && t.body && /* @__PURE__ */ S(b, { alignItems: "stretch", gap: "small", children: [
|
|
1531
|
+
/* @__PURE__ */ r(Z, { as: "div", width: "4px", background: "primary", borderRadius: "small" }),
|
|
1532
|
+
/* @__PURE__ */ r(Z, { as: "div", children: /* @__PURE__ */ r(_, { children: h }) })
|
|
1483
1533
|
] }),
|
|
1484
|
-
|
|
1534
|
+
p && f.length > 0 && /* @__PURE__ */ r(wn, { attachments: f })
|
|
1485
1535
|
] }) }) : null;
|
|
1486
1536
|
}
|
|
1487
|
-
function no(
|
|
1488
|
-
const n = new Date(
|
|
1537
|
+
function no(t) {
|
|
1538
|
+
const n = new Date(t);
|
|
1489
1539
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
|
|
1490
1540
|
}
|
|
1491
1541
|
function io() {
|
|
1492
1542
|
return /* @__PURE__ */ r(_, { color: "secondary", size: "small", children: "|" });
|
|
1493
1543
|
}
|
|
1494
1544
|
function oo({
|
|
1495
|
-
score:
|
|
1545
|
+
score: t,
|
|
1496
1546
|
pointsPossible: n,
|
|
1497
|
-
gradingType:
|
|
1498
|
-
dueAt:
|
|
1547
|
+
gradingType: i,
|
|
1548
|
+
dueAt: s,
|
|
1499
1549
|
allowedAttempts: l,
|
|
1500
1550
|
currentAttempt: c,
|
|
1501
1551
|
isOverdue: d,
|
|
1502
|
-
estimatedDuration:
|
|
1552
|
+
estimatedDuration: p,
|
|
1503
1553
|
labels: m
|
|
1504
1554
|
}) {
|
|
1505
|
-
const
|
|
1506
|
-
return
|
|
1507
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.duration) ??
|
|
1508
|
-
),
|
|
1509
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.score) ??
|
|
1510
|
-
) : n != null &&
|
|
1511
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.pointsPossible) ??
|
|
1555
|
+
const f = q(), h = [];
|
|
1556
|
+
return p && h.push(
|
|
1557
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.duration) ?? f.headerDuration({ minutes: p }) }, "duration")
|
|
1558
|
+
), t != null && n != null ? h.push(
|
|
1559
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.score) ?? f.headerScore({ score: t, total: n }) }, "score")
|
|
1560
|
+
) : n != null && i !== "not_graded" && h.push(
|
|
1561
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.pointsPossible) ?? f.headerPointsPossible({ points: n }) }, "points")
|
|
1512
1562
|
), l != null && (l === -1 ? h.push(
|
|
1513
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ??
|
|
1563
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptsUnlimited() }, "attempts")
|
|
1514
1564
|
) : c != null ? h.push(
|
|
1515
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ??
|
|
1565
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptOf({ current: c, total: l }) }, "attempts")
|
|
1516
1566
|
) : h.push(
|
|
1517
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ??
|
|
1518
|
-
)),
|
|
1519
|
-
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.dueDate) ??
|
|
1567
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.attempts) ?? f.headerAttemptsAllowed({ count: l }) }, "attempts")
|
|
1568
|
+
)), s && h.push(
|
|
1569
|
+
/* @__PURE__ */ r(_, { size: "small", children: (m == null ? void 0 : m.dueDate) ?? f.headerDueDate({ date: no(s) }) }, "due")
|
|
1520
1570
|
), /* @__PURE__ */ S(b, { as: "div", direction: "row", alignItems: "center", gap: "small", children: [
|
|
1521
1571
|
h.map((C, I) => /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
1522
1572
|
I > 0 && /* @__PURE__ */ r(io, {}),
|
|
1523
1573
|
C
|
|
1524
1574
|
] }, `item-${String(I)}`)),
|
|
1525
|
-
d && /* @__PURE__ */ r(_t, { color: "danger", children: (m == null ? void 0 : m.overdue) ??
|
|
1575
|
+
d && /* @__PURE__ */ r(_t, { color: "danger", children: (m == null ? void 0 : m.overdue) ?? f.headerOverdue() })
|
|
1526
1576
|
] });
|
|
1527
1577
|
}
|
|
1528
1578
|
const ro = ae`
|
|
@@ -1698,31 +1748,31 @@ const ro = ae`
|
|
|
1698
1748
|
}
|
|
1699
1749
|
`;
|
|
1700
1750
|
function ao({
|
|
1701
|
-
executeQuery:
|
|
1751
|
+
executeQuery: t
|
|
1702
1752
|
}) {
|
|
1703
1753
|
const n = un();
|
|
1704
1754
|
return dn({
|
|
1705
|
-
mutationFn: async ({ submissionId:
|
|
1706
|
-
const d = await
|
|
1707
|
-
id:
|
|
1708
|
-
submissionAttempt:
|
|
1755
|
+
mutationFn: async ({ submissionId: i, attempt: s, comment: l, fileIds: c }) => {
|
|
1756
|
+
const d = await t(ro, {
|
|
1757
|
+
id: i,
|
|
1758
|
+
submissionAttempt: s,
|
|
1709
1759
|
comment: l,
|
|
1710
1760
|
fileIds: c
|
|
1711
1761
|
});
|
|
1712
1762
|
return Yi.parse(d), d;
|
|
1713
1763
|
},
|
|
1714
|
-
onSuccess: (
|
|
1764
|
+
onSuccess: (i, s) => {
|
|
1715
1765
|
n.invalidateQueries({
|
|
1716
|
-
queryKey: ["assignment-review", "submission-comments",
|
|
1766
|
+
queryKey: ["assignment-review", "submission-comments", s.submissionId]
|
|
1717
1767
|
});
|
|
1718
1768
|
}
|
|
1719
1769
|
});
|
|
1720
1770
|
}
|
|
1721
1771
|
function lo({
|
|
1722
|
-
submissionId:
|
|
1772
|
+
submissionId: t,
|
|
1723
1773
|
courseId: n,
|
|
1724
|
-
pageParams:
|
|
1725
|
-
direction:
|
|
1774
|
+
pageParams: i,
|
|
1775
|
+
direction: s,
|
|
1726
1776
|
executeQuery: l,
|
|
1727
1777
|
enabled: c
|
|
1728
1778
|
}) {
|
|
@@ -1730,67 +1780,67 @@ function lo({
|
|
|
1730
1780
|
queryKey: [
|
|
1731
1781
|
"assignment-review",
|
|
1732
1782
|
"submission-comments",
|
|
1733
|
-
|
|
1783
|
+
t,
|
|
1734
1784
|
n,
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1785
|
+
i == null ? void 0 : i.startCursor,
|
|
1786
|
+
i == null ? void 0 : i.endCursor,
|
|
1787
|
+
s
|
|
1738
1788
|
],
|
|
1739
1789
|
queryFn: async () => {
|
|
1740
1790
|
const d = await l(Ui, {
|
|
1741
|
-
submissionId:
|
|
1791
|
+
submissionId: t,
|
|
1742
1792
|
courseId: n,
|
|
1743
|
-
beforeCursor:
|
|
1744
|
-
afterCursor:
|
|
1745
|
-
first:
|
|
1746
|
-
last:
|
|
1747
|
-
}),
|
|
1793
|
+
beforeCursor: s === "prev" ? (i == null ? void 0 : i.startCursor) ?? null : null,
|
|
1794
|
+
afterCursor: s === "next" ? (i == null ? void 0 : i.endCursor) ?? null : null,
|
|
1795
|
+
first: s === "next" ? 5 : null,
|
|
1796
|
+
last: s === "prev" || !s ? 5 : null
|
|
1797
|
+
}), p = Gi.parse(d);
|
|
1748
1798
|
return {
|
|
1749
|
-
comments: [...
|
|
1750
|
-
(
|
|
1799
|
+
comments: [...p.submissionComments.commentsConnection.nodes].sort(
|
|
1800
|
+
(f, h) => new Date(f.createdAt).getTime() - new Date(h.createdAt).getTime()
|
|
1751
1801
|
),
|
|
1752
|
-
pageInfo:
|
|
1802
|
+
pageInfo: p.submissionComments.commentsConnection.pageInfo
|
|
1753
1803
|
};
|
|
1754
1804
|
},
|
|
1755
|
-
enabled: c ?? !!
|
|
1805
|
+
enabled: c ?? !!t
|
|
1756
1806
|
});
|
|
1757
1807
|
}
|
|
1758
1808
|
function co({
|
|
1759
|
-
executeQuery:
|
|
1809
|
+
executeQuery: t
|
|
1760
1810
|
}) {
|
|
1761
1811
|
const n = un();
|
|
1762
1812
|
return dn({
|
|
1763
|
-
mutationFn: async ({ submissionId:
|
|
1764
|
-
const l = await
|
|
1813
|
+
mutationFn: async ({ submissionId: i, submissionCommentIds: s }) => {
|
|
1814
|
+
const l = await t(
|
|
1765
1815
|
so,
|
|
1766
|
-
{ submissionId:
|
|
1816
|
+
{ submissionId: i, submissionCommentIds: s }
|
|
1767
1817
|
);
|
|
1768
1818
|
return Vi.parse(l), l;
|
|
1769
1819
|
},
|
|
1770
|
-
onSuccess: (
|
|
1820
|
+
onSuccess: (i, s) => {
|
|
1771
1821
|
n.invalidateQueries({
|
|
1772
1822
|
queryKey: ["assignment-review", "assignment"],
|
|
1773
|
-
predicate: (l) => l.queryKey.includes(
|
|
1823
|
+
predicate: (l) => l.queryKey.includes(s.assignmentId)
|
|
1774
1824
|
});
|
|
1775
1825
|
}
|
|
1776
1826
|
});
|
|
1777
1827
|
}
|
|
1778
|
-
function mo(
|
|
1779
|
-
return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: It(
|
|
1828
|
+
function mo(t) {
|
|
1829
|
+
return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: It(t) } });
|
|
1780
1830
|
}
|
|
1781
|
-
function uo(
|
|
1782
|
-
const n = new Date(
|
|
1831
|
+
function uo(t) {
|
|
1832
|
+
const n = new Date(t);
|
|
1783
1833
|
return Number.isNaN(n.getTime()) ? "" : n.toLocaleString();
|
|
1784
1834
|
}
|
|
1785
1835
|
function fo({
|
|
1786
|
-
comment:
|
|
1836
|
+
comment: t,
|
|
1787
1837
|
isFullWidth: n,
|
|
1788
|
-
renderHTML:
|
|
1838
|
+
renderHTML: i
|
|
1789
1839
|
}) {
|
|
1790
1840
|
var m;
|
|
1791
|
-
const
|
|
1841
|
+
const s = q(), l = i ?? mo, c = ((m = t.author.courseRoles) == null ? void 0 : m.includes("StudentEnrollment")) ?? !1, d = qe(() => l(t.htmlComment), [t.htmlComment, l]);
|
|
1792
1842
|
return /* @__PURE__ */ r(
|
|
1793
|
-
|
|
1843
|
+
Z,
|
|
1794
1844
|
{
|
|
1795
1845
|
as: "div",
|
|
1796
1846
|
padding: "small medium",
|
|
@@ -1801,19 +1851,19 @@ function fo({
|
|
|
1801
1851
|
children: /* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "small", children: [
|
|
1802
1852
|
/* @__PURE__ */ S(b, { as: "div", direction: "column", gap: "xx-small", children: [
|
|
1803
1853
|
/* @__PURE__ */ S(b, { as: "div", justifyItems: "space-between", alignItems: "center", children: [
|
|
1804
|
-
/* @__PURE__ */ r(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(_, { weight: "bold", size: "medium", children: /* @__PURE__ */ r(hn, { children:
|
|
1805
|
-
!
|
|
1854
|
+
/* @__PURE__ */ r(b.Item, { shouldShrink: !0, children: /* @__PURE__ */ r(_, { weight: "bold", size: "medium", children: /* @__PURE__ */ r(hn, { children: t.author.shortName }) }) }),
|
|
1855
|
+
!t.read && /* @__PURE__ */ r(Tn, { type: "notification", standalone: !0, children: /* @__PURE__ */ r(Et, { children: s.commentsUnreadSingle() }) })
|
|
1806
1856
|
] }),
|
|
1807
|
-
/* @__PURE__ */ r(_, { size: "small", color: "secondary", children: uo(
|
|
1808
|
-
|
|
1857
|
+
/* @__PURE__ */ r(_, { size: "small", color: "secondary", children: uo(t.createdAt) }),
|
|
1858
|
+
t.attempt > 0 && /* @__PURE__ */ r(_, { size: "small", color: "secondary", children: s.commentsAttempt({ number: t.attempt }) })
|
|
1809
1859
|
] }),
|
|
1810
1860
|
/* @__PURE__ */ r(_, { size: "medium", children: d }),
|
|
1811
|
-
|
|
1861
|
+
t.attachments && t.attachments.length > 0 && /* @__PURE__ */ r(
|
|
1812
1862
|
wn,
|
|
1813
1863
|
{
|
|
1814
|
-
attachments:
|
|
1815
|
-
...
|
|
1816
|
-
_id:
|
|
1864
|
+
attachments: t.attachments.map((f) => ({
|
|
1865
|
+
...f,
|
|
1866
|
+
_id: f._id ?? f.id,
|
|
1817
1867
|
submissionPreviewUrl: null
|
|
1818
1868
|
})),
|
|
1819
1869
|
size: "small"
|
|
@@ -1824,42 +1874,42 @@ function fo({
|
|
|
1824
1874
|
);
|
|
1825
1875
|
}
|
|
1826
1876
|
function po({
|
|
1827
|
-
submissionId:
|
|
1877
|
+
submissionId: t,
|
|
1828
1878
|
courseId: n,
|
|
1829
|
-
assignmentId:
|
|
1830
|
-
attempt:
|
|
1879
|
+
assignmentId: i,
|
|
1880
|
+
attempt: s,
|
|
1831
1881
|
canPostComment: l,
|
|
1832
1882
|
onCommentPosted: c,
|
|
1833
1883
|
renderHTML: d,
|
|
1834
|
-
executeQuery:
|
|
1884
|
+
executeQuery: p
|
|
1835
1885
|
}) {
|
|
1836
|
-
const m = q(), [
|
|
1837
|
-
submissionId:
|
|
1886
|
+
const m = q(), [f, h] = Ee(""), [C, I] = Ee({}), w = zn(/* @__PURE__ */ new Set()), { data: y, isLoading: V, isError: fe } = lo({
|
|
1887
|
+
submissionId: t,
|
|
1838
1888
|
courseId: n,
|
|
1839
1889
|
pageParams: C.pageParams,
|
|
1840
1890
|
direction: C.direction,
|
|
1841
|
-
executeQuery:
|
|
1842
|
-
}), le = ao({ executeQuery:
|
|
1891
|
+
executeQuery: p
|
|
1892
|
+
}), le = ao({ executeQuery: p }), M = co({ executeQuery: p });
|
|
1843
1893
|
Tt(() => {
|
|
1844
1894
|
if (!(y != null && y.comments) || y.comments.length === 0) return;
|
|
1845
1895
|
const E = y.comments.filter((N) => !N.read && !w.current.has(N._id)).filter((N) => {
|
|
1846
|
-
var
|
|
1847
|
-
return !((
|
|
1896
|
+
var ee;
|
|
1897
|
+
return !((ee = N.author.courseRoles) != null && ee.includes("StudentEnrollment"));
|
|
1848
1898
|
}).map((N) => N._id);
|
|
1849
1899
|
if (E.length > 0) {
|
|
1850
1900
|
for (const N of E)
|
|
1851
1901
|
w.current.add(N);
|
|
1852
|
-
|
|
1902
|
+
M.mutate({ submissionId: t, assignmentId: i, submissionCommentIds: E });
|
|
1853
1903
|
}
|
|
1854
|
-
}, [y == null ? void 0 : y.comments,
|
|
1855
|
-
const
|
|
1904
|
+
}, [y == null ? void 0 : y.comments, t, i, M]);
|
|
1905
|
+
const ie = y == null ? void 0 : y.comments.some(
|
|
1856
1906
|
(E) => {
|
|
1857
1907
|
var N;
|
|
1858
1908
|
return !((N = E.author.courseRoles) != null && N.includes("StudentEnrollment"));
|
|
1859
1909
|
}
|
|
1860
1910
|
), O = () => {
|
|
1861
|
-
|
|
1862
|
-
{ submissionId:
|
|
1911
|
+
f.trim() && le.mutate(
|
|
1912
|
+
{ submissionId: t, attempt: s, comment: f },
|
|
1863
1913
|
{
|
|
1864
1914
|
onSuccess: () => {
|
|
1865
1915
|
h(""), c == null || c();
|
|
@@ -1873,7 +1923,7 @@ function po({
|
|
|
1873
1923
|
fo,
|
|
1874
1924
|
{
|
|
1875
1925
|
comment: E,
|
|
1876
|
-
isFullWidth: !
|
|
1926
|
+
isFullWidth: !ie,
|
|
1877
1927
|
renderHTML: d
|
|
1878
1928
|
},
|
|
1879
1929
|
E._id
|
|
@@ -1907,7 +1957,7 @@ function po({
|
|
|
1907
1957
|
{
|
|
1908
1958
|
resize: "vertical",
|
|
1909
1959
|
label: /* @__PURE__ */ r(_, { weight: "bold", size: "medium", children: m.commentsPlaceholder() }),
|
|
1910
|
-
value:
|
|
1960
|
+
value: f,
|
|
1911
1961
|
onChange: (E) => h(E.target.value)
|
|
1912
1962
|
}
|
|
1913
1963
|
),
|
|
@@ -1916,73 +1966,73 @@ function po({
|
|
|
1916
1966
|
{
|
|
1917
1967
|
color: "primary",
|
|
1918
1968
|
onClick: O,
|
|
1919
|
-
interaction:
|
|
1969
|
+
interaction: f.trim().length > 0 && !le.isPending ? "enabled" : "disabled",
|
|
1920
1970
|
children: m.commentsPost()
|
|
1921
1971
|
}
|
|
1922
1972
|
)
|
|
1923
1973
|
] })
|
|
1924
1974
|
] });
|
|
1925
1975
|
}
|
|
1926
|
-
function go(
|
|
1927
|
-
return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: It(
|
|
1976
|
+
function go(t) {
|
|
1977
|
+
return /* @__PURE__ */ r("span", { dangerouslySetInnerHTML: { __html: It(t) } });
|
|
1928
1978
|
}
|
|
1929
1979
|
function Wo({
|
|
1930
|
-
courseId:
|
|
1980
|
+
courseId: t,
|
|
1931
1981
|
assignmentId: n,
|
|
1932
|
-
userId:
|
|
1933
|
-
feedbackMode:
|
|
1982
|
+
userId: i,
|
|
1983
|
+
feedbackMode: s = !1,
|
|
1934
1984
|
onError: l,
|
|
1935
1985
|
renderHTML: c,
|
|
1936
1986
|
renderPanels: d,
|
|
1937
|
-
executeQuery:
|
|
1987
|
+
executeQuery: p
|
|
1938
1988
|
}) {
|
|
1939
|
-
const m = q(),
|
|
1989
|
+
const m = q(), f = c ?? go, {
|
|
1940
1990
|
data: h,
|
|
1941
1991
|
isLoading: C,
|
|
1942
1992
|
isError: I,
|
|
1943
1993
|
error: w
|
|
1944
|
-
} = Xi({ courseId:
|
|
1945
|
-
|
|
1946
|
-
),
|
|
1994
|
+
} = Xi({ courseId: t, assignmentId: n, userId: i, executeQuery: p }), [y, V] = Ee(null), [fe, le] = Ee(
|
|
1995
|
+
s ? "comments" : null
|
|
1996
|
+
), M = qe(
|
|
1947
1997
|
() => (h == null ? void 0 : h.submissionsConnection.nodes[0]) ?? null,
|
|
1948
1998
|
[h]
|
|
1949
|
-
),
|
|
1999
|
+
), ie = M != null && M.attempt > 0, O = y ?? M, ce = y == null || y.attempt === (M == null ? void 0 : M.attempt), E = ie && ce, N = ((h == null ? void 0 : h.allowedAttempts) ?? 0) !== 1, ee = jn((Ze) => {
|
|
1950
2000
|
V(Ze);
|
|
1951
2001
|
}, []);
|
|
1952
2002
|
if (Tt(() => {
|
|
1953
2003
|
I && w && l && l(w);
|
|
1954
2004
|
}, [I, w, l]), Tt(() => {
|
|
1955
|
-
|
|
1956
|
-
}, [
|
|
2005
|
+
s && ie && le("comments");
|
|
2006
|
+
}, [s, ie]), C)
|
|
1957
2007
|
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ r(Ye, { renderTitle: m.progressLoading() }) });
|
|
1958
2008
|
if (I || !h)
|
|
1959
2009
|
return /* @__PURE__ */ r(b, { justifyItems: "center", padding: "large", children: /* @__PURE__ */ r(_, { color: "danger", children: m.assignmentLoadError() }) });
|
|
1960
|
-
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !
|
|
2010
|
+
const Ie = !!h.dueAt && new Date(h.dueAt) < /* @__PURE__ */ new Date() && !ie, xe = M ? /* @__PURE__ */ r(
|
|
1961
2011
|
po,
|
|
1962
2012
|
{
|
|
1963
|
-
submissionId:
|
|
1964
|
-
courseId:
|
|
2013
|
+
submissionId: M.id,
|
|
2014
|
+
courseId: t,
|
|
1965
2015
|
assignmentId: n,
|
|
1966
2016
|
attempt: (O == null ? void 0 : O.attempt) ?? 0,
|
|
1967
2017
|
canPostComment: E,
|
|
1968
|
-
renderHTML:
|
|
1969
|
-
executeQuery:
|
|
2018
|
+
renderHTML: f,
|
|
2019
|
+
executeQuery: p
|
|
1970
2020
|
}
|
|
1971
|
-
) : null, Xe = N &&
|
|
2021
|
+
) : null, Xe = N && M ? /* @__PURE__ */ r(
|
|
1972
2022
|
Ji,
|
|
1973
2023
|
{
|
|
1974
|
-
submissionId:
|
|
2024
|
+
submissionId: M.id,
|
|
1975
2025
|
selectedAttempt: O == null ? void 0 : O.attempt,
|
|
1976
|
-
onAttemptSelect:
|
|
2026
|
+
onAttemptSelect: ee,
|
|
1977
2027
|
pointsPossible: h.pointsPossible,
|
|
1978
|
-
executeQuery:
|
|
2028
|
+
executeQuery: p
|
|
1979
2029
|
}
|
|
1980
2030
|
) : null, Ke = {
|
|
1981
2031
|
commentsPanel: xe,
|
|
1982
2032
|
attemptsPanel: Xe,
|
|
1983
2033
|
activePanel: fe,
|
|
1984
2034
|
setActivePanel: le,
|
|
1985
|
-
unreadCommentCount: (
|
|
2035
|
+
unreadCommentCount: (M == null ? void 0 : M.unreadCommentCount) ?? 0,
|
|
1986
2036
|
hasMultipleAttempts: N
|
|
1987
2037
|
};
|
|
1988
2038
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
@@ -1998,38 +2048,38 @@ function Wo({
|
|
|
1998
2048
|
isOverdue: Ie
|
|
1999
2049
|
}
|
|
2000
2050
|
),
|
|
2001
|
-
h.description && /* @__PURE__ */ S(
|
|
2051
|
+
h.description && /* @__PURE__ */ S(Z, { as: "div", children: [
|
|
2002
2052
|
/* @__PURE__ */ r(St, { level: "h3", children: m.assignmentInstructions() }),
|
|
2003
|
-
/* @__PURE__ */ r(
|
|
2053
|
+
/* @__PURE__ */ r(Z, { as: "div", margin: "small none large none", children: f(h.description) })
|
|
2004
2054
|
] }),
|
|
2005
2055
|
/* @__PURE__ */ r(
|
|
2006
2056
|
to,
|
|
2007
2057
|
{
|
|
2008
2058
|
submission: O,
|
|
2009
2059
|
isLastAttempt: ce,
|
|
2010
|
-
renderHTML:
|
|
2060
|
+
renderHTML: f
|
|
2011
2061
|
}
|
|
2012
2062
|
),
|
|
2013
2063
|
d ? d(Ke) : null
|
|
2014
2064
|
] });
|
|
2015
2065
|
}
|
|
2016
2066
|
function qo({
|
|
2017
|
-
existingFiles:
|
|
2067
|
+
existingFiles: t,
|
|
2018
2068
|
onSubmit: n,
|
|
2019
|
-
onSaveDraft:
|
|
2020
|
-
onDiscardDraft:
|
|
2069
|
+
onSaveDraft: i,
|
|
2070
|
+
onDiscardDraft: s,
|
|
2021
2071
|
onSelectFiles: l,
|
|
2022
2072
|
isSubmitting: c = !1
|
|
2023
2073
|
}) {
|
|
2024
|
-
const d = q(), [
|
|
2074
|
+
const d = q(), [p, m] = Ee(t ?? []), f = async () => {
|
|
2025
2075
|
const w = await l();
|
|
2026
2076
|
m((y) => [...y, ...w]);
|
|
2027
2077
|
}, h = (w) => {
|
|
2028
2078
|
m((y) => y.filter((V) => V.id !== w));
|
|
2029
|
-
}, C =
|
|
2079
|
+
}, C = p.map((w) => w.id), I = p.length > 0 && !c;
|
|
2030
2080
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2031
|
-
|
|
2032
|
-
|
|
2081
|
+
p.length > 0 && /* @__PURE__ */ r(b, { direction: "column", gap: "x-small", children: p.map((w) => /* @__PURE__ */ r(
|
|
2082
|
+
Z,
|
|
2033
2083
|
{
|
|
2034
2084
|
as: "div",
|
|
2035
2085
|
padding: "small",
|
|
@@ -2054,7 +2104,7 @@ function qo({
|
|
|
2054
2104
|
},
|
|
2055
2105
|
w.id
|
|
2056
2106
|
)) }),
|
|
2057
|
-
/* @__PURE__ */ r($, { onClick:
|
|
2107
|
+
/* @__PURE__ */ r($, { onClick: f, children: d.submissionFormAddFiles() }),
|
|
2058
2108
|
/* @__PURE__ */ S(b, { gap: "small", children: [
|
|
2059
2109
|
/* @__PURE__ */ r(
|
|
2060
2110
|
$,
|
|
@@ -2065,36 +2115,36 @@ function qo({
|
|
|
2065
2115
|
children: d.submissionFormSubmit()
|
|
2066
2116
|
}
|
|
2067
2117
|
),
|
|
2068
|
-
|
|
2118
|
+
i && /* @__PURE__ */ r(
|
|
2069
2119
|
$,
|
|
2070
2120
|
{
|
|
2071
|
-
onClick: () =>
|
|
2072
|
-
interaction:
|
|
2121
|
+
onClick: () => i(C),
|
|
2122
|
+
interaction: p.length > 0 ? "enabled" : "disabled",
|
|
2073
2123
|
children: d.submissionFormSaveDraft()
|
|
2074
2124
|
}
|
|
2075
2125
|
),
|
|
2076
|
-
|
|
2126
|
+
s && t && t.length > 0 && /* @__PURE__ */ r($, { color: "primary-inverse", onClick: s, children: d.submissionFormDiscardDraft() })
|
|
2077
2127
|
] })
|
|
2078
2128
|
] });
|
|
2079
2129
|
}
|
|
2080
2130
|
function Yo({
|
|
2081
|
-
prevItem:
|
|
2131
|
+
prevItem: t,
|
|
2082
2132
|
nextItem: n,
|
|
2083
|
-
onNavigatePrev:
|
|
2084
|
-
onNavigateNext:
|
|
2133
|
+
onNavigatePrev: i,
|
|
2134
|
+
onNavigateNext: s,
|
|
2085
2135
|
labels: l
|
|
2086
2136
|
}) {
|
|
2087
2137
|
const c = q();
|
|
2088
|
-
if (!
|
|
2138
|
+
if (!t && !n)
|
|
2089
2139
|
return null;
|
|
2090
|
-
const d = (l == null ? void 0 : l.previous) ?? c.navigationPrevious(),
|
|
2140
|
+
const d = (l == null ? void 0 : l.previous) ?? c.navigationPrevious(), p = (l == null ? void 0 : l.next) ?? c.navigationNext();
|
|
2091
2141
|
return /* @__PURE__ */ S(b, { justifyItems: "space-between", padding: "small none", children: [
|
|
2092
|
-
|
|
2142
|
+
t ? /* @__PURE__ */ r(
|
|
2093
2143
|
$,
|
|
2094
2144
|
{
|
|
2095
2145
|
renderIcon: () => /* @__PURE__ */ r(fn, {}),
|
|
2096
|
-
onClick:
|
|
2097
|
-
"aria-label": `${d}: ${
|
|
2146
|
+
onClick: i,
|
|
2147
|
+
"aria-label": `${d}: ${t.title}`,
|
|
2098
2148
|
children: d
|
|
2099
2149
|
}
|
|
2100
2150
|
) : /* @__PURE__ */ r("div", {}),
|
|
@@ -2102,15 +2152,15 @@ function Yo({
|
|
|
2102
2152
|
$,
|
|
2103
2153
|
{
|
|
2104
2154
|
renderIcon: () => /* @__PURE__ */ r(pn, {}),
|
|
2105
|
-
onClick:
|
|
2106
|
-
"aria-label": `${
|
|
2107
|
-
children:
|
|
2155
|
+
onClick: s,
|
|
2156
|
+
"aria-label": `${p}: ${n.title}`,
|
|
2157
|
+
children: p
|
|
2108
2158
|
}
|
|
2109
2159
|
) : /* @__PURE__ */ r("div", {})
|
|
2110
2160
|
] });
|
|
2111
2161
|
}
|
|
2112
|
-
function ho(
|
|
2113
|
-
switch (
|
|
2162
|
+
function ho(t) {
|
|
2163
|
+
switch (t) {
|
|
2114
2164
|
case "Assignment":
|
|
2115
2165
|
return /* @__PURE__ */ r(Kn, {});
|
|
2116
2166
|
case "Quiz":
|
|
@@ -2127,74 +2177,74 @@ function ho(e) {
|
|
|
2127
2177
|
}
|
|
2128
2178
|
}
|
|
2129
2179
|
function bo({
|
|
2130
|
-
item:
|
|
2180
|
+
item: t,
|
|
2131
2181
|
isSelected: n,
|
|
2132
|
-
isLoadingItem:
|
|
2133
|
-
onClick:
|
|
2182
|
+
isLoadingItem: i,
|
|
2183
|
+
onClick: s
|
|
2134
2184
|
}) {
|
|
2135
|
-
var m,
|
|
2136
|
-
const l = q(), c = ((m =
|
|
2137
|
-
|
|
2185
|
+
var m, f, h, C, I;
|
|
2186
|
+
const l = q(), c = ((m = t.content_details) == null ? void 0 : m.locked_for_user) ?? !1, d = (f = t.content_details) == null ? void 0 : f.lock_explanation, p = /* @__PURE__ */ r(
|
|
2187
|
+
Z,
|
|
2138
2188
|
{
|
|
2139
2189
|
as: "div",
|
|
2140
2190
|
padding: "small",
|
|
2141
2191
|
background: n ? "secondary" : "primary",
|
|
2142
2192
|
borderRadius: "small",
|
|
2143
2193
|
cursor: c ? "not-allowed" : "pointer",
|
|
2144
|
-
onClick: c ? void 0 :
|
|
2194
|
+
onClick: c ? void 0 : s,
|
|
2145
2195
|
role: c ? void 0 : "button",
|
|
2146
2196
|
tabIndex: c ? void 0 : 0,
|
|
2147
2197
|
onKeyDown: c ? void 0 : (w) => {
|
|
2148
|
-
(w.key === "Enter" || w.key === " ") && (w.preventDefault(),
|
|
2198
|
+
(w.key === "Enter" || w.key === " ") && (w.preventDefault(), s());
|
|
2149
2199
|
},
|
|
2150
2200
|
children: /* @__PURE__ */ S(b, { gap: "small", alignItems: "center", children: [
|
|
2151
|
-
/* @__PURE__ */ r(b.Item, { children: c ? /* @__PURE__ */ r(gn, {}) : ho(
|
|
2201
|
+
/* @__PURE__ */ r(b.Item, { children: c ? /* @__PURE__ */ r(gn, {}) : ho(t.type) }),
|
|
2152
2202
|
/* @__PURE__ */ r(b.Item, { shouldGrow: !0, shouldShrink: !0, children: /* @__PURE__ */ S(b, { direction: "column", gap: "xx-small", children: [
|
|
2153
|
-
/* @__PURE__ */ r(_, { weight: n ? "bold" : "normal", size: "small", children:
|
|
2154
|
-
((h =
|
|
2155
|
-
date: new Date(
|
|
2203
|
+
/* @__PURE__ */ r(_, { weight: n ? "bold" : "normal", size: "small", children: t.title }),
|
|
2204
|
+
((h = t.content_details) == null ? void 0 : h.due_at) && /* @__PURE__ */ r(_, { size: "x-small", color: "secondary", children: l.progressDueDate({
|
|
2205
|
+
date: new Date(t.content_details.due_at).toLocaleDateString()
|
|
2156
2206
|
}) }),
|
|
2157
|
-
((C =
|
|
2207
|
+
((C = t.content_details) == null ? void 0 : C.points_possible) != null && /* @__PURE__ */ r(_, { size: "x-small", color: "secondary", children: l.progressPoints({ points: t.content_details.points_possible }) })
|
|
2158
2208
|
] }) }),
|
|
2159
|
-
|
|
2160
|
-
((I =
|
|
2209
|
+
i && /* @__PURE__ */ r(Ye, { size: "x-small", renderTitle: l.progressLoading() }),
|
|
2210
|
+
((I = t.completion_requirement) == null ? void 0 : I.completed) && /* @__PURE__ */ r(_, { color: "success", size: "small", children: "✓" })
|
|
2161
2211
|
] })
|
|
2162
2212
|
}
|
|
2163
2213
|
);
|
|
2164
|
-
return c && d ? /* @__PURE__ */ r(Jn, { renderTip: d, placement: "end", children:
|
|
2214
|
+
return c && d ? /* @__PURE__ */ r(Jn, { renderTip: d, placement: "end", children: p }) : p;
|
|
2165
2215
|
}
|
|
2166
2216
|
function Vo({
|
|
2167
|
-
module:
|
|
2217
|
+
module: t,
|
|
2168
2218
|
currentItemId: n,
|
|
2169
|
-
onItemClick:
|
|
2170
|
-
onClose:
|
|
2219
|
+
onItemClick: i,
|
|
2220
|
+
onClose: s,
|
|
2171
2221
|
onNavigateModule: l,
|
|
2172
2222
|
hasPrevModule: c = !1,
|
|
2173
2223
|
hasNextModule: d = !1,
|
|
2174
|
-
isLoading:
|
|
2224
|
+
isLoading: p = !1,
|
|
2175
2225
|
title: m
|
|
2176
2226
|
}) {
|
|
2177
2227
|
var C;
|
|
2178
|
-
const
|
|
2228
|
+
const f = q(), h = m ?? f.navigationMyProgress();
|
|
2179
2229
|
return /* @__PURE__ */ S(b, { direction: "column", height: "100%", children: [
|
|
2180
2230
|
/* @__PURE__ */ S(b, { justifyItems: "space-between", alignItems: "center", padding: "small", children: [
|
|
2181
2231
|
/* @__PURE__ */ r(St, { level: "h3", children: h }),
|
|
2182
|
-
/* @__PURE__ */ r(Qn, { screenReaderLabel:
|
|
2232
|
+
/* @__PURE__ */ r(Qn, { screenReaderLabel: f.navigationClosePanel(), onClick: s, size: "small", children: /* @__PURE__ */ r(qn, {}) })
|
|
2183
2233
|
] }),
|
|
2184
|
-
/* @__PURE__ */ S(
|
|
2185
|
-
|
|
2234
|
+
/* @__PURE__ */ S(Z, { as: "div", padding: "none small", overflowY: "auto", children: [
|
|
2235
|
+
t.state === "locked" && /* @__PURE__ */ r(b, { padding: "none none small", children: /* @__PURE__ */ S(_t, { color: "warning", children: [
|
|
2186
2236
|
/* @__PURE__ */ r(gn, {}),
|
|
2187
2237
|
" ",
|
|
2188
|
-
|
|
2238
|
+
f.progressLocked()
|
|
2189
2239
|
] }) }),
|
|
2190
|
-
/* @__PURE__ */ r(_, { weight: "bold", size: "medium", children:
|
|
2191
|
-
/* @__PURE__ */ r(b, { direction: "column", gap: "xx-small", padding: "small none", children: (C =
|
|
2240
|
+
/* @__PURE__ */ r(_, { weight: "bold", size: "medium", children: t.name }),
|
|
2241
|
+
/* @__PURE__ */ r(b, { direction: "column", gap: "xx-small", padding: "small none", children: (C = t.items) == null ? void 0 : C.map((I) => /* @__PURE__ */ r(
|
|
2192
2242
|
bo,
|
|
2193
2243
|
{
|
|
2194
2244
|
item: I,
|
|
2195
2245
|
isSelected: I.id === n,
|
|
2196
|
-
isLoadingItem:
|
|
2197
|
-
onClick: () =>
|
|
2246
|
+
isLoadingItem: p && I.id === n,
|
|
2247
|
+
onClick: () => i(I)
|
|
2198
2248
|
},
|
|
2199
2249
|
I.id
|
|
2200
2250
|
)) })
|
|
@@ -2207,8 +2257,8 @@ function Vo({
|
|
|
2207
2257
|
size: "small",
|
|
2208
2258
|
interaction: c ? "enabled" : "disabled",
|
|
2209
2259
|
onClick: () => l("prev"),
|
|
2210
|
-
"aria-label":
|
|
2211
|
-
children:
|
|
2260
|
+
"aria-label": f.navigationPreviousModule(),
|
|
2261
|
+
children: f.navigationPrevious()
|
|
2212
2262
|
}
|
|
2213
2263
|
),
|
|
2214
2264
|
/* @__PURE__ */ r(
|
|
@@ -2218,28 +2268,28 @@ function Vo({
|
|
|
2218
2268
|
size: "small",
|
|
2219
2269
|
interaction: d ? "enabled" : "disabled",
|
|
2220
2270
|
onClick: () => l("next"),
|
|
2221
|
-
"aria-label":
|
|
2222
|
-
children:
|
|
2271
|
+
"aria-label": f.navigationNextModule(),
|
|
2272
|
+
children: f.navigationNext()
|
|
2223
2273
|
}
|
|
2224
2274
|
)
|
|
2225
2275
|
] })
|
|
2226
2276
|
] });
|
|
2227
2277
|
}
|
|
2228
2278
|
function Xo({
|
|
2229
|
-
existingDraft:
|
|
2279
|
+
existingDraft: t,
|
|
2230
2280
|
onSubmit: n,
|
|
2231
|
-
onSaveDraft:
|
|
2232
|
-
onDiscardDraft:
|
|
2281
|
+
onSaveDraft: i,
|
|
2282
|
+
onDiscardDraft: s,
|
|
2233
2283
|
isSubmitting: l = !1
|
|
2234
2284
|
}) {
|
|
2235
|
-
const c = q(), [d,
|
|
2285
|
+
const c = q(), [d, p] = Ee(t ?? ""), m = d.trim().length > 0 && !l;
|
|
2236
2286
|
return /* @__PURE__ */ S(b, { direction: "column", gap: "medium", children: [
|
|
2237
2287
|
/* @__PURE__ */ r(
|
|
2238
2288
|
bn,
|
|
2239
2289
|
{
|
|
2240
2290
|
label: c.submissionTextHeading(),
|
|
2241
2291
|
value: d,
|
|
2242
|
-
onChange: (
|
|
2292
|
+
onChange: (f) => p(f.target.value),
|
|
2243
2293
|
resize: "vertical",
|
|
2244
2294
|
height: "200px"
|
|
2245
2295
|
}
|
|
@@ -2254,37 +2304,37 @@ function Xo({
|
|
|
2254
2304
|
children: c.submissionFormSubmit()
|
|
2255
2305
|
}
|
|
2256
2306
|
),
|
|
2257
|
-
|
|
2307
|
+
i && /* @__PURE__ */ r(
|
|
2258
2308
|
$,
|
|
2259
2309
|
{
|
|
2260
|
-
onClick: () =>
|
|
2310
|
+
onClick: () => i(d),
|
|
2261
2311
|
interaction: d.trim().length > 0 ? "enabled" : "disabled",
|
|
2262
2312
|
children: c.submissionFormSaveDraft()
|
|
2263
2313
|
}
|
|
2264
2314
|
),
|
|
2265
|
-
|
|
2315
|
+
s && t && /* @__PURE__ */ r($, { color: "primary-inverse", onClick: s, children: c.submissionFormDiscardDraft() })
|
|
2266
2316
|
] })
|
|
2267
2317
|
] });
|
|
2268
2318
|
}
|
|
2269
2319
|
function Ko({
|
|
2270
|
-
unreadCount:
|
|
2320
|
+
unreadCount: t
|
|
2271
2321
|
}) {
|
|
2272
2322
|
const n = q();
|
|
2273
|
-
if (
|
|
2323
|
+
if (t === 0)
|
|
2274
2324
|
return null;
|
|
2275
|
-
const
|
|
2276
|
-
return /* @__PURE__ */ r(Tn, { count:
|
|
2325
|
+
const i = t === 1 ? n.commentsUnreadSingle() : n.commentsUnread({ count: t });
|
|
2326
|
+
return /* @__PURE__ */ r(Tn, { count: t, standalone: !0, children: /* @__PURE__ */ r(Et, { children: i }) });
|
|
2277
2327
|
}
|
|
2278
2328
|
function Zo({
|
|
2279
|
-
courseId:
|
|
2329
|
+
courseId: t,
|
|
2280
2330
|
moduleItemId: n,
|
|
2281
|
-
fetchSequence:
|
|
2282
|
-
enabled:
|
|
2331
|
+
fetchSequence: i,
|
|
2332
|
+
enabled: s = !0
|
|
2283
2333
|
}) {
|
|
2284
2334
|
return Ve({
|
|
2285
|
-
queryKey: ["assignment-review", "module-item-sequence",
|
|
2286
|
-
queryFn: () =>
|
|
2287
|
-
enabled:
|
|
2335
|
+
queryKey: ["assignment-review", "module-item-sequence", t, n],
|
|
2336
|
+
queryFn: () => i(t, n),
|
|
2337
|
+
enabled: s && !!n
|
|
2288
2338
|
});
|
|
2289
2339
|
}
|
|
2290
2340
|
export {
|