{ "version": 3, "sources": ["src/app/core/services/client-details/client-details.service.ts", "src/app/core/validators/empty-space-validator.ts"], "sourcesContent": ["\r\nimport { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\r\nimport { BaseService } from '../base.service';\r\nimport { Observable, of, BehaviorSubject } from 'rxjs';\r\nimport { ClientDetails } from '@app/models/dashboard/client-details';\r\n\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ClientDetailsService extends BaseService {\r\n\r\n private remindersCountSubject = new BehaviorSubject(false);\r\n reminderAdded = this.remindersCountSubject.asObservable();\r\n\r\n private isConnectedToOpenSpaceSubject = new BehaviorSubject(false);\r\n connectToOpenSpace = this.isConnectedToOpenSpaceSubject.asObservable();\r\n constructor(private http: HttpClient) {\r\n super();\r\n }\r\n\r\n\r\n isConnectedToOpenSpace(isConnected: boolean) {\r\n this.isConnectedToOpenSpaceSubject.next(isConnected);\r\n }\r\n\r\n updateReminderCountAdded(isReminderAdded: boolean) {\r\n this.remindersCountSubject.next(isReminderAdded);\r\n }\r\n\r\n getClientDetails(clientId: number, additionalDetails: boolean): Observable {\r\n // check if you can remove managerId\r\n return this.http.get(\r\n `${this.API_URL}/clients/${clientId}/?additionalDetails=${additionalDetails}`\r\n );\r\n }\r\n getCountries() {\r\n return this.http.get(`${this.API_URL}/countries`);\r\n }\r\n\r\n postEditClientDetails(params: any): Observable {\r\n return this.http.put(\r\n `${this.API_URL}/clients/${params.clientId}`,\r\n JSON.stringify(params),\r\n this.httpOptions\r\n );\r\n }\r\n\r\n postCompanyImage(clientId: number, image: File): Observable {\r\n const postData = new FormData();\r\n postData.append('file', image);\r\n return this.http.post(\r\n `${this.API_URL}/clients/${clientId}/logo`,\r\n postData\r\n );\r\n }\r\n detachClient(clientId: number) {\r\n return this.http.delete(\r\n `${this.API_URL}/clients/${clientId}`\r\n );\r\n\r\n }\r\n\r\n deleteCompanyImage(clientId: number): Observable {\r\n return this.http.delete(\r\n `${this.API_URL}/clients/${clientId}/logo`\r\n );\r\n }\r\n\r\n redirectToOpenSpace(clientId: number): Observable {\r\n return this.http.get(\r\n `${this.API_URL}/openspace/${clientId}/session`\r\n );\r\n }\r\n\r\n postRestrictAccessToKF(restrictAccessToKF: string, clientId: string): Observable {\r\n return this.http.post(`${this.KF_API_URL}/settings/single?keyName=RestrictAccessToKF&value=${restrictAccessToKF}`, {},\r\n { headers: new HttpHeaders().set('clientId', clientId)});\r\n }\r\n\r\n}\r\n\r\n", "import { AbstractControl, ValidationErrors } from '@angular/forms';\r\nexport class EmptySpaceValidator {\r\n static cannotContainSpace(control: AbstractControl): ValidationErrors | null {\r\n if (control.value) {\r\n if ((control.value as string).indexOf(' ') >= 0) {\r\n return { cannotContainSpace: true };\r\n }\r\n }\r\n return null;\r\n }\r\n}\r\n"], "mappings": ";;;;;;;;;;AAWO,IAAM,uBAAN,MAAMA,8BAA6B,YAAW;EAOnD,YAAoB,MAAgB;AAClC,UAAK;AADa,SAAA,OAAA;AALZ,SAAA,wBAAwB,IAAI,gBAAyB,KAAK;AAClE,SAAA,gBAAgB,KAAK,sBAAsB,aAAY;AAE/C,SAAA,gCAAgC,IAAI,gBAAyB,KAAK;AAC1E,SAAA,qBAAqB,KAAK,8BAA8B,aAAY;EAGpE;EAGA,uBAAuB,aAAoB;AACzC,SAAK,8BAA8B,KAAK,WAAW;EACrD;EAEA,yBAAyB,iBAAwB;AAC/C,SAAK,sBAAsB,KAAK,eAAe;EACjD;EAEA,iBAAiB,UAAkB,mBAA0B;AAE3D,WAAO,KAAK,KAAK,IACf,GAAG,KAAK,OAAO,YAAY,QAAQ,uBAAuB,iBAAiB,EAAE;EAEjF;EACA,eAAY;AACV,WAAO,KAAK,KAAK,IAAS,GAAG,KAAK,OAAO,YAAY;EACvD;EAEA,sBAAsB,QAAW;AAC/B,WAAO,KAAK,KAAK,IACf,GAAG,KAAK,OAAO,YAAY,OAAO,QAAQ,IAC1C,KAAK,UAAU,MAAM,GACrB,KA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