(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[459],{76903:function(e,r,n){"use strict";n.r(r);var i=n(59499),o=n(50029),s=n(87794),t=n.n(s),a=n(30437),l=n(1396),c=n(52565),d=n(64598),u=n(7906),p=n(43894),h=n(82175),m=n(9008),x=n(11163),g=n(33299),f=n(67294),j=n(85893);function b(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?b(Object(n),!0).forEach((function(r){(0,i.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}r.default=function(){var e=function(){var e=(0,f.useState)(!1),r=e[0],n=e[1],i=(0,a.pm)(),s=(0,x.useRouter)(),l=(0,h.TA)({initialValues:{email:"",password:""},onSubmit:function(){var e=(0,o.Z)(t().mark((function e(r){var o;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,(0,g.signIn)("credentials",w(w({},r),{},{callbackUrl:"".concat(window.location.origin),redirect:!1}));case 3:o=e.sent,n(!1),o&&o.ok?(s.push("/"),i.closeAll()):i({status:"error",description:"Login failed. Please check your credentials and try again."});case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),validate:function(e){var r={};return e.email||(r.email="Required"),e.password||(r.password="Required"),r}});return w(w({},l),{},{isLoading:r})}(),r=e.errors,n=e.handleBlur,i=e.handleChange,s=e.handleSubmit,b=e.isLoading,y=e.touched,v=e.values;return(0,j.jsxs)("div",{children:[(0,j.jsxs)(m.default,{children:[(0,j.jsx)("title",{children:"FidesUI App"}),(0,j.jsx)("meta",{name:"description",content:"Generated from FidesUI template"}),(0,j.jsx)("link",{rel:"icon",href:"/favicon.ico"})]}),(0,j.jsx)("main",{children:(0,j.jsxs)(l.Kq,{spacing:16,mx:"auto",maxW:"lg",py:12,px:6,align:"center",minH:"100vh",justify:"center",children:[(0,j.jsx)(l.xu,{display:["none","none","block"],children:(0,j.jsx)("img",{src:"/logo.svg",alt:"FidesUI logo",width:"156px",height:"48px"})}),(0,j.jsxs)(l.Kq,{align:"center",spacing:[0,0,6],children:[(0,j.jsx)(l.X6,{fontSize:"4xl",colorScheme:"primary",display:["none","none","block"],children:"Sign into your account"}),(0,j.jsx)(l.xu,{bg:"white",py:12,px:[0,0,40],width:["100%","100%",640],borderRadius:4,position:["absolute","absolute","inherit"],top:0,bottom:0,left:0,right:0,boxShadow:"base",children:(0,j.jsxs)(l.Kq,{align:"center",justify:"center",spacing:8,children:[(0,j.jsxs)(l.Kq,{display:["block","block","none"],spacing:12,children:[(0,j.jsx)(l.kC,{justifyContent:"center",children:(0,j.jsx)("img",{src:"/logo.svg",alt:"FidesUI logo",width:"156px",height:"48px"})}),(0,j.jsx)(l.X6,{fontSize:"3xl",colorScheme:"primary",children:"Sign into your account"})]}),(0,j.jsx)(c.m$.form,{onSubmit:s,maxW:["xs","xs","100%"],width:"100%",children:(0,j.jsxs)(l.Kq,{spacing:6,children:[(0,j.jsxs)(d.NI,{id:"email",isInvalid:y.email&&Boolean(r.email),children:[(0,j.jsx)(d.lX,{htmlFor:"email",fontWeight:"medium",children:"Email address"}),(0,j.jsx)(u.II,{id:"email",name:"email",focusBorderColor:"primary.500",placeholder:"you@yourdomain.com",onChange:i,onBlur:n,value:v.email,isInvalid:y.email&&Boolean(r.email)}),(0,j.jsx)(d.J1,{children:r.email})]}),(0,j.jsxs)(d.NI,{id:"password",isInvalid:y.password&&Boolean(r.password),children:[(0,j.jsx)(d.lX,{htmlFor:"password",fontWeight:"medium",children:"Password"}),(0,j.jsx)(u.II,{focusBorderColor:"primary.500",type:"password",value:v.password,onChange:i,onBlur:n,isInvalid:y.password&&Boolean(r.password)}),(0,j.jsx)(d.J1,{children:r.password})]}),(0,j.jsx)(p.zx,{type:"submit",bg:"primary.800",_hover:{bg:"primary.400"},_active:{bg:"primary.500"},disabled:!v.email||!v.password,isLoading:b,colorScheme:"primary",children:"Sign in"})]})})]})})]})]})})]})}},87237:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/login",function(){return n(76903)}])},11163:function(e,r,n){e.exports=n(69898)}},function(e){e.O(0,[731,785,437,906,175,774,888,179],(function(){return r=87237,e(e.s=r);var r}));var r=e.O();_N_E=r}]);