dce-reactkit 3.4.0-beta.2 → 3.4.0-beta.4

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/cjs/index.js CHANGED
@@ -45,7 +45,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
45
  PERFORMANCE OF THIS SOFTWARE.
46
46
  ***************************************************************************** */
47
47
 
48
- function __awaiter$1(thisArg, _arguments, P, generator) {
48
+ function __awaiter(thisArg, _arguments, P, generator) {
49
49
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
50
  return new (P || (P = Promise))(function (resolve, reject) {
51
51
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -60,7 +60,7 @@ function __awaiter$1(thisArg, _arguments, P, generator) {
60
60
  * List of error codes built into the react kit
61
61
  * @author Gabe Abrams
62
62
  */
63
- var ReactKitErrorCode$2;
63
+ var ReactKitErrorCode;
64
64
  (function (ReactKitErrorCode) {
65
65
  ReactKitErrorCode["NoResponse"] = "DRK1";
66
66
  ReactKitErrorCode["NoCode"] = "DRK2";
@@ -75,8 +75,8 @@ var ReactKitErrorCode$2;
75
75
  ReactKitErrorCode["NotAllowedToReviewLogs"] = "DRK11";
76
76
  ReactKitErrorCode["ThemeCheckedBeforeReactKitReady"] = "DRK12";
77
77
  ReactKitErrorCode["SessionExpiredMessageGottenBeforeReactKitReady"] = "DRK13";
78
- })(ReactKitErrorCode$2 || (ReactKitErrorCode$2 = {}));
79
- var ReactKitErrorCode$3 = ReactKitErrorCode$2;
78
+ })(ReactKitErrorCode || (ReactKitErrorCode = {}));
79
+ var ReactKitErrorCode$1 = ReactKitErrorCode;
80
80
 
81
81
  /**
82
82
  * Displays an error
@@ -116,7 +116,7 @@ const ErrorBox = (props) => {
116
116
  } },
117
117
  "code:",
118
118
  ' ',
119
- String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$3.NoCode).toUpperCase())));
119
+ String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$1.NoCode).toUpperCase())));
120
120
  }
121
121
  // Main UI
122
122
  return (React__default["default"].createElement("div", { className: "alert alert-danger text-center", style: {
@@ -137,7 +137,7 @@ const ErrorBox = (props) => {
137
137
  * Types of buttons in the modal
138
138
  * @author Gabe Abrams
139
139
  */
140
- var ModalButtonType$2;
140
+ var ModalButtonType;
141
141
  (function (ModalButtonType) {
142
142
  ModalButtonType["Okay"] = "okay";
143
143
  ModalButtonType["Cancel"] = "cancel";
@@ -149,14 +149,14 @@ var ModalButtonType$2;
149
149
  ModalButtonType["ImSure"] = "imSure";
150
150
  ModalButtonType["Delete"] = "delete";
151
151
  ModalButtonType["Confirm"] = "confirm";
152
- })(ModalButtonType$2 || (ModalButtonType$2 = {}));
153
- var ModalButtonType$3 = ModalButtonType$2;
152
+ })(ModalButtonType || (ModalButtonType = {}));
153
+ var ModalButtonType$1 = ModalButtonType;
154
154
 
155
155
  /**
156
156
  * Types of modals
157
157
  * @author Gabe Abrams
158
158
  */
159
- var ModalType$2;
159
+ var ModalType;
160
160
  (function (ModalType) {
161
161
  ModalType["Okay"] = "okay";
162
162
  ModalType["OkayCancel"] = "okay-cancel";
@@ -167,8 +167,8 @@ var ModalType$2;
167
167
  ModalType["DeleteCancel"] = "delete-cancel";
168
168
  ModalType["ConfirmCancel"] = "confirm-cancel";
169
169
  ModalType["NoButtons"] = "-";
170
- })(ModalType$2 || (ModalType$2 = {}));
171
- var ModalType$3 = ModalType$2;
170
+ })(ModalType || (ModalType = {}));
171
+ var ModalType$1 = ModalType;
172
172
 
173
173
  /**
174
174
  * Built-in metadata for logs
@@ -193,7 +193,7 @@ const LogBuiltInMetadata = {
193
193
  * @author Gabe Abrams
194
194
  * @param ms number of ms to wait
195
195
  */
