import * as i0 from '@angular/core';
import { EventEmitter, Directive, Input, Output, Pipe, Component, NgModule, Optional, Inject, ChangeDetectionStrategy, ViewChild } from '@angular/core';
import * as i1 from '@aztrix/helpers';
import { fuzzySort, equals, HelperPipesModule, CategoryLabelPipe, METADATA, LANGUAGE_OVERRIDE, CountrySearchPipe, CountryCodeLabelPipe, getLatestLanguage } from '@aztrix/helpers';
import { AgreementStatus, AgreementConfirmation, AgreementVerification } from '@aztrix/models';
import * as i10 from 'rxjs';
import { BehaviorSubject, combineLatest, of, ReplaySubject, distinctUntilChanged as distinctUntilChanged$1, switchMap as switchMap$1, map, shareReplay, startWith as startWith$1 } from 'rxjs';
import * as i1$1 from '@aztrix/sdk';
import * as i2 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i6 from '@angular/forms';
import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
import { startWith, distinctUntilChanged, switchMap, tap, map as map$1 } from 'rxjs/operators';
import * as i3 from '@angular/material/legacy-form-field';
import { MatLegacyFormFieldModule } from '@angular/material/legacy-form-field';
import * as i3$1 from '@angular/material/legacy-select';
import { MatLegacySelectModule, MatLegacySelect } from '@angular/material/legacy-select';
import * as i5 from '@angular/material/legacy-core';
import * as i5$1 from 'ngx-mat-select-search';
import { NgxMatSelectSearchModule } from 'ngx-mat-select-search';
import * as i7 from '@aztrix/components/button';
import { ButtonModule } from '@aztrix/components/button';
import * as i8 from '@aztrix/icons';
import { IconsModule } from '@aztrix/icons';
import * as i9 from '@angular/material/legacy-chips';
import { MatLegacyChipsModule } from '@angular/material/legacy-chips';
import * as i2$1 from '@aztrix/components/row-cell-view';
import { AgreementCellViewModule, GroupCellViewModule, ProposalCellViewModule } from '@aztrix/components/row-cell-view';
import * as i9$1 from '@aztrix/components/clear-button';
import { ClearButtonModule } from '@aztrix/components/clear-button';
import * as i2$2 from '@aztrix/components/property-view';
import { PropertyViewModule } from '@aztrix/components/property-view';

class AbstractSelectSearch {
    constructor() {
        this.multiple = false;
        this.disabled = false;
        this.addNewValue = new EventEmitter();
    }
}
AbstractSelectSearch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AbstractSelectSearch, deps: [], target: i0.ɵɵFactoryTarget.Directive });
AbstractSelectSearch.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: AbstractSelectSearch, inputs: { form: "form", multiple: "multiple", label: "label", canAddNew: "canAddNew", errorsTemplate: "errorsTemplate", disabled: "disabled", valueCallback: "valueCallback" }, outputs: { addNewValue: "addNewValue" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AbstractSelectSearch, decorators: [{
            type: Directive
        }], propDecorators: { form: [{
                type: Input
            }], multiple: [{
                type: Input
            }], label: [{
                type: Input
            }], canAddNew: [{
                type: Input
            }], errorsTemplate: [{
                type: Input
            }], disabled: [{
                type: Input
            }], valueCallback: [{
                type: Input
            }], addNewValue: [{
                type: Output
            }] } });

class ValueByOptionPipe {
    transform(option, valueCallback) {
        if (valueCallback && option) {
            return valueCallback(option);
        }
        else {
            return option;
        }
    }
}
ValueByOptionPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueByOptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
ValueByOptionPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ValueByOptionPipe, name: "valueByOption" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ValueByOptionPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'valueByOption',
                }]
        }] });

class OptionByValuePipe {
    transform(value, options, valueCallback) {
        if (!valueCallback) {
            return value;
        }
        const valueByOptionPipe = new ValueByOptionPipe();
        return (options || []).find((option) => valueByOptionPipe.transform(option, valueCallback) === value);
    }
}
OptionByValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OptionByValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
OptionByValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: OptionByValuePipe, name: "optionByValue" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OptionByValuePipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'optionByValue',
                }]
        }] });

