import { __decorate, __metadata } from "tslib";
import { Input } from '@angular/core';
import { DynamicOutput, PureRelationsComponent } from '@anglr/dynamic/relations';
import { RelationsEditorMetadata } from '@anglr/dynamic/relations-editor';
import { isPresent, nameof } from '@jscrpt/common';
import { MathPowerRelationsMetadataLoader } from './power.metadata';
let MathPowerRelations = class MathPowerRelations {
    //######################### public methods #########################
    invalidateVisuals() {
    }
    ngOnChanges(changes) {
        var _a, _b;
        if (nameof('input') in changes ||
            nameof('exponent') in changes) {
            if (!isPresent(this.input) ||
                !((_a = this.relationsOptions) === null || _a === void 0 ? void 0 : _a.exponent)) {
                this.result = null;
                return;
            }
            this.result = Math.pow(this.input, (_b = this.relationsOptions) === null || _b === void 0 ? void 0 : _b.exponent);
        }
    }
};
__decorate([
    Input(),
    __metadata("design:type", Object)
], MathPowerRelations.prototype, "input", void 0);
__decorate([
    DynamicOutput(),
    __metadata("design:type", Object)
], MathPowerRelations.prototype, "result", void 0);
MathPowerRelations = __decorate([
    PureRelationsComponent(),
    RelationsEditorMetadata(MathPowerRelationsMetadataLoader)
], MathPowerRelations);
export { MathPowerRelations };
//# sourceMappingURL=power.relations.js.map