{"version":3,"sources":["components/Header.jsx","components/Footer.jsx","components/Landing.jsx","components/MainQuestion.jsx","components/Button.jsx","components/PUI.jsx","components/PUM.jsx","components/Neither.jsx","components/Traveller.jsx","components/Patient.jsx","App.js","serviceWorker.js","index.js"],"names":["Header","className","href","src","style","width","alt","fontSize","display","Footer","target","rel","Landing","to","MainQuestion","props","mainQuestion","Button","value","onClick","label","PUI","PUM","Neither","Traveller","questions","didTravel","React","useState","hasSymptoms","nearCovidPatient","handleDidTravel","evt","handleHasSymptoms","handleNearCovidPatient","Patient","wasExposed","within14Days","isSevere","handleWasExposed","handleWithin14Days","handleIsSevere","App","height","path","Boolean","window","location","hostname","match","ReactDOM","render","StrictMode","document","getElementById","navigator","serviceWorker","ready","then","registration","unregister","catch","error","console","message"],"mappings":"kQAsBeA,MApBf,WACE,OACE,yBAAKC,UAAU,kCACb,yBAAKA,UAAU,aACb,uBAAGC,KAAK,IAAID,UAAU,cACpB,yBACEE,IAAI,aACJF,UAAU,OACVG,MAAO,CAAEC,MAAO,QAChBC,IAAI,uDAGR,wBAAIF,MAAO,CAAEG,SAAU,SAAUC,QAAS,WAA1C,6BCYOC,MAxBf,WACE,OACE,yBAAKR,UAAU,kCACb,uBAAGA,UAAU,iBAAiBG,MAAO,CAAEG,SAAU,YAAjD,sCACsC,IACpC,8BACE,uBACEN,UAAU,aACVC,KAAK,2EACLQ,OAAO,SACPC,IAAI,uBAJN,kBAQM,IAXV,gCAcA,uBAAGV,UAAU,iBAAiBG,MAAO,CAAEG,SAAU,YAAjD,yDCKSK,MArBf,WACE,OACE,yBAAKX,UAAU,WACb,yBAAKA,UAAU,2BACb,iEACA,uBAAGA,UAAU,aAAb,oJAKA,kBAAC,IAAD,CAAMY,GAAG,aAAaZ,UAAU,6BAAhC,aAGA,kBAAC,IAAD,CAAMY,GAAG,WAAWZ,UAAU,6BAA9B,cCVOa,MAJf,SAAsBC,GACpB,OAAO,4BAAKA,EAAMC,eCWLC,MAZf,SAAgBF,GACd,OACE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AD,CAAO2C,KAAK,cACV,kBAAC,EAAD,OAEF,kBAAC,IAAD,CAAOA,KAAK,YACV,kBAAC,EAAD,OAEF,kBAAC,IAAD,CAAOA,KAAK,KACV,kBAAC,EAAD,WAMV,kBAAC,EAAD,QCzBcC,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAAC,EAAD,OAEFC,SAASC,eAAe,SDyHpB,kBAAmBC,WACrBA,UAAUC,cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACLC,QAAQD,MAAMA,EAAME,c","file":"static/js/main.986d889e.chunk.js","sourcesContent":["import React from \"react\";\n\nfunction Header() {\n return (\n
\n
\n \n \n \n

\n Covid19 Screening Tool\n

\n
\n
\n );\n}\n\nexport default Header;\n","import React from \"react\";\n\nfunction Footer() {\n return (\n
\n

\n This is a simplified version of the{\" \"}\n \n \n Decision Tool\n \n {\" \"}\n published by DOH-Philippines\n

\n

\n Developed by Dennis Macaspac | Logo by flaticon.com\n

\n
\n );\n}\n\nexport default Footer;\n","import React from \"react\";\nimport { Link } from \"react-router-dom\";\n\nfunction Landing() {\n return (\n
\n
\n
Are you a traveller or a patient?
\n

\n Choose traveller to enter the algorithm for triage in ports of entry.\n Choose patient to enter the algorithm for triage in healthcare\n facilities.\n

