/*
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 { NumericAxisBase } from "./NumericAxisBase";
import { NumericScaleMode_$type } from "./NumericScaleMode";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { NumericScaler } from "./NumericScaler";
import { Type, enumGetBox, typeCast, markType } from "igniteui-react-core/ES2015/type";
import { ArgumentNullException } from "igniteui-react-core/ES2015/ArgumentNullException";
import { LogarithmicScaler } from "./LogarithmicScaler";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { NumericAxisBaseView } from "./NumericAxisBaseView";
/**
 * @hidden
 */
export class StraightNumericAxisBase extends NumericAxisBase {
    constructor() {
        super();
        this.k7 = null;
        this.lb = false;
        this.ll();
    }
    a1() {
        return new StraightNumericAxisBaseView(this);
    }
    gm(a) {
        super.gm(a);
        this.la = a;
    }
    get k9() {
        return this.c(StraightNumericAxisBase.ln);
    }
    set k9(a) {
        this.h(StraightNumericAxisBase.ln, a);
    }
    static lj(a, b) {
        let c = typeCast(StraightNumericAxisBase.$, a);
        c.ll();
        c.gu("Scaler", b.oldValue, b.newValue);
    }
    k8() {
        return null;
    }
    get_k6() {
        if (this.k7 == null) {
            this.ll();
        }
        return this.k7;
    }
    set_k6(a) {
        let b = this.k7 != a;
        if (b) {
            let c = this.k7;
            this.k7 = a;
            this.gu("ActualScaler", c, a);
        }
    }
    get k6() {
        return this.get_k6();
    }
    set k6(a) {
        this.set_k6(a);
    }
    ks(a, b, c, d, e, f, g) {
        let h = this.k6.t(a, b, c, f, g);
        f = h.p3;
        g = h.p4;
        return {
            p5: f,
            p6: g
        };
    }
    lk(a) {
        let b = this.lb;
        this.lb = true;
        a();
        this.lb = b;
    }
    ll() {
        let a = this.k9;
        if (a == null) {
            a = this.jb();
        }
        this.k6 = a;
        if (this.k6 == null) {
            throw new ArgumentNullException(0, "ActualScaler");
        }
        this.lg();
    }
    lg() {
        this.la.bg();
    }
    go(a, b, c, d) {
        if (this.lb) {
            return;
        }
        super.go(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;
        }
    }
    li() {
        this.k6.y(this.jx);
    }
    lh() {
        this.k6.x(this.jw);
    }
    lc(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));
Type.dep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'gu', ['ScaleMode:k5:lm', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
/**
 * @hidden
 */
export class StraightNumericAxisBaseView extends NumericAxisBaseView {
    constructor(a) {
        super(a);
        this.bf = null;
        this.bf = a;
    }
    bg() {
        this.bf.k6.x(this.bf.jw);
        this.bf.k6.y(this.bf.jx);
    }
}
StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
