import { ChangeDetectionStrategy, Component } from '@angular/core';
import { AddressFormats, subPropertyOfType } from '@aztrix/helpers';
import { AbstractPropertyValueViewComponent } from '../../abstract-property-value-view.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/tooltip";
import * as i3 from "@aztrix/helpers";
import * as i4 from "@aztrix/translate";
export class AddressValueViewComponent extends AbstractPropertyValueViewComponent {
    get addressLineProperties() {
        return (AddressFormats.addressFormatForProperty(this.property).map((line) => line
            .map((lineInfo) => subPropertyOfType(this.property, lineInfo.propertyType))
            .filter((prop) => !!prop)));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressValueViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: AddressValueViewComponent, selector: "ax-address-value-view", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"property | propertyHasValue; else empty\">\n  <div class=\"c-card__property\" *ngFor=\"let line of addressLineProperties; let first = first\">\n    <ng-container *ngIf=\"line | propertyDisplayValue as addressLine\">\n      <span>{{ addressLine }}</span>\n      <span\n        *ngIf=\"first && verificationColor()\"\n        [ngClass]=\"verificationColor()\"\n        matTooltip=\"{{ parentProperty || property | propertyVerificationLabel }}\"\n      ></span>\n    </ng-container>\n  </div>\n</div>\n\n<ng-template #empty>\n  {{ 'property.value.empty' | translate }}\n</ng-template>\n", styles: [".property-value{font-size:16px;font-weight:700}\n", ""], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i3.PropertyDisplayValuePipe, name: "propertyDisplayValue" }, { kind: "pipe", type: i3.PropertyVerificationLabelPipe, name: "propertyVerificationLabel" }, { kind: "pipe", type: i3.PropertyHasValuePipe, name: "propertyHasValue" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AddressValueViewComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-address-value-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"property | propertyHasValue; else empty\">\n  <div class=\"c-card__property\" *ngFor=\"let line of addressLineProperties; let first = first\">\n    <ng-container *ngIf=\"line | propertyDisplayValue as addressLine\">\n      <span>{{ addressLine }}</span>\n      <span\n        *ngIf=\"first && verificationColor()\"\n        [ngClass]=\"verificationColor()\"\n        matTooltip=\"{{ parentProperty || property | propertyVerificationLabel }}\"\n      ></span>\n    </ng-container>\n  </div>\n</div>\n\n<ng-template #empty>\n  {{ 'property.value.empty' | translate }}\n</ng-template>\n", styles: [".property-value{font-size:16px;font-weight:700}\n"] }]
        }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkcmVzcy12YWx1ZS12aWV3LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29tcG9uZW50cy9wcm9wZXJ0eS12aWV3L2NvbW11bmljYXRpb24tdmFsdWUtdmlldy9hZGRyZXNzLXZhbHVlLXZpZXcvYWRkcmVzcy12YWx1ZS12aWV3LmNvbXBvbmVudC50cyIsIi4uLy4u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