@instructure/platform-assignment-review 0.1.0 → 0.2.0

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