{ "version": 3, "sources": ["src/app/shared/dialogs/dialog-location-default/dialog-location-default.component.ts", "src/app/shared/dialogs/dialog-location-default/dialog-location-default.component.html"], "sourcesContent": ["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n OnInit,\n} from '@angular/core';\nimport { FormControl } from '@angular/forms';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { UserService } from '@lis-services';\nimport { LisDialogLocationDefaultOutput } from '@lis-types';\nimport { first } from 'lodash-es';\nimport { LisFormFieldSelect } from '../../form/types/form.type';\n\n@Component({\n templateUrl: './dialog-location-default.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DialogLocationDefaultComponent implements OnInit {\n public locationControl = new FormControl('', []);\n public locationField?: LisFormFieldSelect;\n\n constructor(\n private userService: UserService,\n private dialogRef: MatDialogRef<\n DialogLocationDefaultComponent,\n LisDialogLocationDefaultOutput\n >,\n private cdRef: ChangeDetectorRef\n ) {}\n\n ngOnInit(): void {\n this.init();\n }\n\n public onCtaClick(): void {\n this.dialogRef.close({\n locationId: this.locationControl.value,\n });\n }\n\n private async init(): Promise {\n this.userService.locations$.subscribe((locations) => {\n const firstLocation = first(locations);\n if (firstLocation) {\n this.locationControl.setValue(firstLocation.locationId);\n }\n if (locations) {\n this.locationField = {\n label: 'dialog.location-default.form-field-label',\n type: 'select',\n options: locations.map((location) => ({\n key: location.locationId,\n label: location.city + ', ' + location.country,\n })),\n };\n this.cdRef.detectChanges();\n }\n });\n }\n}\n", "\n {{ 'dialog.location-default.headline' | translate }}\n\n
\n \n\n \n {{ 'dialog.location-default.info' | translate }}\n \n
\n\n \n
\n \n
\n
\n
\n"], "mappings": "+ZCIIA,EAAA,EAAA,iBAAA,CAAA,iBAAsCC,EAAA,UAAAC,EAAAC,eAAA,EAA2B,QAAAD,EAAAE,aAAA,GDarE,IAAaC,GAA8B,IAAA,CAArC,MAAOA,CAA8B,CAIzCC,YACUC,EACAC,EAIAC,EAAwB,CALxB,KAAAF,Y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,mBAAA,CAAA,EACEE,EAAA,CAAA,mBACFG,EAAA,EAAmB,EAGrBJ,EAAA,EAAA,CAAA,EACED,EAAA,GAAA,MAAA,CAAA,EAA2C,GAAA,SAAA,CAAA,EACSM,EAAA,QAAA,UAAA,CAAA,OAASP,EAAA9B,WAAA,CAAY,CAAA,EAAEiC,EAAA,EAAA,oBAA+CG,EAAA,EAAS,MAGvIA,EAAA,SAf4BE,EAAA,CAAA,EAAAC,EAAAC,EAAA,EAAA,EAAA,kCAAA,CAAA,EAGPF,EAAA,CAAA,EAAAlD,EAAA,OAAA0C,EAAAvC,aAAA,EAEC+C,EAAA,EAAAlD,EAAA,OAAA,MAAA,EAChBkD,EAAA,EAAAG,EAAA,IAAAD,EAAA,EAAA,EAAA,8BAAA,EAAA,GAAA,EAMiCF,EAAA,CAAA,EAAAlD,EAAA,UAAA,EAAA,EAAwCkD,EAAA,EAAAC,EAAAC,EAAA,GAAA,GAAA,6BAAA,CAAA,2EDIlEhD,CAA8B,GAAA", "names": ["\u0275\u0275element", "\u0275\u0275property", "ctx_r0", "locationControl", "locationField", "DialogLocationDefaultComponent", "constructor", "userService", "dialogRef", "cdRef", "FormControl", "ngOnInit", "init", "onCtaClick", "close", "locationId", "value", "__async", "locations$", "subscribe", "locations", "firstLocation", "first", "setValue", "label", "type", "options", "map", "location", "key", "city", "country", "detectChanges", "\u0275\u0275directiveInject", "UserService", "MatDialogRef", "ChangeDetectorRef", "selectors", "decls", "vars", "consts", "template", "rf", "ctx", "\u0275\u0275elementStart", "\u0275\u0275elementContainerStart", "\u0275\u0275text", "\u0275\u0275template", "DialogLocationDefaultComponent_lis_form_field_5_Template", "\u0275\u0275elementEnd", "\u0275\u0275listener", "\u0275\u0275advance", "\u0275\u0275textInterpolate", "\u0275\u0275pipeBind1", "\u0275\u0275textInterpolate1"] }