UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

27,493 lines 899 kB
/*
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 { __extends, __generator, __values } from "tslib";
import { Control } from "igniteui-angular-core";
import { INotifyPropertyChanged_$type, Base, Type, EventArgs, PropertyChangedEventArgs, IEnumerable_$type, callStaticConstructors, Point_$type, runOn, delegateCombine, fromEnum, delegateRemove, fromEn, typeCast, enumGetBox, EnumUtil, Boolean_$type, Number_$type, typeGetValue, toEnum, String_$type, markType, markDep, PointUtil, TypeRegistrar, Delegate_$type, Array_$type, Date_$type, getInstanceType } from "igniteui-angular-core";
import { ILegendOwner_$type } from "igniteui-angular-core";
import { IInternalLegendOwner_$type } from "igniteui-angular-core";
import { IDataLegendTarget_$type } from "igniteui-angular-core";
import { IToolbarTarget_$type } from "igniteui-angular-core";
import { ISupportsAnimation_$type } from "igniteui-angular-core";
import { SRProvider } from "igniteui-angular-core";
import { DVContainer } from "igniteui-angular-core";
import { SeriesPlotAreaMarginHorizontalMode_$type } from "./SeriesPlotAreaMarginHorizontalMode";
import { SeriesPlotAreaMarginVerticalMode_$type } from "./SeriesPlotAreaMarginVerticalMode";
import { SeriesViewerScrollbarMode_$type } from "./SeriesViewerScrollbarMode";
import { DoubleAnimator } from "igniteui-angular-core";
import { BrushCollection } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { DependencyObject } from "igniteui-angular-core";
import { MarkerAutomaticBehavior_$type } from "./MarkerAutomaticBehavior";
import { IChartLegend_$type } from "igniteui-angular-core";
import { SeriesHighlightingMode_$type } from "./SeriesHighlightingMode";
import { SeriesSelectionMode_$type } from "./SeriesSelectionMode";
import { SeriesSelectionBehavior_$type } from "./SeriesSelectionBehavior";
import { SeriesViewerHorizontalScrollbarPosition_$type } from "./SeriesViewerHorizontalScrollbarPosition";
import { SeriesViewerVerticalScrollbarPosition_$type } from "./SeriesViewerVerticalScrollbarPosition";
import { Brush } from "igniteui-angular-core";
import { SeriesHighlightingBehavior_$type } from "./SeriesHighlightingBehavior";
import { LegendHighlightingMode_$type } from "./LegendHighlightingMode";
import { LegendItemBadgeShape_$type } from "igniteui-angular-core";
import { LegendItemBadgeMode_$type } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { ChartHitTestMode_$type } from "./ChartHitTestMode";
import { InteractionState_$type } from "igniteui-angular-core";
import { WindowResponse_$type } from "./WindowResponse";
import { Visibility_$type } from "igniteui-angular-core";
import { SeriesViewerComponentsFromView } from "./SeriesViewerComponentsFromView";
import { ZoomCoercionMode_$type } from "./ZoomCoercionMode";
import { ModifierKeys_$type } from "igniteui-angular-core";
import { SeriesHighlightedValuesDisplayMode_$type } from "igniteui-angular-core";
import { DataTemplate } from "igniteui-angular-core";
import { HorizontalAlignment_$type } from "igniteui-angular-core";
import { CanvasRenderScheduler } from "igniteui-angular-core";
import { SyncSettings } from "./SyncSettings";
import { PropertyMetadata } from "igniteui-angular-core";
import { ICommandStateChangedListener_$type } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesViewerComponentsForView } from "./SeriesViewerComponentsForView";
import { VersionQueueHelper } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { IDataLegend_$type } from "igniteui-angular-core";
import { PropertyUpdatedEventArgs } from "igniteui-angular-core";
import { NotifyCollectionChangedEventArgs } from "igniteui-angular-core";
import { ObservableCollection$1 } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { FrameworkElement } from "igniteui-angular-core";
import { MouseEventArgs } from "igniteui-angular-core";
import { MouseButtonEventArgs } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { SeriesViewerManipulationEventArgs } from "./SeriesViewerManipulationEventArgs";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { HashSet$1 } from "igniteui-angular-core";
import { RectChangedEventArgs } from "igniteui-angular-core";
import { MathUtil } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { RefreshCompletedEventArgs } from "./RefreshCompletedEventArgs";
import { Thickness } from "igniteui-angular-core";
import { AxisTitlePosition_$type } from "./AxisTitlePosition";
import { CoercionInfo } from "./CoercionInfo";
import { FastItemsSource } from "igniteui-angular-core";
import { FontUtil } from "igniteui-angular-core";
import { IDataLegendSeries_$type } from "igniteui-angular-core";
import { CaptureImageSettings } from "igniteui-angular-core";
import { ImageCapturedEventArgs } from "igniteui-angular-core";
import { truncate, intDivide, isNaN_, isInfinity, logBase, log10 } from "igniteui-angular-core";
import { ChartContentType_$type } from "./ChartContentType";
import { defaultDVDateParse, dateNow } from "igniteui-angular-core";
import { stringIsNullOrEmpty, stringEmpty, stringEndsWith, stringStartsWith, stringIsNullOrWhiteSpace } from "igniteui-angular-core";
import { ISchedulableRender_$type } from "igniteui-angular-core";
import { Rectangle } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { Line } from "igniteui-angular-core";
import { RenderingContext } from "igniteui-angular-core";
import { TextBlock } from "igniteui-angular-core";
import { ITileZoomTile_$type } from "./ITileZoomTile";
import { DOMExecutionContext } from "igniteui-angular-core";
import { RenderSurface } from "./RenderSurface";
import { PathFigureCollection } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { GeometryGroup } from "igniteui-angular-core";
import { DataContext } from "igniteui-angular-core";
import { LabelPanelsArrangeState } from "./LabelPanelsArrangeState";
import { MarkerTemplates } from "./MarkerTemplates";
import { DataTemplateRenderInfo } from "igniteui-angular-core";
import { DataTemplateMeasureInfo } from "igniteui-angular-core";
import { AxisLabelsLocation_$type } from "./AxisLabelsLocation";
import { IProvidesViewport_$type } from "./IProvidesViewport";
import { ArgumentNullException } from "igniteui-angular-core";
import { ActualLegendItemBadgeShape_$type } from "./ActualLegendItemBadgeShape";
import { CanvasViewRenderer } from "igniteui-angular-core";
import { Defaults } from "./Defaults";
import { EllipseGeometry } from "igniteui-angular-core";
import { DataTemplatePassInfo } from "igniteui-angular-core";
import { BrushUtil } from "igniteui-angular-core";
import { LegendItemHelper } from "igniteui-angular-core";
import { DomWrapper_$type } from "igniteui-angular-core";
import { PointerTooltipStyle } from "./PointerTooltipStyle";
import { DefaultPaletteInfo } from "./DefaultPaletteInfo";
import { CssGradientUtil } from "igniteui-angular-core";
import { AxisDefaults } from "./AxisDefaults";
import { BrushUtilCore } from "igniteui-angular-core";
import { AxisRange } from "./AxisRange";
import { LinearNumericSnapper } from "./LinearNumericSnapper";
import { AxisAnnotationCollection } from "./AxisAnnotationCollection";
import { VerticalAlignment_$type } from "igniteui-angular-core";
import { Canvas } from "igniteui-angular-core";
import { IFastItemsSourceProvider_$type } from "igniteui-angular-core";
import { DoubleCollection } from "igniteui-angular-core";
import { LabelPosition } from "./LabelPosition";
import { BindingFormatter } from "igniteui-angular-core";
import { LabelFontHeuristics } from "./LabelFontHeuristics";
import { Pool$1 } from "igniteui-angular-core";
import { AxisComponentsFromView } from "./AxisComponentsFromView";
import { FastReflectionHelper } from "igniteui-angular-core";
import { AxisRangeChangedEventArgs } from "./AxisRangeChangedEventArgs";
import { RectangleGeometry } from "igniteui-angular-core";
import { PathRenderingInfo } from "./PathRenderingInfo";
import { LineGeometry } from "igniteui-angular-core";
import { RenderRequestedEventArgs } from "./RenderRequestedEventArgs";
import { CategoryMode_$type } from "./CategoryMode";
import { GridMode_$type } from "./GridMode";
import { Panel } from "igniteui-angular-core";
import { UIElement } from "igniteui-angular-core";
import { RectUtil } from "igniteui-angular-core";
import { TickmarkValues } from "./TickmarkValues";
import { TransformGroup } from "igniteui-angular-core";
import { RotateTransform } from "igniteui-angular-core";
import { TranslateTransform } from "igniteui-angular-core";
import { AngleSimplifier } from "igniteui-angular-core";
import { TransformMatrixHelpler } from "igniteui-angular-core";
import { ICategoryScaler_$type } from "./ICategoryScaler";
import { AxisRangeBufferMode_$type } from "./AxisRangeBufferMode";
import { NumericAxisRenderingParameters } from "./NumericAxisRenderingParameters";
import { LogarithmicTickmarkValues } from "./LogarithmicTickmarkValues";
import { LinearTickmarkValues } from "./LinearTickmarkValues";
import { CategoryAxisRenderingParameters } from "./CategoryAxisRenderingParameters";
import { TickmarkValuesInitializationParameters } from "./TickmarkValuesInitializationParameters";
import { NumberAbbreviatorFactory } from "./NumberAbbreviatorFactory";
import { AutomaticSeriesPurpose_$type } from "./AutomaticSeriesPurpose";
import { SeriesMatcher } from "./SeriesMatcher";
import { Stack$1 } from "igniteui-angular-core";
import { RenderValidEventArgs } from "./RenderValidEventArgs";
import { ArrayExtension } from "igniteui-angular-core";
import { SeriesLayerPropertyOverlayValueResolvingEventArgs } from "./SeriesLayerPropertyOverlayValueResolvingEventArgs";
import { PlatformAPIHelper } from "igniteui-angular-core";
import { Marker } from "./Marker";
import { ContentControl } from "igniteui-angular-core";
import { AutoMarginsAndAngleUpdateMode_$type } from "./AutoMarginsAndAngleUpdateMode";
import { ComputedPlotAreaMarginMode_$type } from "./ComputedPlotAreaMarginMode";
import { PolygonUtil } from "igniteui-angular-core";
import { ILegendSeries_$type } from "igniteui-angular-core";
import { ILegendSeriesInternal_$type } from "igniteui-angular-core";
import { ILegendTemplateProvider_$type } from "igniteui-angular-core";
import { PenLineJoin_$type } from "igniteui-angular-core";
import { PenLineCap_$type } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
import { SeriesVisibleRangeMode_$type } from "./SeriesVisibleRangeMode";
import { SeriesOutlineMode_$type } from "./SeriesOutlineMode";
import { TransitionInSpeedType_$type } from "./TransitionInSpeedType";
import { TransitionOutSpeedType_$type } from "./TransitionOutSpeedType";
import { SeriesHitTestMode_$type } from "./SeriesHitTestMode";
import { SeriesComponentsForView } from "./SeriesComponentsForView";
import { Binding } from "igniteui-angular-core";
import { MarkerOutlineMode_$type } from "./MarkerOutlineMode";
import { MarkerFillMode_$type } from "./MarkerFillMode";
import { SeriesPointOfInterest } from "./SeriesPointOfInterest";
import { FastItemColumn } from "igniteui-angular-core";
import { TransitionOutCompletedEventArgs } from "./TransitionOutCompletedEventArgs";
import { IChartItemLegend_$type } from "igniteui-angular-core";
import { SeriesComponentsFromView } from "./SeriesComponentsFromView";
import { DataLegendSeriesValueInfo } from "igniteui-angular-core";
import { DataLegendSeriesContext } from "igniteui-angular-core";
import { MarkerType_$type } from "./MarkerType";
import { Style } from "igniteui-angular-core";
import { FastItemsSourceReference } from "igniteui-angular-core";
import { stringFormat } from "igniteui-angular-core";
import { EasingFunctions } from "igniteui-angular-core";
/**
 * @hidden
 */
var SeriesViewer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewer, _super);
    function SeriesViewer() {
        var _this = _super.call(this) || this;
        _this._widget = null;
        _this.c9 = null;
        _this.dt = null;
        _this.an = null;
        _this.gn = new List$1(ICommandStateChangedListener_$type, 0);
        _this._commandCompleted = null;
        _this._invalidateActions = null;
        _this.da = null;
        _this.a8 = null;
        _this.ba = null;
        _this.ec = false;
        _this.eb = false;
        _this.c1 = null;
        _this.br = new SeriesCollection();
        _this.iy = 0;
        _this.bz = 0;
        _this.b1 = 0;
        _this._skipDataCleanup = false;
        _this.dc = null;
        _this.de = null;
        _this.db = null;
        _this.dd = null;
        _this.ar = null;
        _this.vu = null;
        _this.plotAreaMouseLeftButtonDown = null;
        _this.plotAreaMouseLeftButtonUp = null;
        _this.plotAreaClicked = null;
        _this.plotAreaMouseEnter = null;
        _this.plotAreaMouseLeave = null;
        _this.plotAreaMouseOver = null;
        _this.cf = 0;
        _this.cg = 0;
        _this.bu = 1;
        _this.b7 = 1;
        _this.b3 = 3;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.ja = null;
        _this.d7 = false;
        _this.seriesCursorMouseMove = null;
        _this.seriesMouseLeftButtonDown = null;
        _this.seriesMouseLeftButtonUp = null;
        _this.seriesClick = null;
        _this.seriesMouseMove = null;
        _this.seriesMouseEnter = null;
        _this.seriesMouseLeave = null;
        _this.d1 = false;
        _this.d0 = false;
        _this.v3 = Rect.empty;
        _this.v1 = Rect.empty;
        _this.dy = true;
        _this.v0 = null;
        _this.eh = false;
        _this.ix = 30;
        _this.fq = false;
        _this.ej = false;
        _this.cc = new SeriesViewerComponentsForView();
        _this.d5 = false;
        _this.at = 0;
        _this.as = 1;
        _this.seriesAnimating = null;
        _this.dv = new VersionQueueHelper();
        _this.d4 = false;
        _this.d2 = false;
        _this.cv = 0;
        _this.d9 = false;
        _this.er = false;
        _this.dz = false;
        _this.md = null;
        _this.viewerManipulationStarting = null;
        _this.viewerManipulationEnding = null;
        _this.ef = false;
        _this.ea = false;
        _this.windowRectChanged = null;
        _this.sizeChanged = null;
        _this.e1 = false;
        _this.actualWindowRectChanged = null;
        _this.gridAreaRectChanged = null;
        _this.et = false;
        _this.g0 = 0.0001;
        _this.gz = 0.0001;
        _this._syncChannel = null;
        _this.cm = null;
        _this.gb = false;
        _this.ee = false;
        _this.e0 = false;
        _this.gh = false;
        _this.cq = 1;
        _this.wm = null;
        _this.i0 = 0;
        _this.bq = null;
        _this.ed = false;
        _this.gc = false;
        _this.v2 = Rect.empty;
        _this._selectedSeriesItems = null;
        _this._focusedSeriesItems = null;
        _this.selectedSeriesItemsChanged = null;
        _this.focusedSeriesItemsChanged = null;
        _this.gu = new Date();
        _this.gk = false;
        _this.refreshCompleted = null;
        _this.jf = null;
        _this.je = null;
        _this.u5 = null;
        _this.u4 = null;
        _this.hf = NaN;
        _this.hd = NaN;
        _this.he = NaN;
        _this.hc = NaN;
        _this.hb = NaN;
        _this.g9 = NaN;
        _this.ha = NaN;
        _this.g8 = NaN;
        _this.jc = null;
        _this.al = null;
        _this.am = null;
        _this.ak = null;
        _this.d8 = false;
        _this.dx = false;
        _this._syncSettings = null;
        _this.destroyed = false;
        _this.i9 = null;
        _this.gl = new Dictionary$2(String_$type, Base.$, 0);
        _this.fo = false;
        _this.hg = NaN;
        _this.g5 = NaN;
        _this.g7 = NaN;
        _this.g3 = NaN;
        _this.g2 = 30;
        _this.g1 = NaN;
        _this.d3 = true;
        _this.g6 = NaN;
        _this.g4 = NaN;
        _this.jd = null;
        _this.gw = 1;
        _this.gv = NaN;
        _this.vz = null;
        _this.ez = false;
        _this.gx = 0;
        _this.gy = 0;
        _this.sb = null;
        _this.az = null;
        _this.e4 = false;
        _this.e5 = false;
        _this.e2 = false;
        _this.d6 = false;
        _this.iz = 0;
        _this.ep = false;
        _this.e8 = false;
        _this.seriesDataUpdated = null;
        _this.go = new List$1(IDataLegend_$type, 0);
        _this.dw = null;
        _this.gr = null;
        _this.imageCaptured = null;
        DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
        DVContainer.instance.registerIfLoaded("InteractivityFactoryManager");
        DVContainer.instance.registerIfLoaded("DataChartToolbarFactoryManager");
        DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
        _this.vz = Rect.empty;
        _this.vu = { $type: Point_$type, x: NaN, y: NaN };
        _this.gu = dateNow();
        _this.e4 = false;
        _this.e5 = false;
        _this.al = new CanvasRenderScheduler();
        _this.al.a = runOn(_this, _this.ne);
        _this.am = new CanvasRenderScheduler();
        _this.ak = new CanvasRenderScheduler();
        SeriesViewer.wg = new Rect(0, 0, 0, 1, 1);
        _this.syncSettings = ((function () {
            var $ret = new SyncSettings();
            $ret.synchronizeHorizontally = true;
            $ret.synchronizeVertically = true;
            return $ret;
        })());
        _this.c9 = _this.c8();
        _this.p5(_this.c9);
        _this.c9.c4();
        _this.rm();
        _this.nz();
        _this.actualSyncLink = new SyncLink();
        _this.rt(null, _this.actualSyncLink);
        _this.ar = new ChartContentManager(_this);
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.qh(a, b.propertyName, b.oldValue, b.newValue); });
        _this.selectedSeriesItems = new ChartSelectedItemCollection();
        var a = _this.selectedSeriesItems;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.ps));
        var b = _this.selectedSeriesItems;
        b.collectionResetting = delegateCombine(b.collectionResetting, runOn(_this, _this.q9));
        _this.focusedSeriesItems = new ChartSelectedItemCollection();
        var c = _this.focusedSeriesItems;
        c.collectionChanged = delegateCombine(c.collectionChanged, runOn(_this, _this.o5));
        var d = _this.focusedSeriesItems;
        d.collectionResetting = delegateCombine(d.collectionResetting, runOn(_this, _this.ns));
        var e = _this.series;
        e.collectionChanged = delegateCombine(e.collectionChanged, runOn(_this, _this.rb));
        var f = _this.series;
        f.collectionResetting = delegateCombine(f.collectionResetting, runOn(_this, _this.rc));
        _this.dd = new DoubleAnimator(0, 1, _this.i6);
        _this.dc = new DoubleAnimator(0, 1, _this.i5);
        var g = _this.dc;
        g.propertyChanged = delegateCombine(g.propertyChanged, runOn(_this, _this.ny));
        _this.de = new DoubleAnimator(0, 1, _this.i7);
        _this.db = new DoubleAnimator(0, 1, _this.i3);
        var h = _this.de;
        h.propertyChanged = delegateCombine(h.propertyChanged, runOn(_this, _this.ra));
        var i = _this.db;
        i.propertyChanged = delegateCombine(i.propertyChanged, runOn(_this, _this.nt));
        _this.c9.bx();
        _this.n1();
        _this.n0();
        return _this;
    }
    Object.defineProperty(SeriesViewer.prototype, "widget", {
        get: function () {
            return this._widget;
        },
        set: function (a) {
            this._widget = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.staticInit = function () {
        SeriesViewer.wg = new Rect(0, 0, 0, 1, 1);
    };
    Object.defineProperty(SeriesViewer.prototype, "du", {
        get: function () {
            if (this.dt == null) {
                this.dt = new SRProvider(this.c9.j.ae);
            }
            return this.dt;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ao = function (a) {
        if (this.an == null) {
            this.an = new AutomaticSeriesManager(this);
        }
        return this.an;
    };
    SeriesViewer.prototype.getDesiredToolbarActions = function () {
        if (!this.fi) {
            return null;
        }
        return this.a9.getDesiredToolbarActions(this);
    };
    SeriesViewer.prototype.onToolCommandExecuting = function (a) {
        if (!this.fi) {
            return 1;
        }
        return this.a9.onToolCommandExecuting(this, a);
    };
    SeriesViewer.prototype.addCommandAvailabilityListener = function (a) {
    };
    SeriesViewer.prototype.removeCommandAvailabilityListener = function (a) {
    };
    SeriesViewer.prototype.addCommandStateChangedListener = function (a) {
        if (!this.gn.contains(a)) {
            this.gn.add(a);
        }
    };
    SeriesViewer.prototype.removeCommandStateChangedListener = function (a) {
        if (this.gn.contains(a)) {
            this.gn.remove(a);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "commandCompleted", {
        get: function () {
            return this._commandCompleted;
        },
        set: function (a) {
            this._commandCompleted = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "invalidateActions", {
        get: function () {
            return this._invalidateActions;
        },
        set: function (a) {
            this._invalidateActions = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.provideContextAccessor = function (a) {
        this.da = a;
    };
    SeriesViewer.prototype.n4 = function () {
        if (this.invalidateActions != null) {
            this.invalidateActions();
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "a9", {
        get: function () {
            var _this = this;
            if (this.a8 == null) {
                this.a8 = DVContainer.instance.createInstance(IDataChartToolbarProvider_$type, function () { return _this.du.n; });
                this.a8.container = this.c9.bi;
            }
            return this.a8;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "fi", {
        get: function () {
            return DVContainer.instance.checkLoaded("DataChartToolbarFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bb", {
        get: function () {
            var _this = this;
            if (this.ba == null) {
                this.ba = DVContainer.instance.createInstance(ISeriesViewerInteractionManager_$type, function () { return _this.du.n; });
            }
            return this.ba;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "fa", {
        get: function () {
            return DVContainer.instance.checkLoaded("InteractivityFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.q9 = function (a, b) {
        for (var c = 0; c < this.selectedSeriesItems.count; c++) {
            this.pb(this.selectedSeriesItems._inner[c]);
        }
    };
    SeriesViewer.prototype.ns = function (a, b) {
        for (var c = 0; c < this.focusedSeriesItems.count; c++) {
            this.pa(this.focusedSeriesItems._inner[c]);
        }
    };
    SeriesViewer.prototype.ps = function (a, b) {
        if (b.action == 4 && b.newItems == null && b.oldItems == null) {
            return;
        }
        if (this.ec) {
            return;
        }
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                this.pb(d);
            }
        }
        if (b.newItems != null) {
            for (var e = 0; e < b.newItems.count; e++) {
                var f = b.newItems.item(e);
                f.g(this);
            }
            for (var g = 0; g < b.newItems.count; g++) {
                var h = b.newItems.item(g);
                this.pd(h);
            }
        }
        var i = new ChartSelectedItemCollection();
        if (b.oldItems != null) {
            for (var j = 0; j < b.oldItems.count; j++) {
                i.add(b.oldItems.item(j));
            }
        }
        var k = new ChartSelectedItemCollection();
        if (b.newItems != null) {
            for (var l = 0; l < b.newItems.count; l++) {
                k.add(b.newItems.item(l));
            }
        }
        var m = this.selectedSeriesItems;
        this.pr(this, new SeriesViewerSelectedSeriesItemsChangedEventArgs(i, k, m));
    };
    SeriesViewer.prototype.o5 = function (a, b) {
        if (b.action == 4 && b.newItems == null && b.oldItems == null) {
            return;
        }
        if (this.eb) {
            return;
        }
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                this.pa(d);
            }
        }
        if (b.newItems != null) {
            for (var e = 0; e < b.newItems.count; e++) {
                var f = b.newItems.item(e);
                this.pc(f);
            }
        }
        var g = new ChartSelectedItemCollection();
        if (b.oldItems != null) {
            for (var h = 0; h < b.oldItems.count; h++) {
                g.add(b.oldItems.item(h));
            }
        }
        var i = new ChartSelectedItemCollection();
        if (b.newItems != null) {
            for (var j = 0; j < b.newItems.count; j++) {
                i.add(b.newItems.item(j));
            }
        }
        var k = this.selectedSeriesItems;
        this.o4(this, new SeriesViewerSelectedSeriesItemsChangedEventArgs(g, i, k));
    };
    SeriesViewer.prototype.pc = function (a) {
        this.nu(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            b.pq(c.item);
        });
    };
    SeriesViewer.prototype.pa = function (a) {
        this.nu(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            b.po(c.item);
        });
    };
    SeriesViewer.prototype.nu = function (a) {
        var e_1, _a;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                a(b);
                if (b.isStacked) {
                    b.p2(function (c) {
                        a(c);
                        if (c.eg) {
                            c.p0(function (d) {
                                a(d);
                                return true;
                            });
                        }
                        return true;
                    });
                }
                if (b.eg) {
                    b.p0(function (c) {
                        a(c);
                        return true;
                    });
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
    };
    SeriesViewer.prototype.pd = function (a) {
        this.nu(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            if (c.item == null) {
                b.pw();
            }
            else {
                b.pr(c.item);
            }
        });
    };
    SeriesViewer.prototype.pb = function (a) {
        this.nu(function (b) {
            var c = a;
            if (c.series != null && c.series != b) {
                return;
            }
            if (c.item == null) {
                b.pu();
            }
            else {
                b.pp(c.item);
            }
        });
    };
    SeriesViewer.prototype.nz = function () {
        if (this.c1 != null && this.c2 == null) {
            var a = this.c2;
            a.thumbnailSizeChanged = delegateRemove(a.thumbnailSizeChanged, runOn(this, this.qd));
        }
        if (this.c2 != null) {
            var b = this.c2;
            b.thumbnailSizeChanged = delegateCombine(b.thumbnailSizeChanged, runOn(this, this.qd));
        }
        if (this.jd != null) {
            this.c2.backgroundImageUri = this.jd;
        }
        if (this.c2 != null) {
            this.c2.initializeScalingRatio(this.hi);
        }
        if (this.c1 == null && this.c2 != null) {
            this.oi();
        }
        this.c1 = this.c2;
    };
    SeriesViewer.prototype.qd = function (a, b) {
        var e_2, _a;
        this.c2.surfaceIsDirty = true;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.gz = true;
            }
        }
        catch (e_2_1) {
            e_2 = { error: e_2_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_2)
                    throw e_2.error;
            }
        }
    };
    SeriesViewer.prototype.get_ft = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "ft", {
        get: function () {
            return this.get_ft();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.get_fs = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fs", {
        get: function () {
            return this.get_fs();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.n0 = function () {
        this.c9.co();
        if (this.c2 != null) {
            this.c2.initializeScalingRatio(this.hi);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "series", {
        get: function () {
            return this.br;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rb = function (a, b) {
        var e_3, _a, e_4, _b;
        var c = this.ep;
        this.ep = this.ev();
        if (b.oldItems != null) {
            try {
                for (var _c = __values(fromEn(b.oldItems)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var d = _d.value;
                    if (d != null && d.eo) {
                        this.iy--;
                        if (this.iy < 0) {
                            this.iy = 0;
                        }
                    }
                    d.c3 = null;
                    d.db = null;
                    this.q3(d);
                    this.c9.dy(d);
                }
            }
            catch (e_3_1) {
                e_3 = { error: e_3_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_3)
                        throw e_3.error;
                }
            }
        }
        if (b.newItems != null) {
            try {
                for (var _e = __values(fromEn(b.newItems)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var e = _f.value;
                    if (e != null && e.eo) {
                        this.iy++;
                    }
                    if (!this.c9.aq(e)) {
                        this.rn(e);
                        this.c9.bp(e);
                        e.db = this;
                        e.c3 = this.actualSyncLink;
                        e.so();
                    }
                }
            }
            catch (e_4_1) {
                e_4 = { error: e_4_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_4)
                        throw e_4.error;
                }
            }
        }
        if (this.ep != c && !this.wk.isEmpty) {
            this.qg(this.wk, this.wk);
        }
        this.oh();
        this.oq();
        this.o8();
        this.ob();
    };
    Object.defineProperty(SeriesViewer.prototype, "b0", {
        get: function () {
            return this.bz;
        },
        set: function (a) {
            this.bz = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b2", {
        get: function () {
            return this.b1;
        },
        set: function (a) {
            this.b1 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.n2 = function () {
        this.oq();
    };
    SeriesViewer.prototype.oq = function () {
    };
    Object.defineProperty(SeriesViewer.prototype, "skipDataCleanup", {
        get: function () {
            return this._skipDataCleanup;
        },
        set: function (a) {
            this._skipDataCleanup = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.q3 = function (a) {
        if (!this.skipDataCleanup) {
            if (typeCast(Series.$, a) !== null) {
                a.itemsSource = null;
            }
            else if (typeCast(CategoryAxisBase.$, a) !== null) {
                a.itemsSource = null;
            }
        }
        this.q5(a.name, true);
    };
    Object.defineProperty(SeriesViewer.prototype, "ew", {
        get: function () {
            return this.iy > 0;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rc = function (a, b) {
        var e_5, _a;
        this.ep = this.ev();
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.c3 = null;
                c.db = null;
                this.q3(c);
                this.c9.dy(c);
            }
        }
        catch (e_5_1) {
            e_5 = { error: e_5_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_5)
                    throw e_5.error;
            }
        }
        this.iy = 0;
        this.ob();
    };
    SeriesViewer.prototype.n6 = function (a, b, c, d) {
        var e = this.wk;
        var f = e.width;
        var g = e.height;
        var h = 1;
        var i = a / b;
        if (isNaN_(h)) {
            return {
                p0: a,
                p1: b
            };
        }
        if (isNaN_(i) || c || d || Math.abs(h - i) > 0.0001) {
            if (c && d) {
                if (a > b) {
                    b = a / h;
                }
                else {
                    a = b * h;
                }
            }
            else if (c) {
                b = a / h;
            }
            else {
                a = b * h;
            }
        }
        if (b > 1) {
            var j = 1 / b;
            b = 1;
            a = a * j;
        }
        if (a > 1) {
            var k = 1 / a;
            a = 1;
            b = b * k;
        }
        return {
            p0: a,
            p1: b
        };
    };
    SeriesViewer.prototype.ev = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "f8", {
        get: function () {
            return this.fj;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "e6", {
        get: function () {
            return this.ba != null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "eo", {
        get: function () {
            return this.ba != null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "en", {
        get: function () {
            return this.cf != 0 || this.cg != 0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "em", {
        get: function () {
            return this.eo && this.en;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "dl", {
        get: function () {
            var a = this.bb.f$e;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.no);
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "dm", {
        get: function () {
            var a = this.bb.f$f;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.np);
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "dk", {
        get: function () {
            var a = this.bb.f$d;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.nn);
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bc", {
        get: function () {
            var a = this.bb.f$b;
            if (a.executionContext == null) {
                a.executionContext = this.c9.l();
            }
            if (a.animator == null) {
                a.animator = this.dd;
                a.owner = this;
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.no = function () {
        {
            var a = this.dc;
            if (!a.f() && a.r > 0) {
                a.v();
            }
            if (a.r == 0) {
                var b = this.ge(1);
                while (b) {
                    b = this.ge(0);
                    b = this.ge(1);
                }
            }
        }
    };
    SeriesViewer.prototype.np = function () {
        {
            var a = this.de;
            if (!a.f() && a.r > 0) {
                a.v();
            }
            if (a.r == 0) {
                var b = this.gf(1);
                while (b) {
                    b = this.gf(0);
                    b = this.gf(1);
                }
            }
        }
    };
    SeriesViewer.prototype.nn = function () {
        {
            var a = this.db;
            if (!a.f() && a.r > 0) {
                a.v();
            }
            if (a.r == 0) {
                var b = this.gd(1);
                while (b) {
                    b = this.gd(0);
                    b = this.gd(1);
                }
            }
        }
    };
    SeriesViewer.prototype.ny = function (a, b) {
        this.ge(this.dc.o);
    };
    SeriesViewer.prototype.ra = function (a, b) {
        this.gf(this.de.o);
    };
    SeriesViewer.prototype.nt = function (a, b) {
        this.gd(this.db.o);
    };
    SeriesViewer.prototype.ge = function (a) {
        var b = this.dl.tick(a);
        if (a == 1 && b && this.dc.r > 0) {
            this.dc.v();
        }
        var c = this.dl.dirtyContexts;
        if (this.dl.allDirty) {
            var d = this.series;
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.q3();
            }
        }
        else {
            for (var g = 0; g < c.count; g++) {
                var h = c._inner[g];
                h.q3();
            }
        }
        if (!b) {
            this.dc.w();
            this.o7();
        }
        return b;
    };
    SeriesViewer.prototype.gf = function (a) {
        var b = this.dm.tick(a);
        if (a == 1 && b && this.de.r > 0) {
            this.de.v();
        }
        var c = this.dm.dirtyContexts;
        if (this.dm.allDirty) {
            var d = this.series;
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.q3();
            }
        }
        else {
            for (var g = 0; g < c.count; g++) {
                var h = c._inner[g];
                h.q3();
            }
        }
        if (!b) {
            this.de.w();
        }
        return b;
    };
    SeriesViewer.prototype.gd = function (a) {
        var b = this.dk.tick(a);
        if (a == 1 && b && this.db.r > 0) {
            this.db.v();
        }
        var c = this.dk.dirtyContexts;
        if (this.dk.allDirty) {
            var d = this.series;
            for (var e = 0; e < d.count; e++) {
                var f = d._inner[e];
                f.q3();
            }
        }
        else {
            for (var g = 0; g < c.count; g++) {
                var h = c._inner[g];
                h.q3();
            }
        }
        if (!b) {
            this.db.w();
        }
        return b;
    };
    SeriesViewer.prototype.nx = function () {
        this.c9.ck();
        this.nw();
        for (var a = 0; a < this.series.count; a++) {
            if (this.series._inner[a].es) {
                this.series._inner[a].p6();
            }
        }
    };
    SeriesViewer.prototype.va = function (a) {
        return this.u9(this.ag, a);
    };
    SeriesViewer.prototype.vg = function (a) {
        return this.u9(this.aj, a);
    };
    SeriesViewer.prototype.ve = function (a) {
        return this.u9(this.ah, a);
    };
    SeriesViewer.prototype.vf = function (a) {
        return this.u9(this.ai, a);
    };
    SeriesViewer.prototype.u9 = function (a, b) {
        if (a == null || a.count == 0) {
            return null;
        }
        else {
            return a.item(b % a.count);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "vv", {
        get: function () {
            return this.vu;
        },
        set: function (a) {
            if (PointUtil.notEquals(this.vu, a)) {
                var b = this.vu;
                this.vu = a;
                this.qm("CrosshairPoint", b, this.vu);
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qz = function () {
    };
    Object.defineProperty(SeriesViewer.prototype, "e9", {
        get: function () {
            return this.c0 == 1 || this.c0 == 2 || this.c0 == 3;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "legend", {
        get: function () {
            return this.c(SeriesViewer.td);
        },
        set: function (a) {
            this.h(SeriesViewer.td, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ek", {
        get: function () {
            return this.c(SeriesViewer.sd);
        },
        set: function (a) {
            this.h(SeriesViewer.sd, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "f2", {
        get: function () {
            return this.c(SeriesViewer.t0);
        },
        set: function (a) {
            this.h(SeriesViewer.t0, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pn = function (a, b) {
        this.d7 = false;
        var c = false;
        c = false;
        if (this.c9.k.al) {
            return;
        }
        if (this.plotAreaMouseLeftButtonDown != null) {
            var d = this.bh(a, b, c);
            this.plotAreaMouseLeftButtonDown(this, d);
        }
    };
    SeriesViewer.prototype.bh = function (a, b, c) {
        var d = { $type: Point_$type, x: a.x, y: a.y };
        var e = { $type: Point_$type, x: a.x, y: a.y };
        if (!this.wk.isEmpty) {
            if (c) {
                e.x -= this.wk.left;
                e.y -= this.wk.top;
            }
            else {
                d.x += this.wk.left;
                d.y += this.wk.top;
            }
        }
        var f = new PlotAreaMouseButtonEventArgs(this, d, e);
        f.manipulationOccurred = this.d7;
        return f;
    };
    SeriesViewer.prototype.bl = function (a, b, c) {
        var d = { $type: Point_$type, x: a.x, y: a.y };
        var e = { $type: Point_$type, x: a.x, y: a.y };
        if (!this.wk.isEmpty) {
            if (c) {
                e.x -= this.wk.left;
                e.y -= this.wk.top;
            }
            else {
                d.x += this.wk.left;
                d.y += this.wk.top;
            }
        }
        var f = new PlotAreaMouseEventArgs(this, d, e);
        return f;
    };
    SeriesViewer.prototype.po = function (a, b, c) {
        var d = false;
        d = false;
        if (this.c9.k.al) {
            return;
        }
        if (this.plotAreaMouseLeftButtonUp != null) {
            var e = this.bh(a, b, d);
            this.plotAreaMouseLeftButtonUp(this, e);
        }
        if (!this.d7 && !c) {
            if (this.plotAreaClicked != null) {
                var f = this.bh(a, b, d);
                this.plotAreaClicked(this, f);
            }
        }
        this.d7 = false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fj", {
        get: function () {
            return this.c(SeriesViewer.s9);
        },
        set: function (a) {
            this.h(SeriesViewer.s9, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "f7", {
        get: function () {
            return this.c(SeriesViewer.t3);
        },
        set: function (a) {
            this.h(SeriesViewer.t3, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "by", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesHighlightingMode_$type, this.c(SeriesViewer.sr));
        },
        set: function (a) {
            this.h(SeriesViewer.sr, enumGetBox(SeriesHighlightingMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "cb", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesSelectionMode_$type, this.c(SeriesViewer.tx));
        },
        set: function (a) {
            this.h(SeriesViewer.tx, enumGetBox(SeriesSelectionMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b6", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesSelectionBehavior_$type, this.c(SeriesViewer.tv));
        },
        set: function (a) {
            this.h(SeriesViewer.tv, enumGetBox(SeriesSelectionBehavior_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b9", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesSelectionMode_$type, this.c(SeriesViewer.sl));
        },
        set: function (a) {
            this.h(SeriesViewer.sl, enumGetBox(SeriesSelectionMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ch", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerScrollbarMode_$type, this.c(SeriesViewer.sz));
        },
        set: function (a) {
            this.h(SeriesViewer.sz, enumGetBox(SeriesViewerScrollbarMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ci", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerScrollbarMode_$type, this.c(SeriesViewer.uh));
        },
        set: function (a) {
            this.h(SeriesViewer.uh, enumGetBox(SeriesViewerScrollbarMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ce", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerHorizontalScrollbarPosition_$type, this.c(SeriesViewer.s1));
        },
        set: function (a) {
            this.h(SeriesViewer.s1, enumGetBox(SeriesViewerHorizontalScrollbarPosition_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "cl", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesViewerVerticalScrollbarPosition_$type, this.c(SeriesViewer.uj));
        },
        set: function (a) {
            this.h(SeriesViewer.uj, enumGetBox(SeriesViewerVerticalScrollbarPosition_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vi", {
        get: function () {
            return this.c(SeriesViewer.sv);
        },
        set: function (a) {
            this.h(SeriesViewer.sv, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vj", {
        get: function () {
            return this.c(SeriesViewer.s0);
        },
        set: function (a) {
            this.h(SeriesViewer.s0, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hy", {
        get: function () {
            return this.c(SeriesViewer.s3);
        },
        set: function (a) {
            this.h(SeriesViewer.s3, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hx", {
        get: function () {
            return this.c(SeriesViewer.sy);
        },
        set: function (a) {
            this.h(SeriesViewer.sy, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hu", {
        get: function () {
            return this.c(SeriesViewer.su);
        },
        set: function (a) {
            this.h(SeriesViewer.su, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hv", {
        get: function () {
            return this.c(SeriesViewer.sw);
        },
        set: function (a) {
            this.h(SeriesViewer.sw, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hw", {
        get: function () {
            return this.c(SeriesViewer.sx);
        },
        set: function (a) {
            this.h(SeriesViewer.sx, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h0", {
        get: function () {
            return this.c(SeriesViewer.s5);
        },
        set: function (a) {
            this.h(SeriesViewer.s5, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hz", {
        get: function () {
            return this.c(SeriesViewer.s4);
        },
        set: function (a) {
            this.h(SeriesViewer.s4, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ey", {
        get: function () {
            return this.c(SeriesViewer.s2);
        },
        set: function (a) {
            this.h(SeriesViewer.s2, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vs", {
        get: function () {
            return this.c(SeriesViewer.ue);
        },
        set: function (a) {
            this.h(SeriesViewer.ue, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vt", {
        get: function () {
            return this.c(SeriesViewer.ui);
        },
        set: function (a) {
            this.h(SeriesViewer.ui, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "il", {
        get: function () {
            return this.c(SeriesViewer.ul);
        },
        set: function (a) {
            this.h(SeriesViewer.ul, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ik", {
        get: function () {
            return this.c(SeriesViewer.ug);
        },
        set: function (a) {
            this.h(SeriesViewer.ug, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ii", {
        get: function () {
            return this.c(SeriesViewer.ud);
        },
        set: function (a) {
            this.h(SeriesViewer.ud, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ip", {
        get: function () {
            return this.c(SeriesViewer.uo);
        },
        set: function (a) {
            this.h(SeriesViewer.uo, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ne = function () {
        if (!this.al.g && !this.al.f && !this.c9.a.g && !this.c9.a.f) {
            this.pq();
        }
    };
    SeriesViewer.prototype.pq = function () {
        this.nc();
    };
    Object.defineProperty(SeriesViewer.prototype, "ij", {
        get: function () {
            return this.c(SeriesViewer.uf);
        },
        set: function (a) {
            this.h(SeriesViewer.uf, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "io", {
        get: function () {
            return this.c(SeriesViewer.un);
        },
        set: function (a) {
            this.h(SeriesViewer.un, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "im", {
        get: function () {
            return this.c(SeriesViewer.um);
        },
        set: function (a) {
            this.h(SeriesViewer.um, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "gj", {
        get: function () {
            return this.c(SeriesViewer.uk);
        },
        set: function (a) {
            this.h(SeriesViewer.uk, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ca = function () {
        if (this.cb == 0) {
            return 1;
        }
        return this.cb;
    };
    SeriesViewer.prototype.b5 = function () {
        if (this.b6 == 0) {
            return 3;
        }
        return this.b6;
    };
    SeriesViewer.prototype.bx = function () {
        if (this.bw == 0) {
            return 1;
        }
        if (this.by == 3 || this.by == 5) {
            if (this.bw == 2) {
                return 4;
            }
        }
        return this.bw;
    };
    Object.defineProperty(SeriesViewer.prototype, "bv", {
        get: function () {
            return this.bu;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b8", {
        get: function () {
            return this.b7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "b4", {
        get: function () {
            return this.b3;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bw", {
        get: function () {
            return EnumUtil.getEnumValue(SeriesHighlightingBehavior_$type, this.c(SeriesViewer.sq));
        },
        set: function (a) {
            this.h(SeriesViewer.sq, enumGetBox(SeriesHighlightingBehavior_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bd", {
        get: function () {
            return EnumUtil.getEnumValue(LegendHighlightingMode_$type, this.c(SeriesViewer.ta));
        },
        set: function (a) {
            this.h(SeriesViewer.ta, enumGetBox(LegendHighlightingMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "bf", {
        get: function () {
            return EnumUtil.getEnumValue(LegendItemBadgeShape_$type, this.c(SeriesViewer.tc));
        },
        set: function (a) {
            this.h(SeriesViewer.tc, enumGetBox(LegendItemBadgeShape_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "be", {
        get: function () {
            return EnumUtil.getEnumValue(LegendItemBadgeMode_$type, this.c(SeriesViewer.tb));
        },
        set: function (a) {
            this.h(SeriesViewer.tb, enumGetBox(LegendItemBadgeMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qm = function (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));
        }
    };
    SeriesViewer.prototype.pe = function () {
        this.pf(this.series);
    };
    SeriesViewer.prototype.pf = function (a) {
        var e_6, _a;
        try {
            for (var _b = __values(fromEn(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.a5;
                if (c == null) {
                    continue;
                }
                var d = b.st;
                if (d == null) {
                    continue;
                }
                if (c.containsChild(d)) {
                    c.removeChild(d);
                }
                if (!c.containsChild(d) && b.legendItemVisibility != 1) {
                    c.addChildInOrder(d, b);
                }
            }
        }
        catch (e_6_1) {
            e_6 = { error: e_6_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_6)
                    throw e_6.error;
            }
        }
    };
    SeriesViewer.prototype.pv = function (a, b, c, d) {
        this.qs(a, b, typeCast(MouseEventArgs.$, c), d);
    };
    SeriesViewer.prototype.pz = function (a, b, c, d) {
        this.qw(a, b, typeCast(MouseEventArgs.$, c), d);
    };
    SeriesViewer.prototype.pw = function (a, b, c, d) {
        this.qt(a, b, typeCast(MouseEventArgs.$, c), d);
    };
    SeriesViewer.prototype.px = function (a, b, c, d) {
        this.qu(a, b, typeCast(MouseButtonEventArgs.$, c), d);
    };
    SeriesViewer.prototype.py = function (a, b, c, d) {
        var e = typeCast(MouseButtonEventArgs.$, c);
        if (e != null) {
            this.qv(a, b, typeCast(MouseButtonEventArgs.$, c), d);
        }
        if (e != null) {
            if (!this.d7) {
                this.qp(a, b, typeCast(MouseButtonEventArgs.$, c), d);
            }
        }
    };
    SeriesViewer.prototype.m4 = function (a, b) {
        return null;
    };
    Object.defineProperty(SeriesViewer.prototype, "fp", {
        get: function () {
            return this.d7;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.op = function (a) {
        if (!this.d1 && a) {
            this.nh({ $type: Point_$type, x: NaN, y: NaN });
            this.d1 = true;
            this.d7 = true;
            if (this.viewerManipulationStarting != null) {
                var b = new SeriesViewerManipulationEventArgs();
                b.isDragZoom = true;
                this.viewerManipulationStarting(this, b);
            }
        }
    };
    SeriesViewer.prototype.on = function (a) {
        if (!this.d0 && a) {
            this.nh({ $type: Point_$type, x: NaN, y: NaN });
            this.d0 = true;
            this.d7 = true;
            if (this.viewerManipulationStarting != null) {
                var b = new SeriesViewerManipulationEventArgs();
                b.isDragSelect = true;
                this.viewerManipulationStarting(this, b);
            }
        }
    };
    SeriesViewer.prototype.p0 = function (a, b, c, d) {
    };
    SeriesViewer.prototype.p1 = function (a, b, c, d) {
    };
    SeriesViewer.prototype.qq = function (a, b) {
        if (this.seriesCursorMouseMove != null && this.er) {
            this.seriesCursorMouseMove(this, new ChartCursorEventArgs(this, a, b));
        }
    };
    SeriesViewer.prototype.qu = function (a, b, c, d) {
        if (this.seriesMouseLeftButtonDown != null) {
            this.seriesMouseLeftButtonDown(this, new DataChartMouseButtonEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.qv = function (a, b, c, d) {
        if (this.seriesMouseLeftButtonUp != null) {
            this.seriesMouseLeftButtonUp(this, new DataChartMouseButtonEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.qp = function (a, b, c, d) {
        var e = false;
        if (this.seriesClick != null) {
            var f = new DataChartMouseButtonEventArgs(this, a, b, c, d);
            this.seriesClick(this, f);
            e = f.cancelSelection;
        }
        if (a.isStacked) {
            return;
        }
        if (!e) {
            this.pt(a, b);
        }
    };
    SeriesViewer.prototype.pt = function (a, b) {
        if (b != null && this.b8 != 1) {
            if (a != null) {
                if (!a.ee(b)) {
                    return;
                }
                if (a.bn != null) {
                    if (a.dn != null) {
                        var c = a.dn.indexOf(b);
                        if (c >= 0 && a.bn.dn != null) {
                            b = a.bn.dn.item(c);
                            a = a.bn;
                        }
                    }
                }
            }
            var d = this.gq(a, b, this.b4);
            d = this.gs(d, this.b4);
            var e = this.gp(this.selectedSeriesItems, d, this.b4);
            for (var f = 0; f < e.count; f++) {
                this.selectedSeriesItems.remove(e._inner[f]);
            }
            for (var g = 0; g < d.count; g++) {
                this.selectedSeriesItems.add(d._inner[g]);
            }
        }
    };
    SeriesViewer.prototype.gs = function (a, b) {
        var e_7, _a, e_8, _b;
        var c = new List$1(ChartSelection.$, 0);
        var d = new List$1(ChartSelection.$, 0);
        try {
            for (var _c = __values(fromEnum(a)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var e = _d.value;
                if (this.selectedSeriesItems.contains(e)) {
                    c.add(e);
                }
                else {
                    d.add(e);
                }
            }
        }
        catch (e_7_1) {
            e_7 = { error: e_7_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_7)
                    throw e_7.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(c)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var f = _f.value;
                this.selectedSeriesItems.remove(f);
            }
        }
        catch (e_8_1) {
            e_8 = { error: e_8_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_8)
                    throw e_8.error;
            }
        }
        return d;
    };
    SeriesViewer.prototype.gt = function (a, b) {
        var c = new List$1(ChartSelection.$, 0);
        for (var d = 0; d < a.count; d++) {
            if (!this.fc(d, a, b)) {
                c.add(a._inner[d]);
            }
        }
        return c;
    };
    SeriesViewer.prototype.fc = function (a, b, c) {
        var d = b._inner[a];
        switch (c) {
            case 1: return d.series != null;
            case 2:
                if (d.series != null) {
                    return true;
                }
                for (var e = a + 1; e < b.count; e++) {
                    if (!Base.equalsStatic(d.item, b._inner[e].item)) {
                        return true;
                    }
                }
                return false;
            case 3: return d.series == null || d.item == null;
            case 4:
                if (d.series == null || d.item == null) {
                    return true;
                }
                for (var f = a + 1; f < b.count; f++) {
                    if (d.series == b._inner[f].series && !Base.equalsStatic(d.item, b._inner[f].item)) {
                        return true;
                    }
                }
                return false;
            case 5:
                if (d.series == null || d.item == null) {
                    return true;
                }
                for (var g = a + 1; g < b.count; g++) {
                    if (d.series != b._inner[g].series && !Base.equalsStatic(d.item, b._inner[g].item)) {
                        return true;
                    }
                }
                return false;
            case 6: return d.item != null;
            case 7:
                if (d.item != null) {
                    return true;
                }
                for (var h = a + 1; h < b.count; h++) {
                    if (d.series != b._inner[h].series) {
                        return true;
                    }
                }
                return false;
        }
        return false;
    };
    SeriesViewer.prototype.gp = function (a, b, c) {
        var e_9, _a;
        var d = new List$1(ChartSelection.$, 0);
        var e = new HashSet$1(ChartSelection.$, 0);
        try {
            for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var f = _c.value;
                this.nv(a, e, d, f, c);
            }
        }
        catch (e_9_1) {
            e_9 = { error: e_9_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_9)
                    throw e_9.error;
            }
        }
        return d;
    };
    SeriesViewer.prototype.nv = function (a, b, c, d, e) {
        var e_10, _a, e_11, _b, e_12, _c, e_13, _d, e_14, _e, e_15, _f, e_16, _g;
        switch (e) {
            case 1:
                try {
                    for (var _h = __values(fromEnum(a)), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var f = _j.value;
                        if (f.series != null) {
                            if (!b.contains(f)) {
                                b.add_1(f);
                                c.add(f);
                            }
                        }
                    }
                }
                catch (e_10_1) {
                    e_10 = { error: e_10_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_a = _h.return))
                            _a.call(_h);
                    }
                    finally {
                        if (e_10)
                            throw e_10.error;
                    }
                }
                break;
            case 2:
                try {
                    for (var _k = __values(fromEnum(a)), _l = _k.next(); !_l.done; _l = _k.next()) {
                        var g = _l.value;
                        if (g.series != null || (g.item != null && !Base.equalsStatic(g.item, d.item))) {
                            if (!b.contains(g)) {
                                b.add_1(g);
                                c.add(g);
                            }
                        }
                    }
                }
                catch (e_11_1) {
                    e_11 = { error: e_11_1 };
                }
                finally {
                    try {
                        if (_l && !_l.done && (_b = _k.return))
                            _b.call(_k);
                    }
                    finally {
                        if (e_11)
                            throw e_11.error;
                    }
                }
                break;
            case 3:
                try {
                    for (var _m = __values(fromEnum(a)), _o = _m.next(); !_o.done; _o = _m.next()) {
                        var h = _o.value;
                        if (h.item == null) {
                            if (!b.contains(h)) {
                                b.add_1(h);
                                c.add(h);
                            }
                        }
                    }
                }
                catch (e_12_1) {
                    e_12 = { error: e_12_1 };
                }
                finally {
                    try {
                        if (_o && !_o.done && (_c = _m.return))
                            _c.call(_m);
                    }
                    finally {
                        if (e_12)
                            throw e_12.error;
                    }
                }
                break;
            case 4:
                try {
                    for (var _p = __values(fromEnum(a)), _q = _p.next(); !_q.done; _q = _p.next()) {
                        var i = _q.value;
                        if (i.item == null || (i.series == d.series && i.item != null && !Base.equalsStatic(i.item, d.item))) {
                            if (!b.contains(i)) {
                                b.add_1(i);
                                c.add(i);
                            }
                        }
                    }
                }
                catch (e_13_1) {
                    e_13 = { error: e_13_1 };
                }
                finally {
                    try {
                        if (_q && !_q.done && (_d = _p.return))
                            _d.call(_p);
                    }
                    finally {
                        if (e_13)
                            throw e_13.error;
                    }
                }
                break;
            case 5:
                try {
                    for (var _r = __values(fromEnum(a)), _t = _r.next(); !_t.done; _t = _r.next()) {
                        var j = _t.value;
                        if (j.item == null || (j.series != null && j.series != d.series) || (j.item != null && !Base.equalsStatic(j.item, d.item))) {
                            if (!b.contains(j)) {
                                b.add_1(j);
                                c.add(j);
                            }
                        }
                    }
                }
                catch (e_14_1) {
                    e_14 = { error: e_14_1 };
                }
                finally {
                    try {
                        if (_t && !_t.done && (_e = _r.return))
                            _e.call(_r);
                    }
                    finally {
                        if (e_14)
                            throw e_14.error;
                    }
                }
                break;
            case 6:
                try {
                    for (var _u = __values(fromEnum(a)), _v = _u.next(); !_v.done; _v = _u.next()) {
                        var k = _v.value;
                        if (k.item != null) {
                            if (!b.contains(k)) {
                                b.add_1(k);
                                c.add(k);
                            }
                        }
                    }
                }
                catch (e_15_1) {
                    e_15 = { error: e_15_1 };
                }
                finally {
                    try {
                        if (_v && !_v.done && (_f = _u.return))
                            _f.call(_u);
                    }
                    finally {
                        if (e_15)
                            throw e_15.error;
                    }
                }
                break;
            case 7:
                try {
                    for (var _w = __values(fromEnum(a)), _x = _w.next(); !_x.done; _x = _w.next()) {
                        var l = _x.value;
                        if (l.item != null || l.series != d.series) {
                            if (!b.contains(l)) {
                                b.add_1(l);
                                c.add(l);
                            }
                        }
                    }
                }
                catch (e_16_1) {
                    e_16 = { error: e_16_1 };
                }
                finally {
                    try {
                        if (_x && !_x.done && (_g = _w.return))
                            _g.call(_w);
                    }
                    finally {
                        if (e_16)
                            throw e_16.error;
                    }
                }
                break;
        }
    };
    SeriesViewer.prototype.gq = function (a, b, c) {
        var d = new List$1(ChartSelection.$, 0);
        switch (c) {
            case 1:
            case 2:
                d.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = b;
                    return $ret;
                })()));
                break;
            case 3:
            case 4:
            case 5:
                d.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.item = b;
                    $ret.series = a;
                    return $ret;
                })()));
                break;
            case 6:
            case 7:
                d.add(((function () {
                    var $ret = new ChartSelection();
                    $ret.series = a;
                    return $ret;
                })()));
                break;
        }
        return d;
    };
    SeriesViewer.prototype.rg = function (a) {
        this.bb.f$as(this, a);
    };
    SeriesViewer.prototype.rh = function (a) {
        a = { $type: Point_$type, x: a.x - this.wk.left, y: a.y - this.wk.top };
        var b = this.vy(a);
        if (this.f7) {
            this.nh(b);
        }
        else {
            var c = this.bv;
            var d = c == 2 || c == 3 || c == 4;
            if (d) {
                this.rp(b);
                for (var e = 0; e < this.series.count; e++) {
                    var f = this.series._inner[e];
                    f.sn(b);
                    if (f.isStacked) {
                        f.p2(function (g) {
                            if (g.eg) {
                                g.p0(function (h) {
                                    h.sn(b);
                                    return true;
                                });
                            }
                            g.sn(b);
                            return true;
                        });
                    }
                    if (f.eg) {
                        f.p0(function (g) {
                            g.sn(b);
                            return true;
                        });
                    }
                }
            }
        }
    };
    SeriesViewer.prototype.qw = function (a, b, c, d) {
        if (this.seriesMouseMove != null) {
            this.seriesMouseMove(this, new ChartMouseEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.qs = function (a, b, c, d) {
        if (this.seriesMouseEnter != null) {
            this.seriesMouseEnter(this, new ChartMouseEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.qt = function (a, b, c, d) {
        if (this.seriesMouseLeave != null) {
            this.seriesMouseLeave(this, new ChartMouseEventArgs(this, a, b, c, d));
        }
    };
    SeriesViewer.prototype.oo = function () {
        if (this.d1) {
            this.d1 = false;
            if (this.viewerManipulationEnding != null) {
                var a = new SeriesViewerManipulationEventArgs();
                a.isDragZoom = true;
                this.viewerManipulationEnding(this, a);
            }
        }
    };
    SeriesViewer.prototype.om = function () {
        if (this.d0) {
            this.d0 = false;
            if (this.viewerManipulationEnding != null) {
                var a = new SeriesViewerManipulationEventArgs();
                a.isDragSelect = true;
                this.viewerManipulationEnding(this, a);
            }
        }
    };
    SeriesViewer.prototype.get_wk = function () {
        return this.v3;
    };
    Object.defineProperty(SeriesViewer.prototype, "wk", {
        get: function () {
            return this.get_wk();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "v8", {
        get: function () {
            return this.v1;
        },
        set: function (a) {
            this.v1 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.get_ex = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "ex", {
        get: function () {
            return this.get_ex();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wd = function (a, b, c) {
        if (c.isEmpty) {
            return c;
        }
        var d = c;
        var e = b;
        var f = (d.left - e.left) / e.width;
        var g = (d.top - e.top) / e.height;
        var h = (d.right - e.left) / e.width;
        var i = (d.bottom - e.top) / e.height;
        f = a.left + f * a.width;
        g = a.top + g * a.height;
        h = a.left + h * a.width;
        i = a.top + i * a.height;
        return new Rect(0, f, g, h - f, i - g);
    };
    SeriesViewer.prototype.get_v7 = function () {
        if (this.dy) {
            this.dy = false;
            var a = this.wb(this.wk, this.v8, this.v4);
            this.v0 = a;
        }
        return this.v0;
    };
    Object.defineProperty(SeriesViewer.prototype, "v7", {
        get: function () {
            return this.get_v7();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wb = function (a, b, c) {
        var d = b;
        var e = c;
        var f = a;
        if (f.isEmpty) {
            return Rect.empty;
        }
        if (d.isEmpty) {
            return a;
        }
        var g = (d.left - f.left) / f.width;
        var h = (d.right - f.left) / f.width;
        var i = (d.top - f.top) / f.height;
        var j = (d.bottom - f.top) / f.height;
        g = f.left + (g - e.left) / e.width * f.width;
        h = f.left + (h - e.left) / e.width * f.width;
        i = f.top + (i - e.top) / e.height * f.height;
        j = f.top + (j - e.top) / e.height * f.height;
        var k = new Rect(0, g, i, h - g, j - i);
        k.intersect(f);
        return k;
    };
    SeriesViewer.prototype.v6 = function (a) {
        this.dy = true;
        if (this.ev()) {
            if (a.isEmpty) {
                return Rect.empty;
            }
            var b = void 0;
            if (a.width > a.height) {
                var c = intDivide(truncate((a.width - a.height)), 2);
                b = new Rect(0, a.left + c, a.top, a.height, a.height);
            }
            else {
                var d = intDivide(truncate((a.height - a.width)), 2);
                b = new Rect(0, a.left, a.top + d, a.width, a.width);
            }
            return b;
        }
        return Rect.empty;
    };
    SeriesViewer.prototype.wc = function () {
        return this.wk;
    };
    SeriesViewer.prototype.rl = function (a) {
        a.kh = this.wk;
    };
    Object.defineProperty(SeriesViewer.prototype, "i1", {
        get: function () {
            return this.ix;
        },
        set: function (a) {
            this.ix = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qg = function (a, b) {
        if (!b.isEmpty) {
            this.v3 = b;
            this.v1 = this.v6(this.v3);
            this.c9.eq(this.v3);
        }
        if (this.ev()) {
            if (this.actualSyncLink != null) {
                this.rx(this.v4, false);
            }
        }
        this.pp(a, b);
        if (this.em) {
            this.bc.updateScrollbars(this, this.v4, this.v4, a, b);
        }
    };
    SeriesViewer.prototype.cd = function () {
        return this.cc;
    };
    SeriesViewer.prototype.nd = function (a, b) {
        var c = false;
        c = true;
        if (this.wk.containsPoint(a)) {
            if (!this.d5) {
                this.d5 = true;
                if (this.plotAreaMouseEnter != null) {
                    var d = this.bl(a, false, c);
                    d.isDuringManipulation = b;
                    this.plotAreaMouseEnter(this, d);
                }
            }
            else {
                this.d5 = true;
                if (this.plotAreaMouseOver != null) {
                    var e = this.bl(a, false, c);
                    e.isDuringManipulation = b;
                    this.plotAreaMouseOver(this, e);
                }
            }
        }
        else {
            if (this.d5) {
                this.d5 = false;
                if (this.plotAreaMouseLeave != null) {
                    var f = this.bl(a, false, c);
                    f.isDuringManipulation = b;
                    this.plotAreaMouseLeave(this, f);
                }
            }
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "av", {
        get: function () {
            return this.at;
        },
        set: function (a) {
            var b = this.at;
            this.at = a;
            if (b != this.at) {
                this.qm("ContentHitTestMode", enumGetBox(ChartHitTestMode_$type, b), enumGetBox(ChartHitTestMode_$type, this.at));
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qy = function () {
        this.au = this.aw();
    };
    SeriesViewer.prototype.aw = function () {
        if (!this.fa) {
            return 1;
        }
        return this.bb.f$a(this);
    };
    Object.defineProperty(SeriesViewer.prototype, "au", {
        get: function () {
            return this.as;
        },
        set: function (a) {
            var b = this.as;
            this.as = a;
            if (b != this.as) {
                this.qm("ActualContentHitTestMode", enumGetBox(ChartHitTestMode_$type, b), enumGetBox(ChartHitTestMode_$type, this.as));
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.queueForAnimationIdle = function (a, b) {
        this.dv.j(a, b);
    };
    SeriesViewer.prototype.getAnimationIdleVersionNumber = function () {
        return this.dv.f();
    };
    SeriesViewer.prototype.isAnimationActive = function () {
        for (var a = 0; a < this.series.count; a++) {
            if (this.series._inner[a].d3()) {
                return true;
            }
        }
        if (this.dc.f()) {
            return true;
        }
        return false;
    };
    SeriesViewer.prototype.pu = function (a) {
        this.p2();
    };
    SeriesViewer.prototype.o7 = function () {
        this.p2();
    };
    SeriesViewer.prototype.p2 = function () {
        if (!this.isAnimationActive()) {
            this.dv.h();
        }
    };
    SeriesViewer.prototype.qo = function (a) {
        if (this.seriesAnimating != null) {
            this.seriesAnimating(a);
        }
    };
    SeriesViewer.prototype.fk = function () {
        return this.fl() || this.fm();
    };
    SeriesViewer.prototype.onDetachedFromUI = function () {
        this.d4 = true;
        this.c9.c2();
        SyncManager.e(this);
    };
    SeriesViewer.prototype.onAttachedToUI = function () {
        this.d4 = false;
        this.c9.cw();
        SyncManager.c(this);
    };
    Object.defineProperty(SeriesViewer.prototype, "c0", {
        get: function () {
            return this.cv;
        },
        set: function (a) {
            if (this.c0 != a) {
                var b = this.cv;
                this.cv = a;
                if (this.fa) {
                    this.bb.f$aj(this);
                }
                if (b == 1 && this.cv != 1) {
                    this.oo();
                }
                if (b == 3 && this.cv != 3) {
                    this.om();
                }
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ph = function (a) {
        this.nh(this.vy(a));
    };
    SeriesViewer.prototype.pi = function (a, b) {
        var c = false;
        c = false;
        this.nh({ $type: Point_$type, x: NaN, y: NaN });
        if (this.d5) {
            this.d5 = false;
            if (this.plotAreaMouseLeave != null) {
                var d = this.bl(a, false, c);
                d.isDuringManipulation = b;
                this.plotAreaMouseLeave(this, d);
            }
        }
    };
    SeriesViewer.prototype.fx = function (a, b) {
        return this.bb.f$h(this, a, b);
    };
    SeriesViewer.prototype.o0 = function (a) {
        this.bb.f$r(this, a);
    };
    SeriesViewer.prototype.fw = function (a) {
        return this.bb.f$g(this, a);
    };
    Object.defineProperty(SeriesViewer.prototype, "el", {
        get: function () {
            return this.dz;
        },
        set: function (a) {
            this.dz = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.get_fb = function () {
        return this.ep || this.gg();
    };
    Object.defineProperty(SeriesViewer.prototype, "fb", {
        get: function () {
            return this.get_fb();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.o2 = function (a) {
        this.bb.f$t(this, a);
    };
    Object.defineProperty(SeriesViewer.prototype, "eu", {
        get: function () {
            return this.dz;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pm = function (a) {
        this.bb.f$ah(this, a);
    };
    SeriesViewer.prototype.o3 = function (a, b) {
        this.bb.f$u(this, a, b);
    };
    SeriesViewer.prototype.o1 = function (a) {
        this.bb.f$s(this, a);
    };
    Object.defineProperty(SeriesViewer.prototype, "fy", {
        get: function () {
            return this.d9;
        },
        set: function (a) {
            this.d9 = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.qb = function () {
        this.bb.f$ao(this);
    };
    SeriesViewer.prototype.pl = function (a) {
        this.bb.f$ag(this, a);
    };
    SeriesViewer.prototype.qc = function (a, b, c, d) {
        this.bb.f$ap(this, a, b, c, d);
    };
    SeriesViewer.prototype.pk = function (a) {
        this.bb.f$af(this, a);
    };
    SeriesViewer.prototype.p8 = function (a, b, c, d) {
        this.bb.f$al(this, a, b, c, d);
    };
    SeriesViewer.prototype.pg = function (a) {
        this.bb.f$ac(this, a);
    };
    SeriesViewer.prototype.pj = function (a) {
        this.bb.f$ae(this, a);
    };
    SeriesViewer.prototype.o6 = function (a) {
        this.bb.f$v(this, a);
    };
    SeriesViewer.prototype.p7 = function (a, b, c, d) {
        this.bb.f$ak(this, a, b, c, d);
    };
    SeriesViewer.prototype.p4 = function () {
        this.d7 = false;
    };
    SeriesViewer.prototype.o9 = function (a) {
        this.c9.ej(a.height);
    };
    SeriesViewer.prototype.nw = function () {
        if (this.dz) {
            this.nh({ $type: Point_$type, x: NaN, y: NaN });
            this.c9.ch();
        }
        this.dz = false;
    };
    SeriesViewer.prototype.ot = function (a, b) {
        this.bb.f$q(this, a, b);
    };
    SeriesViewer.prototype.cy = function (a) {
        var b = this.c9.k != null && this.c9.k.al ? this.cz : this.cw;
        if (b != 4) {
            return b;
        }
        return this.c9.m(a);
    };
    SeriesViewer.prototype.qa = function (a) {
        this.ee = false;
        if (!this.ef) {
            this.nh({ $type: Point_$type, x: NaN, y: NaN });
            if (a) {
                this.ef = true;
                this.d7 = true;
                if (this.viewerManipulationStarting != null) {
                    var b = new SeriesViewerManipulationEventArgs();
                    b.isZoomPan = true;
                    this.viewerManipulationStarting(this, b);
                }
            }
        }
        this.bb.f$an(this);
    };
    SeriesViewer.prototype.p9 = function () {
        if (this.ef) {
            this.ef = false;
            if (this.viewerManipulationEnding != null) {
                var a = new SeriesViewerManipulationEventArgs();
                a.isZoomPan = true;
                this.viewerManipulationEnding(this, a);
            }
        }
        this.bb.f$am(this);
    };
    SeriesViewer.prototype.ri = function () {
        this.bb.f$at(this);
    };
    SeriesViewer.prototype.nl = function () {
        if (this.ee) {
            this.ox();
        }
        this.bb.f$n(this);
    };
    SeriesViewer.prototype.ng = function () {
        this.nf();
    };
    SeriesViewer.prototype.nf = function () {
        if (this.fa) {
            this.bb.f$k(this);
        }
    };
    SeriesViewer.prototype.qe = function () {
    };
    SeriesViewer.prototype.q2 = function () {
    };
    SeriesViewer.prototype.q0 = function () {
        for (var a = 0; a < this.series.count; a++) {
            this.series._inner[a].rq(false);
        }
        this.nr(false, false, true);
    };
    SeriesViewer.prototype.os = function (a, b) {
        this.bb.f$p(this, a, b);
    };
    SeriesViewer.prototype.f4 = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "ga", {
        get: function () {
            return this.ea;
        },
        set: function (a) {
            this.ea = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.or = function (a, b, c) {
        this.bb.f$o(this, a, b, c);
    };
    SeriesViewer.prototype.ru = function (a, b) {
        if (b.propertyName == SyncSettings.$$p[0]) {
            SyncManager.b(this, b.oldValue, b.newValue);
        }
    };
    SeriesViewer.prototype.rt = function (a, b) {
        var e_17, _a;
        if (a != null) {
            a.as(this);
            a.propertyUpdated = delegateRemove(a.propertyUpdated, this.propertyUpdated);
        }
        if (b != null) {
            b.al(this);
            b.propertyUpdated = delegateCombine(b.propertyUpdated, this.propertyUpdated);
        }
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.c3 = this.actualSyncLink;
                c.db = this;
            }
        }
        catch (e_17_1) {
            e_17 = { error: e_17_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_17)
                    throw e_17.error;
            }
        }
    };
    SeriesViewer.prototype.nh = function (a) {
        if (this.em) {
            this.bc.onCrosshairMoved(this.vw(a));
        }
        this.actualSyncLink.an(this, a);
    };
    SeriesViewer.prototype.rx = function (a, b) {
        this.ry(a, b, !b);
    };
    SeriesViewer.prototype.ry = function (a, b, c) {
        if (!b) {
            this.actualSyncLink.au(this, a, c);
        }
        else {
            if (!this.fl() && !this.fm()) {
                return;
            }
            var d = !a.isEmpty && !isNaN_(a.x) && !isNaN_(a.y) && !isNaN_(a.width) && !isNaN_(a.height);
            var e = a;
            if (d && !this.f6) {
                if (e.width < this.hm) {
                    return;
                }
                else if (e.height < this.hl) {
                    return;
                }
            }
            if (d && !this.fl()) {
                e = new Rect(0, 0, a.y, 1, a.height);
            }
            if (d && !this.fm()) {
                e = new Rect(0, a.x, 0, a.width, 1);
            }
            this.actualSyncLink.at(this, e);
        }
    };
    SeriesViewer.prototype.qf = function (a, b) {
        if (!b) {
            this.actualSyncLink.ap(this, a);
        }
        else {
            if (!this.fl() && !this.fm()) {
                return;
            }
            var c = !a.isEmpty && !isNaN_(a.x) && !isNaN_(a.y) && !isNaN_(a.width) && !isNaN_(a.height);
            var d = a;
            if (c && !this.fl()) {
                d = new Rect(0, 0, a.y, 1, a.height);
            }
            if (c && !this.fm()) {
                d = new Rect(0, a.x, 0, a.width, 1);
            }
            this.actualSyncLink.ap(this, d);
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "fg", {
        get: function () {
            return this.actualSyncLink != null;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype._gm = function () {
        var _a, _b, a, e_18_1;
        var e_18, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    if (this.actualSyncLink == null) {
                        return [2 /*return*/, undefined];
                    }
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(this.actualSyncLink.ai)), _b = _a.next();
                    _d.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    a = _b.value;
                    return [4 /*yield*/, a];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_18_1 = _d.sent();
                    e_18 = { error: e_18_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_18)
                            throw e_18.error;
                    }
                    return [7 /*endfinally*/];
                case 8: return [2 /*return*/];
            }
        });
    };
    SeriesViewer.prototype.gm = function () {
        var _this = this;
        return toEnum(function () { return _this._gm(); });
    };
    SeriesViewer.prototype.vy = function (a) {
        a = { $type: Point_$type, x: a.x + this.wk.left, y: a.y + this.wk.top };
        var b = this.v7;
        var c = ViewportUtils.b(a.x, this.v4, this.wk, this.v8);
        var d = ViewportUtils.g(a.y, this.v4, this.wk, this.v8);
        return { $type: Point_$type, x: c, y: d };
    };
    SeriesViewer.prototype.vw = function (a) {
        var b = this.v7;
        var c = ViewportUtils.e(a.x, this.v4, this.wk, this.v8);
        var d = ViewportUtils.i(a.y, this.v4, this.wk, this.v8);
        return { $type: Point_$type, x: c, y: d };
    };
    SeriesViewer.prototype.wj = function (a) {
        var b = this.vy({ $type: Point_$type, x: a.left, y: a.top });
        var c = this.vy({ $type: Point_$type, x: a.right, y: a.bottom });
        return new Rect(0, b.x, b.y, c.x - b.x, c.y - b.y);
    };
    SeriesViewer.prototype.qx = function (a, b) {
        if (this.windowRectChanged != null && Rect.l_op_Inequality(a, b)) {
            this.windowRectChanged(this, new RectChangedEventArgs(a, b));
        }
    };
    SeriesViewer.prototype.p6 = function (a, b) {
        this.qx(a, b);
    };
    SeriesViewer.prototype.p3 = function (a, b) {
        if (this.sizeChanged != null && Size.l_op_Inequality(a, b)) {
            this.sizeChanged(this, new RectChangedEventArgs(new Rect(1, 0, 0, a), new Rect(1, 0, 0, b)));
        }
    };
    SeriesViewer.prototype.f0 = function (a, b) {
        if (a.width != b.width || a.height != b.height || a.x != b.x || a.y != b.y) {
            return true;
        }
        return false;
    };
    SeriesViewer.prototype.qj = function (a, b) {
        if (this.actualWindowRectChanged != null && this.f0(a, b)) {
            this.actualWindowRectChanged(this, new RectChangedEventArgs(a, b));
        }
    };
    SeriesViewer.prototype.rz = function (a) {
        if (isNaN_(a) || isInfinity(a)) {
            a = 0.05;
        }
        var b = this.hs() - a;
        var c = this.hs() - a;
        var d = this.hj + (a / 2);
        var e = this.hk + (a / 2);
        this.wl = new Rect(0, d, e, b, c);
    };
    SeriesViewer.prototype.r0 = function (a) {
        this.rz(a * -1);
    };
    SeriesViewer.prototype.q8 = function () {
        this.c9.d2();
    };
    SeriesViewer.prototype.qk = function (a, b) {
        if (this.gridAreaRectChanged != null && Rect.l_op_Inequality(a, b)) {
            this.gridAreaRectChanged(this, new RectChangedEventArgs(a, b));
        }
    };
    SeriesViewer.prototype.get_fd = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fd", {
        get: function () {
            return this.get_fd();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pp = function (a, b) {
        this.qk(a, b);
        if (this.fa) {
            this.bb.f$ar(this);
        }
        if (this.fd && (Rect.l_op_Equality(a, null) || a.isEmpty || a.width == 0 || a.height == 0)) {
            this.rx(this.wl, false);
        }
        else {
            this.n1();
        }
        if (a.isEmpty || a.width == 0 || a.height == 0) {
            this.ob();
        }
    };
    SeriesViewer.prototype.n5 = function () {
        this.n1();
    };
    Object.defineProperty(SeriesViewer.prototype, "hm", {
        get: function () {
            return this.g0;
        },
        set: function (a) {
            var b = this.g0;
            this.g0 = a;
            this.qm("ActualWindowRectMinWidth", b, this.g0);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hl", {
        get: function () {
            return this.gz;
        },
        set: function (a) {
            var b = this.gz;
            this.gz = a;
            this.qm("ActualWindowRectMinHeight", b, this.gz);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "syncChannel", {
        get: function () {
            return this._syncChannel;
        },
        set: function (a) {
            this._syncChannel = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "actualSyncLink", {
        get: function () {
            return this.cm;
        },
        set: function (a) {
            var b = this.cm;
            this.cm = a;
            this.qm("ActualSyncLink", b, this.cm);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.n3 = function () {
        this.c9.d3();
    };
    SeriesViewer.prototype.oy = function () {
        this.ee = true;
    };
    SeriesViewer.prototype.ow = function () {
        this.ee = false;
    };
    SeriesViewer.prototype.ox = function () {
        if (this.ee) {
            if (this.ef) {
                this.ef = false;
                if (!this.d1) {
                    if (this.viewerManipulationEnding != null) {
                        var a = new SeriesViewerManipulationEventArgs();
                        a.isZoomPan = true;
                        this.viewerManipulationEnding(this, a);
                    }
                    this.d7 = false;
                }
            }
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "c2", {
        get: function () {
            return this.c9.i().a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rq = function (a) {
        if (this.c2 != null) {
            this.c2.mobileMode = a;
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "cr", {
        get: function () {
            return this.cq;
        },
        set: function (a) {
            this.cq = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.cs = function () {
        if (this.ct == 0) {
            return 1;
        }
        return this.ct;
    };
    SeriesViewer.prototype.eq = function () {
        return this.c0 == 0 && !this.d9 && !this.ea;
    };
    SeriesViewer.prototype.ei = function () {
        if (this.actualSyncLink != null && this.actualSyncLink.ai.count > 0) {
            var a = true;
            a = this.eq();
            if (!a) {
                return false;
            }
            for (var b = 0; b < this.actualSyncLink.ai.count; b++) {
                if (!this.actualSyncLink.ai.item(b).eq()) {
                    return false;
                }
            }
            return true;
        }
        else {
            return this.eq();
        }
    };
    SeriesViewer.prototype.na = function () {
        if (this.c0 == 2) {
            this.c9.bt();
            this.c0 = 0;
            this.p9();
            this.qf(Rect.empty, true);
            if (this.cp == 1) {
                this.rx(this.wm, true);
            }
        }
        if (this.c0 == 1 || this.c0 == 3) {
            this.c9.bt();
            this.c0 = 0;
            this.p9();
            this.c9.cf();
            this.qf(Rect.empty, true);
        }
    };
    SeriesViewer.prototype.notifyCrosshairUpdate = function () {
    };
    SeriesViewer.prototype.rv = function (a, b) {
        var c = this.hm;
        var d = this.hl;
        this.wl = new Rect(0, this.hj, this.hk, MathUtil.d(a, c, 1), MathUtil.d(b, d, 1));
    };
    SeriesViewer.prototype.rw = function (a, b, c, d) {
        if (!MathUtil.a(a) || a < 0 || a >= 1) {
            a = this.hj;
        }
        if (!MathUtil.a(b) || b < 0 || b >= 1) {
            b = this.hk;
        }
        if (!MathUtil.a(d)) {
            d = this.ht();
        }
        if (!MathUtil.a(c)) {
            c = this.hs();
        }
        this.wl = new Rect(0, a, b, MathUtil.d(c, this.hm, 1), MathUtil.d(d, this.hl, 1));
    };
    SeriesViewer.prototype.hs = function () {
        return 1;
    };
    SeriesViewer.prototype.ht = function () {
        return 1;
    };
    SeriesViewer.prototype.h6 = function () {
        if (this.it > 0) {
            return this.it;
        }
        var a = Rect.l_op_Inequality(this.wk, null) && !this.wk.isEmpty && MathUtil.a(this.wk.width);
        var b = MathUtil.a(this.iv);
        if (b && a) {
            var c = this.iv / this.wk.width;
            if (c <= 0 || c >= 1) {
                c = 0.0001;
            }
            return c;
        }
        return 0.0001;
    };
    SeriesViewer.prototype.h5 = function () {
        if (this.is > 0) {
            return this.is;
        }
        var a = Rect.l_op_Inequality(this.wk, null) && !this.wk.isEmpty && MathUtil.a(this.wk.height);
        var b = MathUtil.a(this.iu);
        if (b && a) {
            var c = this.iu / this.wk.height;
            if (c <= 0 || c >= 1) {
                c = 0.0001;
            }
            return c;
        }
        return 0.0001;
    };
    SeriesViewer.prototype.qh = function (a, b, c, d) {
        var e_19, _a, e_20, _b, e_21, _c;
        switch (b) {
            case SeriesViewer.$$p[44]:
                this.c9.dj();
                break;
            case SeriesViewer.$$p[41]:
                this.c9.dj();
                break;
            case SeriesViewer.$$p[56]:
                this.cr = this.cs();
                break;
            case "HorizontalViewScrollbarMode":
                this.cf = this.ch;
                if (this.eo || this.fa) {
                    this.bc.onHorizontalScrollbarModeChanged(this.cf);
                }
                break;
            case "VerticalViewScrollbarMode":
                this.cg = this.ci;
                if (this.eo || this.fa) {
                    this.bc.onVerticalScrollbarModeChanged(this.cg);
                }
                break;
            case "ActualContentHitTestMode":
                this.oj();
                break;
            case "ContentHitTestMode":
                this.qy();
                break;
            case SeriesViewer.$$p[43]:
                this.c9.dh(c, d);
                this.c9.dj();
                break;
            case SeriesViewer.$$p[40]:
                this.c9.dd(c, d);
                this.c9.dj();
                break;
            case "TitleTextStyle":
            case "TitleTextColor":
            case "SubtitleTextStyle":
            case "SubtitleTextColor":
            case "TitleTopMargin":
            case "TitleLeftMargin":
            case "TitleRightMargin":
            case "TitleBottomMargin":
            case "SubtitleTopMargin":
            case "SubtitleLeftMargin":
            case "SubtitleRightMargin":
            case "SubtitleBottomMargin":
                this.c9.dj();
                break;
            case SeriesViewer.$$p[28]:
            case SeriesViewer.$$p[29]:
            case SeriesViewer.$$p[30]:
                this.c9.db();
                break;
            case "PixelScalingRatio":
                if (isNaN_(DeviceUtils.a(this.h3))) {
                    this.n0();
                }
                else {
                    this.hi = DeviceUtils.a(this.h3);
                }
                break;
            case "InteractionPixelScalingRatio":
                this.hh = this.h1;
                break;
            case "ActualPixelScalingRatio":
                this.c9.dq();
                break;
            case SeriesViewer.$$p[15]:
                this.c9.cp();
                break;
            case "ActualSyncLink":
                this.rt(typeCast(SyncLink.$, c), typeCast(SyncLink.$, d));
                break;
            case SeriesViewer.$$p[3]:
                if (!this.e0) {
                    this.gh = true;
                }
                if (this.wp == 0) {
                    this.er = true;
                }
                else {
                    this.er = this.eg;
                }
                if (this.fa) {
                    this.bb.f$ar(this);
                }
                break;
            case "CrosshairPoint":
                if (this.fa) {
                    if (this.fv) {
                        this.rp(this.vv);
                    }
                    this.bb.f$ar(this);
                }
                this.notifyCrosshairUpdate();
                break;
            case SeriesViewer.$$p[52]:
                if (this.actualSyncLink != null) {
                    this.i0++;
                    this.rx(d, false);
                    this.i0--;
                }
                if (!this.wl.equals1(c) && this.i0 == 0) {
                    this.p6(c, this.wl);
                }
                this.n1();
                break;
            case SeriesViewer.$$p[48]:
                this.hj = this.iq;
                break;
            case SeriesViewer.$$p[49]:
                this.hk = this.ir;
                break;
            case "ActualWindowPositionVertical":
            case "ActualWindowPositionHorizontal":
                if (!this.gc) {
                    this.rv(this.hs(), this.ht());
                }
                break;
            case SeriesViewer.$$p[51]:
            case SeriesViewer.$$p[55]:
                this.hm = this.h6();
                break;
            case SeriesViewer.$$p[50]:
            case SeriesViewer.$$p[54]:
                this.hl = this.h5();
                break;
            case SeriesViewer.$$p[16]:
                this.c9.c5();
                break;
            case SeriesViewer.$$p[12]:
                this.dc.r = this.i5;
                break;
            case SeriesViewer.$$p[36]:
                this.de.r = this.i7;
                break;
            case SeriesViewer.$$p[8]:
                this.db.r = this.i3;
                break;
            case SeriesViewer.$$p[21]:
                this.rs();
                break;
            case "ActualWindowRect":
                this.dy = true;
                if (this.f0(c, d)) {
                    this.m5(c, d);
                }
                if (d.width == 1 && d.height == 1 && c.isEmpty) {
                    this.gk = true;
                }
                this.qj(c, d);
                break;
            case SeriesViewer.$$p[25]:
                this.c9.da(d);
                break;
            case SeriesViewer.$$p[46]:
                this.eh = this.gi;
                break;
            case SeriesViewer.$$p[57]:
                this.i1 = this.i8;
                this.nf();
                break;
            case SeriesViewer.$$p[27]:
                this.bb.f$ai(this);
                break;
            case "HighlightingMode":
            case "HighlightingBehavior":
                this.bu = this.bx();
                if (this.fa) {
                    var e = this.dl;
                    e.retainMainShapes = this.bv == 3;
                    e.isExclusiveHighlight = this.bv == 1;
                }
                break;
            case "SelectionMode":
                this.b7 = this.ca();
                if (this.b7 == 1 && this.selectedSeriesItems.count > 0) {
                    this.selectedSeriesItems.clear();
                }
                if (this.fa) {
                    var f = this.dm;
                }
                break;
            case "SelectionBehavior":
                this.b3 = this.b5();
                if (this.fa) {
                    var g = this.dm;
                }
                break;
            case "LegendItemBadgeShape":
                try {
                    for (var _d = __values(fromEnum(this.series)), _e = _d.next(); !_e.done; _e = _d.next()) {
                        var h = _e.value;
                        h.legendItemBadgeShape = this.bf;
                    }
                }
                catch (e_19_1) {
                    e_19 = { error: e_19_1 };
                }
                finally {
                    try {
                        if (_e && !_e.done && (_a = _d.return))
                            _a.call(_d);
                    }
                    finally {
                        if (e_19)
                            throw e_19.error;
                    }
                }
                break;
            case "LegendItemBadgeMode":
                try {
                    for (var _f = __values(fromEnum(this.series)), _g = _f.next(); !_g.done; _g = _f.next()) {
                        var i = _g.value;
                        i.bd = this.be;
                    }
                }
                catch (e_20_1) {
                    e_20 = { error: e_20_1 };
                }
                finally {
                    try {
                        if (_g && !_g.done && (_b = _f.return))
                            _b.call(_f);
                    }
                    finally {
                        if (e_20)
                            throw e_20.error;
                    }
                }
                break;
            case SeriesViewer.$$p[1]:
            case SeriesViewer.$$p[20]:
            case SeriesViewer.$$p[18]:
            case SeriesViewer.$$p[19]:
            case SeriesViewer.$$p[17]:
                try {
                    for (var _h = __values(fromEnum(this.series)), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var j = _j.value;
                        j.qf();
                    }
                }
                catch (e_21_1) {
                    e_21 = { error: e_21_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_c = _h.return))
                            _c.call(_h);
                    }
                    finally {
                        if (e_21)
                            throw e_21.error;
                    }
                }
                break;
            case "HorizontalViewScrollbarCornerRadius":
            case "HorizontalViewScrollbarFill":
            case "HorizontalViewScrollbarMaxOpacity":
            case "HorizontalViewScrollbarOutline":
            case "HorizontalViewScrollbarStrokeThickness":
            case "VerticalViewScrollbarCornerRadius":
            case "VerticalViewScrollbarFill":
            case "VerticalViewScrollbarMaxOpacity":
            case "VerticalViewScrollbarOutline":
            case "VerticalViewScrollbarStrokeThickness":
                if (this.fa) {
                    this.bc.updateBarAppearance(this, this.vi, this.vs, this.vj, this.vt, this.hy, this.il, this.hx, this.ik);
                }
                break;
            case "HorizontalViewScrollbarHeight":
            case "HorizontalViewScrollbarInset":
            case SeriesViewer.kj:
            case "HorizontalViewScrollbarTrackStartInset":
            case "HorizontalViewScrollbarTrackEndInset":
                if (this.fa) {
                    this.bc.updateBarDimensions(this, this.hv, this.hu, this.hw, this.ey, this.h0, this.hz, this.ip, this.ii, this.ij, this.gj, this.io, this.im);
                }
                break;
            case "VerticalViewScrollbarPosition":
                if (this.fa) {
                    this.bc.updateVerticalScrollbarPosition(this.cl);
                }
                break;
            case "HorizontalViewScrollbarPosition":
                if (this.fa) {
                    this.bc.updateHorizontalScrollbarPosition(this.ce);
                }
                break;
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "e7", {
        get: function () {
            return this.bv == 2 || this.bv == 3 || this.bv == 4;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "fv", {
        get: function () {
            return this.bv == 2 || this.bv == 3 || this.bv == 4;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.rp = function (a) {
        var _this = this;
        var b = 1.7976931348623157E+308;
        var c = null;
        for (var d = 0; d < this.series.count; d++) {
            var e = this.series._inner[d];
            if (e.es) {
                continue;
            }
            if (e.ed && e.ej) {
                continue;
            }
            if (e.isStacked) {
                e.p2(function (f) {
                    var g = _this.m3(f, b, c, a);
                    if (g == null) {
                        return true;
                    }
                    b = g.c;
                    c = g.d;
                    if (f.eg) {
                        f.p0(function (h) {
                            var i = _this.m3(h, b, c, a);
                            if (i == null) {
                                return true;
                            }
                            b = i.c;
                            c = i.d;
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (e.eg) {
                e.p0(function (f) {
                    var g = _this.m3(f, b, c, a);
                    if (g == null) {
                        return true;
                    }
                    b = g.c;
                    c = g.d;
                    return true;
                });
            }
            var f = this.m3(e, b, c, a);
            if (f == null) {
                continue;
            }
            b = f.c;
            c = f.d;
        }
        this.bq = c;
    };
    SeriesViewer.prototype.m3 = function (a, b, c, d) {
        var e = a.v6(d);
        var f = a.wb(d, true, true);
        if (isNaN_(f.x) || isNaN_(f.y)) {
            return null;
        }
        var g = (e.x - f.x) * (e.x - f.x) + (e.y - f.y) * (e.y - f.y);
        if (g < b) {
            b = g;
            c = a;
        }
        return new Tuple$2(Number_$type, Series.$, b, c);
    };
    SeriesViewer.prototype.rs = function () {
        this.ed = this.wq == 0;
        this.c9.dp();
        this.rr();
        this.c9.em();
        this.n3();
        this.oh();
    };
    SeriesViewer.prototype.oj = function () {
        this.c9.cv();
    };
    SeriesViewer.prototype.rr = function () {
        if (this.c2 == null) {
            return;
        }
        this.c2.visibility = this.wq;
        this.c2.isZoomable = this.fk();
    };
    Object.defineProperty(SeriesViewer.prototype, "we", {
        get: function () {
            return this.v2;
        },
        set: function (a) {
            var b = this.v2;
            this.v2 = a;
            if (this.v2.isEmpty) {
                this.c9.cj();
            }
            else {
                this.c9.en(this.wk, this.wh(this.we));
                this.c9.ec();
                this.qm("PreviewRect", b, this.v2);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "selectedSeriesItems", {
        get: function () {
            return this._selectedSeriesItems;
        },
        set: function (a) {
            this._selectedSeriesItems = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "focusedSeriesItems", {
        get: function () {
            return this._focusedSeriesItems;
        },
        set: function (a) {
            this._focusedSeriesItems = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.pr = function (a, b) {
        if (this.selectedSeriesItemsChanged != null) {
            this.selectedSeriesItemsChanged(a, b);
        }
    };
    SeriesViewer.prototype.o4 = function (a, b) {
        if (this.focusedSeriesItemsChanged != null) {
            this.focusedSeriesItemsChanged(a, b);
        }
    };
    SeriesViewer.prototype.rk = function () {
        this.hj = this.v4.x;
        this.hk = this.v4.y;
    };
    SeriesViewer.prototype.m5 = function (a, b) {
        this.gk = false;
        this.gu = dateNow();
        if (this.e6) {
            for (var c = 0; c < this.series.count; c++) {
                this.series._inner[c].o2();
            }
            this.dl.clear();
        }
        if (this.dc.f()) {
            this.dc.w();
        }
        var d = this.gc;
        this.gc = true;
        this.rk();
        this.gc = d;
        this.c9.ck();
        this.c9.ep(this.v4);
        if (this.em) {
            this.bc.updateScrollbars(this, a, this.v4, this.wk, this.wk);
        }
        this.ok(a, b);
    };
    SeriesViewer.prototype.f1 = function () {
        return this.b8 != 1;
    };
    SeriesViewer.prototype.ok = function (a, b) {
    };
    SeriesViewer.prototype.wh = function (a) {
        if (this.wk.isEmpty) {
            return Rect.empty;
        }
        var b = this.wk;
        var c = b.left + (b.width * (a.left - this.v4.left) / this.v4.width);
        var d = b.top + (b.height * (a.top - this.v4.top) / this.v4.height);
        var e = b.left + (b.width * (a.right - this.v4.left) / this.v4.width);
        var f = b.top + (b.height * (a.bottom - this.v4.top) / this.v4.height);
        return new Rect(0, c, d, e - c, f - d);
    };
    SeriesViewer.prototype.qn = function () {
        if (this.refreshCompleted != null && !this.destroyed) {
            this.refreshCompleted(this, new RefreshCompletedEventArgs());
        }
    };
    SeriesViewer.prototype.p5 = function (a) {
        this.rr();
    };
    Object.defineProperty(SeriesViewer.prototype, "ma", {
        get: function () {
            return this.jf;
        },
        set: function (a) {
            var b = this.jf;
            this.jf = a;
            this.qm("TitleTextStyle", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ly", {
        get: function () {
            return this.je;
        },
        set: function (a) {
            var b = this.je;
            this.je = a;
            this.qm("SubtitleTextStyle", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vq", {
        get: function () {
            return this.u5;
        },
        set: function (a) {
            var b = this.u5;
            this.u5 = a;
            this.qm("TitleTextColor", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "vp", {
        get: function () {
            return this.u4;
        },
        set: function (a) {
            var b = this.u4;
            this.u4 = a;
            this.qm("SubtitleTextColor", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ig", {
        get: function () {
            return this.hf;
        },
        set: function (a) {
            var b = this.hf;
            this.hf = a;
            this.qm("TitleTopMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "id", {
        get: function () {
            return this.hd;
        },
        set: function (a) {
            var b = this.hd;
            this.hd = a;
            this.qm("TitleLeftMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ie", {
        get: function () {
            return this.he;
        },
        set: function (a) {
            var b = this.he;
            this.he = a;
            this.qm("TitleRightMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ic", {
        get: function () {
            return this.hc;
        },
        set: function (a) {
            var b = this.hc;
            this.hc = a;
            this.qm("TitleBottomMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ib", {
        get: function () {
            return this.hb;
        },
        set: function (a) {
            var b = this.hb;
            this.hb = a;
            this.qm("SubtitleTopMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h9", {
        get: function () {
            return this.g9;
        },
        set: function (a) {
            var b = this.g9;
            this.g9 = a;
            this.qm("SubtitleLeftMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ia", {
        get: function () {
            return this.ha;
        },
        set: function (a) {
            var b = this.ha;
            this.ha = a;
            this.qm("SubtitleRightMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h8", {
        get: function () {
            return this.g8;
        },
        set: function (a) {
            var b = this.g8;
            this.g8 = a;
            this.qm("SubtitleBottomMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wn = function () {
        return this.c9.fj();
    };
    SeriesViewer.prototype.wo = function () {
        return this.c9.fk();
    };
    SeriesViewer.prototype.ap = function (a) {
        return this.c9.c(a);
    };
    SeriesViewer.prototype.aq = function (a) {
        return this.c9.d(a);
    };
    SeriesViewer.prototype.getFontHeight = function () {
        return this.c9.a9;
    };
    SeriesViewer.prototype.get_fu = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "fu", {
        get: function () {
            return this.get_fu();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.ov = function () {
    };
    SeriesViewer.prototype.provideContainer = function (a) {
        this.c9.c0(a);
    };
    SeriesViewer.prototype.ou = function (a, b) {
        this.c9.c1(a, b);
    };
    SeriesViewer.prototype.notifyContainerResized = function () {
        this.c9.cu();
    };
    SeriesViewer.prototype.v9 = function () {
        return this.c9.fb();
    };
    SeriesViewer.prototype.nm = function () {
        this.c9.b5();
    };
    SeriesViewer.prototype.vx = function () {
        return this.c9.e8();
    };
    SeriesViewer.prototype.dg = function () {
        return this.c9.t();
    };
    SeriesViewer.prototype.df = function () {
        return this.c9.q();
    };
    SeriesViewer.prototype.vb = function () {
        return this.c9.e0();
    };
    SeriesViewer.prototype.vc = function () {
        return this.c9.e3();
    };
    SeriesViewer.prototype.m8 = function (a) {
        this.c9.bp(a);
    };
    SeriesViewer.prototype.q4 = function (a) {
        this.c9.dy(a);
    };
    Object.defineProperty(SeriesViewer.prototype, "fr", {
        get: function () {
            return this.d8;
        },
        set: function (a) {
            var b = this.d8;
            this.d8 = a;
            if (b != this.d8) {
                this.c9.cr(this.d8);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "eg", {
        get: function () {
            return this.dx;
        },
        set: function (a) {
            var b = this.dx;
            this.dx = a;
            if (b != this.dx) {
                this.c9.bk(this.dx);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "syncSettings", {
        get: function () {
            return this._syncSettings;
        },
        set: function (a) {
            this._syncSettings = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.m7 = function (a) {
        this.c9.bn(a);
    };
    SeriesViewer.prototype.q6 = function (a) {
        this.c9.dz(a);
    };
    SeriesViewer.prototype.og = function (source_, a, b, c) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var d = this.actualSyncLink.ag(source_);
        if (d == null) {
            return;
        }
        d.handleCollectionChanged(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
    };
    SeriesViewer.prototype.n7 = function (source_) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var a = this.actualSyncLink.ag(source_);
        if (a == null) {
            return;
        }
        a.handleCollectionChanged(new NotifyCollectionChangedEventArgs(0, 4));
    };
    SeriesViewer.prototype.oe = function (source_, a, b) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var c = this.actualSyncLink.ag(source_);
        if (c == null) {
            return;
        }
        c.handleCollectionChanged(new NotifyCollectionChangedEventArgs(1, 0, b, a));
    };
    SeriesViewer.prototype.of = function (source_, a, b) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        var c = this.actualSyncLink.ag(source_);
        if (c == null) {
            return;
        }
        c.handleCollectionChanged(new NotifyCollectionChangedEventArgs(1, 1, b, a));
    };
    SeriesViewer.prototype.destroy = function () {
        this.destroyed = true;
        var a = new List$1(Series.$, 0);
        for (var b = 0; b < this.series.count; b++) {
            a.add(this.series._inner[b]);
        }
        for (var c = 0; c < a.count; c++) {
            if (a._inner[c].cv != null) {
                a._inner[c].cv.ak();
            }
            this.series.remove(a._inner[c]);
            this.q5(a._inner[c].name, true);
            a._inner[c].itemsSource = null;
            a._inner[c].q9(null, null);
        }
        this.nk();
        this.q7();
        this.onDetachedFromUI();
        this.c9.c0(null);
    };
    SeriesViewer.prototype.nk = function () {
    };
    SeriesViewer.prototype.rf = function (source_) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        this.i9 = source_;
        this.ro();
    };
    SeriesViewer.prototype.q7 = function () {
        this.i9 = null;
        this.ro();
    };
    SeriesViewer.prototype.re = function (a, source_) {
        if (source_.dataView && source_.dataSource) {
            source_ = source_.dataView();
        }
        ;
        if (stringIsNullOrEmpty(a) == false) {
            if (!this.gl.containsKey(a)) {
                this.gl.addItem(a, source_);
            }
            else {
                this.gl.item(a, source_);
            }
        }
        this.ro();
    };
    SeriesViewer.prototype.q5 = function (a, b) {
        if (stringIsNullOrEmpty(a) == false) {
            if (this.gl.containsKey(a)) {
                this.gl.removeItem(a);
            }
        }
        if (!b) {
            this.ro();
        }
    };
    SeriesViewer.prototype.rd = function (a, b) {
        if (a.itemsSource != b) {
            a.itemsSource = b;
        }
    };
    SeriesViewer.prototype.rn = function (a) {
        if (!this.fo) {
            return;
        }
        if (typeCast(Series.$, a) !== null) {
            var b = a;
            if (this.gl.containsKey(b.name)) {
                var c = this.gl.item(b.name);
                this.rd(b, c);
            }
            else {
                this.rd(b, this.i9);
            }
        }
        if (typeCast(CategoryAxisBase.$, a) !== null) {
            var d = a;
            if (this.gl.containsKey(d.name)) {
                var e = this.gl.item(d.name);
                if (d.itemsSource != e) {
                    d.itemsSource = e;
                }
            }
            else {
                if (d.itemsSource != this.i9) {
                    d.itemsSource = this.i9;
                }
            }
        }
    };
    SeriesViewer.prototype.ro = function () {
        var e_22, _a;
        if (!this.fo) {
            return;
        }
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.rn(a);
            }
        }
        catch (e_22_1) {
            e_22 = { error: e_22_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_22)
                    throw e_22.error;
            }
        }
    };
    Object.defineProperty(SeriesViewer.prototype, "ih", {
        get: function () {
            return this.hg;
        },
        set: function (a) {
            this.hg = a;
            this.n3();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h2", {
        get: function () {
            return this.g5;
        },
        set: function (a) {
            this.g5 = a;
            this.n3();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h7", {
        get: function () {
            return this.g7;
        },
        set: function (a) {
            this.g7 = a;
            this.n3();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hp", {
        get: function () {
            return this.g3;
        },
        set: function (a) {
            this.g3 = a;
            this.n3();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "ho", {
        get: function () {
            return this.g2;
        },
        set: function (a) {
            this.g2 = a;
            this.n3();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hn", {
        get: function () {
            return this.g1;
        },
        set: function (a) {
            this.g1 = a;
            this.n3();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.f3 = function () {
        return false;
    };
    Object.defineProperty(SeriesViewer.prototype, "e3", {
        get: function () {
            return this.d3;
        },
        set: function (a) {
            var b = this.d3;
            this.d3 = a;
            this.qm("IsAntiAliasingEnabledDuringInteraction", b, this.d3);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h3", {
        get: function () {
            return this.g6;
        },
        set: function (a) {
            var b = this.g6;
            this.g6 = a;
            this.qm("PixelScalingRatio", b, this.g6);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "h1", {
        get: function () {
            return this.g4;
        },
        set: function (a) {
            var b = this.g4;
            this.g4 = a;
            this.qm("InteractionPixelScalingRatio", b, this.g4);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.cu = function (a, b) {
        var c = new CoercionInfo();
        c.b = a;
        c.a = null;
        var d = FastItemsSource.f(a);
        if (d.d == null) {
            return c;
        }
        if (b != null) {
            var methods_ = b;
            var key_ = d.d;
            var val_ = null;
            if (typeof methods_[key_] != 'undefined') {
                val_ = methods_[key_];
            }
            ;
            c.b = d.c;
            c.a = val_;
        }
        else if (d.d == "defaultDateParse") {
            var e = defaultDVDateParse;
            c.b = d.c;
            c.a = e;
        }
        return c;
    };
    Object.defineProperty(SeriesViewer.prototype, "k1", {
        get: function () {
            return this.jd;
        },
        set: function (a) {
            this.jd = a;
            if (this.c2 == null) {
                return;
            }
            this.c2.backgroundImageUri = this.jd;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hi", {
        get: function () {
            return this.gw;
        },
        set: function (a) {
            var b = this.gw;
            this.gw = a;
            this.qm("ActualPixelScalingRatio", b, this.gw);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hh", {
        get: function () {
            return this.gv;
        },
        set: function (a) {
            var b = this.gv;
            this.gv = a;
            this.qm("ActualInteractionPixelScalingRatio", b, this.gv);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "v4", {
        get: function () {
            return this.vz;
        },
        set: function (a) {
            var b = Rect.l_op_Inequality(this.vz, a);
            if (b) {
                var c = this.vz;
                this.vz = a;
                this.qm("ActualWindowRect", c, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.wa = function () {
        return this.v4;
    };
    SeriesViewer.prototype.n1 = function () {
        if (this.ez) {
            return;
        }
        this.v4 = this.v5();
    };
    SeriesViewer.prototype.wf = function () {
        return Rect.empty;
    };
    SeriesViewer.prototype.v5 = function () {
        var a = this.wl.left;
        var b = this.wl.top;
        var c = this.wl.width;
        var d = this.wl.height;
        if (this.cr == 1) {
            a = Math.min(1, Math.max(0, this.wl.left));
            c = Math.min(1, Math.max(0, this.wl.width));
        }
        if (this.cr == 1) {
            b = Math.min(1, Math.max(0, this.wl.top));
            d = Math.min(1, Math.max(0, this.wl.height));
        }
        return new Rect(0, a, b, c, d);
    };
    SeriesViewer.prototype.jb = function (a, b) {
        return this.c9.bj(a, b, this.hi);
    };
    Object.defineProperty(SeriesViewer.prototype, "hj", {
        get: function () {
            return this.gx;
        },
        set: function (a) {
            var b = this.gx;
            this.gx = a;
            this.qm("ActualWindowPositionHorizontal", b, this.gx);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewer.prototype, "hk", {
        get: function () {
            return this.gy;
        },
        set: function (a) {
            var b = this.gy;
            this.gy = a;
            this.qm("ActualWindowPositionVertical", b, this.gy);
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.oi = function () {
        if (this.ed && this.c2 != null) {
            this.c2.surfaceIsDirty = true;
            this.c2.doRefresh(false);
        }
        this.ng();
        this.oc();
    };
    SeriesViewer.prototype.oh = function () {
        if (this.ed && this.c2 != null) {
            this.c2.surfaceIsDirty = true;
            this.c2.doRefresh(false);
        }
        this.ng();
    };
    SeriesViewer.prototype.flush = function () {
        this.nr(true, true, true);
    };
    SeriesViewer.prototype.nr = function (a, b, c) {
        this.ar.y();
        if (a) {
            this.c9.b7();
            this.ar.y();
        }
        if (c) {
            this.al.l();
        }
        if (b) {
            this.c9.a.l();
        }
        this.gk = true;
    };
    SeriesViewer.prototype.gg = function () {
        return false;
    };
    SeriesViewer.prototype.q1 = function (a, b) {
        if (this.sb != null) {
            this.rj(this.sb);
            this.sb = null;
            this.az = null;
        }
        this.sb = a;
        this.az = this.ar.k(2, a, b);
    };
    SeriesViewer.prototype.rj = function (a) {
        this.ar.ad(2, a);
        this.sb = null;
        this.az = null;
    };
    SeriesViewer.prototype.ni = function () {
        this.ar.ac(2, this.sb, this.az, false);
    };
    SeriesViewer.prototype.o8 = function () {
        var a = false;
        var b = false;
        var c = false;
        for (var d = 0; d < this.series.count; d++) {
            var e = this.series._inner[d];
            if (e.e1) {
                a = true;
            }
            if (e.e2) {
                b = true;
            }
            if (e.es) {
                c = true;
            }
        }
        this.e4 = a;
        this.e5 = b;
        this.e2 = c;
    };
    Object.defineProperty(SeriesViewer.prototype, "fh", {
        get: function () {
            return this.ed;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.m9 = function () {
        this.c9.bq();
        for (var a = 0; a < this.series.count; a++) {
            this.series._inner[a].qo();
        }
    };
    SeriesViewer.prototype.fn = function () {
        return this.c9.am();
    };
    SeriesViewer.prototype.i4 = function () {
        var a = this.iz;
        this.iz++;
        return a;
    };
    SeriesViewer.prototype.dj = function () {
        if (this.ma == null || this.c9.j.ae == null) {
            return null;
        }
        return FontUtil.toFontInfo(this.c9.j.ae, this.ma);
    };
    SeriesViewer.prototype.di = function () {
        if (this.ly == null || this.c9.j.ae == null) {
            return null;
        }
        return FontUtil.toFontInfo(this.c9.j.ae, this.ly);
    };
    SeriesViewer.prototype.rm = function () {
        var a = false;
        a = this.eg;
        this.e0 = true;
        this.er = (a && !this.gh) || this.wp == 0;
        this.e0 = false;
    };
    SeriesViewer.prototype.qr = function () {
        if (this.seriesDataUpdated != null) {
            this.seriesDataUpdated(this, EventArgs.empty);
        }
    };
    SeriesViewer.prototype.ob = function () {
        for (var a = 0; a < this.go.count; a++) {
            this.go._inner[a].notifySeriesCollectionChanged();
        }
    };
    SeriesViewer.prototype.oc = function () {
        for (var a = 0; a < this.go.count; a++) {
            this.go._inner[a].notifySeriesDataChanged();
        }
    };
    SeriesViewer.prototype.od = function (a) {
        for (var b = 0; b < this.go.count; b++) {
            this.go._inner[b].notifyVisualPropertiesChanged(a);
        }
    };
    SeriesViewer.prototype.oa = function (a) {
        for (var b = 0; b < this.go.count; b++) {
            this.go._inner[b].notifyCursorPositionChanged(a);
        }
    };
    SeriesViewer.prototype.attachDataLegend = function (a) {
        this.go.add(a);
    };
    SeriesViewer.prototype.detachDataLegend = function (a) {
        this.go.remove(a);
    };
    Object.defineProperty(SeriesViewer.prototype, "isDetached", {
        get: function () {
            return this.destroyed || this.d4;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewer.prototype.getDataLegendSeries = function () {
        var a = 0;
        for (var b = 0; b < this.series.count; b++) {
            if (this.series._inner[b].isStacked) {
                this.series._inner[b].p2(function (c) {
                    if (c.isUsableInLegend) {
                        a++;
                    }
                    if (c.eg) {
                        c.p0(function (d) {
                            if (d.isUsableInLegend) {
                                a++;
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            else if (this.series._inner[b].eg) {
                if (this.series._inner[b].isUsableInLegend) {
                    a++;
                }
                this.series._inner[b].p0(function (c) {
                    if (c.isUsableInLegend) {
                        a++;
                    }
                    return true;
                });
            }
            else {
                if (this.series._inner[b].isUsableInLegend) {
                    a++;
                }
            }
        }
        var c = new Array(a);
        var d = 0;
        for (var e = 0; e < this.series.count; e++) {
            if (this.series._inner[e].isStacked) {
                this.series._inner[e].p2(function (f) {
                    if (f.isUsableInLegend) {
                        c[d] = f;
                        d++;
                    }
                    if (f.eg) {
                        f.p0(function (g) {
                            if (g.isUsableInLegend) {
                                c[d] = g;
                                d++;
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            else if (this.series._inner[e].eg) {
                if (this.series._inner[e].isUsableInLegend) {
                    c[d] = this.series._inner[e];
                    d++;
                }
                this.series._inner[e].p0(function (f) {
                    if (f.isUsableInLegend) {
                        c[d] = f;
                        d++;
                    }
                    return true;
                });
            }
            else {
                if (this.series._inner[e].isUsableInLegend) {
                    c[d] = this.series._inner[e];
                    d++;
                }
            }
        }
        return c;
    };
    SeriesViewer.prototype.m6 = function (a) {
        var e_23, _a;
        var b = new List$1(ChartSelection.$, 0);
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.p3(a, b, this.b4);
            }
        }
        catch (e_23_1) {
            e_23 = { error: e_23_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_23)
                    throw e_23.error;
            }
        }
        if (b.count == 0) {
            return;
        }
        b = this.gs(b, this.b4);
        b = this.gt(b, this.b4);
        var d = this.gp(this.selectedSeriesItems, b, this.b4);
        for (var e = 0; e < d.count; e++) {
            this.selectedSeriesItems.remove(d._inner[e]);
        }
        for (var f = 0; f < b.count; f++) {
            this.selectedSeriesItems.add(b._inner[f]);
        }
    };
    SeriesViewer.prototype.wi = function (a) {
        a = new Rect(0, a.left + this.wk.left, a.top + this.wk.top, a.width, a.height);
        var b = this.wk;
        var c = this.v4.left + this.v4.width * (a.left - b.left) / b.width;
        var d = this.v4.top + this.v4.height * (a.top - b.top) / b.height;
        var e = this.v4.left + this.v4.width * (a.right - b.left) / b.width;
        var f = this.v4.top + this.v4.height * (a.bottom - b.top) / b.height;
        return new Rect(0, c, d, e - c, f - d);
    };
    SeriesViewer.prototype.nb = function (a) {
        if (this.gr == null) {
            this.gr = new List$1(CaptureImageSettings.$, 0);
        }
        this.gr.add(a);
        this.ar.z();
    };
    SeriesViewer.prototype.nc = function () {
        var _this = this;
        if (this.gr != null && this.gr.count > 0) {
            var a = this.gr.toArray();
            this.gr.clear();
            var _loop_1 = function (c) {
                var b = a[c];
                this_1.js(b, function (d, e) {
                    if (d != null) {
                        _this.ql(b, d, e);
                    }
                });
            };
            var this_1 = this;
            for (var c = 0; c < a.length; c++) {
                _loop_1(c);
            }
        }
    };
    SeriesViewer.prototype.js = function (a, b) {
        var c = "image/png";
        switch (a.a) {
            case 0:
                c = "image/png";
                break;
            case 1:
                c = "image/jpeg";
                break;
            default: return null;
        }
        var d = null;
        d = this.c9.j.at(this.c9.a8, this.c9.a7, this.hi, c, function (e, f) {
            var _a;
            if (a.b) {
                var b_ = f;
                if ((window.ClipboardItem)) {
                    navigator.clipboard.write([new window.ClipboardItem((_a = {}, _a[b_.type] = b_, _a))]);
                }
            }
            if (b != null) {
                b(e, f);
            }
        });
        return d;
    };
    SeriesViewer.prototype.ql = function (a, b, c) {
        if (c === void 0) {
            c = null;
        }
        if (this.imageCaptured != null) {
            var d = new ImageCapturedEventArgs(b, c, a);
            this.imageCaptured(this, d);
        }
    };
    SeriesViewer.$t = markType(SeriesViewer, 'SeriesViewer', Control.$, [INotifyPropertyChanged_$type, ILegendOwner_$type, IInternalLegendOwner_$type, IDataLegendTarget_$type, IToolbarTarget_$type, ISupportsAnimation_$type]);
    SeriesViewer.td = DependencyProperty.i("Legend", IChartLegend_$type, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("Legend", b.oldValue, b.newValue);
    }));
    SeriesViewer.sd = DependencyProperty.i("AnimateSeriesWhenAxisRangeChanges", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("AnimateSeriesWhenAxisRangeChanges", b.oldValue, b.newValue);
    }));
    SeriesViewer.t0 = DependencyProperty.i("SeriesValueLayerUseLegend", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("SeriesValueLayerUseLegend", b.oldValue, b.newValue);
    }));
    SeriesViewer.s9 = DependencyProperty.i("IsWindowSyncedToVisibleRange", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("IsWindowSyncedToVisibleRange", b.oldValue, b.newValue);
    }));
    SeriesViewer.t3 = DependencyProperty.i("ShouldSimulateHoverMoveCrosshairPoint", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("ShouldSimulateHoverMoveCrosshairPoint", b.oldValue, b.newValue);
    }));
    SeriesViewer.sr = DependencyProperty.i("HighlightingMode", SeriesHighlightingMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesHighlightingMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HighlightingMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.tx = DependencyProperty.i("SelectionMode", SeriesSelectionMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("SelectionMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.tv = DependencyProperty.i("SelectionBehavior", SeriesSelectionBehavior_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionBehavior_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("SelectionBehavior", b.oldValue, b.newValue);
    }));
    SeriesViewer.sl = DependencyProperty.i("FocusMode", SeriesSelectionMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("FocusMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.sz = DependencyProperty.i("HorizontalViewScrollbarMode", SeriesViewerScrollbarMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerScrollbarMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.uh = DependencyProperty.i("VerticalViewScrollbarMode", SeriesViewerScrollbarMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerScrollbarMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.s1 = DependencyProperty.i("HorizontalViewScrollbarPosition", SeriesViewerHorizontalScrollbarPosition_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerHorizontalScrollbarPosition_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarPosition", b.oldValue, b.newValue);
    }));
    SeriesViewer.uj = DependencyProperty.i("VerticalViewScrollbarPosition", SeriesViewerVerticalScrollbarPosition_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerVerticalScrollbarPosition_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarPosition", b.oldValue, b.newValue);
    }));
    SeriesViewer.sv = DependencyProperty.i("HorizontalViewScrollbarFill", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarFill", b.oldValue, b.newValue);
    }));
    SeriesViewer.s0 = DependencyProperty.i("HorizontalViewScrollbarOutline", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarOutline", b.oldValue, b.newValue);
    }));
    SeriesViewer.s3 = DependencyProperty.i("HorizontalViewScrollbarStrokeThickness", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarStrokeThickness", b.oldValue, b.newValue);
    }));
    SeriesViewer.sy = DependencyProperty.i("HorizontalViewScrollbarMaxOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarMaxOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.su = DependencyProperty.i("HorizontalViewScrollbarCornerRadius", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarCornerRadius", b.oldValue, b.newValue);
    }));
    SeriesViewer.sw = DependencyProperty.i("HorizontalViewScrollbarHeight", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarHeight", b.oldValue, b.newValue);
    }));
    SeriesViewer.sx = DependencyProperty.i("HorizontalViewScrollbarInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.s5 = DependencyProperty.i("HorizontalViewScrollbarTrackStartInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarTrackStartInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.s4 = DependencyProperty.i("HorizontalViewScrollbarTrackEndInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HorizontalViewScrollbarTrackEndInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.kj = "HorizontalViewScrollbarShouldAddAutoTrackInsets";
    SeriesViewer.s2 = DependencyProperty.i(SeriesViewer.kj, Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, true, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm(SeriesViewer.kj, b.oldValue, b.newValue);
    }));
    SeriesViewer.ue = DependencyProperty.i("VerticalViewScrollbarFill", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarFill", b.oldValue, b.newValue);
    }));
    SeriesViewer.ui = DependencyProperty.i("VerticalViewScrollbarOutline", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarOutline", b.oldValue, b.newValue);
    }));
    SeriesViewer.ul = DependencyProperty.i("VerticalViewScrollbarStrokeThickness", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarStrokeThickness", b.oldValue, b.newValue);
    }));
    SeriesViewer.ug = DependencyProperty.i("VerticalViewScrollbarMaxOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarMaxOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.ud = DependencyProperty.i("VerticalViewScrollbarCornerRadius", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarCornerRadius", b.oldValue, b.newValue);
    }));
    SeriesViewer.uo = DependencyProperty.i("VerticalViewScrollbarWidth", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarWidth", b.oldValue, b.newValue);
    }));
    SeriesViewer.uf = DependencyProperty.i("VerticalViewScrollbarInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.un = DependencyProperty.i("VerticalViewScrollbarTrackStartInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarTrackStartInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.um = DependencyProperty.i("VerticalViewScrollbarTrackEndInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("VerticalViewScrollbarTrackEndInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.mo = "VerticalViewScrollbarShouldAddAutoTrackInsets";
    SeriesViewer.uk = DependencyProperty.i(SeriesViewer.mo, Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, true, function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm(SeriesViewer.mo, b.oldValue, b.newValue);
    }));
    SeriesViewer.sq = DependencyProperty.i("HighlightingBehavior", SeriesHighlightingBehavior_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesHighlightingBehavior_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("HighlightingBehavior", b.oldValue, b.newValue);
    }));
    SeriesViewer.ta = DependencyProperty.i("LegendHighlightingMode", LegendHighlightingMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendHighlightingMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("LegendHighlightingMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.tc = DependencyProperty.i("LegendItemBadgeShape", LegendItemBadgeShape_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendItemBadgeShape_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("LegendItemBadgeShape", b.oldValue, b.newValue);
    }));
    SeriesViewer.tb = DependencyProperty.i("LegendItemBadgeMode", LegendItemBadgeMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendItemBadgeMode_$type, 0), function (a, b) {
        var c = typeCast(SeriesViewer.$, a);
        c.qm("LegendItemBadgeMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.wg = Rect.empty;
    SeriesViewer.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesViewer, 'qm', ['ActualPlotAreaBorderBrush:u6:sc', [Brush.$, null], 'Brushes:ag:se', [BrushCollection.$, null], 'CircleMarkerTemplate:r1:sf', [DataTemplate.$, null], 'CrosshairVisibility:wp:sg', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'DefaultInteraction:cw:sh', [InteractionState_$type, enumGetBox(InteractionState_$type, 4)], 'DiamondMarkerTemplate:r2:si', [DataTemplate.$, null], 'DragModifier:u1:sj', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 2)], 'FocusBrush:u7:sk', [Brush.$, null], 'FocusTransitionDuration:i3:sm', [1, 100], 'HexagonMarkerTemplate:r3:sn', [DataTemplate.$, null], 'HexagramMarkerTemplate:r4:so', [DataTemplate.$, null], 'HighlightedValuesDisplayMode:bt:sp', [SeriesHighlightedValuesDisplayMode_$type, enumGetBox(SeriesHighlightedValuesDisplayMode_$type, 0)], 'HighlightingTransitionDuration:i5:ss', [1, 300], 'HorizontalCrosshairBrush:vh:st', [Brush.$, null], 'InteractionOverride:cx:s6', [InteractionState_$type, enumGetBox(InteractionState_$type, 0)], 'IsPagePanningAllowed:fe:s7', [0, true], 'IsSurfaceInteractionDisabled:ff:s8', [0, false], 'MarkerAutomaticBehavior:bg:te', [MarkerAutomaticBehavior_$type, enumGetBox(MarkerAutomaticBehavior_$type, 4)], 'MarkerBrushes:ah:tf', [BrushCollection.$, null], 'MarkerOutlines:ai:tg', [BrushCollection.$, null], 'Outlines:aj:th', [BrushCollection.$, null], 'OverviewPlusDetailPaneVisibility:wq:ti', [Visibility_$type, enumGetBox(Visibility_$type, 1)], 'PanModifier:u2:tj', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 4)], 'PentagonMarkerTemplate:r5:tk', [DataTemplate.$, null], 'PentagramMarkerTemplate:r6:tl', [DataTemplate.$, null], 'PlotAreaBackground:vk:tm', [Brush.$, null], 'PlotAreaBorderBrush:vl:tn', [Brush.$, null], 'PreferHigherResolutionTiles:fz:to', [0, false], 'PreviewPathFill:vm:tp', [Brush.$, null], 'PreviewPathOpacity:h4:tq', [1, NaN], 'PreviewPathStroke:vn:tr', [Brush.$, null], 'PyramidMarkerTemplate:r7:ts', [DataTemplate.$, null], 'RightButtonDefaultInteraction:cz:tt', [InteractionState_$type, enumGetBox(InteractionState_$type, 4)], 'ScrollbarsAnimationDuration:i6:tu', [1, 300], 'SelectionBrush:vo:tw', [Brush.$, null], 'SelectionModifier:u3:ty', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 1)], 'SelectionTransitionDuration:i7:tz', [1, 300], 'ShouldMatchZOrderToSeriesOrder:f5:t1', [0, false], 'ShouldPanOnMaximumZoom:f6:t2', [0, true], 'SquareMarkerTemplate:r8:t4', [DataTemplate.$, null], 'SubtitleHorizontalAlignment:uz:t5', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'Subtitle:lr:t6', [2, null], 'TetragramMarkerTemplate:r9:t7', [DataTemplate.$, null], 'TitleHorizontalAlignment:u0:t8', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'Title:l3:t9', [2, null], 'TriangleMarkerTemplate:sa:ua', [DataTemplate.$, null], 'UseTiledZooming:gi:ub', [0, false], 'VerticalCrosshairBrush:vr:uc', [Brush.$, null], 'WindowPositionHorizontal:iq:up', [1, NaN], 'WindowPositionVertical:ir:uq', [1, NaN], 'WindowRectMinHeight:is:ur', [1, NaN], 'WindowRectMinWidth:it:us', [1, NaN], 'WindowRect:wl:ut', [Rect.$, new Rect(0, 0, 0, 1, 1)], 'WindowResponse:cp:uu', [WindowResponse_$type, enumGetBox(WindowResponse_$type, 1)], 'WindowSizeMinHeight:iu:uv', [1, NaN], 'WindowSizeMinWidth:iv:uw', [1, NaN], 'ZoomCoercionMode:ct:ux', [ZoomCoercionMode_$type, enumGetBox(ZoomCoercionMode_$type, 0)], 'ZoomTileCacheSize:i8:uy', [1, 30]]);
    return SeriesViewer;
}(Control));
export { SeriesViewer };
/**
 * @hidden
 */
var SeriesViewerView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewerView, _super);
    function SeriesViewerView(a) {
        var _this = _super.call(this) || this;
        _this.p = null;
        _this.a = null;
        _this.n = null;
        _this.o = null;
        _this.g = null;
        _this.b = null;
        _this.ai = false;
        _this.fi = null;
        _this.ff = null;
        _this.fe = null;
        _this.fd = null;
        _this.h = new SeriesViewerComponentsFromView();
        _this.j = null;
        _this.w = null;
        _this.z = null;
        _this.y = null;
        _this.x = null;
        _this.an = false;
        _this.ao = false;
        _this.bi = null;
        _this.k = null;
        _this.a9 = 0;
        _this.a8 = 0;
        _this.a7 = 0;
        _this.e9 = Rect.empty;
        _this.aj = false;
        _this.fg = null;
        _this.fh = null;
        _this.a1 = 0;
        _this.az = 0;
        _this.a0 = 0;
        _this.ay = 0;
        _this.ak = true;
        _this.aa = false;
        _this.a2 = NaN;
        _this.fa = Rect.empty;
        _this.ab = false;
        _this.af = false;
        _this.ae = false;
        _this.av = false;
        _this.et = null;
        _this.es = null;
        _this.ad = false;
        _this.ac = false;
        _this.ag = true;
        _this.ax = null;
        _this.ar = false;
        _this.bg = 0;
        _this.ah = true;
        _this.a8 = 0;
        _this.a7 = 0;
        _this.p = a;
        _this.p.vv = { $type: Point_$type, x: NaN, y: NaN };
        _this.p.cp = 1;
        _this.j = new SeriesViewerViewManager(_this);
        _this.fd = ((function () {
            var $ret = new Line();
            $ret.visibility = 1;
            return $ret;
        })());
        _this.fe = ((function () {
            var $ret = new Line();
            $ret.visibility = 1;
            return $ret;
        })());
        return _this;
    }
    SeriesViewerView.prototype.l = function () {
        return new DOMExecutionContext(this.j.ae);
    };
    SeriesViewerView.prototype.co = function () {
        this.j.ba();
    };
    SeriesViewerView.prototype.c4 = function () {
        this.p.e0 = true;
        this.p.wp = 1;
        this.p.e0 = false;
        this.ff = new Path();
        this.fi = new Rectangle();
        this.fi._visibility = 1;
        this.d6();
        this.g = new SeriesCollection();
        this.b = new AxisCollection();
        this.a = new CanvasRenderScheduler();
        this.a.o(this);
        this.a.h.add(this.p.am);
        if (this.p.wq == 0) {
            this.cn();
        }
        var a = this.p;
        a.windowRectChanged = delegateCombine(a.windowRectChanged, runOn(this, this.ct));
        var b = this.p;
        b.gridAreaRectChanged = delegateCombine(b.gridAreaRectChanged, runOn(this, this.cs));
        this.o = new OverviewPlusDetailViewportHost(this);
        this.dp();
    };
    SeriesViewerView.prototype.e = function () {
        for (var a = 0; a < this.g.count; a++) {
            if (this.g._inner[a].ba.a$e) {
                return this.g._inner[a];
            }
        }
        return null;
    };
    SeriesViewerView.prototype.cn = function () {
        if (this.n == null) {
            this.n = this.j.g();
        }
        this.p.c2.provideContext(this.z);
        this.p.c2.provideContainer(this.bi);
        this.p.c2.provideEventSource(this.k);
        this.n.world = new Rect(0, 0, 0, 1, 1);
        this.n.window = this.p.wl;
        this.n.surfaceViewer = TypeRegistrar.create("SeriesViewerSurfaceViewer", this.p, this);
        this.n.viewScheduler = this.a;
        this.em();
        var a = this.n;
        a.windowChanging = delegateCombine(a.windowChanging, runOn(this, this.dn));
        var b = this.n;
        b.windowChanged = delegateCombine(b.windowChanged, runOn(this, this.dm));
    };
    SeriesViewerView.prototype.dn = function (a, b) {
        var c = b.newValue;
        if (this.n != null) {
            c = this.n.changeRect(b.oldValue, b.newValue, this.p.fl(), this.p.fm(), this.n.world);
        }
        if (c.isEmpty) {
            this.n.window = b.oldValue;
        }
        else if (!c.equals1(b.newValue)) {
            this.n.window = c;
        }
        if (this.p.cp == 1) {
            var d = this.p.wk.width / this.p.wk.height;
            c = new Rect(0, c.left / d, c.top, c.width / d, c.height);
            this.p.wl = c;
        }
    };
    SeriesViewerView.prototype.dm = function (a, b) {
        var c = b.newValue;
        if (this.n != null) {
            c = this.n.changeRect(b.oldValue, b.newValue, this.p.fl(), this.p.fm(), this.n.world);
        }
        if (c.isEmpty) {
            c = b.oldValue;
        }
        else if (!c.equals1(b.newValue)) {
            this.n.window = c;
        }
        var d = this.p.wk.width / this.p.wk.height;
        c = new Rect(0, c.left / d, c.top, c.width / d, c.height);
        this.p.wl = c;
    };
    SeriesViewerView.prototype.em = function () {
        if (this.n == null) {
            return;
        }
        if (this.p.wq != 0) {
            return;
        }
        var a = 1;
        if (this.p.wk.isEmpty == false) {
            a = this.p.wk.width / this.p.wk.height;
        }
        var b = this.n.world;
        var c = new Rect(0, 0, 0, a, 1);
        this.n.world = c;
        if (b.width != c.width || b.height != c.height || b.x != c.x || b.y != c.y) {
            this.n.surfaceViewer.isDirty = true;
        }
        this.n.window = new Rect(0, this.p.wl.left * a, this.p.wl.top, this.p.wl.width * a, this.p.wl.height);
    };
    SeriesViewerView.prototype.ct = function (a, b) {
        this.em();
    };
    SeriesViewerView.prototype.cs = function (a, b) {
        this.em();
    };
    SeriesViewerView.prototype.cb = function (a, b, c) {
        var e_24, _a;
        var d = true;
        try {
            for (var _b = __values(fromEnum(this.p.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var e = _c.value;
                if (d && e.gz) {
                    d = false;
                    if (!c.a.e) {
                        c.a.l(0, 0, a, b);
                    }
                }
                e.rs(new Rect(0, 0, 0, a, b), c);
            }
        }
        catch (e_24_1) {
            e_24 = { error: e_24_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_24)
                    throw e_24.error;
            }
        }
    };
    SeriesViewerView.prototype.d5 = function () {
        this.j.bm();
    };
    SeriesViewerView.prototype.cd = function () {
    };
    SeriesViewerView.prototype.d7 = function () {
        this.j.bn();
    };
    SeriesViewerView.prototype.ck = function () {
        for (var a = 0; a < this.p.series.count; a++) {
            this.p.series._inner[a].cv.ar();
        }
    };
    SeriesViewerView.prototype.cc = function () {
    };
    SeriesViewerView.prototype.ce = function () {
    };
    SeriesViewerView.prototype.dy = function (a) {
        var _this = this;
        var b = this.g.indexOf(a);
        if (b >= 0) {
            this.g.removeAt(b);
        }
        if (a.isStacked) {
            a.p2(function (c) {
                c.db = null;
                b = _this.g.indexOf(c);
                if (b >= 0) {
                    _this.g.removeAt(b);
                }
                if (c.eg) {
                    c.p0(function (d) {
                        d.db = null;
                        b = _this.g.indexOf(d);
                        if (b >= 0) {
                            _this.g.removeAt(b);
                        }
                        return true;
                    });
                }
                return true;
            });
        }
        if (a.eg) {
            a.p0(function (c) {
                c.db = null;
                b = _this.g.indexOf(c);
                if (b >= 0) {
                    _this.g.removeAt(b);
                }
                return true;
            });
        }
        this.p.qy();
        a.q9(null, null);
        this.dc();
    };
    SeriesViewerView.prototype.dc = function () {
        if (this.p.destroyed) {
            return;
        }
        if (this.g.count == 0) {
            if (this.y != null && Rect.l_op_Inequality(this.p.wk, null) && !this.p.wk.isEmpty) {
                this.er();
            }
        }
        this.p.al.r(this.y, this.x);
    };
    SeriesViewerView.prototype.er = function () {
        if (this.g.count > 0) {
            return;
        }
        if (this.y != null && Rect.l_op_Inequality(this.p.wk, null) && !this.p.wk.isEmpty) {
            if (this.p.hi != 1) {
                this.y.aa();
                this.y.ab(this.p.hi, this.p.hi);
            }
            if (!this.y.e) {
                this.y.l(this.p.wk.left, this.p.wk.top, this.p.wk.width, this.p.wk.height);
            }
            if (this.p.hi != 1) {
                this.y.z();
            }
        }
    };
    SeriesViewerView.prototype.aq = function (a) {
        a.q1(a.cv.bx, this.e9);
        return this.g.contains(a);
    };
    Object.defineProperty(SeriesViewerView.prototype, "au", {
        get: function () {
            return this.ai;
        },
        set: function (a) {
            this.ai = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.bp = function (a) {
        var _this = this;
        if (this.p.f5) {
            var b = this.p.series.indexOf(a);
            if (b < (this.p.series.count - 1)) {
                var c = this.p.series._inner[b + 1];
                var d = this.g.indexOf(c);
                var e_25 = d;
                if (!this.g.contains(a)) {
                    this.g.insert(e_25, a);
                    e_25++;
                    if (a.isStacked) {
                        a.p2(function (f) {
                            _this.g.insert(e_25, f);
                            e_25++;
                            if (f.eg) {
                                f.p0(function (g) {
                                    if (!_this.g.contains(g)) {
                                        _this.g.insert(e_25, g);
                                        e_25++;
                                    }
                                    return true;
                                });
                            }
                            return true;
                        });
                    }
                    if (a.eg) {
                        a.p0(function (f) {
                            if (!_this.g.contains(f)) {
                                _this.g.insert(e_25, f);
                                e_25++;
                            }
                            return true;
                        });
                    }
                }
            }
        }
        if (!this.g.contains(a)) {
            this.g.add(a);
            if (a.isStacked) {
                a.p2(function (f) {
                    _this.g.add(f);
                    if (f.eg) {
                        f.p0(function (g) {
                            if (!_this.g.contains(g)) {
                                _this.g.add(g);
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (a.eg) {
                a.p0(function (f) {
                    if (!_this.g.contains(f)) {
                        _this.g.add(f);
                    }
                    return true;
                });
            }
        }
        this.p.qy();
        a.q9(this.y, this.x);
        this.p.n3();
    };
    SeriesViewerView.prototype.dt = function (a) {
        this.x = a;
        for (var b = 0; b < this.g.count; b++) {
            this.g._inner[b].q9(this.y, this.x);
        }
        for (var c = 0; c < this.b.count; c++) {
            this.b._inner[c].h0(this.y, this.x);
        }
    };
    SeriesViewerView.prototype.bx = function () {
    };
    SeriesViewerView.prototype.bt = function () {
        this.cf();
        this.ck();
    };
    SeriesViewerView.prototype.cf = function () {
        this.fi._visibility = 1;
        this.cq();
    };
    SeriesViewerView.prototype.ca = function () {
    };
    SeriesViewerView.prototype.dr = function () {
    };
    SeriesViewerView.prototype.d8 = function () {
        this.fi._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.eg = function (a) {
        this.fi.o = a.top + this.p.wk.top;
        this.fi.n = a.left + this.p.wk.left;
        this.fi.width = a.width;
        this.fi.height = a.height;
        this.db();
        this.fi._fill = null;
        this.fi.ad = 0.5;
        this.cq();
    };
    SeriesViewerView.prototype.bw = function () {
    };
    SeriesViewerView.prototype.df = function () {
    };
    SeriesViewerView.prototype.eo = function (a, b, c, d) {
        this.fe.an = a;
        this.fe.ap = b;
        this.fe.ao = c;
        this.fe.aq = d;
        this.cq();
    };
    SeriesViewerView.prototype.ed = function () {
        this.fe._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.cl = function () {
        if (this.fe._visibility == 0) {
            this.fe._visibility = 1;
            this.cq();
        }
    };
    SeriesViewerView.prototype.eh = function (a, b, c, d) {
        this.fd.an = a;
        this.fd.ap = b;
        this.fd.ao = c;
        this.fd.aq = d;
        this.cq();
    };
    SeriesViewerView.prototype.d9 = function () {
        this.fd._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.cg = function () {
        if (this.fd._visibility == 0) {
            this.fd._visibility = 1;
            this.cq();
        }
    };
    SeriesViewerView.prototype.cj = function () {
        this.ff._visibility = 1;
        this.cq();
    };
    SeriesViewerView.prototype.e6 = function (a) {
        var b = new PathFigureCollection();
        var c = new PathFigure();
        c._isClosed = true;
        c._startPoint = { $type: Point_$type, x: a.left, y: a.top };
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.top }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.top }));
        b.add(c);
        return b;
    };
    SeriesViewerView.prototype.e7 = function (a) {
        var b = new PathFigureCollection();
        var c = new PathFigure();
        c._isClosed = true;
        c._startPoint = { $type: Point_$type, x: a.left, y: a.top };
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.top }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.right, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.bottom }));
        c._segments.add(new LineSegment(0, { $type: Point_$type, x: a.left, y: a.top }));
        b.add(c);
        return b;
    };
    SeriesViewerView.prototype.en = function (a, b) {
        b.intersect(a);
        var c = new PathGeometry();
        c.c = this.e7(a);
        var d = new PathGeometry();
        d.c = this.e6(b);
        var e = new GeometryGroup();
        e.d.add(c);
        e.d.add(d);
        this.ff.an = e;
        this.db();
        this.cq();
    };
    SeriesViewerView.prototype.ec = function () {
        this.ff._visibility = 0;
        this.cq();
    };
    SeriesViewerView.prototype.ep = function (a) {
    };
    SeriesViewerView.prototype.dw = function (a) {
        var b = this.b.indexOf(a);
        this.b.removeAt(b);
        a.h0(null, null);
        this.d3();
        this.p.q5(a.name, true);
    };
    SeriesViewerView.prototype.dx = function (a) {
    };
    SeriesViewerView.prototype.bo = function (a) {
        if (!this.b.contains(a)) {
            this.b.add(a);
        }
        a.h0(this.y, this.x);
        this.d3();
    };
    SeriesViewerView.prototype.bl = function (a) {
    };
    SeriesViewerView.prototype.i = function () {
        this.h.a = this.n;
        return this.h;
    };
    SeriesViewerView.aw = function (a) {
        var b = a.db.series;
        var c = new List$1(Series.$, 0);
        for (var d = 0; d < b.count; d++) {
            c.add(b._inner[d]);
            if (b._inner[d].isStacked) {
                b._inner[d].p2(function (e) {
                    c.add(e);
                    return true;
                });
            }
        }
        return c;
    };
    SeriesViewerView.prototype.d2 = function () {
        this.p.wl = new Rect(0, 0, 0, 1, 1);
    };
    SeriesViewerView.prototype.c0 = function (a) {
        var e_26, _a, e_27, _b;
        var _this = this;
        if (a == this.bi) {
            return;
        }
        if (a == null) {
            if (this.k != null) {
                this.k.av();
            }
            this.j.bg(null);
            this.w = null;
            this.z = null;
            this.y = null;
            this.x = null;
            this.k = null;
            if (this.p.c2 != null) {
                this.p.c2.provideContext(null);
                this.p.c2.provideContainer(null);
                this.p.c2.provideEventSource(null);
            }
            return;
        }
        this.bi = a;
        if (this.au) {
            this.a.h.add(this.p.al);
        }
        this.j.bg(a);
        this.w = this.j.t;
        this.z = this.j.w;
        this.y = this.j.v;
        this.x = this.j.u;
        this.an = false;
        try {
            this.an = (window.navigator.msPointerEnabled && window.MSGesture !== undefined);
        }
        catch (b) {
        }
        this.ao = false;
        try {
            this.ao = (window.PointerEvent !== undefined);
        }
        catch (c) {
        }
        if (this.an || this.ao) {
            this.av = true;
        }
        this.k = this.j.f;
        if (this.k != null) {
            this.k.bl = this.p.wk;
            this.k.ao = runOn(this, this.as);
            var d = this.k;
            d.onContactCompleted = delegateCombine(d.onContactCompleted, function (d, e) { return _this.cx(d, e, _this.k.am); });
            var e = this.k;
            e.onContactMoved = delegateCombine(e.onContactMoved, runOn(this, this.cy));
            var f = this.k;
            f.onContactStarted = delegateCombine(f.onContactStarted, runOn(this, this.cz));
            var g = this.k;
            g.onDragCompleted = delegateCombine(g.onDragCompleted, runOn(this.p, this.p.o1));
            var h = this.k;
            h.onFlingStarted = delegateCombine(h.onFlingStarted, runOn(this, this.al));
            var i = this.k;
            i.onDragDelta = delegateCombine(i.onDragDelta, function (i) { return _this.p.o2(i); });
            var j = this.k;
            j.onDragStarted = delegateCombine(j.onDragStarted, function (j) { return _this.p.o3(j, true); });
            var k = this.k;
            k.onKeyDown = delegateCombine(k.onKeyDown, runOn(this.p, this.p.fw));
            var l = this.k;
            l.onMouseDown = delegateCombine(l.onMouseDown, runOn(this, this.c6));
            var m = this.k;
            m.onMouseLeave = delegateCombine(m.onMouseLeave, runOn(this, this.c7));
            var n = this.k;
            n.onMouseOver = delegateCombine(n.onMouseOver, runOn(this, this.c8));
            var o = this.k;
            o.onMouseUp = delegateCombine(o.onMouseUp, runOn(this, this.c9));
            var p = this.k;
            p.onMouseWheel = delegateCombine(p.onMouseWheel, runOn(this.p, this.p.fx));
            if (this.k.an) {
                var q = this.k;
                q.onZoomDelta = delegateCombine(q.onZoomDelta, function (q, r, s, t) { return _this.p.p8(q, r, s, t); });
                var r = this.k;
                r.onZoomStarted = delegateCombine(r.onZoomStarted, function (r, s, t, u) { return _this.p.qc(r, s, t, u); });
                var s = this.k;
                s.onZoomCompleted = delegateCombine(s.onZoomCompleted, function (s, t, u, v) {
                    if (_this.k.af) {
                        _this.p.p4();
                    }
                    _this.p.p7(s, t, u, v);
                });
            }
            else {
                var t = this.k;
                t.onPinchDelta = delegateCombine(t.onPinchDelta, function (t, u) { return _this.p.pk(u); });
                var u = this.k;
                u.onPinchStarted = delegateCombine(u.onPinchStarted, function (u, v) { return _this.p.pl(u); });
                var v = this.k;
                v.onGestureCompleted = delegateCombine(v.onGestureCompleted, function (v, w) { return _this.p.o6(v); });
            }
            var w = this.k;
            w.onDoubleTap = delegateCombine(w.onDoubleTap, function (w) { return _this.p.o0(w); });
            var x = this.k;
            x.onHold = delegateCombine(x.onHold, runOn(this, this.c3));
        }
        if (this.p.c2 != null) {
            this.p.c2.provideContext(this.z);
            this.p.c2.provideContainer(a);
            this.p.c2.provideEventSource(this.k);
        }
        try {
            for (var _c = __values(fromEnum(this.b)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var y = _d.value;
                y.a5.a2();
                this.bo(y);
            }
        }
        catch (e_26_1) {
            e_26 = { error: e_26_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_26)
                    throw e_26.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(this.g)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var z = _f.value;
                this.bp(z);
            }
        }
        catch (e_27_1) {
            e_27 = { error: e_27_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_27)
                    throw e_27.error;
            }
        }
    };
    SeriesViewerView.prototype.al = function (a, b, c) {
        if (this.p.el) {
            return false;
        }
        return true;
    };
    SeriesViewerView.prototype.cy = function (a, b) {
        this.p.os(a, b);
    };
    SeriesViewerView.prototype.cz = function (a, b) {
        this.p.bb.f$w(this.p, a, b);
    };
    SeriesViewerView.prototype.c3 = function (a) {
        this.p.pm(a);
    };
    SeriesViewerView.prototype.cx = function (a, b, c) {
        this.p.or(a, b, c);
    };
    SeriesViewerView.prototype.du = function (a) {
    };
    SeriesViewerView.prototype.get_ap = function () {
        return false;
    };
    Object.defineProperty(SeriesViewerView.prototype, "ap", {
        get: function () {
            return this.get_ap();
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.ef = function () {
        this.a9 = FontUtil.getCurrentFontHeight(this.j.ae, this.p.getFontInfo());
    };
    SeriesViewerView.prototype.f = function (a, b, c, d) {
        var _this = this;
        return {
            ret: ((function () { var e = _this.p.bb.f$c(_this.p, _this.g, _this.x, a, b, c, d); c = e.p5; return e.ret; })()),
            p2: c
        };
    };
    SeriesViewerView.prototype.bd = function () {
        return this.a8;
    };
    SeriesViewerView.prototype.bc = function () {
        return this.a7;
    };
    SeriesViewerView.prototype.cu = function () {
        this.j.bd();
    };
    SeriesViewerView.prototype.c1 = function (a, b) {
        var c = this.a8;
        var d = this.a7;
        if (this.a8 != a) {
            this.aj = true;
        }
        this.a8 = a;
        if (this.a7 != b) {
            this.aj = true;
        }
        this.a7 = b;
        if (this.aj) {
            var e = new Size(1, c, d);
            var f = new Size(1, a, b);
            this.p.p3(e, f);
        }
        this.dj();
        this.d3();
        this.p.ov();
        this.p.al.r(this.y, this.x);
    };
    SeriesViewerView.prototype.b6 = function (a) {
        this.fg = a;
    };
    SeriesViewerView.prototype.b9 = function (a) {
        this.fh = a;
    };
    SeriesViewerView.prototype.b8 = function () {
        this.a.r(this.z, null);
    };
    SeriesViewerView.prototype.d3 = function () {
        if (this.p.destroyed) {
            return;
        }
        this.ag = true;
        this.p.ar.z();
    };
    SeriesViewerView.prototype.b2 = function () {
        var e_28, _a, e_29, _b, e_30, _c, e_31, _d;
        var _this = this;
        if (this.a8 == 0 || this.a7 == 0) {
            return;
        }
        this.ag = false;
        this.aa = false;
        if (this.ak) {
            this.di();
            this.de();
            this.ak = false;
            this.cq();
        }
        var a = this.a8;
        var b = this.a7;
        var c = this.p.h2;
        var d = this.p.h7;
        var e = this.p.hp;
        var f = this.p.ih;
        var g = this.p.hn;
        var h = this.p.ho;
        if (isNaN_(g)) {
            g = this.a9 / 2;
        }
        if (isNaN_(h)) {
            h = 0;
        }
        var i = this.p.f3();
        var j = new List$1(AxisLabelPanelBase.$, 0);
        try {
            for (var _e = __values(fromEnum(this.b)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var k = _f.value;
                if (k.aw != null) {
                    j.add(k.aw);
                    k.aw.bx = function () { return _this.aj; };
                }
            }
        }
        catch (e_28_1) {
            e_28 = { error: e_28_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_a = _e.return))
                    _a.call(_e);
            }
            finally {
                if (e_28)
                    throw e_28.error;
            }
        }
        if (i) {
            var l = false;
            var m = false;
            var n = false;
            var o = false;
            try {
                for (var _g = __values(fromEnum(j)), _h = _g.next(); !_h.done; _h = _g.next()) {
                    var p = _h.value;
                    if (LabelPanelArranger.b(p) == 2 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        l = true;
                    }
                    if (LabelPanelArranger.b(p) == 3 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        m = true;
                    }
                    if (LabelPanelArranger.b(p) == 0 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        n = true;
                    }
                    if (LabelPanelArranger.b(p) == 1 && (p.ad.az == null || p.ad.az.visibility == 0)) {
                        o = true;
                    }
                    if (p.ad != null && p.ad.az != null) {
                        p.ad.az.c = p.ad.az.location;
                    }
                }
            }
            catch (e_29_1) {
                e_29 = { error: e_29_1 };
            }
            finally {
                try {
                    if (_h && !_h.done && (_b = _g.return))
                        _b.call(_g);
                }
                finally {
                    if (e_29)
                        throw e_29.error;
                }
            }
            if (l || m) {
                if (!n && isNaN_(f)) {
                    f = g;
                }
                if (!o && isNaN_(e)) {
                    e = g;
                }
            }
            if (o || n) {
                if (!l && isNaN_(c)) {
                    c = h;
                }
                if (!m && isNaN_(d)) {
                    d = h;
                }
            }
        }
        if (isNaN_(f)) {
            f = 0;
        }
        if (isNaN_(c)) {
            c = 0;
        }
        if (isNaN_(d)) {
            d = 0;
        }
        if (isNaN_(e)) {
            e = 0;
        }
        var q = this.bf();
        f += q;
        var r = this.be();
        f += r;
        var s = new Rect(0, c, f, a - (c + d), b - (f + e));
        s = LabelPanelArranger.e(j, s);
        var t = new Size(1, Math.max(0, a - (c + d)), Math.max(0, b - (f + e)));
        this.a1 = f - (q + r);
        this.az = c;
        this.a0 = d;
        this.ay = e;
        this.e9 = s;
        var u = ((function () {
            var $ret = new LabelPanelsArrangeState();
            $ret.f = c;
            $ret.c = c;
            $ret.a = f + t.height;
            $ret.b = f + t.height;
            $ret.g = c + t.width;
            $ret.d = c + t.width;
            $ret.h = f;
            $ret.e = f;
            return $ret;
        })());
        LabelPanelArranger.d(j, u, this.e9, function (v, w) {
            if (!v.c1.equals1(w)) {
                if (v.ad != null) {
                    v.ad.cr = true;
                }
                v.c1 = w;
                v.ad.a5.ai();
            }
        });
        var v = false;
        if (this.aj) {
            this.aj = false;
            v = true;
        }
        this.p.qg(this.p.wk, this.e9);
        try {
            for (var _j = __values(fromEnum(this.b)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var w = _k.value;
                if (Rect.l_op_Equality(w.kh, null) || w.kh.isEmpty) {
                    this.aa = true;
                }
                if (w.kh.equals1(this.e9) && !this.j.y()) {
                    continue;
                }
                w.hs(w.kh, this.e9);
            }
        }
        catch (e_30_1) {
            e_30 = { error: e_30_1 };
        }
        finally {
            try {
                if (_k && !_k.done && (_c = _j.return))
                    _c.call(_j);
            }
            finally {
                if (e_30)
                    throw e_30.error;
            }
        }
        try {
            for (var _l = __values(fromEnum(this.g)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var x = _m.value;
                if (Rect.l_op_Equality(x.cv.bx, null) || x.cv.bx.isEmpty) {
                    this.aa = true;
                }
                if (x.cv.bx.equals1(this.e9) && !this.j.y()) {
                    continue;
                }
                x.q1(x.cv.bx, this.e9);
            }
        }
        catch (e_31_1) {
            e_31 = { error: e_31_1 };
        }
        finally {
            try {
                if (_m && !_m.done && (_d = _l.return))
                    _d.call(_l);
            }
            finally {
                if (e_31)
                    throw e_31.error;
            }
        }
        this.ek();
        this.dv(this.e9);
        this.j.bc(false);
    };
    SeriesViewerView.prototype.ek = function () {
        if (this.p.c2 != null && !this.e9.isEmpty) {
            var a = this.p.c2;
            var b = (this.p.eg) ? this.e9.width : Number.POSITIVE_INFINITY;
            var c = (this.p.eg) ? this.e9.height : Number.POSITIVE_INFINITY;
            var d = a.getDesiredSize(new Size(1, b, c));
            this.p.c2.arrange(new Rect(0, this.e9.right - d.width, this.e9.bottom - d.height, d.width, d.height));
            this.em();
        }
    };
    SeriesViewerView.prototype.v = function () {
        var a = this.p.getFontInfo();
        var b = this.s();
        if (this.p.dj() != null) {
            a = this.p.dj();
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.u = function () {
        var a = this.p.getFontInfo();
        var b = this.r();
        if (this.p.di() != null) {
            a = this.p.di();
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.e5 = function () {
        var a = this.p.getFontBrush();
        var b = this.e2();
        if (this.p.vq != null) {
            a = this.p.vq;
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.e4 = function () {
        var a = this.p.getFontBrush();
        var b = this.e1();
        if (this.p.vp != null) {
            a = this.p.vp;
        }
        else if (b != null) {
            a = b;
        }
        return a;
    };
    SeriesViewerView.prototype.bf = function () {
        if (this.p.l3 == null || !(typeCast(XamDataChart.$, this.p) !== null)) {
            return 0;
        }
        var a = this.v();
        var b = 0;
        b = FontUtil.getCurrentFontHeight(this.j.ae, a);
        var c = this.fm();
        b += c.top + c.bottom;
        return b;
    };
    SeriesViewerView.prototype.be = function () {
        if (this.p.lr == null || !(typeCast(XamDataChart.$, this.p) !== null)) {
            return 0;
        }
        if (!isNaN_(this.a2)) {
            return this.a2;
        }
        var a = this.u();
        this.a2 = FontUtil.getCurrentFontHeight(this.j.ae, a);
        var b = this.fl();
        this.a2 += b.top + b.bottom;
        return this.a2;
    };
    SeriesViewerView.prototype.fm = function () {
        var a = this.j.ce();
        var b = isNaN_(this.p.ig) ? a.top : this.p.ig;
        var c = isNaN_(this.p.id) ? a.left : this.p.id;
        var d = isNaN_(this.p.ie) ? a.right : this.p.ie;
        var e = isNaN_(this.p.ic) ? a.bottom : this.p.ic;
        return new Thickness(1, c, b, d, e);
    };
    SeriesViewerView.prototype.fl = function () {
        var a = this.j.cd();
        var b = isNaN_(this.p.ib) ? a.top : this.p.ib;
        var c = isNaN_(this.p.h9) ? a.left : this.p.h9;
        var d = isNaN_(this.p.ia) ? a.right : this.p.ia;
        var e = isNaN_(this.p.h8) ? a.bottom : this.p.h8;
        return new Thickness(1, c, b, d, e);
    };
    SeriesViewerView.prototype.dv = function (a) {
    };
    SeriesViewerView.prototype.cq = function () {
        if (!this.af) {
            if (this.z != null) {
                this.af = true;
                this.a.r(this.z, null);
            }
        }
    };
    SeriesViewerView.prototype.d0 = function () {
        if (this.z == null) {
            return;
        }
        if (this.z.d) {
            if (this.p.hi != 1) {
                this.z.aa();
                this.z.ab(this.p.hi, this.p.hi);
            }
            if (!this.fa.isEmpty) {
                if (!this.au) {
                    if (!this.z.e) {
                        this.z.l(this.fa.left, this.fa.top, this.fa.width, this.fa.height);
                    }
                }
            }
        }
        this.d1();
        if (this.z.d) {
            if (this.p.hi != 1) {
                this.z.z();
            }
        }
    };
    SeriesViewerView.prototype.isValid = function () {
        return true;
    };
    SeriesViewerView.prototype.preRender = function () {
        this.j.a6(this.a8, this.a7);
        this.ds();
    };
    SeriesViewerView.prototype.ds = function () {
    };
    SeriesViewerView.prototype.d1 = function () {
        if (this.z.d) {
            this.fa = new Rect(0, 0, 0, this.a8, this.a7);
            if (this.ax != null && this.ax.count > 0) {
                this.ci();
                this.z.aa();
                this.z.af(this.p.wk);
                if (!this.au) {
                    if (!this.z.e) {
                        this.z.l(this.p.wk.left, this.p.wk.top, this.p.wk.width, this.p.wk.height);
                    }
                }
            }
            this.z.s(this.fd);
            this.z.s(this.fe);
            this.z.t(this.ff);
            this.z.w(this.fi);
            this.z.ad(this.v());
            if (this.et != null) {
                this.et.ao = this.e5();
                this.z.x(this.et);
            }
            this.z.ad(this.u());
            if (this.es != null) {
                this.es.ao = this.e4();
                this.z.x(this.es);
            }
            if (this.ax != null && this.ax.count > 0) {
                this.j.bl(this.ax);
                this.z.z();
            }
            if (this.ar) {
                this.eb();
                this.ar = false;
                this.ax.clear();
                this.p.bb.f$l(this.p);
                this.cq();
            }
            if (this.p.em) {
                if (this.fh != null) {
                    this.z.w(this.fh);
                }
                if (this.fg != null) {
                    this.z.w(this.fg);
                }
            }
        }
    };
    SeriesViewerView.prototype.c2 = function () {
        this.j.bh();
    };
    SeriesViewerView.prototype.cw = function () {
        this.j.bf();
    };
    SeriesViewerView.prototype.fb = function () {
        return new Rect(0, 0, 0, this.a8, this.a7);
    };
    SeriesViewerView.prototype.e8 = function () {
        return this.j.b8();
    };
    SeriesViewerView.prototype.d6 = function () {
        this.p.r1 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.d;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.sa = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.m;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r7 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.j;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r8 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.k;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r2 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.e;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r5 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.h;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r3 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.f;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r9 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.l;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r6 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.i;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
        this.p.r4 = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.g;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
    };
    SeriesViewerView.prototype.ee = function () {
        this.j.bp();
        this.d4();
        var a = this.a9;
        this.ef();
        if (a != this.a9) {
            this.p.n3();
        }
    };
    SeriesViewerView.prototype.dp = function () {
        if (this.p.wq == 0) {
            this.cn();
            this.p.nz();
        }
        if (this.p.c2 != null) {
            var a = this.p.wq;
            this.p.c2.visibility = a;
            this.p.c2.doRefresh(false);
        }
    };
    SeriesViewerView.prototype.as = function (a) {
        return this.p.bb.f$i(this.p, a);
    };
    SeriesViewerView.prototype.c8 = function (a, b, c) {
        this.p.bb.f$z(this.p, this.g, this.x, a, b, c);
        this.p.nd(a, this.p.c0 != 0 || this.p.fp);
    };
    SeriesViewerView.prototype.c7 = function (a) {
        this.p.bb.f$y(this.p, a);
    };
    SeriesViewerView.prototype.c6 = function (a) {
        this.p.bb.f$x(this.p, this.k, a);
    };
    SeriesViewerView.prototype.c9 = function (a) {
        this.p.bb.f$aa(this.p, this.k, a);
    };
    SeriesViewerView.prototype.d4 = function () {
    };
    Object.defineProperty(SeriesViewerView.prototype, "ez", {
        get: function () {
            return this.k.bi;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.eq = function (a) {
        if (this.k != null) {
            this.k.bl = this.p.wk;
        }
    };
    SeriesViewerView.prototype.cr = function (a) {
        this.p.bb.f$ad(this.p, a);
        this.p.eg = a;
    };
    SeriesViewerView.prototype.bk = function (a) {
        this.p.rm();
        this.j.bw(a);
        if (this.p.c2 != null) {
            this.p.c2.mobileMode = a;
        }
        this.el();
    };
    SeriesViewerView.prototype.el = function () {
        this.p.rs();
    };
    Object.defineProperty(SeriesViewerView.prototype, "isDirty", {
        get: function () {
            return this.af;
        },
        set: function (a) {
            this.af = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.undirty = function (a) {
        this.af = false;
        this.d0();
    };
    Object.defineProperty(SeriesViewerView.prototype, "index", {
        get: function () {
            return 10;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.postRender = function () {
    };
    SeriesViewerView.prototype.b7 = function () {
        this.d3();
    };
    SeriesViewerView.prototype.ch = function () {
        this.j.a9();
    };
    SeriesViewerView.prototype.ea = function () {
        this.j.bo();
    };
    SeriesViewerView.prototype.bv = function (a) {
        this.j.ay();
    };
    SeriesViewerView.prototype.bm = function (a) {
        this.j.au(a);
    };
    SeriesViewerView.prototype.ei = function (a) {
        this.j.bu(a);
    };
    SeriesViewerView.prototype.ej = function (a) {
        this.j.bv(a);
    };
    SeriesViewerView.prototype.bn = function (a) {
        this.j.av(a);
    };
    SeriesViewerView.prototype.dz = function (a) {
        this.j.bk(a);
    };
    SeriesViewerView.prototype.da = function (a) {
        this.p.al.r(this.y, this.z);
    };
    SeriesViewerView.prototype.bu = function (a) {
    };
    SeriesViewerView.prototype.m = function (a) {
        if (this.p.eg) {
            return 2;
        }
        else {
            return 1;
        }
    };
    SeriesViewerView.prototype.c5 = function () {
        if (this.k != null) {
            this.k.ae = this.p.ff;
        }
        if (this.n != null) {
            this.n.isSurfaceInteractionDisabled = this.p.ff;
        }
    };
    SeriesViewerView.prototype.bb = function (a, b) {
        if (a == null || this.z == null) {
            return 0;
        }
        this.z.ad(b);
        return this.z.f(a);
    };
    SeriesViewerView.prototype.ba = function (a, b) {
        if (a == null) {
            return 0;
        }
        var c = 0;
        c = FontUtil.getCurrentFontHeight(this.j.ae, b);
        return c;
    };
    SeriesViewerView.prototype.dj = function () {
        this.ak = true;
        this.d3();
        this.cq();
    };
    SeriesViewerView.prototype.eu = function (a, b, c, d) {
        if (a == null) {
            return null;
        }
        var e = ((function () {
            var $ret = new TextBlock();
            $ret.al = a;
            $ret.o = b.top;
            return $ret;
        })());
        var f = this.bb(e, c);
        e.o = b.top;
        var g = this.ba(a, c);
        e.m = f;
        e.l = g;
        switch (d) {
            case 0:
                e.n = b.left;
                break;
            case 2:
                e.n = Math.max((this.a8 - b.right) - f, b.left);
                break;
            case 1:
            case 3:
            default:
                var h = (this.a8 / 2) - (f / 2);
                h += b.left;
                h -= b.right;
                e.n = h;
                break;
        }
        return e;
    };
    SeriesViewerView.prototype.di = function () {
        this.et = typeCast(XamDataChart.$, this.p) !== null ? this.eu(this.p.l3, this.fm(), this.v(), this.ey()) : null;
    };
    SeriesViewerView.prototype.de = function () {
        this.a2 = NaN;
        this.es = typeCast(XamDataChart.$, this.p) !== null ? this.eu(this.p.lr, this.fl(), this.u(), this.ex()) : null;
        if (this.es != null) {
            this.es.o += this.bf();
        }
    };
    SeriesViewerView.prototype.c = function (a) {
        var b = this.j.c();
        if (b == 0) {
            var c = LabelPanelArranger.b(a.aw);
            if (a.aj == null) {
                if (c == 4) {
                    return 4;
                }
                if (c == 5) {
                    return 3;
                }
            }
            else {
                if (c == 4) {
                    return 3;
                }
                if (c == 5) {
                    return 4;
                }
            }
            if (c == 0) {
                return 3;
            }
            return 4;
        }
        return b;
    };
    SeriesViewerView.prototype.d = function (a) {
        var b = this.j.d();
        if (b == 0) {
            var c = LabelPanelArranger.b(a.aw);
            if (a.aj == null) {
                if (c == 7) {
                    return 1;
                }
                if (c == 6) {
                    return 2;
                }
            }
            else {
                if (c == 7) {
                    return 2;
                }
                if (c == 6) {
                    return 1;
                }
            }
            if (c == 3) {
                return 2;
            }
            return 1;
        }
        return b;
    };
    SeriesViewerView.prototype.dk = function () {
        if (!isNaN_(this.p.hh)) {
            if (!isNaN_(DeviceUtils.a(this.p.h3))) {
                this.p.hi = DeviceUtils.a(this.p.h3);
            }
            else {
                this.co();
            }
        }
        if (!this.p.e3) {
            this.j.a5();
        }
    };
    SeriesViewerView.prototype.dl = function () {
        if (!isNaN_(DeviceUtils.a(this.p.hh))) {
            this.p.hi = DeviceUtils.a(this.p.hh);
        }
        if (!this.p.e3) {
            this.j.a4();
        }
    };
    SeriesViewerView.prototype.t = function () {
        return this.j.r();
    };
    SeriesViewerView.prototype.e3 = function () {
        return this.j.b7();
    };
    SeriesViewerView.prototype.q = function () {
        return this.j.q();
    };
    SeriesViewerView.prototype.e0 = function () {
        return this.j.b6();
    };
    SeriesViewerView.prototype.s = function () {
        return this.j.p();
    };
    SeriesViewerView.prototype.r = function () {
        return this.j.o();
    };
    SeriesViewerView.prototype.e2 = function () {
        return this.j.b5();
    };
    SeriesViewerView.prototype.e1 = function () {
        return this.j.b4();
    };
    Object.defineProperty(SeriesViewerView.prototype, "a4", {
        get: function () {
            return this.az;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "a5", {
        get: function () {
            return this.a0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "a6", {
        get: function () {
            return this.a1;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "a3", {
        get: function () {
            return this.ay;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "ew", {
        get: function () {
            return this.et;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerView.prototype, "ev", {
        get: function () {
            return this.es;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerView.prototype.fc = function () {
        return new Rect(0, 0, 0, this.a8, this.a7);
    };
    SeriesViewerView.prototype.fk = function () {
        return this.j.cg();
    };
    SeriesViewerView.prototype.fj = function () {
        return this.j.cf();
    };
    SeriesViewerView.prototype.dd = function (a, b) {
        this.ac = true;
    };
    SeriesViewerView.prototype.dh = function (a, b) {
        this.ad = true;
    };
    SeriesViewerView.prototype.ey = function () {
        if (this.ad) {
            return this.p.u0;
        }
        else {
            var a = 1;
            switch (this.j.as()) {
                case "left":
                    a = 0;
                    break;
                case "right":
                    a = 2;
                    break;
            }
            return a;
        }
    };
    SeriesViewerView.prototype.ex = function () {
        if (this.ac) {
            return this.p.uz;
        }
        else {
            var a = 1;
            switch (this.j.ar()) {
                case "left":
                    a = 0;
                    break;
                case "right":
                    a = 2;
                    break;
            }
            return a;
        }
    };
    SeriesViewerView.prototype.bq = function () {
        if (this.ag) {
            this.b2();
            if (this.aa) {
                this.p.ar.y();
            }
            if (this.ag) {
                this.b2();
            }
        }
    };
    SeriesViewerView.prototype.am = function () {
        if (this.p.gk) {
            return false;
        }
        if ((dateNow().getTime() - this.p.gu.getTime()) < 300) {
            return true;
        }
        return false;
    };
    SeriesViewerView.prototype.b5 = function () {
        this.j.a6(this.a8, this.a7);
    };
    SeriesViewerView.prototype.cp = function () {
        this.j.bb(this.p.fe);
    };
    SeriesViewerView.prototype.at = function (a) {
        var b = this.p.v4;
        var c = b.top > 0;
        var d = b.left > 0;
        var e = b.right < 1;
        var f = b.bottom < 1;
        var g = a.y < 0;
        var h = a.y > 0;
        var i = a.x < 0;
        var j = a.x > 0;
        if (c && g) {
            return true;
        }
        if (d && i) {
            return true;
        }
        if (f && h) {
            return true;
        }
        if (j && e) {
            return true;
        }
        return false;
    };
    SeriesViewerView.prototype.dq = function () {
        this.j.bj();
        this.p.al.r(this.y, this.x);
        this.p.am.r(this.y, null);
        this.p.ak.r(this.y, this.x);
        this.a.r(this.z, null);
    };
    SeriesViewerView.prototype.b3 = function (a, b, c) {
        this.ar = false;
        if (this.ax == null) {
            this.ax = new List$1(ITileZoomTile_$type, 0);
        }
        for (var d = 0; d < this.ax.count; d++) {
            while (d < this.ax.count && !a.containsKey(this.ax._inner[d].content)) {
                this.ax.removeAt(d);
            }
        }
        for (var e = 0; e < b.count; e++) {
            this.ax.add(b._inner[e]);
        }
        this.cq();
    };
    SeriesViewerView.prototype.bh = function (a, b, c) {
        return this.j.an(a, b, c);
    };
    SeriesViewerView.prototype.b0 = function () {
        this.j.a2();
    };
    SeriesViewerView.prototype.b1 = function (a) {
        this.j.a3(a);
    };
    SeriesViewerView.prototype.cm = function () {
        if (this.ax == null) {
            return;
        }
        this.ar = true;
        this.cq();
    };
    SeriesViewerView.prototype.by = function () {
        this.j.a0();
    };
    SeriesViewerView.prototype.br = function () {
        this.j.aw();
    };
    SeriesViewerView.prototype.bz = function (a) {
        this.j.a1(a);
        this.p.oy();
    };
    SeriesViewerView.prototype.bs = function () {
        this.j.ax();
        this.p.ow();
    };
    SeriesViewerView.prototype.ci = function () {
        if (this.ah) {
            this.ah = false;
            if (!this.y.e) {
                this.y.l(this.p.wk.left, this.p.wk.top, this.p.wk.width, this.p.wk.height);
            }
            this.p.al.e = true;
        }
    };
    SeriesViewerView.prototype.eb = function () {
        if (!this.ah) {
            this.ah = true;
            this.p.al.e = false;
            this.p.al.r(this.y, this.x);
        }
    };
    SeriesViewerView.prototype.dg = function () {
    };
    SeriesViewerView.prototype.cv = function () {
        this.j.be();
    };
    SeriesViewerView.prototype.db = function () {
        this.ff._fill = this.p.vm == null ? this.j.b3() : this.p.vm;
        this.ff._opacity = isNaN_(this.p.h4) ? 0.1 : this.p.h4;
        this.fi._stroke = this.p.vn == null ? this.j.b3() : this.p.vn;
    };
    SeriesViewerView.prototype.b4 = function (a) {
        if (this.j.ae == null || (this.j.ae != a)) {
            this.p.provideContainer(a);
        }
    };
    SeriesViewerView.prototype.bj = function (a, b, c) {
        return this.j.ao(a, b, c);
    };
    SeriesViewerView.$t = markType(SeriesViewerView, 'SeriesViewerView', Base.$, [ISchedulableRender_$type]);
    return SeriesViewerView;
}(Base));
export { SeriesViewerView };
/**
 * @hidden
 */
var OverviewPlusDetailViewportHost = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(OverviewPlusDetailViewportHost, _super);
    function OverviewPlusDetailViewportHost(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        if (a == null) {
            throw new ArgumentNullException(0, "view");
        }
        _this.a = a;
        return _this;
    }
    OverviewPlusDetailViewportHost.prototype.getViewInfo = function (a, b) {
        a = new Rect(0, 0, 0, this.a.n.worldRectViewport.width, this.a.n.worldRectViewport.height);
        b = SeriesViewer.wg;
        return {
            p0: a,
            p1: b
        };
    };
    OverviewPlusDetailViewportHost.prototype.getEffectiveViewport = function () {
        if (!this.a.p.fd) {
            if (this.a.p.v8.isEmpty) {
                return this.a.p.v8;
            }
            return this.a.p.wd(this.a.n.previewViewportdRect, this.a.p.wk, this.a.p.v8);
        }
        return Rect.empty;
    };
    OverviewPlusDetailViewportHost.prototype.getMainContentViewport = function () {
        if (!this.a.p.fd) {
            if (this.a.p.v7.isEmpty) {
                return this.a.p.v7;
            }
            return Rect.empty;
        }
        return Rect.empty;
    };
    OverviewPlusDetailViewportHost.$t = markType(OverviewPlusDetailViewportHost, 'OverviewPlusDetailViewportHost', Base.$, [IProvidesViewport_$type]);
    return OverviewPlusDetailViewportHost;
}(Base));
export { OverviewPlusDetailViewportHost };
/**
 * @hidden
 */
var LegendTemplates = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(LegendTemplates, _super);
    function LegendTemplates() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    LegendTemplates.af = function (a) {
        var b = a.av();
        switch (b) {
            case 3: return LegendTemplates.y;
            case 4: return LegendTemplates.aa;
            case 0: return LegendTemplates.z;
            case 8: return LegendTemplates.ae;
            case 9: return LegendTemplates.ac;
            case 5: return LegendTemplates.ah;
            case 1:
            case 2: return LegendTemplates.ad;
            case 6:
            case 7: return LegendTemplates.ab;
        }
        return LegendTemplates.ah;
    };
    LegendTemplates.a = function (a) {
        return new RenderingContext(new CanvasViewRenderer(), a.context);
    };
    LegendTemplates.v = function (a) {
        var b = typeCast(Series.$, a.series);
        if (b == null || b.bd == 0) {
            a.thickness = Defaults.v;
        }
        else {
            a.thickness = b.id;
        }
        if (a.itemBrush != null) {
            a.actualItemBrush = a.itemBrush;
        }
        else {
            if (b != null) {
                a.actualItemBrush = b.va;
            }
        }
        if (a.outline == null) {
            if (b != null) {
                a.m = a.outline;
                a.outline = b.vb;
            }
        }
    };
    LegendTemplates.b = function (a, b, c) {
        var d = (c - b) / 2;
        return a + d;
    };
    LegendTemplates.c = function (a, b, c) {
        var d = (c - b) / 2;
        return a + d;
    };
    LegendTemplates.u = function (a, b, c, d, e, f, g, h) {
        var i = DeviceUtils.g(Defaults.w);
        var j = DeviceUtils.g(Defaults.u);
        var k = LegendTemplates.c(f, j, a.availableHeight);
        var l = LegendTemplates.c(h, j, a.availableHeight);
        var m = LegendTemplates.b(e, i, a.availableWidth);
        var n = LegendTemplates.b(g, i, a.availableWidth);
        var o = ((function () {
            var $ret = new PathFigure();
            $ret.isClosed = true;
            $ret.isFilled = true;
            return $ret;
        })());
        o._startPoint = { $type: Point_$type, x: m, y: l };
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: m, y: l }));
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: n, y: l }));
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: n, y: k }));
        o._segments.add(new LineSegment(0, { $type: Point_$type, x: m, y: k }));
        var p = new PathGeometry();
        p.c.add(o);
        var q = new Path();
        q.an = p;
        q.ad = b;
        q._stroke = c;
        q._fill = d;
        var r = LegendTemplates.a(a);
        r.t(q);
    };
    LegendTemplates.s = function (a) {
        var b = a.data;
        var c = b.series;
        LegendTemplates.v(b);
        var d = DeviceUtils.g(Defaults.w);
        var e = DeviceUtils.g(Defaults.u);
        var f = new Line();
        f.an = LegendTemplates.b(0, d, a.availableWidth);
        f.ap = a.availableHeight / 2;
        f.ao = LegendTemplates.b(d, d, a.availableWidth);
        f.aq = a.availableHeight / 2;
        f._stroke = b.actualItemBrush;
        if (c.bd == 0) {
            f.ad = Defaults.v;
        }
        else {
            f.ad = c.id;
            f.al = c.v3;
            f.ak = c.v3;
            f.ai = c.v1;
            f.ac = c.jg;
            f.am = c.v4;
        }
        var g = LegendTemplates.a(a);
        g.s(f);
    };
    LegendTemplates.r = function (a, b, c) {
        var d = a.data;
        LegendTemplates.v(d);
        var e = DeviceUtils.g(Defaults.w);
        var f = DeviceUtils.g(Defaults.u);
        var g = e / 2;
        var h = f / 2;
        var i = LegendTemplates.b(g, e, a.availableWidth);
        var j = LegendTemplates.c(h, f, a.availableHeight);
        var k = new EllipseGeometry();
        k.e = { $type: Point_$type, x: i, y: j };
        k.c = g;
        k.d = h;
        var l = new Path();
        l.an = k;
        l.ad = d.thickness;
        l._stroke = d.outline;
        l._fill = d.actualItemBrush;
        var m = LegendTemplates.a(a);
        m.t(l);
    };
    LegendTemplates.t = function (a, b) {
        if (b === void 0) {
            b = 0;
        }
        var c = a.data;
        var d = DeviceUtils.g(Defaults.w - b);
        var e = DeviceUtils.g(Defaults.u - b);
        var f = new DataTemplateMeasureInfo();
        f.passInfo = a.passInfo;
        f.width = d;
        f.height = e;
        f.data = a.data;
        f.context = a.context;
        f.renderContext = a.renderContext;
        var g = c.actualItemBrush;
        var h = c.itemBrush;
        var i = c.outline;
        var j = c.series;
        var k = j.sy();
        c.actualItemBrush = j.vk();
        c.outline = j.vl();
        if (c.itemBrush != null) {
            c.actualItemBrush = c.itemBrush;
        }
        if (c.m != null) {
            c.outline = c.m;
        }
        if (j.bd == 1) {
            c.thickness = j.im();
        }
        else {
            c.thickness = Defaults.ab;
        }
        if (k != null && k.measure != null && k.render != null) {
            var l = new DataTemplateRenderInfo();
            l.passInfo = a.passInfo;
            l.availableWidth = f.width;
            l.availableHeight = f.height;
            l.xPosition = (a.availableWidth / 2);
            l.yPosition = (a.availableHeight / 2);
            l.data = a.data;
            l.context = a.context;
            l.renderContext = a.renderContext;
            k.render(l);
        }
        c.itemBrush = h;
        c.actualItemBrush = g;
        c.outline = i;
    };
    LegendTemplates.j = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        LegendTemplates.r(a, Defaults.w, Defaults.u);
    };
    LegendTemplates.n = function (a) {
        var b = a.data;
        var c = b.series;
        LegendTemplates.s(a);
        if (c.bd == 1) {
            LegendTemplates.t(a, Defaults.t);
        }
    };
    LegendTemplates.o = function (a) {
        LegendTemplates.t(a, 0);
    };
    LegendTemplates.q = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, 0, 0, Defaults.w, Defaults.u);
    };
    LegendTemplates.p = function (a) {
        var b = a.data;
        var c = b.series;
        LegendTemplates.v(b);
        if (c.bd == 0) {
            var d = Defaults.v;
            var e = b.actualItemBrush;
            var f = c.vb;
            var g = Defaults.w;
            var h = Defaults.u;
            LegendTemplates.u(a, d, f, e, 0, 0, g, h);
        }
        else {
            var i = Defaults.v;
            var j = b.actualItemBrush;
            var k = c.vv();
            var l = Defaults.w / 2;
            var m = Defaults.w;
            var n = Defaults.u;
            LegendTemplates.u(a, i, j, j, 0, 0, l, n);
            LegendTemplates.u(a, i, k, k, l, 0, m, n);
        }
    };
    LegendTemplates.i = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        var c = 0;
        var d = Defaults.w;
        var e = (Defaults.u * 0.25);
        var f = (Defaults.u * 0.75);
        LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, c, e, d, f);
    };
    LegendTemplates.l = function (a) {
        var b = a.data;
        LegendTemplates.v(b);
        var c = (Defaults.w * 0.25);
        var d = (Defaults.w * 0.75);
        var e = Defaults.u;
        var f = 0;
        LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, c, f, d, e);
    };
    LegendTemplates.m = function (a) {
        var b = a.data;
        var c = BrushUtil.h(0, 0, 0, 0);
        var d = BrushUtil.h(0, 0, 0, 0);
        LegendTemplates.u(a, Defaults.v, c, d, 0, 0, Defaults.w, Defaults.u);
    };
    LegendTemplates.k = function (a) {
    };
    LegendTemplates.g = function (a) {
        var b = a.data;
        var c = b.series;
        var d = c.legendItemBadgeTemplate;
        if (d == null) {
            d = LegendTemplates.af(c);
        }
        var e = c.title;
        if (e == null) {
            e = "Series Title";
        }
        LegendItemHelper.d(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo, c.a5 != null && c.a5.isFinancial, c.il, c.jh);
    };
    LegendTemplates.resolveLegendItemTemplate = function (a) {
        switch (a) {
            case 0: return LegendTemplates.w;
            case 1: return LegendTemplates.x;
        }
        return LegendTemplates.w;
    };
    LegendTemplates.e = function (a) {
        var b = a.data;
        var c = b.series;
        var d = c.legendItemBadgeTemplate;
        if (d == null) {
            d = LegendTemplates.af(c);
        }
        var e = b.legendLabel != null ? b.legendLabel : b.itemLabel;
        if (e == null) {
            e = "Series Item";
        }
        LegendItemHelper.c(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo);
    };
    LegendTemplates.f = function (a) {
    };
    LegendTemplates.d = function (a) {
    };
    LegendTemplates.h = function (a) {
    };
    LegendTemplates.$t = markType(LegendTemplates, 'LegendTemplates');
    LegendTemplates.z = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.j;
        return $ret;
    })());
    LegendTemplates.ae = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.o;
        return $ret;
    })());
    LegendTemplates.ad = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.n;
        return $ret;
    })());
    LegendTemplates.ah = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.q;
        return $ret;
    })());
    LegendTemplates.ab = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.p;
        return $ret;
    })());
    LegendTemplates.y = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.i;
        return $ret;
    })());
    LegendTemplates.aa = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.l;
        return $ret;
    })());
    LegendTemplates.ac = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.m;
        return $ret;
    })());
    LegendTemplates.w = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.g;
        return $ret;
    })());
    LegendTemplates.x = ((function () {
        var $ret = new DataTemplate();
        $ret.measure = LegendTemplates.d;
        $ret.render = LegendTemplates.e;
        return $ret;
    })());
    return LegendTemplates;
}(Base));
export { LegendTemplates };
/**
 * @hidden
 */
var SeriesViewerViewManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewerViewManager, _super);
    function SeriesViewerViewManager(a) {
        var _this = _super.call(this) || this;
        _this.ae = null;
        _this.af = null;
        _this.aj = null;
        _this.ai = null;
        _this.ag = null;
        _this.ak = null;
        _this.t = null;
        _this.w = null;
        _this.v = null;
        _this.u = null;
        _this.x = null;
        _this.f = null;
        _this.j = null;
        _this.ah = null;
        _this.ab = 0;
        _this.aa = 0;
        _this.ac = 1;
        _this.ad = 0;
        _this.l = null;
        _this.ca = new Thickness(0, 0);
        _this.aq = null;
        _this.ap = stringEmpty();
        _this.b9 = new Thickness(0, 0);
        _this.b0 = null;
        _this.bz = null;
        _this.k = null;
        _this.a = 0;
        _this.b = 0;
        _this.n = null;
        _this.b2 = null;
        _this.m = null;
        _this.b1 = null;
        _this.cb = new Thickness(0, 0);
        _this.cc = new Thickness(0, 0);
        _this.h = null;
        _this.z = new Dictionary$2(String_$type, Tuple$2.$.specialize(DomWrapper_$type, RenderingContext.$), 0);
        _this.al = -1;
        _this.am = -1;
        _this.s = null;
        _this.j = a;
        return _this;
    }
    SeriesViewerViewManager.prototype.bj = function () {
    };
    SeriesViewerViewManager.prototype.bg = function (a) {
        if (a == null) {
            if (this.f != null) {
                this.f.av();
            }
            this.ae = null;
            if (this.af != null) {
                this.af.remove();
            }
            this.af = null;
            if (this.aj != null) {
                this.aj.remove();
            }
            this.aj = null;
            if (this.ai != null) {
                this.ai.remove();
            }
            this.ai = null;
            if (this.ag != null) {
                this.ag.remove();
            }
            this.ag = null;
            if (this.ak != null) {
                this.ak.remove();
            }
            this.ak = null;
            this.t = null;
            this.w = null;
            this.v = null;
            this.u = null;
            if (this.ah != null) {
                this.ah.remove();
            }
            this.ah = null;
            this.f = null;
            this.j.p.dc.u(null);
            this.j.p.de.u(null);
            this.j.p.db.u(null);
            this.j.p.dd.u(null);
            this.j.p.al.m(null);
            this.j.p.am.m(null);
            this.j.p.ak.m(null);
            this.j.a.m(null);
            return;
        }
        this.ae = a;
        this.j.p.dc.u(this.ae);
        this.j.p.de.u(this.ae);
        this.j.p.db.u(this.ae);
        this.j.p.dd.u(this.ae);
        this.j.p.al.m(this.ae);
        this.j.p.am.m(this.ae);
        this.j.p.ak.m(this.ae);
        this.j.a.m(this.ae);
        this.j.p.ar.aa(this.ae);
        this.bi();
        this.ae.rootWrapper.setStyleProperty("position", "relative");
        this.af = this.ae.createElement("canvas");
        this.af.setStyleProperty("position", "absolute");
        this.af.setStyleProperty("top", "0px");
        this.af.setStyleProperty("left", "0px");
        this.aj = this.ae.createElement("canvas");
        this.aj.setStyleProperty("position", "absolute");
        this.aj.setStyleProperty("top", "0px");
        this.aj.setStyleProperty("left", "0px");
        this.ai = this.ae.createElement("canvas");
        this.ai.setStyleProperty("position", "absolute");
        this.ai.setStyleProperty("top", "0px");
        this.ai.setStyleProperty("left", "0px");
        this.ag = this.ae.createElement("canvas");
        this.ag.setStyleProperty("position", "absolute");
        this.ag.setStyleProperty("top", "0px");
        this.ag.setStyleProperty("left", "0px");
        this.ak = this.ae.createElement("canvas");
        this.ak.setStyleProperty("position", "absolute");
        this.ak.setStyleProperty("top", "0px");
        this.ak.setStyleProperty("left", "0px");
        this.ae.append(this.af);
        this.ae.append(this.ai);
        this.ae.append(this.aj);
        this.t = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.af));
        this.w = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.aj));
        this.v = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ai));
        if (this.j.p.au != 1) {
            this.u = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ag));
            this.s = this.u;
        }
        else {
            this.u = new RenderingContext(null, null);
        }
        this.x = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ak));
        this.j.du(this.t);
        this.j.c1(this.ae.rootWrapper.width(), this.ae.rootWrapper.height());
        {
            if ((TypeRegistrar.isRegistered('CanvasGestureDOMEventProxy'))) {
                var overlayCanvas_ = this.aj;
                var container_ = this.ae;
                this.f = (TypeRegistrar.create('CanvasGestureDOMEventProxy', overlayCanvas_, container_, false));
            }
            else {
                this.f = null;
            }
            if (this.f != null) {
                this.f.ap = runOn(this.j, this.j.at);
            }
        }
        this.ah = this.ae.createElement("div");
        this.ah.hide();
        this.ah.setStyleProperty("position", "absolute");
        this.ah.setStyleProperty("z-index", "10000");
        this.ah.addClass(this.j.p.md);
        this.ae.append(this.ah);
    };
    SeriesViewerViewManager.by = function (a, b) {
        b();
        return;
    };
    SeriesViewerViewManager.prototype.bi = function () {
        this.j.d4();
        this.j.ef();
        this.bp();
    };
    SeriesViewerViewManager.prototype.ba = function () {
        var a = this.j.p.h3;
        var b = this.j.p.hi;
        if (!isNaN_(a) && a != 0) {
            return;
        }
        if (window.devicePixelRatio != undefined && window.devicePixelRatio != b) {
            this.j.p.hi = window.devicePixelRatio;
        }
    };
    SeriesViewerViewManager.prototype.g = function () {
        if ((TypeRegistrar.isRegistered('XamOverviewPlusDetailPane'))) {
            var overlayCanvas_ = this.aj;
            var container_ = this.ae;
            return (TypeRegistrar.create('XamOverviewPlusDetailPane'));
        }
        return null;
    };
    SeriesViewerViewManager.prototype.bm = function () {
        this.aj.setStyleProperty("cursor", "default");
    };
    SeriesViewerViewManager.prototype.bn = function () {
        this.aj.setStyleProperty("cursor", "pointer");
    };
    SeriesViewerViewManager.prototype.b3 = function () {
        return ((function () {
            var $ret = new Brush();
            $ret.fill = "#000000";
            return $ret;
        })());
    };
    SeriesViewerViewManager.prototype.az = function (a, b, c) {
        this.ab = a;
        this.aa = b;
        this.ac = c;
        var d = a;
        var e = b;
        if (c != 1) {
            d = Math.round(a * c);
            e = Math.round(b * c);
        }
        if (this.af != null) {
            this.af.setAttribute("width", d.toString());
            this.af.setAttribute("height", e.toString());
            this.af.setStyleProperty("width", a.toString() + "px");
            this.af.setStyleProperty("height", b.toString() + "px");
        }
        if (this.aj != null) {
            this.aj.setAttribute("width", d.toString());
            this.aj.setAttribute("height", e.toString());
            this.aj.setStyleProperty("width", a.toString() + "px");
            this.aj.setStyleProperty("height", b.toString() + "px");
            this.aj.setAttribute("tabindex", "0");
            this.aj.setStyleProperty("outline", "0");
        }
        if (this.ai != null) {
            this.ai.setAttribute("width", d.toString());
            this.ai.setAttribute("height", e.toString());
            this.ai.setStyleProperty("width", a.toString() + "px");
            this.ai.setStyleProperty("height", b.toString() + "px");
        }
        if (this.ag != null) {
            this.ag.setAttribute("width", d.toString());
            this.ag.setAttribute("height", e.toString());
            this.ag.setStyleProperty("width", a.toString() + "px");
            this.ag.setStyleProperty("height", b.toString() + "px");
        }
        if (this.ak != null) {
            this.ak.setAttribute("width", d.toString());
            this.ak.setAttribute("height", e.toString());
            this.ak.setStyleProperty("width", a.toString() + "px");
            this.ak.setStyleProperty("height", b.toString() + "px");
        }
        this.j.p.al.q();
        this.j.p.am.q();
        this.j.p.ak.q();
    };
    SeriesViewerViewManager.prototype.b8 = function () {
        if (this.f == null) {
            return { $type: Point_$type, x: 0, y: 0 };
        }
        var a = this.f.bk(this.ae.rootWrapper);
        return { $type: Point_$type, x: a.left, y: a.top };
    };
    SeriesViewerViewManager.prototype.y = function () {
        return false;
    };
    SeriesViewerViewManager.prototype.bc = function (a) {
    };
    SeriesViewerViewManager.prototype.a8 = function (a, b, c, d, e) {
        var f = this.e();
        a = f.a;
        b = f.f;
        c = f.k;
        d = f.h;
        e = f.i;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d,
            p4: e
        };
    };
    SeriesViewerViewManager.prototype.e = function () {
        var e_32, _a;
        var a = new DefaultPaletteInfo();
        a.a = new BrushCollection();
        a.f = new BrushCollection();
        a.b = new BrushCollection();
        a.c = new BrushCollection();
        var b = new List$1(String_$type, 0);
        b.add("background-image");
        this.ae.startCSSQuery();
        var c = this.ae.getCssDefaultValuesForClassCollection("ui-chart-fill-palette-", b.toArray());
        var d = c.length;
        var e = this.ae.getCssDefaultValuesForClassCollection("ui-chart-outline-palette-", b.toArray());
        var f = e.length;
        var g = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-fill-palette-", b.toArray());
        var h = g.length;
        var i = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-outline-palette-", b.toArray());
        var j = i.length;
        for (var k = 0; k < d; k++) {
            a.a.add(CssGradientUtil.brushFromGradientString(c[k][0]));
        }
        for (var l = 0; l < f; l++) {
            a.f.add(CssGradientUtil.brushFromGradientString(e[l][0]));
        }
        for (var m = 0; m < h; m++) {
            a.b.add(CssGradientUtil.brushFromGradientString(g[m][0]));
        }
        for (var n = 0; n < j; n++) {
            a.c.add(CssGradientUtil.brushFromGradientString(i[n][0]));
        }
        b.clear();
        var o = 0;
        var p = 0;
        var q = Math.min(d, f);
        var r = null;
        if (d == 0) {
            b.add("background-color");
        }
        if (f == 0) {
            b.add("border-top-color");
            p = d == 0 ? 1 : 0;
        }
        if (b.count > 0) {
            r = this.ae.getCssDefaultValuesForClassCollection("ui-chart-palette-", b.toArray());
            q = r.length;
        }
        if (d == 0) {
            if (q > 0) {
                for (var s = 0; s < q; s++) {
                    var t = new Brush();
                    t._fill = r[s][o];
                    a.a.add(t);
                }
            }
            else {
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8BDC5C";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8961A9";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#6DB1FF";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#82E9D9";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#EA3C63";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#735656";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#F8CE4F";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#A8A8B7";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#E051A9";
                    return $ret;
                })()));
                a.a.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#FF903B";
                    return $ret;
                })()));
            }
        }
        if (f == 0) {
            if (q > 0) {
                for (var u = 0; u < q; u++) {
                    var v = new Brush();
                    v._fill = r[u][p];
                    a.f.add(v);
                }
            }
            else {
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8BDC5C";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#8961A9";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#6DB1FF";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#82E9D9";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#EA3C63";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#735656";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#F8CE4F";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#A8A8B7";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#E051A9";
                    return $ret;
                })()));
                a.f.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#FF903B";
                    return $ret;
                })()));
            }
        }
        b.clear();
        var w = Math.min(h, j);
        if (h == 0) {
            b.add("background-color");
        }
        if (j == 0) {
            b.add("border-top-color");
            p = h == 0 ? 1 : 0;
        }
        if (b.count > 0) {
            r = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-palette-", b.toArray());
            w = r.length;
        }
        if (h == 0) {
            if (w > 0) {
                var _loop_2 = function (x) {
                    var y = ((function () {
                        var $ret = new Brush();
                        $ret.fill = r[x][o];
                        return $ret;
                    })());
                    a.b.add(y);
                };
                for (var x = 0; x < w; x++) {
                    _loop_2(x);
                }
            }
            else {
                a.b.add(((function () {
                    var $ret = new Brush();
                    $ret.fill = "#FFFFFF";
                    return $ret;
                })()));
            }
        }
        if (j == 0) {
            if (w > 0) {
                var _loop_3 = function (z) {
                    var aa = ((function () {
                        var $ret = new Brush();
                        $ret.fill = r[z][p];
                        return $ret;
                    })());
                    a.c.add(aa);
                };
                for (var z = 0; z < w; z++) {
                    _loop_3(z);
                }
            }
            else {
                try {
                    for (var _b = __values(fromEnum(a.a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var ab = _c.value;
                        a.c.add(ab);
                    }
                }
                catch (e_32_1) {
                    e_32 = { error: e_32_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_32)
                            throw e_32.error;
                    }
                }
            }
        }
        var ac = this.ae.getCssDefaultPropertyValue("ui-chart-axis", "border-top-color");
        if (ac != null) {
            a.i = new Brush();
            a.i._fill = ac;
        }
        else {
            a.i = AxisDefaults.g;
        }
        a.k = new Brush();
        a.k._fill = this.ae.getCssDefaultPropertyValue("", "color");
        a.j = Defaults.ae;
        var ad = this.ae.getCssDefaultPropertyValue("ui-chart-crosshair", "border-top-color");
        if (ad != null) {
            a.j = new Brush();
            a.j._fill = ad;
        }
        this.ae.endCSSQuery();
        a.h = FontUtil.getFont(this.ae);
        var ae = ((function () {
            var $ret = new Brush();
            $ret.fill = "#ee5879";
            return $ret;
        })());
        a.d = new BrushCollection();
        a.d.add(ae);
        a.e = new BrushCollection();
        a.e.add(ae);
        return a;
    };
    SeriesViewerViewManager.prototype.a7 = function (a, b, c, d, e, f) {
        this.ae.startCSSQuery();
        var g = this.ae.getCssDefaultPropertyValue("ui-chart-area-fill-opacity", "opacity");
        a = g != null ? parseFloat(g) : 1;
        b = new Array(4);
        var h = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-top");
        var i = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-right");
        var j = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-bottom");
        var k = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-left");
        b[0] = h != null ? parseFloat(h) : NaN;
        b[1] = i != null ? parseFloat(i) : NaN;
        b[2] = j != null ? parseFloat(j) : NaN;
        b[3] = k != null ? parseFloat(k) : NaN;
        c = d = null;
        var l = this.ae.getCssDefaultPropertyValue("ui-chart-axis-stroke", "border-top-color");
        if (l != null) {
            var m = new Brush();
            m._fill = l;
            c = m;
        }
        var n = this.ae.getCssDefaultPropertyValue("ui-chart-axis-major-line", "border-top-color");
        if (n != null) {
            var o = new Brush();
            o._fill = n;
            d = o;
        }
        var p = this.ae.getCssDefaultPropertyValue("ui-chart-aligned-gridlines", "visibility");
        f = p != null && p == "visible";
        var q = this.ae.getCssDefaultPropertyValue("ui-chart-category-axis-tick", "height");
        if (q != null) {
            e = parseFloat(q);
            if (Math.abs(e) > 4000) {
                e = 0;
            }
        }
        else {
            q = this.ae.getCssDefaultPropertyValue("ui-chart-category-axis-tick", "width");
            e = q != null ? parseFloat(q) : 0;
        }
        this.ae.endCSSQuery();
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d,
            p4: e,
            p5: f
        };
    };
    SeriesViewerViewManager.prototype.ay = function () {
        this.ah.removeChildren();
    };
    SeriesViewerViewManager.prototype.bu = function (x_) {
        var box_ = this.ah;
        var offset_ = this.f.bk(this.ah);
        var a = this.b8();
        x_ = a.x + this.j.p.wk.left + x_;
        box_.setOffset(x_, this.j.p.wk.top + this.ad + a.y);
    };
    SeriesViewerViewManager.prototype.bv = function (y_) {
        this.ad = y_;
        var box_ = this.ah;
        var offset_ = this.ah.getOffset();
        var a = this.b8();
        y_ = this.j.p.wk.top + this.ad + a.y;
        box_.setOffset(offset_.left, y_);
    };
    SeriesViewerViewManager.prototype.au = function (a) {
        var b = a;
        b.show();
        this.ah.append(b);
    };
    SeriesViewerViewManager.prototype.a9 = function () {
        this.ah.hide();
    };
    SeriesViewerViewManager.prototype.bo = function () {
        this.ah.show();
    };
    SeriesViewerViewManager.prototype.av = function (a) {
        this.ae.appendToBody(a);
    };
    SeriesViewerViewManager.prototype.bk = function (a) {
        a.remove();
    };
    SeriesViewerViewManager.prototype.bd = function () {
        if (this.ae == null) {
            return;
        }
        this.ba();
        this.j.c1(this.ae.rootWrapper.width(), this.ae.rootWrapper.height());
    };
    SeriesViewerViewManager.prototype.p = function () {
        return this.l;
    };
    SeriesViewerViewManager.prototype.ce = function () {
        return this.ca;
    };
    SeriesViewerViewManager.prototype.as = function () {
        return this.aq;
    };
    SeriesViewerViewManager.prototype.ar = function () {
        return this.ap;
    };
    SeriesViewerViewManager.prototype.cd = function () {
        return this.b9;
    };
    SeriesViewerViewManager.prototype.b5 = function () {
        return this.b0;
    };
    SeriesViewerViewManager.prototype.b4 = function () {
        return this.bz;
    };
    SeriesViewerViewManager.prototype.o = function () {
        return this.k;
    };
    SeriesViewerViewManager.prototype.c = function () {
        return this.a;
    };
    SeriesViewerViewManager.prototype.d = function () {
        return this.b;
    };
    SeriesViewerViewManager.prototype.r = function () {
        return this.n;
    };
    SeriesViewerViewManager.prototype.b7 = function () {
        return this.b2;
    };
    SeriesViewerViewManager.prototype.q = function () {
        return this.m;
    };
    SeriesViewerViewManager.prototype.b6 = function () {
        return this.b1;
    };
    SeriesViewerViewManager.prototype.cf = function () {
        return this.cb;
    };
    SeriesViewerViewManager.prototype.cg = function () {
        return this.cc;
    };
    SeriesViewerViewManager.prototype.bp = function () {
        this.ae.startCSSQuery();
        this.br();
        this.bq();
        this.bt();
        this.bs();
        this.bx();
        this.ae.endCSSQuery();
    };
    SeriesViewerViewManager.prototype.bx = function () {
        var a = "ui-chart-pointer-tooltip";
        var b = this.ae.getCssDefaultPropertyValue(a, "background-color");
        var c = this.ae.getCssDefaultPropertyValue(a, "border-top-color");
        var d = this.ae.getCssDefaultPropertyValue(a, "border-top-left-radius");
        var e = this.ae.getCssDefaultPropertyValue(a, "border-top-width");
        var f = new PointerTooltipStyle();
        f.a = d != null ? parseFloat(d) : 0;
        f.c = b != null ? Brush.create(b) : ((function () {
            var $ret = new Brush();
            $ret.fill = "white";
            return $ret;
        })());
        f.d = c != null ? Brush.create(c) : ((function () {
            var $ret = new Brush();
            $ret.fill = "gray";
            return $ret;
        })());
        f.b = e != null ? parseFloat(e) : 0;
        this.h = f;
    };
    SeriesViewerViewManager.prototype.br = function () {
        var _this = this;
        var a = "ui-chart-title";
        this.l = FontUtil.getFontForClass(this.ae, a);
        this.b0 = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        this.aq = this.ae.getCssDefaultPropertyValue(a, "text-align");
        if (this.aq == null) {
            this.aq = "center";
        }
        var b = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var f = b != null ? parseFloat(b) : 0;
        var g = c != null ? parseFloat(c) : 0;
        var h = d != null ? parseFloat(d) : 0;
        var i = e != null ? parseFloat(e) : 0;
        this.ca = new Thickness(1, h, f, i, g);
    };
    SeriesViewerViewManager.prototype.bq = function () {
        var _this = this;
        var a = "ui-chart-subtitle";
        this.k = FontUtil.getFontForClass(this.ae, a);
        this.bz = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        this.ap = this.ae.getCssDefaultPropertyValue(a, "text-align");
        if (this.ap == null) {
            this.ap = "center";
        }
        var b = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var f = b != null ? parseFloat(b) : 0;
        var g = c != null ? parseFloat(c) : 0;
        var h = d != null ? parseFloat(d) : 0;
        var i = e != null ? parseFloat(e) : 0;
        this.b9 = new Thickness(1, h, f, i, g);
    };
    SeriesViewerViewManager.prototype.bs = function () {
        var _this = this;
        var a = "ui-chart-horizontal-axis-title";
        this.m = FontUtil.getFontForClass(this.ae, a);
        this.b1 = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        var b = this.ae.getCssDefaultPropertyValue(a, "vertical-align");
        if (b == null) {
            this.a = 0;
        }
        else if (b.toLowerCase() == "bottom") {
            this.a = 4;
        }
        else {
            this.a = 3;
        }
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var f = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var g = c != null ? parseFloat(c) : 2;
        var h = d != null ? parseFloat(d) : 2;
        var i = e != null ? parseFloat(e) : 2;
        var j = f != null ? parseFloat(f) : 2;
        this.cb = new Thickness(1, i, g, j, h);
    };
    SeriesViewerViewManager.prototype.bt = function () {
        var _this = this;
        var a = "ui-chart-vertical-axis-title";
        this.n = FontUtil.getFontForClass(this.ae, a);
        this.b2 = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.getCssDefaultPropertyValue(a, "color");
            return $ret;
        })());
        var b = this.ae.getCssDefaultPropertyValue(a, "text-align");
        if (b == null) {
            this.b = 0;
        }
        else if (b.toLowerCase() == "right") {
            this.b = 2;
        }
        else {
            this.b = 1;
        }
        var c = this.ae.getCssDefaultPropertyValue(a, "margin-top");
        var d = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
        var e = this.ae.getCssDefaultPropertyValue(a, "margin-left");
        var f = this.ae.getCssDefaultPropertyValue(a, "margin-right");
        var g = c != null ? parseFloat(c) : 0;
        var h = d != null ? parseFloat(d) : 0;
        var i = e != null ? parseFloat(e) : 0;
        var j = f != null ? parseFloat(f) : 0;
        this.cc = new Thickness(1, i, g, j, h);
    };
    SeriesViewerViewManager.prototype.a6 = function (a, b) {
        var c = this.j.p.hi;
        if (a != this.ab || b != this.aa || c != this.ac) {
            this.az(a, b, this.j.p.hi);
            this.j.p.al.l();
            this.j.a.l();
        }
    };
    SeriesViewerViewManager.prototype.i = function () {
        return this.h;
    };
    SeriesViewerViewManager.prototype.bb = function (a) {
        if (this.f == null) {
            return;
        }
        this.f.ab = a;
        this.f.ap = runOn(this.j, this.j.at);
    };
    SeriesViewerViewManager.prototype.an = function (a, b, c) {
        var _this = this;
        var d;
        if (!((function () { var e = _this.z.tryGetValue(b.iD.toString(), d); d = e.p1; return e.ret; })())) {
            var e = this.ae.createElement("canvas");
            e.setAttribute("width", c.toString());
            e.setAttribute("height", c.toString());
            e.setStyleProperty("width", c.toString() + "px");
            e.setStyleProperty("height", c.toString() + "px");
            var f = this.ae.get2DCanvasContext(e);
            var g = new RenderingContext(new CanvasViewRenderer(), f);
            var h = new Tuple$2(DomWrapper_$type, RenderingContext.$, e, g);
            d = h;
            this.z.addItem(b.iD.toString(), d);
        }
        var i = new Rect(0, 0, 0, c, c);
        var j = new RenderSurface();
        j.a = d.d;
        for (var k = 0; k < this.j.p.series.count; k++) {
            var l = this.j.p.series._inner[k];
            l.rp(i, a, j, "tile", 1);
        }
        this.j.p.ak.l();
        return d.c;
    };
    SeriesViewerViewManager.prototype.a3 = function (a) {
        this.z.removeItem(a.iD.toString());
    };
    SeriesViewerViewManager.prototype.a2 = function () {
        this.z.clear();
    };
    SeriesViewerViewManager.prototype.bl = function (a) {
        for (var b = 0; b < a.count; b++) {
            var c = a._inner[b];
            var d = c.content;
            this.j.z.n(d.getNativeElement(), 1, c.xPosition + this.j.p.wk.left, c.yPosition + this.j.p.wk.top, c.width, c.height);
        }
    };
    SeriesViewerViewManager.prototype.a0 = function () {
        var _this = this;
        if (this.al != -1) {
            this.aw();
        }
        if (this.ae != null) {
            this.al = this.ae.setTimeout(function () { return _this.j.p.bb.f$m(_this.j.p); }, 5000);
        }
        else {
            this.al = window.setTimeout(function () { return _this.j.p.bb.f$m(_this.j.p); }, 5000);
        }
    };
    SeriesViewerViewManager.prototype.aw = function () {
        if (this.al != -1) {
            if (this.ae != null) {
                this.ae.clearTimeout(this.al);
            }
            else {
                window.clearTimeout(this.al);
            }
            this.al = -1;
        }
    };
    SeriesViewerViewManager.prototype.a1 = function (a) {
        var _this = this;
        if (this.am != -1) {
            this.ax();
        }
        if (this.ae != null) {
            this.am = this.ae.setTimeout(function () { return _this.j.p.nl(); }, a);
        }
        else {
            this.am = window.setTimeout(function () { return _this.j.p.nl(); }, a);
        }
    };
    SeriesViewerViewManager.prototype.ax = function () {
        if (this.am != -1) {
            if (this.ae != null) {
                this.ae.clearTimeout(this.am);
            }
            else {
                window.clearTimeout(this.am);
            }
            this.am = -1;
        }
    };
    SeriesViewerViewManager.prototype.be = function () {
        if (this.j.p.au != 1) {
            if (this.s == null) {
                this.u = new RenderingContext(new CanvasViewRenderer(), this.ae.get2DCanvasContext(this.ag));
                this.s = this.u;
            }
            else {
                this.u = this.s;
            }
        }
        else {
            this.u = new RenderingContext(null, null);
        }
        this.j.dt(this.u);
    };
    SeriesViewerViewManager.prototype.bw = function (a) {
        if (this.ae != null) {
            var b = "igTouch";
            if (a) {
                this.ae.rootWrapper.addClass(b);
            }
            else {
                this.ae.rootWrapper.removeClass(b);
            }
        }
    };
    SeriesViewerViewManager.prototype.a4 = function () {
    };
    SeriesViewerViewManager.prototype.a5 = function () {
    };
    SeriesViewerViewManager.prototype.bh = function () {
        if (this.f != null) {
            this.f.bh(this.aj, "");
        }
    };
    SeriesViewerViewManager.prototype.bf = function () {
        this.ba();
        if (this.f != null) {
            this.f.at(this.aj, "");
        }
    };
    SeriesViewerViewManager.prototype.ao = function (a, b, c) {
        var d = this.ae.createElement("img");
        d.setProperty("src", this.at(a, b, c, "image/png"));
        return d.getNativeElement();
    };
    SeriesViewerViewManager.prototype.at = function (a, b, c, d, e) {
        var _this = this;
        if (e === void 0) {
            e = null;
        }
        var f = a * c;
        var g = b * c;
        var h = this.ae.createElement("canvas");
        h.setStyleProperty("width", a + "px");
        h.setStyleProperty("height", b + "px");
        h.setProperty("width", f);
        h.setProperty("height", g);
        var i = this.ae.get2DCanvasContext(h);
        var j = ((function () {
            var $ret = new Brush();
            $ret.fill = _this.ae.rootWrapper.getStyleProperty("background-color");
            return $ret;
        })());
        if (BrushUtilCore.a(j)) {
            j._fill = this.ae.rootWrapper.parent().getStyleProperty("background-color");
            if (BrushUtilCore.a(j)) {
                j._fill = "rgb(255, 255, 255)";
            }
        }
        if (c != 1) {
            i.save();
            i.scale(c, c);
        }
        i.fillStyle = j._fill;
        i.fillRect(0, 0, a, b);
        if (this.t != null && this.t != this.v) {
            i.drawImage(this.af.getNativeElement(), 0, 0, a, b);
        }
        if (this.v != null) {
            i.drawImage(this.ai.getNativeElement(), 0, 0, a, b);
        }
        if (this.w != null && this.w != this.v) {
            i.drawImage(this.aj.getNativeElement(), 0, 0, a, b);
        }
        if (c != 1) {
            i.restore();
        }
        var format_ = d;
        var sCanv_ = h.getNativeElement();
        var url_ = (sCanv_.toDataURL(format_));
        if (e != null) {
            var cb_1 = e;
            sCanv_.toBlob(function (blob) { cb_1(url_, blob); }, format_);
        }
        return url_;
    };
    SeriesViewerViewManager.$t = markType(SeriesViewerViewManager, 'SeriesViewerViewManager');
    return SeriesViewerViewManager;
}(Base));
export { SeriesViewerViewManager };
/**
 * @hidden
 */
var AutoRangeCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutoRangeCalculator, _super);
    function AutoRangeCalculator() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    AutoRangeCalculator.a = function (a, b, c, d, e, f, g) {
        f = !isNaN_(b) && !isInfinity(b) ? b : Number.POSITIVE_INFINITY;
        g = !isNaN_(c) && !isInfinity(c) ? c : Number.NEGATIVE_INFINITY;
        var h = f;
        var i = g;
        if (isInfinity(h) || isInfinity(i)) {
            if (a != null) {
                var j = a.kv();
                if (j != null) {
                    h = Math.min(h, j.c);
                    i = Math.max(i, j.b);
                }
            }
        }
        if (!isInfinity(h) && !isInfinity(i)) {
            if (h == i && h != 0) {
                h *= h > 0 ? 0.9 : 1.1;
                i *= i > 0 ? 1.1 : 0.9;
            }
            if (h == i && h == 0) {
                i = 1;
            }
            if (b > c) {
                var k = c;
                c = b;
                b = k;
            }
            var l = isNaN_(b) || isInfinity(b) ? h : b;
            var m = isNaN_(c) || isInfinity(c) ? i : c;
            if (d) {
                if (l <= 0) {
                    if (m > 1) {
                        l = 1;
                    }
                    else {
                        l = Math.pow(e, Math.floor(logBase(m, e)));
                    }
                }
                if (isNaN_(b) || isInfinity(b)) {
                    var n = logBase(l, e);
                    h = Math.pow(e, Math.floor(n));
                }
                else {
                    h = l;
                }
                if (isNaN_(c) || isInfinity(c)) {
                    i = Math.pow(e, Math.ceil(logBase(m, e)));
                }
                else {
                    i = m;
                }
            }
            else {
                var o = Math.pow(10, Math.floor(log10(m - l)) - 1);
                var p = a.ek();
                if (a != null && p > 0 && (!a.lm && !a.ll)) {
                    var q = new LinearNumericSnapper(0, h, i, p, a.e0(), a.mk);
                    o = q.g;
                }
                else if (a.lh && p > 0 && (!a.lm || !a.ll)) {
                    var r = h;
                    var s = i;
                    if (a.lm) {
                        r = b;
                    }
                    if (a.ll) {
                        s = c;
                    }
                    var t = new LinearNumericSnapper(0, r, s, p, a.e0(), a.mk);
                    o = t.g;
                }
                if ((isNaN_(b) || isInfinity(b)) && !isNaN_(h) && !isNaN_(o) && o != 0) {
                    {
                        h = o * Math.floor(h / o);
                    }
                }
                else {
                    h = l;
                }
                if ((isNaN_(c) || isInfinity(c)) && !isNaN_(i) && !isNaN_(o) && o != 0) {
                    var u = Math.ceil(i / o);
                    {
                        i = o * u;
                    }
                }
                else {
                    i = m;
                }
                if (a.lh) {
                    if (a.lh && p > 0 && (!a.lm || !a.ll)) {
                        var v = new LinearNumericSnapper(0, h, i, p, a.e0(), a.mk);
                        var w = v.g;
                        if (w != o) {
                            o = w;
                            if ((isNaN_(b) || isInfinity(b)) && !isNaN_(h) && !isNaN_(o) && o != 0) {
                                {
                                    h = o * Math.floor(h / o);
                                }
                            }
                            else {
                                h = l;
                            }
                            if ((isNaN_(c) || isInfinity(c)) && !isNaN_(i) && !isNaN_(o) && o != 0) {
                                var x = Math.ceil(i / o);
                                {
                                    i = o * x;
                                }
                            }
                            else {
                                i = m;
                            }
                        }
                    }
                }
            }
        }
        f = h;
        g = i;
        return {
            p5: f,
            p6: g
        };
    };
    AutoRangeCalculator.$t = markType(AutoRangeCalculator, 'AutoRangeCalculator');
    return AutoRangeCalculator;
}(Base));
export { AutoRangeCalculator };
/**
 * @hidden
 */
export var IAxisAnnotationManager_$type = new Type(null, 'IAxisAnnotationManager');
/**
 * @hidden
 */
var AxisLabelSettings = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelSettings, _super);
    function AxisLabelSettings() {
        var _this = _super.call(this) || this;
        _this.ab = null;
        _this.ay = null;
        _this.b = 1;
        _this.a3 = 0;
        _this.i = true;
        _this.c = 0;
        _this.a = null;
        _this.n = 0;
        _this.p = NaN;
        _this.q = 2;
        _this.r = 2;
        _this.s = 2;
        _this.o = 2;
        _this.av = 0;
        _this.a0 = 1;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.f = null;
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.ar(a, b.propertyName, b.oldValue, b.newValue); });
        return _this;
    }
    Object.defineProperty(AxisLabelSettings.prototype, "textStyle", {
        get: function () {
            return this.ab;
        },
        set: function (a) {
            var b = this.ab;
            this.ab = a;
            if (this.ab != b) {
                this.f = null;
                this.as("TextStyle", b, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "textColor", {
        get: function () {
            return this.ay;
        },
        set: function (a) {
            var b = this.ay;
            this.ay = a;
            this.as("TextColor", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "location", {
        get: function () {
            return this.b;
        },
        set: function (a) {
            var b = this.b;
            this.b = a;
            this.as("Location", enumGetBox(AxisLabelsLocation_$type, b), enumGetBox(AxisLabelsLocation_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "visibility", {
        get: function () {
            return this.a3;
        },
        set: function (a) {
            var b = this.a3;
            this.a3 = a;
            this.as("Visibility", enumGetBox(Visibility_$type, b), enumGetBox(Visibility_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "showFirstLabel", {
        get: function () {
            return this.i;
        },
        set: function (a) {
            var b = this.i;
            this.i = a;
            this.as("ShowFirstLabel", b, a);
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelSettings.prototype.registerAxis = function (a) {
        this.a = a;
    };
    AxisLabelSettings.prototype.unregisterAxis = function (a) {
        this.a = null;
    };
    Object.defineProperty(AxisLabelSettings.prototype, "angle", {
        get: function () {
            return this.n;
        },
        set: function (a) {
            var b = this.n;
            this.n = a;
            this.as("Angle", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "extent", {
        get: function () {
            return this.p;
        },
        set: function (a) {
            var b = this.p;
            this.p = a;
            this.as("Extent", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "margin", {
        set: function (a) {
            this.leftMargin = a;
            this.bottomMargin = a;
            this.rightMargin = a;
            this.topMargin = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "leftMargin", {
        get: function () {
            return this.q;
        },
        set: function (a) {
            var b = this.q;
            this.q = a;
            this.as("LeftMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "rightMargin", {
        get: function () {
            return this.r;
        },
        set: function (a) {
            var b = this.r;
            this.r = a;
            this.as("RightMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "topMargin", {
        get: function () {
            return this.s;
        },
        set: function (a) {
            var b = this.s;
            this.s = a;
            this.as("TopMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "bottomMargin", {
        get: function () {
            return this.o;
        },
        set: function (a) {
            var b = this.o;
            this.o = a;
            this.as("BottomMargin", b, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "horizontalAlignment", {
        get: function () {
            return this.av;
        },
        set: function (a) {
            var b = this.av;
            this.av = a;
            this.as("HorizontalAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "verticalAlignment", {
        get: function () {
            return this.a0;
        },
        set: function (a) {
            var b = this.a0;
            this.a0 = a;
            this.as("VerticalAlignment", enumGetBox(VerticalAlignment_$type, b), enumGetBox(VerticalAlignment_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelSettings.prototype.as = function (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));
        }
    };
    AxisLabelSettings.prototype.ar = function (a, b, c, d) {
        switch (b) {
            case "Location":
                this.c = this.location;
                break;
        }
        if (this.a == null || this.a.bg == null) {
            return;
        }
        switch (b) {
            case "Angle":
                this.a.cq = true;
                this.a.ia();
                break;
            case "TextStyle":
                this.f = null;
                this.a.cq = true;
                if (this.a.bi != null) {
                    this.a.bi.n3();
                }
                this.a.ia();
                break;
            case "Location":
            case "Extent":
            case "Visibility":
            case "HorizontalAlignment":
            case "VerticalAlignment":
            case "TopMargin":
            case "RightMargin":
            case "BottomMargin":
            case "LeftMargin":
            case "ShowFirstLabel":
                this.a.cq = true;
                if (this.a.bi != null) {
                    this.a.bi.n3();
                }
                this.a.ia();
                break;
            case "TextColor":
                this.a.ia();
                break;
        }
    };
    AxisLabelSettings.prototype.k = function () {
        return this.n != 0;
    };
    AxisLabelSettings.prototype.l = function () {
        return !isNaN_(this.p);
    };
    Object.defineProperty(AxisLabelSettings.prototype, "j", {
        get: function () {
            return this.textStyle != null || this.f != null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelSettings.prototype, "g", {
        get: function () {
            return this.f;
        },
        set: function (a) {
            this.f = a;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelSettings.prototype.h = function (a) {
        if (this.f == null) {
            this.f = FontUtil.toFontInfo(a, this.textStyle);
        }
        return this.f;
    };
    AxisLabelSettings.$t = markType(AxisLabelSettings, 'AxisLabelSettings', Base.$, [INotifyPropertyChanged_$type]);
    AxisLabelSettings.extentPropertyDefault = NaN;
    return AxisLabelSettings;
}(Base));
export { AxisLabelSettings };
/**
 * @hidden
 */
var TitleSettings = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(TitleSettings, _super);
    function TitleSettings() {
        var _this = _super.call(this) || this;
        _this.a5 = 0;
        _this.horizontalAlignment = 1;
        _this.leftMargin = NaN;
        _this.rightMargin = NaN;
        _this.topMargin = NaN;
        _this.bottomMargin = NaN;
        return _this;
    }
    Object.defineProperty(TitleSettings.prototype, "position", {
        get: function () {
            return this.a5;
        },
        set: function (a) {
            var b = this.a5;
            this.a5 = a;
            this.as("AxisTitlePosition", enumGetBox(AxisTitlePosition_$type, b), enumGetBox(AxisTitlePosition_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    TitleSettings.prototype.ar = function (a, b, c, d) {
        _super.prototype.ar.call(this, a, b, c, d);
        if (this.a == null || this.a.bi == null) {
            return;
        }
        switch (b) {
            case "AxisTitlePosition":
                this.a.cq = true;
                this.a.ia();
                break;
        }
    };
    TitleSettings.$t = markType(TitleSettings, 'TitleSettings', AxisLabelSettings.$);
    return TitleSettings;
}(AxisLabelSettings));
export { TitleSettings };
/**
 * @hidden
 */
var Axis = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(Axis, _super);
    function Axis() {
        var _this = _super.call(this) || this;
        _this.a5 = null;
        _this.bt = null;
        _this.a9 = null;
        _this.a7 = null;
        _this.iu = null;
        _this.bn = null;
        _this.bh = null;
        _this.bs = null;
        _this.by = false;
        _this.dm = NaN;
        _this.dg = 50;
        _this.dt = 0;
        _this.dq = 150;
        _this.as = 0;
        _this.dl = NaN;
        _this.dx = 0;
        _this.ds = 0;
        _this.dp = 180;
        _this.bk = null;
        _this.bj = null;
        _this.f5 = "Verdana";
        _this.dn = NaN;
        _this.dz = 0;
        _this.du = 8;
        _this.dr = 16;
        _this.fq = -1;
        _this.fp = 1;
        _this.fo = 3;
        _this.fr = 0;
        _this.kn = 0;
        _this.dw = 0;
        _this.dv = 2;
        _this.iv = null;
        _this.d0 = 0;
        _this.ci = false;
        _this.bw = false;
        _this.dh = 0;
        _this.cv = false;
        _this.cx = false;
        _this.bz = false;
        _this.rangeChanged = null;
        _this.al = new AxisAnnotationCollection();
        _this.am = new AxisAnnotationCollection();
        _this.j9 = Rect.empty;
        _this.kg = null;
        _this.dd = null;
        _this.de = null;
        _this.aw = null;
        _this.bx = false;
        _this.ka = null;
        _this.a6 = null;
        _this.fn = null;
        _this.ai = null;
        _this._coercionMethods = null;
        _this.bv = false;
        _this.cy = false;
        _this.c7 = false;
        _this.renderRequested = null;
        _this.bc = null;
        _this.cr = false;
        _this.dj = NaN;
        _this.dk = -1;
        _this.cs = false;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.df = null;
        _this.da = new Dictionary$2(String_$type, String_$type, 0);
        _this.c9 = new Dictionary$2(String_$type, FastReflectionHelper.$, 0);
        _this.km = new Size();
        _this.ap = new AxisComponentsForView();
        _this.d4 = 0;
        _this.di = 0;
        _this.br = null;
        _this.bq = null;
        _this.bp = null;
        _this.ax = new AxisLabelSettings();
        _this.fm = null;
        DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
        DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
        _this.ka = Rect.empty;
        _this.bz = true;
        _this.d4 = NaN;
        _this.a5 = _this.a4();
        _this.hv(_this.a5);
        _this.a5.al();
        _this.br = ((function () {
            var $ret = new Pool$1(TextBlock.$);
            $ret.create = runOn(_this.a5, _this.a5.a3);
            $ret.activate = runOn(_this.a5, _this.a5.aw);
            $ret.disactivate = runOn(_this.a5, _this.a5.ay);
            $ret.destroy = runOn(_this.a5, _this.a5.ax);
            return $ret;
        })());
        _this.bq = ((function () {
            var $ret = new Pool$1(TextBlock.$);
            $ret.create = runOn(_this.a5, _this.a5.a3);
            $ret.activate = runOn(_this.a5, _this.a5.aw);
            $ret.disactivate = runOn(_this.a5, _this.a5.ay);
            $ret.destroy = runOn(_this.a5, _this.a5.ax);
            return $ret;
        })());
        _this.bp = ((function () {
            var $ret = new Pool$1(Rectangle.$);
            $ret.create = runOn(_this.a5, _this.a5.bi);
            $ret.activate = runOn(_this.a5, _this.a5.t);
            $ret.disactivate = runOn(_this.a5, _this.a5.v);
            $ret.destroy = runOn(_this.a5, _this.a5.u);
            return $ret;
        })());
        _this.kg = Rect.empty;
        _this.dd = new List$1(Base.$, 0);
        _this.de = new List$1(LabelPosition.$, 0);
        _this.aw = _this.av();
        _this.aw.ag = _this.az;
        _this.aw.ad = _this;
        _this.df = new List$1(Series.$, 0);
        var a = _this.al;
        a.collectionResetting = delegateCombine(a.collectionResetting, runOn(_this, _this.he));
        var b = _this.al;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.hd));
        var c = _this.am;
        c.collectionResetting = delegateCombine(c.collectionResetting, runOn(_this, _this.hg));
        var d = _this.am;
        d.collectionChanged = delegateCombine(d.collectionChanged, runOn(_this, _this.hf));
        _this.ab = Axis.$;
        if (_this.az != null) {
            _this.ax = _this.az;
        }
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (e, f) { return _this.hz(e, f.propertyName, f.oldValue, f.newValue); });
        _this.bs = function (e, f) {
            if (_this.bi == null || !_this.bi.e1) {
                _this.it(f.oldRect, f.newRect);
            }
        };
        _this.a5.aa();
        return _this;
    }
    Axis.prototype.a4 = function () {
        return new AxisView(this);
    };
    Axis.prototype.hv = function (a) {
    };
    Axis.prototype.hh = function () {
        if (this.ca) {
            this.a8.onAddAnnotations(this);
        }
    };
    Object.defineProperty(Axis.prototype, "bu", {
        get: function () {
            if (this.bt == null) {
                this.bt = new SRProvider(this.fn);
            }
            if (this.bt.l == null) {
                this.bt.l = this.fn;
            }
            return this.bt;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ba", {
        get: function () {
            var _this = this;
            if (this.a9 == null) {
                this.a9 = DVContainer.instance.createInstance(IAxisVisualDataManager_$type, function () { return _this.bu.q; });
            }
            return this.a9;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ek = function () {
        return this.kb().width;
    };
    Axis.prototype.f4 = function () {
        return null;
    };
    Axis.prototype.f3 = function () {
        return null;
    };
    Axis.prototype.get_cb = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cb", {
        get: function () {
            return this.get_cb();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cj = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cj", {
        get: function () {
            return this.get_cj();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_b9 = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "b9", {
        get: function () {
            return this.get_b9();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cm = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cm", {
        get: function () {
            return this.get_cm();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cp = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cp", {
        get: function () {
            return this.get_cp();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cn = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cn", {
        get: function () {
            return this.get_cn();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.d5 = function (a) {
        return NaN;
    };
    Axis.prototype.get_ce = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "ce", {
        get: function () {
            return this.get_ce();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_ck = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "ck", {
        get: function () {
            return this.get_ck();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cl = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cl", {
        get: function () {
            return this.get_cl();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cc = function () {
        return false;
    };
    Object.defineProperty(Axis.prototype, "cc", {
        get: function () {
            return this.get_cc();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_cd = function () {
        return true;
    };
    Object.defineProperty(Axis.prototype, "cd", {
        get: function () {
            return this.get_cd();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ak = function () {
        return this.aj;
    };
    Object.defineProperty(Axis.prototype, "a8", {
        get: function () {
            var _this = this;
            if (this.a7 == null) {
                this.a7 = DVContainer.instance.createInstance(IAxisAnnotationManager_$type, function () { return _this.bu.n; });
                this.a7.owner = this;
            }
            return this.a7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ca", {
        get: function () {
            return DVContainer.instance.checkLoaded("AnnotationFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.hf = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAutoAnnotionsChanged(this, this.am, b);
    };
    Axis.prototype.hg = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAutoAnnotionsReset(this, this.am, b);
    };
    Axis.prototype.hd = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAnnotionsChanged(this, this.al, b);
    };
    Axis.prototype.he = function (a, b) {
        if (!this.ca) {
            return;
        }
        this.a8.onAnnotionsReset(this, this.al, b);
    };
    Axis.prototype.provideRenderer = function (a) {
        this.fn = a;
        this.hi();
        this.aw.ag = this.az;
    };
    Axis.prototype.hs = function (a, b) {
        if (!a.equals1(b)) {
            this.is(a, b);
        }
    };
    Axis.prototype.ac = function () {
        _super.prototype.ac.call(this);
        this.a5.ao();
    };
    Object.defineProperty(Axis.prototype, "bo", {
        get: function () {
            return this.bn;
        },
        set: function (a) {
            if (this.bo != a) {
                var b = this.bo;
                this.bn = a;
                this.h5("FastItemsSourceProvider", b, this.bn);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "bi", {
        get: function () {
            return this.bh;
        },
        set: function (a) {
            if (this.bi != a) {
                var b = this.bi;
                this.bh = a;
                this.h5("SeriesViewer", b, this.bh);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "bg", {
        get: function () {
            return typeCast(XamDataChart.$, this.bi);
        },
        set: function (a) {
            this.bi = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "c6", {
        get: function () {
            return this.by;
        },
        set: function (a) {
            if (this.by == a) {
                return;
            }
            this.by = a;
            var b = null;
            if (this.aw != null && Rect.l_op_Inequality(this.aw.c1, null)) {
                b = this.aw.c1;
            }
            this.aw = this.av();
            this.aw.ad = this;
            this.aw.ag = this.az;
            if (Rect.l_op_Inequality(b, null)) {
                this.aw.c1 = b;
            }
            if (this.bi != null && this.bi.c9 != null) {
                this.aw.af.al(this.bi.c9.y);
                this.h9(true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "e8", {
        get: function () {
            return this.dm;
        },
        set: function (a) {
            var b = this.dm;
            if (b != a) {
                this.dm = a;
                this.dy = a;
                this.h9(true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "dy", {
        get: function () {
            return this.dg;
        },
        set: function (a) {
            this.dg = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fe", {
        get: function () {
            return this.dt;
        },
        set: function (a) {
            this.dt = a;
            this.h9(true);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fb", {
        get: function () {
            return this.dq;
        },
        set: function (a) {
            this.dq = a;
            this.h9(true);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "at", {
        get: function () {
            return this.as;
        },
        set: function (a) {
            var b = this.as;
            if (b != a) {
                this.as = a;
                this.h9(true);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "e7", {
        get: function () {
            return this.dl;
        },
        set: function (a) {
            this.dl = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fd", {
        get: function () {
            return this.ds;
        },
        set: function (a) {
            this.ds = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fa", {
        get: function () {
            return this.dp;
        },
        set: function (a) {
            this.dp = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "bm", {
        get: function () {
            if (this.bk == null) {
                if (this.bj == null) {
                    this.bj = this.a5.i();
                }
                return this.bj;
            }
            return this.bk;
        },
        set: function (a) {
            this.bk = a;
            this.dn = FontUtil.getFontSize(this.bk);
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "gz", {
        get: function () {
            return this.f5;
        },
        set: function (a) {
            this.f5 = a;
            var b = this.dn;
            if (isNaN_(b)) {
                b = 12;
            }
            this.bm.q = a;
            this.bm.f = b;
            this.aw.b8();
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "e9", {
        get: function () {
            return this.dn;
        },
        set: function (a) {
            this.dn = a;
            this.bm = FontUtil.getFontWithNewFontSize(this.bm, this.dn);
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ff", {
        get: function () {
            return this.du;
        },
        set: function (a) {
            this.du = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fc", {
        get: function () {
            return this.dr;
        },
        set: function (a) {
            this.dr = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fv", {
        get: function () {
            return this.fq;
        },
        set: function (a) {
            this.fq = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fu", {
        get: function () {
            return this.fp;
        },
        set: function (a) {
            this.fp = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ft", {
        get: function () {
            return this.fo;
        },
        set: function (a) {
            this.fo = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kq", {
        get: function () {
            return this.kn;
        },
        set: function (a) {
            this.kn = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fh", {
        get: function () {
            return this.dw;
        },
        set: function (a) {
            this.dw = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "fg", {
        get: function () {
            return this.dv;
        },
        set: function (a) {
            this.dv = a;
            this.h8();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ik = function () {
        this.aw.cp();
    };
    Axis.prototype.h8 = function () {
        this.h9(false);
    };
    Axis.prototype.h9 = function (a) {
        if (a) {
            this.aw.co();
        }
        this.cq = true;
        this.h7();
    };
    Axis.prototype.io = function () {
        if (this.fj > 0) {
            this.d0 = this.fj;
            return;
        }
        var a = typeCast(XamDataChart.$, this.bi);
        if (a != null && isNaN_(this.fj) && this.cb && (this.cp || this.a2 == 0)) {
            this.d0 = a.w5.fq;
            return;
        }
        this.d0 = 0;
    };
    Object.defineProperty(Axis.prototype, "b4", {
        get: function () {
            return this.bw;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "b7", {
        get: function () {
            return this.az != null && this.az.k();
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ij = function (a) {
        this.bw = true;
        if (this.dh != a) {
            this.dh = a;
            this.ib(false);
        }
    };
    Axis.prototype.id = function () {
        this.bw = false;
        this.dh = 0;
        this.ib(false);
    };
    Axis.prototype.eh = function () {
        if (this.b4 && (!this.b7 || (this.b7 && this.az.angle == 0))) {
            return this.ey();
        }
        if (this.b7) {
            return this.az.angle;
        }
        return 0;
    };
    Axis.prototype.ey = function () {
        return this.dh;
    };
    Object.defineProperty(Axis.prototype, "c4", {
        get: function () {
            return this.c(Axis.js);
        },
        set: function (a) {
            this.h(Axis.js, a);
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.d7 = function () {
        return 0;
    };
    Axis.prototype.ju = function () {
        if (this.cp) {
            return 2;
        }
        return 0;
    };
    Axis.prototype.ko = function () {
        return 1;
    };
    Axis.prototype.jv = function () {
        return 1;
    };
    Axis.prototype.kp = function () {
        return 1;
    };
    Axis.prototype.d9 = function () {
        if (this.cp) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.eb = function () {
        if (!this.cp && !this.b9) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.ea = function () {
        if (this.cp) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.d8 = function () {
        if (!this.cp && !this.b9) {
            return DeviceUtils.g(5);
        }
        return 0;
    };
    Axis.prototype.ee = function () {
        return NaN;
    };
    Axis.prototype.eg = function () {
        return NaN;
    };
    Axis.prototype.ef = function () {
        return NaN;
    };
    Axis.prototype.ed = function () {
        return NaN;
    };
    Axis.prototype.a0 = function () {
        if (this.cp) {
            return 2;
        }
        if (this.cm) {
            return 5;
        }
        return 1;
    };
    Axis.prototype.a1 = function () {
        return 1;
    };
    Axis.prototype.h6 = function (a) {
        if (this.rangeChanged != null) {
            this.rangeChanged(this, a);
        }
    };
    Axis.prototype.ec = function () {
        if (this.cp) {
            return -90;
        }
        return 0;
    };
    Axis.prototype.d6 = function () {
        return NaN;
    };
    Object.defineProperty(Axis.prototype, "an", {
        get: function () {
            return this.al;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "ao", {
        get: function () {
            return this.am;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kh", {
        get: function () {
            if (this.kg.isEmpty) {
                return this.j9;
            }
            return this.kg;
        },
        set: function (a) {
            this.j9 = a;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ip = function () {
        var a = 0;
        var b = typeCast(XamDataChart.$, this.bi);
        if (b != null && b.ww == 0) {
            a = 1;
        }
        this.a5.a1(a);
    };
    Axis.prototype.c8 = function (a, b, c) {
        return this.bi != null;
    };
    Axis.prototype.co = function () {
        var a = Rect.empty;
        if (this.bi != null) {
            a = this.bi.wl;
        }
        return this.c8(this.kh, a, this.a5);
    };
    Axis.prototype.is = function (a, b) {
        this.cr = false;
        this.kh = b;
        this.cq = true;
        this.c1();
        this.ib(false);
        if (this.bi != null) {
            this.bi.ar.ae(1, this, this.a6, b);
        }
    };
    Object.defineProperty(Axis.prototype, "cq", {
        get: function () {
            return this.bx;
        },
        set: function (a) {
            this.bx = a;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ke = function () {
        if (this.bi == null || this.bi.v8.isEmpty) {
            return Rect.empty;
        }
        var a = this.bi.v8;
        var b = this.kh;
        var c = (a.left - b.left) / b.width;
        var d = (a.top - b.top) / b.height;
        var e = (a.right - b.left) / b.width;
        var f = (a.bottom - b.top) / b.height;
        return new Rect(0, c, d, e - c, f - d);
    };
    Axis.prototype.it = function (a, b) {
        this.ka = b;
        this.cq = true;
        this.ib(true);
    };
    Axis.prototype.h7 = function () {
        this.ib(false);
    };
    Axis.prototype.hz = function (a, b, c, d) {
        var e_33, _a;
        switch (b) {
            case Axis.$$p[10]:
            case Axis.$$p[11]:
                if (this.gi != null) {
                    this.ai = new BindingFormatter();
                    this.ai.j = this.gi;
                    this.ai.d = this.ah;
                }
                else {
                    this.ai = null;
                }
                break;
            case "SeriesViewer":
                var e = typeCast(SeriesViewer.$, c);
                if (e != null) {
                    this.fn = null;
                    e.actualWindowRectChanged = delegateRemove(e.actualWindowRectChanged, this.bs);
                    e.ar.ad(1, this);
                    this.a5.af(e);
                }
                var f = typeCast(SeriesViewer.$, d);
                if (f != null) {
                    this.fn = f.c9.j.ae;
                    this.ka = f.v4;
                    f.actualWindowRectChanged = delegateCombine(f.actualWindowRectChanged, this.bs);
                    this.a6 = f.ar.k(1, this, runOn(this, this.hn));
                    if (this.az == null && this.fn != null) {
                        this.provideRenderer(this.fn);
                    }
                    this.a5.y(f);
                    if (this.cs && !this.a6.e) {
                        this.cs = false;
                        this.c1();
                    }
                    this.im();
                    this.io();
                }
                break;
            case Axis.$$p[8]:
                this.ib(false);
                break;
            case Axis.$$p[21]:
                this.cx = this.cw;
                this.ib(false);
                break;
            case Axis.$$p[20]:
                this.cv = this.cu;
                this.ib(false);
                break;
            case Axis.$$p[9]:
                this.ci = this.ch;
                var g = new AxisRangeChangedEventArgs(0, 0, 0, 1, 1);
                this.hm(g);
                try {
                    for (var _b = __values(fromEnum(this.df)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var h = _c.value;
                        h.qa();
                        if (h.db != null) {
                            h.qk();
                        }
                    }
                }
                catch (e_33_1) {
                    e_33 = { error: e_33_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_33)
                            throw e_33.error;
                    }
                }
                break;
            case Axis.$$p[12]:
                this.a5.am();
                if (typeCast(DataTemplate.$, d) !== null) {
                    this.c7 = true;
                }
                else {
                    this.c7 = false;
                }
                this.cq = true;
                this.ig();
                this.ib(false);
                break;
            case Axis.$$p[16]:
            case Axis.$$p[19]:
            case Axis.$$p[25]:
                this.ib(false);
                break;
            case Axis.$$p[13]:
                var i = typeCast(AxisLabelSettings.$, d);
                if (i != null) {
                    i.registerAxis(this);
                    this.ax = i;
                }
                else {
                    this.ax = new AxisLabelSettings();
                }
                if (this.aw != null) {
                    this.aw.ag = this.ax;
                }
                this.hx();
                this.cq = true;
                this.ib(false);
                break;
            case Axis.$$p[30]:
                this.a5.ap();
                break;
            case Axis.$$p[31]:
                var j = typeCast(TitleSettings.$, d);
                if (j != null) {
                    j.registerAxis(this);
                }
                else {
                    j = new TitleSettings();
                }
                if (this.iv != null) {
                    this.iv.dataContext = j;
                }
                this.hy();
                this.ib(false);
                break;
            case Axis.$$p[26]:
                this.cq = true;
                this.io();
                this.a5.ai();
                this.ib(false);
                break;
            case Axis.$$p[32]:
            case Axis.$$p[5]:
            case "UseEnhancedIntervalManagement":
            case Axis.$$p[6]:
                this.bz = this.c5;
                this.cq = true;
                this.ib(false);
                break;
            case Axis.$$p[3]:
                if (this.bi != null) {
                    this.bi.n3();
                }
                break;
            case Axis.$$p[18]:
                this.im();
                if (d != null) {
                    this.cy = true;
                    this.ib(false);
                }
                else {
                    this.cy = false;
                }
                break;
            case Axis.$$p[4]:
                if (this.aj != null) {
                    this.aj.ia();
                }
                break;
            case Axis.$$p[24]:
            case Axis.$$p[15]:
                this.im();
                this.ib(false);
                break;
            case Axis.$$p[23]:
            case Axis.$$p[14]:
            case Axis.$$p[17]:
            case Axis.$$p[7]:
            case Axis.$$p[28]:
            case Axis.$$p[29]:
            case Axis.$$p[27]:
            case Axis.$$p[2]:
            case Axis.$$p[0]:
            case Axis.$$p[1]:
            case Axis.$$p[22]:
                this.ib(false);
                break;
            case "MinExtent":
                this.a5.ai();
                break;
        }
    };
    Axis.prototype.hx = function () {
        if (this.a5.p()) {
            this.a5.ab(this.ax);
        }
    };
    Axis.prototype.hy = function () {
        this.a5.ap();
    };
    Object.defineProperty(Axis.prototype, "coercionMethods", {
        get: function () {
            return this._coercionMethods;
        },
        set: function (a) {
            this._coercionMethods = a;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.get_expectFunctions = function () {
        return this.bv;
    };
    Axis.prototype.set_expectFunctions = function (a) {
        this.bv = a;
    };
    Object.defineProperty(Axis.prototype, "expectFunctions", {
        get: function () {
            return this.get_expectFunctions();
        },
        set: function (a) {
            this.set_expectFunctions(a);
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.ig = function () {
        this.br.count = 0;
        this.bq.count = 0;
        this.bp.count = 0;
        if (this.a5.p()) {
            this.a5.at();
        }
    };
    Axis.prototype.hu = function (a, b, c, d) {
        var e = Math.min(b, c);
        var f = Math.max(b, c);
        if (e < d.bottom && f > d.top) {
            var g = new RectangleGeometry();
            g.e = new Rect(0, d.left, e, d.width, f - e);
            a.add(g);
        }
    };
    Axis.prototype.ht = function (a, b, c, d, e) {
        var f = b <= c.bottom && b >= c.top;
        if (!e && f) {
            f = !this.cg(b, d.c, c, false);
        }
        if (f) {
            if (d.a) {
                b = this.d1(b, c.top, c.bottom, d);
            }
            var g = new LineGeometry();
            g.d = { $type: Point_$type, x: c.left, y: b };
            g.c = { $type: Point_$type, x: c.right, y: b };
            a.add(g);
        }
    };
    Axis.prototype.ir = function (a, b, c, d) {
        var e = Math.min(b, c);
        var f = Math.max(b, c);
        if (f > d.left && e < d.right) {
            var g = new RectangleGeometry();
            g.e = new Rect(0, e, d.top, f - e, d.height);
            a.add(g);
        }
    };
    Axis.prototype.iq = function (a, b, c, d, e) {
        var f = b >= c.left && b <= c.right;
        if (!f) {
            var g = truncate(Math.round(b));
            var h = truncate(Math.round(c.left));
            var i = truncate(Math.round(c.right));
            if (g >= h && g <= i) {
                f = true;
            }
        }
        if (!e && f) {
            f = !this.cg(b, d.c, c, true);
        }
        if (f) {
            if (d.a) {
                b = this.d1(b, c.left, c.right, d);
            }
            var j = new LineGeometry();
            j.d = { $type: Point_$type, x: b, y: c.top };
            j.c = { $type: Point_$type, x: b, y: c.bottom };
            a.add(j);
        }
    };
    Axis.prototype.cg = function (a, b, c, d) {
        var e_34, _a;
        var e = false;
        var f = typeCast(XamDataChart.$, this.bi);
        if (f != null && (f.xn || f.xo) && !c.isEmpty) {
            var g = this.bi.v4.width == 1 && this.bi.v4.height == 1;
            try {
                for (var _b = __values(fromEnum(f.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var h = _c.value;
                    if (h._visibility != 0 || h.fi < 1 || h.jy == null || BrushUtilCore.a(h.jy) || h.kh.isEmpty) {
                        continue;
                    }
                    if (h.aj != null && h.b5()) {
                        if (f.xn) {
                            var i = this.cp ? c.left : c.top;
                            var j = 0;
                            var k = h.ii(i, j, h.bi.wl, c, h.kc(), d ? c.left : c.top, d ? c.right : c.bottom);
                            i = k.p0;
                            j = k.p1;
                            var l = Rect.empty;
                            var m = Rect.empty;
                            if (d && h.cp) {
                                l = new Rect(0, i - (h.fi / 2), h.kh.top, h.fi, h.kh.height);
                                m = new Rect(0, a - (b / 2), c.top, b, c.height);
                            }
                            else if (!d && !h.cp) {
                                l = new Rect(0, h.kh.left, i - (h.fi / 2), h.kh.width, h.fi);
                                m = new Rect(0, c.left, a - (b / 2), c.width, b);
                            }
                            if (l.left <= m.right && m.left <= l.right && l.top <= m.bottom && m.top <= l.bottom) {
                                e = true;
                                break;
                            }
                        }
                    }
                    else {
                        var n = Rect.empty;
                        var o = Rect.empty;
                        if (d && h.cp) {
                            n = new Rect(0, h.kh.left, h.kh.top, h.fi, h.kh.height);
                            o = new Rect(0, a - (b / 2), c.top, b, c.height);
                        }
                        else if (!d && !h.cp) {
                            n = new Rect(0, h.kh.left, h.kh.bottom - (h.fi / 2), h.kh.width, h.fi);
                            o = new Rect(0, c.left, a - (b / 2), c.width, b);
                        }
                        if (n.left <= o.right && o.left <= n.right && n.top <= o.bottom && o.top <= n.bottom) {
                            e = true;
                            break;
                        }
                        if (g && f.xo) {
                            var p = f.yh;
                            if (isNaN_(p)) {
                                if (d && h.cp) {
                                    p = 0;
                                    p = Math.max(p, f.x9);
                                    p = Math.max(p, f.x6);
                                }
                                else if (!d && !h.cp) {
                                    p = 0;
                                    p = Math.max(p, f.x7);
                                    p = Math.max(p, f.x8);
                                }
                                p += 1;
                            }
                            p *= 2;
                            if (d && h.cp) {
                                n = new Rect(0, h.kh.left, h.kh.top, h.fi, h.kh.height);
                                o = new Rect(0, a - (p / 2), c.top, p, c.height);
                            }
                            else if (!d && !h.cp) {
                                n = new Rect(0, h.kh.left, h.kh.bottom - (h.fi / 2), h.kh.width, h.fi);
                                o = new Rect(0, c.left, a - (p / 2), c.width, p);
                            }
                            if (n.left <= o.right && o.left <= n.right && n.top <= o.bottom && o.top <= n.bottom) {
                                e = true;
                                break;
                            }
                        }
                    }
                }
            }
            catch (e_34_1) {
                e_34 = { error: e_34_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_34)
                        throw e_34.error;
                }
            }
        }
        return e;
    };
    Axis.prototype.ii = function (a, b, c, d, e, f, g) {
        var h = Math.abs(f - g);
        a = this.fx;
        a = this.aj.e6(a);
        var i = typeCast(CategoryAxisBase.$, this.aj);
        if (i != null && i.categoryMode == 2) {
            var j = 0.5 * i.getCategorySize(c, d, e);
            var k = i.a2 == 0;
            if (i.ch == k) {
                j = -j;
            }
            a = a + j;
        }
        b = a - f;
        if (a < f) {
            a = f;
        }
        else if (a > g) {
            a = g;
        }
        if (b < 0) {
            b = 0;
        }
        else if (b > h) {
            b = h;
        }
        return {
            p0: a,
            p1: b
        };
    };
    Axis.prototype.d1 = function (a, b, c, d) {
        var e = a;
        if (d != null && d.c > 0) {
            var f = d.c % 2;
            if (f == 0 || f == 1) {
                var g = 1;
                e = Math.floor(a);
                if (e + 0.5 < a) {
                    g = -1;
                    e = Math.ceil(a);
                }
                if (f == 1) {
                    e += 0.5 * g;
                }
                if (e >= c) {
                    e -= 1;
                }
                else if (e <= b) {
                    e += 1;
                }
            }
        }
        return e;
    };
    Axis.prototype.hk = function (a) {
        this.a5.ae(a);
    };
    Axis.prototype.hj = function () {
        this.br.count = 0;
        this.bq.count = 0;
        this.bp.count = 0;
        this.a5.ac();
        this.dd.clear();
        this.de.clear();
    };
    Axis.prototype.ia = function () {
        this.ib(false);
    };
    Axis.prototype.ib = function (a) {
        if (this.bi != null) {
            this.bi.ar.ac(1, this, this.a6, a);
            if (this.renderRequested != null) {
                var b = new RenderRequestedEventArgs();
                b.animate = a;
                this.renderRequested(this, b);
                a = b.animate;
            }
        }
    };
    Axis.prototype.e1 = function () {
        if (this.bc == null) {
            return -1;
        }
        if (isNaN_(this.bc.b)) {
            return -1;
        }
        if (this.eh() != 0) {
            return -1;
        }
        var a = this.bc.b;
        var b = this.e5();
        var c = this.e2();
        a = a + b + c;
        return Math.max(Axis.ev, a);
    };
    Axis.prototype.e5 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.topMargin;
        }
    };
    Axis.prototype.e3 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.leftMargin;
        }
    };
    Axis.prototype.e4 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.rightMargin;
        }
    };
    Axis.prototype.e2 = function () {
        if (this.az == null) {
            return 0;
        }
        else {
            return this.az.bottomMargin;
        }
    };
    Axis.prototype.ez = function () {
        if (this.bc == null) {
            return -1;
        }
        if (isNaN_(this.bc.d) && isNaN_(this.dj)) {
            return -1;
        }
        if (this.az != null && (this.az.angle != 0)) {
            return -1;
        }
        var a = this.bc.d;
        if (!isNaN_(this.dj) && this.fs == -1) {
            return this.dj;
        }
        return Math.max(Axis.ev, this.bc.d);
    };
    Axis.prototype.d3 = function (a, b, c, d, e) {
        if (a == 1) {
            return 1;
        }
        if (b) {
            return a;
        }
        var f = 0;
        var g = this.es(a, b, c, d, e);
        if (!b && f < 10 && this.cz(g, a, c, d, e)) {
            a = g;
            g = a - 1;
            f += 1;
            while (!b && f < 10 && this.cz(g, a, c, d, e)) {
                a = g;
                g = a - 1;
                f += 1;
            }
        }
        return a;
    };
    Axis.prototype.es = function (a, b, c, d, e) {
        var f = false;
        if (this.cp) {
            f = this.cb && this.b1 && this.bc != null;
        }
        else {
            f = this.cb && this.b1 && this.b6();
        }
        if (f) {
            var g = this.ei(a, c, d, e);
            if (isNaN_(g)) {
                return a;
            }
            var h = this.ej(a, c, d, e);
            if (g <= h) {
                return a;
            }
            var i = Math.ceil((h / g) * a) + 1;
            if (f && i == a) {
                i--;
            }
            return i;
        }
        return a;
    };
    Axis.prototype.ej = function (a, b, c, d) {
        if (this.cp) {
            var e = this.bc.b;
            return e;
        }
        else {
            var f = this.dj;
            if (this.bi != null && this.bi.ft) {
                f = this.bc.b;
            }
            return f;
        }
    };
    Axis.prototype.cz = function (a, b, c, d, e) {
        if (this.cp) {
            if (this.cb && this.b1 && this.bc != null) {
                var f = this.bc.b;
                if (a >= 1) {
                    var g = a;
                    if (g < 1) {
                        return false;
                    }
                    var h = this.ei(g, c, d, e);
                    if (isNaN_(h)) {
                        return false;
                    }
                    if (h > f) {
                        return true;
                    }
                }
            }
        }
        else {
            if (this.cb && this.b1 && this.b6()) {
                if (a >= 1) {
                    var i = a;
                    if (i < 1) {
                        return false;
                    }
                    var j = this.ei(i, c, d, e);
                    if (isNaN_(j)) {
                        return false;
                    }
                    var k = this.dj;
                    if (this.bi != null && this.bi.ft) {
                        k = this.bc.b;
                    }
                    if (j > k) {
                        return true;
                    }
                }
            }
        }
        return false;
    };
    Axis.prototype.ei = function (a, b, c, d) {
        return NaN;
    };
    Axis.prototype.e0 = function () {
        if (this.cp) {
            return this.e1();
        }
        else {
            return this.ez();
        }
    };
    Object.defineProperty(Axis.prototype, "c0", {
        get: function () {
            return this.fs == -1;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.hn = function (a) {
        if (this.a5.n()) {
            return;
        }
        var b = 0;
        var c = 0;
        if (this.de != null && this.de.count > 0) {
            b = this.de._inner[this.de.count - 1].c;
            c = this.de.count;
        }
        if (this.cq && this.c4) {
            this.bc = this.bb();
        }
        this.a5.z();
        this.ic(a);
        this.a5.aq();
        if (!this.cp && this.cq && this.c4 && this.c0) {
            if (this.b2()) {
                this.a5.z();
                this.ic(a);
                this.a5.aq();
            }
        }
        var d = 1;
        var e = 0;
        if (this.de != null && this.de.count > 0) {
            d = this.de._inner[this.de.count - 1].c;
            e = this.de.count;
        }
        if (this.c6) {
            this.cq = true;
        }
        var f = false;
        if (d != b || e != c || this.cq) {
            this.cq = false;
            if (this.a5.p()) {
                this.a5.ai();
                f = true;
            }
        }
        this.a5.ah();
        if (!f) {
            this.ho();
        }
    };
    Axis.prototype.b2 = function () {
        if (!isNaN_(this.dj) || this.dd == null || this.dd.count == 0) {
            return false;
        }
        var a = this.bl();
        if (a == null) {
            return false;
        }
        var b = -1.7976931348623157E+308;
        for (var c = 0; c < this.dd.count; c++) {
            var d = this.dd._inner[c];
            if (typeof d === 'string') {
                var e = FontUtil.measureStringWidth(d, a, this.a5.j);
                b = Math.max(e, b);
            }
        }
        b += 5;
        if (this.az != null) {
            b += this.az.leftMargin + this.az.rightMargin;
        }
        this.dj = b;
        return true;
    };
    Axis.prototype.ie = function () {
        this.dj = NaN;
        this.ib(false);
    };
    Axis.prototype.b6 = function () {
        return !isNaN_(this.dj) && this.fs == -1;
    };
    Axis.prototype.d2 = function (a, b) {
        return a;
    };
    Axis.prototype.ih = function () {
        this.dj = NaN;
    };
    Axis.prototype.bb = function () {
        var a = this.bl();
        if (a == null) {
            return null;
        }
        if (a.f == 0) {
            return null;
        }
        var b = "W";
        if (this.a5.j == null) {
            return null;
        }
        var c = FontUtil.measureStringWidth(b, a, this.a5.j);
        if (this.dk != c || this.bc == null) {
            this.dk = c;
            var d = FontUtil.getCurrentFontHeight(this.bi.c9.j.ae, a);
            if (this.bc == null) {
                this.bc = new LabelFontHeuristics();
            }
            this.bc.b = d;
            this.bc.c = this.fs;
            this.bc.a = this.b1;
            this.bc.e = c;
            this.bc.d = this.bc.e * this.bc.c;
        }
        return this.bc;
    };
    Axis.prototype.bl = function () {
        var a = null;
        if (this.bi != null) {
            a = this.bi.getFontInfo();
        }
        if (this.az != null && this.az.j) {
            if (this.bi != null) {
                a = this.az.h(this.bi.c9.j.ae);
            }
        }
        return a;
    };
    Axis.prototype.ho = function () {
        if (!this.a5.p()) {
            return;
        }
        if (!this.b8()) {
            this.a5.ag();
        }
    };
    Axis.prototype.c1 = function () {
        return this.c2(false);
    };
    Axis.prototype.c2 = function (a) {
        if (a || this.bi == null) {
            var b = this.c3();
            if (b) {
                this.cq = true;
            }
            this.cs = false;
            return b;
        }
        if (!this.cs) {
            this.cs = true;
            this.bi.ar.ab(this, this.a6);
        }
        return false;
    };
    Axis.prototype.c3 = function () {
        return false;
    };
    Axis.prototype.hl = function () {
    };
    Axis.prototype.ic = function (a) {
        if (this.iv != null) {
            if ((this.bf == null || this.bf.visibility == 0) && (this.az == null || this.az.visibility == 0) && this.g8 != null) {
                this.iv._visibility = 0;
            }
            else {
                this.iv._visibility = 1;
            }
        }
    };
    Axis.prototype.im = function () {
        var e_35, _a, e_36, _b;
        var a = typeCast(XamDataChart.$, this.bi);
        if (a == null) {
            return;
        }
        var b = null, c = null, d = null;
        if (this.cb && !this.b9) {
            b = a.aas;
            try {
                for (var _c = __values(fromEnum(this.df)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var e = _d.value;
                    if (e.fv || e.fs || e.fo || e.fs) {
                        c = a.aaq;
                        d = a.aar;
                        break;
                    }
                }
            }
            catch (e_35_1) {
                e_35 = { error: e_35_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_35)
                        throw e_35.error;
                }
            }
        }
        else if (this.cj && !this.b9) {
            c = a.aaq;
            d = a.aar;
            b = this.aj != null ? a.aas : null;
            try {
                for (var _e = __values(fromEnum(this.df)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var f = _f.value;
                    if (f.fv || f.fs || f.fo || f.fs) {
                        b = a.aas;
                        break;
                    }
                }
            }
            catch (e_36_1) {
                e_36 = { error: e_36_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_36)
                        throw e_36.error;
                }
            }
        }
        else if (this.b9 || this.a2 == 3) {
            b = a.aas;
            c = a.aaq;
            d = a.aar;
        }
        this.jy = this.j2 != null ? this.j2 : b;
        this.jw = this.jz != null ? this.jz : c;
        this.jx = this.j0 != null ? this.j0 : d;
    };
    Axis.prototype.h5 = function (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));
        }
    };
    Axis.prototype.ct = function (a) {
        var b = this.df.contains(a);
        if (!b) {
            this.df.add(a);
        }
        this.im();
        return !b;
    };
    Axis.prototype.b0 = function (a) {
        var b = this.df.contains(a);
        if (b) {
            this.df.remove(a);
        }
        this.im();
        return b;
    };
    Axis.prototype.fz = function (a, b) {
        var c = this.gu(b);
        if (c == Axis.$$p[12]) {
            return this.f0(a, b, this.f2);
        }
        return null;
    };
    Axis.prototype.gu = function (a) {
        if (!this.da.containsKey(a)) {
            var b = a.charAt(0).toUpperCase() + a.substr(1);
            this.da.addItem(a, b);
        }
        return this.da.item(a);
    };
    Axis.prototype.f0 = function (a, b, c) {
        var d = null;
        if (!this.c9.containsKey(b)) {
            d = new FastReflectionHelper(false, c);
            this.c9.addItem(b, d);
        }
        else {
            d = this.c9.item(b);
        }
        d.propertyName = c;
        return d.getPropertyValue(a);
    };
    Axis.prototype.f1 = function (a) {
        return this.a5.q(a);
    };
    Axis.prototype.gf = function (a) {
        return this.a5.s(a);
    };
    Axis.prototype.ex = function () {
        return NaN;
    };
    Axis.prototype.el = function (a, b) {
        return 0;
    };
    Axis.prototype.em = function (a, b, c) {
        return 0;
    };
    Axis.prototype.kd = function (a) {
        if (this.bi == null) {
            return Rect.empty;
        }
        if (!a.equals1(this.kh)) {
            return Rect.empty;
        }
        return this.bi.v8;
    };
    Axis.prototype.kc = function () {
        if (this.bi == null) {
            return Rect.empty;
        }
        return this.bi.v8;
    };
    Axis.prototype.kb = function () {
        if (this.bi == null || this.bi.v7.isEmpty) {
            return this.kh;
        }
        return this.bi.v7;
    };
    Axis.prototype.kf = function (a, b) {
        if (b.isEmpty) {
            return a;
        }
        return b;
    };
    Axis.prototype.en = function (a, b, c) {
        var d = this.kd(c);
        var e = new ScalerParams(0, b, c, this.ch, d);
        return this.el(a, e);
    };
    Axis.prototype.hq = function (a, b, c, d) {
    };
    Axis.prototype.hp = function (a, b, c, d, e) {
    };
    Axis.prototype.eo = function (a, b) {
        return 0;
    };
    Axis.prototype.ep = function (a, b, c) {
        return 0;
    };
    Axis.prototype.eq = function (a, b, c) {
        var d = this.kd(c);
        var e = new ScalerParams(0, b, c, this.ch, d);
        return this.eo(a, e);
    };
    Axis.prototype.hr = function (a, b, c, d) {
    };
    Axis.prototype.e6 = function (a) {
        var b = this.kc();
        var c = new ScalerParams(0, this.bi.v4, this.kh, this.ch, b);
        return this.el(a, c);
    };
    Axis.prototype.hw = function (a) {
        var b = false;
        if (this.km.width == 0 || this.km.height == 0) {
            this.kg = new Rect(0, 0, 0, a.width, a.height);
        }
        else {
            b = true;
            this.kg = new Rect(0, 0, 0, this.km.width, this.km.height);
        }
        if (b) {
            this.a6.c = true;
            this.cq = true;
            this.aw.ci();
            this.c2(true);
        }
    };
    Axis.prototype.il = function () {
        this.kg = Rect.empty;
        this.aw.cq();
    };
    Axis.prototype.aq = function () {
        this.ap.a = this.aw;
        return this.ap;
    };
    Object.defineProperty(Axis.prototype, "eu", {
        get: function () {
            return this.di;
        },
        set: function (a) {
            var b = this.eu;
            if (a != b) {
                this.di = a;
                this.h5("MinExtent", b, this.eu);
            }
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.b8 = function () {
        if (!isNaN_(this.d4)) {
            return true;
        }
        if (this.az == null) {
            return false;
        }
        else {
            return this.az.l();
        }
    };
    Axis.prototype.er = function () {
        if (!isNaN_(this.d4)) {
            return this.d4;
        }
        if (this.az == null) {
            return 50;
        }
        return this.az.extent;
    };
    Axis.prototype.hi = function () {
        this.a5.x();
    };
    Axis.prototype.hm = function (a) {
        this.h6(a);
    };
    Object.defineProperty(Axis.prototype, "ki", {
        get: function () {
            return this.ar().a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kj", {
        get: function () {
            return this.ar().b;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kl", {
        get: function () {
            return this.a5.c().d;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Axis.prototype, "kk", {
        get: function () {
            return this.ar().c;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.be = function () {
        return SyncManager.a(this.bh);
    };
    Axis.prototype.ar = function () {
        return this.a5.c();
    };
    Object.defineProperty(Axis.prototype, "ay", {
        get: function () {
            return this.ax;
        },
        enumerable: false,
        configurable: true
    });
    Axis.prototype.h0 = function (a, b) {
        if (this.aw != null) {
            this.aw.cj(a);
        }
        this.a5.ak(a, b);
    };
    Axis.prototype.b5 = function () {
        return this.fx != null;
    };
    Axis.prototype.fy = function () {
        return this.ba.exportVisualData(this);
    };
    Axis.prototype._db = function () {
        var a, b;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    a = 0;
                    _a.label = 1;
                case 1:
                    if (!(a < this.df.count))
                        return [3 /*break*/, 4];
                    b = this.df._inner[a];
                    return [4 /*yield*/, b];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    a++;
                    return [3 /*break*/, 1];
                case 4: return [2 /*return*/];
            }
        });
    };
    Axis.prototype.db = function () {
        var _this = this;
        return toEnum(function () { return _this._db(); });
    };
    Axis.prototype.dc = function () {
        var e_37, _a;
        var a = new List$1(Series.$, 0);
        for (var b = 0; b < this.df.count; b++) {
            var c = this.df._inner[b];
            a.add(c);
        }
        if (this.bi != null && this.bi.series != null) {
            try {
                for (var _b = __values(fromEnum(this.bi.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var d = _c.value;
                    if (d.eo) {
                        a.add(d);
                    }
                }
            }
            catch (e_37_1) {
                e_37 = { error: e_37_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_37)
                        throw e_37.error;
                }
            }
        }
        return a;
    };
    Axis.prototype.h1 = function (a) {
    };
    Axis.prototype.h4 = function (a) {
    };
    Axis.prototype.h3 = function (a) {
    };
    Axis.prototype.j8 = function (a, b, c, d, e) {
        if (this.cp) {
            var f = new LineGeometry();
            f.d = { $type: Point_$type, x: c.left, y: a };
            f.c = { $type: Point_$type, x: c.right, y: a };
            return f;
        }
        else {
            var g = new LineGeometry();
            g.d = { $type: Point_$type, x: a, y: c.bottom };
            g.c = { $type: Point_$type, x: a, y: c.top };
            return g;
        }
    };
    Axis.$t = markType(Axis, 'Axis', Control.$, [INotifyPropertyChanged_$type]);
    Axis.js = DependencyProperty.i("UseEnhancedIntervalManagement", Boolean_$type, Axis.$, new PropertyMetadata(2, false, function (a, b) { return a.h5("UseEnhancedIntervalManagement", b.oldValue, b.newValue); }));
    Axis.ev = 7;
    Axis.$$p = markDep(DependencyProperty, PropertyMetadata, Axis, 'h5', ['ActualMajorStroke:jw:iw', [Brush.$], 'ActualMinorStroke:jx:ix', [Brush.$], 'ActualStroke:jy:iy', [Brush.$], 'CrossingAxis:aj:iz', [Axis.$], 'CrossingValue:fx:i0', [4, null], 'EnhancedIntervalMinimumCharacters:fs:i1', [1, -1], 'EnhancedIntervalPreferMoreCategoryLabels:b1:i2', [0, false], 'FormatLabel:au:i3', [Delegate_$type], 'IsDisabled:cf:i4', [0, false], 'IsInverted:ch:i5', [0, false], 'LabelFormat:gi:i6', [2, null], 'LabelFormatSpecifiers:ah:i7', [Array_$type, null], 'Label:f2:i8', [4, null], 'LabelSettings:az:i9', [AxisLabelSettings.$, null], 'MajorStrokeDashArray:j4:ja', [DoubleCollection.$], 'MajorStroke:jz:jb', [Brush.$], 'MajorStrokeThickness:et:jc', [1, 1], 'MinorStrokeDashArray:j5:jd', [DoubleCollection.$], 'MinorStroke:j0:je', [Brush.$], 'MinorStrokeThickness:ew:jf', [1, 1], 'ShouldAvoidAnnotationCollisions:cu:jg', [0, false], 'ShouldKeepAnnotationsInView:cw:jh', [0, false], 'Strip:j1:ji', [Brush.$], 'StrokeDashArray:j6:jj', [DoubleCollection.$], 'Stroke:j2:jk', [Brush.$], 'StrokeThickness:fi:jl', [1, DeviceUtils.g(2)], 'TickLength:fj:jm', [1, NaN], 'TickStrokeDashArray:j7:jn', [DoubleCollection.$], 'TickStroke:j3:jo', [Brush.$], 'TickStrokeThickness:fk:jp', [1, DeviceUtils.g(2)], 'Title:g8:jq', [2], 'TitleSettings:bf:jr', [TitleSettings.$, null], 'UsePerLabelHeightMeasurement:c5:jt', [0, true]]);
    return Axis;
}(Control));
export { Axis };
/**
 * @hidden
 */
var AxisCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisCollection, _super);
    function AxisCollection() {
        var _this = _super.call(this, Axis.$, 0) || this;
        _this.collectionResetting = null;
        _this.propertyChanged = delegateCombine(_this.propertyChanged, function (a, b) {
            if (b.propertyName == "Name") {
                for (var c = 0; c < _this.count; ++c) {
                    if (_this._inner[c].name == b.propertyName) {
                        _this.ac(new NotifyCollectionChangedEventArgs(2, 2, _this._inner[c], _this._inner[c], c));
                    }
                }
            }
        });
        return _this;
    }
    AxisCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    AxisCollection.$t = markType(AxisCollection, 'AxisCollection', ObservableCollection$1.$.specialize(Axis.$));
    return AxisCollection;
}(ObservableCollection$1));
export { AxisCollection };
/**
 * @hidden
 */
var AxisLabelManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelManager, _super);
    function AxisLabelManager() {
        var _this = _super.call(this) || this;
        _this.e = null;
        _this.f = null;
        _this.b = null;
        _this.a = null;
        _this.c = null;
        _this.c = function (a) {
        };
        return _this;
    }
    AxisLabelManager.prototype.n = function (a, b) {
        this.e.clear();
        this.f.clear();
        this.b.ad = this.a;
        this.b.c5 = a;
        this.b.c4 = b;
        if (b.isEmpty || a.isEmpty) {
            this.s(0);
            this.a.bq.count = 0;
            this.a.bp.count = 0;
        }
        if (this.a.br.count == 0 && this.a.bq.count == 0 && this.a.a5.l()) {
            this.b.ab.clear();
        }
    };
    AxisLabelManager.prototype.i = function (a, b) {
        this.e.add1(a);
        this.f.add(b);
    };
    AxisLabelManager.prototype.t = function () {
        this.b.a9 = this.e;
        this.b.ba = this.f;
        this.b.cl();
    };
    AxisLabelManager.j = function (a, b) {
        AxisLabelManager.k(a, false, b);
    };
    AxisLabelManager.k = function (a, b, c) {
    };
    AxisLabelManager.l = function (a, b, c) {
    };
    AxisLabelManager.m = function (a, b) {
        AxisLabelManager.l(a, true, b);
    };
    AxisLabelManager.prototype.h = function (a) {
        this.b.ab.add(a);
    };
    AxisLabelManager.prototype.r = function (a) {
        this.b.bw = a;
    };
    AxisLabelManager.prototype.o = function (a) {
        this.c(a);
    };
    AxisLabelManager.prototype.u = function (a) {
        var b = this.a.br.item(a);
        return b;
    };
    AxisLabelManager.prototype.s = function (a) {
        if (this.a == null) {
            return;
        }
        this.a.br.count = a;
    };
    Object.defineProperty(AxisLabelManager.prototype, "d", {
        get: function () {
            if (this.a == null || this.a.az == null) {
                return false;
            }
            return this.a.az.visibility != 0;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelManager.prototype.q = function () {
        this.a.br.count = 0;
        this.a.bq.count = 0;
        this.a.bp.count = 0;
        this.a.aw.bb.clear();
    };
    AxisLabelManager.prototype.p = function () {
        this.a.cq = true;
    };
    AxisLabelManager.prototype.g = function () {
        this.a.hh();
    };
    AxisLabelManager.$t = markType(AxisLabelManager, 'AxisLabelManager');
    return AxisLabelManager;
}(Base));
export { AxisLabelManager };
/**
 * @hidden
 */
var AxisLabelPanelBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelPanelBase, _super);
    function AxisLabelPanelBase() {
        var _this = _super.call(this) || this;
        _this.cx = null;
        _this.bw = 0;
        _this.ad = null;
        _this.ak = false;
        _this.a3 = null;
        _this.ba = null;
        _this.c4 = null;
        _this.cw = Rect.empty;
        _this.cv = null;
        _this.c2 = null;
        _this.bc = 0;
        _this.bx = null;
        _this.bb = null;
        _this.a8 = null;
        _this.ag = null;
        _this.ao = false;
        _this.c3 = null;
        _this.ar = false;
        _this.av = false;
        _this.aw = false;
        _this.ax = false;
        _this.bz = null;
        _this.al = false;
        _this.bd = 50;
        _this.be = 0;
        _this.bf = 0;
        _this.c7 = new Size();
        _this.be = NaN;
        _this.c4 = Rect.empty;
        _this.c2 = Rect.empty;
        _this.c1 = Rect.empty;
        _this.af = _this.ae();
        _this.ch(_this.af);
        _this.af.an();
        _this.bb = new List$1(FrameworkElement.$, 0);
        _this.ba = new List$1(LabelPosition.$, 0);
        _this.a8 = new List$1(Rect.$, 0);
        _this.aw = false;
        _this.av = false;
        _this.ax = false;
        _this.ao = false;
        _this.ar = false;
        _this.c3 = Rect.empty;
        _this.ak = false;
        return _this;
    }
    AxisLabelPanelBase.prototype.ae = function () {
        return new AxisLabelPanelBaseView(this);
    };
    AxisLabelPanelBase.prototype.ch = function (a) {
    };
    AxisLabelPanelBase.prototype.b8 = function () {
    };
    AxisLabelPanelBase.prototype.cp = function () {
    };
    AxisLabelPanelBase.prototype.co = function () {
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "az", {
        get: function () {
            return this.ak;
        },
        set: function (a) {
            this.ak = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "a9", {
        get: function () {
            return this.a3;
        },
        set: function (a) {
            var b = this.a3;
            this.a3 = a;
            if (b == null && b != a) {
                this.ce();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "c5", {
        get: function () {
            return this.cw;
        },
        set: function (a) {
            var b = this.cw;
            this.cw = a;
            this.ct(b, this.cw);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "c1", {
        get: function () {
            if (!this.c2.isEmpty) {
                return this.c2;
            }
            return this.cv;
        },
        set: function (a) {
            var b = this.cv;
            this.cv = a;
            this.cd(b, this.cv);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(AxisLabelPanelBase.prototype, "bg", {
        get: function () {
            return this.bc;
        },
        set: function (a) {
            this.bc = a;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.bn = function () {
        var a = 1.7976931348623157E+308;
        if (this.ba != null && this.ba.count > 1) {
            for (var b = 1; b < this.ba.count; b++) {
                var c = this.ba._inner[b];
                var d = this.ba._inner[b - 1];
                if (c.a || d.a) {
                    continue;
                }
                var e = Math.abs(c.c - d.c);
                if (e < a) {
                    a = e;
                }
            }
        }
        return a;
    };
    AxisLabelPanelBase.prototype.cl = function () {
        this.ar = false;
        this.c3 = Rect.empty;
    };
    AxisLabelPanelBase.prototype.an = function (a, b) {
        for (var c = 0; c < a.count - 1; c++) {
            if (b._inner[c]) {
                continue;
            }
            for (var d = c; d < a.count - 1; d++) {
                if (b._inner[d + 1]) {
                    continue;
                }
                if (a._inner[c].intersectsWith(a._inner[d + 1])) {
                    return true;
                }
            }
        }
        return false;
    };
    AxisLabelPanelBase.prototype.by = function (a, b, c) {
        return {
            ret: 0,
            p1: b
        };
    };
    AxisLabelPanelBase.prototype.a5 = function () {
        return null;
    };
    AxisLabelPanelBase.prototype.b6 = function () {
    };
    AxisLabelPanelBase.prototype.b2 = function (a) {
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "ap", {
        get: function () {
            return this.ag != null && this.ag.k();
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.bl = function () {
        if (this.ad.b4 && (!this.ap || (this.ap && this.ag.angle == 0))) {
            return this.ad.ey();
        }
        return this.ag != null ? this.ag.angle : 0;
    };
    AxisLabelPanelBase.prototype.bq = function () {
        return this.ad.bf != null ? this.ad.bf.angle : 0;
    };
    AxisLabelPanelBase.prototype.at = function (a, b) {
        if (a == 0 && !this.ad.b9 && this.ag != null) {
            if (this.ad.cp) {
                if (!this.ag.showFirstLabel && this.ad.bi.ht() == 1) {
                    return false;
                }
            }
            else {
                if (!this.ag.showFirstLabel && this.ad.bi.hs() == 1) {
                    return false;
                }
            }
        }
        return true;
    };
    AxisLabelPanelBase.prototype.bk = function (a) {
        return this.af.m(a);
    };
    AxisLabelPanelBase.prototype.bv = function (a) {
        return this.af.w(a);
    };
    AxisLabelPanelBase.prototype.bm = function (a) {
        return this.af.n(a);
    };
    AxisLabelPanelBase.prototype.bj = function (a) {
        return this.af.l(a);
    };
    AxisLabelPanelBase.prototype.aq = function () {
        return false;
    };
    AxisLabelPanelBase.prototype.ct = function (a, b) {
    };
    AxisLabelPanelBase.prototype.cd = function (a, b) {
    };
    AxisLabelPanelBase.prototype.a7 = function () {
        if (this.ab.count < 1 || this.ba.count == 0) {
            return new List$1(Rect.$, 0);
        }
        this.bb = new List$1(FrameworkElement.$, 0);
        this.a8 = new List$1(Rect.$, 0);
        this.b6();
        this.af.af();
        var a = this.bl();
        if (a % 360 == 0) {
            this.av = false;
        }
        if (this.bb.count == 0) {
            return new List$1(Rect.$, 0);
        }
        this.a8 = this.a5();
        this.a8 = this.a6(this.a8);
        this.ak = true;
        return this.a8;
    };
    AxisLabelPanelBase.prototype.a6 = function (a) {
        var _this = this;
        if (this.ad.cu || this.ad.cw) {
            var b = this.af.p();
            var c = this.af.r();
            var d = this.af.q();
            var e = this.af.o();
            var f = Math.max(b, Math.max(c, Math.max(d, e)));
            var g_1 = new Thickness(0, f);
            if (this.av) {
                g_1 = new Thickness(0, Math.sqrt((f * f) / 2));
            }
            var h = this.a4(a);
            var i = new List$1(Thickness.$, 0);
            if (h.count < 1) {
                return a;
            }
            h.aa(function (j, k) {
                var l = _this.cy(j, a._inner[j], g_1);
                var m = _this.cy(k, a._inner[k], g_1);
                var n = l.top;
                var o = m.top;
                if (n < o) {
                    return -1;
                }
                if (n > o) {
                    return 1;
                }
                return 0;
            });
            for (var j = 0; j < h.count; j++) {
                var k = h._inner[j];
                var l = a._inner[k];
                var m = this.cy(k, a._inner[k], g_1);
                var n = this.ad.bi.wk.top;
                if (this.ad.cw) {
                    if (l.top < (this.ad.bi.wk.top - n)) {
                        l = new Rect(0, l.left, l.top + ((this.ad.bi.wk.top - n) - l.top), l.width, l.height);
                        a._inner[k] = l;
                    }
                }
            }
            var o = this.as(a, h, g_1);
            if (o && (this.ad.cu)) {
                for (var p = 0; p < h.count - 1; p++) {
                    var q = h._inner[p];
                    var r = h._inner[p + 1];
                    var s = a._inner[q];
                    var t = a._inner[r];
                    var u = this.cy(q, a._inner[q], g_1);
                    var v = this.cy(r, a._inner[r], g_1);
                    if (u.intersectsWith(v) || u.top > v.bottom) {
                        var w = new Rect(0, t.left, u.bottom + 1 + (t.top - v.top), t.width, t.height);
                        a._inner[r] = w;
                    }
                }
            }
            for (var x = h.count - 1; x >= 0; x--) {
                var y = h._inner[x];
                var z = a._inner[y];
                var aa = this.cy(y, a._inner[y], g_1);
                var ab = this.ad.bi.c9.a3;
                if (this.ad.cw) {
                    if (aa.bottom > this.ad.bi.wk.bottom + ab) {
                        z = new Rect(0, z.left, z.top - (aa.bottom - (this.ad.bi.wk.bottom + ab)), z.width, z.height);
                        a._inner[y] = z;
                    }
                }
            }
            if (this.ad.cu) {
                for (var ac = h.count - 1; ac >= 1; ac--) {
                    var ad = h._inner[ac];
                    var ae = h._inner[ac - 1];
                    var af = a._inner[ad];
                    var ag = a._inner[ae];
                    var ah = this.cy(ad, a._inner[ad], g_1);
                    var ai = this.cy(ae, a._inner[ae], g_1);
                    if (ah.intersectsWith(ai) || ah.top < ai.bottom) {
                        var aj = new Rect(0, ag.left, ah.top - (ai.height + 1 + (ag.top - ai.top)), ag.width, ag.height);
                        a._inner[ae] = aj;
                    }
                }
            }
            return a;
        }
        else {
            return a;
        }
    };
    AxisLabelPanelBase.prototype.cy = function (a, b, c) {
        var d = this.ba._inner[a];
        var e = d.d;
        if (isNaN_(e.left) || isNaN_(e.top) || isNaN_(e.right) || isNaN_(e.bottom)) {
            e = c;
        }
        if (e.left > c.left || e.top > c.top || e.right > c.right || e.bottom > c.bottom) {
            e = c;
        }
        var f = new Rect(0, b.left - e.left, b.top - e.top, b.width + e.left + e.right, b.height + e.top + e.bottom);
        return f;
    };
    AxisLabelPanelBase.prototype.as = function (a, b, c) {
        if (b.count <= 1) {
            return false;
        }
        for (var d = 0; d < b.count - 1; d++) {
            var e = b._inner[d];
            var f = b._inner[d + 1];
            var g = a._inner[e];
            var h = a._inner[f];
            var i = this.cy(e, a._inner[e], c);
            var j = this.cy(f, a._inner[f], c);
            if (i.intersectsWith(j)) {
                return true;
            }
        }
        return false;
    };
    AxisLabelPanelBase.prototype.a4 = function (a) {
        var b = new List$1(Number_$type, 0);
        for (var c = 0; c < a.count; c++) {
            var d = this.ba._inner[c].a;
            if (d) {
                b.add(c);
            }
        }
        return b;
    };
    AxisLabelPanelBase.prototype.bp = function (a, b) {
        var c = a * (Math.PI / 180);
        var d = Math.abs(b.width * Math.cos(c)) + Math.abs(b.height * Math.sin(c));
        return d;
    };
    AxisLabelPanelBase.prototype.bo = function (a, b) {
        var c = a * (Math.PI / 180);
        var d = Math.abs(b.height * Math.cos(c)) + Math.abs(b.width * Math.sin(c));
        return d;
    };
    AxisLabelPanelBase.prototype.bt = function () {
        var a = this.af.k();
        return a;
    };
    AxisLabelPanelBase.prototype.br = function () {
        var a = this.af.j();
        return a;
    };
    AxisLabelPanelBase.prototype.bs = function () {
        if (this.ad.g8 == null || (this.ad.bf != null && this.ad.bf.visibility == 1)) {
            return 0;
        }
        var a = this.br();
        var b = this.bt();
        var c = new Rect(0, 0, 0, b, a);
        var d = this.bq();
        var e = RectUtil.w(c, d);
        return e.height + this.af.v() + this.af.s();
    };
    AxisLabelPanelBase.prototype.bu = function () {
        if (this.ad.g8 == null || (this.ad.bf != null && this.ad.bf.visibility == 1)) {
            return 0;
        }
        var a = this.br();
        var b = this.bt();
        var c = new Rect(0, 0, 0, b, a);
        var d = this.bq();
        var e = RectUtil.w(c, d);
        return e.width + this.af.t() + this.af.u();
    };
    AxisLabelPanelBase.prototype.c6 = function (a) {
        if (this.ad == null || this.ab.count == 0) {
            return a;
        }
        this.b5(a);
        this.b9();
        this.b4(a);
        this.a8 = this.a7();
        if (this.bb.count != this.a8.count) {
            return a;
        }
        var b = this.af.p();
        var c = this.af.r();
        var d = this.af.q();
        var e = this.af.o();
        if (this.av) {
            for (var f = 0; f < this.bb.count; f++) {
                if (this.at(f, this.a8._inner[f])) {
                    this.af.aa(this.bb._inner[f], this.a8._inner[f], b, c, d, e);
                }
                this.cm(this.bb._inner[f], this.bl());
            }
        }
        for (var g = 0; g < this.bb.count; g++) {
            if (!this.av) {
                this.af.ae(this.bb._inner[g]);
            }
            if (this.at(g, this.a8._inner[g])) {
                this.af.aa(this.bb._inner[g], this.a8._inner[g], b, c, d, e);
            }
            else {
                this.af.aa(this.bb._inner[g], new Rect(0, 0, 0, 0, 0), b, c, d, e);
            }
        }
        if (this.ad.bq.count > 0) {
            this.ad.a8.arrangeAnnotations(this.ad, this.af, this.bb, this.a8, this.av, this.bl(), b, c, d, e);
        }
        this.b2(a);
        if (this.aq() && this.am && this.ad != null && this.ad.bg != null && !this.ad.cr && this.ad.bg.xa && !this.ad.bg.xh && this.a8 != null && this.a8.count > 0) {
            var h = this.a8.count - 1;
            if (this.ad.bq.count > 0) {
                h -= this.ad.bq.count;
            }
            if (h < 0) {
                h = 0;
            }
            this.ad.bg.zv(this, this.c1, this.a8._inner[0], this.a8._inner[h]);
        }
        return a;
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "am", {
        get: function () {
            return this.ad.az != null && (this.ad.az.c != 5 && this.ad.az.c != 4);
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.c0 = function () {
        return Rect.empty;
    };
    AxisLabelPanelBase.prototype.b5 = function (a) {
        if (this.ad.iv == null) {
            return;
        }
        this.af.ai(this.ad.iv, new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
        var b = Math.abs(this.bq() - 0) > 1E-06;
        var c = this.c0();
        var d = c.left + (c.width / 2);
        var e = c.top + (c.height / 2);
        var f = this.bt() + this.af.t() + this.af.u();
        var g = this.br() + this.af.v() + this.af.s();
        var h = f / 2;
        var i = g / 2;
        var j = new Rect(0, d - h, e - i, f, g);
        if (b) {
            this.cn(this.ad.iv);
        }
        else {
            this.af.ae(this.ad.iv);
        }
        this.af.aa(this.ad.iv, j, this.af.t(), this.af.v(), this.af.u(), this.af.s());
        if ((this.ad.bf == null || this.ad.bf.visibility == 0) && (this.ad.az == null || this.ad.az.visibility == 0) && this.ad.g8 != null) {
            this.ad.iv._visibility = 0;
        }
        else {
            this.ad.iv._visibility = 1;
            this.af.aa(this.ad.iv, new Rect(0, 0, 0, 0, 0), 0, 0, 0, 0);
        }
    };
    AxisLabelPanelBase.prototype.b4 = function (a) {
        this.af.ab(a);
    };
    AxisLabelPanelBase.prototype.b9 = function () {
    };
    AxisLabelPanelBase.prototype.a2 = function () {
        if (typeCast(CategoryAxisBase.$, this.ad) !== null) {
            return this.ad.k2;
        }
        if (typeCast(NumericAxisBase.$, this.ad) !== null) {
            var a = new List$1(Number_$type, 0);
            var d = this.ad.k9.j();
            for (var c = 0; c < d.length; c++) {
                var b = d[c];
                var e = this.ad.kc();
                var f = new ScalerParams(0, this.ad.bi.wl, this.ad.kh, this.ad.ci, e);
                a.add(this.ad.el(b, f));
            }
            return a;
        }
        return null;
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "ah", {
        get: function () {
            var a = this.ag != null ? this.ag.c : this.ai();
            if (this.ad.aj == null) {
                if (a == 4) {
                    a = 5;
                }
                else if (a == 5) {
                    a = 4;
                }
                else if (a == 6) {
                    a = 7;
                }
                else if (a == 7) {
                    a = 6;
                }
            }
            return a;
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.cs = function (a, b, c, d, e, f) {
        var g = b;
        var h = b;
        if (f != null) {
            var i = f.c / 2;
            g -= i;
            h += i;
        }
        if (h >= e.left && g <= e.right) {
            if (f.a) {
                b = this.ad.d1(b, e.left, e.right, f);
            }
            var j = new LineGeometry();
            j.d = { $type: Point_$type, x: b, y: c };
            j.c = { $type: Point_$type, x: b, y: d };
            a.add(j);
        }
    };
    AxisLabelPanelBase.prototype.cc = function (a, b, c, d, e, f) {
        if (b <= e.bottom && b >= e.top) {
            if (f.a) {
                b = this.ad.d1(b, e.top, e.bottom, f);
            }
            var g = new LineGeometry();
            g.d = { $type: Point_$type, x: c, y: b };
            g.c = { $type: Point_$type, x: d, y: b };
            a.add(g);
        }
    };
    AxisLabelPanelBase.prototype.cm = function (a, b) {
        var c = this.bl();
        this.af.aj(a, c);
    };
    AxisLabelPanelBase.prototype.get_au = function () {
        return false;
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "au", {
        get: function () {
            return this.get_au();
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.ac = function (a, b) {
        var c = a.height;
        var d = a.width;
        var e = 0 + a.left;
        var f = (c / 2) + a.top;
        var g = new TransformGroup();
        var h = AngleSimplifier.a(b);
        var i = ((function () {
            var $ret = new RotateTransform();
            $ret.j = h;
            $ret.k = e;
            $ret.l = f;
            return $ret;
        })());
        var j = 0;
        var k = 0;
        if (h != 0 && h != 360) {
            if (h > 0 && h < 180) {
                j = -Math.sin(MathUtil.o(h)) * (c / 2);
            }
            else {
                i.k = d;
                k = -d;
                j = -Math.sin(MathUtil.o(h - 180)) * (c / 2);
            }
        }
        var l = ((function () {
            var $ret = new TranslateTransform();
            $ret.k = j;
            $ret.j = k;
            return $ret;
        })());
        g.j.add(i);
        g.j.add(l);
        var m = TransformMatrixHelpler.f(g);
        var n = RectUtil.n(a);
        var o = RectUtil.o(a);
        var p = RectUtil.k(a);
        var q = RectUtil.j(a);
        var r = TransformMatrixHelpler.i(m, n);
        var s = TransformMatrixHelpler.i(m, o);
        var t = TransformMatrixHelpler.i(m, p);
        var u = TransformMatrixHelpler.i(m, q);
        var v = new Array(4);
        v[0] = r;
        v[1] = s;
        v[2] = t;
        v[3] = u;
        return v;
    };
    AxisLabelPanelBase.prototype.cz = function (a, b) {
        var c = this.ac(a, b);
        var d = 1.7976931348623157E+308;
        var e = 1.7976931348623157E+308;
        var f = -1.7976931348623157E+308;
        var g = -1.7976931348623157E+308;
        for (var h = 0; h < c.length; h++) {
            d = c[h].x < d ? c[h].x : d;
            e = c[h].y < e ? c[h].y : e;
            f = c[h].x > f ? c[h].x : f;
            g = c[h].y > g ? c[h].y : g;
        }
        return new Rect(0, d, e, Math.max(f - d, 0), Math.max(g - e, 0));
    };
    AxisLabelPanelBase.prototype.cn = function (a) {
        var b = this.bq();
        this.cb(a, b);
    };
    AxisLabelPanelBase.prototype.cb = function (a, b) {
        var c = typeCast(FrameworkElement.$, a);
        var d = this.br();
        var e = this.bt();
        var f = 0.5 * e;
        var g = 0.5 * d;
        var h = ((function () {
            var $ret = new RotateTransform();
            $ret.j = b;
            $ret.k = f;
            $ret.l = g;
            return $ret;
        })());
        var i = new TransformGroup();
        i.j.add(h);
        c.j = i;
    };
    AxisLabelPanelBase.prototype.c8 = function (a) {
        var e_38, _a;
        if ((this.ab.contains(this.ad.iv) == false) && this.ad.iv != null) {
            this.ab.add(this.ad.iv);
            AxisLabelManager.m(this.ad.iv, this.ad.bf);
        }
        try {
            for (var _b = __values(fromEnum(this.ab)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                if (b != this.ad.iv && b != this.af.aw) {
                    this.af.ah(b);
                }
            }
        }
        catch (e_38_1) {
            e_38 = { error: e_38_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_38)
                    throw e_38.error;
            }
        }
        var c = (this.ad == null || this.bd <= 0 || isNaN_(this.bd)) ? 50 : this.bd;
        if (this.ad != null && (this.ad.df == null || this.ad.df.count == 0)) {
            if (this.ad.b8()) {
                c = this.ad.er();
            }
        }
        var d = this.aq();
        c = Math.min(c, d ? a.height : a.width);
        c = isInfinity(c) ? 50 : c;
        return d ? new Size(1, 50, c) : new Size(1, c, 50);
    };
    Object.defineProperty(AxisLabelPanelBase.prototype, "bh", {
        get: function () {
            return this.c(AxisLabelPanelBase.cu);
        },
        set: function (a) {
            this.h(AxisLabelPanelBase.cu, a);
        },
        enumerable: false,
        configurable: true
    });
    AxisLabelPanelBase.prototype.aj = function (a) {
        if (a == null) {
            return this.ad.bi.ap(this.ad);
        }
        if (a.position == 0) {
            if (this.ad != null && this.ad.bi != null) {
                return this.ad.bi.ap(this.ad);
            }
            return 4;
        }
        return a.position;
    };
    AxisLabelPanelBase.prototype.ai = function () {
        return 1;
    };
    AxisLabelPanelBase.prototype.ay = function (a) {
        return true;
    };
    AxisLabelPanelBase.prototype._a0 = function () {
        var _a, _b, a, e_39_1;
        var e_39, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    _d.trys.push([0, 5, 6, 7]);
                    _a = __values(fromEnum(this.ab)), _b = _a.next();
                    _d.label = 1;
                case 1:
                    if (!!_b.done)
                        return [3 /*break*/, 4];
                    a = _b.value;
                    if (!(a != this.ad.iv && a != this.af.aw))
                        return [3 /*break*/, 3];
                    return [4 /*yield*/, a];
                case 2:
                    _d.sent();
                    _d.label = 3;
                case 3:
                    _b = _a.next();
                    return [3 /*break*/, 1];
                case 4: return [3 /*break*/, 7];
                case 5:
                    e_39_1 = _d.sent();
                    e_39 = { error: e_39_1 };
                    return [3 /*break*/, 7];
                case 6:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_39)
                            throw e_39.error;
                    }
                    return [7 /*endfinally*/];
                case 7: return [2 /*return*/];
            }
        });
    };
    AxisLabelPanelBase.prototype.a0 = function () {
        var _this = this;
        return toEnum(function () { return _this._a0(); });
    };
    AxisLabelPanelBase.prototype.b1 = function (a, b, c, d, e) {
        var f = this.af.x(b, c, d, e);
        return f;
    };
    AxisLabelPanelBase.prototype.b7 = function (a) {
        if (this.bz == null || this.bk(this.bz) < this.bk(a)) {
            this.bz = a;
        }
    };
    AxisLabelPanelBase.prototype.cg = function (a) {
        this.bb.add(a);
    };
    AxisLabelPanelBase.prototype._a1 = function () {
        var a, b;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    a = 0;
                    _a.label = 1;
                case 1:
                    if (!(a < this.ad.br.count))
                        return [3 /*break*/, 4];
                    return [4 /*yield*/, this.ad.br.item(a)];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    a++;
                    return [3 /*break*/, 1];
                case 4:
                    b = 0;
                    _a.label = 5;
                case 5:
                    if (!(b < this.ad.bq.count))
                        return [3 /*break*/, 8];
                    return [4 /*yield*/, this.ad.bq.item(b)];
                case 6:
                    _a.sent();
                    _a.label = 7;
                case 7:
                    b++;
                    return [3 /*break*/, 5];
                case 8: return [2 /*return*/];
            }
        });
    };
    AxisLabelPanelBase.prototype.a1 = function () {
        var _this = this;
        return toEnum(function () { return _this._a1(); });
    };
    AxisLabelPanelBase.prototype.ca = function () {
        this.af.ag();
        this.cr();
    };
    AxisLabelPanelBase.prototype.cr = function () {
        this.a8 = this.a7();
    };
    AxisLabelPanelBase.prototype.ce = function () {
    };
    AxisLabelPanelBase.prototype.bi = function (a) {
        return this.bd;
    };
    AxisLabelPanelBase.prototype.ci = function () {
        this.c2 = new Rect(0, 0, 0, this.c7.width, this.c7.height);
    };
    AxisLabelPanelBase.prototype.cq = function () {
        this.c2 = Rect.empty;
    };
    AxisLabelPanelBase.prototype.cf = function () {
        this.af.ak();
    };
    AxisLabelPanelBase.prototype.cj = function (a) {
        this.af.al(a);
    };
    AxisLabelPanelBase.prototype.b3 = function () {
        this.af.y();
    };
    AxisLabelPanelBase.prototype.ck = function () {
        this.af.ao();
    };
    AxisLabelPanelBase.$t = markType(AxisLabelPanelBase, 'AxisLabelPanelBase', Panel.$);
    AxisLabelPanelBase.cu = DependencyProperty.i("Extent", Number_$type, AxisLabelPanelBase.$, new PropertyMetadata(2, 50, function (a, b) { return a.bd = b.newValue; }));
    return AxisLabelPanelBase;
}(Panel));
export { AxisLabelPanelBase };
/**
 * @hidden
 */
var CategoryAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAxisBase, _super);
    function CategoryAxisBase() {
        var _this = _super.call(this) || this;
        _this.k2 = null;
        _this.ku = null;
        _this.lh = 0;
        _this.lj = 0;
        _this.ks = 0;
        _this.k4 = 1;
        _this.li = 0;
        _this.kw = false;
        _this.k2 = new List$1(Number_$type, 0);
        return _this;
    }
    CategoryAxisBase.prototype.a4 = function () {
        return new CategoryAxisBaseView(this);
    };
    CategoryAxisBase.prototype.ag = function () {
        return [0, this.lk - 1];
    };
    CategoryAxisBase.prototype.get_cd = function () {
        return false;
    };
    CategoryAxisBase.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.kr = a;
    };
    CategoryAxisBase.prototype.ei = function (a, b, c, d) {
        var e = this.getCategorySize(b, c, d);
        var f = e * a;
        return f;
    };
    CategoryAxisBase.prototype.c8 = function (a, b, c) {
        var d = _super.prototype.c8.call(this, a, b, c);
        if (!d) {
            return false;
        }
        return this.itemsSource != null && this.lj > 0;
    };
    CategoryAxisBase.prototype.l6 = function () {
        if (this.kv != null && this.bo != null && this.itemsSource != null) {
            this.kv = this.bo.releaseFastItemsSource(this.itemsSource);
        }
    };
    CategoryAxisBase.prototype.l5 = function () {
        if (this.kv == null && this.bo != null && this.itemsSource != null) {
            this.kv = this.bo.getFastItemsSource(this.itemsSource);
        }
    };
    CategoryAxisBase.prototype.get_cb = function () {
        return true;
    };
    CategoryAxisBase.prototype.mj = function (a, b, c) {
        if (this.b9) {
            return Rect.empty;
        }
        return this.mk(a, b, c, this.cp);
    };
    CategoryAxisBase.prototype.mk = function (a, b, c, d) {
        var e = 0;
        var f = a.x;
        var g = this.kh.left;
        var h = this.kh.right;
        if (d) {
            f = a.y;
            g = this.kh.top;
            h = this.kh.bottom;
        }
        var i = this.k2;
        if ((d && !this.ch) || (!d && this.ch)) {
            i = new List$1(Number_$type, 0);
            for (var j = this.k2.count - 1; j >= 0; j--) {
                i.add(this.k2._inner[j]);
            }
        }
        if (this.categoryMode == 0) {
            if (b) {
                var k = void 0;
                if (d) {
                    k = new Rect(0, this.kh.left, a.y - c / 2, this.kh.width, c);
                }
                else {
                    k = new Rect(0, a.x - c / 2, this.kh.top, c, this.kh.height);
                }
                k.intersect(this.kh);
                return k;
            }
            else {
                if (f > h) {
                    return Rect.empty;
                }
                if (f < g) {
                    return Rect.empty;
                }
                var l = 1.7976931348623157E+308;
                var m = -1;
                for (e = 0; e < i.count; e++) {
                    var n = Math.abs(i._inner[e] - f);
                    if (n < l) {
                        l = n;
                        m = e;
                    }
                }
                if (m == -1) {
                    return Rect.empty;
                }
                var o = i._inner[m];
                var p = void 0;
                if (d) {
                    p = new Rect(0, this.kh.left, o - c / 2, this.kh.width, c);
                }
                else {
                    p = new Rect(0, o - c / 2, this.kh.top, c, this.kh.height);
                }
                p.intersect(this.kh);
                return p;
            }
        }
        else {
            for (e = 0; e < i.count; e++) {
                if (i._inner[e] > f) {
                    break;
                }
            }
            if (e == 0) {
                return Rect.empty;
            }
            if (f > h) {
                return Rect.empty;
            }
            if (f < g) {
                return Rect.empty;
            }
            var q = this.kh.right;
            if (d) {
                q = this.kh.bottom;
            }
            if (e < i.count) {
                q = i._inner[e];
            }
            if (d) {
                return new Rect(0, this.kh.left, i._inner[e - 1], this.kh.width, q - i._inner[e - 1]);
            }
            else {
                return new Rect(0, i._inner[e - 1], this.kh.top, q - i._inner[e - 1], this.kh.height);
            }
        }
    };
    Object.defineProperty(CategoryAxisBase.prototype, "itemsSource", {
        get: function () {
            return this.c(CategoryAxisBase.me);
        },
        set: function (a) {
            this.h(CategoryAxisBase.me, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAxisBase.prototype, "lk", {
        get: function () {
            return this.lh;
        },
        set: function (a) {
            this.lh = a;
            this.lj = this.lh;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(CategoryAxisBase.prototype, "categoryMode", {
        get: function () {
            return this.ks;
        },
        set: function (a) {
            if (this.ks != a) {
                var b = this.ks;
                this.ks = a;
                this.h5("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, a));
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.lf = function (a, b, c) {
        var d = !isNaN_(this.k5) ? MathUtil.d(this.k5, 0, this.k4) : 0;
        if (!this.b9 && this.ld > 0) {
            var e = this.getCategorySize(a, b, c);
            var f = 0.5 * d;
            var g = e * f;
            if (g < this.ld) {
                g = this.ld;
                f = g / e;
                d = f / 0.5;
                d = MathUtil.d(d, 0, this.k4);
            }
        }
        return d;
    };
    Object.defineProperty(CategoryAxisBase.prototype, "ll", {
        get: function () {
            return this.li;
        },
        set: function (a) {
            if (a != this.li) {
                var b = this.li;
                this.li = a;
                this.h5("GroupCount", b, this.li);
            }
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.eo = function (a, b) {
        return NaN;
    };
    CategoryAxisBase.prototype.getUnscaledValue3 = function (a, b, c, d) {
        return NaN;
    };
    CategoryAxisBase.prototype.getCategorySize = function (a, b, c) {
        return NaN;
    };
    CategoryAxisBase.prototype.k8 = function (a, b, c) {
        return NaN;
    };
    CategoryAxisBase.prototype.getGroupCenter = function (a, b, c, d) {
        return NaN;
    };
    CategoryAxisBase.prototype.lg = function (a) {
        var b = this.bi.wl;
        var c = this.kh;
        var d = this.kc();
        var e = new ScalerParams(0, b, c, this.ch, d);
        return this.eo(a, e);
    };
    CategoryAxisBase.prototype._k1 = function () {
        var _a, _b, a, e_40_1, _c, _d, b, _e, _f, c, e_41_1, e_42_1;
        var e_40, _g, e_42, _h, e_41, _j;
        return __generator(this, function (_k) {
            switch (_k.label) {
                case 0:
                    _k.trys.push([0, 5, 6, 7]);
                    _a = __values(fromEnum(this.df)), _b = _a.next();
                    _k.label = 1;
                case 1:
                    if (!!_b.done)
                        return [3 /*break*/, 4];
                    a = _b.value;
                    return [4 /*yield*/, a];
                case 2:
                    _k.sent();
                    _k.label = 3;
                case 3:
                    _b = _a.next();
                    return [3 /*break*/, 1];
                case 4: return [3 /*break*/, 7];
                case 5:
                    e_40_1 = _k.sent();
                    e_40 = { error: e_40_1 };
                    return [3 /*break*/, 7];
                case 6:
                    try {
                        if (_b && !_b.done && (_g = _a.return))
                            _g.call(_a);
                    }
                    finally {
                        if (e_40)
                            throw e_40.error;
                    }
                    return [7 /*endfinally*/];
                case 7:
                    if (!(this.bi != null && this.bi.fg && this.ky(this.bi)))
                        return [3 /*break*/, 21];
                    _k.label = 8;
                case 8:
                    _k.trys.push([8, 19, 20, 21]);
                    _c = __values(fromEnum(this.bi.gm())), _d = _c.next();
                    _k.label = 9;
                case 9:
                    if (!!_d.done)
                        return [3 /*break*/, 18];
                    b = _d.value;
                    if (!(b != this.bi))
                        return [3 /*break*/, 17];
                    _k.label = 10;
                case 10:
                    _k.trys.push([10, 15, 16, 17]);
                    _e = (e_41 = void 0, __values(fromEnum(b.series))), _f = _e.next();
                    _k.label = 11;
                case 11:
                    if (!!_f.done)
                        return [3 /*break*/, 14];
                    c = _f.value;
                    return [4 /*yield*/, c];
                case 12:
                    _k.sent();
                    _k.label = 13;
                case 13:
                    _f = _e.next();
                    return [3 /*break*/, 11];
                case 14: return [3 /*break*/, 17];
                case 15:
                    e_41_1 = _k.sent();
                    e_41 = { error: e_41_1 };
                    return [3 /*break*/, 17];
                case 16:
                    try {
                        if (_f && !_f.done && (_j = _e.return))
                            _j.call(_e);
                    }
                    finally {
                        if (e_41)
                            throw e_41.error;
                    }
                    return [7 /*endfinally*/];
                case 17:
                    _d = _c.next();
                    return [3 /*break*/, 9];
                case 18: return [3 /*break*/, 21];
                case 19:
                    e_42_1 = _k.sent();
                    e_42 = { error: e_42_1 };
                    return [3 /*break*/, 21];
                case 20:
                    try {
                        if (_d && !_d.done && (_h = _c.return))
                            _h.call(_c);
                    }
                    finally {
                        if (e_42)
                            throw e_42.error;
                    }
                    return [7 /*endfinally*/];
                case 21: return [2 /*return*/];
            }
        });
    };
    CategoryAxisBase.prototype.k1 = function () {
        var _this = this;
        return toEnum(function () { return _this._k1(); });
    };
    CategoryAxisBase.prototype.kx = function (a) {
        return this.df.contains(a);
    };
    CategoryAxisBase.prototype.ky = function (a) {
        return false;
    };
    CategoryAxisBase.prototype._k0 = function () {
        var a, _a, _b, b, c, _c, _d, d, e_43_1, e_44_1;
        var e_44, _e, e_43, _f;
        return __generator(this, function (_g) {
            switch (_g.label) {
                case 0:
                    a = typeCast(XamDataChart.$, this.bi);
                    if (!(a != null && a.fg && this.ky(a)))
                        return [3 /*break*/, 14];
                    _g.label = 1;
                case 1:
                    _g.trys.push([1, 12, 13, 14]);
                    _a = __values(fromEnum(a.gm())), _b = _a.next();
                    _g.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 11];
                    b = _b.value;
                    if (!(b != this.bi))
                        return [3 /*break*/, 10];
                    c = typeCast(XamDataChart.$, b);
                    if (!(c != null))
                        return [3 /*break*/, 10];
                    _g.label = 3;
                case 3:
                    _g.trys.push([3, 8, 9, 10]);
                    _c = (e_43 = void 0, __values(fromEnum(c.axes))), _d = _c.next();
                    _g.label = 4;
                case 4:
                    if (!!_d.done)
                        return [3 /*break*/, 7];
                    d = _d.value;
                    if (!(typeCast(CategoryAxisBase.$, d) !== null))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, typeCast(CategoryAxisBase.$, d)];
                case 5:
                    _g.sent();
                    _g.label = 6;
                case 6:
                    _d = _c.next();
                    return [3 /*break*/, 4];
                case 7: return [3 /*break*/, 10];
                case 8:
                    e_43_1 = _g.sent();
                    e_43 = { error: e_43_1 };
                    return [3 /*break*/, 10];
                case 9:
                    try {
                        if (_d && !_d.done && (_f = _c.return))
                            _f.call(_c);
                    }
                    finally {
                        if (e_43)
                            throw e_43.error;
                    }
                    return [7 /*endfinally*/];
                case 10:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 11: return [3 /*break*/, 14];
                case 12:
                    e_44_1 = _g.sent();
                    e_44 = { error: e_44_1 };
                    return [3 /*break*/, 14];
                case 13:
                    try {
                        if (_b && !_b.done && (_e = _a.return))
                            _e.call(_a);
                    }
                    finally {
                        if (e_44)
                            throw e_44.error;
                    }
                    return [7 /*endfinally*/];
                case 14: return [2 /*return*/];
            }
        });
    };
    CategoryAxisBase.prototype.k0 = function () {
        var _this = this;
        return toEnum(function () { return _this._k0(); });
    };
    CategoryAxisBase.prototype.ma = function (a) {
        var e_45, _a, e_46, _b;
        if (this.kw) {
            return;
        }
        try {
            this.kw = true;
            var b = 0;
            var c = 0;
            var d = false;
            try {
                for (var _c = __values(fromEnum(this.k1())), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var e = _d.value;
                    if (!e.ey && !e.fs && !e.e6) {
                        continue;
                    }
                    if (e.bn != null) {
                        continue;
                    }
                    var f = e;
                    var g = f.preferredCategoryMode(this);
                    if (g == 2) {
                        b = 2;
                        d = true;
                        if (this.kx(e)) {
                            c++;
                        }
                    }
                    if (g == 1 && !d) {
                        b = 1;
                    }
                }
            }
            catch (e_45_1) {
                e_45 = { error: e_45_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_45)
                        throw e_45.error;
                }
            }
            var h = this.kz;
            try {
                for (var _e = __values(fromEnum(this.k0())), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var i = _f.value;
                    if (i.kz) {
                        h = true;
                    }
                    if (a) {
                        i.ma(false);
                    }
                }
            }
            catch (e_46_1) {
                e_46 = { error: e_46_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_46)
                        throw e_46.error;
                }
            }
            if (b == 0 && h) {
                b = 2;
                if (c == 0) {
                    c = 1;
                }
            }
            this.categoryMode = b;
            this.ll = c;
        }
        finally {
            this.kw = false;
        }
    };
    CategoryAxisBase.prototype.lm = function () {
        if (this.kv == null) {
            return 0;
        }
        return this.kv.count;
    };
    CategoryAxisBase.prototype.hz = function (a, b, c, d) {
        var e_47, _a, e_48, _b, e_49, _c;
        _super.prototype.hz.call(this, a, b, c, d);
        switch (b) {
            case "FastItemsSourceProvider":
                if ((typeCast(IFastItemsSourceProvider_$type, c)) != null) {
                    this.kv = c.releaseFastItemsSource(this.itemsSource);
                }
                if ((typeCast(IFastItemsSourceProvider_$type, d)) != null) {
                    this.kv = d.getFastItemsSource(this.itemsSource);
                }
                this.lk = 0;
                if (this.kv != null) {
                    this.lk = this.lm();
                }
                this.ma(true);
                break;
            case "ItemsSource":
                if (this.bo != null) {
                    this.kv = this.bo.getFastItemsSource(this.itemsSource);
                }
                break;
            case CategoryAxisBase.$$p[0]:
                var e = typeCast(IFastItemsSource_$type, c);
                this.lx();
                this.cq = true;
                if (e != null) {
                    e.event = delegateRemove(e.event, runOn(this, this.l0));
                }
                this.lk = 0;
                if (this.kv != null) {
                    this.lk = this.lm();
                }
                if (this.kv != null) {
                    var f = this.kv;
                    f.event = delegateCombine(f.event, runOn(this, this.l0));
                    this.ib(false);
                    try {
                        for (var _d = __values(fromEnum(this.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                            var g = _e.value;
                            g.rq(false);
                            if (g.db != null) {
                                g.qk();
                            }
                        }
                    }
                    catch (e_47_1) {
                        e_47 = { error: e_47_1 };
                    }
                    finally {
                        try {
                            if (_e && !_e.done && (_a = _d.return))
                                _a.call(_d);
                        }
                        finally {
                            if (e_47)
                                throw e_47.error;
                        }
                    }
                    if (this.bi != null && this.bi.fu) {
                        this.bi.qz();
                    }
                }
                else {
                    this.hj();
                    try {
                        for (var _f = __values(fromEnum(this.db())), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var h = _g.value;
                            h.o4(true, h.cv);
                            if (h.db != null) {
                                h.qk();
                            }
                        }
                    }
                    catch (e_48_1) {
                        e_48 = { error: e_48_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_48)
                                throw e_48.error;
                        }
                    }
                }
                break;
            case "ItemsCount":
                this.h6(new AxisRangeChangedEventArgs(0, 0, 0, typeGetValue((c)) - 1, typeGetValue((d)) - 1));
                this.ib(false);
                break;
            case CategoryAxisBase.$$p[5]:
                this.cq = true;
                this.mb();
                this.ib(false);
                this.ly();
                break;
            case "CategoryMode":
                this.cq = true;
                this.ib(false);
                this.l8();
                this.ly();
                break;
            case CategoryAxisBase.$$p[4]:
            case CategoryAxisBase.$$p[3]:
            case CategoryAxisBase.$$p[2]:
            case CategoryAxisBase.$$p[1]:
                this.k4 = this.lc;
                this.cq = true;
                try {
                    for (var _h = __values(fromEnum(this.db())), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var i = _j.value;
                        i.gz = true;
                        var j = typeCast(IHasCategoryModePreference_$type, i);
                        if (j != null && j.preferredCategoryMode(this) == 2) {
                            i.rq(false);
                        }
                    }
                }
                catch (e_49_1) {
                    e_49 = { error: e_49_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_c = _h.return))
                            _c.call(_h);
                    }
                    finally {
                        if (e_49)
                            throw e_49.error;
                    }
                }
                this.ib(false);
                if (this.bi != null) {
                    this.bi.oh();
                }
                break;
            case Axis.$$p[4]:
            case Axis.$$p[3]:
                this.cq = true;
                this.ib(true);
                break;
        }
    };
    CategoryAxisBase.prototype.ly = function () {
        var e_50, _a;
        try {
            for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.rq(false);
            }
        }
        catch (e_50_1) {
            e_50 = { error: e_50_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_50)
                    throw e_50.error;
            }
        }
    };
    CategoryAxisBase.prototype.l0 = function (a, b) {
        this.l7(b);
    };
    CategoryAxisBase.prototype.l7 = function (a) {
        switch (a.action) {
            case 3:
            case 0:
            case 1:
            case 2:
            case 4:
                if (this.kv != null) {
                    this.lk = this.lm();
                }
                this.ib(false);
                break;
        }
        if (this.kv != null) {
            this.lk = this.lm();
        }
    };
    CategoryAxisBase.prototype.mb = function () {
        var e_51, _a;
        var a = false, b = false;
        try {
            for (var _b = __values(fromEnum(this.df)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = typeCast(IHasCategoryModePreference_$type, c);
                if (d == null) {
                    continue;
                }
                var e = d.preferredCategoryMode(this);
                a = a || e == 1;
                b = b || e == 2;
            }
        }
        catch (e_51_1) {
            e_51 = { error: e_51_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_51)
                    throw e_51.error;
            }
        }
        var f = b ? 2 : a ? 1 : 0;
        if (f == 0 && this.kz) {
            f = 1;
            if (this.ll == 0) {
                this.ll = 1;
            }
        }
        this.categoryMode = f;
    };
    CategoryAxisBase.prototype.ct = function (a) {
        var e_52, _a;
        var b = _super.prototype.ct.call(this, a);
        if (b) {
            this.ma(true);
            var c = typeCast(IHasCategoryModePreference_$type, a);
            if (c != null && c.preferredCategoryMode(this) == 2) {
                try {
                    for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        var e = typeCast(IHasCategoryModePreference_$type, d);
                        if (e != null && e != c && e.preferredCategoryMode(this) == 2) {
                            d.rq(false);
                        }
                    }
                }
                catch (e_52_1) {
                    e_52 = { error: e_52_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_52)
                            throw e_52.error;
                    }
                }
            }
            this.ib(false);
            this.c1();
        }
        return b;
    };
    CategoryAxisBase.prototype.b0 = function (a) {
        var e_53, _a;
        var b = _super.prototype.b0.call(this, a);
        if (b) {
            this.ma(true);
            var c = typeCast(IHasCategoryModePreference_$type, a);
            if (c != null && c.preferredCategoryMode(this) != 0) {
                try {
                    for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var d = _c.value;
                        var e = typeCast(IHasCategoryModePreference_$type, d);
                        if (e != null) {
                            d.rq(false);
                        }
                    }
                }
                catch (e_53_1) {
                    e_53 = { error: e_53_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_53)
                            throw e_53.error;
                    }
                }
            }
            this.ib(false);
        }
        return b;
    };
    CategoryAxisBase.prototype.l8 = function () {
        var e_54, _a;
        var a = null;
        try {
            for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                if (b.ey) {
                    var c = b.aw(this);
                    if (c != null && c.aj == this) {
                        a = c;
                    }
                }
            }
        }
        catch (e_54_1) {
            e_54 = { error: e_54_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_54)
                    throw e_54.error;
            }
        }
        if (a != null) {
            a.ia();
        }
    };
    CategoryAxisBase.prototype.lx = function () {
        this.ku = this.kv;
    };
    CategoryAxisBase.prototype.l9 = function () {
        var a = this.az;
        if (a == null) {
            a = new AxisLabelSettings();
        }
        if (a.visibility == 1) {
            this.br.count = 0;
            this.bq.count = 0;
            this.bp.count = 0;
        }
        else {
            var b = 0;
            b = this.kr.bl(this.dd);
            this.br.count = b;
        }
    };
    CategoryAxisBase.prototype.lz = function (a) {
        if (this.kv != null) {
            this.kv.handleCollectionChanged(a);
        }
    };
    CategoryAxisBase.prototype.l4 = function (a, b, c) {
        this.lz(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
    };
    CategoryAxisBase.prototype.l1 = function () {
        this.lz(new NotifyCollectionChangedEventArgs(0, 4));
    };
    CategoryAxisBase.prototype.l2 = function (a, b) {
        this.lz(new NotifyCollectionChangedEventArgs(1, 0, b, a));
    };
    CategoryAxisBase.prototype.l3 = function (a, b) {
        this.lz(new NotifyCollectionChangedEventArgs(1, 1, b, a));
    };
    CategoryAxisBase.prototype.k9 = function (a, b, c, d) {
        return this.la(a, b, c, d, this.categoryMode);
    };
    CategoryAxisBase.prototype.la = function (a, b, c, d, e) {
        var f = 0;
        var g = e;
        if (g == 0 && this.categoryMode != 0) {
            g = 1;
        }
        switch (g) {
            case 0:
                f = 0;
                break;
            case 1:
                f = 0.5 * this.getCategorySize(a, b, c);
                break;
            case 2:
                f = this.getGroupCenter(d, a, b, c);
                break;
        }
        if (this.cp != this.ch) {
            f *= -1;
        }
        return f;
    };
    CategoryAxisBase.prototype.getSeriesOffset = function (a, b, c, d, e) {
        return this.la(a, b, c, d, e);
    };
    Object.defineProperty(CategoryAxisBase.prototype, "isVertical", {
        get: function () {
            return this.cp;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.j$d = function (a, b) {
        return this.eo.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$c = function (a, b) {
        return this.el.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$e = function (a, b, c, d, e) {
        this.hp.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$f = function (a, b, c, d) {
        this.hq.apply(this, arguments);
    };
    CategoryAxisBase.prototype.j$g = function (a, b, c, d) {
        this.hr.apply(this, arguments);
    };
    Object.defineProperty(CategoryAxisBase.prototype, "j$b", {
        get: function () {
            return this.ch;
        },
        enumerable: false,
        configurable: true
    });
    CategoryAxisBase.prototype.j$a = function () {
        return this.ag.apply(this, arguments);
    };
    CategoryAxisBase.$t = markType(CategoryAxisBase, 'CategoryAxisBase', Axis.$, [ICategoryScaler_$type]);
    CategoryAxisBase.me = DependencyProperty.i("ItemsSource", IEnumerable_$type, CategoryAxisBase.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(CategoryAxisBase.$, a);
        if (c.bo != null) {
            c.bo.releaseFastItemsSource(b.oldValue);
        }
        a.h5("ItemsSource", b.oldValue, b.newValue);
    }));
    CategoryAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAxisBase, 'h5', ['FastItemsSource:kv:mc', [IFastItemsSource_$type], 'Gap:k5:md', [1, 0.2], 'MaximumGap:lc:mf', [1, 1], 'MinimumGapSize:ld:mg', [1, 0], 'Overlap:le:mh', [1, 0], 'UseClusteringMode:kz:mi', [0, false]]);
    return CategoryAxisBase;
}(Axis));
export { CategoryAxisBase };
/**
 * @hidden
 */
var HorizontalAxisLabelPanelBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAxisLabelPanelBase, _super);
    function HorizontalAxisLabelPanelBase() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.dl = 0;
        _this.di = 0;
        _this.dk = 0;
        _this.dj = 0;
        return _this;
    }
    HorizontalAxisLabelPanelBase.prototype.ae = function () {
        return new HorizontalAxisLabelPanelBaseView(this);
    };
    HorizontalAxisLabelPanelBase.prototype.ch = function (a) {
        _super.prototype.ch.call(this, a);
        this.c9 = a;
    };
    HorizontalAxisLabelPanelBase.prototype.b6 = function () {
        this.c9.a1();
    };
    HorizontalAxisLabelPanelBase.prototype.db = function () {
        return ((this.ag != null && this.ag.k()) || this.ad.b4) && this.bl() % 360 != 0;
    };
    HorizontalAxisLabelPanelBase.prototype.dc = function () {
        return this.ao && !this.av;
    };
    HorizontalAxisLabelPanelBase.prototype.aq = function () {
        return true;
    };
    HorizontalAxisLabelPanelBase.prototype.a5 = function () {
        var _this = this;
        var a = new List$1(Rect.$, 0);
        var b = new List$1(Boolean_$type, 0);
        this.aw = false;
        this.av = false;
        this.ax = false;
        var c = this.bl();
        var d = c * Math.PI / 180;
        if (this.db()) {
            this.av = true;
        }
        this.ao = false;
        this.dn(a, b, d);
        if (this.ad != null && this.ad.bi != null && (this.ad.bi.ft || this.ad.bi.fs) && a != null) {
            for (var e = 0; e < a.count; e++) {
                var f = a._inner[e];
                if (this.c3.isEmpty) {
                    this.c3 = f;
                }
                else {
                    if (this.c3.width < f.width) {
                        this.c3 = f;
                    }
                }
            }
        }
        this.ao = this.ao || this.an(a, b);
        if (this.ao) {
            this.dq(a, b);
        }
        else {
            this.dr();
        }
        var g = this.ad.b8();
        if (!g) {
            this.dm(c);
        }
        else {
            this.af.ac();
        }
        if (this.av) {
            for (var h = 0; h < a.count; h++) {
                var i = a._inner[h];
                i.x = this.ba._inner[h].c;
                a._inner[h] = i;
            }
        }
        var j = 0;
        if (this.dc()) {
            j = ((function () { var k = _this.by(_this.di, a, b); a = k.p1; return k.ret; })());
        }
        if (this.ao && !this.aw) {
            if (j > 0) {
                if (this.c9.a0()) {
                    this.ax = true;
                }
            }
        }
        if (this.ao && this.da()) {
            this.ar = true;
            var k = this.c1.width;
            var l = this.dg();
            var m = this.df();
            var n = this.ba.count > 1 ? this.ba._inner[1].c - this.ba._inner[0].c : k;
            var o = Math.abs(n * 0.8);
            var p = 0;
            var q = Math.abs(Math.atan(this.di / n) * 180 / Math.PI);
            var r = this.af.p();
            var s = this.af.q();
            for (var t = 0; t < a.count; t++) {
                if (this.al) {
                    if (t > 0 && t < a.count - 1) {
                        var u = this.ba.count > 1 ? this.ba._inner[t].c - (a._inner[t - 1].x + a._inner[t - 1].width) : k;
                        var v = this.ba.count > 1 ? a._inner[t + 1].x - this.ba._inner[t].c : k;
                        o = Math.abs(Math.min(Math.abs(u * 2), Math.abs(v * 2)) * 0.8);
                    }
                    else {
                        if (t == 0) {
                            var w = this.ba.count > 1 ? a._inner[t + 1].x - this.ba._inner[t].c : k;
                            o = Math.abs((n * 2) * 0.8);
                        }
                        if (t == a.count - 1) {
                            var x = this.ba.count > 1 ? this.ba._inner[t].c - (a._inner[t - 1].x + a._inner[t - 1].width) : k;
                            o = Math.abs((x * 2) * 0.8);
                        }
                    }
                }
                var y = Math.min(a._inner[t].width, o);
                p = this.av ? this.ba._inner[t].c : this.ba._inner[t].c - y / 2;
                var z = AngleSimplifier.a(c);
                var aa = (z >= q && z <= 180 - q) || (z >= 180 + q && z <= 360 - q);
                var ab = a._inner[t];
                if (this.av && aa) {
                    var ac = this.bv(this.bb._inner[t]);
                    o = Math.min(l / Math.abs(Math.sin(d)), ac);
                }
                ab.x = p;
                ab.width = Math.min(o, ab.width);
                a._inner[t] = ab;
                if (!(typeCast(TextBlock.$, this.bb._inner[t]) !== null)) {
                    this.bb._inner[t].width = Math.min(o, ab.width);
                }
                var ad = typeCast(TextBlock.$, this.bb._inner[t]);
                if (ad != null) {
                    var ae = this.b1(t, ad, o, r, s);
                    if (this.ax) {
                        ad.height = m;
                    }
                    else if (!Base.equalsStatic(ad.al, ae)) {
                        ad.al = ae;
                        this.bb._inner[t].width = Math.min(o, this.bk(this.bb._inner[t]));
                        this.dk = Math.min(this.dk, this.bb._inner[t].width);
                    }
                }
            }
            if (!g) {
                this.dm(c);
            }
        }
        if (this.dd()) {
            this.dp(a);
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.dn = function (a, b, c) {
        var d = this.bs();
        var e = this.dh();
        this.di = -1.7976931348623157E+308;
        this.dl = -1.7976931348623157E+308;
        this.dj = -1.7976931348623157E+308;
        this.dk = -1.7976931348623157E+308;
        var f = this.af.p();
        var g = this.af.q();
        var h = this.af.r();
        var i = this.af.o();
        var j = this.c1.top;
        var k = (this.c1.height - d);
        var l = false;
        for (var m = 0; m < this.bb.count; m++) {
            if (!this.ba._inner[m].a) {
                l = true;
            }
        }
        for (var n = 0; n < this.bb.count; n++) {
            if (this.ba == null || n >= this.ba.count) {
                break;
            }
            var o = void 0, p = void 0, q = void 0, r = void 0, s = void 0, t = void 0;
            var u = this.bb._inner[n];
            s = this.bk(u);
            t = this.bj(u);
            r = s + this.af.p() + this.af.q();
            q = t + h + i;
            var v = this.ba._inner[n].a;
            if (this.av) {
                o = this.ba._inner[n].c;
            }
            else {
                o = this.ba._inner[n].c - r / 2;
            }
            p = j + e;
            if (!v || !l) {
                this.di = Math.max(q, this.di);
                this.dl = Math.max(r, this.dl);
                this.dj = Math.max(t, this.dj);
                this.dk = Math.max(s, this.dk);
            }
            var w = new Rect(0, o, p, r, q);
            a.add(w);
            b.add(v);
            var x = r * Math.abs(Math.sin(c));
            this.ao = this.ao || x > k;
        }
        if (this.ad != null && this.ad.bz) {
            var y = -1;
            for (var z = 0; z < this.bb.count; z++) {
                var aa = this.bb._inner[z];
                y = Math.max(aa.ah, y);
            }
            if (y >= 0 && !isNaN_(y)) {
                for (var ab = 0; ab < this.bb.count; ab++) {
                    var ac = this.bb._inner[ab];
                    ac.ah = y;
                }
            }
        }
    };
    HorizontalAxisLabelPanelBase.prototype.dm = function (a) {
        var b = a * (Math.PI / 180);
        var c = Math.abs(this.dk * Math.sin(b)) + Math.abs(this.dj * Math.cos(b));
        c += this.af.r() + this.af.o();
        var d = this.bs();
        this.bh = (c) + (d) + this.ad.d0;
    };
    HorizontalAxisLabelPanelBase.prototype.dp = function (a) {
        this.c9.a2(a);
    };
    HorizontalAxisLabelPanelBase.prototype.dq = function (a, b) {
    };
    HorizontalAxisLabelPanelBase.prototype.dr = function () {
    };
    HorizontalAxisLabelPanelBase.prototype.get_au = function () {
        return true;
    };
    HorizontalAxisLabelPanelBase.prototype.cm = function (a, b) {
        var c = a.l;
        var d = a.m;
        var e = 0;
        var f = c / 2;
        var g = new TransformGroup();
        var h = AngleSimplifier.a(this.bl());
        var i = ((function () {
            var $ret = new RotateTransform();
            $ret.j = h;
            $ret.k = e;
            $ret.l = f;
            return $ret;
        })());
        var j = 0;
        var k = 0;
        if (h != 0 && h != 360) {
            if (h > 0 && h < 180) {
                j = -Math.sin(MathUtil.o(h)) * (c / 2);
            }
            else {
                i.k = d;
                k = -d;
                j = -Math.sin(MathUtil.o(h - 180)) * (c / 2);
            }
        }
        var l = ((function () {
            var $ret = new TranslateTransform();
            $ret.k = j;
            $ret.j = k;
            return $ret;
        })());
        g.j.add(i);
        g.j.add(l);
        a.j = g;
    };
    HorizontalAxisLabelPanelBase.prototype.dd = function () {
        return !this.aw && !this.av;
    };
    HorizontalAxisLabelPanelBase.prototype.da = function () {
        if (this.ad != null && this.ad.bi != null && this.ad.bi.fu) {
            return false;
        }
        return true;
    };
    HorizontalAxisLabelPanelBase.prototype.by = function (a, b, c) {
        var d = 0;
        var e = new List$1(Rect.$, 0);
        var f = this.dh() + this.c1.top;
        var g = this.dg();
        var h = f + g;
        if (a * 3 <= this.bd) {
            d = 3;
        }
        else if (a * 2 <= this.bd) {
            d = 2;
        }
        else {
            return {
                ret: d,
                p1: b
            };
        }
        var i = 0;
        for (var j = 0; j < b.count; j++) {
            var k = RectUtil.p(b._inner[j]);
            if (!c._inner[j]) {
                if (i % d == 0) {
                    k.y = f;
                }
                else if (i % d == d - 1) {
                    k.y = h - k.height;
                }
                else {
                    k.y = (f + (g / 2)) - k.height / 2;
                }
                i++;
            }
            e.add(k);
        }
        this.ao = this.an(e, c);
        if (!this.ao) {
            this.aw = true;
            b = e;
        }
        return {
            ret: d,
            p1: b
        };
    };
    HorizontalAxisLabelPanelBase.prototype.c0 = function () {
        var a = this.aj(this.ad.bf);
        var b = this.bs();
        var c = this.ah;
        var d = 0;
        if (a == 3) {
            d += this.c1.top;
            if (c == 1 || c == 5) {
                d += this.ad.d0;
            }
        }
        else {
            d = this.c1.bottom - b;
            if (c == 4 || c == 0) {
                d -= this.ad.d0;
            }
        }
        var e = this.bu();
        var f = 0;
        var g = this.ad.bf == null ? 1 : this.ad.bf.horizontalAlignment;
        if (g == 0) {
            f = this.c1.left;
        }
        else if (g == 2) {
            f = this.c1.right - e;
        }
        else {
            f = (this.c1.left + (this.c1.width / 2)) - (e / 2);
        }
        return new Rect(0, f, d, e, b);
    };
    HorizontalAxisLabelPanelBase.prototype.dh = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 3) {
            a += this.bs();
        }
        var c = this.ah;
        if (c == 1 || c == 5) {
            a += this.ad.d0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.de = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 4) {
            a += this.bs();
        }
        var c = this.ah;
        if (c == 0 || c == 4) {
            a += this.ad.d0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.dg = function () {
        var a = (this.bd - this.dh()) - this.de();
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.df = function () {
        var a = ((this.dg() - this.af.r()) - this.af.o());
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    HorizontalAxisLabelPanelBase.prototype.b9 = function () {
        var e_55, _a;
        var a = this.af.au();
        this.ad.hk(a);
        if (this.ag != null && this.ag.visibility != 0) {
            return;
        }
        var b = this.ad.d0;
        if (b == 0) {
            return;
        }
        var c = this.a2();
        if (c == null) {
            return;
        }
        var d = this.c1.top;
        var e;
        var f = this.ah;
        if (f == 0 || f == 4) {
            d = this.c1.bottom;
            e = d - this.ad.d0;
        }
        else {
            e = d + this.ad.d0;
        }
        var g = this.af.b();
        try {
            for (var _b = __values(fromEnum(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var h = _c.value;
                this.cs(a, h, d, e, this.c4, g);
            }
        }
        catch (e_55_1) {
            e_55 = { error: e_55_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_55)
                    throw e_55.error;
            }
        }
        if (!this.ab.contains(this.af.aw)) {
            this.ab.add(this.af.aw);
        }
    };
    HorizontalAxisLabelPanelBase.prototype.a6 = function (a) {
        var _this = this;
        if (this.ad.cu || this.ad.cw) {
            var b = this.af.p();
            var c = this.af.r();
            var d = this.af.q();
            var e = this.af.o();
            var f = Math.max(b, Math.max(c, Math.max(d, e)));
            var g_2 = new Thickness(0, f);
            if (this.av) {
                g_2 = new Thickness(0, Math.sqrt((f * f) / 2));
            }
            var h = this.a4(a);
            var i = new List$1(Thickness.$, 0);
            if (h.count < 1) {
                return a;
            }
            h.aa(function (j, k) {
                var l = _this.cy(j, a._inner[j], g_2);
                var m = _this.cy(k, a._inner[k], g_2);
                var n = l.left;
                var o = m.left;
                if (n < o) {
                    return -1;
                }
                if (n > o) {
                    return 1;
                }
                return 0;
            });
            for (var j = 0; j < h.count; j++) {
                var k = h._inner[j];
                var l = a._inner[k];
                var m = this.cy(k, a._inner[k], g_2);
                var n = this.ad.bi.wk.left;
                if (this.ad.cw) {
                    if (l.left < (this.ad.bi.wk.left - n)) {
                        l = new Rect(0, l.left + ((this.ad.bi.wk.left - n) - l.left), l.top, l.width, l.height);
                        a._inner[k] = l;
                    }
                }
            }
            var o = this.as(a, h, g_2);
            if (o && (this.ad.cu)) {
                for (var p = 0; p < h.count - 1; p++) {
                    var q = h._inner[p];
                    var r = h._inner[p + 1];
                    var s = a._inner[q];
                    var t = a._inner[r];
                    var u = this.cy(q, a._inner[q], g_2);
                    var v = this.cy(r, a._inner[r], g_2);
                    if (u.intersectsWith(v) || u.left > v.right) {
                        var w = new Rect(0, u.right + 1 + (t.left - v.left), t.top, t.width, t.height);
                        a._inner[r] = w;
                    }
                }
            }
            for (var x = h.count - 1; x >= 0; x--) {
                var y = h._inner[x];
                var z = a._inner[y];
                var aa = this.cy(y, a._inner[y], g_2);
                var ab = this.ad.bi.c9.a5;
                if (this.ad.cw) {
                    if (aa.right > this.ad.bi.wk.right + ab) {
                        z = new Rect(0, z.left - (aa.right - (this.ad.bi.wk.right + ab)), z.top, z.width, z.height);
                        a._inner[y] = z;
                    }
                }
            }
            if (this.ad.cu) {
                for (var ac = h.count - 1; ac >= 1; ac--) {
                    var ad = h._inner[ac];
                    var ae = h._inner[ac - 1];
                    var af = a._inner[ad];
                    var ag = a._inner[ae];
                    var ah = this.cy(ad, a._inner[ad], g_2);
                    var ai = this.cy(ae, a._inner[ae], g_2);
                    if (ah.intersectsWith(ai) || ah.left < ai.right) {
                        var aj = new Rect(0, ah.left - (ai.width + 1) + (ag.left - ai.left), ag.top, ag.width, ag.height);
                        a._inner[ae] = aj;
                    }
                }
            }
            return a;
        }
        else {
            return a;
        }
    };
    HorizontalAxisLabelPanelBase.$t = markType(HorizontalAxisLabelPanelBase, 'HorizontalAxisLabelPanelBase', AxisLabelPanelBase.$);
    return HorizontalAxisLabelPanelBase;
}(AxisLabelPanelBase));
export { HorizontalAxisLabelPanelBase };
/**
 * @hidden
 */
var HorizontalAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAxisLabelPanel, _super);
    function HorizontalAxisLabelPanel() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    HorizontalAxisLabelPanel.prototype.ai = function () {
        return 1;
    };
    HorizontalAxisLabelPanel.prototype.ay = function (a) {
        return a == 5 || a == 4 || a == 1 || a == 0;
    };
    HorizontalAxisLabelPanel.$t = markType(HorizontalAxisLabelPanel, 'HorizontalAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
    return HorizontalAxisLabelPanel;
}(HorizontalAxisLabelPanelBase));
export { HorizontalAxisLabelPanel };
/**
 * @hidden
 */
var NumericAxisBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAxisBase, _super);
    function NumericAxisBase() {
        var _this = _super.call(this) || this;
        _this.kw = 0;
        _this.lw = 0;
        _this.ma = 0;
        _this.lz = 0;
        _this.lv = 0;
        _this.l9 = 0;
        _this.ly = 0;
        _this.lu = 0;
        _this.mh = -1;
        _this.mg = 0;
        _this.mi = -1;
        _this.le = false;
        _this.lx = 0;
        _this.lc = false;
        _this.ld = false;
        _this.mn = 0;
        _this.k4 = null;
        _this.lq = false;
        _this.lr = false;
        _this.ks = null;
        _this.ku = null;
        _this.l1 = -1;
        _this.l0 = -1;
        _this.kx = 0;
        _this.ln = false;
        _this.k8 = null;
        _this.lb = false;
        _this.mn = 10;
        return _this;
    }
    NumericAxisBase.prototype.a4 = function () {
        return new NumericAxisBaseView(this);
    };
    NumericAxisBase.prototype.ag = function () {
        return [this.l4, this.l3];
    };
    NumericAxisBase.prototype.hv = function (a) {
        _super.prototype.hv.call(this, a);
        this.k1 = a;
    };
    NumericAxisBase.prototype.d2 = function (a, b) {
        var c = a < this.l4 ? this.l4 : a;
        c = a > this.l3 ? this.l3 : c;
        return c;
    };
    NumericAxisBase.prototype.get_cj = function () {
        return true;
    };
    Object.defineProperty(NumericAxisBase.prototype, "ky", {
        get: function () {
            return EnumUtil.getEnumValue(AxisRangeBufferMode_$type, this.c(NumericAxisBase.nw));
        },
        set: function (a) {
            this.h(NumericAxisBase.nw, enumGetBox(AxisRangeBufferMode_$type, a));
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "kz", {
        get: function () {
            return this.kw;
        },
        set: function (a) {
            this.kw = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l4", {
        get: function () {
            return this.lw;
        },
        set: function (a) {
            if (this.l4 != a) {
                var b = this.lw;
                this.lw = a;
                this.ma = Math.log(this.l4);
                this.h5("ActualMinimumValue", b, this.l4);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.f4 = function () {
        return this.mc;
    };
    Object.defineProperty(NumericAxisBase.prototype, "l7", {
        get: function () {
            return this.lz;
        },
        set: function (a) {
            if (this.l7 != a) {
                var b = this.lz;
                this.lz = a;
                this.h5("ActualVisibleMinimumValue", b, this.l7);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l3", {
        get: function () {
            return this.lv;
        },
        set: function (a) {
            if (this.l3 != a) {
                var b = this.lv;
                this.lv = a;
                this.l9 = Math.log(this.l3);
                this.h5("ActualMaximumValue", b, this.l3);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.f3 = function () {
        return this.l3;
    };
    Object.defineProperty(NumericAxisBase.prototype, "l6", {
        get: function () {
            return this.ly;
        },
        set: function (a) {
            if (this.l6 != a) {
                var b = this.ly;
                this.ly = a;
                this.h5("ActualVisibleMaximumValue", b, this.l6);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l2", {
        get: function () {
            return this.lu;
        },
        set: function (a) {
            if (this.l2 != a) {
                var b = this.lu;
                this.lu = a;
                this.h5("ActualInterval", b, this.l2);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.ex = function () {
        return this.l2;
    };
    Object.defineProperty(NumericAxisBase.prototype, "mk", {
        get: function () {
            return this.mh;
        },
        set: function (a) {
            this.mh = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "mj", {
        get: function () {
            return this.mg;
        },
        set: function (a) {
            if (this.mj != a) {
                var b = this.mg;
                this.mg = a;
                this.h5("ActualMaxPrecision", b, this.mj);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "ml", {
        get: function () {
            return this.mi;
        },
        set: function (a) {
            this.mi = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "li", {
        get: function () {
            return this.le;
        },
        set: function (a) {
            this.le = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "l5", {
        get: function () {
            return this.lx;
        },
        set: function (a) {
            if (this.l5 != a) {
                var b = this.lx;
                this.lx = a;
                this.h5("ActualMinorInterval", b, this.l5);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lg", {
        get: function () {
            return this.lc;
        },
        set: function (a) {
            if (this.lg != a) {
                var b = this.lc;
                if (b != a) {
                    this.lc = a;
                    this.h5("ActualIsLogarithmic", b, this.lg);
                }
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lh", {
        get: function () {
            return this.ld;
        },
        set: function (a) {
            this.ld = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lp", {
        get: function () {
            return this.lg && this.l4 > 0 && this.mn > 1;
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.ic = function (a) {
        _super.prototype.ic.call(this, a);
        if (this.lp && this.bi != null) {
            var b = this.kc();
            var c = this.kb();
            var d = this.k5(this.kh, this.bi.v4, b, c);
            if (d == null) {
                return;
            }
            var _loop_4 = function (e) {
                var f = this_2.mm;
                var g = d.k._inner[e];
                var h = Math.min(g.d, g.c);
                var i = Math.max(g.d, g.c);
                var j = Math.floor(logBase(h, f));
                var k = Math.ceil(logBase(i, f));
                if (k - j < 2) {
                    if (typeCast(LogarithmicTickmarkValues.$, this_2.k8) !== null) {
                        this_2.k8 = new LinearTickmarkValues();
                    }
                }
                else {
                    this_2.k8 = this_2.la != null ? this_2.la : ((function () {
                        var $ret = new LogarithmicTickmarkValues();
                        $ret.x = f;
                        return $ret;
                    })());
                }
            };
            var this_2 = this;
            for (var e = 0; e < d.k.count; e++) {
                _loop_4(e);
            }
        }
    };
    NumericAxisBase.prototype.it = function (a, b) {
        _super.prototype.it.call(this, a, b);
        if (this.mo != -1) {
            this.mj = this.mp();
        }
        else {
            if (this.mj != -1) {
                this.mj = -1;
            }
        }
    };
    NumericAxisBase.prototype.h4 = function (a) {
        _super.prototype.h4.call(this, a);
        this.mc = a;
    };
    NumericAxisBase.prototype.h3 = function (a) {
        _super.prototype.h4.call(this, a);
        this.mb = a;
    };
    NumericAxisBase.prototype.hz = function (a, b, c, d) {
        _super.prototype.hz.call(this, a, b, c, d);
        switch (b) {
            case "SeriesViewer":
                this.mj = this.mp();
                break;
            case NumericAxisBase.$$p[12]:
                this.li = this.ls;
                this.mj = this.mp();
                break;
            case NumericAxisBase.$$p[7]:
                this.ml = this.mo;
                this.mj = this.mp();
                break;
            case "ActualMaxPrecision":
                this.mk = this.mj;
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[0]:
            case NumericAxisBase.$$p[1]:
                if (this.mq != null) {
                    this.ks = new BindingFormatter();
                    this.ks.j = this.mq;
                    this.ks.d = this.kr;
                }
                else {
                    this.ks = null;
                }
                break;
            case "AutoRangeBufferMode":
                this.kz = this.ky;
                this.hl();
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[9]:
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[8]:
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[2]:
                this.lh = this.lj;
                this.c1();
                this.ib(false);
                break;
            case NumericAxisBase.$$p[5]:
                this.lq = true;
                this.lg = this.lo;
                break;
            case Axis.$$p[4]:
            case Axis.$$p[3]:
            case NumericAxisBase.$$p[4]:
            case NumericAxisBase.$$p[10]:
                this.cq = true;
                this.ib(false);
                break;
            case NumericAxisBase.$$p[6]:
                this.lq = true;
                this.mn = this.mm;
                if (this.lg) {
                    this.c1();
                    this.ni();
                    this.ib(false);
                }
                break;
            case NumericAxisBase.$$p[11]:
                var e = new AxisRangeChangedEventArgs(0, this.l4, this.l4, this.l3, this.l3);
                this.h6(e);
                this.cq = true;
                this.ib(false);
                break;
            case Axis.$$p[13]:
                this.k4 = this.k2();
                this.cq = true;
                this.ib(false);
                break;
            case "TickmarkValues":
                this.nk();
                break;
            case "ActualIsLogarithmic":
                this.c1();
                this.ni();
                this.cq = true;
                this.nk();
                this.ib(false);
                break;
            case "ActualTickmarkValues":
                this.cq = true;
                this.ib(false);
                break;
            case "AbbreviateLargeNumbers":
                this.ib(false);
                break;
        }
    };
    NumericAxisBase.prototype.ni = function () {
        var e_56, _a;
        try {
            for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.rq(false);
            }
        }
        catch (e_56_1) {
            e_56 = { error: e_56_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_56)
                    throw e_56.error;
            }
        }
    };
    NumericAxisBase.prototype.kv = function () {
        var e_57, _a;
        var a = new AxisRange(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY);
        var b = false;
        if (this.bi != null) {
            try {
                for (var _b = __values(fromEnum(this.db())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    var d = c.ay(this);
                    if (d != null) {
                        b = true;
                        a = new AxisRange(Math.min(a.c, d.c), Math.max(a.b, d.b));
                    }
                }
            }
            catch (e_57_1) {
                e_57 = { error: e_57_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_57)
                        throw e_57.error;
                }
            }
        }
        if (b) {
            if (this.l1 >= 0) {
                a = new AxisRange(a.c - this.l1, a.b);
            }
            if (this.l0 >= 0) {
                a = new AxisRange(a.c, a.b + this.l0);
            }
            this.ku = a;
            return a;
        }
        this.ku = null;
        return null;
    };
    NumericAxisBase.prototype.lt = function (a) {
        var e_58, _a;
        if (a == 1 || a == 2 || a == 3) {
            var b = this.ku;
            if (b == null) {
                b = this.kv();
            }
            if (b == null) {
                return false;
            }
            if (this.bi == null || this.bi.wk.isEmpty) {
                return false;
            }
            var c = -1;
            var d = -1;
            try {
                for (var _b = __values(fromEnum(this.dc())), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    var f = e.ax(b, this, new Rect(0, 0, 0, 1, 1));
                    if (f.c != b.c) {
                        if (a == 1 || a == 2) {
                            c = Math.max(c, b.c - f.c);
                        }
                    }
                    if (f.b != b.b) {
                        if (a == 1 || a == 3) {
                            d = Math.max(d, f.b - b.b);
                        }
                    }
                }
            }
            catch (e_58_1) {
                e_58 = { error: e_58_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_58)
                        throw e_58.error;
                }
            }
            if (c >= 0 || d >= 0) {
                this.l1 = c;
                this.l0 = d;
                return true;
            }
            return false;
        }
        return false;
    };
    NumericAxisBase.prototype.k0 = function () {
        if (this.kz == 0) {
            if (this.bi != null) {
                if (this.cp) {
                    if (this.bi.b2 == 2) {
                        return 1;
                    }
                    if (this.ci) {
                        if (this.bi.b2 == 4) {
                            return 3;
                        }
                        if (this.bi.b2 == 3) {
                            return 2;
                        }
                    }
                    else {
                        if (this.bi.b2 == 4) {
                            return 2;
                        }
                        if (this.bi.b2 == 3) {
                            return 3;
                        }
                    }
                }
                else {
                    if (this.bi.b0 == 2) {
                        return 1;
                    }
                    if (this.ci) {
                        if (this.bi.b0 == 4) {
                            return 3;
                        }
                        if (this.bi.b0 == 3) {
                            return 2;
                        }
                    }
                    else {
                        if (this.bi.b0 == 4) {
                            return 2;
                        }
                        if (this.bi.b0 == 3) {
                            return 3;
                        }
                    }
                }
            }
            return 4;
        }
        else {
            return this.kz;
        }
    };
    NumericAxisBase.prototype.ng = function (a, b, c, d, e, f, g) {
        var h = AutoRangeCalculator.a(a, b, c, d, e, f, g);
        f = h.p5;
        g = h.p6;
        return {
            p5: f,
            p6: g
        };
    };
    NumericAxisBase.prototype.c3 = function () {
        if (this.cq && this.c4) {
            this.bc = this.bb();
        }
        var a = this.lg && !isNaN_(this.mm) && !isInfinity(this.mm) && this.mm > 1;
        var b;
        var c;
        var d = this.k0();
        if (d != this.kx) {
            this.kx = d;
            this.hl();
        }
        var e = false;
        if (!this.kh.isEmpty && d != 4) {
            if (this.l1 == -1 && this.l0 == -1) {
                e = true;
            }
        }
        var f = this.ng(this, this.mc, this.mb, a, this.mm, b, c);
        b = f.p5;
        c = f.p6;
        if (b != this.l4 || c != this.l3 || this.lq) {
            if (d != 4 && (this.l1 >= 0 || this.l0 >= 0)) {
                this.hl();
                var g = this.ng(this, this.mc, this.mb, a, this.mm, b, c);
                b = g.p5;
                c = g.p6;
            }
        }
        if (b != this.l4 || c != this.l3 || this.lq || e) {
            this.lq = false;
            var h = new AxisRangeChangedEventArgs(0, this.l4, b, this.l3, c);
            this.l4 = b;
            this.l3 = c;
            if (!this.kh.isEmpty && d != 4) {
                if (this.lt(d)) {
                    var i = this.ng(this, this.mc, this.mb, a, this.mm, b, c);
                    b = i.p5;
                    c = i.p6;
                    h = new AxisRangeChangedEventArgs(0, h.oldMinimumValue, b, h.oldMaximumValue, c);
                    this.l4 = b;
                    this.l3 = c;
                }
            }
            this.h6(h);
            this.nj(h);
            this.ib(true);
            return true;
        }
        return false;
    };
    NumericAxisBase.prototype.hl = function () {
        this.l1 = -1;
        this.l0 = -1;
    };
    NumericAxisBase.prototype.nj = function (a) {
    };
    NumericAxisBase.prototype.ct = function (a) {
        var b = _super.prototype.ct.call(this, a);
        if (b) {
            this.c1();
        }
        return b;
    };
    NumericAxisBase.prototype.b0 = function (a) {
        var b = _super.prototype.b0.call(this, a);
        if (b) {
            this.c1();
        }
        return b;
    };
    NumericAxisBase.prototype.k3 = function (a) {
        return new NumericAxisRenderer(a);
    };
    NumericAxisBase.prototype.k2 = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new AxisLabelManager();
            $ret.a = _this;
            $ret.f = _this.de;
            $ret.e = _this.dd;
            $ret.b = _this.aw;
            return $ret;
        })());
        if (this.az != null) {
            this.az.registerAxis(this);
        }
        var b = this.k3(a);
        b.u = function () {
            var c = _this.a5.a4();
            var d = _this.a5.a7();
            var e = _this.a5.a5();
            var f = _this.a5.a6();
            _this.ip();
            _this.hk(c);
            _this.hk(d);
            _this.hk(e);
            _this.hk(f);
        };
        b.o = function (c, d) { return !d.isEmpty && !c.isEmpty; };
        b.d = function (c, d, e, f) { return _this.k5(c, d, e, f); };
        b.g = function (c, d) {
            _this.ln = d;
            var e = _this.f1(c);
            _this.ln = false;
            return e;
        };
        return b;
    };
    NumericAxisBase.prototype.k6 = function () {
        return new NumericAxisRenderingParameters();
    };
    NumericAxisBase.prototype.nh = function () {
    };
    NumericAxisBase.prototype.k7 = function () {
        return null;
    };
    NumericAxisBase.prototype.mp = function () {
        if (!this.li && (this.ka.isEmpty || this.ka.width < 1 || this.ka.height < 1)) {
            return -1;
        }
        return this.ml;
    };
    NumericAxisBase.prototype.k5 = function (a, b, c, d) {
        var e = this.k6();
        var f = this.a5.a4();
        var g = this.a5.a7();
        var h = this.a5.a5();
        var i = this.a5.a6();
        var j = this.a5.e();
        var k = this.a5.f();
        var l = this.a5.g();
        e.u = f;
        e.x = g;
        e.v = h;
        e.w = i;
        e.a = j;
        e.c = k;
        e.d = l;
        e.l = this.l3;
        e.m = this.l4;
        e.h = this.ll;
        e.f = this.k9;
        e.aa = a;
        e.z = c;
        e.y = d;
        e.ab = b;
        e.o = this.e0();
        e.s = this.mk;
        e.g = this.lk();
        e.p = this.l8;
        e.q = this.md;
        e.t = this.f2;
        if (this.f2 == null && (this.au != null || this.ai != null || this.k1.m())) {
            e.t = "Format";
        }
        e.j = this.cy;
        e.ac = this.lf;
        return e;
    };
    NumericAxisBase.prototype.mf = function (a) {
        var b = this.kc();
        var c = new ScalerParams(0, this.bi.v4, this.kh, this.ch, b);
        return this.eo(a, c);
    };
    NumericAxisBase.prototype.lk = function () {
        return !isNaN_(this.l8);
    };
    Object.defineProperty(NumericAxisBase.prototype, "lm", {
        get: function () {
            return !isNaN_(this.mc);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "ll", {
        get: function () {
            return !isNaN_(this.mb);
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.prototype.nk = function () {
        if (this.la != null) {
            this.k9 = this.la;
        }
        else if (this.lg) {
            this.k9 = new LogarithmicTickmarkValues();
            this.k1.bl();
        }
        else {
            this.k9 = new LinearTickmarkValues();
        }
    };
    Object.defineProperty(NumericAxisBase.prototype, "la", {
        get: function () {
            return typeCast(TickmarkValues.$, this.c(NumericAxisBase.nz));
        },
        set: function (a) {
            this.h(NumericAxisBase.nz, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "k9", {
        get: function () {
            if (this.k8 == null) {
                this.nk();
            }
            return this.k8;
        },
        set: function (a) {
            var b = this.k8;
            var c = b != a;
            if (c) {
                this.k8 = a;
                this.h5("ActualTickmarkValues", b, a);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(NumericAxisBase.prototype, "lf", {
        get: function () {
            return this.lb;
        },
        set: function (a) {
            var b = this.lf;
            if (a != b) {
                this.lb = a;
                this.h5("AbbreviateLargeNumbers", b, this.lf);
            }
        },
        enumerable: false,
        configurable: true
    });
    NumericAxisBase.$t = markType(NumericAxisBase, 'NumericAxisBase', Axis.$);
    NumericAxisBase.nw = DependencyProperty.i("AutoRangeBufferMode", AxisRangeBufferMode_$type, NumericAxisBase.$, new PropertyMetadata(2, enumGetBox(AxisRangeBufferMode_$type, 0), function (a, b) { return a.h5("AutoRangeBufferMode", b.oldValue, b.newValue); }));
    NumericAxisBase.nz = DependencyProperty.i("TickmarkValues", TickmarkValues.$, NumericAxisBase.$, new PropertyMetadata(1, function (a, b) { return a.h5("TickmarkValues", b.oldValue, b.newValue); }));
    NumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAxisBase, 'h5', ['AbbreviatedLabelFormat:mq:nl', [2, null], 'AbbreviatedLabelFormatSpecifiers:kr:nm', [Array_$type, null], 'FavorLabellingScaleEnd:lj:nn', [0, false], 'FormatAbbreviatedLabel:kt:no', [Delegate_$type], 'Interval:l8:np', [1, NaN], 'IsLogarithmic:lo:nq', [0, false], 'LogarithmBase:mm:nr', [1, 10], 'MaxPrecision:mo:nt', [1, -1], 'MaximumValue:mb:ns', [1, NaN], 'MinimumValue:mc:nu', [1, NaN], 'MinorInterval:md:nv', [1, NaN], 'ReferenceValue:me:nx', [1, 0], 'ShouldApplyMaxPrecisionWhenZoomed:ls:ny', [0, false]]);
    return NumericAxisBase;
}(Axis));
export { NumericAxisBase };
/**
 * @hidden
 */
var NumericScaler = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericScaler, _super);
    function NumericScaler() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.o = 0;
        _this.n = 0;
        _this.m = 0;
        return _this;
    }
    NumericScaler.prototype.y = function (a) {
        this.l = a;
    };
    NumericScaler.prototype.x = function (a) {
        this.k = a;
    };
    NumericScaler.prototype.w = function (a, b, c) {
        switch (a) {
            case NumericScaler.$$p[1]:
                this.o = this.l;
                this.z();
                break;
            case NumericScaler.$$p[0]:
                this.n = this.k;
                this.z();
                break;
        }
    };
    NumericScaler.prototype.z = function () {
        if (isNaN_(this.l) || isNaN_(this.k) || isInfinity(this.l) || isInfinity(this.k) || this.l < (-7.9228162514264338E+28) || this.k > (7.9228162514264338E+28)) {
            this.m = this.k - this.l;
        }
        else {
            this.m = this.k - this.l;
        }
    };
    NumericScaler.prototype.j = function (a, b, c, d) {
        var e = new List$1(Number_$type, 2, a.count);
        for (var f = b; f < c; f++) {
            e.add(this.q(a.item(f), d));
        }
        return e;
    };
    NumericScaler.prototype.v = function (a, b, c, d) {
        for (var e = b; e < c; e++) {
            a.item(e, this.p(a.item(e), d));
        }
    };
    NumericScaler.prototype.u = function (a, b, c, d, e) {
        for (var f = 0; f < b.count; f++) {
            var g = b.item(f);
            for (var h = c; h < d; h++) {
                a.item(h)[g] = this.p(a.item(h)[g], e);
            }
        }
    };
    NumericScaler.$t = markType(NumericScaler, 'NumericScaler', DependencyObject.$);
    NumericScaler.ac = new Rect(0, 0, 0, 1, 1);
    NumericScaler.$$p = markDep(DependencyProperty, PropertyMetadata, NumericScaler, 'w', ['ActualMaximumValue:k:aa', [1, NaN], 'ActualMinimumValue:l:ab', [1, NaN]]);
    return NumericScaler;
}(DependencyObject));
export { NumericScaler };
/**
 * @hidden
 */
var AxisRendererBase = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisRendererBase, _super);
    function AxisRendererBase(a) {
        var _this = _super.call(this) || this;
        _this.u = null;
        _this.o = null;
        _this.v = null;
        _this.m = null;
        _this.l = null;
        _this.k = null;
        _this.q = null;
        _this.n = null;
        _this.j = null;
        _this.e = null;
        _this.p = null;
        _this.h = null;
        _this.t = null;
        _this.b = null;
        _this.g = null;
        _this.d = null;
        _this.r = null;
        _this.a = null;
        _this.f = null;
        _this.i = null;
        _this.u = function () {
        };
        _this.o = function (b, c) { return false; };
        _this.v = function () {
        };
        _this.m = function (b, c) { return c; };
        _this.l = function (b, c, d, e) {
        };
        _this.k = function (b, c, d) {
        };
        _this.q = function (b, c) { return false; };
        _this.n = function (b, c) { return _this.q(b, c); };
        _this.j = function (b) {
        };
        _this.e = function (b) {
        };
        _this.p = function (b, c, d) { return false; };
        _this.h = function (b, c) { return new LabelPosition(c); };
        _this.t = function (b, c) { return c; };
        _this.g = function (b, c) { return null; };
        _this.r = function (b, c, d, e) { return c; };
        _this.a = function (b, c, d, e) { return c; };
        _this.b = a;
        _this.d = function (b, c, d, e) { return null; };
        return _this;
    }
    AxisRendererBase.prototype.c = function (a, b, c, d, e) {
        var e_59, _a;
        this.x(c, b);
        if (this.o(b, c)) {
            this.v();
            var f_1 = this.d(b, c, d, e);
            this.x(c, b);
            if (f_1 == null) {
                this.aa();
                return null;
            }
            if (f_1.k.count > 1 && !f_1.g) {
                this.ab(f_1);
            }
            var _loop_5 = function (g) {
                f_1.e = g;
                if (isNaN_(g.c) || isInfinity(g.c) || isNaN_(g.d) || isInfinity(g.d)) {
                    return "continue";
                }
                if (g.d == g.c) {
                    return "continue";
                }
                this_3.e(f_1);
                this_3.b.o(f_1.r);
                var h = 0;
                var i = 0;
                var j = false;
                var k = function (l) { return l; };
                if (this_3.f != null) {
                    k = this_3.i;
                }
                if (typeCast(CategoryAxisRenderingParameters.$, f_1) !== null) {
                    h = f_1.ac;
                    i = f_1.ag;
                    j = f_1.ad;
                }
                f_1.f = this_3.s(f_1);
                f_1.f.s(((function () {
                    var $ret = new TickmarkValuesInitializationParameters();
                    $ret.n = f_1.e.d;
                    $ret.m = f_1.e.c;
                    $ret.g = f_1.m;
                    $ret.f = f_1.l;
                    $ret.k = f_1.e.b;
                    $ret.d = f_1.g;
                    $ret.l = f_1.p;
                    $ret.j = f_1.q;
                    $ret.h = f_1.o;
                    $ret.i = f_1.e.a;
                    $ret.q = f_1.e.e;
                    $ret.a = h;
                    $ret.r = i;
                    $ret.t = f_1.ab;
                    $ret.s = f_1.aa;
                    $ret.e = j;
                    $ret.c = k;
                    $ret.p = f_1.s;
                    return $ret;
                })()));
                this_3.y(f_1);
            };
            var this_3 = this;
            try {
                for (var _b = __values(fromEnum(f_1.k)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var g = _c.value;
                    _loop_5(g);
                }
            }
            catch (e_59_1) {
                e_59 = { error: e_59_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_59)
                        throw e_59.error;
                }
            }
            this.z();
            return f_1;
        }
        return null;
    };
    AxisRendererBase.prototype.aa = function () {
        this.b.q();
    };
    AxisRendererBase.prototype.ab = function (a) {
        var e_60, _a, e_61, _b;
        var b = -1.7976931348623157E+308;
        var c = -2147483648;
        var d = 0;
        var e = 0;
        var f = false;
        var g = function (h) { return h; };
        if (this.f != null) {
            g = this.i;
        }
        if (typeCast(CategoryAxisRenderingParameters.$, a) !== null) {
            d = a.ac;
            e = a.ag;
            f = a.ad;
        }
        var _loop_6 = function (h) {
            a.e = h;
            a.f.s(((function () {
                var $ret = new TickmarkValuesInitializationParameters();
                $ret.n = h.d;
                $ret.m = h.c;
                $ret.g = a.m;
                $ret.f = a.l;
                $ret.k = h.b;
                $ret.d = a.g;
                $ret.l = a.p;
                $ret.i = h.a;
                $ret.q = h.e;
                $ret.h = a.o;
                $ret.j = a.q;
                $ret.a = d;
                $ret.r = e;
                $ret.t = a.ab;
                $ret.s = a.aa;
                $ret.e = f;
                $ret.c = g;
                $ret.p = a.s;
                return $ret;
            })()));
            h.a = a.f.m;
            h.e = a.f.r;
            if (!isNaN_(a.f.m)) {
                b = Math.max(b, a.f.m);
                c = Math.max(c, a.f.r);
            }
        };
        try {
            for (var _c = __values(fromEnum(a.k)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var h = _d.value;
                _loop_6(h);
            }
        }
        catch (e_60_1) {
            e_60 = { error: e_60_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_60)
                    throw e_60.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(a.k)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var i = _f.value;
                if (i.a == b) {
                    i.a = -1;
                    i.e = -1;
                }
                else {
                    i.a = b;
                    i.e = c;
                }
            }
        }
        catch (e_61_1) {
            e_61 = { error: e_61_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_61)
                    throw e_61.error;
            }
        }
    };
    AxisRendererBase.prototype.x = function (a, b) {
        this.u();
        this.b.n(a, b);
        this.b.t();
    };
    AxisRendererBase.prototype.z = function () {
        var e_62, _a;
        this.b.t();
        var a = false;
        if (this.b.d) {
            this.b.s(0);
        }
        else {
            var b = 0;
            try {
                for (var _b = __values(fromEnum(this.b.e)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    var d = typeCast(FrameworkElement.$, c);
                    if (d == null) {
                        d = this.b.u(b);
                        var e = d.al;
                        var f = c.toString();
                        var g = 0;
                        var h = 0;
                        if (e != null) {
                            g = e.length;
                        }
                        if (f != null) {
                            h = f.length;
                        }
                        if (g != h) {
                            a = true;
                        }
                        d.al = f;
                        b++;
                    }
                    else {
                    }
                }
            }
            catch (e_62_1) {
                e_62 = { error: e_62_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_62)
                        throw e_62.error;
                }
            }
            if (a) {
                this.b.p();
            }
            this.b.g();
            this.b.s(b);
        }
    };
    AxisRendererBase.prototype.s = function (a) {
        return a.f;
    };
    AxisRendererBase.prototype.y = function (a) {
        var b = a.f.j();
        var c = a.f.k();
        this.b.r(this.m(a, a.f.m));
        this.j(a);
        for (var d = 0; d < b.length; d++) {
            var e = a.f.p + d;
            var f = b[d];
            var g = f;
            var h = 0;
            if (d < b.length - 1) {
                h = b[d + 1];
            }
            else {
                h = Number.POSITIVE_INFINITY;
            }
            g = this.r(a, g, e, a.f.m);
            h = this.r(a, h, e, a.f.m);
            var i = this.m(a, g);
            var j = this.m(a, h);
            if (this.q(a, i)) {
                if (e % 2 == 0 && this.n(a, j) && !isInfinity(j)) {
                    this.l(a, a.x, i, j);
                }
                a.b = a.c;
                this.k(a, a.v, i);
                a.b = null;
            }
            i = this.a(a, i, e, a.f.m);
            if (!isNaN_(i) && !isInfinity(i) && this.p(a, i, d == b.length - 1)) {
                var k = this.w(a, g, e, a.f.m);
                if (k != null) {
                    this.b.i(k, this.h(a, i));
                }
            }
        }
        if (a.j) {
            for (var l = 0; l < c.length; l++) {
                var m = c[l];
                var n = this.m(a, m);
                a.b = a.d;
                this.k(a, a.w, n);
                a.b = null;
            }
        }
    };
    AxisRendererBase.prototype.w = function (a, b, c, d) {
        return null;
    };
    AxisRendererBase.$t = markType(AxisRendererBase, 'AxisRendererBase');
    return AxisRendererBase;
}(Base));
export { AxisRendererBase };
/**
 * @hidden
 */
var NumericAxisRenderer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAxisRenderer, _super);
    function NumericAxisRenderer(a) {
        var _this = _super.call(this, a) || this;
        _this.ac = null;
        _this.ad = false;
        return _this;
    }
    NumericAxisRenderer.prototype.w = function (a, b, c, d) {
        var e;
        if (a.t != null) {
            if (a.i() && a.ac) {
                return this.ae(b, this.g);
            }
            e = this.g(b, false);
        }
        else {
            b = Math.round(b * 1000000) / 1000000;
            if (a.i() && a.ac) {
                return this.ae(b, null);
            }
            e = MathUtil.s(b);
        }
        return e;
    };
    NumericAxisRenderer.prototype.ae = function (a, b) {
        if (this.ad) {
            return a.toString();
        }
        if (this.ac == null) {
            this.ac = NumberAbbreviatorFactory.a(this.b.a.bu);
            if (this.ac == null) {
                this.ad = true;
                return a.toString();
            }
        }
        return this.ac.abbreviate(a, b);
    };
    NumericAxisRenderer.$t = markType(NumericAxisRenderer, 'NumericAxisRenderer', AxisRendererBase.$);
    return NumericAxisRenderer;
}(AxisRendererBase));
export { NumericAxisRenderer };
/**
 * @hidden
 */
var VerticalAxisLabelPanel = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(VerticalAxisLabelPanel, _super);
    function VerticalAxisLabelPanel() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.di = 0;
        _this.df = 0;
        _this.dh = 0;
        _this.dg = 0;
        return _this;
    }
    VerticalAxisLabelPanel.prototype.ae = function () {
        return new VerticalAxisLabelPanelView(this);
    };
    VerticalAxisLabelPanel.prototype.ch = function (a) {
        _super.prototype.ch.call(this, a);
        this.c9 = a;
    };
    VerticalAxisLabelPanel.prototype.b6 = function () {
        this.c9.a0();
    };
    VerticalAxisLabelPanel.prototype.bq = function () {
        return this.ad.bf != null ? this.ad.bf.angle : -90;
    };
    VerticalAxisLabelPanel.prototype.db = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 1) {
            a += this.bu();
        }
        var c = this.ah;
        if (c == 3 || c == 7) {
            a += this.ad.d0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.dd = function () {
        var a = 0;
        var b = this.aj(this.ad.bf);
        if (b == 2) {
            a += this.bu();
        }
        var c = this.ah;
        if (c == 2 || c == 6) {
            a += this.ad.d0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.de = function () {
        var a = (this.bd - this.db()) - this.dd();
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.dc = function () {
        var a = ((this.de() - this.af.p()) - this.af.q());
        if (a < 0) {
            a = 0;
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.a5 = function () {
        var a = new List$1(Rect.$, 0);
        this.aw = false;
        this.av = false;
        if (this.ag != null && this.ag.k() && this.bl() % 360 != 0) {
            this.av = true;
        }
        this.di = -1.7976931348623157E+308;
        this.df = -1.7976931348623157E+308;
        this.dh = -1.7976931348623157E+308;
        this.dg = -1.7976931348623157E+308;
        var b = this.af.p();
        var c = this.af.r();
        var d = this.af.q();
        var e = this.af.o();
        var f = this.db();
        var g = false;
        if (!isNaN_(this.be)) {
            this.di = Math.max(this.be, this.di);
            this.dh = Math.max(this.bf, this.dh);
        }
        for (var h = 0; h < this.bb.count; h++) {
            var i = this.bb._inner[h];
            var j = this.ba._inner[h].a;
            var k = this.bj(i);
            var l = this.bk(i);
            var m = k + c + e;
            var n = l + b + d;
            var o = this.c1.left + f;
            var p = this.ba._inner[h].c - m / 2;
            if (j) {
                var q = this.be;
                if ((isNaN_(this.be) || n > this.be || this.ba._inner[h].b) && !g) {
                    if (this.ba._inner[h].b) {
                        g = true;
                    }
                    this.ba._inner[h].b = false;
                    this.be = n;
                    this.bf = l;
                }
                this.di = Math.max(this.be, this.di);
                this.df = Math.max(m, this.df);
                this.dh = Math.max(this.bf, this.dh);
                this.dg = Math.max(k, this.dg);
            }
            else {
                this.di = Math.max(n, this.di);
                this.df = Math.max(m, this.df);
                this.dh = Math.max(l, this.dh);
                this.dg = Math.max(k, this.dg);
            }
            var r = new Rect(0, o, p, n, m);
            a.add(r);
        }
        var s = 0;
        if (this.av) {
            s = this.bl() % 360;
            if (s < 0) {
                s += 360;
            }
        }
        var t = this.ad.b8();
        if (!t) {
            this.dj(s, b, d);
        }
        else {
            this.af.ac();
        }
        if (this.av) {
            for (var u = 0; u < a.count; u++) {
                var v = a._inner[u];
                v.y = this.ba._inner[u].c - this.df / 2;
                a._inner[u] = v;
            }
        }
        var w = false;
        if (!this.av && this.di <= this.bd) {
            w = true;
        }
        if (!w) {
            var x = this.c1.height;
            var y = this.de();
            var z = y;
            var aa = this.ba.count > 1 ? Math.abs(this.ba._inner[1].c - this.ba._inner[0].c) : x;
            var ab = Math.abs(Math.asin(aa / this.di) * (180 / Math.PI));
            var ac = (s >= ab && s <= 180 - ab) || (s - 180 >= ab && s - 180 <= 180 - ab);
            for (var ad = 0; ad < a.count; ad++) {
                if (this.av) {
                    var ae = s * (Math.PI / 180);
                    var af = this.bv(this.bb._inner[ad]);
                    z = Math.min(y / Math.abs(Math.cos(ae)), af);
                    if (ac) {
                        var ag = void 0;
                        if (s > 0 && s < 90) {
                            ag = (Math.PI / 180) * (90 - s);
                        }
                        else if (s > 270 && s < 360) {
                            ag = (Math.PI / 180) * (s - 270);
                        }
                        else {
                            ag = 0;
                        }
                        z = aa / Math.cos(ag);
                    }
                }
                var ah = a._inner[ad];
                ah.width = Math.min(ah.width, z);
                a._inner[ad] = ah;
                if (!(typeCast(TextBlock.$, this.bb._inner[ad]) !== null)) {
                    this.bb._inner[ad].width = z;
                }
                var ai = typeCast(TextBlock.$, this.bb._inner[ad]);
                if (ai != null) {
                    var aj = this.b1(ad, ai, z, b, d);
                    if (!Base.equalsStatic(ai.al, aj)) {
                        ai.al = aj;
                        this.bb._inner[ad].width = z;
                    }
                }
            }
            if (!t) {
                this.dj(s, b, d);
            }
        }
        if (this.da()) {
            this.dk(a);
        }
        return a;
    };
    VerticalAxisLabelPanel.prototype.dj = function (a, b, c) {
        var d = a * (Math.PI / 180);
        var e = Math.abs(this.dh * Math.cos(d)) + Math.abs(this.dg * Math.sin(d));
        var f = this.bu();
        var g = (e + b + c) + (f) + this.ad.d0;
        this.bh = Math.max(this.ad.eu, g);
    };
    VerticalAxisLabelPanel.prototype.dk = function (a) {
        this.c9.a1(a, this.di);
    };
    VerticalAxisLabelPanel.prototype.cm = function (a, b) {
        var c = 0;
        var d = this.dg / 2;
        var e = new TransformGroup();
        var f = AngleSimplifier.a(this.bl());
        var g = ((function () {
            var $ret = new RotateTransform();
            $ret.j = f;
            $ret.k = c;
            $ret.l = d;
            return $ret;
        })());
        var h = 0;
        var i = 0;
        if (f != 0 && f != 360) {
            f -= 90;
            if (f > 0 && f < 180) {
                g.k = this.dh;
                h = -this.dh + this.dg / 2;
                h = h + Math.sin(MathUtil.o(f - 180)) * (this.dg / 2);
            }
            else {
                if (f >= 180) {
                    h = h - Math.cos(MathUtil.o(f)) * (this.dg / 2);
                }
                else {
                    h = h + Math.cos(MathUtil.o(f)) * (this.dg / 2);
                }
            }
        }
        var j = ((function () {
            var $ret = new TranslateTransform();
            $ret.j = h;
            $ret.k = i;
            return $ret;
        })());
        e.j.add(g);
        e.j.add(j);
        a.j = e;
    };
    VerticalAxisLabelPanel.prototype.da = function () {
        return !this.aw && !this.av;
    };
    VerticalAxisLabelPanel.prototype.c0 = function () {
        var a = this.aj(this.ad.bf);
        var b = this.bu();
        var c = this.ah;
        var d = 0;
        if (a == 1) {
            d += this.c1.left;
            if (c == 3 || c == 7) {
                d += this.ad.d0;
            }
        }
        else {
            d = this.c1.right - b;
            if (c == 6 || c == 2) {
                d -= this.ad.d0;
            }
        }
        var e = this.bs();
        var f = 0;
        var g = this.ad.bf == null ? 1 : this.ad.bf.verticalAlignment;
        if (g == 0) {
            f = this.c1.top;
        }
        else if (g == 2) {
            f = this.c1.bottom - e;
        }
        else {
            f = (this.c1.top + (this.c1.height / 2)) - (e / 2);
        }
        return new Rect(0, d, f, b, e);
    };
    VerticalAxisLabelPanel.prototype.aj = function (a) {
        if (a == null) {
            return this.ad.bi.aq(this.ad);
        }
        if (a.position == 0) {
            if (this.ad != null && this.ad.bi != null) {
                return this.ad.bi.aq(this.ad);
            }
            return 1;
        }
        return a.position;
    };
    VerticalAxisLabelPanel.prototype.ai = function () {
        return 2;
    };
    VerticalAxisLabelPanel.prototype.ay = function (a) {
        return a == 2 || a == 3 || a == 6 || a == 7;
    };
    VerticalAxisLabelPanel.prototype.b9 = function () {
        var e_63, _a;
        var a = this.af.au();
        this.ad.hk(a);
        if (this.ag != null && this.ag.visibility != 0) {
            return;
        }
        var b = this.ad.d0;
        if (b == 0) {
            return;
        }
        var c = this.a2();
        if (c == null) {
            return;
        }
        var d = this.c1.left;
        var e;
        var f = this.ah;
        if (f == 2 || f == 6) {
            d = this.c1.right;
            e = d - b;
        }
        else {
            e = d + b;
        }
        var g = this.af.b();
        try {
            for (var _b = __values(fromEnum(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var h = _c.value;
                this.cc(a, h, d, e, this.c4, g);
            }
        }
        catch (e_63_1) {
            e_63 = { error: e_63_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_63)
                    throw e_63.error;
            }
        }
        if (!this.ab.contains(this.af.aw)) {
            this.ab.add(this.af.aw);
        }
    };
    VerticalAxisLabelPanel.$t = markType(VerticalAxisLabelPanel, 'VerticalAxisLabelPanel', AxisLabelPanelBase.$);
    return VerticalAxisLabelPanel;
}(AxisLabelPanelBase));
export { VerticalAxisLabelPanel };
/**
 * @hidden
 */
var ViewportUtils = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ViewportUtils, _super);
    function ViewportUtils() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ViewportUtils.e = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = d.left + d.width * (a - e.left) / e.width;
            f = (f - c.left) / c.width;
            return c.left + c.width * (f - b.left) / b.width;
        }
        return c.left + c.width * (a - b.left) / b.width;
    };
    ViewportUtils.b = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = b.left + b.width * (a - c.left) / c.width;
            f = (f * c.width) + c.left;
            f = ((f - d.left) * e.width / d.width) + e.left;
            return f;
        }
        return ((a - c.left) * b.width / c.width) + b.left;
    };
    ViewportUtils.i = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = d.top + d.height * (a - e.top) / e.height;
            f = (f - c.top) / c.height;
            return c.top + c.height * (f - b.top) / b.height;
        }
        return c.top + c.height * (a - b.top) / b.height;
    };
    ViewportUtils.g = function (a, b, c, d) {
        if (!d.isEmpty) {
            var e = NumericScaler.ac;
            var f = b.top + b.height * (a - c.top) / c.height;
            f = (f * c.height) + c.top;
            f = ((f - d.top) * e.height / d.height) + e.top;
            return f;
        }
        return ((a - c.top) * b.height / c.height) + b.top;
    };
    ViewportUtils.d = function (a, b, c, d) {
        var e = d;
        if (e.isEmpty) {
            e = c;
        }
        return e.width * a / b.width;
    };
    ViewportUtils.a = function (a, b, c, d) {
        var e = d;
        if (e.isEmpty) {
            e = c;
        }
        return b.width * a / e.width;
    };
    ViewportUtils.h = function (a, b, c, d) {
        var e = d;
        if (e.isEmpty) {
            e = c;
        }
        return e.height * a / b.height;
    };
    ViewportUtils.f = function (a, b, c) {
        return c.width * a / b.width;
    };
    ViewportUtils.c = function (a, b, c) {
        return b.width * a / c.width;
    };
    ViewportUtils.j = function (a, b, c) {
        return c.height * a / b.height;
    };
    ViewportUtils.$t = markType(ViewportUtils, 'ViewportUtils');
    return ViewportUtils;
}(Base));
export { ViewportUtils };
/**
 * @hidden
 */
export var IHasCategoryAxis_$type = new Type(null, 'IHasCategoryAxis');
/**
 * @hidden
 */
export var IHasCategoryModePreference_$type = new Type(null, 'IHasCategoryModePreference', null, [IHasCategoryAxis_$type]);
/**
 * @hidden
 */
var AutomaticSeriesManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutomaticSeriesManager, _super);
    function AutomaticSeriesManager(a) {
        var _this = _super.call(this) || this;
        _this.g = new HashSet$1(AutomaticSeriesPurpose_$type, 0);
        _this.c = null;
        _this.f = false;
        _this.a = null;
        _this.a = new AutomaticSeriesRequestCollection();
        var b = _this.a;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.i));
        var c = a.series;
        _this.c = c;
        c.collectionChanged = delegateCombine(c.collectionChanged, runOn(_this, _this.m));
        c.collectionResetting = delegateCombine(c.collectionResetting, runOn(_this, _this.n));
        return _this;
    }
    AutomaticSeriesManager.prototype.e = function (a) {
        return this.g.contains(a);
    };
    AutomaticSeriesManager.prototype.i = function (a, b) {
        this.j();
    };
    AutomaticSeriesManager.prototype.n = function (a, b) {
        this.j();
    };
    AutomaticSeriesManager.prototype.m = function (a, b) {
        this.j();
    };
    AutomaticSeriesManager.prototype.j = function () {
        if (this.f) {
            return;
        }
        this.f = true;
        try {
            this.k();
        }
        finally {
            this.f = false;
        }
    };
    AutomaticSeriesManager.prototype.k = function () {
        this.g.clear();
        var a = new Dictionary$2(Series.$, Number_$type, 0);
        var b = new Dictionary$2(Series.$, AutomaticSeriesRequest.$, 0);
        for (var c = 0; c < this.c.count; c++) {
            a.addItem(this.c._inner[c], c);
        }
        for (var d = 0; d < this.a.count; d++) {
            this.g.add_1(this.a._inner[d].a);
            b.addItem(this.a._inner[d].d, this.a._inner[d]);
        }
        var e = new List$1(Series.$, 0);
        var f = new List$1(AutomaticSeriesRequest.$, 0);
        var g = new List$1(AutomaticSeriesRequest.$, 0);
        for (var h = 0; h < this.a.count; h++) {
            if (!a.containsKey(this.a._inner[h].d)) {
                f.add(this.a._inner[h]);
            }
        }
        for (var i = 0; i < this.c.count; i++) {
            if (this.c._inner[i].ew && !b.containsKey(this.c._inner[i])) {
                e.add(this.c._inner[i]);
            }
            if (b.containsKey(this.c._inner[i]) && this.d(b.item(this.c._inner[i]), a, b)) {
                e.add(this.c._inner[i]);
                g.add(b.item(this.c._inner[i]));
                f.add(b.item(this.c._inner[i]));
            }
        }
        for (var j = e.count - 1; j >= 0; j--) {
            var k = e._inner[j];
            var l = a.item(k);
            this.c.removeAt(l);
        }
        a.clear();
        for (var m = 0; m < this.c.count; m++) {
            a.addItem(this.c._inner[m], m);
        }
        for (var n = 0; n < f.count; n++) {
            f._inner[n].d.ew = true;
            var o = this.h(f._inner[n], a);
            this.c.insert(o, f._inner[n].d);
            a.item(f._inner[n].d, o);
            for (var p = o; p < this.c.count; p++) {
                var q = this.c._inner[p];
                if (a.containsKey(q)) {
                    a.item(q, p);
                }
            }
        }
    };
    AutomaticSeriesManager.prototype.l = function (a) {
        for (var b = this.a.count - 1; b >= 0; b--) {
            if (this.a._inner[b].a == a) {
                this.a.removeAt(b);
            }
        }
    };
    AutomaticSeriesManager.prototype.h = function (a, b) {
        if (a.f) {
            return 0;
        }
        if (a.e) {
            return this.c.count;
        }
        if (a.c != null) {
            if (!b.containsKey(a.c)) {
                return this.c.count;
            }
            var c = b.item(a.c);
            return c - 1;
        }
        if (a.b != null) {
            if (!b.containsKey(a.b)) {
                return this.c.count;
            }
            var d = b.item(a.b);
            return d + 1;
        }
        return this.c.count;
    };
    AutomaticSeriesManager.prototype.d = function (a, b, c) {
        var d = b.item(a.d);
        if (a.f) {
            for (var e = d; e >= 0; e--) {
                if (!c.containsKey(this.c._inner[e])) {
                    return true;
                }
            }
        }
        if (a.e) {
            for (var f = d; f < this.c.count; f++) {
                if (!c.containsKey(this.c._inner[f])) {
                    return true;
                }
            }
        }
        if (a.c != null) {
            if (!b.containsKey(a.c)) {
                return false;
            }
            var g = b.item(a.c);
            if (d != g - 1) {
                return true;
            }
        }
        if (a.b != null) {
            if (!b.containsKey(a.b)) {
                return false;
            }
            var h = b.item(a.b);
            if (d != h + 1) {
                return true;
            }
        }
        return false;
    };
    Object.defineProperty(AutomaticSeriesManager.prototype, "b", {
        get: function () {
            return this.a;
        },
        enumerable: false,
        configurable: true
    });
    AutomaticSeriesManager.$t = markType(AutomaticSeriesManager, 'AutomaticSeriesManager');
    return AutomaticSeriesManager;
}(Base));
export { AutomaticSeriesManager };
/**
 * @hidden
 */
var AutomaticSeriesRequest = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutomaticSeriesRequest, _super);
    function AutomaticSeriesRequest() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = 0;
        _this.d = null;
        _this.b = null;
        _this.c = null;
        _this.e = false;
        _this.f = false;
        return _this;
    }
    AutomaticSeriesRequest.$t = markType(AutomaticSeriesRequest, 'AutomaticSeriesRequest');
    return AutomaticSeriesRequest;
}(Base));
export { AutomaticSeriesRequest };
/**
 * @hidden
 */
var AutomaticSeriesRequestCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AutomaticSeriesRequestCollection, _super);
    function AutomaticSeriesRequestCollection() {
        return _super.call(this, AutomaticSeriesRequest.$, 0) || this;
    }
    AutomaticSeriesRequestCollection.$t = markType(AutomaticSeriesRequestCollection, 'AutomaticSeriesRequestCollection', ObservableCollection$1.$.specialize(AutomaticSeriesRequest.$));
    return AutomaticSeriesRequestCollection;
}(ObservableCollection$1));
export { AutomaticSeriesRequestCollection };
/**
 * @hidden
 */
var ChartSelection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartSelection, _super);
    function ChartSelection() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this._item = null;
        _this._series = null;
        _this.b = null;
        return _this;
    }
    Object.defineProperty(ChartSelection.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartSelection.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartSelection.prototype, "c", {
        get: function () {
            if (this.b == null && this.series != null) {
                this.b = this.series.cf();
            }
            return this.b;
        },
        set: function (a) {
            this.b = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartSelection.prototype.equals = function (a) {
        var b = typeCast(ChartSelection.$, a);
        if (b == null) {
            return false;
        }
        return b.series == this.series && b.item == this.item;
    };
    ChartSelection.prototype.getHashCode = function () {
        var a = 31;
        if (this.item != null) {
            a ^= Base.getHashCodeStatic(this.item);
        }
        if (this.series != null) {
            a ^= Base.getHashCodeStatic(this.series);
        }
        return a;
    };
    ChartSelection.prototype.g = function (a) {
        if (this.b != null && this.series == null) {
            var b = SeriesMatcherHelper.a(a, this.b);
            if (b != null && b.length > 0) {
                this.series = b[0];
            }
        }
    };
    ChartSelection.$t = markType(ChartSelection, 'ChartSelection');
    return ChartSelection;
}(Base));
export { ChartSelection };
/**
 * @hidden
 */
var ChartSelectedItemCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartSelectedItemCollection, _super);
    function ChartSelectedItemCollection() {
        var _this = _super.call(this, ChartSelection.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    ChartSelectedItemCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    ChartSelectedItemCollection.$t = markType(ChartSelectedItemCollection, 'ChartSelectedItemCollection', ObservableCollection$1.$.specialize(ChartSelection.$));
    return ChartSelectedItemCollection;
}(ObservableCollection$1));
export { ChartSelectedItemCollection };
/**
 * @hidden
 */
var SeriesMatcherHelper = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesMatcherHelper, _super);
    function SeriesMatcherHelper() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    SeriesMatcherHelper.a = function (a, b) {
        var c = new List$1(Series.$, 0);
        a.nu(function (d) {
            if (SeriesMatcherHelper.b(b, d)) {
                c.add(d);
            }
        });
        return c.toArray();
    };
    SeriesMatcherHelper.b = function (a, b) {
        if (a.b >= 0) {
            if (b.index == a.b) {
                return true;
            }
        }
        if (a.e != null) {
            if (Base.equalsStatic(a.e, b.name)) {
                return true;
            }
        }
        if (a.f != null) {
            if (Base.equalsStatic(a.f, b.title)) {
                return true;
            }
        }
        if (a.d != null && a.c != null) {
            var c = a.d;
            if (!stringEndsWith(c, "MemberPath")) {
                c += "MemberPath";
            }
            var d = b.mc(c);
            if (Base.equalsStatic(a.c, d)) {
                return true;
            }
        }
        return false;
    };
    SeriesMatcherHelper.$t = markType(SeriesMatcherHelper, 'SeriesMatcherHelper');
    return SeriesMatcherHelper;
}(Base));
export { SeriesMatcherHelper };
/**
 * @hidden
 */
var SeriesLayer = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayer, _super);
    function SeriesLayer() {
        var _this = _super.call(this) || this;
        _this._source = null;
        _this._target = null;
        _this.z = null;
        _this.n = null;
        _this.u = new Dictionary$2(String_$type, Delegate_$type, 0);
        _this.y = new Dictionary$2(String_$type, Stack$1.$.specialize(Boolean_$type), 0);
        _this.p = false;
        _this.aa = new HashSet$1(SeriesLayerPropertyOverlay.$, 0);
        _this.ab = new HashSet$1(SeriesLayerPropertyOverlay.$, 0);
        _this.v = new Dictionary$2(String_$type, List$1.$.specialize(SeriesLayerPropertyOverlay.$), 0);
        _this.w = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
        _this.x = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
        _this.propertyChanged = null;
        _this.q = false;
        _this.l = new SeriesLayerPropertyOverlayCollection();
        _this.o = false;
        _this.z = new HashSet$1(String_$type, 0);
        _this.z.add_1("FastItemsSource");
        var a = _this.l;
        a.collectionResetting = delegateCombine(a.collectionResetting, runOn(_this, _this.al));
        var b = _this.l;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.ak));
        return _this;
    }
    Object.defineProperty(SeriesLayer.prototype, "source", {
        get: function () {
            return this._source;
        },
        set: function (a) {
            this._source = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesLayer.prototype, "target", {
        get: function () {
            return this._target;
        },
        set: function (a) {
            this._target = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayer.prototype.ak = function (a, b) {
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                if (d == null) {
                    continue;
                }
                var e = d;
                e.propertyUpdated = delegateRemove(e.propertyUpdated, runOn(this, this.av));
                if (this.p && (this.aa.contains(e) || this.ab.contains(e))) {
                    this.aq(e);
                }
            }
        }
        if (b.newItems != null) {
            for (var f = 0; f < b.newItems.count; f++) {
                var g = b.newItems.item(f);
                if (g == null) {
                    continue;
                }
                var h = g;
                if (h.ad != null) {
                    if (h.r) {
                        this.x.item(h.aa, h);
                    }
                    else {
                        this.w.item(h.aa, h);
                    }
                }
                if (h.y != null) {
                    var i = h.y;
                    if (!h.q) {
                        i = Series.nv(i);
                    }
                    if (!this.v.containsKey(i)) {
                        this.v.addItem(i, new List$1(SeriesLayerPropertyOverlay.$, 0));
                    }
                    this.v.item(i).add(h);
                }
                h.propertyUpdated = delegateCombine(h.propertyUpdated, runOn(this, this.av));
            }
        }
        if (this.target != null && this.target.fu) {
            this.a3();
        }
        else {
            this.a5();
        }
    };
    SeriesLayer.prototype.au = function () {
        if (this.target != null) {
            this.target.q7();
        }
    };
    SeriesLayer.prototype.at = function () {
        if (this.target != null) {
            this.target.q5();
        }
    };
    Object.defineProperty(SeriesLayer.prototype, "t", {
        get: function () {
            return this.target != null && this.target.g3;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayer.prototype.a3 = function () {
        var e_64, _a;
        if (this.p) {
            try {
                for (var _b = __values(fromEnum(this.l)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, this.source, this.target);
                    }
                }
            }
            catch (e_64_1) {
                e_64 = { error: e_64_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_64)
                        throw e_64.error;
                }
            }
        }
    };
    SeriesLayer.prototype.a4 = function () {
        var e_65, _a;
        if (this.p) {
            try {
                for (var _b = __values(fromEnum(this.l)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, this.source, null);
                    }
                }
            }
            catch (e_65_1) {
                e_65 = { error: e_65_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_65)
                        throw e_65.error;
                }
            }
        }
    };
    SeriesLayer.prototype.a5 = function () {
        var e_66, _a;
        if (this.p) {
            try {
                for (var _b = __values(fromEnum(this.l)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, null, this.target);
                    }
                }
            }
            catch (e_66_1) {
                e_66 = { error: e_66_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_66)
                        throw e_66.error;
                }
            }
        }
    };
    SeriesLayer.prototype.a2 = function (a, b, c) {
        if (a.p) {
            if (a.r && b != null) {
                if (!this.aa.contains(a)) {
                    this.aa.add_1(a);
                    this.an(a, b);
                }
            }
            else if (!a.r && c != null) {
                if (!this.ab.contains(a)) {
                    this.ab.add_1(a);
                    this.an(a, c);
                }
            }
        }
        else {
            if (a.r) {
                this.aa.add_1(a);
            }
            else {
                this.ab.add_1(a);
            }
        }
    };
    SeriesLayer.prototype.ah = function (a) {
        if (a == null) {
            return null;
        }
        if (this.source == null) {
            return null;
        }
        if (this.x.containsKey(a.name) && this.aa.contains(this.x.item(a.name))) {
            return this.x.item(a.name).w;
        }
        return this.source.c(a);
    };
    SeriesLayer.prototype.an = function (a, b) {
        if (b == null) {
            return;
        }
        var c = a.aa;
        var d = b.tl(c);
        if (d == null) {
            return;
        }
        var e = b.c(d);
        if (!a.r) {
            e = this.ah(d);
        }
        var f = this.ag(e, a, b);
        var g = this.af(a, e, f, b);
        this.ao(b, d, g);
    };
    SeriesLayer.prototype.ag = function (a, b, c) {
        var d = a;
        if (b.y != null) {
            var e = b.y;
            if (!b.q) {
                e = Series.nv(b.y);
            }
            var f = c.tl(e);
            if (f != null) {
                d = c.c(f);
                if (!b.r) {
                    d = this.ah(f);
                }
            }
        }
        return d;
    };
    SeriesLayer.prototype.ao = function (a, b, c) {
        var _this = this;
        if (a.f3(b.name) || a.f3("Actual" + b.name)) {
            this.ar(b.name, function () {
                _this.az(a, b);
                a.h(b, c);
                _this.a0(a, b);
            });
        }
        else {
            this.az(a, b);
            a.h(b, c);
            this.a0(a, b);
        }
    };
    SeriesLayer.prototype.ar = function (a, b) {
        if (this.n == null) {
            this.n = this.source.cv.j();
        }
        if (!this.o) {
            this.o = true;
            this.n.enqueueAction(runOn(this, this.as));
        }
        this.u.item(a, b);
    };
    SeriesLayer.prototype.as = function () {
        var e_67, _a;
        this.o = false;
        var a = new List$1(Delegate_$type, 0);
        try {
            for (var _b = __values(fromEnum(this.u.values)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                a.add(b);
            }
        }
        catch (e_67_1) {
            e_67 = { error: e_67_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_67)
                    throw e_67.error;
            }
        }
        this.u.clear();
        for (var c = 0; c < a.count; c++) {
            var d = a._inner[c];
            d();
        }
    };
    SeriesLayer.prototype.az = function (a, b) {
        var c = b.name;
        var d = null;
        if (!this.y.containsKey(c)) {
            this.y.addItem(c, new Stack$1(Boolean_$type));
        }
        this.y.item(c).h(true);
    };
    SeriesLayer.prototype.a0 = function (a, b) {
        var c = b.name;
        if (this.y.containsKey(c)) {
            this.y.item(c).e();
            if (this.y.item(c).f == 0) {
                this.y.removeItem(c);
            }
        }
    };
    SeriesLayer.prototype.r = function (a, b) {
        if (this.y.containsKey(b.name) && this.y.item(b.name).d()) {
            return true;
        }
        return false;
    };
    SeriesLayer.prototype.af = function (a, b, c, d) {
        return a.t(b, c, d);
    };
    SeriesLayer.prototype.al = function (a, b) {
        for (var c = 0; c < this.l.count; c++) {
            var d = this.l._inner[c];
            if (d == null) {
                continue;
            }
            d.propertyUpdated = delegateRemove(d.propertyUpdated, runOn(this, this.av));
            if (this.p && (this.aa.contains(d) || this.ab.contains(d))) {
                this.aq(d);
            }
        }
    };
    SeriesLayer.prototype.av = function (a, b) {
        var c = a;
        if (b.propertyName == SeriesLayerPropertyOverlay.$$p[0]) {
            if (b.oldValue != null) {
                var d = b.oldValue;
                if (!c.q) {
                    d = Series.nv(d);
                }
                if (this.v.containsKey(d)) {
                    var e = this.v.item(d);
                    e.remove(c);
                    if (e.count == 0) {
                        this.v.removeItem(d);
                    }
                }
            }
            if (b.newValue != null) {
                var f = b.newValue;
                if (!c.q) {
                    f = Series.nv(f);
                }
                if (!this.v.containsKey(f)) {
                    this.v.addItem(f, new List$1(SeriesLayerPropertyOverlay.$, 0));
                }
                this.v.item(f).add(c);
            }
        }
        if (this.aa.contains(c) || this.ab.contains(c)) {
            this.a2(c, this.source, this.target);
        }
    };
    SeriesLayer.prototype.ax = function (a, b, c) {
        this.aw(a, b, c);
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
    };
    SeriesLayer.prototype.am = function (a, b) {
        this.source = a;
        this.target = b;
        this.p = true;
        this.a5();
        var c = this.target;
        c.renderValid = delegateCombine(c.renderValid, runOn(this, this.a1));
        a.propertyUpdated = delegateCombine(a.propertyUpdated, runOn(this, this.ay));
    };
    SeriesLayer.prototype.ay = function (a, b) {
        if (this.p) {
            if (!this.source.gl(b.propertyName)) {
                var c = this.source.tl(b.propertyName);
                if (c != null) {
                    this.ai(this.source, this.target, c, b.newValue);
                }
            }
        }
    };
    SeriesLayer.prototype.a1 = function (a, b) {
        if (this.source == null || this.source.f1()) {
            return;
        }
        this.a4();
        if (this.target != null) {
            var c = this.target;
            c.renderValid = delegateRemove(c.renderValid, runOn(this, this.a1));
        }
    };
    SeriesLayer.prototype.ap = function (a) {
        var e_68, _a;
        var b = this.source;
        b.propertyUpdated = delegateRemove(b.propertyUpdated, runOn(this, this.ay));
        this.p = false;
        var c = new List$1(SeriesLayerPropertyOverlay.$, 1, this.ab);
        c.o(this.aa);
        try {
            for (var _b = __values(fromEnum(c)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                this.aq(d);
            }
        }
        catch (e_68_1) {
            e_68 = { error: e_68_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_68)
                    throw e_68.error;
            }
        }
    };
    SeriesLayer.prototype.aq = function (a) {
        if (a.y != null) {
            if (this.v.containsKey(a.y)) {
                var b = this.v.item(a.y);
                b.remove(a);
                if (b.count == 0) {
                    this.v.removeItem(a.y);
                }
            }
        }
        if (a.r) {
            if (this.x.containsKey(a.aa)) {
                this.x.removeItem(a.aa);
            }
        }
        else {
            if (this.w.containsKey(a.aa)) {
                this.w.removeItem(a.aa);
            }
        }
        if (this.aa.contains(a) || this.ab.contains(a)) {
            if (this.aa.contains(a)) {
                this.aa.remove(a);
            }
            if (this.ab.contains(a)) {
                this.ab.remove(a);
            }
            if (a.r) {
                if (this.source == null) {
                    return;
                }
                var c = this.source.tl(a.aa);
                if (c == null) {
                    return;
                }
                this.ao(this.source, c, a.w);
            }
        }
    };
    SeriesLayer.prototype.aw = function (a, b, c) {
        this.q = true;
    };
    SeriesLayer.prototype.ai = function (a, b, c, d) {
        var e_69, _a;
        var e = d;
        if (this.r(a, c)) {
            return this.ah(c);
        }
        var f = false;
        if (this.s(a, b, c)) {
            f = true;
        }
        if (this.v.containsKey(c.name)) {
            if (this.p) {
                var g = this.v.item(c.name);
                try {
                    for (var _b = __values(fromEnum(g)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var h = _c.value;
                        if (h.y != null) {
                            var i = h.ad;
                            if (!h.q) {
                                i = Series.nv(i);
                            }
                            var j = a.tl(i);
                            var k = a.c(j);
                            k = this.ad(a, b, j, k);
                            if (h.r) {
                                if (!a.gl(c.name)) {
                                    var l = this.ae(a, b, j, k);
                                    this.az(a, c);
                                    this.ao(a, j, l);
                                    this.a0(a, c);
                                }
                            }
                            else {
                                b.h(j, k);
                            }
                        }
                    }
                }
                catch (e_69_1) {
                    e_69 = { error: e_69_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_69)
                            throw e_69.error;
                    }
                }
            }
        }
        if (!f) {
            d = this.ad(a, b, c, d);
            b.h(c, d);
        }
        return e;
    };
    SeriesLayer.prototype.s = function (a, b, c) {
        if (this.z.contains(c.name)) {
            return true;
        }
        if (c.name != null && stringStartsWith(c.name, "Actual")) {
            return true;
        }
        return false;
    };
    SeriesLayer.prototype.ad = function (a, b, c, d) {
        if (this.w.containsKey(c.name)) {
            var e = false;
            if (this.source == null) {
                this.source = a;
                e = true;
            }
            var f = this.w.item(c.name);
            var g = this.ag(d, f, a);
            d = this.w.item(c.name).t(d, g, a);
            if (e) {
                this.source = null;
            }
        }
        return d;
    };
    SeriesLayer.prototype.ae = function (a, b, c, d) {
        if (this.p && this.x.containsKey(c.name)) {
            var e = false;
            if (this.source == null) {
                this.source = a;
                e = true;
            }
            if (this.r(a, c)) {
                d = this.ah(c);
            }
            var f = this.x.item(c.name);
            var g = this.ag(d, f, a);
            d = this.x.item(c.name).t(d, g, a);
            if (e) {
                this.source = null;
            }
        }
        return d;
    };
    Object.defineProperty(SeriesLayer.prototype, "m", {
        get: function () {
            return this.l;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayer.$t = markType(SeriesLayer, 'SeriesLayer', DependencyObject.$, [INotifyPropertyChanged_$type]);
    SeriesLayer.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesLayer, 'ax', ['ZIndex:ac:a6', [1, 0]]);
    return SeriesLayer;
}(DependencyObject));
export { SeriesLayer };
/**
 * @hidden
 */
var SeriesLayerCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerCollection, _super);
    function SeriesLayerCollection() {
        var _this = _super.call(this, SeriesLayer.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    SeriesLayerCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    SeriesLayerCollection.$t = markType(SeriesLayerCollection, 'SeriesLayerCollection', ObservableCollection$1.$.specialize(SeriesLayer.$));
    return SeriesLayerCollection;
}(ObservableCollection$1));
export { SeriesLayerCollection };
/**
 * @hidden
 */
var SeriesLayerManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerManager, _super);
    function SeriesLayerManager() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        return _this;
    }
    SeriesLayerManager.prototype.b = function (a, b) {
        if (b.propertyName == "ZIndex") {
            this.n(this.a);
        }
    };
    SeriesLayerManager.prototype.i = function (a, b) {
        if (b.oldItems != null) {
            for (var c = 0; c < b.oldItems.count; c++) {
                var d = b.oldItems.item(c);
                if (d == null) {
                    continue;
                }
                var e = d;
                e.propertyChanged = delegateRemove(e.propertyChanged, runOn(this, this.b));
            }
        }
        if (b.newItems != null) {
            for (var f = 0; f < b.newItems.count; f++) {
                var g = b.newItems.item(f);
                if (g == null) {
                    continue;
                }
                var h = g;
                h.propertyChanged = delegateCombine(h.propertyChanged, runOn(this, this.b));
            }
        }
        this.n(a);
    };
    SeriesLayerManager.prototype.n = function (a) {
        var e_70, _a, e_71, _b;
        var b = new SeriesLayerCollection();
        try {
            for (var _c = __values(fromEnum(a.ca)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var c = _d.value;
                b.add(c);
            }
        }
        catch (e_70_1) {
            e_70 = { error: e_70_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_70)
                    throw e_70.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(a.cb)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var d = _f.value;
                b.add(d);
            }
        }
        catch (e_71_1) {
            e_71 = { error: e_71_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_71)
                    throw e_71.error;
            }
        }
        var e = function (f, g) {
            if (f.ac < g.ac) {
                return -1;
            }
            else if (f.ac > g.ac) {
                return 1;
            }
            else {
                return 0;
            }
        };
        ArrayExtension.quickSort(b, function (f, g) { return e(f, g); });
        this.m(b, a.actualLayers);
    };
    SeriesLayerManager.prototype.m = function (a, b) {
        var c = new List$1(Number_$type, 0);
        var d = 0;
        for (var e = 0; e < b.count; e++) {
            if (b._inner[e] == null) {
                c.add(e);
                continue;
            }
            if (d > a.count - 1) {
                c.add(e);
                continue;
            }
            if (Base.equalsStatic(b._inner[e], a._inner[d])) {
                d++;
                continue;
            }
            b.insert(e, a._inner[d]);
            d++;
        }
        for (var f = c.count - 1; f >= 0; f--) {
            b.removeAt(f);
        }
        for (; d < a.count; d++) {
            b.add(a._inner[d]);
        }
    };
    SeriesLayerManager.prototype.h = function (a, b, c) {
        this.i(a, c);
    };
    SeriesLayerManager.prototype.j = function (a, b, c) {
        var e_72, _a;
        try {
            for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.b));
            }
        }
        catch (e_72_1) {
            e_72 = { error: e_72_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_72)
                    throw e_72.error;
            }
        }
    };
    SeriesLayerManager.prototype.e = function (a, b, c) {
        this.i(a, c);
    };
    SeriesLayerManager.prototype.f = function (a, b, c) {
        var e_73, _a;
        try {
            for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var d = _c.value;
                d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.b));
            }
        }
        catch (e_73_1) {
            e_73 = { error: e_73_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_73)
                    throw e_73.error;
            }
        }
    };
    SeriesLayerManager.prototype.c = function (a, b, c) {
        var e_74, _a;
        switch (c.action) {
            case 0:
                if (c.newItems != null) {
                    for (var d = 0; d < c.newItems.count; d++) {
                        var e = c.newItems.item(d);
                        this.k(d + c.newStartingIndex, e);
                    }
                }
                break;
            case 1:
                if (c.oldItems != null) {
                    for (var f = 0; f < c.oldItems.count; f++) {
                        var g = c.oldItems.item(f);
                        this.l(g, c.oldStartingIndex);
                    }
                }
                break;
            case 2:
                if (c.oldItems != null) {
                    for (var h = 0; h < c.oldItems.count; h++) {
                        var i = c.oldItems.item(h);
                        this.l(i, c.oldStartingIndex);
                    }
                }
                if (c.newItems != null) {
                    for (var j = 0; j < c.newItems.count; j++) {
                        var k = c.newItems.item(j);
                        this.k(j + c.newStartingIndex, k);
                    }
                }
                break;
            case 4:
                this.g();
                var l = 0;
                try {
                    for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var m = _c.value;
                        var n = m;
                        this.k(l, n);
                        l++;
                    }
                }
                catch (e_74_1) {
                    e_74 = { error: e_74_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_74)
                            throw e_74.error;
                    }
                }
                break;
        }
    };
    SeriesLayerManager.prototype.g = function () {
        var e_75, _a;
        try {
            for (var _b = __values(fromEnum(this.a.actualLayers)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.a.pg(a);
            }
        }
        catch (e_75_1) {
            e_75 = { error: e_75_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_75)
                    throw e_75.error;
            }
        }
    };
    SeriesLayerManager.prototype.l = function (a, b) {
        this.a.pg(a);
    };
    SeriesLayerManager.prototype.k = function (a, b) {
        this.a.bm(a, b);
    };
    SeriesLayerManager.prototype.d = function (a, b, c) {
        this.g();
    };
    SeriesLayerManager.$t = markType(SeriesLayerManager, 'SeriesLayerManager');
    return SeriesLayerManager;
}(Base));
export { SeriesLayerManager };
/**
 * @hidden
 */
var SeriesLayerPropertyOverlay = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerPropertyOverlay, _super);
    function SeriesLayerPropertyOverlay() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.o = false;
        _this.k = null;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.q = false;
        _this.n = false;
        _this.m = false;
        _this.w = null;
        _this.s = null;
        _this.valueResolving = null;
        return _this;
    }
    SeriesLayerPropertyOverlay.prototype.ah = function (a, b, c) {
        this.ag(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));
        }
    };
    SeriesLayerPropertyOverlay.prototype.ag = function (a, b, c) {
        this.n = true;
        switch (a) {
            case SeriesLayerPropertyOverlay.$$p[4]:
                this.m = true;
                break;
            default: break;
        }
    };
    SeriesLayerPropertyOverlay.prototype.t = function (a, b, c) {
        this.w = a;
        var d = this.x;
        if (a == null && this.y != null) {
            a = b;
            if (this.x == null) {
                d = b;
            }
        }
        if (d == this.s && this.s != null) {
            return d;
        }
        if (this.valueResolving != null) {
            var e_76 = a;
            var f = ((function () {
                var $ret = new SeriesLayerPropertyOverlayValueResolvingEventArgs();
                $ret.value = e_76;
                return $ret;
            })());
            if (!this.q) {
                this.ai(f, c);
                d = f.value;
            }
            {
                this.valueResolving(this, f);
            }
            if (f.b) {
                if (!this.q) {
                    this.aj(f, c);
                }
                d = f.value;
            }
        }
        else {
            if (!this.q) {
                d = this.v(d, c);
            }
        }
        this.s = d;
        return d;
    };
    SeriesLayerPropertyOverlay.prototype.aj = function (a, b) {
        var c = b.tl(this.aa);
        if (c == null) {
            return;
        }
        var d = PlatformAPIHelper.n(c.propertyType, a.value);
        a.value = d;
        a.b = false;
    };
    SeriesLayerPropertyOverlay.prototype.v = function (a, b) {
        var c = b.tl(this.aa);
        if (c == null) {
            return a;
        }
        var d = PlatformAPIHelper.n(c.propertyType, a);
        a = d;
        return a;
    };
    SeriesLayerPropertyOverlay.prototype.ai = function (a, b) {
        var c = b.tl(this.aa);
        if (c == null) {
            return;
        }
        var d = PlatformAPIHelper.f(c.propertyType, a.value);
        a.value = d;
        a.b = false;
    };
    SeriesLayerPropertyOverlay.prototype.u = function (a, b) {
        var c = b.tl(this.aa);
        if (c == null) {
            return a;
        }
        var d = PlatformAPIHelper.f(c.propertyType, a);
        a = d;
        return a;
    };
    Object.defineProperty(SeriesLayerPropertyOverlay.prototype, "aa", {
        get: function () {
            if (!this.q) {
                return Series.nv(this.ad);
            }
            return this.ad;
        },
        enumerable: false,
        configurable: true
    });
    SeriesLayerPropertyOverlay.$t = markType(SeriesLayerPropertyOverlay, 'SeriesLayerPropertyOverlay', DependencyObject.$, [INotifyPropertyChanged_$type]);
    SeriesLayerPropertyOverlay.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesLayerPropertyOverlay, 'ah', ['CurrentValuePropertyName:y:ak', [2, null], 'IsAlwaysApplied:p:al', [0, false], 'IsSourceOverlay:r:am', [0, false], 'PropertyName:ad:an', [2, null], 'Value:x:ao', [4]]);
    return SeriesLayerPropertyOverlay;
}(DependencyObject));
export { SeriesLayerPropertyOverlay };
/**
 * @hidden
 */
var SeriesLayerPropertyOverlayCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesLayerPropertyOverlayCollection, _super);
    function SeriesLayerPropertyOverlayCollection() {
        var _this = _super.call(this, SeriesLayerPropertyOverlay.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    SeriesLayerPropertyOverlayCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    SeriesLayerPropertyOverlayCollection.$t = markType(SeriesLayerPropertyOverlayCollection, 'SeriesLayerPropertyOverlayCollection', ObservableCollection$1.$.specialize(SeriesLayerPropertyOverlay.$));
    return SeriesLayerPropertyOverlayCollection;
}(ObservableCollection$1));
export { SeriesLayerPropertyOverlayCollection };
/**
 * @hidden
 */
export var IDataChartToolbarProvider_$type = new Type(null, 'IDataChartToolbarProvider');
/**
 * @hidden
 */
export var ISeriesViewerScrollbarManager_$type = new Type(null, 'ISeriesViewerScrollbarManager');
/**
 * @hidden
 */
export var ISeriesInteractionManager_$type = new Type(null, 'ISeriesInteractionManager');
/**
 * @hidden
 */
export var ISeriesViewerInteractionManager_$type = new Type(null, 'ISeriesViewerInteractionManager');
/**
 * @hidden
 */
export var IDataChartVisualDataManager_$type = new Type(null, 'IDataChartVisualDataManager');
/**
 * @hidden
 */
export var IAxisVisualDataManager_$type = new Type(null, 'IAxisVisualDataManager');
/**
 * @hidden
 */
export var ISeriesVisualDataManager_$type = new Type(null, 'ISeriesVisualDataManager');
/**
 * @hidden
 */
var XamDataChart = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(XamDataChart, _super);
    function XamDataChart() {
        var _this = _super.call(this) || this;
        _this._xsr = null;
        _this.wx = null;
        _this.xy = 1;
        _this.xz = 1;
        _this.xh = false;
        _this.xl = false;
        _this.xk = false;
        _this.x0 = 0;
        _this.x1 = 0;
        _this.yi = NaN;
        _this.yj = NaN;
        _this.ws = new AxisCollection();
        _this.axisRangeChanged = null;
        _this.w6 = null;
        _this.w9 = false;
        _this.xv = 0;
        _this.xx = 0;
        _this.xw = 0;
        _this.xu = 0;
        _this.x3 = NaN;
        _this.x5 = NaN;
        _this.x4 = NaN;
        _this.x2 = NaN;
        _this.ab = XamDataChart.$;
        _this.xk = true;
        var a = _this.axes;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.zp));
        var b = _this.axes;
        b.collectionResetting = delegateCombine(b.collectionResetting, runOn(_this, _this.zq));
        return _this;
    }
    Object.defineProperty(XamDataChart.prototype, "XSRP", {
        get: function () {
            if (this._xsr == null) {
                this._xsr = new SRProvider(this.c9.j.ae);
            }
            return this._xsr;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "wy", {
        get: function () {
            var _this = this;
            if (this.wx == null) {
                this.wx = DVContainer.instance.createInstance(IDataChartVisualDataManager_$type, function () { return _this.XSRP.q; });
            }
            return this.wx;
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.staticInit = function () {
        XamDataChart.yf = -1.7976931348623157E+308;
        XamDataChart.ye = 1.7976931348623157E+308;
    };
    XamDataChart.yr = function (a) {
        if (a.db == null) {
            return -1;
        }
        if (!a.ff) {
            return -1;
        }
        var b = XamDataChartView.aw(a);
        if (b.count == 0) {
            return -1;
        }
        var c = -1;
        for (var d = 0; d < b.count; d++) {
            c = Math.max(c, b._inner[d].index);
        }
        var e = c + 1;
        if (a.isFragment) {
            e = a.j1();
            if (e == -1) {
                return -1;
            }
            var f = a.bp();
            e = f.index + e;
        }
        if (a.bn != null) {
            e = a.j5() + a.bn.index;
            if (e == -1) {
                return -1;
            }
        }
        return e;
    };
    XamDataChart.prototype.qh = function (a, b, c, d) {
        var e_77, _a, e_78, _b, e_79, _c;
        _super.prototype.qh.call(this, a, b, c, d);
        switch (b) {
            case XamDataChart.$$p[23]:
                this.ya = this.yp;
                break;
            case XamDataChart.$$p[24]:
                this.yb = this.yq;
                break;
            case "ActualWindowScaleHorizontal":
            case "ActualWindowScaleVertical":
                if (!this.gc) {
                    this.rv(this.hs(), this.ht());
                }
                break;
            case XamDataChart.$$p[8]:
                this.c9.fr(d);
                {
                    try {
                        for (var _d = __values(fromEnum(this.axes)), _e = _d.next(); !_e.done; _e = _d.next()) {
                            var e = _e.value;
                            e.ia();
                        }
                    }
                    catch (e_77_1) {
                        e_77 = { error: e_77_1 };
                    }
                    finally {
                        try {
                            if (_e && !_e.done && (_a = _d.return))
                                _a.call(_d);
                        }
                        finally {
                            if (e_77)
                                throw e_77.error;
                        }
                    }
                }
                break;
            case XamDataChart.$$p[9]:
                this.xg = this.xf;
                break;
            case XamDataChart.$$p[22]:
                this.xj = this.xs;
                break;
            case XamDataChart.$$p[11]:
            case XamDataChart.$$p[13]:
                this.rr();
                break;
            case XamDataChart.$$p[0]:
            case XamDataChart.$$p[17]:
                if (c != d) {
                    try {
                        for (var _f = __values(fromEnum(this.axes)), _g = _f.next(); !_g.done; _g = _f.next()) {
                            var f = _g.value;
                            f.cq = true;
                            f.ia();
                        }
                    }
                    catch (e_78_1) {
                        e_78 = { error: e_78_1 };
                    }
                    finally {
                        try {
                            if (_g && !_g.done && (_b = _f.return))
                                _b.call(_f);
                        }
                        finally {
                            if (e_78)
                                throw e_78.error;
                        }
                    }
                }
                break;
            case XamDataChart.$$p[7]:
            case XamDataChart.$$p[5]:
            case XamDataChart.$$p[6]:
                try {
                    for (var _h = __values(fromEnum(this.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                        var g = _j.value;
                        g.im();
                    }
                }
                catch (e_79_1) {
                    e_79 = { error: e_79_1 };
                }
                finally {
                    try {
                        if (_j && !_j.done && (_c = _h.return))
                            _c.call(_h);
                    }
                    finally {
                        if (e_79)
                            throw e_79.error;
                    }
                }
                break;
            case XamDataChart.$$p[4]:
                this.zt();
                break;
        }
    };
    XamDataChart.prototype.qz = function () {
        _super.prototype.qz.call(this);
        if (this.wr == 1 || this.wr == 2) {
            this.zx();
        }
    };
    XamDataChart.prototype.ov = function () {
        _super.prototype.ov.call(this);
        if (this.xa && this.wr != 0) {
            if (!this.xr) {
                this.zx();
            }
        }
    };
    XamDataChart.prototype.ok = function (a, b) {
        _super.prototype.ok.call(this, a, b);
        if (this.xa && this.wr == 2) {
            if (!a.isEmpty && !b.isEmpty) {
                if (Math.abs(a.width - b.width) > 1E-10) {
                    if (!this.xr) {
                        this.zx();
                    }
                }
            }
        }
    };
    XamDataChart.prototype.oq = function () {
        _super.prototype.oq.call(this);
        if (this.wu == 1) {
            this.zt();
        }
    };
    XamDataChart.prototype.zy = function () {
        this.zt();
    };
    XamDataChart.prototype.zt = function () {
        var e_80, _a, e_81, _b;
        var a = this.aat();
        this.w9 = false;
        if (!isNaN_(this.yl)) {
            this.x7 = this.yl;
        }
        else {
            this.x7 = a.left;
        }
        if (!isNaN_(this.yn)) {
            this.x9 = this.yn;
        }
        else {
            this.x9 = a.top;
        }
        if (!isNaN_(this.ym)) {
            this.x8 = this.ym;
        }
        else {
            this.x8 = a.right;
        }
        if (!isNaN_(this.yk)) {
            this.x6 = this.yk;
        }
        else {
            this.x6 = a.bottom;
        }
        this.v8 = this.v6(this.wk);
        if (this.w9) {
            this.w9 = false;
            try {
                for (var _c = __values(fromEnum(this.axes)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var b = _d.value;
                    b.cq = true;
                    b.ia();
                }
            }
            catch (e_80_1) {
                e_80 = { error: e_80_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_80)
                        throw e_80.error;
                }
            }
            try {
                for (var _e = __values(fromEnum(this.series)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var c = _f.value;
                    c.rq(false);
                }
            }
            catch (e_81_1) {
                e_81 = { error: e_81_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_81)
                        throw e_81.error;
                }
            }
        }
    };
    XamDataChart.prototype.aat = function () {
        this.z0();
        switch (this.wu) {
            case 1:
                var a = this.aau();
                return a;
            default: return new Thickness(1, 0, 0, 0, 0);
        }
    };
    XamDataChart.prototype.z0 = function () {
        this.b0 = this.w0();
        this.b2 = this.w3();
    };
    XamDataChart.prototype.w3 = function () {
        var e_82, _a;
        var a = 1;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.cl();
                a = this.w2(a, c);
            }
        }
        catch (e_82_1) {
            e_82 = { error: e_82_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_82)
                    throw e_82.error;
            }
        }
        return a;
    };
    XamDataChart.prototype.w2 = function (a, b) {
        switch (a) {
            case 2: return 2;
            case 4:
                if (b == 2 || b == 3) {
                    return 2;
                }
                return a;
            case 3:
                if (b == 2 || b == 4) {
                    return 2;
                }
                return a;
            case 1: return b;
        }
        return a;
    };
    XamDataChart.prototype.w0 = function () {
        var e_83, _a;
        var a = 1;
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = b.ck();
                a = this.wz(a, c);
            }
        }
        catch (e_83_1) {
            e_83 = { error: e_83_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_83)
                    throw e_83.error;
            }
        }
        return a;
    };
    XamDataChart.prototype.wz = function (a, b) {
        switch (a) {
            case 2: return 2;
            case 4:
                if (b == 2 || b == 3) {
                    return 2;
                }
                return a;
            case 3:
                if (b == 2 || b == 4) {
                    return 2;
                }
                return a;
            case 1: return b;
        }
        return a;
    };
    XamDataChart.prototype.aau = function () {
        var a = new Thickness(1, 0, 0, 0, 0);
        for (var b = 0; b < this.series.count; b++) {
            var c = this.series._inner[b];
            var d = c.wt();
            a = new Thickness(1, Math.max(d.left, a.left), Math.max(d.top, a.top), Math.max(d.right, a.right), Math.max(d.bottom, a.bottom));
        }
        return a;
    };
    XamDataChart.prototype.aav = function (a, b) {
        var c = new Thickness(1, 0, 0, 0, 0);
        for (var d = 0; d < this.series.count; d++) {
            var e = this.series._inner[d];
            var f = e.wv(a, b);
            c = new Thickness(1, Math.max(f.left, c.left), Math.max(f.top, c.top), Math.max(f.right, c.right), Math.max(f.bottom, c.bottom));
        }
        return c;
    };
    XamDataChart.prototype.get_ex = function () {
        return this.wu == 1;
    };
    XamDataChart.prototype.hs = function () {
        return this.ya;
    };
    XamDataChart.prototype.ht = function () {
        return this.yb;
    };
    XamDataChart.prototype.rk = function () {
        _super.prototype.rk.call(this);
        this.ya = this.v4.width;
        this.yb = this.v4.height;
    };
    Object.defineProperty(XamDataChart.prototype, "ya", {
        get: function () {
            return this.xy;
        },
        set: function (a) {
            var b = this.xy;
            this.xy = a;
            this.qm("ActualWindowScaleHorizontal", b, this.xy);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yb", {
        get: function () {
            return this.xz;
        },
        set: function (a) {
            var b = this.xz;
            this.xz = a;
            this.qm("ActualWindowScaleVertical", b, this.xz);
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.fl = function () {
        return this.xg;
    };
    XamDataChart.prototype.fm = function () {
        return this.xj;
    };
    Object.defineProperty(XamDataChart.prototype, "xa", {
        get: function () {
            return this.xm || this.xp;
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.get_fu = function () {
        return this.xb;
    };
    Object.defineProperty(XamDataChart.prototype, "xb", {
        get: function () {
            return this.xq || (this.ft && this.wr != 0);
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.get_ft = function () {
        return this.xp;
    };
    XamDataChart.prototype.get_fs = function () {
        return this.xm;
    };
    XamDataChart.prototype.zx = function () {
        this.xh = false;
        this.xl = true;
        this.xk = true;
        for (var a = 0; a < this.axes.count; a++) {
            this.axes._inner[a].cq = true;
            this.axes._inner[a].ia();
        }
    };
    XamDataChart.prototype.zw = function () {
        this.xh = false;
        this.xk = true;
        for (var a = 0; a < this.axes.count; a++) {
            this.axes._inner[a].cq = true;
            this.axes._inner[a].ia();
        }
    };
    XamDataChart.prototype.zv = function (a, b, c, d) {
        if (a.ad == null) {
            return;
        }
        if (a.ad.cq || a.ad.kh.isEmpty) {
            return;
        }
        var e = false;
        for (var f = 0; f < this.axes.count; f++) {
            var g = this.axes._inner[f].aw.bh;
            this.axes._inner[f].aw.ca();
            if (this.axes._inner[f].aw.bh != g) {
                e = true;
            }
        }
        if (e) {
            return;
        }
        if (isNaN_(this.yi)) {
            this.yi = this.c9.a4;
            this.yj = this.c9.a5;
        }
        var h = false;
        var i = false;
        var j = 0;
        if (a.au) {
            var k = this.xk;
            if (this.xp && this.xk) {
                j = this.yo(a, b, c, d);
                this.xk = false;
                if (a.bl() != j) {
                    if (j == 0 && a.ad.b4) {
                        if (k) {
                            this.xl = true;
                            a.ad.id();
                            h = true;
                            i = true;
                        }
                    }
                    else {
                        if ((j > a.bl()) || k) {
                            this.xl = true;
                            a.ad.ij(j);
                            h = true;
                            i = true;
                        }
                    }
                }
            }
        }
        this.ej = h;
        if (a.bl() != 0 || j != 0 || h) {
            var l = a.bl();
            var m = c.left + c.width / 2;
            var n = d.left + d.width / 2;
            if (a.av) {
                m = c.left;
                n = d.left;
            }
            if (l == 0) {
                m = m - a.c3.width / 2;
                n = n - a.c3.width / 2;
            }
            var o = a.cz(new Rect(0, m, c.top, a.c3.width, a.c3.height), l);
            var p = a.cz(new Rect(0, n, d.top, a.c3.width, a.c3.height), l);
            c = o;
            d = p;
        }
        var q = false;
        if (this.xl) {
            this.xl = false;
            q = true;
        }
        this.xh = true;
        var r = 0;
        var s = 0;
        var t = 0;
        var u = c.left + t;
        var v = d.right + t;
        var w = 0;
        w = this.wk.right + this.c9.a5;
        if (u < 0) {
            r = -u;
            r += this.yc;
        }
        if (v > w) {
            s = v - w;
            s += this.yc;
        }
        if (q) {
            if (u > 0) {
                r = -u;
                r += this.yc;
            }
            if (v < w) {
                s = -(w - v);
                s += this.yc;
            }
        }
        var x = false;
        var y = false;
        if (r != 0 || s != 0) {
            x = true;
            this.x0 = this.x0 + r;
            this.x1 = this.x1 + s;
            if (this.x0 > this.yd) {
                this.x0 = this.yd;
                y = true;
            }
            if (this.x1 > this.yd) {
                this.x1 = this.yd;
                y = true;
            }
            if (this.x0 < 0) {
                this.x0 = 0;
                y = true;
            }
            if (this.x1 < 0) {
                this.x1 = 0;
                y = true;
            }
        }
        else {
            if (this.ej) {
                this.zs();
            }
            return;
        }
        this.gb = true;
        this.h2 = this.yi + this.x0;
        this.h7 = this.yj + this.x1;
        this.gb = false;
        this.fq = x;
        if (y) {
            if (q && (this.fq || this.ej)) {
                this.zs();
            }
            return;
        }
        if (this.fq || this.ej) {
            this.zs();
        }
    };
    XamDataChart.prototype.yo = function (a, b, c, d) {
        var e = this.yg(-1, a, b, c, d);
        var f = a.bl();
        if (e < f) {
            var g = c.left + c.width / 2;
            var h = d.left + d.width / 2;
            if (a.av) {
                g = c.left;
                h = d.left;
            }
            var i = a.cz(new Rect(0, g, c.top, a.c3.width, a.c3.height), e);
            var j = a.cz(new Rect(0, h, d.top, a.c3.width, a.c3.height), e);
            if (e == 0) {
                i = new Rect(0, g - a.c3.width / 2, c.top, a.c3.width, a.c3.height);
                j = new Rect(0, h - a.c3.width / 2, d.top, a.c3.width, a.c3.height);
            }
            var k = a.cz(new Rect(0, g, c.top, a.c3.width, a.c3.height), f);
            var l = a.cz(new Rect(0, h, d.top, a.c3.width, a.c3.height), f);
            var m = j.right - l.right;
            var n = 0;
            var o = 0;
            o = this.wk.right + this.c9.a5;
            var p = i.left + n;
            var q = j.right + n;
            var r = 0;
            var s = 0;
            if (p < 0) {
                r = -p;
                r += this.yc;
            }
            if (q > o) {
                s = q - o;
                s += this.yc;
            }
            var t = false;
            if (this.xl || this.xk) {
                t = true;
            }
            if (t) {
                if (p > 0) {
                    r = -p;
                    r += this.yc;
                }
                if (q < o) {
                    s = -(o - q);
                    s += this.yc;
                }
            }
            var u = false;
            var v = false;
            var w = 0;
            var x = 0;
            if (r != 0 || s != 0) {
                v = true;
                w = this.x0 + r;
                x = this.x1 + s;
                if (w > this.yd) {
                    w = this.yd;
                    u = true;
                }
                if (x > this.yd) {
                    x = this.yd;
                    u = true;
                }
                if (w < 0) {
                    w = 0;
                    u = true;
                }
                if (x < 0) {
                    x = 0;
                    u = true;
                }
            }
            var y = this.c9.a4;
            var z = this.c9.a5;
            var aa = new Thickness(1, this.yi + w, 0, this.yj + x, 0);
            var ab = (aa.left - y) + (aa.right - z);
            var ac = a.ad.kb().width;
            var ad = ac - ab;
            var ae = ad / ac;
            var af = a.bn() * ae;
            var ag = this.yg(af, a, b, c, d);
            if (ag == e) {
                return e;
            }
            else {
                return f;
            }
        }
        return e;
    };
    XamDataChart.prototype.yg = function (a, b, c, d, e) {
        var f = b.c3;
        var g = b.bn();
        if (a < 0) {
        }
        if (a > 0) {
            g = a;
        }
        if (f.width < g) {
            return 0;
        }
        var h = 45;
        var i = new Rect(0, 0, f.top, f.width, f.height);
        var j = new Rect(0, g, f.top, f.width, f.height);
        var k = b.ac(i, h);
        var l = b.ac(j, h);
        var m = true;
        for (var n = 0; n < k.length; n++) {
            if (PolygonUtil.a(l, k[n])) {
                m = false;
                break;
            }
        }
        if (!m) {
            h = 90;
        }
        return h;
    };
    XamDataChart.prototype.zs = function () {
        for (var a = 0; a < this.axes.count; a++) {
            this.axes._inner[a].cq = true;
            this.axes._inner[a].ib(false);
        }
        this.nr(true, false, false);
        this.xh = false;
        for (var b = 0; b < this.axes.count; b++) {
            this.axes._inner[b].cq = true;
            this.axes._inner[b].ib(false);
        }
        this.nr(true, false, false);
    };
    Object.defineProperty(XamDataChart.prototype, "axes", {
        get: function () {
            return this.ws;
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.zp = function (a, b) {
        var e_84, _a, e_85, _b, e_86, _c;
        if (b.oldItems != null) {
            try {
                for (var _d = __values(fromEn(b.oldItems)), _e = _d.next(); !_e.done; _e = _d.next()) {
                    var c = _e.value;
                    if (c != null) {
                        c.bo = null;
                        c.bi = null;
                        this.q3(c);
                        this.c9.dw(c);
                        c.rangeChanged = delegateRemove(c.rangeChanged, runOn(this, this.zr));
                        this.c9.dx(c);
                        if (c.df != null) {
                            try {
                                for (var _f = (e_85 = void 0, __values(fromEnum(c.db()))), _g = _f.next(); !_g.done; _g = _f.next()) {
                                    var d = _g.value;
                                    d.rq(false);
                                }
                            }
                            catch (e_85_1) {
                                e_85 = { error: e_85_1 };
                            }
                            finally {
                                try {
                                    if (_g && !_g.done && (_b = _f.return))
                                        _b.call(_f);
                                }
                                finally {
                                    if (e_85)
                                        throw e_85.error;
                                }
                            }
                        }
                    }
                }
            }
            catch (e_84_1) {
                e_84 = { error: e_84_1 };
            }
            finally {
                try {
                    if (_e && !_e.done && (_a = _d.return))
                        _a.call(_d);
                }
                finally {
                    if (e_84)
                        throw e_84.error;
                }
            }
            if (this.axes.count == 0) {
                this.q8();
            }
        }
        if (b.newItems != null) {
            try {
                for (var _h = __values(fromEn(b.newItems)), _j = _h.next(); !_j.done; _j = _h.next()) {
                    var e = _j.value;
                    if (e != null) {
                        this.rn(e);
                        e.bo = this.actualSyncLink;
                        e.bi = this;
                        e.a5.a2();
                        this.c9.bo(e);
                        e.rangeChanged = delegateCombine(e.rangeChanged, runOn(this, this.zr));
                        this.c9.bl(e);
                    }
                }
            }
            catch (e_86_1) {
                e_86 = { error: e_86_1 };
            }
            finally {
                try {
                    if (_j && !_j.done && (_c = _h.return))
                        _c.call(_h);
                }
                finally {
                    if (e_86)
                        throw e_86.error;
                }
            }
        }
        this.oh();
        if (!this.xr && this.fu) {
            this.qz();
        }
    };
    XamDataChart.prototype.zq = function (a, b) {
        var e_87, _a, e_88, _b, e_89, _c, e_90, _d;
        var c = new List$1(Series.$, 0);
        try {
            for (var _e = __values(fromEnum(this.axes)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var d = _f.value;
                if (d.df != null) {
                    try {
                        for (var _g = (e_88 = void 0, __values(fromEnum(d.db()))), _h = _g.next(); !_h.done; _h = _g.next()) {
                            var e = _h.value;
                            if (!c.contains(e)) {
                                c.add(e);
                            }
                        }
                    }
                    catch (e_88_1) {
                        e_88 = { error: e_88_1 };
                    }
                    finally {
                        try {
                            if (_h && !_h.done && (_b = _g.return))
                                _b.call(_g);
                        }
                        finally {
                            if (e_88)
                                throw e_88.error;
                        }
                    }
                }
                d.bo = null;
                d.bi = null;
                this.q3(d);
                this.c9.dw(d);
                d.rangeChanged = delegateRemove(d.rangeChanged, runOn(this, this.zr));
                this.c9.dx(d);
                this.q8();
            }
        }
        catch (e_87_1) {
            e_87 = { error: e_87_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_a = _e.return))
                    _a.call(_e);
            }
            finally {
                if (e_87)
                    throw e_87.error;
            }
        }
        try {
            for (var _j = __values(fromEnum(this.series)), _k = _j.next(); !_k.done; _k = _j.next()) {
                var f = _k.value;
                if (!c.contains(f)) {
                    c.add(f);
                }
            }
        }
        catch (e_89_1) {
            e_89 = { error: e_89_1 };
        }
        finally {
            try {
                if (_k && !_k.done && (_c = _j.return))
                    _c.call(_j);
            }
            finally {
                if (e_89)
                    throw e_89.error;
            }
        }
        try {
            for (var _l = __values(fromEnum(c)), _m = _l.next(); !_m.done; _m = _l.next()) {
                var g = _m.value;
                g.rq(false);
            }
        }
        catch (e_90_1) {
            e_90 = { error: e_90_1 };
        }
        finally {
            try {
                if (_m && !_m.done && (_d = _l.return))
                    _d.call(_l);
            }
            finally {
                if (e_90)
                    throw e_90.error;
            }
        }
    };
    XamDataChart.prototype.zr = function (a, b) {
        var e_91, _a, e_92, _b, e_93, _c;
        var c = typeCast(Axis.$, a);
        if (c == null) {
            return;
        }
        this.oh();
        if (this.axisRangeChanged != null) {
            this.axisRangeChanged(this, new ChartAxisRangeChangedEventArgs(this, c, b.oldMinimumValue, b.minimumValue, b.oldMaximumValue, b.maximumValue));
        }
        if (c.aj != null) {
            c.aj.h7();
        }
        c.h7();
        var d = this.ek;
        if (typeCast(CategoryAxisBase.$, c) !== null) {
            d = true;
        }
        try {
            for (var _d = __values(fromEnum(c.db())), _e = _d.next(); !_e.done; _e = _d.next()) {
                var e = _e.value;
                e.gz = true;
                this.oh();
                e.rq(d);
            }
        }
        catch (e_91_1) {
            e_91 = { error: e_91_1 };
        }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return))
                    _a.call(_d);
            }
            finally {
                if (e_91)
                    throw e_91.error;
            }
        }
        if (c.bi != null) {
            try {
                for (var _f = __values(fromEnum(c.bi.series)), _g = _f.next(); !_g.done; _g = _f.next()) {
                    var f = _g.value;
                    XamDataChart.zu(c, d, f);
                }
            }
            catch (e_92_1) {
                e_92 = { error: e_92_1 };
            }
            finally {
                try {
                    if (_g && !_g.done && (_b = _f.return))
                        _b.call(_f);
                }
                finally {
                    if (e_92)
                        throw e_92.error;
                }
            }
        }
        try {
            for (var _h = __values(fromEnum(this.axes)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var g = _j.value;
                if (g != c && g.aj != null && g.aj == c) {
                    g.h7();
                }
            }
        }
        catch (e_93_1) {
            e_93 = { error: e_93_1 };
        }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return))
                    _c.call(_h);
            }
            finally {
                if (e_93)
                    throw e_93.error;
            }
        }
    };
    XamDataChart.zu = function (a, b, c) {
    };
    XamDataChart.prototype.rt = function (a, b) {
        var e_94, _a;
        _super.prototype.rt.call(this, a, b);
        if (this.axes == null) {
            return;
        }
        try {
            for (var _b = __values(fromEnum(this.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.bo = this.actualSyncLink;
                c.bi = this;
            }
        }
        catch (e_94_1) {
            e_94 = { error: e_94_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_94)
                    throw e_94.error;
            }
        }
    };
    XamDataChart.prototype.getFontInfo = function () {
        this.w6 = this.w5.fo;
        return this.w6;
    };
    XamDataChart.prototype.zz = function () {
        var e_95, _a, e_96, _b;
        this.c9.ee();
        try {
            for (var _c = __values(fromEnum(this.axes)), _d = _c.next(); !_d.done; _d = _c.next()) {
                var a = _d.value;
                a.ib(false);
            }
        }
        catch (e_95_1) {
            e_95 = { error: e_95_1 };
        }
        finally {
            try {
                if (_d && !_d.done && (_a = _c.return))
                    _a.call(_c);
            }
            finally {
                if (e_95)
                    throw e_95.error;
            }
        }
        try {
            for (var _e = __values(fromEnum(this.series)), _f = _e.next(); !_f.done; _f = _e.next()) {
                var b = _f.value;
                b.cv.bl();
                b.rq(false);
            }
        }
        catch (e_96_1) {
            e_96 = { error: e_96_1 };
        }
        finally {
            try {
                if (_f && !_f.done && (_b = _e.return))
                    _b.call(_e);
            }
            finally {
                if (e_96)
                    throw e_96.error;
            }
        }
    };
    XamDataChart.prototype.getFontBrush = function () {
        return this.w5.fw;
    };
    XamDataChart.prototype.nk = function () {
        _super.prototype.nk.call(this);
        var a = new List$1(Axis.$, 0);
        for (var b = 0; b < this.axes.count; b++) {
            a.add(this.axes._inner[b]);
        }
        for (var c = 0; c < a.count; c++) {
            this.axes.remove(a._inner[c]);
            if (typeCast(CategoryAxisBase.$, a._inner[c]) !== null) {
                var d = a._inner[c];
                this.q5(d.name, true);
                d.itemsSource = null;
            }
            a._inner[c].h0(null, null);
        }
    };
    XamDataChart.prototype.u8 = function () {
        return this.w5.fs;
    };
    XamDataChart.prototype.f3 = function () {
        return true;
    };
    XamDataChart.prototype.ro = function () {
        var e_97, _a;
        _super.prototype.ro.call(this);
        if (!this.fo) {
            return;
        }
        try {
            for (var _b = __values(fromEnum(this.axes)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                this.rn(a);
            }
        }
        catch (e_97_1) {
            e_97 = { error: e_97_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_97)
                    throw e_97.error;
            }
        }
    };
    XamDataChart.prototype.ev = function () {
        if (this.xi) {
            return true;
        }
        return this.xe();
    };
    XamDataChart.prototype.xe = function () {
        for (var a = 0; a < this.series.count; a++) {
            if (this.series._inner[a].fs || this.series._inner[a].fo) {
                return true;
            }
        }
        for (var b = 0; b < this.axes.count; b++) {
            if (this.axes._inner[b].b9 || this.axes._inner[b].cm) {
                return true;
            }
        }
        return false;
    };
    XamDataChart.prototype.c8 = function () {
        return new XamDataChartView(this);
    };
    XamDataChart.prototype.p5 = function (a) {
        _super.prototype.p5.call(this, a);
        this.w5 = a;
    };
    XamDataChart.prototype.q0 = function () {
        for (var a = 0; a < this.ws.count; a++) {
            this.ws._inner[a].cq = true;
            this.ws._inner[a].ib(false);
        }
        _super.prototype.q0.call(this);
    };
    Object.defineProperty(XamDataChart.prototype, "x7", {
        get: function () {
            return this.xv;
        },
        set: function (a) {
            var b = this.xv;
            this.xv = a;
            if (this.xv != b) {
                this.w9 = true;
                this.qm(XamDataChart.yu, b, this.xv);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "x9", {
        get: function () {
            return this.xx;
        },
        set: function (a) {
            var b = this.xx;
            this.xx = a;
            if (this.xx != b) {
                this.w9 = true;
                this.qm(XamDataChart.yw, b, this.xx);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "x8", {
        get: function () {
            return this.xw;
        },
        set: function (a) {
            var b = this.xw;
            this.xw = a;
            if (this.xw != b) {
                this.w9 = true;
                this.qm(XamDataChart.yv, b, this.xw);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "x6", {
        get: function () {
            return this.xu;
        },
        set: function (a) {
            var b = this.xu;
            this.xu = a;
            if (this.xu != b) {
                this.w9 = true;
                this.qm(XamDataChart.yt, b, this.xu);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yl", {
        get: function () {
            return this.x3;
        },
        set: function (a) {
            this.x3 = a;
            this.zt();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yn", {
        get: function () {
            return this.x5;
        },
        set: function (a) {
            this.x5 = a;
            this.zt();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "ym", {
        get: function () {
            return this.x4;
        },
        set: function (a) {
            this.x4 = a;
            this.zt();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(XamDataChart.prototype, "yk", {
        get: function () {
            return this.x2;
        },
        set: function (a) {
            this.x2 = a;
            this.zt();
        },
        enumerable: false,
        configurable: true
    });
    XamDataChart.prototype.v6 = function (a) {
        var b = _super.prototype.v6.call(this, a);
        if (a.isEmpty) {
            return Rect.empty;
        }
        if (this.x7 == 0 && this.x9 == 0 && this.x8 == 0 && this.x6 == 0) {
            return b;
        }
        if (this.x7 + this.x8 >= a.width || this.x9 + this.x6 >= a.height) {
            return b;
        }
        var c = new Rect(0, a.left + this.x7, a.top + this.x9, a.width - this.x7 - this.x8, a.height - this.x9 - this.x6);
        if (this.ev()) {
            var d = void 0;
            if (c.width > c.height) {
                var e = intDivide(truncate((c.width - c.height)), 2);
                d = new Rect(0, c.left + e, c.top, c.height, c.height);
            }
            else {
                var f = intDivide(truncate((c.height - c.width)), 2);
                d = new Rect(0, c.left, c.top + f, c.width, c.width);
            }
            return d;
        }
        return c;
    };
    XamDataChart.prototype.wc = function () {
        var a = this.wk;
        var b = this.wl;
        var c = this.v8;
        if (c.isEmpty || a.isEmpty) {
            return a;
        }
        if (c.containsRect(a)) {
            return a;
        }
        if (a.containsRect(c)) {
            return c;
        }
        return a;
    };
    XamDataChart.prototype.ys = function () {
        return this.wy.exportVisualData(this);
    };
    XamDataChart.prototype.y7 = function () {
        var cvd_ = this.ys();
        cvd_.scaleByViewport();
        return (cvd_.serialize());
    };
    XamDataChart.prototype.qe = function () {
        _super.prototype.qe.call(this);
        for (var a = 0; a < this.axes.count; a++) {
            var b = this.axes._inner[a];
            var c = 50;
            if (!isNaN_(b.aw.bh)) {
                c = b.aw.bh;
            }
            b.d4 = c;
        }
    };
    XamDataChart.prototype.q2 = function () {
        _super.prototype.q2.call(this);
        for (var a = 0; a < this.axes.count; a++) {
            var b = this.axes._inner[a];
            b.d4 = NaN;
            b.cq = true;
            b.ib(false);
        }
    };
    XamDataChart.prototype.xt = function (a) {
        var e_98, _a;
        var b = new List$1(Axis.$, 0);
        try {
            for (var _b = __values(fromEnum(this.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = c.aw(a);
                if (d != null) {
                    b.add(d);
                }
            }
        }
        catch (e_98_1) {
            e_98 = { error: e_98_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_98)
                    throw e_98.error;
            }
        }
        return b;
    };
    XamDataChart.$t = markType(XamDataChart, 'XamDataChart', SeriesViewer.$);
    XamDataChart.yf = 0;
    XamDataChart.ye = 0;
    XamDataChart.yu = "ActualPlotAreaMarginLeft";
    XamDataChart.yw = "ActualPlotAreaMarginTop";
    XamDataChart.yv = "ActualPlotAreaMarginRight";
    XamDataChart.yt = "ActualPlotAreaMarginBottom";
    XamDataChart.$$p = markDep(DependencyProperty, PropertyMetadata, XamDataChart, 'qm', ['AlignsGridLinesToPixels:xc:z1', [0, true], 'AutoExpandMarginExtraPadding:yc:z2', [1, DeviceUtils.g(2)], 'AutoExpandMarginMaximumValue:yd:z3', [1, 60], 'AutoMarginAndAngleUpdateMode:wr:z4', [AutoMarginsAndAngleUpdateMode_$type, enumGetBox(AutoMarginsAndAngleUpdateMode_$type, 0)], 'ComputedPlotAreaMarginMode:wu:z5', [ComputedPlotAreaMarginMode_$type, enumGetBox(ComputedPlotAreaMarginMode_$type, 0)], 'DefaultAxisMajorStroke:aaq:z6', [Brush.$, null], 'DefaultAxisMinorStroke:aar:z7', [Brush.$, null], 'DefaultAxisStroke:aas:z8', [Brush.$, null], 'GridMode:ww:z9', [GridMode_$type, enumGetBox(GridMode_$type, 2)], 'HorizontalZoomable:xf:aaa', [0, false], 'InitialCloseGridlinesThreshold:yh:aab', [1, NaN], 'IsHorizontalZoomEnabled:xg:aac', [0, false], 'IsSquare:xi:aad', [0, false], 'IsVerticalZoomEnabled:xj:aae', [0, false], 'SeriesPlotAreaMarginHorizontalMode:w1:aaf', [SeriesPlotAreaMarginHorizontalMode_$type, enumGetBox(SeriesPlotAreaMarginHorizontalMode_$type, 0)], 'SeriesPlotAreaMarginVerticalMode:w4:aag', [SeriesPlotAreaMarginVerticalMode_$type, enumGetBox(SeriesPlotAreaMarginVerticalMode_$type, 0)], 'ShouldAutoExpandMarginForInitialLabels:xm:aah', [0, false], 'ShouldClipGridlines:xn:aai', [0, true], 'ShouldClipInitialCloseGridlines:xo:aaj', [0, true], 'ShouldConsiderAutoRotationForInitialLabels:xp:aak', [0, false], 'ShouldSuppressAxisLabelTruncation:xq:aal', [0, false], 'SuppressAutoMarginAndAngleRecalculation:xr:aam', [0, false], 'VerticalZoomable:xs:aan', [0, false], 'WindowScaleHorizontal:yp:aao', [1, NaN], 'WindowScaleVertical:yq:aap', [1, NaN]]);
    return XamDataChart;
}(SeriesViewer));
export { XamDataChart };
/**
 * @hidden
 */
var LabelPanelArranger = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(LabelPanelArranger, _super);
    function LabelPanelArranger() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    LabelPanelArranger.e = function (a, b) {
        var e_99, _a;
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                var d = c.ad;
                var e = d.aj;
                e = LabelPanelArranger.a(c, d, e);
                var f = LabelPanelArranger.b(c);
                var g = 0;
                var h = 0;
                var i = 0;
                if (d.b8()) {
                    c.af.ac();
                    i = c.bh;
                }
                else {
                    i = c.bi(b);
                }
                g = i;
                h = i;
                if (c.ad.az != null && c.ad.az.visibility != 0) {
                    h = 0;
                    g = 0;
                }
                if (c.aq()) {
                    switch (f) {
                        case 0:
                            b.y = Math.max(0, b.top + h);
                            b.height = Math.max(0, b.height - h);
                            d.az.c = 0;
                            break;
                        case 4:
                            if (e != null && (c.bg - b.top < h && typeCast(HorizontalAxisLabelPanel.$, c) !== null)) {
                                d.az.c = 5;
                            }
                            else {
                                d.az.c = 4;
                            }
                            break;
                        case 5:
                            if (e != null && (b.bottom - c.bg < h && typeCast(HorizontalAxisLabelPanel.$, c) !== null)) {
                                if (d.az != null) {
                                    d.az.c = 4;
                                }
                            }
                            else {
                                if (d.az != null) {
                                    d.az.c = 5;
                                }
                            }
                            break;
                        case 1:
                        default:
                            if (d.az != null) {
                                d.az.c = 1;
                            }
                            b.height = Math.max(0, b.height - h);
                            break;
                    }
                }
                if (typeCast(VerticalAxisLabelPanel.$, c) !== null) {
                    switch (f) {
                        case 3:
                            b.width = Math.max(0, b.width - g);
                            d.az.c = 3;
                            break;
                        case 6:
                            if (e != null && c.bg - b.left < g) {
                                d.az.c = 7;
                            }
                            else {
                                d.az.c = 6;
                            }
                            break;
                        case 7:
                            if (e != null && b.right - c.bg < g) {
                                d.az.c = 6;
                            }
                            else {
                                d.az.c = 7;
                            }
                            break;
                        case 2:
                        default:
                            if (d.az != null) {
                                d.az.c = 2;
                            }
                            b.x = Math.max(0, b.left + g);
                            b.width = Math.max(0, b.width - g);
                            break;
                    }
                }
                if (c.ad.b9) {
                    if (d.az != null) {
                        d.az.c = f;
                    }
                }
            }
        }
        catch (e_99_1) {
            e_99 = { error: e_99_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_99)
                    throw e_99.error;
            }
        }
        return b;
    };
    LabelPanelArranger.a = function (a, b, c) {
        return b.ak();
    };
    LabelPanelArranger.b = function (a) {
        if (a == null) {
            return 1;
        }
        else {
            var b = a.ad;
            if (b != null && b.az != null) {
                var c = b.az.c;
                if (!a.ay(c)) {
                    return a.ai();
                }
                return c;
            }
            else {
                return a.ai();
            }
        }
    };
    LabelPanelArranger.c = function (a, b, c, d) {
        var e = a.ad;
        var f = e.aj;
        f = LabelPanelArranger.a(a, e, f);
        var g = LabelPanelArranger.b(a);
        var h;
        var i = a.bi(c);
        var j = Math.max(0, i);
        var k = Math.max(0, i);
        if (a.ad != null && a.ad.az != null && a.ad.az.visibility == 1) {
            return;
        }
        switch (g) {
            case 3:
                b.g = b.g - k;
                b.d = b.d - k;
                h = new Rect(0, b.g, c.top, k, c.height);
                d(a, h);
                break;
            case 2:
                h = new Rect(0, b.f, c.top, k, c.height);
                d(a, h);
                b.f = b.f + k;
                b.c = b.c + k;
                break;
            case 7:
                if (f != null) {
                    h = new Rect(0, b.f + a.bg, c.top, k, c.height);
                }
                else {
                    b.d = b.d - k;
                    h = new Rect(0, b.d, c.top, k, c.height);
                }
                d(a, h);
                break;
            case 6:
                if (f != null) {
                    h = new Rect(0, b.f + a.bg - k, c.top, k, c.height);
                }
                else {
                    h = new Rect(0, b.c, c.top, k, c.height);
                    b.c = b.c + k;
                }
                d(a, h);
                break;
            case 1:
                b.a = b.a - j;
                b.b = b.b - j;
                h = new Rect(0, c.left, b.a, c.width, j);
                d(a, h);
                break;
            case 0:
                h = new Rect(0, c.left, b.h, c.width, j);
                d(a, h);
                b.h = b.h + j;
                b.e = b.e + j;
                break;
            case 5:
                if (f != null) {
                    h = new Rect(0, c.left, b.h + a.bg, c.width, j);
                }
                else {
                    b.b = b.b - j;
                    h = new Rect(0, c.left, b.b, c.width, j);
                }
                d(a, h);
                break;
            case 4:
                if (f != null) {
                    h = new Rect(0, c.left, b.h + a.bg - j, c.width, j);
                }
                else {
                    h = new Rect(0, c.left, b.e, c.width, j);
                    b.e = b.e + j;
                }
                d(a, h);
                break;
        }
        if (a.ad.b9) {
            h = new Rect(0, c.left, c.top, c.width, c.height);
            d(a, h);
        }
    };
    LabelPanelArranger.d = function (a, b, c, d) {
        var e_100, _a, e_101, _b, e_102, _c;
        var e = new List$1(AxisLabelPanelBase.$, 0);
        var f = new List$1(AxisLabelPanelBase.$, 0);
        try {
            for (var _d = __values(fromEnum(a)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var g = _e.value;
                var h = LabelPanelArranger.b(g);
                switch (h) {
                    case 1:
                    case 2:
                    case 0:
                    case 3:
                        f.add(g);
                        break;
                    case 5:
                    case 6:
                    case 4:
                    case 7:
                        e.add(g);
                        break;
                }
            }
        }
        catch (e_100_1) {
            e_100 = { error: e_100_1 };
        }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return))
                    _a.call(_d);
            }
            finally {
                if (e_100)
                    throw e_100.error;
            }
        }
        try {
            for (var _f = __values(fromEnum(f)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var i = _g.value;
                LabelPanelArranger.c(i, b, c, d);
            }
        }
        catch (e_101_1) {
            e_101 = { error: e_101_1 };
        }
        finally {
            try {
                if (_g && !_g.done && (_b = _f.return))
                    _b.call(_f);
            }
            finally {
                if (e_101)
                    throw e_101.error;
            }
        }
        try {
            for (var _h = __values(fromEnum(e)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var j = _j.value;
                LabelPanelArranger.c(j, b, c, d);
            }
        }
        catch (e_102_1) {
            e_102 = { error: e_102_1 };
        }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return))
                    _c.call(_h);
            }
            finally {
                if (e_102)
                    throw e_102.error;
            }
        }
    };
    LabelPanelArranger.$t = markType(LabelPanelArranger, 'LabelPanelArranger');
    return LabelPanelArranger;
}(Base));
export { LabelPanelArranger };
/**
 * @hidden
 */
var ChartContentManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartContentManager, _super);
    function ChartContentManager(a) {
        var _this = _super.call(this) || this;
        _this.l = null;
        _this.r = new Dictionary$2(ChartContentType_$type, Dictionary$2.$.specialize(DependencyObject.$, ContentInfo.$), 0);
        _this.t = new List$1(Series.$, 0);
        _this.m = false;
        _this.v = null;
        _this.q = false;
        _this.o = false;
        _this.n = false;
        _this.p = false;
        _this.p = true;
        _this.o = true;
        _this.n = true;
        _this.r.addItem(0, new Dictionary$2(DependencyObject.$, ContentInfo.$, 0));
        _this.r.addItem(1, new Dictionary$2(DependencyObject.$, ContentInfo.$, 0));
        _this.r.addItem(2, new Dictionary$2(DependencyObject.$, ContentInfo.$, 0));
        _this.l = a;
        return _this;
    }
    Object.defineProperty(ChartContentManager.prototype, "u", {
        get: function () {
            return this.t;
        },
        set: function (a) {
            this.t = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartContentManager.prototype.k = function (a, b, c) {
        var d = this.j(a, b);
        d.a = c;
        return d;
    };
    ChartContentManager.prototype.ad = function (a, b) {
        var c = this.r.item(a);
        if (c.containsKey(b)) {
            c.removeItem(b);
        }
        var d = typeCast(Series.$, b);
        if (d != null && this.u.contains(d)) {
            this.u.remove(d);
        }
    };
    ChartContentManager.prototype.aa = function (a) {
        var b = this.v;
        this.v = a;
        if (this.m && b == null && this.v != null) {
            this.v.setTimeout(runOn(this, this.w), 0);
        }
    };
    ChartContentManager.prototype.z = function () {
        if (!this.m) {
            this.m = true;
            if (this.v != null) {
                this.v.setTimeout(runOn(this, this.w), 0);
            }
            else {
            }
        }
    };
    ChartContentManager.prototype.ac = function (a, b, c, d) {
        var e = c;
        if (!e.c) {
            e.b = d;
        }
        else {
            if (!d) {
                e.b = false;
            }
        }
        if (!e.c) {
            e.c = true;
            this.z();
        }
    };
    ChartContentManager.prototype.j = function (a, b) {
        var c = this.r.item(a);
        var d = null;
        if (!((function () { var e = c.tryGetValue(b, d); d = e.p1; return e.ret; })())) {
            d = new ContentInfo();
            d.h = b;
            c.addItem(b, d);
            var e = typeCast(Series.$, b);
            if (e != null && !this.u.contains(e)) {
                if (e.isFragment) {
                    var f = e.bp();
                    var g = this.u.indexOf(f) + 1;
                    g += e.j6();
                    if (this.u.count <= g || f.kb() == 0 || g == -1) {
                        this.u.add(e);
                    }
                    else {
                        this.u.insert(g, e);
                    }
                }
                else {
                    this.u.add(e);
                }
            }
        }
        return d;
    };
    ChartContentManager.prototype.y = function () {
        this.w();
    };
    ChartContentManager.prototype.w = function () {
        var e_103, _a;
        if (this.l == null || this.r == null) {
            return;
        }
        if (!this.m) {
            return;
        }
        this.m = false;
        if (this.l != null) {
            this.l.m9();
        }
        try {
            for (var _b = __values(fromEnum(this.s())), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.f();
            }
        }
        catch (e_103_1) {
            e_103 = { error: e_103_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_103)
                    throw e_103.error;
            }
        }
        if (!this.m) {
            this.l.qn();
        }
    };
    ChartContentManager.prototype._s = function () {
        var a, _a, _b, b, e_104_1, c, _c, _d, d, _e, _f, e, _g, _h, f, e_105_1, _j, _k, g, e_106_1;
        var e_104, _l, e_107, _m, e_108, _o, e_105, _p, e_106, _q;
        return __generator(this, function (_r) {
            switch (_r.label) {
                case 0:
                    a = null;
                    a = this.r.item(1);
                    _r.label = 1;
                case 1:
                    _r.trys.push([1, 6, 7, 8]);
                    _a = __values(fromEnum(a.values)), _b = _a.next();
                    _r.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    b = _b.value;
                    return [4 /*yield*/, b];
                case 3:
                    _r.sent();
                    _r.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_104_1 = _r.sent();
                    e_104 = { error: e_104_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_l = _a.return))
                            _l.call(_a);
                    }
                    finally {
                        if (e_104)
                            throw e_104.error;
                    }
                    return [7 /*endfinally*/];
                case 8:
                    a = this.r.item(0);
                    c = new List$1(ContentInfo.$, 0);
                    try {
                        for (_c = __values(fromEnum(this.u)), _d = _c.next(); !_d.done; _d = _c.next()) {
                            d = _d.value;
                            if (!d.es) {
                                c.add(a.item(d));
                            }
                        }
                    }
                    catch (e_107_1) {
                        e_107 = { error: e_107_1 };
                    }
                    finally {
                        try {
                            if (_d && !_d.done && (_m = _c.return))
                                _m.call(_c);
                        }
                        finally {
                            if (e_107)
                                throw e_107.error;
                        }
                    }
                    try {
                        for (_e = __values(fromEnum(this.u)), _f = _e.next(); !_f.done; _f = _e.next()) {
                            e = _f.value;
                            if (e.es) {
                                c.add(a.item(e));
                            }
                        }
                    }
                    catch (e_108_1) {
                        e_108 = { error: e_108_1 };
                    }
                    finally {
                        try {
                            if (_f && !_f.done && (_o = _e.return))
                                _o.call(_e);
                        }
                        finally {
                            if (e_108)
                                throw e_108.error;
                        }
                    }
                    _r.label = 9;
                case 9:
                    _r.trys.push([9, 14, 15, 16]);
                    _g = __values(fromEnum(c)), _h = _g.next();
                    _r.label = 10;
                case 10:
                    if (!!_h.done)
                        return [3 /*break*/, 13];
                    f = _h.value;
                    return [4 /*yield*/, f];
                case 11:
                    _r.sent();
                    _r.label = 12;
                case 12:
                    _h = _g.next();
                    return [3 /*break*/, 10];
                case 13: return [3 /*break*/, 16];
                case 14:
                    e_105_1 = _r.sent();
                    e_105 = { error: e_105_1 };
                    return [3 /*break*/, 16];
                case 15:
                    try {
                        if (_h && !_h.done && (_p = _g.return))
                            _p.call(_g);
                    }
                    finally {
                        if (e_105)
                            throw e_105.error;
                    }
                    return [7 /*endfinally*/];
                case 16:
                    a = this.r.item(2);
                    _r.label = 17;
                case 17:
                    _r.trys.push([17, 22, 23, 24]);
                    _j = __values(fromEnum(a.values)), _k = _j.next();
                    _r.label = 18;
                case 18:
                    if (!!_k.done)
                        return [3 /*break*/, 21];
                    g = _k.value;
                    return [4 /*yield*/, g];
                case 19:
                    _r.sent();
                    _r.label = 20;
                case 20:
                    _k = _j.next();
                    return [3 /*break*/, 18];
                case 21: return [3 /*break*/, 24];
                case 22:
                    e_106_1 = _r.sent();
                    e_106 = { error: e_106_1 };
                    return [3 /*break*/, 24];
                case 23:
                    try {
                        if (_k && !_k.done && (_q = _j.return))
                            _q.call(_j);
                    }
                    finally {
                        if (e_106)
                            throw e_106.error;
                    }
                    return [7 /*endfinally*/];
                case 24: return [2 /*return*/];
            }
        });
    };
    ChartContentManager.prototype.s = function () {
        var _this = this;
        return toEnum(function () { return _this._s(); });
    };
    ChartContentManager.prototype.x = function (a) {
        var e_109, _a, e_110, _b, e_111, _c;
        try {
            for (var _d = __values(fromEnum(this.r.item(1).values)), _e = _d.next(); !_e.done; _e = _d.next()) {
                var b = _e.value;
                b.h.hw(a);
            }
        }
        catch (e_109_1) {
            e_109 = { error: e_109_1 };
        }
        finally {
            try {
                if (_e && !_e.done && (_a = _d.return))
                    _a.call(_d);
            }
            finally {
                if (e_109)
                    throw e_109.error;
            }
        }
        try {
            for (var _f = __values(fromEnum(this.r.item(1).values)), _g = _f.next(); !_g.done; _g = _f.next()) {
                var c = _g.value;
                c.f();
            }
        }
        catch (e_110_1) {
            e_110 = { error: e_110_1 };
        }
        finally {
            try {
                if (_g && !_g.done && (_b = _f.return))
                    _b.call(_f);
            }
            finally {
                if (e_110)
                    throw e_110.error;
            }
        }
        try {
            for (var _h = __values(fromEnum(this.r.item(1).values)), _j = _h.next(); !_j.done; _j = _h.next()) {
                var d = _j.value;
                d.h.il();
            }
        }
        catch (e_111_1) {
            e_111 = { error: e_111_1 };
        }
        finally {
            try {
                if (_j && !_j.done && (_c = _h.return))
                    _c.call(_h);
            }
            finally {
                if (e_111)
                    throw e_111.error;
            }
        }
    };
    ChartContentManager.prototype.ae = function (a, b, c, d) {
        c.i = d;
    };
    ChartContentManager.prototype.ab = function (a, b) {
        if (!b.e) {
            b.e = true;
            this.z();
        }
    };
    ChartContentManager.$t = markType(ChartContentManager, 'ChartContentManager', DependencyObject.$);
    return ChartContentManager;
}(DependencyObject));
export { ChartContentManager };
/**
 * @hidden
 */
var ContentInfo = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ContentInfo, _super);
    function ContentInfo() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.h = null;
        _this.a = null;
        _this.b = false;
        _this.c = false;
        _this.i = null;
        _this.e = false;
        return _this;
    }
    Object.defineProperty(ContentInfo.prototype, "d", {
        get: function () {
            if (this.i.isEmpty) {
                return false;
            }
            if (this.i.width == 0 && this.i.height == 0) {
                return false;
            }
            return true;
        },
        enumerable: false,
        configurable: true
    });
    ContentInfo.prototype.g = function () {
        if (this.e && typeCast(Axis.$, this.h) !== null) {
            this.e = false;
            var a = this.c;
            this.c = true;
            var b = this.h.c2(true);
            if (!b) {
                this.c = a;
            }
        }
    };
    ContentInfo.prototype.f = function () {
        this.g();
        if (typeCast(Axis.$, this.h) !== null) {
            var a = typeCast(Axis.$, this.h);
            if (a.aj != null) {
                var b = a.aj;
                if (b.a6 != null && b.a6.e) {
                    b.a6.g();
                }
            }
        }
        if (this.c) {
            this.c = false;
            this.a(this.b);
            this.b = false;
        }
    };
    ContentInfo.$t = markType(ContentInfo, 'ContentInfo');
    return ContentInfo;
}(Base));
export { ContentInfo };
/**
 * @hidden
 */
var Series = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(Series, _super);
    function Series() {
        var _this = _super.call(this) || this;
        _this.cv = null;
        _this.kf = 0;
        _this.wh = null;
        _this.ew = false;
        _this.jx = null;
        _this.cc = null;
        _this.dq = null;
        _this.bb = null;
        _this.a9 = null;
        _this.dc = null;
        _this.su = null;
        _this.hg = new Dictionary$2(String_$type, String_$type, 0);
        _this.hf = new Dictionary$2(String_$type, FastReflectionHelper.$, 0);
        _this.kh = null;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.d7 = false;
        _this.transitionOutCompleted = null;
        _this.renderRequested = null;
        _this.bt = 1;
        _this.cd = new SeriesLayerPropertyOverlayCollection();
        _this.b4 = null;
        _this.dv = false;
        _this.renderValid = null;
        _this.g0 = false;
        _this.g3 = false;
        _this.gj = false;
        _this.cu = null;
        _this.a1 = null;
        _this.dy = true;
        _this.hu = new Stack$1(String_$type);
        _this.gq = false;
        _this.gr = false;
        _this.dz = false;
        _this.d0 = false;
        _this.as = null;
        _this.at = null;
        _this.d6 = false;
        _this.c2 = null;
        _this.da = null;
        _this.hx = null;
        _this.bh = null;
        _this.dp = null;
        _this.ju = null;
        _this.sr = null;
        _this.a4 = null;
        _this.c1 = 0;
        _this.c0 = 0;
        _this.ea = false;
        _this.dx = false;
        _this.h1 = DeviceUtils.g(1);
        _this.h5 = NaN;
        _this.h2 = NaN;
        _this.h3 = NaN;
        _this.h4 = NaN;
        _this.vf = null;
        _this.vh = null;
        _this.vi = BrushUtil.h(255, 255, 0, 0);
        _this.vg = BrushUtil.h(255, 255, 0, 0);
        _this.ik = DeviceUtils.g(2);
        _this.bw = 1;
        _this.cn = 1;
        _this.cm = 1;
        _this.hz = 0.2;
        _this.h0 = 0.2;
        _this.d2 = false;
        _this.dw = false;
        _this.ef = false;
        _this.ht = null;
        _this.du = false;
        _this.cw = 1;
        _this.cg = 1;
        _this.kk = null;
        _this.d9 = false;
        _this.bq = new SeriesComponentsForView();
        _this.d1 = false;
        _this.k1 = null;
        _this.jw = null;
        _this._coercionMethods = null;
        _this.dt = false;
        _this.b0 = 0;
        _this.bz = 0;
        _this.ds = null;
        _this.v5 = { $type: Point_$type, x: NaN, y: NaN };
        _this.h6 = NaN;
        _this.h7 = NaN;
        _this.hk = new Dictionary$2(SeriesLayer.$, Series.$, 0);
        _this.hq = new List$1(Series.$, 0);
        _this.b5 = null;
        _this.b8 = new SeriesLayerCollection();
        _this.b7 = new SeriesLayerCollection();
        _this.b6 = new SeriesLayerCollection();
        _this.hn = new HashSet$1(String_$type, 0);
        _this.bn = null;
        _this.bk = null;
        _this.hl = new Dictionary$2(String_$type, Number_$type, 0);
        _this.hh = new Dictionary$2(String_$type, Stack$1.$.specialize(Boolean_$type), 0);
        _this.a8 = null;
        DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
        DVContainer.instance.registerIfLoaded("InteractivityFactoryManager");
        DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
        _this.kf = Series.jz++;
        _this.gz = true;
        _this.wh = Rect.empty;
        _this.cv = _this.cs();
        _this.cv.bx = Rect.empty;
        _this.q0(_this.cv);
        _this.cv.n = true;
        _this.cv.au();
        _this.cv.n = false;
        _this.ab = Series.$;
        _this.cc = new SeriesLayerManager();
        _this.cc.a = _this;
        _this.dp = function (a, b) {
            if (_this.db == null || !_this.db.e1) {
                _this.sq(b.oldRect, b.newRect);
            }
        };
        _this.bh = function (a, b) { return _this.q8(a, b.propertyName, b.oldValue, b.newValue); };
        _this.ju = function (a, b) {
            if (_this.db != null) {
                _this.gz = true;
                _this.db.oi();
            }
            _this.pa(b.action, b.position, b.count, b.propertyName);
        };
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.q8(a, b.propertyName, b.oldValue, b.newValue); });
        var a = _this.b8;
        a.collectionResetting = delegateCombine(a.collectionResetting, runOn(_this, _this.ot));
        var b = _this.b8;
        b.collectionChanged = delegateCombine(b.collectionChanged, runOn(_this, _this.os));
        var c = _this.b7;
        c.collectionResetting = delegateCombine(c.collectionResetting, runOn(_this, _this.op));
        var d = _this.b7;
        d.collectionChanged = delegateCombine(d.collectionChanged, runOn(_this, _this.oo));
        var e = _this.b6;
        e.collectionResetting = delegateCombine(e.collectionResetting, runOn(_this, _this.on));
        var f = _this.b6;
        f.collectionChanged = delegateCombine(f.collectionChanged, runOn(_this, _this.om));
        var g = _this.cd;
        g.collectionResetting = delegateCombine(g.collectionResetting, runOn(_this, _this.or));
        var h = _this.cd;
        h.collectionChanged = delegateCombine(h.collectionChanged, runOn(_this, _this.oq));
        _this.su = new Canvas();
        _this.dc = new DoubleAnimator(0, 1, _this.kc);
        var i = _this.dc;
        i.propertyChanged = delegateCombine(i.propertyChanged, runOn(_this, _this.ou));
        _this.g(Series.u2, ((function () {
            var $ret = new Binding(1, "Visibility");
            $ret.d = _this;
            return $ret;
        })()));
        _this.b1 = _this.b2();
        _this.cx = _this.cy();
        return _this;
    }
    Series.prototype.gb = function () {
        if (this.db != null && this.db.f1()) {
            return true;
        }
        return false;
    };
    Series.prototype.get_dataLegendKey = function () {
        if (!stringIsNullOrEmpty(this.name)) {
            return this.name;
        }
        return "Index___" + this.index.toString();
    };
    Object.defineProperty(Series.prototype, "dataLegendKey", {
        get: function () {
            return this.get_dataLegendKey();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "group", {
        get: function () {
            if (this.bn != null && !stringIsNullOrEmpty(this.mi)) {
                return this.mi;
            }
            if (!stringIsNullOrEmpty(this.l2)) {
                return this.l2;
            }
            return this.mb();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "parentKey", {
        get: function () {
            return this.bn != null ? this.bn.dataLegendKey : this.dataLegendKey;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "parentTitle", {
        get: function () {
            if (this.bn != null) {
                return this.bn.title.toString();
            }
            if (this.title != null) {
                return this.title.toString();
            }
            return "SeriesNoTitle";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "jy", {
        get: function () {
            return this.jx;
        },
        set: function (a) {
            this.jx = a;
            this.dc.u(this.jx);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.provideRenderer = function (a) {
        this.jy = a;
    };
    Series.prototype.nd = function () {
        return this.ba.a$u(this);
    };
    Series.prototype.j5 = function () {
        return this.bn.actualLayers.indexOf(this.b5);
    };
    Series.prototype.os = function (a, b) {
        this.cc.h(this, this.b8, b);
    };
    Series.prototype.ot = function (a, b) {
        this.cc.j(this, this.b8, b);
    };
    Series.prototype.oo = function (a, b) {
        this.cc.e(this, this.b8, b);
    };
    Series.prototype.op = function (a, b) {
        this.cc.f(this, this.b8, b);
    };
    Series.prototype.om = function (a, b) {
        this.cc.c(this, this.b8, b);
        if (this.db != null) {
            this.db.ob();
        }
    };
    Series.prototype.on = function (a, b) {
        this.cc.d(this, this.b8, b);
        if (this.db != null) {
            this.db.ob();
        }
    };
    Series.prototype.oq = function (a, b) {
        var e_112, _a;
        switch (b.action) {
            case 0:
                if (b.newItems != null) {
                    for (var c = 0; c < b.newItems.count; c++) {
                        var d = b.newItems.item(c);
                        d.o = true;
                        this.qu(c + b.newStartingIndex, d);
                    }
                }
                break;
            case 1:
                if (b.oldItems != null) {
                    for (var e = 0; e < b.oldItems.count; e++) {
                        var f = b.oldItems.item(e);
                        this.qv(f, b.oldStartingIndex);
                    }
                }
                break;
            case 2:
                if (b.oldItems != null) {
                    for (var g = 0; g < b.oldItems.count; g++) {
                        var h = b.oldItems.item(g);
                        this.qv(h, b.oldStartingIndex);
                    }
                }
                if (b.newItems != null) {
                    for (var i = 0; i < b.newItems.count; i++) {
                        var j = b.newItems.item(i);
                        this.qu(i + b.newStartingIndex, j);
                    }
                }
                break;
            case 4:
                this.qp();
                var k = 0;
                try {
                    for (var _b = __values(fromEnum(this.cd)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var l = _c.value;
                        var m = l;
                        this.qu(k, m);
                        k++;
                    }
                }
                catch (e_112_1) {
                    e_112 = { error: e_112_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_112)
                            throw e_112.error;
                    }
                }
                break;
        }
    };
    Series.prototype.qp = function () {
        var e_113, _a, e_114, _b, e_115, _c;
        var a = this.b4;
        if (a != null) {
            var b = new List$1(SeriesLayerPropertyOverlay.$, 0);
            var c = new List$1(SeriesLayerPropertyOverlay.$, 0);
            try {
                for (var _d = __values(fromEnum(a.m)), _e = _d.next(); !_e.done; _e = _d.next()) {
                    var d = _e.value;
                    if (d.o) {
                        b.add(d);
                    }
                }
            }
            catch (e_113_1) {
                e_113 = { error: e_113_1 };
            }
            finally {
                try {
                    if (_e && !_e.done && (_a = _d.return))
                        _a.call(_d);
                }
                finally {
                    if (e_113)
                        throw e_113.error;
                }
            }
            try {
                for (var _f = __values(fromEnum(b)), _g = _f.next(); !_g.done; _g = _f.next()) {
                    var e = _g.value;
                    a.m.remove(e);
                    if (e.k != null) {
                        c.add(e.k);
                    }
                }
            }
            catch (e_114_1) {
                e_114 = { error: e_114_1 };
            }
            finally {
                try {
                    if (_g && !_g.done && (_b = _f.return))
                        _b.call(_f);
                }
                finally {
                    if (e_114)
                        throw e_114.error;
                }
            }
            try {
                for (var _h = __values(fromEnum(c)), _j = _h.next(); !_j.done; _j = _h.next()) {
                    var f = _j.value;
                    a.m.add(f);
                }
            }
            catch (e_115_1) {
                e_115 = { error: e_115_1 };
            }
            finally {
                try {
                    if (_j && !_j.done && (_c = _h.return))
                        _c.call(_h);
                }
                finally {
                    if (e_115)
                        throw e_115.error;
                }
            }
        }
    };
    Series.prototype.qv = function (a, b) {
        var c = this.b4;
        if (c != null) {
            var d = c.m.indexOf(a);
            if (d >= 0) {
                var e = c.m._inner[d];
                c.m.removeAt(d);
                if (e.k != null) {
                    c.m.insert(d, a);
                }
            }
        }
    };
    Series.prototype.qu = function (a, b) {
        var e_116, _a;
        var c = this.b4;
        if (c != null) {
            var d = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
            try {
                for (var _b = __values(fromEnum(c.m)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    d.addItem(e.ad, b);
                }
            }
            catch (e_116_1) {
                e_116 = { error: e_116_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_116)
                        throw e_116.error;
                }
            }
            if (d.containsKey(b.ad)) {
                b.k = d.item(b.ad);
                c.m.remove(d.item(b.ad));
            }
            c.m.add(b);
        }
    };
    Series.prototype.or = function (a, b) {
        this.qp();
    };
    Series.prototype.sk = function (a) {
    };
    Series.prototype.sj = function (a) {
    };
    Series.prototype.sl = function (a) {
    };
    Series.prototype.ou = function (a, b) {
        this.jp = this.dc.o;
    };
    Object.defineProperty(Series.prototype, "dr", {
        get: function () {
            if (this.dq == null) {
                this.dq = new SRProvider(this.jy);
            }
            if (this.dq.l == null) {
                if (this.jy != null) {
                    this.dq.l = this.jy;
                }
                else if (this.db != null && this.db.c9 != null && this.db.c9.j != null && this.db.c9.j.ae != null) {
                    this.dq.l = this.db.c9.j.ae;
                }
            }
            return this.dq;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "bc", {
        get: function () {
            var _this = this;
            if (this.bb == null) {
                this.bb = DVContainer.instance.createInstance(ISeriesVisualDataManager_$type, function () { return _this.dr.q; });
            }
            return this.bb;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "hm", {
        get: function () {
            return this.ba.a$j;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ba", {
        get: function () {
            var _this = this;
            if (this.a9 == null) {
                this.a9 = DVContainer.instance.createInstance(ISeriesInteractionManager_$type, function () { return _this.dr.n; });
                if (this.toolTip != null) {
                    this.a9.a$as(this, this.toolTip);
                }
            }
            return this.a9;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "fh", {
        get: function () {
            return DVContainer.instance.checkLoaded("InteractivityFactoryManager");
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.q0 = function (a) {
    };
    Series.prototype.qx = function () {
        this.ov(this.a5, this.a5);
        if (this.dn == null && this.c3 != null && this.itemsSource != null) {
            this.dn = this.c3.getFastItemsSource(this.itemsSource);
        }
        this.cv.ax();
    };
    Series.prototype.qy = function () {
        this.o3();
        if (this.dn != null && this.c3 != null && this.itemsSource != null) {
            this.dn = this.c3.releaseFastItemsSource(this.itemsSource);
        }
        this.cv.ay();
    };
    Series.prototype.ct = function () {
        return this.cs();
    };
    Series.prototype.cs = function () {
        return new SeriesView(this);
    };
    Series.prototype.ha = function () {
        return false;
    };
    Series.prototype.kp = function (a, b) {
        return null;
    };
    Series.prototype.mc = function (a) {
        return null;
    };
    Series.prototype.onLegendItemOver = function (a) {
    };
    Series.prototype.onLegendItemPointerUp = function (a) {
    };
    Series.prototype.onLegendItemPointerDown = function (a) {
    };
    Series.prototype.onLegendItemEnter = function (a) {
        if (this.fd && this.fh && this.db != null && (this.db.bd == 0 || this.db.bd == 2) && this.bx != 1) {
            this.ba.a$ab(this, a, { $type: Point_$type, x: NaN, y: NaN }, false, true, false, a == null, this == this.db.bq, false);
        }
    };
    Series.prototype.onLegendItemLeave = function (a) {
        if (this.fd && this.fh && this.db != null && (this.db.bd == 0 || this.db.bd == 2) && this.bx != 1) {
            this.ba.a$ab(this, a, { $type: Point_$type, x: NaN, y: NaN }, false, true, true, a == null, this == this.db.bq, a != null);
        }
    };
    Series.prototype.nc = function (a) {
        if (!this.hg.containsKey(a)) {
            var b = a.substr(0, 1).toUpperCase() + a.substr(1);
            this.hg.addItem(a, b);
        }
        return this.hg.item(a);
    };
    Series.prototype.kq = function (a, b, c) {
        var d = null;
        if (!this.hf.containsKey(b)) {
            d = new FastReflectionHelper(false, c);
            this.hf.addItem(b, d);
        }
        else {
            d = this.hf.item(b);
        }
        d.propertyName = c;
        var e = d.getPropertyValue(a);
        if (this.expectFunctions) {
            var func_ = e;
            var item_ = a;
            if ((typeof func_ === 'function')) {
                e = func_.apply(item_);
            }
        }
        return e;
    };
    Series.prototype.iq = function (a) {
        return this.j2(a);
    };
    Series.prototype.j4 = function (a) {
        return -1;
    };
    Series.prototype.get_fr = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fr", {
        get: function () {
            return this.get_fr();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.a0 = function () {
        return null;
    };
    Series.prototype.j2 = function (a) {
        return -1;
    };
    Series.prototype.wt = function () {
        var a = 1;
        var b = 1;
        if (this.db != null) {
            a = this.db.b0;
            b = this.db.b2;
        }
        return this.wu(a, b);
    };
    Series.prototype.wv = function (a, b) {
        return this.wu(a, b);
    };
    Series.prototype.wu = function (a, b) {
        return new Thickness(1, 0, 0, 0, 0);
    };
    Series.prototype.ck = function () {
        return 1;
    };
    Series.prototype.cl = function () {
        return 1;
    };
    Series.prototype.km = function (a) {
        return null;
    };
    Series.prototype.p3 = function (a, b, c) {
    };
    Series.prototype.ak = function (a, b) {
        return null;
    };
    Series.prototype.kv = function (a, b) {
        return a.km(b);
    };
    Series.prototype.di = function (a, b, c, d) {
        return a.dg(b, c, d);
    };
    Series.prototype.dj = function (a, b, c, d) {
        return a.dh(b, c, d);
    };
    Series.prototype.j1 = function () {
        return -1;
    };
    Series.prototype.j6 = function () {
        return -1;
    };
    Series.prototype.kb = function () {
        return -1;
    };
    Object.defineProperty(Series.prototype, "container", {
        get: function () {
            return this.db;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "hasSubItems", {
        get: function () {
            return this.eh();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.eh = function () {
        if (this.d2 && this.ht != null) {
            return true;
        }
        return false;
    };
    Series.prototype.forSubItems = function (a) {
        this.p1(a);
    };
    Series.prototype.p1 = function (a) {
        var e_117, _a;
        if (this.d2 && this.ht != null) {
            try {
                for (var _b = __values(fromEnum(this.ht)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var b = _c.value;
                    a(b);
                }
            }
            catch (e_117_1) {
                e_117 = { error: e_117_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_117)
                        throw e_117.error;
                }
            }
        }
    };
    Series.prototype.p2 = function (a) {
    };
    Object.defineProperty(Series.prototype, "eg", {
        get: function () {
            return this.b6.count > 0;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.p0 = function (a) {
        for (var b = 0; b < this.hq.count; b++) {
            var c = this.hq._inner[b];
            if (!a(c)) {
                break;
            }
        }
    };
    Series.prototype.nb = function () {
        return null;
    };
    Series.prototype.vv = function () {
        return this.ve;
    };
    Series.prototype.vw = function () {
        return this.vu;
    };
    Series.prototype.resolveLegendIndex = function () {
        return this.index;
    };
    Series.prototype.bp = function () {
        return null;
    };
    Series.prototype.get_es = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "es", {
        get: function () {
            return this.get_es();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ep = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ep", {
        get: function () {
            return this.get_ep();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_eo = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "eo", {
        get: function () {
            return this.get_eo();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_er = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "er", {
        get: function () {
            return this.get_er();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_eq = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "eq", {
        get: function () {
            return this.get_eq();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_et = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "et", {
        get: function () {
            return this.get_et();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isVertical = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isVertical", {
        get: function () {
            return this.get_isVertical();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isFragment = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isFragment", {
        get: function () {
            return this.get_isFragment();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ev = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ev", {
        get: function () {
            return this.get_ev();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_eu = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "eu", {
        get: function () {
            return this.get_eu();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ek = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ek", {
        get: function () {
            return this.get_ek();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f4 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f4", {
        get: function () {
            return this.get_f4();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fj = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fj", {
        get: function () {
            return this.get_fj();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fi = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fi", {
        get: function () {
            return this.get_fi();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fz = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fz", {
        get: function () {
            return this.get_fz();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ez = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ez", {
        get: function () {
            return this.get_ez();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ex = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ex", {
        get: function () {
            return this.get_ex();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f5 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f5", {
        get: function () {
            return this.get_f5();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fq = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fq", {
        get: function () {
            return this.get_fq();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fp = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fp", {
        get: function () {
            return this.get_fp();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fn = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fn", {
        get: function () {
            return this.get_fn();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fm = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fm", {
        get: function () {
            return this.get_fm();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f2 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f2", {
        get: function () {
            return this.get_f2();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_f0 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "f0", {
        get: function () {
            return this.get_f0();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fx = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fx", {
        get: function () {
            return this.get_fx();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fo = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fo", {
        get: function () {
            return this.get_fo();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fv = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fv", {
        get: function () {
            return this.get_fv();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fs = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fs", {
        get: function () {
            return this.get_fs();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isStacked = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isStacked", {
        get: function () {
            return this.get_isStacked();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e6 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e6", {
        get: function () {
            return this.get_e6();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ft = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ft", {
        get: function () {
            return this.get_ft();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ey = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ey", {
        get: function () {
            return this.get_ey();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fb = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fb", {
        get: function () {
            return this.get_fb();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fw = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fw", {
        get: function () {
            return this.get_fw();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isValueOverlay = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "isValueOverlay", {
        get: function () {
            return this.get_isValueOverlay();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fe = function () {
        return this.bn != null;
    };
    Object.defineProperty(Series.prototype, "fe", {
        get: function () {
            return this.get_fe();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isSummarizationSupported = function () {
        return !this.isValueOverlay;
    };
    Object.defineProperty(Series.prototype, "isSummarizationSupported", {
        get: function () {
            return this.get_isSummarizationSupported();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "isLayer", {
        get: function () {
            return this.bn != null;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.bo = function () {
        return null;
    };
    Series.prototype.get_ei = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ei", {
        get: function () {
            return this.get_ei();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e9 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e9", {
        get: function () {
            return this.get_e9();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e8 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e8", {
        get: function () {
            return this.get_e8();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e7 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e7", {
        get: function () {
            return this.get_e7();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fa = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fa", {
        get: function () {
            return this.get_fa();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e1 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e1", {
        get: function () {
            return this.get_e1();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e2 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "e2", {
        get: function () {
            return this.get_e2();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.io = function (a, b, c, d, e) {
        return Number.POSITIVE_INFINITY;
    };
    Series.prototype.ip = function (a, b, c, d, e, f, g) {
        return this.ba.a$m(this, a, b, c, d, e, f, g);
    };
    Series.prototype.get_hc = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "hc", {
        get: function () {
            return this.get_hc();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.i6 = function (a, b, c, d, e, f, g, h) {
        return this.ba.a$p(this, a, b, c, d, e, f, g, h);
    };
    Series.prototype.iu = function (a, b, c, d, e, f, g, h) {
        return this.ba.a$o(this, a, b, c, d, e, f, g, h);
    };
    Series.prototype.ka = function (a, b, c, d, e) {
        return this.ba.a$r(this, a, b, c, d, e);
    };
    Series.prototype.it = function (a) {
        return (a ? 10 : 3);
    };
    Series.prototype.aj = function (a) {
        return null;
    };
    Series.prototype.al = function (a) {
        return null;
    };
    Series.prototype.gu = function (a, b) {
        return this.ba.a$f(this, a, b);
    };
    Series.prototype.an = function (a, b, c, d, e, f) {
        return this.ba.a$b(this, a, b, c, d, e, f);
    };
    Series.prototype.am = function (a, b, c, d, e, f) {
        return this.ba.a$a(this, a, b, c, d, e, f);
    };
    Series.prototype.gw = function (a, b, c) {
        return this.ba.a$g(this, a, b, c);
    };
    Series.prototype.gx = function (a, b) {
        return this.ba.a$h(this, a, b);
    };
    Series.prototype.j8 = function (a, b, c, d, e) {
        return this.ba.a$q(this, a, b, c, d, e);
    };
    Series.prototype.is = function (a, b) {
        return this.ba.a$n(this, a, b);
    };
    Series.prototype.j9 = function (a, b) {
        return -1;
    };
    Series.prototype.j7 = function (a, b) {
        return -1;
    };
    Series.prototype.i4 = function (a, b, c) {
        return NaN;
    };
    Series.prototype.wb = function (a, b, c) {
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    Series.prototype.wm = function (a) {
        return Rect.empty;
    };
    Series.prototype.ao = function (a) {
        var b = this.wm(a);
        if (!b.isEmpty) {
            var c = new Array(1);
            c[0] = b;
            return c;
        }
        return null;
    };
    Series.prototype.wn = function (a) {
        return this.wm(this.wg(a));
    };
    Series.prototype.ap = function (a) {
        return this.ao(this.wg(a));
    };
    Series.prototype.ar = function (a, b) {
        return null;
    };
    Series.prototype.wo = function (a) {
        return Rect.empty;
    };
    Series.prototype.wp = function (a) {
        return this.wo(this.wg(a));
    };
    Series.prototype.gy = function (a, b) {
        return this.ba.a$i(this, a, b);
    };
    Series.prototype.wd = function (a, b, c, d, e, f, g, h, i) {
        return this.ba.a$au(this, a, b, c, d, e, f, g, h, i);
    };
    Series.prototype.i0 = function (a, b, c) {
        return this.i4(a, b, c);
    };
    Series.prototype.v7 = function (a, b, c) {
        return this.wb(a, b, c);
    };
    Series.prototype.i2 = function (a, b, c) {
        return this.i4(a, b, c);
    };
    Series.prototype.v9 = function (a, b, c) {
        return this.wb(a, b, c);
    };
    Series.prototype.wc = function (a, b, c) {
        var d = this.wg(a);
        return this.wb(d, b, c);
    };
    Series.prototype.i5 = function (a, b, c) {
        var d = this.wg(a);
        return this.i4(d, b, c);
    };
    Series.prototype.v8 = function (a, b, c) {
        var d = this.wg(a);
        return this.v7(d, b, c);
    };
    Series.prototype.i1 = function (a, b, c) {
        var d = this.wg(a);
        return this.i0(d, b, c);
    };
    Series.prototype.wa = function (a, b, c) {
        var d = this.wg(a);
        return this.v9(d, b, c);
    };
    Series.prototype.i3 = function (a, b, c) {
        var d = this.wg(a);
        return this.i2(d, b, c);
    };
    Series.prototype.j3 = function (a) {
        var b = this.wg(a);
        return this.j2(b);
    };
    Series.prototype.iv = function () {
        return 0;
    };
    Series.pl = function (a, b, c) {
        if (b != null && b.c9.j.ae != null) {
            b.c9.j.ae.getExternal(a, b.c9.j.ae.rootWrapper, b.c9.j.ae.getExternal(b, null, null));
        }
        var d = a;
    };
    Series.prototype.ir = function (a) {
        var b = this.wg(a);
        return this.iq(b);
    };
    Series.prototype.kn = function (a) {
        var b = this.wg(a);
        return this.km(b);
    };
    Series.prototype.oy = function (a, b) {
        a.kh = b;
    };
    Series.prototype.kz = function (a) {
        return a.kh;
    };
    Series.prototype.au = function (a) {
        if (a && this.as != null) {
            return this.as;
        }
        if (this.at != null) {
            return this.at;
        }
        return this.kh;
    };
    Series.prototype.eb = function (a, b, c, d, e) {
        return false;
    };
    Series.prototype.jc = function (a) {
        var b = this.md();
        if (b == null) {
            return NaN;
        }
        if (a.content == null) {
            return NaN;
        }
        if (a.content.item == null) {
            return NaN;
        }
        return FastItemColumn.i(this.kp(a.content.item, b));
    };
    Series.prototype.jb = function (a) {
        var b = this.md();
        if (b == null) {
            return NaN;
        }
        if (a == null) {
            return NaN;
        }
        return FastItemColumn.i(this.kp(a, b));
    };
    Series.prototype.md = function () {
        return null;
    };
    Series.prototype.i7 = function (a, b) {
        return NaN;
    };
    Series.prototype.aq = function (a) {
        return [NaN, NaN];
    };
    Series.prototype.we = function (a) {
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    Series.prototype.wf = function (a) {
        return { $type: Point_$type, x: NaN, y: NaN };
    };
    Series.prototype.raisePropertyChanged = function (a, b, c) {
        this.r8(a);
        if (this.propertyChanged != null) {
            this.propertyChanged(this, new PropertyChangedEventArgs(a));
        }
        c = this.k2(a, b, c);
        if (this.propertyUpdated != null) {
            if (a == Series.$$p[19] && b != null && c != null) {
                this.d7 = true;
            }
            this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
            if (a == Series.$$p[19] && b != null && c != null) {
                this.d7 = false;
            }
        }
        this.sa(a);
    };
    Series.prototype.k2 = function (a, b, c) {
        this.hn.add_1(a);
        if (this.ec) {
            c = this.kx(a, b, c);
        }
        return c;
    };
    Series.prototype.kx = function (a, b, c) {
        if (this.gl(a)) {
            return c;
        }
        for (var d = 0; d < this.hq.count; d++) {
            var e = this.hq._inner[d];
            var f = e.b5;
            var g = this.tl(a);
            if (g == null) {
                continue;
            }
            c = f.ai(this, e, g, c);
        }
        return c;
    };
    Series.prototype.tl = function (a) {
        if (Series.he.containsKey(a) && Series.he.item(a).containsKey(getInstanceType(this))) {
            return Series.he.item(a).item(getInstanceType(this));
        }
        var b = DependencyProperty.h(a, getInstanceType(this));
        if (b == null) {
            return null;
        }
        if (!Series.he.containsKey(a)) {
            Series.he.addItem(a, new Dictionary$2(Type.$, DependencyProperty.$, 0));
        }
        Series.he.item(a).addItem(getInstanceType(this), b);
        return b;
    };
    Series.prototype.get_hasMarkers = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "hasMarkers", {
        get: function () {
            return this.get_hasMarkers();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_el = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "el", {
        get: function () {
            return this.get_el();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.p6 = function () {
    };
    Series.prototype.p7 = function () {
        this.p6();
    };
    Series.prototype.vm = function (a) {
        if (this.db == null) {
            return this.u8;
        }
        var b = this.db.va(this.index + a);
        b = this.vs(b);
        return b;
    };
    Series.prototype.vs = function (a) {
        if (this.actualLayers != null && this.actualLayers.count > 0) {
            var b = true;
            for (var c = 0; c < this.actualLayers.count; c++) {
                var d = this.actualLayers._inner[c];
                if (!d.target.fu) {
                    b = false;
                }
            }
            if (!b) {
                return a;
            }
            a = BrushUtil.q(a, this.h9);
            return a;
        }
        return a;
    };
    Series.prototype.vp = function (a) {
        if (this.db == null) {
            return this.u8;
        }
        var b = this.db.vg(this.index + a);
        b = this.vs(b);
        return b;
    };
    Series.prototype.vn = function (a) {
        if (this.db == null) {
            return this.u8;
        }
        var b = this.db.ve(this.index + a);
        b = this.vs(b);
        return b;
    };
    Series.prototype.vo = function (a) {
        if (this.db == null) {
            return this.vc;
        }
        var b = this.db.vf(this.index + a);
        b = this.vs(b);
        return b;
    };
    Series.prototype.vk = function () {
        return null;
    };
    Series.prototype.vl = function () {
        return null;
    };
    Series.prototype.sy = function () {
        return null;
    };
    Series.prototype.im = function () {
        return NaN;
    };
    Series.prototype.wg = function (a) {
        var b = this.cv.bx;
        var c = this.cv.by;
        var d = this.cv.getEffectiveViewport();
        var e = { $type: Point_$type, x: ViewportUtils.b(a.x, c, b, d), y: ViewportUtils.g(a.y, c, b, d) };
        return e;
    };
    Series.prototype.wq = function (a) {
        var b = this.wg({ $type: Point_$type, x: a.left, y: a.bottom });
        var c = this.wg({ $type: Point_$type, x: a.right, y: a.top });
        return new Rect(2, b, c);
    };
    Series.prototype.v6 = function (a) {
        var b = this.db != null ? this.db.v7 : this.cv.bx;
        var c = this.cv.by;
        var d = this.cv.getEffectiveViewport();
        var e = ViewportUtils.e(a.x, c, b, d);
        var f = ViewportUtils.i(a.y, c, b, d);
        return { $type: Point_$type, x: e, y: f };
    };
    Series.prototype.kw = function (a, b) {
        var c = this.cv.c(a);
        var d = c != null ? c.item : null;
        if (d == null) {
            var e = this.wg(b);
            d = this.km(e);
        }
        return d;
    };
    Series.prototype.gc = function (a) {
        return false;
    };
    Series.prototype.ay = function (a) {
        return new AxisRange(NaN, NaN);
    };
    Series.prototype.az = function (a) {
        return new AxisRange(NaN, NaN);
    };
    Series.prototype.ws = function () {
        return new Size(1, 0, 0);
    };
    Series.prototype.ax = function (a, b, c) {
        this.px();
        if (!this.isVertical) {
            if (this.ie == 0 && this.ii == 0) {
                return a;
            }
            var d = new ScalerParams(0, c, this.db.wk, b.ch, this.getEffectiveViewport());
            d.b = this.ix();
            var e = b.el(a.c, d);
            var f = b.el(a.b, d);
            if (b.ch) {
                f += this.ie;
                e -= this.ii;
            }
            else {
                f -= this.ii;
                e += this.ie;
            }
            var g = b.eo(e, d);
            var h = b.eo(f, d);
            return new AxisRange(g, h);
        }
        else {
            if (this.ig == 0 && this.ih == 0) {
                return a;
            }
            var i = new ScalerParams(0, c, this.db.wk, b.ch, this.getEffectiveViewport());
            i.b = this.ix();
            var j = b.el(a.c, i);
            var k = b.el(a.b, i);
            if (!b.ch) {
                k += this.ih;
                j -= this.ig;
            }
            else {
                k -= this.ig;
                j += this.ih;
            }
            var l = b.eo(j, i);
            var m = b.eo(k, i);
            return new AxisRange(l, m);
        }
    };
    Series.prototype.px = function () {
        if (isNaN_(this.ii)) {
            var a = this.wv(1, 1);
            this.ii = a.top;
            if (isNaN_(this.ii)) {
                this.ii = 0;
            }
        }
        if (isNaN_(this.ie)) {
            var b = this.wv(1, 1);
            this.ie = b.bottom;
            if (isNaN_(this.ie)) {
                this.ie = 0;
            }
        }
        if (isNaN_(this.ig)) {
            var c = this.wv(1, 1);
            this.ig = c.left;
            if (isNaN_(this.ig)) {
                this.ig = 0;
            }
        }
        if (isNaN_(this.ih)) {
            var d = this.wv(1, 1);
            this.ih = d.right;
            if (isNaN_(this.ih)) {
                this.ih = 0;
            }
        }
    };
    Series.prototype.rq = function (a) {
        this.gq = false;
        if (this.db != null) {
            this.db.ar.ac(0, this, this.a1, a);
            if (this.renderRequested != null) {
                var b = new RenderRequestedEventArgs();
                b.animate = a;
                this.renderRequested(this, b);
                a = b.animate;
            }
        }
    };
    Series.prototype.ph = function (a) {
        this.rr(a);
        if (this.hd(this.cv.bx, this.cv.by, this.cv)) {
            this.ps();
        }
        this.gq = false;
    };
    Object.defineProperty(Series.prototype, "bu", {
        get: function () {
            return this.bt;
        },
        set: function (a) {
            this.bt = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.rr = function (a) {
        {
            this.rd();
        }
        if (this.g2 && !this.gm()) {
            this.g1 = false;
        }
        if (this.g5 && !this.gn()) {
            this.g4 = false;
            this.qz();
        }
    };
    Object.defineProperty(Series.prototype, "ce", {
        get: function () {
            return this.cd;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_em = function () {
        return this.ga();
    };
    Object.defineProperty(Series.prototype, "em", {
        get: function () {
            return this.get_em();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.ga = function () {
        return this.highlightedItemsSource != null;
    };
    Series.prototype.rd = function () {
        var a = false;
        if (this.bn != null) {
            a = true;
        }
        var b = this.bv;
        if (b == 0) {
            if (this.db != null) {
                if (this.db.bt != 0) {
                    b = this.db.bt;
                }
            }
        }
        if (b == 0) {
            b = 1;
        }
        if (!this.em || a) {
            b = 1;
        }
        if (this.bu != b) {
            if (this.bu == 1 && b != 1) {
                this.bu = b;
                this.pj();
            }
            else {
                this.bu = b;
                this.pf();
            }
        }
    };
    Series.prototype.pf = function () {
        if (!this.gs) {
            return;
        }
        if (this.b4 != null) {
            this.b4.au();
        }
    };
    Series.pm = function () {
        if (Series.hi == null) {
            Series.hi = new Dictionary$2(String_$type, String_$type, 0);
            Series.hj = new Dictionary$2(String_$type, String_$type, 0);
            Series.o8(Series.hi, Series.hj);
        }
    };
    Series.nu = function (a) {
        Series.pm();
        if (Series.hi.containsKey(a)) {
            return Series.hi.item(a);
        }
        return PlatformAPIHelper.q(a);
        return a;
    };
    Series.nv = function (a) {
        Series.pm();
        if (Series.hj.containsKey(a)) {
            return Series.hj.item(a);
        }
        return PlatformAPIHelper.r(a);
        return a;
    };
    Series.o8 = function (a, b) {
        Series.hi.item("ItemsSource", "dataSource");
        Series.hj.item("dataSource", "ItemsSource");
        Series.hi.item("HighlightedItemsSource", "highlightedDataSource");
        Series.hj.item("highlightedDataSource", "HighlightedItemsSource");
    };
    Series.prototype.rz = function (a, b) {
        var c = typeCast(Brush.$, b.value);
        if (c == null) {
            return;
        }
        b.value = BrushUtil.q(c, this.h9);
    };
    Series.prototype.rx = function (a, b) {
        var c = typeCast(String_$type, b.value);
        if (c != null) {
            c += this.mg;
            b.value = c;
        }
    };
    Series.prototype.rw = function (a, b) {
        if (this.highlightedItemsSource != null) {
            b.value = this.highlightedItemsSource;
            return;
        }
        b.value = this.itemsSource;
    };
    Series.prototype.ry = function (a, b) {
        var c = this.kc / 1000;
        if (c != 0) {
            b.value = this.kc;
            return;
        }
        b.value = this.kd;
    };
    Series.prototype.get_gs = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "gs", {
        get: function () {
            return this.get_gs();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pj = function () {
        var e_118, _a;
        if (!this.gs) {
            return;
        }
        if (this.b4 == null || !this.ca.contains(this.b4)) {
            var a = new SeriesLayer();
            var b = this.hr();
            try {
                for (var _b = __values(fromEnum(b)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    a.m.add(c);
                }
            }
            catch (e_118_1) {
                e_118 = { error: e_118_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_118)
                        throw e_118.error;
                }
            }
            this.b4 = a;
            this.ca.add(a);
        }
        else {
            this.b4.at();
        }
    };
    Series.prototype.hr = function () {
        var e_119, _a, e_120, _b;
        var a = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "ItemsSource";
            $ret.y = "HighlightedItemsSource";
            $ret.q = true;
            return $ret;
        })());
        a.valueResolving = delegateCombine(a.valueResolving, runOn(this, this.rw));
        var b = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "ShouldAnimateOnDataSourceSwap";
            $ret.q = true;
            $ret.x = true;
            $ret.p = true;
            return $ret;
        })());
        var c = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "TransitionDuration";
            $ret.y = "TransitionInDuration";
            $ret.q = true;
            $ret.p = true;
            return $ret;
        })());
        c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.ry));
        var d = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "Title";
            $ret.p = true;
            $ret.q = true;
            return $ret;
        })());
        d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.rx));
        var e = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.ad = "LegendItemVisibility";
            $ret.q = true;
            $ret.y = "HighlightedLegendItemVisibility";
            $ret.p = true;
            return $ret;
        })());
        e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.p8));
        var f = new List$1(SeriesLayerPropertyOverlay.$, 0);
        var g = this.hs();
        {
            f.add(a);
        }
        f.add(d);
        f.add(b);
        f.add(c);
        f.add(e);
        f.o(g);
        if (this.ce.count > 0) {
            var h = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
            try {
                for (var _c = __values(fromEnum(f)), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var i = _d.value;
                    h.addItem(i.ad, i);
                }
            }
            catch (e_119_1) {
                e_119 = { error: e_119_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_119)
                        throw e_119.error;
                }
            }
            try {
                for (var _e = __values(fromEnum(this.ce)), _f = _e.next(); !_f.done; _f = _e.next()) {
                    var j = _f.value;
                    if (h.containsKey(j.ad)) {
                        j.k = h.item(j.ad);
                        f.remove(h.item(j.ad));
                    }
                    f.add(j);
                }
            }
            catch (e_120_1) {
                e_120 = { error: e_120_1 };
            }
            finally {
                try {
                    if (_f && !_f.done && (_b = _e.return))
                        _b.call(_e);
                }
                finally {
                    if (e_120)
                        throw e_120.error;
                }
            }
        }
        return f;
    };
    Series.prototype.p8 = function (a, b) {
        if (this.ww == 1) {
            b.value = enumGetBox(Visibility_$type, 1);
            return;
        }
        b.value = enumGetBox(Visibility_$type, this.legendItemVisibility);
    };
    Series.prototype.hs = function () {
        return new List$1(SeriesLayerPropertyOverlay.$, 0);
    };
    Object.defineProperty(Series.prototype, "fu", {
        get: function () {
            return this.dv;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.qw = function () {
        if (!this.dv) {
            this.pd();
        }
        this.dv = true;
        if (this.renderValid != null) {
            this.renderValid(this, new RenderValidEventArgs());
        }
    };
    Series.prototype.o0 = function () {
        if (this.g0 && !this.g2) {
            this.dc.r = truncate(Math.max(this.i8(), this.i9()));
            this.o5();
        }
        if (this.g3 && !this.g5) {
            this.dc.r = truncate(Math.max(this.i8(), this.ja()));
            this.o5();
        }
    };
    Series.prototype.qn = function () {
        if (!this.d3()) {
            if (this.db != null) {
                this.db.pu(this);
            }
        }
    };
    Series.prototype.qz = function () {
        if (this.gj) {
            if (this.bn != null) {
                this.bn.rn(this);
            }
            else if (this.db != null) {
                this.db.series.remove(this);
            }
        }
        if (this.bn != null) {
            if (this.bn.gi) {
                if (this.bn.highlightedItemsSource != null) {
                    this.bn.highlightedItemsSource = null;
                }
            }
        }
        if (this.transitionOutCompleted != null) {
            this.transitionOutCompleted(this, new TransitionOutCompletedEventArgs());
        }
    };
    Series.prototype.rn = function (a) {
        if (a.b5 != null) {
            if (this.cb.contains(a.b5)) {
                this.cb.remove(a.b5);
            }
            if (this.ca.contains(a.b5)) {
                this.ca.remove(a.b5);
            }
        }
    };
    Series.prototype.o5 = function () {
    };
    Series.prototype.rs = function (a, b) {
        if (this.cu == null) {
            this.cu = this.cs();
            this.cu.q = true;
            if (this.db != null) {
                this.db.am.o(this.cu);
                this.cu.a = this.db.am;
            }
            this.cu.au();
        }
        this.cu.bx = a;
    };
    Series.prototype.rp = function (a, b, c, d, e) {
        this.ba.a$z(this, a, b, d, e);
    };
    Series.prototype.getEffectiveViewport1 = function (a) {
        if (this.db == null) {
            return Rect.empty;
        }
        if (a.p) {
            return this.db.v8;
        }
        if (a.q) {
            if (this.db.v8.isEmpty) {
                return this.db.v8;
            }
            var b = this.db.wd(a.bx, this.db.wk, this.db.v8);
            return b;
        }
        return this.db.v8;
    };
    Series.prototype.getMainContentViewport = function () {
        return this.wi(this.cv);
    };
    Series.prototype.wi = function (a) {
        if (this.db == null || this.db.v7.isEmpty) {
            return a.bx;
        }
        if (a.p) {
            return a.bx;
        }
        if (a.q) {
            if (this.db.v8.isEmpty) {
                return a.bx;
            }
            if (this.db.v7.equals1(this.db.wk)) {
                return a.bx;
            }
            var b = this.db.wd(a.bx, this.db.wk, this.db.v8);
            var c = this.db.wb(a.bx, b, this.db.v4);
            return c;
        }
        return this.db.v7;
    };
    Series.prototype.wl = function (a) {
        if (!this.wr.equals1(a)) {
            return Rect.empty;
        }
        return this.getEffectiveViewport();
    };
    Series.prototype.wk = function (a) {
        if (this.db == null || this.db.v8.isEmpty) {
            return Rect.empty;
        }
        var b = this.db.v8;
        var c = a.bx;
        var d = (b.left - c.left) / c.width;
        var e = (b.top - c.top) / c.height;
        var f = (b.right - c.left) / c.width;
        var g = (b.bottom - c.top) / c.height;
        return new Rect(0, d, e, f - d, g - e);
    };
    Series.prototype.getEffectiveViewport = function () {
        return this.getEffectiveViewport1(this.cv);
    };
    Series.prototype.rj = function () {
        this.rk(null);
    };
    Series.prototype.get_ed = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "ed", {
        get: function () {
            return this.get_ed();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_ej = function () {
        return this.bx == 2 || this.bx == 4;
    };
    Object.defineProperty(Series.prototype, "ej", {
        get: function () {
            return this.get_ej();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.rk = function (a) {
        if (this.fh) {
            this.ba.a$ak(this, a);
        }
    };
    Series.prototype.rl = function (a) {
        if (this.fh) {
            this.ba.a$al(this, a, this.db);
        }
    };
    Series.prototype.getViewInfo = function (a, b) {
        a = this.cv.bx;
        b = this.cv.by;
        return {
            p0: a,
            p1: b
        };
    };
    Series.prototype.hd = function (a, b, c) {
        if (a.width == 0 || a.height == 0) {
            return false;
        }
        if (this.isFragment) {
            return true;
        }
        return this._visibility == 0;
    };
    Series.prototype.o4 = function (a, b) {
        if (a) {
            this.gz = true;
        }
    };
    Series.prototype.d4 = function () {
        return this.d5(this.cv);
    };
    Series.prototype.d5 = function (a) {
        var b = a.bx;
        var c = a.by;
        if (!this.hd(b, c, a)) {
            this.o4(true, a);
            return true;
        }
        return false;
    };
    Series.prototype.q1 = function (a, b) {
        this.cv.bx = b;
        this.sp(a, b);
        if (this.db != null) {
            this.db.ar.ae(0, this, this.a1, b);
            if (a.isEmpty || a.width == 0 || a.height == 0) {
                this.db.ob();
            }
        }
    };
    Series.prototype.sq = function (a, b) {
    };
    Series.prototype.sp = function (a, b) {
    };
    Object.defineProperty(Series.prototype, "gz", {
        get: function () {
            return this.dy;
        },
        set: function (a) {
            this.dy = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pz = function (a) {
        a.pi(null);
    };
    Series.prototype.ql = function () {
        this.gr = false;
        this.gz = true;
        if (this.db != null) {
            this.db.oi();
        }
    };
    Series.prototype.re = function (a) {
        this.hu.h(a);
        this.sg();
        this.hu.e();
    };
    Series.prototype.qf = function () {
        this.sg();
        this.q2();
    };
    Series.prototype.qk = function () {
        this.gr = false;
        this.gz = true;
        if (this.db != null) {
            this.db.oh();
        }
    };
    Series.prototype.get_ff = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "ff", {
        get: function () {
            return this.get_ff();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_isUsableInLegend = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "isUsableInLegend", {
        get: function () {
            return this.get_isUsableInLegend();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.qs = function () {
        this.cv.aq();
    };
    Series.prototype.qm = function () {
        this.q2();
    };
    Series.prototype.q2 = function () {
        this.cv.a1();
        this.q4(false);
        this.sh();
        if (this.isStacked) {
            this.p2(function (a) {
                a.q2();
                if (a.eg) {
                    a.p0(function (b) {
                        b.q3();
                        return true;
                    });
                }
                return true;
            });
        }
        if (this.eg) {
            this.p0(function (a) {
                a.q3();
                return true;
            });
        }
    };
    Series.prototype.q3 = function () {
        this.cv.a1();
        this.q4(true);
        if (this.isStacked) {
            this.p2(function (a) {
                a.q3();
                if (a.eg) {
                    a.p0(function (b) {
                        b.q3();
                        return true;
                    });
                }
                return true;
            });
        }
        if (this.eg) {
            this.p0(function (a) {
                a.q3();
                return true;
            });
        }
    };
    Series.prototype.f9 = function () {
        return false;
    };
    Series.prototype.q4 = function (a) {
        if (this.a1 == null || this.a1.c) {
            return;
        }
        var b = this.cv.bx;
        var c = this.cv.by;
        var d = this.hd(b, c, this.cv);
        var e = this.db != null && this.db.fh && this.cu != null && this.hd(this.cu.bx, this.cu.by, this.cu);
        if (d) {
            if (a) {
                this.gq = !this.f9();
                this.ph(false);
            }
            else {
                this.rq(false);
                this.gq = !this.f9();
            }
        }
        if (e) {
            if (!this.gz) {
                this.qk();
                this.gr = true;
            }
        }
    };
    Object.defineProperty(Series.prototype, "g1", {
        get: function () {
            return this.dz;
        },
        set: function (a) {
            this.dz = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "g4", {
        get: function () {
            return this.d0;
        },
        set: function (a) {
            this.d0 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "g2", {
        get: function () {
            if (this.g1 == false) {
                return false;
            }
            return this.i9() > 0;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "g5", {
        get: function () {
            if (this.g4 == false) {
                return false;
            }
            return this.ja() > 0;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.v = function () {
        _super.prototype.v.call(this);
        this.raisePropertyChanged("Opacity", this._opacity, this._opacity);
    };
    Series.prototype.w = function (a, b) {
        _super.prototype.w.call(this, a, b);
        this.raisePropertyChanged("Visibility", enumGetBox(Visibility_$type, a), enumGetBox(Visibility_$type, b));
    };
    Series.prototype.qr = function () {
    };
    Series.prototype.qe = function () {
        if (this.db != null) {
            this.db.ob();
        }
    };
    Series.prototype.pv = function () {
        if (this.db != null) {
            for (var a = 0; a < this.db.selectedSeriesItems.count; a++) {
                var b = this.db.selectedSeriesItems._inner[a];
                b.g(this.db);
            }
            for (var c = 0; c < this.db.selectedSeriesItems.count; c++) {
                var d = this.db.selectedSeriesItems._inner[c];
                if (d.series != null && d.series != this) {
                    continue;
                }
                if (d.item == null) {
                    this.pw();
                }
                else {
                    this.pr(d.item);
                }
            }
        }
    };
    Series.prototype.pn = function () {
        if (this.db != null) {
            for (var a = 0; a < this.db.focusedSeriesItems.count; a++) {
                var b = this.db.focusedSeriesItems._inner[a];
                if (b.series != null && b.series != this) {
                    continue;
                }
                this.pq(b.item);
            }
        }
    };
    Series.prototype.q8 = function (a, b, c, d) {
        switch (b) {
            case "SyncLink":
                if (typeCast(SyncLink.$, c) !== null) {
                    var e = c;
                    e.propertyUpdated = delegateRemove(e.propertyUpdated, this.bh);
                    this.ri(typeCast(IFastItemsSourceProvider_$type, c));
                }
                if (typeCast(SyncLink.$, d) !== null) {
                    var f = d;
                    f.propertyUpdated = delegateCombine(f.propertyUpdated, this.bh);
                    this.rh(typeCast(IFastItemsSourceProvider_$type, d));
                }
                if (this.index == -1) {
                    this.index = XamDataChart.yr(this);
                }
                break;
            case Series.$$p[40]:
                this.ch = this.cj();
                this.sf();
                this.pi(null);
                this.q2();
                break;
            case Series.$$p[66]:
                this.d2 = this.g8;
                this.pd();
                this.q2();
                break;
            case SeriesViewer.$$p[1]:
            case SeriesViewer.$$p[19]:
            case SeriesViewer.$$p[18]:
            case SeriesViewer.$$p[20]:
                this.pi(null);
                break;
            case "HighlightingMode":
                this.bx = this.by();
                break;
            case "SelectionMode":
                this.cp = this.cr();
                break;
            case "FocusMode":
                this.co = this.cq();
                break;
            case "SeriesViewer":
                if (typeCast(SeriesViewer.$, c) !== null) {
                    this.jy = null;
                    var g = c;
                    g.windowRectChanged = delegateRemove(g.windowRectChanged, this.dp);
                    var h = c.series;
                    h.collectionChanged = delegateRemove(h.collectionChanged, this.hx);
                    var i = c;
                    i.propertyUpdated = delegateRemove(i.propertyUpdated, this.bh);
                    c.ar.ad(0, this);
                    this.rk(c);
                    this.cv.al(c);
                }
                if (typeCast(SeriesViewer.$, d) !== null) {
                    this.jy = d.c9.j.ae;
                    var j = d;
                    j.windowRectChanged = delegateCombine(j.windowRectChanged, this.dp);
                    var k = d.series;
                    k.collectionChanged = delegateCombine(k.collectionChanged, this.hx);
                    var l = d;
                    l.propertyUpdated = delegateCombine(l.propertyUpdated, this.bh);
                    this.a1 = d.ar.k(0, this, runOn(this, this.ph));
                    this.cv.ag(d);
                    this.bx = this.by();
                    this.cp = this.cr();
                    this.co = this.cq();
                    this.vd = this.vr();
                    this.u9 = this.vq();
                    this.sc();
                    this.pd();
                    if (this.fz) {
                        this.ic = this.jj();
                    }
                    this.pk();
                    this.kf = this.db.i4();
                    this.pv();
                    this.pn();
                }
                if (this.db == null) {
                    this.externalObject._ensureTooltipDestroyed();
                    this.dc.w();
                    if (c != null) {
                        var m = c;
                        m.pu(this);
                    }
                }
                if (this.index != -1) {
                    this.re(null);
                }
                if (this.index == -1 || d == null) {
                    this.index = XamDataChart.yr(this);
                }
                this.a5 = this.a6();
                this.ow(typeCast(SeriesViewer.$, c), typeCast(SeriesViewer.$, d));
                break;
            case Series.$$p[55]:
                if (this.cv != null) {
                    this.cv.a0();
                }
                break;
            case "HitTestMode":
                this.b1 = this.b2();
                break;
            case "ActualHitTestMode":
                if (this.db != null) {
                    this.db.qy();
                }
                break;
            case Series.$$p[25]:
                this.rq(true);
                break;
            case Series.$$p[18]:
            case Series.$$p[24]:
                this.qe();
                break;
            case "LegendItemBadgeTemplate":
            case "LegendItemTemplate":
            case Series.$$p[33]:
            case Series.$$p[32]:
                this.re(b);
                this.q2();
                this.qe();
                break;
            case Series.$$p[37]:
                this.se();
                break;
            case Series.$$p[26]:
                this.sd();
                break;
            case Series.$$p[11]:
            case Series.$$p[12]:
                if (this.lt != null) {
                    this.as = new BindingFormatter();
                    this.as.j = this.lt;
                    this.as.d = this.ag;
                }
                else {
                    this.as = null;
                }
                break;
            case Series.$$p[13]:
            case Series.$$p[14]:
                if (this.lt != null) {
                    this.at = new BindingFormatter();
                    this.at.j = this.lw;
                    this.at.d = this.ah;
                }
                else {
                    this.at = null;
                }
                break;
            case Series.$$p[6]:
            case Series.$$p[15]:
            case Series.$$p[41]:
            case Series.$$p[16]:
            case Series.$$p[17]:
                this.pi(b);
                this.q2();
                break;
            case "Index":
                if (typeGetValue(c) != typeGetValue(d)) {
                    this.qr();
                    this.ch = this.cj();
                    this.sf();
                    this.se();
                    this.pi(null);
                    this.q2();
                }
                break;
            case "RadiusX":
            case "RadiusY":
            case "RoundedCornersLocation":
                this.q2();
                break;
            case Series.$$p[10]:
                this.sc();
                this.q2();
                break;
            case Series.$$p[36]:
            case Series.$$p[35]:
            case Series.$$p[38]:
                this.q2();
                break;
            case Series.$$p[30]:
                this.qs();
                this.q2();
                break;
            case Series.$$p[67]:
            case Series.$$p[46]:
            case Series.$$p[45]:
            case Series.$$p[47]:
            case Series.$$p[48]:
                this.q2();
                break;
            case Series.$$p[54]:
                this.sf();
                if (this.bd == 1) {
                    this.sh();
                }
                break;
            case Series.$$p[3]:
            case Series.$$p[4]:
                this.pd();
                this.q2();
                break;
            case Series.$$p[20]:
                this.u9 = this.vq();
                break;
            case Series.$$p[44]:
                this.vd = this.vr();
                break;
            case Series.$$p[8]:
                this.vi = this.vd;
                this.q2();
                break;
            case Series.$$p[2]:
                this.vg = this.u9;
                this.q2();
                break;
            case Series.$$p[1]:
            case Series.$$p[7]:
            case Series.$$p[9]:
                this.safeActualBrush = this.vt(this.u8);
                this.vf = this.u8;
                this.vh = this.vc;
                this.ik = this.id;
                this.vb = this.vc;
                this.va = this.u8;
                this.q2();
                this.cv.bl();
                if (this.toolTip != null && this.a9 != null) {
                    this.ba.a$as(this, this.toolTip);
                }
                break;
            case "Visibility":
                this.cv.bm();
                break;
            case Series.$$p[21]:
                this.rq(true);
                break;
            case "ItemsSource":
                if (this.c3 != null) {
                    this.rh(this.c3);
                }
                break;
            case Series.$$p[19]:
                this.pd();
                if (c != d && d != null) {
                    if (!this.gf || !this.d7) {
                        this.g1 = true;
                    }
                    this.g4 = false;
                    this.gj = false;
                }
                this.ql();
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    var n = c;
                    n.event = delegateRemove(n.event, this.ju);
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    var o = d;
                    o.event = delegateCombine(o.event, this.ju);
                }
                this.pv();
                this.pn();
                break;
            case "Legend":
                if (d != null) {
                    if (a == this) {
                        d.seriesOwner = this;
                    }
                    else if (typeCast(XamDataChart.$, a) !== null) {
                        d.chartOwner = a;
                    }
                }
                this.a5 = this.a6();
                break;
            case "ActualLegend":
                if (this.a5 != null && this.a5.isItemwise) {
                    this.pd();
                    this.ef = true;
                }
                else {
                    this.ef = false;
                }
                if (c != null && c.isItemwise) {
                    c.clearLegendItemsForSeries(this);
                }
                this.en = this.a5 == null ? false : this.a5.isFinancial;
                this.ov(typeCast(IChartLegend_$type, c), typeCast(IChartLegend_$type, d));
                this.ps();
                break;
            case "LegendItem":
                this.ox(typeCast(Control.$, c), typeCast(Control.$, d));
                break;
            case Series.$$p[34]:
                this.pd();
                this.cv.av();
                this.qe();
                break;
            case Series.$$p[56]:
                if (this.a9 != null || this.fh) {
                    this.ba.a$as(this, this.toolTip);
                }
                break;
            case "CrosshairPoint":
                if (this.db != null) {
                    this.sn(this.db.vv);
                }
                if (this.db != null) {
                    if (!this.d6) {
                        this.db.qq(this, this.km(this.db.vv));
                    }
                }
                break;
            case Series.$$p[42]:
                this.ic = this.jj();
                break;
            case "ActualResolution":
                this.rq(false);
                this.qk();
                break;
            case Series.$$p[71]:
                this.ii = this.jt;
                if (this.db != null) {
                    this.db.n5();
                }
                break;
            case Series.$$p[68]:
                this.ie = this.jq;
                if (this.db != null) {
                    this.db.n5();
                }
                break;
            case Series.$$p[57]:
            case Series.$$p[58]:
                var p = this.dc.f();
                this.dc.w();
                if (p) {
                    this.qn();
                }
                this.dc.r = this.kc;
                this.dc.b = this.dd;
                this.rq(false);
                break;
            case "DiscreteLegendItemTemplate":
                this.rq(false);
                break;
            case "VisibilityProxy":
                if (c != d) {
                    this.rq(false);
                }
                this.qk();
                this.cv.bm();
                break;
            case Series.$$p[31]:
                this.bx = this.by();
                this.rq(false);
                break;
            case Series.$$p[27]:
                this.ia = isNaN_(this.je) ? 0.2 : this.je;
                break;
            case Series.$$p[53]:
                this.pk();
                break;
            case "FinalValue":
                this.sm();
                break;
            case Series.$$p[72]:
                this.cx = this.cy();
                break;
        }
    };
    Series.prototype.vq = function () {
        if (this.vj != null) {
            return this.vj;
        }
        else {
            if (this.db != null && this.db.u7 != null) {
                return this.db.u7;
            }
            else {
                return BrushUtil.h(255, 255, 0, 0);
            }
        }
    };
    Series.prototype.vr = function () {
        if (this.vy != null) {
            return this.vy;
        }
        else {
            if (this.db != null && this.db.vo != null) {
                return this.db.vo;
            }
            else {
                return BrushUtil.h(255, 255, 0, 0);
            }
        }
    };
    Series.prototype.vt = function (a) {
        if (this.gk) {
            return this.cv.bq(a);
        }
        return a;
    };
    Series.prototype.sf = function () {
        var a = this.ch;
        var b = this.jo;
        if (isNaN_(b)) {
            b = DeviceUtils.g(2);
        }
        if (a == 2) {
            b = 1;
        }
        if (this.id != b) {
            this.id = b;
        }
        this.ik = this.id;
    };
    Series.prototype.sn = function (a) {
        if (this.db != null && this.db.fa && this.bx != 1 && this.db.e7) {
            if (isNaN_(a.x) || isNaN_(a.y)) {
                this.ba.a$ab(this, null, a, false, false, false, false, this.db.bq == this, true);
            }
            else {
                this.ba.a$ab(this, this.km(a), a, false, false, false, false, this.db.bq == this, false);
            }
        }
    };
    Series.prototype.pr = function (a) {
        if (this.dn == null) {
            return;
        }
        var b = this.dn.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fh) {
            this.ba.a$x(this, a, b);
        }
    };
    Series.prototype.pw = function () {
        if (this.dn == null) {
            return;
        }
        if (this.fh) {
            this.ba.a$v(this);
        }
    };
    Series.prototype.pu = function () {
        if (this.dn == null) {
            return;
        }
        if (this.fh) {
            this.ba.a$ao(this);
        }
    };
    Series.prototype.pq = function (a) {
        if (this.dn == null) {
            return;
        }
        var b = this.dn.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fh) {
            this.ba.a$w(this, a, b);
        }
    };
    Series.prototype.pp = function (a) {
        if (this.dn == null) {
            return;
        }
        var b = this.dn.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fh) {
            this.ba.a$an(this, a, b);
        }
    };
    Series.prototype.ee = function (a) {
        if (this.dn != null && this.dn.indexOf(a) >= 0) {
            return true;
        }
        return false;
    };
    Series.prototype.po = function (a) {
        if (this.dn == null) {
            return;
        }
        var b = this.dn.indexOf(a);
        if (b < 0) {
            return;
        }
        if (this.fh) {
            this.ba.a$am(this, a, b);
        }
    };
    Series.prototype.pk = function () {
        var vwr_ = this.db;
        if (vwr_ != null) {
            if (vwr_.e8) {
                var host_ = vwr_.ja;
                if (host_ != null) {
                    Series.pl(this, this.db, false);
                    this.externalObject.owner = (this.externalObject.owner) ? this.externalObject.owner : ((host_) ? host_.externalObject : null);
                }
            }
            else {
                Series.pl(this, this.db, false);
                this.externalObject.owner = (this.externalObject.owner) ? this.externalObject.owner : ((vwr_) ? vwr_.externalObject : null);
            }
        }
        if (this.db != null && (this.externalObject.owner)) {
            var sv_ = this.db;
            this.externalObject.owner._ensureDefaultTooltip(this.externalObject);
            ;
        }
    };
    Series.prototype.get_fd = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fd", {
        get: function () {
            return this.get_fd();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pe = function (a) {
        a.d6 = true;
    };
    Object.defineProperty(Series.prototype, "c3", {
        get: function () {
            return this.c2;
        },
        set: function (a) {
            if (this.c3 != a) {
                var b = this.c3;
                this.c2 = a;
                this.raisePropertyChanged("SyncLink", b, this.c3);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "db", {
        get: function () {
            return this.da;
        },
        set: function (a) {
            if (this.db != a) {
                var b = this.db;
                this.da = a;
                this.raisePropertyChanged("SeriesViewer", b, this.da);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "c9", {
        get: function () {
            return typeCast(XamDataChart.$, this.db);
        },
        set: function (a) {
            this.db = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "itemsSource", {
        get: function () {
            return this.c(Series.ty);
        },
        set: function (a) {
            this.h(Series.ty, a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pa = function (a, b, c, d) {
        this.pd();
        if (this.db != null) {
            this.db.qr();
        }
    };
    Object.defineProperty(Series.prototype, "legend", {
        get: function () {
            return this.c(Series.t4);
        },
        set: function (a) {
            this.h(Series.t4, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "st", {
        get: function () {
            if (this.sr == null && this.a5 != null) {
                this.sr = this.ss();
            }
            return this.sr;
        },
        set: function (a) {
            if (this.st != a) {
                var b = this.st;
                this.sr = a;
                this.raisePropertyChanged("LegendItem", b, this.sr);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.ky = function () {
        return this.ss();
    };
    Series.prototype.ss = function () {
        var _this = this;
        var a = typeCast(ContentControl.$, this.sr);
        var b = this.legendItemTemplate;
        if (b == null) {
            b = this.cv.bn(this.c1);
        }
        if (b != null) {
            if (a == null) {
                a = new ContentControl();
            }
            a.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = null;
                return $ret;
            })());
            a.ah = b;
        }
        else {
            a = null;
        }
        return a;
    };
    Object.defineProperty(Series.prototype, "a5", {
        get: function () {
            return this.a4;
        },
        set: function (a) {
            if (this.a5 != a) {
                var b = this.a4;
                this.a4 = a;
                this.raisePropertyChanged("ActualLegend", b, this.a4);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "legendItemBadgeTemplate", {
        get: function () {
            return this.c(Series.t1);
        },
        set: function (a) {
            this.h(Series.t1, a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sx = function () {
        return this.legendItemBadgeTemplate;
    };
    Object.defineProperty(Series.prototype, "legendItemTemplate", {
        get: function () {
            return this.c(Series.t2);
        },
        set: function (a) {
            this.h(Series.t2, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "sw", {
        get: function () {
            return this.c(Series.ti);
        },
        set: function (a) {
            this.h(Series.ti, a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "index", {
        get: function () {
            return typeGetValue(this.c(Series.tt));
        },
        set: function (a) {
            this.h(Series.tt, a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.so = function () {
        this.re(null);
    };
    Series.prototype.pi = function (a) {
        this.re(a);
    };
    Series.prototype.fg = function (a, b, c, d) {
        if (!BrushUtil.d(c, d)) {
            return true;
        }
        return false;
    };
    Series.prototype.sg = function () {
        this.qk();
        if (this.index < 0) {
            return;
        }
        if (this.ve != null) {
            this.r7("ActualBrush");
            var a = this.u8;
            this.cv.a9();
            this.cv.ai();
            var b = this.u8;
            var c = this.fg("ActualBrush", this.hu.f > 0 ? this.hu.d() : null, a, b);
            this.r9("ActualBrush", c);
        }
        else {
            this.u8 = this.db == null ? null : this.db.va(this.index);
        }
        if (this.ch == 2) {
            this.r7("ActualOutline");
            var d = this.vc;
            this.cv.ba();
            this.vc = this.u8;
            var e = this.vc;
            var f = this.fg("ActualOutline", this.hu.f > 0 ? this.hu.d() : null, d, e);
            this.r9("ActualOutline", f);
        }
        else {
            if (this.vu != null) {
                this.r7("ActualOutline");
                var g = this.vc;
                this.cv.ba();
                this.cv.aj();
                var h = this.vc;
                var i = this.fg("ActualOutline", this.hu.f > 0 ? this.hu.d() : null, g, h);
                this.r9("ActualOutline", i);
            }
            else {
                this.vc = this.db == null ? null : this.db.vg(this.index);
            }
        }
        if ((this.fv || this.fb) && this.fq) {
            this.u8 = this.vc;
        }
        else if ((this.fv || this.fb) && this.eu) {
            this.vc = this.u8;
        }
        else if ((this.fv || this.fb) && this.fi) {
            this.vc = this.u8;
        }
        else if (this.f2 && this.legendItemBadgeShape == 2) {
            this.u8 = this.vc;
        }
    };
    Series.prototype.d3 = function () {
        return this.dc.f();
    };
    Series.prototype.r6 = function () {
        this.dc.v();
    };
    Object.defineProperty(Series.prototype, "ic", {
        get: function () {
            if (!this.dx) {
                this.dx = true;
                this.h1 = this.jj();
            }
            return this.h1;
        },
        set: function (a) {
            var b = this.h1;
            this.h1 = a;
            if (b != this.h1) {
                this.raisePropertyChanged("ActualResolution", b, this.h1);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.jj = function () {
        if (!isNaN_(this.ji)) {
            return this.ji;
        }
        return DeviceUtils.g(1);
    };
    Object.defineProperty(Series.prototype, "ii", {
        get: function () {
            return this.h5;
        },
        set: function (a) {
            this.h5 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ie", {
        get: function () {
            return this.h2;
        },
        set: function (a) {
            this.h2 = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.rv = function () {
        this.ii = NaN;
        this.ig = NaN;
        this.ih = NaN;
        this.ie = NaN;
    };
    Object.defineProperty(Series.prototype, "ig", {
        get: function () {
            return this.h3;
        },
        set: function (a) {
            this.h3 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ih", {
        get: function () {
            return this.h4;
        },
        set: function (a) {
            this.h4 = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "bx", {
        get: function () {
            return this.bw;
        },
        set: function (a) {
            var b = this.bw;
            this.bw = a;
            if (b != this.bw) {
                this.raisePropertyChanged("ActualHighlightingMode", enumGetBox(SeriesHighlightingMode_$type, b), enumGetBox(SeriesHighlightingMode_$type, this.bw));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "cp", {
        get: function () {
            return this.cn;
        },
        set: function (a) {
            var b = this.cn;
            this.cn = a;
            if (b != this.cn) {
                this.raisePropertyChanged("ActualSelectionMode", enumGetBox(SeriesSelectionMode_$type, b), enumGetBox(SeriesSelectionMode_$type, this.cn));
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "co", {
        get: function () {
            return this.cm;
        },
        set: function (a) {
            var b = this.cm;
            this.cm = a;
            if (b != this.cm) {
                this.raisePropertyChanged("ActualFocusMode", enumGetBox(SeriesSelectionMode_$type, b), enumGetBox(SeriesSelectionMode_$type, this.cm));
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_gd = function () {
        return !this.ed;
    };
    Object.defineProperty(Series.prototype, "gd", {
        get: function () {
            return this.get_gd();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pt = function () {
    };
    Series.prototype.by = function () {
        if (!this.fd) {
            return 1;
        }
        if (this.db != null) {
            if (this.db.by != 1 && this.db.by != 0 && !this.e0) {
                return this.db.by;
            }
        }
        if (this.fc) {
            return 2;
        }
        return 1;
    };
    Series.prototype.cr = function () {
        if (!this.fd) {
            return 1;
        }
        if (this.db != null) {
            if (this.db.cb != 1 && this.db.cb != 0) {
                return this.db.cb;
            }
        }
        return 1;
    };
    Series.prototype.cq = function () {
        if (!this.fd) {
            return 1;
        }
        if (this.db != null) {
            if (this.db.cb != 1 && this.db.cb != 0) {
                return this.db.b9;
            }
        }
        return 1;
    };
    Series.prototype.fy = function (a) {
        switch (a) {
            case 2:
            case 4: return true;
        }
        return false;
    };
    Object.defineProperty(Series.prototype, "h9", {
        get: function () {
            return this.hz;
        },
        set: function (a) {
            var b = this.hz;
            this.hz = a;
            if (b != this.hz) {
                this.raisePropertyChanged("ActualHighlightedValuesFadeOpacity", b, this.hz);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ia", {
        get: function () {
            return this.h0;
        },
        set: function (a) {
            var b = this.h0;
            this.h0 = a;
            if (b != this.h0) {
                this.raisePropertyChanged("ActualHighlightingFadeOpacity", b, this.h0);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.pd = function () {
        this.dw = true;
    };
    Series.prototype.ps = function () {
        if (this.dw) {
            this.dw = false;
            if (this.d2) {
                if (this.ef) {
                    this.rf();
                }
            }
        }
    };
    Series.prototype.rf = function () {
        if (this.db == null) {
            return;
        }
        if (this.a5 == null) {
            return;
        }
        if (this.a5.isItemwise) {
            var a = this.a5;
            this.a5.clearLegendItemsForSeries(this);
            if (this.legendItemVisibility == 0) {
                this.o9();
                a.renderItemwiseContent(this);
            }
        }
    };
    Series.prototype.gt = function (a) {
        return false;
    };
    Series.prototype.o9 = function () {
        var _this = this;
        if (this.dn == null) {
            return;
        }
        var a = typeCast(IChartItemLegend_$type, this.a5);
        if (a == null || this.dn == null) {
            return;
        }
        this.ht = new List$1(UIElement.$, 0);
        var b = this.dn;
        var c = new List$1(SeriesPointOfInterest.$, 0);
        this.eb(c, false, false, 0, true);
        var _loop_7 = function (d) {
            var e = c._inner[d];
            var f = this_4.vn(e.c);
            var g = this_4.vm(e.c);
            var h = this_4.vo(e.c);
            var i = this_4.vp(e.c);
            var j = new ContentControl();
            var k = this_4.kr(e.c, true);
            var l = this_4.kt(e.c);
            var m = null;
            if (typeCast(Date_$type, k) !== null) {
                var n = k;
                m = (n.toString());
            }
            else {
                if (k != null) {
                    m = k.toString();
                }
            }
            var o = null;
            if (typeCast(Date_$type, l) !== null) {
                var p = l;
                o = (p.toString());
            }
            else {
                if (l != null) {
                    o = l.toString();
                }
                else {
                    o = m;
                }
            }
            if (this_4.ei) {
                g = f;
                i = h;
            }
            var q = this_4.ks(e.c);
            j.content = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = q;
                $ret.itemBrush = g;
                $ret.outline = i;
                $ret.itemLabel = m;
                $ret.legendLabel = o;
                return $ret;
            })());
            var r = this_4.sw;
            if (r == null) {
                r = this_4.cv.bn(this_4.c0);
            }
            j.ah = r;
            this_4.ht.add(j);
        };
        var this_4 = this;
        for (var d = 0; d < c.count; d++) {
            _loop_7(d);
        }
    };
    Series.prototype.ks = function (a) {
        return this.dn.item(a);
    };
    Series.prototype.kr = function (a, b) {
        if (this.ey || this.e6 || this.fs) {
            var c = this.a0();
            if (c != null) {
                if (!c.co()) {
                    return null;
                }
                if (c.cn) {
                    var d = a;
                    if (d < 0) {
                        return null;
                    }
                    var e = c;
                    var f = e.i$d(d);
                    var g = this.hy(f);
                    return g;
                }
                else {
                    if (c.ck) {
                        var h = a;
                        if (h < 0) {
                            h = 0;
                        }
                        var i = c;
                        var j = i.getDateTime(h);
                        return j;
                    }
                    else {
                        var k = a;
                        if (k < 0) {
                            return null;
                        }
                        var l = c.kv;
                        if (l == null || l.count == 0) {
                            return null;
                        }
                        var m = false;
                        if (c.b9 && c.cl) {
                            m = true;
                        }
                        if (!m) {
                            if (k >= l.count) {
                                k = l.count - 1;
                            }
                        }
                        var n = c.gf(k);
                        return n;
                    }
                }
            }
        }
        return null;
    };
    Series.prototype.kt = function (a) {
        return null;
    };
    Series.prototype.get_isColoredItemwise = function () {
        return this.d2;
    };
    Object.defineProperty(Series.prototype, "isColoredItemwise", {
        get: function () {
            return this.get_isColoredItemwise();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_e5 = function () {
        return true;
    };
    Object.defineProperty(Series.prototype, "e5", {
        get: function () {
            return this.get_e5();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sc = function () {
        var a = (typeCast(XamDataChart.$, this.db));
        if (a != null) {
            this.h8 = isNaN_(this.ij) ? a.w5.fp : this.ij;
        }
    };
    Series.prototype.se = function () {
        this.ib = isNaN_(this.jf) ? this.jk() : this.jf;
    };
    Series.prototype.sd = function () {
        this.h9 = isNaN_(this.jd) ? 0.2 : this.jd;
    };
    Series.prototype.jk = function () {
        return 1;
    };
    Object.defineProperty(Series.prototype, "e3", {
        get: function () {
            return this.du;
        },
        set: function (a) {
            this.du = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "cx", {
        get: function () {
            return this.cw;
        },
        set: function (a) {
            this.cw = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.cy = function () {
        if (this.cz == 0) {
            return 1;
        }
        return this.cz;
    };
    Object.defineProperty(Series.prototype, "ch", {
        get: function () {
            return this.cg;
        },
        set: function (a) {
            this.cg = a;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.cj = function () {
        if (this.ci == 0) {
            return 1;
        }
        return this.ci;
    };
    Series.prototype.a3 = function (a) {
        var _this = this;
        return ((function () {
            var $ret = new DataContext();
            $ret.series = _this;
            $ret.item = a;
            return $ret;
        })());
    };
    Series.prototype.c4 = function () {
        return 1;
    };
    Series.prototype.c7 = function () {
        return 1;
    };
    Series.prototype.ro = function () {
        this.cv.a5();
    };
    Series.prototype.ru = function () {
        this.d9 = true;
        this.g4 = false;
        this.g1 = true;
        this.gj = false;
        this.rq(true);
    };
    Series.prototype.q6 = function () {
        this.g1 = false;
        this.g4 = true;
        this.gj = false;
        this.rq(true);
    };
    Series.prototype.q5 = function () {
        this.g4 = false;
        this.g1 = true;
        this.gj = false;
        this.rq(true);
    };
    Series.prototype.q7 = function () {
        this.gj = true;
        if (!this.gn() || this.ja() == 0 || !this.hd(this.cv.bx, this.cv.by, this.cv)) {
            this.qz();
        }
        this.g1 = false;
        this.g4 = true;
        this.rq(true);
    };
    Series.prototype.rm = function () {
        this.o1();
    };
    Series.prototype.o1 = function () {
    };
    Series.prototype.qa = function () {
    };
    Series._hp = function (a, b, c) {
        var d;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    d = b;
                    _a.label = 1;
                case 1:
                    if (!(d < c))
                        return [3 /*break*/, 4];
                    return [4 /*yield*/, a(d)];
                case 2:
                    _a.sent();
                    _a.label = 3;
                case 3:
                    d++;
                    return [3 /*break*/, 1];
                case 4: return [2 /*return*/];
            }
        });
    };
    Series.hp = function (a, b, c) {
        return toEnum(function () { return Series._hp(a, b, c); });
    };
    Series.ho = function (a, b) {
        return Series.hp(a, 0, b);
    };
    Series.prototype.br = function () {
        return this.bq;
    };
    Series.prototype.r1 = function (a) {
        this.si(a);
    };
    Series.prototype.i8 = function () {
        return this.kc;
    };
    Series.prototype.i9 = function () {
        return this.kd;
    };
    Series.prototype.ja = function () {
        return this.ke;
    };
    Series.prototype.get_g6 = function () {
        return this.d1;
    };
    Series.prototype.set_g6 = function (a) {
        this.d1 = a;
    };
    Object.defineProperty(Series.prototype, "g6", {
        get: function () {
            return this.get_g6();
        },
        set: function (a) {
            this.set_g6(a);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "gg", {
        get: function () {
            return this.g6;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.o2 = function () {
        this.ba.a$y();
    };
    Series.prototype.dg = function (a, b, c) {
        return null;
    };
    Series.prototype.dh = function (a, b, c) {
        return null;
    };
    Series.prototype.qt = function (a, b, c, d) {
        this.ba.a$ae(this, a, b, c, d);
    };
    Series.prototype.r5 = function (a) {
        this.ba.a$ar(this, a);
    };
    Series.prototype.ow = function (a, b) {
        if (this.a5 != null && this.st != null) {
            if (b == null && this.a5.containsChild(this.st)) {
                this.a5.removeChild(this.st);
            }
            if (b != null && !this.a5.containsChild(this.st) && this.legendItemVisibility != 1) {
                this.a5.addChildInOrder(this.st, this);
            }
        }
    };
    Series.prototype.o3 = function () {
        if (this.a5 == null || this.st == null) {
            return;
        }
        this.a5.removeChild(this.st);
    };
    Series.prototype.ov = function (a, b) {
        if (this.st != null) {
            if (a != null && a.containsChild(this.st)) {
                a.removeChild(this.st);
            }
            if (this.db != null && b != null && !b.containsChild(this.st) && this.legendItemVisibility != 1) {
                b.addChildInOrder(this.st, this);
            }
        }
    };
    Series.prototype.ox = function (a, b) {
        if (this.a5 != null) {
            if (a != null && this.a5.containsChild(a)) {
                this.a5.removeChild(a);
            }
            if (this.db != null && b != null && this.legendItemVisibility != 1) {
                this.a5.addChildInOrder(b, this);
            }
        }
    };
    Series.prototype.ri = function (a) {
        this.dn = a.releaseFastItemsSource(this.itemsSource);
    };
    Series.prototype.rh = function (a) {
        this.dn = a.getFastItemsSource(this.itemsSource);
    };
    Series.prototype.a6 = function () {
        if (this.legend != null) {
            return this.legend;
        }
        if (this.db != null && this.db.legend != null) {
            return this.db.legend;
        }
        return null;
    };
    Series.prototype.gm = function () {
        return false;
    };
    Series.prototype.gn = function () {
        return false;
    };
    Series.prototype.ge = function (a) {
        return (a && this.i8() > 0) || this.d3() || (this.g2 && this.gm() && this.i9() > 0) || (this.g5 && this.gn() && this.ja() > 0);
    };
    Series.prototype.pb = function (a) {
        if (a != null) {
            a.b0(this);
        }
    };
    Series.prototype.rg = function (a) {
        if (a != null) {
            a.ct(this);
        }
    };
    Series.prototype.bs = function () {
        return this.cv.g();
    };
    Series.prototype.si = function (a) {
        this.cv.bb(a);
    };
    Series.prototype.r4 = function (a, b) {
        this.ba.a$aq(this, a, b);
    };
    Series.prototype.get_g9 = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "g9", {
        get: function () {
            return this.get_g9();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.q9 = function (a, b) {
        this.cv.at(a, b);
    };
    Series.prototype.rb = function (a) {
        this.q1(this.wr, a);
    };
    Series.prototype.p5 = function (a) {
        if (this.dn != null) {
            this.dn.handleCollectionChanged(a);
        }
    };
    Series.prototype.qi = function (a, b, c) {
        this.p5(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
    };
    Series.prototype.qd = function () {
        this.p5(new NotifyCollectionChangedEventArgs(0, 4));
    };
    Series.prototype.qg = function (a, b) {
        this.p5(new NotifyCollectionChangedEventArgs(1, 0, b, a));
    };
    Series.prototype.qh = function (a, b) {
        this.p5(new NotifyCollectionChangedEventArgs(1, 1, b, a));
    };
    Series.prototype.sb = function () {
        this.rq(false);
    };
    Series.prototype.gv = function (a, b) {
        return false;
    };
    Series.prototype.get_coercionMethods = function () {
        return this._coercionMethods;
    };
    Series.prototype.set_coercionMethods = function (a) {
        this._coercionMethods = a;
    };
    Object.defineProperty(Series.prototype, "coercionMethods", {
        get: function () {
            return this.get_coercionMethods();
        },
        set: function (a) {
            this.set_coercionMethods(a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_expectFunctions = function () {
        return this.dt;
    };
    Series.prototype.set_expectFunctions = function (a) {
        var b = this.dt;
        this.dt = a;
        if (b != this.dt) {
            this.raisePropertyChanged("ExpectFunctions", b, this.dt);
        }
    };
    Object.defineProperty(Series.prototype, "expectFunctions", {
        get: function () {
            return this.get_expectFunctions();
        },
        set: function (a) {
            this.set_expectFunctions(a);
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.a2 = function (a, b) {
        return null;
    };
    Object.defineProperty(Series.prototype, "b3", {
        get: function () {
            return this.b0;
        },
        set: function (a) {
            var b = this.b0;
            this.b0 = a;
            if (b != this.b0) {
                this.raisePropertyChanged("HitTestMode", enumGetBox(SeriesHitTestMode_$type, b), enumGetBox(SeriesHitTestMode_$type, this.b0));
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.b2 = function () {
        return this.b3 == 0 ? 2 : this.b3;
    };
    Object.defineProperty(Series.prototype, "b1", {
        get: function () {
            return this.bz;
        },
        set: function (a) {
            var b = this.bz;
            this.bz = a;
            if (b != this.bz) {
                this.raisePropertyChanged("ActualHitTestMode", enumGetBox(SeriesHitTestMode_$type, b), enumGetBox(SeriesHitTestMode_$type, this.bz));
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.dk = function (a) {
        if (a == null) {
            return this.dn.registerColumn(null, null, false);
        }
        var b = null;
        var c = SeriesViewer.cu(a, this.coercionMethods);
        b = c.a;
        return this.dn.registerColumn(a, b, this.expectFunctions);
    };
    Series.prototype.dl = function (a) {
        if (a == null) {
            return this.dn.registerColumnInt(null, null, false);
        }
        var b = null;
        var c = SeriesViewer.cu(a, this.coercionMethods);
        b = c.a;
        return this.dn.registerColumnInt(a, b, this.expectFunctions);
    };
    Series.prototype.dm = function (a) {
        if (a == null) {
            return this.dn.registerColumnObject(null, null, false);
        }
        var b = null;
        var c = SeriesViewer.cu(a, this.coercionMethods);
        b = c.a;
        return this.dn.registerColumnObject(a, b, this.expectFunctions);
    };
    Object.defineProperty(Series.prototype, "wr", {
        get: function () {
            return this.cv != null ? this.cv.bx : Rect.empty;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fl = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fl", {
        get: function () {
            return this.get_fl();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.get_fk = function () {
        return false;
    };
    Object.defineProperty(Series.prototype, "fk", {
        get: function () {
            return this.get_fk();
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.r3 = function (a) {
    };
    Series.prototype.r2 = function (a, b) {
    };
    Series.prototype.o7 = function (a, b) {
        this.bc.copyVisualData(a, b);
    };
    Series.prototype.kl = function () {
        var a = this.bc.exportVisualData(this, this.wr);
        this.py(a);
        this.cv.an(a);
        this.bc.exportLayerVisualData(this, a);
        return a;
    };
    Series.prototype.py = function (a) {
    };
    Series.prototype.qb = function (a) {
        if (this.v5.x != a.x || this.v5.y != a.y) {
            this.v5 = a;
            this.qq(a);
        }
    };
    Series.prototype.qq = function (a) {
    };
    Series.prototype.qc = function () {
    };
    Series.prototype.qj = function () {
    };
    Series.prototype.aw = function (a) {
        return null;
    };
    Series.prototype.ai = function () {
        return null;
    };
    Series.prototype.ix = function () {
        return NaN;
    };
    Series.iy = function (a, b) {
        if (a == null || a.count == 0) {
            return NaN;
        }
        if (b != null && b.i$b != null) {
            if (b.i$b.count != a.count) {
                return NaN;
            }
            for (var c = 0; c < a.count; c++) {
                if (!isNaN_(a.item(b.i$b._inner[c])) && a.item(b.i$b._inner[c]) != 0) {
                    return a.item(b.i$b._inner[c]);
                }
            }
        }
        for (var d = 0; d < a.count; d++) {
            if (!isNaN_(a.item(d)) && a.item(d) != 0) {
                return a.item(d);
            }
        }
        return NaN;
    };
    Series.iz = function (a, b) {
        if (a == null || a.count == 0) {
            return NaN;
        }
        if (b != null && b.i$b != null) {
            if (b.i$b.count != a.count) {
                return NaN;
            }
            for (var c = 0; c < a.count; c++) {
                if (!isNaN_(a.item(b.i$b._inner[c])) && a.item(b.i$b._inner[c]) != 0) {
                    return a.item(b.i$b._inner[c]);
                }
            }
        }
        for (var d = 0; d < a.count; d++) {
            if (!isNaN_(a.item(d)) && a.item(d) != 0) {
                return a.item(d);
            }
        }
        return NaN;
    };
    Series.prototype.qo = function () {
    };
    Object.defineProperty(Series.prototype, "il", {
        get: function () {
            return this.h6;
        },
        set: function (a) {
            var b = this.il;
            if (a != b) {
                this.h6 = a;
                this.raisePropertyChanged("FinalValue", b, this.il);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "jh", {
        get: function () {
            return this.h7;
        },
        set: function (a) {
            var b = this.jh;
            if (a != b) {
                this.h7 = a;
                this.raisePropertyChanged("PercentChange", b, this.jh);
            }
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sm = function () {
        var a = this.ix();
        this.jh = (this.il - a) / a * 100;
    };
    Series.prototype.ko = function (a) {
        return null;
    };
    Object.defineProperty(Series.prototype, "lj", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.bz) ? this.dr.bz : "Open";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "k5", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.bw) ? this.dr.bw : "Close";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "k8", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.bx) ? this.dr.bx : "High";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "lh", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.by) ? this.dr.by : "Low";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "lr", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.b0) ? this.dr.b0 : "Volume";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "lq", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.b9) ? this.dr.b9 : "Value";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ll", {
        get: function () {
            return !stringIsNullOrWhiteSpace(this.dr.m) ? this.dr.m : "Radius";
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.sh = function () {
        this.sv = this.sx();
        this.cv.bl();
    };
    Series.prototype.av = function () {
        var a = this.legendItemBadgeShape;
        if (a == 0) {
            a = this.bf();
        }
        var b = 0;
        if (a == 3) {
            if (this.e9 || this.f5) {
                b = 6;
            }
            else if (this.e7) {
                b = 7;
            }
            else {
                b = 5;
            }
        }
        else if (a == 4) {
            if (this.hasMarkers && !this.e8) {
                b = 8;
            }
            else {
                b = 0;
            }
        }
        else if (a == 2) {
            if (this.hasMarkers && !this.es) {
                b = 1;
            }
            else {
                b = 2;
            }
        }
        else if (a == 1) {
            b = 0;
        }
        else if (a == 5) {
            b = 3;
        }
        else if (a == 6) {
            b = 4;
        }
        else if (a == 7) {
            b = 9;
        }
        return b;
    };
    Series.prototype.be = function (a) {
        return a;
    };
    Series.prototype.bf = function () {
        if (this.eu || this.ex || this.ez || this.fp || this.fx || this.e9 || this.e7 || this.e8 || this.f2 || this.f5) {
            return this.be(3);
        }
        else if (this.fj || this.fz || this.fq || this.fi || this.isValueOverlay) {
            return this.be(2);
        }
        else if (this.es || this.fn || this.fm) {
            return this.be(1);
        }
        else if (this.ei) {
            return this.be(4);
        }
        return this.be(1);
    };
    Series.prototype.bj = function () {
        return null;
    };
    Series.prototype.bl = function () {
        return this.bj();
    };
    Object.defineProperty(Series.prototype, "cb", {
        get: function () {
            return this.b8;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ca", {
        get: function () {
            return this.b7;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "actualLayers", {
        get: function () {
            return this.b6;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Series.prototype, "ec", {
        get: function () {
            return this.hq.count > 0;
        },
        enumerable: false,
        configurable: true
    });
    Series.prototype.r0 = function (a, b) {
        if (b != null) {
            a.legendItemVisibility = 1;
        }
        else {
            a.legendItemVisibility = 0;
        }
        a.bk = b;
    };
    Series.prototype.r8 = function (a) {
        if (!this.hl.containsKey(a)) {
            this.hl.addItem(a, 0);
        }
        this.hl.item(a, this.hl.item(a) + 1);
    };
    Series.prototype.sa = function (a) {
        if (this.hl.containsKey(a)) {
            this.hl.item(a, this.hl.item(a) - 1);
            if (this.hl.item(a) == 0) {
                this.hl.removeItem(a);
            }
        }
    };
    Series.prototype.f3 = function (a) {
        if (this.hl.containsKey(a) && this.hl.item(a) > 0) {
            return true;
        }
        return false;
    };
    Series.prototype.r7 = function (a) {
        if (!this.hh.containsKey(a)) {
            this.hh.addItem(a, new Stack$1(Boolean_$type));
        }
        this.hh.item(a).h(true);
    };
    Series.prototype.r9 = function (a, b) {
        if (this.hh.containsKey(a)) {
            this.hh.item(a).e();
            if (this.hh.item(a).f == 0) {
                this.hh.removeItem(a);
                var c = this.tl(a);
                if (b && this.eg && !this.f3(a) && !this.f3("Actual" + a)) {
                    {
                        if (c != null) {
                            this.r8(a);
                            this.k2(a, this.c(c), this.c(c));
                            this.sa(a);
                        }
                    }
                }
            }
        }
    };
    Series.prototype.gl = function (a) {
        if (this.hh.containsKey(a) && this.hh.item(a).d()) {
            return true;
        }
        return false;
    };
    Series.prototype.f1 = function () {
        return this.hh.count > 0;
    };
    Series.prototype.ku = function () {
        return null;
    };
    Series.prototype.bm = function (a, b) {
        if (this.hk.containsKey(b)) {
            return this.hk.item(b);
        }
        var c = this.bl();
        if (c == null) {
            return null;
        }
        c.bn = this;
        c.b5 = b;
        this.p9(c);
        this.rt(c);
        b.am(this, c);
        this.oz(a, c);
        this.hk.item(b, c);
        this.hq.insert(a, c);
        return c;
    };
    Series.prototype.p9 = function (a) {
        if (this.k1 != null) {
            a.k1 = this.k1;
        }
        if (this.go) {
            a.go = true;
        }
    };
    Series.prototype.oz = function (a, b) {
        this.cv.ah(a, b);
    };
    Series.prototype.pc = function (a) {
        this.cv.am(a);
    };
    Series.prototype.rt = function (a) {
        var e_121, _a;
        try {
            for (var _b = __values(fromEnum(this.hn)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = this.tl(b);
                if (c == null) {
                    continue;
                }
                this.o6(a, c);
            }
        }
        catch (e_121_1) {
            e_121 = { error: e_121_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_121)
                    throw e_121.error;
            }
        }
    };
    Series.prototype.f8 = function (a) {
        if (a.name == "ToolTip") {
            return true;
        }
        return false;
    };
    Series.prototype.gp = function (a) {
        if (a.name == "ToolTip" && this.go) {
            return true;
        }
        return false;
    };
    Series.prototype.o6 = function (a, b) {
        var c = a.b5;
        if (c != null) {
            var d = this.c(b);
            if (this.gp(b)) {
                return;
            }
            if (this.f8(b)) {
                d = this.ki(b, d);
            }
            c.ai(this, a, b, d);
        }
    };
    Series.prototype.ki = function (a, b) {
        if (a.name == "ToolTip") {
            return null;
        }
        return b;
    };
    Series.prototype.pg = function (a) {
        if (this.hk.containsKey(a)) {
            var b = this.hk.item(a);
            this.hk.removeItem(a);
            a.ap(b);
            this.pc(b);
            this.hq.remove(b);
        }
    };
    Series.prototype.getDataLegendBadge = function () {
        var a = this.sx();
        if (a == null) {
            a = LegendTemplates.af(this);
        }
        return a;
    };
    Series.prototype.getDataLegendBadgeContext = function () {
        var _this = this;
        if (this.a8 == null) {
            this.a8 = ((function () {
                var $ret = new DataContext();
                $ret.series = _this;
                $ret.item = null;
                return $ret;
            })());
        }
        return this.a8;
    };
    Series.prototype.getDataLegendBadgeContextAtPosition = function (a, b) {
        var c = this.getDataLegendBadgeContext();
        var d = this.getDataLegendResolvedWorldPositionX(a);
        var e = this.getDataLegendResolvedWorldPositionY(b);
        var f = this.j2({ $type: Point_$type, x: d, y: e });
        if (this.dn == null || f < 0 || f > (this.dn.count - 1)) {
            return null;
        }
        if (this.d2) {
            c.itemBrush = this.vm(f);
            c.outline = this.vp(f);
        }
        return c;
    };
    Series.prototype.getDataLegendBadgeShapeAndMarker = function () {
        var a = this.av();
        if (a == 8) {
            return this.l9();
        }
        else if (a == 1) {
            if (this.bd == 0) {
                return "Line";
            }
            return "LineWith" + this.l9();
        }
        else if (a == 3) {
            return "Bar";
        }
        else if (a == 4) {
            return "Column";
        }
        else if (a == 9) {
            return "None";
        }
        else if (a == 0) {
            return "Circle";
        }
        else if (a == 2) {
            return "Line";
        }
        else if (a == 5) {
            return "Square";
        }
        else if (a == 6) {
            if (this.bd == 0) {
                return "Square";
            }
            else {
                return "TwoColumns";
            }
        }
        else if (a == 7) {
            if (this.bd == 0) {
                return "Square";
            }
            else {
                return "TwoBars";
            }
        }
        return EnumUtil.getName(ActualLegendItemBadgeShape_$type, a);
    };
    Series.prototype.l9 = function () {
        return null;
    };
    Series.prototype.ma = function (a, b) {
        if (b == a.db.r1) {
            return "Circle";
        }
        else if (b == a.db.r2) {
            return "Diamond";
        }
        else if (b == a.db.r3) {
            return "Hexagon";
        }
        else if (b == a.db.r4) {
            return "Hexagram";
        }
        else if (b == a.db.r5) {
            return "Pentagon";
        }
        else if (b == a.db.r6) {
            return "Pentagram";
        }
        else if (b == a.db.r7) {
            return "Pyramid";
        }
        else if (b == a.db.r8) {
            return "Square";
        }
        else if (b == a.db.r9) {
            return "Tetragram";
        }
        else if (b == a.db.sa) {
            return "Triangle";
        }
        else if (b != null) {
            return "Custom";
        }
        else {
            return "None";
        }
    };
    Series.prototype.getDataLegendSeriesTitle = function () {
        return this.title == null ? null : this.title.toString();
    };
    Series.prototype.iw = function (a, b) {
        return FastItemColumn.i(this.kp(a, b));
    };
    Series.prototype.getDataLegendResolvedWorldPositionX = function (a) {
        if (isNaN_(a) || a < 0) {
            if (this.isVertical) {
                a = 1;
            }
            else {
                var b = this.a0();
                if (b != null) {
                    if (b.ch) {
                        a = 0;
                    }
                    else {
                        a = 1;
                    }
                }
                else {
                    a = 1;
                }
            }
        }
        return a;
    };
    Series.prototype.getDataLegendResolvedWorldPositionY = function (a) {
        if (isNaN_(a) || a < 0) {
            if (this.isVertical) {
                var b = this.a0();
                if (b != null) {
                    if (b.ch) {
                        a = 1;
                    }
                    else {
                        a = 0;
                    }
                }
                else {
                    a = 0;
                }
            }
            else {
                a = 0;
            }
        }
        return a;
    };
    Series.prototype.getDataLegendSeriesContextAt = function (a, b) {
        var c = new DataLegendSeriesValueInfo();
        c.l = this.i4({ $type: Point_$type, x: a, y: b }, false, false);
        c.a = 0;
        c.q = "Value";
        c.r = "Value";
        c.s = "";
        var d = new DataLegendSeriesContext();
        d.e = ((function () {
            var $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
            $ret.add(c);
            return $ret;
        })());
        d.h = this.mb();
        return d;
    };
    Series.prototype.mb = function () {
        var a = "Category";
        if (this.fb) {
            a = "Geographic";
        }
        if (this.ft) {
            a = "Range";
        }
        if (this.fw) {
            a = "Shape";
        }
        if (this.fv) {
            a = "Scatter";
        }
        if (this.fo) {
            a = "Polar";
        }
        if (this.fs) {
            a = "Radial";
        }
        if (this.isStacked || this.isFragment) {
            a = "Stacked";
        }
        if (this.fa) {
            a = "Category";
        }
        if (this.e6) {
            if (this.e9) {
                a = "Financial";
            }
            else {
                a = getInstanceType(this).typeName.toString();
            }
        }
        if (this.fe) {
            a += " Highlight";
        }
        else if (this.isValueOverlay) {
            a += " Overlay";
        }
        else {
            a += " Series";
        }
        return a;
    };
    Series.prototype.getDataLegendAxisLabelFromCursorPosition = function (a, b) {
        if (this.ey || this.e6 || this.fs) {
            var c = this.a0();
            if (c != null) {
                if (!c.co()) {
                    return null;
                }
                var d = this.getDataLegendResolvedWorldPositionX(a);
                var e = this.getDataLegendResolvedWorldPositionY(b);
                var f = { $type: Point_$type, x: d, y: e };
                if (c.cn) {
                    var g = this.j4(f);
                    if (g < 0) {
                        return null;
                    }
                    var h = c;
                    var i = h.i$d(g);
                    var j = this.hy(i);
                    return j;
                }
                else {
                    if (c.ck) {
                        var k = this.iq(f);
                        if (k < 0) {
                            k = 0;
                        }
                        var l = c;
                        var m = l.getDateTime(k);
                        return m;
                    }
                    else {
                        var n = this.j2(f);
                        if (n < 0) {
                            return null;
                        }
                        var o = c.kv;
                        if (o == null || o.count == 0) {
                            return null;
                        }
                        var p = false;
                        if (c.b9 && c.cl) {
                            p = true;
                        }
                        if (!p) {
                            if (n >= o.count) {
                                n = o.count - 1;
                            }
                        }
                        var q = c.gf(n);
                        return q;
                    }
                }
            }
        }
        return null;
    };
    Series.prototype.hy = function (ticks_) {
        var a = (new Date(ticks_));
        return a;
    };
    Series.prototype.vz = function (a) {
        if (a == null) {
            return null;
        }
        if (this.b4 == null) {
            return a;
        }
        a = BrushUtil.q(a, this.h9);
        return a;
    };
    Series.prototype.cf = function () {
        var _this = this;
        var a = this.md();
        if (a != null) {
            var b_1 = this.mc(a);
            if (b_1 != null) {
                var c = ((function () {
                    var $ret = new SeriesMatcher();
                    $ret.d = a;
                    $ret.c = b_1;
                    return $ret;
                })());
                if (this.f6(c)) {
                    return c;
                }
            }
        }
        if (this.name != null) {
            var d = ((function () {
                var $ret = new SeriesMatcher();
                $ret.e = _this.name;
                return $ret;
            })());
            if (this.f6(d)) {
                return d;
            }
        }
        var e = "Series Title";
        if (this.title != null && typeof this.title === 'string' && !Base.equalsStatic(this.title, e)) {
            var f = ((function () {
                var $ret = new SeriesMatcher();
                $ret.f = _this.title;
                return $ret;
            })());
            if (this.f6(f)) {
                return f;
            }
        }
        if (this.index != -1) {
            var g = ((function () {
                var $ret = new SeriesMatcher();
                $ret.b = _this.index;
                return $ret;
            })());
            return g;
        }
        return null;
    };
    Series.prototype.f6 = function (a) {
        if (this.db != null) {
            var b = SeriesMatcherHelper.a(this.db, a);
            if (b != null && b.length == 1) {
                return true;
            }
        }
        return false;
    };
    Series.$t = markType(Series, 'Series', Control.$, [INotifyPropertyChanged_$type, IProvidesViewport_$type, ILegendSeries_$type, ILegendSeriesInternal_$type, ILegendOwner_$type, ILegendTemplateProvider_$type, IDataLegendSeries_$type]);
    Series.jz = 0;
    Series.u2 = DependencyProperty.i("VisibilityProxy", Visibility_$type, Series.$, new PropertyMetadata(2, enumGetBox(Visibility_$type, 0), function (a, b) { return a.raisePropertyChanged("VisibilityProxy", b.oldValue, b.newValue); }));
    Series.he = new Dictionary$2(String_$type, Dictionary$2.$.specialize(Type.$, DependencyProperty.$), 0);
    Series.hi = null;
    Series.hj = null;
    Series.ty = DependencyProperty.i("ItemsSource", IEnumerable_$type, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        if (c.c3 != null) {
            c.c3.releaseFastItemsSource(b.oldValue);
        }
        a.raisePropertyChanged("ItemsSource", b.oldValue, b.newValue);
    }));
    Series.t4 = DependencyProperty.i("Legend", IChartLegend_$type, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("Legend", b.oldValue, b.newValue);
    }));
    Series.t1 = DependencyProperty.i("LegendItemBadgeTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("LegendItemBadgeTemplate", b.oldValue, b.newValue);
        if (c.st != null) {
            c.st = c.ss();
        }
    }));
    Series.t2 = DependencyProperty.i("LegendItemTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("LegendItemTemplate", b.oldValue, b.newValue);
        if (c.st != null) {
            c.st = c.ss();
        }
    }));
    Series.ti = DependencyProperty.i("DiscreteLegendItemTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("DiscreteLegendItemTemplate", b.oldValue, b.newValue);
    }));
    Series.tt = DependencyProperty.i("Index", Number_$type, Series.$, new PropertyMetadata(2, -1, function (a, b) {
        var c = typeCast(Series.$, a);
        c.raisePropertyChanged("Index", b.oldValue, b.newValue);
        if (c.st != null) {
            c.st = c.ss();
        }
    }));
    Series.$$p = markDep(DependencyProperty, PropertyMetadata, Series, 'raisePropertyChanged', ['ActualAreaFillOpacity:h8:sz', [1, 1], 'ActualBrush:u8:s0', [Brush.$], 'ActualFocusBrush:u9:s1', [Brush.$], 'ActualLegendItemBadgeBrush:va:s2', [Brush.$], 'ActualLegendItemBadgeOutline:vb:s3', [Brush.$], 'ActualLegendItemBadgeTemplate:sv:s4', [DataTemplate.$], 'ActualMarkerFillOpacity:ib:s5', [1, 1], 'ActualOutline:vc:s6', [Brush.$], 'ActualSelectionBrush:vd:s7', [Brush.$], 'ActualThickness:id:s8', [1, DeviceUtils.g(2)], 'AreaFillOpacity:ij:s9', [1, NaN], 'AutoCalloutLabelFormat:lt:ta', [2, null], 'AutoCalloutLabelFormatSpecifiers:ag:tb', [Array_$type, null], 'AutoCalloutValueLabelFormat:lw:tc', [2, null], 'AutoCalloutValueLabelFormatSpecifiers:ah:td', [Array_$type, null], 'Brush:ve:te', [Brush.$, null], 'DashArray:v1:tf', [DoubleCollection.$], 'DashCap:v2:tg', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)], 'DataLegendGroup:l2:th', [2, null], 'FastItemsSource:dn:tj', [IFastItemsSource_$type], 'FocusBrush:vj:tk', [Brush.$, null], 'HighlightedItemsSource::tm', [IEnumerable_$type, null], 'HighlightedLegendItemVisibility:ww:tn', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'HighlightedTitleSuffix:mg:to', [2, " - Highlighted"], 'HighlightedValuesDataLegendGroup:mi:tp', [2, null], 'HighlightedValuesDisplayMode:bv:tq', [SeriesHighlightedValuesDisplayMode_$type, enumGetBox(SeriesHighlightedValuesDisplayMode_$type, 0)], 'HighlightedValuesFadeOpacity:jd:tr', [1, NaN], 'HighlightingFadeOpacity:je:ts', [1, NaN], 'IsActualLegendFinancial:en:tu', [0, false], 'IsComponentHighlightingModeIgnored:e0:tv', [0, false], 'IsDropShadowEnabled:e4:tw', [0, false], 'IsHighlightingEnabled:fc:tx', [0, false], 'LegendItemBadgeMode:bd:tz', [LegendItemBadgeMode_$type, enumGetBox(LegendItemBadgeMode_$type, 0)], 'LegendItemBadgeShape::t0', [LegendItemBadgeShape_$type, enumGetBox(LegendItemBadgeShape_$type, 0)], 'LegendItemVisibility::t3', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'LineCap:v3:t5', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)], 'LineJoin:v4:t6', [PenLineJoin_$type, enumGetBox(PenLineJoin_$type, 0)], 'MarkerFillOpacity:jf:t7', [1, NaN], 'MiterLimit:jg:t8', [1, 10], 'MouseOverEnabled:f7:t9', [0, true], 'OutlineMode:ci:ua', [SeriesOutlineMode_$type, enumGetBox(SeriesOutlineMode_$type, 0)], 'Outline:vu:ub', [Brush.$, null], 'Resolution:ji:uc', [1, NaN], 'SafeActualBrush::ud', [Brush.$], 'SelectionBrush:vy:ue', [Brush.$, null], 'ShadowBlur:jl:uf', [1, NaN], 'ShadowColor:v0:ug', [Color.$], 'ShadowOffsetX:jm:uh', [1, NaN], 'ShadowOffsetY:jn:ui', [1, NaN], 'ShouldAnimateOnDataSourceSwap:gf:uj', [0, false], 'ShouldHideAutoCallouts:gh:uk', [0, false], 'ShouldRemoveHighlightedDataOnLayerHidden:gi:ul', [0, false], 'ShouldShiftOpacityForSafeActualBrush:gk:um', [0, true], 'ShowDefaultTooltip:go:un', [0, false], 'Thickness:jo:uo', [1, DeviceUtils.g(2)], 'Title::up', [4, "Series Title"], 'ToolTip::uq', [4, null], 'TransitionDuration:kc:ur', [1, 0], 'TransitionEasingFunction:dd:us', [Delegate_$type, null], 'TransitionInDuration:kd:ut', [1, 1000], 'TransitionInEasingFunction:de:uu', [Delegate_$type, null], 'TransitionInSpeedType:c5:uv', [TransitionInSpeedType_$type, enumGetBox(TransitionInSpeedType_$type, 0)], 'TransitionOutDuration:ke:uw', [1, 1000], 'TransitionOutEasingFunction:df:ux', [Delegate_$type, null], 'TransitionOutSpeedType:c8:uy', [TransitionOutSpeedType_$type, enumGetBox(TransitionOutSpeedType_$type, 0)], 'TransitionProgress:jp:uz', [1, 0], 'UseItemWiseColors:g8:u0', [0, false], 'UseSingleShadow:hb:u1', [0, true], 'VisibleRangeMarginBottom:jq:u3', [1, NaN], 'VisibleRangeMarginLeft:jr:u4', [1, NaN], 'VisibleRangeMarginRight:js:u5', [1, NaN], 'VisibleRangeMarginTop:jt:u6', [1, NaN], 'VisibleRangeMode:cz:u7', [SeriesVisibleRangeMode_$type, enumGetBox(SeriesVisibleRangeMode_$type, 0)]]);
    return Series;
}(Control));
export { Series };
/**
 * @hidden
 */
var MarkerSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(MarkerSeries, _super);
    function MarkerSeries() {
        var _this = _super.call(this) || this;
        _this.w6 = 1;
        _this.w1 = 1;
        _this.wx = 1;
        _this.x0 = null;
        _this.w7 = _this.w8();
        return _this;
    }
    MarkerSeries.prototype.hs = function () {
        var a = _super.prototype.hs.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "MarkerBrush";
                $ret.p = true;
                $ret.y = "ActualMarkerBrush";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.rz));
            a.add(b);
        }
        {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "MarkerOutline";
                $ret.p = true;
                $ret.y = "ActualMarkerOutline";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.rz));
            a.add(c);
        }
        return a;
    };
    MarkerSeries.prototype.wu = function (a, b) {
        if (this.fs || this.fo) {
            return new Thickness(1, 0, 0, 0, 0);
        }
        if (this.w7 != 1 && this.w7 != 13) {
            var c = this.w5.cv();
            var d = (c.width / 2) + (this.xi / 2);
            var e = (c.height / 2) + (this.xi / 2);
            var f = e;
            var g = e;
            var h = d;
            var i = d;
            if (a == 2 || a == 4) {
                h = 0;
            }
            if (a == 2 || a == 3) {
                i = 0;
            }
            if (b == 2 || b == 3) {
                f = 0;
            }
            if (b == 2 || b == 4) {
                g = 0;
            }
            return new Thickness(1, h, f, i, g);
        }
        return new Thickness(1, 0, 0, 0, 0);
    };
    MarkerSeries.prototype.q0 = function (a) {
        _super.prototype.q0.call(this, a);
        this.w5 = a;
    };
    MarkerSeries.prototype.get_hasMarkers = function () {
        return true;
    };
    MarkerSeries.prototype.get_el = function () {
        return this.w7 != 13 && this.w7 != 1;
    };
    MarkerSeries.prototype.vk = function () {
        return this.yg;
    };
    MarkerSeries.prototype.vl = function () {
        return this.yh;
    };
    MarkerSeries.prototype.sy = function () {
        return this.x0;
    };
    MarkerSeries.prototype.l9 = function () {
        return this.ma(this, this.x0);
    };
    Object.defineProperty(MarkerSeries.prototype, "w7", {
        get: function () {
            return this.w6;
        },
        set: function (a) {
            var b = this.w6;
            this.w6 = a;
            if (b != a) {
                this.raisePropertyChanged("ActualMarkerType", enumGetBox(MarkerType_$type, b), enumGetBox(MarkerType_$type, this.w6));
            }
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.w8 = function () {
        if (this.w9 == 1 || this.w9 == 0) {
            if (this.fh && this.ba.a$d) {
                return 2;
            }
            if (this.xe()) {
                return 13;
            }
        }
        return this.w9;
    };
    MarkerSeries.prototype.xe = function () {
        return (this.g8 && typeCast(IChartItemLegend_$type, this.legend) !== null) || this.xd();
    };
    MarkerSeries.prototype.xd = function () {
        var e_122, _a;
        if (this.db == null) {
            return false;
        }
        if (this.db.ew) {
            try {
                for (var _b = __values(fromEnum(this.db.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var a = _c.value;
                    if (a.eo) {
                        if (a.gt(this)) {
                            return true;
                        }
                    }
                }
            }
            catch (e_122_1) {
                e_122 = { error: e_122_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_122)
                        throw e_122.error;
                }
            }
        }
        return false;
    };
    MarkerSeries.prototype.pt = function () {
        _super.prototype.pt.call(this);
        this.w7 = this.w8();
    };
    Object.defineProperty(MarkerSeries.prototype, "xb", {
        get: function () {
            return this.xc || this.xz == this.db.r1;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MarkerSeries.prototype, "w2", {
        get: function () {
            return this.w1;
        },
        set: function (a) {
            this.w1 = a;
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.w4 = function () {
        if (this.w3 == 0) {
            return 1;
        }
        return this.w3;
    };
    MarkerSeries.prototype.sk = function (a) {
        _super.prototype.sk.call(this, a);
        this.w3 = a;
    };
    Object.defineProperty(MarkerSeries.prototype, "wy", {
        get: function () {
            return this.wx;
        },
        set: function (a) {
            this.wx = a;
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.w0 = function () {
        if (this.wz == 0) {
            return 1;
        }
        return this.wz;
    };
    MarkerSeries.prototype.sj = function (a) {
        _super.prototype.sj.call(this, a);
        this.wz = a;
    };
    MarkerSeries.prototype.sl = function (a) {
        _super.prototype.sl.call(this, a);
        this.xi = a;
    };
    MarkerSeries.prototype.im = function () {
        return this.xi;
    };
    Object.defineProperty(MarkerSeries, "x2", {
        get: function () {
            if (MarkerSeries.xy == null) {
                MarkerSeries.xy = new DataTemplate();
            }
            return MarkerSeries.xy;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MarkerSeries.prototype, "yi", {
        get: function () {
            return this.c(MarkerSeries.x7);
        },
        set: function (a) {
            this.h(MarkerSeries.x7, a);
        },
        enumerable: false,
        configurable: true
    });
    MarkerSeries.prototype.xf = function () {
        return this.x0 != null && ((this.w7 != 1 && this.w7 != 0) || this.x1 != null);
    };
    MarkerSeries.prototype.qr = function () {
        _super.prototype.qr.call(this);
        this.w2 = this.w4();
        this.wy = this.w0();
    };
    MarkerSeries.prototype.q8 = function (a, b, c, d) {
        _super.prototype.q8.call(this, a, b, c, d);
        switch (b) {
            case MarkerSeries.$$p[10]:
                this.w7 = this.w8();
                break;
            case "MarkerBrush":
            case "ActualMarkerType":
            case MarkerSeries.$$p[6]:
            case MarkerSeries.$$p[8]:
            case MarkerSeries.$$p[9]:
                this.re(b);
                this.q2();
                break;
            case MarkerSeries.$$p[5]:
                this.w2 = this.w4();
                this.re(null);
                this.q2();
                break;
            case MarkerSeries.$$p[4]:
                this.wy = this.w0();
                this.re(null);
                this.q2();
                break;
            case MarkerSeries.$$p[2]:
                this.x0 = d;
                if (c == MarkerSeries.x2 || d == MarkerSeries.x2 || (c == null || d != null)) {
                    this.w5.cl();
                    var e = typeCast(MarkerSeriesView.$, this.cu);
                    if (e != null) {
                        e.cl();
                    }
                    this.rq(false);
                }
                if (this.ei) {
                    this.va = this.vk();
                    this.vb = this.vl();
                }
                if (this.db != null) {
                    this.db.n2();
                }
                this.cv.bl();
                if (this.toolTip != null && this.fh) {
                    this.ba.a$as(this, this.toolTip);
                }
                this.qk();
                break;
            case MarkerSeries.$$p[11]:
                this.w5.cs(this.xh);
                this.rq(false);
                break;
            case MarkerSeries.$$p[0]:
            case MarkerSeries.$$p[1]:
                if (this.ei) {
                    this.va = this.vk();
                    this.vb = this.vl();
                }
                break;
        }
    };
    MarkerSeries.xn = function (a) {
        switch (a) {
            case 3:
            case 13: return SeriesViewer.$$p[2];
            case 4: return SeriesViewer.$$p[45];
            case 5: return SeriesViewer.$$p[31];
            case 6: return SeriesViewer.$$p[39];
            case 7: return SeriesViewer.$$p[5];
            case 8: return SeriesViewer.$$p[23];
            case 9: return SeriesViewer.$$p[9];
            case 10: return SeriesViewer.$$p[42];
            case 11: return SeriesViewer.$$p[24];
            case 12: return SeriesViewer.$$p[10];
            case 0:
            case 1:
            default: return null;
        }
    };
    MarkerSeries.xa = function (a, b) {
        var c = 1;
        var d = 0;
        if (a != null && a.db != null) {
            d = a.db.bg;
        }
        if (a == null || a.db == null) {
            c = 1;
            return c;
        }
        if (b != 2 && b != 0) {
            c = b;
        }
        else {
            if (d == 4) {
                c = 3;
            }
            else if (d == 5) {
                c = 4;
            }
            else if (d == 9) {
                c = 8;
            }
            else if (d == 11) {
                c = 10;
            }
            else if (d == 8) {
                c = 7;
            }
            else if (d == 7) {
                c = 6;
            }
            else if (d == 10) {
                c = 9;
            }
            else if (d == 12) {
                c = 11;
            }
            else if (d == 6) {
                c = 5;
            }
            else if (d == 13) {
                c = 12;
            }
            else if (d == 1) {
                c = 1;
            }
            else if (d == 0) {
                if (a.fk) {
                    c = 1;
                }
                else {
                    c = 3;
                }
            }
            else if (d == 3 || d == 2) {
                if (d == 2) {
                    if (a.fk) {
                        c = 1;
                        return c;
                    }
                }
                if (a.index < 0) {
                    c = 1;
                }
                else {
                    var e = [3, 4, 8, 10, 7, 6, 9, 11, 5, 12];
                    c = e[a.index % e.length];
                }
            }
        }
        return c;
    };
    MarkerSeries.prototype.vn = function (a) {
        if (this.db == null) {
            return this.u8;
        }
        var b = this.db.ve(this.index + a);
        if (this.w9 == 13) {
            b = this.cv.bt();
        }
        else {
            if (this.wy != 2) {
                if (this.db != null) {
                    var c = b;
                    if (!isNaN_(this.ib) && this.ib != 1) {
                        c = BrushUtil.q(c, this.ib);
                    }
                    b = c;
                }
            }
            else {
                return this.vo(a);
            }
        }
        b = this.vs(b);
        return b;
    };
    MarkerSeries.prototype.vo = function (a) {
        if (this.db == null) {
            return this.u8;
        }
        var b = this.db.vf(this.index + a);
        if (this.w9 == 13) {
            b = this.cv.bt();
        }
        else {
            if (this.w2 == 2) {
                return this.vn(a);
            }
        }
        b = this.vs(b);
        return b;
    };
    MarkerSeries.prototype.sg = function () {
        _super.prototype.sg.call(this);
        if (this.index < 0) {
            return;
        }
        if (this.w5.b5()) {
            this.w5.ci();
            this.w5.cc();
        }
        else {
            var a = MarkerSeries.xa(this, this.w7);
            if (a == 1 && this.xe()) {
                a = 13;
            }
            var b = MarkerSeries.xn(a);
            if (b == null) {
                this.xz = MarkerSeries.x2;
            }
            else {
                this.w5.cf(b);
            }
        }
        if (this.yi != null && this.w7 != 13) {
            this.r7("ActualMarkerBrush");
            var c = this.yg;
            this.w5.cg();
            this.w5.cd();
            var d = this.yg;
            var e = this.fg("ActualMarkerBrush", this.hu.f > 0 ? this.hu.d() : null, c, d);
            this.r9("ActualMarkerBrush", e);
        }
        else {
            if (this.w7 == 13) {
                if (!BrushUtilCore.a(this.yg)) {
                    this.r7("ActualMarkerBrush");
                    var f = this.yg;
                    this.yg = this.cv.bt();
                    var g = this.yg;
                    var h = this.fg("ActualMarkerBrush", this.hu.f > 0 ? this.hu.d() : null, f, g);
                    this.r9("ActualMarkerBrush", h);
                }
            }
            else {
                if (this.wy != 2) {
                    if (this.db != null) {
                        var i = this.db.ve(this.index);
                        if (!isNaN_(this.ib) && this.ib != 1) {
                            i = BrushUtil.q(i, this.ib);
                        }
                        this.yg = i;
                    }
                    else {
                        this.yg = null;
                    }
                }
            }
        }
        if (this.yj != null && this.w9 != 13) {
            this.r7("ActualMarkerOutline");
            var j = this.yh;
            this.w5.ch();
            this.w5.ce();
            var k = this.yh;
            var l = this.fg("ActualMarkerOutline", this.hu.f > 0 ? this.hu.d() : null, j, k);
            this.r9("ActualMarkerOutline", l);
        }
        else {
            if (this.w7 == 13) {
                if (!BrushUtilCore.a(this.yh)) {
                    this.r7("ActualMarkerOutline");
                    var m = this.yh;
                    this.yh = this.cv.bt();
                    var n = this.yh;
                    var o = this.fg("ActualMarkerOutline", this.hu.f > 0 ? this.hu.d() : null, m, n);
                    this.r9("ActualMarkerOutline", o);
                }
            }
            else {
                if (this.w2 == 2) {
                    this.yh = this.yg;
                }
                else {
                    this.yh = this.db == null ? null : this.db.vf(this.index);
                }
            }
        }
        if (this.wy == 2 && this.yi == null && this.w7 != 13) {
            if (this.yh != null) {
                var p = this.yh;
                if (!isNaN_(this.ib) && this.ib != 1) {
                    p = BrushUtil.q(p, this.ib);
                }
                this.yg = p;
            }
            else {
                this.yg = null;
            }
        }
    };
    MarkerSeries.prototype.py = function (a) {
        _super.prototype.py.call(this, a);
        this.bc.exportMarkerVisualData(this, a);
    };
    MarkerSeries.prototype.xg = function (a, b) {
        if (this.hasMarkers && this.xf()) {
            var c = this.wp(a);
            if (c.isEmpty) {
                return false;
            }
            var d = RectUtil.r(c, this.it(b));
            if (d.containsPoint(a)) {
                return true;
            }
        }
        return false;
    };
    MarkerSeries.prototype.a2 = function (a, b) {
        var c = this.w5.b1(a);
        var d = null;
        if (c != null) {
            d = c.content;
        }
        return d;
    };
    MarkerSeries.$t = markType(MarkerSeries, 'MarkerSeries', Series.$);
    MarkerSeries.xy = null;
    MarkerSeries.x7 = DependencyProperty.i("MarkerBrush", Brush.$, MarkerSeries.$, new PropertyMetadata(1, function (a, b) {
        var c = (typeCast(MarkerSeries.$, a));
        c.raisePropertyChanged("MarkerBrush", b.oldValue, b.newValue);
    }));
    MarkerSeries.$$p = markDep(DependencyProperty, PropertyMetadata, MarkerSeries, 'raisePropertyChanged', ['ActualMarkerBrush:yg:x3', [Brush.$], 'ActualMarkerOutline:yh:x4', [Brush.$], 'ActualMarkerTemplate:xz:x5', [DataTemplate.$, null], 'IsCustomMarkerCircular:xc:x6', [0, false], 'MarkerFillMode:wz:x8', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:w3:x9', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:yj:ya', [Brush.$], 'MarkerStyle:yk:yb', [Style.$], 'MarkerTemplate:x1:yc', [DataTemplate.$, null], 'MarkerThickness:xi:yd', [1, DeviceUtils.g(2)], 'MarkerType:w9:ye', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'UseLightweightMarkers:xh:yf', [0, false]]);
    return MarkerSeries;
}(Series));
export { MarkerSeries };
/**
 * @hidden
 */
var SyncLink = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SyncLink, _super);
    function SyncLink() {
        var _this = _super.call(this) || this;
        _this.ak = null;
        _this.ah = new Dictionary$2(IEnumerable_$type, FastItemsSourceReference.$, 0);
        _this.av = null;
        _this.ad = null;
        _this.propertyChanged = null;
        _this.propertyUpdated = null;
        _this.propertyUpdated = delegateCombine(_this.propertyUpdated, function (a, b) { return _this.aq(a, b.propertyName, b.oldValue, b.newValue); });
        _this.ad = new ChartCollection();
        var a = _this.ad;
        a.collectionChanged = delegateCombine(a.collectionChanged, runOn(_this, _this.am));
        _this.av = new Rect(0, 0, 0, 1, 1);
        return _this;
    }
    SyncLink.prototype.aq = function (a, b, c, d) {
    };
    SyncLink.prototype.releaseFastItemsSource = function (a) {
        var _this = this;
        if (a != null) {
            var b_2 = null;
            if (((function () { var c = _this.ah.tryGetValue(a, b_2); b_2 = c.p1; return c.ret; })())) {
                --b_2.b;
                if (b_2.b == 0) {
                    this.ah.removeItem(a);
                }
            }
        }
        return null;
    };
    SyncLink.af = function (a) {
        return ((function () {
            var $ret = new FastItemsSource();
            $ret.e = a;
            return $ret;
        })());
    };
    SyncLink.prototype.getFastItemsSource = function (a) {
        var _this = this;
        if (SyncLink.aj == null) {
            SyncLink.aj = SyncLink.af;
        }
        var b = null;
        if (a != null) {
            var c_1 = null;
            if (!((function () { var d = _this.ah.tryGetValue(a, c_1); c_1 = d.p1; return d.ret; })())) {
                b = SyncLink.aj(a);
                c_1 = new FastItemsSourceReference(b);
                this.ah.addItem(a, c_1);
            }
            c_1.b++;
            b = c_1.a;
        }
        return b;
    };
    SyncLink.prototype.ag = function (a) {
        var _this = this;
        var b = null;
        if (a != null) {
            var c_2 = null;
            if (!((function () { var d = _this.ah.tryGetValue(a, c_2); c_2 = d.p1; return d.ret; })())) {
                return null;
            }
            b = c_2.a;
        }
        return b;
    };
    SyncLink.prototype.aw = function (a, b, c) {
        return this.ax(a, b, c, false);
    };
    SyncLink.prototype.ax = function (a, b, c, d) {
        if (!c.isEmpty) {
            c = new Rect(0, c.left, c.top, c.width, c.height);
            var e = a.hm;
            var f = a.hl;
            if (b == a) {
                if (!d) {
                    if (!b.fl()) {
                        c.x = b.wl.x;
                        c.width = b.wl.width;
                    }
                    if (!b.fm()) {
                        c.y = b.wl.y;
                        c.height = b.wl.height;
                    }
                }
            }
            else {
                var g = SyncManager.a(b);
                if (g == null || !g.synchronizeHorizontally) {
                    c.x = b.wl.x;
                    c.width = b.wl.width;
                }
                if (g == null || !g.synchronizeVertically) {
                    c.y = b.wl.y;
                    c.height = b.wl.height;
                }
            }
            var h = 0.5 * (c.left + c.right);
            var i = 0.5 * (c.top + c.bottom);
            var j = c.width;
            var k = c.height;
            var l = MathUtil.d(c.width, e, 1);
            var m = MathUtil.d(c.height, f, 1);
            var n = false;
            if (a.gg() && !a.wk.isEmpty) {
                var o = a.wk;
                var p = o.width / o.height;
                var q = l * o.width;
                var r = m * o.height;
                var s = q / r;
                if (s != p) {
                    if (r * p > q) {
                        q = r * p;
                        l = q / o.width;
                    }
                    else {
                        r = q / p;
                        m = r / o.height;
                    }
                }
            }
            else if (a.ev()) {
                var t = false;
                var u = false;
                if (Math.abs(l - a.v4.width) > e) {
                    t = true;
                }
                if (Math.abs(m - a.v4.height) > f) {
                    u = true;
                }
                var v = a.n6(l, m, t, u);
                l = v.p0;
                m = v.p1;
                l = MathUtil.d(l, e, 1);
                m = MathUtil.d(m, f, 1);
            }
            else if (b.f8) {
                var w = 1.7976931348623157E+308;
                var x = -1.7976931348623157E+308;
                var y = 1.7976931348623157E+308;
                var z = -1.7976931348623157E+308;
                var aa = c.left;
                var ab = c.right;
                var ac = c.top;
                var ad = c.bottom;
                var ae = c.width;
                var af = c.height;
                if (b.cr == 1) {
                    if (aa < 0) {
                        aa = 0;
                        ab = aa + ae;
                    }
                    if (ab > 1) {
                        ab = 1;
                        aa = ab - ae;
                    }
                    if (ac < 0) {
                        ac = 0;
                        ad = ac + af;
                    }
                    if (ad > 1) {
                        ad = 1;
                        ac = ad - af;
                    }
                }
                var ag = new Rect(0, aa, ac, ab - aa, ad - ac);
                var ah = [w, x];
                var ai = [y, z];
                for (var aj = 0; aj < b.series.count; aj++) {
                    var ak = b.series._inner[aj];
                    if (ak.es) {
                        continue;
                    }
                    {
                        var al = ak;
                        if (al.isVertical) {
                            if (c.height < 1) {
                                ai = this.ac(al, b, ag, ai);
                                y = ai[0];
                                z = ai[1];
                            }
                        }
                        else {
                            if (c.width < 1) {
                                ah = this.ab(al, b, ag, ah);
                                w = ah[0];
                                x = ah[1];
                            }
                        }
                    }
                }
                var am = (w == 1.7976931348623157E+308 || x == -1.7976931348623157E+308 || isNaN_(w) || isNaN_(x));
                var an = (y == 1.7976931348623157E+308 || z == -1.7976931348623157E+308 || isNaN_(y) || isNaN_(z));
                if (!am || !an) {
                    if (am) {
                        c = new Rect(0, y, c.top, z - y, c.height);
                    }
                    else if (an) {
                        c = new Rect(0, c.left, w, c.width, x - w);
                    }
                    else {
                        c = new Rect(0, y, w, z - y, x - w);
                    }
                    l = c.width;
                    m = c.height;
                    n = true;
                }
            }
            var ao = l != j;
            var ap = m != k;
            var aq = ao && !n ? h - 0.5 * l : c.left;
            var ar = ap && !n ? i - 0.5 * m : c.top;
            var as = ao && !n ? h + 0.5 * l : c.right;
            var at = ap && !n ? i + 0.5 * m : c.bottom;
            if (b.cr == 1) {
                if (aq < 0) {
                    aq = 0;
                    as = aq + l;
                }
                if (as > 1) {
                    as = 1;
                    aq = as - l;
                }
                if (ar < 0) {
                    ar = 0;
                    at = ar + m;
                }
                if (at > 1) {
                    at = 1;
                    ar = at - m;
                }
            }
            c = new Rect(0, aq, ar, as - aq, at - ar);
        }
        return c;
    };
    SyncLink.prototype.ab = function (a, b, c, d) {
        var e = a.ai();
        var f = d[0];
        var g = d[1];
        var h = null;
        for (var i = 0; i < e.length; i++) {
            if (e[i].cp) {
                h = e[i];
            }
        }
        if (h != null) {
            var j = new Rect(0, 0, 0, 1, 1);
            var k = new ScalerParams(0, j, j, h.ch, b.wd(j, b.wk, b.v8));
            k.b = a.ix();
            var l = a.az(c);
            var m = l == null || l.c == 1.7976931348623157E+308 || isNaN_(l.c);
            if (m) {
                return d;
            }
            var n = h.el(l.c, k);
            var o = h.el(l.b, k);
            if (h.ch) {
                var p = n;
                n = o;
                o = p;
            }
            g = Math.max(g, n);
            f = Math.min(f, o);
            if (a.cx == 2) {
                if (h.cj) {
                    var q = h;
                    var r = q.me;
                    r = h.d2(r, k);
                    var s = h.el(r, k);
                    g = Math.max(g, s);
                    f = Math.min(f, s);
                }
            }
        }
        d[0] = f;
        d[1] = g;
        return d;
    };
    SyncLink.prototype.ac = function (a, b, c, d) {
        var e = a.ai();
        var f = d[0];
        var g = d[1];
        var h = null;
        for (var i = 0; i < e.length; i++) {
            if (!e[i].cp) {
                h = e[i];
            }
        }
        if (h != null) {
            var j = new Rect(0, 0, 0, 1, 1);
            var k = new ScalerParams(0, j, j, h.ch, b.wd(j, b.wk, b.v8));
            k.b = a.ix();
            var l = a.az(c);
            var m = l == null || l.c == 1.7976931348623157E+308 || isNaN_(l.c);
            if (m) {
                return d;
            }
            var n = h.el(l.c, k);
            var o = h.el(l.b, k);
            if (h.ch) {
                var p = n;
                n = o;
                o = p;
            }
            g = Math.max(g, o);
            f = Math.min(f, n);
            if (a.cx == 2) {
                if (h.cj) {
                    var q = h;
                    var r = q.me;
                    r = h.d2(r, k);
                    var s = h.el(r, k);
                    g = Math.max(g, s);
                    f = Math.min(f, s);
                }
            }
        }
        d[0] = f;
        d[1] = g;
        return d;
    };
    Object.defineProperty(SyncLink.prototype, "ai", {
        get: function () {
            return this.ad;
        },
        enumerable: false,
        configurable: true
    });
    SyncLink.prototype.al = function (a) {
        this.ad.add(a);
    };
    SyncLink.prototype.as = function (a) {
        this.ad.remove(a);
    };
    SyncLink.prototype.ao = function () {
        var e_123, _a;
        try {
            for (var _b = __values(fromEnum(this.ad)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                if (a.wl.isEmpty) {
                    a.wl = this.aw(null, a, this.av);
                }
            }
        }
        catch (e_123_1) {
            e_123 = { error: e_123_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_123)
                    throw e_123.error;
            }
        }
    };
    SyncLink.prototype.am = function (a, b) {
        var e_124, _a;
        if (b.newItems != null) {
            try {
                for (var _b = __values(fromEn(b.newItems)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var c = _c.value;
                    if (c.wl.isEmpty) {
                        c.wl = this.aw(null, c, this.av);
                    }
                }
            }
            catch (e_124_1) {
                e_124 = { error: e_124_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_124)
                        throw e_124.error;
                }
            }
        }
    };
    SyncLink.prototype.an = function (a, b) {
        var e_125, _a;
        try {
            for (var _b = __values(fromEnum(this.ai)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                if (c == a) {
                    c.vv = { $type: Point_$type, x: b.x, y: b.y };
                }
                else {
                    var d = { $type: Point_$type, x: b.x, y: b.y };
                    var e = SyncManager.a(c);
                    if (e == null || !e.synchronizeHorizontally) {
                        d.x = NaN;
                    }
                    if (e == null || !e.synchronizeVertically) {
                        d.y = NaN;
                    }
                    c.vv = d;
                }
            }
        }
        catch (e_125_1) {
            e_125 = { error: e_125_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_125)
                    throw e_125.error;
            }
        }
    };
    SyncLink.prototype.ap = function (a, b) {
        var e_126, _a;
        try {
            for (var _b = __values(fromEnum(this.ai)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var c = _c.value;
                c.we = this.aw(a, c, b);
            }
        }
        catch (e_126_1) {
            e_126 = { error: e_126_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_126)
                    throw e_126.error;
            }
        }
    };
    SyncLink.prototype.at = function (a, b) {
        this.au(a, b, false);
    };
    SyncLink.prototype.au = function (a, b, c) {
        var e_127, _a;
        var d = b.isEmpty || isNaN_(b.x) || isNaN_(b.y) || isNaN_(b.width) || isNaN_(b.height);
        if (!d && !a.et) {
            try {
                for (var _b = __values(fromEnum(this.ai)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var e = _c.value;
                    e.et = true;
                    e.wl = this.ax(a, e, b, c);
                    e.et = false;
                }
            }
            catch (e_127_1) {
                e_127 = { error: e_127_1 };
            }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return))
                        _a.call(_b);
                }
                finally {
                    if (e_127)
                        throw e_127.error;
                }
            }
        }
    };
    SyncLink.prototype.ar = function (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));
        }
    };
    SyncLink.$t = markType(SyncLink, 'SyncLink', FrameworkElement.$, [INotifyPropertyChanged_$type, IFastItemsSourceProvider_$type]);
    SyncLink.aj = null;
    return SyncLink;
}(FrameworkElement));
export { SyncLink };
/**
 * @hidden
 */
var SyncLinkManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SyncLinkManager, _super);
    function SyncLinkManager() {
        var _this = _super.call(this) || this;
        _this.d = null;
        _this.d = new Dictionary$2(String_$type, SyncLink.$, 0);
        return _this;
    }
    SyncLinkManager.instance = function () {
        if (SyncLinkManager.b == null) {
            SyncLinkManager.b = new SyncLinkManager();
        }
        return SyncLinkManager.b;
    };
    Object.defineProperty(SyncLinkManager.prototype, "e", {
        get: function () {
            return this.d.count;
        },
        enumerable: false,
        configurable: true
    });
    SyncLinkManager.prototype.getLink = function (a) {
        var _this = this;
        var b;
        if (((function () { var c = _this.d.tryGetValue(a, b); b = c.p1; return c.ret; })())) {
            return b;
        }
        b = new SyncLink();
        b.ak = a;
        this.d.addItem(a, b);
        return b;
    };
    SyncLinkManager.prototype.releaseLink = function (a) {
        if (a.ai.count == 0 && a.ak != null && this.d.containsKey(a.ak)) {
            this.d.removeItem(a.ak);
        }
    };
    SyncLinkManager.$t = markType(SyncLinkManager, 'SyncLinkManager');
    SyncLinkManager.b = null;
    return SyncLinkManager;
}(Base));
export { SyncLinkManager };
/**
 * @hidden
 */
var SyncManager = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SyncManager, _super);
    function SyncManager() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    SyncManager.e = function (a) {
        var b = SyncManager.a(a);
        if (b == null) {
            return;
        }
        if (!a.fg) {
            return;
        }
        if (a.syncChannel != b.syncChannel) {
            return;
        }
        SyncManager.b(a, a.syncChannel, null);
    };
    SyncManager.c = function (a) {
        var b = SyncManager.a(a);
        if (b == null) {
            return;
        }
        if (a.fg && a.syncChannel == b.syncChannel) {
            return;
        }
        var c = null;
        if (a.fg) {
            c = a.syncChannel;
        }
        SyncManager.b(a, c, b.syncChannel);
    };
    SyncManager.b = function (a, b, c) {
        if (a != null) {
            if (stringIsNullOrEmpty(c)) {
                var d = a.actualSyncLink;
                a.actualSyncLink = null;
                a.actualSyncLink = new SyncLink();
                if (d != null) {
                    SyncLinkManager.instance().releaseLink(d);
                }
                a.syncChannel = null;
            }
            else {
                if (!stringIsNullOrEmpty(b)) {
                    var e = a.actualSyncLink;
                    a.actualSyncLink = null;
                    if (e != null) {
                        SyncLinkManager.instance().releaseLink(e);
                    }
                }
                a.actualSyncLink = SyncLinkManager.instance().getLink(c);
                a.syncChannel = c;
            }
        }
    };
    SyncManager.d = function (a, b) {
        a.syncSettings = b;
    };
    SyncManager.a = function (a) {
        return a.syncSettings;
    };
    SyncManager.$t = markType(SyncManager, 'SyncManager');
    return SyncManager;
}(Base));
export { SyncManager };
/**
 * @hidden
 */
var ChartCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartCollection, _super);
    function ChartCollection() {
        var _this = _super.call(this, SeriesViewer.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    ChartCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    ChartCollection.$t = markType(ChartCollection, 'ChartCollection', ObservableCollection$1.$.specialize(SeriesViewer.$));
    return ChartCollection;
}(ObservableCollection$1));
export { ChartCollection };
/**
 * @hidden
 */
var SeriesCollection = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesCollection, _super);
    function SeriesCollection() {
        var _this = _super.call(this, Series.$, 0) || this;
        _this.collectionResetting = null;
        return _this;
    }
    SeriesCollection.prototype.p = function () {
        if (this.collectionResetting != null) {
            this.collectionResetting(this, null);
        }
        _super.prototype.p.call(this);
    };
    SeriesCollection.$t = markType(SeriesCollection, 'SeriesCollection', ObservableCollection$1.$.specialize(Series.$));
    return SeriesCollection;
}(ObservableCollection$1));
export { SeriesCollection };
/**
 * @hidden
 */
var PlotAreaMouseEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PlotAreaMouseEventArgs, _super);
    function PlotAreaMouseEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._chartPosition = null;
        _this._plotAreaPosition = null;
        _this._isDuringManipulation = false;
        _this._viewer = null;
        _this.viewer = a;
        _this.chartPosition = b;
        _this.plotAreaPosition = c;
        return _this;
    }
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "chartPosition", {
        get: function () {
            return this._chartPosition;
        },
        set: function (a) {
            this._chartPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "isDuringManipulation", {
        get: function () {
            return this._isDuringManipulation;
        },
        set: function (a) {
            this._isDuringManipulation = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseEventArgs.prototype, "viewer", {
        get: function () {
            return this._viewer;
        },
        set: function (a) {
            this._viewer = a;
        },
        enumerable: false,
        configurable: true
    });
    PlotAreaMouseEventArgs.$t = markType(PlotAreaMouseEventArgs, 'PlotAreaMouseEventArgs', EventArgs.$);
    return PlotAreaMouseEventArgs;
}(EventArgs));
export { PlotAreaMouseEventArgs };
/**
 * @hidden
 */
var PlotAreaMouseButtonEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(PlotAreaMouseButtonEventArgs, _super);
    function PlotAreaMouseButtonEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._chartPosition = null;
        _this._plotAreaPosition = null;
        _this._manipulationOccurred = false;
        _this._viewer = null;
        _this.viewer = a;
        _this.chartPosition = b;
        _this.plotAreaPosition = c;
        return _this;
    }
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "chartPosition", {
        get: function () {
            return this._chartPosition;
        },
        set: function (a) {
            this._chartPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "manipulationOccurred", {
        get: function () {
            return this._manipulationOccurred;
        },
        set: function (a) {
            this._manipulationOccurred = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(PlotAreaMouseButtonEventArgs.prototype, "viewer", {
        get: function () {
            return this._viewer;
        },
        set: function (a) {
            this._viewer = a;
        },
        enumerable: false,
        configurable: true
    });
    PlotAreaMouseButtonEventArgs.$t = markType(PlotAreaMouseButtonEventArgs, 'PlotAreaMouseButtonEventArgs', EventArgs.$);
    return PlotAreaMouseButtonEventArgs;
}(EventArgs));
export { PlotAreaMouseButtonEventArgs };
/**
 * @hidden
 */
var ChartCursorEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartCursorEventArgs, _super);
    function ChartCursorEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._item = null;
        _this._series = null;
        _this._seriesViewer = null;
        _this.seriesViewer = a;
        _this.series = b;
        _this.item = c;
        return _this;
    }
    ChartCursorEventArgs.prototype.toString = function () {
        return this.seriesViewer.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "");
    };
    Object.defineProperty(ChartCursorEventArgs.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartCursorEventArgs.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartCursorEventArgs.prototype, "seriesViewer", {
        get: function () {
            return this._seriesViewer;
        },
        set: function (a) {
            this._seriesViewer = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartCursorEventArgs.prototype, "chart", {
        get: function () {
            return typeCast(XamDataChart.$, this.seriesViewer);
        },
        enumerable: false,
        configurable: true
    });
    ChartCursorEventArgs.$t = markType(ChartCursorEventArgs, 'ChartCursorEventArgs', EventArgs.$);
    return ChartCursorEventArgs;
}(EventArgs));
export { ChartCursorEventArgs };
/**
 * @hidden
 */
var SeriesViewerSelectedSeriesItemsChangedEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesViewerSelectedSeriesItemsChangedEventArgs, _super);
    function SeriesViewerSelectedSeriesItemsChangedEventArgs(a, b, c) {
        var _this = _super.call(this) || this;
        _this._oldItems = null;
        _this._newItems = null;
        _this._currentItems = null;
        _this.oldItems = a;
        _this.newItems = b;
        _this.currentItems = c;
        return _this;
    }
    Object.defineProperty(SeriesViewerSelectedSeriesItemsChangedEventArgs.prototype, "oldItems", {
        get: function () {
            return this._oldItems;
        },
        set: function (a) {
            this._oldItems = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerSelectedSeriesItemsChangedEventArgs.prototype, "newItems", {
        get: function () {
            return this._newItems;
        },
        set: function (a) {
            this._newItems = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesViewerSelectedSeriesItemsChangedEventArgs.prototype, "currentItems", {
        get: function () {
            return this._currentItems;
        },
        set: function (a) {
            this._currentItems = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesViewerSelectedSeriesItemsChangedEventArgs.$t = markType(SeriesViewerSelectedSeriesItemsChangedEventArgs, 'SeriesViewerSelectedSeriesItemsChangedEventArgs', EventArgs.$);
    return SeriesViewerSelectedSeriesItemsChangedEventArgs;
}(EventArgs));
export { SeriesViewerSelectedSeriesItemsChangedEventArgs };
/**
 * @hidden
 */
var DataChartMouseButtonEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataChartMouseButtonEventArgs, _super);
    function DataChartMouseButtonEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this.j = { $type: Point_$type, x: NaN, y: NaN };
        _this.i = null;
        _this.d = false;
        _this._item = null;
        _this._series = null;
        _this._plotAreaPosition = null;
        _this._chart = null;
        _this.chart = a;
        _this.series = b;
        _this.item = c;
        _this.i = d;
        _this.plotAreaPosition = e;
        return _this;
    }
    DataChartMouseButtonEventArgs.prototype.toString = function () {
        return this.chart.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "") + ", " + this.getPosition(null).toString();
    };
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "handled", {
        get: function () {
            return this.i.handled;
        },
        set: function (a) {
            this.i.handled = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "cancelSelection", {
        get: function () {
            return this.d;
        },
        set: function (a) {
            this.d = a;
        },
        enumerable: false,
        configurable: true
    });
    DataChartMouseButtonEventArgs.prototype.getPosition = function (a) {
        return this.i.getPosition(a);
    };
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "originalSource", {
        get: function () {
            return this.i.originalSource;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "chartPosition", {
        get: function () {
            if (isNaN_(this.j.x) && isNaN_(this.j.y)) {
                this.j.x = this.plotAreaPosition.x - this.chart.wk.left;
                this.j.y = this.plotAreaPosition.y - this.chart.wk.top;
            }
            return this.j;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(DataChartMouseButtonEventArgs.prototype, "chart", {
        get: function () {
            return this._chart;
        },
        set: function (a) {
            this._chart = a;
        },
        enumerable: false,
        configurable: true
    });
    DataChartMouseButtonEventArgs.$t = markType(DataChartMouseButtonEventArgs, 'DataChartMouseButtonEventArgs', EventArgs.$);
    return DataChartMouseButtonEventArgs;
}(EventArgs));
export { DataChartMouseButtonEventArgs };
/**
 * @hidden
 */
var ChartMouseEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartMouseEventArgs, _super);
    function ChartMouseEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _this.f = null;
        _this._item = null;
        _this._series = null;
        _this._plotAreaPosition = null;
        _this.g = { $type: Point_$type, x: NaN, y: NaN };
        _this._chart = null;
        _this.chart = a;
        _this.series = b;
        _this.item = c;
        _this.f = d;
        _this.plotAreaPosition = e;
        return _this;
    }
    ChartMouseEventArgs.prototype.toString = function () {
        return this.chart.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "") + ", " + this.getPosition(null).toString();
    };
    ChartMouseEventArgs.prototype.getPosition = function (a) {
        return this.f.getPosition(a);
    };
    Object.defineProperty(ChartMouseEventArgs.prototype, "originalSource", {
        get: function () {
            return this.f.originalSource;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "item", {
        get: function () {
            return this._item;
        },
        set: function (a) {
            this._item = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "plotAreaPosition", {
        get: function () {
            return this._plotAreaPosition;
        },
        set: function (a) {
            this._plotAreaPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "chartPosition", {
        get: function () {
            if (isNaN_(this.g.x) && isNaN_(this.g.y)) {
                this.g.x = this.plotAreaPosition.x - this.chart.wk.left;
                this.g.y = this.plotAreaPosition.y - this.chart.wk.top;
            }
            return this.g;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartMouseEventArgs.prototype, "chart", {
        get: function () {
            return this._chart;
        },
        set: function (a) {
            this._chart = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartMouseEventArgs.$t = markType(ChartMouseEventArgs, 'ChartMouseEventArgs', EventArgs.$);
    return ChartMouseEventArgs;
}(EventArgs));
export { ChartMouseEventArgs };
/**
 * @hidden
 */
var AxisComponentsForView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisComponentsForView, _super);
    function AxisComponentsForView() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        return _this;
    }
    AxisComponentsForView.$t = markType(AxisComponentsForView, 'AxisComponentsForView');
    return AxisComponentsForView;
}(Base));
export { AxisComponentsForView };
/**
 * @hidden
 */
var AxisLabelPanelBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisLabelPanelBaseView, _super);
    function AxisLabelPanelBaseView(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.aw = null;
        _this.e = null;
        _this.av = Rect.empty;
        _this.c = null;
        _this.h = 0;
        _this.i = NaN;
        _this.a = a;
        return _this;
    }
    AxisLabelPanelBaseView.prototype.aa = function (a, b, c, d, e, f) {
        var g = typeCast(FrameworkElement.$, a);
        if (g != null) {
            g._visibility = 0;
            if (b.width == 0 && b.height == 0) {
                g._visibility = 1;
            }
            var h = b.height - (d + f);
            var i = b.width - (c + e);
            g.n = b.left + c;
            g.o = b.top + d;
            if (i < 0) {
                i = 0;
            }
            if (h < 0) {
                h = 0;
            }
            g.l = h;
            g.m = i;
            if (g.j != null) {
                var j = g.j;
                var k = j.j._inner[0];
                k.k = k.k + g.n;
                k.l = k.l + g.o;
            }
        }
    };
    AxisLabelPanelBaseView.prototype.z = function (a, b, c, d, e, f, g, h) {
        var i = Math.max(e, Math.max(f, Math.max(g, h)));
        var j = new Thickness(0, i);
        if (this.a.av) {
            j = new Thickness(0, Math.sqrt((i * i) / 2));
        }
        var k = c.d;
        if (isNaN_(k.left) || isNaN_(k.top) || isNaN_(k.right) || isNaN_(k.bottom)) {
            k = j;
        }
        if (k.left > j.left || k.top > j.top || k.right > j.right || k.bottom > j.bottom) {
            k = j;
        }
        var l = new Rect(0, d.left - k.left, d.top - k.top, d.width + k.left + k.right, d.height + k.top + k.bottom);
        var m = a.j;
        a.j = null;
        this.aa(a, l, e, f, g, h);
        a.j = m;
        a.width = a.m;
        a.height = a.l;
    };
    AxisLabelPanelBaseView.prototype.ae = function (a) {
        var b = a;
        b.j = null;
    };
    AxisLabelPanelBaseView.prototype.ah = function (a) {
    };
    AxisLabelPanelBaseView.prototype.ai = function (a, b) {
    };
    AxisLabelPanelBaseView.prototype.aj = function (a, b) {
        var c = typeCast(FrameworkElement.$, a);
        var d = 0;
        var e = 0;
        var f = new TransformGroup();
        var g = ((function () {
            var $ret = new RotateTransform();
            $ret.j = b;
            $ret.k = d;
            $ret.l = e;
            return $ret;
        })());
        f.j.add(g);
        c.j = f;
    };
    AxisLabelPanelBaseView.prototype.ar = function (a, b, c, d, e, f, g, h, i) {
        var j = Math.max(e, Math.max(f, Math.max(g, h)));
        var k = new Thickness(0, j);
        if (this.a.av) {
            k = new Thickness(0, Math.sqrt((j * j) / 2));
        }
        var l = c.d;
        if (isNaN_(l.left) || isNaN_(l.top) || isNaN_(l.right) || isNaN_(l.bottom)) {
            l = k;
        }
        if (l.left > k.left || l.top > k.top || l.right > k.right || l.bottom > k.bottom) {
            l = k;
        }
        var m = b.j;
        var n = new TransformGroup();
        var o = a.n + l.left;
        var p = a.o + l.top;
        n.j.add(m);
        a.j = n;
    };
    AxisLabelPanelBaseView.prototype.ad = function (a) {
        a.j = null;
    };
    AxisLabelPanelBaseView.prototype.x = function (a, b, c, d) {
        var e = a.al.length;
        var f = a.al;
        var g = a.al;
        while ((this.m(a) + c + d) > b && e > 0) {
            e--;
            f = f.substr(0, e) + "\u2026";
            a.al = f;
        }
        a.al = g;
        return f;
    };
    AxisLabelPanelBaseView.prototype.af = function () {
        var e_128, _a;
        if (this.e == null) {
            return;
        }
        var a = this.g();
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                var c = typeCast(FrameworkElement.$, b);
                if (c != null) {
                    this.a.cg(c);
                }
                this.a.b7(b);
            }
        }
        catch (e_128_1) {
            e_128 = { error: e_128_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_128)
                    throw e_128.error;
            }
        }
    };
    AxisLabelPanelBaseView.prototype.g = function () {
        var a = this.a.a1();
        var b = this.a.a0();
        if (!this.a.ad.c7) {
            return a;
        }
        else {
            return b;
        }
    };
    AxisLabelPanelBaseView.prototype.l = function (a) {
        if (this.a.ad != null && this.a.ad.bz) {
            return this.ax(a).height;
        }
        else {
            return this.h;
        }
    };
    AxisLabelPanelBaseView.prototype.n = function (a) {
        return this.l(a) + this.r() + this.o();
    };
    AxisLabelPanelBaseView.prototype.an = function () {
        this.aw = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            return $ret;
        })());
    };
    AxisLabelPanelBaseView.prototype.m = function (a) {
        if (this.a.ad != null && this.a.ad.bz) {
            return this.ax(a).width;
        }
        else {
            var b = a;
            if (b != null && b.al != null) {
                return this.e.f(b);
            }
            return 0;
        }
    };
    AxisLabelPanelBaseView.prototype.w = function (a) {
        var b = a;
        if (b != null && b.al != null) {
            return this.m(a) + this.p() + this.q();
        }
        return 0;
    };
    AxisLabelPanelBaseView.prototype.ax = function (a) {
        var b = a;
        if (b != null && b.al != null) {
            b.ag = true;
            var c = this.e.ah(b, this.h, true);
            return new Size(1, c.c, c.b);
        }
        return new Size(1, 0, 0);
    };
    AxisLabelPanelBaseView.prototype.ac = function () {
        this.a.bh = this.a.ad.er();
    };
    AxisLabelPanelBaseView.prototype.ak = function () {
        this.ag();
        this.a.c8(new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
    };
    AxisLabelPanelBaseView.prototype.f = function () {
        return this.e;
    };
    AxisLabelPanelBaseView.prototype.al = function (a) {
        this.e = a;
    };
    AxisLabelPanelBaseView.prototype.y = function () {
        if (this.a.c1.isEmpty) {
            return;
        }
        var a = this.a.bd;
        this.a.c6(new Size(1, this.a.c1.width, this.a.c1.height));
        if (this.a.bd != a) {
            this.a.ad.bg.n3();
            this.am();
        }
    };
    AxisLabelPanelBaseView.prototype.am = function () {
    };
    AxisLabelPanelBaseView.prototype.ap = function (a) {
        this.e.x(a);
    };
    AxisLabelPanelBaseView.prototype.ao = function () {
        var e_129, _a, e_130, _b;
        if (this.e == null) {
            return;
        }
        if (this.e.d) {
            if (this.a.ad.bi != null && this.a.ad.bi.hi != 1) {
                this.e.aa();
                this.e.ab(this.a.ad.bi.hi, this.a.ad.bi.hi);
            }
            this.ag();
            this.av = this.a.c1;
            var a = this.a.ad.bg.getFontBrush();
            if (this.a.ag != null && this.a.ag.textColor != null) {
                a = this.a.ag.textColor;
            }
            if (this.a.j != null) {
                this.e.aa();
                this.e.k(this.a.j);
            }
            var b = false;
            try {
                for (var _c = __values(fromEnum(this.g())), _d = _c.next(); !_d.done; _d = _c.next()) {
                    var c = _d.value;
                    var d = typeCast(TextBlock.$, c);
                    if (d != null) {
                        if (d.s != 0) {
                            b = true;
                            continue;
                        }
                        d.ao = a;
                        if (d.j != null) {
                            this.e.aa();
                            this.e.k(d.j);
                        }
                        this.ap(d);
                        if (d.j != null) {
                            this.e.z();
                        }
                    }
                }
            }
            catch (e_129_1) {
                e_129 = { error: e_129_1 };
            }
            finally {
                try {
                    if (_d && !_d.done && (_a = _c.return))
                        _a.call(_c);
                }
                finally {
                    if (e_129)
                        throw e_129.error;
                }
            }
            if (b) {
                try {
                    for (var _e = __values(fromEnum(this.a.ab)), _f = _e.next(); !_f.done; _f = _e.next()) {
                        var e = _f.value;
                        var f = typeCast(Rectangle.$, e);
                        if (f != null) {
                            if (f.s == 0) {
                                continue;
                            }
                            if (f.j != null) {
                                this.e.aa();
                                this.e.k(f.j);
                            }
                            this.e.w(f);
                            if (f.j != null) {
                                this.e.z();
                            }
                        }
                        var g = typeCast(TextBlock.$, e);
                        if (g != null) {
                            if (g.s == 0) {
                                continue;
                            }
                            if (g.j != null) {
                                this.e.aa();
                                this.e.k(g.j);
                            }
                            if (g.ao == null) {
                                g.ao = a;
                            }
                            this.e.x(g);
                            if (g.j != null) {
                                this.e.z();
                            }
                        }
                    }
                }
                catch (e_130_1) {
                    e_130 = { error: e_130_1 };
                }
                finally {
                    try {
                        if (_f && !_f.done && (_b = _e.return))
                            _b.call(_e);
                    }
                    finally {
                        if (e_130)
                            throw e_130.error;
                    }
                }
            }
            if (this.a.j != null) {
                this.e.z();
            }
            this.aq();
            a = this.at();
            this.e.ad(this.d());
            var h = this.a.ad.iv;
            if (h != null) {
                h.ao = a;
                if (h.j != null) {
                    this.e.aa();
                    this.e.k(h.j);
                }
                this.e.x(h);
                if (h.j != null) {
                    this.e.z();
                }
            }
            if (this.a.ad.bi != null && this.a.ad.bi.hi != 1) {
                this.e.z();
            }
        }
    };
    AxisLabelPanelBaseView.prototype.d = function () {
        var a = this.a.ad.bi.getFontInfo();
        if (this.a.ad.bf != null && this.a.ad.bf.textStyle != null) {
            a = this.a.ad.bf.h(this.a.ad.bi.c9.j.ae);
        }
        else {
            var b = this.a.ad.bi.df();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    AxisLabelPanelBaseView.prototype.at = function () {
        var a = this.a.ad.bg.getFontBrush();
        if (this.a.ad.bf != null && this.a.ad.bf.textColor != null) {
            a = this.a.ad.bf.textColor;
        }
        else {
            var b = this.a.ad.bi.vb();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    AxisLabelPanelBaseView.prototype.ag = function () {
        if (this.e == null) {
            return;
        }
        var a = this.a.ad.bi.getFontInfo();
        if (this.a.ag != null && this.a.ag.j) {
            a = this.a.ag.h(this.a.ad.bi.c9.j.ae);
        }
        if (this.c != a) {
            this.c = a;
            this.as();
        }
        this.e.ad(a);
    };
    AxisLabelPanelBaseView.prototype.as = function () {
        if (this.a.ad != null && this.a.ad.bi != null) {
            if (this.a.ag == null || this.a.ag.textStyle == null) {
                this.h = this.a.ad.bi.c9.a9;
                return;
            }
            if (this.h == 0) {
                this.h = this.a.ad.bi.c9.a9;
            }
            var a = this.h;
            var b = this.a.ad.bi.getFontInfo();
            if (this.a.ag != null && this.a.ag.textStyle != null) {
                b = this.a.ag.h(this.a.ad.bi.c9.j.ae);
            }
            var c = FontUtil.getCurrentFontHeight(this.a.ad.bi.c9.j.ae, b);
            this.h = c;
            if (a != this.h) {
                this.a.ad.bi.n3();
            }
        }
    };
    AxisLabelPanelBaseView.prototype.j = function () {
        if (this.a.ad.g8 == null) {
            return 0;
        }
        if (this.a.ad.bf != null && this.a.ad.bf.visibility == 1) {
            return 0;
        }
        if (!isNaN_(this.i)) {
            return this.i;
        }
        var a = this.d();
        if (this.a.ad.bi == null) {
            return this.h;
        }
        this.i = FontUtil.getCurrentFontHeight(this.a.ad.bi.c9.j.ae, a);
        return this.i;
    };
    AxisLabelPanelBaseView.prototype.k = function () {
        if (this.a.ad.bf != null && this.a.ad.bf.visibility == 1) {
            return 0;
        }
        if (this.e == null) {
            return 0;
        }
        var a = this.a.ad.iv;
        if (a != null && a.al != null) {
            this.e.ad(this.d());
            var b = this.e.f(a);
            this.ag();
            return b;
        }
        return 0;
    };
    AxisLabelPanelBaseView.prototype.aq = function () {
        if (this.a.ab.count == 0) {
            return;
        }
        if (this.a.ad.j3 == null) {
            this.aw._stroke = this.a.ad.bg.u8();
        }
        else {
            this.aw._stroke = this.a.ad.j3;
        }
        this.aw.ad = this.a.ad.fk;
        this.e.t(this.aw);
    };
    AxisLabelPanelBaseView.prototype.ab = function (a) {
    };
    AxisLabelPanelBaseView.prototype.ay = function () {
        return this.a.ad.bi.wn();
    };
    AxisLabelPanelBaseView.prototype.v = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.topMargin)) {
            return Math.max(0, this.a.ad.bf.topMargin);
        }
        else {
            return this.ay().top;
        }
    };
    AxisLabelPanelBaseView.prototype.s = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.bottomMargin)) {
            return Math.max(0, this.a.ad.bf.bottomMargin);
        }
        else {
            return this.ay().bottom;
        }
    };
    AxisLabelPanelBaseView.prototype.t = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.leftMargin)) {
            return Math.max(0, this.a.ad.bf.leftMargin);
        }
        else {
            return this.ay().left;
        }
    };
    AxisLabelPanelBaseView.prototype.u = function () {
        if (this.a.ad.bf != null && !isNaN_(this.a.ad.bf.rightMargin)) {
            return Math.max(0, this.a.ad.bf.rightMargin);
        }
        else {
            return this.ay().right;
        }
    };
    AxisLabelPanelBaseView.prototype.au = function () {
        return this.aw.an.d;
    };
    AxisLabelPanelBaseView.prototype.b = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.ad.j3;
            $ret.c = _this.a.ad.fk;
            return $ret;
        })());
        if (this.a.ad != null && typeCast(XamDataChart.$, this.a.ad.bg) !== null) {
            var b = this.a.ad.bg;
            if (b.xc && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    AxisLabelPanelBaseView.prototype.r = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.topMargin);
    };
    AxisLabelPanelBaseView.prototype.p = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.leftMargin);
    };
    AxisLabelPanelBaseView.prototype.q = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.rightMargin);
    };
    AxisLabelPanelBaseView.prototype.o = function () {
        if (this.a.ag == null) {
            return 0;
        }
        return Math.max(0, this.a.ag.bottomMargin);
    };
    AxisLabelPanelBaseView.$t = markType(AxisLabelPanelBaseView, 'AxisLabelPanelBaseView');
    return AxisLabelPanelBaseView;
}(Base));
export { AxisLabelPanelBaseView };
/**
 * @hidden
 */
var AxisView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(AxisView, _super);
    function AxisView(a) {
        var _this = _super.call(this) || this;
        _this.a = null;
        _this.bd = null;
        _this.be = null;
        _this.bg = null;
        _this.bf = null;
        _this.b = new AxisComponentsFromView();
        _this.h = null;
        _this.k = null;
        _this.j = null;
        _this._isDirty = false;
        _this.bh = null;
        _this.bb = Rect.empty;
        _this.a = a;
        _this.bh = new Rectangle();
        return _this;
    }
    AxisView.prototype.al = function () {
        this.bd = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            return $ret;
        })());
        this.bg = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            $ret.stroke = null;
            return $ret;
        })());
        this.be = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            return $ret;
        })());
        this.bf = ((function () {
            var $ret = new Path();
            $ret.an = new GeometryGroup();
            $ret.ab = false;
            return $ret;
        })());
        this.a.j3 = AxisDefaults.j;
        this.a.fj = AxisDefaults.d;
        this.a.fk = AxisDefaults.e;
        this.a.et = AxisDefaults.b;
        this.a.ew = AxisDefaults.c;
        this.a.fi = AxisDefaults.a;
    };
    AxisView.prototype.an = function (a) {
    };
    AxisView.prototype.a3 = function () {
        var a = new TextBlock();
        return a;
    };
    AxisView.prototype.aw = function (a) {
        a._visibility = 0;
        a.s = 0;
        if (a.x == null) {
            this.a.aw.ab.add(a);
        }
    };
    AxisView.prototype.ay = function (a) {
        a._visibility = 1;
    };
    AxisView.prototype.ax = function (a) {
        if (this.a.aw.ab.contains(a)) {
            this.a.aw.ab.remove(a);
        }
    };
    AxisView.prototype.bi = function () {
        var a = new Rectangle();
        return a;
    };
    AxisView.prototype.t = function (a) {
        if (a.x == null) {
            this.d.ab.add(a);
        }
        a._visibility = 0;
    };
    AxisView.prototype.v = function (a) {
        a._visibility = 1;
    };
    AxisView.prototype.u = function (a) {
        if (this.a.aw.ab.contains(a)) {
            this.a.aw.ab.remove(a);
        }
    };
    AxisView.prototype.ao = function () {
    };
    AxisView.prototype.p = function () {
        return true;
    };
    Object.defineProperty(AxisView.prototype, "index", {
        get: function () {
            if (this.a.bi != null && this.a.bi.fd) {
                return this.a.bi.series.count + 1;
            }
            var a = typeCast(XamDataChart.$, this.a.bg);
            var b = 0;
            if (a == null) {
                return 0;
            }
            if (a != null && a.ww == 1) {
                var c = 0;
                for (var d = 0; d < this.a.bi.series.count; d++) {
                    if (this.a.bi.series._inner[d].isStacked) {
                        c += this.a.bi.series._inner[d].kb();
                    }
                    else {
                        c++;
                    }
                }
                b = c;
            }
            return b + a.axes.indexOf(this.a);
        },
        enumerable: false,
        configurable: true
    });
    AxisView.prototype.ai = function () {
        this.d.cf();
        this.d.b3();
    };
    AxisView.prototype.ag = function () {
        this.d.ca();
    };
    AxisView.prototype.ac = function () {
        if (this.d != null) {
            this.d.ab.clear();
        }
        this.ae(this.bd.an.d);
        this.ae(this.bg.an.d);
        this.ae(this.be.an.d);
        this.ae(this.bf.an.d);
        this.aj();
    };
    AxisView.prototype.a1 = function (a) {
        this.bd._visibility = a;
        this.be._visibility = a;
        this.bg._visibility = a;
        this.bf._visibility = a;
    };
    AxisView.prototype.at = function () {
    };
    AxisView.prototype.ab = function (a) {
        this.a.cq = true;
        if (this.a.bi != null) {
            this.a.bi.n3();
        }
        this.a.ia();
    };
    AxisView.prototype.c = function () {
        this.b.a = this.bd;
        this.b.b = this.be;
        this.b.c = this.bf;
        this.b.d = this.bg;
        return this.b;
    };
    AxisView.prototype.ae = function (a) {
        if (a != null) {
            a.clear();
        }
    };
    AxisView.prototype.a4 = function () {
        return this.bd.an.d;
    };
    AxisView.prototype.e = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.j2;
            $ret.c = _this.a.fi;
            $ret.f = _this.a.j6;
            return $ret;
        })());
        if (typeCast(XamDataChart.$, this.a.bg) !== null) {
            var b = this.a.bg;
            if (b.xc && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    AxisView.prototype.a7 = function () {
        return this.bg.an.d;
    };
    AxisView.prototype.a5 = function () {
        return this.be.an.d;
    };
    AxisView.prototype.f = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.jz;
            $ret.c = _this.a.et;
            $ret.f = _this.a.j4;
            return $ret;
        })());
        if (typeCast(XamDataChart.$, this.a.bg) !== null) {
            var b = this.a.bg;
            if (b.xc && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    AxisView.prototype.a6 = function () {
        return this.bf.an.d;
    };
    AxisView.prototype.g = function () {
        var _this = this;
        var a = ((function () {
            var $ret = new PathRenderingInfo();
            $ret.e = _this.a.j0;
            $ret.c = _this.a.ew;
            $ret.f = _this.a.j5;
            return $ret;
        })());
        if (typeCast(XamDataChart.$, this.a.bg) !== null) {
            var b = this.a.bg;
            if (b.xc && b.c0 != 2 && b.c0 != 1) {
                a.a = true;
            }
        }
        return a;
    };
    Object.defineProperty(AxisView.prototype, "d", {
        get: function () {
            return this.a.aq().a;
        },
        enumerable: false,
        configurable: true
    });
    AxisView.prototype.az = function (a, b, c) {
        this.d.ad = a;
        this.d.c5 = b;
        this.d.c4 = c;
        this.aj();
    };
    AxisView.prototype.ad = function () {
        this.d.ab.clear();
        this.aj();
    };
    AxisView.prototype.av = function (a) {
        this.d.bw = a;
        this.aj();
    };
    AxisView.prototype.a0 = function (a, b) {
        this.d.a9 = a;
        this.d.ba = b;
        this.d.ar = false;
    };
    AxisView.prototype.au = function (a) {
        this.d.bg = a;
    };
    AxisView.prototype.aa = function () {
    };
    AxisView.prototype.s = function (a) {
        return null;
    };
    AxisView.prototype.z = function () {
    };
    AxisView.prototype.aq = function () {
    };
    AxisView.prototype.l = function () {
        return true;
    };
    AxisView.prototype.o = function () {
        return false;
    };
    AxisView.prototype.m = function () {
        return false;
    };
    AxisView.prototype.r = function (dataItem_) {
        if (this.a.au != null) {
            return this.a.au(dataItem_);
        }
        if (this.a.ai != null) {
            return this.a.ai.i(dataItem_);
        }
        return null;
    };
    AxisView.prototype.q = function (dataItem_) {
        if (this.o() && this.m()) {
            return this.r(dataItem_);
        }
        else {
            if (this.a.au != null) {
                return this.a.au(dataItem_);
            }
            if (this.a.ai != null) {
                return this.a.ai.i(dataItem_);
            }
        }
        var label_ = this.a.f2;
        var a = typeof dataItem_ === 'number' && typeof label_ === 'string';
        var labelValue_ = null;
        if (this.h != null) {
            labelValue_ = this.h.getPropertyValue(dataItem_);
            if ((labelValue_ === undefined)) {
                labelValue_ = label_;
            }
        }
        else {
            labelValue_ = a ? stringFormat(label_, dataItem_) : (typeof dataItem_[label_] != 'undefined') ? dataItem_[label_] : label_;
            ;
        }
        if (this.a.expectFunctions) {
            if ((typeof (labelValue_) == 'function')) {
                labelValue_ = labelValue_();
            }
        }
        return labelValue_;
    };
    AxisView.prototype.ak = function (a, b) {
        this.j = a;
        this.k = b;
    };
    Object.defineProperty(AxisView.prototype, "isDirty", {
        get: function () {
            return this._isDirty;
        },
        set: function (a) {
            this._isDirty = a;
        },
        enumerable: false,
        configurable: true
    });
    AxisView.prototype.aj = function () {
        if (this.a.bg == null || this.j == null) {
            return;
        }
        if (!this.isDirty) {
            this.isDirty = true;
            this.a.bg.al.r(this.j, this.k);
        }
    };
    AxisView.prototype.undirty = function (a) {
        this.isDirty = false;
        this.ar(a);
    };
    AxisView.prototype.ar = function (a) {
        if (this.j == null) {
            return;
        }
        if (this.j.d) {
            if (this.a.bi != null && this.a.bi.hi != 1) {
                this.j.aa();
                this.j.ab(this.a.bi.hi, this.a.bi.hi);
            }
            var b = this.a.bg.v9();
            if (a) {
                if (!this.j.e) {
                    this.j.l(b.left, b.top, b.width, b.height);
                }
            }
            if (a) {
                if (this.a.bi.vk != null && !this.a.kh.isEmpty) {
                    this.bh.o = this.a.kh.top;
                    this.bh.n = this.a.kh.left;
                    this.bh.width = this.a.kh.width;
                    this.bh.height = this.a.kh.height;
                    this.bh._fill = this.a.bi.vk;
                    this.j.w(this.bh);
                }
            }
            this.j.aa();
            this.j.af(this.a.kh);
            this.as();
            this.j.z();
            if (this.a.bi != null && this.a.bi.hi != 1) {
                this.j.z();
            }
        }
        if (this.k.d) {
            if (this.a.bi != null && this.a.bi.hi != 1) {
                this.k.aa();
                this.k.ab(this.a.bi.hi, this.a.bi.hi);
            }
            var c = this.bb;
            var d = this.a.bg.v9();
            if (!c.isEmpty && a) {
                if (!this.k.e) {
                    this.k.l(d.left, d.top, d.width, d.height);
                }
            }
            if (this.a.bi != null && this.a.bi.hi != 1) {
                this.k.z();
            }
        }
    };
    AxisView.prototype.postRender = function () {
        this.d.ck();
    };
    AxisView.prototype.as = function () {
        if (this.j.d) {
            this.bd._stroke = this.a.jy;
            this.bg._fill = this.a.j1;
            this.bf._stroke = this.a.jx;
            this.be._stroke = this.a.jw;
            this.bf.ad = this.a.ew;
            this.be.ad = this.a.et;
            this.bd.ad = this.a.fi;
            this.bf.ai = this.a.j5;
            this.be.ai = this.a.j4;
            this.bd.ai = this.a.j6;
            this.bb = this.a.kh;
            this.j.t(this.bd);
            this.j.t(this.bg);
            this.j.t(this.be);
            this.j.t(this.bf);
        }
    };
    AxisView.prototype.ah = function () {
        this.aj();
    };
    AxisView.prototype.af = function (a) {
        if (a != null) {
            a.al.u(this);
            a.c9.cq();
        }
    };
    AxisView.prototype.y = function (a) {
        if (a != null) {
            a.al.o(this);
            this.aj();
        }
    };
    AxisView.prototype.i = function () {
        if (this.a.bi == null || this.a.bi.c9.j.ae == null) {
            return null;
        }
        return FontUtil.getFont(this.a.bi.c9.j.ae);
    };
    AxisView.prototype.n = function () {
        return this.j == null;
    };
    AxisView.prototype.ap = function () {
        if (this.a.b9 || this.a.cm) {
            return;
        }
        if (this.a.g8 == null) {
            this.a.iv = null;
            this.a.cq = true;
            this.a.ia();
            return;
        }
        if (this.a.iv == null) {
            var a = new TextBlock();
            a.al = this.a.g8;
            a.dataContext = this.a.bf;
            this.a.iv = a;
        }
        else {
            this.a.iv.al = this.a.g8;
            this.a.iv.dataContext = this.a.bf;
        }
        this.a.cq = true;
        this.a.ia();
    };
    AxisView.prototype.x = function () {
        var a;
        var b = new AxisLabelSettings();
        if (this.a.b9) {
            a = "ui-angular-axis-labels";
            b.margin = 0;
        }
        else if (this.a.cp) {
            a = "ui-vertical-axis-labels";
            b.location = 2;
            b.leftMargin = 5;
            b.rightMargin = 5;
            b.topMargin = 2;
            b.bottomMargin = 2;
        }
        else if (this.a.a2 == 3) {
            a = "ui-radial-axis-labels";
            b.location = 5;
        }
        else {
            a = "ui-horizontal-axis-labels";
            b.location = 1;
            b.leftMargin = 2;
            b.rightMargin = 2;
            b.topMargin = 5;
            b.bottomMargin = 5;
        }
        this.w(b, a);
    };
    AxisView.prototype.a2 = function () {
        if (this.a.bi == null) {
            return;
        }
        var a = this.a.bi.w5;
        var b = a.fv;
        var c = a.fu;
        if (this.a.j2 == null) {
            if (b == null) {
                this.a.j2 = a.fs;
            }
            else if (b.color.l != 0) {
                this.a.j2 = b;
            }
        }
        if (this.a.jz == null) {
            if (c == null) {
                this.a.jz = a.fs;
            }
            else if (c.color.l != 0) {
                this.a.jz = c;
            }
        }
    };
    AxisView.prototype.w = function (a, b) {
        this.a.fn.startCSSQuery();
        var c = this.a.fn.getCssDefaultPropertyValue(b, "margin-top");
        var d = this.a.fn.getCssDefaultPropertyValue(b, "margin-right");
        var e = this.a.fn.getCssDefaultPropertyValue(b, "margin-bottom");
        var f = this.a.fn.getCssDefaultPropertyValue(b, "margin-left");
        var g = this.a.fn.getCssDefaultPropertyValue(b, "text-align");
        var h = this.a.fn.getCssDefaultPropertyValue(b, "vertical-align");
        var i = this.a.fn.getCssDefaultPropertyValue(b, "color");
        var j = FontUtil.getFontForClass(this.a.fn, b);
        this.a.fn.endCSSQuery();
        if (c != null) {
            a.topMargin = parseFloat(c);
        }
        if (d != null) {
            a.rightMargin = parseFloat(d);
        }
        if (e != null) {
            a.bottomMargin = parseFloat(e);
        }
        if (f != null) {
            a.leftMargin = parseFloat(f);
        }
        if (i != null) {
            if (a.textColor == null) {
                a.textColor = new Brush();
            }
            a.textColor._fill = i;
        }
        if (j != null) {
            a.g = j;
        }
        if (g != null) {
            switch (g) {
                case "right":
                    a.horizontalAlignment = 2;
                    break;
                case "left":
                    a.horizontalAlignment = 0;
                    break;
                default:
                    a.horizontalAlignment = 1;
                    break;
            }
        }
        if (h != null) {
            switch (h) {
                case "top":
                    a.verticalAlignment = 0;
                    break;
                case "bottom":
                    a.verticalAlignment = 2;
                    break;
                default:
                    a.verticalAlignment = 1;
                    break;
            }
        }
        this.a.az = a;
    };
    AxisView.prototype.preRender = function () {
        if (this.a.bi != null) {
            this.a.bi.nm();
        }
    };
    AxisView.prototype.isValid = function () {
        return this.a != null && !this.a.kh.isEmpty;
    };
    AxisView.prototype.a8 = function (a) {
        return { $type: Point_$type, x: a.n, y: a.o };
    };
    AxisView.prototype.a9 = function () {
        return { $type: Point_$type, x: this.a.aw.c1.left, y: this.a.aw.c1.top };
    };
    AxisView.prototype.bc = function () {
        var a = this.a.aw.c1;
        return a;
    };
    AxisView.prototype.ba = function (a) {
        return { $type: Point_$type, x: a.n, y: a.o };
    };
    AxisView.prototype.bj = function (a) {
        var b = this.a.aw.af.t();
        var c = this.a.aw.af.v();
        var d = this.a.aw.af.u();
        var e = this.a.aw.af.s();
        return new Thickness(1, b, c, d, e);
    };
    AxisView.prototype.am = function () {
        if (FastReflectionHelper.needsHelper(this.a.f2)) {
            this.h = new FastReflectionHelper(true, this.a.f2);
        }
        else {
            this.h = null;
        }
    };
    AxisView.$t = markType(AxisView, 'AxisView', Base.$, [ISchedulableRender_$type]);
    return AxisView;
}(Base));
export { AxisView };
/**
 * @hidden
 */
var CategoryAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(CategoryAxisBaseView, _super);
    function CategoryAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bk = null;
        _this.bk = a;
        return _this;
    }
    CategoryAxisBaseView.prototype.s = function (a) {
        var b = 0;
        if (this.bk.categoryMode == 0) {
            b = truncate(Math.round(a));
        }
        else {
            b = truncate(Math.floor(a));
        }
        if (b < 0 || b > this.a.lk - 1) {
            return null;
        }
        var c = this.a.kv.item(b);
        var d = this.q(c);
        if (d == null) {
            return null;
        }
        return d.toString();
    };
    CategoryAxisBaseView.prototype.bl = function (a) {
        var b = 0;
        var c = false;
        for (var d = 0; d < a.count; d++) {
            var e = typeCast(FrameworkElement.$, a._inner[d]);
            if (e == null) {
                e = this.a.br.item(d);
                var f = a._inner[d] == null ? "" : a._inner[d].toString();
                var g = e.al;
                var h = 0;
                var i = 0;
                if (g != null) {
                    h = g.length;
                }
                if (f != null) {
                    i = f.length;
                }
                if (h != i) {
                    c = true;
                }
                e.al = f;
                b++;
            }
            else {
                this.d.ab.add(e);
            }
        }
        if (c) {
            this.a.cq = true;
        }
        this.a.hh();
        return b;
    };
    CategoryAxisBaseView.$t = markType(CategoryAxisBaseView, 'CategoryAxisBaseView', AxisView.$);
    return CategoryAxisBaseView;
}(AxisView));
export { CategoryAxisBaseView };
/**
 * @hidden
 */
var HorizontalAxisLabelPanelBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(HorizontalAxisLabelPanelBaseView, _super);
    function HorizontalAxisLabelPanelBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.az = null;
        _this.az = a;
        return _this;
    }
    HorizontalAxisLabelPanelBaseView.prototype.a1 = function () {
    };
    HorizontalAxisLabelPanelBaseView.prototype.a0 = function () {
        return false;
    };
    HorizontalAxisLabelPanelBaseView.prototype.a2 = function (a) {
        var b = this.a.bs();
        var c, d;
        c = this.az.dh();
        d = this.az.de();
        var e = this.a.ag != null ? this.a.ag.verticalAlignment : 1;
        var f = this.a.bd;
        var g = a.count;
        var h = this.a.c1;
        var i = this.az.dg();
        var j = i / 2;
        for (var k = 0; k < g; k++) {
            var l = a._inner[k];
            var m = l.height / 2;
            switch (e) {
                case 0:
                    l.y = h.top + c;
                    break;
                case 1:
                case 3:
                    l.y = (h.top + c + j) - m;
                    break;
                case 2:
                    l.y = (h.bottom - d) - l.height;
                    break;
            }
        }
    };
    HorizontalAxisLabelPanelBaseView.$t = markType(HorizontalAxisLabelPanelBaseView, 'HorizontalAxisLabelPanelBaseView', AxisLabelPanelBaseView.$);
    return HorizontalAxisLabelPanelBaseView;
}(AxisLabelPanelBaseView));
export { HorizontalAxisLabelPanelBaseView };
/**
 * @hidden
 */
var NumericAxisBaseView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(NumericAxisBaseView, _super);
    function NumericAxisBaseView(a) {
        var _this = _super.call(this, a) || this;
        _this.bk = null;
        _this.bk = a;
        return _this;
    }
    NumericAxisBaseView.prototype.bl = function () {
    };
    NumericAxisBaseView.prototype.o = function () {
        return this.bk.ln;
    };
    NumericAxisBaseView.prototype.m = function () {
        if (this.bk.kt != null) {
            return true;
        }
        if (this.bk.ks != null) {
            return true;
        }
        return false;
    };
    NumericAxisBaseView.prototype.r = function (dataItem_) {
        if (this.bk.kt != null) {
            return this.bk.kt(dataItem_);
        }
        if (this.bk.ks != null) {
            return this.bk.ks.i(dataItem_);
        }
        return null;
    };
    NumericAxisBaseView.prototype.s = function (a) {
        var b = this.bk.k4.d(this.bk.kh, this.bk.bi.v4, this.bk.kc(), this.bk.kb());
        return this.bk.k4.w(b, a, -1, NaN);
    };
    NumericAxisBaseView.$t = markType(NumericAxisBaseView, 'NumericAxisBaseView', AxisView.$);
    return NumericAxisBaseView;
}(AxisView));
export { NumericAxisBaseView };
/**
 * @hidden
 */
var VerticalAxisLabelPanelView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(VerticalAxisLabelPanelView, _super);
    function VerticalAxisLabelPanelView(a) {
        var _this = _super.call(this, a) || this;
        _this.az = null;
        _this.az = a;
        return _this;
    }
    VerticalAxisLabelPanelView.prototype.a0 = function () {
    };
    VerticalAxisLabelPanelView.prototype.d = function () {
        var a = this.a.ad.bi.getFontInfo();
        if (this.a.ad.bf != null && this.a.ad.bf.textStyle != null) {
            a = this.a.ad.bf.h(this.a.ad.bi.c9.j.ae);
        }
        else {
            var b = this.a.ad.bi.dg();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    VerticalAxisLabelPanelView.prototype.ay = function () {
        return this.a.ad.bi.wo();
    };
    VerticalAxisLabelPanelView.prototype.at = function () {
        var a = this.a.ad.bg.getFontBrush();
        if (this.a.ad.bf != null && this.a.ad.bf.textColor != null) {
            a = this.a.ad.bf.textColor;
        }
        else {
            var b = this.a.ad.bi.vc();
            if (b != null) {
                a = b;
            }
        }
        return a;
    };
    VerticalAxisLabelPanelView.prototype.a1 = function (a, b) {
        var c, d;
        c = this.az.db();
        d = this.az.dd();
        var e = this.a.ag != null ? this.a.ag.horizontalAlignment : 1;
        var f = this.a.bd;
        var g = this.az.de();
        var h = g / 2;
        var i = this.a.c1;
        for (var j = 0; j < a.count; j++) {
            var k = a._inner[j];
            var l = k.width / 2;
            switch (e) {
                case 0:
                    k.x = i.left + c;
                    break;
                case 1:
                case 3:
                    k.x = (i.left + c + h) - l;
                    break;
                case 2:
                    k.x = (i.right - d) - k.width;
                    break;
            }
        }
    };
    VerticalAxisLabelPanelView.$t = markType(VerticalAxisLabelPanelView, 'VerticalAxisLabelPanelView', AxisLabelPanelBaseView.$);
    return VerticalAxisLabelPanelView;
}(AxisLabelPanelBaseView));
export { VerticalAxisLabelPanelView };
/**
 * @hidden
 */
var XamDataChartView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(XamDataChartView, _super);
    function XamDataChartView(a) {
        var _this = _super.call(this, a) || this;
        _this.fn = null;
        _this.fw = null;
        _this.fs = null;
        _this.ft = null;
        _this.fv = null;
        _this.fu = null;
        _this.fp = 0;
        _this.fq = 0;
        _this.fo = null;
        _this.fn = a;
        return _this;
    }
    XamDataChartView.prototype.fr = function (a) {
        this.p.al.s();
    };
    XamDataChartView.prototype.ds = function () {
        _super.prototype.ds.call(this);
        if (this.b.count == 0 && this.y != null) {
            if (this.p.hi != 1) {
                this.y.aa();
                this.y.ab(this.p.hi, this.p.hi);
            }
            if (!this.y.e) {
                this.y.l(0, 0, this.a8, this.a7);
            }
            if (this.p.hi != 1) {
                this.y.z();
            }
        }
    };
    XamDataChartView.prototype.d4 = function () {
        var e_131, _a;
        var a, b;
        var c = 1, d = 0;
        var e = false;
        var f = this.j.e();
        var g;
        var h = this.j.a7(c, g, a, b, d, e);
        c = h.p0;
        g = h.p1;
        a = h.p2;
        b = h.p3;
        d = h.p4;
        e = h.p5;
        if (isNaN_(this.p.ih)) {
            this.p.ih = g[0];
        }
        if (isNaN_(this.p.h7)) {
            this.p.h7 = g[1];
        }
        if (isNaN_(this.p.hp)) {
            this.p.hp = g[2];
        }
        if (isNaN_(this.p.h2)) {
            this.p.h2 = g[3];
        }
        this.fn.aas = f.i;
        this.fn.aaq = AxisDefaults.h;
        this.fn.aar = AxisDefaults.i;
        this.fn.xc = e;
        this.fv = a;
        this.fu = b;
        this.fn.ag = f.a;
        this.fn.aj = f.f;
        this.fn.ah = f.b != null ? f.b : new BrushCollection();
        this.fn.ai = f.c != null ? f.c : new BrushCollection();
        if (this.fn.ah.count == 0) {
            for (var i = 0; i < f.a.count; i++) {
                this.fn.ah.add(f.a.item(i));
            }
        }
        if (f.c.count == 0) {
            for (var j = 0; j < f.f.count; j++) {
                this.fn.ai.add(f.f.item(j));
            }
        }
        this.ft = f.j;
        this.fw = f.k;
        this.fo = f.h;
        this.fs = f.i;
        this.fp = c;
        try {
            for (var _b = __values(fromEnum(this.fn.series)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var k = _c.value;
                k.sc();
            }
        }
        catch (e_131_1) {
            e_131 = { error: e_131_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_131)
                    throw e_131.error;
            }
        }
        this.fq = d;
    };
    XamDataChartView.prototype.d1 = function () {
        this.fe.ad = Defaults.j;
        this.fd.ad = Defaults.j;
        this.fe._stroke = this.p.vr != null ? this.p.vr : this.ft;
        this.fd._stroke = this.p.vh != null ? this.p.vh : this.ft;
        _super.prototype.d1.call(this);
    };
    XamDataChartView.$t = markType(XamDataChartView, 'XamDataChartView', SeriesViewerView.$);
    return XamDataChartView;
}(SeriesViewerView));
export { XamDataChartView };
/**
 * @hidden
 */
var SeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(SeriesView, _super);
    function SeriesView(a) {
        var _this = _super.call(this) || this;
        _this.e = null;
        _this.s = false;
        _this.h = null;
        _this.d = null;
        _this._isDirty = false;
        _this.bz = null;
        _this.bp = null;
        _this.v = 0;
        _this.bu = Rect.empty;
        _this.bo = new Brush();
        _this.f = new SeriesComponentsFromView();
        _this.k = null;
        _this.l = null;
        _this.bv = null;
        _this.bw = null;
        _this.m = false;
        _this.a = null;
        _this.r = false;
        _this.n = false;
        _this.p = false;
        _this.ad = null;
        _this.v = NaN;
        _this.r = true;
        _this.e = a;
        _this.q = false;
        _this.bz = new Rectangle();
        _this.s = false;
        return _this;
    }
    SeriesView.prototype.getDefaultTooltipTemplate = function () {
        return this.e.ba.a$t(this.e);
    };
    SeriesView.prototype.ar = function () {
        if (this.e.fh) {
            this.e.ba.a$aa(this.e);
        }
    };
    SeriesView.prototype.j = function () {
        return new DOMExecutionContext(this.e.db.c9.j.ae);
    };
    Object.defineProperty(SeriesView.prototype, "i", {
        get: function () {
            if (this.h == null) {
                this.h = this.j();
            }
            return this.h;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.ah = function (a, b) {
        Series.pl(b, this.e.db, false);
        b.db = this.e.db;
        b.c3 = this.e.c3;
        if (b.db != null) {
            b.db.m8(b);
        }
    };
    SeriesView.prototype.am = function (a) {
        Series.pl(a, this.e.db, true);
        a.o4(true, a.cv);
        a.db = null;
        a.c3 = null;
        a.itemsSource = null;
        a.legend = null;
        if (a.db != null) {
            a.db.q4(a);
        }
    };
    SeriesView.prototype.au = function () {
        if (!this.q) {
            this.e.ij = 0.8;
            this.e.c1 = 0;
            this.e.c0 = 1;
            this.d = new DataContext();
            this.d.series = this.e;
            this.e.de = EasingFunctions.cubicEase;
            this.af();
        }
    };
    SeriesView.prototype.getEffectiveViewport = function () {
        return this.e.getEffectiveViewport1(this);
    };
    SeriesView.prototype.a1 = function () {
        this.as();
    };
    SeriesView.prototype.ak = function () {
    };
    SeriesView.prototype.getMainContentViewport = function () {
        return this.e.getMainContentViewport();
    };
    Object.defineProperty(SeriesView.prototype, "w", {
        get: function () {
            if (this.e.db != null) {
                return this.e.db.c9.j.ae;
            }
            return null;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesView.prototype, "isDirty", {
        get: function () {
            return this._isDirty;
        },
        set: function (a) {
            this._isDirty = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.get_index = function () {
        if (this.e == null || this.e.db == null) {
            return 0;
        }
        if (this.e.db.fd) {
            if (this.e.fb) {
                return this.e.db.series.indexOf(this.e);
            }
            else {
                var a = this.e.db.series.indexOf(this.e);
                if (a >= 0) {
                    return a;
                }
                for (var b = 0; b < this.e.db.series.count; b++) {
                    if (this.e.db.series._inner[b].fb) {
                        var c = this.e.db.series._inner[b].bo();
                        if (c == this.e) {
                            return b;
                        }
                    }
                }
                return a;
            }
        }
        var d = typeCast(XamDataChart.$, this.e.c9);
        var e = 0;
        if (d != null) {
            if (d.ww == 2 || d.ww == 0) {
                e = d.axes.count;
            }
        }
        var f = 0;
        for (var g = 0; g < this.e.db.series.count; g++) {
            if (this.e.db.series._inner[g] == this.e) {
                break;
            }
            if (this.e.db.series._inner[g].isStacked) {
                f += this.e.db.series._inner[g].kb();
            }
            else if (this.e.db.series._inner[g].eg) {
                if (this.e.bn != null && this.e.bn == this.e.db.series._inner[g]) {
                    f += 1;
                    for (var h = 0; h < this.e.db.series._inner[g].actualLayers.count; h++) {
                        if (this.e.db.series._inner[g].actualLayers._inner[h].target == this.e) {
                            return e + f + (h);
                        }
                    }
                }
                else {
                    f += this.e.db.series._inner[g].actualLayers.count + 1;
                }
            }
            else {
                f++;
            }
        }
        return e + f;
    };
    Object.defineProperty(SeriesView.prototype, "index", {
        get: function () {
            return this.get_index();
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.as = function () {
        if (this.e.db == null) {
            return;
        }
        if (!this.isDirty) {
            this.isDirty = true;
            this.a.r(this.k, this.l);
        }
    };
    SeriesView.prototype.undirty = function (a) {
        this.isDirty = false;
        this.a6(a);
    };
    SeriesView.prototype.aw = function () {
        this.as();
    };
    SeriesView.prototype.bt = function () {
        if (this.bp == null) {
            this.bp = ((function () {
                var $ret = new Brush();
                $ret.color = Color.u(0, 0, 0, 0);
                return $ret;
            })());
        }
        return this.bp;
    };
    SeriesView.prototype.bq = function (a) {
        if (a != null) {
            var b = BrushUtil.n(a, 1);
            return b;
        }
        else {
            return null;
        }
    };
    SeriesView.prototype.u = function () {
        if (!isNaN_(this.v)) {
            return this.v;
        }
        if (this.e.db != null) {
            return this.e.db.hi;
        }
        else {
            return 1;
        }
    };
    SeriesView.prototype.a6 = function (a) {
        if (this.k == null) {
            return;
        }
        if (this.bu.isEmpty) {
            this.bu = this.bx;
        }
        var b = this.bu;
        var c = this.e.db.v9();
        var d = c.left;
        var e = c.top;
        var f = c.width;
        var g = c.height;
        var h = this.u();
        if (this.p) {
            d = this.bx.left;
            e = this.bx.top;
            f = this.bx.width;
            g = this.bx.height;
        }
        if (this.k.d) {
            if (h != 1) {
                this.k.aa();
                this.k.ab(h, h);
            }
            if (a) {
                if (!this.k.e) {
                    this.k.l(d, e, f, g);
                }
            }
            if (a) {
                if (this.e.db.vk != null && !this.bx.isEmpty) {
                    this.bz.o = this.bx.top;
                    this.bz.n = this.bx.left;
                    this.bz.width = this.bx.width;
                    this.bz.height = this.bx.height;
                    this.bz._fill = this.e.db.vk;
                    this.k.w(this.bz);
                }
            }
            if (h != 1) {
                this.k.z();
            }
        }
        if (this.l != null && this.r) {
            if (this.l.d) {
                if (this.e.db != null && h != 1) {
                    this.l.aa();
                    this.l.ab(h, h);
                }
                if (!b.isEmpty && a) {
                    if (!this.l.e) {
                        this.l.l(b.left, b.top, b.width, b.height);
                    }
                }
                this.bc(true);
                this.a8(this.l, true);
                this.a7(this.l, true);
                if (h != 1) {
                    this.l.z();
                }
            }
        }
        if (this.k.d && this.r) {
            if (h != 1) {
                this.k.aa();
                this.k.ab(h, h);
            }
            this.k.aa();
            if (!this.q && Rect.l_op_Inequality(this.e.wh, null) && !this.e.wh.isEmpty && (this.e.wh.width != 1 || this.e.wh.height != 1)) {
                this.k.af(new Rect(0, this.bx.left + this.bx.width * this.e.wh.left, this.bx.top + this.bx.height * this.e.wh.top, this.bx.width * this.e.wh.width, this.bx.height * this.e.wh.height));
            }
            else {
                this.k.af(this.bx);
            }
            this.bc(false);
            this.k.ae(this.e._opacity);
            if (this.e.e4 && this.e.e5 && !this.q) {
                if (this.e.hb) {
                    this.k.p(this.e.v0.colorString, 0, this.e.jm, this.e.jn);
                    var i = this.e.db.c9.j.x;
                    var j = this.e.db.c9.j.ak;
                    if (h != 1) {
                        i.aa();
                        i.ab(h, h);
                    }
                    if (!i.e) {
                        i.l(c.left, c.top, c.width, c.height);
                    }
                    this.a8(i, false);
                    this.a7(i, false);
                    this.k.n(j.getNativeElement(), 1, 0, 0, c.width, c.height);
                    if (h != 1) {
                        i.z();
                    }
                }
                else {
                    this.k.p(this.e.v0.colorString, this.e.jl, this.e.jm, this.e.jn);
                    this.a8(this.k, false);
                    this.a7(this.k, false);
                }
                this.k.m();
            }
            else {
                this.a8(this.k, false);
                this.a7(this.k, false);
            }
            this.k.ae(1);
            this.k.z();
            if (h != 1) {
                this.k.z();
            }
        }
    };
    SeriesView.prototype.bf = function (a, b, c) {
        if (c) {
            this.bh(a, b);
        }
        else {
            this.bg(a, b);
        }
    };
    SeriesView.prototype.bi = function (a, b, c) {
        if (c) {
            this.bk(a, b);
        }
        else {
            this.bj(a, b);
        }
    };
    SeriesView.prototype.aa = function (a, b) {
        if (b) {
            return this.ab(a);
        }
        else {
            return this.ac(a);
        }
    };
    SeriesView.prototype.ab = function (a) {
        return null;
    };
    SeriesView.prototype.ac = function (a) {
        return null;
    };
    SeriesView.prototype.bg = function (a, b) {
    };
    SeriesView.prototype.bj = function (a, b) {
    };
    SeriesView.prototype.bh = function (a, b) {
    };
    SeriesView.prototype.bk = function (a, b) {
    };
    SeriesView.prototype.bc = function (a) {
        if (a) {
            this.be();
        }
        else {
            this.bd();
        }
    };
    SeriesView.prototype.bd = function () {
    };
    SeriesView.prototype.be = function () {
    };
    SeriesView.prototype.bs = function (a) {
        return this.br();
    };
    SeriesView.prototype.br = function () {
        var a = this.e.kf;
        var num_ = (a + 1) * 1000;
        var b = ((num_ & 0x3F) << 2);
        num_ = (num_ >> 6);
        var c = ((num_ & 0x3F) << 2);
        num_ = (num_ >> 6);
        var d = ((num_ & 0x3F) << 2);
        this.bo._fill = "rgb(" + b + "," + c + "," + d + ")";
        return this.bo;
    };
    SeriesView.prototype.a8 = function (a, b) {
        this.bu = this.bx;
    };
    SeriesView.prototype.a7 = function (a, b) {
    };
    SeriesView.prototype.az = function () {
    };
    SeriesView.prototype.ao = function () {
    };
    SeriesView.prototype.ap = function () {
    };
    SeriesView.prototype.g = function () {
        return this.f;
    };
    SeriesView.prototype.bb = function (a) {
    };
    SeriesView.prototype.t = function () {
        return true;
    };
    SeriesView.prototype.ay = function () {
    };
    SeriesView.prototype.ax = function () {
    };
    SeriesView.prototype.a9 = function () {
        this.e.u8 = null;
    };
    SeriesView.prototype.ai = function () {
        this.e.u8 = this.e.ve;
    };
    SeriesView.prototype.ba = function () {
        this.e.vc = null;
    };
    SeriesView.prototype.aj = function () {
        this.e.vc = this.e.vu;
    };
    SeriesView.prototype.c = function (a) {
        if (typeCast(DataContext.$, a) !== null) {
            return a;
        }
        return null;
    };
    SeriesView.prototype.at = function (a, b) {
        this.k = a;
        this.l = b;
    };
    Object.defineProperty(SeriesView.prototype, "bx", {
        get: function () {
            return this.bv;
        },
        set: function (a) {
            this.bv = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.get_by = function () {
        if (this.p) {
            return this.bw;
        }
        else if (this.q) {
            return XamDataChart.wg;
        }
        else {
            return this.e.db != null ? this.e.db.v4 : Rect.empty;
        }
    };
    Object.defineProperty(SeriesView.prototype, "by", {
        get: function () {
            return this.get_by();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(SeriesView.prototype, "q", {
        get: function () {
            return this.m;
        },
        set: function (a) {
            this.m = a;
        },
        enumerable: false,
        configurable: true
    });
    SeriesView.prototype.al = function (a) {
        if (a != null) {
            this.a.u(this);
            if (this.e.cu != null) {
                this.e.cu.a.u(this.e.cu);
            }
        }
    };
    SeriesView.prototype.ag = function (a) {
        var e_132, _a;
        if (a != null) {
            if (this.e.g9) {
                this.k = this.e.db.c9.z;
                a.c9.a.o(this);
                this.a = a.c9.a;
            }
            else {
                this.k = this.e.db.c9.y;
                a.al.o(this);
                this.a = a.al;
            }
            if (this.e.cu != null) {
                a.am.o(this.e.cu);
                this.e.cu.a = a.am;
                this.e.cu.as();
            }
            if (this.e.fh) {
                try {
                    for (var _b = __values(fromEnum(this.e.ba.a$j.keys)), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var b = _c.value;
                        a.ak.o(this.e.ba.a$j.item(b));
                        this.e.ba.a$j.item(b).a = a.ak;
                        this.e.ba.a$j.item(b).as();
                    }
                }
                catch (e_132_1) {
                    e_132 = { error: e_132_1 };
                }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return))
                            _a.call(_b);
                    }
                    finally {
                        if (e_132)
                            throw e_132.error;
                    }
                }
            }
            this.as();
        }
    };
    SeriesView.prototype.postRender = function () {
        this.a2();
    };
    SeriesView.prototype.a2 = function () {
    };
    SeriesView.prototype.b = function (a) {
        return null;
    };
    SeriesView.prototype.a4 = function (a) {
        this.e.cu.k = a.a;
    };
    SeriesView.prototype.an = function (a) {
    };
    SeriesView.prototype.bl = function () {
        if (this.n) {
            return;
        }
        if (this.e.db != null) {
            var a = (this.e.legend != null) ? this.e.legend : this.e.db.legend;
            if (a != null && this.e.st != null && a.containsChild(this.e.st)) {
                a.removeChild(this.e.st);
                var b = this.e.ky();
                b.content.actualItemBrush = this.e.u8;
                b.content.outline = this.e.vc;
                b.content.thickness = this.e.id;
                a.addChildInOrder(this.e.st, this.e);
            }
        }
    };
    SeriesView.prototype.av = function () {
        this.e.ov(this.e.a5, this.e.a5);
    };
    SeriesView.prototype.a0 = function () {
        this.bl();
    };
    SeriesView.prototype.getViewInfo = function (a, b) {
        a = this.bx;
        b = this.by;
        return {
            p0: a,
            p1: b
        };
    };
    SeriesView.prototype.o = function () {
        return this.k != null;
    };
    SeriesView.prototype.bm = function () {
        this.r = this.e._visibility == 0;
        this.as();
    };
    SeriesView.prototype.a5 = function () {
        this.e.ba.a$ap(this.e);
    };
    SeriesView.prototype.af = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.v0 = a;
        this.e.jl = 5;
        this.e.jm = 5;
        this.e.jn = 5;
    };
    SeriesView.prototype.aq = function () {
    };
    SeriesView.prototype.preRender = function () {
        if (this.e.db != null && !this.q) {
            this.e.db.nm();
        }
    };
    SeriesView.prototype.isValid = function () {
        return true;
    };
    SeriesView.prototype.a3 = function (a) {
        this.k = a.a;
    };
    SeriesView.prototype.bn = function (type_) {
        var legendTemplates_ = TypeRegistrar.get("LegendTemplates");
        var a = (legendTemplates_.resolveLegendItemTemplate(type_));
        return a;
    };
    SeriesView.$t = markType(SeriesView, 'SeriesView', Base.$, [ISchedulableRender_$type, IProvidesViewport_$type]);
    return SeriesView;
}(Base));
export { SeriesView };
/**
 * @hidden
 */
var MarkerSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(MarkerSeriesView, _super);
    function MarkerSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.b4 = null;
        _this.b9 = 1;
        _this.cb = Defaults.ab;
        _this.ca = 3;
        _this.b8 = null;
        _this.b7 = false;
        _this.b0 = new Marker();
        _this.ct = null;
        _this.b0 = new Marker();
        _this.b0.content = new DataContext();
        _this.b4 = a;
        return _this;
    }
    MarkerSeriesView.prototype.au = function () {
        _super.prototype.au.call(this);
        this.b8 = new List$1(Marker.$, 0);
        this.ct = ((function () {
            var $ret = new DataTemplate();
            $ret.render = MarkerTemplates.c;
            $ret.measure = MarkerTemplates.b;
            return $ret;
        })());
    };
    MarkerSeriesView.prototype.cl = function () {
        var e_133, _a;
        try {
            for (var _b = __values(fromEnum(this.b8)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var a = _c.value;
                a.ah = this.b4.x0;
            }
        }
        catch (e_133_1) {
            e_133 = { error: e_133_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_133)
                    throw e_133.error;
            }
        }
        this.as();
    };
    MarkerSeriesView.prototype.cv = function () {
        if (this.k == null) {
            return new Size(1, 0, 0);
        }
        var a = new DataTemplatePassInfo();
        a.isHitTestRender = false;
        a.context = this.k.h();
        a.viewportTop = this.bx.top;
        a.viewportLeft = this.bx.left;
        a.viewportWidth = this.bx.width;
        a.viewportHeight = this.bx.height;
        a.passID = "TestMeasure";
        var b = new DataTemplateRenderInfo();
        b.isHitTestRender = false;
        b.passInfo = a;
        var c = new DataTemplateMeasureInfo();
        c.passInfo = a;
        var d = this.k.h();
        c.context = d;
        b.context = d;
        var e = 0;
        var f = 0;
        if (this.b4.x0 != null && this.b4.x0.passStarting != null) {
            this.b4.x0.passStarting(a);
        }
        var g = this.b4.x0;
        if (this.b8.count > 0) {
            var h = this.b8._inner[0];
            c.data = h.content;
            c.width = h.width;
            c.height = h.height;
            c.renderOffsetX = 0;
            c.renderOffsetY = 0;
            c.renderContext = this.k;
            g = h.ah;
        }
        var i = 0;
        var j = 0;
        if (g != null && g.measure != null) {
            g.measure(c);
            i = c.width;
            j = c.height;
        }
        if (this.b4.x0 != null && this.b4.x0.passCompleted != null) {
            this.b4.x0.passCompleted(a);
        }
        return new Size(1, i, j);
    };
    MarkerSeriesView.prototype.cs = function (a) {
    };
    MarkerSeriesView.prototype.b3 = function () {
        var _this = this;
        var a = new Marker();
        a.content = ((function () {
            var $ret = new DataContext();
            $ret.series = _this.e;
            return $ret;
        })());
        a.ah = this.b4.x0;
        this.b8.add(a);
        return a;
    };
    MarkerSeriesView.prototype.ck = function (a) {
        for (var b = this.b8.count - 1; b >= 0; b--) {
            var c = this.b8._inner[b];
            a(c);
        }
    };
    MarkerSeriesView.prototype.co = function (a) {
        a._visibility = 0;
    };
    MarkerSeriesView.prototype.cq = function (a) {
        a._visibility = 1;
    };
    MarkerSeriesView.prototype.cp = function (a) {
        this.b8.remove(a);
    };
    MarkerSeriesView.prototype.b5 = function () {
        return this.b4.x1 != null;
    };
    MarkerSeriesView.prototype.ci = function () {
        this.b4.xz = null;
    };
    MarkerSeriesView.prototype.cc = function () {
        this.b4.xz = this.b4.x1;
    };
    MarkerSeriesView.prototype.cu = function (a) {
        var b = a.n;
        var c = a.o;
        var d = a.m;
        var e = a.l;
        return new Rect(0, b - d / 2, c - d / 2, d, e);
    };
    MarkerSeriesView.prototype.cf = function (a) {
        if (this.b4.db == null) {
            return;
        }
        switch (a) {
            case SeriesViewer.$$p[2]:
                this.b4.xz = this.b4.db.r1;
                break;
            case SeriesViewer.$$p[45]:
                this.b4.xz = this.b4.db.sa;
                break;
            case SeriesViewer.$$p[31]:
                this.b4.xz = this.b4.db.r7;
                break;
            case SeriesViewer.$$p[39]:
                this.b4.xz = this.b4.db.r8;
                break;
            case SeriesViewer.$$p[5]:
                this.b4.xz = this.b4.db.r2;
                break;
            case SeriesViewer.$$p[23]:
                this.b4.xz = this.b4.db.r5;
                break;
            case SeriesViewer.$$p[9]:
                this.b4.xz = this.b4.db.r3;
                break;
            case SeriesViewer.$$p[42]:
                this.b4.xz = this.b4.db.r9;
                break;
            case SeriesViewer.$$p[24]:
                this.b4.xz = this.b4.db.r6;
                break;
            case SeriesViewer.$$p[10]:
                this.b4.xz = this.b4.db.r4;
                break;
        }
    };
    MarkerSeriesView.prototype.cg = function () {
        this.b4.yg = null;
    };
    MarkerSeriesView.prototype.cd = function () {
        if (!isNaN_(this.e.ib) && this.e.ib != 1) {
            var a = BrushUtil.q(this.b4.yi, this.e.ib);
            this.b4.yg = a;
        }
        else {
            this.b4.yg = this.b4.yi;
        }
    };
    MarkerSeriesView.prototype.ch = function () {
        this.b4.yh = null;
    };
    MarkerSeriesView.prototype.ce = function () {
        this.b4.yh = this.b4.yj;
    };
    MarkerSeriesView.prototype.cr = function () {
        this.as();
    };
    MarkerSeriesView.prototype.bj = function (a, b) {
        _super.prototype.bj.call(this, a, b);
        if (!this.b7) {
            var c = a;
            var d = c.content;
            if (d != null) {
                d.actualItemBrush = this.b4.yg;
                if (d.itemBrush != null) {
                    d.actualItemBrush = d.itemBrush;
                }
                d.outline = this.b4.yh;
                d.thickness = this.b4.xi;
            }
        }
    };
    MarkerSeriesView.prototype.bk = function (a, b) {
        _super.prototype.bk.call(this, a, b);
        var c = a;
        this.b0._visibility = c._visibility;
        this.b0.ah = c.ah;
        this.b0.width = c.width;
        this.b0.height = c.height;
        this.b0.m = c.m;
        this.b0.l = c.l;
        this.b0.n = c.n;
        this.b0.o = c.o;
        var d = this.bs(b);
        var e = this.b0.content;
        var f = c.content;
        e.item = f.item;
        e.series = f.series;
        e.thickness = f.thickness;
        if (e != null) {
            e.actualItemBrush = d;
            e.outline = d;
            e.thickness = this.b9 + this.ca;
        }
    };
    MarkerSeriesView.prototype.b = function (a) {
        if (a >= 0 && a < this.b8.count) {
            return this.b8._inner[a].content;
        }
        return _super.prototype.b.call(this, a);
    };
    MarkerSeriesView.prototype.a7 = function (a, b) {
        _super.prototype.a7.call(this, a, b);
        if (a.d) {
            var c = new DataTemplatePassInfo();
            c.isHitTestRender = b;
            c.context = a.h();
            c.viewportTop = this.bx.top;
            c.viewportLeft = this.bx.left;
            c.viewportWidth = this.bx.width;
            c.viewportHeight = this.bx.height;
            c.passID = "Markers";
            var d = new DataTemplateRenderInfo();
            d.isHitTestRender = b;
            d.passInfo = c;
            var e = new DataTemplateMeasureInfo();
            e.passInfo = c;
            var f = false;
            var g = a.h();
            e.context = g;
            d.context = g;
            var h = 0;
            var i = 0;
            if (this.b4.x0 != null && this.b4.x0.passStarting != null) {
                this.b4.x0.passStarting(c);
            }
            for (var j = 0; j < this.b8.count; j++) {
                var k = this.b8._inner[j];
                if (k._visibility == 1) {
                    continue;
                }
                this.bi(k, j, b);
                if (b) {
                    k = this.b0;
                }
                if (!f) {
                    e.data = k.content;
                    e.width = k.width;
                    e.height = k.height;
                    e.renderOffsetX = 0;
                    e.renderOffsetY = 0;
                    e.renderContext = a;
                    var l = k.ah;
                    if (l.measure != null) {
                        e.data = k.content;
                        l.measure(e);
                        f = e.isConstant;
                        if (f) {
                            h = e.width;
                            i = e.height;
                        }
                    }
                    d.availableWidth = e.width;
                    d.availableHeight = e.height;
                    d.renderOffsetX = e.renderOffsetX;
                    d.renderOffsetY = e.renderOffsetY;
                    d.renderContext = a;
                }
                else {
                    d.availableWidth = h;
                    d.availableHeight = i;
                }
                if (!isNaN_(k.width) && !isInfinity(k.width)) {
                    d.availableWidth = k.width;
                }
                if (!isNaN_(k.height) && !isInfinity(k.height)) {
                    d.availableHeight = k.height;
                }
                a.q(d, k);
                k.m = d.availableWidth;
                k.l = d.availableHeight;
                k.ai = d.renderOffsetX;
                k.aj = d.renderOffsetY;
            }
            if (this.b4.x0 != null && this.b4.x0.passCompleted != null) {
                this.b4.x0.passCompleted(c);
            }
        }
    };
    MarkerSeriesView.prototype.cm = function (a) {
        a.create = runOn(this, this.b3);
        a.destroy = runOn(this, this.cp);
        a.activate = runOn(this, this.co);
        a.disactivate = runOn(this, this.cq);
    };
    MarkerSeriesView.prototype.cn = function (a) {
        a.create = runOn(this, this.b3);
        a.destroy = runOn(this, this.cp);
        a.activate = runOn(this, this.co);
        a.disactivate = runOn(this, this.cq);
    };
    MarkerSeriesView.prototype.b1 = function (a) {
        var b = this.b2(a, 0);
        if (b == null) {
            b = this.b2(a, 3);
        }
        return b;
    };
    MarkerSeriesView.prototype.b2 = function (a, b) {
        var c;
        var d;
        var e;
        var f;
        for (var g = this.b8.count - 1; g >= 0; g--) {
            var h = this.b8._inner[g];
            if (h._visibility == 1 || h._opacity == 0) {
                continue;
            }
            c = (h.m / 2) + b;
            d = (h.l / 2) + b;
            e = h.ai;
            f = h.aj;
            if (this.b4.xb) {
                if (this.b6(a.x, a.y, h.n + e, h.o + f, c)) {
                    return h;
                }
            }
            else {
                if ((h.n + e) - c <= a.x && (h.n + e) + c >= a.x && (h.o + f) - d <= a.y && (h.o + f) + d >= a.y) {
                    return h;
                }
            }
        }
        return null;
    };
    MarkerSeriesView.prototype.b6 = function (a, b, c, d, e) {
        var f = e * e;
        var g = (a - c) * (a - c) + (b - d) * (b - d);
        return g < f;
    };
    MarkerSeriesView.$t = markType(MarkerSeriesView, 'MarkerSeriesView', SeriesView.$);
    return MarkerSeriesView;
}(SeriesView));
export { MarkerSeriesView };
/**
 * @hidden
 */
var ChartAxisRangeChangedEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(ChartAxisRangeChangedEventArgs, _super);
    function ChartAxisRangeChangedEventArgs(a, b, c, d, e, f) {
        var _this = _super.call(this) || this;
        _this._chart = null;
        _this._axis = null;
        _this._oldMinimumValue = 0;
        _this._minimumValue = 0;
        _this._oldMaximumValue = 0;
        _this._maximumValue = 0;
        _this.chart = a;
        _this.axis = b;
        _this.oldMinimumValue = c;
        _this.minimumValue = d;
        _this.oldMaximumValue = e;
        _this.maximumValue = f;
        return _this;
    }
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "chart", {
        get: function () {
            return this._chart;
        },
        set: function (a) {
            this._chart = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "axis", {
        get: function () {
            return this._axis;
        },
        set: function (a) {
            this._axis = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "oldMinimumValue", {
        get: function () {
            return this._oldMinimumValue;
        },
        set: function (a) {
            this._oldMinimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "oldMaximumValue", {
        get: function () {
            return this._oldMaximumValue;
        },
        set: function (a) {
            this._oldMaximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(ChartAxisRangeChangedEventArgs.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    ChartAxisRangeChangedEventArgs.$t = markType(ChartAxisRangeChangedEventArgs, 'ChartAxisRangeChangedEventArgs', EventArgs.$);
    return ChartAxisRangeChangedEventArgs;
}(EventArgs));
export { ChartAxisRangeChangedEventArgs };
(function (v) { callStaticConstructors(); })(true);