import * as tslib_1 from "tslib";
import { CalloutAnnotationCollection } from "./igr-callout-annotation-collection";
import { CalloutCollisionMode_$type } from "./CalloutCollisionMode";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { CalloutLayer } from "./CalloutLayer";
import { CalloutAnnotationCollection as CalloutAnnotationCollection_internal } from "./CalloutAnnotationCollection";
import { CalloutAnnotation } from "./CalloutAnnotation";
import { SyncableObservableCollection$1 } from "igniteui-react-core/ES5/SyncableObservableCollection$1";
import { ensureBool, brushToString, stringToBrush, ensureEnum } from "igniteui-react-core/ES5/componentUtil";
/**
 * Represents an annotation layer that displays crosshair lines that cross through the closest value of the target series under the cursor.
*/
var IgrCalloutLayer = /** @class */ (function (_super) {
    tslib_1.__extends(IgrCalloutLayer, _super);
    function IgrCalloutLayer(props) {
        var _this = _super.call(this, props) || this;
        _this._callouts = null;
        return _this;
    }
    IgrCalloutLayer.prototype.createImplementation = function () {
        return new CalloutLayer();
    };
    Object.defineProperty(IgrCalloutLayer.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "callouts", {
        /**
         * Gets the current SeriesViewer object's child Series.
        */
        get: function () {
            if (this._callouts === null) {
                var coll = new CalloutAnnotationCollection();
                var innerColl = this.i.callouts;
                var wasNull = false;
                if (!innerColl) {
                    wasNull = true;
                    innerColl = new CalloutAnnotationCollection_internal();
                }
                this._callouts = coll._fromInner(innerColl);
            }
            return this._callouts;
        },
        set: function (v) {
            if (this._callouts !== null) {
                this._callouts._setSyncTarget(null);
                this._callouts = null;
            }
            var coll = new CalloutAnnotationCollection();
            this._callouts = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(CalloutAnnotation.$type);
            var innerColl = this.i.callouts;
            var wasNull = false;
            if (!innerColl) {
                wasNull = true;
                innerColl = new CalloutAnnotationCollection_internal();
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._callouts._setSyncTarget(syncColl);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.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.mu == null) {
                return null;
            }
            return this.i.mu.externalObject;
        },
        set: function (v) {
            v == null ? this.i.mu = null : this.i.mu = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "isAutoCalloutBehaviorEnabled", {
        /**
         * Gets or sets how to select the final value to annotate.
        */
        get: function () {
            return this.i.m2;
        },
        set: function (v) {
            this.i.m2 = ensureBool(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutTextColor", {
        /**
         * Gets or sets the color to use for the axis annotation text. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.ob);
        },
        set: function (v) {
            this.i.ob = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutBackground", {
        /**
         * Gets or sets the color to use for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.n9);
        },
        set: function (v) {
            this.i.n9 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutInterpolatedValuePrecision", {
        /**
         * Gets or sets the precision to use displaying values for interpolated crosshair positions.
        */
        get: function () {
            return this.i.ne;
        },
        set: function (v) {
            this.i.ne = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutOutline", {
        /**
         * Gets or sets the color to use for the axis annotation outline. Leave unset for an automatic value.
        */
        get: function () {
            return brushToString(this.i.oa);
        },
        set: function (v) {
            this.i.oa = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutPadding", {
        /**
         * Gets or sets the padding for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.na;
        },
        set: function (v) {
            this.i.na = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutCollisionMode", {
        /**
         * Gets or sets the padding for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.ms;
        },
        set: function (v) {
            this.i.ms = ensureEnum(CalloutCollisionMode_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutPositionPadding", {
        /**
         * Gets or sets the padding to add to the callout positioning. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.nb;
        },
        set: function (v) {
            this.i.nb = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrCalloutLayer.prototype, "calloutStrokeThickness", {
        /**
         * Gets or sets the stroke thickness for the axis annotation backing. Leave unset for an automatic value.
        */
        get: function () {
            return this.i.nc;
        },
        set: function (v) {
            this.i.nc = +v;
        },
        enumerable: true,
        configurable: true
    });
    return IgrCalloutLayer;
}(IgrAnnotationLayer));
export { IgrCalloutLayer };