class SelectSearchComponent {
    constructor() {
        this.form = new UntypedFormControl();
        this.multiple = false;
        this.canAddNew = false;
        this.required = false;
        this.appearance = 'outline';
        this.disabled = false;
        this.addNewValue = new EventEmitter();
        this.formFilterControl = new UntypedFormControl('');
        this.options$ = new BehaviorSubject([]);
        this.searchedOptions = [];
        this.searchResults$ = combineLatest([
            this.options$,
            this.formFilterControl.valueChanges.pipe(startWith('')),
        ]).pipe(distinctUntilChanged(), switchMap(([options, query]) => {
            if (this.searchCallback$) {
                return this.searchCallback$(options, query);
            }
            else {
                return of(fuzzySort(options, query, this.keys || []));
            }
        }), tap((options) => {
            var _a;
            if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.length)) {
                this.searchedOptions = options;
                if (!this.searchedOptions.find((o) => {
                    if (this.valueCallback) {
                        return this.valueCallback(o) === this.form.value;
                    }
                    else {
                        return o === this.form.value;
                    }
                })) {
                    this.form.reset();
                }
            }
        }));
    }
    ngOnChanges(changes) {
        if (changes.options && this.options && Array.isArray(this.options)) {
            this.options$.next(this.options);
            this.searchedOptions = this.options;
        }
    }
    removeSelection(value) {
        if (Array.isArray(this.form.value)) {
            const selectedOptions = this.form.value;
            const newOptions = selectedOptions.filter((option) => option !== value);
            this.form.setValue(newOptions);
        }
        else {
            this.form.setValue(undefined);
        }
    }
    clearValue() {
        this.form.setValue(null);
    }
}
SelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
SelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: SelectSearchComponent, selector: "ax-select-search", inputs: { form: "form", options: "options", placeholder: "placeholder", optionTemplate: "optionTemplate", selectedValueTemplate: "selectedValueTemplate", multiple: "multiple", label: "label", keys: "keys", canAddNew: "canAddNew", required: "required", appearance: "appearance", errorsTemplate: "errorsTemplate", prefixTemplate: "prefixTemplate", disabled: "disabled", valueCallback: "valueCallback", searchCallback$: "searchCallback$" }, outputs: { addNewValue: "addNewValue" }, usesOnChanges: true, ngImport: i0, template: "<mat-form-field\n  class=\"c-input\"\n  appearance=\"outline\"\n  [ngClass]=\"{'remove-subtext': !errorsTemplate}\"\n  [appearance]=\"appearance\"\n>\n  <mat-label *ngIf=\"label\">{{ label }}</mat-label>\n  <mat-select\n    [formControl]=\"form\"\n    [placeholder]=\"placeholder\"\n    [multiple]=\"multiple\"\n    [disabled]=\"disabled\"\n  >\n    <mat-select-trigger>\n      <ng-container *ngIf=\"multiple\">\n        <ng-container *ngTemplateOutlet=\"chipsList\"></ng-container>\n      </ng-container>\n      <ng-container *ngIf=\"!multiple\">\n        <ng-container\n          *ngTemplateOutlet=\"\n            selectedValueTemplate;\n            context: {$implicit: form.value | optionByValue: searchedOptions:valueCallback}\n          \"\n        ></ng-container>\n      </ng-container>\n    </mat-select-trigger>\n    <mat-option *ngIf=\"(keys && keys.length) || searchCallback$\">\n      <ngx-mat-select-search\n        [formControl]=\"formFilterControl\"\n        [placeholderLabel]=\"'label.search' | translate\"\n        [noEntriesFoundLabel]=\"'search.results.absence' | translate\"\n      >\n        <ax-icon class=\"icon\" name=\"close\" ngxMatSelectSearchClear></ax-icon>\n      </ngx-mat-select-search>\n    </mat-option>\n    <mat-option *ngIf=\"!required\" [value]=\"null\" (click)=\"removeSelection()\">\n      <div class=\"option-wrapper\">\n        {{ 'label.none' | translate }}\n      </div>\n    </mat-option>\n    <mat-option\n      class=\"add-new\"\n      *ngIf=\"canAddNew\"\n      [disabled]=\"true\"\n      [value]=\"null\"\n      (click)=\"addNewValue.emit()\"\n    >\n      <div class=\"option-wrapper\">\n        <ax-icon class=\"icon\" name=\"plus\"></ax-icon>{{ 'label.add' | translate }}\n      </div>\n    </mat-option>\n    <mat-option\n      *ngFor=\"let result of searchResults$ | async\"\n      [value]=\"result | valueByOption: valueCallback\"\n    >\n      <div class=\"option-wrapper\">\n        <ng-container\n          *ngTemplateOutlet=\"optionTemplate; context: {$implicit: result}\"\n        ></ng-container>\n      </div>\n    </mat-option>\n  </mat-select>\n\n  <button\n    axButton\n    icon-button\n    matSuffix\n    aria-label=\"Clear\"\n    *ngIf=\"form?.value && !disabled\"\n    (click)=\"clearValue()\"\n  >\n    <ax-icon class=\"icon\" name=\"close\"></ax-icon>\n  </button>\n\n  <mat-error>\n    <ng-container *ngTemplateOutlet=\"errorsTemplate\"></ng-container>\n  </mat-error>\n\n  <span matPrefix>\n    <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n  </span>\n</mat-form-field>\n\n<ng-template #chipsList>\n  <mat-chip-list>\n    <mat-chip\n      *ngFor=\"let value of form.value\"\n      [selectable]=\"true\"\n      [removable]=\"true\"\n      (removed)=\"removeSelection(value)\"\n    >\n      <ng-container\n        *ngTemplateOutlet=\"\n          selectedValueTemplate;\n          context: {$implicit: value | optionByValue: searchedOptions:valueCallback}\n        \"\n      ></ng-container>\n      <ax-icon matChipRemove class=\"icon\" name=\"close\"></ax-icon>\n    </mat-chip>\n  </mat-chip-list>\n</ng-template>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}:host ::ng-deep .mat-select-trigger{height:auto;min-height:1.125em}::ng-deep .mat-option.add-new[aria-disabled=true]{cursor:pointer}::ng-deep .mat-option.add-new[aria-disabled=true]:hover{background:rgba(0,0,0,.04);color:var(--font-color)}::ng-deep .add-new .mat-pseudo-checkbox{display:none}::ng-deep .add-new .mat-pseudo-checkbox .mat-option[aria-disabled=true]{cursor:pointer}::ng-deep mat-option.mat-option.mat-active{background:transparent}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.MatLegacyError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatLegacyFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLegacyLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatLegacyPrefix, selector: "[matPrefix]" }, { kind: "directive", type: i3.MatLegacySuffix, selector: "[matSuffix]" }, { kind: "component", type: i3$1.MatLegacySelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "directive", type: i3$1.MatLegacySelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i5.MatLegacyOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5$1.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: i5$1.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i7.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "component", type: i8.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i9.MatLegacyChipList, selector: "mat-chip-list", inputs: ["role", "aria-describedby", "errorStateMatcher", "multiple", "compareWith", "value", "required", "placeholder", "disabled", "aria-orientation", "selectable", "tabIndex"], outputs: ["change", "valueChange"], exportAs: ["matChipList"] }, { kind: "directive", type: i9.MatLegacyChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["color", "disableRipple", "tabIndex", "role", "selected", "value", "selectable", "disabled", "removable"], outputs: ["selectionChange", "destroyed", "removed"], exportAs: ["matChip"] }, { kind: "directive", type: i9.MatLegacyChipRemove, selector: "[matChipRemove]" }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: OptionByValuePipe, name: "optionByValue" }, { kind: "pipe", type: ValueByOptionPipe, name: "valueByOption" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-select-search', template: "<mat-form-field\n  class=\"c-input\"\n  appearance=\"outline\"\n  [ngClass]=\"{'remove-subtext': !errorsTemplate}\"\n  [appearance]=\"appearance\"\n>\n  <mat-label *ngIf=\"label\">{{ label }}</mat-label>\n  <mat-select\n    [formControl]=\"form\"\n    [placeholder]=\"placeholder\"\n    [multiple]=\"multiple\"\n    [disabled]=\"disabled\"\n  >\n    <mat-select-trigger>\n      <ng-container *ngIf=\"multiple\">\n        <ng-container *ngTemplateOutlet=\"chipsList\"></ng-container>\n      </ng-container>\n      <ng-container *ngIf=\"!multiple\">\n        <ng-container\n          *ngTemplateOutlet=\"\n            selectedValueTemplate;\n            context: {$implicit: form.value | optionByValue: searchedOptions:valueCallback}\n          \"\n        ></ng-container>\n      </ng-container>\n    </mat-select-trigger>\n    <mat-option *ngIf=\"(keys && keys.length) || searchCallback$\">\n      <ngx-mat-select-search\n        [formControl]=\"formFilterControl\"\n        [placeholderLabel]=\"'label.search' | translate\"\n        [noEntriesFoundLabel]=\"'search.results.absence' | translate\"\n      >\n        <ax-icon class=\"icon\" name=\"close\" ngxMatSelectSearchClear></ax-icon>\n      </ngx-mat-select-search>\n    </mat-option>\n    <mat-option *ngIf=\"!required\" [value]=\"null\" (click)=\"removeSelection()\">\n      <div class=\"option-wrapper\">\n        {{ 'label.none' | translate }}\n      </div>\n    </mat-option>\n    <mat-option\n      class=\"add-new\"\n      *ngIf=\"canAddNew\"\n      [disabled]=\"true\"\n      [value]=\"null\"\n      (click)=\"addNewValue.emit()\"\n    >\n      <div class=\"option-wrapper\">\n        <ax-icon class=\"icon\" name=\"plus\"></ax-icon>{{ 'label.add' | translate }}\n      </div>\n    </mat-option>\n    <mat-option\n      *ngFor=\"let result of searchResults$ | async\"\n      [value]=\"result | valueByOption: valueCallback\"\n    >\n      <div class=\"option-wrapper\">\n        <ng-container\n          *ngTemplateOutlet=\"optionTemplate; context: {$implicit: result}\"\n        ></ng-container>\n      </div>\n    </mat-option>\n  </mat-select>\n\n  <button\n    axButton\n    icon-button\n    matSuffix\n    aria-label=\"Clear\"\n    *ngIf=\"form?.value && !disabled\"\n    (click)=\"clearValue()\"\n  >\n    <ax-icon class=\"icon\" name=\"close\"></ax-icon>\n  </button>\n\n  <mat-error>\n    <ng-container *ngTemplateOutlet=\"errorsTemplate\"></ng-container>\n  </mat-error>\n\n  <span matPrefix>\n    <ng-container *ngTemplateOutlet=\"prefixTemplate\"></ng-container>\n  </span>\n</mat-form-field>\n\n<ng-template #chipsList>\n  <mat-chip-list>\n    <mat-chip\n      *ngFor=\"let value of form.value\"\n      [selectable]=\"true\"\n      [removable]=\"true\"\n      (removed)=\"removeSelection(value)\"\n    >\n      <ng-container\n        *ngTemplateOutlet=\"\n          selectedValueTemplate;\n          context: {$implicit: value | optionByValue: searchedOptions:valueCallback}\n        \"\n      ></ng-container>\n      <ax-icon matChipRemove class=\"icon\" name=\"close\"></ax-icon>\n    </mat-chip>\n  </mat-chip-list>\n</ng-template>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}:host ::ng-deep .mat-select-trigger{height:auto;min-height:1.125em}::ng-deep .mat-option.add-new[aria-disabled=true]{cursor:pointer}::ng-deep .mat-option.add-new[aria-disabled=true]:hover{background:rgba(0,0,0,.04);color:var(--font-color)}::ng-deep .add-new .mat-pseudo-checkbox{display:none}::ng-deep .add-new .mat-pseudo-checkbox .mat-option[aria-disabled=true]{cursor:pointer}::ng-deep mat-option.mat-option.mat-active{background:transparent}\n"] }]
        }], propDecorators: { form: [{
                type: Input
            }], options: [{
                type: Input
            }], placeholder: [{
                type: Input
            }], optionTemplate: [{
                type: Input
            }], selectedValueTemplate: [{
                type: Input
            }], multiple: [{
                type: Input
            }], label: [{
                type: Input
            }], keys: [{
                type: Input
            }], canAddNew: [{
                type: Input
            }], required: [{
                type: Input
            }], appearance: [{
                type: Input
            }], errorsTemplate: [{
                type: Input
            }], prefixTemplate: [{
                type: Input
            }], disabled: [{
                type: Input
            }], valueCallback: [{
                type: Input
            }], searchCallback$: [{
                type: Input
            }], addNewValue: [{
                type: Output
            }] } });

