text: (this.webpackJsonpfrontend=this.webpackJsonpfrontend||[]).push([[7],{162:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));a(64);function n(e){return e?e-(new Date).getTime():0}},192:function(e,t,a){"use strict";var n=a(1),r=a(2),i=a(25),o=a(0),c=(a(4),a(3)),s=a(5),l=a(6),d=a(152),p=a(150),u=a(123),m=a(15),f=a(122),b={enter:m.b.enteringScreen,exit:m.b.leavingScreen},h=o.forwardRef((function(e,t){var a=e.BackdropProps,i=e.children,s=e.classes,m=e.className,h=e.disableBackdropClick,v=void 0!==h&&h,x=e.disableEscapeKeyDown,g=void 0!==x&&x,k=e.fullScreen,y=void 0!==k&&k,j=e.fullWidth,O=void 0!==j&&j,E=e.maxWidth,w=void 0===E?"sm":E,S=e.onBackdropClick,D=e.onClose,C=e.onEnter,W=e.onEntered,B=e.onEntering,N=e.onEscapeKeyDown,T=e.onExit,P=e.onExited,M=e.onExiting,F=e.open,R=e.PaperComponent,$=void 0===R?f.a:R,I=e.PaperProps,A=void 0===I?{}:I,K=e.scroll,Y=void 0===K?"paper":K,z=e.TransitionComponent,X=void 0===z?u.a:z,H=e.transitionDuration,J=void 0===H?b:H,L=e.TransitionProps,q=e["aria-describedby"],G=e["aria-labelledby"],Q=Object(r.a)(e,["BackdropProps","children","classes","className","disableBackdropClick","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","onEnter","onEntered","onEntering","onEscapeKeyDown","onExit","onExited","onExiting","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps","aria-describedby","aria-labelledby"]),U=o.useRef();return o.createElement(d.a,Object(n.a)({className:Object(c.a)(s.root,m),BackdropComponent:p.a,BackdropProps:Object(n.a)({transitionDuration:J},a),closeAfterTransition:!0,disableBackdropClick:v,disableEscapeKeyDown:g,onEscapeKeyDown:N,onClose:D,open:F,ref:t},Q),o.createElement(X,Object(n.a)({appear:!0,in:F,timeout:J,onEnter:C,onEntering:B,onEntered:W,onExit:T,onExiting:M,onExited:P,role:"none presentation"},L),o.createElement("div",{className:Object(c.a)(s.container,s["scroll".concat(Object(l.a)(Y))]),onClick:function(e){e.target===e.currentTarget&&e.target===U.current&&(U.current=null,S&&S(e),!v&&D&&D(e,"backdropClick"))},onMouseDown:function(e){U.current=e.target}},o.createElement($,Object(n.a)({elevation:24,role:"dialog","aria-describedby":q,"aria-labelledby":G},A,{className:Object(c.a)(s.paper,s["paperScroll".concat(Object(l.a)(Y))],s["paperWidth".concat(Object(l.a)(String(w)))],A.className,y&&s.paperFullScreen,O&&s.paperFullWidth)}),i))))}));t.a=Object(s.a)((function(e){return{root:{"@media print":{position:"absolute !important"}},scrollPaper:{display:"flex",justifyContent:"center",alignItems:"center"},scrollBody:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&:after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}},container:{height:"100%","@media print":{height:"auto"},outline:0},paper:{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},paperScrollPaper:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},paperScrollBody:{display:"inline-block",verticalAlign:"middle",textAlign:"left"},paperWidthFalse:{maxWidth:"calc(100% - 64px)"},paperWidthXs:{maxWidth:Math.max(e.breakpoints.values.xs,444),"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64),{maxWidth:"calc(100% - 64px)"})},paperWidthSm:{maxWidth:e.breakpoints.values.sm,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.sm+64),{maxWidth:"calc(100% - 64px)"})},paperWidthMd:{maxWidth:e.breakpoints.values.md,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.md+64),{maxWidth:"calc(100% - 64px)"})},paperWidthLg:{maxWidth:e.breakpoints.values.lg,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.lg+64),{maxWidth:"calc(100% - 64px)"})},paperWidthXl:{maxWidth:e.breakpoints.values.xl,"&$paperScrollBody":Object(i.a)({},e.breakpoints.down(e.breakpoints.values.xl+64),{maxWidth:"calc(100% - 64px)"})},paperFullWidth:{width:"calc(100% - 64px)"},paperFullScreen:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,"&$paperScrollBody":{margin:0,maxWidth:"100%"}}}}),{name:"MuiDialog"})(h)},193:function(e,t,a){"use strict";var n=a(1),r=a(2),i=a(0),o=(a(4),a(3)),c=a(5),s=a(46),l=i.forwardRef((function(e,t){var a=e.children,c=e.classes,l=e.className,d=e.disableTypography,p=void 0!==d&&d,u=Object(r.a)(e,["children","classes","className","disableTypography"]);return i.createElement("div",Object(n.a)({className:Object(o.a)(c.root,l),ref:t},u),p?a:i.createElement(s.a,{component:"h2",variant:"h6"},a))}));t.a=Object(c.a)({root:{margin:0,padding:"16px 24px",flex:"0 0 auto"}},{name:"MuiDialogTitle"})(l)},194:function(e,t,a){"use strict";var n=a(1),r=a(2),i=a(0),o=(a(4),a(3)),c=a(5),s=i.forwardRef((function(e,t){var a=e.classes,c=e.className,s=e.dividers,l=void 0!==s&&s,d=Object(r.a)(e,["classes","className","dividers"]);return i.createElement("div",Object(n.a)({className:Object(o.a)(a.root,c,l&&a.dividers),ref:t},d))}));t.a=Object(c.a)((function(e){return{root:{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"8px 24px","&:first-child":{paddingTop:20}},dividers:{padding:"16px 24px",borderTop:"1px solid ".concat(e.palette.divider),borderBottom:"1px solid ".concat(e.palette.divider)}}}),{name:"MuiDialogContent"})(s)},195:function(e,t,a){"use strict";var n=a(1),r=a(0),i=(a(4),a(5)),o=a(46),c=r.forwardRef((function(e,t){return r.createElement(o.a,Object(n.a)({component:"p",variant:"body1",color:"textSecondary",ref:t},e))}));t.a=Object(i.a)({root:{marginBottom:12}},{name:"MuiDialogContentText"})(c)},196:function(e,t,a){"use strict";var n=a(1),r=a(2),i=a(0),o=(a(4),a(3)),c=a(5),s=a(6);function l(e){var t,a,n;return t=e,a=0,n=1,e=(Math.min(Math.max(a,t),n)-a)/(n-a),e=(e-=1)*e*e+1}var d=i.forwardRef((function(e,t){var a,c=e.classes,d=e.className,p=e.color,u=void 0===p?"primary":p,m=e.disableShrink,f=void 0!==m&&m,b=e.size,h=void 0===b?40:b,v=e.style,x=e.thickness,g=void 0===x?3.6:x,k=e.value,y=void 0===k?0:k,j=e.variant,O=void 0===j?"indeterminate":j,E=Object(r.a)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),w={},S={},D={};if("determinate"===O||"static"===O){var C=2*Math.PI*((44-g)/2);w.strokeDasharray=C.toFixed(3),D["aria-valuenow"]=Math.round(y),"static"===O?(w.strokeDashoffset="".concat(((100-y)/100*C).toFixed(3),"px"),S.transform="rotate(-90deg)"):(w.strokeDashoffset="".concat((a=(100-y)/100,a*a*C).toFixed(3),"px"),S.transform="rotate(".concat((270*l(y/70)).toFixed(3),"deg)"))}return i.createElement("div",Object(n.a)({className:Object(o.a)(c.root,d,"inherit"!==u&&c["color".concat(Object(s.a)(u))],{indeterminate:c.indeterminate,static:c.static}[O]),style:Object(n.a)({width:h,height:h},S,{},v),ref:t,role:"progressbar"},D,E),i.createElement("svg",{className:c.svg,viewBox:"".concat(22," ").concat(22," ").concat(44," ").concat(44)},i.createElement("circle",{className:Object(o.a)(c.circle,f&&c.circleDisableShrink,{indeterminate:c.circleIndeterminate,static:c.circleStatic}[O]),style:w,cx:44,cy:44,r:(44-g)/2,fill:"none",strokeWidth:g})))}));t.a=Object(c.a)((function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},"@keyframes circular-rotate":{"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}}),{name:"MuiCircularProgress",flip:!1})(d)},197:function(e,t,a){"use strict";var n=a(1),r=a(2),i=a(0),o=(a(4),a(3)),c=a(5),s=i.forwardRef((function(e,t){var a=e.disableSpacing,c=void 0!==a&&a,s=e.classes,l=e.className,d=Object(r.a)(e,["disableSpacing","classes","className"]);return i.createElement("div",Object(n.a)({className:Object(o.a)(s.root,l,!c&&s.spacing),ref:t},d))}));t.a=Object(c.a)({root:{display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},spacing:{"& > :not(:first-child)":{marginLeft:8}}},{name:"MuiDialogActions"})(s)},215:function(e,t,a){"use strict";a.r(t),a.d(t,"default",(function(){return O}));var n=a(16),r=a.n(n),i=a(13),o=a(28),c=a(9),s=a(0),l=a.n(s),d=a(192),p=a(193),u=a(194),m=a(195),f=a(92),b=a(196),h=a(197),v=a(148),x=a(18),g=a(63),k=a(19),y=a(49),j=a(162);function O(e){var t=Object(s.useContext)(k.b).contextState,a=Object(y.d)(),n=a.refreshErrors,O=a.refreshToken,E=Object(s.useState)(0),w=Object(c.a)(E,2),S=w[0],D=w[1],C=Object(s.useState)((function(){return{show:"hidden",remaining:Object(j.a)(t.expiration)}})),W=Object(c.a)(C,2),B=W[0],N=W[1],T=Object(y.c)().logOut,P=Object(s.useRef)({dialog:0,signout:0});function M(){return(M=Object(o.a)(r.a.mark((function e(){return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:O(!0),N((function(e){return Object(i.a)({},e,{show:"hidden"})}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function F(){clearTimeout(P.current.dialog),clearTimeout(P.current.signout)}return Object(s.useEffect)((function(){if(t.token.length>3){var e=Object(j.a)(t.expiration);return P.current.dialog=window.setTimeout((function(){N({show:"dialog",remaining:e-25e3})}),e-25e3),P.current.signout=window.setTimeout((function(){N({show:"hidden",remaining:0}),T(!0)}),e),function(){F()}}}),[t.expiration,t.token,T]),Object(s.useEffect)((function(){if("dialog"===B.show){var e=setInterval((function(){D((function(e){return e>=100?0:e+1}))}),200);return function(){clearInterval(e)}}}),[B.show]),l.a.createElement(l.a.Fragment,null,l.a.createElement(d.a,{open:"dialog"===B.show,onClose:function(){return N((function(e){return Object(i.a)({},e,{show:"hidden"})}))},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description"},l.a.createElement(p.a,{id:"alert-dialog-title"},"Your sessiong is about to exipire"),l.a.createElement(u.a,null,l.a.createElement(m.a,{id:"alert-dialog-description"},"Tap on 'Continue' to keep your session opened"),l.a.createElement(f.a,{justifyContent:"center",m:3},l.a.createElement(b.a,{variant:"static",value:S,size:"5rem"}))),l.a.createElement(h.a,null,l.a.createElement(v.a,{onClick:function(){F(),T(!0)},color:"secondary",variant:"contained"},"Cancel"),l.a.createElement(v.a,{onClick:function(){return M.apply(this,arguments)},variant:"contained",color:"primary",autoFocus:!0},"Continue"))),l.a.createElement(g.a,{severity:"error",isOpen:Object(x.c)(n),closeFn:function(){return N((function(e){return Object(i.a)({},e,{show:"hidden"})}))},title:"Error while trying to keep session opened. Please try to log in again",body:n||"Server error"}))}}}]);
  //# sourceMappingURL=7.0f92cb41.chunk.js.map