@local-civics/mgmt-ui 0.1.186 → 0.1.188

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -34,35 +34,35 @@ function _interopNamespaceDefault(e) {
34
34
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
35
35
  var papa__namespace = /*#__PURE__*/_interopNamespaceDefault(papa);
36
36
 
37
- var __defProp$9 = Object.defineProperty;
38
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
39
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
40
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
41
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
42
- var __spreadValues$9 = (a, b) => {
37
+ var __defProp$a = Object.defineProperty;
38
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
39
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
40
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
41
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
42
+ var __spreadValues$a = (a, b) => {
43
43
  for (var prop in b || (b = {}))
44
- if (__hasOwnProp$9.call(b, prop))
45
- __defNormalProp$9(a, prop, b[prop]);
46
- if (__getOwnPropSymbols$9)
47
- for (var prop of __getOwnPropSymbols$9(b)) {
48
- if (__propIsEnum$9.call(b, prop))
49
- __defNormalProp$9(a, prop, b[prop]);
44
+ if (__hasOwnProp$a.call(b, prop))
45
+ __defNormalProp$a(a, prop, b[prop]);
46
+ if (__getOwnPropSymbols$a)
47
+ for (var prop of __getOwnPropSymbols$a(b)) {
48
+ if (__propIsEnum$a.call(b, prop))
49
+ __defNormalProp$a(a, prop, b[prop]);
50
50
  }
51
51
  return a;
52
52
  };
53
53
  var __objRest$2 = (source, exclude) => {
54
54
  var target = {};
55
55
  for (var prop in source)
56
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
56
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
57
57
  target[prop] = source[prop];
58
- if (source != null && __getOwnPropSymbols$9)
59
- for (var prop of __getOwnPropSymbols$9(source)) {
60
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
58
+ if (source != null && __getOwnPropSymbols$a)
59
+ for (var prop of __getOwnPropSymbols$a(source)) {
60
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
61
61
  target[prop] = source[prop];
62
62
  }
63
63
  return target;
64
64
  };
65
- const useStyles$u = core.createStyles((theme) => ({
65
+ const useStyles$w = core.createStyles((theme) => ({
66
66
  user: {
67
67
  display: "block",
68
68
  width: "100%",
@@ -73,8 +73,8 @@ const useStyles$u = core.createStyles((theme) => ({
73
73
  }));
74
74
  function UserButton(_a) {
75
75
  var _b = _a, { image, name, email, icon } = _b, others = __objRest$2(_b, ["image", "name", "email", "icon"]);
76
- const { classes } = useStyles$u();
77
- return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$9({ className: classes.user }, others), /* @__PURE__ */ React__namespace.createElement(core.Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React__namespace.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs" }, email)));
76
+ const { classes } = useStyles$w();
77
+ return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$a({ className: classes.user }, others), /* @__PURE__ */ React__namespace.createElement(core.Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React__namespace.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "xs" }, email)));
78
78
  }
79
79
 
80
80
  const compact = (num) => {
@@ -84,7 +84,7 @@ const compact = (num) => {
84
84
  }).format(num || 0);
85
85
  };
86
86
 
87
- const useStyles$t = core.createStyles((theme, _params, getRef) => {
87
+ const useStyles$v = core.createStyles((theme, _params, getRef) => {
88
88
  const icon = getRef("icon");
89
89
  return {
90
90
  control: {
@@ -137,7 +137,7 @@ const useStyles$t = core.createStyles((theme, _params, getRef) => {
137
137
  };
138
138
  });
139
139
  function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, notifications }) {
140
- const { classes, theme, cx } = useStyles$t();
140
+ const { classes, theme, cx } = useStyles$v();
141
141
  const hasLinks = Array.isArray(links) && links.length > 0;
142
142
  const hasActiveLinks = Array.isArray(links) && links.map((l) => !!active && active === `${label}/${l.label}`).reduce((a, b) => a || b, false);
143
143
  const [opened, setOpened] = React.useState(initiallyOpened || hasActiveLinks || false);
@@ -182,26 +182,26 @@ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, n
182
182
  ), hasLinks ? /* @__PURE__ */ React__namespace.createElement(core.Collapse, { in: opened }, items) : null);
183
183
  }
184
184
 
185
- var __defProp$8 = Object.defineProperty;
186
- var __defProps$5 = Object.defineProperties;
187
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
188
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
189
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
190
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
191
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
192
- var __spreadValues$8 = (a, b) => {
185
+ var __defProp$9 = Object.defineProperty;
186
+ var __defProps$6 = Object.defineProperties;
187
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
188
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
189
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
190
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
191
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
192
+ var __spreadValues$9 = (a, b) => {
193
193
  for (var prop in b || (b = {}))
194
- if (__hasOwnProp$8.call(b, prop))
195
- __defNormalProp$8(a, prop, b[prop]);
196
- if (__getOwnPropSymbols$8)
197
- for (var prop of __getOwnPropSymbols$8(b)) {
198
- if (__propIsEnum$8.call(b, prop))
199
- __defNormalProp$8(a, prop, b[prop]);
194
+ if (__hasOwnProp$9.call(b, prop))
195
+ __defNormalProp$9(a, prop, b[prop]);
196
+ if (__getOwnPropSymbols$9)
197
+ for (var prop of __getOwnPropSymbols$9(b)) {
198
+ if (__propIsEnum$9.call(b, prop))
199
+ __defNormalProp$9(a, prop, b[prop]);
200
200
  }
201
201
  return a;
202
202
  };
203
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
204
- const useStyles$s = core.createStyles((theme, _params, getRef) => {
203
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
204
+ const useStyles$u = core.createStyles((theme, _params, getRef) => {
205
205
  const icon = getRef("icon");
206
206
  return {
207
207
  navbar: {
@@ -232,7 +232,7 @@ const useStyles$s = core.createStyles((theme, _params, getRef) => {
232
232
  color: theme.colorScheme === "dark" ? theme.white : theme.black,
233
233
  borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
234
234
  },
235
- link: __spreadProps$5(__spreadValues$8({}, theme.fn.focusStyles()), {
235
+ link: __spreadProps$6(__spreadValues$9({}, theme.fn.focusStyles()), {
236
236
  display: "flex",
237
237
  alignItems: "center",
238
238
  textDecoration: "none",
@@ -301,7 +301,7 @@ const TRIAL_PAGES = [
301
301
  "Badges"
302
302
  ];
303
303
  function Navbar(props) {
304
- const { classes, cx } = useStyles$s();
304
+ const { classes, cx } = useStyles$u();
305
305
  const [burgerOpen, setBurgerOpen] = React__namespace.useState(false);
306
306
  const toggle = () => setBurgerOpen(!burgerOpen);
307
307
  const links = data.map((item) => {
@@ -314,12 +314,12 @@ function Navbar(props) {
314
314
  }
315
315
  return /* @__PURE__ */ React__namespace.createElement(
316
316
  LinksGroup,
317
- __spreadProps$5(__spreadValues$8(__spreadValues$8({
317
+ __spreadProps$6(__spreadValues$9(__spreadValues$9({
318
318
  key: item.label,
319
319
  active: props.active
320
320
  }, item), context), {
321
321
  links: (item.links || []).map((link) => {
322
- return __spreadValues$8(__spreadValues$8({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
322
+ return __spreadValues$9(__spreadValues$9({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
323
323
  })
324
324
  })
325
325
  );
@@ -344,7 +344,7 @@ function Navbar(props) {
344
344
  } }, /* @__PURE__ */ React__namespace.createElement(icons.IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Logout"))))));
345
345
  }
346
346
 
347
- const useStyles$r = core.createStyles((theme) => ({
347
+ const useStyles$t = core.createStyles((theme) => ({
348
348
  inner: {
349
349
  paddingTop: theme.spacing.xl,
350
350
  paddingBottom: theme.spacing.xl * 4
@@ -380,7 +380,7 @@ const useStyles$r = core.createStyles((theme) => ({
380
380
  }
381
381
  }));
382
382
  const GettingStarted = (props) => {
383
- const { classes } = useStyles$r();
383
+ const { classes } = useStyles$t();
384
384
  return /* @__PURE__ */ React__namespace.createElement(
385
385
  core.Modal,
386
386
  {
@@ -394,7 +394,7 @@ const GettingStarted = (props) => {
394
394
  );
395
395
  };
396
396
 
397
- const useStyles$q = core.createStyles((theme) => ({
397
+ const useStyles$s = core.createStyles((theme) => ({
398
398
  title: {
399
399
  fontSize: 34,
400
400
  fontWeight: 900,
@@ -435,7 +435,7 @@ const useStyles$q = core.createStyles((theme) => ({
435
435
  }
436
436
  }));
437
437
  const SwitchAccount = (props) => {
438
- const { classes, theme } = useStyles$q();
438
+ const { classes, theme } = useStyles$s();
439
439
  const options = props.accounts.map((a) => {
440
440
  return /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: () => props.onClick && props.onClick(a.accountId), key: a.accountId, p: theme.spacing.md }, /* @__PURE__ */ React__namespace.createElement(core.Card, { withBorder: true, shadow: "md", radius: "md", className: classes.card, p: "xl" }, a.isAdmin && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(icons.IconBatteryEco, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), a.isGroupAdmin && !a.isAdmin && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(icons.IconBooks, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), !a.isAdmin && !a.isGroupAdmin && /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(icons.IconBackpack, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "lg", weight: 500, className: classes.cardTitle, mt: "md" }, a.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", color: "dimmed", mt: "sm" }, a.isAdmin ? "Admin" : a.isGroupAdmin ? "Educator" : "Student")));
441
441
  });
@@ -452,7 +452,7 @@ const SwitchAccount = (props) => {
452
452
  );
453
453
  };
454
454
 
455
- const useStyles$p = core.createStyles((theme) => ({
455
+ const useStyles$r = core.createStyles((theme) => ({
456
456
  root: {
457
457
  display: "flex",
458
458
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -496,7 +496,7 @@ const useStyles$p = core.createStyles((theme) => ({
496
496
  }
497
497
  }));
498
498
  const StatsGroup = ({ data, footer }) => {
499
- const { classes } = useStyles$p();
499
+ const { classes } = useStyles$r();
500
500
  const stats = data.map((stat) => {
501
501
  const value = (() => {
502
502
  if (stat.unit === "%") {
@@ -516,7 +516,7 @@ const Tabs = (props) => {
516
516
  return /* @__PURE__ */ React__namespace.createElement(core.Tabs, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React__namespace.createElement(core.Tabs.List, null, tabs));
517
517
  };
518
518
 
519
- const useStyles$o = core.createStyles((theme) => ({
519
+ const useStyles$q = core.createStyles((theme) => ({
520
520
  button: {
521
521
  borderTopRightRadius: 0,
522
522
  borderBottomRightRadius: 0,
@@ -531,7 +531,7 @@ const useStyles$o = core.createStyles((theme) => ({
531
531
  }
532
532
  }));
533
533
  const SplitButton$4 = (props) => {
534
- const { classes, theme } = useStyles$o();
534
+ const { classes, theme } = useStyles$q();
535
535
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
536
536
  return /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
537
537
  core.Button,
@@ -559,7 +559,7 @@ const SplitButton$4 = (props) => {
559
559
  ));
560
560
  };
561
561
 
562
- const useStyles$n = core.createStyles((theme) => ({
562
+ const useStyles$p = core.createStyles((theme) => ({
563
563
  wrapper: {
564
564
  display: "flex",
565
565
  alignItems: "center",
@@ -610,7 +610,7 @@ const useStyles$n = core.createStyles((theme) => ({
610
610
  }
611
611
  }));
612
612
  const PlaceholderBanner = (props) => {
613
- const { classes } = useStyles$n();
613
+ const { classes } = useStyles$p();
614
614
  const title = props.title || "Nothing to display";
615
615
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
616
616
  return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.body }, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.loading ? "Loading..." : title), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", color: "dimmed" }, props.loading ? "Hold on, we're loading your data." : description)), /* @__PURE__ */ React__namespace.createElement(core.Image, { src: `https://cdn.localcivics.io/illustrations/${props.icon}.svg`, className: classes.image }));
@@ -682,7 +682,7 @@ function Table$i(props) {
682
682
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lesson Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
683
683
  }
684
684
 
685
- const useStyles$m = core.createStyles((theme) => ({
685
+ const useStyles$o = core.createStyles((theme) => ({
686
686
  title: {
687
687
  fontSize: 34,
688
688
  fontWeight: 900,
@@ -695,7 +695,7 @@ const useStyles$m = core.createStyles((theme) => ({
695
695
  }
696
696
  }));
697
697
  const Badge = (props) => {
698
- const { classes } = useStyles$m();
698
+ const { classes } = useStyles$o();
699
699
  const [tab, setTab] = React.useState("lessons");
700
700
  const numberOfStudents = props.students.length;
701
701
  const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -793,7 +793,7 @@ function Table$h(props) {
793
793
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
794
794
  }
795
795
 
796
- const useStyles$l = core.createStyles((theme) => ({
796
+ const useStyles$n = core.createStyles((theme) => ({
797
797
  title: {
798
798
  fontSize: 34,
799
799
  fontWeight: 900,
@@ -806,7 +806,7 @@ const useStyles$l = core.createStyles((theme) => ({
806
806
  }
807
807
  }));
808
808
  const Badges = (props) => {
809
- const { classes } = useStyles$l();
809
+ const { classes } = useStyles$n();
810
810
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Badges"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Badges and micro-credentials"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Key milestones that reflect skill development, micro-credentials, or academic progress"))), /* @__PURE__ */ React__namespace.createElement(
811
811
  core.Autocomplete,
812
812
  {
@@ -1036,7 +1036,63 @@ const SplitButton$3 = (props) => {
1036
1036
  ));
1037
1037
  };
1038
1038
 
1039
+ function useSortableData(items, config = { key: "", direction: null }) {
1040
+ const [sortConfig, setSortConfig] = React.useState(config);
1041
+ const sortedItems = React.useMemo(() => {
1042
+ let sortableItems = [...items];
1043
+ if (sortConfig.direction !== null) {
1044
+ sortableItems.sort((a, b) => {
1045
+ const aValue = a[sortConfig.key];
1046
+ const bValue = b[sortConfig.key];
1047
+ if (aValue === bValue)
1048
+ return 0;
1049
+ if (aValue === null || aValue === void 0)
1050
+ return 1;
1051
+ if (bValue === null || bValue === void 0)
1052
+ return -1;
1053
+ if (typeof aValue === "number" && typeof bValue === "number") {
1054
+ return sortConfig.direction === "asc" ? aValue - bValue : bValue - aValue;
1055
+ }
1056
+ if (typeof aValue === "boolean" && typeof bValue === "boolean") {
1057
+ return sortConfig.direction === "asc" ? aValue === bValue ? 0 : aValue ? 1 : -1 : aValue === bValue ? 0 : aValue ? -1 : 1;
1058
+ }
1059
+ if (aValue instanceof Date && bValue instanceof Date) {
1060
+ return sortConfig.direction === "asc" ? aValue.getTime() - bValue.getTime() : bValue.getTime() - aValue.getTime();
1061
+ }
1062
+ return sortConfig.direction === "asc" ? String(aValue).localeCompare(String(bValue)) : String(bValue).localeCompare(String(aValue));
1063
+ });
1064
+ }
1065
+ return sortableItems;
1066
+ }, [items, sortConfig]);
1067
+ const requestSort = (key) => {
1068
+ let direction = "asc";
1069
+ if (sortConfig.key === key && sortConfig.direction === "asc") {
1070
+ direction = "desc";
1071
+ } else if (sortConfig.key === key && sortConfig.direction === "desc") {
1072
+ direction = null;
1073
+ }
1074
+ setSortConfig({ key, direction });
1075
+ };
1076
+ return { items: sortedItems, requestSort, sortConfig };
1077
+ }
1078
+
1079
+ const useStyles$m = core.createStyles((theme) => ({
1080
+ th: { padding: "0 !important" },
1081
+ control: {
1082
+ width: "100%",
1083
+ padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
1084
+ "&:hover": {
1085
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
1086
+ }
1087
+ }
1088
+ }));
1089
+ function Th$2({ children, reversed, sorted, onSort }) {
1090
+ const { classes } = useStyles$m();
1091
+ const Icon = sorted ? reversed ? icons.IconChevronUp : icons.IconChevronDown : icons.IconSelector;
1092
+ return /* @__PURE__ */ React__namespace.createElement("th", { className: classes.th }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 14, stroke: 1.5 })))));
1093
+ }
1039
1094
  function Table$b(props) {
1095
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1040
1096
  if (props.items.length === 0) {
1041
1097
  return /* @__PURE__ */ React__namespace.createElement(
1042
1098
  PlaceholderBanner,
@@ -1065,29 +1121,77 @@ function Table$b(props) {
1065
1121
  data: [{ value: "student", label: "Student" }, { value: "educator", label: "Educator" }]
1066
1122
  }
1067
1123
  ))), /* @__PURE__ */ React__namespace.createElement("td", null, row.badgesEarned), /* @__PURE__ */ React__namespace.createElement("td", null, row.lessonsCompleted), /* @__PURE__ */ React__namespace.createElement("td", null, row.hasAccount && /* @__PURE__ */ React__namespace.createElement(icons.IconCheck, { color: "green" })), /* @__PURE__ */ React__namespace.createElement("td", null, row.lastActivity ? relativeTimeFromDates(row.lastActivity) : ""), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, !row.readonly && !!props.onDelete && /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red" }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1068
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea, null, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Role"), /* @__PURE__ */ React__namespace.createElement("th", null, "Badges Earned"), /* @__PURE__ */ React__namespace.createElement("th", null, "Lessons Completed"), /* @__PURE__ */ React__namespace.createElement("th", null, "Account Created?"), /* @__PURE__ */ React__namespace.createElement("th", null, "Last Active"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1124
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea, null, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement(
1125
+ Th$2,
1126
+ {
1127
+ sorted: sortConfig.key === "givenName",
1128
+ reversed: sortConfig.direction === "desc",
1129
+ onSort: () => requestSort("givenName")
1130
+ },
1131
+ "Name"
1132
+ ), /* @__PURE__ */ React__namespace.createElement(
1133
+ Th$2,
1134
+ {
1135
+ sorted: sortConfig.key === "isAdmin",
1136
+ reversed: sortConfig.direction === "desc",
1137
+ onSort: () => requestSort("isAdmin")
1138
+ },
1139
+ "Role"
1140
+ ), /* @__PURE__ */ React__namespace.createElement(
1141
+ Th$2,
1142
+ {
1143
+ sorted: sortConfig.key === "badgesEarned",
1144
+ reversed: sortConfig.direction === "desc",
1145
+ onSort: () => requestSort("badgesEarned")
1146
+ },
1147
+ "Badges Earned"
1148
+ ), /* @__PURE__ */ React__namespace.createElement(
1149
+ Th$2,
1150
+ {
1151
+ sorted: sortConfig.key === "lessonsCompleted",
1152
+ reversed: sortConfig.direction === "desc",
1153
+ onSort: () => requestSort("lessonsCompleted")
1154
+ },
1155
+ "Lessons Completed"
1156
+ ), /* @__PURE__ */ React__namespace.createElement(
1157
+ Th$2,
1158
+ {
1159
+ sorted: sortConfig.key === "hasAccount",
1160
+ reversed: sortConfig.direction === "desc",
1161
+ onSort: () => requestSort("hasAccount")
1162
+ },
1163
+ "Account Created?"
1164
+ ), /* @__PURE__ */ React__namespace.createElement(
1165
+ Th$2,
1166
+ {
1167
+ sorted: sortConfig.key === "lastActivity",
1168
+ reversed: sortConfig.direction === "desc",
1169
+ onSort: () => requestSort("lastActivity")
1170
+ },
1171
+ "Last Active"
1172
+ ), /* @__PURE__ */ React__namespace.createElement("th", null), " ")), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1069
1173
  }
1070
1174
 
1071
- var __defProp$7 = Object.defineProperty;
1072
- var __defProps$4 = Object.defineProperties;
1073
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1074
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1075
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1076
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1077
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1078
- var __spreadValues$7 = (a, b) => {
1175
+ var __defProp$8 = Object.defineProperty;
1176
+ var __defProps$5 = Object.defineProperties;
1177
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1178
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1179
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1180
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1181
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1182
+ var __spreadValues$8 = (a, b) => {
1079
1183
  for (var prop in b || (b = {}))
1080
- if (__hasOwnProp$7.call(b, prop))
1081
- __defNormalProp$7(a, prop, b[prop]);
1082
- if (__getOwnPropSymbols$7)
1083
- for (var prop of __getOwnPropSymbols$7(b)) {
1084
- if (__propIsEnum$7.call(b, prop))
1085
- __defNormalProp$7(a, prop, b[prop]);
1184
+ if (__hasOwnProp$8.call(b, prop))
1185
+ __defNormalProp$8(a, prop, b[prop]);
1186
+ if (__getOwnPropSymbols$8)
1187
+ for (var prop of __getOwnPropSymbols$8(b)) {
1188
+ if (__propIsEnum$8.call(b, prop))
1189
+ __defNormalProp$8(a, prop, b[prop]);
1086
1190
  }
1087
1191
  return a;
1088
1192
  };
1089
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1090
- const useStyles$k = core.createStyles((theme) => ({
1193
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1194
+ const useStyles$l = core.createStyles((theme) => ({
1091
1195
  title: {
1092
1196
  fontSize: 34,
1093
1197
  fontWeight: 900,
@@ -1120,7 +1224,7 @@ const useStyles$k = core.createStyles((theme) => ({
1120
1224
  }
1121
1225
  }));
1122
1226
  const Class = (props) => {
1123
- const { classes } = useStyles$k();
1227
+ const { classes } = useStyles$l();
1124
1228
  const form$1 = form.useForm({
1125
1229
  initialValues: {
1126
1230
  classId: "",
@@ -1152,27 +1256,27 @@ const Class = (props) => {
1152
1256
  padding: "xl",
1153
1257
  size: "xl"
1154
1258
  },
1155
- /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$4(__spreadValues$7({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
1259
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$5(__spreadValues$8({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
1156
1260
  const values = form$1.values;
1157
1261
  form$1.reset();
1158
1262
  setOpened(false);
1159
1263
  props.onCreateMembers && props.onCreateMembers([values]);
1160
1264
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1161
1265
  core.TextInput,
1162
- __spreadValues$7({
1266
+ __spreadValues$8({
1163
1267
  withAsterisk: true,
1164
1268
  label: "Email",
1165
1269
  placeholder: "Email"
1166
1270
  }, form$1.getInputProps("email"))
1167
1271
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
1168
1272
  core.TextInput,
1169
- __spreadValues$7({
1273
+ __spreadValues$8({
1170
1274
  label: "Given name",
1171
1275
  placeholder: "Given name"
1172
1276
  }, form$1.getInputProps("givenName"))
1173
1277
  ), /* @__PURE__ */ React__namespace.createElement(
1174
1278
  core.TextInput,
1175
- __spreadValues$7({
1279
+ __spreadValues$8({
1176
1280
  label: "Family name",
1177
1281
  placeholder: "Family name"
1178
1282
  }, form$1.getInputProps("familyName"))
@@ -1221,7 +1325,7 @@ const Class = (props) => {
1221
1325
  ))))));
1222
1326
  };
1223
1327
  const DropzoneButton$1 = (props) => {
1224
- const { classes, theme } = useStyles$k();
1328
+ const { classes, theme } = useStyles$l();
1225
1329
  const openRef = React__namespace.useRef(null);
1226
1330
  const [loading, setLoading] = React__namespace.useState(false);
1227
1331
  const onDrop = React__namespace.useCallback((acceptedFiles) => {
@@ -1267,47 +1371,7 @@ const DropzoneButton$1 = (props) => {
1267
1371
  } }, "Select file"));
1268
1372
  };
1269
1373
 
1270
- function useSortableData(items, config = { key: "", direction: null }) {
1271
- const [sortConfig, setSortConfig] = React.useState(config);
1272
- const sortedItems = React.useMemo(() => {
1273
- let sortableItems = [...items];
1274
- if (sortConfig.direction !== null) {
1275
- sortableItems.sort((a, b) => {
1276
- const aValue = a[sortConfig.key];
1277
- const bValue = b[sortConfig.key];
1278
- if (aValue === bValue)
1279
- return 0;
1280
- if (aValue === null || aValue === void 0)
1281
- return 1;
1282
- if (bValue === null || bValue === void 0)
1283
- return -1;
1284
- if (typeof aValue === "number" && typeof bValue === "number") {
1285
- return sortConfig.direction === "asc" ? aValue - bValue : bValue - aValue;
1286
- }
1287
- if (typeof aValue === "boolean" && typeof bValue === "boolean") {
1288
- return sortConfig.direction === "asc" ? aValue === bValue ? 0 : aValue ? 1 : -1 : aValue === bValue ? 0 : aValue ? -1 : 1;
1289
- }
1290
- if (aValue instanceof Date && bValue instanceof Date) {
1291
- return sortConfig.direction === "asc" ? aValue.getTime() - bValue.getTime() : bValue.getTime() - aValue.getTime();
1292
- }
1293
- return sortConfig.direction === "asc" ? String(aValue).localeCompare(String(bValue)) : String(bValue).localeCompare(String(aValue));
1294
- });
1295
- }
1296
- return sortableItems;
1297
- }, [items, sortConfig]);
1298
- const requestSort = (key) => {
1299
- let direction = "asc";
1300
- if (sortConfig.key === key && sortConfig.direction === "asc") {
1301
- direction = "desc";
1302
- } else if (sortConfig.key === key && sortConfig.direction === "desc") {
1303
- direction = null;
1304
- }
1305
- setSortConfig({ key, direction });
1306
- };
1307
- return { items: sortedItems, requestSort, sortConfig };
1308
- }
1309
-
1310
- const useStyles$j = core.createStyles((theme) => ({
1374
+ const useStyles$k = core.createStyles((theme) => ({
1311
1375
  th: { padding: "0 !important" },
1312
1376
  control: {
1313
1377
  width: "100%",
@@ -1317,10 +1381,10 @@ const useStyles$j = core.createStyles((theme) => ({
1317
1381
  }
1318
1382
  }
1319
1383
  }));
1320
- function Th({ children, reversed, sorted, onSort }) {
1321
- const { classes } = useStyles$j();
1384
+ function Th$1({ children, reversed, sorted, onSort }) {
1385
+ const { classes } = useStyles$k();
1322
1386
  const Icon = sorted ? reversed ? icons.IconChevronUp : icons.IconChevronDown : icons.IconSelector;
1323
- return /* @__PURE__ */ React__namespace.createElement("th", { className: classes.th }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart" }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm" }, children), /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 14, stroke: 1.5 })))));
1387
+ return /* @__PURE__ */ React__namespace.createElement("th", { className: classes.th }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 14, stroke: 1.5 })))));
1324
1388
  }
1325
1389
  function Table$a(props) {
1326
1390
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
@@ -1345,23 +1409,15 @@ function Table$a(props) {
1345
1409
  });
1346
1410
  const rows = sortedItems.map((row) => /* @__PURE__ */ React__namespace.createElement("tr", { key: row.classId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: reactRouterDom.Link, to: row.href }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.name))), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.description)), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.numberOfStudents || 0)), /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red" }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1347
1411
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement(
1348
- Th,
1412
+ Th$1,
1349
1413
  {
1350
1414
  sorted: sortConfig.key === "name",
1351
1415
  reversed: sortConfig.direction === "desc",
1352
1416
  onSort: () => requestSort("name")
1353
1417
  },
1354
1418
  "Class Name"
1355
- ), /* @__PURE__ */ React__namespace.createElement(
1356
- Th,
1357
- {
1358
- sorted: sortConfig.key === "description",
1359
- reversed: sortConfig.direction === "desc",
1360
- onSort: () => requestSort("description")
1361
- },
1362
- "Description"
1363
- ), /* @__PURE__ */ React__namespace.createElement(
1364
- Th,
1419
+ ), /* @__PURE__ */ React__namespace.createElement("th", { style: { padding: "7px 16px" } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm" }, "Description")), /* @__PURE__ */ React__namespace.createElement(
1420
+ Th$1,
1365
1421
  {
1366
1422
  sorted: sortConfig.key === "numberOfStudents",
1367
1423
  reversed: sortConfig.direction === "desc",
@@ -1371,23 +1427,23 @@ function Table$a(props) {
1371
1427
  ), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1372
1428
  }
1373
1429
 
1374
- var __defProp$6 = Object.defineProperty;
1375
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1376
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1377
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1378
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1379
- var __spreadValues$6 = (a, b) => {
1430
+ var __defProp$7 = Object.defineProperty;
1431
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1432
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1433
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1434
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1435
+ var __spreadValues$7 = (a, b) => {
1380
1436
  for (var prop in b || (b = {}))
1381
- if (__hasOwnProp$6.call(b, prop))
1382
- __defNormalProp$6(a, prop, b[prop]);
1383
- if (__getOwnPropSymbols$6)
1384
- for (var prop of __getOwnPropSymbols$6(b)) {
1385
- if (__propIsEnum$6.call(b, prop))
1386
- __defNormalProp$6(a, prop, b[prop]);
1437
+ if (__hasOwnProp$7.call(b, prop))
1438
+ __defNormalProp$7(a, prop, b[prop]);
1439
+ if (__getOwnPropSymbols$7)
1440
+ for (var prop of __getOwnPropSymbols$7(b)) {
1441
+ if (__propIsEnum$7.call(b, prop))
1442
+ __defNormalProp$7(a, prop, b[prop]);
1387
1443
  }
1388
1444
  return a;
1389
1445
  };
1390
- const useStyles$i = core.createStyles((theme) => ({
1446
+ const useStyles$j = core.createStyles((theme) => ({
1391
1447
  title: {
1392
1448
  fontSize: 34,
1393
1449
  fontWeight: 900,
@@ -1400,7 +1456,7 @@ const useStyles$i = core.createStyles((theme) => ({
1400
1456
  }
1401
1457
  }));
1402
1458
  const Classes = (props) => {
1403
- const { classes } = useStyles$i();
1459
+ const { classes } = useStyles$j();
1404
1460
  const form$1 = form.useForm({
1405
1461
  initialValues: {
1406
1462
  classId: "",
@@ -1430,14 +1486,14 @@ const Classes = (props) => {
1430
1486
  props.onCreateClass && props.onCreateClass(values);
1431
1487
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1432
1488
  core.TextInput,
1433
- __spreadValues$6({
1489
+ __spreadValues$7({
1434
1490
  withAsterisk: true,
1435
1491
  label: "Name",
1436
1492
  placeholder: "Class name"
1437
1493
  }, form$1.getInputProps("name"))
1438
1494
  ), /* @__PURE__ */ React__namespace.createElement(
1439
1495
  core.TextInput,
1440
- __spreadValues$6({
1496
+ __spreadValues$7({
1441
1497
  label: "Description",
1442
1498
  placeholder: "A class for my first period English students"
1443
1499
  }, form$1.getInputProps("description"))
@@ -1471,7 +1527,7 @@ const Classes = (props) => {
1471
1527
  ))))));
1472
1528
  };
1473
1529
 
1474
- const useStyles$h = core.createStyles((theme) => ({
1530
+ const useStyles$i = core.createStyles((theme) => ({
1475
1531
  title: {
1476
1532
  fontSize: 34,
1477
1533
  fontWeight: 900,
@@ -1485,7 +1541,7 @@ const useStyles$h = core.createStyles((theme) => ({
1485
1541
  }
1486
1542
  }));
1487
1543
  const UserInfo = (props) => {
1488
- const { classes } = useStyles$h();
1544
+ const { classes } = useStyles$i();
1489
1545
  return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "xs" }, props.impactStatement));
1490
1546
  };
1491
1547
 
@@ -1623,7 +1679,7 @@ const Student = (props) => {
1623
1679
  ))))));
1624
1680
  };
1625
1681
 
1626
- const useStyles$g = core.createStyles((theme, props) => {
1682
+ const useStyles$h = core.createStyles((theme, props) => {
1627
1683
  const from = props.from || "blue";
1628
1684
  const to = props.to || "green";
1629
1685
  return {
@@ -1651,7 +1707,7 @@ const useStyles$g = core.createStyles((theme, props) => {
1651
1707
  };
1652
1708
  });
1653
1709
  function CardGradient(props) {
1654
- const { classes } = useStyles$g(props);
1710
+ const { classes } = useStyles$h(props);
1655
1711
  const from = props.from || "blue";
1656
1712
  const to = props.to || "green";
1657
1713
  const icon = props.icon || /* @__PURE__ */ React__namespace.createElement(icons.IconColorSwatch, { size: 28, stroke: 1.5 });
@@ -1667,35 +1723,35 @@ function CardGradient(props) {
1667
1723
  ), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xl", weight: 500, mt: "md" }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", mt: "sm", color: "dimmed" }, props.description));
1668
1724
  }
1669
1725
 
1670
- var __defProp$5 = Object.defineProperty;
1671
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1672
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1673
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1674
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1675
- var __spreadValues$5 = (a, b) => {
1726
+ var __defProp$6 = Object.defineProperty;
1727
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1728
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1729
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1730
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1731
+ var __spreadValues$6 = (a, b) => {
1676
1732
  for (var prop in b || (b = {}))
1677
- if (__hasOwnProp$5.call(b, prop))
1678
- __defNormalProp$5(a, prop, b[prop]);
1679
- if (__getOwnPropSymbols$5)
1680
- for (var prop of __getOwnPropSymbols$5(b)) {
1681
- if (__propIsEnum$5.call(b, prop))
1682
- __defNormalProp$5(a, prop, b[prop]);
1733
+ if (__hasOwnProp$6.call(b, prop))
1734
+ __defNormalProp$6(a, prop, b[prop]);
1735
+ if (__getOwnPropSymbols$6)
1736
+ for (var prop of __getOwnPropSymbols$6(b)) {
1737
+ if (__propIsEnum$6.call(b, prop))
1738
+ __defNormalProp$6(a, prop, b[prop]);
1683
1739
  }
1684
1740
  return a;
1685
1741
  };
1686
1742
  var __objRest$1 = (source, exclude) => {
1687
1743
  var target = {};
1688
1744
  for (var prop in source)
1689
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1745
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1690
1746
  target[prop] = source[prop];
1691
- if (source != null && __getOwnPropSymbols$5)
1692
- for (var prop of __getOwnPropSymbols$5(source)) {
1693
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1747
+ if (source != null && __getOwnPropSymbols$6)
1748
+ for (var prop of __getOwnPropSymbols$6(source)) {
1749
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1694
1750
  target[prop] = source[prop];
1695
1751
  }
1696
1752
  return target;
1697
1753
  };
1698
- const useStyles$f = core.createStyles((theme) => ({
1754
+ const useStyles$g = core.createStyles((theme) => ({
1699
1755
  card: {
1700
1756
  height: 240,
1701
1757
  backgroundSize: "cover",
@@ -1740,7 +1796,7 @@ const TenantBanner = (_a) => {
1740
1796
  "className",
1741
1797
  "code"
1742
1798
  ]);
1743
- const { classes, cx, theme } = useStyles$f();
1799
+ const { classes, cx, theme } = useStyles$g();
1744
1800
  const handleCopy = async () => {
1745
1801
  if (!code)
1746
1802
  return;
@@ -1757,9 +1813,9 @@ const TenantBanner = (_a) => {
1757
1813
  };
1758
1814
  return /* @__PURE__ */ React__namespace.createElement(
1759
1815
  core.Card,
1760
- __spreadValues$5({
1816
+ __spreadValues$6({
1761
1817
  radius: "md",
1762
- style: __spreadValues$5({ backgroundImage: `url(${image})` }, style),
1818
+ style: __spreadValues$6({ backgroundImage: `url(${image})` }, style),
1763
1819
  className: cx(classes.card, className)
1764
1820
  }, others),
1765
1821
  /* @__PURE__ */ React__namespace.createElement(
@@ -1857,7 +1913,7 @@ function Table$6(props) {
1857
1913
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Student Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Reflection"), /* @__PURE__ */ React__namespace.createElement("th", null, "Rating"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1858
1914
  }
1859
1915
 
1860
- const useStyles$e = core.createStyles((theme) => ({
1916
+ const useStyles$f = core.createStyles((theme) => ({
1861
1917
  button: {
1862
1918
  borderTopRightRadius: 0,
1863
1919
  borderBottomRightRadius: 0,
@@ -1872,7 +1928,7 @@ const useStyles$e = core.createStyles((theme) => ({
1872
1928
  }
1873
1929
  }));
1874
1930
  const SplitButton$2 = (props) => {
1875
- const { classes, theme } = useStyles$e();
1931
+ const { classes, theme } = useStyles$f();
1876
1932
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
1877
1933
  return /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
1878
1934
  core.Button,
@@ -2016,7 +2072,7 @@ function Stack$1(props) {
2016
2072
  }
2017
2073
  const truncateWithEllipses = (text, max) => text.substr(0, max - 1) + (text.length > max ? "&hellip;" : "");
2018
2074
 
2019
- const useStyles$d = core.createStyles((theme) => ({
2075
+ const useStyles$e = core.createStyles((theme) => ({
2020
2076
  title: {
2021
2077
  fontSize: 34,
2022
2078
  fontWeight: 900,
@@ -2029,7 +2085,7 @@ const useStyles$d = core.createStyles((theme) => ({
2029
2085
  }
2030
2086
  }));
2031
2087
  const Lesson = (props) => {
2032
- const { classes } = useStyles$d();
2088
+ const { classes } = useStyles$e();
2033
2089
  const [tab, setTab] = React.useState("question");
2034
2090
  const numberOfStudents = props.students.length;
2035
2091
  const numberOfLessons = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -2173,7 +2229,7 @@ function Table$4(props) {
2173
2229
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
2174
2230
  }
2175
2231
 
2176
- const useStyles$c = core.createStyles((theme) => ({
2232
+ const useStyles$d = core.createStyles((theme) => ({
2177
2233
  title: {
2178
2234
  fontSize: 34,
2179
2235
  fontWeight: 900,
@@ -2186,7 +2242,7 @@ const useStyles$c = core.createStyles((theme) => ({
2186
2242
  }
2187
2243
  }));
2188
2244
  const Lessons = (props) => {
2189
- const { classes } = useStyles$c();
2245
+ const { classes } = useStyles$d();
2190
2246
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Lessons"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Lessons"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Bite-sized activities and learning experiences accelerating students achievement"))), /* @__PURE__ */ React__namespace.createElement(
2191
2247
  core.Autocomplete,
2192
2248
  {
@@ -2203,7 +2259,7 @@ const Lessons = (props) => {
2203
2259
  ))));
2204
2260
  };
2205
2261
 
2206
- const useStyles$b = core.createStyles((theme) => ({
2262
+ const useStyles$c = core.createStyles((theme) => ({
2207
2263
  title: {
2208
2264
  fontSize: 22,
2209
2265
  fontWeight: 900,
@@ -2222,7 +2278,7 @@ const useStyles$b = core.createStyles((theme) => ({
2222
2278
  }
2223
2279
  }));
2224
2280
  function AccessCode(props) {
2225
- const { classes } = useStyles$b();
2281
+ const { classes } = useStyles$c();
2226
2282
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { mx: "0", px: "0", size: 460, my: 30 }, /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, "Access code"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", size: "sm" }, "Grant access to join your organization"), /* @__PURE__ */ React__namespace.createElement(core.Paper, { withBorder: true, shadow: "md", p: 30, radius: "md", mt: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.TextInput, { value: props.value, readOnly: true }), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart", mt: "lg", className: classes.controls }, /* @__PURE__ */ React__namespace.createElement(
2227
2283
  core.Anchor,
2228
2284
  {
@@ -2250,7 +2306,7 @@ const monthNames = [
2250
2306
  "November",
2251
2307
  "December"
2252
2308
  ];
2253
- const useStyles$a = core.createStyles((theme) => ({
2309
+ const useStyles$b = core.createStyles((theme) => ({
2254
2310
  title: {
2255
2311
  fontSize: 34,
2256
2312
  fontWeight: 900,
@@ -2280,7 +2336,7 @@ const useStyles$a = core.createStyles((theme) => ({
2280
2336
  }
2281
2337
  }));
2282
2338
  const Organization = (props) => {
2283
- const { classes } = useStyles$a();
2339
+ const { classes } = useStyles$b();
2284
2340
  return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React__namespace.createElement(
2285
2341
  core.Badge,
2286
2342
  {
@@ -2306,7 +2362,7 @@ const Organization = (props) => {
2306
2362
  ] }))))));
2307
2363
  };
2308
2364
 
2309
- const useStyles$9 = core.createStyles((theme) => ({
2365
+ const useStyles$a = core.createStyles((theme) => ({
2310
2366
  button: {
2311
2367
  borderTopRightRadius: 0,
2312
2368
  borderBottomRightRadius: 0,
@@ -2321,7 +2377,7 @@ const useStyles$9 = core.createStyles((theme) => ({
2321
2377
  }
2322
2378
  }));
2323
2379
  const SplitButton$1 = (props) => {
2324
- const { classes, theme } = useStyles$9();
2380
+ const { classes, theme } = useStyles$a();
2325
2381
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
2326
2382
  const hasMenu = !!props.withOrganizationLink;
2327
2383
  return /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React__namespace.createElement(
@@ -2383,26 +2439,26 @@ function Table$3(props) {
2383
2439
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea, null, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Role"), /* @__PURE__ */ React__namespace.createElement("th", null, "Account Created?"), /* @__PURE__ */ React__namespace.createElement("th", null, "# of Classes"), /* @__PURE__ */ React__namespace.createElement("th", null, "Last Active"), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
2384
2440
  }
2385
2441
 
2386
- var __defProp$4 = Object.defineProperty;
2387
- var __defProps$3 = Object.defineProperties;
2388
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
2389
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
2390
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
2391
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
2392
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2393
- var __spreadValues$4 = (a, b) => {
2442
+ var __defProp$5 = Object.defineProperty;
2443
+ var __defProps$4 = Object.defineProperties;
2444
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2445
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
2446
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
2447
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
2448
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2449
+ var __spreadValues$5 = (a, b) => {
2394
2450
  for (var prop in b || (b = {}))
2395
- if (__hasOwnProp$4.call(b, prop))
2396
- __defNormalProp$4(a, prop, b[prop]);
2397
- if (__getOwnPropSymbols$4)
2398
- for (var prop of __getOwnPropSymbols$4(b)) {
2399
- if (__propIsEnum$4.call(b, prop))
2400
- __defNormalProp$4(a, prop, b[prop]);
2451
+ if (__hasOwnProp$5.call(b, prop))
2452
+ __defNormalProp$5(a, prop, b[prop]);
2453
+ if (__getOwnPropSymbols$5)
2454
+ for (var prop of __getOwnPropSymbols$5(b)) {
2455
+ if (__propIsEnum$5.call(b, prop))
2456
+ __defNormalProp$5(a, prop, b[prop]);
2401
2457
  }
2402
2458
  return a;
2403
2459
  };
2404
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
2405
- const useStyles$8 = core.createStyles((theme) => ({
2460
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2461
+ const useStyles$9 = core.createStyles((theme) => ({
2406
2462
  title: {
2407
2463
  fontSize: 34,
2408
2464
  fontWeight: 900,
@@ -2432,7 +2488,7 @@ const useStyles$8 = core.createStyles((theme) => ({
2432
2488
  }
2433
2489
  }));
2434
2490
  const People = (props) => {
2435
- const { classes } = useStyles$8();
2491
+ const { classes } = useStyles$9();
2436
2492
  const form$1 = form.useForm({
2437
2493
  initialValues: {
2438
2494
  userId: "",
@@ -2463,27 +2519,27 @@ const People = (props) => {
2463
2519
  padding: "xl",
2464
2520
  size: "xl"
2465
2521
  },
2466
- /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps$3(__spreadValues$4({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
2522
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps$4(__spreadValues$5({}, props), { close: () => setOpened(false) })), /* @__PURE__ */ React__namespace.createElement(core.Divider, { label: "or", labelPosition: "center", my: "md", variant: "dashed" }), /* @__PURE__ */ React__namespace.createElement("form", { onSubmit: form$1.onSubmit(() => {
2467
2523
  const values = form$1.values;
2468
2524
  form$1.reset();
2469
2525
  setOpened(false);
2470
2526
  props.onCreateUsers && props.onCreateUsers([values]);
2471
2527
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
2472
2528
  core.TextInput,
2473
- __spreadValues$4({
2529
+ __spreadValues$5({
2474
2530
  withAsterisk: true,
2475
2531
  label: "Email",
2476
2532
  placeholder: "Email"
2477
2533
  }, form$1.getInputProps("email"))
2478
2534
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
2479
2535
  core.TextInput,
2480
- __spreadValues$4({
2536
+ __spreadValues$5({
2481
2537
  label: "Given name",
2482
2538
  placeholder: "Given name"
2483
2539
  }, form$1.getInputProps("givenName"))
2484
2540
  ), /* @__PURE__ */ React__namespace.createElement(
2485
2541
  core.TextInput,
2486
- __spreadValues$4({
2542
+ __spreadValues$5({
2487
2543
  label: "Family name",
2488
2544
  placeholder: "Family name"
2489
2545
  }, form$1.getInputProps("familyName"))
@@ -2536,7 +2592,7 @@ const People = (props) => {
2536
2592
  ))))));
2537
2593
  };
2538
2594
  const DropzoneButton = (props) => {
2539
- const { classes, theme } = useStyles$8();
2595
+ const { classes, theme } = useStyles$9();
2540
2596
  const openRef = React__namespace.useRef(null);
2541
2597
  const [loading, setLoading] = React__namespace.useState(false);
2542
2598
  const onDrop = React__namespace.useCallback((acceptedFiles) => {
@@ -2582,7 +2638,7 @@ const DropzoneButton = (props) => {
2582
2638
  } }, "Select file"));
2583
2639
  };
2584
2640
 
2585
- const useStyles$7 = core.createStyles((theme) => ({
2641
+ const useStyles$8 = core.createStyles((theme) => ({
2586
2642
  form: {
2587
2643
  backgroundColor: theme.white,
2588
2644
  padding: theme.spacing.xl,
@@ -2645,7 +2701,7 @@ const useStyles$7 = core.createStyles((theme) => ({
2645
2701
  }
2646
2702
  }));
2647
2703
  const StartAnonymousLesson = (props) => {
2648
- const { classes } = useStyles$7();
2704
+ const { classes } = useStyles$8();
2649
2705
  const [name, setName] = React__namespace.useState("");
2650
2706
  return /* @__PURE__ */ React__namespace.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React__namespace.createElement(core.Container, null, /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { maw: 960, cols: 2, spacing: 15, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React__namespace.createElement("div", { className: classes.content }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet" }, "Community"), /* @__PURE__ */ React__namespace.createElement(core.Title, { className: classes.title }, props.title), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", mt: "md" }, props.description), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", mt: "md" }, "You are now part of ", `${props.educatorName}'s`, " Class")), /* @__PURE__ */ React__namespace.createElement("div", { className: classes.form }, /* @__PURE__ */ React__namespace.createElement(
2651
2707
  core.TextInput,
@@ -2669,24 +2725,24 @@ const StartAnonymousLesson = (props) => {
2669
2725
  ))))));
2670
2726
  };
2671
2727
 
2672
- var __defProp$3 = Object.defineProperty;
2673
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
2674
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
2675
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
2676
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2677
- var __spreadValues$3 = (a, b) => {
2728
+ var __defProp$4 = Object.defineProperty;
2729
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
2730
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
2731
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
2732
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2733
+ var __spreadValues$4 = (a, b) => {
2678
2734
  for (var prop in b || (b = {}))
2679
- if (__hasOwnProp$3.call(b, prop))
2680
- __defNormalProp$3(a, prop, b[prop]);
2681
- if (__getOwnPropSymbols$3)
2682
- for (var prop of __getOwnPropSymbols$3(b)) {
2683
- if (__propIsEnum$3.call(b, prop))
2684
- __defNormalProp$3(a, prop, b[prop]);
2735
+ if (__hasOwnProp$4.call(b, prop))
2736
+ __defNormalProp$4(a, prop, b[prop]);
2737
+ if (__getOwnPropSymbols$4)
2738
+ for (var prop of __getOwnPropSymbols$4(b)) {
2739
+ if (__propIsEnum$4.call(b, prop))
2740
+ __defNormalProp$4(a, prop, b[prop]);
2685
2741
  }
2686
2742
  return a;
2687
2743
  };
2688
2744
  const BadgeGrid = (props) => {
2689
- const badges = props.badges.map((b) => /* @__PURE__ */ React__namespace.createElement(TaskCard, __spreadValues$3({ key: b.title }, b)));
2745
+ const badges = props.badges.map((b) => /* @__PURE__ */ React__namespace.createElement(TaskCard, __spreadValues$4({ key: b.title }, b)));
2690
2746
  return /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { cols: 4, breakpoints: [{ maxWidth: "sm", cols: 1 }, { maxWidth: "md", cols: 3 }] }, badges);
2691
2747
  };
2692
2748
  function TaskCard(props) {
@@ -2702,7 +2758,7 @@ function TaskCard(props) {
2702
2758
  ));
2703
2759
  }
2704
2760
 
2705
- const useStyles$6 = core.createStyles((theme) => ({
2761
+ const useStyles$7 = core.createStyles((theme) => ({
2706
2762
  action: {
2707
2763
  backgroundColor: "inherit",
2708
2764
  ":hover": {
@@ -2721,7 +2777,7 @@ const useStyles$6 = core.createStyles((theme) => ({
2721
2777
  }
2722
2778
  }));
2723
2779
  const TrialHome = (props) => {
2724
- const { classes } = useStyles$6();
2780
+ const { classes } = useStyles$7();
2725
2781
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, null, props.daysRemaining, " day", props.daysRemaining !== 1 ? "s" : "", " left"), /* @__PURE__ */ React__namespace.createElement(
2726
2782
  core.Button,
2727
2783
  {
@@ -2750,38 +2806,38 @@ const TrialHome = (props) => {
2750
2806
  )), /* @__PURE__ */ React__namespace.createElement(core.Title, { maw: 500, mb: 20, mt: 20, className: classes.title }, "Based on the tags you selected, check out these lessons to get started with your students!"), /* @__PURE__ */ React__namespace.createElement(BadgeGrid, { onAssign: props.onAssign, badges: props.badges })));
2751
2807
  };
2752
2808
 
2753
- var __defProp$2 = Object.defineProperty;
2754
- var __defProps$2 = Object.defineProperties;
2755
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
2756
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
2757
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
2758
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
2759
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2760
- var __spreadValues$2 = (a, b) => {
2809
+ var __defProp$3 = Object.defineProperty;
2810
+ var __defProps$3 = Object.defineProperties;
2811
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
2812
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
2813
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
2814
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
2815
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2816
+ var __spreadValues$3 = (a, b) => {
2761
2817
  for (var prop in b || (b = {}))
2762
- if (__hasOwnProp$2.call(b, prop))
2763
- __defNormalProp$2(a, prop, b[prop]);
2764
- if (__getOwnPropSymbols$2)
2765
- for (var prop of __getOwnPropSymbols$2(b)) {
2766
- if (__propIsEnum$2.call(b, prop))
2767
- __defNormalProp$2(a, prop, b[prop]);
2818
+ if (__hasOwnProp$3.call(b, prop))
2819
+ __defNormalProp$3(a, prop, b[prop]);
2820
+ if (__getOwnPropSymbols$3)
2821
+ for (var prop of __getOwnPropSymbols$3(b)) {
2822
+ if (__propIsEnum$3.call(b, prop))
2823
+ __defNormalProp$3(a, prop, b[prop]);
2768
2824
  }
2769
2825
  return a;
2770
2826
  };
2771
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
2827
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
2772
2828
  var __objRest = (source, exclude) => {
2773
2829
  var target = {};
2774
2830
  for (var prop in source)
2775
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
2831
+ if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
2776
2832
  target[prop] = source[prop];
2777
- if (source != null && __getOwnPropSymbols$2)
2778
- for (var prop of __getOwnPropSymbols$2(source)) {
2779
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
2833
+ if (source != null && __getOwnPropSymbols$3)
2834
+ for (var prop of __getOwnPropSymbols$3(source)) {
2835
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
2780
2836
  target[prop] = source[prop];
2781
2837
  }
2782
2838
  return target;
2783
2839
  };
2784
- const useStyles$5 = core.createStyles((theme, { checked }) => ({
2840
+ const useStyles$6 = core.createStyles((theme, { checked }) => ({
2785
2841
  button: {
2786
2842
  display: "flex",
2787
2843
  alignItems: "center",
@@ -2823,10 +2879,10 @@ function ImageCheckbox(_a) {
2823
2879
  finalValue: false,
2824
2880
  onChange
2825
2881
  });
2826
- const { classes, cx } = useStyles$5({ checked: value });
2882
+ const { classes, cx } = useStyles$6({ checked: value });
2827
2883
  return /* @__PURE__ */ React__namespace.createElement(
2828
2884
  core.UnstyledButton,
2829
- __spreadProps$2(__spreadValues$2({}, others), {
2885
+ __spreadProps$3(__spreadValues$3({}, others), {
2830
2886
  onClick: () => handleChange(!value),
2831
2887
  className: cx(classes.button, className)
2832
2888
  }),
@@ -2847,7 +2903,7 @@ function ImageCheckbox(_a) {
2847
2903
  function SelectGrid(props) {
2848
2904
  const items = props.items.map((item) => /* @__PURE__ */ React__namespace.createElement(
2849
2905
  ImageCheckbox,
2850
- __spreadProps$2(__spreadValues$2({}, item), {
2906
+ __spreadProps$3(__spreadValues$3({}, item), {
2851
2907
  key: item.title,
2852
2908
  onChange: (checked) => props.onChange(item.title, checked)
2853
2909
  })
@@ -2865,26 +2921,26 @@ function SelectGrid(props) {
2865
2921
  );
2866
2922
  }
2867
2923
 
2868
- var __defProp$1 = Object.defineProperty;
2869
- var __defProps$1 = Object.defineProperties;
2870
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2871
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2872
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2873
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2874
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2875
- var __spreadValues$1 = (a, b) => {
2924
+ var __defProp$2 = Object.defineProperty;
2925
+ var __defProps$2 = Object.defineProperties;
2926
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
2927
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
2928
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
2929
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
2930
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2931
+ var __spreadValues$2 = (a, b) => {
2876
2932
  for (var prop in b || (b = {}))
2877
- if (__hasOwnProp$1.call(b, prop))
2878
- __defNormalProp$1(a, prop, b[prop]);
2879
- if (__getOwnPropSymbols$1)
2880
- for (var prop of __getOwnPropSymbols$1(b)) {
2881
- if (__propIsEnum$1.call(b, prop))
2882
- __defNormalProp$1(a, prop, b[prop]);
2933
+ if (__hasOwnProp$2.call(b, prop))
2934
+ __defNormalProp$2(a, prop, b[prop]);
2935
+ if (__getOwnPropSymbols$2)
2936
+ for (var prop of __getOwnPropSymbols$2(b)) {
2937
+ if (__propIsEnum$2.call(b, prop))
2938
+ __defNormalProp$2(a, prop, b[prop]);
2883
2939
  }
2884
2940
  return a;
2885
2941
  };
2886
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2887
- const useStyles$4 = core.createStyles((theme) => ({
2942
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
2943
+ const useStyles$5 = core.createStyles((theme) => ({
2888
2944
  wrapper: {
2889
2945
  minHeight: "100%",
2890
2946
  boxSizing: "border-box",
@@ -2947,7 +3003,7 @@ const OPTIONS = [
2947
3003
  { description: "project-based learning", title: "Project-Based Learning", icon: icons.IconTools }
2948
3004
  ];
2949
3005
  const TrialRegistration = (props) => {
2950
- const { classes } = useStyles$4();
3006
+ const { classes } = useStyles$5();
2951
3007
  const [firstName, setFirstName] = React__namespace.useState("");
2952
3008
  const [lastName, setLastName] = React__namespace.useState("");
2953
3009
  const [organization, setOrganization] = React__namespace.useState({ organizationId: "", displayName: "" });
@@ -2993,7 +3049,7 @@ const TrialRegistration = (props) => {
2993
3049
  label: "School/Organization Name",
2994
3050
  placeholder: "What's the name of your school?",
2995
3051
  data: props.organizations.map((o) => {
2996
- return __spreadProps$1(__spreadValues$1({}, o), { value: o.displayName });
3052
+ return __spreadProps$2(__spreadValues$2({}, o), { value: o.displayName });
2997
3053
  }),
2998
3054
  onItemSubmit: (item) => setOrganization({ organizationId: item.organizationId, displayName: item.displayName }),
2999
3055
  onChange: (next) => {
@@ -3005,7 +3061,7 @@ const TrialRegistration = (props) => {
3005
3061
  SelectGrid,
3006
3062
  {
3007
3063
  items: OPTIONS,
3008
- onChange: (e, checked) => setInterests(__spreadProps$1(__spreadValues$1({}, interests), { [e]: checked }))
3064
+ onChange: (e, checked) => setInterests(__spreadProps$2(__spreadValues$2({}, interests), { [e]: checked }))
3009
3065
  }
3010
3066
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "right", mt: "md" }, /* @__PURE__ */ React__namespace.createElement(
3011
3067
  core.Button,
@@ -3043,26 +3099,26 @@ const AdminProvider = (props) => {
3043
3099
  );
3044
3100
  };
3045
3101
 
3046
- var __defProp = Object.defineProperty;
3047
- var __defProps = Object.defineProperties;
3048
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3049
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3050
- var __hasOwnProp = Object.prototype.hasOwnProperty;
3051
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
3052
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3053
- var __spreadValues = (a, b) => {
3102
+ var __defProp$1 = Object.defineProperty;
3103
+ var __defProps$1 = Object.defineProperties;
3104
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3105
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3106
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
3107
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
3108
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3109
+ var __spreadValues$1 = (a, b) => {
3054
3110
  for (var prop in b || (b = {}))
3055
- if (__hasOwnProp.call(b, prop))
3056
- __defNormalProp(a, prop, b[prop]);
3057
- if (__getOwnPropSymbols)
3058
- for (var prop of __getOwnPropSymbols(b)) {
3059
- if (__propIsEnum.call(b, prop))
3060
- __defNormalProp(a, prop, b[prop]);
3111
+ if (__hasOwnProp$1.call(b, prop))
3112
+ __defNormalProp$1(a, prop, b[prop]);
3113
+ if (__getOwnPropSymbols$1)
3114
+ for (var prop of __getOwnPropSymbols$1(b)) {
3115
+ if (__propIsEnum$1.call(b, prop))
3116
+ __defNormalProp$1(a, prop, b[prop]);
3061
3117
  }
3062
3118
  return a;
3063
3119
  };
3064
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3065
- const useStyles$3 = core.createStyles((theme, props) => ({
3120
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3121
+ const useStyles$4 = core.createStyles((theme, props) => ({
3066
3122
  footer: {
3067
3123
  paddingTop: theme.spacing.md,
3068
3124
  paddingBottom: theme.spacing.md,
@@ -3149,7 +3205,7 @@ const useStyles$3 = core.createStyles((theme, props) => ({
3149
3205
  }
3150
3206
  }));
3151
3207
  const App = (props) => {
3152
- const { classes } = useStyles$3(props);
3208
+ const { classes } = useStyles$4(props);
3153
3209
  const account = useAccount(props.account, props.accounts, props.onAccountChange);
3154
3210
  return /* @__PURE__ */ React__namespace.createElement(
3155
3211
  core.AppShell,
@@ -3157,7 +3213,7 @@ const App = (props) => {
3157
3213
  padding: "xs",
3158
3214
  navbar: props.navbar && /* @__PURE__ */ React__namespace.createElement(
3159
3215
  Navbar,
3160
- __spreadProps(__spreadValues({}, props.navbar.props), {
3216
+ __spreadProps$1(__spreadValues$1({}, props.navbar.props), {
3161
3217
  onSwitchAccounts: account.accounts && account.accounts.length > 1 ? () => account.setChangeModalOpen(true) : void 0
3162
3218
  })
3163
3219
  ),
@@ -3276,7 +3332,7 @@ function Table$2(props) {
3276
3332
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
3277
3333
  }
3278
3334
 
3279
- const useStyles$2 = core.createStyles((theme) => ({
3335
+ const useStyles$3 = core.createStyles((theme) => ({
3280
3336
  title: {
3281
3337
  fontSize: 34,
3282
3338
  fontWeight: 900,
@@ -3289,7 +3345,7 @@ const useStyles$2 = core.createStyles((theme) => ({
3289
3345
  }
3290
3346
  }));
3291
3347
  const Pathways = (props) => {
3292
- const { classes } = useStyles$2();
3348
+ const { classes } = useStyles$3();
3293
3349
  return /* @__PURE__ */ React__namespace.createElement(core.Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(core.Grid, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { sm: "auto" }, /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled", size: "lg" }, "Pathways"), /* @__PURE__ */ React__namespace.createElement(core.Title, { order: 2, className: classes.title, mt: "md" }, "Pathways"), /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Explore all your unique pathway requirements in one clear space"))), /* @__PURE__ */ React__namespace.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React__namespace.createElement(core.LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React__namespace.createElement(
3294
3350
  Table$2,
3295
3351
  {
@@ -3299,7 +3355,7 @@ const Pathways = (props) => {
3299
3355
  ))));
3300
3356
  };
3301
3357
 
3302
- const useStyles$1 = core.createStyles((theme) => ({
3358
+ const useStyles$2 = core.createStyles((theme) => ({
3303
3359
  button: {
3304
3360
  borderTopRightRadius: 0,
3305
3361
  borderBottomRightRadius: 0,
@@ -3314,7 +3370,7 @@ const useStyles$1 = core.createStyles((theme) => ({
3314
3370
  }
3315
3371
  }));
3316
3372
  const SplitButton = (props) => {
3317
- const { classes, theme } = useStyles$1();
3373
+ const { classes, theme } = useStyles$2();
3318
3374
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
3319
3375
  return /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
3320
3376
  core.Button,
@@ -3350,7 +3406,32 @@ function Stack(props) {
3350
3406
  return /* @__PURE__ */ React__namespace.createElement(core.Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
3351
3407
  }
3352
3408
 
3409
+ var __defProp = Object.defineProperty;
3410
+ var __defProps = Object.defineProperties;
3411
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3412
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3413
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3414
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
3415
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3416
+ var __spreadValues = (a, b) => {
3417
+ for (var prop in b || (b = {}))
3418
+ if (__hasOwnProp.call(b, prop))
3419
+ __defNormalProp(a, prop, b[prop]);
3420
+ if (__getOwnPropSymbols)
3421
+ for (var prop of __getOwnPropSymbols(b)) {
3422
+ if (__propIsEnum.call(b, prop))
3423
+ __defNormalProp(a, prop, b[prop]);
3424
+ }
3425
+ return a;
3426
+ };
3427
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3353
3428
  function Table$1(props) {
3429
+ const preparedItems = React__namespace.useMemo(() => {
3430
+ return props.items.map((item) => __spreadValues(__spreadProps(__spreadValues({}, item), {
3431
+ status: item.isComplete
3432
+ }), item.categoryPoints));
3433
+ }, [props.items]);
3434
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3354
3435
  if (props.items.length === 0) {
3355
3436
  return /* @__PURE__ */ React__namespace.createElement(
3356
3437
  PlaceholderBanner,
@@ -3362,6 +3443,10 @@ function Table$1(props) {
3362
3443
  }
3363
3444
  );
3364
3445
  }
3446
+ const sortStatus = {
3447
+ columnAccessor: sortConfig.key,
3448
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
3449
+ };
3365
3450
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
3366
3451
  mantineDatatable.DataTable,
3367
3452
  {
@@ -3372,24 +3457,33 @@ function Table$1(props) {
3372
3457
  withColumnBorders: true,
3373
3458
  striped: true,
3374
3459
  highlightOnHover: true,
3375
- records: props.items,
3460
+ records: sortedItems,
3376
3461
  idAccessor: "userId",
3462
+ sortStatus,
3463
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
3377
3464
  columns: [
3378
3465
  {
3379
3466
  accessor: "name",
3380
3467
  title: "Student Name",
3381
- render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email)))
3468
+ sortable: true,
3469
+ titleStyle: { whiteSpace: "nowrap" },
3470
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Group, { spacing: "sm", noWrap: true }, /* @__PURE__ */ React__namespace.createElement(core.Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "sm", weight: 500 }, row.name), /* @__PURE__ */ React__namespace.createElement(core.Text, { size: "xs", color: "dimmed" }, row.email)))
3382
3471
  },
3383
3472
  {
3384
3473
  accessor: "status",
3385
- render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Incomplete"))
3474
+ title: "Status",
3475
+ sortable: true,
3476
+ titleStyle: { whiteSpace: "nowrap" },
3477
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: row.isComplete ? "blue" : "red", variant: "filled" }, row.isComplete ? "Complete" : "Incomplete")
3386
3478
  },
3387
3479
  ...props.categories.map((category) => ({
3388
3480
  accessor: category.categoryId,
3389
3481
  title: category.name,
3482
+ sortable: true,
3483
+ titleStyle: { whiteSpace: "nowrap" },
3390
3484
  render: (row) => {
3391
3485
  var _a, _b;
3392
- return /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "blue", variant: "filled" }, (_b = (_a = row.categoryPoints) == null ? void 0 : _a[category.categoryId]) != null ? _b : 0);
3486
+ return /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "blue", variant: "filled" }, (_b = (_a = row.categoryPoints) == null ? void 0 : _a[category.categoryId]) != null ? _b : 0, " pts");
3393
3487
  }
3394
3488
  }))
3395
3489
  ],
@@ -3400,7 +3494,23 @@ function Table$1(props) {
3400
3494
  ));
3401
3495
  }
3402
3496
 
3497
+ const useStyles$1 = core.createStyles((theme) => ({
3498
+ th: { padding: "0 !important" },
3499
+ control: {
3500
+ width: "100%",
3501
+ padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
3502
+ "&:hover": {
3503
+ backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
3504
+ }
3505
+ }
3506
+ }));
3507
+ function Th({ children, reversed, sorted, onSort }) {
3508
+ const { classes } = useStyles$1();
3509
+ const Icon = sorted ? reversed ? icons.IconChevronUp : icons.IconChevronDown : icons.IconSelector;
3510
+ return /* @__PURE__ */ React__namespace.createElement("th", { className: classes.th }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React__namespace.createElement(core.Center, null, /* @__PURE__ */ React__namespace.createElement(Icon, { size: 14, stroke: 1.5 })))));
3511
+ }
3403
3512
  function Table(props) {
3513
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
3404
3514
  if (props.items.length === 0) {
3405
3515
  return /* @__PURE__ */ React__namespace.createElement(
3406
3516
  PlaceholderBanner,
@@ -3412,11 +3522,27 @@ function Table(props) {
3412
3522
  }
3413
3523
  );
3414
3524
  }
3415
- const rows = props.items.map((row) => {
3525
+ const rows = sortedItems.map((row) => {
3416
3526
  const percentageCompletion = Math.round((row.percentageCompletion + Number.EPSILON) * 100);
3417
- return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.badgeName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href }, row.badgeName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
3527
+ return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.badgeId }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href }, row.badgeName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
3418
3528
  });
3419
- return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
3529
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement(
3530
+ Th,
3531
+ {
3532
+ sorted: sortConfig.key === "badgeName",
3533
+ reversed: sortConfig.direction === "desc",
3534
+ onSort: () => requestSort("badgeName")
3535
+ },
3536
+ "Badge Name"
3537
+ ), /* @__PURE__ */ React__namespace.createElement(
3538
+ Th,
3539
+ {
3540
+ sorted: sortConfig.key === "percentageCompletion",
3541
+ reversed: sortConfig.direction === "desc",
3542
+ onSort: () => requestSort("percentageCompletion")
3543
+ },
3544
+ "Badge Completion"
3545
+ ))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
3420
3546
  }
3421
3547
 
3422
3548
  const useStyles = core.createStyles((theme) => ({