class ProposalByIdPipe {
    transform(proposals, proposalId) {
        return proposals.find((p) => p.id === proposalId);
    }
}
ProposalByIdPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalByIdPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
ProposalByIdPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ProposalByIdPipe, name: "proposalById" });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalByIdPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'proposalById',
                }]
        }] });

class AgreementSelectSearchComponent extends AbstractSelectSearch {
    constructor(_proposalsService) {
        super();
        this._proposalsService = _proposalsService;
        this._proposals$ = new ReplaySubject(1);
        this.searchCallback$ = (_options, query) => {
            return this._proposals$.pipe(distinctUntilChanged$1((p1, p2) => equals(p1, p2)), switchMap$1((proposals) => {
                const searchOptions = {
                    agreementStatus: AgreementStatus.AGREEMENTSTATUS_UNDEFINED,
                    agreementConfirmation: AgreementConfirmation.AGREEMENTCONFIRMATION_UNDEFINED,
                    agreementVerification: AgreementVerification.AGREEMENTVERIFICATION_UNDEFINED,
                    limit: 20,
                    query: query,
                };
                let observable = this._proposalsService.searchAgreements(searchOptions);
                if (proposals.length === 1) {
                    observable = this._proposalsService.searchAgreementsOfProposal(proposals[0].id, searchOptions);
                }
                return observable.pipe(map((result) => result.results));
            }), shareReplay(1));
        };
    }
    ngOnChanges(changes) {
        if (changes.proposals && this.proposals) {
            this._proposals$.next(this.proposals);
        }
    }
}
AgreementSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AgreementSelectSearchComponent, deps: [{ token: i1$1.ProposalsService }], target: i0.ɵɵFactoryTarget.Component });
AgreementSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: AgreementSelectSearchComponent, selector: "ax-agreement-select-search", inputs: { proposals: "proposals" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-template #option let-result>\n  <ax-agreement-cell-view\n    *ngIf=\"result\"\n    [agreement]=\"result\"\n    [proposal]=\"proposals | proposalById: result.proposalId\"\n  >\n    <div class=\"status\" *ngIf=\"result.agreementData?.confirmed\">\n      <span>\n        {{ result.active ? ('agreement.active' | translate) : ('agreement.expired' | translate) }}\n      </span>\n      <div class=\"status-indicator\" [ngClass]=\"{'is-expired': result.expirationTimestamp}\"></div>\n    </div>\n    <div class=\"status\" *ngIf=\"!result.agreementData?.confirmed\">\n      <span>{{ 'agreement.status.not-confirmed' | translate }}</span>\n      <div class=\"status-indicator is-pending\"></div>\n    </div>\n  </ax-agreement-cell-view>\n</ng-template>\n\n<ng-template #selectedViewTemplate let-result>\n  <ax-agreement-cell-view\n    class=\"selected\"\n    *ngIf=\"result\"\n    [agreement]=\"result\"\n    [noAvatar]=\"true\"\n    [proposal]=\"proposals | proposalById: result.proposalId\"\n  ></ax-agreement-cell-view>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [placeholder]=\"(multiple ? 'label.agreements' : 'label.agreement') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [searchCallback$]=\"searchCallback$\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.agreements' : 'label.agreement') | translate)\"\n></ax-select-search>\n", styles: [".status{display:flex;align-items:center}.status-indicator{background-color:var(--primary-color-500);width:8px;height:8px;border-radius:6px;margin:0 6px}.status-indicator.is-pending{background-color:#e67e22}.status-indicator.is-expired{background-color:var(--warn-color-500)}.selected{height:38px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "component", type: i2$1.AgreementCellViewComponent, selector: "ax-agreement-cell-view", inputs: ["proposal", "agreement", "noAvatar"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: ProposalByIdPipe, name: "proposalById" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AgreementSelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-agreement-select-search', template: "<ng-template #option let-result>\n  <ax-agreement-cell-view\n    *ngIf=\"result\"\n    [agreement]=\"result\"\n    [proposal]=\"proposals | proposalById: result.proposalId\"\n  >\n    <div class=\"status\" *ngIf=\"result.agreementData?.confirmed\">\n      <span>\n        {{ result.active ? ('agreement.active' | translate) : ('agreement.expired' | translate) }}\n      </span>\n      <div class=\"status-indicator\" [ngClass]=\"{'is-expired': result.expirationTimestamp}\"></div>\n    </div>\n    <div class=\"status\" *ngIf=\"!result.agreementData?.confirmed\">\n      <span>{{ 'agreement.status.not-confirmed' | translate }}</span>\n      <div class=\"status-indicator is-pending\"></div>\n    </div>\n  </ax-agreement-cell-view>\n</ng-template>\n\n<ng-template #selectedViewTemplate let-result>\n  <ax-agreement-cell-view\n    class=\"selected\"\n    *ngIf=\"result\"\n    [agreement]=\"result\"\n    [noAvatar]=\"true\"\n    [proposal]=\"proposals | proposalById: result.proposalId\"\n  ></ax-agreement-cell-view>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [placeholder]=\"(multiple ? 'label.agreements' : 'label.agreement') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [searchCallback$]=\"searchCallback$\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.agreements' : 'label.agreement') | translate)\"\n></ax-select-search>\n", styles: [".status{display:flex;align-items:center}.status-indicator{background-color:var(--primary-color-500);width:8px;height:8px;border-radius:6px;margin:0 6px}.status-indicator.is-pending{background-color:#e67e22}.status-indicator.is-expired{background-color:var(--warn-color-500)}.selected{height:38px}\n"] }]
        }], ctorParameters: function () { return [{ type: i1$1.ProposalsService }]; }, propDecorators: { proposals: [{
                type: Input
            }] } });

