import { __extends } from "tslib";
import { ValueLayerValueMode_$type } from "./ValueLayerValueMode";
import { IgrSeries } from "./igr-series";
import { IgrAxis } from "./igr-axis";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { ValueLayer } from "./ValueLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush, toPoint } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgrValueLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrValueLayer, _super);
    function IgrValueLayer(props) {
        return _super.call(this, props) || this;
    }
    IgrValueLayer.prototype.createImplementation = function () {
        return new ValueLayer();
    };
    Object.defineProperty(IgrValueLayer.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "isAnnotationValueLayer", {
        /**
         * Gets whether the series is an crosshair annotation layer.
        */
        get: function () {
            return this.i.et;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "valueMode", {
        /**
         * Gets or sets the value mode for the overlay.
        */
        get: function () {
            return this.i.z3;
        },
        set: function (v) {
            this.i.z3 = ensureEnum(ValueLayerValueMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "horizontalLineStroke", {
        /**
         * Gets or sets the color to use for the horizontal line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acs);
        },
        set: function (v) {
            this.i.acs = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "verticalLineStroke", {
        /**
         * Gets or sets the color to use for vertical line. Leave null for an automatic value.
        */
        get: function () {
            return brushToString(this.i.act);
        },
        set: function (v) {
            this.i.act = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "targetSeriesName", {
        /**
         * Gets or sets the name of the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            return this.i.aaw;
        },
        set: function (v) {
            this.i.aaw = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "targetSeries", {
        /**
         * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            var r = this.i.z1;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrSeries._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.z1 = null : this.i.z1 = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "targetAxisName", {
        /**
         * Gets or sets the name of the axis to target this annotation to. If null, this annotation targets all axis simultaneously.
        */
        get: function () {
            return this.i.aat;
        },
        set: function (v) {
            this.i.aat = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "targetAxis", {
        /**
         * Gets or sets the axis to target this annotation to. If null, this annotation targets all value axis simultaneously.
        */
        get: function () {
            var r = this.i.zw;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgrAxis._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.zw = null : this.i.zw = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "useInterpolation", {
        /**
         * Gets or sets whether to use value interpolation when drawing a line through the best value for the cursor position.
        */
        get: function () {
            return this.i.z8;
        },
        set: function (v) {
            this.i.z8 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "isAxisAnnotationEnabled", {
        /**
         * Gets or sets whether to draw annotations over the axes where the crosshair meets with them.
        */
        get: function () {
            return this.i.z5;
        },
        set: function (v) {
            this.i.z5 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationFormatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for the x axis annotation.
        */
        get: function () {
            return this.i.zx;
        },
        set: function (v) {
            this.i.zx = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationFormatLabel", {
        /**
         * Sets or gets a function which takes an object that produces a formatted label for the y axis annotation.
        */
        get: function () {
            return this.i.zy;
        },
        set: function (v) {
            this.i.zy = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the x axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acw);
        },
        set: function (v) {
            this.i.acw = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acu);
        },
        set: function (v) {
            this.i.acu = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aab;
        },
        set: function (v) {
            this.i.aab = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.aan;
        },
        set: function (v) {
            this.i.aan = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the x axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acv);
        },
        set: function (v) {
            this.i.acv = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aad;
        },
        set: function (v) {
            this.i.aad = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aaf;
        },
        set: function (v) {
            this.i.aaf = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aae;
        },
        set: function (v) {
            this.i.aae = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aac;
        },
        set: function (v) {
            this.i.aac = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationPaddingLeft", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aaj;
        },
        set: function (v) {
            this.i.aaj = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationPaddingTop", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aal;
        },
        set: function (v) {
            this.i.aal = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationPaddingRight", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aak;
        },
        set: function (v) {
            this.i.aak = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationPaddingBottom", {
        /**
         * Gets or sets the padding to use withing the axis annotation callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.aai;
        },
        set: function (v) {
            this.i.aai = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "xAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the x axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aag;
        },
        set: function (v) {
            this.i.aag = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationTextColor", {
        /**
         * Gets or sets the color to use for the y axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acz);
        },
        set: function (v) {
            this.i.acz = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationBackground", {
        /**
         * Gets or sets the color to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acx);
        },
        set: function (v) {
            this.i.acx = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationBackgroundCornerRadius", {
        /**
         * Gets or sets the corner radius to use for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aah;
        },
        set: function (v) {
            this.i.aah = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.aao;
        },
        set: function (v) {
            this.i.aao = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationOutline", {
        /**
         * Gets or sets the color to use for the y axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.acy);
        },
        set: function (v) {
            this.i.acy = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "yAxisAnnotationStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the y axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.aam;
        },
        set: function (v) {
            this.i.aam = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "skipUnknownValues", {
        /**
         * Gets or sets whether to skip unknown values when searching for series values.
        */
        get: function () {
            return this.i.z7;
        },
        set: function (v) {
            this.i.z7 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrValueLayer.prototype, "isSummarizationSupported", {
        get: function () {
            return this.i.isSummarizationSupported;
        },
        enumerable: false,
        configurable: true
    });
    IgrValueLayer.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) {
            return this.targetSeries;
        }
        if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
            return this.targetAxis;
        }
        return null;
    };
    IgrValueLayer.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.targetSeries && this.targetSeries._styling) {
            this.targetSeries._styling(container, component, this);
        }
        if (this.targetAxis && this.targetAxis._styling) {
            this.targetAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgrValueLayer.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.i5(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    return IgrValueLayer;
}(IgrAnnotationLayer));
export { IgrValueLayer };
