import { delegateCombine, delegateRemove } from "igniteui-react-core/ES2015/type";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { AssigningCategoryStyleEventArgs } from "./igr-assigning-category-style-event-args";
import { AssigningCategoryMarkerStyleEventArgs } from "./igr-assigning-category-marker-style-event-args";
import { IgrMarkerSeries } from "./igr-marker-series";
import { ensureBool, ensureEnum, toPoint } from "igniteui-react-core/ES2015/componentUtil";
/**
 * Represents the base class for IgxDataChartComponent category series.
*/
export class IgrCategorySeries extends IgrMarkerSeries {
    constructor(props) {
        super(props);
        this._assigningCategoryStyle = null;
        this._assigningCategoryStyle_wrapped = null;
        this._assigningCategoryMarkerStyle = null;
        this._assigningCategoryMarkerStyle_wrapped = null;
    }
    get i() {
        return this._implementation;
    }
    /**
     * Gets whether or not this series is Category series
    */
    get isCategory() {
        return this.i.cl;
    }
    /**
     * Gets or sets whether this category series should allow custom style overrides of its individual visuals.
    */
    get isCustomCategoryStyleAllowed() {
        return this.i.nq;
    }
    set isCustomCategoryStyleAllowed(v) {
        this.i.nq = ensureBool(v);
    }
    /**
     * Gets or sets whether this category series should allow custom style overrides of its individual marker visuals.
    */
    get isCustomCategoryMarkerStyleAllowed() {
        return this.i.np;
    }
    set isCustomCategoryMarkerStyleAllowed(v) {
        this.i.np = ensureBool(v);
    }
    /**
     * Sets or Gets whether to increase marker fidelity for extreme data shapes that have lots of Y variation over short X intervals.
    *
    * Set `useHighMarkerFidelity` when your data has high variation along the y-axis within a short span of this x-axis.
    */
    get useHighMarkerFidelity() {
        return this.i.nv;
    }
    set useHighMarkerFidelity(v) {
        this.i.nv = ensureBool(v);
    }
    /**
     * 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.
    *
    * `transitionInMode` controls the direction of the transition-in animation.
    */
    get transitionInMode() {
        return this.i.na;
    }
    set transitionInMode(v) {
        this.i.na = ensureEnum(CategoryTransitionInMode_$type, v);
    }
    /**
     * 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.
    *
    * Set `isTransitionInEnabled` to true if you want your chart series to animate into position when the chart is loading into view.
    */
    get isTransitionInEnabled() {
        return this.i.nr;
    }
    set isTransitionInEnabled(v) {
        this.i.nr = ensureBool(v);
    }
    /**
     * 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);
    }
    /**
     * 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.fm(toPoint(world));
        return (iv);
    }
    /**
     * Gets the index of the item based on world coordinates.
    
    * @param world  * The world coordinates to use.
    */
    getItemIndex(world) {
        let iv = this.i.e5(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.d8(toPoint(world));
        return (iv);
    }
    /**
     * Event raised when Assigning Category Style
    */
    get assigningCategoryStyle() {
        return this._assigningCategoryStyle;
    }
    set assigningCategoryStyle(ev) {
        if (this._assigningCategoryStyle_wrapped !== null) {
            this.i.assigningCategoryStyle = delegateRemove(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped);
            this._assigningCategoryStyle_wrapped = null;
            this._assigningCategoryStyle = null;
        }
        this._assigningCategoryStyle = ev;
        this._assigningCategoryStyle_wrapped = (o, e) => {
            let outerArgs = new AssigningCategoryStyleEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeAssigningCategoryStyle) {
                this.beforeAssigningCategoryStyle(this, outerArgs);
            }
            if (this._assigningCategoryStyle) {
                this._assigningCategoryStyle(this, outerArgs);
            }
        };
        this.i.assigningCategoryStyle = delegateCombine(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped);
    }
    /**
     * Event raised when Assigning Category Marker Style
    */
    get assigningCategoryMarkerStyle() {
        return this._assigningCategoryMarkerStyle;
    }
    set assigningCategoryMarkerStyle(ev) {
        if (this._assigningCategoryMarkerStyle_wrapped !== null) {
            this.i.assigningCategoryMarkerStyle = delegateRemove(this.i.assigningCategoryMarkerStyle, this._assigningCategoryMarkerStyle_wrapped);
            this._assigningCategoryMarkerStyle_wrapped = null;
            this._assigningCategoryMarkerStyle = null;
        }
        this._assigningCategoryMarkerStyle = ev;
        this._assigningCategoryMarkerStyle_wrapped = (o, e) => {
            let outerArgs = new AssigningCategoryMarkerStyleEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeAssigningCategoryMarkerStyle) {
                this.beforeAssigningCategoryMarkerStyle(this, outerArgs);
            }
            if (this._assigningCategoryMarkerStyle) {
                this._assigningCategoryMarkerStyle(this, outerArgs);
            }
        };
        this.i.assigningCategoryMarkerStyle = delegateCombine(this.i.assigningCategoryMarkerStyle, this._assigningCategoryMarkerStyle_wrapped);
    }
}
