/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import * as React from 'react';
import { Visibility_$type } from "igniteui-react-core";
import { HorizontalAlignment_$type } from "igniteui-react-core";
import { VerticalAlignment_$type } from "igniteui-react-core";
import { AxisLabelsLocation_$type } from './AxisLabelsLocation';
import { AxisLabelSettings } from './AxisLabelSettings';
import { TitleSettings } from './TitleSettings';
import { AxisTitlePosition_$type } from './AxisTitlePosition';
import { ensureEnum, arrayFindByName, brushToString, stringToBrush, ensureBool, isValidProp, getModifiedProps, toSpinal, initializePropertiesFromCss, NamePatcher } from "igniteui-react-core";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { IgrRenderRequestedEventArgs } from './igr-render-requested-event-args';
import { TypeRegistrar } from "igniteui-react-core";
import { IgrAxisRangeChangedEventArgs } from './igr-axis-range-changed-event-args';
import { IgrAxisAnnotationCollection } from './igr-axis-annotation-collection';
import { AxisAnnotationCollection as AxisAnnotationCollection_internal } from './AxisAnnotationCollection';
import { SyncableObservableCollection$1 } from "igniteui-react-core";
import { IAxisAnnotation_$type } from './IAxisAnnotation';
/**
 * Represents the base class from which all axis types are derived.
*
* The `IgrAxis` is an array of axis objects.
*
* ```ts
* <IgrDataChart
*     dataSource={this.state.dataSource} >
*
*     <IgrCategoryXAxis name="xAxis" label="Date" />
*     <IgrNumericYAxis  name="yAxis" />
*  </IgrDataChart>
* ```
*/
var IgrAxis = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrAxis, _super);
    function IgrAxis(props) {
        var _this = _super.call(this, props) || this;
        _this._renderer = null;
        _this._crossingAxisName = null;
        _this._annotations = null;
        _this.__p = null;
        _this._hasUserValues = new Set();
        _this._stylingContainer = null;
        _this._stylingParent = null;
        _this._inStyling = false;
        _this._rangeChanged = null;
        _this._rangeChanged_wrapped = null;
        _this._renderRequested = null;
        _this._renderRequested_wrapped = null;
        if (_this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
        }
        _this._implementation = _this.createImplementation();
        _this._implementation.externalObject = _this;
        _this.onImplementationCreated();
        return _this;
    }
    Object.defineProperty(IgrAxis.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.onImplementationCreated = function () {
    };
    IgrAxis.prototype.componentDidMount = function () {
        var e_1, _a;
        {
            try {
                for (var _b = tslib_1.__values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var p = _c.value;
                    {
                        if (isValidProp(this, p)) {
                            {
                                this[p] = this.props[p];
                            }
                        }
                    }
                }
            }
            catch (e_1_1) {
                e_1 = { error: e_1_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_1)
                        throw e_1.error;
                }
            }
        }
    };
    Object.defineProperty(IgrAxis.prototype, "axisInternal", {
        //private _crossingAxisName: string;
        //public set crossingAxisName(value: string) {
        //    this._crossingAxisName = value;
        //}
        //public get crossingAxisName(): string {
        //    return this._crossingAxisName;
        //}
        get: function () {
            return this.i;
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.createImplementation = function () {
        return null;
    };
    IgrAxis.prototype.shouldComponentUpdate = function (nextProps, nextState) {
        var e_2, _a;
        var mod = getModifiedProps(this.props, nextProps);
        try {
            for (var _b = tslib_1.__values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = mod[p];
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
        return true;
    };
    IgrAxis.prototype.render = function () {
        return null;
    };
    Object.defineProperty(IgrAxis.prototype, "name", {
        get: function () {
            return this.i.name;
        },
        set: function (value) {
            this.i.name = value;
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.provideData = function (data) {
    };
    IgrAxis.prototype._provideRenderer = function (renderer) {
        this._renderer = renderer;
    };
    IgrAxis._createFromInternal = function (internal) {
        if (!internal) {
            return null;
        }
        if (!internal.$type) {
            return null;
        }
        var name = internal.$type.name;
        var externalName = "Igr" + name;
        if (!TypeRegistrar.isRegistered(externalName)) {
            return null;
        }
        return TypeRegistrar.create(externalName);
    };
    Object.defineProperty(IgrAxis.prototype, "isCategory", {
        /**
     * Gets or sets if the current axis is of category axis type
    */
        get: function () {
            return this.i.b4;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isNumeric", {
        /**
         * Gets or sets if the current axis is of numeric axis type
        *
        *     Gets or sets if the current axis is of numeric axis type
        */
        get: function () {
            return this.i.cc;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isAngular", {
        /**
         * Gets if the current axis is of angular axis type
        */
        get: function () {
            return this.i.b2;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isRadial", {
        /**
         * Gets or sets if the current axis is of radial axis type
        */
        get: function () {
            return this.i.ce;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isVertical", {
        /**
         * Gets if the current axis is a vertical axis.
        */
        get: function () {
            return this.i.ch;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isSorting", {
        /**
         * Gets or sets if the current axis is sorting data items
        */
        get: function () {
            return this.i.cf;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isDateTime", {
        /**
         * Gets or sets if the current axis is of date time axis type
        */
        get: function () {
            return this.i.b7;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isPiecewise", {
        /**
         * Gets or sets if the axis is a piecewise scaling function.
        */
        get: function () {
            return this.i.cd;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isCategoryDateTime", {
        /**
         * Gets if the current axis is of category date time axis type
        */
        get: function () {
            return this.i.b5;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isContinuous", {
        /**
         * Gets if the current axis is a continuous rather than a discrete scale
        */
        get: function () {
            return this.i.b6;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "formatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart.
        *
        * The `formatLabel` function takes an object that produces a formatted label for displaying in the chart.
        *
        * ```ts
        * <IgrDataChart dataSource={this.data}   >
        *     <IgrCategoryXAxis
        * 		name="xAxis"
        * 		FormatLabel="xAxis_FormatLabel" />
        * </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.at;
        },
        set: function (v) {
            this.i.at = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "title", {
        /**
         * Gets or sets the Title property.
        *
        * Use `title` property to display the title of the component.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return this.i.gd;
        },
        set: function (v) {
            this.i.gd = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "stroke", {
        /**
         * Gets or sets the Stroke property.
         * Null is treated as auto. The axis stroke will be displayed or not based on the axis type and series used with it.
        *
        * Use `stroke` property to set the stroke of the chart.
        *
        * ```ts
        * <IgrCategoryChart
        *         ref={this.onChartRef}
        *         width="100%"
        *         height="100%"
        *         dataSource={this.data}
        *         titleTopMargin={5}
        *         xAxisStroke="gray"/>
        * ```
        */
        get: function () {
            return brushToString(this.i.iw);
        },
        set: function (v) {
            this.i.iw = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "actualStroke", {
        /**
         * Gets or sets the effective stroke used for the axis.
        */
        get: function () {
            return brushToString(this.i.is);
        },
        set: function (v) {
            this.i.is = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "strokeThickness", {
        /**
         * Gets or sets the StrokeThickness property.
        *
        * Use `strokeThickness` property for the thickness of the stroke.
        *
        * ```ts
        * <IgrCategoryChart
        *         ref={this.onChartRef}
        *         width="100%"
        *         height="100%"
        *         dataSource={this.data}
        *         titleTopMargin={5}
        *         xAxisStrokeThickness={2}>
        * ```
        */
        get: function () {
            return this.i.eq;
        },
        set: function (v) {
            this.i.eq = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "strip", {
        /**
         * Gets or sets the Strip property.
        *
        * Use `strip` property to set the strip of the chart.
        *
        * ```ts
        * <IgrCategoryChart
        *         ref={this.onChartRef}
        *         width="100%"
        *         height="100%"
        *         dataSource={this.data}
        *         titleTopMargin={5}
        *         xAxisStrip="gray"/>
        * ```
        */
        get: function () {
            return brushToString(this.i.iv);
        },
        set: function (v) {
            this.i.iv = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "majorStroke", {
        /**
         * Gets or sets the MajorStroke property.
         * Null is treated as auto. Major lines will be displayed or not based on the axis type and series used with it.
        *
        * Gets or sets the `majorStroke` using this property.
        *
        * ```ts
        * <IgrNumericYAxis name="yAxis"
        *     interval={100}
        *     majorStroke="black"
        *     majorStrokeThickness={1}
        *     minorInterval={25}
        *     minorStroke="gray"
        *     minorStrokeThickness={0.5} />
        * ```
        */
        get: function () {
            return brushToString(this.i.it);
        },
        set: function (v) {
            this.i.it = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "actualMajorStroke", {
        /**
         * Gets or sets the ActualMajorStroke property.
        *
        * The `actualMajorStroke` property is used for ActualMajorStroke of the axis.
        */
        get: function () {
            return brushToString(this.i.iq);
        },
        set: function (v) {
            this.i.iq = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "majorStrokeThickness", {
        /**
         * Gets or sets the MajorStrokeThickness property.
        *
        * Gets or sets the `majorStrokeThickness` using this property.
        *
        * ```ts
        * <IgrNumericYAxis name="yAxis"
        *     interval={100}
        *     majorStroke="black"
        *     majorStrokeThickness={1}
        *     minorInterval={25}
        *     minorStroke="gray"
        *     minorStrokeThickness={0.5} />
        * ```
        */
        get: function () {
            return this.i.d6;
        },
        set: function (v) {
            this.i.d6 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "minorStroke", {
        /**
         * Gets or sets the MinorStroke property.
        *
        * Gets or sets the minorStroke thickness using `minorStrokeThickness` property.
        *
        * ```ts
        * <IgrNumericYAxis name="yAxis"
        *     interval={100}
        *     majorStroke="black"
        *     majorStrokeThickness={1}
        *     minorInterval={25}
        *     minorStroke="gray"
        *     minorStrokeThickness={0.5} />
        * ```
        */
        get: function () {
            return brushToString(this.i.iu);
        },
        set: function (v) {
            this.i.iu = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "actualMinorStroke", {
        /**
         * Gets or sets the ActualMinorStroke property.
        *
        * The `actualMinorStroke` property is used for ActualMinorStroke of the axis.
        */
        get: function () {
            return brushToString(this.i.ir);
        },
        set: function (v) {
            this.i.ir = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "minorStrokeThickness", {
        /**
         * Gets or sets the MinorStrokeThickness property.
        */
        get: function () {
            return this.i.d9;
        },
        set: function (v) {
            this.i.d9 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "tickStroke", {
        /**
         * Gets or sets the TickStroke property.
        *
        * Use `tickStroke` property for the color of the tickmarks.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     tickLength={10}
        *     tickStrokeThickness={0.5}
        *     tickStroke="black" />
        * ```
        */
        get: function () {
            return brushToString(this.i.ix);
        },
        set: function (v) {
            this.i.ix = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "tickStrokeThickness", {
        /**
         * Gets or sets the TickStrokeThickness property.
        *
        * Use `tickStrokeThickness` property for thickness of the stroke tickmarks.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     tickLength={10}
        *     tickStrokeThickness={0.5}
        *     tickStroke="black" />
        * ```
        */
        get: function () {
            return this.i.es;
        },
        set: function (v) {
            this.i.es = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "tickLength", {
        /**
         * Gets or sets the TickLength property.
        *
        * Use `tickLength` property for The length of the tickmarks to display for this axis.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     tickLength={10}
        *     tickStrokeThickness={0.5}
        *     tickStroke="black" />
        * ```
        */
        get: function () {
            return this.i.er;
        },
        set: function (v) {
            this.i.er = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isDisabled", {
        /**
         * Gets or sets the IsDisabled property. If true, the axis will not be rendered.
        *
        * The `isDisabled` property is used to decide if the axis will not be rendered.
        */
        get: function () {
            return this.i.b8;
        },
        set: function (v) {
            this.i.b8 = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "isInverted", {
        /**
         * Gets or sets the IsInverted property.
        *
        * Gets or sets the `isInverted` property.
        */
        get: function () {
            return this.i.ca;
        },
        set: function (v) {
            this.i.ca = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "useEnhancedIntervalManagement", {
        /**
         * Gets or sets whether to use more advanced heuristics when determining the initial number of labels to render, before resolving collisions, etc.
        *
        * Use `useEnhancedIntervalManagement` property to gets/sets whether to use more advanced heuristics when determining the initial number of labels to render,
        * before resolving collisions, etc.
        */
        get: function () {
            return this.i.cq;
        },
        set: function (v) {
            this.i.cq = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "enhancedIntervalMinimumCharacters", {
        /**
         * Gets or sets the mininum desired characters to be displayed for horizontal axes when using advanced label heuristics. -1 will attempt to adjust the interval to precisely fit the horizontal labels.
        *
        * The `enhancedIntervalMinimumCharacters` property is used to set the mininum desired characters to be displayed for horizontal axes when using advanced label heuristics.
        */
        get: function () {
            return this.i.e0;
        },
        set: function (v) {
            this.i.e0 = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelTextStyle", {
        /**
         * Gets or sets the text style to use for axis labels.
        *
        * The `labelTextStyle` property Overrides the style of the text used for the axis labels.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"
        * 		titleTextStyle="12pt Verdana" />
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return this.i.ay ? this.i.ay.textStyle : null;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.textStyle = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelTextColor", {
        /**
         * The color of the {0}.
        *
        * The `labelTextColor` property Overrides the color of the text used for the axis labels.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"
        * 		labelTextColor="gray"  />
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return brushToString(this.i.ay ? this.i.ay.textColor : null);
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.textColor = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelLocation", {
        /**
         * Gets or sets the location of the {0}.
        *
        * The `Location` property is used for the location.
        */
        get: function () {
            return this.i.ay ? this.i.ay.location : 0;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.location = ensureEnum(AxisLabelsLocation_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelVisibility", {
        /**
         * Gets or sets the visibility of the {0}.
        *
        * The `Visibility` property is used for the visibility of the axis.
        */
        get: function () {
            return this.i.ay ? this.i.ay.visibility : 0;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.visibility = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelShowFirstLabel", {
        /**
         * Gets or sets whether the first label is displayed when the zoom level is set to 1.
        *
        * The `ShowFirstLabel` is used to check whether the first label is displayed when the zoom level is set to 1.
        */
        get: function () {
            return this.i.ay ? this.i.ay.showFirstLabel : false;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.showFirstLabel = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelAngle", {
        /**
         * Gets or sets the angle of the {0}.
        *
        * The `Angle` property is used to set the angle of the axis.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"
        * 		titleAngle={90} />
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return this.i.ay ? this.i.ay.angle : NaN;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.angle = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelExtent", {
        /**
         * Distance between the axis and the edge of the control.
        *
        * The `Extent` property is used for the extent.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"/>
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.ay ? this.i.ay.extent : NaN;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.extent = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelLeftMargin", {
        /**
         * Margin applied to the left of the {0}.
        *
        * The `labelLeftMargin` property is used for the left margin of the labels.
        */
        get: function () {
            return this.i.ay ? this.i.ay.leftMargin : NaN;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.leftMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelRightMargin", {
        /**
         * Margin applied to the right of the {0}.
        *
        * The `labelRightMargin` property is used for the right margin of the labels.
        */
        get: function () {
            return this.i.ay ? this.i.ay.rightMargin : NaN;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.rightMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelTopMargin", {
        /**
         * Margin applied above the {0}.
        *
        * The `labelTopMargin` property is used for the top margin of the labels.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     label="Country"
        *     labelTextStyle="9pt Verdana"
        *     labelTopMargin={5}
        *     labelTextColor="gray" />
        * ```
        */
        get: function () {
            return this.i.ay ? this.i.ay.topMargin : NaN;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.topMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelBottomMargin", {
        /**
         * Margin applied below the {0}.
        *
        * The `labelBottomMargin` is used to set the bottom margin of the labels.
        */
        get: function () {
            return this.i.ay ? this.i.ay.bottomMargin : NaN;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.bottomMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelHorizontalAlignment", {
        /**
         * Gets or sets the horizontal alignment of the {0}.
        *
        * The `HorizontalAlignment` property is used for the horizontal alignment.
        */
        get: function () {
            return this.i.ay ? this.i.ay.horizontalAlignment : 0;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.horizontalAlignment = ensureEnum(HorizontalAlignment_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelVerticalAlignment", {
        /**
         * Gets or sets the vertical alignment of the {0}.
        *
        * The `VerticalAlignment` property is used for the vertical alignment of the axis.
        */
        get: function () {
            return this.i.ay ? this.i.ay.verticalAlignment : 0;
        },
        set: function (v) {
            this.ensureLabelSettings();
            this.i.ay.verticalAlignment = ensureEnum(VerticalAlignment_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.ensureLabelSettings = function () {
        if (this.i.ay) {
            return;
        }
        this.i.ay = new AxisLabelSettings();
        this.i.ay.location = this.i.az();
        this.i.ay.angle = this.i.dn();
        this.i.ay.leftMargin = this.i.dq();
        this.i.ay.rightMargin = this.i.dr();
        this.i.ay.topMargin = this.i.ds();
        this.i.ay.bottomMargin = this.i.dp();
        this.i.ay.horizontalAlignment = this.i.io();
        this.i.ay.verticalAlignment = this.i.jh();
    };
    Object.defineProperty(IgrAxis.prototype, "crossingAxis", {
        /**
         * Gets or sets the CrossingAxis property.
        *
        * The `crossingAxis` property is used for CrossingAxis .
        *
        * ```ts
        *  <IgrDataChart
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrNumericXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis"
        * 		 crossingAxisName= "xAxis"
        * 		crossingValue= {700}/>
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            if (this.i.ai == null) {
                return null;
            }
            if (!this.i.ai.externalObject) {
                var e = IgrAxis._createFromInternal(this.i.ai);
                if (e) {
                    e._implementation = this.i.ai;
                }
                this.i.ai.externalObject = e;
            }
            return this.i.ai.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.ai = null : this.i.ai = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "crossingAxisName", {
        /**
        * Gets or sets the name to use to resolve crossingAxis from markup.
        */
        get: function () {
            return this._crossingAxisName;
        },
        set: function (v) {
            this._crossingAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "crossingValue", {
        /**
         * Gets or sets the CrossingValue property.
        *
        * The `crossingValue` property is used for CrossingValue of the axis.
        *
        * ```ts
        *  <IgrDataChart
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrNumericXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis"
        * 		 crossingAxis= "xAxis"
        * 		crossingValue= {700}/>
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.e5;
        },
        set: function (v) {
            this.i.e5 = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titlePosition", {
        /**
         * Gets or sets the title position relative to the axis labels.
        */
        get: function () {
            return this.i.be ? this.i.be.position : 0;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.position = ensureEnum(AxisTitlePosition_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleTextStyle", {
        /**
         * Gets or sets the text style to use for axis labels.
        *
        * The `labelTextStyle` property Overrides the style of the text used for the axis labels.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"
        * 		titleTextStyle="12pt Verdana" />
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return this.i.be ? this.i.be.textStyle : null;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.textStyle = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleTextColor", {
        /**
         * The color of the {0}.
        *
        * The `labelTextColor` property Overrides the color of the text used for the axis labels.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"
        * 		labelTextColor="gray"  />
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return brushToString(this.i.be ? this.i.be.textColor : null);
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.textColor = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleLocation", {
        /**
         * Gets or sets the location of the {0}.
        *
        * The `Location` property is used for the location.
        */
        get: function () {
            return this.i.be ? this.i.be.location : 0;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.location = ensureEnum(AxisLabelsLocation_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleVisibility", {
        /**
         * Gets or sets the visibility of the {0}.
        *
        * The `Visibility` property is used for the visibility of the axis.
        */
        get: function () {
            return this.i.be ? this.i.be.visibility : 0;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.visibility = ensureEnum(Visibility_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleShowFirstLabel", {
        /**
         * Gets or sets whether the first label is displayed when the zoom level is set to 1.
        *
        * The `ShowFirstLabel` is used to check whether the first label is displayed when the zoom level is set to 1.
        */
        get: function () {
            return this.i.be ? this.i.be.showFirstLabel : false;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.showFirstLabel = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleAngle", {
        /**
         * Gets or sets the angle of the {0}.
        *
        * The `Angle` property is used to set the angle of the axis.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"
        * 		titleAngle={90} />
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     title="Country"
        *     titleTextColor="gray"
        *     titleTextStyle="12pt Verdana"
        *     titleAngle={90} />
        * ```
        */
        get: function () {
            return this.i.be ? this.i.be.angle : NaN;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.angle = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleExtent", {
        /**
         * Distance between the axis and the edge of the control.
        *
        * The `Extent` property is used for the extent.
        *
        * ```ts
        * <IgrDataChart
        *     dataSource={this.state.dataSource}
        *     width="700px"
        *     height="500px">
        *
        *     <IgrCategoryXAxis name="xAxis"
        * 		label="Year"/>
        *     <IgrNumericYAxis  name="yAxis" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.be ? this.i.be.extent : NaN;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.extent = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleLeftMargin", {
        /**
         * Margin applied to the left of the {0}.
        *
        * The `labelLeftMargin` property is used for the left margin of the labels.
        */
        get: function () {
            return this.i.be ? this.i.be.leftMargin : NaN;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.leftMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleRightMargin", {
        /**
         * Margin applied to the right of the {0}.
        *
        * The `labelRightMargin` property is used for the right margin of the labels.
        */
        get: function () {
            return this.i.be ? this.i.be.rightMargin : NaN;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.rightMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleTopMargin", {
        /**
         * Margin applied above the {0}.
        *
        * The `labelTopMargin` property is used for the top margin of the labels.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     label="Country"
        *     labelTextStyle="9pt Verdana"
        *     labelTopMargin={5}
        *     labelTextColor="gray" />
        * ```
        */
        get: function () {
            return this.i.be ? this.i.be.topMargin : NaN;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.topMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleBottomMargin", {
        /**
         * Margin applied below the {0}.
        *
        * The `labelBottomMargin` is used to set the bottom margin of the labels.
        */
        get: function () {
            return this.i.be ? this.i.be.bottomMargin : NaN;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.bottomMargin = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleHorizontalAlignment", {
        /**
         * Gets or sets the horizontal alignment of the {0}.
        *
        * The `HorizontalAlignment` property is used for the horizontal alignment.
        */
        get: function () {
            return this.i.be ? this.i.be.horizontalAlignment : 0;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.horizontalAlignment = ensureEnum(HorizontalAlignment_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "titleVerticalAlignment", {
        /**
         * Gets or sets the vertical alignment of the {0}.
        *
        * The `VerticalAlignment` property is used for the vertical alignment of the axis.
        */
        get: function () {
            return this.i.be ? this.i.be.verticalAlignment : 0;
        },
        set: function (v) {
            this.ensureTitleSettings();
            this.i.be.verticalAlignment = ensureEnum(VerticalAlignment_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.ensureTitleSettings = function () {
        if (this.i.be) {
            return;
        }
        this.i.be = new TitleSettings();
        this.i.be.location = this.i.a0();
        this.i.be.angle = this.i.dt();
        this.i.be.leftMargin = this.i.dv();
        this.i.be.rightMargin = this.i.dw();
        this.i.be.topMargin = this.i.dx();
        this.i.be.bottomMargin = this.i.du();
        this.i.be.horizontalAlignment = this.i.ip();
        this.i.be.verticalAlignment = this.i.ji();
    };
    Object.defineProperty(IgrAxis.prototype, "annotations", {
        /**
         * Gets the current annotations for the axis.
        */
        get: function () {
            if (this._annotations === null) {
                var coll = new IgrAxisAnnotationCollection();
                var innerColl = this.i.am;
                if (!innerColl) {
                    innerColl = new AxisAnnotationCollection_internal();
                }
                this._annotations = coll._fromInner(innerColl);
            }
            return this._annotations;
        },
        set: function (v) {
            if (this._annotations !== null) {
                this._annotations._setSyncTarget(null);
                this._annotations = null;
            }
            var coll = new IgrAxisAnnotationCollection();
            this._annotations = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(IAxisAnnotation_$type);
            var innerColl = this.i.am;
            if (!innerColl) {
                innerColl = new AxisAnnotationCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._annotations._setSyncTarget(syncColl);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "coercionMethods", {
        /**
         * Gets or sets the coercion methods to use when loading data from data sources.
         * Should be specified before setting any member paths, if being used. Setting it later
         * will not cause data to be re-imported into the chart.
        *
        * The	`coercionMethods` methods is to use when loading data from data sources. Should be specified before setting any member paths, if being used.
        * Setting it later will not cause data to be reimported into the chart.
        */
        get: function () {
            return this.i.coercionMethods;
        },
        set: function (v) {
            this.i.coercionMethods = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "expectFunctions", {
        /**
         * Gets or sets whether the series should expect that properties in its items source may be functions that need to be
         * evaluated to yield their value. This defaults to false, as there will be a subtle performance impact to using this feature.
         * This value must be set before assigning an item's source to take effect.
        */
        get: function () {
            return this.i.expectFunctions;
        },
        set: function (v) {
            this.i.expectFunctions = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "label", {
        /**
         * Gets or sets the axis label format string.
        *
        * The `label` property is used for label mapping of the axis labels.
        *
        * ```ts
        * <IgrCategoryXAxis name="xAxis"
        *     label="Country"
        *     labelTextStyle="9pt Verdana"
        *     labelTopMargin={5}
        *     labelTextColor="gray" />
        * ```
        */
        get: function () {
            return this.i.fa;
        },
        set: function (v) {
            this.i.fa = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelFormat", {
        /**
         * Gets or sets the label format string to use for the label.
        */
        get: function () {
            return this.i.fp;
        },
        set: function (v) {
            this.i.fp = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "labelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the LabelFormat string.
        */
        get: function () {
            return this.i.ag;
        },
        set: function (v) {
            this.i.ag = v;
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.bindAxes = function (axes) {
        for (var i = 0; i < axes.length; i++) {
            if (this.crossingAxisName && this.crossingAxisName.length > 0 &&
                axes[i].name == this.crossingAxisName) {
                this.crossingAxis = axes[i];
            }
        }
    };
    IgrAxis.prototype.findByName = function (name) {
        if (this.crossingAxis && this.crossingAxis.name && this.crossingAxis.name == name) {
            return this.crossingAxis;
        }
        if (this.annotations != null && this.annotations.findByName && this.annotations.findByName(name)) {
            return this.annotations.findByName(name);
        }
        if (this.labelFormatSpecifiers != null && arrayFindByName(this.labelFormatSpecifiers, name)) {
            return arrayFindByName(this.labelFormatSpecifiers, name);
        }
        return null;
    };
    Object.defineProperty(IgrAxis.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: true,
        configurable: true
    });
    IgrAxis.prototype.__m = function (propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    };
    IgrAxis.prototype._styling = function (container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        var genericPrefix = "";
        var typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("Axis");
        var additionalPrefixes = [];
        var prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        var b = this.i.$type.baseType;
        while (b && b.name != "Object" &&
            b.name != "Base" &&
            b.name != "Control" &&
            b.Name != "DependencyObject" &&
            b.Name != "FrameworkElement") {
            typeName = b.name;
            if (typeName.indexOf("Xam") === 0) {
                typeName = typeName.substring(3);
            }
            var basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            var parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            var parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (this.crossingAxis && this.crossingAxis._styling) {
            this.crossingAxis._styling(container, component, this);
        }
        if (this._otherStyling) {
            this._otherStyling(container, component, parent);
        }
        this._inStyling = false;
    };
    /**
 * Renders the axis with no animation.

*/
    IgrAxis.prototype.renderAxis = function () {
        this.i.hb();
    };
    /**
     * If using enhanced interval management and precise interval fitting, this will reset the cached maximum label width, and recalculate using the current labels.
    
    */
    IgrAxis.prototype.resetCachedEnhancedInterval = function () {
        this.i.he();
    };
    IgrAxis.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.e7(item, memberPathName);
        return (iv);
    };
    /**
     * Gets the label for a data item.
    
    * @param value  * The unscaled value to get a label for.
    */
    IgrAxis.prototype.getValueLabel = function (value) {
        var iv = this.i.fm(value);
        return (iv);
    };
    /**
     * Scales a value from axis space into screen space.
    
    * @param unscaledValue  * The unscaled axis value to scale.
    */
    IgrAxis.prototype.scaleValue = function (unscaledValue) {
        var iv = this.i.ee(unscaledValue);
        return (iv);
    };
    Object.defineProperty(IgrAxis.prototype, "rangeChanged", {
        /**
         * Occurs when the axis range changes.
        */
        get: function () {
            return this._rangeChanged;
        },
        set: function (ev) {
            var _this = this;
            if (this._rangeChanged_wrapped !== null) {
                this.i.rangeChanged = delegateRemove(this.i.rangeChanged, this._rangeChanged_wrapped);
                this._rangeChanged_wrapped = null;
                this._rangeChanged = null;
            }
            this._rangeChanged = ev;
            this._rangeChanged_wrapped = function (o, e) {
                var outerArgs = new IgrAxisRangeChangedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeRangeChanged) {
                    _this.beforeRangeChanged(_this, outerArgs);
                }
                if (_this._rangeChanged) {
                    _this._rangeChanged(_this, outerArgs);
                }
            };
            this.i.rangeChanged = delegateCombine(this.i.rangeChanged, this._rangeChanged_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrAxis.prototype, "renderRequested", {
        /**
         * This event is raised every time a render has been requested from a series.
        */
        get: function () {
            return this._renderRequested;
        },
        set: function (ev) {
            var _this = this;
            if (this._renderRequested_wrapped !== null) {
                this.i.renderRequested = delegateRemove(this.i.renderRequested, this._renderRequested_wrapped);
                this._renderRequested_wrapped = null;
                this._renderRequested = null;
            }
            this._renderRequested = ev;
            this._renderRequested_wrapped = function (o, e) {
                var outerArgs = new IgrRenderRequestedEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeRenderRequested) {
                    _this.beforeRenderRequested(_this, outerArgs);
                }
                if (_this._renderRequested) {
                    _this._renderRequested(_this, outerArgs);
                }
            };
            this.i.renderRequested = delegateCombine(this.i.renderRequested, this._renderRequested_wrapped);
        },
        enumerable: true,
        configurable: true
    });
    return IgrAxis;
}(React.Component));
export { IgrAxis };
//# sourceMappingURL=igr-axis.js.map
