"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProductIconThemesContributionPoint = void 0;
const tslib_1 = require("tslib");
const di_1 = require("@opensumi/di");
const ide_core_common_1 = require("@opensumi/ide-core-common");
const ide_theme_1 = require("@opensumi/ide-theme");
const common_1 = require("../../../common");
const types_1 = require("../../types");
let ProductIconThemesContributionPoint = class ProductIconThemesContributionPoint extends common_1.VSCodeContributePoint {
    contribute() {
        for (const contrib of this.contributesMap) {
            const { extensionId, contributes } = contrib;
            const themes = contributes.map((t) => ({
                ...t,
                label: this.getLocalizeFromNlsJSON(t.label, extensionId),
                extensionId,
            }));
            const extension = this.extensionManageService.getExtensionInstanceByExtId(extensionId);
            if (extension) {
                this.productIconService.registerProductIconThemes(themes, ide_core_common_1.URI.from(extension.uri));
            }
        }
    }
};
exports.ProductIconThemesContributionPoint = ProductIconThemesContributionPoint;
tslib_1.__decorate([
    (0, di_1.Autowired)(ide_theme_1.IProductIconService),
    tslib_1.__metadata("design:type", Object)
], ProductIconThemesContributionPoint.prototype, "productIconService", void 0);
tslib_1.__decorate([
    (0, di_1.Autowired)(types_1.AbstractExtInstanceManagementService),
    tslib_1.__metadata("design:type", types_1.AbstractExtInstanceManagementService)
], ProductIconThemesContributionPoint.prototype, "extensionManageService", void 0);
exports.ProductIconThemesContributionPoint = ProductIconThemesContributionPoint = tslib_1.__decorate([
    (0, di_1.Injectable)(),
    (0, common_1.Contributes)('productIconThemes'),
    (0, common_1.LifeCycle)(2 /* LifeCyclePhase.Initialize */)
], ProductIconThemesContributionPoint);
//# sourceMappingURL=productIconTheme.js.map