import * as React from 'react';
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { Visibility_$type } from "igniteui-react-core";
import { MarkerType_$type } from "./MarkerType";
import { IgrPropertyUpdatedEventArgs } from "igniteui-react-core";
import { StackedFragmentSeries } from "./StackedFragmentSeries";
import { getModifiedProps, isValidProp, brushToString, stringToBrush, ensureBool, colorToString, stringToColor, ensureEnum, toSpinal, initializePropertiesFromCss, NamePatcher, fromPoint, toPoint, fromRect } from "igniteui-react-core";
import { TypeRegistrar } from "igniteui-react-core";
import { SeriesOutlineMode_$type } from './SeriesOutlineMode';
/**
 * Represents a non-visual child of StackedSeriesBase.
*/
export class IgrStackedFragmentSeries extends React.Component {
    constructor(props) {
        super(props);
        this.__p = null;
        this._hasUserValues = new Set();
        this._stylingContainer = null;
        this._stylingParent = null;
        this._inStyling = false;
        this._propertyUpdated = null;
        this._propertyUpdated_wrapped = null;
        if (this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this));
        }
        this._implementation = this.createImplementation();
        this._implementation.externalObject = this;
        this.onImplementationCreated();
    }
    createImplementation() {
        return new StackedFragmentSeries();
    }
    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;
    }
    provideRenderer(renderer) {
        this._renderer = renderer;
        this.i.visualSeriesLink.provideRenderer(renderer);
    }
    /**
     * @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);
    }
    /**
 * Gets or sets the ItemsSource property for the current series object. Normally you will want to provide data to the parent series instead.
 * But if you have data as individual columns, it can be assigned here. The data must be aligned and have the same number of items for each fragment.
*/
    get dataSource() {
        return this.i.itemsSource;
    }
    set dataSource(v) {
        this.i.itemsSource = v;
    }
    /**
     * Gets or sets the brush of the stacked fragment.
    */
    get brush() {
        return brushToString(this.i.hc);
    }
    set brush(v) {
        this.i.hc = stringToBrush(v);
    }
    /**
     * Gets the actual brush used by the series.
    */
    get actualBrush() {
        return brushToString(this.i.g7);
    }
    set actualBrush(v) {
        this.i.g7 = stringToBrush(v);
    }
    /**
     * Gets or sets whether drop shadow should be enabled for this series.
    */
    get isDropShadowEnabled() {
        return this.i.ab;
    }
    set isDropShadowEnabled(v) {
        this.i.ab = ensureBool(v);
    }
    /**
     * Gets whether drop shadow is actually enabled for this series.
    */
    get actualIsDropShadowEnabled() {
        return this.i.w;
    }
    set actualIsDropShadowEnabled(v) {
        this.i.w = ensureBool(v);
    }
    /**
     * Gets or sets the shadow blur.
     * This property is ignored when StackedFragmentSeries.UseSingleShadow is set to true.
    */
    get shadowBlur() {
        return this.i.bc;
    }
    set shadowBlur(v) {
        this.i.bc = +v;
    }
    /**
     * Gets the actual shadow blur used by the series.
    */
    get actualShadowBlur() {
        return this.i.at;
    }
    set actualShadowBlur(v) {
        this.i.at = +v;
    }
    /**
     * Gets or sets the drop shadow color.
    */
    get shadowColor() {
        return colorToString(this.i.hj);
    }
    set shadowColor(v) {
        this.i.hj = stringToColor(v);
    }
    /**
     * Gets actual the drop shadow color used by the series.
    */
    get actualShadowColor() {
        return colorToString(this.i.hi);
    }
    set actualShadowColor(v) {
        this.i.hi = stringToColor(v);
    }
    /**
     * Gets or sets whether drop shadow is applied to the whole StackedFragmentSeries visual or to each of the individual shapes forming the StackedFragmentSeries.
     * When this property is set to true, no StackedFragmentSeries.ShadowBlur is applied.
    */
    get useSingleShadow() {
        return this.i.ah;
    }
    set useSingleShadow(v) {
        this.i.ah = ensureBool(v);
    }
    /**
     * Gets whether drop shadow is actually applied to the whole StackedFragmentSeries visual or to each of the individual shapes forming the StackedFragmentSeries.
    */
    get actualUseSingleShadow() {
        return this.i.z;
    }
    set actualUseSingleShadow(v) {
        this.i.z = ensureBool(v);
    }
    /**
     * Gets or sets the drop shadow x-offset.
    */
    get shadowOffsetX() {
        return this.i.bd;
    }
    set shadowOffsetX(v) {
        this.i.bd = +v;
    }
    /**
     * Gets the actual drop shadow x-offset applied to the series.
    */
    get actualShadowOffsetX() {
        return this.i.au;
    }
    set actualShadowOffsetX(v) {
        this.i.au = +v;
    }
    /**
     * Gets or sets the drop shadow y-offset.
    */
    get shadowOffsetY() {
        return this.i.be;
    }
    set shadowOffsetY(v) {
        this.i.be = +v;
    }
    /**
     * Gets the actual drop shadow y-offset applied to the series.
    */
    get actualShadowOffsetY() {
        return this.i.av;
    }
    set actualShadowOffsetY(v) {
        this.i.av = +v;
    }
    /**
     * Gets or sets the LegendItemBadgeTemplate property.
     * The legend item badge is created according to the LegendItemBadgeTemplate on-demand by
     * the series object itself.
    */
    get legendItemBadgeTemplate() {
        return this.i.e3;
    }
    set legendItemBadgeTemplate(v) {
        this.i.e3 = v;
    }
    /**
     * Gets the actual legend item badge template used by the series.
    */
    get actualLegendItemBadgeTemplate() {
        return this.i.e0;
    }
    set actualLegendItemBadgeTemplate(v) {
        this.i.e0 = v;
    }
    /**
     * Gets or sets the LegendItemTemplate property.
     * The legend item control content is created according to the LegendItemTemplate on-demand by
     * the series object itself.
    */
    get legendItemTemplate() {
        return this.i.e4;
    }
    set legendItemTemplate(v) {
        this.i.e4 = v;
    }
    /**
     * Gets the actual legend item template used by the series.
    */
    get actualLegendItemTemplate() {
        return this.i.e1;
    }
    set actualLegendItemTemplate(v) {
        this.i.e1 = v;
    }
    /**
     * Gets or sets the legend item visibility for the current series object.
    */
    get legendItemVisibility() {
        return this.i.h9;
    }
    set legendItemVisibility(v) {
        this.i.h9 = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets the actual visibility of the legend items in the series.
    */
    get actualLegendItemVisibility() {
        return this.i.h7;
    }
    set actualLegendItemVisibility(v) {
        this.i.h7 = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets or sets the brush that specifies how the current series object's marker interiors are painted.
    */
    get markerBrush() {
        return brushToString(this.i.hd);
    }
    set markerBrush(v) {
        this.i.hd = stringToBrush(v);
    }
    /**
     * Gets the actual marker brush of the series.
    */
    get actualMarkerBrush() {
        return brushToString(this.i.g8);
    }
    set actualMarkerBrush(v) {
        this.i.g8 = stringToBrush(v);
    }
    /**
     * Gets or sets the brush that specifies how the current series object's marker outlines are painted.
    */
    get markerOutline() {
        return brushToString(this.i.he);
    }
    set markerOutline(v) {
        this.i.he = stringToBrush(v);
    }
    /**
     * Gets the actual marker outline of the series.
    */
    get actualMarkerOutline() {
        return brushToString(this.i.g9);
    }
    set actualMarkerOutline(v) {
        this.i.g9 = stringToBrush(v);
    }
    /**
     * Gets or sets the MarkerTemplate for the current series object.
    */
    get markerTemplate() {
        return this.i.e5;
    }
    set markerTemplate(v) {
        this.i.e5 = v;
    }
    /**
     * Gets the actual marker template used by the series.
    */
    get actualMarkerTemplate() {
        return this.i.e2;
    }
    set actualMarkerTemplate(v) {
        this.i.e2 = v;
    }
    /**
     * Gets or sets the marker type for the current series object.
     * If the MarkerTemplate property is set, the setting of the MarkerType property will be ignored.
    */
    get markerType() {
        return this.i.n;
    }
    set markerType(v) {
        this.i.n = ensureEnum(MarkerType_$type, v);
    }
    /**
     * Gets the actual marker type set used in the series.
    */
    get actualMarkerType() {
        return this.i.m;
    }
    set actualMarkerType(v) {
        this.i.m = ensureEnum(MarkerType_$type, v);
    }
    /**
     * Gets or sets the Name of the stacked fragment.
    */
    get name() {
        return this.i.c8;
    }
    set name(v) {
        this.i.c8 = v;
    }
    /**
     * Gets or sets the Opacity of the stacked fragment.
    */
    get opacity() {
        return this.i.a9;
    }
    set opacity(v) {
        this.i.a9 = +v;
    }
    /**
     * Gets the series opacity.
    */
    get actualOpacity() {
        return this.i.aq;
    }
    set actualOpacity(v) {
        this.i.aq = +v;
    }
    /**
     * Gets or sets the brush to use for the outline of the series.
     * Some series types, such as LineSeries, do not display outlines.  Therefore, this property does not affect some charts.
    */
    get outline() {
        return brushToString(this.i.hg);
    }
    set outline(v) {
        this.i.hg = stringToBrush(v);
    }
    /**
     * Gets the series outline.
    */
    get actualOutline() {
        return brushToString(this.i.hb);
    }
    set actualOutline(v) {
        this.i.hb = stringToBrush(v);
    }
    /**
     * Gets or sets the AreaFillOpacity of the stacked fragment. This property only applies for area-like series.
    */
    get areaFillOpacity() {
        return this.i.ax;
    }
    set areaFillOpacity(v) {
        this.i.ax = +v;
    }
    /**
     * Gets the series ActualAreaFillOpacity.  This property only applies for area-like series.
    */
    get actualAreaFillOpacity() {
        return this.i.am;
    }
    set actualAreaFillOpacity(v) {
        this.i.am = +v;
    }
    /**
     * Gets or sets the opacity to use for the marker fills.
    */
    get markerFillOpacity() {
        return this.i.a7;
    }
    set markerFillOpacity(v) {
        this.i.a7 = +v;
    }
    /**
     * Gets the actual opacity to use for hte marker fills.
    */
    get actualMarkerFillOpacity() {
        return this.i.ao;
    }
    set actualMarkerFillOpacity(v) {
        this.i.ao = +v;
    }
    /**
     * Gets or sets the outline mode to use for the fragment.
    */
    get outlineMode() {
        return this.i.q;
    }
    set outlineMode(v) {
        this.i.q = ensureEnum(SeriesOutlineMode_$type, v);
    }
    /**
     * Gets the actual outline mode to use for the fragment.
    */
    get actualOutlineMode() {
        return this.i.p;
    }
    set actualOutlineMode(v) {
        this.i.p = ensureEnum(SeriesOutlineMode_$type, v);
    }
    /**
     * Gets or sets the target opacity to fade to for fade style highlighting.
    */
    get highlightingFadeOpacity() {
        return this.i.a6;
    }
    set highlightingFadeOpacity(v) {
        this.i.a6 = +v;
    }
    /**
     * Gets the actual target opacity to fade to for fade style highlighting.
    */
    get actualHighlightingFadeOpacity() {
        return this.i.an;
    }
    set actualHighlightingFadeOpacity(v) {
        this.i.an = +v;
    }
    /**
     * Gets or sets the x-radius of the ellipse that is used to round the corners of the column. This only applies to Bar and Column series.
    */
    get radiusX() {
        return this.i.ba;
    }
    set radiusX(v) {
        this.i.ba = +v;
    }
    /**
     * Gets the actual corner radius of the series
    */
    get actualRadiusX() {
        return this.i.ar;
    }
    set actualRadiusX(v) {
        this.i.ar = +v;
    }
    /**
     * Gets or sets the y-radius of the ellipse that is used to round the corners of the column. This only applies to Bar and Column series.
    */
    get radiusY() {
        return this.i.bb;
    }
    set radiusY(v) {
        this.i.bb = +v;
    }
    /**
     * Gets the actual corner radius of the series
    */
    get actualRadiusY() {
        return this.i.as;
    }
    set actualRadiusY(v) {
        this.i.as = +v;
    }
    /**
     * Gets or sets the width of the current series object's line thickness.
    */
    get thickness() {
        return this.i.bf;
    }
    set thickness(v) {
        this.i.bf = +v;
    }
    /**
     * Gets or sets the thickness of this stacked fragment.
    */
    get actualThickness() {
        return this.i.aw;
    }
    set actualThickness(v) {
        this.i.aw = +v;
    }
    /**
     * Gets or sets the width of the current series object's marker thickness.
    */
    get markerThickness() {
        return this.i.a8;
    }
    set markerThickness(v) {
        this.i.a8 = +v;
    }
    /**
     * Gets actual marker thickness of this stacked fragment.
    */
    get actualMarkerThickness() {
        return this.i.ap;
    }
    set actualMarkerThickness(v) {
        this.i.ap = +v;
    }
    /**
     * Gets or sets the Title property.
     * The legend item control is created according to the Title on-demand by
     * the series object itself.
    */
    get title() {
        return this.i.bp;
    }
    set title(v) {
        this.i.bp = v;
    }
    /**
     * Gets or sets the value mapping property for the current series object.
    */
    get valueMemberPath() {
        return this.i.ds;
    }
    set valueMemberPath(v) {
        this.i.ds = v;
    }
    /**
     * Gets or sets the Visibility of the stacked fragment.
    */
    get visibility() {
        return this.i.ia;
    }
    set visibility(v) {
        this.i.ia = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets the actual visibility of the stacked fragment.
    */
    get actualVisibility() {
        return this.i.h8;
    }
    set actualVisibility(v) {
        this.i.h8 = ensureEnum(Visibility_$type, v);
    }
    /**
     * Gets the resolved brush used between the local series and the parent series.
    */
    get parentOrLocalBrush() {
        return brushToString(this.i.hh);
    }
    set parentOrLocalBrush(v) {
        this.i.hh = stringToBrush(v);
    }
    findByName(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("StackedFragmentSeries");
        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;
    }
    /**
 * Gets the item item index associated with the specified world position

*/
    getItemIndex(world) {
        let iv = this.i.bh(toPoint(world));
        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.bn(toPoint(world));
        return (iv);
    }
    getPreviousOrExactIndex(world, skipUnknowns) {
        let iv = this.i.bk(toPoint(world), skipUnknowns);
        return (iv);
    }
    getNextOrExactIndex(world, skipUnknowns) {
        let iv = this.i.bj(toPoint(world), skipUnknowns);
        return (iv);
    }
    getSeriesValue(world, useInterpolation, skipUnknowns) {
        let iv = this.i.a4(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    }
    getSeriesValuePosition(world, useInterpolation, skipUnknowns) {
        let iv = this.i.hx(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    }
    /**
     * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
    
    * @param world  * The world coordinate for which to get a value bounding box for
    */
    getSeriesValueBoundingBox(world) {
        let iv = this.i.h1(toPoint(world));
        return fromRect(iv);
    }
    /**
     * If possible, will return the best available value marker bounding box within the series that has the best value match for the world position provided.
    
    * @param world  * The world coordinates for which to get a value marker bounding box for
    */
    getSeriesValueMarkerBoundingBox(world) {
        let iv = this.i.h3(toPoint(world));
        return fromRect(iv);
    }
    getSeriesHighValue(world, useInterpolation, skipUnknowns) {
        let iv = this.i.a0(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    }
    getSeriesHighValuePosition(world, useInterpolation, skipUnknowns) {
        let iv = this.i.ht(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    }
    getSeriesLowValue(world, useInterpolation, skipUnknowns) {
        let iv = this.i.a2(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    }
    getSeriesLowValuePosition(world, useInterpolation, skipUnknowns) {
        let iv = this.i.hv(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    }
    getSeriesValuePositionFromSeriesPixel(mouse, useInterpolation, skipUnknowns) {
        let iv = this.i.hy(toPoint(mouse), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    }
    getSeriesValueFromSeriesPixel(mouse, useInterpolation, skipUnknowns) {
        let iv = this.i.a5(toPoint(mouse), useInterpolation, skipUnknowns);
        return (iv);
    }
    /**
     * For a category plotted series, returns the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned.
    
    */
    getItemSpan() {
        let iv = this.i.az();
        return (iv);
    }
    /**
     * Converts a point from coordinates within the series plot area to a world position within axis space.
    
    * @param seriesPoint  * The pixel location within the plot area of the series.
    */
    toWorldPosition(seriesPoint) {
        let iv = this.i.hz(toPoint(seriesPoint));
        return fromPoint(iv);
    }
    /**
     * Converts a point from world coordinates to coordinates within the viewport of the series.
    
    * @param world  * The world position from which to convert.
    */
    fromWorldPosition(world) {
        let iv = this.i.hs(toPoint(world));
        return fromPoint(iv);
    }
    /**
     * Requests that the provided item should be brought into view if possible.
    
    * @param item  * The item to attempt to bring into view.
    */
    scrollIntoView(item) {
        let iv = this.i.ae(item);
        return (iv);
    }
    /**
     * Gets the effective viewport, adjusted to account for margins and other factors.
    
    */
    getEffectiveViewport() {
        let iv = this.i.h0();
        return fromRect(iv);
    }
    /**
     * Notifies the series that a visual property has changed, requiring a visual update.
    
    */
    notifyVisualPropertiesChanged() {
        this.i.dw();
    }
    /**
     * Simulates a pointer hover over the series surface.
    
    * @param point  * The pointer position relative to the series viewport over which to hover.
    */
    simulateHover(point) {
        this.i.d0(toPoint(point));
    }
    /**
     * Moves the cursor point to the provided world position. Some series may react to the current cursor position.
    
    * @param point  * The cursor point, in world coordinates.
    */
    moveCursorPoint(point) {
        this.i.dv(toPoint(point));
    }
    /**
     * Event raised when a property (including "effective" and non-dependency property) value changes.
    */
    get propertyUpdated() {
        return this._propertyUpdated;
    }
    set propertyUpdated(ev) {
        if (this._propertyUpdated_wrapped !== null) {
            this.i.propertyUpdated = delegateRemove(this.i.propertyUpdated, this._propertyUpdated_wrapped);
            this._propertyUpdated_wrapped = null;
            this._propertyUpdated = null;
        }
        this._propertyUpdated = ev;
        this._propertyUpdated_wrapped = (o, e) => {
            let outerArgs = new IgrPropertyUpdatedEventArgs();
            outerArgs._provideImplementation(e);
            if (this.beforePropertyUpdated) {
                this.beforePropertyUpdated(this, outerArgs);
            }
            if (this._propertyUpdated) {
                this._propertyUpdated(this, outerArgs);
            }
        };
        this.i.propertyUpdated = delegateCombine(this.i.propertyUpdated, this._propertyUpdated_wrapped);
    }
}
//# sourceMappingURL=igr-stacked-fragment-series.js.map
