import { IgrObjectCollection } from "igniteui-react-core";
import { ObjectCollection as ObjectCollection_internal } from "igniteui-react-core";
import { Base } from "igniteui-react-core";
import { SyncableObservableCollection$1 } from "igniteui-react-core";
/**
 * Provides data for the SelectedItemsChanged event.
*/
var IgrSelectedItemsChangedEventArgs = /** @class */ /*@__PURE__*/ (function () {
    function IgrSelectedItemsChangedEventArgs() {
        this._oldItems = null;
        this._newItems = null;
        this._currentItems = null;
    }
    Object.defineProperty(IgrSelectedItemsChangedEventArgs.prototype, "i", {
        /**
         * @hidden
         */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    IgrSelectedItemsChangedEventArgs.prototype.onImplementationCreated = function () {
    };
    IgrSelectedItemsChangedEventArgs.prototype._provideImplementation = function (i) {
        this._implementation = i;
        this._implementation.externalObject = this;
        this.onImplementationCreated();
        if (this._initializeAdapters) {
            this._initializeAdapters();
        }
    };
    Object.defineProperty(IgrSelectedItemsChangedEventArgs.prototype, "oldItems", {
        /**
         * A list of the previously selected items.
        */
        get: function () {
            if (this._oldItems === null) {
                var coll = new IgrObjectCollection();
                var innerColl = this.i.oldItems;
                if (!innerColl) {
                    innerColl = new ObjectCollection_internal(0);
                }
                this._oldItems = coll._fromInner(innerColl);
                this.i.oldItems = innerColl;
            }
            return this._oldItems;
        },
        set: function (v) {
            if (this._oldItems !== null) {
                this._oldItems._setSyncTarget(null);
                this._oldItems = null;
            }
            var coll = new IgrObjectCollection();
            this._oldItems = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(Base.$type);
            var innerColl = this.i.oldItems;
            if (!innerColl) {
                innerColl = new ObjectCollection_internal(0);
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._oldItems._setSyncTarget(syncColl);
            this.i.oldItems = innerColl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSelectedItemsChangedEventArgs.prototype, "newItems", {
        /**
         * A list of the items being selected.
        */
        get: function () {
            if (this._newItems === null) {
                var coll = new IgrObjectCollection();
                var innerColl = this.i.newItems;
                if (!innerColl) {
                    innerColl = new ObjectCollection_internal(0);
                }
                this._newItems = coll._fromInner(innerColl);
                this.i.newItems = innerColl;
            }
            return this._newItems;
        },
        set: function (v) {
            if (this._newItems !== null) {
                this._newItems._setSyncTarget(null);
                this._newItems = null;
            }
            var coll = new IgrObjectCollection();
            this._newItems = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(Base.$type);
            var innerColl = this.i.newItems;
            if (!innerColl) {
                innerColl = new ObjectCollection_internal(0);
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._newItems._setSyncTarget(syncColl);
            this.i.newItems = innerColl;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrSelectedItemsChangedEventArgs.prototype, "currentItems", {
        /**
         * A list of the current items selected.
        */
        get: function () {
            if (this._currentItems === null) {
                var coll = new IgrObjectCollection();
                var innerColl = this.i.currentItems;
                if (!innerColl) {
                    innerColl = new ObjectCollection_internal(0);
                }
                this._currentItems = coll._fromInner(innerColl);
                this.i.currentItems = innerColl;
            }
            return this._currentItems;
        },
        set: function (v) {
            if (this._currentItems !== null) {
                this._currentItems._setSyncTarget(null);
                this._currentItems = null;
            }
            var coll = new IgrObjectCollection();
            this._currentItems = coll._fromOuter(v);
            var syncColl = new SyncableObservableCollection$1(Base.$type);
            var innerColl = this.i.currentItems;
            if (!innerColl) {
                innerColl = new ObjectCollection_internal(0);
            }
            syncColl._inner = innerColl;
            syncColl.clear();
            this._currentItems._setSyncTarget(syncColl);
            this.i.currentItems = innerColl;
        },
        enumerable: false,
        configurable: true
    });
    return IgrSelectedItemsChangedEventArgs;
}());
export { IgrSelectedItemsChangedEventArgs };
