(window.webpackJsonp=window.webpackJsonp||[]).push([[266],{1490:function(e,n,t){"use strict";t.r(n),t.d(n,"useOAuthViewModel",(function(){return u}));t(10),t(6);var r=t(73),c=t(20),o=t(44),a=t(199),i=t(239),__awaiter=function(e,n,t,r){return new(t||(t=Promise))((function(c,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r.throw(e))}catch(e){o(e)}}function step(e){e.done?c(e.value):function adopt(e){return e instanceof t?e:new t((function(n){n(e)}))}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,n||[])).next())}))},u=function useOAuthViewModel(){var e=Object(i.i)(),n=Object(r.h)(),t=Object(i.h)(),u=Object(c.useResolve)(a.a);Object(r.g)((function(){return __awaiter(void 0,void 0,void 0,regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s();case 2:case"end":return e.stop()}}),_callee)})))}));var s=function tryLogin(){return __awaiter(void 0,void 0,void 0,regeneratorRuntime.mark((function _callee2(){var r,c,a,i;return regeneratorRuntime.wrap((function _callee2$(s){for(;;)switch(s.prev=s.next){case 0:return r=n.value,c=r.params,a=r.query,i=c.provider,s.prev=2,s.next=5,u.login(i,a);case 5:s.next=10;break;case 7:s.prev=7,s.t0=s.catch(2),o.a.dispatch("notify",{message:e("argilla.api.errors::UnauthorizedError"),type:"error"});case 10:return s.prev=10,t.go("/"),s.finish(10);case 13:case"end":return s.stop()}}),_callee2,null,[[2,7,10,13]])})))}}}}]);