"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneUnitClass = exports._cloneUnitBundle = exports.cloneUnitBundle = void 0;
const bundleClass_1 = require("./spec/bundleClass");
const object_1 = require("./util/object");
function cloneUnitBundle(Bundle) {
    const { __bundle } = Bundle;
    const bundle = (0, object_1.clone)(__bundle);
    return _cloneUnitBundle(Bundle, bundle);
}
exports.cloneUnitBundle = cloneUnitBundle;
function _cloneUnitBundle(Bundle, bundle) {
    const NewClass = cloneUnitClass(Bundle);
    const NewBundle = (0, bundleClass_1.bundleClass)(NewClass, bundle);
    return NewBundle;
}
exports._cloneUnitBundle = _cloneUnitBundle;
function cloneUnitClass(Class) {
    class NewClass extends Class {
    }
    Object.defineProperty(NewClass, 'name', { value: Class.constructor.name });
    return NewClass;
}
exports.cloneUnitClass = cloneUnitClass;
//# sourceMappingURL=cloneUnitClass.js.map