import { __extends } from "tslib";
import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
import { RadialLabelMode_$type } from "igniteui-angular-core";
import { CategoryCollisionMode_$type } from "./CategoryCollisionMode";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { IgxCategoryAngleAxisComponent } from "./igx-category-angle-axis-component";
import { IgxNumericRadiusAxisComponent } from "./igx-numeric-radius-axis-component";
import { IgxAssigningRadialStyleEventArgs } from "./igx-assigning-radial-style-event-args";
import { IgxAssigningRadialMarkerStyleEventArgs } from "./igx-assigning-radial-marker-style-event-args";
import { IgxMarkerSeriesComponent } from "./igx-marker-series-component";
import { ensureEnum, ensureBool, arrayFindByName, toPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class for all IgxDataChartComponent radial series
*/
var IgxRadialBaseComponent = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgxRadialBaseComponent, _super);
    function IgxRadialBaseComponent() {
        var _this = _super.call(this) || this;
        _this._assigningRadialStyle = null;
        _this._assigningRadialMarkerStyle = null;
        return _this;
    }
    Object.defineProperty(IgxRadialBaseComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "autoCalloutLabelPrecision", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.z4;
        },
        set: function (v) {
            this.i.z4 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "autoCalloutPercentagePrecision", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.z5;
        },
        set: function (v) {
            this.i.z5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "autoCalloutLabelValueSeparator", {
        /**
         * Gets or sets the labelling mode to use for the auto callouts in preference to their mode.
        */
        get: function () {
            return this.i.aad;
        },
        set: function (v) {
            this.i.aad = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "legendRadialLabelMode", {
        /**
         * Gets or sets the labelling mode to use for the auto callouts in preference to their mode.
        */
        get: function () {
            return this.i.zf;
        },
        set: function (v) {
            this.i.zf = ensureEnum(RadialLabelMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "categoryCollisionMode", {
        /**
         * Gets or sets the category collision mode selection behavior to use for the series.
        */
        get: function () {
            return this.i.y0;
        },
        set: function (v) {
            this.i.y0 = ensureEnum(CategoryCollisionMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "autoCalloutRadialLabelMode", {
        /**
         * Gets or sets the labelling mode to use for the auto callouts in preference to their mode.
        */
        get: function () {
            return this.i.ze;
        },
        set: function (v) {
            this.i.ze = ensureEnum(RadialLabelMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "autoCalloutOthersLabelFormat", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.aaf;
        },
        set: function (v) {
            this.i.aaf = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "autoCalloutOthersLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the auto callouts for the others category.
        */
        get: function () {
            return this.i.ym;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.ym = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "proportionalRadialLabelFormat", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.aa2;
        },
        set: function (v) {
            this.i.aa2 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "proportionalRadialLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the auto callouts for the others category.
        */
        get: function () {
            return this.i.yr;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.yr = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "legendProportionalRadialLabelFormat", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.aas;
        },
        set: function (v) {
            this.i.aas = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "legendProportionalRadialLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the auto callouts for the others category.
        */
        get: function () {
            return this.i.yo;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.yo = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "othersProportionalRadialLabelFormat", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.aaz;
        },
        set: function (v) {
            this.i.aaz = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "othersProportionalRadialLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the auto callouts for the others category.
        */
        get: function () {
            return this.i.yq;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.yq = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "othersLegendProportionalRadialLabelFormat", {
        /**
         * Gets or sets the format string to use for the auto callout labels for the others category.
        */
        get: function () {
            return this.i.aaw;
        },
        set: function (v) {
            this.i.aaw = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "othersLegendProportionalRadialLabelFormatSpecifiers", {
        /**
         * Gets or sets the format specifiers to use with the auto callouts for the others category.
        */
        get: function () {
            return this.i.yp;
        },
        set: function (v) {
            if (v && !Array.isArray(v) && typeof (v) == "string") {
                var re = /\s*(?:,|\s|$)\s*/gm;
                v = v.split(re);
            }
            this.i.yp = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isRadial", {
        /**
         * Checks if this series is a radial series
        */
        get: function () {
            return this.i.ft;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isCustomRadialStyleAllowed", {
        /**
         * Gets or sets whether this Radial series should allow custom style overrides of its individual visuals.
        */
        get: function () {
            return this.i.zs;
        },
        set: function (v) {
            this.i.zs = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isCustomRadialMarkerStyleAllowed", {
        /**
         * Gets or sets whether this Radial series should allow custom style overrides of its individual marker visuals.
        */
        get: function () {
            return this.i.zr;
        },
        set: function (v) {
            this.i.zr = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "transitionInMode", {
        /**
         * Gets or sets the method by which to animate the data into the chart when the chart data source is swapped.
         * Note: Transitions are not currently supported for stacked series.
        */
        get: function () {
            return this.i.y3;
        },
        set: function (v) {
            this.i.y3 = ensureEnum(CategoryTransitionInMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "isTransitionInEnabled", {
        /**
         * Gets or sets whether the series should transition into the plot area when a new data source is assigned.
         * Note: Transitions are not currently supported for stacked series.
        */
        get: function () {
            return this.i.zt;
        },
        set: function (v) {
            this.i.zt = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "angleAxis", {
        /**
         * Gets the effective angle axis for the current series object.
        */
        get: function () {
            var r = this.i.yz;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxCategoryAngleAxisComponent._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.yz = null : this.i.yz = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "valueAxis", {
        /**
         * Gets the effective value axis for the current series object.
        */
        get: function () {
            var r = this.i.y5;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                var e = IgxNumericRadiusAxisComponent._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.y5 = null : this.i.y5 = v.i;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "clipSeriesToBounds", {
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this property to true will decrease chart performance.
        */
        get: function () {
            return this.i.zq;
        },
        set: function (v) {
            this.i.zq = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    IgxRadialBaseComponent.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.autoCalloutOthersLabelFormatSpecifiers != null && arrayFindByName(this.autoCalloutOthersLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.autoCalloutOthersLabelFormatSpecifiers, name);
        }
        if (this.proportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.proportionalRadialLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.proportionalRadialLabelFormatSpecifiers, name);
        }
        if (this.legendProportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.legendProportionalRadialLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.legendProportionalRadialLabelFormatSpecifiers, name);
        }
        if (this.othersProportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.othersProportionalRadialLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.othersProportionalRadialLabelFormatSpecifiers, name);
        }
        if (this.othersLegendProportionalRadialLabelFormatSpecifiers != null && arrayFindByName(this.othersLegendProportionalRadialLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.othersLegendProportionalRadialLabelFormatSpecifiers, name);
        }
        if (this.angleAxis && this.angleAxis.name && this.angleAxis.name == name) {
            return this.angleAxis;
        }
        if (this.valueAxis && this.valueAxis.name && this.valueAxis.name == name) {
            return this.valueAxis;
        }
        return null;
    };
    IgxRadialBaseComponent.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.angleAxis && this.angleAxis._styling) {
            this.angleAxis._styling(container, component, this);
        }
        if (this.valueAxis && this.valueAxis._styling) {
            this.valueAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Determine if object can be used as ValueAxis
    
    * @param axis  * The object to check
    */
    IgxRadialBaseComponent.prototype.canUseAsValueAxis = function (axis) {
        var iv = this.i.zp(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as AngleAxis
    
    * @param axis  * The object to check
    */
    IgxRadialBaseComponent.prototype.canUseAsAngleAxis = function (axis) {
        var iv = this.i.zo(axis);
        return (iv);
    };
    /**
     * Gets the item that is the best match for the specified world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    IgxRadialBaseComponent.prototype.getItem = function (world) {
        var iv = this.i.kn(toPoint(world));
        return (iv);
    };
    /**
     * Gets the angle to the provided world position from the center of the radial series.
    
    * @param world  * The world position to get the angle for
    */
    IgxRadialBaseComponent.prototype.getAngleFromWorld = function (world) {
        var iv = this.i.zz(toPoint(world));
        return (iv);
    };
    /**
     * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex.
    
    * @param world  * The world position for which to return the index.
    */
    IgxRadialBaseComponent.prototype.getExactItemIndex = function (world) {
        var iv = this.i.ir(toPoint(world));
        return (iv);
    };
    /**
     * Get the index of the item near the provided world coordinates.
    
    * @param world  * The world coordinates for which to getch the item index.
    */
    IgxRadialBaseComponent.prototype.getItemIndex = function (world) {
        var iv = this.i.j3(toPoint(world));
        return (iv);
    };
    /**
     * Scrolls the specified item into the view.
    
    * @param item  * The item to scroll into view.
    */
    IgxRadialBaseComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.gd(item);
        return (iv);
    };
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    */
    IgxRadialBaseComponent.prototype.getOffsetValue = function () {
        var iv = this.i.getOffsetValue();
        return (iv);
    };
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    IgxRadialBaseComponent.prototype.getCategoryWidth = function () {
        var iv = this.i.getCategoryWidth();
        return (iv);
    };
    Object.defineProperty(IgxRadialBaseComponent.prototype, "assigningRadialStyle", {
        /**
         * Event raised when Assigning Category Style
        */
        get: function () {
            var _this = this;
            if (this._assigningRadialStyle == null) {
                this._assigningRadialStyle = new EventEmitter();
                this.i.assigningRadialStyle = delegateCombine(this.i.assigningRadialStyle, function (o, e) {
                    var outerArgs = new IgxAssigningRadialStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningRadialStyle) {
                        _this.beforeAssigningRadialStyle(_this, outerArgs);
                    }
                    _this._assigningRadialStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningRadialStyle;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgxRadialBaseComponent.prototype, "assigningRadialMarkerStyle", {
        /**
         * Event raised when Assigning Radial Marker Style
        */
        get: function () {
            var _this = this;
            if (this._assigningRadialMarkerStyle == null) {
                this._assigningRadialMarkerStyle = new EventEmitter();
                this.i.assigningRadialMarkerStyle = delegateCombine(this.i.assigningRadialMarkerStyle, function (o, e) {
                    var outerArgs = new IgxAssigningRadialMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (_this.beforeAssigningRadialMarkerStyle) {
                        _this.beforeAssigningRadialMarkerStyle(_this, outerArgs);
                    }
                    _this._assigningRadialMarkerStyle.emit({
                        sender: _this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningRadialMarkerStyle;
        },
        enumerable: false,
        configurable: true
    });
    IgxRadialBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxRadialBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxRadialBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxRadialBaseComponent, selector: "ng-component", inputs: { autoCalloutLabelPrecision: "autoCalloutLabelPrecision", autoCalloutPercentagePrecision: "autoCalloutPercentagePrecision", autoCalloutLabelValueSeparator: "autoCalloutLabelValueSeparator", legendRadialLabelMode: "legendRadialLabelMode", categoryCollisionMode: "categoryCollisionMode", autoCalloutRadialLabelMode: "autoCalloutRadialLabelMode", autoCalloutOthersLabelFormat: "autoCalloutOthersLabelFormat", autoCalloutOthersLabelFormatSpecifiers: "autoCalloutOthersLabelFormatSpecifiers", proportionalRadialLabelFormat: "proportionalRadialLabelFormat", proportionalRadialLabelFormatSpecifiers: "proportionalRadialLabelFormatSpecifiers", legendProportionalRadialLabelFormat: "legendProportionalRadialLabelFormat", legendProportionalRadialLabelFormatSpecifiers: "legendProportionalRadialLabelFormatSpecifiers", othersProportionalRadialLabelFormat: "othersProportionalRadialLabelFormat", othersProportionalRadialLabelFormatSpecifiers: "othersProportionalRadialLabelFormatSpecifiers", othersLegendProportionalRadialLabelFormat: "othersLegendProportionalRadialLabelFormat", othersLegendProportionalRadialLabelFormatSpecifiers: "othersLegendProportionalRadialLabelFormatSpecifiers", isCustomRadialStyleAllowed: "isCustomRadialStyleAllowed", isCustomRadialMarkerStyleAllowed: "isCustomRadialMarkerStyleAllowed", transitionInMode: "transitionInMode", isTransitionInEnabled: "isTransitionInEnabled", angleAxis: "angleAxis", valueAxis: "valueAxis", clipSeriesToBounds: "clipSeriesToBounds" }, outputs: { assigningRadialStyle: "assigningRadialStyle", assigningRadialMarkerStyle: "assigningRadialMarkerStyle" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
    return IgxRadialBaseComponent;
}(IgxMarkerSeriesComponent));
export { IgxRadialBaseComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxRadialBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: "",
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { autoCalloutLabelPrecision: [{
                type: Input
            }], autoCalloutPercentagePrecision: [{
                type: Input
            }], autoCalloutLabelValueSeparator: [{
                type: Input
            }], legendRadialLabelMode: [{
                type: Input
            }], categoryCollisionMode: [{
                type: Input
            }], autoCalloutRadialLabelMode: [{
                type: Input
            }], autoCalloutOthersLabelFormat: [{
                type: Input
            }], autoCalloutOthersLabelFormatSpecifiers: [{
                type: Input
            }], proportionalRadialLabelFormat: [{
                type: Input
            }], proportionalRadialLabelFormatSpecifiers: [{
                type: Input
            }], legendProportionalRadialLabelFormat: [{
                type: Input
            }], legendProportionalRadialLabelFormatSpecifiers: [{
                type: Input
            }], othersProportionalRadialLabelFormat: [{
                type: Input
            }], othersProportionalRadialLabelFormatSpecifiers: [{
                type: Input
            }], othersLegendProportionalRadialLabelFormat: [{
                type: Input
            }], othersLegendProportionalRadialLabelFormatSpecifiers: [{
                type: Input
            }], isCustomRadialStyleAllowed: [{
                type: Input
            }], isCustomRadialMarkerStyleAllowed: [{
                type: Input
            }], transitionInMode: [{
                type: Input
            }], isTransitionInEnabled: [{
                type: Input
            }], angleAxis: [{
                type: Input
            }], valueAxis: [{
                type: Input
            }], clipSeriesToBounds: [{
                type: Input
            }], assigningRadialStyle: [{
                type: Output
            }], assigningRadialMarkerStyle: [{
                type: Output
            }] } });
