'use strict';
import { authTypes } from '../../meta/auth/login.js';
import { apiPost } from '../../../fd-toolbox/api/api-client.js';
import { getLoginResult } from '../../meta/auth/auth-handler.js';
import { routes } from '../../../fd-toolbox/routing/routes.js';
import { navigate } from '../../../fd-toolbox/redirect/redirect-functions.js';

var __defProp=Object['defineProperty'],__name=(_0x3963df,_0x2120ba)=>__defProp(_0x3963df,'name',{'value':_0x2120ba,'configurable':!![]});async function registerByOAuth(_0x2604c4,_0x4852f7,_0x3a0a4a,_0x4bbc0e,_0x4d8404){return register({'oauthKey':_0x2604c4,'oauthProvider':_0x4852f7,'authType':authTypes['oauth'],'email':_0x3a0a4a,'firstName':_0x4bbc0e,'lastName':_0x4d8404});}__name(registerByOAuth,'registerByOAuth');async function register(_0x24fe11){const _0x2755c8=await apiPost(routes['register'],_0x24fe11);return onRegisterFormRegisterResult(_0x2755c8,_0x24fe11['authType']);}__name(register,'register');function onRegisterFormRegisterResult(_0x2e2b5f,_0x2d3715){const _0x772abc=getLoginResult(_0x2e2b5f);return _0x772abc['isSuccess']&&_0x2d3715===authTypes['default']&&navigate(routes['login']),_0x772abc;}__name(onRegisterFormRegisterResult,'onRegisterFormRegisterResult');

export { register, registerByOAuth };
