mario-education 2.0.168-staging → 2.0.170-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.
- package/dist/CreateSurveyAdminV2-547xST7c.js +2489 -0
- package/dist/CreateSurveyAdminV2-Xig-sxO4.cjs +1 -0
- package/dist/containers/SurveyDashboard/components/CreateSurveyV2/SelectStudentsStep.d.ts +2 -0
- package/dist/containers/SurveyDashboard/hooks/useSelectStudentsStep.d.ts +2 -0
- package/dist/containers/SurveyDashboard/types/createSurveyV2.types.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/index.modern.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,2489 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as Se } from "react/jsx-runtime";
|
|
2
|
+
import { useState as O, useCallback as ze, useEffect as ge, useMemo as M, useRef as ht } from "react";
|
|
3
|
+
import { Box as r, Button as G, Stack as W, Typography as m, Chip as Ee, Grid as Pe, TableContainer as gt, Table as Ne, TableHead as ve, TableRow as V, TableCell as T, TableBody as Te, TextField as ee, FormControl as oe, Select as ce, MenuItem as de, InputAdornment as pt, Checkbox as Le, TableSortLabel as ie, TablePagination as ft, Tooltip as We, tooltipClasses as we, styled as _t, Dialog as yt, DialogTitle as bt, IconButton as Ct, DialogContent as St, FormControlLabel as be, RadioGroup as Nt, Radio as Re, Avatar as vt } from "@mui/material";
|
|
4
|
+
import { useDispatch as Qe, useSelector as Oe } from "react-redux";
|
|
5
|
+
import { useNavigate as Me } from "react-router-dom";
|
|
6
|
+
import qe from "moment";
|
|
7
|
+
import { setLoading as se, setAlert as me, getFileUrl as Tt, getStaticFileUrl as wt } from "mario-core";
|
|
8
|
+
import { A as xt, B as Ft, z as It } from "./surveyService-PH3HqoxP.js";
|
|
9
|
+
import { e as Bt } from "./questionCategoryService-Cy4o2SXv.js";
|
|
10
|
+
import { A as Ge } from "./ArrowBack-DytrysgX.js";
|
|
11
|
+
import { C as Ye } from "./Check-D8k_l7WO.js";
|
|
12
|
+
import { A as $e } from "./ArrowForward-DxhjtaZw.js";
|
|
13
|
+
import { d as xe, b as At } from "./createSvgIcon-Bge4D-o7.js";
|
|
14
|
+
import { A as Ue } from "./Add-6ex8DhwL.js";
|
|
15
|
+
import { LocalizationProvider as Rt, DateTimePicker as Et } from "@mui/x-date-pickers";
|
|
16
|
+
import { A as Lt } from "./AdapterMoment-CeMS9jLD.js";
|
|
17
|
+
import { S as kt } from "./Search-srkT1jtT.js";
|
|
18
|
+
import { C as qt } from "./Close-Z8xNZb_y.js";
|
|
19
|
+
const Ce = [
|
|
20
|
+
{ stepNumber: 1, stepCode: "CHOOSE_TEMPLATE", label: "Choose Template" },
|
|
21
|
+
{ stepNumber: 2, stepCode: "CHECK_DETAILS", label: "Check Details" },
|
|
22
|
+
{ stepNumber: 3, stepCode: "CREATE_SURVEY", label: "Create Survey" },
|
|
23
|
+
{ stepNumber: 4, stepCode: "SELECT_STUDENTS", label: "Select Students" },
|
|
24
|
+
{ stepNumber: 5, stepCode: "REVIEW_PUBLISH", label: "Review & Publish" }
|
|
25
|
+
], Pt = [
|
|
26
|
+
"All",
|
|
27
|
+
"School Climate",
|
|
28
|
+
"Well-being",
|
|
29
|
+
"Health & Wellness"
|
|
30
|
+
], Ht = [
|
|
31
|
+
{
|
|
32
|
+
id: 1,
|
|
33
|
+
title: "Stress",
|
|
34
|
+
description: "Assess stress levels and identify stressors affecting students",
|
|
35
|
+
questionCount: 13,
|
|
36
|
+
category: "Well-being"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: 2,
|
|
40
|
+
title: "Grows",
|
|
41
|
+
description: "Measure student growth mindset and learning attitudes",
|
|
42
|
+
questionCount: 6,
|
|
43
|
+
category: "School Climate"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 3,
|
|
47
|
+
title: "Climate Survey",
|
|
48
|
+
description: "Evaluate overall school climate and student experiences",
|
|
49
|
+
questionCount: 9,
|
|
50
|
+
category: "School Climate"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: 4,
|
|
54
|
+
title: "Happiness",
|
|
55
|
+
description: "Track student happiness and emotional well-being",
|
|
56
|
+
questionCount: 8,
|
|
57
|
+
category: "Well-being"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 5,
|
|
61
|
+
title: "Climate Survey: Connections with Adults & Peers",
|
|
62
|
+
description: "Assess the quality of relationships with adults and peers in school",
|
|
63
|
+
questionCount: 14,
|
|
64
|
+
category: "School Climate"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 6,
|
|
68
|
+
title: "Climate Survey: Holistic Learning Experiences",
|
|
69
|
+
description: "Evaluate overall school climate and student experiences",
|
|
70
|
+
questionCount: 18,
|
|
71
|
+
category: "Well-being"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 7,
|
|
75
|
+
title: "Climate Survey: My Health and Well-being",
|
|
76
|
+
description: "Monitor student physical and mental health and wellness",
|
|
77
|
+
questionCount: 21,
|
|
78
|
+
category: "Health & Wellness"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 8,
|
|
82
|
+
title: "Well-being",
|
|
83
|
+
description: "General assessment of student wellness and quality of life",
|
|
84
|
+
questionCount: 10,
|
|
85
|
+
category: "Well-being"
|
|
86
|
+
}
|
|
87
|
+
], Dt = (n) => {
|
|
88
|
+
const l = Qe(), u = Me(), i = Oe((s) => s?.common?.language || "en"), [o, d] = O(n?.activeStep ?? 0), [_, g] = O(n?.selectedCategory ?? "All"), [c, N] = O(n?.selectedTemplateId ?? null), [w, h] = O(Ht), [f, q] = O(!1), [v, S] = O(n?.editingTemplate ?? null), k = ze(async () => {
|
|
89
|
+
try {
|
|
90
|
+
q(!0), l(se(!0));
|
|
91
|
+
const s = await xt(i);
|
|
92
|
+
if (s?.data && Array.isArray(s.data) && s.data.length > 0) {
|
|
93
|
+
const B = s.data.map((I) => {
|
|
94
|
+
let R = "Well-being";
|
|
95
|
+
const A = (I.name || "").toLowerCase();
|
|
96
|
+
return A.includes("climate") || A.includes("grow") ? R = "School Climate" : A.includes("health") && (R = "Health & Wellness"), {
|
|
97
|
+
id: I.id,
|
|
98
|
+
title: I.name,
|
|
99
|
+
description: I.description,
|
|
100
|
+
questionCount: I.numberQuestion ?? I.questionTemplates?.length ?? 0,
|
|
101
|
+
category: R,
|
|
102
|
+
rawTemplate: I
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
h(B), n?.selectedTemplateId || N((I) => I || (B.length > 0 ? B[0].id : null));
|
|
106
|
+
}
|
|
107
|
+
} catch (s) {
|
|
108
|
+
console.error("Error fetching survey templates:", s), l(
|
|
109
|
+
me({
|
|
110
|
+
type: "danger",
|
|
111
|
+
message: s?.message || "Failed to fetch survey templates"
|
|
112
|
+
})
|
|
113
|
+
);
|
|
114
|
+
} finally {
|
|
115
|
+
q(!1), l(se(!1));
|
|
116
|
+
}
|
|
117
|
+
}, [i, l]);
|
|
118
|
+
ge(() => {
|
|
119
|
+
k();
|
|
120
|
+
}, [k]);
|
|
121
|
+
const F = M(() => {
|
|
122
|
+
const s = /* @__PURE__ */ new Set();
|
|
123
|
+
return w.forEach((B) => {
|
|
124
|
+
B.category && s.add(B.category);
|
|
125
|
+
}), s.size === 0 ? Pt : ["All", ...Array.from(s)];
|
|
126
|
+
}, [w]), C = M(() => _ === "All" ? w : w.filter(
|
|
127
|
+
(s) => s.category.toLowerCase() === _.toLowerCase()
|
|
128
|
+
), [w, _]), z = M(() => w.find((s) => s.id === c) || null, [w, c]), E = (s) => {
|
|
129
|
+
g(s);
|
|
130
|
+
}, J = (s) => {
|
|
131
|
+
N(s);
|
|
132
|
+
}, Y = () => {
|
|
133
|
+
N(null), d((s) => Math.min(s + 1, Ce.length - 1));
|
|
134
|
+
}, Z = (s, B) => {
|
|
135
|
+
B.stopPropagation(), S(s);
|
|
136
|
+
}, j = () => {
|
|
137
|
+
S(null);
|
|
138
|
+
}, X = async (s) => {
|
|
139
|
+
try {
|
|
140
|
+
l(se(!0));
|
|
141
|
+
const B = s.rawTemplate?.questionTemplates?.map((A) => A.questionId || A.id)?.filter((A) => typeof A == "number" || !String(A).startsWith("q-"))?.map((A) => Number(A)) || [], I = {
|
|
142
|
+
id: s.id,
|
|
143
|
+
name: s.title,
|
|
144
|
+
description: s.description,
|
|
145
|
+
isFavorite: s.rawTemplate?.isFavorite ?? !1,
|
|
146
|
+
questionIds: B
|
|
147
|
+
};
|
|
148
|
+
await Bt(I), h(
|
|
149
|
+
(A) => A.map(($) => $.id === s.id ? s : $)
|
|
150
|
+
), S(null);
|
|
151
|
+
const R = localStorage.getItem("create_survey_draft");
|
|
152
|
+
if (R)
|
|
153
|
+
try {
|
|
154
|
+
const A = JSON.parse(R);
|
|
155
|
+
A.editingTemplateFormData && (delete A.editingTemplateFormData, localStorage.setItem("create_survey_draft", JSON.stringify(A)));
|
|
156
|
+
} catch {
|
|
157
|
+
}
|
|
158
|
+
l(me({ type: "success", message: "Update template successfully" }));
|
|
159
|
+
} catch (B) {
|
|
160
|
+
l(me({ type: "danger", message: B.response?.data?.title || "Update template failed" }));
|
|
161
|
+
} finally {
|
|
162
|
+
l(se(!1));
|
|
163
|
+
}
|
|
164
|
+
}, K = () => {
|
|
165
|
+
u("/admin/survey-dashboard/list-survey");
|
|
166
|
+
};
|
|
167
|
+
return {
|
|
168
|
+
steps: Ce,
|
|
169
|
+
activeStep: o,
|
|
170
|
+
categories: F,
|
|
171
|
+
selectedCategory: _,
|
|
172
|
+
selectedTemplateId: c,
|
|
173
|
+
selectedTemplate: z,
|
|
174
|
+
templates: C,
|
|
175
|
+
rawTemplates: w,
|
|
176
|
+
isLoading: f,
|
|
177
|
+
editingTemplate: v,
|
|
178
|
+
handleSelectCategory: E,
|
|
179
|
+
handleSelectTemplate: J,
|
|
180
|
+
handleCreateBlankSurvey: Y,
|
|
181
|
+
handleEditTemplate: Z,
|
|
182
|
+
handleCloseEditTemplate: j,
|
|
183
|
+
handleSaveEditTemplate: X,
|
|
184
|
+
handleGoBackToDashboard: K,
|
|
185
|
+
handlePreviousStep: () => {
|
|
186
|
+
o > 0 ? d((s) => s - 1) : K();
|
|
187
|
+
},
|
|
188
|
+
handleNextStep: () => {
|
|
189
|
+
o < Ce.length - 1 && d((s) => s + 1);
|
|
190
|
+
},
|
|
191
|
+
handleGoToStep: (s) => {
|
|
192
|
+
s >= 0 && s < Ce.length && d(s);
|
|
193
|
+
},
|
|
194
|
+
refetchTemplates: k
|
|
195
|
+
};
|
|
196
|
+
}, ke = (n, l) => !n || !Array.isArray(n) || n.length === 0 ? [] : n.map((u, i) => ({
|
|
197
|
+
id: u.questionId ?? u.id ?? `q-${i + 1}`,
|
|
198
|
+
orderNumber: u.orderDefaultQuestionTemplate ?? i + 1,
|
|
199
|
+
questionText: u.questionText ?? u.text ?? `Question ${i + 1}`,
|
|
200
|
+
type: String(u.type || "Text"),
|
|
201
|
+
category: u.category ?? u.categoryName ?? u.categoryTitle ?? u.title ?? l ?? "General",
|
|
202
|
+
options: u.answers?.map((o) => o.text) || []
|
|
203
|
+
})), He = [
|
|
204
|
+
{
|
|
205
|
+
id: "q-1",
|
|
206
|
+
orderNumber: 1,
|
|
207
|
+
questionText: "How would you rate your overall well-being?",
|
|
208
|
+
type: "Rating",
|
|
209
|
+
category: "Overall Well-being"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
id: "q-2",
|
|
213
|
+
orderNumber: 2,
|
|
214
|
+
questionText: "Do you feel balanced in your daily life?",
|
|
215
|
+
type: "YesNo",
|
|
216
|
+
category: "Life Balance"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: "q-3",
|
|
220
|
+
orderNumber: 3,
|
|
221
|
+
questionText: "What contributes most to your well-being?",
|
|
222
|
+
type: "Text",
|
|
223
|
+
category: "Well-being Factors"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: "q-4",
|
|
227
|
+
orderNumber: 4,
|
|
228
|
+
questionText: "How satisfied are you with your life?",
|
|
229
|
+
type: "Rating",
|
|
230
|
+
category: "Life Satisfaction"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
id: "q-5",
|
|
234
|
+
orderNumber: 5,
|
|
235
|
+
questionText: "Do you have people who support you?",
|
|
236
|
+
type: "YesNo",
|
|
237
|
+
category: "Social Support"
|
|
238
|
+
}
|
|
239
|
+
], zt = (n, l) => {
|
|
240
|
+
const u = M(() => {
|
|
241
|
+
const v = n?.rawTemplate?.questionTemplates, S = ke(v, n?.category || "Well-being");
|
|
242
|
+
return S.length > 0 ? S : He;
|
|
243
|
+
}, [n]), [i, o] = O(() => l?.step2FormData ? l.step2FormData : {
|
|
244
|
+
templateName: n?.title || "Well-being",
|
|
245
|
+
description: n?.description || "General assessment of student wellness and quality of life",
|
|
246
|
+
showLandingPageFlag: !1,
|
|
247
|
+
questions: u,
|
|
248
|
+
selectedCategoryFilter: "All"
|
|
249
|
+
}), d = ht(l?.selectedTemplateId ?? n?.id);
|
|
250
|
+
ge(() => {
|
|
251
|
+
if (n) {
|
|
252
|
+
if (d.current === n.id)
|
|
253
|
+
return;
|
|
254
|
+
d.current = n.id;
|
|
255
|
+
const v = n.rawTemplate?.questionTemplates, S = ke(v, n.category || "Well-being");
|
|
256
|
+
o((k) => ({
|
|
257
|
+
...k,
|
|
258
|
+
templateName: n.title || "",
|
|
259
|
+
description: n.description || "",
|
|
260
|
+
questions: S.length > 0 ? S : k.questions.length > 0 ? k.questions : He,
|
|
261
|
+
selectedCategoryFilter: "All"
|
|
262
|
+
}));
|
|
263
|
+
}
|
|
264
|
+
}, [n]);
|
|
265
|
+
const _ = M(() => {
|
|
266
|
+
const v = /* @__PURE__ */ new Set();
|
|
267
|
+
i.questions.forEach((k) => {
|
|
268
|
+
const F = k.category?.trim();
|
|
269
|
+
F && v.add(F);
|
|
270
|
+
});
|
|
271
|
+
const S = Array.from(v);
|
|
272
|
+
return S.length > 0 ? ["All", ...S] : ["All"];
|
|
273
|
+
}, [i.questions]), g = M(() => i.selectedCategoryFilter === "All" ? i.questions : i.questions.filter(
|
|
274
|
+
(v) => v.category === i.selectedCategoryFilter
|
|
275
|
+
), [i.questions, i.selectedCategoryFilter]), c = (v) => {
|
|
276
|
+
o((S) => ({ ...S, templateName: v }));
|
|
277
|
+
}, N = (v) => {
|
|
278
|
+
o((S) => ({ ...S, description: v }));
|
|
279
|
+
}, w = (v) => {
|
|
280
|
+
o((S) => ({ ...S, selectedCategoryFilter: v }));
|
|
281
|
+
}, h = (v) => {
|
|
282
|
+
console.log("Edit question:", v);
|
|
283
|
+
}, f = (v) => {
|
|
284
|
+
o((S) => ({
|
|
285
|
+
...S,
|
|
286
|
+
questions: S.questions.filter((k) => k.id !== v).map((k, F) => ({ ...k, orderNumber: F + 1 }))
|
|
287
|
+
}));
|
|
288
|
+
}, q = () => {
|
|
289
|
+
const v = `q-${Date.now()}`, S = i.questions.length + 1, k = {
|
|
290
|
+
id: v,
|
|
291
|
+
orderNumber: S,
|
|
292
|
+
questionText: "New Question",
|
|
293
|
+
type: "Rating",
|
|
294
|
+
category: "General"
|
|
295
|
+
};
|
|
296
|
+
o((F) => ({
|
|
297
|
+
...F,
|
|
298
|
+
questions: [...F.questions, k]
|
|
299
|
+
}));
|
|
300
|
+
};
|
|
301
|
+
return {
|
|
302
|
+
formData: i,
|
|
303
|
+
questionCategories: _,
|
|
304
|
+
filteredQuestions: g,
|
|
305
|
+
totalQuestionsCount: i.questions.length,
|
|
306
|
+
handleTemplateNameChange: c,
|
|
307
|
+
handleDescriptionChange: N,
|
|
308
|
+
handleCategoryFilterChange: w,
|
|
309
|
+
handleEditQuestion: h,
|
|
310
|
+
handleRemoveQuestion: f,
|
|
311
|
+
handleAddQuestion: q
|
|
312
|
+
};
|
|
313
|
+
}, Wt = (n, {
|
|
314
|
+
initialTitle: l = "",
|
|
315
|
+
initialDeadline: u = qe().add(1, "days").format("DD.MM.YYYY hh:mm A")
|
|
316
|
+
} = {}) => {
|
|
317
|
+
const [i, o] = O(() => n?.step3FormData ? n.step3FormData : {
|
|
318
|
+
title: l || "",
|
|
319
|
+
deadline: u || ""
|
|
320
|
+
});
|
|
321
|
+
return {
|
|
322
|
+
formData: i,
|
|
323
|
+
handleTitleChange: (g) => {
|
|
324
|
+
o((c) => ({ ...c, title: g }));
|
|
325
|
+
},
|
|
326
|
+
handleDeadlineChange: (g) => {
|
|
327
|
+
o((c) => ({ ...c, deadline: g }));
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
}, Qt = wt("/images/image-default.png"), Ot = [
|
|
331
|
+
{ label: "All Flags", value: "all" },
|
|
332
|
+
{ label: "Red Flag", value: "red" },
|
|
333
|
+
{ label: "Yellow Flag", value: "yellow" },
|
|
334
|
+
{ label: "Green Flag", value: "green" }
|
|
335
|
+
], Mt = (n) => {
|
|
336
|
+
const [l, u] = O([]), [i, o] = O(n?.selectedStudentIds ?? []), [d, _] = O([]), [g, c] = O(Ot), [N, w] = O([]), [h, f] = O({
|
|
337
|
+
searchQuery: "",
|
|
338
|
+
selectedGrade: "All Grades",
|
|
339
|
+
selectedFlag: "all",
|
|
340
|
+
selectedTeacher: "All Teachers",
|
|
341
|
+
page: 0,
|
|
342
|
+
rowsPerPage: 10,
|
|
343
|
+
sortBy: "name",
|
|
344
|
+
sortOrder: "asc"
|
|
345
|
+
}), q = ze(async () => {
|
|
346
|
+
try {
|
|
347
|
+
const y = await Ft({
|
|
348
|
+
roles: ["Admin"]
|
|
349
|
+
});
|
|
350
|
+
if (y?.data?.items && Array.isArray(y.data.items) && y.data.items.length > 0) {
|
|
351
|
+
const b = y.data.items.map((p) => {
|
|
352
|
+
let P = "none";
|
|
353
|
+
if (typeof p.flag == "string") {
|
|
354
|
+
const ne = p.flag.toLowerCase();
|
|
355
|
+
(ne === "red" || ne === "yellow" || ne === "green") && (P = ne);
|
|
356
|
+
} else
|
|
357
|
+
p.redFlags > 0 || p.flag === 1 ? P = "red" : p.yellowFlags > 0 || p.flag === 2 ? P = "yellow" : (p.greenFlags > 0 || p.flag === 3) && (P = "green");
|
|
358
|
+
const U = p.fullName || p.studentName, Fe = p.gradeLevel, Ie = p.email, fe = p.userId || (typeof p.id == "string" ? p.id : ""), le = typeof p.studentId == "number" ? p.studentId : typeof p.id == "number" ? p.id : void 0, Be = fe || (le !== void 0 ? String(le) : `student-${Math.random()}`), Ae = (p.schoolLevel || (p.userId && p.id === void 0 ? "ES" : "MS")).toUpperCase();
|
|
359
|
+
return {
|
|
360
|
+
id: Be,
|
|
361
|
+
userId: fe,
|
|
362
|
+
studentId: le,
|
|
363
|
+
schoolLevel: Ae,
|
|
364
|
+
name: U,
|
|
365
|
+
avatarUrl: p.profileImageFileName ? Tt(p.profileImageFileName) : Qt,
|
|
366
|
+
flag: P,
|
|
367
|
+
flagTooltip: p.flagTooltip || void 0,
|
|
368
|
+
flagDetail: p.flagDetail,
|
|
369
|
+
lastSafetyAnswer: p.lastSafetyAnswer,
|
|
370
|
+
lastStressAnswer: p.lastStressAnswer,
|
|
371
|
+
flagSessionId: p.flagSessionId,
|
|
372
|
+
flagSessionResultId: p.flagSessionResultId,
|
|
373
|
+
grade: Fe,
|
|
374
|
+
email: Ie,
|
|
375
|
+
listTeachers: p.listTeachers || []
|
|
376
|
+
};
|
|
377
|
+
});
|
|
378
|
+
u(b);
|
|
379
|
+
const s = Array.from(new Set(b.map((p) => p.grade))).filter((p) => p && p !== "N/A"), B = (p) => {
|
|
380
|
+
if (!p || p === "N/A") return -999;
|
|
381
|
+
const P = p.toString().toUpperCase().replace(/TH|RD|ND|ST/g, "").trim();
|
|
382
|
+
if (P === "PK") return -2;
|
|
383
|
+
if (P === "K") return -1;
|
|
384
|
+
if (P === "G") return 0;
|
|
385
|
+
const U = P.match(/^(\d+)/);
|
|
386
|
+
return U ? parseInt(U[1], 10) : 999;
|
|
387
|
+
};
|
|
388
|
+
s.sort((p, P) => B(p) - B(P)), _(["All Grades", ...s]);
|
|
389
|
+
const I = Array.from(new Set(b.map((p) => p.flag))), R = [{ label: "All Flags", value: "all" }];
|
|
390
|
+
I.includes("red") && R.push({ label: "Red Flag", value: "red" }), I.includes("yellow") && R.push({ label: "Yellow Flag", value: "yellow" }), I.includes("green") && R.push({ label: "Green Flag", value: "green" }), c(R);
|
|
391
|
+
const A = /* @__PURE__ */ new Set();
|
|
392
|
+
b.forEach((p) => {
|
|
393
|
+
p.listTeachers && p.listTeachers.length > 0 && p.listTeachers.forEach((P) => {
|
|
394
|
+
P.name && A.add(P.name.trim());
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
const $ = Array.from(A).sort((p, P) => p.localeCompare(P));
|
|
398
|
+
w(["All Teachers", ...$]);
|
|
399
|
+
}
|
|
400
|
+
} catch (y) {
|
|
401
|
+
console.error("Error fetching students list:", y);
|
|
402
|
+
}
|
|
403
|
+
}, []);
|
|
404
|
+
ge(() => {
|
|
405
|
+
q();
|
|
406
|
+
}, [q]);
|
|
407
|
+
const v = (y) => {
|
|
408
|
+
f((b) => ({ ...b, searchQuery: y, page: 0 }));
|
|
409
|
+
}, S = (y) => {
|
|
410
|
+
f((b) => ({ ...b, selectedGrade: y, page: 0 }));
|
|
411
|
+
}, k = (y) => {
|
|
412
|
+
f((b) => ({ ...b, selectedFlag: y, page: 0 }));
|
|
413
|
+
}, F = (y) => {
|
|
414
|
+
f((b) => ({ ...b, selectedTeacher: y, page: 0 }));
|
|
415
|
+
}, C = (y, b) => {
|
|
416
|
+
f((s) => ({ ...s, page: b }));
|
|
417
|
+
}, z = (y) => {
|
|
418
|
+
f((b) => ({ ...b, rowsPerPage: parseInt(y.target.value, 10), page: 0 }));
|
|
419
|
+
}, E = M(() => l.filter((y) => {
|
|
420
|
+
if (h.searchQuery.trim()) {
|
|
421
|
+
const b = (R) => R.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), s = b(h.searchQuery.trim()), B = b(y.name).includes(s), I = b(y.email).includes(s);
|
|
422
|
+
if (!B && !I) return !1;
|
|
423
|
+
}
|
|
424
|
+
return !(h.selectedGrade !== "All Grades" && y.grade.toLowerCase() !== h.selectedGrade.toLowerCase() || h.selectedFlag !== "all" && y.flag !== h.selectedFlag || h.selectedTeacher !== "All Teachers" && (!y.listTeachers || y.listTeachers.length === 0 || !y.listTeachers.some((s) => s.name && s.name.trim() === h.selectedTeacher)));
|
|
425
|
+
}), [l, h]), J = (y) => {
|
|
426
|
+
f((b) => ({
|
|
427
|
+
...b,
|
|
428
|
+
sortBy: y,
|
|
429
|
+
sortOrder: b.sortBy === y && b.sortOrder === "asc" ? "desc" : "asc"
|
|
430
|
+
}));
|
|
431
|
+
}, Y = M(() => [...E].sort((b, s) => {
|
|
432
|
+
let B = b[h.sortBy], I = s[h.sortBy];
|
|
433
|
+
if (h.sortBy === "flag") {
|
|
434
|
+
const R = { red: 3, yellow: 2, green: 1, none: 0 };
|
|
435
|
+
B = R[b.flag] || 0, I = R[s.flag] || 0;
|
|
436
|
+
} else if (h.sortBy === "grade") {
|
|
437
|
+
const R = (A) => {
|
|
438
|
+
if (!A || A === "N/A") return -999;
|
|
439
|
+
const $ = A.toString().toUpperCase().replace(/TH|RD|ND|ST/g, "").trim();
|
|
440
|
+
if ($ === "PK") return -2;
|
|
441
|
+
if ($ === "K") return -1;
|
|
442
|
+
if ($ === "G") return 0;
|
|
443
|
+
const p = $.match(/^(\d+)/);
|
|
444
|
+
return p ? parseInt(p[1], 10) : 999;
|
|
445
|
+
};
|
|
446
|
+
B = R(b.grade), I = R(s.grade);
|
|
447
|
+
} else h.sortBy === "teacher" ? (B = b.listTeachers && b.listTeachers.length > 0 ? b.listTeachers.map((R) => R.name).join(", ").toLowerCase() : "", I = s.listTeachers && s.listTeachers.length > 0 ? s.listTeachers.map((R) => R.name).join(", ").toLowerCase() : "") : typeof B == "string" && typeof I == "string" && (B = B.toLowerCase(), I = I.toLowerCase());
|
|
448
|
+
return B < I ? h.sortOrder === "asc" ? -1 : 1 : B > I ? h.sortOrder === "asc" ? 1 : -1 : 0;
|
|
449
|
+
}), [E, h.sortBy, h.sortOrder]), Z = M(() => {
|
|
450
|
+
const y = h.page * h.rowsPerPage;
|
|
451
|
+
return Y.slice(y, y + h.rowsPerPage);
|
|
452
|
+
}, [Y, h.page, h.rowsPerPage]), j = M(() => E.length === 0 ? !1 : E.every((y) => i.includes(y.id)), [E, i]), X = M(() => {
|
|
453
|
+
if (E.length === 0) return !1;
|
|
454
|
+
const y = E.filter((b) => i.includes(b.id));
|
|
455
|
+
return y.length > 0 && y.length < E.length;
|
|
456
|
+
}, [E, i]), K = () => {
|
|
457
|
+
if (j) {
|
|
458
|
+
const y = E.map((b) => b.id);
|
|
459
|
+
o((b) => b.filter((s) => !y.includes(s)));
|
|
460
|
+
} else {
|
|
461
|
+
const y = /* @__PURE__ */ new Set([...i, ...E.map((b) => b.id)]);
|
|
462
|
+
o(Array.from(y));
|
|
463
|
+
}
|
|
464
|
+
}, te = (y) => {
|
|
465
|
+
o((b) => b.includes(y) ? b.filter((s) => s !== y) : [...b, y]);
|
|
466
|
+
};
|
|
467
|
+
return {
|
|
468
|
+
students: Z,
|
|
469
|
+
allFilteredStudents: E,
|
|
470
|
+
totalStudentsCount: E.length,
|
|
471
|
+
totalSelectedCount: i.length,
|
|
472
|
+
selectedStudentIds: i,
|
|
473
|
+
filters: h,
|
|
474
|
+
gradeOptions: d,
|
|
475
|
+
flagOptions: g,
|
|
476
|
+
teacherOptions: N,
|
|
477
|
+
isAllSelected: j,
|
|
478
|
+
isIndeterminate: X,
|
|
479
|
+
handleSortChange: J,
|
|
480
|
+
handleSearchChange: v,
|
|
481
|
+
handleGradeFilterChange: S,
|
|
482
|
+
handleFlagFilterChange: k,
|
|
483
|
+
handleTeacherFilterChange: F,
|
|
484
|
+
handlePageChange: C,
|
|
485
|
+
handleRowsPerPageChange: z,
|
|
486
|
+
handleToggleSelectAll: K,
|
|
487
|
+
handleToggleStudent: te
|
|
488
|
+
};
|
|
489
|
+
}, Gt = "_createSurveyPage_254g3_1", Yt = "_headerTopBar_254g3_16", $t = "_contentBody_254g3_28", Ut = "_stepperContainer_254g3_39", Vt = "_backButton_254g3_44", jt = "_stepperProgress_254g3_58", Kt = "_stepColumn_254g3_66", Jt = "_stepColumnLast_254g3_72", Zt = "_stepCircleRow_254g3_77", Xt = "_stepCircle_254g3_77", en = "_active_254g3_96", tn = "_completed_254g3_100", nn = "_stepConnectorLine_254g3_105", an = "_stepLabelStack_254g3_115", sn = "_stepInnerDot_254g3_119", ln = "_stepNumberLabel_254g3_133", rn = "_stepTextLabel_254g3_145", on = "_chooseTemplateCard_254g3_157", cn = "_headerSection_254g3_173", dn = "_headerTitle_254g3_177", mn = "_headerSubtitle_254g3_192", un = "_bannerContainer_254g3_199", hn = "_bannerIconBox_254g3_219", gn = "_bannerTitle_254g3_228", pn = "_bannerSubtitle_254g3_235", fn = "_bannerActionBtn_254g3_240", _n = "_sectionTitle_254g3_258", yn = "_filterPillsContainer_254g3_266", bn = "_filterPill_254g3_266", Cn = "_templateCard_254g3_301", Sn = "_selected_254g3_319", Nn = "_templateCardTitle_254g3_324", vn = "_templateEditBtn_254g3_332", Tn = "_templateDescription_254g3_346", wn = "_chipItem_254g3_353", xn = "_wizardFooter_254g3_367", Fn = "_previousBtn_254g3_387", In = "_disabled_254g3_409", Bn = "_stepCounterText_254g3_427", An = "_nextBtn_254g3_433", Rn = "_editTemplateHeaderSection_254g3_453", En = "_editTemplateCancelBtn_254g3_460", Ln = "_editTemplateSaveBtn_254g3_472", kn = "_templateCategorySelect_254g3_495", qn = "_formFieldBlock_254g3_514", Pn = "_formFieldLabel_254g3_520", Hn = "_requiredAsterisk_254g3_528", Dn = "_customTextField_254g3_532", zn = "_formFieldHelperText_254g3_549", Wn = "_questionsHeaderSection_254g3_577", Qn = "_questionsTitle_254g3_585", On = "_questionsCountNumber_254g3_591", Mn = "_filterByRow_254g3_597", Gn = "_filterByLabel_254g3_605", Yn = "_categoryFilterFormControl_254g3_611", $n = "_categorySelectInput_254g3_615", Un = "_tableContainerWrapper_254g3_633", Vn = "_questionsTable_254g3_641", jn = "_tableHeaderRow_254g3_646", Kn = "_tableBodyRow_254g3_659", Jn = "_thNumber_254g3_673", Zn = "_tdNumber_254g3_674", Xn = "_thQuestion_254g3_683", ea = "_tdQuestion_254g3_684", ta = "_questionText_254g3_690", na = "_thType_254g3_709", aa = "_tdType_254g3_710", sa = "_thCategory_254g3_716", la = "_tdCategory_254g3_717", ra = "_categoryText_254g3_723", ia = "_thActions_254g3_730", oa = "_tdActions_254g3_731", ca = "_questionTypeBadge_254g3_737", da = "_badgeTextLabel_254g3_747", ma = "_badgeRating_254g3_753", ua = "_badgeYesNo_254g3_760", ha = "_badgeText_254g3_747", ga = "_tableEditBtn_254g3_781", pa = "_tableRemoveBtn_254g3_796", fa = "_addQuestionWrapper_254g3_811", _a = "_addQuestionBtn_254g3_819", ya = "_selectedCountSection_254g3_838", ba = "_selectedCountText_254g3_843", Ca = "_selectedCountHighlight_254g3_849", Sa = "_studentsToolbar_254g3_855", Na = "_searchBarContainer_254g3_863", va = "_studentSearchInput_254g3_868", Ta = "_filterDropdownWrapper_254g3_894", wa = "_filterSelectBox_254g3_898", xa = "_studentsTableContainer_254g3_924", Fa = "_studentsTable_254g3_924", Ia = "_studentsTableHeaderRow_254g3_938", Ba = "_checkboxHeaderCell_254g3_949", Aa = "_tableHeaderCell_254g3_957", Ra = "_checkboxBodyCell_254g3_973", Ea = "_studentTableRow_254g3_981", La = "_selectedRow_254g3_988", ka = "_studentNameCell_254g3_995", qa = "_studentNameText_254g3_1000", Pa = "_flagCell_254g3_1006", Ha = "_gradeCell_254g3_1011", Da = "_gradeText_254g3_1016", za = "_emailCell_254g3_1021", Wa = "_emailText_254g3_1026", Qa = "_studentsPagination_254g3_1031", Oa = "_reviewSectionBlock_254g3_1049", Ma = "_reviewSectionHeader_254g3_1058", Ga = "_reviewSectionTitle_254g3_1065", Ya = "_reviewEditSectionBtn_254g3_1071", $a = "_reviewFieldGroup_254g3_1082", Ua = "_reviewFieldLabel_254g3_1086", Va = "_reviewFieldValue_254g3_1094", ja = "_reviewQuestionsTableContainer_254g3_1100", Ka = "_previewSurveyBtn_254g3_1106", Ja = "_publishBtn_254g3_1122", t = {
|
|
490
|
+
createSurveyPage: Gt,
|
|
491
|
+
headerTopBar: Yt,
|
|
492
|
+
contentBody: $t,
|
|
493
|
+
stepperContainer: Ut,
|
|
494
|
+
backButton: Vt,
|
|
495
|
+
stepperProgress: jt,
|
|
496
|
+
stepColumn: Kt,
|
|
497
|
+
stepColumnLast: Jt,
|
|
498
|
+
stepCircleRow: Zt,
|
|
499
|
+
stepCircle: Xt,
|
|
500
|
+
active: en,
|
|
501
|
+
completed: tn,
|
|
502
|
+
stepConnectorLine: nn,
|
|
503
|
+
stepLabelStack: an,
|
|
504
|
+
stepInnerDot: sn,
|
|
505
|
+
stepNumberLabel: ln,
|
|
506
|
+
stepTextLabel: rn,
|
|
507
|
+
chooseTemplateCard: on,
|
|
508
|
+
headerSection: cn,
|
|
509
|
+
headerTitle: dn,
|
|
510
|
+
headerSubtitle: mn,
|
|
511
|
+
bannerContainer: un,
|
|
512
|
+
bannerIconBox: hn,
|
|
513
|
+
bannerTitle: gn,
|
|
514
|
+
bannerSubtitle: pn,
|
|
515
|
+
bannerActionBtn: fn,
|
|
516
|
+
sectionTitle: _n,
|
|
517
|
+
filterPillsContainer: yn,
|
|
518
|
+
filterPill: bn,
|
|
519
|
+
templateCard: Cn,
|
|
520
|
+
selected: Sn,
|
|
521
|
+
templateCardTitle: Nn,
|
|
522
|
+
templateEditBtn: vn,
|
|
523
|
+
templateDescription: Tn,
|
|
524
|
+
chipItem: wn,
|
|
525
|
+
wizardFooter: xn,
|
|
526
|
+
previousBtn: Fn,
|
|
527
|
+
disabled: In,
|
|
528
|
+
stepCounterText: Bn,
|
|
529
|
+
nextBtn: An,
|
|
530
|
+
editTemplateHeaderSection: Rn,
|
|
531
|
+
editTemplateCancelBtn: En,
|
|
532
|
+
editTemplateSaveBtn: Ln,
|
|
533
|
+
templateCategorySelect: kn,
|
|
534
|
+
formFieldBlock: qn,
|
|
535
|
+
formFieldLabel: Pn,
|
|
536
|
+
requiredAsterisk: Hn,
|
|
537
|
+
customTextField: Dn,
|
|
538
|
+
formFieldHelperText: zn,
|
|
539
|
+
questionsHeaderSection: Wn,
|
|
540
|
+
questionsTitle: Qn,
|
|
541
|
+
questionsCountNumber: On,
|
|
542
|
+
filterByRow: Mn,
|
|
543
|
+
filterByLabel: Gn,
|
|
544
|
+
categoryFilterFormControl: Yn,
|
|
545
|
+
categorySelectInput: $n,
|
|
546
|
+
tableContainerWrapper: Un,
|
|
547
|
+
questionsTable: Vn,
|
|
548
|
+
tableHeaderRow: jn,
|
|
549
|
+
tableBodyRow: Kn,
|
|
550
|
+
thNumber: Jn,
|
|
551
|
+
tdNumber: Zn,
|
|
552
|
+
thQuestion: Xn,
|
|
553
|
+
tdQuestion: ea,
|
|
554
|
+
questionText: ta,
|
|
555
|
+
thType: na,
|
|
556
|
+
tdType: aa,
|
|
557
|
+
thCategory: sa,
|
|
558
|
+
tdCategory: la,
|
|
559
|
+
categoryText: ra,
|
|
560
|
+
thActions: ia,
|
|
561
|
+
tdActions: oa,
|
|
562
|
+
questionTypeBadge: ca,
|
|
563
|
+
badgeTextLabel: da,
|
|
564
|
+
badgeRating: ma,
|
|
565
|
+
badgeYesNo: ua,
|
|
566
|
+
badgeText: ha,
|
|
567
|
+
tableEditBtn: ga,
|
|
568
|
+
tableRemoveBtn: pa,
|
|
569
|
+
addQuestionWrapper: fa,
|
|
570
|
+
addQuestionBtn: _a,
|
|
571
|
+
selectedCountSection: ya,
|
|
572
|
+
selectedCountText: ba,
|
|
573
|
+
selectedCountHighlight: Ca,
|
|
574
|
+
studentsToolbar: Sa,
|
|
575
|
+
searchBarContainer: Na,
|
|
576
|
+
studentSearchInput: va,
|
|
577
|
+
filterDropdownWrapper: Ta,
|
|
578
|
+
filterSelectBox: wa,
|
|
579
|
+
studentsTableContainer: xa,
|
|
580
|
+
studentsTable: Fa,
|
|
581
|
+
studentsTableHeaderRow: Ia,
|
|
582
|
+
checkboxHeaderCell: Ba,
|
|
583
|
+
tableHeaderCell: Aa,
|
|
584
|
+
checkboxBodyCell: Ra,
|
|
585
|
+
studentTableRow: Ea,
|
|
586
|
+
selectedRow: La,
|
|
587
|
+
studentNameCell: ka,
|
|
588
|
+
studentNameText: qa,
|
|
589
|
+
flagCell: Pa,
|
|
590
|
+
gradeCell: Ha,
|
|
591
|
+
gradeText: Da,
|
|
592
|
+
emailCell: za,
|
|
593
|
+
emailText: Wa,
|
|
594
|
+
studentsPagination: Qa,
|
|
595
|
+
reviewSectionBlock: Oa,
|
|
596
|
+
reviewSectionHeader: Ma,
|
|
597
|
+
reviewSectionTitle: Ga,
|
|
598
|
+
reviewEditSectionBtn: Ya,
|
|
599
|
+
reviewFieldGroup: $a,
|
|
600
|
+
reviewFieldLabel: Ua,
|
|
601
|
+
reviewFieldValue: Va,
|
|
602
|
+
reviewQuestionsTableContainer: ja,
|
|
603
|
+
previewSurveyBtn: Ka,
|
|
604
|
+
publishBtn: Ja
|
|
605
|
+
}, Za = ({
|
|
606
|
+
steps: n,
|
|
607
|
+
activeStep: l,
|
|
608
|
+
onBack: u
|
|
609
|
+
}) => /* @__PURE__ */ a(r, { className: t.stepperContainer, children: [
|
|
610
|
+
/* @__PURE__ */ e(
|
|
611
|
+
G,
|
|
612
|
+
{
|
|
613
|
+
onClick: u,
|
|
614
|
+
startIcon: /* @__PURE__ */ e(Ge, { fontSize: "small" }),
|
|
615
|
+
className: t.backButton,
|
|
616
|
+
children: "Back to Surveys Dashboard"
|
|
617
|
+
}
|
|
618
|
+
),
|
|
619
|
+
/* @__PURE__ */ e(r, { className: t.stepperProgress, children: n.map((i, o) => {
|
|
620
|
+
const d = o === l, _ = o < l, g = o === n.length - 1;
|
|
621
|
+
return /* @__PURE__ */ a(
|
|
622
|
+
r,
|
|
623
|
+
{
|
|
624
|
+
className: `${t.stepColumn} ${g ? t.stepColumnLast : ""}`,
|
|
625
|
+
children: [
|
|
626
|
+
/* @__PURE__ */ a(r, { className: t.stepCircleRow, children: [
|
|
627
|
+
/* @__PURE__ */ a(
|
|
628
|
+
r,
|
|
629
|
+
{
|
|
630
|
+
className: `${t.stepCircle} ${d ? t.active : _ ? t.completed : ""}`,
|
|
631
|
+
children: [
|
|
632
|
+
d && /* @__PURE__ */ e(r, { className: t.stepInnerDot }),
|
|
633
|
+
_ && /* @__PURE__ */ e(Ye, { sx: { fontSize: 16, color: "#ffffff" } })
|
|
634
|
+
]
|
|
635
|
+
}
|
|
636
|
+
),
|
|
637
|
+
!g && /* @__PURE__ */ e(
|
|
638
|
+
r,
|
|
639
|
+
{
|
|
640
|
+
className: `${t.stepConnectorLine} ${_ ? t.completed : ""}`
|
|
641
|
+
}
|
|
642
|
+
)
|
|
643
|
+
] }),
|
|
644
|
+
/* @__PURE__ */ a(
|
|
645
|
+
W,
|
|
646
|
+
{
|
|
647
|
+
alignItems: "flex-start",
|
|
648
|
+
spacing: 0.25,
|
|
649
|
+
className: t.stepLabelStack,
|
|
650
|
+
children: [
|
|
651
|
+
/* @__PURE__ */ a(
|
|
652
|
+
m,
|
|
653
|
+
{
|
|
654
|
+
variant: "caption",
|
|
655
|
+
className: `${t.stepNumberLabel} ${d ? t.active : ""}`,
|
|
656
|
+
children: [
|
|
657
|
+
"STEP ",
|
|
658
|
+
i.stepNumber
|
|
659
|
+
]
|
|
660
|
+
}
|
|
661
|
+
),
|
|
662
|
+
/* @__PURE__ */ e(
|
|
663
|
+
m,
|
|
664
|
+
{
|
|
665
|
+
variant: "body2",
|
|
666
|
+
className: `${t.stepTextLabel} ${d ? t.active : ""}`,
|
|
667
|
+
children: i.label
|
|
668
|
+
}
|
|
669
|
+
)
|
|
670
|
+
]
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
]
|
|
674
|
+
},
|
|
675
|
+
i.stepCode
|
|
676
|
+
);
|
|
677
|
+
}) })
|
|
678
|
+
] }), Xa = ({
|
|
679
|
+
onCreateBlank: n
|
|
680
|
+
}) => /* @__PURE__ */ a(r, { className: t.bannerContainer, children: [
|
|
681
|
+
/* @__PURE__ */ a(W, { direction: "row", spacing: 2, alignItems: "center", children: [
|
|
682
|
+
/* @__PURE__ */ e(r, { className: t.bannerIconBox, children: /* @__PURE__ */ e("img", { src: "/images/scratch-icon.png", alt: "Start from Scratch" }) }),
|
|
683
|
+
/* @__PURE__ */ a(r, { children: [
|
|
684
|
+
/* @__PURE__ */ e(m, { variant: "subtitle1", className: t.bannerTitle, children: "Start from Scratch" }),
|
|
685
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.bannerSubtitle, children: "Create a custom survey tailored to your specific needs" })
|
|
686
|
+
] })
|
|
687
|
+
] }),
|
|
688
|
+
/* @__PURE__ */ e(
|
|
689
|
+
G,
|
|
690
|
+
{
|
|
691
|
+
onClick: n,
|
|
692
|
+
endIcon: /* @__PURE__ */ e($e, { sx: { fontSize: 16 } }),
|
|
693
|
+
className: t.bannerActionBtn,
|
|
694
|
+
children: "CREATE BLANK SURVEY"
|
|
695
|
+
}
|
|
696
|
+
)
|
|
697
|
+
] }), es = ({
|
|
698
|
+
categories: n,
|
|
699
|
+
selectedCategory: l,
|
|
700
|
+
onSelectCategory: u
|
|
701
|
+
}) => /* @__PURE__ */ e(r, { className: t.filterPillsContainer, children: /* @__PURE__ */ e(W, { direction: "row", spacing: 1.5, alignItems: "center", children: n.map((i) => {
|
|
702
|
+
const o = l.toLowerCase() === i.toLowerCase();
|
|
703
|
+
return /* @__PURE__ */ e(
|
|
704
|
+
Ee,
|
|
705
|
+
{
|
|
706
|
+
label: i,
|
|
707
|
+
onClick: () => u(i),
|
|
708
|
+
className: `${t.filterPill} ${o ? t.active : ""}`
|
|
709
|
+
},
|
|
710
|
+
i
|
|
711
|
+
);
|
|
712
|
+
}) }) }), ue = xe(/* @__PURE__ */ e("path", {
|
|
713
|
+
d: "m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"
|
|
714
|
+
}), "EditOutlined"), ts = ({
|
|
715
|
+
template: n,
|
|
716
|
+
isSelected: l,
|
|
717
|
+
onSelect: u,
|
|
718
|
+
onEdit: i
|
|
719
|
+
}) => /* @__PURE__ */ a(
|
|
720
|
+
r,
|
|
721
|
+
{
|
|
722
|
+
onClick: () => u(n.id),
|
|
723
|
+
className: `${t.templateCard} ${l ? t.selected : ""}`,
|
|
724
|
+
children: [
|
|
725
|
+
/* @__PURE__ */ a(r, { children: [
|
|
726
|
+
/* @__PURE__ */ a(
|
|
727
|
+
W,
|
|
728
|
+
{
|
|
729
|
+
direction: "row",
|
|
730
|
+
alignItems: "flex-start",
|
|
731
|
+
justifyContent: "space-between",
|
|
732
|
+
spacing: 1,
|
|
733
|
+
children: [
|
|
734
|
+
/* @__PURE__ */ e(m, { variant: "h6", className: t.templateCardTitle, children: n.title }),
|
|
735
|
+
/* @__PURE__ */ e(
|
|
736
|
+
G,
|
|
737
|
+
{
|
|
738
|
+
size: "small",
|
|
739
|
+
onClick: (o) => i(n, o),
|
|
740
|
+
startIcon: /* @__PURE__ */ e(ue, { sx: { fontSize: 14 } }),
|
|
741
|
+
className: t.templateEditBtn,
|
|
742
|
+
children: "EDIT"
|
|
743
|
+
}
|
|
744
|
+
)
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
),
|
|
748
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.templateDescription, children: n.description })
|
|
749
|
+
] }),
|
|
750
|
+
/* @__PURE__ */ a(W, { direction: "row", spacing: 1, alignItems: "center", flexWrap: "wrap", sx: { gap: 0.75 }, children: [
|
|
751
|
+
/* @__PURE__ */ e(
|
|
752
|
+
Ee,
|
|
753
|
+
{
|
|
754
|
+
label: `${n.questionCount} questions`,
|
|
755
|
+
size: "small",
|
|
756
|
+
className: t.chipItem
|
|
757
|
+
}
|
|
758
|
+
),
|
|
759
|
+
/* @__PURE__ */ e(
|
|
760
|
+
Ee,
|
|
761
|
+
{
|
|
762
|
+
label: n.category,
|
|
763
|
+
size: "small",
|
|
764
|
+
className: t.chipItem
|
|
765
|
+
}
|
|
766
|
+
)
|
|
767
|
+
] })
|
|
768
|
+
]
|
|
769
|
+
}
|
|
770
|
+
), ns = xe(/* @__PURE__ */ e("path", {
|
|
771
|
+
d: "M12 6.5c3.79 0 7.17 2.13 8.82 5.5-1.65 3.37-5.02 5.5-8.82 5.5S4.83 15.37 3.18 12C4.83 8.63 8.21 6.5 12 6.5m0-2C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5m0 5c1.38 0 2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5-2.5-1.12-2.5-2.5 1.12-2.5 2.5-2.5m0-2c-2.48 0-4.5 2.02-4.5 4.5s2.02 4.5 4.5 4.5 4.5-2.02 4.5-4.5-2.02-4.5-4.5-4.5"
|
|
772
|
+
}), "RemoveRedEyeOutlined"), pe = ({
|
|
773
|
+
currentStep: n,
|
|
774
|
+
totalSteps: l,
|
|
775
|
+
onPrevious: u,
|
|
776
|
+
onNext: i,
|
|
777
|
+
isNextDisabled: o = !1,
|
|
778
|
+
isLastStep: d = !1,
|
|
779
|
+
nextLabel: _ = "NEXT",
|
|
780
|
+
onPreview: g
|
|
781
|
+
}) => /* @__PURE__ */ a(r, { className: t.wizardFooter, children: [
|
|
782
|
+
/* @__PURE__ */ e(
|
|
783
|
+
G,
|
|
784
|
+
{
|
|
785
|
+
variant: "outlined",
|
|
786
|
+
onClick: u,
|
|
787
|
+
startIcon: /* @__PURE__ */ e(Ge, { sx: { fontSize: 16 } }),
|
|
788
|
+
className: `${t.previousBtn} ${n === 1 ? t.disabled : ""}`,
|
|
789
|
+
children: "PREVIOUS"
|
|
790
|
+
}
|
|
791
|
+
),
|
|
792
|
+
/* @__PURE__ */ a(m, { variant: "body2", className: t.stepCounterText, children: [
|
|
793
|
+
"Step ",
|
|
794
|
+
n,
|
|
795
|
+
" of ",
|
|
796
|
+
l
|
|
797
|
+
] }),
|
|
798
|
+
d ? /* @__PURE__ */ a(W, { direction: "row", spacing: 1.5, alignItems: "center", children: [
|
|
799
|
+
g && /* @__PURE__ */ e(
|
|
800
|
+
G,
|
|
801
|
+
{
|
|
802
|
+
variant: "outlined",
|
|
803
|
+
onClick: g,
|
|
804
|
+
startIcon: /* @__PURE__ */ e(ns, { sx: { fontSize: 18 } }),
|
|
805
|
+
className: t.previewSurveyBtn,
|
|
806
|
+
children: "SURVEY PREVIEW"
|
|
807
|
+
}
|
|
808
|
+
),
|
|
809
|
+
/* @__PURE__ */ e(
|
|
810
|
+
G,
|
|
811
|
+
{
|
|
812
|
+
variant: "contained",
|
|
813
|
+
onClick: i,
|
|
814
|
+
disabled: o,
|
|
815
|
+
className: t.publishBtn,
|
|
816
|
+
children: _ || "PUBLISH"
|
|
817
|
+
}
|
|
818
|
+
)
|
|
819
|
+
] }) : /* @__PURE__ */ e(
|
|
820
|
+
G,
|
|
821
|
+
{
|
|
822
|
+
variant: "contained",
|
|
823
|
+
onClick: i,
|
|
824
|
+
disabled: o,
|
|
825
|
+
endIcon: /* @__PURE__ */ e($e, { sx: { fontSize: 16 } }),
|
|
826
|
+
className: t.nextBtn,
|
|
827
|
+
children: _
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
] }), as = ({
|
|
831
|
+
categories: n,
|
|
832
|
+
selectedCategory: l,
|
|
833
|
+
templates: u,
|
|
834
|
+
selectedTemplateId: i,
|
|
835
|
+
currentStepNumber: o,
|
|
836
|
+
totalSteps: d,
|
|
837
|
+
onSelectCategory: _,
|
|
838
|
+
onSelectTemplate: g,
|
|
839
|
+
onCreateBlank: c,
|
|
840
|
+
onEditTemplate: N,
|
|
841
|
+
onPrevious: w,
|
|
842
|
+
onNext: h
|
|
843
|
+
}) => /* @__PURE__ */ a(r, { className: t.chooseTemplateCard, children: [
|
|
844
|
+
/* @__PURE__ */ a(r, { children: [
|
|
845
|
+
/* @__PURE__ */ e(m, { variant: "h4", className: t.headerTitle, children: "Choose a Template" }),
|
|
846
|
+
/* @__PURE__ */ e(m, { variant: "body1", className: t.headerSubtitle, children: "Start with a template or create from scratch" })
|
|
847
|
+
] }),
|
|
848
|
+
/* @__PURE__ */ e(Xa, { onCreateBlank: c }),
|
|
849
|
+
/* @__PURE__ */ a(W, { spacing: 1, children: [
|
|
850
|
+
/* @__PURE__ */ e(m, { variant: "h6", className: t.sectionTitle, children: "Survey Templates" }),
|
|
851
|
+
/* @__PURE__ */ e(
|
|
852
|
+
es,
|
|
853
|
+
{
|
|
854
|
+
categories: n,
|
|
855
|
+
selectedCategory: l,
|
|
856
|
+
onSelectCategory: _
|
|
857
|
+
}
|
|
858
|
+
)
|
|
859
|
+
] }),
|
|
860
|
+
/* @__PURE__ */ e(Pe, { container: !0, spacing: 2.5, sx: { mt: 1 }, children: u.map((f) => /* @__PURE__ */ e(Pe, { item: !0, xs: 12, sm: 6, md: 4, children: /* @__PURE__ */ e(
|
|
861
|
+
ts,
|
|
862
|
+
{
|
|
863
|
+
template: f,
|
|
864
|
+
isSelected: i === f.id,
|
|
865
|
+
onSelect: g,
|
|
866
|
+
onEdit: N
|
|
867
|
+
}
|
|
868
|
+
) }, f.id)) }),
|
|
869
|
+
/* @__PURE__ */ e(
|
|
870
|
+
pe,
|
|
871
|
+
{
|
|
872
|
+
currentStep: o,
|
|
873
|
+
totalSteps: d,
|
|
874
|
+
onPrevious: w,
|
|
875
|
+
onNext: h
|
|
876
|
+
}
|
|
877
|
+
)
|
|
878
|
+
] }), ss = xe(/* @__PURE__ */ e("path", {
|
|
879
|
+
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
|
|
880
|
+
}), "DeleteOutlineOutlined"), Ve = ({ type: n }) => {
|
|
881
|
+
const l = (o) => {
|
|
882
|
+
if (typeof o == "number" || !isNaN(Number(o))) {
|
|
883
|
+
const d = Number(o);
|
|
884
|
+
if (d === 0) return "Text";
|
|
885
|
+
if (d === 1) return "MultipleChoice";
|
|
886
|
+
if (d === 2 || d === 3) return "Slider";
|
|
887
|
+
if (d === 4) return "YesNo";
|
|
888
|
+
if (d === 5) return "SingleChoice";
|
|
889
|
+
if (d === 6) return "Date";
|
|
890
|
+
}
|
|
891
|
+
return String(o);
|
|
892
|
+
}, u = (o) => {
|
|
893
|
+
switch (l(o)) {
|
|
894
|
+
case "Rating":
|
|
895
|
+
case "StarRating":
|
|
896
|
+
case "Slider":
|
|
897
|
+
return t.badgeRating;
|
|
898
|
+
case "YesNo":
|
|
899
|
+
case "SingleChoice":
|
|
900
|
+
return t.badgeYesNo;
|
|
901
|
+
case "Text":
|
|
902
|
+
case "TextInput":
|
|
903
|
+
case "OpenField":
|
|
904
|
+
return t.badgeText;
|
|
905
|
+
default:
|
|
906
|
+
return t.badgeText;
|
|
907
|
+
}
|
|
908
|
+
}, i = (o) => {
|
|
909
|
+
const d = l(o);
|
|
910
|
+
switch (d) {
|
|
911
|
+
case "YesNo":
|
|
912
|
+
return "Yes/No";
|
|
913
|
+
case "SingleChoice":
|
|
914
|
+
return "Single Choice";
|
|
915
|
+
case "StarRating":
|
|
916
|
+
case "Rating":
|
|
917
|
+
return "Rating";
|
|
918
|
+
case "TextInput":
|
|
919
|
+
case "OpenField":
|
|
920
|
+
case "Text":
|
|
921
|
+
return "Text";
|
|
922
|
+
case "MultipleChoice":
|
|
923
|
+
return "Multiple Choice";
|
|
924
|
+
default:
|
|
925
|
+
return d;
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
return /* @__PURE__ */ e(r, { className: `${t.questionTypeBadge} ${u(n)}`, children: /* @__PURE__ */ e(m, { variant: "caption", className: t.badgeTextLabel, children: i(n) }) });
|
|
929
|
+
}, je = ({
|
|
930
|
+
questions: n,
|
|
931
|
+
onEditQuestion: l,
|
|
932
|
+
onRemoveQuestion: u
|
|
933
|
+
}) => /* @__PURE__ */ e(gt, { className: t.tableContainerWrapper, children: /* @__PURE__ */ a(Ne, { className: t.questionsTable, children: [
|
|
934
|
+
/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ a(V, { className: t.tableHeaderRow, children: [
|
|
935
|
+
/* @__PURE__ */ e(T, { className: t.thNumber, children: "#" }),
|
|
936
|
+
/* @__PURE__ */ e(T, { className: t.thQuestion, children: "Question" }),
|
|
937
|
+
/* @__PURE__ */ e(T, { className: t.thType, children: "Type" }),
|
|
938
|
+
/* @__PURE__ */ e(T, { className: t.thCategory, children: "Category" }),
|
|
939
|
+
/* @__PURE__ */ e(T, { className: t.thActions, children: "Actions" })
|
|
940
|
+
] }) }),
|
|
941
|
+
/* @__PURE__ */ e(Te, { children: n.map((i, o) => /* @__PURE__ */ a(V, { className: t.tableBodyRow, children: [
|
|
942
|
+
/* @__PURE__ */ a(T, { className: t.tdNumber, children: [
|
|
943
|
+
o + 1,
|
|
944
|
+
"."
|
|
945
|
+
] }),
|
|
946
|
+
/* @__PURE__ */ e(T, { className: t.tdQuestion, children: /* @__PURE__ */ e(
|
|
947
|
+
m,
|
|
948
|
+
{
|
|
949
|
+
variant: "body2",
|
|
950
|
+
className: t.questionText,
|
|
951
|
+
dangerouslySetInnerHTML: {
|
|
952
|
+
__html: i.questionText || ""
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
) }),
|
|
956
|
+
/* @__PURE__ */ e(T, { className: t.tdType, children: /* @__PURE__ */ e(Ve, { type: i.type }) }),
|
|
957
|
+
/* @__PURE__ */ e(T, { className: t.tdCategory, children: /* @__PURE__ */ e(m, { variant: "body2", className: t.categoryText, children: i.category }) }),
|
|
958
|
+
/* @__PURE__ */ e(T, { className: t.tdActions, children: /* @__PURE__ */ a(W, { direction: "row", spacing: 1.5, alignItems: "center", children: [
|
|
959
|
+
/* @__PURE__ */ e(
|
|
960
|
+
G,
|
|
961
|
+
{
|
|
962
|
+
onClick: () => l(i.id),
|
|
963
|
+
startIcon: /* @__PURE__ */ e(ue, { fontSize: "small" }),
|
|
964
|
+
className: t.tableEditBtn,
|
|
965
|
+
children: "Edit"
|
|
966
|
+
}
|
|
967
|
+
),
|
|
968
|
+
/* @__PURE__ */ e(
|
|
969
|
+
G,
|
|
970
|
+
{
|
|
971
|
+
onClick: () => u(i.id),
|
|
972
|
+
startIcon: /* @__PURE__ */ e(ss, { fontSize: "small" }),
|
|
973
|
+
className: t.tableRemoveBtn,
|
|
974
|
+
children: "Remove"
|
|
975
|
+
}
|
|
976
|
+
)
|
|
977
|
+
] }) })
|
|
978
|
+
] }, i.id)) })
|
|
979
|
+
] }) }), ls = ({
|
|
980
|
+
formData: n,
|
|
981
|
+
questionCategories: l,
|
|
982
|
+
filteredQuestions: u,
|
|
983
|
+
totalQuestionsCount: i,
|
|
984
|
+
currentStepNumber: o,
|
|
985
|
+
totalSteps: d,
|
|
986
|
+
onTemplateNameChange: _,
|
|
987
|
+
onDescriptionChange: g,
|
|
988
|
+
onCategoryFilterChange: c,
|
|
989
|
+
onEditQuestion: N,
|
|
990
|
+
onRemoveQuestion: w,
|
|
991
|
+
onAddQuestion: h,
|
|
992
|
+
onPrevious: f,
|
|
993
|
+
onNext: q
|
|
994
|
+
}) => {
|
|
995
|
+
const v = (S) => {
|
|
996
|
+
c(S.target.value);
|
|
997
|
+
};
|
|
998
|
+
return /* @__PURE__ */ a(r, { className: t.chooseTemplateCard, children: [
|
|
999
|
+
/* @__PURE__ */ a(r, { className: t.headerSection, children: [
|
|
1000
|
+
/* @__PURE__ */ e(m, { variant: "h5", className: t.headerTitle, children: "Check Details" }),
|
|
1001
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.headerSubtitle, children: "Review and edit the details below." })
|
|
1002
|
+
] }),
|
|
1003
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
1004
|
+
/* @__PURE__ */ a(m, { variant: "subtitle2", className: t.formFieldLabel, children: [
|
|
1005
|
+
"Template Name ",
|
|
1006
|
+
/* @__PURE__ */ e("span", { className: t.requiredAsterisk, children: "*" })
|
|
1007
|
+
] }),
|
|
1008
|
+
/* @__PURE__ */ e(
|
|
1009
|
+
ee,
|
|
1010
|
+
{
|
|
1011
|
+
fullWidth: !0,
|
|
1012
|
+
variant: "outlined",
|
|
1013
|
+
value: n.templateName,
|
|
1014
|
+
onChange: (S) => _(S.target.value),
|
|
1015
|
+
placeholder: "Enter template name",
|
|
1016
|
+
className: t.customTextField
|
|
1017
|
+
}
|
|
1018
|
+
)
|
|
1019
|
+
] }),
|
|
1020
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
1021
|
+
/* @__PURE__ */ e(m, { variant: "subtitle2", className: t.formFieldLabel, children: "Description and instructions of when to use" }),
|
|
1022
|
+
/* @__PURE__ */ e(
|
|
1023
|
+
ee,
|
|
1024
|
+
{
|
|
1025
|
+
fullWidth: !0,
|
|
1026
|
+
multiline: !0,
|
|
1027
|
+
rows: 3,
|
|
1028
|
+
variant: "outlined",
|
|
1029
|
+
value: n.description,
|
|
1030
|
+
onChange: (S) => g(S.target.value),
|
|
1031
|
+
placeholder: "Enter description and instructions",
|
|
1032
|
+
className: t.customTextField
|
|
1033
|
+
}
|
|
1034
|
+
)
|
|
1035
|
+
] }),
|
|
1036
|
+
/* @__PURE__ */ a(r, { className: t.questionsHeaderSection, children: [
|
|
1037
|
+
/* @__PURE__ */ a(W, { direction: "row", alignItems: "center", spacing: 0.75, sx: { mb: 1.5 }, children: [
|
|
1038
|
+
/* @__PURE__ */ e(m, { variant: "subtitle1", className: t.questionsTitle, children: "Questions" }),
|
|
1039
|
+
/* @__PURE__ */ e(m, { variant: "subtitle1", className: t.questionsCountNumber, children: i })
|
|
1040
|
+
] }),
|
|
1041
|
+
/* @__PURE__ */ a(W, { direction: "row", alignItems: "center", spacing: 1.5, className: t.filterByRow, children: [
|
|
1042
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.filterByLabel, children: "Filter by category" }),
|
|
1043
|
+
/* @__PURE__ */ e(oe, { size: "small", className: t.categoryFilterFormControl, children: /* @__PURE__ */ e(
|
|
1044
|
+
ce,
|
|
1045
|
+
{
|
|
1046
|
+
value: n.selectedCategoryFilter,
|
|
1047
|
+
onChange: v,
|
|
1048
|
+
className: t.categorySelectInput,
|
|
1049
|
+
children: l.map((S) => /* @__PURE__ */ e(de, { value: S, children: S }, S))
|
|
1050
|
+
}
|
|
1051
|
+
) })
|
|
1052
|
+
] })
|
|
1053
|
+
] }),
|
|
1054
|
+
/* @__PURE__ */ e(
|
|
1055
|
+
je,
|
|
1056
|
+
{
|
|
1057
|
+
questions: u,
|
|
1058
|
+
onEditQuestion: N,
|
|
1059
|
+
onRemoveQuestion: w
|
|
1060
|
+
}
|
|
1061
|
+
),
|
|
1062
|
+
/* @__PURE__ */ e(r, { className: t.addQuestionWrapper, children: /* @__PURE__ */ e(
|
|
1063
|
+
G,
|
|
1064
|
+
{
|
|
1065
|
+
onClick: h,
|
|
1066
|
+
startIcon: /* @__PURE__ */ e(Ue, {}),
|
|
1067
|
+
className: t.addQuestionBtn,
|
|
1068
|
+
children: "ADD QUESTION"
|
|
1069
|
+
}
|
|
1070
|
+
) }),
|
|
1071
|
+
/* @__PURE__ */ e(
|
|
1072
|
+
pe,
|
|
1073
|
+
{
|
|
1074
|
+
currentStep: o,
|
|
1075
|
+
totalSteps: d,
|
|
1076
|
+
onPrevious: f,
|
|
1077
|
+
onNext: q,
|
|
1078
|
+
isNextDisabled: !n.templateName || n.templateName.trim() === ""
|
|
1079
|
+
}
|
|
1080
|
+
)
|
|
1081
|
+
] });
|
|
1082
|
+
}, rs = ({
|
|
1083
|
+
formData: n,
|
|
1084
|
+
currentStepNumber: l,
|
|
1085
|
+
totalSteps: u,
|
|
1086
|
+
onTitleChange: i,
|
|
1087
|
+
onDeadlineChange: o,
|
|
1088
|
+
onPrevious: d,
|
|
1089
|
+
onNext: _
|
|
1090
|
+
}) => /* @__PURE__ */ a(r, { className: t.chooseTemplateCard, children: [
|
|
1091
|
+
/* @__PURE__ */ a(r, { className: t.headerSection, children: [
|
|
1092
|
+
/* @__PURE__ */ e(m, { variant: "h5", className: t.headerTitle, children: "Create Survey" }),
|
|
1093
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.headerSubtitle, children: "Set the title and deadline for your survey" })
|
|
1094
|
+
] }),
|
|
1095
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
1096
|
+
/* @__PURE__ */ a(m, { variant: "subtitle2", className: t.formFieldLabel, children: [
|
|
1097
|
+
"Title ",
|
|
1098
|
+
/* @__PURE__ */ e("span", { className: t.requiredAsterisk, children: "*" })
|
|
1099
|
+
] }),
|
|
1100
|
+
/* @__PURE__ */ e(
|
|
1101
|
+
ee,
|
|
1102
|
+
{
|
|
1103
|
+
fullWidth: !0,
|
|
1104
|
+
variant: "outlined",
|
|
1105
|
+
value: n.title,
|
|
1106
|
+
onChange: (g) => i(g.target.value),
|
|
1107
|
+
placeholder: "Enter survey title",
|
|
1108
|
+
className: t.customTextField
|
|
1109
|
+
}
|
|
1110
|
+
)
|
|
1111
|
+
] }),
|
|
1112
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
1113
|
+
/* @__PURE__ */ a(m, { variant: "subtitle2", className: t.formFieldLabel, children: [
|
|
1114
|
+
"Deadline ",
|
|
1115
|
+
/* @__PURE__ */ e("span", { className: t.requiredAsterisk, children: "*" })
|
|
1116
|
+
] }),
|
|
1117
|
+
/* @__PURE__ */ e(Rt, { dateAdapter: Lt, children: /* @__PURE__ */ e(
|
|
1118
|
+
Et,
|
|
1119
|
+
{
|
|
1120
|
+
value: n.deadline ? qe(n.deadline, "DD.MM.YYYY hh:mm A") : null,
|
|
1121
|
+
onChange: (g) => {
|
|
1122
|
+
o(g ? g.format("DD.MM.YYYY hh:mm A") : "");
|
|
1123
|
+
},
|
|
1124
|
+
format: "DD.MM.YYYY hh:mm A",
|
|
1125
|
+
slotProps: {
|
|
1126
|
+
textField: {
|
|
1127
|
+
fullWidth: !0,
|
|
1128
|
+
variant: "outlined",
|
|
1129
|
+
placeholder: "DD.MM.YYYY hh:mm A",
|
|
1130
|
+
className: t.customTextField
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
) }),
|
|
1135
|
+
/* @__PURE__ */ e(m, { variant: "caption", className: t.formFieldHelperText, children: "Select the date and time when the survey will close" })
|
|
1136
|
+
] }),
|
|
1137
|
+
/* @__PURE__ */ e(
|
|
1138
|
+
pe,
|
|
1139
|
+
{
|
|
1140
|
+
currentStep: l,
|
|
1141
|
+
totalSteps: u,
|
|
1142
|
+
onPrevious: d,
|
|
1143
|
+
onNext: _,
|
|
1144
|
+
isNextDisabled: !n.title || n.title.trim() === "" || !n.deadline
|
|
1145
|
+
}
|
|
1146
|
+
)
|
|
1147
|
+
] }), he = ({ size: n = 32, color: l = "#C44140" }) => /* @__PURE__ */ e("svg", { width: n, height: n, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M28.2409 -0.141754C25.4195 3.28575 25.0819 7.25702 25.2536 11.6181C25.4635 16.9475 26.3117 24.291 27.1324 29.5842C27.2535 30.3658 26.3405 30.8232 25.7942 30.2545C22.7477 27.0829 19.2078 23.33 16.0196 19.1775C13.2409 22.6735 11.0153 26.7226 8.60824 31.0487C8.37898 31.4608 7.83452 31.5433 7.47943 31.2194C7.07049 30.8465 6.80209 30.3374 6.72382 29.7869C5.03439 17.9028 4.08511 12.0405 3.95375 -0.206989L28.2409 -0.141754Z", fill: l }) }), x = {
|
|
1148
|
+
"flag-of-session": "_flag-of-session_izm26_530",
|
|
1149
|
+
"flag-of-session__title-red": "_flag-of-session__title-red_izm26_539",
|
|
1150
|
+
"flag-of-session__title-red--text": "_flag-of-session__title-red--text_izm26_544",
|
|
1151
|
+
"flag-of-session__title-yellow": "_flag-of-session__title-yellow_izm26_561",
|
|
1152
|
+
"flag-of-session__title-yellow--text": "_flag-of-session__title-yellow--text_izm26_566",
|
|
1153
|
+
"flag-of-session__content-green": "_flag-of-session__content-green_izm26_572",
|
|
1154
|
+
"flag-of-session__content-green--text": "_flag-of-session__content-green--text_izm26_579",
|
|
1155
|
+
"flag-of-session__item": "_flag-of-session__item_izm26_586",
|
|
1156
|
+
"flag-of-session__item--title": "_flag-of-session__item--title_izm26_594",
|
|
1157
|
+
"flag-of-session__item--content": "_flag-of-session__item--content_izm26_601",
|
|
1158
|
+
"flag-of-session__item-column": "_flag-of-session__item-column_izm26_608",
|
|
1159
|
+
"flag-of-session__item-column--no-bold": "_flag-of-session__item-column--no-bold_izm26_620",
|
|
1160
|
+
"flag-of-session__item-column--content": "_flag-of-session__item-column--content_izm26_627"
|
|
1161
|
+
}, De = (n) => {
|
|
1162
|
+
switch (n) {
|
|
1163
|
+
case "Red Flag":
|
|
1164
|
+
return /* @__PURE__ */ a("div", { className: x["flag-of-session__title-red"], children: [
|
|
1165
|
+
/* @__PURE__ */ e(he, { color: "#C44140", size: 32 }),
|
|
1166
|
+
/* @__PURE__ */ e("span", { className: x["flag-of-session__title-red--text"], children: "Red Flag" })
|
|
1167
|
+
] });
|
|
1168
|
+
case "Yellow Flag":
|
|
1169
|
+
return /* @__PURE__ */ a("div", { className: x["flag-of-session__title-yellow"], children: [
|
|
1170
|
+
/* @__PURE__ */ e(he, { color: "#F5D500", size: 32 }),
|
|
1171
|
+
/* @__PURE__ */ e("span", { className: x["flag-of-session__title-yellow--text"], children: "Yellow Flag" })
|
|
1172
|
+
] });
|
|
1173
|
+
default:
|
|
1174
|
+
return null;
|
|
1175
|
+
}
|
|
1176
|
+
}, is = ({
|
|
1177
|
+
flag: n,
|
|
1178
|
+
flagDetail: l,
|
|
1179
|
+
lastSafetyAnswer: u,
|
|
1180
|
+
lastStressAnswer: i,
|
|
1181
|
+
showResult: o,
|
|
1182
|
+
defaultStress: d,
|
|
1183
|
+
defaultSafety: _,
|
|
1184
|
+
defaultDecrease: g,
|
|
1185
|
+
isDetailView: c,
|
|
1186
|
+
hasReadyToLearn: N,
|
|
1187
|
+
inSession: w
|
|
1188
|
+
}) => o ? /* @__PURE__ */ a("div", { className: x["flag-of-session"], style: { gap: "6px" }, children: [
|
|
1189
|
+
(n === "Green Flag" || n === "Green") && /* @__PURE__ */ a("div", { className: x["flag-of-session__content-green"], children: [
|
|
1190
|
+
"Everything is ",
|
|
1191
|
+
/* @__PURE__ */ e("p", { className: x["flag-of-session__content-green--text"], children: "fine" })
|
|
1192
|
+
] }),
|
|
1193
|
+
c && n && De(n || ""),
|
|
1194
|
+
l?.stress && (c ? /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1195
|
+
/* @__PURE__ */ e("p", { className: x["flag-of-session__item--title"], children: "Stress score:" }),
|
|
1196
|
+
/* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1197
|
+
l?.stress?.score,
|
|
1198
|
+
"%"
|
|
1199
|
+
] })
|
|
1200
|
+
] }) : /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1201
|
+
/* @__PURE__ */ a(
|
|
1202
|
+
"span",
|
|
1203
|
+
{
|
|
1204
|
+
style: {
|
|
1205
|
+
fontWeight: 600,
|
|
1206
|
+
color: l?.stress?.flag === "Red Flag" ? "#C44140" : "#F5D500",
|
|
1207
|
+
fontSize: "12px"
|
|
1208
|
+
},
|
|
1209
|
+
children: [
|
|
1210
|
+
l?.stress?.score,
|
|
1211
|
+
"%"
|
|
1212
|
+
]
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1215
|
+
"Stress vs Last check-in ",
|
|
1216
|
+
i,
|
|
1217
|
+
"%"
|
|
1218
|
+
] })),
|
|
1219
|
+
l?.safety && (c ? /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1220
|
+
/* @__PURE__ */ e("p", { className: x["flag-of-session__item--title"], children: "Safety score:" }),
|
|
1221
|
+
/* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1222
|
+
l?.safety?.score,
|
|
1223
|
+
"%"
|
|
1224
|
+
] })
|
|
1225
|
+
] }) : /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1226
|
+
/* @__PURE__ */ a("span", { style: { fontWeight: 600, color: l?.safety?.flag === "Red Flag" ? "#C44140" : "#F5D500" }, children: [
|
|
1227
|
+
l?.safety?.score,
|
|
1228
|
+
"%"
|
|
1229
|
+
] }),
|
|
1230
|
+
" Safety vs Last check-in ",
|
|
1231
|
+
u,
|
|
1232
|
+
"%"
|
|
1233
|
+
] })),
|
|
1234
|
+
l?.decrease && l?.decrease?.length > 0 && (c ? /* @__PURE__ */ a("div", { children: [
|
|
1235
|
+
/* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1236
|
+
/* @__PURE__ */ e("span", { className: x["flag-of-session__item--title"], children: "Sudden Drop: " }),
|
|
1237
|
+
/* @__PURE__ */ a("span", { className: x["flag-of-session__item--title"], children: [
|
|
1238
|
+
l.decrease.length,
|
|
1239
|
+
" "
|
|
1240
|
+
] }),
|
|
1241
|
+
"core well-being metric shows a decrease of ",
|
|
1242
|
+
g,
|
|
1243
|
+
"% comparing their average of the last four check-ins."
|
|
1244
|
+
] }),
|
|
1245
|
+
/* @__PURE__ */ e("ul", { className: x["flag-of-session__item-column--content"], children: l.decrease?.map((h, f) => /* @__PURE__ */ e("li", { style: { color: "#242424", marginLeft: "16px" }, children: /* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: /* @__PURE__ */ a("p", { style: { margin: 0 }, children: [
|
|
1246
|
+
h.questionText,
|
|
1247
|
+
": ",
|
|
1248
|
+
h.answer,
|
|
1249
|
+
"% ",
|
|
1250
|
+
h.averageOtherRatingsText ? "" : h.averageOtherRatings !== void 0 ? `vs avr ${h.averageOtherRatings}%` : "vs previous"
|
|
1251
|
+
] }) }) }, f)) })
|
|
1252
|
+
] }) : w ? /* @__PURE__ */ a("div", { className: x["flag-of-session__item-column"], children: [
|
|
1253
|
+
/* @__PURE__ */ a("p", { className: x["flag-of-session__item-column--no-bold"], children: [
|
|
1254
|
+
"Sudden Drop: ",
|
|
1255
|
+
l.decrease.length || 0,
|
|
1256
|
+
" core well-being metric shows a decrease compared to the average of the last four check-ins."
|
|
1257
|
+
] }),
|
|
1258
|
+
/* @__PURE__ */ e("ul", { className: x["flag-of-session__item-column--content"], children: l.decrease?.map((h, f) => {
|
|
1259
|
+
const v = n?.includes("Red") ? "#C44140" : "#F5D500";
|
|
1260
|
+
return /* @__PURE__ */ e("li", { style: { color: "#242424", marginLeft: "16px" }, children: /* @__PURE__ */ a("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1261
|
+
/* @__PURE__ */ a("p", { style: { margin: 0, fontSize: "12px" }, children: [
|
|
1262
|
+
h.questionText,
|
|
1263
|
+
":"
|
|
1264
|
+
] }),
|
|
1265
|
+
/* @__PURE__ */ a("p", { style: { margin: 0, color: v, fontSize: "12px" }, children: [
|
|
1266
|
+
h.answer,
|
|
1267
|
+
"%"
|
|
1268
|
+
] }),
|
|
1269
|
+
h.averageOtherRatingsText ? "" : h.averageOtherRatings !== void 0 && /* @__PURE__ */ a("p", { style: { margin: 0, fontSize: "12px", marginLeft: "4px" }, children: [
|
|
1270
|
+
"vs avr ",
|
|
1271
|
+
h.averageOtherRatings,
|
|
1272
|
+
"%"
|
|
1273
|
+
] })
|
|
1274
|
+
] }) }, f);
|
|
1275
|
+
}) })
|
|
1276
|
+
] }) : /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1277
|
+
"Sudden Drop: Any core well-being metric shows a percentage decrease of ",
|
|
1278
|
+
g || 20,
|
|
1279
|
+
"% comparing their average of the last four check-ins."
|
|
1280
|
+
] })),
|
|
1281
|
+
l?.readinessToLearn && (c ? /* @__PURE__ */ e("div", { children: /* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1282
|
+
/* @__PURE__ */ e("span", { className: x["flag-of-session__item--title"], children: "Ready to learn: " }),
|
|
1283
|
+
l?.readinessToLearn
|
|
1284
|
+
] }) }) : /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1285
|
+
"Ready to learn: ",
|
|
1286
|
+
l?.readinessToLearn
|
|
1287
|
+
] }))
|
|
1288
|
+
] }) : /* @__PURE__ */ a("div", { className: x["flag-of-session"], children: [
|
|
1289
|
+
De(n || ""),
|
|
1290
|
+
_ && /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1291
|
+
/* @__PURE__ */ e("p", { className: x["flag-of-session__item--title"], children: "Safety score:" }),
|
|
1292
|
+
/* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1293
|
+
"Under ",
|
|
1294
|
+
_,
|
|
1295
|
+
"%"
|
|
1296
|
+
] })
|
|
1297
|
+
] }),
|
|
1298
|
+
d && /* @__PURE__ */ a("div", { className: x["flag-of-session__item"], children: [
|
|
1299
|
+
/* @__PURE__ */ e("p", { className: x["flag-of-session__item--title"], children: "Stress level:" }),
|
|
1300
|
+
/* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1301
|
+
"Higher than ",
|
|
1302
|
+
d,
|
|
1303
|
+
"%"
|
|
1304
|
+
] })
|
|
1305
|
+
] }),
|
|
1306
|
+
g && /* @__PURE__ */ e("div", { children: /* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1307
|
+
/* @__PURE__ */ e("span", { className: x["flag-of-session__item--title"], children: "Sudden Drop: " }),
|
|
1308
|
+
"Any core well-being metric shows a percentage decrease of ",
|
|
1309
|
+
g,
|
|
1310
|
+
"% comparing their average of the last four check-ins."
|
|
1311
|
+
] }) }),
|
|
1312
|
+
N && /* @__PURE__ */ e("div", { children: /* @__PURE__ */ a("p", { className: x["flag-of-session__item--content"], children: [
|
|
1313
|
+
/* @__PURE__ */ e("span", { className: x["flag-of-session__item--title"], children: "Ready to learn: " }),
|
|
1314
|
+
"The student reported as not ready to learn in last check-in."
|
|
1315
|
+
] }) })
|
|
1316
|
+
] }), os = At(({ className: n, ...l }) => /* @__PURE__ */ e(We, { ...l, classes: { popper: n } }))(({ theme: n }) => ({
|
|
1317
|
+
zIndex: 1e3,
|
|
1318
|
+
[`& .${we.tooltip}`]: {
|
|
1319
|
+
backgroundColor: "transparent !important",
|
|
1320
|
+
marginTop: "8px !important",
|
|
1321
|
+
fontFamily: "Poppins-Regular"
|
|
1322
|
+
},
|
|
1323
|
+
[`& .${we.arrow}`]: {
|
|
1324
|
+
color: n.palette.common.white,
|
|
1325
|
+
top: "4px !important"
|
|
1326
|
+
}
|
|
1327
|
+
})), cs = (n) => {
|
|
1328
|
+
if (!n) return null;
|
|
1329
|
+
const l = n.toLowerCase();
|
|
1330
|
+
return l === "red" ? /* @__PURE__ */ e(he, { size: 32, color: "#C44140" }) : l === "yellow" ? /* @__PURE__ */ e(he, { size: 32, color: "#F5D500" }) : l === "green" ? /* @__PURE__ */ e(he, { size: 32, color: "#10B981" }) : null;
|
|
1331
|
+
}, ds = ({
|
|
1332
|
+
students: n,
|
|
1333
|
+
totalStudentsCount: l,
|
|
1334
|
+
totalSelectedCount: u,
|
|
1335
|
+
selectedStudentIds: i,
|
|
1336
|
+
filters: o,
|
|
1337
|
+
gradeOptions: d,
|
|
1338
|
+
flagOptions: _,
|
|
1339
|
+
teacherOptions: g,
|
|
1340
|
+
page: c,
|
|
1341
|
+
rowsPerPage: N,
|
|
1342
|
+
isAllSelected: w,
|
|
1343
|
+
isIndeterminate: h,
|
|
1344
|
+
sortBy: f,
|
|
1345
|
+
sortOrder: q,
|
|
1346
|
+
onSortChange: v,
|
|
1347
|
+
currentStepNumber: S,
|
|
1348
|
+
totalSteps: k,
|
|
1349
|
+
onSearchChange: F,
|
|
1350
|
+
onGradeChange: C,
|
|
1351
|
+
onFlagChange: z,
|
|
1352
|
+
onTeacherChange: E,
|
|
1353
|
+
onPageChange: J,
|
|
1354
|
+
onRowsPerPageChange: Y,
|
|
1355
|
+
onToggleSelectAll: Z,
|
|
1356
|
+
onToggleStudent: j,
|
|
1357
|
+
onPrevious: X,
|
|
1358
|
+
onNext: K
|
|
1359
|
+
}) => {
|
|
1360
|
+
const te = (s) => {
|
|
1361
|
+
C(s.target.value);
|
|
1362
|
+
}, y = (s) => {
|
|
1363
|
+
z(s.target.value);
|
|
1364
|
+
}, b = (s) => {
|
|
1365
|
+
E(s.target.value);
|
|
1366
|
+
};
|
|
1367
|
+
return /* @__PURE__ */ a(r, { className: t.chooseTemplateCard, children: [
|
|
1368
|
+
/* @__PURE__ */ a(r, { className: t.headerSection, children: [
|
|
1369
|
+
/* @__PURE__ */ e(m, { variant: "h5", className: t.headerTitle, children: "Select Students" }),
|
|
1370
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.headerSubtitle, children: "Choose the students who should participate in this survey" })
|
|
1371
|
+
] }),
|
|
1372
|
+
/* @__PURE__ */ e(r, { className: t.selectedCountSection, children: /* @__PURE__ */ a(m, { variant: "subtitle1", className: t.selectedCountText, children: [
|
|
1373
|
+
"Selected students",
|
|
1374
|
+
" ",
|
|
1375
|
+
/* @__PURE__ */ e(r, { component: "span", className: t.selectedCountHighlight, children: u })
|
|
1376
|
+
] }) }),
|
|
1377
|
+
/* @__PURE__ */ a(r, { className: t.studentsToolbar, children: [
|
|
1378
|
+
/* @__PURE__ */ e(r, { className: t.searchBarContainer, children: /* @__PURE__ */ e(
|
|
1379
|
+
ee,
|
|
1380
|
+
{
|
|
1381
|
+
fullWidth: !0,
|
|
1382
|
+
size: "small",
|
|
1383
|
+
placeholder: "Search students by name or email...",
|
|
1384
|
+
value: o.searchQuery,
|
|
1385
|
+
onChange: (s) => F(s.target.value),
|
|
1386
|
+
className: t.studentSearchInput,
|
|
1387
|
+
InputProps: {
|
|
1388
|
+
startAdornment: /* @__PURE__ */ e(pt, { position: "start", children: /* @__PURE__ */ e(kt, { sx: { color: "#94a3b8", fontSize: 20 } }) })
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
) }),
|
|
1392
|
+
/* @__PURE__ */ e(r, { className: t.filterDropdownWrapper, children: /* @__PURE__ */ e(oe, { size: "small", fullWidth: !0, children: /* @__PURE__ */ e(
|
|
1393
|
+
ce,
|
|
1394
|
+
{
|
|
1395
|
+
value: o.selectedGrade,
|
|
1396
|
+
onChange: te,
|
|
1397
|
+
displayEmpty: !0,
|
|
1398
|
+
className: t.filterSelectBox,
|
|
1399
|
+
children: d.map((s) => /* @__PURE__ */ e(de, { value: s, children: s }, s))
|
|
1400
|
+
}
|
|
1401
|
+
) }) }),
|
|
1402
|
+
/* @__PURE__ */ e(r, { className: t.filterDropdownWrapper, children: /* @__PURE__ */ e(oe, { size: "small", fullWidth: !0, children: /* @__PURE__ */ e(
|
|
1403
|
+
ce,
|
|
1404
|
+
{
|
|
1405
|
+
value: o.selectedFlag,
|
|
1406
|
+
onChange: y,
|
|
1407
|
+
displayEmpty: !0,
|
|
1408
|
+
className: t.filterSelectBox,
|
|
1409
|
+
children: _.map((s) => /* @__PURE__ */ e(de, { value: s.value, children: s.label }, s.value))
|
|
1410
|
+
}
|
|
1411
|
+
) }) }),
|
|
1412
|
+
/* @__PURE__ */ e(r, { className: t.filterDropdownWrapper, children: /* @__PURE__ */ e(oe, { size: "small", fullWidth: !0, children: /* @__PURE__ */ e(
|
|
1413
|
+
ce,
|
|
1414
|
+
{
|
|
1415
|
+
value: o.selectedTeacher,
|
|
1416
|
+
onChange: b,
|
|
1417
|
+
displayEmpty: !0,
|
|
1418
|
+
className: t.filterSelectBox,
|
|
1419
|
+
children: g.map((s) => /* @__PURE__ */ e(de, { value: s, children: s }, s))
|
|
1420
|
+
}
|
|
1421
|
+
) }) })
|
|
1422
|
+
] }),
|
|
1423
|
+
/* @__PURE__ */ a(r, { className: t.studentsTableContainer, children: [
|
|
1424
|
+
/* @__PURE__ */ a(Ne, { className: t.studentsTable, children: [
|
|
1425
|
+
/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ a(V, { className: t.studentsTableHeaderRow, children: [
|
|
1426
|
+
/* @__PURE__ */ e(T, { className: t.checkboxHeaderCell, children: /* @__PURE__ */ e(
|
|
1427
|
+
Le,
|
|
1428
|
+
{
|
|
1429
|
+
checked: w,
|
|
1430
|
+
indeterminate: h,
|
|
1431
|
+
onChange: Z,
|
|
1432
|
+
sx: {
|
|
1433
|
+
color: "#cbd5e1",
|
|
1434
|
+
"&.Mui-checked": { color: "#2563eb" },
|
|
1435
|
+
"&.MuiCheckbox-indeterminate": { color: "#2563eb" }
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
) }),
|
|
1439
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: /* @__PURE__ */ e(
|
|
1440
|
+
ie,
|
|
1441
|
+
{
|
|
1442
|
+
active: f === "name",
|
|
1443
|
+
direction: f === "name" ? q : "asc",
|
|
1444
|
+
onClick: () => v("name"),
|
|
1445
|
+
children: "Student Name"
|
|
1446
|
+
}
|
|
1447
|
+
) }),
|
|
1448
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: /* @__PURE__ */ e(
|
|
1449
|
+
ie,
|
|
1450
|
+
{
|
|
1451
|
+
active: f === "flag",
|
|
1452
|
+
direction: f === "flag" ? q : "asc",
|
|
1453
|
+
onClick: () => v("flag"),
|
|
1454
|
+
children: "Flag"
|
|
1455
|
+
}
|
|
1456
|
+
) }),
|
|
1457
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: /* @__PURE__ */ e(
|
|
1458
|
+
ie,
|
|
1459
|
+
{
|
|
1460
|
+
active: f === "grade",
|
|
1461
|
+
direction: f === "grade" ? q : "asc",
|
|
1462
|
+
onClick: () => v("grade"),
|
|
1463
|
+
children: "Grade"
|
|
1464
|
+
}
|
|
1465
|
+
) }),
|
|
1466
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: /* @__PURE__ */ e(
|
|
1467
|
+
ie,
|
|
1468
|
+
{
|
|
1469
|
+
active: f === "teacher",
|
|
1470
|
+
direction: f === "teacher" ? q : "asc",
|
|
1471
|
+
onClick: () => v("teacher"),
|
|
1472
|
+
children: "Teacher"
|
|
1473
|
+
}
|
|
1474
|
+
) }),
|
|
1475
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: /* @__PURE__ */ e(
|
|
1476
|
+
ie,
|
|
1477
|
+
{
|
|
1478
|
+
active: f === "email",
|
|
1479
|
+
direction: f === "email" ? q : "asc",
|
|
1480
|
+
onClick: () => v("email"),
|
|
1481
|
+
children: "Email"
|
|
1482
|
+
}
|
|
1483
|
+
) })
|
|
1484
|
+
] }) }),
|
|
1485
|
+
/* @__PURE__ */ e(Te, { children: n.length === 0 ? /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(T, { colSpan: 5, align: "center", sx: { py: 4, color: "#94a3b8" }, children: "No students found matching current filters." }) }) : n.map((s) => {
|
|
1486
|
+
const B = i.includes(s.id);
|
|
1487
|
+
return /* @__PURE__ */ a(
|
|
1488
|
+
V,
|
|
1489
|
+
{
|
|
1490
|
+
className: `${t.studentTableRow} ${B ? t.selectedRow : ""}`,
|
|
1491
|
+
onClick: () => j(s.id),
|
|
1492
|
+
children: [
|
|
1493
|
+
/* @__PURE__ */ e(
|
|
1494
|
+
T,
|
|
1495
|
+
{
|
|
1496
|
+
className: t.checkboxBodyCell,
|
|
1497
|
+
onClick: (I) => I.stopPropagation(),
|
|
1498
|
+
children: /* @__PURE__ */ e(
|
|
1499
|
+
Le,
|
|
1500
|
+
{
|
|
1501
|
+
checked: B,
|
|
1502
|
+
onChange: () => j(s.id),
|
|
1503
|
+
sx: {
|
|
1504
|
+
color: "#cbd5e1",
|
|
1505
|
+
"&.Mui-checked": { color: "#2563eb" }
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1509
|
+
}
|
|
1510
|
+
),
|
|
1511
|
+
/* @__PURE__ */ e(T, { className: t.studentNameCell, children: /* @__PURE__ */ a(W, { direction: "row", alignItems: "center", spacing: 1.75, children: [
|
|
1512
|
+
/* @__PURE__ */ e(
|
|
1513
|
+
"img",
|
|
1514
|
+
{
|
|
1515
|
+
src: s.avatarUrl,
|
|
1516
|
+
alt: s.name,
|
|
1517
|
+
style: { width: 44, height: 44, borderRadius: "50%", objectFit: "cover" }
|
|
1518
|
+
}
|
|
1519
|
+
),
|
|
1520
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.studentNameText, children: s.name })
|
|
1521
|
+
] }) }),
|
|
1522
|
+
/* @__PURE__ */ e(T, { className: t.flagCell, children: /* @__PURE__ */ e(
|
|
1523
|
+
os,
|
|
1524
|
+
{
|
|
1525
|
+
arrow: !0,
|
|
1526
|
+
placement: "bottom",
|
|
1527
|
+
title: s?.flag && s.flag !== "none" ? /* @__PURE__ */ e(
|
|
1528
|
+
is,
|
|
1529
|
+
{
|
|
1530
|
+
flag: s.flag === "red" ? "Red Flag" : s.flag === "yellow" ? "Yellow Flag" : "Green Flag",
|
|
1531
|
+
flagDetail: s.flagDetail,
|
|
1532
|
+
lastSafetyAnswer: s.lastSafetyAnswer,
|
|
1533
|
+
lastStressAnswer: s.lastStressAnswer,
|
|
1534
|
+
showResult: !0
|
|
1535
|
+
}
|
|
1536
|
+
) : "",
|
|
1537
|
+
children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "center", cursor: "pointer" }, children: cs(s.flag) }) })
|
|
1538
|
+
}
|
|
1539
|
+
) }),
|
|
1540
|
+
/* @__PURE__ */ e(T, { className: t.gradeCell, children: /* @__PURE__ */ e(m, { variant: "body2", className: t.gradeText, children: s.grade }) }),
|
|
1541
|
+
/* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#475569" }, children: s.listTeachers && s.listTeachers.length > 0 ? s.listTeachers.map((I) => I.name).filter(Boolean).join(", ") : "-" }) }),
|
|
1542
|
+
/* @__PURE__ */ e(T, { className: t.emailCell, children: /* @__PURE__ */ e(m, { variant: "body2", className: t.emailText, children: s.email }) })
|
|
1543
|
+
]
|
|
1544
|
+
},
|
|
1545
|
+
s.id
|
|
1546
|
+
);
|
|
1547
|
+
}) })
|
|
1548
|
+
] }),
|
|
1549
|
+
l > 0 && /* @__PURE__ */ e(
|
|
1550
|
+
ft,
|
|
1551
|
+
{
|
|
1552
|
+
rowsPerPageOptions: [5, 10, 25, 50],
|
|
1553
|
+
component: "div",
|
|
1554
|
+
count: l,
|
|
1555
|
+
rowsPerPage: N,
|
|
1556
|
+
page: c,
|
|
1557
|
+
onPageChange: J,
|
|
1558
|
+
onRowsPerPageChange: Y,
|
|
1559
|
+
className: t.studentsPagination
|
|
1560
|
+
}
|
|
1561
|
+
)
|
|
1562
|
+
] }),
|
|
1563
|
+
/* @__PURE__ */ e(
|
|
1564
|
+
pe,
|
|
1565
|
+
{
|
|
1566
|
+
currentStep: S,
|
|
1567
|
+
totalSteps: k,
|
|
1568
|
+
onPrevious: X,
|
|
1569
|
+
onNext: K
|
|
1570
|
+
}
|
|
1571
|
+
)
|
|
1572
|
+
] });
|
|
1573
|
+
}, ms = ({ size: n = 32, color: l = "#C44140" }) => /* @__PURE__ */ e("svg", { width: n, height: n, viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e("path", { d: "M28.2409 -0.141754C25.4195 3.28575 25.0819 7.25702 25.2536 11.6181C25.4635 16.9475 26.3117 24.291 27.1324 29.5842C27.2535 30.3658 26.3405 30.8232 25.7942 30.2545C22.7477 27.0829 19.2078 23.33 16.0196 19.1775C13.2409 22.6735 11.0153 26.7226 8.60824 31.0487C8.37898 31.4608 7.83452 31.5433 7.47943 31.2194C7.07049 30.8465 6.80209 30.3374 6.72382 29.7869C5.03439 17.9028 4.08511 12.0405 3.95375 -0.206989L28.2409 -0.141754Z", fill: l }) }), us = _t(({ className: n, ...l }) => /* @__PURE__ */ e(We, { ...l, classes: { popper: n } }))(() => ({
|
|
1574
|
+
[`& .${we.tooltip}`]: {
|
|
1575
|
+
backgroundColor: "#ffffff",
|
|
1576
|
+
color: "#1e293b",
|
|
1577
|
+
maxWidth: 220,
|
|
1578
|
+
fontSize: "0.75rem",
|
|
1579
|
+
border: "1px solid #e2e8f0",
|
|
1580
|
+
boxShadow: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
|
|
1581
|
+
borderRadius: "8px",
|
|
1582
|
+
padding: "8px 12px"
|
|
1583
|
+
},
|
|
1584
|
+
[`& .${we.arrow}`]: {
|
|
1585
|
+
color: "#ffffff",
|
|
1586
|
+
"&:before": {
|
|
1587
|
+
border: "1px solid #e2e8f0"
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
})), hs = ({ flag: n, tooltip: l }) => {
|
|
1591
|
+
if (n === "none") return null;
|
|
1592
|
+
let u = "#10B981";
|
|
1593
|
+
return n === "red" ? u = "#D10530" : n === "yellow" ? u = "#F5D500" : n === "green" && (u = "#0F9655"), /* @__PURE__ */ e(us, { title: l ? /* @__PURE__ */ e(r, { sx: { lineHeight: 1.4 }, children: l }) : /* @__PURE__ */ e(r, { sx: { lineHeight: 1.4 }, children: n === "red" ? /* @__PURE__ */ a(Se, { children: [
|
|
1594
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#D10530", fontWeight: 700 }, children: "High" }),
|
|
1595
|
+
" Risk,",
|
|
1596
|
+
/* @__PURE__ */ e("br", {}),
|
|
1597
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#D10530", fontWeight: 700 }, children: "Negative" }),
|
|
1598
|
+
" readiness to learn"
|
|
1599
|
+
] }) : n === "yellow" ? /* @__PURE__ */ a(Se, { children: [
|
|
1600
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#F5D500", fontWeight: 700 }, children: "Moderate" }),
|
|
1601
|
+
" Risk,",
|
|
1602
|
+
/* @__PURE__ */ e("br", {}),
|
|
1603
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#F5D500", fontWeight: 700 }, children: "Caution" }),
|
|
1604
|
+
" readiness to learn"
|
|
1605
|
+
] }) : /* @__PURE__ */ a(Se, { children: [
|
|
1606
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#0F9655", fontWeight: 700 }, children: "Low" }),
|
|
1607
|
+
" Risk,",
|
|
1608
|
+
/* @__PURE__ */ e("br", {}),
|
|
1609
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#0F9655", fontWeight: 700 }, children: "Positive" }),
|
|
1610
|
+
" readiness to learn"
|
|
1611
|
+
] }) }), arrow: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
1612
|
+
r,
|
|
1613
|
+
{
|
|
1614
|
+
component: "span",
|
|
1615
|
+
sx: {
|
|
1616
|
+
display: "inline-flex",
|
|
1617
|
+
alignItems: "center",
|
|
1618
|
+
cursor: "pointer",
|
|
1619
|
+
transition: "transform 0.15s ease",
|
|
1620
|
+
"&:hover": {
|
|
1621
|
+
transform: "scale(1.15)"
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1624
|
+
children: /* @__PURE__ */ e(ms, { color: u, size: 28 })
|
|
1625
|
+
}
|
|
1626
|
+
) });
|
|
1627
|
+
}, gs = xe(/* @__PURE__ */ e("path", {
|
|
1628
|
+
d: "M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 16H5V10h14zm0-12H5V6h14zM9 14H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2zm-8 4H7v-2h2zm4 0h-2v-2h2zm4 0h-2v-2h2z"
|
|
1629
|
+
}), "CalendarMonthOutlined"), ps = ({
|
|
1630
|
+
open: n,
|
|
1631
|
+
title: l,
|
|
1632
|
+
description: u,
|
|
1633
|
+
deadline: i,
|
|
1634
|
+
questions: o,
|
|
1635
|
+
onClose: d
|
|
1636
|
+
}) => {
|
|
1637
|
+
const _ = (c) => {
|
|
1638
|
+
if (typeof c == "number" || !isNaN(Number(c))) {
|
|
1639
|
+
const N = Number(c);
|
|
1640
|
+
if (N === 0) return "Text";
|
|
1641
|
+
if (N === 1) return "MultipleChoice";
|
|
1642
|
+
if (N === 2 || N === 3) return "Slider";
|
|
1643
|
+
if (N === 4) return "YesNo";
|
|
1644
|
+
if (N === 5) return "SingleChoice";
|
|
1645
|
+
if (N === 6) return "Date";
|
|
1646
|
+
}
|
|
1647
|
+
return String(c);
|
|
1648
|
+
}, g = (c) => {
|
|
1649
|
+
try {
|
|
1650
|
+
const N = document.createElement("textarea");
|
|
1651
|
+
return N.innerHTML = c, N.value;
|
|
1652
|
+
} catch {
|
|
1653
|
+
return c;
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
return /* @__PURE__ */ a(
|
|
1657
|
+
yt,
|
|
1658
|
+
{
|
|
1659
|
+
open: n,
|
|
1660
|
+
onClose: d,
|
|
1661
|
+
maxWidth: "md",
|
|
1662
|
+
fullWidth: !0,
|
|
1663
|
+
PaperProps: {
|
|
1664
|
+
sx: {
|
|
1665
|
+
borderRadius: "16px",
|
|
1666
|
+
p: 1,
|
|
1667
|
+
maxHeight: "90vh"
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
children: [
|
|
1671
|
+
/* @__PURE__ */ a(
|
|
1672
|
+
bt,
|
|
1673
|
+
{
|
|
1674
|
+
sx: {
|
|
1675
|
+
display: "flex",
|
|
1676
|
+
justifyContent: "space-between",
|
|
1677
|
+
alignItems: "center",
|
|
1678
|
+
pb: 1,
|
|
1679
|
+
fontWeight: 700,
|
|
1680
|
+
fontSize: "1.1rem",
|
|
1681
|
+
color: "#0f172a"
|
|
1682
|
+
},
|
|
1683
|
+
children: [
|
|
1684
|
+
"Survey preview",
|
|
1685
|
+
/* @__PURE__ */ e(Ct, { onClick: d, size: "small", sx: { color: "#64748b" }, children: /* @__PURE__ */ e(qt, { fontSize: "small" }) })
|
|
1686
|
+
]
|
|
1687
|
+
}
|
|
1688
|
+
),
|
|
1689
|
+
/* @__PURE__ */ a(St, { dividers: !0, sx: { p: 3 }, children: [
|
|
1690
|
+
/* @__PURE__ */ e(m, { variant: "h6", sx: { fontWeight: 800, color: "#0f172a", mb: 0.5 }, children: l || "Student Well Being" }),
|
|
1691
|
+
/* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#64748b", mb: 2 }, children: u || "General assessment of student wellness and quality of life" }),
|
|
1692
|
+
i && /* @__PURE__ */ a(W, { direction: "row", spacing: 1, alignItems: "center", sx: { color: "#64748b", mb: 3 }, children: [
|
|
1693
|
+
/* @__PURE__ */ e(gs, { sx: { fontSize: 16, color: "#2563eb" } }),
|
|
1694
|
+
/* @__PURE__ */ a(m, { variant: "caption", sx: { fontWeight: 600 }, children: [
|
|
1695
|
+
"Due: ",
|
|
1696
|
+
i
|
|
1697
|
+
] })
|
|
1698
|
+
] }),
|
|
1699
|
+
/* @__PURE__ */ e(W, { spacing: 3, children: o.map((c, N) => /* @__PURE__ */ a(r, { sx: { pb: 1 }, children: [
|
|
1700
|
+
/* @__PURE__ */ a(r, { sx: { display: "flex", gap: "4px", fontWeight: 600, color: "#1e293b", mb: 1.5, fontSize: "0.875rem" }, children: [
|
|
1701
|
+
/* @__PURE__ */ a(r, { children: [
|
|
1702
|
+
N + 1,
|
|
1703
|
+
"."
|
|
1704
|
+
] }),
|
|
1705
|
+
/* @__PURE__ */ e(r, { sx: { "& p": { m: 0, display: "inline" }, "& span": { display: "inline" } }, dangerouslySetInnerHTML: { __html: g(c.questionText || "") } })
|
|
1706
|
+
] }),
|
|
1707
|
+
(_(c.type) === "Rating" || _(c.type) === "StarRating" || _(c.type) === "Slider") && /* @__PURE__ */ e(W, { direction: "row", spacing: 1.5, children: [1, 2, 3, 4, 5].map((w) => /* @__PURE__ */ e(
|
|
1708
|
+
r,
|
|
1709
|
+
{
|
|
1710
|
+
sx: {
|
|
1711
|
+
width: 32,
|
|
1712
|
+
height: 32,
|
|
1713
|
+
borderRadius: "50%",
|
|
1714
|
+
backgroundColor: "#eff6ff",
|
|
1715
|
+
display: "flex",
|
|
1716
|
+
alignItems: "center",
|
|
1717
|
+
justifyContent: "center",
|
|
1718
|
+
fontSize: "0.875rem",
|
|
1719
|
+
fontWeight: 600,
|
|
1720
|
+
color: "#2563eb",
|
|
1721
|
+
cursor: "pointer",
|
|
1722
|
+
transition: "all 0.15s ease",
|
|
1723
|
+
"&:hover": {
|
|
1724
|
+
borderColor: "#2563eb",
|
|
1725
|
+
backgroundColor: "#eff6ff"
|
|
1726
|
+
}
|
|
1727
|
+
},
|
|
1728
|
+
children: w
|
|
1729
|
+
},
|
|
1730
|
+
w
|
|
1731
|
+
)) }),
|
|
1732
|
+
_(c.type) === "MultipleChoice" && /* @__PURE__ */ e(W, { spacing: 1, children: c.options && c.options.length > 0 ? c.options.map((w, h) => /* @__PURE__ */ e(
|
|
1733
|
+
be,
|
|
1734
|
+
{
|
|
1735
|
+
control: /* @__PURE__ */ e(Le, { size: "small", sx: { color: "#cbd5e1", "&.Mui-checked": { color: "#2563eb" } } }),
|
|
1736
|
+
label: /* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#475569" }, children: w })
|
|
1737
|
+
},
|
|
1738
|
+
h
|
|
1739
|
+
)) : /* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#94a3b8" }, children: "No options provided" }) }),
|
|
1740
|
+
(_(c.type) === "YesNo" || _(c.type) === "SingleChoice") && /* @__PURE__ */ e(Nt, { row: !0, children: c.options && c.options.length > 0 ? c.options.map((w, h) => /* @__PURE__ */ e(
|
|
1741
|
+
be,
|
|
1742
|
+
{
|
|
1743
|
+
value: w,
|
|
1744
|
+
control: /* @__PURE__ */ e(Re, { size: "small", sx: { color: "#cbd5e1", "&.Mui-checked": { color: "#2563eb" } } }),
|
|
1745
|
+
label: /* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#475569" }, children: w })
|
|
1746
|
+
},
|
|
1747
|
+
h
|
|
1748
|
+
)) : /* @__PURE__ */ a(Se, { children: [
|
|
1749
|
+
/* @__PURE__ */ e(
|
|
1750
|
+
be,
|
|
1751
|
+
{
|
|
1752
|
+
value: "yes",
|
|
1753
|
+
control: /* @__PURE__ */ e(Re, { size: "small", sx: { color: "#cbd5e1", "&.Mui-checked": { color: "#2563eb" } } }),
|
|
1754
|
+
label: /* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#475569" }, children: "Yes" })
|
|
1755
|
+
}
|
|
1756
|
+
),
|
|
1757
|
+
/* @__PURE__ */ e(
|
|
1758
|
+
be,
|
|
1759
|
+
{
|
|
1760
|
+
value: "no",
|
|
1761
|
+
control: /* @__PURE__ */ e(Re, { size: "small", sx: { color: "#cbd5e1", "&.Mui-checked": { color: "#2563eb" } } }),
|
|
1762
|
+
label: /* @__PURE__ */ e(m, { variant: "body2", sx: { color: "#475569" }, children: "No" })
|
|
1763
|
+
}
|
|
1764
|
+
)
|
|
1765
|
+
] }) }),
|
|
1766
|
+
(_(c.type) === "Text" || _(c.type) === "TextInput" || _(c.type) === "OpenField") && /* @__PURE__ */ e(
|
|
1767
|
+
ee,
|
|
1768
|
+
{
|
|
1769
|
+
fullWidth: !0,
|
|
1770
|
+
multiline: !0,
|
|
1771
|
+
rows: 2,
|
|
1772
|
+
placeholder: "Your answer...",
|
|
1773
|
+
size: "small",
|
|
1774
|
+
sx: {
|
|
1775
|
+
"& .MuiOutlinedInput-root": {
|
|
1776
|
+
borderRadius: "8px",
|
|
1777
|
+
backgroundColor: "#ffffff"
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
)
|
|
1782
|
+
] }, c.id)) })
|
|
1783
|
+
] })
|
|
1784
|
+
]
|
|
1785
|
+
}
|
|
1786
|
+
);
|
|
1787
|
+
}, fs = ({
|
|
1788
|
+
templateFormData: n,
|
|
1789
|
+
surveyFormData: l,
|
|
1790
|
+
selectedStudents: u,
|
|
1791
|
+
currentStepNumber: i,
|
|
1792
|
+
totalSteps: o,
|
|
1793
|
+
onEditTemplateDetails: d,
|
|
1794
|
+
onEditSurveyDetails: _,
|
|
1795
|
+
onEditSelectedStudents: g,
|
|
1796
|
+
onPrevious: c,
|
|
1797
|
+
onPublish: N
|
|
1798
|
+
}) => {
|
|
1799
|
+
const [w, h] = O(!1);
|
|
1800
|
+
return /* @__PURE__ */ a(r, { className: t.chooseTemplateCard, children: [
|
|
1801
|
+
/* @__PURE__ */ a(r, { className: t.reviewSectionBlock, children: [
|
|
1802
|
+
/* @__PURE__ */ a(r, { className: t.reviewSectionHeader, children: [
|
|
1803
|
+
/* @__PURE__ */ e(m, { variant: "h6", className: t.reviewSectionTitle, children: "Template Details" }),
|
|
1804
|
+
/* @__PURE__ */ e(
|
|
1805
|
+
G,
|
|
1806
|
+
{
|
|
1807
|
+
variant: "text",
|
|
1808
|
+
onClick: d,
|
|
1809
|
+
startIcon: /* @__PURE__ */ e(ue, { sx: { fontSize: 16 } }),
|
|
1810
|
+
className: t.reviewEditSectionBtn,
|
|
1811
|
+
children: "EDIT"
|
|
1812
|
+
}
|
|
1813
|
+
)
|
|
1814
|
+
] }),
|
|
1815
|
+
/* @__PURE__ */ a(r, { className: t.reviewFieldGroup, children: [
|
|
1816
|
+
/* @__PURE__ */ e(m, { variant: "caption", className: t.reviewFieldLabel, children: "Template Name" }),
|
|
1817
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.reviewFieldValue, children: n.templateName || "Well-being" })
|
|
1818
|
+
] }),
|
|
1819
|
+
/* @__PURE__ */ a(r, { className: t.reviewFieldGroup, children: [
|
|
1820
|
+
/* @__PURE__ */ e(m, { variant: "caption", className: t.reviewFieldLabel, children: "Description and instructions of when to use" }),
|
|
1821
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.reviewFieldValue, children: n.description || "General assessment of student wellness and quality of life" })
|
|
1822
|
+
] }),
|
|
1823
|
+
/* @__PURE__ */ a(r, { className: t.reviewFieldGroup, sx: { mt: 3 }, children: [
|
|
1824
|
+
/* @__PURE__ */ e(m, { variant: "caption", className: t.reviewFieldLabel, children: "Questions" }),
|
|
1825
|
+
/* @__PURE__ */ e(m, { variant: "h6", className: t.questionsHeadingText, sx: { mb: 1.5 }, children: /* @__PURE__ */ e("span", { className: t.questionCountBadge, children: n.questions.length }) }),
|
|
1826
|
+
/* @__PURE__ */ e(r, { className: t.reviewQuestionsTableContainer, children: /* @__PURE__ */ a(Ne, { className: t.questionsTable, children: [
|
|
1827
|
+
/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ a(V, { className: t.tableHeaderRow, children: [
|
|
1828
|
+
/* @__PURE__ */ e(T, { className: t.thNumber, children: "#" }),
|
|
1829
|
+
/* @__PURE__ */ e(T, { className: t.thQuestion, children: "Question" }),
|
|
1830
|
+
/* @__PURE__ */ e(T, { className: t.thType, children: "Type" }),
|
|
1831
|
+
/* @__PURE__ */ e(T, { className: t.thCategory, children: "Category" })
|
|
1832
|
+
] }) }),
|
|
1833
|
+
/* @__PURE__ */ e(Te, { children: n.questions.map((f, q) => /* @__PURE__ */ a(V, { className: t.tableBodyRow, children: [
|
|
1834
|
+
/* @__PURE__ */ a(T, { className: t.tdNumber, children: [
|
|
1835
|
+
q + 1,
|
|
1836
|
+
"."
|
|
1837
|
+
] }),
|
|
1838
|
+
/* @__PURE__ */ e(T, { className: t.tdQuestion, children: /* @__PURE__ */ e(
|
|
1839
|
+
m,
|
|
1840
|
+
{
|
|
1841
|
+
variant: "body2",
|
|
1842
|
+
className: t.questionText,
|
|
1843
|
+
dangerouslySetInnerHTML: {
|
|
1844
|
+
__html: f.questionText || ""
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
) }),
|
|
1848
|
+
/* @__PURE__ */ e(T, { className: t.tdType, children: /* @__PURE__ */ e(Ve, { type: f.type }) }),
|
|
1849
|
+
/* @__PURE__ */ e(T, { className: t.tdCategory, children: /* @__PURE__ */ e(m, { variant: "body2", className: t.categoryText, children: f.category }) })
|
|
1850
|
+
] }, f.id)) })
|
|
1851
|
+
] }) })
|
|
1852
|
+
] })
|
|
1853
|
+
] }),
|
|
1854
|
+
/* @__PURE__ */ a(r, { className: t.reviewSectionBlock, children: [
|
|
1855
|
+
/* @__PURE__ */ a(r, { className: t.reviewSectionHeader, children: [
|
|
1856
|
+
/* @__PURE__ */ e(m, { variant: "h6", className: t.reviewSectionTitle, children: "Survey Details" }),
|
|
1857
|
+
/* @__PURE__ */ e(
|
|
1858
|
+
G,
|
|
1859
|
+
{
|
|
1860
|
+
variant: "text",
|
|
1861
|
+
onClick: _,
|
|
1862
|
+
startIcon: /* @__PURE__ */ e(ue, { sx: { fontSize: 16 } }),
|
|
1863
|
+
className: t.reviewEditSectionBtn,
|
|
1864
|
+
children: "EDIT"
|
|
1865
|
+
}
|
|
1866
|
+
)
|
|
1867
|
+
] }),
|
|
1868
|
+
/* @__PURE__ */ a(r, { className: t.reviewFieldGroup, children: [
|
|
1869
|
+
/* @__PURE__ */ e(m, { variant: "caption", className: t.reviewFieldLabel, children: "Title" }),
|
|
1870
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.reviewFieldValue, children: l.title || "Student Well Being" })
|
|
1871
|
+
] }),
|
|
1872
|
+
/* @__PURE__ */ a(r, { className: t.reviewFieldGroup, children: [
|
|
1873
|
+
/* @__PURE__ */ e(m, { variant: "caption", className: t.reviewFieldLabel, children: "Deadline" }),
|
|
1874
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.reviewFieldValue, children: l.deadline || "15th January 2026, 12:00 PM" })
|
|
1875
|
+
] })
|
|
1876
|
+
] }),
|
|
1877
|
+
/* @__PURE__ */ a(r, { className: t.reviewSectionBlock, children: [
|
|
1878
|
+
/* @__PURE__ */ a(r, { className: t.reviewSectionHeader, children: [
|
|
1879
|
+
/* @__PURE__ */ a(m, { variant: "h6", className: t.reviewSectionTitle, children: [
|
|
1880
|
+
"Selected Students",
|
|
1881
|
+
" ",
|
|
1882
|
+
/* @__PURE__ */ e(r, { component: "span", sx: { color: "#2563eb", fontWeight: 700 }, children: u.length })
|
|
1883
|
+
] }),
|
|
1884
|
+
/* @__PURE__ */ e(
|
|
1885
|
+
G,
|
|
1886
|
+
{
|
|
1887
|
+
variant: "text",
|
|
1888
|
+
onClick: g,
|
|
1889
|
+
startIcon: /* @__PURE__ */ e(ue, { sx: { fontSize: 16 } }),
|
|
1890
|
+
className: t.reviewEditSectionBtn,
|
|
1891
|
+
children: "EDIT"
|
|
1892
|
+
}
|
|
1893
|
+
)
|
|
1894
|
+
] }),
|
|
1895
|
+
/* @__PURE__ */ e(r, { className: t.studentsTableContainer, children: /* @__PURE__ */ a(Ne, { className: t.studentsTable, children: [
|
|
1896
|
+
/* @__PURE__ */ e(ve, { children: /* @__PURE__ */ a(V, { className: t.tableHeaderRow, children: [
|
|
1897
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: "Student Name" }),
|
|
1898
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: "Flag" }),
|
|
1899
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: "Grade" }),
|
|
1900
|
+
/* @__PURE__ */ e(T, { className: t.tableHeaderCell, children: "Email" })
|
|
1901
|
+
] }) }),
|
|
1902
|
+
/* @__PURE__ */ e(Te, { children: u.length === 0 ? /* @__PURE__ */ e(V, { children: /* @__PURE__ */ e(T, { colSpan: 4, align: "center", sx: { py: 3, color: "#94a3b8" }, children: "No students selected." }) }) : u.map((f) => /* @__PURE__ */ a(V, { className: t.studentTableRow, children: [
|
|
1903
|
+
/* @__PURE__ */ e(T, { className: t.studentNameCell, children: /* @__PURE__ */ a(W, { direction: "row", alignItems: "center", spacing: 1.5, children: [
|
|
1904
|
+
/* @__PURE__ */ e(
|
|
1905
|
+
vt,
|
|
1906
|
+
{
|
|
1907
|
+
src: f.avatarUrl,
|
|
1908
|
+
alt: f.name,
|
|
1909
|
+
sx: {
|
|
1910
|
+
width: 28,
|
|
1911
|
+
height: 28,
|
|
1912
|
+
fontSize: "0.75rem",
|
|
1913
|
+
bgcolor: "#e0e7ff",
|
|
1914
|
+
color: "#3730a3"
|
|
1915
|
+
},
|
|
1916
|
+
children: f.name.charAt(0)
|
|
1917
|
+
}
|
|
1918
|
+
),
|
|
1919
|
+
/* @__PURE__ */ e(m, { variant: "body2", className: t.studentNameText, children: f.name })
|
|
1920
|
+
] }) }),
|
|
1921
|
+
/* @__PURE__ */ e(T, { className: t.flagCell, children: /* @__PURE__ */ e(
|
|
1922
|
+
hs,
|
|
1923
|
+
{
|
|
1924
|
+
flag: f.flag,
|
|
1925
|
+
tooltip: f.flagTooltip
|
|
1926
|
+
}
|
|
1927
|
+
) }),
|
|
1928
|
+
/* @__PURE__ */ e(T, { className: t.gradeCell, children: /* @__PURE__ */ e(m, { variant: "body2", className: t.gradeText, children: f.grade }) }),
|
|
1929
|
+
/* @__PURE__ */ e(T, { className: t.emailCell, children: /* @__PURE__ */ e(m, { variant: "body2", className: t.emailText, children: f.email }) })
|
|
1930
|
+
] }, f.id)) })
|
|
1931
|
+
] }) })
|
|
1932
|
+
] }),
|
|
1933
|
+
/* @__PURE__ */ e(
|
|
1934
|
+
pe,
|
|
1935
|
+
{
|
|
1936
|
+
currentStep: i,
|
|
1937
|
+
totalSteps: o,
|
|
1938
|
+
isLastStep: !0,
|
|
1939
|
+
nextLabel: "PUBLISH",
|
|
1940
|
+
onPreview: () => h(!0),
|
|
1941
|
+
onPrevious: c,
|
|
1942
|
+
onNext: N
|
|
1943
|
+
}
|
|
1944
|
+
),
|
|
1945
|
+
/* @__PURE__ */ e(
|
|
1946
|
+
ps,
|
|
1947
|
+
{
|
|
1948
|
+
open: w,
|
|
1949
|
+
title: l.title || n.templateName,
|
|
1950
|
+
description: n.description,
|
|
1951
|
+
deadline: l.deadline,
|
|
1952
|
+
questions: n.questions,
|
|
1953
|
+
onClose: () => h(!1)
|
|
1954
|
+
}
|
|
1955
|
+
)
|
|
1956
|
+
] });
|
|
1957
|
+
}, _s = [
|
|
1958
|
+
{
|
|
1959
|
+
id: "q-1",
|
|
1960
|
+
orderNumber: 1,
|
|
1961
|
+
questionText: "How would you rate your overall well-being?",
|
|
1962
|
+
type: "Rating",
|
|
1963
|
+
category: "Overall Well-being"
|
|
1964
|
+
},
|
|
1965
|
+
{
|
|
1966
|
+
id: "q-2",
|
|
1967
|
+
orderNumber: 2,
|
|
1968
|
+
questionText: "Do you feel balanced in your daily life?",
|
|
1969
|
+
type: "YesNo",
|
|
1970
|
+
category: "Life Balance"
|
|
1971
|
+
},
|
|
1972
|
+
{
|
|
1973
|
+
id: "q-3",
|
|
1974
|
+
orderNumber: 3,
|
|
1975
|
+
questionText: "What contributes most to your well-being?",
|
|
1976
|
+
type: "Text",
|
|
1977
|
+
category: "Well-being Factors"
|
|
1978
|
+
}
|
|
1979
|
+
], ys = ({
|
|
1980
|
+
template: n,
|
|
1981
|
+
initialDraftData: l,
|
|
1982
|
+
onSave: u,
|
|
1983
|
+
onCancel: i,
|
|
1984
|
+
onAddQuestionRedirect: o,
|
|
1985
|
+
onEditQuestionRedirect: d
|
|
1986
|
+
}) => {
|
|
1987
|
+
const _ = M(() => {
|
|
1988
|
+
const F = n.rawTemplate?.questionTemplates, C = ke(F, n.category || "Well-being");
|
|
1989
|
+
return C.length > 0 ? C : _s;
|
|
1990
|
+
}, [n]), [g, c] = O(() => l || {
|
|
1991
|
+
id: n.id,
|
|
1992
|
+
templateName: n.title,
|
|
1993
|
+
description: n.description || "",
|
|
1994
|
+
showLandingPageFlag: !1,
|
|
1995
|
+
category: n.category || "Well-being",
|
|
1996
|
+
questions: _
|
|
1997
|
+
}), N = M(() => {
|
|
1998
|
+
const F = /* @__PURE__ */ new Set();
|
|
1999
|
+
g.category?.trim() && F.add(g.category.trim()), g.questions.forEach((z) => {
|
|
2000
|
+
const E = z.category?.trim();
|
|
2001
|
+
E && F.add(E);
|
|
2002
|
+
});
|
|
2003
|
+
const C = Array.from(F);
|
|
2004
|
+
return C.length > 0 ? C : ["General"];
|
|
2005
|
+
}, [g.category, g.questions]), w = (F) => {
|
|
2006
|
+
c((C) => ({ ...C, templateName: F }));
|
|
2007
|
+
}, h = (F) => {
|
|
2008
|
+
c((C) => ({ ...C, description: F }));
|
|
2009
|
+
}, f = (F) => {
|
|
2010
|
+
c((C) => ({ ...C, category: F }));
|
|
2011
|
+
}, q = (F) => {
|
|
2012
|
+
d && d(F, g);
|
|
2013
|
+
}, v = (F) => {
|
|
2014
|
+
c((C) => ({
|
|
2015
|
+
...C,
|
|
2016
|
+
questions: C.questions.filter((z) => z.id !== F).map((z, E) => ({ ...z, orderNumber: E + 1 }))
|
|
2017
|
+
}));
|
|
2018
|
+
}, S = () => {
|
|
2019
|
+
o && o(g);
|
|
2020
|
+
}, k = () => {
|
|
2021
|
+
const F = {
|
|
2022
|
+
...n,
|
|
2023
|
+
title: g.templateName,
|
|
2024
|
+
description: g.description,
|
|
2025
|
+
category: g.category,
|
|
2026
|
+
questionCount: g.questions.length,
|
|
2027
|
+
rawTemplate: {
|
|
2028
|
+
...n.rawTemplate,
|
|
2029
|
+
questionTemplates: g.questions.map((C) => ({
|
|
2030
|
+
questionId: typeof C.id == "number" || String(C.id).startsWith("q-") ? C.id : parseInt(String(C.id)),
|
|
2031
|
+
questionText: C.questionText,
|
|
2032
|
+
type: C.type,
|
|
2033
|
+
category: C.category
|
|
2034
|
+
}))
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
u(F);
|
|
2038
|
+
};
|
|
2039
|
+
return {
|
|
2040
|
+
formData: g,
|
|
2041
|
+
categoryOptions: N,
|
|
2042
|
+
totalQuestionsCount: g.questions.length,
|
|
2043
|
+
handleTemplateNameChange: w,
|
|
2044
|
+
handleDescriptionChange: h,
|
|
2045
|
+
handleCategoryChange: f,
|
|
2046
|
+
handleEditQuestion: q,
|
|
2047
|
+
handleRemoveQuestion: v,
|
|
2048
|
+
handleAddQuestion: S,
|
|
2049
|
+
handleSave: k,
|
|
2050
|
+
handleCancel: i
|
|
2051
|
+
};
|
|
2052
|
+
}, bs = ({
|
|
2053
|
+
template: n,
|
|
2054
|
+
initialDraftData: l,
|
|
2055
|
+
onSave: u,
|
|
2056
|
+
onCancel: i,
|
|
2057
|
+
onAddQuestionRedirect: o,
|
|
2058
|
+
onEditQuestionRedirect: d
|
|
2059
|
+
}) => {
|
|
2060
|
+
const {
|
|
2061
|
+
formData: _,
|
|
2062
|
+
categoryOptions: g,
|
|
2063
|
+
totalQuestionsCount: c,
|
|
2064
|
+
handleTemplateNameChange: N,
|
|
2065
|
+
handleDescriptionChange: w,
|
|
2066
|
+
handleCategoryChange: h,
|
|
2067
|
+
handleEditQuestion: f,
|
|
2068
|
+
handleRemoveQuestion: q,
|
|
2069
|
+
handleAddQuestion: v,
|
|
2070
|
+
handleSave: S,
|
|
2071
|
+
handleCancel: k
|
|
2072
|
+
} = ys({
|
|
2073
|
+
template: n,
|
|
2074
|
+
initialDraftData: l,
|
|
2075
|
+
onSave: u,
|
|
2076
|
+
onCancel: i,
|
|
2077
|
+
onAddQuestionRedirect: o,
|
|
2078
|
+
onEditQuestionRedirect: d
|
|
2079
|
+
});
|
|
2080
|
+
ge(() => {
|
|
2081
|
+
window.scrollTo({ top: 0, behavior: "instant" });
|
|
2082
|
+
const C = document.querySelector("main");
|
|
2083
|
+
C && C.scrollTo({ top: 0, behavior: "instant" });
|
|
2084
|
+
const z = document.documentElement || document.body;
|
|
2085
|
+
z && (z.scrollTop = 0);
|
|
2086
|
+
}, []);
|
|
2087
|
+
const F = (C) => {
|
|
2088
|
+
h(C.target.value);
|
|
2089
|
+
};
|
|
2090
|
+
return /* @__PURE__ */ a(r, { className: t.chooseTemplateCard, children: [
|
|
2091
|
+
/* @__PURE__ */ a(r, { className: t.editTemplateHeaderSection, children: [
|
|
2092
|
+
/* @__PURE__ */ e(m, { variant: "h5", className: t.headerTitle, children: "Edit Template" }),
|
|
2093
|
+
/* @__PURE__ */ a(W, { direction: "row", alignItems: "center", spacing: 2, children: [
|
|
2094
|
+
/* @__PURE__ */ e(
|
|
2095
|
+
G,
|
|
2096
|
+
{
|
|
2097
|
+
onClick: k,
|
|
2098
|
+
className: t.editTemplateCancelBtn,
|
|
2099
|
+
children: "CANCEL"
|
|
2100
|
+
}
|
|
2101
|
+
),
|
|
2102
|
+
/* @__PURE__ */ e(
|
|
2103
|
+
G,
|
|
2104
|
+
{
|
|
2105
|
+
variant: "contained",
|
|
2106
|
+
onClick: S,
|
|
2107
|
+
startIcon: /* @__PURE__ */ e(Ye, {}),
|
|
2108
|
+
className: t.editTemplateSaveBtn,
|
|
2109
|
+
disabled: !_.templateName || _.templateName.trim() === "",
|
|
2110
|
+
children: "SAVE CHANGES"
|
|
2111
|
+
}
|
|
2112
|
+
)
|
|
2113
|
+
] })
|
|
2114
|
+
] }),
|
|
2115
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
2116
|
+
/* @__PURE__ */ a(m, { variant: "subtitle2", className: t.formFieldLabel, children: [
|
|
2117
|
+
"Template Name ",
|
|
2118
|
+
/* @__PURE__ */ e("span", { className: t.requiredAsterisk, children: "*" })
|
|
2119
|
+
] }),
|
|
2120
|
+
/* @__PURE__ */ e(
|
|
2121
|
+
ee,
|
|
2122
|
+
{
|
|
2123
|
+
fullWidth: !0,
|
|
2124
|
+
variant: "outlined",
|
|
2125
|
+
value: _.templateName,
|
|
2126
|
+
onChange: (C) => N(C.target.value),
|
|
2127
|
+
placeholder: "Enter template name",
|
|
2128
|
+
className: t.customTextField
|
|
2129
|
+
}
|
|
2130
|
+
)
|
|
2131
|
+
] }),
|
|
2132
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
2133
|
+
/* @__PURE__ */ e(m, { variant: "subtitle2", className: t.formFieldLabel, children: "Description and instructions of when to use" }),
|
|
2134
|
+
/* @__PURE__ */ e(
|
|
2135
|
+
ee,
|
|
2136
|
+
{
|
|
2137
|
+
fullWidth: !0,
|
|
2138
|
+
multiline: !0,
|
|
2139
|
+
rows: 3,
|
|
2140
|
+
variant: "outlined",
|
|
2141
|
+
value: _.description,
|
|
2142
|
+
onChange: (C) => w(C.target.value),
|
|
2143
|
+
placeholder: "Enter description and instructions",
|
|
2144
|
+
className: t.customTextField
|
|
2145
|
+
}
|
|
2146
|
+
)
|
|
2147
|
+
] }),
|
|
2148
|
+
/* @__PURE__ */ a(r, { className: t.formFieldBlock, children: [
|
|
2149
|
+
/* @__PURE__ */ a(m, { variant: "subtitle2", className: t.formFieldLabel, children: [
|
|
2150
|
+
"Category ",
|
|
2151
|
+
/* @__PURE__ */ e("span", { className: t.requiredAsterisk, children: "*" })
|
|
2152
|
+
] }),
|
|
2153
|
+
/* @__PURE__ */ e(oe, { fullWidth: !0, size: "small", children: /* @__PURE__ */ e(
|
|
2154
|
+
ce,
|
|
2155
|
+
{
|
|
2156
|
+
value: _.category,
|
|
2157
|
+
onChange: F,
|
|
2158
|
+
className: t.templateCategorySelect,
|
|
2159
|
+
children: g.map((C) => /* @__PURE__ */ e(de, { value: C, children: C }, C))
|
|
2160
|
+
}
|
|
2161
|
+
) })
|
|
2162
|
+
] }),
|
|
2163
|
+
/* @__PURE__ */ e(r, { className: t.questionsHeaderSection, children: /* @__PURE__ */ a(W, { direction: "row", alignItems: "center", spacing: 0.75, children: [
|
|
2164
|
+
/* @__PURE__ */ e(m, { variant: "subtitle1", className: t.questionsTitle, children: "Questions" }),
|
|
2165
|
+
/* @__PURE__ */ e(m, { variant: "subtitle1", className: t.questionsCountNumber, children: c })
|
|
2166
|
+
] }) }),
|
|
2167
|
+
/* @__PURE__ */ e(
|
|
2168
|
+
je,
|
|
2169
|
+
{
|
|
2170
|
+
questions: _.questions,
|
|
2171
|
+
onEditQuestion: f,
|
|
2172
|
+
onRemoveQuestion: q
|
|
2173
|
+
}
|
|
2174
|
+
),
|
|
2175
|
+
/* @__PURE__ */ e(r, { className: t.addQuestionWrapper, children: /* @__PURE__ */ e(
|
|
2176
|
+
G,
|
|
2177
|
+
{
|
|
2178
|
+
onClick: v,
|
|
2179
|
+
startIcon: /* @__PURE__ */ e(Ue, {}),
|
|
2180
|
+
className: t.addQuestionBtn,
|
|
2181
|
+
children: "ADD QUESTION"
|
|
2182
|
+
}
|
|
2183
|
+
) })
|
|
2184
|
+
] });
|
|
2185
|
+
}, Ds = () => {
|
|
2186
|
+
const n = Qe(), l = Oe((H) => H?.common?.user?.roles), u = Me(), i = M(() => {
|
|
2187
|
+
if (localStorage.getItem("is_returning_from_question") === "true") {
|
|
2188
|
+
localStorage.removeItem("is_returning_from_question");
|
|
2189
|
+
const Q = localStorage.getItem("create_survey_draft");
|
|
2190
|
+
if (Q)
|
|
2191
|
+
try {
|
|
2192
|
+
return JSON.parse(Q);
|
|
2193
|
+
} catch {
|
|
2194
|
+
}
|
|
2195
|
+
} else
|
|
2196
|
+
localStorage.removeItem("create_survey_draft");
|
|
2197
|
+
return null;
|
|
2198
|
+
}, []), {
|
|
2199
|
+
steps: o,
|
|
2200
|
+
activeStep: d,
|
|
2201
|
+
categories: _,
|
|
2202
|
+
selectedCategory: g,
|
|
2203
|
+
selectedTemplateId: c,
|
|
2204
|
+
templates: N,
|
|
2205
|
+
editingTemplate: w,
|
|
2206
|
+
handleSelectCategory: h,
|
|
2207
|
+
handleSelectTemplate: f,
|
|
2208
|
+
handleCreateBlankSurvey: q,
|
|
2209
|
+
handleEditTemplate: v,
|
|
2210
|
+
handleCloseEditTemplate: S,
|
|
2211
|
+
handleSaveEditTemplate: k,
|
|
2212
|
+
handleGoBackToDashboard: F,
|
|
2213
|
+
handlePreviousStep: C,
|
|
2214
|
+
handleNextStep: z,
|
|
2215
|
+
handleGoToStep: E
|
|
2216
|
+
} = Dt(i), J = M(() => {
|
|
2217
|
+
if (c) {
|
|
2218
|
+
const H = N.find((Q) => Q.id === c);
|
|
2219
|
+
return H || null;
|
|
2220
|
+
}
|
|
2221
|
+
return N.length > 0 ? N[0] : null;
|
|
2222
|
+
}, [N, c]), {
|
|
2223
|
+
formData: Y,
|
|
2224
|
+
questionCategories: Z,
|
|
2225
|
+
filteredQuestions: j,
|
|
2226
|
+
totalQuestionsCount: X,
|
|
2227
|
+
handleTemplateNameChange: K,
|
|
2228
|
+
handleDescriptionChange: te,
|
|
2229
|
+
handleCategoryFilterChange: y,
|
|
2230
|
+
handleRemoveQuestion: b
|
|
2231
|
+
} = zt(J, i), {
|
|
2232
|
+
formData: s,
|
|
2233
|
+
handleTitleChange: B,
|
|
2234
|
+
handleDeadlineChange: I
|
|
2235
|
+
} = Wt(i), {
|
|
2236
|
+
students: R,
|
|
2237
|
+
allFilteredStudents: A,
|
|
2238
|
+
totalStudentsCount: $,
|
|
2239
|
+
totalSelectedCount: p,
|
|
2240
|
+
selectedStudentIds: P,
|
|
2241
|
+
filters: U,
|
|
2242
|
+
gradeOptions: Fe,
|
|
2243
|
+
flagOptions: Ie,
|
|
2244
|
+
teacherOptions: fe,
|
|
2245
|
+
isAllSelected: le,
|
|
2246
|
+
isIndeterminate: Be,
|
|
2247
|
+
handleSortChange: Ae,
|
|
2248
|
+
handleSearchChange: ne,
|
|
2249
|
+
handleGradeFilterChange: Ke,
|
|
2250
|
+
handleFlagFilterChange: Je,
|
|
2251
|
+
handleTeacherFilterChange: Ze,
|
|
2252
|
+
handlePageChange: Xe,
|
|
2253
|
+
handleRowsPerPageChange: et,
|
|
2254
|
+
handleToggleSelectAll: tt,
|
|
2255
|
+
handleToggleStudent: nt
|
|
2256
|
+
} = Mt(i), _e = (H) => {
|
|
2257
|
+
const Q = {
|
|
2258
|
+
activeStep: d,
|
|
2259
|
+
selectedCategory: g,
|
|
2260
|
+
selectedTemplateId: c,
|
|
2261
|
+
step2FormData: Y,
|
|
2262
|
+
step3FormData: s,
|
|
2263
|
+
selectedStudentIds: P,
|
|
2264
|
+
editingTemplate: w,
|
|
2265
|
+
...H
|
|
2266
|
+
};
|
|
2267
|
+
localStorage.setItem("create_survey_draft", JSON.stringify(Q));
|
|
2268
|
+
}, at = () => {
|
|
2269
|
+
_e(), u("/admin/create-survey-question?type=0&from=create-survey");
|
|
2270
|
+
}, st = (H) => {
|
|
2271
|
+
_e(), u(`/admin/survey-question-detail/${H}?type=0&from=create-survey`);
|
|
2272
|
+
}, lt = M(() => (A || R).filter((H) => P.includes(H.id)), [A, R, P]), rt = async () => {
|
|
2273
|
+
const H = /* @__PURE__ */ new Map();
|
|
2274
|
+
(A || R || []).forEach((L) => H.set(L.id, L));
|
|
2275
|
+
const Q = [], ae = [], ye = [];
|
|
2276
|
+
P.forEach((L) => {
|
|
2277
|
+
const D = H.get(L);
|
|
2278
|
+
if (D)
|
|
2279
|
+
D.schoolLevel === "ES" && D.userId ? (ae.push(D.userId), ye.push({
|
|
2280
|
+
userId: D.userId,
|
|
2281
|
+
name: D.name,
|
|
2282
|
+
firstName: D.name?.split(" ")?.[0] || "",
|
|
2283
|
+
email: D.email,
|
|
2284
|
+
studentId: D.studentId
|
|
2285
|
+
})) : D.studentId !== void 0 ? Q.push(D.studentId) : typeof L == "number" ? Q.push(L) : D.userId && (ae.push(D.userId), ye.push({
|
|
2286
|
+
userId: D.userId,
|
|
2287
|
+
name: D.name,
|
|
2288
|
+
firstName: D.name?.split(" ")?.[0] || "",
|
|
2289
|
+
email: D.email,
|
|
2290
|
+
studentId: D.studentId
|
|
2291
|
+
}));
|
|
2292
|
+
else if (typeof L == "number" || !isNaN(Number(L)) && !String(L).includes("-"))
|
|
2293
|
+
Q.push(Number(L));
|
|
2294
|
+
else {
|
|
2295
|
+
const re = String(L);
|
|
2296
|
+
ae.push(re), ye.push({
|
|
2297
|
+
userId: re,
|
|
2298
|
+
name: `Student ${re}`,
|
|
2299
|
+
firstName: "Student",
|
|
2300
|
+
email: ""
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
});
|
|
2304
|
+
const ct = [
|
|
2305
|
+
{
|
|
2306
|
+
id: c,
|
|
2307
|
+
name: Y.templateName,
|
|
2308
|
+
title: Y.templateName,
|
|
2309
|
+
description: Y.description,
|
|
2310
|
+
numberQuestion: Y.questions.length,
|
|
2311
|
+
orderDefaultSurvey: 1,
|
|
2312
|
+
questionTemplates: Y.questions.map((L, D) => ({
|
|
2313
|
+
questionId: typeof L.id == "string" && L.id.startsWith("q-") ? 0 : Number(L.id),
|
|
2314
|
+
questionText: L.questionText,
|
|
2315
|
+
type: L.type || "MultipleChoice",
|
|
2316
|
+
orderDefaultQuestionTemplate: L.orderNumber ?? D,
|
|
2317
|
+
answers: L.options && Array.isArray(L.options) ? L.options.map((re, ut) => ({
|
|
2318
|
+
id: 0,
|
|
2319
|
+
text: re,
|
|
2320
|
+
order: ut
|
|
2321
|
+
})) : L.answers || []
|
|
2322
|
+
}))
|
|
2323
|
+
}
|
|
2324
|
+
], dt = s.deadline ? qe(s.deadline, "DD.MM.YYYY hh:mm A").valueOf() : null, mt = {
|
|
2325
|
+
title: s.title,
|
|
2326
|
+
deadline: dt,
|
|
2327
|
+
studentIds: Q,
|
|
2328
|
+
esStudentUserIds: ae,
|
|
2329
|
+
studentUserIds: ae,
|
|
2330
|
+
esStudents: ye,
|
|
2331
|
+
additionalQuestions: [],
|
|
2332
|
+
staffIds: [],
|
|
2333
|
+
summarizeQuestions: [],
|
|
2334
|
+
isAdmin: !0,
|
|
2335
|
+
isDraft: !1,
|
|
2336
|
+
role: Array.isArray(l) ? l.join(",") : l ? String(l) : "Admin",
|
|
2337
|
+
templateQuestions: ct
|
|
2338
|
+
};
|
|
2339
|
+
try {
|
|
2340
|
+
n(se(!0)), await It(mt), n(
|
|
2341
|
+
me({
|
|
2342
|
+
type: "success",
|
|
2343
|
+
message: "Publish survey success"
|
|
2344
|
+
})
|
|
2345
|
+
), F();
|
|
2346
|
+
} catch (L) {
|
|
2347
|
+
console.error("Error publishing survey:", L), n(
|
|
2348
|
+
me({
|
|
2349
|
+
type: "danger",
|
|
2350
|
+
message: L?.response?.data?.title || L?.message || "Failed to publish survey"
|
|
2351
|
+
})
|
|
2352
|
+
);
|
|
2353
|
+
} finally {
|
|
2354
|
+
n(se(!1));
|
|
2355
|
+
}
|
|
2356
|
+
};
|
|
2357
|
+
ge(() => {
|
|
2358
|
+
window.scrollTo({ top: 0, behavior: "instant" });
|
|
2359
|
+
const H = document.querySelector("main");
|
|
2360
|
+
H && H.scrollTo({ top: 0, behavior: "instant" });
|
|
2361
|
+
const Q = document.documentElement || document.body;
|
|
2362
|
+
Q && (Q.scrollTop = 0);
|
|
2363
|
+
}, [d, w]);
|
|
2364
|
+
const it = (H) => {
|
|
2365
|
+
_e({ editingTemplateFormData: H }), u("/admin/create-survey-question?type=0&from=edit-template");
|
|
2366
|
+
}, ot = (H, Q) => {
|
|
2367
|
+
_e({ editingTemplateFormData: Q }), u(`/admin/survey-question-detail/${H}?type=0&from=edit-template`);
|
|
2368
|
+
};
|
|
2369
|
+
return w ? /* @__PURE__ */ e(r, { className: t.createSurveyPage, children: /* @__PURE__ */ e(r, { className: t.contentBody, children: /* @__PURE__ */ e(
|
|
2370
|
+
bs,
|
|
2371
|
+
{
|
|
2372
|
+
template: w,
|
|
2373
|
+
initialDraftData: i?.editingTemplateFormData,
|
|
2374
|
+
onSave: k,
|
|
2375
|
+
onCancel: S,
|
|
2376
|
+
onAddQuestionRedirect: it,
|
|
2377
|
+
onEditQuestionRedirect: ot
|
|
2378
|
+
}
|
|
2379
|
+
) }) }) : /* @__PURE__ */ a(r, { className: t.createSurveyPage, children: [
|
|
2380
|
+
/* @__PURE__ */ e(r, { className: t.headerTopBar, children: /* @__PURE__ */ e(
|
|
2381
|
+
Za,
|
|
2382
|
+
{
|
|
2383
|
+
steps: o,
|
|
2384
|
+
activeStep: d,
|
|
2385
|
+
onBack: F
|
|
2386
|
+
}
|
|
2387
|
+
) }),
|
|
2388
|
+
/* @__PURE__ */ a(r, { className: t.contentBody, children: [
|
|
2389
|
+
d === 0 && /* @__PURE__ */ e(
|
|
2390
|
+
as,
|
|
2391
|
+
{
|
|
2392
|
+
categories: _,
|
|
2393
|
+
selectedCategory: g,
|
|
2394
|
+
templates: N,
|
|
2395
|
+
selectedTemplateId: c,
|
|
2396
|
+
currentStepNumber: d + 1,
|
|
2397
|
+
totalSteps: o.length,
|
|
2398
|
+
onSelectCategory: h,
|
|
2399
|
+
onSelectTemplate: f,
|
|
2400
|
+
onCreateBlank: q,
|
|
2401
|
+
onEditTemplate: v,
|
|
2402
|
+
onPrevious: C,
|
|
2403
|
+
onNext: z
|
|
2404
|
+
}
|
|
2405
|
+
),
|
|
2406
|
+
d === 1 && /* @__PURE__ */ e(
|
|
2407
|
+
ls,
|
|
2408
|
+
{
|
|
2409
|
+
formData: Y,
|
|
2410
|
+
questionCategories: Z,
|
|
2411
|
+
filteredQuestions: j,
|
|
2412
|
+
totalQuestionsCount: X,
|
|
2413
|
+
currentStepNumber: d + 1,
|
|
2414
|
+
totalSteps: o.length,
|
|
2415
|
+
onTemplateNameChange: K,
|
|
2416
|
+
onDescriptionChange: te,
|
|
2417
|
+
onCategoryFilterChange: y,
|
|
2418
|
+
onEditQuestion: st,
|
|
2419
|
+
onRemoveQuestion: b,
|
|
2420
|
+
onAddQuestion: at,
|
|
2421
|
+
onPrevious: C,
|
|
2422
|
+
onNext: z
|
|
2423
|
+
}
|
|
2424
|
+
),
|
|
2425
|
+
d === 2 && /* @__PURE__ */ e(
|
|
2426
|
+
rs,
|
|
2427
|
+
{
|
|
2428
|
+
formData: s,
|
|
2429
|
+
currentStepNumber: d + 1,
|
|
2430
|
+
totalSteps: o.length,
|
|
2431
|
+
onTitleChange: B,
|
|
2432
|
+
onDeadlineChange: I,
|
|
2433
|
+
onPrevious: C,
|
|
2434
|
+
onNext: z
|
|
2435
|
+
}
|
|
2436
|
+
),
|
|
2437
|
+
d === 3 && /* @__PURE__ */ e(
|
|
2438
|
+
ds,
|
|
2439
|
+
{
|
|
2440
|
+
students: R,
|
|
2441
|
+
totalStudentsCount: $,
|
|
2442
|
+
totalSelectedCount: p,
|
|
2443
|
+
selectedStudentIds: P,
|
|
2444
|
+
filters: U,
|
|
2445
|
+
gradeOptions: Fe,
|
|
2446
|
+
flagOptions: Ie,
|
|
2447
|
+
teacherOptions: fe,
|
|
2448
|
+
page: U.page,
|
|
2449
|
+
rowsPerPage: U.rowsPerPage,
|
|
2450
|
+
isAllSelected: le,
|
|
2451
|
+
isIndeterminate: Be,
|
|
2452
|
+
sortBy: U.sortBy,
|
|
2453
|
+
sortOrder: U.sortOrder,
|
|
2454
|
+
onSortChange: Ae,
|
|
2455
|
+
currentStepNumber: d + 1,
|
|
2456
|
+
totalSteps: o.length,
|
|
2457
|
+
onSearchChange: ne,
|
|
2458
|
+
onGradeChange: Ke,
|
|
2459
|
+
onFlagChange: Je,
|
|
2460
|
+
onTeacherChange: Ze,
|
|
2461
|
+
onPageChange: Xe,
|
|
2462
|
+
onRowsPerPageChange: et,
|
|
2463
|
+
onToggleSelectAll: tt,
|
|
2464
|
+
onToggleStudent: nt,
|
|
2465
|
+
onPrevious: C,
|
|
2466
|
+
onNext: z
|
|
2467
|
+
}
|
|
2468
|
+
),
|
|
2469
|
+
d === 4 && /* @__PURE__ */ e(
|
|
2470
|
+
fs,
|
|
2471
|
+
{
|
|
2472
|
+
templateFormData: Y,
|
|
2473
|
+
surveyFormData: s,
|
|
2474
|
+
selectedStudents: lt,
|
|
2475
|
+
currentStepNumber: d + 1,
|
|
2476
|
+
totalSteps: o.length,
|
|
2477
|
+
onEditTemplateDetails: () => E(1),
|
|
2478
|
+
onEditSurveyDetails: () => E(2),
|
|
2479
|
+
onEditSelectedStudents: () => E(3),
|
|
2480
|
+
onPrevious: C,
|
|
2481
|
+
onPublish: rt
|
|
2482
|
+
}
|
|
2483
|
+
)
|
|
2484
|
+
] })
|
|
2485
|
+
] });
|
|
2486
|
+
};
|
|
2487
|
+
export {
|
|
2488
|
+
Ds as default
|
|
2489
|
+
};
|