import { EventEmitter, Output, Component, Input } from '@angular/core';
import { delegateCombine } from "igniteui-angular-core";
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 { ensureBool, toPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents the base class for all IgxDataChartComponent radial series
*/
export let IgxRadialBaseComponent = /*@__PURE__*/ (() => {
    class IgxRadialBaseComponent extends IgxMarkerSeriesComponent {
        constructor() {
            super();
            this._assigningRadialStyle = null;
            this._assigningRadialMarkerStyle = null;
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Checks if this series is a radial series
        */
        get isRadial() {
            return this.i.ea;
        }
        /**
         * Gets or sets whether this Radial series should allow custom style overrides of its individual visuals.
        */
        get isCustomRadialStyleAllowed() {
            return this.i.r6;
        }
        set isCustomRadialStyleAllowed(v) {
            this.i.r6 = ensureBool(v);
        }
        /**
         * Gets or sets whether this Radial series should allow custom style overrides of its individual marker visuals.
        */
        get isCustomRadialMarkerStyleAllowed() {
            return this.i.r5;
        }
        set isCustomRadialMarkerStyleAllowed(v) {
            this.i.r5 = ensureBool(v);
        }
        /**
         * Gets the effective angle axis for the current series object.
        */
        get angleAxis() {
            if (this.i.rk == null) {
                return null;
            }
            if (!this.i.rk.externalObject) {
                let e = IgxCategoryAngleAxisComponent._createFromInternal(this.i.rk);
                if (e) {
                    e._implementation = this.i.rk;
                }
                this.i.rk.externalObject = e;
            }
            return this.i.rk.externalObject;
        }
        set angleAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.rk = null : this.i.rk = v.i;
        }
        /**
         * Gets the effective value axis for the current series object.
        */
        get valueAxis() {
            if (this.i.rr == null) {
                return null;
            }
            if (!this.i.rr.externalObject) {
                let e = IgxNumericRadiusAxisComponent._createFromInternal(this.i.rr);
                if (e) {
                    e._implementation = this.i.rr;
                }
                this.i.rr.externalObject = e;
            }
            return this.i.rr.externalObject;
        }
        set valueAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.rr = null : this.i.rr = v.i;
        }
        /**
         * Gets or sets whether to clip the series to the bounds.
         * Setting this property to true will decrease chart performance.
        */
        get clipSeriesToBounds() {
            return this.i.r4;
        }
        set clipSeriesToBounds(v) {
            this.i.r4 = ensureBool(v);
        }
        findByName(name) {
            var baseResult = super.findByName(name);
            if (baseResult) {
                return baseResult;
            }
            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;
        }
        _styling(container, component, parent) {
            super._styling(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
        */
        canUseAsValueAxis(axis) {
            let iv = this.i.r3(axis);
            return (iv);
        }
        /**
         * Determine if object can be used as AngleAxis
        
        * @param axis  * The object to check
        */
        canUseAsAngleAxis(axis) {
            let iv = this.i.r2(axis);
            return (iv);
        }
        /**
         * Gets the item that is the best match for the specified world coordinates.
        
        * @param world  * The world coordinates to use.
        */
        getItem(world) {
            let iv = this.i.ht(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
        */
        getAngleFromWorld(world) {
            let iv = this.i.sb(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.
        */
        getExactItemIndex(world) {
            let iv = this.i.f5(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.
        */
        getItemIndex(world) {
            let iv = this.i.hd(toPoint(world));
            return (iv);
        }
        /**
         * Scrolls the specified item into the view.
        
        * @param item  * The item to scroll into view.
        */
        scrollIntoView(item) {
            let iv = this.i.en(item);
            return (iv);
        }
        /**
         * Returns the offset value for this series if grouped on a category axis.
        
        */
        getOffsetValue() {
            let iv = this.i.getOffsetValue();
            return (iv);
        }
        /**
         * Returns the width of the category grouping this series is in.
        
        */
        getCategoryWidth() {
            let iv = this.i.getCategoryWidth();
            return (iv);
        }
        /**
         * Event raised when Assigning Category Style
        */
        get assigningRadialStyle() {
            if (this._assigningRadialStyle == null) {
                this._assigningRadialStyle = new EventEmitter();
                this.i.assigningRadialStyle = delegateCombine(this.i.assigningRadialStyle, (o, e) => {
                    let outerArgs = new IgxAssigningRadialStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeAssigningRadialStyle) {
                        this.beforeAssigningRadialStyle(this, outerArgs);
                    }
                    this._assigningRadialStyle.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningRadialStyle;
        }
        /**
         * Event raised when Assigning Radial Marker Style
        */
        get assigningRadialMarkerStyle() {
            if (this._assigningRadialMarkerStyle == null) {
                this._assigningRadialMarkerStyle = new EventEmitter();
                this.i.assigningRadialMarkerStyle = delegateCombine(this.i.assigningRadialMarkerStyle, (o, e) => {
                    let outerArgs = new IgxAssigningRadialMarkerStyleEventArgs();
                    outerArgs._provideImplementation(e);
                    if (this.beforeAssigningRadialMarkerStyle) {
                        this.beforeAssigningRadialMarkerStyle(this, outerArgs);
                    }
                    this._assigningRadialMarkerStyle.emit({
                        sender: this,
                        args: outerArgs
                    });
                });
            }
            return this._assigningRadialMarkerStyle;
        }
    }
    IgxRadialBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxRadialBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxRadialBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxRadialBaseComponent, selector: "ng-component", inputs: { isCustomRadialStyleAllowed: "isCustomRadialStyleAllowed", isCustomRadialMarkerStyleAllowed: "isCustomRadialMarkerStyleAllowed", angleAxis: "angleAxis", valueAxis: "valueAxis", clipSeriesToBounds: "clipSeriesToBounds" }, outputs: { assigningRadialStyle: "assigningRadialStyle", assigningRadialMarkerStyle: "assigningRadialMarkerStyle" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true });
    return IgxRadialBaseComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxRadialBaseComponent, decorators: [{
            type: Component,
            args: [{
                    template: ``,
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { isCustomRadialStyleAllowed: [{
                type: Input
            }], isCustomRadialMarkerStyleAllowed: [{
                type: Input
            }], angleAxis: [{
                type: Input
            }], valueAxis: [{
                type: Input
            }], clipSeriesToBounds: [{
                type: Input
            }], assigningRadialStyle: [{
                type: Output
            }], assigningRadialMarkerStyle: [{
                type: Output
            }] } });