class SelectSearchModule {
}
SelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
SelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: SelectSearchModule, declarations: [SelectSearchComponent, OptionByValuePipe, ValueByOptionPipe], imports: [CommonModule,
        MatLegacyFormFieldModule,
        MatLegacySelectModule,
        NgxMatSelectSearchModule,
        ReactiveFormsModule,
        HelperPipesModule,
        ButtonModule,
        IconsModule,
        MatLegacyChipsModule,
        ButtonModule], exports: [SelectSearchComponent] });
SelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectSearchModule, imports: [CommonModule,
        MatLegacyFormFieldModule,
        MatLegacySelectModule,
        NgxMatSelectSearchModule,
        ReactiveFormsModule,
        HelperPipesModule,
        ButtonModule,
        IconsModule,
        MatLegacyChipsModule,
        ButtonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: SelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [SelectSearchComponent, OptionByValuePipe, ValueByOptionPipe],
                    imports: [
                        CommonModule,
                        MatLegacyFormFieldModule,
                        MatLegacySelectModule,
                        NgxMatSelectSearchModule,
                        ReactiveFormsModule,
                        HelperPipesModule,
                        ButtonModule,
                        IconsModule,
                        MatLegacyChipsModule,
                        ButtonModule,
                    ],
                    exports: [SelectSearchComponent],
                }]
        }] });

class AgreementSelectSearchModule {
}
AgreementSelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AgreementSelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
AgreementSelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: AgreementSelectSearchModule, declarations: [AgreementSelectSearchComponent, ProposalByIdPipe], imports: [CommonModule, SelectSearchModule, HelperPipesModule, AgreementCellViewModule], exports: [AgreementSelectSearchComponent] });
AgreementSelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AgreementSelectSearchModule, imports: [CommonModule, SelectSearchModule, HelperPipesModule, AgreementCellViewModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AgreementSelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [AgreementSelectSearchComponent, ProposalByIdPipe],
                    imports: [CommonModule, SelectSearchModule, HelperPipesModule, AgreementCellViewModule],
                    exports: [AgreementSelectSearchComponent],
                }]
        }] });

