{ "version": 3, "sources": ["../javascripts/selectors/profile.ts"], "sourcesContent": ["import { createSelector } from '@reduxjs/toolkit';\nimport { jwtDecode } from 'jwt-decode';\nimport type { ProfileFull } from '../@types/Profile';\nimport type { Token } from '../@types/Token';\nimport type { RootState } from '../reducers';\n\nexport const getProfile = createSelector(\n (state: RootState) => state.auth.profile,\n (state: RootState) => state.auth.token,\n (profile, token) => {\n if (!token || !profile) return null;\n\n try {\n const data = jwtDecode(token);\n const fullProfile: ProfileFull = {\n ...profile,\n id: data.sub,\n email: data.email,\n };\n return fullProfile;\n } catch (_e) {\n return null;\n }\n },\n);\n"], "mappings": "8FAMO,IAAMA,EAAaC,EACvBC,GAAqBA,EAAM,KAAK,QAChCA,GAAqBA,EAAM,KAAK,MACjC,CAACC,EAASC,IAAU,CAClB,GAAI,CAACA,GAAS,CAACD,EAAS,OAAO,KAE/B,GAAI,CACF,IAAME,EAAOC,EAAiBF,CAAK,EAMnC,MALiC,CAC/B,GAAGD,EACH,GAAIE,EAAK,IACT,MAAOA,EAAK,KACd,CAEF,MAAa,CACX,OAAO,IACT,CACF,CACF", "names": ["getProfile", "createSelector", "state", "profile", "token", "data", "jwtDecode"] }