@local-civics/mgmt-ui 0.1.192 → 0.1.194

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { useState, useMemo } from 'react';
3
3
  import { createStyles, Group, Avatar, Text, Box, Badge as Badge$1, ThemeIcon, Collapse, Navbar as Navbar$1, Center, Image, Code, Burger, ScrollArea, Modal, Loader, Container, Button, Title, UnstyledButton, Card, SimpleGrid, Tabs as Tabs$1, Stack as Stack$5, Grid, ActionIcon, LoadingOverlay, Select, Table as Table$l, Autocomplete, Drawer, Divider, TextInput, Tooltip, Paper, Overlay, Anchor, Menu, Checkbox, createEmotionCache, MantineProvider, AppShell } from '@mantine/core';
4
- import { IconChevronRight, IconChevronLeft, IconVideo, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconRoute, IconAlbum, IconLambda, IconClipboard, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconChevronUp, IconChevronDown, IconSelector, IconDownload, IconX, IconCloudUpload, IconInfoCircle, IconColorSwatch, IconPointer, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
4
+ import { IconChevronRight, IconChevronLeft, IconVideo, IconSwitchHorizontal, IconLogout, IconHome2, IconGauge, IconCategory2, IconRoute, IconAlbum, IconLambda, IconClipboard, IconBuilding, IconBatteryEco, IconBooks, IconBackpack, IconClipboardCopy, IconTableExport, IconArrowLeft, IconPlaylistAdd, IconCheck, IconTrash, IconDownload, IconX, IconCloudUpload, IconChevronUp, IconChevronDown, IconSelector, IconInfoCircle, IconColorSwatch, IconPointer, IconScribble, IconSchool, IconPodium, IconBriefcase, IconPresentation, IconNews, IconTools, IconBrandInstagram, IconBrandLinkedin, IconBrandFacebook } from '@tabler/icons';
5
5
  import { Link } from 'react-router-dom';
6
6
  import { showNotification, NotificationsProvider } from '@mantine/notifications';
7
7
  export { showNotification, updateNotification } from '@mantine/notifications';
@@ -14,35 +14,35 @@ import AvatarInit from 'avatar-initials';
14
14
  import { Chart } from 'react-charts';
15
15
  import { useUncontrolled } from '@mantine/hooks';
16
16
 
17
- var __defProp$d = Object.defineProperty;
18
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
19
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
20
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
21
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
- var __spreadValues$d = (a, b) => {
17
+ var __defProp$e = Object.defineProperty;
18
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
19
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
20
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
21
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
22
+ var __spreadValues$e = (a, b) => {
23
23
  for (var prop in b || (b = {}))
24
- if (__hasOwnProp$d.call(b, prop))
25
- __defNormalProp$d(a, prop, b[prop]);
26
- if (__getOwnPropSymbols$d)
27
- for (var prop of __getOwnPropSymbols$d(b)) {
28
- if (__propIsEnum$d.call(b, prop))
29
- __defNormalProp$d(a, prop, b[prop]);
24
+ if (__hasOwnProp$e.call(b, prop))
25
+ __defNormalProp$e(a, prop, b[prop]);
26
+ if (__getOwnPropSymbols$e)
27
+ for (var prop of __getOwnPropSymbols$e(b)) {
28
+ if (__propIsEnum$e.call(b, prop))
29
+ __defNormalProp$e(a, prop, b[prop]);
30
30
  }
31
31
  return a;
32
32
  };
33
33
  var __objRest$2 = (source, exclude) => {
34
34
  var target = {};
35
35
  for (var prop in source)
36
- if (__hasOwnProp$d.call(source, prop) && exclude.indexOf(prop) < 0)
36
+ if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
37
37
  target[prop] = source[prop];
38
- if (source != null && __getOwnPropSymbols$d)
39
- for (var prop of __getOwnPropSymbols$d(source)) {
40
- if (exclude.indexOf(prop) < 0 && __propIsEnum$d.call(source, prop))
38
+ if (source != null && __getOwnPropSymbols$e)
39
+ for (var prop of __getOwnPropSymbols$e(source)) {
40
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
41
41
  target[prop] = source[prop];
42
42
  }
43
43
  return target;
44
44
  };
45
- const useStyles$y = createStyles((theme) => ({
45
+ const useStyles$w = createStyles((theme) => ({
46
46
  user: {
47
47
  display: "block",
48
48
  width: "100%",
@@ -53,8 +53,8 @@ const useStyles$y = createStyles((theme) => ({
53
53
  }));
54
54
  function UserButton(_a) {
55
55
  var _b = _a, { image, name, email, icon } = _b, others = __objRest$2(_b, ["image", "name", "email", "icon"]);
56
- const { classes } = useStyles$y();
57
- return /* @__PURE__ */ React.createElement(Group, __spreadValues$d({ className: classes.user }, others), /* @__PURE__ */ React.createElement(Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", size: "xs" }, email)));
56
+ const { classes } = useStyles$w();
57
+ return /* @__PURE__ */ React.createElement(Group, __spreadValues$e({ className: classes.user }, others), /* @__PURE__ */ React.createElement(Avatar, { src: image, radius: "xl" }), /* @__PURE__ */ React.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, name), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", size: "xs" }, email)));
58
58
  }
59
59
 
60
60
  const compact = (num) => {
@@ -64,7 +64,7 @@ const compact = (num) => {
64
64
  }).format(num || 0);
65
65
  };
66
66
 
67
- const useStyles$x = createStyles((theme, _params, getRef) => {
67
+ const useStyles$v = createStyles((theme, _params, getRef) => {
68
68
  const icon = getRef("icon");
69
69
  return {
70
70
  control: {
@@ -117,7 +117,7 @@ const useStyles$x = createStyles((theme, _params, getRef) => {
117
117
  };
118
118
  });
119
119
  function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, notifications }) {
120
- const { classes, theme, cx } = useStyles$x();
120
+ const { classes, theme, cx } = useStyles$v();
121
121
  const hasLinks = Array.isArray(links) && links.length > 0;
122
122
  const hasActiveLinks = Array.isArray(links) && links.map((l) => !!active && active === `${label}/${l.label}`).reduce((a, b) => a || b, false);
123
123
  const [opened, setOpened] = useState(initiallyOpened || hasActiveLinks || false);
@@ -162,26 +162,26 @@ function LinksGroup({ icon: Icon, href, label, initiallyOpened, links, active, n
162
162
  ), hasLinks ? /* @__PURE__ */ React.createElement(Collapse, { in: opened }, items) : null);
163
163
  }
164
164
 
165
- var __defProp$c = Object.defineProperty;
166
- var __defProps$9 = Object.defineProperties;
167
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
168
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
169
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
170
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
171
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
172
- var __spreadValues$c = (a, b) => {
165
+ var __defProp$d = Object.defineProperty;
166
+ var __defProps$a = Object.defineProperties;
167
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
168
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
169
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
170
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
171
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
172
+ var __spreadValues$d = (a, b) => {
173
173
  for (var prop in b || (b = {}))
174
- if (__hasOwnProp$c.call(b, prop))
175
- __defNormalProp$c(a, prop, b[prop]);
176
- if (__getOwnPropSymbols$c)
177
- for (var prop of __getOwnPropSymbols$c(b)) {
178
- if (__propIsEnum$c.call(b, prop))
179
- __defNormalProp$c(a, prop, b[prop]);
174
+ if (__hasOwnProp$d.call(b, prop))
175
+ __defNormalProp$d(a, prop, b[prop]);
176
+ if (__getOwnPropSymbols$d)
177
+ for (var prop of __getOwnPropSymbols$d(b)) {
178
+ if (__propIsEnum$d.call(b, prop))
179
+ __defNormalProp$d(a, prop, b[prop]);
180
180
  }
181
181
  return a;
182
182
  };
183
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
184
- const useStyles$w = createStyles((theme, _params, getRef) => {
183
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
184
+ const useStyles$u = createStyles((theme, _params, getRef) => {
185
185
  const icon = getRef("icon");
186
186
  return {
187
187
  navbar: {
@@ -212,7 +212,7 @@ const useStyles$w = createStyles((theme, _params, getRef) => {
212
212
  color: theme.colorScheme === "dark" ? theme.white : theme.black,
213
213
  borderBottom: `1px solid ${theme.colorScheme === "dark" ? theme.colors.dark[4] : theme.colors.gray[3]}`
214
214
  },
215
- link: __spreadProps$9(__spreadValues$c({}, theme.fn.focusStyles()), {
215
+ link: __spreadProps$a(__spreadValues$d({}, theme.fn.focusStyles()), {
216
216
  display: "flex",
217
217
  alignItems: "center",
218
218
  textDecoration: "none",
@@ -282,7 +282,7 @@ const TRIAL_PAGES = [
282
282
  "Badges"
283
283
  ];
284
284
  function Navbar(props) {
285
- const { classes, cx } = useStyles$w();
285
+ const { classes, cx } = useStyles$u();
286
286
  const [burgerOpen, setBurgerOpen] = React.useState(false);
287
287
  const toggle = () => setBurgerOpen(!burgerOpen);
288
288
  const links = data.map((item) => {
@@ -295,12 +295,12 @@ function Navbar(props) {
295
295
  }
296
296
  return /* @__PURE__ */ React.createElement(
297
297
  LinksGroup,
298
- __spreadProps$9(__spreadValues$c(__spreadValues$c({
298
+ __spreadProps$a(__spreadValues$d(__spreadValues$d({
299
299
  key: item.label,
300
300
  active: props.active
301
301
  }, item), context), {
302
302
  links: (item.links || []).map((link) => {
303
- return __spreadValues$c(__spreadValues$c({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
303
+ return __spreadValues$d(__spreadValues$d({}, link), props.links[`${item.label}/${link.label}`] || { notifications: 0, href: "" });
304
304
  })
305
305
  })
306
306
  );
@@ -325,7 +325,7 @@ function Navbar(props) {
325
325
  } }, /* @__PURE__ */ React.createElement(IconLogout, { className: classes.linkIcon, stroke: 1.5 }), /* @__PURE__ */ React.createElement("span", null, "Logout"))))));
326
326
  }
327
327
 
328
- const useStyles$v = createStyles((theme) => ({
328
+ const useStyles$t = createStyles((theme) => ({
329
329
  inner: {
330
330
  paddingTop: theme.spacing.xl,
331
331
  paddingBottom: theme.spacing.xl * 4
@@ -361,7 +361,7 @@ const useStyles$v = createStyles((theme) => ({
361
361
  }
362
362
  }));
363
363
  const GettingStarted = (props) => {
364
- const { classes } = useStyles$v();
364
+ const { classes } = useStyles$t();
365
365
  return /* @__PURE__ */ React.createElement(
366
366
  Modal,
367
367
  {
@@ -375,7 +375,7 @@ const GettingStarted = (props) => {
375
375
  );
376
376
  };
377
377
 
378
- const useStyles$u = createStyles((theme) => ({
378
+ const useStyles$s = createStyles((theme) => ({
379
379
  title: {
380
380
  fontSize: 34,
381
381
  fontWeight: 900,
@@ -416,7 +416,7 @@ const useStyles$u = createStyles((theme) => ({
416
416
  }
417
417
  }));
418
418
  const SwitchAccount = (props) => {
419
- const { classes, theme } = useStyles$u();
419
+ const { classes, theme } = useStyles$s();
420
420
  const options = props.accounts.map((a) => {
421
421
  return /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: () => props.onClick && props.onClick(a.accountId), key: a.accountId, p: theme.spacing.md }, /* @__PURE__ */ React.createElement(Card, { withBorder: true, shadow: "md", radius: "md", className: classes.card, p: "xl" }, a.isAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBatteryEco, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), a.isGroupAdmin && !a.isAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBooks, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), !a.isAdmin && !a.isGroupAdmin && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(IconBackpack, { size: 50, stroke: 2, color: theme.fn.primaryColor() })), /* @__PURE__ */ React.createElement(Text, { size: "lg", weight: 500, className: classes.cardTitle, mt: "md" }, a.name), /* @__PURE__ */ React.createElement(Text, { size: "sm", color: "dimmed", mt: "sm" }, a.isAdmin ? "Admin" : a.isGroupAdmin ? "Educator" : "Student")));
422
422
  });
@@ -433,7 +433,7 @@ const SwitchAccount = (props) => {
433
433
  );
434
434
  };
435
435
 
436
- const useStyles$t = createStyles((theme) => ({
436
+ const useStyles$r = createStyles((theme) => ({
437
437
  root: {
438
438
  display: "flex",
439
439
  backgroundImage: `linear-gradient(-60deg, ${theme.colors[theme.primaryColor][4]} 0%, ${theme.colors[theme.primaryColor][7]} 100%)`,
@@ -477,7 +477,7 @@ const useStyles$t = createStyles((theme) => ({
477
477
  }
478
478
  }));
479
479
  const StatsGroup = ({ data, footer }) => {
480
- const { classes } = useStyles$t();
480
+ const { classes } = useStyles$r();
481
481
  const stats = data.map((stat) => {
482
482
  const value = (() => {
483
483
  if (stat.unit === "%") {
@@ -497,7 +497,7 @@ const Tabs = (props) => {
497
497
  return /* @__PURE__ */ React.createElement(Tabs$1, { value: props.value, onTabChange: props.onChange }, /* @__PURE__ */ React.createElement(Tabs$1.List, null, tabs));
498
498
  };
499
499
 
500
- const useStyles$s = createStyles((theme) => ({
500
+ const useStyles$q = createStyles((theme) => ({
501
501
  button: {
502
502
  borderTopRightRadius: 0,
503
503
  borderBottomRightRadius: 0,
@@ -512,7 +512,7 @@ const useStyles$s = createStyles((theme) => ({
512
512
  }
513
513
  }));
514
514
  const SplitButton$5 = (props) => {
515
- const { classes, theme } = useStyles$s();
515
+ const { classes, theme } = useStyles$q();
516
516
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
517
517
  return /* @__PURE__ */ React.createElement(Stack$5, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
518
518
  Button,
@@ -540,7 +540,7 @@ const SplitButton$5 = (props) => {
540
540
  ));
541
541
  };
542
542
 
543
- const useStyles$r = createStyles((theme) => ({
543
+ const useStyles$p = createStyles((theme) => ({
544
544
  wrapper: {
545
545
  display: "flex",
546
546
  alignItems: "center",
@@ -591,7 +591,7 @@ const useStyles$r = createStyles((theme) => ({
591
591
  }
592
592
  }));
593
593
  const PlaceholderBanner = (props) => {
594
- const { classes } = useStyles$r();
594
+ const { classes } = useStyles$p();
595
595
  const title = props.title || "Nothing to display";
596
596
  const description = props.description || "We don't have anything to show you here just yet. Add data, check back later, or adjust your search.";
597
597
  return /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement("div", { className: classes.body }, /* @__PURE__ */ React.createElement(Title, { className: classes.title }, props.loading ? "Loading..." : title), /* @__PURE__ */ React.createElement(Text, { size: "sm", color: "dimmed" }, props.loading ? "Hold on, we're loading your data." : description)), /* @__PURE__ */ React.createElement(Image, { src: `https://cdn.localcivics.io/illustrations/${props.icon}.svg`, className: classes.image }));
@@ -645,28 +645,28 @@ function useSortableData(items, config = { key: "", direction: null }) {
645
645
  return { items: sortedItems, requestSort, sortConfig };
646
646
  }
647
647
 
648
- var __defProp$b = Object.defineProperty;
649
- var __defProps$8 = Object.defineProperties;
650
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
651
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
652
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
653
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
654
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
655
- var __spreadValues$b = (a, b) => {
648
+ var __defProp$c = Object.defineProperty;
649
+ var __defProps$9 = Object.defineProperties;
650
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
651
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
652
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
653
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
654
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
655
+ var __spreadValues$c = (a, b) => {
656
656
  for (var prop in b || (b = {}))
657
- if (__hasOwnProp$b.call(b, prop))
658
- __defNormalProp$b(a, prop, b[prop]);
659
- if (__getOwnPropSymbols$b)
660
- for (var prop of __getOwnPropSymbols$b(b)) {
661
- if (__propIsEnum$b.call(b, prop))
662
- __defNormalProp$b(a, prop, b[prop]);
657
+ if (__hasOwnProp$c.call(b, prop))
658
+ __defNormalProp$c(a, prop, b[prop]);
659
+ if (__getOwnPropSymbols$c)
660
+ for (var prop of __getOwnPropSymbols$c(b)) {
661
+ if (__propIsEnum$c.call(b, prop))
662
+ __defNormalProp$c(a, prop, b[prop]);
663
663
  }
664
664
  return a;
665
665
  };
666
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
666
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
667
667
  function Table$k(props) {
668
668
  const preparedItems = React.useMemo(() => {
669
- return props.items.map((item) => __spreadProps$8(__spreadValues$b({}, item), {
669
+ return props.items.map((item) => __spreadProps$9(__spreadValues$c({}, item), {
670
670
  status: item.isComplete ? 1 : 0
671
671
  }));
672
672
  }, [props.items]);
@@ -763,7 +763,7 @@ function Table$j(props) {
763
763
  ));
764
764
  }
765
765
 
766
- const useStyles$q = createStyles((theme) => ({
766
+ const useStyles$o = createStyles((theme) => ({
767
767
  title: {
768
768
  fontSize: 34,
769
769
  fontWeight: 900,
@@ -776,7 +776,7 @@ const useStyles$q = createStyles((theme) => ({
776
776
  }
777
777
  }));
778
778
  const Badge = (props) => {
779
- const { classes } = useStyles$q();
779
+ const { classes } = useStyles$o();
780
780
  const [tab, setTab] = useState("lessons");
781
781
  const numberOfStudents = props.students.length;
782
782
  const numberOfBadges = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -874,7 +874,7 @@ function Table$i(props) {
874
874
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React.createElement("tbody", null, rows)));
875
875
  }
876
876
 
877
- const useStyles$p = createStyles((theme) => ({
877
+ const useStyles$n = createStyles((theme) => ({
878
878
  title: {
879
879
  fontSize: 34,
880
880
  fontWeight: 900,
@@ -887,7 +887,7 @@ const useStyles$p = createStyles((theme) => ({
887
887
  }
888
888
  }));
889
889
  const Badges = (props) => {
890
- const { classes } = useStyles$p();
890
+ const { classes } = useStyles$n();
891
891
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(Badge$1, { variant: "filled", size: "lg" }, "Badges"), /* @__PURE__ */ React.createElement(Title, { order: 2, className: classes.title, mt: "md" }, "Badges and micro-credentials"), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Key milestones that reflect skill development, micro-credentials, or academic progress"))), /* @__PURE__ */ React.createElement(
892
892
  Autocomplete,
893
893
  {
@@ -1117,22 +1117,31 @@ const SplitButton$4 = (props) => {
1117
1117
  ));
1118
1118
  };
1119
1119
 
1120
- const useStyles$o = createStyles((theme) => ({
1121
- th: { padding: "0 !important" },
1122
- control: {
1123
- width: "100%",
1124
- padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
1125
- "&:hover": {
1126
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
1120
+ var __defProp$b = Object.defineProperty;
1121
+ var __defProps$8 = Object.defineProperties;
1122
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1123
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
1124
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
1125
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
1126
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1127
+ var __spreadValues$b = (a, b) => {
1128
+ for (var prop in b || (b = {}))
1129
+ if (__hasOwnProp$b.call(b, prop))
1130
+ __defNormalProp$b(a, prop, b[prop]);
1131
+ if (__getOwnPropSymbols$b)
1132
+ for (var prop of __getOwnPropSymbols$b(b)) {
1133
+ if (__propIsEnum$b.call(b, prop))
1134
+ __defNormalProp$b(a, prop, b[prop]);
1127
1135
  }
1128
- }
1129
- }));
1130
- function Th$2({ children, reversed, sorted, onSort }) {
1131
- const { classes } = useStyles$o();
1132
- const Icon = sorted ? reversed ? IconChevronUp : IconChevronDown : IconSelector;
1133
- return /* @__PURE__ */ React.createElement("th", { className: classes.th }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React.createElement(Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Icon, { size: 14, stroke: 1.5 })))));
1134
- }
1136
+ return a;
1137
+ };
1138
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1135
1139
  function Table$c(props) {
1140
+ React.useMemo(() => {
1141
+ return props.items.map((item) => __spreadProps$8(__spreadValues$b({}, item), {
1142
+ fullName: item.givenName && item.familyName ? `${item.givenName} ${item.familyName}`.toLowerCase() : item.email.toLowerCase()
1143
+ }));
1144
+ }, [props.items]);
1136
1145
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
1137
1146
  if (props.items.length === 0) {
1138
1147
  return /* @__PURE__ */ React.createElement(
@@ -1145,6 +1154,10 @@ function Table$c(props) {
1145
1154
  }
1146
1155
  );
1147
1156
  }
1157
+ const sortStatus = {
1158
+ columnAccessor: sortConfig.key,
1159
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
1160
+ };
1148
1161
  const openDeleteModal = (student) => openConfirmModal({
1149
1162
  title: `Remove "${student.givenName && student.familyName ? `${student.givenName} ${student.familyName}` : student.email}" from this class?`,
1150
1163
  centered: true,
@@ -1153,64 +1166,73 @@ function Table$c(props) {
1153
1166
  confirmProps: { color: "red" },
1154
1167
  onConfirm: () => props.onDelete && props.onDelete(student)
1155
1168
  });
1156
- const rows = sortedItems.map((row) => /* @__PURE__ */ React.createElement("tr", { key: row.email }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Group, { spacing: "sm" }, /* @__PURE__ */ React.createElement(Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, row.givenName && row.familyName ? `${row.givenName} ${row.familyName}` : row.email), /* @__PURE__ */ React.createElement(Text, { size: "xs", color: "dimmed" }, row.email))))), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Box, { maw: 150 }, /* @__PURE__ */ React.createElement(
1157
- Select,
1169
+ return /* @__PURE__ */ React.createElement(ScrollArea, null, /* @__PURE__ */ React.createElement(
1170
+ DataTable,
1158
1171
  {
1159
- size: "sm",
1160
- value: row.isAdmin ? "educator" : "student",
1161
- onChange: (value) => props.onRoleChange && props.onRoleChange(row, value),
1162
- data: [{ value: "student", label: "Student" }, { value: "educator", label: "Educator" }]
1172
+ verticalSpacing: 20,
1173
+ sx: { minWidth: 700 },
1174
+ highlightOnHover: true,
1175
+ striped: true,
1176
+ records: sortedItems,
1177
+ idAccessor: "email",
1178
+ sortStatus,
1179
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
1180
+ columns: [
1181
+ {
1182
+ accessor: "fullName",
1183
+ title: "Name",
1184
+ sortable: true,
1185
+ render: (row) => /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Group, { spacing: "sm" }, /* @__PURE__ */ React.createElement(Avatar, { size: 40, src: row.avatar, radius: 40 }), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Text, { size: "sm", weight: 500 }, row.givenName && row.familyName ? `${row.givenName} ${row.familyName}` : row.email), /* @__PURE__ */ React.createElement(Text, { size: "xs", color: "dimmed" }, row.email))))
1186
+ },
1187
+ {
1188
+ accessor: "isAdmin",
1189
+ title: "Role",
1190
+ sortable: true,
1191
+ render: (row) => /* @__PURE__ */ React.createElement(Box, { maw: 150 }, /* @__PURE__ */ React.createElement(
1192
+ Select,
1193
+ {
1194
+ size: "sm",
1195
+ disabled: row.readonly,
1196
+ value: row.isAdmin ? "educator" : "student",
1197
+ onChange: (value) => props.onRoleChange && props.onRoleChange(row, value),
1198
+ data: [
1199
+ { label: "Student", value: "student" },
1200
+ { label: "Educator", value: "educator" }
1201
+ ]
1202
+ }
1203
+ ))
1204
+ },
1205
+ {
1206
+ accessor: "badgesEarned",
1207
+ title: "Badges Earned",
1208
+ sortable: true
1209
+ },
1210
+ {
1211
+ accessor: "lessonsCompleted",
1212
+ title: "Lessons Completed",
1213
+ sortable: true
1214
+ },
1215
+ {
1216
+ accessor: "hasAccount",
1217
+ title: "Account Created?",
1218
+ sortable: true,
1219
+ render: (row) => row.hasAccount ? /* @__PURE__ */ React.createElement(IconCheck, { color: "green" }) : null
1220
+ },
1221
+ {
1222
+ accessor: "lastActivity",
1223
+ title: "Last Active",
1224
+ sortable: true,
1225
+ render: (row) => row.lastActivity ? relativeTimeFromDates(row.lastActivity) : ""
1226
+ },
1227
+ {
1228
+ accessor: "actions",
1229
+ title: "",
1230
+ textAlignment: "right",
1231
+ render: (row) => /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, !row.readonly && !!props.onDelete && /* @__PURE__ */ React.createElement(ActionIcon, { color: "red", onClick: () => openDeleteModal(row) }, /* @__PURE__ */ React.createElement(IconTrash, { size: 16, stroke: 1.5 })))
1232
+ }
1233
+ ]
1163
1234
  }
1164
- ))), /* @__PURE__ */ React.createElement("td", null, row.badgesEarned), /* @__PURE__ */ React.createElement("td", null, row.lessonsCompleted), /* @__PURE__ */ React.createElement("td", null, row.hasAccount && /* @__PURE__ */ React.createElement(IconCheck, { color: "green" })), /* @__PURE__ */ React.createElement("td", null, row.lastActivity ? relativeTimeFromDates(row.lastActivity) : ""), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, !row.readonly && !!props.onDelete && /* @__PURE__ */ React.createElement(ActionIcon, { color: "red" }, /* @__PURE__ */ React.createElement(IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1165
- return /* @__PURE__ */ React.createElement(ScrollArea, null, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
1166
- Th$2,
1167
- {
1168
- sorted: sortConfig.key === "givenName",
1169
- reversed: sortConfig.direction === "desc",
1170
- onSort: () => requestSort("givenName")
1171
- },
1172
- "Name"
1173
- ), /* @__PURE__ */ React.createElement(
1174
- Th$2,
1175
- {
1176
- sorted: sortConfig.key === "isAdmin",
1177
- reversed: sortConfig.direction === "desc",
1178
- onSort: () => requestSort("isAdmin")
1179
- },
1180
- "Role"
1181
- ), /* @__PURE__ */ React.createElement(
1182
- Th$2,
1183
- {
1184
- sorted: sortConfig.key === "badgesEarned",
1185
- reversed: sortConfig.direction === "desc",
1186
- onSort: () => requestSort("badgesEarned")
1187
- },
1188
- "Badges Earned"
1189
- ), /* @__PURE__ */ React.createElement(
1190
- Th$2,
1191
- {
1192
- sorted: sortConfig.key === "lessonsCompleted",
1193
- reversed: sortConfig.direction === "desc",
1194
- onSort: () => requestSort("lessonsCompleted")
1195
- },
1196
- "Lessons Completed"
1197
- ), /* @__PURE__ */ React.createElement(
1198
- Th$2,
1199
- {
1200
- sorted: sortConfig.key === "hasAccount",
1201
- reversed: sortConfig.direction === "desc",
1202
- onSort: () => requestSort("hasAccount")
1203
- },
1204
- "Account Created?"
1205
- ), /* @__PURE__ */ React.createElement(
1206
- Th$2,
1207
- {
1208
- sorted: sortConfig.key === "lastActivity",
1209
- reversed: sortConfig.direction === "desc",
1210
- onSort: () => requestSort("lastActivity")
1211
- },
1212
- "Last Active"
1213
- ), /* @__PURE__ */ React.createElement("th", null), " ")), /* @__PURE__ */ React.createElement("tbody", null, rows)));
1235
+ ));
1214
1236
  }
1215
1237
 
1216
1238
  var __defProp$a = Object.defineProperty;
@@ -1232,7 +1254,7 @@ var __spreadValues$a = (a, b) => {
1232
1254
  return a;
1233
1255
  };
1234
1256
  var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1235
- const useStyles$n = createStyles((theme) => ({
1257
+ const useStyles$m = createStyles((theme) => ({
1236
1258
  title: {
1237
1259
  fontSize: 34,
1238
1260
  fontWeight: 900,
@@ -1265,7 +1287,7 @@ const useStyles$n = createStyles((theme) => ({
1265
1287
  }
1266
1288
  }));
1267
1289
  const Class = (props) => {
1268
- const { classes } = useStyles$n();
1290
+ const { classes } = useStyles$m();
1269
1291
  const form = useForm({
1270
1292
  initialValues: {
1271
1293
  classId: "",
@@ -1366,7 +1388,7 @@ const Class = (props) => {
1366
1388
  ))))));
1367
1389
  };
1368
1390
  const DropzoneButton$1 = (props) => {
1369
- const { classes, theme } = useStyles$n();
1391
+ const { classes, theme } = useStyles$m();
1370
1392
  const openRef = React.useRef(null);
1371
1393
  const [loading, setLoading] = React.useState(false);
1372
1394
  const onDrop = React.useCallback((acceptedFiles) => {
@@ -1412,7 +1434,7 @@ const DropzoneButton$1 = (props) => {
1412
1434
  } }, "Select file"));
1413
1435
  };
1414
1436
 
1415
- const useStyles$m = createStyles((theme) => ({
1437
+ const useStyles$l = createStyles((theme) => ({
1416
1438
  th: { padding: "0 !important" },
1417
1439
  control: {
1418
1440
  width: "100%",
@@ -1422,8 +1444,8 @@ const useStyles$m = createStyles((theme) => ({
1422
1444
  }
1423
1445
  }
1424
1446
  }));
1425
- function Th$1({ children, reversed, sorted, onSort }) {
1426
- const { classes } = useStyles$m();
1447
+ function Th({ children, reversed, sorted, onSort }) {
1448
+ const { classes } = useStyles$l();
1427
1449
  const Icon = sorted ? reversed ? IconChevronUp : IconChevronDown : IconSelector;
1428
1450
  return /* @__PURE__ */ React.createElement("th", { className: classes.th }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React.createElement(Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Icon, { size: 14, stroke: 1.5 })))));
1429
1451
  }
@@ -1450,7 +1472,7 @@ function Table$b(props) {
1450
1472
  });
1451
1473
  const rows = sortedItems.map((row) => /* @__PURE__ */ React.createElement("tr", { key: row.classId }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(UnstyledButton, { component: Link, to: row.href }, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.name))), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.description)), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { size: 14 }, row.numberOfStudents || 0)), /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0, position: "right" }, /* @__PURE__ */ React.createElement(ActionIcon, { color: "red" }, /* @__PURE__ */ React.createElement(IconTrash, { onClick: () => openDeleteModal(row), size: 16, stroke: 1.5 }))))));
1452
1474
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: 20, sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
1453
- Th$1,
1475
+ Th,
1454
1476
  {
1455
1477
  sorted: sortConfig.key === "name",
1456
1478
  reversed: sortConfig.direction === "desc",
@@ -1458,7 +1480,7 @@ function Table$b(props) {
1458
1480
  },
1459
1481
  "Class Name"
1460
1482
  ), /* @__PURE__ */ React.createElement("th", { style: { padding: "7px 16px" } }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm" }, "Description")), /* @__PURE__ */ React.createElement(
1461
- Th$1,
1483
+ Th,
1462
1484
  {
1463
1485
  sorted: sortConfig.key === "numberOfStudents",
1464
1486
  reversed: sortConfig.direction === "desc",
@@ -1484,7 +1506,7 @@ var __spreadValues$9 = (a, b) => {
1484
1506
  }
1485
1507
  return a;
1486
1508
  };
1487
- const useStyles$l = createStyles((theme) => ({
1509
+ const useStyles$k = createStyles((theme) => ({
1488
1510
  title: {
1489
1511
  fontSize: 34,
1490
1512
  fontWeight: 900,
@@ -1497,7 +1519,7 @@ const useStyles$l = createStyles((theme) => ({
1497
1519
  }
1498
1520
  }));
1499
1521
  const Classes = (props) => {
1500
- const { classes } = useStyles$l();
1522
+ const { classes } = useStyles$k();
1501
1523
  const form = useForm({
1502
1524
  initialValues: {
1503
1525
  classId: "",
@@ -1568,7 +1590,7 @@ const Classes = (props) => {
1568
1590
  ))))));
1569
1591
  };
1570
1592
 
1571
- const useStyles$k = createStyles((theme) => ({
1593
+ const useStyles$j = createStyles((theme) => ({
1572
1594
  title: {
1573
1595
  fontSize: 34,
1574
1596
  fontWeight: 900,
@@ -1582,7 +1604,7 @@ const useStyles$k = createStyles((theme) => ({
1582
1604
  }
1583
1605
  }));
1584
1606
  const UserInfo = (props) => {
1585
- const { classes } = useStyles$k();
1607
+ const { classes } = useStyles$j();
1586
1608
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Title, { className: classes.title }, props.name), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", className: classes.description, mt: "xs" }, props.impactStatement));
1587
1609
  };
1588
1610
 
@@ -1720,7 +1742,7 @@ const Student = (props) => {
1720
1742
  ))))));
1721
1743
  };
1722
1744
 
1723
- const useStyles$j = createStyles((theme, props) => {
1745
+ const useStyles$i = createStyles((theme, props) => {
1724
1746
  const from = props.from || "blue";
1725
1747
  const to = props.to || "green";
1726
1748
  return {
@@ -1748,7 +1770,7 @@ const useStyles$j = createStyles((theme, props) => {
1748
1770
  };
1749
1771
  });
1750
1772
  function CardGradient(props) {
1751
- const { classes } = useStyles$j(props);
1773
+ const { classes } = useStyles$i(props);
1752
1774
  const from = props.from || "blue";
1753
1775
  const to = props.to || "green";
1754
1776
  const icon = props.icon || /* @__PURE__ */ React.createElement(IconColorSwatch, { size: 28, stroke: 1.5 });
@@ -1792,7 +1814,7 @@ var __objRest$1 = (source, exclude) => {
1792
1814
  }
1793
1815
  return target;
1794
1816
  };
1795
- const useStyles$i = createStyles((theme) => ({
1817
+ const useStyles$h = createStyles((theme) => ({
1796
1818
  card: {
1797
1819
  height: 240,
1798
1820
  backgroundSize: "cover",
@@ -1837,7 +1859,7 @@ const TenantBanner = (_a) => {
1837
1859
  "className",
1838
1860
  "code"
1839
1861
  ]);
1840
- const { classes, cx, theme } = useStyles$i();
1862
+ const { classes, cx, theme } = useStyles$h();
1841
1863
  const handleCopy = async () => {
1842
1864
  if (!code)
1843
1865
  return;
@@ -1977,7 +1999,7 @@ function Table$7(props) {
1977
1999
  ));
1978
2000
  }
1979
2001
 
1980
- const useStyles$h = createStyles((theme) => ({
2002
+ const useStyles$g = createStyles((theme) => ({
1981
2003
  button: {
1982
2004
  borderTopRightRadius: 0,
1983
2005
  borderBottomRightRadius: 0,
@@ -1992,7 +2014,7 @@ const useStyles$h = createStyles((theme) => ({
1992
2014
  }
1993
2015
  }));
1994
2016
  const SplitButton$3 = (props) => {
1995
- const { classes, theme } = useStyles$h();
2017
+ const { classes, theme } = useStyles$g();
1996
2018
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
1997
2019
  return /* @__PURE__ */ React.createElement(Stack$5, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
1998
2020
  Button,
@@ -2170,7 +2192,7 @@ function Stack$2(props) {
2170
2192
  }
2171
2193
  const truncateWithEllipses = (text, max) => text.substr(0, max - 1) + (text.length > max ? "&hellip;" : "");
2172
2194
 
2173
- const useStyles$g = createStyles((theme) => ({
2195
+ const useStyles$f = createStyles((theme) => ({
2174
2196
  title: {
2175
2197
  fontSize: 34,
2176
2198
  fontWeight: 900,
@@ -2183,7 +2205,7 @@ const useStyles$g = createStyles((theme) => ({
2183
2205
  }
2184
2206
  }));
2185
2207
  const Lesson = (props) => {
2186
- const { classes } = useStyles$g();
2208
+ const { classes } = useStyles$f();
2187
2209
  const [tab, setTab] = useState("question");
2188
2210
  const numberOfStudents = props.students.length;
2189
2211
  const numberOfLessons = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -2327,7 +2349,7 @@ function Table$5(props) {
2327
2349
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React.createElement("tbody", null, rows)));
2328
2350
  }
2329
2351
 
2330
- const useStyles$f = createStyles((theme) => ({
2352
+ const useStyles$e = createStyles((theme) => ({
2331
2353
  title: {
2332
2354
  fontSize: 34,
2333
2355
  fontWeight: 900,
@@ -2340,7 +2362,7 @@ const useStyles$f = createStyles((theme) => ({
2340
2362
  }
2341
2363
  }));
2342
2364
  const Lessons = (props) => {
2343
- const { classes } = useStyles$f();
2365
+ const { classes } = useStyles$e();
2344
2366
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(Badge$1, { variant: "filled", size: "lg" }, "Lessons"), /* @__PURE__ */ React.createElement(Title, { order: 2, className: classes.title, mt: "md" }, "Lessons"), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Bite-sized activities and learning experiences accelerating students achievement"))), /* @__PURE__ */ React.createElement(
2345
2367
  Autocomplete,
2346
2368
  {
@@ -2357,7 +2379,7 @@ const Lessons = (props) => {
2357
2379
  ))));
2358
2380
  };
2359
2381
 
2360
- const useStyles$e = createStyles((theme) => ({
2382
+ const useStyles$d = createStyles((theme) => ({
2361
2383
  title: {
2362
2384
  fontSize: 22,
2363
2385
  fontWeight: 900,
@@ -2376,7 +2398,7 @@ const useStyles$e = createStyles((theme) => ({
2376
2398
  }
2377
2399
  }));
2378
2400
  function AccessCode(props) {
2379
- const { classes } = useStyles$e();
2401
+ const { classes } = useStyles$d();
2380
2402
  return /* @__PURE__ */ React.createElement(Container, { mx: "0", px: "0", size: 460, my: 30 }, /* @__PURE__ */ React.createElement(Title, { className: classes.title }, "Access code"), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", size: "sm" }, "Grant access to join your organization"), /* @__PURE__ */ React.createElement(Paper, { withBorder: true, shadow: "md", p: 30, radius: "md", mt: "xl" }, /* @__PURE__ */ React.createElement(TextInput, { value: props.value, readOnly: true }), /* @__PURE__ */ React.createElement(Group, { position: "apart", mt: "lg", className: classes.controls }, /* @__PURE__ */ React.createElement(
2381
2403
  Anchor,
2382
2404
  {
@@ -2404,7 +2426,7 @@ const monthNames = [
2404
2426
  "November",
2405
2427
  "December"
2406
2428
  ];
2407
- const useStyles$d = createStyles((theme) => ({
2429
+ const useStyles$c = createStyles((theme) => ({
2408
2430
  title: {
2409
2431
  fontSize: 34,
2410
2432
  fontWeight: 900,
@@ -2434,7 +2456,7 @@ const useStyles$d = createStyles((theme) => ({
2434
2456
  }
2435
2457
  }));
2436
2458
  const Organization = (props) => {
2437
- const { classes } = useStyles$d();
2459
+ const { classes } = useStyles$c();
2438
2460
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: props.onBackClick }, /* @__PURE__ */ React.createElement(
2439
2461
  Badge$1,
2440
2462
  {
@@ -2460,7 +2482,7 @@ const Organization = (props) => {
2460
2482
  ] }))))));
2461
2483
  };
2462
2484
 
2463
- const useStyles$c = createStyles((theme) => ({
2485
+ const useStyles$b = createStyles((theme) => ({
2464
2486
  button: {
2465
2487
  borderTopRightRadius: 0,
2466
2488
  borderBottomRightRadius: 0,
@@ -2475,7 +2497,7 @@ const useStyles$c = createStyles((theme) => ({
2475
2497
  }
2476
2498
  }));
2477
2499
  const SplitButton$2 = (props) => {
2478
- const { classes, theme } = useStyles$c();
2500
+ const { classes, theme } = useStyles$b();
2479
2501
  const menuIconColor = theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
2480
2502
  const hasMenu = !!props.withOrganizationLink;
2481
2503
  return /* @__PURE__ */ React.createElement(Group, { noWrap: true, spacing: 0 }, /* @__PURE__ */ React.createElement(
@@ -2556,7 +2578,7 @@ var __spreadValues$6 = (a, b) => {
2556
2578
  return a;
2557
2579
  };
2558
2580
  var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
2559
- const useStyles$b = createStyles((theme) => ({
2581
+ const useStyles$a = createStyles((theme) => ({
2560
2582
  title: {
2561
2583
  fontSize: 34,
2562
2584
  fontWeight: 900,
@@ -2586,7 +2608,7 @@ const useStyles$b = createStyles((theme) => ({
2586
2608
  }
2587
2609
  }));
2588
2610
  const People = (props) => {
2589
- const { classes } = useStyles$b();
2611
+ const { classes } = useStyles$a();
2590
2612
  const form = useForm({
2591
2613
  initialValues: {
2592
2614
  userId: "",
@@ -2690,7 +2712,7 @@ const People = (props) => {
2690
2712
  ))))));
2691
2713
  };
2692
2714
  const DropzoneButton = (props) => {
2693
- const { classes, theme } = useStyles$b();
2715
+ const { classes, theme } = useStyles$a();
2694
2716
  const openRef = React.useRef(null);
2695
2717
  const [loading, setLoading] = React.useState(false);
2696
2718
  const onDrop = React.useCallback((acceptedFiles) => {
@@ -2736,7 +2758,7 @@ const DropzoneButton = (props) => {
2736
2758
  } }, "Select file"));
2737
2759
  };
2738
2760
 
2739
- const useStyles$a = createStyles((theme) => ({
2761
+ const useStyles$9 = createStyles((theme) => ({
2740
2762
  form: {
2741
2763
  backgroundColor: theme.white,
2742
2764
  padding: theme.spacing.xl,
@@ -2799,7 +2821,7 @@ const useStyles$a = createStyles((theme) => ({
2799
2821
  }
2800
2822
  }));
2801
2823
  const StartAnonymousLesson = (props) => {
2802
- const { classes } = useStyles$a();
2824
+ const { classes } = useStyles$9();
2803
2825
  const [name, setName] = React.useState("");
2804
2826
  return /* @__PURE__ */ React.createElement("div", { className: classes.wrapper }, /* @__PURE__ */ React.createElement(Container, null, /* @__PURE__ */ React.createElement(SimpleGrid, { maw: 960, cols: 2, spacing: 15, breakpoints: [{ maxWidth: "sm", cols: 1 }] }, /* @__PURE__ */ React.createElement("div", { className: classes.content }, /* @__PURE__ */ React.createElement(Badge$1, { color: "violet" }, "Community"), /* @__PURE__ */ React.createElement(Title, { className: classes.title }, props.title), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", mt: "md" }, props.description), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", mt: "md" }, "You are now part of ", `${props.educatorName}'s`, " Class")), /* @__PURE__ */ React.createElement("div", { className: classes.form }, /* @__PURE__ */ React.createElement(
2805
2827
  TextInput,
@@ -2856,7 +2878,7 @@ function TaskCard(props) {
2856
2878
  ));
2857
2879
  }
2858
2880
 
2859
- const useStyles$9 = createStyles((theme) => ({
2881
+ const useStyles$8 = createStyles((theme) => ({
2860
2882
  action: {
2861
2883
  backgroundColor: "inherit",
2862
2884
  ":hover": {
@@ -2875,7 +2897,7 @@ const useStyles$9 = createStyles((theme) => ({
2875
2897
  }
2876
2898
  }));
2877
2899
  const TrialHome = (props) => {
2878
- const { classes } = useStyles$9();
2900
+ const { classes } = useStyles$8();
2879
2901
  return /* @__PURE__ */ React.createElement(Container, { size: "lg" }, /* @__PURE__ */ React.createElement(Badge$1, null, props.daysRemaining, " day", props.daysRemaining !== 1 ? "s" : "", " left"), /* @__PURE__ */ React.createElement(
2880
2902
  Button,
2881
2903
  {
@@ -2935,7 +2957,7 @@ var __objRest = (source, exclude) => {
2935
2957
  }
2936
2958
  return target;
2937
2959
  };
2938
- const useStyles$8 = createStyles((theme, { checked }) => ({
2960
+ const useStyles$7 = createStyles((theme, { checked }) => ({
2939
2961
  button: {
2940
2962
  display: "flex",
2941
2963
  alignItems: "center",
@@ -2977,7 +2999,7 @@ function ImageCheckbox(_a) {
2977
2999
  finalValue: false,
2978
3000
  onChange
2979
3001
  });
2980
- const { classes, cx } = useStyles$8({ checked: value });
3002
+ const { classes, cx } = useStyles$7({ checked: value });
2981
3003
  return /* @__PURE__ */ React.createElement(
2982
3004
  UnstyledButton,
2983
3005
  __spreadProps$4(__spreadValues$4({}, others), {
@@ -3038,7 +3060,7 @@ var __spreadValues$3 = (a, b) => {
3038
3060
  return a;
3039
3061
  };
3040
3062
  var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
3041
- const useStyles$7 = createStyles((theme) => ({
3063
+ const useStyles$6 = createStyles((theme) => ({
3042
3064
  wrapper: {
3043
3065
  minHeight: "100%",
3044
3066
  boxSizing: "border-box",
@@ -3101,7 +3123,7 @@ const OPTIONS = [
3101
3123
  { description: "project-based learning", title: "Project-Based Learning", icon: IconTools }
3102
3124
  ];
3103
3125
  const TrialRegistration = (props) => {
3104
- const { classes } = useStyles$7();
3126
+ const { classes } = useStyles$6();
3105
3127
  const [firstName, setFirstName] = React.useState("");
3106
3128
  const [lastName, setLastName] = React.useState("");
3107
3129
  const [organization, setOrganization] = React.useState({ organizationId: "", displayName: "" });
@@ -3216,7 +3238,7 @@ var __spreadValues$2 = (a, b) => {
3216
3238
  return a;
3217
3239
  };
3218
3240
  var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
3219
- const useStyles$6 = createStyles((theme, props) => ({
3241
+ const useStyles$5 = createStyles((theme, props) => ({
3220
3242
  footer: {
3221
3243
  paddingTop: theme.spacing.md,
3222
3244
  paddingBottom: theme.spacing.md,
@@ -3303,7 +3325,7 @@ const useStyles$6 = createStyles((theme, props) => ({
3303
3325
  }
3304
3326
  }));
3305
3327
  const App = (props) => {
3306
- const { classes } = useStyles$6(props);
3328
+ const { classes } = useStyles$5(props);
3307
3329
  const account = useAccount(props.account, props.accounts, props.onAccountChange);
3308
3330
  return /* @__PURE__ */ React.createElement(
3309
3331
  AppShell,
@@ -3430,7 +3452,7 @@ function Table$3(props) {
3430
3452
  return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { horizontalSpacing: 0, verticalSpacing: 0, sx: { minWidth: 700 } }, /* @__PURE__ */ React.createElement("tbody", null, rows)));
3431
3453
  }
3432
3454
 
3433
- const useStyles$5 = createStyles((theme) => ({
3455
+ const useStyles$4 = createStyles((theme) => ({
3434
3456
  title: {
3435
3457
  fontSize: 34,
3436
3458
  fontWeight: 900,
@@ -3443,7 +3465,7 @@ const useStyles$5 = createStyles((theme) => ({
3443
3465
  }
3444
3466
  }));
3445
3467
  const Pathways = (props) => {
3446
- const { classes } = useStyles$5();
3468
+ const { classes } = useStyles$4();
3447
3469
  return /* @__PURE__ */ React.createElement(Container, { size: "lg", py: "xl" }, /* @__PURE__ */ React.createElement(Stack$5, { spacing: "md" }, /* @__PURE__ */ React.createElement(Grid, null, /* @__PURE__ */ React.createElement(Grid.Col, { sm: "auto" }, /* @__PURE__ */ React.createElement(Badge$1, { variant: "filled", size: "lg" }, "Pathways"), /* @__PURE__ */ React.createElement(Title, { order: 2, className: classes.title, mt: "md" }, "Pathways"), /* @__PURE__ */ React.createElement(Text, { color: "dimmed", className: classes.description, mt: "sm" }, "Explore all your unique pathway requirements in one clear space"))), /* @__PURE__ */ React.createElement("div", { style: { position: "relative" } }, /* @__PURE__ */ React.createElement(LoadingOverlay, { visible: props.loading, overlayBlur: 2 }), /* @__PURE__ */ React.createElement(
3448
3470
  Table$3,
3449
3471
  {
@@ -3453,7 +3475,7 @@ const Pathways = (props) => {
3453
3475
  ))));
3454
3476
  };
3455
3477
 
3456
- const useStyles$4 = createStyles((theme) => ({
3478
+ const useStyles$3 = createStyles((theme) => ({
3457
3479
  button: {
3458
3480
  borderTopRightRadius: 0,
3459
3481
  borderBottomRightRadius: 0,
@@ -3468,7 +3490,7 @@ const useStyles$4 = createStyles((theme) => ({
3468
3490
  }
3469
3491
  }));
3470
3492
  const SplitButton$1 = (props) => {
3471
- const { classes, theme } = useStyles$4();
3493
+ const { classes, theme } = useStyles$3();
3472
3494
  theme.colors[theme.primaryColor][theme.colorScheme === "dark" ? 5 : 6];
3473
3495
  return /* @__PURE__ */ React.createElement(Stack$5, { spacing: "sm" }, /* @__PURE__ */ React.createElement(
3474
3496
  Button,
@@ -3525,7 +3547,10 @@ var __spreadValues$1 = (a, b) => {
3525
3547
  var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
3526
3548
  function Table$2(props) {
3527
3549
  const preparedItems = React.useMemo(() => {
3528
- return props.items.map((item) => {
3550
+ console.group("Pathway Table Data Check");
3551
+ console.log("Raw items from props:", props.items);
3552
+ console.log("Categories available:", props.categories);
3553
+ const mapped = props.items.map((item) => {
3529
3554
  const flatItem = __spreadProps$1(__spreadValues$1({}, item), {
3530
3555
  status: item.isComplete ? 1 : 0
3531
3556
  });
@@ -3536,6 +3561,19 @@ function Table$2(props) {
3536
3561
  }
3537
3562
  return flatItem;
3538
3563
  });
3564
+ console.log("Transformed items (Flat):", mapped);
3565
+ if (mapped.length > 0 && props.categories.length > 0) {
3566
+ const firstStudent = mapped[0];
3567
+ const firstCatId = props.categories[0].categoryId;
3568
+ console.log(
3569
+ `Matching Check: Does student have key [${firstCatId}]?`,
3570
+ firstStudent.hasOwnProperty(firstCatId) ? "YES \u2705" : "NO \u274C",
3571
+ "Value:",
3572
+ firstStudent[firstCatId]
3573
+ );
3574
+ }
3575
+ console.groupEnd();
3576
+ return mapped;
3539
3577
  }, [props.items, props.categories]);
3540
3578
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(preparedItems);
3541
3579
  if (props.items.length === 0) {
@@ -3600,21 +3638,6 @@ function Table$2(props) {
3600
3638
  ));
3601
3639
  }
3602
3640
 
3603
- const useStyles$3 = createStyles((theme) => ({
3604
- th: { padding: "0 !important" },
3605
- control: {
3606
- width: "100%",
3607
- padding: `${theme.spacing.xs}px ${theme.spacing.md}px`,
3608
- "&:hover": {
3609
- backgroundColor: theme.colorScheme === "dark" ? theme.colors.dark[6] : theme.colors.gray[0]
3610
- }
3611
- }
3612
- }));
3613
- function Th({ children, reversed, sorted, onSort }) {
3614
- const { classes } = useStyles$3();
3615
- const Icon = sorted ? reversed ? IconChevronUp : IconChevronDown : IconSelector;
3616
- return /* @__PURE__ */ React.createElement("th", { className: classes.th }, /* @__PURE__ */ React.createElement(UnstyledButton, { onClick: onSort, className: classes.control }, /* @__PURE__ */ React.createElement(Group, { position: "apart", noWrap: true, spacing: "xs" }, /* @__PURE__ */ React.createElement(Text, { weight: 500, size: "sm", sx: { whiteSpace: "nowrap" } }, children), /* @__PURE__ */ React.createElement(Center, null, /* @__PURE__ */ React.createElement(Icon, { size: 14, stroke: 1.5 })))));
3617
- }
3618
3641
  function Table$1(props) {
3619
3642
  const { items: sortedItems, requestSort, sortConfig } = useSortableData(props.items);
3620
3643
  if (props.items.length === 0) {
@@ -3628,27 +3651,40 @@ function Table$1(props) {
3628
3651
  }
3629
3652
  );
3630
3653
  }
3631
- const rows = sortedItems.map((row) => {
3632
- const percentageCompletion = Math.round((row.percentageCompletion + Number.EPSILON) * 100);
3633
- return /* @__PURE__ */ React.createElement("tr", { key: row.badgeId }, /* @__PURE__ */ React.createElement("td", null, /* @__PURE__ */ React.createElement(Text, { component: Link, to: row.href }, row.badgeName)), /* @__PURE__ */ React.createElement("td", null, percentageCompletion, "%"));
3634
- });
3635
- return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(Table$l, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React.createElement("thead", null, /* @__PURE__ */ React.createElement("tr", null, /* @__PURE__ */ React.createElement(
3636
- Th,
3637
- {
3638
- sorted: sortConfig.key === "badgeName",
3639
- reversed: sortConfig.direction === "desc",
3640
- onSort: () => requestSort("badgeName")
3641
- },
3642
- "Badge Name"
3643
- ), /* @__PURE__ */ React.createElement(
3644
- Th,
3654
+ const sortStatus = {
3655
+ columnAccessor: sortConfig.key,
3656
+ direction: sortConfig.direction === "desc" ? "desc" : "asc"
3657
+ };
3658
+ return /* @__PURE__ */ React.createElement(ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React.createElement(
3659
+ DataTable,
3645
3660
  {
3646
- sorted: sortConfig.key === "percentageCompletion",
3647
- reversed: sortConfig.direction === "desc",
3648
- onSort: () => requestSort("percentageCompletion")
3649
- },
3650
- "Badge Completion"
3651
- ))), /* @__PURE__ */ React.createElement("tbody", null, rows)));
3661
+ verticalSpacing: "sm",
3662
+ sx: { minWidth: 700 },
3663
+ highlightOnHover: true,
3664
+ striped: true,
3665
+ records: sortedItems,
3666
+ idAccessor: "badgeId",
3667
+ sortStatus,
3668
+ onSortStatusChange: (status) => requestSort(status.columnAccessor),
3669
+ columns: [
3670
+ {
3671
+ accessor: "badgeName",
3672
+ title: "Badge Name",
3673
+ sortable: true,
3674
+ render: (row) => /* @__PURE__ */ React.createElement(Text, { component: Link, to: row.href, color: "blue" }, row.badgeName)
3675
+ },
3676
+ {
3677
+ accessor: "percentageCompletion",
3678
+ title: "Badge Completion",
3679
+ sortable: true,
3680
+ render: (row) => {
3681
+ const roundedValue = Math.round((row.percentageCompletion + Number.EPSILON) * 100);
3682
+ return `${roundedValue}%`;
3683
+ }
3684
+ }
3685
+ ]
3686
+ }
3687
+ ));
3652
3688
  }
3653
3689
 
3654
3690
  const useStyles$2 = createStyles((theme) => ({
@@ -3777,7 +3813,18 @@ const SplitButton = (props) => {
3777
3813
  function Stack(props) {
3778
3814
  if (!props.items.length)
3779
3815
  return null;
3780
- return /* @__PURE__ */ React.createElement(Grid, { gutter: "md", sx: { padding: 20, minWidth: 700 } }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "By link")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "By badge")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "By Lesson")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "By Question")), props.items.map((row, i) => /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement("a", { href: row.link, target: "_blank", rel: "noopener noreferrer" }, "View File")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, null, row.badgeName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, null, row.lessonName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 6 }, /* @__PURE__ */ React.createElement(Text, null, row.question)))));
3816
+ return /* @__PURE__ */ React.createElement(Grid, { gutter: "md", sx: { padding: 20, minWidth: 700 } }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Link")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Badge")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Lesson")), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, { color: "dark.4", weight: "bold", size: "md" }, "Question")), props.items.map((row, i) => /* @__PURE__ */ React.createElement(React.Fragment, { key: i }, /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(
3817
+ Button,
3818
+ {
3819
+ component: "a",
3820
+ href: row.link,
3821
+ target: "_blank",
3822
+ rel: "noopener noreferrer",
3823
+ size: "xs",
3824
+ variant: "light"
3825
+ },
3826
+ "View File"
3827
+ )), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.badgeName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.lessonName)), /* @__PURE__ */ React.createElement(Grid.Col, { span: 3 }, /* @__PURE__ */ React.createElement(Text, null, row.question)))));
3781
3828
  }
3782
3829
 
3783
3830
  var __defProp = Object.defineProperty;