import { extend, globalDefine, isBlank, noop } from '@jscrpt/common';
globalDefine(global => {
    if (isBlank(global.ngDesignerMetadata)) {
        global.ngDesignerMetadata = true;
    }
});
/**
 * Sets dynamic metadata to for property
 * @param value - Object with metadata to be stored
 * @param property - Property definition symbol
 */
export function DynamicPropertyMetadata(value, property) {
    if (ngDesignerMetadata) {
        return function (target, propertyKey) {
            var _a;
            const metadata = Reflect.get(target, property) ?? {};
            const propertyMetadata = metadata[_a = propertyKey] ?? (metadata[_a] = {});
            extend(true, propertyMetadata, value);
            if (!Reflect.has(target, property)) {
                Reflect.defineProperty(target, property, {
                    value: metadata
                });
            }
        };
    }
    return noop;
}
//# sourceMappingURL=dynamicPropertyMetadata.decorator.js.map