touchstudy-core 0.1.132 → 0.1.133

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ var reactRedux = require('react-redux');
16
16
  var moment = _interopDefault(require('moment'));
17
17
  require('moment/locale/ko.js');
18
18
  require('moment/locale/en-au.js');
19
- var _ = _interopDefault(require('lodash'));
19
+ var _$5 = _interopDefault(require('lodash'));
20
20
  var fa = require('react-icons/fa');
21
21
  var io = require('react-icons/io');
22
22
  var io5 = require('react-icons/io5');
@@ -24,8 +24,7 @@ var Select = require('react-select');
24
24
  var Select__default = _interopDefault(Select);
25
25
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
26
26
  var axios = _interopDefault(require('axios'));
27
- var GoogleLogin = require('@leecheuk/react-google-login');
28
- var GoogleLogin__default = _interopDefault(GoogleLogin);
27
+ var reactGoogleLogin = require('@leecheuk/react-google-login');
29
28
  var formik = require('formik');
30
29
  var reactVirtualized = require('react-virtualized');
31
30
  var tinymce = _interopDefault(require('tinymce'));
@@ -70,7 +69,6 @@ var Container = _interopDefault(require('@mui/material/Container'));
70
69
  var styles$c = require('@mui/material/styles');
71
70
  var Slider = _interopDefault(require('react-slick'));
72
71
  var gr = require('react-icons/gr');
73
- var reactRouterDom = require('react-router-dom');
74
72
  var Popover = _interopDefault(require('@mui/material/Popover'));
75
73
  var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
76
74
  var go = require('react-icons/go');
@@ -4945,7 +4943,7 @@ var getLocalDayOfWeek = function getLocalDayOfWeek(utcDateTime, dayOfWeek) {
4945
4943
  return moment.utc(utcDateTime).add(diff, "days").local().weekday();
4946
4944
  };
