"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var ArticleQuery_1 = require("../ArticleQuery");
exports.createArticleQuery = function (articleState) {
    var baseArticleQuery = ArticleQuery_1.createArticleQuery(articleState);
    var getMainArticle = function () {
        return baseArticleQuery.getFilteredArticles(function (article) { return article.parent === undefined; })[0];
    };
    var getMainComId = function () {
        var mainArticle = getMainArticle();
        if (mainArticle === undefined) {
            return undefined;
        }
        return mainArticle.comId;
    };
    return tslib_1.__assign(tslib_1.__assign({}, baseArticleQuery), { getMainArticle: getMainArticle, getMainArticleComId: getMainComId });
};
