import { __extends } from "tslib";
import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxSeriesComponent } from "./igx-series-component";
import { CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { IgxCalloutStyleUpdatingEventArgs } from "./igx-callout-style-updating-event-args";
import { IgxCalloutContentUpdatingEventArgs } from "./igx-callout-content-updating-event-args";
import { IgxCalloutLabelUpdatingEventArgs } from "./igx-callout-label-updating-event-args";
import { IgxCalloutSeriesSelectingEventArgs } from "./igx-callout-series-selecting-event-args";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { CalloutLayer } from "./CalloutLayer";
import { ensureBool, brushToString, stringToBrush, ensureEnum } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgxCalloutLayerComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxCalloutLayerComponent, _super);
    function IgxCalloutLayerComponent() {
        var _this = _super.call(this) || this;
        _this._calloutStyleUpdating = null;
        _this._calloutContentUpdating = null;
        _this._calloutLabelUpdating = null;
        _this._calloutSeriesSelecting = null;
        return _this;
    }
    IgxCalloutLayerComponent.prototype.createImplementation = function () {
        return new CalloutLayer();
    };
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "labelMemberPath", {
        /**
         * Gets or sets the label mapping property for the callouts.
        */
        get: function () {
            return this.i.rm;
        },
        set: function (v) {
            this.i.rm = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "xMemberPath", {
        /**
         * Gets or sets the label mapping property for the callouts.
        */
        get: function () {
            return this.i.rv;
        },
        set: function (v) {
            this.i.rv = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "yMemberPath", {
        /**
         * Gets or sets the label mapping property for the callouts.
        */
        get: function () {
            return this.i.ry;
        },
        set: function (v) {
            this.i.ry = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "keyMemberPath", {
        /**
         * Gets or sets the key mapping property for the callouts.
        */
        get: function () {
            return this.i.rj;
        },
        set: function (v) {
            this.i.rj = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "isCalloutOffsettingEnabled", {
        /**
         * Gets or sets whether to allow the callouts to be variable distances from the target points, for suppporting collision modes.
        */
        get: function () {
            return this.i.p8;
        },
        set: function (v) {
            this.i.p8 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "contentMemberPath", {
        /**
         * Gets or sets the content mapping property for the callouts.
        */
        get: function () {
            return this.i.rd;
        },
        set: function (v) {
            this.i.rd = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "targetSeriesName", {
        /**
         * Gets or sets the name of the series series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            return this.i.ro;
        },
        set: function (v) {
            this.i.ro = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "targetSeries", {
        /**
         * Gets or sets the series to target this annotation to. If null, this annotation targets all series simultaneously.
        */
        get: function () {
            if (this.i.pj == null) {
                return null;
            }
            if (!this.i.pj.externalObject) {
                var e = IgxSeriesComponent._createFromInternal(this.i.pj);
                if (e) {
                    e._implementation = this.i.pj;
                }
                this.i.pj.externalObject = e;
            }
            return this.i.pj.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.pj = null : this.i.pj = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "collisionChannel", {
        /**
         * Gets or sets a channel name to identify other callout layers within the chart to share collision information with.
        */
        get: function () {
            return this.i.ra;
        },
        set: function (v) {
            this.i.ra = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "isAutoCalloutBehaviorEnabled", {
        /**
         * Gets or sets how to select the final value to annotate.
        */
        get: function () {
            return this.i.p7;
        },
        set: function (v) {
            this.i.p7 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "useValueForAutoCalloutLabels", {
        /**
         * Gets or sets whether to use values, rather than labels for auto callout labels.
        */
        get: function () {
            return this.i.qa;
        },
        set: function (v) {
            this.i.qa = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "isCustomCalloutStyleEnabled", {
        /**
         * Gets or sets whether to allow for custom callout styles.
        */
        get: function () {
            return this.i.p9;
        },
        set: function (v) {
            this.i.p9 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "autoCalloutLabelPrecision", {
        /**
         * Gets or sets the precision to use when values are used for the auto callout labels.
        */
        get: function () {
            return this.i.qs;
        },
        set: function (v) {
            this.i.qs = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutTextColor", {
        /**
         * Gets or sets the color to use for the callout text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.s7);
        },
        set: function (v) {
            this.i.s7 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutBackground", {
        /**
         * Gets or sets the brush that specifies how the backgrounds for the callouts of the layer are painted. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.s4);
        },
        set: function (v) {
            this.i.s4 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.qt;
        },
        set: function (v) {
            this.i.qt = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutOutline", {
        /**
         * Gets or sets the brush that specifies how the outlines for the callouts of the layer are painted.
        */
        get: function () {
            return brushToString(this.i.s6);
        },
        set: function (v) {
            this.i.s6 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutLeaderBrush", {
        /**
         * Gets or sets the brush that specifies how the leader lines for the callouts of the layer are painted.
        */
        get: function () {
            return brushToString(this.i.s5);
        },
        set: function (v) {
            this.i.s5 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutPaddingLeft", {
        /**
         * Gets or sets the left padding to use withing the callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.ql;
        },
        set: function (v) {
            this.i.ql = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutPaddingTop", {
        /**
         * Gets or sets the top padding to use within the callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.qn;
        },
        set: function (v) {
            this.i.qn = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutPaddingRight", {
        /**
         * Gets or sets the right padding to use within the callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.qm;
        },
        set: function (v) {
            this.i.qm = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutPaddingBottom", {
        /**
         * Gets or sets the bottom padding to use within the callout. Leaving this NaN will use an automatic value related to the axis label margins.
        */
        get: function () {
            return this.i.qk;
        },
        set: function (v) {
            this.i.qk = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutCollisionMode", {
        /**
         * Gets or sets the strategy to use for avoiding collisions between the callouts in this layer. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.pd;
        },
        set: function (v) {
            this.i.pd = ensureEnum(CalloutCollisionMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutPositionPadding", {
        /**
         * Gets or sets the padding to add to the callout positioning. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.qo;
        },
        set: function (v) {
            this.i.qo = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the callout backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.qp;
        },
        set: function (v) {
            this.i.qp = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "textStyle", {
        /**
         * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.rr;
        },
        set: function (v) {
            this.i.rr = v;
        },
        enumerable: false,
        configurable: true
    });
    IgxCalloutLayerComponent.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;
        }
        return null;
    };
    IgxCalloutLayerComponent.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);
        }
        this._inStyling = false;
    };
    IgxCalloutLayerComponent.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.gt(item, memberPathName);
        return (iv);
    };
    /**
     * Invalidates content of callout layer
    
    */
    IgxCalloutLayerComponent.prototype.invalidateCalloutContent = function () {
        this.i.r7();
    };
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutStyleUpdating", {
        /**
         * Event raised when updating style of callout layer
        */
        get: function () {
            var _this = this;
            if (this._calloutStyleUpdating == null) {
                this._calloutStyleUpdating = new EventEmitter();
                this.i.calloutStyleUpdating = delegateCombine(this.i.calloutStyleUpdating, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxCalloutStyleUpdatingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeCalloutStyleUpdating) {
                            _this.beforeCalloutStyleUpdating(_this, outerArgs);
                        }
                        _this._calloutStyleUpdating.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._calloutStyleUpdating;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutContentUpdating", {
        /**
         * Raised to allow you to decide on the content for an automatically created callout.
        */
        get: function () {
            var _this = this;
            if (this._calloutContentUpdating == null) {
                this._calloutContentUpdating = new EventEmitter();
                this.i.calloutContentUpdating = delegateCombine(this.i.calloutContentUpdating, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxCalloutContentUpdatingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeCalloutContentUpdating) {
                            _this.beforeCalloutContentUpdating(_this, outerArgs);
                        }
                        _this._calloutContentUpdating.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._calloutContentUpdating;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutLabelUpdating", {
        /**
         * Raised to allow you to decide on the label for an automatically created callout.
        */
        get: function () {
            var _this = this;
            if (this._calloutLabelUpdating == null) {
                this._calloutLabelUpdating = new EventEmitter();
                this.i.calloutLabelUpdating = delegateCombine(this.i.calloutLabelUpdating, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxCalloutLabelUpdatingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeCalloutLabelUpdating) {
                            _this.beforeCalloutLabelUpdating(_this, outerArgs);
                        }
                        _this._calloutLabelUpdating.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._calloutLabelUpdating;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxCalloutLayerComponent.prototype, "calloutSeriesSelecting", {
        /**
         * Raised to allow you to select a target series for a data bound callout.
        */
        get: function () {
            var _this = this;
            if (this._calloutSeriesSelecting == null) {
                this._calloutSeriesSelecting = new EventEmitter();
                this.i.calloutSeriesSelecting = delegateCombine(this.i.calloutSeriesSelecting, function (o, e) {
                    _this._runInZone(function () {
                        var outerArgs = new IgxCalloutSeriesSelectingEventArgs();
                        outerArgs._provideImplementation(e);
                        if (_this.beforeCalloutSeriesSelecting) {
                            _this.beforeCalloutSeriesSelecting(_this, outerArgs);
                        }
                        _this._calloutSeriesSelecting.emit({
                            sender: _this,
                            args: outerArgs
                        });
                    });
                });
            }
            return this._calloutSeriesSelecting;
        },
        enumerable: false,
        configurable: true
    });
    IgxCalloutLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: IgxCalloutLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxCalloutLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: IgxCalloutLayerComponent, selector: "igx-callout-layer", inputs: { labelMemberPath: "labelMemberPath", xMemberPath: "xMemberPath", yMemberPath: "yMemberPath", keyMemberPath: "keyMemberPath", isCalloutOffsettingEnabled: "isCalloutOffsettingEnabled", contentMemberPath: "contentMemberPath", targetSeriesName: "targetSeriesName", targetSeries: "targetSeries", collisionChannel: "collisionChannel", isAutoCalloutBehaviorEnabled: "isAutoCalloutBehaviorEnabled", useValueForAutoCalloutLabels: "useValueForAutoCalloutLabels", isCustomCalloutStyleEnabled: "isCustomCalloutStyleEnabled", autoCalloutLabelPrecision: "autoCalloutLabelPrecision", calloutTextColor: "calloutTextColor", calloutBackground: "calloutBackground", calloutInterpolatedValuePrecision: "calloutInterpolatedValuePrecision", calloutOutline: "calloutOutline", calloutLeaderBrush: "calloutLeaderBrush", calloutPaddingLeft: "calloutPaddingLeft", calloutPaddingTop: "calloutPaddingTop", calloutPaddingRight: "calloutPaddingRight", calloutPaddingBottom: "calloutPaddingBottom", calloutCollisionMode: "calloutCollisionMode", calloutPositionPadding: "calloutPositionPadding", calloutStrokeThickness: "calloutStrokeThickness", textStyle: "textStyle" }, outputs: { calloutStyleUpdating: "calloutStyleUpdating", calloutContentUpdating: "calloutContentUpdating", calloutLabelUpdating: "calloutLabelUpdating", calloutSeriesSelecting: "calloutSeriesSelecting" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCalloutLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCalloutLayerComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxCalloutLayerComponent;
}(IgxAnnotationLayerComponent));
export { IgxCalloutLayerComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: IgxCalloutLayerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-callout-layer',
                    template: "",
                    providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(function () { return IgxCalloutLayerComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCalloutLayerComponent; }) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { labelMemberPath: [{
                type: Input
            }], xMemberPath: [{
                type: Input
            }], yMemberPath: [{
                type: Input
            }], keyMemberPath: [{
                type: Input
            }], isCalloutOffsettingEnabled: [{
                type: Input
            }], contentMemberPath: [{
                type: Input
            }], targetSeriesName: [{
                type: Input
            }], targetSeries: [{
                type: Input
            }], collisionChannel: [{
                type: Input
            }], isAutoCalloutBehaviorEnabled: [{
                type: Input
            }], useValueForAutoCalloutLabels: [{
                type: Input
            }], isCustomCalloutStyleEnabled: [{
                type: Input
            }], autoCalloutLabelPrecision: [{
                type: Input
            }], calloutTextColor: [{
                type: Input
            }], calloutBackground: [{
                type: Input
            }], calloutInterpolatedValuePrecision: [{
                type: Input
            }], calloutOutline: [{
                type: Input
            }], calloutLeaderBrush: [{
                type: Input
            }], calloutPaddingLeft: [{
                type: Input
            }], calloutPaddingTop: [{
                type: Input
            }], calloutPaddingRight: [{
                type: Input
            }], calloutPaddingBottom: [{
                type: Input
            }], calloutCollisionMode: [{
                type: Input
            }], calloutPositionPadding: [{
                type: Input
            }], calloutStrokeThickness: [{
                type: Input
            }], textStyle: [{
                type: Input
            }], calloutStyleUpdating: [{
                type: Output
            }], calloutContentUpdating: [{
                type: Output
            }], calloutLabelUpdating: [{
                type: Output
            }], calloutSeriesSelecting: [{
                type: Output
            }] } });
//# sourceMappingURL=igx-callout-layer-component.js.map
