import { __decorate, __metadata } from "tslib";
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { Product } from '../shared/product';
import { Addon } from '@vendasta/core/shared';
var AddonDetailsComponent = /** @class */ (function () {
    function AddonDetailsComponent() {
        this.hasVerifiedContract = false;
        this.loaded = true;
        this.showPricing = true;
        this.showEnableAddon = false;
        this.actionEnabled = false;
        this.prerequisiteSelected = new EventEmitter();
        this.actionSelected = new EventEmitter();
    }
    AddonDetailsComponent.prototype.onPrerequisiteSelected = function () {
        this.prerequisiteSelected.emit();
    };
    AddonDetailsComponent.prototype.onActionSelected = function () {
        this.actionSelected.emit();
    };
    AddonDetailsComponent.prototype.getPricing = function (product, addon) {
        return {
            currency: product.currency,
            prices: [
                {
                    price: addon.price,
                    frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
                }
            ]
        };
    };
    Object.defineProperty(AddonDetailsComponent.prototype, "pricingLabel", {
        get: function () {
            return this.reseller ? 'Wholesale Pricing' : 'Pricing';
        },
        enumerable: true,
        configurable: true
    });
    __decorate([
        Input(),
        __metadata("design:type", Product)
    ], AddonDetailsComponent.prototype, "product", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Addon)
    ], AddonDetailsComponent.prototype, "addon", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Boolean)
    ], AddonDetailsComponent.prototype, "reseller", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "billedProduct", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "hasVerifiedContract", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "loaded", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "showPricing", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "showEnableAddon", void 0);
    __decorate([
        Input(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "actionEnabled", void 0);
    __decorate([
        Output(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "prerequisiteSelected", void 0);
    __decorate([
        Output(),
        __metadata("design:type", Object)
    ], AddonDetailsComponent.prototype, "actionSelected", void 0);
    AddonDetailsComponent = __decorate([
        Component({
            selector: 'addon-details',
            template: "<div class=\"addon-page\">\n  <va-header-container [iconUrl]=\"addon.icon\"\n                       [title]=\"addon.title\"\n                       [tagline]=\"addon.tagline\"\n                       [chipLabels]=\"product.getLmiCategoryNames()\"\n                       [pricing]=\"getPricing(product, addon)\"\n                       [pricingLabel]=\"pricingLabel\"\n                       [prerequisiteLabel]=\"product.name\"\n                       [billedProduct]=\"billedProduct\"\n                       [hasVerifiedContract]=\"hasVerifiedContract\"\n                       [loaded]=\"loaded\"\n                       [showPricing]=\"showPricing\"\n                       [actionLabel]=\"'Enable Add-on'\"\n                       [showEnableAddon]=\"showEnableAddon\"\n                       (actionSelected)=\"onActionSelected()\"\n                       (prerequisiteSelected)=\"onPrerequisiteSelected()\">\n  </va-header-container>\n\n  <div class=\"addon-details addon-content\">\n    <ng-container *ngIf=\"reseller\">\n      <div class=\"left-column\">\n        <div *ngIf=\"addon.resellerMarketing?.description || addon.resellerMarketing?.keySellingPoints\">\n          <va-selling-info [description]=\"addon.resellerMarketing?.description\"\n                           [keySellingPoints]=\"addon.resellerMarketing?.keySellingPoints\"></va-selling-info>\n        </div>\n        <section *ngIf=\"addon.resellerMarketing?.faqs?.length > 0 && addon.resellerMarketing?.faqs[0].question\">\n          <h2 class=\"va-addon-title\">FAQs</h2>\n          <va-faqs [faqs]=\"addon.resellerMarketing?.faqs\"></va-faqs>\n        </section>\n      </div>\n      <div class=\"right-column\">\n        <section *ngIf=\"addon.restrictions?.country?.whitelist\">\n          <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n        </section>\n        <section *ngIf=\"addon.screenshots?.length > 0\">\n          <h2 class=\"va-addon-title\">Gallery</h2>\n          <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n        </section>\n        <section *ngIf=\"addon.resellerMarketing?.files?.length > 0\">\n        <h2 class=\"va-addon-title\">Files</h2>\n        <va-files [files]=\"addon.resellerMarketingFiles\"></va-files>\n        </section>\n      </div>\n    </ng-container>\n\n    <ng-container *ngIf=\"!reseller\">\n      <div class=\"left-column\">\n        <div *ngIf=\"addon.endUserMarketing?.description || addon.endUserMarketing?.keySellingPoints\">\n          <va-selling-info [description]=\"addon.endUserMarketing?.description\"\n                           [keySellingPoints]=\"addon.endUserMarketing?.keySellingPoints\"></va-selling-info>\n        </div>\n        <section *ngIf=\"addon.endUserMarketing?.faqs?.length > 0 && addon.endUserMarketing?.faqs[0].question\">\n          <h2 class=\"va-addon-title\">FAQs</h2>\n          <va-faqs [faqs]=\"addon.endUserMarketing?.faqs\"></va-faqs>\n        </section>\n      </div>\n\n      <div class=\"right-column\">\n        <section *ngIf=\"addon.restrictions?.country?.whitelist?.length > 0\">\n          <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n        </section>\n        <section *ngIf=\"addon.screenshots?.length > 0\">\n          <h2 class=\"va-addon-title\">Gallery</h2>\n          <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n        </section>\n        <section *ngIf=\"addon.endUserMarketing?.files?.length > 0\">\n        <h2 class=\"va-addon-title\">Files</h2>\n        <va-files [files]=\"addon.endUserMarketingFiles\"></va-files>\n        </section>\n      </div>\n    </ng-container>\n  </div>\n\n</div>\n",
            styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-addon-title{font-size:32px;font-weight:300;margin-top:0;color:#212121}@media screen and (min-width:600px){.va-addon-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.addon-page{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px;color:#212121}.addon-page .item-amount{color:#999;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.addon-content{display:flex}@media screen and (max-width:600px){.right-column{width:100%}.addon-content{flex-direction:column}}"]
        })
    ], AddonDetailsComponent);
    return AddonDetailsComponent;
}());
export { AddonDetailsComponent };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRkb24tZGV0YWlscy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdmVuZGFzdGEvc3RvcmUvIiwic291cmNlcyI6WyJsaWIvYWRkb24tZGV0YWlscy9hZGRvbi1kZXRhaWxzLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUN2RSxPQUFPLEVBQUUsT0FBTyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDNUMsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBUzlDO0lBQUE7UUFLVyx3QkFBbUIsR0FBRyxLQUFLLENBQUM7UUFDNUIsV0FBTSxHQUFHLElBQUksQ0FBQztRQUNkLGdCQUFXLEdBQUcsSUFBSSxDQUFDO1FBQ25CLG9CQUFlLEdBQUcsS0FBSyxDQUFDO1FBQ3hCLGtCQUFhLEdBQUcsS0FBSyxDQUFDO1FBQ3JCLHlCQUFvQixHQUFHLElBQUksWUFBWSxFQUFFLENBQUM7UUFDMUMsbUJBQWMsR0FBRyxJQUFJLFlBQVksRUFBRSxDQUFDO0lBd0JoRCxDQUFDO0lBdEJDLHNEQUFzQixHQUF0QjtRQUNFLElBQUksQ0FBQyxvQkFBb0IsQ0FBQyxJQUFJLEVBQUUsQ0FBQztJQUNuQyxDQUFDO0lBQ0QsZ0RBQWdCLEdBQWhCO1FBQ0UsSU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