4947
4945
  var getUtcDayOfWeek = function getUtcDayOfWeek(localDateTime, dayOfWeek) {
4948
- var currentDayOfWeek = _.cloneDeep(localDateTime).local().weekday();
4946
+ var currentDayOfWeek = _$5.cloneDeep(localDateTime).local().weekday();
4949
4947
  var diff = dayOfWeek - currentDayOfWeek;
4950
4948
  if (diff < 0) diff += 7;
4951
4949
  return localDateTime.add(diff, "days").utc().weekday();
@@ -6482,7 +6480,7 @@ var useGoogleSignOut = function useGoogleSignOut(props) {
6482
6480
  var handleLogoutFailure = function handleLogoutFailure() {
6483
6481
  onFailure === null || onFailure === void 0 ? void 0 : onFailure();
6484
6482
  };
6485
- var _useGoogleLogout = GoogleLogin.useGoogleLogout({
6483
+ var _useGoogleLogout = reactGoogleLogin.useGoogleLogout({
6486
6484
  clientId: GOOGLE_CLIENT_ID,
6487
6485
  onLogoutSuccess: handleLogoutSuccess,
6488
6486
  onFailure: handleLogoutFailure
@@ -6599,7 +6597,7 @@ var useList = function useList(fetchData, defaultQuery) {
6599
6597
  var _paging$page, _paging$limit;
6600
6598
  return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
6601
6599
  };
6602
- var debounceSearch = _.debounce(function () {
6600
+ var debounceSearch = _$5.debounce(function () {
6603
6601
  var _textSearchRef$curren;
6604
6602
  setFilter(_extends({}, filter, {
6605
6603
  currentPage: 1,
@@ -10403,7 +10401,7 @@ var BlockLogin = function BlockLogin(_ref3) {
10403
10401
  width: "300px"
10404
10402
  })), !isOTP && !isEmail && React__default.createElement("div", {
10405
10403
  className: "p-0 mt-1 mb-4"
10406
- }, React__default.createElement(GoogleLogin__default, {
10404
+ }, React__default.createElement(reactGoogleLogin.GoogleLogin, {
10407
10405
  clientId: clientId,
10408
10406
  buttonText: t("sign_in_with_your_google_account"),
10409
10407
  onSuccess: onSuccessGoogle,
@@ -12048,7 +12046,7 @@ var ClassForm = function ClassForm(_ref) {
12048
12046
  };
12049
12047
  var handleDeleteWeeklyDays = function handleDeleteWeeklyDays(currentValue) {
12050
12048
  if (formikProp.values.courseWeeklyDays.length <= 1) return;
12051
- var courseWeeklyDays = _.cloneDeep(formikProp.values.courseWeeklyDays);
12049
+ var courseWeeklyDays = _$5.cloneDeep(formikProp.values.courseWeeklyDays);
12052
12050
  var newValues = courseWeeklyDays.filter(function (i) {
12053
12051
  var _i$startTime, _currentValue$startTi, _i$endTime, _currentValue$endTime;
12054
12052
  return i.dayOfWeek !== currentValue.dayOfWeek || ((_i$startTime = i.startTime) === null || _i$startTime === void 0 ? void 0 : _i$startTime.format("HH:mm:ss")) !== ((_currentValue$startTi = currentValue.startTime) === null || _currentValue$startTi === void 0 ? void 0 : _currentValue$startTi.format("HH:mm:ss")) || ((_i$endTime = i.endTime) === null || _i$endTime === void 0 ? void 0 : _i$endTime.format("HH:mm:ss")) !== ((_currentValue$endTime = currentValue.endTime) === null || _currentValue$endTime === void 0 ? void 0 : _currentValue$endTime.format("HH:mm:ss"));
@@ -12084,7 +12082,7 @@ var ClassForm = function ClassForm(_ref) {
12084
12082
  var handleChangeWeeklyDayTime = function handleChangeWeeklyDayTime(key, newValue, currentValue) {
12085
12083
  var _extends2;
12086
12084
  var time = newValue === null || newValue === void 0 ? void 0 : newValue.local();
12087
- var courseWeeklyDays = _.cloneDeep(formikProp.values.courseWeeklyDays);
12085
+ var courseWeeklyDays = _$5.cloneDeep(formikProp.values.courseWeeklyDays);
12088
12086
  var currentIndex = courseWeeklyDays.findIndex(function (i) {
12089
12087
  var _i$startTime2, _currentValue$startTi2, _i$endTime2, _currentValue$endTime2;
12090
12088
  return i.dayOfWeek === currentValue.dayOfWeek && ((_i$startTime2 = i.startTime) === null || _i$startTime2 === void 0 ? void 0 : _i$startTime2.format("HH:mm:ss")) === ((_currentValue$startTi2 = currentValue.startTime) === null || _currentValue$startTi2 === void 0 ? void 0 : _currentValue$startTi2.format("HH:mm:ss")) && ((_i$endTime2 = i.endTime) === null || _i$endTime2 === void 0 ? void 0 : _i$endTime2.format("HH:mm:ss")) === ((_currentValue$endTime2 = currentValue.endTime) === null || _currentValue$endTime2 === void 0 ? void 0 : _currentValue$endTime2.format("HH:mm:ss"));
@@ -12119,11 +12117,11 @@ var ClassForm = function ClassForm(_ref) {
12119
12117
  }, [JSON.stringify(data)]);
12120
12118
  var minDate = React.useMemo(function () {
12121
12119
  if (!formikProp.values.startDate) return undefined;
12122
- return _.cloneDeep(formikProp.values.startDate).add(1, "days");
12120
+ return _$5.cloneDeep(formikProp.values.startDate).add(1, "days");
12123
12121
  }, [formikProp.values.startDate]);
12124
12122
  var maxDate = React.useMemo(function () {
12125
12123
  if (!formikProp.values.endDate) return undefined;
12126
- return _.cloneDeep(formikProp.values.endDate).add(1, "days");
12124
+ return _$5.cloneDeep(formikProp.values.endDate).add(1, "days");
12127
12125
  }, [formikProp.values.endDate]);
12128
12126
  var WeeklyDayErrors = formikProp.touched.courseWeeklyDays && formikProp.errors.courseWeeklyDays && React__default.createElement("div", {
12129
12127
  className: "mt-1"
@@ -12140,7 +12138,7 @@ var ClassForm = function ClassForm(_ref) {
12140
12138
  });
12141
12139
  }, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
12142
12140
  var courseWeeklyDays = React.useMemo(function () {
12143
- return _.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
12141
+ return _$5.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
12144
12142
  }, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
12145
12143
  return React__default.createElement("div", {
12146
12144
  className: "d-flex flex-column"
@@ -12291,7 +12289,7 @@ var ClassForm = function ClassForm(_ref) {
12291
12289
  value: v.startTime,
12292
12290
  format: "HH:mm",
12293
12291
  open: open === index + "-startTime",
12294
- maxTime: v.endTime ? _.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
12292
+ maxTime: v.endTime ? _$5.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
12295
12293
  onAccept: function onAccept(newValue) {
12296
12294
  return handleChangeWeeklyDayTime("startTime", newValue, v);
12297
12295
  },
@@ -12321,7 +12319,7 @@ var ClassForm = function ClassForm(_ref) {
12321
12319
  components: ["TimePicker"]
12322
12320
  }, React__default.createElement(xDatePickers.TimePicker, {
12323
12321
  value: v.endTime,
12324
- minTime: v.startTime ? (_$cloneDeep = _.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
12322
+ minTime: v.startTime ? (_$cloneDeep = _$5.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
12325
12323
  format: "HH:mm",
12326
12324
  open: open === index + "-endTime",
12327
12325
  onAccept: function onAccept(newValue) {
@@ -12945,7 +12943,7 @@ var useStudentClassList = function useStudentClassList(courseId) {
12945
12943
  currentPage: 1
12946
12944
  }));
12947
12945
  };
12948
- var debounceSearch = _.debounce(function () {
12946
+ var debounceSearch = _$5.debounce(function () {
12949
12947
  setFilter(_extends({}, filter, {
12950
12948
  currentPage: 1
12951
12949
  }));
@@ -13081,7 +13079,7 @@ var useTeacherClassList = function useTeacherClassList(courseId) {
13081
13079
  currentPage: 1
13082
13080
  }));
13083
13081
  };
13084
- var debounceSearch = _.debounce(function () {
13082
+ var debounceSearch = _$5.debounce(function () {
13085
13083
  setFilter(_extends({}, filter, {
13086
13084
  currentPage: 1
13087
13085
  }));
@@ -13389,7 +13387,7 @@ var useClassDetail = function useClassDetail(_ref) {
13389
13387
  });
13390
13388
  }, [JSON.stringify(course)]);
13391
13389
  var convertToRequestBody = function convertToRequestBody(request) {
13392
- var localStartDate = _.cloneDeep(request.startDate);
13390
+ var localStartDate = _$5.cloneDeep(request.startDate);
13393
13391
  return _extends({}, request, {
13394
13392
  startDate: request.startDate.utc().format(DATE_TIME_FORMAT),
13395
13393
  endDate: request.endDate.utc().format(DATE_TIME_FORMAT),
@@ -13638,13 +13636,13 @@ var useClassDetail = function useClassDetail(_ref) {
13638
13636
  });
13639
13637
  if (event.target.checked) {
13640
13638
  setSelected(function (prev) {
13641
- return _.uniq([].concat(prev, newSelected));
13639
+ return _$5.uniq([].concat(prev, newSelected));
13642
13640
  });
13643
13641
  return;
13644
13642
  }
13645
- setSelected(_.difference(selected, newSelected));
13643
+ setSelected(_$5.difference(selected, newSelected));
13646
13644
  };
13647
- var debounceSearch = _.debounce(function () {
13645
+ var debounceSearch = _$5.debounce(function () {
13648
13646
  setFilter(_extends({}, filter, {
13649
13647
  currentPage: 1
13650
13648
  }));
@@ -13662,7 +13660,7 @@ var useClassDetail = function useClassDetail(_ref) {
13662
13660
  }) : userList.map(function (n) {
13663
13661
  return n.teacherId;
13664
13662
  });
13665
- var checkLength = _.intersection(selected, newSelected).length;
13663
+ var checkLength = _$5.intersection(selected, newSelected).length;
13666
13664
  return checkLength === userLength;
13667
13665
  };
13668
13666
  var handleClear = function handleClear() {
@@ -13697,7 +13695,7 @@ var useClassDetail = function useClassDetail(_ref) {
13697
13695
  }));
13698
13696
  setSelected([]);
13699
13697
  };
13700
- var debounceSort = _.debounce(handleSort, 300);
13698
+ var debounceSort = _$5.debounce(handleSort, 300);
13701
13699
  var handleChangePage = function handleChangePage(_, page) {
13702
13700
  setFilter(_extends({}, filter, {
13703
13701
  currentPage: page
@@ -13775,8 +13773,8 @@ var LessonFormBody = function LessonFormBody(_ref) {
13775
13773
  React.useEffect(function () {
13776
13774
  if (open && data) formikProp.setValues(data);else formikProp.setValues(DEFAULT_LESSON_REQUEST);
13777
13775
  }, [open, JSON.stringify(data)]);
13778
- var maxTime = formikProp.values.endTime ? _.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
13779
- var minTime = formikProp.values.startTime ? _.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
13776
+ var maxTime = formikProp.values.endTime ? _$5.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
13777
+ var minTime = formikProp.values.startTime ? _$5.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
13780
13778
  return React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogContent, {
13781
13779
  sx: {
13782
13780
  overflowY: "unset"
@@ -14356,7 +14354,7 @@ var useClassList = function useClassList(history, classCreateUrl, classUpdateUrl
14356
14354
  currentPage: 1
14357
14355
  }));
14358
14356
  };
14359
- var debounceSearch = _.debounce(function () {
14357
+ var debounceSearch = _$5.debounce(function () {
14360
14358
  setClassFilter(_extends({}, classFilter, {
14361
14359
  currentPage: 1
14362
14360
  }));
@@ -19458,7 +19456,7 @@ var useNotes = function useNotes(setFilter, filter) {
19458
19456
  var items = (data === null || data === void 0 ? void 0 : data.items) || [];
19459
19457
  var newNotes = items;
19460
19458
  if (filter !== null && filter !== void 0 && filter.currentPage && (filter === null || filter === void 0 ? void 0 : filter.currentPage) > 1) {
19461
- newNotes = [].concat(_.uniqBy([].concat(notes, items), "id"));
19459
+ newNotes = [].concat(_$5.uniqBy([].concat(notes, items), "id"));
19462
19460
  }
19463
19461
  setNotes(newNotes);
19464
19462
  });
@@ -19481,7 +19479,7 @@ var useNotes = function useNotes(setFilter, filter) {
19481
19479
  });
19482
19480
  }, [filter === null || filter === void 0 ? void 0 : filter.currentPage, totalPages]);
19483
19481
  var handleNoteAdded = function handleNoteAdded(note) {
19484
- var newNotes = [].concat(_.uniqBy([note].concat(notes), "id"));
19482
+ var newNotes = [].concat(_$5.uniqBy([note].concat(notes), "id"));
19485
19483
  setNotes(newNotes);
19486
19484
  };
19487
19485
  var handleNoteUpdated = function handleNoteUpdated(note) {
@@ -19937,18 +19935,20 @@ var useExamResultData = function useExamResultData(props) {
19937
19935
  topAnswerOrder: i.topAnswerOrder == null ? 0 : i.topAnswerOrder
19938
19936
  });
19939
19937
  });
19940
- var mySeriesData = [null].concat(_.sortBy(questionsData.filter(function (i) {
19938
+ var sortedMySeriesQuestionData = _$5.sortBy(questionsData.filter(function (i) {
19941
19939
  return i.answerOrder !== 0;
19942
- }), ["answerOrder", "questionOrder"]).map(function (item) {
19940
+ }), ["answerOrder", "questionOrder"]);
19941
+ var mySeriesData = [null].concat(sortedMySeriesQuestionData.map(function (item) {
19943
19942
  return timelyOrderQuestion.questions.length - item.questionOrder;
19944
19943
  }), questionsData.filter(function (i) {
19945
19944
  return i.answerOrder === 0;
19946
19945
  }).map(function () {
19947
19946
  return null;
19948
19947
  }), [null]);
19949
- var topSeriesData = [null].concat(_.sortBy(questionsData.filter(function (i) {
19948
+ var sortedTopSeriesQuestionData = _$5.sortBy(questionsData.filter(function (i) {
19950
19949
  return i.topAnswerOrder !== 0;
19951
- }), ["topAnswerOrder", "questionOrder"]).map(function (item) {
19950
+ }), ["topAnswerOrder", "questionOrder"]);
19951
+ var topSeriesData = [null].concat(sortedTopSeriesQuestionData.map(function (item) {
19952
19952
  return timelyOrderQuestion.questions.length - item.questionOrder;
19953
19953
  }), questionsData.filter(function (i) {
19954
19954
  return i.topAnswerOrder === 0;
@@ -22201,7 +22201,7 @@ var useUserList = function useUserList(role) {
22201
22201
  currentPage: 1
22202
22202
  }));
22203
22203
  };
22204
- var debounceSort = _.debounce(handleSort, 300);
22204
+ var debounceSort = _$5.debounce(handleSort, 300);
22205
22205
  var getUserById = function getUserById(id) {
22206
22206
  try {
22207
22207
  var _temp8 = function _temp8() {
@@ -22359,7 +22359,7 @@ var useUserList = function useUserList(role) {
22359
22359
  return Promise.reject(e);
22360
22360
  }
22361
22361
  };
22362
- var debounceSearch = _.debounce(function () {
22362
+ var debounceSearch = _$5.debounce(function () {
22363
22363
  setFilter(_extends({}, filter, {
22364
22364
  currentPage: 1
22365
22365
  }));
@@ -22912,10 +22912,15 @@ var QuestionView = function QuestionView(_ref2) {
22912
22912
  }, React__default.createElement(material.Stack, null, React__default.createElement(material.FormGroup, null, React__default.createElement(material.FormLabel, {
22913
22913
  htmlFor: "textual_answer",
22914
22914
  className: styles$6["question-label"] + " form-label"
22915
- }, t("textual_answer")), React__default.createElement(MathTinyEditor, {
22915
+ }, t("textual_answer")), React__default.createElement(material.TextField, {
22916
+ sx: {
22917
+ "& .MuiInputBase-input": {
22918
+ p: "12px 14px"
22919
+ }
22920
+ },
22916
22921
  value: (question === null || question === void 0 ? void 0 : question.textualAnswer) || "",
22917
- onChange: function onChange(newValue) {
22918
- return onChangeTextualAnswer(newValue, index);
22922
+ onChange: function onChange(e) {
22923
+ return onChangeTextualAnswer(e.target.value, index);
22919
22924
  }
22920
22925
  })))));
22921
22926
  case exports.QuestionAnswerType.MultipleChoice:
@@ -23610,8 +23615,8 @@ var useExamDetailView = function useExamDetailView(props) {
23610
23615
  var handleAddArticle = function handleAddArticle() {
23611
23616
  var _$maxBy, _$maxBy2;
23612
23617
  if (!exam) return;
23613
- var maxArticle = ((_$maxBy = _.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
23614
- var maxOrder = ((_$maxBy2 = _.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
23618
+ var maxArticle = ((_$maxBy = _$5.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
23619
+ var maxOrder = ((_$maxBy2 = _$5.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
23615
23620
  onChangeExam(_extends({}, exam, {
23616
23621
  questions: [].concat(exam.questions, [{
23617
23622
  questionAnswerType: exports.QuestionAnswerType.SingleChoice,
@@ -23662,7 +23667,7 @@ var useExamDetailView = function useExamDetailView(props) {
23662
23667
  var examGroupByArticle = React.useMemo(function () {
23663
23668
  if (!exam) return [];
23664
23669
  var articles = [];
23665
- var groupedArticle = _.groupBy(exam.questions, "article");
23670
+ var groupedArticle = _$5.groupBy(exam.questions, "article");
23666
23671
  for (var key in groupedArticle) {
23667
23672
  if (Object.prototype.hasOwnProperty.call(groupedArticle, key)) {
23668
23673
  var _questions$find, _$maxBy3;
@@ -23672,13 +23677,13 @@ var useExamDetailView = function useExamDetailView(props) {
23672
23677
  categoryId: (_questions$find = questions.find(function (i) {
23673
23678
  return !!i.categoryId;
23674
23679
  })) === null || _questions$find === void 0 ? void 0 : _questions$find.categoryId,
23675
- answerCount: ((_$maxBy3 = _.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
23680
+ answerCount: ((_$maxBy3 = _$5.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
23676
23681
  questionCount: questions.length,
23677
23682
  questions: questions
23678
23683
  });
23679
23684
  }
23680
23685
  }
23681
- return _.sortBy(articles, "article");
23686
+ return _$5.sortBy(articles, "article");
23682
23687
  }, [JSON.stringify(exam)]);
23683
23688
  var durationOptions = React.useMemo(function () {
23684
23689
  var options = DURATION_OPTIONS.map(function (i) {
@@ -26092,11 +26097,11 @@ var useTextbookShare = function useTextbookShare(props) {
26092
26097
  });
26093
26098
  if (event.target.checked) {
26094
26099
  setSelectedShare(function (prev) {
26095
- return _.uniq([].concat(prev, newSelected));
26100
+ return _$5.uniq([].concat(prev, newSelected));
26096
26101
  });
26097
26102
  return;
26098
26103
  }
26099
- setSelectedShare(_.difference(selectedShare, newSelected));
26104
+ setSelectedShare(_$5.difference(selectedShare, newSelected));
26100
26105
  };
26101
26106
  var isCheckAllShare = function isCheckAllShare(userLength) {
26102
26107
  var newSelected = isUpdate ? shared.map(function (n) {
@@ -26104,7 +26109,7 @@ var useTextbookShare = function useTextbookShare(props) {
26104
26109
  }) : notShared.map(function (n) {
26105
26110
  return n.id;
26106
26111
  });
26107
- var checkLength = _.intersection(selectedShare, newSelected).length;
26112
+ var checkLength = _$5.intersection(selectedShare, newSelected).length;
26108
26113
  return checkLength === userLength;
26109
26114
  };
26110
26115
  var handleClickCheckboxShare = function handleClickCheckboxShare(id) {
@@ -26898,7 +26903,7 @@ var useNotificationList = function useNotificationList(_ref) {
26898
26903
  currentPage: 1
26899
26904
  }));
26900
26905
  };
26901
- var debounceSearch = _.debounce(function () {
26906
+ var debounceSearch = _$5.debounce(function () {
26902
26907
  setNotificationFilter(_extends({}, notificationFilter, {
26903
26908
  currentPage: 1
26904
26909
  }));
@@ -28229,6 +28234,7 @@ var isEqual$1 = function isEqual(prev, next) {
28229
28234
  var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$1);
28230
28235
 
28231
28236
  var _excluded$f = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
28237
+ var _ = _$5;
28232
28238
  var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
28233
28239
  var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate;
28234
28240
  var data = _ref.data,
@@ -28350,6 +28356,7 @@ var isEqual$2 = function isEqual(prev, next) {
28350
28356
  var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$2);
28351
28357
 
28352
28358
  var _excluded$g = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "isDisabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
28359
+ var _$1 = _$5;
28353
28360
  var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
28354
28361
  var _data$articles$2, _data$articles$2$cate, _data$articles$2$cate2, _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2;
28355
28362
  var expandedIndex = _ref.expandedIndex,
@@ -28456,7 +28463,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
28456
28463
  }).join(",") : ""].filter(function (i) {
28457
28464
  return !!i;
28458
28465
  }).join(" / ");
28459
- var blockErrors = _.get(errors, path);
28466
+ var blockErrors = _$1.get(errors, path);
28460
28467
  return React__default.createElement(material.Accordion, {
28461
28468
  expanded: open,
28462
28469
  onChange: handleToggle,
@@ -28853,6 +28860,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
28853
28860
  };
28854
28861
 
28855
28862
  var _excluded$i = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
28863
+ var _$2 = _$5;
28856
28864
  var ChapterBlock = function ChapterBlock(_ref) {
28857
28865
  var data = _ref.data,
28858
28866
  expandedIndex = _ref.expandedIndex,
@@ -28890,10 +28898,10 @@ var ChapterBlock = function ChapterBlock(_ref) {
28890
28898
  chapter: title
28891
28899
  }), title, path.replace(/\[(\d+)\]$/, ""), expandedIndex);
28892
28900
  };
28893
- var pageNameError = _.get(errors, path + ".name");
28894
- var pageFromError = _.get(errors, path + ".pageFrom");
28895
- var pageToError = _.get(errors, path + ".pageTo");
28896
- var blockErrors = _.get(errors, path);
28901
+ var pageNameError = _$2.get(errors, path + ".name");
28902
+ var pageFromError = _$2.get(errors, path + ".pageFrom");
28903
+ var pageToError = _$2.get(errors, path + ".pageTo");
28904
+ var blockErrors = _$2.get(errors, path);
28897
28905
  return React__default.createElement(material.Accordion, {
28898
28906
  expanded: open,
28899
28907
  onChange: handleToggle,
@@ -29222,7 +29230,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
29222
29230
  return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.academyDomain;
29223
29231
  });
29224
29232
  var getOptionFilter = function getOptionFilter() {
29225
- var cloneFilter = _.clone(filter);
29233
+ var cloneFilter = _$5.clone(filter);
29226
29234
  for (var key in cloneFilter) {
29227
29235
  if (Object.prototype.hasOwnProperty.call(cloneFilter, key)) {
29228
29236
  var element = cloneFilter[key];
@@ -29370,6 +29378,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
29370
29378
  };
29371
29379
  };
29372
29380
 
29381
+ var _$3 = _$5;
29373
29382
  var TextbookContentsTab = function TextbookContentsTab(props) {
29374
29383
  var values = props.values,
29375
29384
  setFieldValue = props.setFieldValue;
@@ -29411,7 +29420,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
29411
29420
  };
29412
29421
  var handleConfirmDeleteBlock = function handleConfirmDeleteBlock() {
29413
29422
  if (!(openConfirmDelete !== null && openConfirmDelete !== void 0 && openConfirmDelete.path)) return;
29414
- var items = _.get(values, openConfirmDelete.path, []);
29423
+ var items = _$3.get(values, openConfirmDelete.path, []);
29415
29424
  setFieldValue(openConfirmDelete.path, items.filter(function (_, i) {
29416
29425
  return i !== openConfirmDelete.itemIndex;
29417
29426
  }));
@@ -29451,12 +29460,12 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
29451
29460
  if (!newParts.length) return;
29452
29461
  if (newParts.length < parts.length) {
29453
29462
  var _$get, _$get2, _$get3;
29454
- var subChapters = (_$get = _.get(values, newPath + ".subChapters")) != null ? _$get : [];
29463
+ var subChapters = (_$get = _$3.get(values, newPath + ".subChapters")) != null ? _$get : [];
29455
29464
  var questionGroups = [];
29456
- if (!subChapters.length) questionGroups = (_$get2 = _.get(values, newPath + ".questionGroups")) != null ? _$get2 : [];else questionGroups = (_$get3 = _.get(values, newPath + ".subChapters[" + (subChapters.length - 1) + "].questionGroups")) != null ? _$get3 : [];
29457
- return _.last(questionGroups);
29465
+ if (!subChapters.length) questionGroups = (_$get2 = _$3.get(values, newPath + ".questionGroups")) != null ? _$get2 : [];else questionGroups = (_$get3 = _$3.get(values, newPath + ".subChapters[" + (subChapters.length - 1) + "].questionGroups")) != null ? _$get3 : [];
29466
+ return _$3.last(questionGroups);
29458
29467
  }
29459
- return _.get(values, newPath);
29468
+ return _$3.get(values, newPath);
29460
29469
  };
29461
29470
  var handleOpenSubCategoryMenu = React.useCallback(function (key, categoryId) {
29462
29471
  setOptionKey(key);
@@ -29885,7 +29894,7 @@ var useSelect = function useSelect(_ref) {
29885
29894
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
29886
29895
  });
29887
29896
  var isSuperAdmin = !!user && !user.academyDomain;
29888
- var loadData = _.debounce(function (e) {
29897
+ var loadData = _$5.debounce(function (e) {
29889
29898
  try {
29890
29899
  var _temp2 = function _temp2() {
29891
29900
  setLoading(false);
@@ -30026,6 +30035,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
30026
30035
  }, errors === null || errors === void 0 ? void 0 : errors.textbookOwners[index].courseId)));
30027
30036
  };
30028
30037
 
30038
+ var _$4 = _$5;
30029
30039
  var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30030
30040
  var errors = _ref.errors,
30031
30041
  values = _ref.values,
@@ -30046,7 +30056,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30046
30056
  container: true,
30047
30057
  spacing: "16px"
30048
30058
  }, textbookOwners === null || textbookOwners === void 0 ? void 0 : textbookOwners.map(function (_val, index) {
30049
- var _values$textbookOwner, _values$textbookOwner2, _values$textbookOwner3, _values$textbookOwner4, _values$textbookOwner5;
30059
+ var _values$textbookOwner, _values$textbookOwner2, _values$textbookOwner3;
30050
30060
  return React__default.createElement(material.Grid, {
30051
30061
  item: true,
30052
30062
  xs: 6,
@@ -30088,17 +30098,17 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30088
30098
  fullWidth: true
30089
30099
  }, field));
30090
30100
  }
30091
- }), _.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(material.Typography, {
30101
+ }), _$4.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(material.Typography, {
30092
30102
  fontWeight: 500,
30093
30103
  fontSize: "10px",
30094
30104
  lineHeight: "11.93px",
30095
- color: _.get(errors, "textbookOwners[" + index + "].email") ? "#97A1AF" : "#F34B4B"
30096
- }, _.get(errors, "textbookOwners[" + index + "].email"))), !!(values !== null && values !== void 0 && (_values$textbookOwner = values.textbookOwners) !== null && _values$textbookOwner !== void 0 && _values$textbookOwner[index].email) && React__default.createElement(OwnerSelector, {
30105
+ color: _$4.get(errors, "textbookOwners[" + index + "].email") ? "#97A1AF" : "#F34B4B"
30106
+ }, _$4.get(errors, "textbookOwners[" + index + "].email"))), !!(values !== null && values !== void 0 && (_values$textbookOwner = values.textbookOwners) !== null && _values$textbookOwner !== void 0 && _values$textbookOwner[index].email) && React__default.createElement(OwnerSelector, {
30107
+ values: values,
30097
30108
  errors: errors,
30098
30109
  index: index,
30099
30110
  onChangeFieldValue: setFieldValue,
30100
- academyId: values === null || values === void 0 ? void 0 : (_values$textbookOwner2 = values.textbookOwners) === null || _values$textbookOwner2 === void 0 ? void 0 : (_values$textbookOwner3 = _values$textbookOwner2[index]) === null || _values$textbookOwner3 === void 0 ? void 0 : _values$textbookOwner3.academyId,
30101
- email: values === null || values === void 0 ? void 0 : (_values$textbookOwner4 = values.textbookOwners) === null || _values$textbookOwner4 === void 0 ? void 0 : (_values$textbookOwner5 = _values$textbookOwner4[index]) === null || _values$textbookOwner5 === void 0 ? void 0 : _values$textbookOwner5.email
30111
+ academyId: values === null || values === void 0 ? void 0 : (_values$textbookOwner2 = values.textbookOwners) === null || _values$textbookOwner2 === void 0 ? void 0 : (_values$textbookOwner3 = _values$textbookOwner2[index]) === null || _values$textbookOwner3 === void 0 ? void 0 : _values$textbookOwner3.academyId
30102
30112
  })));
30103
30113
  }), React__default.createElement(material.Grid, {
30104
30114
  item: true,
@@ -30127,7 +30137,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30127
30137
  };
30128
30138
 
30129
30139
  var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
30130
- var values = isMath !== undefined ? _.cloneDeep(textbook) : textbook;
30140
+ var values = isMath !== undefined ? _$5.cloneDeep(textbook) : textbook;
30131
30141
  if (isMath !== undefined) values.type = isMath;
30132
30142
  for (var key in values) {
30133
30143
  if (values.hasOwnProperty(key)) {
@@ -30142,7 +30152,7 @@ var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
30142
30152
  return values;
30143
30153
  };
30144
30154
  var _resetAllCrategoriesAndQuestionTypesBySubject = function resetAllCrategoriesAndQuestionTypesBySubject(textbook, subject) {
30145
- var values = subject ? _.cloneDeep(textbook) : textbook;
30155
+ var values = subject ? _$5.cloneDeep(textbook) : textbook;
30146
30156
  if (subject) {
30147
30157
  values.subjectId = subject === null || subject === void 0 ? void 0 : subject.value;
30148
30158
  values.subject = subject;
@@ -30387,7 +30397,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
30387
30397
  },
30388
30398
  variant: "contained",
30389
30399
  onClick: function onClick() {
30390
- if (!_.isEmpty(errors)) {
30400
+ if (!_$5.isEmpty(errors)) {
30391
30401
  reactToastify.toast.error(i18n.t("please_fill_in_the_blank_fields"));
30392
30402
  }
30393
30403
  },
@@ -31135,7 +31145,7 @@ var usePreparedExam = function usePreparedExam(_ref) {
31135
31145
  return Promise.reject(e);
31136
31146
  }
31137
31147
  };
31138
- var debounceSearch = _.debounce(function () {
31148
+ var debounceSearch = _$5.debounce(function () {
31139
31149
  setTextbookFilter(_extends({}, textbookFilter, {
31140
31150
  currentPage: 1
31141
31151
  }));
@@ -32840,7 +32850,7 @@ var PreparedItem = function PreparedItem(_ref) {
32840
32850
  });
32841
32851
  return React__default.createElement(formik.Form, {
32842
32852
  style: {
32843
- height: !_.isEmpty(values) && !textbookList.length ? "100%" : "unset"
32853
+ height: !_$5.isEmpty(values) && !textbookList.length ? "100%" : "unset"
32844
32854
  }
32845
32855
  }, React__default.createElement(material.Stack, null, React__default.createElement(material.Accordion, {
32846
32856
  sx: {
@@ -33246,7 +33256,7 @@ var PreparedItem = function PreparedItem(_ref) {
33246
33256
  open: openConfirmDialog,
33247
33257
  onClose: handleCloseConfirmDialog,
33248
33258
  onSubmit: handleResetFilter
33249
- }), !_.isEmpty(values) && !textbookList.length && React__default.createElement(material.Stack, {
33259
+ }), !_$5.isEmpty(values) && !textbookList.length && React__default.createElement(material.Stack, {
33250
33260
  height: 1,
33251
33261
  justifyContent: "center",
33252
33262
  alignItems: "center"
@@ -34043,7 +34053,9 @@ var Header = function Header(_ref) {
34043
34053
  headerTabs = _ref.headerTabs,
34044
34054
  role = _ref.role,
34045
34055
  history = _ref.history,
34056
+ link = _ref.link,
34046
34057
  onSignOut = _ref.onSignOut;
34058
+ var Link = link;
34047
34059
  var _useTranslation = reactI18next.useTranslation(),
34048
34060
  t = _useTranslation.t;
34049
34061
  var theme = material.useTheme();
@@ -34106,7 +34118,7 @@ var Header = function Header(_ref) {
34106
34118
  icon = _ref2.icon,
34107
34119
  label = _ref2.label,
34108
34120
  activePaths = _ref2.activePaths;
34109
- return React__default.createElement(reactRouterDom.Link, {
34121
+ return React__default.createElement(Link, {
34110
34122
  key: path,
34111
34123
  "aria-current": "page",
34112
34124
  to: !isAcademy ? "#" : path,
@@ -34139,7 +34151,7 @@ var Header = function Header(_ref) {
34139
34151
  })), React__default.createElement(material.Stack, {
34140
34152
  direction: "row",
34141
34153
  alignItems: "center"
34142
- }, React__default.createElement(reactRouterDom.Link, {
34154
+ }, React__default.createElement(Link, {
34143
34155
  "aria-current": "page",
34144
34156
  to: isAcademy ? homeRoute.path : academyListRoute.path,
34145
34157
  className: "border-none"