1"use strict";(self.webpackChunkconsumer_web=self.webpackChunkconsumer_web||[]).push([[121],{36121:function(e,t,n){n.r(t);var r=n(21076),o=n(72791),i=n(57689),a=n(50108),c=n(97695),s=n(80184);t.default=function(e){var t=(0,c.M6)(),n=t.authentication,u=t.setToken,l=(0,i.s0)(),f=n.isAuthenticated,d=(0,o.useCallback)((function(){(0,c.YC)(e).then((function(e){var t=e.status,n=e.res;t&&u(n.accessToken)}))}),[]);if((0,o.useEffect)((function(){d()}),[]),f){var h=new URLSearchParams(window.location.search).get("state");l(h.match(/[/]/g)?h:"/home")}return(0,s.jsx)("div",{className:"clipLoaderDiv",children:(0,s.jsx)(r.Z,{in:!0,style:{transitionDelay:"800ms",backgroundColor:"white"},unmountOnExit:!0,children:(0,s.jsx)(a.Z,{backColor:"white"})})})}},97695:function(e,t,n){n.d(t,{M6:function(){return q},YC:function(){return P},Z6:function(){return O}});var r,o=n(15671),i=n(43144),a=n(11752),c=n(61120),s=n(60136),u=n(27277),l=n(51651),f=n(83694),d=n.n(f),h=n(72426),v=n.n(h),w=n(60364),p=n(76711),k=n(53585),m=l.AuthorizationServiceConfiguration,_=l.AuthorizationRequest,T=l.RedirectRequestHandler,g=l.FetchRequestor,I=l.LocalStorageBackend,S=l.DefaultCrypto,R=l.AuthorizationNotifier,A=l.BaseTokenRequestHandler,y=l.GRANT_TYPE_AUTHORIZATION_CODE,C=(l.GRANT_TYPE_REFRESH_TOKEN,l.TokenRequest),Z=function(e){(0,s.Z)(n,e);var t=(0,u.Z)(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,i.Z)(n,[{key:"parse",value:function(e,t){return(0,a.Z)((0,c.Z)(n.prototype),"parse",this).call(this,e,!1)}}]),n}(l.BasicQueryStringUtils),b=null!==(r=null===d()||void 0===d()?void 0:d().SSO)&&void 0!==r?r:{},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new Promise((function(n){var r=window.location,o=new T(new I,new Z,r,new S);m.fetchFromIssuer(b.OPServer,new g).then((function(i){try{var a=new _({client_id:b.clientInfo[e].clientId,redirect_uri:"".concat(r.origin).concat(b.redirect_uri),scope:b.scope,response_type:"code",state:null!==t&&void 0!==t?t:void 0,extras:{prompt:"login",access_type:"offline"}});o.performAuthorizationRequest(i,a),n({status:!0})}catch(c){n({status:!1,err:c})}})).catch((function(e){n({status:!1,err:e})}))}))},P=function(e){return new Promise((function(t){var n=new A(new g),r=new T(new I,new Z,window.location,new S),o=new R;r.setAuthorizationNotifier(o),o.setAuthorizationListener((function(e,r,o){if(r){var i=null;e&&e.internal&&((i={}).code_verifier=e.internal.code_verifier);var a=new C({client_id:e.clientId,redirect_uri:e.redirectUri,grant_type:y,code:r.code,refresh_token:void 0,extras:i});m.fetchFromIssuer(b.OPServer,new g).then((function(e){var t=e;return n.performTokenRequest(t,a)})).then((function(n){localStorage.setItem("ssoClientId",e.clientId),x(n),t({status:!0,res:n})})).catch((function(e){t({status:!1,err:e})}))}})),new URLSearchParams(e.location.search).get("code")||t({status:!1,err:"Unable to get authorization code"}),r.completeAuthorizationRequestIfPossible()}))},q=function(){var e=(0,w.I0)();return{authentication:(0,w.v9)((function(e){return e.auth})),setToken:function(t){return e((0,p.NT)({token:t}))}}},x=function(e){var t=v()().add(e.expiresIn-k.H7,"seconds");localStorage.setItem("expiresIn",t.toString()),localStorage.setItem("refreshToken",e.refreshToken),localStorage.setItem("SSOToken",e.accessToken)}}}]); 2//# sourceMappingURL=121.e9669eb3.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.