{"ast":null,"code":"import { MatTableDataSource } from '@angular/material/table';\nimport { MatPaginator } from '@angular/material/paginator';\nimport { DialogCadastroComponent } from '../shared/dialog-cadastro/dialog-cadastro.component';\nimport { environment } from '../environments/environment';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/common/http\";\nimport * as i2 from \"@angular/material/dialog\";\nimport * as i3 from \"@angular/common\";\nimport * as i4 from \"@angular/forms\";\nimport * as i5 from \"@angular/material/table\";\nimport * as i6 from \"@angular/material/icon\";\nimport * as i7 from \"@angular/material/card\";\nimport * as i8 from \"@angular/material/form-field\";\nimport * as i9 from \"@angular/material/select\";\nimport * as i10 from \"@angular/material/core\";\nimport * as i11 from \"@angular/material/input\";\nimport * as i12 from \"@angular/material/button\";\nconst _c0 = () => [\"usuario\", \"estacionamento\", \"perfil\", \"actions\"];\nconst _c1 = () => [\"name\", \"acoes\"];\nfunction CadastroComponent_mat_option_39_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 36);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const usuario_r2 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", usuario_r2.id);\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate2(\" \", usuario_r2.nome, \" (\", usuario_r2.email, \") \");\n  }\n}\nfunction CadastroComponent_mat_option_44_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 36);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const perfil_r3 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", perfil_r3.id);\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate1(\" \", perfil_r3.name, \" \");\n  }\n}\nfunction CadastroComponent_mat_option_49_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"mat-option\", 36);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const cliente_r4 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", cliente_r4.id);\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate1(\" \", cliente_r4.name, \" \");\n  }\n}\nfunction CadastroComponent_th_60_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Usu\\u00E1rio\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_61_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const row_r5 = ctx.$implicit;\n    const ctx_r5 = i0.ɵɵnextContext();\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(ctx_r5.getUsuarioNome(row_r5.userId));\n  }\n}\nfunction CadastroComponent_th_63_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Estacionamento\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_64_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const row_r7 = ctx.$implicit;\n    const ctx_r5 = i0.ɵɵnextContext();\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(ctx_r5.getEstacionamentoNome(row_r7.parkingId));\n  }\n}\nfunction CadastroComponent_th_66_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Perfil\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_67_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const row_r8 = ctx.$implicit;\n    const ctx_r5 = i0.ɵɵnextContext();\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(ctx_r5.getPerfilNome(row_r8.profileId));\n  }\n}\nfunction CadastroComponent_th_69_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"A\\u00E7\\u00F5es\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_70_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r9 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"td\", 38)(1, \"button\", 39);\n    i0.ɵɵlistener(\"click\", function CadastroComponent_td_70_Template_button_click_1_listener() {\n      const row_r10 = i0.ɵɵrestoreView(_r9).$implicit;\n      const ctx_r5 = i0.ɵɵnextContext();\n      return i0.ɵɵresetView(ctx_r5.removerVinculo(row_r10.id));\n    });\n    i0.ɵɵelementStart(2, \"mat-icon\");\n    i0.ɵɵtext(3, \"delete\");\n    i0.ɵɵelementEnd()()();\n  }\n}\nfunction CadastroComponent_tr_71_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"tr\", 40);\n  }\n}\nfunction CadastroComponent_tr_72_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"tr\", 41);\n  }\n}\nfunction CadastroComponent_th_84_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Nome\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_85_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const user_r11 = ctx.$implicit;\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(user_r11.nome);\n  }\n}\nfunction CadastroComponent_th_87_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Email\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_88_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const user_r12 = ctx.$implicit;\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(user_r12.email);\n  }\n}\nfunction CadastroComponent_th_90_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Cargo\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_91_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const user_r13 = ctx.$implicit;\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(user_r13.cargo);\n  }\n}\nfunction CadastroComponent_th_93_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Perfil\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_94_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const user_r14 = ctx.$implicit;\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate((user_r14.profile == null ? null : user_r14.profile.name) || \"\\u2014\");\n  }\n}\nfunction CadastroComponent_tr_95_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"tr\", 40);\n  }\n}\nfunction CadastroComponent_tr_96_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"tr\", 41);\n  }\n}\nfunction CadastroComponent_th_112_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"Nome\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_113_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"td\", 38);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const p_r15 = ctx.$implicit;\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(p_r15.name);\n  }\n}\nfunction CadastroComponent_th_115_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"th\", 37);\n    i0.ɵɵtext(1, \"A\\u00E7\\u00F5es\");\n    i0.ɵɵelementEnd();\n  }\n}\nfunction CadastroComponent_td_116_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r16 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"td\", 38)(1, \"button\", 42);\n    i0.ɵɵlistener(\"click\", function CadastroComponent_td_116_Template_button_click_1_listener() {\n      const p_r17 = i0.ɵɵrestoreView(_r16).$implicit;\n      const ctx_r5 = i0.ɵɵnextContext();\n      return i0.ɵɵresetView(ctx_r5.editarEstacionamento(p_r17));\n    });\n    i0.ɵɵelementStart(2, \"mat-icon\");\n    i0.ɵɵtext(3, \"edit\");\n    i0.ɵɵelementEnd()();\n    i0.ɵɵelementStart(4, \"button\", 39);\n    i0.ɵɵlistener(\"click\", function CadastroComponent_td_116_Template_button_click_4_listener() {\n      const p_r17 = i0.ɵɵrestoreView(_r16).$implicit;\n      const ctx_r5 = i0.ɵɵnextContext();\n      return i0.ɵɵresetView(ctx_r5.deletarEstacionamento(p_r17.id));\n    });\n    i0.ɵɵelementStart(5, \"mat-icon\");\n    i0.ɵɵtext(6, \"delete\");\n    i0.ɵɵelementEnd()()();\n  }\n}\nfunction CadastroComponent_tr_117_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"tr\", 40);\n  }\n}\nfunction CadastroComponent_tr_118_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelement(0, \"tr\", 41);\n  }\n}\nexport let CadastroComponent = /*#__PURE__*/(() => {\n  class CadastroComponent {\n    constructor(http, dialog) {\n      this.http = http;\n      this.dialog = dialog;\n      this.usuario = {\n        username: '',\n        email: '',\n        password: '',\n        nome: '',\n        cargo: ''\n      };\n      this.usuarios = [];\n      this.usuariosDataSource = new MatTableDataSource();\n      this.usuariosLista = [];\n      this.parkings = [];\n      this.clientes = [];\n      this.perfis = [];\n      this.userParkingProfiles = [];\n      this.parkingForm = {\n        id: null,\n        name: ''\n      };\n      this.usuarioSelecionadoId = 0;\n      this.perfilSelecionadoId = 0;\n      this.estacionamentoSelecionadoId = 0;\n      this.dataSource = new MatTableDataSource();\n      this.displayedColumns = ['nome', 'email', 'cargo', 'perfil'];\n    }\n    ngOnInit() {\n      this.carregarUsuarios();\n      this.carregarPerfis();\n      this.carregarEstacionamentos();\n      this.carregarVinculos();\n    }\n    aplicarFiltro(event) {\n      const valorFiltro = event.target.value;\n      this.usuariosDataSource.filter = valorFiltro.trim().toLowerCase();\n    }\n    carregarUsuarios() {\n      const url = `${environment.apiUrlBackEnd}/api/users`;\n      this.http.get(url).subscribe(data => {\n        this.usuarios = data;\n        this.usuariosDataSource.data = data;\n      });\n    }\n    carregarPerfis() {\n      const url = `${environment.apiUrlBackEnd}/api/user-profiles`;\n      this.http.get(url).subscribe(data => {\n        this.perfis = data;\n      });\n    }\n    carregarEstacionamentos() {\n      const url = `${environment.apiUrlBackEnd}/api/parkings`;\n      this.http.get(url).subscribe(data => {\n        this.clientes = data;\n      });\n    }\n    carregarVinculos() {\n      const url = `${environment.apiUrlBackEnd}/api/user-parking-profiles`;\n      this.http.get(url).subscribe(data => {\n        this.userParkingProfiles = data;\n        this.dataSource = new MatTableDataSource(this.userParkingProfiles);\n        this.dataSource.paginator = this.paginator;\n      });\n    }\n    cadastrar() {\n      const url = `${environment.apiUrlBackEnd}/api/auth/register`;\n      this.http.post(url, this.usuario, {\n        responseType: 'text'\n      }).subscribe({\n        next: res => {\n          this.abrirPopup(res.includes('sucesso') ? 'Registro bem-sucedido' : res);\n          this.listarUsuarios();\n        },\n        error: err => {\n          const msg = err.status === 409 ? 'Usuário já existe' : 'Erro no cadastro';\n          this.abrirPopup(msg);\n        }\n      });\n    }\n    abrirPopup(mensagem) {\n      this.dialog.open(DialogCadastroComponent, {\n        data: {\n          mensagem\n        }\n      });\n    }\n    atribuirPerfil() {\n      const payload = {\n        userId: this.usuarioSelecionadoId,\n        profileId: this.perfilSelecionadoId,\n        parkingId: this.estacionamentoSelecionadoId\n      };\n      const url = `${environment.apiUrlBackEnd}/api/user-parking-profiles`;\n      this.http.post(url, payload).subscribe(() => {\n        alert('Perfil atribuído com sucesso');\n        this.carregarVinculos();\n      });\n    }\n    listarUsuarios() {\n      const url = `${environment.apiUrlBackEnd}/api/users`;\n      this.http.get(url).subscribe({\n        next: res => {\n          this.usuarios = res;\n          this.usuariosDataSource.data = res;\n          this.usuariosLista = res; // para uso no mat-select\n        },\n        error: err => console.error('Erro ao buscar usuários:', err)\n      });\n    }\n    salvarEstacionamento() {\n      const method = this.parkingForm.id ? 'put' : 'post';\n      const url = this.parkingForm.id ? `${environment.apiUrlBackEnd}/api/parkings/${this.parkingForm.id}` : `${environment.apiUrlBackEnd}/api/parkings`;\n      this.http[method](url, this.parkingForm).subscribe(() => {\n        this.carregarEstacionamentos();\n        this.limparFormulario();\n      });\n    }\n    editarEstacionamento(p) {\n      this.parkingForm = {\n        ...p\n      };\n    }\n    deletarEstacionamento(id) {\n      if (confirm('Tem certeza que deseja excluir?')) {\n        const url = `${environment.apiUrlBackEnd}/api/parkings/${id}`;\n        this.http.delete(url).subscribe(() => {\n          this.carregarEstacionamentos();\n        });\n      }\n    }\n    limparFormulario() {\n      this.parkingForm = {\n        id: null,\n        name: ''\n      };\n    }\n    removerVinculo(id) {\n      const url = `${environment.apiUrlBackEnd}/api/user-parking-profiles/${id}`;\n      this.http.delete(url).subscribe(() => {\n        this.carregarVinculos();\n      });\n    }\n    // 🔍 Métodos auxiliares para nome\n    getUsuarioNome(id) {\n      const user = this.usuarios.find(u => u.id === id);\n      return user ? user.nome : '—';\n    }\n    getEstacionamentoNome(id) {\n      const est = this.clientes.find(p => p.id === id);\n      return est ? est.name : '—';\n    }\n    getPerfilNome(id) {\n      const perfil = this.perfis.find(p => p.id === id);\n      return perfil ? perfil.name : '—';\n    }\n    static #_ = this.ɵfac = function CadastroComponent_Factory(t) {\n      return new (t || CadastroComponent)(i0.ɵɵdirectiveInject(i1.HttpClient), i0.ɵɵdirectiveInject(i2.MatDialog));\n    };\n    static #_2 = this.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n      type: CadastroComponent,\n      selectors: [[\"app-cadastro\"]],\n      viewQuery: function CadastroComponent_Query(rf, ctx) {\n        if (rf & 1) {\n          i0.ɵɵviewQuery(MatPaginator, 5);\n        }\n        if (rf & 2) {\n          let _t;\n          i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.paginator = _t.first);\n        }\n      },\n      decls: 119,\n      vars: 26,\n      consts: [[\"cadastroForm\", \"ngForm\"], [1, \"cadastro-container\"], [\"color\", \"primary\"], [3, \"ngSubmit\"], [\"appearance\", \"outline\", 1, \"full-width\"], [\"matInput\", \"\", \"name\", \"username\", \"required\", \"\", 3, \"ngModelChange\", \"ngModel\"], [\"matInput\", \"\", \"name\", \"email\", \"required\", \"\", \"type\", \"email\", 3, \"ngModelChange\", \"ngModel\"], [\"matInput\", \"\", \"name\", \"password\", \"required\", \"\", \"type\", \"password\", 3, \"ngModelChange\", \"ngModel\"], [\"matInput\", \"\", \"name\", \"nome\", \"required\", \"\", 3, \"ngModelChange\", \"ngModel\"], [\"matInput\", \"\", \"name\", \"cargo\", \"required\", \"\", 3, \"ngModelChange\", \"ngModel\"], [\"mat-raised-button\", \"\", \"color\", \"primary\", \"type\", \"submit\"], [\"color\", \"accent\"], [1, \"full-width\"], [3, \"valueChange\", \"value\"], [3, \"value\", 4, \"ngFor\", \"ngForOf\"], [\"mat-raised-button\", \"\", \"color\", \"accent\", 3, \"click\"], [\"mat-table\", \"\", 1, \"mat-elevation-z8\", \"full-width\", 3, \"dataSource\"], [\"matColumnDef\", \"usuario\"], [\"mat-header-cell\", \"\", 4, \"matHeaderCellDef\"], [\"mat-cell\", \"\", 4, \"matCellDef\"], [\"matColumnDef\", \"estacionamento\"], [\"matColumnDef\", \"perfil\"], [\"matColumnDef\", \"actions\"], [\"mat-header-row\", \"\", 4, \"matHeaderRowDef\"], [\"mat-row\", \"\", 4, \"matRowDef\", \"matRowDefColumns\"], [\"appearance\", \"fill\", 1, \"full-width\"], [\"matInput\", \"\", \"placeholder\", \"Digite para filtrar\", 3, \"keyup\"], [\"matColumnDef\", \"nome\"], [\"matColumnDef\", \"email\"], [\"matColumnDef\", \"cargo\"], [1, \"cadastro-card\"], [\"matInput\", \"\", \"name\", \"name\", \"required\", \"\", 3, \"ngModelChange\", \"ngModel\"], [1, \"btn-container\"], [\"mat-stroked-button\", \"\", \"type\", \"button\", 3, \"click\"], [\"matColumnDef\", \"name\"], [\"matColumnDef\", \"acoes\"], [3, \"value\"], [\"mat-header-cell\", \"\"], [\"mat-cell\", \"\"], [\"mat-icon-button\", \"\", \"color\", \"warn\", 3, \"click\"], [\"mat-header-row\", \"\"], [\"mat-row\", \"\"], [\"mat-icon-button\", \"\", \"color\", \"primary\", 3, \"click\"]],\n      template: function CadastroComponent_Template(rf, ctx) {\n        if (rf & 1) {\n          const _r1 = i0.ɵɵgetCurrentView();\n          i0.ɵɵelementStart(0, \"mat-card\", 1)(1, \"h2\")(2, \"mat-icon\", 2);\n          i0.ɵɵtext(3, \"person_add\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtext(4, \" Cadastro de Usu\\u00E1rio\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(5, \"form\", 3, 0);\n          i0.ɵɵlistener(\"ngSubmit\", function CadastroComponent_Template_form_ngSubmit_5_listener() {\n            i0.ɵɵrestoreView(_r1);\n            return i0.ɵɵresetView(ctx.cadastrar());\n          });\n          i0.ɵɵelementStart(7, \"mat-form-field\", 4)(8, \"mat-label\");\n          i0.ɵɵtext(9, \"Username\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(10, \"input\", 5);\n          i0.ɵɵtwoWayListener(\"ngModelChange\", function CadastroComponent_Template_input_ngModelChange_10_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.usuario.username, $event) || (ctx.usuario.username = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(11, \"mat-form-field\", 4)(12, \"mat-label\");\n          i0.ɵɵtext(13, \"Email\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(14, \"input\", 6);\n          i0.ɵɵtwoWayListener(\"ngModelChange\", function CadastroComponent_Template_input_ngModelChange_14_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.usuario.email, $event) || (ctx.usuario.email = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(15, \"mat-form-field\", 4)(16, \"mat-label\");\n          i0.ɵɵtext(17, \"Senha\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(18, \"input\", 7);\n          i0.ɵɵtwoWayListener(\"ngModelChange\", function CadastroComponent_Template_input_ngModelChange_18_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.usuario.password, $event) || (ctx.usuario.password = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(19, \"mat-form-field\", 4)(20, \"mat-label\");\n          i0.ɵɵtext(21, \"Nome\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(22, \"input\", 8);\n          i0.ɵɵtwoWayListener(\"ngModelChange\", function CadastroComponent_Template_input_ngModelChange_22_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.usuario.nome, $event) || (ctx.usuario.nome = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(23, \"mat-form-field\", 4)(24, \"mat-label\");\n          i0.ɵɵtext(25, \"Cargo\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(26, \"input\", 9);\n          i0.ɵɵtwoWayListener(\"ngModelChange\", function CadastroComponent_Template_input_ngModelChange_26_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.usuario.cargo, $event) || (ctx.usuario.cargo = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(27, \"button\", 10);\n          i0.ɵɵtext(28, \"Cadastrar\");\n          i0.ɵɵelementEnd()()();\n          i0.ɵɵelement(29, \"br\");\n          i0.ɵɵelementStart(30, \"mat-card\", 1)(31, \"h2\")(32, \"mat-icon\", 11);\n          i0.ɵɵtext(33, \"group_add\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtext(34, \" Atribuir Perfil a Usu\\u00E1rio\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(35, \"mat-form-field\", 12)(36, \"mat-label\");\n          i0.ɵɵtext(37, \"Usu\\u00E1rio\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(38, \"mat-select\", 13);\n          i0.ɵɵtwoWayListener(\"valueChange\", function CadastroComponent_Template_mat_select_valueChange_38_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.usuarioSelecionadoId, $event) || (ctx.usuarioSelecionadoId = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵtemplate(39, CadastroComponent_mat_option_39_Template, 2, 3, \"mat-option\", 14);\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(40, \"mat-form-field\", 12)(41, \"mat-label\");\n          i0.ɵɵtext(42, \"Perfil\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(43, \"mat-select\", 13);\n          i0.ɵɵtwoWayListener(\"valueChange\", function CadastroComponent_Template_mat_select_valueChange_43_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.perfilSelecionadoId, $event) || (ctx.perfilSelecionadoId = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵtemplate(44, CadastroComponent_mat_option_44_Template, 2, 2, \"mat-option\", 14);\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(45, \"mat-form-field\", 12)(46, \"mat-label\");\n          i0.ɵɵtext(47, \"Estacionamento\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(48, \"mat-select\", 13);\n          i0.ɵɵtwoWayListener(\"valueChange\", function CadastroComponent_Template_mat_select_valueChange_48_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.estacionamentoSelecionadoId, $event) || (ctx.estacionamentoSelecionadoId = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵtemplate(49, CadastroComponent_mat_option_49_Template, 2, 2, \"mat-option\", 14);\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(50, \"button\", 15);\n          i0.ɵɵlistener(\"click\", function CadastroComponent_Template_button_click_50_listener() {\n            i0.ɵɵrestoreView(_r1);\n            return i0.ɵɵresetView(ctx.atribuirPerfil());\n          });\n          i0.ɵɵtext(51, \"Atribuir Perfil\");\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelement(52, \"br\");\n          i0.ɵɵelementStart(53, \"mat-card\", 1)(54, \"h3\")(55, \"mat-icon\");\n          i0.ɵɵtext(56, \"link\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtext(57, \" V\\u00EDnculos de Perfil por Usu\\u00E1rio/Estacionamento\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(58, \"table\", 16);\n          i0.ɵɵelementContainerStart(59, 17);\n          i0.ɵɵtemplate(60, CadastroComponent_th_60_Template, 2, 0, \"th\", 18)(61, CadastroComponent_td_61_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(62, 20);\n          i0.ɵɵtemplate(63, CadastroComponent_th_63_Template, 2, 0, \"th\", 18)(64, CadastroComponent_td_64_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(65, 21);\n          i0.ɵɵtemplate(66, CadastroComponent_th_66_Template, 2, 0, \"th\", 18)(67, CadastroComponent_td_67_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(68, 22);\n          i0.ɵɵtemplate(69, CadastroComponent_th_69_Template, 2, 0, \"th\", 18)(70, CadastroComponent_td_70_Template, 4, 0, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵtemplate(71, CadastroComponent_tr_71_Template, 1, 0, \"tr\", 23)(72, CadastroComponent_tr_72_Template, 1, 0, \"tr\", 24);\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(73, \"mat-card\", 1)(74, \"h2\")(75, \"mat-icon\");\n          i0.ɵɵtext(76, \"list\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtext(77, \" Lista de Usu\\u00E1rios\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(78, \"mat-form-field\", 25)(79, \"mat-label\");\n          i0.ɵɵtext(80, \"Filtrar usu\\u00E1rios\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(81, \"input\", 26);\n          i0.ɵɵlistener(\"keyup\", function CadastroComponent_Template_input_keyup_81_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            return i0.ɵɵresetView(ctx.aplicarFiltro($event));\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(82, \"table\", 16);\n          i0.ɵɵelementContainerStart(83, 27);\n          i0.ɵɵtemplate(84, CadastroComponent_th_84_Template, 2, 0, \"th\", 18)(85, CadastroComponent_td_85_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(86, 28);\n          i0.ɵɵtemplate(87, CadastroComponent_th_87_Template, 2, 0, \"th\", 18)(88, CadastroComponent_td_88_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(89, 29);\n          i0.ɵɵtemplate(90, CadastroComponent_th_90_Template, 2, 0, \"th\", 18)(91, CadastroComponent_td_91_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(92, 21);\n          i0.ɵɵtemplate(93, CadastroComponent_th_93_Template, 2, 0, \"th\", 18)(94, CadastroComponent_td_94_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵtemplate(95, CadastroComponent_tr_95_Template, 1, 0, \"tr\", 23)(96, CadastroComponent_tr_96_Template, 1, 0, \"tr\", 24);\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(97, \"mat-card\", 30)(98, \"h2\");\n          i0.ɵɵtext(99, \"Cadastro de Estacionamento\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(100, \"form\", 3);\n          i0.ɵɵlistener(\"ngSubmit\", function CadastroComponent_Template_form_ngSubmit_100_listener() {\n            i0.ɵɵrestoreView(_r1);\n            return i0.ɵɵresetView(ctx.salvarEstacionamento());\n          });\n          i0.ɵɵelementStart(101, \"mat-form-field\", 4)(102, \"mat-label\");\n          i0.ɵɵtext(103, \"Nome\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(104, \"input\", 31);\n          i0.ɵɵtwoWayListener(\"ngModelChange\", function CadastroComponent_Template_input_ngModelChange_104_listener($event) {\n            i0.ɵɵrestoreView(_r1);\n            i0.ɵɵtwoWayBindingSet(ctx.parkingForm.name, $event) || (ctx.parkingForm.name = $event);\n            return i0.ɵɵresetView($event);\n          });\n          i0.ɵɵelementEnd()();\n          i0.ɵɵelementStart(105, \"div\", 32)(106, \"button\", 10);\n          i0.ɵɵtext(107);\n          i0.ɵɵelementEnd();\n          i0.ɵɵelementStart(108, \"button\", 33);\n          i0.ɵɵlistener(\"click\", function CadastroComponent_Template_button_click_108_listener() {\n            i0.ɵɵrestoreView(_r1);\n            return i0.ɵɵresetView(ctx.limparFormulario());\n          });\n          i0.ɵɵtext(109, \"Limpar\");\n          i0.ɵɵelementEnd()()();\n          i0.ɵɵelementStart(110, \"table\", 16);\n          i0.ɵɵelementContainerStart(111, 34);\n          i0.ɵɵtemplate(112, CadastroComponent_th_112_Template, 2, 0, \"th\", 18)(113, CadastroComponent_td_113_Template, 2, 1, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵelementContainerStart(114, 35);\n          i0.ɵɵtemplate(115, CadastroComponent_th_115_Template, 2, 0, \"th\", 18)(116, CadastroComponent_td_116_Template, 7, 0, \"td\", 19);\n          i0.ɵɵelementContainerEnd();\n          i0.ɵɵtemplate(117, CadastroComponent_tr_117_Template, 1, 0, \"tr\", 23)(118, CadastroComponent_tr_118_Template, 1, 0, \"tr\", 24);\n          i0.ɵɵelementEnd()();\n        }\n        if (rf & 2) {\n          i0.ɵɵadvance(10);\n          i0.ɵɵtwoWayProperty(\"ngModel\", ctx.usuario.username);\n          i0.ɵɵadvance(4);\n          i0.ɵɵtwoWayProperty(\"ngModel\", ctx.usuario.email);\n          i0.ɵɵadvance(4);\n          i0.ɵɵtwoWayProperty(\"ngModel\", ctx.usuario.password);\n          i0.ɵɵadvance(4);\n          i0.ɵɵtwoWayProperty(\"ngModel\", ctx.usuario.nome);\n          i0.ɵɵadvance(4);\n          i0.ɵɵtwoWayProperty(\"ngModel\", ctx.usuario.cargo);\n          i0.ɵɵadvance(12);\n          i0.ɵɵtwoWayProperty(\"value\", ctx.usuarioSelecionadoId);\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"ngForOf\", ctx.usuarios);\n          i0.ɵɵadvance(4);\n          i0.ɵɵtwoWayProperty(\"value\", ctx.perfilSelecionadoId);\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"ngForOf\", ctx.perfis);\n          i0.ɵɵadvance(4);\n          i0.ɵɵtwoWayProperty(\"value\", ctx.estacionamentoSelecionadoId);\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"ngForOf\", ctx.clientes);\n          i0.ɵɵadvance(9);\n          i0.ɵɵproperty(\"dataSource\", ctx.dataSource);\n          i0.ɵɵadvance(13);\n          i0.ɵɵproperty(\"matHeaderRowDef\", i0.ɵɵpureFunction0(22, _c0));\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"matRowDefColumns\", i0.ɵɵpureFunction0(23, _c0));\n          i0.ɵɵadvance(10);\n          i0.ɵɵproperty(\"dataSource\", ctx.usuarios);\n          i0.ɵɵadvance(13);\n          i0.ɵɵproperty(\"matHeaderRowDef\", ctx.displayedColumns);\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"matRowDefColumns\", ctx.displayedColumns);\n          i0.ɵɵadvance(8);\n          i0.ɵɵtwoWayProperty(\"ngModel\", ctx.parkingForm.name);\n          i0.ɵɵadvance(3);\n          i0.ɵɵtextInterpolate1(\" \", ctx.parkingForm.id ? \"Atualizar\" : \"Cadastrar\", \" \");\n          i0.ɵɵadvance(3);\n          i0.ɵɵproperty(\"dataSource\", ctx.parkings);\n          i0.ɵɵadvance(7);\n          i0.ɵɵproperty(\"matHeaderRowDef\", i0.ɵɵpureFunction0(24, _c1));\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"matRowDefColumns\", i0.ɵɵpureFunction0(25, _c1));\n        }\n      },\n      dependencies: [i3.NgForOf, i4.ɵNgNoValidate, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.RequiredValidator, i4.NgModel, i4.NgForm, i5.MatTable, i5.MatHeaderCellDef, i5.MatHeaderRowDef, i5.MatColumnDef, i5.MatCellDef, i5.MatRowDef, i5.MatHeaderCell, i5.MatCell, i5.MatHeaderRow, i5.MatRow, i6.MatIcon, i7.MatCard, i8.MatFormField, i8.MatLabel, i9.MatSelect, i10.MatOption, i11.MatInput, i12.MatButton, i12.MatIconButton],\n      encapsulation: 2\n    });\n  }\n  return CadastroComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}