touchstudy-core 0.1.131 → 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.
@@ -19,14 +19,14 @@ import moment from 'moment';
19
19
  export { default as moment } from 'moment';
20
20
  import 'moment/locale/ko.js';
21
21
  import 'moment/locale/en-au.js';
22
- import _ from 'lodash';
22
+ import _$5 from 'lodash';
23
23
  import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlus, FaPlusCircle, FaUpload, FaEye as FaEye$1, FaPencilAlt, FaShare, FaExchangeAlt, FaBookOpen } from 'react-icons/fa';
24
24
  import { IoMdArrowBack, IoIosAdd, IoMdAdd, IoIosAlert, IoIosArrowDown, IoIosSearch, IoIosArrowUp } from 'react-icons/io';
25
25
  import { IoClose, IoSearch, IoCloseOutline, IoChevronUp, IoChevronDown, IoChatbubbleEllipsesSharp, IoPrint, IoWarning, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle, IoCloseCircle, IoLogOut } from 'react-icons/io5';
26
26
  import Select, { components } from 'react-select';
27
27
  import CreatableSelect from 'react-select/creatable';
28
28
  import axios from 'axios';
29
- import GoogleLogin, { useGoogleLogout } from '@leecheuk/react-google-login';
29
+ import { useGoogleLogout, GoogleLogin } from '@leecheuk/react-google-login';
30
30
  import { Formik, Form, Field, FieldArray } from 'formik';
31
31
  import { AutoSizer } from 'react-virtualized';
32
32
  import tinymce from 'tinymce';
@@ -71,7 +71,6 @@ import Container$1 from '@mui/material/Container';
71
71
  import { alpha } from '@mui/material/styles';
72
72
  import Slider from 'react-slick';
73
73
  import { GrNext, GrPrevious } from 'react-icons/gr';
74
- import { Link } from 'react-router-dom';
75
74
  import Popover from '@mui/material/Popover';
76
75
  import MenuItem$1 from '@mui/material/MenuItem';
77
76
  import { GoArrowSwitch } from 'react-icons/go';
@@ -4949,7 +4948,7 @@ var getLocalDayOfWeek = function getLocalDayOfWeek(utcDateTime, dayOfWeek) {
4949
4948
  return moment.utc(utcDateTime).add(diff, "days").local().weekday();
4950
4949
  };
