@steedos/webapp 2.1.52 → 2.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["selectors/index.js","selectors/entities/users.ts","utils/hash_history.jsx","types/actions.ts","utils/key_mirror.ts","action_types/users.ts","action_types/spaces.ts","action_types/general.ts","action_types/errors.ts","client/fetch_etag.js","utils/helpers.ts","reducers/entities/users.ts","reducers/entities/spaces.ts","reducers/entities/general.ts","reducers/entities/index.ts","reducers/i18n.js","reducers/settings.js","reducers/requests.js","reducers/index.ts","stores/initial_state.js","stores/redux_store.js","i18n/i18n.js","selectors/i18n.js","utils/utils.jsx","client/client4.ts","utils/sentry.js","client/index.ts","actions/errors.ts","actions/helpers.ts","stores/local_storage_store.ts","selectors/entities/spaces.ts","actions/spaces.ts","selectors/settings.ts","actions/users.ts","actions/global_actions.jsx","actions/root.js","actions/settings.ts","components/Loading.tsx","components/LoggedIn.jsx","components/FormError.tsx","components/Card.tsx","components/Logo.tsx","components/Background.tsx","components/InputPassword.tsx","components/LocalizedInput.tsx","components/countdown.tsx","pages/Signup.jsx","pages/Login.jsx","pages/Logout.jsx","components/Navbar.tsx","pages/Home.jsx","pages/updatePassword.jsx","pages/CreateTenant.jsx","pages/SelectSpace.jsx","pages/Preference.tsx","pages/VerifyEmail.jsx","pages/VerifyMobile.jsx","root.jsx","actions/i18n.js","components/intl_provider/intl_provider.js","components/intl_provider/index.js","index.tsx"],"names":["getSettings","state","settings","getTenant","tenant","Object","assign","name","getRequests","requests","getSettingsTenantId","_id","getCurrentUser","entities","users","getCurrentUserId","currentUserId","hashHistory","window","createHashHistory","BATCH","batchActions","actions","type","meta","batch","payload","keyMirror","obj","Array","isArray","Error","ret","key","hasOwnProperty","CREATE_USER_REQUEST","CREATE_USER_SUCCESS","CREATE_USER_FAILURE","LOGIN_REQUEST","LOGIN_SUCCESS","LOGIN_FAILURE","LOGOUT_REQUEST","LOGOUT_SUCCESS","LOGOUT_FAILURE","REVOKE_ALL_USER_SESSIONS_SUCCESS","REVOKE_SESSIONS_FOR_ALL_USERS_SUCCESS","UPDATE_ME_REQUEST","UPDATE_ME_SUCCESS","UPDATE_ME_FAILURE","RECEIVED_ME","RECEIVED_PROFILE","RECEIVED_PROFILES","RECEIVED_PROFILES_LIST","RECEIVED_PROFILE_IN_TEAM","RECEIVED_PROFILE_NOT_IN_TEAM","RECEIVED_PROFILE_WITHOUT_TEAM","RECEIVED_SESSIONS","RECEIVED_REVOKED_SESSION","RESET_LOGOUT_STATE","RECEIVED_MY_USER_ACCESS_TOKEN","RECEIVED_MY_USER_ACCESS_TOKENS","CLEAR_MY_USER_ACCESS_TOKENS","REVOKED_USER_ACCESS_TOKEN","DISABLED_USER_ACCESS_TOKEN","ENABLED_USER_ACCESS_TOKEN","LOGIN","VERIFICATION_TOKEN_RECIEVED","CHANGEPASSWORD_REQUEST","CHANGEPASSWORD_FAILURE","CHANGEPASSWORD_RECEIVED","VERIFYEMAIL_REQUEST","VERIFYEMAIL_FAILURE","VERIFYEMAIL_RECEIVED","VERIFYMOBILE_REQUEST","VERIFYMOBILE_FAILURE","VERIFYMOBILE_RECEIVED","TO_MOBILE_CODE_LOGIN","GET_SPACES_REQUEST","GET_SPACES_SUCCESS","GET_SPACES_FAILURE","MY_SPACES_REQUEST","MY_SPACES_SUCCESS","MY_SPACES_FAILURE","CREATE_SPACE_REQUEST","CREATE_SPACE_SUCCESS","CREATE_SPACE_FAILURE","JOIN_SPACE_REQUEST","JOIN_SPACE_SUCCESS","JOIN_SPACE_FAILURE","CREATED_SPACE","SELECT_SPACE","UPDATED_SPACE","RECEIVED_SPACE","RECEIVED_SPACES_LIST","DISMISS_ERROR","LOG_ERROR","CLEAR_ERRORS","RESTORE_ERRORS","RECEIVED_SETTINGS","RECEIVED_APP_STATE","RECEIVED_APP_CREDENTIALS","REMOVED_APP_CREDENTIALS","RECEIVED_APP_DEVICE_TOKEN","PING_RESET","RECEIVED_SERVER_VERSION","CLIENT_CONFIG_RECEIVED","CLIENT_CONFIG_RESET","CLIENT_LICENSE_RECEIVED","CLIENT_LICENSE_RESET","RECEIVED_DATA_RETENTION_POLICY","LOG_CLIENT_ERROR_REQUEST","LOG_CLIENT_ERROR_SUCCESS","LOG_CLIENT_ERROR_FAILURE","SUPPORTED_TIMEZONES_REQUEST","SUPPORTED_TIMEZONES_SUCCESS","SUPPORTED_TIMEZONES_FAILURE","SUPPORTED_TIMEZONES_RECEIVED","WEBSOCKET_REQUEST","WEBSOCKET_SUCCESS","WEBSOCKET_FAILURE","WEBSOCKET_CLOSED","REDIRECT_LOCATION_SUCCESS","REDIRECT_LOCATION_FAILURE","SET_CONFIG_AND_LICENSE","WARN_METRICS_STATUS_RECEIVED","WARN_METRIC_STATUS_RECEIVED","WARN_METRIC_STATUS_REMOVED","data","etags","url","options","headers","method","etag","cachedResponse","fetch","then","response","status","clone","responseEtag","get","Reflect","apply","undefined","buildQueryString","parameters","keys","length","query","i","encodeURIComponent","combineReducers","action","UserTypes","user","nextState","userId","password_expired","email_verified","mobile_verified","currentSpaceId","SpaceTypes","spaces","listToMap","appState","GeneralTypes","credentials","deviceToken","serverVersion","general","translations","en","locale","i18n","require","services","store","createStore","rootReducer","initialState","applyMiddleware","thunkMiddleware","languages","value","order","getAllLanguages","getLanguageInfo","getCurrentLocale","DefaultClientLocale","getBrowserLng","getTranslations","I18n","navigator","userLanguage","language","indexOf","getBrowserLocale","localizeMessage","id","defaultMessage","getState","recordsList","recordsMap","Client4","LOGIN_TOKEN_KEY","LOGIN_TOKEN_EXPIRES_KEY","USER_ID_KEY","logToConsole","_lastLoginTokenWhenPolled","loginExpirationInDays","clusterId","token","csrf","urlVersion","userAgent","enableLogging","defaultHeaders","diagnosticId","includeCookies","isRudderKeySet","connectionError","unknownError","userRoles","doFetch","logClientError","message","login","password","deviceId","trackEvent","body","device_id","getAccountsRoute","JSON","stringify","createUser","inviteId","redirect","queryParams","t","iid","r","createSpace","getBaseRoute","sendVerificationToken","getMe","getMySpaces","logout","a","doFetchWithResponse","ok","getOptions","parseAndMergeNestedHeaders","json","ClientError","getUrl","intl","has","msg","console","error","server_error_id","status_code","changePassword","oldPassword","newPassword","verifyEmail","email","code","verifyMobile","mobile","foo","URL","location","href","pathname","split","this","ROOT_URL_PATH_PREFIX","baseUrl","startsWith","csrfToken","enable","include","roles","document","cookie","cookies","trim","replace","newOptions","getCSRFFromCookie","toLowerCase","category","event","props","user_actual_id","originalHeaders","Map","nestedHeaders","forEach","val","capitalizedKey","l","toUpperCase","realVal","match","nestedHeaderStrings","shift","moreNestedHeaders","map","h","set","apiUrl","index","substring","whitelist","part","join","cleanUrlForLogging","defineProperty","enumerable","ClientClass4","logError","dispatch","forceLogoutIfNecessary","err","setToken","dispatcher","requestSuccess","requestData","bindClientFunc","clientFunc","onRequest","onSuccess","onFailure","params","push","s","getPreviousSpaceIdKey","getPathScopedKey","path","LocalStorageStore","basePath","localStorage","getItem","setItem","removeItem","spaceId","wasLoggedIn","getSpaces","values","getSpaceCount","getCurrentSpace","getCurrentSpaceId","getSpace","selectSpace","selectedSpaceId","getPreviousSpaceId","setPreviousSpaceId","space","promises","Promise","all","goSpaceHome","authToken","log","rootUrl","root_url","searchParams","URLSearchParams","search","redirect_uri","origin","u","append","toString","created","completeLogin","loginId","mfaToken","_next","setUserId","ReactNativeWebView","postMessage","tokens","accessToken","getChangePasswordFunc","getVerifyEmailFunc","getVerifyMobileFunc","emitUserLoggedOutEvent","redirectToPath","redirectTo","catch","e","selectDefaultSpace","redirectUserToVerifyMobile","finishSignin","currentUser","redirectUserToUpdatePassword","enable_bind_mobile","enable_bind_email","redirectUserToVerifyEmail","loadMeAndConfig","setEnableLogging","EnableDeveloper","setDiagnosticId","DiagnosticId","resolvedPromises","getWasLoggedIn","getMeFunc","me","useStyles","makeStyles","theme","createStyles","backdrop","zIndex","drawer","color","backgroundColor","connect","classes","React","useState","open","setOpen","useEffect","Backdrop","className","CircularProgress","LoggedIn","context","GlobalActions","isValidState","children","PureComponent","variantIcon","success","CheckCircleOutline","warning","WarningOutlined","ErrorOutline","info","InfoOutlined","useStyles1","getColor","palette","darken","lighten","getBackgroundColor","green","main","primary","amber","icon","fontSize","iconVariant","opacity","marginRight","spacing","display","alignItems","MySnackbarContentWrapper","variant","onClose","other","Icon","SnackbarContent","elevation","clsx","aria-describedby","mobile_help","chunks","target","email_help","useStyles2","margin","marginBottom","FormError","formError","_variant","Card","openPrivacyPage","AppBrowserOpen","onClick","logoUrl","logo_url","src","backgroundUrl","background_url","background_color","style","innerWidth","backgroundImage","InputPassword","forwardRef","ref","selfInputRef","useRef","inputRef","clearPasswordValueAttribute","setTimeout","input","current","getAttribute","hasAttribute","removeAttribute","timer","clearTimeout","onFocus","onBlur","displayName","LocalizedInput","placeholder","otherProps","localizedPlaceholder","useCountDown","timerKey","useMemo","getter","setter","total","lifecycle","saveKey","getSaveData","Date","now","sessionStorage","addData","getData","resetCountDown","useCallback","getRestTime","expiredTime","isNaN","restTime","Math","floor","setRestTime","setInterval","newRestTime","clearInterval","ReApplyCodeBtn","resetCountdown","textColor","disabled","Signup","createLoginPlaceholder","inputLabel","loginBy","Utils","handleEmailChange","setState","handleNameChange","switchLoginByMobile","switchLoginByEmail","tabColor","tab","handleMobileChange","handlePasswordChange","handleCodeChange","verifyCode","goLogin","history","serverError","loading","onSubmit","preventDefault","invite_token","GlobalAction","loginSuccess","goSignup","settingsTenantId","sessionExpired","loginByEmail","loginByMobile","loginWithCode","loginWithPassword","enable_mobile_code_login","enable_email_code_login","enable_password_login","emailInput","createRef","mobileInput","passwordInput","browserHistory","title","autoCapitalize","onChange","autocomplete","Component","bindActionCreators","withRouter","Login","handleLoginIdChange","MFA","username","RegExp","test","switchLoginWithCode","loginWith","switchLoginWithPassword","args","team","loginIdInput","enable_register","Logout","menuOpen","setMenuOpen","onLogout","aria-label","xmlns","fill","viewBox","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d","aria-haspopup","fillRule","clipRule","show","role","aria-orientation","aria-labelledby","Home","goHome","previousSpaceId","paramSpaceId","result","currentSpace","UpdatePassword","handleOldPasswordChange","handleNewPasswordChange","handleConfirmPasswordChange","confirmPassword","CreateTenant","class","SelectSpace","handleCreateTenant","handleSpaceClick","loadingSpaceId","spaceContent","spaceCount","mySpaces","setError","fullname","setFullname","VerifyEmail","verifyBy","finish","VerifyMobile","LoggedInRoute","component","rest","render","Root","onConfigLoaded","configLoaded","basename","exact","Preference","to","loadTranslations","warn","IntlProvider","handleLocaleChange","loadTranslationsIfNecessary","localeInfo","prevProps","messages","ReactDOM","getElementById"],"mappings":"m/eAAO,SAASA,EAAYC,GACxB,OAAO,eACAA,EAAMC,UAIV,SAASC,EAAUF,GACtB,IAAMG,EAASC,OAAOC,OAAO,GAAIL,EAAMC,SAASE,QAGhD,OAFKA,EAAOG,OACRH,EAAOG,KAAO,WACXH,EAGJ,SAASI,EAAYP,GACxB,OAAOA,EAAMQ,SAGV,SAASC,EAAoBT,GAChC,GAAGA,EAAMC,UAAYD,EAAMC,SAASE,OAChC,OAAOH,EAAMC,SAASE,OAAOO,IChB9B,SAASC,EAAeX,GAC7B,OAAOA,EAAMY,SAASC,MAAMA,MAAMC,EAAiBd,IAG9C,SAASc,EAAiBd,GAC/B,OAAOA,EAAMY,SAASC,MAAME,c,mCCNjBC,EAAgC,qBAAXC,OAAuBC,cAAoB,KCoChEC,EAAQ,yBAEd,SAASC,EAAaC,GAAkC,IAAfC,EAAc,uDAAPH,EACnD,MAAO,CAACG,OAAMC,KAAM,CAACC,OAAO,GAAOC,QAASJ,GCtBjC,SAASK,EAAwBC,GAC5C,KAAMA,aAAevB,SAAWwB,MAAMC,QAAQF,GAC1C,MAAM,IAAIG,MAAM,+CAGpB,IAAMC,EAAW,GACjB,IAAK,IAAMC,KAAOL,EACTA,EAAIM,eAAeD,KAIxBD,EAAIC,GAAOA,GAEf,OAAOD,EC9BIL,QAAU,CACrBQ,oBAAqB,KACrBC,oBAAqB,KAC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AKuY,mBAAmBvY,KAAKkB,MAAM3H,U,+BA6BvC,OACI,kBAAC,KAAD,CACI5I,IAAKqP,KAAKkB,MAAM3H,OAChBA,OAAQyG,KAAKkB,MAAM3H,OACnBof,SAAU3Y,KAAKkB,MAAM7H,cAEpB2G,KAAKkB,MAAM4I,c,GA7DcZ,IAAMa,eCmBjCf,oBAhBf,SAAyBra,GACrB,IAAM4K,EAASe,GAAiB3L,GAChC,MAAO,CACH4K,SACAF,aAAcoB,GAAgB9L,EAAO4K,OAI7C,SAA4BwJ,GACxB,MAAO,CACH/S,QAAS2jB,YAAmB,CACxByE,qBACDrV,MAIIiG,CAA6CsP,ICf5DM,IAAShB,OACL,kBAAC,IAAD,CAAUje,MAAOA,IACb,kBAAC,GAAD,KACI,kBAAC,GAAD,QAGR6G,SAASqY,eAAe,W","file":"static/js/main.26b3db1e.chunk.js","sourcesContent":["export function getSettings(state) {\n return {\n ...state.settings,\n };\n}\n\nexport function getTenant(state) {\n const tenant = Object.assign({}, state.settings.tenant)\n if (!tenant.name)\n tenant.name = \"Steedos\"\n return tenant;\n}\n\nexport function getRequests(state){\n return state.requests\n}\n\nexport function getSettingsTenantId(state){\n if(state.settings && state.settings.tenant){\n return state.settings.tenant._id\n }\n}\n\n","\nimport { GlobalState } from \"../../types/store\";\n\nexport function getCurrentUser(state: GlobalState) {\n return state.entities.users.users[getCurrentUserId(state)];\n}\n\nexport function getCurrentUserId(state: GlobalState) {\n return state.entities.users.currentUserId;\n}\n\nexport function getUsers(state: GlobalState) {\n return state.entities.users.users;\n}\n","import {createHashHistory} from 'history';\n\nexport const hashHistory = typeof window !== 'undefined'?createHashHistory():null;\n","import {GlobalState} from './store';\n\nexport type GetStateFunc = () => GlobalState;\nexport type GenericAction = {\n type: string;\n data?: any;\n meta?: any;\n error?: any;\n index?: number;\n displayable?: boolean;\n postId?: string;\n sessionId?: string;\n currentUserId?: string;\n remove?: Function|string[];\n timestamp?: number;\n [extraProps: string]: any;\n};\nexport type Thunk = (b: DispatchFunc, a: GetStateFunc) => Promise<ActionResult> | ActionResult;\n\ntype BatchAction = {\n type: 'BATCHING_REDUCER.BATCH';\n payload: Array<GenericAction>;\n meta: {\n batch: true;\n };\n};\nexport type Action = GenericAction | Thunk | BatchAction | ActionFunc;\n\nexport type ActionResult = {\n data: any;\n} | {\n error: any;\n};\n\nexport type DispatchFunc = (action: Action, getState?: GetStateFunc | null) => Promise<ActionResult>;\nexport type ActionFunc = (dispatch: DispatchFunc, getState: GetStateFunc) => Promise<ActionResult|ActionResult[]> | ActionResult;\nexport type PlatformType = 'web' | 'ios' | 'android';\n\nexport const BATCH = 'BATCHING_REDUCER.BATCH';\n\nexport function batchActions(actions: Action[], type = BATCH) {\n return {type, meta: {batch: true}, payload: actions};\n}\n\nexport type Reducer<S = any, A extends Action = Action> = (\n state: S | undefined,\n action: A\n ) => S\n\nexport function enableBatching<S>(reduce: Reducer<S>): Reducer<S> {\n return function batchingReducer(state, action) {\n if (action && 'meta' in action && action.meta.batch) {\n return action.payload.reduce(batchingReducer, state);\n }\n return reduce(state, action);\n };\n}","\n/**\n * Constructs an enumeration with keys equal to their value.\n *\n * For example:\n *\n * var COLORS = keyMirror({blue: null, red: null});\n * var myColor = COLORS.blue;\n * var isColorValid = !!COLORS[myColor];\n *\n * The last line could not be performed if the values of the generated enum were\n * not equal to their keys.\n *\n * Input: {key1: val1, key2: val2}\n * Output: {key1: key1, key2: key2}\n *\n * @param {object} obj\n * @return {object}\n */\nexport default function keyMirror<T extends {}>(obj: T): { [K in keyof T]: K } {\n if (!(obj instanceof Object && !Array.isArray(obj))) {\n throw new Error('keyMirror(...): Argument must be an object.');\n }\n\n const ret: any = {};\n for (const key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n\n ret[key] = key;\n }\n return ret;\n}","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n CREATE_USER_REQUEST: null,\n CREATE_USER_SUCCESS: null,\n CREATE_USER_FAILURE: null,\n\n LOGIN_REQUEST: null,\n LOGIN_SUCCESS: null,\n LOGIN_FAILURE: null,\n\n LOGOUT_REQUEST: null,\n LOGOUT_SUCCESS: null,\n LOGOUT_FAILURE: null,\n\n REVOKE_ALL_USER_SESSIONS_SUCCESS: null,\n REVOKE_SESSIONS_FOR_ALL_USERS_SUCCESS: null,\n\n UPDATE_ME_REQUEST: null,\n UPDATE_ME_SUCCESS: null,\n UPDATE_ME_FAILURE: null,\n\n RECEIVED_ME: null,\n RECEIVED_PROFILE: null,\n RECEIVED_PROFILES: null,\n RECEIVED_PROFILES_LIST: null,\n RECEIVED_PROFILE_IN_TEAM: null,\n RECEIVED_PROFILE_NOT_IN_TEAM: null,\n RECEIVED_PROFILE_WITHOUT_TEAM: null,\n RECEIVED_SESSIONS: null,\n RECEIVED_REVOKED_SESSION: null,\n RESET_LOGOUT_STATE: null,\n RECEIVED_MY_USER_ACCESS_TOKEN: null,\n RECEIVED_MY_USER_ACCESS_TOKENS: null,\n CLEAR_MY_USER_ACCESS_TOKENS: null,\n REVOKED_USER_ACCESS_TOKEN: null,\n DISABLED_USER_ACCESS_TOKEN: null,\n ENABLED_USER_ACCESS_TOKEN: null,\n LOGIN: null,\n\n VERIFICATION_TOKEN_RECIEVED: null,\n\n CHANGEPASSWORD_REQUEST: null,\n CHANGEPASSWORD_FAILURE: null,\n CHANGEPASSWORD_RECEIVED: null,\n\n VERIFYEMAIL_REQUEST: null,\n VERIFYEMAIL_FAILURE: null,\n VERIFYEMAIL_RECEIVED: null,\n\n VERIFYMOBILE_REQUEST: null,\n VERIFYMOBILE_FAILURE: null,\n VERIFYMOBILE_RECEIVED: null,\n TO_MOBILE_CODE_LOGIN: null,\n});","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n GET_SPACES_REQUEST: null,\n GET_SPACES_SUCCESS: null,\n GET_SPACES_FAILURE: null,\n\n MY_SPACES_REQUEST: null,\n MY_SPACES_SUCCESS: null,\n MY_SPACES_FAILURE: null,\n\n CREATE_SPACE_REQUEST: null,\n CREATE_SPACE_SUCCESS: null,\n CREATE_SPACE_FAILURE: null,\n\n JOIN_SPACE_REQUEST: null,\n JOIN_SPACE_SUCCESS: null,\n JOIN_SPACE_FAILURE: null,\n\n CREATED_SPACE: null,\n SELECT_SPACE: null,\n UPDATED_SPACE: null,\n\n RECEIVED_SPACE: null,\n RECEIVED_SPACES_LIST: null,\n})","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n RECEIVED_SETTINGS: null, \n \n RECEIVED_APP_STATE: null,\n RECEIVED_APP_CREDENTIALS: null,\n REMOVED_APP_CREDENTIALS: null,\n RECEIVED_APP_DEVICE_TOKEN: null,\n\n PING_RESET: null,\n\n RECEIVED_SERVER_VERSION: null,\n\n CLIENT_CONFIG_RECEIVED: null,\n CLIENT_CONFIG_RESET: null,\n\n CLIENT_LICENSE_RECEIVED: null,\n CLIENT_LICENSE_RESET: null,\n\n RECEIVED_DATA_RETENTION_POLICY: null,\n\n LOG_CLIENT_ERROR_REQUEST: null,\n LOG_CLIENT_ERROR_SUCCESS: null,\n LOG_CLIENT_ERROR_FAILURE: null,\n\n SUPPORTED_TIMEZONES_REQUEST: null,\n SUPPORTED_TIMEZONES_SUCCESS: null,\n SUPPORTED_TIMEZONES_FAILURE: null,\n SUPPORTED_TIMEZONES_RECEIVED: null,\n\n WEBSOCKET_REQUEST: null,\n WEBSOCKET_SUCCESS: null,\n WEBSOCKET_FAILURE: null,\n WEBSOCKET_CLOSED: null,\n\n REDIRECT_LOCATION_SUCCESS: null,\n REDIRECT_LOCATION_FAILURE: null,\n SET_CONFIG_AND_LICENSE: null,\n\n WARN_METRICS_STATUS_RECEIVED: null,\n WARN_METRIC_STATUS_RECEIVED: null,\n WARN_METRIC_STATUS_REMOVED: null,\n});","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n DISMISS_ERROR: null,\n LOG_ERROR: null,\n CLEAR_ERRORS: null,\n RESTORE_ERRORS: null,\n});","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nconst data = {};\nconst etags = {};\n\nexport default (url = null, options = {headers: {}}) => {\n url = url || options.url; // eslint-disable-line no-param-reassign\n\n if (options.method === 'GET' || !options.method) {\n const etag = etags[url];\n const cachedResponse = data[`${url}${etag}`]; // ensure etag is for url\n if (etag) {\n options.headers['If-None-Match'] = etag;\n }\n\n return fetch(url, options).\n then((response) => {\n if (response.status === 304) {\n return cachedResponse.clone();\n }\n\n if (response.status === 200) {\n const responseEtag = response.headers.get('Etag');\n\n if (responseEtag) {\n data[`${url}${responseEtag}`] = response.clone();\n etags[url] = responseEtag;\n }\n }\n\n return response;\n });\n }\n\n // all other requests go straight to fetch\n return Reflect.apply(fetch, undefined, [url, options]); //eslint-disable-line no-undefined\n};\n","import {Dictionary} from '../types/utilities';\n\nexport function buildQueryString(parameters: Dictionary<any>): string {\n const keys = Object.keys(parameters);\n if (keys.length === 0) {\n return '';\n }\n\n let query = '?';\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n query += key + '=' + encodeURIComponent(parameters[key]);\n\n if (i < keys.length - 1) {\n query += '&';\n }\n }\n\n return query;\n}","import {UserTypes} from '../../action_types/';\nimport { GenericAction } from '../../types/actions';\nimport { IDMappedObjects } from '../../types/utilities';\nimport { UserProfile } from '../../types/users';\nimport { combineReducers } from 'redux';\n\nconst currentUserId = (state = '', action: GenericAction) => {\n switch (action.type) {\n case UserTypes.RECEIVED_ME: {\n const data = action.data || action.payload;\n return data._id;\n }\n\n case UserTypes.LOGIN: { // Used by the mobile app\n const {user} = action.data;\n\n return user ? user._id : state;\n }\n case UserTypes.LOGOUT_SUCCESS:\n return '';\n }\n\n return state;\n}\n\n\nconst users = (state: IDMappedObjects<UserProfile> = {}, action: GenericAction) => {\n switch (action.type) {\n case UserTypes.RECEIVED_ME:\n case UserTypes.RECEIVED_PROFILE: {\n const data = action.data || action.payload;\n const user = { ...data };\n\n return {\n ...state,\n [data._id]: user,\n };\n }\n case UserTypes.LOGIN: { // Used by the mobile app\n const { user } = action.data;\n\n if (user) {\n const nextState = { ...state };\n nextState[user._id] = user;\n return nextState;\n }\n\n return state;\n }\n case UserTypes.LOGOUT_SUCCESS:\n return {};\n case UserTypes.CHANGEPASSWORD_RECEIVED:{\n const data = action.data || action.payload;\n return {\n ...state,\n [data.userId]: Object.assign({}, state[data.userId], { password_expired: data.password_expired }),\n }\n }\n case UserTypes.VERIFYEMAIL_RECEIVED: {\n const data = action.data || action.payload;\n return {\n ...state,\n [data.userId]: Object.assign({}, state[data.userId], { email_verified: data.email_verified }),\n }\n }\n case UserTypes.VERIFYMOBILE_RECEIVED: {\n const data = action.data || action.payload;\n return {\n ...state,\n [data.userId]: Object.assign({}, state[data.userId], { mobile_verified: data.mobile_verified }),\n }\n }\n default:\n return state;\n }\n}\n\n\n\nexport default combineReducers({\n currentUserId,\n users\n})","import { UserTypes, SpaceTypes } from '../../action_types/';\nimport { GenericAction } from '../../types/actions';\nimport { IDMappedObjects } from '../../types/utilities';\nimport { UserProfile } from '../../types/users';\nimport { combineReducers } from 'redux';\nimport { listToMap } from '../../utils/utils';\n\nconst currentSpaceId = (state = '', action: GenericAction) => {\n switch (action.type) {\n case SpaceTypes.SELECT_SPACE:\n return action.data;\n case UserTypes.LOGOUT_SUCCESS:\n return '';\n default:\n return state;\n }\n}\n\nconst spaces = (state: IDMappedObjects<UserProfile> = {}, action: GenericAction) => {\n switch (action.type) {\n case SpaceTypes.RECEIVED_SPACES_LIST:\n return Object.assign({}, state, listToMap(action.data));\n case UserTypes.LOGOUT_SUCCESS:\n return {};\n\n default:\n return state;\n }\n}\n\n\nexport default combineReducers({\n currentSpaceId,\n spaces,\n})","import {combineReducers} from 'redux';\nimport { GenericAction } from '../../types/actions';\nimport { GeneralTypes, UserTypes } from '../../action_types/';\n\n\n// function config(state: Partial<ClientConfig> = {}, action: GenericAction) {\n// switch (action.type) {\n// case GeneralTypes.CLIENT_CONFIG_RECEIVED:\n// return Object.assign({}, state, action.data);\n// case UserTypes.LOGIN: // Used by the mobile app\n// case GeneralTypes.SET_CONFIG_AND_LICENSE:\n// return Object.assign({}, state, action.data.config);\n// case GeneralTypes.CLIENT_CONFIG_RESET:\n// case UserTypes.LOGOUT_SUCCESS:\n// return {};\n// default:\n// return state;\n// }\n// }\n\nfunction appState(state = false, action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_APP_STATE:\n return action.data;\n\n default:\n return state;\n }\n}\n\nfunction credentials(state: any = {}, action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_APP_CREDENTIALS:\n return Object.assign({}, state, action.data);\n\n case UserTypes.LOGIN: // Used by the mobile app\n return {\n url: action.data.url,\n };\n case UserTypes.LOGOUT_SUCCESS:\n return {};\n default:\n return state;\n }\n}\n\n\nfunction deviceToken(state = '', action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_APP_DEVICE_TOKEN:\n return action.data;\n default:\n return state;\n }\n}\n\nfunction serverVersion(state = '', action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_SERVER_VERSION:\n return action.data;\n case UserTypes.LOGOUT_SUCCESS:\n return '';\n default:\n return state;\n }\n}\n\nexport default combineReducers({\n appState,\n credentials,\n deviceToken,\n serverVersion,\n});","import users from './users';\nimport spaces from './spaces';\nimport general from './general';\nimport { combineReducers } from 'redux';\n\nexport default combineReducers({\n general,\n users,\n spaces\n})","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {combineReducers} from 'redux';\n\nimport en from '../i18n/en.json';\n\nfunction translations(state = {en}, action) {\n switch (action.type) {\n case \"RECEIVED_TRANSLATIONS\":\n return {\n ...state,\n [action.data.locale]: action.data.translations,\n };\n\n default:\n return state;\n }\n}\n\nexport default combineReducers({\n translations,\n});\n","\nimport { GeneralTypes } from \"../action_types\";\n\nconst settings = (state = {}, action) => {\n switch (action.type) {\n case GeneralTypes.RECEIVED_SETTINGS:\n return Object.assign({}, state, action.data);\n default:\n return state\n }\n}\n\nexport default settings","const requests = (state = {}, action) => {\n switch (action.type) {\n case 'change':\n return Object.assign({}, state, {status: action.data});\n default:\n return state\n }\n}\n\nexport default requests","import { combineReducers } from 'redux'\nimport entities from './entities'\nimport i18n from './i18n'\nimport settings from './settings'\nimport requests from './requests'\n\nexport default combineReducers({\n entities,\n i18n,\n settings,\n requests,\n})","const en = require(\"../i18n/en.json\");\nconst zhCN = require(\"../i18n/zh-CN.json\");\n\nexport default {\n entities: {\n general: {\n },\n users: {\n currentUserId: '',\n users: {},\n },\n spaces: {\n currentSpaceId: '',\n spaces: {},\n },\n },\n i18n: {\n translations: {\n en: en,\n 'zh-CN': zhCN\n }\n },\n settings: {\n services: {\n\n }\n },\n requests: {\n status: \"not_started\"\n },\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n// This is a temporary store while we are transitioning from Flux to Redux. This file exports\n// the configured Redux store for use by actions and selectors.\n\nimport { createStore, applyMiddleware } from 'redux'\nimport thunkMiddleware from 'redux-thunk'\nimport rootReducer from '../reducers'\nimport initialState from './initial_state';\n\nconst store = createStore(\n rootReducer, \n initialState, \n applyMiddleware(\n thunkMiddleware,\n )\n);\n\nexport function bindActionToRedux(action, ...args) {\n return async () => {\n await action(...args)(store.dispatch, store.getState);\n };\n}\n\nif (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined') { //eslint-disable-line no-process-env\n window.storeWebapp = store;\n}\n\nexport default store;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable import/order */\n\n// import {addLocaleData} from 'react-intl';\n\n// import enLocaleData from 'react-intl/locale-data/en';\n// import zhLocaleData from 'react-intl/locale-data/zh';\n\nimport store from '../stores/redux_store';\nimport { getSettings } from '../selectors';\n\nconst en = require(\"./en.json\");\nconst zhCN = require(\"./zh-CN.json\");\n\n// should match the values in model/config.go\nconst languages = {\n en: {\n value: 'en',\n name: 'English',\n order: 1,\n translations: en\n },\n 'zh-CN': {\n value: 'zh-CN',\n name: '中文 (简体)',\n order: 13,\n translations: zhCN\n },\n};\n\nexport function getAllLanguages() {\n return languages;\n}\n\nexport function getLanguages() {\n const config = getSettings(store.getState());\n if (!config.AvailableLocales) {\n return getAllLanguages();\n }\n return config.AvailableLocales.split(',').reduce((result, l) => {\n if (languages[l]) {\n result[l] = languages[l];\n }\n return result;\n }, {});\n}\n\nexport function getLanguageInfo(locale) {\n return getAllLanguages()[locale];\n}\n\nexport function isLanguageAvailable(locale) {\n return Boolean(getLanguages()[locale]);\n}\n\nexport function doAddLocaleData() {\n // addLocaleData(enLocaleData);\n // addLocaleData(zhLocaleData);\n}\n","\nimport * as I18n from '../i18n/i18n';\n\nimport { getSettings } from '../selectors';\nimport { getBrowserLng } from '../utils/utils';\n\nexport function getCurrentUserLocale(state) {\n return getBrowserLng();\n}\n\n// This is a placeholder for if we ever implement browser-locale detection\nexport function getCurrentLocale(state) {\n return getCurrentUserLocale(state, getSettings(state).DefaultClientLocale);\n}\n\nexport function getTranslations(state, locale) {\n const localeInfo = I18n.getLanguageInfo(locale);\n\n let translations;\n if (localeInfo) {\n translations = state.i18n.translations[locale];\n } else {\n // Default to English if an unsupported locale is specified\n translations = state.i18n.translations.en;\n }\n\n return translations;\n}\n","import store from '../stores/redux_store';\nimport {getCurrentLocale, getTranslations} from '../selectors/i18n';\nimport {IDMappedObjects, Dictionary} from '../types/utilities';\n\nexport const getCookie = (name) => {\n let pattern = RegExp(name + \"=.[^;]*\")\n let matched = document.cookie.match(pattern)\n if(matched){\n let cookie = matched[0].split('=')\n return cookie[1]\n }\n return ''\n}\n\nexport const getBrowserLng = function () {\n var l, lng;\n var navigator = window.navigator;\n l = navigator.userLanguage || navigator.language || 'en';\n if (l.indexOf(\"zh\") >= 0) {\n lng = \"zh-CN\";\n } else {\n lng = \"en\";\n }\n return lng;\n};\n\nexport const getBrowserLocale = function(){\n var l, locale;\n var navigator = window.navigator;\n l = navigator.userLanguage || navigator.language || 'en';\n if (l.indexOf(\"zh\") >= 0) {\n locale = \"zh-cn\";\n } else {\n locale = \"en-us\";\n }\n return locale;\n}\n\nexport function localizeMessage(id, defaultMessage) {\n const state = store.getState();\n\n const locale = getCurrentLocale(state);\n const translations = getTranslations(state, locale);\n\n if (!translations || !(id in translations)) {\n return defaultMessage || id;\n }\n\n return translations[id];\n}\n\nexport function isEmptyObject(object) {\n if (!object) {\n return true;\n }\n\n if (Object.keys(object).length === 0) {\n return true;\n }\n\n return false;\n}\n\nexport function listToMap(recordsList) {\n const recordsMap = {};\n for (let i = 0; i < recordsList.length; i++) {\n recordsMap[recordsList[i]._id] = recordsList[i];\n }\n return recordsMap;\n}\n\n\n// export const setLocationSearch = (location)=>{\n// let value = '';\n// if(location){\n// if(location.search){\n// value = location.search\n// }else if(location.hash && location.hash.indexOf(\"?\") > -1){\n// value = location.hash.substring(location.hash.indexOf(\"?\"))\n// }\n// }\n// if(!window._AccountsLocationSearch && value){\n// window._AccountsLocationSearch = value\n// }\n// };\n\n// export const getLocationSearch = ()=>{\n// return window._AccountsLocationSearch || \"\"\n// }\n\n\nexport const fixRootUrl = (rootUrl) => {\n\n if (process.env.NODE_ENV == 'development')\n return rootUrl;\n\n if (rootUrl) {\n var parsedUrl = new URL(rootUrl);\n \n var pathPrefix = parsedUrl.pathname;\n if (pathPrefix.slice(-1) === '/') {\n // remove trailing slash (or turn \"/\" into \"\")\n pathPrefix = pathPrefix.slice(0, -1);\n }\n return pathPrefix;\n } else {\n return \"\";\n }\n\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport fetch from './fetch_etag';\nimport {cleanUrlForLogging} from '../utils/sentry';\nimport { Options, ClientResponse } from '../types/client4';\nimport {buildQueryString} from '../utils/helpers';\nimport { UserProfile } from '../types/users';\nimport { ServerError } from '../types/errors';\nimport { Space } from '../types/spaces';\nimport { getBrowserLocale } from '../utils/utils';\n\nconst FormData = require('form-data');\nconst HEADER_AUTH = 'Authorization';\nconst HEADER_BEARER = 'BEARER';\nconst HEADER_REQUESTED_WITH = 'X-Requested-With';\nconst HEADER_USER_AGENT = 'User-Agent';\nconst HEADER_X_CLUSTER_ID = 'X-Cluster-Id';\nconst HEADER_X_CSRF_TOKEN = 'X-CSRF-Token';\nexport const HEADER_X_VERSION_ID = 'X-Version-Id';\nconst PER_PAGE_DEFAULT = 60;\nconst LOGS_PER_PAGE_DEFAULT = 10000;\nexport const DEFAULT_LIMIT_BEFORE = 30;\nexport const DEFAULT_LIMIT_AFTER = 30;\n\nconst DEFAULT_LOGIN_EXPIRATION_DAYS = 90;\nconst LOGIN_UNEXPIRING_TOKEN_DAYS = 365 * 100;\n\nexport default class Client4 {\n LOGIN_TOKEN_KEY = \"Meteor.loginToken\";\n LOGIN_TOKEN_EXPIRES_KEY = \"Meteor.loginTokenExpires\";\n USER_ID_KEY = \"Meteor.userId\";\n logToConsole = false;\n _lastLoginTokenWhenPolled= null;\n loginExpirationInDays = null;\n serverVersion = '';\n clusterId = '';\n token = '';\n csrf = '';\n url = (process.env.NODE_ENV == 'development' && process.env.REACT_APP_API_URL)? process.env.REACT_APP_API_URL as string : '';\n urlVersion = '';\n userAgent: string|null = null;\n enableLogging = false;\n defaultHeaders: {[x: string]: string} = {\n 'Content-Type': 'application/json'\n };\n userId = '';\n diagnosticId = '';\n includeCookies = true;\n isRudderKeySet = false;\n translations = {\n connectionError: 'There appears to be a problem with your internet connection.',\n unknownError: 'We received an unexpected status code from the server.',\n };\n userRoles?: string;\n \n getUrl() {\n var href = new URL(window.location.href);\n var foo = href.pathname.split('/accounts');\n if(!this.url){\n var ROOT_URL_PATH_PREFIX = '';\n if(foo.length > 1){\n ROOT_URL_PATH_PREFIX = foo[0];\n }\n return ROOT_URL_PATH_PREFIX;\n }\n return this.url;\n }\n\n getAbsoluteUrl(baseUrl: string) {\n if (typeof baseUrl !== 'string' || !baseUrl.startsWith('/')) {\n return baseUrl;\n }\n return this.getUrl() + baseUrl;\n }\n\n setUrl(url: string) {\n this.url = url;\n }\n\n setUserAgent(userAgent: string) {\n this.userAgent = userAgent;\n }\n\n getToken() {\n return this.token;\n }\n\n setToken(token: string) {\n this.token = token;\n }\n\n setCSRF(csrfToken: string) {\n this.csrf = csrfToken;\n }\n\n setAcceptLanguage(locale: string) {\n this.defaultHeaders['Accept-Language'] = locale;\n }\n\n setEnableLogging(enable: boolean) {\n this.enableLogging = enable;\n }\n\n setIncludeCookies(include: boolean) {\n this.includeCookies = include;\n }\n\n setUserId(userId: string) {\n this.userId = userId;\n }\n\n setUserRoles(roles: string) {\n this.userRoles = roles;\n }\n\n setDiagnosticId(diagnosticId: string) {\n this.diagnosticId = diagnosticId;\n }\n\n enableRudderEvents() {\n this.isRudderKeySet = true;\n }\n\n getServerVersion() {\n return this.serverVersion;\n }\n\n getUrlVersion() {\n return this.urlVersion;\n }\n\n getBaseRoute() {\n return `${this.getUrl()}${this.urlVersion}`;\n }\n\n getAccountsRoute() {\n return `${this.getBaseRoute()}/accounts`;\n }\n\n getCSRFFromCookie() {\n if (typeof document !== 'undefined' && typeof document.cookie !== 'undefined') {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n if (cookie.startsWith('MMCSRF=')) {\n return cookie.replace('MMCSRF=', '');\n }\n }\n }\n return '';\n }\n\n getOptions(options: Options) {\n const newOptions: Options = {...options};\n\n const headers: {[x: string]: string} = {\n [HEADER_REQUESTED_WITH]: 'XMLHttpRequest',\n ...this.defaultHeaders,\n };\n\n if (this.token) {\n headers[HEADER_AUTH] = `${HEADER_BEARER} ${this.token}`;\n }\n\n const csrfToken = this.csrf || this.getCSRFFromCookie();\n if (options.method && options.method.toLowerCase() !== 'get' && csrfToken) {\n headers[HEADER_X_CSRF_TOKEN] = csrfToken;\n }\n\n if (this.includeCookies) {\n newOptions.credentials = 'include';\n }\n\n if (this.userAgent) {\n headers[HEADER_USER_AGENT] = this.userAgent;\n }\n\n if (newOptions.headers) {\n Object.assign(headers, newOptions.headers);\n }\n\n return {\n ...newOptions,\n headers,\n };\n }\n\n getTranslations = (url: string) => {\n return this.doFetch<Record<string, string>>(\n url,\n {method: 'get'},\n );\n }\n\n\n logClientError = (message: string, level = 'ERROR') => {\n // const url = `${this.getBaseRoute()}/logs`;\n\n // if (!this.enableLogging) {\n // throw new ClientError(this.getUrl(), {\n // message: 'Logging disabled.',\n // url,\n // });\n // }\n\n // return this.doFetch<{\n // message: string;\n // }>(\n // url,\n // {method: 'post', body: JSON.stringify({message, level})},\n // );\n };\n\n login = (user: string | object, password: string, token = '', deviceId = '') => {\n this.trackEvent('api', 'api_users_login');\n const body: any = {\n device_id: deviceId,\n user,\n password,\n token,\n locale: getBrowserLocale()\n };\n\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/login`,\n {method: 'POST', body: JSON.stringify(body)},\n );\n\n };\n\n\n createUser = (user: UserProfile, token: string, inviteId: string, redirect: string) => {\n this.trackEvent('api', 'api_users_createUser');\n\n const queryParams: any = {};\n\n if (token) {\n queryParams.t = token;\n }\n\n if (inviteId) {\n queryParams.iid = inviteId;\n }\n\n if (redirect) {\n queryParams.r = redirect;\n }\n\n const auth:any = this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/register${buildQueryString(queryParams)}`,\n {method: 'POST', body: JSON.stringify(user)},\n );\n\n return auth\n };\n\n createSpace = (name: string) => {\n this.trackEvent('api', 'api_users_createTenant');\n\n const queryParams: any = {};\n\n const auth:any = this.doFetch<UserProfile>(\n `${this.getBaseRoute()}/api/v4/spaces/register/tenant${buildQueryString(queryParams)}`,\n {method: 'POST', body: JSON.stringify({name: name})},\n );\n\n return auth\n };\n\n sendVerificationToken = (user: string) => {\n this.trackEvent('api', 'api_users_verify');\n\n const body: any = {\n user: user,\n };\n\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/sendVerificationCode`,\n {method: 'POST', body: JSON.stringify(body)},\n );\n };\n\n getSettings = () => {\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/settings`,\n {method: 'get'},\n );\n };\n\n getMe = () => {\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/user`,\n {method: 'get'},\n );\n };\n\n getMySpaces = () => {\n return this.doFetch<Space[]>(\n `${this.getAccountsRoute()}/user/spaces`,\n {method: 'get'},\n );\n };\n\n logout = async () => {\n this.trackEvent('api', 'api_users_logout');\n\n const {response} = await this.doFetchWithResponse(\n `${this.getAccountsRoute()}/logout`,\n {method: 'post'},\n );\n\n if (response.ok) {\n this.token = '';\n }\n\n this.serverVersion = '';\n \n return response;\n };\n\n // Client Helpers\n\n doFetch = async <T>(url: string, options: Options): Promise<T> => {\n const {data} = await this.doFetchWithResponse<T>(url, options);\n\n return data;\n };\n\n doFetchWithResponse = async <T>(url: string, options: Options): Promise<ClientResponse<T>> => {\n const response = await fetch(url, this.getOptions(options));\n const headers = parseAndMergeNestedHeaders(response.headers);\n\n let data;\n try {\n data = await response.json();\n } catch (err) {\n throw new ClientError(this.getUrl(), {\n message: 'Received invalid response from the server.',\n intl: {\n id: 'mobile.request.invalid_response',\n defaultMessage: 'Received invalid response from the server.',\n },\n url,\n });\n }\n\n if (headers.has(HEADER_X_VERSION_ID) && !headers.get('Cache-Control')) {\n const serverVersion = headers.get(HEADER_X_VERSION_ID);\n if (serverVersion && this.serverVersion !== serverVersion) {\n this.serverVersion = serverVersion as string;\n }\n }\n\n if (headers.has(HEADER_X_CLUSTER_ID)) {\n const clusterId = headers.get(HEADER_X_CLUSTER_ID);\n if (clusterId && this.clusterId !== clusterId) {\n this.clusterId = clusterId as string;\n }\n }\n\n if (response.ok) {\n return {\n response,\n headers: headers as Map<string, string>,\n data,\n };\n }\n\n const msg = data.message || '';\n\n if (this.logToConsole) {\n console.error(msg); // eslint-disable-line no-console\n }\n\n throw new ClientError(this.getUrl(), {\n message: msg,\n server_error_id: data.id,\n status_code: data.status_code,\n url,\n });\n };\n\n trackEvent(category: string, event: string, props?: any) {\n if (!this.isRudderKeySet) {\n return;\n }\n\n const properties = Object.assign({\n category,\n type: event,\n // user_actual_role: this.userRoles && isSystemAdmin(this.userRoles) ? 'system_admin, system_user' : 'system_user',\n user_actual_id: this.userId,\n }, props);\n const options = {\n context: {\n ip: '0.0.0.0',\n },\n page: {\n path: '',\n referrer: '',\n search: '',\n title: '',\n url: '',\n },\n anonymousId: '00000000000000000000000000',\n };\n\n // rudderAnalytics.track('event', properties, options);\n }\n\n changePassword = (oldPassword: string, newPassword: string)=>{\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/changePassword`,\n {method: 'POST', body: JSON.stringify({\n oldPassword: oldPassword,\n newPassword: newPassword,\n })},\n );\n }\n\n verifyEmail = (email: string, code: string)=>{\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/verify/email`,\n {method: 'POST', body: JSON.stringify({\n email: email,\n code: code,\n })},\n );\n }\n\n verifyMobile = (mobile: string, code: string)=>{\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/verify/mobile`,\n {method: 'POST', body: JSON.stringify({\n mobile: mobile,\n code: code,\n })},\n );\n }\n\n // _initLocalStorage(ROOT_URL_PATH_PREFIX){\n // if (ROOT_URL_PATH_PREFIX) {\n // let namespace = `:${ROOT_URL_PATH_PREFIX}`;\n // this.LOGIN_TOKEN_KEY += namespace;\n // this.LOGIN_TOKEN_EXPIRES_KEY += namespace;\n // this.USER_ID_KEY += namespace;\n // }\n // }\n\n // _getTokenLifetimeMs() {\n // const loginExpirationInDays = (this.loginExpirationInDays === null) ? LOGIN_UNEXPIRING_TOKEN_DAYS : this.loginExpirationInDays;\n // return (loginExpirationInDays || DEFAULT_LOGIN_EXPIRATION_DAYS) * 24 * 60 * 60 * 1000;\n // }\n\n // _tokenExpiration(when) {\n // return new Date((new Date(when)).getTime() + this._getTokenLifetimeMs());\n // }\n \n // _storeLoginToken(userId, token, tokenExpires) {\n // localStorage.setItem(this.USER_ID_KEY, userId);\n // localStorage.setItem(this.LOGIN_TOKEN_KEY, token);\n // if (! tokenExpires)\n // tokenExpires = this._tokenExpiration(new Date());\n // localStorage.setItem(this.LOGIN_TOKEN_EXPIRES_KEY, tokenExpires);\n \n // this._lastLoginTokenWhenPolled = token;\n // };\n \n // _unstoreLoginToken() {\n // localStorage.removeItem(this.USER_ID_KEY);\n // localStorage.removeItem(this.LOGIN_TOKEN_KEY);\n // localStorage.removeItem(this.LOGIN_TOKEN_EXPIRES_KEY);\n\n // this._lastLoginTokenWhenPolled = null;\n // };\n}\n\nfunction parseAndMergeNestedHeaders(originalHeaders: any) {\n const headers = new Map();\n let nestedHeaders = new Map();\n originalHeaders.forEach((val: string, key: string) => {\n const capitalizedKey = key.replace(/\\b[a-z]/g, (l) => l.toUpperCase());\n let realVal = val;\n if (val && val.match(/\\n\\S+:\\s\\S+/)) {\n const nestedHeaderStrings = val.split('\\n');\n realVal = nestedHeaderStrings.shift() as string;\n const moreNestedHeaders = new Map(\n nestedHeaderStrings.map((h: any) => h.split(/:\\s/)),\n );\n nestedHeaders = new Map([...nestedHeaders, ...moreNestedHeaders]);\n }\n headers.set(capitalizedKey, realVal);\n });\n return new Map([...headers, ...nestedHeaders]);\n}\n\nexport class ClientError extends Error implements ServerError {\n url?: string;\n intl?: {\n id: string;\n defaultMessage: string;\n values?: any;\n };\n server_error_id?: string;\n status_code?: number;\n\n constructor(baseUrl: string, data: ServerError) {\n super(data.message + ': ' + cleanUrlForLogging(baseUrl, data.url || ''));\n\n this.message = data.message;\n this.url = data.url;\n this.intl = data.intl;\n this.server_error_id = data.server_error_id;\n this.status_code = data.status_code;\n\n // Ensure message is treated as a property of this class when object spreading. Without this,\n // copying the object by using `{...error}` would not include the message.\n Object.defineProperty(this, 'message', {enumerable: true});\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n// @flow\n\n// Given a URL from an API request, return a URL that has any parts removed that are either sensitive or that would\n// prevent properly grouping the messages in Sentry.\nexport function cleanUrlForLogging(baseUrl, apiUrl) {\n let url = apiUrl;\n\n // Trim the host name\n url = url.substring(baseUrl.length);\n\n // Filter the query string\n const index = url.indexOf('?');\n if (index !== -1) {\n url = url.substring(0, index);\n }\n\n // A non-exhaustive whitelist to exclude parts of the URL that are unimportant (eg IDs) or may be sentsitive\n // (eg email addresses). We prefer filtering out fields that aren't recognized because there should generally\n // be enough left over for debugging.\n //\n // Note that new API routes don't need to be added here since this shouldn't be happening for newly added routes.\n const whitelist = [\n 'api', 'v4', 'users', 'teams', 'scheme', 'name', 'members', 'channels', 'posts', 'reactions', 'commands',\n 'files', 'preferences', 'hooks', 'incoming', 'outgoing', 'oauth', 'apps', 'emoji', 'brand', 'image',\n 'data_retention', 'jobs', 'plugins', 'roles', 'system', 'timezones', 'schemes', 'redirect_location', 'patch',\n 'mfa', 'password', 'reset', 'send', 'active', 'verify', 'terms_of_service', 'login', 'logout', 'ids',\n 'usernames', 'me', 'username', 'email', 'default', 'sessions', 'revoke', 'all', 'audits', 'device', 'status',\n 'search', 'switch', 'authorized', 'authorize', 'deauthorize', 'tokens', 'disable', 'enable', 'exists', 'unread',\n 'invite', 'batch', 'stats', 'import', 'schemeRoles', 'direct', 'group', 'convert', 'view', 'search_autocomplete',\n 'thread', 'info', 'flagged', 'pinned', 'pin', 'unpin', 'opengraph', 'actions', 'thumbnail', 'preview', 'link',\n 'delete', 'logs', 'ping', 'config', 'client', 'license', 'websocket', 'webrtc', 'token', 'regen_token',\n 'autocomplete', 'execute', 'regen_secret', 'policy', 'type', 'cancel', 'reload', 'environment', 's3_test', 'file',\n 'caches', 'invalidate', 'database', 'recycle', 'compliance', 'reports', 'cluster', 'ldap', 'test', 'sync', 'saml',\n 'certificate', 'public', 'private', 'idp', 'elasticsearch', 'purge_indexes', 'analytics', 'old', 'webapp', 'fake',\n ];\n\n url = url.split('/').map((part) => {\n if (part !== '' && whitelist.indexOf(part) === -1) {\n return '<filtered>';\n }\n\n return part;\n }).join('/');\n\n if (index !== -1) {\n // Add this on afterwards since it wouldn't pass the whitelist\n url += '?<filtered>';\n }\n\n return url;\n}\n","\nimport ClientClass4, {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID} from './client4';\n\nconst Client4 = new ClientClass4();\n\nif ((typeof(window) !== 'undefined'))\n window['Client4'] = Client4;\n\nexport {\n Client4, DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID,\n}\n","\nimport {ErrorTypes} from '../action_types';\nimport {serializeError, ErrorObject} from 'serialize-error';\nimport {Client4} from '../client';\n// import EventEmitter from './utils/event_emitter';\nimport {DispatchFunc, ActionFunc} from '../types/actions';\nimport {ServerError} from '../types/errors';\n\nexport function dismissErrorObject(index: number) {\n return {\n type: ErrorTypes.DISMISS_ERROR,\n index,\n data: null,\n };\n}\n\nexport function dismissError(index: number): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n dispatch(dismissErrorObject(index));\n\n return {data: true};\n };\n}\n\nexport function getLogErrorAction(error: ErrorObject, displayable = false) {\n return {\n type: ErrorTypes.LOG_ERROR,\n displayable,\n error,\n data: null,\n };\n}\n\nexport function logError(error: ServerError, displayable = false): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n // if (error.server_error_id === 'api.context.session_expired.app_error') {\n // return {data: true};\n // }\n\n // const serializedError = serializeError(error);\n\n // let sendToServer = true;\n // if (error.stack && error.stack.includes('TypeError: Failed to fetch')) {\n // sendToServer = false;\n // }\n // if (error.server_error_id) {\n // sendToServer = false;\n // }\n\n // if (sendToServer) {\n // try {\n // const stringifiedSerializedError = JSON.stringify(serializedError).toString();\n // await Client4.logClientError(stringifiedSerializedError);\n // } catch (err) {\n // // avoid crashing the app if an error sending\n // // the error occurs.\n // }\n // }\n\n // // EventEmitter.emit(ErrorTypes.LOG_ERROR, error);\n // dispatch(getLogErrorAction(serializedError, displayable));\n\n return {data: true};\n };\n}\n\nexport function clearErrors(): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n dispatch({type: ErrorTypes.CLEAR_ERRORS, data: null});\n\n return {data: true};\n };\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\nimport {Client4} from '../client';\nimport {UserTypes} from '../action_types';\n\nimport {Client4Error} from '../types/client4';\nimport {batchActions, Action, ActionFunc, GenericAction, DispatchFunc, GetStateFunc} from '../types/actions';\n\nimport {logError} from './errors';\n\ntype ActionType = string;\nconst HTTP_UNAUTHORIZED = 401;\nexport function forceLogoutIfNecessary(err: Client4Error, dispatch: DispatchFunc, getState: GetStateFunc) {\n const {currentUserId} = getState().entities.users;\n\n if ('status_code' in err && err.status_code === HTTP_UNAUTHORIZED && err.url && err.url.indexOf('/login') === -1 && currentUserId) {\n Client4.setToken('');\n dispatch({type: UserTypes.LOGOUT_SUCCESS, data: {}});\n }\n}\n\nfunction dispatcher(type: ActionType, data: any, dispatch: DispatchFunc) {\n if (type.indexOf('SUCCESS') === -1) { // we don't want to pass the data for the request types\n dispatch(requestSuccess(type, data));\n } else {\n dispatch(requestData(type));\n }\n}\n\nexport function requestData(type: ActionType): GenericAction {\n return {\n type,\n data: null,\n };\n}\n\nexport function requestSuccess(type: ActionType, data: any) {\n return {\n type,\n data,\n };\n}\n\nexport function requestFailure(type: ActionType, error: Client4Error): any {\n return {\n type,\n error,\n };\n}\n\n/**\n * Returns an ActionFunc which calls a specfied (client) function and\n * dispatches the specifed actions on request, success or failure.\n *\n * @export\n * @param {Object} obj an object for destructirung required properties\n * @param {() => Promise<mixed>} obj.clientFunc clientFunc to execute\n * @param {ActionType} obj.onRequest ActionType to dispatch on request\n * @param {(ActionType | Array<ActionType>)} obj.onSuccess ActionType to dispatch on success\n * @param {ActionType} obj.onFailure ActionType to dispatch on failure\n * @param {...Array<any>} obj.params\n * @returns {ActionFunc} ActionFunc\n */\n\nexport function bindClientFunc({\n clientFunc,\n onRequest,\n onSuccess,\n onFailure,\n params = [],\n}: {\n clientFunc: (...args: any[]) => Promise<any>;\n onRequest?: ActionType;\n onSuccess?: ActionType | Array<ActionType>;\n onFailure?: ActionType;\n params?: Array<any>;\n}): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n if (onRequest) {\n dispatch(requestData(onRequest));\n }\n\n let data: any = null;\n try {\n data = await clientFunc(...params);\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n const actions: Action[] = [logError(error)];\n if (onFailure) {\n actions.push(requestFailure(onFailure, error));\n }\n dispatch(batchActions(actions));\n return {error};\n }\n\n if (Array.isArray(onSuccess)) {\n onSuccess.forEach((s) => {\n dispatcher(s, data, dispatch);\n });\n } else if (onSuccess) {\n dispatcher(onSuccess, data, dispatch);\n }\n\n return {data};\n };\n}\n\n// Debounce function based on underscores modified to use es6 and a cb\n\nexport function debounce(func: (...args: any) => unknown, wait: number, immediate: boolean, cb: () => unknown) {\n //let timeout: NodeJS.Timeout|null;\n let timeout: any;\n return function fx(...args: Array<any>) {\n const runLater = () => {\n timeout = null;\n if (!immediate) {\n Reflect.apply(func, this, args);\n if (cb) {\n cb();\n }\n }\n };\n const callNow = immediate && !timeout;\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(runLater, wait);\n if (callNow) {\n Reflect.apply(func, this, args);\n if (cb) {\n cb();\n }\n }\n };\n}\n\nexport class FormattedError extends Error {\n intl: {\n id: string;\n defaultMessage: string;\n values: any;\n };\n\n constructor(id: string, defaultMessage: string, values: any = {}) {\n super(defaultMessage);\n this.intl = {\n id,\n defaultMessage,\n values,\n };\n }\n}","import store from './redux_store';\n\nconst getBasePath = () => {return 'steedos'}\nconst getPreviousSpaceIdKey = (userId) => ['user_prev_space', userId].join(':');\nconst getWasLoggedInKey = () => 'was_logged_in';\n\n\nconst getPathScopedKey = (path, key) => {\n if (path === '' || path === '/') {\n return key;\n }\n\n return [path, key].join(':');\n};\n\n\nclass LocalStorageStoreClass {\n \n getItem(key, state = store.getState()) {\n const basePath = getBasePath();\n\n return localStorage.getItem(getPathScopedKey(basePath, key));\n }\n\n setItem(key, value) {\n const state = store.getState();\n const basePath = getBasePath();\n\n localStorage.setItem(getPathScopedKey(basePath, key), value);\n }\n\n removeItem(key) {\n const state = store.getState();\n const basePath = getBasePath();\n\n localStorage.removeItem(getPathScopedKey(basePath, key));\n }\n\n getPreviousSpaceId(userId) {\n if (!userId)\n userId = this.getItem('userId');\n return this.getItem(getPreviousSpaceIdKey(userId));\n }\n\n setPreviousSpaceId(userId, spaceId) {\n this.setItem(getPreviousSpaceIdKey(userId), spaceId);\n this.setItem('spaceId', spaceId);\n localStorage.setItem('spaceId', spaceId);\n }\n\n getUserId() {\n return this.getItem('userId')\n }\n\n setUserId(userId, token?:string) {\n if (userId) {\n this.setItem('userId', userId)\n this.setItem('token', token)\n this.setItem(getWasLoggedInKey(), 'true');\n } else {\n this.removeItem('userId')\n this.removeItem('token')\n this.removeItem('spaceId')\n localStorage.removeItem('spaceId');\n this.setItem(getWasLoggedInKey(), 'false');\n }\n }\n\n setWasLoggedIn(wasLoggedIn) {\n if (wasLoggedIn) {\n this.setItem(getWasLoggedInKey(), 'true');\n } else {\n this.setItem(getWasLoggedInKey(), 'false');\n }\n }\n\n getWasLoggedIn() {\n return this.getItem(getWasLoggedInKey()) === 'true';\n }\n}\n\nconst LocalStorageStore = new LocalStorageStoreClass();\n\nif (typeof window !== 'undefined')\n window['LocalStorageStore'] = LocalStorageStore;\n\nexport default LocalStorageStore;\n","import { GlobalState } from \"../../types/store\";\n\nexport function getSpaces(state: GlobalState) {\n return state.entities.spaces.spaces;\n}\n\nexport function getMySpaces(state: GlobalState) {\n return Object.values(state.entities.spaces.spaces);\n}\n\nexport function getSpaceCount(state: GlobalState) {\n return Object.keys(state.entities.spaces.spaces).length;\n}\n\nexport function getCurrentSpace(state: GlobalState) {\n return state.entities.spaces.spaces[getCurrentSpaceId(state)];\n}\n\nexport function getCurrentSpaceId(state: GlobalState) {\n return state.entities.spaces.currentSpaceId;\n}\n\nexport function getSpace(state: GlobalState, spaceId: string) {\n return state.entities.spaces.spaces[spaceId];\n}\n","import {Client4} from '../client';\nimport {GetStateFunc, DispatchFunc, ActionFunc, ActionResult, batchActions, Action} from '../types/actions';\nimport {SpaceTypes, UserTypes} from '../action_types';\nimport {Space, SpaceUser} from '../types/spaces';\nimport {logError} from './errors';\nimport {bindClientFunc, forceLogoutIfNecessary} from './helpers';\nimport LocalStorageStore from '../stores/local_storage_store';\nimport { getCurrentUserId } from '../selectors/entities/users';\nimport { getSpace } from '../selectors/entities/spaces';\nimport { getRootUrl } from '../selectors/settings';\nimport store from '../stores/redux_store';\n\nimport { hashHistory } from \"../utils/hash_history\";\n\nexport function selectSpace(spaceId?: string | null): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const userId = getCurrentUserId(getState());\n if (!userId)\n return {data: false};\n let selectedSpaceId = spaceId;\n \n if (!selectedSpaceId)\n selectedSpaceId = LocalStorageStore.getPreviousSpaceId(userId);\n else {\n const space = getSpace(getState(), selectedSpaceId);\n if (!space)\n return {data: false};\n }\n\n dispatch({\n type: SpaceTypes.SELECT_SPACE,\n data: selectedSpaceId,\n });\n LocalStorageStore.setPreviousSpaceId(userId, selectedSpaceId);\n\n return {data: selectedSpaceId};\n };\n}\n\nexport function getMySpaces(): ActionFunc {\n return bindClientFunc({\n clientFunc: Client4.getMySpaces,\n onRequest: SpaceTypes.MY_SPACES_REQUEST,\n onSuccess: [SpaceTypes.RECEIVED_SPACES_LIST, SpaceTypes.MY_SPACES_SUCCESS],\n onFailure: SpaceTypes.MY_SPACES_FAILURE,\n });\n}\n\n\nexport function createSpace(name: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n let space:any = null;\n\n try {\n space = await Client4.createSpace(name);\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n dispatch(logError(error));\n return {error};\n }\n\n if (space && space._id) {\n const promises = [\n dispatch(getMySpaces()),\n dispatch(selectSpace(space._id)),\n // dispatch(getClientConfig()),\n ];\n \n try {\n await Promise.all(promises);\n } catch (error) {\n return {error};\n }\n }\n\n return {data: space};\n };\n}\n\n\nexport function goSpaceHome(location, spaceId: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const userId: any = LocalStorageStore.getItem('userId');\n const authToken: any = LocalStorageStore.getItem('token');\n const spaceId: any = LocalStorageStore.getItem('spaceId');\n const rootUrl: any = getRootUrl(store.getState());\n\n const searchParams = new URLSearchParams(location.search);\n let redirect_uri = searchParams.get(\"redirect_uri\");\n \n if (redirect_uri){\n if(!redirect_uri.startsWith(\"http://\") && !redirect_uri.startsWith(\"https://\")){\n redirect_uri = window.location.origin + redirect_uri\n }\n let u = new URL(redirect_uri);\n u.searchParams.append('X-Space-Id',spaceId);\n u.searchParams.append('X-Auth-Token',authToken);\n u.searchParams.append('X-User-Id',userId);\n window.location.href = u.toString();\n }\n else{\n window.location.href = rootUrl ? rootUrl : \"/\";\n }\n\n return { data: true };\n }\n}","import { GlobalState } from \"../types/store\";\n\nexport function getRootUrl(state: GlobalState) {\n console.log(state)\n return state.settings.root_url;\n}\n","import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from '../types/actions';\n\nimport { UserTypes } from '../action_types';\nimport { UserProfile } from '../types/users';\nimport { Client4 } from '../client/';\nimport {logError} from './errors';\nimport {bindClientFunc, forceLogoutIfNecessary, debounce} from './helpers';\nimport { getMySpaces, selectSpace } from './spaces';\nimport LocalStorageStore from '../stores/local_storage_store';\n\nexport function createUser(user: UserProfile, token: string, inviteId: string, redirect: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n let created;\n\n try {\n created = await Client4.createUser(user, token, inviteId, redirect);\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n dispatch(logError(error));\n return {error};\n }\n\n dispatch({type: UserTypes.RECEIVED_ME, data: created.user});\n return completeLogin(created)(dispatch, getState);\n };\n}\n\nexport function login(loginId: string, password: string, mfaToken = ''): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.LOGIN_REQUEST, data: null});\n\n const deviceId = getState().entities.general.deviceToken;\n let data;\n\n try {\n data = await Client4.login(loginId, password, mfaToken, deviceId);\n if(data._next){\n return {error: data._next};\n }\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.LOGIN_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return completeLogin(data)(dispatch, getState);\n };\n}\n\n\nfunction completeLogin(data: any): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({\n type: UserTypes.RECEIVED_ME,\n data: data.user,\n });\n Client4.setToken(data.token);\n Client4.setUserId(data.user._id);\n\n if (data.user && data.user._id) {\n LocalStorageStore.setUserId(data.user._id, data.token); \n }\n \n const promises = [\n dispatch(getMySpaces()),\n dispatch(selectSpace()),\n // dispatch(getClientConfig()),\n ];\n\n try {\n await Promise.all(promises);\n } catch (error) {\n dispatch(batchActions([\n {type: UserTypes.LOGIN_FAILURE, error},\n logError(error),\n ]));\n return {error};\n }\n\n dispatch(batchActions([\n {\n type: UserTypes.LOGIN_SUCCESS,\n },\n ]));\n\n\n if(window.ReactNativeWebView && window.ReactNativeWebView.postMessage){\n window.ReactNativeWebView.postMessage(JSON.stringify({\n \"X-Auth-Token\": data.token,\n \"X-User-Id\": data.user._id,\n \"X-Access-Token\": data.tokens.accessToken\n }))\n }\n\n return {data: true, _next: data._next};\n };\n}\n\nexport function loadMe(): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const state = getState();\n\n // const deviceId = state.entities.general.deviceToken;\n // if (deviceId) {\n // Client4.attachDevice(deviceId);\n // }\n\n const promises = [\n dispatch(getMe()),\n dispatch(getMySpaces()),\n dispatch(selectSpace()),\n ];\n\n await Promise.all(promises);\n\n const {currentUserId} = getState().entities.users;\n const user = getState().entities.users.users[currentUserId];\n if (currentUserId) {\n Client4.setUserId(currentUserId);\n }\n\n return {data: true};\n };\n}\n\nexport function logout(): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n dispatch({type: UserTypes.LOGOUT_REQUEST, data: null});\n\n try {\n await Client4.logout();\n } catch (error) {\n // nothing to do here\n }\n\n LocalStorageStore.setUserId(null);\n dispatch({type: UserTypes.LOGOUT_SUCCESS, data: null});\n\n return {data: true};\n };\n}\n\n\nexport function getMe(): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n\n if (!LocalStorageStore.getItem('userId'))\n return {error: 'user not found.'} \n\n const getMeFunc = bindClientFunc({\n clientFunc: Client4.getMe,\n onSuccess: UserTypes.RECEIVED_ME,\n });\n const me = await getMeFunc(dispatch, getState);\n\n if ('error' in me) {\n LocalStorageStore.removeItem('userId');\n return me;\n }\n // if ('data' in me) {\n // dispatch(loadRolesIfNeeded(me.data.roles.split(' ')));\n // }\n return me;\n };\n}\n\nexport function sendVerificationToken(loginId: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const deviceId = getState().entities.general.deviceToken;\n let data;\n \n try {\n data = await Client4.sendVerificationToken(loginId);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.VERIFICATION_TOKEN_RECIEVED,\n error,\n },\n //logError(error),\n ]));\n return {error};\n }\n \n return data;\n };\n }\n \nexport function changePassword(oldPassword: string, newPassword: string){\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.CHANGEPASSWORD_REQUEST, data: null});\n let data;\n try {\n const getChangePasswordFunc = bindClientFunc({\n clientFunc: Client4.changePassword,\n onSuccess: UserTypes.CHANGEPASSWORD_RECEIVED,\n params: [oldPassword, newPassword]\n });\n \n data = await getChangePasswordFunc(dispatch, getState);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.CHANGEPASSWORD_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return data;\n };\n}\n\nexport function verifyEmail(email: string, code: string){\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.VERIFYEMAIL_REQUEST, data: null});\n let data;\n try {\n const getVerifyEmailFunc = bindClientFunc({\n clientFunc: Client4.verifyEmail,\n onSuccess: UserTypes.VERIFYEMAIL_RECEIVED,\n params: [email, code]\n });\n \n data = await getVerifyEmailFunc(dispatch, getState);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.VERIFYEMAIL_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return data;\n };\n}\n\nexport function verifyMobile(mobile: string, code: string){\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.VERIFYMOBILE_REQUEST, data: null});\n let data;\n try {\n const getVerifyMobileFunc = bindClientFunc({\n clientFunc: Client4.verifyMobile,\n onSuccess: UserTypes.VERIFYMOBILE_RECEIVED,\n params: [mobile, code]\n });\n data = await getVerifyMobileFunc(dispatch, getState);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.VERIFYMOBILE_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return data;\n };\n}","import { hashHistory } from \"../utils/hash_history\";\nimport { logout, loadMe } from \"./users\";\nimport store from '../stores/redux_store';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport { getMySpaces, getCurrentSpaceId, getSpace } from '../selectors/entities/spaces';\nimport LocalStorageStore from '../stores/local_storage_store';\nimport { selectSpace } from '../actions/spaces';\n\n\nconst dispatch = store.dispatch;\nconst getState = store.getState;\n\nexport function emitUserLoggedOutEvent(redirectToPath, shouldSignalLogout = true, userAction = true) {\n // If the logout was intentional, discard knowledge about having previously been logged in.\n // This bit is otherwise used to detect session expirations on the login page.\n if (userAction) {\n }\n\n if (!redirectToPath)\n redirectToPath = '/login'\n\n dispatch(logout()).then(() => {\n LocalStorageStore.setUserId(null);\n\n // if (shouldSignalLogout) {\n // BrowserStore.signalLogout();\n // }\n\n // BrowserStore.clear();\n // stopPeriodicStatusUpdates();\n // WebsocketActions.close();\n\n // clearUserCookie();\n\n redirectTo(redirectToPath);\n }).catch((e) => {\n console.log(e);\n redirectTo(redirectToPath);\n });\n}\n\n\nexport async function selectDefaultSpace(location) {\n let state = getState();\n\n // Assume we need to load the user if they don't have any team memberships loaded or the user loaded\n let user = getCurrentUser(state);\n \n if (!user) {\n return;\n }\n \n // const locale = getCurrentLocale(state);\n const spaceId = LocalStorageStore.getPreviousSpaceId(user.id);\n\n const space = getSpace(state, spaceId);\n if (space) {\n dispatch(selectSpace(space._id));\n return space._id;\n } else {\n hashHistory.push({\n pathname: '/select-space',\n search: location.search\n });\n }\n}\n\nexport async function redirectUserToDefaultSpace(location) {\n const spaceId = await selectDefaultSpace(location);\n hashHistory.push({\n pathname: `/home/${spaceId}`,\n search: location.search\n });\n}\n\nexport async function redirectUserToUpdatePassword(location){\n hashHistory.push({\n pathname: '/update-password',\n search: location.search\n });\n}\n\nexport async function redirectUserToVerifyEmail(location){\n hashHistory.push({\n pathname: '/verify/email',\n search: location.search\n });\n}\n\nexport async function redirectUserToVerifyMobile(location){\n hashHistory.push({\n pathname: '/verify/mobile',\n search: location.search\n });\n}\n\nexport function redirectTo(redirectTo, location) {\n\n if (!redirectTo) \n return;\n\n if (redirectTo && redirectTo.indexOf('no_redirect=1')<0) {\n const userId = LocalStorageStore.getItem('userId');\n const authToken = LocalStorageStore.getItem('token');\n const spaceId = LocalStorageStore.getItem('spaceId');\n \n redirectTo = redirectTo.indexOf(\"?\")>0?redirectTo+'&no_redirect=1':redirectTo+'?no_redirect=1'\n if (userId && authToken){\n redirectTo = `${redirectTo}&X-Auth-Token=${authToken}&X-User-Id=${userId}&X-Space-Id=${spaceId}`\n }\n\n if (redirectTo.match(/^\\/([^/]|$)/)){\n if(location){\n hashHistory.push({\n pathname: redirectTo,\n search: location.search\n })\n }else{\n hashHistory.push(redirectTo);\n }\n }\n else\n document.location.href=redirectTo\n }\n\n}\n\nexport function finishSignin(currentUser, tenant, location){\n let password_expired = currentUser.password_expired;\n if(password_expired){\n redirectUserToUpdatePassword(location);\n return;\n }\n \n let enable_bind_mobile = tenant.enable_bind_mobile;\n if(enable_bind_mobile && !currentUser.mobile_verified){\n redirectUserToVerifyMobile(location);\n return;\n }\n\n let enable_bind_email = tenant.enable_bind_email;\n if(enable_bind_email && !currentUser.email_verified){\n redirectUserToVerifyEmail(location);\n return;\n }\n\n if(location){\n hashHistory.push({\n pathname: '/home',\n search: location.search\n })\n }else{\n hashHistory.push('/home');\n }\n // let redirect_uri = new URLSearchParams(location?location.search:\"\").get('redirect_uri')\n // if (!redirect_uri)\n // redirect_uri = '/'\n // redirectTo(redirect_uri, location);\n}","\nimport * as UserActions from '../actions/users';\nimport { loadSettings } from '../actions/settings';\nimport LocalStorageStore from '../stores/local_storage_store';\nimport {Client4} from '../client';\n\nexport function loadMeAndConfig() {\n return async (dispatch) => {\n\n const token = LocalStorageStore.getItem('token')\n if (token)\n Client4.setToken(token);\n\n // if any new promise needs to be added please be mindful of the order as it is used in root.jsx for redirection\n const promises = [\n dispatch(loadSettings()),\n // dispatch(getLicenseConfig()),\n ];\n\n // // need to await for clientConfig first as it is required for loadMe\n const resolvedPromises = await Promise.all(promises);\n if (LocalStorageStore.getWasLoggedIn()) {\n resolvedPromises.push(await dispatch(UserActions.loadMe()));\n }\n\n return resolvedPromises;\n };\n}","\n\nimport { Client4 } from \"../client\";\nimport { loadMe } from \"./users\";\nimport { GeneralState } from \"../types/general\";\nimport { GeneralTypes } from \"../action_types\";\nimport {bindClientFunc, forceLogoutIfNecessary, FormattedError} from './helpers';\nimport {GetStateFunc, DispatchFunc, ActionFunc, batchActions} from '../types/actions';\n\nexport function loadSettings(): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n let data;\n try {\n data = await Client4.getSettings();\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n return {error};\n }\n\n Client4.setEnableLogging(data.EnableDeveloper === 'true');\n Client4.setDiagnosticId(data.DiagnosticId);\n\n dispatch({\n type: GeneralTypes.RECEIVED_SETTINGS,\n data: data,\n });\n\n return {data};\n };\n}","import React, { useState, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport Backdrop from '@material-ui/core/Backdrop';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport { getRequests } from '../selectors'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n backdrop: {\n zIndex: theme.zIndex.drawer + 1,\n color: '#fff',\n backgroundColor: 'rgba(0, 0, 0, 0.0)',\n },\n }),\n);\n\nconst Loading = ({ requests }: any) =>{\n const classes = useStyles({});\n const [open, setOpen] = React.useState(false);\n const handleClose = () => {\n setOpen(false);\n };\n const handleOpen = () => {\n setOpen(true);\n };\n\n useEffect(() => {\n if(requests.status === 'started'){\n handleOpen();\n }else{\n handleClose();\n }\n }, [requests]);\n\n return (\n <div>\n <Backdrop className={classes.backdrop} open={open}>\n <CircularProgress />\n </Backdrop>\n </div>\n );\n}\n\n\nfunction mapStateToProps(state: any) {\n return {\n requests: getRequests(state)\n };\n }\n \nexport default connect(mapStateToProps)(Loading);","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport * as GlobalActions from '../actions/global_actions';\nimport Loading from './Loading';\n\nclass LoggedIn extends React.PureComponent {\n\n static propTypes = {\n currentUser: PropTypes.object,\n }\n\n constructor(props, context) {\n super(props, context);\n }\n\n isValidState() {\n return this.props.currentUser != null;\n }\n \n componentDidMount() {\n\n // Tell the desktop app the webapp is ready\n window.postMessage(\n {\n type: 'webapp-ready',\n },\n window.location.origin,\n );\n\n if (!this.props.currentUser) {\n GlobalActions.emitUserLoggedOutEvent('/login?redirect_to=' + encodeURIComponent(this.props.location.pathname), true, false);\n }\n }\n render() {\n if (!this.isValidState()) {\n return <Loading/>;\n }\n\n return this.props.children;\n }\n}\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(LoggedIn);","import React, { SyntheticEvent } from 'react';\nimport { SnackbarContent } from '@material-ui/core';\nimport { amber, green } from '@material-ui/core/colors';\nimport {FormattedMessage} from 'react-intl';\nimport clsx from 'clsx';\nimport CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutline from '@material-ui/icons/ErrorOutline';\nimport InfoOutlined from '@material-ui/icons/InfoOutlined';\nimport WarningOutlined from '@material-ui/icons/WarningOutlined';\nimport { makeStyles, Theme, withStyles, lighten, darken } from '@material-ui/core/styles';\n\nconst variantIcon:any = {\n success: CheckCircleOutline,\n warning: WarningOutlined,\n error: ErrorOutline,\n info: InfoOutlined,\n};\n\nconst useStyles1 = makeStyles((theme: Theme) => {\n\n const getColor = theme.palette.type === 'light' ? darken : lighten;\n const getBackgroundColor = theme.palette.type === 'light' ? lighten : darken;\n\n return ({\n success: {\n backgroundColor: green[600],\n },\n error: {\n color: getColor(theme.palette.error.main, 0.6),\n backgroundColor: getBackgroundColor(theme.palette.error.main, 0.9),\n '& $icon': {\n color: theme.palette.error.main,\n },\n },\n info: {\n color: getColor(theme.palette.primary.main, 0.6),\n backgroundColor: getBackgroundColor(theme.palette.primary.main, 0.9),\n '& $icon': {\n color: theme.palette.primary.main,\n },\n },\n warning: {\n color: getColor(amber[700], 0.6),\n backgroundColor: getBackgroundColor(amber[700], 0.9),\n '& $icon': {\n color: amber[700],\n },\n },\n icon: {\n fontSize: 20,\n },\n iconVariant: {\n opacity: 0.9,\n marginRight: theme.spacing(1),\n },\n message: {\n display: 'flex',\n alignItems: 'center',\n },\n })\n});\n\nexport interface Props {\n className?: string;\n message: string;\n onClose?: () => void;\n variant: keyof typeof variantIcon;\n}\n\nfunction MySnackbarContentWrapper(props: Props) {\n const classes: any = useStyles1({});\n const { className, message, onClose, variant, ...other } = props;\n const Icon = variantIcon[variant];\n return (\n <SnackbarContent elevation={0}\n className={clsx(classes[variant], className)}\n aria-describedby=\"client-snackbar\"\n message={\n <span id=\"client-snackbar\" className={classes.message}>\n <Icon className={clsx(classes.icon, classes.iconVariant)} />\n <FormattedMessage\n id={message}\n defaultMessage={message}\n values={{\n mobile_help: (...chunks: any) => (\n <a className=\"external_link\" target=\"_blank\" href=\"https://developer.steedos.com/developer/steedos_config/#%E5%8F%91%E9%80%81%E7%9F%AD%E4%BF%A1%E9%85%8D%E7%BD%AE\">\n {chunks}\n </a>\n ),\n email_help: (...chunks: any) => (\n <a className=\"external_link\" target=\"_blank\" href=\"https://developer.steedos.com/developer/steedos_config/#%E9%82%AE%E4%BB%B6%E9%85%8D%E7%BD%AE\">\n {chunks}\n </a>\n )\n }}\n /> \n </span>\n }\n // action={[\n // <IconButton key=\"close\" aria-label=\"close\" color=\"inherit\" onClick={onClose}>\n // <Close className={classes.icon} />\n // </IconButton>,\n // ]}\n {...other}\n />\n );\n}\n\nconst useStyles2 = makeStyles((theme: Theme) => ({\n margin: {\n // marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n}));\n\nconst useStyles = makeStyles({\n formError: {\n color: 'red',\n },\n});\n\n// interface Props {\n// error: string;\n// }\n\nconst FormError = ({ error, variant}: any) => {\n const classes = useStyles2({});\n let _variant = variant || \"error\";\n return <MySnackbarContentWrapper\n variant= {_variant}\n className={classes.margin}\n message={error}\n/>;\n};\n\nexport default FormError;\n","import * as React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport Logo from './Logo';\nimport { localizeMessage } from '../utils/utils';\n\nclass Card extends React.Component {\n render() {\n return (\n<div className=\"flex sm:items-center justify-center mx-auto overflow-auto md:p-10 h-full\">\n <div className=\"relative rounded p-11 sm:shadow-md bg-white w-screen max-w-md\">\n {this.props.children}\n </div>\n <div className=\"absolute bottom-0 left-0 right-0 text-center m-2 text-gray-500 text-sm\">\n <FormattedMessage\n id='accounts.copyright'\n defaultMessage='© 2020 salesforce.com, inc.'\n /> \n <span className=\"ml-1 mr-1\"> | </span>\n <a className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\"\n href=\"javascript:void(0)\" onClick={this.openPrivacyPage}>\n <FormattedMessage\n id='accounts.privacy'\n defaultMessage='Privacy'\n /> \n </a>\n </div>\n</div>\n )\n }\n\n openPrivacyPage = async () => {\n const href=localizeMessage('accounts.privacyURL');\n if(window && window.AppBrowserOpen){\n // TODO:暂时没效果,等webapp包整合到meteor中再处理\n window.AppBrowserOpen(href, \"_blank\");\n }\n else{\n window.open(href);\n }\n };\n}\n\nfunction mapStateToProps(state: any) {\n return {\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(Card);","import * as React from 'react';\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport { Client4 } from '../client';\nimport { localizeMessage } from '../utils/utils';\n\ninterface Props {\n logoUrl?: string;\n}\n\nconst Logo = ({ tenant, location }: any) => {\n let logoUrl = `${Client4.getUrl()}${localizeMessage('accounts.logoURL')}`;\n if (tenant.logo_url) {\n logoUrl = tenant.logo_url\n }\n return (<div>\n <img src={logoUrl} className='h-10'></img>\n </div>\n )\n};\n\nfunction mapStateToProps(state: any) {\n return {\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(Logo);","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Client4 } from '../client';\nimport { getTenant } from '../selectors';\n\nconst Background = ({ tenant, location }: any) => {\n let backgroundUrl = `${Client4.getUrl()}/images/background.svg`;\n if (tenant.background_url) {\n backgroundUrl = tenant.background_url \n }\n let backgroundColor = '#f8f8f8';\n if (tenant.background_color) {\n backgroundColor = tenant.background_color \n }\n\n const style = (window.innerWidth > 640)?{\n backgroundImage: 'url('+backgroundUrl+')',\n backgroundColor: backgroundColor\n }:{}\n\n return (\n <div className=\"\">\n <div className=\"fixed bg-white justify-center mx-auto h-full w-full\" style={style}>\n </div> \n </div>\n )\n};\n\nfunction mapStateToProps(state) {\n return {\n tenant: getTenant(state),\n };\n}\nexport default connect(mapStateToProps)(Background);","import React, { useEffect, useRef } from 'react'\n\nconst InputPassword = React.forwardRef((props: any, ref?: React.Ref<HTMLInputElement>) => {\n\n const selfInputRef = useRef<HTMLInputElement>();\n const inputRef = ref || selfInputRef;\n\n const clearPasswordValueAttribute = () => {\n return setTimeout(() => {\n const input = (inputRef as any).current;\n if (\n input &&\n input.getAttribute('type') === 'password' &&\n input.hasAttribute('value')\n ) {\n input.removeAttribute('value');\n }\n }, 50);\n };\n\n const handlePasswordFocus = (e: any) => {\n const { onFocus } = props;\n clearPasswordValueAttribute();\n onFocus?.(e);\n\n }\n\n const handlePasswordBlur = (e: any) => {\n const { onBlur } = props;\n clearPasswordValueAttribute();\n onBlur?.(e);\n\n }\n\n useEffect(() => {\n const timer = clearPasswordValueAttribute();\n return () => {\n clearTimeout(timer)\n }\n }, [props.value, props.type]);\n\n clearPasswordValueAttribute();\n\n return (\n <input \n {...props}\n ref={inputRef}\n onFocus={handlePasswordFocus}\n onBlur={handlePasswordBlur}\n />\n );\n});\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\nimport InputPassword from './InputPassword';\n\ntype Props = {\n placeholder: {\n id: string;\n defaultMessage: string;\n values?: {string: any};\n };\n value?: string;\n disabled?: boolean;\n type?: string;\n};\n\nconst LocalizedInput = React.forwardRef((props: Props, ref?: React.Ref<HTMLInputElement>) => {\n const {placeholder, ...otherProps} = props;\n\n return (\n <FormattedMessage\n id={placeholder.id}\n defaultMessage={placeholder.defaultMessage}\n values={placeholder.values}\n >\n {(localizedPlaceholder: (string | JSX.Element)) => (\n otherProps.type === \"password\" ? (\n <InputPassword \n {...otherProps}\n ref={ref}\n placeholder={localizedPlaceholder as string}\n />\n ) : (\n <input\n {...otherProps}\n ref={ref}\n placeholder={localizedPlaceholder as string}\n />\n )\n )}\n </FormattedMessage>\n );\n});\nLocalizedInput.displayName = 'LocalizedInput';\n\nexport default LocalizedInput;\n","import React, { useEffect, useCallback, useState, useMemo } from 'react'\n\ntype Options = {\n total?: number\n lifecycle?: 'always' | 'session'\n}\n\nconst useCountDown = (\n timerKey: string,\n options: Options\n) => {\n const [addData, getData] = useMemo(() => {\n const total = options.total || 60\n const lifecycle = options.lifecycle || 'session'\n const saveKey = `__${timerKey}`\n const getSaveData = () => '' + (Date.now() + total * 1000)\n let getter, setter\n switch (lifecycle) {\n case 'always':\n setter = () => localStorage.setItem(saveKey, getSaveData())\n getter = () => localStorage.getItem(saveKey)\n break\n case 'session':\n setter = () => sessionStorage.setItem(saveKey, getSaveData())\n getter = () => sessionStorage.getItem(saveKey)\n break\n }\n return [setter, getter] as [() => undefined, () => string | null | number]\n }, [options, timerKey])\n\n const resetCountDown = useCallback(() => {\n addData()\n }, [addData])\n\n const getRestTime = useCallback(() => {\n let expiredTime: string | null | number = getData()\n if (!expiredTime) {\n return 0\n } else {\n expiredTime = +expiredTime\n if (isNaN(expiredTime)) {\n return 0\n } else {\n const restTime = Math.floor(((expiredTime - Date.now()) / 1000))\n return restTime < 0 ? 0 : restTime\n }\n }\n }, [getData])\n\n const [restTime, setRestTime] = useState(getRestTime())\n\n useEffect(() => {\n const timer = setInterval(() => {\n const newRestTime = getRestTime()\n if (restTime !== newRestTime) {\n setRestTime(newRestTime)\n }\n }, 500)\n return () => {\n clearInterval(timer)\n }\n }, [getRestTime, restTime])\n\n return [\n restTime,\n resetCountDown\n ] as [number, () => undefined]\n}\n\nconst CountDownProvider = ({ id, children, options }: {\n id: string,\n options: Options,\n children: (restTime: number, resetCountDown: () => undefined) => any\n}) => {\n const [restTime, resetCountDown] = useCountDown(id, options)\n return children(restTime, resetCountDown)\n}\n\nexport { useCountDown, CountDownProvider }","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators, Dispatch, AnyAction } from 'redux';\nimport { createUser, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if(onClick){\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code' \n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass Signup extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n let email = '';\n if ((new URLSearchParams(this.props.location.search)).get('email')) {\n email = (new URLSearchParams(this.props.location.search)).get('email');\n }\n let mobile = '';\n if ((new URLSearchParams(this.props.location.search)).get('mobile')) {\n mobile = (new URLSearchParams(this.props.location.search)).get('mobile');\n }\n let invite_token = '';\n if ((new URLSearchParams(this.props.location.search)).get('invite_token')) {\n invite_token = (new URLSearchParams(this.props.location.search)).get('invite_token');\n }\n\n let spaceId = this.props.settingsTenantId\n\n this.state = {\n // ldapEnabled: this.props.isLicensed && this.props.enableLdap,\n // samlEnabled: this.props.isLicensed && this.props.enableSaml,\n invite_token,\n spaceId,\n email,\n mobile,\n userId: '',\n password: '',\n verifyCode: '',\n sessionExpired: false,\n loginSuccess: false,\n\n loginByEmail: false,\n loginByMobile: false,\n loginBy: \"mobile\",\n \n loginWithCode: false,\n loginWithPassword: false,\n\n serverError: '',\n loading: false\n\n // brandImageError: false,\n };\n\n \n \n if (this.props.tenant.enable_mobile_code_login && this.props.tenant.enable_email_code_login) {\n this.state.loginWithCode = true;\n this.state.loginByEmail = true;\n this.state.loginByMobile = true;\n this.state.loginBy = \"mobile\"\n } else if (this.props.tenant.enable_mobile_code_login) {\n this.state.loginWithCode = true\n this.state.loginByMobile = true;\n this.state.loginByEmail = false;\n this.state.loginBy = \"mobile\"\n } else if (this.props.tenant.enable_email_code_login) {\n this.state.loginWithCode = true\n this.state.loginByMobile = false;\n this.state.loginByEmail = true;\n this.state.loginBy = \"email\"\n } else if (this.props.tenant.enable_password_login) {\n this.state.loginWithPassword = true\n this.state.loginByEmail = true;\n this.state.loginByMobile = false;\n this.state.loginBy = \"email\"\n } \n\n // this.state.loginWithCode = false\n // this.state.loginWithPassword = true\n // this.state.loginByMobile = true;\n // this.state.loginByEmail = true;\n // this.state.loginBy = \"email\"\n\n this.emailInput = React.createRef();\n this.mobileInput = React.createRef();\n this.passwordInput = React.createRef();\n\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage('accounts.signup') + ` | ${this.props.tenant.name}`;\n\n\n }\n\n createLoginPlaceholder = () => {\n\n let inputLabel = '';\n if (this.state.loginBy == \"mobile\")\n inputLabel = 'accounts.mobile';\n else if (this.state.loginBy == \"email\") \n inputLabel = 'accounts.email';\n \n return Utils.localizeMessage(inputLabel)\n }\n\n handleEmailChange = (e) => {\n this.setState({\n email: e.target.value,\n });\n }\n\n handleNameChange = (e) => {\n this.setState({\n name: e.target.value,\n });\n }\n\n switchLoginByMobile = (e) => {\n this.setState({\n loginBy: 'mobile',\n });\n }\n\n switchLoginByEmail = (e) => {\n this.setState({\n loginBy: 'email',\n });\n }\n\n tabColor = (tab) => {\n if (this.state.loginBy === tab)\n return \"text-blue-600 hover:text-blue-700 border-blue-600 hover:border-blue-300\"\n else\n return \"text-gray-600 hover:text-gray-500 hover:border-gray-300\"\n }\n\n handleMobileChange = (e) => {\n this.setState({\n mobile: e.target.value,\n });\n }\n\n handlePasswordChange = (e) => {\n this.setState({\n password: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n goLogin = ()=>{\n let state = {\n email: this.state.email,\n mobile: this.state.mobile,\n };\n this.props.history.push({\n pathname: `/login`,\n search: this.props.location.search,\n state: state\n })\n }\n\n sendVerificationToken = (e) => {\n\n this.setState({serverError: null, loading: true});\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && !this.state.mobile.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.loginBy === 'email'?this.state.email.trim():'',\n mobile: this.state.loginBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n this.state.userId = userId;\n // if (!userId)\n // this.setState({\n // serverError: (\n // <FormattedMessage\n // id='accounts.userNotFound'\n // defaultMessage='User not found.'\n // />\n // ),\n // });\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.setState({error: null});\n\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && !this.state.mobile.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n if (!this.state.name || !this.state.name.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.nameRequired'\n />\n ),\n });\n return\n }\n\n // if(!this.state.password.trim()){\n // throw new Error('accounts.passwordRequired');\n // }\n\n const user = {\n password: this.state.password?this.state.password.trim():this.state.password,\n name: this.state.name.trim(),\n locale: Utils.getBrowserLocale(),\n verifyCode: this.state.verifyCode?this.state.verifyCode.trim():this.state.verifyCode,\n }\n\n if(this.state.spaceId){\n user.spaceId = this.state.spaceId;\n }\n \n if(this.state.invite_token){\n user.invite_token = this.state.invite_token\n }\n\n if (this.state.loginBy === 'mobile'){\n user.mobile = this.state.mobile\n } else if (this.state.loginBy === 'email'){\n user.email = this.state.email\n }\n this.props.actions.createUser(user).then(async ({error, _next}) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finishSignin(_next);\n });\n };\n\n\n finishSignin = (_next) => {\n if(_next === 'TO_VERIFY_MOBILE'){\n const location = this.props.location;\n return GlobalAction.redirectUserToVerifyMobile(location)\n }\n\n const query = new URLSearchParams(this.props.location.search);\n const redirectTo = query.get('redirect_to');\n\n // Utils.setCSRFFromCookie();\n\n // Record a successful login to local storage. If an unintentional logout occurs, e.g.\n // via session expiration, this bit won't get reset and we can notify the user as such.\n\n if (redirectTo && redirectTo.match(/^\\/([^/]|$)/)) {\n this.props.history.push(redirectTo);\n // } else if (team) {\n // browserHistory.push(`/${team.name}`);\n } else {\n this.state.loginSuccess = true;\n GlobalAction.redirectUserToDefaultSpace(this.props.location);\n \n }\n }\n\n goSignup = ()=>{\n let state = {};\n if(this.state.email.trim().length > 0){\n state = { email: this.state.email.trim() }\n }\n this.props.history.push({\n pathname: `/signup`,\n search: this.props.location.search,\n state: state\n })\n }\n\n\n render() {\n\n return (\n <>\n <Background/>\n <Card>\n <Logo/>\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id='accounts.signup'\n defaultMessage='Sign Up'\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n {/* {this.state.loginByMobile && this.state.loginByEmail && (\n <nav className=\"flex -mb-px py-2\">\n {this.state.loginByMobile && (\n <button\n type='button'\n onClick={this.switchLoginByMobile}\n className={\"group inline-flex items-center py-1 px-1 border-b-2 border-transparent font-medium text-sm leading-5 focus:outline-none \" + this.tabColor('mobile')}>\n <span>\n <FormattedMessage\n id='accounts.mobile'\n defaultMessage='Mobile'\n />\n </span>\n </button>\n )}\n {this.state.loginByEmail && (\n <button\n type='button'\n onClick={this.switchLoginByEmail}\n className={\"ml-8 group inline-flex items-center py-1 px-1 border-b-2 border-transparent font-medium text-sm leading-5 focus:outline-none \" + this.tabColor('email')}>\n <span>\n <FormattedMessage\n id='accounts.email'\n defaultMessage='Email'\n />\n </span>\n </button>)\n }\n </nav>\n )} */}\n \n <div className=\"rounded-md shadow-sm my-2\">\n {this.state.loginBy === 'email' && (\n <div>\n <LocalizedInput \n id=\"email\"\n name=\"email\" \n ref={this.emailInput}\n value={this.state.email}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.email_placeholder', defaultMessage: 'Please enter email'}}\n onChange={this.handleEmailChange}\n />\n </div>\n )}\n\n {this.state.loginBy === 'mobile' && (\n <div>\n <LocalizedInput \n id=\"mobile\"\n name=\"mobile\" \n ref={this.mobileInput}\n value={this.state.mobile}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.mobile_placeholder', defaultMessage: 'Please enter mobile'}}\n onChange={this.handleMobileChange}\n />\n </div>\n )}\n\n <div className=\"-mt-px\">\n <LocalizedInput \n type=\"password\"\n id=\"password\"\n name=\"password\" \n autocomplete=\"new-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.password_create', defaultMessage: 'Set Password'}}\n onChange={this.handlePasswordChange}\n />\n </div>\n\n {this.state.loginWithCode && (\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput \n id=\"verifyCode\"\n name=\"verifyCode\" \n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.verifyCode', defaultMessage: 'Verify Code'}}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile}/>\n\n </div>\n )}\n\n <div className=\"-mt-px\">\n <LocalizedInput \n id=\"name\"\n name=\"name\" \n value={this.state.name}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.name_placeholder', defaultMessage: 'Name'}}\n onChange={this.handleNameChange}\n />\n </div>\n </div>\n \n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n {this.state.loginByEmail && this.state.loginBy === 'mobile' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginByEmail}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_email'\n defaultMessage='Use email'\n />\n </button>\n </div>\n )}\n\n {this.state.loginByMobile && this.state.loginBy === 'email' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginByMobile}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_mobile'\n defaultMessage='Use mobile'\n />\n </button>\n </div>\n )}\n <div className=\"text-sm leading-5 my-4\">\n <FormattedMessage\n id='accounts.has_account'\n defaultMessage='Has Account?'\n />\n <button type=\"button\" onClick={this.goLogin}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.signin'\n defaultMessage='Login'\n />\n </button>\n </div>\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n getCurrentUserId: getCurrentUserId(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n createUser,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(Signup));\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators, Dispatch, AnyAction } from 'redux';\nimport { login, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId, getCurrentUser } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\nimport LocalStorageStore from '../stores/local_storage_store';\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium rounded-br-md bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if(onClick){\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code' \n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass Login extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n let email = '';\n if ((new URLSearchParams(this.props.location.search)).get('email')) {\n email = (new URLSearchParams(this.props.location.search)).get('email');\n }\n let spaceId = '';\n if ((new URLSearchParams(this.props.location.search)).get('X-Space-Id')) {\n spaceId = (new URLSearchParams(this.props.location.search)).get('email');\n } else if (this.props.settingsTenantId) {\n spaceId = this.props.settingsTenantId\n }\n\n this.state = {\n // ldapEnabled: this.props.isLicensed && this.props.enableLdap,\n // samlEnabled: this.props.isLicensed && this.props.enableSaml,\n spaceId,\n email,\n username: '',\n mobile: '',\n loginId: '',\n userId: '',\n password: '',\n verifyCode: '',\n sessionExpired: false,\n loginSuccess: false,\n\n loginByEmail: true,\n loginByMobile: true,\n loginBy: \"mobile\",\n \n loginWith: this.props.tenant.enable_password_login? 'password':'code',\n loginWithCode: this.props.tenant.enable_mobile_code_login || this.props.tenant.enable_email_code_login,\n loginWithPassword: this.props.tenant.enable_password_login,\n\n serverError: '',\n loading: false,\n MFA: false,\n // brandImageError: false,\n };\n\n \n \n // if (this.props.tenant.enable_mobile_code_login || this.props.tenant.enable_email_code_login) {\n // this.state.loginWithCode = true;\n // this.state.loginByEmail = true;\n // this.state.loginByMobile = true;\n // this.state.loginBy = \"mobile\"\n // } else if (this.props.tenant.enable_mobile_code_login) {\n // this.state.loginWithCode = true\n // this.state.loginByMobile = true;\n // this.state.loginByEmail = false;\n // this.state.loginBy = \"mobile\"\n // } else if (this.props.tenant.enable_email_code_login) {\n // this.state.loginWithCode = true\n // this.state.loginByMobile = false;\n // this.state.loginByEmail = true;\n // this.state.loginBy = \"email\"\n // } else if (this.props.tenant.enable_password_login) {\n // this.state.loginWithPassword = true\n // this.state.loginByEmail = true;\n // this.state.loginByMobile = true;\n // this.state.loginBy = \"email\"\n // } \n\n // this.state.loginWithCode = false\n // this.state.loginWithPassword = true\n // this.state.loginByMobile = true;\n // this.state.loginByEmail = true;\n // this.state.loginBy = \"email\"\n\n this.emailInput = React.createRef();\n this.mobileInput = React.createRef();\n this.passwordInput = React.createRef();\n\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage('accounts.signin') + ` | ${this.props.tenant.name}`;\n\n\n }\n\n createLoginPlaceholder = () => {\n\n let inputLabel = '';\n if (this.state.loginBy == \"mobile\")\n inputLabel = 'accounts.mobile';\n else if (this.state.loginBy == \"email\") \n inputLabel = 'accounts.email';\n \n return Utils.localizeMessage(inputLabel)\n }\n\n handleLoginIdChange = (e) => {\n const loginId = e.target.value;\n if(this.state.MFA){\n this.setState({\n loginId,\n mobile: e.target.value,\n username: null,\n email: null,\n loginBy: 'mobile'\n });\n return;\n }\n if (loginId.indexOf('@') > 0) {\n this.setState({\n loginId,\n email: e.target.value,\n username: null,\n mobile: null,\n loginBy: 'email'\n });\n } else {\n if(new RegExp('^[0-9]{11}$').test(e.target.value)){\n this.setState({\n loginId,\n mobile: e.target.value,\n username: null,\n email: null,\n loginBy: 'mobile'\n });\n }else{\n this.setState({\n loginId,\n username: e.target.value,\n mobile: null,\n email: null,\n loginBy: 'username'\n });\n }\n }\n }\n\n handlePasswordChange = (e) => {\n this.setState({\n password: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n switchLoginWithCode = (e) => {\n this.setState({\n loginWith: 'code',\n });\n }\n\n switchLoginWithPassword = (e) => {\n this.setState({\n loginWith: 'password',\n });\n }\n\n sendVerificationToken = (e) => {\n\n this.setState({serverError: null, loading: true});\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && (!this.state.mobile || !this.state.mobile.trim() || !new RegExp('^[0-9]{11}$').test(this.state.mobile))){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.loginBy === 'email'?this.state.email.trim():'',\n mobile: this.state.loginBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n this.state.userId = userId;\n if (!userId)\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.userNotFound'\n defaultMessage='User not found.'\n />\n ),\n });\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.setState({error: null});\n\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && !this.state.mobile.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n // if(!this.state.password.trim()){\n // throw new Error('accounts.passwordRequired');\n // }\n\n const user = {\n email: this.state.loginBy === 'email'?this.state.email.trim():'',\n mobile: this.state.loginBy === 'mobile'?this.state.mobile.trim():'',\n username: (this.state.loginWith === 'password' && this.state.loginBy === 'username')?this.state.username.trim():'',\n spaceId: this.state.spaceId,\n }\n this.props.actions.login(user, this.state.password?this.state.password.trim():this.state.password, this.state.verifyCode?this.state.verifyCode.trim():this.state.verifyCode).then(async (args) => {\n const {error} = args;\n if(error === 'TO_MOBILE_CODE_LOGIN'){\n return this.setState({\n loginByEmail: false,\n loginByMobile: true,\n loginBy: \"mobile\",\n loginWith: 'code',\n MFA: true,\n loginId: '',\n email: null,\n username: null\n });\n }else if(error === 'TO_VERIFY_MOBILE'){\n const location = this.props.location;\n GlobalAction.redirectUserToVerifyMobile(location)\n }\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finishSignin();\n \n });\n };\n\n\n finishSignin = (team) => {\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n }\n\n goSignup = ()=>{\n let state = {};\n if(this.state.email && this.state.email.trim().length > 0){\n state = { email: this.state.email.trim() }\n }\n\n if(this.state.mobile && this.state.mobile.trim().length > 0){\n state = { mobile: this.state.mobile.trim() }\n }\n this.props.history.push({\n pathname: `/signup`,\n search: this.props.location.search,\n state: state\n })\n }\n\n render() {\n\n return (\n <>\n <Background/>\n <Card>\n <Logo/>\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n {this.state.MFA && <FormattedMessage\n id='accounts.signin-MFA'\n defaultMessage='Multi-Factor Authentication'\n />}\n {!this.state.MFA && <FormattedMessage\n id='accounts.signin'\n defaultMessage='Login'\n />}\n \n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n <div>\n <LocalizedInput \n id=\"loginId\"\n name=\"loginId\" \n ref={this.loginIdInput}\n value={this.state.loginId}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={this.state.MFA ? {id: 'accounts.mobile', defaultMessage: 'Mobile'} : {id: 'accounts.email_mobile', defaultMessage: 'Email or mobile'}}\n onChange={this.handleLoginIdChange}\n />\n </div>\n\n {this.state.loginWith == 'password' && (\n <div className=\"-mt-px\">\n <LocalizedInput \n type=\"password\"\n id=\"password\"\n name=\"password\" \n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.password_placeholder', defaultMessage: 'Password'}}\n onChange={this.handlePasswordChange}\n autocomplete=\"new-password\"\n />\n </div>\n )}\n\n {this.state.loginWith == 'code' && (\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput \n id=\"verifyCode\"\n name=\"verifyCode\" \n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-bl-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.verifyCode', defaultMessage: 'Verify Code'}}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile}/>\n\n </div>\n )}\n </div>\n \n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n\n {!this.state.MFA && this.state.loginWithPassword && this.state.loginWith === 'code' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginWithPassword}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_password'\n defaultMessage='Login with password'\n />\n </button>\n </div>\n )}\n\n {this.state.loginWithCode && this.state.loginWith === 'password' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginWithCode}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_code'\n defaultMessage='Login with verfiy code'\n />\n </button>\n </div>\n )}\n\n {!this.state.MFA && this.props.tenant.enable_register &&\n <div className=\"text-sm leading-5 my-4\">\n <FormattedMessage\n id='accounts.no_account'\n defaultMessage='No Account?'\n />\n <button type=\"button\" onClick={this.goSignup}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.signup'\n defaultMessage='Sign Up'\n />\n </button>\n </div>}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n getCurrentUserId: getCurrentUserId(state),\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n login,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(Login));\n","import React, { useState, useEffect } from 'react';\nimport {bindActionCreators} from 'redux';\nimport { RouteComponentProps, Link } from 'react-router-dom';\nimport { Button, Typography } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/styles';\nimport {FormattedMessage} from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getTenant, getSettings } from '../selectors';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport { getCurrentSpace, currentSpaceId } from \"../selectors/entities/spaces\";\nimport { logout } from '../actions/users';\nimport { hashHistory } from \"../utils/hash_history\";\nimport * as GlobalAction from '../actions/global_actions';\n\nclass Logout extends React.PureComponent {\n\n\n constructor(props, context) {\n super(props, context);\n }\n\n componentDidMount() {\n\n let redirect_uri = new URLSearchParams(this.props.location.search).get('redirect_uri')\n if (!redirect_uri)\n redirect_uri = '/login'\n GlobalAction.emitUserLoggedOutEvent(redirect_uri);\n }\n\n render() {\n return null\n }\n};\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n logout,\n }, dispatch),\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Logout);","import * as React from 'react';\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport { Transition } from '@tailwindui/react'\nimport { useState } from 'react'\nimport * as GlobalActions from '../actions/global_actions';\nimport Logo from './Logo';\n\nconst Navbar = ({ tenant, user }: any) => {\n const [menuOpen, setMenuOpen] = useState(false)\n\n const onLogout = async () => {\n GlobalActions.emitUserLoggedOutEvent();\n };\n\n // document.onclick=() => {if (menuOpen) setMenuOpen(false)}\n\n return (\n<div>\n <nav className=\"bg-white shadow border-gray-200\">\n <div className=\"mx-auto px-4 sm:px-6 lg:px-8\">\n <div className=\"flex items-center justify-between h-15\">\n <div className=\"flex items-center\">\n <div className=\"flex-shrink-0\">\n <a href=\"/\">\n <Logo/>\n </a>\n </div>\n <div className=\"hidden md:block\">\n <div className=\"ml-10 flex items-baseline space-x-4\">\n {/* <a href=\"/\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-900 focus:outline-none hover:bg-gray-200 focus:text-gray-700\">Home</a>\n \n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Team</a>\n\n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Projects</a>\n\n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Calendar</a>\n\n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Reports</a> */}\n </div>\n </div>\n </div>\n <div className=\"md:block\">\n <div className=\"ml-4 flex items-center md:ml-6\">\n <a href=\"https://www.steedos.com/help/\" target=\"_blank\" className=\"p-1 text-cool-gray-400 rounded-full hover:bg-cool-gray-100 hover:text-cool-gray-500 focus:outline-none focus:shadow-outline focus:text-cool-gray-500\" aria-label=\"Notifications\">\n <svg className=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </a>\n\n <div className=\"ml-3 relative\">\n {/* <div>\n <button className=\"p-1 border-2 border-transparent text-gray-700 rounded-full hover:text-blue-500 focus:outline-none transition duration-150 ease-in-out flex items-center\" id=\"user-menu\" aria-label=\"User menu\" aria-haspopup=\"true\"\n onClick={() => setMenuOpen(!menuOpen)}\n >\n <span className=\"mr-1\">{user && user.name &&(user.name)}</span>\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" className=\"h-4 w-4\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </button>\n </div> */}\n <div>\n <button className=\"max-w-xs flex items-center text-sm rounded-full focus:outline-none focus:bg-cool-gray-100 lg:p-2 lg:rounded-md lg:hover:bg-cool-gray-100\" id=\"user-menu\" aria-label=\"User menu\" aria-haspopup=\"true\"\n onClick={() => setMenuOpen(!menuOpen)}\n >\n <span className=\"inline-block h-8 w-8 rounded-full overflow-hidden bg-gray-100\">\n <svg className=\"h-full w-full text-gray-300\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\n <path d=\"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z\" />\n </svg>\n </span>\n <p className=\"hidden ml-3 text-cool-gray-700 text-sm leading-5 font-medium lg:block\">{user && user.name &&(user.name)}</p>\n <svg className=\"hidden flex-shrink-0 ml-1 h-5 w-5 text-cool-gray-400 lg:block\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\" />\n </svg>\n </button>\n </div>\n <Transition\n show={menuOpen}\n >\n <div className=\"origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg\">\n <div className=\"py-1 rounded-md bg-white shadow-xs\" role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"user-menu\">\n {/* <a href=\"#\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">Your Profile</a> */}\n <a href=\"#/select-space\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">选择企业</a>\n\n {/* <a href=\"#/preference\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">账户设置</a> */}\n\n <a href=\"#\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\" onClick={onLogout}>注销</a>\n </div>\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </nav>\n\n {/* <header className=\"bg-white shadow\">\n <div className=\"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8\">\n <h1 className=\"text-3xl font-bold leading-tight text-gray-900\">\n Dashboard\n </h1>\n </div>\n </header> */}\n {/* <main>\n <div className=\"max-w-7xl mx-auto py-6 sm:px-6 lg:px-8\">\n <div className=\"px-4 py-6 sm:px-0\">\n <div className=\"border-4 border-dashed border-gray-200 rounded-lg h-96\"></div>\n </div>\n </div>\n </main> */}\n</div>\n \n )\n};\n\nfunction mapStateToProps(state: any) {\n return {\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(Navbar);","import React, { useState, useEffect } from 'react';\nimport {bindActionCreators} from 'redux';\nimport { RouteComponentProps, Link } from 'react-router-dom';\nimport { Button, Typography } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/styles';\nimport {FormattedMessage} from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getTenant, getSettings, getSettingsTenantId } from '../selectors';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport { getCurrentSpace, getCurrentSpaceId } from \"../selectors/entities/spaces\";\nimport Navbar from '../components/Navbar';\nimport { selectSpace, goSpaceHome } from '../actions/spaces';\nimport { hashHistory } from \"../utils/hash_history\";\nimport LocalStorageStore from '../stores/local_storage_store';\nimport * as GlobalAction from '../actions/global_actions';\n\nclass Home extends React.PureComponent {\n\n\n constructor(props, context) {\n super(props, context);\n }\n\n componentDidMount() {\n const previousSpaceId = LocalStorageStore.getPreviousSpaceId();\n const paramSpaceId = (this.props.match && this.props.match.params)?this.props.match.params.spaceId:null;\n const {currentSpaceId, settingsTenantId} = this.props;\n const spaceId = paramSpaceId ? paramSpaceId : currentSpaceId ? currentSpaceId : (previousSpaceId && previousSpaceId !== 'null') ? previousSpaceId : settingsTenantId\n if (spaceId) {\n this.props.actions.selectSpace(spaceId).then(async (result) => {\n if (result) {\n if(result.data == false){\n hashHistory.push({\n pathname: '/select-space',\n search: this.props.location.search\n });\n return\n }else{\n this.goHome();\n return\n }\n }\n });\n } else {\n hashHistory.push({\n pathname: '/select-space',\n search: this.props.location.search\n });\n }\n if (process.env.NODE_ENV == 'production')\n if (this.props.currentUser && this.props.currentSpace) \n this.goHome();\n }\n\n goHome = async () => {\n this.props.actions.goSpaceHome(this.props.location);\n };\n\n render() {\n\n if (process.env.NODE_ENV == 'production')\n return null;\n\n const {currentUser, currentSpace} = this.props;\n\n if (!currentUser || !currentSpace) {\n return null;\n }\n\n return (\n <div>\n <Navbar user={currentUser}/>\n<div className=\"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-6 border-b border-gray-200 md:flex md:items-center md:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <h2 className=\"text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:leading-9 sm:truncate\">\n {this.props.currentSpace && this.props.currentSpace.name}\n </h2>\n </div>\n <div className=\"mt-4 flex md:mt-0 md:ml-4\">\n {/* <span className=\"shadow-sm rounded-md\">\n <button type=\"button\" className=\"inline-flex items-center px-4 py-2 border border-gray-300 text-sm leading-5 font-medium rounded-md text-gray-700 bg-white hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:text-gray-800 active:bg-gray-50 transition duration-150 ease-in-out\">\n 切换企业\n </button>\n </span> */}\n <span className=\"shadow-sm rounded-md\">\n <button type=\"button\" className=\"inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-700 active:bg-blue-700 transition duration-150 ease-in-out\"\n onClick={this.goHome}>\n 进入首页\n </button>\n </span>\n </div>\n</div>\n \n{/* \n <div className=\"bg-white overflow-hidden sm:shadow sm:rounded-lg sm:px-6 sm:mx-8 sm:my-8 md:max-w-5xl md:mx-auto\">\n <div className=\"px-4 py-5 sm:p-6\">\n <div className=\"py-6 md:flex md:items-center md:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center\">\n <span className=\"inline-block h-15 w-15 rounded-full overflow-hidden bg-gray-100 text-gray-500\">\n <svg className=\"h-full w-full\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\" />\n </svg>\n </span>\n <div>\n <div className=\"flex items-center\">\n <h1 className=\"ml-3 text-2xl font-bold leading-7 text-cool-gray-900 sm:leading-9 sm:truncate\">\n {this.props.currentSpace && this.props.currentSpace.name}\n </h1>\n </div>\n <dl className=\"mt-6 flex flex-col sm:ml-3 sm:mt-1 sm:flex-row sm:flex-wrap\">\n <dt className=\"sr-only\">Company</dt>\n <dd className=\"flex items-center text-sm leading-5 text-cool-gray-500 font-medium capitalize sm:mr-6\">\n <svg className=\"flex-shrink-0 mr-1.5 h-5 w-5 text-cool-gray-400\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M4 4a2 2 0 012-2h8a2 2 0 012 2v12a1 1 0 110 2h-3a1 1 0 01-1-1v-2a1 1 0 00-1-1H9a1 1 0 00-1 1v2a1 1 0 01-1 1H4a1 1 0 110-2V4zm3 1h2v2H7V5zm2 4H7v2h2V9zm2-4h2v2h-2V5zm2 4h-2v2h2V9z\" clipRule=\"evenodd\" />\n </svg>\n 华炎软件\n </dd>\n <dt className=\"sr-only\">Account status</dt>\n <dd className=\"mt-3 flex items-center text-sm leading-5 text-cool-gray-500 font-medium sm:mr-6 sm:mt-0 capitalize\">\n {emailVerified()}\n {mobileVerified()}\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <div className=\"mt-6 flex space-x-3 md:mt-0 md:ml-4\">\n <span className=\"shadow-sm rounded-md\">\n <button type=\"button\" className=\"inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-teal-600 hover:bg-teal-500 focus:outline-none focus:shadow-outline-teal focus:border-teal-700 active:bg-teal-700 transition duration-150 ease-in-out\" \n onClick={this.onHome}>\n 进入首页\n </button>\n </span>\n <span className=\"shadow-sm rounded-md\">\n <a href=\"#/preference\" className=\"inline-flex items-center px-4 py-2 border border-cool-gray-300 text-sm leading-5 font-medium rounded-md text-cool-gray-700 bg-white hover:text-cool-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:text-cool-gray-800 active:bg-cool-gray-50 transition duration-150 ease-in-out\">\n 账户设置\n </a>\n </span>\n </div>\n </div>\n </div>\n </div> */}\n </div>\n );\n }\n};\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n currentSpace: getCurrentSpace(state),\n currentSpaceId: getCurrentSpaceId(state),\n tenant: getTenant(state),\n settings: getSettings(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n selectSpace,\n goSpaceHome,\n }, dispatch),\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Home);","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators } from 'redux';\nimport { changePassword } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport { getCurrentUserId } from '../selectors/entities/users';\nimport * as GlobalAction from '../actions/global_actions';\n\nclass UpdatePassword extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n this.state = {\n oldPassword: '',\n newPassword: '',\n confirmPassword: '',\n serverError: '',\n loading: false\n };\n\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage('accounts.title.updatePassword') + ` | ${this.props.tenant.name}`;\n }\n\n\n handleOldPasswordChange = (e) => {\n this.setState({\n oldPassword: e.target.value,\n });\n }\n\n handleNewPasswordChange = (e) => {\n this.setState({\n newPassword: e.target.value,\n });\n }\n\n handleConfirmPasswordChange = (e) => {\n this.setState({\n confirmPassword: e.target.value,\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.setState({error: null});\n\n if(this.state.oldPassword === this.state.newPassword){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.oldAndNewPasswordNotEQ'\n />\n ),\n });\n return\n }\n\n if(this.state.newPassword != this.state.confirmPassword){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.passwordNotEQ'\n />\n ),\n });\n return\n }\n\n this.props.actions.changePassword(this.state.oldPassword, this.state.newPassword).then(async (result) => {\n let error = null;\n if(result){\n error = result.error\n }\n if (error) {\n if(error.message === 'accounts.invalid_credentials'){\n error.message = 'accounts.updatePassword_invalid_credentials'\n }\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }else{\n GlobalAction.emitUserLoggedOutEvent('/login');\n }\n });\n };\n\n render() {\n\n return (\n <>\n <Background />\n <Card>\n <Logo />\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id='accounts.update_password'\n defaultMessage='Change Password'\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n\n <div className=\"-mt-px\">\n <LocalizedInput\n type=\"password\"\n id=\"oldPassword\"\n name=\"oldPassword\"\n autocomplete=\"old-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.oldPassword', defaultMessage: 'Set oldPassword' }}\n onChange={this.handleOldPasswordChange}\n />\n </div>\n <div className=\"-mt-px\">\n <LocalizedInput\n type=\"password\"\n id=\"newPassword\"\n name=\"newPassword\"\n autocomplete=\"new-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.newPassword', defaultMessage: 'Set newPassword' }}\n onChange={this.handleNewPasswordChange}\n />\n </div>\n <div className=\"-mt-px\">\n <LocalizedInput\n type=\"password\"\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n autocomplete=\"confirm-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.confirmPassword', defaultMessage: 'Set confirmPassword' }}\n onChange={this.handleConfirmPasswordChange}\n />\n </div>\n </div>\n {this.state.serverError && <FormError error={this.state.serverError} />}\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n getCurrentUserId: getCurrentUserId(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n changePassword\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(UpdatePassword));\n","import React, { useState, useEffect } from 'react';\nimport { bindActionCreators, Dispatch, AnyAction } from 'redux';\nimport { RouteComponentProps, Link } from 'react-router-dom';\nimport { createStyles, Theme, makeStyles, FormControl, InputLabel, Input, Button} from '@material-ui/core';\nimport { useIntl, FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport LocalizedInput from '../components/LocalizedInput';\nimport FormError from '../components/FormError';\nimport { getCookie, fixRootUrl } from '../utils/utils';\nimport { createSpace, selectSpace, } from '../actions/spaces';\nimport { hashHistory } from \"../utils/hash_history\";\nimport Logo from '../components/Logo';\nimport Card from '../components/Card';\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUser } from '../selectors/entities/users';\n\nclass CreateTenant extends React.PureComponent {\n\n\n constructor(props, context) {\n super(props, context);\n\n this.state = {\n name: ''\n };\n }\n\n handleNameChange = (e) => {\n this.setState({\n name: e.target.value,\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.props.actions.createSpace(this.state.name).then(async ({data}) => {\n console.log(data)\n // if (error) {\n // this.setState({\n // serverError: (\n // <FormattedMessage\n // id={error.message}\n // />\n // ),\n // });\n // return;\n // }\n \n if (data)\n this.selectSpace(data)\n });\n\n\n };\n\n selectSpace = (space) => {\n if(space && space._id) {\n this.props.actions.selectSpace(space._id);\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n // hashHistory.push(`/home/${space._id}`)\n }\n }\n\n render() {\n\n return (\n<Card>\n\n <Logo/>\n \n <h2 className=\"my-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id='accounts.title.createTenant'\n defaultMessage='Create Team'\n />\n </h2>\n <div class=\"mt-2 max-w-xl text-sm leading-5 text-gray-500\">\n <p>\n <FormattedMessage\n id='accounts.create_tenant_description'\n defaultMessage='Create a new team and invite your colleagues to join.'\n />\n </p>\n </div>\n \n <form onSubmit={this.onSubmit} className=\"mt-4\">\n\n\n <div className=\"rounded-md shadow-sm my-2\">\n <div>\n <LocalizedInput \n id=\"name\"\n name=\"name\" \n value={this.state.name}\n className=\"appearance-none rounded-none relative block w-full px-3 py-2 border-b border-gray-500 bg-blue-50 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5\" \n placeholder={{id: 'accounts.tenant_name', defaultMessage: 'Team Name'}}\n onChange={this.handleNameChange}\n />\n </div>\n </div>\n \n {/* {error && <FormError error={error!} />} */}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n )};\n};\n\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n createSpace,\n selectSpace,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps,mapDispatchToProps)(CreateTenant);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport {FormattedMessage} from 'react-intl';\nimport { hashHistory } from \"../utils/hash_history\";\nimport {Link} from 'react-router-dom';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Navbar from '../components/Navbar';\nimport Background from '../components/Background';\n\nimport { getCurrentUser } from '../selectors/entities/users';\nimport { getSpaceCount, getCurrentSpaceId, getCurrentSpace, getSpaces, getMySpaces } from '../selectors/entities/spaces';\nimport { selectSpace } from '../actions/spaces';\n\nclass SelectSpace extends React.PureComponent {\n static propTypes = {\n currentUserId: PropTypes.string,\n spaceCount: PropTypes.number,\n isMemberOfSpace: PropTypes.bool,\n listableSpaces: PropTypes.array,\n canCreateSpaces: PropTypes.bool,\n history: PropTypes.object,\n // actions: PropTypes.shape({\n // getSpaces: PropTypes.func.isRequired,\n // loadRolesIfNeeded: PropTypes.func.isRequired,\n // addUserToSpace: PropTypes.func.isRequired,\n // }).isRequired,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n loadingSpaceId: '',\n error: null,\n };\n }\n\n handleCreateTenant = () => {\n hashHistory.push({\n pathname: '/create-space',\n search: this.props.location.search\n })\n }\n\n handleSpaceClick = (space) => {\n if(space) {\n this.props.actions.selectSpace(space._id);\n hashHistory.push({\n pathname: `/home/${space._id}`,\n search: this.props.location.search\n })\n }\n }\n\n render() {\n\n let spaceContent = [] \n Object.keys(this.props.spaces).forEach((spaceId) => {\n const space = this.props.spaces[spaceId]\n spaceContent.push (\n <li key={spaceId}>\n <a\n space ={space}\n onClick={e => this.handleSpaceClick(space)} \n className=\"w-full text-left border-b border-gray-100 block hover:bg-blue-100 focus:outline-none transition duration-150 ease-in-out\">\n <div className=\"flex items-center sm:px-10 py-4\">\n <div className=\"min-w-0 flex-1 flex items-center\">\n <div className=\"flex-shrink-0 pr-4 text-gray-600\">\n {/* <img className=\"h-12 w-12 rounded-full\" src=\"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80\" alt=\"\"/> */}\n {/* <svg className=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z\" />\n </svg> */}\n <svg className=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\" />\n </svg>\n </div>\n <div className=\"min-w-0 flex-1\">\n <div>\n <div className=\"text-lg leading-5 font-medium truncate\">{space.name}</div> \n </div>\n </div>\n </div>\n <div>\n <svg className=\"h-5 w-5 text-gray-400\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n </div>\n </a>\n </li>\n )});\n\n return (\n <>\n <Background/>\n <div className=\"flex sm:items-center justify-center mx-auto overflow-auto p-10\">\n <div className=\"relative rounded sm:shadow bg-white w-screen max-w-md\">\n <div className=\"sm:pt-10 sm:pl-10 sm:pr-10\">\n <Logo/>\n <h2 className=\"mt-6 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n {this.props.spaceCount>0 &&(\n <FormattedMessage\n id='accounts.select_space'\n defaultMessage='Select Company'\n />\n )}\n {this.props.spaceCount==0 &&(\n <FormattedMessage\n id='accounts.no_tenant'\n defaultMessage='No Company'\n />\n )}\n </h2>\n </div>\n <div className=\"mt-4 bg-white overflow-hidden mb-10\">\n <ul className=\"border-t border-gray-100\">\n {spaceContent}\n </ul>\n\n <div className=\"mt-6 mx-10 flex justify-end\">\n <button type=\"button\" \n onClick={this.handleCreateTenant}\n className=\"rounded group relative w-full justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.create_tenant'\n defaultMessage='Create Company'\n />\n </button>\n </div>\n </div>\n </div>\n </div>\n </>\n )\n }\n}\n\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n currentSpace: getCurrentSpace(state),\n spaces: getSpaces(state),\n mySpaces: getMySpaces(state),\n spaceCount: getSpaceCount(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n selectSpace,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SelectSpace);","import React, { useState, useEffect} from 'react';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport FormError from '../components/FormError';\nimport Navbar from '../components/Navbar';\nimport { getCurrentUser } from '../selectors/entities/users';\n\n\nconst Preference = ({ currentUser, match, settings, history, location, tenant }: any) => {\n const [error, setError] = useState<string | null>(null);\n const [fullname, setFullname] = useState<string | \"\">(currentUser.name);\n const searchParams = new URLSearchParams(location.search);\n let spaceId = searchParams.get(\"X-Space-Id\");\n const [user, setUser] = useState({ spaces: [], name: '' });\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n setError(null);\n try {\n if (!fullname.trim()) {\n throw new Error(\"accounts.nameRequired\");\n }\n\n // const r = await accountsRest.authFetch('user', {\n // method: \"PUT\",\n // body: JSON.stringify({\n // fullname: fullname\n // }),\n // credentials: 'include'\n // });\n\n } catch (err) {\n setError(err.message);\n }\n };\n\n return (\n<>\n <Navbar/>\n\n <main className=\"bg-cool-gray-100 h-screen\">\n <div className=\"max-w-7xl mx-auto sm:px-6 lg:px-8\">\n <div className=\"px-4 py-8 sm:px-0\">\n\n\n\n <header>\n <div className=\"max-w-7xl\">\n <h1 className=\"text-3xl font-bold leading-tight text-gray-900\">\n 账户设置\n </h1>\n </div>\n </header>\n\n<div className=\"hidden sm:block\">\n <div className=\"py-5\">\n <div className=\"border-t border-gray-200\"></div>\n </div>\n</div>\n\n<div className=\"mt-10 sm:mt-0\">\n <div className=\"md:grid md:grid-cols-3 md:gap-6\">\n <div className=\"md:col-span-1\">\n <div className=\"px-4 sm:px-0\">\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">个人信息</h3>\n {/* <p className=\"mt-1 text-sm leading-5 text-gray-600\">\n Use a permanent address where you can receive mail.\n </p> */}\n </div>\n </div>\n <div className=\"mt-5 md:mt-0 md:col-span-2\">\n <form onSubmit={onSubmit}>\n <div className=\"shadow overflow-hidden sm:rounded-md\">\n <div className=\"px-4 py-5 bg-white sm:p-6\">\n <div className=\"grid grid-cols-6 gap-6\">\n <div className=\"col-span-6 sm:col-span-3\">\n <label className=\"block text-sm font-medium leading-5 text-gray-700\">姓名</label>\n <input id=\"fullname\"\n value={fullname}\n onChange={e => setFullname(e.target.value)}\n className=\"mt-1 form-input block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out sm:text-sm sm:leading-5\"/>\n </div>\n </div>\n </div>\n {error && <FormError error={error!} />}\n <div className=\"px-4 py-3 bg-gray-50 text-right sm:px-6\">\n <button className=\"py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-indigo-600 shadow-sm hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue active:bg-indigo-600 transition duration-150 ease-in-out\">\n 保存\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n</div>\n\n </div>\n </div>\n </main>\n\n</>\n );\n};\n\nfunction mapStateToProps(state: any) {\n return {\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state)\n };\n}\n\nexport default connect(mapStateToProps)(Preference);\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators } from 'redux';\nimport { verifyEmail, verifyMobile, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId, getCurrentUser } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium rounded-br-md bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if (onClick) {\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code'\n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass VerifyEmail extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n const verifyBy = 'email';\n this.state = {\n verifyBy,\n email: '',\n mobile: '',\n verifyCode: '',\n serverError: '',\n loading: false\n };\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage(`accounts.verify_${verifyBy}`) + ` | ${this.props.tenant.name}`;\n }\n\n handleEmailChange = (e) => {\n this.setState({\n email: e.target.value,\n });\n }\n\n handleMobileChange = (e) => {\n this.setState({\n mobile: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n\n sendVerificationToken = (e) => {\n this.setState({ serverError: null, loading: true });\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.verifyBy === 'email'?this.state.email.trim():'',\n mobile: this.state.verifyBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n if(userId && userId !== this.props.currentUserId){\n if(this.state.verifyBy === 'email'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.emailAlreadyExists'\n />\n ),\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.mobileAlreadyExists'\n />\n ),\n });\n }\n \n return\n }\n });\n }\n\n onSubmit = async (e) => {\n this.setState({ serverError: null, loading: true });\n e.preventDefault();\n this.setState({ error: null });\n\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n \n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n if(!this.state.verifyCode || !this.state.verifyCode.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.accounts.codeRequired'\n />\n ),\n });\n return\n }\n\n if(this.state.verifyBy === 'email'){\n this.props.actions.verifyEmail(this.state.email.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.props.actions.verifyMobile(this.state.mobile.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n };\n\n\n finish = (team) => {\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n }\n\n render() {\n\n return (\n <>\n <Background />\n <Card>\n <Logo />\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id={`accounts.verify_${this.state.verifyBy}`}\n defaultMessage={`verify ${this.state.verifyBy}`}\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n\n\n {this.state.verifyBy == 'email' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"email\"\n name=\"email\"\n value={this.state.email}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.email_placeholder', defaultMessage: 'Email' }}\n onChange={this.handleEmailChange}\n />\n </div>\n )}\n\n {this.state.verifyBy == 'mobile' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"mobile\"\n name=\"mobile\"\n value={this.state.mobile}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.mobile_placeholder', defaultMessage: 'Mobile' }}\n onChange={this.handleMobileChange}\n />\n </div>\n )}\n\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput\n id=\"verifyCode\"\n name=\"verifyCode\"\n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-bl-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.verifyCode', defaultMessage: 'Verify Code' }}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile} />\n\n </div>\n </div>\n\n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n currentUserId: getCurrentUserId(state),\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n verifyEmail,\n verifyMobile,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(VerifyEmail));\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators } from 'redux';\nimport { verifyEmail, verifyMobile, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId, getCurrentUser } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium rounded-br-md bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if (onClick) {\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code'\n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass VerifyMobile extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n const verifyBy = 'mobile';\n this.state = {\n verifyBy,\n email: '',\n mobile: '',\n verifyCode: '',\n serverError: '',\n loading: false\n };\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage(`accounts.verify_${verifyBy}`) + ` | ${this.props.tenant.name}`;\n }\n\n handleEmailChange = (e) => {\n this.setState({\n email: e.target.value,\n });\n }\n\n handleMobileChange = (e) => {\n this.setState({\n mobile: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n\n sendVerificationToken = (e) => {\n this.setState({ serverError: null, loading: true });\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.verifyBy === 'email'?this.state.email.trim():'',\n mobile: this.state.verifyBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n if(userId && userId !== this.props.currentUserId){\n if(this.state.verifyBy === 'email'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.emailAlreadyExists'\n />\n ),\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.mobileAlreadyExists'\n />\n ),\n });\n }\n \n return\n }\n });\n }\n\n onSubmit = async (e) => {\n this.setState({ serverError: null, loading: true });\n e.preventDefault();\n this.setState({ error: null });\n\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n \n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n if(!this.state.verifyCode || !this.state.verifyCode.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.accounts.codeRequired'\n />\n ),\n });\n return\n }\n\n if(this.state.verifyBy === 'email'){\n this.props.actions.verifyEmail(this.state.email.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.props.actions.verifyMobile(this.state.mobile.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n };\n\n\n finish = (team) => {\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n }\n\n render() {\n\n return (\n <>\n <Background />\n <Card>\n <Logo />\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id={`accounts.verify_${this.state.verifyBy}`}\n defaultMessage={`verify ${this.state.verifyBy}`}\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n\n\n {this.state.verifyBy == 'email' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"email\"\n name=\"email\"\n value={this.state.email}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.email_placeholder', defaultMessage: 'Email' }}\n onChange={this.handleEmailChange}\n />\n </div>\n )}\n\n {this.state.verifyBy == 'mobile' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"mobile\"\n name=\"mobile\"\n value={this.state.mobile}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.mobile_placeholder', defaultMessage: 'Mobile' }}\n onChange={this.handleMobileChange}\n />\n </div>\n )}\n\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput\n id=\"verifyCode\"\n name=\"verifyCode\"\n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-bl-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.verifyCode', defaultMessage: 'Verify Code' }}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile} />\n\n </div>\n </div>\n\n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n currentUserId: getCurrentUserId(state),\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n verifyEmail,\n verifyMobile,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(VerifyMobile));\n","import React from 'react';\nimport {bindActionCreators} from 'redux';\n\nimport { Switch, HashRouter, Route, Redirect } from 'react-router-dom';\nimport { connect } from 'react-redux';\nimport { getTenant } from './selectors';\nimport { getCurrentUser } from './selectors/entities/users'\nimport * as GlobalActions from './actions/global_actions';\nimport {loadMeAndConfig} from './actions/root';\n\nimport LoggedIn from './components/LoggedIn';\nimport Signup from './pages/Signup';\nimport Login from './pages/Login';\nimport Logout from './pages/Logout';\nimport Home from './pages/Home';\nimport UpdatePassword from './pages/updatePassword';\nimport CreateTenant from './pages/CreateTenant';\nimport SelectSpace from './pages/SelectSpace';\nimport Preference from './pages/Preference';\nimport Loading from './components/Loading';\nimport VerifyEmail from './pages/VerifyEmail';\nimport VerifyMobile from './pages/VerifyMobile';\n\n\nconst LoggedInRoute = ({component: Component, ...rest}) => {\n\n if (!Component) return null;\n return (\n <Route\n {...rest}\n render={(props) => (\n <LoggedIn {...props}>\n <Component {...props}/>\n </LoggedIn>\n )}\n />\n )}\n;\n\nclass Root extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n configLoaded: false,\n };\n }\n\n onConfigLoaded = () => {\n this.setState({configLoaded: true});\n }\n\n componentDidMount() {\n this.props.actions.loadMeAndConfig().then((response) => {\n // let password_expired = false;\n // if(this.props.currentUser){\n // GlobalActions.finishSignin(this.props.currentUser, this.props.tenant, this.props.location);\n // } else{\n // GlobalActions.selectDefaultSpace();\n // if (document.location.pathname === '/' && document.location.hash === '#/' && response[1] && response[1].data) {\n // GlobalActions.redirectUserToDefaultSpace();\n // }\n // }\n this.onConfigLoaded();\n }).then(() => {\n // if (isCurrentUserSystemAdmin(store.getState())) {\n // this.props.actions.getWarnMetricsStatus();\n // }\n });\n // trackLoadTime();\n }\n\n render() {\n if (!this.state.configLoaded) {\n return <div/>;\n }\n \n return (\n <HashRouter basename=\"\">\n <div className=\"absolute w-full h-full\">\n <Loading></Loading>\n {/* <GlobalMessage></GlobalMessage> */}\n {/* <Route path=\"/\" component={GoBack}/> */}\n {/* <Route path=\"/\" component={Title}/> */}\n <Switch>\n <Route path=\"/browsers.html\" exact />\n <Route path=\"/logout\" component={Logout} />\n <LoggedInRoute exact path=\"/\" component={Home}/>\n\n <Route path=\"/signup\" component={Signup} />\n\n <Route path=\"/login\" component={Login} />\n \n <LoggedInRoute path=\"/create-space\" component={CreateTenant} />\n <LoggedInRoute path=\"/select-space\" component={SelectSpace} />\n <LoggedInRoute exact path=\"/update-password\" component={UpdatePassword} />\n <LoggedInRoute path=\"/verify/email\" component={VerifyEmail} />\n <LoggedInRoute path=\"/verify/mobile\" component={VerifyMobile} />\n {/* <Route path=\"/login-code\" component={LoginCode} /> */}\n <LoggedInRoute path=\"/preference\" component={Preference} />\n {/* <LoggedInRoute path=\"/verify-mobile/:token\" component={VerifyMobile} /> */}\n <LoggedInRoute path=\"/home\" component={Home}/>\n <LoggedInRoute path=\"/home/:spaceId\" component={Home}/>\n <Redirect\n to={{\n ...this.props.location,\n pathname: '/login',\n }}\n />\n </Switch>\n </div>\n </HashRouter>\n );\n };\n}\n\nfunction mapStateToProps(state) {\n return {\n tenant: getTenant(state),\n currentUser: getCurrentUser(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n loadMeAndConfig,\n //getWarnMetricsStatus,\n }, dispatch),\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Root);","import * as I18n from '../i18n/i18n';\nimport {Client4} from '../client';\n\nexport function loadTranslations(locale, url) {\n // console.log('loadTranslations', locale,url);\n const translations = {};\n // No need to go to the server for EN\n if (locale === 'en') { \n const en = I18n.getAllLanguages()[locale].translations;\n Object.assign(translations, en);\n return {\n type: \"RECEIVED_TRANSLATIONS\",\n data: {\n locale,\n translations\n },\n }\n }\n \n return (dispatch) => {\n Client4.doFetch(url).then((translations) => {\n dispatch({\n type:\"RECEIVED_TRANSLATIONS\",\n data: {\n locale,\n translations,\n },\n });\n }).catch((error) => {\n console.warn('Actions - loadTranslations - recreived error: ', error)\n }); // eslint-disable-line no-empty-function\n }\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {IntlProvider as BaseIntlProvider} from 'react-intl';\n\nimport * as I18n from '../../i18n/i18n';\n\nexport default class IntlProvider extends React.PureComponent {\n static propTypes = {\n children: PropTypes.element.isRequired,\n locale: PropTypes.string.isRequired,\n settings: PropTypes.object,\n translations: PropTypes.object,\n actions: PropTypes.shape({\n loadTranslations: PropTypes.func.isRequired,\n }).isRequired,\n };\n\n constructor(props) {\n super(props);\n // props.actions.loadSettings();\n // props.actions.loadTenant();\n }\n\n componentDidMount() {\n // Initialize browser's i18n data\n I18n.doAddLocaleData();\n\n this.handleLocaleChange(this.props.locale);\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.locale !== this.props.locale) {\n this.handleLocaleChange(this.props.locale);\n }\n }\n\n handleLocaleChange = (locale) => {\n this.loadTranslationsIfNecessary(locale);\n }\n\n loadTranslationsIfNecessary = (locale) => {\n if (this.props.translations) {\n // Already loaded\n return;\n }\n\n const localeInfo = I18n.getLanguageInfo(locale);\n\n if (locale === 'en' || !localeInfo) {\n // English is loaded by default and invalid locales fall back to English, so we should never hit this\n return;\n }\n\n this.props.actions.loadTranslations(locale, localeInfo.url);\n }\n\n render() {\n // if (!this.props.translations) {\n // return null;\n // }\n\n return (\n <BaseIntlProvider\n key={this.props.locale}\n locale={this.props.locale}\n messages={this.props.translations}\n >\n {this.props.children}\n </BaseIntlProvider>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\n\nimport { loadTranslations } from '../../actions/i18n';\n\nimport {getCurrentLocale, getTranslations} from '../../selectors/i18n';\n\nimport IntlProvider from './intl_provider';\n\nfunction mapStateToProps(state) {\n const locale = getCurrentLocale(state);\n return {\n locale,\n translations: getTranslations(state, locale),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n loadTranslations,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(IntlProvider);\n","import 'react-app-polyfill/ie9';\nimport 'core-js/proposals/url';\nimport 'core-js/stable';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Router from './root';\nimport { Provider } from 'react-redux'\nimport IntlProvider from './components/intl_provider';\n\nimport store from './stores/redux_store';\n\n\nReactDOM.render(\n <Provider store={store}>\n <IntlProvider>\n <Router />\n </IntlProvider>\n </Provider>,\n document.getElementById('root') as HTMLElement);\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["selectors/index.js","selectors/entities/users.ts","utils/hash_history.jsx","types/actions.ts","utils/key_mirror.ts","action_types/users.ts","action_types/spaces.ts","action_types/general.ts","action_types/errors.ts","client/fetch_etag.js","utils/helpers.ts","reducers/entities/users.ts","reducers/entities/spaces.ts","reducers/entities/general.ts","reducers/entities/index.ts","reducers/i18n.js","reducers/settings.js","reducers/requests.js","reducers/index.ts","stores/initial_state.js","stores/redux_store.js","i18n/i18n.js","selectors/i18n.js","utils/utils.jsx","client/client4.ts","utils/sentry.js","client/index.ts","actions/errors.ts","actions/helpers.ts","stores/local_storage_store.ts","selectors/entities/spaces.ts","actions/spaces.ts","selectors/settings.ts","actions/users.ts","actions/global_actions.jsx","actions/root.js","actions/settings.ts","components/Loading.tsx","components/LoggedIn.jsx","components/FormError.tsx","components/Card.tsx","components/Logo.tsx","components/Background.tsx","components/InputPassword.tsx","components/LocalizedInput.tsx","components/countdown.tsx","pages/Signup.jsx","pages/Login.jsx","pages/Logout.jsx","components/Navbar.tsx","pages/Home.jsx","pages/updatePassword.jsx","pages/CreateTenant.jsx","pages/SelectSpace.jsx","pages/Preference.tsx","pages/VerifyEmail.jsx","pages/VerifyMobile.jsx","root.jsx","actions/i18n.js","components/intl_provider/intl_provider.js","components/intl_provider/index.js","index.tsx"],"names":["getSettings","state","settings","getTenant","tenant","Object","assign","name","getRequests","requests","getSettingsTenantId","_id","getCurrentUser","entities","users","getCurrentUserId","currentUserId","hashHistory","window","createHashHistory","BATCH","batchActions","actions","type","meta","batch","payload","keyMirror","obj","Array","isArray","Error","ret","key","hasOwnProperty","CREATE_USER_REQUEST","CREATE_USER_SUCCESS","CREATE_USER_FAILURE","LOGIN_REQUEST","LOGIN_SUCCESS","LOGIN_FAILURE","LOGOUT_REQUEST","LOGOUT_SUCCESS","LOGOUT_FAILURE","REVOKE_ALL_USER_SESSIONS_SUCCESS","REVOKE_SESSIONS_FOR_ALL_USERS_SUCCESS","UPDATE_ME_REQUEST","UPDATE_ME_SUCCESS","UPDATE_ME_FAILURE","RECEIVED_ME","RECEIVED_PROFILE","RECEIVED_PROFILES","RECEIVED_PROFILES_LIST","RECEIVED_PROFILE_IN_TEAM","RECEIVED_PROFILE_NOT_IN_TEAM","RECEIVED_PROFILE_WITHOUT_TEAM","RECEIVED_SESSIONS","RECEIVED_REVOKED_SESSION","RESET_LOGOUT_STATE","RECEIVED_MY_USER_ACCESS_TOKEN","RECEIVED_MY_USER_ACCESS_TOKENS","CLEAR_MY_USER_ACCESS_TOKENS","REVOKED_USER_ACCESS_TOKEN","DISABLED_USER_ACCESS_TOKEN","ENABLED_USER_ACCESS_TOKEN","LOGIN","VERIFICATION_TOKEN_RECIEVED","CHANGEPASSWORD_REQUEST","CHANGEPASSWORD_FAILURE","CHANGEPASSWORD_RECEIVED","VERIFYEMAIL_REQUEST","VERIFYEMAIL_FAILURE","VERIFYEMAIL_RECEIVED","VERIFYMOBILE_REQUEST","VERIFYMOBILE_FAILURE","VERIFYMOBILE_RECEIVED","TO_MOBILE_CODE_LOGIN","GET_SPACES_REQUEST","GET_SPACES_SUCCESS","GET_SPACES_FAILURE","MY_SPACES_REQUEST","MY_SPACES_SUCCESS","MY_SPACES_FAILURE","CREATE_SPACE_REQUEST","CREATE_SPACE_SUCCESS","CREATE_SPACE_FAILURE","JOIN_SPACE_REQUEST","JOIN_SPACE_SUCCESS","JOIN_SPACE_FAILURE","CREATED_SPACE","SELECT_SPACE","UPDATED_SPACE","RECEIVED_SPACE","RECEIVED_SPACES_LIST","DISMISS_ERROR","LOG_ERROR","CLEAR_ERRORS","RESTORE_ERRORS","RECEIVED_SETTINGS","RECEIVED_APP_STATE","RECEIVED_APP_CREDENTIALS","REMOVED_APP_CREDENTIALS","RECEIVED_APP_DEVICE_TOKEN","PING_RESET","RECEIVED_SERVER_VERSION","CLIENT_CONFIG_RECEIVED","CLIENT_CONFIG_RESET","CLIENT_LICENSE_RECEIVED","CLIENT_LICENSE_RESET","RECEIVED_DATA_RETENTION_POLICY","LOG_CLIENT_ERROR_REQUEST","LOG_CLIENT_ERROR_SUCCESS","LOG_CLIENT_ERROR_FAILURE","SUPPORTED_TIMEZONES_REQUEST","SUPPORTED_TIMEZONES_SUCCESS","SUPPORTED_TIMEZONES_FAILURE","SUPPORTED_TIMEZONES_RECEIVED","WEBSOCKET_REQUEST","WEBSOCKET_SUCCESS","WEBSOCKET_FAILURE","WEBSOCKET_CLOSED","REDIRECT_LOCATION_SUCCESS","REDIRECT_LOCATION_FAILURE","SET_CONFIG_AND_LICENSE","WARN_METRICS_STATUS_RECEIVED","WARN_METRIC_STATUS_RECEIVED","WARN_METRIC_STATUS_REMOVED","data","etags","url","options","headers","method","etag","cachedResponse","fetch","then","response","status","clone","responseEtag","get","Reflect","apply","undefined","buildQueryString","parameters","keys","length","query","i","encodeURIComponent","combineReducers","action","UserTypes","user","nextState","userId","password_expired","email_verified","mobile_verified","currentSpaceId","SpaceTypes","spaces","listToMap","appState","GeneralTypes","credentials","deviceToken","serverVersion","general","translations","en","locale","i18n","require","services","store","createStore","rootReducer","initialState","applyMiddleware","thunkMiddleware","languages","value","order","getAllLanguages","getLanguageInfo","getCurrentLocale","DefaultClientLocale","getBrowserLng","getTranslations","I18n","navigator","userLanguage","language","indexOf","getBrowserLocale","localizeMessage","id","defaultMessage","getState","recordsList","recordsMap","Client4","LOGIN_TOKEN_KEY","LOGIN_TOKEN_EXPIRES_KEY","USER_ID_KEY","logToConsole","_lastLoginTokenWhenPolled","loginExpirationInDays","clusterId","token","csrf","urlVersion","userAgent","enableLogging","defaultHeaders","diagnosticId","includeCookies","isRudderKeySet","connectionError","unknownError","userRoles","doFetch","logClientError","message","login","password","deviceId","trackEvent","body","device_id","getAccountsRoute","JSON","stringify","createUser","inviteId","redirect","queryParams","t","iid","r","createSpace","getBaseRoute","sendVerificationToken","getMe","getMySpaces","logout","a","doFetchWithResponse","ok","getOptions","parseAndMergeNestedHeaders","json","ClientError","getUrl","intl","has","msg","console","error","server_error_id","status_code","changePassword","oldPassword","newPassword","verifyEmail","email","code","verifyMobile","mobile","foo","URL","location","href","pathname","split","this","ROOT_URL_PATH_PREFIX","baseUrl","startsWith","csrfToken","enable","include","roles","document","cookie","cookies","trim","replace","newOptions","getCSRFFromCookie","toLowerCase","category","event","props","user_actual_id","originalHeaders","Map","nestedHeaders","forEach","val","capitalizedKey","l","toUpperCase","realVal","match","nestedHeaderStrings","shift","moreNestedHeaders","map","h","set","apiUrl","index","substring","whitelist","part","join","cleanUrlForLogging","defineProperty","enumerable","ClientClass4","logError","dispatch","forceLogoutIfNecessary","err","setToken","dispatcher","requestSuccess","requestData","bindClientFunc","clientFunc","onRequest","onSuccess","onFailure","params","push","s","getPreviousSpaceIdKey","getPathScopedKey","path","LocalStorageStore","basePath","localStorage","getItem","setItem","removeItem","spaceId","wasLoggedIn","getSpaces","values","getSpaceCount","getCurrentSpace","getCurrentSpaceId","getSpace","selectSpace","selectedSpaceId","getPreviousSpaceId","setPreviousSpaceId","space","promises","Promise","all","goSpaceHome","authToken","log","rootUrl","root_url","searchParams","URLSearchParams","search","redirect_uri","origin","u","append","toString","created","completeLogin","loginId","mfaToken","_next","setUserId","ReactNativeWebView","postMessage","tokens","accessToken","getChangePasswordFunc","getVerifyEmailFunc","getVerifyMobileFunc","emitUserLoggedOutEvent","redirectToPath","redirectTo","catch","e","selectDefaultSpace","redirectUserToVerifyMobile","finishSignin","currentUser","redirectUserToUpdatePassword","enable_bind_mobile","enable_bind_email","redirectUserToVerifyEmail","loadMeAndConfig","setEnableLogging","EnableDeveloper","setDiagnosticId","DiagnosticId","resolvedPromises","getWasLoggedIn","getMeFunc","me","useStyles","makeStyles","theme","createStyles","backdrop","zIndex","drawer","color","backgroundColor","connect","classes","React","useState","open","setOpen","useEffect","Backdrop","className","CircularProgress","LoggedIn","context","GlobalActions","isValidState","children","PureComponent","variantIcon","success","CheckCircleOutline","warning","WarningOutlined","ErrorOutline","info","InfoOutlined","useStyles1","getColor","palette","darken","lighten","getBackgroundColor","green","main","primary","amber","icon","fontSize","iconVariant","opacity","marginRight","spacing","display","alignItems","MySnackbarContentWrapper","variant","onClose","other","Icon","SnackbarContent","elevation","clsx","aria-describedby","mobile_help","chunks","target","email_help","useStyles2","margin","marginBottom","FormError","formError","_variant","Card","openPrivacyPage","AppBrowserOpen","onClick","logoUrl","logo_url","src","backgroundUrl","background_url","background_color","style","innerWidth","backgroundImage","InputPassword","forwardRef","ref","selfInputRef","useRef","inputRef","clearPasswordValueAttribute","setTimeout","input","current","getAttribute","hasAttribute","removeAttribute","timer","clearTimeout","onFocus","onBlur","displayName","LocalizedInput","placeholder","otherProps","localizedPlaceholder","useCountDown","timerKey","useMemo","getter","setter","total","lifecycle","saveKey","getSaveData","Date","now","sessionStorage","addData","getData","resetCountDown","useCallback","getRestTime","expiredTime","isNaN","restTime","Math","floor","setRestTime","setInterval","newRestTime","clearInterval","ReApplyCodeBtn","resetCountdown","textColor","disabled","Signup","createLoginPlaceholder","inputLabel","loginBy","Utils","handleEmailChange","setState","handleNameChange","switchLoginByMobile","switchLoginByEmail","tabColor","tab","handleMobileChange","handlePasswordChange","handleCodeChange","verifyCode","goLogin","history","serverError","loading","onSubmit","preventDefault","invite_token","GlobalAction","loginSuccess","goSignup","settingsTenantId","sessionExpired","loginByEmail","loginByMobile","loginWithCode","loginWithPassword","enable_mobile_code_login","enable_email_code_login","enable_password_login","emailInput","createRef","mobileInput","passwordInput","browserHistory","title","autoCapitalize","onChange","autocomplete","Component","bindActionCreators","withRouter","Login","handleLoginIdChange","MFA","username","RegExp","test","switchLoginWithCode","loginWith","switchLoginWithPassword","args","team","loginIdInput","enable_register","Logout","menuOpen","setMenuOpen","onLogout","aria-label","xmlns","fill","viewBox","stroke","strokeLinecap","strokeLinejoin","strokeWidth","d","aria-haspopup","fillRule","clipRule","show","role","aria-orientation","aria-labelledby","Home","goHome","previousSpaceId","paramSpaceId","result","currentSpace","UpdatePassword","handleOldPasswordChange","handleNewPasswordChange","handleConfirmPasswordChange","confirmPassword","CreateTenant","class","SelectSpace","handleCreateTenant","handleSpaceClick","loadingSpaceId","spaceContent","spaceCount","mySpaces","setError","fullname","setFullname","VerifyEmail","verifyBy","finish","VerifyMobile","LoggedInRoute","component","rest","render","Root","onConfigLoaded","configLoaded","basename","exact","Preference","to","loadTranslations","warn","IntlProvider","handleLocaleChange","loadTranslationsIfNecessary","localeInfo","prevProps","messages","ReactDOM","getElementById"],"mappings":"+gfAAO,SAASA,EAAYC,GACxB,OAAO,eACAA,EAAMC,UAIV,SAASC,EAAUF,GACtB,IAAMG,EAASC,OAAOC,OAAO,GAAIL,EAAMC,SAASE,QAGhD,OAFKA,EAAOG,OACRH,EAAOG,KAAO,WACXH,EAGJ,SAASI,EAAYP,GACxB,OAAOA,EAAMQ,SAGV,SAASC,EAAoBT,GAChC,GAAGA,EAAMC,UAAYD,EAAMC,SAASE,OAChC,OAAOH,EAAMC,SAASE,OAAOO,IChB9B,SAASC,EAAeX,GAC7B,OAAOA,EAAMY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wBACLwG,KAAM,CACF8C,SACAF,qBAGT+N,OAAM,SAACrI,GACND,QAAQuZ,KAAK,iDAAkDtZ,O,cCpBtDuZ,G,kDAWjB,WAAYpX,GAAQ,IAAD,8BACf,cAAMA,IAkBVqX,mBAAqB,SAAChf,GAClB,EAAKif,4BAA4Bjf,IApBlB,EAuBnBif,4BAA8B,SAACjf,GAC3B,IAAI,EAAK2H,MAAM7H,aAAf,CAKA,IAAMof,EAAa/d,GAAqBnB,GAEzB,OAAXA,GAAoBkf,GAKxB,EAAKvX,MAAMlR,QAAQooB,iBAAiB7e,EAAQkf,EAAW9hB,OApCxC,E,gEAUfqJ,KAAKuY,mBAAmBvY,KAAKkB,MAAM3H,U,yCAGpBmf,GACXA,EAAUnf,SAAWyG,KAAKkB,MAAM3H,QAChCyG,KAAKuY,mBAAmBvY,KAAKkB,MAAM3H,U,+BA6BvC,OACI,kBAAC,KAAD,CACI5I,IAAKqP,KAAKkB,MAAM3H,OAChBA,OAAQyG,KAAKkB,MAAM3H,OACnBof,SAAU3Y,KAAKkB,MAAM7H,cAEpB2G,KAAKkB,MAAM4I,c,GA7DcZ,IAAMa,eCmBjCf,oBAhBf,SAAyBra,GACrB,IAAM4K,EAASe,GAAiB3L,GAChC,MAAO,CACH4K,SACAF,aAAcoB,GAAgB9L,EAAO4K,OAI7C,SAA4BwJ,GACxB,MAAO,CACH/S,QAAS2jB,YAAmB,CACxByE,qBACDrV,MAIIiG,CAA6CsP,ICf5DM,IAAShB,OACL,kBAAC,IAAD,CAAUje,MAAOA,IACb,kBAAC,GAAD,KACI,kBAAC,GAAD,QAGR6G,SAASqY,eAAe,W","file":"static/js/main.a01ccc36.chunk.js","sourcesContent":["export function getSettings(state) {\n return {\n ...state.settings,\n };\n}\n\nexport function getTenant(state) {\n const tenant = Object.assign({}, state.settings.tenant)\n if (!tenant.name)\n tenant.name = \"Steedos\"\n return tenant;\n}\n\nexport function getRequests(state){\n return state.requests\n}\n\nexport function getSettingsTenantId(state){\n if(state.settings && state.settings.tenant){\n return state.settings.tenant._id\n }\n}\n\n","\nimport { GlobalState } from \"../../types/store\";\n\nexport function getCurrentUser(state: GlobalState) {\n return state.entities.users.users[getCurrentUserId(state)];\n}\n\nexport function getCurrentUserId(state: GlobalState) {\n return state.entities.users.currentUserId;\n}\n\nexport function getUsers(state: GlobalState) {\n return state.entities.users.users;\n}\n","import {createHashHistory} from 'history';\n\nexport const hashHistory = typeof window !== 'undefined'?createHashHistory():null;\n","import {GlobalState} from './store';\n\nexport type GetStateFunc = () => GlobalState;\nexport type GenericAction = {\n type: string;\n data?: any;\n meta?: any;\n error?: any;\n index?: number;\n displayable?: boolean;\n postId?: string;\n sessionId?: string;\n currentUserId?: string;\n remove?: Function|string[];\n timestamp?: number;\n [extraProps: string]: any;\n};\nexport type Thunk = (b: DispatchFunc, a: GetStateFunc) => Promise<ActionResult> | ActionResult;\n\ntype BatchAction = {\n type: 'BATCHING_REDUCER.BATCH';\n payload: Array<GenericAction>;\n meta: {\n batch: true;\n };\n};\nexport type Action = GenericAction | Thunk | BatchAction | ActionFunc;\n\nexport type ActionResult = {\n data: any;\n} | {\n error: any;\n};\n\nexport type DispatchFunc = (action: Action, getState?: GetStateFunc | null) => Promise<ActionResult>;\nexport type ActionFunc = (dispatch: DispatchFunc, getState: GetStateFunc) => Promise<ActionResult|ActionResult[]> | ActionResult;\nexport type PlatformType = 'web' | 'ios' | 'android';\n\nexport const BATCH = 'BATCHING_REDUCER.BATCH';\n\nexport function batchActions(actions: Action[], type = BATCH) {\n return {type, meta: {batch: true}, payload: actions};\n}\n\nexport type Reducer<S = any, A extends Action = Action> = (\n state: S | undefined,\n action: A\n ) => S\n\nexport function enableBatching<S>(reduce: Reducer<S>): Reducer<S> {\n return function batchingReducer(state, action) {\n if (action && 'meta' in action && action.meta.batch) {\n return action.payload.reduce(batchingReducer, state);\n }\n return reduce(state, action);\n };\n}","\n/**\n * Constructs an enumeration with keys equal to their value.\n *\n * For example:\n *\n * var COLORS = keyMirror({blue: null, red: null});\n * var myColor = COLORS.blue;\n * var isColorValid = !!COLORS[myColor];\n *\n * The last line could not be performed if the values of the generated enum were\n * not equal to their keys.\n *\n * Input: {key1: val1, key2: val2}\n * Output: {key1: key1, key2: key2}\n *\n * @param {object} obj\n * @return {object}\n */\nexport default function keyMirror<T extends {}>(obj: T): { [K in keyof T]: K } {\n if (!(obj instanceof Object && !Array.isArray(obj))) {\n throw new Error('keyMirror(...): Argument must be an object.');\n }\n\n const ret: any = {};\n for (const key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n\n ret[key] = key;\n }\n return ret;\n}","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n CREATE_USER_REQUEST: null,\n CREATE_USER_SUCCESS: null,\n CREATE_USER_FAILURE: null,\n\n LOGIN_REQUEST: null,\n LOGIN_SUCCESS: null,\n LOGIN_FAILURE: null,\n\n LOGOUT_REQUEST: null,\n LOGOUT_SUCCESS: null,\n LOGOUT_FAILURE: null,\n\n REVOKE_ALL_USER_SESSIONS_SUCCESS: null,\n REVOKE_SESSIONS_FOR_ALL_USERS_SUCCESS: null,\n\n UPDATE_ME_REQUEST: null,\n UPDATE_ME_SUCCESS: null,\n UPDATE_ME_FAILURE: null,\n\n RECEIVED_ME: null,\n RECEIVED_PROFILE: null,\n RECEIVED_PROFILES: null,\n RECEIVED_PROFILES_LIST: null,\n RECEIVED_PROFILE_IN_TEAM: null,\n RECEIVED_PROFILE_NOT_IN_TEAM: null,\n RECEIVED_PROFILE_WITHOUT_TEAM: null,\n RECEIVED_SESSIONS: null,\n RECEIVED_REVOKED_SESSION: null,\n RESET_LOGOUT_STATE: null,\n RECEIVED_MY_USER_ACCESS_TOKEN: null,\n RECEIVED_MY_USER_ACCESS_TOKENS: null,\n CLEAR_MY_USER_ACCESS_TOKENS: null,\n REVOKED_USER_ACCESS_TOKEN: null,\n DISABLED_USER_ACCESS_TOKEN: null,\n ENABLED_USER_ACCESS_TOKEN: null,\n LOGIN: null,\n\n VERIFICATION_TOKEN_RECIEVED: null,\n\n CHANGEPASSWORD_REQUEST: null,\n CHANGEPASSWORD_FAILURE: null,\n CHANGEPASSWORD_RECEIVED: null,\n\n VERIFYEMAIL_REQUEST: null,\n VERIFYEMAIL_FAILURE: null,\n VERIFYEMAIL_RECEIVED: null,\n\n VERIFYMOBILE_REQUEST: null,\n VERIFYMOBILE_FAILURE: null,\n VERIFYMOBILE_RECEIVED: null,\n TO_MOBILE_CODE_LOGIN: null,\n});","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n GET_SPACES_REQUEST: null,\n GET_SPACES_SUCCESS: null,\n GET_SPACES_FAILURE: null,\n\n MY_SPACES_REQUEST: null,\n MY_SPACES_SUCCESS: null,\n MY_SPACES_FAILURE: null,\n\n CREATE_SPACE_REQUEST: null,\n CREATE_SPACE_SUCCESS: null,\n CREATE_SPACE_FAILURE: null,\n\n JOIN_SPACE_REQUEST: null,\n JOIN_SPACE_SUCCESS: null,\n JOIN_SPACE_FAILURE: null,\n\n CREATED_SPACE: null,\n SELECT_SPACE: null,\n UPDATED_SPACE: null,\n\n RECEIVED_SPACE: null,\n RECEIVED_SPACES_LIST: null,\n})","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n RECEIVED_SETTINGS: null, \n \n RECEIVED_APP_STATE: null,\n RECEIVED_APP_CREDENTIALS: null,\n REMOVED_APP_CREDENTIALS: null,\n RECEIVED_APP_DEVICE_TOKEN: null,\n\n PING_RESET: null,\n\n RECEIVED_SERVER_VERSION: null,\n\n CLIENT_CONFIG_RECEIVED: null,\n CLIENT_CONFIG_RESET: null,\n\n CLIENT_LICENSE_RECEIVED: null,\n CLIENT_LICENSE_RESET: null,\n\n RECEIVED_DATA_RETENTION_POLICY: null,\n\n LOG_CLIENT_ERROR_REQUEST: null,\n LOG_CLIENT_ERROR_SUCCESS: null,\n LOG_CLIENT_ERROR_FAILURE: null,\n\n SUPPORTED_TIMEZONES_REQUEST: null,\n SUPPORTED_TIMEZONES_SUCCESS: null,\n SUPPORTED_TIMEZONES_FAILURE: null,\n SUPPORTED_TIMEZONES_RECEIVED: null,\n\n WEBSOCKET_REQUEST: null,\n WEBSOCKET_SUCCESS: null,\n WEBSOCKET_FAILURE: null,\n WEBSOCKET_CLOSED: null,\n\n REDIRECT_LOCATION_SUCCESS: null,\n REDIRECT_LOCATION_FAILURE: null,\n SET_CONFIG_AND_LICENSE: null,\n\n WARN_METRICS_STATUS_RECEIVED: null,\n WARN_METRIC_STATUS_RECEIVED: null,\n WARN_METRIC_STATUS_REMOVED: null,\n});","import keyMirror from '../utils/key_mirror';\n\nexport default keyMirror({\n DISMISS_ERROR: null,\n LOG_ERROR: null,\n CLEAR_ERRORS: null,\n RESTORE_ERRORS: null,\n});","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nconst data = {};\nconst etags = {};\n\nexport default (url = null, options = {headers: {}}) => {\n url = url || options.url; // eslint-disable-line no-param-reassign\n\n if (options.method === 'GET' || !options.method) {\n const etag = etags[url];\n const cachedResponse = data[`${url}${etag}`]; // ensure etag is for url\n if (etag) {\n options.headers['If-None-Match'] = etag;\n }\n\n return fetch(url, options).\n then((response) => {\n if (response.status === 304) {\n return cachedResponse.clone();\n }\n\n if (response.status === 200) {\n const responseEtag = response.headers.get('Etag');\n\n if (responseEtag) {\n data[`${url}${responseEtag}`] = response.clone();\n etags[url] = responseEtag;\n }\n }\n\n return response;\n });\n }\n\n // all other requests go straight to fetch\n return Reflect.apply(fetch, undefined, [url, options]); //eslint-disable-line no-undefined\n};\n","import {Dictionary} from '../types/utilities';\n\nexport function buildQueryString(parameters: Dictionary<any>): string {\n const keys = Object.keys(parameters);\n if (keys.length === 0) {\n return '';\n }\n\n let query = '?';\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n query += key + '=' + encodeURIComponent(parameters[key]);\n\n if (i < keys.length - 1) {\n query += '&';\n }\n }\n\n return query;\n}","import {UserTypes} from '../../action_types/';\nimport { GenericAction } from '../../types/actions';\nimport { IDMappedObjects } from '../../types/utilities';\nimport { UserProfile } from '../../types/users';\nimport { combineReducers } from 'redux';\n\nconst currentUserId = (state = '', action: GenericAction) => {\n switch (action.type) {\n case UserTypes.RECEIVED_ME: {\n const data = action.data || action.payload;\n return data._id;\n }\n\n case UserTypes.LOGIN: { // Used by the mobile app\n const {user} = action.data;\n\n return user ? user._id : state;\n }\n case UserTypes.LOGOUT_SUCCESS:\n return '';\n }\n\n return state;\n}\n\n\nconst users = (state: IDMappedObjects<UserProfile> = {}, action: GenericAction) => {\n switch (action.type) {\n case UserTypes.RECEIVED_ME:\n case UserTypes.RECEIVED_PROFILE: {\n const data = action.data || action.payload;\n const user = { ...data };\n\n return {\n ...state,\n [data._id]: user,\n };\n }\n case UserTypes.LOGIN: { // Used by the mobile app\n const { user } = action.data;\n\n if (user) {\n const nextState = { ...state };\n nextState[user._id] = user;\n return nextState;\n }\n\n return state;\n }\n case UserTypes.LOGOUT_SUCCESS:\n return {};\n case UserTypes.CHANGEPASSWORD_RECEIVED:{\n const data = action.data || action.payload;\n return {\n ...state,\n [data.userId]: Object.assign({}, state[data.userId], { password_expired: data.password_expired }),\n }\n }\n case UserTypes.VERIFYEMAIL_RECEIVED: {\n const data = action.data || action.payload;\n return {\n ...state,\n [data.userId]: Object.assign({}, state[data.userId], { email_verified: data.email_verified }),\n }\n }\n case UserTypes.VERIFYMOBILE_RECEIVED: {\n const data = action.data || action.payload;\n return {\n ...state,\n [data.userId]: Object.assign({}, state[data.userId], { mobile_verified: data.mobile_verified }),\n }\n }\n default:\n return state;\n }\n}\n\n\n\nexport default combineReducers({\n currentUserId,\n users\n})","import { UserTypes, SpaceTypes } from '../../action_types/';\nimport { GenericAction } from '../../types/actions';\nimport { IDMappedObjects } from '../../types/utilities';\nimport { UserProfile } from '../../types/users';\nimport { combineReducers } from 'redux';\nimport { listToMap } from '../../utils/utils';\n\nconst currentSpaceId = (state = '', action: GenericAction) => {\n switch (action.type) {\n case SpaceTypes.SELECT_SPACE:\n return action.data;\n case UserTypes.LOGOUT_SUCCESS:\n return '';\n default:\n return state;\n }\n}\n\nconst spaces = (state: IDMappedObjects<UserProfile> = {}, action: GenericAction) => {\n switch (action.type) {\n case SpaceTypes.RECEIVED_SPACES_LIST:\n return Object.assign({}, state, listToMap(action.data));\n case UserTypes.LOGOUT_SUCCESS:\n return {};\n\n default:\n return state;\n }\n}\n\n\nexport default combineReducers({\n currentSpaceId,\n spaces,\n})","import {combineReducers} from 'redux';\nimport { GenericAction } from '../../types/actions';\nimport { GeneralTypes, UserTypes } from '../../action_types/';\n\n\n// function config(state: Partial<ClientConfig> = {}, action: GenericAction) {\n// switch (action.type) {\n// case GeneralTypes.CLIENT_CONFIG_RECEIVED:\n// return Object.assign({}, state, action.data);\n// case UserTypes.LOGIN: // Used by the mobile app\n// case GeneralTypes.SET_CONFIG_AND_LICENSE:\n// return Object.assign({}, state, action.data.config);\n// case GeneralTypes.CLIENT_CONFIG_RESET:\n// case UserTypes.LOGOUT_SUCCESS:\n// return {};\n// default:\n// return state;\n// }\n// }\n\nfunction appState(state = false, action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_APP_STATE:\n return action.data;\n\n default:\n return state;\n }\n}\n\nfunction credentials(state: any = {}, action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_APP_CREDENTIALS:\n return Object.assign({}, state, action.data);\n\n case UserTypes.LOGIN: // Used by the mobile app\n return {\n url: action.data.url,\n };\n case UserTypes.LOGOUT_SUCCESS:\n return {};\n default:\n return state;\n }\n}\n\n\nfunction deviceToken(state = '', action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_APP_DEVICE_TOKEN:\n return action.data;\n default:\n return state;\n }\n}\n\nfunction serverVersion(state = '', action: GenericAction) {\n switch (action.type) {\n case GeneralTypes.RECEIVED_SERVER_VERSION:\n return action.data;\n case UserTypes.LOGOUT_SUCCESS:\n return '';\n default:\n return state;\n }\n}\n\nexport default combineReducers({\n appState,\n credentials,\n deviceToken,\n serverVersion,\n});","import users from './users';\nimport spaces from './spaces';\nimport general from './general';\nimport { combineReducers } from 'redux';\n\nexport default combineReducers({\n general,\n users,\n spaces\n})","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {combineReducers} from 'redux';\n\nimport en from '../i18n/en.json';\n\nfunction translations(state = {en}, action) {\n switch (action.type) {\n case \"RECEIVED_TRANSLATIONS\":\n return {\n ...state,\n [action.data.locale]: action.data.translations,\n };\n\n default:\n return state;\n }\n}\n\nexport default combineReducers({\n translations,\n});\n","\nimport { GeneralTypes } from \"../action_types\";\n\nconst settings = (state = {}, action) => {\n switch (action.type) {\n case GeneralTypes.RECEIVED_SETTINGS:\n return Object.assign({}, state, action.data);\n default:\n return state\n }\n}\n\nexport default settings","const requests = (state = {}, action) => {\n switch (action.type) {\n case 'change':\n return Object.assign({}, state, {status: action.data});\n default:\n return state\n }\n}\n\nexport default requests","import { combineReducers } from 'redux'\nimport entities from './entities'\nimport i18n from './i18n'\nimport settings from './settings'\nimport requests from './requests'\n\nexport default combineReducers({\n entities,\n i18n,\n settings,\n requests,\n})","const en = require(\"../i18n/en.json\");\nconst zhCN = require(\"../i18n/zh-CN.json\");\n\nexport default {\n entities: {\n general: {\n },\n users: {\n currentUserId: '',\n users: {},\n },\n spaces: {\n currentSpaceId: '',\n spaces: {},\n },\n },\n i18n: {\n translations: {\n en: en,\n 'zh-CN': zhCN\n }\n },\n settings: {\n services: {\n\n }\n },\n requests: {\n status: \"not_started\"\n },\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n// This is a temporary store while we are transitioning from Flux to Redux. This file exports\n// the configured Redux store for use by actions and selectors.\n\nimport { createStore, applyMiddleware } from 'redux'\nimport thunkMiddleware from 'redux-thunk'\nimport rootReducer from '../reducers'\nimport initialState from './initial_state';\n\nconst store = createStore(\n rootReducer, \n initialState, \n applyMiddleware(\n thunkMiddleware,\n )\n);\n\nexport function bindActionToRedux(action, ...args) {\n return async () => {\n await action(...args)(store.dispatch, store.getState);\n };\n}\n\nif (process.env.NODE_ENV !== 'production' && typeof window !== 'undefined') { //eslint-disable-line no-process-env\n window.storeWebapp = store;\n}\n\nexport default store;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n/* eslint-disable import/order */\n\n// import {addLocaleData} from 'react-intl';\n\n// import enLocaleData from 'react-intl/locale-data/en';\n// import zhLocaleData from 'react-intl/locale-data/zh';\n\nimport store from '../stores/redux_store';\nimport { getSettings } from '../selectors';\n\nconst en = require(\"./en.json\");\nconst zhCN = require(\"./zh-CN.json\");\n\n// should match the values in model/config.go\nconst languages = {\n en: {\n value: 'en',\n name: 'English',\n order: 1,\n translations: en\n },\n 'zh-CN': {\n value: 'zh-CN',\n name: '中文 (简体)',\n order: 13,\n translations: zhCN\n },\n};\n\nexport function getAllLanguages() {\n return languages;\n}\n\nexport function getLanguages() {\n const config = getSettings(store.getState());\n if (!config.AvailableLocales) {\n return getAllLanguages();\n }\n return config.AvailableLocales.split(',').reduce((result, l) => {\n if (languages[l]) {\n result[l] = languages[l];\n }\n return result;\n }, {});\n}\n\nexport function getLanguageInfo(locale) {\n return getAllLanguages()[locale];\n}\n\nexport function isLanguageAvailable(locale) {\n return Boolean(getLanguages()[locale]);\n}\n\nexport function doAddLocaleData() {\n // addLocaleData(enLocaleData);\n // addLocaleData(zhLocaleData);\n}\n","\nimport * as I18n from '../i18n/i18n';\n\nimport { getSettings } from '../selectors';\nimport { getBrowserLng } from '../utils/utils';\n\nexport function getCurrentUserLocale(state) {\n return getBrowserLng();\n}\n\n// This is a placeholder for if we ever implement browser-locale detection\nexport function getCurrentLocale(state) {\n return getCurrentUserLocale(state, getSettings(state).DefaultClientLocale);\n}\n\nexport function getTranslations(state, locale) {\n const localeInfo = I18n.getLanguageInfo(locale);\n\n let translations;\n if (localeInfo) {\n translations = state.i18n.translations[locale];\n } else {\n // Default to English if an unsupported locale is specified\n translations = state.i18n.translations.en;\n }\n\n return translations;\n}\n","import store from '../stores/redux_store';\nimport {getCurrentLocale, getTranslations} from '../selectors/i18n';\nimport {IDMappedObjects, Dictionary} from '../types/utilities';\n\nexport const getCookie = (name) => {\n let pattern = RegExp(name + \"=.[^;]*\")\n let matched = document.cookie.match(pattern)\n if(matched){\n let cookie = matched[0].split('=')\n return cookie[1]\n }\n return ''\n}\n\nexport const getBrowserLng = function () {\n var l, lng;\n var navigator = window.navigator;\n l = navigator.userLanguage || navigator.language || 'en';\n if (l.indexOf(\"zh\") >= 0) {\n lng = \"zh-CN\";\n } else {\n lng = \"en\";\n }\n return lng;\n};\n\nexport const getBrowserLocale = function(){\n var l, locale;\n var navigator = window.navigator;\n l = navigator.userLanguage || navigator.language || 'en';\n if (l.indexOf(\"zh\") >= 0) {\n locale = \"zh-cn\";\n } else {\n locale = \"en-us\";\n }\n return locale;\n}\n\nexport function localizeMessage(id, defaultMessage) {\n const state = store.getState();\n\n const locale = getCurrentLocale(state);\n const translations = getTranslations(state, locale);\n\n if (!translations || !(id in translations)) {\n return defaultMessage || id;\n }\n\n return translations[id];\n}\n\nexport function isEmptyObject(object) {\n if (!object) {\n return true;\n }\n\n if (Object.keys(object).length === 0) {\n return true;\n }\n\n return false;\n}\n\nexport function listToMap(recordsList) {\n const recordsMap = {};\n for (let i = 0; i < recordsList.length; i++) {\n recordsMap[recordsList[i]._id] = recordsList[i];\n }\n return recordsMap;\n}\n\n\n// export const setLocationSearch = (location)=>{\n// let value = '';\n// if(location){\n// if(location.search){\n// value = location.search\n// }else if(location.hash && location.hash.indexOf(\"?\") > -1){\n// value = location.hash.substring(location.hash.indexOf(\"?\"))\n// }\n// }\n// if(!window._AccountsLocationSearch && value){\n// window._AccountsLocationSearch = value\n// }\n// };\n\n// export const getLocationSearch = ()=>{\n// return window._AccountsLocationSearch || \"\"\n// }\n\n\nexport const fixRootUrl = (rootUrl) => {\n\n if (process.env.NODE_ENV == 'development')\n return rootUrl;\n\n if (rootUrl) {\n var parsedUrl = new URL(rootUrl);\n \n var pathPrefix = parsedUrl.pathname;\n if (pathPrefix.slice(-1) === '/') {\n // remove trailing slash (or turn \"/\" into \"\")\n pathPrefix = pathPrefix.slice(0, -1);\n }\n return pathPrefix;\n } else {\n return \"\";\n }\n\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport fetch from './fetch_etag';\nimport {cleanUrlForLogging} from '../utils/sentry';\nimport { Options, ClientResponse } from '../types/client4';\nimport {buildQueryString} from '../utils/helpers';\nimport { UserProfile } from '../types/users';\nimport { ServerError } from '../types/errors';\nimport { Space } from '../types/spaces';\nimport { getBrowserLocale } from '../utils/utils';\n\nconst FormData = require('form-data');\nconst HEADER_AUTH = 'Authorization';\nconst HEADER_BEARER = 'BEARER';\nconst HEADER_REQUESTED_WITH = 'X-Requested-With';\nconst HEADER_USER_AGENT = 'User-Agent';\nconst HEADER_X_CLUSTER_ID = 'X-Cluster-Id';\nconst HEADER_X_CSRF_TOKEN = 'X-CSRF-Token';\nexport const HEADER_X_VERSION_ID = 'X-Version-Id';\nconst PER_PAGE_DEFAULT = 60;\nconst LOGS_PER_PAGE_DEFAULT = 10000;\nexport const DEFAULT_LIMIT_BEFORE = 30;\nexport const DEFAULT_LIMIT_AFTER = 30;\n\nconst DEFAULT_LOGIN_EXPIRATION_DAYS = 90;\nconst LOGIN_UNEXPIRING_TOKEN_DAYS = 365 * 100;\n\nexport default class Client4 {\n LOGIN_TOKEN_KEY = \"Meteor.loginToken\";\n LOGIN_TOKEN_EXPIRES_KEY = \"Meteor.loginTokenExpires\";\n USER_ID_KEY = \"Meteor.userId\";\n logToConsole = false;\n _lastLoginTokenWhenPolled= null;\n loginExpirationInDays = null;\n serverVersion = '';\n clusterId = '';\n token = '';\n csrf = '';\n url = (process.env.NODE_ENV == 'development' && process.env.REACT_APP_API_URL)? process.env.REACT_APP_API_URL as string : '';\n urlVersion = '';\n userAgent: string|null = null;\n enableLogging = false;\n defaultHeaders: {[x: string]: string} = {\n 'Content-Type': 'application/json'\n };\n userId = '';\n diagnosticId = '';\n includeCookies = true;\n isRudderKeySet = false;\n translations = {\n connectionError: 'There appears to be a problem with your internet connection.',\n unknownError: 'We received an unexpected status code from the server.',\n };\n userRoles?: string;\n \n getUrl() {\n var href = new URL(window.location.href);\n var foo = href.pathname.split('/accounts');\n if(!this.url){\n var ROOT_URL_PATH_PREFIX = '';\n if(foo.length > 1){\n ROOT_URL_PATH_PREFIX = foo[0];\n }\n return ROOT_URL_PATH_PREFIX;\n }\n return this.url;\n }\n\n getAbsoluteUrl(baseUrl: string) {\n if (typeof baseUrl !== 'string' || !baseUrl.startsWith('/')) {\n return baseUrl;\n }\n return this.getUrl() + baseUrl;\n }\n\n setUrl(url: string) {\n this.url = url;\n }\n\n setUserAgent(userAgent: string) {\n this.userAgent = userAgent;\n }\n\n getToken() {\n return this.token;\n }\n\n setToken(token: string) {\n this.token = token;\n }\n\n setCSRF(csrfToken: string) {\n this.csrf = csrfToken;\n }\n\n setAcceptLanguage(locale: string) {\n this.defaultHeaders['Accept-Language'] = locale;\n }\n\n setEnableLogging(enable: boolean) {\n this.enableLogging = enable;\n }\n\n setIncludeCookies(include: boolean) {\n this.includeCookies = include;\n }\n\n setUserId(userId: string) {\n this.userId = userId;\n }\n\n setUserRoles(roles: string) {\n this.userRoles = roles;\n }\n\n setDiagnosticId(diagnosticId: string) {\n this.diagnosticId = diagnosticId;\n }\n\n enableRudderEvents() {\n this.isRudderKeySet = true;\n }\n\n getServerVersion() {\n return this.serverVersion;\n }\n\n getUrlVersion() {\n return this.urlVersion;\n }\n\n getBaseRoute() {\n return `${this.getUrl()}${this.urlVersion}`;\n }\n\n getAccountsRoute() {\n return `${this.getBaseRoute()}/accounts`;\n }\n\n getCSRFFromCookie() {\n if (typeof document !== 'undefined' && typeof document.cookie !== 'undefined') {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].trim();\n if (cookie.startsWith('MMCSRF=')) {\n return cookie.replace('MMCSRF=', '');\n }\n }\n }\n return '';\n }\n\n getOptions(options: Options) {\n const newOptions: Options = {...options};\n\n const headers: {[x: string]: string} = {\n [HEADER_REQUESTED_WITH]: 'XMLHttpRequest',\n ...this.defaultHeaders,\n };\n\n if (this.token) {\n headers[HEADER_AUTH] = `${HEADER_BEARER} ${this.token}`;\n }\n\n const csrfToken = this.csrf || this.getCSRFFromCookie();\n if (options.method && options.method.toLowerCase() !== 'get' && csrfToken) {\n headers[HEADER_X_CSRF_TOKEN] = csrfToken;\n }\n\n if (this.includeCookies) {\n newOptions.credentials = 'include';\n }\n\n if (this.userAgent) {\n headers[HEADER_USER_AGENT] = this.userAgent;\n }\n\n if (newOptions.headers) {\n Object.assign(headers, newOptions.headers);\n }\n\n return {\n ...newOptions,\n headers,\n };\n }\n\n getTranslations = (url: string) => {\n return this.doFetch<Record<string, string>>(\n url,\n {method: 'get'},\n );\n }\n\n\n logClientError = (message: string, level = 'ERROR') => {\n // const url = `${this.getBaseRoute()}/logs`;\n\n // if (!this.enableLogging) {\n // throw new ClientError(this.getUrl(), {\n // message: 'Logging disabled.',\n // url,\n // });\n // }\n\n // return this.doFetch<{\n // message: string;\n // }>(\n // url,\n // {method: 'post', body: JSON.stringify({message, level})},\n // );\n };\n\n login = (user: string | object, password: string, token = '', deviceId = '') => {\n this.trackEvent('api', 'api_users_login');\n const body: any = {\n device_id: deviceId,\n user,\n password,\n token,\n locale: getBrowserLocale()\n };\n\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/login`,\n {method: 'POST', body: JSON.stringify(body)},\n );\n\n };\n\n\n createUser = (user: UserProfile, token: string, inviteId: string, redirect: string) => {\n this.trackEvent('api', 'api_users_createUser');\n\n const queryParams: any = {};\n\n if (token) {\n queryParams.t = token;\n }\n\n if (inviteId) {\n queryParams.iid = inviteId;\n }\n\n if (redirect) {\n queryParams.r = redirect;\n }\n\n const auth:any = this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/register${buildQueryString(queryParams)}`,\n {method: 'POST', body: JSON.stringify(user)},\n );\n\n return auth\n };\n\n createSpace = (name: string) => {\n this.trackEvent('api', 'api_users_createTenant');\n\n const queryParams: any = {};\n\n const auth:any = this.doFetch<UserProfile>(\n `${this.getBaseRoute()}/api/v4/spaces/register/tenant${buildQueryString(queryParams)}`,\n {method: 'POST', body: JSON.stringify({name: name})},\n );\n\n return auth\n };\n\n sendVerificationToken = (user: string) => {\n this.trackEvent('api', 'api_users_verify');\n\n const body: any = {\n user: user,\n };\n\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/sendVerificationCode`,\n {method: 'POST', body: JSON.stringify(body)},\n );\n };\n\n getSettings = () => {\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/settings`,\n {method: 'get'},\n );\n };\n\n getMe = () => {\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/user`,\n {method: 'get'},\n );\n };\n\n getMySpaces = () => {\n return this.doFetch<Space[]>(\n `${this.getAccountsRoute()}/user/spaces`,\n {method: 'get'},\n );\n };\n\n logout = async () => {\n this.trackEvent('api', 'api_users_logout');\n\n const {response} = await this.doFetchWithResponse(\n `${this.getAccountsRoute()}/logout`,\n {method: 'post'},\n );\n\n if (response.ok) {\n this.token = '';\n }\n\n this.serverVersion = '';\n \n return response;\n };\n\n // Client Helpers\n\n doFetch = async <T>(url: string, options: Options): Promise<T> => {\n const {data} = await this.doFetchWithResponse<T>(url, options);\n\n return data;\n };\n\n doFetchWithResponse = async <T>(url: string, options: Options): Promise<ClientResponse<T>> => {\n const response = await fetch(url, this.getOptions(options));\n const headers = parseAndMergeNestedHeaders(response.headers);\n\n let data;\n try {\n data = await response.json();\n } catch (err) {\n throw new ClientError(this.getUrl(), {\n message: 'Received invalid response from the server.',\n intl: {\n id: 'mobile.request.invalid_response',\n defaultMessage: 'Received invalid response from the server.',\n },\n url,\n });\n }\n\n if (headers.has(HEADER_X_VERSION_ID) && !headers.get('Cache-Control')) {\n const serverVersion = headers.get(HEADER_X_VERSION_ID);\n if (serverVersion && this.serverVersion !== serverVersion) {\n this.serverVersion = serverVersion as string;\n }\n }\n\n if (headers.has(HEADER_X_CLUSTER_ID)) {\n const clusterId = headers.get(HEADER_X_CLUSTER_ID);\n if (clusterId && this.clusterId !== clusterId) {\n this.clusterId = clusterId as string;\n }\n }\n\n if (response.ok) {\n return {\n response,\n headers: headers as Map<string, string>,\n data,\n };\n }\n\n const msg = data.message || '';\n\n if (this.logToConsole) {\n console.error(msg); // eslint-disable-line no-console\n }\n\n throw new ClientError(this.getUrl(), {\n message: msg,\n server_error_id: data.id,\n status_code: data.status_code,\n url,\n });\n };\n\n trackEvent(category: string, event: string, props?: any) {\n if (!this.isRudderKeySet) {\n return;\n }\n\n const properties = Object.assign({\n category,\n type: event,\n // user_actual_role: this.userRoles && isSystemAdmin(this.userRoles) ? 'system_admin, system_user' : 'system_user',\n user_actual_id: this.userId,\n }, props);\n const options = {\n context: {\n ip: '0.0.0.0',\n },\n page: {\n path: '',\n referrer: '',\n search: '',\n title: '',\n url: '',\n },\n anonymousId: '00000000000000000000000000',\n };\n\n // rudderAnalytics.track('event', properties, options);\n }\n\n changePassword = (oldPassword: string, newPassword: string)=>{\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/changePassword`,\n {method: 'POST', body: JSON.stringify({\n oldPassword: oldPassword,\n newPassword: newPassword,\n })},\n );\n }\n\n verifyEmail = (email: string, code: string)=>{\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/verify/email`,\n {method: 'POST', body: JSON.stringify({\n email: email,\n code: code,\n })},\n );\n }\n\n verifyMobile = (mobile: string, code: string)=>{\n return this.doFetch<UserProfile>(\n `${this.getAccountsRoute()}/password/verify/mobile`,\n {method: 'POST', body: JSON.stringify({\n mobile: mobile,\n code: code,\n })},\n );\n }\n\n // _initLocalStorage(ROOT_URL_PATH_PREFIX){\n // if (ROOT_URL_PATH_PREFIX) {\n // let namespace = `:${ROOT_URL_PATH_PREFIX}`;\n // this.LOGIN_TOKEN_KEY += namespace;\n // this.LOGIN_TOKEN_EXPIRES_KEY += namespace;\n // this.USER_ID_KEY += namespace;\n // }\n // }\n\n // _getTokenLifetimeMs() {\n // const loginExpirationInDays = (this.loginExpirationInDays === null) ? LOGIN_UNEXPIRING_TOKEN_DAYS : this.loginExpirationInDays;\n // return (loginExpirationInDays || DEFAULT_LOGIN_EXPIRATION_DAYS) * 24 * 60 * 60 * 1000;\n // }\n\n // _tokenExpiration(when) {\n // return new Date((new Date(when)).getTime() + this._getTokenLifetimeMs());\n // }\n \n // _storeLoginToken(userId, token, tokenExpires) {\n // localStorage.setItem(this.USER_ID_KEY, userId);\n // localStorage.setItem(this.LOGIN_TOKEN_KEY, token);\n // if (! tokenExpires)\n // tokenExpires = this._tokenExpiration(new Date());\n // localStorage.setItem(this.LOGIN_TOKEN_EXPIRES_KEY, tokenExpires);\n \n // this._lastLoginTokenWhenPolled = token;\n // };\n \n // _unstoreLoginToken() {\n // localStorage.removeItem(this.USER_ID_KEY);\n // localStorage.removeItem(this.LOGIN_TOKEN_KEY);\n // localStorage.removeItem(this.LOGIN_TOKEN_EXPIRES_KEY);\n\n // this._lastLoginTokenWhenPolled = null;\n // };\n}\n\nfunction parseAndMergeNestedHeaders(originalHeaders: any) {\n const headers = new Map();\n let nestedHeaders = new Map();\n originalHeaders.forEach((val: string, key: string) => {\n const capitalizedKey = key.replace(/\\b[a-z]/g, (l) => l.toUpperCase());\n let realVal = val;\n if (val && val.match(/\\n\\S+:\\s\\S+/)) {\n const nestedHeaderStrings = val.split('\\n');\n realVal = nestedHeaderStrings.shift() as string;\n const moreNestedHeaders = new Map(\n nestedHeaderStrings.map((h: any) => h.split(/:\\s/)),\n );\n nestedHeaders = new Map([...nestedHeaders, ...moreNestedHeaders]);\n }\n headers.set(capitalizedKey, realVal);\n });\n return new Map([...headers, ...nestedHeaders]);\n}\n\nexport class ClientError extends Error implements ServerError {\n url?: string;\n intl?: {\n id: string;\n defaultMessage: string;\n values?: any;\n };\n server_error_id?: string;\n status_code?: number;\n\n constructor(baseUrl: string, data: ServerError) {\n super(data.message + ': ' + cleanUrlForLogging(baseUrl, data.url || ''));\n\n this.message = data.message;\n this.url = data.url;\n this.intl = data.intl;\n this.server_error_id = data.server_error_id;\n this.status_code = data.status_code;\n\n // Ensure message is treated as a property of this class when object spreading. Without this,\n // copying the object by using `{...error}` would not include the message.\n Object.defineProperty(this, 'message', {enumerable: true});\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n// @flow\n\n// Given a URL from an API request, return a URL that has any parts removed that are either sensitive or that would\n// prevent properly grouping the messages in Sentry.\nexport function cleanUrlForLogging(baseUrl, apiUrl) {\n let url = apiUrl;\n\n // Trim the host name\n url = url.substring(baseUrl.length);\n\n // Filter the query string\n const index = url.indexOf('?');\n if (index !== -1) {\n url = url.substring(0, index);\n }\n\n // A non-exhaustive whitelist to exclude parts of the URL that are unimportant (eg IDs) or may be sentsitive\n // (eg email addresses). We prefer filtering out fields that aren't recognized because there should generally\n // be enough left over for debugging.\n //\n // Note that new API routes don't need to be added here since this shouldn't be happening for newly added routes.\n const whitelist = [\n 'api', 'v4', 'users', 'teams', 'scheme', 'name', 'members', 'channels', 'posts', 'reactions', 'commands',\n 'files', 'preferences', 'hooks', 'incoming', 'outgoing', 'oauth', 'apps', 'emoji', 'brand', 'image',\n 'data_retention', 'jobs', 'plugins', 'roles', 'system', 'timezones', 'schemes', 'redirect_location', 'patch',\n 'mfa', 'password', 'reset', 'send', 'active', 'verify', 'terms_of_service', 'login', 'logout', 'ids',\n 'usernames', 'me', 'username', 'email', 'default', 'sessions', 'revoke', 'all', 'audits', 'device', 'status',\n 'search', 'switch', 'authorized', 'authorize', 'deauthorize', 'tokens', 'disable', 'enable', 'exists', 'unread',\n 'invite', 'batch', 'stats', 'import', 'schemeRoles', 'direct', 'group', 'convert', 'view', 'search_autocomplete',\n 'thread', 'info', 'flagged', 'pinned', 'pin', 'unpin', 'opengraph', 'actions', 'thumbnail', 'preview', 'link',\n 'delete', 'logs', 'ping', 'config', 'client', 'license', 'websocket', 'webrtc', 'token', 'regen_token',\n 'autocomplete', 'execute', 'regen_secret', 'policy', 'type', 'cancel', 'reload', 'environment', 's3_test', 'file',\n 'caches', 'invalidate', 'database', 'recycle', 'compliance', 'reports', 'cluster', 'ldap', 'test', 'sync', 'saml',\n 'certificate', 'public', 'private', 'idp', 'elasticsearch', 'purge_indexes', 'analytics', 'old', 'webapp', 'fake',\n ];\n\n url = url.split('/').map((part) => {\n if (part !== '' && whitelist.indexOf(part) === -1) {\n return '<filtered>';\n }\n\n return part;\n }).join('/');\n\n if (index !== -1) {\n // Add this on afterwards since it wouldn't pass the whitelist\n url += '?<filtered>';\n }\n\n return url;\n}\n","\nimport ClientClass4, {DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID} from './client4';\n\nconst Client4 = new ClientClass4();\n\nif ((typeof(window) !== 'undefined'))\n window['Client4'] = Client4;\n\nexport {\n Client4, DEFAULT_LIMIT_AFTER, DEFAULT_LIMIT_BEFORE, HEADER_X_VERSION_ID,\n}\n","\nimport {ErrorTypes} from '../action_types';\nimport {serializeError, ErrorObject} from 'serialize-error';\nimport {Client4} from '../client';\n// import EventEmitter from './utils/event_emitter';\nimport {DispatchFunc, ActionFunc} from '../types/actions';\nimport {ServerError} from '../types/errors';\n\nexport function dismissErrorObject(index: number) {\n return {\n type: ErrorTypes.DISMISS_ERROR,\n index,\n data: null,\n };\n}\n\nexport function dismissError(index: number): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n dispatch(dismissErrorObject(index));\n\n return {data: true};\n };\n}\n\nexport function getLogErrorAction(error: ErrorObject, displayable = false) {\n return {\n type: ErrorTypes.LOG_ERROR,\n displayable,\n error,\n data: null,\n };\n}\n\nexport function logError(error: ServerError, displayable = false): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n // if (error.server_error_id === 'api.context.session_expired.app_error') {\n // return {data: true};\n // }\n\n // const serializedError = serializeError(error);\n\n // let sendToServer = true;\n // if (error.stack && error.stack.includes('TypeError: Failed to fetch')) {\n // sendToServer = false;\n // }\n // if (error.server_error_id) {\n // sendToServer = false;\n // }\n\n // if (sendToServer) {\n // try {\n // const stringifiedSerializedError = JSON.stringify(serializedError).toString();\n // await Client4.logClientError(stringifiedSerializedError);\n // } catch (err) {\n // // avoid crashing the app if an error sending\n // // the error occurs.\n // }\n // }\n\n // // EventEmitter.emit(ErrorTypes.LOG_ERROR, error);\n // dispatch(getLogErrorAction(serializedError, displayable));\n\n return {data: true};\n };\n}\n\nexport function clearErrors(): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n dispatch({type: ErrorTypes.CLEAR_ERRORS, data: null});\n\n return {data: true};\n };\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\nimport {Client4} from '../client';\nimport {UserTypes} from '../action_types';\n\nimport {Client4Error} from '../types/client4';\nimport {batchActions, Action, ActionFunc, GenericAction, DispatchFunc, GetStateFunc} from '../types/actions';\n\nimport {logError} from './errors';\n\ntype ActionType = string;\nconst HTTP_UNAUTHORIZED = 401;\nexport function forceLogoutIfNecessary(err: Client4Error, dispatch: DispatchFunc, getState: GetStateFunc) {\n const {currentUserId} = getState().entities.users;\n\n if ('status_code' in err && err.status_code === HTTP_UNAUTHORIZED && err.url && err.url.indexOf('/login') === -1 && currentUserId) {\n Client4.setToken('');\n dispatch({type: UserTypes.LOGOUT_SUCCESS, data: {}});\n }\n}\n\nfunction dispatcher(type: ActionType, data: any, dispatch: DispatchFunc) {\n if (type.indexOf('SUCCESS') === -1) { // we don't want to pass the data for the request types\n dispatch(requestSuccess(type, data));\n } else {\n dispatch(requestData(type));\n }\n}\n\nexport function requestData(type: ActionType): GenericAction {\n return {\n type,\n data: null,\n };\n}\n\nexport function requestSuccess(type: ActionType, data: any) {\n return {\n type,\n data,\n };\n}\n\nexport function requestFailure(type: ActionType, error: Client4Error): any {\n return {\n type,\n error,\n };\n}\n\n/**\n * Returns an ActionFunc which calls a specfied (client) function and\n * dispatches the specifed actions on request, success or failure.\n *\n * @export\n * @param {Object} obj an object for destructirung required properties\n * @param {() => Promise<mixed>} obj.clientFunc clientFunc to execute\n * @param {ActionType} obj.onRequest ActionType to dispatch on request\n * @param {(ActionType | Array<ActionType>)} obj.onSuccess ActionType to dispatch on success\n * @param {ActionType} obj.onFailure ActionType to dispatch on failure\n * @param {...Array<any>} obj.params\n * @returns {ActionFunc} ActionFunc\n */\n\nexport function bindClientFunc({\n clientFunc,\n onRequest,\n onSuccess,\n onFailure,\n params = [],\n}: {\n clientFunc: (...args: any[]) => Promise<any>;\n onRequest?: ActionType;\n onSuccess?: ActionType | Array<ActionType>;\n onFailure?: ActionType;\n params?: Array<any>;\n}): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n if (onRequest) {\n dispatch(requestData(onRequest));\n }\n\n let data: any = null;\n try {\n data = await clientFunc(...params);\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n const actions: Action[] = [logError(error)];\n if (onFailure) {\n actions.push(requestFailure(onFailure, error));\n }\n dispatch(batchActions(actions));\n return {error};\n }\n\n if (Array.isArray(onSuccess)) {\n onSuccess.forEach((s) => {\n dispatcher(s, data, dispatch);\n });\n } else if (onSuccess) {\n dispatcher(onSuccess, data, dispatch);\n }\n\n return {data};\n };\n}\n\n// Debounce function based on underscores modified to use es6 and a cb\n\nexport function debounce(func: (...args: any) => unknown, wait: number, immediate: boolean, cb: () => unknown) {\n //let timeout: NodeJS.Timeout|null;\n let timeout: any;\n return function fx(...args: Array<any>) {\n const runLater = () => {\n timeout = null;\n if (!immediate) {\n Reflect.apply(func, this, args);\n if (cb) {\n cb();\n }\n }\n };\n const callNow = immediate && !timeout;\n if (timeout) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(runLater, wait);\n if (callNow) {\n Reflect.apply(func, this, args);\n if (cb) {\n cb();\n }\n }\n };\n}\n\nexport class FormattedError extends Error {\n intl: {\n id: string;\n defaultMessage: string;\n values: any;\n };\n\n constructor(id: string, defaultMessage: string, values: any = {}) {\n super(defaultMessage);\n this.intl = {\n id,\n defaultMessage,\n values,\n };\n }\n}","import store from './redux_store';\n\nconst getBasePath = () => {return 'steedos'}\nconst getPreviousSpaceIdKey = (userId) => ['user_prev_space', userId].join(':');\nconst getWasLoggedInKey = () => 'was_logged_in';\n\n\nconst getPathScopedKey = (path, key) => {\n if (path === '' || path === '/') {\n return key;\n }\n\n return [path, key].join(':');\n};\n\n\nclass LocalStorageStoreClass {\n \n getItem(key, state = store.getState()) {\n const basePath = getBasePath();\n\n return localStorage.getItem(getPathScopedKey(basePath, key));\n }\n\n setItem(key, value) {\n const state = store.getState();\n const basePath = getBasePath();\n\n localStorage.setItem(getPathScopedKey(basePath, key), value);\n }\n\n removeItem(key) {\n const state = store.getState();\n const basePath = getBasePath();\n\n localStorage.removeItem(getPathScopedKey(basePath, key));\n }\n\n getPreviousSpaceId(userId) {\n if (!userId)\n userId = this.getItem('userId');\n return this.getItem(getPreviousSpaceIdKey(userId));\n }\n\n setPreviousSpaceId(userId, spaceId) {\n this.setItem(getPreviousSpaceIdKey(userId), spaceId);\n this.setItem('spaceId', spaceId);\n localStorage.setItem('spaceId', spaceId);\n }\n\n getUserId() {\n return this.getItem('userId')\n }\n\n setUserId(userId, token?:string) {\n if (userId) {\n this.setItem('userId', userId)\n this.setItem('token', token)\n this.setItem(getWasLoggedInKey(), 'true');\n } else {\n this.removeItem('userId')\n this.removeItem('token')\n this.removeItem('spaceId')\n localStorage.removeItem('spaceId');\n this.setItem(getWasLoggedInKey(), 'false');\n }\n }\n\n setWasLoggedIn(wasLoggedIn) {\n if (wasLoggedIn) {\n this.setItem(getWasLoggedInKey(), 'true');\n } else {\n this.setItem(getWasLoggedInKey(), 'false');\n }\n }\n\n getWasLoggedIn() {\n return this.getItem(getWasLoggedInKey()) === 'true';\n }\n}\n\nconst LocalStorageStore = new LocalStorageStoreClass();\n\nif (typeof window !== 'undefined')\n window['LocalStorageStore'] = LocalStorageStore;\n\nexport default LocalStorageStore;\n","import { GlobalState } from \"../../types/store\";\n\nexport function getSpaces(state: GlobalState) {\n return state.entities.spaces.spaces;\n}\n\nexport function getMySpaces(state: GlobalState) {\n return Object.values(state.entities.spaces.spaces);\n}\n\nexport function getSpaceCount(state: GlobalState) {\n return Object.keys(state.entities.spaces.spaces).length;\n}\n\nexport function getCurrentSpace(state: GlobalState) {\n return state.entities.spaces.spaces[getCurrentSpaceId(state)];\n}\n\nexport function getCurrentSpaceId(state: GlobalState) {\n return state.entities.spaces.currentSpaceId;\n}\n\nexport function getSpace(state: GlobalState, spaceId: string) {\n return state.entities.spaces.spaces[spaceId];\n}\n","import {Client4} from '../client';\nimport {GetStateFunc, DispatchFunc, ActionFunc, ActionResult, batchActions, Action} from '../types/actions';\nimport {SpaceTypes, UserTypes} from '../action_types';\nimport {Space, SpaceUser} from '../types/spaces';\nimport {logError} from './errors';\nimport {bindClientFunc, forceLogoutIfNecessary} from './helpers';\nimport LocalStorageStore from '../stores/local_storage_store';\nimport { getCurrentUserId } from '../selectors/entities/users';\nimport { getSpace } from '../selectors/entities/spaces';\nimport { getRootUrl } from '../selectors/settings';\nimport store from '../stores/redux_store';\n\nimport { hashHistory } from \"../utils/hash_history\";\n\nexport function selectSpace(spaceId?: string | null): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const userId = getCurrentUserId(getState());\n if (!userId)\n return {data: false};\n let selectedSpaceId = spaceId;\n \n if (!selectedSpaceId)\n selectedSpaceId = LocalStorageStore.getPreviousSpaceId(userId);\n else {\n const space = getSpace(getState(), selectedSpaceId);\n if (!space)\n return {data: false};\n }\n\n dispatch({\n type: SpaceTypes.SELECT_SPACE,\n data: selectedSpaceId,\n });\n LocalStorageStore.setPreviousSpaceId(userId, selectedSpaceId);\n\n return {data: selectedSpaceId};\n };\n}\n\nexport function getMySpaces(): ActionFunc {\n return bindClientFunc({\n clientFunc: Client4.getMySpaces,\n onRequest: SpaceTypes.MY_SPACES_REQUEST,\n onSuccess: [SpaceTypes.RECEIVED_SPACES_LIST, SpaceTypes.MY_SPACES_SUCCESS],\n onFailure: SpaceTypes.MY_SPACES_FAILURE,\n });\n}\n\n\nexport function createSpace(name: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n let space:any = null;\n\n try {\n space = await Client4.createSpace(name);\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n dispatch(logError(error));\n return {error};\n }\n\n if (space && space._id) {\n const promises = [\n dispatch(getMySpaces()),\n dispatch(selectSpace(space._id)),\n // dispatch(getClientConfig()),\n ];\n \n try {\n await Promise.all(promises);\n } catch (error) {\n return {error};\n }\n }\n\n return {data: space};\n };\n}\n\n\nexport function goSpaceHome(location, spaceId: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const userId: any = LocalStorageStore.getItem('userId');\n const authToken: any = LocalStorageStore.getItem('token');\n const spaceId: any = LocalStorageStore.getItem('spaceId');\n const rootUrl: any = getRootUrl(store.getState());\n\n const searchParams = new URLSearchParams(location.search);\n let redirect_uri = searchParams.get(\"redirect_uri\");\n \n if (redirect_uri){\n if(!redirect_uri.startsWith(\"http://\") && !redirect_uri.startsWith(\"https://\")){\n redirect_uri = window.location.origin + redirect_uri\n }\n let u = new URL(redirect_uri);\n u.searchParams.append('X-Space-Id',spaceId);\n u.searchParams.append('X-Auth-Token',authToken);\n u.searchParams.append('X-User-Id',userId);\n window.location.href = u.toString();\n }\n else{\n window.location.href = rootUrl ? rootUrl : \"/\";\n }\n\n return { data: true };\n }\n}","import { GlobalState } from \"../types/store\";\n\nexport function getRootUrl(state: GlobalState) {\n console.log(state)\n return state.settings.root_url;\n}\n","import {Action, ActionFunc, ActionResult, batchActions, DispatchFunc, GetStateFunc} from '../types/actions';\n\nimport { UserTypes } from '../action_types';\nimport { UserProfile } from '../types/users';\nimport { Client4 } from '../client/';\nimport {logError} from './errors';\nimport {bindClientFunc, forceLogoutIfNecessary, debounce} from './helpers';\nimport { getMySpaces, selectSpace } from './spaces';\nimport LocalStorageStore from '../stores/local_storage_store';\n\nexport function createUser(user: UserProfile, token: string, inviteId: string, redirect: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n let created;\n\n try {\n created = await Client4.createUser(user, token, inviteId, redirect);\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n dispatch(logError(error));\n return {error};\n }\n\n dispatch({type: UserTypes.RECEIVED_ME, data: created.user});\n return completeLogin(created)(dispatch, getState);\n };\n}\n\nexport function login(loginId: string, password: string, mfaToken = ''): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.LOGIN_REQUEST, data: null});\n\n const deviceId = getState().entities.general.deviceToken;\n let data;\n\n try {\n data = await Client4.login(loginId, password, mfaToken, deviceId);\n if(data._next){\n return {error: data._next};\n }\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.LOGIN_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return completeLogin(data)(dispatch, getState);\n };\n}\n\n\nfunction completeLogin(data: any): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({\n type: UserTypes.RECEIVED_ME,\n data: data.user,\n });\n Client4.setToken(data.token);\n Client4.setUserId(data.user._id);\n\n if (data.user && data.user._id) {\n LocalStorageStore.setUserId(data.user._id, data.token); \n }\n \n const promises = [\n dispatch(getMySpaces()),\n dispatch(selectSpace()),\n // dispatch(getClientConfig()),\n ];\n\n try {\n await Promise.all(promises);\n } catch (error) {\n dispatch(batchActions([\n {type: UserTypes.LOGIN_FAILURE, error},\n logError(error),\n ]));\n return {error};\n }\n\n dispatch(batchActions([\n {\n type: UserTypes.LOGIN_SUCCESS,\n },\n ]));\n\n\n if(window.ReactNativeWebView && window.ReactNativeWebView.postMessage){\n window.ReactNativeWebView.postMessage(JSON.stringify({\n \"X-Auth-Token\": data.token,\n \"X-User-Id\": data.user._id,\n \"X-Access-Token\": data.tokens.accessToken\n }))\n }\n\n return {data: true, _next: data._next};\n };\n}\n\nexport function loadMe(): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const state = getState();\n\n // const deviceId = state.entities.general.deviceToken;\n // if (deviceId) {\n // Client4.attachDevice(deviceId);\n // }\n\n const promises = [\n dispatch(getMe()),\n dispatch(getMySpaces()),\n dispatch(selectSpace()),\n ];\n\n await Promise.all(promises);\n\n const {currentUserId} = getState().entities.users;\n const user = getState().entities.users.users[currentUserId];\n if (currentUserId) {\n Client4.setUserId(currentUserId);\n }\n\n return {data: true};\n };\n}\n\nexport function logout(): ActionFunc {\n return async (dispatch: DispatchFunc) => {\n dispatch({type: UserTypes.LOGOUT_REQUEST, data: null});\n\n try {\n await Client4.logout();\n } catch (error) {\n // nothing to do here\n }\n\n LocalStorageStore.setUserId(null);\n dispatch({type: UserTypes.LOGOUT_SUCCESS, data: null});\n\n return {data: true};\n };\n}\n\n\nexport function getMe(): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n\n if (!LocalStorageStore.getItem('userId'))\n return {error: 'user not found.'} \n\n const getMeFunc = bindClientFunc({\n clientFunc: Client4.getMe,\n onSuccess: UserTypes.RECEIVED_ME,\n });\n const me = await getMeFunc(dispatch, getState);\n\n if ('error' in me) {\n LocalStorageStore.removeItem('userId');\n return me;\n }\n // if ('data' in me) {\n // dispatch(loadRolesIfNeeded(me.data.roles.split(' ')));\n // }\n return me;\n };\n}\n\nexport function sendVerificationToken(loginId: string): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n const deviceId = getState().entities.general.deviceToken;\n let data;\n \n try {\n data = await Client4.sendVerificationToken(loginId);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.VERIFICATION_TOKEN_RECIEVED,\n error,\n },\n //logError(error),\n ]));\n return {error};\n }\n \n return data;\n };\n }\n \nexport function changePassword(oldPassword: string, newPassword: string){\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.CHANGEPASSWORD_REQUEST, data: null});\n let data;\n try {\n const getChangePasswordFunc = bindClientFunc({\n clientFunc: Client4.changePassword,\n onSuccess: UserTypes.CHANGEPASSWORD_RECEIVED,\n params: [oldPassword, newPassword]\n });\n \n data = await getChangePasswordFunc(dispatch, getState);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.CHANGEPASSWORD_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return data;\n };\n}\n\nexport function verifyEmail(email: string, code: string){\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.VERIFYEMAIL_REQUEST, data: null});\n let data;\n try {\n const getVerifyEmailFunc = bindClientFunc({\n clientFunc: Client4.verifyEmail,\n onSuccess: UserTypes.VERIFYEMAIL_RECEIVED,\n params: [email, code]\n });\n \n data = await getVerifyEmailFunc(dispatch, getState);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.VERIFYEMAIL_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return data;\n };\n}\n\nexport function verifyMobile(mobile: string, code: string){\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n dispatch({type: UserTypes.VERIFYMOBILE_REQUEST, data: null});\n let data;\n try {\n const getVerifyMobileFunc = bindClientFunc({\n clientFunc: Client4.verifyMobile,\n onSuccess: UserTypes.VERIFYMOBILE_RECEIVED,\n params: [mobile, code]\n });\n data = await getVerifyMobileFunc(dispatch, getState);\n } catch (error) {\n dispatch(batchActions([\n {\n type: UserTypes.VERIFYMOBILE_FAILURE,\n error,\n },\n logError(error),\n ]));\n return {error};\n }\n\n return data;\n };\n}","import { hashHistory } from \"../utils/hash_history\";\nimport { logout, loadMe } from \"./users\";\nimport store from '../stores/redux_store';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport { getMySpaces, getCurrentSpaceId, getSpace } from '../selectors/entities/spaces';\nimport LocalStorageStore from '../stores/local_storage_store';\nimport { selectSpace } from '../actions/spaces';\n\n\nconst dispatch = store.dispatch;\nconst getState = store.getState;\n\nexport function emitUserLoggedOutEvent(redirectToPath, shouldSignalLogout = true, userAction = true) {\n // If the logout was intentional, discard knowledge about having previously been logged in.\n // This bit is otherwise used to detect session expirations on the login page.\n if (userAction) {\n }\n\n if (!redirectToPath)\n redirectToPath = '/login'\n\n dispatch(logout()).then(() => {\n LocalStorageStore.setUserId(null);\n\n // if (shouldSignalLogout) {\n // BrowserStore.signalLogout();\n // }\n\n // BrowserStore.clear();\n // stopPeriodicStatusUpdates();\n // WebsocketActions.close();\n\n // clearUserCookie();\n\n redirectTo(redirectToPath);\n }).catch((e) => {\n console.log(e);\n redirectTo(redirectToPath);\n });\n}\n\n\nexport async function selectDefaultSpace(location) {\n let state = getState();\n\n // Assume we need to load the user if they don't have any team memberships loaded or the user loaded\n let user = getCurrentUser(state);\n \n if (!user) {\n return;\n }\n \n // const locale = getCurrentLocale(state);\n const spaceId = LocalStorageStore.getPreviousSpaceId(user.id);\n\n const space = getSpace(state, spaceId);\n if (space) {\n dispatch(selectSpace(space._id));\n return space._id;\n } else {\n hashHistory.push({\n pathname: '/select-space',\n search: location.search\n });\n }\n}\n\nexport async function redirectUserToDefaultSpace(location) {\n const spaceId = await selectDefaultSpace(location);\n hashHistory.push({\n pathname: `/home/${spaceId}`,\n search: location.search\n });\n}\n\nexport async function redirectUserToUpdatePassword(location){\n hashHistory.push({\n pathname: '/update-password',\n search: location.search\n });\n}\n\nexport async function redirectUserToVerifyEmail(location){\n hashHistory.push({\n pathname: '/verify/email',\n search: location.search\n });\n}\n\nexport async function redirectUserToVerifyMobile(location){\n hashHistory.push({\n pathname: '/verify/mobile',\n search: location.search\n });\n}\n\nexport function redirectTo(redirectTo, location) {\n\n if (!redirectTo) \n return;\n\n if (redirectTo && redirectTo.indexOf('no_redirect=1')<0) {\n const userId = LocalStorageStore.getItem('userId');\n const authToken = LocalStorageStore.getItem('token');\n const spaceId = LocalStorageStore.getItem('spaceId');\n \n redirectTo = redirectTo.indexOf(\"?\")>0?redirectTo+'&no_redirect=1':redirectTo+'?no_redirect=1'\n if (userId && authToken){\n redirectTo = `${redirectTo}&X-Auth-Token=${authToken}&X-User-Id=${userId}&X-Space-Id=${spaceId}`\n }\n\n if (redirectTo.match(/^\\/([^/]|$)/)){\n if(location){\n hashHistory.push({\n pathname: redirectTo,\n search: location.search\n })\n }else{\n hashHistory.push(redirectTo);\n }\n }\n else\n document.location.href=redirectTo\n }\n\n}\n\nexport function finishSignin(currentUser, tenant, location){\n let password_expired = currentUser.password_expired;\n if(password_expired){\n redirectUserToUpdatePassword(location);\n return;\n }\n \n let enable_bind_mobile = tenant.enable_bind_mobile;\n if(enable_bind_mobile && !currentUser.mobile_verified){\n redirectUserToVerifyMobile(location);\n return;\n }\n\n let enable_bind_email = tenant.enable_bind_email;\n if(enable_bind_email && !currentUser.email_verified){\n redirectUserToVerifyEmail(location);\n return;\n }\n\n if(location){\n hashHistory.push({\n pathname: '/home',\n search: location.search\n })\n }else{\n hashHistory.push('/home');\n }\n // let redirect_uri = new URLSearchParams(location?location.search:\"\").get('redirect_uri')\n // if (!redirect_uri)\n // redirect_uri = '/'\n // redirectTo(redirect_uri, location);\n}","\nimport * as UserActions from '../actions/users';\nimport { loadSettings } from '../actions/settings';\nimport LocalStorageStore from '../stores/local_storage_store';\nimport {Client4} from '../client';\n\nexport function loadMeAndConfig() {\n return async (dispatch) => {\n\n const token = LocalStorageStore.getItem('token')\n if (token)\n Client4.setToken(token);\n\n // if any new promise needs to be added please be mindful of the order as it is used in root.jsx for redirection\n const promises = [\n dispatch(loadSettings()),\n // dispatch(getLicenseConfig()),\n ];\n\n // // need to await for clientConfig first as it is required for loadMe\n const resolvedPromises = await Promise.all(promises);\n if (LocalStorageStore.getWasLoggedIn()) {\n resolvedPromises.push(await dispatch(UserActions.loadMe()));\n }\n\n return resolvedPromises;\n };\n}","\n\nimport { Client4 } from \"../client\";\nimport { loadMe } from \"./users\";\nimport { GeneralState } from \"../types/general\";\nimport { GeneralTypes } from \"../action_types\";\nimport {bindClientFunc, forceLogoutIfNecessary, FormattedError} from './helpers';\nimport {GetStateFunc, DispatchFunc, ActionFunc, batchActions} from '../types/actions';\n\nexport function loadSettings(): ActionFunc {\n return async (dispatch: DispatchFunc, getState: GetStateFunc) => {\n let data;\n try {\n data = await Client4.getSettings();\n } catch (error) {\n forceLogoutIfNecessary(error, dispatch, getState);\n return {error};\n }\n\n Client4.setEnableLogging(data.EnableDeveloper === 'true');\n Client4.setDiagnosticId(data.DiagnosticId);\n\n dispatch({\n type: GeneralTypes.RECEIVED_SETTINGS,\n data: data,\n });\n\n return {data};\n };\n}","import React, { useState, useEffect } from 'react';\nimport { connect } from 'react-redux';\nimport Backdrop from '@material-ui/core/Backdrop';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { makeStyles, createStyles, Theme } from '@material-ui/core/styles';\nimport { getRequests } from '../selectors'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n backdrop: {\n zIndex: theme.zIndex.drawer + 1,\n color: '#fff',\n backgroundColor: 'rgba(0, 0, 0, 0.0)',\n },\n }),\n);\n\nconst Loading = ({ requests }: any) =>{\n const classes = useStyles({});\n const [open, setOpen] = React.useState(false);\n const handleClose = () => {\n setOpen(false);\n };\n const handleOpen = () => {\n setOpen(true);\n };\n\n useEffect(() => {\n if(requests.status === 'started'){\n handleOpen();\n }else{\n handleClose();\n }\n }, [requests]);\n\n return (\n <div>\n <Backdrop className={classes.backdrop} open={open}>\n <CircularProgress />\n </Backdrop>\n </div>\n );\n}\n\n\nfunction mapStateToProps(state: any) {\n return {\n requests: getRequests(state)\n };\n }\n \nexport default connect(mapStateToProps)(Loading);","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport * as GlobalActions from '../actions/global_actions';\nimport Loading from './Loading';\n\nclass LoggedIn extends React.PureComponent {\n\n static propTypes = {\n currentUser: PropTypes.object,\n }\n\n constructor(props, context) {\n super(props, context);\n }\n\n isValidState() {\n return this.props.currentUser != null;\n }\n \n componentDidMount() {\n\n // Tell the desktop app the webapp is ready\n window.postMessage(\n {\n type: 'webapp-ready',\n },\n window.location.origin,\n );\n\n if (!this.props.currentUser) {\n GlobalActions.emitUserLoggedOutEvent('/login?redirect_to=' + encodeURIComponent(this.props.location.pathname), true, false);\n }\n }\n render() {\n if (!this.isValidState()) {\n return <Loading/>;\n }\n\n return this.props.children;\n }\n}\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(LoggedIn);","import React, { SyntheticEvent } from 'react';\nimport { SnackbarContent } from '@material-ui/core';\nimport { amber, green } from '@material-ui/core/colors';\nimport {FormattedMessage} from 'react-intl';\nimport clsx from 'clsx';\nimport CheckCircleOutline from '@material-ui/icons/CheckCircleOutline';\nimport ErrorOutline from '@material-ui/icons/ErrorOutline';\nimport InfoOutlined from '@material-ui/icons/InfoOutlined';\nimport WarningOutlined from '@material-ui/icons/WarningOutlined';\nimport { makeStyles, Theme, withStyles, lighten, darken } from '@material-ui/core/styles';\n\nconst variantIcon:any = {\n success: CheckCircleOutline,\n warning: WarningOutlined,\n error: ErrorOutline,\n info: InfoOutlined,\n};\n\nconst useStyles1 = makeStyles((theme: Theme) => {\n\n const getColor = theme.palette.type === 'light' ? darken : lighten;\n const getBackgroundColor = theme.palette.type === 'light' ? lighten : darken;\n\n return ({\n success: {\n backgroundColor: green[600],\n },\n error: {\n color: getColor(theme.palette.error.main, 0.6),\n backgroundColor: getBackgroundColor(theme.palette.error.main, 0.9),\n '& $icon': {\n color: theme.palette.error.main,\n },\n },\n info: {\n color: getColor(theme.palette.primary.main, 0.6),\n backgroundColor: getBackgroundColor(theme.palette.primary.main, 0.9),\n '& $icon': {\n color: theme.palette.primary.main,\n },\n },\n warning: {\n color: getColor(amber[700], 0.6),\n backgroundColor: getBackgroundColor(amber[700], 0.9),\n '& $icon': {\n color: amber[700],\n },\n },\n icon: {\n fontSize: 20,\n },\n iconVariant: {\n opacity: 0.9,\n marginRight: theme.spacing(1),\n },\n message: {\n display: 'flex',\n alignItems: 'center',\n },\n })\n});\n\nexport interface Props {\n className?: string;\n message: string;\n onClose?: () => void;\n variant: keyof typeof variantIcon;\n}\n\nfunction MySnackbarContentWrapper(props: Props) {\n const classes: any = useStyles1({});\n const { className, message, onClose, variant, ...other } = props;\n const Icon = variantIcon[variant];\n return (\n <SnackbarContent elevation={0}\n className={clsx(classes[variant], className)}\n aria-describedby=\"client-snackbar\"\n message={\n <span id=\"client-snackbar\" className={classes.message}>\n <Icon className={clsx(classes.icon, classes.iconVariant)} />\n <FormattedMessage\n id={message}\n defaultMessage={message}\n values={{\n mobile_help: (...chunks: any) => (\n <a className=\"external_link\" target=\"_blank\" href=\"https://developer.steedos.com/developer/steedos_config/#%E5%8F%91%E9%80%81%E7%9F%AD%E4%BF%A1%E9%85%8D%E7%BD%AE\">\n {chunks}\n </a>\n ),\n email_help: (...chunks: any) => (\n <a className=\"external_link\" target=\"_blank\" href=\"https://developer.steedos.com/developer/steedos_config/#%E9%82%AE%E4%BB%B6%E9%85%8D%E7%BD%AE\">\n {chunks}\n </a>\n )\n }}\n /> \n </span>\n }\n // action={[\n // <IconButton key=\"close\" aria-label=\"close\" color=\"inherit\" onClick={onClose}>\n // <Close className={classes.icon} />\n // </IconButton>,\n // ]}\n {...other}\n />\n );\n}\n\nconst useStyles2 = makeStyles((theme: Theme) => ({\n margin: {\n // marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n}));\n\nconst useStyles = makeStyles({\n formError: {\n color: 'red',\n },\n});\n\n// interface Props {\n// error: string;\n// }\n\nconst FormError = ({ error, variant}: any) => {\n const classes = useStyles2({});\n let _variant = variant || \"error\";\n return <MySnackbarContentWrapper\n variant= {_variant}\n className={classes.margin}\n message={error}\n/>;\n};\n\nexport default FormError;\n","import * as React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport Logo from './Logo';\nimport { localizeMessage } from '../utils/utils';\n\nclass Card extends React.Component {\n render() {\n return (\n<div className=\"flex sm:items-center justify-center mx-auto overflow-auto md:p-10 h-full\">\n <div className=\"relative rounded p-11 sm:shadow-md bg-white w-screen max-w-md\">\n {this.props.children}\n </div>\n <div className=\"absolute bottom-0 left-0 right-0 text-center m-2 text-gray-500 text-sm\">\n <FormattedMessage\n id='accounts.copyright'\n defaultMessage='© 2020 salesforce.com, inc.'\n /> \n <span className=\"ml-1 mr-1\"> | </span>\n <a className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\"\n href=\"javascript:void(0)\" onClick={this.openPrivacyPage}>\n <FormattedMessage\n id='accounts.privacy'\n defaultMessage='Privacy'\n /> \n </a>\n </div>\n</div>\n )\n }\n\n openPrivacyPage = async () => {\n const href=localizeMessage('accounts.privacyURL');\n if(window && window.AppBrowserOpen){\n // TODO:暂时没效果,等webapp包整合到meteor中再处理\n window.AppBrowserOpen(href, \"_blank\");\n }\n else{\n window.open(href);\n }\n };\n}\n\nfunction mapStateToProps(state: any) {\n return {\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(Card);","import * as React from 'react';\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport { Client4 } from '../client';\nimport { localizeMessage } from '../utils/utils';\n\ninterface Props {\n logoUrl?: string;\n}\n\nconst Logo = ({ tenant, location }: any) => {\n let logoUrl = `${Client4.getUrl()}${localizeMessage('accounts.logoURL')}`;\n if (tenant.logo_url) {\n logoUrl = tenant.logo_url\n }\n return (<div>\n <img src={logoUrl} className='h-10'></img>\n </div>\n )\n};\n\nfunction mapStateToProps(state: any) {\n return {\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(Logo);","import * as React from 'react';\nimport { connect } from 'react-redux';\nimport { Client4 } from '../client';\nimport { getTenant } from '../selectors';\n\nconst Background = ({ tenant, location }: any) => {\n let backgroundUrl = `${Client4.getUrl()}/images/background.svg`;\n if (tenant.background_url) {\n backgroundUrl = tenant.background_url \n }\n let backgroundColor = '#f8f8f8';\n if (tenant.background_color) {\n backgroundColor = tenant.background_color \n }\n\n const style = (window.innerWidth > 640)?{\n backgroundImage: 'url('+backgroundUrl+')',\n backgroundColor: backgroundColor\n }:{}\n\n return (\n <div className=\"\">\n <div className=\"fixed bg-white justify-center mx-auto h-full w-full\" style={style}>\n </div> \n </div>\n )\n};\n\nfunction mapStateToProps(state) {\n return {\n tenant: getTenant(state),\n };\n}\nexport default connect(mapStateToProps)(Background);","import React, { useEffect, useRef } from 'react'\n\nconst InputPassword = React.forwardRef((props: any, ref?: React.Ref<HTMLInputElement>) => {\n\n const selfInputRef = useRef<HTMLInputElement>();\n const inputRef = ref || selfInputRef;\n\n const clearPasswordValueAttribute = () => {\n return setTimeout(() => {\n const input = (inputRef as any).current;\n if (\n input &&\n input.getAttribute('type') === 'password' &&\n input.hasAttribute('value')\n ) {\n input.removeAttribute('value');\n }\n }, 50);\n };\n\n const handlePasswordFocus = (e: any) => {\n const { onFocus } = props;\n clearPasswordValueAttribute();\n onFocus?.(e);\n\n }\n\n const handlePasswordBlur = (e: any) => {\n const { onBlur } = props;\n clearPasswordValueAttribute();\n onBlur?.(e);\n\n }\n\n useEffect(() => {\n const timer = clearPasswordValueAttribute();\n return () => {\n clearTimeout(timer)\n }\n }, [props.value, props.type]);\n\n clearPasswordValueAttribute();\n\n return (\n <input \n {...props}\n ref={inputRef}\n onFocus={handlePasswordFocus}\n onBlur={handlePasswordBlur}\n />\n );\n});\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport React from 'react';\nimport {FormattedMessage} from 'react-intl';\nimport InputPassword from './InputPassword';\n\ntype Props = {\n placeholder: {\n id: string;\n defaultMessage: string;\n values?: {string: any};\n };\n value?: string;\n disabled?: boolean;\n type?: string;\n};\n\nconst LocalizedInput = React.forwardRef((props: Props, ref?: React.Ref<HTMLInputElement>) => {\n const {placeholder, ...otherProps} = props;\n\n return (\n <FormattedMessage\n id={placeholder.id}\n defaultMessage={placeholder.defaultMessage}\n values={placeholder.values}\n >\n {(localizedPlaceholder: (string | JSX.Element)) => (\n otherProps.type === \"password\" ? (\n <InputPassword \n {...otherProps}\n ref={ref}\n placeholder={localizedPlaceholder as string}\n />\n ) : (\n <input\n {...otherProps}\n ref={ref}\n placeholder={localizedPlaceholder as string}\n />\n )\n )}\n </FormattedMessage>\n );\n});\nLocalizedInput.displayName = 'LocalizedInput';\n\nexport default LocalizedInput;\n","import React, { useEffect, useCallback, useState, useMemo } from 'react'\n\ntype Options = {\n total?: number\n lifecycle?: 'always' | 'session'\n}\n\nconst useCountDown = (\n timerKey: string,\n options: Options\n) => {\n const [addData, getData] = useMemo(() => {\n const total = options.total || 60\n const lifecycle = options.lifecycle || 'session'\n const saveKey = `__${timerKey}`\n const getSaveData = () => '' + (Date.now() + total * 1000)\n let getter, setter\n switch (lifecycle) {\n case 'always':\n setter = () => localStorage.setItem(saveKey, getSaveData())\n getter = () => localStorage.getItem(saveKey)\n break\n case 'session':\n setter = () => sessionStorage.setItem(saveKey, getSaveData())\n getter = () => sessionStorage.getItem(saveKey)\n break\n }\n return [setter, getter] as [() => undefined, () => string | null | number]\n }, [options, timerKey])\n\n const resetCountDown = useCallback(() => {\n addData()\n }, [addData])\n\n const getRestTime = useCallback(() => {\n let expiredTime: string | null | number = getData()\n if (!expiredTime) {\n return 0\n } else {\n expiredTime = +expiredTime\n if (isNaN(expiredTime)) {\n return 0\n } else {\n const restTime = Math.floor(((expiredTime - Date.now()) / 1000))\n return restTime < 0 ? 0 : restTime\n }\n }\n }, [getData])\n\n const [restTime, setRestTime] = useState(getRestTime())\n\n useEffect(() => {\n const timer = setInterval(() => {\n const newRestTime = getRestTime()\n if (restTime !== newRestTime) {\n setRestTime(newRestTime)\n }\n }, 500)\n return () => {\n clearInterval(timer)\n }\n }, [getRestTime, restTime])\n\n return [\n restTime,\n resetCountDown\n ] as [number, () => undefined]\n}\n\nconst CountDownProvider = ({ id, children, options }: {\n id: string,\n options: Options,\n children: (restTime: number, resetCountDown: () => undefined) => any\n}) => {\n const [restTime, resetCountDown] = useCountDown(id, options)\n return children(restTime, resetCountDown)\n}\n\nexport { useCountDown, CountDownProvider }","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators, Dispatch, AnyAction } from 'redux';\nimport { createUser, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if(onClick){\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code' \n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass Signup extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n let email = '';\n if ((new URLSearchParams(this.props.location.search)).get('email')) {\n email = (new URLSearchParams(this.props.location.search)).get('email');\n }\n let mobile = '';\n if ((new URLSearchParams(this.props.location.search)).get('mobile')) {\n mobile = (new URLSearchParams(this.props.location.search)).get('mobile');\n }\n let invite_token = '';\n if ((new URLSearchParams(this.props.location.search)).get('invite_token')) {\n invite_token = (new URLSearchParams(this.props.location.search)).get('invite_token');\n }\n\n let spaceId = this.props.settingsTenantId\n\n this.state = {\n // ldapEnabled: this.props.isLicensed && this.props.enableLdap,\n // samlEnabled: this.props.isLicensed && this.props.enableSaml,\n invite_token,\n spaceId,\n email,\n mobile,\n userId: '',\n password: '',\n verifyCode: '',\n sessionExpired: false,\n loginSuccess: false,\n\n loginByEmail: false,\n loginByMobile: false,\n loginBy: \"mobile\",\n \n loginWithCode: false,\n loginWithPassword: false,\n\n serverError: '',\n loading: false\n\n // brandImageError: false,\n };\n\n \n \n if (this.props.tenant.enable_mobile_code_login && this.props.tenant.enable_email_code_login) {\n this.state.loginWithCode = true;\n this.state.loginByEmail = true;\n this.state.loginByMobile = true;\n this.state.loginBy = \"mobile\"\n } else if (this.props.tenant.enable_mobile_code_login) {\n this.state.loginWithCode = true\n this.state.loginByMobile = true;\n this.state.loginByEmail = false;\n this.state.loginBy = \"mobile\"\n } else if (this.props.tenant.enable_email_code_login) {\n this.state.loginWithCode = true\n this.state.loginByMobile = false;\n this.state.loginByEmail = true;\n this.state.loginBy = \"email\"\n } else if (this.props.tenant.enable_password_login) {\n this.state.loginWithPassword = true\n this.state.loginByEmail = true;\n this.state.loginByMobile = false;\n this.state.loginBy = \"email\"\n } \n\n // this.state.loginWithCode = false\n // this.state.loginWithPassword = true\n // this.state.loginByMobile = true;\n // this.state.loginByEmail = true;\n // this.state.loginBy = \"email\"\n\n this.emailInput = React.createRef();\n this.mobileInput = React.createRef();\n this.passwordInput = React.createRef();\n\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage('accounts.signup') + ` | ${this.props.tenant.name}`;\n\n\n }\n\n createLoginPlaceholder = () => {\n\n let inputLabel = '';\n if (this.state.loginBy == \"mobile\")\n inputLabel = 'accounts.mobile';\n else if (this.state.loginBy == \"email\") \n inputLabel = 'accounts.email';\n \n return Utils.localizeMessage(inputLabel)\n }\n\n handleEmailChange = (e) => {\n this.setState({\n email: e.target.value,\n });\n }\n\n handleNameChange = (e) => {\n this.setState({\n name: e.target.value,\n });\n }\n\n switchLoginByMobile = (e) => {\n this.setState({\n loginBy: 'mobile',\n });\n }\n\n switchLoginByEmail = (e) => {\n this.setState({\n loginBy: 'email',\n });\n }\n\n tabColor = (tab) => {\n if (this.state.loginBy === tab)\n return \"text-blue-600 hover:text-blue-700 border-blue-600 hover:border-blue-300\"\n else\n return \"text-gray-600 hover:text-gray-500 hover:border-gray-300\"\n }\n\n handleMobileChange = (e) => {\n this.setState({\n mobile: e.target.value,\n });\n }\n\n handlePasswordChange = (e) => {\n this.setState({\n password: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n goLogin = ()=>{\n let state = {\n email: this.state.email,\n mobile: this.state.mobile,\n };\n this.props.history.push({\n pathname: `/login`,\n search: this.props.location.search,\n state: state\n })\n }\n\n sendVerificationToken = (e) => {\n\n this.setState({serverError: null, loading: true});\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && !this.state.mobile.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.loginBy === 'email'?this.state.email.trim():'',\n mobile: this.state.loginBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n this.state.userId = userId;\n // if (!userId)\n // this.setState({\n // serverError: (\n // <FormattedMessage\n // id='accounts.userNotFound'\n // defaultMessage='User not found.'\n // />\n // ),\n // });\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.setState({error: null});\n\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && !this.state.mobile.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n if (!this.state.name || !this.state.name.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.nameRequired'\n />\n ),\n });\n return\n }\n\n // if(!this.state.password.trim()){\n // throw new Error('accounts.passwordRequired');\n // }\n\n const user = {\n password: this.state.password?this.state.password.trim():this.state.password,\n name: this.state.name.trim(),\n locale: Utils.getBrowserLocale(),\n verifyCode: this.state.verifyCode?this.state.verifyCode.trim():this.state.verifyCode,\n }\n\n if(this.state.spaceId){\n user.spaceId = this.state.spaceId;\n }\n \n if(this.state.invite_token){\n user.invite_token = this.state.invite_token\n }\n\n if (this.state.loginBy === 'mobile'){\n user.mobile = this.state.mobile\n } else if (this.state.loginBy === 'email'){\n user.email = this.state.email\n }\n this.props.actions.createUser(user).then(async ({error, _next}) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finishSignin(_next);\n });\n };\n\n\n finishSignin = (_next) => {\n if(_next === 'TO_VERIFY_MOBILE'){\n const location = this.props.location;\n return GlobalAction.redirectUserToVerifyMobile(location)\n }\n\n const query = new URLSearchParams(this.props.location.search);\n const redirectTo = query.get('redirect_to');\n\n // Utils.setCSRFFromCookie();\n\n // Record a successful login to local storage. If an unintentional logout occurs, e.g.\n // via session expiration, this bit won't get reset and we can notify the user as such.\n\n if (redirectTo && redirectTo.match(/^\\/([^/]|$)/)) {\n this.props.history.push(redirectTo);\n // } else if (team) {\n // browserHistory.push(`/${team.name}`);\n } else {\n this.state.loginSuccess = true;\n GlobalAction.redirectUserToDefaultSpace(this.props.location);\n \n }\n }\n\n goSignup = ()=>{\n let state = {};\n if(this.state.email.trim().length > 0){\n state = { email: this.state.email.trim() }\n }\n this.props.history.push({\n pathname: `/signup`,\n search: this.props.location.search,\n state: state\n })\n }\n\n\n render() {\n\n return (\n <>\n <Background/>\n <Card>\n <Logo/>\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id='accounts.signup'\n defaultMessage='Sign Up'\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n {/* {this.state.loginByMobile && this.state.loginByEmail && (\n <nav className=\"flex -mb-px py-2\">\n {this.state.loginByMobile && (\n <button\n type='button'\n onClick={this.switchLoginByMobile}\n className={\"group inline-flex items-center py-1 px-1 border-b-2 border-transparent font-medium text-sm leading-5 focus:outline-none \" + this.tabColor('mobile')}>\n <span>\n <FormattedMessage\n id='accounts.mobile'\n defaultMessage='Mobile'\n />\n </span>\n </button>\n )}\n {this.state.loginByEmail && (\n <button\n type='button'\n onClick={this.switchLoginByEmail}\n className={\"ml-8 group inline-flex items-center py-1 px-1 border-b-2 border-transparent font-medium text-sm leading-5 focus:outline-none \" + this.tabColor('email')}>\n <span>\n <FormattedMessage\n id='accounts.email'\n defaultMessage='Email'\n />\n </span>\n </button>)\n }\n </nav>\n )} */}\n \n <div className=\"rounded-md shadow-sm my-2\">\n {this.state.loginBy === 'email' && (\n <div>\n <LocalizedInput \n id=\"email\"\n name=\"email\" \n ref={this.emailInput}\n value={this.state.email}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.email_placeholder', defaultMessage: 'Please enter email'}}\n onChange={this.handleEmailChange}\n />\n </div>\n )}\n\n {this.state.loginBy === 'mobile' && (\n <div>\n <LocalizedInput \n id=\"mobile\"\n name=\"mobile\" \n ref={this.mobileInput}\n value={this.state.mobile}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.mobile_placeholder', defaultMessage: 'Please enter mobile'}}\n onChange={this.handleMobileChange}\n />\n </div>\n )}\n\n <div className=\"-mt-px\">\n <LocalizedInput \n type=\"password\"\n id=\"password\"\n name=\"password\" \n autocomplete=\"new-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.password_create', defaultMessage: 'Set Password'}}\n onChange={this.handlePasswordChange}\n />\n </div>\n\n {this.state.loginWithCode && (\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput \n id=\"verifyCode\"\n name=\"verifyCode\" \n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.verifyCode', defaultMessage: 'Verify Code'}}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile}/>\n\n </div>\n )}\n\n <div className=\"-mt-px\">\n <LocalizedInput \n id=\"name\"\n name=\"name\" \n value={this.state.name}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.name_placeholder', defaultMessage: 'Name'}}\n onChange={this.handleNameChange}\n />\n </div>\n </div>\n \n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n {this.state.loginByEmail && this.state.loginBy === 'mobile' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginByEmail}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_email'\n defaultMessage='Use email'\n />\n </button>\n </div>\n )}\n\n {this.state.loginByMobile && this.state.loginBy === 'email' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginByMobile}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_mobile'\n defaultMessage='Use mobile'\n />\n </button>\n </div>\n )}\n <div className=\"text-sm leading-5 my-4\">\n <FormattedMessage\n id='accounts.has_account'\n defaultMessage='Has Account?'\n />\n <button type=\"button\" onClick={this.goLogin}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.signin'\n defaultMessage='Login'\n />\n </button>\n </div>\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n getCurrentUserId: getCurrentUserId(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n createUser,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(Signup));\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators, Dispatch, AnyAction } from 'redux';\nimport { login, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId, getCurrentUser } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\nimport LocalStorageStore from '../stores/local_storage_store';\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium rounded-br-md bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if(onClick){\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code' \n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass Login extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n let email = '';\n if ((new URLSearchParams(this.props.location.search)).get('email')) {\n email = (new URLSearchParams(this.props.location.search)).get('email');\n }\n let spaceId = '';\n if ((new URLSearchParams(this.props.location.search)).get('X-Space-Id')) {\n spaceId = (new URLSearchParams(this.props.location.search)).get('email');\n } else if (this.props.settingsTenantId) {\n spaceId = this.props.settingsTenantId\n }\n\n this.state = {\n // ldapEnabled: this.props.isLicensed && this.props.enableLdap,\n // samlEnabled: this.props.isLicensed && this.props.enableSaml,\n spaceId,\n email,\n username: '',\n mobile: '',\n loginId: '',\n userId: '',\n password: '',\n verifyCode: '',\n sessionExpired: false,\n loginSuccess: false,\n\n loginByEmail: true,\n loginByMobile: true,\n loginBy: \"mobile\",\n \n loginWith: this.props.tenant.enable_password_login? 'password':'code',\n loginWithCode: this.props.tenant.enable_mobile_code_login || this.props.tenant.enable_email_code_login,\n loginWithPassword: this.props.tenant.enable_password_login,\n\n serverError: '',\n loading: false,\n MFA: false,\n // brandImageError: false,\n };\n\n \n \n // if (this.props.tenant.enable_mobile_code_login || this.props.tenant.enable_email_code_login) {\n // this.state.loginWithCode = true;\n // this.state.loginByEmail = true;\n // this.state.loginByMobile = true;\n // this.state.loginBy = \"mobile\"\n // } else if (this.props.tenant.enable_mobile_code_login) {\n // this.state.loginWithCode = true\n // this.state.loginByMobile = true;\n // this.state.loginByEmail = false;\n // this.state.loginBy = \"mobile\"\n // } else if (this.props.tenant.enable_email_code_login) {\n // this.state.loginWithCode = true\n // this.state.loginByMobile = false;\n // this.state.loginByEmail = true;\n // this.state.loginBy = \"email\"\n // } else if (this.props.tenant.enable_password_login) {\n // this.state.loginWithPassword = true\n // this.state.loginByEmail = true;\n // this.state.loginByMobile = true;\n // this.state.loginBy = \"email\"\n // } \n\n // this.state.loginWithCode = false\n // this.state.loginWithPassword = true\n // this.state.loginByMobile = true;\n // this.state.loginByEmail = true;\n // this.state.loginBy = \"email\"\n\n this.emailInput = React.createRef();\n this.mobileInput = React.createRef();\n this.passwordInput = React.createRef();\n\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage('accounts.signin') + ` | ${this.props.tenant.name}`;\n\n\n }\n\n createLoginPlaceholder = () => {\n\n let inputLabel = '';\n if (this.state.loginBy == \"mobile\")\n inputLabel = 'accounts.mobile';\n else if (this.state.loginBy == \"email\") \n inputLabel = 'accounts.email';\n \n return Utils.localizeMessage(inputLabel)\n }\n\n handleLoginIdChange = (e) => {\n const loginId = e.target.value;\n if(this.state.MFA){\n this.setState({\n loginId,\n mobile: e.target.value,\n username: null,\n email: null,\n loginBy: 'mobile'\n });\n return;\n }\n if (loginId.indexOf('@') > 0) {\n this.setState({\n loginId,\n email: e.target.value,\n username: null,\n mobile: null,\n loginBy: 'email'\n });\n } else {\n if(new RegExp('^[0-9]{11}$').test(e.target.value)){\n this.setState({\n loginId,\n mobile: e.target.value,\n username: null,\n email: null,\n loginBy: 'mobile'\n });\n }else{\n this.setState({\n loginId,\n username: e.target.value,\n mobile: null,\n email: null,\n loginBy: 'username'\n });\n }\n }\n }\n\n handlePasswordChange = (e) => {\n this.setState({\n password: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n switchLoginWithCode = (e) => {\n this.setState({\n loginWith: 'code',\n });\n }\n\n switchLoginWithPassword = (e) => {\n this.setState({\n loginWith: 'password',\n });\n }\n\n sendVerificationToken = (e) => {\n\n this.setState({serverError: null, loading: true});\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && (!this.state.mobile || !this.state.mobile.trim() || !new RegExp('^[0-9]{11}$').test(this.state.mobile))){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.loginBy === 'email'?this.state.email.trim():'',\n mobile: this.state.loginBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n this.state.userId = userId;\n if (!userId)\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.userNotFound'\n defaultMessage='User not found.'\n />\n ),\n });\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.setState({error: null});\n\n if(this.state.loginBy === 'email' && !this.state.email.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if(this.state.loginBy === 'mobile' && !this.state.mobile.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n // if(!this.state.password.trim()){\n // throw new Error('accounts.passwordRequired');\n // }\n\n const user = {\n email: this.state.loginBy === 'email'?this.state.email.trim():'',\n mobile: this.state.loginBy === 'mobile'?this.state.mobile.trim():'',\n username: (this.state.loginWith === 'password' && this.state.loginBy === 'username')?this.state.username.trim():'',\n spaceId: this.state.spaceId,\n }\n this.props.actions.login(user, this.state.password?this.state.password.trim():this.state.password, this.state.verifyCode?this.state.verifyCode.trim():this.state.verifyCode).then(async (args) => {\n const {error} = args;\n if(error === 'TO_MOBILE_CODE_LOGIN'){\n return this.setState({\n loginByEmail: false,\n loginByMobile: true,\n loginBy: \"mobile\",\n loginWith: 'code',\n MFA: true,\n loginId: '',\n email: null,\n username: null\n });\n }else if(error === 'TO_VERIFY_MOBILE'){\n const location = this.props.location;\n GlobalAction.redirectUserToVerifyMobile(location)\n }\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finishSignin();\n \n });\n };\n\n\n finishSignin = (team) => {\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n }\n\n goSignup = ()=>{\n let state = {};\n if(this.state.email && this.state.email.trim().length > 0){\n state = { email: this.state.email.trim() }\n }\n\n if(this.state.mobile && this.state.mobile.trim().length > 0){\n state = { mobile: this.state.mobile.trim() }\n }\n this.props.history.push({\n pathname: `/signup`,\n search: this.props.location.search,\n state: state\n })\n }\n\n render() {\n\n return (\n <>\n <Background/>\n <Card>\n <Logo/>\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n {this.state.MFA && <FormattedMessage\n id='accounts.signin-MFA'\n defaultMessage='Multi-Factor Authentication'\n />}\n {!this.state.MFA && <FormattedMessage\n id='accounts.signin'\n defaultMessage='Login'\n />}\n \n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n <div>\n <LocalizedInput \n id=\"loginId\"\n name=\"loginId\" \n ref={this.loginIdInput}\n value={this.state.loginId}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={this.state.MFA ? {id: 'accounts.mobile', defaultMessage: 'Mobile'} : {id: 'accounts.email_mobile', defaultMessage: 'Email or mobile'}}\n onChange={this.handleLoginIdChange}\n />\n </div>\n\n {this.state.loginWith == 'password' && (\n <div className=\"-mt-px\">\n <LocalizedInput \n type=\"password\"\n id=\"password\"\n name=\"password\" \n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.password_placeholder', defaultMessage: 'Password'}}\n onChange={this.handlePasswordChange}\n autocomplete=\"new-password\"\n />\n </div>\n )}\n\n {this.state.loginWith == 'code' && (\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput \n id=\"verifyCode\"\n name=\"verifyCode\" \n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-bl-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\" \n placeholder={{id: 'accounts.verifyCode', defaultMessage: 'Verify Code'}}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile}/>\n\n </div>\n )}\n </div>\n \n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n\n {!this.state.MFA && this.state.loginWithPassword && this.state.loginWith === 'code' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginWithPassword}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_password'\n defaultMessage='Login with password'\n />\n </button>\n </div>\n )}\n\n {this.state.loginWithCode && this.state.loginWith === 'password' && (\n <div className=\"text-sm leading-5 my-4\">\n <button type=\"button\" onClick={this.switchLoginWithCode}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.switch_code'\n defaultMessage='Login with verfiy code'\n />\n </button>\n </div>\n )}\n\n {!this.state.MFA && this.props.tenant.enable_register &&\n <div className=\"text-sm leading-5 my-4\">\n <FormattedMessage\n id='accounts.no_account'\n defaultMessage='No Account?'\n />\n <button type=\"button\" onClick={this.goSignup}\n className=\"font-medium text-blue-600 hover:text-blue-500 focus:outline-none hover:underline transition ease-in-out duration-150\">\n <FormattedMessage\n id='accounts.signup'\n defaultMessage='Sign Up'\n />\n </button>\n </div>}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n getCurrentUserId: getCurrentUserId(state),\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n login,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(Login));\n","import React, { useState, useEffect } from 'react';\nimport {bindActionCreators} from 'redux';\nimport { RouteComponentProps, Link } from 'react-router-dom';\nimport { Button, Typography } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/styles';\nimport {FormattedMessage} from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getTenant, getSettings } from '../selectors';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport { getCurrentSpace, currentSpaceId } from \"../selectors/entities/spaces\";\nimport { logout } from '../actions/users';\nimport { hashHistory } from \"../utils/hash_history\";\nimport * as GlobalAction from '../actions/global_actions';\n\nclass Logout extends React.PureComponent {\n\n\n constructor(props, context) {\n super(props, context);\n }\n\n componentDidMount() {\n\n let redirect_uri = new URLSearchParams(this.props.location.search).get('redirect_uri')\n if (!redirect_uri)\n redirect_uri = '/login'\n GlobalAction.emitUserLoggedOutEvent(redirect_uri);\n }\n\n render() {\n return null\n }\n};\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n logout,\n }, dispatch),\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Logout);","import * as React from 'react';\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport { Transition } from '@tailwindui/react'\nimport { useState } from 'react'\nimport * as GlobalActions from '../actions/global_actions';\nimport Logo from './Logo';\n\nconst Navbar = ({ tenant, user }: any) => {\n const [menuOpen, setMenuOpen] = useState(false)\n\n const onLogout = async () => {\n GlobalActions.emitUserLoggedOutEvent();\n };\n\n // document.onclick=() => {if (menuOpen) setMenuOpen(false)}\n\n return (\n<div>\n <nav className=\"bg-white shadow border-gray-200\">\n <div className=\"mx-auto px-4 sm:px-6 lg:px-8\">\n <div className=\"flex items-center justify-between h-15\">\n <div className=\"flex items-center\">\n <div className=\"flex-shrink-0\">\n <a href=\"/\">\n <Logo/>\n </a>\n </div>\n <div className=\"hidden md:block\">\n <div className=\"ml-10 flex items-baseline space-x-4\">\n {/* <a href=\"/\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-900 focus:outline-none hover:bg-gray-200 focus:text-gray-700\">Home</a>\n \n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Team</a>\n\n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Projects</a>\n\n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Calendar</a>\n\n <a href=\"#\" className=\"px-3 py-2 rounded-md text-sm font-medium text-gray-300 hover:text-white hover:bg-gray-700 focus:outline-none focus:text-white focus:bg-gray-700\">Reports</a> */}\n </div>\n </div>\n </div>\n <div className=\"md:block\">\n <div className=\"ml-4 flex items-center md:ml-6\">\n <a href=\"https://www.steedos.com/help/\" target=\"_blank\" className=\"p-1 text-cool-gray-400 rounded-full hover:bg-cool-gray-100 hover:text-cool-gray-500 focus:outline-none focus:shadow-outline focus:text-cool-gray-500\" aria-label=\"Notifications\">\n <svg className=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </a>\n\n <div className=\"ml-3 relative\">\n {/* <div>\n <button className=\"p-1 border-2 border-transparent text-gray-700 rounded-full hover:text-blue-500 focus:outline-none transition duration-150 ease-in-out flex items-center\" id=\"user-menu\" aria-label=\"User menu\" aria-haspopup=\"true\"\n onClick={() => setMenuOpen(!menuOpen)}\n >\n <span className=\"mr-1\">{user && user.name &&(user.name)}</span>\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" className=\"h-4 w-4\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </button>\n </div> */}\n <div>\n <button className=\"max-w-xs flex items-center text-sm rounded-full focus:outline-none focus:bg-cool-gray-100 lg:p-2 lg:rounded-md lg:hover:bg-cool-gray-100\" id=\"user-menu\" aria-label=\"User menu\" aria-haspopup=\"true\"\n onClick={() => setMenuOpen(!menuOpen)}\n >\n <span className=\"inline-block h-8 w-8 rounded-full overflow-hidden bg-gray-100\">\n <svg className=\"h-full w-full text-gray-300\" fill=\"currentColor\" viewBox=\"0 0 24 24\">\n <path d=\"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z\" />\n </svg>\n </span>\n <p className=\"hidden ml-3 text-cool-gray-700 text-sm leading-5 font-medium lg:block\">{user && user.name &&(user.name)}</p>\n <svg className=\"hidden flex-shrink-0 ml-1 h-5 w-5 text-cool-gray-400 lg:block\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z\" clipRule=\"evenodd\" />\n </svg>\n </button>\n </div>\n <Transition\n show={menuOpen}\n >\n <div className=\"origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg\">\n <div className=\"py-1 rounded-md bg-white shadow-xs\" role=\"menu\" aria-orientation=\"vertical\" aria-labelledby=\"user-menu\">\n {/* <a href=\"#\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">Your Profile</a> */}\n <a href=\"#/select-space\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">选择企业</a>\n\n {/* <a href=\"#/preference\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\">账户设置</a> */}\n\n <a href=\"#\" className=\"block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100\" role=\"menuitem\" onClick={onLogout}>注销</a>\n </div>\n </div>\n </Transition>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </nav>\n\n {/* <header className=\"bg-white shadow\">\n <div className=\"max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8\">\n <h1 className=\"text-3xl font-bold leading-tight text-gray-900\">\n Dashboard\n </h1>\n </div>\n </header> */}\n {/* <main>\n <div className=\"max-w-7xl mx-auto py-6 sm:px-6 lg:px-8\">\n <div className=\"px-4 py-6 sm:px-0\">\n <div className=\"border-4 border-dashed border-gray-200 rounded-lg h-96\"></div>\n </div>\n </div>\n </main> */}\n</div>\n \n )\n};\n\nfunction mapStateToProps(state: any) {\n return {\n tenant: getTenant(state),\n };\n}\n\nexport default connect(mapStateToProps)(Navbar);","import React, { useState, useEffect } from 'react';\nimport {bindActionCreators} from 'redux';\nimport { RouteComponentProps, Link } from 'react-router-dom';\nimport { Button, Typography } from '@material-ui/core';\nimport { makeStyles } from '@material-ui/styles';\nimport {FormattedMessage} from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getTenant, getSettings, getSettingsTenantId } from '../selectors';\nimport { getCurrentUser } from \"../selectors/entities/users\";\nimport { getCurrentSpace, getCurrentSpaceId } from \"../selectors/entities/spaces\";\nimport Navbar from '../components/Navbar';\nimport { selectSpace, goSpaceHome } from '../actions/spaces';\nimport { hashHistory } from \"../utils/hash_history\";\nimport LocalStorageStore from '../stores/local_storage_store';\nimport * as GlobalAction from '../actions/global_actions';\n\nclass Home extends React.PureComponent {\n\n\n constructor(props, context) {\n super(props, context);\n }\n\n componentDidMount() {\n const previousSpaceId = LocalStorageStore.getPreviousSpaceId();\n const paramSpaceId = (this.props.match && this.props.match.params)?this.props.match.params.spaceId:null;\n const {currentSpaceId, settingsTenantId} = this.props;\n const spaceId = paramSpaceId ? paramSpaceId : currentSpaceId ? currentSpaceId : (previousSpaceId && previousSpaceId !== 'null') ? previousSpaceId : settingsTenantId\n if (spaceId) {\n this.props.actions.selectSpace(spaceId).then(async (result) => {\n if (result) {\n if(result.data == false){\n hashHistory.push({\n pathname: '/select-space',\n search: this.props.location.search\n });\n return\n }else{\n this.goHome();\n return\n }\n }\n });\n } else {\n hashHistory.push({\n pathname: '/select-space',\n search: this.props.location.search\n });\n }\n if (process.env.NODE_ENV == 'production')\n if (this.props.currentUser && this.props.currentSpace) \n this.goHome();\n }\n\n goHome = async () => {\n this.props.actions.goSpaceHome(this.props.location);\n };\n\n render() {\n\n if (process.env.NODE_ENV == 'production')\n return null;\n\n const {currentUser, currentSpace} = this.props;\n\n if (!currentUser || !currentSpace) {\n return null;\n }\n\n return (\n <div>\n <Navbar user={currentUser}/>\n<div className=\"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-6 border-b border-gray-200 md:flex md:items-center md:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <h2 className=\"text-2xl font-bold leading-7 text-gray-900 sm:text-3xl sm:leading-9 sm:truncate\">\n {this.props.currentSpace && this.props.currentSpace.name}\n </h2>\n </div>\n <div className=\"mt-4 flex md:mt-0 md:ml-4\">\n {/* <span className=\"shadow-sm rounded-md\">\n <button type=\"button\" className=\"inline-flex items-center px-4 py-2 border border-gray-300 text-sm leading-5 font-medium rounded-md text-gray-700 bg-white hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:text-gray-800 active:bg-gray-50 transition duration-150 ease-in-out\">\n 切换企业\n </button>\n </span> */}\n <span className=\"shadow-sm rounded-md\">\n <button type=\"button\" className=\"inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-700 active:bg-blue-700 transition duration-150 ease-in-out\"\n onClick={this.goHome}>\n 进入首页\n </button>\n </span>\n </div>\n</div>\n \n{/* \n <div className=\"bg-white overflow-hidden sm:shadow sm:rounded-lg sm:px-6 sm:mx-8 sm:my-8 md:max-w-5xl md:mx-auto\">\n <div className=\"px-4 py-5 sm:p-6\">\n <div className=\"py-6 md:flex md:items-center md:justify-between\">\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center\">\n <span className=\"inline-block h-15 w-15 rounded-full overflow-hidden bg-gray-100 text-gray-500\">\n <svg className=\"h-full w-full\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\" />\n </svg>\n </span>\n <div>\n <div className=\"flex items-center\">\n <h1 className=\"ml-3 text-2xl font-bold leading-7 text-cool-gray-900 sm:leading-9 sm:truncate\">\n {this.props.currentSpace && this.props.currentSpace.name}\n </h1>\n </div>\n <dl className=\"mt-6 flex flex-col sm:ml-3 sm:mt-1 sm:flex-row sm:flex-wrap\">\n <dt className=\"sr-only\">Company</dt>\n <dd className=\"flex items-center text-sm leading-5 text-cool-gray-500 font-medium capitalize sm:mr-6\">\n <svg className=\"flex-shrink-0 mr-1.5 h-5 w-5 text-cool-gray-400\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M4 4a2 2 0 012-2h8a2 2 0 012 2v12a1 1 0 110 2h-3a1 1 0 01-1-1v-2a1 1 0 00-1-1H9a1 1 0 00-1 1v2a1 1 0 01-1 1H4a1 1 0 110-2V4zm3 1h2v2H7V5zm2 4H7v2h2V9zm2-4h2v2h-2V5zm2 4h-2v2h2V9z\" clipRule=\"evenodd\" />\n </svg>\n 华炎软件\n </dd>\n <dt className=\"sr-only\">Account status</dt>\n <dd className=\"mt-3 flex items-center text-sm leading-5 text-cool-gray-500 font-medium sm:mr-6 sm:mt-0 capitalize\">\n {emailVerified()}\n {mobileVerified()}\n </dd>\n </dl>\n </div>\n </div>\n </div>\n <div className=\"mt-6 flex space-x-3 md:mt-0 md:ml-4\">\n <span className=\"shadow-sm rounded-md\">\n <button type=\"button\" className=\"inline-flex items-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-teal-600 hover:bg-teal-500 focus:outline-none focus:shadow-outline-teal focus:border-teal-700 active:bg-teal-700 transition duration-150 ease-in-out\" \n onClick={this.onHome}>\n 进入首页\n </button>\n </span>\n <span className=\"shadow-sm rounded-md\">\n <a href=\"#/preference\" className=\"inline-flex items-center px-4 py-2 border border-cool-gray-300 text-sm leading-5 font-medium rounded-md text-cool-gray-700 bg-white hover:text-cool-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:text-cool-gray-800 active:bg-cool-gray-50 transition duration-150 ease-in-out\">\n 账户设置\n </a>\n </span>\n </div>\n </div>\n </div>\n </div> */}\n </div>\n );\n }\n};\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n currentSpace: getCurrentSpace(state),\n currentSpaceId: getCurrentSpaceId(state),\n tenant: getTenant(state),\n settings: getSettings(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n selectSpace,\n goSpaceHome,\n }, dispatch),\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Home);","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators } from 'redux';\nimport { changePassword } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport { getCurrentUserId } from '../selectors/entities/users';\nimport * as GlobalAction from '../actions/global_actions';\n\nclass UpdatePassword extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n this.state = {\n oldPassword: '',\n newPassword: '',\n confirmPassword: '',\n serverError: '',\n loading: false\n };\n\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage('accounts.title.updatePassword') + ` | ${this.props.tenant.name}`;\n }\n\n\n handleOldPasswordChange = (e) => {\n this.setState({\n oldPassword: e.target.value,\n });\n }\n\n handleNewPasswordChange = (e) => {\n this.setState({\n newPassword: e.target.value,\n });\n }\n\n handleConfirmPasswordChange = (e) => {\n this.setState({\n confirmPassword: e.target.value,\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.setState({error: null});\n\n if(this.state.oldPassword === this.state.newPassword){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.oldAndNewPasswordNotEQ'\n />\n ),\n });\n return\n }\n\n if(this.state.newPassword != this.state.confirmPassword){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.passwordNotEQ'\n />\n ),\n });\n return\n }\n\n this.props.actions.changePassword(this.state.oldPassword, this.state.newPassword).then(async (result) => {\n let error = null;\n if(result){\n error = result.error\n }\n if (error) {\n if(error.message === 'accounts.invalid_credentials'){\n error.message = 'accounts.updatePassword_invalid_credentials'\n }\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }else{\n GlobalAction.emitUserLoggedOutEvent('/login');\n }\n });\n };\n\n render() {\n\n return (\n <>\n <Background />\n <Card>\n <Logo />\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id='accounts.update_password'\n defaultMessage='Change Password'\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n\n <div className=\"-mt-px\">\n <LocalizedInput\n type=\"password\"\n id=\"oldPassword\"\n name=\"oldPassword\"\n autocomplete=\"old-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.oldPassword', defaultMessage: 'Set oldPassword' }}\n onChange={this.handleOldPasswordChange}\n />\n </div>\n <div className=\"-mt-px\">\n <LocalizedInput\n type=\"password\"\n id=\"newPassword\"\n name=\"newPassword\"\n autocomplete=\"new-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.newPassword', defaultMessage: 'Set newPassword' }}\n onChange={this.handleNewPasswordChange}\n />\n </div>\n <div className=\"-mt-px\">\n <LocalizedInput\n type=\"password\"\n id=\"confirmPassword\"\n name=\"confirmPassword\"\n autocomplete=\"confirm-password\"\n value={this.state.password}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.confirmPassword', defaultMessage: 'Set confirmPassword' }}\n onChange={this.handleConfirmPasswordChange}\n />\n </div>\n </div>\n {this.state.serverError && <FormError error={this.state.serverError} />}\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n getCurrentUserId: getCurrentUserId(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n changePassword\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(UpdatePassword));\n","import React, { useState, useEffect } from 'react';\nimport { bindActionCreators, Dispatch, AnyAction } from 'redux';\nimport { RouteComponentProps, Link } from 'react-router-dom';\nimport { createStyles, Theme, makeStyles, FormControl, InputLabel, Input, Button} from '@material-ui/core';\nimport { useIntl, FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport LocalizedInput from '../components/LocalizedInput';\nimport FormError from '../components/FormError';\nimport { getCookie, fixRootUrl } from '../utils/utils';\nimport { createSpace, selectSpace, } from '../actions/spaces';\nimport { hashHistory } from \"../utils/hash_history\";\nimport Logo from '../components/Logo';\nimport Card from '../components/Card';\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUser } from '../selectors/entities/users';\n\nclass CreateTenant extends React.PureComponent {\n\n\n constructor(props, context) {\n super(props, context);\n\n this.state = {\n name: ''\n };\n }\n\n handleNameChange = (e) => {\n this.setState({\n name: e.target.value,\n });\n }\n\n onSubmit = async (e) => {\n this.setState({serverError: null, loading: true});\n e.preventDefault();\n this.props.actions.createSpace(this.state.name).then(async ({data}) => {\n console.log(data)\n // if (error) {\n // this.setState({\n // serverError: (\n // <FormattedMessage\n // id={error.message}\n // />\n // ),\n // });\n // return;\n // }\n \n if (data)\n this.selectSpace(data)\n });\n\n\n };\n\n selectSpace = (space) => {\n if(space && space._id) {\n this.props.actions.selectSpace(space._id);\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n // hashHistory.push(`/home/${space._id}`)\n }\n }\n\n render() {\n\n return (\n<Card>\n\n <Logo/>\n \n <h2 className=\"my-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id='accounts.title.createTenant'\n defaultMessage='Create Team'\n />\n </h2>\n <div class=\"mt-2 max-w-xl text-sm leading-5 text-gray-500\">\n <p>\n <FormattedMessage\n id='accounts.create_tenant_description'\n defaultMessage='Create a new team and invite your colleagues to join.'\n />\n </p>\n </div>\n \n <form onSubmit={this.onSubmit} className=\"mt-4\">\n\n\n <div className=\"rounded-md shadow-sm my-2\">\n <div>\n <LocalizedInput \n id=\"name\"\n name=\"name\" \n value={this.state.name}\n className=\"appearance-none rounded-none relative block w-full px-3 py-2 border-b border-gray-500 bg-blue-50 placeholder-gray-500 text-gray-900 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5\" \n placeholder={{id: 'accounts.tenant_name', defaultMessage: 'Team Name'}}\n onChange={this.handleNameChange}\n />\n </div>\n </div>\n \n {/* {error && <FormError error={error!} />} */}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n )};\n};\n\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n createSpace,\n selectSpace,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps,mapDispatchToProps)(CreateTenant);\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\nimport {FormattedMessage} from 'react-intl';\nimport { hashHistory } from \"../utils/hash_history\";\nimport {Link} from 'react-router-dom';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Navbar from '../components/Navbar';\nimport Background from '../components/Background';\n\nimport { getCurrentUser } from '../selectors/entities/users';\nimport { getSpaceCount, getCurrentSpaceId, getCurrentSpace, getSpaces, getMySpaces } from '../selectors/entities/spaces';\nimport { selectSpace } from '../actions/spaces';\n\nclass SelectSpace extends React.PureComponent {\n static propTypes = {\n currentUserId: PropTypes.string,\n spaceCount: PropTypes.number,\n isMemberOfSpace: PropTypes.bool,\n listableSpaces: PropTypes.array,\n canCreateSpaces: PropTypes.bool,\n history: PropTypes.object,\n // actions: PropTypes.shape({\n // getSpaces: PropTypes.func.isRequired,\n // loadRolesIfNeeded: PropTypes.func.isRequired,\n // addUserToSpace: PropTypes.func.isRequired,\n // }).isRequired,\n };\n\n constructor(props) {\n super(props);\n\n this.state = {\n loadingSpaceId: '',\n error: null,\n };\n }\n\n handleCreateTenant = () => {\n hashHistory.push({\n pathname: '/create-space',\n search: this.props.location.search\n })\n }\n\n handleSpaceClick = (space) => {\n if(space) {\n this.props.actions.selectSpace(space._id);\n hashHistory.push({\n pathname: `/home/${space._id}`,\n search: this.props.location.search\n })\n }\n }\n\n render() {\n\n let spaceContent = [] \n Object.keys(this.props.spaces).forEach((spaceId) => {\n const space = this.props.spaces[spaceId]\n spaceContent.push (\n <li key={spaceId}>\n <a\n space ={space}\n onClick={e => this.handleSpaceClick(space)} \n className=\"w-full text-left border-b border-gray-100 block hover:bg-blue-100 focus:outline-none transition duration-150 ease-in-out\">\n <div className=\"flex items-center sm:px-10 py-4\">\n <div className=\"min-w-0 flex-1 flex items-center\">\n <div className=\"flex-shrink-0 pr-4 text-gray-600\">\n {/* <img className=\"h-12 w-12 rounded-full\" src=\"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80\" alt=\"\"/> */}\n {/* <svg className=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z\" />\n </svg> */}\n <svg className=\"h-6 w-6\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9\" />\n </svg>\n </div>\n <div className=\"min-w-0 flex-1\">\n <div>\n <div className=\"text-lg leading-5 font-medium truncate\">{space.name}</div> \n </div>\n </div>\n </div>\n <div>\n <svg className=\"h-5 w-5 text-gray-400\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path fillRule=\"evenodd\" d=\"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z\" clipRule=\"evenodd\" />\n </svg>\n </div>\n </div>\n </a>\n </li>\n )});\n\n return (\n <>\n <Background/>\n <div className=\"flex sm:items-center justify-center mx-auto overflow-auto p-10\">\n <div className=\"relative rounded sm:shadow bg-white w-screen max-w-md\">\n <div className=\"sm:pt-10 sm:pl-10 sm:pr-10\">\n <Logo/>\n <h2 className=\"mt-6 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n {this.props.spaceCount>0 &&(\n <FormattedMessage\n id='accounts.select_space'\n defaultMessage='Select Company'\n />\n )}\n {this.props.spaceCount==0 &&(\n <FormattedMessage\n id='accounts.no_tenant'\n defaultMessage='No Company'\n />\n )}\n </h2>\n </div>\n <div className=\"mt-4 bg-white overflow-hidden mb-10\">\n <ul className=\"border-t border-gray-100\">\n {spaceContent}\n </ul>\n\n <div className=\"mt-6 mx-10 flex justify-end\">\n <button type=\"button\" \n onClick={this.handleCreateTenant}\n className=\"rounded group relative w-full justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.create_tenant'\n defaultMessage='Create Company'\n />\n </button>\n </div>\n </div>\n </div>\n </div>\n </>\n )\n }\n}\n\n\nfunction mapStateToProps(state) {\n return {\n currentUser: getCurrentUser(state),\n currentSpace: getCurrentSpace(state),\n spaces: getSpaces(state),\n mySpaces: getMySpaces(state),\n spaceCount: getSpaceCount(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n selectSpace,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SelectSpace);","import React, { useState, useEffect} from 'react';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant } from '../selectors';\nimport FormError from '../components/FormError';\nimport Navbar from '../components/Navbar';\nimport { getCurrentUser } from '../selectors/entities/users';\n\n\nconst Preference = ({ currentUser, match, settings, history, location, tenant }: any) => {\n const [error, setError] = useState<string | null>(null);\n const [fullname, setFullname] = useState<string | \"\">(currentUser.name);\n const searchParams = new URLSearchParams(location.search);\n let spaceId = searchParams.get(\"X-Space-Id\");\n const [user, setUser] = useState({ spaces: [], name: '' });\n const onSubmit = async (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n setError(null);\n try {\n if (!fullname.trim()) {\n throw new Error(\"accounts.nameRequired\");\n }\n\n // const r = await accountsRest.authFetch('user', {\n // method: \"PUT\",\n // body: JSON.stringify({\n // fullname: fullname\n // }),\n // credentials: 'include'\n // });\n\n } catch (err) {\n setError(err.message);\n }\n };\n\n return (\n<>\n <Navbar/>\n\n <main className=\"bg-cool-gray-100 h-screen\">\n <div className=\"max-w-7xl mx-auto sm:px-6 lg:px-8\">\n <div className=\"px-4 py-8 sm:px-0\">\n\n\n\n <header>\n <div className=\"max-w-7xl\">\n <h1 className=\"text-3xl font-bold leading-tight text-gray-900\">\n 账户设置\n </h1>\n </div>\n </header>\n\n<div className=\"hidden sm:block\">\n <div className=\"py-5\">\n <div className=\"border-t border-gray-200\"></div>\n </div>\n</div>\n\n<div className=\"mt-10 sm:mt-0\">\n <div className=\"md:grid md:grid-cols-3 md:gap-6\">\n <div className=\"md:col-span-1\">\n <div className=\"px-4 sm:px-0\">\n <h3 className=\"text-lg font-medium leading-6 text-gray-900\">个人信息</h3>\n {/* <p className=\"mt-1 text-sm leading-5 text-gray-600\">\n Use a permanent address where you can receive mail.\n </p> */}\n </div>\n </div>\n <div className=\"mt-5 md:mt-0 md:col-span-2\">\n <form onSubmit={onSubmit}>\n <div className=\"shadow overflow-hidden sm:rounded-md\">\n <div className=\"px-4 py-5 bg-white sm:p-6\">\n <div className=\"grid grid-cols-6 gap-6\">\n <div className=\"col-span-6 sm:col-span-3\">\n <label className=\"block text-sm font-medium leading-5 text-gray-700\">姓名</label>\n <input id=\"fullname\"\n value={fullname}\n onChange={e => setFullname(e.target.value)}\n className=\"mt-1 form-input block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:shadow-outline-blue focus:border-blue-300 transition duration-150 ease-in-out sm:text-sm sm:leading-5\"/>\n </div>\n </div>\n </div>\n {error && <FormError error={error!} />}\n <div className=\"px-4 py-3 bg-gray-50 text-right sm:px-6\">\n <button className=\"py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-indigo-600 shadow-sm hover:bg-indigo-500 focus:outline-none focus:shadow-outline-blue active:bg-indigo-600 transition duration-150 ease-in-out\">\n 保存\n </button>\n </div>\n </div>\n </form>\n </div>\n </div>\n</div>\n\n </div>\n </div>\n </main>\n\n</>\n );\n};\n\nfunction mapStateToProps(state: any) {\n return {\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state)\n };\n}\n\nexport default connect(mapStateToProps)(Preference);\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators } from 'redux';\nimport { verifyEmail, verifyMobile, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId, getCurrentUser } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium rounded-br-md bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if (onClick) {\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code'\n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass VerifyEmail extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n const verifyBy = 'email';\n this.state = {\n verifyBy,\n email: '',\n mobile: '',\n verifyCode: '',\n serverError: '',\n loading: false\n };\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage(`accounts.verify_${verifyBy}`) + ` | ${this.props.tenant.name}`;\n }\n\n handleEmailChange = (e) => {\n this.setState({\n email: e.target.value,\n });\n }\n\n handleMobileChange = (e) => {\n this.setState({\n mobile: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n\n sendVerificationToken = (e) => {\n this.setState({ serverError: null, loading: true });\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.verifyBy === 'email'?this.state.email.trim():'',\n mobile: this.state.verifyBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n if(userId && userId !== this.props.currentUserId){\n if(this.state.verifyBy === 'email'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.emailAlreadyExists'\n />\n ),\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.mobileAlreadyExists'\n />\n ),\n });\n }\n \n return\n }\n });\n }\n\n onSubmit = async (e) => {\n this.setState({ serverError: null, loading: true });\n e.preventDefault();\n this.setState({ error: null });\n\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n \n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n if(!this.state.verifyCode || !this.state.verifyCode.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.accounts.codeRequired'\n />\n ),\n });\n return\n }\n\n if(this.state.verifyBy === 'email'){\n this.props.actions.verifyEmail(this.state.email.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.props.actions.verifyMobile(this.state.mobile.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n };\n\n\n finish = (team) => {\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n }\n\n render() {\n\n return (\n <>\n <Background />\n <Card>\n <Logo />\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id={`accounts.verify_${this.state.verifyBy}`}\n defaultMessage={`verify ${this.state.verifyBy}`}\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n\n\n {this.state.verifyBy == 'email' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"email\"\n name=\"email\"\n value={this.state.email}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.email_placeholder', defaultMessage: 'Email' }}\n onChange={this.handleEmailChange}\n />\n </div>\n )}\n\n {this.state.verifyBy == 'mobile' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"mobile\"\n name=\"mobile\"\n value={this.state.mobile}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.mobile_placeholder', defaultMessage: 'Mobile' }}\n onChange={this.handleMobileChange}\n />\n </div>\n )}\n\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput\n id=\"verifyCode\"\n name=\"verifyCode\"\n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-bl-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.verifyCode', defaultMessage: 'Verify Code' }}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile} />\n\n </div>\n </div>\n\n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n currentUserId: getCurrentUserId(state),\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n verifyEmail,\n verifyMobile,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(VerifyEmail));\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { connect } from 'react-redux';\nimport { getSettings, getTenant, getSettingsTenantId } from '../selectors';\nimport * as Utils from '../utils/utils';\nimport FormError from '../components/FormError';\nimport Card from '../components/Card';\nimport Logo from '../components/Logo';\nimport Background from '../components/Background';\nimport LocalizedInput from '../components/LocalizedInput';\nimport { bindActionCreators } from 'redux';\nimport { verifyEmail, verifyMobile, sendVerificationToken } from '../actions/users';\nimport { withRouter } from \"react-router-dom\";\nimport * as GlobalAction from '../actions/global_actions';\nimport { getCurrentUserId, getCurrentUser } from '../selectors/entities/users';\nimport { useCountDown } from \"../components/countdown\";\n\nconst totalSeconds = 60;\nconst ReApplyCodeBtn = ({ onClick, id, loginId }) => {\n const [restTime, resetCountdown] = useCountDown(loginId || \"cnt1\", {\n total: totalSeconds,\n lifecycle: \"session\"\n });\n let textColor = \"text-blue-600 hover:text-blue-600\"\n if (restTime > 0) {\n textColor = \"text-gray-300 hover:text-gray-300\"\n }\n return (\n\n <button className={\"justify-center col-span-2 -ml-px relative inline-flex items-center px-3 py-3 border border-gray-300 text-sm leading-5 font-medium rounded-br-md bg-gray-100 hover:bg-white focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 transition ease-in-out duration-150 \" + textColor}\n id={id}\n disabled={restTime > 0}\n type=\"button\"\n onClick={(e) => {\n resetCountdown();\n if (onClick) {\n onClick();\n }\n }}>\n <span className=\"\">\n <FormattedMessage\n id='accounts.sendCode'\n defaultMessage='Get Verify code'\n />{restTime > 0 ? ` (${restTime})` : null}\n </span>\n </button>\n\n );\n};\n\n\nclass VerifyMobile extends React.Component {\n\n constructor(props, context) {\n super(props, context);\n\n const verifyBy = 'mobile';\n this.state = {\n verifyBy,\n email: '',\n mobile: '',\n verifyCode: '',\n serverError: '',\n loading: false\n };\n window.browserHistory = this.props.history;\n document.title = Utils.localizeMessage(`accounts.verify_${verifyBy}`) + ` | ${this.props.tenant.name}`;\n }\n\n handleEmailChange = (e) => {\n this.setState({\n email: e.target.value,\n });\n }\n\n handleMobileChange = (e) => {\n this.setState({\n mobile: e.target.value,\n });\n }\n\n handleCodeChange = (e) => {\n this.setState({\n verifyCode: e.target.value,\n });\n }\n\n\n sendVerificationToken = (e) => {\n this.setState({ serverError: null, loading: true });\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n const user = {\n email: this.state.verifyBy === 'email'?this.state.email.trim():'',\n mobile: this.state.verifyBy === 'mobile'?this.state.mobile.trim():'',\n }\n this.props.actions.sendVerificationToken(user).then(async (userId) => {\n if(userId && userId !== this.props.currentUserId){\n if(this.state.verifyBy === 'email'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.emailAlreadyExists'\n />\n ),\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.mobileAlreadyExists'\n />\n ),\n });\n }\n \n return\n }\n });\n }\n\n onSubmit = async (e) => {\n this.setState({ serverError: null, loading: true });\n e.preventDefault();\n this.setState({ error: null });\n\n if (this.state.verifyBy === 'email' && !this.state.email.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidEmail'\n />\n ),\n });\n return\n }\n \n if (this.state.verifyBy === 'mobile' && !this.state.mobile.trim()) {\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.invalidMobile'\n />\n ),\n });\n return\n }\n\n if(!this.state.verifyCode || !this.state.verifyCode.trim()){\n this.setState({\n serverError: (\n <FormattedMessage\n id='accounts.accounts.codeRequired'\n />\n ),\n });\n return\n }\n\n if(this.state.verifyBy === 'email'){\n this.props.actions.verifyEmail(this.state.email.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n\n if(this.state.verifyBy === 'mobile'){\n this.props.actions.verifyMobile(this.state.mobile.trim(), this.state.verifyCode.trim()).then(async ({ error }) => {\n if (error) {\n this.setState({\n serverError: (\n <FormattedMessage\n id={error.message}\n />\n ),\n });\n return;\n }\n this.finish();\n });\n }\n };\n\n\n finish = (team) => {\n const currentUser = this.props.currentUser;\n const tenant = this.props.tenant;\n const location = this.props.location;\n GlobalAction.finishSignin(currentUser, tenant, location)\n }\n\n render() {\n\n return (\n <>\n <Background />\n <Card>\n <Logo />\n <h2 className=\"mt-2 text-left text-2xl leading-9 font-extrabold text-gray-900\">\n <FormattedMessage\n id={`accounts.verify_${this.state.verifyBy}`}\n defaultMessage={`verify ${this.state.verifyBy}`}\n />\n </h2>\n\n <form onSubmit={this.onSubmit} className=\"mt-4\" autoCapitalize=\"none\">\n <div className=\"rounded-md shadow-sm my-2\">\n\n\n {this.state.verifyBy == 'email' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"email\"\n name=\"email\"\n value={this.state.email}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.email_placeholder', defaultMessage: 'Email' }}\n onChange={this.handleEmailChange}\n />\n </div>\n )}\n\n {this.state.verifyBy == 'mobile' && (\n <div className=\"-mt-px\">\n <LocalizedInput\n id=\"mobile\"\n name=\"mobile\"\n value={this.state.mobile}\n className=\"appearance-none rounded-none relative block w-full px-3 py-3 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.mobile_placeholder', defaultMessage: 'Mobile' }}\n onChange={this.handleMobileChange}\n />\n </div>\n )}\n\n <div className=\"-mt-px grid grid-cols-5\">\n <LocalizedInput\n id=\"verifyCode\"\n name=\"verifyCode\"\n value={this.state.verifyCode}\n className=\"col-span-3 appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-bl-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-md sm:leading-5\"\n placeholder={{ id: 'accounts.verifyCode', defaultMessage: 'Verify Code' }}\n onChange={this.handleCodeChange}\n />\n <ReApplyCodeBtn onClick={this.sendVerificationToken} id=\"reApplyCodeBtn\" loginId={this.state.email + this.state.mobile} />\n\n </div>\n </div>\n\n {this.state.serverError && <FormError error={this.state.serverError} />}\n\n <div className=\"mt-6 flex justify-end\">\n <button type=\"submit\" className=\"rounded group relative w-32 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-none text-white bg-blue-600 hover:bg-blue-500 focus:outline-none focus:border-blue-700 focus:shadow-outline-blue active:bg-blue-700 transition duration-150 ease-in-out\">\n <FormattedMessage\n id='accounts.submit'\n defaultMessage='Submit'\n />\n </button>\n </div>\n </form>\n </Card>\n </>\n );\n };\n\n}\n\nfunction mapStateToProps(state) {\n return {\n currentUserId: getCurrentUserId(state),\n currentUser: getCurrentUser(state),\n settings: getSettings(state),\n tenant: getTenant(state),\n settingsTenantId: getSettingsTenantId(state)\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n verifyEmail,\n verifyMobile,\n sendVerificationToken,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(withRouter(VerifyMobile));\n","import React from 'react';\nimport {bindActionCreators} from 'redux';\n\nimport { Switch, HashRouter, Route, Redirect } from 'react-router-dom';\nimport { connect } from 'react-redux';\nimport { getTenant } from './selectors';\nimport { getCurrentUser } from './selectors/entities/users'\nimport * as GlobalActions from './actions/global_actions';\nimport {loadMeAndConfig} from './actions/root';\n\nimport LoggedIn from './components/LoggedIn';\nimport Signup from './pages/Signup';\nimport Login from './pages/Login';\nimport Logout from './pages/Logout';\nimport Home from './pages/Home';\nimport UpdatePassword from './pages/updatePassword';\nimport CreateTenant from './pages/CreateTenant';\nimport SelectSpace from './pages/SelectSpace';\nimport Preference from './pages/Preference';\nimport Loading from './components/Loading';\nimport VerifyEmail from './pages/VerifyEmail';\nimport VerifyMobile from './pages/VerifyMobile';\n\n\nconst LoggedInRoute = ({component: Component, ...rest}) => {\n\n if (!Component) return null;\n return (\n <Route\n {...rest}\n render={(props) => (\n <LoggedIn {...props}>\n <Component {...props}/>\n </LoggedIn>\n )}\n />\n )}\n;\n\nclass Root extends React.PureComponent {\n\n constructor(props) {\n super(props);\n\n this.state = {\n configLoaded: false,\n };\n }\n\n onConfigLoaded = () => {\n this.setState({configLoaded: true});\n }\n\n componentDidMount() {\n this.props.actions.loadMeAndConfig().then((response) => {\n // let password_expired = false;\n // if(this.props.currentUser){\n // GlobalActions.finishSignin(this.props.currentUser, this.props.tenant, this.props.location);\n // } else{\n // GlobalActions.selectDefaultSpace();\n // if (document.location.pathname === '/' && document.location.hash === '#/' && response[1] && response[1].data) {\n // GlobalActions.redirectUserToDefaultSpace();\n // }\n // }\n this.onConfigLoaded();\n }).then(() => {\n // if (isCurrentUserSystemAdmin(store.getState())) {\n // this.props.actions.getWarnMetricsStatus();\n // }\n });\n // trackLoadTime();\n }\n\n render() {\n if (!this.state.configLoaded) {\n return <div/>;\n }\n \n return (\n <HashRouter basename=\"\">\n <div className=\"absolute w-full h-full\">\n <Loading></Loading>\n {/* <GlobalMessage></GlobalMessage> */}\n {/* <Route path=\"/\" component={GoBack}/> */}\n {/* <Route path=\"/\" component={Title}/> */}\n <Switch>\n <Route path=\"/browsers.html\" exact />\n <Route path=\"/logout\" component={Logout} />\n <LoggedInRoute exact path=\"/\" component={Home}/>\n\n <Route path=\"/signup\" component={Signup} />\n\n <Route path=\"/login\" component={Login} />\n \n <LoggedInRoute path=\"/create-space\" component={CreateTenant} />\n <LoggedInRoute path=\"/select-space\" component={SelectSpace} />\n <LoggedInRoute exact path=\"/update-password\" component={UpdatePassword} />\n <LoggedInRoute path=\"/verify/email\" component={VerifyEmail} />\n <LoggedInRoute path=\"/verify/mobile\" component={VerifyMobile} />\n {/* <Route path=\"/login-code\" component={LoginCode} /> */}\n <LoggedInRoute path=\"/preference\" component={Preference} />\n {/* <LoggedInRoute path=\"/verify-mobile/:token\" component={VerifyMobile} /> */}\n <LoggedInRoute path=\"/home\" component={Home}/>\n <LoggedInRoute path=\"/home/:spaceId\" component={Home}/>\n <Redirect\n to={{\n ...this.props.location,\n pathname: '/login',\n }}\n />\n </Switch>\n </div>\n </HashRouter>\n );\n };\n}\n\nfunction mapStateToProps(state) {\n return {\n tenant: getTenant(state),\n currentUser: getCurrentUser(state),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n loadMeAndConfig,\n //getWarnMetricsStatus,\n }, dispatch),\n };\n}\nexport default connect(mapStateToProps, mapDispatchToProps)(Root);","import * as I18n from '../i18n/i18n';\nimport {Client4} from '../client';\n\nexport function loadTranslations(locale, url) {\n // console.log('loadTranslations', locale,url);\n const translations = {};\n // No need to go to the server for EN\n if (locale === 'en') { \n const en = I18n.getAllLanguages()[locale].translations;\n Object.assign(translations, en);\n return {\n type: \"RECEIVED_TRANSLATIONS\",\n data: {\n locale,\n translations\n },\n }\n }\n \n return (dispatch) => {\n Client4.doFetch(url).then((translations) => {\n dispatch({\n type:\"RECEIVED_TRANSLATIONS\",\n data: {\n locale,\n translations,\n },\n });\n }).catch((error) => {\n console.warn('Actions - loadTranslations - recreived error: ', error)\n }); // eslint-disable-line no-empty-function\n }\n}","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport {IntlProvider as BaseIntlProvider} from 'react-intl';\n\nimport * as I18n from '../../i18n/i18n';\n\nexport default class IntlProvider extends React.PureComponent {\n static propTypes = {\n children: PropTypes.element.isRequired,\n locale: PropTypes.string.isRequired,\n settings: PropTypes.object,\n translations: PropTypes.object,\n actions: PropTypes.shape({\n loadTranslations: PropTypes.func.isRequired,\n }).isRequired,\n };\n\n constructor(props) {\n super(props);\n // props.actions.loadSettings();\n // props.actions.loadTenant();\n }\n\n componentDidMount() {\n // Initialize browser's i18n data\n I18n.doAddLocaleData();\n\n this.handleLocaleChange(this.props.locale);\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.locale !== this.props.locale) {\n this.handleLocaleChange(this.props.locale);\n }\n }\n\n handleLocaleChange = (locale) => {\n this.loadTranslationsIfNecessary(locale);\n }\n\n loadTranslationsIfNecessary = (locale) => {\n if (this.props.translations) {\n // Already loaded\n return;\n }\n\n const localeInfo = I18n.getLanguageInfo(locale);\n\n if (locale === 'en' || !localeInfo) {\n // English is loaded by default and invalid locales fall back to English, so we should never hit this\n return;\n }\n\n this.props.actions.loadTranslations(locale, localeInfo.url);\n }\n\n render() {\n // if (!this.props.translations) {\n // return null;\n // }\n\n return (\n <BaseIntlProvider\n key={this.props.locale}\n locale={this.props.locale}\n messages={this.props.translations}\n >\n {this.props.children}\n </BaseIntlProvider>\n );\n }\n}\n","// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\nimport {connect} from 'react-redux';\nimport {bindActionCreators} from 'redux';\n\nimport { loadTranslations } from '../../actions/i18n';\n\nimport {getCurrentLocale, getTranslations} from '../../selectors/i18n';\n\nimport IntlProvider from './intl_provider';\n\nfunction mapStateToProps(state) {\n const locale = getCurrentLocale(state);\n return {\n locale,\n translations: getTranslations(state, locale),\n };\n}\n\nfunction mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({\n loadTranslations,\n }, dispatch),\n };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(IntlProvider);\n","import 'react-app-polyfill/ie9';\nimport 'core-js/proposals/url';\nimport 'core-js/stable';\n\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport Router from './root';\nimport { Provider } from 'react-redux'\nimport IntlProvider from './components/intl_provider';\n\nimport store from './stores/redux_store';\n\n\nReactDOM.render(\n <Provider store={store}>\n <IntlProvider>\n <Router />\n </IntlProvider>\n </Provider>,\n document.getElementById('root') as HTMLElement);\n"],"sourceRoot":""}