@burdenoff/microfe-buildmyiq 2026.803.1 → 2026.804.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts +21 -3
  2. package/dist/buildmyiq/hooks/useBuildmyiqApi.d.ts.map +1 -1
  3. package/dist/buildmyiq/hooks/useBuildmyiqApi.js +116 -62
  4. package/dist/buildmyiq/hooks/useBuildmyiqApi.js.map +1 -1
  5. package/dist/buildmyiq/pages/DashboardPage.d.ts.map +1 -1
  6. package/dist/buildmyiq/pages/DashboardPage.js +3 -4
  7. package/dist/buildmyiq/pages/DashboardPage.js.map +1 -1
  8. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.d.ts.map +1 -1
  9. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js +1 -2
  10. package/dist/buildmyiq/pages/assessments/TakeAssessmentPage.js.map +1 -1
  11. package/dist/buildmyiq/pages/catalog/CourseDetailPage.d.ts.map +1 -1
  12. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js +14 -15
  13. package/dist/buildmyiq/pages/catalog/CourseDetailPage.js.map +1 -1
  14. package/dist/buildmyiq/pages/certificates/CertificatesPage.d.ts.map +1 -1
  15. package/dist/buildmyiq/pages/certificates/CertificatesPage.js +175 -175
  16. package/dist/buildmyiq/pages/certificates/CertificatesPage.js.map +1 -1
  17. package/dist/buildmyiq/pages/learning/MyLearningPage.js +2 -4
  18. package/dist/buildmyiq/pages/learning/MyLearningPage.js.map +1 -1
  19. package/dist/buildmyiq/pages/paths/PathsPage.d.ts.map +1 -1
  20. package/dist/buildmyiq/pages/paths/PathsPage.js +1 -2
  21. package/dist/buildmyiq/pages/paths/PathsPage.js.map +1 -1
  22. package/dist/buildmyiq/pages/submissions/AnswersView.d.ts +6 -0
  23. package/dist/buildmyiq/pages/submissions/AnswersView.d.ts.map +1 -0
  24. package/dist/buildmyiq/pages/submissions/AnswersView.js +41 -0
  25. package/dist/buildmyiq/pages/submissions/AnswersView.js.map +1 -0
  26. package/dist/buildmyiq/pages/submissions/BulkGradingPage.d.ts.map +1 -1
  27. package/dist/buildmyiq/pages/submissions/BulkGradingPage.js +332 -173
  28. package/dist/buildmyiq/pages/submissions/BulkGradingPage.js.map +1 -1
  29. package/dist/buildmyiq/pages/submissions/SubmissionsPage.d.ts.map +1 -1
  30. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js +221 -227
  31. package/dist/buildmyiq/pages/submissions/SubmissionsPage.js.map +1 -1
  32. package/dist/buildmyiq/pages/submissions/aiGrading.d.ts +26 -0
  33. package/dist/buildmyiq/pages/submissions/aiGrading.d.ts.map +1 -0
  34. package/dist/buildmyiq/pages/submissions/aiGrading.js +23 -0
  35. package/dist/buildmyiq/pages/submissions/aiGrading.js.map +1 -0
  36. package/dist/buildmyiq/types/index.d.ts +10 -0
  37. package/dist/buildmyiq/types/index.d.ts.map +1 -1
  38. package/dist/buildmyiq/types/index.js.map +1 -1
  39. package/dist/utils/pageContext.d.ts +8 -0
  40. package/dist/utils/pageContext.d.ts.map +1 -1
  41. package/dist/utils/pageContext.js +8 -0
  42. package/dist/utils/pageContext.js.map +1 -1
  43. package/package.json +2 -1
@@ -4,86 +4,86 @@ import { PageLayout as t } from "../../components/PageLayout.js";
4
4
  import { MetricsCard as n } from "../../components/MetricsCard.js";
5
5
  import { formatDate as r, formatPercent as ee } from "../../utils/formatters.js";
6
6
  import { StatusBadge as te } from "../../components/StatusBadge.js";
7
- import { EmptyState as i } from "../../components/EmptyState.js";
8
- import { ErrorView as ne, LoadingView as re } from "../../components/StateViews.js";
9
- import { DataTable as ie } from "../../components/DataTable.js";
10
- import { FilterTabs as ae } from "../../components/FilterTabs.js";
11
- import { Pagination as oe } from "../../components/Pagination.js";
12
- import { Avatar as se } from "../../components/Avatar.js";
13
- import { useBuiCertificates as ce, useBuiCourses as le, useBuiIssueCertificate as ue, useBuiRevokeCertificate as a } from "../../hooks/useBuildmyiqApi.js";
7
+ import { EmptyState as ne } from "../../components/EmptyState.js";
8
+ import { ErrorView as re, LoadingView as ie } from "../../components/StateViews.js";
9
+ import { DataTable as ae } from "../../components/DataTable.js";
10
+ import { FilterTabs as oe } from "../../components/FilterTabs.js";
11
+ import { Pagination as se } from "../../components/Pagination.js";
12
+ import { Avatar as ce } from "../../components/Avatar.js";
13
+ import { useBuiCertificates as le, useBuiCourses as ue, useBuiIssueCertificate as de, useBuiMyCertificates as fe, useBuiRevokeCertificate as pe } from "../../hooks/useBuildmyiqApi.js";
14
14
  import "../../hooks/index.js";
