/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { BaseDataSource } from "./BaseDataSource";
import { Base, typeCast, Array_$type, Number_$type, markType } from "./type";
import { RearrangedListView } from "./RearrangedListView";
import { DataSourcePropertiesComparer } from "./DataSourcePropertiesComparer";
import { List$1 } from "./List$1";
import { DataSourceExecutionContext } from "./DataSourceExecutionContext";
import { DataSourceLocalDataProvider } from "./DataSourceLocalDataProvider";
import { DataSourceSpecialRow } from "./DataSourceSpecialRow";
import { ISupportsDataChangeNotifications_$type } from "./ISupportsDataChangeNotifications";
import { ISupportsExpansionChangeNotifications_$type } from "./ISupportsExpansionChangeNotifications";
/**
 * @hidden
 */
var LocalDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(LocalDataSource, _super);
    function LocalDataSource() {
        var _this = _super.call(this) || this;
        _this.cg = null;
        _this.cf = null;
        _this.df = null;
        _this.cl = null;
        _this.cp = null;
        _this.cr = null;
        _this.cn = null;
        _this.c1 = new List$1(Array_$type, 0);
        _this.cs = false;
        _this.ce = null;
        _this.c9 = -1;
        _this.c2 = -1;
        _this.db = -1;
        _this.c4 = -1;
        _this.dc = -1;
        _this.c5 = -1;
        _this.da = -1;
        _this.c3 = -1;
        _this.de = -1;
        _this.dd = -1;
        _this.c7 = -1;
        _this.c6 = -1;
        _this.c8 = -1;
        _this.executionContext = new DataSourceExecutionContext();
        return _this;
    }
    LocalDataSource.prototype.get_actualBaseDataProvider = function () {
        return this.actualDataProvider;
    };
    Object.defineProperty(LocalDataSource.prototype, "actualBaseDataProvider", {
        get: function () {
            return this.get_actualBaseDataProvider();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(LocalDataSource.prototype, "dataProvider", {
        get: function () {
            return this.cg;
        },
        set: function (a) {
            var b = this.cg;
            this.cg = a;
            if (b != this.cg) {
                this.onPropertyUpdated("DataProvider", b, this.cg);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(LocalDataSource.prototype, "actualDataProvider", {
        get: function () {
            if (this.cf == null) {
                this.actualDataProvider = this.resolveDataProvider();
            }
            return this.cf;
        },
        set: function (a) {
            var b = this.cf;
            this.cf = a;
            if (b != this.cf) {
                this.onPropertyUpdated("ActualDataProvider", b, this.cf);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(LocalDataSource.prototype, "itemsSource", {
        get: function () {
            return this.df;
        },
        set: function (a) {
            var b = this.df;
            this.df = a;
            if (b != this.df) {
                this.onPropertyUpdated("ItemsSource", b, this.df);
            }
        },
        enumerable: true,
        configurable: true
    });
    LocalDataSource.prototype.canInitialize = function () {
        var a = _super.prototype.canInitialize.call(this);
        if (!a) {
            return false;
        }
        return this.itemsSource != null;
    };
    Object.defineProperty(LocalDataSource.prototype, "cm", {
        get: function () {
            return this.cl;
        },
        set: function (a) {
            this.cl = a;
            this.actualDataProvider = this.resolveDataProvider();
        },
        enumerable: true,
        configurable: true
    });
    LocalDataSource.prototype.resolveDataProvider = function () {
        var provider_ = new DataSourceLocalDataProvider();
        provider_.executionContext = new DataSourceExecutionContext();
        return provider_;
    };
    LocalDataSource.prototype.propertyUpdatedOverride = function (a, b, c) {
        _super.prototype.propertyUpdatedOverride.call(this, a, b, c);
        switch (a) {
            case "DataProvider":
                this.actualDataProvider = this.dataProvider;
                break;
            case "ActualDataProvider":
                if (this.actualDataProvider != null) {
                    this.actualDataProvider.dataSource = this.itemsSource;
                    this.actualSchema = this.actualDataProvider.actualSchema;
                    this.actualCount = this.resolveFullCount(this.actualDataProvider.actualCount);
                }
                this.queueAutoRefresh();
                break;
            case "ItemsSource":
                if (this.actualDataProvider != null) {
                    this.actualDataProvider.dataSource = this.itemsSource;
                    this.actualSchema = this.actualDataProvider.actualSchema;
                    this.actualCount = this.resolveFullCount(this.actualDataProvider.actualCount);
                }
                this.queueAutoRefresh();
                break;
        }
    };
    LocalDataSource.prototype.getItemAtIndex = function (a) {
        if (this.cp != null && this.cp.a6 != null) {
            return this.cp.a6.item(a);
        }
        else {
            return this.actualDataProvider.getItemAtIndex(a);
        }
    };
    LocalDataSource.prototype.getItemPropertyAtIndex = function (a, b) {
        var c;
        if (this.cp != null) {
            c = this.cp.a6.item(a);
        }
        else {
            c = this.actualDataProvider.getItemAtIndex(a);
        }
        var item_ = c;
        if ((item_ != null && item_.$$isSpecialRow !== undefined)) {
            return this.getSpecialRowItemValue(c, b);
        }
        return this.actualDataProvider.getItemValue(c, b);
    };
    LocalDataSource.prototype.ck = function () {
        return this.actualDataProvider;
    };
    LocalDataSource.prototype.cu = function () {
        return this.c1 != null && this.c1.count > 0;
    };
    LocalDataSource.prototype.refreshInternalOverride = function () {
        _super.prototype.refreshInternalOverride.call(this);
        if (this.actualDataProvider != null) {
            if (this.cv() || this.cw() || this.cx() || this.cy() || this.cu()) {
                if (this.cp == null) {
                    if (this.cr == null) {
                        this.cr = new LocalDataSourceViewUpdateNotifier(this);
                    }
                    this.cp = new RearrangedListView(this.actualDataProvider);
                    this.cp.ab = this.cr;
                    this.cp.ad = new LocalDataSourceViewExpansionNotifier(this);
                }
                this.ensureComparables(this.actualDataProvider.actualSchema);
                this.cp.av = this.shouldEmitSectionHeaders && this.aj;
                this.cp.au = this.shouldEmitSectionFooters && this.aj;
                this.cp.aw = this.shouldEmitShiftedRows;
                this.cp.cb(this.c1);
                this.cp.a2 = this.c0();
                this.cp.a1 = this.cz();
                this.cp.p = this.co();
                this.cp.ae = this.groupDescriptions;
                this.cp.af = this.sortDescriptions;
                this.cp.ag = this.summaryDescriptions;
                this.cp.l = this.summaryScope;
                this.cp.am = this.includeSummaryRowsInSection;
                this.cp.as = this.isSectionSummaryRowsAtBottom;
                this.cp.j = this.sectionHeaderDisplayMode;
                this.cp.m = this;
                this.cp.ap = this.groupDescriptions != null && this.groupDescriptions.k.count > 0;
                this.cp.t = this.cq();
                this.cp.b6();
                this.actualSchema = this.actualDataProvider.actualSchema;
                this.actualCount = this.cp.a6.count;
            }
            else {
                var a = this.ck();
                this.actualSchema = this.actualDataProvider.actualSchema;
                if (a != null) {
                    this.actualCount = a.actualCount;
                }
                else {
                    this.actualCount = 0;
                }
                if (this.cp != null) {
                    this.cp.ab = null;
                    this.cp = null;
                    this.onBroadcastClearItems();
                }
            }
        }
        else {
            this.actualCount = 0;
            this.actualSchema = null;
        }
    };
    LocalDataSource.prototype.get_isItemIndexLookupSupported = function () {
        return true;
    };
    LocalDataSource.prototype.get_isKeyIndexLookupSupported = function () {
        return true;
    };
    LocalDataSource.prototype.indexOfItem = function (a) {
        if (this.cp != null) {
            return this.cp.a6.indexOf(a);
        }
        if (this.actualDataProvider != null && this.actualDataProvider.isItemIndexLookupSupported) {
            return this.actualDataProvider.indexOfItem(a);
        }
        if (this.actualDataProvider != null) {
            var b = this.actualDataProvider.actualCount;
            var c = void 0;
            for (var d = 0; d < b; d++) {
                c = this.actualDataProvider.getItemAtIndex(d);
                if (this.ct(c, a)) {
                    return d;
                }
            }
        }
        return -1;
    };
    LocalDataSource.prototype.ct = function (a, b) {
        if (a == null && b == null) {
            return true;
        }
        if (a == null || b == null) {
            return false;
        }
        return Base.equalsStatic(a, b);
    };
    LocalDataSource.prototype.indexOfKey = function (a) {
        var b = this.actualPrimaryKey;
        if (b == null || b.length < 1 || this.actualBaseDataProvider == null) {
            return this.indexOfItem(a[0]);
        }
        var c = this.co();
        var d;
        if (this.cp != null) {
            var e = this.cp.a6.count;
            for (var f = 0; f < e; f++) {
                d = this.cp.a6.item(f);
                if (typeCast(DataSourceSpecialRow.$, d) !== null) {
                    var g = d;
                    if (g.rowType == 1 && !this.isSectionContentVisible && this.isSectionHeaderNormalRow) {
                        if (c.i(d, a) == 0) {
                            return f;
                        }
                    }
                }
                else if (c.i(d, a) == 0) {
                    return f;
                }
            }
            return -1;
        }
        if (this.actualDataProvider != null && this.actualDataProvider.isKeyIndexLookupSupported) {
            return this.actualDataProvider.indexOfKey(a);
        }
        if (this.actualDataProvider != null) {
            var h = this.actualDataProvider.actualCount;
            for (var i = 0; i < h; i++) {
                d = this.actualDataProvider.getItemAtIndex(i);
                if (c.i(d, a) == 0) {
                    return i;
                }
            }
        }
        return -1;
    };
    LocalDataSource.prototype.onActualPrimaryKeyChangedOverrride = function (a, b) {
        _super.prototype.onActualPrimaryKeyChangedOverrride.call(this, a, b);
        this.cn = null;
    };
    LocalDataSource.prototype.co = function () {
        if (this.cn != null) {
            return this.cn;
        }
        if (this.actualPrimaryKey == null) {
            this.cn = new DataSourcePropertiesComparer(null, null, null, this);
            return this.cn;
        }
        var a = new Array(this.actualPrimaryKey.length);
        for (var b = 0; b < a.length; b++) {
            a[b] = 0;
        }
        this.cn = new DataSourcePropertiesComparer(this.actualPrimaryKey, a, this.d, this);
        return this.cn;
    };
    LocalDataSource.prototype.cq = function () {
        if (this.filterExpressions.j.count == 0) {
            return null;
        }
        var a = this.actualDataProvider;
        var b = this.actualDataProvider.actualSchema;
        var c = this.filterExpressions.j;
        var d = function (e) {
            for (var f = 0; f < c.count; f++) {
                if (!c.item(f).match(e, a, b)) {
                    return false;
                }
            }
            return true;
        };
        return d;
    };
    LocalDataSource.prototype.c0 = function () {
        var a = 0;
        if (this.sortDescriptions.k.count == 0 && (this.groupDescriptions == null || this.groupDescriptions.k.count == 0)) {
            return null;
        }
        a = this.sortDescriptions.k.count;
        if (this.groupDescriptions != null) {
            a += this.groupDescriptions.k.count;
        }
        var b = new Array(a);
        var c = new Array(a);
        var d = 0;
        if (this.groupDescriptions != null) {
            for (var e = 0; e < this.groupDescriptions.k.count; e++) {
                b[e] = this.groupDescriptions.k.item(e).propertyName;
                c[e] = this.groupDescriptions.k.item(e).direction;
                d++;
            }
        }
        for (var f = 0; f < this.sortDescriptions.k.count; f++) {
            b[f + d] = this.sortDescriptions.k.item(f).propertyName;
            c[f + d] = this.sortDescriptions.k.item(f).direction;
        }
        return new DataSourcePropertiesComparer(b, c, this.d, this);
    };
    LocalDataSource.prototype.cz = function () {
        if (this.groupDescriptions == null || this.groupDescriptions.k.count < 1) {
            return null;
        }
        var a = 0;
        a = this.groupDescriptions.k.count;
        var b = new Array(a);
        var c = new Array(a);
        if (this.groupDescriptions != null) {
            for (var d = 0; d < this.groupDescriptions.k.count; d++) {
                b[d] = this.groupDescriptions.k.item(d).propertyName;
                c[d] = this.groupDescriptions.k.item(d).direction;
            }
        }
        return new DataSourcePropertiesComparer(b, c, this.d, this);
    };
    LocalDataSource.prototype.cw = function () {
        if (this.groupDescriptions == null || this.groupDescriptions.k.count < 1) {
            return false;
        }
        if (this.actualDataProvider == null) {
            return false;
        }
        if (this.actualDataProvider.isGroupingSupported) {
            return false;
        }
        return true;
    };
    LocalDataSource.prototype.cx = function () {
        if (this.sortDescriptions == null || this.sortDescriptions.k.count < 1) {
            return false;
        }
        if (this.actualDataProvider == null) {
            return false;
        }
        if (this.actualDataProvider.isSortingSupported) {
            return false;
        }
        return true;
    };
    LocalDataSource.prototype.cv = function () {
        return this.filterExpressions != null && this.filterExpressions.j.count > 0;
    };
    LocalDataSource.prototype.cy = function () {
        if (this.summaryDescriptions == null || this.summaryDescriptions.k.count < 1) {
            return false;
        }
        return true;
    };
    LocalDataSource.prototype.onClearItemsOverride = function () {
        if (this.cp != null) {
            this.cp.notifyClearItems();
            this.queueAutoRefresh();
        }
        else {
            _super.prototype.onClearItemsOverride.call(this);
        }
    };
    LocalDataSource.prototype.onSetItemOverride = function (a, b, c) {
        if (this.cp != null) {
            this.cp.notifySetItem(a, b, c);
        }
        else {
            _super.prototype.onSetItemOverride.call(this, a, b, c);
        }
    };
    LocalDataSource.prototype.onInsertItemOverride = function (a, b) {
        if (this.cp != null) {
            this.cp.notifyInsertItem(a, b);
        }
        else {
            _super.prototype.onInsertItemOverride.call(this, a, b);
        }
    };
    LocalDataSource.prototype.onRemoveItemOverride = function (a, b) {
        if (this.cp != null) {
            this.cp.notifyRemoveItem(a, b);
        }
        else {
            _super.prototype.onRemoveItemOverride.call(this, a, b);
        }
    };
    LocalDataSource.prototype.dk = function () {
        this.actualCount = this.cp.a6.count;
        this.onBroadcastClearItems();
    };
    LocalDataSource.prototype.dn = function (a, b, c) {
        this.actualCount = this.cp.a6.count;
        this.onBroadcastSetItem(a, b, c);
    };
    LocalDataSource.prototype.dl = function (a, b) {
        this.actualCount = this.cp.a6.count;
        this.onBroadcastInsertItem(a, b);
    };
    LocalDataSource.prototype.dm = function (a, b) {
        this.actualCount = this.cp.a6.count;
        this.onBroadcastRemoveItem(a, b);
    };
    LocalDataSource.prototype.pinRow = function (a) {
        _super.prototype.pinRow.call(this, a);
        this.c9 = -1;
        this.c2 = -1;
        if (this.cp != null) {
            this.c1.add(a);
            this.cp.b5(a);
        }
        else {
            this.c1.add(a);
            this.queueAutoRefresh();
        }
    };
    LocalDataSource.prototype.unpinRow = function (a) {
        _super.prototype.unpinRow.call(this, a);
        var b = this.co();
        if (this.cp != null) {
            for (var c = this.c1.count - 1; c >= 0; c--) {
                var d = this.c1._inner[c];
                if (d.length != a.length) {
                    continue;
                }
                if (b.h(d, a) == 0) {
                    this.c1.removeAt(c);
                    this.cp.cc(d);
                }
            }
        }
        else {
            for (var e = this.c1.count - 1; e >= 0; e--) {
                var f = this.c1._inner[e];
                if (f.length != a.length) {
                    continue;
                }
                if (b.h(f, a) == 0) {
                    this.c1.removeAt(e);
                }
            }
            this.queueAutoRefresh();
        }
        this.c9 = -1;
        this.c2 = -1;
    };
    LocalDataSource.prototype.clearPinnedRows = function () {
        for (var a = this.c1.count - 1; a >= 0; a--) {
            this.unpinRow(this.c1._inner[a]);
        }
    };
    LocalDataSource.prototype.isRowPinned = function (a) {
        if (this.cp == null) {
            return false;
        }
        var b = this.getItemAtIndex(a);
        if (b == null) {
            return false;
        }
        var item_ = b;
        if ((item_ != null && item_.$$isSpecialRow !== undefined)) {
            if (item_.rowType == 3) {
                return true;
            }
        }
        var c = this.co();
        var d;
        if (this.actualPrimaryKey == null) {
            d = new Array(1);
            d[0] = b;
        }
        else {
            var e = this.actualPrimaryKey;
            var f = e.length;
            d = new Array(f);
            for (var g = 0; g < f; g++) {
                d[g] = this.getItemProperty(b, e[g]);
            }
        }
        for (var h = 0; h < this.c1.count; h++) {
            if (c.h(this.c1._inner[h], d) == 0) {
                return true;
            }
        }
        return false;
    };
    LocalDataSource.prototype.get_isSortingSupported = function () {
        if (this.externalDataSource != null && !this.cs) {
            this.cs = true;
            var a = this.externalDataSource.isSortingSupportedOverride;
            this.cs = false;
            return a;
        }
        return true;
    };
    LocalDataSource.prototype.get_isFilteringSupported = function () {
        if (this.externalDataSource != null && !this.cs) {
            this.cs = true;
            var a = this.externalDataSource.isFilteringSupportedOverride;
            this.cs = false;
            return a;
        }
        return true;
    };
    LocalDataSource.prototype.get_isGroupingSupported = function () {
        if (this.externalDataSource != null && !this.cs) {
            this.cs = true;
            var a = this.externalDataSource.isGroupingSupportedOverride;
            this.cs = false;
            return a;
        }
        return true;
    };
    LocalDataSource.prototype.getStickyRowPriority = function (a) {
        var b = this.getRowType(a);
        switch (b) {
            case 1: return 100 - this.getRowLevel(a);
            case 2: return 99 - this.getRowLevel(a);
            case 3:
            case 5: return 2;
            case 4: return 3;
        }
        return 1;
    };
    LocalDataSource.prototype.getStickyRowsInRange = function (a, b) {
        if (this.cp == null || ((this.groupDescriptions == null || this.groupDescriptions.k.count == 0) && (this.summaryDescriptions == null || this.summaryDescriptions.k.count == 0) && !this.cu())) {
            return null;
        }
        var c = null;
        var d = null;
        if (this.cp.a5.count == 1) {
            c = this.cp.a5._inner[0];
            d = this.cp.a5._inner[0];
        }
        else {
            c = this.cp.w(a);
            if (c != null) {
                while (c.z != -1) {
                    c = this.cp.a5._inner[c.z];
                }
            }
            d = this.cp.w(b);
            if (b >= this.cp.a6.count - this.cp.bk) {
                d = this.cp.v();
            }
        }
        if (c == null || d == null) {
            return null;
        }
        if (c.ae == this.c9 && c.aa == this.db && c.af == this.dc && c.ad == this.da && c.ah == this.de && c.ag == this.dd && d.ae == this.c2 && d.aa == this.c4 && d.af == this.c5 && d.ad == this.c3 && d.ah == this.c7 && d.ag == this.c6 && this.cp.bk == this.c8) {
            return this.ce;
        }
        this.c9 = c.ae;
        this.c2 = d.ae;
        this.db = c.aa;
        this.c4 = d.aa;
        this.dc = c.af;
        this.c5 = d.af;
        this.da = c.ad;
        this.c3 = d.ad;
        this.de = c.ah;
        this.dd = c.ag;
        this.c7 = d.ah;
        this.c6 = d.ag;
        this.c8 = this.cp.bk;
        if (this.cp.a5.count == 1) {
            this.c2 = d.ad;
        }
        var e = 0;
        if (this.shouldEmitSectionHeaders && this.aj) {
            e = 1;
        }
        var f = this.cp.ba();
        var g = new List$1(Number_$type, 0);
        for (var h = c.ae; h <= d.ae; h++) {
            var i = this.cp.a5._inner[h];
            var j = this.cp.a5._inner[h].c.length;
            var k = this.cp.a5._inner[h].w();
            if (this.shouldEmitSectionHeaders && this.aj) {
                for (var l = 0; l < j; l++) {
                    if (this.cp.a5._inner[h].a[l] != null) {
                        var m = i.af + i.b[l];
                        g.add(m);
                        if (this.summaryScope == 0 || this.summaryScope == 2) {
                            if (i.c[l] && this.includeSummaryRowsInSection && !this.isSectionSummaryRowsAtBottom) {
                                for (var n = 0; n < f; n++) {
                                    g.add(m + 1 + n);
                                }
                            }
                        }
                    }
                    if (!this.cp.a5._inner[h].c[l]) {
                        break;
                    }
                }
            }
            if (this.cp.a5._inner[h].q) {
                if (this.shouldEmitShiftedRows) {
                    for (var o = 0; o < this.cp.a5._inner[h].aa; o++) {
                        g.add(this.cp.a5._inner[h].af + this.cp.a5._inner[h].ah + o + k);
                    }
                }
            }
            if (this.summaryScope == 0 || this.summaryScope == 2) {
                if (this.includeSummaryRowsInSection && this.isSectionSummaryRowsAtBottom) {
                    for (var p = this.cp.a5._inner[h].ag - 1; p >= 0; p--) {
                        if (this.shouldEmitSectionFooters) {
                            g.add(this.cp.a5._inner[h].ad - k - p);
                        }
                        else {
                            g.add(this.cp.a5._inner[h].ad - p);
                        }
                    }
                }
            }
            if (this.shouldEmitSectionFooters && this.aj) {
                for (var q = j - 1; q >= 0; q--) {
                    if (!this.cp.a5._inner[h].c[q]) {
                        break;
                    }
                    g.add(this.cp.a5._inner[h].ad - q);
                }
            }
        }
        for (var r = this.cp.a6.count - this.cp.bk; r < this.cp.a6.count; r++) {
            g.add(r);
        }
        this.ce = g.toArray();
        return this.ce;
    };
    LocalDataSource.prototype.isExclusivelySticky = function (a) {
        var b = this.getRowType(a);
        return b == 1 || b == 2 || b == 4 || (this.isSectionSummaryRowsAtBottom && b == 5);
    };
    LocalDataSource.prototype.getRowType = function (a) {
        if (a < 0) {
            return 0;
        }
        var b = this.getItemAtIndex(a);
        var item_ = b;
        if ((item_ != null && item_.$$isSpecialRow !== undefined)) {
            var c = b.rowType;
            if (this.isSectionHeaderNormalRow && c == 1) {
                return 0;
            }
            return c;
        }
        return 0;
    };
    LocalDataSource.prototype.setIsRowExpandedAtIndex = function (a, b) {
        if (this.isSectionCollapsable && this.cp != null && this.cp.a6.count > 0 && this.cp.a6.count > a) {
            this.cp.ca(a, b);
        }
    };
    LocalDataSource.prototype.getIsRowExpandedAtIndex = function (a) {
        if (this.cp != null && this.cp.a6.count > 0 && this.cp.a6.count > a) {
            return this.cp.ak(a);
        }
        return true;
    };
    LocalDataSource.prototype.getRowLevel = function (a) {
        if (a < 0) {
            return 0;
        }
        var b = this.getItemAtIndex(a);
        var item_ = b;
        if ((item_ != null && item_.$$isSpecialRow !== undefined)) {
            return b.level;
        }
        if (this.sectionHeaderDisplayMode == 1) {
            return this.groupDescriptions.k.count;
        }
        else if (this.groupDescriptions.k.count > 0) {
            return 1;
        }
        return 0;
    };
    LocalDataSource.prototype.getRootSummaryRowCount = function () {
        if (this.cp != null) {
            return this.cp.bk;
        }
        return 0;
    };
    LocalDataSource.prototype.getRootSummaryResults = function () {
        if (this.cp != null) {
            return this.cp.i;
        }
        return null;
    };
    LocalDataSource.prototype.getSectionSummaryResults = function (a) {
        if (this.cp != null && this.cp.a5.count > 0 && a >= 0 && a < this.cp.a5.count) {
            return this.cp.a5._inner[a].j;
        }
        return null;
    };
    LocalDataSource.prototype.clone = function () {
        var a = new LocalDataSource();
        a.itemsSource = this.itemsSource;
        _super.prototype.cloneProperties.call(this, a);
        return a;
    };
    LocalDataSource.$t = markType(LocalDataSource, 'LocalDataSource', BaseDataSource.$);
    return LocalDataSource;
}(BaseDataSource));
export { LocalDataSource };
/**
 * @hidden
 */
var LocalDataSourceViewUpdateNotifier = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(LocalDataSourceViewUpdateNotifier, _super);
    function LocalDataSourceViewUpdateNotifier(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.a = a;
        return _this;
    }
    LocalDataSourceViewUpdateNotifier.prototype.notifyClearItems = function () {
        this.a.dk();
    };
    LocalDataSourceViewUpdateNotifier.prototype.notifyInsertItem = function (a, b) {
        this.a.dl(a, b);
    };
    LocalDataSourceViewUpdateNotifier.prototype.notifyRemoveItem = function (a, b) {
        this.a.dm(a, b);
    };
    LocalDataSourceViewUpdateNotifier.prototype.notifySetItem = function (a, b, c) {
        this.a.dn(a, b, c);
    };
    LocalDataSourceViewUpdateNotifier.$t = markType(LocalDataSourceViewUpdateNotifier, 'LocalDataSourceViewUpdateNotifier', Base.$, [ISupportsDataChangeNotifications_$type]);
    return LocalDataSourceViewUpdateNotifier;
}(Base));
export { LocalDataSourceViewUpdateNotifier };
/**
 * @hidden
 */
var LocalDataSourceViewExpansionNotifier = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(LocalDataSourceViewExpansionNotifier, _super);
    function LocalDataSourceViewExpansionNotifier(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.a = a;
        return _this;
    }
    LocalDataSourceViewExpansionNotifier.prototype.notifyRowExpansionChanged = function (a, b, c) {
        this.a.onRowExpansionChanged(a, b, c);
    };
    LocalDataSourceViewExpansionNotifier.$t = markType(LocalDataSourceViewExpansionNotifier, 'LocalDataSourceViewExpansionNotifier', Base.$, [ISupportsExpansionChangeNotifications_$type]);
    return LocalDataSourceViewExpansionNotifier;
}(Base));
export { LocalDataSourceViewExpansionNotifier };
//# sourceMappingURL=LocalDataSource_combined.js.map
