JSFiddle - React, Tailwind, and code Playground

by Ryan Brackett

JavaScript

function generateQuestionnaire() {
  var t = {
    phase: "user_phase",
    form: {
      sections: [{
        localizedLabel: "COVID-19 Screening Tool",
        key: "user_single_choice",
        answer: {
          type: "SingleChoice",
          choices: [{
            localizedLabel: "Use For Myself",
            value: !0
          }, {
            localizedLabel: "Use For Someone Else",
            value: !1
          }]
        },
        isOptional: !1
      }]
    }
  };

  function a(e) {
    return {
      phase: "emergency_phase",
      form: {
        sections: [{
          icon: "asterisk.circle.fill",
          localizedLabel: "Is this an emergency?",
          detailedLocalizedLabel: e ? "Stop and call 911 if you are experiencing:\n•   Severe, constant chest pain or pressure\n•   Extreme difficulty breathing\n•   Severe, constant lightheadedness\n•   Serious disorientation or unresponsiveness" : "Stop and call 911 if they are experiencing:\n•   Severe, constant chest pain or pressure\n•   Extreme difficulty breathing\n•   Severe, constant lightheadedness\n•   Serious disorientation or unresponsiveness",
          key: "emergency_single_choice",
          answer: {
            type: "SingleChoice",
            choices: [{
              localizedLabel: e ? "I'm experiencing at least one of these symptoms" : "They're experiencing at least one of these symptoms",
              value: !0
            }, {
              localizedLabel: e ? "I do not have any of these symptoms" : "They do not have any of these symptoms",
              value: !1
            }]
          },
          isOptional: !1
        }]
      }
    }
  }

  function i(e) {
    return {
      phase: "age_phase",
      form: {
        sections: [{
          localizedLabel: e ? "How old are you?" : "How old are they?",
          key: "age_single_choice",
          answer: {
            type: "SingleChoice",
            choices: [{
              localizedLabel: "Under 18",
             ...