import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { CurrencyCode } from '@ishop/admin-ui/core';
export class ShippingMethodTestResultComponent {
    constructor() {
        this.okToRun = false;
        this.testDataUpdated = false;
        this.runTest = new EventEmitter();
    }
}
ShippingMethodTestResultComponent.decorators = [
    { type: Component, args: [{
                selector: 'vdr-shipping-method-test-result',
                template: "<div\r\n    class=\"test-result card\"\r\n    [ngClass]=\"{\r\n        success: testResult?.eligible === true,\r\n        error: testResult?.eligible === false,\r\n        unknown: !testResult\r\n    }\"\r\n>\r\n    <div class=\"card-header\">\r\n        {{ 'settings.test-result' | translate }}\r\n    </div>\r\n    <div class=\"card-block\">\r\n        <div class=\"result-details\" [class.stale]=\"testDataUpdated\">\r\n            <vdr-labeled-data [label]=\"'settings.eligible' | translate\">\r\n                <div class=\"eligible-icon\">\r\n                    <clr-icon\r\n                        shape=\"success-standard\"\r\n                        class=\"is-solid success\"\r\n                        *ngIf=\"testResult?.eligible\"\r\n                    ></clr-icon>\r\n                    <clr-icon\r\n                        shape=\"ban\"\r\n                        class=\"is-solid error\"\r\n                        *ngIf=\"testResult?.eligible === false\"\r\n                    ></clr-icon>\r\n                    <clr-icon shape=\"unknown-status\" *ngIf=\"!testResult\"></clr-icon>\r\n                </div>\r\n                {{ testResult?.eligible }}\r\n            </vdr-labeled-data>\r\n            <div class=\"price-row\">\r\n                <vdr-labeled-data\r\n                    [label]=\"'common.price' | translate\"\r\n                    *ngIf=\"testResult?.quote?.price != null\"\r\n                >\r\n                    {{ testResult.quote?.price | localeCurrency: currencyCode }}\r\n                </vdr-labeled-data>\r\n                <vdr-labeled-data\r\n                    [label]=\"'common.price-with-tax' | translate\"\r\n                    *ngIf=\"testResult?.quote?.priceWithTax != null\"\r\n                >\r\n                    {{ testResult.quote?.priceWithTax | localeCurrency: currencyCode }}\r\n                </vdr-labeled-data>\r\n            </div>\r\n            <vdr-object-tree\r\n                *ngIf=\"testResult?.quote?.metadata\"\r\n                [value]=\"testResult?.quote?.metadata\"\r\n            ></vdr-object-tree>\r\n        </div>\r\n    </div>\r\n    <div class=\"card-footer\">\r\n        <button class=\"btn btn-secondary\" (click)=\"runTest.emit()\" [disabled]=\"!okToRun\">\r\n            {{ 'settings.test-shipping-method' | translate }}\r\n        </button>\r\n    </div>\r\n</div>\r\n",
                changeDetection: ChangeDetectionStrategy.OnPush,
                styles: [".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-left:24px}"]
            },] }
];
ShippingMethodTestResultComponent.propDecorators = {
    testResult: [{ type: Input }],
    okToRun: [{ type: Input }],
    testDataUpdated: [{ type: Input }],
    currencyCode: [{ type: Input }],
    runTest: [{ type: Output }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hpcHBpbmctbWV0aG9kLXRlc3QtcmVzdWx0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvc2V0dGluZ3Mvc3JjL2NvbXBvbmVudHMvc2hpcHBpbmctbWV0aG9kLXRlc3QtcmVzdWx0L3NoaXBwaW5nLW1ldGhvZC10ZXN0LXJlc3VsdC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUVoRyxPQUFPLEVBQUUsWUFBWSxFQUE0QixNQUFNLHNCQUFzQixDQUFDO0FBUTlFLE1BQU0sT0FBTyxp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