{"version":3,"sources":["settings.ts","api/index.ts","pages/Dashboard.tsx","pages/SessionPictures.tsx","pages/Session.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["settings","axios","defaults","baseURL","createClient","body","a","post","res","data","client_id","getClient","id","get","startSession","clientId","getSession","killSession","delete","restartSession","Dashboard","history","useHistory","useState","error","setError","name","setName","email","setEmail","phone","setPhone","handleSubmit","e","preventDefault","length","message","parseInt","push","onSubmit","htmlFor","minLength","value","onChange","target","type","onClick","className","SessionPictures","urls","setUrls","activeUrl","setActiveUrl","useEffect","interval","setInterval","photos","clearInterval","closeModal","host","visible","onOk","cancelText","onCancel","width","src","alt","sort","b","split","localeCompare","map","title","Session","props","match","params","setClient","active","setActive","handleStartSession","loading","handleRestartSession","handleExit","handleNuke","success","client","has_photos","ghost","onBack","goBack","tags","color","subTitle","extra","disabled","onConfirm","danger","App","path","component","exact","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","document","getElementById"],"mappings":"2RAAe,EACR,OCGP,GAAqB,SAAjBA,EAAyB,CAE3BC,IAAMC,SAASC,QADF,4BAIR,IAAMC,EAAY,uCAAG,WAAOC,GAAP,eAAAC,EAAA,sEACRL,IAAMM,KAAN,eAAkDF,GAD1C,cACpBG,EADoB,yBAEnBA,EAAIC,KAAKC,WAFU,2CAAH,sDAKZC,EAAS,uCAAG,WAAOC,GAAP,eAAAN,EAAA,sEACLL,IAAMY,IAAN,uBAAkCD,IAD7B,cACjBJ,EADiB,yBAEhBA,EAAIC,MAFY,2CAAH,sDAITK,EAAY,uCAAG,WAAOC,GAAP,eAAAT,EAAA,sEACRL,IAAMM,KAAN,uBAA2BQ,EAA3B,aADQ,cACpBP,EADoB,yBAEnBA,EAAIC,MAFe,2CAAH,sDAKZO,EAAU,uCAAG,WAAOD,GAAP,eAAAT,EAAA,sEACNL,IAAMY,IAAN,uBACAE,EADA,aADM,cAClBP,EADkB,yBAIjBA,EAAIC,MAJa,2CAAH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b,SAKE,cAAC,IAAD,CAAQa,QAAM,EAACF,UAAWjB,EAA1B,2BAJI,QAQN,cAAC,IAAD,CAEEU,OAAK,EACL3C,KAAK,UACLkD,UAAWjB,EACXhC,QAASqC,EALX,2BACM,aAUV,cAAC,IAAD,IACA,cAAC,IAAD,CAAKpC,UAAU,WAAf,SACE,cAAC,EAAD,CAAiBhC,SAAUA,UCvFpBmF,MAbf,WACE,OACE,cAAC,IAAD,UACE,qBAAKnD,UAAU,MAAf,SACE,eAAC,IAAD,WACE,cAAC,IAAD,CAAOoD,KAAK,sBAAsBC,UAAW3B,IAC7C,cAAC,IAAD,CAAO4B,OAAK,EAACF,KAAK,IAAIC,UAAWhF,YCC5BkF,EAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,8BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCFdQ,IAASC,OAAO,cAAC,EAAD,IAASC,SAASC,eAAe,SAKjDZ,M","file":"static/js/main.f00f7f92.chunk.js","sourcesContent":["export default {\n env: 'prod',\n}\n","import { Client } from '../types'\nimport axios from 'axios'\nimport settings from '../settings'\n\nif (settings.env === 'jank') {\n const host = 'http://192.168.1.107:5000'\n axios.defaults.baseURL = host\n}\n\nexport const createClient = async (body: Omit) => {\n const res = await axios.post<{ client_id: string }>(`/api/clients`, body)\n return res.data.client_id\n}\n\nexport const getClient = async (id: string): Promise => {\n const res = await axios.get(`/api/clients/${id}`)\n return res.data\n}\nexport const startSession = async (clientId: string) => {\n const res = await axios.post(`/api/clients/${clientId}/session`)\n return res.data // session data\n}\n\nexport const getSession = async (clientId: string) => {\n const res = await axios.get<{ photos: string[] }>(\n `/api/clients/${clientId}/session`,\n )\n return res.data // session data\n}\n\nexport const killSession = async (clientId: string) => {\n await axios.delete(`/api/clients/${clientId}/session`)\n}\n\nexport const restartSession = async (clientId: string) => {\n await killSession(clientId)\n await startSession(clientId)\n}\n\n// Someday\n\nexport const getClients = async (): Promise => {\n const res = await axios.get(`/api/clients`)\n return res.data\n}\n\nexport const cleanup = () => {\n // send\n}\n","import { message } from 'antd'\nimport { Content } from 'antd/lib/layout/layout'\nimport React, { FormEvent } from 'react'\nimport { useState } from 'react'\nimport { useHistory } from 'react-router-dom'\nimport { createClient } from '../api'\n\nexport const Dashboard = () => {\n const history = useHistory()\n const [error, setError] = useState(null)\n const [name, setName] = useState('')\n const [email, setEmail] = useState('')\n const [phone, setPhone] = useState('')\n\n const handleReset = () => {\n //\n setName('')\n setEmail('')\n setPhone('')\n }\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault()\n\n if (phone.length < 10) {\n // helpful message\n message.error('Check all fields!')\n setError('Phone number needs to be a length of at least 10')\n return\n }\n\n const client_id = await createClient({\n name,\n email,\n phone: parseInt(phone),\n })\n\n history.push(`/sessions/${client_id}`)\n }\n\n return (\n \n

Dashboard

\n
\n \n \n \n \n \n {error &&

{error}

}\n
\n
\n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { Card, Modal, Spin } from 'antd'\nimport { getSession } from '../api'\nimport settings from '../settings'\n\ntype Props = {\n clientId: string\n}\n\nexport const SessionPictures = ({ clientId }: Props) => {\n const [urls, setUrls] = useState(null)\n const [activeUrl, setActiveUrl] = useState(null)\n\n useEffect(() => {\n const get = async () => {\n if (urls) return\n\n const { photos } = await getSession(clientId)\n if (photos.length) setUrls(photos)\n }\n\n const interval = setInterval(get, 250)\n\n return () => clearInterval(interval)\n }, [clientId, urls])\n\n const closeModal = () => setActiveUrl(null)\n\n const host = settings.env === 'jank' ? 'http://192.168.1.107:5000' : ''\n\n if (!urls?.length) return null\n\n return (\n <>\n \n \n \n
\n

Session Pictures

\n
\n {urls ? (\n urls\n .sort((a, b) => a.split('_')[0].localeCompare(b.split('_')[0]))\n .map((src) => (\n \n setActiveUrl(src)}\n key={src}\n id={src}\n src={`${host}/output/${clientId}/${src}`}\n alt=\"lol\"\n />\n \n ))\n ) : (\n \n )}\n
\n
\n \n )\n}\n","import React, { useEffect, useState } from 'react'\nimport { RouteComponentProps, useHistory } from 'react-router-dom'\nimport { getClient, killSession, restartSession, startSession } from '../api'\nimport { SessionPictures } from './SessionPictures'\nimport {\n Button,\n Divider,\n message,\n PageHeader,\n Popconfirm,\n Row,\n Tag,\n} from 'antd'\nimport { Content } from 'antd/lib/layout/layout'\nimport { Client } from '../types'\n\ntype Props = RouteComponentProps<{ clientId: string }>\n\nexport const Session = (props: Props) => {\n const history = useHistory()\n const { clientId } = props.match.params\n const [client, setClient] = useState(null)\n const [active, setActive] = useState(false)\n\n const handleStartSession = async () => {\n message.loading('Photo sequence starting! Stand by...')\n await startSession(clientId)\n setActive(true)\n }\n\n const handleRestartSession = async () => {\n setActive(false)\n message.loading(\n 'Deleting photos & restarting capture sequence! Stand by...',\n )\n await restartSession(clientId)\n setActive(true)\n }\n\n const handleExit = async () => {\n history.push('/')\n }\n\n const handleNuke = async () => {\n await killSession(clientId)\n message.success('Photos Deleted! Going back to dashboard')\n history.push('/')\n }\n\n useEffect(() => {\n const get = async () => {\n const client = await getClient(clientId)\n setClient(client)\n if (client.has_photos) setActive(true)\n }\n\n get()\n }, [clientId])\n\n return (\n \n history.goBack()}\n title={`Session for ${clientId}`}\n tags={active ? Active : Inactive}\n subTitle={`session has ${active ? 'started' : 'not started'}`}\n extra={[\n \n Capture\n ,\n \n \n ,\n \n \n ,\n \n Finish Session\n ,\n ]}\n >\n \n \n \n \n \n )\n}\n","import React from 'react'\nimport './App.css'\n\nimport { BrowserRouter, Switch, Route } from 'react-router-dom'\nimport { Dashboard } from './pages/Dashboard'\nimport { Session } from './pages/Session'\n\nfunction App() {\n return (\n \n
\n \n \n \n \n
\n
\n )\n}\n\nexport default App\n","import { ReportHandler } from 'web-vitals';\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler) => {\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 'antd/dist/antd.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(, document.getElementById('root'))\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":""}