import { __extends } from "tslib";
import { Component, Input } from '@angular/core';
import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component";
import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component";
import { IgxStackedSeriesBaseComponent } from "./igx-stacked-series-base-component";
import * as i0 from "@angular/core";
/**
 * Base class for stacked series with a category x-axis and a numeric y-axis.
*/
var IgxHorizontalStackedSeriesBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxHorizontalStackedSeriesBaseComponent, _super);
    function IgxHorizontalStackedSeriesBaseComponent() {
        return _super.call(this) || this;
    }
    Object.defineProperty(IgxHorizontalStackedSeriesBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxHorizontalStackedSeriesBaseComponent.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for this series.
        */
        get: function () {
            if (this.i.xAxis == null) {
                return null;
            }
            if (!this.i.xAxis.externalObject) {
                var e = IgxCategoryAxisBaseComponent._createFromInternal(this.i.xAxis);
                if (e) {
                    e._implementation = this.i.xAxis;
                }
                this.i.xAxis.externalObject = e;
            }
            return this.i.xAxis.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.xAxis = null : this.i.xAxis = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxHorizontalStackedSeriesBaseComponent.prototype, "hasValueAxis", {
        get: function () {
            return this.i.c6;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxHorizontalStackedSeriesBaseComponent.prototype, "isValueAxisInverted", {
        get: function () {
            return this.i.ej;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxHorizontalStackedSeriesBaseComponent.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for this series.
        */
        get: function () {
            if (this.i.yAxis == null) {
                return null;
            }
            if (!this.i.yAxis.externalObject) {
                var e = IgxNumericYAxisComponent._createFromInternal(this.i.yAxis);
                if (e) {
                    e._implementation = this.i.yAxis;
                }
                this.i.yAxis.externalObject = e;
            }
            return this.i.yAxis.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.yAxis = null : this.i.yAxis = v.i;
        },
        enumerable: false,
        configurable: true
    });
    IgxHorizontalStackedSeriesBaseComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
            return this.xAxis;
        }
        if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
            return this.yAxis;
        }
        return null;
    };
    IgxHorizontalStackedSeriesBaseComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.xAxis && this.xAxis._styling) {
            this.xAxis._styling(container, component, this);
        }
        if (this.yAxis && this.yAxis._styling) {
            this.yAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    IgxHorizontalStackedSeriesBaseComponent.prototype.getOffsetValue = function () {
        var iv = this.i.getOffsetValue();
        return (iv);
    };
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    IgxHorizontalStackedSeriesBaseComponent.prototype.getCategoryWidth = function () {
        var iv = this.i.getCategoryWidth();
        return (iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgxHorizontalStackedSeriesBaseComponent.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.ug(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgxHorizontalStackedSeriesBaseComponent.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.uf(axis);
        return (iv);
    };
    IgxHorizontalStackedSeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxHorizontalStackedSeriesBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxHorizontalStackedSeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxHorizontalStackedSeriesBaseComponent, selector: "ng-component", inputs: { xAxis: "xAxis", yAxis: "yAxis" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxHorizontalStackedSeriesBaseComponent;
}(IgxStackedSeriesBaseComponent));
export { IgxHorizontalStackedSeriesBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxHorizontalStackedSeriesBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { xAxis: [{
                type: Input
            }], yAxis: [{
                type: Input
            }] } });
