/*
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-angular-core/ES5/DependencyProperty";
import { NumericScaler } from "./NumericScaler";
import { Type, enumGetBox, typeCast, markType } from "igniteui-angular-core/ES5/type";
import { ArgumentNullException } from "igniteui-angular-core/ES5/ArgumentNullException";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-angular-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.ld = null;
        _this.lh = false;
        _this.lr();
        return _this;
    }
    StraightNumericAxisBase.prototype.a1 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.gr = function (a) {
        _super.prototype.gr.call(this, a);
        this.lg = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "lf", {
        get: function () {
            return this.c(StraightNumericAxisBase.lt);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.lt, a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.lp = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.lr();
        c.gz("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.le = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_lc = function () {
        if (this.ld == null) {
            this.lr();
        }
        return this.ld;
    };
    StraightNumericAxisBase.prototype.set_lc = function (a) {
        var b = this.ld != a;
        if (b) {
            var c = this.ld;
            this.ld = a;
            this.gz("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "lc", {
        get: function () {
            return this.get_lc();
        },
        set: function (a) {
            this.set_lc(a);
        },
        enumerable: true,
        configurable: true
    });
    StraightNumericAxisBase.prototype.ky = function (a, b, c, d, e, f, g) {
        var h = this.lc.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.lq = function (a) {
        var b = this.lh;
        this.lh = true;
        a();
        this.lh = b;
    };
    StraightNumericAxisBase.prototype.lr = function () {
        var a = this.lf;
        if (a == null) {
            a = this.jh();
        }
        this.lc = a;
        if (this.lc == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.lm();
    };
    StraightNumericAxisBase.prototype.lm = function () {
        this.lg.bh();
    };
    StraightNumericAxisBase.prototype.gt = function (a, b, c, d) {
        if (this.lh) {
            return;
        }
        _super.prototype.gt.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[2]:
                this.lr();
                break;
            case NumericAxisBase.$$p[1]:
                this.lr();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.lr();
                break;
            case "Scaler":
                this.lr();
                break;
            case "ActualScaler":
                this.jo = typeCast(LogarithmicScaler.$, this.lc) !== null;
                this.lm();
                this.ck();
                this.g5(false);
                break;
            case "ActualMaximumValue":
                this.ln();
                break;
            case "ActualMinimumValue":
                this.lo();
                this.lr();
                break;
        }
    };
    StraightNumericAxisBase.prototype.lo = function () {
        this.lc.y(this.j3);
    };
    StraightNumericAxisBase.prototype.ln = function () {
        this.lc.x(this.j2);
    };
    StraightNumericAxisBase.prototype.li = function (a, b) {
        if (a < this.j3) {
            a = this.j3;
        }
        else if (a > this.j2) {
            a = this.j2;
        }
        if (!b.ce) {
            return (a - this.j3) / (this.j2 - this.j3);
        }
        else {
            return (a - this.j2) / (this.j3 - this.j2);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.lt = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.lp));
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
Type.dep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'gz', ['ScaleMode:lb:ls', [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.bg = null;
        _this.bg = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bh = function () {
        this.bg.lc.x(this.bg.j2);
        this.bg.lc.y(this.bg.j3);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
//# sourceMappingURL=StraightNumericAxisBase_combined.js.map