UNPKG

analytica-frontend-lib

Version:

Repositório público dos componentes utilizados nas plataformas da Analytica Ensino

707 lines (651 loc) 32.4 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _chunkQ7THVSHRjs = require('./chunk-Q7THVSHR.js'); var _chunkOKU4RHFXjs = require('./chunk-OKU4RHFX.js'); var _chunkGYQUB3VWjs = require('./chunk-GYQUB3VW.js'); var _chunkDR7XX7RNjs = require('./chunk-DR7XX7RN.js'); var _chunkHZE6VBF5js = require('./chunk-HZE6VBF5.js'); var _chunkHN2HFYUOjs = require('./chunk-HN2HFYUO.js'); var _chunkHGWU3GUNjs = require('./chunk-HGWU3GUN.js'); var _chunkBVUPM6EYjs = require('./chunk-BVUPM6EY.js'); var _chunkTCLRDUMFjs = require('./chunk-TCLRDUMF.js'); var _chunk34ST3MKOjs = require('./chunk-34ST3MKO.js'); var _chunkANT66KVKjs = require('./chunk-ANT66KVK.js'); var _chunkTN3AYOMVjs = require('./chunk-TN3AYOMV.js'); var _chunkAOUX6XXNjs = require('./chunk-AOUX6XXN.js'); // src/components/Quiz/Quiz.tsx var _BookOpen = require('@phosphor-icons/react/dist/csr/BookOpen'); var _CaretLeft = require('@phosphor-icons/react/dist/csr/CaretLeft'); var _CaretRight = require('@phosphor-icons/react/dist/csr/CaretRight'); var _SquaresFour = require('@phosphor-icons/react/dist/csr/SquaresFour'); var _react = require('react'); var _jsxruntime = require('react/jsx-runtime'); var getQuizTypeConfig = (type) => { const QUIZ_TYPE_CONFIG = { ["SIMULADO" /* SIMULADO */]: { label: "Simulado", article: "o", preposition: "do" }, ["QUESTIONARIO" /* QUESTIONARIO */]: { label: "Question\xE1rio", article: "o", preposition: "do" }, ["ATIVIDADE" /* ATIVIDADE */]: { label: "Atividade", article: "a", preposition: "da" }, ["AULA_RECOMENDADA" /* AULA_RECOMENDADA */]: { label: "Aula recomendada", article: "a", preposition: "da" } }; const config = QUIZ_TYPE_CONFIG[type]; return config || QUIZ_TYPE_CONFIG["SIMULADO" /* SIMULADO */]; }; var getTypeLabel = (type) => { return getQuizTypeConfig(type).label; }; var getQuizArticle = (type) => { return getQuizTypeConfig(type).article; }; var getQuizPreposition = (type) => { return getQuizTypeConfig(type).preposition; }; var getCompletionTitle = (type) => { const config = getQuizTypeConfig(type); return `Voc\xEA concluiu ${config.article} ${config.label.toLowerCase()}!`; }; var getGoBackButtonLabel = (type) => { if (type === "SIMULADO" /* SIMULADO */) return "Ir para simulados"; if (type === "QUESTIONARIO" /* QUESTIONARIO */) return "Ir para aulas"; if (type === "ATIVIDADE" /* ATIVIDADE */) return "Ir para atividades"; if (type === "AULA_RECOMENDADA" /* AULA_RECOMENDADA */) return "Ir para aulas recomendadas"; return "Ir para simulados"; }; var getExitConfirmationText = (type) => { const config = getQuizTypeConfig(type); if (type === "QUESTIONARIO" /* QUESTIONARIO */) { return `Se voc\xEA sair ${config.preposition} ${config.label.toLowerCase()} agora, todas as respostas ser\xE3o perdidas.`; } return `Se voc\xEA sair ${config.preposition} ${config.label.toLowerCase()} agora, poder\xE1 continuar de onde parou depois.`; }; var getFinishConfirmationText = (type) => { const config = getQuizTypeConfig(type); return `Tem certeza que deseja finalizar ${config.article} ${config.label.toLowerCase()}?`; }; var Quiz = _react.forwardRef.call(void 0, ({ children, className, variant = "default" /* DEFAULT */, ...props }, ref) => { const { setVariant } = _chunkAOUX6XXNjs.useQuizStore.call(void 0, ); _react.useEffect.call(void 0, () => { setVariant(variant); }, [variant, setVariant]); return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkTN3AYOMVjs.cn.call(void 0, "flex flex-col", className), ...props, children }); }); var QuizTitle = _react.forwardRef.call(void 0, ({ className, onBack, ...props }, ref) => { const { quiz, currentQuestionIndex, getTotalQuestions, getQuizTitle, isStarted } = _chunkAOUX6XXNjs.useQuizStore.call(void 0, ); const [showExitConfirmation, setShowExitConfirmation] = _react.useState.call(void 0, false); const totalQuestions = getTotalQuestions(); const quizTitle = getQuizTitle(); const handleBackClick = () => { if (isStarted) { setShowExitConfirmation(true); } else { actionOnBack(); } }; const handleConfirmExit = () => { setShowExitConfirmation(false); actionOnBack(); }; const actionOnBack = () => { if (onBack) { onBack(); } else { globalThis.history.back(); } }; const handleCancelExit = () => { setShowExitConfirmation(false); }; return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref, className: _chunkTN3AYOMVjs.cn.call(void 0, "flex flex-row justify-between items-center relative p-2", className ), ...props, children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBVUPM6EYjs.IconButton_default, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CaretLeft.CaretLeftIcon, { size: 24 }), size: "md", "aria-label": "Voltar", onClick: handleBackClick } ), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "flex flex-col gap-2 text-center", children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-text-950 font-bold text-md", children: quizTitle }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" }) ] }) ] } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQ7THVSHRjs.AlertDialog, { isOpen: showExitConfirmation, onChangeOpen: setShowExitConfirmation, title: "Deseja sair?", description: getExitConfirmationText(_optionalChain([quiz, 'optionalAccess', _ => _.type]) || "SIMULADO" /* SIMULADO */), cancelButtonLabel: "Voltar e revisar", submitButtonLabel: "Sair Mesmo Assim", onSubmit: handleConfirmExit, onCancel: handleCancelExit } ) ] }); }); var QuizHeader = () => { const { getCurrentQuestion, getQuestionIndex, quiz } = _chunkAOUX6XXNjs.useQuizStore.call(void 0, ); const currentQuestion = getCurrentQuestion(); let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : _optionalChain([currentQuestion, 'optionalAccess', _2 => _2.id]); const questionIndex = getQuestionIndex(currentId); const questionNumber = currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o"; const shouldShowExamInfo = _optionalChain([quiz, 'optionalAccess', _3 => _3.type]) === "SIMULADO" /* SIMULADO */; const examInfo = shouldShowExamInfo ? _chunkGYQUB3VWjs.formatExamInfo.call(void 0, _optionalChain([currentQuestion, 'optionalAccess', _4 => _4.examBoard]), _optionalChain([currentQuestion, 'optionalAccess', _5 => _5.examYear])) : ""; const title = examInfo ? `${questionNumber} ${examInfo}` : questionNumber; return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkDR7XX7RNjs.HeaderAlternative, { title, subTitle: _nullishCoalesce(_optionalChain([currentQuestion, 'optionalAccess', _6 => _6.knowledgeMatrix, 'optionalAccess', _7 => _7[0], 'optionalAccess', _8 => _8.topic, 'optionalAccess', _9 => _9.name]), () => ( "")), content: _nullishCoalesce(_optionalChain([currentQuestion, 'optionalAccess', _10 => _10.statement]), () => ( "")) } ); }; var QuizContent = ({ paddingBottom }) => { const { getCurrentQuestion } = _chunkAOUX6XXNjs.useQuizStore.call(void 0, ); const currentQuestion = getCurrentQuestion(); const questionComponents = { ["ALTERNATIVA" /* ALTERNATIVA */]: _chunkOKU4RHFXjs.QuizAlternative, ["MULTIPLA_ESCOLHA" /* MULTIPLA_ESCOLHA */]: _chunkOKU4RHFXjs.QuizMultipleChoice, ["DISSERTATIVA" /* DISSERTATIVA */]: _chunkOKU4RHFXjs.QuizDissertative, ["VERDADEIRO_FALSO" /* VERDADEIRO_FALSO */]: _chunkOKU4RHFXjs.QuizTrueOrFalse, ["RELACIONAR" /* RELACIONAR */]: _chunkOKU4RHFXjs.QuizConnectDots, ["PREENCHER_LACUNAS" /* PREENCHER_LACUNAS */]: _chunkOKU4RHFXjs.QuizFill, ["IMAGEM" /* IMAGEM */]: _chunkOKU4RHFXjs.QuizImageQuestion }; const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null; return QuestionComponent ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QuestionComponent, { paddingBottom }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { size: "md", weight: "medium", className: "text-text-950 text-md", children: "Tipo de quest\xE3o n\xE3o suportado" }); }; var QuizQuestionList = ({ filterType = "all", onQuestionClick } = {}) => { const { getQuestionsGroupedBySubject, goToQuestion, getQuestionStatusFromUserAnswers, getQuestionIndex, quiz } = _chunkAOUX6XXNjs.useQuizStore.call(void 0, ); const shouldShowExamInfo = _optionalChain([quiz, 'optionalAccess', _11 => _11.type]) === "SIMULADO" /* SIMULADO */; const groupedQuestions = getQuestionsGroupedBySubject(); const getQuestionStatus = (questionId) => { return getQuestionStatusFromUserAnswers(questionId); }; const filteredGroupedQuestions = Object.entries(groupedQuestions).reduce( (acc, [subjectId, questions]) => { const filteredQuestions = questions.filter((question) => { const status = getQuestionStatus(question.id); switch (filterType) { case "answered": return status === "answered"; case "unanswered": return status === "unanswered" || status === "skipped"; default: return true; } }); if (filteredQuestions.length > 0) { acc[subjectId] = filteredQuestions; } return acc; }, // eslint-disable-next-line @typescript-eslint/no-explicit-any {} ); const getStatusLabel = (status) => { switch (status) { case "answered": return "Respondida"; case "skipped": return "Em branco"; default: return "Em branco"; } }; return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "space-y-6 px-4 h-full", children: [ Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-lg", children: "Nenhum resultado" }) }), Object.entries(filteredGroupedQuestions).map( ([subjectId, questions]) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "section", { className: "flex flex-col gap-2", children: [ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _BookOpen.BookOpenIcon, { size: 17, className: "text-white" }) }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-text-800 font-bold text-lg", children: _nullishCoalesce(_optionalChain([questions, 'optionalAccess', _12 => _12[0], 'optionalAccess', _13 => _13.knowledgeMatrix, 'optionalAccess', _14 => _14[0], 'optionalAccess', _15 => _15.subject, 'optionalAccess', _16 => _16.name]), () => ( "Sem mat\xE9ria")) }) ] }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "flex flex-col gap-2", children: questions.map((question) => { const status = getQuestionStatus(question.id); const questionNumber = getQuestionIndex(question.id); const examInfo = shouldShowExamInfo ? _chunkGYQUB3VWjs.formatExamInfo.call(void 0, question.examBoard, question.examYear) : ""; const questionTitle = `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`; const header = examInfo ? `${questionTitle} ${examInfo}` : questionTitle; return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHN2HFYUOjs.CardStatus, { header, label: getStatusLabel(status), onClick: () => { goToQuestion(questionNumber - 1); _optionalChain([onQuestionClick, 'optionalCall', _17 => _17()]); } }, question.id ); }) }) ] }, subjectId) ) ] }); }; var QuizResultModal = ({ isOpen, onClose, image, showImagePlaceholder = true, title, description, footer }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCLRDUMFjs.Modal_default, { isOpen, onClose, title: "", closeOnEscape: false, hideCloseButton: true, size: "md", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [ image ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-[282px] h-auto", children: image }) : showImagePlaceholder && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { as: "span", size: "sm", color: "text-gray-500", children: "Imagem de resultado" }) }), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-2 text-center", children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { as: "h2", size: "lg", weight: "bold", children: title }), description ] }), footer ] }) } ); var QuizFooter = _react.forwardRef.call(void 0, ({ className, onGoToSimulated, onDetailResult, handleFinishSimulated, onGoToNextModule, onRepeat, onTryLater, resultImageComponent, resultIncorrectImageComponent, ...props }, ref) => { const { quiz, currentQuestionIndex, getTotalQuestions, goToNextQuestion, goToPreviousQuestion, getUnansweredQuestionsFromUserAnswers, getCurrentAnswer, skipQuestion, skipCurrentQuestionIfUnanswered, getCurrentQuestion, getQuestionStatusFromUserAnswers, variant, getQuestionResultStatistics } = _chunkAOUX6XXNjs.useQuizStore.call(void 0, ); const totalQuestions = getTotalQuestions(); const isFirstQuestion = currentQuestionIndex === 0; const isLastQuestion = currentQuestionIndex === totalQuestions - 1; const currentAnswer = getCurrentAnswer(); const currentQuestion = getCurrentQuestion(); const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false; const [activeModal, setActiveModal] = _react.useState.call(void 0, null); const [filterType, setFilterType] = _react.useState.call(void 0, "all"); const openModal = (modalName) => setActiveModal(modalName); const closeModal = () => setActiveModal(null); const isModalOpen = (modalName) => activeModal === modalName; const unansweredQuestions = getUnansweredQuestionsFromUserAnswers(); const allQuestions = getTotalQuestions(); const stats = getQuestionResultStatistics(); const correctAnswers = _optionalChain([stats, 'optionalAccess', _18 => _18.correctAnswers]); const quizType = _optionalChain([quiz, 'optionalAccess', _19 => _19.type]) || "SIMULADO" /* SIMULADO */; const quizTypeLabel = getTypeLabel(quizType); const moduleName = _optionalChain([quiz, 'optionalAccess', _20 => _20.questions, 'optionalAccess', _21 => _21[0], 'optionalAccess', _22 => _22.knowledgeMatrix, 'optionalAccess', _23 => _23[0], 'optionalAccess', _24 => _24.subtopic, 'optionalAccess', _25 => _25.name]); const submitAndOpenResultModal = async () => { if (handleFinishSimulated) { await Promise.resolve(handleFinishSimulated()); } const latestStats = getQuestionResultStatistics(); const latestCorrect = _optionalChain([latestStats, 'optionalAccess', _26 => _26.correctAnswers]); const latestTotal = _optionalChain([latestStats, 'optionalAccess', _27 => _27.totalAnswered]); if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof latestCorrect === "number" && typeof latestTotal === "number" && latestCorrect === latestTotal) { openModal("modalQuestionnaireAllCorrect"); return; } if (quizType === "QUESTIONARIO" /* QUESTIONARIO */ && typeof latestCorrect === "number" && latestCorrect === 0) { openModal("modalQuestionnaireAllIncorrect"); return; } openModal("modalResult"); }; const handleFinishQuiz = async () => { skipCurrentQuestionIfUnanswered(); if (unansweredQuestions.length > 0) { openModal("alertDialog"); return; } try { await submitAndOpenResultModal(); } catch (err) { console.error("handleFinishSimulated failed:", err); } }; const handleAlertSubmit = async () => { try { await submitAndOpenResultModal(); } catch (err) { console.error("handleFinishSimulated failed:", err); closeModal(); } }; return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "footer", { ref, className: _chunkTN3AYOMVjs.cn.call(void 0, "w-full px-2 bg-background lg:max-w-[1000px] not-lg:max-w-[calc(100vw-32px)] border-t border-border-50 fixed bottom-0 min-h-[80px] flex flex-row justify-between items-center", className ), ...props, children: variant === "default" ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row items-center gap-1", children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkBVUPM6EYjs.IconButton_default, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _SquaresFour.SquaresFourIcon, { size: 24, className: "text-text-950" }), size: "md", onClick: () => openModal("modalNavigate") } ), isFirstQuestion ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { variant: "outline", size: "small", onClick: () => { skipQuestion(); goToNextQuestion(); }, children: "Pular" } ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { size: "medium", variant: "link", action: "primary", iconLeft: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CaretLeft.CaretLeftIcon, { size: 18 }), onClick: () => { goToPreviousQuestion(); }, children: "Voltar" } ) ] }), !isFirstQuestion && !isLastQuestion && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { size: "small", variant: "outline", action: "primary", onClick: () => { skipQuestion(); goToNextQuestion(); }, children: "Pular" } ), isLastQuestion ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { size: "medium", variant: "solid", action: "primary", onClick: handleFinishQuiz, children: "Finalizar" } ) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { size: "medium", variant: "link", action: "primary", iconRight: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _CaretRight.CaretRightIcon, { size: 18 }), disabled: !currentAnswer && !isCurrentQuestionSkipped, onClick: () => { goToNextQuestion(); }, children: "Avan\xE7ar" } ) ] }) : _optionalChain([currentQuestion, 'optionalAccess', _28 => _28.solutionExplanation]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { variant: "link", action: "primary", size: "medium", onClick: () => openModal("modalResolution"), children: "Ver resolu\xE7\xE3o" } ) }) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQ7THVSHRjs.AlertDialog, { isOpen: isModalOpen("alertDialog"), onChangeOpen: (open) => open ? openModal("alertDialog") : closeModal(), title: `Finalizar ${quizTypeLabel.toLowerCase()}?`, description: unansweredQuestions.length > 0 ? `Voc\xEA deixou as quest\xF5es ${unansweredQuestions.join(", ")} sem resposta. Finalizar agora pode impactar seu desempenho.` : getFinishConfirmationText(quizType), cancelButtonLabel: "Voltar e revisar", submitButtonLabel: "Finalizar Mesmo Assim", onSubmit: handleAlertSubmit } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QuizResultModal, { isOpen: isModalOpen("modalResult"), onClose: closeModal, image: resultImageComponent, title: getCompletionTitle(quizType), description: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkANT66KVKjs.Text_default, { as: "p", size: "sm", color: "text-text-500", children: [ "Voc\xEA acertou ", _nullishCoalesce(correctAnswers, () => ( "--")), " de ", allQuestions, " quest\xF5es." ] }), footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { variant: "outline", className: "w-full", size: "small", onClick: onGoToSimulated, children: getGoBackButtonLabel(quizType) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" }) ] }) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCLRDUMFjs.Modal_default, { isOpen: isModalOpen("modalNavigate"), onClose: closeModal, title: "Quest\xF5es", size: "lg", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "max-w-[266px]", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkHGWU3GUNjs.Select_default, { value: filterType, onValueChange: setFilterType, children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHGWU3GUNjs.SelectTrigger, { variant: "rounded", className: "max-w-[266px] min-w-[160px]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHGWU3GUNjs.SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" }) } ), /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkHGWU3GUNjs.SelectContent, { children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHGWU3GUNjs.SelectItem, { value: "all", children: "Todas" }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHGWU3GUNjs.SelectItem, { value: "unanswered", children: "Em branco" }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHGWU3GUNjs.SelectItem, { value: "answered", children: "Respondidas" }) ] }) ] }) }) ] }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QuizQuestionList, { filterType, onQuestionClick: closeModal } ) }) ] }) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkTCLRDUMFjs.Modal_default, { isOpen: isModalOpen("modalResolution"), onClose: closeModal, title: "Resolu\xE7\xE3o", size: "lg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHZE6VBF5js.HtmlMathRenderer_default, { content: _optionalChain([currentQuestion, 'optionalAccess', _29 => _29.solutionExplanation]) || "", className: "text-text-950 text-base" } ) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QuizResultModal, { isOpen: isModalOpen("modalQuestionnaireAllCorrect"), onClose: closeModal, image: resultImageComponent, title: "\u{1F389} Parab\xE9ns!", description: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { as: "p", size: "sm", color: "text-text-500", children: moduleName ? `Voc\xEA concluiu o m\xF3dulo ${moduleName}.` : "Voc\xEA concluiu o question\xE1rio!" }), footer: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { className: "w-full", onClick: onGoToNextModule, children: getGoBackButtonLabel(quizType) }) }) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, QuizResultModal, { isOpen: isModalOpen("modalQuestionnaireAllIncorrect"), onClose: closeModal, image: resultIncorrectImageComponent, showImagePlaceholder: false, title: "\u{1F615} N\xE3o foi dessa vez...", description: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { as: "p", size: "sm", color: "text-text-500", children: "Voc\xEA tirou 0 no question\xE1rio, mas n\xE3o se preocupe! Isso \xE9 apenas uma oportunidade de aprendizado." }), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { as: "p", size: "sm", color: "text-text-500", children: "Que tal tentar novamente para melhorar sua nota? Estamos aqui para te ajudar a entender o conte\xFAdo e evoluir." }), _optionalChain([quiz, 'optionalAccess', _30 => _30.canRetry]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkANT66KVKjs.Text_default, { as: "p", size: "sm", color: "text-text-500", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" }) ] }), footer: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [ _optionalChain([quiz, 'optionalAccess', _31 => _31.canRetry]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { type: "button", variant: "link", size: "small", className: "w-auto", onClick: () => { closeModal(); openModal("alertDialogTryLater"); }, children: "Tentar depois" } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { variant: "outline", size: "small", className: "w-auto", onClick: onDetailResult, children: "Detalhar resultado" } ), _optionalChain([quiz, 'optionalAccess', _32 => _32.canRetry]) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { className: "w-auto", size: "small", onClick: onRepeat, children: "Repetir question\xE1rio" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk34ST3MKOjs.Button_default, { className: "w-auto", size: "small", onClick: onGoToSimulated, children: getGoBackButtonLabel(quizType) } ) ] }) } ), /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkQ7THVSHRjs.AlertDialog, { isOpen: isModalOpen("alertDialogTryLater"), onChangeOpen: (open) => open ? openModal("alertDialogTryLater") : closeModal(), title: "Tentar depois?", description: "Voc\xEA optou por refazer o question\xE1rio mais tarde.\n\nLembre-se: enquanto n\xE3o refazer o question\xE1rio, sua nota permanecer\xE1 0 no sistema.", cancelButtonLabel: "Repetir question\xE1rio", submitButtonLabel: "Tentar depois", onSubmit: () => { _optionalChain([onTryLater, 'optionalCall', _33 => _33()]); closeModal(); }, onCancel: () => { _optionalChain([onRepeat, 'optionalCall', _34 => _34()]); closeModal(); } } ) ] }); } ); exports.getQuizTypeConfig = getQuizTypeConfig; exports.getTypeLabel = getTypeLabel; exports.getQuizArticle = getQuizArticle; exports.getQuizPreposition = getQuizPreposition; exports.getCompletionTitle = getCompletionTitle; exports.getGoBackButtonLabel = getGoBackButtonLabel; exports.getExitConfirmationText = getExitConfirmationText; exports.getFinishConfirmationText = getFinishConfirmationText; exports.Quiz = Quiz; exports.QuizTitle = QuizTitle; exports.QuizHeader = QuizHeader; exports.QuizContent = QuizContent; exports.QuizQuestionList = QuizQuestionList; exports.QuizFooter = QuizFooter; //# sourceMappingURL=chunk-FTJT2F5A.js.map