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 ShippingMethodTestResultComponent {
    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: ShippingMethodTestResultComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.2", type: ShippingMethodTestResultComponent, selector: "vdr-shipping-method-test-result", inputs: { testResult: "testResult", okToRun: "okToRun", testDataUpdated: "testDataUpdated", currencyCode: "currencyCode" }, outputs: { runTest: "runTest" }, ngImport: i0, template: "<div\n    class=\"test-result card\"\n    [ngClass]=\"{\n        success: testResult?.eligible === true,\n        error: testResult?.eligible === false,\n        unknown: !testResult\n    }\"\n>\n    <div class=\"card-header\">\n        {{ 'settings.test-result' | translate }}\n    </div>\n    <div class=\"card-block\">\n        <div class=\"result-details\" [class.stale]=\"testDataUpdated\">\n            <vdr-labeled-data [label]=\"'settings.eligible' | translate\">\n                <div class=\"eligible-icon\">\n                    <clr-icon\n                        shape=\"success-standard\"\n                        class=\"is-solid success\"\n                        *ngIf=\"testResult?.eligible\"\n                    ></clr-icon>\n                    <clr-icon\n                        shape=\"ban\"\n                        class=\"is-solid error\"\n                        *ngIf=\"testResult?.eligible === false\"\n                    ></clr-icon>\n                    <clr-icon shape=\"unknown-status\" *ngIf=\"!testResult\"></clr-icon>\n                </div>\n                {{ testResult?.eligible }}\n            </vdr-labeled-data>\n            <div class=\"price-row\">\n                <vdr-labeled-data\n                    [label]=\"'common.price' | translate\"\n                    *ngIf=\"testResult?.quote?.price != null\"\n                >\n                    {{ testResult.quote?.price | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n                <vdr-labeled-data\n                    [label]=\"'common.price-with-tax' | translate\"\n                    *ngIf=\"testResult?.quote?.priceWithTax != null\"\n                >\n                    {{ testResult.quote?.priceWithTax | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n            </div>\n            <vdr-object-tree\n                *ngIf=\"testResult?.quote?.metadata\"\n                [value]=\"testResult?.quote?.metadata\"\n            ></vdr-object-tree>\n        </div>\n    </div>\n    <div class=\"card-footer\">\n        <button class=\"btn btn-secondary\" (click)=\"runTest.emit()\" [disabled]=\"!okToRun\">\n            {{ 'settings.test-shipping-method' | translate }}\n        </button>\n    </div>\n</div>\n", styles: [":host{display:block}.test-result.success .card-block{background-color:var(--color-success-100)}.test-result.error .card-block{background-color:var(--color-error-100)}.test-result.unknown .card-block{background-color:var(--color-component-bg-100)}.result-details{transition:opacity .2s}.result-details.stale{opacity:.5}.eligible-icon{display:inline-block}.eligible-icon .success{color:var(--color-success-500)}.eligible-icon .error{color:var(--color-error-500)}.price-row{display:flex}.price-row>*:not(:first-child){margin-inline-start:24px}\n"], dependencies: [{ kind: "directive", type: i1.ClrIconCustomTag, selector: "clr-icon" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: "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: ShippingMethodTestResultComponent, decorators: [{
            type: Component,
            args: [{ selector: 'vdr-shipping-method-test-result', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n    class=\"test-result card\"\n    [ngClass]=\"{\n        success: testResult?.eligible === true,\n        error: testResult?.eligible === false,\n        unknown: !testResult\n    }\"\n>\n    <div class=\"card-header\">\n        {{ 'settings.test-result' | translate }}\n    </div>\n    <div class=\"card-block\">\n        <div class=\"result-details\" [class.stale]=\"testDataUpdated\">\n            <vdr-labeled-data [label]=\"'settings.eligible' | translate\">\n                <div class=\"eligible-icon\">\n                    <clr-icon\n                        shape=\"success-standard\"\n                        class=\"is-solid success\"\n                        *ngIf=\"testResult?.eligible\"\n                    ></clr-icon>\n                    <clr-icon\n                        shape=\"ban\"\n                        class=\"is-solid error\"\n                        *ngIf=\"testResult?.eligible === false\"\n                    ></clr-icon>\n                    <clr-icon shape=\"unknown-status\" *ngIf=\"!testResult\"></clr-icon>\n                </div>\n                {{ testResult?.eligible }}\n            </vdr-labeled-data>\n            <div class=\"price-row\">\n                <vdr-labeled-data\n                    [label]=\"'common.price' | translate\"\n                    *ngIf=\"testResult?.quote?.price != null\"\n                >\n                    {{ testResult.quote?.price | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n                <vdr-labeled-data\n                    [label]=\"'common.price-with-tax' | translate\"\n                    *ngIf=\"testResult?.quote?.priceWithTax != null\"\n                >\n                    {{ testResult.quote?.priceWithTax | localeCurrency: currencyCode }}\n                </vdr-labeled-data>\n            </div>\n            <vdr-object-tree\n                *ngIf=\"testResult?.quote?.metadata\"\n                [value]=\"testResult?.quote?.metadata\"\n            ></vdr-object-tree>\n        </div>\n    </div>\n    <div class=\"card-footer\">\n        <button class=\"btn btn-secondary\" (click)=\"runTest.emit()\" [disabled]=\"!okToRun\">\n            {{ 'settings.test-shipping-method' | translate }}\n        </button>\n    </div>\n</div>\n", styles: [":host{display:block}.test-result.success .card-block{background-color:var(--color-success-100)}.test-result.error .card-block{background-color:var(--color-error-100)}.test-result.unknown .card-block{background-color:var(--color-component-bg-100)}.result-details{transition:opacity .2s}.result-details.stale{opacity:.5}.eligible-icon{display:inline-block}.eligible-icon .success{color:var(--color-success-500)}.eligible-icon .error{color:var(--color-error-500)}.price-row{display:flex}.price-row>*:not(:first-child){margin-inline-start:24px}\n"] }]
        }], propDecorators: { testResult: [{
                type: Input
            }], okToRun: [{
                type: Input
            }], testDataUpdated: [{
                type: Input
            }], currencyCode: [{
                type: Input
            }], runTest: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 