/*
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 { Base, PropertyChangedEventArgs, runOn, delegateCombine, typeCast, fromEnum, String_$type, delegateRemove, enumGetBox, markType } from "./type";
import { IDataSource_$type } from "./IDataSource";
import { IEditableDataSource_$type } from "./IEditableDataSource";
import { TransactionService } from "./TransactionService";
import { IDataSourceDataProviderUpdateNotifier_$type } from "./IDataSourceDataProviderUpdateNotifier";
import { SortDescriptionCollection } from "./SortDescriptionCollection";
import { FilterExpressionCollection } from "./FilterExpressionCollection";
import { SummaryDescriptionCollection } from "./SummaryDescriptionCollection";
import { DataSourceSummaryScope_$type } from "./DataSourceSummaryScope";
import { DataSourceSectionHeaderDisplayMode_$type } from "./DataSourceSectionHeaderDisplayMode";
import { TransactionKeyEqualityComparer } from "./TransactionKeyEqualityComparer";
import { Transaction } from "./Transaction";
import { DataSourceSpecialRow } from "./DataSourceSpecialRow";
import { List$1 } from "./List$1";
import { Dictionary$2 } from "./Dictionary$2";
import { DataSourceAggregatedResult } from "./DataSourceAggregatedResult";
import { DataSourceDataCommittedEventArgs } from "./DataSourceDataCommittedEventArgs";
import { DataSourceRowExpansionChangedEventArgs } from "./DataSourceRowExpansionChangedEventArgs";
import { DataSourceSchemaChangedEventArgs } from "./DataSourceSchemaChangedEventArgs";
import { TransactionType } from "./TransactionType";
/**
 * @hidden
 */
var BaseDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(BaseDataSource, _super);
    function BaseDataSource() {
        var _this = _super.call(this) || this;
        _this.t = null;
        _this._isReadOnly = false;
        _this.y = false;
        _this.dataCommitted = null;
        _this.an = false;
        _this.aw = null;
        _this._externalDataSource = null;
        _this.r = null;
        _this.q = null;
        _this.h = null;
        _this.s = null;
        _this.i = null;
        _this.n = null;
        _this.ar = 0;
        _this.as = 0;
        _this.at = 0;
        _this.o = null;
        _this.propertyChanged = null;
        _this.k = null;
        _this.m = null;
        _this.schemaChanged = null;
        _this.rowExpansionChanged = null;
        _this.z = false;
        _this.g = 0;
        _this.w = false;
        _this.b = null;
        _this.a = null;
        _this.c = null;
        _this.af = false;
        _this.ag = false;
        _this.u = false;
        _this.f = 0;
        _this.aa = false;
        _this.ac = true;
        _this.x = false;
        _this.ae = false;
        _this.ad = false;
        _this.ab = true;
        _this.ai = true;
        _this.ah = false;
        _this.aj = true;
        _this.v = false;
        _this.d = null;
        _this.k = new DefaultDataSourceDataProviderUpdateNotifier(_this);
        _this.r = new SortDescriptionCollection();
        _this.q = new SortDescriptionCollection();
        _this.s = new SummaryDescriptionCollection();
        _this.r.n(runOn(_this, _this.cn));
        _this.q.n(runOn(_this, _this.br));
        _this.s.n(runOn(_this, _this.co));
        _this.h = new FilterExpressionCollection();
        _this.h.m(runOn(_this, _this.bp));
        _this.t = new TransactionService(runOn(_this, _this.bt), runOn(_this, _this.clone1), new TransactionKeyEqualityComparer());
        var a = _this.t;
        a.stateChanged = delegateCombine(a.stateChanged, runOn(_this, _this.cj));
        return _this;
    }
    BaseDataSource.prototype.cj = function (a, b) {
        if (a == 0 || a == 1) {
            if (this.updateNotifier != null) {
                var c = b;
                var d = c.transactions._inner[0];
                if (d.type == 1 || d.type == TransactionType.Delete) {
                    var e = d.id;
                    var f = this.indexOfKey(e);
                    if (f > -1) {
                        var g = this.getItemAtIndex(f);
                        this.updateNotifier.notifySetItem(f, g, g);
                        var h = this.getStickyRows();
                        if (h != null) {
                            for (var i = 0; i < h.length; i++) {
                                var j = h[i];
                                var k = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(j));
                                if (k != null && k.rowType == 3 && k.targetRow == g) {
                                    this.updateNotifier.notifySetItem(j, k, k);
                                    break;
                                }
                            }
                        }
                    }
                }
                else if (d.type == 0) {
                }
            }
        }
        this.ci(a, b);
    };
    BaseDataSource.prototype.ci = function (a, b) {
    };
    BaseDataSource.prototype.ao = function () {
        return !this.isReadOnly && this.actualPrimaryKey != null && this.actualBaseDataProvider != null && this.t != null;
    };
    BaseDataSource.prototype.bt = function (a, b) {
        var e_1, _a;
        if (a != null && b != null) {
            var c = a;
            var d = b;
            try {
                for (var _b = tslib_1.__values(fromEnum(d)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    if (c.containsKey(e.key)) {
                        c.item(e.key, e.value);
                    }
                    else {
                        c.addItem(e.key, e.value);
                    }
                }
            }
            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;
                }
            }
        }
    };
    BaseDataSource.prototype.clone1 = function (a) {
        var e_2, _a;
        if (a != null) {
            var b = a;
            var c = new Dictionary$2(String_$type, Base.$, 0);
            try {
                for (var _b = tslib_1.__values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var d = _c.value;
                    c.addItem(d.key, d.value);
                }
            }
            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;
                }
            }
            return c;
        }
        return null;
    };
    Object.defineProperty(BaseDataSource.prototype, "isReadOnly", {
        get: function () {
            return this._isReadOnly;
        },
        set: function (a) {
            this._isReadOnly = a;
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isBatchingEnabled = function () {
        return this.y;
    };
    BaseDataSource.prototype.set_isBatchingEnabled = function (a) {
        this.y = a;
    };
    Object.defineProperty(BaseDataSource.prototype, "isBatchingEnabled", {
        get: function () {
            return this.get_isBatchingEnabled();
        },
        set: function (a) {
            this.set_isBatchingEnabled(a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "canUndo", {
        get: function () {
            return this.t.k;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "canRedo", {
        get: function () {
            return this.t.j;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "canCommit", {
        get: function () {
            return this.t.a(-1).length > 0;
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.updatePropertyAtKey = function (a, b, c, d) {
        if (d === void 0) {
            d = false;
        }
        if (this.ao()) {
            var e_3 = null;
            if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) {
                var f = typeCast(DataSourceSpecialRow.$, a[0]);
                if (f.rowType == 3) {
                    e_3 = f;
                    if (this.actualPrimaryKey != null) {
                        a = new Array(this.actualPrimaryKey.length);
                        this.getPrimaryKeyValue(e_3.targetRow, a);
                    }
                    else {
                        a = ((function () {
                            var $ret = new Array(1);
                            $ret.push(e_3.targetRow);
                            return $ret;
                        })());
                    }
                }
            }
            var g = new Dictionary$2(String_$type, Base.$, 0);
            g.addItem(b, c);
            var h = new Transaction();
            h.id = a;
            h.value = g;
            h.type = 1;
            this.t.v(h, d);
            if (this.isBatchingEnabled || d) {
                if (this.updateNotifier != null) {
                    var i = this.indexOfKey(a);
                    if (i > -1) {
                        var j = this.getItemAtIndex(i);
                        this.updateNotifier.notifySetItem(i, j, j);
                    }
                    if (this.isRowPinned(i)) {
                        var k = -1;
                        if (e_3 != null) {
                            k = this.indexOfItem(e_3);
                        }
                        else {
                            var l = this.getStickyRows();
                            if (l != null) {
                                for (var m = 0; m < l.length; m++) {
                                    var n = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(l[m]));
                                    if (n != null && n.rowType == 3) {
                                        e_3 = n;
                                        k = l[m];
                                        break;
                                    }
                                }
                            }
                        }
                        if (k > -1) {
                            this.updateNotifier.notifySetItem(k, e_3, e_3);
                        }
                    }
                }
            }
            return h.transactionID;
        }
        return -1;
    };
    BaseDataSource.prototype.removeItemByKey = function (a) {
        if (this.ao()) {
            var b_1 = null;
            if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) {
                var c = typeCast(DataSourceSpecialRow.$, a[0]);
                if (c.rowType == 3) {
                    b_1 = c;
                    if (this.actualPrimaryKey != null) {
                        a = new Array(this.actualPrimaryKey.length);
                        this.getPrimaryKeyValue(b_1.targetRow, a);
                    }
                    else {
                        a = ((function () {
                            var $ret = new Array(1);
                            $ret.push(b_1.targetRow);
                            return $ret;
                        })());
                    }
                }
            }
            var d = new Transaction();
            d.id = a;
            d.type = TransactionType.Delete;
            this.t.v(d, false);
            if (this.isBatchingEnabled) {
                if (this.updateNotifier != null) {
                    var e = this.indexOfKey(a);
                    if (e > -1) {
                        var f = this.getItemAtIndex(e);
                        this.updateNotifier.notifySetItem(e, f, f);
                    }
                    if (this.isRowPinned(e)) {
                        var g = -1;
                        if (b_1 != null) {
                            g = this.indexOfItem(b_1);
                        }
                        else {
                            var h = this.getStickyRows();
                            if (h != null) {
                                for (var i = 0; i < h.length; i++) {
                                    var j = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(h[i]));
                                    if (j != null && j.rowType == 3) {
                                        b_1 = j;
                                        g = h[i];
                                        break;
                                    }
                                }
                            }
                        }
                        if (g > -1) {
                            this.updateNotifier.notifySetItem(g, b_1, b_1);
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.removeItem = function (a) {
        if (this.ao()) {
            var b = void 0;
            if (typeCast(DataSourceSpecialRow.$, a) !== null) {
                b = [a];
            }
            else if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) {
                b = [a];
            }
            else {
                b = new Array(this.actualPrimaryKey.length);
                this.getPrimaryKeyValue(a, b);
            }
            this.removeItemByKey(b);
        }
    };
    BaseDataSource.prototype.addItem = function (a) {
        if (this.ao()) {
            if (typeCast(DataSourceSpecialRow.$, a) !== null) {
                return;
            }
            var b = new Transaction();
            b.id = [a];
            b.type = 0;
            this.t.v(b, false);
        }
    };
    BaseDataSource.prototype.acceptPendingTransaction = function (a) {
        if (this.ao()) {
            var b = this.t.d(a);
            if (b != null) {
                this.t.ap(a);
            }
        }
    };
    BaseDataSource.prototype.rejectPendingTransaction = function (a) {
        if (this.ao()) {
            var b = this.t.d(a);
            if (b != null) {
                this.t.x(a);
                if (this.updateNotifier != null) {
                    if (b.type != 0) {
                        var c = b.id;
                        var d = this.indexOfKey(c);
                        if (d > -1) {
                            var e = this.getItemAtIndex(d);
                            this.updateNotifier.notifySetItem(d, e, e);
                            var f = this.getStickyRows();
                            if (f != null) {
                                for (var g = 0; g < f.length; g++) {
                                    var h = typeCast(DataSourceSpecialRow.$, this.getItemAtIndex(f[g]));
                                    if (h != null && h.rowType == 3) {
                                        if (h.targetRow == e) {
                                            this.updateNotifier.notifySetItem(f[g], h, h);
                                            break;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.commitEdits = function (a) {
        if (this.ao()) {
            var b = this.t.c(null).length > 0;
            var c = this.t.s(a, this.isBatchingEnabled);
            if (c == -1 && b) {
                if (this.updateNotifier != null) {
                    this.updateNotifier.notifyClearItems();
                }
            }
            return c;
        }
        return -1;
    };
    BaseDataSource.prototype.cancelEdits = function () {
        if (this.ao()) {
            this.t.w(true, null);
            if (this.updateNotifier != null) {
                this.updateNotifier.notifyClearItems();
            }
        }
    };
    BaseDataSource.prototype.acceptPendingCommit = function (a) {
        if (this.ao()) {
            var b = this.t.e(a);
            if (b != null) {
                this.t.u(a);
                if (this.updateNotifier != null) {
                    for (var c = 0; c < b.a.length; c++) {
                        if (b.a[c].transactionType != 0) {
                            var d = b.a[c].id;
                            var e = this.indexOfKey(d);
                            if (e > -1) {
                                var f = this.getItemAtIndex(e);
                                this.updateNotifier.notifySetItem(e, f, f);
                            }
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.rejectPendingCommit = function (a) {
        if (this.ao()) {
            var b = this.t.e(a);
            if (b != null) {
                this.t.ac(a);
                if (this.updateNotifier != null) {
                    for (var c = 0; c < b.a.length; c++) {
                        if (b.a[c].transactionType != 0) {
                            var d = b.a[c].id;
                            var e = this.indexOfKey(d);
                            if (e > -1) {
                                var f = this.getItemAtIndex(e);
                                this.updateNotifier.notifySetItem(e, f, f);
                            }
                        }
                    }
                }
            }
        }
    };
    BaseDataSource.prototype.undo = function () {
        if (this.ao()) {
            this.t.ae();
        }
    };
    BaseDataSource.prototype.redo = function () {
        if (this.ao()) {
            this.t.ab();
        }
    };
    BaseDataSource.prototype.hasEdit = function (a, b) {
        if (this.ao()) {
            a = this.e(a);
            var c = this.t.g(a);
            if (c != null) {
                var d = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value);
                if (d != null && d.containsKey(b)) {
                    return true;
                }
            }
            c = this.t.ah(a);
            if (c != null) {
                var e = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value);
                if (e != null && e.containsKey(b)) {
                    return true;
                }
            }
            c = this.t.ag(a);
            if (c != null) {
                var f = typeCast(Dictionary$2.$.specialize(String_$type, Base.$), c.value);
                if (f != null && f.containsKey(b)) {
                    return true;
                }
            }
        }
        return false;
    };
    BaseDataSource.prototype.hasDelete = function (a) {
        if (this.ao()) {
            a = this.e(a);
            var b = this.t.g(a);
            if (b != null && b.transactionType == TransactionType.Delete) {
                return true;
            }
            b = this.t.ah(a);
            if (b != null && b.transactionType == TransactionType.Delete) {
                return true;
            }
            b = this.t.ag(a);
            if (b != null && b.transactionType == TransactionType.Delete) {
                return true;
            }
        }
        return false;
    };
    BaseDataSource.prototype.hasAdd = function (a) {
        if (this.ao()) {
            var b = this.t.g(a);
            if (b != null && b.transactionType == 0) {
                return true;
            }
            b = this.t.ah(a);
            if (b != null && b.transactionType == 0) {
                return true;
            }
        }
        return false;
    };
    BaseDataSource.prototype.getAggregatedChanges = function (a) {
        var e_4, _a;
        if (this.ao()) {
            var b = this.t.a(a);
            var c = new List$1(DataSourceAggregatedResult.$, 0);
            for (var d = 0; d < b.length; d++) {
                var e = b[d].id;
                var f = new DataSourceAggregatedResult();
                if (b[d].transactionType == 0) {
                    f.transactionType = 0;
                    f.item = e[0];
                }
                else if (b[d].transactionType == TransactionType.Delete) {
                    f.transactionType = TransactionType.Delete;
                    var g = this.indexOfKey(e);
                    if (g > -1) {
                        f.item = this.getItemAtIndex(g);
                    }
                    else {
                        f.item = e;
                    }
                }
                else if (b[d].transactionType == 1) {
                    f.transactionType = 1;
                    var h = b[d].value;
                    f.keys = new Array(h.count);
                    f.values = new Array(h.count);
                    var i = 0;
                    try {
                        for (var _b = (e_4 = void 0, tslib_1.__values(fromEnum(h))), _c = _b.next(); !_c.done; _c = _b.next()) {
                            var j = _c.value;
                            f.keys[i] = j.key;
                            f.values[i] = j.value;
                            i++;
                        }
                    }
                    catch (e_4_1) {
                        e_4 = { error: e_4_1 };
                    }
                    finally {
                        try {
                            if (_c && !_c.done && (_a = _b.return))
                                _a.call(_b);
                        }
                        finally {
                            if (e_4)
                                throw e_4.error;
                        }
                    }
                    var k = this.indexOfKey(e);
                    if (k > -1) {
                        f.item = this.getItemAtIndex(k);
                    }
                    else {
                        f.item = e;
                    }
                }
                c.add(f);
            }
            return c.toArray();
        }
        return new Array(0);
    };
    BaseDataSource.prototype.isPendingTransaction = function (a) {
        return this.t.d(a) != null;
    };
    BaseDataSource.prototype.isPendingCommit = function (a) {
        return this.t.e(a) != null;
    };
    BaseDataSource.prototype.setTransactionError = function (a, b) {
        var c = this.t.d(a);
        if (c != null) {
            c.error = b;
            if (this.updateNotifier != null) {
                var d = c.id;
                var e = this.indexOfKey(d);
                if (e > -1) {
                    var f = this.getItemAtIndex(e);
                    this.updateNotifier.notifySetItem(e, f, f);
                }
            }
        }
    };
    BaseDataSource.prototype.getTransactionErrorByKey = function (a, b) {
        a = this.e(a);
        var c = this.t.c(a);
        for (var d = 0; d < c.length; d++) {
            if (c[d].error != null) {
                if (c[d].type == 1) {
                    var e = c[d].value;
                    if (e.containsKey(b)) {
                        return c[d].error;
                    }
                }
            }
        }
        return null;
    };
    BaseDataSource.prototype.getTransactionErrorByID = function (a) {
        var b = this.t.d(a);
        if (b != null) {
            return b.error;
        }
        return null;
    };
    BaseDataSource.prototype.getTransactionID = function (a, b) {
        a = this.e(a);
        var c = this.t.c(a);
        for (var d = 0; d < c.length; d++) {
            if (c[d].type == 1) {
                var e = c[d].value;
                if (e.containsKey(b)) {
                    return c[d].transactionID;
                }
            }
        }
        return -1;
    };
    BaseDataSource.prototype.e = function (a) {
        if (a.length == 1 && typeCast(DataSourceSpecialRow.$, a[0]) !== null) {
            var b_2 = typeCast(DataSourceSpecialRow.$, a[0]);
            if (b_2.rowType == 3) {
                if (this.actualPrimaryKey != null) {
                    a = new Array(this.actualPrimaryKey.length);
                    this.getPrimaryKeyValue(b_2.targetRow, a);
                }
                else {
                    a = ((function () {
                        var $ret = new Array(1);
                        $ret.push(b_2.targetRow);
                        return $ret;
                    })());
                }
            }
        }
        return a;
    };
    BaseDataSource.prototype.bu = function (a, b) {
        if (this.dataCommitted != null) {
            this.dataCommitted(this, new DataSourceDataCommittedEventArgs(a, b));
        }
    };
    BaseDataSource.prototype.cn = function (a, b) {
        this.onSortDescriptionsChanged(b);
    };
    BaseDataSource.prototype.br = function (a, b) {
        this.onGroupDescriptionsChanged(b);
    };
    BaseDataSource.prototype.co = function (a, b) {
        this.onSummaryDescriptionsChanged(b);
    };
    BaseDataSource.prototype.bp = function (a, b) {
        this.onFilterExpressionsChanged(b);
    };
    BaseDataSource.prototype.onSortDescriptionsChanged = function (a) {
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onGroupDescriptionsChanged = function (a) {
        if (this.isGroupingSupported) {
            if (this.groupDescriptions != null && this.groupDescriptions.k.count > 0) {
                this.an = true;
            }
            else {
                this.an = false;
            }
            this.queueAutoRefresh();
        }
    };
    BaseDataSource.prototype.onSummaryDescriptionsChanged = function (a) {
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onFilterExpressionsChanged = function (a) {
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onRowExpansionChanged = function (a, b, c) {
        if (this.rowExpansionChanged != null) {
            this.rowExpansionChanged(this, new DataSourceRowExpansionChangedEventArgs(a, b, c));
        }
    };
    BaseDataSource.prototype.isPlaceholderItem = function (a) {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "externalDataSource", {
        get: function () {
            return this._externalDataSource;
        },
        set: function (a) {
            this._externalDataSource = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "actualSchema", {
        get: function () {
            return this.n;
        },
        set: function (a) {
            var b = this.n;
            this.n = a;
            if (b != this.n) {
                this.onPropertyUpdated("ActualSchema", b, this.n);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "actualCount", {
        get: function () {
            return this.ar;
        },
        set: function (a) {
            var b = this.ar;
            this.ar = a;
            if (b != this.ar) {
                this.onPropertyUpdated("ActualCount", b, this.ar);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "firstVisibleIndexRequested", {
        get: function () {
            return this.as;
        },
        set: function (a) {
            var b = this.as;
            this.as = a;
            if (b != this.as) {
                this.onPropertyUpdated("FirstVisibleIndexRequested", b, this.as);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "lastVisibleIndexRequested", {
        get: function () {
            return this.at;
        },
        set: function (a) {
            var b = this.at;
            this.at = a;
            if (b != this.at) {
                this.onPropertyUpdated("LastVisibleIndexRequested", b, this.at);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "updateNotifier", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            var b = this.o;
            this.o = a;
            if (b != this.o) {
                this.onPropertyUpdated("UpdateNotifier", b, this.o);
            }
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.getItemAtIndex = function (a) {
        return null;
    };
    BaseDataSource.prototype.getItemProperty = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            var item_ = a;
            if ((item_ != null && item_.$$isSpecialRow !== undefined)) {
                return this.getSpecialRowItemValue(a, b);
            }
            return this.actualBaseDataProvider.getItemValue(a, b);
        }
        return null;
    };
    BaseDataSource.prototype.getSpecialRowItemValue = function (a, b) {
        if (a.rowType == 3) {
            if (this.ao()) {
                var c = this.ax(a.targetRow, b);
                if (c != null) {
                    return c;
                }
            }
            return this.getItemProperty(a.targetRow, b);
        }
        return a.n(b);
    };
    BaseDataSource.prototype.ax = function (a, b) {
        var c;
        if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) {
            c = [a];
        }
        else {
            c = new Array(this.actualPrimaryKey.length);
            this.getPrimaryKeyValue(a, c);
        }
        var d = this.t.g(c);
        if (d != null && d.transactionType == 1) {
            var e = d.value;
            if (e.containsKey(b)) {
                return e.item(b);
            }
        }
        d = this.t.ah(c);
        if (d != null && d.transactionType == 1) {
            var f = d.value;
            if (f.containsKey(b)) {
                return f.item(b);
            }
        }
        d = this.t.ag(c);
        if (d != null && d.transactionType == 1) {
            var g = d.value;
            if (g.containsKey(b)) {
                return g.item(b);
            }
        }
        return null;
    };
    BaseDataSource.prototype.al = function (a, b) {
        var c;
        if (this.actualPrimaryKey == null || this.actualPrimaryKey.length < 1) {
            c = [a];
        }
        else {
            c = new Array(this.actualPrimaryKey.length);
            this.getPrimaryKeyValue(a, c);
        }
        var d = this.t.g(c);
        if (d != null && d.transactionType == 1) {
            var e = d.value;
            if (e.containsKey(b)) {
                return true;
            }
        }
        d = this.t.ah(c);
        if (d != null && d.transactionType == 1) {
            var f = d.value;
            if (f.containsKey(b)) {
                return true;
            }
        }
        d = this.t.ag(c);
        if (d != null && d.transactionType == 1) {
            var g = d.value;
            if (g.containsKey(b)) {
                return true;
            }
        }
        return false;
    };
    BaseDataSource.prototype.getItemPropertyAtIndex = function (a, b) {
        return null;
    };
    BaseDataSource.prototype.get_fullSectionInformationWillForceLoad = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "fullSectionInformationWillForceLoad", {
        get: function () {
            return this.get_fullSectionInformationWillForceLoad();
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.onPropertyUpdated = function (a, b, c) {
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        this.propertyUpdatedOverride(a, b, c);
    };
    BaseDataSource.prototype.propertyUpdatedOverride = function (a, b, c) {
        switch (a) {
            case "PrimaryKey":
                this.actualPrimaryKey = this.primaryKey;
                break;
            case "ActualPrimaryKey":
                this.onActualPrimaryKeyChanged(b, c);
                break;
            case "ExecutionContext":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.executionContext = this.executionContext;
                }
                this.queueAutoRefresh();
                break;
            case "LastVisibleIndexRequested":
            case "FirstVisibleIndexRequested":
                this.onRequestedVisibleRangeChanged();
                break;
            case "ActualDataProvider":
                this.onActualDataProviderChanged(b, c);
                break;
            case "DeferAutoRefresh":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.deferAutoRefresh = this.deferAutoRefresh;
                }
                if (!c) {
                    this.queueAutoRefresh();
                }
                break;
            case "PropertiesRequested":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.propertiesRequested = this.propertiesRequested;
                }
                break;
            case "ShouldEmitSectionFooters":
            case "ShouldEmitSectionHeaders":
            case "ShouldEmitShiftedRows":
            case "SectionHeaderDisplayMode":
            case "IsSectionCollapsable":
            case "IncludeSummaryRowsInSection":
            case "IsSectionSummaryRowsAtBottom":
            case "IsSectionContentVisible":
                this.queueAutoRefresh();
                break;
            case "SummaryScope":
                if (this.actualBaseDataProvider != null) {
                    this.actualBaseDataProvider.summaryScope = this.summaryScope;
                }
                this.queueAutoRefresh();
                break;
        }
    };
    BaseDataSource.prototype.onActualPrimaryKeyChanged = function (a, b) {
        this.onActualPrimaryKeyChangedOverrride(a, b);
    };
    BaseDataSource.prototype.onActualPrimaryKeyChangedOverrride = function (a, b) {
    };
    BaseDataSource.prototype.get_isVirtual = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isVirtual", {
        get: function () {
            return this.get_isVirtual();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "dataProviderUpdateNotifier", {
        get: function () {
            return this.k;
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.onActualDataProviderChanged = function (a, b) {
        var c = a;
        var d = b;
        if (c != null) {
            c.updateNotifier = null;
        }
        if (d != null) {
            d.updateNotifier = this.k;
        }
        if (c != null) {
            c.schemaChanged = delegateRemove(c.schemaChanged, runOn(this, this.bl));
        }
        if (d != null) {
            d.schemaChanged = delegateCombine(d.schemaChanged, runOn(this, this.bl));
            d.executionContext = this.executionContext;
            this.notifyUsingSourceIndexes = this.actualBaseDataProvider.notifyUsingSourceIndexes;
        }
        else {
            this.notifyUsingSourceIndexes = false;
        }
        if (c != null) {
            this.sortDescriptions.syncTarget = null;
            this.groupDescriptions.syncTarget = null;
            this.filterExpressions.syncTarget = null;
            this.summaryDescriptions.syncTarget = null;
        }
        if (d != null) {
            this.sortDescriptions.syncTarget = d.sortDescriptions;
            this.groupDescriptions.syncTarget = d.groupDescriptions;
            this.filterExpressions.syncTarget = d.filterExpressions;
            this.summaryDescriptions.syncTarget = d.summaryDescriptions;
            if (this.propertiesRequested != null) {
                d.propertiesRequested = this.propertiesRequested;
            }
            d.summaryScope = this.summaryScope;
        }
        this.queueAutoRefresh();
    };
    BaseDataSource.prototype.onRequestedVisibleRangeChanged = function () {
    };
    Object.defineProperty(BaseDataSource.prototype, "executionContext", {
        get: function () {
            return this.m;
        },
        set: function (a) {
            var b = this.m;
            this.m = a;
            if (this.m != b) {
                this.onPropertyUpdated("ExecutionContext", b, this.m);
            }
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.canInitialize = function () {
        if (this.m != null && this.actualBaseDataProvider != null) {
            return true;
        }
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isInitializing", {
        get: function () {
            return this.z;
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isSortingSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isSortingSupported", {
        get: function () {
            return this.get_isSortingSupported();
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isFilteringSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isFilteringSupported", {
        get: function () {
            return this.get_isFilteringSupported();
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "sortDescriptions", {
        get: function () {
            return this.r;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "groupDescriptions", {
        get: function () {
            return this.q;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "filterExpressions", {
        get: function () {
            return this.h;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "summaryDescriptions", {
        get: function () {
            return this.s;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "summaryScope", {
        get: function () {
            return this.g;
        },
        set: function (a) {
            var b = this.g;
            this.g = a;
            if (this.g != b) {
                this.onPropertyUpdated("SummaryScope", enumGetBox(DataSourceSummaryScope_$type, b), enumGetBox(DataSourceSummaryScope_$type, this.g));
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "deferAutoRefresh", {
        get: function () {
            return this.w;
        },
        set: function (a) {
            var b = this.w;
            this.w = a;
            if (this.w != b) {
                this.onPropertyUpdated("DeferAutoRefresh", b, this.w);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "primaryKey", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            var b = this.b;
            this.b = a;
            if (this.b != b) {
                this.onPropertyUpdated("PrimaryKey", b, this.b);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "actualPrimaryKey", {
        get: function () {
            return this.a;
        },
        set: function (a) {
            var b = this.a;
            this.a = a;
            if (this.a != b) {
                this.onPropertyUpdated("ActualPrimaryKey", b, this.a);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "propertiesRequested", {
        get: function () {
            return this.c;
        },
        set: function (a) {
            var b = this.c;
            this.c = a;
            if (this.c != b) {
                this.onPropertyUpdated("PropertiesRequested", b, this.c);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "notifyUsingSourceIndexes", {
        get: function () {
            return this.af;
        },
        set: function (a) {
            var b = this.af;
            this.af = a;
            if (this.af != b) {
                this.onPropertyUpdated("NotifyUsingSourceIndexes", b, this.af);
            }
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isItemIndexLookupSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isItemIndexLookupSupported", {
        get: function () {
            return this.get_isItemIndexLookupSupported();
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isKeyIndexLookupSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isKeyIndexLookupSupported", {
        get: function () {
            return this.get_isKeyIndexLookupSupported();
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.initializeOverride = function () {
    };
    BaseDataSource.prototype.resolveFullCount = function (a) {
        return a;
    };
    BaseDataSource.prototype.bl = function (a, b) {
        var _this = this;
        var c = this.executionContext;
        c.execute(function () {
            _this.ag = true;
            _this.v = true;
            _this.queueAutoRefresh();
            if (_this.deferAutoRefresh) {
                _this.actualSchema = b.schema;
                _this.actualCount = _this.resolveFullCount(b.count);
                _this.bv();
            }
        });
    };
    BaseDataSource.prototype.bv = function () {
        if (this.schemaChanged != null) {
            this.schemaChanged(this, new DataSourceSchemaChangedEventArgs(this.actualSchema, this.actualCount));
        }
    };
    BaseDataSource.prototype.onSetItem = function (a, b, c) {
        this.onSetItemOverride(a, b, c);
    };
    BaseDataSource.prototype.onBroadcastSetItem = function (a, b, c) {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifySetItem(a, b, c);
        }
    };
    BaseDataSource.prototype.onSetItemOverride = function (a, b, c) {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastSetItem(a, b, c);
    };
    BaseDataSource.prototype.onClearItems = function () {
        this.onClearItemsOverride();
    };
    BaseDataSource.prototype.onBroadcastClearItems = function () {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifyClearItems();
        }
    };
    BaseDataSource.prototype.onClearItemsOverride = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastClearItems();
    };
    BaseDataSource.prototype.onInsertItem = function (a, b) {
        this.onInsertItemOverride(a, b);
    };
    BaseDataSource.prototype.onBroadcastInsertItem = function (a, b) {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifyInsertItem(a, b);
        }
    };
    BaseDataSource.prototype.onInsertItemOverride = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastInsertItem(a, b);
    };
    BaseDataSource.prototype.onRemoveItem = function (a, b) {
        this.onRemoveItemOverride(a, b);
    };
    BaseDataSource.prototype.onBroadcastRemoveItem = function (a, b) {
        if (this.updateNotifier != null) {
            this.updateNotifier.notifyRemoveItem(a, b);
        }
    };
    BaseDataSource.prototype.onRemoveItemOverride = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        this.onBroadcastRemoveItem(a, b);
    };
    BaseDataSource.prototype.notifySetItem = function (a, b, c) {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifySetItem(a, b, c);
        }
    };
    BaseDataSource.prototype.notifyClearItems = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifyClearItems();
        }
    };
    BaseDataSource.prototype.notifyInsertItem = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifyInsertItem(a, b);
        }
        ;
    };
    BaseDataSource.prototype.notifyRemoveItem = function (a, b) {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.notifyRemoveItem(a, b);
        }
        ;
    };
    BaseDataSource.prototype.queueAutoRefresh = function () {
        if (this.deferAutoRefresh) {
            return;
        }
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.queueAutoRefresh();
        }
        if (this.u) {
            return;
        }
        if (this.executionContext != null) {
            this.u = true;
            this.executionContext.enqueueAction(runOn(this, this.bn));
        }
    };
    BaseDataSource.prototype.bn = function () {
        if (this.deferAutoRefresh) {
            this.u = false;
            return;
        }
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.flushAutoRefresh();
        }
        if (!this.u) {
            return;
        }
        this.u = false;
        this.cl();
    };
    BaseDataSource.prototype.cl = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualSchema = this.actualBaseDataProvider.actualSchema;
            this.actualCount = this.resolveFullCount(this.actualBaseDataProvider.actualCount);
        }
        if (this.actualSchema != null && this.primaryKey == null) {
            this.actualPrimaryKey = this.actualSchema.primaryKey;
        }
        this.refreshInternalOverride();
        if (this.ag) {
            this.ag = false;
            this.bv();
        }
    };
    BaseDataSource.prototype.refreshInternalOverride = function () {
    };
    BaseDataSource.prototype.flushAutoRefresh = function () {
        this.bn();
    };
    BaseDataSource.prototype.refresh = function () {
        if (this.actualBaseDataProvider != null) {
            this.actualBaseDataProvider.refresh();
        }
        this.cl();
    };
    BaseDataSource.prototype.indexOfItem = function (a) {
        return -1;
    };
    BaseDataSource.prototype.indexOfKey = function (a) {
        return -1;
    };
    BaseDataSource.prototype.getPrimaryKeyValue = function (a, b) {
        var c = this.actualPrimaryKey;
        if (c == null || c.length < 1 || this.actualBaseDataProvider == null) {
            return;
        }
        for (var d = 0; d < c.length; d++) {
            b[d] = this.actualBaseDataProvider.getItemValue(a, c[d]);
        }
    };
    BaseDataSource.prototype.getRowType = function (a) {
        return 0;
    };
    BaseDataSource.prototype.getMainValuePath = function (a) {
        return "SectionInformation";
    };
    BaseDataSource.prototype.getStickyRows = function () {
        return this.getStickyRowsInRange(this.firstVisibleIndexRequested, this.lastVisibleIndexRequested);
    };
    BaseDataSource.prototype.getStickyRowsInRange = function (a, b) {
        return null;
    };
    BaseDataSource.prototype.isRowSpanning = function (a) {
        return a == 1 || a == 2;
    };
    BaseDataSource.prototype.getStickyRowPriority = function (a) {
        return -1;
    };
    BaseDataSource.prototype.isExclusivelySticky = function (a) {
        return false;
    };
    BaseDataSource.prototype.pinRow = function (a) {
    };
    BaseDataSource.prototype.unpinRow = function (a) {
    };
    BaseDataSource.prototype.clearPinnedRows = function () {
    };
    BaseDataSource.prototype.isRowPinned = function (a) {
        return false;
    };
    BaseDataSource.prototype.get_isGroupingSupported = function () {
        return false;
    };
    Object.defineProperty(BaseDataSource.prototype, "isGroupingSupported", {
        get: function () {
            return this.get_isGroupingSupported();
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_sectionHeaderDisplayMode = function () {
        return this.f;
    };
    BaseDataSource.prototype.set_sectionHeaderDisplayMode = function (a) {
        var b = this.f;
        this.f = a;
        if (b != this.f) {
            this.onPropertyUpdated("SectionHeaderDisplayMode", enumGetBox(DataSourceSectionHeaderDisplayMode_$type, b), enumGetBox(DataSourceSectionHeaderDisplayMode_$type, this.f));
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "sectionHeaderDisplayMode", {
        get: function () {
            return this.get_sectionHeaderDisplayMode();
        },
        set: function (a) {
            this.set_sectionHeaderDisplayMode(a);
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionCollapsable = function () {
        return this.aa;
    };
    BaseDataSource.prototype.set_isSectionCollapsable = function (a) {
        var b = this.aa;
        this.aa = a;
        if (this.aa != b) {
            this.onPropertyUpdated("IsSectionCollapsable", b, this.aa);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionCollapsable", {
        get: function () {
            return this.get_isSectionCollapsable();
        },
        set: function (a) {
            this.set_isSectionCollapsable(a);
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionExpandedDefault = function () {
        return this.ac;
    };
    BaseDataSource.prototype.set_isSectionExpandedDefault = function (a) {
        this.ac = a;
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionExpandedDefault", {
        get: function () {
            return this.get_isSectionExpandedDefault();
        },
        set: function (a) {
            this.set_isSectionExpandedDefault(a);
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_includeSummaryRowsInSection = function () {
        return this.x;
    };
    BaseDataSource.prototype.set_includeSummaryRowsInSection = function (a) {
        var b = this.x;
        this.x = a;
        if (this.x != b) {
            this.onPropertyUpdated("IncludeSummaryRowsInSection", b, this.x);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "includeSummaryRowsInSection", {
        get: function () {
            return this.get_includeSummaryRowsInSection();
        },
        set: function (a) {
            this.set_includeSummaryRowsInSection(a);
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionSummaryRowsAtBottom = function () {
        return this.ae;
    };
    BaseDataSource.prototype.set_isSectionSummaryRowsAtBottom = function (a) {
        var b = this.ae;
        this.ae = a;
        if (this.ae != b) {
            this.onPropertyUpdated("IsSectionSummaryRowsAtBottom", b, this.ae);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionSummaryRowsAtBottom", {
        get: function () {
            return this.get_isSectionSummaryRowsAtBottom();
        },
        set: function (a) {
            this.set_isSectionSummaryRowsAtBottom(a);
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionHeaderNormalRow = function () {
        return this.ad;
    };
    BaseDataSource.prototype.set_isSectionHeaderNormalRow = function (a) {
        var b = this.ad;
        this.ad = a;
        if (this.ad != b) {
            this.onPropertyUpdated("IsSectionHeaderNormalRow", b, this.ad);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionHeaderNormalRow", {
        get: function () {
            return this.get_isSectionHeaderNormalRow();
        },
        set: function (a) {
            this.set_isSectionHeaderNormalRow(a);
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.get_isSectionContentVisible = function () {
        return this.ab;
    };
    BaseDataSource.prototype.set_isSectionContentVisible = function (a) {
        var b = this.ab;
        this.ab = a;
        if (this.ab != b) {
            this.onPropertyUpdated("IsSectionContentVisible", b, this.ab);
        }
    };
    Object.defineProperty(BaseDataSource.prototype, "isSectionContentVisible", {
        get: function () {
            return this.get_isSectionContentVisible();
        },
        set: function (a) {
            this.set_isSectionContentVisible(a);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitSectionHeaders", {
        get: function () {
            return this.ai;
        },
        set: function (a) {
            var b = this.ai;
            this.ai = a;
            if (this.ai != b) {
                this.onPropertyUpdated("ShouldEmitSectionHeaders", b, this.ai);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitSectionFooters", {
        get: function () {
            return this.ah;
        },
        set: function (a) {
            var b = this.ah;
            this.ah = a;
            if (this.ah != b) {
                this.onPropertyUpdated("ShouldEmitSectionFooters", b, this.ah);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(BaseDataSource.prototype, "shouldEmitShiftedRows", {
        get: function () {
            return this.aj;
        },
        set: function (a) {
            var b = this.aj;
            this.aj = a;
            if (this.aj != b) {
                this.onPropertyUpdated("ShouldEmitShiftedRows", b, this.aj);
            }
        },
        enumerable: true,
        configurable: true
    });
    BaseDataSource.prototype.ensureComparables = function (a) {
        if (this.v && this.actualCount > 0 && this.actualBaseDataProvider != null) {
            this.d = new Array(a.propertyNames.length);
            this.v = false;
        }
    };
    BaseDataSource.prototype.resolveSchemaPropertyType = function (a) {
        return this.actualBaseDataProvider.resolveSchemaPropertyType(a);
    };
    BaseDataSource.prototype.setIsRowExpandedAtIndex = function (a, b) {
    };
    BaseDataSource.prototype.getIsRowExpandedAtIndex = function (a) {
        return true;
    };
    BaseDataSource.prototype.getRowLevel = function (a) {
        return 0;
    };
    BaseDataSource.prototype.getRootSummaryRowCount = function () {
        return 0;
    };
    BaseDataSource.prototype.getRootSummaryResults = function () {
        return null;
    };
    BaseDataSource.prototype.getSectionSummaryResults = function (a) {
        return null;
    };
    BaseDataSource.prototype.clone = function () {
        return null;
    };
    BaseDataSource.prototype.cloneProperties = function (a) {
        var b = typeCast(BaseDataSource.$, a);
        if (b != null) {
            b.executionContext = this.executionContext;
            b.includeSummaryRowsInSection = this.includeSummaryRowsInSection;
            b.isSectionCollapsable = this.isSectionCollapsable;
            b.isSectionExpandedDefault = this.isSectionExpandedDefault;
            b.isSectionHeaderNormalRow = this.isSectionHeaderNormalRow;
            b.isSectionSummaryRowsAtBottom = this.isSectionSummaryRowsAtBottom;
            b.isSectionContentVisible = this.isSectionContentVisible;
            b.primaryKey = this.primaryKey;
            b.propertiesRequested = this.propertiesRequested;
            b.sectionHeaderDisplayMode = this.sectionHeaderDisplayMode;
            b.shouldEmitSectionFooters = this.shouldEmitSectionFooters;
            b.shouldEmitSectionHeaders = this.shouldEmitSectionHeaders;
            b.shouldEmitShiftedRows = this.shouldEmitShiftedRows;
            b.summaryScope = this.summaryScope;
            for (var c = 0; c < this.groupDescriptions.k.count; c++) {
                b.groupDescriptions.add(this.groupDescriptions.k.item(c));
            }
            for (var d = 0; d < this.sortDescriptions.k.count; d++) {
                b.sortDescriptions.add(this.sortDescriptions.k.item(d));
            }
            for (var e = 0; e < this.filterExpressions.j.count; e++) {
                b.filterExpressions.add(this.filterExpressions.j.item(e));
            }
            for (var f = 0; f < this.summaryDescriptions.k.count; f++) {
                b.summaryDescriptions.add(this.summaryDescriptions.k.item(f));
            }
        }
    };
    BaseDataSource.$t = markType(BaseDataSource, 'BaseDataSource', Base.$, [IDataSource_$type, IEditableDataSource_$type]);
    return BaseDataSource;
}(Base));
export { BaseDataSource };
/**
 * @hidden
 */
var DefaultDataSourceDataProviderUpdateNotifier = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(DefaultDataSourceDataProviderUpdateNotifier, _super);
    function DefaultDataSourceDataProviderUpdateNotifier(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.a = a;
        return _this;
    }
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifySetItem = function (a, b, c) {
        this.a.onSetItem(a, b, c);
    };
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifyClearItems = function () {
        this.a.onClearItems();
    };
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifyInsertItem = function (a, b) {
        this.a.onInsertItem(a, b);
    };
    DefaultDataSourceDataProviderUpdateNotifier.prototype.notifyRemoveItem = function (a, b) {
        this.a.onRemoveItem(a, b);
    };
    DefaultDataSourceDataProviderUpdateNotifier.$t = markType(DefaultDataSourceDataProviderUpdateNotifier, 'DefaultDataSourceDataProviderUpdateNotifier', Base.$, [IDataSourceDataProviderUpdateNotifier_$type]);
    return DefaultDataSourceDataProviderUpdateNotifier;
}(Base));
export { DefaultDataSourceDataProviderUpdateNotifier };
//# sourceMappingURL=BaseDataSource_combined.js.map
