touchstudy-core 0.1.174 → 0.1.176
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/containers/Classes/configs/types.d.ts +2 -2
- package/dist/index.css +13 -0
- package/dist/index.js +606 -57
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +608 -59
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/Header.d.ts +1 -1
- package/dist/layouts/TimerCountItem.d.ts +9 -0
- package/dist/layouts/TimerItem.d.ts +11 -0
- package/dist/services/subjectService.d.ts +4 -0
- package/dist/theme/palette.d.ts +1 -0
- package/dist/utils/enums/index.d.ts +1 -0
- package/dist/utils/enums/subject.d.ts +5 -0
- package/dist/utils/functions/times.d.ts +1 -0
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/subjects.d.ts +17 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -537,6 +537,7 @@ var teacher_in_charge = "담당 교사";
|
|
537
537
|
var counselor = "상담교사";
|
538
538
|
var new_question = "새로운 질문";
|
539
539
|
var hour = "시간";
|
540
|
+
var hour_h = "시간";
|
540
541
|
var minute = "분";
|
541
542
|
var second = "두번째";
|
542
543
|
var question_order = "{{number}} 번";
|
@@ -1111,6 +1112,7 @@ var academy_invite_detail = "아카데미 초대 세부정보";
|
|
1111
1112
|
var are_you_sure_to_delete_academy_invite = "이 아카데미 초대를 삭제하시겠습니까?";
|
1112
1113
|
var day = "낮";
|
1113
1114
|
var days = "날";
|
1115
|
+
var month = "월";
|
1114
1116
|
var emails = "이메일";
|
1115
1117
|
var is_accepted = "승인됨";
|
1116
1118
|
var re_send = "다시 보내기";
|
@@ -1543,6 +1545,12 @@ var teacher_to_teachers = "교사에서 교사들에게";
|
|
1543
1545
|
var student_required = "학생은 필수입니다";
|
1544
1546
|
var teachers_required = "교사가 필요합니다";
|
1545
1547
|
var all_changes_are_not_saved_yet = "아직 모든 변경 사항이 저장되지 않았습니다";
|
1548
|
+
var pause = "일시정지";
|
1549
|
+
var press_to_start = "눌러서 시작하기";
|
1550
|
+
var study_timer = "순공 타이머";
|
1551
|
+
var show_timer = "타이머 표시";
|
1552
|
+
var failed_to_pause_the_subject_name = "과목 '{{name}}'를 일시 중지하는 데 실패했습니다";
|
1553
|
+
var failed_to_start_the_subject_name = "과목 '{{name}}'를 시작하는 데 실패했습니다";
|
1546
1554
|
var lang_ko = {
|
1547
1555
|
problem_solving: problem_solving,
|
1548
1556
|
my_story: my_story,
|
@@ -1734,6 +1742,7 @@ var lang_ko = {
|
|
1734
1742
|
counselor: counselor,
|
1735
1743
|
new_question: new_question,
|
1736
1744
|
hour: hour,
|
1745
|
+
hour_h: hour_h,
|
1737
1746
|
minute: minute,
|
1738
1747
|
second: second,
|
1739
1748
|
question_order: question_order,
|
@@ -2300,6 +2309,7 @@ var lang_ko = {
|
|
2300
2309
|
are_you_sure_to_delete_academy_invite: are_you_sure_to_delete_academy_invite,
|
2301
2310
|
day: day,
|
2302
2311
|
days: days,
|
2312
|
+
month: month,
|
2303
2313
|
emails: emails,
|
2304
2314
|
is_accepted: is_accepted,
|
2305
2315
|
re_send: re_send,
|
@@ -2719,7 +2729,13 @@ var lang_ko = {
|
|
2719
2729
|
teacher_to_teachers: teacher_to_teachers,
|
2720
2730
|
student_required: student_required,
|
2721
2731
|
teachers_required: teachers_required,
|
2722
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet
|
2732
|
+
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet,
|
2733
|
+
pause: pause,
|
2734
|
+
press_to_start: press_to_start,
|
2735
|
+
study_timer: study_timer,
|
2736
|
+
show_timer: show_timer,
|
2737
|
+
failed_to_pause_the_subject_name: failed_to_pause_the_subject_name,
|
2738
|
+
failed_to_start_the_subject_name: failed_to_start_the_subject_name
|
2723
2739
|
};
|
2724
2740
|
|
2725
2741
|
var problem_solving$1 = "Problem Solving";
|
@@ -2938,6 +2954,7 @@ var counselor$1 = "Counselor";
|
|
2938
2954
|
var new_question$1 = "New Question";
|
2939
2955
|
var hour$1 = "hr";
|
2940
2956
|
var hours = "hrs";
|
2957
|
+
var hour_h$1 = "h";
|
2941
2958
|
var minute$1 = "min";
|
2942
2959
|
var second$1 = "second";
|
2943
2960
|
var question_order$1 = "Number {{number}}";
|
@@ -3487,6 +3504,7 @@ var academy_invite_detail$1 = "Academy Invite Detail";
|
|
3487
3504
|
var are_you_sure_to_delete_academy_invite$1 = "Are you sure to delete this academy invite?";
|
3488
3505
|
var day$1 = "day";
|
3489
3506
|
var days$1 = "days";
|
3507
|
+
var month$1 = "month";
|
3490
3508
|
var emails$1 = "Emails";
|
3491
3509
|
var is_accepted$1 = "Is Accepted";
|
3492
3510
|
var re_send$1 = "Resend";
|
@@ -3920,6 +3938,12 @@ var teacher_to_teachers$1 = "Teacher to teachers";
|
|
3920
3938
|
var student_required$1 = "Student is required";
|
3921
3939
|
var teachers_required$1 = "Teachers are required";
|
3922
3940
|
var all_changes_are_not_saved_yet$1 = "All changes are not saved yet";
|
3941
|
+
var pause$1 = "Pause";
|
3942
|
+
var press_to_start$1 = "Press to start";
|
3943
|
+
var study_timer$1 = "Focused Study Timer";
|
3944
|
+
var show_timer$1 = "Show timer";
|
3945
|
+
var failed_to_pause_the_subject_name$1 = "Failed to pause the subject '{{name}}'";
|
3946
|
+
var failed_to_start_the_subject_name$1 = "Failed to start the subject '{{name}}'";
|
3923
3947
|
var lang_en = {
|
3924
3948
|
problem_solving: problem_solving$1,
|
3925
3949
|
my_story: my_story$1,
|
@@ -4137,6 +4161,7 @@ var lang_en = {
|
|
4137
4161
|
new_question: new_question$1,
|
4138
4162
|
hour: hour$1,
|
4139
4163
|
hours: hours,
|
4164
|
+
hour_h: hour_h$1,
|
4140
4165
|
minute: minute$1,
|
4141
4166
|
second: second$1,
|
4142
4167
|
question_order: question_order$1,
|
@@ -4678,6 +4703,7 @@ var lang_en = {
|
|
4678
4703
|
are_you_sure_to_delete_academy_invite: are_you_sure_to_delete_academy_invite$1,
|
4679
4704
|
day: day$1,
|
4680
4705
|
days: days$1,
|
4706
|
+
month: month$1,
|
4681
4707
|
emails: emails$1,
|
4682
4708
|
is_accepted: is_accepted$1,
|
4683
4709
|
re_send: re_send$1,
|
@@ -5098,7 +5124,13 @@ var lang_en = {
|
|
5098
5124
|
teacher_to_teachers: teacher_to_teachers$1,
|
5099
5125
|
student_required: student_required$1,
|
5100
5126
|
teachers_required: teachers_required$1,
|
5101
|
-
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet$1
|
5127
|
+
all_changes_are_not_saved_yet: all_changes_are_not_saved_yet$1,
|
5128
|
+
pause: pause$1,
|
5129
|
+
press_to_start: press_to_start$1,
|
5130
|
+
study_timer: study_timer$1,
|
5131
|
+
show_timer: show_timer$1,
|
5132
|
+
failed_to_pause_the_subject_name: failed_to_pause_the_subject_name$1,
|
5133
|
+
failed_to_start_the_subject_name: failed_to_start_the_subject_name$1
|
5102
5134
|
};
|
5103
5135
|
|
5104
5136
|
i18n__default.use(reactI18next.initReactI18next).init({
|
@@ -5554,7 +5586,7 @@ var PrintExamView2 = function PrintExamView2(_ref) {
|
|
5554
5586
|
}, t("print_pdf"))));
|
5555
5587
|
};
|
5556
5588
|
|
5557
|
-
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"};
|
5589
|
+
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky","timer-menu":"_3bvVg","timer-menu-item":"_z624V","subject-name":"_2KJX4","duration":"_1mwlk","icon-start":"_maff_"};
|
5558
5590
|
|
5559
5591
|
var config = {
|
5560
5592
|
loader: {
|
@@ -6129,6 +6161,7 @@ var CustomSelect = function CustomSelect(_ref) {
|
|
6129
6161
|
Option: CustomOption
|
6130
6162
|
},
|
6131
6163
|
styles: _extends({}, customStyles, styles),
|
6164
|
+
isMulti: isMulti,
|
6132
6165
|
placeholder: t("select_placeholder")
|
6133
6166
|
}, rest));
|
6134
6167
|
};
|
@@ -6307,6 +6340,12 @@ var PrintStatus;
|
|
6307
6340
|
SchoolType[SchoolType["High"] = 3] = "High";
|
6308
6341
|
})(exports.SchoolType || (exports.SchoolType = {}));
|
6309
6342
|
|
6343
|
+
(function (SubjectTimerStatus) {
|
6344
|
+
SubjectTimerStatus[SubjectTimerStatus["NotStarted"] = 0] = "NotStarted";
|
6345
|
+
SubjectTimerStatus[SubjectTimerStatus["Started"] = 1] = "Started";
|
6346
|
+
SubjectTimerStatus[SubjectTimerStatus["Paused"] = 2] = "Paused";
|
6347
|
+
})(exports.SubjectTimerStatus || (exports.SubjectTimerStatus = {}));
|
6348
|
+
|
6310
6349
|
var canAccess = function canAccess(userRoles, componentRoles) {
|
6311
6350
|
if (!Array.isArray(userRoles)) {
|
6312
6351
|
return false;
|
@@ -6556,6 +6595,11 @@ var getRemainTime = function getRemainTime(startTime, duration) {
|
|
6556
6595
|
if (timePass > durationInNumber) return 0;
|
6557
6596
|
return durationInNumber - timePass;
|
6558
6597
|
};
|
6598
|
+
var getCountTime = function getCountTime(startTime, duration) {
|
6599
|
+
var timePass = diffFromNow(startTime, "second");
|
6600
|
+
if (typeof timePass !== "number") return null;
|
6601
|
+
return duration + timePass;
|
6602
|
+
};
|
6559
6603
|
|
6560
6604
|
var formatDateTime = function formatDateTime(inputDate) {
|
6561
6605
|
var date = new Date(inputDate);
|
@@ -8280,6 +8324,27 @@ var getSubjectListApi = function getSubjectListApi(textSearch) {
|
|
8280
8324
|
return Promise.reject(e);
|
8281
8325
|
}
|
8282
8326
|
};
|
8327
|
+
var getStudentSubjectListApi = function getStudentSubjectListApi() {
|
8328
|
+
try {
|
8329
|
+
return Promise.resolve(api.get(SUBJECT_URL + "/timers"));
|
8330
|
+
} catch (e) {
|
8331
|
+
return Promise.reject(e);
|
8332
|
+
}
|
8333
|
+
};
|
8334
|
+
var startStudentSubjectTimerApi = function startStudentSubjectTimerApi(subjectId) {
|
8335
|
+
try {
|
8336
|
+
return Promise.resolve(api.post(SUBJECT_URL + "/" + subjectId + "/timers"));
|
8337
|
+
} catch (e) {
|
8338
|
+
return Promise.reject(e);
|
8339
|
+
}
|
8340
|
+
};
|
8341
|
+
var pauseStudentSubjectApi = function pauseStudentSubjectApi(subjectId, recordId, data) {
|
8342
|
+
try {
|
8343
|
+
return Promise.resolve(api.post(SUBJECT_URL + "/" + subjectId + "/timers/" + recordId, data));
|
8344
|
+
} catch (e) {
|
8345
|
+
return Promise.reject(e);
|
8346
|
+
}
|
8347
|
+
};
|
8283
8348
|
|
8284
8349
|
var SubjectSelector = function SubjectSelector(_ref) {
|
8285
8350
|
var value = _ref.value,
|
@@ -10349,6 +10414,7 @@ var grey = {
|
|
10349
10414
|
var green = {
|
10350
10415
|
0: '#FFFFFF',
|
10351
10416
|
100: '#F0FFF6',
|
10417
|
+
200: '#D2FFE4',
|
10352
10418
|
300: '#89F0B2',
|
10353
10419
|
500: '#3DC674',
|
10354
10420
|
700: '#349056',
|
@@ -13017,8 +13083,8 @@ var DayOfWeek;
|
|
13017
13083
|
})(DayOfWeek || (DayOfWeek = {}));
|
13018
13084
|
var TeacherSortBy;
|
13019
13085
|
(function (TeacherSortBy) {
|
13020
|
-
TeacherSortBy["Name"] = "UserProfile.FullName";
|
13021
|
-
TeacherSortBy["Email"] = "UserProfile.Email";
|
13086
|
+
TeacherSortBy["Name"] = "User.UserProfile.FullName";
|
13087
|
+
TeacherSortBy["Email"] = "User.UserProfile.Email";
|
13022
13088
|
})(TeacherSortBy || (TeacherSortBy = {}));
|
13023
13089
|
var ClassStatus;
|
13024
13090
|
(function (ClassStatus) {
|
@@ -13296,23 +13362,29 @@ var DEFAULT_USER_FILTERS = {
|
|
13296
13362
|
|
13297
13363
|
var styles$3 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
13298
13364
|
|
13299
|
-
var _excluded$7 = ["teachers", "value"];
|
13300
13365
|
var TeacherSelector = function TeacherSelector(_ref) {
|
13301
13366
|
var teachers = _ref.teachers,
|
13302
|
-
value = _ref.value
|
13303
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
13367
|
+
value = _ref.value;
|
13304
13368
|
var teacherOptions = teachers.map(function (i) {
|
13305
13369
|
return {
|
13306
13370
|
label: i.teacherName + "/" + i.teacherEmail,
|
13307
13371
|
value: i.id
|
13308
13372
|
};
|
13309
13373
|
});
|
13310
|
-
return React__default.createElement(CustomAsyncSelect,
|
13374
|
+
return React__default.createElement(CustomAsyncSelect, {
|
13311
13375
|
options: teacherOptions,
|
13312
|
-
value: value
|
13313
|
-
|
13376
|
+
value: value,
|
13377
|
+
menuPlacement: "bottom",
|
13378
|
+
styles: {
|
13379
|
+
menuPortal: function menuPortal(base) {
|
13380
|
+
return _extends({}, base, {
|
13381
|
+
zIndex: 9999
|
13382
|
+
});
|
13383
|
+
}
|
13384
|
+
},
|
13385
|
+
menuPortalTarget: document.body,
|
13314
13386
|
isClearable: true
|
13315
|
-
})
|
13387
|
+
});
|
13316
13388
|
};
|
13317
13389
|
|
13318
13390
|
var ErrorHandler = function ErrorHandler(_ref) {
|
@@ -20280,12 +20352,12 @@ function CreateNewQuestionDialog(_ref) {
|
|
20280
20352
|
});
|
20281
20353
|
}
|
20282
20354
|
|
20283
|
-
var _excluded$
|
20355
|
+
var _excluded$7 = ["children", "value", "index"];
|
20284
20356
|
var CustomTabPanel = function CustomTabPanel(props) {
|
20285
20357
|
var children = props.children,
|
20286
20358
|
value = props.value,
|
20287
20359
|
index = props.index,
|
20288
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
20360
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$7);
|
20289
20361
|
return React__default.createElement("div", Object.assign({
|
20290
20362
|
role: "tabpanel",
|
20291
20363
|
hidden: value !== index,
|
@@ -24342,7 +24414,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
24342
24414
|
}, t("cancel"))))));
|
24343
24415
|
};
|
24344
24416
|
|
24345
|
-
var _excluded$
|
24417
|
+
var _excluded$8 = ["onChange"];
|
24346
24418
|
var StartPageDialog = function StartPageDialog(_ref) {
|
24347
24419
|
var t = _ref.t,
|
24348
24420
|
onClose = _ref.onClose,
|
@@ -24408,7 +24480,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
24408
24480
|
}, t("page_to_start_with")), React__default.createElement(formik.Field, {
|
24409
24481
|
name: "startPage",
|
24410
24482
|
render: function render(_ref3) {
|
24411
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
24483
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$8);
|
24412
24484
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
24413
24485
|
maxMenuHeight: 150,
|
24414
24486
|
menuPosition: "fixed",
|
@@ -26040,10 +26112,10 @@ var DrawerTextbookResultTab = function DrawerTextbookResultTab(_ref) {
|
|
26040
26112
|
};
|
26041
26113
|
|
26042
26114
|
var _styled$1;
|
26043
|
-
var _excluded$
|
26115
|
+
var _excluded$9 = ["className"];
|
26044
26116
|
var CustomTooltip$1 = material.styled(function (_ref) {
|
26045
26117
|
var className = _ref.className,
|
26046
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26118
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
|
26047
26119
|
return React__default.createElement(material.Tooltip, Object.assign({}, props, {
|
26048
26120
|
classes: {
|
26049
26121
|
popper: className
|
@@ -27524,7 +27596,7 @@ var useTeacherList = function useTeacherList() {
|
|
27524
27596
|
};
|
27525
27597
|
};
|
27526
27598
|
|
27527
|
-
var _excluded$
|
27599
|
+
var _excluded$a = ["getStudents"],
|
27528
27600
|
_excluded2 = ["getTeachers"],
|
27529
27601
|
_excluded3 = ["getLessons"];
|
27530
27602
|
var PAGE_TITLE$4 = "classes";
|
@@ -27575,7 +27647,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
27575
27647
|
};
|
27576
27648
|
var _useStudentClassList = useStudentClassList(classId),
|
27577
27649
|
getStudents = _useStudentClassList.getStudents,
|
27578
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
27650
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$a);
|
27579
27651
|
var _useTeacherClassList = useTeacherClassList(classId),
|
27580
27652
|
getTeachers = _useTeacherClassList.getTeachers,
|
27581
27653
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -28963,14 +29035,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
28963
29035
|
|
28964
29036
|
var styles$8 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
28965
29037
|
|
28966
|
-
var _excluded$
|
29038
|
+
var _excluded$b = ["text", "isRequired", "className"];
|
28967
29039
|
var LabelRequired = function LabelRequired(_ref) {
|
28968
29040
|
var text = _ref.text,
|
28969
29041
|
_ref$isRequired = _ref.isRequired,
|
28970
29042
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
28971
29043
|
_ref$className = _ref.className,
|
28972
29044
|
className = _ref$className === void 0 ? "" : _ref$className,
|
28973
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
29045
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
28974
29046
|
return React__default.createElement(material.FormLabel, Object.assign({
|
28975
29047
|
className: "fw-medium mb-1 " + className
|
28976
29048
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -29024,7 +29096,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
29024
29096
|
return api["delete"](USER_URL$1 + "/delete/" + id);
|
29025
29097
|
};
|
29026
29098
|
|
29027
|
-
var _excluded$
|
29099
|
+
var _excluded$c = ["ref"],
|
29028
29100
|
_excluded2$1 = ["ref"],
|
29029
29101
|
_excluded3$1 = ["ref"],
|
29030
29102
|
_excluded4 = ["ref"],
|
@@ -29054,7 +29126,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
29054
29126
|
t = _useTranslation.t;
|
29055
29127
|
var _register = register("fullName"),
|
29056
29128
|
fullNameRef = _register.ref,
|
29057
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
29129
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$c);
|
29058
29130
|
var _register2 = register("email"),
|
29059
29131
|
emailRef = _register2.ref,
|
29060
29132
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -33125,12 +33197,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
33125
33197
|
|
33126
33198
|
var styles$a = {"drawer":"_11aYm","open":"_3Ydwm","drawer-overlay":"_3SQDf","drawer-header":"_2BwOx","drawer-form":"_2Zo7R","dropdown-content-academy":"_1lzjD","dropdown-change":"_1y7K9","dropdown-academy-item":"_1Y-55","dropdown-content-language":"_1fBXY","dropdown-item-language":"_3Szun","dropdown-item-language-active":"_2HhLb","item-address":"_3WYHC","item-logout":"_2-9ix","title-address":"_1r4pn","image-academy":"_2ZozT"};
|
33127
33199
|
|
33128
|
-
var _excluded$
|
33200
|
+
var _excluded$d = ["isOpen", "onClose", "handleSaveExam"];
|
33129
33201
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
33130
33202
|
var isOpen = props.isOpen,
|
33131
33203
|
onClose = props.onClose,
|
33132
33204
|
handleSaveExam = props.handleSaveExam,
|
33133
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
33205
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
33134
33206
|
var _useTranslation = reactI18next.useTranslation(),
|
33135
33207
|
t = _useTranslation.t;
|
33136
33208
|
var theme = material.useTheme();
|
@@ -34283,12 +34355,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
34283
34355
|
|
34284
34356
|
var styles$b = {"avatar":"_8niRT"};
|
34285
34357
|
|
34286
|
-
var _excluded$
|
34358
|
+
var _excluded$e = ["value", "disabled", "optionTypeNotification"];
|
34287
34359
|
var TypeSelector = function TypeSelector(_ref) {
|
34288
34360
|
var value = _ref.value,
|
34289
34361
|
disabled = _ref.disabled,
|
34290
34362
|
optionTypeNotification = _ref.optionTypeNotification,
|
34291
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34363
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
34292
34364
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34293
34365
|
options: optionTypeNotification,
|
34294
34366
|
value: value
|
@@ -34681,11 +34753,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
34681
34753
|
};
|
34682
34754
|
};
|
34683
34755
|
|
34684
|
-
var _excluded$
|
34756
|
+
var _excluded$f = ["value", "optionTypeNotification"];
|
34685
34757
|
var SelectFilterType = function SelectFilterType(_ref) {
|
34686
34758
|
var value = _ref.value,
|
34687
34759
|
optionTypeNotification = _ref.optionTypeNotification,
|
34688
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
34760
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
34689
34761
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
34690
34762
|
options: optionTypeNotification,
|
34691
34763
|
value: value
|
@@ -35962,7 +36034,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
35962
36034
|
};
|
35963
36035
|
var QuestionShortInput$1 = React.memo(QuestionShortInput, isEqual$1);
|
35964
36036
|
|
35965
|
-
var _excluded$
|
36037
|
+
var _excluded$g = ["onChange"];
|
35966
36038
|
var _$2 = _$8;
|
35967
36039
|
var BpIcon$1 = material.styled("span")(function (_ref) {
|
35968
36040
|
var theme = _ref.theme;
|
@@ -36273,7 +36345,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
36273
36345
|
name: path + ".questionTypeId",
|
36274
36346
|
render: function render(_ref5) {
|
36275
36347
|
var _ref5$field = _ref5.field,
|
36276
|
-
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$
|
36348
|
+
field = _objectWithoutPropertiesLoose(_ref5$field, _excluded$g);
|
36277
36349
|
return React__default.createElement(CustomSelectOption, Object.assign({}, field, {
|
36278
36350
|
isDisabled: disabled,
|
36279
36351
|
value: data.questionType,
|
@@ -36322,7 +36394,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
36322
36394
|
};
|
36323
36395
|
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$2);
|
36324
36396
|
|
36325
|
-
var _excluded$
|
36397
|
+
var _excluded$h = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36326
36398
|
var _$3 = _$8;
|
36327
36399
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
36328
36400
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
|
@@ -36343,7 +36415,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
36343
36415
|
onCloseCategoryMenu = _ref.onCloseCategoryMenu,
|
36344
36416
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36345
36417
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36346
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36418
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
36347
36419
|
var errors = formikProps.errors;
|
36348
36420
|
var startOrderRef = React.useRef(null);
|
36349
36421
|
var articles = data.articles,
|
@@ -36486,7 +36558,7 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
36486
36558
|
};
|
36487
36559
|
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$3);
|
36488
36560
|
|
36489
|
-
var _excluded$
|
36561
|
+
var _excluded$i = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36490
36562
|
var _$4 = _$8;
|
36491
36563
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
36492
36564
|
var _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2, _data$articles$4, _data$articles$4$cate, _data$articles$4$cate2;
|
@@ -36511,7 +36583,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36511
36583
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36512
36584
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36513
36585
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36514
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
36586
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$i);
|
36515
36587
|
var errors = formikProps.errors,
|
36516
36588
|
setFieldValue = formikProps.setFieldValue;
|
36517
36589
|
var _useTranslation = reactI18next.useTranslation(),
|
@@ -36974,7 +37046,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
36974
37046
|
}, formikProps)))));
|
36975
37047
|
};
|
36976
37048
|
|
36977
|
-
var _excluded$
|
37049
|
+
var _excluded$j = ["path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "questionGroups", "subChapters", "categories", "questionTypes", "disabled", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
36978
37050
|
var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
36979
37051
|
var path = _ref.path,
|
36980
37052
|
paths = _ref.paths,
|
@@ -36994,7 +37066,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
36994
37066
|
onCopiedPrevQuestionGroup = _ref.onCopiedPrevQuestionGroup,
|
36995
37067
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
36996
37068
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
36997
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
37069
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
36998
37070
|
var _useTranslation = reactI18next.useTranslation(),
|
36999
37071
|
t = _useTranslation.t;
|
37000
37072
|
var setFieldValue = formikProps.setFieldValue;
|
@@ -37173,7 +37245,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
37173
37245
|
}));
|
37174
37246
|
};
|
37175
37247
|
|
37176
|
-
var _excluded$
|
37248
|
+
var _excluded$k = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
37177
37249
|
var _$5 = _$8;
|
37178
37250
|
var ChapterBlock = function ChapterBlock(_ref) {
|
37179
37251
|
var data = _ref.data,
|
@@ -37196,7 +37268,7 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
37196
37268
|
onOpenSubCategoryMenu = _ref.onOpenSubCategoryMenu,
|
37197
37269
|
onOpenQuestionTypeMenu = _ref.onOpenQuestionTypeMenu,
|
37198
37270
|
onCloseQuestionTypeMenu = _ref.onCloseQuestionTypeMenu,
|
37199
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
37271
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$k);
|
37200
37272
|
var errors = formikProps.errors;
|
37201
37273
|
var _useTranslation = reactI18next.useTranslation(),
|
37202
37274
|
t = _useTranslation.t;
|
@@ -37887,7 +37959,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
37887
37959
|
}));
|
37888
37960
|
};
|
37889
37961
|
|
37890
|
-
var _excluded$
|
37962
|
+
var _excluded$l = ["value"];
|
37891
37963
|
var VisuallyHiddenInput = material.styled("input")({
|
37892
37964
|
clip: "rect(0 0 0 0)",
|
37893
37965
|
clipPath: "inset(50%)",
|
@@ -38055,7 +38127,7 @@ var TextbookInfoTab = function TextbookInfoTab(_ref) {
|
|
38055
38127
|
render: function render(_ref4) {
|
38056
38128
|
var _ref4$field = _ref4.field,
|
38057
38129
|
value = _ref4$field.value,
|
38058
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
38130
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$l);
|
38059
38131
|
return React__default.createElement(xDatePickers.LocalizationProvider, {
|
38060
38132
|
dateAdapter: AdapterMoment.AdapterMoment
|
38061
38133
|
}, React__default.createElement(xDatePickers.DatePicker, Object.assign({}, action, {
|
@@ -38529,7 +38601,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
38529
38601
|
}));
|
38530
38602
|
};
|
38531
38603
|
|
38532
|
-
var _excluded$
|
38604
|
+
var _excluded$m = ["isCreatedByAdmin", "isSuperAdminUser", "isSuperAdmin", "isAdmin", "textbookId", "selected", "coverImage", "disabled", "ownersDisabled", "selectedTextbook", "handleSaveData", "onChangeTab", "onUploadImage"];
|
38533
38605
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
38534
38606
|
var _valuesTextbook$curre;
|
38535
38607
|
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
@@ -38545,7 +38617,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38545
38617
|
handleSaveData = _ref.handleSaveData,
|
38546
38618
|
onChangeTab = _ref.onChangeTab,
|
38547
38619
|
onUploadImage = _ref.onUploadImage,
|
38548
|
-
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
38620
|
+
formikProps = _objectWithoutPropertiesLoose(_ref, _excluded$m);
|
38549
38621
|
var values = formikProps.values,
|
38550
38622
|
errors = formikProps.errors,
|
38551
38623
|
dirty = formikProps.dirty,
|
@@ -39797,7 +39869,7 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
|
|
39797
39869
|
var handleGoToMainPage = function handleGoToMainPage() {
|
39798
39870
|
if (!user) return;
|
39799
39871
|
var isAcademy = user.academyDomain || user.isLearningSpace;
|
39800
|
-
var mainUrl =
|
39872
|
+
var mainUrl = isAcademy ? homeAcademyUrl : homeUrl;
|
39801
39873
|
pushTo(history, mainUrl);
|
39802
39874
|
};
|
39803
39875
|
var handleImageError = function handleImageError() {
|
@@ -40452,6 +40524,491 @@ var singleLogo = function singleLogo(_ref) {
|
|
40452
40524
|
}))));
|
40453
40525
|
};
|
40454
40526
|
|
40527
|
+
var TimerItem = function TimerItem(_ref) {
|
40528
|
+
var data = _ref.data,
|
40529
|
+
seconds = _ref.seconds,
|
40530
|
+
loading = _ref.loading,
|
40531
|
+
activeTimerId = _ref.activeTimerId,
|
40532
|
+
onStartOrPauseTimer = _ref.onStartOrPauseTimer;
|
40533
|
+
var theme = material.useTheme();
|
40534
|
+
var _useTranslation = reactI18next.useTranslation(),
|
40535
|
+
t = _useTranslation.t;
|
40536
|
+
var handleStartOrPauseTimer = function handleStartOrPauseTimer() {
|
40537
|
+
onStartOrPauseTimer(data);
|
40538
|
+
};
|
40539
|
+
var isStarted = activeTimerId === data.id && data.status === exports.SubjectTimerStatus.Started;
|
40540
|
+
var displayedTime = React.useMemo(function () {
|
40541
|
+
switch (data.status) {
|
40542
|
+
case exports.SubjectTimerStatus.Started:
|
40543
|
+
return activeTimerId !== data.id ? formatTime$2(Math.floor(data.duration / 1000), t) : formatTime$2(seconds != null ? seconds : 0, t);
|
40544
|
+
case exports.SubjectTimerStatus.NotStarted:
|
40545
|
+
return t("press_to_start");
|
40546
|
+
default:
|
40547
|
+
return formatTime$2(Math.floor(data.duration / 1000), t);
|
40548
|
+
}
|
40549
|
+
}, [data.id, data.status, data.duration, seconds, activeTimerId, t]);
|
40550
|
+
return React__default.createElement(MenuItem, {
|
40551
|
+
className: "" + styles["timer-menu-item"],
|
40552
|
+
sx: {
|
40553
|
+
py: 1,
|
40554
|
+
bgcolor: theme.palette.background.paper,
|
40555
|
+
borderRadius: 0.75,
|
40556
|
+
minHeight: "52px"
|
40557
|
+
},
|
40558
|
+
disabled: loading,
|
40559
|
+
onClick: handleStartOrPauseTimer
|
40560
|
+
}, React__default.createElement(material.Stack, {
|
40561
|
+
direction: "row",
|
40562
|
+
gap: 1,
|
40563
|
+
sx: {
|
40564
|
+
justifyContent: "space-between",
|
40565
|
+
alignItems: "center",
|
40566
|
+
width: "100%"
|
40567
|
+
}
|
40568
|
+
}, React__default.createElement(material.Typography, {
|
40569
|
+
className: styles["subject-name"] + " " + styles["truncate"],
|
40570
|
+
fontSize: "14px",
|
40571
|
+
fontWeight: 600
|
40572
|
+
}, data.name), React__default.createElement(material.Box, {
|
40573
|
+
sx: {
|
40574
|
+
display: "flex",
|
40575
|
+
alignItems: "center",
|
40576
|
+
gap: 1.5
|
40577
|
+
}
|
40578
|
+
}, React__default.createElement(material.Typography, {
|
40579
|
+
className: "" + styles["duration"],
|
40580
|
+
sx: {
|
40581
|
+
color: isStarted ? theme.palette.common.black : theme.palette.success.light,
|
40582
|
+
fontSize: "14px",
|
40583
|
+
fontWeight: 700
|
40584
|
+
}
|
40585
|
+
}, displayedTime), !isStarted && React__default.createElement(material.Box, {
|
40586
|
+
className: "" + styles["icon-start"]
|
40587
|
+
}, React__default.createElement(io5.IoPlayCircleSharp, {
|
40588
|
+
size: 20
|
40589
|
+
})))));
|
40590
|
+
};
|
40591
|
+
var TOTAL_SECONDS_IN_A_MINUTE = 60;
|
40592
|
+
var TOTAL_SECONDS_IN_AN_HOUR = 60 * 60;
|
40593
|
+
var formatTime$2 = function formatTime(totalSeconds, t) {
|
40594
|
+
var hours = Math.floor(totalSeconds / TOTAL_SECONDS_IN_AN_HOUR);
|
40595
|
+
var minutes = Math.floor(totalSeconds % TOTAL_SECONDS_IN_AN_HOUR / TOTAL_SECONDS_IN_A_MINUTE);
|
40596
|
+
var seconds = totalSeconds % TOTAL_SECONDS_IN_A_MINUTE;
|
40597
|
+
if (hours > 0) {
|
40598
|
+
return "" + hours.toString().padStart(2, "0") + t("hour_h") + " " + minutes.toString().padStart(2, "0") + t("minutes") + " " + seconds.toString().padStart(2, "0") + t("seconds");
|
40599
|
+
}
|
40600
|
+
if (minutes > 0) {
|
40601
|
+
return "" + minutes.toString().padStart(2, "0") + t("minutes") + " " + seconds.toString().padStart(2, "0") + t("seconds");
|
40602
|
+
}
|
40603
|
+
return "" + seconds.toString().padStart(2, "0") + t("seconds");
|
40604
|
+
};
|
40605
|
+
|
40606
|
+
var TimerCountItem = function TimerCountItem(_ref) {
|
40607
|
+
var data = _ref.data,
|
40608
|
+
activeTimerId = _ref.activeTimerId,
|
40609
|
+
onChangeTime = _ref.onChangeTime;
|
40610
|
+
var requestAnimationRef = React.useRef(null);
|
40611
|
+
var user = reactRedux.useSelector(function (state) {
|
40612
|
+
var _state$common;
|
40613
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
40614
|
+
});
|
40615
|
+
React.useEffect(function () {
|
40616
|
+
if (data.status !== exports.SubjectTimerStatus.Started || !(user !== null && user !== void 0 && user.academyDomain) && !(user !== null && user !== void 0 && user.isLearningSpace) || data.id !== activeTimerId) return;
|
40617
|
+
var _animate = function animate() {
|
40618
|
+
var startTime = data.startTime,
|
40619
|
+
lastResumeTime = data.lastResumeTime,
|
40620
|
+
duration = data.duration;
|
40621
|
+
var startOfTime = lastResumeTime !== DATE_TIME_MIN_VALUE ? lastResumeTime : startTime;
|
40622
|
+
if (startOfTime === DATE_TIME_MIN_VALUE) return;
|
40623
|
+
var time = getCountTime(startOfTime, Math.floor(duration / 1000));
|
40624
|
+
if (typeof time !== "number") {
|
40625
|
+
onChangeTime(data, undefined);
|
40626
|
+
return;
|
40627
|
+
}
|
40628
|
+
onChangeTime(data, time);
|
40629
|
+
requestAnimationRef.current = requestAnimationFrame(_animate);
|
40630
|
+
};
|
40631
|
+
requestAnimationRef.current = requestAnimationFrame(_animate);
|
40632
|
+
return function () {
|
40633
|
+
!!requestAnimationRef.current && cancelAnimationFrame(requestAnimationRef.current);
|
40634
|
+
};
|
40635
|
+
}, [JSON.stringify(data), user === null || user === void 0 ? void 0 : user.id, user === null || user === void 0 ? void 0 : user.academyDomain, user === null || user === void 0 ? void 0 : user.isLearningSpace, activeTimerId]);
|
40636
|
+
return React__default.createElement(React.Fragment, null);
|
40637
|
+
};
|
40638
|
+
|
40639
|
+
var formatDate = function formatDate(t, date) {
|
40640
|
+
return utcToLocalTime(date, t("date_format"));
|
40641
|
+
};
|
40642
|
+
var TimerDropdown = function TimerDropdown() {
|
40643
|
+
var _user$academyDomain$t, _user$academyDomain, _user$academyDomain$t2;
|
40644
|
+
var _useTranslation = reactI18next.useTranslation(),
|
40645
|
+
t = _useTranslation.t;
|
40646
|
+
var theme = material.useTheme();
|
40647
|
+
var user = reactRedux.useSelector(function (state) {
|
40648
|
+
var _state$common;
|
40649
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
40650
|
+
});
|
40651
|
+
var _useState = React.useState(null),
|
40652
|
+
open = _useState[0],
|
40653
|
+
setOpen = _useState[1];
|
40654
|
+
var _useState2 = React.useState([]),
|
40655
|
+
timers = _useState2[0],
|
40656
|
+
setTimers = _useState2[1];
|
40657
|
+
var _useState3 = React.useState(),
|
40658
|
+
seconds = _useState3[0],
|
40659
|
+
setSeconds = _useState3[1];
|
40660
|
+
var _useState4 = React.useState(),
|
40661
|
+
activeTimerId = _useState4[0],
|
40662
|
+
setActiveTimerId = _useState4[1];
|
40663
|
+
var _useState5 = React.useState(false),
|
40664
|
+
loadingItem = _useState5[0],
|
40665
|
+
setLoadingItem = _useState5[1];
|
40666
|
+
var _useState6 = React.useState(false),
|
40667
|
+
isFetching = _useState6[0],
|
40668
|
+
setFetching = _useState6[1];
|
40669
|
+
var fetchedRef = React.useRef();
|
40670
|
+
var academyDomain = (_user$academyDomain$t = user === null || user === void 0 ? void 0 : (_user$academyDomain = user.academyDomain) === null || _user$academyDomain === void 0 ? void 0 : (_user$academyDomain$t2 = _user$academyDomain.toLowerCase) === null || _user$academyDomain$t2 === void 0 ? void 0 : _user$academyDomain$t2.call(_user$academyDomain)) != null ? _user$academyDomain$t : "";
|
40671
|
+
var handleChangeTime = function handleChangeTime(data, time) {
|
40672
|
+
if (!(user !== null && user !== void 0 && user.id) || !academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace)) return;
|
40673
|
+
if (academyDomain !== fetchedRef.current && data.id !== activeTimerId) return;
|
40674
|
+
setSeconds(time);
|
40675
|
+
var key = user.id + "-" + data.id + "-" + SUBJECT_TIMER_KEY + academyDomain;
|
40676
|
+
saveDuration(key, time * 1000);
|
40677
|
+
};
|
40678
|
+
var handleOpen = function handleOpen(event) {
|
40679
|
+
setOpen(event.currentTarget);
|
40680
|
+
};
|
40681
|
+
var handleClose = function handleClose() {
|
40682
|
+
setOpen(null);
|
40683
|
+
};
|
40684
|
+
var handleStartOrPauseTimer = function handleStartOrPauseTimer(data) {
|
40685
|
+
try {
|
40686
|
+
var _temp2 = function _temp2(_result3) {
|
40687
|
+
if (_exit) return _result3;
|
40688
|
+
setLoadingItem(false);
|
40689
|
+
};
|
40690
|
+
var _exit = false;
|
40691
|
+
var isActive = activeTimerId === data.id;
|
40692
|
+
var isPaused = data.status === exports.SubjectTimerStatus.Paused;
|
40693
|
+
setLoadingItem(true);
|
40694
|
+
var _temp = _catch(function () {
|
40695
|
+
return Promise.resolve(handlePauseAllTimers(data.id)).then(function () {
|
40696
|
+
return function () {
|
40697
|
+
if (data.recordId) {
|
40698
|
+
return function () {
|
40699
|
+
if (!isActive && !isPaused) {
|
40700
|
+
setActiveTimerId(data.id);
|
40701
|
+
setTimers(function (timers) {
|
40702
|
+
return timers.map(function (timer) {
|
40703
|
+
return timer.id === data.id ? _extends({}, timer, {
|
40704
|
+
lastResumeTime: moment().utc().toISOString()
|
40705
|
+
}) : timer;
|
40706
|
+
});
|
40707
|
+
});
|
40708
|
+
setLoadingItem(false);
|
40709
|
+
_exit = true;
|
40710
|
+
} else {
|
40711
|
+
return Promise.resolve(pauseStudentSubjectApi(data.id, data.recordId, {
|
40712
|
+
status: isPaused ? exports.SubjectTimerStatus.Started : exports.SubjectTimerStatus.Paused,
|
40713
|
+
startTime: isPaused ? moment().utc().valueOf() : 0,
|
40714
|
+
pauseTime: !isPaused ? moment().utc().valueOf() : 0,
|
40715
|
+
duration: isActive && seconds ? seconds * 1000 : data.duration
|
40716
|
+
})).then(function (res) {
|
40717
|
+
setTimers(function (timers) {
|
40718
|
+
return timers.map(function (timer) {
|
40719
|
+
return timer.id === data.id ? res.data : timer;
|
40720
|
+
});
|
40721
|
+
});
|
40722
|
+
setActiveTimerId(!isPaused && isActive ? undefined : data.id);
|
40723
|
+
});
|
40724
|
+
}
|
40725
|
+
}();
|
40726
|
+
} else {
|
40727
|
+
return Promise.resolve(startStudentSubjectTimerApi(data.id)).then(function (res) {
|
40728
|
+
setTimers(function (timers) {
|
40729
|
+
return timers.map(function (timer) {
|
40730
|
+
return timer.id === data.id ? res.data : timer;
|
40731
|
+
});
|
40732
|
+
});
|
40733
|
+
setActiveTimerId(!isPaused && isActive ? undefined : data.id);
|
40734
|
+
});
|
40735
|
+
}
|
40736
|
+
}();
|
40737
|
+
});
|
40738
|
+
}, function () {
|
40739
|
+
reactToastify.toast.error(t(isPaused ? "failed_to_start_the_subject_name" : "failed_to_pause_the_subject_name", {
|
40740
|
+
name: data.name
|
40741
|
+
}));
|
40742
|
+
});
|
40743
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
40744
|
+
} catch (e) {
|
40745
|
+
return Promise.reject(e);
|
40746
|
+
}
|
40747
|
+
};
|
40748
|
+
var handlePauseAllTimers = function handlePauseAllTimers(exceptId) {
|
40749
|
+
try {
|
40750
|
+
!exceptId && setLoadingItem(true);
|
40751
|
+
var tasks = timers.filter(function (i) {
|
40752
|
+
return i.status === exports.SubjectTimerStatus.Started && i.id !== exceptId;
|
40753
|
+
}).map(function (i) {
|
40754
|
+
return handlePauseTimer(i);
|
40755
|
+
});
|
40756
|
+
return Promise.resolve(Promise.all(tasks)).then(function () {
|
40757
|
+
!exceptId && setLoadingItem(false);
|
40758
|
+
});
|
40759
|
+
} catch (e) {
|
40760
|
+
return Promise.reject(e);
|
40761
|
+
}
|
40762
|
+
};
|
40763
|
+
var handlePauseTimer = function handlePauseTimer(data, updateState) {
|
40764
|
+
if (updateState === void 0) {
|
40765
|
+
updateState = true;
|
40766
|
+
}
|
40767
|
+
try {
|
40768
|
+
if (data.status === exports.SubjectTimerStatus.Paused) return Promise.resolve(data);
|
40769
|
+
return Promise.resolve(_catch(function () {
|
40770
|
+
return Promise.resolve(pauseStudentSubjectApi(data.id, data.recordId, {
|
40771
|
+
status: exports.SubjectTimerStatus.Paused,
|
40772
|
+
duration: activeTimerId === data.id && seconds ? seconds * 1000 : data.duration,
|
40773
|
+
pauseTime: moment().utc().valueOf()
|
40774
|
+
})).then(function (res) {
|
40775
|
+
if (updateState) setTimers(function (state) {
|
40776
|
+
return state.map(function (i) {
|
40777
|
+
return i.id === data.id ? res.data : i;
|
40778
|
+
});
|
40779
|
+
});
|
40780
|
+
return res.data;
|
40781
|
+
});
|
40782
|
+
}, function () {
|
40783
|
+
activeTimerId === data.id && reactToastify.toast.error(t("failed_to_pause_the_subject_name", {
|
40784
|
+
name: data.name
|
40785
|
+
}));
|
40786
|
+
}));
|
40787
|
+
} catch (e) {
|
40788
|
+
return Promise.reject(e);
|
40789
|
+
}
|
40790
|
+
};
|
40791
|
+
var getDataFromLocalStorage = React.useCallback(function (items) {
|
40792
|
+
if (fetchedRef.current !== academyDomain) return [];
|
40793
|
+
return items.map(function (item) {
|
40794
|
+
var key = (user === null || user === void 0 ? void 0 : user.id) + "-" + item.id + "-" + SUBJECT_TIMER_KEY + academyDomain;
|
40795
|
+
var duration = getLocalDuration(key, item);
|
40796
|
+
var lastResumeTime = moment().utc().toISOString();
|
40797
|
+
return _extends({}, item, {
|
40798
|
+
duration: duration !== null ? duration : item.duration,
|
40799
|
+
lastResumeTime: lastResumeTime
|
40800
|
+
});
|
40801
|
+
});
|
40802
|
+
}, [user === null || user === void 0 ? void 0 : user.id, academyDomain]);
|
40803
|
+
React.useEffect(function () {
|
40804
|
+
var fetchData = function fetchData() {
|
40805
|
+
try {
|
40806
|
+
var _temp4 = function _temp4() {
|
40807
|
+
setFetching(false);
|
40808
|
+
};
|
40809
|
+
if (!(user !== null && user !== void 0 && user.id) || !academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace)) return Promise.resolve();
|
40810
|
+
if (fetchedRef.current == academyDomain && !open) return Promise.resolve();
|
40811
|
+
setFetching(true);
|
40812
|
+
var _temp3 = _catch(function () {
|
40813
|
+
return Promise.resolve(getStudentSubjectListApi()).then(function (res) {
|
40814
|
+
var _items$find;
|
40815
|
+
var _res$data$items = res.data.items,
|
40816
|
+
items = _res$data$items === void 0 ? [] : _res$data$items;
|
40817
|
+
fetchedRef.current = academyDomain;
|
40818
|
+
setTimers(getDataFromLocalStorage(items));
|
40819
|
+
setActiveTimerId((_items$find = items.find(function (i) {
|
40820
|
+
return i.status === exports.SubjectTimerStatus.Started;
|
40821
|
+
})) === null || _items$find === void 0 ? void 0 : _items$find.id);
|
40822
|
+
});
|
40823
|
+
}, function (error) {
|
40824
|
+
reactToastify.toast.error(getErrorMessage(t, error));
|
40825
|
+
});
|
40826
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
40827
|
+
} catch (e) {
|
40828
|
+
return Promise.reject(e);
|
40829
|
+
}
|
40830
|
+
};
|
40831
|
+
fetchData();
|
40832
|
+
}, [t, getDataFromLocalStorage, user === null || user === void 0 ? void 0 : user.isLearningSpace, open]);
|
40833
|
+
var today = formatDate(t);
|
40834
|
+
var isRunning = timers.some(function (timer) {
|
40835
|
+
return timer.status === exports.SubjectTimerStatus.Started;
|
40836
|
+
});
|
40837
|
+
var selectedTimer = timers.find(function (i) {
|
40838
|
+
return i.id === activeTimerId;
|
40839
|
+
});
|
40840
|
+
return React__default.createElement(React.Fragment, null, React__default.createElement(IconButton, {
|
40841
|
+
onClick: handleOpen,
|
40842
|
+
sx: {
|
40843
|
+
width: 44,
|
40844
|
+
height: 44,
|
40845
|
+
mx: 1,
|
40846
|
+
borderRadius: "6px",
|
40847
|
+
padding: "8px",
|
40848
|
+
background: !isRunning ? grey[50] : green[100],
|
40849
|
+
"&: hover": {
|
40850
|
+
background: !isRunning ? grey[200] : green[200]
|
40851
|
+
}
|
40852
|
+
}
|
40853
|
+
}, React__default.createElement(material.Stack, {
|
40854
|
+
justifyContent: "center",
|
40855
|
+
alignItems: "center",
|
40856
|
+
width: "100%",
|
40857
|
+
height: "100%",
|
40858
|
+
sx: {
|
40859
|
+
borderRadius: "50%",
|
40860
|
+
backgroundColor: "#FFF"
|
40861
|
+
}
|
40862
|
+
}, React__default.createElement(io5.IoTimer, {
|
40863
|
+
color: !isRunning ? grey[700] : green[500],
|
40864
|
+
size: "16.25px"
|
40865
|
+
}))), selectedTimer && React__default.createElement(TimerCountItem, {
|
40866
|
+
data: selectedTimer,
|
40867
|
+
activeTimerId: activeTimerId,
|
40868
|
+
onChangeTime: handleChangeTime
|
40869
|
+
}), React__default.createElement(Popover, {
|
40870
|
+
open: !!open,
|
40871
|
+
anchorEl: open,
|
40872
|
+
onClose: handleClose,
|
40873
|
+
anchorOrigin: {
|
40874
|
+
vertical: "bottom",
|
40875
|
+
horizontal: "right"
|
40876
|
+
},
|
40877
|
+
transformOrigin: {
|
40878
|
+
vertical: "top",
|
40879
|
+
horizontal: "right"
|
40880
|
+
},
|
40881
|
+
slotProps: {
|
40882
|
+
paper: {
|
40883
|
+
sx: {
|
40884
|
+
px: 2,
|
40885
|
+
mt: 1,
|
40886
|
+
ml: 0.75,
|
40887
|
+
width: 320,
|
40888
|
+
borderRadius: 2,
|
40889
|
+
boxShadow: 3,
|
40890
|
+
bgcolor: theme.palette.grey[50]
|
40891
|
+
}
|
40892
|
+
}
|
40893
|
+
}
|
40894
|
+
}, React__default.createElement(material.Box, {
|
40895
|
+
sx: {
|
40896
|
+
py: 2,
|
40897
|
+
display: "flex",
|
40898
|
+
alignItems: "center",
|
40899
|
+
justifyContent: "space-between"
|
40900
|
+
}
|
40901
|
+
}, React__default.createElement(material.Box, {
|
40902
|
+
sx: {
|
40903
|
+
display: "flex",
|
40904
|
+
gap: 1,
|
40905
|
+
alignItems: "center"
|
40906
|
+
}
|
40907
|
+
}, React__default.createElement(material.Box, {
|
40908
|
+
display: "flex",
|
40909
|
+
alignItems: "center"
|
40910
|
+
}, React__default.createElement(io5.IoTimer, null)), React__default.createElement(material.Typography, {
|
40911
|
+
variant: "subtitle1",
|
40912
|
+
fontWeight: "bold",
|
40913
|
+
fontSize: "14px"
|
40914
|
+
}, t("study_timer"))), React__default.createElement(material.Typography, {
|
40915
|
+
color: "textSecondary",
|
40916
|
+
whiteSpace: "nowrap",
|
40917
|
+
fontSize: "14px"
|
40918
|
+
}, today)), React__default.createElement(material.Divider, {
|
40919
|
+
sx: {
|
40920
|
+
bgcolor: theme.palette.grey[700]
|
40921
|
+
}
|
40922
|
+
}), React__default.createElement(material.Stack, {
|
40923
|
+
className: "" + styles["timer-menu"],
|
40924
|
+
gap: 1.5,
|
40925
|
+
flexDirection: "column",
|
40926
|
+
sx: {
|
40927
|
+
py: 2,
|
40928
|
+
maxHeight: "360px"
|
40929
|
+
}
|
40930
|
+
}, !isFetching && React__default.createElement(ListView, {
|
40931
|
+
data: timers,
|
40932
|
+
render: function render(item, index) {
|
40933
|
+
return React__default.createElement(TimerItem, {
|
40934
|
+
key: index,
|
40935
|
+
data: item,
|
40936
|
+
loading: loadingItem,
|
40937
|
+
seconds: activeTimerId === item.id ? seconds : undefined,
|
40938
|
+
activeTimerId: activeTimerId,
|
40939
|
+
onStartOrPauseTimer: handleStartOrPauseTimer
|
40940
|
+
});
|
40941
|
+
}
|
40942
|
+
}), isFetching && React__default.createElement(material.Stack, {
|
40943
|
+
sx: {
|
40944
|
+
width: "100%",
|
40945
|
+
py: 2
|
40946
|
+
},
|
40947
|
+
justifyContent: "center",
|
40948
|
+
alignItems: "center"
|
40949
|
+
}, React__default.createElement(material.Typography, {
|
40950
|
+
className: "text-muted"
|
40951
|
+
}, React__default.createElement(material.CircularProgress, {
|
40952
|
+
size: "16px",
|
40953
|
+
color: "success"
|
40954
|
+
}))), !timers.length && !isFetching && React__default.createElement(material.Box, null, React__default.createElement(material.Typography, {
|
40955
|
+
className: "text-muted"
|
40956
|
+
}, t("no_data")))), React__default.createElement(material.Divider, {
|
40957
|
+
sx: {
|
40958
|
+
bgcolor: theme.palette.grey[700]
|
40959
|
+
}
|
40960
|
+
}), React__default.createElement(material.Box, {
|
40961
|
+
sx: {
|
40962
|
+
p: 2,
|
40963
|
+
textAlign: "right"
|
40964
|
+
}
|
40965
|
+
}, React__default.createElement(material.Button, {
|
40966
|
+
disableTouchRipple: true,
|
40967
|
+
onClick: function onClick() {
|
40968
|
+
return handlePauseAllTimers();
|
40969
|
+
},
|
40970
|
+
disabled: loadingItem,
|
40971
|
+
sx: {
|
40972
|
+
fontWeight: 700,
|
40973
|
+
color: theme.palette.success.main,
|
40974
|
+
padding: "8px 12px",
|
40975
|
+
bgcolor: theme.palette.background.paper,
|
40976
|
+
"&:hover": {
|
40977
|
+
bgcolor: theme.palette.grey[200]
|
40978
|
+
},
|
40979
|
+
"&:disabled": {
|
40980
|
+
opacity: 0.5
|
40981
|
+
}
|
40982
|
+
}
|
40983
|
+
}, loadingItem ? t("saving") : t("pause")))));
|
40984
|
+
};
|
40985
|
+
var SUBJECT_TIMER_KEY = "stk";
|
40986
|
+
var saveDuration = function saveDuration(key, duration) {
|
40987
|
+
localStorage.setItem(key, "" + duration);
|
40988
|
+
};
|
40989
|
+
var getLocalDuration = function getLocalDuration(key, timer) {
|
40990
|
+
try {
|
40991
|
+
var res = localStorage.getItem(key);
|
40992
|
+
var duration = +(res != null ? res : "");
|
40993
|
+
if (!duration || Number.isNaN(duration) || duration <= timer.duration) return null;
|
40994
|
+
return duration;
|
40995
|
+
} catch (error) {
|
40996
|
+
return null;
|
40997
|
+
}
|
40998
|
+
};
|
40999
|
+
|
41000
|
+
var HeaderLink = function HeaderLink(_ref) {
|
41001
|
+
var data = _ref.data,
|
41002
|
+
render = _ref.render;
|
41003
|
+
var activePaths = data.activePaths,
|
41004
|
+
path = data.path;
|
41005
|
+
var pathname = window.location.pathname.toLowerCase();
|
41006
|
+
var isActive = (activePaths === null || activePaths === void 0 ? void 0 : activePaths.some(function (a) {
|
41007
|
+
return pathname.startsWith(a);
|
41008
|
+
})) || pathname.startsWith(path);
|
41009
|
+
return React__default.createElement(React.Fragment, null, render(data, isActive));
|
41010
|
+
};
|
41011
|
+
|
40455
41012
|
var Header = function Header(_ref) {
|
40456
41013
|
var academyListRoute = _ref.academyListRoute,
|
40457
41014
|
homeRoute = _ref.homeRoute,
|
@@ -40574,7 +41131,9 @@ var Header = function Header(_ref) {
|
|
40574
41131
|
justifyContent: "center",
|
40575
41132
|
height: "100%",
|
40576
41133
|
className: styles["logo"] + " d-flex d-lg-none"
|
40577
|
-
}, React__default.createElement(singleLogo, null))), React__default.createElement(material.Stack, {
|
41134
|
+
}, React__default.createElement(singleLogo, null))), !isTeacherSide && React__default.createElement(material.Stack, {
|
41135
|
+
className: "me-2 ms-2"
|
41136
|
+
}, React__default.createElement(TimerDropdown, null)), React__default.createElement(material.Stack, {
|
40578
41137
|
className: "me-2",
|
40579
41138
|
display: "none"
|
40580
41139
|
}, React__default.createElement(TheLanguageDropdown, null)), showAnnouncement && renderNotificationLink && React__default.createElement(AnnouncementContainer, {
|
@@ -40583,17 +41142,6 @@ var Header = function Header(_ref) {
|
|
40583
41142
|
renderViewNoteLink: renderViewNoteLink
|
40584
41143
|
})));
|
40585
41144
|
};
|
40586
|
-
var HeaderLink = function HeaderLink(_ref3) {
|
40587
|
-
var data = _ref3.data,
|
40588
|
-
render = _ref3.render;
|
40589
|
-
var activePaths = data.activePaths,
|
40590
|
-
path = data.path;
|
40591
|
-
var pathname = location.pathname.toLowerCase();
|
40592
|
-
var isActive = (activePaths === null || activePaths === void 0 ? void 0 : activePaths.some(function (a) {
|
40593
|
-
return pathname.startsWith(a);
|
40594
|
-
})) || pathname.startsWith(path);
|
40595
|
-
return React__default.createElement(React.Fragment, null, render(data, isActive));
|
40596
|
-
};
|
40597
41145
|
|
40598
41146
|
var useLayoutContext = function useLayoutContext(role, showLoadingAcademy, domain) {
|
40599
41147
|
var _currentPusher$connec2;
|
@@ -40978,6 +41526,7 @@ exports.formatTime = formatTime;
|
|
40978
41526
|
exports.formatTimeSecond = formatTimeSecond;
|
40979
41527
|
exports.getAcademyDomain = getAcademyDomain;
|
40980
41528
|
exports.getAccessToken = getAccessToken;
|
41529
|
+
exports.getCountTime = getCountTime;
|
40981
41530
|
exports.getErrorMessage = getErrorMessage;
|
40982
41531
|
exports.getLanguage = getLanguage;
|
40983
41532
|
exports.getLearningSpace = getLearningSpace;
|