define(["exports", "aurelia-framework", "aurelia-event-aggregator"], function (exports, _aureliaFramework, _aureliaEventAggregator) {
    "use strict";

    exports.__esModule = true;
    exports.Metal = undefined;

    function _initDefineProp(target, property, descriptor, context) {
        if (!descriptor) return;
        Object.defineProperty(target, property, {
            enumerable: descriptor.enumerable,
            configurable: descriptor.configurable,
            writable: descriptor.writable,
            value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
        });
    }

    function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
        var desc = {};
        Object['ke' + 'ys'](descriptor).forEach(function (key) {
            desc[key] = descriptor[key];
        });
        desc.enumerable = !!desc.enumerable;
        desc.configurable = !!desc.configurable;

        if ('value' in desc || desc.initializer) {
            desc.writable = true;
        }

        desc = decorators.slice().reverse().reduce(function (desc, decorator) {
            return decorator(target, property, desc) || desc;
        }, desc);

        if (context && desc.initializer !== void 0) {
            desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
            desc.initializer = undefined;
        }

        if (desc.initializer === void 0) {
            Object['define' + 'Property'](target, property, desc);
            desc = null;
        }

        return desc;
    }

    function _initializerWarningHelper(descriptor, context) {
        throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
    }

    var _dec, _class, _desc, _value, _class2, _descriptor;

    let Metal = exports.Metal = (_dec = (0, _aureliaFramework.inject)(_aureliaEventAggregator.EventAggregator), _dec(_class = (_class2 = class Metal {

        constructor(eventAggregator) {
            _initDefineProp(this, "message", _descriptor, this);

            this.eventAggregator = eventAggregator;
            this.message = "Johan Rabie";
        }

        attached() {
            const walker = document.createTreeWalker(document.querySelector("router-view"), NodeFilter.SHOW_ELEMENT, null, false);
            while (walker.nextNode()) {
                const bindingItems = Array.from(walker.currentNode.attributes).filter(item => item.name.indexOf(".bind") > -1 || item.name.indexOf(".two-way") > -1);

                if (bindingItems.length > 0) {
                    this.processNode(walker.currentNode, bindingItems);
                }
            }
        }

        processNode(element, attributes) {
            console.log(element);
            console.log(attributes);
        }

        detached() {}
    }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "message", [_aureliaFramework.bindable], {
        enumerable: true,
        initializer: null
    })), _class2)) || _class);
});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm1ldGFsLmpzIl0sIm5hbWVzIjpbIk1ldGFsIiwiY29uc3RydWN0b3IiLCJldmVudEFnZ3JlZ2F0b3IiLCJtZXNzYWdlIiwiYXR0YWNoZWQiLCJ3YWxrZXIiLCJkb2N1bWVudCIsImNyZWF0ZVRyZWVXYWxrZXIiLCJxdWVyeVNlbGVjdG9yIiwiTm9kZUZpbHRlciIsIlNIT1dfRUxFTUVOVCIsIm5leHROb2RlIiwiYmluZGluZ0l0ZW1zIiwiQXJyYXkiLCJmcm9tIiwiY3VycmVudE5vZGUiLCJhdHRyaWJ1dGVzIiwiZmlsdGVyIiwiaXRlbSIsIm5hbWUiLCJpbmRleE9mIiwibGVuZ3RoIiwicHJvY2Vzc05vZGUiLCJlbGVtZW50IiwiY29uc29sZSIsImxvZyIsImRldGFjaGVkIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7UUFJYUEsSyxXQUFBQSxLLFdBRFosc0UsMkJBQ00sTUFBTUEsS0FBTixDQUFZOztBQUdmQyxvQkFBWUMsZUFBWixFQUE2QjtBQUFBOztBQUN6QixpQkFBS0EsZUFBTCxHQUF1QkEsZUFBdkI7QUFDQSxpQkFBS0MsT0FBTCxHQUFlLGFBQWY7QUFDSDs7QUFFREMsbUJBQVc7QUFFUCxrQkFBTUMsU0FBU0MsU0FBU0MsZ0JBQVQsQ0FBMEJELFNBQVNFLGFBQVQsQ0FBdUIsYUFBdkIsQ0FBMUIsRUFBaUVDLFdBQVdDLFlBQTVFLEVBQTJGLElBQTNGLEVBQWlHLEtBQWpHLENBQWY7QUFDQSxtQkFBTUws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