@local-civics/mgmt-ui 0.1.196 → 0.1.198

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$e = Object.defineProperty;
38
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
39
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
40
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
41
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
42
- var __spreadValues$e = (a, b) => {
37
+ var __defProp$f = Object.defineProperty;
38
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
39
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
40
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
41
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
42
+ var __spreadValues$f = (a, b) => {
43
43
  for (var prop in b || (b = {}))
44
- if (__hasOwnProp$e.call(b, prop))
45
- __defNormalProp$e(a, prop, b[prop]);
46
- if (__getOwnPropSymbols$e)
47
- for (var prop of __getOwnPropSymbols$e(b)) {
48
- if (__propIsEnum$e.call(b, prop))
49
- __defNormalProp$e(a, prop, b[prop]);
44
+ if (__hasOwnProp$f.call(b, prop))
45
+ __defNormalProp$f(a, prop, b[prop]);
46
+ if (__getOwnPropSymbols$f)
47
+ for (var prop of __getOwnPropSymbols$f(b)) {
48
+ if (__propIsEnum$f.call(b, prop))
49
+ __defNormalProp$f(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$e.call(source, prop) && exclude.indexOf(prop) < 0)
56
+ if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
57
57
  target[prop] = source[prop];
58
- if (source != null && __getOwnPropSymbols$e)
59
- for (var prop of __getOwnPropSymbols$e(source)) {
60
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
58
+ if (source != null && __getOwnPropSymbols$f)
59
+ for (var prop of __getOwnPropSymbols$f(source)) {
60
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
61
61
  target[prop] = source[prop];
62
62
  }
63
63
  return target;
64
64
  };
65
- const useStyles$w = core.createStyles((theme) => ({
65
+ const useStyles$v = core.createStyles((theme) => ({
66
66
  user: {
67
67
  display: "block",
68
68
  width: "100%",
@@ -73,8 +73,8 @@ const useStyles$w = 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$w();
77
- return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$e({ 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$v();
77
+ return /* @__PURE__ */ React__namespace.createElement(core.Group, __spreadValues$f({ 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$v = core.createStyles((theme, _params, getRef) => {
87
+ const useStyles$u = core.createStyles((theme, _params, getRef) => {
88
88
  const icon = getRef("icon");
89
89
  return {
90
90
  control: {
@@ -137,7 +137,7 @@ const useStyles$v = 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$v();
140
+ const { classes, theme, cx } = useStyles$u();
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$d = Object.defineProperty;
186
- var __defProps$9 = Object.defineProperties;
187
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
188
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
189
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
190
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
191
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
192
- var __spreadValues$d = (a, b) => {
185
+ var __defProp$e = Object.defineProperty;
186
+ var __defProps$a = Object.defineProperties;
187
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
188
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
189
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
190
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
191
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
192
+ var __spreadValues$e = (a, b) => {
193
193
  for (var prop in b || (b = {}))
194
- if (__hasOwnProp$d.call(b, prop))
195
- __defNormalProp$d(a, prop, b[prop]);
196
- if (__getOwnPropSymbols$d)
197
- for (var prop of __getOwnPropSymbols$d(b)) {
198
- if (__propIsEnum$d.call(b, prop))
199
- __defNormalProp$d(a, prop, b[prop]);
194
+ if (__hasOwnProp$e.call(b, prop))
195
+ __defNormalProp$e(a, prop, b[prop]);
196
+ if (__getOwnPropSymbols$e)
197
+ for (var prop of __getOwnPropSymbols$e(b)) {
198
+ if (__propIsEnum$e.call(b, prop))
199
+ __defNormalProp$e(a, prop, b[prop]);
200
200
  }
201
201
  return a;
202
202
  };
203
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
204
- const useStyles$u = core.createStyles((theme, _params, getRef) => {
203
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
204
+ const useStyles$t = core.createStyles((theme, _params, getRef) => {
205
205
  const icon = getRef("icon");
206
206
  return {
207
207
  navbar: {
@@ -232,7 +232,7 @@ const useStyles$u = 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$9(__spreadValues$d({}, theme.fn.focusStyles()), {
235
+ link: __spreadProps$a(__spreadValues$e({}, theme.fn.focusStyles()), {
236
236
  display: "flex",
237
237
  alignItems: "center",
238
238
  textDecoration: "none",
@@ -302,7 +302,7 @@ const TRIAL_PAGES = [
302
302
  "Badges"
303
303
  ];
304
304
  function Navbar(props) {
305
- const { classes, cx } = useStyles$u();
305
+ const { classes, cx } = useStyles$t();
306
306
  const [burgerOpen, setBurgerOpen] = React__namespace.useState(false);
307
307
  const toggle = () => setBurgerOpen(!burgerOpen);
308
308
  const links = data.map((item) => {
@@ -315,12 +315,12 @@ function Navbar(props) {
315
315
  }
316
316
  return /* @__PURE__ */ React__namespace.createElement(
317
317
  LinksGroup,
318
- __spreadProps$9(__spreadValues$d(__spreadValues$d({
318
+ __spreadProps$a(__spreadValues$e(__spreadValues$e({
319
319
  key: item.label,
320
320
  active: props.active
321
321
  }, item), context), {
322
322
  links: (item.links || []).map((link) => {
323
- return __spreadValues$d(__spreadValues$d({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
323
+ return __spreadValues$e(__spreadValues$e({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
324
324
  })
325
325
  })
326
326
  );
@@ -345,7 +345,7 @@ function Navbar(props) {
345
345
  } }, /* @__PURE__ */ React__namespace.createElement(icons.IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React__namespace.createElement("span", null, "Logout"))))));
346
346
  }
347
347
 
348
- const useStyles$t = core.createStyles((theme) => ({
348
+ const useStyles$s = core.createStyles((theme) => ({
349
349
  inner: {
350
350
  paddingTop: theme.spacing.xl,
351
351
  paddingBottom: theme.spacing.xl * 4
@@ -381,7 +381,7 @@ const useStyles$t = core.createStyles((theme) => ({
381
381
  }
382
382
  }));
383
383
  const GettingStarted = (props) => {
384
- const { classes } = useStyles$t();
384
+ const { classes } = useStyles$s();
385
385
  return /* @__PURE__ */ React__namespace.createElement(
386
386
  core.Modal,
387
387
  {
@@ -395,7 +395,7 @@ const GettingStarted = (props) => {
395
395
  );
396
396
  };
397
397
 
398
- const useStyles$s = core.createStyles((theme) => ({
398
+ const useStyles$r = core.createStyles((theme) => ({
399
399
  title: {
400
400
  fontSize: 34,
401
401
  fontWeight: 900,
@@ -436,7 +436,7 @@ const useStyles$s = core.createStyles((theme) => ({
436
436
  }
437
437
  }));
438
438
  const SwitchAccount = (props) => {
439
- const { classes, theme } = useStyles$s();
439
+ const { classes, theme } = useStyles$r();
440
440
  const options = props.accounts.map((a) => {
441
441
  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")));
442
442
  });
@@ -453,7 +453,7 @@ const SwitchAccount = (props) => {
453
453
  );
454
454
  };
455
455
 
456
- const useStyles$r = core.createStyles((theme) => ({
456
+ const useStyles$q = core.createStyles((theme) => ({
457
457
  root: {
458
458
  display: "flex",
459
459
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -497,7 +497,7 @@ const useStyles$r = core.createStyles((theme) => ({
497
497
  }
498
498
  }));
499
499
  const StatsGroup = ({ data, footer }) => {
500
- const { classes } = useStyles$r();
500
+ const { classes } = useStyles$q();
501
501
  const stats = data.map((stat) => {
502
502
  const value = (() => {
503
503
  if (stat.unit === "%") {
@@ -517,7 +517,7 @@ const Tabs = (props) => {
517
517
  return /* @__PURE__ */ React__namespace.createElement(core.Tabs, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React__namespace.createElement(core.Tabs.List, null, tabs));
518
518
  };
519
519
 
520
- const useStyles$q = core.createStyles((theme) => ({
520
+ const useStyles$p = core.createStyles((theme) => ({
521
521
  button: {
522
522
  borderTopRightRadius: 0,
523
523
  borderBottomRightRadius: 0,
@@ -532,7 +532,7 @@ const useStyles$q = core.createStyles((theme) => ({
532
532
  }
533
533
  }));
534
534
  const SplitButton$5 = (props) => {
535
- const { classes, theme } = useStyles$q();
535
+ const { classes, theme } = useStyles$p();
536
536
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
537
537
  return /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "sm" }, /* @__PURE__ */ React__namespace.createElement(
538
538
  core.Button,
@@ -560,7 +560,7 @@ const SplitButton$5 = (props) => {
560
560
  ));
561
561
  };
562
562
 
563
- const useStyles$p = core.createStyles((theme) => ({
563
+ const useStyles$o = core.createStyles((theme) => ({
564
564
  wrapper: {
565
565
  display: "flex",
566
566
  alignItems: "center",
@@ -611,7 +611,7 @@ const useStyles$p = core.createStyles((theme) => ({
611
611
  }
612
612
  }));
613
613
  const PlaceholderBanner = (props) => {
614
- const { classes } = useStyles$p();
614
+ const { classes } = useStyles$o();
615
615
  const title = props.title || "Nothing to display";
616
616
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
617
617
  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 }));
@@ -663,28 +663,28 @@ function useSortableData(items, config = { key: "", direction: null }) {
663
663
  return { items: sortedItems, requestSort, sortConfig };
664
664
  }
665
665
 
666
- var __defProp$c = Object.defineProperty;
667
- var __defProps$8 = Object.defineProperties;
668
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
669
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
670
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
671
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
672
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
673
- var __spreadValues$c = (a, b) => {
666
+ var __defProp$d = Object.defineProperty;
667
+ var __defProps$9 = Object.defineProperties;
668
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
669
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
670
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
671
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
672
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
673
+ var __spreadValues$d = (a, b) => {
674
674
  for (var prop in b || (b = {}))
675
- if (__hasOwnProp$c.call(b, prop))
676
- __defNormalProp$c(a, prop, b[prop]);
677
- if (__getOwnPropSymbols$c)
678
- for (var prop of __getOwnPropSymbols$c(b)) {
679
- if (__propIsEnum$c.call(b, prop))
680
- __defNormalProp$c(a, prop, b[prop]);
675
+ if (__hasOwnProp$d.call(b, prop))
676
+ __defNormalProp$d(a, prop, b[prop]);
677
+ if (__getOwnPropSymbols$d)
678
+ for (var prop of __getOwnPropSymbols$d(b)) {
679
+ if (__propIsEnum$d.call(b, prop))
680
+ __defNormalProp$d(a, prop, b[prop]);
681
681
  }
682
682
  return a;
683
683
  };
684
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
684
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
685
685
  function Table$k(props) {
686
686
  const preparedItems = React__namespace.useMemo(() => {
687
- return props.items.map((item) => __spreadProps$8(__spreadValues$c({}, item), {
687
+ return props.items.map((item) => __spreadProps$9(__spreadValues$d({}, item), {
688
688
  status: item.isComplete ? 1 : 0
689
689
  }));
690
690
  }, [props.items]);
@@ -781,7 +781,7 @@ function Table$j(props) {
781
781
  ));
782
782
  }
783
783
 
784
- const useStyles$o = core.createStyles((theme) => ({
784
+ const useStyles$n = core.createStyles((theme) => ({
785
785
  title: {
786
786
  fontSize: 34,
787
787
  fontWeight: 900,
@@ -794,7 +794,7 @@ const useStyles$o = core.createStyles((theme) => ({
794
794
  }
795
795
  }));
796
796
  const Badge = (props) => {
797
- const { classes } = useStyles$o();
797
+ const { classes } = useStyles$n();
798
798
  const [tab, setTab] = React.useState("lessons");
799
799
  const numberOfStudents = props.students.length;
800
800
  const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -892,7 +892,7 @@ function Table$i(props) {
892
892
  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)));
893
893
  }
894
894
 
895
- const useStyles$n = core.createStyles((theme) => ({
895
+ const useStyles$m = core.createStyles((theme) => ({
896
896
  title: {
897
897
  fontSize: 34,
898
898
  fontWeight: 900,
@@ -905,7 +905,7 @@ const useStyles$n = core.createStyles((theme) => ({
905
905
  }
906
906
  }));
907
907
  const Badges = (props) => {
908
- const { classes } = useStyles$n();
908
+ const { classes } = useStyles$m();
909
909
  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(
910
910
  core.Autocomplete,
911
911
  {
@@ -1135,28 +1135,28 @@ const SplitButton$4 = (props) => {
1135
1135
  ));
1136
1136
  };
1137
1137
 
1138
- var __defProp$b = Object.defineProperty;
1139
- var __defProps$7 = Object.defineProperties;
1140
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1141
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1142
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1143
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1144
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1145
- var __spreadValues$b = (a, b) => {
1138
+ var __defProp$c = Object.defineProperty;
1139
+ var __defProps$8 = Object.defineProperties;
1140
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1141
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
1142
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
1143
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
1144
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1145
+ var __spreadValues$c = (a, b) => {
1146
1146
  for (var prop in b || (b = {}))
1147
- if (__hasOwnProp$b.call(b, prop))
1148
- __defNormalProp$b(a, prop, b[prop]);
1149
- if (__getOwnPropSymbols$b)
1150
- for (var prop of __getOwnPropSymbols$b(b)) {
1151
- if (__propIsEnum$b.call(b, prop))
1152
- __defNormalProp$b(a, prop, b[prop]);
1147
+ if (__hasOwnProp$c.call(b, prop))
1148
+ __defNormalProp$c(a, prop, b[prop]);
1149
+ if (__getOwnPropSymbols$c)
1150
+ for (var prop of __getOwnPropSymbols$c(b)) {
1151
+ if (__propIsEnum$c.call(b, prop))
1152
+ __defNormalProp$c(a, prop, b[prop]);
1153
1153
  }
1154
1154
  return a;
1155
1155
  };
1156
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1156
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1157
1157
  function Table$c(props) {
1158
1158
  const preparedItems = React__namespace.useMemo(() => {
1159
- return props.items.map((item) => __spreadProps$7(__spreadValues$b({}, item), {
1159
+ return props.items.map((item) => __spreadProps$8(__spreadValues$c({}, item), {
1160
1160
  fullName: item.givenName && item.familyName ? `${item.givenName} ${item.familyName}`.toLowerCase() : item.email.toLowerCase()
1161
1161
  }));
1162
1162
  }, [props.items]);
@@ -1253,26 +1253,26 @@ function Table$c(props) {
1253
1253
  ));
1254
1254
  }
1255
1255
 
1256
- var __defProp$a = Object.defineProperty;
1257
- var __defProps$6 = Object.defineProperties;
1258
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1259
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1260
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1261
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1262
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1263
- var __spreadValues$a = (a, b) => {
1256
+ var __defProp$b = Object.defineProperty;
1257
+ var __defProps$7 = Object.defineProperties;
1258
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1259
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1260
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1261
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1262
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1263
+ var __spreadValues$b = (a, b) => {
1264
1264
  for (var prop in b || (b = {}))
1265
- if (__hasOwnProp$a.call(b, prop))
1266
- __defNormalProp$a(a, prop, b[prop]);
1267
- if (__getOwnPropSymbols$a)
1268
- for (var prop of __getOwnPropSymbols$a(b)) {
1269
- if (__propIsEnum$a.call(b, prop))
1270
- __defNormalProp$a(a, prop, b[prop]);
1265
+ if (__hasOwnProp$b.call(b, prop))
1266
+ __defNormalProp$b(a, prop, b[prop]);
1267
+ if (__getOwnPropSymbols$b)
1268
+ for (var prop of __getOwnPropSymbols$b(b)) {
1269
+ if (__propIsEnum$b.call(b, prop))
1270
+ __defNormalProp$b(a, prop, b[prop]);
1271
1271
  }
1272
1272
  return a;
1273
1273
  };
1274
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1275
- const useStyles$m = core.createStyles((theme) => ({
1274
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1275
+ const useStyles$l = core.createStyles((theme) => ({
1276
1276
  title: {
1277
1277
  fontSize: 34,
1278
1278
  fontWeight: 900,
@@ -1305,7 +1305,7 @@ const useStyles$m = core.createStyles((theme) => ({
1305
1305
  }
1306
1306
  }));
1307
1307
  const Class = (props) => {
1308
- const { classes } = useStyles$m();
1308
+ const { classes } = useStyles$l();
1309
1309
  const form$1 = form.useForm({
1310
1310
  initialValues: {
1311
1311
  classId: "",
@@ -1337,27 +1337,27 @@ const Class = (props) => {
1337
1337
  padding: "xl",
1338
1338
  size: "xl"
1339
1339
  },
1340
- /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$6(__spreadValues$a({}, 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(() => {
1340
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton$1, __spreadProps$7(__spreadValues$b({}, 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(() => {
1341
1341
  const values = form$1.values;
1342
1342
  form$1.reset();
1343
1343
  setOpened(false);
1344
1344
  props.onCreateMembers && props.onCreateMembers([values]);
1345
1345
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1346
1346
  core.TextInput,
1347
- __spreadValues$a({
1347
+ __spreadValues$b({
1348
1348
  withAsterisk: true,
1349
1349
  label: "Email",
1350
1350
  placeholder: "Email"
1351
1351
  }, form$1.getInputProps("email"))
1352
1352
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
1353
1353
  core.TextInput,
1354
- __spreadValues$a({
1354
+ __spreadValues$b({
1355
1355
  label: "Given name",
1356
1356
  placeholder: "Given name"
1357
1357
  }, form$1.getInputProps("givenName"))
1358
1358
  ), /* @__PURE__ */ React__namespace.createElement(
1359
1359
  core.TextInput,
1360
- __spreadValues$a({
1360
+ __spreadValues$b({
1361
1361
  label: "Family name",
1362
1362
  placeholder: "Family name"
1363
1363
  }, form$1.getInputProps("familyName"))
@@ -1406,7 +1406,7 @@ const Class = (props) => {
1406
1406
  ))))));
1407
1407
  };
1408
1408
  const DropzoneButton$1 = (props) => {
1409
- const { classes, theme } = useStyles$m();
1409
+ const { classes, theme } = useStyles$l();
1410
1410
  const openRef = React__namespace.useRef(null);
1411
1411
  const [loading, setLoading] = React__namespace.useState(false);
1412
1412
  const onDrop = React__namespace.useCallback((acceptedFiles) => {
@@ -1452,21 +1452,6 @@ const DropzoneButton$1 = (props) => {
1452
1452
  } }, "Select file"));
1453
1453
  };
1454
1454
 
1455
- const useStyles$l = core.createStyles((theme) => ({
1456
- th: { padding: "0 !important" },
1457
- control: {
1458
- width: "100%",
1459
- padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
1460
- "&:hover": {
1461
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
1462
- }
1463
- }
1464
- }));
1465
- function Th({ children, reversed, sorted, onSort }) {
1466
- const { classes } = useStyles$l();
1467
- const Icon = sorted ? reversed ? icons.IconChevronUp : icons.IconChevronDown : icons.IconSelector;
1468
- 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 })))));
1469
- }
1470
1455
  function Table$b(props) {
1471
1456
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1472
1457
  if (props.items.length === 0) {
@@ -1488,39 +1473,64 @@ function Table$b(props) {
1488
1473
  confirmProps: { color: "red" },
1489
1474
  onConfirm: () => props.onDeleteClass(group)
1490
1475
  });
1491
- 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 }))))));
1492
- 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(
1493
- Th,
1494
- {
1495
- sorted: sortConfig.key === "name",
1496
- reversed: sortConfig.direction === "desc",
1497
- onSort: () => requestSort("name")
1498
- },
1499
- "Class Name"
1500
- ), /* @__PURE__ */ React__namespace.createElement("th", { style: { padding: "7px 16px" } }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: 500, size: "sm" }, "Description")), /* @__PURE__ */ React__namespace.createElement(
1501
- Th,
1476
+ const sortStatus = {
1477
+ columnAccessor: sortConfig.key,
1478
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
1479
+ };
1480
+ return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
1481
+ mantineDatatable.DataTable,
1502
1482
  {
1503
- sorted: sortConfig.key === "numberOfStudents",
1504
- reversed: sortConfig.direction === "desc",
1505
- onSort: () => requestSort("numberOfStudents")
1506
- },
1507
- "# of Students"
1508
- ), /* @__PURE__ */ React__namespace.createElement("th", null))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
1483
+ withBorder: false,
1484
+ borderRadius: "sm",
1485
+ verticalSpacing: "sm",
1486
+ sx: { minWidth: 700 },
1487
+ highlightOnHover: true,
1488
+ striped: true,
1489
+ records: sortedItems,
1490
+ idAccessor: "classId",
1491
+ sortStatus,
1492
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
1493
+ columns: [
1494
+ {
1495
+ accessor: "name",
1496
+ title: "Class Name",
1497
+ sortable: true,
1498
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: reactRouterDom.Link, to: row.href }, /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14, weight: 500 }, row.name))
1499
+ },
1500
+ {
1501
+ accessor: "description",
1502
+ title: "Description",
1503
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.description)
1504
+ },
1505
+ {
1506
+ accessor: "numberOfStudents",
1507
+ title: "# of Students",
1508
+ sortable: true,
1509
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Text, { size: 14 }, row.numberOfStudents || 0)
1510
+ },
1511
+ {
1512
+ accessor: "actions",
1513
+ title: "",
1514
+ render: (row) => /* @__PURE__ */ React__namespace.createElement(core.Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React__namespace.createElement(core.ActionIcon, { color: "red", onClick: () => openDeleteModal(row) }, /* @__PURE__ */ React__namespace.createElement(icons.IconTrash, { size: 16, stroke: 1.5 })))
1515
+ }
1516
+ ]
1517
+ }
1518
+ ));
1509
1519
  }
1510
1520
 
1511
- var __defProp$9 = Object.defineProperty;
1512
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1513
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1514
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1515
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1516
- var __spreadValues$9 = (a, b) => {
1521
+ var __defProp$a = Object.defineProperty;
1522
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1523
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1524
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1525
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1526
+ var __spreadValues$a = (a, b) => {
1517
1527
  for (var prop in b || (b = {}))
1518
- if (__hasOwnProp$9.call(b, prop))
1519
- __defNormalProp$9(a, prop, b[prop]);
1520
- if (__getOwnPropSymbols$9)
1521
- for (var prop of __getOwnPropSymbols$9(b)) {
1522
- if (__propIsEnum$9.call(b, prop))
1523
- __defNormalProp$9(a, prop, b[prop]);
1528
+ if (__hasOwnProp$a.call(b, prop))
1529
+ __defNormalProp$a(a, prop, b[prop]);
1530
+ if (__getOwnPropSymbols$a)
1531
+ for (var prop of __getOwnPropSymbols$a(b)) {
1532
+ if (__propIsEnum$a.call(b, prop))
1533
+ __defNormalProp$a(a, prop, b[prop]);
1524
1534
  }
1525
1535
  return a;
1526
1536
  };
@@ -1567,14 +1577,14 @@ const Classes = (props) => {
1567
1577
  props.onCreateClass && props.onCreateClass(values);
1568
1578
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
1569
1579
  core.TextInput,
1570
- __spreadValues$9({
1580
+ __spreadValues$a({
1571
1581
  withAsterisk: true,
1572
1582
  label: "Name",
1573
1583
  placeholder: "Class name"
1574
1584
  }, form$1.getInputProps("name"))
1575
1585
  ), /* @__PURE__ */ React__namespace.createElement(
1576
1586
  core.TextInput,
1577
- __spreadValues$9({
1587
+ __spreadValues$a({
1578
1588
  label: "Description",
1579
1589
  placeholder: "A class for my first period English students"
1580
1590
  }, form$1.getInputProps("description"))
@@ -1804,30 +1814,30 @@ function CardGradient(props) {
1804
1814
  ), /* @__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));
1805
1815
  }
1806
1816
 
1807
- var __defProp$8 = Object.defineProperty;
1808
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1809
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1810
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1811
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1812
- var __spreadValues$8 = (a, b) => {
1817
+ var __defProp$9 = Object.defineProperty;
1818
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1819
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1820
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1821
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1822
+ var __spreadValues$9 = (a, b) => {
1813
1823
  for (var prop in b || (b = {}))
1814
- if (__hasOwnProp$8.call(b, prop))
1815
- __defNormalProp$8(a, prop, b[prop]);
1816
- if (__getOwnPropSymbols$8)
1817
- for (var prop of __getOwnPropSymbols$8(b)) {
1818
- if (__propIsEnum$8.call(b, prop))
1819
- __defNormalProp$8(a, prop, b[prop]);
1824
+ if (__hasOwnProp$9.call(b, prop))
1825
+ __defNormalProp$9(a, prop, b[prop]);
1826
+ if (__getOwnPropSymbols$9)
1827
+ for (var prop of __getOwnPropSymbols$9(b)) {
1828
+ if (__propIsEnum$9.call(b, prop))
1829
+ __defNormalProp$9(a, prop, b[prop]);
1820
1830
  }
1821
1831
  return a;
1822
1832
  };
1823
1833
  var __objRest$1 = (source, exclude) => {
1824
1834
  var target = {};
1825
1835
  for (var prop in source)
1826
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1836
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1827
1837
  target[prop] = source[prop];
1828
- if (source != null && __getOwnPropSymbols$8)
1829
- for (var prop of __getOwnPropSymbols$8(source)) {
1830
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
1838
+ if (source != null && __getOwnPropSymbols$9)
1839
+ for (var prop of __getOwnPropSymbols$9(source)) {
1840
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
1831
1841
  target[prop] = source[prop];
1832
1842
  }
1833
1843
  return target;
@@ -1894,9 +1904,9 @@ const TenantBanner = (_a) => {
1894
1904
  };
1895
1905
  return /* @__PURE__ */ React__namespace.createElement(
1896
1906
  core.Card,
1897
- __spreadValues$8({
1907
+ __spreadValues$9({
1898
1908
  radius: "md",
1899
- style: __spreadValues$8({ backgroundImage: `url(${image})` }, style),
1909
+ style: __spreadValues$9({ backgroundImage: `url(${image})` }, style),
1900
1910
  className: cx(classes.card, className)
1901
1911
  }, others),
1902
1912
  /* @__PURE__ */ React__namespace.createElement(
@@ -2069,31 +2079,36 @@ function Stack$3(props) {
2069
2079
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.UnstyledButton, { component: reactRouterDom.Link, to: props.href }, /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: 24, sx: { padding: 20, minWidth: 700 } }, rows)));
2070
2080
  }
2071
2081
 
2072
- var __defProp$7 = Object.defineProperty;
2073
- var __defProps$5 = Object.defineProperties;
2074
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2075
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
2076
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
2077
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
2078
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2079
- var __spreadValues$7 = (a, b) => {
2082
+ var __defProp$8 = Object.defineProperty;
2083
+ var __defProps$6 = Object.defineProperties;
2084
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
2085
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
2086
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
2087
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
2088
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2089
+ var __spreadValues$8 = (a, b) => {
2080
2090
  for (var prop in b || (b = {}))
2081
- if (__hasOwnProp$7.call(b, prop))
2082
- __defNormalProp$7(a, prop, b[prop]);
2083
- if (__getOwnPropSymbols$7)
2084
- for (var prop of __getOwnPropSymbols$7(b)) {
2085
- if (__propIsEnum$7.call(b, prop))
2086
- __defNormalProp$7(a, prop, b[prop]);
2091
+ if (__hasOwnProp$8.call(b, prop))
2092
+ __defNormalProp$8(a, prop, b[prop]);
2093
+ if (__getOwnPropSymbols$8)
2094
+ for (var prop of __getOwnPropSymbols$8(b)) {
2095
+ if (__propIsEnum$8.call(b, prop))
2096
+ __defNormalProp$8(a, prop, b[prop]);
2087
2097
  }
2088
2098
  return a;
2089
2099
  };
2090
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2100
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
2091
2101
  function Table$6(props) {
2092
2102
  const preparedItems = React__namespace.useMemo(() => {
2093
- return props.items.map((item) => __spreadProps$5(__spreadValues$7({}, item), {
2103
+ return props.items.map((item) => __spreadProps$6(__spreadValues$8({}, item), {
2094
2104
  status: item.isComplete ? 2 : item.isStarted ? 1 : 0
2095
2105
  }));
2096
2106
  }, [props.items]);
2107
+ const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2108
+ const sortStatus = {
2109
+ columnAccessor: sortConfig.key,
2110
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
2111
+ };
2097
2112
  if (props.items.length === 0) {
2098
2113
  return /* @__PURE__ */ React__namespace.createElement(
2099
2114
  PlaceholderBanner,
@@ -2105,11 +2120,6 @@ function Table$6(props) {
2105
2120
  }
2106
2121
  );
2107
2122
  }
2108
- const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
2109
- const sortStatus = {
2110
- columnAccessor: sortConfig.key,
2111
- direction: sortConfig.direction === "desc" ? "desc" : "asc"
2112
- };
2113
2123
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(
2114
2124
  mantineDatatable.DataTable,
2115
2125
  {
@@ -2577,25 +2587,25 @@ function Table$4(props) {
2577
2587
  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)));
2578
2588
  }
2579
2589
 
2580
- var __defProp$6 = Object.defineProperty;
2581
- var __defProps$4 = Object.defineProperties;
2582
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2583
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
2584
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
2585
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
2586
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2587
- var __spreadValues$6 = (a, b) => {
2590
+ var __defProp$7 = Object.defineProperty;
2591
+ var __defProps$5 = Object.defineProperties;
2592
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
2593
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
2594
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
2595
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
2596
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2597
+ var __spreadValues$7 = (a, b) => {
2588
2598
  for (var prop in b || (b = {}))
2589
- if (__hasOwnProp$6.call(b, prop))
2590
- __defNormalProp$6(a, prop, b[prop]);
2591
- if (__getOwnPropSymbols$6)
2592
- for (var prop of __getOwnPropSymbols$6(b)) {
2593
- if (__propIsEnum$6.call(b, prop))
2594
- __defNormalProp$6(a, prop, b[prop]);
2599
+ if (__hasOwnProp$7.call(b, prop))
2600
+ __defNormalProp$7(a, prop, b[prop]);
2601
+ if (__getOwnPropSymbols$7)
2602
+ for (var prop of __getOwnPropSymbols$7(b)) {
2603
+ if (__propIsEnum$7.call(b, prop))
2604
+ __defNormalProp$7(a, prop, b[prop]);
2595
2605
  }
2596
2606
  return a;
2597
2607
  };
2598
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2608
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2599
2609
  const useStyles$a = core.createStyles((theme) => ({
2600
2610
  title: {
2601
2611
  fontSize: 34,
@@ -2657,27 +2667,27 @@ const People = (props) => {
2657
2667
  padding: "xl",
2658
2668
  size: "xl"
2659
2669
  },
2660
- /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps$4(__spreadValues$6({}, 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(() => {
2670
+ /* @__PURE__ */ React__namespace.createElement(core.Stack, { spacing: "md" }, /* @__PURE__ */ React__namespace.createElement(DropzoneButton, __spreadProps$5(__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(() => {
2661
2671
  const values = form$1.values;
2662
2672
  form$1.reset();
2663
2673
  setOpened(false);
2664
2674
  props.onCreateUsers && props.onCreateUsers([values]);
2665
2675
  }) }, /* @__PURE__ */ React__namespace.createElement(core.Stack, null, /* @__PURE__ */ React__namespace.createElement(
2666
2676
  core.TextInput,
2667
- __spreadValues$6({
2677
+ __spreadValues$7({
2668
2678
  withAsterisk: true,
2669
2679
  label: "Email",
2670
2680
  placeholder: "Email"
2671
2681
  }, form$1.getInputProps("email"))
2672
2682
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { grow: true }, /* @__PURE__ */ React__namespace.createElement(
2673
2683
  core.TextInput,
2674
- __spreadValues$6({
2684
+ __spreadValues$7({
2675
2685
  label: "Given name",
2676
2686
  placeholder: "Given name"
2677
2687
  }, form$1.getInputProps("givenName"))
2678
2688
  ), /* @__PURE__ */ React__namespace.createElement(
2679
2689
  core.TextInput,
2680
- __spreadValues$6({
2690
+ __spreadValues$7({
2681
2691
  label: "Family name",
2682
2692
  placeholder: "Family name"
2683
2693
  }, form$1.getInputProps("familyName"))
@@ -2863,24 +2873,24 @@ const StartAnonymousLesson = (props) => {
2863
2873
  ))))));
2864
2874
  };
2865
2875
 
2866
- var __defProp$5 = Object.defineProperty;
2867
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
2868
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
2869
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
2870
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2871
- var __spreadValues$5 = (a, b) => {
2876
+ var __defProp$6 = Object.defineProperty;
2877
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
2878
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
2879
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
2880
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2881
+ var __spreadValues$6 = (a, b) => {
2872
2882
  for (var prop in b || (b = {}))
2873
- if (__hasOwnProp$5.call(b, prop))
2874
- __defNormalProp$5(a, prop, b[prop]);
2875
- if (__getOwnPropSymbols$5)
2876
- for (var prop of __getOwnPropSymbols$5(b)) {
2877
- if (__propIsEnum$5.call(b, prop))
2878
- __defNormalProp$5(a, prop, b[prop]);
2883
+ if (__hasOwnProp$6.call(b, prop))
2884
+ __defNormalProp$6(a, prop, b[prop]);
2885
+ if (__getOwnPropSymbols$6)
2886
+ for (var prop of __getOwnPropSymbols$6(b)) {
2887
+ if (__propIsEnum$6.call(b, prop))
2888
+ __defNormalProp$6(a, prop, b[prop]);
2879
2889
  }
2880
2890
  return a;
2881
2891
  };
2882
2892
  const BadgeGrid = (props) => {
2883
- const badges = props.badges.map((b) => /* @__PURE__ */ React__namespace.createElement(TaskCard, __spreadValues$5({ key: b.title }, b)));
2893
+ const badges = props.badges.map((b) => /* @__PURE__ */ React__namespace.createElement(TaskCard, __spreadValues$6({ key: b.title }, b)));
2884
2894
  return /* @__PURE__ */ React__namespace.createElement(core.SimpleGrid, { cols: 4, breakpoints: [{ maxWidth: "sm", cols: 1 }, { maxWidth: "md", cols: 3 }] }, badges);
2885
2895
  };
2886
2896
  function TaskCard(props) {
@@ -2944,33 +2954,33 @@ const TrialHome = (props) => {
2944
2954
  )), /* @__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 })));
2945
2955
  };
2946
2956
 
2947
- var __defProp$4 = Object.defineProperty;
2948
- var __defProps$3 = Object.defineProperties;
2949
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
2950
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
2951
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
2952
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
2953
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2954
- var __spreadValues$4 = (a, b) => {
2957
+ var __defProp$5 = Object.defineProperty;
2958
+ var __defProps$4 = Object.defineProperties;
2959
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
2960
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
2961
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
2962
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
2963
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2964
+ var __spreadValues$5 = (a, b) => {
2955
2965
  for (var prop in b || (b = {}))
2956
- if (__hasOwnProp$4.call(b, prop))
2957
- __defNormalProp$4(a, prop, b[prop]);
2958
- if (__getOwnPropSymbols$4)
2959
- for (var prop of __getOwnPropSymbols$4(b)) {
2960
- if (__propIsEnum$4.call(b, prop))
2961
- __defNormalProp$4(a, prop, b[prop]);
2966
+ if (__hasOwnProp$5.call(b, prop))
2967
+ __defNormalProp$5(a, prop, b[prop]);
2968
+ if (__getOwnPropSymbols$5)
2969
+ for (var prop of __getOwnPropSymbols$5(b)) {
2970
+ if (__propIsEnum$5.call(b, prop))
2971
+ __defNormalProp$5(a, prop, b[prop]);
2962
2972
  }
2963
2973
  return a;
2964
2974
  };
2965
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
2975
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
2966
2976
  var __objRest = (source, exclude) => {
2967
2977
  var target = {};
2968
2978
  for (var prop in source)
2969
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
2979
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
2970
2980
  target[prop] = source[prop];
2971
- if (source != null && __getOwnPropSymbols$4)
2972
- for (var prop of __getOwnPropSymbols$4(source)) {
2973
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
2981
+ if (source != null && __getOwnPropSymbols$5)
2982
+ for (var prop of __getOwnPropSymbols$5(source)) {
2983
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
2974
2984
  target[prop] = source[prop];
2975
2985
  }
2976
2986
  return target;
@@ -3020,7 +3030,7 @@ function ImageCheckbox(_a) {
3020
3030
  const { classes, cx } = useStyles$7({ checked: value });
3021
3031
  return /* @__PURE__ */ React__namespace.createElement(
3022
3032
  core.UnstyledButton,
3023
- __spreadProps$3(__spreadValues$4({}, others), {
3033
+ __spreadProps$4(__spreadValues$5({}, others), {
3024
3034
  onClick: () => handleChange(!value),
3025
3035
  className: cx(classes.button, className)
3026
3036
  }),
@@ -3041,7 +3051,7 @@ function ImageCheckbox(_a) {
3041
3051
  function SelectGrid(props) {
3042
3052
  const items = props.items.map((item) => /* @__PURE__ */ React__namespace.createElement(
3043
3053
  ImageCheckbox,
3044
- __spreadProps$3(__spreadValues$4({}, item), {
3054
+ __spreadProps$4(__spreadValues$5({}, item), {
3045
3055
  key: item.title,
3046
3056
  onChange: (checked) => props.onChange(item.title, checked)
3047
3057
  })
@@ -3059,25 +3069,25 @@ function SelectGrid(props) {
3059
3069
  );
3060
3070
  }
3061
3071
 
3062
- var __defProp$3 = Object.defineProperty;
3063
- var __defProps$2 = Object.defineProperties;
3064
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
3065
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
3066
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
3067
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
3068
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3069
- var __spreadValues$3 = (a, b) => {
3072
+ var __defProp$4 = Object.defineProperty;
3073
+ var __defProps$3 = Object.defineProperties;
3074
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
3075
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
3076
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
3077
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
3078
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3079
+ var __spreadValues$4 = (a, b) => {
3070
3080
  for (var prop in b || (b = {}))
3071
- if (__hasOwnProp$3.call(b, prop))
3072
- __defNormalProp$3(a, prop, b[prop]);
3073
- if (__getOwnPropSymbols$3)
3074
- for (var prop of __getOwnPropSymbols$3(b)) {
3075
- if (__propIsEnum$3.call(b, prop))
3076
- __defNormalProp$3(a, prop, b[prop]);
3081
+ if (__hasOwnProp$4.call(b, prop))
3082
+ __defNormalProp$4(a, prop, b[prop]);
3083
+ if (__getOwnPropSymbols$4)
3084
+ for (var prop of __getOwnPropSymbols$4(b)) {
3085
+ if (__propIsEnum$4.call(b, prop))
3086
+ __defNormalProp$4(a, prop, b[prop]);
3077
3087
  }
3078
3088
  return a;
3079
3089
  };
3080
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3090
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
3081
3091
  const useStyles$6 = core.createStyles((theme) => ({
3082
3092
  wrapper: {
3083
3093
  minHeight: "100%",
@@ -3187,7 +3197,7 @@ const TrialRegistration = (props) => {
3187
3197
  label: "School/Organization Name",
3188
3198
  placeholder: "What's the name of your school?",
3189
3199
  data: props.organizations.map((o) => {
3190
- return __spreadProps$2(__spreadValues$3({}, o), { value: o.displayName });
3200
+ return __spreadProps$3(__spreadValues$4({}, o), { value: o.displayName });
3191
3201
  }),
3192
3202
  onItemSubmit: (item) => setOrganization({ organizationId: item.organizationId, displayName: item.displayName }),
3193
3203
  onChange: (next) => {
@@ -3199,7 +3209,7 @@ const TrialRegistration = (props) => {
3199
3209
  SelectGrid,
3200
3210
  {
3201
3211
  items: OPTIONS,
3202
- onChange: (e, checked) => setInterests(__spreadProps$2(__spreadValues$3({}, interests), { [e]: checked }))
3212
+ onChange: (e, checked) => setInterests(__spreadProps$3(__spreadValues$4({}, interests), { [e]: checked }))
3203
3213
  }
3204
3214
  ), /* @__PURE__ */ React__namespace.createElement(core.Group, { position: "right", mt: "md" }, /* @__PURE__ */ React__namespace.createElement(
3205
3215
  core.Button,
@@ -3237,25 +3247,25 @@ const AdminProvider = (props) => {
3237
3247
  );
3238
3248
  };
3239
3249
 
3240
- var __defProp$2 = Object.defineProperty;
3241
- var __defProps$1 = Object.defineProperties;
3242
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3243
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
3244
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
3245
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
3246
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3247
- var __spreadValues$2 = (a, b) => {
3250
+ var __defProp$3 = Object.defineProperty;
3251
+ var __defProps$2 = Object.defineProperties;
3252
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
3253
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
3254
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
3255
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
3256
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3257
+ var __spreadValues$3 = (a, b) => {
3248
3258
  for (var prop in b || (b = {}))
3249
- if (__hasOwnProp$2.call(b, prop))
3250
- __defNormalProp$2(a, prop, b[prop]);
3251
- if (__getOwnPropSymbols$2)
3252
- for (var prop of __getOwnPropSymbols$2(b)) {
3253
- if (__propIsEnum$2.call(b, prop))
3254
- __defNormalProp$2(a, prop, b[prop]);
3259
+ if (__hasOwnProp$3.call(b, prop))
3260
+ __defNormalProp$3(a, prop, b[prop]);
3261
+ if (__getOwnPropSymbols$3)
3262
+ for (var prop of __getOwnPropSymbols$3(b)) {
3263
+ if (__propIsEnum$3.call(b, prop))
3264
+ __defNormalProp$3(a, prop, b[prop]);
3255
3265
  }
3256
3266
  return a;
3257
3267
  };
3258
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3268
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3259
3269
  const useStyles$5 = core.createStyles((theme, props) => ({
3260
3270
  footer: {
3261
3271
  paddingTop: theme.spacing.md,
@@ -3351,7 +3361,7 @@ const App = (props) => {
3351
3361
  padding: "xs",
3352
3362
  navbar: props.navbar && /* @__PURE__ */ React__namespace.createElement(
3353
3363
  Navbar,
3354
- __spreadProps$1(__spreadValues$2({}, props.navbar.props), {
3364
+ __spreadProps$2(__spreadValues$3({}, props.navbar.props), {
3355
3365
  onSwitchAccounts: account.accounts && account.accounts.length > 1 ? () => account.setChangeModalOpen(true) : void 0
3356
3366
  })
3357
3367
  ),
@@ -3544,25 +3554,25 @@ function Stack$1(props) {
3544
3554
  return /* @__PURE__ */ React__namespace.createElement(core.Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
3545
3555
  }
3546
3556
 
3547
- var __defProp$1 = Object.defineProperty;
3548
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3549
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
3550
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
3551
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3552
- var __spreadValues$1 = (a, b) => {
3557
+ var __defProp$2 = Object.defineProperty;
3558
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
3559
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
3560
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
3561
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3562
+ var __spreadValues$2 = (a, b) => {
3553
3563
  for (var prop in b || (b = {}))
3554
- if (__hasOwnProp$1.call(b, prop))
3555
- __defNormalProp$1(a, prop, b[prop]);
3556
- if (__getOwnPropSymbols$1)
3557
- for (var prop of __getOwnPropSymbols$1(b)) {
3558
- if (__propIsEnum$1.call(b, prop))
3559
- __defNormalProp$1(a, prop, b[prop]);
3564
+ if (__hasOwnProp$2.call(b, prop))
3565
+ __defNormalProp$2(a, prop, b[prop]);
3566
+ if (__getOwnPropSymbols$2)
3567
+ for (var prop of __getOwnPropSymbols$2(b)) {
3568
+ if (__propIsEnum$2.call(b, prop))
3569
+ __defNormalProp$2(a, prop, b[prop]);
3560
3570
  }
3561
3571
  return a;
3562
3572
  };
3563
3573
  function Table$2(props) {
3564
3574
  const preparedItems = React__namespace.useMemo(() => {
3565
- return (props.items || []).map((item) => __spreadValues$1(__spreadValues$1({}, item), item.categoryPoints));
3575
+ return (props.items || []).map((item) => __spreadValues$2(__spreadValues$2({}, item), item.categoryPoints));
3566
3576
  }, [props.items]);
3567
3577
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3568
3578
  if (props.loading && props.items.length === 0) {
@@ -3818,9 +3828,10 @@ const SplitButton = (props) => {
3818
3828
  };
3819
3829
 
3820
3830
  function Stack(props) {
3821
- if (!props.items.length)
3831
+ const { items, hideBadge, hideLesson } = props;
3832
+ if (!items.length)
3822
3833
  return null;
3823
- return /* @__PURE__ */ React__namespace.createElement(core.Grid, { gutter: "md", sx: { padding: 20, minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dark.4", weight: "bold", size: "md" }, "Link")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dark.4", weight: "bold", size: "md" }, "Badge")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dark.4", weight: "bold", size: "md" }, "Lesson")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dark.4", weight: "bold", size: "md" }, "Question")), props.items.map((row, i) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: i }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(
3834
+ return /* @__PURE__ */ React__namespace.createElement(core.Grid, { gutter: "md", sx: { padding: 20, minWidth: 700 } }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dark.4", weight: "bold", size: "md" }, "Link")), !hideBadge && /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: "bold" }, "Badge")), !hideLesson && /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { weight: "bold" }, "Lesson")), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { color: "dark.4", weight: "bold", size: "md" }, "Question")), items.map((row, i) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, { key: i }, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(
3824
3835
  core.Button,
3825
3836
  {
3826
3837
  component: "a",
@@ -3831,33 +3842,33 @@ function Stack(props) {
3831
3842
  variant: "light"
3832
3843
  },
3833
3844
  "View File"
3834
- )), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.badgeName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.lessonName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.question)))));
3845
+ )), !hideBadge && /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.badgeName)), !hideLesson && /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.lessonName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 3 }, /* @__PURE__ */ React__namespace.createElement(core.Text, null, row.question)))));
3835
3846
  }
3836
3847
 
3837
- var __defProp = Object.defineProperty;
3838
- var __defProps = Object.defineProperties;
3839
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3840
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3841
- var __hasOwnProp = Object.prototype.hasOwnProperty;
3842
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
3843
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3844
- var __spreadValues = (a, b) => {
3848
+ var __defProp$1 = Object.defineProperty;
3849
+ var __defProps$1 = Object.defineProperties;
3850
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
3851
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
3852
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
3853
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
3854
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3855
+ var __spreadValues$1 = (a, b) => {
3845
3856
  for (var prop in b || (b = {}))
3846
- if (__hasOwnProp.call(b, prop))
3847
- __defNormalProp(a, prop, b[prop]);
3848
- if (__getOwnPropSymbols)
3849
- for (var prop of __getOwnPropSymbols(b)) {
3850
- if (__propIsEnum.call(b, prop))
3851
- __defNormalProp(a, prop, b[prop]);
3857
+ if (__hasOwnProp$1.call(b, prop))
3858
+ __defNormalProp$1(a, prop, b[prop]);
3859
+ if (__getOwnPropSymbols$1)
3860
+ for (var prop of __getOwnPropSymbols$1(b)) {
3861
+ if (__propIsEnum$1.call(b, prop))
3862
+ __defNormalProp$1(a, prop, b[prop]);
3852
3863
  }
3853
3864
  return a;
3854
3865
  };
3855
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3866
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3856
3867
  function Table(props) {
3857
3868
  const preparedItems = React__namespace.useMemo(() => {
3858
3869
  return props.items.map((item) => {
3859
3870
  var _a;
3860
- return __spreadProps(__spreadValues({}, item), {
3871
+ return __spreadProps$1(__spreadValues$1({}, item), {
3861
3872
  submissionCount: ((_a = item.submissions) == null ? void 0 : _a.length) || 0
3862
3873
  });
3863
3874
  });
@@ -3904,12 +3915,66 @@ function Table(props) {
3904
3915
  render: (row) => row.submissions.length
3905
3916
  }],
3906
3917
  rowExpansion: {
3907
- content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack, { items: record.submissions })
3918
+ content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(
3919
+ Stack,
3920
+ {
3921
+ items: record.submissions,
3922
+ hideBadge: props.hideBadge,
3923
+ hideLesson: props.hideLesson
3924
+ }
3925
+ )
3908
3926
  }
3909
3927
  }
3910
3928
  ));
3911
3929
  }
3912
3930
 
3931
+ var __defProp = Object.defineProperty;
3932
+ var __defProps = Object.defineProperties;
3933
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
3934
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3935
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3936
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
3937
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3938
+ var __spreadValues = (a, b) => {
3939
+ for (var prop in b || (b = {}))
3940
+ if (__hasOwnProp.call(b, prop))
3941
+ __defNormalProp(a, prop, b[prop]);
3942
+ if (__getOwnPropSymbols)
3943
+ for (var prop of __getOwnPropSymbols(b)) {
3944
+ if (__propIsEnum.call(b, prop))
3945
+ __defNormalProp(a, prop, b[prop]);
3946
+ }
3947
+ return a;
3948
+ };
3949
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
3950
+ const useFilteredStudents = (students) => {
3951
+ return React__namespace.useMemo(() => {
3952
+ const byBadge = (badgeId) => students.map((s) => __spreadProps(__spreadValues({}, s), {
3953
+ submissions: (s.submissions || []).filter(
3954
+ (sub) => sub.badgeId === badgeId
3955
+ )
3956
+ })).filter((s) => s.submissions.length);
3957
+ const byLesson = (lessonName) => students.map((s) => __spreadProps(__spreadValues({}, s), {
3958
+ submissions: (s.submissions || []).filter(
3959
+ (sub) => sub.lessonName === lessonName
3960
+ )
3961
+ })).filter((s) => s.submissions.length);
3962
+ const byPathway = (pathwayId, badges) => {
3963
+ const validBadgeIds = badges.filter(
3964
+ (b) => Array.isArray(b.categories) && b.categories.some(
3965
+ (c) => c.startsWith(pathwayId)
3966
+ )
3967
+ ).map((b) => b.badgeId);
3968
+ return students.map((s) => __spreadProps(__spreadValues({}, s), {
3969
+ submissions: (s.submissions || []).filter(
3970
+ (sub) => validBadgeIds.includes(sub.badgeId)
3971
+ )
3972
+ })).filter((s) => s.submissions.length);
3973
+ };
3974
+ return { byBadge, byLesson, byPathway };
3975
+ }, [students]);
3976
+ };
3977
+
3913
3978
  const useStyles = core.createStyles((theme) => ({
3914
3979
  title: {
3915
3980
  fontSize: 34,
@@ -3922,6 +3987,43 @@ const useStyles = core.createStyles((theme) => ({
3922
3987
  maxWidth: 600
3923
3988
  }
3924
3989
  }));
3990
+ const BadgeTable = ({ badges, students, loading }) => {
3991
+ const { byBadge } = useFilteredStudents(students);
3992
+ return /* @__PURE__ */ React__namespace.createElement(core.Accordion, null, badges.map((b) => /* @__PURE__ */ React__namespace.createElement(core.Accordion.Item, { key: b.badgeId, value: b.badgeId }, /* @__PURE__ */ React__namespace.createElement(core.Accordion.Control, null, b.displayName), /* @__PURE__ */ React__namespace.createElement(core.Accordion.Panel, null, /* @__PURE__ */ React__namespace.createElement(
3993
+ Table,
3994
+ {
3995
+ loading,
3996
+ items: byBadge(b.badgeId),
3997
+ hideBadge: true
3998
+ }
3999
+ )))));
4000
+ };
4001
+ const LessonTableWrapper = ({ lessons, students, loading }) => {
4002
+ const { byLesson } = useFilteredStudents(students);
4003
+ return /* @__PURE__ */ React__namespace.createElement(core.Accordion, null, lessons.map((l) => /* @__PURE__ */ React__namespace.createElement(core.Accordion.Item, { key: l.lessonId, value: l.lessonId }, /* @__PURE__ */ React__namespace.createElement(core.Accordion.Control, null, l.lessonName), /* @__PURE__ */ React__namespace.createElement(core.Accordion.Panel, null, /* @__PURE__ */ React__namespace.createElement(
4004
+ Table,
4005
+ {
4006
+ loading,
4007
+ items: byLesson(l.lessonName),
4008
+ hideLesson: true
4009
+ }
4010
+ )))));
4011
+ };
4012
+ const PathwayTable = ({
4013
+ pathways,
4014
+ badges,
4015
+ students,
4016
+ loading
4017
+ }) => {
4018
+ const { byPathway } = useFilteredStudents(students);
4019
+ return /* @__PURE__ */ React__namespace.createElement(core.Accordion, null, pathways.map((p) => /* @__PURE__ */ React__namespace.createElement(core.Accordion.Item, { key: p.pathwayId, value: p.pathwayId }, /* @__PURE__ */ React__namespace.createElement(core.Accordion.Control, null, /* @__PURE__ */ React__namespace.createElement("strong", null, p.title), /* @__PURE__ */ React__namespace.createElement("div", null, p.description)), /* @__PURE__ */ React__namespace.createElement(core.Accordion.Panel, null, /* @__PURE__ */ React__namespace.createElement(
4020
+ Table,
4021
+ {
4022
+ loading,
4023
+ items: byPathway(p.pathwayId, badges)
4024
+ }
4025
+ )))));
4026
+ };
3925
4027
  const FileLocker = (props) => {
3926
4028
  const { classes } = useStyles();
3927
4029
  const [tab, setTab] = React.useState("students");
@@ -3987,6 +4089,28 @@ const FileLocker = (props) => {
3987
4089
  loading: props.loading,
3988
4090
  items: props.students
3989
4091
  }
4092
+ ), tab === "pathways" && /* @__PURE__ */ React__namespace.createElement(
4093
+ PathwayTable,
4094
+ {
4095
+ pathways: props.pathways || [],
4096
+ badges: props.badges || [],
4097
+ students: props.students,
4098
+ loading: props.loading
4099
+ }
4100
+ ), tab === "badges" && /* @__PURE__ */ React__namespace.createElement(
4101
+ BadgeTable,
4102
+ {
4103
+ badges: props.badges || [],
4104
+ students: props.students,
4105
+ loading: props.loading
4106
+ }
4107
+ ), tab === "lessons" && /* @__PURE__ */ React__namespace.createElement(
4108
+ LessonTableWrapper,
4109
+ {
4110
+ lessons: props.lessons,
4111
+ students: props.students,
4112
+ loading: props.loading
4113
+ }
3990
4114
  )))))));
3991
4115
  };
3992
4116
 
@@ -4013,6 +4137,7 @@ exports.Lessons = Lessons;
4013
4137
  exports.Navbar = Navbar;
4014
4138
  exports.Organization = Organization;
4015
4139
  exports.Pathway = Pathway;
4140
+ exports.PathwayTable = PathwayTable;
4016
4141
  exports.Pathways = Pathways;
4017
4142
  exports.People = People;
4018
4143
  exports.StartAnonymousLesson = StartAnonymousLesson;