/*
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.ni = null;
            this.nm = false;
            this.nw();
        }
        a3() {
            return new StraightNumericAxisBaseView(this);
        }
        hr(a) {
            super.hr(a);
            this.nl = a;
        }
        get nk() {
            return this.c(StraightNumericAxisBase.ny);
        }
        set nk(a) {
            this.h(StraightNumericAxisBase.ny, a);
        }
        static nu(a, b) {
            let c = typeCast(StraightNumericAxisBase.$, a);
            c.nw();
            c.h1("Scaler", b.oldValue, b.newValue);
        }
        nj() {
            return null;
        }
        get_nh() {
            if (this.ni == null) {
                this.nw();
            }
            return this.ni;
        }
        set_nh(a) {
            let b = this.ni != a;
            if (b) {
                let c = this.ni;
                this.ni = a;
                this.h1("ActualScaler", c, a);
            }
        }
        get nh() {
            return this.get_nh();
        }
        set nh(a) {
            this.set_nh(a);
        }
        mx(a, b, c, d, e, f, g) {
            let h = this.nh.t(a, b, c, f, g);
            f = h.p3;
            g = h.p4;
            return {
                p5: f,
                p6: g
            };
        }
        nv(a) {
            let b = this.nm;
            this.nm = true;
            a();
            this.nm = b;
        }
        nw() {
            let a = this.nk;
            if (a == null) {
                a = this.k2();
            }
            this.nh = a;
            if (this.nh == null) {
                throw new ArgumentNullException(0, "ActualScaler");
            }
            this.nr();
        }
        nr() {
            this.nl.bk();
        }
        hv(a, b, c, d) {
            if (this.nm) {
                return;
            }
            super.hv(a, b, c, d);
            switch (b) {
                case NumericAxisBase.$$p[6]:
                    this.nw();
                    break;
                case NumericAxisBase.$$p[5]:
                    this.nw();
                    break;
                case StraightNumericAxisBase.$$p[0]:
                    this.nw();
                    break;
                case "Scaler":
                    this.nw();
                    break;
                case "ActualScaler":
                    this.la = typeCast(LogarithmicScaler.$, this.nh) !== null;
                    this.nr();
                    this.c0();
                    this.h7(false);
                    break;
                case "ActualMaximumValue":
                    this.ns();
                    break;
                case "ActualMinimumValue":
                    this.nt();
                    this.nw();
                    break;
            }
        }
        nt() {
            this.nh.y(this.lw);
        }
        ns() {
            this.nh.x(this.lv);
        }
        nn(a, b) {
            if (a < this.lw) {
                a = this.lw;
            }
            else if (a > this.lv) {
                a = this.lv;
            }
            if (!b.co) {
                return (a - this.lw) / (this.lv - this.lw);
            }
            else {
                return (a - this.lv) / (this.lw - this.lv);
            }
        }
    }
    StraightNumericAxisBase.$t = markType(StraightNumericAxisBase, 'StraightNumericAxisBase', NumericAxisBase.$);
    StraightNumericAxisBase.ny = DependencyProperty.i("Scaler", NumericScaler.$, StraightNumericAxisBase.$, new PropertyMetadata(2, null, StraightNumericAxisBase.nu));
    StraightNumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, StraightNumericAxisBase, 'h1', ['ScaleMode:ng:nx', [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.nh.x(this.bj.lv);
            this.bj.nh.y(this.bj.lw);
        }
    }
    StraightNumericAxisBaseView.$t = markType(StraightNumericAxisBaseView, 'StraightNumericAxisBaseView', NumericAxisBaseView.$);
    return StraightNumericAxisBaseView;
})();
