/*
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 { DependencyObject } from "igniteui-react-core";
import { INotifyPropertyChanged_$type, PropertyChangedEventArgs, delegateCombine, typeCast, fromEnum, markType, markDep } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { Series } from "./Series";
import { DependencyProperty } from "igniteui-react-core";
import { PropertyUpdatedEventArgs } from "igniteui-react-core";
import { ISupportsSizeScale_$type } from "./ISupportsSizeScale";
import { PropertyMetadata } from "igniteui-react-core";
import { isNaN_, isInfinity } from "igniteui-react-core";
/**
 * @hidden
 */
export let SizeScale = /*@__PURE__*/ (() => {
    class SizeScale extends DependencyObject {
        constructor() {
            super();
            this._globalMinimum = 0;
            this._globalMaximum = 0;
            this.l = null;
            this.propertyChanged = null;
            this.propertyUpdated = null;
            this.globalMinimum = NaN;
            this.globalMaximum = NaN;
            this.l = new List$1(Series.$, 0);
            this.propertyUpdated = delegateCombine(this.propertyUpdated, (a, b) => this.y(a, b.propertyName, b.oldValue, b.newValue));
        }
        get globalMinimum() {
            return this._globalMinimum;
        }
        set globalMinimum(a) {
            this._globalMinimum = a;
        }
        get globalMaximum() {
            return this._globalMaximum;
        }
        set globalMaximum(a) {
            this._globalMaximum = a;
        }
        getCurrentGlobalMinimum() {
            return this.globalMinimum;
        }
        getCurrentGlobalMaximum() {
            return this.globalMaximum;
        }
        x() {
            if (isNaN_(this.globalMinimum) || isNaN_(this.globalMaximum)) {
                for (let a of fromEnum(this.l)) {
                    if (typeCast(ISupportsSizeScale_$type, a) !== null) {
                        a.updateSizeScaleGlobals();
                    }
                }
            }
        }
        ab(a, b) {
            if (!isNaN_(a) && !isInfinity(a)) {
                if (isNaN_(this.globalMinimum)) {
                    this.globalMinimum = a;
                }
                else {
                    this.globalMinimum = Math.min(a, this.globalMinimum);
                }
            }
            if (!isNaN_(b) && !isInfinity(b)) {
                if (isNaN_(this.globalMaximum)) {
                    this.globalMaximum = b;
                }
                else {
                    this.globalMaximum = Math.max(b, this.globalMaximum);
                }
            }
        }
        aa() {
            this.globalMinimum = NaN;
            this.globalMaximum = NaN;
        }
        z(a, b, c) {
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
            if (this.propertyUpdated != null) {
                this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
            }
        }
        y(a, b, c, d) {
            for (let e of fromEnum(this.l)) {
                e.pp(false);
                if (e.cy != null) {
                    e.ol();
                    e.ok();
                }
            }
        }
    }
    SizeScale.$t = /*@__PURE__*/ markType(SizeScale, 'SizeScale', DependencyObject.$, [INotifyPropertyChanged_$type]);
    SizeScale.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, SizeScale, 'z', ['IsLogarithmic', [0, false], 'LogarithmBase', [1, 10], 'MaximumValue', [1, NaN], 'MinimumValue', [1, NaN]]);
    return SizeScale;
})();
