| 
						
						
						
					 | 
					@ -1,11 +1,10 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { GfSymbolPipe } from '@ghostfolio/client/pipes/symbol/symbol.pipe'; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { AdminService } from '@ghostfolio/client/services/admin.service'; | 
					 | 
					 | 
					import { AdminService } from '@ghostfolio/client/services/admin.service'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { DataService } from '@ghostfolio/client/services/data.service'; | 
					 | 
					 | 
					import { DataService } from '@ghostfolio/client/services/data.service'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; | 
					 | 
					 | 
					import { getAssetProfileIdentifier } from '@ghostfolio/common/helper'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { Filter, PortfolioPosition, User } from '@ghostfolio/common/interfaces'; | 
					 | 
					 | 
					import { Filter, PortfolioPosition, User } from '@ghostfolio/common/interfaces'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { InternalRoute } from '@ghostfolio/common/routes/interfaces/internal-route.interface'; | 
					 | 
					 | 
					import { InternalRoute } from '@ghostfolio/common/routes/interfaces/internal-route.interface'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { internalRoutes } from '@ghostfolio/common/routes/routes'; | 
					 | 
					 | 
					import { internalRoutes } from '@ghostfolio/common/routes/routes'; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					import { DateRange } from '@ghostfolio/common/types'; | 
					 | 
					 | 
					import { AccountWithPlatform, DateRange } from '@ghostfolio/common/types'; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { FocusKeyManager } from '@angular/cdk/a11y'; | 
					 | 
					 | 
					import { FocusKeyManager } from '@angular/cdk/a11y'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { | 
					 | 
					 | 
					import { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -25,19 +24,14 @@ import { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  ViewChild, | 
					 | 
					 | 
					  ViewChild, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  ViewChildren | 
					 | 
					 | 
					  ViewChildren | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} from '@angular/core'; | 
					 | 
					 | 
					} from '@angular/core'; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					import { | 
					 | 
					 | 
					import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					  FormBuilder, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  FormControl, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  FormsModule, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  ReactiveFormsModule | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} from '@angular/forms'; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					import { MatButtonModule } from '@angular/material/button'; | 
					 | 
					 | 
					import { MatButtonModule } from '@angular/material/button'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { MatFormFieldModule } from '@angular/material/form-field'; | 
					 | 
					 | 
					import { MatFormFieldModule } from '@angular/material/form-field'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { MatMenuTrigger } from '@angular/material/menu'; | 
					 | 
					 | 
					import { MatMenuTrigger } from '@angular/material/menu'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { MatSelectModule } from '@angular/material/select'; | 
					 | 
					 | 
					import { MatSelectModule } from '@angular/material/select'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { RouterModule } from '@angular/router'; | 
					 | 
					 | 
					import { RouterModule } from '@angular/router'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { IonIcon } from '@ionic/angular/standalone'; | 
					 | 
					 | 
					import { IonIcon } from '@ionic/angular/standalone'; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					import { Account, AssetClass, DataSource } from '@prisma/client'; | 
					 | 
					 | 
					import { AssetClass, DataSource } from '@prisma/client'; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					import { differenceInYears } from 'date-fns'; | 
					 | 
					 | 
					import { differenceInYears } from 'date-fns'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import Fuse from 'fuse.js'; | 
					 | 
					 | 
					import Fuse from 'fuse.js'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { addIcons } from 'ionicons'; | 
					 | 
					 | 
					import { addIcons } from 'ionicons'; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -60,8 +54,11 @@ import { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  tap | 
					 | 
					 | 
					  tap | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} from 'rxjs/operators'; | 
					 | 
					 | 
					} from 'rxjs/operators'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { GfEntityLogoComponent } from '../entity-logo/entity-logo.component'; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { translate } from '../i18n'; | 
					 | 
					 | 
					import { translate } from '../i18n'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  GfPortfolioFilterFormComponent, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  PortfolioFilterFormValue | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					} from '../portfolio-filter-form'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { GfAssistantListItemComponent } from './assistant-list-item/assistant-list-item.component'; | 
					 | 
					 | 
					import { GfAssistantListItemComponent } from './assistant-list-item/assistant-list-item.component'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { SearchMode } from './enums/search-mode'; | 
					 | 
					 | 
					import { SearchMode } from './enums/search-mode'; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import { | 
					 | 
					 | 
					import { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -75,8 +72,7 @@ import { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  imports: [ | 
					 | 
					 | 
					  imports: [ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    FormsModule, | 
					 | 
					 | 
					    FormsModule, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    GfAssistantListItemComponent, | 
					 | 
					 | 
					    GfAssistantListItemComponent, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    GfEntityLogoComponent, | 
					 | 
					 | 
					    GfPortfolioFilterFormComponent, | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					    GfSymbolPipe, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    IonIcon, | 
					 | 
					 | 
					    IonIcon, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    MatButtonModule, | 
					 | 
					 | 
					    MatButtonModule, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    MatFormFieldModule, | 
					 | 
					 | 
					    MatFormFieldModule, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -141,16 +137,10 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public static readonly SEARCH_RESULTS_DEFAULT_LIMIT = 5; | 
					 | 
					 | 
					  public static readonly SEARCH_RESULTS_DEFAULT_LIMIT = 5; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  public accounts: Account[] = []; | 
					 | 
					 | 
					  public accounts: AccountWithPlatform[] = []; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  public assetClasses: Filter[] = []; | 
					 | 
					 | 
					  public assetClasses: Filter[] = []; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public dateRangeFormControl = new FormControl<string>(undefined); | 
					 | 
					 | 
					  public dateRangeFormControl = new FormControl<string>(undefined); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public dateRangeOptions: DateRangeOption[] = []; | 
					 | 
					 | 
					  public dateRangeOptions: DateRangeOption[] = []; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public filterForm = this.formBuilder.group({ | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    account: new FormControl<string>(undefined), | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    assetClass: new FormControl<string>(undefined), | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    holding: new FormControl<PortfolioPosition>(undefined), | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    tag: new FormControl<string>(undefined) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public holdings: PortfolioPosition[] = []; | 
					 | 
					 | 
					  public holdings: PortfolioPosition[] = []; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public isLoading = { | 
					 | 
					 | 
					  public isLoading = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    accounts: false, | 
					 | 
					 | 
					    accounts: false, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -160,6 +150,14 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  }; | 
					 | 
					 | 
					  }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public isOpen = false; | 
					 | 
					 | 
					  public isOpen = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public placeholder = $localize`Find account, holding or page...`; | 
					 | 
					 | 
					  public placeholder = $localize`Find account, holding or page...`; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  public portfolioFilterFormControl = new FormControl<PortfolioFilterFormValue>( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      account: null, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      assetClass: null, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      holding: null, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      tag: null | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					  ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public searchFormControl = new FormControl(''); | 
					 | 
					 | 
					  public searchFormControl = new FormControl(''); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public searchResults: SearchResults = { | 
					 | 
					 | 
					  public searchResults: SearchResults = { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    accounts: [], | 
					 | 
					 | 
					    accounts: [], | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -186,8 +184,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public constructor( | 
					 | 
					 | 
					  public constructor( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    private adminService: AdminService, | 
					 | 
					 | 
					    private adminService: AdminService, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    private changeDetectorRef: ChangeDetectorRef, | 
					 | 
					 | 
					    private changeDetectorRef: ChangeDetectorRef, | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    private dataService: DataService, | 
					 | 
					 | 
					    private dataService: DataService | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					    private formBuilder: FormBuilder | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  ) { | 
					 | 
					 | 
					  ) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    addIcons({ closeCircleOutline, closeOutline, searchOutline }); | 
					 | 
					 | 
					    addIcons({ closeCircleOutline, closeOutline, searchOutline }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -244,7 +241,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ); | 
					 | 
					 | 
					            ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          } | 
					 | 
					 | 
					          } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          // Accounts
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          const accounts$: Observable<Partial<SearchResults>> = | 
					 | 
					 | 
					          const accounts$: Observable<Partial<SearchResults>> = | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.searchAccounts(searchTerm).pipe( | 
					 | 
					 | 
					            this.searchAccounts(searchTerm).pipe( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              map((accounts) => ({ | 
					 | 
					 | 
					              map((accounts) => ({ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -263,7 +259,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              }) | 
					 | 
					 | 
					              }) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ); | 
					 | 
					 | 
					            ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          // Asset profiles
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          const assetProfiles$: Observable<Partial<SearchResults>> = this | 
					 | 
					 | 
					          const assetProfiles$: Observable<Partial<SearchResults>> = this | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            .hasPermissionToAccessAdminControl | 
					 | 
					 | 
					            .hasPermissionToAccessAdminControl | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ? this.searchAssetProfiles(searchTerm).pipe( | 
					 | 
					 | 
					            ? this.searchAssetProfiles(searchTerm).pipe( | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -292,7 +287,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }) | 
					 | 
					 | 
					                }) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              ); | 
					 | 
					 | 
					              ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          // Holdings
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          const holdings$: Observable<Partial<SearchResults>> = | 
					 | 
					 | 
					          const holdings$: Observable<Partial<SearchResults>> = | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.searchHoldings(searchTerm).pipe( | 
					 | 
					 | 
					            this.searchHoldings(searchTerm).pipe( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              map((holdings) => ({ | 
					 | 
					 | 
					              map((holdings) => ({ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -311,7 +305,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              }) | 
					 | 
					 | 
					              }) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            ); | 
					 | 
					 | 
					            ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          // Quick links
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          const quickLinks$: Observable<Partial<SearchResults>> = of( | 
					 | 
					 | 
					          const quickLinks$: Observable<Partial<SearchResults>> = of( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            this.searchQuickLinks(searchTerm) | 
					 | 
					 | 
					            this.searchQuickLinks(searchTerm) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          ).pipe( | 
					 | 
					 | 
					          ).pipe( | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -327,7 +320,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            }) | 
					 | 
					 | 
					            }) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          ); | 
					 | 
					 | 
					          ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          // Merge all results
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          return merge(accounts$, assetProfiles$, holdings$, quickLinks$).pipe( | 
					 | 
					 | 
					          return merge(accounts$, assetProfiles$, holdings$, quickLinks$).pipe( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            scan( | 
					 | 
					 | 
					            scan( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					              (acc: SearchResults, curr: Partial<SearchResults>) => ({ | 
					 | 
					 | 
					              (acc: SearchResults, curr: Partial<SearchResults>) => ({ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -362,22 +354,11 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            quickLinks: [] | 
					 | 
					 | 
					            quickLinks: [] | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          }; | 
					 | 
					 | 
					          }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.changeDetectorRef.markForCheck(); | 
					 | 
					 | 
					          this.changeDetectorRef.markForCheck(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        complete: () => { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.isLoading = { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            accounts: false, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            assetProfiles: false, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            holdings: false, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            quickLinks: false | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          }; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          this.changeDetectorRef.markForCheck(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }); | 
					 | 
					 | 
					      }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public ngOnChanges() { | 
					 | 
					 | 
					  public ngOnChanges() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.accounts = this.user?.accounts ?? []; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.dateRangeOptions = [ | 
					 | 
					 | 
					    this.dateRangeOptions = [ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        label: $localize`Today`, | 
					 | 
					 | 
					        label: $localize`Today`, | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -445,7 +426,11 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.dateRangeFormControl.setValue(this.user?.settings?.dateRange ?? null); | 
					 | 
					 | 
					    this.dateRangeFormControl.setValue(this.user?.settings?.dateRange ?? null); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    this.filterForm.disable({ emitEvent: false }); | 
					 | 
					 | 
					    if (this.hasPermissionToChangeFilters) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      this.portfolioFilterFormControl.enable({ emitEvent: false }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					      this.portfolioFilterFormControl.disable({ emitEvent: false }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.tags = | 
					 | 
					 | 
					    this.tags = | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.user?.tags | 
					 | 
					 | 
					      this.user?.tags | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -459,29 +444,6 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            type: 'TAG' | 
					 | 
					 | 
					            type: 'TAG' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          }; | 
					 | 
					 | 
					          }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }) ?? []; | 
					 | 
					 | 
					        }) ?? []; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (this.tags.length === 0) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.filterForm.get('tag').disable({ emitEvent: false }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public hasFilter(aFormValue: { [key: string]: string }) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    return Object.values(aFormValue).some((value) => { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      return !!value; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public holdingComparisonFunction( | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    option: PortfolioPosition, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    value: PortfolioPosition | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  ): boolean { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    if (value === null) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      return false; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    return ( | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      getAssetProfileIdentifier(option) === getAssetProfileIdentifier(value) | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public initialize() { | 
					 | 
					 | 
					  public initialize() { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -527,36 +489,35 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          .sort((a, b) => { | 
					 | 
					 | 
					          .sort((a, b) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            return a.name?.localeCompare(b.name); | 
					 | 
					 | 
					            return a.name?.localeCompare(b.name); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					          }); | 
					 | 
					 | 
					          }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        this.setFilterFormValues(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        if (this.hasPermissionToChangeFilters) { | 
					 | 
					 | 
					        this.setPortfolioFilterFormValues(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					          this.filterForm.enable({ emitEvent: false }); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        this.changeDetectorRef.markForCheck(); | 
					 | 
					 | 
					        this.changeDetectorRef.markForCheck(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }); | 
					 | 
					 | 
					      }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public onApplyFilters() { | 
					 | 
					 | 
					  public onApplyFilters() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    const filterValue = this.portfolioFilterFormControl.value; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.filtersChanged.emit([ | 
					 | 
					 | 
					    this.filtersChanged.emit([ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        id: this.filterForm.get('account').value, | 
					 | 
					 | 
					        id: filterValue?.account, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        type: 'ACCOUNT' | 
					 | 
					 | 
					        type: 'ACCOUNT' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					      }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        id: this.filterForm.get('assetClass').value, | 
					 | 
					 | 
					        id: filterValue?.assetClass, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        type: 'ASSET_CLASS' | 
					 | 
					 | 
					        type: 'ASSET_CLASS' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					      }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        id: this.filterForm.get('holding').value?.dataSource, | 
					 | 
					 | 
					        id: filterValue?.holding?.dataSource, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        type: 'DATA_SOURCE' | 
					 | 
					 | 
					        type: 'DATA_SOURCE' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					      }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        id: this.filterForm.get('holding').value?.symbol, | 
					 | 
					 | 
					        id: filterValue?.holding?.symbol, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        type: 'SYMBOL' | 
					 | 
					 | 
					        type: 'SYMBOL' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					      }, | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					      { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        id: this.filterForm.get('tag').value, | 
					 | 
					 | 
					        id: filterValue?.tag, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        type: 'TAG' | 
					 | 
					 | 
					        type: 'TAG' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      } | 
					 | 
					 | 
					      } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ]); | 
					 | 
					 | 
					    ]); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -569,12 +530,15 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public onCloseAssistant() { | 
					 | 
					 | 
					  public onCloseAssistant() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    this.portfolioFilterFormControl.reset(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.setIsOpen(false); | 
					 | 
					 | 
					    this.setIsOpen(false); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.closed.emit(); | 
					 | 
					 | 
					    this.closed.emit(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  public onResetFilters() { | 
					 | 
					 | 
					  public onResetFilters() { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    this.portfolioFilterFormControl.reset(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    this.filtersChanged.emit( | 
					 | 
					 | 
					    this.filtersChanged.emit( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      this.filterTypes.map((type) => { | 
					 | 
					 | 
					      this.filterTypes.map((type) => { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return { | 
					 | 
					 | 
					        return { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -786,7 +750,7 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }); | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					  private setFilterFormValues() { | 
					 | 
					 | 
					  private setPortfolioFilterFormValues() { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    const dataSource = this.user?.settings?.[ | 
					 | 
					 | 
					    const dataSource = this.user?.settings?.[ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      'filters.dataSource' | 
					 | 
					 | 
					      'filters.dataSource' | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ] as DataSource; | 
					 | 
					 | 
					    ] as DataSource; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -800,16 +764,11 @@ export class GfAssistantComponent implements OnChanges, OnDestroy, OnInit { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      ); | 
					 | 
					 | 
					      ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }); | 
					 | 
					 | 
					    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    this.filterForm.setValue( | 
					 | 
					 | 
					    this.portfolioFilterFormControl.setValue({ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					      { | 
					 | 
					 | 
					      account: this.user?.settings?.['filters.accounts']?.[0] ?? null, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        account: this.user?.settings?.['filters.accounts']?.[0] ?? null, | 
					 | 
					 | 
					      assetClass: this.user?.settings?.['filters.assetClasses']?.[0] ?? null, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        assetClass: this.user?.settings?.['filters.assetClasses']?.[0] ?? null, | 
					 | 
					 | 
					      holding: selectedHolding ?? null, | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        holding: selectedHolding ?? null, | 
					 | 
					 | 
					      tag: this.user?.settings?.['filters.tags']?.[0] ?? null | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        tag: this.user?.settings?.['filters.tags']?.[0] ?? null | 
					 | 
					 | 
					    }); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					      }, | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        emitEvent: false | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					      } | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					  } | 
					 | 
					 | 
					  } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					
  |