/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import * as tslib_1 from "tslib";
import { NumericAxisBase } from "./NumericAxisBase";
import { NumericScaleMode_$type } from "./NumericScaleMode";
import { DependencyProperty } from "igniteui-react-core/ES5/DependencyProperty";
import { NumericScaler } from "./NumericScaler";
import { Type, enumGetBox, typeCast, markType } from "igniteui-react-core/ES5/type";
import { ArgumentNullException } from "igniteui-react-core/ES5/ArgumentNullException";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-react-core/ES5/PropertyMetadata";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var StraightNumericAxisBase = /** @class */ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.k7 = null;
        _this.lb = false;
        _this.ll();
        return _this;
    }
    StraightNumericAxisBase.prototype.a1 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.gm = function (a) {
        _super.prototype.gm.call(this, a);
        this.la = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "k9", {
        get: function () {
            return this.c(StraightNumericAxisBase.ln);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.ln, a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.lj = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.ll();
        c.gu("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.k8 = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_k6 = function () {
        if (this.k7 == null) {
            this.ll();
        }
        return this.k7;
    };
    StraightNumericAxisBase.prototype.set_k6 = function (a) {
        var b = this.k7 != a;
        if (b) {
            var c = this.k7;
            this.k7 = a;
            this.gu("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "k6", {
        get: function () {
            return this.get_k6();
        },
        set: function (a) {
            this.set_k6(a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.prototype.ks = function (a, b, c, d, e, f, g) {
        var h = this.k6.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.lk = function (a) {
        var b = this.lb;
        this.lb = true;
        a();
        this.lb = b;
    };
    StraightNumericAxisBase.prototype.ll = function () {
        var a = this.k9;
        if (a == null) {
            a = this.jb();
        }
        this.k6 = a;
        if (this.k6 == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.lg();
    };
    StraightNumericAxisBase.prototype.lg = function () {
        this.la.bg();
    };
    StraightNumericAxisBase.prototype.go = function (a, b, c, d) {
        if (this.lb) {
            return;
        }
        _super.prototype.go.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[2]:
                this.ll();
                break;
            case NumericAxisBase.$$p[1]:
                this.ll();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.ll();
                break;
            case "Scaler":
                this.ll();
                break;
            case "ActualScaler":
                this.ji = typeCast(LogarithmicScaler.$, this.k6) !== null;
                this.lg();
                this.ck();
                this.g0(false);
                break;
            case "ActualMaximumValue":
                this.lh();
                break;
            case "ActualMinimumValue":
                this.li();
                this.ll();
                break;
        }
    };
    StraightNumericAxisBase.prototype.li = function () {
        this.k6.y(this.jx);
    };
    StraightNumericAxisBase.prototype.lh = function () {
        this.k6.x(this.jw);
    };
    StraightNumericAxisBase.prototype.lc = function (a, b) {
        if (a < this.jx) {
            a = this.jx;
        }
        else if (a > this.jw) {
            a = this.jw;
        }
        if (!b.ce) {
            return (a - this.jx) / (this.jw - this.jx);
        }
        else {
            return (a - this.jw) / (this.jx - this.jw);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.ln = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.lj));
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
Type.dep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'gu', ['ScaleMode:k5:lm', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ (function (_super) {
    tslib_1.__extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bf = null;
        _this.bf = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bg = function () {
        this.bf.k6.x(this.bf.jw);
        this.bf.k6.y(this.bf.jx);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