4951
4950
  var getUtcDayOfWeek = function getUtcDayOfWeek(localDateTime, dayOfWeek) {
4952
- var currentDayOfWeek = _.cloneDeep(localDateTime).local().weekday();
4951
+ var currentDayOfWeek = _$5.cloneDeep(localDateTime).local().weekday();
4953
4952
  var diff = dayOfWeek - currentDayOfWeek;
4954
4953
  if (diff < 0) diff += 7;
4955
4954
  return localDateTime.add(diff, "days").utc().weekday();
@@ -6610,7 +6609,7 @@ var useList = function useList(fetchData, defaultQuery) {
6610
6609
  var _paging$page, _paging$limit;
6611
6610
  return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
6612
6611
  };
6613
- var debounceSearch = _.debounce(function () {
6612
+ var debounceSearch = _$5.debounce(function () {
6614
6613
  var _textSearchRef$curren;
6615
6614
  setFilter(_extends({}, filter, {
6616
6615
  currentPage: 1,
@@ -12061,7 +12060,7 @@ var ClassForm = function ClassForm(_ref) {
12061
12060
  };
12062
12061
  var handleDeleteWeeklyDays = function handleDeleteWeeklyDays(currentValue) {
12063
12062
  if (formikProp.values.courseWeeklyDays.length <= 1) return;
12064
- var courseWeeklyDays = _.cloneDeep(formikProp.values.courseWeeklyDays);
12063
+ var courseWeeklyDays = _$5.cloneDeep(formikProp.values.courseWeeklyDays);
12065
12064
  var newValues = courseWeeklyDays.filter(function (i) {
12066
12065
  var _i$startTime, _currentValue$startTi, _i$endTime, _currentValue$endTime;
12067
12066
  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"));
@@ -12097,7 +12096,7 @@ var ClassForm = function ClassForm(_ref) {
12097
12096
  var handleChangeWeeklyDayTime = function handleChangeWeeklyDayTime(key, newValue, currentValue) {
12098
12097
  var _extends2;
12099
12098
  var time = newValue === null || newValue === void 0 ? void 0 : newValue.local();
12100
- var courseWeeklyDays = _.cloneDeep(formikProp.values.courseWeeklyDays);
12099
+ var courseWeeklyDays = _$5.cloneDeep(formikProp.values.courseWeeklyDays);
12101
12100
  var currentIndex = courseWeeklyDays.findIndex(function (i) {
12102
12101
  var _i$startTime2, _currentValue$startTi2, _i$endTime2, _currentValue$endTime2;
12103
12102
  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"));
@@ -12132,11 +12131,11 @@ var ClassForm = function ClassForm(_ref) {
12132
12131
  }, [JSON.stringify(data)]);
12133
12132
  var minDate = useMemo(function () {
12134
12133
  if (!formikProp.values.startDate) return undefined;
12135
- return _.cloneDeep(formikProp.values.startDate).add(1, "days");
12134
+ return _$5.cloneDeep(formikProp.values.startDate).add(1, "days");
12136
12135
  }, [formikProp.values.startDate]);
12137
12136
  var maxDate = useMemo(function () {
12138
12137
  if (!formikProp.values.endDate) return undefined;
12139
- return _.cloneDeep(formikProp.values.endDate).add(1, "days");
12138
+ return _$5.cloneDeep(formikProp.values.endDate).add(1, "days");
12140
12139
  }, [formikProp.values.endDate]);
12141
12140
  var WeeklyDayErrors = formikProp.touched.courseWeeklyDays && formikProp.errors.courseWeeklyDays && React__default.createElement("div", {
12142
12141
  className: "mt-1"
@@ -12153,7 +12152,7 @@ var ClassForm = function ClassForm(_ref) {
12153
12152
  });
12154
12153
  }, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
12155
12154
  var courseWeeklyDays = useMemo(function () {
12156
- return _.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
12155
+ return _$5.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
12157
12156
  }, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
12158
12157
  return React__default.createElement("div", {
12159
12158
  className: "d-flex flex-column"
@@ -12304,7 +12303,7 @@ var ClassForm = function ClassForm(_ref) {
12304
12303
  value: v.startTime,
12305
12304
  format: "HH:mm",
12306
12305
  open: open === index + "-startTime",
12307
- maxTime: v.endTime ? _.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
12306
+ maxTime: v.endTime ? _$5.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
12308
12307
  onAccept: function onAccept(newValue) {
12309
12308
  return handleChangeWeeklyDayTime("startTime", newValue, v);
12310
12309
  },
@@ -12334,7 +12333,7 @@ var ClassForm = function ClassForm(_ref) {
12334
12333
  components: ["TimePicker"]
12335
12334
  }, React__default.createElement(TimePicker, {
12336
12335
  value: v.endTime,
12337
- minTime: v.startTime ? (_$cloneDeep = _.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
12336
+ minTime: v.startTime ? (_$cloneDeep = _$5.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
12338
12337
  format: "HH:mm",
12339
12338
  open: open === index + "-endTime",
12340
12339
  onAccept: function onAccept(newValue) {
@@ -12958,7 +12957,7 @@ var useStudentClassList = function useStudentClassList(courseId) {
12958
12957
  currentPage: 1
12959
12958
  }));
12960
12959
  };
12961
- var debounceSearch = _.debounce(function () {
12960
+ var debounceSearch = _$5.debounce(function () {
12962
12961
  setFilter(_extends({}, filter, {
12963
12962
  currentPage: 1
12964
12963
  }));
@@ -13094,7 +13093,7 @@ var useTeacherClassList = function useTeacherClassList(courseId) {
13094
13093
  currentPage: 1
13095
13094
  }));
13096
13095
  };
13097
- var debounceSearch = _.debounce(function () {
13096
+ var debounceSearch = _$5.debounce(function () {
13098
13097
  setFilter(_extends({}, filter, {
13099
13098
  currentPage: 1
13100
13099
  }));
@@ -13402,7 +13401,7 @@ var useClassDetail = function useClassDetail(_ref) {
13402
13401
  });
13403
13402
  }, [JSON.stringify(course)]);
13404
13403
  var convertToRequestBody = function convertToRequestBody(request) {
13405
- var localStartDate = _.cloneDeep(request.startDate);
13404
+ var localStartDate = _$5.cloneDeep(request.startDate);
13406
13405
  return _extends({}, request, {
13407
13406
  startDate: request.startDate.utc().format(DATE_TIME_FORMAT),
13408
13407
  endDate: request.endDate.utc().format(DATE_TIME_FORMAT),
@@ -13651,13 +13650,13 @@ var useClassDetail = function useClassDetail(_ref) {
13651
13650
  });
13652
13651
  if (event.target.checked) {
13653
13652
  setSelected(function (prev) {
13654
- return _.uniq([].concat(prev, newSelected));
13653
+ return _$5.uniq([].concat(prev, newSelected));
13655
13654
  });
13656
13655
  return;
13657
13656
  }
13658
- setSelected(_.difference(selected, newSelected));
13657
+ setSelected(_$5.difference(selected, newSelected));
13659
13658
  };
13660
- var debounceSearch = _.debounce(function () {
13659
+ var debounceSearch = _$5.debounce(function () {
13661
13660
  setFilter(_extends({}, filter, {
13662
13661
  currentPage: 1
13663
13662
  }));
@@ -13675,7 +13674,7 @@ var useClassDetail = function useClassDetail(_ref) {
13675
13674
  }) : userList.map(function (n) {
13676
13675
  return n.teacherId;
13677
13676
  });
13678
- var checkLength = _.intersection(selected, newSelected).length;
13677
+ var checkLength = _$5.intersection(selected, newSelected).length;
13679
13678
  return checkLength === userLength;
13680
13679
  };
13681
13680
  var handleClear = function handleClear() {
@@ -13710,7 +13709,7 @@ var useClassDetail = function useClassDetail(_ref) {
13710
13709
  }));
13711
13710
  setSelected([]);
13712
13711
  };
13713
- var debounceSort = _.debounce(handleSort, 300);
13712
+ var debounceSort = _$5.debounce(handleSort, 300);
13714
13713
  var handleChangePage = function handleChangePage(_, page) {
13715
13714
  setFilter(_extends({}, filter, {
13716
13715
  currentPage: page
@@ -13788,8 +13787,8 @@ var LessonFormBody = function LessonFormBody(_ref) {
13788
13787
  useEffect(function () {
13789
13788
  if (open && data) formikProp.setValues(data);else formikProp.setValues(DEFAULT_LESSON_REQUEST);
13790
13789
  }, [open, JSON.stringify(data)]);
13791
- var maxTime = formikProp.values.endTime ? _.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
13792
- var minTime = formikProp.values.startTime ? _.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
13790
+ var maxTime = formikProp.values.endTime ? _$5.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
13791
+ var minTime = formikProp.values.startTime ? _$5.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
13793
13792
  return React__default.createElement(Fragment$1, null, React__default.createElement(DialogContent, {
13794
13793
  sx: {
13795
13794
  overflowY: "unset"
@@ -14369,7 +14368,7 @@ var useClassList = function useClassList(history, classCreateUrl, classUpdateUrl
14369
14368
  currentPage: 1
14370
14369
  }));
14371
14370
  };
14372
- var debounceSearch = _.debounce(function () {
14371
+ var debounceSearch = _$5.debounce(function () {
14373
14372
  setClassFilter(_extends({}, classFilter, {
14374
14373
  currentPage: 1
14375
14374
  }));
@@ -19471,7 +19470,7 @@ var useNotes = function useNotes(setFilter, filter) {
19471
19470
  var items = (data === null || data === void 0 ? void 0 : data.items) || [];
19472
19471
  var newNotes = items;
19473
19472
  if (filter !== null && filter !== void 0 && filter.currentPage && (filter === null || filter === void 0 ? void 0 : filter.currentPage) > 1) {
19474
- newNotes = [].concat(_.uniqBy([].concat(notes, items), "id"));
19473
+ newNotes = [].concat(_$5.uniqBy([].concat(notes, items), "id"));
19475
19474
  }
19476
19475
  setNotes(newNotes);
19477
19476
  });
@@ -19494,7 +19493,7 @@ var useNotes = function useNotes(setFilter, filter) {
19494
19493
  });
19495
19494
  }, [filter === null || filter === void 0 ? void 0 : filter.currentPage, totalPages]);
19496
19495
  var handleNoteAdded = function handleNoteAdded(note) {
19497
- var newNotes = [].concat(_.uniqBy([note].concat(notes), "id"));
19496
+ var newNotes = [].concat(_$5.uniqBy([note].concat(notes), "id"));
19498
19497
  setNotes(newNotes);
19499
19498
  };
19500
19499
  var handleNoteUpdated = function handleNoteUpdated(note) {
@@ -19950,18 +19949,20 @@ var useExamResultData = function useExamResultData(props) {
19950
19949
  topAnswerOrder: i.topAnswerOrder == null ? 0 : i.topAnswerOrder
19951
19950
  });
19952
19951
  });
19953
- var mySeriesData = [null].concat(_.sortBy(questionsData.filter(function (i) {
19952
+ var sortedMySeriesQuestionData = _$5.sortBy(questionsData.filter(function (i) {
19954
19953
  return i.answerOrder !== 0;
19955
- }), ["answerOrder", "questionOrder"]).map(function (item) {
19954
+ }), ["answerOrder", "questionOrder"]);
19955
+ var mySeriesData = [null].concat(sortedMySeriesQuestionData.map(function (item) {
19956
19956
  return timelyOrderQuestion.questions.length - item.questionOrder;
19957
19957
  }), questionsData.filter(function (i) {
19958
19958
  return i.answerOrder === 0;
19959
19959
  }).map(function () {
19960
19960
  return null;
19961
19961
  }), [null]);
19962
- var topSeriesData = [null].concat(_.sortBy(questionsData.filter(function (i) {
19962
+ var sortedTopSeriesQuestionData = _$5.sortBy(questionsData.filter(function (i) {
19963
19963
  return i.topAnswerOrder !== 0;
19964
- }), ["topAnswerOrder", "questionOrder"]).map(function (item) {
19964
+ }), ["topAnswerOrder", "questionOrder"]);
19965
+ var topSeriesData = [null].concat(sortedTopSeriesQuestionData.map(function (item) {
19965
19966
  return timelyOrderQuestion.questions.length - item.questionOrder;
19966
19967
  }), questionsData.filter(function (i) {
19967
19968
  return i.topAnswerOrder === 0;
@@ -21646,7 +21647,8 @@ var UserDialog = function UserDialog(_ref) {
21646
21647
  setLoadingDefaultPassCode(true);
21647
21648
  var _temp3 = _catch(function () {
21648
21649
  return Promise.resolve(getUserDefaultPassCodeApi(parentPhoneNumber, phoneNumber, email, true)).then(function (res) {
21649
- setPassCode(res.data);
21650
+ var _res$data;
21651
+ setPassCode((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.toString());
21650
21652
  });
21651
21653
  }, function (error) {
21652
21654
  toast.error(getErrorMessage(t, error));
@@ -21702,6 +21704,9 @@ var UserDialog = function UserDialog(_ref) {
21702
21704
  setRoles([].concat((data === null || data === void 0 ? void 0 : data.roles) || [Role.Teacher]));
21703
21705
  }
21704
21706
  }, [open]);
21707
+ useEffect(function () {
21708
+ getDefaultPassCode();
21709
+ }, [getValues().parentPhoneNumber, getValues().phoneNumber]);
21705
21710
  var handleUseDefaultPassCode = function handleUseDefaultPassCode() {
21706
21711
  setUseDefaultPassCode(true);
21707
21712
  setPassCode(undefined);
@@ -21930,16 +21935,9 @@ var UserDialog = function UserDialog(_ref) {
21930
21935
  color: theme.palette.success.main,
21931
21936
  fontWeight: 600
21932
21937
  }
21933
- }, defaultPassCodeValue), React__default.createElement(Box, null, isLoadingDefaultPassCode ? React__default.createElement(CircularProgress, {
21938
+ }, defaultPassCodeValue), React__default.createElement(Box, null, isLoadingDefaultPassCode && React__default.createElement(CircularProgress, {
21934
21939
  size: "1rem"
21935
- }) : React__default.createElement(IconButton, {
21936
- className: "bg-success",
21937
- onClick: getDefaultPassCode,
21938
- disabled: disabled
21939
- }, React__default.createElement(FaRotateRight, {
21940
- color: "#FFF",
21941
- size: 10
21942
- }))))), React__default.createElement(FormControlLabel, {
21940
+ })))), React__default.createElement(FormControlLabel, {
21943
21941
  control: React__default.createElement(Radio, {
21944
21942
  checked: !useDefaultPassCode,
21945
21943
  onChange: function onChange() {
@@ -22217,7 +22215,7 @@ var useUserList = function useUserList(role) {
22217
22215
  currentPage: 1
22218
22216
  }));
22219
22217
  };
22220
- var debounceSort = _.debounce(handleSort, 300);
22218
+ var debounceSort = _$5.debounce(handleSort, 300);
22221
22219
  var getUserById = function getUserById(id) {
22222
22220
  try {
22223
22221
  var _temp8 = function _temp8() {
@@ -22375,7 +22373,7 @@ var useUserList = function useUserList(role) {
22375
22373
  return Promise.reject(e);
22376
22374
  }
22377
22375
  };
22378
- var debounceSearch = _.debounce(function () {
22376
+ var debounceSearch = _$5.debounce(function () {
22379
22377
  setFilter(_extends({}, filter, {
22380
22378
  currentPage: 1
22381
22379
  }));
@@ -22928,10 +22926,15 @@ var QuestionView = function QuestionView(_ref2) {
22928
22926
  }, React__default.createElement(Stack, null, React__default.createElement(FormGroup, null, React__default.createElement(FormLabel, {
22929
22927
  htmlFor: "textual_answer",
22930
22928
  className: styles$6["question-label"] + " form-label"
22931
- }, t("textual_answer")), React__default.createElement(MathTinyEditor, {
22929
+ }, t("textual_answer")), React__default.createElement(TextField, {
22930
+ sx: {
22931
+ "& .MuiInputBase-input": {
22932
+ p: "12px 14px"
22933
+ }
22934
+ },
22932
22935
  value: (question === null || question === void 0 ? void 0 : question.textualAnswer) || "",
22933
- onChange: function onChange(newValue) {
22934
- return onChangeTextualAnswer(newValue, index);
22936
+ onChange: function onChange(e) {
22937
+ return onChangeTextualAnswer(e.target.value, index);
22935
22938
  }
22936
22939
  })))));
22937
22940
  case QuestionAnswerType.MultipleChoice:
@@ -23626,8 +23629,8 @@ var useExamDetailView = function useExamDetailView(props) {
23626
23629
  var handleAddArticle = function handleAddArticle() {
23627
23630
  var _$maxBy, _$maxBy2;
23628
23631
  if (!exam) return;
23629
- var maxArticle = ((_$maxBy = _.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
23630
- var maxOrder = ((_$maxBy2 = _.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
23632
+ var maxArticle = ((_$maxBy = _$5.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
23633
+ var maxOrder = ((_$maxBy2 = _$5.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
23631
23634
  onChangeExam(_extends({}, exam, {
23632
23635
  questions: [].concat(exam.questions, [{
23633
23636
  questionAnswerType: QuestionAnswerType.SingleChoice,
@@ -23678,7 +23681,7 @@ var useExamDetailView = function useExamDetailView(props) {
23678
23681
  var examGroupByArticle = useMemo(function () {
23679
23682
  if (!exam) return [];
23680
23683
  var articles = [];
23681
- var groupedArticle = _.groupBy(exam.questions, "article");
23684
+ var groupedArticle = _$5.groupBy(exam.questions, "article");
23682
23685
  for (var key in groupedArticle) {
23683
23686
  if (Object.prototype.hasOwnProperty.call(groupedArticle, key)) {
23684
23687
  var _questions$find, _$maxBy3;
@@ -23688,13 +23691,13 @@ var useExamDetailView = function useExamDetailView(props) {
23688
23691
  categoryId: (_questions$find = questions.find(function (i) {
23689
23692
  return !!i.categoryId;
23690
23693
  })) === null || _questions$find === void 0 ? void 0 : _questions$find.categoryId,
23691
- answerCount: ((_$maxBy3 = _.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
23694
+ answerCount: ((_$maxBy3 = _$5.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
23692
23695
  questionCount: questions.length,
23693
23696
  questions: questions
23694
23697
  });
23695
23698
  }
23696
23699
  }
23697
- return _.sortBy(articles, "article");
23700
+ return _$5.sortBy(articles, "article");
23698
23701
  }, [JSON.stringify(exam)]);
23699
23702
  var durationOptions = useMemo(function () {
23700
23703
  var options = DURATION_OPTIONS.map(function (i) {
@@ -26108,11 +26111,11 @@ var useTextbookShare = function useTextbookShare(props) {
26108
26111
  });
26109
26112
  if (event.target.checked) {
26110
26113
  setSelectedShare(function (prev) {
26111
- return _.uniq([].concat(prev, newSelected));
26114
+ return _$5.uniq([].concat(prev, newSelected));
26112
26115
  });
26113
26116
  return;
26114
26117
  }
26115
- setSelectedShare(_.difference(selectedShare, newSelected));
26118
+ setSelectedShare(_$5.difference(selectedShare, newSelected));
26116
26119
  };
26117
26120
  var isCheckAllShare = function isCheckAllShare(userLength) {
26118
26121
  var newSelected = isUpdate ? shared.map(function (n) {
@@ -26120,7 +26123,7 @@ var useTextbookShare = function useTextbookShare(props) {
26120
26123
  }) : notShared.map(function (n) {
26121
26124
  return n.id;
26122
26125
  });
26123
- var checkLength = _.intersection(selectedShare, newSelected).length;
26126
+ var checkLength = _$5.intersection(selectedShare, newSelected).length;
26124
26127
  return checkLength === userLength;
26125
26128
  };
26126
26129
  var handleClickCheckboxShare = function handleClickCheckboxShare(id) {
@@ -26914,7 +26917,7 @@ var useNotificationList = function useNotificationList(_ref) {
26914
26917
  currentPage: 1
26915
26918
  }));
26916
26919
  };
26917
- var debounceSearch = _.debounce(function () {
26920
+ var debounceSearch = _$5.debounce(function () {
26918
26921
  setNotificationFilter(_extends({}, notificationFilter, {
26919
26922
  currentPage: 1
26920
26923
  }));
@@ -28245,6 +28248,7 @@ var isEqual$1 = function isEqual(prev, next) {
28245
28248
  var QuestionBlock$1 = memo(QuestionBlock, isEqual$1);
28246
28249
 
28247
28250
  var _excluded$f = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
28251
+ var _ = _$5;
28248
28252
  var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
28249
28253
  var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate;
28250
28254
  var data = _ref.data,
@@ -28366,6 +28370,7 @@ var isEqual$2 = function isEqual(prev, next) {
28366
28370
  var QuestionGroupBlockBody$1 = memo(QuestionGroupBlockBody, isEqual$2);
28367
28371
 
28368
28372
  var _excluded$g = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "isDisabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
28373
+ var _$1 = _$5;
28369
28374
  var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
28370
28375
  var _data$articles$2, _data$articles$2$cate, _data$articles$2$cate2, _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2;
28371
28376
  var expandedIndex = _ref.expandedIndex,
@@ -28472,7 +28477,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
28472
28477
  }).join(",") : ""].filter(function (i) {
28473
28478
  return !!i;
28474
28479
  }).join(" / ");
28475
- var blockErrors = _.get(errors, path);
28480
+ var blockErrors = _$1.get(errors, path);
28476
28481
  return React__default.createElement(Accordion, {
28477
28482
  expanded: open,
28478
28483
  onChange: handleToggle,
@@ -28869,6 +28874,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
28869
28874
  };
28870
28875
 
28871
28876
  var _excluded$i = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
28877
+ var _$2 = _$5;
28872
28878
  var ChapterBlock = function ChapterBlock(_ref) {
28873
28879
  var data = _ref.data,
28874
28880
  expandedIndex = _ref.expandedIndex,
@@ -28906,10 +28912,10 @@ var ChapterBlock = function ChapterBlock(_ref) {
28906
28912
  chapter: title
28907
28913
  }), title, path.replace(/\[(\d+)\]$/, ""), expandedIndex);
28908
28914
  };
28909
- var pageNameError = _.get(errors, path + ".name");
28910
- var pageFromError = _.get(errors, path + ".pageFrom");
28911
- var pageToError = _.get(errors, path + ".pageTo");
28912
- var blockErrors = _.get(errors, path);
28915
+ var pageNameError = _$2.get(errors, path + ".name");
28916
+ var pageFromError = _$2.get(errors, path + ".pageFrom");
28917
+ var pageToError = _$2.get(errors, path + ".pageTo");
28918
+ var blockErrors = _$2.get(errors, path);
28913
28919
  return React__default.createElement(Accordion, {
28914
28920
  expanded: open,
28915
28921
  onChange: handleToggle,
@@ -29238,7 +29244,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
29238
29244
  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;
29239
29245
  });
29240
29246
  var getOptionFilter = function getOptionFilter() {
29241
- var cloneFilter = _.clone(filter);
29247
+ var cloneFilter = _$5.clone(filter);
29242
29248
  for (var key in cloneFilter) {
29243
29249
  if (Object.prototype.hasOwnProperty.call(cloneFilter, key)) {
29244
29250
  var element = cloneFilter[key];
@@ -29386,6 +29392,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
29386
29392
  };
29387
29393
  };
29388
29394
 
29395
+ var _$3 = _$5;
29389
29396
  var TextbookContentsTab = function TextbookContentsTab(props) {
29390
29397
  var values = props.values,
29391
29398
  setFieldValue = props.setFieldValue;
@@ -29427,7 +29434,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
29427
29434
  };
29428
29435
  var handleConfirmDeleteBlock = function handleConfirmDeleteBlock() {
29429
29436
  if (!(openConfirmDelete !== null && openConfirmDelete !== void 0 && openConfirmDelete.path)) return;
29430
- var items = _.get(values, openConfirmDelete.path, []);
29437
+ var items = _$3.get(values, openConfirmDelete.path, []);
29431
29438
  setFieldValue(openConfirmDelete.path, items.filter(function (_, i) {
29432
29439
  return i !== openConfirmDelete.itemIndex;
29433
29440
  }));
@@ -29467,12 +29474,12 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
29467
29474
  if (!newParts.length) return;
29468
29475
  if (newParts.length < parts.length) {
29469
29476
  var _$get, _$get2, _$get3;
29470
- var subChapters = (_$get = _.get(values, newPath + ".subChapters")) != null ? _$get : [];
29477
+ var subChapters = (_$get = _$3.get(values, newPath + ".subChapters")) != null ? _$get : [];
29471
29478
  var questionGroups = [];
29472
- if (!subChapters.length) questionGroups = (_$get2 = _.get(values, newPath + ".questionGroups")) != null ? _$get2 : [];else questionGroups = (_$get3 = _.get(values, newPath + ".subChapters[" + (subChapters.length - 1) + "].questionGroups")) != null ? _$get3 : [];
29473
- return _.last(questionGroups);
29479
+ 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 : [];
29480
+ return _$3.last(questionGroups);
29474
29481
  }
29475
- return _.get(values, newPath);
29482
+ return _$3.get(values, newPath);
29476
29483
  };
29477
29484
  var handleOpenSubCategoryMenu = useCallback(function (key, categoryId) {
29478
29485
  setOptionKey(key);
@@ -29901,7 +29908,7 @@ var useSelect = function useSelect(_ref) {
29901
29908
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
29902
29909
  });
29903
29910
  var isSuperAdmin = !!user && !user.academyDomain;
29904
- var loadData = _.debounce(function (e) {
29911
+ var loadData = _$5.debounce(function (e) {
29905
29912
  try {
29906
29913
  var _temp2 = function _temp2() {
29907
29914
  setLoading(false);
@@ -30042,6 +30049,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
30042
30049
  }, errors === null || errors === void 0 ? void 0 : errors.textbookOwners[index].courseId)));
30043
30050
  };
30044
30051
 
30052
+ var _$4 = _$5;
30045
30053
  var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30046
30054
  var errors = _ref.errors,
30047
30055
  values = _ref.values,
@@ -30062,7 +30070,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30062
30070
  container: true,
30063
30071
  spacing: "16px"
30064
30072
  }, textbookOwners === null || textbookOwners === void 0 ? void 0 : textbookOwners.map(function (_val, index) {
30065
- var _values$textbookOwner, _values$textbookOwner2, _values$textbookOwner3, _values$textbookOwner4, _values$textbookOwner5;
30073
+ var _values$textbookOwner, _values$textbookOwner2, _values$textbookOwner3;
30066
30074
  return React__default.createElement(Grid, {
30067
30075
  item: true,
30068
30076
  xs: 6,
@@ -30104,17 +30112,17 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30104
30112
  fullWidth: true
30105
30113
  }, field));
30106
30114
  }
30107
- }), _.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(Typography, {
30115
+ }), _$4.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(Typography, {
30108
30116
  fontWeight: 500,
30109
30117
  fontSize: "10px",
30110
30118
  lineHeight: "11.93px",
30111
- color: _.get(errors, "textbookOwners[" + index + "].email") ? "#97A1AF" : "#F34B4B"
30112
- }, _.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, {
30119
+ color: _$4.get(errors, "textbookOwners[" + index + "].email") ? "#97A1AF" : "#F34B4B"
30120
+ }, _$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, {
30121
+ values: values,
30113
30122
  errors: errors,
30114
30123
  index: index,
30115
30124
  onChangeFieldValue: setFieldValue,
30116
- 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,
30117
- 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
30125
+ 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
30118
30126
  })));
30119
30127
  }), React__default.createElement(Grid, {
30120
30128
  item: true,
@@ -30143,7 +30151,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
30143
30151
  };
30144
30152
 
30145
30153
  var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
30146
- var values = isMath !== undefined ? _.cloneDeep(textbook) : textbook;
30154
+ var values = isMath !== undefined ? _$5.cloneDeep(textbook) : textbook;
30147
30155
  if (isMath !== undefined) values.type = isMath;
30148
30156
  for (var key in values) {
30149
30157
  if (values.hasOwnProperty(key)) {
@@ -30158,7 +30166,7 @@ var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
30158
30166
  return values;
30159
30167
  };
30160
30168
  var _resetAllCrategoriesAndQuestionTypesBySubject = function resetAllCrategoriesAndQuestionTypesBySubject(textbook, subject) {
30161
- var values = subject ? _.cloneDeep(textbook) : textbook;
30169
+ var values = subject ? _$5.cloneDeep(textbook) : textbook;
30162
30170
  if (subject) {
30163
30171
  values.subjectId = subject === null || subject === void 0 ? void 0 : subject.value;
30164
30172
  values.subject = subject;
@@ -30403,7 +30411,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
30403
30411
  },
30404
30412
  variant: "contained",
30405
30413
  onClick: function onClick() {
30406
- if (!_.isEmpty(errors)) {
30414
+ if (!_$5.isEmpty(errors)) {
30407
30415
  toast.error(t$1("please_fill_in_the_blank_fields"));
30408
30416
  }
30409
30417
  },
@@ -31151,7 +31159,7 @@ var usePreparedExam = function usePreparedExam(_ref) {
31151
31159
  return Promise.reject(e);
31152
31160
  }
31153
31161
  };
31154
- var debounceSearch = _.debounce(function () {
31162
+ var debounceSearch = _$5.debounce(function () {
31155
31163
  setTextbookFilter(_extends({}, textbookFilter, {
31156
31164
  currentPage: 1
31157
31165
  }));
@@ -32856,7 +32864,7 @@ var PreparedItem = function PreparedItem(_ref) {
32856
32864
  });
32857
32865
  return React__default.createElement(Form, {
32858
32866
  style: {
32859
- height: !_.isEmpty(values) && !textbookList.length ? "100%" : "unset"
32867
+ height: !_$5.isEmpty(values) && !textbookList.length ? "100%" : "unset"
32860
32868
  }
32861
32869
  }, React__default.createElement(Stack, null, React__default.createElement(Accordion, {
32862
32870
  sx: {
@@ -33262,7 +33270,7 @@ var PreparedItem = function PreparedItem(_ref) {
33262
33270
  open: openConfirmDialog,
33263
33271
  onClose: handleCloseConfirmDialog,
33264
33272
  onSubmit: handleResetFilter
33265
- }), !_.isEmpty(values) && !textbookList.length && React__default.createElement(Stack, {
33273
+ }), !_$5.isEmpty(values) && !textbookList.length && React__default.createElement(Stack, {
33266
33274
  height: 1,
33267
33275
  justifyContent: "center",
33268
33276
  alignItems: "center"
@@ -34059,7 +34067,9 @@ var Header = function Header(_ref) {
34059
34067
  headerTabs = _ref.headerTabs,
34060
34068
  role = _ref.role,
34061
34069
  history = _ref.history,
34070
+ link = _ref.link,
34062
34071
  onSignOut = _ref.onSignOut;
34072
+ var Link = link;
34063
34073
  var _useTranslation = useTranslation(),
34064
34074
  t = _useTranslation.t;
34065
34075
  var theme = useTheme();