class CategorySelectSearchComponent {
    constructor(_translate, _changeDetector, _languageOverride$ = null) {
        this._translate = _translate;
        this._changeDetector = _changeDetector;
        this._languageOverride$ = _languageOverride$;
        this.form = new UntypedFormControl();
        this.forProperty = false;
        this.required = false;
        this.formFilterControl = new UntypedFormControl('');
        this._categoryPipe = new CategoryLabelPipe(this._translate, this._changeDetector, this._languageOverride$);
        this._categories = ['ALL'].concat(METADATA.categories);
        this.categoryResults$ = this.formFilterControl.valueChanges.pipe(startWith$1(this.formFilterControl.value.toLowerCase()), map((query) => this._categories
            .filter((category) => this._categoryPipe.transform(category).toLowerCase().includes(query.toLowerCase()))
            .filter((category) => category !== 'ALL')));
    }
}
CategorySelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CategorySelectSearchComponent, deps: [{ token: i1.TranslateService }, { token: i0.ChangeDetectorRef }, { token: LANGUAGE_OVERRIDE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
CategorySelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: CategorySelectSearchComponent, selector: "ax-category-select-search", inputs: { form: "form", forProperty: "forProperty", hint: "hint", label: "label", required: "required" }, ngImport: i0, template: "<mat-form-field\n  [appearance]=\"forProperty ? 'outline' : 'standard'\"\n  [ngClass]=\"{'c-input': forProperty}\"\n  style=\"width: 100%\"\n>\n  <mat-label *ngIf=\"forProperty\">\n    <span *ngIf=\"label\">{{ label }}<span *ngIf=\"required\">*</span></span>\n  </mat-label>\n  <mat-select\n    disableOptionCentering\n    [placeholder]=\"'label.category' | translate\"\n    [formControl]=\"form\"\n  >\n    <mat-option>\n      <ngx-mat-select-search\n        [formControl]=\"formFilterControl\"\n        [placeholderLabel]=\"'label.search' | translate\"\n        [noEntriesFoundLabel]=\"'search.results.absence' | translate\"\n        class=\"select-search\"\n      >\n        <ax-icon class=\"icon\" name=\"close\" ngxMatSelectSearchClear></ax-icon>\n      </ngx-mat-select-search>\n    </mat-option>\n    <mat-option\n      *ngFor=\"let category of categoryResults$ | async\"\n      [value]=\"category === 'ALL' ? undefined : category\"\n    >\n      <div class=\"option-wrapper\">\n        <ax-icon class=\"icon\" [name]=\"category | categoryIcon\"></ax-icon>\n        <span>{{ category | categoryLabel }}</span>\n      </div>\n    </mat-option>\n  </mat-select>\n  <mat-hint *ngIf=\"hint\" align=\"end\">\n    <span>{{ hint }}</span>\n  </mat-hint>\n  <mat-error>\n    <ax-icon name=\"alert-circle\"></ax-icon>\n    {{\n      'property.validation.required'\n        | translate: {propertyType: 'property.CATEGORY.label' | translate}\n    }}\n  </mat-error>\n  <ax-clear-button *ngIf=\"forProperty && form.value\" [form]=\"form\" matSuffix></ax-clear-button>\n</mat-form-field>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.MatLegacyError, selector: "mat-error", inputs: ["id"] }, { kind: "component", type: i3.MatLegacyFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLegacyHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatLegacyLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatLegacySuffix, selector: "[matSuffix]" }, { kind: "component", type: i3$1.MatLegacySelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatLegacyOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i8.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i5$1.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: i5$1.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i9$1.ClearButtonComponent, selector: "ax-clear-button", inputs: ["form"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.CategoryIconPipe, name: "categoryIcon" }, { kind: "pipe", type: i1.CategoryLabelPipe, name: "categoryLabel" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CategorySelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-category-select-search', template: "<mat-form-field\n  [appearance]=\"forProperty ? 'outline' : 'standard'\"\n  [ngClass]=\"{'c-input': forProperty}\"\n  style=\"width: 100%\"\n>\n  <mat-label *ngIf=\"forProperty\">\n    <span *ngIf=\"label\">{{ label }}<span *ngIf=\"required\">*</span></span>\n  </mat-label>\n  <mat-select\n    disableOptionCentering\n    [placeholder]=\"'label.category' | translate\"\n    [formControl]=\"form\"\n  >\n    <mat-option>\n      <ngx-mat-select-search\n        [formControl]=\"formFilterControl\"\n        [placeholderLabel]=\"'label.search' | translate\"\n        [noEntriesFoundLabel]=\"'search.results.absence' | translate\"\n        class=\"select-search\"\n      >\n        <ax-icon class=\"icon\" name=\"close\" ngxMatSelectSearchClear></ax-icon>\n      </ngx-mat-select-search>\n    </mat-option>\n    <mat-option\n      *ngFor=\"let category of categoryResults$ | async\"\n      [value]=\"category === 'ALL' ? undefined : category\"\n    >\n      <div class=\"option-wrapper\">\n        <ax-icon class=\"icon\" [name]=\"category | categoryIcon\"></ax-icon>\n        <span>{{ category | categoryLabel }}</span>\n      </div>\n    </mat-option>\n  </mat-select>\n  <mat-hint *ngIf=\"hint\" align=\"end\">\n    <span>{{ hint }}</span>\n  </mat-hint>\n  <mat-error>\n    <ax-icon name=\"alert-circle\"></ax-icon>\n    {{\n      'property.validation.required'\n        | translate: {propertyType: 'property.CATEGORY.label' | translate}\n    }}\n  </mat-error>\n  <ax-clear-button *ngIf=\"forProperty && form.value\" [form]=\"form\" matSuffix></ax-clear-button>\n</mat-form-field>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}\n"] }]
        }], ctorParameters: function () {
        return [{ type: i1.TranslateService }, { type: i0.ChangeDetectorRef }, { type: i10.BehaviorSubject, decorators: [{
                        type: Optional
                    }, {
                        type: Inject,
                        args: [LANGUAGE_OVERRIDE]
                    }] }];
    }, propDecorators: { form: [{
                type: Input
            }], forProperty: [{
                type: Input
            }], hint: [{
                type: Input
            }], label: [{
                type: Input
            }], required: [{
                type: Input
            }] } });

class CategorySelectSearchModule {
}
CategorySelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CategorySelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
CategorySelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: CategorySelectSearchModule, declarations: [CategorySelectSearchComponent], imports: [CommonModule,
        MatLegacySelectModule,
        MatLegacyFormFieldModule,
        IconsModule,
        NgxMatSelectSearchModule,
        ReactiveFormsModule,
        HelperPipesModule,
        ClearButtonModule], exports: [CategorySelectSearchComponent] });
CategorySelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CategorySelectSearchModule, imports: [CommonModule,
        MatLegacySelectModule,
        MatLegacyFormFieldModule,
        IconsModule,
        NgxMatSelectSearchModule,
        ReactiveFormsModule,
        HelperPipesModule,
        ClearButtonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CategorySelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [CategorySelectSearchComponent],
                    imports: [
                        CommonModule,
                        MatLegacySelectModule,
                        MatLegacyFormFieldModule,
                        IconsModule,
                        NgxMatSelectSearchModule,
                        ReactiveFormsModule,
                        HelperPipesModule,
                        ClearButtonModule,
                    ],
                    exports: [CategorySelectSearchComponent],
                }]
        }] });

