{"version":3,"sources":["WeightLoss/weightLoss.js","Navbar/navbar.js","App.js","serviceWorker.js","index.js"],"names":["props","useState","weights","setWeights","firstTime","setFirstTime","results","setResults","notBefore","Date","adjustChartData","date","data","filter","item","parseFloat","RowKey","map","newItem","valueOf","console","log","useEffect","a","options","url","method","axios","fetchData","height","width","margin","top","right","left","bottom","strokeDasharray","dataKey","name","tickFormatter","unixTime","moment","format","scale","type","domain","Math","min","i","max","interval","ticks","yDomain","weight","floor","push","getTicks","id","style","color","onClick","document","getElementById","value","onChange","e","state","setState","className","aria-hidden","focusable","data-prefix","data-icon","role","xmlns","viewBox","fill","d","display","Boolean","window","location","hostname","match","appInsights","ApplicationInsights","config","instrumentationKey","loadAppInsights","trackPageView","ReactDOM","render","StrictMode","navigator","serviceWorker","ready","then","registration","unregister","catch","error","message"],"mappings":"8bAee,G,OAAA,SAACA,GAAW,IAAD,EACMC,mBAAS,IADf,mBACjBC,EADiB,KACRC,EADQ,OAEUF,mBAAS,GAFnB,mBAEjBG,EAFiB,KAENC,EAFM,OAGMJ,mBAAS,IAHf,mBAGjBK,EAHiB,KAGRC,EAHQ,KAKlBC,EAAY,IAAIC,KAAK,6BAe3B,SAASC,EAAgBJ,EAASK,GAChCR,EACEG,EAAQM,KACLC,QAAO,SAACC,GAAD,OAAU,IAAIL,KAAKM,WAAWD,EAAKE,SAAWL,KACrDM,KAAI,SAACH,GACJ,IAAII,EAAUJ,EAGd,OAFAI,EAAQP,KAAOI,WAAWD,EAAKE,QAAUL,EAAKQ,UAC9CC,QAAQC,IAAIH,EAAQP,MACbO,MA2Cf,OAjEAI,qBAAU,WAAM,4CACd,8BAAAC,EAAA,6DACMC,EAAU,CACZC,IAAK,kBACLC,OAAQ,OAHZ,SAKwBC,IAAMH,GAL9B,OAKQlB,EALR,OAMEC,EAAWD,GACXD,EAAaG,EAAUW,WACvBT,EAAgBJ,EAASE,GAR3B,4CADc,uBAAC,WAAD,wBAWdoB,KACC,IAsDD,6BACE,kBAAC,IAA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aAAhB,kBA4BR,8BAIE,yBAAKV,MAAO,CAAEoB,QAAmB,IAAVZ,EAAc,OAAS,KAC5C,yBAAKE,UAAU,aACb,wDAGJ,yBAAKV,MAAO,CAAEoB,QAAmB,IAAVZ,EAAc,OAAS,KAC5C,kBAAC,EAAD,WCpHK,oBAAM,kBAAC,EAAD,OCMDa,QACW,cAA7BC,OAAOC,SAASC,UAEa,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2D,ICVEC,EAAc,I,OAAIC,GAAoB,CAC1CC,OAAQ,CACNC,mBAAoB,0CAIxBH,EAAYI,kBACZJ,EAAYK,gBAEZC,IAASC,OACP,kBAAC,IAAMC,WAAP,KACE,kBAAC,EAAD,OAEF/B,SAASC,eAAe,SD8GpB,kBAAmB+B,WACrBA,UAAUC,cAAcC,MACrBC,MAAK,SAAAC,GACJA,EAAaC,gBAEdC,OAAM,SAAAC,GACLhF,QAAQgF,MAAMA,EAAMC,c","file":"static/js/main.739e4f5b.chunk.js","sourcesContent":["import React from \"react\";\nimport { useState, useEffect } from \"react\";\nimport axios from \"axios\";\nimport {\n LineChart,\n Line,\n XAxis,\n YAxis,\n CartesianGrid,\n ResponsiveContainer,\n} from \"recharts\";\nimport moment from \"moment\";\nimport DateTimePicker from 'react-datetime-picker';\nimport './weightloss.css'\n\nexport default (props) => {\n const [weights, setWeights] = useState([]);\n const [firstTime, setFirstTime] = useState(0);\n const [results, setResults] = useState({});\n\n const notBefore = new Date(\"June 1, 2023 12:00:00 PST\")\n useEffect(() => {\n async function fetchData() {\n let options = {\n url: \"/api/getWeights\",\n method: \"GET\",\n };\n const results = await axios(options);\n setResults(results);\n setFirstTime(notBefore.valueOf());\n adjustChartData(results, notBefore);\n }\n fetchData();\n }, []);\n\n function adjustChartData(results, date) {\n setWeights(\n results.data\n .filter((item) => new Date(parseFloat(item.RowKey)) > date)\n .map((item) => {\n let newItem = item;\n newItem.date = parseFloat(item.RowKey) - date.valueOf();\n console.log(newItem.date);\n return newItem;\n })\n );\n }\n\n function onChange(e) {\n setFirstTime(e.valueOf());\n adjustChartData(results, e);\n }\n\n function putWeight() {\n let weight = parseFloat(document.getElementById(\"weight\").value);\n let options = {\n url: \"/api/putWeight\",\n method: \"POST\",\n data: {\n weight: parseFloat(weight),\n },\n };\n axios(options);\n document.getElementById(\"weight\").value = \"\";\n weights.push({ weight, date: new Date().valueOf() - firstTime });\n setWeights(weights);\n }\n\n function getTicks(weights) {\n let yDomain =[\n Math.min(...weights.map((i) => i.weight)),\n Math.max(...weights.map((i) => i.weight)),\n ];\n \n let ticks = [];\n \n let a = Math.floor(yDomain[0] / 10) * 10\n while (a < yDomain[1])\n {\n ticks.push(a);\n a += 10;\n }\n ticks.push(a);\n return ticks;\n }\n\n return (\n
\n \n \n \n \n moment(unixTime + firstTime).format(\"MMM Do\")\n }\n scale=\"time\"\n type=\"number\"\n domain={[\n Math.min(...weights.map((i) => i.date)),\n Math.max(...weights.map((i) => i.date)),\n ]}\n />\n i.weight)),\n Math.max(...weights.map((i) => i.weight)),\n ]}\n />\n \n \n \n\n
\n \n \n
\n
\n \n
\n
\n );\n};\n","import React, { useState } from \"react\";\nimport \"./navbar.css\";\n// import SimcraftPawn from '../SimcraftPawn/SimcraftPawn';\nimport WeightLoss from \"../WeightLoss/weightLoss\";\nimport PSAElement from \"../PSA/psa\";\n\nexport default () => {\n let [state, setState] = useState(0);\n return (\n
\n \n
\n {/*
\n \n
*/}\n
\n
\n

Seth's Random Website!

\n
\n
\n
\n \n
\n {/*
\n \n
*/}\n {/*
\n \n
*/}\n
\n
\n );\n};\n","import React from 'react';\nimport './App.css';\nimport Navbar from './Navbar/navbar';\n\n\n\nexport default () => ;","// 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\nimport { ApplicationInsights } from '@microsoft/applicationinsights-web'\n\nconst appInsights = new ApplicationInsights({\n config: {\n instrumentationKey: '9b0ef77d-aac6-44ef-b77c-2595da731562'\n /* ...Other Configuration Options... */\n }\n});\nappInsights.loadAppInsights();\nappInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview\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":""}