mario-education 2.0.144-staging → 2.0.145-staging

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.
@@ -0,0 +1,1267 @@
1
+ import { jsx as e, jsxs as l, Fragment as K } from "react/jsx-runtime";
2
+ import { useTranslation as x, api as P, BASE_URL as F, setAlert as _, setLoading as N, SearchBox as _e, LinkEditButton as Se, EmptyDataAlert as be, CustomPagination as Ie, CustomTab as Oe } from "mario-core";
3
+ import { Row as U, Col as m, Label as V, Input as B, Button as q, Table as Re } from "reactstrap";
4
+ import { Formik as de } from "formik";
5
+ import * as Ae from "react";
6
+ import re, { useRef as we, useState as I, useCallback as O, useMemo as E, useEffect as Y, forwardRef as Le } from "react";
7
+ import { useDispatch as z } from "react-redux";
8
+ import { e as ee, f as G, g as Z } from "./index-BzA6oUpQ.js";
9
+ import { g as Ue } from "./userDeletedService-B3c2erm-.js";
10
+ import { _ as Pe } from "./extends-hS2Bh-Yp.js";
11
+ import { _ as ke, c as oe, g as Ee, a as $e, b as ne, v as Fe, d as le, u as Te, S as De } from "./useStateManager-7e1e8489.esm-Dg9jhVbQ.js";
12
+ import "@emotion/react";
13
+ import "react-dom";
14
+ import { a as Q, b as X } from "./index-Dn1cuBch.js";
15
+ const M = {
16
+ USERNAME: "Username",
17
+ EMAIL: "Email",
18
+ ROLE: "Role",
19
+ GRADE: "Grade"
20
+ }, $ = {
21
+ ClassLink: 0,
22
+ Clever: 1
23
+ }, me = ({ rosterConfig: t, updateData: o, type: s }) => {
24
+ const { t: r } = x();
25
+ return /* @__PURE__ */ e(
26
+ de,
27
+ {
28
+ initialValues: t,
29
+ enableReinitialize: !0,
30
+ onSubmit: (a) => {
31
+ o(a);
32
+ },
33
+ children: (a) => {
34
+ const {
35
+ values: h,
36
+ handleChange: n,
37
+ handleBlur: d,
38
+ handleSubmit: i
39
+ } = a;
40
+ return /* @__PURE__ */ l(U, { children: [
41
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ l("h5", { className: "mt-4 font-weight-bold", children: [
42
+ r("one_roster_config"),
43
+ " (From ",
44
+ s === $.ClassLink ? "ClassLink" : "Clever",
45
+ ")"
46
+ ] }) }),
47
+ /* @__PURE__ */ l(m, { md: 12, className: "my-4 mt-2", children: [
48
+ /* @__PURE__ */ e(V, { className: "font-weight-bold", children: r("time_oneRoster_sync_hh") }),
49
+ /* @__PURE__ */ e(
50
+ B,
51
+ {
52
+ name: "cronjobTime",
53
+ placeholder: r("time_oneRoster_sync_hh"),
54
+ value: h.cronjobTime,
55
+ onChange: (c) => {
56
+ n(c);
57
+ },
58
+ onBlur: d("cronjobTime")
59
+ }
60
+ )
61
+ ] }),
62
+ /* @__PURE__ */ e(m, { md: 12, className: "my-4 mt-2", children: /* @__PURE__ */ l(U, { children: [
63
+ /* @__PURE__ */ l(m, { md: s === $.ClassLink ? 9 : 12, children: [
64
+ /* @__PURE__ */ l(V, { className: "font-weight-bold", children: [
65
+ r("end_point_url"),
66
+ ":"
67
+ ] }),
68
+ /* @__PURE__ */ e(
69
+ B,
70
+ {
71
+ disabled: !0,
72
+ name: "endPointUrl",
73
+ placeholder: r("end_point_url"),
74
+ value: h.endPointUrl,
75
+ onChange: (c) => {
76
+ n(c);
77
+ },
78
+ onBlur: d("endPointUrl")
79
+ }
80
+ )
81
+ ] }),
82
+ s === $.ClassLink && /* @__PURE__ */ l(m, { md: 3, children: [
83
+ /* @__PURE__ */ e(V, { className: "font-weight-bold", children: "Version:" }),
84
+ /* @__PURE__ */ l(
85
+ B,
86
+ {
87
+ disabled: !0,
88
+ type: "select",
89
+ name: "oneRosterVersion",
90
+ value: h.oneRosterVersion || "1.1",
91
+ onChange: (c) => {
92
+ n(c);
93
+ },
94
+ onBlur: d("oneRosterVersion"),
95
+ children: [
96
+ /* @__PURE__ */ e("option", { value: "1.1", children: "1.1" }),
97
+ /* @__PURE__ */ e("option", { value: "1.2", children: "1.2" })
98
+ ]
99
+ }
100
+ )
101
+ ] })
102
+ ] }) }),
103
+ /* @__PURE__ */ l(m, { md: 12, className: "mb-4 mt-2", children: [
104
+ /* @__PURE__ */ l(V, { className: "font-weight-bold", children: [
105
+ r("client_id"),
106
+ ":"
107
+ ] }),
108
+ /* @__PURE__ */ e(
109
+ B,
110
+ {
111
+ disabled: !0,
112
+ name: "clientId",
113
+ placeholder: r("client_id"),
114
+ value: h.clientId,
115
+ onChange: (c) => {
116
+ n(c);
117
+ },
118
+ onBlur: d("clientId")
119
+ }
120
+ )
121
+ ] }),
122
+ /* @__PURE__ */ l(m, { md: 12, className: "mb-4", children: [
123
+ /* @__PURE__ */ l(V, { className: "font-weight-bold", children: [
124
+ r("client_secret"),
125
+ ":"
126
+ ] }),
127
+ /* @__PURE__ */ e(
128
+ B,
129
+ {
130
+ disabled: !0,
131
+ name: "clientSecret",
132
+ placeholder: r("client_secret"),
133
+ value: h.clientSecret,
134
+ onChange: (c) => {
135
+ n(c);
136
+ },
137
+ onBlur: d("clientSecret")
138
+ }
139
+ )
140
+ ] }),
141
+ /* @__PURE__ */ e(m, { md: 12, className: "d-flex justify-content-end", children: /* @__PURE__ */ e(
142
+ q,
143
+ {
144
+ onClick: () => i(),
145
+ color: "success",
146
+ children: r("save")
147
+ }
148
+ ) })
149
+ ] });
150
+ }
151
+ }
152
+ );
153
+ }, ue = `${F}/api/oneRoster`, Ve = `${F}/api/ImportOneRoster/file`, Be = `${F}/api/usersOneRoster`, je = `${F}/api/User/roster-users`, pe = `${F}/api/veraCross`, he = `${F}/api/openApply`, Me = (t) => P.get(ue, { params: { type: t } }), xe = () => P.get(pe), Je = (t) => P.put(`${pe}`, t), qe = (t, o) => P.put(`${ue}`, t, { params: { type: o } }), ze = () => P.get(he), We = (t) => P.put(`${he}`, t), Ge = (t, o) => P.post(Ve, t, {
154
+ onUploadProgress: o
155
+ }), Ze = (t) => P.get(`${Be}`, {
156
+ params: t
157
+ }), Ye = (t) => P.post(`${je}`, t), He = () => P.post(`${F}/api/ImportRestApiRoster/trigger-sync`), Ke = () => P.post(`${F}/api/clever/trigger-sync`), Qe = () => P.post(`${F}/api/ImportRestApiVeraCross/trigger-sync`), Xe = () => P.post(`${F}/api/ImportRestApiOpenApply/trigger-sync`), et = "_spinner_tuwht_1", tt = "_pointer_tuwht_26", k = {
158
+ spinner: et,
159
+ "success-block": "_success-block_tuwht_14",
160
+ "middle-block": "_middle-block_tuwht_18",
161
+ "list-block": "_list-block_tuwht_22",
162
+ pointer: tt
163
+ }, st = [
164
+ "academicSession",
165
+ "classes",
166
+ "resources",
167
+ "courses",
168
+ "orgs",
169
+ "categories",
170
+ "lineItems",
171
+ "results",
172
+ "users",
173
+ "enrollments",
174
+ "demographics"
175
+ ], ge = "Response status code does not indicate success: 403 ().", rt = {
176
+ value: 10
177
+ }, nt = {
178
+ searchString: "",
179
+ currentPage: 1,
180
+ pageSize: rt.value,
181
+ isCreated: !1
182
+ }, at = [
183
+ "students",
184
+ "faculties"
185
+ ], it = [
186
+ "students",
187
+ "parents"
188
+ ], ot = ({ errorImportRest: t, type: o }) => {
189
+ const s = z(), r = we(null), [a, h] = I(0), [n, d] = I(), [i] = I({}), c = O(async () => {
190
+ if (t) {
191
+ s(_({
192
+ type: "danger",
193
+ message: `${t} (Please make sure your changes are saved)`
194
+ }));
195
+ return;
196
+ }
197
+ s(N(!0));
198
+ try {
199
+ const y = o === $.Clever ? await Ke() : await He();
200
+ s(_({
201
+ type: "success",
202
+ message: y.data?.message || "Sync job has been triggered in the background. Please wait a few moments before refreshing the page."
203
+ }));
204
+ } catch (y) {
205
+ s(_({
206
+ type: "danger",
207
+ message: y.response?.data?.message || y.response?.data?.title || y.message
208
+ }));
209
+ }
210
+ s(N(!1));
211
+ }, [t, o, s]), u = O(
212
+ async (y) => {
213
+ d({
214
+ error: "",
215
+ success: !1,
216
+ isUploading: !0,
217
+ importedFiles: "",
218
+ rejectedFiles: "",
219
+ comment: ""
220
+ }), s(N(!0));
221
+ try {
222
+ const g = new FormData();
223
+ g.append("file", y);
224
+ const L = await Ge(
225
+ g,
226
+ R
227
+ );
228
+ d((w) => ({
229
+ ...w,
230
+ success: !0,
231
+ importedFiles: L.data.csvFilesImported || "",
232
+ rejectedFiles: L.data.cSVFilesRejected || "",
233
+ comment: L.data.comment || ""
234
+ }));
235
+ } catch (g) {
236
+ d((L) => ({
237
+ ...L,
238
+ error: g.response?.data?.title || g.message
239
+ }));
240
+ }
241
+ r.current?.value && (r.current.value = ""), d((g) => ({
242
+ ...g,
243
+ isUploading: !1
244
+ })), s(N(!1));
245
+ },
246
+ [JSON.stringify(n)]
247
+ ), v = () => {
248
+ r.current?.click();
249
+ }, R = (y) => {
250
+ const g = Math.round(
251
+ y.loaded / y.total * 100
252
+ );
253
+ h(g);
254
+ }, S = O(async () => {
255
+ d(void 0), h(0);
256
+ const y = r.current?.files?.[0];
257
+ y && await u(y);
258
+ }, []), b = E(() => {
259
+ if (n)
260
+ return n.isUploading && a < 100 ? /* @__PURE__ */ e(
261
+ ee,
262
+ {
263
+ color: "#999999",
264
+ className: `mr-2 ${k.spinner}`
265
+ }
266
+ ) : n.success || a === 100 ? /* @__PURE__ */ e(G, { color: "#28a745", className: "mr-2" }) : /* @__PURE__ */ e(Z, { color: "#dc3545", className: "mr-2" });
267
+ }, [JSON.stringify(n), a]), C = E(() => i === void 0 || Object.keys(i).length === 0 ? void 0 : st.map((g) => ({
268
+ name: g,
269
+ status: i?.[g]
270
+ })).filter((g) => g.status != "ResourceNotFound").map((g) => /* @__PURE__ */ l("div", { children: [
271
+ g.status ? g.status == !0 ? /* @__PURE__ */ e(G, { color: "#28a745", className: "mr-2" }) : /* @__PURE__ */ e(Z, { color: "#dc3545", className: "mr-2" }) : /* @__PURE__ */ e(
272
+ ee,
273
+ {
274
+ color: "#999999",
275
+ className: `mr-2 ${k.spinner}`
276
+ }
277
+ ),
278
+ /* @__PURE__ */ e("b", { children: `${g.name}: ` }),
279
+ g.status ? g.status == !0 ? "Import successful" : /* @__PURE__ */ e("span", { children: g.status === ge ? "Invalid Client Id and Client Secret" : g.status }) : "Importing..."
280
+ ] })), [JSON.stringify(i)]), j = E(() => {
281
+ if (n)
282
+ return n.isUploading && a < 100 ? /* @__PURE__ */ l(re.Fragment, { children: [
283
+ /* @__PURE__ */ e("b", { children: "Uploading: " }),
284
+ " ",
285
+ a,
286
+ "%"
287
+ ] }) : /* @__PURE__ */ e("b", { children: n.success || a === 100 ? "Upload success" : "Upload fail" });
288
+ }, [JSON.stringify(n), a]), T = E(() => {
289
+ if (n)
290
+ return n.isUploading ? /* @__PURE__ */ e(
291
+ ee,
292
+ {
293
+ color: "#999999",
294
+ className: `mr-2 ${k.spinner}`
295
+ }
296
+ ) : n.success ? /* @__PURE__ */ e(G, { color: "#28a745", className: "mr-2" }) : /* @__PURE__ */ e(Z, { color: "#dc3545", className: "mr-2" });
297
+ }, [JSON.stringify(n)]), f = E(() => {
298
+ if (!n) return;
299
+ const y = n.comment, g = n.importedFiles?.split(",")?.filter((w) => w?.trim()?.length) || [], L = n.rejectedFiles?.split(",")?.filter((w) => w?.trim()?.length) || [];
300
+ return n.isUploading ? /* @__PURE__ */ e("b", { children: "Importing to database..." }) : n.success ? /* @__PURE__ */ l(re.Fragment, { children: [
301
+ /* @__PURE__ */ e("b", { children: "Import to database successful" }),
302
+ /* @__PURE__ */ l("div", { className: `${k["success-block"]}`, children: [
303
+ /* @__PURE__ */ l("div", { children: [
304
+ /* @__PURE__ */ l("div", { className: "mt-1", children: [
305
+ /* @__PURE__ */ e("b", { children: "List imported csv file: " }),
306
+ g.length === 0 && /* @__PURE__ */ e("span", { children: "No File" })
307
+ ] }),
308
+ /* @__PURE__ */ e("ul", { className: `pl-4 ${k["list-block"]}`, children: g.map((w) => /* @__PURE__ */ l("li", { children: [
309
+ /* @__PURE__ */ e(
310
+ G,
311
+ {
312
+ color: "#28a745",
313
+ className: "mr-2"
314
+ }
315
+ ),
316
+ /* @__PURE__ */ e("span", { children: w })
317
+ ] })) })
318
+ ] }),
319
+ /* @__PURE__ */ l("div", { className: `${k["middle-block"]}`, children: [
320
+ /* @__PURE__ */ l("div", { children: [
321
+ /* @__PURE__ */ e("b", { children: "List rejected csv file: " }),
322
+ L.length === 0 && /* @__PURE__ */ e("span", { children: "No File" })
323
+ ] }),
324
+ /* @__PURE__ */ e("ul", { className: `pl-4 ${k["list-block"]}`, children: L.map((w) => /* @__PURE__ */ l("li", { children: [
325
+ /* @__PURE__ */ e(
326
+ Z,
327
+ {
328
+ color: "#dc3545",
329
+ className: "mr-2"
330
+ }
331
+ ),
332
+ /* @__PURE__ */ e("span", { children: w })
333
+ ] })) })
334
+ ] }),
335
+ y && /* @__PURE__ */ l("div", { children: [
336
+ /* @__PURE__ */ e("b", { children: "Comment: " }),
337
+ /* @__PURE__ */ e("span", { children: y })
338
+ ] })
339
+ ] })
340
+ ] }) : /* @__PURE__ */ l(re.Fragment, { children: [
341
+ /* @__PURE__ */ l("b", { children: [
342
+ "Import to database fail",
343
+ !!n.error && ": "
344
+ ] }),
345
+ n.error
346
+ ] });
347
+ }, [JSON.stringify(n)]);
348
+ return {
349
+ inputRef: r,
350
+ fileProgress: a,
351
+ uploadInfo: n,
352
+ uploadIcon: b,
353
+ uploadMessage: j,
354
+ importIcon: T,
355
+ importMessage: f,
356
+ restApiInfo: i,
357
+ restApiProgress: C,
358
+ setFileProgress: h,
359
+ handleFileChange: S,
360
+ importRosterZipFile: u,
361
+ handleChooseZipFile: v,
362
+ handleImportFromRestfulApi: c
363
+ };
364
+ }, fe = ({ errorImportRest: t, type: o }) => {
365
+ const {
366
+ restApiProgress: s,
367
+ handleImportFromRestfulApi: r
368
+ } = ot({ errorImportRest: t, type: o }), { t: a } = x();
369
+ return /* @__PURE__ */ l(U, { children: [
370
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ e("h5", { className: "mt-4", style: { fontWeight: 700 }, children: a("import_one_roster") }) }),
371
+ /* @__PURE__ */ l(m, { md: 6, children: [
372
+ /* @__PURE__ */ e(
373
+ q,
374
+ {
375
+ color: "primary",
376
+ className: "w-100 mt-4 mb-1",
377
+ onClick: r,
378
+ children: a("import_from_restful_api")
379
+ }
380
+ ),
381
+ /* @__PURE__ */ e("div", { className: "mt-2", children: s })
382
+ ] })
383
+ ] });
384
+ }, lt = {
385
+ cronjobTime: "",
386
+ clientId: "",
387
+ clientSecret: "",
388
+ endPointUrl: "",
389
+ oneRosterVersion: "1.1"
390
+ }, Ce = (t) => {
391
+ const o = z(), [s, r] = I(lt), a = O(async (d = !0) => {
392
+ d && o(N(!0));
393
+ try {
394
+ const i = await Me(t);
395
+ r(i.data);
396
+ } catch (i) {
397
+ d && o(
398
+ _({
399
+ type: "danger",
400
+ message: i.response?.data?.title || i.message
401
+ })
402
+ );
403
+ }
404
+ d && o(N(!1));
405
+ }, []), h = O(async (d) => {
406
+ o(N(!0));
407
+ try {
408
+ const i = await qe(d, t);
409
+ r(i.data), await a(!1), o(
410
+ _({
411
+ type: "success",
412
+ message: "Update Roster config successfully"
413
+ })
414
+ );
415
+ } catch (i) {
416
+ o(
417
+ _({
418
+ type: "danger",
419
+ message: i.response?.data?.title || i.message
420
+ })
421
+ );
422
+ }
423
+ o(N(!1));
424
+ }, []), n = E(
425
+ () => !s.clientId.trim().length && !s.clientSecret.trim().length && !s.endPointUrl.trim().length ? "Client Id and Client Secret are required" : s.endPointUrl.trim().length ? s.clientId.trim().length ? s.clientSecret.trim().length ? null : "Client Secret is required" : "Client Id is required" : "End Point URL is required",
426
+ [JSON.stringify(s)]
427
+ );
428
+ return Y(() => {
429
+ document.title = "OneRoster | Settings", a();
430
+ }, [t]), {
431
+ rosterConfig: s,
432
+ errorImportRest: n,
433
+ updateData: h
434
+ };
435
+ }, ct = () => {
436
+ const {
437
+ rosterConfig: t,
438
+ errorImportRest: o,
439
+ updateData: s
440
+ } = Ce($.ClassLink);
441
+ return /* @__PURE__ */ e("div", { className: "fadeIn animated", children: /* @__PURE__ */ l(U, { children: [
442
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ e(
443
+ me,
444
+ {
445
+ rosterConfig: t,
446
+ updateData: s,
447
+ type: $.ClassLink
448
+ }
449
+ ) }),
450
+ /* @__PURE__ */ e(m, { md: 5 }),
451
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ e(
452
+ fe,
453
+ {
454
+ errorImportRest: o,
455
+ type: $.ClassLink
456
+ }
457
+ ) })
458
+ ] }) });
459
+ }, dt = () => {
460
+ const t = z(), [o, s] = I([]), [r, a] = I(nt), [h, n] = I(0), [d, i] = I(!1), [c, u] = I([]), [v, R] = I([]), [S, b] = I(), C = (p) => {
461
+ const A = {
462
+ ...r,
463
+ ...p
464
+ };
465
+ A.searchString && p.searchString && p.searchString != r.searchString && (A.currentPage = 1), a(A);
466
+ }, j = O((p) => {
467
+ p !== r.sortBy ? C({
468
+ sortBy: p,
469
+ orderBy: "ASC",
470
+ currentPage: 1
471
+ }) : C({
472
+ sortBy: p,
473
+ orderBy: r.orderBy !== "DESC" ? "DESC" : "ASC",
474
+ currentPage: 1
475
+ });
476
+ }, [JSON.stringify(r)]), T = async () => {
477
+ t(N(!0));
478
+ try {
479
+ const p = await Ze(r);
480
+ s(p?.data?.items), n(p?.data?.totalItems);
481
+ } catch (p) {
482
+ t(
483
+ _({
484
+ type: "danger",
485
+ message: p.response?.data?.title || p.message
486
+ })
487
+ );
488
+ }
489
+ t(N(!1));
490
+ }, f = async () => {
491
+ t(N(!0));
492
+ try {
493
+ const p = await Ue({
494
+ sortBy: "Email"
495
+ });
496
+ R(p?.data?.map((A) => ({
497
+ label: A.email,
498
+ value: A.id
499
+ })));
500
+ } catch (p) {
501
+ t(
502
+ _({
503
+ type: "danger",
504
+ message: p.response?.data?.title || p.message
505
+ })
506
+ );
507
+ }
508
+ t(N(!1));
509
+ }, y = O((p, A) => {
510
+ let W = v.find((D) => D.value === p);
511
+ b({
512
+ ...S,
513
+ [A]: W
514
+ });
515
+ }, [JSON.stringify(S), JSON.stringify(v)]), g = () => {
516
+ i(!d), u(o.map((p) => p.sourcedId)), d && u([]);
517
+ }, L = (p) => {
518
+ const { id: A, checked: W } = p.target;
519
+ u([...c, A]), W || u(c.filter((D) => D !== A));
520
+ }, w = (p) => `${p.givenName || ""} ${p.middleName || ""} ${p.familyName || ""}`.replaceAll(" ", " ").trim(), J = O((p, A) => {
521
+ R([
522
+ ...v,
523
+ p
524
+ ]), b({
525
+ ...S,
526
+ [A]: p
527
+ });
528
+ }, [JSON.stringify(v), JSON.stringify(S)]), H = O(() => {
529
+ r.currentPage == 1 ? T() : C({ currentPage: 1 }), u([]), b(void 0), i(!1);
530
+ }, [JSON.stringify(r)]);
531
+ return Y(() => {
532
+ T();
533
+ }, [JSON.stringify(r)]), Y(() => {
534
+ document.title = "OneRoster | Users", f();
535
+ }, []), {
536
+ handelSort: j,
537
+ handelRetrievedData: H,
538
+ handleCreateTeacherOption: J,
539
+ selectedTeachers: S,
540
+ handleSelectTeacher: y,
541
+ teachers: v,
542
+ getFullName: w,
543
+ totalItem: h,
544
+ userList: o,
545
+ filters: r,
546
+ changeFilters: C,
547
+ handleSelectAll: g,
548
+ handleClickCheck: L,
549
+ isCheckAll: d,
550
+ isCheck: c
551
+ };
552
+ }, mt = (t, o) => {
553
+ const s = z(), r = async (n) => {
554
+ s(N(!0));
555
+ try {
556
+ await Ye(n), s(
557
+ _({
558
+ type: "success",
559
+ message: "Create Successfully"
560
+ })
561
+ ), o?.();
562
+ } catch (d) {
563
+ s(
564
+ _({
565
+ type: "danger",
566
+ message: d.response?.data?.title || d.message
567
+ })
568
+ );
569
+ }
570
+ s(N(!1));
571
+ };
572
+ return {
573
+ handleCreateMultiUsers: (n, d) => {
574
+ if (n.length === 0) {
575
+ s(
576
+ _({
577
+ type: "danger",
578
+ message: "Not found selected user."
579
+ })
580
+ );
581
+ return;
582
+ }
583
+ if (n.some((u) => {
584
+ const v = t.find((b) => b.sourcedId == u), R = d?.[u];
585
+ return !!(v?.role?.includes?.("student") && !R);
586
+ })) {
587
+ s(
588
+ _({
589
+ type: "danger",
590
+ message: "Please select/add teacher for all selected student first."
591
+ })
592
+ );
593
+ return;
594
+ }
595
+ const c = n.map((u) => {
596
+ const v = d?.[u], R = {
597
+ sourcedId: u
598
+ };
599
+ if (v) {
600
+ const S = v?.value && typeof v?.value == "string" ? v?.value : void 0, b = v?.value && typeof v?.value == "number" ? v?.label : void 0;
601
+ R.teacherEmail = b, R.teacherUserId = S;
602
+ }
603
+ return R;
604
+ });
605
+ r([...c]);
606
+ },
607
+ handleCreateSingleUser: (n, d, i) => {
608
+ if (!i && d) {
609
+ s(
610
+ _({
611
+ type: "danger",
612
+ message: "Please select/add teacher for all selected student first."
613
+ })
614
+ );
615
+ return;
616
+ }
617
+ const c = i?.value && typeof i?.value == "string" ? i?.value : void 0, u = i?.value && typeof i?.value == "number" ? i?.label : void 0;
618
+ r([
619
+ {
620
+ sourcedId: n,
621
+ teacherUserId: c,
622
+ teacherEmail: u
623
+ }
624
+ ]);
625
+ }
626
+ };
627
+ };
628
+ var ut = ["allowCreateWhileLoading", "createOptionPosition", "formatCreateLabel", "isValidNewOption", "getNewOptionData", "onCreateOption", "options", "onChange"], ce = function() {
629
+ var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", s = arguments.length > 1 ? arguments[1] : void 0, r = arguments.length > 2 ? arguments[2] : void 0, a = String(o).toLowerCase(), h = String(r.getOptionValue(s)).toLowerCase(), n = String(r.getOptionLabel(s)).toLowerCase();
630
+ return h === a || n === a;
631
+ }, ae = {
632
+ formatCreateLabel: function(o) {
633
+ return 'Create "'.concat(o, '"');
634
+ },
635
+ isValidNewOption: function(o, s, r, a) {
636
+ return !(!o || s.some(function(h) {
637
+ return ce(o, h, a);
638
+ }) || r.some(function(h) {
639
+ return ce(o, h, a);
640
+ }));
641
+ },
642
+ getNewOptionData: function(o, s) {
643
+ return {
644
+ label: s,
645
+ value: o,
646
+ __isNew__: !0
647
+ };
648
+ }
649
+ };
650
+ function pt(t) {
651
+ var o = t.allowCreateWhileLoading, s = o === void 0 ? !1 : o, r = t.createOptionPosition, a = r === void 0 ? "last" : r, h = t.formatCreateLabel, n = h === void 0 ? ae.formatCreateLabel : h, d = t.isValidNewOption, i = d === void 0 ? ae.isValidNewOption : d, c = t.getNewOptionData, u = c === void 0 ? ae.getNewOptionData : c, v = t.onCreateOption, R = t.options, S = R === void 0 ? [] : R, b = t.onChange, C = ke(t, ut), j = C.getOptionValue, T = j === void 0 ? $e : j, f = C.getOptionLabel, y = f === void 0 ? Ee : f, g = C.inputValue, L = C.isLoading, w = C.isMulti, J = C.value, H = C.name, p = E(function() {
652
+ return i(g, oe(J), S, {
653
+ getOptionValue: T,
654
+ getOptionLabel: y
655
+ }) ? u(g, n(g)) : void 0;
656
+ }, [n, u, y, T, g, i, S, J]), A = E(function() {
657
+ return (s || !L) && p ? a === "first" ? [p].concat(ne(S)) : [].concat(ne(S), [p]) : S;
658
+ }, [s, a, L, p, S]), W = O(function(D, te) {
659
+ if (te.action !== "select-option")
660
+ return b(D, te);
661
+ var ie = Array.isArray(D) ? D : [D];
662
+ if (ie[ie.length - 1] === p) {
663
+ if (v) v(g);
664
+ else {
665
+ var se = u(g, g), ve = {
666
+ action: "create-option",
667
+ name: H,
668
+ option: se
669
+ };
670
+ b(Fe(w, [].concat(ne(oe(J)), [se]), se), ve);
671
+ }
672
+ return;
673
+ }
674
+ b(D, te);
675
+ }, [u, g, w, H, p, v, b, J]);
676
+ return le(le({}, C), {}, {
677
+ options: A,
678
+ onChange: W
679
+ });
680
+ }
681
+ var ht = /* @__PURE__ */ Le(function(t, o) {
682
+ var s = Te(t), r = pt(s);
683
+ return /* @__PURE__ */ Ae.createElement(De, Pe({
684
+ ref: o
685
+ }, r));
686
+ }), gt = ht;
687
+ const ft = ({
688
+ options: t,
689
+ isDisabled: o,
690
+ scrollBottom: s,
691
+ onCreateOption: r,
692
+ ...a
693
+ }) => {
694
+ const [h, n] = I(), d = (u) => String(u).toLowerCase().match(
695
+ /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
696
+ );
697
+ return /* @__PURE__ */ l("div", { className: "w-100", children: [
698
+ /* @__PURE__ */ e("div", { className: "w-100", children: /* @__PURE__ */ e(
699
+ gt,
700
+ {
701
+ isDisabled: o,
702
+ options: t,
703
+ menuPlacement: s ? "top" : "auto",
704
+ onCreateOption: (u) => {
705
+ if (d(u))
706
+ n(void 0);
707
+ else {
708
+ n(`Invalid email format for email: ${u}`);
709
+ return;
710
+ }
711
+ const v = {
712
+ label: u,
713
+ value: -(/* @__PURE__ */ new Date()).getTime()
714
+ };
715
+ r?.(v);
716
+ },
717
+ onFocus: () => {
718
+ n(void 0);
719
+ },
720
+ ...a
721
+ }
722
+ ) }),
723
+ !!h && /* @__PURE__ */ e("p", { className: "text-danger mb-0 mt-1", children: h })
724
+ ] });
725
+ }, Ct = () => {
726
+ const {
727
+ handelSort: t,
728
+ handelRetrievedData: o,
729
+ handleCreateTeacherOption: s,
730
+ selectedTeachers: r,
731
+ handleSelectTeacher: a,
732
+ teachers: h,
733
+ getFullName: n,
734
+ userList: d,
735
+ totalItem: i,
736
+ changeFilters: c,
737
+ filters: u,
738
+ handleSelectAll: v,
739
+ handleClickCheck: R,
740
+ isCheckAll: S,
741
+ isCheck: b
742
+ } = dt(), { t: C } = x(), { handleCreateMultiUsers: j, handleCreateSingleUser: T } = mt(d, o);
743
+ return /* @__PURE__ */ l("div", { className: "fadeIn animated", children: [
744
+ /* @__PURE__ */ e("h5", { className: "mt-4 mb-2", children: C("non_existent_users") }),
745
+ /* @__PURE__ */ l(U, { className: "my-2", children: [
746
+ /* @__PURE__ */ e(m, { md: 8, children: /* @__PURE__ */ e(
747
+ _e,
748
+ {
749
+ initValue: u?.searchString || "",
750
+ onSearch: (f) => c({ searchString: f }),
751
+ placeholder: C("type_something_to_search_users")
752
+ }
753
+ ) }),
754
+ /* @__PURE__ */ l(
755
+ m,
756
+ {
757
+ md: 4,
758
+ className: "d-flex justify-content-end align-items-center",
759
+ children: [
760
+ C("total_of_users"),
761
+ ": ",
762
+ i
763
+ ]
764
+ }
765
+ )
766
+ ] }),
767
+ /* @__PURE__ */ e(U, { className: "mb-2", children: /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e(q, { onClick: () => j(b, r), color: "primary", children: C("create_account_for_selected_users") }) }) }),
768
+ /* @__PURE__ */ l(U, { className: "mb-2", children: [
769
+ /* @__PURE__ */ e(m, { md: 12, children: d && d.length > 0 ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ l(Re, { bordered: !0, hover: !0, striped: !0, responsive: !0, size: "sm", children: [
770
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { children: [
771
+ /* @__PURE__ */ e("th", { className: "align-middle", children: /* @__PURE__ */ e(
772
+ "input",
773
+ {
774
+ type: "checkbox",
775
+ onChange: v,
776
+ checked: S
777
+ }
778
+ ) }),
779
+ /* @__PURE__ */ l("th", { className: `align-top ${k.pointer}`, onClick: () => t(M.USERNAME), children: [
780
+ C("user_name"),
781
+ u.sortBy === M.USERNAME && /* @__PURE__ */ e(K, { children: u.orderBy === "DESC" ? /* @__PURE__ */ e(Q, { className: "ml-1" }) : /* @__PURE__ */ e(X, { className: "ml-1" }) })
782
+ ] }),
783
+ /* @__PURE__ */ l("th", { className: `align-top ${k.pointer}`, onClick: () => t(M.EMAIL), children: [
784
+ C("user_email"),
785
+ u.sortBy === M.EMAIL && /* @__PURE__ */ e(K, { children: u.orderBy === "DESC" ? /* @__PURE__ */ e(Q, { className: "ml-1" }) : /* @__PURE__ */ e(X, { className: "ml-1" }) })
786
+ ] }),
787
+ /* @__PURE__ */ l("th", { className: `align-top ${k.pointer}`, onClick: () => t(M.ROLE), children: [
788
+ C("role"),
789
+ u.sortBy === M.ROLE && /* @__PURE__ */ e(K, { children: u.orderBy === "DESC" ? /* @__PURE__ */ e(Q, { className: "ml-1" }) : /* @__PURE__ */ e(X, { className: "ml-1" }) })
790
+ ] }),
791
+ /* @__PURE__ */ l("th", { className: `align-top ${k.pointer}`, onClick: () => t(M.GRADE), children: [
792
+ C("grade"),
793
+ u.sortBy === M.GRADE && /* @__PURE__ */ e(K, { children: u.orderBy === "DESC" ? /* @__PURE__ */ e(Q, { className: "ml-1" }) : /* @__PURE__ */ e(X, { className: "ml-1" }) })
794
+ ] }),
795
+ /* @__PURE__ */ e("th", { className: "align-top", children: C("action") })
796
+ ] }) }),
797
+ /* @__PURE__ */ e("tbody", { children: d.map((f) => /* @__PURE__ */ l("tr", { children: [
798
+ /* @__PURE__ */ e("td", { className: "align-middle", children: /* @__PURE__ */ e(
799
+ "input",
800
+ {
801
+ id: f.sourcedId,
802
+ type: "checkbox",
803
+ onChange: R,
804
+ checked: b.includes(
805
+ f.sourcedId
806
+ )
807
+ }
808
+ ) }),
809
+ /* @__PURE__ */ e("td", { className: "align-middle", children: n(f) }),
810
+ /* @__PURE__ */ e("td", { className: "align-middle", children: f.email }),
811
+ /* @__PURE__ */ e("td", { className: "align-middle text-capitalize", children: !!f.role && f.role.replace?.("SecondaryTeacher", "SupportTeacher") }),
812
+ /* @__PURE__ */ e("td", { className: "align-middle", children: f.grades }),
813
+ /* @__PURE__ */ e(
814
+ "td",
815
+ {
816
+ className: "align-middle",
817
+ style: {
818
+ width: "30%"
819
+ },
820
+ children: f.email?.trim() && /* @__PURE__ */ l("div", { className: "d-flex", children: [
821
+ f.role?.includes?.("student") && /* @__PURE__ */ e(
822
+ ft,
823
+ {
824
+ value: r?.[f.sourcedId] || null,
825
+ options: h,
826
+ onChange: (y) => a(y.value, f.sourcedId),
827
+ onCreateOption: (y) => s(y, f.sourcedId),
828
+ placeholder: C("select_teacher"),
829
+ className: "flex-grow-1 mr-2"
830
+ }
831
+ ),
832
+ /* @__PURE__ */ e(
833
+ Se,
834
+ {
835
+ label: C("create"),
836
+ onClick: () => T(
837
+ f.sourcedId,
838
+ f.role?.includes("student"),
839
+ r?.[f.sourcedId]
840
+ )
841
+ }
842
+ )
843
+ ] })
844
+ }
845
+ )
846
+ ] }, f.id)) })
847
+ ] }) }) : /* @__PURE__ */ e(be, { label: C("user") }) }),
848
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ e(
849
+ Ie,
850
+ {
851
+ filters: u,
852
+ totalRecordCount: i,
853
+ changePageSize: (f) => c({ pageSize: f }),
854
+ changePage: (f) => c({ currentPage: f })
855
+ }
856
+ ) })
857
+ ] })
858
+ ] });
859
+ }, ye = ({ veraCrossConfig: t, updateData: o, labelTime: s = "time_vera_cross_sync_hh" }) => {
860
+ const { t: r } = x();
861
+ return /* @__PURE__ */ e(
862
+ de,
863
+ {
864
+ initialValues: t,
865
+ enableReinitialize: !0,
866
+ onSubmit: (a) => {
867
+ o(a);
868
+ },
869
+ children: (a) => {
870
+ const {
871
+ values: h,
872
+ handleChange: n,
873
+ handleBlur: d,
874
+ handleSubmit: i
875
+ } = a;
876
+ return /* @__PURE__ */ l(U, { children: [
877
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ e("h5", { className: "mt-4 font-weight-bold", children: r("one_roster_config") }) }),
878
+ /* @__PURE__ */ l(m, { md: 12, className: "my-4 mt-2", children: [
879
+ /* @__PURE__ */ e(V, { className: "font-weight-bold", children: r(s) }),
880
+ /* @__PURE__ */ e(
881
+ B,
882
+ {
883
+ name: "cronjobTime",
884
+ placeholder: r(s),
885
+ value: h.cronjobTime,
886
+ onChange: (c) => {
887
+ n(c);
888
+ },
889
+ onBlur: d("cronjobTime")
890
+ }
891
+ )
892
+ ] }),
893
+ /* @__PURE__ */ l(m, { md: 12, className: "my-4 mt-2", children: [
894
+ /* @__PURE__ */ l(V, { className: "font-weight-bold", children: [
895
+ r("end_point_url"),
896
+ ":"
897
+ ] }),
898
+ /* @__PURE__ */ e(
899
+ B,
900
+ {
901
+ name: "endPointUrl",
902
+ placeholder: r("end_point_url"),
903
+ value: h.endPointUrl,
904
+ onChange: (c) => {
905
+ n(c);
906
+ },
907
+ onBlur: d("endPointUrl")
908
+ }
909
+ )
910
+ ] }),
911
+ /* @__PURE__ */ l(m, { md: 12, className: "mb-4 mt-2", children: [
912
+ /* @__PURE__ */ l(V, { className: "font-weight-bold", children: [
913
+ r("client_id"),
914
+ ":"
915
+ ] }),
916
+ /* @__PURE__ */ e(
917
+ B,
918
+ {
919
+ name: "clientId",
920
+ placeholder: r("client_id"),
921
+ value: h.clientId,
922
+ onChange: (c) => {
923
+ n(c);
924
+ },
925
+ onBlur: d("clientId")
926
+ }
927
+ )
928
+ ] }),
929
+ /* @__PURE__ */ l(m, { md: 12, className: "mb-4", children: [
930
+ /* @__PURE__ */ l(V, { className: "font-weight-bold", children: [
931
+ r("client_secret"),
932
+ ":"
933
+ ] }),
934
+ /* @__PURE__ */ e(
935
+ B,
936
+ {
937
+ name: "clientSecret",
938
+ placeholder: r("client_secret"),
939
+ value: h.clientSecret,
940
+ onChange: (c) => {
941
+ n(c);
942
+ },
943
+ onBlur: d("clientSecret")
944
+ }
945
+ )
946
+ ] }),
947
+ /* @__PURE__ */ e(m, { md: 12, className: "d-flex justify-content-end", children: /* @__PURE__ */ e(
948
+ q,
949
+ {
950
+ onClick: () => i(),
951
+ color: "success",
952
+ children: r("save")
953
+ }
954
+ ) })
955
+ ] });
956
+ }
957
+ }
958
+ );
959
+ }, yt = {
960
+ cronjobTime: "",
961
+ clientId: "",
962
+ clientSecret: "",
963
+ endPointUrl: ""
964
+ }, Nt = () => {
965
+ const t = z(), [o] = I(), [s, r] = I(
966
+ yt
967
+ ), a = O(async (i = !0) => {
968
+ i && t(N(!0));
969
+ try {
970
+ const c = await xe();
971
+ r(c.data);
972
+ } catch (c) {
973
+ i && t(
974
+ _({
975
+ type: "danger",
976
+ message: c.response?.data?.title || c.message
977
+ })
978
+ );
979
+ }
980
+ i && t(N(!1));
981
+ }, []), h = O(async (i) => {
982
+ t(N(!0));
983
+ try {
984
+ const c = await Je(i);
985
+ r(c.data), await a(!1), t(
986
+ _({
987
+ type: "success",
988
+ message: "Update vera cross config successfully"
989
+ })
990
+ );
991
+ } catch (c) {
992
+ t(
993
+ _({
994
+ type: "danger",
995
+ message: c.response?.data?.title || c.message
996
+ })
997
+ );
998
+ }
999
+ t(N(!1));
1000
+ }, []), n = E(() => !s.clientId.trim().length && !s.clientSecret.trim().length && !s.endPointUrl.trim().length ? "Client Id and Client Secret are required" : s.endPointUrl.trim().length ? s.clientId.trim().length ? s.clientSecret.trim().length ? null : "Client Secret is required" : "Client Id is required" : "End Point URL is required", [JSON.stringify(s)]), d = O(async () => {
1001
+ if (n) {
1002
+ t(
1003
+ _({
1004
+ type: "danger",
1005
+ message: `${n} (Please make sure your changes are saved)`
1006
+ })
1007
+ );
1008
+ return;
1009
+ }
1010
+ t(N(!0));
1011
+ try {
1012
+ const i = await Qe();
1013
+ t(
1014
+ _({
1015
+ type: "success",
1016
+ message: i.data?.message || "VeraCross sync job has been triggered in the background. Please wait a few moments before refreshing the page."
1017
+ })
1018
+ );
1019
+ } catch (i) {
1020
+ t(
1021
+ _({
1022
+ type: "danger",
1023
+ message: i.response?.data?.message || i.response?.data?.title || i.message
1024
+ })
1025
+ );
1026
+ }
1027
+ t(N(!1));
1028
+ }, [n, t]);
1029
+ return Y(() => {
1030
+ document.title = "Veracross | Settings", a();
1031
+ }, []), {
1032
+ veraCrossConfig: s,
1033
+ errorImportRest: n,
1034
+ updateData: h,
1035
+ restApiInfo: o,
1036
+ handleImportFromRestfulApi: d
1037
+ };
1038
+ }, Ne = ({
1039
+ restApiInfo: t,
1040
+ importInfo: o
1041
+ }) => {
1042
+ if (!t) return null;
1043
+ const r = o.map((a) => ({
1044
+ name: a,
1045
+ status: t[a]
1046
+ })).filter((a) => a.status !== "ResourceNotFound");
1047
+ return /* @__PURE__ */ e("div", { children: r.map((a) => /* @__PURE__ */ l("div", { className: "flex items-center mb-2", children: [
1048
+ a.status ? a.status === !0 ? /* @__PURE__ */ e(G, { color: "#28a745", className: "mr-2" }) : /* @__PURE__ */ e(Z, { color: "#dc3545", className: "mr-2" }) : /* @__PURE__ */ e(
1049
+ ee,
1050
+ {
1051
+ color: "#999999",
1052
+ className: `mr-2 ${k.spinner}`
1053
+ }
1054
+ ),
1055
+ /* @__PURE__ */ e("b", { children: `${a.name}: ` }),
1056
+ " ",
1057
+ a.status ? a.status === !0 ? "Import successful" : /* @__PURE__ */ e("span", { children: a.status === ge ? "Invalid Client Id and Client Secret" : a.status }) : "Importing..."
1058
+ ] }, a.name)) });
1059
+ }, vt = () => {
1060
+ const {
1061
+ veraCrossConfig: t,
1062
+ updateData: o,
1063
+ restApiInfo: s,
1064
+ handleImportFromRestfulApi: r
1065
+ } = Nt(), { t: a } = x();
1066
+ return /* @__PURE__ */ e("div", { className: "fadeIn animated", children: /* @__PURE__ */ l(U, { children: [
1067
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ e(
1068
+ ye,
1069
+ {
1070
+ veraCrossConfig: t,
1071
+ updateData: o
1072
+ }
1073
+ ) }),
1074
+ /* @__PURE__ */ e(m, { md: 5 }),
1075
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ l(U, { children: [
1076
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ e("h5", { className: "mt-4", style: { fontWeight: 700 }, children: a("import_vera_cross") }) }),
1077
+ /* @__PURE__ */ e(m, { md: 6 }),
1078
+ /* @__PURE__ */ l(m, { md: 6, children: [
1079
+ /* @__PURE__ */ e(
1080
+ q,
1081
+ {
1082
+ color: "primary",
1083
+ className: "w-100 mt-4 mb-1",
1084
+ onClick: r,
1085
+ children: a("import_from_restful_api")
1086
+ }
1087
+ ),
1088
+ /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(Ne, { restApiInfo: s, importInfo: at }) })
1089
+ ] })
1090
+ ] }) })
1091
+ ] }) });
1092
+ }, _t = {
1093
+ cronjobTime: "",
1094
+ clientId: "",
1095
+ clientSecret: "",
1096
+ endPointUrl: ""
1097
+ }, St = () => {
1098
+ const t = z(), [o] = I(), [s, r] = I(
1099
+ _t
1100
+ ), a = O(async (i = !0) => {
1101
+ i && t(N(!0));
1102
+ try {
1103
+ const c = await ze();
1104
+ r(c.data);
1105
+ } catch (c) {
1106
+ i && t(
1107
+ _({
1108
+ type: "danger",
1109
+ message: c.response?.data?.title || c.message
1110
+ })
1111
+ );
1112
+ }
1113
+ i && t(N(!1));
1114
+ }, []), h = O(async (i) => {
1115
+ t(N(!0));
1116
+ try {
1117
+ const c = await We(i);
1118
+ r(c.data), await a(!1), t(
1119
+ _({
1120
+ type: "success",
1121
+ message: "Update vera cross config successfully"
1122
+ })
1123
+ );
1124
+ } catch (c) {
1125
+ t(
1126
+ _({
1127
+ type: "danger",
1128
+ message: c.response?.data?.title || c.message
1129
+ })
1130
+ );
1131
+ }
1132
+ t(N(!1));
1133
+ }, []), n = E(() => !s.clientId.trim().length && !s.clientSecret.trim().length && !s.endPointUrl.trim().length ? "Client Id and Client Secret are required" : s.endPointUrl.trim().length ? s.clientId.trim().length ? s.clientSecret.trim().length ? null : "Client Secret is required" : "Client Id is required" : "End Point URL is required", [JSON.stringify(s)]), d = O(async () => {
1134
+ if (n) {
1135
+ t(
1136
+ _({
1137
+ type: "danger",
1138
+ message: `${n} (Please make sure your changes are saved)`
1139
+ })
1140
+ );
1141
+ return;
1142
+ }
1143
+ t(N(!0));
1144
+ try {
1145
+ const i = await Xe();
1146
+ t(
1147
+ _({
1148
+ type: "success",
1149
+ message: i.data?.message || "OpenApply sync job has been triggered in the background. Please wait a few moments before refreshing the page."
1150
+ })
1151
+ );
1152
+ } catch (i) {
1153
+ t(
1154
+ _({
1155
+ type: "danger",
1156
+ message: i.response?.data?.message || i.response?.data?.title || i.message
1157
+ })
1158
+ );
1159
+ }
1160
+ t(N(!1));
1161
+ }, [n, t]);
1162
+ return Y(() => {
1163
+ document.title = "Open Apply | Settings", a();
1164
+ }, []), {
1165
+ openApplyConfig: s,
1166
+ errorImportRest: n,
1167
+ updateData: h,
1168
+ restApiInfo: o,
1169
+ handleImportFromRestfulApi: d
1170
+ };
1171
+ }, bt = () => {
1172
+ const {
1173
+ openApplyConfig: t,
1174
+ updateData: o,
1175
+ restApiInfo: s,
1176
+ handleImportFromRestfulApi: r
1177
+ } = St(), { t: a } = x();
1178
+ return /* @__PURE__ */ e("div", { className: "fadeIn animated", children: /* @__PURE__ */ l(U, { children: [
1179
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ e(
1180
+ ye,
1181
+ {
1182
+ veraCrossConfig: t,
1183
+ updateData: o,
1184
+ labelTime: "time_open_apply_sync_hh"
1185
+ }
1186
+ ) }),
1187
+ /* @__PURE__ */ e(m, { md: 5 }),
1188
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ l(U, { children: [
1189
+ /* @__PURE__ */ e(m, { md: 12, children: /* @__PURE__ */ e("h5", { className: "mt-4", style: { fontWeight: 700 }, children: a("import_open_apply") }) }),
1190
+ /* @__PURE__ */ e(m, { md: 6 }),
1191
+ /* @__PURE__ */ l(m, { md: 6, children: [
1192
+ /* @__PURE__ */ e(
1193
+ q,
1194
+ {
1195
+ color: "primary",
1196
+ className: "w-100 mt-4 mb-1",
1197
+ onClick: r,
1198
+ children: a("import_from_restful_api")
1199
+ }
1200
+ ),
1201
+ /* @__PURE__ */ e("div", { className: "mt-2", children: /* @__PURE__ */ e(
1202
+ Ne,
1203
+ {
1204
+ restApiInfo: s,
1205
+ importInfo: it
1206
+ }
1207
+ ) })
1208
+ ] })
1209
+ ] }) })
1210
+ ] }) });
1211
+ }, It = () => {
1212
+ const {
1213
+ rosterConfig: t,
1214
+ errorImportRest: o,
1215
+ updateData: s
1216
+ } = Ce($.Clever);
1217
+ return /* @__PURE__ */ e("div", { className: "fadeIn animated", children: /* @__PURE__ */ l(U, { children: [
1218
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ e(
1219
+ me,
1220
+ {
1221
+ rosterConfig: t,
1222
+ updateData: s,
1223
+ type: $.Clever
1224
+ }
1225
+ ) }),
1226
+ /* @__PURE__ */ e(m, { md: 5 }),
1227
+ /* @__PURE__ */ e(m, { md: 7, children: /* @__PURE__ */ e(
1228
+ fe,
1229
+ {
1230
+ errorImportRest: o,
1231
+ type: $.Clever
1232
+ }
1233
+ ) })
1234
+ ] }) });
1235
+ }, Ot = [
1236
+ {
1237
+ path: "/admin/one-rosters/settings-classlink",
1238
+ title: "one_roster_setting",
1239
+ component: ct
1240
+ },
1241
+ {
1242
+ path: "/admin/one-rosters/settings-clever",
1243
+ title: "clever_setting",
1244
+ component: It
1245
+ },
1246
+ {
1247
+ path: "/admin/one-rosters/veracross-settings",
1248
+ title: "veracross_setting",
1249
+ component: vt
1250
+ },
1251
+ {
1252
+ path: "/admin/one-rosters/open-apply",
1253
+ title: "open_apply_setting",
1254
+ component: bt
1255
+ },
1256
+ {
1257
+ path: "/admin/one-rosters/users",
1258
+ title: "users",
1259
+ component: Ct
1260
+ }
1261
+ ], Rt = "one_roster", jt = () => {
1262
+ const { t } = x();
1263
+ return /* @__PURE__ */ e(Oe, { title: t(Rt), tabs: Ot.map((o) => ({ ...o, title: t(o.title) })) });
1264
+ };
1265
+ export {
1266
+ jt as default
1267
+ };