15
- import { FileLink as de } from "../../components/FileLink.js";
16
- import { BuiPermissionButton as o } from "../../components/BuiPermissionButton.js";
15
+ import { FileLink as me } from "../../components/FileLink.js";
16
+ import { BuiPermissionButton as i } from "../../components/BuiPermissionButton.js";
17
17
  import "../../components/index.js";
18
- import { useMemo as s, useState as c } from "react";
19
- import { Award as l, Ban as u, CalendarClock as fe, Download as pe, Plus as d, Search as me, ShieldCheck as he } from "lucide-react";
20
- import { Fragment as ge, jsx as f, jsxs as p } from "react/jsx-runtime";
21
- import { Button as m, Input as h, Label as g, ResponsiveDialog as _e, ResponsiveDialogContent as ve, ResponsiveDialogDescription as ye, ResponsiveDialogFooter as be, ResponsiveDialogHeader as xe, ResponsiveDialogTitle as Se, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as b, SelectValue as x } from "@burdenoff/fe-libs/ui";
18
+ import { useMemo as a, useState as o } from "react";
19
+ import { Award as s, Ban as c, CalendarClock as he, Download as ge, Plus as l, Search as _e, ShieldCheck as ve } from "lucide-react";
20
+ import { Fragment as ye, jsx as u, jsxs as d } from "react/jsx-runtime";
21
+ import { Button as f, Input as p, Label as m, ResponsiveDialog as be, ResponsiveDialogContent as xe, ResponsiveDialogDescription as Se, ResponsiveDialogFooter as Ce, ResponsiveDialogHeader as we, ResponsiveDialogTitle as Te, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "@burdenoff/fe-libs/ui";
22
22
  //#region src/buildmyiq/pages/certificates/CertificatesPage.tsx
23
- var S = 8, Ce = (e) => {
23
+ var b = 8, Ee = (e) => {
24
24
  let t = e.trim();
25
25
  if (!t) return;
26
26
  let n = new Date(t);
27
27
  return Number.isNaN(n.getTime()) ? void 0 : n.toISOString();
28
- }, we = () => `BMIQ-${Date.now().toString(36).toUpperCase()}`, C = () => {
29
- let { currentUser: C } = e(), w = C?.id, [T, Te] = c(w ? "MINE" : "ALL"), [E, D] = c("ALL"), [O, Ee] = c(""), [De, k] = c(0), [Oe, A] = c(!1), [j, M] = c(null), [N, P] = c(null), [F, I] = c(null), L = () => ({
28
+ }, De = () => `BMIQ-${Date.now().toString(36).toUpperCase()}`, x = () => {
29
+ let { currentUser: x } = e(), S = x?.id, [C, Oe] = o(S ? "MINE" : "ALL"), [w, T] = o("ALL"), [E, ke] = o(""), [Ae, D] = o(0), [je, O] = o(!1), [k, A] = o(null), [j, M] = o(null), [N, P] = o(null), F = () => ({
30
30
  courseId: "",
31
- learnerId: w ?? "",
32
- serial: we(),
31
+ learnerId: S ?? "",
32
+ serial: De(),
33
33
  finalScore: "",
34
34
  expiresAt: ""
35
- }), [R, z] = c(L), B = le({ limit: 100 }), V = s(() => B.data?.items ?? [], [B.data]), H = s(() => {
35
+ }), [I, L] = o(F), R = ue({ limit: 100 }), z = a(() => R.data?.items ?? [], [R.data]), B = a(() => {
36
36
  let e = /* @__PURE__ */ new Map();
37
- for (let t of V) e.set(t.id, t.title);
37
+ for (let t of z) e.set(t.id, t.title);
38
38
  return e;
39
- }, [V]), U = ce(E === "ALL" ? void 0 : E, T === "MINE" ? w : void 0), W = ue(), ke = a(), G = s(() => U.data ?? [], [U.data]), K = s(() => {
40
- let e = O.trim().toLowerCase();
41
- return e ? G.filter((t) => {
42
- let n = (H.get(t.courseId) ?? "").toLowerCase(), r = t.learnerId === w ? "you me mine" : t.learnerId.toLowerCase();
39
+ }, [z]), V = w === "ALL" ? void 0 : w, Me = fe(V, C === "MINE"), Ne = le(V, C === "ALL"), H = C === "MINE" ? Me : Ne, U = de(), Pe = pe(), W = a(() => H.data ?? [], [H.data]), G = a(() => {
40
+ let e = E.trim().toLowerCase();
41
+ return e ? W.filter((t) => {
42
+ let n = (B.get(t.courseId) ?? "").toLowerCase(), r = t.learnerId === S ? "you me mine" : t.learnerId.toLowerCase();
43
43
  return t.serial.toLowerCase().includes(e) || n.includes(e) || r.includes(e);
44
- }) : G;
44
+ }) : W;
45
45
  }, [
46
- G,
47
- O,
48
- H,
49
- w
50
- ]), q = s(() => {
46
+ W,
47
+ E,
48
+ B,
49
+ S
50
+ ]), K = a(() => {
51
51
  let e = 0, t = 0, n = 0;
52
- for (let r of G) r.status === "ISSUED" ? e += 1 : r.status === "EXPIRED" ? t += 1 : r.status === "REVOKED" && (n += 1);
52
+ for (let r of W) r.status === "ISSUED" ? e += 1 : r.status === "EXPIRED" ? t += 1 : r.status === "REVOKED" && (n += 1);
53
53
  return {
54
- total: G.length,
54
+ total: W.length,
55
55
  issued: e,
56
56
  expired: t,
57
57
  revoked: n
58
58
  };
59
- }, [G]), Ae = Math.max(1, Math.ceil(K.length / S)), J = Math.min(De, Ae - 1), Y = s(() => K.slice(J * S, J * S + S), [K, J]), je = [{
59
+ }, [W]), Fe = Math.max(1, Math.ceil(G.length / b)), q = Math.min(Ae, Fe - 1), J = a(() => G.slice(q * b, q * b + b), [G, q]), Ie = [{
60
60
  value: "MINE",
61
61
  label: "Mine"
62
62
  }, {
63
63
  value: "ALL",
64
64
  label: "All"
65
- }], Me = async (e) => {
65
+ }], Le = async (e) => {
66
66
  if (!(typeof window < "u" && !window.confirm(`Revoke certificate ${e.serial}? This cannot be undone.`))) {
67
- P(null), I(e.id);
67
+ M(null), P(e.id);
68
68
  try {
69
- await ke.mutateAsync(e.id);
69
+ await Pe.mutateAsync(e.id);
70
70
  } catch (e) {
71
- P(e instanceof Error ? e.message : "Failed to revoke certificate.");
71
+ M(e instanceof Error ? e.message : "Failed to revoke certificate.");
72
72
  } finally {
73
- I(null);
73
+ P(null);
74
74
  }
75
75
  }
76
- }, Ne = [
76
+ }, Y = [
77
77
  {
78
78
  key: "serial",
79
79
  header: "Serial",
80
80
  sortValue: (e) => e.serial.toLowerCase(),
81
- render: (e) => /* @__PURE__ */ p("div", {
81
+ render: (e) => /* @__PURE__ */ d("div", {
82
82
  className: "flex items-center gap-3",
83
- children: [/* @__PURE__ */ f("div", {
83
+ children: [/* @__PURE__ */ u("div", {
84
84
  className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-[var(--color-accent-primary)]",
85
- children: /* @__PURE__ */ f(l, { className: "h-4 w-4" })
86
- }), /* @__PURE__ */ f("span", {
85
+ children: /* @__PURE__ */ u(s, { className: "h-4 w-4" })
86
+ }), /* @__PURE__ */ u("span", {
87
87
  className: "min-w-0 truncate font-mono text-xs font-semibold text-text-primary",
88
88
  children: e.serial
89
89
  })]
@@ -93,28 +93,28 @@ var S = 8, Ce = (e) => {
93
93
  key: "course",
94
94
  header: "Course",
95
95
  hideOnMobile: !0,
96
- sortValue: (e) => (H.get(e.courseId) ?? "").toLowerCase(),
97
- render: (e) => /* @__PURE__ */ f("span", {
96
+ sortValue: (e) => (B.get(e.courseId) ?? "").toLowerCase(),
97
+ render: (e) => /* @__PURE__ */ u("span", {
98
98
  className: "text-text-secondary",
99
- children: H.get(e.courseId) ?? "—"
99
+ children: B.get(e.courseId) ?? "—"
100
100
  })
101
101
  },
102
102
  {
103
103
  key: "learner",
104
104
  header: "Learner",
105
- sortValue: (e) => e.learnerId === w ? "" : e.learnerId,
105
+ sortValue: (e) => e.learnerId === S ? "" : e.learnerId,
106
106
  render: (e) => {
107
- let t = e.learnerId === w, n = t ? C?.name ?? C?.username ?? C?.email ?? null : null;
108
- return /* @__PURE__ */ p("div", {
107
+ let t = e.learnerId === S, n = t ? x?.name ?? x?.username ?? x?.email ?? null : null;
108
+ return /* @__PURE__ */ d("div", {
109
109
  className: "flex items-center gap-2.5",
110
- children: [/* @__PURE__ */ f(se, {
110
+ children: [/* @__PURE__ */ u(ce, {
111
111
  size: "sm",
112
112
  seed: e.learnerId,
113
113
  name: n
114
- }), t ? /* @__PURE__ */ f("span", {
114
+ }), t ? /* @__PURE__ */ u("span", {
115
115
  className: "font-medium text-text-primary",
116
116
  children: "You"
117
- }) : /* @__PURE__ */ p("span", {
117
+ }) : /* @__PURE__ */ d("span", {
118
118
  className: "font-mono text-xs text-text-tertiary",
119
119
  title: e.learnerId,
120
120
  children: [e.learnerId.slice(0, 8), "…"]
@@ -125,14 +125,14 @@ var S = 8, Ce = (e) => {
125
125
  {
126
126
  key: "status",
127
127
  header: "Status",
128
- render: (e) => /* @__PURE__ */ f(te, { status: e.status })
128
+ render: (e) => /* @__PURE__ */ u(te, { status: e.status })
129
129
  },
130
130
  {
131
131
  key: "issuedAt",
132
132
  header: "Issued",
133
133
  hideOnMobile: !0,
134
134
  sortValue: (e) => e.issuedAt,
135
- render: (e) => /* @__PURE__ */ f("span", {
135
+ render: (e) => /* @__PURE__ */ u("span", {
136
136
  className: "text-text-secondary",
137
137
  children: r(e.issuedAt)
138
138
  })
@@ -142,7 +142,7 @@ var S = 8, Ce = (e) => {
142
142
  header: "Expires",
143
143
  hideOnMobile: !0,
144
144
  sortValue: (e) => e.expiresAt ?? "",
145
- render: (e) => /* @__PURE__ */ f("span", {
145
+ render: (e) => /* @__PURE__ */ u("span", {
146
146
  className: "text-text-tertiary",
147
147
  children: r(e.expiresAt)
148
148
  })
@@ -153,7 +153,7 @@ var S = 8, Ce = (e) => {
153
153
  align: "right",
154
154
  hideOnMobile: !0,
155
155
  sortValue: (e) => e.finalScore ?? -1,
156
- render: (e) => /* @__PURE__ */ f("span", {
156
+ render: (e) => /* @__PURE__ */ u("span", {
157
157
  className: "font-medium tabular-nums text-text-primary",
158
158
  children: e.finalScore == null ? "—" : ee(e.finalScore)
159
159
  })
@@ -162,7 +162,7 @@ var S = 8, Ce = (e) => {
162
162
  key: "file",
163
163
  header: "PDF",
164
164
  hideOnMobile: !0,
165
- render: (e) => e.file ? /* @__PURE__ */ f(de, { fileId: e.file.id }) : /* @__PURE__ */ f("span", {
165
+ render: (e) => e.file ? /* @__PURE__ */ u(me, { fileId: e.file.id }) : /* @__PURE__ */ u("span", {
166
166
  className: "text-text-tertiary",
167
167
  children: "—"
168
168
  })
@@ -171,133 +171,133 @@ var S = 8, Ce = (e) => {
171
171
  key: "actions",
172
172
  header: "",
173
173
  align: "right",
174
- render: (e) => e.status === "ISSUED" ? /* @__PURE__ */ f(o, {
174
+ render: (e) => e.status === "ISSUED" ? /* @__PURE__ */ u(i, {
175
175
  resource: "buildmyiq-certificate",
176
176
  action: "update",
177
177
  deniedBehavior: "hide",
178
- children: /* @__PURE__ */ p(m, {
178
+ children: /* @__PURE__ */ d(f, {
179
179
  variant: "ghost",
180
180
  size: "sm",
181
181
  className: "text-status-error-text hover:text-status-error-text",
182
- disabled: F === e.id,
183
- onClick: () => void Me(e),
184
- children: [/* @__PURE__ */ f(u, { className: "mr-1.5 h-4 w-4" }), F === e.id ? "Revoking…" : "Revoke"]
182
+ disabled: N === e.id,
183
+ onClick: () => void Le(e),
184
+ children: [/* @__PURE__ */ u(c, { className: "mr-1.5 h-4 w-4" }), N === e.id ? "Revoking…" : "Revoke"]
185
185
  })
186
186
  }) : null
187
187
  }
188
188
  ], X = () => {
189
- z(L()), M(null), A(!0);
189
+ L(F()), A(null), O(!0);
190
190
  }, Z = () => {
191
- A(!1), z(L()), M(null);
192
- }, Pe = async () => {
193
- if (!R.courseId) {
194
- M("Please choose a course for this certificate.");
191
+ O(!1), L(F()), A(null);
192
+ }, Re = async () => {
193
+ if (!I.courseId) {
194
+ A("Please choose a course for this certificate.");
195
195
  return;
196
196
  }
197
- if (!R.learnerId.trim()) {
198
- M("A learner (user ID) is required.");
197
+ if (!I.learnerId.trim()) {
198
+ A("A learner (user ID) is required.");
199
199
  return;
200
200
  }
201
- if (!R.serial.trim()) {
202
- M("A certificate serial is required.");
201
+ if (!I.serial.trim()) {
202
+ A("A certificate serial is required.");
203
203
  return;
204
204
  }
205
- let e = R.finalScore.trim() ? Number(R.finalScore) : void 0;
205
+ let e = I.finalScore.trim() ? Number(I.finalScore) : void 0;
206
206
  if (e !== void 0 && (!Number.isFinite(e) || e < 0)) {
207
- M("Final score must be a non-negative number.");
207
+ A("Final score must be a non-negative number.");
208
208
  return;
209
209
  }
210
- let t = Ce(R.expiresAt);
211
- M(null);
210
+ let t = Ee(I.expiresAt);
211
+ A(null);
212
212
  try {
213
- await W.mutateAsync({
214
- courseId: R.courseId,
215
- learnerId: R.learnerId.trim(),
216
- serial: R.serial.trim(),
213
+ await U.mutateAsync({
214
+ courseId: I.courseId,
215
+ learnerId: I.learnerId.trim(),
216
+ serial: I.serial.trim(),
217
217
  finalScore: e,
218
218
  expiresAt: t
219
219
  }), Z();
220
220
  } catch (e) {
221
- M(e instanceof Error ? e.message : "Failed to issue certificate.");
221
+ A(e instanceof Error ? e.message : "Failed to issue certificate.");
222
222
  }
223
- }, Q = V.length > 0, $ = T === "MINE" || E !== "ALL" || O.trim().length > 0, Fe = !U.isLoading && !U.isError && q.total > 0;
224
- return /* @__PURE__ */ p(t, {
223
+ }, Q = z.length > 0, $ = C === "MINE" || w !== "ALL" || E.trim().length > 0, ze = !H.isLoading && !H.isError && K.total > 0;
224
+ return /* @__PURE__ */ d(t, {
225
225
  title: "Certificates",
226
226
  description: "Verifiable credentials issued to learners on course completion.",
227
227
  titleGradient: !0,
228
228
  aurora: !0,
229
- actions: /* @__PURE__ */ f(o, {
229
+ actions: /* @__PURE__ */ u(i, {
230
230
  resource: "buildmyiq-certificate",
231
231
  action: "create",
232
232
  deniedBehavior: "hide",
233
- children: /* @__PURE__ */ p(m, {
233
+ children: /* @__PURE__ */ d(f, {
234
234
  onClick: X,
235
235
  disabled: !Q,
236
- children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " Issue certificate"]
236
+ children: [/* @__PURE__ */ u(l, { className: "mr-1.5 h-4 w-4" }), " Issue certificate"]
237
237
  })
238
238
  }),
239
239
  children: [
240
- Fe && /* @__PURE__ */ p("div", {
240
+ ze && /* @__PURE__ */ d("div", {
241
241
  className: "mb-5 grid grid-cols-2 gap-4 sm:grid-cols-4",
242
242
  children: [
243
- /* @__PURE__ */ f(n, {
244
- icon: /* @__PURE__ */ f(l, { className: "h-5 w-5" }),
245
- value: q.total,
243
+ /* @__PURE__ */ u(n, {
244
+ icon: /* @__PURE__ */ u(s, { className: "h-5 w-5" }),
245
+ value: K.total,
246
246
  label: "Certificates",
247
247
  featured: !0
248
248
  }),
249
- /* @__PURE__ */ f(n, {
250
- icon: /* @__PURE__ */ f(he, { className: "h-5 w-5" }),
251
- value: q.issued,
249
+ /* @__PURE__ */ u(n, {
250
+ icon: /* @__PURE__ */ u(ve, { className: "h-5 w-5" }),
251
+ value: K.issued,
252
252
  label: "Issued",
253
253
  accent: "success"
254
254
  }),
255
- /* @__PURE__ */ f(n, {
256
- icon: /* @__PURE__ */ f(fe, { className: "h-5 w-5" }),
257
- value: q.expired,
255
+ /* @__PURE__ */ u(n, {
256
+ icon: /* @__PURE__ */ u(he, { className: "h-5 w-5" }),
257
+ value: K.expired,
258
258
  label: "Expired"
259
259
  }),
260
- /* @__PURE__ */ f(n, {
261
- icon: /* @__PURE__ */ f(u, { className: "h-5 w-5" }),
262
- value: q.revoked,
260
+ /* @__PURE__ */ u(n, {
261
+ icon: /* @__PURE__ */ u(c, { className: "h-5 w-5" }),
262
+ value: K.revoked,
263
263
  label: "Revoked",
264
264
  accent: "error"
265
265
  })
266
266
  ]
267
267
  }),
268
- /* @__PURE__ */ p("div", {
268
+ /* @__PURE__ */ d("div", {
269
269
  className: "mb-5 flex flex-wrap items-center gap-3",
270
270
  children: [
271
- /* @__PURE__ */ f(ae, {
272
- options: je,
273
- value: T,
271
+ /* @__PURE__ */ u(oe, {
272
+ options: Ie,
273
+ value: C,
274
274
  onChange: (e) => {
275
- Te(e), k(0);
275
+ Oe(e), D(0);
276
276
  }
277
277
  }),
278
- /* @__PURE__ */ p(_, {
279
- value: E,
278
+ /* @__PURE__ */ d(h, {
279
+ value: w,
280
280
  onValueChange: (e) => {
281
- D(e), k(0);
281
+ T(e), D(0);
282
282
  },
283
- children: [/* @__PURE__ */ f(b, {
283
+ children: [/* @__PURE__ */ u(v, {
284
284
  className: "w-56",
285
285
  "aria-label": "Filter by course",
286
- children: /* @__PURE__ */ f(x, { placeholder: "All courses" })
287
- }), /* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f(y, {
286
+ children: /* @__PURE__ */ u(y, { placeholder: "All courses" })
287
+ }), /* @__PURE__ */ d(g, { children: [/* @__PURE__ */ u(_, {
288
288
  value: "ALL",
289
289
  children: "All courses"
290
- }), V.map((e) => /* @__PURE__ */ f(y, {
290
+ }), z.map((e) => /* @__PURE__ */ u(_, {
291
291
  value: e.id,
292
292
  children: e.title
293
293
  }, e.id))] })]
294
294
  }),
295
- /* @__PURE__ */ p("div", {
295
+ /* @__PURE__ */ d("div", {
296
296
  className: "relative w-full sm:ml-auto sm:w-64",
297
- children: [/* @__PURE__ */ f(me, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ f(h, {
298
- value: O,
297
+ children: [/* @__PURE__ */ u(_e, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-text-tertiary" }), /* @__PURE__ */ u(p, {
298
+ value: E,
299
299
  onChange: (e) => {
300
- Ee(e.target.value), k(0);
300
+ ke(e.target.value), D(0);
301
301
  },
302
302
  placeholder: "Search certificates…",
303
303
  "aria-label": "Search certificates",
@@ -306,154 +306,154 @@ var S = 8, Ce = (e) => {
306
306
  })
307
307
  ]
308
308
  }),
309
- N && /* @__PURE__ */ f("p", {
309
+ j && /* @__PURE__ */ u("p", {
310
310
  className: "mb-4 rounded-lg bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
311
- children: N
311
+ children: j
312
312
  }),
313
- U.isLoading ? /* @__PURE__ */ f(re, { label: "Loading certificates…" }) : U.isError ? /* @__PURE__ */ f(ne, {
313
+ H.isLoading ? /* @__PURE__ */ u(ie, { label: "Loading certificates…" }) : H.isError ? /* @__PURE__ */ u(re, {
314
314
  message: "Couldn't load certificates.",
315
- onRetry: () => U.refetch()
316
- }) : K.length === 0 ? /* @__PURE__ */ f(i, {
315
+ onRetry: () => H.refetch()
316
+ }) : G.length === 0 ? /* @__PURE__ */ u(ne, {
317
317
  illustration: $ ? "empty-search" : "onboarding",
318
- icon: /* @__PURE__ */ f(l, { className: "h-10 w-10" }),
318
+ icon: /* @__PURE__ */ u(s, { className: "h-10 w-10" }),
319
319
  title: $ ? "No certificates match these filters" : "No certificates issued yet",
320
- description: $ ? O.trim().length > 0 ? "No credentials match your search. Try a different serial, course, or learner." : T === "MINE" ? "You haven't earned a certificate for this selection yet." : "No certificates have been issued for this course yet." : Q ? "Issue a certificate to credential a learner who has completed a course." : "Publish a course first, then issue certificates to learners who complete it.",
321
- action: !$ && Q ? /* @__PURE__ */ f(o, {
320
+ description: $ ? E.trim().length > 0 ? "No credentials match your search. Try a different serial, course, or learner." : C === "MINE" ? "You haven't earned a certificate for this selection yet." : "No certificates have been issued for this course yet." : Q ? "Issue a certificate to credential a learner who has completed a course." : "Publish a course first, then issue certificates to learners who complete it.",
321
+ action: !$ && Q ? /* @__PURE__ */ u(i, {
322
322
  resource: "buildmyiq-certificate",
323
323
  action: "create",
324
324
  deniedBehavior: "hide",
325
- children: /* @__PURE__ */ p(m, {
325
+ children: /* @__PURE__ */ d(f, {
326
326
  onClick: X,
327
- children: [/* @__PURE__ */ f(d, { className: "mr-1.5 h-4 w-4" }), " Issue certificate"]
327
+ children: [/* @__PURE__ */ u(l, { className: "mr-1.5 h-4 w-4" }), " Issue certificate"]
328
328
  })
329
329
  }) : void 0
330
- }) : /* @__PURE__ */ p(ge, { children: [/* @__PURE__ */ f(ie, {
331
- columns: Ne,
332
- rows: Y,
330
+ }) : /* @__PURE__ */ d(ye, { children: [/* @__PURE__ */ u(ae, {
331
+ columns: Y,
332
+ rows: J,
333
333
  rowKey: (e) => e.id,
334
334
  defaultSort: {
335
335
  key: "issuedAt",
336
336
  dir: "desc"
337
337
  }
338
- }), /* @__PURE__ */ f(oe, {
339
- page: J,
340
- pageSize: S,
341
- itemCount: Y.length,
342
- hasMore: (J + 1) * S < K.length,
343
- onPageChange: k
338
+ }), /* @__PURE__ */ u(se, {
339
+ page: q,
340
+ pageSize: b,
341
+ itemCount: J.length,
342
+ hasMore: (q + 1) * b < G.length,
343
+ onPageChange: D
344
344
  })] }),
345
- /* @__PURE__ */ f(_e, {
346
- open: Oe,
345
+ /* @__PURE__ */ u(be, {
346
+ open: je,
347
347
  onOpenChange: (e) => {
348
- e ? A(!0) : Z();
348
+ e ? O(!0) : Z();
349
349
  },
350
- children: /* @__PURE__ */ p(ve, { children: [/* @__PURE__ */ p(xe, { children: [/* @__PURE__ */ f(Se, { children: "Issue certificate" }), /* @__PURE__ */ f(ye, { children: "Credential a learner for completing a course. The serial is auto-generated but editable." })] }), /* @__PURE__ */ p("form", {
350
+ children: /* @__PURE__ */ d(xe, { children: [/* @__PURE__ */ d(we, { children: [/* @__PURE__ */ u(Te, { children: "Issue certificate" }), /* @__PURE__ */ u(Se, { children: "Credential a learner for completing a course. The serial is auto-generated but editable." })] }), /* @__PURE__ */ d("form", {
351
351
  onSubmit: (e) => {
352
- e.preventDefault(), Pe();
352
+ e.preventDefault(), Re();
353
353
  },
354
- children: [/* @__PURE__ */ p("div", {
354
+ children: [/* @__PURE__ */ d("div", {
355
355
  className: "grid gap-4 py-2",
356
356
  children: [
357
- /* @__PURE__ */ p("div", {
357
+ /* @__PURE__ */ d("div", {
358
358
  className: "grid gap-1.5",
359
- children: [/* @__PURE__ */ f(g, {
359
+ children: [/* @__PURE__ */ u(m, {
360
360
  htmlFor: "cert-course",
361
361
  children: "Course *"
362
- }), /* @__PURE__ */ p(_, {
363
- value: R.courseId,
364
- onValueChange: (e) => z((t) => ({
362
+ }), /* @__PURE__ */ d(h, {
363
+ value: I.courseId,
364
+ onValueChange: (e) => L((t) => ({
365
365
  ...t,
366
366
  courseId: e
367
367
  })),
368
- children: [/* @__PURE__ */ f(b, {
368
+ children: [/* @__PURE__ */ u(v, {
369
369
  id: "cert-course",
370
370
  className: "data-[placeholder]:text-text-secondary!",
371
- children: /* @__PURE__ */ f(x, { placeholder: "Select a course" })
372
- }), /* @__PURE__ */ f(v, { children: V.map((e) => /* @__PURE__ */ f(y, {
371
+ children: /* @__PURE__ */ u(y, { placeholder: "Select a course" })
372
+ }), /* @__PURE__ */ u(g, { children: z.map((e) => /* @__PURE__ */ u(_, {
373
373
  value: e.id,
374
374
  children: e.title
375
375
  }, e.id)) })]
376
376
  })]
377
377
  }),
378
- /* @__PURE__ */ p("div", {
378
+ /* @__PURE__ */ d("div", {
379
379
  className: "grid gap-1.5",
380
- children: [/* @__PURE__ */ f(g, {
380
+ children: [/* @__PURE__ */ u(m, {
381
381
  htmlFor: "cert-learner",
382
382
  children: "Learner (user ID) *"
383
- }), /* @__PURE__ */ f(h, {
383
+ }), /* @__PURE__ */ u(p, {
384
384
  id: "cert-learner",
385
- value: R.learnerId,
386
- onChange: (e) => z((t) => ({
385
+ value: I.learnerId,
386
+ onChange: (e) => L((t) => ({
387
387
  ...t,
388
388
  learnerId: e.target.value
389
389
  })),
390
390
  placeholder: "Defaults to you"
391
391
  })]
392
392
  }),
393
- /* @__PURE__ */ p("div", {
393
+ /* @__PURE__ */ d("div", {
394
394
  className: "grid gap-1.5",
395
- children: [/* @__PURE__ */ f(g, {
395
+ children: [/* @__PURE__ */ u(m, {
396
396
  htmlFor: "cert-serial",
397
397
  children: "Serial *"
398
- }), /* @__PURE__ */ f(h, {
398
+ }), /* @__PURE__ */ u(p, {
399
399
  id: "cert-serial",
400
- value: R.serial,
401
- onChange: (e) => z((t) => ({
400
+ value: I.serial,
401
+ onChange: (e) => L((t) => ({
402
402
  ...t,
403
403
  serial: e.target.value
404
404
  })),
405
405
  placeholder: "BMIQ-XXXXXX"
406
406
  })]
407
407
  }),
408
- /* @__PURE__ */ p("div", {
408
+ /* @__PURE__ */ d("div", {
409
409
  className: "grid gap-2 sm:grid-cols-2",
410
- children: [/* @__PURE__ */ p("div", {
410
+ children: [/* @__PURE__ */ d("div", {
411
411
  className: "grid gap-1.5",
412
- children: [/* @__PURE__ */ f(g, {
412
+ children: [/* @__PURE__ */ u(m, {
413
413
  htmlFor: "cert-score",
414
414
  children: "Final score"
415
- }), /* @__PURE__ */ f(h, {
415
+ }), /* @__PURE__ */ u(p, {
416
416
  id: "cert-score",
417
417
  type: "number",
418
418
  min: "0",
419
419
  step: "0.1",
420
- value: R.finalScore,
421
- onChange: (e) => z((t) => ({
420
+ value: I.finalScore,
421
+ onChange: (e) => L((t) => ({
422
422
  ...t,
423
423
  finalScore: e.target.value
424
424
  })),
425
425
  placeholder: "e.g. 92"
426
426
  })]
427
- }), /* @__PURE__ */ p("div", {
427
+ }), /* @__PURE__ */ d("div", {
428
428
  className: "grid gap-1.5",
429
- children: [/* @__PURE__ */ f(g, {
429
+ children: [/* @__PURE__ */ u(m, {
430
430
  htmlFor: "cert-expires",
431
431
  children: "Expires"
432
- }), /* @__PURE__ */ f(h, {
432
+ }), /* @__PURE__ */ u(p, {
433
433
  id: "cert-expires",
434
434
  type: "date",
435
- value: R.expiresAt,
436
- onChange: (e) => z((t) => ({
435
+ value: I.expiresAt,
436
+ onChange: (e) => L((t) => ({
437
437
  ...t,
438
438
  expiresAt: e.target.value
439
439
  }))
440
440
  })]
441
441
  })]
442
442
  }),
443
- j && /* @__PURE__ */ f("p", {
443
+ k && /* @__PURE__ */ u("p", {
444
444
  className: "text-sm text-status-error-text",
445
- children: j
445
+ children: k
446
446
  })
447
447
  ]
448
- }), /* @__PURE__ */ p(be, { children: [/* @__PURE__ */ f(m, {
448
+ }), /* @__PURE__ */ d(Ce, { children: [/* @__PURE__ */ u(f, {
449
449
  type: "button",
450
450
  variant: "outline",
451
451
  onClick: Z,
452
452
  children: "Cancel"
453
- }), /* @__PURE__ */ p(m, {
453
+ }), /* @__PURE__ */ d(f, {
454
454
  type: "submit",
455
- disabled: W.isPending,
456
- children: [/* @__PURE__ */ f(pe, { className: "mr-1.5 h-4 w-4" }), W.isPending ? "Issuing…" : "Issue certificate"]
455
+ disabled: U.isPending,
456
+ children: [/* @__PURE__ */ u(ge, { className: "mr-1.5 h-4 w-4" }), U.isPending ? "Issuing…" : "Issue certificate"]
457
457
  })] })]
458
458
  })] })
459
459
  })
@@ -461,6 +461,6 @@ var S = 8, Ce = (e) => {
461
461
  });
462
462
  };
463
463
  //#endregion
464
- export { C as CertificatesPage };
464
+ export { x as CertificatesPage };
465
465
 
466
466
  //# sourceMappingURL=CertificatesPage.js.map