import { __assign } from "tslib";
import { createArticleQuery as createBaseArticleQuery } from "../ArticleQuery";
export var createArticleQuery = function (articleState) {
    var baseArticleQuery = createBaseArticleQuery(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 __assign(__assign({}, baseArticleQuery), { getMainArticle: getMainArticle, getMainArticleComId: getMainComId });
};
