/*
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 { __extends } from "tslib";
import { NumericAxisBase } from "./NumericAxisBase";
import { NumericScaleMode_$type } from "./NumericScaleMode";
import { DependencyProperty } from "igniteui-angular-core";
import { NumericScaler } from "./NumericScaler";
import { enumGetBox, typeCast, markType, markDep } from "igniteui-angular-core";
import { ArgumentNullException } from "igniteui-angular-core";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-angular-core";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
var StraightNumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBase, _super);
    function StraightNumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.nh = null;
        _this.nl = false;
        _this.nv();
        return _this;
    }
    StraightNumericAxisBase.prototype.a3 = function () {
        return new StraightNumericAxisBaseView(this);
    };
    StraightNumericAxisBase.prototype.hr = function (a) {
        _super.prototype.hr.call(this, a);
        this.nk = a;
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "nj", {
        get: function () {
            return this.c(StraightNumericAxisBase.nx);
        },
        set: function (a) {
            this.h(StraightNumericAxisBase.nx, a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.nt = function (a, b) {
        var c = typeCast(StraightNumericAxisBase.$, a);
        c.nv();
        c.h1("Scaler", b.oldValue, b.newValue);
    };
    StraightNumericAxisBase.prototype.ni = function () {
        return null;
    };
    StraightNumericAxisBase.prototype.get_ng = function () {
        if (this.nh == null) {
            this.nv();
        }
        return this.nh;
    };
    StraightNumericAxisBase.prototype.set_ng = function (a) {
        var b = this.nh != a;
        if (b) {
            var c = this.nh;
            this.nh = a;
            this.h1("ActualScaler", c, a);
        }
    };
    Object.defineProperty(StraightNumericAxisBase.prototype, "ng", {
        get: function () {
            return this.get_ng();
        },
        set: function (a) {
            this.set_ng(a);
        },
        enumerable: false,
        configurable: true
    });
    StraightNumericAxisBase.prototype.mw = function (a, b, c, d, e, f, g) {
        var h = this.ng.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    };
    StraightNumericAxisBase.prototype.nu = function (a) {
        var b = this.nl;
        this.nl = true;
        a();
        this.nl = b;
    };
    StraightNumericAxisBase.prototype.nv = function () {
        var a = this.nj;
        if (a == null) {
            a = this.k1();
        }
        this.ng = a;
        if (this.ng == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.nq();
    };
    StraightNumericAxisBase.prototype.nq = function () {
        this.nk.bk();
    };
    StraightNumericAxisBase.prototype.hv = function (a, b, c, d) {
        if (this.nl) {
            return;
        }
        _super.prototype.hv.call(this, a, b, c, d);
        switch (b) {
            case NumericAxisBase.$$p[6]:
                this.nv();
                break;
            case NumericAxisBase.$$p[5]:
                this.nv();
                break;
            case StraightNumericAxisBase.$$p[0]:
                this.nv();
                break;
            case "Scaler":
                this.nv();
                break;
            case "ActualScaler":
                this.k9 = typeCast(LogarithmicScaler.$, this.ng) !== null;
                this.nq();
                this.c0();
                this.h7(false);
                break;
            case "ActualMaximumValue":
                this.nr();
                break;
            case "ActualMinimumValue":
                this.ns();
                this.nv();
                break;
        }
    };
    StraightNumericAxisBase.prototype.ns = function () {
        this.ng.y(this.lv);
    };
    StraightNumericAxisBase.prototype.nr = function () {
        this.ng.x(this.lu);
    };
    StraightNumericAxisBase.prototype.nm = function (a, b) {
        if (a < this.lv) {
            a = this.lv;
        }
        else if (a > this.lu) {
            a = this.lu;
        }
        if (!b.co) {
            return (a - this.lv) / (this.lu - this.lv);
        }
        else {
            return (a - this.lu) / (this.lv - this.lu);
        }
    };
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.nx = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.nt));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h1', ['ScaleMode:nf:nw', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
}(NumericAxisBase));
export { StraightNumericAxisBase };
/**
 * @hidden
 */
var StraightNumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(StraightNumericAxisBaseView, _super);
    function StraightNumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bj = null;
        _this.bj = a;
        return _this;
    }
    StraightNumericAxisBaseView.prototype.bk = function () {
        this.bj.ng.x(this.bj.lu);
        this.bj.ng.y(this.bj.lv);
    };
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
}(NumericAxisBaseView));
export { StraightNumericAxisBaseView };
