@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
1 lines • 81.2 kB
Source Map (JSON)
{"version":3,"file":"c8y-ngx-components-reports.mjs","sources":["../../reports/reports.service.ts","../../reports/export-schedules.interface.ts","../../reports/cron.service.ts","../../reports/cron.component.ts","../../reports/cron.component.html","../../reports/schedule-modal.component.ts","../../reports/schedule-modal.component.html","../../reports/export-schedules.component.ts","../../reports/export-schedules.component.html","../../reports/reports.module.ts","../../reports/ng1/downgraded.components.ts","../../reports/ng1/downgraded.services.ts","../../reports/ng1/index.ts","../../reports/c8y-ngx-components-reports.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Export, Schedule } from './export-schedules.interface';\nimport { AlertService } from '@c8y/ngx-components';\nimport { orderBy, isEqual, remove, some } from 'lodash-es';\nimport {\n InventoryService,\n IdReference,\n IFetchResponse,\n IIdentified,\n FetchClient,\n IFetchOptions\n} from '@c8y/client';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Injectable()\nexport class ReportsService {\n microserviceUrl: string;\n headers: any;\n isReportAgentSubscribed: boolean;\n REPORT_AGENT_NOT_SUBSCRIBED_EXPECTED_ERROR_LOWER_CASE: string;\n\n constructor(\n private alertService: AlertService,\n private inventoryService: InventoryService,\n private client: FetchClient,\n private translateService: TranslateService\n ) {\n this.microserviceUrl = '/service/reporting';\n this.headers = { 'Content-Type': 'application/json' };\n this.isReportAgentSubscribed = true;\n this.REPORT_AGENT_NOT_SUBSCRIBED_EXPECTED_ERROR_LOWER_CASE = 'microservice/not found';\n }\n\n async getExport(exportId: IdReference) {\n let exp: Export;\n const exportDetail = await this.inventoryService.detail(exportId);\n const { data, res } = exportDetail;\n if (res.status !== 200) {\n this.alertService.addServerFailure({ data, res });\n } else {\n exp = data ? (data as unknown as Export) : ({} as Export);\n }\n\n return exp;\n }\n\n async getScheduleList(exportId: IdReference) {\n const exp = await this.getExport(exportId);\n\n return this.extractScheduleListFromExport(exp);\n }\n\n extractScheduleListFromExport(exp: Export) {\n let scheduleList: Schedule[];\n if (exp) {\n scheduleList = exp.c8y_ScheduleConfiguration ? exp.c8y_ScheduleConfiguration : [];\n }\n return orderBy(scheduleList, ['timestamp'], ['desc']);\n }\n\n async addSchedule(schedule: Schedule, exportId: IdReference) {\n return await this.updateSchedules(exportId, [], [schedule]);\n }\n\n async updateSchedule(oldSchedule: Schedule, schedule: Schedule, exportId: IdReference) {\n return await this.updateSchedules(exportId, [oldSchedule], [schedule]);\n }\n\n async updateSchedules(\n exportId: IdReference,\n schedulesToRemove: Schedule[] = [],\n schedulesToAdd: Schedule[] = []\n ) {\n let success = false;\n const exp = await this.getExport(exportId);\n const schedules = this.extractScheduleListFromExport(exp);\n\n remove(schedules, (schedule: Schedule) =>\n some(schedulesToRemove, (scheduleToRemove: Schedule) => isEqual(schedule, scheduleToRemove))\n );\n schedules.push(...schedulesToAdd);\n exp.c8y_ScheduleConfiguration = schedules;\n const { data, res } = await this.inventoryService.update(exp);\n if (res.status === 200) {\n success = await this.reschedule(exportId);\n } else {\n this.alertService.addServerFailure({ data, res });\n }\n\n return success;\n }\n\n async reschedule(exportId: IdReference) {\n const options: IFetchOptions = {\n method: 'PUT',\n headers: this.headers\n };\n const rescheduling = await this.client.fetch(\n `${this.microserviceUrl}/schedule/${exportId}`,\n options\n );\n return rescheduling.status === 200;\n }\n\n async deleteSchedule(schedule: Schedule, exportId: IdReference) {\n return await this.updateSchedules(exportId, [schedule], []);\n }\n\n /**\n * Removes report configuration.\n *\n * Note: fallback strategy is based on error code returned by backend\n * in case of missing subscription for report-agent microservice.\n * @param config entity of report configuration\n * @returns Response wrapped in [[IFetchResponse]]\n */\n async removeConfiguration(config: IIdentified): Promise<IFetchResponse> {\n let res: IFetchResponse;\n if (!this.isReportAgentSubscribed) {\n res = await this.fallbackConfigurationRemoval(config);\n } else {\n res = await this.normalConfigurationRemoval(config);\n if (res.status === 404) {\n const data = await res.json();\n if (\n data &&\n data.error &&\n data.error.toLowerCase() === this.REPORT_AGENT_NOT_SUBSCRIBED_EXPECTED_ERROR_LOWER_CASE\n ) {\n res = await this.fallbackConfigurationRemoval(config);\n this.isReportAgentSubscribed = false;\n }\n }\n }\n return res;\n }\n\n async normalConfigurationRemoval(config: IIdentified): Promise<IFetchResponse> {\n const url = `${this.microserviceUrl}/config/${config.id}`;\n return await this.client.fetch(url, { method: 'DELETE' });\n }\n\n async fallbackConfigurationRemoval(config: IIdentified): Promise<IFetchResponse> {\n let res;\n try {\n res = (await this.inventoryService.delete(config)).res;\n } catch (e) {\n // this could be an error related to not existing object or anything else which makes request return error status code\n // in case of concurrent removal everything is fine, therefor warning message. But it might not recover from some errors\n this.alertService.addServerFailure(e, 'warning');\n }\n return res;\n }\n}\n","import { IManagedObject } from '@c8y/client';\n\nexport interface Export extends IManagedObject {\n c8y_ScheduleConfiguration: Schedule[];\n}\n\nexport interface Schedule {\n timestamp: number;\n emailConfig: EmailConfig;\n cronConfig: CronConfig;\n}\n\nexport interface EmailConfig {\n to: string[];\n cc: string[];\n bcc: string[];\n replyTo: string;\n text: string;\n subject: string;\n}\n\nexport interface CronConfig {\n month: string;\n hour: string;\n weekday: string;\n day: string;\n minute: string;\n}\n\nexport interface EmittedCron {\n cron: string;\n valid: boolean;\n}\n\nexport interface EmitterPayload {\n success: boolean;\n message: string;\n schedule: Schedule;\n}\n\nexport enum ActionType {\n CREATE = 'create',\n EDIT = 'edit',\n DUPLICATE = 'duplicate'\n}\n\nexport enum Base {\n Initial = 1,\n Hour,\n Day,\n Week,\n Month,\n Year\n}\n","import { Injectable } from '@angular/core';\nimport { CronConfig, Base } from './export-schedules.interface';\nimport { TranslateService } from '@ngx-translate/core';\nimport { formatDate } from '@angular/common';\nimport { gettext } from '@c8y/ngx-components';\n\n@Injectable()\nexport class CronService {\n daysOfWeekPosix: any[] = [];\n daysOfMonth = [\n { value: '1', label: '1.' },\n { value: '2', label: '2.' },\n { value: '3', label: '3.' },\n { value: '4', label: '4.' },\n { value: '5', label: '5.' },\n { value: '6', label: '6.' },\n { value: '7', label: '7.' },\n { value: '8', label: '8.' },\n { value: '9', label: '9.' },\n { value: '10', label: '10.' },\n { value: '11', label: '11.' },\n { value: '12', label: '12.' },\n { value: '13', label: '13.' },\n { value: '14', label: '14.' },\n { value: '15', label: '15.' },\n { value: '16', label: '16.' },\n { value: '17', label: '17.' },\n { value: '18', label: '18.' },\n { value: '19', label: '19.' },\n { value: '20', label: '20.' },\n { value: '21', label: '21.' },\n { value: '22', label: '22.' },\n { value: '23', label: '23.' },\n { value: '24', label: '24.' },\n { value: '25', label: '25.' },\n { value: '26', label: '26.' },\n { value: '27', label: '27.' },\n { value: '28', label: '28.' },\n { value: '29', label: '29.' },\n { value: '30', label: '30.' },\n { value: '31', label: '31.' }\n ];\n months: any[] = [];\n hours: any[] = [];\n minutes: any[] = [];\n intervals = [\n { value: 2, label: gettext('Hour') },\n { value: 3, label: gettext('Day') },\n { value: 4, label: gettext('Week') },\n { value: 5, label: gettext('Month') },\n { value: 6, label: gettext('Year') }\n ];\n constructor(private translateService: TranslateService) {\n for (let x = 0; x < 24; x++) {\n this.hours.push({ value: x.toString(), label: `${x}` });\n }\n for (let x = 0; x < 60; x = x + 5) {\n this.minutes.push({ value: x.toString(), label: `${x}` });\n }\n\n for (let x = 0; x < 7; x++) {\n this.daysOfWeekPosix.push({\n value: x.toString(),\n label: this.getWeekDayName({ weekday: x } as unknown as CronConfig)\n });\n }\n\n for (let x = 1; x < 13; x++) {\n this.months.push({\n value: x.toString(),\n label: this.getMonthName({ month: x } as unknown as CronConfig)\n });\n }\n }\n\n generateCron(cronConfig: CronConfig) {\n let cron = '';\n cron = cronConfig.minute ? `${cronConfig.minute}` : '*';\n cron += cronConfig.hour ? ` ${cronConfig.hour}` : ' *';\n cron += cronConfig.day ? ` ${cronConfig.day}` : ' *';\n cron += cronConfig.month ? ` ${cronConfig.month}` : ' *';\n cron += cronConfig.weekday ? ` ${cronConfig.weekday}` : ' *';\n\n return cron;\n }\n\n generateCronConfig(cron: string) {\n const parts = cron.split(/\\s+/);\n const cronConfig: CronConfig = {\n minute: parts[0],\n hour: parts[1],\n day: parts[2],\n month: parts[3],\n weekday: parts[4]\n };\n\n return cronConfig;\n }\n\n getBase(cronConfig: CronConfig) {\n let base: Base = Base.Initial;\n\n if (\n cronConfig.minute !== '*' &&\n cronConfig.hour === '*' &&\n cronConfig.day === '*' &&\n cronConfig.month === '*' &&\n cronConfig.weekday === '*'\n ) {\n base = Base.Hour;\n } else if (\n cronConfig.minute !== '*' &&\n cronConfig.hour !== '*' &&\n cronConfig.day === '*' &&\n cronConfig.month === '*' &&\n cronConfig.weekday === '*'\n ) {\n base = Base.Day;\n } else if (\n cronConfig.minute !== '*' &&\n cronConfig.hour !== '*' &&\n cronConfig.day === '*' &&\n cronConfig.month === '*' &&\n cronConfig.weekday !== '*'\n ) {\n base = Base.Week;\n } else if (\n cronConfig.minute !== '*' &&\n cronConfig.hour !== '*' &&\n cronConfig.day !== '*' &&\n cronConfig.month === '*' &&\n cronConfig.weekday === '*'\n ) {\n base = Base.Month;\n } else if (\n cronConfig.minute !== '*' &&\n cronConfig.hour !== '*' &&\n cronConfig.day !== '*' &&\n cronConfig.month !== '*' &&\n cronConfig.weekday === '*'\n ) {\n base = Base.Year;\n } else {\n // cronConfig invalid\n }\n\n return base;\n }\n\n validateModels(base: Base, cronConfig: CronConfig) {\n let valid: boolean;\n switch (base) {\n case Base.Initial: // Please select\n valid = false;\n break;\n case Base.Hour:\n if (cronConfig.minute !== '*') {\n valid = true;\n } else {\n valid = false;\n }\n break;\n case Base.Day:\n if (cronConfig.minute !== '*' && cronConfig.hour !== '*') {\n valid = true;\n } else {\n valid = false;\n }\n break;\n case Base.Week:\n if (cronConfig.minute !== '*' && cronConfig.hour !== '*' && cronConfig.weekday !== '*') {\n valid = true;\n } else {\n valid = false;\n }\n break;\n case Base.Month:\n if (cronConfig.minute !== '*' && cronConfig.hour !== '*' && cronConfig.day !== '*') {\n valid = true;\n } else {\n valid = false;\n }\n break;\n case Base.Year:\n if (\n cronConfig.minute !== '*' &&\n cronConfig.hour !== '*' &&\n cronConfig.day !== '*' &&\n cronConfig.month !== '*'\n ) {\n valid = true;\n } else {\n valid = false;\n }\n break;\n default:\n valid = false;\n }\n\n return valid;\n }\n\n clearNextModels(base: Base, cronConfig: CronConfig) {\n if (base === Base.Initial) {\n // please select, delete all\n // cron expression: every minute at second 0\n cronConfig.minute = '*';\n cronConfig.hour = '*';\n cronConfig.day = '*';\n cronConfig.month = '*';\n cronConfig.weekday = '*';\n } else if (base === Base.Hour) {\n // hour, don't delete minutes\n // cron expression: every hour, at whatever minute, at second 0\n cronConfig.minute = cronConfig.minute === '*' ? this.minutes[0].value : cronConfig.minute;\n cronConfig.hour = '*';\n cronConfig.day = '*';\n cronConfig.month = '*';\n cronConfig.weekday = '*';\n } else if (base === Base.Day) {\n // day, don't delete minutes and hours\n // cron expression: every day of every month, at whatever hour and minute, at second 0\n cronConfig.minute = cronConfig.minute === '*' ? this.minutes[0].value : cronConfig.minute;\n cronConfig.hour = cronConfig.hour === '*' ? this.hours[0].value : cronConfig.hour;\n cronConfig.day = '*';\n cronConfig.month = '*';\n cronConfig.weekday = '*';\n } else if (base === Base.Week) {\n // week, delete month and day\n // cron expression: every month, at whatever weekday, hour and minute, at second 0\n cronConfig.minute = cronConfig.minute === '*' ? this.minutes[0].value : cronConfig.minute;\n cronConfig.hour = cronConfig.hour === '*' ? this.hours[0].value : cronConfig.hour;\n cronConfig.day = '*';\n cronConfig.month = '*';\n cronConfig.weekday =\n cronConfig.weekday === '*' || cronConfig.weekday === '?'\n ? this.daysOfWeekPosix[0].value\n : cronConfig.weekday;\n } else if (base === Base.Month) {\n // month, delete month and weekday\n // cron expression: every month, at whatever day of month, hour and minute, at second 0\n cronConfig.minute = cronConfig.minute === '*' ? this.minutes[0].value : cronConfig.minute;\n cronConfig.hour = cronConfig.hour === '*' ? this.hours[0].value : cronConfig.hour;\n cronConfig.day = cronConfig.day === '*' ? this.daysOfMonth[0].value : cronConfig.day;\n cronConfig.month = '*';\n cronConfig.weekday = '*';\n } else if (base === Base.Year) {\n // year, delete weekday\n // cron expression: every year, at whatever month, day of month, hour and minute, at second 0\n cronConfig.minute = cronConfig.minute === '*' ? this.minutes[0].value : cronConfig.minute;\n cronConfig.hour = cronConfig.hour === '*' ? this.hours[0].value : cronConfig.hour;\n cronConfig.day = cronConfig.day === '*' ? this.daysOfMonth[0].value : cronConfig.day;\n cronConfig.month = cronConfig.month === '*' ? this.months[0].value : cronConfig.month;\n cronConfig.weekday = '*';\n }\n }\n\n getWeekDayName(cronConfig: CronConfig) {\n const date = new Date(0);\n const firstSundayDate = date.getDate() + 3; // because we know date 0 was on Thursday...\n date.setDate(firstSundayDate + parseInt(cronConfig.weekday, 10));\n return formatDate(date, 'EEEE', this.translateService.currentLang);\n }\n\n getMonthDayName(cronConfig: CronConfig) {\n let name = '';\n this.daysOfMonth.forEach(item => {\n if (item.value === cronConfig.day) {\n name = item.label;\n }\n });\n\n return name;\n }\n\n getMonthName(cronConfig: CronConfig) {\n const date = new Date(0);\n date.setMonth(parseInt(cronConfig.month, 10) - 1);\n return formatDate(date, 'LLLL', this.translateService.currentLang);\n }\n}\n","import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { EmittedCron, CronConfig, Base } from './export-schedules.interface';\nimport { CronService } from './cron.service';\n\n@Component({\n selector: 'cron',\n templateUrl: './cron.component.html'\n})\nexport class CronComponent implements OnInit {\n @Input() cronIn: string;\n @Output() emitter: EventEmitter<EmittedCron> = new EventEmitter();\n emittedCron: EmittedCron = {\n valid: false,\n cron: ''\n };\n\n base: Base = Base.Initial;\n cronConfig: CronConfig;\n\n daysOfWeekPosix: any[];\n daysOfMonth: any[];\n months: any[];\n hours: any[];\n minutes: any[];\n intervals: any[];\n\n constructor(private cronService: CronService) {\n //\n }\n\n ngOnInit() {\n this.daysOfWeekPosix = this.cronService.daysOfWeekPosix;\n this.daysOfMonth = this.cronService.daysOfMonth;\n this.months = this.cronService.months;\n this.hours = this.cronService.hours;\n this.minutes = this.cronService.minutes;\n this.intervals = this.cronService.intervals;\n\n this.cronConfig = this.cronService.generateCronConfig(this.cronIn);\n this.base = this.cronService.getBase(this.cronConfig);\n }\n\n onChangeSelect() {\n this.cronService.clearNextModels(this.base, this.cronConfig);\n this.emittedCron.valid = this.cronService.validateModels(this.base, this.cronConfig);\n this.emittedCron.cron = this.cronService.generateCron(this.cronConfig);\n this.emitter.emit(this.emittedCron);\n }\n}\n","<div class=\"cron-wrap\">\n <div class=\"form-group smart-cron-job-every\">\n <label for=\"smart-cron-job-every\" class=\"control-label\" translate>Interval</label>\n <div>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"cron-select form-control\"\n id=\"smart-cron-job-every\"\n [(ngModel)]=\"base\"\n required=\"true\"\n (change)=\"onChangeSelect()\"\n >\n <option *ngIf=\"base === 1\" value=\"1\" translate>Select…</option>\n <option *ngFor=\"let baseInterval of intervals\" [ngValue]=\"baseInterval.value\">\n {{ baseInterval.label | translate }}\n </option>\n </select>\n <span></span>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"form-group smart-cron-job-on col-md-6\" *ngIf=\"base == 4\">\n <label class=\"control-label\" for=\"smart-cron-job-on\" translate>Day</label>\n\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"cron-select form-control day-value\"\n id=\"smart-cron-job-on\"\n [(ngModel)]=\"cronConfig.weekday\"\n (change)=\"onChangeSelect()\"\n >\n <option *ngFor=\"let dayOfWeek of daysOfWeekPosix\" [ngValue]=\"dayOfWeek.value\">\n {{ dayOfWeek.label | translate }}\n </option>\n </select>\n <span></span>\n </div>\n </div>\n\n <div class=\"form-group smart-cron-job-of col-md-6\" *ngIf=\"base == 6\">\n <label for=\"smart-cron-job-of\" class=\"control-label\" translate>Month</label>\n <div>\n <div class=\"c8y-select-wrapper\">\n <select\n id=\"smart-cron-job-of\"\n class=\"cron-select form-control month-value\"\n [(ngModel)]=\"cronConfig.month\"\n (change)=\"onChangeSelect()\"\n >\n <option *ngFor=\"let month of months\" [ngValue]=\"month.value\">\n {{ month.label | translate }}\n </option>\n </select>\n <span></span>\n </div>\n </div>\n </div>\n\n <div class=\"form-group smart-cron-job-on-the col-md-6\" *ngIf=\"base >= 5\">\n <label for=\"smart-cron-job-on-the\" class=\"control-label\" translate>Day</label>\n <div>\n <div class=\"c8y-select-wrapper\">\n <select\n id=\"smart-cron-job-on-the\"\n class=\"cron-select form-control day-of-month-value\"\n [(ngModel)]=\"cronConfig.day\"\n (change)=\"onChangeSelect()\"\n >\n <option *ngFor=\"let dayOfMonth of daysOfMonth\" [ngValue]=\"dayOfMonth.value\">\n {{ dayOfMonth.label | translate }}\n </option>\n </select>\n <span></span>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"form-group smart-cron-job-at\" *ngIf=\"base >= 2\">\n <label for=\"smart-cron-job-at-hour\" class=\"control-label\">\n <span *ngIf=\"base >= 3\" translate>Time</span>\n <span *ngIf=\"base < 3\" translate>Minutes</span>\n </label>\n <div>\n <div class=\"form-inline\">\n <div class=\"c8y-select-wrapper\" *ngIf=\"base >= 3\">\n <select\n id=\"smart-cron-job-at-hour\"\n class=\"cron-select form-control hour-value\"\n [(ngModel)]=\"cronConfig.hour\"\n (change)=\"onChangeSelect()\"\n >\n <option *ngFor=\"let hour of hours\" [ngValue]=\"hour.value\">\n {{ hour.value | number: '2.0-0' }}\n </option>\n </select>\n <span></span>\n </div>\n <span *ngIf=\"base >= 3\">:</span>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"cron-select form-control minute-value\"\n id=\"smart-cron-job-at-minute\"\n [(ngModel)]=\"cronConfig.minute\"\n (change)=\"onChangeSelect()\"\n >\n <option *ngFor=\"let minute of minutes\" [ngValue]=\"minute.value\">\n {{ minute.value | number: '2.0-0' }}\n </option>\n </select>\n <span></span>\n </div>\n </div>\n </div>\n </div>\n</div>\n","import { Component, OnInit, Output, EventEmitter } from '@angular/core';\nimport { BsModalRef } from 'ngx-bootstrap/modal';\nimport { Schedule, ActionType } from './export-schedules.interface';\nimport { EmittedCron, EmitterPayload } from './export-schedules.interface';\nimport { CronService } from './cron.service';\nimport { cloneDeep } from 'lodash-es';\nimport { gettext } from '@c8y/ngx-components';\nimport { ReportsService } from './reports.service';\n\n@Component({\n selector: 'schedule-modal',\n templateUrl: './schedule-modal.component.html'\n})\nexport class ScheduleModalComponent implements OnInit {\n schedule: Schedule;\n oldSchedule: Schedule;\n @Output() emitter: EventEmitter<EmitterPayload> = new EventEmitter();\n exportId: number;\n actionType: ActionType;\n ActionType = ActionType;\n cronExpression = '* * * * *';\n validCron = false;\n emitterPayload: EmitterPayload = {\n success: false,\n message: '',\n schedule: { timestamp: undefined, emailConfig: undefined, cronConfig: undefined }\n };\n\n emailTo: string;\n emailCc: string;\n emailBcc: string;\n emailReplyTo: string;\n emailSubject: string;\n emailText: string;\n\n placeholdersInfo = gettext(\n 'Available placeholders: {tenant-domain}, {host}, {binaryId}. Whole link to downloadable file is: {tenant-domain}/inventory/binaries/{binaryId}.'\n );\n\n constructor(\n public reportsService: ReportsService,\n public modalRef: BsModalRef,\n private cronService: CronService\n ) {}\n\n ngOnInit() {\n this.oldSchedule = cloneDeep(this.schedule);\n this.populateEmailFieldsFromSchedule(this.schedule);\n this.cronExpression = this.cronService.generateCron(this.schedule.cronConfig);\n this.validCron = this.cronService.validateModels(\n this.cronService.getBase(this.schedule.cronConfig),\n this.schedule.cronConfig\n );\n }\n\n populateEmailFieldsFromSchedule(schedule: Schedule) {\n if (schedule.emailConfig.to && schedule.emailConfig.to.length) {\n this.emailTo = schedule.emailConfig.to.toString();\n }\n if (schedule.emailConfig.cc && schedule.emailConfig.cc.length) {\n this.emailCc = schedule.emailConfig.cc.toString();\n }\n if (schedule.emailConfig.bcc && schedule.emailConfig.bcc.length) {\n this.emailBcc = schedule.emailConfig.bcc.toString();\n }\n if (schedule.emailConfig.replyTo) {\n this.emailReplyTo = schedule.emailConfig.replyTo;\n }\n if (schedule.emailConfig.subject) {\n this.emailSubject = schedule.emailConfig.subject;\n }\n if (schedule.emailConfig.text) {\n this.emailText = schedule.emailConfig.text;\n }\n }\n\n save() {\n this.populateScheduleFromCronExpression();\n this.populateScheduleFromEmailFields();\n if (this.actionType === ActionType.CREATE || this.actionType === ActionType.DUPLICATE) {\n const date = new Date();\n const timestamp = date.getTime();\n this.schedule.timestamp = timestamp;\n }\n this.emitterPayload.success = true;\n this.emitterPayload.schedule = this.schedule;\n this.modalRef.hide();\n // signal to the parent component to update list\n this.emitter.emit(this.emitterPayload);\n }\n\n cancel() {\n this.modalRef.hide();\n }\n\n getCron(cron: EmittedCron) {\n this.validCron = cron.valid;\n if (cron.valid) {\n this.cronExpression = cron.cron;\n }\n }\n\n populateScheduleFromCronExpression() {\n this.schedule.cronConfig = this.cronService.generateCronConfig(this.cronExpression);\n }\n\n convertStringOfEmailsToArray(stringOfEmails: string) {\n const arr = [];\n if (stringOfEmails) {\n const parts = stringOfEmails.split(',');\n parts.forEach(item => {\n if (item) {\n arr.push(item);\n }\n });\n }\n return arr;\n }\n\n populateScheduleFromEmailFields() {\n this.schedule.emailConfig.to = this.emailTo\n ? this.convertStringOfEmailsToArray(this.emailTo)\n : null;\n this.schedule.emailConfig.cc = this.emailCc\n ? this.convertStringOfEmailsToArray(this.emailCc)\n : null;\n this.schedule.emailConfig.bcc = this.emailBcc\n ? this.convertStringOfEmailsToArray(this.emailBcc)\n : null;\n this.schedule.emailConfig.replyTo = this.emailReplyTo;\n this.schedule.emailConfig.subject = this.emailSubject;\n this.schedule.emailConfig.text = this.emailText;\n }\n}\n","<div class=\"modal-header dialog-header\">\n <i c8yIcon=\"c8y-report\"></i>\n <h4 id=\"modal-title\">\n <span *ngIf=\"actionType === ActionType.CREATE\" translate>New export schedule</span>\n <span *ngIf=\"actionType === ActionType.EDIT\" translate>Edit export schedule</span>\n <span *ngIf=\"actionType === ActionType.DUPLICATE\" translate>Duplicate export schedule</span>\n </h4>\n</div>\n\n<div class=\"modal-body\" id=\"modal-body\">\n <p class=\"lead text-center p-t-24 m-b-0\" translate>On schedule send export via email</p>\n</div>\n<div class=\"modal-inner-scroll smart-rule-control\">\n <form #scheduleForm=\"ngForm\" class=\"edit-smart-rule-details\">\n <div class=\"list-group\">\n <div class=\"list-group-item bg-level-1\">\n <div class=\"smart-list-icon-label\">\n <span class=\"dot bg-primary-light m-r-8\">1</span>\n <strong translate>Frequency</strong>\n </div>\n <div class=\"p-t-16\">\n <div class=\"form-group\">\n <cron [cronIn]=\"cronExpression\" (emitter)=\"getCron($event)\" name=\"cron\"></cron>\n </div>\n </div>\n </div>\n <div class=\"list-group-item\">\n <div class=\"smart-list-icon-label\">\n <span class=\"dot bg-primary-light m-r-8\">2</span>\n <div class=\"d-inline-block\">\n <strong translate>Send email</strong>\n <p class=\"help-block text-muted small p-absolute\">\n <i class=\"text-info m-r-4 text-14\" c8yIcon=\"info-circle\"></i>\n <span translate\n >Enter one or more valid email addresses, separated with a comma.</span\n >\n </p>\n </div>\n </div>\n <div class=\"p-t-24\">\n <div class=\"form-group\">\n <label class=\"control-label\" translate>Send to</label>\n <c8y-form-group>\n <input\n emails\n type=\"text\"\n class=\"form-control\"\n name=\"to\"\n [(ngModel)]=\"emailTo\"\n placeholder=\"{{\n 'e.g. joe.doe@example.com,john.smith@example.com`LOCALIZE`' | translate\n }}\"\n required\n />\n </c8y-form-group>\n </div>\n\n <div class=\"form-group\">\n <label class=\"control-label\" translate>CC</label>\n <c8y-form-group>\n <input\n emails\n type=\"text\"\n class=\"form-control span\"\n name=\"cc\"\n placeholder=\"{{\n 'e.g. joe.doe@example.com,john.smith@example.com`LOCALIZE`' | translate\n }}\"\n [(ngModel)]=\"emailCc\"\n />\n </c8y-form-group>\n </div>\n\n <div class=\"form-group\">\n <label class=\"control-label\" translate>BCC</label>\n <c8y-form-group>\n <input\n emails\n type=\"text\"\n class=\"form-control span\"\n name=\"bcc\"\n placeholder=\"{{\n 'e.g. joe.doe@example.com,john.smith@example.com`LOCALIZE`' | translate\n }}\"\n [(ngModel)]=\"emailBcc\"\n />\n </c8y-form-group>\n </div>\n\n <div class=\"form-group\">\n <label class=\"control-label\" translate>Reply to (single email address)</label>\n <c8y-form-group>\n <input\n email\n type=\"text\"\n class=\"form-control span\"\n name=\"replyTo\"\n placeholder=\"{{ 'e.g. joe.doe@example.com`LOCALIZE`' | translate }}\"\n [(ngModel)]=\"emailReplyTo\"\n />\n </c8y-form-group>\n </div>\n\n <div class=\"form-group\">\n <label class=\"control-label\" translate>Subject</label>\n <c8y-form-group>\n <input\n type=\"text\"\n class=\"form-control span\"\n name=\"subject\"\n [(ngModel)]=\"emailSubject\"\n placeholder=\"{{ 'e.g. Daily report' | translate }}\"\n required\n />\n </c8y-form-group>\n </div>\n\n <div class=\"form-group\">\n <label class=\"control-label\" translate>Message</label>\n <c8y-form-group>\n <textarea\n class=\"form-control\"\n name=\"text\"\n [(ngModel)]=\"emailText\"\n placeholder=\"{{ 'Message' | translate }}\"\n rows=\"4\"\n required\n ></textarea>\n <p class=\"help-block text-muted\">\n {{ placeholdersInfo | translate }}\n </p>\n </c8y-form-group>\n </div>\n </div>\n </div>\n </div>\n </form>\n</div>\n\n<div class=\"modal-footer\">\n <button class=\"btn btn-default\" (click)=\"cancel()\" title=\"{{ 'Cancel' | translate }}\">\n {{ 'Cancel' | translate }}\n </button>\n <button\n class=\"btn btn-primary\"\n (click)=\"save()\"\n [disabled]=\"!validCron || !scheduleForm.form.valid\"\n >\n <span>\n <span *ngIf=\"actionType === ActionType.CREATE\" title=\"{{ 'Create' | translate }}\">\n {{ 'Create' | translate }}\n </span>\n <span *ngIf=\"actionType === ActionType.EDIT\" title=\"{{ 'Save' | translate }}\">\n {{ 'Save' | translate }}\n </span>\n <span *ngIf=\"actionType === ActionType.DUPLICATE\" title=\"{{ 'Duplicate' | translate }}\">\n {{ 'Duplicate' | translate }}\n </span>\n </span>\n </button>\n</div>\n","import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core';\nimport { Export, Schedule, EmitterPayload, ActionType } from './export-schedules.interface';\nimport { ReportsService } from './reports.service';\nimport { BsModalService, BsModalRef, ModalOptions } from 'ngx-bootstrap/modal';\nimport { ScheduleModalComponent } from './schedule-modal.component';\nimport { gettext, OptionsService, Permissions } from '@c8y/ngx-components';\nimport { cloneDeep } from 'lodash-es';\nimport { CronService } from './cron.service';\nimport { IdReference } from '@c8y/client';\nimport { TranslateService } from '@ngx-translate/core';\nimport { UserService } from '@c8y/client';\nimport { isEmpty } from 'lodash-es';\n@Component({\n selector: 'export-schedules',\n templateUrl: './export-schedules.component.html'\n})\nexport class ExportSchedulesComponent implements OnInit, OnChanges {\n @Input() set exportId(exportId: IdReference) {\n this._exportId = exportId;\n }\n\n @Output() onSchedulesUpdate = new EventEmitter<Schedule[]>();\n\n exp: Export;\n scheduleList: Schedule[] = [];\n initialSchedule: Schedule = {\n timestamp: null,\n emailConfig: {\n to: [],\n cc: [],\n bcc: [],\n replyTo: '',\n text: '',\n subject: ''\n },\n cronConfig: {\n minute: '0',\n hour: '0',\n day: '1',\n month: '1',\n weekday: '?'\n }\n };\n buttonLabels: any;\n listClass = 'interact-list';\n loadingStatus: any;\n sortType: string;\n sortReverse = false;\n isOpen: any = {};\n isFlipped: boolean;\n isEditMenuOpen = false;\n modalRef: BsModalRef;\n currentUserEmail = '';\n hasRequiredRole = false;\n private _exportId: IdReference;\n private defaultExportEmailTemplate = this.translateService.instant(\n gettext(\n 'File with exported data can be downloaded from {tenant-domain}/apps/cockpit/index.html#?download={binaryId}.'\n )\n );\n\n constructor(\n private reportsService: ReportsService,\n private bsModalService: BsModalService,\n public cronService: CronService,\n private translateService: TranslateService,\n private userService: UserService,\n private optionsService: OptionsService\n ) {\n this.loadingStatus = {\n inProgress: false,\n done: false,\n error: false\n };\n }\n\n async ngOnInit() {\n this.hasRequiredRole = await this.checkRole();\n this.getScheduleList(true);\n const currentUserEmail = await this.getCurrentUserEmail();\n this.initialSchedule.emailConfig.text = await this.optionsService.getTenantOption(\n 'configuration',\n 'export.data.mail.text'\n );\n if (isEmpty(this.initialSchedule.emailConfig.text)) {\n this.initialSchedule.emailConfig.text = await this.optionsService.getInheritedTenantOption(\n 'configuration',\n 'export.data.mail.text',\n this.defaultExportEmailTemplate\n );\n }\n this.initialSchedule.emailConfig.to = currentUserEmail;\n this.exp = await this.reportsService.getExport(this._exportId);\n this.initialSchedule.emailConfig.subject = this.translateService.instant(\n gettext('Export of \"{{expName}}\"'),\n { expName: this.exp.name }\n );\n }\n\n ngOnChanges() {\n this.translateButtonTitles();\n }\n\n translateButtonTitles() {\n this.buttonLabels = {\n edit: this.translateService.instant(gettext('Edit schedule')),\n editNoPermission: this.translateService.instant(gettext('Edit schedule - no permissions')),\n duplicate: this.translateService.instant(gettext('Duplicate schedule')),\n duplicateNoPermission: this.translateService.instant(\n gettext('Duplicate schedule - no permissions')\n ),\n delete: this.translateService.instant(gettext('Delete schedule')),\n deleteNoPermission: this.translateService.instant(gettext('Delete schedule - no permissions'))\n };\n }\n\n async getCurrentUserEmail() {\n const { data } = await this.userService.current();\n return data && data.email ? [data.email] : [];\n }\n async checkRole() {\n const { data } = await this.userService.current();\n const role = Permissions.ROLE_SCHEDULE_REPORT_ADMIN;\n const hasRole = this.userService.hasRole(data, role);\n return hasRole;\n }\n\n async getScheduleList(withProgress: boolean) {\n if (withProgress) {\n this.loadingStatus.inProgress = true;\n }\n this.scheduleList = await this.reportsService.getScheduleList(this._exportId);\n if (withProgress) {\n this.loadingStatus.inProgress = false;\n }\n }\n\n addSchedule() {\n this.openAddEditModal(this._exportId, this.initialSchedule, ActionType.CREATE);\n }\n\n editSchedule(schedule: Schedule, index: number, event: any) {\n if (this.hasRequiredRole) {\n event.preventDefault();\n this.openAddEditModal(this._exportId, schedule, ActionType.EDIT, index);\n }\n }\n\n duplicateSchedule(schedule: Schedule, event: any) {\n event.preventDefault();\n this.openAddEditModal(this._exportId, schedule, ActionType.DUPLICATE);\n }\n\n openAddEditModal(\n exportId: IdReference,\n schedule: Schedule,\n actionType: ActionType,\n index?: number\n ) {\n const payload = { actionType, exportId, schedule: cloneDeep(schedule) };\n const modalOptions = {\n class: 'modal-sm',\n ariaDescribedby: 'modal-body',\n ariaLabelledBy: 'modal-title',\n initialState: payload\n } as ModalOptions;\n this.modalRef = this.bsModalService.show(ScheduleModalComponent, modalOptions);\n this.modalRef.content.emitter.subscribe((load: EmitterPayload) =>\n this.getMessageFromModal(load, index)\n );\n }\n\n getMessageFromModal(payload: EmitterPayload, index?: number) {\n if (payload.success) {\n if (index !== undefined) {\n this.scheduleList[index] = payload.schedule;\n } else {\n this.scheduleList.push(payload.schedule);\n }\n this.onSchedulesUpdate.emit(this.scheduleList);\n }\n }\n\n removeSchedule(schedule: Schedule, index: number, event: any) {\n event.preventDefault();\n this.scheduleList.splice(index, 1);\n this.onSchedulesUpdate.emit(this.scheduleList);\n }\n}\n","<div>\n <div *ngIf=\"loadingStatus.inProgress\" class=\"d-flex a-i-center\">\n <c8y-loading></c8y-loading>\n </div>\n\n <div *ngIf=\"!loadingStatus.inProgress && loadingStatus.done && loadingStatus.error\">\n <div class=\"alert alert-warning max-width-100\" translate>Could not load schedules list.</div>\n </div>\n\n <div *ngIf=\"!loadingStatus.inProgress && !loadingStatus.done && !loadingStatus.error\">\n <c8y-ui-empty-state\n *ngIf=\"!scheduleList.length\"\n [icon]=\"'c8y-report'\"\n [title]=\"'No export schedules defined.' | translate\"\n [horizontal]=\"true\"\n ></c8y-ui-empty-state>\n\n <div class=\"c8y-list__group\" *ngIf=\"scheduleList.length\">\n <div class=\"c8y-list__item hidden-xs\">\n <div class=\"c8y-list__item__block\">\n <div class=\"c8y-list__item__icon\">\n <i class=\"p-l-24\"></i>\n </div>\n <div class=\"c8y-list__item__body\">\n <div class=\"d-flex\">\n <div class=\"col-sm-6\">\n <label class=\"m-0\">\n {{ 'Description' | translate }}\n </label>\n </div>\n <div class=\"col-sm-6 m-r-40\">\n <label class=\"m-0\">\n {{ 'Frequency' | translate }}\n </label>\n </div>\n </div>\n </div>\n <span></span>\n </div>\n </div>\n\n <div\n class=\"c8y-list__item pointer\"\n *ngFor=\"let schedule of scheduleList; index as i\"\n (click)=\"editSchedule(schedule, i, $event)\"\n >\n <div class=\"c8y-list__item__block\">\n <div class=\"c8y-list__item__icon\">\n <i c8yIcon=\"c8y-report\" class=\"c8y-icon-duocolor\"></i>\n </div>\n <div class=\"c8y-list__item__body d-flex\">\n <div class=\"col-sm-6 col-xs-6\">\n <div class=\"text-truncate\" title=\"{{ schedule.emailConfig.subject }}\">\n {{ schedule.emailConfig.subject }}\n </div>\n </div>\n <div class=\"col-sm-6 col-xs-6\">\n <div class=\"d-flex a-i-baseline\">\n <i c8yIcon=\"calendar\" class=\"text-muted m-r-4\"></i>\n <span class=\"smart-rule-information\">\n <span\n *ngIf=\"cronService.getBase(schedule.cronConfig) === 2\"\n ngNonBindable\n translate\n [translateParams]=\"{ minutes: schedule.cronConfig.minute | number: '2.0-0' }\"\n >\n Hourly: {{ minutes }} minute(s) past the hour.\n </span>\n <span\n *ngIf=\"cronService.getBase(schedule.cronConfig) === 3\"\n ngNonBindable\n translate\n [translateParams]=\"{\n hour: schedule.cronConfig.hour | number: '2.0-0',\n minutes: schedule.cronConfig.minute | number: '2.0-0'\n }\"\n >\n Daily: at {{ hour }}:{{ minutes }}.\n </span>\n <span\n *ngIf=\"cronService.getBase(schedule.cronConfig) === 4\"\n ngNonBindable\n translate\n [translateParams]=\"{\n weekDay: cronService.getWeekDayName(schedule.cronConfig),\n hour: schedule.cronConfig.hour | number: '2.0-0',\n minutes: schedule.cronConfig.minute | number: '2.0-0'\n }\"\n >\n Weekly: {{ weekDay }}, at {{ hour }}:{{ minutes }}.\n </span>\n <span\n *ngIf=\"cronService.getBase(schedule.cronConfig) === 5\"\n ngNonBindable\n translate\n [translateParams]=\"{\n monthDay: cronService.getMonthDayName(schedule.cronConfig),\n hour: schedule.cronConfig.hour | number: '2.0-0',\n minutes: schedule.cronConfig.minute | number: '2.0-0'\n }\"\n >\n Monthly: {{ monthDay }} day of the month, at {{ hour }}:{{ minutes }}.\n </span>\n <span\n *ngIf=\"cronService.getBase(schedule.cronConfig) === 6\"\n ngNonBindable\n translate\n [translateParams]=\"{\n month: cronService.getMonthName(schedule.cronConfig),\n monthDay: cronService.getMonthDayName(schedule.cronConfig),\n hour: schedule.cronConfig.hour | number: '2.0-0',\n minutes: schedule.cronConfig.minute | number: '2.0-0'\n }\"\n >\n Yearly: {{ month }}, {{ monthDay }} day of the month, at {{ hour }}:{{\n minutes\n }}.\n </span>\n </span>\n </div>\n </div>\n </div>\n <div class=\"c8y-list__item__actions\" (click)=\"$event.stopPropagation()\">\n <div class=\"settings dropdown\" dropdown>\n <button\n class=\"dropdown-toggle c8y-dropdown\"\n type=\"button\"\n title=\"{{ 'Actions' | translate }}\"\n dropdownToggle\n >\n <i [c8yIcon]=\"'ellipsis-v'\"></i>\n </button>\n <ul role=\"list\" class=\"dropdown-menu dropdown-menu-right\" *dropdownMenu>\n <li role=\"menuitem\">\n <button\n type=\"button\"\n [title]=\"hasRequiredRole ? buttonLabels.edit : buttonLabels.editNoPermission\"\n (click)=\"editSchedule(schedule, i, $event)\"\n [disabled]=\"!hasRequiredRole\"\n >\n <i [c8yIcon]=\"'pencil'\"></i>\n {{ 'Edit' | translate }}\n </button>\n </li>\n <li role=\"menuitem\">\n <button\n type=\"button\"\n [title]=\"\n hasRequiredRole ? buttonLabels.duplicate : buttonLabels.duplicateNoPermission\n \"\n (click)=\"duplicateSchedule(schedule, $event)\"\n [disabled]=\"!hasRequiredRole\"\n >\n <i [c8yIcon]=\"'copy'\"></i>\n {{ 'Duplicate' | translate }}\n </button>\n </li>\n <li role=\"menuitem\">\n <button\n type=\"button\"\n [title]=\"\n hasRequiredRole ? buttonLabels.delete : buttonLabels.deleteNoPermission\n \"\n (click)=\"removeSchedule(schedule, i, $event)\"\n [disabled]=\"!hasRequiredRole\"\n >\n <i [c8yIcon]=\"'delete'\"></i>\n {{ 'Delete' | translate }}\n </button>\n </li>\n </ul>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"alert alert-warning max-width-100\" *ngIf=\"!hasRequiredRole\" role=\"alert\" translate>\n You don't have the permission required to schedule exports.\n </div>\n <button\n class=\"btn btn-default m-t-16\"\n type=\"button\"\n title=\"{{ 'Add schedule' | translate }}\"\n (click)=\"addSchedule()\"\n [disabled]=\"!hasRequiredRole\"\n >\n <i [c8yIcon]=\"'plus-circle'\"></i>\n {{ 'Add schedule' | translate }}\n </button>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CoreModule, FormsModule } from '@c8y/ngx-components';\nimport { ReportsService } from './reports.service';\nimport { CronService } from './cron.service';\nimport { ExportSchedulesComponent } from './export-schedules.component';\nimport { ScheduleModalComponent } from './schedule-modal.component';\nimport { CronComponent } from './cron.component';\nimport { BsDropdownModule } from 'ngx-bootstrap/dropdown';\nimport { TooltipModule } from 'ngx-bootstrap/tooltip';\n\n/**\n * The angular module definition for reports.\n * @exports ExportSchedulesComponent\n * @exports ScheduleModalComponent\n * @exports CronComponent\n */\n@NgModule({\n declarations: [ExportSchedulesComponent, ScheduleModalComponent, CronComponent],\n imports: [CoreModule, FormsModule, BsDropdownModule, TooltipModule],\n providers: [ReportsService, CronService],\n exports: [ExportSchedulesComponent, ScheduleModalComponent, CronComponent]\n})\nexport class ReportsModule {}\n","import { downgradeComponent } from '@angular/upgrade/static';\nimport { ExportSchedulesComponent } from '../export-schedules.component';\nexport const exportSchedulesComponentDowngradedComponent = downgradeComponent({\n component: ExportSchedulesComponent\n});\n","import { downgradeInjectable } from '@angular/upgrade/static';\nimport { ReportsService } from '../reports.service';\nexport const reportsServiceDowngradedInjectable = downgradeInjectable(ReportsService);\n","import * as angular from 'angular';\nimport { registerNgModule } from '@c8y/ng1-modules';\nimport { exportSchedulesComponentDowngradedComponent } from './downgraded.components';\nimport { reportsServiceDowngradedInjectable } from './downgraded.services';\n\nconst NAME_REPORTS = 'c8y.upgrade.reports';\n\nangular\n .module(NAME_REPORTS, [])\n .directive('c8yExportSchedules', exportSchedulesComponentDowngradedComponent)\n .service('c8yReportsService', reportsServiceDowngradedInjectable);\n\nexport const ng1ModulesReports = [NAME_REPORTS];\n\nregisterNgModule(ng1ModulesReports);\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i1.CronService","i2","i3","i4","i1.ReportsService","i3.CronService","i5","i6","i7.CronComponent","i7"],"mappings":";;;;;;;;;;;;;;;;;;MAea,cAAc,CAAA;AAMzB,IAAA,WAAA,CACU,YAA0B,EAC1B,gBAAkC,EAClC,MAAmB,EACnB,gBAAkC,EAAA;QAHlC,IAAY,CAAA,YAAA,GAAZ,YAAY,CAAc;QAC1B,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;QAClC,IAAM,CAAA,MAAA,GAAN,MAAM,CAAa;QACnB,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAkB;AAE1C,QAAA,IAAI,CAAC,eAAe,GAAG,oBAAoB,CAAC;QAC5C,IAAI,CAAC,OAAO,GAAG,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;AACtD,QAAA,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;AACpC,QAAA,IAAI,CAAC,qDAAqD,GAAG,wBAAwB,CAAC;KACvF;IAED,MAAM,SAAS,CAAC,QAAqB,EAAA;AACnC,QAAA,IAAI,GAAW,CAAC;QAChB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AAClE,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC;AACnC,QAAA,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;YACtB,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;SACnD;aAAM;YACL,GAAG,GAAG,IAAI,GAAI,IAA0B,GAAI,EAAa,CAAC;SAC3D;AAED,QAAA,OAAO,GAAG,CAAC;KACZ;IAED,MAAM,eAAe,CAAC,QAAqB,EAAA;QACzC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE3C,QAAA,OAAO,IAAI,CAAC,6BAA6B,CAAC,GAAG,CAAC,CAAC;KAChD;AAED,IAAA,6BAA6B,CAAC,GAAW,EAAA;AACvC,QAAA,IAAI,YAAwB,CAAC;QAC7B,IAAI,GAAG,EAAE;AACP,YAAA,YAAY,GAAG,GAAG,CAAC,yBAAyB,GAAG,GAAG,CAAC,yBAAyB,GAAG,EAAE,CAAC;SACnF;AACD,QAAA,OAAO,OAAO,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;KACvD;AAED,IAAA,MAAM,WAAW,CAAC,QAAkB,EAAE,QAAqB,EAAA;AACzD,QAAA,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;KAC7D;AAED,IAAA,MAAM,cAAc,CAAC,WAAqB,EAAE,QAAkB,EAAE,QAAqB,EAAA;AACnF,QAAA,OAAO,MAAM,IAAI,CAAC,eAAe,CA