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EAAOC,IAAG,CACTC,QAAS,CAAEC,MAAO,IAClBC,QAAS3C,EACT8B,UAAS,qNAAAtB,QACO,IAAd5B,EAAqB,YAAc,eAClC+C,SAAA,EAEHC,EAAAA,EAAAA,KAAA,OACEE,UAAU,yCACVc,IAAKC,EAAAA,EACLC,IAAI,MAGNlB,EAAAA,EAAAA,KAAA,MAAIE,UAAU,2JAA0JH,SAAC,4CAI3KF,EAAAA,EAAAA,MAAA,OACEkB,QAAS3C,EACT8B,UAAS,qNAAAtB,QACO,IAAd5B,EAAqB,YAAc,eAClC+C,SAAA,EAEHC,EAAAA,EAAAA,KAAA,OACEE,UAAU,yCACVc,IAAKC,EAAAA,EACLC,IAAI,MAGNlB,EAAAA,EAAAA,KAAA,MAAIE,UAAU,2JAA0JH,SAAC,8CAM7K,OAIJC,EAAAA,EAAAA,KAAAF,EAAAA,SAAA,KAGFE,EAAAA,EAAAA,KAACmB,EAAAA,EAAM,MACN,C","sources":["components/Layout/LayoutNav.jsx"],"sourcesContent":["import ChatModule from \"../ChatModule/ChatModule\";\nimport { Outlet } from \"react-router-dom\";\nimport Footer from \"../Footer/Footer\";\nimport Navbar from \"../Navbar/Navbar\";\nimport { useEffect, useState } from \"react\";\nimport axios from \"axios\";\nimport { useGlobalContext } from \"../../utils/contexts\";\nimport useTokenValidation from \"../../Hooks/useTokenValidation\";\nimport { useLocation } from \"react-router-dom\";\nimport FreeBootcampRegModal from \"../AllModal/FreeBootcampRegModal\";\nimport BootcampPiece from \"../../assets/Bootcamppopup/Chess animated png 3.svg\";\nimport Login from \"../old_Home/old_Login/Login\";\nimport { AnimatePresence, motion } from \"framer-motion\";\n\n// LayoutNav is rendering the layout of the website\n// refer to app.js\n\nconst LayoutNav = (props) => {\n const location = useLocation();\n const [error, setError] = useState(null);\n const [openModal, setOpenModal] = useState(false);\n const [isRegistered, setIsRegistered] = useState(false); // Moved useState inside the component function\n const [registerForm, setRegisterForm] = useState(false);\n const [active, setActive] = useState(false);\n const [route, setRoute] = useState(\"\");\n // check token validity\n useTokenValidation(error);\n const { setCoachLoading } = useGlobalContext();\n // get user\n const auth = JSON.parse(localStorage.getItem(\"auth\"));\n const [registerWithOTP, setRegisterWithOTP] = useState(false);\n const handleFreeClassModel = () => {\n if (!auth?._id) {\n setRegisterForm(true);\n setRegisterWithOTP(true);\n setActive(true);\n } else {\n setOpenModal(!openModal);\n }\n };\n\n useEffect(() => {\n if (auth?._id) {\n const fetchRegistrationStatus = async () => {\n try {\n const response = await axios.get(\n `${process.env.REACT_APP_BACKEND_URL}/api/freeGroupClass/check-registration`,\n {\n params: {\n userId: auth?._id,\n },\n }\n );\n\n setIsRegistered(response.data.message === \"Notregistered\");\n } catch (error) {\n console.error(\"Error fetching registration status:\", error);\n }\n };\n\n if (auth._id) {\n fetchRegistrationStatus();\n }\n }\n }, [auth?._id]);\n\n const handleActiveLogin = (url, navigate = false) => {\n setActive(true);\n setRegisterForm(false);\n if (!navigate) {\n setRoute(url);\n }\n };\n // get coach\n useEffect(() => {\n if (auth?._id) {\n setCoachLoading(true);\n const coach = axios\n .get(\n `${process.env.REACT_APP_BACKEND_URL}/api/coach/user/${auth?._id}`,\n {\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${auth?.accessToken}`,\n },\n }\n )\n .then((res) => {\n const coach = res.data;\n console.log(coach);\n props.setCoachData(coach);\n setCoachLoading(false);\n })\n .catch((err) => {\n console.log(err.message);\n setCoachLoading(false);\n setError(err);\n });\n\n return () => coach;\n }\n }, [auth?._id, auth?.accessToken]);\n\n return (\n <>\n {active && (\n