(this["webpackJsonpso-auth-validation"]=this["webpackJsonpso-auth-validation"]||[]).push([[0],{22:function(e){e.exports=JSON.parse('{"redirectUrls":[{"customer":{"id":"Cust37624","redirect_url":"https://soplayground.leadx360.com/integrations/configureCRM"}},{"customer":{"id":"Cust91698","redirect_url":"https://soplayground.leadx360.com/integrations/configureCRM"}},{"customer":{"id":"Cust92911","redirect_url":"https://test.leadx.no/integrations/configureCRM"}}]}')},31:function(e,t,c){},33:function(e,t,c){},39:function(e,t,c){"use strict";c.r(t);var n=c(0),r=c(12),i=c.n(r),o=(c(31),c(14)),s=c(2),a=c(20),u=c(22),l=c.p+"static/media/Loader.3ee1fc4c.png",d=c(3);function f(){var e=Object(n.useState)(null),t=Object(a.a)(e,2),c=(t[0],t[1],Object(n.useState)("validating")),r=Object(a.a)(c,2),i=r[0],o=r[1];Object(n.useEffect)((function(){setTimeout((function(){s()}),1e3)}),[]);var s=function(){try{var e=window.location.href.replace(/.*#/,"").split("&").map((function(e){return e.replace(/.*=/,"")}))[4],t=e.split(".").map((function(e){return e.replace(/.*:/,"")}))[1],c=window.location.href.replace(/^.*validate#/,"#");console.log(t,e);var n=function(e,t){var c=t.redirectUrls.find((function(t){return t.customer.id===e}));return console.log("customer url : ",c.customer.redirectUrl,e),c.customer.redirect_url}(JSON.parse(atob(t))["http://schemes.superoffice.net/identity/ctx"],u),r="".concat(n,"?").concat(c);o("success"),setTimeout((function(){window.location.href=r}),1e3)}catch(i){console.log(i),o("failure")}};return Object(d.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",flexDirection:"column"},children:[Object(d.jsx)("img",{src:l,style:{width:"50%"},alt:"Connecting"}),Object(d.jsx)("span",{children:function(e){switch(e){case"success":return"Connection with SuperOffice is successful ! ";case"failure":return"Sorry, failed to connect with SuperOffice";default:return"Validating connection with SuperOffice"}}(i)})]})}c(33);var h=function(){return Object(d.jsx)("div",{className:"App",style:{height:"100%"},children:Object(d.jsx)(o.a,{children:Object(d.jsx)(s.c,{children:Object(d.jsx)(s.a,{path:"/validate",children:Object(d.jsx)(f,{})})})})})},j=function(e){e&&e instanceof Function&&c.e(3).then(c.bind(null,41)).then((function(t){var c=t.getCLS,n=t.getFID,r=t.getFCP,i=t.getLCP,o=t.getTTFB;c(e),n(e),r(e),i(e),o(e)}))},p=c(26),O=c(8),b=c(25),g=c(11),m="SET_CustomerId",v="SET_RedirectURL",x={CustomerId:"",RedirectUrl:""},C={validate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:x,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case m:return Object(g.a)(Object(g.a)({},e),{},{CustomerId:t.payload.CustomerId});case v:return Object(g.a)(Object(g.a)({},e),{},{RedirectUrl:t.payload.RedirectUrl});default:return e}}},S=Object(O.c)(C),w=O.d,y=Object(O.e)((function(e,t){return"USER_LOGOUT_SUCCESS"===t.type&&(e=void 0),S(e,t)}),w(Object(O.a)(b.a)));i.a.render(Object(d.jsx)(p.a,{store:y,children:Object(d.jsx)(o.a,{children:Object(d.jsx)(h,{})})}),document.getElementById("root")),j()}},[[39,1,2]]]); //# sourceMappingURL=main.d8b3710b.chunk.js.map