class CountrySelectSearchComponent {
    constructor(_translate, _changeDetector) {
        this._translate = _translate;
        this._changeDetector = _changeDetector;
        this.form = new UntypedFormControl();
        this.appearance = 'outline';
        this._countrySearchPipe = new CountrySearchPipe(this._translate, this._changeDetector);
        this.countryCodes$ = this._translate.events$.pipe(startWith$1(undefined), map(() => CountrySearchPipe.allCountryCodeRepsSorted(this._translate, true)));
        this.searchCallback$ = (options, query) => {
            const searchOptions = options.map((countryCode) => ({
                code: countryCode.countryCode,
                label: this._translate.instant(CountryCodeLabelPipe.countryCodeLabel(countryCode.countryCode)),
            }));
            return of(fuzzySort(searchOptions, query, ['code', 'label']).map((result) => options.find((option) => option.countryCode === result.code)));
        };
    }
    valueCallback(value) {
        return value === null || value === void 0 ? void 0 : value.countryCode;
    }
    searchCallback(options, query) {
        return of(this._countrySearchPipe.transform(query, true, options.map((o) => o.countryCode)));
    }
}
CountrySelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CountrySelectSearchComponent, deps: [{ token: i1.TranslateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
CountrySelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: CountrySelectSearchComponent, selector: "ax-country-select-search", inputs: { label: "label", placeholder: "placeholder", form: "form", prefixIcon: "prefixIcon", appearance: "appearance" }, ngImport: i0, template: "<ng-template #option let-result>\n  <div class=\"option-wrapper\">\n    <ax-icon class=\"icon\" [name]=\"'flags:' + (result?.countryCode || 'world')\"></ax-icon>\n    <span>{{ result?.countryCode | countryCodeLabel }}</span>\n  </div>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"countryCodes$ | async\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"option\"\n  [valueCallback]=\"valueCallback\"\n  [appearance]=\"appearance\"\n  [searchCallback$]=\"searchCallback$\"\n  [label]=\"label\"\n  [placeholder]=\"placeholder\"\n></ax-select-search>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}.selected{margin-left:1rem}.option-wrapper .icon{padding-top:.2rem}\n"], dependencies: [{ kind: "component", type: SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "component", type: i8.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.CountryCodeLabelPipe, name: "countryCodeLabel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CountrySelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-country-select-search', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #option let-result>\n  <div class=\"option-wrapper\">\n    <ax-icon class=\"icon\" [name]=\"'flags:' + (result?.countryCode || 'world')\"></ax-icon>\n    <span>{{ result?.countryCode | countryCodeLabel }}</span>\n  </div>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"countryCodes$ | async\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"option\"\n  [valueCallback]=\"valueCallback\"\n  [appearance]=\"appearance\"\n  [searchCallback$]=\"searchCallback$\"\n  [label]=\"label\"\n  [placeholder]=\"placeholder\"\n></ax-select-search>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}.selected{margin-left:1rem}.option-wrapper .icon{padding-top:.2rem}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.TranslateService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { label: [{
                type: Input
            }], placeholder: [{
                type: Input
            }], form: [{
                type: Input
            }], prefixIcon: [{
                type: Input
            }], appearance: [{
                type: Input
            }] } });

class CountrySelectSearchModule {
}
CountrySelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CountrySelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
CountrySelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: CountrySelectSearchModule, declarations: [CountrySelectSearchComponent], imports: [CommonModule, SelectSearchModule, HelperPipesModule, IconsModule], exports: [CountrySelectSearchComponent] });
CountrySelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CountrySelectSearchModule, imports: [CommonModule, SelectSearchModule, HelperPipesModule, IconsModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: CountrySelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [CountrySelectSearchComponent],
                    imports: [CommonModule, SelectSearchModule, HelperPipesModule, IconsModule],
                    exports: [CountrySelectSearchComponent],
                }]
        }] });

class GroupSelectSearchComponent extends AbstractSelectSearch {
}
GroupSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GroupSelectSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
GroupSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: GroupSelectSearchComponent, selector: "ax-group-select-search", inputs: { groups: "groups" }, usesInheritance: true, ngImport: i0, template: "<ng-template #option let-result>\n  <ax-group-cell-view [group]=\"result\"></ax-group-cell-view>\n</ng-template>\n<ng-template #selectedViewTemplate let-result>\n  <span>\n    {{ result | displayName }}\n  </span>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"groups\"\n  [placeholder]=\"(multiple ? 'label.groups' : 'label.group') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [keys]=\"['name']\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.groups' : 'label.group') | translate)\"\n></ax-select-search>\n", dependencies: [{ kind: "component", type: SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "component", type: i2$1.GroupCellViewComponent, selector: "ax-group-cell-view", inputs: ["group"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.DisplayNamePipe, name: "displayName" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GroupSelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-group-select-search', template: "<ng-template #option let-result>\n  <ax-group-cell-view [group]=\"result\"></ax-group-cell-view>\n</ng-template>\n<ng-template #selectedViewTemplate let-result>\n  <span>\n    {{ result | displayName }}\n  </span>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"groups\"\n  [placeholder]=\"(multiple ? 'label.groups' : 'label.group') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [keys]=\"['name']\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.groups' : 'label.group') | translate)\"\n></ax-select-search>\n" }]
        }], propDecorators: { groups: [{
                type: Input
            }] } });

class GroupSelectSearchModule {
}
GroupSelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GroupSelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
GroupSelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: GroupSelectSearchModule, declarations: [GroupSelectSearchComponent], imports: [SelectSearchModule, GroupCellViewModule, HelperPipesModule], exports: [GroupSelectSearchComponent] });
GroupSelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GroupSelectSearchModule, imports: [SelectSearchModule, GroupCellViewModule, HelperPipesModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: GroupSelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [GroupSelectSearchComponent],
                    imports: [SelectSearchModule, GroupCellViewModule, HelperPipesModule],
                    exports: [GroupSelectSearchComponent],
                }]
        }] });

