var BaseModel = /** @class */ (function () {
    function BaseModel(element) {
        this._element = element;
    }
    BaseModel.prototype._getValue = function (tagName) {
        return this._getElement(tagName).textContent;
    };
    BaseModel.prototype._getValueOrUndefined = function (tagName) {
        var element = this._getElementOrUndefined(tagName);
        if (!element)
            return undefined;
        return element.textContent;
    };
    BaseModel.prototype._getElement = function (tagName) {
        var children = this._element.children;
        for (var i = 0; i < children.length; i++) {
            if (children[i].tagName === tagName) {
                return children[i];
            }
        }
        throw new Error("Element " + tagName + " not found.");
    };
    BaseModel.prototype._getElements = function (tagName) {
        var elements = [];
        var children = this._element.children;
        for (var i = 0; i < children.length; i++) {
            if (children[i].tagName === tagName) {
                elements.push(children[i]);
            }
        }
        return elements;
    };
    BaseModel.prototype._getElementOrUndefined = function (tagName) {
        var children = this._element.children;
        for (var i = 0; i < children.length; i++) {
            if (children[i].tagName === tagName) {
                return children[i];
            }
        }
        return undefined;
    };
    return BaseModel;
}());
export { BaseModel };
//# sourceMappingURL=BaseModel.js.map