import { __extends } from "tslib";
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { IgxBrushScaleComponent } from "./igx-brush-scale-component";
import { ShapeItemSearchMode_$type } from "./ShapeItemSearchMode";
import { IgxNumericXAxisComponent } from "./igx-numeric-x-axis-component";
import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component";
import { IgxAssigningShapeStyleEventArgs } from "./igx-assigning-shape-style-event-args";
import { IgxAssigningShapeMarkerStyleEventArgs } from "./igx-assigning-shape-marker-style-event-args";
import { IgxStyleShapeEventArgs } from "./igx-style-shape-event-args";
import { IgxSeriesComponent } from "./igx-series-component";
import { ensureBool, ensureEnum, toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Series class for rendering polygons.
*/
var IgxShapeSeriesBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxShapeSeriesBaseComponent, _super);
    function IgxShapeSeriesBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningShapeStyle = null;
        _this._assigningShapeMarkerStyle = null;
        _this._styleShape = null;
        return _this;
    }
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isCustomShapeStyleAllowed", {
        /**
         * Gets or sets whether this Shape series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.x6;
        },
        set: function (v) {
            this.i.x6 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isCustomShapeMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Shape series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.x5;
        },
        set: function (v) {
            this.i.x5 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "fillMemberPath", {
        /**
         * Gets or sets the fill mapping property for the current series object.
        */
        get: function () {
            return this.i.ys;
        },
        set: function (v) {
            this.i.ys = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "fillScale", {
        /**
         * Gets or sets the brush scale for the fill brush of markers.
        */
        get: function () {
            var r = this.i.w8;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxBrushScaleComponent._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.w8 = null : this.i.w8 = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "fillScaleUseGlobalValues", {
        /**
         * Gets or sets whether or not the FillScale uses global min/max values of FillMemberPath from multiple series.
         * This setting applies only if multiple series are using the same FillScale.
        */
        get: function () {
            return this.i.x1;
        },
        set: function (v) {
            this.i.x1 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "actualItemSearchMode", {
        get: function () {
            return this.i.xg;
        },
        set: function (v) {
            this.i.xg = ensureEnum(ShapeItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "itemSearchMode", {
        /**
         * Gets or sets the mode the series will use to find the closest point to the cursor.
        */
        get: function () {
            return this.i.xi;
        },
        set: function (v) {
            this.i.xi = ensureEnum(ShapeItemSearchMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "itemSearchThreshold", {
        /**
         * Gets or sets the threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.yo;
        },
        set: function (v) {
            this.i.yo = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "itemSearchPointsThreshold", {
        /**
         * Gets or sets the points threshold to use when searching for items using ItemSearchMode.
        */
        get: function () {
            return this.i.yn;
        },
        set: function (v) {
            this.i.yn = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "shapeMemberPath", {
        /**
         * The name of the property on ItemsSource items which, for each shape, contains a list of points to be converted to a polygon.
         * To be consistent with the Shapefile technical description, it is expected that each list of points is defined as an IEnumerable of IEnumerable of Point, or in other words, a list of lists of points.
        */
        get: function () {
            return this.i.y5;
        },
        set: function (v) {
            this.i.y5 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "highlightedShapeMemberPath", {
        /**
         * Gets or sets the value mapping property for the current series object.
        */
        get: function () {
            return this.i.yw;
        },
        set: function (v) {
            this.i.yw = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for the current ScatterBase object.
        */
        get: function () {
            var r = this.i.xc;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericXAxisComponent._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.xc = null : this.i.xc = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for the current ScatterBase object.
        */
        get: function () {
            var r = this.i.xe;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericYAxisComponent._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.xe = null : this.i.xe = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "shapeFilterResolution", {
        /**
         * The resolution at which to filter out shapes in the series.  For example, if the ShapeFilterResolution is set to 3, then elements with a bounding rectangle smaller than 3 X 3 pixels will be filtered out.
         * In the case of ScatterPolylineSeries, the resolution is compared to either dimension, rather than both.  In other words, a polyline will not be filtered if its height or its width exceeds the value of this property.  Whereas with a ShapeSeries, both the height and the width must exceed the value of this property.
        */
        get: function () {
            return this.i.yk;
        },
        set: function (v) {
            this.i.yk = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isShape", {
        /**
         * Gets whether or not this series is a shape series
        */
        get: function () {
            return this.i.fx;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "isMarkerlessDisplayPreferred", {
        /**
         * Overridden by derived series classes to indicate when marker-less display is preferred or not.
        */
        get: function () {
            return this.i.fl;
        },
        enumerable: false,
        configurable: true
    });
    IgxShapeSeriesBaseComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.fillScale && this.fillScale.name && this.fillScale.name == name) {
            return this.fillScale;
        }
        if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
            return this.xAxis;
        }
        if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
            return this.yAxis;
        }
        return null;
    };
    IgxShapeSeriesBaseComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.fillScale && this.fillScale._styling) {
            this.fillScale._styling(container, component, this);
        }
        if (this.xAxis && this.xAxis._styling) {
            this.xAxis._styling(container, component, this);
        }
        if (this.yAxis && this.yAxis._styling) {
            this.yAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    IgxShapeSeriesBaseComponent.prototype.getItemValue = function (item, memberPathName) {
        var iv = this.i.kq(item, memberPathName);
        return (iv);
    };
    /**
     * Gets the value of a requested member path from the series.
    
    * @param memberPathName  * The property name of a valid member path for the series
    */
    IgxShapeSeriesBaseComponent.prototype.getMemberPathValue = function (memberPathName) {
        var iv = this.i.md(memberPathName);
        return (iv);
    };
    IgxShapeSeriesBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.ir(toPoint(world));
        return (iv);
    };
    IgxShapeSeriesBaseComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.wa(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxShapeSeriesBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.kn(toPoint(world));
        return (iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    IgxShapeSeriesBaseComponent.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.x0(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    IgxShapeSeriesBaseComponent.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.xz(axis);
        return (iv);
    };
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "assigningShapeStyle", {
        /**
         * Event raised when Assigning Shape Style. Note, if using this event, or highlighting, its best to avoid use of ShapeStyle/StyleShape/ShapeStyleSelector.
        */
        get: function () {
            var _this = this;
            if (this._assigningShapeStyle == null) {
                this._assigningShapeStyle = new EventEmitter();
                this.i.assigningShapeStyle = delegateCombine(this.i.assigningShapeStyle, function (o, e) {
                    var outerArgs = new IgxAssigningShapeStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningShapeStyle) {
                        _this.beforeAssigningShapeStyle(_this, outerArgs);
                    }
                    _this._assigningShapeStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningShapeStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "assigningShapeMarkerStyle", {
        /**
         * Event raised when Assigning Shape Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningShapeMarkerStyle == null) {
                this._assigningShapeMarkerStyle = new EventEmitter();
                this.i.assigningShapeMarkerStyle = delegateCombine(this.i.assigningShapeMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningShapeMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningShapeMarkerStyle) {
                        _this.beforeAssigningShapeMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningShapeMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningShapeMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxShapeSeriesBaseComponent.prototype, "styleShape", {
        /**
         * Raised when tile's image URI should be provided
        */
        get: function () {
            var _this = this;
            if (this._styleShape == null) {
                this._styleShape = new EventEmitter();
                this.i.styleShape = delegateCombine(this.i.styleShape, function (o, e) {
                    var outerArgs = new IgxStyleShapeEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeStyleShape) {
                        _this.beforeStyleShape(_this, outerArgs);
                    }
                    _this._styleShape.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._styleShape;
        },
        enumerable: false,
        configurable: true
    });
    IgxShapeSeriesBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxShapeSeriesBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxShapeSeriesBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxShapeSeriesBaseComponent, selector: "ng-component", inputs: { isCustomShapeStyleAllowed: "isCustomShapeStyleAllowed", isCustomShapeMarkerStyleAllowed: "isCustomShapeMarkerStyleAllowed", fillMemberPath: "fillMemberPath", fillScale: "fillScale", fillScaleUseGlobalValues: "fillScaleUseGlobalValues", actualItemSearchMode: "actualItemSearchMode", itemSearchMode: "itemSearchMode", itemSearchThreshold: "itemSearchThreshold", itemSearchPointsThreshold: "itemSearchPointsThreshold", shapeMemberPath: "shapeMemberPath", highlightedShapeMemberPath: "highlightedShapeMemberPath", xAxis: "xAxis", yAxis: "yAxis", shapeFilterResolution: "shapeFilterResolution" }, outputs: { assigningShapeStyle: "assigningShapeStyle", assigningShapeMarkerStyle: "assigningShapeMarkerStyle", styleShape: "styleShape" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxShapeSeriesBaseComponent;
}(IgxSeriesComponent));
export { IgxShapeSeriesBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxShapeSeriesBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { isCustomShapeStyleAllowed: [{
                type: Input
            }], isCustomShapeMarkerStyleAllowed: [{
                type: Input
            }], fillMemberPath: [{
                type: Input
            }], fillScale: [{
                type: Input
            }], fillScaleUseGlobalValues: [{
                type: Input
            }], actualItemSearchMode: [{
                type: Input
            }], itemSearchMode: [{
                type: Input
            }], itemSearchThreshold: [{
                type: Input
            }], itemSearchPointsThreshold: [{
                type: Input
            }], shapeMemberPath: [{
                type: Input
            }], highlightedShapeMemberPath: [{
                type: Input
            }], xAxis: [{
                type: Input
            }], yAxis: [{
                type: Input
            }], shapeFilterResolution: [{
                type: Input
            }], assigningShapeStyle: [{
                type: Output
            }], assigningShapeMarkerStyle: [{
                type: Output
            }], styleShape: [{
                type: Output
            }] } });
