a7ec47ca205eb7a4d0c9b61b60d9958a44f1bd557ca22367407d671c8c5f57f3.json raw
1 {"ast":null,"code":"import { inject } from '@angular/core';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport { IconButtonComponent, StorageService } from '@common';\nimport * as i0 from \"@angular/core\";\nexport let EditIdentityComponent = /*#__PURE__*/(() => {\n class EditIdentityComponent {\n identity;\n previousRoute;\n #activatedRoute = inject(ActivatedRoute);\n #storage = inject(StorageService);\n #router = inject(Router);\n constructor() {\n // Must be called in the constructor and NOT in ngOnInit.\n this.previousRoute = this.#router.getCurrentNavigation()?.previousNavigation?.extractedUrl.toString();\n }\n ngOnInit() {\n const selectedIdentityId = this.#activatedRoute.snapshot.params['id'];\n if (!selectedIdentityId) {\n return;\n }\n this.identity = this.#storage.getBrowserSessionHandler().browserSessionData?.identities.find(x => x.id === selectedIdentityId);\n }\n onClickCancel() {\n if (!this.previousRoute) {\n return;\n }\n this.#router.navigateByUrl(this.previousRoute);\n }\n static ɵfac = function EditIdentityComponent_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || EditIdentityComponent)();\n };\n static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: EditIdentityComponent,\n selectors: [[\"app-edit-identity\"]],\n decls: 6,\n vars: 1,\n consts: [[1, \"custom-header\"], [\"icon\", \"chevron-left\", 1, \"button\", 3, \"click\"], [1, \"text\"], [1, \"edit-identity-outlet\"]],\n template: function EditIdentityComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 0)(1, \"lib-icon-button\", 1);\n i0.ɵɵlistener(\"click\", function EditIdentityComponent_Template_lib_icon_button_click_1_listener() {\n return ctx.onClickCancel();\n });\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(2, \"span\", 2);\n i0.ɵɵtext(3);\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(4, \"div\", 3);\n i0.ɵɵelement(5, \"router-outlet\");\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n i0.ɵɵadvance(3);\n i0.ɵɵtextInterpolate1(\"\", ctx.identity == null ? null : ctx.identity.nick, \" \");\n }\n },\n dependencies: [RouterOutlet, IconButtonComponent],\n styles: [\"[_nghost-%COMP%] {\\n height: 100%;\\n display: flex;\\n flex-direction: column;\\n overflow-y: hidden;\\n overflow-x: hidden;\\n}\\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] {\\n padding-top: var(--size);\\n padding-bottom: var(--size);\\n display: grid;\\n grid-template-columns: 1fr;\\n grid-template-rows: auto;\\n align-items: center;\\n background: var(--background);\\n}\\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .button[_ngcontent-%COMP%] {\\n grid-column-start: 1;\\n grid-column-end: 2;\\n grid-row-start: 1;\\n grid-row-end: 2;\\n justify-self: start;\\n margin-left: 16px;\\n z-index: 1;\\n}\\n[_nghost-%COMP%] .custom-header[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] {\\n grid-column-start: 1;\\n grid-column-end: 2;\\n grid-row-start: 1;\\n grid-row-end: 2;\\n font-size: 20px;\\n font-weight: 500;\\n justify-self: center;\\n height: 32px;\\n overflow-x: hidden;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n max-width: 70%;\\n}\\n[_nghost-%COMP%] .edit-identity-outlet[_ngcontent-%COMP%] {\\n flex-grow: 1;\\n overflow-y: hidden;\\n}\"]\n });\n }\n return EditIdentityComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}