196
- const waitMs = (ms = 0) => __awaiter$1(void 0, void 0, void 0, function* () {
196
+ const waitMs = (ms = 0) => __awaiter(void 0, void 0, void 0, function* () {
197
197
  return new Promise((resolve) => {
198
198
  setTimeout(resolve, ms);
199
199
  });
@@ -203,7 +203,7 @@ const waitMs = (ms = 0) => __awaiter$1(void 0, void 0, void 0, function* () {
203
203
  * Bootstrap variants
204
204
  * @author Gabe Abrams
205
205
  */
206
- var Variant$2;
206
+ var Variant;
207
207
  (function (Variant) {
208
208
  Variant["Primary"] = "primary";
209
209
  Variant["Secondary"] = "secondary";
@@ -213,21 +213,21 @@ var Variant$2;
213
213
  Variant["Danger"] = "danger";
214
214
  Variant["Light"] = "light";
215
215
  Variant["Dark"] = "dark";
216
- })(Variant$2 || (Variant$2 = {}));
217
- var Variant$3 = Variant$2;
216
+ })(Variant || (Variant = {}));
217
+ var Variant$1 = Variant;
218
218
 
219
219
  /**
220
220
  * Modal sizes
221
221
  * @author Gabe Abrams
222
222
  */
223
- var ModalSize$1;
223
+ var ModalSize;
224
224
  (function (ModalSize) {
225
225
  ModalSize["Small"] = "sm";
226
226
  ModalSize["Medium"] = "md";
227
227
  ModalSize["Large"] = "lg";
228
228
  ModalSize["ExtraLarge"] = "xl";
229
- })(ModalSize$1 || (ModalSize$1 = {}));
230
- var ModalSize$2 = ModalSize$1;
229
+ })(ModalSize || (ModalSize = {}));
230
+ var ModalSize$1 = ModalSize;
231
231
 
232
232
  /**
233
233
  * A generic popup modal
@@ -240,86 +240,86 @@ var ModalSize$2 = ModalSize$1;
240
240
  const MS_TO_ANIMATE = 200; // Animation duration
241
241
  // Modal type to list of buttons
242
242
  const modalTypeToModalButtonTypes = {
243
- [ModalType$3.Okay]: [
244
- ModalButtonType$3.Okay,
243
+ [ModalType$1.Okay]: [
244
+ ModalButtonType$1.Okay,
245
245
  ],
246
- [ModalType$3.OkayCancel]: [
247
- ModalButtonType$3.Okay,
248
- ModalButtonType$3.Cancel,
246
+ [ModalType$1.OkayCancel]: [
247
+ ModalButtonType$1.Okay,
248
+ ModalButtonType$1.Cancel,
249
249
  ],
250
- [ModalType$3.YesNo]: [
251
- ModalButtonType$3.Yes,
252
- ModalButtonType$3.No,
250
+ [ModalType$1.YesNo]: [
251
+ ModalButtonType$1.Yes,
252
+ ModalButtonType$1.No,
253
253
  ],
254
- [ModalType$3.YesNoCancel]: [
255
- ModalButtonType$3.Yes,
256
- ModalButtonType$3.No,
257
- ModalButtonType$3.Cancel,
254
+ [ModalType$1.YesNoCancel]: [
255
+ ModalButtonType$1.Yes,
256
+ ModalButtonType$1.No,
257
+ ModalButtonType$1.Cancel,
258
258
  ],
259
- [ModalType$3.AbandonGoBack]: [
260
- ModalButtonType$3.Abandon,
261
- ModalButtonType$3.GoBack,
259
+ [ModalType$1.AbandonGoBack]: [
260
+ ModalButtonType$1.Abandon,
261
+ ModalButtonType$1.GoBack,
262
262
  ],
263
- [ModalType$3.ImSureCancel]: [
264
- ModalButtonType$3.ImSure,
265
- ModalButtonType$3.Cancel,
263
+ [ModalType$1.ImSureCancel]: [
264
+ ModalButtonType$1.ImSure,
265
+ ModalButtonType$1.Cancel,
266
266
  ],
267
- [ModalType$3.DeleteCancel]: [
268
- ModalButtonType$3.Delete,
269
- ModalButtonType$3.Cancel,
267
+ [ModalType$1.DeleteCancel]: [
268
+ ModalButtonType$1.Delete,
269
+ ModalButtonType$1.Cancel,
270
270
  ],
271
- [ModalType$3.ConfirmCancel]: [
272
- ModalButtonType$3.Confirm,
273
- ModalButtonType$3.Cancel,
271
+ [ModalType$1.ConfirmCancel]: [
272
+ ModalButtonType$1.Confirm,
273
+ ModalButtonType$1.Cancel,
274
274
  ],
275
275
  };
276
276
  // Button type styling and labels
277
277
  const ModalButtonTypeToLabelAndVariant = {
278
- [ModalButtonType$3.Okay]: {
278
+ [ModalButtonType$1.Okay]: {
279
279
  label: 'Okay',
280
- variant: Variant$3.Dark,
280
+ variant: Variant$1.Dark,
281
281
  },
282
- [ModalButtonType$3.Cancel]: {
282
+ [ModalButtonType$1.Cancel]: {
283
283
  label: 'Cancel',
284
- variant: Variant$3.Secondary,
284
+ variant: Variant$1.Secondary,
285
285
  },
286
- [ModalButtonType$3.Yes]: {
286
+ [ModalButtonType$1.Yes]: {
287
287
  label: 'Yes',
288
- variant: Variant$3.Dark,
288
+ variant: Variant$1.Dark,
289
289
  },
290
- [ModalButtonType$3.No]: {
290
+ [ModalButtonType$1.No]: {
291
291
  label: 'No',
292
- variant: Variant$3.Secondary,
292
+ variant: Variant$1.Secondary,
293
293
  },
294
- [ModalButtonType$3.Abandon]: {
294
+ [ModalButtonType$1.Abandon]: {
295
295
  label: 'Abandon Changes',
296
- variant: Variant$3.Warning,
296
+ variant: Variant$1.Warning,
297
297
  },
298
- [ModalButtonType$3.GoBack]: {
298
+ [ModalButtonType$1.GoBack]: {
299
299
  label: 'Go Back',
300
- variant: Variant$3.Secondary,
300
+ variant: Variant$1.Secondary,
301
301
  },
302
- [ModalButtonType$3.Continue]: {
302
+ [ModalButtonType$1.Continue]: {
303
303
  label: 'Continue',
304
- variant: Variant$3.Dark,
304
+ variant: Variant$1.Dark,
305
305
  },
306
- [ModalButtonType$3.ImSure]: {
306
+ [ModalButtonType$1.ImSure]: {
307
307
  label: 'I am sure',
308
- variant: Variant$3.Warning,
308
+ variant: Variant$1.Warning,
309
309
  },
310
- [ModalButtonType$3.Delete]: {
310
+ [ModalButtonType$1.Delete]: {
311
311
  label: 'Yes, Delete',
312
- variant: Variant$3.Danger,
312
+ variant: Variant$1.Danger,
313
313
  },
314
- [ModalButtonType$3.Confirm]: {
314
+ [ModalButtonType$1.Confirm]: {
315
315
  label: 'Confirm',
316
- variant: Variant$3.Dark,
316
+ variant: Variant$1.Dark,
317
317
  },
318
318
  };
319
319
  /*------------------------------------------------------------------------*/
320
320
  /* Style */
321
321
  /*------------------------------------------------------------------------*/
322
- const style$9 = `
322
+ const style$8 = `
323
323
  .Modal-backdrop {
324
324
  position: fixed;
325
325
  top: 0;
@@ -391,7 +391,7 @@ const Modal = (props) => {
391
391
  /*------------------------------------------------------------------------*/
392
392
  var _a;
393
393
  /* -------------- Props ------------- */
394
- const { type = ModalType$3.NoButtons, size = ModalSize$2.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
394
+ const { type = ModalType$1.NoButtons, size = ModalSize$1.Large, title, children, onClose, dontAllowBackdropExit, onTopOfOtherModals, } = props;
395
395
  /* -------------- State ------------- */
396
396
  // If true, the modal is shown
397
397
  const [visible, setVisible] = React.useState(false);
@@ -408,7 +408,7 @@ const Modal = (props) => {
408
408
  * @author Gabe Abrams
409
409
  */
410
410
  React.useEffect(() => {
411
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
411
+ (() => __awaiter(void 0, void 0, void 0, function* () {
412
412
  // Set defaults
413
413
  setVisible(false);
414
414
  setAnimatingIn(true);
@@ -434,7 +434,7 @@ const Modal = (props) => {
434
434
  * @param ModalButtonType the button that was clicked when closing the
435
435
  * modal
436
436
  */
437
- const handleClose = (ModalButtonType) => __awaiter$1(void 0, void 0, void 0, function* () {
437
+ const handleClose = (ModalButtonType) => __awaiter(void 0, void 0, void 0, function* () {
438
438
  // Don't close if no handler
439
439
  if (!onClose) {
440
440
  return;
@@ -493,10 +493,10 @@ const Modal = (props) => {
493
493
  left: 0,
494
494
  right: 0,
495
495
  } },
496
- React__default["default"].createElement("style", null, style$9),
496
+ React__default["default"].createElement("style", null, style$8),
497
497
  React__default["default"].createElement("div", { className: `Modal-backdrop ${backdropAnimationClass}`, style: {
498
498
  zIndex: 5000000003,
499
- }, onClick: () => __awaiter$1(void 0, void 0, void 0, function* () {
499
+ }, onClick: () => __awaiter(void 0, void 0, void 0, function* () {
500
500
  // Skip if exit via backdrop not allowed
501
501
  if (dontAllowBackdropExit || !onClose) {
502
502
  // Show pop animation
@@ -509,7 +509,7 @@ const Modal = (props) => {
509
509
  return;
510
510
  }
511
511
  // Handle close
512
- handleClose(ModalButtonType$3.Cancel);
512
+ handleClose(ModalButtonType$1.Cancel);
513
513
  }) }),
514
514
  React__default["default"].createElement("div", { className: `modal-dialog modal-${size} ${animationClass}`, style: {
515
515
  zIndex: 5000000002,
@@ -521,7 +521,7 @@ const Modal = (props) => {
521
521
  } }, title),
522
522
  onClose && (React__default["default"].createElement("button", { type: "button", className: "btn-close", "aria-label": "Close", onClick: () => {
523
523
  // Handle close
524
- handleClose(ModalButtonType$3.Cancel);
524
+ handleClose(ModalButtonType$1.Cancel);
525
525
  } }))),
526
526
  children && (React__default["default"].createElement("div", { className: "modal-body" }, children)),
527
527
  footer && (React__default["default"].createElement("div", { className: "modal-footer pt-1 pb-1" }, footer))))));
@@ -531,7 +531,7 @@ const Modal = (props) => {
531
531
  * An error with a code
532
532
  * @author Gabe Abrams
533
533
  */
534
- class ErrorWithCode$1 extends Error {
534
+ class ErrorWithCode extends Error {
535
535
  constructor(message, code) {
536
536
  super(message);
537
537
  this.name = 'ErrorWithCode';
@@ -578,10 +578,10 @@ let storedSendRequest;
578
578
  * @author Gabe Abrams
579
579
  * @returns sendRequest function
580
580
  */
581
- const getSendRequest = () => __awaiter$1(void 0, void 0, void 0, function* () {
581
+ const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
582
582
  // Track timeout
583
583
  let timedOut = false;
584
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
584
+ (() => __awaiter(void 0, void 0, void 0, function* () {
585
585
  yield waitMs(5000);
586
586
  timedOut = true;
587
587
  }))(),
@@ -589,7 +589,7 @@ const getSendRequest = () => __awaiter$1(void 0, void 0, void 0, function* () {
589
589
  yield initialized;
590
590
  // Error if no send request function
591
591
  if (timedOut) {
592
- showFatalError$1(new ErrorWithCode$1('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$3.NoCACCLSendRequestFunction));
592
+ showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
593
593
  // Return dummy function that never resolves
594
594
  return (() => {
595
595
  return new Promise(() => { });
@@ -628,12 +628,12 @@ const initClient = (opts) => {
628
628
  };
629
629
 
630
630
  // Keep track of whether or not session expiry has already been handled
631
- let sessionAlreadyExpired$1 = false;
631
+ let sessionAlreadyExpired = false;
632
632
  /*------------------------------------------------------------------------*/
633
633
  /* Stub Logic */
634
634
  /*------------------------------------------------------------------------*/
635
635
  // Stored stub responses
636
- const stubResponses$1 = {};
636
+ const stubResponses = {};
637
637
  /**
638
638
  * Add a stub response
639
639
  * @author Gabe Abrams
@@ -649,12 +649,12 @@ const _setStubResponse = (opts) => {
649
649
  const { path, body, } = opts;
650
650
  const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET').toUpperCase();
651
651
  const errorMessage = ((_b = opts.errorMessage) !== null && _b !== void 0 ? _b : 'An unknown error has occurred.');
652
- const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$3.NoCode);
652
+ const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$1.NoCode);
653
653
  // Store to stub responses
654
- if (!stubResponses$1[method]) {
655
- stubResponses$1[method] = {};
654
+ if (!stubResponses[method]) {
655
+ stubResponses[method] = {};
656
656
  }
657
- stubResponses$1[method][path] = ((opts.errorMessage || opts.errorCode)
657
+ stubResponses[method][path] = ((opts.errorMessage || opts.errorCode)
658
658
  ? {
659
659
  success: false,
660
660
  errorMessage,
@@ -677,15 +677,15 @@ const _setStubResponse = (opts) => {
677
677
  * @param [opts.params] - query/body parameters to include
678
678
  * @returns response from server
679
679
  */
680
- const visitServerEndpoint$1 = (opts) => __awaiter$1(void 0, void 0, void 0, function* () {
680
+ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function* () {
681
681
  var _a, _b, _c;
682
682
  const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET');
683
683
  // Handle stubs
684
- const stubResponse = (_b = stubResponses$1[method]) === null || _b === void 0 ? void 0 : _b[opts.path];
684
+ const stubResponse = (_b = stubResponses[method]) === null || _b === void 0 ? void 0 : _b[opts.path];
685
685
  if (stubResponse) {
686
686
  // Remove from list
687
687
  try {
688
- stubResponses$1[method][opts.path] = undefined;
688
+ stubResponses[method][opts.path] = undefined;
689
689
  }
690
690
  catch (err) {
691
691
  // Ignore
@@ -695,7 +695,7 @@ const visitServerEndpoint$1 = (opts) => __awaiter$1(void 0, void 0, void 0, func
695
695
  return stubResponse.body;
696
696
  }
697
697
  // Error
698
- throw new ErrorWithCode$1(stubResponse.errorMessage, stubResponse.errorCode);
698
+ throw new ErrorWithCode(stubResponse.errorMessage, stubResponse.errorCode);
699
699
  }
700
700
  // Send the request
701
701
  const sendRequest = yield getSendRequest();
@@ -706,19 +706,19 @@ const visitServerEndpoint$1 = (opts) => __awaiter$1(void 0, void 0, void 0, func
706
706
  });
707
707
  // Check for failure
708
708
  if (!response || !response.body) {
709
- throw new ErrorWithCode$1('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$3.NoResponse);
709
+ throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$1.NoResponse);
710
710
  }
711
711
  if (!response.body.success) {
712
712
  // Session expired
713
- if (response.body.code === ReactKitErrorCode$3.SessionExpired) {
713
+ if (response.body.code === ReactKitErrorCode$1.SessionExpired) {
714
714
  // Skip notice if session was already expired
715
- if (sessionAlreadyExpired$1) {
715
+ if (sessionAlreadyExpired) {
716
716
  // Never return (browser is already reloading)
717
717
  yield new Promise(() => {
718
718
  // Promise that never returns
719
719
  });
720
720
  }
721
- sessionAlreadyExpired$1 = true;
721
+ sessionAlreadyExpired = true;
722
722
  // Show session expiration message
723
723
  {
724
724
  // Fallback to alert
@@ -731,9 +731,9 @@ const visitServerEndpoint$1 = (opts) => __awaiter$1(void 0, void 0, void 0, func
731
731
  });
732
732
  }
733
733
  // Other errors
734
- throw new ErrorWithCode$1((response.body.message
734
+ throw new ErrorWithCode((response.body.message
735
735
  || 'An unknown error occurred. Please contact an admin.'), (response.body.code
736
- || ReactKitErrorCode$3.NoCode));
736
+ || ReactKitErrorCode$1.NoCode));
737
737
  }
738
738
  // Success! Extract the body
739
739
  const { body } = response.body;
@@ -745,9 +745,9 @@ const visitServerEndpoint$1 = (opts) => __awaiter$1(void 0, void 0, void 0, func
745
745
  * Log a user action on the client (cannot be used on the server)
746
746
  * @author Gabe Abrams
747
747
  */
748
- const logClientEvent = (opts) => __awaiter$1(void 0, void 0, void 0, function* () {
748
+ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
749
749
  var _a, _b, _c, _d, _e, _f, _g;
750
- return visitServerEndpoint$1({
750
+ return visitServerEndpoint({
751
751
  path: LOG_ROUTE_PATH,
752
752
  method: 'POST',
753
753
  params: {
@@ -797,7 +797,7 @@ let onAlertClosed;
797
797
  * @param title the title text to display at the top of the alert
798
798
  * @param text the text to display in the alert
799
799
  */
800
- const alert$2 = (title, text) => __awaiter$1(void 0, void 0, void 0, function* () {
800
+ const alert$1 = (title, text) => __awaiter(void 0, void 0, void 0, function* () {
801
801
  // Fallback if alert not available
802
802
  if (!setAlertInfo) {
803
803
  window.alert(`${title}\n\n${text}`);
@@ -837,7 +837,7 @@ let onConfirmClosed;
837
837
  * button
838
838
  * @returns true if the user confirmed
839
839
  */
840
- const confirm = (title, text, opts) => __awaiter$1(void 0, void 0, void 0, function* () {
840
+ const confirm = (title, text, opts) => __awaiter(void 0, void 0, void 0, function* () {
841
841
  // Fallback if confirm is not available
842
842
  if (!setConfirmInfo) {
843
843
  return window.confirm(`${title}\n\n${text}`);
@@ -869,15 +869,15 @@ let setFatalErrorTitle;
869
869
  * @param error the error to show
870
870
  * @param [errorTitle] title of the error box
871
871
  */
872
- const showFatalError$1 = (error, errorTitle = 'An Error Occurred') => {
872
+ const showFatalError = (error, errorTitle = 'An Error Occurred') => {
873
873
  var _a, _b;
874
874
  // Determine message and code
875
875
  const message = (typeof error === 'string'
876
876
  ? error.trim()
877
877
  : String((_a = error.message) !== null && _a !== void 0 ? _a : 'An unknown error occurred.'));
878
878
  const code = (typeof error === 'string'
879
- ? ReactKitErrorCode$3.NoCode
880
- : String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$3.NoCode));
879
+ ? ReactKitErrorCode$1.NoCode
880
+ : String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$1.NoCode));
881
881
  // Add log
882
882
  logClientEvent({
883
883
  context: LogBuiltInMetadata.Context.ClientFatalError,
@@ -892,7 +892,7 @@ const showFatalError$1 = (error, errorTitle = 'An Error Occurred') => {
892
892
  });
893
893
  // Handle case where app hasn't loaded
894
894
  if (!setFatalErrorMessage || !setFatalErrorCode) {
895
- alert$2(errorTitle, `${message} (code: ${code}). Please contact support.`);
895
+ alert$1(errorTitle, `${message} (code: ${code}). Please contact support.`);
896
896
  return undefined;
897
897
  }
898
898
  // Use setters
@@ -936,7 +936,7 @@ const AppWrapper = (props) => {
936
936
  let modal;
937
937
  /* -------------- Alert ------------- */
938
938
  if (alertInfo) {
939
- modal = (React__default["default"].createElement(Modal, { key: `alert-${alertInfo.title}-${alertInfo.text}`, title: alertInfo.title, type: ModalType$3.Okay, onClose: () => {
939
+ modal = (React__default["default"].createElement(Modal, { key: `alert-${alertInfo.title}-${alertInfo.text}`, title: alertInfo.title, type: ModalType$1.Okay, onClose: () => {
940
940
  // Alert closed
941
941
  setAlertInfo(undefined);
942
942
  if (onAlertClosed) {
@@ -946,10 +946,10 @@ const AppWrapper = (props) => {
946
946
  }
947
947
  /* ------------- Confirm ------------ */
948
948
  if (confirmInfo) {
949
- modal = (React__default["default"].createElement(Modal, { key: `confirm-${confirmInfo.title}-${confirmInfo.text}`, title: confirmInfo.title, type: ModalType$3.OkayCancel, okayLabel: confirmInfo.opts.confirmButtonText, okayVariant: confirmInfo.opts.confirmButtonVariant, cancelLabel: confirmInfo.opts.cancelButtonText, cancelVariant: confirmInfo.opts.cancelButtonVariant, onClose: (buttonType) => {
949
+ modal = (React__default["default"].createElement(Modal, { key: `confirm-${confirmInfo.title}-${confirmInfo.text}`, title: confirmInfo.title, type: ModalType$1.OkayCancel, okayLabel: confirmInfo.opts.confirmButtonText, okayVariant: confirmInfo.opts.confirmButtonVariant, cancelLabel: confirmInfo.opts.cancelButtonText, cancelVariant: confirmInfo.opts.cancelButtonVariant, onClose: (buttonType) => {
950
950
  setConfirmInfo(undefined);
951
951
  if (onConfirmClosed) {
952
- onConfirmClosed(buttonType === ModalButtonType$3.Okay);
952
+ onConfirmClosed(buttonType === ModalButtonType$1.Okay);
953
953
  }
954
954
  }, dontAllowBackdropExit: true }, confirmInfo.text));
955
955
  }
@@ -962,8 +962,8 @@ const AppWrapper = (props) => {
962
962
  if (fatalErrorMessage || fatalErrorCode || sessionHasExpired) {
963
963
  // Re-encapsulate in an error
964
964
  const error = (sessionHasExpired
965
- ? new ErrorWithCode$1(getSessionExpiredMessage(), ReactKitErrorCode$3.SessionExpired)
966
- : new ErrorWithCode$1((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$3.NoCode)));
965
+ ? new ErrorWithCode(getSessionExpiredMessage(), ReactKitErrorCode$1.SessionExpired)
966
+ : new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$1.NoCode)));
967
967
  // Build error screen
968
968
  body = (React__default["default"].createElement("div", { style: {
969
969
  display: 'block',
@@ -997,7 +997,7 @@ const AppWrapper = (props) => {
997
997
  /*------------------------------------------------------------------------*/
998
998
  /* Style */
999
999
  /*------------------------------------------------------------------------*/
1000
- const style$8 = `
1000
+ const style$7 = `
1001
1001
  /* Container fades in */
1002
1002
  .LoadingSpinner-container {
1003
1003
  animation-name: LoadingSpinner-container-fade-in;
@@ -1069,13 +1069,13 @@ const style$8 = `
1069
1069
  /*------------------------------------------------------------------------*/
1070
1070
  /* Component */
1071
1071
  /*------------------------------------------------------------------------*/
1072
- const LoadingSpinner$1 = () => {
1072
+ const LoadingSpinner = () => {
1073
1073
  /*------------------------------------------------------------------------*/
1074
1074
  /* Render */
1075
1075
  /*------------------------------------------------------------------------*/
1076
1076
  // Add all four blips to a container
1077
1077
  return (React__default["default"].createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
1078
- React__default["default"].createElement("style", null, style$8),
1078
+ React__default["default"].createElement("style", null, style$7),
1079
1079
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-1 me-1" }),
1080
1080
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-2 me-1" }),
1081
1081
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-3 me-1" }),
@@ -1089,7 +1089,7 @@ const LoadingSpinner$1 = () => {
1089
1089
  /*------------------------------------------------------------------------*/
1090
1090
  /* Style */
1091
1091
  /*------------------------------------------------------------------------*/
1092
- const style$7 = `
1092
+ const style$6 = `
1093
1093
  /* Tab Box */
1094
1094
  .TabBox-box {
1095
1095
  /* Light Border */
@@ -1169,7 +1169,7 @@ const TabBox = (props) => {
1169
1169
  /*----------------------------------------*/
1170
1170
  // Full UI
1171
1171
  return (React__default["default"].createElement("div", { className: `TabBox-container ${noBottomMargin ? '' : 'mb-2'}` },
1172
- React__default["default"].createElement("style", null, style$7),
1172
+ React__default["default"].createElement("style", null, style$6),
1173
1173
  React__default["default"].createElement("div", { className: "TabBox-title-container" },
1174
1174
  React__default["default"].createElement("div", { className: "TabBox-title" }, title)),
1175
1175
  React__default["default"].createElement("div", { className: `TabBox-box ps-2 pt-2 pe-2 ${noBottomPadding ? '' : 'pb-2'}` },
@@ -1183,12 +1183,12 @@ const TabBox = (props) => {
1183
1183
  /*------------------------------------------------------------------------*/
1184
1184
  /* Component */
1185
1185
  /*------------------------------------------------------------------------*/
1186
- const RadioButton$1 = (props) => {
1186
+ const RadioButton = (props) => {
1187
1187
  /*------------------------------------------------------------------------*/
1188
1188
  /* Setup */
1189
1189
  /*------------------------------------------------------------------------*/
1190
1190
  /* -------------- Props ------------- */
1191
- const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$3.Secondary, unselectedVariant = Variant$3.Light, small, } = props;
1191
+ const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$1.Secondary, unselectedVariant = Variant$1.Light, small, } = props;
1192
1192
  /*------------------------------------------------------------------------*/
1193
1193
  /* Render */
1194
1194
  /*------------------------------------------------------------------------*/
@@ -1211,12 +1211,12 @@ const RadioButton$1 = (props) => {
1211
1211
  /*------------------------------------------------------------------------*/
1212
1212
  /* Component */
1213
1213
  /*------------------------------------------------------------------------*/
1214
- const CheckboxButton$1 = (props) => {
1214
+ const CheckboxButton = (props) => {
1215
1215
  /*------------------------------------------------------------------------*/
1216
1216
  /* Setup */
1217
1217
  /*------------------------------------------------------------------------*/
1218
1218
  /* -------------- Props ------------- */
1219
- const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$3.Secondary, uncheckedVariant = Variant$3.Light, small, dashed, } = props;
1219
+ const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
1220
1220
  /*------------------------------------------------------------------------*/
1221
1221
  /* Render */
1222
1222
  /*------------------------------------------------------------------------*/
@@ -1248,7 +1248,7 @@ const CheckboxButton$1 = (props) => {
1248
1248
  /*------------------------------------------------------------------------*/
1249
1249
  /* Component */
1250
1250
  /*------------------------------------------------------------------------*/
1251
- const ButtonInputGroup$1 = (props) => {
1251
+ const ButtonInputGroup = (props) => {
1252
1252
  /*------------------------------------------------------------------------*/
1253
1253
  /* Setup */
1254
1254
  /*------------------------------------------------------------------------*/
@@ -1490,7 +1490,7 @@ const SimpleDateChooser = (props) => {
1490
1490
  /*------------------------------------------------------------------------*/
1491
1491
  /* Style */
1492
1492
  /*------------------------------------------------------------------------*/
1493
- const style$6 = `
1493
+ const style$5 = `
1494
1494
  .Drawer-container {
1495
1495
  margin-left: 1rem;
1496
1496
  margin-right: 1rem;
@@ -1524,7 +1524,7 @@ const Drawer = (props) => {
1524
1524
  return (React__default["default"].createElement("div", { className: "Drawer-container", style: {
1525
1525
  backgroundColor: (customBackgroundColor !== null && customBackgroundColor !== void 0 ? customBackgroundColor : undefined),
1526
1526
  } },
1527
- React__default["default"].createElement("style", null, style$6),
1527
+ React__default["default"].createElement("style", null, style$5),
1528
1528
  children));
1529
1529
  };
1530
1530
 
@@ -1862,13 +1862,13 @@ const PopPendingMark = (props) => {
1862
1862
  */
1863
1863
  /* ------------- Actions ------------ */
1864
1864
  // Types of actions
1865
- var ActionType$7;
1865
+ var ActionType$6;
1866
1866
  (function (ActionType) {
1867
1867
  // Indicate that the text was recently copied
1868
1868
  ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
1869
1869
  // Clear the status
1870
1870
  ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
1871
- })(ActionType$7 || (ActionType$7 = {}));
1871
+ })(ActionType$6 || (ActionType$6 = {}));
1872
1872
  /**
1873
1873
  * Reducer that executes actions
1874
1874
  * @author Gabe Abrams
@@ -1877,12 +1877,12 @@ var ActionType$7;
1877
1877
  */
1878
1878
  const reducer$6 = (state, action) => {
1879
1879
  switch (action.type) {
1880
- case ActionType$7.IndicateRecentlyCopied: {
1880
+ case ActionType$6.IndicateRecentlyCopied: {
1881
1881
  return {
1882
1882
  recentlyCopied: true,
1883
1883
  };
1884
1884
  }
1885
- case ActionType$7.ClearRecentlyCopiedStatus: {
1885
+ case ActionType$6.ClearRecentlyCopiedStatus: {
1886
1886
  return {
1887
1887
  recentlyCopied: false,
1888
1888
  };
@@ -1918,23 +1918,23 @@ const CopiableBox = (props) => {
1918
1918
  * Perform a copy
1919
1919
  * @author Gabe Abrams
1920
1920
  */
1921
- const performCopy = () => __awaiter$1(void 0, void 0, void 0, function* () {
1921
+ const performCopy = () => __awaiter(void 0, void 0, void 0, function* () {
1922
1922
  // Write to clipboard
1923
1923
  try {
1924
1924
  yield navigator.clipboard.writeText(text);
1925
1925
  }
1926
1926
  catch (err) {
1927
- return alert$2('Unable to copy', 'Oops! We couldn\'t copy that to the clipboard. Please copy the text manually.');
1927
+ return alert$1('Unable to copy', 'Oops! We couldn\'t copy that to the clipboard. Please copy the text manually.');
1928
1928
  }
1929
1929
  // Show copied notice
1930
1930
  dispatch({
1931
- type: ActionType$7.IndicateRecentlyCopied,
1931
+ type: ActionType$6.IndicateRecentlyCopied,
1932
1932
  });
1933
1933
  // Wait a moment
1934
1934
  yield waitMs(4000);
1935
1935
  // Hide copied notice
1936
1936
  dispatch({
1937
- type: ActionType$7.ClearRecentlyCopiedStatus,
1937
+ type: ActionType$6.ClearRecentlyCopiedStatus,
1938
1938
  });
1939
1939
  });
1940
1940
  /*------------------------------------------------------------------------*/
@@ -1990,11 +1990,11 @@ const CopiableBox = (props) => {
1990
1990
  */
1991
1991
  /* ------------- Actions ------------ */
1992
1992
  // Types of actions
1993
- var ActionType$6;
1993
+ var ActionType$5;
1994
1994
  (function (ActionType) {
1995
1995
  // Toggle whether a child are being shown
1996
1996
  ActionType["ToggleChild"] = "toggle-child";
1997
- })(ActionType$6 || (ActionType$6 = {}));
1997
+ })(ActionType$5 || (ActionType$5 = {}));
1998
1998
  /**
1999
1999
  * Reducer that executes actions
2000
2000
  * @author Gabe Abrams
@@ -2003,7 +2003,7 @@ var ActionType$6;
2003
2003
  */
2004
2004
  const reducer$5 = (state, action) => {
2005
2005
  switch (action.type) {
2006
- case ActionType$6.ToggleChild: {
2006
+ case ActionType$5.ToggleChild: {
2007
2007
  return Object.assign(Object.assign({}, state), { childExpanded: Object.assign(Object.assign({}, state.childExpanded), { [String(action.id)]: !state.childExpanded[String(action.id)] }) });
2008
2008
  }
2009
2009
  default: {
@@ -2122,14 +2122,14 @@ const NestableItemList = (props) => {
2122
2122
  backgroundColor: 'transparent',
2123
2123
  }, type: "button", onClick: () => {
2124
2124
  dispatch({
2125
- type: ActionType$6.ToggleChild,
2125
+ type: ActionType$5.ToggleChild,
2126
2126
  id: item.id,
2127
2127
  });
2128
2128
  }, "aria-label": `${childExpanded[item.id] ? 'Hide' : 'Show'} items in ${item.name}` },
2129
2129
  React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: childExpanded[item.id] ? freeSolidSvgIcons.faChevronDown : freeSolidSvgIcons.faChevronRight })))),
2130
- React__default["default"].createElement(CheckboxButton$1, { className: `NestableItemList-CheckboxButton-${item.id}`, text: item.name, checked: item.isGroup ? allChecked(item.children) : item.checked, dashed: item.isGroup ? !noneChecked(item.children) : false, onChanged: (checked) => {
2130
+ React__default["default"].createElement(CheckboxButton, { className: `NestableItemList-CheckboxButton-${item.id}`, text: item.name, checked: item.isGroup ? allChecked(item.children) : item.checked, dashed: item.isGroup ? !noneChecked(item.children) : false, onChanged: (checked) => {
2131
2131
  onChanged(changeChecked(item.id, checked, items));
2132
- }, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$3.Light }),
2132
+ }, ariaLabel: `Select ${item.name}`, checkedVariant: Variant$1.Light }),
2133
2133
  (item.isGroup && childExpanded[item.id]) && (React__default["default"].createElement("div", { className: "NestableItemList-children-container", style: {
2134
2134
  paddingLeft: '2.2rem',
2135
2135
  } },
@@ -2267,7 +2267,7 @@ var LogAction$1 = LogAction;
2267
2267
  * Server-side API param types
2268
2268
  * @author Gabe Abrams
2269
2269
  */
2270
- var ParamType$2;
2270
+ var ParamType;
2271
2271
  (function (ParamType) {
2272
2272
  ParamType["Boolean"] = "boolean";
2273
2273
  ParamType["BooleanOptional"] = "boolean-optional";
@@ -2279,8 +2279,8 @@ var ParamType$2;
2279
2279
  ParamType["JSONOptional"] = "json-optional";
2280
2280
  ParamType["String"] = "string";
2281
2281
  ParamType["StringOptional"] = "string-optional";
2282
- })(ParamType$2 || (ParamType$2 = {}));
2283
- var ParamType$3 = ParamType$2;
2282
+ })(ParamType || (ParamType = {}));
2283
+ var ParamType$1 = ParamType;
2284
2284
 
2285
2285
  /**
2286
2286
  * Round a number to a certain number of decimals
@@ -2397,7 +2397,7 @@ var SortType;
2397
2397
  })(SortType || (SortType = {}));
2398
2398
  /* ------------- Actions ------------ */
2399
2399
  // Types of actions
2400
- var ActionType$5;
2400
+ var ActionType$4;
2401
2401
  (function (ActionType) {
2402
2402
  // Toggle sort column param
2403
2403
  ActionType["ToggleSortColumn"] = "toggle-sort-column";
@@ -2409,7 +2409,7 @@ var ActionType$5;
2409
2409
  ActionType["ShowAllColumns"] = "show-all-columns";
2410
2410
  // Hide all columns
2411
2411
  ActionType["HideAllColumns"] = "hide-all-columns";
2412
- })(ActionType$5 || (ActionType$5 = {}));
2412
+ })(ActionType$4 || (ActionType$4 = {}));
2413
2413
  /**
2414
2414
  * Reducer that executes actions
2415
2415
  * @author Gabe Abrams
@@ -2418,7 +2418,7 @@ var ActionType$5;
2418
2418
  */
2419
2419
  const reducer$4 = (state, action) => {
2420
2420
  switch (action.type) {
2421
- case ActionType$5.ToggleSortColumn: {
2421
+ case ActionType$4.ToggleSortColumn: {
2422
2422
  if (action.param !== state.sortColumnParam) {
2423
2423
  // Different column param
2424
2424
  return Object.assign(Object.assign({}, state), { sortColumnParam: action.param, sortType: SortType.Ascending });
@@ -2430,22 +2430,22 @@ const reducer$4 = (state, action) => {
2430
2430
  // Stop sorting by column
2431
2431
  return Object.assign(Object.assign({}, state), { sortColumnParam: undefined, sortType: SortType.Ascending });
2432
2432
  }
2433
- case ActionType$5.UpdateColumnVisibility: {
2433
+ case ActionType$4.UpdateColumnVisibility: {
2434
2434
  const { columnVisibilityMap } = state;
2435
2435
  columnVisibilityMap[action.param] = action.visible;
2436
2436
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2437
2437
  }
2438
- case ActionType$5.ToggleColVisCusModalVisibility: {
2438
+ case ActionType$4.ToggleColVisCusModalVisibility: {
2439
2439
  return Object.assign(Object.assign({}, state), { columnVisibilityCustomizationModalVisible: !state.columnVisibilityCustomizationModalVisible });
2440
2440
  }
2441
- case ActionType$5.ShowAllColumns: {
2441
+ case ActionType$4.ShowAllColumns: {
2442
2442
  const { columnVisibilityMap } = state;
2443
2443
  Object.keys(columnVisibilityMap).forEach((param) => {
2444
2444
  columnVisibilityMap[param] = true;
2445
2445
  });
2446
2446
  return Object.assign(Object.assign({}, state), { columnVisibilityMap });
2447
2447
  }
2448
- case ActionType$5.HideAllColumns: {
2448
+ case ActionType$4.HideAllColumns: {
2449
2449
  const { columnVisibilityMap } = state;
2450
2450
  Object.keys(columnVisibilityMap).forEach((param) => {
2451
2451
  columnVisibilityMap[param] = false;
@@ -2506,36 +2506,36 @@ const IntelliTable = (props) => {
2506
2506
  /* ------- Col Vis Customization Modal ------ */
2507
2507
  if (columnVisibilityCustomizationModalVisible) {
2508
2508
  // Create modal
2509
- modal = (React__default["default"].createElement(Modal, { type: ModalType$3.Okay, title: "Choose columns to show:", onClose: () => {
2509
+ modal = (React__default["default"].createElement(Modal, { type: ModalType$1.Okay, title: "Choose columns to show:", onClose: () => {
2510
2510
  const noColumnsSelected = (Object.values(columnVisibilityMap)
2511
2511
  .every((isSelected) => {
2512
2512
  return !isSelected;
2513
2513
  }));
2514
2514
  if (noColumnsSelected) {
2515
- return alert$2('Choose at least one column', 'To continue, you have to choose at least one column to show');
2515
+ return alert$1('Choose at least one column', 'To continue, you have to choose at least one column to show');
2516
2516
  }
2517
2517
  dispatch({
2518
- type: ActionType$5.ToggleColVisCusModalVisibility,
2518
+ type: ActionType$4.ToggleColVisCusModalVisibility,
2519
2519
  });
2520
- }, okayVariant: Variant$3.Light },
2520
+ }, okayVariant: Variant$1.Light },
2521
2521
  columns.map((column) => {
2522
- return (React__default["default"].createElement(CheckboxButton$1, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
2522
+ return (React__default["default"].createElement(CheckboxButton, { key: column.param, id: `IntelliTable-${id}-toggle-visibility-${column.param}`, className: "mb-2", text: column.title, onChanged: (checked) => {
2523
2523
  dispatch({
2524
- type: ActionType$5.UpdateColumnVisibility,
2524
+ type: ActionType$4.UpdateColumnVisibility,
2525
2525
  param: column.param,
2526
2526
  visible: checked,
2527
2527
  });
2528
- }, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$3.Light, uncheckedVariant: Variant$3.Secondary }));
2528
+ }, checked: columnVisibilityMap[column.param], ariaLabel: `show "${column.title}" column in the ${title} table`, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Secondary }));
2529
2529
  }),
2530
2530
  React__default["default"].createElement("div", { className: "mt-3" }, "Or you can:"),
2531
2531
  React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-select-all-columns`, className: "btn btn-secondary me-2", "aria-label": `show all columns in the ${title} table`, onClick: () => {
2532
2532
  dispatch({
2533
- type: ActionType$5.ShowAllColumns,
2533
+ type: ActionType$4.ShowAllColumns,
2534
2534
  });
2535
2535
  } }, "Select All"),
2536
2536
  React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-select-none-columns`, className: "btn btn-secondary", "aria-label": `hide all columns in the ${title} table`, onClick: () => {
2537
2537
  dispatch({
2538
- type: ActionType$5.HideAllColumns,
2538
+ type: ActionType$4.HideAllColumns,
2539
2539
  });
2540
2540
  } }, "Deselect All")));
2541
2541
  }
@@ -2586,7 +2586,7 @@ const IntelliTable = (props) => {
2586
2586
  React__default["default"].createElement("div", null,
2587
2587
  React__default["default"].createElement("button", { type: "button", id: `IntelliTable-${id}-sort-by-${column.param}-button`, className: `btn btn-${sortingByThisColumn ? 'light' : 'secondary'} btn-sm ms-1 ps-1 pe-1 pt-0 pb-0`, "aria-label": sortButtonAriaLabel, onClick: () => {
2588
2588
  dispatch({
2589
- type: ActionType$5.ToggleSortColumn,
2589
+ type: ActionType$4.ToggleSortColumn,
2590
2590
  param: column.param,
2591
2591
  });
2592
2592
  } },
@@ -2626,7 +2626,7 @@ const IntelliTable = (props) => {
2626
2626
  }
2627
2627
  // Sort differently based on the data type
2628
2628
  // > Boolean
2629
- if (paramType === ParamType$3.Boolean) {
2629
+ if (paramType === ParamType$1.Boolean) {
2630
2630
  if (aVal && !bVal) {
2631
2631
  return (descending ? -1 : 1);
2632
2632
  }
@@ -2636,14 +2636,14 @@ const IntelliTable = (props) => {
2636
2636
  return tiebreaker;
2637
2637
  }
2638
2638
  // > Number
2639
- if (paramType === ParamType$3.Int
2640
- || paramType === ParamType$3.Float) {
2639
+ if (paramType === ParamType$1.Int
2640
+ || paramType === ParamType$1.Float) {
2641
2641
  return (descending
2642
2642
  ? (bVal - aVal)
2643
2643
  : (aVal - bVal));
2644
2644
  }
2645
2645
  // > String
2646
- if (paramType === ParamType$3.String) {
2646
+ if (paramType === ParamType$1.String) {
2647
2647
  if (aVal < bVal) {
2648
2648
  return (descending ? 1 : -1);
2649
2649
  }
@@ -2653,7 +2653,7 @@ const IntelliTable = (props) => {
2653
2653
  return tiebreaker;
2654
2654
  }
2655
2655
  // > JSON
2656
- if (paramType === ParamType$3.JSON) {
2656
+ if (paramType === ParamType$1.JSON) {
2657
2657
  const aSize = (Array.isArray(aVal)
2658
2658
  ? aVal.length
2659
2659
  : Object.keys(aVal).length);
@@ -2685,7 +2685,7 @@ const IntelliTable = (props) => {
2685
2685
  let fullValue;
2686
2686
  let visibleValue;
2687
2687
  let title = '';
2688
- if (column.type === ParamType$3.Boolean) {
2688
+ if (column.type === ParamType$1.Boolean) {
2689
2689
  fullValue = !!(value);
2690
2690
  const noValue = (value === undefined
2691
2691
  || value === null);
@@ -2697,7 +2697,7 @@ const IntelliTable = (props) => {
2697
2697
  title = 'Empty Cell';
2698
2698
  }
2699
2699
  }
2700
- else if (column.type === ParamType$3.Int) {
2700
+ else if (column.type === ParamType$1.Int) {
2701
2701
  fullValue = Number.parseInt(value, 10);
2702
2702
  const noValue = Number.isNaN(fullValue);
2703
2703
  visibleValue = (noValue
@@ -2708,7 +2708,7 @@ const IntelliTable = (props) => {
2708
2708
  title = 'Empty Cell';
2709
2709
  }
2710
2710
  }
2711
- else if (column.type === ParamType$3.Float) {
2711
+ else if (column.type === ParamType$1.Float) {
2712
2712
  fullValue = Number.parseFloat(value);
2713
2713
  const noValue = Number.isNaN(fullValue);
2714
2714
  visibleValue = (noValue
@@ -2719,7 +2719,7 @@ const IntelliTable = (props) => {
2719
2719
  title = 'Empty Cell';
2720
2720
  }
2721
2721
  }
2722
- else if (column.type === ParamType$3.String) {
2722
+ else if (column.type === ParamType$1.String) {
2723
2723
  fullValue = String(value).trim();
2724
2724
  const noValue = (value === undefined
2725
2725
  || value === null
@@ -2732,7 +2732,7 @@ const IntelliTable = (props) => {
2732
2732
  title = 'Empty Cell';
2733
2733
  }
2734
2734
  }
2735
- else if (column.type === ParamType$3.JSON) {
2735
+ else if (column.type === ParamType$1.JSON) {
2736
2736
  fullValue = JSON.stringify(value);
2737
2737
  const noValue = (Array.isArray(value)
2738
2738
  ? (!value || value.length === 0)
@@ -2775,7 +2775,7 @@ const IntelliTable = (props) => {
2775
2775
  React__default["default"].createElement(CSVDownloadButton, { "aria-label": `download data as csv for ${title}`, id: `IntelliTable-${id}-download-as-csv`, filename: filename, csv: csv }),
2776
2776
  React__default["default"].createElement("button", { type: "button", className: "btn btn-secondary ms-2", "aria-label": `show panel for customizing which columns show in table ${title}`, id: `IntelliTable-${id}-show-column-customization-modal`, onClick: () => {
2777
2777
  dispatch({
2778
- type: ActionType$5.ToggleColVisCusModalVisibility,
2778
+ type: ActionType$4.ToggleColVisCusModalVisibility,
2779
2779
  });
2780
2780
  } },
2781
2781
  "Show/Hide Cols",
@@ -2897,185 +2897,185 @@ const columns = [
2897
2897
  {
2898
2898
  title: 'First Name',
2899
2899
  param: 'userFirstName',
2900
- type: ParamType$3.String,
2900
+ type: ParamType$1.String,
2901
2901
  },
2902
2902
  {
2903
2903
  title: 'Last Name',
2904
2904
  param: 'userLastName',
2905
- type: ParamType$3.String,
2905
+ type: ParamType$1.String,
2906
2906
  },
2907
2907
  {
2908
2908
  title: 'Email',
2909
2909
  param: 'userEmail',
2910
- type: ParamType$3.String,
2910
+ type: ParamType$1.String,
2911
2911
  },
2912
2912
  {
2913
2913
  title: 'Canvas Id',
2914
2914
  param: 'userId',
2915
- type: ParamType$3.Int,
2915
+ type: ParamType$1.Int,
2916
2916
  },
2917
2917
  {
2918
2918
  title: 'Student?',
2919
2919
  param: 'isLearner',
2920
- type: ParamType$3.Boolean,
2920
+ type: ParamType$1.Boolean,
2921
2921
  },
2922
2922
  {
2923
2923
  title: 'Teaching Staff?',
2924
2924
  param: 'isTTM',
2925
- type: ParamType$3.Boolean,
2925
+ type: ParamType$1.Boolean,
2926
2926
  startsHidden: true,
2927
2927
  },
2928
2928
  {
2929
2929
  title: 'Admin?',
2930
2930
  param: 'isAdmin',
2931
- type: ParamType$3.Boolean,
2931
+ type: ParamType$1.Boolean,
2932
2932
  startsHidden: true,
2933
2933
  },
2934
2934
  {
2935
2935
  title: 'Course Canvas Id',
2936
2936
  param: 'courseId',
2937
- type: ParamType$3.Int,
2937
+ type: ParamType$1.Int,
2938
2938
  startsHidden: true,
2939
2939
  },
2940
2940
  {
2941
2941
  title: 'Course Name',
2942
2942
  param: 'courseName',
2943
- type: ParamType$3.String,
2943
+ type: ParamType$1.String,
2944
2944
  },
2945
2945
  {
2946
2946
  title: 'Browser Name',
2947
2947
  param: 'browser.name',
2948
- type: ParamType$3.String,
2948
+ type: ParamType$1.String,
2949
2949
  startsHidden: true,
2950
2950
  },
2951
2951
  {
2952
2952
  title: 'Browser Version',
2953
2953
  param: 'browser.version',
2954
- type: ParamType$3.String,
2954
+ type: ParamType$1.String,
2955
2955
  startsHidden: true,
2956
2956
  },
2957
2957
  {
2958
2958
  title: 'OS',
2959
2959
  param: 'device.os',
2960
- type: ParamType$3.String,
2960
+ type: ParamType$1.String,
2961
2961
  startsHidden: true,
2962
2962
  },
2963
2963
  {
2964
2964
  title: 'Mobile?',
2965
2965
  param: 'device.isMobile',
2966
- type: ParamType$3.Boolean,
2966
+ type: ParamType$1.Boolean,
2967
2967
  startsHidden: true,
2968
2968
  },
2969
2969
  {
2970
2970
  title: 'Year',
2971
2971
  param: 'year',
2972
- type: ParamType$3.Int,
2972
+ type: ParamType$1.Int,
2973
2973
  },
2974
2974
  {
2975
2975
  title: 'Month',
2976
2976
  param: 'month',
2977
- type: ParamType$3.Int,
2977
+ type: ParamType$1.Int,
2978
2978
  },
2979
2979
  {
2980
2980
  title: 'Day',
2981
2981
  param: 'day',
2982
- type: ParamType$3.Int,
2982
+ type: ParamType$1.Int,
2983
2983
  },
2984
2984
  {
2985
2985
  title: 'Hour',
2986
2986
  param: 'hour',
2987
- type: ParamType$3.Int,
2987
+ type: ParamType$1.Int,
2988
2988
  },
2989
2989
  {
2990
2990
  title: 'Minute',
2991
2991
  param: 'minute',
2992
- type: ParamType$3.Int,
2992
+ type: ParamType$1.Int,
2993
2993
  startsHidden: true,
2994
2994
  },
2995
2995
  {
2996
2996
  title: 'Timestamp',
2997
2997
  param: 'timestamp',
2998
- type: ParamType$3.Int,
2998
+ type: ParamType$1.Int,
2999
2999
  startsHidden: true,
3000
3000
  },
3001
3001
  {
3002
3002
  title: 'Context',
3003
3003
  param: 'context',
3004
- type: ParamType$3.String,
3004
+ type: ParamType$1.String,
3005
3005
  },
3006
3006
  {
3007
3007
  title: 'Subcontext',
3008
3008
  param: 'subcontext',
3009
- type: ParamType$3.String,
3009
+ type: ParamType$1.String,
3010
3010
  },
3011
3011
  {
3012
3012
  title: 'Tags',
3013
3013
  param: 'tags',
3014
- type: ParamType$3.JSON,
3014
+ type: ParamType$1.JSON,
3015
3015
  startsHidden: true,
3016
3016
  },
3017
3017
  {
3018
3018
  title: 'Log Level',
3019
3019
  param: 'level',
3020
- type: ParamType$3.String,
3020
+ type: ParamType$1.String,
3021
3021
  startsHidden: true,
3022
3022
  },
3023
3023
  {
3024
3024
  title: 'Metadata',
3025
3025
  param: 'metadata',
3026
- type: ParamType$3.JSON,
3026
+ type: ParamType$1.JSON,
3027
3027
  startsHidden: true,
3028
3028
  },
3029
3029
  {
3030
3030
  title: 'Source',
3031
3031
  param: 'source',
3032
- type: ParamType$3.String,
3032
+ type: ParamType$1.String,
3033
3033
  },
3034
3034
  {
3035
3035
  title: 'Server Route Path',
3036
3036
  param: 'routePath',
3037
- type: ParamType$3.String,
3037
+ type: ParamType$1.String,
3038
3038
  startsHidden: true,
3039
3039
  },
3040
3040
  {
3041
3041
  title: 'Server Route Template',
3042
3042
  param: 'routeTemplate',
3043
- type: ParamType$3.String,
3043
+ type: ParamType$1.String,
3044
3044
  startsHidden: true,
3045
3045
  },
3046
3046
  {
3047
3047
  title: 'Type',
3048
3048
  param: 'type',
3049
- type: ParamType$3.String,
3049
+ type: ParamType$1.String,
3050
3050
  },
3051
3051
  {
3052
3052
  title: 'Error Message',
3053
3053
  param: 'errorMessage',
3054
- type: ParamType$3.String,
3054
+ type: ParamType$1.String,
3055
3055
  startsHidden: true,
3056
3056
  },
3057
3057
  {
3058
3058
  title: 'Error Code',
3059
3059
  param: 'errorCode',
3060
- type: ParamType$3.String,
3060
+ type: ParamType$1.String,
3061
3061
  startsHidden: true,
3062
3062
  },
3063
3063
  {
3064
3064
  title: 'Error Stack',
3065
3065
  param: 'errorStack',
3066
- type: ParamType$3.String,
3066
+ type: ParamType$1.String,
3067
3067
  startsHidden: true,
3068
3068
  },
3069
3069
  {
3070
3070
  title: 'Action Target',
3071
3071
  param: 'target',
3072
- type: ParamType$3.String,
3072
+ type: ParamType$1.String,
3073
3073
  startsHidden: true,
3074
3074
  },
3075
3075
  {
3076
3076
  title: 'Action Type',
3077
3077
  param: 'action',
3078
- type: ParamType$3.String,
3078
+ type: ParamType$1.String,
3079
3079
  startsHidden: true,
3080
3080
  },
3081
3081
  ];
@@ -3141,7 +3141,7 @@ const genHumanReadableName = (machineReadableName) => {
3141
3141
  };
3142
3142
  /* ------------- Actions ------------ */
3143
3143
  // Types of actions
3144
- var ActionType$4;
3144
+ var ActionType$3;
3145
3145
  (function (ActionType) {
3146
3146
  // Show the loading bar
3147
3147
  ActionType["StartLoading"] = "start-loading";
@@ -3163,7 +3163,7 @@ var ActionType$4;
3163
3163
  ActionType["UpdateActionErrorFilterState"] = "update-action-error-filter-state";
3164
3164
  // Update the advanced filter state
3165
3165
  ActionType["UpdateAdvancedFilterState"] = "update-advanced-filter-state";
3166
- })(ActionType$4 || (ActionType$4 = {}));
3166
+ })(ActionType$3 || (ActionType$3 = {}));
3167
3167
  /**
3168
3168
  * Reducer that executes actions
3169
3169
  * @author Gabe Abrams
@@ -3172,36 +3172,36 @@ var ActionType$4;
3172
3172
  */
3173
3173
  const reducer$3 = (state, action) => {
3174
3174
  switch (action.type) {
3175
- case ActionType$4.StartLoading: {
3175
+ case ActionType$3.StartLoading: {
3176
3176
  return Object.assign(Object.assign({}, state), { loading: true });
3177
3177
  }
3178
- case ActionType$4.FinishLoading: {
3178
+ case ActionType$3.FinishLoading: {
3179
3179
  return Object.assign(Object.assign({}, state), { loading: false, logMap: action.logMap });
3180
3180
  }
3181
- case ActionType$4.ToggleFilterDrawer: {
3181
+ case ActionType$3.ToggleFilterDrawer: {
3182
3182
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: (state.expandedFilterDrawer === action.filterDrawer
3183
3183
  ? undefined // hide
3184
3184
  : action.filterDrawer) });
3185
3185
  }
3186
- case ActionType$4.HideFilterDrawer: {
3186
+ case ActionType$3.HideFilterDrawer: {
3187
3187
  return Object.assign(Object.assign({}, state), { expandedFilterDrawer: undefined });
3188
3188
  }
3189
- case ActionType$4.ResetFilters: {
3189
+ case ActionType$3.ResetFilters: {
3190
3190
  return Object.assign(Object.assign({}, state), { dateFilterState: action.initDateFilterState, contextFilterState: action.initContextFilterState, tagFilterState: action.initTagFilterState, actionErrorFilterState: action.initActionErrorFilterState, advancedFilterState: action.initAdvancedFilterState });
3191
3191
  }
3192
- case ActionType$4.UpdateDateFilterState: {
3192
+ case ActionType$3.UpdateDateFilterState: {
3193
3193
  return Object.assign(Object.assign({}, state), { dateFilterState: action.dateFilterState });
3194
3194
  }
3195
- case ActionType$4.UpdateContextFilterState: {
3195
+ case ActionType$3.UpdateContextFilterState: {
3196
3196
  return Object.assign(Object.assign({}, state), { contextFilterState: action.contextFilterState });
3197
3197
  }
3198
- case ActionType$4.UpdateTagFilterState: {
3198
+ case ActionType$3.UpdateTagFilterState: {
3199
3199
  return Object.assign(Object.assign({}, state), { tagFilterState: action.tagFilterState });
3200
3200
  }
3201
- case ActionType$4.UpdateActionErrorFilterState: {
3201
+ case ActionType$3.UpdateActionErrorFilterState: {
3202
3202
  return Object.assign(Object.assign({}, state), { actionErrorFilterState: action.actionErrorFilterState });
3203
3203
  }
3204
- case ActionType$4.UpdateAdvancedFilterState: {
3204
+ case ActionType$3.UpdateAdvancedFilterState: {
3205
3205
  return Object.assign(Object.assign({}, state), { advancedFilterState: action.advancedFilterState });
3206
3206
  }
3207
3207
  default: {
@@ -3378,10 +3378,10 @@ const LogReviewer = (props) => {
3378
3378
  * @author Gabe Abrams
3379
3379
  * @param newDateFilterState the new date filter state
3380
3380
  */
3381
- const handleDateRangeUpdated = (newDateFilterState) => __awaiter$1(void 0, void 0, void 0, function* () {
3381
+ const handleDateRangeUpdated = (newDateFilterState) => __awaiter(void 0, void 0, void 0, function* () {
3382
3382
  // Update state
3383
3383
  dispatch({
3384
- type: ActionType$4.UpdateDateFilterState,
3384
+ type: ActionType$3.UpdateDateFilterState,
3385
3385
  dateFilterState: newDateFilterState,
3386
3386
  });
3387
3387
  // Check which year/month combos we need to load
@@ -3392,7 +3392,7 @@ const LogReviewer = (props) => {
3392
3392
  }
3393
3393
  // Start loading
3394
3394
  dispatch({
3395
- type: ActionType$4.StartLoading,
3395
+ type: ActionType$3.StartLoading,
3396
3396
  });
3397
3397
  // Load required months
3398
3398
  try {
@@ -3400,7 +3400,7 @@ const LogReviewer = (props) => {
3400
3400
  // Destructure
3401
3401
  const { year, month } = toLoad[i];
3402
3402
  // Load
3403
- const logs = yield visitServerEndpoint$1({
3403
+ const logs = yield visitServerEndpoint({
3404
3404
  path: `${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/${year}/months/${month}`,
3405
3405
  method: 'GET',
3406
3406
  });
@@ -3412,11 +3412,11 @@ const LogReviewer = (props) => {
3412
3412
  }
3413
3413
  }
3414
3414
  catch (err) {
3415
- return showFatalError$1(err);
3415
+ return showFatalError(err);
3416
3416
  }
3417
3417
  // Finish loading
3418
3418
  dispatch({
3419
- type: ActionType$4.FinishLoading,
3419
+ type: ActionType$3.FinishLoading,
3420
3420
  logMap,
3421
3421
  });
3422
3422
  });
@@ -3442,7 +3442,7 @@ const LogReviewer = (props) => {
3442
3442
  /* ------------- Loading ------------ */
3443
3443
  if (loading) {
3444
3444
  body = (React__default["default"].createElement("div", { className: "text-center p-5" },
3445
- React__default["default"].createElement(LoadingSpinner$1, null)));
3445
+ React__default["default"].createElement(LoadingSpinner, null)));
3446
3446
  }
3447
3447
  /* ------------ Review UI ----------- */
3448
3448
  if (!loading) {
@@ -3455,7 +3455,7 @@ const LogReviewer = (props) => {
3455
3455
  React__default["default"].createElement("div", { className: "LogReviewer-filter-toggle-buttons alert alert-secondary p-2 m-0" },
3456
3456
  React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-date-filter-drawer", className: `btn btn-${FilterDrawer.Date === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle date filter drawer", onClick: () => {
3457
3457
  dispatch({
3458
- type: ActionType$4.ToggleFilterDrawer,
3458
+ type: ActionType$3.ToggleFilterDrawer,
3459
3459
  filterDrawer: FilterDrawer.Date,
3460
3460
  });
3461
3461
  } },
@@ -3463,7 +3463,7 @@ const LogReviewer = (props) => {
3463
3463
  "Date"),
3464
3464
  React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-context-filter-drawer", className: `btn btn-${FilterDrawer.Context === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle context filter drawer", onClick: () => {
3465
3465
  dispatch({
3466
- type: ActionType$4.ToggleFilterDrawer,
3466
+ type: ActionType$3.ToggleFilterDrawer,
3467
3467
  filterDrawer: FilterDrawer.Context,
3468
3468
  });
3469
3469
  } },
@@ -3471,7 +3471,7 @@ const LogReviewer = (props) => {
3471
3471
  "Context"),
3472
3472
  (LogMetadata.Tag && Object.keys(LogMetadata.Tag).length > 0) && (React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-tag-filter-drawer", className: `btn btn-${FilterDrawer.Tag === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle tag filter drawer", onClick: () => {
3473
3473
  dispatch({
3474
- type: ActionType$4.ToggleFilterDrawer,
3474
+ type: ActionType$3.ToggleFilterDrawer,
3475
3475
  filterDrawer: FilterDrawer.Tag,
3476
3476
  });
3477
3477
  } },
@@ -3479,7 +3479,7 @@ const LogReviewer = (props) => {
3479
3479
  "Tag")),
3480
3480
  React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-action-filter-drawer", className: `btn btn-${FilterDrawer.Action === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle action and error filter drawer", onClick: () => {
3481
3481
  dispatch({
3482
- type: ActionType$4.ToggleFilterDrawer,
3482
+ type: ActionType$3.ToggleFilterDrawer,
3483
3483
  filterDrawer: FilterDrawer.Action,
3484
3484
  });
3485
3485
  } },
@@ -3487,7 +3487,7 @@ const LogReviewer = (props) => {
3487
3487
  "Action"),
3488
3488
  React__default["default"].createElement("button", { type: "button", id: "LogReviewer-toggle-advanced-filter-drawer", className: `btn btn-${FilterDrawer.Advanced === expandedFilterDrawer ? 'warning' : 'light'} me-2`, "aria-label": "toggle advanced filter drawer", onClick: () => {
3489
3489
  dispatch({
3490
- type: ActionType$4.ToggleFilterDrawer,
3490
+ type: ActionType$3.ToggleFilterDrawer,
3491
3491
  filterDrawer: FilterDrawer.Advanced,
3492
3492
  });
3493
3493
  } },
@@ -3495,7 +3495,7 @@ const LogReviewer = (props) => {
3495
3495
  "Advanced"),
3496
3496
  React__default["default"].createElement("button", { type: "button", id: "LogReviewer-reset-filters-button", className: "btn btn-light", "aria-label": "reset filters", onClick: () => {
3497
3497
  dispatch({
3498
- type: ActionType$4.ResetFilters,
3498
+ type: ActionType$3.ResetFilters,
3499
3499
  initActionErrorFilterState,
3500
3500
  initAdvancedFilterState,
3501
3501
  initContextFilterState,
@@ -3525,7 +3525,7 @@ const LogReviewer = (props) => {
3525
3525
  || (year === dateFilterState.startDate.year
3526
3526
  && month === dateFilterState.startDate.month
3527
3527
  && day < dateFilterState.startDate.day)) {
3528
- return alert$2('Invalid Start Date', 'The start date cannot be before the end date.');
3528
+ return alert$1('Invalid Start Date', 'The start date cannot be before the end date.');
3529
3529
  }
3530
3530
  dateFilterState.endDate = { month, day, year };
3531
3531
  handleDateRangeUpdated(dateFilterState);
@@ -3617,7 +3617,7 @@ const LogReviewer = (props) => {
3617
3617
  }
3618
3618
  });
3619
3619
  dispatch({
3620
- type: ActionType$4.UpdateContextFilterState,
3620
+ type: ActionType$3.UpdateContextFilterState,
3621
3621
  contextFilterState,
3622
3622
  });
3623
3623
  } }));
@@ -3629,10 +3629,10 @@ const LogReviewer = (props) => {
3629
3629
  React__default["default"].createElement("div", { className: "d-flex gap-1 flex-wrap" }, Object.keys((_d = LogMetadata.Tag) !== null && _d !== void 0 ? _d : {})
3630
3630
  .map((tag) => {
3631
3631
  const description = genHumanReadableName(tag);
3632
- return (React__default["default"].createElement(CheckboxButton$1, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked: tagFilterState[tag], onChanged: (checked) => {
3632
+ return (React__default["default"].createElement(CheckboxButton, { key: tag, id: `LogReviewer-tag-${tag}-checkbox`, text: description, ariaLabel: `require that logs be tagged with "${description}" or any other selected tag`, checked: tagFilterState[tag], onChanged: (checked) => {
3633
3633
  tagFilterState[tag] = checked;
3634
3634
  dispatch({
3635
- type: ActionType$4.UpdateTagFilterState,
3635
+ type: ActionType$3.UpdateTagFilterState,
3636
3636
  tagFilterState,
3637
3637
  });
3638
3638
  } }));
@@ -3642,47 +3642,47 @@ const LogReviewer = (props) => {
3642
3642
  // Create filter UI
3643
3643
  filterDrawer = (React__default["default"].createElement(React__default["default"].Fragment, null,
3644
3644
  React__default["default"].createElement(TabBox, { title: "Log Type" },
3645
- React__default["default"].createElement(RadioButton$1, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
3645
+ React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-all", text: "All Logs", onSelected: () => {
3646
3646
  actionErrorFilterState.type = undefined;
3647
3647
  dispatch({
3648
- type: ActionType$4.UpdateActionErrorFilterState,
3648
+ type: ActionType$3.UpdateActionErrorFilterState,
3649
3649
  actionErrorFilterState,
3650
3650
  });
3651
3651
  }, ariaLabel: "show logs of all types", selected: actionErrorFilterState.type === undefined }),
3652
- React__default["default"].createElement(RadioButton$1, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
3652
+ React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => {
3653
3653
  actionErrorFilterState.type = LogType$1.Action;
3654
3654
  dispatch({
3655
- type: ActionType$4.UpdateActionErrorFilterState,
3655
+ type: ActionType$3.UpdateActionErrorFilterState,
3656
3656
  actionErrorFilterState,
3657
3657
  });
3658
3658
  }, ariaLabel: "only show action logs", selected: actionErrorFilterState.type === LogType$1.Action }),
3659
- React__default["default"].createElement(RadioButton$1, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
3659
+ React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => {
3660
3660
  actionErrorFilterState.type = LogType$1.Error;
3661
3661
  dispatch({
3662
- type: ActionType$4.UpdateActionErrorFilterState,
3662
+ type: ActionType$3.UpdateActionErrorFilterState,
3663
3663
  actionErrorFilterState,
3664
3664
  });
3665
3665
  }, ariaLabel: "only show error logs", selected: actionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true })),
3666
3666
  (actionErrorFilterState.type === undefined
3667
3667
  || actionErrorFilterState.type === LogType$1.Action) && (React__default["default"].createElement(TabBox, { title: "Action Log Details" },
3668
- React__default["default"].createElement(ButtonInputGroup$1, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1)
3668
+ React__default["default"].createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1)
3669
3669
  .map((action) => {
3670
3670
  const description = genHumanReadableName(action);
3671
- return (React__default["default"].createElement(CheckboxButton$1, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: actionErrorFilterState.action[action], onChanged: (checked) => {
3671
+ return (React__default["default"].createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: actionErrorFilterState.action[action], onChanged: (checked) => {
3672
3672
  actionErrorFilterState.action[action] = checked;
3673
3673
  dispatch({
3674
- type: ActionType$4.UpdateActionErrorFilterState,
3674
+ type: ActionType$3.UpdateActionErrorFilterState,
3675
3675
  actionErrorFilterState,
3676
3676
  });
3677
3677
  } }));
3678
3678
  })),
3679
- React__default["default"].createElement(ButtonInputGroup$1, { label: "Target", wrapButtonsAndAddGaps: true }, Object.keys(targetMap)
3679
+ React__default["default"].createElement(ButtonInputGroup, { label: "Target", wrapButtonsAndAddGaps: true }, Object.keys(targetMap)
3680
3680
  .map((target) => {
3681
3681
  const description = genHumanReadableName(target);
3682
- return (React__default["default"].createElement(CheckboxButton$1, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
3682
+ return (React__default["default"].createElement(CheckboxButton, { key: target, id: `LogReviewer-target-${target}-checkbox`, text: description, ariaLabel: `include logs with target "${description}" in results`, checked: actionErrorFilterState.target[target], noMarginOnRight: true, onChanged: (checked) => {
3683
3683
  actionErrorFilterState.target[target] = checked;
3684
3684
  dispatch({
3685
- type: ActionType$4.UpdateActionErrorFilterState,
3685
+ type: ActionType$3.UpdateActionErrorFilterState,
3686
3686
  actionErrorFilterState,
3687
3687
  });
3688
3688
  } }));
@@ -3694,7 +3694,7 @@ const LogReviewer = (props) => {
3694
3694
  React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: actionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => {
3695
3695
  actionErrorFilterState.errorMessage = e.target.value;
3696
3696
  dispatch({
3697
- type: ActionType$4.UpdateActionErrorFilterState,
3697
+ type: ActionType$3.UpdateActionErrorFilterState,
3698
3698
  actionErrorFilterState,
3699
3699
  });
3700
3700
  } })),
@@ -3705,7 +3705,7 @@ const LogReviewer = (props) => {
3705
3705
  .trim()
3706
3706
  .toUpperCase());
3707
3707
  dispatch({
3708
- type: ActionType$4.UpdateActionErrorFilterState,
3708
+ type: ActionType$3.UpdateActionErrorFilterState,
3709
3709
  actionErrorFilterState,
3710
3710
  });
3711
3711
  } }))))));
@@ -3719,7 +3719,7 @@ const LogReviewer = (props) => {
3719
3719
  React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user first name", value: advancedFilterState.userFirstName, placeholder: "e.g. Divardo", onChange: (e) => {
3720
3720
  advancedFilterState.userFirstName = e.target.value;
3721
3721
  dispatch({
3722
- type: ActionType$4.UpdateAdvancedFilterState,
3722
+ type: ActionType$3.UpdateAdvancedFilterState,
3723
3723
  advancedFilterState,
3724
3724
  });
3725
3725
  } })),
@@ -3728,7 +3728,7 @@ const LogReviewer = (props) => {
3728
3728
  React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for user last name", value: advancedFilterState.userLastName, placeholder: "e.g. Calicci", onChange: (e) => {
3729
3729
  advancedFilterState.userLastName = e.target.value;
3730
3730
  dispatch({
3731
- type: ActionType$4.UpdateAdvancedFilterState,
3731
+ type: ActionType$3.UpdateAdvancedFilterState,
3732
3732
  advancedFilterState,
3733
3733
  });
3734
3734
  } })),
@@ -3738,7 +3738,7 @@ const LogReviewer = (props) => {
3738
3738
  advancedFilterState.userEmail = ((e.target.value)
3739
3739
  .trim());
3740
3740
  dispatch({
3741
- type: ActionType$4.UpdateAdvancedFilterState,
3741
+ type: ActionType$3.UpdateAdvancedFilterState,
3742
3742
  advancedFilterState,
3743
3743
  });
3744
3744
  } })),
@@ -3752,29 +3752,29 @@ const LogReviewer = (props) => {
3752
3752
  .trim());
3753
3753
  }
3754
3754
  dispatch({
3755
- type: ActionType$4.UpdateAdvancedFilterState,
3755
+ type: ActionType$3.UpdateAdvancedFilterState,
3756
3756
  advancedFilterState,
3757
3757
  });
3758
3758
  } })),
3759
- React__default["default"].createElement(ButtonInputGroup$1, { label: "Role" },
3760
- React__default["default"].createElement(CheckboxButton$1, { text: "Students", onChanged: (checked) => {
3759
+ React__default["default"].createElement(ButtonInputGroup, { label: "Role" },
3760
+ React__default["default"].createElement(CheckboxButton, { text: "Students", onChanged: (checked) => {
3761
3761
  advancedFilterState.includeLearners = checked;
3762
3762
  dispatch({
3763
- type: ActionType$4.UpdateAdvancedFilterState,
3763
+ type: ActionType$3.UpdateAdvancedFilterState,
3764
3764
  advancedFilterState,
3765
3765
  });
3766
3766
  }, checked: advancedFilterState.includeLearners, ariaLabel: "show logs from students" }),
3767
- React__default["default"].createElement(CheckboxButton$1, { text: "Teaching Team Members", onChanged: (checked) => {
3767
+ React__default["default"].createElement(CheckboxButton, { text: "Teaching Team Members", onChanged: (checked) => {
3768
3768
  advancedFilterState.includeTTMs = checked;
3769
3769
  dispatch({
3770
- type: ActionType$4.UpdateAdvancedFilterState,
3770
+ type: ActionType$3.UpdateAdvancedFilterState,
3771
3771
  advancedFilterState,
3772
3772
  });
3773
3773
  }, checked: advancedFilterState.includeTTMs, ariaLabel: "show logs from teaching team members" }),
3774
- React__default["default"].createElement(CheckboxButton$1, { text: "Admins", onChanged: (checked) => {
3774
+ React__default["default"].createElement(CheckboxButton, { text: "Admins", onChanged: (checked) => {
3775
3775
  advancedFilterState.includeAdmins = checked;
3776
3776
  dispatch({
3777
- type: ActionType$4.UpdateAdvancedFilterState,
3777
+ type: ActionType$3.UpdateAdvancedFilterState,
3778
3778
  advancedFilterState,
3779
3779
  });
3780
3780
  }, checked: advancedFilterState.includeAdmins, ariaLabel: "show logs from admins" }))),
@@ -3784,7 +3784,7 @@ const LogReviewer = (props) => {
3784
3784
  React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for course name", value: advancedFilterState.courseName, placeholder: "e.g. GLC 200", onChange: (e) => {
3785
3785
  advancedFilterState.courseName = e.target.value;
3786
3786
  dispatch({
3787
- type: ActionType$4.UpdateAdvancedFilterState,
3787
+ type: ActionType$3.UpdateAdvancedFilterState,
3788
3788
  advancedFilterState,
3789
3789
  });
3790
3790
  } })),
@@ -3798,53 +3798,53 @@ const LogReviewer = (props) => {
3798
3798
  .trim());
3799
3799
  }
3800
3800
  dispatch({
3801
- type: ActionType$4.UpdateAdvancedFilterState,
3801
+ type: ActionType$3.UpdateAdvancedFilterState,
3802
3802
  advancedFilterState,
3803
3803
  });
3804
3804
  } }))),
3805
3805
  React__default["default"].createElement(TabBox, { title: "Device" },
3806
- React__default["default"].createElement(ButtonInputGroup$1, { label: "Device Type" },
3807
- React__default["default"].createElement(RadioButton$1, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
3806
+ React__default["default"].createElement(ButtonInputGroup, { label: "Device Type" },
3807
+ React__default["default"].createElement(RadioButton, { text: "All Devices", ariaLabel: "show logs from all devices", selected: advancedFilterState.isMobile === undefined, onSelected: () => {
3808
3808
  advancedFilterState.isMobile = undefined;
3809
3809
  dispatch({
3810
- type: ActionType$4.UpdateAdvancedFilterState,
3810
+ type: ActionType$3.UpdateAdvancedFilterState,
3811
3811
  advancedFilterState,
3812
3812
  });
3813
3813
  } }),
3814
- React__default["default"].createElement(RadioButton$1, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
3814
+ React__default["default"].createElement(RadioButton, { text: "Mobile Only", ariaLabel: "show logs from mobile devices", selected: advancedFilterState.isMobile === true, onSelected: () => {
3815
3815
  advancedFilterState.isMobile = true;
3816
3816
  dispatch({
3817
- type: ActionType$4.UpdateAdvancedFilterState,
3817
+ type: ActionType$3.UpdateAdvancedFilterState,
3818
3818
  advancedFilterState,
3819
3819
  });
3820
3820
  } }),
3821
- React__default["default"].createElement(RadioButton$1, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
3821
+ React__default["default"].createElement(RadioButton, { text: "Desktop Only", ariaLabel: "show logs from desktop devices", selected: advancedFilterState.isMobile === false, onSelected: () => {
3822
3822
  advancedFilterState.isMobile = false;
3823
3823
  dispatch({
3824
- type: ActionType$4.UpdateAdvancedFilterState,
3824
+ type: ActionType$3.UpdateAdvancedFilterState,
3825
3825
  advancedFilterState,
3826
3826
  });
3827
3827
  }, noMarginOnRight: true }))),
3828
3828
  React__default["default"].createElement(TabBox, { title: "Source" },
3829
- React__default["default"].createElement(ButtonInputGroup$1, { label: "Source Type" },
3830
- React__default["default"].createElement(RadioButton$1, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
3829
+ React__default["default"].createElement(ButtonInputGroup, { label: "Source Type" },
3830
+ React__default["default"].createElement(RadioButton, { text: "Both", ariaLabel: "show logs from all sources", selected: advancedFilterState.source === undefined, onSelected: () => {
3831
3831
  advancedFilterState.source = undefined;
3832
3832
  dispatch({
3833
- type: ActionType$4.UpdateAdvancedFilterState,
3833
+ type: ActionType$3.UpdateAdvancedFilterState,
3834
3834
  advancedFilterState,
3835
3835
  });
3836
3836
  } }),
3837
- React__default["default"].createElement(RadioButton$1, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
3837
+ React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: advancedFilterState.source === LogSource$1.Client, onSelected: () => {
3838
3838
  advancedFilterState.source = LogSource$1.Client;
3839
3839
  dispatch({
3840
- type: ActionType$4.UpdateAdvancedFilterState,
3840
+ type: ActionType$3.UpdateAdvancedFilterState,
3841
3841
  advancedFilterState,
3842
3842
  });
3843
3843
  } }),
3844
- React__default["default"].createElement(RadioButton$1, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
3844
+ React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: advancedFilterState.source === LogSource$1.Server, onSelected: () => {
3845
3845
  advancedFilterState.source = LogSource$1.Server;
3846
3846
  dispatch({
3847
- type: ActionType$4.UpdateAdvancedFilterState,
3847
+ type: ActionType$3.UpdateAdvancedFilterState,
3848
3848
  advancedFilterState,
3849
3849
  });
3850
3850
  }, noMarginOnRight: true })),
@@ -3855,7 +3855,7 @@ const LogReviewer = (props) => {
3855
3855
  advancedFilterState.courseName = ((e.target.value)
3856
3856
  .trim());
3857
3857
  dispatch({
3858
- type: ActionType$4.UpdateAdvancedFilterState,
3858
+ type: ActionType$3.UpdateAdvancedFilterState,
3859
3859
  advancedFilterState,
3860
3860
  });
3861
3861
  } })),
@@ -3865,7 +3865,7 @@ const LogReviewer = (props) => {
3865
3865
  advancedFilterState.courseName = ((e.target.value)
3866
3866
  .trim());
3867
3867
  dispatch({
3868
- type: ActionType$4.UpdateAdvancedFilterState,
3868
+ type: ActionType$3.UpdateAdvancedFilterState,
3869
3869
  advancedFilterState,
3870
3870
  });
3871
3871
  } })))))));
@@ -3874,1250 +3874,287 @@ const LogReviewer = (props) => {
3874
3874
  // Filters UI
3875
3875
  const filters = (React__default["default"].createElement(React__default["default"].Fragment, null,
3876
3876
  filterToggles,
3877
- filterDrawer && (React__default["default"].createElement(Drawer, { customBackgroundColor: "#eee" }, filterDrawer))));
3878
- // Actually filter the logs
3879
- // > Perform filters
3880
- const logs = [];
3881
- Object.keys(logMap).forEach((year) => {
3882
- Object.keys(logMap[year]).forEach((month) => {
3883
- logMap[year][month].forEach((log) => {
3884
- /* ----------- Date Filter ---------- */
3885
- var _a;
3886
- // Before start date
3887
- if (
3888
- // Previous year
3889
- log.year < dateFilterState.startDate.year
3890
- // Same year, earlier month
3891
- || ((log.year === dateFilterState.startDate.year)
3892
- && (log.month < dateFilterState.startDate.month))
3893
- // Same year, same month, earlier day
3894
- || ((log.year === dateFilterState.startDate.year)
3895
- && (log.month === dateFilterState.startDate.month)
3896
- && (log.day < dateFilterState.startDate.day))) {
3897
- return;
3898
- }
3899
- // After end date
3900
- if (
3901
- // Later year
3902
- log.year > dateFilterState.endDate.year
3903
- // Same year, later month
3904
- || ((log.year === dateFilterState.endDate.year)
3905
- && (log.month > dateFilterState.endDate.month))
3906
- // Same year, same month, later day
3907
- || ((log.year === dateFilterState.endDate.year)
3908
- && (log.month === dateFilterState.endDate.month)
3909
- && (log.day > dateFilterState.endDate.day))) {
3910
- return;
3911
- }
3912
- /* --------- Context Filter --------- */
3913
- // Context doesn't match
3914
- if (
3915
- // Whole context is deselected
3916
- contextFilterState[log.context] === false
3917
- // None of the subcontexts are selected
3918
- || (
3919
- // Has subcontexts
3920
- typeof contextFilterState[log.context] !== 'boolean'
3921
- // None of the subcontexts are selected
3922
- && Object.values((_a = contextFilterState[log.context]) !== null && _a !== void 0 ? _a : {})
3923
- .every((isSelected) => {
3924
- return !isSelected;
3925
- }))) {
3926
- return;
3927
- }
3928
- // Subcontext doesn't match
3929
- if (
3930
- // Log context is not "uncategorized" (no point in further filters)
3931
- log.context !== LogBuiltInMetadata.Context.Uncategorized
3932
- // Log has a subcontext
3933
- && log.subcontext
3934
- // Context has subcontexts
3935
- && (contextFilterState[log.context]
3936
- && contextFilterState[log.context] !== false
3937
- && contextFilterState[log.context] !== true)
3938
- // Subcontext is not selected
3939
- && !contextFilterState[log.context][log.subcontext]) {
3940
- return;
3941
- }
3942
- /* -------------- Tags -------------- */
3943
- // No tags match
3944
- if (
3945
- // At least one tag is required
3946
- Object.values(tagFilterState)
3947
- .filter((isSelected) => {
3948
- return isSelected;
3949
- })
3950
- .length > 0
3951
- // No tags match
3952
- && log.tags.every((tag) => {
3953
- return !tagFilterState[tag];
3954
- })) {
3955
- return;
3956
- }
3957
- /* ------- Actions and Errors ------- */
3958
- // Log type doesn't match
3959
- if (
3960
- // Filter won't allow all types
3961
- actionErrorFilterState.type !== undefined
3962
- // Log type doesn't match
3963
- && actionErrorFilterState.type !== log.type) {
3964
- return;
3965
- }
3966
- // Filter errors
3967
- if (log.type === LogType$1.Error) {
3968
- // Message doesn't match
3969
- if (
3970
- // Message exists
3971
- log.errorMessage
3972
- // Message filter exists
3973
- && actionErrorFilterState.errorMessage.trim().length > 0
3974
- // Message doesn't match
3975
- && log.errorMessage.toLowerCase().includes(actionErrorFilterState.errorMessage.trim().toLowerCase())) {
3976
- return;
3977
- }
3978
- // Code doesn't match
3979
- if (
3980
- // Code exists
3981
- log.errorCode
3982
- // Code filter exists
3983
- && actionErrorFilterState.errorCode.trim().length > 0
3984
- // Code doesn't match
3985
- && log.errorCode.toUpperCase().includes(actionErrorFilterState.errorCode.trim().toUpperCase())) {
3986
- return;
3987
- }
3988
- }
3989
- // Filter actions
3990
- if (log.type === LogType$1.Action) {
3991
- // Target isn't selected
3992
- if (
3993
- // Target exists
3994
- log.target
3995
- // Target isn't selected
3996
- && !actionErrorFilterState.target[log.target]) {
3997
- return;
3998
- }
3999
- // Action
4000
- if (
4001
- // Action exists
4002
- log.action
4003
- // Action isn't selected
4004
- && !actionErrorFilterState.action[log.action]) {
4005
- return;
4006
- }
4007
- }
4008
- /* --------- Advanced Filter -------- */
4009
- // First name doesn't match
4010
- if (
4011
- // First name exists
4012
- log.userFirstName
4013
- // First name query doesn't match
4014
- && !log.userFirstName.toLowerCase().includes(advancedFilterState.userFirstName.toLowerCase().trim())) {
4015
- return;
4016
- }
4017
- // Last name doesn't match
4018
- if (
4019
- // Last name exists
4020
- log.userLastName
4021
- // Last name query doesn't match
4022
- && !log.userLastName.toLowerCase().includes(advancedFilterState.userLastName.toLowerCase().trim())) {
4023
- return;
4024
- }
4025
- // Email doesn't match
4026
- if (
4027
- // Email exists
4028
- log.userEmail
4029
- // Email query doesn't match
4030
- && !log.userEmail.toLowerCase().includes(advancedFilterState.userEmail.toLowerCase().trim())) {
4031
- return;
4032
- }
4033
- // User id doesn't match
4034
- if (
4035
- // User id exists
4036
- log.userId
4037
- // User id doesn't match
4038
- && !String(log.userId).includes(advancedFilterState.userId.trim())) {
4039
- return;
4040
- }
4041
- // Learner not allowed
4042
- if (
4043
- // User is a learner
4044
- log.isLearner
4045
- // Learners aren't included
4046
- && !advancedFilterState.includeLearners) {
4047
- return;
4048
- }
4049
- // TTM not allowed
4050
- if (
4051
- // User is a ttm
4052
- log.isTTM
4053
- // TTMs aren't included
4054
- && !advancedFilterState.includeTTMs) {
4055
- return;
4056
- }
4057
- // Admin not allowed
4058
- if (
4059
- // User is an admin
4060
- log.isAdmin
4061
- // Admins aren't included
4062
- && !advancedFilterState.includeAdmins) {
4063
- return;
4064
- }
4065
- // Course Id doesn't match
4066
- if (
4067
- // Course Id exists
4068
- log.courseId
4069
- // Course Id doesn't match
4070
- && !String(log.courseId).includes(advancedFilterState.courseId.trim())) {
4071
- return;
4072
- }
4073
- // Course name doesn't match
4074
- if (
4075
- // Course name exists
4076
- log.courseName
4077
- // Course name doesn't match
4078
- && !String(log.courseName).includes(advancedFilterState.courseName.trim())) {
4079
- return;
4080
- }
4081
- // Mobile filter doesn't match
4082
- if (
4083
- // Mobile filter exists
4084
- advancedFilterState.isMobile !== undefined
4085
- // Device info exists
4086
- && log.device
4087
- // Mobile filter doesn't match
4088
- && (advancedFilterState.isMobile !== log.device.isMobile)) {
4089
- return;
4090
- }
4091
- // Log source doesn't match
4092
- if (
4093
- // Source filter exists
4094
- advancedFilterState.source !== undefined
4095
- // Source info exists
4096
- && log.source
4097
- // Source filter doesn't match
4098
- && (advancedFilterState.source !== log.source)) {
4099
- return;
4100
- }
4101
- // Route path doesn't match (Only for server source)
4102
- if (
4103
- // Source is server
4104
- (log.source === LogSource$1.Server)
4105
- // Route path is being filtered
4106
- && (advancedFilterState.routePath.trim().length)
4107
- // Route path doesn't match
4108
- && !(log.routePath.includes(advancedFilterState.routePath.trim()))) {
4109
- return;
4110
- }
4111
- // Route template doesn't match (Only for server source)
4112
- if (
4113
- // Source is server
4114
- (log.source === LogSource$1.Server)
4115
- // Route template is being filtered
4116
- && (advancedFilterState.routeTemplate.trim().length)
4117
- // Route template doesn't match
4118
- && !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))) {
4119
- return;
4120
- }
4121
- /* -------------- Done -------------- */
4122
- // Made it past all filters. Add to the list
4123
- logs.push(log);
4124
- });
4125
- });
4126
- });
4127
- /*----------------------------------------*/
4128
- /* Data */
4129
- /*----------------------------------------*/
4130
- // Nothing to show notice
4131
- const noLogsNotice = (logs.length === 0
4132
- ? (React__default["default"].createElement("div", { className: "alert alert-warning text-center mt-2" },
4133
- React__default["default"].createElement("h4", { className: "m-1" }, "No Logs to Show"),
4134
- React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
4135
- : undefined);
4136
- // Create intelliTable
4137
- const dataTable = (React__default["default"].createElement(IntelliTable, { title: "Matching Logs:", csvName: `Logs from ${getHumanReadableDate()}`, id: "logs", data: logs, columns: columns }));
4138
- // Main body
4139
- body = (React__default["default"].createElement(React__default["default"].Fragment, null,
4140
- filters,
4141
- React__default["default"].createElement("div", { className: "mt-2" },
4142
- dataTable,
4143
- noLogsNotice)));
4144
- }
4145
- /* ---------- Wrap in Modal --------- */
4146
- return (React__default["default"].createElement("div", { className: "LogReviewer-outer-container" },
4147
- React__default["default"].createElement("style", null, style$1),
4148
- React__default["default"].createElement("div", { className: "LogReviewer-inner-container" },
4149
- React__default["default"].createElement("div", { className: "LogReviewer-header" },
4150
- React__default["default"].createElement("div", { className: "LogReviewer-header-title" },
4151
- React__default["default"].createElement("h3", { className: "text-center m-0" }, "Log Review Dashboard")),
4152
- React__default["default"].createElement("div", { style: { width: 0 } },
4153
- React__default["default"].createElement("button", { type: "button", className: "LogReviewer-header-close-button btn btn-dark btn-lg pe-0", "aria-label": "close log reviewer panel", onClick: onClose },
4154
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faTimes })))),
4155
- React__default["default"].createElement("div", { className: "LogReviewer-contents" }, body))));
4156
- };
4157
-
4158
- /******************************************************************************
4159
- Copyright (c) Microsoft Corporation.
4160
-
4161
- Permission to use, copy, modify, and/or distribute this software for any
4162
- purpose with or without fee is hereby granted.
4163
-
4164
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4165
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4166
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4167
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4168
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4169
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4170
- PERFORMANCE OF THIS SOFTWARE.
4171
- ***************************************************************************** */
4172
-
4173
- function __awaiter(thisArg, _arguments, P, generator) {
4174
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4175
- return new (P || (P = Promise))(function (resolve, reject) {
4176
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
4177
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
4178
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
4179
- step((generator = generator.apply(thisArg, _arguments || [])).next());
4180
- });
4181
- }
4182
-
4183
- // Highest error code = DRK10
4184
- /**
4185
- * List of error codes built into the react kit
4186
- * @author Gabe Abrams
4187
- */
4188
- var ReactKitErrorCode;
4189
- (function (ReactKitErrorCode) {
4190
- ReactKitErrorCode["NoResponse"] = "DRK1";
4191
- ReactKitErrorCode["NoCode"] = "DRK2";
4192
- ReactKitErrorCode["SessionExpired"] = "DRK3";
4193
- ReactKitErrorCode["MissingParameter"] = "DRK4";
4194
- ReactKitErrorCode["InvalidParameter"] = "DRK5";
4195
- ReactKitErrorCode["WrongCourse"] = "DRK6";
4196
- ReactKitErrorCode["NoCACCLSendRequestFunction"] = "DRK7";
4197
- ReactKitErrorCode["NoCACCLGetLaunchInfoFunction"] = "DRK8";
4198
- ReactKitErrorCode["NotTTM"] = "DRK9";
4199
- ReactKitErrorCode["NotAdmin"] = "DRK10";
4200
- })(ReactKitErrorCode || (ReactKitErrorCode = {}));
4201
- var ReactKitErrorCode$1 = ReactKitErrorCode;
4202
-
4203
- /**
4204
- * Types of buttons in the modal
4205
- * @author Gabe Abrams
4206
- */
4207
- var ModalButtonType;
4208
- (function (ModalButtonType) {
4209
- ModalButtonType["Okay"] = "okay";
4210
- ModalButtonType["Cancel"] = "cancel";
4211
- ModalButtonType["Yes"] = "yes";
4212
- ModalButtonType["No"] = "no";
4213
- ModalButtonType["Abandon"] = "abandon";
4214
- ModalButtonType["GoBack"] = "goBack";
4215
- ModalButtonType["Continue"] = "continue";
4216
- ModalButtonType["ImSure"] = "imSure";
4217
- ModalButtonType["Delete"] = "delete";
4218
- ModalButtonType["Confirm"] = "confirm";
4219
- })(ModalButtonType || (ModalButtonType = {}));
4220
- var ModalButtonType$1 = ModalButtonType;
4221
-
4222
- /**
4223
- * Types of modals
4224
- * @author Gabe Abrams
4225
- */
4226
- var ModalType;
4227
- (function (ModalType) {
4228
- ModalType["Okay"] = "okay";
4229
- ModalType["OkayCancel"] = "okay-cancel";
4230
- ModalType["YesNo"] = "yes-no";
4231
- ModalType["YesNoCancel"] = "yes-no-cancel";
4232
- ModalType["AbandonGoBack"] = "abandon-goBack";
4233
- ModalType["ImSureCancel"] = "imSure-cancel";
4234
- ModalType["DeleteCancel"] = "delete-cancel";
4235
- ModalType["ConfirmCancel"] = "confirm-cancel";
4236
- ModalType["NoButtons"] = "-";
4237
- })(ModalType || (ModalType = {}));
4238
- var ModalType$1 = ModalType;
4239
-
4240
- /**
4241
- * Bootstrap variants
4242
- * @author Gabe Abrams
4243
- */
4244
- var Variant;
4245
- (function (Variant) {
4246
- Variant["Primary"] = "primary";
4247
- Variant["Secondary"] = "secondary";
4248
- Variant["Success"] = "success";
4249
- Variant["Warning"] = "warning";
4250
- Variant["Info"] = "info";
4251
- Variant["Danger"] = "danger";
4252
- Variant["Light"] = "light";
4253
- Variant["Dark"] = "dark";
4254
- })(Variant || (Variant = {}));
4255
- var Variant$1 = Variant;
4256
-
4257
- /**
4258
- * Modal sizes
4259
- * @author Gabe Abrams
4260
- */
4261
- var ModalSize;
4262
- (function (ModalSize) {
4263
- ModalSize["Small"] = "sm";
4264
- ModalSize["Medium"] = "md";
4265
- ModalSize["Large"] = "lg";
4266
- ModalSize["ExtraLarge"] = "xl";
4267
- })(ModalSize || (ModalSize = {}));
4268
- // Modal type to list of buttons
4269
- ({
4270
- [ModalType$1.Okay]: [
4271
- ModalButtonType$1.Okay,
4272
- ],
4273
- [ModalType$1.OkayCancel]: [
4274
- ModalButtonType$1.Okay,
4275
- ModalButtonType$1.Cancel,
4276
- ],
4277
- [ModalType$1.YesNo]: [
4278
- ModalButtonType$1.Yes,
4279
- ModalButtonType$1.No,
4280
- ],
4281
- [ModalType$1.YesNoCancel]: [
4282
- ModalButtonType$1.Yes,
4283
- ModalButtonType$1.No,
4284
- ModalButtonType$1.Cancel,
4285
- ],
4286
- [ModalType$1.AbandonGoBack]: [
4287
- ModalButtonType$1.Abandon,
4288
- ModalButtonType$1.GoBack,
4289
- ],
4290
- [ModalType$1.ImSureCancel]: [
4291
- ModalButtonType$1.ImSure,
4292
- ModalButtonType$1.Cancel,
4293
- ],
4294
- [ModalType$1.DeleteCancel]: [
4295
- ModalButtonType$1.Delete,
4296
- ModalButtonType$1.Cancel,
4297
- ],
4298
- [ModalType$1.ConfirmCancel]: [
4299
- ModalButtonType$1.Confirm,
4300
- ModalButtonType$1.Cancel,
4301
- ],
4302
- });
4303
- // Button type styling and labels
4304
- ({
4305
- [ModalButtonType$1.Okay]: {
4306
- label: 'Okay',
4307
- variant: Variant$1.Dark,
4308
- },
4309
- [ModalButtonType$1.Cancel]: {
4310
- label: 'Cancel',
4311
- variant: Variant$1.Secondary,
4312
- },
4313
- [ModalButtonType$1.Yes]: {
4314
- label: 'Yes',
4315
- variant: Variant$1.Dark,
4316
- },
4317
- [ModalButtonType$1.No]: {
4318
- label: 'No',
4319
- variant: Variant$1.Secondary,
4320
- },
4321
- [ModalButtonType$1.Abandon]: {
4322
- label: 'Abandon Changes',
4323
- variant: Variant$1.Warning,
4324
- },
4325
- [ModalButtonType$1.GoBack]: {
4326
- label: 'Go Back',
4327
- variant: Variant$1.Secondary,
4328
- },
4329
- [ModalButtonType$1.Continue]: {
4330
- label: 'Continue',
4331
- variant: Variant$1.Dark,
4332
- },
4333
- [ModalButtonType$1.ImSure]: {
4334
- label: 'I am sure',
4335
- variant: Variant$1.Warning,
4336
- },
4337
- [ModalButtonType$1.Delete]: {
4338
- label: 'Yes, Delete',
4339
- variant: Variant$1.Danger,
4340
- },
4341
- [ModalButtonType$1.Confirm]: {
4342
- label: 'Confirm',
4343
- variant: Variant$1.Dark,
4344
- },
4345
- });
4346
-
4347
- /**
4348
- * An error with a code
4349
- * @author Gabe Abrams
4350
- */
4351
- class ErrorWithCode extends Error {
4352
- constructor(message, code) {
4353
- super(message);
4354
- this.name = 'ErrorWithCode';
4355
- this.code = code;
4356
- }
4357
- }
4358
- /**
4359
- * Send a request using caccl's send request feature
4360
- * @author Gabe Abrams
4361
- * @param opts send request options
4362
- * @returns send request response
4363
- */
4364
- const cacclSendRequest = (opts) => __awaiter(void 0, void 0, void 0, function* () {
4365
- // Make sure send request has been passed in
4366
- {
4367
- throw new ErrorWithCode(`\nThe request could not be sent because the AppWrapper component does not have a copy of sendRequest from CACCL.\nIf you are currently writing tests for your app, this means you did not properly stub the server response.\nMethod: ${opts.method}\nPath: ${opts.path}\n\n`, ReactKitErrorCode$1.NoCACCLSendRequestFunction);
4368
- }
4369
- });
4370
- /**
4371
- * Show an alert modal with an "Okay" button
4372
- * @author Gabe Abrams
4373
- * @param title the title text to display at the top of the alert
4374
- * @param text the text to display in the alert
4375
- */
4376
- const alert$1 = (title, text) => __awaiter(void 0, void 0, void 0, function* () {
4377
- // Fallback if alert not available
4378
- {
4379
- window.alert(`${title}\n\n${text}`);
4380
- return undefined;
4381
- }
4382
- });
4383
- /**
4384
- * Show a fatal error message
4385
- * @author Gabe Abrams
4386
- * @param error the error to show
4387
- * @param [errorTitle] title of the error box
4388
- */
4389
- const showFatalError = (error, errorTitle = 'An Error Occurred') => {
4390
- var _a, _b;
4391
- // Determine message and code
4392
- const message = (typeof error === 'string'
4393
- ? error.trim()
4394
- : String((_a = error.message) !== null && _a !== void 0 ? _a : 'An unknown error occurred.'));
4395
- const code = (typeof error === 'string'
4396
- ? ReactKitErrorCode$1.NoCode
4397
- : String((_b = error.code) !== null && _b !== void 0 ? _b : ReactKitErrorCode$1.NoCode));
4398
- // Handle case where app hasn't loaded
4399
- {
4400
- alert$1(errorTitle, `${message} (code: ${code}). Please contact support.`);
4401
- return undefined;
4402
- }
4403
- };
4404
-
4405
- /**
4406
- * Loading spinner/indicator
4407
- * @author Gabe Abrams
4408
- */
4409
- /*------------------------------------------------------------------------*/
4410
- /* Style */
4411
- /*------------------------------------------------------------------------*/
4412
- const style$5 = `
4413
- /* Container fades in */
4414
- .LoadingSpinner-container {
4415
- animation-name: LoadingSpinner-container-fade-in;
4416
- animation-duration: 0.3s;
4417
- animation-delay: 0.4s;
4418
- animation-fill-mode: both;
4419
- animation-timing-function: ease-out;
4420
- }
4421
- @keyframes LoadingSpinner-container-fade-in {
4422
- 0% {
4423
- opacity: 0;
4424
- }
4425
- 100% {
4426
- opacity: 1;
4427
- }
4428
- }
4429
-
4430
- /* Blips */
4431
- .LoadingSpinner-blip-1,
4432
- .LoadingSpinner-blip-2,
4433
- .LoadingSpinner-blip-3,
4434
- .LoadingSpinner-blip-4 {
4435
- font-size: 1.8rem;
4436
- opacity: 0.6;
4437
- margin-top: 1rem;
4438
- margin-bottom: 1rem;
4439
- }
4440
-
4441
- /* First Blip */
4442
- .LoadingSpinner-blip-1 {
4443
- animation: LoadingSpinner-pop-animation 2s infinite;
4444
- }
4445
-
4446
- /* Second Blip */
4447
- .LoadingSpinner-blip-2 {
4448
- animation: LoadingSpinner-pop-animation 2s infinite;
4449
- -webkit-animation-delay: 0.1s;
4450
- animation-delay: 0.1s;
4451
- }
4452
-
4453
- /* Third Blip */
4454
- .LoadingSpinner-blip-3 {
4455
- animation: LoadingSpinner-pop-animation 2s infinite;
4456
- animation-delay: 0.2s;
4457
- }
4458
-
4459
- /* Fourth Blip */
4460
- .LoadingSpinner-blip-4 {
4461
- animation: LoadingSpinner-pop-animation 2s infinite;
4462
- animation-delay: 0.3s;
4463
- }
4464
-
4465
- /* Pop Animation for Each Blip */
4466
- @keyframes LoadingSpinner-pop-animation {
4467
- 0% {
4468
- transform: scale(1.0);
4469
- }
4470
- 10% {
4471
- transform: scale(1.5);
4472
- }
4473
- 30% {
4474
- transform: scale(1.0);
4475
- }
4476
- 100% {
4477
- transform: scale(1.0);
4478
- }
4479
- }
4480
- `;
4481
- /*------------------------------------------------------------------------*/
4482
- /* Component */
4483
- /*------------------------------------------------------------------------*/
4484
- const LoadingSpinner = () => {
4485
- /*------------------------------------------------------------------------*/
4486
- /* Render */
4487
- /*------------------------------------------------------------------------*/
4488
- // Add all four blips to a container
4489
- return (React__default["default"].createElement("div", { className: "text-center LoadingSpinner LoadingSpinner-container" },
4490
- React__default["default"].createElement("style", null, style$5),
4491
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-1 me-1" }),
4492
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-2 me-1" }),
4493
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-3 me-1" }),
4494
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-4" })));
4495
- };
4496
-
4497
- /**
4498
- * A radio selection button
4499
- * @author Gabe Abrams
4500
- */
4501
- /*------------------------------------------------------------------------*/
4502
- /* Component */
4503
- /*------------------------------------------------------------------------*/
4504
- const RadioButton = (props) => {
4505
- /*------------------------------------------------------------------------*/
4506
- /* Setup */
4507
- /*------------------------------------------------------------------------*/
4508
- /* -------------- Props ------------- */
4509
- const { text, onSelected, ariaLabel, title, selected, id, noMarginOnRight, selectedVariant = Variant$1.Secondary, unselectedVariant = Variant$1.Light, small, } = props;
4510
- /*------------------------------------------------------------------------*/
4511
- /* Render */
4512
- /*------------------------------------------------------------------------*/
4513
- /*----------------------------------------*/
4514
- /* Main UI */
4515
- /*----------------------------------------*/
4516
- return (React__default["default"].createElement("button", { type: "button", id: id, title: title, className: `btn btn-${selected ? selectedVariant : unselectedVariant}${selected ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'}`, "aria-label": `${ariaLabel}${selected ? ': currently selected' : ''}`, onClick: () => {
4517
- if (!selected) {
4518
- onSelected();
4519
- }
4520
- } },
4521
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: selected ? freeSolidSvgIcons.faDotCircle : freeRegularSvgIcons.faCircle, className: "me-1" }),
4522
- text));
4523
- };
4524
-
4525
- /**
4526
- * A checkbox button
4527
- * @author Gabe Abrams
4528
- */
4529
- /*------------------------------------------------------------------------*/
4530
- /* Component */
4531
- /*------------------------------------------------------------------------*/
4532
- const CheckboxButton = (props) => {
4533
- /*------------------------------------------------------------------------*/
4534
- /* Setup */
4535
- /*------------------------------------------------------------------------*/
4536
- /* -------------- Props ------------- */
4537
- const { text, onChanged, ariaLabel, title, checked, id, className, noMarginOnRight, checkedVariant = Variant$1.Secondary, uncheckedVariant = Variant$1.Light, small, dashed, } = props;
4538
- /*------------------------------------------------------------------------*/
4539
- /* Render */
4540
- /*------------------------------------------------------------------------*/
4541
- /*----------------------------------------*/
4542
- /* Main UI */
4543
- /*----------------------------------------*/
4544
- // Determine the icon
4545
- let icon;
4546
- if (checked) {
4547
- icon = freeSolidSvgIcons.faCheckSquare;
4548
- }
4549
- else {
4550
- icon = (dashed
4551
- ? freeRegularSvgIcons.faSquareMinus
4552
- : freeRegularSvgIcons.faSquare);
4553
- }
4554
- // Create the button
4555
- return (React__default["default"].createElement("button", { type: "button", id: id, title: title, className: `CheckboxButton-status-${checked ? 'checked' : 'unchecked'} ${dashed ? 'CheckboxButton-dashed ' : ''}btn btn-${checked ? checkedVariant : uncheckedVariant}${checked ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": `${ariaLabel}${checked ? ': currently checked' : ''}`, onClick: () => {
4556
- onChanged(!checked);
4557
- } },
4558
- React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: icon, className: "me-1" }),
4559
- text));
4560
- };
4561
-
4562
- /**
4563
- * Input group with a title and space for buttons
4564
- * @author Gabe Abrams
4565
- */
4566
- /*------------------------------------------------------------------------*/
4567
- /* Component */
4568
- /*------------------------------------------------------------------------*/
4569
- const ButtonInputGroup = (props) => {
4570
- /*------------------------------------------------------------------------*/
4571
- /* Setup */
4572
- /*------------------------------------------------------------------------*/
4573
- /* -------------- Props ------------- */
4574
- // Destructure all props
4575
- const { label, minLabelWidth, children, } = props;
4576
- /*------------------------------------------------------------------------*/
4577
- /* Render */
4578
- /*------------------------------------------------------------------------*/
4579
- /*----------------------------------------*/
4580
- /* Main UI */
4581
- /*----------------------------------------*/
4582
- return (React__default["default"].createElement("div", { className: "input-group" },
4583
- React__default["default"].createElement("div", { className: "input-group-prepend d-flex w-100" },
4584
- React__default["default"].createElement("span", { className: "input-group-text", style: {
4585
- minWidth: (minLabelWidth !== null && minLabelWidth !== void 0 ? minLabelWidth : undefined),
4586
- borderTopRightRadius: 0,
4587
- borderBottomRightRadius: 0,
4588
- } }, label),
4589
- React__default["default"].createElement("span", { className: "input-group-text flex-grow-1 rounded-right", style: {
4590
- backgroundColor: 'white',
4591
- borderTopLeftRadius: 0,
4592
- borderBottomLeftRadius: 0,
4593
- borderLeftWidth: 0,
4594
- } }, children))));
4595
- };
4596
-
4597
- /**
4598
- * Copiable text box
4599
- * @author Gabe Abrams
4600
- */
4601
- /* ------------- Actions ------------ */
4602
- // Types of actions
4603
- var ActionType$1$1;
4604
- (function (ActionType) {
4605
- // Indicate that the text was recently copied
4606
- ActionType["IndicateRecentlyCopied"] = "indicate-recently-copied";
4607
- // Clear the status
4608
- ActionType["ClearRecentlyCopiedStatus"] = "clear-recently-copied-status";
4609
- })(ActionType$1$1 || (ActionType$1$1 = {}));
4610
-
4611
- /**
4612
- * Reusable nested item picker
4613
- * @author Yuen Ler Chow
4614
- */
4615
- /* ------------- Actions ------------ */
4616
- // Types of actions
4617
- var ActionType$3;
4618
- (function (ActionType) {
4619
- // Toggle whether the children are being shown
4620
- ActionType["ToggleItems"] = "toggle-items";
4621
- })(ActionType$3 || (ActionType$3 = {}));
4622
-
4623
- // Keep track of whether or not session expiry has already been handled
4624
- let sessionAlreadyExpired = false;
4625
- /*------------------------------------------------------------------------*/
4626
- /* Stub Logic */
4627
- /*------------------------------------------------------------------------*/
4628
- // Stored stub responses
4629
- const stubResponses = {};
4630
- /*------------------------------------------------------------------------*/
4631
- /* Main */
4632
- /*------------------------------------------------------------------------*/
4633
- /**
4634
- * Visit an endpoint on the server [for client only]
4635
- * @author Gabe Abrams
4636
- * @param opts object containing all arguments
4637
- * @param opts.path - the path of the server endpoint
4638
- * @param [opts.method=GET] - the method of the endpoint
4639
- * @param [opts.params] - query/body parameters to include
4640
- * @returns response from server
4641
- */
4642
- const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function* () {
4643
- var _a, _b, _c;
4644
- const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET');
4645
- // Handle stubs
4646
- const stubResponse = (_b = stubResponses[method]) === null || _b === void 0 ? void 0 : _b[opts.path];
4647
- if (stubResponse) {
4648
- // Remove from list
4649
- try {
4650
- stubResponses[method][opts.path] = undefined;
4651
- }
4652
- catch (err) {
4653
- // Ignore
4654
- }
4655
- // Success
4656
- if (stubResponse.success) {
4657
- return stubResponse.body;
4658
- }
4659
- // Error
4660
- throw new ErrorWithCode(stubResponse.errorMessage, stubResponse.errorCode);
4661
- }
4662
- // Send the request
4663
- const response = yield cacclSendRequest({
4664
- path: opts.path,
4665
- method: (_c = opts.method) !== null && _c !== void 0 ? _c : 'GET',
4666
- params: opts.params,
4667
- });
4668
- // Check for failure
4669
- if (!response || !response.body) {
4670
- throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$1.NoResponse);
4671
- }
4672
- if (!response.body.success) {
4673
- // Session expired
4674
- if (response.body.code === ReactKitErrorCode$1.SessionExpired) {
4675
- // Skip notice if session was already expired
4676
- if (sessionAlreadyExpired) {
4677
- // Never return (browser is already reloading)
4678
- yield new Promise(() => {
4679
- // Promise that never returns
4680
- });
4681
- }
4682
- sessionAlreadyExpired = true;
4683
- // Show session expiration message
4684
- {
4685
- // Fallback to alert
4686
- // eslint-disable-next-line no-alert
4687
- alert('Your session has expired. Please start over.');
4688
- }
4689
- // Never return (don't continue execution)
4690
- yield new Promise(() => {
4691
- // Promise that never returns
4692
- });
4693
- }
4694
- // Other errors
4695
- throw new ErrorWithCode((response.body.message
4696
- || 'An unknown error occurred. Please contact an admin.'), (response.body.code
4697
- || ReactKitErrorCode$1.NoCode));
4698
- }
4699
- // Success! Extract the body
4700
- const { body } = response.body;
4701
- // Return
4702
- return body;
4703
- });
4704
-
4705
- // Import custom error
4706
- // Stored copy of caccl functions
4707
- let _cacclGetLaunchInfo$1;
4708
- /*------------------------------------------------------------------------*/
4709
- /* Helpers */
4710
- /*------------------------------------------------------------------------*/
4711
- /**
4712
- * Get launch info via CACCL
4713
- * @author Gabe Abrams
4714
- * @param req express request object
4715
- * @returns object { launched, launchInfo }
4716
- */
4717
- const cacclGetLaunchInfo$1 = (req) => {
4718
- {
4719
- throw new ErrorWithCode('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$1.NoCACCLGetLaunchInfoFunction);
4720
- }
4721
- };
4722
-
4723
- /**
4724
- * Server-side API param types
4725
- * @author Gabe Abrams
4726
- */
4727
- var ParamType;
4728
- (function (ParamType) {
4729
- ParamType["Boolean"] = "boolean";
4730
- ParamType["BooleanOptional"] = "boolean-optional";
4731
- ParamType["Float"] = "float";
4732
- ParamType["FloatOptional"] = "float-optional";
4733
- ParamType["Int"] = "int";
4734
- ParamType["IntOptional"] = "int-optional";
4735
- ParamType["JSON"] = "json";
4736
- ParamType["JSONOptional"] = "json-optional";
4737
- ParamType["String"] = "string";
4738
- ParamType["StringOptional"] = "string-optional";
4739
- })(ParamType || (ParamType = {}));
4740
- var ParamType$1 = ParamType;
4741
-
4742
- // Import shared types
4743
- /**
4744
- * Handle an error and respond to the client
4745
- * @author Gabe Abrams
4746
- * @param res express response
4747
- * @param error error info
4748
- * @param opts.err the error to send to the client
4749
- * or the error message
4750
- * @param [opts.code] an error code (only used if err.code is not
4751
- * included)
4752
- * @param [opts.status=500] the https status code to use
4753
- * defined)
4754
- */
4755
- const handleError$1 = (res, error) => {
4756
- // Get the error message
4757
- let message;
4758
- if (error && error.message) {
4759
- message = (error.message || 'An unknown error occurred.');
4760
- }
4761
- else if (typeof error === 'string') {
4762
- message = (error.trim().length > 0
4763
- ? error
4764
- : 'An unknown error occurred.');
4765
- }
4766
- else {
4767
- message = 'An unknown error occurred.';
4768
- }
4769
- // Get the error code
4770
- const code = (error.code || ReactKitErrorCode$1.NoCode);
4771
- // Get the status code
4772
- const status = (error.status || 500);
4773
- // Respond to user
4774
- res
4775
- // Set the http status code
4776
- .status(status)
4777
- // Send a JSON response
4778
- .json({
4779
- // Error message
4780
- message,
4781
- // Error code
4782
- code,
4783
- // Success = false flag so client can detect server-side errors
4784
- success: false,
4785
- });
4786
- return undefined;
4787
- };
4788
-
4789
- /**
4790
- * Send successful API response
4791
- * @author Gabe Abrams
4792
- * @param res express response
4793
- * @param body the body of the response to send to the client
4794
- */
4795
- const handleSuccess$1 = (res, body) => {
4796
- // Send a http 200 json response
4797
- res.json({
4798
- // Include the body as a parameter
4799
- body,
4800
- // Success = true flag so client can detect successful responses
4801
- success: true,
4802
- });
4803
- return undefined;
4804
- };
4805
-
4806
- /**
4807
- * Generate an express API route handler
4808
- * @author Gabe Abrams
4809
- * @param opts object containing all arguments
4810
- * @param opts.paramTypes map containing the types for each parameter that is
4811
- * included in the request (map: param name => type)
4812
- * @param opts.handler function that processes the request
4813
- * @returns express route handler that takes the following arguments:
4814
- * params (map: param name => value), handleSuccess (function for handling
4815
- * successful requests), handleError (function for handling failed requests),
4816
- * req (express request object), res (express response object),
4817
- * next (express next function). Params also has userId, userFirstName,
4818
- * userLastName, isLearner, isTTM, isAdmin, and any other variables that
4819
- * are directly added to the session
4820
- */
4821
- const genRouteHandler$1 = (opts) => {
4822
- // Return a route handler
4823
- return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
4824
- var _a, _b;
4825
- // Output params
4826
- const output = {};
4827
- /*----------------------------------------*/
4828
- /* Parse Params */
4829
- /*----------------------------------------*/
4830
- // Process items one by one
4831
- const paramList = Object.entries((_a = opts.paramTypes) !== null && _a !== void 0 ? _a : {});
4832
- for (let i = 0; i < paramList.length; i++) {
4833
- const [name, type] = paramList[i];
4834
- // Find the value as a string
4835
- const value = (req.params[name]
4836
- || req.query[name]
4837
- || req.body[name]);
4838
- // Parse
4839
- if (type === ParamType$1.Boolean || type === ParamType$1.BooleanOptional) {
4840
- // Boolean
4841
- // Handle case where value doesn't exist
4842
- if (value === undefined) {
4843
- if (type === ParamType$1.BooleanOptional) {
4844
- output[name] = undefined;
3877
+ filterDrawer && (React__default["default"].createElement(Drawer, { customBackgroundColor: "#eee" }, filterDrawer))));
3878
+ // Actually filter the logs
3879
+ // > Perform filters
3880
+ const logs = [];
3881
+ Object.keys(logMap).forEach((year) => {
3882
+ Object.keys(logMap[year]).forEach((month) => {
3883
+ logMap[year][month].forEach((log) => {
3884
+ /* ----------- Date Filter ---------- */
3885
+ var _a;
3886
+ // Before start date
3887
+ if (
3888
+ // Previous year
3889
+ log.year < dateFilterState.startDate.year
3890
+ // Same year, earlier month
3891
+ || ((log.year === dateFilterState.startDate.year)
3892
+ && (log.month < dateFilterState.startDate.month))
3893
+ // Same year, same month, earlier day
3894
+ || ((log.year === dateFilterState.startDate.year)
3895
+ && (log.month === dateFilterState.startDate.month)
3896
+ && (log.day < dateFilterState.startDate.day))) {
3897
+ return;
4845
3898
  }
4846
- else {
4847
- return handleError$1(res, {
4848
- message: `Parameter ${name} is required, but it was not included.`,
4849
- code: ReactKitErrorCode$1.MissingParameter,
4850
- status: 422,
4851
- });
3899
+ // After end date
3900
+ if (
3901
+ // Later year
3902
+ log.year > dateFilterState.endDate.year
3903
+ // Same year, later month
3904
+ || ((log.year === dateFilterState.endDate.year)
3905
+ && (log.month > dateFilterState.endDate.month))
3906
+ // Same year, same month, later day
3907
+ || ((log.year === dateFilterState.endDate.year)
3908
+ && (log.month === dateFilterState.endDate.month)
3909
+ && (log.day > dateFilterState.endDate.day))) {
3910
+ return;
4852
3911
  }
4853
- }
4854
- else {
4855
- // Value exists
4856
- // Simplify value
4857
- const simpleVal = (String(value)
4858
- .trim()
4859
- .toLowerCase());
4860
- // Parse
4861
- output[name] = ([
4862
- 'true',
4863
- 'yes',
4864
- 'y',
4865
- '1',
4866
- 't',
4867
- ].indexOf(simpleVal) >= 0);
4868
- }
4869
- }
4870
- else if (type === ParamType$1.Float || type === ParamType$1.FloatOptional) {
4871
- // Float
4872
- // Handle case where value doesn't exist
4873
- if (value === undefined) {
4874
- if (type === ParamType$1.FloatOptional) {
4875
- output[name] = undefined;
3912
+ /* --------- Context Filter --------- */
3913
+ // Context doesn't match
3914
+ if (
3915
+ // Whole context is deselected
3916
+ contextFilterState[log.context] === false
3917
+ // None of the subcontexts are selected
3918
+ || (
3919
+ // Has subcontexts
3920
+ typeof contextFilterState[log.context] !== 'boolean'
3921
+ // None of the subcontexts are selected
3922
+ && Object.values((_a = contextFilterState[log.context]) !== null && _a !== void 0 ? _a : {})
3923
+ .every((isSelected) => {
3924
+ return !isSelected;
3925
+ }))) {
3926
+ return;
4876
3927
  }
4877
- else {
4878
- return handleError$1(res, {
4879
- message: `Parameter ${name} is required, but it was not included.`,
4880
- code: ReactKitErrorCode$1.MissingParameter,
4881
- status: 422,
4882
- });
3928
+ // Subcontext doesn't match
3929
+ if (
3930
+ // Log context is not "uncategorized" (no point in further filters)
3931
+ log.context !== LogBuiltInMetadata.Context.Uncategorized
3932
+ // Log has a subcontext
3933
+ && log.subcontext
3934
+ // Context has subcontexts
3935
+ && (contextFilterState[log.context]
3936
+ && contextFilterState[log.context] !== false
3937
+ && contextFilterState[log.context] !== true)
3938
+ // Subcontext is not selected
3939
+ && !contextFilterState[log.context][log.subcontext]) {
3940
+ return;
4883
3941
  }
4884
- }
4885
- else if (!Number.isNaN(Number.parseFloat(String(value)))) {
4886
- // Value is a number
4887
- output[name] = Number.parseFloat(String(value));
4888
- }
4889
- else {
4890
- // Issue!
4891
- return handleError$1(res, {
4892
- message: `Request data was malformed: ${name} was not a valid float.`,
4893
- code: ReactKitErrorCode$1.InvalidParameter,
4894
- status: 422,
4895
- });
4896
- }
4897
- }
4898
- else if (type === ParamType$1.Int || type === ParamType$1.IntOptional) {
4899
- // Int
4900
- // Handle case where value doesn't exist
4901
- if (value === undefined) {
4902
- if (type === ParamType$1.IntOptional) {
4903
- output[name] = undefined;
3942
+ /* -------------- Tags -------------- */
3943
+ // No tags match
3944
+ if (
3945
+ // At least one tag is required
3946
+ Object.values(tagFilterState)
3947
+ .filter((isSelected) => {
3948
+ return isSelected;
3949
+ })
3950
+ .length > 0
3951
+ // No tags match
3952
+ && log.tags.every((tag) => {
3953
+ return !tagFilterState[tag];
3954
+ })) {
3955
+ return;
4904
3956
  }
4905
- else {
4906
- return handleError$1(res, {
4907
- message: `Parameter ${name} is required, but it was not included.`,
4908
- code: ReactKitErrorCode$1.MissingParameter,
4909
- status: 422,
4910
- });
3957
+ /* ------- Actions and Errors ------- */
3958
+ // Log type doesn't match
3959
+ if (
3960
+ // Filter won't allow all types
3961
+ actionErrorFilterState.type !== undefined
3962
+ // Log type doesn't match
3963
+ && actionErrorFilterState.type !== log.type) {
3964
+ return;
4911
3965
  }
4912
- }
4913
- else if (!Number.isNaN(Number.parseInt(String(value), 10))) {
4914
- // Value is a number
4915
- output[name] = Number.parseInt(String(value), 10);
4916
- }
4917
- else {
4918
- // Issue!
4919
- return handleError$1(res, {
4920
- message: `Request data was malformed: ${name} was not a valid int.`,
4921
- code: ReactKitErrorCode$1.InvalidParameter,
4922
- status: 422,
4923
- });
4924
- }
4925
- }
4926
- else if (type === ParamType$1.JSON || type === ParamType$1.JSONOptional) {
4927
- // Stringified JSON
4928
- // Handle case where value doesn't exist
4929
- if (value === undefined) {
4930
- if (type === ParamType$1.JSONOptional) {
4931
- output[name] = undefined;
3966
+ // Filter errors
3967
+ if (log.type === LogType$1.Error) {
3968
+ // Message doesn't match
3969
+ if (
3970
+ // Message exists
3971
+ log.errorMessage
3972
+ // Message filter exists
3973
+ && actionErrorFilterState.errorMessage.trim().length > 0
3974
+ // Message doesn't match
3975
+ && log.errorMessage.toLowerCase().includes(actionErrorFilterState.errorMessage.trim().toLowerCase())) {
3976
+ return;
3977
+ }
3978
+ // Code doesn't match
3979
+ if (
3980
+ // Code exists
3981
+ log.errorCode
3982
+ // Code filter exists
3983
+ && actionErrorFilterState.errorCode.trim().length > 0
3984
+ // Code doesn't match
3985
+ && log.errorCode.toUpperCase().includes(actionErrorFilterState.errorCode.trim().toUpperCase())) {
3986
+ return;
3987
+ }
4932
3988
  }
4933
- else {
4934
- return handleError$1(res, {
4935
- message: `Parameter ${name} is required, but it was not included.`,
4936
- code: ReactKitErrorCode$1.MissingParameter,
4937
- status: 422,
4938
- });
3989
+ // Filter actions
3990
+ if (log.type === LogType$1.Action) {
3991
+ // Target isn't selected
3992
+ if (
3993
+ // Target exists
3994
+ log.target
3995
+ // Target isn't selected
3996
+ && !actionErrorFilterState.target[log.target]) {
3997
+ return;
3998
+ }
3999
+ // Action
4000
+ if (
4001
+ // Action exists
4002
+ log.action
4003
+ // Action isn't selected
4004
+ && !actionErrorFilterState.action[log.action]) {
4005
+ return;
4006
+ }
4939
4007
  }
4940
- }
4941
- else {
4942
- // Value exists
4943
- // Parse
4944
- try {
4945
- output[name] = JSON.parse(String(value));
4008
+ /* --------- Advanced Filter -------- */
4009
+ // First name doesn't match
4010
+ if (
4011
+ // First name exists
4012
+ log.userFirstName
4013
+ // First name query doesn't match
4014
+ && !log.userFirstName.toLowerCase().includes(advancedFilterState.userFirstName.toLowerCase().trim())) {
4015
+ return;
4946
4016
  }
4947
- catch (err) {
4948
- return handleError$1(res, {
4949
- message: `Request data was malformed: ${name} was not a valid JSON payload.`,
4950
- code: ReactKitErrorCode$1.InvalidParameter,
4951
- status: 422,
4952
- });
4017
+ // Last name doesn't match
4018
+ if (
4019
+ // Last name exists
4020
+ log.userLastName
4021
+ // Last name query doesn't match
4022
+ && !log.userLastName.toLowerCase().includes(advancedFilterState.userLastName.toLowerCase().trim())) {
4023
+ return;
4953
4024
  }
4954
- }
4955
- }
4956
- else if (type === ParamType$1.String || type === ParamType$1.StringOptional) {
4957
- // String
4958
- // Handle case where value doesn't exist
4959
- if (value === undefined) {
4960
- if (type === ParamType$1.StringOptional) {
4961
- output[name] = undefined;
4025
+ // Email doesn't match
4026
+ if (
4027
+ // Email exists
4028
+ log.userEmail
4029
+ // Email query doesn't match
4030
+ && !log.userEmail.toLowerCase().includes(advancedFilterState.userEmail.toLowerCase().trim())) {
4031
+ return;
4962
4032
  }
4963
- else {
4964
- return handleError$1(res, {
4965
- message: `Parameter ${name} is required, but it was not included.`,
4966
- code: ReactKitErrorCode$1.MissingParameter,
4967
- status: 422,
4968
- });
4033
+ // User id doesn't match
4034
+ if (
4035
+ // User id exists
4036
+ log.userId
4037
+ // User id doesn't match
4038
+ && !String(log.userId).includes(advancedFilterState.userId.trim())) {
4039
+ return;
4969
4040
  }
4970
- }
4971
- else {
4972
- // Value exists
4973
- // Leave as is
4974
- output[name] = value;
4975
- }
4976
- }
4977
- else {
4978
- // No valid data type
4979
- return handleError$1(res, {
4980
- message: `An internal error occurred: we could not determine the type of ${name}.`,
4981
- code: ReactKitErrorCode$1.InvalidParameter,
4982
- status: 422,
4041
+ // Learner not allowed
4042
+ if (
4043
+ // User is a learner
4044
+ log.isLearner
4045
+ // Learners aren't included
4046
+ && !advancedFilterState.includeLearners) {
4047
+ return;
4048
+ }
4049
+ // TTM not allowed
4050
+ if (
4051
+ // User is a ttm
4052
+ log.isTTM
4053
+ // TTMs aren't included
4054
+ && !advancedFilterState.includeTTMs) {
4055
+ return;
4056
+ }
4057
+ // Admin not allowed
4058
+ if (
4059
+ // User is an admin
4060
+ log.isAdmin
4061
+ // Admins aren't included
4062
+ && !advancedFilterState.includeAdmins) {
4063
+ return;
4064
+ }
4065
+ // Course Id doesn't match
4066
+ if (
4067
+ // Course Id exists
4068
+ log.courseId
4069
+ // Course Id doesn't match
4070
+ && !String(log.courseId).includes(advancedFilterState.courseId.trim())) {
4071
+ return;
4072
+ }
4073
+ // Course name doesn't match
4074
+ if (
4075
+ // Course name exists
4076
+ log.courseName
4077
+ // Course name doesn't match
4078
+ && !String(log.courseName).includes(advancedFilterState.courseName.trim())) {
4079
+ return;
4080
+ }
4081
+ // Mobile filter doesn't match
4082
+ if (
4083
+ // Mobile filter exists
4084
+ advancedFilterState.isMobile !== undefined
4085
+ // Device info exists
4086
+ && log.device
4087
+ // Mobile filter doesn't match
4088
+ && (advancedFilterState.isMobile !== log.device.isMobile)) {
4089
+ return;
4090
+ }
4091
+ // Log source doesn't match
4092
+ if (
4093
+ // Source filter exists
4094
+ advancedFilterState.source !== undefined
4095
+ // Source info exists
4096
+ && log.source
4097
+ // Source filter doesn't match
4098
+ && (advancedFilterState.source !== log.source)) {
4099
+ return;
4100
+ }
4101
+ // Route path doesn't match (Only for server source)
4102
+ if (
4103
+ // Source is server
4104
+ (log.source === LogSource$1.Server)
4105
+ // Route path is being filtered
4106
+ && (advancedFilterState.routePath.trim().length)
4107
+ // Route path doesn't match
4108
+ && !(log.routePath.includes(advancedFilterState.routePath.trim()))) {
4109
+ return;
4110
+ }
4111
+ // Route template doesn't match (Only for server source)
4112
+ if (
4113
+ // Source is server
4114
+ (log.source === LogSource$1.Server)
4115
+ // Route template is being filtered
4116
+ && (advancedFilterState.routeTemplate.trim().length)
4117
+ // Route template doesn't match
4118
+ && !(log.routeTemplate.includes(advancedFilterState.routeTemplate.trim()))) {
4119
+ return;
4120
+ }
4121
+ /* -------------- Done -------------- */
4122
+ // Made it past all filters. Add to the list
4123
+ logs.push(log);
4983
4124
  });
4984
- }
4985
- }
4986
- /*----------------------------------------*/
4987
- /* Launch Info */
4988
- /*----------------------------------------*/
4989
- // Get launch info
4990
- const { launched, launchInfo } = cacclGetLaunchInfo$1(req);
4991
- if (!launched || !launchInfo) {
4992
- return handleError$1(res, {
4993
- message: 'Your session has expired. Please refresh the page and try again.',
4994
- code: ReactKitErrorCode$1.SessionExpired,
4995
- status: 440,
4996
- });
4997
- }
4998
- // Error if user info cannot be found
4999
- if (!launchInfo.userId
5000
- || !launchInfo.userFirstName
5001
- || !launchInfo.userLastName
5002
- || (launchInfo.notInCourse
5003
- && !launchInfo.isAdmin)
5004
- || (!launchInfo.isTTM
5005
- && !launchInfo.isLearner
5006
- && !launchInfo.isAdmin)) {
5007
- return handleError$1(res, {
5008
- message: 'Your session was invalid. Please refresh the page and try again.',
5009
- code: ReactKitErrorCode$1.SessionExpired,
5010
- status: 440,
5011
4125
  });
5012
- }
5013
- // Add launch info to output
5014
- output.userId = launchInfo.userId;
5015
- output.userFirstName = launchInfo.userFirstName;
5016
- output.userLastName = launchInfo.userLastName;
5017
- output.userEmail = launchInfo.userEmail;
5018
- output.isLearner = !!launchInfo.isLearner;
5019
- output.isTTM = !!launchInfo.isTTM;
5020
- output.isAdmin = !!launchInfo.isAdmin;
5021
- output.courseId = ((_b = output.courseId) !== null && _b !== void 0 ? _b : launchInfo.courseId);
5022
- output.courseName = launchInfo.contextLabel;
5023
- // Add other session variables
5024
- Object.keys(req.session).forEach((propName) => {
5025
- // Skip if prop already in output
5026
- if (output[propName] !== undefined) {
5027
- return;
5028
- }
5029
- // Add to output
5030
- const value = req.session[propName];
5031
- if (typeof value === 'string'
5032
- || typeof value === 'boolean'
5033
- || typeof value === 'number') {
5034
- output[propName] = value;
5035
- }
5036
4126
  });
5037
4127
  /*----------------------------------------*/
5038
- /* Require Course Consistency */
5039
- /*----------------------------------------*/
5040
- // Make sure the user actually launched from the appropriate course
5041
- if (output.courseId
5042
- && launchInfo.courseId
5043
- && output.courseId !== launchInfo.courseId
5044
- && !output.isTTM
5045
- && !output.isAdmin) {
5046
- // Course of interest is not the launch course
5047
- return handleError$1(res, {
5048
- message: 'You switched sessions by opening this app in another tab. Please refresh the page and try again.',
5049
- code: ReactKitErrorCode$1.WrongCourse,
5050
- status: 401,
5051
- });
5052
- }
5053
- /*----------------------------------------*/
5054
- /* Require Proper Permissions */
4128
+ /* Data */
5055
4129
  /*----------------------------------------*/
5056
- // Add TTM endpoint security
5057
- if (
5058
- // This is a TTM endpoint
5059
- req.path.startsWith('/api/ttm')
5060
- // User is not a TTM
5061
- && (
5062
- // User is not a TTM
5063
- !output.isTTM
5064
- // User is not an admin
5065
- && !output.isAdmin)) {
5066
- // User does not have access
5067
- return handleError$1(res, {
5068
- message: 'This action is only allowed if you are a teaching team member for the course. Please go back to Canvas, log in as a teaching team member, and try again.',
5069
- code: ReactKitErrorCode$1.NotTTM,
5070
- status: 401,
5071
- });
5072
- }
5073
- // Add Admin endpoint security
5074
- if (
5075
- // This is an admin endpoint
5076
- req.path.startsWith('/api/admin')
5077
- // User is not an admin
5078
- && !output.isAdmin) {
5079
- // User does not have access
5080
- return handleError$1(res, {
5081
- message: 'This action is only allowed if you are a Canvas admin. Please go back to Canvas, log in as an admin, and try again.',
5082
- code: ReactKitErrorCode$1.NotAdmin,
5083
- status: 401,
5084
- });
5085
- }
5086
- /*------------------------------------------------------------------------*/
5087
- /* Call handler */
5088
- /*------------------------------------------------------------------------*/
5089
- try {
5090
- const results = yield opts.handler({
5091
- params: output,
5092
- req,
5093
- res,
5094
- next,
5095
- });
5096
- // Send results to client
5097
- handleSuccess$1(res, results !== null && results !== void 0 ? results : undefined);
5098
- }
5099
- catch (err) {
5100
- // Send error to client
5101
- handleError$1(res, err);
5102
- }
5103
- });
4130
+ // Nothing to show notice
4131
+ const noLogsNotice = (logs.length === 0
4132
+ ? (React__default["default"].createElement("div", { className: "alert alert-warning text-center mt-2" },
4133
+ React__default["default"].createElement("h4", { className: "m-1" }, "No Logs to Show"),
4134
+ React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet.")))
4135
+ : undefined);
4136
+ // Create intelliTable
4137
+ const dataTable = (React__default["default"].createElement(IntelliTable, { title: "Matching Logs:", csvName: `Logs from ${getHumanReadableDate()}`, id: "logs", data: logs, columns: columns }));
4138
+ // Main body
4139
+ body = (React__default["default"].createElement(React__default["default"].Fragment, null,
4140
+ filters,
4141
+ React__default["default"].createElement("div", { className: "mt-2" },
4142
+ dataTable,
4143
+ noLogsNotice)));
4144
+ }
4145
+ /* ---------- Wrap in Modal --------- */
4146
+ return (React__default["default"].createElement("div", { className: "LogReviewer-outer-container" },
4147
+ React__default["default"].createElement("style", null, style$1),
4148
+ React__default["default"].createElement("div", { className: "LogReviewer-inner-container" },
4149
+ React__default["default"].createElement("div", { className: "LogReviewer-header" },
4150
+ React__default["default"].createElement("div", { className: "LogReviewer-header-title" },
4151
+ React__default["default"].createElement("h3", { className: "text-center m-0" }, "Log Review Dashboard")),
4152
+ React__default["default"].createElement("div", { style: { width: 0 } },
4153
+ React__default["default"].createElement("button", { type: "button", className: "LogReviewer-header-close-button btn btn-dark btn-lg pe-0", "aria-label": "close log reviewer panel", onClick: onClose },
4154
+ React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faTimes })))),
4155
+ React__default["default"].createElement("div", { className: "LogReviewer-contents" }, body))));
5104
4156
  };
5105
4157
 
5106
- /**
5107
- * Days of the week
5108
- * @author Gabe Abrams
5109
- */
5110
- var DayOfWeek$2;
5111
- (function (DayOfWeek) {
5112
- DayOfWeek["Monday"] = "m";
5113
- DayOfWeek["Tuesday"] = "t";
5114
- DayOfWeek["Wednesday"] = "w";
5115
- DayOfWeek["Thursday"] = "r";
5116
- DayOfWeek["Friday"] = "f";
5117
- DayOfWeek["Saturday"] = "s";
5118
- DayOfWeek["Sunday"] = "u";
5119
- })(DayOfWeek$2 || (DayOfWeek$2 = {}));
5120
-
5121
4158
  /**
5122
4159
  * Options for field types
5123
4160
  * @author Yuen Ler Chow
@@ -40675,7 +39712,7 @@ const AddOrEditDBEntry = (props) => {
40675
39712
  * Save changes to the DBEntry and then finish
40676
39713
  * @author Yuen Ler Chow
40677
39714
  */
40678
- const save = () => __awaiter$1(void 0, void 0, void 0, function* () {
39715
+ const save = () => __awaiter(void 0, void 0, void 0, function* () {
40679
39716
  // Start the save loading indicator
40680
39717
  dispatch({ type: ActionType$1.StartSave });
40681
39718
  // add all default values to the entry
@@ -40945,7 +39982,7 @@ const AddOrEditDBEntry = (props) => {
40945
39982
  return renderEntryField(field, disabled);
40946
39983
  }),
40947
39984
  React__default["default"].createElement("div", { className: "text-center mt-2" },
40948
- React__default["default"].createElement("button", { type: "button", id: "AddOrEditDBEntry-save-changes-button", className: "btn btn-primary btn-lg me-1", "aria-label": "Save changes", onClick: () => __awaiter$1(void 0, void 0, void 0, function* () {
39985
+ React__default["default"].createElement("button", { type: "button", id: "AddOrEditDBEntry-save-changes-button", className: "btn btn-primary btn-lg me-1", "aria-label": "Save changes", onClick: () => __awaiter(void 0, void 0, void 0, function* () {
40949
39986
  if (validationError) {
40950
39987
  return alert$1('Please fix the following error', validationError);
40951
39988
  }
@@ -40976,6 +40013,7 @@ const AddOrEditDBEntry = (props) => {
40976
40013
  * @author Yuen Ler Chow
40977
40014
  * @param collectionName the name of the collection
40978
40015
  * @param [adminsOnly] true if the endpoint is for admins only
40016
+ * @returns the endpoint path
40979
40017
  */
40980
40018
  const generateEndpointPath = (collectionName, adminsOnly) => {
40981
40019
  // Determine prefix based on whether the endpoint is for admins only
@@ -41088,7 +40126,7 @@ const DBEntryManagerPanel = (props) => {
41088
40126
  * @author Yuen Ler Chow
41089
40127
  * @param entry the database entry to delete
41090
40128
  */
41091
- const deleteEntry = (entry) => __awaiter$1(void 0, void 0, void 0, function* () {
40129
+ const deleteEntry = (entry) => __awaiter(void 0, void 0, void 0, function* () {
41092
40130
  // Confirm
41093
40131
  const confirmed = yield confirm('Remove?', `Are you sure you want to remove this ${itemName}?`, {
41094
40132
  confirmButtonText: 'Remove Item',
@@ -41104,7 +40142,7 @@ const DBEntryManagerPanel = (props) => {
41104
40142
  type: ActionType.StartDelete,
41105
40143
  });
41106
40144
  // Perform deletion
41107
- yield visitServerEndpoint$1({
40145
+ yield visitServerEndpoint({
41108
40146
  path: `${endpoint}/${entry[idPropName]}`,
41109
40147
  method: 'DELETE',
41110
40148
  });
@@ -41116,7 +40154,7 @@ const DBEntryManagerPanel = (props) => {
41116
40154
  });
41117
40155
  }
41118
40156
  catch (err) {
41119
- return showFatalError$1(err);
40157
+ return showFatalError(err);
41120
40158
  }
41121
40159
  });
41122
40160
  /*------------------------------------------------------------------------*/
@@ -41127,10 +40165,10 @@ const DBEntryManagerPanel = (props) => {
41127
40165
  * @author Yuen Ler Chow
41128
40166
  */
41129
40167
  React.useEffect(() => {
41130
- (() => __awaiter$1(void 0, void 0, void 0, function* () {
40168
+ (() => __awaiter(void 0, void 0, void 0, function* () {
41131
40169
  // Load list of database entries
41132
40170
  try {
41133
- const data = yield visitServerEndpoint$1({
40171
+ const data = yield visitServerEndpoint({
41134
40172
  path: endpoint,
41135
40173
  method: 'GET',
41136
40174
  params: {
@@ -41144,7 +40182,7 @@ const DBEntryManagerPanel = (props) => {
41144
40182
  });
41145
40183
  }
41146
40184
  catch (err) {
41147
- return showFatalError$1(err);
40185
+ return showFatalError(err);
41148
40186
  }
41149
40187
  }))();
41150
40188
  }, []);
@@ -41157,7 +40195,7 @@ const DBEntryManagerPanel = (props) => {
41157
40195
  let body;
41158
40196
  /* ------------- Loading ------------ */
41159
40197
  if (loading) {
41160
- body = (React__default["default"].createElement(LoadingSpinner$1, null));
40198
+ body = (React__default["default"].createElement(LoadingSpinner, null));
41161
40199
  }
41162
40200
  /* ------------- List of entries ------------ */
41163
40201
  if (!loading && !adding && !dbEntryToEdit) {
@@ -41441,7 +40479,7 @@ let _logCollection;
41441
40479
  */
41442
40480
  const cacclGetLaunchInfo = (req) => {
41443
40481
  if (!_cacclGetLaunchInfo) {
41444
- throw new ErrorWithCode$1('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$3.NoCACCLGetLaunchInfoFunction);
40482
+ throw new ErrorWithCode('Could not get launch info because server was not initialized with dce-reactkit\'s initServer function', ReactKitErrorCode$1.NoCACCLGetLaunchInfoFunction);
41445
40483
  }
41446
40484
  return _cacclGetLaunchInfo(req);
41447
40485
  };
@@ -41501,16 +40539,16 @@ const initServer = (opts) => {
41501
40539
  */
41502
40540
  opts.app.post(LOG_ROUTE_PATH, genRouteHandler({
41503
40541
  paramTypes: {
41504
- context: ParamType$3.String,
41505
- subcontext: ParamType$3.String,
41506
- tags: ParamType$3.JSON,
41507
- level: ParamType$3.String,
41508
- metadata: ParamType$3.JSON,
41509
- errorMessage: ParamType$3.StringOptional,
41510
- errorCode: ParamType$3.StringOptional,
41511
- errorStack: ParamType$3.StringOptional,
41512
- target: ParamType$3.StringOptional,
41513
- action: ParamType$3.StringOptional,
40542
+ context: ParamType$1.String,
40543
+ subcontext: ParamType$1.String,
40544
+ tags: ParamType$1.JSON,
40545
+ level: ParamType$1.String,
40546
+ metadata: ParamType$1.JSON,
40547
+ errorMessage: ParamType$1.StringOptional,
40548
+ errorCode: ParamType$1.StringOptional,
40549
+ errorStack: ParamType$1.StringOptional,
40550
+ target: ParamType$1.StringOptional,
40551
+ action: ParamType$1.StringOptional,
41514
40552
  },
41515
40553
  handler: ({ params, logServerEvent }) => {
41516
40554
  // Create log info
@@ -41556,7 +40594,7 @@ const initServer = (opts) => {
41556
40594
  * @param isAdmin if true, the user is an admin
41557
40595
  * @returns true if the user can review logs
41558
40596
  */
41559
- const canReviewLogs = (userId, isAdmin) => __awaiter$1(void 0, void 0, void 0, function* () {
40597
+ const canReviewLogs = (userId, isAdmin) => __awaiter(void 0, void 0, void 0, function* () {
41560
40598
  // Immediately deny access if user is not an admin
41561
40599
  if (!isAdmin) {
41562
40600
  return false;
@@ -41589,7 +40627,7 @@ const initServer = (opts) => {
41589
40627
  * @returns {boolean} true if user has access
41590
40628
  */
41591
40629
  opts.app.get(LOG_REVIEW_STATUS_ROUTE, genRouteHandler({
41592
- handler: ({ params }) => __awaiter$1(void 0, void 0, void 0, function* () {
40630
+ handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
41593
40631
  const { userId, isAdmin } = params;
41594
40632
  const canReview = yield canReviewLogs(userId, isAdmin);
41595
40633
  return canReview;
@@ -41604,16 +40642,16 @@ const initServer = (opts) => {
41604
40642
  */
41605
40643
  opts.app.get(`${LOG_REVIEW_ROUTE_PATH_PREFIX}/years/:year/months/:month`, genRouteHandler({
41606
40644
  paramTypes: {
41607
- year: ParamType$3.Int,
41608
- month: ParamType$3.Int,
40645
+ year: ParamType$1.Int,
40646
+ month: ParamType$1.Int,
41609
40647
  },
41610
- handler: ({ params }) => __awaiter$1(void 0, void 0, void 0, function* () {
40648
+ handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
41611
40649
  // Get user info
41612
40650
  const { year, month, userId, isAdmin, } = params;
41613
40651
  // Validate user
41614
40652
  const canReview = yield canReviewLogs(userId, isAdmin);
41615
40653
  if (!canReview) {
41616
- throw new ErrorWithCode$1('You cannot access this resource because you do not have the appropriate permissions.', ReactKitErrorCode$3.NotAllowedToReviewLogs);
40654
+ throw new ErrorWithCode('You cannot access this resource because you do not have the appropriate permissions.', ReactKitErrorCode$1.NotAllowedToReviewLogs);
41617
40655
  }
41618
40656
  // Query for logs
41619
40657
  const logs = yield _logCollection.find({
@@ -41654,7 +40692,7 @@ const handleError = (res, error) => {
41654
40692
  message = 'An unknown error occurred.';
41655
40693
  }
41656
40694
  // Get the error code
41657
- const code = (error.code || ReactKitErrorCode$3.NoCode);
40695
+ const code = (error.code || ReactKitErrorCode$1.NoCode);
41658
40696
  // Get the status code
41659
40697
  const status = (error.status || 500);
41660
40698
  // Respond to user
@@ -41708,7 +40746,7 @@ const genErrorPage = (opts = {}) => {
41708
40746
  const title = ((_a = opts.title) !== null && _a !== void 0 ? _a : 'An Error Occurred');
41709
40747
  const pageTitle = ((_b = opts.pageTitle) !== null && _b !== void 0 ? _b : title);
41710
40748
  const description = ((_c = opts.description) !== null && _c !== void 0 ? _c : 'An unknown server error occurred. Please contact support.');
41711
- const code = ((_d = opts.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$3.NoCode);
40749
+ const code = ((_d = opts.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$1.NoCode);
41712
40750
  return `
41713
40751
  <head>
41714
40752
  <!-- Metadata -->
@@ -41947,7 +40985,7 @@ const parseUserAgent = (userAgent) => {
41947
40985
  */
41948
40986
  const genRouteHandler = (opts) => {
41949
40987
  // Return a route handler
41950
- return (req, res, next) => __awaiter$1(void 0, void 0, void 0, function* () {
40988
+ return (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
41951
40989
  var _a, _b;
41952
40990
  // Output params
41953
40991
  const output = {};
@@ -41963,17 +41001,17 @@ const genRouteHandler = (opts) => {
41963
41001
  || req.query[name]
41964
41002
  || req.body[name]);
41965
41003
  // Parse
41966
- if (type === ParamType$3.Boolean || type === ParamType$3.BooleanOptional) {
41004
+ if (type === ParamType$1.Boolean || type === ParamType$1.BooleanOptional) {
41967
41005
  // Boolean
41968
41006
  // Handle case where value doesn't exist
41969
41007
  if (value === undefined) {
41970
- if (type === ParamType$3.BooleanOptional) {
41008
+ if (type === ParamType$1.BooleanOptional) {
41971
41009
  output[name] = undefined;
41972
41010
  }
41973
41011
  else {
41974
41012
  return handleError(res, {
41975
41013
  message: `Parameter ${name} is required, but it was not included.`,
41976
- code: ReactKitErrorCode$3.MissingParameter,
41014
+ code: ReactKitErrorCode$1.MissingParameter,
41977
41015
  status: 422,
41978
41016
  });
41979
41017
  }
@@ -41994,17 +41032,17 @@ const genRouteHandler = (opts) => {
41994
41032
  ].indexOf(simpleVal) >= 0);
41995
41033
  }
41996
41034
  }
41997
- else if (type === ParamType$3.Float || type === ParamType$3.FloatOptional) {
41035
+ else if (type === ParamType$1.Float || type === ParamType$1.FloatOptional) {
41998
41036
  // Float
41999
41037
  // Handle case where value doesn't exist
42000
41038
  if (value === undefined) {
42001
- if (type === ParamType$3.FloatOptional) {
41039
+ if (type === ParamType$1.FloatOptional) {
42002
41040
  output[name] = undefined;
42003
41041
  }
42004
41042
  else {
42005
41043
  return handleError(res, {
42006
41044
  message: `Parameter ${name} is required, but it was not included.`,
42007
- code: ReactKitErrorCode$3.MissingParameter,
41045
+ code: ReactKitErrorCode$1.MissingParameter,
42008
41046
  status: 422,
42009
41047
  });
42010
41048
  }
@@ -42017,22 +41055,22 @@ const genRouteHandler = (opts) => {
42017
41055
  // Issue!
42018
41056
  return handleError(res, {
42019
41057
  message: `Request data was malformed: ${name} was not a valid float.`,
42020
- code: ReactKitErrorCode$3.InvalidParameter,
41058
+ code: ReactKitErrorCode$1.InvalidParameter,
42021
41059
  status: 422,
42022
41060
  });
42023
41061
  }
42024
41062
  }
42025
- else if (type === ParamType$3.Int || type === ParamType$3.IntOptional) {
41063
+ else if (type === ParamType$1.Int || type === ParamType$1.IntOptional) {
42026
41064
  // Int
42027
41065
  // Handle case where value doesn't exist
42028
41066
  if (value === undefined) {
42029
- if (type === ParamType$3.IntOptional) {
41067
+ if (type === ParamType$1.IntOptional) {
42030
41068
  output[name] = undefined;
42031
41069
  }
42032
41070
  else {
42033
41071
  return handleError(res, {
42034
41072
  message: `Parameter ${name} is required, but it was not included.`,
42035
- code: ReactKitErrorCode$3.MissingParameter,
41073
+ code: ReactKitErrorCode$1.MissingParameter,
42036
41074
  status: 422,
42037
41075
  });
42038
41076
  }
@@ -42045,22 +41083,22 @@ const genRouteHandler = (opts) => {
42045
41083
  // Issue!
42046
41084
  return handleError(res, {
42047
41085
  message: `Request data was malformed: ${name} was not a valid int.`,
42048
- code: ReactKitErrorCode$3.InvalidParameter,
41086
+ code: ReactKitErrorCode$1.InvalidParameter,
42049
41087
  status: 422,
42050
41088
  });
42051
41089
  }
42052
41090
  }
42053
- else if (type === ParamType$3.JSON || type === ParamType$3.JSONOptional) {
41091
+ else if (type === ParamType$1.JSON || type === ParamType$1.JSONOptional) {
42054
41092
  // Stringified JSON
42055
41093
  // Handle case where value doesn't exist
42056
41094
  if (value === undefined) {
42057
- if (type === ParamType$3.JSONOptional) {
41095
+ if (type === ParamType$1.JSONOptional) {
42058
41096
  output[name] = undefined;
42059
41097
  }
42060
41098
  else {
42061
41099
  return handleError(res, {
42062
41100
  message: `Parameter ${name} is required, but it was not included.`,
42063
- code: ReactKitErrorCode$3.MissingParameter,
41101
+ code: ReactKitErrorCode$1.MissingParameter,
42064
41102
  status: 422,
42065
41103
  });
42066
41104
  }
@@ -42074,23 +41112,23 @@ const genRouteHandler = (opts) => {
42074
41112
  catch (err) {
42075
41113
  return handleError(res, {
42076
41114
  message: `Request data was malformed: ${name} was not a valid JSON payload.`,
42077
- code: ReactKitErrorCode$3.InvalidParameter,
41115
+ code: ReactKitErrorCode$1.InvalidParameter,
42078
41116
  status: 422,
42079
41117
  });
42080
41118
  }
42081
41119
  }
42082
41120
  }
42083
- else if (type === ParamType$3.String || type === ParamType$3.StringOptional) {
41121
+ else if (type === ParamType$1.String || type === ParamType$1.StringOptional) {
42084
41122
  // String
42085
41123
  // Handle case where value doesn't exist
42086
41124
  if (value === undefined) {
42087
- if (type === ParamType$3.StringOptional) {
41125
+ if (type === ParamType$1.StringOptional) {
42088
41126
  output[name] = undefined;
42089
41127
  }
42090
41128
  else {
42091
41129
  return handleError(res, {
42092
41130
  message: `Parameter ${name} is required, but it was not included.`,
42093
- code: ReactKitErrorCode$3.MissingParameter,
41131
+ code: ReactKitErrorCode$1.MissingParameter,
42094
41132
  status: 422,
42095
41133
  });
42096
41134
  }
@@ -42105,7 +41143,7 @@ const genRouteHandler = (opts) => {
42105
41143
  // No valid data type
42106
41144
  return handleError(res, {
42107
41145
  message: `An internal error occurred: we could not determine the type of ${name}.`,
42108
- code: ReactKitErrorCode$3.InvalidParameter,
41146
+ code: ReactKitErrorCode$1.InvalidParameter,
42109
41147
  status: 422,
42110
41148
  });
42111
41149
  }
@@ -42122,7 +41160,7 @@ const genRouteHandler = (opts) => {
42122
41160
  && !opts.skipSessionCheck) {
42123
41161
  return handleError(res, {
42124
41162
  message: 'Your session has expired. Please refresh the page and try again.',
42125
- code: ReactKitErrorCode$3.SessionExpired,
41163
+ code: ReactKitErrorCode$1.SessionExpired,
42126
41164
  status: 401,
42127
41165
  });
42128
41166
  }
@@ -42142,7 +41180,7 @@ const genRouteHandler = (opts) => {
42142
41180
  && !opts.skipSessionCheck) {
42143
41181
  return handleError(res, {
42144
41182
  message: 'Your session was invalid. Please refresh the page and try again.',
42145
- code: ReactKitErrorCode$3.SessionExpired,
41183
+ code: ReactKitErrorCode$1.SessionExpired,
42146
41184
  status: 401,
42147
41185
  });
42148
41186
  }
@@ -42201,7 +41239,7 @@ const genRouteHandler = (opts) => {
42201
41239
  // Course of interest is not the launch course
42202
41240
  return handleError(res, {
42203
41241
  message: 'You switched sessions by opening this app in another tab. Please refresh the page and try again.',
42204
- code: ReactKitErrorCode$3.WrongCourse,
41242
+ code: ReactKitErrorCode$1.WrongCourse,
42205
41243
  status: 401,
42206
41244
  });
42207
41245
  }
@@ -42221,7 +41259,7 @@ const genRouteHandler = (opts) => {
42221
41259
  // User does not have access
42222
41260
  return handleError(res, {
42223
41261
  message: 'This action is only allowed if you are a teaching team member for the course. Please go back to Canvas, log in as a teaching team member, and try again.',
42224
- code: ReactKitErrorCode$3.NotTTM,
41262
+ code: ReactKitErrorCode$1.NotTTM,
42225
41263
  status: 401,
42226
41264
  });
42227
41265
  }
@@ -42234,7 +41272,7 @@ const genRouteHandler = (opts) => {
42234
41272
  // User does not have access
42235
41273
  return handleError(res, {
42236
41274
  message: 'This action is only allowed if you are a Canvas admin. Please go back to Canvas, log in as an admin, and try again.',
42237
- code: ReactKitErrorCode$3.NotAdmin,
41275
+ code: ReactKitErrorCode$1.NotAdmin,
42238
41276
  status: 401,
42239
41277
  });
42240
41278
  }
@@ -42246,7 +41284,7 @@ const genRouteHandler = (opts) => {
42246
41284
  * Log an event on the server
42247
41285
  * @author Gabe Abrams
42248
41286
  */
42249
- const logServerEvent = (opts) => __awaiter$1(void 0, void 0, void 0, function* () {
41287
+ const logServerEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () {
42250
41288
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
42251
41289
  // NOTE: internally, we slip through an opts.overrideAsClientEvent boolean
42252
41290
  // that indicates that this is actually a client event, but we don't
@@ -42290,7 +41328,7 @@ const genRouteHandler = (opts) => {
42290
41328
  ? {
42291
41329
  type: LogType$1.Error,
42292
41330
  errorMessage: (_j = opts.error.message) !== null && _j !== void 0 ? _j : 'Unknown message',
42293
- errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$3.NoCode,
41331
+ errorCode: (_k = opts.error.code) !== null && _k !== void 0 ? _k : ReactKitErrorCode$1.NoCode,
42294
41332
  errorStack: (_l = opts.error.stack) !== null && _l !== void 0 ? _l : 'No stack',
42295
41333
  }
42296
41334
  : {
@@ -42495,7 +41533,7 @@ const startMinWait = (minWaitMs) => {
42495
41533
  * Finish the remaining time to wait
42496
41534
  * @author Gabe Abrams
42497
41535
  */
42498
- return () => __awaiter$1(void 0, void 0, void 0, function* () {
41536
+ return () => __awaiter(void 0, void 0, void 0, function* () {
42499
41537
  const endTimestamp = Date.now();
42500
41538
  // Calculate remaining time to wait
42501
41539
  const elapsedTimeMs = (endTimestamp - startTimestamp);
@@ -42582,7 +41620,7 @@ const onlyKeepLetters = (str) => {
42582
41620
  * once
42583
41621
  * @returns array of resolved values in the same order as the task functions
42584
41622
  */
42585
- const parallelLimit = (taskFunctions, limit) => __awaiter$1(void 0, void 0, void 0, function* () {
41623
+ const parallelLimit = (taskFunctions, limit) => __awaiter(void 0, void 0, void 0, function* () {
42586
41624
  const results = [];
42587
41625
  // Wait until finished with all tasks
42588
41626
  yield new Promise((resolve) => {
@@ -42593,7 +41631,7 @@ const parallelLimit = (taskFunctions, limit) => __awaiter$1(void 0, void 0, void
42593
41631
  * Start the next task
42594
41632
  * @author Gabe Abrams
42595
41633
  */
42596
- const startTask = () => __awaiter$1(void 0, void 0, void 0, function* () {
41634
+ const startTask = () => __awaiter(void 0, void 0, void 0, function* () {
42597
41635
  const taskIndex = nextTaskIndex++;
42598
41636
  // Get the task
42599
41637
  const taskFunction = taskFunctions[taskIndex];
@@ -42646,14 +41684,14 @@ let canReview = undefined;
42646
41684
  * @author Gabe Abrams
42647
41685
  * @returns true if current user can review logs
42648
41686
  */
42649
- const canReviewLogs = () => __awaiter$1(void 0, void 0, void 0, function* () {
41687
+ const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () {
42650
41688
  // If cached, use that value
42651
41689
  if (canReview !== undefined) {
42652
41690
  return canReview;
42653
41691
  }
42654
41692
  // Ask on server
42655
41693
  try {
42656
- canReview = !!(yield visitServerEndpoint$1({
41694
+ canReview = !!(yield visitServerEndpoint({
42657
41695
  path: LOG_REVIEW_STATUS_ROUTE,
42658
41696
  method: 'GET',
42659
41697
  }));
@@ -42776,11 +41814,11 @@ const addDBEditorEndpoints = (opts) => {
42776
41814
  * @author Yuen Ler Chow
42777
41815
  * @returns {any[]} the list of items in the collection
42778
41816
  */
42779
- app.get(endpointPath, genRouteHandler$1({
41817
+ app.get(endpointPath, genRouteHandler({
42780
41818
  paramTypes: {
42781
41819
  filterQuery: ParamType$1.JSONOptional,
42782
41820
  },
42783
- handler: ({ params }) => __awaiter$1(void 0, void 0, void 0, function* () {
41821
+ handler: ({ params }) => __awaiter(void 0, void 0, void 0, function* () {
42784
41822
  var _a;
42785
41823
  const filterQuery = (_a = params.filterQuery) !== null && _a !== void 0 ? _a : {};
42786
41824
  const categories = yield collection.find(filterQuery);
@@ -42792,11 +41830,11 @@ const addDBEditorEndpoints = (opts) => {
42792
41830
  * @author Yuen Ler Chow
42793
41831
  * @param {any} item the item to create
42794
41832
  */
42795
- app.post(endpointPath, genRouteHandler$1({
41833
+ app.post(endpointPath, genRouteHandler({
42796
41834
  paramTypes: {
42797
41835
  item: ParamType$1.JSON,
42798
41836
  },
42799
- handler: ({ params, }) => __awaiter$1(void 0, void 0, void 0, function* () {
41837
+ handler: ({ params, }) => __awaiter(void 0, void 0, void 0, function* () {
42800
41838
  // Destructure params
42801
41839
  const { item, } = params;
42802
41840
  yield collection.insert(item);
@@ -42806,11 +41844,11 @@ const addDBEditorEndpoints = (opts) => {
42806
41844
  * Remove an item from the collection by id
42807
41845
  * @author Yuen Ler Chow
42808
41846
  */
42809
- app.delete(`${endpointPath}/:id`, genRouteHandler$1({
41847
+ app.delete(`${endpointPath}/:id`, genRouteHandler({
42810
41848
  paramTypes: {
42811
41849
  id: ParamType$1.String,
42812
41850
  },
42813
- handler: ({ params, }) => __awaiter$1(void 0, void 0, void 0, function* () {
41851
+ handler: ({ params, }) => __awaiter(void 0, void 0, void 0, function* () {
42814
41852
  // Destructure params
42815
41853
  const { id, } = params;
42816
41854
  yield collection.delete({ id });
@@ -42835,9 +41873,9 @@ var DayOfWeek;
42835
41873
  var DayOfWeek$1 = DayOfWeek;
42836
41874
 
42837
41875
  exports.AppWrapper = AppWrapper;
42838
- exports.ButtonInputGroup = ButtonInputGroup$1;
41876
+ exports.ButtonInputGroup = ButtonInputGroup;
42839
41877
  exports.CSVDownloadButton = CSVDownloadButton;
42840
- exports.CheckboxButton = CheckboxButton$1;
41878
+ exports.CheckboxButton = CheckboxButton;
42841
41879
  exports.CopiableBox = CopiableBox;
42842
41880
  exports.DAY_IN_MS = DAY_IN_MS;
42843
41881
  exports.DBEntryFieldType = DBEntryFieldType$1;
@@ -42846,11 +41884,11 @@ exports.DayOfWeek = DayOfWeek$1;
42846
41884
  exports.Drawer = Drawer;
42847
41885
  exports.DynamicWord = DynamicWord;
42848
41886
  exports.ErrorBox = ErrorBox;
42849
- exports.ErrorWithCode = ErrorWithCode$1;
41887
+ exports.ErrorWithCode = ErrorWithCode;
42850
41888
  exports.HOUR_IN_MS = HOUR_IN_MS;
42851
41889
  exports.IntelliTable = IntelliTable;
42852
41890
  exports.ItemPicker = ItemPicker;
42853
- exports.LoadingSpinner = LoadingSpinner$1;
41891
+ exports.LoadingSpinner = LoadingSpinner;
42854
41892
  exports.LogAction = LogAction$1;
42855
41893
  exports.LogBuiltInMetadata = LogBuiltInMetadata;
42856
41894
  exports.LogReviewer = LogReviewer;
@@ -42858,21 +41896,21 @@ exports.LogSource = LogSource$1;
42858
41896
  exports.LogType = LogType$1;
42859
41897
  exports.MINUTE_IN_MS = MINUTE_IN_MS;
42860
41898
  exports.Modal = Modal;
42861
- exports.ModalButtonType = ModalButtonType$3;
42862
- exports.ModalSize = ModalSize$2;
42863
- exports.ModalType = ModalType$3;
42864
- exports.ParamType = ParamType$3;
41899
+ exports.ModalButtonType = ModalButtonType$1;
41900
+ exports.ModalSize = ModalSize$1;
41901
+ exports.ModalType = ModalType$1;
41902
+ exports.ParamType = ParamType$1;
42865
41903
  exports.PopFailureMark = PopFailureMark;
42866
41904
  exports.PopPendingMark = PopPendingMark;
42867
41905
  exports.PopSuccessMark = PopSuccessMark;
42868
- exports.RadioButton = RadioButton$1;
42869
- exports.ReactKitErrorCode = ReactKitErrorCode$3;
41906
+ exports.RadioButton = RadioButton;
41907
+ exports.ReactKitErrorCode = ReactKitErrorCode$1;
42870
41908
  exports.SimpleDateChooser = SimpleDateChooser;
42871
41909
  exports.TabBox = TabBox;
42872
- exports.Variant = Variant$3;
41910
+ exports.Variant = Variant$1;
42873
41911
  exports.abbreviate = abbreviate;
42874
41912
  exports.addDBEditorEndpoints = addDBEditorEndpoints;
42875
- exports.alert = alert$2;
41913
+ exports.alert = alert$1;
42876
41914
  exports.avg = avg;
42877
41915
  exports.canReviewLogs = canReviewLogs;
42878
41916
  exports.ceilToNumDecimals = ceilToNumDecimals;
@@ -42901,11 +41939,11 @@ exports.padDecimalZeros = padDecimalZeros;
42901
41939
  exports.padZerosLeft = padZerosLeft;
42902
41940
  exports.parallelLimit = parallelLimit;
42903
41941
  exports.roundToNumDecimals = roundToNumDecimals;
42904
- exports.showFatalError = showFatalError$1;
41942
+ exports.showFatalError = showFatalError;
42905
41943
  exports.startMinWait = startMinWait;
42906
41944
  exports.stringsToHumanReadableList = stringsToHumanReadableList;
42907
41945
  exports.stubServerEndpoint = stubServerEndpoint;
42908
41946
  exports.sum = sum;
42909
- exports.visitServerEndpoint = visitServerEndpoint$1;
41947
+ exports.visitServerEndpoint = visitServerEndpoint;
42910
41948
  exports.waitMs = waitMs;
42911
41949
  //# sourceMappingURL=index.js.map