import * as React from 'react';
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { LabelsPosition_$type } from "./LabelsPosition";
import { Visibility_$type } from "igniteui-react-core";
import { LeaderLineType_$type } from "./LeaderLineType";
import { OthersCategoryType_$type } from "./OthersCategoryType";
import { IgrIndexCollection } from "./igr-index-collection";
import { SweepDirection_$type } from "igniteui-react-core";
import { SliceSelectionMode_$type } from "./SliceSelectionMode";
import { IgrObjectCollection } from "igniteui-react-core";
import { IgrLabelClickEventArgs } from "./igr-label-click-event-args";
import { IgrSelectedItemChangingEventArgs } from "./igr-selected-item-changing-event-args";
import { IgrSelectedItemsChangingEventArgs } from "./igr-selected-items-changing-event-args";
import { IgrSelectedItemChangedEventArgs } from "./igr-selected-item-changed-event-args";
import { IgrSelectedItemsChangedEventArgs } from "./igr-selected-items-changed-event-args";
import { IgrSliceClickEventArgs } from "./igr-slice-click-event-args";
import { TypeRegistrar, Number_$type, Base } from "igniteui-react-core";
import { NamePatcher, getModifiedProps, isValidProp, ensureEnum, brushToString, stringToBrush, ensureBool, toBrushCollection, fromBrushCollection, arrayFindByName, toSpinal, initializePropertiesFromCss, toPoint } from "igniteui-react-core";
import { IndexCollection as IndexCollection_internal } from "./IndexCollection";
import { SyncableObservableCollection$1 } from "igniteui-react-core";
import { Style } from "igniteui-react-core";
import { ObjectCollection as ObjectCollection_internal } from "igniteui-react-core";
/**
 * Represents the base class for the pie chart.
*/
export class IgrPieChartBase extends React.Component {
    constructor(props) {
        super(props);
        this._explodedSlices = null;
        this._selectedItems = null;
        this.__p = null;
        this._hasUserValues = new Set();
        this._stylingContainer = null;
        this._stylingParent = null;
        this._inStyling = false;
        this._labelClick = null;
        this._labelClick_wrapped = null;
        this._selectedItemChanging = null;
        this._selectedItemChanging_wrapped = null;
        this._selectedItemsChanging = null;
        this._selectedItemsChanging_wrapped = null;
        this._selectedItemChanged = null;
        this._selectedItemChanged_wrapped = null;
        this._selectedItemsChanged = null;
        this._selectedItemsChanged_wrapped = null;
        this._sliceClick = null;
        this._sliceClick_wrapped = null;
        if (this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
        }
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return null;
    }
    /**
     * @hidden
     */
    get i() {
        return this._implementation;
    } /**
                                 * @hidden
                                 */
    static _createFromInternal(internal) {
        if (!internal) {
            return null;
        }
        if (!internal.$type) {
            return null;
        }
        let name = internal.$type.name;
        let externalName = "Igr" + name;
        if (!TypeRegistrar.isRegistered(externalName)) {
            return null;
        }
        return TypeRegistrar.create(externalName);
    }
    onImplementationCreated() {
    }
    componentDidMount() {
        for (const p of Object.keys(this.props)) {
            if (isValidProp(this, p)) {
                this[p] = this.props[p];
            }
        }
    }
    shouldComponentUpdate(nextProps, nextState) {
        const mod = getModifiedProps(this.props, nextProps);
        for (const p of Object.keys(mod)) {
            if (isValidProp(this, p)) {
                this[p] = mod[p];
            }
        }
        return true;
    }
    render() {
        return null;
    }
    /**
     * Gets or sets the amount of space between the center and the start of the arc. This property should be set between 0 and 1.
     * If InnerExtent is set to a value greater than 1, it will be interpreted as a percentage, effectively divided by 100.
    */
    get innerExtent() {
        return this.i.cv;
    }
    set innerExtent(v) {
        this.i.cv = +v;
    }
    /**
     * Gets or Sets the property name that contains the values.
    */
    get valueMemberPath() {
        return this.i.e4;
    }
    set valueMemberPath(v) {
        this.i.e4 = v;
    }
    /**
     * Gets or sets the property name that contains the labels.
    */
    get labelMemberPath() {
        return this.i.dx;
    }
    set labelMemberPath(v) {
        this.i.dx = v;
    }
    /**
     * Gets or sets the property name that contains the legend labels.
    */
    get legendLabelMemberPath() {
        return this.i.ec;
    }
    set legendLabelMemberPath(v) {
        this.i.ec = v;
    }
    /**
     * Gets or sets the position of chart labels.
    */
    get labelsPosition() {
        return this.i.aw;
    }
    set labelsPosition(v) {
        this.i.aw = ensureEnum(LabelsPosition_$type, v);
    }
    /**
     * Gets or sets the color for labels rendered outside of the pie chart.
    */
    get labelOuterColor() {
        return brushToString(this.i.hu);
    }
    set labelOuterColor(v) {
        this.i.hu = stringToBrush(v);
    }
    /**
     * Gets or sets the color for labels rendered inside of the pie chart.
    */
    get labelInnerColor() {
        return brushToString(this.i.ht);
    }
    set labelInnerColor(v) {
        this.i.ht = stringToBrush(v);
    }
    /**
     * Gets or sets whether the leader lines are visible.
    */
    get leaderLineVisibility() {
        return this.i.h6;
    }
    set leaderLineVisibility(v) {
        this.i.h6 = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets what type of leader lines will be used for the outside end labels.
    */
    get leaderLineType() {
        return this.i.ax;
    }
    set leaderLineType(v) {
        this.i.ax = ensureEnum(LeaderLineType_$type, v);
    }
    /**
     * Gets or sets the margin between a label and the end of its leader line. The default is 6 pixels.
    */
    get leaderLineMargin() {
        return this.i.cx;
    }
    set leaderLineMargin(v) {
        this.i.cx = +v;
    }
    /**
     * Gets or sets the ToolTip for the chart.
    */
    get toolTip() {
        return this.i.da;
    }
    set toolTip(v) {
        this.i.da = v;
    }
    /**
     * Gets or sets the threshold value that determines if slices are grouped into the Others slice.
    */
    get othersCategoryThreshold() {
        return this.i.cy;
    }
    set othersCategoryThreshold(v) {
        this.i.cy = +v;
    }
    /**
     * Gets or sets whether to use numeric or percent-based threshold value.
    */
    get othersCategoryType() {
        return this.i.ay;
    }
    set othersCategoryType(v) {
        this.i.ay = ensureEnum(OthersCategoryType_$type, v);
    }
    /**
     * Gets or sets the label of the Others slice.
    */
    get othersCategoryText() {
        return this.i.ej;
    }
    set othersCategoryText(v) {
        this.i.ej = v;
    }
    /**
     * Determines how much the exploded slice is offset from the center. Value between 0 and 1.
    */
    get explodedRadius() {
        return this.i.cq;
    }
    set explodedRadius(v) {
        this.i.cq = +v;
    }
    /**
     * Gets or sets the scaling factor of the chart's radius. Value between 0 and 1.
    */
    get radiusFactor() {
        return this.i.c1;
    }
    set radiusFactor(v) {
        this.i.c1 = +v;
    }
    /**
     * Gets or sets whether the slices can be selected.
    */
    get allowSliceSelection() {
        return this.i.b0;
    }
    set allowSliceSelection(v) {
        this.i.b0 = ensureBool(v);
    }
    /**
     * Gets or sets whether the slices can be exploded.
    */
    get allowSliceExplosion() {
        return this.i.bz;
    }
    set allowSliceExplosion(v) {
        this.i.bz = ensureBool(v);
    }
    /**
     * Gets or sets the collection of exploded slice indices.
    */
    get explodedSlices() {
        if (this._explodedSlices === null) {
            let coll = new IgrIndexCollection();
            let innerColl = this.i.explodedSlices;
            if (!innerColl) {
                innerColl = new IndexCollection_internal();
            }
            this._explodedSlices = coll._fromInner(innerColl);
            this.i.explodedSlices = innerColl;
        }
        return this._explodedSlices;
    }
    set explodedSlices(v) {
        if (this._explodedSlices !== null) {
            this._explodedSlices._setSyncTarget(null);
            this._explodedSlices = null;
        }
        let coll = new IgrIndexCollection();
        this._explodedSlices = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(Number_$type);
        let innerColl = this.i.explodedSlices;
        if (!innerColl) {
            innerColl = new IndexCollection_internal();
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._explodedSlices._setSyncTarget(syncColl);
        this.i.explodedSlices = innerColl;
    }
    /**
     * Gets or sets the pixel amount by which the labels are offset from the edge of the slices.
    */
    get labelExtent() {
        return this.i.cw;
    }
    set labelExtent(v) {
        this.i.cw = +v;
    }
    /**
     * Gets or sets the starting angle of the chart.
     * The default zero value is equivalent to 3 o'clock.
    */
    get startAngle() {
        return this.i.c3;
    }
    set startAngle(v) {
        this.i.c3 = +v;
    }
    /**
     * Gets or sets the rotational direction of the chart.
    */
    get sweepDirection() {
        return this.i.hv;
    }
    set sweepDirection(v) {
        this.i.hv = ensureEnum(SweepDirection_$type, v);
    }
    /**
     * Gets or sets the fill brush.
    */
    get othersCategoryFill() {
        return this.i.h3 ? this.i.h3.fill : null;
    }
    set othersCategoryFill(v) {
        this.ensureOthersCategoryStyle();
        this.i.h3.fill = v;
    }
    /**
     * Gets or sets the stroke brush.
    */
    get othersCategoryStroke() {
        return this.i.h3 ? this.i.h3.stroke : null;
    }
    set othersCategoryStroke(v) {
        this.ensureOthersCategoryStyle();
        this.i.h3.stroke = v;
    }
    /**
     * Gets or sets the stroke thickness.
    */
    get othersCategoryStrokeThickness() {
        return this.i.h3 ? this.i.h3.strokeThickness : NaN;
    }
    set othersCategoryStrokeThickness(v) {
        this.ensureOthersCategoryStyle();
        this.i.h3.strokeThickness = +v;
    }
    /**
     * Gets or sets the opacity.
    */
    get othersCategoryOpacity() {
        return this.i.h3 ? this.i.h3.opacity : NaN;
    }
    set othersCategoryOpacity(v) {
        this.ensureOthersCategoryStyle();
        this.i.h3.opacity = +v;
    }
    ensureOthersCategoryStyle() {
        if (this.i.h3) {
            return;
        }
        this.i.h3 = new Style();
    }
    /**
     * Gets or sets the fill brush.
    */
    get selectedSliceFill() {
        return this.i.h4 ? this.i.h4.fill : null;
    }
    set selectedSliceFill(v) {
        this.ensureSelectedStyle();
        this.i.h4.fill = v;
    }
    /**
     * Gets or sets the stroke brush.
    */
    get selectedSliceStroke() {
        return this.i.h4 ? this.i.h4.stroke : null;
    }
    set selectedSliceStroke(v) {
        this.ensureSelectedStyle();
        this.i.h4.stroke = v;
    }
    /**
     * Gets or sets the stroke thickness.
    */
    get selectedSliceStrokeThickness() {
        return this.i.h4 ? this.i.h4.strokeThickness : NaN;
    }
    set selectedSliceStrokeThickness(v) {
        this.ensureSelectedStyle();
        this.i.h4.strokeThickness = +v;
    }
    /**
     * Gets or sets the opacity.
    */
    get selectedSliceOpacity() {
        return this.i.h4 ? this.i.h4.opacity : NaN;
    }
    set selectedSliceOpacity(v) {
        this.ensureSelectedStyle();
        this.i.h4.opacity = +v;
    }
    ensureSelectedStyle() {
        if (this.i.h4) {
            return;
        }
        this.i.h4 = new Style();
    }
    /**
     * Gets or sets the palette of brushes to use for coloring the slices.
    */
    get brushes() {
        return fromBrushCollection(this.i.ak);
    }
    set brushes(v) {
        this.i.ak = toBrushCollection(v);
    }
    /**
     * Gets or sets the palette of brushes to use for outlines on the slices.
    */
    get outlines() {
        return fromBrushCollection(this.i.al);
    }
    set outlines(v) {
        this.i.al = toBrushCollection(v);
    }
    /**
     * Gets or sets the label format string to use for the label.
    */
    get labelFormat() {
        return this.i.dt;
    }
    set labelFormat(v) {
        this.i.dt = v;
    }
    /**
     * Gets or sets the format specifiers to use with the LabelFormat string.
    */
    get labelFormatSpecifiers() {
        return this.i.ag;
    }
    set labelFormatSpecifiers(v) {
        this.i.ag = v;
    }
    /**
     * Gets or sets the label format string to use for the label.
    */
    get othersLabelFormat() {
        return this.i.en;
    }
    set othersLabelFormat(v) {
        this.i.en = v;
    }
    /**
     * Gets or sets the format specifiers to use with the OthersLabelFormat string.
    */
    get othersLabelFormatSpecifiers() {
        return this.i.aj;
    }
    set othersLabelFormatSpecifiers(v) {
        this.i.aj = v;
    }
    /**
     * Gets or sets the label format string to use for the label.
    */
    get legendLabelFormat() {
        return this.i.d9;
    }
    set legendLabelFormat(v) {
        this.i.d9 = v;
    }
    /**
     * Gets or sets the format specifiers to use with the LegendLabelFormat string.
    */
    get legendLabelFormatSpecifiers() {
        return this.i.ah;
    }
    set legendLabelFormatSpecifiers(v) {
        this.i.ah = v;
    }
    /**
     * Gets or sets the label format string to use for the label.
    */
    get legendOthersLabelFormat() {
        return this.i.ee;
    }
    set legendOthersLabelFormat(v) {
        this.i.ee = v;
    }
    /**
     * Gets or sets the format specifiers to use with the LegendOthersLabelFormat string.
    */
    get legendOthersLabelFormatSpecifiers() {
        return this.i.ai;
    }
    set legendOthersLabelFormatSpecifiers(v) {
        this.i.ai = v;
    }
    /**
     * Gets or sets the LegendItemTemplate property.
     * The legend item control content is created according to the LegendItemTemplate on-demand by
     * the chart object itself.
    */
    get legendItemTemplate() {
        return this.i.legendItemTemplate;
    }
    set legendItemTemplate(v) {
        this.i.legendItemTemplate = v;
    }
    /**
     * Gets or sets the LegendItemBadgeTemplate property.
     * The legend item badge is created according to the LegendItemBadgeTemplate on-demand by
     * the chart object itself.
    */
    get legendItemBadgeTemplate() {
        return this.i.legendItemBadgeTemplate;
    }
    set legendItemBadgeTemplate(v) {
        this.i.legendItemBadgeTemplate = v;
    }
    /**
     * Gets or sets whether all surface interactions with the plot area should be disabled.
    */
    get isSurfaceInteractionDisabled() {
        return this.i.b5;
    }
    set isSurfaceInteractionDisabled(v) {
        this.i.b5 = ensureBool(v);
    }
    /**
     * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart.
    */
    get formatLabel() {
        return this.i.a1;
    }
    set formatLabel(v) {
        this.i.a1 = v;
    }
    /**
     * Sets or gets a function which takes an object that produces a formatted label for displaying in the chart's legend.
    */
    get formatLegendLabel() {
        return this.i.a2;
    }
    set formatLegendLabel(v) {
        this.i.a2 = v;
    }
    /**
     * Gets or sets the scaling value used to affect the pixel density of the control.
     * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
     * to appear blurry.
    */
    get pixelScalingRatio() {
        return this.i.c0;
    }
    set pixelScalingRatio(v) {
        this.i.c0 = +v;
    }
    /**
     * Resolved pixel scaling ratio. Unless explicitly overridden by the PieChartBase.PixelScalingRatio property,
     * this one returns the default ratio enforced by device. High resolution devices will initialize this property
     * to a higher value.
    */
    get actualPixelScalingRatio() {
        return this.i.cn;
    }
    set actualPixelScalingRatio(v) {
        this.i.cn = +v;
    }
    /**
     * Gets or sets which mode to use for selecting slices.
    */
    get selectionMode() {
        return this.i.bb;
    }
    set selectionMode(v) {
        this.i.bb = ensureEnum(SliceSelectionMode_$type, v);
    }
    /**
     * Gets or sets the currently selected data item.  If a different data item is provided the pie chart
     * will select the slice associated with the new item.
    */
    get selectedItem() {
        return this.i.selectedItem;
    }
    set selectedItem(v) {
        this.i.selectedItem = v;
    }
    /**
     * Gets the currently selected data items.  Adding or removing data items from this collection will
     * select or deselect the slices associated with those items.
    */
    get selectedItems() {
        if (this._selectedItems === null) {
            let coll = new IgrObjectCollection();
            let innerColl = this.i.selectedItems;
            if (!innerColl) {
                innerColl = new ObjectCollection_internal(0);
            }
            this._selectedItems = coll._fromInner(innerColl);
            this.i.selectedItems = innerColl;
        }
        return this._selectedItems;
    }
    set selectedItems(v) {
        if (this._selectedItems !== null) {
            this._selectedItems._setSyncTarget(null);
            this._selectedItems = null;
        }
        let coll = new IgrObjectCollection();
        this._selectedItems = coll._fromOuter(v);
        let syncColl = new SyncableObservableCollection$1(Base.$type);
        let innerColl = this.i.selectedItems;
        if (!innerColl) {
            innerColl = new ObjectCollection_internal(0);
        }
        syncColl._inner = innerColl;
        syncColl.clear();
        this._selectedItems._setSyncTarget(syncColl);
        this.i.selectedItems = innerColl;
    }
    /**
     * Manually overrides the style to use for the labels.
    */
    get textStyle() {
        return this.i.ez;
    }
    set textStyle(v) {
        this.i.ez = v;
    }
    findByName(name) {
        if (this.legend && this.legend.name && this.legend.name == name) {
            return this.legend;
        }
        if (this.labelFormatSpecifiers != null && arrayFindByName(this.labelFormatSpecifiers, name)) {
            return arrayFindByName(this.labelFormatSpecifiers, name);
        }
        if (this.othersLabelFormatSpecifiers != null && arrayFindByName(this.othersLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.othersLabelFormatSpecifiers, name);
        }
        if (this.legendLabelFormatSpecifiers != null && arrayFindByName(this.legendLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.legendLabelFormatSpecifiers, name);
        }
        if (this.legendOthersLabelFormatSpecifiers != null && arrayFindByName(this.legendOthersLabelFormatSpecifiers, name)) {
            return arrayFindByName(this.legendOthersLabelFormatSpecifiers, name);
        }
        return null;
    }
    get hasUserValues() {
        return this._hasUserValues;
    }
    __m(propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    }
    _styling(container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        let genericPrefix = "";
        let typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("PieChartBase");
        let additionalPrefixes = [];
        let prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        let b = this.i.$type.baseType;
        while (b && b.name != "Object" &&
            b.name != "Base" &&
            b.name != "Control" &&
            b.Name != "DependencyObject" &&
            b.Name != "FrameworkElement") {
            typeName = b.name;
            if (typeName.indexOf("Xam") === 0) {
                typeName = typeName.substring(3);
            }
            let basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            let parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            let parentPrefix = toSpinal(parentTypeName);
            additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-");
            additionalPrefixes.push(parentPrefix + "-" + prefix + "-");
        }
        initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes);
        if (this._otherStyling) {
            this._otherStyling(container, component, parent);
        }
        this._inStyling = false;
    }
    /**
     * Returns the chart visuals expressed as a serialized string.
    
    */
    exportSerializedVisualData() {
        let iv = this.i.di();
        return (iv);
    }
    /**
     * Simulates a mouse click action at the specified point.
    
    * @param point  * The point to click at.
    */
    simulateLeftClick(point) {
        this.i.gb(toPoint(point));
    }
    /**
     * Invoked by the containing object to provide reference to the container.
    
    * @param container  * Reference to the container.
    */
    provideContainer(container) {
        this.i.provideContainer(container);
    }
    /**
     * Notification from the containing object that the container has been resized.
    
    */
    notifyContainerResized() {
        this.i.notifyContainerResized();
    }
    /**
     * Invoked when the instance is being destroyed.
    
    */
    destroy() {
        this.i.destroy();
    }
    /**
     * Use to force the pie chart to finish any deferred work before printing or evaluating its visual.
     * This should only be called if the visual of the pie chart needs to be synchronously saved or evaluated.
     * Calling this method too often will hinder the performance of the pie chart.
    
    */
    flush() {
        this.i.e9();
    }
    notifySetItem(source_, index, oldItem, newItem) {
        this.i.fi(source_, index, oldItem, newItem);
    }
    /**
     * Manually notifies the pie chart's data source that the data it has bound to has been cleared and needs to be re-examined.
     * This should not be called if the data that the pie chart is bound to is already observable.
    
    * @param source_  * The data source.
    */
    notifyClearItems(source_) {
        this.i.fe(source_);
    }
    notifyInsertItem(source_, index, newItem) {
        this.i.fg(source_, index, newItem);
    }
    notifyRemoveItem(source_, index, oldItem) {
        this.i.fh(source_, index, oldItem);
    }
    /**
     * Assigns data source for the items.
    
    * @param source_  * Array of the data source items.
    */
    setWidgetLevelDataSource(source_) {
        this.i.ga(source_);
    }
    /**
     * Resets items data source.
    
    */
    removeWidgetLevelDataSource() {
        this.i.f1();
    }
    /**
     * Invoked when style is updated.
    
    */
    styleUpdated() {
        this.i.gf();
    }
    /**
     * Raised when the slice's label is clicked.
    */
    get labelClick() {
        return this._labelClick;
    }
    set labelClick(ev) {
        if (this._labelClick_wrapped !== null) {
            this.i.labelClick = delegateRemove(this.i.labelClick, this._labelClick_wrapped);
            this._labelClick_wrapped = null;
            this._labelClick = null;
        }
        this._labelClick = ev;
        this._labelClick_wrapped = (o, e) => {
            let outerArgs = new IgrLabelClickEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeLabelClick) {
                this.beforeLabelClick(this, outerArgs);
            }
            if (this._labelClick) {
                this._labelClick(this, outerArgs);
            }
        };
        this.i.labelClick = delegateCombine(this.i.labelClick, this._labelClick_wrapped);
    }
    /**
     * Raised when the SelectedItem property is changing.  This event is cancelable.
    */
    get selectedItemChanging() {
        return this._selectedItemChanging;
    }
    set selectedItemChanging(ev) {
        if (this._selectedItemChanging_wrapped !== null) {
            this.i.selectedItemChanging = delegateRemove(this.i.selectedItemChanging, this._selectedItemChanging_wrapped);
            this._selectedItemChanging_wrapped = null;
            this._selectedItemChanging = null;
        }
        this._selectedItemChanging = ev;
        this._selectedItemChanging_wrapped = (o, e) => {
            let outerArgs = new IgrSelectedItemChangingEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeSelectedItemChanging) {
                this.beforeSelectedItemChanging(this, outerArgs);
            }
            if (this._selectedItemChanging) {
                this._selectedItemChanging(this, outerArgs);
            }
        };
        this.i.selectedItemChanging = delegateCombine(this.i.selectedItemChanging, this._selectedItemChanging_wrapped);
    }
    /**
     * Raised when the SelectedItems collection is changing.  This event is cancelable.
    */
    get selectedItemsChanging() {
        return this._selectedItemsChanging;
    }
    set selectedItemsChanging(ev) {
        if (this._selectedItemsChanging_wrapped !== null) {
            this.i.selectedItemsChanging = delegateRemove(this.i.selectedItemsChanging, this._selectedItemsChanging_wrapped);
            this._selectedItemsChanging_wrapped = null;
            this._selectedItemsChanging = null;
        }
        this._selectedItemsChanging = ev;
        this._selectedItemsChanging_wrapped = (o, e) => {
            let outerArgs = new IgrSelectedItemsChangingEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeSelectedItemsChanging) {
                this.beforeSelectedItemsChanging(this, outerArgs);
            }
            if (this._selectedItemsChanging) {
                this._selectedItemsChanging(this, outerArgs);
            }
        };
        this.i.selectedItemsChanging = delegateCombine(this.i.selectedItemsChanging, this._selectedItemsChanging_wrapped);
    }
    /**
     * Raised when the SelectedItem property has changed.
    */
    get selectedItemChanged() {
        return this._selectedItemChanged;
    }
    set selectedItemChanged(ev) {
        if (this._selectedItemChanged_wrapped !== null) {
            this.i.selectedItemChanged = delegateRemove(this.i.selectedItemChanged, this._selectedItemChanged_wrapped);
            this._selectedItemChanged_wrapped = null;
            this._selectedItemChanged = null;
        }
        this._selectedItemChanged = ev;
        this._selectedItemChanged_wrapped = (o, e) => {
            let outerArgs = new IgrSelectedItemChangedEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeSelectedItemChanged) {
                this.beforeSelectedItemChanged(this, outerArgs);
            }
            if (this._selectedItemChanged) {
                this._selectedItemChanged(this, outerArgs);
            }
        };
        this.i.selectedItemChanged = delegateCombine(this.i.selectedItemChanged, this._selectedItemChanged_wrapped);
    }
    /**
     * Raised when the SelectedItems collection has changed.
    */
    get selectedItemsChanged() {
        return this._selectedItemsChanged;
    }
    set selectedItemsChanged(ev) {
        if (this._selectedItemsChanged_wrapped !== null) {
            this.i.selectedItemsChanged = delegateRemove(this.i.selectedItemsChanged, this._selectedItemsChanged_wrapped);
            this._selectedItemsChanged_wrapped = null;
            this._selectedItemsChanged = null;
        }
        this._selectedItemsChanged = ev;
        this._selectedItemsChanged_wrapped = (o, e) => {
            let outerArgs = new IgrSelectedItemsChangedEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeSelectedItemsChanged) {
                this.beforeSelectedItemsChanged(this, outerArgs);
            }
            if (this._selectedItemsChanged) {
                this._selectedItemsChanged(this, outerArgs);
            }
        };
        this.i.selectedItemsChanged = delegateCombine(this.i.selectedItemsChanged, this._selectedItemsChanged_wrapped);
    }
    /**
     * Raised when the slice is clicked.
    */
    get sliceClick() {
        return this._sliceClick;
    }
    set sliceClick(ev) {
        if (this._sliceClick_wrapped !== null) {
            this.i.sliceClick = delegateRemove(this.i.sliceClick, this._sliceClick_wrapped);
            this._sliceClick_wrapped = null;
            this._sliceClick = null;
        }
        this._sliceClick = ev;
        this._sliceClick_wrapped = (o, e) => {
            let outerArgs = new IgrSliceClickEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforeSliceClick) {
                this.beforeSliceClick(this, outerArgs);
            }
            if (this._sliceClick) {
                this._sliceClick(this, outerArgs);
            }
        };
        this.i.sliceClick = delegateCombine(this.i.sliceClick, this._sliceClick_wrapped);
    }
}
//# sourceMappingURL=igr-pie-chart-base.js.map