class LanguageSelectSearchComponent {
    constructor(_translate) {
        this._translate = _translate;
        this.form = new UntypedFormControl();
        this.openedChange = new EventEmitter();
        this.formFilterControl = new UntypedFormControl('');
        this.opened = false;
        this.languages = this._languages();
        this.searchResults$ = this.formFilterControl.valueChanges.pipe(startWith(''), map$1((query) => fuzzySort(this.languages, query, ['label'])));
    }
    openChanged(event) {
        this.opened = event;
        this.openedChange.emit(this.opened);
    }
    _languages(exclude = []) {
        return this._translate
            .getLangs()
            .filter((lang) => !exclude.includes(lang))
            .map((languageCode) => ({
            languageCode,
            label: this._translate.instant(`languageCode.${languageCode}.label`),
        }));
    }
}
LanguageSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LanguageSelectSearchComponent, deps: [{ token: i1.TranslateService }], target: i0.ɵɵFactoryTarget.Component });
LanguageSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: LanguageSelectSearchComponent, selector: "ax-language-select-search", inputs: { form: "form" }, outputs: { openedChange: "openedChange" }, viewQueries: [{ propertyName: "select", first: true, predicate: MatLegacySelect, descendants: true, static: true }], ngImport: i0, template: "<mat-form-field appearance=\"standard\" style=\"width: 100%\">\n  <mat-select\n    [formControl]=\"form\"\n    [placeholder]=\"form.value ? '' : ('label.language' | translate)\"\n    (openedChange)=\"openChanged($event)\"\n  >\n    <mat-option>\n      <ngx-mat-select-search\n        [formControl]=\"formFilterControl\"\n        [placeholderLabel]=\"'label.search' | translate\"\n        [noEntriesFoundLabel]=\"'search.results.absence' | translate\"\n      >\n        <ax-icon class=\"icon\" name=\"close\" ngxMatSelectSearchClear></ax-icon>\n      </ngx-mat-select-search>\n    </mat-option>\n    <mat-option\n      *ngFor=\"let result of searchResults$ | async | slice: 0:(opened ? undefined : 5)\"\n      [value]=\"result.languageCode\"\n    >\n      <div class=\"option-wrapper\">\n        <ax-icon class=\"icon\" [name]=\"result.languageCode\"></ax-icon>\n        <span>{{ result.languageCode | languageCodeLabel }}</span>\n      </div>\n    </mat-option>\n  </mat-select>\n</mat-form-field>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i3.MatLegacyFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i3$1.MatLegacySelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatLegacyOption, selector: "mat-option", exportAs: ["matOption"] }, { kind: "component", type: i5$1.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti"], outputs: ["toggleAll"] }, { kind: "directive", type: i5$1.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: i8.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.SlicePipe, name: "slice" }, { kind: "pipe", type: i1.LanguageCodeLabelPipe, name: "languageCodeLabel" }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LanguageSelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-language-select-search', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-form-field appearance=\"standard\" style=\"width: 100%\">\n  <mat-select\n    [formControl]=\"form\"\n    [placeholder]=\"form.value ? '' : ('label.language' | translate)\"\n    (openedChange)=\"openChanged($event)\"\n  >\n    <mat-option>\n      <ngx-mat-select-search\n        [formControl]=\"formFilterControl\"\n        [placeholderLabel]=\"'label.search' | translate\"\n        [noEntriesFoundLabel]=\"'search.results.absence' | translate\"\n      >\n        <ax-icon class=\"icon\" name=\"close\" ngxMatSelectSearchClear></ax-icon>\n      </ngx-mat-select-search>\n    </mat-option>\n    <mat-option\n      *ngFor=\"let result of searchResults$ | async | slice: 0:(opened ? undefined : 5)\"\n      [value]=\"result.languageCode\"\n    >\n      <div class=\"option-wrapper\">\n        <ax-icon class=\"icon\" [name]=\"result.languageCode\"></ax-icon>\n        <span>{{ result.languageCode | languageCodeLabel }}</span>\n      </div>\n    </mat-option>\n  </mat-select>\n</mat-form-field>\n", styles: [":host{width:100%}::ng-deep .mat-select-panel-wrap .mat-select-panel{max-width:180px}.icon{width:1rem;height:1rem}.option-wrapper{display:flex;align-items:center;width:100%;gap:.5rem}.option-wrapper .icon{vertical-align:middle}.option-wrapper span{max-width:100%;white-space:normal;line-height:1.2}ngx-mat-select-search.mat-select-search-inside-mat-option ::ng-deep .mat-icon-button.mat-select-search-clear{width:2em;height:2em;top:10px}ngx-mat-select-search.mat-select-search-inside-mat-option .icon,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon{width:100%;height:100%;display:flex;color:#363f48;justify-content:center;align-items:center}ngx-mat-select-search.mat-select-search-inside-mat-option .icon ::ng-deep svg,ngx-mat-select-search.mat-select-search-inside-mat-option span.mat-button-wrapper .icon ::ng-deep svg{width:1em;height:1em}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.TranslateService }]; }, propDecorators: { form: [{
                type: Input
            }], openedChange: [{
                type: Output
            }], select: [{
                type: ViewChild,
                args: [MatLegacySelect, { static: true }]
            }] } });

class LanguageSelectSearchModule {
}
LanguageSelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LanguageSelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
LanguageSelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: LanguageSelectSearchModule, declarations: [LanguageSelectSearchComponent], imports: [CommonModule,
        MatLegacyFormFieldModule,
        MatLegacySelectModule,
        NgxMatSelectSearchModule,
        ReactiveFormsModule,
        IconsModule,
        HelperPipesModule], exports: [LanguageSelectSearchComponent] });
LanguageSelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LanguageSelectSearchModule, imports: [CommonModule,
        MatLegacyFormFieldModule,
        MatLegacySelectModule,
        NgxMatSelectSearchModule,
        ReactiveFormsModule,
        IconsModule,
        HelperPipesModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: LanguageSelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [LanguageSelectSearchComponent],
                    imports: [
                        CommonModule,
                        MatLegacyFormFieldModule,
                        MatLegacySelectModule,
                        NgxMatSelectSearchModule,
                        ReactiveFormsModule,
                        IconsModule,
                        HelperPipesModule,
                    ],
                    exports: [LanguageSelectSearchComponent],
                }]
        }] });

class ProductSelectSearchComponent extends AbstractSelectSearch {
}
ProductSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProductSelectSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
ProductSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ProductSelectSearchComponent, selector: "ax-product-select-search", inputs: { products: "products" }, usesInheritance: true, ngImport: i0, template: "<ng-template #option let-result>\n  {{ result?.name }}\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"products\"\n  [placeholder]=\"'label.product' | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"option\"\n  [multiple]=\"multiple\"\n  [keys]=\"['name']\"\n  [valueCallback]=\"valueCallback\"\n  [disabled]=\"disabled\"\n  [label]=\"label ? label : ('label.product' | translate)\"\n></ax-select-search>\n", styles: [""], dependencies: [{ kind: "component", type: SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProductSelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-product-select-search', template: "<ng-template #option let-result>\n  {{ result?.name }}\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"products\"\n  [placeholder]=\"'label.product' | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"option\"\n  [multiple]=\"multiple\"\n  [keys]=\"['name']\"\n  [valueCallback]=\"valueCallback\"\n  [disabled]=\"disabled\"\n  [label]=\"label ? label : ('label.product' | translate)\"\n></ax-select-search>\n" }]
        }], propDecorators: { products: [{
                type: Input
            }] } });

class ProductSelectSearchModule {
}
ProductSelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProductSelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
ProductSelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ProductSelectSearchModule, declarations: [ProductSelectSearchComponent], imports: [CommonModule, SelectSearchModule, HelperPipesModule], exports: [ProductSelectSearchComponent] });
ProductSelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProductSelectSearchModule, imports: [CommonModule, SelectSearchModule, HelperPipesModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProductSelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [ProductSelectSearchComponent],
                    imports: [CommonModule, SelectSearchModule, HelperPipesModule],
                    exports: [ProductSelectSearchComponent],
                }]
        }] });

