@instructure/platform-grades 0.0.4 → 0.2.1
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/grading/GradeCalculationHelper.d.ts +18 -0
- package/dist/grading/GradeCalculationHelper.d.ts.map +1 -0
- package/dist/grading/GradeFormatHelper.d.ts +42 -0
- package/dist/grading/GradeFormatHelper.d.ts.map +1 -0
- package/dist/grading/GradingSchemeHelper.d.ts +7 -0
- package/dist/grading/GradingSchemeHelper.d.ts.map +1 -0
- package/dist/grading/index.d.ts +7 -0
- package/dist/grading/index.d.ts.map +1 -0
- package/dist/grading/locale.d.ts +47 -0
- package/dist/grading/locale.d.ts.map +1 -0
- package/dist/grading/round.d.ts +11 -0
- package/dist/grading/round.d.ts.map +1 -0
- package/dist/grading/types.d.ts +65 -0
- package/dist/grading/types.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1544 -268
- package/package.json +29 -14
package/dist/index.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Spinner as
|
|
3
|
-
import { Text as
|
|
4
|
-
import { View as
|
|
5
|
-
import { useState as
|
|
6
|
-
import { Table as
|
|
7
|
-
import { Pill as
|
|
8
|
-
import { ToggleDetails as
|
|
9
|
-
import { Heading as
|
|
10
|
-
import { usePlatformUi as
|
|
11
|
-
import { useQuery as
|
|
12
|
-
import { gql as
|
|
13
|
-
import { z as
|
|
14
|
-
import { canvasFetch as
|
|
15
|
-
const
|
|
1
|
+
import { jsxs as x, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { Spinner as et } from "@instructure/ui-spinner";
|
|
3
|
+
import { Text as E } from "@instructure/ui-text";
|
|
4
|
+
import { View as Y } from "@instructure/ui-view";
|
|
5
|
+
import { useState as me, useCallback as tt, useMemo as ee } from "react";
|
|
6
|
+
import { Table as A } from "@instructure/ui-table";
|
|
7
|
+
import { Pill as rt } from "@instructure/ui-pill";
|
|
8
|
+
import { ToggleDetails as nt } from "@instructure/ui-toggle-details";
|
|
9
|
+
import { Heading as it } from "@instructure/ui-heading";
|
|
10
|
+
import { usePlatformUi as st } from "@instructure/platform-provider";
|
|
11
|
+
import { useQuery as be } from "@tanstack/react-query";
|
|
12
|
+
import { gql as ct } from "graphql-tag";
|
|
13
|
+
import { z as d } from "zod";
|
|
14
|
+
import { canvasFetch as ut } from "@instructure/platform-canvas-fetch";
|
|
15
|
+
const k = {
|
|
16
16
|
caption: "Assignment Group Totals",
|
|
17
17
|
assignmentGroup: "Assignment Group",
|
|
18
18
|
weight: "Weight"
|
|
19
19
|
};
|
|
20
|
-
function
|
|
21
|
-
groups:
|
|
22
|
-
labels:
|
|
20
|
+
function ot({
|
|
21
|
+
groups: e,
|
|
22
|
+
labels: t
|
|
23
23
|
}) {
|
|
24
|
-
const
|
|
25
|
-
caption: (
|
|
26
|
-
assignmentGroup: (
|
|
27
|
-
weight: (
|
|
24
|
+
const r = {
|
|
25
|
+
caption: (t == null ? void 0 : t.caption) ?? k.caption,
|
|
26
|
+
assignmentGroup: (t == null ? void 0 : t.assignmentGroup) ?? k.assignmentGroup,
|
|
27
|
+
weight: (t == null ? void 0 : t.weight) ?? k.weight
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ x(A, { caption: r.caption, children: [
|
|
30
|
+
/* @__PURE__ */ l(A.Head, { children: /* @__PURE__ */ x(A.Row, { children: [
|
|
31
|
+
/* @__PURE__ */ l(A.ColHeader, { id: "group-name", children: r.assignmentGroup }),
|
|
32
|
+
/* @__PURE__ */ l(A.ColHeader, { id: "group-weight", children: r.weight })
|
|
33
33
|
] }) }),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
34
|
+
/* @__PURE__ */ l(A.Body, { children: e.map((n) => /* @__PURE__ */ x(A.Row, { children: [
|
|
35
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ l(E, { children: n.groupName }) }),
|
|
36
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ x(E, { children: [
|
|
37
|
+
n.groupWeight,
|
|
38
38
|
"%"
|
|
39
39
|
] }) })
|
|
40
|
-
] },
|
|
40
|
+
] }, n.groupId)) })
|
|
41
41
|
] });
|
|
42
42
|
}
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
return
|
|
43
|
+
const Ne = (e, t, r) => e ? r ?? "-" : t != null ? `${Math.round(t)}%` : "-", Ee = (e) => e === "letter_grade" || e === "gpa_scale" || e === "pass_fail", ft = (e, t) => !!e || Ee(t), ye = (e, t, r) => {
|
|
44
|
+
const n = r ?? 0;
|
|
45
|
+
return Ee(t) ? e !== null ? String(e) : "-" : `${e !== null ? e : "-"}/${n}`;
|
|
46
46
|
};
|
|
47
|
-
function
|
|
48
|
-
if (
|
|
49
|
-
return /* @__PURE__ */
|
|
50
|
-
const
|
|
51
|
-
return /* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
function at({ comments: e }) {
|
|
48
|
+
if (e.length === 0)
|
|
49
|
+
return /* @__PURE__ */ l(E, { children: "-" });
|
|
50
|
+
const t = e.some((r) => !r.read);
|
|
51
|
+
return /* @__PURE__ */ l(Y, { as: "span", display: "inline-flex", children: /* @__PURE__ */ x(E, { children: [
|
|
52
|
+
t ? "• " : "",
|
|
53
|
+
e.length
|
|
54
54
|
] }) });
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const W = {
|
|
57
57
|
submitted: "Submitted",
|
|
58
58
|
notSubmitted: "Not Submitted",
|
|
59
59
|
late: "Late",
|
|
60
60
|
excused: "Excused",
|
|
61
61
|
missing: "Missing"
|
|
62
62
|
};
|
|
63
|
-
function
|
|
64
|
-
return
|
|
63
|
+
function dt(e, t) {
|
|
64
|
+
return e.state === "submitted" || e.state === "pending_review" || e.state === "graded" && e.score !== null ? t.submitted : e.excused ? t.excused : e.late ? t.late : e.missing ? t.missing : t.notSubmitted;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
score:
|
|
68
|
-
labels:
|
|
66
|
+
function gt({
|
|
67
|
+
score: e,
|
|
68
|
+
labels: t
|
|
69
69
|
}) {
|
|
70
|
-
const
|
|
71
|
-
submitted: (
|
|
72
|
-
notSubmitted: (
|
|
73
|
-
late: (
|
|
74
|
-
excused: (
|
|
75
|
-
missing: (
|
|
76
|
-
},
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
}
|
|
79
|
-
const
|
|
70
|
+
const r = {
|
|
71
|
+
submitted: (t == null ? void 0 : t.submitted) ?? W.submitted,
|
|
72
|
+
notSubmitted: (t == null ? void 0 : t.notSubmitted) ?? W.notSubmitted,
|
|
73
|
+
late: (t == null ? void 0 : t.late) ?? W.late,
|
|
74
|
+
excused: (t == null ? void 0 : t.excused) ?? W.excused,
|
|
75
|
+
missing: (t == null ? void 0 : t.missing) ?? W.missing
|
|
76
|
+
}, n = dt(e, r), s = n === r.late || n === r.missing ? "danger" : "info";
|
|
77
|
+
return /* @__PURE__ */ l(rt, { color: s, children: n });
|
|
78
|
+
}
|
|
79
|
+
const F = {
|
|
80
80
|
caption: "Assignment Scores",
|
|
81
81
|
name: "Name",
|
|
82
82
|
dueDate: "Due Date",
|
|
@@ -85,118 +85,118 @@ const S = {
|
|
|
85
85
|
feedback: "Feedback",
|
|
86
86
|
noAssignments: "No assignments"
|
|
87
87
|
};
|
|
88
|
-
function
|
|
89
|
-
return
|
|
88
|
+
function lt(e) {
|
|
89
|
+
return e ? new Date(e).toLocaleDateString(void 0, {
|
|
90
90
|
year: "numeric",
|
|
91
91
|
month: "short",
|
|
92
92
|
day: "numeric"
|
|
93
93
|
}) : "-";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
return i.name.localeCompare(
|
|
100
|
-
const c = i.dueAt ? new Date(i.dueAt).getTime() : 0, u =
|
|
95
|
+
function ht(e, t, r) {
|
|
96
|
+
if (r === "none") return e;
|
|
97
|
+
const n = [...e].sort((i, s) => {
|
|
98
|
+
if (t === "name")
|
|
99
|
+
return i.name.localeCompare(s.name);
|
|
100
|
+
const c = i.dueAt ? new Date(i.dueAt).getTime() : 0, u = s.dueAt ? new Date(s.dueAt).getTime() : 0;
|
|
101
101
|
return c - u;
|
|
102
102
|
});
|
|
103
|
-
return
|
|
103
|
+
return r === "descending" ? n.reverse() : n;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
scores:
|
|
107
|
-
onAssignmentClick:
|
|
108
|
-
labels:
|
|
109
|
-
statusLabels:
|
|
105
|
+
function mt({
|
|
106
|
+
scores: e,
|
|
107
|
+
onAssignmentClick: t,
|
|
108
|
+
labels: r,
|
|
109
|
+
statusLabels: n
|
|
110
110
|
}) {
|
|
111
111
|
const i = {
|
|
112
|
-
caption: (
|
|
113
|
-
name: (
|
|
114
|
-
dueDate: (
|
|
115
|
-
status: (
|
|
116
|
-
result: (
|
|
117
|
-
feedback: (
|
|
118
|
-
noAssignments: (
|
|
119
|
-
}, [
|
|
120
|
-
(
|
|
121
|
-
const
|
|
122
|
-
|
|
112
|
+
caption: (r == null ? void 0 : r.caption) ?? F.caption,
|
|
113
|
+
name: (r == null ? void 0 : r.name) ?? F.name,
|
|
114
|
+
dueDate: (r == null ? void 0 : r.dueDate) ?? F.dueDate,
|
|
115
|
+
status: (r == null ? void 0 : r.status) ?? F.status,
|
|
116
|
+
result: (r == null ? void 0 : r.result) ?? F.result,
|
|
117
|
+
feedback: (r == null ? void 0 : r.feedback) ?? F.feedback,
|
|
118
|
+
noAssignments: (r == null ? void 0 : r.noAssignments) ?? F.noAssignments
|
|
119
|
+
}, [s, c] = me("name"), [u, f] = me("none"), o = tt(
|
|
120
|
+
(h, { id: b }) => {
|
|
121
|
+
const P = b;
|
|
122
|
+
P === s ? f((g) => g === "ascending" ? "descending" : "ascending") : (c(P), f("ascending"));
|
|
123
123
|
},
|
|
124
|
-
[
|
|
125
|
-
),
|
|
126
|
-
() =>
|
|
127
|
-
[
|
|
128
|
-
),
|
|
129
|
-
return
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
124
|
+
[s]
|
|
125
|
+
), m = ee(
|
|
126
|
+
() => ht(e, s, u),
|
|
127
|
+
[e, s, u]
|
|
128
|
+
), a = (h) => h === s ? u : "none";
|
|
129
|
+
return e.length === 0 ? /* @__PURE__ */ l(E, { children: i.noAssignments }) : /* @__PURE__ */ x(A, { caption: i.caption, hover: !!t, children: [
|
|
130
|
+
/* @__PURE__ */ l(A.Head, { renderSortLabel: "Sort by", children: /* @__PURE__ */ x(A.Row, { children: [
|
|
131
|
+
/* @__PURE__ */ l(
|
|
132
|
+
A.ColHeader,
|
|
133
133
|
{
|
|
134
134
|
id: "name",
|
|
135
|
-
onRequestSort:
|
|
136
|
-
sortDirection:
|
|
135
|
+
onRequestSort: o,
|
|
136
|
+
sortDirection: a("name"),
|
|
137
137
|
children: i.name
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
140
|
+
/* @__PURE__ */ l(
|
|
141
|
+
A.ColHeader,
|
|
142
142
|
{
|
|
143
143
|
id: "dueDate",
|
|
144
|
-
onRequestSort:
|
|
145
|
-
sortDirection:
|
|
144
|
+
onRequestSort: o,
|
|
145
|
+
sortDirection: a("dueDate"),
|
|
146
146
|
children: i.dueDate
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ l(A.ColHeader, { id: "status", children: i.status }),
|
|
150
|
+
/* @__PURE__ */ l(A.ColHeader, { id: "result", children: i.result }),
|
|
151
|
+
/* @__PURE__ */ l(A.ColHeader, { id: "feedback", children: i.feedback })
|
|
152
152
|
] }) }),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
153
|
+
/* @__PURE__ */ l(A.Body, { children: m.map((h) => /* @__PURE__ */ x(
|
|
154
|
+
A.Row,
|
|
155
155
|
{
|
|
156
|
-
onClick:
|
|
156
|
+
onClick: t ? () => t(h.assignmentId) : void 0,
|
|
157
157
|
children: [
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ l(E, { children: h.name }) }),
|
|
159
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ l(E, { children: h.dueAt ? lt(h.dueAt) : "-" }) }),
|
|
160
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ l(gt, { score: h, labels: n }) }),
|
|
161
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ l(E, { children: ye(h.score, h.gradingType, h.pointsPossible) }) }),
|
|
162
|
+
/* @__PURE__ */ l(A.Cell, { children: /* @__PURE__ */ l(at, { comments: h.comments }) })
|
|
163
163
|
]
|
|
164
164
|
},
|
|
165
|
-
|
|
165
|
+
h.assignmentId
|
|
166
166
|
)) })
|
|
167
167
|
] });
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
title:
|
|
171
|
-
defaultExpanded:
|
|
172
|
-
children:
|
|
169
|
+
function pt({
|
|
170
|
+
title: e,
|
|
171
|
+
defaultExpanded: t = !1,
|
|
172
|
+
children: r
|
|
173
173
|
}) {
|
|
174
|
-
return /* @__PURE__ */
|
|
174
|
+
return /* @__PURE__ */ l(nt, { summary: e, defaultExpanded: t, children: r });
|
|
175
175
|
}
|
|
176
|
-
const
|
|
176
|
+
const pe = {
|
|
177
177
|
total: "Total: {{score}}",
|
|
178
178
|
noActivities: "There are no scored activities in this course."
|
|
179
179
|
};
|
|
180
|
-
function
|
|
181
|
-
currentScore:
|
|
182
|
-
currentGrade:
|
|
183
|
-
restrictQuantitativeData:
|
|
184
|
-
hideFinalGrade:
|
|
180
|
+
function St({
|
|
181
|
+
currentScore: e,
|
|
182
|
+
currentGrade: t,
|
|
183
|
+
restrictQuantitativeData: r,
|
|
184
|
+
hideFinalGrade: n,
|
|
185
185
|
hasScoredActivities: i,
|
|
186
|
-
labels:
|
|
186
|
+
labels: s
|
|
187
187
|
}) {
|
|
188
188
|
const c = {
|
|
189
|
-
total: (
|
|
190
|
-
noActivities: (
|
|
189
|
+
total: (s == null ? void 0 : s.total) ?? pe.total,
|
|
190
|
+
noActivities: (s == null ? void 0 : s.noActivities) ?? pe.noActivities
|
|
191
191
|
};
|
|
192
192
|
if (!i)
|
|
193
|
-
return /* @__PURE__ */
|
|
194
|
-
if (
|
|
193
|
+
return /* @__PURE__ */ l(E, { children: c.noActivities });
|
|
194
|
+
if (n)
|
|
195
195
|
return null;
|
|
196
|
-
const u =
|
|
197
|
-
return /* @__PURE__ */
|
|
196
|
+
const u = Ne(r, e, t), f = c.total.replace("{{score}}", u);
|
|
197
|
+
return /* @__PURE__ */ l(it, { level: "h2", children: f });
|
|
198
198
|
}
|
|
199
|
-
const
|
|
199
|
+
const wt = ct`
|
|
200
200
|
query GetSubmissionScoresForCourse($enrollmentId: ID!, $userId: ID!) {
|
|
201
201
|
legacyNode(_id: $enrollmentId, type: Enrollment) {
|
|
202
202
|
... on Enrollment {
|
|
@@ -253,7 +253,7 @@ const X = k`
|
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
|
-
`,
|
|
256
|
+
`, At = d.enum([
|
|
257
257
|
"attendance",
|
|
258
258
|
"basic_lti_launch",
|
|
259
259
|
"discussion_topic",
|
|
@@ -268,204 +268,1480 @@ const X = k`
|
|
|
268
268
|
"online_url",
|
|
269
269
|
"student_annotation",
|
|
270
270
|
"wiki_page"
|
|
271
|
-
]),
|
|
272
|
-
_id:
|
|
273
|
-
read:
|
|
274
|
-
}),
|
|
275
|
-
currentScore:
|
|
276
|
-
finalScore:
|
|
277
|
-
finalGrade:
|
|
278
|
-
state:
|
|
279
|
-
}),
|
|
280
|
-
state:
|
|
281
|
-
submissionStatus:
|
|
282
|
-
late:
|
|
283
|
-
excused:
|
|
284
|
-
missing:
|
|
285
|
-
score:
|
|
286
|
-
grade:
|
|
287
|
-
commentsConnection:
|
|
288
|
-
nodes:
|
|
271
|
+
]), _t = d.object({
|
|
272
|
+
_id: d.string(),
|
|
273
|
+
read: d.boolean()
|
|
274
|
+
}), bt = d.object({
|
|
275
|
+
currentScore: d.number().nullable(),
|
|
276
|
+
finalScore: d.number().nullable(),
|
|
277
|
+
finalGrade: d.string().nullable(),
|
|
278
|
+
state: d.string()
|
|
279
|
+
}), Nt = d.object({
|
|
280
|
+
state: d.string(),
|
|
281
|
+
submissionStatus: d.string(),
|
|
282
|
+
late: d.boolean(),
|
|
283
|
+
excused: d.boolean(),
|
|
284
|
+
missing: d.boolean(),
|
|
285
|
+
score: d.number().nullable(),
|
|
286
|
+
grade: d.string().nullable(),
|
|
287
|
+
commentsConnection: d.object({
|
|
288
|
+
nodes: d.array(_t)
|
|
289
289
|
})
|
|
290
|
-
}),
|
|
291
|
-
_id:
|
|
292
|
-
name:
|
|
293
|
-
dueAt:
|
|
294
|
-
pointsPossible:
|
|
295
|
-
gradingType:
|
|
296
|
-
submissionsConnection:
|
|
297
|
-
nodes:
|
|
290
|
+
}), Et = d.object({
|
|
291
|
+
_id: d.string(),
|
|
292
|
+
name: d.string(),
|
|
293
|
+
dueAt: d.string().nullable(),
|
|
294
|
+
pointsPossible: d.number().nullable(),
|
|
295
|
+
gradingType: d.string(),
|
|
296
|
+
submissionsConnection: d.object({
|
|
297
|
+
nodes: d.array(Nt)
|
|
298
298
|
}),
|
|
299
|
-
submissionTypes:
|
|
300
|
-
}).strict(),
|
|
301
|
-
_id:
|
|
302
|
-
name:
|
|
303
|
-
groupWeight:
|
|
304
|
-
gradesConnection:
|
|
305
|
-
nodes:
|
|
299
|
+
submissionTypes: d.array(At)
|
|
300
|
+
}).strict(), yt = d.object({
|
|
301
|
+
_id: d.string(),
|
|
302
|
+
name: d.string(),
|
|
303
|
+
groupWeight: d.number().nullable(),
|
|
304
|
+
gradesConnection: d.object({
|
|
305
|
+
nodes: d.array(bt)
|
|
306
306
|
}),
|
|
307
|
-
assignmentsConnection:
|
|
308
|
-
nodes:
|
|
307
|
+
assignmentsConnection: d.object({
|
|
308
|
+
nodes: d.array(Et)
|
|
309
309
|
})
|
|
310
|
-
}),
|
|
311
|
-
applyGroupWeights:
|
|
312
|
-
assignmentGroups:
|
|
313
|
-
}),
|
|
314
|
-
grades:
|
|
315
|
-
finalScore:
|
|
316
|
-
finalGrade:
|
|
317
|
-
currentScore:
|
|
318
|
-
currentGrade:
|
|
310
|
+
}), Dt = d.object({
|
|
311
|
+
applyGroupWeights: d.boolean(),
|
|
312
|
+
assignmentGroups: d.array(yt)
|
|
313
|
+
}), Pt = d.object({
|
|
314
|
+
grades: d.object({
|
|
315
|
+
finalScore: d.number().nullable(),
|
|
316
|
+
finalGrade: d.string().nullable(),
|
|
317
|
+
currentScore: d.number().nullable(),
|
|
318
|
+
currentGrade: d.string().nullable()
|
|
319
319
|
}).nullable(),
|
|
320
|
-
course:
|
|
321
|
-
}),
|
|
322
|
-
id:
|
|
323
|
-
settings:
|
|
324
|
-
restrict_quantitative_data:
|
|
325
|
-
hide_final_grade:
|
|
320
|
+
course: Dt
|
|
321
|
+
}), Gt = d.object({
|
|
322
|
+
id: d.number(),
|
|
323
|
+
settings: d.object({
|
|
324
|
+
restrict_quantitative_data: d.boolean().nullable(),
|
|
325
|
+
hide_final_grade: d.boolean().nullable()
|
|
326
326
|
})
|
|
327
327
|
});
|
|
328
|
-
function
|
|
329
|
-
enrollmentId:
|
|
330
|
-
userId:
|
|
331
|
-
enabled:
|
|
328
|
+
function xt({
|
|
329
|
+
enrollmentId: e,
|
|
330
|
+
userId: t,
|
|
331
|
+
enabled: r = !0
|
|
332
332
|
}) {
|
|
333
|
-
const { executeQuery:
|
|
334
|
-
return
|
|
335
|
-
queryKey: ["courseScores",
|
|
336
|
-
enabled:
|
|
333
|
+
const { executeQuery: n } = st();
|
|
334
|
+
return be({
|
|
335
|
+
queryKey: ["courseScores", e, t],
|
|
336
|
+
enabled: r && !!e && !!t,
|
|
337
337
|
queryFn: async () => {
|
|
338
|
-
const i = await
|
|
339
|
-
|
|
340
|
-
{ enrollmentId:
|
|
338
|
+
const i = await n(
|
|
339
|
+
wt,
|
|
340
|
+
{ enrollmentId: e, userId: t }
|
|
341
341
|
);
|
|
342
|
-
return
|
|
342
|
+
return Pt.parse(i.legacyNode);
|
|
343
343
|
},
|
|
344
344
|
gcTime: 0
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
courseId:
|
|
349
|
-
enabled:
|
|
347
|
+
function It({
|
|
348
|
+
courseId: e,
|
|
349
|
+
enabled: t = !0
|
|
350
350
|
}) {
|
|
351
|
-
return
|
|
352
|
-
queryKey: ["courseSettings",
|
|
353
|
-
enabled:
|
|
354
|
-
queryFn: async () => (await
|
|
351
|
+
return be({
|
|
352
|
+
queryKey: ["courseSettings", e],
|
|
353
|
+
enabled: t && !!e,
|
|
354
|
+
queryFn: async () => (await ut(
|
|
355
355
|
{
|
|
356
|
-
path: `/api/v1/courses/${
|
|
356
|
+
path: `/api/v1/courses/${e}`,
|
|
357
357
|
params: { "include[]": "settings" }
|
|
358
358
|
},
|
|
359
|
-
|
|
359
|
+
Gt
|
|
360
360
|
)).data.settings
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
const { course:
|
|
363
|
+
function Ot(e, t) {
|
|
364
|
+
const { course: r, grades: n } = e, i = r.assignmentGroups.map((c) => ({
|
|
365
365
|
groupId: c._id,
|
|
366
366
|
groupName: c.name,
|
|
367
367
|
groupWeight: c.groupWeight ?? 0
|
|
368
368
|
}));
|
|
369
369
|
return {
|
|
370
|
-
totalScore:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
370
|
+
totalScore: Ne(
|
|
371
|
+
t == null ? void 0 : t.restrict_quantitative_data,
|
|
372
|
+
n == null ? void 0 : n.currentScore,
|
|
373
|
+
n == null ? void 0 : n.currentGrade
|
|
374
374
|
),
|
|
375
|
-
applyGroupWeights:
|
|
375
|
+
applyGroupWeights: r.applyGroupWeights,
|
|
376
376
|
assignmentGroupWeights: i
|
|
377
377
|
};
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
return
|
|
381
|
-
(
|
|
379
|
+
function Bt(e, t) {
|
|
380
|
+
return e.course.assignmentGroups.flatMap(
|
|
381
|
+
(r) => r.assignmentsConnection.nodes.map((n) => {
|
|
382
382
|
var u;
|
|
383
|
-
const i =
|
|
384
|
-
|
|
385
|
-
|
|
383
|
+
const i = n.submissionsConnection.nodes[0], c = ft(
|
|
384
|
+
t == null ? void 0 : t.restrict_quantitative_data,
|
|
385
|
+
n.gradingType
|
|
386
386
|
) ? i == null ? void 0 : i.grade : (u = i == null ? void 0 : i.score) == null ? void 0 : u.toString();
|
|
387
387
|
return {
|
|
388
|
-
assignmentId:
|
|
389
|
-
name:
|
|
390
|
-
pointsPossible:
|
|
391
|
-
dueAt:
|
|
388
|
+
assignmentId: n._id,
|
|
389
|
+
name: n.name,
|
|
390
|
+
pointsPossible: n.pointsPossible ?? 0,
|
|
391
|
+
dueAt: n.dueAt ?? "",
|
|
392
392
|
score: c ?? null,
|
|
393
|
-
gradingType:
|
|
393
|
+
gradingType: n.gradingType,
|
|
394
394
|
state: (i == null ? void 0 : i.state) ?? "",
|
|
395
395
|
submissionStatus: (i == null ? void 0 : i.submissionStatus) ?? "",
|
|
396
396
|
comments: (i == null ? void 0 : i.commentsConnection.nodes) ?? [],
|
|
397
397
|
late: (i == null ? void 0 : i.late) ?? !1,
|
|
398
398
|
excused: (i == null ? void 0 : i.excused) ?? !1,
|
|
399
399
|
missing: (i == null ? void 0 : i.missing) ?? !1,
|
|
400
|
-
submissionTypes:
|
|
400
|
+
submissionTypes: n.submissionTypes
|
|
401
401
|
};
|
|
402
402
|
})
|
|
403
403
|
);
|
|
404
404
|
}
|
|
405
|
-
function
|
|
406
|
-
courseId:
|
|
407
|
-
enrollmentId:
|
|
408
|
-
userId:
|
|
409
|
-
onAssignmentClick:
|
|
405
|
+
function hn({
|
|
406
|
+
courseId: e,
|
|
407
|
+
enrollmentId: t,
|
|
408
|
+
userId: r,
|
|
409
|
+
onAssignmentClick: n,
|
|
410
410
|
onError: i,
|
|
411
|
-
labels:
|
|
411
|
+
labels: s
|
|
412
412
|
}) {
|
|
413
|
-
var
|
|
414
|
-
const c =
|
|
413
|
+
var a, h, b, P, g;
|
|
414
|
+
const c = xt({ enrollmentId: t, userId: r }), u = It({ courseId: e }), f = ee(() => c.data ? Ot(c.data, u.data) : null, [c.data, u.data]), o = ee(() => c.data ? Bt(c.data, u.data) : [], [c.data, u.data]);
|
|
415
415
|
if (c.isPending)
|
|
416
|
-
return /* @__PURE__ */
|
|
416
|
+
return /* @__PURE__ */ l(et, { renderTitle: (s == null ? void 0 : s.loading) ?? "Loading..." });
|
|
417
417
|
if (c.isError)
|
|
418
|
-
return i && c.error && i(c.error), /* @__PURE__ */
|
|
419
|
-
const
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
|
|
418
|
+
return i && c.error && i(c.error), /* @__PURE__ */ l(Y, { as: "div", padding: "medium", children: /* @__PURE__ */ l(E, { color: "danger", children: (s == null ? void 0 : s.error) ?? "Failed to load scores." }) });
|
|
419
|
+
const m = o.length > 0;
|
|
420
|
+
return /* @__PURE__ */ x(Y, { as: "div", children: [
|
|
421
|
+
/* @__PURE__ */ l(Y, { as: "div", padding: "small medium", children: /* @__PURE__ */ l(
|
|
422
|
+
St,
|
|
423
423
|
{
|
|
424
|
-
currentScore: (
|
|
425
|
-
currentGrade: (
|
|
426
|
-
restrictQuantitativeData: (
|
|
427
|
-
hideFinalGrade: (
|
|
428
|
-
hasScoredActivities:
|
|
424
|
+
currentScore: (a = c.data.grades) == null ? void 0 : a.currentScore,
|
|
425
|
+
currentGrade: (h = c.data.grades) == null ? void 0 : h.currentGrade,
|
|
426
|
+
restrictQuantitativeData: (b = u.data) == null ? void 0 : b.restrict_quantitative_data,
|
|
427
|
+
hideFinalGrade: (P = u.data) == null ? void 0 : P.hide_final_grade,
|
|
428
|
+
hasScoredActivities: m,
|
|
429
429
|
labels: {
|
|
430
|
-
total:
|
|
431
|
-
noActivities:
|
|
430
|
+
total: s == null ? void 0 : s.total,
|
|
431
|
+
noActivities: s == null ? void 0 : s.noActivities
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
) }),
|
|
435
|
-
(
|
|
436
|
-
|
|
437
|
-
|
|
435
|
+
(f == null ? void 0 : f.applyGroupWeights) && /* @__PURE__ */ l(pt, { title: (s == null ? void 0 : s.assignmentGroupWeights) ?? "Assignment Group Weights", children: /* @__PURE__ */ l(ot, { groups: f.assignmentGroupWeights }) }),
|
|
436
|
+
m && /* @__PURE__ */ l(
|
|
437
|
+
mt,
|
|
438
438
|
{
|
|
439
|
-
scores:
|
|
440
|
-
restrictQuantitativeData: !!((
|
|
441
|
-
onAssignmentClick:
|
|
439
|
+
scores: o,
|
|
440
|
+
restrictQuantitativeData: !!((g = u.data) != null && g.restrict_quantitative_data),
|
|
441
|
+
onAssignmentClick: n
|
|
442
442
|
}
|
|
443
443
|
)
|
|
444
444
|
] });
|
|
445
445
|
}
|
|
446
|
-
function
|
|
447
|
-
score:
|
|
448
|
-
gradingType:
|
|
449
|
-
pointsPossible:
|
|
446
|
+
function mn({
|
|
447
|
+
score: e,
|
|
448
|
+
gradingType: t,
|
|
449
|
+
pointsPossible: r
|
|
450
450
|
}) {
|
|
451
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ l(E, { children: ye(e, t, r) });
|
|
452
|
+
}
|
|
453
|
+
var Ft = 20, Mt = 1, R = 1e6, Se = 1e6, Rt = -7, jt = 21, qt = !1, H = "[big.js] ", q = H + "Invalid ", Z = q + "decimal places", $t = q + "rounding mode", De = H + "Division by zero", p = {}, y = void 0, Lt = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
454
|
+
function Pe() {
|
|
455
|
+
function e(t) {
|
|
456
|
+
var r = this;
|
|
457
|
+
if (!(r instanceof e)) return t === y ? Pe() : new e(t);
|
|
458
|
+
if (t instanceof e)
|
|
459
|
+
r.s = t.s, r.e = t.e, r.c = t.c.slice();
|
|
460
|
+
else {
|
|
461
|
+
if (typeof t != "string") {
|
|
462
|
+
if (e.strict === !0 && typeof t != "bigint")
|
|
463
|
+
throw TypeError(q + "value");
|
|
464
|
+
t = t === 0 && 1 / t < 0 ? "-0" : String(t);
|
|
465
|
+
}
|
|
466
|
+
Ut(r, t);
|
|
467
|
+
}
|
|
468
|
+
r.constructor = e;
|
|
469
|
+
}
|
|
470
|
+
return e.prototype = p, e.DP = Ft, e.RM = Mt, e.NE = Rt, e.PE = jt, e.strict = qt, e.roundDown = 0, e.roundHalfUp = 1, e.roundHalfEven = 2, e.roundUp = 3, e;
|
|
471
|
+
}
|
|
472
|
+
function Ut(e, t) {
|
|
473
|
+
var r, n, i;
|
|
474
|
+
if (!Lt.test(t))
|
|
475
|
+
throw Error(q + "number");
|
|
476
|
+
for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (r = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (n = t.search(/e/i)) > 0 ? (r < 0 && (r = n), r += +t.slice(n + 1), t = t.substring(0, n)) : r < 0 && (r = t.length), i = t.length, n = 0; n < i && t.charAt(n) == "0"; ) ++n;
|
|
477
|
+
if (n == i)
|
|
478
|
+
e.c = [e.e = 0];
|
|
479
|
+
else {
|
|
480
|
+
for (; i > 0 && t.charAt(--i) == "0"; ) ;
|
|
481
|
+
for (e.e = r - n - 1, e.c = [], r = 0; n <= i; ) e.c[r++] = +t.charAt(n++);
|
|
482
|
+
}
|
|
483
|
+
return e;
|
|
484
|
+
}
|
|
485
|
+
function $(e, t, r, n) {
|
|
486
|
+
var i = e.c;
|
|
487
|
+
if (r === y && (r = e.constructor.RM), r !== 0 && r !== 1 && r !== 2 && r !== 3)
|
|
488
|
+
throw Error($t);
|
|
489
|
+
if (t < 1)
|
|
490
|
+
n = r === 3 && (n || !!i[0]) || t === 0 && (r === 1 && i[0] >= 5 || r === 2 && (i[0] > 5 || i[0] === 5 && (n || i[1] !== y))), i.length = 1, n ? (e.e = e.e - t + 1, i[0] = 1) : i[0] = e.e = 0;
|
|
491
|
+
else if (t < i.length) {
|
|
492
|
+
if (n = r === 1 && i[t] >= 5 || r === 2 && (i[t] > 5 || i[t] === 5 && (n || i[t + 1] !== y || i[t - 1] & 1)) || r === 3 && (n || !!i[0]), i.length = t, n) {
|
|
493
|
+
for (; ++i[--t] > 9; )
|
|
494
|
+
if (i[t] = 0, t === 0) {
|
|
495
|
+
++e.e, i.unshift(1);
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
for (t = i.length; !i[--t]; ) i.pop();
|
|
500
|
+
}
|
|
501
|
+
return e;
|
|
502
|
+
}
|
|
503
|
+
function L(e, t, r) {
|
|
504
|
+
var n = e.e, i = e.c.join(""), s = i.length;
|
|
505
|
+
if (t)
|
|
506
|
+
i = i.charAt(0) + (s > 1 ? "." + i.slice(1) : "") + (n < 0 ? "e" : "e+") + n;
|
|
507
|
+
else if (n < 0) {
|
|
508
|
+
for (; ++n; ) i = "0" + i;
|
|
509
|
+
i = "0." + i;
|
|
510
|
+
} else if (n > 0)
|
|
511
|
+
if (++n > s)
|
|
512
|
+
for (n -= s; n--; ) i += "0";
|
|
513
|
+
else n < s && (i = i.slice(0, n) + "." + i.slice(n));
|
|
514
|
+
else s > 1 && (i = i.charAt(0) + "." + i.slice(1));
|
|
515
|
+
return e.s < 0 && r ? "-" + i : i;
|
|
516
|
+
}
|
|
517
|
+
p.abs = function() {
|
|
518
|
+
var e = new this.constructor(this);
|
|
519
|
+
return e.s = 1, e;
|
|
520
|
+
};
|
|
521
|
+
p.cmp = function(e) {
|
|
522
|
+
var t, r = this, n = r.c, i = (e = new r.constructor(e)).c, s = r.s, c = e.s, u = r.e, f = e.e;
|
|
523
|
+
if (!n[0] || !i[0]) return n[0] ? s : i[0] ? -c : 0;
|
|
524
|
+
if (s != c) return s;
|
|
525
|
+
if (t = s < 0, u != f) return u > f ^ t ? 1 : -1;
|
|
526
|
+
for (c = (u = n.length) < (f = i.length) ? u : f, s = -1; ++s < c; )
|
|
527
|
+
if (n[s] != i[s]) return n[s] > i[s] ^ t ? 1 : -1;
|
|
528
|
+
return u == f ? 0 : u > f ^ t ? 1 : -1;
|
|
529
|
+
};
|
|
530
|
+
p.div = function(e) {
|
|
531
|
+
var t = this, r = t.constructor, n = t.c, i = (e = new r(e)).c, s = t.s == e.s ? 1 : -1, c = r.DP;
|
|
532
|
+
if (c !== ~~c || c < 0 || c > R)
|
|
533
|
+
throw Error(Z);
|
|
534
|
+
if (!i[0])
|
|
535
|
+
throw Error(De);
|
|
536
|
+
if (!n[0])
|
|
537
|
+
return e.s = s, e.c = [e.e = 0], e;
|
|
538
|
+
var u, f, o, m, a, h = i.slice(), b = u = i.length, P = n.length, g = n.slice(0, u), S = g.length, _ = e, O = _.c = [], B = 0, G = c + (_.e = t.e - e.e) + 1;
|
|
539
|
+
for (_.s = s, s = G < 0 ? 0 : G, h.unshift(0); S++ < u; ) g.push(0);
|
|
540
|
+
do {
|
|
541
|
+
for (o = 0; o < 10; o++) {
|
|
542
|
+
if (u != (S = g.length))
|
|
543
|
+
m = u > S ? 1 : -1;
|
|
544
|
+
else
|
|
545
|
+
for (a = -1, m = 0; ++a < u; )
|
|
546
|
+
if (i[a] != g[a]) {
|
|
547
|
+
m = i[a] > g[a] ? 1 : -1;
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
if (m < 0) {
|
|
551
|
+
for (f = S == u ? i : h; S; ) {
|
|
552
|
+
if (g[--S] < f[S]) {
|
|
553
|
+
for (a = S; a && !g[--a]; ) g[a] = 9;
|
|
554
|
+
--g[a], g[S] += 10;
|
|
555
|
+
}
|
|
556
|
+
g[S] -= f[S];
|
|
557
|
+
}
|
|
558
|
+
for (; !g[0]; ) g.shift();
|
|
559
|
+
} else
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
O[B++] = m ? o : ++o, g[0] && m ? g[S] = n[b] || 0 : g = [n[b]];
|
|
563
|
+
} while ((b++ < P || g[0] !== y) && s--);
|
|
564
|
+
return !O[0] && B != 1 && (O.shift(), _.e--, G--), B > G && $(_, G, r.RM, g[0] !== y), _;
|
|
565
|
+
};
|
|
566
|
+
p.eq = function(e) {
|
|
567
|
+
return this.cmp(e) === 0;
|
|
568
|
+
};
|
|
569
|
+
p.gt = function(e) {
|
|
570
|
+
return this.cmp(e) > 0;
|
|
571
|
+
};
|
|
572
|
+
p.gte = function(e) {
|
|
573
|
+
return this.cmp(e) > -1;
|
|
574
|
+
};
|
|
575
|
+
p.lt = function(e) {
|
|
576
|
+
return this.cmp(e) < 0;
|
|
577
|
+
};
|
|
578
|
+
p.lte = function(e) {
|
|
579
|
+
return this.cmp(e) < 1;
|
|
580
|
+
};
|
|
581
|
+
p.minus = p.sub = function(e) {
|
|
582
|
+
var t, r, n, i, s = this, c = s.constructor, u = s.s, f = (e = new c(e)).s;
|
|
583
|
+
if (u != f)
|
|
584
|
+
return e.s = -f, s.plus(e);
|
|
585
|
+
var o = s.c.slice(), m = s.e, a = e.c, h = e.e;
|
|
586
|
+
if (!o[0] || !a[0])
|
|
587
|
+
return a[0] ? e.s = -f : o[0] ? e = new c(s) : e.s = 1, e;
|
|
588
|
+
if (u = m - h) {
|
|
589
|
+
for ((i = u < 0) ? (u = -u, n = o) : (h = m, n = a), n.reverse(), f = u; f--; ) n.push(0);
|
|
590
|
+
n.reverse();
|
|
591
|
+
} else
|
|
592
|
+
for (r = ((i = o.length < a.length) ? o : a).length, u = f = 0; f < r; f++)
|
|
593
|
+
if (o[f] != a[f]) {
|
|
594
|
+
i = o[f] < a[f];
|
|
595
|
+
break;
|
|
596
|
+
}
|
|
597
|
+
if (i && (n = o, o = a, a = n, e.s = -e.s), (f = (r = a.length) - (t = o.length)) > 0) for (; f--; ) o[t++] = 0;
|
|
598
|
+
for (f = t; r > u; ) {
|
|
599
|
+
if (o[--r] < a[r]) {
|
|
600
|
+
for (t = r; t && !o[--t]; ) o[t] = 9;
|
|
601
|
+
--o[t], o[r] += 10;
|
|
602
|
+
}
|
|
603
|
+
o[r] -= a[r];
|
|
604
|
+
}
|
|
605
|
+
for (; o[--f] === 0; ) o.pop();
|
|
606
|
+
for (; o[0] === 0; )
|
|
607
|
+
o.shift(), --h;
|
|
608
|
+
return o[0] || (e.s = 1, o = [h = 0]), e.c = o, e.e = h, e;
|
|
609
|
+
};
|
|
610
|
+
p.mod = function(e) {
|
|
611
|
+
var t, r = this, n = r.constructor, i = r.s, s = (e = new n(e)).s;
|
|
612
|
+
if (!e.c[0])
|
|
613
|
+
throw Error(De);
|
|
614
|
+
return r.s = e.s = 1, t = e.cmp(r) == 1, r.s = i, e.s = s, t ? new n(r) : (i = n.DP, s = n.RM, n.DP = n.RM = 0, r = r.div(e), n.DP = i, n.RM = s, this.minus(r.times(e)));
|
|
615
|
+
};
|
|
616
|
+
p.neg = function() {
|
|
617
|
+
var e = new this.constructor(this);
|
|
618
|
+
return e.s = -e.s, e;
|
|
619
|
+
};
|
|
620
|
+
p.plus = p.add = function(e) {
|
|
621
|
+
var t, r, n, i = this, s = i.constructor;
|
|
622
|
+
if (e = new s(e), i.s != e.s)
|
|
623
|
+
return e.s = -e.s, i.minus(e);
|
|
624
|
+
var c = i.e, u = i.c, f = e.e, o = e.c;
|
|
625
|
+
if (!u[0] || !o[0])
|
|
626
|
+
return o[0] || (u[0] ? e = new s(i) : e.s = i.s), e;
|
|
627
|
+
if (u = u.slice(), t = c - f) {
|
|
628
|
+
for (t > 0 ? (f = c, n = o) : (t = -t, n = u), n.reverse(); t--; ) n.push(0);
|
|
629
|
+
n.reverse();
|
|
630
|
+
}
|
|
631
|
+
for (u.length - o.length < 0 && (n = o, o = u, u = n), t = o.length, r = 0; t; u[t] %= 10) r = (u[--t] = u[t] + o[t] + r) / 10 | 0;
|
|
632
|
+
for (r && (u.unshift(r), ++f), t = u.length; u[--t] === 0; ) u.pop();
|
|
633
|
+
return e.c = u, e.e = f, e;
|
|
634
|
+
};
|
|
635
|
+
p.pow = function(e) {
|
|
636
|
+
var t = this, r = new t.constructor("1"), n = r, i = e < 0;
|
|
637
|
+
if (e !== ~~e || e < -Se || e > Se)
|
|
638
|
+
throw Error(q + "exponent");
|
|
639
|
+
for (i && (e = -e); e & 1 && (n = n.times(t)), e >>= 1, !!e; )
|
|
640
|
+
t = t.times(t);
|
|
641
|
+
return i ? r.div(n) : n;
|
|
642
|
+
};
|
|
643
|
+
p.prec = function(e, t) {
|
|
644
|
+
if (e !== ~~e || e < 1 || e > R)
|
|
645
|
+
throw Error(q + "precision");
|
|
646
|
+
return $(new this.constructor(this), e, t);
|
|
647
|
+
};
|
|
648
|
+
p.round = function(e, t) {
|
|
649
|
+
if (e === y) e = 0;
|
|
650
|
+
else if (e !== ~~e || e < -R || e > R)
|
|
651
|
+
throw Error(Z);
|
|
652
|
+
return $(new this.constructor(this), e + this.e + 1, t);
|
|
653
|
+
};
|
|
654
|
+
p.sqrt = function() {
|
|
655
|
+
var e, t, r, n = this, i = n.constructor, s = n.s, c = n.e, u = new i("0.5");
|
|
656
|
+
if (!n.c[0]) return new i(n);
|
|
657
|
+
if (s < 0)
|
|
658
|
+
throw Error(H + "No square root");
|
|
659
|
+
s = Math.sqrt(+L(n, !0, !0)), s === 0 || s === 1 / 0 ? (t = n.c.join(""), t.length + c & 1 || (t += "0"), s = Math.sqrt(t), c = ((c + 1) / 2 | 0) - (c < 0 || c & 1), e = new i((s == 1 / 0 ? "5e" : (s = s.toExponential()).slice(0, s.indexOf("e") + 1)) + c)) : e = new i(s + ""), c = e.e + (i.DP += 4);
|
|
660
|
+
do
|
|
661
|
+
r = e, e = u.times(r.plus(n.div(r)));
|
|
662
|
+
while (r.c.slice(0, c).join("") !== e.c.slice(0, c).join(""));
|
|
663
|
+
return $(e, (i.DP -= 4) + e.e + 1, i.RM);
|
|
664
|
+
};
|
|
665
|
+
p.times = p.mul = function(e) {
|
|
666
|
+
var t, r = this, n = r.constructor, i = r.c, s = (e = new n(e)).c, c = i.length, u = s.length, f = r.e, o = e.e;
|
|
667
|
+
if (e.s = r.s == e.s ? 1 : -1, !i[0] || !s[0])
|
|
668
|
+
return e.c = [e.e = 0], e;
|
|
669
|
+
for (e.e = f + o, c < u && (t = i, i = s, s = t, o = c, c = u, u = o), t = new Array(o = c + u); o--; ) t[o] = 0;
|
|
670
|
+
for (f = u; f--; ) {
|
|
671
|
+
for (u = 0, o = c + f; o > f; )
|
|
672
|
+
u = t[o] + s[f] * i[o - f - 1] + u, t[o--] = u % 10, u = u / 10 | 0;
|
|
673
|
+
t[o] = u;
|
|
674
|
+
}
|
|
675
|
+
for (u ? ++e.e : t.shift(), f = t.length; !t[--f]; ) t.pop();
|
|
676
|
+
return e.c = t, e;
|
|
677
|
+
};
|
|
678
|
+
p.toExponential = function(e, t) {
|
|
679
|
+
var r = this, n = r.c[0];
|
|
680
|
+
if (e !== y) {
|
|
681
|
+
if (e !== ~~e || e < 0 || e > R)
|
|
682
|
+
throw Error(Z);
|
|
683
|
+
for (r = $(new r.constructor(r), ++e, t); r.c.length < e; ) r.c.push(0);
|
|
684
|
+
}
|
|
685
|
+
return L(r, !0, !!n);
|
|
686
|
+
};
|
|
687
|
+
p.toFixed = function(e, t) {
|
|
688
|
+
var r = this, n = r.c[0];
|
|
689
|
+
if (e !== y) {
|
|
690
|
+
if (e !== ~~e || e < 0 || e > R)
|
|
691
|
+
throw Error(Z);
|
|
692
|
+
for (r = $(new r.constructor(r), e + r.e + 1, t), e = e + r.e + 1; r.c.length < e; ) r.c.push(0);
|
|
693
|
+
}
|
|
694
|
+
return L(r, !1, !!n);
|
|
695
|
+
};
|
|
696
|
+
p[Symbol.for("nodejs.util.inspect.custom")] = p.toJSON = p.toString = function() {
|
|
697
|
+
var e = this, t = e.constructor;
|
|
698
|
+
return L(e, e.e <= t.NE || e.e >= t.PE, !!e.c[0]);
|
|
699
|
+
};
|
|
700
|
+
p.toNumber = function() {
|
|
701
|
+
var e = +L(this, !0, !0);
|
|
702
|
+
if (this.constructor.strict === !0 && !this.eq(e.toString()))
|
|
703
|
+
throw Error(H + "Imprecise conversion");
|
|
704
|
+
return e;
|
|
705
|
+
};
|
|
706
|
+
p.toPrecision = function(e, t) {
|
|
707
|
+
var r = this, n = r.constructor, i = r.c[0];
|
|
708
|
+
if (e !== y) {
|
|
709
|
+
if (e !== ~~e || e < 1 || e > R)
|
|
710
|
+
throw Error(q + "precision");
|
|
711
|
+
for (r = $(new n(r), e, t); r.c.length < e; ) r.c.push(0);
|
|
712
|
+
}
|
|
713
|
+
return L(r, e <= r.e || r.e <= n.NE || r.e >= n.PE, !!i);
|
|
714
|
+
};
|
|
715
|
+
p.valueOf = function() {
|
|
716
|
+
var e = this, t = e.constructor;
|
|
717
|
+
if (t.strict === !0)
|
|
718
|
+
throw Error(H + "valueOf disallowed");
|
|
719
|
+
return L(e, e.e <= t.NE || e.e >= t.PE, !0);
|
|
720
|
+
};
|
|
721
|
+
var D = Pe();
|
|
722
|
+
function Wt(e) {
|
|
723
|
+
return Number.isSafeInteger(e) && e >= 0;
|
|
724
|
+
}
|
|
725
|
+
function Ge(e) {
|
|
726
|
+
return e != null && typeof e != "function" && Wt(e.length);
|
|
727
|
+
}
|
|
728
|
+
function ie(e) {
|
|
729
|
+
return e;
|
|
730
|
+
}
|
|
731
|
+
function te(e) {
|
|
732
|
+
return e === "__proto__";
|
|
733
|
+
}
|
|
734
|
+
function xe(e) {
|
|
735
|
+
switch (typeof e) {
|
|
736
|
+
case "number":
|
|
737
|
+
case "symbol":
|
|
738
|
+
return !1;
|
|
739
|
+
case "string":
|
|
740
|
+
return e.includes(".") || e.includes("[") || e.includes("]");
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
function se(e) {
|
|
744
|
+
var t;
|
|
745
|
+
return typeof e == "string" || typeof e == "symbol" ? e : Object.is((t = e == null ? void 0 : e.valueOf) == null ? void 0 : t.call(e), -0) ? "-0" : String(e);
|
|
746
|
+
}
|
|
747
|
+
function Ie(e) {
|
|
748
|
+
if (e == null)
|
|
749
|
+
return "";
|
|
750
|
+
if (typeof e == "string")
|
|
751
|
+
return e;
|
|
752
|
+
if (Array.isArray(e))
|
|
753
|
+
return e.map(Ie).join(",");
|
|
754
|
+
const t = String(e);
|
|
755
|
+
return t === "0" && Object.is(Number(e), -0) ? "-0" : t;
|
|
756
|
+
}
|
|
757
|
+
function Oe(e) {
|
|
758
|
+
if (Array.isArray(e))
|
|
759
|
+
return e.map(se);
|
|
760
|
+
if (typeof e == "symbol")
|
|
761
|
+
return [e];
|
|
762
|
+
e = Ie(e);
|
|
763
|
+
const t = [], r = e.length;
|
|
764
|
+
if (r === 0)
|
|
765
|
+
return t;
|
|
766
|
+
let n = 0, i = "", s = "", c = !1;
|
|
767
|
+
for (e.charCodeAt(0) === 46 && (t.push(""), n++); n < r; ) {
|
|
768
|
+
const u = e[n];
|
|
769
|
+
s ? u === "\\" && n + 1 < r ? (n++, i += e[n]) : u === s ? s = "" : i += u : c ? u === '"' || u === "'" ? s = u : u === "]" ? (c = !1, t.push(i), i = "") : i += u : u === "[" ? (c = !0, i && (t.push(i), i = "")) : u === "." ? i && (t.push(i), i = "") : i += u, n++;
|
|
770
|
+
}
|
|
771
|
+
return i && t.push(i), t;
|
|
772
|
+
}
|
|
773
|
+
function ce(e, t, r) {
|
|
774
|
+
if (e == null)
|
|
775
|
+
return r;
|
|
776
|
+
switch (typeof t) {
|
|
777
|
+
case "string": {
|
|
778
|
+
if (te(t))
|
|
779
|
+
return r;
|
|
780
|
+
const n = e[t];
|
|
781
|
+
return n === void 0 ? xe(t) ? ce(e, Oe(t), r) : r : n;
|
|
782
|
+
}
|
|
783
|
+
case "number":
|
|
784
|
+
case "symbol": {
|
|
785
|
+
typeof t == "number" && (t = se(t));
|
|
786
|
+
const n = e[t];
|
|
787
|
+
return n === void 0 ? r : n;
|
|
788
|
+
}
|
|
789
|
+
default: {
|
|
790
|
+
if (Array.isArray(t))
|
|
791
|
+
return vt(e, t, r);
|
|
792
|
+
if (Object.is(t == null ? void 0 : t.valueOf(), -0) ? t = "-0" : t = String(t), te(t))
|
|
793
|
+
return r;
|
|
794
|
+
const n = e[t];
|
|
795
|
+
return n === void 0 ? r : n;
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
function vt(e, t, r) {
|
|
800
|
+
if (t.length === 0)
|
|
801
|
+
return r;
|
|
802
|
+
let n = e;
|
|
803
|
+
for (let i = 0; i < t.length; i++) {
|
|
804
|
+
if (n == null || te(t[i]))
|
|
805
|
+
return r;
|
|
806
|
+
n = n[t[i]];
|
|
807
|
+
}
|
|
808
|
+
return n === void 0 ? r : n;
|
|
809
|
+
}
|
|
810
|
+
function zt(e) {
|
|
811
|
+
return function(t) {
|
|
812
|
+
return ce(t, e);
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
function Ht(e) {
|
|
816
|
+
return e !== null && (typeof e == "object" || typeof e == "function");
|
|
817
|
+
}
|
|
818
|
+
function re(e) {
|
|
819
|
+
return e == null || typeof e != "object" && typeof e != "function";
|
|
820
|
+
}
|
|
821
|
+
function we(e, t) {
|
|
822
|
+
return e === t || Number.isNaN(e) && Number.isNaN(t);
|
|
823
|
+
}
|
|
824
|
+
function Be(e, t, r) {
|
|
825
|
+
return typeof r != "function" ? Be(e, t, () => {
|
|
826
|
+
}) : ne(e, t, function n(i, s, c, u, f, o) {
|
|
827
|
+
const m = r(i, s, c, u, f, o);
|
|
828
|
+
return m !== void 0 ? !!m : ne(i, s, n, o);
|
|
829
|
+
}, /* @__PURE__ */ new Map());
|
|
830
|
+
}
|
|
831
|
+
function ne(e, t, r, n) {
|
|
832
|
+
if (t === e)
|
|
833
|
+
return !0;
|
|
834
|
+
switch (typeof t) {
|
|
835
|
+
case "object":
|
|
836
|
+
return Qt(e, t, r, n);
|
|
837
|
+
case "function":
|
|
838
|
+
return Object.keys(t).length > 0 ? ne(e, { ...t }, r, n) : we(e, t);
|
|
839
|
+
default:
|
|
840
|
+
return Ht(e) ? typeof t == "string" ? t === "" : !0 : we(e, t);
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
function Qt(e, t, r, n) {
|
|
844
|
+
if (t == null)
|
|
845
|
+
return !0;
|
|
846
|
+
if (Array.isArray(t))
|
|
847
|
+
return Fe(e, t, r, n);
|
|
848
|
+
if (t instanceof Map)
|
|
849
|
+
return Xt(e, t, r, n);
|
|
850
|
+
if (t instanceof Set)
|
|
851
|
+
return Yt(e, t, r, n);
|
|
852
|
+
const i = Object.keys(t);
|
|
853
|
+
if (e == null || re(e))
|
|
854
|
+
return i.length === 0;
|
|
855
|
+
if (i.length === 0)
|
|
856
|
+
return !0;
|
|
857
|
+
if (n != null && n.has(t))
|
|
858
|
+
return n.get(t) === e;
|
|
859
|
+
n == null || n.set(t, e);
|
|
860
|
+
try {
|
|
861
|
+
for (let s = 0; s < i.length; s++) {
|
|
862
|
+
const c = i[s];
|
|
863
|
+
if (!re(e) && !(c in e) || t[c] === void 0 && e[c] !== void 0 || t[c] === null && e[c] !== null || !r(e[c], t[c], c, e, t, n))
|
|
864
|
+
return !1;
|
|
865
|
+
}
|
|
866
|
+
return !0;
|
|
867
|
+
} finally {
|
|
868
|
+
n == null || n.delete(t);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
function Xt(e, t, r, n) {
|
|
872
|
+
if (t.size === 0)
|
|
873
|
+
return !0;
|
|
874
|
+
if (!(e instanceof Map))
|
|
875
|
+
return !1;
|
|
876
|
+
for (const [i, s] of t.entries()) {
|
|
877
|
+
const c = e.get(i);
|
|
878
|
+
if (r(c, s, i, e, t, n) === !1)
|
|
879
|
+
return !1;
|
|
880
|
+
}
|
|
881
|
+
return !0;
|
|
882
|
+
}
|
|
883
|
+
function Fe(e, t, r, n) {
|
|
884
|
+
if (t.length === 0)
|
|
885
|
+
return !0;
|
|
886
|
+
if (!Array.isArray(e))
|
|
887
|
+
return !1;
|
|
888
|
+
const i = /* @__PURE__ */ new Set();
|
|
889
|
+
for (let s = 0; s < t.length; s++) {
|
|
890
|
+
const c = t[s];
|
|
891
|
+
let u = !1;
|
|
892
|
+
for (let f = 0; f < e.length; f++) {
|
|
893
|
+
if (i.has(f))
|
|
894
|
+
continue;
|
|
895
|
+
const o = e[f];
|
|
896
|
+
let m = !1;
|
|
897
|
+
if (r(o, c, s, e, t, n) && (m = !0), m) {
|
|
898
|
+
i.add(f), u = !0;
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
if (!u)
|
|
903
|
+
return !1;
|
|
904
|
+
}
|
|
905
|
+
return !0;
|
|
906
|
+
}
|
|
907
|
+
function Yt(e, t, r, n) {
|
|
908
|
+
return t.size === 0 ? !0 : e instanceof Set ? Fe([...e], [...t], r, n) : !1;
|
|
909
|
+
}
|
|
910
|
+
function Me(e, t) {
|
|
911
|
+
return Be(e, t, () => {
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
function Vt(e) {
|
|
915
|
+
return Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
|
|
916
|
+
}
|
|
917
|
+
function ue(e) {
|
|
918
|
+
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
919
|
+
}
|
|
920
|
+
const Zt = "[object RegExp]", Re = "[object String]", je = "[object Number]", qe = "[object Boolean]", $e = "[object Arguments]", Jt = "[object Symbol]", Tt = "[object Date]", Kt = "[object Map]", kt = "[object Set]", Ct = "[object Array]", er = "[object ArrayBuffer]", Le = "[object Object]", tr = "[object DataView]", rr = "[object Uint8Array]", nr = "[object Uint8ClampedArray]", ir = "[object Uint16Array]", sr = "[object Uint32Array]", cr = "[object Int8Array]", ur = "[object Int16Array]", or = "[object Int32Array]", fr = "[object Float32Array]", ar = "[object Float64Array]";
|
|
921
|
+
function dr(e) {
|
|
922
|
+
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
923
|
+
}
|
|
924
|
+
function gr(e, t) {
|
|
925
|
+
return M(e, void 0, e, /* @__PURE__ */ new Map(), t);
|
|
926
|
+
}
|
|
927
|
+
function M(e, t, r, n = /* @__PURE__ */ new Map(), i = void 0) {
|
|
928
|
+
const s = i == null ? void 0 : i(e, t, r, n);
|
|
929
|
+
if (s !== void 0)
|
|
930
|
+
return s;
|
|
931
|
+
if (re(e))
|
|
932
|
+
return e;
|
|
933
|
+
if (n.has(e))
|
|
934
|
+
return n.get(e);
|
|
935
|
+
if (Array.isArray(e)) {
|
|
936
|
+
const c = new Array(e.length);
|
|
937
|
+
n.set(e, c);
|
|
938
|
+
for (let u = 0; u < e.length; u++)
|
|
939
|
+
c[u] = M(e[u], u, r, n, i);
|
|
940
|
+
return Object.hasOwn(e, "index") && (c.index = e.index), Object.hasOwn(e, "input") && (c.input = e.input), c;
|
|
941
|
+
}
|
|
942
|
+
if (e instanceof Date)
|
|
943
|
+
return new Date(e.getTime());
|
|
944
|
+
if (e instanceof RegExp) {
|
|
945
|
+
const c = new RegExp(e.source, e.flags);
|
|
946
|
+
return c.lastIndex = e.lastIndex, c;
|
|
947
|
+
}
|
|
948
|
+
if (e instanceof Map) {
|
|
949
|
+
const c = /* @__PURE__ */ new Map();
|
|
950
|
+
n.set(e, c);
|
|
951
|
+
for (const [u, f] of e)
|
|
952
|
+
c.set(u, M(f, u, r, n, i));
|
|
953
|
+
return c;
|
|
954
|
+
}
|
|
955
|
+
if (e instanceof Set) {
|
|
956
|
+
const c = /* @__PURE__ */ new Set();
|
|
957
|
+
n.set(e, c);
|
|
958
|
+
for (const u of e)
|
|
959
|
+
c.add(M(u, void 0, r, n, i));
|
|
960
|
+
return c;
|
|
961
|
+
}
|
|
962
|
+
if (typeof Buffer < "u" && Buffer.isBuffer(e))
|
|
963
|
+
return e.subarray();
|
|
964
|
+
if (dr(e)) {
|
|
965
|
+
const c = new (Object.getPrototypeOf(e)).constructor(e.length);
|
|
966
|
+
n.set(e, c);
|
|
967
|
+
for (let u = 0; u < e.length; u++)
|
|
968
|
+
c[u] = M(e[u], u, r, n, i);
|
|
969
|
+
return c;
|
|
970
|
+
}
|
|
971
|
+
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer)
|
|
972
|
+
return e.slice(0);
|
|
973
|
+
if (e instanceof DataView) {
|
|
974
|
+
const c = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
|
|
975
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
976
|
+
}
|
|
977
|
+
if (typeof File < "u" && e instanceof File) {
|
|
978
|
+
const c = new File([e], e.name, {
|
|
979
|
+
type: e.type
|
|
980
|
+
});
|
|
981
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
982
|
+
}
|
|
983
|
+
if (typeof Blob < "u" && e instanceof Blob) {
|
|
984
|
+
const c = new Blob([e], { type: e.type });
|
|
985
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
986
|
+
}
|
|
987
|
+
if (e instanceof Error) {
|
|
988
|
+
const c = structuredClone(e);
|
|
989
|
+
return n.set(e, c), c.message = e.message, c.name = e.name, c.stack = e.stack, c.cause = e.cause, c.constructor = e.constructor, N(c, e, r, n, i), c;
|
|
990
|
+
}
|
|
991
|
+
if (e instanceof Boolean) {
|
|
992
|
+
const c = new Boolean(e.valueOf());
|
|
993
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
994
|
+
}
|
|
995
|
+
if (e instanceof Number) {
|
|
996
|
+
const c = new Number(e.valueOf());
|
|
997
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
998
|
+
}
|
|
999
|
+
if (e instanceof String) {
|
|
1000
|
+
const c = new String(e.valueOf());
|
|
1001
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
1002
|
+
}
|
|
1003
|
+
if (typeof e == "object" && lr(e)) {
|
|
1004
|
+
const c = Object.create(Object.getPrototypeOf(e));
|
|
1005
|
+
return n.set(e, c), N(c, e, r, n, i), c;
|
|
1006
|
+
}
|
|
1007
|
+
return e;
|
|
1008
|
+
}
|
|
1009
|
+
function N(e, t, r = e, n, i) {
|
|
1010
|
+
const s = [...Object.keys(t), ...Vt(t)];
|
|
1011
|
+
for (let c = 0; c < s.length; c++) {
|
|
1012
|
+
const u = s[c], f = Object.getOwnPropertyDescriptor(e, u);
|
|
1013
|
+
(f == null || f.writable) && (e[u] = M(t[u], u, r, n, i));
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
function lr(e) {
|
|
1017
|
+
switch (ue(e)) {
|
|
1018
|
+
case $e:
|
|
1019
|
+
case Ct:
|
|
1020
|
+
case er:
|
|
1021
|
+
case tr:
|
|
1022
|
+
case qe:
|
|
1023
|
+
case Tt:
|
|
1024
|
+
case fr:
|
|
1025
|
+
case ar:
|
|
1026
|
+
case cr:
|
|
1027
|
+
case ur:
|
|
1028
|
+
case or:
|
|
1029
|
+
case Kt:
|
|
1030
|
+
case je:
|
|
1031
|
+
case Le:
|
|
1032
|
+
case Zt:
|
|
1033
|
+
case kt:
|
|
1034
|
+
case Re:
|
|
1035
|
+
case Jt:
|
|
1036
|
+
case rr:
|
|
1037
|
+
case nr:
|
|
1038
|
+
case ir:
|
|
1039
|
+
case sr:
|
|
1040
|
+
return !0;
|
|
1041
|
+
default:
|
|
1042
|
+
return !1;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
function hr(e) {
|
|
1046
|
+
return M(e, void 0, e, /* @__PURE__ */ new Map(), void 0);
|
|
1047
|
+
}
|
|
1048
|
+
function mr(e) {
|
|
1049
|
+
return e = hr(e), (t) => Me(t, e);
|
|
1050
|
+
}
|
|
1051
|
+
function pr(e, t) {
|
|
1052
|
+
return gr(e, (r, n, i, s) => {
|
|
1053
|
+
if (typeof e == "object") {
|
|
1054
|
+
if (ue(e) === Le && typeof e.constructor != "function") {
|
|
1055
|
+
const c = {};
|
|
1056
|
+
return s.set(e, c), N(c, e, i, s), c;
|
|
1057
|
+
}
|
|
1058
|
+
switch (Object.prototype.toString.call(e)) {
|
|
1059
|
+
case je:
|
|
1060
|
+
case Re:
|
|
1061
|
+
case qe: {
|
|
1062
|
+
const c = new e.constructor(e == null ? void 0 : e.valueOf());
|
|
1063
|
+
return N(c, e), c;
|
|
1064
|
+
}
|
|
1065
|
+
case $e: {
|
|
1066
|
+
const c = {};
|
|
1067
|
+
return N(c, e), c.length = e.length, c[Symbol.iterator] = e[Symbol.iterator], c;
|
|
1068
|
+
}
|
|
1069
|
+
default:
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
function Sr(e) {
|
|
1076
|
+
return pr(e);
|
|
1077
|
+
}
|
|
1078
|
+
const wr = /^(?:0|[1-9]\d*)$/;
|
|
1079
|
+
function Ar(e, t = Number.MAX_SAFE_INTEGER) {
|
|
1080
|
+
switch (typeof e) {
|
|
1081
|
+
case "number":
|
|
1082
|
+
return Number.isInteger(e) && e >= 0 && e < t;
|
|
1083
|
+
case "symbol":
|
|
1084
|
+
return !1;
|
|
1085
|
+
case "string":
|
|
1086
|
+
return wr.test(e);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
function _r(e) {
|
|
1090
|
+
return e !== null && typeof e == "object" && ue(e) === "[object Arguments]";
|
|
1091
|
+
}
|
|
1092
|
+
function br(e, t) {
|
|
1093
|
+
let r;
|
|
1094
|
+
if (Array.isArray(t) ? r = t : typeof t == "string" && xe(t) && (e == null ? void 0 : e[t]) == null ? r = Oe(t) : r = [t], r.length === 0)
|
|
1095
|
+
return !1;
|
|
1096
|
+
let n = e;
|
|
1097
|
+
for (let i = 0; i < r.length; i++) {
|
|
1098
|
+
const s = r[i];
|
|
1099
|
+
if ((n == null || !Object.hasOwn(n, s)) && !((Array.isArray(n) || _r(n)) && Ar(s) && s < n.length))
|
|
1100
|
+
return !1;
|
|
1101
|
+
n = n[s];
|
|
1102
|
+
}
|
|
1103
|
+
return !0;
|
|
1104
|
+
}
|
|
1105
|
+
function Nr(e, t) {
|
|
1106
|
+
switch (typeof e) {
|
|
1107
|
+
case "object": {
|
|
1108
|
+
Object.is(e == null ? void 0 : e.valueOf(), -0) && (e = "-0");
|
|
1109
|
+
break;
|
|
1110
|
+
}
|
|
1111
|
+
case "number": {
|
|
1112
|
+
e = se(e);
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
return t = Sr(t), function(r) {
|
|
1117
|
+
const n = ce(r, e);
|
|
1118
|
+
return n === void 0 ? br(r, e) : t === void 0 ? n === void 0 : Me(n, t);
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
function Er(e) {
|
|
1122
|
+
if (e == null)
|
|
1123
|
+
return ie;
|
|
1124
|
+
switch (typeof e) {
|
|
1125
|
+
case "function":
|
|
1126
|
+
return e;
|
|
1127
|
+
case "object":
|
|
1128
|
+
return Array.isArray(e) && e.length === 2 ? Nr(e[0], e[1]) : mr(e);
|
|
1129
|
+
case "string":
|
|
1130
|
+
case "symbol":
|
|
1131
|
+
case "number":
|
|
1132
|
+
return zt(e);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
function Ue(e, t, r = 1) {
|
|
1136
|
+
if (t == null && (t = e, e = 0), !Number.isInteger(r) || r === 0)
|
|
1137
|
+
throw new Error("The step value must be a non-zero integer.");
|
|
1138
|
+
const n = Math.max(Math.ceil((t - e) / r), 0), i = new Array(n);
|
|
1139
|
+
for (let s = 0; s < n; s++)
|
|
1140
|
+
i[s] = e + s * r;
|
|
1141
|
+
return i;
|
|
1142
|
+
}
|
|
1143
|
+
function yr(e, t) {
|
|
1144
|
+
if (!e)
|
|
1145
|
+
return [];
|
|
1146
|
+
const r = Ge(e) || Array.isArray(e) ? Ue(0, e.length) : Object.keys(e), n = Er(t ?? ie), i = new Array(r.length);
|
|
1147
|
+
for (let s = 0; s < r.length; s++) {
|
|
1148
|
+
const c = r[s], u = e[c];
|
|
1149
|
+
i[s] = n(u, c, e);
|
|
1150
|
+
}
|
|
1151
|
+
return i;
|
|
1152
|
+
}
|
|
1153
|
+
function Dr(e, t = ie, r) {
|
|
1154
|
+
if (!e)
|
|
1155
|
+
return r;
|
|
1156
|
+
let n, i = 0;
|
|
1157
|
+
Ge(e) ? (n = Ue(0, e.length), r == null && e.length > 0 && (r = e[0], i += 1)) : (n = Object.keys(e), r == null && (r = e[n[0]], i += 1));
|
|
1158
|
+
for (let s = i; s < n.length; s++) {
|
|
1159
|
+
const c = n[s], u = e[c];
|
|
1160
|
+
r = t(r, u, c, e);
|
|
1161
|
+
}
|
|
1162
|
+
return r;
|
|
1163
|
+
}
|
|
1164
|
+
function Pr(e, t) {
|
|
1165
|
+
return new D(e || 0).plus(t || 0);
|
|
1166
|
+
}
|
|
1167
|
+
function We(e, t) {
|
|
1168
|
+
return new D(e || 0).div(t || 0);
|
|
1169
|
+
}
|
|
1170
|
+
function pn(e, t) {
|
|
1171
|
+
return new D(e || 0).times(t || 0);
|
|
1172
|
+
}
|
|
1173
|
+
function oe(e) {
|
|
1174
|
+
return Number.parseFloat(e.toString());
|
|
1175
|
+
}
|
|
1176
|
+
function Sn(e) {
|
|
1177
|
+
return e.reduce((t, r) => t.plus(r || 0), D(0));
|
|
1178
|
+
}
|
|
1179
|
+
function Gr(e) {
|
|
1180
|
+
const t = Dr(e, Pr, 0);
|
|
1181
|
+
return oe(t);
|
|
1182
|
+
}
|
|
1183
|
+
function wn(e, t) {
|
|
1184
|
+
const r = yr(e, t);
|
|
1185
|
+
return Gr(r);
|
|
1186
|
+
}
|
|
1187
|
+
function ve(e, t) {
|
|
1188
|
+
const r = Number(e) / Number(t) * 100;
|
|
1189
|
+
if (!Number.isFinite(r))
|
|
1190
|
+
return r;
|
|
1191
|
+
const n = We(e, t), i = new D(n).times(100);
|
|
1192
|
+
return oe(i);
|
|
1193
|
+
}
|
|
1194
|
+
function An(e, t, r) {
|
|
1195
|
+
const n = (e || 0) / (t / r);
|
|
1196
|
+
if (!Number.isFinite(n))
|
|
1197
|
+
return n;
|
|
1198
|
+
const i = We(t, r), s = new D(e || 0).div(i);
|
|
1199
|
+
return oe(s);
|
|
1200
|
+
}
|
|
1201
|
+
function _n({
|
|
1202
|
+
score: e,
|
|
1203
|
+
possible: t,
|
|
1204
|
+
weight: r
|
|
1205
|
+
}) {
|
|
1206
|
+
return e && r && t ? D(e).div(t).times(r) : D(0);
|
|
1207
|
+
}
|
|
1208
|
+
function bn(e, t = 0) {
|
|
1209
|
+
try {
|
|
1210
|
+
if (e == null)
|
|
1211
|
+
return NaN;
|
|
1212
|
+
const r = parseFloat(e.toString());
|
|
1213
|
+
return parseFloat(D(r).round(t).toString());
|
|
1214
|
+
} catch {
|
|
1215
|
+
return NaN;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
var xr = 20, Ir = 1, V = 1e6, Ae = 1e6, Or = -7, Br = 21, fe = "[big.js] ", Q = fe + "Invalid ", ae = Q + "decimal places", _e = Q + "rounding mode", ze = fe + "Division by zero", w = {}, j = void 0, Fr = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
1219
|
+
function He() {
|
|
1220
|
+
function e(t) {
|
|
1221
|
+
var r = this;
|
|
1222
|
+
if (!(r instanceof e)) return t === j ? He() : new e(t);
|
|
1223
|
+
t instanceof e ? (r.s = t.s, r.e = t.e, r.c = t.c.slice()) : Mr(r, t), r.constructor = e;
|
|
1224
|
+
}
|
|
1225
|
+
return e.prototype = w, e.DP = xr, e.RM = Ir, e.NE = Or, e.PE = Br, e.version = "5.2.2", e;
|
|
1226
|
+
}
|
|
1227
|
+
function Mr(e, t) {
|
|
1228
|
+
var r, n, i;
|
|
1229
|
+
if (t === 0 && 1 / t < 0) t = "-0";
|
|
1230
|
+
else if (!Fr.test(t += "")) throw Error(Q + "number");
|
|
1231
|
+
for (e.s = t.charAt(0) == "-" ? (t = t.slice(1), -1) : 1, (r = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (n = t.search(/e/i)) > 0 ? (r < 0 && (r = n), r += +t.slice(n + 1), t = t.substring(0, n)) : r < 0 && (r = t.length), i = t.length, n = 0; n < i && t.charAt(n) == "0"; ) ++n;
|
|
1232
|
+
if (n == i)
|
|
1233
|
+
e.c = [e.e = 0];
|
|
1234
|
+
else {
|
|
1235
|
+
for (; i > 0 && t.charAt(--i) == "0"; ) ;
|
|
1236
|
+
for (e.e = r - n - 1, e.c = [], r = 0; n <= i; ) e.c[r++] = +t.charAt(n++);
|
|
1237
|
+
}
|
|
1238
|
+
return e;
|
|
1239
|
+
}
|
|
1240
|
+
function J(e, t, r, n) {
|
|
1241
|
+
var i = e.c, s = e.e + t + 1;
|
|
1242
|
+
if (s < i.length) {
|
|
1243
|
+
if (r === 1)
|
|
1244
|
+
n = i[s] >= 5;
|
|
1245
|
+
else if (r === 2)
|
|
1246
|
+
n = i[s] > 5 || i[s] == 5 && (n || s < 0 || i[s + 1] !== j || i[s - 1] & 1);
|
|
1247
|
+
else if (r === 3)
|
|
1248
|
+
n = n || !!i[0];
|
|
1249
|
+
else if (n = !1, r !== 0) throw Error(_e);
|
|
1250
|
+
if (s < 1)
|
|
1251
|
+
i.length = 1, n ? (e.e = -t, i[0] = 1) : i[0] = e.e = 0;
|
|
1252
|
+
else {
|
|
1253
|
+
if (i.length = s--, n)
|
|
1254
|
+
for (; ++i[s] > 9; )
|
|
1255
|
+
i[s] = 0, s-- || (++e.e, i.unshift(1));
|
|
1256
|
+
for (s = i.length; !i[--s]; ) i.pop();
|
|
1257
|
+
}
|
|
1258
|
+
} else if (r < 0 || r > 3 || r !== ~~r)
|
|
1259
|
+
throw Error(_e);
|
|
1260
|
+
return e;
|
|
1261
|
+
}
|
|
1262
|
+
function X(e, t, r, n) {
|
|
1263
|
+
var i, s, c = e.constructor, u = !e.c[0];
|
|
1264
|
+
if (r !== j) {
|
|
1265
|
+
if (r !== ~~r || r < (t == 3) || r > V)
|
|
1266
|
+
throw Error(t == 3 ? Q + "precision" : ae);
|
|
1267
|
+
for (e = new c(e), r = n - e.e, e.c.length > ++n && J(e, r, c.RM), t == 2 && (n = e.e + r + 1); e.c.length < n; ) e.c.push(0);
|
|
1268
|
+
}
|
|
1269
|
+
if (i = e.e, s = e.c.join(""), r = s.length, t != 2 && (t == 1 || t == 3 && n <= i || i <= c.NE || i >= c.PE))
|
|
1270
|
+
s = s.charAt(0) + (r > 1 ? "." + s.slice(1) : "") + (i < 0 ? "e" : "e+") + i;
|
|
1271
|
+
else if (i < 0) {
|
|
1272
|
+
for (; ++i; ) s = "0" + s;
|
|
1273
|
+
s = "0." + s;
|
|
1274
|
+
} else if (i > 0)
|
|
1275
|
+
if (++i > r) for (i -= r; i--; ) s += "0";
|
|
1276
|
+
else i < r && (s = s.slice(0, i) + "." + s.slice(i));
|
|
1277
|
+
else r > 1 && (s = s.charAt(0) + "." + s.slice(1));
|
|
1278
|
+
return e.s < 0 && (!u || t == 4) ? "-" + s : s;
|
|
1279
|
+
}
|
|
1280
|
+
w.abs = function() {
|
|
1281
|
+
var e = new this.constructor(this);
|
|
1282
|
+
return e.s = 1, e;
|
|
1283
|
+
};
|
|
1284
|
+
w.cmp = function(e) {
|
|
1285
|
+
var t, r = this, n = r.c, i = (e = new r.constructor(e)).c, s = r.s, c = e.s, u = r.e, f = e.e;
|
|
1286
|
+
if (!n[0] || !i[0]) return n[0] ? s : i[0] ? -c : 0;
|
|
1287
|
+
if (s != c) return s;
|
|
1288
|
+
if (t = s < 0, u != f) return u > f ^ t ? 1 : -1;
|
|
1289
|
+
for (c = (u = n.length) < (f = i.length) ? u : f, s = -1; ++s < c; )
|
|
1290
|
+
if (n[s] != i[s]) return n[s] > i[s] ^ t ? 1 : -1;
|
|
1291
|
+
return u == f ? 0 : u > f ^ t ? 1 : -1;
|
|
1292
|
+
};
|
|
1293
|
+
w.div = function(e) {
|
|
1294
|
+
var t = this, r = t.constructor, n = t.c, i = (e = new r(e)).c, s = t.s == e.s ? 1 : -1, c = r.DP;
|
|
1295
|
+
if (c !== ~~c || c < 0 || c > V) throw Error(ae);
|
|
1296
|
+
if (!i[0]) throw Error(ze);
|
|
1297
|
+
if (!n[0]) return new r(s * 0);
|
|
1298
|
+
var u, f, o, m, a, h = i.slice(), b = u = i.length, P = n.length, g = n.slice(0, u), S = g.length, _ = e, O = _.c = [], B = 0, G = c + (_.e = t.e - e.e) + 1;
|
|
1299
|
+
for (_.s = s, s = G < 0 ? 0 : G, h.unshift(0); S++ < u; ) g.push(0);
|
|
1300
|
+
do {
|
|
1301
|
+
for (o = 0; o < 10; o++) {
|
|
1302
|
+
if (u != (S = g.length))
|
|
1303
|
+
m = u > S ? 1 : -1;
|
|
1304
|
+
else
|
|
1305
|
+
for (a = -1, m = 0; ++a < u; )
|
|
1306
|
+
if (i[a] != g[a]) {
|
|
1307
|
+
m = i[a] > g[a] ? 1 : -1;
|
|
1308
|
+
break;
|
|
1309
|
+
}
|
|
1310
|
+
if (m < 0) {
|
|
1311
|
+
for (f = S == u ? i : h; S; ) {
|
|
1312
|
+
if (g[--S] < f[S]) {
|
|
1313
|
+
for (a = S; a && !g[--a]; ) g[a] = 9;
|
|
1314
|
+
--g[a], g[S] += 10;
|
|
1315
|
+
}
|
|
1316
|
+
g[S] -= f[S];
|
|
1317
|
+
}
|
|
1318
|
+
for (; !g[0]; ) g.shift();
|
|
1319
|
+
} else
|
|
1320
|
+
break;
|
|
1321
|
+
}
|
|
1322
|
+
O[B++] = m ? o : ++o, g[0] && m ? g[S] = n[b] || 0 : g = [n[b]];
|
|
1323
|
+
} while ((b++ < P || g[0] !== j) && s--);
|
|
1324
|
+
return !O[0] && B != 1 && (O.shift(), _.e--), B > G && J(_, c, r.RM, g[0] !== j), _;
|
|
1325
|
+
};
|
|
1326
|
+
w.eq = function(e) {
|
|
1327
|
+
return !this.cmp(e);
|
|
1328
|
+
};
|
|
1329
|
+
w.gt = function(e) {
|
|
1330
|
+
return this.cmp(e) > 0;
|
|
1331
|
+
};
|
|
1332
|
+
w.gte = function(e) {
|
|
1333
|
+
return this.cmp(e) > -1;
|
|
1334
|
+
};
|
|
1335
|
+
w.lt = function(e) {
|
|
1336
|
+
return this.cmp(e) < 0;
|
|
1337
|
+
};
|
|
1338
|
+
w.lte = function(e) {
|
|
1339
|
+
return this.cmp(e) < 1;
|
|
1340
|
+
};
|
|
1341
|
+
w.minus = w.sub = function(e) {
|
|
1342
|
+
var t, r, n, i, s = this, c = s.constructor, u = s.s, f = (e = new c(e)).s;
|
|
1343
|
+
if (u != f)
|
|
1344
|
+
return e.s = -f, s.plus(e);
|
|
1345
|
+
var o = s.c.slice(), m = s.e, a = e.c, h = e.e;
|
|
1346
|
+
if (!o[0] || !a[0])
|
|
1347
|
+
return a[0] ? (e.s = -f, e) : new c(o[0] ? s : 0);
|
|
1348
|
+
if (u = m - h) {
|
|
1349
|
+
for ((i = u < 0) ? (u = -u, n = o) : (h = m, n = a), n.reverse(), f = u; f--; ) n.push(0);
|
|
1350
|
+
n.reverse();
|
|
1351
|
+
} else
|
|
1352
|
+
for (r = ((i = o.length < a.length) ? o : a).length, u = f = 0; f < r; f++)
|
|
1353
|
+
if (o[f] != a[f]) {
|
|
1354
|
+
i = o[f] < a[f];
|
|
1355
|
+
break;
|
|
1356
|
+
}
|
|
1357
|
+
if (i && (n = o, o = a, a = n, e.s = -e.s), (f = (r = a.length) - (t = o.length)) > 0) for (; f--; ) o[t++] = 0;
|
|
1358
|
+
for (f = t; r > u; ) {
|
|
1359
|
+
if (o[--r] < a[r]) {
|
|
1360
|
+
for (t = r; t && !o[--t]; ) o[t] = 9;
|
|
1361
|
+
--o[t], o[r] += 10;
|
|
1362
|
+
}
|
|
1363
|
+
o[r] -= a[r];
|
|
1364
|
+
}
|
|
1365
|
+
for (; o[--f] === 0; ) o.pop();
|
|
1366
|
+
for (; o[0] === 0; )
|
|
1367
|
+
o.shift(), --h;
|
|
1368
|
+
return o[0] || (e.s = 1, o = [h = 0]), e.c = o, e.e = h, e;
|
|
1369
|
+
};
|
|
1370
|
+
w.mod = function(e) {
|
|
1371
|
+
var t, r = this, n = r.constructor, i = r.s, s = (e = new n(e)).s;
|
|
1372
|
+
if (!e.c[0]) throw Error(ze);
|
|
1373
|
+
return r.s = e.s = 1, t = e.cmp(r) == 1, r.s = i, e.s = s, t ? new n(r) : (i = n.DP, s = n.RM, n.DP = n.RM = 0, r = r.div(e), n.DP = i, n.RM = s, this.minus(r.times(e)));
|
|
1374
|
+
};
|
|
1375
|
+
w.plus = w.add = function(e) {
|
|
1376
|
+
var t, r = this, n = r.constructor, i = r.s, s = (e = new n(e)).s;
|
|
1377
|
+
if (i != s)
|
|
1378
|
+
return e.s = -s, r.minus(e);
|
|
1379
|
+
var c = r.e, u = r.c, f = e.e, o = e.c;
|
|
1380
|
+
if (!u[0] || !o[0]) return o[0] ? e : new n(u[0] ? r : i * 0);
|
|
1381
|
+
if (u = u.slice(), i = c - f) {
|
|
1382
|
+
for (i > 0 ? (f = c, t = o) : (i = -i, t = u), t.reverse(); i--; ) t.push(0);
|
|
1383
|
+
t.reverse();
|
|
1384
|
+
}
|
|
1385
|
+
for (u.length - o.length < 0 && (t = o, o = u, u = t), i = o.length, s = 0; i; u[i] %= 10) s = (u[--i] = u[i] + o[i] + s) / 10 | 0;
|
|
1386
|
+
for (s && (u.unshift(s), ++f), i = u.length; u[--i] === 0; ) u.pop();
|
|
1387
|
+
return e.c = u, e.e = f, e;
|
|
1388
|
+
};
|
|
1389
|
+
w.pow = function(e) {
|
|
1390
|
+
var t = this, r = new t.constructor(1), n = r, i = e < 0;
|
|
1391
|
+
if (e !== ~~e || e < -Ae || e > Ae) throw Error(Q + "exponent");
|
|
1392
|
+
for (i && (e = -e); e & 1 && (n = n.times(t)), e >>= 1, !!e; )
|
|
1393
|
+
t = t.times(t);
|
|
1394
|
+
return i ? r.div(n) : n;
|
|
1395
|
+
};
|
|
1396
|
+
w.round = function(e, t) {
|
|
1397
|
+
var r = this.constructor;
|
|
1398
|
+
if (e === j) e = 0;
|
|
1399
|
+
else if (e !== ~~e || e < -V || e > V) throw Error(ae);
|
|
1400
|
+
return J(new r(this), e, t === j ? r.RM : t);
|
|
1401
|
+
};
|
|
1402
|
+
w.sqrt = function() {
|
|
1403
|
+
var e, t, r, n = this, i = n.constructor, s = n.s, c = n.e, u = new i(0.5);
|
|
1404
|
+
if (!n.c[0]) return new i(n);
|
|
1405
|
+
if (s < 0) throw Error(fe + "No square root");
|
|
1406
|
+
s = Math.sqrt(n + ""), s === 0 || s === 1 / 0 ? (t = n.c.join(""), t.length + c & 1 || (t += "0"), s = Math.sqrt(t), c = ((c + 1) / 2 | 0) - (c < 0 || c & 1), e = new i((s == 1 / 0 ? "1e" : (s = s.toExponential()).slice(0, s.indexOf("e") + 1)) + c)) : e = new i(s), c = e.e + (i.DP += 4);
|
|
1407
|
+
do
|
|
1408
|
+
r = e, e = u.times(r.plus(n.div(r)));
|
|
1409
|
+
while (r.c.slice(0, c).join("") !== e.c.slice(0, c).join(""));
|
|
1410
|
+
return J(e, i.DP -= 4, i.RM);
|
|
1411
|
+
};
|
|
1412
|
+
w.times = w.mul = function(e) {
|
|
1413
|
+
var t, r = this, n = r.constructor, i = r.c, s = (e = new n(e)).c, c = i.length, u = s.length, f = r.e, o = e.e;
|
|
1414
|
+
if (e.s = r.s == e.s ? 1 : -1, !i[0] || !s[0]) return new n(e.s * 0);
|
|
1415
|
+
for (e.e = f + o, c < u && (t = i, i = s, s = t, o = c, c = u, u = o), t = new Array(o = c + u); o--; ) t[o] = 0;
|
|
1416
|
+
for (f = u; f--; ) {
|
|
1417
|
+
for (u = 0, o = c + f; o > f; )
|
|
1418
|
+
u = t[o] + s[f] * i[o - f - 1] + u, t[o--] = u % 10, u = u / 10 | 0;
|
|
1419
|
+
t[o] = (t[o] + u) % 10;
|
|
1420
|
+
}
|
|
1421
|
+
for (u ? ++e.e : t.shift(), f = t.length; !t[--f]; ) t.pop();
|
|
1422
|
+
return e.c = t, e;
|
|
1423
|
+
};
|
|
1424
|
+
w.toExponential = function(e) {
|
|
1425
|
+
return X(this, 1, e, e);
|
|
1426
|
+
};
|
|
1427
|
+
w.toFixed = function(e) {
|
|
1428
|
+
return X(this, 2, e, this.e + e);
|
|
1429
|
+
};
|
|
1430
|
+
w.toPrecision = function(e) {
|
|
1431
|
+
return X(this, 3, e, e - 1);
|
|
1432
|
+
};
|
|
1433
|
+
w.toString = function() {
|
|
1434
|
+
return X(this);
|
|
1435
|
+
};
|
|
1436
|
+
w.valueOf = w.toJSON = function() {
|
|
1437
|
+
return X(this, 4);
|
|
1438
|
+
};
|
|
1439
|
+
var Rr = He();
|
|
1440
|
+
function C(e, t) {
|
|
1441
|
+
if (typeof e != "number" || Number.isNaN(e) || t == null)
|
|
1442
|
+
return null;
|
|
1443
|
+
const r = t.map((n) => ({ name: n[0], value: n[1] }));
|
|
1444
|
+
return jr(e, r);
|
|
1445
|
+
}
|
|
1446
|
+
function jr(e, t) {
|
|
1447
|
+
if (typeof e != "number" || Number.isNaN(e) || t == null)
|
|
1448
|
+
return null;
|
|
1449
|
+
const r = parseFloat(Rr(e).round(4)), n = Math.max(r, 0), i = t.find((s, c) => {
|
|
1450
|
+
const u = (s.value * 100).toPrecision(4);
|
|
1451
|
+
return n >= parseFloat(u) || c === t.length - 1;
|
|
1452
|
+
});
|
|
1453
|
+
if (!i)
|
|
1454
|
+
throw new Error("grading scheme not found");
|
|
1455
|
+
return i.name;
|
|
1456
|
+
}
|
|
1457
|
+
function qr(e, t = {}) {
|
|
1458
|
+
const r = t.precision ?? (t.strip_insignificant_zeros !== !1 ? void 0 : 5), n = r !== void 0 ? e.toFixed(r) : String(e), i = t.strip_insignificant_zeros !== !1 && n.includes(".") ? n.replace(/\.?0+$/, "") : n;
|
|
1459
|
+
return t.percentage ? `${i}%` : i;
|
|
1460
|
+
}
|
|
1461
|
+
function $r(e) {
|
|
1462
|
+
if (typeof e == "number") return e;
|
|
1463
|
+
const t = String(e).replace(/,/g, ""), r = parseFloat(t);
|
|
1464
|
+
return Number.isNaN(r) ? NaN : r;
|
|
1465
|
+
}
|
|
1466
|
+
const Lr = {
|
|
1467
|
+
excused: "Excused",
|
|
1468
|
+
complete: "Complete",
|
|
1469
|
+
incomplete: "Incomplete",
|
|
1470
|
+
scoreOutOf: "%{score}/%{pointsPossible}"
|
|
1471
|
+
}, z = {
|
|
1472
|
+
formatNumber: qr,
|
|
1473
|
+
parseNumber: $r,
|
|
1474
|
+
strings: Lr
|
|
1475
|
+
};
|
|
1476
|
+
let de = { ...z };
|
|
1477
|
+
function Nn(e) {
|
|
1478
|
+
de = {
|
|
1479
|
+
formatNumber: e.formatNumber ?? z.formatNumber,
|
|
1480
|
+
parseNumber: e.parseNumber ?? z.parseNumber,
|
|
1481
|
+
strings: { ...z.strings, ...e.strings }
|
|
1482
|
+
};
|
|
1483
|
+
}
|
|
1484
|
+
function En() {
|
|
1485
|
+
de = { ...z };
|
|
1486
|
+
}
|
|
1487
|
+
function I() {
|
|
1488
|
+
return de;
|
|
1489
|
+
}
|
|
1490
|
+
const U = Object.assign(
|
|
1491
|
+
(e, t = 0) => {
|
|
1492
|
+
if (e === null)
|
|
1493
|
+
return NaN;
|
|
1494
|
+
try {
|
|
1495
|
+
return parseFloat(D(e).round(t).toString());
|
|
1496
|
+
} catch {
|
|
1497
|
+
return NaN;
|
|
1498
|
+
}
|
|
1499
|
+
},
|
|
1500
|
+
{ DEFAULT: 2 }
|
|
1501
|
+
), Qe = "letter_grade", ge = "points", le = "percent", Xe = "pass_fail", Ye = "gpa_scale", Ur = "points_out_of_fraction", he = ["complete", "pass"], Ve = ["incomplete", "fail"], T = "–", Wr = [ge, le, Ye], vr = ["pass_fail", "letter_grade"];
|
|
1502
|
+
function Ze(e) {
|
|
1503
|
+
return typeof e != "string" ? e : e.replace(/(.+)-$/, "$1−");
|
|
1504
|
+
}
|
|
1505
|
+
function Je(e, t = null) {
|
|
1506
|
+
return t ? t === Xe : he.includes(e) || Ve.includes(e);
|
|
1507
|
+
}
|
|
1508
|
+
function zr(e, t) {
|
|
1509
|
+
return t ? t === le : /%/g.test(e);
|
|
1510
|
+
}
|
|
1511
|
+
function Te(e) {
|
|
1512
|
+
return e === "EX";
|
|
1513
|
+
}
|
|
1514
|
+
function K() {
|
|
1515
|
+
return I().strings.excused;
|
|
1516
|
+
}
|
|
1517
|
+
function Ke(e, t) {
|
|
1518
|
+
if (e == null || e === "" || t == null)
|
|
1519
|
+
return e;
|
|
1520
|
+
const { formatNumber: r, strings: n } = I(), i = { precision: 2, strip_insignificant_zeros: !0 };
|
|
1521
|
+
let s = T;
|
|
1522
|
+
e != null && (s = r(Number(e), i));
|
|
1523
|
+
const c = r(Number(t), i);
|
|
1524
|
+
return n.scoreOutOf.replace("%{score}", s).replace("%{pointsPossible}", c);
|
|
1525
|
+
}
|
|
1526
|
+
function Hr(e) {
|
|
1527
|
+
return he.includes(e) ? "complete" : Ve.includes(e) ? "incomplete" : null;
|
|
1528
|
+
}
|
|
1529
|
+
function Qr(e) {
|
|
1530
|
+
return e === ge || e === le || e === Xe || e === Qe;
|
|
1531
|
+
}
|
|
1532
|
+
function Xr(e, t) {
|
|
1533
|
+
return t ? Qr(t) : typeof e == "number" || Je(e);
|
|
1534
|
+
}
|
|
1535
|
+
function Yr(e) {
|
|
1536
|
+
const { formatNumber: t } = I();
|
|
1537
|
+
return t(U(e, 2), { precision: 2, strip_insignificant_zeros: !0 });
|
|
1538
|
+
}
|
|
1539
|
+
function Vr(e, t) {
|
|
1540
|
+
const { formatNumber: r } = I(), n = t.pointsPossible ? ve(e, t.pointsPossible) : e;
|
|
1541
|
+
return r(U(n, 2), {
|
|
1542
|
+
percentage: !0,
|
|
1543
|
+
precision: 2,
|
|
1544
|
+
strip_insignificant_zeros: !0
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
function v(e, t, r = {}) {
|
|
1548
|
+
let n;
|
|
1549
|
+
if (r != null && r.restrict_quantitative_data && r.pointsPossible === 0 && (e ?? 0) >= 0)
|
|
1550
|
+
n = C(
|
|
1551
|
+
100,
|
|
1552
|
+
r.gradingScheme,
|
|
1553
|
+
r.pointsBasedGradingScheme,
|
|
1554
|
+
r.scalingFactor
|
|
1555
|
+
);
|
|
1556
|
+
else if (r.pointsPossible) {
|
|
1557
|
+
const i = ve(e, r.pointsPossible);
|
|
1558
|
+
n = C(
|
|
1559
|
+
i,
|
|
1560
|
+
r.gradingScheme,
|
|
1561
|
+
r.pointsBasedGradingScheme,
|
|
1562
|
+
r.scalingFactor
|
|
1563
|
+
);
|
|
1564
|
+
} else t != null ? n = t : n = C(
|
|
1565
|
+
e,
|
|
1566
|
+
r.gradingScheme,
|
|
1567
|
+
r.pointsBasedGradingScheme,
|
|
1568
|
+
r.scalingFactor
|
|
1569
|
+
);
|
|
1570
|
+
return Ze(n);
|
|
1571
|
+
}
|
|
1572
|
+
function Zr(e, t, r) {
|
|
1573
|
+
const { strings: n } = I();
|
|
1574
|
+
let i = !1;
|
|
1575
|
+
return r.pointsPossible ? i = e > 0 : i = he.includes(t), i ? n.complete : n.incomplete;
|
|
1576
|
+
}
|
|
1577
|
+
function Jr(e, t = {}) {
|
|
1578
|
+
return e.excused ? K() : e.grade == null ? t.defaultValue != null ? t.defaultValue : T : e.grade;
|
|
1579
|
+
}
|
|
1580
|
+
function Tr(e, t = {}) {
|
|
1581
|
+
const { formatNumber: r } = I();
|
|
1582
|
+
let n = e;
|
|
1583
|
+
if (e == null || e === "")
|
|
1584
|
+
return "defaultValue" in t ? t.defaultValue : e;
|
|
1585
|
+
if (Te(e))
|
|
1586
|
+
return K();
|
|
1587
|
+
let i = ke(e, t);
|
|
1588
|
+
if (Xr(i, t.gradingType))
|
|
1589
|
+
if (Je(i, t.gradingType)) {
|
|
1590
|
+
i = Hr(i);
|
|
1591
|
+
const { strings: s } = I();
|
|
1592
|
+
n = i === "complete" ? s.complete : s.incomplete;
|
|
1593
|
+
} else if (i && t.gradingType === Qe)
|
|
1594
|
+
n = v(null, i);
|
|
1595
|
+
else if (t.restrict_quantitative_data && t.score != null && t.pointsPossible != null)
|
|
1596
|
+
n = v(t.score, null, {
|
|
1597
|
+
gradingScheme: t.grading_scheme,
|
|
1598
|
+
pointsBasedGradingScheme: t.points_based_grading_scheme,
|
|
1599
|
+
pointsPossible: t.pointsPossible,
|
|
1600
|
+
restrict_quantitative_data: t.restrict_quantitative_data,
|
|
1601
|
+
scalingFactor: t.scaling_factor
|
|
1602
|
+
});
|
|
1603
|
+
else {
|
|
1604
|
+
const s = U(i, t.precision || 2);
|
|
1605
|
+
n = r(s, {
|
|
1606
|
+
percentage: zr(e, t.gradingType)
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
return !t.restrict_quantitative_data && t.gradingType === ge && t.formatType === Ur && (n = Ke(e, t.pointsPossible)), t.restrict_quantitative_data && t.score != null && t.pointsPossible != null && t.gradingType === Ye && (n = v(t.score, null, {
|
|
1610
|
+
gradingScheme: t.grading_scheme,
|
|
1611
|
+
pointsBasedGradingScheme: t.points_based_grading_scheme,
|
|
1612
|
+
pointsPossible: t.pointsPossible,
|
|
1613
|
+
restrict_quantitative_data: t.restrict_quantitative_data,
|
|
1614
|
+
scalingFactor: t.scaling_factor
|
|
1615
|
+
})), t.restrict_quantitative_data && t.score != null && t.pointsPossible === 0 && t.gradingType === "letter_grade" && (n = v(t.score, null, {
|
|
1616
|
+
gradingScheme: t.grading_scheme,
|
|
1617
|
+
pointsBasedGradingScheme: t.points_based_grading_scheme,
|
|
1618
|
+
pointsPossible: t.pointsPossible,
|
|
1619
|
+
restrict_quantitative_data: t.restrict_quantitative_data,
|
|
1620
|
+
scalingFactor: t.scaling_factor
|
|
1621
|
+
})), n;
|
|
1622
|
+
}
|
|
1623
|
+
function Kr(e) {
|
|
1624
|
+
if (e == null || typeof e != "string")
|
|
1625
|
+
return e;
|
|
1626
|
+
const { parseNumber: t } = I(), r = t(e.replace("%", ""));
|
|
1627
|
+
return Number.isNaN(Number(r)) ? e : r + (/%/g.test(e) ? "%" : "");
|
|
1628
|
+
}
|
|
1629
|
+
function ke(e, t = {}) {
|
|
1630
|
+
if (e == null || e === "" || typeof e == "number")
|
|
1631
|
+
return e;
|
|
1632
|
+
const { parseNumber: r } = I();
|
|
1633
|
+
let n;
|
|
1634
|
+
const i = e.replace("%", "");
|
|
1635
|
+
return "delocalize" in t && !t.delocalize && !Number.isNaN(Number(i)) ? n = parseFloat(i) : n = r(i), Number.isNaN(Number(n)) ? e : n;
|
|
1636
|
+
}
|
|
1637
|
+
function kr(e, t = { version: "final" }) {
|
|
1638
|
+
if (e.excused)
|
|
1639
|
+
return K();
|
|
1640
|
+
const r = t.version === "entered" ? e.enteredScore : e.score, n = t.version === "entered" ? e.enteredGrade : e.grade;
|
|
1641
|
+
if (r == null)
|
|
1642
|
+
return t.defaultValue != null ? t.defaultValue : T;
|
|
1643
|
+
switch (t.formatType) {
|
|
1644
|
+
case "percent":
|
|
1645
|
+
return Vr(r, t);
|
|
1646
|
+
case "gradingScheme":
|
|
1647
|
+
return v(r, n ?? null);
|
|
1648
|
+
case "passFail":
|
|
1649
|
+
return Zr(r, n ?? "", t);
|
|
1650
|
+
default:
|
|
1651
|
+
return Yr(r);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
const yn = {
|
|
1655
|
+
formatGrade: Tr,
|
|
1656
|
+
delocalizeGrade: Kr,
|
|
1657
|
+
parseGrade: ke,
|
|
1658
|
+
excused: K,
|
|
1659
|
+
isExcused: Te,
|
|
1660
|
+
formatGradeInfo: Jr,
|
|
1661
|
+
formatPointsOutOf: Ke,
|
|
1662
|
+
formatSubmissionGrade: kr,
|
|
1663
|
+
replaceDashWithMinus: Ze,
|
|
1664
|
+
UNGRADED: T,
|
|
1665
|
+
QUANTITATIVE_GRADING_TYPES: Wr,
|
|
1666
|
+
QUALITATIVE_GRADING_TYPES: vr
|
|
1667
|
+
};
|
|
1668
|
+
function Ce(e, t) {
|
|
1669
|
+
const r = (s, c) => s[0].toLowerCase() === c, n = `${e}`.trim().toLowerCase();
|
|
1670
|
+
let i = t.findIndex((s) => r(s, n));
|
|
1671
|
+
if (i < 0 && /.+−$/.test(n)) {
|
|
1672
|
+
const s = n.replace(/−$/, "-");
|
|
1673
|
+
i = t.findIndex((c) => r(c, s));
|
|
1674
|
+
}
|
|
1675
|
+
return i;
|
|
1676
|
+
}
|
|
1677
|
+
function Dn(e, t) {
|
|
1678
|
+
const r = Ce(e, t);
|
|
1679
|
+
if (r === -1)
|
|
1680
|
+
return null;
|
|
1681
|
+
if (r === 0)
|
|
1682
|
+
return 100;
|
|
1683
|
+
const n = t[r][1], i = t[r - 1][1], s = U(i - n, 4) * 100;
|
|
1684
|
+
let c = 1;
|
|
1685
|
+
return s <= 1 && (s <= 0.1 ? c = 0.01 : c = 0.1), U(i * 100 - c, 2);
|
|
1686
|
+
}
|
|
1687
|
+
function Pn(e, t) {
|
|
1688
|
+
const r = Ce(e, t);
|
|
1689
|
+
if (r === -1)
|
|
1690
|
+
return null;
|
|
1691
|
+
const n = t[r][1];
|
|
1692
|
+
return U(n * 100, 2);
|
|
1693
|
+
}
|
|
1694
|
+
function Gn(e, t) {
|
|
1695
|
+
if (t.pointsBased && e != null)
|
|
1696
|
+
return e / t.scalingFactor * 100;
|
|
452
1697
|
}
|
|
453
1698
|
export {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
1699
|
+
ot as AssignmentGroupScoresTable,
|
|
1700
|
+
mt as AssignmentScoresTable,
|
|
1701
|
+
pt as CollapsibleSection,
|
|
1702
|
+
at as FeedbackIndicator,
|
|
1703
|
+
yn as GradeFormatHelper,
|
|
1704
|
+
vr as QUALITATIVE_GRADING_TYPES,
|
|
1705
|
+
Wr as QUANTITATIVE_GRADING_TYPES,
|
|
1706
|
+
mn as ScoreDisplay,
|
|
1707
|
+
hn as ScoresPage,
|
|
1708
|
+
gt as SubmissionStatusPill,
|
|
1709
|
+
St as TotalScoreHeading,
|
|
1710
|
+
T as UNGRADED,
|
|
1711
|
+
Pr as add,
|
|
1712
|
+
Sn as bigSum,
|
|
1713
|
+
dt as calculateSubmissionStatus,
|
|
1714
|
+
Nn as configureGradeFormatting,
|
|
1715
|
+
Kr as delocalizeGrade,
|
|
1716
|
+
We as divide,
|
|
1717
|
+
K as excused,
|
|
1718
|
+
Tr as formatGrade,
|
|
1719
|
+
Jr as formatGradeInfo,
|
|
1720
|
+
Ke as formatPointsOutOf,
|
|
1721
|
+
ye as formatScore,
|
|
1722
|
+
kr as formatSubmissionGrade,
|
|
1723
|
+
Ne as getTotalScore,
|
|
1724
|
+
Gn as gradePointsToPercentage,
|
|
1725
|
+
Pn as gradeToScoreLowerBound,
|
|
1726
|
+
Dn as gradeToScoreUpperBound,
|
|
1727
|
+
Ce as indexOfGrade,
|
|
1728
|
+
Te as isExcused,
|
|
1729
|
+
Ee as isNonNumericGradingType,
|
|
1730
|
+
pn as multiply,
|
|
1731
|
+
ke as parseGrade,
|
|
1732
|
+
Ze as replaceDashWithMinus,
|
|
1733
|
+
En as resetGradeFormatting,
|
|
1734
|
+
U as round,
|
|
1735
|
+
ve as scoreToPercentage,
|
|
1736
|
+
An as scoreToScaledPoints,
|
|
1737
|
+
ft as shouldUseFormattedGrade,
|
|
1738
|
+
Gr as sum,
|
|
1739
|
+
wn as sumBy,
|
|
1740
|
+
oe as toNumber,
|
|
1741
|
+
bn as totalGradeRound,
|
|
1742
|
+
Ot as transformAssignmentGroupScores,
|
|
1743
|
+
Bt as transformAssignmentScores,
|
|
1744
|
+
xt as useGetCourseScores,
|
|
1745
|
+
It as useGetCourseSettings,
|
|
1746
|
+
_n as weightedPercent
|
|
471
1747
|
};
|