{ "version": 3, "sources": ["src/app/services/user.service.ts"], "sourcesContent": ["import { Injectable } from '@angular/core';\nimport { Store } from '@ngrx/store';\nimport { selectUser } from '../ngrx/data.reducer';\nimport { distinctUntilChanged, Subject, takeUntil } from 'rxjs';\n\n@Injectable()\nexport class UserService {\n user$ = this.store.select(selectUser);\n userDetails;\n private destroy$ = new Subject();\n constructor(private store: Store) {\n this.user$\n .pipe(\n distinctUntilChanged(\n (prev, curr) => JSON.stringify(prev) === JSON.stringify(curr),\n ),\n takeUntil(this.destroy$),\n )\n .subscribe((user) => {\n this.userDetails = user;\n });\n }\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n }\n loginDataSet(response) {\n let Data = {\n ...(this.userDetails || {}),\n email: response?.[0]?.email || null,\n fullName: response?.[0]?.fullName || null,\n id: response?.[0]?.id || null,\n phone: response?.[0]?.phone || null,\n countryCode: response?.countryCode || null,\n phoneCode: response?.phoneCode || null,\n loggedIn: response?.loggedIn || null,\n profileImage: response?.[0]?.profileImage || null,\n registeredFrom: response?.[0]?.registeredFrom || null,\n timeZone: response?.[0]?.timeZone || null,\n userType: response?.[0]?.userType || null,\n userTypeId: response?.[0]?.userTypeId || null,\n deviceID: response[1]?.deviceID || null,\n refreshToken: response[1]?.refreshToken || null,\n token: response[1]?.token || null,\n isOnBoardingCompleted:\n response?.[0]?.userTypeId === 1\n ? response?.[0]?.mentorDetails?.[0]?.isOnBoardingCompleted\n : false,\n currentCountry: null,\n chooseProfile: false,\n aboutMe: response?.[0]?.mentorDetails?.[0]?.aboutMe || null,\n shortBio: response?.[0]?.mentorDetails?.[0]?.shortBio || null,\n uniqueName: response?.[0]?.mentorDetails?.[0]?.uniqueName || null,\n userName: response?.[0]?.mentorDetails?.[0]?.userName || null,\n socialLink: response?.[0]?.mentorDetails?.[0]?.socialLink || null,\n otherCategory: response?.[0]?.mentorDetails?.[0]?.otherCatagory || null,\n verificationPostUrl:\n response?.[0]?.mentorDetails?.[0]?.verificationPostUrl || null,\n profileVideoUrl:\n response?.[0]?.mentorDetails?.[0]?.profileVideoUrl || null,\n mentorSlotBuffer:\n response?.[0]?.mentorDetails?.[0]?.mentorSlotBuffer || null,\n supportMentorDefaultAmount:\n response?.[0]?.mentorDetails?.[0]?.supportMentorDefaultAmount || null,\n isProfileCompleted:\n response?.[0]?.mentorDetails?.[0]?.isProfileCompleted || null,\n zoomAccessTokenEnc:\n response?.mentorDetails?.[0]?.zoomAccessTokenEnc !== ''\n ? response?.mentorDetails?.[0]?.zoomAccessTokenEnc\n : null,\n zoomRefreshTokenEnc:\n response?.mentorDetails?.[0]?.zoomRefreshTokenEnc !== ''\n ? response?.mentorDetails?.[0]?.zoomRefreshTokenEnc\n : null,\n zoomKey:\n response?.mentorDetails?.[0]?.zoomKey !== ''\n ? response?.mentorDetails?.[0]?.zoomKey\n : null,\n zoomAesiv:\n response?.mentorDetails?.[0]?.zoomAesiv !== ''\n ? response?.mentorDetails?.[0]?.zoomAesiv\n : null,\n isApproved: response?.[0]?.mentorDetails?.[0]?.isApproved || null,\n applyApproval: response?.[0]?.mentorDetails?.[0]?.applyApproval || null,\n googleCalendarAccessToken:\n response?.[0]?.mentorDetails?.[0]?.googleCalendarAccessToken || null,\n googleCalendarRefreshToken:\n response?.[0]?.mentorDetails?.[0]?.googleCalendarRefreshToken || null,\n microsoftCalendarAccessToken:\n response?.[0]?.mentorDetails?.[0]?.microsoftCalendarAccessToken || null,\n microsoftCalendarRefreshToken:\n response?.[0]?.mentorDetails?.[0]?.microsoftCalendarRefreshToken ||\n null,\n };\n let filteredObject: any = Object.fromEntries(\n Object.entries(Data).filter(([key, value]) => value !== null),\n );\n return filteredObject;\n }\n userDataSet(response) {\n let Data = {\n ...(this.userDetails || {}),\n email: response?.email || null,\n fullName: response?.fullName || null,\n id: response?.id || null,\n phone: response?.phone || null,\n countryCode: response?.countryCode || null,\n phoneCode: response?.phoneCode || null,\n loggedIn: response?.loggedIn || null,\n profileImage: response?.profileImage || null,\n registeredFrom: response?.registeredFrom || null,\n timeZone: response?.timeZone || null,\n userType: response?.userType || null,\n userTypeId: response?.userTypeId || null,\n deviceID: response[1]?.deviceID || null,\n refreshToken: response[1]?.refreshToken || null,\n token: response[1]?.token || null,\n isOnBoardingCompleted:\n response?.userTypeId === 1\n ? response?.mentorDetails?.[0]?.isOnBoardingCompleted\n : false,\n currentCountry: null,\n chooseProfile: false,\n aboutMe: response?.mentorDetails?.[0]?.aboutMe || null,\n shortBio: response?.mentorDetails?.[0]?.shortBio || null,\n uniqueName: response?.mentorDetails?.[0]?.uniqueName || null,\n userName: response?.mentorDetails?.[0]?.userName || null,\n socialLink: response?.mentorDetails?.[0]?.socialLink || null,\n otherCategory: response?.mentorDetails?.[0]?.otherCatagory || null,\n verificationPostUrl:\n response?.mentorDetails?.[0]?.verificationPostUrl || null,\n profileVideoUrl: response?.mentorDetails?.[0]?.profileVideoUrl || null,\n mentorSlotBuffer: response?.mentorDetails?.[0]?.mentorSlotBuffer || null,\n supportMentorDefaultAmount:\n response?.mentorDetails?.[0]?.supportMentorDefaultAmount || null,\n isProfileCompleted:\n response?.mentorDetails?.[0]?.isProfileCompleted || null,\n zoomAccessTokenEnc:\n response?.mentorDetails?.[0]?.zoomAccessTokenEnc !== ''\n ? response?.mentorDetails?.[0]?.zoomAccessTokenEnc\n : null,\n zoomRefreshTokenEnc:\n response?.mentorDetails?.[0]?.zoomRefreshTokenEnc !== ''\n ? response?.mentorDetails?.[0]?.zoomRefreshTokenEnc\n : null,\n zoomKey:\n response?.mentorDetails?.[0]?.zoomKey !== ''\n ? response?.mentorDetails?.[0]?.zoomKey\n : null,\n zoomAesiv:\n response?.mentorDetails?.[0]?.zoomAesiv !== ''\n ? response?.mentorDetails?.[0]?.zoomAesiv\n : null,\n googleMeetAccessToken: response?.model?.mentorDetails?.[0]?.googleMeetAccessToken,\n googleMeetAesiv: response?.model?.mentorDetails?.[0]?.googleMeetAesiv,\n googleMeetKey: response?.model?.mentorDetails?.[0]?.googleMeetKey,\n googleMeetRefreshToken: response?.model?.mentorDetails?.[0]?.googleMeetRefreshToken,\n isApproved: response?.mentorDetails?.[0]?.isApproved || null,\n applyApproval: response?.mentorDetails?.[0]?.applyApproval || null,\n googleCalendarAccessToken:\n response?.mentorDetails?.[0]?.googleCalendarAccessToken || null,\n googleCalendarRefreshToken:\n response?.mentorDetails?.[0]?.googleCalendarRefreshToken || null,\n microsoftCalendarAccessToken:\n response?.mentorDetails?.[0]?.microsoftCalendarAccessToken || null,\n microsoftCalendarRefreshToken:\n response?.mentorDetails?.[0]?.microsoftCalendarRefreshToken || null,\n\n bankName: response?.bankAccountDetails?.[0]?.bankName || null,\n bankAccountName: response?.bankAccountDetails?.[0]?.accountName || null,\n bankAccountNumber: response?.bankAccountDetails?.[0]?.accountNumber || null,\n bankCountry: response?.bankAccountDetails?.[0]?.country || null,\n };\n let filteredObject: any = Object.fromEntries(\n Object.entries(Data).filter(\n ([key, value]) => value !== null && value !== '',\n ),\n );\n return filteredObject;\n }\n}\n"], "mappings": "+HAMA,IAAaA,GAAW,IAAA,CAAlB,IAAOA,EAAP,MAAOA,CAAW,CAItBC,YAAoBC,EAAY,CAAZ,KAAAA,MAAAA,EAHpB,KAAAC,MAAQ,KAAKD,MAAME,OAAOC,CAAU,EAE5B,KAAAC,SAAW,IAAIC,EAErB,KAAKJ,MACFK,KACCC,EACE,CAACC,EAAMC,IAASC,KAAKC,UAAUH,CAAI,IAAME,KAAKC,UAAUF,CAAI,CAAC,EAE/DG,EAAU,KAAKR,QAAQ,CAAC,EAEzBS,UAAWC,GAAQ,CAClB,KAAKC,YAAcD,CACrB,CAAC,CACL,CACAE,aAAW,CACT,KAAKZ,SAASa,KAAI,EAClB,KAAKb,SAASc,SAAQ,CACxB,CACAC,aAAaC,EAAQ,CACnB,IAAIC,EAAOC,EAAAC,EAAA,GACL,KAAKR,aAAe,CAAA,GADf,CAETS,MAAOJ,IAAW,CAAC,GAAGI,OAAS,KAC/BC,SAAUL,IAAW,CAAC,GAA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lB,IAAO1F,EAAP2F,SAAO3F,CAAW,GAAA", "names": ["UserService", "constructor", "store", "user$", "select", "selectUser", "destroy$", "Subject", "pipe", "distinctUntilChanged", "prev", "curr", "JSON", "stringify", "takeUntil", "subscribe", "user", "userDetails", "ngOnDestroy", "next", "complete", "loginDataSet", "response", "Data", "__spreadProps", "__spreadValues", "email", "fullName", "id", "phone", "countryCode", "phoneCode", "loggedIn", "profileImage", "registeredFrom", "timeZone", "userType", "userTypeId", "deviceID", "refreshToken", "token", "isOnBoardingCompleted", "mentorDetails", "currentCountry", "chooseProfile", "aboutMe", "shortBio", "uniqueName", "userName", "socialLink", "otherCategory", "otherCatagory", "verificationPostUrl", "profileVideoUrl", "mentorSlotBuffer", "supportMentorDefaultAmount", "isProfileCompleted", "zoomAccessTokenEnc", "zoomRefreshTokenEnc", "zoomKey", "zoomAesiv", "isApproved", "applyApproval", "googleCalendarAccessToken", "googleCalendarRefreshToken", "microsoftCalendarAccessToken", "microsoftCalendarRefreshToken", "Object", "fromEntries", "entries", "filter", "key", "value", "userDataSet", "googleMeetAccessToken", "model", "googleMeetAesiv", "googleMeetKey", "googleMeetRefreshToken", "bankName", "bankAccountDetails", "bankAccountName", "accountName", "bankAccountNumber", "accountNumber", "bankCountry", "country", "\u0275\u0275inject", "Store", "factory", "\u0275fac", "_UserService"] }