\n \n Traveller\n \n \n Patient\n \n
\n
\n );\n}\n\nexport default Landing;\n","import React from \"react\";\n\nfunction MainQuestion(props) {\n return
{props.mainQuestion}
;\n}\n\nexport default MainQuestion;\n","import React from \"react\";\n\nfunction Button(props) {\n return (\n \n {props.label}\n \n );\n}\n\nexport default Button;\n","import React from \"react\";\n\nfunction PUI() {\n return (\n
\n
You are PUI
\n
\n );\n}\n\nexport default PUI;\n","import React from \"react\";\n\nfunction PUM() {\n return (\n
\n
You are PUM
\n
\n );\n}\n\nexport default PUM;\n","import React from \"react\";\n\nfunction Neither() {\n return (\n
\n
You are neither PUI nor PUM
\n
\n );\n}\n\nexport default Neither;\n","import React from \"react\";\n\nimport MainQuestion from \"./MainQuestion\";\nimport Button from \"./Button\";\n\nimport PUI from \"./PUI\";\nimport PUM from \"./PUM\";\nimport Neither from \"./Neither\";\n\nfunction Traveller() {\n let questions = {\n travel: \"Did you travel outside the country?\",\n symptoms: \"Do you have symptoms such as fever, cough or colds?\",\n exposure: \"Were you anywhere near a confirmed Covid-19 patient?\",\n };\n\n let didTravel = React.useState(\"no answer\");\n let hasSymptoms = React.useState(\"no answer\");\n let nearCovidPatient = React.useState(\"no answer\");\n\n const handleDidTravel = (evt) => {\n didTravel[1](evt.target.value);\n };\n\n function handleHasSymptoms(evt) {\n hasSymptoms[1](evt.target.value);\n }\n\n function handleNearCovidPatient(evt) {\n nearCovidPatient[1](evt.target.value);\n }\n\n return (\n
\n {/* Summary of User's Answers */}\n
\n {didTravel[0] !== \"no answer\" && (\n
\n
Your Answers
\n {didTravel[0] !== \"no answer\" && (\n

Travel: {didTravel[0]}

\n )}\n {hasSymptoms[0] !== \"no answer\" && (\n

Symptoms: {hasSymptoms[0]}

\n )}\n {nearCovidPatient[0] !== \"no answer\" && (\n

Near Covid Patient: {nearCovidPatient[0]}

\n )}\n
\n )}\n
\n\n {/* First Question */}\n {didTravel[0] === \"no answer\" &&\n hasSymptoms[0] === \"no answer\" &&\n nearCovidPatient[0] === \"no answer\" && (\n
\n \n
\n )}\n {/* Next Question */}\n {didTravel[0] === \"yes\" &&\n hasSymptoms[0] === \"no answer\" &&\n nearCovidPatient[0] === \"no answer\" && (\n
\n \n
\n )}\n {/* Next Question */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"no answer\" &&\n nearCovidPatient[0] === \"yes\" && (\n
\n \n
\n )}\n {/* Next Question */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"no answer\" &&\n nearCovidPatient[0] === \"no answer\" && (\n
\n \n
\n )}\n\n {/* Result */}\n {didTravel[0] === \"yes\" &&\n hasSymptoms[0] === \"yes\" &&\n nearCovidPatient[0] === \"no answer\" && }\n {/* Next Result */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"no answer\" &&\n nearCovidPatient[0] === \"no\" && }\n {/* Next Result */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"no\" &&\n nearCovidPatient[0] === \"none\" && }\n {/* Next Result */}\n {didTravel[0] === \"yes\" &&\n hasSymptoms[0] === \"no\" &&\n nearCovidPatient[0] === \"no answer\" && }\n {/* Next Result */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"yes\" &&\n nearCovidPatient[0] === \"no\" && }\n {/* Next Result */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"no\" &&\n nearCovidPatient[0] === \"yes\" && }\n {/* Next Result */}\n {didTravel[0] === \"no\" &&\n hasSymptoms[0] === \"yes\" &&\n nearCovidPatient[0] === \"yes\" && }\n\n {/* Start Over */}\n \n
\n );\n}\n\nexport default Traveller;\n","import React from \"react\";\n\nimport MainQuestion from \"./MainQuestion\";\nimport Button from \"./Button\";\n\nimport PUI from \"./PUI\";\nimport PUM from \"./PUM\";\nimport Neither from \"./Neither\";\n\nfunction Patient() {\n let questions = {\n symptoms:\n \"Do you have symptoms such as fever, cough or colds, shortness of breath or other respiratory symptoms?\",\n exposure: \"Were you anywhere near a confirmed Covid-19 patient or area?\",\n timing: \"Did the symptoms occur within 14 days of exposure?\",\n severity:\n \"Do you have SEVERE acute respiratory infection or atypical pneumonia?\",\n };\n\n let hasSymptoms = React.useState(\"no answer\");\n let wasExposed = React.useState(\"no answer\");\n let within14Days = React.useState(\"no answer\");\n let isSevere = React.useState(\"no answer\");\n\n function handleHasSymptoms(evt) {\n hasSymptoms[1](evt.target.value);\n }\n\n function handleWasExposed(evt) {\n wasExposed[1](evt.target.value);\n }\n\n function handleWithin14Days(evt) {\n within14Days[1](evt.target.value);\n }\n\n function handleIsSevere(evt) {\n isSevere[1](evt.target.value);\n }\n\n return (\n
\n {/* Summary of User's Answers */}\n
\n {hasSymptoms[0] !== \"no answer\" && (\n
\n
Your Answers
\n {hasSymptoms[0] !== \"no answer\" && (\n

Has Symptoms: {hasSymptoms[0]}

\n )}\n {wasExposed[0] !== \"no answer\" && (\n

\n Exposed to Covid Patient or Area: {wasExposed[0]}\n

\n )}\n {within14Days[0] !== \"no answer\" && (\n

\n Symptoms Happened Within 14 Days: {within14Days[0]}\n

\n )}\n {isSevere[0] !== \"no answer\" && (\n

Symptoms Are Severe: {isSevere[0]}

\n )}\n
\n )}\n
\n\n {/* First Question */}\n {hasSymptoms[0] === \"no answer\" &&\n wasExposed[0] === \"no answer\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"no answer\" && (\n
\n \n
\n )}\n\n {/* Next Question */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"no answer\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"no answer\" && (\n
\n \n
\n )}\n\n {/* Next Question */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"yes\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"no answer\" && (\n
\n \n
\n )}\n\n {/* Next Question */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"no\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"no answer\" && (\n
\n \n
\n )}\n\n {/* Result */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"no\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"yes\" && }\n\n {/* Result */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"yes\" &&\n within14Days[0] === \"no\" &&\n isSevere[0] === \"no answer\" && }\n\n {/* Result */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"no\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"no\" && }\n\n {/* Result */}\n {hasSymptoms[0] === \"yes\" &&\n wasExposed[0] === \"yes\" &&\n within14Days[0] === \"yes\" &&\n isSevere[0] === \"no answer\" && }\n\n {/* Result */}\n {hasSymptoms[0] === \"no\" &&\n wasExposed[0] === \"no answer\" &&\n within14Days[0] === \"no answer\" &&\n isSevere[0] === \"no answer\" && }\n\n {/* Start Over */}\n \n
\n );\n}\n\nexport default Patient;\n","import React from \"react\";\nimport { BrowserRouter as Router, Switch, Route } from \"react-router-dom\";\n\nimport Header from \"./components/Header\";\nimport Footer from \"./components/Footer\";\nimport Landing from \"./components/Landing\";\nimport Traveller from \"./components/Traveller\";\nimport Patient from \"./components/Patient\";\nimport PhStats from \"./components/PhStats\";\n\nfunction App() {\n return (\n
\n
\n
\n
\n
Live Statistics for the Philippines:
\n no data\n {/* */}\n
\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
\n );\n}\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.0/8 are considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl, {\n headers: { 'Service-Worker': 'script' },\n })\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready\n .then(registration => {\n registration.unregister();\n })\n .catch(error => {\n console.error(error.message);\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}