"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[6914],{76914:function(e,t,a){a.r(t);var r=a(29439),o=a(72791),i=a(16871),n=a(81207),s=a(25787),c=a(11135),l=a(62666),d=a(10703),p=a(61889),g=a(20890),m=a(36151),h=a(15146),u=a(80184);t.default=(0,s.Z)((function(e){return(0,c.Z)({paper:{borderRadius:8,display:"flex",flexDirection:"column",alignItems:"center",width:800,height:424,margin:"auto",position:"absolute",top:"50%",left:"50%",marginLeft:-400,marginTop:-212,"&.MuiPaper-root":{borderRadius:8}},submit:{margin:"30px 0px 16px",height:40,boxShadow:"none",padding:"16px 30px"},mainContainer:{position:"relative",height:424},theOcean:{borderTopLeftRadius:8,borderBottomLeftRadius:8,background:"transparent linear-gradient(to bottom, #073052 0%,#05122b 100%); 0% 0% no-repeat padding-box;"},oceanBg:{backgroundImage:"url(/images/BG_Illustration.svg)",backgroundRepeat:"no-repeat",backgroundPosition:"bottom left",height:"100%",width:324},theLogin:{padding:"40px 45px 20px 45px"},extraDetailsContainer:{fontStyle:"italic",color:"#9C9C9C",transition:"all .2s ease-in-out",padding:"0 5px",marginTop:5,overflow:"auto"},errorLabel:{color:"#000",fontSize:18,fontWeight:500,marginLeft:5},simpleError:{marginTop:5,padding:"2px 5px",fontSize:16,color:"#000"},messageIcon:{color:"#C72C48",display:"flex","& svg":{width:32,height:32}},errorTitle:{display:"flex",alignItems:"center"}})}))((function(e){var t=e.classes,a=(0,i.s0)(),s=(0,o.useState)(""),c=(0,r.Z)(s,2),x=c[0],f=c[1],b=(0,o.useState)(""),v=(0,r.Z)(b,2),Z=v[0],j=v[1],S=(0,o.useState)(!0),C=(0,r.Z)(S,2),I=C[0],N=C[1];return(0,o.useEffect)((function(){if(I){var e=window.location.search,t=new URLSearchParams(e),r=t.get("code"),o=t.get("state"),i=t.get("error"),s=t.get("errorDescription");i||s?(f(i||""),j(s||""),N(!1)):n.Z.invoke("POST","/api/v1/login/oauth2/auth",{code:r,state:o}).then((function(){var e="/";localStorage.getItem("redirect-path")&&""!==localStorage.getItem("redirect-path")&&(e="".concat(localStorage.getItem("redirect-path")),localStorage.setItem("redirect-path","")),N(!1),a(e)})).catch((function(e){f(e.errorMessage),j(e.detailedError),N(!1)}))}}),[I,a]),""!==x||""!==Z?(0,u.jsx)(o.Fragment,{children:(0,u.jsx)(d.Z,{className:t.paper,children:(0,u.jsxs)(p.ZP,{container:!0,className:t.mainContainer,children:[(0,u.jsx)(p.ZP,{item:!0,xs:7,className:t.theOcean,children:(0,u.jsx)("div",{className:t.oceanBg})}),(0,u.jsxs)(p.ZP,{item:!0,xs:5,className:t.theLogin,children:[(0,u.jsxs)("div",{className:t.errorTitle,children:[(0,u.jsx)("span",{className:t.messageIcon,children:(0,u.jsx)(h.Z,{})}),(0,u.jsx)("span",{className:t.errorLabel,children:"Error from IDP"})]}),(0,u.jsx)("div",{className:t.simpleError,children:x}),(0,u.jsx)(g.Z,{variant:"body1",gutterBottom:!0,component:"div",className:t.extraDetailsContainer,children:Z}),(0,u.jsx)(m.Z,{component:"a",href:"".concat(l.F,"login"),type:"submit",variant:"contained",color:"primary",className:t.submit,children:"Back to Login"})]})]})})}):null}))},15146:function(e,t,a){var r=a(95318);t.Z=void 0;var o=r(a(45649)),i=a(80184),n=(0,o.default)((0,i.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline");t.Z=n}}]);
//# sourceMappingURL=6914.ed2f1662.chunk.js.map