import * as tslib_1 from "tslib";
import { IgCollection } from "igniteui-angular-core/ES5/IgCollection";
import { markType } from "igniteui-angular-core/ES5/type";
import { SyncableObservableCollection$2 } from "igniteui-angular-core/ES5/SyncableObservableCollection$2";
import { TreemapNodeStyleMapping as TreemapNodeStyleMapping_internal } from './TreemapNodeStyleMapping';
import { IgxTreemapNodeStyleMappingComponent as IgxTreemapNodeStyleMappingComponent } from './igx-treemap-node-style-mapping-component';
var TreemapNodeStyleMappingCollection = /** @class */ (function (_super) {
    tslib_1.__extends(TreemapNodeStyleMappingCollection, _super);
    function TreemapNodeStyleMappingCollection(list) {
        var _this = _super.call(this) || this;
        if (!IgxTreemapNodeStyleMappingComponent.$type) {
            IgxTreemapNodeStyleMappingComponent.$type = markType(IgxTreemapNodeStyleMappingComponent, "IgxTreemapNodeStyleMappingComponent");
        }
        if (list) {
            for (var i = 0; i < list.length; i++) {
                _this.add(list[i]);
            }
        }
        return _this;
    }
    TreemapNodeStyleMappingCollection.prototype._createInnerColl = function () {
        if (!IgxTreemapNodeStyleMappingComponent.$type) {
            IgxTreemapNodeStyleMappingComponent.$type = markType(IgxTreemapNodeStyleMappingComponent, "IgxTreemapNodeStyleMappingComponent");
        }
        var coll = new SyncableObservableCollection$2(IgxTreemapNodeStyleMappingComponent.$type, TreemapNodeStyleMapping_internal.$type, 0);
        coll.compare = function (ext, int) {
            var comp = ext;
            if (comp._implementation) {
                comp = comp._implementation;
            }
            if (comp.equals) {
                return comp.equals(int);
            }
            return comp === int;
        };
        coll.createTo = function (ext) {
            return ext._implementation;
        };
        coll.createFrom = function (int) {
            var ext = int.externalObject;
            if (!ext) {
                ext = new IgxTreemapNodeStyleMappingComponent();
                if (ext) {
                    ext._implementation = int;
                }
            }
            return ext;
        };
        return coll;
    };
    return TreemapNodeStyleMappingCollection;
}(IgCollection));
export { TreemapNodeStyleMappingCollection };
//# sourceMappingURL=igx-treemap-node-style-mapping-collection.js.map