/*
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-angular-core";
import { NumericScaler } from "./NumericScaler";
import { typeCast, enumGetBox, 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
 */
export let StraightNumericAxisBase = /*@__PURE__*/ (() => {
    class StraightNumericAxisBase extends NumericAxisBase {
        constructor() {
            super();
            this.r6 = null;
            this.sa = false;
            this.sk();
        }
        bm() {
            return new StraightNumericAxisBaseView(this);
        }
        kb(a) {
            super.kb(a);
            this.r9 = a;
        }
        jr(a) {
            super.jr(a);
            this.ju(a, "ScaleMode");
        }
        ju(a, b) {
            super.ju(a, b);
            let c = typeCast(StraightNumericAxisBase.$, a);
            if (c == null) {
                return;
            }
            let d = this;
            if (b == "ScaleMode") {
                c.r4 = d.r4;
            }
        }
        get r8() {
            return this.c(StraightNumericAxisBase.sm);
        }
        set r8(a) {
            this.h(StraightNumericAxisBase.sm, a);
        }
        static si(a, b) {
            let c = typeCast(StraightNumericAxisBase.$, a);
            c.sk();
            c.kx("Scaler", b.oldValue, b.newValue);
        }
        r7() {
            return null;
        }
        get_r5() {
            if (this.r6 == null) {
                this.sk();
            }
            return this.r6;
        }
        set_r5(a) {
            let b = this.r6 != a;
            if (b) {
                let c = this.r6;
                this.r6 = a;
                this.kx("ActualScaler", c, a);
            }
        }
        get r5() {
            return this.get_r5();
        }
        set r5(a) {
            this.set_r5(a);
        }
        re(a, b, c, d, e, f, g) {
            let h = this.r5.t(a, b, c, f, g);
            f = h.p3;
            g = h.p4;
            return {
                p5: f,
                p6: g
            };
        }
        sj(a) {
            let b = this.sa;
            this.sa = true;
            a();
            this.sa = b;
        }
        sk() {
            let a = this.r8;
            if (a == null) {
                a = this.ot();
            }
            this.r5 = a;
            if (this.r5 == null) {
                throw new ArgumentNullException(0, "ActualScaler");
            }
            this.sf();
        }
        sf() {
            this.r9.bn();
        }
        kf(a, b, c, d) {
            if (this.sa) {
                return;
            }
            super.kf(a, b, c, d);
            switch (b) {
                case NumericAxisBase.$$p[12]:
                    this.sk();
                    break;
                case NumericAxisBase.$$p[11]:
                    this.sk();
                    break;
                case StraightNumericAxisBase.$$p[0]:
                    this.sk();
                    break;
                case "Scaler":
                    this.sk();
                    break;
                case "ActualScaler":
                    this.o2 = typeCast(LogarithmicScaler.$, this.r5) !== null;
                    this.sf();
                    this.d2();
                    this.k3(false);
                    break;
                case "ActualMaximumValue":
                    this.sg();
                    break;
                case "ActualMinimumValue":
                    this.sh();
                    this.sk();
                    break;
            }
        }
        sh() {
            this.r5.y(this.pr);
        }
        sg() {
            this.r5.x(this.pq);
        }
        sb(a, b) {
            if (a < this.pr) {
                a = this.pr;
            }
            else if (a > this.pq) {
                a = this.pq;
            }
            if (!b.dq) {
                return (a - this.pr) / (this.pq - this.pr);
            }
            else {
                return (a - this.pq) / (this.pr - this.pq);
            }
        }
    }
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.sm = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.si));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'kx', ['ScaleMode:r4:sl', [NumericScaleMode_$type, enumGetBox(NumericScaleMode_$type, 0)]]);
    return StraightNumericAxisBase;
})();
/**
 * @hidden
 */
export let StraightNumericAxisBaseView = /*@__PURE__*/ (() => {
    class StraightNumericAxisBaseView extends NumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bm = null;
            this.bm = a;
        }
        bn() {
            this.bm.r5.x(this.bm.pq);
            this.bm.r5.y(this.bm.pr);
        }
    }
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
})();