class PropertySelectSearchComponent extends AbstractSelectSearch {
}
PropertySelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: PropertySelectSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
PropertySelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: PropertySelectSearchComponent, selector: "ax-property-select-search", inputs: { properties: "properties", placeholder: "placeholder" }, usesInheritance: true, ngImport: i0, template: "<ng-template #option let-result>\n  <ax-property-value-view [property]=\"result\"></ax-property-value-view>\n  <ax-icon *ngIf=\"result?.visibility === 'PRIVATE'\" class=\"icon\" name=\"eye-off\"></ax-icon>\n</ng-template>\n<ng-template #selectedViewTemplate let-result>\n  <ax-property-value-view [property]=\"result\"></ax-property-value-view>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"properties\"\n  [placeholder]=\"\n    placeholder && placeholder !== ''\n      ? placeholder\n      : ((multiple ? 'label.properties' : 'label.property') | translate)\n  \"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [valueCallback]=\"valueCallback\"\n  [canAddNew]=\"canAddNew\"\n  [label]=\"label ? label : ((multiple ? 'label.properties' : 'label.property') | translate)\"\n></ax-select-search>\n", styles: [".icon{margin-left:auto;width:1rem;height:1rem}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.PropertyValueViewComponent, selector: "ax-property-value-view", inputs: ["property", "showVerificationLabel", "clickable", "isIndividual", "params"] }, { kind: "component", type: SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "component", type: i8.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: PropertySelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-property-select-search', template: "<ng-template #option let-result>\n  <ax-property-value-view [property]=\"result\"></ax-property-value-view>\n  <ax-icon *ngIf=\"result?.visibility === 'PRIVATE'\" class=\"icon\" name=\"eye-off\"></ax-icon>\n</ng-template>\n<ng-template #selectedViewTemplate let-result>\n  <ax-property-value-view [property]=\"result\"></ax-property-value-view>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"properties\"\n  [placeholder]=\"\n    placeholder && placeholder !== ''\n      ? placeholder\n      : ((multiple ? 'label.properties' : 'label.property') | translate)\n  \"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selectedViewTemplate\"\n  [multiple]=\"multiple\"\n  [valueCallback]=\"valueCallback\"\n  [canAddNew]=\"canAddNew\"\n  [label]=\"label ? label : ((multiple ? 'label.properties' : 'label.property') | translate)\"\n></ax-select-search>\n", styles: [".icon{margin-left:auto;width:1rem;height:1rem}\n"] }]
        }], propDecorators: { properties: [{
                type: Input
            }], placeholder: [{
                type: Input
            }] } });

class PropertySelectSearchModule {
}
PropertySelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: PropertySelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
PropertySelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: PropertySelectSearchModule, declarations: [PropertySelectSearchComponent], imports: [CommonModule, HelperPipesModule, PropertyViewModule, SelectSearchModule, IconsModule], exports: [PropertySelectSearchComponent] });
PropertySelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: PropertySelectSearchModule, imports: [CommonModule, HelperPipesModule, PropertyViewModule, SelectSearchModule, IconsModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: PropertySelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [PropertySelectSearchComponent],
                    imports: [CommonModule, HelperPipesModule, PropertyViewModule, SelectSearchModule, IconsModule],
                    exports: [PropertySelectSearchComponent],
                }]
        }] });

class ProposalSelectSearchComponent extends AbstractSelectSearch {
    constructor() {
        super(...arguments);
        this.searchCallback$ = (options, query) => {
            const searchOptions = options.map((proposal) => {
                var _a;
                return ({
                    id: proposal.id,
                    name: (_a = getLatestLanguage(proposal, this.languageCode)) === null || _a === void 0 ? void 0 : _a.name,
                });
            });
            return of(fuzzySort(searchOptions, query, ['name']).map((result) => options.find((option) => option.id === result.id)));
        };
    }
}
ProposalSelectSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalSelectSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
ProposalSelectSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: ProposalSelectSearchComponent, selector: "ax-proposal-select-search", inputs: { proposals: "proposals", languageCode: "languageCode" }, usesInheritance: true, ngImport: i0, template: "<ng-template #option let-result>\n  <ax-proposal-cell-view [proposal]=\"result\"></ax-proposal-cell-view>\n</ng-template>\n\n<ng-template #selected let-result>\n  <span>\n    {{ result | displayName }}\n  </span>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"proposals\"\n  [placeholder]=\"(multiple ? 'label.proposals' : 'label.proposal') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selected\"\n  [multiple]=\"multiple\"\n  [searchCallback$]=\"searchCallback$\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.proposals' : 'label.proposal') | translate)\"\n></ax-select-search>\n", dependencies: [{ kind: "component", type: SelectSearchComponent, selector: "ax-select-search", inputs: ["form", "options", "placeholder", "optionTemplate", "selectedValueTemplate", "multiple", "label", "keys", "canAddNew", "required", "appearance", "errorsTemplate", "prefixTemplate", "disabled", "valueCallback", "searchCallback$"], outputs: ["addNewValue"] }, { kind: "component", type: i2$1.ProposalCellViewComponent, selector: "ax-proposal-cell-view", inputs: ["proposal", "languageCode"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "pipe", type: i1.DisplayNamePipe, name: "displayName" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalSelectSearchComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-proposal-select-search', template: "<ng-template #option let-result>\n  <ax-proposal-cell-view [proposal]=\"result\"></ax-proposal-cell-view>\n</ng-template>\n\n<ng-template #selected let-result>\n  <span>\n    {{ result | displayName }}\n  </span>\n</ng-template>\n\n<ax-select-search\n  [form]=\"form\"\n  [options]=\"proposals\"\n  [placeholder]=\"(multiple ? 'label.proposals' : 'label.proposal') | translate\"\n  [optionTemplate]=\"option\"\n  [selectedValueTemplate]=\"selected\"\n  [multiple]=\"multiple\"\n  [searchCallback$]=\"searchCallback$\"\n  [valueCallback]=\"valueCallback\"\n  [label]=\"label ? label : ((multiple ? 'label.proposals' : 'label.proposal') | translate)\"\n></ax-select-search>\n" }]
        }], propDecorators: { proposals: [{
                type: Input
            }], languageCode: [{
                type: Input
            }] } });

class ProposalSelectSearchModule {
}
ProposalSelectSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalSelectSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
ProposalSelectSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: ProposalSelectSearchModule, declarations: [ProposalSelectSearchComponent], imports: [SelectSearchModule, ProposalCellViewModule, HelperPipesModule], exports: [ProposalSelectSearchComponent] });
ProposalSelectSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalSelectSearchModule, imports: [SelectSearchModule, ProposalCellViewModule, HelperPipesModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: ProposalSelectSearchModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [ProposalSelectSearchComponent],
                    imports: [SelectSearchModule, ProposalCellViewModule, HelperPipesModule],
                    exports: [ProposalSelectSearchComponent],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { AbstractSelectSearch, AgreementSelectSearchComponent, AgreementSelectSearchModule, CategorySelectSearchComponent, CategorySelectSearchModule, CountrySelectSearchComponent, CountrySelectSearchModule, GroupSelectSearchComponent, GroupSelectSearchModule, LanguageSelectSearchComponent, LanguageSelectSearchModule, ProductSelectSearchComponent, ProductSelectSearchModule, PropertySelectSearchComponent, PropertySelectSearchModule, ProposalSelectSearchComponent, ProposalSelectSearchModule, SelectSearchComponent, SelectSearchModule };
//# sourceMappingURL=aztrix-components-select-search.mjs.map
