"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const util_1 = require("../util");
function AboutPageAdapter(input, page) {
    const { accessor, configGenerator } = input;
    if (!page.items) {
        page.items = [];
    }
    const developerName = accessor.value('developerName', 'string', '');
    if (developerName) {
        page.items.push({
            title: 'Developer',
            value: developerName
        });
    }
    const appDescription = accessor.value('appDescription', 'string', '');
    if (appDescription) {
        page.items.push({
            title: 'About us',
            value: appDescription
        });
    }
    const appVersion = util_1.readAsBoolean(accessor, 'showAppVersion');
    if (appVersion) {
        page.items.push({
            title: 'Version',
            value: '{{ environment.version }}'
        });
    }
    // to avoid empty About page we add version if there is nothing
    if (page.items.length === 0) {
        page.items.push({
            title: 'Version',
            value: '{{ environment.version }}'
        });
    }
    page = configGenerator.about(undefined, page);
    configGenerator.addMenuForPage(page);
    return page;
}
exports.default = AboutPageAdapter;
//# sourceMappingURL=AboutPageAdapter.js.map