text: (this.webpackJsonpvent_platform=this.webpackJsonpvent_platform||[]).push([[0],{173:function(e,a,t){e.exports=t(203)},178:function(e,a,t){},179:function(e,a,t){},203:function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),i=t(12),o=t.n(i),l=(t(178),t(34)),c=t(54),s=(t(179),t(35)),d=t(4),m=t(243),u=t(234),g=t(242),p=t(238),h=t(262),b=t(149),f=t(81),v=t(139),E=t.n(v),y=function(){var e=localStorage.getItem("token");return E.a.create({baseURL:"https://ventilator-registry.herokuapp.com/",headers:{Authorization:e}})},x=Object(b.a)({mapPropsToValues:function(e){return{name:e.name||"",brand:e.brand||"",model:e.model||"",quantity:e.quantity||""}},validationSchema:f.a().shape({name:f.b().required("Required"),brand:f.b().required("Required"),model:f.b().required("Required"),quantity:f.b().required("Please enter at least 1")}),handleSubmit:function(e,a){var t=a.props,n=localStorage.getItem("id"),r=Object(s.a)({},e,{user_id:n});y().post("/vents/",r).then((function(e){console.log(e),t.history.push("/dashboard/".concat(n))})).catch((function(e){console.log(e)})),t.setSubmitting(!1)}})((function(e){var a=e.classes,t=e.values,n=e.touched,i=e.errors,o=e.isSubmitting,l=e.handleChange,c=e.handleBlur,s=e.handleSubmit,d=e.handleReset,b=localStorage.getItem("id");return r.a.createElement("div",{className:a.container},r.a.createElement("div",{className:a.post_header},r.a.createElement("div",{className:a.heading},"Add Your Ventilator Details"),r.a.createElement("div",{className:a.link,onClick:function(){return e.history.push("/dashboard/".concat(b))}},"My Dashboard")),r.a.createElement("form",{onSubmit:s},r.a.createElement(u.a,{className:a.card},r.a.createElement(p.a,null,r.a.createElement(h.a,{id:"name",label:"Hospital Name",value:t.name,onChange:l,onBlur:c,helperText:n.name?i.name:"",error:n.name&&Boolean(i.name),margin:"dense",variant:"outlined",fullWidth:!0}),r.a.createElement(h.a,{id:"brand",label:"Ventilator Brand",value:t.brand,onChange:l,onBlur:c,helperText:n.brand?i.brand:"",error:n.brand&&Boolean(i.brand),margin:"dense",variant:"outlined",fullWidth:!0}),r.a.createElement(h.a,{id:"model",label:"Ventilator Model",value:t.model,onChange:l,onBlur:c,helperText:n.model?i.model:"",error:n.model&&Boolean(i.model),margin:"dense",variant:"outlined",fullWidth:!0}),r.a.createElement(h.a,{id:"quantity",label:"Ventilator Quantity on Hand",value:t.quantity,onChange:l,onBlur:c,helperText:n.quantity?i.quantity:"",error:n.quantity&&Boolean(i.quantity),margin:"dense",variant:"outlined",fullWidth:!0})),r.a.createElement(g.a,{className:a.actions},r.a.createElement(m.a,{type:"submit",color:"primary",disabled:o},"SUBMIT"),r.a.createElement(m.a,{color:"secondary",onClick:d},"CLEAR")))))})),S=Object(d.a)((function(){return{card:{maxWidth:420,marginTop:50},container:{backgroundColor:"#eaeff1",display:"flex",flexDirection:"column",alignItems:"center",minHeight:"100vh"},actions:{float:"right"},post_header:{backgroundColor:"#009be5",color:"#fff",width:"100vw",height:"144px"},heading:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:"26px",fontWeight:"500",lineSpacing:"0.5px",height:"80%"},link:{display:"flex",marginLeft:"20px",fontSize:"14px",fontWeight:"600",fontFamily:"Roboto, sans-serif",cursor:"pointer"}}}))(x),k=t(7),j=t(9),w=t(245),O=t(150),C=t(244),N=t(204),I=Object(C.a)((function(e){return{root:{height:"100vh",backgroundColor:"#eaeff1",display:"flex",justifyContent:"center",alignItems:"center",flexWrap:"wrap","& > *":{margin:e.spacing(1),width:e.spacing(50),height:e.spacing(60)}},input:{margin:"20px 0","& > *":{margin:e.spacing(2.5),width:"25ch"}},top_section:{margin:"20px 0",display:"flex",flexDirection:"column",justifyContent:"space-between"}}}));function B(e){var a=I(),t=Object(n.useState)({username:"",password:""}),i=Object(j.a)(t,2),o=i[0],c=i[1],d=function(e){c(Object(s.a)({},o,Object(k.a)({},e.target.name,e.target.value)))};return r.a.createElement("div",{className:a.root},r.a.createElement(O.a,{elevation:3,className:a.paper},r.a.createElement("div",{className:a.top_section},r.a.createElement(N.a,{variant:"h4",align:"center"},"1M Ventilators"),r.a.createElement(N.a,{variant:"body2",align:"center",style:{color:"#808080",fontWeight:"600"}},"Ventilator Registry Sing In")),r.a.createElement(w.a,{variant:"middle"}),r.a.createElement("form",{className:a.input},r.a.createElement(h.a,{id:"filled-username",variant:"filled",name:"username",label:"Username",onChange:d,value:o.username}),r.a.createElement(h.a,{id:"filled-password",variant:"filled",name:"password",label:"Password",type:"password",onChange:d,value:o.password}),r.a.createElement(m.a,{variant:"contained",color:"primary",size:"large",onClick:function(){y().post("/auth/login",o).then((function(a){localStorage.setItem("token",a.data.token),localStorage.setItem("id",a.data.users_id),localStorage.setItem("name",a.data.name),e.history.push("/dashboard/".concat(a.data.users_id))})).catch((function(e){alert("There's been a problem with your login, please check your details and try again."),console.log(e)}))}},"Sign In")),r.a.createElement(N.a,{variant:"body2",align:"center",style:{color:"#808080",fontWeight:"600"}},"Don't have an account?\xa0",r.a.createElement(l.b,{to:"/signup"},"Sign Up"))))}var W=Object(C.a)((function(e){return{root:{height:"100vh",backgroundColor:"#eaeff1",display:"flex",justifyContent:"center",alignItems:"center",flexWrap:"wrap","& > *":{margin:e.spacing(1),width:e.spacing(50),height:e.spacing(70)}},input:{margin:"20px 0","& > *":{margin:e.spacing(2.5),width:"25ch"}},top_section:{margin:"20px 0",display:"flex",flexDirection:"column",justifyContent:"space-between"}}}));function P(e){var a=W(),t=Object(n.useState)({username:"",password:"",name:""}),i=Object(j.a)(t,2),o=i[0],c=i[1],d=function(e){c(Object(s.a)({},o,Object(k.a)({},e.target.name,e.target.value)))};return r.a.createElement("div",{className:a.root},r.a.createElement(O.a,{elevation:3,className:a.paper},r.a.createElement("div",{className:a.top_section},r.a.createElement(N.a,{variant:"h4",align:"center"},"1M Ventilators"),r.a.createElement(N.a,{variant:"body2",align:"center",style:{color:"#808080",fontWeight:"600"}},"Sing Up for Ventilator Registry")),r.a.createElement(w.a,{variant:"middle"}),r.a.createElement("form",{className:a.input},r.a.createElement(h.a,{id:"filled-username",variant:"filled",name:"username",label:"Username",onChange:d,value:o.username}),r.a.createElement(h.a,{id:"filled-password",variant:"filled",name:"password",label:"Password",type:"password",onChange:d,value:o.password}),r.a.createElement(h.a,{id:"filled-name",variant:"filled",name:"name",label:"Name",onChange:d,value:o.name}),r.a.createElement(m.a,{variant:"contained",color:"primary",size:"large",onClick:function(){y().post("/auth/register",o).then((function(a){alert("You've registered successfully."),e.history.push("/")})).catch((function(e){alert("There's been a problem with your registration."),console.log(e)}))}},"Sign Up")),r.a.createElement(N.a,{variant:"body2",align:"center",style:{color:"#808080",fontWeight:"600"}},"Already have an account\xa0",r.a.createElement(l.b,{to:"/"},"Login"))))}var q=t(259),R=t(256),M=t(148),T=t(258),D=t(254),V=t(255),z=t(249),_=t(109),H=t.n(_),U=t(10),L=t(251),A=t(252),F=t(248),Q=t(250),Y=t(246),J=t(263),$=t(247),G=t(265);t(3);function K(e,a,t){return a[t]<e[t]?-1:a[t]>e[t]?1:0}var X=[{id:"name",numeric:!1,disablePadding:!0,label:"Hospital"},{id:"brand",numeric:!0,disablePadding:!1,label:"Brand"},{id:"model",numeric:!0,disablePadding:!1,label:"Model"},{id:"quantity",numeric:!0,disablePadding:!1,label:"Quantity"}];function Z(e){var a=e.classes,t=e.order,n=e.orderBy,i=e.onRequestSort;return r.a.createElement(Y.a,null,r.a.createElement($.a,null,X.map((function(e){return r.a.createElement(F.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:n===e.id&&t},r.a.createElement(G.a,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(o=e.id,function(e){i(e,o)})},e.label,n===e.id?r.a.createElement("span",{className:a.visuallyHidden},"desc"===t?"sorted descending":"sorted ascending"):null));var o}))))}Object(C.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(U.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}}));var ee=Object(C.a)((function(e){return{root:{width:"100%"},paper:{width:"100%",padding:"0 20px"},table:{minWidth:750},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function ae(e){var a=ee(),t=r.a.useState("asc"),n=Object(j.a)(t,2),i=n[0],o=n[1],l=r.a.useState("brand"),c=Object(j.a)(l,2),s=c[0],d=c[1],m=r.a.useState(0),u=Object(j.a)(m,2),g=u[0],p=u[1],h=r.a.useState(5),b=Object(j.a)(h,2),f=b[0],v=b[1];var E=e.vents.map((function(e){return a="".concat(e.name),t="".concat(e.brand),n="".concat(e.model),r="".concat(e.quantity),{name:a,brand:t,model:n,quantity:r};var a,t,n,r})),y=f-Math.min(f,E.length-g*f);return r.a.createElement("div",{className:a.root},r.a.createElement(O.a,{className:a.paper},r.a.createElement(Q.a,null,r.a.createElement(L.a,{className:a.table,"aria-labelledby":"tableTitle",size:"medium","aria-label":"enhanced table"},r.a.createElement(Z,{classes:a,order:i,orderBy:s,onRequestSort:function(e,a){o(s===a&&"asc"===i?"desc":"asc"),d(a)},rowCount:E.length}),r.a.createElement(A.a,null,function(e,a){var t=e.map((function(e,a){return[e,a]}));return t.sort((function(e,t){var n=a(e[0],t[0]);return 0!==n?n:e[1]-t[1]})),t.map((function(e){return e[0]}))}(E,function(e,a){return"desc"===e?function(e,t){return K(e,t,a)}:function(e,t){return-K(e,t,a)}}(i,s)).slice(g*f,g*f+f).map((function(e,a){var t="enhanced-table-checkbox-".concat(a);return r.a.createElement($.a,{hover:!0,tabIndex:-1,key:e.name},r.a.createElement(F.a,{component:"th",id:t,scope:"row",padding:"none"},e.name),r.a.createElement(F.a,{align:"right"},e.brand),r.a.createElement(F.a,{align:"right"},e.model),r.a.createElement(F.a,{align:"right"},e.quantity))})),y>0&&r.a.createElement($.a,{style:{height:53*y}},r.a.createElement(F.a,{colSpan:6}))))),r.a.createElement(J.a,{rowsPerPageOptions:[5,10,25],component:"div",count:E.length,rowsPerPage:f,page:g,onChangePage:function(e,a){p(a)},onChangeRowsPerPage:function(e){v(parseInt(e.target.value,10)),p(0)}})))}var te=Object(d.a)((function(e){return{paper:{maxWidth:1100,margin:"auto",overflow:"hidden"},searchBar:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},searchInput:{fontSize:e.typography.fontSize},block:{display:"block"},addUser:{marginRight:e.spacing(1)},contentWrapper:{margin:"40px 16px"}}}))((function(e){var a=e.classes,t=Object(n.useState)([]),i=Object(j.a)(t,2),o=i[0],l=i[1];return Object(n.useEffect)((function(){y().get("/vents").then((function(e){return l(e.data)})).catch((function(e){return console.log(e)}))})),r.a.createElement(O.a,{className:a.paper},r.a.createElement(D.a,{className:a.searchBar,position:"static",color:"default",elevation:0},r.a.createElement(z.a,null,r.a.createElement(V.a,{container:!0,spacing:2,alignItems:"center"},r.a.createElement(V.a,{item:!0},r.a.createElement(H.a,{className:a.block,color:"inherit"})),r.a.createElement(V.a,{item:!0,xs:!0},r.a.createElement(h.a,{fullWidth:!0,placeholder:"Search by brand or model",InputProps:{disableUnderline:!0,className:a.searchInput}}))))),0===o.length?r.a.createElement("div",{className:a.root},r.a.createElement("div",{style:{margin:"20px 0"}},"No Ventilators in Dashboard")):r.a.createElement(ae,{vents:o.vents}))})),ne=t(145),re=t.n(ne),ie=t(144),oe=t.n(ie);function le(e,a,t){return a[t]<e[t]?-1:a[t]>e[t]?1:0}var ce=[{id:"name",numeric:!1,disablePadding:!0,label:"Hospital"},{id:"brand",numeric:!0,disablePadding:!1,label:"Brand"},{id:"model",numeric:!0,disablePadding:!1,label:"Model"},{id:"quantity",numeric:!0,disablePadding:!1,label:"Quantity"},{id:"update",numeric:!0,disablePadding:!0,label:"Update"},{id:"delete",numeric:!0,disablePadding:!0,label:"Delete"}];function se(e){var a=e.classes,t=e.order,n=e.orderBy,i=e.onRequestSort;return r.a.createElement(Y.a,null,r.a.createElement($.a,null,ce.map((function(e){return r.a.createElement(F.a,{key:e.id,align:e.numeric?"right":"left",padding:e.disablePadding?"none":"default",sortDirection:n===e.id&&t},r.a.createElement(G.a,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(o=e.id,function(e){i(e,o)})},e.label,n===e.id?r.a.createElement("span",{className:a.visuallyHidden},"desc"===t?"sorted descending":"sorted ascending"):null));var o}))))}Object(C.a)((function(e){return{root:{paddingLeft:e.spacing(2),paddingRight:e.spacing(1)},highlight:"light"===e.palette.type?{color:e.palette.secondary.main,backgroundColor:Object(U.d)(e.palette.secondary.light,.85)}:{color:e.palette.text.primary,backgroundColor:e.palette.secondary.dark},title:{flex:"1 1 100%"}}}));var de=Object(C.a)((function(e){return{root:{width:"100%"},paper:{width:"100%",padding:"0 20px"},table:{minWidth:750},visuallyHidden:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",top:20,width:1}}}));function me(e){var a=de(),t=r.a.useState("asc"),n=Object(j.a)(t,2),i=n[0],o=n[1],l=r.a.useState("brand"),s=Object(j.a)(l,2),d=s[0],m=s[1],u=r.a.useState(0),g=Object(j.a)(u,2),p=g[0],h=g[1],b=r.a.useState(5),f=Object(j.a)(b,2),v=f[0],E=f[1],x=Object(c.g)();var S=e.vents.map((function(e){return a="".concat(e.name),t="".concat(e.brand),n="".concat(e.model),r="".concat(e.quantity),i="".concat(e.id),{name:a,brand:t,model:n,quantity:r,id:i};var a,t,n,r,i})),k=v-Math.min(v,S.length-p*v);return r.a.createElement("div",{className:a.root},r.a.createElement(O.a,{className:a.paper},r.a.createElement(Q.a,null,r.a.createElement(L.a,{className:a.table,"aria-labelledby":"tableTitle",size:"medium","aria-label":"enhanced table"},r.a.createElement(se,{classes:a,order:i,orderBy:d,onRequestSort:function(e,a){o(d===a&&"asc"===i?"desc":"asc"),m(a)},rowCount:S.length}),r.a.createElement(A.a,null,function(e,a){var t=e.map((function(e,a){return[e,a]}));return t.sort((function(e,t){var n=a(e[0],t[0]);return 0!==n?n:e[1]-t[1]})),t.map((function(e){return e[0]}))}(S,function(e,a){return"desc"===e?function(e,t){return le(e,t,a)}:function(e,t){return-le(e,t,a)}}(i,d)).slice(p*v,p*v+v).map((function(e,a){var t="enhanced-table-checkbox-".concat(a);return r.a.createElement($.a,{hover:!0,tabIndex:-1,key:e.name},r.a.createElement(F.a,{component:"th",id:t,scope:"row",padding:"none"},e.name),r.a.createElement(F.a,{align:"right"},e.brand),r.a.createElement(F.a,{align:"right"},e.model),r.a.createElement(F.a,{align:"right"},e.quantity),r.a.createElement(F.a,{align:"right",onClick:function(){return a=e.id,void x.push("/update/".concat(a));var a}},r.a.createElement(oe.a,null)),r.a.createElement(F.a,{align:"right",onClick:function(){return a=e.id,void y().delete("/vents/".concat(a)).then((function(e){console.log(e.data)})).catch((function(e){return console.log(e)}));var a}},r.a.createElement(re.a,null)))})),k>0&&r.a.createElement($.a,{style:{height:53*k}},r.a.createElement(F.a,{colSpan:6}))))),r.a.createElement(J.a,{rowsPerPageOptions:[5,10,25],component:"div",count:S.length,rowsPerPage:v,page:p,onChangePage:function(e,a){h(a)},onChangeRowsPerPage:function(e){E(parseInt(e.target.value,10)),h(0)}})))}var ue=Object(d.a)((function(e){return{paper:{maxWidth:1100,margin:"auto",overflow:"hidden"},searchBar:{borderBottom:"1px solid rgba(0, 0, 0, 0.12)"},searchInput:{fontSize:e.typography.fontSize},block:{display:"block"},addUser:{marginRight:e.spacing(1)},contentWrapper:{margin:"40px 16px"},load:{width:"100%","& > * + *":{marginTop:e.spacing(2)}}}}))((function(e){var a=e.classes,t=Object(c.g)(),i=Object(n.useState)([]),o=Object(j.a)(i,2),l=o[0],s=o[1],d=localStorage.getItem("id");return Object(n.useEffect)((function(){y().get("/users/".concat(d,"/vents")).then((function(e){s(e.data)})).catch((function(e){return console.log(e)}))})),r.a.createElement(O.a,{className:a.paper},r.a.createElement(D.a,{className:a.searchBar,position:"static",color:"default",elevation:0},r.a.createElement(z.a,null,r.a.createElement(V.a,{container:!0,spacing:2,alignItems:"center"},r.a.createElement(V.a,{item:!0},r.a.createElement(H.a,{className:a.block,color:"inherit"})),r.a.createElement(V.a,{item:!0,xs:!0},r.a.createElement(h.a,{fullWidth:!0,placeholder:"Search by brand or model",InputProps:{disableUnderline:!0,className:a.searchInput}})),r.a.createElement(V.a,{item:!0},r.a.createElement(m.a,{variant:"contained",color:"primary",className:a.addUser,onClick:function(){return t.push("/add_vent")}},"Add Ventilator"))))),0===l.length?r.a.createElement("div",{className:a.root},r.a.createElement("div",{style:{margin:"20px 0"}},"No Ventilators in Dashboard")):r.a.createElement(me,Object.assign({vents:l},e)))})),ge=t(267),pe=t(253),he=t(257),be=t(261),fe=t(268),ve=t(147),Ee=t.n(ve);var ye=Object(d.a)((function(e){return{secondaryBar:{zIndex:0},menuButton:{marginLeft:-e.spacing(1)},iconButtonAvatar:{padding:4},link:{textDecoration:"none",color:"rgba(255, 255, 255, 0.7)","&:hover":{color:e.palette.common.white}},button:{borderColor:"rgba(255, 255, 255, 0.7)"}}}))((function(e){var a=e.classes,t=Object(n.useState)(0),i=Object(j.a)(t,2),o=i[0],l=i[1],s=function(e){l(e)},d=Object(c.g)(),m=localStorage.getItem("name").charAt(0);return r.a.createElement(r.a.Fragment,null,r.a.createElement(D.a,{color:"primary",position:"sticky",elevation:0},r.a.createElement(z.a,null,r.a.createElement(V.a,{container:!0,spacing:1,alignItems:"center"},r.a.createElement(V.a,{item:!0,xs:!0}),r.a.createElement(V.a,{item:!0},r.a.createElement(R.a,{className:a.link,href:"https://1mventilators.com/",target:"-blank",variant:"body2"},"1mventilators.com")),r.a.createElement(V.a,{item:!0},r.a.createElement(pe.a,{color:"inherit",className:a.iconButtonAvatar,onClick:function(){s(1),e.dashboard()}},r.a.createElement(ge.a,{alt:"My Avatar"},m)))))),r.a.createElement(D.a,{component:"div",className:a.secondaryBar,color:"primary",position:"static",elevation:0},r.a.createElement(z.a,null,r.a.createElement(V.a,{container:!0,alignItems:"center",spacing:1},r.a.createElement(V.a,{item:!0,xs:!0},r.a.createElement(N.a,{color:"inherit",variant:"h5",component:"h1"},"Ventilator Registry")),r.a.createElement(V.a,{item:!0},r.a.createElement(fe.a,{title:"Logout"},r.a.createElement(pe.a,{color:"inherit"},r.a.createElement(Ee.a,{onClick:function(){localStorage.removeItem("token"),d.push("/")}}))))))),r.a.createElement(D.a,{component:"div",className:a.secondaryBar,color:"primary",position:"static",elevation:0},r.a.createElement(be.a,{value:o,textColor:"inherit"},r.a.createElement(he.a,{textColor:"inherit",label:"Registry",onClick:function(){s(0),e.registry()}}),r.a.createElement(he.a,{textColor:"inherit",label:"My Dashboard",onClick:function(){s(1),e.dashboard()}}))))}));function xe(){return r.a.createElement(N.a,{variant:"body2",color:"textSecondary",align:"center"},"Copyright \xa9 ",r.a.createElement(R.a,{color:"inherit",href:"https://material-ui.com/"},"1MVentilators")," ",(new Date).getFullYear(),".")}var Se=Object(M.a)({palette:{primary:{light:"#63ccff",main:"#009be5",dark:"#006db3"}},typography:{h5:{fontWeight:500,fontSize:26,letterSpacing:.5}},shape:{borderRadius:8},props:{MuiTab:{disableRipple:!0}},mixins:{toolbar:{minHeight:48}}});Se=Object(s.a)({},Se,{overrides:{MuiDrawer:{paper:{backgroundColor:"#18202c"}},MuiButton:{label:{textTransform:"none"},contained:{boxShadow:"none","&:active":{boxShadow:"none"}}},MuiTabs:{root:{marginLeft:Se.spacing(1)},indicator:{height:3,borderTopLeftRadius:3,borderTopRightRadius:3,backgroundColor:Se.palette.common.white}},MuiTab:{root:Object(k.a)({textTransform:"none",margin:"0 16px",minWidth:0,padding:0},Se.breakpoints.up("md"),{padding:0,minWidth:0})},MuiIconButton:{root:{padding:Se.spacing(1)}},MuiTooltip:{tooltip:{borderRadius:4}},MuiDivider:{root:{backgroundColor:"#404854"}},MuiListItemText:{primary:{fontWeight:Se.typography.fontWeightMedium}},MuiListItemIcon:{root:{color:"inherit",marginRight:0,"& svg":{fontSize:20}}},MuiAvatar:{root:{width:32,height:32}}}});var ke={root:{display:"flex",minHeight:"100vh"},drawer:Object(k.a)({},Se.breakpoints.up("sm"),{width:256,flexShrink:0}),app:{flex:1,display:"flex",flexDirection:"column"},main:{flex:1,padding:Se.spacing(6,4),background:"#eaeff1"},footer:{padding:Se.spacing(2),background:"#eaeff1"}};var je=Object(d.a)(ke)((function(e){var a=e.classes,t=Object(n.useState)(!1),i=Object(j.a)(t,2),o=i[0],l=i[1],c=Object(n.useState)(!0),s=Object(j.a)(c,2),d=s[0],m=s[1];return r.a.createElement(T.a,{theme:Se},r.a.createElement("div",{className:a.root},r.a.createElement(q.a,null),r.a.createElement("div",{className:a.app},r.a.createElement(ye,{dashboard:function(){!1===o&&(l(!0),m(!1))},registry:function(){!1===d&&(m(!0),l(!1))}}),r.a.createElement("main",{className:a.main},!1===o?r.a.createElement(te,null):r.a.createElement(ue,null)),r.a.createElement("footer",{className:a.footer},r.a.createElement(xe,null)))))})),we={name:"",brand:"",model:"",quantity:""};var Oe=Object(d.a)((function(){return{card:{maxWidth:420,marginTop:50},container:{backgroundColor:"#eaeff1",display:"flex",flexDirection:"column",alignItems:"center",minHeight:"100vh"},actions:{float:"right"},post_header:{backgroundColor:"#009be5",color:"#fff",width:"100vw",height:"144px"},heading:{display:"flex",justifyContent:"center",alignItems:"center",fontSize:"26px",fontWeight:"500",lineSpacing:"0.5px",height:"80%"},link:{display:"flex",marginLeft:"20px",fontSize:"14px",fontWeight:"600",fontFamily:"Roboto, sans-serif",cursor:"pointer"}}}))((function(e){var a=e.classes,t=Object(n.useState)(we),i=Object(j.a)(t,2),o=i[0],l=i[1],c=localStorage.getItem("id"),d=function(e){l(Object(s.a)({},o,Object(k.a)({},e.target.name,e.target.value)))};Object(n.useEffect)((function(){var a=e.match.params.id;y().get("/vents/".concat(a)).then((function(e){l(e.data.vents)})).catch((function(e){console.log(e)}))}),[e.match.params.id]);var b=function(){var a=e.match.params.id,t=localStorage.getItem("id");y().put("/vents/".concat(a),o).then((function(e){console.log(e)})).catch((function(e){console.log(e)})),e.history.push("/dashboard/".concat(t))};return r.a.createElement("div",{className:a.container},r.a.createElement("div",{className:a.post_header},r.a.createElement("div",{className:a.heading},"Add Your Ventilator Details"),r.a.createElement("div",{className:a.link,onClick:function(){return e.history.push("/dashboard/".concat(c))}},"My Dashboard")),r.a.createElement("form",{onSubmit:b},r.a.createElement(u.a,{className:a.card},r.a.createElement(p.a,null,r.a.createElement(h.a,{name:"name",label:"Hospital Name",value:o.name,onChange:d,margin:"dense",variant:"outlined",fullWidth:!0}),r.a.createElement(h.a,{name:"brand",label:"Ventilator Brand",value:o.brand,onChange:d,margin:"dense",variant:"outlined",fullWidth:!0}),r.a.createElement(h.a,{name:"model",label:"Ventilator Model",value:o.model,onChange:d,margin:"dense",variant:"outlined",fullWidth:!0}),r.a.createElement(h.a,{name:"quantity",label:"Ventilator Quantity on Hand",value:o.quantity,onChange:d,margin:"dense",variant:"outlined",fullWidth:!0})),r.a.createElement(g.a,{className:a.actions},r.a.createElement(m.a,{type:"submit",color:"primary",onClick:function(){return b}},"SUBMIT")))))})),Ce=t(2);function Ne(e){var a=e.component,t=Object(Ce.a)(e,["component"]);return r.a.createElement(c.b,Object.assign({},t,{render:function(e){return localStorage.getItem("token")?r.a.createElement(a,e):r.a.createElement(c.a,{to:"/"})}}))}var Ie=function(){return r.a.createElement(l.a,null,r.a.createElement("div",{className:"App"},r.a.createElement(c.d,null,r.a.createElement(c.b,{exact:!0,path:"/",component:B}),r.a.createElement(c.b,{path:"/signup",component:P}),r.a.createElement(Ne,{path:"/dashboard/:id",component:je}),r.a.createElement(Ne,{path:"/add_vent",component:S}),r.a.createElement(Ne,{path:"/post",render:function(e){return r.a.createElement(S,e)}}),r.a.createElement(Ne,{path:"/update/:id",component:Oe}))))};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));o.a.render(r.a.createElement(r.a.StrictMode,null,r.a.createElement(Ie,null)),document.getElementById("root")),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},[[173,1,2]]]);
  //# sourceMappingURL=main.08f3374e.chunk.js.map