@senior-agronegocio/angular-components 0.0.9860 → 0.0.9861
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/senior-agronegocio-angular-components.umd.js +5613 -4468
- package/bundles/senior-agronegocio-angular-components.umd.js.map +1 -1
- package/bundles/senior-agronegocio-angular-components.umd.min.js +2 -2
- package/bundles/senior-agronegocio-angular-components.umd.min.js.map +1 -1
- package/common/agro-number-utils.class.d.ts +6 -0
- package/common/agro-object-stringifier.class.d.ts +16 -0
- package/common/agro-regex.constant.d.ts +3 -0
- package/common/agro-string-utils.class.d.ts +3 -0
- package/components/event-control-board/event-control-board.component.d.ts +25 -17
- package/components/event-control-board/index.d.ts +1 -3
- package/components/event-control-board/service/entity-service.d.ts +3 -3
- package/components/event-control-board/service/origination/origination-dto.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/components/modal-invoice-pj/for-fixation/modal-fixation-options.interface.d.ts +5 -0
- package/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.d.ts +35 -0
- package/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.module.d.ts +2 -0
- package/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.component.d.ts +26 -0
- package/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.module.d.ts +2 -0
- package/components/modal-invoice-pj/for-transfer/modal-invoice-pj-for-transfer.component.d.ts +26 -0
- package/components/modal-invoice-pj/for-transfer/modal-invoice-pj-for-transfer.module.d.ts +2 -0
- package/components/modal-invoice-pj/index.d.ts +9 -0
- package/components/modal-invoice-pj/modal-invoice-pj-base.class.d.ts +53 -0
- package/components/modal-invoice-pj/modal-invoice-pj-options.interface.d.ts +10 -0
- package/components/modal-invoice-pj/modal-shared-imports.d.ts +8 -0
- package/components/modal-invoice-pj/services/agro-invoice/agro-invoice.module.d.ts +2 -0
- package/components/modal-invoice-pj/services/agro-invoice/agro-invoice.service.d.ts +16 -0
- package/components/modal-invoice-pj/services/agro-invoice/index.d.ts +2 -0
- package/components/modal-invoice-pj/services/agro-invoice/interfaces.d.ts +75 -0
- package/esm2015/common/agro-number-utils.class.js +18 -1
- package/esm2015/common/agro-object-stringifier.class.js +31 -0
- package/esm2015/common/agro-platform-utils.class.js +8 -7
- package/esm2015/common/agro-regex.constant.js +5 -2
- package/esm2015/common/agro-string-utils.class.js +27 -11
- package/esm2015/components/cancel-event-dialog/cancel-event-dialog-config.js +1 -1
- package/esm2015/components/event-control-board/event-control-board.component.js +110 -90
- package/esm2015/components/event-control-board/event-control-board.module.js +2 -5
- package/esm2015/components/event-control-board/index.js +2 -4
- package/esm2015/components/event-control-board/service/entity-service.js +25 -27
- package/esm2015/components/event-control-board/service/origination/origination-dto.js +1 -1
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/modal-invoice-pj/for-fixation/modal-fixation-options.interface.js +1 -0
- package/esm2015/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.js +189 -0
- package/esm2015/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.module.js +16 -0
- package/esm2015/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.component.js +60 -0
- package/esm2015/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.module.js +16 -0
- package/esm2015/components/modal-invoice-pj/for-transfer/modal-invoice-pj-for-transfer.component.js +60 -0
- package/esm2015/components/modal-invoice-pj/for-transfer/modal-invoice-pj-for-transfer.module.js +16 -0
- package/esm2015/components/modal-invoice-pj/index.js +8 -0
- package/esm2015/components/modal-invoice-pj/modal-invoice-pj-base.class.js +193 -0
- package/esm2015/components/modal-invoice-pj/modal-invoice-pj-options.interface.js +1 -0
- package/esm2015/components/modal-invoice-pj/modal-shared-imports.js +32 -0
- package/esm2015/components/modal-invoice-pj/services/agro-invoice/agro-invoice.module.js +28 -0
- package/esm2015/components/modal-invoice-pj/services/agro-invoice/agro-invoice.service.js +49 -0
- package/esm2015/components/modal-invoice-pj/services/agro-invoice/index.js +3 -0
- package/esm2015/components/modal-invoice-pj/services/agro-invoice/interfaces.js +13 -0
- package/esm2015/lib-translation.module.js +3 -1
- package/esm2015/pipe/cnpj-cpf/cnpj-cpf.pipe.js +28 -0
- package/esm2015/pipe/cnpj-cpf/cnpj-cpf.pipe.module.js +15 -0
- package/esm2015/pipe/cnpj-cpf/index.js +3 -0
- package/esm2015/pipe/index.js +5 -1
- package/esm2015/pipe/kilogram/index.js +3 -0
- package/esm2015/pipe/kilogram/kilogram.module.js +17 -0
- package/esm2015/pipe/kilogram/kilogram.pipe.js +38 -0
- package/esm2015/pipe/stringifier/index.js +3 -0
- package/esm2015/pipe/stringifier/stringifier.pipe.js +13 -0
- package/esm2015/pipe/stringifier/stringifier.pipe.module.js +15 -0
- package/esm2015/pipe/telephone/index.js +3 -0
- package/esm2015/pipe/telephone/telephone.pipe.js +91 -0
- package/esm2015/pipe/telephone/telephone.pipe.module.js +15 -0
- package/esm2015/public-api.js +6 -6
- package/esm2015/senior-agronegocio-angular-components.js +3 -2
- package/esm2015/services/entity-service.js +132 -0
- package/esm2015/services/i18n/en-US.js +9 -1
- package/esm2015/services/i18n/es-CO.js +10 -2
- package/esm2015/services/i18n/pt-BR.js +272 -261
- package/esm2015/services/index.js +1 -1
- package/esm2015/services/lib-translation.service.js +3 -3
- package/esm2015/services/producer-invoice/producer-invoice-dto.js +1 -0
- package/esm2015/services/producer-invoice/producer-invoice.service.js +64 -0
- package/esm5/common/agro-number-utils.class.js +19 -1
- package/esm5/common/agro-object-stringifier.class.js +35 -0
- package/esm5/common/agro-platform-utils.class.js +8 -7
- package/esm5/common/agro-regex.constant.js +5 -2
- package/esm5/common/agro-string-utils.class.js +27 -11
- package/esm5/components/cancel-event-dialog/cancel-event-dialog-config.js +1 -1
- package/esm5/components/event-control-board/event-control-board.component.js +113 -91
- package/esm5/components/event-control-board/event-control-board.module.js +2 -5
- package/esm5/components/event-control-board/index.js +2 -4
- package/esm5/components/event-control-board/service/entity-service.js +24 -26
- package/esm5/components/event-control-board/service/origination/origination-dto.js +1 -1
- package/esm5/components/index.js +2 -1
- package/esm5/components/modal-invoice-pj/for-fixation/modal-fixation-options.interface.js +1 -0
- package/esm5/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.component.js +221 -0
- package/esm5/components/modal-invoice-pj/for-fixation/modal-invoice-pj-for-fixation.module.js +19 -0
- package/esm5/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.component.js +63 -0
- package/esm5/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.module.js +19 -0
- package/esm5/components/modal-invoice-pj/for-transfer/modal-invoice-pj-for-transfer.component.js +63 -0
- package/esm5/components/modal-invoice-pj/for-transfer/modal-invoice-pj-for-transfer.module.js +19 -0
- package/esm5/components/modal-invoice-pj/index.js +8 -0
- package/esm5/components/modal-invoice-pj/modal-invoice-pj-base.class.js +210 -0
- package/esm5/components/modal-invoice-pj/modal-invoice-pj-options.interface.js +1 -0
- package/esm5/components/modal-invoice-pj/modal-shared-imports.js +32 -0
- package/esm5/components/modal-invoice-pj/services/agro-invoice/agro-invoice.module.js +31 -0
- package/esm5/components/modal-invoice-pj/services/agro-invoice/agro-invoice.service.js +56 -0
- package/esm5/components/modal-invoice-pj/services/agro-invoice/index.js +3 -0
- package/esm5/components/modal-invoice-pj/services/agro-invoice/interfaces.js +13 -0
- package/esm5/lib-translation.module.js +3 -1
- package/esm5/pipe/cnpj-cpf/cnpj-cpf.pipe.js +35 -0
- package/esm5/pipe/cnpj-cpf/cnpj-cpf.pipe.module.js +18 -0
- package/esm5/pipe/cnpj-cpf/index.js +3 -0
- package/esm5/pipe/index.js +5 -1
- package/esm5/pipe/kilogram/index.js +3 -0
- package/esm5/pipe/kilogram/kilogram.module.js +20 -0
- package/esm5/pipe/kilogram/kilogram.pipe.js +41 -0
- package/esm5/pipe/stringifier/index.js +3 -0
- package/esm5/pipe/stringifier/stringifier.pipe.js +16 -0
- package/esm5/pipe/stringifier/stringifier.pipe.module.js +18 -0
- package/esm5/pipe/telephone/index.js +3 -0
- package/esm5/pipe/telephone/telephone.pipe.js +95 -0
- package/esm5/pipe/telephone/telephone.pipe.module.js +18 -0
- package/esm5/public-api.js +6 -6
- package/esm5/senior-agronegocio-angular-components.js +3 -2
- package/esm5/services/entity-service.js +143 -0
- package/esm5/services/i18n/en-US.js +9 -1
- package/esm5/services/i18n/es-CO.js +10 -2
- package/esm5/services/i18n/pt-BR.js +272 -261
- package/esm5/services/index.js +1 -1
- package/esm5/services/lib-translation.service.js +3 -3
- package/esm5/services/producer-invoice/producer-invoice-dto.js +1 -0
- package/esm5/services/producer-invoice/producer-invoice.service.js +72 -0
- package/fesm2015/senior-agronegocio-angular-components.js +4777 -3766
- package/fesm2015/senior-agronegocio-angular-components.js.map +1 -1
- package/fesm5/senior-agronegocio-angular-components.js +5604 -4475
- package/fesm5/senior-agronegocio-angular-components.js.map +1 -1
- package/package.json +7 -55
- package/pipe/cnpj-cpf/cnpj-cpf.pipe.d.ts +4 -0
- package/pipe/cnpj-cpf/cnpj-cpf.pipe.module.d.ts +2 -0
- package/pipe/cnpj-cpf/index.d.ts +2 -0
- package/pipe/index.d.ts +4 -0
- package/pipe/kilogram/index.d.ts +2 -0
- package/pipe/kilogram/kilogram.module.d.ts +2 -0
- package/pipe/kilogram/kilogram.pipe.d.ts +8 -0
- package/pipe/stringifier/index.d.ts +2 -0
- package/pipe/stringifier/stringifier.pipe.d.ts +9 -0
- package/pipe/stringifier/stringifier.pipe.module.d.ts +2 -0
- package/pipe/telephone/index.d.ts +2 -0
- package/pipe/telephone/telephone.pipe.d.ts +21 -0
- package/pipe/telephone/telephone.pipe.module.d.ts +2 -0
- package/public-api.d.ts +5 -5
- package/senior-agronegocio-angular-components.d.ts +2 -1
- package/senior-agronegocio-angular-components.metadata.json +1 -1
- package/services/entity-service.d.ts +73 -0
- package/services/i18n/en-US.d.ts +8 -0
- package/services/i18n/es-CO.d.ts +8 -0
- package/services/i18n/pt-BR.d.ts +270 -259
- package/{components/event-control-board/service → services}/producer-invoice/producer-invoice-dto.d.ts +4 -4
- package/services/producer-invoice/producer-invoice.service.d.ts +18 -0
- package/components/event-control-board/service/event-control-board.service.d.ts +0 -13
- package/components/event-control-board/service/producer-invoice/producer-invoice.module.d.ts +0 -2
- package/components/event-control-board/service/producer-invoice/producer-invoice.service.d.ts +0 -11
- package/esm2015/components/event-control-board/service/event-control-board.service.js +0 -37
- package/esm2015/components/event-control-board/service/producer-invoice/producer-invoice-dto.js +0 -1
- package/esm2015/components/event-control-board/service/producer-invoice/producer-invoice.module.js +0 -26
- package/esm2015/components/event-control-board/service/producer-invoice/producer-invoice.service.js +0 -24
- package/esm5/components/event-control-board/service/event-control-board.service.js +0 -38
- package/esm5/components/event-control-board/service/producer-invoice/producer-invoice-dto.js +0 -1
- package/esm5/components/event-control-board/service/producer-invoice/producer-invoice.module.js +0 -29
- package/esm5/components/event-control-board/service/producer-invoice/producer-invoice.service.js +0 -27
|
@@ -68,4 +68,10 @@ export declare class AgroNumberUtils {
|
|
|
68
68
|
* @returns O número arredondado.
|
|
69
69
|
*/
|
|
70
70
|
static roundTo(value: number, decimals?: number): number;
|
|
71
|
+
/**
|
|
72
|
+
* Pega apenas números, convertendo strings para números e retornarndo apenas o maior inteiro encontrado.
|
|
73
|
+
* @param value - O valor a ser processado.
|
|
74
|
+
* @returns O maior número inteiro encontrado ou 0 se nenhum número for encontrado.
|
|
75
|
+
*/
|
|
76
|
+
static getNearInteger(value: any): number;
|
|
71
77
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PipeTransform } from "@angular/core";
|
|
2
|
+
export declare type UsePipes = {
|
|
3
|
+
[key: string]: PipeTransform;
|
|
4
|
+
};
|
|
5
|
+
export declare class AgroObjectStringifier {
|
|
6
|
+
/**
|
|
7
|
+
* Formata um objeto concatenando valores segundo as chaves e pipes informados.
|
|
8
|
+
*
|
|
9
|
+
* @param separator Separador entre os valores (ex: "-")
|
|
10
|
+
* @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
|
|
11
|
+
* @param obj Objeto origem
|
|
12
|
+
*/
|
|
13
|
+
static formatObject(separator: string, fields: string[], obj: any, usePipes?: UsePipes): string;
|
|
14
|
+
/** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
|
|
15
|
+
private static resolvePath;
|
|
16
|
+
}
|
|
@@ -91,4 +91,7 @@ export declare class AgroStringUtils {
|
|
|
91
91
|
static applyMask(value: string, mask: AgroStringMasks | string): string;
|
|
92
92
|
static isValid(str: NullableString): boolean;
|
|
93
93
|
static isInvalid(str: NullableString): boolean;
|
|
94
|
+
static isISODate(value: string): boolean;
|
|
95
|
+
static isISOTime(value: string): boolean;
|
|
96
|
+
static isISODatetime(value: string): boolean;
|
|
94
97
|
}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from
|
|
2
|
-
import { FormBuilder, FormGroup } from
|
|
3
|
-
import { BadgeColors, ButtonPriority, FormField, Step } from
|
|
4
|
-
import { DialogService, MessageService } from
|
|
5
|
-
import { AGRO_NUMBERS } from
|
|
6
|
-
import { LibTranslationService } from
|
|
7
|
-
import { WebsocketService } from
|
|
8
|
-
import { CancelEventDialogConfig } from
|
|
9
|
-
import { EventOrigin } from
|
|
10
|
-
import { EventStatus } from
|
|
11
|
-
import { E070Emp } from
|
|
12
|
-
import { E070Fil } from
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup } from '@angular/forms';
|
|
3
|
+
import { BadgeColors, ButtonPriority, FormField, Step } from '@seniorsistemas/angular-components';
|
|
4
|
+
import { DialogService, MessageService } from 'primeng';
|
|
5
|
+
import { AGRO_NUMBERS } from '../../enums/agro-numbers.enum';
|
|
6
|
+
import { LibTranslationService } from '../../services/lib-translation.service';
|
|
7
|
+
import { WebsocketService } from '../../services/websocket';
|
|
8
|
+
import { CancelEventDialogConfig } from '../cancel-event-dialog/cancel-event-dialog-config';
|
|
9
|
+
import { EventOrigin } from './common/event-origin';
|
|
10
|
+
import { EventStatus } from './common/event-status';
|
|
11
|
+
import { E070Emp } from './service/e070emp/e070emp';
|
|
12
|
+
import { E070Fil } from './service/e070fil/e070fil';
|
|
13
|
+
import { EventControlItemService } from './service/event-control-item/event-control-item.service';
|
|
14
|
+
import { EventControlService } from './service/event-control/event-control.service';
|
|
15
|
+
import { PaginatorStorageService } from './service/paginator-storage.service';
|
|
16
|
+
import { TransferService } from './service/transfer/transfer.service';
|
|
17
|
+
import { FixationService } from './service/fixation-entity/fixation.service';
|
|
18
|
+
import { ProducerInvoiceService } from '../../services/producer-invoice/producer-invoice.service';
|
|
15
19
|
export declare class EventControlBoardComponent implements OnInit, OnDestroy, OnChanges {
|
|
16
20
|
private readonly translate;
|
|
17
21
|
private readonly formBuilder;
|
|
18
22
|
private readonly websocketService;
|
|
19
|
-
private readonly eventControlBoardService;
|
|
20
23
|
private readonly paginatorStorageService;
|
|
21
24
|
private readonly messageService;
|
|
22
25
|
private readonly dialogService;
|
|
26
|
+
eventControlService: EventControlService;
|
|
27
|
+
eventControlItemService: EventControlItemService;
|
|
28
|
+
transferService: TransferService;
|
|
29
|
+
producerInvoiceService: ProducerInvoiceService;
|
|
30
|
+
fixationService: FixationService;
|
|
23
31
|
company: E070Emp;
|
|
24
32
|
branch: E070Fil;
|
|
25
33
|
controlCode: string[];
|
|
@@ -34,7 +42,7 @@ export declare class EventControlBoardComponent implements OnInit, OnDestroy, On
|
|
|
34
42
|
producerInvoice: any;
|
|
35
43
|
steps: Step[];
|
|
36
44
|
selectedStep: any;
|
|
37
|
-
eventId:
|
|
45
|
+
eventId: '';
|
|
38
46
|
showSidebar: boolean;
|
|
39
47
|
showReprocessButton: boolean;
|
|
40
48
|
sidebarTitle: string;
|
|
@@ -56,7 +64,7 @@ export declare class EventControlBoardComponent implements OnInit, OnDestroy, On
|
|
|
56
64
|
private readonly eventItem;
|
|
57
65
|
private readonly inputFieldsPath;
|
|
58
66
|
private readonly invoiceTypeTranslate;
|
|
59
|
-
constructor(translate: LibTranslationService, formBuilder: FormBuilder, websocketService: WebsocketService,
|
|
67
|
+
constructor(translate: LibTranslationService, formBuilder: FormBuilder, websocketService: WebsocketService, paginatorStorageService: PaginatorStorageService, messageService: MessageService, dialogService: DialogService, eventControlService: EventControlService, eventControlItemService: EventControlItemService, transferService: TransferService, producerInvoiceService: ProducerInvoiceService, fixationService: FixationService);
|
|
60
68
|
ngOnInit(): Promise<void>;
|
|
61
69
|
ngOnChanges(changes: SimpleChanges): void;
|
|
62
70
|
private updateCompanyAndBranchFormFields;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { EventControlBoardComponent } from "./event-control-board.component";
|
|
2
|
-
export { EventControlBoardService } from "./service/event-control-board.service";
|
|
3
1
|
export { SharedModule } from "./shared.module";
|
|
4
2
|
export { EventControlBoardModule } from "./event-control-board.module";
|
|
3
|
+
export { EventControlBoardComponent } from "./event-control-board.component";
|
|
5
4
|
export { EventStepsModule } from "../event-steps/index";
|
|
6
5
|
export { FixationModule } from "./service/fixation-entity/fixation.module";
|
|
7
6
|
export { E001pesModule } from "./service/e001pes/e001pes.module";
|
|
@@ -15,7 +14,6 @@ export { EventControlItemModule } from "./service/event-control-item/event-contr
|
|
|
15
14
|
export { ExternalInvoiceModule } from "./service/external-invoice/external-invoice.module";
|
|
16
15
|
export { InvoiceModule } from "./service/invoice/invoice.module";
|
|
17
16
|
export { OriginationModule } from "./service/origination/origination.module";
|
|
18
|
-
export { ProducerInvoiceModule } from "./service/producer-invoice/producer-invoice.module";
|
|
19
17
|
export { RuralEstateModule } from "./service/rural-estate/rural-estate.module";
|
|
20
18
|
export { TicketModule } from "./service/ticket/ticket.module";
|
|
21
19
|
export { PaginatorStorageService } from "./service/paginator-storage.service";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HttpParams, HttpClient } from
|
|
2
|
-
import { MessageService, SortMeta } from
|
|
3
|
-
import { LibTranslationService } from
|
|
1
|
+
import { HttpParams, HttpClient } from '@angular/common/http';
|
|
2
|
+
import { MessageService, SortMeta } from 'primeng';
|
|
3
|
+
import { LibTranslationService } from '../../../services/lib-translation.service';
|
|
4
4
|
export declare class EntityService<T> {
|
|
5
5
|
protected http: HttpClient;
|
|
6
6
|
protected messageService: MessageService;
|
|
@@ -11,7 +11,7 @@ import { DocumentsToIssue } from "../../common/documentsToIssue";
|
|
|
11
11
|
import { RuralEstateDto } from "../rural-estate/rural-estate-dto";
|
|
12
12
|
import { TicketDto } from "../ticket/ticket-dto";
|
|
13
13
|
import { ExternalInvoiceDto } from "../external-invoice/external-invoice-dto";
|
|
14
|
-
import { ProducerInvoiceDto } from "
|
|
14
|
+
import { ProducerInvoiceDto } from "../../../../services/producer-invoice/producer-invoice-dto";
|
|
15
15
|
import { ControlStatus } from "../../common/control-status";
|
|
16
16
|
export interface OriginationDto {
|
|
17
17
|
id?: string;
|
package/components/index.d.ts
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { IInvoiceLookupResponse } from '../services/agro-invoice/interfaces';
|
|
3
|
+
import { LibTranslationService } from '../../../services/lib-translation.service';
|
|
4
|
+
import { AgroInvoiceService } from '../services/agro-invoice';
|
|
5
|
+
import { Column, LocaleService } from '@seniorsistemas/angular-components';
|
|
6
|
+
import { KilogramPipe } from '../../../pipe/kilogram';
|
|
7
|
+
import { CurrencyPipe } from '@angular/common';
|
|
8
|
+
import { ModalInvoicePjBase } from '../modal-invoice-pj-base.class';
|
|
9
|
+
import { ModalInvoicePjForFixationOptions } from './modal-fixation-options.interface';
|
|
10
|
+
import { ProducerInvoiceService } from '../../../services/producer-invoice/producer-invoice.service';
|
|
11
|
+
import { MessageService } from 'primeng';
|
|
12
|
+
export declare class ModalInvoicePjForFixationComponent extends ModalInvoicePjBase implements OnInit, OnDestroy {
|
|
13
|
+
readonly translationService: LibTranslationService;
|
|
14
|
+
readonly invoiceService: AgroInvoiceService;
|
|
15
|
+
readonly localeService: LocaleService;
|
|
16
|
+
readonly kilogramPipe: KilogramPipe;
|
|
17
|
+
readonly currencyPipe: CurrencyPipe;
|
|
18
|
+
readonly producerInvoiceService: ProducerInvoiceService;
|
|
19
|
+
readonly messageService: MessageService;
|
|
20
|
+
options: ModalInvoicePjForFixationOptions;
|
|
21
|
+
whenSelectInvoices: EventEmitter<any[]>;
|
|
22
|
+
gridColumns: Partial<Column & {
|
|
23
|
+
sortable?: boolean;
|
|
24
|
+
}>[];
|
|
25
|
+
constructor(translationService: LibTranslationService, invoiceService: AgroInvoiceService, localeService: LocaleService, kilogramPipe: KilogramPipe, currencyPipe: CurrencyPipe, producerInvoiceService: ProducerInvoiceService, messageService: MessageService);
|
|
26
|
+
ngOnInit(): void;
|
|
27
|
+
defineGridColumns(): void;
|
|
28
|
+
beforeAdd(selectedInvoices: any[]): Promise<any>;
|
|
29
|
+
open(): void;
|
|
30
|
+
linkSelectedInvoicesInFixationItem(): Promise<void>;
|
|
31
|
+
isValidAndSetLinkedValueInInvoices(): Promise<boolean>;
|
|
32
|
+
adaptResult(result: IInvoiceLookupResponse): Promise<any>;
|
|
33
|
+
cancel(): Promise<void>;
|
|
34
|
+
updateLinkedValueInGrid(rows: number): Promise<void>;
|
|
35
|
+
}
|
package/components/modal-invoice-pj/for-origination/modal-invoice-pj-for-origination.component.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ModalInvoicePjOptions } from '../modal-invoice-pj-options.interface';
|
|
3
|
+
import { Column, LocaleService } from '@seniorsistemas/angular-components';
|
|
4
|
+
import { ModalInvoicePjBase } from '../modal-invoice-pj-base.class';
|
|
5
|
+
import { IInvoiceLookupResponse } from '../services/agro-invoice/interfaces';
|
|
6
|
+
import { KilogramPipe } from '../../../pipe/kilogram';
|
|
7
|
+
import { LibTranslationService } from '../../../services/lib-translation.service';
|
|
8
|
+
import { AgroInvoiceService } from '../services/agro-invoice';
|
|
9
|
+
import { MessageService } from 'primeng';
|
|
10
|
+
export declare class ModalInvoicePjForOriginationComponent extends ModalInvoicePjBase implements OnInit, OnDestroy {
|
|
11
|
+
translate: LibTranslationService;
|
|
12
|
+
invoiceService: AgroInvoiceService;
|
|
13
|
+
localeService: LocaleService;
|
|
14
|
+
kilogramPipe: KilogramPipe;
|
|
15
|
+
messageService: MessageService;
|
|
16
|
+
options: ModalInvoicePjOptions;
|
|
17
|
+
whenSelectInvoices: EventEmitter<any[]>;
|
|
18
|
+
gridColumns: Partial<Column & {
|
|
19
|
+
sortable?: boolean;
|
|
20
|
+
}>[];
|
|
21
|
+
constructor(translate: LibTranslationService, invoiceService: AgroInvoiceService, localeService: LocaleService, kilogramPipe: KilogramPipe, messageService: MessageService);
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
defineGridColumns(): void;
|
|
24
|
+
beforeAdd(selectedInvoices: any): Promise<any>;
|
|
25
|
+
adaptResult(result: IInvoiceLookupResponse): Promise<any>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { ModalInvoicePjOptions } from '../modal-invoice-pj-options.interface';
|
|
3
|
+
import { Column, LocaleService } from '@seniorsistemas/angular-components';
|
|
4
|
+
import { ModalInvoicePjBase } from '../modal-invoice-pj-base.class';
|
|
5
|
+
import { IInvoiceLookupResponse } from '../services/agro-invoice/interfaces';
|
|
6
|
+
import { KilogramPipe } from '../../../pipe/kilogram';
|
|
7
|
+
import { LibTranslationService } from '../../../services/lib-translation.service';
|
|
8
|
+
import { AgroInvoiceService } from '../services/agro-invoice';
|
|
9
|
+
import { MessageService } from 'primeng';
|
|
10
|
+
export declare class ModalInvoicePjForTransferComponent extends ModalInvoicePjBase implements OnInit, OnDestroy {
|
|
11
|
+
translate: LibTranslationService;
|
|
12
|
+
invoiceService: AgroInvoiceService;
|
|
13
|
+
localeService: LocaleService;
|
|
14
|
+
kilogramPipe: KilogramPipe;
|
|
15
|
+
messageService: MessageService;
|
|
16
|
+
options: ModalInvoicePjOptions;
|
|
17
|
+
whenSelectInvoices: EventEmitter<any[]>;
|
|
18
|
+
gridColumns: Partial<Column & {
|
|
19
|
+
sortable?: boolean;
|
|
20
|
+
}>[];
|
|
21
|
+
constructor(translate: LibTranslationService, invoiceService: AgroInvoiceService, localeService: LocaleService, kilogramPipe: KilogramPipe, messageService: MessageService);
|
|
22
|
+
ngOnInit(): void;
|
|
23
|
+
defineGridColumns(): void;
|
|
24
|
+
beforeAdd(selectedInvoices: any): Promise<any>;
|
|
25
|
+
adaptResult(result: IInvoiceLookupResponse): Promise<any>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { ModalInvoicePjForOriginationComponent } from './for-origination/modal-invoice-pj-for-origination.component';
|
|
2
|
+
export { ModalInvoicePjForOriginationModule } from './for-origination/modal-invoice-pj-for-origination.module';
|
|
3
|
+
export { ModalInvoicePjForTransferComponent } from './for-transfer/modal-invoice-pj-for-transfer.component';
|
|
4
|
+
export { ModalInvoicePjForTransferModule } from './for-transfer/modal-invoice-pj-for-transfer.module';
|
|
5
|
+
export { ModalInvoicePjForFixationComponent } from './for-fixation/modal-invoice-pj-for-fixation.component';
|
|
6
|
+
export { ModalInvoicePjForFixationModule } from './for-fixation/modal-invoice-pj-for-fixation.module';
|
|
7
|
+
export { ModalInvoicePjOptions } from './modal-invoice-pj-options.interface';
|
|
8
|
+
export { ModalInvoicePjForFixationOptions } from './for-fixation/modal-fixation-options.interface';
|
|
9
|
+
export { AgroInvoiceModule, AgroInvoiceService } from './services/agro-invoice/index';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { LazyLoadEvent, MessageService } from 'primeng';
|
|
3
|
+
import { Subject } from 'rxjs';
|
|
4
|
+
import { FormControl } from '@angular/forms';
|
|
5
|
+
import { ListParams } from '../../services/entity-service';
|
|
6
|
+
import { AgroInvoiceService } from './services/agro-invoice/agro-invoice.service';
|
|
7
|
+
import { ModalInvoicePjOptions } from './modal-invoice-pj-options.interface';
|
|
8
|
+
import { ButtonPriority, Column, LocaleService } from '@seniorsistemas/angular-components';
|
|
9
|
+
import { LibTranslationService } from '../../services/lib-translation.service';
|
|
10
|
+
import { IInvoiceLookupResponse } from './services/agro-invoice/interfaces';
|
|
11
|
+
import { KilogramPipe } from '../../pipe/kilogram';
|
|
12
|
+
export declare abstract class ModalInvoicePjBase {
|
|
13
|
+
protected readonly translate: LibTranslationService;
|
|
14
|
+
protected readonly invoiceService: AgroInvoiceService;
|
|
15
|
+
protected readonly localeService: LocaleService;
|
|
16
|
+
protected readonly kilogramPipe: KilogramPipe;
|
|
17
|
+
protected readonly messageService: MessageService;
|
|
18
|
+
abstract options: ModalInvoicePjOptions;
|
|
19
|
+
abstract whenSelectInvoices: EventEmitter<any[]>;
|
|
20
|
+
abstract gridColumns: Partial<Column & {
|
|
21
|
+
sortable?: boolean;
|
|
22
|
+
}>[];
|
|
23
|
+
gridData: any[];
|
|
24
|
+
buttonPriority: typeof ButtonPriority;
|
|
25
|
+
dontHaveAnyInvoice: boolean;
|
|
26
|
+
gridLoading: boolean;
|
|
27
|
+
gridTotalRecords: number;
|
|
28
|
+
selected: any[];
|
|
29
|
+
unselectedIds: Set<number>;
|
|
30
|
+
visible: boolean;
|
|
31
|
+
searchValue: FormControl;
|
|
32
|
+
protected readonly ngUnsubscribe: Subject<unknown>;
|
|
33
|
+
protected currentParams: ListParams;
|
|
34
|
+
gridFieldValuesMap: {
|
|
35
|
+
[key: string]: (row: any) => any;
|
|
36
|
+
};
|
|
37
|
+
constructor(translate: LibTranslationService, invoiceService: AgroInvoiceService, localeService: LocaleService, kilogramPipe: KilogramPipe, messageService: MessageService);
|
|
38
|
+
ngOnDestroy(): void;
|
|
39
|
+
ngOnInit(): void;
|
|
40
|
+
abstract adaptResult(result: IInvoiceLookupResponse): Promise<any>;
|
|
41
|
+
abstract beforeAdd(selectedInvoices: any): Promise<any>;
|
|
42
|
+
protected whenSearchValueChanges(): void;
|
|
43
|
+
tryToSearchAgain(): void;
|
|
44
|
+
open(): void;
|
|
45
|
+
protected checkIfOptionsIsValid(): boolean;
|
|
46
|
+
private getPagination;
|
|
47
|
+
updateCurrentParams(event: LazyLoadEvent): void;
|
|
48
|
+
updateGridData(event: LazyLoadEvent, searchValue?: string): void;
|
|
49
|
+
cancelPooling(): void;
|
|
50
|
+
add(): Promise<void>;
|
|
51
|
+
protected resetSpecs(): void;
|
|
52
|
+
cancel(): Promise<void>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LibTranslationModule } from '../../lib-translation.module';
|
|
2
|
+
import { CurrencyPipe, DatePipe, DecimalPipe } from '@angular/common';
|
|
3
|
+
import { LocaleModule, LocalizedDatePipe } from '@seniorsistemas/angular-components';
|
|
4
|
+
import { KilogramPipe } from '../../pipe/kilogram';
|
|
5
|
+
export declare const imports: (typeof LibTranslationModule | (import("@angular/compiler/src/core").ModuleWithProviders & {
|
|
6
|
+
ngModule: LocaleModule;
|
|
7
|
+
}))[];
|
|
8
|
+
export declare const providers: (typeof KilogramPipe | typeof DecimalPipe | typeof CurrencyPipe | typeof DatePipe | typeof LocalizedDatePipe)[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HttpClient } from "@angular/common/http";
|
|
2
|
+
import { MessageService } from "primeng/api";
|
|
3
|
+
import { AgroEntityService } from "../../../../services/entity-service";
|
|
4
|
+
import { LibTranslationService as TranslateService } from "../../../../services/lib-translation.service";
|
|
5
|
+
import { IInvoiceLookupFilter, IInvoiceLookupResponse } from "./interfaces";
|
|
6
|
+
import { Observable } from "rxjs";
|
|
7
|
+
export declare class AgroInvoiceService extends AgroEntityService<any> {
|
|
8
|
+
protected http: HttpClient;
|
|
9
|
+
protected messageService: MessageService;
|
|
10
|
+
protected translate: TranslateService;
|
|
11
|
+
private readonly pooling;
|
|
12
|
+
constructor(http: HttpClient, messageService: MessageService, translate: TranslateService);
|
|
13
|
+
invoiceLookupFilter(data: IInvoiceLookupFilter): Observable<IInvoiceLookupResponse>;
|
|
14
|
+
cancelActivePooling(): void;
|
|
15
|
+
private pollInvoiceResult;
|
|
16
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare enum statusLookup {
|
|
2
|
+
PENDING = "PENDING",
|
|
3
|
+
FINISHED = "FINISHED",
|
|
4
|
+
ERROR = "ERROR"
|
|
5
|
+
}
|
|
6
|
+
export declare enum statusIntegration {
|
|
7
|
+
SUCCESS = "SUCCESS",
|
|
8
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
9
|
+
ERROR = "ERROR"
|
|
10
|
+
}
|
|
11
|
+
export interface IInvoiceLookupFilter {
|
|
12
|
+
filter: IRecInvoiceLookupFilter;
|
|
13
|
+
pageRequest: IRecPageRequest;
|
|
14
|
+
}
|
|
15
|
+
export interface IRecInvoiceLookupFilter {
|
|
16
|
+
companyId: string;
|
|
17
|
+
branchId: string;
|
|
18
|
+
ruralEstateIds: string[];
|
|
19
|
+
producerIds: string[];
|
|
20
|
+
productId: string;
|
|
21
|
+
multiProducts: boolean;
|
|
22
|
+
number?: number;
|
|
23
|
+
series?: string;
|
|
24
|
+
key?: string;
|
|
25
|
+
issuanceDateStart?: string;
|
|
26
|
+
issuanceDateEnd?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IRecPageRequest {
|
|
29
|
+
offset: number;
|
|
30
|
+
size: number;
|
|
31
|
+
orderBy: IOrderBy[];
|
|
32
|
+
}
|
|
33
|
+
export interface IOrderBy {
|
|
34
|
+
field: string;
|
|
35
|
+
order: "asc" | "desc";
|
|
36
|
+
}
|
|
37
|
+
export interface IInvoiceLookupResponse {
|
|
38
|
+
status: statusLookup;
|
|
39
|
+
message: string;
|
|
40
|
+
result: IInvoiceLookupDataResponse;
|
|
41
|
+
}
|
|
42
|
+
export interface IInvoiceLookupRecord {
|
|
43
|
+
externalInvoiceId?: string;
|
|
44
|
+
companyId: string;
|
|
45
|
+
branchId: string;
|
|
46
|
+
producerId: string;
|
|
47
|
+
issuanceDate: string;
|
|
48
|
+
items: IInvoiceLookupItemRecord[];
|
|
49
|
+
invoiceId?: string;
|
|
50
|
+
ruralEstateId?: string;
|
|
51
|
+
number?: number;
|
|
52
|
+
series?: string;
|
|
53
|
+
seriesId?: string;
|
|
54
|
+
seriesLegal?: string;
|
|
55
|
+
key?: string;
|
|
56
|
+
netTotalValue?: number;
|
|
57
|
+
totalItems?: number;
|
|
58
|
+
totalItemsQuantity?: number;
|
|
59
|
+
}
|
|
60
|
+
interface IInvoiceLookupItemRecord {
|
|
61
|
+
itemSequence: number;
|
|
62
|
+
productId: string;
|
|
63
|
+
productCode: string;
|
|
64
|
+
serviceId: string;
|
|
65
|
+
unitPrice: number;
|
|
66
|
+
quantity: number;
|
|
67
|
+
}
|
|
68
|
+
export interface IInvoiceLookupDataResponse {
|
|
69
|
+
totalElements: number;
|
|
70
|
+
status: statusIntegration;
|
|
71
|
+
invoices?: IInvoiceLookupRecord[];
|
|
72
|
+
message?: string;
|
|
73
|
+
lookupId?: string;
|
|
74
|
+
}
|
|
75
|
+
export {};
|
|
@@ -108,5 +108,22 @@ export class AgroNumberUtils {
|
|
|
108
108
|
const factor = Math.pow(AGRO_NUMBERS.TEN, decimals);
|
|
109
109
|
return Math.round(value * factor) / factor;
|
|
110
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* Pega apenas números, convertendo strings para números e retornarndo apenas o maior inteiro encontrado.
|
|
113
|
+
* @param value - O valor a ser processado.
|
|
114
|
+
* @returns O maior número inteiro encontrado ou 0 se nenhum número for encontrado.
|
|
115
|
+
*/
|
|
116
|
+
static getNearInteger(value) {
|
|
117
|
+
if (typeof value === "number") {
|
|
118
|
+
return Math.floor(value);
|
|
119
|
+
}
|
|
120
|
+
if (typeof value === "string") {
|
|
121
|
+
const numbers = value.match(/\d+/g);
|
|
122
|
+
if (numbers && numbers.length > 0) {
|
|
123
|
+
return Math.max(...numbers.map(Number));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
111
128
|
}
|
|
112
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
129
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdyby1udW1iZXItdXRpbHMuY2xhc3MuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2VuaW9yLWFncm9uZWdvY2lvL2FuZ3VsYXItY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImNvbW1vbi9hZ3JvLW51bWJlci11dGlscy5jbGFzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxVQUFVLENBQUM7QUFFeEMsTUFBTSxPQUFPLGVBQWU7SUFDeEI7Ozs7T0FJRztJQUNILE1BQU0sQ0FBQyxpQkFBaUIsQ0FBQyxHQUFRO1FBQzdCLE9BQU8sR0FBRyxLQUFLLElBQUksSUFBSSxHQUFHLEtBQUssU0FBUyxDQUFDO0lBQzdDLENBQUM7SUFFRDs7OztPQUlHO0lBQ0gsTUFBTSxDQUFDLG9CQUFvQixDQUFDLEdBQVE7UUFDaEMsT0FBTyxDQUFDLGVBQWUsQ0FBQyxpQkFBaUIsQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUNuRCxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCxNQUFNLENBQUMsTUFBTSxDQUFDLEtBQWE7UUFDM0IsT0FBTyxLQUFLLEdBQUcsWUFBWSxDQUFDLEdBQUcsS0FBSy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WYgKHR5cGVvZiB2YWx1ZSA9PT0gXCJzdHJpbmdcIikge1xyXG4gICAgICAgICAgICBjb25zdCBudW1iZXJzID0gdmFsdWUubWF0Y2goL1xcZCsvZyk7XHJcbiAgICAgICAgICAgIGlmIChudW1iZXJzICYmIG51bWJlcnMubGVuZ3RoID4gMCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KC4uLm51bWJlcnMubWFwKE51bWJlcikpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICByZXR1cm4gMDtcclxuICAgIH1cclxufVxyXG4iXX0=
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AgroStringUtils } from "./agro-string-utils.class";
|
|
2
|
+
export class AgroObjectStringifier {
|
|
3
|
+
/**
|
|
4
|
+
* Formata um objeto concatenando valores segundo as chaves e pipes informados.
|
|
5
|
+
*
|
|
6
|
+
* @param separator Separador entre os valores (ex: "-")
|
|
7
|
+
* @param fields Campos a extrair. Podem conter subpropriedades ("propriedade.subPropriedade") e pipes ("propriedade|nomeDaPipe:arg1:arg2")
|
|
8
|
+
* @param obj Objeto origem
|
|
9
|
+
*/
|
|
10
|
+
static formatObject(separator, fields, obj, usePipes) {
|
|
11
|
+
function mapField(field) {
|
|
12
|
+
const value = AgroObjectStringifier.resolvePath(obj, field);
|
|
13
|
+
if (usePipes === null || usePipes === void 0 ? void 0 : usePipes.hasOwnProperty(field)) {
|
|
14
|
+
return usePipes[field].transform(value);
|
|
15
|
+
}
|
|
16
|
+
return value !== null && value !== void 0 ? value : "";
|
|
17
|
+
}
|
|
18
|
+
function filterValid(v) {
|
|
19
|
+
return typeof v === "number" || AgroStringUtils.isValid(v);
|
|
20
|
+
}
|
|
21
|
+
return fields.map(mapField).filter(filterValid).join(` ${separator} `);
|
|
22
|
+
}
|
|
23
|
+
/** Resolve um caminho tipo "empresa.cargo" dentro de um objeto */
|
|
24
|
+
static resolvePath(obj, path) {
|
|
25
|
+
function reducer(acc, key) {
|
|
26
|
+
return acc === null || acc === void 0 ? void 0 : acc[key];
|
|
27
|
+
}
|
|
28
|
+
return path.split(".").reduce(reducer, obj);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdyby1vYmplY3Qtc3RyaW5naWZpZXIuY2xhc3MuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9Ac2VuaW9yLWFncm9uZWdvY2lvL2FuZ3VsYXItY29tcG9uZW50cy8iLCJzb3VyY2VzIjpbImNvbW1vbi9hZ3JvLW9iamVjdC1zdHJpbmdpZmllci5jbGFzcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFNNUQsTUFBTSxPQUFPLHFCQUFxQjtJQUM5Qjs7Ozs7O09BTUc7SUFDSCxNQUFNLENBQUMsWUFBWSxDQUFDLFNBQWlCLEVBQUUsTUFBZ0IsRUFBRSxHQUFRLEVBQUUsUUFBbUI7UUFDbEYsU0FBUyxRQUFRLENBQUMsS0FBYTtZQUMzQixNQUFNLEtBQUssR0FBRyxxQkFBcUIsQ0FBQyxXQUFXLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxDQUFDO1lBQzVELElBQUksUUFBUSxhQUFSLFFBQVEsdUJBQVIsUUFBUSxDQUFFLGNBQWMsQ0FBQyxLQUFLLEdBQUc7Z0JBQ2pDLE9BQU8sUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FBQzthQUMzQztZQUNELE9BQU8sS0FBSyxhQUFMLEtBQUssY0FBTCxLQUFLLEdBQUksRUFBRSxDQUFDO1FBQ3ZCLENBQUM7UUFFRCxTQUFTLFdBQVcsQ0FBQyxDQUFrQjtZQUNuQyxPQUFPLE9BQU8sQ0FBQyxL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AgICAgICByZXR1cm4gZmllbGRzLm1hcChtYXBGaWVsZCkuZmlsdGVyKGZpbHRlclZhbGlkKS5qb2luKGAgJHtzZXBhcmF0b3J9IGApO1xyXG4gICAgfVxyXG5cclxuICAgIC8qKiBSZXNvbHZlIHVtIGNhbWluaG8gdGlwbyBcImVtcHJlc2EuY2FyZ29cIiBkZW50cm8gZGUgdW0gb2JqZXRvICovXHJcbiAgICBwcml2YXRlIHN0YXRpYyByZXNvbHZlUGF0aChvYmo6IGFueSwgcGF0aDogc3RyaW5nKTogYW55IHtcclxuICAgICAgICBmdW5jdGlvbiByZWR1Y2VyKGFjYzogYW55LCBrZXk6IHN0cmluZyk6IGFueSB7XHJcbiAgICAgICAgICAgIHJldHVybiBhY2M/LltrZXldO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gcGF0aC5zcGxpdChcIi5cIikucmVkdWNlKHJlZHVjZXIsIG9iaik7XHJcbiAgICB9XHJcbn1cclxuIl19
|