define(["require", "exports"], function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PictureController = /** @class */ (function () {
        function PictureController($element) {
            this.$element = $element;
        }
        Object.defineProperty(PictureController.prototype, "images", {
            get: function () {
                if (this.imagesStatic) {
                    return this.imagesStatic;
                }
                else {
                    var imagesAttribute = this.$element[0].parentNode.getAttribute('images');
                    if (imagesAttribute) {
                        return JSON.parse(imagesAttribute);
                    }
                    else {
                        return {};
                    }
                }
            },
            set: function (images) {
                if (images) {
                    if (images.constructor.name === 'String') {
                        try {
                            this.imagesStatic = JSON.parse(images);
                        }
                        catch (error) {
                            console.error(error);
                        }
                    }
                    else {
                        this.imagesStatic = images;
                    }
                }
                else {
                    var parentAttribute = this.$element[0].parentNode.getAttribute('images');
                    if (parentAttribute) {
                        this.imagesStatic = JSON.parse(parentAttribute);
                    }
                    else {
                        this.imagesStatic = {};
                    }
                }
            },
            enumerable: true,
            configurable: true
        });
        return PictureController;
    }());
    exports.PictureController = PictureController;
});
//# sourceMappingURL=picture.controller.js.map