/*
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 { 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
 */
export let StraightNumericAxisBase = /*@__PURE__*/ (() => {
    class StraightNumericAxisBase extends NumericAxisBase {
        constructor() {
            super();
            this.nh = null;
            this.nl = false;
            this.nv();
        }
        a3() {
            return new StraightNumericAxisBaseView(this);
        }
        hr(a) {
            super.hr(a);
            this.nk = a;
        }
        get nj() {
            return this.c(StraightNumericAxisBase.nx);
        }
        set nj(a) {
            this.h(StraightNumericAxisBase.nx, a);
        }
        static nt(a, b) {
            let c = typeCast(StraightNumericAxisBase.$, a);
            c.nv();
            c.h1("Scaler", b.oldValue, b.newValue);
        }
        ni() {
            return null;
        }
        get_ng() {
            if (this.nh == null) {
                this.nv();
            }
            return this.nh;
        }
        set_ng(a) {
            let b = this.nh != a;
            if (b) {
                let c = this.nh;
                this.nh = a;
                this.h1("ActualScaler", c, a);
            }
        }
        get ng() {
            return this.get_ng();
        }
        set ng(a) {
            this.set_ng(a);
        }
        mw(a, b, c, d, e, f, g) {
            let h = this.ng.t(a, b, c, f, g);
            f = h.p3;
            g = h.p4;
            return {
                p5: f,
                p6: g
            };
        }
        nu(a) {
            let b = this.nl;
            this.nl = true;
            a();
            this.nl = b;
        }
        nv() {
            let a = this.nj;
            if (a == null) {
                a = this.k1();
            }
            this.ng = a;
            if (this.ng == null) {
                throw new ArgumentNullException(0, "ActualScaler");
            }
            this.nq();
        }
        nq() {
            this.nk.bk();
        }
        hv(a, b, c, d) {
            if (this.nl) {
                return;
            }
            super.hv(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;
            }
        }
        ns() {
            this.ng.y(this.lv);
        }
        nr() {
            this.ng.x(this.lu);
        }
        nm(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;
})();
/**
 * @hidden
 */
export let StraightNumericAxisBaseView = /*@__PURE__*/ (() => {
    class StraightNumericAxisBaseView extends NumericAxisBaseView {
        constructor(a) {
            super(a);
            this.bj = null;
            this.bj = a;
        }
        bk() {
            this.bj.ng.x(this.bj.lu);
            this.bj.ng.y(this.bj.lv);
        }
    }
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
})();
