import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@clr/angular";
import * as i2 from "@angular/common";
import * as i3 from "@vendure/admin-ui/core";
import * as i4 from "@ngx-translate/core";
export class ShippingEligibilityTestResultComponent {
    constructor() {
        this.okToRun = false;
        this.testDataUpdated = false;
        this.runTest = new EventEmitter();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ShippingEligibilityTestResultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ShippingEligibilityTestResultComponent, selector: "vdr-shipping-eligibility-test-result", inputs: { testResult: "testResult", okToRun: "okToRun", testDataUpdated: "testDataUpdated", currencyCode: "currencyCode" }, outputs: { runTest: "runTest" }, ngImport: i0, template: "<vdr-card class=\"test-result\" [title]=\"'settings.test-result' | translate\">\n    <div class=\"card-span\" *ngFor=\"let quote of testResult\">\n        <div class=\"result-details\" [class.stale]=\"testDataUpdated\">\n            <vdr-labeled-data [label]=\"'settings.shipping-method' | translate\">\n                {{ quote.name }}\n            </vdr-labeled-data>\n            <div class=\"price-row\">\n                <vdr-labeled-data [label]=\"'common.price' | translate\">\n                    {{ quote.price | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n                <vdr-labeled-data [label]=\"'common.price-with-tax' | translate\">\n                    {{ quote.priceWithTax | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n            </div>\n            <vdr-object-tree *ngIf=\"quote.metadata\" [value]=\"quote.metadata\"></vdr-object-tree>\n        </div>\n    </div>\n    <div class=\"card-span\" *ngIf=\"testResult?.length === 0\">\n        <clr-icon shape=\"ban\" class=\"is-solid error\"></clr-icon>\n        {{ 'settings.no-eligible-shipping-methods' | translate }}\n    </div>\n    <div class=\"card-footer\">\n        <button class=\"btn btn-secondary\" (click)=\"runTest.emit()\" [disabled]=\"!okToRun\">\n            {{ 'settings.test-shipping-methods' | translate }}\n        </button>\n    </div>\n</vdr-card>\n", styles: [":host{display:block}.result-details{transition:opacity .2s}.result-details.stale{opacity:.5}.price-row{display:flex}.price-row>*:not(:first-child){margin-inline-start:24px}clr-icon.error{color:var(--color-error-500)}\n"], dependencies: [{ kind: "directive", type: i1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.LabeledDataComponent, selector: "vdr-labeled-data", inputs: ["label"] }, { kind: "component", type: i3.ObjectTreeComponent, selector: "vdr-object-tree", inputs: ["value", "isArrayItem"] }, { kind: "component", type: i3.CardComponent, selector: "vdr-card", inputs: ["title", "paddingX"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i3.LocaleCurrencyPipe, name: "localeCurrency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.2", ngImport: i0, type: ShippingEligibilityTestResultComponent, decorators: [{
            type: Component,
            args: [{ selector: 'vdr-shipping-eligibility-test-result', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vdr-card class=\"test-result\" [title]=\"'settings.test-result' | translate\">\n    <div class=\"card-span\" *ngFor=\"let quote of testResult\">\n        <div class=\"result-details\" [class.stale]=\"testDataUpdated\">\n            <vdr-labeled-data [label]=\"'settings.shipping-method' | translate\">\n                {{ quote.name }}\n            </vdr-labeled-data>\n            <div class=\"price-row\">\n                <vdr-labeled-data [label]=\"'common.price' | translate\">\n                    {{ quote.price | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n                <vdr-labeled-data [label]=\"'common.price-with-tax' | translate\">\n                    {{ quote.priceWithTax | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n            </div>\n            <vdr-object-tree *ngIf=\"quote.metadata\" [value]=\"quote.metadata\"></vdr-object-tree>\n        </div>\n    </div>\n    <div class=\"card-span\" *ngIf=\"testResult?.length === 0\">\n        <clr-icon shape=\"ban\" class=\"is-solid error\"></clr-icon>\n        {{ 'settings.no-eligible-shipping-methods' | translate }}\n    </div>\n    <div class=\"card-footer\">\n        <button class=\"btn btn-secondary\" (click)=\"runTest.emit()\" [disabled]=\"!okToRun\">\n            {{ 'settings.test-shipping-methods' | translate }}\n        </button>\n    </div>\n</vdr-card>\n", styles: [":host{display:block}.result-details{transition:opacity .2s}.result-details.stale{opacity:.5}.price-row{display:flex}.price-row>*:not(:first-child){margin-inline-start:24px}clr-icon.error{color:var(--color-error-500)}\n"] }]
        }], propDecorators: { testResult: [{
                type: Input
            }], okToRun: [{
                type: Input
            }], testDataUpdated: [{
                type: Input
            }], currencyCode: [{
                type: Input
            }], runTest: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hpcHBpbmctZWxpZ2liaWxpdHktdGVzdC1yZXN1bHQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL2xpYi9zZXR0aW5ncy9zcmMvY29tcG9uZW50cy9zaGlwcGluZy1lbGlnaWJpbGl0eS10ZXN0LXJlc3VsdC9zaGlwcGluZy1lbGlnaWJpbGl0eS10ZXN0LXJlc3VsdC5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi9zcmMvbGliL3NldHRpbmdzL3NyYy9jb21wb25lbnRzL3NoaXBwaW5nLWVsaWdpYmlsaXR5LXRlc3QtcmVzdWx0L3NoaXBwaW5nLWVsaWdpYmlsaXR5LXRlc3QtcmVzdWx0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRS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