{"version":3,"sources":["Info.js","Stepper.js","InitialPopup.js","Books.js","Store.js","TextWindow.js","BookSelector.js","DataLoading.js","App.js","Routes.js","reportWebVitals.js","index.js"],"names":["Info","props","nodeRef","useRef","CSSTransition","in","timeout","classNames","className","ref","href","title","style","margin","textAlign","src","alt","rel","target","verticalAlign","Stepper","prevStepsCSS","step","shouldShowFullTranslation","nextStepsCSS","maxStep","translateIconCSS","shouldAllowShowFullTranslation","onClick","showFullTranslation","marginRight","showBookSelector","disabled","decrementStep","type","maxLength","onChange","changeStep","onFocus","ev","select","onKeyUp","key","blur","value","pattern","incrementStep","InitialPopup","seenPopupPreviously","localStorage","getItem","hidePopup","setSeenPopup","setTimeout","setItem","Fragment","seenPopup","srcSet","media","getDailyCacheBuster","today","Date","dd","String","getDate","padStart","getMonth","getFullYear","Books","BookLoader","load","fetch","headers","method","then","response","json","books","loadText","promiseArray","forEach","b","bookTextPromise","translation","text","steps","nativeText","SoundGenerator","push","Promise","all","SoundObject","book","language","texts","concat","window","initBookTitle","initBook","find","data","store","booksLoaded","length","preLoadedSounds","preLoadSounds","save","bool","snds","index","soundName","Audio","shouldShowBookSelector","parseInt","volumeOn","callbacks","cb","TextWindow","highlightRef","currentStep","join","newPhrase","newLanguageText","subText","substr","startIndex","endIndex","split","current","scrollIntoView","tangentialCSS","map","paragraph","paragraphIndex","indexOf","highlightedTextStartIndex","highlightedTextEndIndex","lastIndexOf","highlightedText","replace","substring","highlighCSS","isGreen","highlightSearchRegEx","highlightSections","BookSelector","useState","flag","setFlag","hideBookSelector","selectedBook","selectedLanguage","volumeIcon","backgroundImage","filter","css","chooseBook","bind","author","color","padding","toggleVolume","opacity","paddingTop","marginLeft","display","paddingBottom","toString","DataLoading","App","setStore","persistStep","stopAudio","a","Object","keys","k","pause","currentTime","getTextIndexByStartIndex","t","useEffect","assign","Math","max","booksForChosenLanguage","selectedIndex","findIndex","nextBook","min","stepIndex","textIndex","play","num","actualNumber","isNaN","Routes","path","reportWebVitals","onPerfE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WAC1Bc,EAAKC,MAAMhB,MAAQJ,EAAEI,MACrBe,EAAKC,MAAM5E,QAAUwD,EAAEI,MAAMkB,OAE7BH,EAAKC,MAAMG,gBAAkBC,EAAcxB,EAAEvC,KAER,IAAjC0D,EAAKC,MAAMf,WAAWiB,SACxBH,EAAKC,MAAMxE,oBAAsB,GAGnC8I,IACAvE,EAAKM,QA2DDuD,aAxDe,WAEnB7D,EAAKC,MAAMa,UAAYd,EAAKC,MAAMa,SAClCjE,aAAaK,QAAQ,WAAY8C,EAAKC,MAAMa,UAE5Cd,EAAKM,QAoDDQ,SAAUb,EAAMa,eChMTkF,MAff,SAAgBnM,GAEd,OAEE,eAAC,IAAD,WACI,cAAC,IAAD,CAAOoM,KAAK,SAAZ,SACI,cAAC,EAAD,MAEJ,cAAC,IAAD,UACI,cAAC,EAAD,UCFGC,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,6BAAqB9H,MAAK,YAAkD,IAA/C+H,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,SAM1BZ,M","file":"static/js/main.148abf3f.chunk.js","sourcesContent":["import React, { useRef } from 'react';\r\nimport { CSSTransition } from 'react-transition-group';\r\nimport './Info.css';\r\n\r\nfunction Info(props) {\r\n\r\n const nodeRef = useRef(null);\r\n\r\n return (\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n close\r\n \r\n
\r\n\r\n
\r\n\r\n

\r\n \"Neuron\"\r\n

\r\n \r\n

\r\n The general idea behind DonQuixote is to attempt to capitalize on\r\n  Hebbian learning \r\n by using your primary language as the basis and springboard for learning a new language.\r\n As a child, we are constantly associating words and phrases contextually. When we're young, we see a ball, and a parent says \"ball.\" \r\n After enough conditioning, we associate the word ball with its image. By stepping through a DonQuixote \r\n text and reciting your primary language aloud as well as the language you're trying to learn, we believe that you're cutting \r\n down learning time drastically by activating the same associative learning mechanism used as a child.\r\n

\r\n\r\n

\r\n With modern language learning apps, the focus is very much on the new word or phrase you're \r\n trying to learn. While this seems like the obvious track, we take the opposite approach and focus on the words you know in your\r\n primary language instead. We then introduce you to the associated words and phrases in the other language. This method should enable the \r\n brain to attribute meaning to the new language. \r\n

\r\n\r\n

\r\n As you step through the lessons, you may notice that your primary language sounds stranger than usual. \r\n The sacrifice in usual word order in your primary language enables you to think contextually in the \r\n language you're trying to learn. When you get to the highlighted green text, you'll notice a sense of understanding that you didn't have before.\r\n You may also become aware if you hit the translate button(translate), you can read and understand the \r\n entire text, especially if you go through it more than once.\r\n

\r\n\r\n

\r\n That's our handwavy theory behind it anyway. You'll have to try it for yourselves and see how effective DonQuixote is for you. We believe all \r\n language learning apps are useful in your language learning journey and hope that you continue to use them as well as DonQuixote going forward.\r\n

\r\n\r\n

\r\n Get Started\r\n

\r\n\r\n
\r\n\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default Info;\r\n","import React, { useRef } from 'react';\r\nimport { CSSTransition } from 'react-transition-group';\r\nimport './Stepper.css';\r\nimport classNames from \"classnames\";\r\n\r\nfunction Stepper(props) {\r\n\r\n const nodeRef = useRef(null);\r\n\r\n const focus = (ev) => {\r\n ev.target.select();\r\n };\r\n\r\n const keyUp = (ev) => {\r\n if (ev.key === \"Enter\") {\r\n ev.target.blur();\r\n }\r\n };\r\n\r\n const prevStepsCSS = classNames({\r\n \"Stepper-button\": true,\r\n \"Stepper-disable\": props.step <= 1 || props.shouldShowFullTranslation !== 0\r\n });\r\n\r\n const nextStepsCSS = classNames({\r\n \"Stepper-button\": true,\r\n \"Stepper-done\": props.step === props.maxStep,\r\n \"Stepper-disable\": props.shouldShowFullTranslation !== 0\r\n });\r\n\r\n const translateIconCSS = classNames({\r\n \"Stepper-button\": true,\r\n \"Stepper-book\": true,\r\n \"Stepper-foreign\": props.shouldShowFullTranslation === 1,\r\n \"Stepper-domestic\": props.shouldShowFullTranslation === 2\r\n });\r\n\r\n return (\r\n \r\n \r\n
\r\n {props.shouldAllowShowFullTranslation && }\r\n \r\n \r\n \r\n \r\n\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default Stepper;\r\n","import React, { useRef } from 'react';\r\nimport { CSSTransition } from 'react-transition-group';\r\nimport './InitialPopup.css';\r\n\r\nfunction InitialPopup(props) {\r\n\r\n let seenPopupPreviously = localStorage && localStorage.getItem(\"popupSeen\");\r\n const nodeRef = useRef(null);\r\n\r\n const hidePopup = () => {\r\n\r\n props.setSeenPopup();\r\n \r\n setTimeout(() => {\r\n \r\n if (localStorage) {\r\n localStorage.setItem(\"popupSeen\", true);\r\n }\r\n }, 1);\r\n };\r\n\r\n if (seenPopupPreviously) {\r\n return ;\r\n }\r\n\r\n // setTimeout(() => {\r\n // hidePopup();\r\n // }, 40000);\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n

\r\n \r\n \r\n \"Don\r\n \r\n

\r\n

\r\n Welcome to donquixote.fun, a novel way of learning languages quickly.\r\n We only have a few translations right now, but stay tuned. Read the following suggestions and then begin. Good luck!\r\n

\r\n
    \r\n
  • check_circle Recite the Primary and Foreign language in the highlighted sections out loud
  • \r\n
  • check_circle When you get to a green highlighted item, you should understand the meaning
  • \r\n
  • check_circle If you pause, remember the step number you left off, so you can resume your position later
  • \r\n
  • check_circle Choose a different text if you'd like by clicking the book icon
  • \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n );\r\n}\r\n\r\nexport default InitialPopup;\r\n","\r\nconst getDailyCacheBuster = () => {\r\n let today = new Date();\r\n let dd = String(today.getDate()).padStart(2, '0');\r\n let mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!\r\n let yyyy = today.getFullYear();\r\n\r\n return mm + dd + yyyy;\r\n};\r\n\r\nlet Books = [\r\n\r\n];\r\n\r\nconst BookLoader = {\r\n load: () => {\r\n\r\n return fetch(\"/books/books.json?t=\" + getDailyCacheBuster(), {\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n method: \"GET\"\r\n }).then((response) => response.json())\r\n .then((json) => {\r\n \r\n Books = json.books;\r\n\r\n return BookLoader.loadText();\r\n });\r\n },\r\n loadText: () => {\r\n\r\n const promiseArray = [];\r\n\r\n Books.forEach((b) => {\r\n\r\n const bookTextPromise = fetch(`/books/${b.translation}?t=` + getDailyCacheBuster(), {\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n method: \"GET\"\r\n }).then((response) => response.json())\r\n .then((json) => {\r\n \r\n b.text = json.text;\r\n b.steps = json.steps;\r\n b.nativeText = json.nativeText || [];\r\n\r\n // console.log(\"b\", b);\r\n \r\n SoundGenerator(b);\r\n\r\n return b;\r\n });\r\n\r\n promiseArray.push(bookTextPromise);\r\n });\r\n\r\n return Promise.all(promiseArray).then(() => {\r\n return Books;\r\n });\r\n }\r\n};\r\n\r\nlet SoundObject = {};\r\nconst SoundGenerator = (book) => {\r\n\r\n SoundObject[book.key] = SoundObject[book.key] || { language: book.language, texts: [] };\r\n\r\n SoundObject[book.key].texts = SoundObject[book.key].texts.concat(book.text);\r\n SoundObject[book.key].language = book.language;\r\n\r\n window.SoundObject = SoundObject;\r\n}\r\n\r\nexport { BookLoader, Books };\r\n","import { BookLoader } from \"./Books\";\r\n\r\nBookLoader.load().then((books) => {\r\n\r\n const initBookTitle = (localStorage && localStorage.getItem(\"prevBook\")) ? localStorage.getItem(\"prevBook\") : \"conversation1-es\";\r\n const initBook = books.find((b) => b.key === initBookTitle);\r\n\r\n data.store.booksLoaded = true;\r\n data.store.book = initBookTitle;\r\n data.store.steps = initBook.steps;\r\n data.store.maxStep = initBook.steps.length;\r\n data.store.text = initBook.text;\r\n data.store.nativeText = initBook.nativeText;\r\n data.store.preLoadedSounds = preLoadSounds(initBookTitle)\r\n\r\n data.save();\r\n});\r\n\r\nconst stringToBool = (bool) => {\r\n\r\n if (bool === \"true\") {\r\n return true;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst preLoadSounds = (title) => {\r\n \r\n const snds = {};\r\n\r\n for (let index = 0; index < data.store.text.length; index++) {\r\n \r\n const soundName = `/sounds/${title}-${index}.mp3`;\r\n\r\n snds[data.store.book + \"-\" + index] = new Audio(soundName);\r\n\r\n }\r\n \r\n return snds;\r\n};\r\n\r\nconst data = {\r\n\r\n store: {\r\n\r\n booksLoaded: false,\r\n book: \"conversation1-es\",\r\n shouldShowBookSelector: false,\r\n seenPopup: (localStorage && localStorage.getItem(\"popupSeen\")) ? true : false,\r\n step: (localStorage && localStorage.getItem(\"prevStep\")) ? parseInt(localStorage.getItem(\"prevStep\"), 10) : 1,\r\n steps: 1,\r\n maxStep: 1,\r\n text: \"\",\r\n nativeText: \"\",\r\n showFullTranslation: 0,\r\n volumeOn: (localStorage && localStorage.getItem(\"volumeOn\") != null) ? stringToBool(localStorage.getItem(\"volumeOn\")) : true,\r\n preLoadedSounds: {}\r\n },\r\n\r\n callbacks: [],\r\n\r\n onChange: (cb) => {\r\n data.callbacks.push(cb);\r\n },\r\n\r\n save: () => {\r\n data.callbacks.forEach(cb => {\r\n cb(data.store);\r\n });\r\n }\r\n};\r\n\r\nexport { data, preLoadSounds };\r\n","import classNames from 'classnames';\r\nimport React, { useRef } from 'react';\r\nimport { CSSTransition } from 'react-transition-group';\r\nimport './TextWindow.css';\r\n\r\nfunction TextWindow(props) {\r\n\r\n const nodeRef = useRef(null);\r\n const highlightRef = useRef(null);\r\n\r\n const executeScroll = () => {\r\n \r\n setTimeout(() => {\r\n\r\n if (highlightRef.current) {\r\n highlightRef.current.scrollIntoView();\r\n }\r\n }, 1);\r\n \r\n };\r\n\r\n const currentStep = props.steps[props.step - 1];\r\n\r\n if (!props.text || !currentStep) {\r\n return ;\r\n }\r\n\r\n let text = props.text.join(\"|\"); // we joined all paragraphs as one string\r\n\r\n if (props.shouldShowFullTranslation === 0) {\r\n\r\n let nativeText = currentStep ? currentStep.nativeText : \"\";\r\n let newPhrase = currentStep ? currentStep.newPhrase : \"\";\r\n let newLanguageText = currentStep ? currentStep.newLanguageText : \"\";\r\n \r\n let subText = currentStep ? \"$$\" + nativeText + \"^^\" + newPhrase + \"^^\" + newLanguageText + \"$$\" : \"\"; // the text we want to insert\r\n \r\n if (props.seenPopup && currentStep) {\r\n \r\n text = text.substr(0, currentStep.startIndex) + subText + text.substr(currentStep.endIndex); // insert the new text\r\n }\r\n }\r\n\r\n text = text.split(\"|\"); // turn it back into an array of paragraphs\r\n\r\n executeScroll();\r\n\r\n const tangentialCSS = classNames({\r\n \"TextWindow\": true,\r\n \"TextWindow-tan\": props.seenPopup,\r\n \"TextWindow-fullForeign\": props.shouldShowFullTranslation === 1 || props.shouldShowFullTranslation === 2\r\n });\r\n\r\n return (\r\n \r\n \r\n
\r\n \r\n {text.map((paragraph, paragraphIndex) => {\r\n if (paragraph.indexOf(\"$$\") !== -1) {\r\n\r\n const highlightedTextStartIndex = paragraph.indexOf(\"$$\");\r\n const highlightedTextEndIndex = paragraph.lastIndexOf(\"$$\") - 2;\r\n\r\n const searchRegExp = /\\$\\$/g;\r\n paragraph = paragraph.replace(searchRegExp, \"\");\r\n let highlightedText = paragraph.substring(highlightedTextStartIndex, highlightedTextEndIndex);\r\n // console.log(highlightedText, highlightedTextStartIndex, highlightedTextEndIndex);\r\n let highlighCSS = currentStep.isGreen ? \"TextWindow-highlightGreen\" : \"TextWindow-highlight\";\r\n let title = currentStep.isGreen ? \"You should have a decent level of understanding of the text when its highlighted green\" : \"\";\r\n\r\n const highlightSearchRegEx = /\\^\\^/g;\r\n const highlightSections = highlightedText.split(\"^^\");\r\n const nativeText = highlightSections[0];\r\n const newPhrase = highlightSections[1];\r\n const newLanguageText = highlightSections[2];\r\n highlightedText = highlightedText.replace(highlightSearchRegEx, \"\");\r\n paragraph = paragraph.replace(highlightSearchRegEx, \"\");\r\n\r\n paragraph =

\r\n {paragraph.substr(0, highlightedTextStartIndex)}\r\n \r\n {nativeText}\r\n {newPhrase}\r\n {newLanguageText}\r\n \r\n {paragraph.substr(highlightedTextStartIndex + highlightedText.length)}\r\n

;\r\n\r\n return paragraph;\r\n }\r\n\r\n paragraph = paragraph.indexOf(\"(((\") !== -1 ? {paragraph.replace(/\\(\\(\\(/g, \"\").replace(/\\)\\)\\)/g, \"\")} : paragraph;\r\n\r\n return

{paragraph}

;\r\n })}\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default TextWindow;\r\n","import React, { useRef, useState } from 'react';\r\nimport { CSSTransition } from 'react-transition-group';\r\nimport './BookSelector.css';\r\nimport { Books } from \"./Books\";\r\n\r\nfunction BookSelector(props) {\r\n\r\n const nodeRef = useRef(null);\r\n const [flag, setFlag] = useState(\"\");\r\n\r\n const hidePopup = () => {\r\n\r\n props.hideBookSelector();\r\n };\r\n\r\n const changeFlag = (ev) => {\r\n setFlag(ev.target.value);\r\n };\r\n\r\n const toggleVolume = (ev) => {\r\n\r\n props.toggleVolume();\r\n };\r\n\r\n const selectedBook = Books.find((b) => { return b.key === props.book; });\r\n\r\n const selectedLanguage = selectedBook && !flag ? selectedBook.language : flag;\r\n\r\n let volumeIcon = props.volumeOn ? \"volume_up\" : \"volume_mute\";\r\n\r\n // console.log(\"vi\", props.volumeOn, volumeIcon);\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n\r\n
\r\n Choose text\r\n
\r\n\r\n
\r\n Remember to recite each step aloud to aid learning.\r\n
\r\n\r\n \r\n\r\n
\r\n\r\n {Books.filter((b) => b.language === selectedLanguage).map((b) => {\r\n\r\n const isSelected = b.key === props.book;\r\n const css = isSelected ? \"BookSelector-book BookSelector-selected\" : \"BookSelector-book\";\r\n\r\n return \r\n })}\r\n\r\n
\r\n \r\n \r\n info_outline\r\n \r\n \r\n email\r\n \r\n \r\n \"Twitter\r\n \r\n \r\n © {new Date().getFullYear().toString()} DonQuixote LLC\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n );\r\n}\r\n\r\nexport default BookSelector;\r\n","import React, { useRef } from 'react';\r\nimport { CSSTransition } from 'react-transition-group';\r\nimport './DataLoading.css';\r\n\r\nfunction DataLoading(props) {\r\n\r\n const nodeRef = useRef(null);\r\n\r\n return (\r\n \r\n \r\n
\r\n
\r\n \"DonQuixote\r\n
\r\n
\r\n ....loading, please wait\r\n
\r\n
\r\n
\r\n
\r\n );\r\n}\r\n\r\nexport default DataLoading;\r\n","import React, { useState, useEffect } from 'react';\nimport './App.css';\nimport Stepper from './Stepper';\nimport InitialPopup from './InitialPopup';\nimport { data, preLoadSounds } from \"./Store\";\nimport TextWindow from './TextWindow';\nimport BookSelector from './BookSelector';\nimport DataLoading from './DataLoading';\nimport { Books } from \"./Books\";\n\nfunction App() {\n\n const [store, setStore] = useState(data.store);\n\n const handleSeenPopup = () => {\n data.store.seenPopup = true;\n data.save();\n }\n\n const persistStep = () => {\n\n if (localStorage) {\n localStorage.setItem(\"prevStep\", data.store.step);\n localStorage.setItem(\"prevBook\", data.store.book);\n }\n\n }\n\n const changeStep = (ev) => {\n\n stopAudio();\n const num = parseInt(ev.target.value, 10);\n const isANumber = !isNaN(num);\n const actualNumber = isANumber ? num : 0;\n\n data.store.step = Math.max(actualNumber, 1);\n data.store.step = Math.min(data.store.step, data.store.maxStep);\n \n persistStep();\n data.save();\n \n }\n\n const decrementStep = () => {\n\n stopAudio();\n data.store.step = Math.max(data.store.step - 1, 1);\n\n persistStep();\n data.save();\n }\n\n const incrementStep = () => {\n\n stopAudio();\n\n if (data.store.maxStep === data.store.step) {\n\n const selectedBook = Books.find((b) => { return b.key === data.store.book; });\n const booksForChosenLanguage = Books.filter((b) => b.language === selectedBook.language);\n const selectedIndex = booksForChosenLanguage.findIndex((b) => b.key === data.store.book);\n\n if (booksForChosenLanguage.length > selectedIndex + 1) {\n data.store.book = booksForChosenLanguage[selectedIndex + 1].key;\n } else {\n data.store.book = booksForChosenLanguage[0].key;\n }\n\n const nextBook = booksForChosenLanguage.find((b) => b.key === data.store.book);\n\n data.store.book = nextBook.key;\n data.store.text = nextBook.text;\n data.store.nativeText = nextBook.nativeText;\n data.store.steps = nextBook.steps;\n data.store.maxStep = nextBook.steps.length;\n\n data.store.step = 1;\n \n } else {\n\n data.store.step = Math.min(data.store.step + 1, data.store.maxStep);\n\n let stepIndex = data.store.step - 1;\n\n if (data.store.volumeOn && data.store.steps[stepIndex] && data.store.steps[stepIndex].isGreen) {\n let textIndex = getTextIndexByStartIndex(data.store.steps[stepIndex].startIndex);\n // console.log(data.store.preLoadedSounds);\n let audio = data.store.preLoadedSounds[`${data.store.book}-${textIndex}`] || new Audio(`/sounds/${data.store.book}-${textIndex}.mp3`);\n\n audio.play();\n // console.log(data.store, data.store.steps[data.store.step - 1], soundName);\n }\n }\n\n persistStep();\n data.save();\n };\n\n async function stopAudio() {\n Object.keys(data.store.preLoadedSounds).forEach((k) => {\n data.store.preLoadedSounds[k].pause();\n data.store.preLoadedSounds[k].currentTime = 0;\n })\n }\n\n const getTextIndexByStartIndex = (startIndex) => {\n\n let length = 0;\n\n for (let index = 0; index < data.store.text.length; index++) {\n const t = data.store.text[index];\n\n if (startIndex < length) {\n return index - 1;\n }\n\n length += t.length + 1;\n \n }\n\n return data.store.text.length - 1;\n };\n\n const showBookSelector = () => {\n data.store.shouldShowBookSelector = true;\n \n data.save();\n };\n\n const hideBookSelector = () => {\n data.store.shouldShowBookSelector = false;\n \n data.save();\n };\n\n const chooseBook = (b) => {\n\n data.store.book = b.key;\n data.store.shouldShowBookSelector = false;\n data.store.step = 1;\n data.store.text = b.text;\n data.store.nativeText = b.nativeText;\n data.store.steps = b.steps;\n data.store.maxStep = b.steps.length;\n // data.store.preLoadedSounds = {...data.store.preLoadedSounds, ...preLoadSounds(b.key)}; if we want to keep loading them\n data.store.preLoadedSounds = preLoadSounds(b.key);\n\n if (data.store.nativeText.length === 0) {\n data.store.showFullTranslation = 0;\n }\n\n persistStep();\n data.save();\n };\n\n const toggleVolume = () => {\n\n data.store.volumeOn = !data.store.volumeOn;\n localStorage.setItem(\"volumeOn\", data.store.volumeOn);\n\n data.save();\n };\n\n const showFullTranslation = () => {\n\n if (data.store.showFullTranslation < 2) {\n data.store.showFullTranslation++;\n } else {\n data.store.showFullTranslation = 0;\n }\n\n data.save();\n };\n\n useEffect(() => {\n data.onChange((store) => {\n\n setStore(Object.assign({}, store));\n });\n \n }, []);\n\n // console.log(\"abc\", store.volumeOn);\n\n return (\n
\n \n \n \n {store.seenPopup && 0}\n />}\n {store.seenPopup && }\n
\n );\n}\n\nexport default App;\n","import React from 'react';\r\nimport { Route, Switch } from \"wouter\";\r\nimport Info from \"./Info\";\r\nimport App from \"./App\";\r\n\r\nfunction Routes(props) {\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n\r\nexport default Routes;\r\n","const reportWebVitals = onPerfEntry => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport Routes from './Routes';\nimport reportWebVitals from './reportWebVitals';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root')\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}