{"ast":null,"code":"import _asyncToGenerator from \"/root/rfcontavagas/12.-Servidor-local-Docker/Front-Parking-Angular/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport * as XLSX from 'xlsx';\nimport { saveAs } from 'file-saver';\nimport jsPDF from 'jspdf';\nimport autoTable from 'jspdf-autotable';\nimport { environment } from '../environments/environment';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"@angular/common/http\";\nimport * as i2 from \"../services/user.service\";\nimport * as i3 from \"../services/client.service\";\nimport * as i4 from \"@angular/common\";\nimport * as i5 from \"@angular/forms\";\nfunction RelatorioComponent_div_3_option_7_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"option\", 11);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const relatorio_r3 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", relatorio_r3.tipo);\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate1(\" \", relatorio_r3.label, \" \");\n  }\n}\nfunction RelatorioComponent_div_3_div_10_option_6_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"option\", 11);\n    i0.ɵɵtext(1);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const piso_r5 = ctx.$implicit;\n    i0.ɵɵproperty(\"value\", piso_r5);\n    i0.ɵɵadvance();\n    i0.ɵɵtextInterpolate(piso_r5);\n  }\n}\nfunction RelatorioComponent_div_3_div_10_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r4 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"div\", 12)(1, \"label\");\n    i0.ɵɵtext(2, \"Filtrar Piso: \");\n    i0.ɵɵelementStart(3, \"select\", 5);\n    i0.ɵɵtwoWayListener(\"ngModelChange\", function RelatorioComponent_div_3_div_10_Template_select_ngModelChange_3_listener($event) {\n      i0.ɵɵrestoreView(_r4);\n      const ctx_r1 = i0.ɵɵnextContext(2);\n      i0.ɵɵtwoWayBindingSet(ctx_r1.pisoFiltrado, $event) || (ctx_r1.pisoFiltrado = $event);\n      return i0.ɵɵresetView($event);\n    });\n    i0.ɵɵelementStart(4, \"option\", 13);\n    i0.ɵɵtext(5, \"Todos\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵtemplate(6, RelatorioComponent_div_3_div_10_option_6_Template, 2, 2, \"option\", 6);\n    i0.ɵɵelementEnd()()();\n  }\n  if (rf & 2) {\n    const ctx_r1 = i0.ɵɵnextContext(2);\n    i0.ɵɵadvance(3);\n    i0.ɵɵtwoWayProperty(\"ngModel\", ctx_r1.pisoFiltrado);\n    i0.ɵɵadvance(3);\n    i0.ɵɵproperty(\"ngForOf\", ctx_r1.todosOsPisos);\n  }\n}\nfunction RelatorioComponent_div_3_div_11_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r6 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"div\", 14)(1, \"button\", 15);\n    i0.ɵɵlistener(\"click\", function RelatorioComponent_div_3_div_11_Template_button_click_1_listener() {\n      i0.ɵɵrestoreView(_r6);\n      const ctx_r1 = i0.ɵɵnextContext(2);\n      return i0.ɵɵresetView(ctx_r1.exportarExcel());\n    });\n    i0.ɵɵtext(2, \"\\uD83D\\uDCE5 Exportar Excel\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(3, \"button\", 16);\n    i0.ɵɵlistener(\"click\", function RelatorioComponent_div_3_div_11_Template_button_click_3_listener() {\n      i0.ɵɵrestoreView(_r6);\n      const ctx_r1 = i0.ɵɵnextContext(2);\n      return i0.ɵɵresetView(ctx_r1.exportarPDF());\n    });\n    i0.ɵɵtext(4, \"\\uD83E\\uDDFE Exportar PDF\");\n    i0.ɵɵelementEnd()();\n  }\n}\nfunction RelatorioComponent_div_3_table_12_tr_12_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"tr\")(1, \"td\");\n    i0.ɵɵtext(2);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(3, \"td\");\n    i0.ɵɵtext(4);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(5, \"td\");\n    i0.ɵɵtext(6);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(7, \"td\");\n    i0.ɵɵtext(8);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const item_r7 = ctx.$implicit;\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r7.data);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r7.piso);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r7.hora);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r7.vagas);\n  }\n}\nfunction RelatorioComponent_div_3_table_12_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"table\", 17)(1, \"thead\")(2, \"tr\")(3, \"th\");\n    i0.ɵɵtext(4, \"Data\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(5, \"th\");\n    i0.ɵɵtext(6, \"Piso\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(7, \"th\");\n    i0.ɵɵtext(8, \"Hora\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(9, \"th\");\n    i0.ɵɵtext(10, \"Vagas\");\n    i0.ɵɵelementEnd()()();\n    i0.ɵɵelementStart(11, \"tbody\");\n    i0.ɵɵtemplate(12, RelatorioComponent_div_3_table_12_tr_12_Template, 9, 4, \"tr\", 18);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const ctx_r1 = i0.ɵɵnextContext(2);\n    i0.ɵɵadvance(12);\n    i0.ɵɵproperty(\"ngForOf\", ctx_r1.relatorioFiltradoPorPiso);\n  }\n}\nfunction RelatorioComponent_div_3_table_13_tr_10_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"tr\")(1, \"td\");\n    i0.ɵɵtext(2);\n    i0.ɵɵpipe(3, \"date\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(4, \"td\");\n    i0.ɵɵtext(5);\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(6, \"td\");\n    i0.ɵɵtext(7);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const item_r8 = ctx.$implicit;\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(3, 3, item_r8.data, \"dd/MM/yyyy\"));\n    i0.ɵɵadvance(3);\n    i0.ɵɵtextInterpolate(item_r8.hora);\n    i0.ɵɵadvance(2);\n    i0.ɵɵtextInterpolate(item_r8.total);\n  }\n}\nfunction RelatorioComponent_div_3_table_13_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"table\", 17)(1, \"thead\")(2, \"tr\")(3, \"th\");\n    i0.ɵɵtext(4, \"Data\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(5, \"th\");\n    i0.ɵɵtext(6, \"Hora\");\n    i0.ɵɵelementEnd();\n    i0.ɵɵelementStart(7, \"th\");\n    i0.ɵɵtext(8, \"Total de Vagas\");\n    i0.ɵɵelementEnd()()();\n    i0.ɵɵelementStart(9, \"tbody\");\n    i0.ɵɵtemplate(10, RelatorioComponent_div_3_table_13_tr_10_Template, 8, 6, \"tr\", 18);\n    i0.ɵɵelementEnd()();\n  }\n  if (rf & 2) {\n    const ctx_r1 = i0.ɵɵnextContext(2);\n    i0.ɵɵadvance(10);\n    i0.ɵɵproperty(\"ngForOf\", ctx_r1.relatorioConsolidado);\n  }\n}\nfunction RelatorioComponent_div_3_Template(rf, ctx) {\n  if (rf & 1) {\n    const _r1 = i0.ɵɵgetCurrentView();\n    i0.ɵɵelementStart(0, \"div\", 3)(1, \"label\");\n    i0.ɵɵtext(2, \"Data Inicial: \");\n    i0.ɵɵelementStart(3, \"input\", 4);\n    i0.ɵɵtwoWayListener(\"ngModelChange\", function RelatorioComponent_div_3_Template_input_ngModelChange_3_listener($event) {\n      i0.ɵɵrestoreView(_r1);\n      const ctx_r1 = i0.ɵɵnextContext();\n      i0.ɵɵtwoWayBindingSet(ctx_r1.dataInicial, $event) || (ctx_r1.dataInicial = $event);\n      return i0.ɵɵresetView($event);\n    });\n    i0.ɵɵelementEnd()();\n    i0.ɵɵelementStart(4, \"label\");\n    i0.ɵɵtext(5, \"Tipo de Relat\\u00F3rio: \");\n    i0.ɵɵelementStart(6, \"select\", 5);\n    i0.ɵɵtwoWayListener(\"ngModelChange\", function RelatorioComponent_div_3_Template_select_ngModelChange_6_listener($event) {\n      i0.ɵɵrestoreView(_r1);\n      const ctx_r1 = i0.ɵɵnextContext();\n      i0.ɵɵtwoWayBindingSet(ctx_r1.tipoRelatorio, $event) || (ctx_r1.tipoRelatorio = $event);\n      return i0.ɵɵresetView($event);\n    });\n    i0.ɵɵtemplate(7, RelatorioComponent_div_3_option_7_Template, 2, 2, \"option\", 6);\n    i0.ɵɵelementEnd()();\n    i0.ɵɵelementStart(8, \"button\", 7);\n    i0.ɵɵlistener(\"click\", function RelatorioComponent_div_3_Template_button_click_8_listener() {\n      i0.ɵɵrestoreView(_r1);\n      const ctx_r1 = i0.ɵɵnextContext();\n      return i0.ɵɵresetView(ctx_r1.consultar());\n    });\n    i0.ɵɵtext(9, \" Consultar \");\n    i0.ɵɵelementEnd();\n    i0.ɵɵtemplate(10, RelatorioComponent_div_3_div_10_Template, 7, 2, \"div\", 8)(11, RelatorioComponent_div_3_div_11_Template, 5, 0, \"div\", 9)(12, RelatorioComponent_div_3_table_12_Template, 13, 1, \"table\", 10)(13, RelatorioComponent_div_3_table_13_Template, 11, 1, \"table\", 10);\n    i0.ɵɵelementEnd();\n  }\n  if (rf & 2) {\n    const ctx_r1 = i0.ɵɵnextContext();\n    i0.ɵɵadvance(3);\n    i0.ɵɵtwoWayProperty(\"ngModel\", ctx_r1.dataInicial);\n    i0.ɵɵadvance(3);\n    i0.ɵɵtwoWayProperty(\"ngModel\", ctx_r1.tipoRelatorio);\n    i0.ɵɵadvance();\n    i0.ɵɵproperty(\"ngForOf\", ctx_r1.relatoriosDisponiveis);\n    i0.ɵɵadvance();\n    i0.ɵɵproperty(\"disabled\", !ctx_r1.dataInicial || !ctx_r1.tipoRelatorio);\n    i0.ɵɵadvance(2);\n    i0.ɵɵproperty(\"ngIf\", ctx_r1.tipoRelatorio === \"por-piso\" && ctx_r1.todosOsPisos.length > 0);\n    i0.ɵɵadvance();\n    i0.ɵɵproperty(\"ngIf\", ctx_r1.relatorioFiltrado.length > 0 || ctx_r1.relatorioConsolidado.length > 0);\n    i0.ɵɵadvance();\n    i0.ɵɵproperty(\"ngIf\", ctx_r1.tipoRelatorio === \"por-piso\" && ctx_r1.relatorioFiltradoPorPiso.length > 0);\n    i0.ɵɵadvance();\n    i0.ɵɵproperty(\"ngIf\", ctx_r1.tipoRelatorio === \"consolidado\" && ctx_r1.relatorioConsolidado.length > 0);\n  }\n}\nfunction RelatorioComponent_div_4_Template(rf, ctx) {\n  if (rf & 1) {\n    i0.ɵɵelementStart(0, \"div\", 19);\n    i0.ɵɵtext(1, \" Voc\\u00EA n\\u00E3o tem permiss\\u00E3o para visualizar relat\\u00F3rios neste estacionamento. \");\n    i0.ɵɵelementEnd();\n  }\n}\nexport let RelatorioComponent = /*#__PURE__*/(() => {\n  class RelatorioComponent {\n    constructor(http, userService, clientService) {\n      this.http = http;\n      this.userService = userService;\n      this.clientService = clientService;\n      this.dataInicial = '';\n      this.tipoRelatorio = 'por-piso';\n      this.nomeClienteSelecionado = '';\n      this.relatorioFiltrado = [];\n      this.relatorioConsolidado = [];\n      this.relatoriosDisponiveis = [];\n      this.pisoFiltrado = '';\n      this.todosOsPisos = [];\n      this.customerId = 0;\n    }\n    ngOnInit() {\n      this.clientService.selectedClient$.subscribe(clientIdStr => {\n        this.customerId = Number(clientIdStr);\n        this.nomeClienteSelecionado = this.clientService.getSelectedClientName();\n        this.carregarRelatoriosPermitidos();\n      });\n    }\n    carregarRelatoriosPermitidos() {\n      const funcionalidades = this.userService.getUserFunctionalitiesByParking(this.customerId);\n      this.relatoriosDisponiveis = [];\n      if (funcionalidades.includes('REL.OCUPACAO_CONSOLIDADO')) {\n        this.relatoriosDisponiveis.push({\n          tipo: 'consolidado',\n          label: 'Ocupação Consolidada'\n        });\n      }\n      if (funcionalidades.includes('REL.OCUPACAO_POR_PISO')) {\n        this.relatoriosDisponiveis.push({\n          tipo: 'por-piso',\n          label: 'Ocupação por Piso'\n        });\n      }\n      this.tipoRelatorio = this.relatoriosDisponiveis[0]?.tipo || '';\n    }\n    consultar() {\n      const headers = {\n        device: 'manager'\n      };\n      if (!this.dataInicial) {\n        alert(\"Selecione a data inicial.\");\n        return;\n      }\n      this.nomeClienteSelecionado = document.querySelector('#clienteSelect option:checked')?.text || '';\n      const dataFormatada = this.formatarData(this.dataInicial);\n      if (this.tipoRelatorio === 'por-piso') {\n        const apiUrl = environment.apiUrlBackEndExternaApiDB;\n        const url = `${apiUrl}/v1/report-statistical/vw_report_ocupacao_por_piso/${this.customerId}/${dataFormatada}`;\n        this.http.get(url, {\n          headers\n        }).subscribe(res => {\n          const resultado = [];\n          if (Array.isArray(res?.relatorio)) {\n            res.relatorio.forEach(item => {\n              const data = item.data;\n              for (const [piso, horas] of Object.entries(item.pisos)) {\n                for (const [hora, valor] of Object.entries(horas)) {\n                  resultado.push({\n                    data,\n                    piso,\n                    hora,\n                    vagas: valor\n                  });\n                }\n              }\n            });\n          }\n          this.relatorioFiltrado = resultado.sort((a, b) => {\n            const dataA = a.data.localeCompare(b.data);\n            const pisoA = a.piso.localeCompare(b.piso);\n            const [horaA, minutoA] = a.hora.split(':').map(Number);\n            const [horaB, minutoB] = b.hora.split(':').map(Number);\n            const horaComp = horaA - horaB || minutoA - minutoB;\n            return dataA || pisoA || horaComp;\n          });\n          this.todosOsPisos = [...new Set(resultado.map(item => item.piso))].sort();\n          this.pisoFiltrado = '';\n        }, error => console.error('[Relatório por piso] Erro:', error));\n      } else if (this.tipoRelatorio === 'consolidado') {\n        const apiUrl = environment.apiUrlBackEndExternaApiDB;\n        const url = `${apiUrl}/v1/report-statistical/vw_report_ocupacao_consolidada/${this.customerId}/${dataFormatada}`;\n        this.http.get(url, {\n          headers\n        }).subscribe(res => {\n          const resultado = [];\n          if (Array.isArray(res?.relatorio)) {\n            res.relatorio.forEach(item => {\n              const data = item.data;\n              for (const piso of Object.values(item.pisos)) {\n                for (const [hora, valor] of Object.entries(piso)) {\n                  resultado.push({\n                    data,\n                    hora,\n                    total: valor\n                  });\n                }\n              }\n            });\n          }\n          this.relatorioConsolidado = resultado.sort((a, b) => {\n            const dataA = a.data.localeCompare(b.data);\n            const [horaA, minutoA] = a.hora.split(':').map(Number);\n            const [horaB, minutoB] = b.hora.split(':').map(Number);\n            return dataA || horaA - horaB || minutoA - minutoB;\n          });\n        }, error => console.error('[Relatório consolidado] Erro:', error));\n      }\n    }\n    get relatorioFiltradoPorPiso() {\n      if (!this.pisoFiltrado) return this.relatorioFiltrado;\n      return this.relatorioFiltrado.filter(item => item.piso === this.pisoFiltrado);\n    }\n    formatarData(iso) {\n      const [ano, mes, dia] = iso.split('-');\n      return `${dia}-${mes}-${ano}`;\n    }\n    exportarExcel() {\n      const data = this.tipoRelatorio === 'por-piso' ? this.relatorioFiltrado : this.relatorioConsolidado;\n      if (!data.length) return;\n      const worksheet = XLSX.utils.json_to_sheet(data);\n      const workbook = {\n        Sheets: {\n          'Relatório': worksheet\n        },\n        SheetNames: ['Relatório']\n      };\n      const nomeCliente = this.nomeClienteSelecionado || 'Cliente';\n      const nomeRelatorio = this.tipoRelatorio === 'por-piso' ? 'Relatório Por Piso' : 'Relatório Consolidado';\n      const dataStr = this.dataInicial || new Date().toISOString().split('T')[0];\n      const nomeArquivo = `${nomeCliente} - ${nomeRelatorio} - ${dataStr}`.replace(/\\s+/g, '_');\n      const excelBuffer = XLSX.write(workbook, {\n        bookType: 'xlsx',\n        type: 'array'\n      });\n      const blob = new Blob([excelBuffer], {\n        type: 'application/octet-stream'\n      });\n      saveAs(blob, `${nomeArquivo}.xlsx`);\n    }\n    exportarPDF() {\n      var _this = this;\n      return _asyncToGenerator(function* () {\n        const data = _this.tipoRelatorio === 'por-piso' ? _this.relatorioFiltrado : _this.relatorioConsolidado;\n        if (!data.length) return;\n        const doc = new jsPDF();\n        const nomeCliente = _this.nomeClienteSelecionado || 'Cliente';\n        const nomeRelatorio = _this.tipoRelatorio === 'por-piso' ? 'Ocupação por Piso' : 'Ocupação Consolidada';\n        const dataStr = _this.dataInicial || new Date().toISOString().split('T')[0];\n        const dateObj = new Date(dataStr);\n        const dataFormatada = dateObj.toLocaleDateString('pt-BR', {\n          weekday: 'long',\n          year: 'numeric',\n          month: 'long',\n          day: 'numeric'\n        });\n        const nomeArquivo = `${nomeCliente} - ${nomeRelatorio} - ${dataStr}`.replace(/\\s+/g, '_');\n        // Carregar logotipo\n        try {\n          const base64Logo = yield _this.convertToBase64('assets/logo.png');\n          doc.addImage(base64Logo, 'PNG', 14, 10, 40, 50); // largura 40, altura 50\n        } catch (err) {\n          console.warn('Erro ao carregar o logotipo:', err);\n        }\n        doc.setFont('helvetica', 'bold');\n        doc.setFontSize(16);\n        doc.text(nomeRelatorio, 105, 25, {\n          align: 'center'\n        }); // sobe um pouco\n        doc.setFontSize(12);\n        doc.setFont('helvetica', 'normal');\n        doc.text(`Cliente: ${nomeCliente}`, 14, 65);\n        doc.text(`Data: ${dataFormatada}`, 14, 72);\n        doc.text(`Gerado em: ${new Date().toLocaleString('pt-BR')}`, 14, 79);\n        const colunas = Object.keys(data?.[0] || {});\n        const linhas = data.map(obj => colunas.map(c => obj[c]));\n        // Tabela + Rodapé em todas as páginas\n        autoTable(doc, {\n          startY: 85,\n          head: [colunas],\n          body: linhas,\n          theme: 'grid',\n          styles: {\n            fontSize: 10,\n            cellPadding: 3,\n            valign: 'middle'\n          },\n          headStyles: {\n            fillColor: [41, 128, 185],\n            textColor: [255, 255, 255],\n            fontStyle: 'bold'\n          },\n          alternateRowStyles: {\n            fillColor: [240, 240, 240]\n          },\n          margin: {\n            top: 10,\n            bottom: 30\n          },\n          didDrawPage: dataArg => {\n            const pageNumber = doc.getNumberOfPages();\n            const pageSize = doc.internal.pageSize;\n            const pageHeight = pageSize.height ? pageSize.height : pageSize.getHeight();\n            doc.setFontSize(10);\n            doc.setTextColor(150);\n            doc.text(`Cliente: ${nomeCliente} · Página ${pageNumber}`, dataArg.settings.margin.left, pageHeight - 10);\n          }\n        });\n        doc.save(`${nomeArquivo}.pdf`);\n      })();\n    }\n    convertToBase64(url) {\n      return new Promise((resolve, reject) => {\n        const img = new Image();\n        img.crossOrigin = 'Anonymous';\n        img.onload = () => {\n          const canvas = document.createElement('canvas');\n          canvas.width = img.width;\n          canvas.height = img.height;\n          const ctx = canvas.getContext('2d');\n          ctx?.drawImage(img, 0, 0);\n          const dataURL = canvas.toDataURL('image/png');\n          resolve(dataURL);\n        };\n        img.onerror = error => reject(error);\n        img.src = url;\n      });\n    }\n    static #_ = this.ɵfac = function RelatorioComponent_Factory(t) {\n      return new (t || RelatorioComponent)(i0.ɵɵdirectiveInject(i1.HttpClient), i0.ɵɵdirectiveInject(i2.UserService), i0.ɵɵdirectiveInject(i3.ClientService));\n    };\n    static #_2 = this.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n      type: RelatorioComponent,\n      selectors: [[\"app-relatorio\"]],\n      decls: 5,\n      vars: 2,\n      consts: [[1, \"container\"], [\"class\", \"filtros\", 4, \"ngIf\"], [\"class\", \"alert alert-warning mt-4\", 4, \"ngIf\"], [1, \"filtros\"], [\"type\", \"date\", 1, \"form-control\", 3, \"ngModelChange\", \"ngModel\"], [1, \"form-control\", 3, \"ngModelChange\", \"ngModel\"], [3, \"value\", 4, \"ngFor\", \"ngForOf\"], [1, \"btn\", \"btn-primary\", 3, \"click\", \"disabled\"], [\"style\", \"margin-top: 10px;\", 4, \"ngIf\"], [\"class\", \"export-buttons\", 4, \"ngIf\"], [\"class\", \"table table-striped mt-3\", 4, \"ngIf\"], [3, \"value\"], [2, \"margin-top\", \"10px\"], [\"value\", \"\"], [1, \"export-buttons\"], [1, \"btn\", \"btn-success\", 3, \"click\"], [1, \"btn\", \"btn-danger\", 3, \"click\"], [1, \"table\", \"table-striped\", \"mt-3\"], [4, \"ngFor\", \"ngForOf\"], [1, \"alert\", \"alert-warning\", \"mt-4\"]],\n      template: function RelatorioComponent_Template(rf, ctx) {\n        if (rf & 1) {\n          i0.ɵɵelementStart(0, \"div\", 0)(1, \"h2\");\n          i0.ɵɵtext(2, \"Relat\\u00F3rio de Ocupa\\u00E7\\u00E3o\");\n          i0.ɵɵelementEnd();\n          i0.ɵɵtemplate(3, RelatorioComponent_div_3_Template, 14, 8, \"div\", 1)(4, RelatorioComponent_div_4_Template, 2, 0, \"div\", 2);\n          i0.ɵɵelementEnd();\n        }\n        if (rf & 2) {\n          i0.ɵɵadvance(3);\n          i0.ɵɵproperty(\"ngIf\", ctx.relatoriosDisponiveis.length > 0);\n          i0.ɵɵadvance();\n          i0.ɵɵproperty(\"ngIf\", ctx.relatoriosDisponiveis.length === 0);\n        }\n      },\n      dependencies: [i4.NgForOf, i4.NgIf, i5.NgSelectOption, i5.ɵNgSelectMultipleOption, i5.DefaultValueAccessor, i5.SelectControlValueAccessor, i5.NgControlStatus, i5.NgModel, i4.DatePipe],\n      styles: [\".container[_ngcontent-%COMP%]{max-width:1000px;margin:40px auto;padding:20px;font-family:Arial,sans-serif;background-color:#f9f9f9;border-radius:12px;box-shadow:0 0 12px #00000014}h2[_ngcontent-%COMP%]{text-align:center;margin-bottom:30px;color:#333}.filtros[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:15px;align-items:center;justify-content:space-between;margin-bottom:20px}.filtros[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{display:flex;flex-direction:column;font-weight:700;color:#444}.filtros[_ngcontent-%COMP%]   input[_ngcontent-%COMP%], .filtros[_ngcontent-%COMP%]   select[_ngcontent-%COMP%]{padding:6px 10px;border:1px solid #ccc;border-radius:6px;font-size:14px}.filtros[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{padding:8px 16px;font-size:14px;border:none;border-radius:6px;cursor:pointer;transition:.2s ease-in-out}.filtros[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:first-of-type{background-color:#007bff;color:#fff}.filtros[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:last-of-type{background-color:#28a745;color:#fff}.filtros[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]:hover{opacity:.9}table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;margin-top:20px;background-color:#fff;border-radius:8px;overflow:hidden;box-shadow:0 0 6px #0000000d}thead[_ngcontent-%COMP%]   th[_ngcontent-%COMP%]{background-color:#007bff;color:#fff;padding:12px;text-align:left;font-weight:700}tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{padding:10px 12px;border-bottom:1px solid #eaeaea}tbody[_ngcontent-%COMP%]   tr[_ngcontent-%COMP%]:hover{background-color:#f1f1f1}button.btn-success[_ngcontent-%COMP%]{background-color:#28a745;color:#fff;border:none;margin-right:10px;padding:10px;border-radius:6px;cursor:pointer}button.btn-danger[_ngcontent-%COMP%]{background-color:#dc3545;color:#fff;border:none;padding:10px;border-radius:6px;cursor:pointer}.export-buttons[_ngcontent-%COMP%]{margin-top:20px;display:flex;gap:15px;justify-content:flex-end}button.btn-success[_ngcontent-%COMP%], button.btn-danger[_ngcontent-%COMP%]{padding:10px 18px;font-size:14px;border-radius:6px;font-weight:700;border:none;cursor:pointer;box-shadow:0 3px 6px #0000001a}.alert[_ngcontent-%COMP%]{background-color:#fff3cd;border:1px solid #ffeeba;color:#856404;padding:12px 16px;border-radius:6px;font-size:14px;margin-top:16px}button.btn-success[_ngcontent-%COMP%]{background-color:#28a745;color:#fff}button.btn-success[_ngcontent-%COMP%]:hover{background-color:#218838}button.btn-danger[_ngcontent-%COMP%]{background-color:#dc3545;color:#fff}button.btn-danger[_ngcontent-%COMP%]:hover{background-color:#c82333}.filtros[_ngcontent-%COMP%]{display:flex;gap:20px;align-items:center;flex-wrap:wrap;margin-bottom:20px}.alert[_ngcontent-%COMP%]{background-color:#fff3cd;border:1px solid #ffeeba;color:#856404;padding:12px 16px;border-radius:6px;font-size:14px}.export-buttons[_ngcontent-%COMP%]{margin-top:15px;display:flex;gap:10px}\"]\n    });\n  }\n  return RelatorioComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}