import { __extends, __values } from "tslib";
import * as React from 'react';
import { Treemap } from "./Treemap";
import { toPoint, ensureEnum, brushToString, stringToBrush, ensureBool, initializePropertiesFromCss, NamePatcher, isValidProp, toSpinal, getModifiedProps, fromBrushCollection, toBrushCollection } from "igniteui-react-core";
import { FontInfo } from "igniteui-react-core";
import { ReactRenderer } from "igniteui-react-core";
import { delegateCombine, delegateRemove } from "igniteui-react-core";
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { TreemapNodeStyleMapping } from './TreemapNodeStyleMapping';
import { IgrTreemapNodeStyleMappingCollection } from './igr-treemap-node-style-mapping-collection';
import { ContentChildrenManager } from "igniteui-react-core";
import { CollectionAdapter } from "igniteui-react-core";
import { NotifyCollectionChangedAction } from "igniteui-react-core";
import { TreemapFillScaleMode_$type } from "./TreemapFillScaleMode";
import { IgrTreemapNodeStylingEventArgs } from "./igr-treemap-node-styling-event-args";
import { TreemapOrientation_$type } from './TreemapOrientation';
import { TreemapLayoutType_$type } from './TreemapLayoutType';
import { IgrTreemapNodePointerEventArgs } from './igr-treemap-node-pointer-event-args';
import { TreemapHeaderDisplayMode_$type } from './TreemapHeaderDisplayMode';
import { HorizontalAlignment_$type } from "igniteui-react-core";
import { VerticalAlignment_$type } from "igniteui-react-core";
import { TreemapLabelHorizontalFitMode_$type } from './TreemapLabelHorizontalFitMode';
import { TreemapLabelVerticalFitMode_$type } from './TreemapLabelVerticalFitMode';
import { TreemapHighlightingMode_$type } from './TreemapHighlightingMode';
var IgrTreemap = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrTreemap, _super);
    function IgrTreemap(props) {
        var _this = _super.call(this, props) || this;
        _this._wrapper = null;
        _this.contentStyleMappings = [];
        /**
        * The style mappings actually present in the treemap. Do not directly modify this array.
        * This array's contents can be modified by causing React to reproject the child content.
        * Or adding and removing ranges from the manual ranges collection on the ranges property.
        */
        _this.actualStyleMappings = [];
        _this._styleMappings = null;
        _this._styleMappingsAdapter = null;
        _this._implementation = null;
        _this.__p = null;
        _this._hasUserValues = new Set();
        _this._stylingContainer = null;
        _this._stylingParent = null;
        _this._inStyling = false;
        _this._nodeStyling = null;
        _this._nodeStyling_wrapped = null;
        _this._nodeRenderStyling = null;
        _this._nodeRenderStyling_wrapped = null;
        _this._nodePointerOver = null;
        _this._nodePointerOver_wrapped = null;
        _this._nodePointerEnter = null;
        _this._nodePointerEnter_wrapped = null;
        _this._nodePointerLeave = null;
        _this._nodePointerLeave_wrapped = null;
        _this._nodePointerPressed = null;
        _this._nodePointerPressed_wrapped = null;
        _this._nodePointerReleased = null;
        _this._nodePointerReleased_wrapped = null;
        if (_this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
        }
        _this._getMainRef = _this._getMainRef.bind(_this);
        _this._contentChildrenManager = new ContentChildrenManager(function (ch) { return ch.key || ch.props.name; }, function (ch) { return ch.key || ch.props.name; }, function () { return _this._updateContentChildren(); });
        _this._implementation = _this.createImplementation();
        if (document) {
            _this._container = document.createElement("div");
            _this._container.style.display = "block";
            _this._container.style.width = "100%";
            _this._container.style.height = "100%";
        }
        var root;
        root = _this._container;
        if (_this._container != null) {
            root = _this._container;
        }
        var ren = new ReactRenderer(root, document, true, DataChartStylingDefaults);
        _this._wrapper = ren;
        var treemap = _this.i;
        _this._treeMap = treemap;
        _this._styleMappingsAdapter = new CollectionAdapter(_this.contentStyleMappings, _this.i.styleMappings, _this.actualStyleMappings, function (c) { return c.i; }, function (i) {
            if (_this._container && _this._container.parentElement) {
                i._styling(_this._container, _this, _this);
            }
        }, function (i) { });
        treemap.provideContainer(ren);
        treemap.notifySizeChanged();
        if (props) {
            _this.initializeProperties();
        }
        ren.addSizeWatcher(function () {
            _this._treeMap.notifySizeChanged();
        });
        return _this;
    }
    Object.defineProperty(IgrTreemap.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this._treeMap.notifySizeChanged();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this._treeMap.notifySizeChanged();
            }
        },
        enumerable: false,
        configurable: true
    });
    IgrTreemap.prototype._getMainRef = function (ref) {
        this._elRef = ref;
    };
    IgrTreemap.prototype._updateContentChildren = function () {
        this.contentStyleMappings.length = 0;
        var contentChildrenActual = this._contentChildrenManager.contentChildrenActual;
        for (var i = 0; i < contentChildrenActual.length; i++) {
            if ((TreemapNodeStyleMapping.$type).isAssignableFrom(contentChildrenActual[i].i.$type)) {
                this.contentStyleMappings.push(contentChildrenActual[i]);
            }
        }
        if (this._styleMappingsAdapter !== null) {
            this._styleMappingsAdapter.notifyContentChanged();
        }
    };
    Object.defineProperty(IgrTreemap.prototype, "styleMappings", {
        /**
         * A collection of manually added style mappings for the treemap.
        */
        get: function () {
            var _this = this;
            if (this._styleMappings === null) {
                var coll = new IgrTreemapNodeStyleMappingCollection();
                var inner = coll._innerColl;
                inner.addListener(function (sender, e) {
                    switch (e.action) {
                        case NotifyCollectionChangedAction.Add:
                            _this._styleMappingsAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
                            break;
                        case NotifyCollectionChangedAction.Remove:
                            _this._styleMappingsAdapter.removeManualItemAt(e.oldStartingIndex);
                            break;
                        case NotifyCollectionChangedAction.Replace:
                            _this._styleMappingsAdapter.removeManualItemAt(e.oldStartingIndex);
                            _this._styleMappingsAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
                            break;
                        case NotifyCollectionChangedAction.Reset:
                            _this._styleMappingsAdapter.clearManualItems();
                            break;
                    }
                });
                this._styleMappings = coll;
            }
            return this._styleMappings;
        },
        enumerable: false,
        configurable: true
    });
    IgrTreemap.prototype.render = function () {
        var children = this._contentChildrenManager.getChildren(this.props.children);
        var div = React.createElement("div", {
            className: "ig-treemap igr-treemap",
            ref: this._getMainRef,
            children: children
        });
        //}
        return div;
    };
    IgrTreemap.prototype.shouldComponentUpdate = function (nextProps, nextState) {
        var e_1, _a;
        var mod = getModifiedProps(this.props, nextProps);
        try {
            for (var _b = __values(Object.keys(mod)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = mod[p];
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        return true;
    };
    IgrTreemap.prototype.initializeProperties = function () {
        var e_2, _a;
        try {
            for (var _b = __values(Object.keys(this.props)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var p = _c.value;
                if (isValidProp(this, p)) {
                    this[p] = this.props[p];
                }
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    // supports angular themes or custom properties set in CSS
    IgrTreemap.prototype.updateStyle = function () {
        this._styling(this._elRef, this);
    };
    IgrTreemap.prototype.destroy = function () {
        this._treeMap.destroy();
        this._wrapper.destroy();
    };
    IgrTreemap.prototype.componentWillUnmount = function () {
    };
    IgrTreemap.prototype.componentDidMount = function () {
        this._elRef.style.width = this._width ? this._width : "";
        this._elRef.style.height = this._height ? this._height : "";
        this._elRef.appendChild(this._container);
        this._treeMap.notifySizeChanged();
        this.initializeContent();
    };
    IgrTreemap.prototype.initializeContent = function () {
        this._styling(this._container, this);
        if (this.actualStyleMappings && this.actualStyleMappings.length > 0) {
            var currStyleMapping = this.actualStyleMappings;
            for (var i = 0; i < currStyleMapping.length; i++) {
                currStyleMapping[i]._styling(this._container, this, this);
            }
        }
        this._updateContentChildren();
        this.updateStyle();
        this.i.notifySizeChanged();
    };
    IgrTreemap.prototype.createImplementation = function () {
        return new Treemap();
    };
    Object.defineProperty(IgrTreemap.prototype, "i", {
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "valueMemberPath", {
        /**
     * Gets or sets path to use to get the values from the items.
    */
        get: function () {
            return this.i.g3;
        },
        set: function (v) {
            this.i.g3 = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "rootTitle", {
        /**
         * Gets or sets the root title to use for breadcrumbs.
        */
        get: function () {
            return this.i.gt;
        },
        set: function (v) {
            this.i.gt = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "breadcrumbSequence", {
        /**
         * Gets or sets the root title to use for breadcrumbs.
        */
        get: function () {
            return this.i.ev;
        },
        set: function (v) {
            this.i.ev = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentIdMemberPath", {
        /**
         * Gets or sets the path to use to get the Parent of the items.
        */
        get: function () {
            return this.i.gh;
        },
        set: function (v) {
            this.i.gh = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelMemberPath", {
        /**
         * Gets or sets the path to use to get the Label of the items.
        */
        get: function () {
            return this.i.fz;
        },
        set: function (v) {
            this.i.fz = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "customValueMemberPath", {
        /**
         * Gets or sets the path to use to get the custom value of the items.
        */
        get: function () {
            return this.i.ey;
        },
        set: function (v) {
            this.i.ey = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "idMemberPath", {
        /**
         * Gets or sets the path to use to get the id of the items.
        */
        get: function () {
            return this.i.fp;
        },
        set: function (v) {
            this.i.fp = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "dataSource", {
        /**
         * Gets or sets the (possibly hierarchical) data to assign to the TreeMap.
        */
        get: function () {
            return this.i.dataSource;
        },
        set: function (v) {
            this.i.dataSource = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "fillBrushes", {
        /**
         * Gets or sets brushes to use for the fill scale.
        */
        get: function () {
            return fromBrushCollection(this.i.b);
        },
        set: function (v) {
            this.i.b = toBrushCollection(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "fillScaleMode", {
        /**
         * Gets or sets mode to use for the fill scale.
        */
        get: function () {
            return this.i.d;
        },
        set: function (v) {
            this.i.d = ensureEnum(TreemapFillScaleMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "isFillScaleLogarithmic", {
        /**
         * Gets or sets whether the fill scale is logarithmic.
        */
        get: function () {
            return this.i.bq;
        },
        set: function (v) {
            this.i.bq = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "fillScaleLogarithmBase", {
        /**
         * Gets or sets the logarithm base to use if the fill scale is logarithmic.
        */
        get: function () {
            return this.i.ee;
        },
        set: function (v) {
            this.i.ee = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "fillScaleMinimumValue", {
        /**
         * Gets or sets the minimum value to use for the fill scale.
        */
        get: function () {
            return this.i.c6;
        },
        set: function (v) {
            this.i.c6 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "fillScaleMaximumValue", {
        /**
         * Gets or sets the maximum value to use for the fill scale.
        */
        get: function () {
            return this.i.c5;
        },
        set: function (v) {
            this.i.c5 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelVerticalFitMode", {
        /**
         * Gets or sets the vertical fit mode to use for the node labels.
        */
        get: function () {
            return this.i.p;
        },
        set: function (v) {
            this.i.p = ensureEnum(TreemapLabelVerticalFitMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelHorizontalFitMode", {
        /**
         * Gets or sets the horizontal fit mode to use for the node labels.
        */
        get: function () {
            return this.i.m;
        },
        set: function (v) {
            this.i.m = ensureEnum(TreemapLabelHorizontalFitMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "overlayHeaderHoverBackground", {
        /**
         * Gets or sets the background to use for the overlay header when it is hovered.
        */
        get: function () {
            return brushToString(this.i.i2);
        },
        set: function (v) {
            this.i.i2 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerHoverBackground", {
        /**
         * Gets or sets the background to use for the header when it is hovered.
        */
        get: function () {
            return brushToString(this.i.iw);
        },
        set: function (v) {
            this.i.iw = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerBackground", {
        /**
         * Gets or sets the background to use for the header.
        */
        get: function () {
            return brushToString(this.i.iu);
        },
        set: function (v) {
            this.i.iu = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "overlayHeaderBackground", {
        /**
         * Gets or sets the background to use for the overlay header.
        */
        get: function () {
            return brushToString(this.i.i1);
        },
        set: function (v) {
            this.i.i1 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerTextColor", {
        /**
         * Gets or sets the text color to use for the header.
        */
        get: function () {
            return brushToString(this.i.iz);
        },
        set: function (v) {
            this.i.iz = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerDarkTextColor", {
        /**
         * Gets or sets the dark text color to use for the header.
        */
        get: function () {
            return brushToString(this.i.iv);
        },
        set: function (v) {
            this.i.iv = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "textColor", {
        /**
         * Gets or sets the text color to use for the nodes.
        */
        get: function () {
            return brushToString(this.i.jc);
        },
        set: function (v) {
            this.i.jc = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "darkTextColor", {
        /**
         * Gets or sets the dark text color to use for the nodes.
        */
        get: function () {
            return brushToString(this.i.it);
        },
        set: function (v) {
            this.i.it = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerHoverTextColor", {
        /**
         * Gets or sets the text color to use for the header.
        */
        get: function () {
            return brushToString(this.i.iy);
        },
        set: function (v) {
            this.i.iy = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerHoverDarkTextColor", {
        /**
         * Gets or sets the dark text color to use for the header when hovered.
        */
        get: function () {
            return brushToString(this.i.ix);
        },
        set: function (v) {
            this.i.ix = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "textStyle", {
        /**
         * Gets or sets the font to use for content nodes
        */
        get: function () {
            if (this.i.a4 == null) {
                return null;
            }
            return this.i.a4.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.a4 = fi;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerTextStyle", {
        /**
         * Gets or sets the font to use for header nodes
        */
        get: function () {
            if (this.i.a2 == null) {
                return null;
            }
            return this.i.a2.fontString;
        },
        set: function (v) {
            var fi = new FontInfo();
            fi.fontString = v;
            this.i.a2 = fi;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerDisplayMode", {
        /**
         * Gets or sets the font to use for header nodes
        */
        get: function () {
            return this.i.j;
        },
        set: function (v) {
            this.i.j = ensureEnum(TreemapHeaderDisplayMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerLabelLeftMargin", {
        /**
         * Gets or sets the left margin to use for the header.
        */
        get: function () {
            return this.i.da;
        },
        set: function (v) {
            this.i.da = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerLabelTopMargin", {
        /**
         * Gets or sets the top margin to use for the header.
        */
        get: function () {
            return this.i.dc;
        },
        set: function (v) {
            this.i.dc = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerLabelRightMargin", {
        /**
         * Gets or sets the right margin to use for the header.
        */
        get: function () {
            return this.i.db;
        },
        set: function (v) {
            this.i.db = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerLabelBottomMargin", {
        /**
         * Gets or sets the bottom margin to use for the header.
        */
        get: function () {
            return this.i.c9;
        },
        set: function (v) {
            this.i.c9 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelLeftMargin", {
        /**
         * Gets or sets the left margin to use for the overlay header.
        */
        get: function () {
            return this.i.dl;
        },
        set: function (v) {
            this.i.dl = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelTopMargin", {
        /**
         * Gets or sets the top margin to use for the overlay header.
        */
        get: function () {
            return this.i.dn;
        },
        set: function (v) {
            this.i.dn = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelRightMargin", {
        /**
         * Gets or sets the right margin to use for the overlay header.
        */
        get: function () {
            return this.i.dm;
        },
        set: function (v) {
            this.i.dm = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "overlayHeaderLabelBottomMargin", {
        /**
         * Gets or sets the bottom margin to use for the overlay header.
        */
        get: function () {
            return this.i.dk;
        },
        set: function (v) {
            this.i.dk = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelLeftMargin", {
        /**
         * Gets or sets the left margin to use for the labels.
        */
        get: function () {
            return this.i.df;
        },
        set: function (v) {
            this.i.df = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelTopMargin", {
        /**
         * Gets or sets the top margin to use for the labels.
        */
        get: function () {
            return this.i.dh;
        },
        set: function (v) {
            this.i.dh = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelRightMargin", {
        /**
         * Gets or sets the right margin to use for the labels.
        */
        get: function () {
            return this.i.dg;
        },
        set: function (v) {
            this.i.dg = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelBottomMargin", {
        /**
         * Gets or sets the bottom margin to use for the labels.
        */
        get: function () {
            return this.i.de;
        },
        set: function (v) {
            this.i.de = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeLeftMargin", {
        /**
         * Gets or sets the left margin to use for the parent nodes.
        */
        get: function () {
            return this.i.dr;
        },
        set: function (v) {
            this.i.dr = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeTopMargin", {
        /**
         * Gets or sets the top margin to use for the parent nodes.
        */
        get: function () {
            return this.i.dv;
        },
        set: function (v) {
            this.i.dv = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeRightMargin", {
        /**
         * Gets or sets the right margin to use for the parent nodes.
        */
        get: function () {
            return this.i.dt;
        },
        set: function (v) {
            this.i.dt = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeBottomMargin", {
        /**
         * Gets or sets the bottom margin to use for the parent nodes.
        */
        get: function () {
            return this.i.dp;
        },
        set: function (v) {
            this.i.dp = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeLeftPadding", {
        /**
         * Gets or sets the left padding to use for the parent nodes.
        */
        get: function () {
            return this.i.ds;
        },
        set: function (v) {
            this.i.ds = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeTopPadding", {
        /**
         * Gets or sets the top padding to use for the parent nodes.
        */
        get: function () {
            return this.i.dw;
        },
        set: function (v) {
            this.i.dw = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeRightPadding", {
        /**
         * Gets or sets the right padding to use for the parent nodes.
        */
        get: function () {
            return this.i.du;
        },
        set: function (v) {
            this.i.du = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "parentNodeBottomPadding", {
        /**
         * Gets or sets the bottom padding to use for the parent nodes.
        */
        get: function () {
            return this.i.dq;
        },
        set: function (v) {
            this.i.dq = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelHorizontalAlignment", {
        /**
         * Gets or sets the horizontal alignment to use for the node labels.
        */
        get: function () {
            return this.i.id;
        },
        set: function (v) {
            this.i.id = ensureEnum(HorizontalAlignment_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "labelVerticalAlignment", {
        /**
         * Gets or sets the vertical alignment to use for the node labels.
        */
        get: function () {
            return this.i.ji;
        },
        set: function (v) {
            this.i.ji = ensureEnum(VerticalAlignment_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "headerHeight", {
        /**
         * Gets or sets the height to use for the header.
        */
        get: function () {
            return this.i.c8;
        },
        set: function (v) {
            this.i.c8 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "outline", {
        /**
         * Gets or sets the outline to use for the nodes.
        */
        get: function () {
            return brushToString(this.i.i0);
        },
        set: function (v) {
            this.i.i0 = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "strokeThickness", {
        /**
         * Gets or sets the stroke thickness to use for the node outline.
        */
        get: function () {
            return this.i.d8;
        },
        set: function (v) {
            this.i.d8 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodeOpacity", {
        /**
         * Gets or sets the opacity to use for the nodes.
        */
        get: function () {
            return this.i.dj;
        },
        set: function (v) {
            this.i.dj = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "layoutOrientation", {
        /**
         * Gets or sets the orientation to use for the stripped and slice and dice layout types.
        */
        get: function () {
            return this.i.aj;
        },
        set: function (v) {
            this.i.aj = ensureEnum(TreemapOrientation_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "layoutType", {
        /**
         * Gets or sets the type of layout to use for the nodes.
        */
        get: function () {
            return this.i.s;
        },
        set: function (v) {
            this.i.s = ensureEnum(TreemapLayoutType_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "minimumDisplaySize", {
        /**
         * Gets or sets the minimum size (width or height) to display a node.
        */
        get: function () {
            return this.i.di;
        },
        set: function (v) {
            this.i.di = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "transitionDuration", {
        /**
         * Gets or sets the number of milliseconds over which changes to the gauge should be animated.
        */
        get: function () {
            return this.i.ei;
        },
        set: function (v) {
            this.i.ei = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "pixelScalingRatio", {
        /**
         * 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: function () {
            return this.i.dx;
        },
        set: function (v) {
            this.i.dx = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "actualPixelScalingRatio", {
        get: function () {
            return this.i.c1;
        },
        set: function (v) {
            this.i.c1 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "interactionPixelScalingRatio", {
        /**
         * Gets or sets the scaling value used to affect the pixel density of the control while it is animating.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.dd;
        },
        set: function (v) {
            this.i.dd = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "actualInteractionPixelScalingRatio", {
        /**
         * Gets or sets the resolved scaling value used to affect the pixel density of the control while it is animating.
         * A higher scaling ratio will produce crisper visuals at the expense of memory.  Lower values will cause the control
         * to appear blurry.
        */
        get: function () {
            return this.i.c0;
        },
        set: function (v) {
            this.i.c0 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "highlightingTransitionDuration", {
        /**
         * Gets or sets the number of milliseconds over which the highlighting effect will render.
        */
        get: function () {
            return this.i.eg;
        },
        set: function (v) {
            this.i.eg = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "highlightingMode", {
        /**
         * Gets or sets the highlighting mode to use.
        */
        get: function () {
            return this.i.au;
        },
        set: function (v) {
            this.i.au = ensureEnum(TreemapHighlightingMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "actualHighlightingMode", {
        /**
         * Gets the actual highlighting mode used.
        */
        get: function () {
            return this.i.as;
        },
        set: function (v) {
            this.i.as = ensureEnum(TreemapHighlightingMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "animating", {
        get: function () {
            return this.i.bm;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "focusItem", {
        /**
         * Gets or sets the item to drill to in the treemap.
        */
        get: function () {
            return this.i.ek;
        },
        set: function (v) {
            this.i.ek = v;
        },
        enumerable: false,
        configurable: true
    });
    IgrTreemap.prototype.findByName = function (name) {
        if (this.findEphemera) {
            if (name && name.indexOf("@@e:") == 0) {
                return this.findEphemera(name);
            }
        }
        if (this.styleMappings != null && this.styleMappings.findByName && this.styleMappings.findByName(name)) {
            return this.styleMappings.findByName(name);
        }
        return null;
    };
    Object.defineProperty(IgrTreemap.prototype, "hasUserValues", {
        get: function () {
            return this._hasUserValues;
        },
        enumerable: false,
        configurable: true
    });
    IgrTreemap.prototype.__m = function (propertyName) {
        if (!this._inStyling) {
            this._hasUserValues.add(propertyName);
        }
    };
    IgrTreemap.prototype._styling = function (container, component, parent) {
        if (this._inStyling) {
            return;
        }
        this._inStyling = true;
        this._stylingContainer = container;
        this._stylingParent = component;
        var genericPrefix = "";
        var typeName = this.i.$type.name;
        if (typeName.indexOf("Xam") === 0) {
            typeName = typeName.substring(3);
        }
        genericPrefix = toSpinal("Treemap");
        var additionalPrefixes = [];
        var prefix = toSpinal(typeName);
        additionalPrefixes.push(prefix + "-");
        var 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);
            }
            var basePrefix = toSpinal(typeName);
            additionalPrefixes.push(basePrefix + "-");
            b = b.baseType;
        }
        if (parent) {
            var parentTypeName = parent.i.$type.name;
            if (parentTypeName.indexOf("Xam") === 0) {
                parentTypeName = parentTypeName.substring(3);
            }
            var 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;
    };
    IgrTreemap.prototype.notifySizeChanged = function () {
        this.i.notifySizeChanged();
    };
    /**
     * Returns visuals as a serialized string.
    
    */
    IgrTreemap.prototype.exportSerializedVisualData = function () {
        var iv = this.i.e1();
        return (iv);
    };
    IgrTreemap.prototype.markDirty = function () {
        this.i.hh();
    };
    IgrTreemap.prototype.onDetachedFromUI = function () {
        this.i.onDetachedFromUI();
    };
    IgrTreemap.prototype.onAttachedToUI = function () {
        this.i.onAttachedToUI();
    };
    IgrTreemap.prototype.flush = function () {
        this.i.he();
    };
    IgrTreemap.prototype.notifySetItem = function (source_, index, oldItem, newItem) {
        this.i.hm(source_, index, oldItem, newItem);
    };
    /**
     * Manually notifies the treemap'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.
    */
    IgrTreemap.prototype.notifyClearItems = function (source_) {
        this.i.hj(source_);
    };
    IgrTreemap.prototype.notifyInsertItem = function (source_, index, newItem) {
        this.i.hk(source_, index, newItem);
    };
    IgrTreemap.prototype.notifyRemoveItem = function (source_, index, oldItem) {
        this.i.hl(source_, index, oldItem);
    };
    IgrTreemap.prototype.simulateHover = function (point) {
        this.i.h5(toPoint(point));
    };
    Object.defineProperty(IgrTreemap.prototype, "nodeStyling", {
        /**
         * Fired when a node is being styled. Provides an opportunity to customize node styling.
        */
        get: function () {
            return this._nodeStyling;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodeStyling_wrapped !== null) {
                this.i.nodeStyling = delegateRemove(this.i.nodeStyling, this._nodeStyling_wrapped);
                this._nodeStyling_wrapped = null;
                this._nodeStyling = null;
            }
            this._nodeStyling = ev;
            this._nodeStyling_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodeStylingEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodeStyling) {
                    _this.beforeNodeStyling(_this, outerArgs);
                }
                if (_this._nodeStyling) {
                    _this._nodeStyling(_this, outerArgs);
                }
            };
            this.i.nodeStyling = delegateCombine(this.i.nodeStyling, this._nodeStyling_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodeRenderStyling", {
        /**
         * Fired before a node is rendered for last minute style changes.
        */
        get: function () {
            return this._nodeRenderStyling;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodeRenderStyling_wrapped !== null) {
                this.i.nodeRenderStyling = delegateRemove(this.i.nodeRenderStyling, this._nodeRenderStyling_wrapped);
                this._nodeRenderStyling_wrapped = null;
                this._nodeRenderStyling = null;
            }
            this._nodeRenderStyling = ev;
            this._nodeRenderStyling_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodeStylingEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodeRenderStyling) {
                    _this.beforeNodeRenderStyling(_this, outerArgs);
                }
                if (_this._nodeRenderStyling) {
                    _this._nodeRenderStyling(_this, outerArgs);
                }
            };
            this.i.nodeRenderStyling = delegateCombine(this.i.nodeRenderStyling, this._nodeRenderStyling_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodePointerOver", {
        /**
         * Fired with the pointer is moving over a node.
        */
        get: function () {
            return this._nodePointerOver;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodePointerOver_wrapped !== null) {
                this.i.nodePointerOver = delegateRemove(this.i.nodePointerOver, this._nodePointerOver_wrapped);
                this._nodePointerOver_wrapped = null;
                this._nodePointerOver = null;
            }
            this._nodePointerOver = ev;
            this._nodePointerOver_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodePointerEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodePointerOver) {
                    _this.beforeNodePointerOver(_this, outerArgs);
                }
                if (_this._nodePointerOver) {
                    _this._nodePointerOver(_this, outerArgs);
                }
            };
            this.i.nodePointerOver = delegateCombine(this.i.nodePointerOver, this._nodePointerOver_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodePointerEnter", {
        /**
         * Fired when the pointer enters a node.
        */
        get: function () {
            return this._nodePointerEnter;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodePointerEnter_wrapped !== null) {
                this.i.nodePointerEnter = delegateRemove(this.i.nodePointerEnter, this._nodePointerEnter_wrapped);
                this._nodePointerEnter_wrapped = null;
                this._nodePointerEnter = null;
            }
            this._nodePointerEnter = ev;
            this._nodePointerEnter_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodePointerEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodePointerEnter) {
                    _this.beforeNodePointerEnter(_this, outerArgs);
                }
                if (_this._nodePointerEnter) {
                    _this._nodePointerEnter(_this, outerArgs);
                }
            };
            this.i.nodePointerEnter = delegateCombine(this.i.nodePointerEnter, this._nodePointerEnter_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodePointerLeave", {
        /**
         * Fired when the pointer leaved a node.
        */
        get: function () {
            return this._nodePointerLeave;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodePointerLeave_wrapped !== null) {
                this.i.nodePointerLeave = delegateRemove(this.i.nodePointerLeave, this._nodePointerLeave_wrapped);
                this._nodePointerLeave_wrapped = null;
                this._nodePointerLeave = null;
            }
            this._nodePointerLeave = ev;
            this._nodePointerLeave_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodePointerEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodePointerLeave) {
                    _this.beforeNodePointerLeave(_this, outerArgs);
                }
                if (_this._nodePointerLeave) {
                    _this._nodePointerLeave(_this, outerArgs);
                }
            };
            this.i.nodePointerLeave = delegateCombine(this.i.nodePointerLeave, this._nodePointerLeave_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodePointerPressed", {
        /**
         * Fired when the pointer is pressed on a node.
        */
        get: function () {
            return this._nodePointerPressed;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodePointerPressed_wrapped !== null) {
                this.i.nodePointerPressed = delegateRemove(this.i.nodePointerPressed, this._nodePointerPressed_wrapped);
                this._nodePointerPressed_wrapped = null;
                this._nodePointerPressed = null;
            }
            this._nodePointerPressed = ev;
            this._nodePointerPressed_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodePointerEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodePointerPressed) {
                    _this.beforeNodePointerPressed(_this, outerArgs);
                }
                if (_this._nodePointerPressed) {
                    _this._nodePointerPressed(_this, outerArgs);
                }
            };
            this.i.nodePointerPressed = delegateCombine(this.i.nodePointerPressed, this._nodePointerPressed_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrTreemap.prototype, "nodePointerReleased", {
        /**
         * Fired when the pointer is released on a node.
        */
        get: function () {
            return this._nodePointerReleased;
        },
        set: function (ev) {
            var _this = this;
            if (this._nodePointerReleased_wrapped !== null) {
                this.i.nodePointerReleased = delegateRemove(this.i.nodePointerReleased, this._nodePointerReleased_wrapped);
                this._nodePointerReleased_wrapped = null;
                this._nodePointerReleased = null;
            }
            this._nodePointerReleased = ev;
            this._nodePointerReleased_wrapped = function (o, e) {
                var outerArgs = new IgrTreemapNodePointerEventArgs();
                outerArgs._provideImplementation(e);
                if (_this.beforeNodePointerReleased) {
                    _this.beforeNodePointerReleased(_this, outerArgs);
                }
                if (_this._nodePointerReleased) {
                    _this._nodePointerReleased(_this, outerArgs);
                }
            };
            this.i.nodePointerReleased = delegateCombine(this.i.nodePointerReleased, this._nodePointerReleased_wrapped);
            ;
        },
        enumerable: false,
        configurable: true
    });
    return IgrTreemap;
}(React.Component));
export { IgrTreemap };
