58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
// Module ID: 15927
|
|
// Function ID: 15928
|
|
// Name: isClarificationComplete
|
|
// Dependencies: [2]
|
|
// Exports: formatClarificationAnswers, isClarificationComplete, nextClarificationStep
|
|
|
|
// Module 15927 (isClarificationComplete)
|
|
import set from "set" /* 2 */;
|
|
|
|
let result = set.fileFinishedImporting("modules/vibegrations/lib/VibegrationsClarification.tsx");
|
|
|
|
export const isClarificationComplete = function isClarificationComplete(questions) {
|
|
closure_0 = arg1;
|
|
questions = questions.questions;
|
|
return questions.every((arg0) => {
|
|
let tmp2 = null != tmp;
|
|
if (tmp2) {
|
|
tmp2 = "" !== tmp.text.trim();
|
|
const str = tmp.text;
|
|
}
|
|
return tmp2;
|
|
});
|
|
};
|
|
export const nextClarificationStep = function nextClarificationStep(clarification, arg1, bound) {
|
|
const questions = clarification.questions;
|
|
let num = 1;
|
|
if (1 <= questions.length) {
|
|
const result = (bound + num) % questions.length;
|
|
while (null != arg1[questions[result].id]) {
|
|
let str = tmp2.text;
|
|
if ("" === str.trim()) {
|
|
break;
|
|
} else {
|
|
num = num + 1;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
return null;
|
|
};
|
|
export const formatClarificationAnswers = function formatClarificationAnswers(questions, arg1) {
|
|
closure_0 = arg1;
|
|
questions = questions.questions;
|
|
const mapped = questions.map((question, index) => ({ question, index, answer: table[question.id] }));
|
|
const found = mapped.filter((answer) => {
|
|
let tmp = null != answer.answer;
|
|
if (tmp) {
|
|
tmp = "" !== answer.answer.text.trim();
|
|
const str = answer.answer.text;
|
|
}
|
|
return tmp;
|
|
});
|
|
const mapped1 = found.map((answer) => {
|
|
const sum = answer.index + 1;
|
|
return "" + sum + ". " + answer.question.question + " \u2192 " + answer.answer.text.trim();
|
|
});
|
|
return mapped1.join("\n");
|
|
};
|