UNPKG

igniteui-angular-charts

Version:

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

26,722 lines 880 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 { Control } from "igniteui-angular-core";
import { INotifyPropertyChanged_$type, Base, Type, BaseError, 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, Date_$type, Array_$type, getInstanceType, IEqualityComparer$1_$type } 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 { HashSet$1 } from "igniteui-angular-core";
import { IToolbarContextAccessor_$type } 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 { List$1 } from "igniteui-angular-core";
import { ICommandStateChangedListener_$type } 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 { ChartResizeIdleEventArgs } from "./ChartResizeIdleEventArgs";
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 { FontInfo } from "igniteui-angular-core";
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 { AutomaticSeriesPurpose_$type } from "./AutomaticSeriesPurpose";
import { defaultDVDateParse, dateNow, dateMinValue } from "igniteui-angular-core";
import { stringIsNullOrEmpty, stringEmpty, stringContains, stringReplace, stringEndsWith, stringStartsWith, stringIsNullOrWhiteSpace } from "igniteui-angular-core";
import { timeSpanTotalMilliseconds } 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 { CanvasScalingHelpers } from "igniteui-angular-core";
import { DefaultPaletteInfo } from "./DefaultPaletteInfo";
import { CssGradientUtil } from "igniteui-angular-core";
import { AxisDefaults } from "./AxisDefaults";
import { BrushUtilCore } from "igniteui-angular-core";
import { ImageLoader } 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 { AnnotationBackingArrangedSize } from "./AnnotationBackingArrangedSize";
import { AxisComponentsFromView } from "./AxisComponentsFromView";
import { FeatureState_$type } from "igniteui-angular-core";
import { FastReflectionHelper } from "igniteui-angular-core";
import { TransformGroup } from "igniteui-angular-core";
import { Convert } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { UIElement } from "igniteui-angular-core";
import { PolygonUtil } from "igniteui-angular-core";
import { ContentControl } from "igniteui-angular-core";
import { RotateTransform } 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 { AxisMatcher } from "./AxisMatcher";
import { CategoryMode_$type } from "./CategoryMode";
import { GridMode_$type } from "./GridMode";
import { Panel } from "igniteui-angular-core";
import { RectUtil } from "igniteui-angular-core";
import { TickmarkValues } from "./TickmarkValues";
import { TranslateTransform } from "igniteui-angular-core";
import { AngleSimplifier } from "igniteui-angular-core";
import { TransformMatrixHelpler } from "igniteui-angular-core";
import { TrimmedTextInfo } from "./TrimmedTextInfo";
import { ICategoryScaler_$type } from "./ICategoryScaler";
import { OverlayCollisionInfo } from "./OverlayCollisionInfo";
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 { AutomaticAxisPurpose_$type } from "./AutomaticAxisPurpose";
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 { PenLineCap_$type } from "igniteui-angular-core";
import { Marker } from "./Marker";
import { AutoMarginsAndAngleUpdateMode_$type } from "./AutoMarginsAndAngleUpdateMode";
import { ComputedPlotAreaMarginMode_$type } from "./ComputedPlotAreaMarginMode";
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 { 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
 */
export let SeriesViewer = /*@__PURE__*/ (() => {
    class SeriesViewer extends Control {
        constructor() {
            super();
            this._widget = null;
            this.dw = null;
            this.ee = null;
            this.an = null;
            this.userAnnotationInformationRequested = null;
            this.userAnnotationToolTipContentUpdating = null;
            this.hm = new List$1(ICommandStateChangedListener_$type, 0);
            this._commandCompleted = null;
            this._invalidateActions = null;
            this.hi = null;
            this.bn = null;
            this.bp = null;
            this.e0 = false;
            this.ez = false;
            this.dn = null;
            this.b7 = new SeriesCollection();
            this.b8 = new SeriesCollection();
            this.j1 = 0;
            this.ch = 0;
            this.cj = 0;
            this._skipDataCleanup = false;
            this.dy = null;
            this.d0 = null;
            this.dx = null;
            this.dz = null;
            this.a3 = null;
            this.yh = null;
            this.plotAreaMouseLeftButtonDown = null;
            this.plotAreaMouseLeftButtonUp = null;
            this.plotAreaClicked = null;
            this.plotAreaMouseEnter = null;
            this.plotAreaMouseLeave = null;
            this.plotAreaMouseOver = null;
            this.axisLabelMouseDown = null;
            this.axisLabelMouseUp = null;
            this.axisLabelMouseEnter = null;
            this.axisLabelMouseLeave = null;
            this.axisLabelMouseOver = null;
            this.axisLabelMouseClick = null;
            this.axisPanelMouseDown = null;
            this.axisPanelMouseUp = null;
            this.axisPanelMouseEnter = null;
            this.axisPanelMouseLeave = null;
            this.axisPanelMouseOver = null;
            this.axisPanelMouseClick = null;
            this.cx = 0;
            this.cy = 0;
            this.cc = 1;
            this.cp = 1;
            this.cl = 3;
            this.propertyChanged = null;
            this.propertyUpdated = null;
            this.kh = null;
            this.hj = new HashSet$1(IChartLegend_$type, 0);
            this.ev = false;
            this.seriesCursorMouseMove = null;
            this.seriesMouseLeftButtonDown = null;
            this.seriesMouseLeftButtonUp = null;
            this.seriesClick = null;
            this.seriesMouseMove = null;
            this.seriesMouseEnter = null;
            this.seriesMouseLeave = null;
            this.em = false;
            this.el = false;
            this.yq = Rect.empty;
            this.yo = Rect.empty;
            this.ej = true;
            this.yn = null;
            this.e5 = false;
            this.j0 = 30;
            this.resizeIdle = null;
            this.gl = false;
            this.e7 = false;
            this.cu = new SeriesViewerComponentsForView();
            this.es = false;
            this.a5 = 0;
            this.a4 = 1;
            this.seriesAnimating = null;
            this.eg = new VersionQueueHelper();
            this.ep = false;
            this.en = false;
            this.dh = 0;
            this.ex = false;
            this.ff = false;
            this.ek = false;
            this.ns = null;
            this.viewerManipulationStarting = null;
            this.viewerManipulationEnding = null;
            this.e3 = false;
            this.ey = false;
            this.windowRectChanged = null;
            this.sizeChanged = null;
            this.fr = false;
            this.actualWindowRectChanged = null;
            this.gridAreaRectChanged = null;
            this.fh = false;
            this.h0 = 0.0001;
            this.hz = 0.0001;
            this._syncChannel = null;
            this.c4 = null;
            this.g7 = false;
            this.e2 = false;
            this.fq = false;
            this.hd = false;
            this.da = 1;
            this.zb = null;
            this.j3 = 0;
            this.b5 = null;
            this.e1 = false;
            this.g8 = false;
            this.yp = Rect.empty;
            this._selectedSeriesItems = null;
            this._focusedSeriesItems = null;
            this.selectedSeriesItemsChanged = null;
            this.focusedSeriesItemsChanged = null;
            this.hu = new Date();
            this.hg = false;
            this.refreshCompleted = null;
            this.km = null;
            this.kl = null;
            this.xs = null;
            this.xr = null;
            this.ig = NaN;
            this.id = NaN;
            this.ie = NaN;
            this.ic = NaN;
            this.ib = NaN;
            this.h9 = NaN;
            this.ia = NaN;
            this.h8 = NaN;
            this.kj = null;
            this.al = null;
            this.am = null;
            this.ak = null;
            this.ew = false;
            this.ei = false;
            this._syncSettings = null;
            this.destroyed = false;
            this.kg = null;
            this.hh = new Dictionary$2(String_$type, Base.$, 0);
            this.gj = false;
            this.ih = NaN;
            this.h5 = NaN;
            this.h7 = NaN;
            this.h3 = NaN;
            this.h2 = 30;
            this.h1 = NaN;
            this.eo = true;
            this.h6 = NaN;
            this.h4 = NaN;
            this.kk = null;
            this.hw = 1;
            this.hv = NaN;
            this.ym = null;
            this.fp = false;
            this.hx = 0;
            this.hy = 0;
            this.ur = null;
            this.bc = null;
            this.fv = false;
            this.fw = false;
            this.ft = false;
            this.et = false;
            this.j2 = 0;
            this.fd = false;
            this.fz = false;
            this.seriesDataUpdated = null;
            this.hn = new List$1(IDataLegend_$type, 0);
            this.eh = null;
            this.seriesDataChanged = null;
            this.hq = null;
            this.imageCaptured = null;
            this.df = null;
            this.ht = dateMinValue();
            this.eu = false;
            this.bk = null;
            this.eq = false;
            this.er = false;
            DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
            DVContainer.instance.registerIfLoaded("InteractivityFactoryManager");
            DVContainer.instance.registerIfLoaded("DataChartToolbarFactoryManager");
            DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
            this.ym = Rect.empty;
            this.yh = { $type: Point_$type, x: NaN, y: NaN };
            this.hu = dateNow();
            this.fv = false;
            this.fw = false;
            this.al = new CanvasRenderScheduler();
            this.al.a = runOn(this, this.ow);
            this.am = new CanvasRenderScheduler();
            this.ak = new CanvasRenderScheduler();
            SeriesViewer.y4 = new Rect(0, 0, 0, 1, 1);
            this.syncSettings = ((() => {
                let $ret = new SyncSettings();
                $ret.synchronizeHorizontally = true;
                $ret.synchronizeVertically = true;
                return $ret;
            })());
            this.dw = this.dv();
            this.rw(this.dw);
            this.dw.c7();
            this.t0();
            this.pn();
            this.actualSyncLink = new SyncLink();
            this.t7(null, this.actualSyncLink);
            this.a3 = new ChartContentManager(this);
            this.propertyUpdated = delegateCombine(this.propertyUpdated, (a, b) => this.r8(a, b.propertyName, b.oldValue, b.newValue));
            this.selectedSeriesItems = new ChartSelectedItemCollection();
            let a = this.selectedSeriesItems;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.rh));
            let b = this.selectedSeriesItems;
            b.collectionResetting = delegateCombine(b.collectionResetting, runOn(this, this.tg));
            this.focusedSeriesItems = new ChartSelectedItemCollection();
            let c = this.focusedSeriesItems;
            c.collectionChanged = delegateCombine(c.collectionChanged, runOn(this, this.qu));
            let d = this.focusedSeriesItems;
            d.collectionResetting = delegateCombine(d.collectionResetting, runOn(this, this.pg));
            let e = this.series;
            e.collectionChanged = delegateCombine(e.collectionChanged, runOn(this, this.sa));
            let f = this.series;
            f.collectionResetting = delegateCombine(f.collectionResetting, runOn(this, this.sb));
            let g = this.b9;
            g.collectionChanged = delegateCombine(g.collectionChanged, runOn(this, this.ti));
            let h = this.b9;
            h.collectionResetting = delegateCombine(h.collectionResetting, runOn(this, this.tj));
            this.dz = new DoubleAnimator(0, 1, this.kc);
            this.dy = new DoubleAnimator(0, 1, this.ka);
            let i = this.dy;
            i.propertyChanged = delegateCombine(i.propertyChanged, runOn(this, this.pm));
            this.d0 = new DoubleAnimator(0, 1, this.ke);
            this.dx = new DoubleAnimator(0, 1, this.j7);
            let j = this.d0;
            j.propertyChanged = delegateCombine(j.propertyChanged, runOn(this, this.th));
            let k = this.dx;
            k.propertyChanged = delegateCombine(k.propertyChanged, runOn(this, this.ph));
            this.dw.b0();
            this.pp();
            this.po();
        }
        get widget() {
            return this._widget;
        }
        set widget(a) {
            this._widget = a;
        }
        static staticInit() {
            SeriesViewer.y4 = new Rect(0, 0, 0, 1, 1);
        }
        get ef() {
            if (this.ee == null) {
                this.ee = new SRProvider(this.dw.j.ae);
            }
            return this.ee;
        }
        ao(a) {
            if (this.an == null) {
                this.an = new AutomaticSeriesManager(this, this.series, this.b9);
            }
            return this.an;
        }
        getDesiredToolbarActions() {
            if (!this.gc) {
                return null;
            }
            return this.bo.getDesiredToolbarActions(this);
        }
        ru(a, b) {
            if (this.userAnnotationInformationRequested != null) {
                this.userAnnotationInformationRequested(a, b);
            }
        }
        rv(a, b) {
            if (this.userAnnotationToolTipContentUpdating != null) {
                this.userAnnotationToolTipContentUpdating(a, b);
            }
        }
        op(a) {
            if (this.fs) {
                for (let b = 0; b < this.b9.count; b++) {
                    let c = this.b9._inner[b];
                    if (c.f9) {
                        this.bl.cancelAnnotationFlow(c, a);
                    }
                }
            }
        }
        pb(a) {
            if (this.fs) {
                for (let b = 0; b < this.b9.count; b++) {
                    let c = this.b9._inner[b];
                    if (c.f9) {
                        this.bl.finishAnnotationFlow(c, a);
                    }
                }
            }
        }
        onToolCommandExecuting(a) {
            if (!this.gc) {
                return 1;
            }
            return this.bo.onToolCommandExecuting(this, a);
        }
        addCommandAvailabilityListener(a) {
        }
        removeCommandAvailabilityListener(a) {
        }
        addCommandStateChangedListener(a) {
            if (!this.hm.contains(a)) {
                this.hm.add(a);
            }
        }
        removeCommandStateChangedListener(a) {
            if (this.hm.contains(a)) {
                this.hm.remove(a);
            }
        }
        get commandCompleted() {
            return this._commandCompleted;
        }
        set commandCompleted(a) {
            this._commandCompleted = a;
        }
        get invalidateActions() {
            return this._invalidateActions;
        }
        set invalidateActions(a) {
            this._invalidateActions = a;
        }
        get hk() {
            return this.hi;
        }
        provideContextAccessor(a) {
            if (this.hi == null) {
                this.hi = new HashSet$1(IToolbarContextAccessor_$type, 0);
            }
            this.hi.add_1(a);
        }
        dismissContextAccessor(a) {
            if (this.hi == null) {
                return;
            }
            this.hi.remove(a);
        }
        ps() {
            if (this.invalidateActions != null) {
                this.invalidateActions();
            }
        }
        get bo() {
            if (this.bn == null) {
                this.bn = DVContainer.instance.createInstance(IDataChartToolbarProvider_$type, () => this.ef.n);
                this.bn.container = this.dw.bl;
            }
            return this.bn;
        }
        get gc() {
            return DVContainer.instance.checkLoaded("DataChartToolbarFactoryManager");
        }
        get bq() {
            if (this.bp == null) {
                this.bp = DVContainer.instance.createInstance(ISeriesViewerInteractionManager_$type, () => this.ef.n);
            }
            return this.bp;
        }
        get f3() {
            return DVContainer.instance.checkLoaded("InteractivityFactoryManager");
        }
        sb(a, b) {
            if (this.an != null) {
                this.an.o(a, b);
            }
            else {
                this.b9.clear();
            }
        }
        sa(a, b) {
            if (this.an != null) {
                this.an.n(a, b);
            }
            else {
                switch (b.action) {
                    case 0:
                        if (b.newItems != null) {
                            for (let c = 0; c < b.newItems.count; c++) {
                                let d = b.newItems.item(c);
                                this.b9.insert(c + b.newStartingIndex, d);
                            }
                        }
                        break;
                    case 1:
                        if (b.oldItems != null) {
                            for (let e = 0; e < b.oldItems.count; e++) {
                                this.b9.removeAt(b.oldStartingIndex);
                            }
                        }
                        break;
                    case 2:
                        if (b.oldItems != null) {
                            for (let f = 0; f < b.oldItems.count; f++) {
                                this.b9.removeAt(b.oldStartingIndex);
                            }
                        }
                        if (b.newItems != null) {
                            for (let g = 0; g < b.newItems.count; g++) {
                                let h = b.newItems.item(g);
                                this.b9.insert(g + b.newStartingIndex, h);
                            }
                        }
                        break;
                    case 4:
                        this.b9.clear();
                        for (let i of fromEnum(this.series)) {
                            this.b9.add(i);
                        }
                        break;
                }
            }
        }
        tg(a, b) {
            for (let c = 0; c < this.selectedSeriesItems.count; c++) {
                this.q0(this.selectedSeriesItems._inner[c]);
            }
        }
        pg(a, b) {
            for (let c = 0; c < this.focusedSeriesItems.count; c++) {
                this.qz(this.focusedSeriesItems._inner[c]);
            }
        }
        rh(a, b) {
            if (b.action == 4 && b.newItems == null && b.oldItems == null) {
                return;
            }
            if (this.e0) {
                return;
            }
            if (b.oldItems != null) {
                for (let c = 0; c < b.oldItems.count; c++) {
                    let d = b.oldItems.item(c);
                    this.q0(d);
                }
            }
            if (b.newItems != null) {
                for (let e = 0; e < b.newItems.count; e++) {
                    let f = b.newItems.item(e);
                    f.f(this);
                }
                for (let g = 0; g < b.newItems.count; g++) {
                    let h = b.newItems.item(g);
                    this.q2(h);
                }
            }
            let i = new ChartSelectedItemCollection();
            if (b.oldItems != null) {
                for (let j = 0; j < b.oldItems.count; j++) {
                    i.add(b.oldItems.item(j));
                }
            }
            let k = new ChartSelectedItemCollection();
            if (b.newItems != null) {
                for (let l = 0; l < b.newItems.count; l++) {
                    k.add(b.newItems.item(l));
                }
            }
            let m = this.selectedSeriesItems;
            this.rg(this, new SeriesViewerSelectedSeriesItemsChangedEventArgs(i, k, m));
        }
        qu(a, b) {
            if (b.action == 4 && b.newItems == null && b.oldItems == null) {
                return;
            }
            if (this.ez) {
                return;
            }
            if (b.oldItems != null) {
                for (let c = 0; c < b.oldItems.count; c++) {
                    let d = b.oldItems.item(c);
                    this.qz(d);
                }
            }
            if (b.newItems != null) {
                for (let e = 0; e < b.newItems.count; e++) {
                    let f = b.newItems.item(e);
                    this.q1(f);
                }
            }
            let g = new ChartSelectedItemCollection();
            if (b.oldItems != null) {
                for (let h = 0; h < b.oldItems.count; h++) {
                    g.add(b.oldItems.item(h));
                }
            }
            let i = new ChartSelectedItemCollection();
            if (b.newItems != null) {
                for (let j = 0; j < b.newItems.count; j++) {
                    i.add(b.newItems.item(j));
                }
            }
            let k = this.selectedSeriesItems;
            this.qt(this, new SeriesViewerSelectedSeriesItemsChangedEventArgs(g, i, k));
        }
        q1(a) {
            this.pi((b) => {
                let c = a;
                if (c.series != null && c.series != b) {
                    return;
                }
                b.p5(c.item);
            });
        }
        qz(a) {
            this.pi((b) => {
                let c = a;
                if (c.series != null && c.series != b) {
                    return;
                }
                b.p3(c.item);
            });
        }
        pi(a) {
            for (let b of fromEnum(this.b9)) {
                a(b);
                if (b.isStacked) {
                    b.qh((c) => {
                        a(c);
                        if (c.ei) {
                            c.qf((d) => {
                                a(d);
                                return true;
                            });
                        }
                        return true;
                    });
                }
                if (b.ei) {
                    b.qf((c) => {
                        a(c);
                        return true;
                    });
                }
            }
        }
        q2(a) {
            this.pi((b) => {
                let c = a;
                if (c.series != null && c.series != b) {
                    return;
                }
                if (c.item == null) {
                    b.qb();
                }
                else {
                    b.p6(c.item);
                }
            });
        }
        q0(a) {
            this.pi((b) => {
                let c = a;
                if (c.series != null && c.series != b) {
                    return;
                }
                if (c.item == null) {
                    b.p9();
                }
                else {
                    b.p4(c.item);
                }
            });
        }
        pn() {
            if (this.dn != null && this.dp == null) {
                let a = this.dp;
                a.thumbnailSizeChanged = delegateRemove(a.thumbnailSizeChanged, runOn(this, this.r4));
            }
            if (this.dp != null) {
                let b = this.dp;
                b.thumbnailSizeChanged = delegateCombine(b.thumbnailSizeChanged, runOn(this, this.r4));
            }
            if (this.kk != null) {
                this.dp.backgroundImageUri = this.kk;
            }
            if (this.dp != null) {
                this.dp.initializeScalingRatio(this.ij);
            }
            if (this.dn == null && this.dp != null) {
                this.p7();
            }
            this.dn = this.dp;
        }
        r4(a, b) {
            this.dp.surfaceIsDirty = true;
            for (let c of fromEnum(this.b9)) {
                c.g6 = true;
            }
        }
        get_go() {
            return false;
        }
        get go() {
            return this.get_go();
        }
        get_gn() {
            return false;
        }
        get gn() {
            return this.get_gn();
        }
        po() {
            this.dw.cr();
            if (this.dp != null) {
                this.dp.initializeScalingRatio(this.ij);
            }
        }
        get series() {
            return this.b8;
        }
        get b9() {
            return this.b7;
        }
        ti(a, b) {
            let c = this.fd;
            this.fd = this.fj();
            if (b.oldItems != null) {
                let d = this.j1;
                for (let e of fromEn(b.oldItems)) {
                    if (e != null && e.eq) {
                        this.j1--;
                        if (this.j1 < 0) {
                            this.j1 = 0;
                        }
                    }
                    e.c4 = null;
                    e.dc = null;
                    this.s8(e);
                    this.dw.d1(e);
                }
                if (this.j1 < d) {
                    for (let f of fromEnum(this.b9)) {
                        if (f.ev) {
                            continue;
                        }
                        f.p8();
                    }
                }
            }
            if (b.newItems != null) {
                let g = this.j1;
                for (let h of fromEn(b.newItems)) {
                    if (h != null && h.eq) {
                        this.j1++;
                    }
                    if (!this.dw.ar(h)) {
                        this.t1(h);
                        this.dw.bs(h);
                        h.dc = this;
                        h.c4 = this.actualSyncLink;
                        h.s7();
                    }
                }
                if (this.j1 > g) {
                    for (let i of fromEnum(this.b9)) {
                        if (i.ev || b.newItems.contains(i)) {
                            continue;
                        }
                        i.p8();
                    }
                }
            }
            if (this.fd != c && !this.y9.isEmpty) {
                this.r7(this.y9, this.y9);
            }
            this.p6();
            this.qf();
            this.qx();
            this.p0();
        }
        get ci() {
            return this.ch;
        }
        set ci(a) {
            this.ch = a;
        }
        get ck() {
            return this.cj;
        }
        set ck(a) {
            this.cj = a;
        }
        pq() {
            this.qf();
        }
        qf() {
        }
        get skipDataCleanup() {
            return this._skipDataCleanup;
        }
        set skipDataCleanup(a) {
            this._skipDataCleanup = a;
        }
        s8(a) {
            if (!this.skipDataCleanup) {
                if (typeCast(Series.$, a) !== null) {
                    a.itemsSource = null;
                }
                else if (typeCast(CategoryAxisBase.$, a) !== null) {
                    a.itemsSource = null;
                }
            }
            this.ta(a.name, true);
        }
        get fm() {
            return this.j1 > 0;
        }
        tj(a, b) {
            this.fd = this.fj();
            for (let c of fromEnum(this.b9)) {
                c.c4 = null;
                c.dc = null;
                this.s8(c);
                this.dw.d1(c);
            }
            this.j1 = 0;
            this.p0();
        }
        pv(a, b, c, d) {
            let e = this.y9;
            let f = e.width;
            let g = e.height;
            let h = 1;
            let 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) {
                let j = 1 / b;
                b = 1;
                a = a * j;
            }
            if (a > 1) {
                let k = 1 / a;
                a = 1;
                b = b * k;
            }
            return {
                p0: a,
                p1: b
            };
        }
        fj() {
            return false;
        }
        get g4() {
            return this.ge;
        }
        get fx() {
            return this.bp != null;
        }
        get fc() {
            return this.bp != null;
        }
        get fb() {
            return this.cx != 0 || this.cy != 0;
        }
        get fa() {
            return this.fc && this.fb;
        }
        get d7() {
            let a = this.bq.f$e;
            if (a.executionContext == null) {
                a.executionContext = this.dw.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.o7);
            }
            a.dismissHighlightDelay = this.j9;
            return a;
        }
        get d8() {
            let a = this.bq.f$f;
            if (a.executionContext == null) {
                a.executionContext = this.dw.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.o8);
            }
            a.dismissHighlightDelay = this.kd;
            return a;
        }
        get d6() {
            let a = this.bq.f$d;
            if (a.executionContext == null) {
                a.executionContext = this.dw.l();
            }
            if (a.ensureAnimator == null) {
                a.ensureAnimator = runOn(this, this.o6);
            }
            a.dismissHighlightDelay = this.j6;
            return a;
        }
        get br() {
            let a = this.bq.f$b;
            if (a.executionContext == null) {
                a.executionContext = this.dw.l();
            }
            if (a.animator == null) {
                a.animator = this.dz;
                a.owner = this;
            }
            return a;
        }
        o7() {
            {
                let a = this.dy;
                if (!a.f() && a.r > 0) {
                    a.v();
                }
                if (a.r == 0) {
                    let b = this.ha(1);
                    while (b) {
                        b = this.ha(0);
                        b = this.ha(1);
                    }
                }
            }
        }
        o8() {
            {
                let a = this.d0;
                if (!a.f() && a.r > 0) {
                    a.v();
                }
                if (a.r == 0) {
                    let b = this.hb(1);
                    while (b) {
                        b = this.hb(0);
                        b = this.hb(1);
                    }
                }
            }
        }
        o6() {
            {
                let a = this.dx;
                if (!a.f() && a.r > 0) {
                    a.v();
                }
                if (a.r == 0) {
                    let b = this.g9(1);
                    while (b) {
                        b = this.g9(0);
                        b = this.g9(1);
                    }
                }
            }
        }
        pm(a, b) {
            this.ha(this.dy.o);
        }
        th(a, b) {
            this.hb(this.d0.o);
        }
        ph(a, b) {
            this.g9(this.dx.o);
        }
        ha(a) {
            let b = this.d7.tick(a);
            if (a == 1 && b && this.dy.r > 0) {
                this.dy.v();
            }
            let c = this.d7.dirtyContexts;
            if (this.d7.allDirty) {
                let d = this.b9;
                for (let e = 0; e < d.count; e++) {
                    let f = d._inner[e];
                    f.rk();
                }
            }
            else {
                for (let g = 0; g < c.count; g++) {
                    let h = c._inner[g];
                    h.rk();
                }
            }
            if (!b) {
                this.dy.w();
                this.qw();
            }
            return b;
        }
        hb(a) {
            let b = this.d8.tick(a);
            if (a == 1 && b && this.d0.r > 0) {
                this.d0.v();
            }
            let c = this.d8.dirtyContexts;
            if (this.d8.allDirty) {
                let d = this.b9;
                for (let e = 0; e < d.count; e++) {
                    let f = d._inner[e];
                    f.rk();
                }
            }
            else {
                for (let g = 0; g < c.count; g++) {
                    let h = c._inner[g];
                    h.rk();
                }
            }
            if (!b) {
                this.d0.w();
            }
            return b;
        }
        g9(a) {
            let b = this.d6.tick(a);
            if (a == 1 && b && this.dx.r > 0) {
                this.dx.v();
            }
            let c = this.d6.dirtyContexts;
            if (this.d6.allDirty) {
                let d = this.b9;
                for (let e = 0; e < d.count; e++) {
                    let f = d._inner[e];
                    f.rk();
                }
            }
            else {
                for (let g = 0; g < c.count; g++) {
                    let h = c._inner[g];
                    h.rk();
                }
            }
            if (!b) {
                this.dx.w();
            }
            return b;
        }
        pl() {
            this.dw.cn();
            this.pk();
            for (let a = 0; a < this.b9.count; a++) {
                if (this.b9._inner[a].ev) {
                    this.b9._inner[a].ql();
                }
            }
        }
        xx(a) {
            return this.xw(this.ag, a);
        }
        x3(a) {
            return this.xw(this.aj, a);
        }
        x1(a) {
            return this.xw(this.ah, a);
        }
        x2(a) {
            return this.xw(this.ai, a);
        }
        xw(a, b) {
            if (a == null || a.count == 0) {
                return null;
            }
            else {
                return a.item(b % a.count);
            }
        }
        get yi() {
            return this.yh;
        }
        set yi(a) {
            if (PointUtil.notEquals(this.yh, a)) {
                let b = this.yh;
                this.yh = a;
                this.sr("CrosshairPoint", b, this.yh);
            }
        }
        s4() {
        }
        get f2() {
            return this.dm == 1 || this.dm == 2 || this.dm == 3;
        }
        get legend() {
            return this.c(SeriesViewer.vy);
        }
        set legend(a) {
            this.h(SeriesViewer.vy, a);
        }
        get e8() {
            return this.c(SeriesViewer.ut);
        }
        set e8(a) {
            this.h(SeriesViewer.ut, a);
        }
        get gy() {
            return this.c(SeriesViewer.wn);
        }
        set gy(a) {
            this.h(SeriesViewer.wn, a);
        }
        se(a, b) {
            if (this.axisLabelMouseDown != null) {
                this.axisLabelMouseDown(this, b);
            }
        }
        si(a, b) {
            if (this.axisLabelMouseUp != null) {
                this.axisLabelMouseUp(this, b);
            }
        }
        sf(a, b) {
            if (this.axisLabelMouseEnter != null) {
                this.axisLabelMouseEnter(this, b);
            }
        }
        sg(a, b) {
            if (this.axisLabelMouseLeave != null) {
                this.axisLabelMouseLeave(this, b);
            }
        }
        sh(a, b) {
            if (this.axisLabelMouseOver != null) {
                this.axisLabelMouseOver(this, b);
            }
        }
        sd(a, b) {
            if (this.axisLabelMouseClick != null) {
                this.axisLabelMouseClick(this, b);
            }
        }
        sk(a, b) {
            if (this.axisPanelMouseDown != null) {
                this.axisPanelMouseDown(this, b);
            }
        }
        so(a, b) {
            if (this.axisPanelMouseUp != null) {
                this.axisPanelMouseUp(this, b);
            }
        }
        sl(a, b) {
            if (this.axisPanelMouseEnter != null) {
                this.axisPanelMouseEnter(this, b);
            }
        }
        sm(a, b) {
            if (this.axisPanelMouseLeave != null) {
                this.axisPanelMouseLeave(this, b);
            }
        }
        sn(a, b) {
            if (this.axisPanelMouseOver != null) {
                this.axisPanelMouseOver(this, b);
            }
        }
        sj(a, b) {
            if (this.axisPanelMouseClick != null) {
                this.axisPanelMouseClick(this, b);
            }
        }
        rc(a, b) {
            this.ev = false;
            let c = false;
            c = false;
            if (this.dw.k.al) {
                return;
            }
            if (this.plotAreaMouseLeftButtonDown != null) {
                let d = this.bw(a, b, c);
                this.plotAreaMouseLeftButtonDown(this, d);
            }
        }
        bw(a, b, c) {
            let d = { $type: Point_$type, x: a.x, y: a.y };
            let e = { $type: Point_$type, x: a.x, y: a.y };
            if (!this.y9.isEmpty) {
                if (c) {
                    e.x -= this.y9.left;
                    e.y -= this.y9.top;
                }
                else {
                    d.x += this.y9.left;
                    d.y += this.y9.top;
                }
            }
            let f = new PlotAreaMouseButtonEventArgs(this, d, e);
            f.manipulationOccurred = this.ev;
            return f;
        }
        b0(a, b, c) {
            let d = { $type: Point_$type, x: a.x, y: a.y };
            let e = { $type: Point_$type, x: a.x, y: a.y };
            if (!this.y9.isEmpty) {
                if (c) {
                    e.x -= this.y9.left;
                    e.y -= this.y9.top;
                }
                else {
                    d.x += this.y9.left;
                    d.y += this.y9.top;
                }
            }
            let f = new PlotAreaMouseEventArgs(this, d, e);
            return f;
        }
        rd(a, b, c) {
            let d = false;
            d = false;
            if (this.dw.k.al) {
                return;
            }
            if (this.plotAreaMouseLeftButtonUp != null) {
                let e = this.bw(a, b, d);
                this.plotAreaMouseLeftButtonUp(this, e);
            }
            if (!this.ev && !c) {
                if (this.plotAreaClicked != null) {
                    let f = this.bw(a, b, d);
                    this.plotAreaClicked(this, f);
                }
            }
            this.ev = false;
        }
        get ge() {
            return this.c(SeriesViewer.vu);
        }
        set ge(a) {
            this.h(SeriesViewer.vu, a);
        }
        get g3() {
            return this.c(SeriesViewer.wq);
        }
        set g3(a) {
            this.h(SeriesViewer.wq, a);
        }
        get cg() {
            return EnumUtil.getEnumValue(SeriesHighlightingMode_$type, this.c(SeriesViewer.vb));
        }
        set cg(a) {
            this.h(SeriesViewer.vb, enumGetBox(SeriesHighlightingMode_$type, a));
        }
        get iy() {
            return this.c(SeriesViewer.va);
        }
        set iy(a) {
            this.h(SeriesViewer.va, a);
        }
        get ct() {
            return EnumUtil.getEnumValue(SeriesSelectionMode_$type, this.c(SeriesViewer.wk));
        }
        set ct(a) {
            this.h(SeriesViewer.wk, enumGetBox(SeriesSelectionMode_$type, a));
        }
        get co() {
            return EnumUtil.getEnumValue(SeriesSelectionBehavior_$type, this.c(SeriesViewer.wh));
        }
        set co(a) {
            this.h(SeriesViewer.wh, enumGetBox(SeriesSelectionBehavior_$type, a));
        }
        get cr() {
            return EnumUtil.getEnumValue(SeriesSelectionMode_$type, this.c(SeriesViewer.u3));
        }
        set cr(a) {
            this.h(SeriesViewer.u3, enumGetBox(SeriesSelectionMode_$type, a));
        }
        get cz() {
            return EnumUtil.getEnumValue(SeriesViewerScrollbarMode_$type, this.c(SeriesViewer.vj));
        }
        set cz(a) {
            this.h(SeriesViewer.vj, enumGetBox(SeriesViewerScrollbarMode_$type, a));
        }
        get c0() {
            return EnumUtil.getEnumValue(SeriesViewerScrollbarMode_$type, this.c(SeriesViewer.w4));
        }
        set c0(a) {
            this.h(SeriesViewer.w4, enumGetBox(SeriesViewerScrollbarMode_$type, a));
        }
        get cw() {
            return EnumUtil.getEnumValue(SeriesViewerHorizontalScrollbarPosition_$type, this.c(SeriesViewer.vl));
        }
        set cw(a) {
            this.h(SeriesViewer.vl, enumGetBox(SeriesViewerHorizontalScrollbarPosition_$type, a));
        }
        get c3() {
            return EnumUtil.getEnumValue(SeriesViewerVerticalScrollbarPosition_$type, this.c(SeriesViewer.w6));
        }
        set c3(a) {
            this.h(SeriesViewer.w6, enumGetBox(SeriesViewerVerticalScrollbarPosition_$type, a));
        }
        get x5() {
            return this.c(SeriesViewer.vf);
        }
        set x5(a) {
            this.h(SeriesViewer.vf, a);
        }
        get x6() {
            return this.c(SeriesViewer.vk);
        }
        set x6(a) {
            this.h(SeriesViewer.vk, a);
        }
        get i3() {
            return this.c(SeriesViewer.vn);
        }
        set i3(a) {
            this.h(SeriesViewer.vn, a);
        }
        get i2() {
            return this.c(SeriesViewer.vi);
        }
        set i2(a) {
            this.h(SeriesViewer.vi, a);
        }
        get iz() {
            return this.c(SeriesViewer.ve);
        }
        set iz(a) {
            this.h(SeriesViewer.ve, a);
        }
        get i0() {
            return this.c(SeriesViewer.vg);
        }
        set i0(a) {
            this.h(SeriesViewer.vg, a);
        }
        get i1() {
            return this.c(SeriesViewer.vh);
        }
        set i1(a) {
            this.h(SeriesViewer.vh, a);
        }
        get i5() {
            return this.c(SeriesViewer.vp);
        }
        set i5(a) {
            this.h(SeriesViewer.vp, a);
        }
        get i4() {
            return this.c(SeriesViewer.vo);
        }
        set i4(a) {
            this.h(SeriesViewer.vo, a);
        }
        get fo() {
            return this.c(SeriesViewer.vm);
        }
        set fo(a) {
            this.h(SeriesViewer.vm, a);
        }
        get yf() {
            return this.c(SeriesViewer.w1);
        }
        set yf(a) {
            this.h(SeriesViewer.w1, a);
        }
        get yg() {
            return this.c(SeriesViewer.w5);
        }
        set yg(a) {
            this.h(SeriesViewer.w5, a);
        }
        get jp() {
            return this.c(SeriesViewer.w8);
        }
        set jp(a) {
            this.h(SeriesViewer.w8, a);
        }
        get jo() {
            return this.c(SeriesViewer.w3);
        }
        set jo(a) {
            this.h(SeriesViewer.w3, a);
        }
        get jm() {
            return this.c(SeriesViewer.w0);
        }
        set jm(a) {
            this.h(SeriesViewer.w0, a);
        }
        get js() {
            return this.c(SeriesViewer.xb);
        }
        set js(a) {
            this.h(SeriesViewer.xb, a);
        }
        ow() {
            if (!this.al.g && !this.al.f && !this.dw.a.g && !this.dw.a.f) {
                this.rf();
            }
        }
        rf() {
            this.ou();
        }
        get jn() {
            return this.c(SeriesViewer.w2);
        }
        set jn(a) {
            this.h(SeriesViewer.w2, a);
        }
        get jr() {
            return this.c(SeriesViewer.xa);
        }
        set jr(a) {
            this.h(SeriesViewer.xa, a);
        }
        get jq() {
            return this.c(SeriesViewer.w9);
        }
        set jq(a) {
            this.h(SeriesViewer.w9, a);
        }
        get hf() {
            return this.c(SeriesViewer.w7);
        }
        set hf(a) {
            this.h(SeriesViewer.w7, a);
        }
        cs() {
            if (this.ct == 0) {
                return 1;
            }
            return this.ct;
        }
        cn() {
            if (this.co == 0) {
                return 3;
            }
            return this.co;
        }
        cf() {
            if (this.ce == 0) {
                return 1;
            }
            if (this.cg == 3 || this.cg == 5) {
                if (this.ce == 2) {
                    return 4;
                }
            }
            return this.ce;
        }
        get cd() {
            return this.cc;
        }
        get cq() {
            return this.cp;
        }
        get cm() {
            return this.cl;
        }
        get ce() {
            return EnumUtil.getEnumValue(SeriesHighlightingBehavior_$type, this.c(SeriesViewer.u8));
        }
        set ce(a) {
            this.h(SeriesViewer.u8, enumGetBox(SeriesHighlightingBehavior_$type, a));
        }
        get bs() {
            return EnumUtil.getEnumValue(LegendHighlightingMode_$type, this.c(SeriesViewer.vv));
        }
        set bs(a) {
            this.h(SeriesViewer.vv, enumGetBox(LegendHighlightingMode_$type, a));
        }
        get bu() {
            return EnumUtil.getEnumValue(LegendItemBadgeShape_$type, this.c(SeriesViewer.vx));
        }
        set bu(a) {
            this.h(SeriesViewer.vx, enumGetBox(LegendItemBadgeShape_$type, a));
        }
        get bt() {
            return EnumUtil.getEnumValue(LegendItemBadgeMode_$type, this.c(SeriesViewer.vw));
        }
        set bt(a) {
            this.h(SeriesViewer.vw, enumGetBox(LegendItemBadgeMode_$type, a));
        }
        get fk() {
            return this.c(SeriesViewer.u0);
        }
        set fk(a) {
            this.h(SeriesViewer.u0, a);
        }
        sr(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));
            }
        }
        q3() {
            this.q4(this.b9);
        }
        q4(a) {
            this.hj.clear();
            for (let b of fromEn(a)) {
                let c = b.a5;
                if (c == null) {
                    continue;
                }
                let d = b.tc;
                if (d == null) {
                    continue;
                }
                if (c.containsChild(d)) {
                    c.removeChild(d);
                    if (!this.hj.contains(c)) {
                        this.hj.add_1(c);
                    }
                }
                if (!c.containsChild(d) && b.legendItemVisibility != 1) {
                    c.addChildInOrder(d, b);
                    if (!this.hj.contains(c)) {
                        this.hj.add_1(c);
                    }
                }
            }
            for (let e of fromEnum(this.hj)) {
                e.flushTextContentChangedCheck();
            }
        }
        rk(a, b, c, d) {
            this.sx(a, b, typeCast(MouseEventArgs.$, c), d);
        }
        ro(a, b, c, d) {
            this.s1(a, b, typeCast(MouseEventArgs.$, c), d);
        }
        rl(a, b, c, d) {
            this.sy(a, b, typeCast(MouseEventArgs.$, c), d);
        }
        rm(a, b, c, d) {
            this.sz(a, b, typeCast(MouseButtonEventArgs.$, c), d);
        }
        rn(a, b, c, d) {
            let e = typeCast(MouseButtonEventArgs.$, c);
            if (e != null) {
                this.s0(a, b, typeCast(MouseButtonEventArgs.$, c), d);
            }
            if (e != null) {
                if (!this.ev) {
                    this.su(a, b, typeCast(MouseButtonEventArgs.$, c), d);
                }
            }
        }
        oj(a, b) {
            return null;
        }
        get gk() {
            return this.ev;
        }
        qd(a, b) {
            if (!this.em && a) {
                this.oz({ $type: Point_$type, x: NaN, y: NaN });
                this.em = true;
                this.ev = true;
                if (this.fk) {
                    this.bq.f$y(this, b);
                }
                if (this.viewerManipulationStarting != null) {
                    let c = new SeriesViewerManipulationEventArgs();
                    c.isDragZoom = true;
                    this.viewerManipulationStarting(this, c);
                }
            }
        }
        qb(a, b) {
            if (!this.el && a) {
                this.oz({ $type: Point_$type, x: NaN, y: NaN });
                this.el = true;
                this.ev = true;
                if (this.fk) {
                    this.bq.f$y(this, b);
                }
                if (this.viewerManipulationStarting != null) {
                    let c = new SeriesViewerManipulationEventArgs();
                    c.isDragSelect = true;
                    this.viewerManipulationStarting(this, c);
                }
            }
        }
        rp(a, b, c, d) {
        }
        rq(a, b, c, d) {
        }
        sv(a, b) {
            if (this.seriesCursorMouseMove != null && this.ff) {
                this.seriesCursorMouseMove(this, new ChartCursorEventArgs(this, a, b));
            }
        }
        sz(a, b, c, d) {
            if (this.seriesMouseLeftButtonDown != null) {
                this.seriesMouseLeftButtonDown(this, new DataChartMouseButtonEventArgs(this, a, b, c, d));
            }
        }
        s0(a, b, c, d) {
            if (this.seriesMouseLeftButtonUp != null) {
                this.seriesMouseLeftButtonUp(this, new DataChartMouseButtonEventArgs(this, a, b, c, d));
            }
        }
        su(a, b, c, d) {
            let e = false;
            if (this.seriesClick != null) {
                let f = new DataChartMouseButtonEventArgs(this, a, b, c, d);
                this.seriesClick(this, f);
                e = f.cancelSelection;
            }
            if (a.isStacked) {
                return;
            }
            if (!e) {
                this.ri(a, b);
            }
        }
        ri(a, b) {
            if (b != null && this.cq != 1) {
                if (a != null) {
                    if (!a.eg(b)) {
                        return;
                    }
                    if (a.bo != null) {
                        if (a.dp != null) {
                            let c = a.dp.indexOf(b);
                            if (c >= 0 && a.bo.dp != null) {
                                b = a.bo.dp.item(c);
                                a = a.bo;
                            }
                        }
                    }
                }
                let d = this.hp(a, b, this.cm);
                d = this.hr(d, this.cm);
                let e = this.ho(this.selectedSeriesItems, d, this.cm);
                for (let f = 0; f < e.count; f++) {
                    this.selectedSeriesItems.remove(e._inner[f]);
                }
                for (let g = 0; g < d.count; g++) {
                    this.selectedSeriesItems.add(d._inner[g]);
                }
            }
        }
        hr(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            let d = new List$1(ChartSelection.$, 0);
            for (let e of fromEnum(a)) {
                if (this.selectedSeriesItems.contains(e)) {
                    c.add(e);
                }
                else {
                    d.add(e);
                }
            }
            for (let f of fromEnum(c)) {
                this.selectedSeriesItems.remove(f);
            }
            return d;
        }
        hs(a, b) {
            let c = new List$1(ChartSelection.$, 0);
            for (let d = 0; d < a.count; d++) {
                if (!this.f5(d, a, b)) {
                    c.add(a._inner[d]);
                }
            }
            return c;
        }
        f5(a, b, c) {
            let d = b._inner[a];
            switch (c) {
                case 1: return d.series != null;
                case 2:
                    if (d.series != null) {
                        return true;
                    }
                    for (let 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 (let 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 (let 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 (let h = a + 1; h < b.count; h++) {
                        if (d.series != b._inner[h].series) {
                            return true;
                        }
                    }
                    return false;
            }
            return false;
        }
        ho(a, b, c) {
            let d = new List$1(ChartSelection.$, 0);
            let e = new HashSet$1(ChartSelection.$, 2, new ChartSelectionEqualityComparer());
            for (let f of fromEnum(b)) {
                this.pj(a, e, d, f, c);
            }
            return d;
        }
        pj(a, b, c, d, e) {
            switch (e) {
                case 1:
                    for (let f of fromEnum(a)) {
                        if (f.series != null) {
                            if (!b.contains(f)) {
                                b.add_1(f);
                                c.add(f);
                            }
                        }
                    }
                    break;
                case 2:
                    for (let g of fromEnum(a)) {
                        if (g.series != null || (g.item != null && !Base.equalsStatic(g.item, d.item))) {
                            if (!b.contains(g)) {
                                b.add_1(g);
                                c.add(g);
                            }
                        }
                    }
                    break;
                case 3:
                    for (let h of fromEnum(a)) {
                        if (h.item == null) {
                            if (!b.contains(h)) {
                                b.add_1(h);
                                c.add(h);
                            }
                        }
                    }
                    break;
                case 4:
                    for (let i of fromEnum(a)) {
                        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);
                            }
                        }
                    }
                    break;
                case 5:
                    for (let j of fromEnum(a)) {
                        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);
                            }
                        }
                    }
                    break;
                case 6:
                    for (let k of fromEnum(a)) {
                        if (k.item != null) {
                            if (!b.contains(k)) {
                                b.add_1(k);
                                c.add(k);
                            }
                        }
                    }
                    break;
                case 7:
                    for (let l of fromEnum(a)) {
                        if (l.item != null || l.series != d.series) {
                            if (!b.contains(l)) {
                                b.add_1(l);
                                c.add(l);
                            }
                        }
                    }
                    break;
            }
        }
        hp(a, b, c) {
            let d = new List$1(ChartSelection.$, 0);
            switch (c) {
                case 1:
                case 2:
                    d.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.item = b;
                        return $ret;
                    })()));
                    break;
                case 3:
                case 4:
                case 5:
                    d.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.item = b;
                        $ret.series = a;
                        return $ret;
                    })()));
                    break;
                case 6:
                case 7:
                    d.add(((() => {
                        let $ret = new ChartSelection();
                        $ret.series = a;
                        return $ret;
                    })()));
                    break;
            }
            return d;
        }
        tp(a) {
            this.bq.f$at(this, a);
        }
        tq() {
            this.bq.f$au(this);
        }
        to(a) {
            this.bq.f$as(this, a);
        }
        tt(a) {
            this.bq.f$at(this, a);
            this.rb(a);
        }
        ts(a) {
            this.bq.f$o(this, a, true, false);
        }
        tr(a) {
            a = { $type: Point_$type, x: a.x - this.y9.left, y: a.y - this.y9.top };
            let b = this.yl(a);
            if (this.g3) {
                this.oz(b);
            }
            else {
                let c = this.cd;
                let d = c == 2 || c == 3 || c == 4;
                if (d) {
                    this.t3(b);
                    for (let e = 0; e < this.b9.count; e++) {
                        let f = this.b9._inner[e];
                        f.s6(b);
                        if (f.isStacked) {
                            f.qh((g) => {
                                if (g.ei) {
                                    g.qf((h) => {
                                        h.s6(b);
                                        return true;
                                    });
                                }
                                g.s6(b);
                                return true;
                            });
                        }
                        if (f.ei) {
                            f.qf((g) => {
                                g.s6(b);
                                return true;
                            });
                        }
                    }
                }
            }
        }
        s1(a, b, c, d) {
            if (this.seriesMouseMove != null) {
                this.seriesMouseMove(this, new ChartMouseEventArgs(this, a, b, c, d));
            }
        }
        sx(a, b, c, d) {
            if (this.seriesMouseEnter != null) {
                this.seriesMouseEnter(this, new ChartMouseEventArgs(this, a, b, c, d));
            }
        }
        sy(a, b, c, d) {
            if (this.seriesMouseLeave != null) {
                this.seriesMouseLeave(this, new ChartMouseEventArgs(this, a, b, c, d));
            }
        }
        qc() {
            if (this.em) {
                this.em = false;
                if (this.viewerManipulationEnding != null) {
                    let a = new SeriesViewerManipulationEventArgs();
                    a.isDragZoom = true;
                    this.viewerManipulationEnding(this, a);
                }
            }
        }
        gr(a) {
            if (this.el) {
                this.el = false;
                if (this.viewerManipulationEnding != null) {
                    let b = new SeriesViewerManipulationEventArgs();
                    let c = this.y8(a);
                    b.isDragSelect = true;
                    b.dragSelectRectangle = c;
                    this.viewerManipulationEnding(this, b);
                    if (b.isDragSelectCancelled) {
                        return true;
                    }
                }
            }
            return false;
        }
        get_y9() {
            return this.yq;
        }
        get y9() {
            return this.get_y9();
        }
        get yv() {
            return this.yo;
        }
        set yv(a) {
            this.yo = a;
        }
        get_fn() {
            return false;
        }
        get fn() {
            return this.get_fn();
        }
        y1(a, b, c) {
            if (c.isEmpty) {
                return c;
            }
            let d = c;
            let e = b;
            let f = (d.left - e.left) / e.width;
            let g = (d.top - e.top) / e.height;
            let h = (d.right - e.left) / e.width;
            let 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);
        }
        get_yu() {
            if (this.ej) {
                this.ej = false;
                let a = this.yz(this.y9, this.yv, this.yr);
                this.yn = a;
            }
            return this.yn;
        }
        get yu() {
            return this.get_yu();
        }
        yz(a, b, c) {
            let d = b;
            let e = c;
            let f = a;
            if (f.isEmpty) {
                return Rect.empty;
            }
            if (d.isEmpty) {
                return a;
            }
            let g = (d.left - f.left) / f.width;
            let h = (d.right - f.left) / f.width;
            let i = (d.top - f.top) / f.height;
            let 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;
            let k = new Rect(0, g, i, h - g, j - i);
            k.intersect(f);
            return k;
        }
        yt(a) {
            this.ej = true;
            if (this.fj()) {
                if (a.isEmpty) {
                    return Rect.empty;
                }
                let b;
                if (a.width > a.height) {
                    let c = intDivide(truncate((a.width - a.height)), 2);
                    b = new Rect(0, a.left + c, a.top, a.height, a.height);
                }
                else {
                    let 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;
        }
        y0() {
            return this.y9;
        }
        tz(a) {
            a.o6 = this.y9;
        }
        get j4() {
            return this.j0;
        }
        set j4(a) {
            this.j0 = a;
        }
        r7(a, b) {
            if (!b.isEmpty) {
                this.yq = b;
                this.yo = this.yt(this.yq);
                this.dw.et(this.yq);
            }
            if (this.fj()) {
                if (this.actualSyncLink != null) {
                    this.ud(this.yr, false);
                }
            }
            this.re(a, b);
            if (this.fa) {
                this.br.updateScrollbars(this, this.yr, this.yr, a, b);
            }
        }
        cv() {
            return this.cu;
        }
        ov(a, b) {
            let c = false;
            c = true;
            if (this.y9.containsPoint(a)) {
                if (!this.es) {
                    this.es = true;
                    if (this.plotAreaMouseEnter != null) {
                        let d = this.b0(a, false, c);
                        d.isDuringManipulation = b;
                        this.plotAreaMouseEnter(this, d);
                    }
                }
                else {
                    this.es = true;
                    if (this.plotAreaMouseOver != null) {
                        let e = this.b0(a, false, c);
                        e.isDuringManipulation = b;
                        this.plotAreaMouseOver(this, e);
                    }
                }
            }
            else {
                if (this.es) {
                    this.es = false;
                    if (this.plotAreaMouseLeave != null) {
                        let f = this.b0(a, false, c);
                        f.isDuringManipulation = b;
                        this.plotAreaMouseLeave(this, f);
                    }
                }
            }
        }
        get a7() {
            return this.a5;
        }
        set a7(a) {
            let b = this.a5;
            this.a5 = a;
            if (b != this.a5) {
                this.sr("ContentHitTestMode", enumGetBox(ChartHitTestMode_$type, b), enumGetBox(ChartHitTestMode_$type, this.a5));
            }
        }
        s3() {
            this.a6 = this.a8();
        }
        a8() {
            if (!this.f3) {
                return 1;
            }
            return this.bq.f$a(this);
        }
        get a6() {
            return this.a4;
        }
        set a6(a) {
            let b = this.a4;
            this.a4 = a;
            if (b != this.a4) {
                this.sr("ActualContentHitTestMode", enumGetBox(ChartHitTestMode_$type, b), enumGetBox(ChartHitTestMode_$type, this.a4));
            }
        }
        queueForAnimationIdle(a, b) {
            this.eg.j(a, b);
        }
        getAnimationIdleVersionNumber() {
            return this.eg.f();
        }
        isAnimationActive() {
            for (let a = 0; a < this.b9.count; a++) {
                if (this.b9._inner[a].d4()) {
                    return true;
                }
            }
            if (this.dy.f()) {
                return true;
            }
            return false;
        }
        rj(a) {
            this.rr();
        }
        qw() {
            this.rr();
        }
        rr() {
            if (!this.isAnimationActive()) {
                this.eg.h();
            }
        }
        st(a) {
            if (this.seriesAnimating != null) {
                this.seriesAnimating(a);
            }
        }
        gf() {
            return this.gg() || this.gh();
        }
        onDetachedFromUI() {
            this.ep = true;
            this.dw.c5();
            SyncManager.e(this);
        }
        onAttachedToUI() {
            this.ep = false;
            this.dw.cz();
            SyncManager.c(this);
        }
        get dm() {
            return this.dh;
        }
        set dm(a) {
            if (this.dm != a) {
                let b = this.dh;
                this.dh = a;
                if (this.f3) {
                    this.bq.f$aj(this);
                }
                if (b == 1 && this.dh != 1) {
                    this.qc();
                }
                if (b == 3 && this.dh != 3) {
                    this.gr(Rect.empty);
                }
            }
        }
        q6(a) {
            this.oz(this.yl(a));
        }
        q7(a, b) {
            let c = false;
            c = false;
            this.oz({ $type: Point_$type, x: NaN, y: NaN });
            if (this.es) {
                this.es = false;
                if (this.plotAreaMouseLeave != null) {
                    let d = this.b0(a, false, c);
                    d.isDuringManipulation = b;
                    this.plotAreaMouseLeave(this, d);
                }
            }
        }
        gt(a, b) {
            return this.bq.f$h(this, a, b);
        }
        qp(a) {
            this.bq.f$r(this, a);
        }
        gs(a) {
            return this.bq.f$g(this, a);
        }
        get e9() {
            return this.ek;
        }
        set e9(a) {
            this.ek = a;
        }
        get_f4() {
            return this.fd || this.hc();
        }
        get f4() {
            return this.get_f4();
        }
        qr(a) {
            this.bq.f$t(this, a);
        }
        get fi() {
            return this.ek;
        }
        rb(a) {
            this.bq.f$ah(this, a);
        }
        qs(a, b) {
            this.bq.f$u(this, a, b);
        }
        qq(a) {
            this.bq.f$s(this, a);
        }
        get gu() {
            return this.ex;
        }
        set gu(a) {
            this.ex = a;
        }
        r2(a) {
            this.bq.f$ao(this, a);
        }
        ra(a) {
            this.bq.f$ag(this, a);
        }
        r3(a, b, c, d) {
            this.bq.f$ap(this, a, b, c, d);
        }
        q9(a) {
            this.bq.f$af(this, a);
        }
        rz(a, b, c, d) {
            this.bq.f$al(this, a, b, c, d);
        }
        q5(a) {
            this.bq.f$ac(this, a);
        }
        q8(a) {
            this.bq.f$ae(this, a);
        }
        qv(a) {
            this.bq.f$v(this, a);
        }
        ry(a, b, c, d) {
            this.bq.f$ak(this, a, b, c, d);
        }
        rt() {
            this.ev = false;
        }
        qy(a) {
            this.dw.em(a.height);
        }
        pk() {
            if (this.ek) {
                this.oz({ $type: Point_$type, x: NaN, y: NaN });
                this.dw.ck();
            }
            this.ek = false;
        }
        qi(a, b) {
            this.bq.f$q(this, a, b);
        }
        dk(a) {
            let b = this.dw.k != null && this.dw.k.al ? this.dl : this.di;
            if (b != 4) {
                return b;
            }
            return this.dw.m(a);
        }
        r1(a, b) {
            this.e2 = false;
            if (!this.e3) {
                this.oz({ $type: Point_$type, x: NaN, y: NaN });
                if (a) {
                    this.e3 = true;
                    this.ev = true;
                    if (this.fk) {
                        this.bq.f$y(this, b);
                    }
                    if (this.viewerManipulationStarting != null) {
                        let c = new SeriesViewerManipulationEventArgs();
                        c.isZoomPan = true;
                        this.viewerManipulationStarting(this, c);
                    }
                }
            }
            this.bq.f$an(this);
        }
        r0() {
            if (this.e3) {
                this.e3 = false;
                if (this.viewerManipulationEnding != null) {
                    let a = new SeriesViewerManipulationEventArgs();
                    a.isZoomPan = true;
                    this.viewerManipulationEnding(this, a);
                }
            }
            this.bq.f$am(this);
        }
        tw() {
            this.bq.f$av(this);
        }
        o4() {
            if (this.e2) {
                this.qm();
            }
            this.bq.f$n(this);
        }
        oy() {
            this.ox();
        }
        ox() {
            if (this.f3) {
                this.bq.f$k(this);
            }
        }
        r5() {
        }
        o3(a, b, c, d, e) {
        }
        f7(a) {
            return false;
        }
        s7() {
        }
        s5() {
            for (let a = 0; a < this.b9.count; a++) {
                this.b9._inner[a].r8(false);
            }
            this.pf(false, false, true);
        }
        qh(a, b) {
            this.bq.f$p(this, a, b);
        }
        g0() {
            return false;
        }
        get g6() {
            return this.ey;
        }
        set g6(a) {
            this.ey = a;
        }
        qg(a, b, c) {
            this.bq.f$o(this, a, b, c);
        }
        t8(a, b) {
            if (b.propertyName == SyncSettings.$$p[0]) {
                SyncManager.b(this, b.oldValue, b.newValue);
            }
        }
        t7(a, b) {
            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);
            }
            for (let c of fromEnum(this.b9)) {
                c.c4 = this.actualSyncLink;
                c.dc = this;
            }
        }
        oz(a) {
            if (this.fa) {
                this.br.onCrosshairMoved(this.yj(a));
            }
            this.actualSyncLink.an(this, a);
        }
        ud(a, b) {
            this.ue(a, b, !b);
        }
        ue(a, b, c) {
            if (!b) {
                this.actualSyncLink.au(this, a, c);
            }
            else {
                if (!this.gg() && !this.gh()) {
                    return;
                }
                let d = !a.isEmpty && !isNaN_(a.x) && !isNaN_(a.y) && !isNaN_(a.width) && !isNaN_(a.height);
                let e = a;
                if (d && !this.g2) {
                    if (e.width < this.io) {
                        return;
                    }
                    else if (e.height < this.im) {
                        return;
                    }
                }
                if (d && !this.gg()) {
                    e = new Rect(0, 0, a.y, 1, a.height);
                }
                if (d && !this.gh()) {
                    e = new Rect(0, a.x, 0, a.width, 1);
                }
                this.actualSyncLink.at(this, e);
            }
        }
        r6(a, b) {
            if (!b) {
                this.actualSyncLink.ap(this, a);
            }
            else {
                if (!this.gg() && !this.gh()) {
                    return;
                }
                let c = !a.isEmpty && !isNaN_(a.x) && !isNaN_(a.y) && !isNaN_(a.width) && !isNaN_(a.height);
                let d = a;
                if (c && !this.gg()) {
                    d = new Rect(0, 0, a.y, 1, a.height);
                }
                if (c && !this.gh()) {
                    d = new Rect(0, a.x, 0, a.width, 1);
                }
                this.actualSyncLink.ap(this, d);
            }
        }
        get ga() {
            return this.actualSyncLink != null;
        }
        *_hl() {
            if (this.actualSyncLink == null) {
                return undefined;
            }
            for (let a of fromEnum(this.actualSyncLink.ai)) {
                yield a;
            }
        }
        hl() {
            return toEnum(() => this._hl());
        }
        yl(a) {
            a = { $type: Point_$type, x: a.x + this.y9.left, y: a.y + this.y9.top };
            let b = this.yu;
            let c = ViewportUtils.b(a.x, this.yr, this.y9, this.yv);
            let d = ViewportUtils.g(a.y, this.yr, this.y9, this.yv);
            return { $type: Point_$type, x: c, y: d };
        }
        yj(a) {
            let b = this.yu;
            let c = ViewportUtils.e(a.x, this.yr, this.y9, this.yv);
            let d = ViewportUtils.i(a.y, this.yr, this.y9, this.yv);
            return { $type: Point_$type, x: c, y: d };
        }
        y8(a) {
            if (a.isEmpty) {
                return Rect.empty;
            }
            let b = this.yl({ $type: Point_$type, x: a.left, y: a.top });
            let c = this.yl({ $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);
        }
        yw(a) {
            let b = this.yj({ $type: Point_$type, x: a.left, y: a.top });
            let c = this.yj({ $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);
        }
        s2(a, b) {
            if (this.windowRectChanged != null && Rect.l_op_Inequality(a, b)) {
                this.windowRectChanged(this, new RectChangedEventArgs(a, b));
            }
        }
        rx(a, b) {
            this.s2(a, b);
        }
        rs(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)));
            }
            this.qe(b);
        }
        gw(a, b) {
            if (a.width != b.width || a.height != b.height || a.x != b.x || a.y != b.y) {
                return true;
            }
            return false;
        }
        sc(a, b) {
            if (this.actualWindowRectChanged != null && this.gw(a, b)) {
                this.actualWindowRectChanged(this, new RectChangedEventArgs(a, b));
            }
        }
        uf(a) {
            if (isNaN_(a) || isInfinity(a)) {
                a = 0.05;
            }
            let b = this.iu() - a;
            let c = this.iu() - a;
            let d = this.ik + (a / 2);
            let e = this.il + (a / 2);
            this.za = new Rect(0, d, e, b, c);
        }
        ug(a) {
            this.uf(a * -1);
        }
        te() {
            this.dw.d5();
        }
        sp(a, b) {
            if (this.gridAreaRectChanged != null && Rect.l_op_Inequality(a, b)) {
                this.gridAreaRectChanged(this, new RectChangedEventArgs(a, b));
            }
        }
        get_f6() {
            return false;
        }
        get f6() {
            return this.get_f6();
        }
        re(a, b) {
            this.sp(a, b);
            if (this.f3) {
                this.bq.f$ar(this);
            }
            if (this.f6 && (Rect.l_op_Equality(a, null) || a.isEmpty || a.width == 0 || a.height == 0)) {
                this.ud(this.za, false);
            }
            else {
                this.pp();
            }
            if (a.isEmpty || a.width == 0 || a.height == 0) {
                this.p0();
            }
        }
        pt() {
            this.pp();
        }
        get io() {
            return this.h0;
        }
        set io(a) {
            let b = this.h0;
            this.h0 = a;
            this.sr("ActualWindowRectMinWidth", b, this.h0);
        }
        get im() {
            return this.hz;
        }
        set im(a) {
            let b = this.hz;
            this.hz = a;
            this.sr("ActualWindowRectMinHeight", b, this.hz);
        }
        get syncChannel() {
            return this._syncChannel;
        }
        set syncChannel(a) {
            this._syncChannel = a;
        }
        get actualSyncLink() {
            return this.c4;
        }
        set actualSyncLink(a) {
            let b = this.c4;
            this.c4 = a;
            this.sr("ActualSyncLink", b, this.c4);
        }
        pr() {
            this.dw.d6();
        }
        qn() {
            this.e2 = true;
        }
        ql() {
            this.e2 = false;
        }
        qm() {
            if (this.e2) {
                if (this.e3) {
                    this.e3 = false;
                    if (!this.em) {
                        if (this.viewerManipulationEnding != null) {
                            let a = new SeriesViewerManipulationEventArgs();
                            a.isZoomPan = true;
                            this.viewerManipulationEnding(this, a);
                        }
                        this.ev = false;
                    }
                }
            }
        }
        get dp() {
            return this.dw.i().a;
        }
        t4(a) {
            if (this.dp != null) {
                this.dp.mobileMode = a;
            }
        }
        get db() {
            return this.da;
        }
        set db(a) {
            this.da = a;
        }
        dc() {
            if (this.dd == 0) {
                return 1;
            }
            return this.dd;
        }
        fe() {
            return this.dm == 0 && !this.ex && !this.ey;
        }
        e6() {
            if (this.actualSyncLink != null && this.actualSyncLink.ai.count > 0) {
                let a = true;
                a = this.fe();
                if (!a) {
                    return false;
                }
                for (let b = 0; b < this.actualSyncLink.ai.count; b++) {
                    if (!this.actualSyncLink.ai.item(b).fe()) {
                        return false;
                    }
                }
                return true;
            }
            else {
                return this.fe();
            }
        }
        os() {
            if (this.dm == 2) {
                this.dw.bw();
                this.dm = 0;
                this.r0();
                this.r6(Rect.empty, true);
                if (this.c9 == 1) {
                    this.ud(this.zb, true);
                }
            }
            if (this.dm == 1 || this.dm == 3) {
                this.dw.bw();
                this.dm = 0;
                this.r0();
                this.dw.ci();
                this.r6(Rect.empty, true);
            }
        }
        notifyCrosshairUpdate() {
        }
        ua(a, b) {
            let c = this.io;
            let d = this.im;
            this.za = new Rect(0, this.ik, this.il, MathUtil.e(a, c, 1), MathUtil.e(b, d, 1));
        }
        ub(a, b, c, d) {
            if (!MathUtil.b(a) || a < 0 || a >= 1) {
                a = this.ik;
            }
            if (!MathUtil.b(b) || b < 0 || b >= 1) {
                b = this.il;
            }
            if (!MathUtil.b(d)) {
                d = this.iv();
            }
            if (!MathUtil.b(c)) {
                c = this.iu();
            }
            this.za = new Rect(0, a, b, MathUtil.e(c, this.io, 1), MathUtil.e(d, this.im, 1));
        }
        iu() {
            return 1;
        }
        iv() {
            return 1;
        }
        jb() {
            if (this.jw > 0) {
                return this.jw;
            }
            let a = Rect.l_op_Inequality(this.y9, null) && !this.y9.isEmpty && MathUtil.b(this.y9.width);
            let b = MathUtil.b(this.jy);
            if (b && a) {
                let c = this.jy / this.y9.width;
                if (c <= 0 || c >= 1) {
                    c = 0.0001;
                }
                return c;
            }
            return 0.0001;
        }
        ja() {
            if (this.jv > 0) {
                return this.jv;
            }
            let a = Rect.l_op_Inequality(this.y9, null) && !this.y9.isEmpty && MathUtil.b(this.y9.height);
            let b = MathUtil.b(this.jx);
            if (b && a) {
                let c = this.jx / this.y9.height;
                if (c <= 0 || c >= 1) {
                    c = 0.0001;
                }
                return c;
            }
            return 0.0001;
        }
        r8(a, b, c, d) {
            switch (b) {
                case SeriesViewer.$$p[49]:
                    this.dw.dm();
                    break;
                case SeriesViewer.$$p[46]:
                    this.dw.dm();
                    break;
                case SeriesViewer.$$p[61]:
                    this.db = this.dc();
                    break;
                case "HorizontalViewScrollbarMode":
                    this.cx = this.cz;
                    if (this.fc || this.f3) {
                        this.br.onHorizontalScrollbarModeChanged(this.cx);
                    }
                    break;
                case "VerticalViewScrollbarMode":
                    this.cy = this.c0;
                    if (this.fc || this.f3) {
                        this.br.onVerticalScrollbarModeChanged(this.cy);
                    }
                    break;
                case "ActualContentHitTestMode":
                    this.p8();
                    break;
                case "ContentHitTestMode":
                    this.s3();
                    break;
                case SeriesViewer.$$p[48]:
                    this.dw.dk(c, d);
                    this.dw.dm();
                    break;
                case SeriesViewer.$$p[45]:
                    this.dw.dg(c, d);
                    this.dw.dm();
                    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.dw.dm();
                    break;
                case SeriesViewer.$$p[31]:
                case SeriesViewer.$$p[32]:
                case SeriesViewer.$$p[33]:
                    this.dw.de();
                    break;
                case "PixelScalingRatio":
                    if (isNaN_(DeviceUtils.a(this.i8))) {
                        this.po();
                    }
                    else {
                        this.ij = DeviceUtils.a(this.i8);
                    }
                    break;
                case "InteractionPixelScalingRatio":
                    this.ii = this.i6;
                    break;
                case "ActualPixelScalingRatio":
                    this.dw.dt();
                    break;
                case SeriesViewer.$$p[17]:
                    this.dw.cs();
                    break;
                case "ActualSyncLink":
                    this.t7(typeCast(SyncLink.$, c), typeCast(SyncLink.$, d));
                    break;
                case SeriesViewer.$$p[3]:
                    if (!this.fq) {
                        this.hd = true;
                    }
                    if (this.ze == 0) {
                        this.ff = true;
                    }
                    else {
                        this.ff = this.e4;
                    }
                    if (this.f3) {
                        this.bq.f$ar(this);
                    }
                    break;
                case "CrosshairPoint":
                    if (this.f3) {
                        if (this.gq) {
                            this.t3(this.yi);
                        }
                        this.bq.f$ar(this);
                    }
                    this.notifyCrosshairUpdate();
                    break;
                case SeriesViewer.$$p[57]:
                    if (this.actualSyncLink != null) {
                        this.j3++;
                        this.ud(d, false);
                        this.j3--;
                    }
                    if (!this.za.equals1(c) && this.j3 == 0) {
                        this.rx(c, this.za);
                    }
                    this.pp();
                    break;
                case SeriesViewer.$$p[53]:
                    this.ik = this.jt;
                    break;
                case SeriesViewer.$$p[54]:
                    this.il = this.ju;
                    break;
                case "ActualWindowPositionVertical":
                case "ActualWindowPositionHorizontal":
                    if (!this.g8) {
                        this.ua(this.iu(), this.iv());
                    }
                    break;
                case SeriesViewer.$$p[56]:
                case SeriesViewer.$$p[60]:
                    this.io = this.jb();
                    break;
                case SeriesViewer.$$p[55]:
                case SeriesViewer.$$p[59]:
                    this.im = this.ja();
                    break;
                case SeriesViewer.$$p[18]:
                    this.dw.c8();
                    break;
                case SeriesViewer.$$p[14]:
                    this.dy.r = this.ka;
                    break;
                case SeriesViewer.$$p[41]:
                    this.d0.r = this.ke;
                    break;
                case SeriesViewer.$$p[9]:
                    this.dx.r = this.j7;
                    break;
                case SeriesViewer.$$p[39]:
                    if (this.f3) {
                        let e = this.d8;
                        e.dismissHighlightDelay = this.kd;
                    }
                    break;
                case SeriesViewer.$$p[13]:
                    if (this.f3) {
                        let f = this.d7;
                        f.dismissHighlightDelay = this.j9;
                    }
                    break;
                case SeriesViewer.$$p[8]:
                    if (this.f3) {
                        let g = this.d6;
                        g.dismissHighlightDelay = this.j6;
                    }
                    break;
                case SeriesViewer.$$p[24]:
                    this.t6();
                    break;
                case "ActualWindowRect":
                    this.ej = true;
                    if (this.gw(c, d)) {
                        this.ok(c, d);
                    }
                    if (d.width == 1 && d.height == 1 && c.isEmpty) {
                        this.hg = true;
                    }
                    this.sc(c, d);
                    break;
                case SeriesViewer.$$p[28]:
                    this.dw.dd(d);
                    break;
                case SeriesViewer.$$p[51]:
                    this.e5 = this.he;
                    break;
                case SeriesViewer.$$p[62]:
                    this.j4 = this.kf;
                    this.ox();
                    break;
                case SeriesViewer.$$p[30]:
                    this.bq.f$ai(this);
                    break;
                case "HighlightingMode":
                case "HighlightingBehavior":
                    this.cc = this.cf();
                    if (this.f3) {
                        let h = this.d7;
                        h.retainMainShapes = this.cd == 3;
                        h.isExclusiveHighlight = this.cd == 1;
                    }
                    break;
                case "SelectionMode":
                    this.cp = this.cs();
                    if (this.cp == 1 && this.selectedSeriesItems.count > 0) {
                        this.selectedSeriesItems.clear();
                    }
                    if (this.f3) {
                        let i = this.d8;
                    }
                    break;
                case "SelectionBehavior":
                    this.cl = this.cn();
                    if (this.f3) {
                        let j = this.d8;
                    }
                    break;
                case "LegendItemBadgeShape":
                    for (let k of fromEnum(this.b9)) {
                        k.legendItemBadgeShape = this.bu;
                    }
                    break;
                case "LegendItemBadgeMode":
                    for (let l of fromEnum(this.b9)) {
                        l.be = this.bt;
                    }
                    break;
                case SeriesViewer.$$p[1]:
                case SeriesViewer.$$p[23]:
                case SeriesViewer.$$p[21]:
                case SeriesViewer.$$p[22]:
                case SeriesViewer.$$p[20]:
                    for (let m of fromEnum(this.b9)) {
                        m.qv();
                    }
                    break;
                case "HorizontalViewScrollbarCornerRadius":
                case "HorizontalViewScrollbarFill":
                case "HorizontalViewScrollbarMaxOpacity":
                case "HorizontalViewScrollbarOutline":
                case "HorizontalViewScrollbarStrokeThickness":
                case "VerticalViewScrollbarCornerRadius":
                case "VerticalViewScrollbarFill":
                case "VerticalViewScrollbarMaxOpacity":
                case "VerticalViewScrollbarOutline":
                case "VerticalViewScrollbarStrokeThickness":
                    if (this.f3) {
                        this.br.updateBarAppearance(this, this.x5, this.yf, this.x6, this.yg, this.i3, this.jp, this.i2, this.jo);
                    }
                    break;
                case "HorizontalViewScrollbarHeight":
                case "HorizontalViewScrollbarInset":
                case SeriesViewer.lu:
                case "HorizontalViewScrollbarTrackStartInset":
                case "HorizontalViewScrollbarTrackEndInset":
                    if (this.f3) {
                        this.br.updateBarDimensions(this, this.i0, this.iz, this.i1, this.fo, this.i5, this.i4, this.js, this.jm, this.jn, this.hf, this.jr, this.jq);
                    }
                    break;
                case "VerticalViewScrollbarPosition":
                    if (this.f3) {
                        this.br.updateVerticalScrollbarPosition(this.c3);
                    }
                    break;
                case "HorizontalViewScrollbarPosition":
                    if (this.f3) {
                        this.br.updateHorizontalScrollbarPosition(this.cw);
                    }
                    break;
            }
            if (this.gc && this.bn != null) {
                this.bo.onTargetPropertyChanged(this, b, c, d);
            }
        }
        get fy() {
            return this.cd == 2 || this.cd == 3 || this.cd == 4;
        }
        get gq() {
            return this.cd == 2 || this.cd == 3 || this.cd == 4;
        }
        t3(a) {
            let b = 1.7976931348623157E+308;
            let c = null;
            for (let d = 0; d < this.b9.count; d++) {
                let e = this.b9._inner[d];
                if (e.ev) {
                    continue;
                }
                if (e.ef && e.el) {
                    continue;
                }
                if (e.isStacked) {
                    e.qh((f) => {
                        let g = this.oi(f, b, c, a);
                        if (g == null) {
                            return true;
                        }
                        b = g.c;
                        c = g.d;
                        if (f.ei) {
                            f.qf((h) => {
                                let i = this.oi(h, b, c, a);
                                if (i == null) {
                                    return true;
                                }
                                b = i.c;
                                c = i.d;
                                return true;
                            });
                        }
                        return true;
                    });
                }
                if (e.ei) {
                    e.qf((f) => {
                        let g = this.oi(f, b, c, a);
                        if (g == null) {
                            return true;
                        }
                        b = g.c;
                        c = g.d;
                        return true;
                    });
                }
                let f = this.oi(e, b, c, a);
                if (f == null) {
                    continue;
                }
                b = f.c;
                c = f.d;
            }
            this.b5 = c;
        }
        oi(a, b, c, d) {
            let e = a.wr(d);
            let f = a.ww(d, true, true);
            if (isNaN_(f.x) || isNaN_(f.y)) {
                return null;
            }
            let 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);
        }
        t6() {
            this.e1 = this.zf == 0;
            this.dw.ds();
            this.t5();
            this.dw.ep();
            this.pr();
            this.p6();
        }
        p8() {
            this.dw.cy();
        }
        t5() {
            if (this.dp == null) {
                return;
            }
            this.dp.visibility = this.zf;
            this.dp.isZoomable = this.gf();
        }
        get y2() {
            return this.yp;
        }
        set y2(a) {
            let b = this.yp;
            this.yp = a;
            if (this.yp.isEmpty) {
                this.dw.cm();
            }
            else {
                this.dw.eq(this.y9, this.y5(this.y2));
                this.dw.ef();
                this.sr("PreviewRect", b, this.yp);
            }
        }
        get selectedSeriesItems() {
            return this._selectedSeriesItems;
        }
        set selectedSeriesItems(a) {
            this._selectedSeriesItems = a;
        }
        get focusedSeriesItems() {
            return this._focusedSeriesItems;
        }
        set focusedSeriesItems(a) {
            this._focusedSeriesItems = a;
        }
        rg(a, b) {
            if (this.selectedSeriesItemsChanged != null) {
                this.selectedSeriesItemsChanged(a, b);
            }
        }
        qt(a, b) {
            if (this.focusedSeriesItemsChanged != null) {
                this.focusedSeriesItemsChanged(a, b);
            }
        }
        ty() {
            this.ik = this.yr.x;
            this.il = this.yr.y;
        }
        ok(a, b) {
            this.hg = false;
            this.hu = dateNow();
            if (this.fx) {
                for (let c = 0; c < this.b9.count; c++) {
                    this.b9._inner[c].pg();
                }
                this.d7.clear();
            }
            if (this.dy.f()) {
                this.dy.w();
            }
            let d = this.g8;
            this.g8 = true;
            this.ty();
            this.g8 = d;
            this.dw.cn();
            this.dw.es(this.yr);
            if (this.fa) {
                this.br.updateScrollbars(this, a, this.yr, this.y9, this.y9);
            }
            this.p9(a, b);
        }
        gx() {
            return this.cq != 1;
        }
        p9(a, b) {
        }
        y5(a) {
            if (this.y9.isEmpty) {
                return Rect.empty;
            }
            let b = this.y9;
            let c = b.left + (b.width * (a.left - this.yr.left) / this.yr.width);
            let d = b.top + (b.height * (a.top - this.yr.top) / this.yr.height);
            let e = b.left + (b.width * (a.right - this.yr.left) / this.yr.width);
            let f = b.top + (b.height * (a.bottom - this.yr.top) / this.yr.height);
            return new Rect(0, c, d, e - c, f - d);
        }
        ss() {
            if (this.refreshCompleted != null && !this.destroyed) {
                this.refreshCompleted(this, new RefreshCompletedEventArgs());
            }
        }
        rw(a) {
            this.t5();
        }
        get np() {
            return this.km;
        }
        set np(a) {
            let b = this.km;
            this.km = a;
            this.sr("TitleTextStyle", b, a);
        }
        get nd() {
            return this.kl;
        }
        set nd(a) {
            let b = this.kl;
            this.kl = a;
            this.sr("SubtitleTextStyle", b, a);
        }
        get yd() {
            return this.xs;
        }
        set yd(a) {
            let b = this.xs;
            this.xs = a;
            this.sr("TitleTextColor", b, a);
        }
        get yc() {
            return this.xr;
        }
        set yc(a) {
            let b = this.xr;
            this.xr = a;
            this.sr("SubtitleTextColor", b, a);
        }
        get jk() {
            return this.ig;
        }
        set jk(a) {
            let b = this.ig;
            this.ig = a;
            this.sr("TitleTopMargin", b, a);
        }
        get ji() {
            return this.id;
        }
        set ji(a) {
            let b = this.id;
            this.id = a;
            this.sr("TitleLeftMargin", b, a);
        }
        get jj() {
            return this.ie;
        }
        set jj(a) {
            let b = this.ie;
            this.ie = a;
            this.sr("TitleRightMargin", b, a);
        }
        get jh() {
            return this.ic;
        }
        set jh(a) {
            let b = this.ic;
            this.ic = a;
            this.sr("TitleBottomMargin", b, a);
        }
        get jg() {
            return this.ib;
        }
        set jg(a) {
            let b = this.ib;
            this.ib = a;
            this.sr("SubtitleTopMargin", b, a);
        }
        get je() {
            return this.h9;
        }
        set je(a) {
            let b = this.h9;
            this.h9 = a;
            this.sr("SubtitleLeftMargin", b, a);
        }
        get jf() {
            return this.ia;
        }
        set jf(a) {
            let b = this.ia;
            this.ia = a;
            this.sr("SubtitleRightMargin", b, a);
        }
        get jd() {
            return this.h8;
        }
        set jd(a) {
            let b = this.h8;
            this.h8 = a;
            this.sr("SubtitleBottomMargin", b, a);
        }
        zc() {
            return this.dw.fm();
        }
        zd() {
            return this.dw.fn();
        }
        a1(a) {
            return this.dw.c(a);
        }
        a2(a) {
            return this.dw.d(a);
        }
        getFontHeight() {
            return this.dw.bc;
        }
        get_gp() {
            return false;
        }
        get gp() {
            return this.get_gp();
        }
        qk() {
        }
        provideContainer(a) {
            this.dw.c3(a);
        }
        qj(a, b) {
            this.dw.c4(a, b);
        }
        notifyContainerResized() {
            this.dw.cx();
        }
        yx() {
            return this.dw.fe();
        }
        o5() {
            this.dw.b8();
        }
        yk() {
            return this.dw.fb();
        }
        d2() {
            return this.dw.t();
        }
        d1() {
            return this.dw.q();
        }
        xy() {
            return this.dw.e3();
        }
        xz() {
            return this.dw.e6();
        }
        on(a) {
            this.dw.bs(a);
        }
        s9(a) {
            this.dw.d1(a);
        }
        get gm() {
            return this.ew;
        }
        set gm(a) {
            let b = this.ew;
            this.ew = a;
            if (b != this.ew) {
                this.dw.cu(this.ew);
            }
        }
        get e4() {
            return this.ei;
        }
        set e4(a) {
            let b = this.ei;
            this.ei = a;
            if (b != this.ei) {
                this.dw.bn(this.ei);
            }
        }
        get syncSettings() {
            return this._syncSettings;
        }
        set syncSettings(a) {
            this._syncSettings = a;
        }
        om(a) {
            this.dw.bq(a);
        }
        tb(a) {
            this.dw.d2(a);
        }
        p5(source_, a, b, c) {
            if (source_.dataView && source_.dataSource) {
                source_ = source_.dataView();
            }
            ;
            let d = this.actualSyncLink.ag(source_);
            if (d == null) {
                return;
            }
            d.handleCollectionChanged(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
        }
        pw(source_) {
            if (source_.dataView && source_.dataSource) {
                source_ = source_.dataView();
            }
            ;
            let a = this.actualSyncLink.ag(source_);
            if (a == null) {
                return;
            }
            a.handleCollectionChanged(new NotifyCollectionChangedEventArgs(0, 4));
        }
        p3(source_, a, b) {
            if (source_.dataView && source_.dataSource) {
                source_ = source_.dataView();
            }
            ;
            let c = this.actualSyncLink.ag(source_);
            if (c == null) {
                return;
            }
            c.handleCollectionChanged(new NotifyCollectionChangedEventArgs(1, 0, b, a));
        }
        p4(source_, a, b) {
            if (source_.dataView && source_.dataSource) {
                source_ = source_.dataView();
            }
            ;
            let c = this.actualSyncLink.ag(source_);
            if (c == null) {
                return;
            }
            c.handleCollectionChanged(new NotifyCollectionChangedEventArgs(1, 1, b, a));
        }
        destroy() {
            this.destroyed = true;
            let a = new List$1(Series.$, 0);
            for (let b = 0; b < this.series.count; b++) {
                a.add(this.series._inner[b]);
            }
            for (let c = 0; c < a.count; c++) {
                if (a._inner[c].cw != null) {
                    a._inner[c].cw.as();
                }
                this.series.remove(a._inner[c]);
                this.ta(a._inner[c].name, true);
                a._inner[c].itemsSource = null;
                a._inner[c].rr(null, null);
            }
            this.o2();
            this.tc();
            this.onDetachedFromUI();
            this.dw.c3(null);
        }
        o2() {
        }
        tn(source_) {
            if (source_.dataView && source_.dataSource) {
                source_ = source_.dataView();
            }
            ;
            this.kg = source_;
            this.t2();
        }
        tc() {
            this.kg = null;
            this.t2();
        }
        tl(a, source_) {
            if (source_.dataView && source_.dataSource) {
                source_ = source_.dataView();
            }
            ;
            if (stringIsNullOrEmpty(a) == false) {
                if (!this.hh.containsKey(a)) {
                    this.hh.addItem(a, source_);
                }
                else {
                    this.hh.item(a, source_);
                }
            }
            this.t2();
        }
        ta(a, b) {
            if (stringIsNullOrEmpty(a) == false) {
                if (this.hh.containsKey(a)) {
                    this.hh.removeItem(a);
                }
            }
            if (!b) {
                this.t2();
            }
        }
        tk(a, b) {
            if (a.itemsSource != b) {
                a.itemsSource = b;
            }
        }
        t1(a) {
            if (!this.gj) {
                return;
            }
            if (typeCast(Series.$, a) !== null) {
                let b = a;
                if (this.hh.containsKey(b.name)) {
                    let c = this.hh.item(b.name);
                    this.tk(b, c);
                }
                else {
                    this.tk(b, this.kg);
                }
            }
            if (typeCast(CategoryAxisBase.$, a) !== null) {
                let d = a;
                if (this.hh.containsKey(d.name)) {
                    let e = this.hh.item(d.name);
                    if (d.itemsSource != e) {
                        d.itemsSource = e;
                    }
                }
                else {
                    if (d.itemsSource != this.kg) {
                        d.itemsSource = this.kg;
                    }
                }
            }
        }
        t2() {
            if (!this.gj) {
                return;
            }
            for (let a of fromEnum(this.b9)) {
                this.t1(a);
            }
        }
        get jl() {
            return this.ih;
        }
        set jl(a) {
            this.ih = a;
            this.pr();
        }
        get i7() {
            return this.h5;
        }
        set i7(a) {
            this.h5 = a;
            this.pr();
        }
        get jc() {
            return this.h7;
        }
        set jc(a) {
            this.h7 = a;
            this.pr();
        }
        get ir() {
            return this.h3;
        }
        set ir(a) {
            this.h3 = a;
            this.pr();
        }
        get iq() {
            return this.h2;
        }
        set iq(a) {
            this.h2 = a;
            this.pr();
        }
        get ip() {
            return this.h1;
        }
        set ip(a) {
            this.h1 = a;
            this.pr();
        }
        gz() {
            return false;
        }
        get fu() {
            return this.eo;
        }
        set fu(a) {
            let b = this.eo;
            this.eo = a;
            this.sr("IsAntiAliasingEnabledDuringInteraction", b, this.eo);
        }
        get i8() {
            return this.h6;
        }
        set i8(a) {
            let b = this.h6;
            this.h6 = a;
            this.sr("PixelScalingRatio", b, this.h6);
        }
        get i6() {
            return this.h4;
        }
        set i6(a) {
            let b = this.h4;
            this.h4 = a;
            this.sr("InteractionPixelScalingRatio", b, this.h4);
        }
        static de(a, b) {
            let c = new CoercionInfo();
            c.b = a;
            c.a = null;
            let d = FastItemsSource.f(a);
            if (d.d == null) {
                return c;
            }
            if (b != null) {
                let methods_ = b;
                let key_ = d.d;
                let val_ = null;
                if (typeof methods_[key_] != 'undefined') {
                    val_ = methods_[key_];
                }
                ;
                c.b = d.c;
                c.a = val_;
            }
            else if (d.d == "defaultDateParse") {
                let e = defaultDVDateParse;
                c.b = d.c;
                c.a = e;
            }
            return c;
        }
        get md() {
            return this.kk;
        }
        set md(a) {
            this.kk = a;
            if (this.dp == null) {
                return;
            }
            this.dp.backgroundImageUri = this.kk;
        }
        get ij() {
            return this.hw;
        }
        set ij(a) {
            let b = this.hw;
            this.hw = a;
            this.sr("ActualPixelScalingRatio", b, this.hw);
        }
        get ii() {
            return this.hv;
        }
        set ii(a) {
            let b = this.hv;
            this.hv = a;
            this.sr("ActualInteractionPixelScalingRatio", b, this.hv);
        }
        get yr() {
            return this.ym;
        }
        set yr(a) {
            let b = Rect.l_op_Inequality(this.ym, a);
            if (b) {
                let c = this.ym;
                this.ym = a;
                this.sr("ActualWindowRect", c, a);
            }
        }
        yy() {
            return this.yr;
        }
        pp() {
            if (this.fp) {
                return;
            }
            this.yr = this.ys();
        }
        y3() {
            return Rect.empty;
        }
        ys() {
            let a = this.za.left;
            let b = this.za.top;
            let c = this.za.width;
            let d = this.za.height;
            if (this.db == 1) {
                a = Math.min(1, Math.max(0, this.za.left));
                c = Math.min(1, Math.max(0, this.za.width));
            }
            if (this.db == 1) {
                b = Math.min(1, Math.max(0, this.za.top));
                d = Math.min(1, Math.max(0, this.za.height));
            }
            return new Rect(0, a, b, c, d);
        }
        ki(a, b) {
            return this.dw.bm(a, b, this.ij);
        }
        get ik() {
            return this.hx;
        }
        set ik(a) {
            let b = this.hx;
            this.hx = a;
            this.sr("ActualWindowPositionHorizontal", b, this.hx);
        }
        get il() {
            return this.hy;
        }
        set il(a) {
            let b = this.hy;
            this.hy = a;
            this.sr("ActualWindowPositionVertical", b, this.hy);
        }
        p7() {
            if (this.e1 && this.dp != null) {
                this.dp.surfaceIsDirty = true;
                this.dp.doRefresh(false);
            }
            this.oy();
            this.p1();
        }
        p6() {
            if (this.e1 && this.dp != null) {
                this.dp.surfaceIsDirty = true;
                this.dp.doRefresh(false);
            }
            this.oy();
        }
        flush() {
            this.pf(true, true, true);
        }
        pf(a, b, c) {
            this.a3.y();
            if (a) {
                this.dw.ca();
                this.a3.y();
            }
            for (let d = 0; d < this.b9.count; d++) {
                let e = this.b9._inner[d];
                e.q7();
            }
            if (c) {
                this.al.l();
            }
            if (b) {
                this.dw.a.l();
            }
            this.hg = true;
        }
        hc() {
            return false;
        }
        s6(a, b) {
            if (this.ur != null) {
                this.tx(this.ur);
                this.ur = null;
                this.bc = null;
            }
            this.ur = a;
            this.bc = this.a3.k(2, a, b);
        }
        tx(a) {
            this.a3.ad(2, a);
            this.ur = null;
            this.bc = null;
        }
        o0() {
            this.a3.ac(2, this.ur, this.bc, false);
        }
        qx() {
            let a = false;
            let b = false;
            let c = false;
            for (let d = 0; d < this.b9.count; d++) {
                let e = this.b9._inner[d];
                if (e.e4) {
                    a = true;
                }
                if (e.e5) {
                    b = true;
                }
                if (e.ev) {
                    c = true;
                }
            }
            this.fv = a;
            this.fw = b;
            this.ft = c;
        }
        get gb() {
            return this.e1;
        }
        oo() {
            this.dw.bt();
            for (let a = 0; a < this.b9.count; a++) {
                this.b9._inner[a].q4();
            }
        }
        gi() {
            return this.dw.an();
        }
        j8() {
            let a = this.j2;
            this.j2++;
            return a;
        }
        d5() {
            if (this.np == null || this.dw.j.ae == null) {
                return null;
            }
            return FontUtil.toFontInfo(this.dw.j.ae, this.np);
        }
        d4() {
            if (this.nd == null || this.dw.j.ae == null) {
                return null;
            }
            return FontUtil.toFontInfo(this.dw.j.ae, this.nd);
        }
        t0() {
            let a = false;
            a = this.e4;
            this.fq = true;
            this.ff = (a && !this.hd) || this.ze == 0;
            this.fq = false;
        }
        sw() {
            if (this.seriesDataUpdated != null) {
                this.seriesDataUpdated(this, EventArgs.empty);
            }
        }
        p0() {
            for (let a = 0; a < this.hn.count; a++) {
                this.hn._inner[a].notifySeriesCollectionChanged();
            }
        }
        p1() {
            for (let a = 0; a < this.hn.count; a++) {
                this.hn._inner[a].notifySeriesDataChanged();
            }
            this.notifySeriesDataChanged();
        }
        p2(a) {
            for (let b = 0; b < this.hn.count; b++) {
                this.hn._inner[b].notifyVisualPropertiesChanged(a);
            }
        }
        pz(a) {
            for (let b = 0; b < this.hn.count; b++) {
                this.hn._inner[b].notifyCursorPositionChanged(a);
            }
        }
        attachDataLegend(a) {
            this.hn.add(a);
        }
        detachDataLegend(a) {
            this.hn.remove(a);
        }
        get isDetached() {
            return this.destroyed || this.ep;
        }
        getDataLegendSeries() {
            let a = 0;
            for (let b = 0; b < this.b9.count; b++) {
                if (this.b9._inner[b].isStacked) {
                    this.b9._inner[b].qh((c) => {
                        if (c.isUsableInLegend) {
                            a++;
                        }
                        if (c.ei) {
                            c.qf((d) => {
                                if (d.isUsableInLegend) {
                                    a++;
                                }
                                return true;
                            });
                        }
                        return true;
                    });
                }
                else if (this.b9._inner[b].ei) {
                    if (this.b9._inner[b].isUsableInLegend) {
                        a++;
                    }
                    this.b9._inner[b].qf((c) => {
                        if (c.isUsableInLegend) {
                            a++;
                        }
                        return true;
                    });
                }
                else {
                    if (this.b9._inner[b].isUsableInLegend) {
                        a++;
                    }
                }
            }
            let c = new Array(a);
            let d = 0;
            for (let e = 0; e < this.b9.count; e++) {
                if (this.b9._inner[e].isStacked) {
                    this.b9._inner[e].qh((f) => {
                        if (f.isUsableInLegend) {
                            c[d] = f;
                            d++;
                        }
                        if (f.ei) {
                            f.qf((g) => {
                                if (g.isUsableInLegend) {
                                    c[d] = g;
                                    d++;
                                }
                                return true;
                            });
                        }
                        return true;
                    });
                }
                else if (this.b9._inner[e].ei) {
                    if (this.b9._inner[e].isUsableInLegend) {
                        c[d] = this.b9._inner[e];
                        d++;
                    }
                    this.b9._inner[e].qf((f) => {
                        if (f.isUsableInLegend) {
                            c[d] = f;
                            d++;
                        }
                        return true;
                    });
                }
                else {
                    if (this.b9._inner[e].isUsableInLegend) {
                        c[d] = this.b9._inner[e];
                        d++;
                    }
                }
            }
            return c;
        }
        ol(a) {
            let b = this.y8(a);
            let c = new List$1(ChartSelection.$, 0);
            for (let d of fromEnum(this.b9)) {
                d.qi(b, c, this.cm);
            }
            if (c.count == 0) {
                return;
            }
            c = this.hr(c, this.cm);
            c = this.hs(c, this.cm);
            let e = this.ho(this.selectedSeriesItems, c, this.cm);
            for (let f = 0; f < e.count; f++) {
                this.selectedSeriesItems.remove(e._inner[f]);
            }
            for (let g = 0; g < c.count; g++) {
                this.selectedSeriesItems.add(c._inner[g]);
            }
        }
        y6(a) {
            a = new Rect(0, a.left, a.top, a.width, a.height);
            let b = this.y9;
            let c = this.yr.left + this.yr.width * (a.left - b.left) / b.width;
            let d = this.yr.top + this.yr.height * (a.top - b.top) / b.height;
            let e = this.yr.left + this.yr.width * (a.right - b.left) / b.width;
            let f = this.yr.top + this.yr.height * (a.bottom - b.top) / b.height;
            return new Rect(0, c, d, e - c, f - d);
        }
        y7(a) {
            a = new Rect(0, a.left + this.y9.left, a.top + this.y9.top, a.width, a.height);
            return this.y6(a);
        }
        ot(a) {
            if (this.hq == null) {
                this.hq = new List$1(CaptureImageSettings.$, 0);
            }
            this.hq.add(a);
            this.a3.z();
        }
        ou() {
            if (this.hq != null && this.hq.count > 0) {
                let a = this.hq.toArray();
                this.hq.clear();
                for (let c = 0; c < a.length; c++) {
                    let b = a[c];
                    this.kz(b, (d, e) => {
                        if (d != null) {
                            this.sq(b, d, e);
                        }
                    });
                }
            }
        }
        kz(a, b) {
            let c = "image/png";
            switch (a.a) {
                case 0:
                    c = "image/png";
                    break;
                case 1:
                    c = "image/jpeg";
                    break;
                default: return null;
            }
            let d = null;
            d = this.dw.j.at(this.dw.bb, this.dw.ba, this.ij, c, (e, f) => {
                if (a.b) {
                    let b_ = f;
                    if ((window.ClipboardItem)) {
                        navigator.clipboard.write([new window.ClipboardItem({ [b_.type]: b_ })]);
                    }
                }
                if (b != null) {
                    b(e, f);
                }
            });
            return d;
        }
        sq(a, b, c = null) {
            if (this.imageCaptured != null) {
                let d = new ImageCapturedEventArgs(b, c, a);
                this.imageCaptured(this, d);
            }
        }
        notifySeriesDataChanged() {
            if (this.seriesDataChanged != null) {
                this.seriesDataChanged(this, null);
            }
        }
        iw() {
            return this.dw.ba;
        }
        ix() {
            return this.dw.bb;
        }
        get dg() {
            if (this.df == null) {
                this.df = this.dw.l();
            }
            return this.df;
        }
        qe(a) {
            if (this.resizeIdle != null) {
                this.ht = dateNow();
                if (!this.eu) {
                    this.eu = true;
                    this.dg.executeDelayed(runOn(this, this.tf), this.kb);
                }
            }
        }
        tf() {
            let a = dateNow();
            let b = timeSpanTotalMilliseconds((+a - +(this.ht)));
            if (b >= this.kb) {
                this.eu = false;
                if (this.resizeIdle != null) {
                    this.resizeIdle(this, new ChartResizeIdleEventArgs());
                }
            }
            else {
                let c = Math.max(this.kb - b, 0);
                this.dg.executeDelayed(runOn(this, this.tf), this.kb);
            }
        }
        get fs() {
            return DVContainer.instance.checkLoaded("AnnotationFactoryManager");
        }
        get bl() {
            if (this.bk == null) {
                if (TypeRegistrar.isRegistered("AnnotationLayerProxy")) {
                    this.bk = TypeRegistrar.create("AnnotationLayerProxy");
                    this.bk.container = this.dw.bl;
                }
                else {
                    throw new BaseError(1, "annotation layer module is not loaded, but is required.");
                }
            }
            return this.bk;
        }
        get fl() {
            return (TypeRegistrar.isRegistered("AnnotationLayerProxy"));
        }
        get f0() {
            return this.eq;
        }
        get f1() {
            return this.er;
        }
        oq() {
            this.pc();
        }
        or() {
            this.pd();
        }
        pc() {
            this.dj = 0;
            this.eq = false;
            this.t9();
        }
        pd() {
            this.dj = 0;
            this.er = false;
            this.t9();
        }
        mt() {
            if (!this.fs) {
                return null;
            }
            this.o9();
            let a = this.b6();
            return this.bl.saveAnnotationsToJson(a);
        }
        pu(a) {
            if (!this.fs) {
                return;
            }
            this.o9();
            let b = this.b6();
            this.bl.loadAnnotationsFromJson(b, a);
        }
        tu() {
            if (!this.fs) {
                return;
            }
            this.o9();
            let a = this.b6();
            a.gv = true;
            this.dj = 3;
            this.er = false;
            this.eq = true;
            this.t9();
        }
        o9() {
            let a = this.ao(this);
            if (!a.f(10)) {
                if (this.fl) {
                    let b = this.bl.createUserAnnotationLayer();
                    b.p0(this);
                    let c = new AutomaticSeriesRequest();
                    c.d = b;
                    c.f = true;
                    c.a = 10;
                    a.b.add(c);
                    let d = this.bl.createUserAnnotationToolTipLayer();
                    d.p0(this);
                    let e = new AutomaticSeriesRequest();
                    e.d = d;
                    e.e = true;
                    e.a = 11;
                    a.b.add(e);
                }
            }
        }
        tv() {
            if (!this.fs) {
                return;
            }
            this.o9();
            let a = this.b6();
            a.gv = true;
            this.dj = 3;
            this.eq = false;
            this.er = true;
            this.t9();
        }
        td() {
            if (!this.fs) {
                return;
            }
            let a = this.ao(this);
            if (!a.f(10)) {
                if (this.fl) {
                    let b = this.bl.createUserAnnotationLayer();
                    let c = new AutomaticSeriesRequest();
                    c.d = b;
                    c.f = true;
                    c.a = 10;
                    a.b.add(c);
                }
            }
            let d = this.b6();
            this.bl.resetUserAnnotationLayer(d);
            this.dj = 0;
            this.eq = false;
            this.er = false;
            this.t9();
        }
        b6() {
            for (let a = 0; a < this.b9.count; a++) {
                let b = this.b9._inner[a];
                if (b.f9) {
                    return b;
                }
            }
            return null;
        }
        tm(a) {
            for (let b = 0; b < this.b9.count; b++) {
                let c = this.b9._inner[b];
                if (c.ga) {
                    this.bl.setIsDisabled(c, a);
                }
            }
        }
        uc(a) {
            this.eq = false;
            this.er = false;
            this.t9();
        }
        t9() {
            this.tm(this.eq || this.er);
        }
        pa() {
            this.eq = false;
            this.er = false;
            this.t9();
        }
    }
    SeriesViewer.$t = markType(SeriesViewer, 'SeriesViewer', Control.$, [INotifyPropertyChanged_$type, ILegendOwner_$type, IInternalLegendOwner_$type, IDataLegendTarget_$type, IToolbarTarget_$type, ISupportsAnimation_$type]);
    SeriesViewer.vy = DependencyProperty.i("Legend", IChartLegend_$type, SeriesViewer.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("Legend", b.oldValue, b.newValue);
    }));
    SeriesViewer.ut = DependencyProperty.i("AnimateSeriesWhenAxisRangeChanges", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("AnimateSeriesWhenAxisRangeChanges", b.oldValue, b.newValue);
    }));
    SeriesViewer.wn = DependencyProperty.i("SeriesValueLayerUseLegend", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("SeriesValueLayerUseLegend", b.oldValue, b.newValue);
    }));
    SeriesViewer.vu = DependencyProperty.i("IsWindowSyncedToVisibleRange", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("IsWindowSyncedToVisibleRange", b.oldValue, b.newValue);
    }));
    SeriesViewer.wq = DependencyProperty.i("ShouldSimulateHoverMoveCrosshairPoint", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("ShouldSimulateHoverMoveCrosshairPoint", b.oldValue, b.newValue);
    }));
    SeriesViewer.vb = DependencyProperty.i("HighlightingMode", SeriesHighlightingMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesHighlightingMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HighlightingMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.va = DependencyProperty.i("HighlightingFadeOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HighlightingFadeOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.wk = DependencyProperty.i("SelectionMode", SeriesSelectionMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("SelectionMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.wh = DependencyProperty.i("SelectionBehavior", SeriesSelectionBehavior_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionBehavior_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("SelectionBehavior", b.oldValue, b.newValue);
    }));
    SeriesViewer.u3 = DependencyProperty.i("FocusMode", SeriesSelectionMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesSelectionMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("FocusMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.vj = DependencyProperty.i("HorizontalViewScrollbarMode", SeriesViewerScrollbarMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerScrollbarMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.w4 = DependencyProperty.i("VerticalViewScrollbarMode", SeriesViewerScrollbarMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerScrollbarMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.vl = DependencyProperty.i("HorizontalViewScrollbarPosition", SeriesViewerHorizontalScrollbarPosition_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerHorizontalScrollbarPosition_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarPosition", b.oldValue, b.newValue);
    }));
    SeriesViewer.w6 = DependencyProperty.i("VerticalViewScrollbarPosition", SeriesViewerVerticalScrollbarPosition_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesViewerVerticalScrollbarPosition_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarPosition", b.oldValue, b.newValue);
    }));
    SeriesViewer.vf = DependencyProperty.i("HorizontalViewScrollbarFill", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarFill", b.oldValue, b.newValue);
    }));
    SeriesViewer.vk = DependencyProperty.i("HorizontalViewScrollbarOutline", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarOutline", b.oldValue, b.newValue);
    }));
    SeriesViewer.vn = DependencyProperty.i("HorizontalViewScrollbarStrokeThickness", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarStrokeThickness", b.oldValue, b.newValue);
    }));
    SeriesViewer.vi = DependencyProperty.i("HorizontalViewScrollbarMaxOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarMaxOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.ve = DependencyProperty.i("HorizontalViewScrollbarCornerRadius", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarCornerRadius", b.oldValue, b.newValue);
    }));
    SeriesViewer.vg = DependencyProperty.i("HorizontalViewScrollbarHeight", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarHeight", b.oldValue, b.newValue);
    }));
    SeriesViewer.vh = DependencyProperty.i("HorizontalViewScrollbarInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.vp = DependencyProperty.i("HorizontalViewScrollbarTrackStartInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarTrackStartInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.vo = DependencyProperty.i("HorizontalViewScrollbarTrackEndInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HorizontalViewScrollbarTrackEndInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.lu = "HorizontalViewScrollbarShouldAddAutoTrackInsets";
    SeriesViewer.vm = DependencyProperty.i(SeriesViewer.lu, Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, true, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr(SeriesViewer.lu, b.oldValue, b.newValue);
    }));
    SeriesViewer.w1 = DependencyProperty.i("VerticalViewScrollbarFill", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarFill", b.oldValue, b.newValue);
    }));
    SeriesViewer.w5 = DependencyProperty.i("VerticalViewScrollbarOutline", Brush.$, SeriesViewer.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarOutline", b.oldValue, b.newValue);
    }));
    SeriesViewer.w8 = DependencyProperty.i("VerticalViewScrollbarStrokeThickness", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarStrokeThickness", b.oldValue, b.newValue);
    }));
    SeriesViewer.w3 = DependencyProperty.i("VerticalViewScrollbarMaxOpacity", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarMaxOpacity", b.oldValue, b.newValue);
    }));
    SeriesViewer.w0 = DependencyProperty.i("VerticalViewScrollbarCornerRadius", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarCornerRadius", b.oldValue, b.newValue);
    }));
    SeriesViewer.xb = DependencyProperty.i("VerticalViewScrollbarWidth", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarWidth", b.oldValue, b.newValue);
    }));
    SeriesViewer.w2 = DependencyProperty.i("VerticalViewScrollbarInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.xa = DependencyProperty.i("VerticalViewScrollbarTrackStartInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarTrackStartInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.w9 = DependencyProperty.i("VerticalViewScrollbarTrackEndInset", Number_$type, SeriesViewer.$, new PropertyMetadata(2, NaN, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("VerticalViewScrollbarTrackEndInset", b.oldValue, b.newValue);
    }));
    SeriesViewer.n3 = "VerticalViewScrollbarShouldAddAutoTrackInsets";
    SeriesViewer.w7 = DependencyProperty.i(SeriesViewer.n3, Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, true, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr(SeriesViewer.n3, b.oldValue, b.newValue);
    }));
    SeriesViewer.u8 = DependencyProperty.i("HighlightingBehavior", SeriesHighlightingBehavior_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(SeriesHighlightingBehavior_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("HighlightingBehavior", b.oldValue, b.newValue);
    }));
    SeriesViewer.vv = DependencyProperty.i("LegendHighlightingMode", LegendHighlightingMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendHighlightingMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("LegendHighlightingMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.vx = DependencyProperty.i("LegendItemBadgeShape", LegendItemBadgeShape_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendItemBadgeShape_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("LegendItemBadgeShape", b.oldValue, b.newValue);
    }));
    SeriesViewer.vw = DependencyProperty.i("LegendItemBadgeMode", LegendItemBadgeMode_$type, SeriesViewer.$, new PropertyMetadata(2, enumGetBox(LegendItemBadgeMode_$type, 0), (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("LegendItemBadgeMode", b.oldValue, b.newValue);
    }));
    SeriesViewer.u0 = DependencyProperty.i("FireMouseLeaveOnManipulationStart", Boolean_$type, SeriesViewer.$, new PropertyMetadata(2, false, (a, b) => {
        let c = typeCast(SeriesViewer.$, a);
        c.sr("FireMouseLeaveOnManipulationStart", b.oldValue, b.newValue);
    }));
    SeriesViewer.y4 = Rect.empty;
    SeriesViewer.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesViewer, 'sr', ['ActualPlotAreaBorderBrush:xt:us', [Brush.$, null], 'Brushes:ag:uu', [BrushCollection.$, null], 'CircleMarkerTemplate:uh:uv', [DataTemplate.$, null], 'CrosshairVisibility:ze:uw', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'DefaultInteraction:di:ux', [InteractionState_$type, enumGetBox(InteractionState_$type, 4)], 'DiamondMarkerTemplate:ui:uy', [DataTemplate.$, null], 'DragModifier:xo:uz', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 2)], 'FocusBrush:xu:u1', [Brush.$, null], 'FocusDismissDelayMilliseconds:j6:u2', [1, 200], 'FocusTransitionDuration:j7:u4', [1, 100], 'HexagonMarkerTemplate:uj:u5', [DataTemplate.$, null], 'HexagramMarkerTemplate:uk:u6', [DataTemplate.$, null], 'HighlightedValuesDisplayMode:cb:u7', [SeriesHighlightedValuesDisplayMode_$type, enumGetBox(SeriesHighlightedValuesDisplayMode_$type, 0)], 'HighlightingDismissDelayMilliseconds:j9:u9', [1, 200], 'HighlightingTransitionDuration:ka:vc', [1, 300], 'HorizontalCrosshairBrush:x4:vd', [Brush.$, null], 'InteractionOverride:dj:vq', [InteractionState_$type, enumGetBox(InteractionState_$type, 0)], 'IsPagePanningAllowed:f8:vr', [0, true], 'IsSurfaceInteractionDisabled:f9:vs', [0, false], 'IsUserAnnotationsEnabled:gd:vt', [0, false], 'MarkerAutomaticBehavior:bv:vz', [MarkerAutomaticBehavior_$type, enumGetBox(MarkerAutomaticBehavior_$type, 4)], 'MarkerBrushes:ah:v0', [BrushCollection.$, null], 'MarkerOutlines:ai:v1', [BrushCollection.$, null], 'Outlines:aj:v2', [BrushCollection.$, null], 'OverviewPlusDetailPaneVisibility:zf:v3', [Visibility_$type, enumGetBox(Visibility_$type, 1)], 'PanModifier:xp:v4', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 4)], 'PentagonMarkerTemplate:ul:v5', [DataTemplate.$, null], 'PentagramMarkerTemplate:um:v6', [DataTemplate.$, null], 'PlotAreaBackground:x7:v7', [Brush.$, null], 'PlotAreaBorderBrush:x8:v8', [Brush.$, null], 'PreferHigherResolutionTiles:gv:v9', [0, false], 'PreviewPathFill:x9:wa', [Brush.$, null], 'PreviewPathOpacity:i9:wb', [1, NaN], 'PreviewPathStroke:ya:wc', [Brush.$, null], 'PyramidMarkerTemplate:un:wd', [DataTemplate.$, null], 'ResizeIdleMilliseconds:kb:we', [1, 250], 'RightButtonDefaultInteraction:dl:wf', [InteractionState_$type, enumGetBox(InteractionState_$type, 4)], 'ScrollbarsAnimationDuration:kc:wg', [1, 300], 'SelectionBrush:yb:wi', [Brush.$, null], 'SelectionDismissDelayMilliseconds:kd:wj', [1, 200], 'SelectionModifier:xq:wl', [ModifierKeys_$type, enumGetBox(ModifierKeys_$type, 1)], 'SelectionTransitionDuration:ke:wm', [1, 300], 'ShouldMatchZOrderToSeriesOrder:g1:wo', [0, false], 'ShouldPanOnMaximumZoom:g2:wp', [0, true], 'SquareMarkerTemplate:uo:wr', [DataTemplate.$, null], 'SubtitleHorizontalAlignment:xm:ws', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'Subtitle:m6:wt', [2, null], 'TetragramMarkerTemplate:up:wu', [DataTemplate.$, null], 'TitleHorizontalAlignment:xn:wv', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'Title:ni:ww', [2, null], 'TriangleMarkerTemplate:uq:wx', [DataTemplate.$, null], 'UseTiledZooming:he:wy', [0, false], 'VerticalCrosshairBrush:ye:wz', [Brush.$, null], 'WindowPositionHorizontal:jt:xc', [1, NaN], 'WindowPositionVertical:ju:xd', [1, NaN], 'WindowRectMinHeight:jv:xe', [1, NaN], 'WindowRectMinWidth:jw:xf', [1, NaN], 'WindowRect:za:xg', [Rect.$, new Rect(0, 0, 0, 1, 1)], 'WindowResponse:c9:xh', [WindowResponse_$type, enumGetBox(WindowResponse_$type, 1)], 'WindowSizeMinHeight:jx:xi', [1, NaN], 'WindowSizeMinWidth:jy:xj', [1, NaN], 'ZoomCoercionMode:dd:xk', [ZoomCoercionMode_$type, enumGetBox(ZoomCoercionMode_$type, 0)], 'ZoomTileCacheSize:kf:xl', [1, 30]]);
    return SeriesViewer;
})();
/**
 * @hidden
 */
export let SeriesViewerView = /*@__PURE__*/ (() => {
    class SeriesViewerView extends Base {
        constructor(a) {
            super();
            this.p = null;
            this.a = null;
            this.n = null;
            this.o = null;
            this.g = null;
            this.b = null;
            this.ai = false;
            this.fl = null;
            this.fi = null;
            this.fh = null;
            this.fg = null;
            this.h = new SeriesViewerComponentsFromView();
            this.j = null;
            this.w = null;
            this.z = null;
            this.y = null;
            this.x = null;
            this.ao = false;
            this.ap = false;
            this.bl = null;
            this.k = null;
            this.bc = 0;
            this.bb = 0;
            this.ba = 0;
            this.fc = Rect.empty;
            this.aj = false;
            this.fj = null;
            this.fk = null;
            this.a4 = 0;
            this.a2 = 0;
            this.a3 = 0;
            this.a1 = 0;
            this.ak = true;
            this.aa = false;
            this.a5 = NaN;
            this.fd = Rect.empty;
            this.ab = false;
            this.af = false;
            this.ae = false;
            this.ax = new List$1(Series.$, 0);
            this.aw = false;
            this.ew = null;
            this.ev = null;
            this.ad = false;
            this.ac = false;
            this.ag = true;
            this.a0 = null;
            this.as = false;
            this.bj = 0;
            this.ah = true;
            this.bb = 0;
            this.ba = 0;
            this.p = a;
            this.p.yi = { $type: Point_$type, x: NaN, y: NaN };
            this.p.c9 = 1;
            this.j = new SeriesViewerViewManager(this);
            this.fg = ((() => {
                let $ret = new Line();
                $ret.visibility = 1;
                return $ret;
            })());
            this.fh = ((() => {
                let $ret = new Line();
                $ret.visibility = 1;
                return $ret;
            })());
        }
        l() {
            return new DOMExecutionContext(this.j.ae);
        }
        cr() {
            this.j.ba();
        }
        c7() {
            this.p.fq = true;
            this.p.ze = 1;
            this.p.fq = false;
            this.fi = new Path();
            this.fl = new Rectangle();
            this.fl._visibility = 1;
            this.d9();
            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.zf == 0) {
                this.cq();
            }
            let a = this.p;
            a.windowRectChanged = delegateCombine(a.windowRectChanged, runOn(this, this.cw));
            let b = this.p;
            b.gridAreaRectChanged = delegateCombine(b.gridAreaRectChanged, runOn(this, this.cv));
            this.o = new OverviewPlusDetailViewportHost(this);
            this.ds();
        }
        e() {
            for (let a = 0; a < this.g.count; a++) {
                if (this.g._inner[a].ba.a$f) {
                    return this.g._inner[a];
                }
            }
            return null;
        }
        cq() {
            if (this.n == null) {
                this.n = this.j.g();
            }
            this.p.dp.provideContext(this.z);
            this.p.dp.provideContainer(this.bl);
            this.p.dp.provideEventSource(this.k);
            this.n.world = new Rect(0, 0, 0, 1, 1);
            this.n.window = this.p.za;
            this.n.surfaceViewer = TypeRegistrar.create("SeriesViewerSurfaceViewer", this.p, this);
            this.n.viewScheduler = this.a;
            this.ep();
            let a = this.n;
            a.windowChanging = delegateCombine(a.windowChanging, runOn(this, this.dr));
            let b = this.n;
            b.windowChanged = delegateCombine(b.windowChanged, runOn(this, this.dq));
        }
        dr(a, b) {
            let c = b.newValue;
            if (this.n != null) {
                c = this.n.changeRect(b.oldValue, b.newValue, this.p.gg(), this.p.gh(), this.n.world);
            }
            if (c.isEmpty) {
                this.n.window = b.oldValue;
            }
            else if (!c.equals1(b.newValue)) {
                this.n.window = c;
            }
            if (this.p.c9 == 1) {
                let d = this.p.y9.width / this.p.y9.height;
                c = new Rect(0, c.left / d, c.top, c.width / d, c.height);
                this.p.za = c;
            }
        }
        dq(a, b) {
            let c = b.newValue;
            if (this.n != null) {
                c = this.n.changeRect(b.oldValue, b.newValue, this.p.gg(), this.p.gh(), this.n.world);
            }
            if (c.isEmpty) {
                c = b.oldValue;
            }
            else if (!c.equals1(b.newValue)) {
                this.n.window = c;
            }
            let d = this.p.y9.width / this.p.y9.height;
            c = new Rect(0, c.left / d, c.top, c.width / d, c.height);
            this.p.za = c;
        }
        ep() {
            if (this.n == null) {
                return;
            }
            if (this.p.zf != 0) {
                return;
            }
            let a = 1;
            if (this.p.y9.isEmpty == false) {
                a = this.p.y9.width / this.p.y9.height;
            }
            let b = this.n.world;
            let 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.za.left * a, this.p.za.top, this.p.za.width * a, this.p.za.height);
        }
        cw(a, b) {
            this.ep();
        }
        cv(a, b) {
            this.ep();
        }
        ce(a, b, c) {
            let d = true;
            for (let e of fromEnum(this.p.b9)) {
                if (d && e.g6) {
                    d = false;
                    if (!c.a.e) {
                        c.a.l(0, 0, a, b);
                    }
                }
                e.sa(new Rect(0, 0, 0, a, b), c);
            }
        }
        d8() {
            this.j.bm();
        }
        cg() {
        }
        ea() {
            this.j.bn();
        }
        cn() {
            for (let a = 0; a < this.p.b9.count; a++) {
                this.p.b9._inner[a].cw.a1();
            }
        }
        cf() {
        }
        ch() {
        }
        d1(a) {
            let b = this.g.indexOf(a);
            if (b >= 0) {
                this.g.removeAt(b);
            }
            if (a.isStacked) {
                a.qh((c) => {
                    c.dc = null;
                    b = this.g.indexOf(c);
                    if (b >= 0) {
                        this.g.removeAt(b);
                    }
                    if (c.ei) {
                        c.qf((d) => {
                            d.dc = null;
                            b = this.g.indexOf(d);
                            if (b >= 0) {
                                this.g.removeAt(b);
                            }
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (a.ei) {
                a.qf((c) => {
                    c.dc = null;
                    b = this.g.indexOf(c);
                    if (b >= 0) {
                        this.g.removeAt(b);
                    }
                    return true;
                });
            }
            this.p.s3();
            a.rr(null, null);
            this.df();
        }
        df() {
            if (this.p.destroyed) {
                return;
            }
            if (this.g.count == 0) {
                if (this.y != null && Rect.l_op_Inequality(this.p.y9, null) && !this.p.y9.isEmpty) {
                    this.eu();
                }
            }
            this.p.al.r(this.y, this.x);
        }
        eu() {
            if (this.g.count > 0) {
                return;
            }
            if (this.y != null && Rect.l_op_Inequality(this.p.y9, null) && !this.p.y9.isEmpty) {
                if (this.p.ij != 1) {
                    this.y.aa();
                    this.y.ab(this.p.ij, this.p.ij);
                }
                if (!this.y.e) {
                    this.y.l(this.p.y9.left, this.p.y9.top, this.p.y9.width, this.p.y9.height);
                }
                if (this.p.ij != 1) {
                    this.y.z();
                }
            }
        }
        ar(a) {
            a.ri(a.cw.b9, this.fc);
            return this.g.contains(a);
        }
        get av() {
            return this.ai;
        }
        set av(a) {
            this.ai = a;
        }
        bs(a) {
            if (this.p.g1) {
                let b = this.p.b9.indexOf(a);
                if (b < (this.p.b9.count - 1)) {
                    let c = this.p.b9._inner[b + 1];
                    let d = this.g.indexOf(c);
                    let e = d;
                    if (!this.g.contains(a)) {
                        this.g.insert(e, a);
                        e++;
                        if (a.isStacked) {
                            a.qh((f) => {
                                this.g.insert(e, f);
                                e++;
                                if (f.ei) {
                                    f.qf((g) => {
                                        if (!this.g.contains(g)) {
                                            this.g.insert(e, g);
                                            e++;
                                        }
                                        return true;
                                    });
                                }
                                return true;
                            });
                        }
                        if (a.ei) {
                            a.qf((f) => {
                                if (!this.g.contains(f)) {
                                    this.g.insert(e, f);
                                    e++;
                                }
                                return true;
                            });
                        }
                    }
                }
            }
            if (!this.g.contains(a)) {
                this.g.add(a);
                if (a.isStacked) {
                    a.qh((f) => {
                        this.g.add(f);
                        if (f.ei) {
                            f.qf((g) => {
                                if (!this.g.contains(g)) {
                                    this.g.add(g);
                                }
                                return true;
                            });
                        }
                        return true;
                    });
                }
                if (a.ei) {
                    a.qf((f) => {
                        if (!this.g.contains(f)) {
                            this.g.add(f);
                        }
                        return true;
                    });
                }
            }
            this.p.s3();
            a.rr(this.y, this.x);
            this.p.pr();
        }
        dw(a) {
            this.x = a;
            for (let b = 0; b < this.g.count; b++) {
                this.g._inner[b].rr(this.y, this.x);
            }
            for (let c = 0; c < this.b.count; c++) {
                this.b._inner[c].lb(this.y, this.x);
            }
        }
        b0() {
        }
        bw() {
            this.ci();
            this.cn();
        }
        ci() {
            this.fl._visibility = 1;
            this.ct();
        }
        cd() {
        }
        du() {
        }
        eb() {
            this.fl._visibility = 0;
            this.ct();
        }
        ej(a) {
            this.fl.o = a.top + this.p.y9.top;
            this.fl.n = a.left + this.p.y9.left;
            this.fl.width = a.width;
            this.fl.height = a.height;
            this.de();
            this.fl._fill = null;
            this.fl.ad = 0.5;
            this.ct();
        }
        bz() {
        }
        di() {
        }
        er(a, b, c, d) {
            this.fh.an = a;
            this.fh.ap = b;
            this.fh.ao = c;
            this.fh.aq = d;
            this.ct();
        }
        eg() {
            this.fh._visibility = 0;
            this.ct();
        }
        co() {
            if (this.fh._visibility == 0) {
                this.fh._visibility = 1;
                this.ct();
            }
        }
        ek(a, b, c, d) {
            this.fg.an = a;
            this.fg.ap = b;
            this.fg.ao = c;
            this.fg.aq = d;
            this.ct();
        }
        ec() {
            this.fg._visibility = 0;
            this.ct();
        }
        cj() {
            if (this.fg._visibility == 0) {
                this.fg._visibility = 1;
                this.ct();
            }
        }
        cm() {
            this.fi._visibility = 1;
            this.ct();
        }
        e9(a) {
            let b = new PathFigureCollection();
            let 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;
        }
        fa(a) {
            let b = new PathFigureCollection();
            let 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;
        }
        eq(a, b) {
            b.intersect(a);
            let c = new PathGeometry();
            c.c = this.fa(a);
            let d = new PathGeometry();
            d.c = this.e9(b);
            let e = new GeometryGroup();
            e.d.add(c);
            e.d.add(d);
            this.fi.an = e;
            this.de();
            this.ct();
        }
        ef() {
            this.fi._visibility = 0;
            this.ct();
        }
        es(a) {
        }
        dz(a) {
            let b = this.b.indexOf(a);
            this.b.removeAt(b);
            a.lb(null, null);
            this.d6();
            this.p.ta(a.name, true);
        }
        d0(a) {
        }
        br(a) {
            if (!this.b.contains(a)) {
                this.b.add(a);
            }
            a.lb(this.y, this.x);
            this.d6();
        }
        bo(a) {
        }
        i() {
            this.h.a = this.n;
            return this.h;
        }
        static az(a) {
            let b = a.dc.b9;
            let c = new List$1(Series.$, 0);
            for (let d = 0; d < b.count; d++) {
                c.add(b._inner[d]);
                if (b._inner[d].isStacked) {
                    b._inner[d].qh((e) => {
                        c.add(e);
                        return true;
                    });
                }
            }
            return c;
        }
        d5() {
            this.p.za = new Rect(0, 0, 0, 1, 1);
        }
        c3(a) {
            if (a == this.bl) {
                return;
            }
            if (a == null) {
                if (this.k != null) {
                    this.k.aw();
                }
                this.j.bg(null);
                this.w = null;
                this.z = null;
                this.y = null;
                this.x = null;
                this.k = null;
                if (this.p.dp != null) {
                    this.p.dp.provideContext(null);
                    this.p.dp.provideContainer(null);
                    this.p.dp.provideEventSource(null);
                }
                return;
            }
            this.bl = a;
            if (this.av) {
                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.ao = false;
            try {
                this.ao = (window.navigator.msPointerEnabled && window.MSGesture !== undefined);
            }
            catch (b) {
            }
            this.ap = false;
            try {
                this.ap = (window.PointerEvent !== undefined);
            }
            catch (c) {
            }
            if (this.ao || this.ap) {
                this.aw = true;
            }
            this.k = this.j.f;
            if (this.k != null) {
                this.k.bm = this.p.y9;
                this.k.ap = runOn(this, this.at);
                let d = this.k;
                d.onContactCompleted = delegateCombine(d.onContactCompleted, (d, e) => this.c0(d, e, this.k.am));
                let e = this.k;
                e.onContactMoved = delegateCombine(e.onContactMoved, runOn(this, this.c1));
                let f = this.k;
                f.onContactStarted = delegateCombine(f.onContactStarted, runOn(this, this.c2));
                let g = this.k;
                g.onDragCompleted = delegateCombine(g.onDragCompleted, runOn(this.p, this.p.qq));
                let h = this.k;
                h.onFlingStarted = delegateCombine(h.onFlingStarted, runOn(this, this.al));
                let i = this.k;
                i.onDragDelta = delegateCombine(i.onDragDelta, (i) => this.p.qr(i));
                let j = this.k;
                j.onDragStarted = delegateCombine(j.onDragStarted, (j) => this.p.qs(j, true));
                let k = this.k;
                k.onKeyDown = delegateCombine(k.onKeyDown, runOn(this.p, this.p.gs));
                let l = this.k;
                l.onMouseDown = delegateCombine(l.onMouseDown, runOn(this, this.c9));
                let m = this.k;
                m.onMouseLeave = delegateCombine(m.onMouseLeave, runOn(this, this.da));
                let n = this.k;
                n.onMouseOver = delegateCombine(n.onMouseOver, runOn(this, this.db));
                let o = this.k;
                o.onMouseUp = delegateCombine(o.onMouseUp, runOn(this, this.dc));
                let p = this.k;
                p.onMouseWheel = delegateCombine(p.onMouseWheel, runOn(this.p, this.p.gt));
                if (this.k.an) {
                    let q = this.k;
                    q.onZoomDelta = delegateCombine(q.onZoomDelta, (q, r, s, t) => this.p.rz(q, r, s, t));
                    let r = this.k;
                    r.onZoomStarted = delegateCombine(r.onZoomStarted, (r, s, t, u) => this.p.r3(r, s, t, u));
                    let s = this.k;
                    s.onZoomCompleted = delegateCombine(s.onZoomCompleted, (s, t, u, v) => {
                        if (this.k.af) {
                            this.p.rt();
                        }
                        this.p.ry(s, t, u, v);
                    });
                }
                else {
                    let t = this.k;
                    t.onPinchDelta = delegateCombine(t.onPinchDelta, (t, u) => this.p.q9(u));
                    let u = this.k;
                    u.onPinchStarted = delegateCombine(u.onPinchStarted, (u, v) => this.p.ra(u));
                    let v = this.k;
                    v.onGestureCompleted = delegateCombine(v.onGestureCompleted, (v, w) => this.p.qv(v));
                }
                let w = this.k;
                w.onDoubleTap = delegateCombine(w.onDoubleTap, (w) => this.p.qp(w));
                let x = this.k;
                x.onHold = delegateCombine(x.onHold, runOn(this, this.c6));
            }
            if (this.p.dp != null) {
                this.p.dp.provideContext(this.z);
                this.p.dp.provideContainer(a);
                this.p.dp.provideEventSource(this.k);
            }
            for (let y of fromEnum(this.b)) {
                y.bp.a8();
                this.br(y);
            }
            for (let z of fromEnum(this.g)) {
                this.bs(z);
            }
        }
        al(a, b, c) {
            if (this.p.e9) {
                return false;
            }
            return true;
        }
        c1(a, b) {
            this.p.qh(a, b);
        }
        c2(a, b) {
            this.p.bq.f$w(this.p, a, b);
        }
        c6(a) {
            this.p.rb(a);
        }
        c0(a, b, c) {
            this.p.qg(a, b, c);
        }
        dx(a) {
        }
        get_aq() {
            return false;
        }
        get aq() {
            return this.get_aq();
        }
        ei() {
            this.bc = FontUtil.getCurrentFontHeight(this.j.ae, this.p.getFontInfo());
        }
        f(a, b, c, d) {
            return {
                ret: ((() => { let e = this.p.bq.f$c(this.p, this.g, this.x, a, b, c, d); c = e.p5; return e.ret; })()),
                p2: c
            };
        }
        bg() {
            return this.bb;
        }
        bf() {
            return this.ba;
        }
        cx() {
            this.j.bd();
        }
        c4(a, b) {
            let c = this.bb;
            let d = this.ba;
            if (this.bb != a) {
                this.aj = true;
            }
            this.bb = a;
            if (this.ba != b) {
                this.aj = true;
            }
            this.ba = b;
            if (this.aj) {
                let e = new Size(1, c, d);
                let f = new Size(1, a, b);
                this.p.rs(e, f);
            }
            this.dm();
            this.d6();
            this.p.qk();
            this.p.al.r(this.y, this.x);
        }
        b9(a) {
            this.fj = a;
        }
        cc(a) {
            this.fk = a;
        }
        cb() {
            this.a.r(this.z, null);
        }
        d6() {
            if (this.p.destroyed) {
                return;
            }
            this.ag = true;
            this.p.a3.z();
        }
        b5() {
            if (this.bb == 0 || this.ba == 0) {
                return;
            }
            this.ag = false;
            this.aa = false;
            if (this.ak) {
                this.dl();
                this.dh();
                this.ak = false;
                this.ct();
            }
            let a = this.bb;
            let b = this.ba;
            let c = this.p.i7;
            let d = this.p.jc;
            let e = this.p.ir;
            let f = this.p.jl;
            let g = this.p.ip;
            let h = this.p.iq;
            if (isNaN_(g)) {
                g = this.bc / 2;
            }
            if (isNaN_(h)) {
                h = 0;
            }
            let i = this.p.gz();
            let j = new List$1(AxisLabelPanelBase.$, 0);
            for (let k of fromEnum(this.b)) {
                if (k.a1 != null) {
                    j.add(k.a1);
                    k.a1.b2 = () => this.aj;
                }
            }
            if (i) {
                let l = false;
                let m = false;
                let n = false;
                let o = false;
                for (let p of fromEnum(j)) {
                    if (LabelPanelArranger.b(p) == 2 && (p.ae.a4 == null || p.ae.a4.visibility == 0)) {
                        l = true;
                    }
                    if (LabelPanelArranger.b(p) == 3 && (p.ae.a4 == null || p.ae.a4.visibility == 0)) {
                        m = true;
                    }
                    if (LabelPanelArranger.b(p) == 0 && (p.ae.a4 == null || p.ae.a4.visibility == 0)) {
                        n = true;
                    }
                    if (LabelPanelArranger.b(p) == 1 && (p.ae.a4 == null || p.ae.a4.visibility == 0)) {
                        o = true;
                    }
                    if (p.ae != null && p.ae.a4 != null) {
                        p.ae.a4.c = p.ae.a4.location;
                    }
                }
                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;
            }
            let q = this.bi();
            f += q;
            let r = this.bh();
            f += r;
            let s = new Rect(0, c, f, a - (c + d), b - (f + e));
            s = LabelPanelArranger.e(j, s);
            let t = new Size(1, Math.max(0, a - (c + d)), Math.max(0, b - (f + e)));
            this.a4 = f - (q + r);
            this.a2 = c;
            this.a3 = d;
            this.a1 = e;
            this.fc = s;
            let u = ((() => {
                let $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.fc, (v, w) => {
                if (!v.c6.equals1(w)) {
                    if (v.ae != null) {
                        v.ae.d1 = true;
                    }
                    v.c6 = w;
                    v.ae.bp.ao();
                }
            });
            let v = false;
            if (this.aj) {
                this.aj = false;
                v = true;
            }
            this.p.r7(this.p.y9, this.fc);
            for (let w of fromEnum(this.b)) {
                if (Rect.l_op_Equality(w.o6, null) || w.o6.isEmpty) {
                    this.aa = true;
                }
                if (w.o6.equals1(this.fc) && !this.j.y()) {
                    continue;
                }
                w.k3(w.o6, this.fc);
            }
            for (let x of fromEnum(this.g)) {
                if (Rect.l_op_Equality(x.cw.b9, null) || x.cw.b9.isEmpty) {
                    this.aa = true;
                }
                if (x.cw.b9.equals1(this.fc) && !this.j.y()) {
                    continue;
                }
                x.ri(x.cw.b9, this.fc);
            }
            this.en();
            this.dy(this.fc);
            this.j.bc(false);
        }
        en() {
            if (this.p.dp != null && !this.fc.isEmpty) {
                let a = this.p.dp;
                let b = (this.p.e4) ? this.fc.width : Number.POSITIVE_INFINITY;
                let c = (this.p.e4) ? this.fc.height : Number.POSITIVE_INFINITY;
                let d = a.getDesiredSize(new Size(1, b, c));
                this.p.dp.arrange(new Rect(0, this.fc.right - d.width, this.fc.bottom - d.height, d.width, d.height));
                this.ep();
            }
        }
        v() {
            let a = this.p.getFontInfo();
            let b = this.s();
            if (this.p.d5() != null) {
                a = this.p.d5();
            }
            else if (b != null) {
                a = b;
            }
            return a;
        }
        u() {
            let a = this.p.getFontInfo();
            let b = this.r();
            if (this.p.d4() != null) {
                a = this.p.d4();
            }
            else if (b != null) {
                a = b;
            }
            return a;
        }
        e8() {
            let a = this.p.getFontBrush();
            let b = this.e5();
            if (this.p.yd != null) {
                a = this.p.yd;
            }
            else if (b != null) {
                a = b;
            }
            return a;
        }
        e7() {
            let a = this.p.getFontBrush();
            let b = this.e4();
            if (this.p.yc != null) {
                a = this.p.yc;
            }
            else if (b != null) {
                a = b;
            }
            return a;
        }
        bi() {
            if (this.p.ni == null || !(typeCast(XamDataChart.$, this.p) !== null)) {
                return 0;
            }
            let a = this.v();
            let b = 0;
            b = FontUtil.getCurrentFontHeight(this.j.ae, a);
            let c = this.fp();
            b += c.top + c.bottom;
            return b;
        }
        bh() {
            if (this.p.m6 == null || !(typeCast(XamDataChart.$, this.p) !== null)) {
                return 0;
            }
            if (!isNaN_(this.a5)) {
                return this.a5;
            }
            let a = this.u();
            this.a5 = FontUtil.getCurrentFontHeight(this.j.ae, a);
            let b = this.fo();
            this.a5 += b.top + b.bottom;
            return this.a5;
        }
        fp() {
            let a = this.j.ce();
            let b = isNaN_(this.p.jk) ? a.top : this.p.jk;
            let c = isNaN_(this.p.ji) ? a.left : this.p.ji;
            let d = isNaN_(this.p.jj) ? a.right : this.p.jj;
            let e = isNaN_(this.p.jh) ? a.bottom : this.p.jh;
            return new Thickness(1, c, b, d, e);
        }
        fo() {
            let a = this.j.cd();
            let b = isNaN_(this.p.jg) ? a.top : this.p.jg;
            let c = isNaN_(this.p.je) ? a.left : this.p.je;
            let d = isNaN_(this.p.jf) ? a.right : this.p.jf;
            let e = isNaN_(this.p.jd) ? a.bottom : this.p.jd;
            return new Thickness(1, c, b, d, e);
        }
        dy(a) {
        }
        ct() {
            if (!this.af) {
                if (this.z != null) {
                    this.af = true;
                    this.a.r(this.z, null);
                }
            }
        }
        d3() {
            if (this.z == null) {
                return;
            }
            if (this.z.d) {
                if (this.p.ij != 1) {
                    this.z.aa();
                    this.z.ab(this.p.ij, this.p.ij);
                }
                if (!this.fd.isEmpty) {
                    if (!this.av) {
                        if (!this.z.e) {
                            this.z.l(this.fd.left, this.fd.top, this.fd.width, this.fd.height);
                        }
                    }
                }
            }
            this.d4();
            if (this.z.d) {
                if (this.p.ij != 1) {
                    this.z.z();
                }
            }
        }
        isValid() {
            return true;
        }
        preRender() {
            this.j.a6(this.bb, this.ba);
            this.dv();
        }
        dv() {
        }
        d4() {
            if (this.z.d) {
                this.fd = new Rect(0, 0, 0, this.bb, this.ba);
                if (this.a0 != null && this.a0.count > 0) {
                    this.cl();
                    this.z.aa();
                    this.z.ah(this.p.y9);
                    if (!this.av) {
                        if (!this.z.e) {
                            this.z.l(this.p.y9.left, this.p.y9.top, this.p.y9.width, this.p.y9.height);
                        }
                    }
                }
                this.z.s(this.fg);
                this.z.s(this.fh);
                this.z.t(this.fi);
                this.z.w(this.fl);
                this.z.af(this.v());
                if (this.ew != null) {
                    this.ew.ao = this.e8();
                    this.z.x(this.ew);
                }
                this.z.af(this.u());
                if (this.ev != null) {
                    this.ev.ao = this.e7();
                    this.z.x(this.ev);
                }
                if (this.a0 != null && this.a0.count > 0) {
                    this.j.bl(this.a0);
                    this.z.z();
                }
                if (this.as) {
                    this.ee();
                    this.as = false;
                    this.a0.clear();
                    this.p.bq.f$l(this.p);
                    this.ct();
                }
                if (this.p.fa) {
                    if (this.fk != null) {
                        this.z.w(this.fk);
                    }
                    if (this.fj != null) {
                        this.z.w(this.fj);
                    }
                }
            }
        }
        c5() {
            this.j.bh();
        }
        cz() {
            this.j.bf();
        }
        fe() {
            return new Rect(0, 0, 0, this.bb, this.ba);
        }
        fb() {
            return this.j.b8();
        }
        d9() {
            this.p.uh = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.d;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.uq = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.m;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.un = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.j;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.uo = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.k;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.ui = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.e;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.ul = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.h;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.uj = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.f;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.up = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.l;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.um = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.i;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
            this.p.uk = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.g;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
        }
        eh() {
            this.j.bp();
            this.d7();
            let a = this.bc;
            this.ei();
            if (a != this.bc) {
                this.p.pr();
            }
        }
        ds() {
            if (this.p.zf == 0) {
                this.cq();
                this.p.pn();
            }
            if (this.p.dp != null) {
                let a = this.p.zf;
                this.p.dp.visibility = a;
                this.p.dp.doRefresh(false);
            }
        }
        at(a) {
            return this.p.bq.f$i(this.p, a);
        }
        db(a, b, c) {
            this.p.bq.f$z(this.p, this.g, this.x, a, b, c);
            this.p.ov(a, this.p.dm != 0 || this.p.gk);
        }
        da(a) {
            this.p.bq.f$y(this.p, a);
        }
        c9(a) {
            this.p.bq.f$x(this.p, this.k, a);
        }
        dc(a) {
            this.p.bq.f$aa(this.p, this.k, a);
        }
        d7() {
        }
        get e2() {
            return this.k.bj;
        }
        et(a) {
            if (this.k != null) {
                this.k.bm = this.p.y9;
            }
        }
        cu(a) {
            this.p.bq.f$ad(this.p, a);
            this.p.e4 = a;
        }
        bn(a) {
            this.p.t0();
            this.j.bw(a);
            if (this.p.dp != null) {
                this.p.dp.mobileMode = a;
            }
            this.eo();
        }
        eo() {
            this.p.t6();
        }
        get isDirty() {
            return this.af;
        }
        set isDirty(a) {
            this.af = a;
        }
        undirty(a) {
            this.af = false;
            this.d3();
        }
        get index() {
            return 10;
        }
        postRender() {
        }
        ca() {
            this.d6();
        }
        get am() {
            return this.ae;
        }
        ck() {
            this.ae = false;
            this.ax.clear();
            this.j.a9();
        }
        ed() {
            this.ae = true;
            this.j.bo();
        }
        get ay() {
            return this.ax;
        }
        by(a) {
            this.ax.clear();
            this.j.ay();
        }
        bp(a, b) {
            this.ax.add(b);
            this.j.au(a);
        }
        el(a) {
            this.j.bu(a);
        }
        em(a) {
            this.j.bv(a);
        }
        bq(a) {
            this.j.av(a);
        }
        d2(a) {
            this.j.bk(a);
        }
        dd(a) {
            this.p.al.r(this.y, this.z);
        }
        bx(a) {
        }
        m(a) {
            if (this.p.e4) {
                return 2;
            }
            else {
                return 1;
            }
        }
        c8() {
            if (this.k != null) {
                this.k.ae = this.p.f9;
            }
            if (this.n != null) {
                this.n.isSurfaceInteractionDisabled = this.p.f9;
            }
        }
        be(a, b) {
            if (a == null || this.z == null) {
                return 0;
            }
            this.z.af(b);
            return this.z.f(a);
        }
        bd(a, b) {
            if (a == null) {
                return 0;
            }
            let c = 0;
            c = FontUtil.getCurrentFontHeight(this.j.ae, b);
            return c;
        }
        dm() {
            this.ak = true;
            this.d6();
            this.ct();
        }
        ex(a, b, c, d) {
            if (a == null) {
                return null;
            }
            let e = ((() => {
                let $ret = new TextBlock();
                $ret.al = a;
                $ret.o = b.top;
                return $ret;
            })());
            let f = this.be(e, c);
            e.o = b.top;
            let g = this.bd(a, c);
            e.m = f;
            e.l = g;
            switch (d) {
                case 0:
                    e.n = b.left;
                    break;
                case 2:
                    e.n = Math.max((this.bb - b.right) - f, b.left);
                    break;
                case 1:
                case 3:
                default:
                    let h = (this.bb / 2) - (f / 2);
                    h += b.left;
                    h -= b.right;
                    e.n = h;
                    break;
            }
            return e;
        }
        dl() {
            this.ew = typeCast(XamDataChart.$, this.p) !== null ? this.ex(this.p.ni, this.fp(), this.v(), this.e1()) : null;
        }
        dh() {
            this.a5 = NaN;
            this.ev = typeCast(XamDataChart.$, this.p) !== null ? this.ex(this.p.m6, this.fo(), this.u(), this.e0()) : null;
            if (this.ev != null) {
                this.ev.o += this.bi();
            }
        }
        c(a) {
            let b = this.j.c();
            if (b == 0) {
                let c = LabelPanelArranger.b(a.a1);
                if (a.an == 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;
        }
        d(a) {
            let b = this.j.d();
            if (b == 0) {
                let c = LabelPanelArranger.b(a.a1);
                if (a.an == 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;
        }
        dn() {
            if (!isNaN_(this.p.ii)) {
                if (!isNaN_(DeviceUtils.a(this.p.i8))) {
                    this.p.ij = DeviceUtils.a(this.p.i8);
                }
                else {
                    this.cr();
                }
            }
            if (!this.p.fu) {
                this.j.a5();
            }
        }
        dp() {
            if (!isNaN_(DeviceUtils.a(this.p.ii))) {
                this.p.ij = DeviceUtils.a(this.p.ii);
            }
            if (!this.p.fu) {
                this.j.a4();
            }
        }
        t() {
            return this.j.r();
        }
        e6() {
            return this.j.b7();
        }
        q() {
            return this.j.q();
        }
        e3() {
            return this.j.b6();
        }
        s() {
            return this.j.p();
        }
        r() {
            return this.j.o();
        }
        e5() {
            return this.j.b5();
        }
        e4() {
            return this.j.b4();
        }
        get a7() {
            return this.a2;
        }
        get a8() {
            return this.a3;
        }
        get a9() {
            return this.a4;
        }
        get a6() {
            return this.a1;
        }
        get ez() {
            return this.ew;
        }
        get ey() {
            return this.ev;
        }
        ff() {
            return new Rect(0, 0, 0, this.bb, this.ba);
        }
        fn() {
            return this.j.cg();
        }
        fm() {
            return this.j.cf();
        }
        dg(a, b) {
            this.ac = true;
        }
        dk(a, b) {
            this.ad = true;
        }
        e1() {
            if (this.ad) {
                return this.p.xn;
            }
            else {
                let a = 1;
                switch (this.j.as()) {
                    case "left":
                        a = 0;
                        break;
                    case "right":
                        a = 2;
                        break;
                }
                return a;
            }
        }
        e0() {
            if (this.ac) {
                return this.p.xm;
            }
            else {
                let a = 1;
                switch (this.j.ar()) {
                    case "left":
                        a = 0;
                        break;
                    case "right":
                        a = 2;
                        break;
                }
                return a;
            }
        }
        bt() {
            if (this.ag) {
                this.b5();
                if (this.aa) {
                    this.p.a3.y();
                }
                if (this.ag) {
                    this.b5();
                }
            }
        }
        an() {
            if (this.p.hg) {
                return false;
            }
            if ((dateNow().getTime() - this.p.hu.getTime()) < 300) {
                return true;
            }
            return false;
        }
        b8() {
            this.j.a6(this.bb, this.ba);
        }
        cs() {
            this.j.bb(this.p.f8);
        }
        au(a) {
            let b = this.p.yr;
            let c = b.top > 0;
            let d = b.left > 0;
            let e = b.right < 1;
            let f = b.bottom < 1;
            let g = a.y < 0;
            let h = a.y > 0;
            let i = a.x < 0;
            let 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;
        }
        dt() {
            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);
        }
        b6(a, b, c) {
            this.as = false;
            if (this.a0 == null) {
                this.a0 = new List$1(ITileZoomTile_$type, 0);
            }
            for (let d = 0; d < this.a0.count; d++) {
                while (d < this.a0.count && !a.containsKey(this.a0._inner[d].content)) {
                    this.a0.removeAt(d);
                }
            }
            for (let e = 0; e < b.count; e++) {
                this.a0.add(b._inner[e]);
            }
            this.ct();
        }
        bk(a, b, c) {
            return this.j.an(a, b, c);
        }
        b3() {
            this.j.a2();
        }
        b4(a) {
            this.j.a3(a);
        }
        cp() {
            if (this.a0 == null) {
                return;
            }
            this.as = true;
            this.ct();
        }
        b1() {
            this.j.a0();
        }
        bu() {
            this.j.aw();
        }
        b2(a) {
            this.j.a1(a);
            this.p.qn();
        }
        bv() {
            this.j.ax();
            this.p.ql();
        }
        cl() {
            if (this.ah) {
                this.ah = false;
                if (!this.y.e) {
                    this.y.l(this.p.y9.left, this.p.y9.top, this.p.y9.width, this.p.y9.height);
                }
                this.p.al.e = true;
            }
        }
        ee() {
            if (!this.ah) {
                this.ah = true;
                this.p.al.e = false;
                this.p.al.r(this.y, this.x);
            }
        }
        dj() {
        }
        cy() {
            this.j.be();
        }
        de() {
            this.fi._fill = this.p.x9 == null ? this.j.b3() : this.p.x9;
            this.fi._opacity = isNaN_(this.p.i9) ? 0.1 : this.p.i9;
            this.fl._stroke = this.p.ya == null ? this.j.b3() : this.p.ya;
        }
        b7(a) {
            if (this.j.ae == null || (this.j.ae != a)) {
                this.p.provideContainer(a);
            }
        }
        bm(a, b, c) {
            return this.j.ao(a, b, c);
        }
    }
    SeriesViewerView.$t = markType(SeriesViewerView, 'SeriesViewerView', Base.$, [ISchedulableRender_$type]);
    return SeriesViewerView;
})();
/**
 * @hidden
 */
export let OverviewPlusDetailViewportHost = /*@__PURE__*/ (() => {
    class OverviewPlusDetailViewportHost extends Base {
        constructor(a) {
            super();
            this.a = null;
            if (a == null) {
                throw new ArgumentNullException(0, "view");
            }
            this.a = a;
        }
        getViewInfo(a, b) {
            a = new Rect(0, 0, 0, this.a.n.worldRectViewport.width, this.a.n.worldRectViewport.height);
            b = SeriesViewer.y4;
            return {
                p0: a,
                p1: b
            };
        }
        getEffectiveViewport() {
            if (!this.a.p.f6) {
                if (this.a.p.yv.isEmpty) {
                    return this.a.p.yv;
                }
                return this.a.p.y1(this.a.n.previewViewportdRect, this.a.p.y9, this.a.p.yv);
            }
            return Rect.empty;
        }
        getMainContentViewport() {
            if (!this.a.p.f6) {
                if (this.a.p.yu.isEmpty) {
                    return this.a.p.yu;
                }
                return Rect.empty;
            }
            return Rect.empty;
        }
    }
    OverviewPlusDetailViewportHost.$t = markType(OverviewPlusDetailViewportHost, 'OverviewPlusDetailViewportHost', Base.$, [IProvidesViewport_$type]);
    return OverviewPlusDetailViewportHost;
})();
/**
 * @hidden
 */
export let LegendTemplates = /*@__PURE__*/ (() => {
    class LegendTemplates extends Base {
        static af(a) {
            let 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;
        }
        static a(a) {
            return new RenderingContext(new CanvasViewRenderer(), a.context);
        }
        static v(a) {
            let b = typeCast(Series.$, a.series);
            if (b == null || b.be == 0) {
                a.thickness = Defaults.legendBadge_ShapeThickness;
            }
            else {
                a.thickness = b.il;
            }
            if (a.itemBrush != null) {
                a.actualItemBrush = a.itemBrush;
            }
            else {
                if (b != null) {
                    a.actualItemBrush = b.vv;
                }
            }
            if (a.outline == null) {
                if (b != null) {
                    a.m = a.outline;
                    a.outline = b.vw;
                }
            }
        }
        static b(a, b, c) {
            let d = (c - b) / 2;
            return a + d;
        }
        static c(a, b, c) {
            let d = (c - b) / 2;
            return a + d;
        }
        static u(a, b, c, d, e, f, g, h) {
            let i = DeviceUtils.g(Defaults.legendBadge_ShapeWidth);
            let j = DeviceUtils.g(Defaults.legendBadge_ShapeHeight);
            let k = LegendTemplates.c(f, j, a.availableHeight);
            let l = LegendTemplates.c(h, j, a.availableHeight);
            let m = LegendTemplates.b(e, i, a.availableWidth);
            let n = LegendTemplates.b(g, i, a.availableWidth);
            let o = ((() => {
                let $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 }));
            let p = new PathGeometry();
            p.c.add(o);
            let q = new Path();
            q.an = p;
            q.ad = b;
            q._stroke = c;
            q._fill = d;
            let r = LegendTemplates.a(a);
            r.t(q);
        }
        static s(a) {
            let b = a.data;
            let c = b.series;
            LegendTemplates.v(b);
            let d = DeviceUtils.g(Defaults.legendBadge_ShapeWidth);
            let e = DeviceUtils.g(Defaults.legendBadge_ShapeHeight);
            let 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.be == 0) {
                f.ad = Defaults.legendBadge_ShapeThickness;
            }
            else {
                f.ad = c.il;
                f.al = c.wo;
                f.ak = c.wo;
                f.ai = c.wm;
                f.ac = c.jp;
                f.am = c.wp;
            }
            let g = LegendTemplates.a(a);
            g.s(f);
        }
        static r(a, b, c) {
            let d = a.data;
            LegendTemplates.v(d);
            let e = DeviceUtils.g(Defaults.legendBadge_ShapeWidth);
            let f = DeviceUtils.g(Defaults.legendBadge_ShapeHeight);
            let g = e / 2;
            let h = f / 2;
            let i = LegendTemplates.b(g, e, a.availableWidth);
            let j = LegendTemplates.c(h, f, a.availableHeight);
            let k = new EllipseGeometry();
            k.e = { $type: Point_$type, x: i, y: j };
            k.c = g;
            k.d = h;
            let l = new Path();
            l.an = k;
            l.ad = d.thickness;
            l._stroke = d.outline;
            l._fill = d.actualItemBrush;
            let m = LegendTemplates.a(a);
            m.t(l);
        }
        static t(a, b = 0) {
            let c = a.data;
            let d = DeviceUtils.g(Defaults.legendBadge_ShapeWidth - b);
            let e = DeviceUtils.g(Defaults.legendBadge_ShapeHeight - b);
            let 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;
            let g = c.actualItemBrush;
            let h = c.itemBrush;
            let i = c.outline;
            let j = c.series;
            let k = j.th();
            c.actualItemBrush = j.v5();
            c.outline = j.v6();
            if (c.itemBrush != null) {
                c.actualItemBrush = c.itemBrush;
            }
            if (c.m != null) {
                c.outline = c.m;
            }
            if (j.be == 1) {
                c.thickness = j.iu();
            }
            else {
                c.thickness = Defaults.series_MarkerThickness;
            }
            if (k != null && k.measure != null && k.render != null) {
                let 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;
        }
        static j(a) {
            let b = a.data;
            LegendTemplates.v(b);
            LegendTemplates.r(a, Defaults.legendBadge_ShapeWidth, Defaults.legendBadge_ShapeHeight);
        }
        static n(a) {
            let b = a.data;
            let c = b.series;
            LegendTemplates.s(a);
            if (c.be == 1) {
                LegendTemplates.t(a, Defaults.legendBadge_OverlaidMarkerPadding);
            }
        }
        static o(a) {
            LegendTemplates.t(a, 0);
        }
        static q(a) {
            let b = a.data;
            LegendTemplates.v(b);
            LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, 0, 0, Defaults.legendBadge_ShapeWidth, Defaults.legendBadge_ShapeHeight);
        }
        static p(a) {
            let b = a.data;
            let c = b.series;
            LegendTemplates.v(b);
            if (c.be == 0) {
                let d = Defaults.legendBadge_ShapeThickness;
                let e = b.actualItemBrush;
                let f = c.vw;
                let g = Defaults.legendBadge_ShapeWidth;
                let h = Defaults.legendBadge_ShapeHeight;
                LegendTemplates.u(a, d, f, e, 0, 0, g, h);
            }
            else {
                let i = Defaults.legendBadge_ShapeThickness;
                let j = b.actualItemBrush;
                let k = c.wg();
                let l = Defaults.legendBadge_ShapeWidth / 2;
                let m = Defaults.legendBadge_ShapeWidth;
                let n = Defaults.legendBadge_ShapeHeight;
                LegendTemplates.u(a, i, j, j, 0, 0, l, n);
                LegendTemplates.u(a, i, k, k, l, 0, m, n);
            }
        }
        static i(a) {
            let b = a.data;
            LegendTemplates.v(b);
            let c = 0;
            let d = Defaults.legendBadge_ShapeWidth;
            let e = (Defaults.legendBadge_ShapeHeight * 0.25);
            let f = (Defaults.legendBadge_ShapeHeight * 0.75);
            LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, c, e, d, f);
        }
        static l(a) {
            let b = a.data;
            LegendTemplates.v(b);
            let c = (Defaults.legendBadge_ShapeWidth * 0.25);
            let d = (Defaults.legendBadge_ShapeWidth * 0.75);
            let e = Defaults.legendBadge_ShapeHeight;
            let f = 0;
            LegendTemplates.u(a, b.thickness, b.outline, b.actualItemBrush, c, f, d, e);
        }
        static m(a) {
            let b = a.data;
            let c = BrushUtil.j(0, 0, 0, 0);
            let d = BrushUtil.j(0, 0, 0, 0);
            LegendTemplates.u(a, Defaults.legendBadge_ShapeThickness, c, d, 0, 0, Defaults.legendBadge_ShapeWidth, Defaults.legendBadge_ShapeHeight);
        }
        static k(a) {
        }
        static g(a) {
            let b = a.data;
            let c = b.series;
            let d = c.legendItemBadgeTemplate;
            if (d == null) {
                d = LegendTemplates.af(c);
            }
            let 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.it, c.jq);
        }
        static resolveLegendItemTemplate(a) {
            switch (a) {
                case 0: return LegendTemplates.w;
                case 1: return LegendTemplates.x;
            }
            return LegendTemplates.w;
        }
        static e(a) {
            let b = a.data;
            let c = b.series;
            let d = c.legendItemBadgeTemplate;
            if (d == null) {
                d = LegendTemplates.af(c);
            }
            let 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);
        }
        static f(a) {
        }
        static d(a) {
        }
        static h(a) {
        }
    }
    LegendTemplates.$t = markType(LegendTemplates, 'LegendTemplates');
    LegendTemplates.z = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.j;
        return $ret;
    })());
    LegendTemplates.ae = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.o;
        return $ret;
    })());
    LegendTemplates.ad = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.n;
        return $ret;
    })());
    LegendTemplates.ah = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.q;
        return $ret;
    })());
    LegendTemplates.ab = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.p;
        return $ret;
    })());
    LegendTemplates.y = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.i;
        return $ret;
    })());
    LegendTemplates.aa = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.l;
        return $ret;
    })());
    LegendTemplates.ac = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.m;
        return $ret;
    })());
    LegendTemplates.w = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.f;
        $ret.render = LegendTemplates.g;
        return $ret;
    })());
    LegendTemplates.x = ((() => {
        let $ret = new DataTemplate();
        $ret.measure = LegendTemplates.d;
        $ret.render = LegendTemplates.e;
        return $ret;
    })());
    return LegendTemplates;
})();
/**
 * @hidden
 */
export let SeriesViewerViewManager = /*@__PURE__*/ (() => {
    class SeriesViewerViewManager extends Base {
        constructor(a) {
            super();
            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;
        }
        bj() {
        }
        bg(a) {
            if (a == null) {
                if (this.f != null) {
                    this.f.aw();
                }
                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.dy.u(null);
                this.j.p.d0.u(null);
                this.j.p.dx.u(null);
                this.j.p.dz.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.dy.u(this.ae);
            this.j.p.d0.u(this.ae);
            this.j.p.dx.u(this.ae);
            this.j.p.dz.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.a3.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.a6 != 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.dx(this.t);
            this.j.c4(this.ae.rootWrapper.width(), this.ae.rootWrapper.height());
            {
                if ((TypeRegistrar.isRegistered('CanvasGestureDOMEventProxy'))) {
                    let overlayCanvas_ = this.aj;
                    let container_ = this.ae;
                    this.f = (TypeRegistrar.create('CanvasGestureDOMEventProxy', overlayCanvas_, container_, false));
                }
                else {
                    this.f = null;
                }
                if (this.f != null) {
                    this.f.aq = runOn(this.j, this.j.au);
                }
            }
            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.ns);
            this.ae.append(this.ah);
        }
        static by(a, b) {
            b();
            return;
        }
        bi() {
            this.j.d7();
            this.j.ei();
            this.bp();
        }
        ba() {
            let a = CanvasScalingHelpers.b(this.ae);
            this.j.p.ij = CanvasScalingHelpers.a(this.j.p.i8, this.j.p.ij, a);
            if (this.f != null) {
                CanvasScalingHelpers.h(this.f, a);
            }
        }
        g() {
            if ((TypeRegistrar.isRegistered('XamOverviewPlusDetailPane'))) {
                let overlayCanvas_ = this.aj;
                let container_ = this.ae;
                return (TypeRegistrar.create('XamOverviewPlusDetailPane'));
            }
            return null;
        }
        bm() {
            this.aj.setStyleProperty("cursor", "default");
        }
        bn() {
            this.aj.setStyleProperty("cursor", "pointer");
        }
        b3() {
            return ((() => {
                let $ret = new Brush();
                $ret.fill = "#000000";
                return $ret;
            })());
        }
        az(a, b, c) {
            this.ab = a;
            this.aa = b;
            this.ac = c;
            let d = a;
            let 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();
        }
        b8() {
            if (this.f == null) {
                return { $type: Point_$type, x: 0, y: 0 };
            }
            let a = this.f.bl(this.ae.rootWrapper);
            return { $type: Point_$type, x: a.left, y: a.top };
        }
        y() {
            return false;
        }
        bc(a) {
        }
        a8(a, b, c, d, e) {
            let 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
            };
        }
        e() {
            let a = new DefaultPaletteInfo();
            a.a = new BrushCollection();
            a.f = new BrushCollection();
            a.b = new BrushCollection();
            a.c = new BrushCollection();
            let b = new List$1(String_$type, 0);
            b.add("background-image");
            this.ae.startCSSQuery();
            let c = this.ae.getCssDefaultValuesForClassCollection("ui-chart-fill-palette-", b.toArray());
            let d = c.length;
            let e = this.ae.getCssDefaultValuesForClassCollection("ui-chart-outline-palette-", b.toArray());
            let f = e.length;
            let g = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-fill-palette-", b.toArray());
            let h = g.length;
            let i = this.ae.getCssDefaultValuesForClassCollection("ui-chart-marker-outline-palette-", b.toArray());
            let j = i.length;
            for (let k = 0; k < d; k++) {
                a.a.add(CssGradientUtil.brushFromGradientString(c[k][0]));
            }
            for (let l = 0; l < f; l++) {
                a.f.add(CssGradientUtil.brushFromGradientString(e[l][0]));
            }
            for (let m = 0; m < h; m++) {
                a.b.add(CssGradientUtil.brushFromGradientString(g[m][0]));
            }
            for (let n = 0; n < j; n++) {
                a.c.add(CssGradientUtil.brushFromGradientString(i[n][0]));
            }
            b.clear();
            let o = 0;
            let p = 0;
            let q = Math.min(d, f);
            let 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 (let s = 0; s < q; s++) {
                        let t = new Brush();
                        t._fill = r[s][o];
                        a.a.add(t);
                    }
                }
                else {
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#8BDC5C";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#8961A9";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#6DB1FF";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#82E9D9";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#EA3C63";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#735656";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#F8CE4F";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#A8A8B7";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#E051A9";
                        return $ret;
                    })()));
                    a.a.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#FF903B";
                        return $ret;
                    })()));
                }
            }
            if (f == 0) {
                if (q > 0) {
                    for (let u = 0; u < q; u++) {
                        let v = new Brush();
                        v._fill = r[u][p];
                        a.f.add(v);
                    }
                }
                else {
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#8BDC5C";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#8961A9";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#6DB1FF";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#82E9D9";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#EA3C63";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#735656";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#F8CE4F";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#A8A8B7";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#E051A9";
                        return $ret;
                    })()));
                    a.f.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#FF903B";
                        return $ret;
                    })()));
                }
            }
            b.clear();
            let 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) {
                    for (let x = 0; x < w; x++) {
                        let y = ((() => {
                            let $ret = new Brush();
                            $ret.fill = r[x][o];
                            return $ret;
                        })());
                        a.b.add(y);
                    }
                }
                else {
                    a.b.add(((() => {
                        let $ret = new Brush();
                        $ret.fill = "#FFFFFF";
                        return $ret;
                    })()));
                }
            }
            if (j == 0) {
                if (w > 0) {
                    for (let z = 0; z < w; z++) {
                        let aa = ((() => {
                            let $ret = new Brush();
                            $ret.fill = r[z][p];
                            return $ret;
                        })());
                        a.c.add(aa);
                    }
                }
                else {
                    for (let ab of fromEnum(a.a)) {
                        a.c.add(ab);
                    }
                }
            }
            let 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.axis_LineBrush;
            }
            a.k = new Brush();
            a.k._fill = this.ae.getCssDefaultPropertyValue("", "color");
            a.j = Defaults.crosshairLineBrush;
            let 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);
            let ae = ((() => {
                let $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;
        }
        a7(a, b, c, d, e, f) {
            this.ae.startCSSQuery();
            let g = this.ae.getCssDefaultPropertyValue("ui-chart-area-fill-opacity", "opacity");
            a = g != null ? parseFloat(g) : 1;
            b = new Array(4);
            let h = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-top");
            let i = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-right");
            let j = this.ae.getCssDefaultPropertyValue("ui-chart-render-margins", "margin-bottom");
            let 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;
            let l = this.ae.getCssDefaultPropertyValue("ui-chart-axis-stroke", "border-top-color");
            if (l != null) {
                let m = new Brush();
                m._fill = l;
                c = m;
            }
            let n = this.ae.getCssDefaultPropertyValue("ui-chart-axis-major-line", "border-top-color");
            if (n != null) {
                let o = new Brush();
                o._fill = n;
                d = o;
            }
            let p = this.ae.getCssDefaultPropertyValue("ui-chart-aligned-gridlines", "visibility");
            f = p != null && p == "visible";
            let 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
            };
        }
        ay() {
            this.ah.removeChildren();
        }
        bu(x_) {
            let box_ = this.ah;
            let offset_ = this.f.bl(this.ah);
            let a = this.b8();
            x_ = a.x + this.j.p.y9.left + x_;
            box_.setOffset(x_, this.j.p.y9.top + this.ad + a.y);
        }
        bv(y_) {
            this.ad = y_;
            let box_ = this.ah;
            let offset_ = this.ah.getOffset();
            let a = this.b8();
            y_ = this.j.p.y9.top + this.ad + a.y;
            box_.setOffset(offset_.left, y_);
        }
        au(a) {
            let b = a;
            b.show();
            this.ah.append(b);
        }
        a9() {
            this.ah.hide();
        }
        bo() {
            this.ah.show();
        }
        av(a) {
            this.ae.appendToBody(a);
        }
        bk(a) {
            a.remove();
        }
        bd() {
            if (this.ae == null) {
                return;
            }
            this.ba();
            this.j.c4(this.ae.rootWrapper.width(), this.ae.rootWrapper.height());
        }
        p() {
            return this.l;
        }
        ce() {
            return this.ca;
        }
        as() {
            return this.aq;
        }
        ar() {
            return this.ap;
        }
        cd() {
            return this.b9;
        }
        b5() {
            return this.b0;
        }
        b4() {
            return this.bz;
        }
        o() {
            return this.k;
        }
        c() {
            return this.a;
        }
        d() {
            return this.b;
        }
        r() {
            return this.n;
        }
        b7() {
            return this.b2;
        }
        q() {
            return this.m;
        }
        b6() {
            return this.b1;
        }
        cf() {
            return this.cb;
        }
        cg() {
            return this.cc;
        }
        bp() {
            this.ae.startCSSQuery();
            this.br();
            this.bq();
            this.bt();
            this.bs();
            this.bx();
            this.ae.endCSSQuery();
        }
        bx() {
            let a = "ui-chart-pointer-tooltip";
            let b = this.ae.getCssDefaultPropertyValue(a, "background-color");
            let c = this.ae.getCssDefaultPropertyValue(a, "border-top-color");
            let d = this.ae.getCssDefaultPropertyValue(a, "border-top-left-radius");
            let e = this.ae.getCssDefaultPropertyValue(a, "border-top-width");
            let f = new PointerTooltipStyle();
            f.a = d != null ? parseFloat(d) : 0;
            f.c = b != null ? Brush.create(b) : ((() => {
                let $ret = new Brush();
                $ret.fill = "white";
                return $ret;
            })());
            f.d = c != null ? Brush.create(c) : ((() => {
                let $ret = new Brush();
                $ret.fill = "gray";
                return $ret;
            })());
            f.b = e != null ? parseFloat(e) : 0;
            this.h = f;
        }
        br() {
            let a = "ui-chart-title";
            this.l = FontUtil.getFontForClass(this.ae, a);
            this.b0 = ((() => {
                let $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";
            }
            let b = this.ae.getCssDefaultPropertyValue(a, "margin-top");
            let c = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
            let d = this.ae.getCssDefaultPropertyValue(a, "margin-left");
            let e = this.ae.getCssDefaultPropertyValue(a, "margin-right");
            let f = b != null ? parseFloat(b) : 0;
            let g = c != null ? parseFloat(c) : 0;
            let h = d != null ? parseFloat(d) : 0;
            let i = e != null ? parseFloat(e) : 0;
            this.ca = new Thickness(1, h, f, i, g);
        }
        bq() {
            let a = "ui-chart-subtitle";
            this.k = FontUtil.getFontForClass(this.ae, a);
            this.bz = ((() => {
                let $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";
            }
            let b = this.ae.getCssDefaultPropertyValue(a, "margin-top");
            let c = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
            let d = this.ae.getCssDefaultPropertyValue(a, "margin-left");
            let e = this.ae.getCssDefaultPropertyValue(a, "margin-right");
            let f = b != null ? parseFloat(b) : 0;
            let g = c != null ? parseFloat(c) : 0;
            let h = d != null ? parseFloat(d) : 0;
            let i = e != null ? parseFloat(e) : 0;
            this.b9 = new Thickness(1, h, f, i, g);
        }
        bs() {
            let a = "ui-chart-horizontal-axis-title";
            this.m = FontUtil.getFontForClass(this.ae, a);
            this.b1 = ((() => {
                let $ret = new Brush();
                $ret.fill = this.ae.getCssDefaultPropertyValue(a, "color");
                return $ret;
            })());
            let 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;
            }
            let c = this.ae.getCssDefaultPropertyValue(a, "margin-top");
            let d = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
            let e = this.ae.getCssDefaultPropertyValue(a, "margin-left");
            let f = this.ae.getCssDefaultPropertyValue(a, "margin-right");
            let g = c != null ? parseFloat(c) : 2;
            let h = d != null ? parseFloat(d) : 2;
            let i = e != null ? parseFloat(e) : 2;
            let j = f != null ? parseFloat(f) : 2;
            this.cb = new Thickness(1, i, g, j, h);
        }
        bt() {
            let a = "ui-chart-vertical-axis-title";
            this.n = FontUtil.getFontForClass(this.ae, a);
            this.b2 = ((() => {
                let $ret = new Brush();
                $ret.fill = this.ae.getCssDefaultPropertyValue(a, "color");
                return $ret;
            })());
            let 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;
            }
            let c = this.ae.getCssDefaultPropertyValue(a, "margin-top");
            let d = this.ae.getCssDefaultPropertyValue(a, "margin-bottom");
            let e = this.ae.getCssDefaultPropertyValue(a, "margin-left");
            let f = this.ae.getCssDefaultPropertyValue(a, "margin-right");
            let g = c != null ? parseFloat(c) : 0;
            let h = d != null ? parseFloat(d) : 0;
            let i = e != null ? parseFloat(e) : 0;
            let j = f != null ? parseFloat(f) : 0;
            this.cc = new Thickness(1, i, g, j, h);
        }
        a6(a, b) {
            let c = this.j.p.ij;
            if (a != this.ab || b != this.aa || c != this.ac) {
                this.az(a, b, this.j.p.ij);
                this.j.p.al.l();
                this.j.a.l();
            }
        }
        i() {
            return this.h;
        }
        bb(a) {
            if (this.f == null) {
                return;
            }
            this.f.ab = a;
            this.f.aq = runOn(this.j, this.j.au);
        }
        an(a, b, c) {
            let d;
            if (!((() => { let e = this.z.tryGetValue(b.iD.toString(), d); d = e.p1; return e.ret; })())) {
                let 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");
                let f = this.ae.get2DCanvasContext(e);
                let g = new RenderingContext(new CanvasViewRenderer(), f);
                let h = new Tuple$2(DomWrapper_$type, RenderingContext.$, e, g);
                d = h;
                this.z.addItem(b.iD.toString(), d);
            }
            let i = new Rect(0, 0, 0, c, c);
            let j = new RenderSurface();
            j.a = d.d;
            for (let k = 0; k < this.j.p.b9.count; k++) {
                let l = this.j.p.b9._inner[k];
                l.r7(i, a, j, "tile", 1);
            }
            this.j.p.ak.l();
            return d.c;
        }
        a3(a) {
            this.z.removeItem(a.iD.toString());
        }
        a2() {
            this.z.clear();
        }
        bl(a) {
            for (let b = 0; b < a.count; b++) {
                let c = a._inner[b];
                let d = c.content;
                this.j.z.n(d.getNativeElement(), 1, c.xPosition + this.j.p.y9.left, c.yPosition + this.j.p.y9.top, c.width, c.height);
            }
        }
        a0() {
            if (this.al != -1) {
                this.aw();
            }
            if (this.ae != null) {
                this.al = this.ae.setTimeout(() => this.j.p.bq.f$m(this.j.p), 5000);
            }
            else {
                this.al = window.setTimeout(() => this.j.p.bq.f$m(this.j.p), 5000);
            }
        }
        aw() {
            if (this.al != -1) {
                if (this.ae != null) {
                    this.ae.clearTimeout(this.al);
                }
                else {
                    window.clearTimeout(this.al);
                }
                this.al = -1;
            }
        }
        a1(a) {
            if (this.am != -1) {
                this.ax();
            }
            if (this.ae != null) {
                this.am = this.ae.setTimeout(() => this.j.p.o4(), a);
            }
            else {
                this.am = window.setTimeout(() => this.j.p.o4(), a);
            }
        }
        ax() {
            if (this.am != -1) {
                if (this.ae != null) {
                    this.ae.clearTimeout(this.am);
                }
                else {
                    window.clearTimeout(this.am);
                }
                this.am = -1;
            }
        }
        be() {
            if (this.j.p.a6 != 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.dw(this.u);
        }
        bw(a) {
            if (this.ae != null) {
                let b = "igTouch";
                if (a) {
                    this.ae.rootWrapper.addClass(b);
                }
                else {
                    this.ae.rootWrapper.removeClass(b);
                }
            }
        }
        a4() {
        }
        a5() {
        }
        bh() {
            if (this.f != null) {
                this.f.bi(this.aj, "");
            }
        }
        bf() {
            this.ba();
            if (this.f != null) {
                this.f.au(this.aj, "");
            }
        }
        ao(a, b, c) {
            let d = this.ae.createElement("img");
            d.setProperty("src", this.at(a, b, c, "image/png"));
            return d.getNativeElement();
        }
        at(a, b, c, d, e = null) {
            let f = a * c;
            let g = b * c;
            let h = this.ae.createElement("canvas");
            h.setStyleProperty("width", a + "px");
            h.setStyleProperty("height", b + "px");
            h.setProperty("width", f);
            h.setProperty("height", g);
            let i = this.ae.get2DCanvasContext(h);
            let j = ((() => {
                let $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();
            }
            let format_ = d;
            let sCanv_ = h.getNativeElement();
            let url_ = (sCanv_.toDataURL(format_));
            if (e != null) {
                let cb_ = e;
                sCanv_.toBlob((blob) => { cb_(url_, blob); }, format_);
            }
            return url_;
        }
    }
    SeriesViewerViewManager.$t = markType(SeriesViewerViewManager, 'SeriesViewerViewManager');
    return SeriesViewerViewManager;
})();
/**
 * @hidden
 */
export let AnnotationBadge = /*@__PURE__*/ (() => {
    class AnnotationBadge extends Control {
        constructor(a) {
            super();
            this.ag = null;
            this.a3 = null;
            this.a4 = null;
            this.a8 = new Thickness(0, 0);
            this.a9 = new Thickness(0, 0);
            this.aj = 0;
            this.ak = 24;
            this.an = null;
            this.ah = null;
            this.propertyChanged = null;
            this.ai = null;
            this.ag = new AnnotationBadgeView(this);
            this.ai = a;
        }
        get a5() {
            return this.a3;
        }
        set a5(a) {
            let b = this.a3;
            this.a3 = a;
            if (b != this.a3) {
                this.a0("Background", b, a);
            }
        }
        get a6() {
            return this.a4;
        }
        set a6(a) {
            let b = this.a4;
            this.a4 = a;
            if (b != this.a4) {
                this.a0("BorderBrush", b, a);
            }
        }
        get ba() {
            return this.a8;
        }
        set ba(a) {
            let b = this.a8;
            this.a8 = a;
            if (b != this.a8) {
                this.a0("BorderThickness", b, a);
            }
        }
        get bb() {
            return this.a9;
        }
        set bb(a) {
            let b = this.a9;
            this.a9 = a;
            if (b != this.a9) {
                this.a0("Margin", b, a);
            }
        }
        get al() {
            return this.aj;
        }
        set al(a) {
            let b = this.aj;
            this.aj = a;
            if (b != this.aj) {
                this.a0("Radius", b, a);
            }
        }
        get am() {
            return this.ak;
        }
        set am(a) {
            let b = this.ak;
            this.ak = a;
            if (b != this.ak) {
                this.a0("Size", b, a);
            }
        }
        get as() {
            return this.an;
        }
        set as(a) {
            let b = this.an;
            if (this.an != a) {
                this.an = a;
                this.a1(a);
            }
        }
        a0(a, b, c) {
            this.az(a, b, c);
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
        }
        az(a, b, c) {
            switch (a) {
                case "Background":
                case "BorderBrush":
                case "BorderThickness":
                case "Size":
                case "Radius":
                case "Width":
                case "Height":
                    this.a2();
                    break;
            }
        }
        a7() {
            let a = DeviceUtils.g(this.am);
            return new Size(1, this.bb.left + a + this.bb.right, a);
        }
        a2() {
            this.width = DeviceUtils.g(this.am);
            this.height = DeviceUtils.g(this.am);
            this.ag.e();
        }
        a1(a) {
            if (a == null) {
                this.ag.c(null);
            }
            else {
                let b = this.ai;
                b.loadCompleted = delegateCombine(b.loadCompleted, runOn(this, this.ay));
                this.ai.request(a);
            }
        }
        ay(a, b) {
            let c = this.ai;
            c.loadCompleted = delegateRemove(c.loadCompleted, runOn(this, this.ay));
            if (b.d == this.as) {
                this.ag.c(b.b);
            }
        }
    }
    AnnotationBadge.$t = markType(AnnotationBadge, 'AnnotationBadge', Control.$, [INotifyPropertyChanged_$type]);
    return AnnotationBadge;
})();
/**
 * @hidden
 */
export let AutoRangeCalculator = /*@__PURE__*/ (() => {
    class AutoRangeCalculator extends Base {
        static a(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;
            let h = f;
            let i = g;
            if (isInfinity(h) || isInfinity(i)) {
                if (a != null) {
                    let j = a.pm();
                    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) {
                    let k = c;
                    c = b;
                    b = k;
                }
                let l = isNaN_(b) || isInfinity(b) ? h : b;
                let 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)) {
                        let 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 {
                    let o = Math.pow(10, Math.floor(log10(m - l)) - 1);
                    let p = a.f5();
                    if (a != null && p > 0 && (!a.qe && !a.qd)) {
                        let q = new LinearNumericSnapper(0, h, i, p, a.gm(), a.rh);
                        o = q.g;
                    }
                    else if (a.p9 && p > 0 && (!a.qe || !a.qd)) {
                        let r = h;
                        let s = i;
                        if (a.qe) {
                            r = b;
                        }
                        if (a.qd) {
                            s = c;
                        }
                        let t = new LinearNumericSnapper(0, r, s, p, a.gm(), a.rh);
                        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) {
                        let u = Math.ceil(i / o);
                        {
                            i = o * u;
                        }
                    }
                    else {
                        i = m;
                    }
                    if (a.p9) {
                        if (a.p9 && p > 0 && (!a.qe || !a.qd)) {
                            let v = new LinearNumericSnapper(0, h, i, p, a.gm(), a.rh);
                            let 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) {
                                    let 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;
})();
/**
 * @hidden
 */
export let AxisMouseEventArgs = /*@__PURE__*/ (() => {
    class AxisMouseEventArgs extends Base {
        constructor(a, b, c, d, e, f, g) {
            super();
            this.a = null;
            this.c = 0;
            this.b = new Date();
            this.f = null;
            this.g = null;
            this.h = null;
            this.e = null;
            this.d = null;
            this.a = a;
            this.c = b;
            this.b = c;
            this.f = f;
            this.h = g;
            this.e = d;
            this.d = e;
            this.g = { $type: Point_$type, x: this.f.x - a.b7.y9.left, y: this.f.y - a.b7.y9.top };
        }
    }
    AxisMouseEventArgs.$t = markType(AxisMouseEventArgs, 'AxisMouseEventArgs');
    return AxisMouseEventArgs;
})();
/**
 * @hidden
 */
export let IAxisAnnotationManager_$type = new Type(null, 'IAxisAnnotationManager');
/**
 * @hidden
 */
export let AxisLabelSettings = /*@__PURE__*/ (() => {
    class AxisLabelSettings extends Base {
        constructor() {
            super();
            this.ah = null;
            this.a6 = null;
            this.b = 1;
            this.bb = 0;
            this.i = true;
            this.c = 0;
            this.a = null;
            this.n = 0;
            this.p = NaN;
            this.r = NaN;
            this.s = NaN;
            this.q = 2;
            this.t = 2;
            this.u = 2;
            this.o = 2;
            this.a3 = 0;
            this.a8 = 1;
            this.propertyChanged = null;
            this.propertyUpdated = null;
            this.f = null;
            this.propertyUpdated = delegateCombine(this.propertyUpdated, (a, b) => this.az(a, b.propertyName, b.oldValue, b.newValue));
        }
        get textStyle() {
            return this.ah;
        }
        set textStyle(a) {
            let b = this.ah;
            this.ah = a;
            if (this.ah != b) {
                this.f = null;
                this.a0("TextStyle", b, a);
            }
        }
        get textColor() {
            return this.a6;
        }
        set textColor(a) {
            let b = this.a6;
            this.a6 = a;
            this.a0("TextColor", b, a);
        }
        get location() {
            return this.b;
        }
        set location(a) {
            let b = this.b;
            this.b = a;
            this.a0("Location", enumGetBox(AxisLabelsLocation_$type, b), enumGetBox(AxisLabelsLocation_$type, a));
        }
        get visibility() {
            return this.bb;
        }
        set visibility(a) {
            let b = this.bb;
            this.bb = a;
            this.a0("Visibility", enumGetBox(Visibility_$type, b), enumGetBox(Visibility_$type, a));
        }
        get showFirstLabel() {
            return this.i;
        }
        set showFirstLabel(a) {
            let b = this.i;
            this.i = a;
            this.a0("ShowFirstLabel", b, a);
        }
        registerAxis(a) {
            this.a = a;
        }
        unregisterAxis(a) {
            this.a = null;
        }
        get angle() {
            return this.n;
        }
        set angle(a) {
            let b = this.n;
            this.n = a;
            this.a0("Angle", b, a);
        }
        get extent() {
            return this.p;
        }
        set extent(a) {
            let b = this.p;
            this.p = a;
            this.a0("Extent", b, a);
        }
        get maximumExtent() {
            return this.r;
        }
        set maximumExtent(a) {
            let b = this.r;
            this.r = a;
            this.a0("MaximumExtent", b, a);
        }
        get maximumExtentPercentage() {
            return this.s;
        }
        set maximumExtentPercentage(a) {
            let b = this.s;
            this.s = a;
            this.a0("MaximumExtentPercentage", b, a);
        }
        set margin(a) {
            this.leftMargin = a;
            this.bottomMargin = a;
            this.rightMargin = a;
            this.topMargin = a;
        }
        get leftMargin() {
            return this.q;
        }
        set leftMargin(a) {
            let b = this.q;
            this.q = a;
            this.a0("LeftMargin", b, a);
        }
        get rightMargin() {
            return this.t;
        }
        set rightMargin(a) {
            let b = this.t;
            this.t = a;
            this.a0("RightMargin", b, a);
        }
        get topMargin() {
            return this.u;
        }
        set topMargin(a) {
            let b = this.u;
            this.u = a;
            this.a0("TopMargin", b, a);
        }
        get bottomMargin() {
            return this.o;
        }
        set bottomMargin(a) {
            let b = this.o;
            this.o = a;
            this.a0("BottomMargin", b, a);
        }
        get horizontalAlignment() {
            return this.a3;
        }
        set horizontalAlignment(a) {
            let b = this.a3;
            this.a3 = a;
            this.a0("HorizontalAlignment", enumGetBox(HorizontalAlignment_$type, b), enumGetBox(HorizontalAlignment_$type, a));
        }
        get verticalAlignment() {
            return this.a8;
        }
        set verticalAlignment(a) {
            let b = this.a8;
            this.a8 = a;
            this.a0("VerticalAlignment", enumGetBox(VerticalAlignment_$type, b), enumGetBox(VerticalAlignment_$type, a));
        }
        a0(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));
            }
        }
        az(a, b, c, d) {
            switch (b) {
                case "Location":
                    this.c = this.location;
                    break;
            }
            if (this.a == null || this.a.b5 == null) {
                return;
            }
            switch (b) {
                case "Angle":
                    this.a.d0 = true;
                    this.a.lx();
                    break;
                case "TextStyle":
                    this.f = null;
                    this.a.d0 = true;
                    if (this.a.b7 != null) {
                        this.a.b7.pr();
                    }
                    this.a.lx();
                    break;
                case "Location":
                case "Extent":
                case "Visibility":
                case "HorizontalAlignment":
                case "VerticalAlignment":
                case "TopMargin":
                case "RightMargin":
                case "BottomMargin":
                case "LeftMargin":
                case "ShowFirstLabel":
                    this.a.d0 = true;
                    if (this.a.b7 != null) {
                        this.a.b7.pr();
                    }
                    this.a.lx();
                    break;
                case "TextColor":
                    this.a.lx();
                    break;
            }
        }
        k() {
            return this.n != 0;
        }
        l() {
            return !isNaN_(this.p);
        }
        get j() {
            return this.textStyle != null || this.f != null;
        }
        get g() {
            return this.f;
        }
        set g(a) {
            this.f = a;
        }
        h(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;
})();
/**
 * @hidden
 */
export let TitleSettings = /*@__PURE__*/ (() => {
    class TitleSettings extends AxisLabelSettings {
        constructor() {
            super();
            this.bd = 0;
            this.horizontalAlignment = 1;
            this.leftMargin = NaN;
            this.rightMargin = NaN;
            this.topMargin = NaN;
            this.bottomMargin = NaN;
        }
        get position() {
            return this.bd;
        }
        set position(a) {
            let b = this.bd;
            this.bd = a;
            this.a0("AxisTitlePosition", enumGetBox(AxisTitlePosition_$type, b), enumGetBox(AxisTitlePosition_$type, a));
        }
        az(a, b, c, d) {
            super.az(a, b, c, d);
            if (this.a == null || this.a.b7 == null) {
                return;
            }
            switch (b) {
                case "AxisTitlePosition":
                    this.a.d0 = true;
                    this.a.lx();
                    break;
            }
        }
    }
    TitleSettings.$t = markType(TitleSettings, 'TitleSettings', AxisLabelSettings.$);
    return TitleSettings;
})();
/**
 * @hidden
 */
export let Axis = /*@__PURE__*/ (() => {
    class Axis extends Control {
        constructor() {
            super();
            this.bp = null;
            this.ck = null;
            this.by = null;
            this.j6 = null;
            this.hc = -1;
            this.hb = -1;
            this.hl = 0;
            this.co = false;
            this.cp = false;
            this.ox = { $type: Point_$type, x: Number.NEGATIVE_INFINITY, y: Number.NEGATIVE_INFINITY };
            this.labelMouseDown = null;
            this.labelMouseUp = null;
            this.labelMouseEnter = null;
            this.labelMouseLeave = null;
            this.labelMouseOver = null;
            this.labelMouseClick = null;
            this.panelMouseDown = null;
            this.panelMouseUp = null;
            this.panelMouseEnter = null;
            this.panelMouseLeave = null;
            this.panelMouseOver = null;
            this.panelMouseClick = null;
            this.bw = null;
            this.mf = null;
            this.cc = null;
            this.b6 = null;
            this.cj = null;
            this.cr = false;
            this.ez = NaN;
            this.et = 50;
            this.e5 = 0;
            this.e2 = 150;
            this.ax = 0;
            this.ey = NaN;
            this.e9 = 0;
            this.e4 = 0;
            this.e1 = 180;
            this.b9 = null;
            this.b8 = null;
            this.h1 = "Verdana";
            this.e0 = NaN;
            this.fb = 0;
            this.e6 = 8;
            this.e3 = 16;
            this.hf = -1;
            this.he = 1;
            this.hd = 3;
            this.hg = 0;
            this.pc = 0;
            this.e8 = 0;
            this.e7 = 2;
            this.mg = null;
            this.fc = 0;
            this.dp = false;
            this.cn = false;
            this.eu = 0;
            this.d7 = false;
            this.d9 = false;
            this.cs = false;
            this.rangeChanged = null;
            this.aq = new AxisAnnotationCollection();
            this.ar = new AxisAnnotationCollection();
            this.oy = Rect.empty;
            this.o5 = null;
            this.eq = null;
            this.er = null;
            this.a1 = null;
            this.cq = false;
            this.oz = null;
            this.bq = null;
            this.ha = null;
            this.ai = null;
            this.en = new Dictionary$2(String_$type, Base.$, 0);
            this._coercionMethods = null;
            this.cm = false;
            this.ea = false;
            this.ej = false;
            this.renderRequested = null;
            this.b1 = null;
            this.d1 = false;
            this.ew = NaN;
            this.ex = -1;
            this.d2 = false;
            this.propertyChanged = null;
            this.propertyUpdated = null;
            this.es = null;
            this.em = new Dictionary$2(String_$type, String_$type, 0);
            this.el = new Dictionary$2(String_$type, FastReflectionHelper.$, 0);
            this.pb = new Size();
            this.au = new AxisComponentsForView();
            this.fp = 0;
            this.ev = 0;
            this.ci = null;
            this.ch = null;
            this.cf = null;
            this.ce = null;
            this.cg = null;
            this.a2 = new AxisLabelSettings();
            this.g9 = null;
            this.ao = null;
            this.de = false;
            this.dh = false;
            this.cu = false;
            this.j6 = "AXIS_ID_" + Axis.hp++;
            DVContainer.instance.registerIfLoaded("VisualDataFactoryManager");
            DVContainer.instance.registerIfLoaded("AnnotationFactoryManager");
            this.oz = Rect.empty;
            this.cs = true;
            this.fp = NaN;
            this.bp = this.bo();
            this.k6(this.bp);
            this.bp.ar();
            this.ci = ((() => {
                let $ret = new Pool$1(TextBlock.$);
                $ret.create = runOn(this.bp, this.bp.a9);
                $ret.activate = runOn(this.bp, this.bp.a2);
                $ret.disactivate = runOn(this.bp, this.bp.a4);
                $ret.destroy = runOn(this.bp, this.bp.a3);
                return $ret;
            })());
            this.ch = ((() => {
                let $ret = new Pool$1(TextBlock.$);
                $ret.create = runOn(this.bp, this.bp.a9);
                $ret.activate = runOn(this.bp, this.bp.a2);
                $ret.disactivate = runOn(this.bp, this.bp.a4);
                $ret.destroy = runOn(this.bp, this.bp.a3);
                return $ret;
            })());
            this.cf = ((() => {
                let $ret = new Pool$1(Rectangle.$);
                $ret.create = runOn(this.bp, this.bp.bo);
                $ret.activate = runOn(this.bp, this.bp.w);
                $ret.disactivate = runOn(this.bp, this.bp.y);
                $ret.destroy = runOn(this.bp, this.bp.x);
                return $ret;
            })());
            this.ce = ((() => {
                let $ret = new Pool$1(AnnotationBackingArrangedSize.$);
                $ret.create = runOn(this, this.aj);
                $ret.activate = runOn(this, this.ke);
                $ret.disactivate = runOn(this, this.kg);
                $ret.destroy = runOn(this, this.kf);
                return $ret;
            })());
            this.cg = ((() => {
                let $ret = new Pool$1(AnnotationBadge.$);
                $ret.create = runOn(this.bp, this.bp.a);
                $ret.activate = runOn(this.bp, this.bp.z);
                $ret.disactivate = runOn(this.bp, this.bp.ab);
                $ret.destroy = runOn(this.bp, this.bp.aa);
                return $ret;
            })());
            this.o5 = Rect.empty;
            this.eq = new List$1(Base.$, 0);
            this.er = new List$1(LabelPosition.$, 0);
            this.a1 = this.a0();
            this.a1.ah = this.a4;
            this.a1.ae = this;
            this.es = new List$1(Series.$, 0);
            let a = this.aq;
            a.collectionResetting = delegateCombine(a.collectionResetting, runOn(this, this.ka));
            let b = this.aq;
            b.collectionChanged = delegateCombine(b.collectionChanged, runOn(this, this.j9));
            let c = this.ar;
            c.collectionResetting = delegateCombine(c.collectionResetting, runOn(this, this.kc));
            let d = this.ar;
            d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.kb));
            this.ab = Axis.$;
            if (this.a4 != null) {
                this.a2 = this.a4;
            }
            this.propertyUpdated = delegateCombine(this.propertyUpdated, (e, f) => this.la(e, f.propertyName, f.oldValue, f.newValue));
            this.cj = (e, f) => {
                if (this.b7 == null || !this.b7.fr) {
                    this.me(f.oldRect, f.newRect);
                }
            };
            this.bp.ag();
        }
        bo() {
            return new AxisView(this);
        }
        k6(a) {
        }
        kd() {
            if (this.dd) {
                this.bx.onAddAnnotations(this);
            }
        }
        get cl() {
            if (this.ck == null) {
                this.ck = new SRProvider(this.ha);
            }
            if (this.ck.l == null) {
                this.ck.l = this.ha;
            }
            return this.ck;
        }
        get bz() {
            if (this.by == null) {
                this.by = DVContainer.instance.createInstance(IAxisVisualDataManager_$type, () => this.cl.q);
            }
            return this.by;
        }
        f5() {
            return this.o0().width;
        }
        hz() {
            return null;
        }
        hy() {
            return null;
        }
        get_df() {
            return false;
        }
        get df() {
            return this.get_df();
        }
        get_dq() {
            return false;
        }
        get dq() {
            return this.get_dq();
        }
        get_dc() {
            return false;
        }
        get dc() {
            return this.get_dc();
        }
        get_du() {
            return false;
        }
        get du() {
            return this.get_du();
        }
        get_dy() {
            return false;
        }
        get dy() {
            return this.get_dy();
        }
        get_dm() {
            return !this.dy && !this.du && !this.dc;
        }
        get dm() {
            return this.get_dm();
        }
        get_dv() {
            return false;
        }
        get dv() {
            return this.get_dv();
        }
        fq(a) {
            return NaN;
        }
        get_dj() {
            return false;
        }
        get dj() {
            return this.get_dj();
        }
        get_dr() {
            return false;
        }
        get dr() {
            return this.get_dr();
        }
        get_ds() {
            return false;
        }
        get ds() {
            return this.get_ds();
        }
        get_dg() {
            return false;
        }
        get dg() {
            return this.get_dg();
        }
        get_di() {
            return true;
        }
        get di() {
            return this.get_di();
        }
        ap() {
            return this.an;
        }
        aj() {
            return new AnnotationBackingArrangedSize();
        }
        ke(a) {
        }
        kg(a) {
        }
        kf(a) {
            a.d = 0;
            a.e = 0;
            a.f = 0;
            a.c = 0;
        }
        get hk() {
            return this.hc;
        }
        get hj() {
            return this.hb;
        }
        ht(a) {
            let b = new ScalerParams(0, this.b7.za, this.b7.y9, this.dn, this.b7.yv);
            return this.f9(a, b);
        }
        ki(a, b, c, d, e) {
            let f = this.ox;
            this.ox = a;
            if (!e) {
                let g = a;
                let h = 0;
                let i = this.b7.yl(a);
                if (this.a1.c6.isEmpty) {
                    return;
                }
                let j = this.a1.c6;
                let k = { $type: Point_$type, x: this.a1.c6.x + (this.a1.c6.width * 0.5), y: this.a1.c6.y };
                if (this.du && this.dq && this.an != null && this.an.dc) {
                    if (this.hr != null) {
                        h = Convert.toDouble3(this.hr);
                        g = GeometryUtil.w(k, a, -h);
                    }
                }
                if (j.containsPoint(g)) {
                    let l = this.dy ? a.y : a.x;
                    let m = this.dj ? this.ht(l) : dateMinValue();
                    let n = !this.dj ? this.ht(l) : NaN;
                    if (!this.co) {
                        this.lo(new AxisMouseEventArgs(this, n, m, null, null, a, i));
                        this.co = true;
                    }
                    if (f.x != a.x || f.y != a.y) {
                        this.lq(new AxisMouseEventArgs(this, n, m, null, null, a, i));
                    }
                    if (c) {
                        this.ln(new AxisMouseEventArgs(this, n, m, null, null, a, i));
                        this.cp = true;
                    }
                    else if (d) {
                        this.lr(new AxisMouseEventArgs(this, n, m, null, null, a, i));
                        if (this.cp) {
                            this.lm(new AxisMouseEventArgs(this, n, m, null, null, a, i));
                        }
                        this.cp = false;
                    }
                }
                else if (this.co) {
                    let o = this.dy ? a.y : a.x;
                    let p = this.dj ? this.ht(o) : dateMinValue();
                    let q = !this.dj ? this.ht(o) : NaN;
                    this.lp(new AxisMouseEventArgs(this, q, p, null, null, a, i));
                    this.co = false;
                }
                let r = -1;
                let s = this.a1.bd;
                for (let t = s.count - 1; t >= 0; t--) {
                    let u = s._inner[t];
                    let v = false;
                    let w = this.er._inner[t].b;
                    if (w) {
                        r++;
                        let x = this.ce.count - 1;
                        let y = this.ce.item(x - r);
                        let z = new Rect(0, y.d, y.e, y.f, y.c);
                        v = z.containsPoint(a);
                        if (v) {
                            let aa = 0;
                        }
                    }
                    else {
                        if (this.a1.bg._inner[t].j != null) {
                            let ab = this.a1.bg._inner[t].j;
                            let ac = this.ow(u, ab, k, h);
                            let ad = this.a1.ad(u, ac);
                            if (PolygonUtil.a(ad, a)) {
                                v = true;
                            }
                        }
                        else {
                            v = u.containsPoint(a);
                        }
                    }
                    if (v) {
                        let ae = this.a1.bf._inner[t].f;
                        let af = this.a1.be._inner[t];
                        let ag = this.dj ? this.ht(ae) : dateMinValue();
                        let ah = !this.dj ? this.ht(ae) : NaN;
                        let ai = null;
                        let aj = null;
                        if (typeof af === 'string') {
                            ai = af;
                        }
                        else {
                            if (typeCast(ContentControl.$, af) !== null) {
                                aj = af.content;
                            }
                            else {
                                aj = af;
                            }
                        }
                        if (t != this.hk) {
                            if (this.hk != -1 && this.hk < this.a1.bf.count) {
                                let ak = this.a1.bf._inner[this.hk].f;
                                let al = this.dj ? this.ht(ak) : dateMinValue();
                                let am = !this.dj ? this.ht(ak) : NaN;
                                let an = this.a1.be._inner[this.hk];
                                let ao = null;
                                let ap = null;
                                if (typeof an === 'string') {
                                    ao = an;
                                }
                                else {
                                    if (typeCast(ContentControl.$, an) !== null) {
                                        ap = an.content;
                                    }
                                    else {
                                        ap = an;
                                    }
                                }
                                this.lj(new AxisMouseEventArgs(this, am, al, ao, ap, a, i));
                            }
                            this.hc = t;
                            this.hb = w ? this.ce.count - 1 - r : -1;
                            this.li(new AxisMouseEventArgs(this, ah, ag, ai, aj, a, i));
                        }
                        if (f.x != a.x || f.y != a.y) {
                            this.lk(new AxisMouseEventArgs(this, ah, ag, ai, aj, a, i));
                        }
                        if (c) {
                            this.lh(new AxisMouseEventArgs(this, ah, ag, ai, aj, a, i));
                            this.hl = t;
                        }
                        else if (d) {
                            this.ll(new AxisMouseEventArgs(this, ah, ag, ai, aj, a, i));
                            if (t == this.hl) {
                                this.lg(new AxisMouseEventArgs(this, ah, ag, ai, aj, a, i));
                                this.hl = -1;
                            }
                        }
                        return;
                    }
                }
            }
            if (this.hk != -1 && this.hk < this.a1.bf.count) {
                if (this.labelMouseLeave != null) {
                    let aq = this.b7.yl(a);
                    let ar = this.a1.bf._inner[this.hk].f;
                    let as = this.a1.be._inner[this.hk];
                    let at = null;
                    let au = null;
                    if (typeof as === 'string') {
                        at = as;
                    }
                    else {
                        if (typeCast(ContentControl.$, as) !== null) {
                            au = as.content;
                        }
                        else {
                            au = as;
                        }
                    }
                    let av = this.dj ? this.ht(ar) : dateMinValue();
                    let aw = !this.dj ? this.ht(ar) : NaN;
                    this.lj(new AxisMouseEventArgs(this, aw, av, at, au, a, aq));
                }
                this.hc = -1;
                this.hb = -1;
            }
            if (d) {
                this.hl = -1;
            }
        }
        ow(a, b, c, d) {
            let e = new TransformGroup();
            e.j.add(b);
            e.j.add(((() => {
                let $ret = new RotateTransform();
                $ret.j = d;
                $ret.k = c.x;
                $ret.l = c.y;
                return $ret;
            })()));
            return e;
        }
        c4() {
            return this.labelMouseDown != null;
        }
        lh(a) {
            if (this.labelMouseDown != null) {
                this.labelMouseDown(this, a);
            }
        }
        c8() {
            return this.labelMouseUp != null;
        }
        ll(a) {
            if (this.labelMouseUp != null) {
                this.labelMouseUp(this, a);
            }
        }
        c5() {
            return this.labelMouseEnter != null;
        }
        li(a) {
            if (this.labelMouseEnter != null) {
                this.labelMouseEnter(this, a);
            }
        }
        c6() {
            return this.labelMouseLeave != null;
        }
        lj(a) {
            if (this.labelMouseLeave != null) {
                this.labelMouseLeave(this, a);
            }
        }
        c7() {
            return this.labelMouseOver != null;
        }
        lk(a) {
            if (this.labelMouseOver != null) {
                this.labelMouseOver(this, a);
            }
        }
        c3() {
            return this.labelMouseClick != null;
        }
        lg(a) {
            if (this.labelMouseClick != null) {
                this.labelMouseClick(this, a);
            }
        }
        ln(a) {
            if (this.panelMouseDown != null) {
                this.panelMouseDown(this, a);
            }
        }
        lr(a) {
            if (this.panelMouseUp != null) {
                this.panelMouseUp(this, a);
            }
        }
        lo(a) {
            if (this.panelMouseEnter != null) {
                this.panelMouseEnter(this, a);
            }
        }
        lp(a) {
            if (this.panelMouseLeave != null) {
                this.panelMouseLeave(this, a);
            }
        }
        lq(a) {
            if (this.panelMouseOver != null) {
                this.panelMouseOver(this, a);
            }
        }
        lm(a) {
            if (this.panelMouseClick != null) {
                this.panelMouseClick(this, a);
            }
        }
        get bx() {
            if (this.bw == null) {
                this.bw = DVContainer.instance.createInstance(IAxisAnnotationManager_$type, () => this.cl.n);
                this.bw.owner = this;
            }
            return this.bw;
        }
        get dd() {
            return DVContainer.instance.checkLoaded("AnnotationFactoryManager");
        }
        kb(a, b) {
            if (!this.dd) {
                return;
            }
            this.bx.onAutoAnnotionsChanged(this, this.ar, b);
        }
        kc(a, b) {
            if (!this.dd) {
                return;
            }
            this.bx.onAutoAnnotionsReset(this, this.ar, b);
        }
        j9(a, b) {
            if (!this.dd) {
                return;
            }
            this.bx.onAnnotionsChanged(this, this.aq, b);
        }
        ka(a, b) {
            if (!this.dd) {
                return;
            }
            this.bx.onAnnotionsReset(this, this.aq, b);
        }
        provideRenderer(a) {
            ImageLoader.d = a;
            this.ha = a;
            this.kh();
            this.a1.ah = this.a4;
        }
        k3(a, b) {
            if (!a.equals1(b)) {
                this.md(a, b);
            }
        }
        ac() {
            super.ac();
            this.bp.au();
        }
        get cd() {
            return this.cc;
        }
        set cd(a) {
            if (this.cd != a) {
                let b = this.cd;
                this.cc = a;
                this.ls("FastItemsSourceProvider", b, this.cc);
            }
        }
        get b7() {
            return this.b6;
        }
        set b7(a) {
            if (this.b7 != a) {
                let b = this.b7;
                this.b6 = a;
                this.ls("SeriesViewer", b, this.b6);
            }
        }
        get b5() {
            return typeCast(XamDataChart.$, this.b7);
        }
        set b5(a) {
            this.b7 = a;
        }
        get ei() {
            return this.cr;
        }
        set ei(a) {
            if (this.cr == a) {
                return;
            }
            this.cr = a;
            let b = null;
            if (this.a1 != null && Rect.l_op_Inequality(this.a1.c6, null)) {
                b = this.a1.c6;
            }
            this.a1 = this.a0();
            this.a1.ae = this;
            this.a1.ah = this.a4;
            if (Rect.l_op_Inequality(b, null)) {
                this.a1.c6 = b;
            }
            if (this.b7 != null && this.b7.dw != null) {
                this.a1.ag.ak(this.b7.dw.y);
                this.lw(true);
            }
        }
        get gv() {
            return this.ez;
        }
        set gv(a) {
            let b = this.ez;
            if (b != a) {
                this.ez = a;
                this.fa = a;
                this.lw(true);
            }
        }
        get fa() {
            return this.et;
        }
        set fa(a) {
            this.et = a;
        }
        get g1() {
            return this.e5;
        }
        set g1(a) {
            this.e5 = a;
            this.lw(true);
        }
        get gy() {
            return this.e2;
        }
        set gy(a) {
            this.e2 = a;
            this.lw(true);
        }
        get ay() {
            return this.ax;
        }
        set ay(a) {
            let b = this.ax;
            if (b != a) {
                this.ax = a;
                this.lw(true);
            }
        }
        get gu() {
            return this.ey;
        }
        set gu(a) {
            this.ey = a;
            this.lv();
        }
        get g0() {
            return this.e4;
        }
        set g0(a) {
            this.e4 = a;
            this.lv();
        }
        get gx() {
            return this.e1;
        }
        set gx(a) {
            this.e1 = a;
            this.lv();
        }
        get cb() {
            if (this.b9 == null) {
                if (this.b8 == null) {
                    this.b8 = this.bp.j();
                }
                return this.b8;
            }
            return this.b9;
        }
        set cb(a) {
            this.b9 = a;
            this.e0 = FontUtil.getFontSize(this.b9);
            this.lv();
        }
        get ju() {
            return this.h1;
        }
        set ju(a) {
            this.h1 = a;
            let b = this.e0;
            if (isNaN_(b)) {
                b = 12;
            }
            this.cb.q = a;
            this.cb.f = b;
            this.a1.cc();
            this.lv();
        }
        get gw() {
            return this.e0;
        }
        set gw(a) {
            this.e0 = a;
            this.cb = FontUtil.getFontWithNewFontSize(this.cb, this.e0);
            this.lv();
        }
        get g2() {
            return this.e6;
        }
        set g2(a) {
            this.e6 = a;
            this.lv();
        }
        get gz() {
            return this.e3;
        }
        set gz(a) {
            this.e3 = a;
            this.lv();
        }
        get ho() {
            return this.hf;
        }
        set ho(a) {
            this.hf = a;
            this.lv();
        }
        get hn() {
            return this.he;
        }
        set hn(a) {
            this.he = a;
            this.lv();
        }
        get hm() {
            return this.hd;
        }
        set hm(a) {
            this.hd = a;
            this.lv();
        }
        get ph() {
            return this.pc;
        }
        set ph(a) {
            this.pc = a;
            this.lv();
        }
        get g4() {
            return this.e8;
        }
        set g4(a) {
            this.e8 = a;
            this.lv();
        }
        get g3() {
            return this.e7;
        }
        set g3(a) {
            this.e7 = a;
            this.lv();
        }
        l6() {
            this.a1.cu();
        }
        lv() {
            this.lw(false);
        }
        lw(a) {
            if (a) {
                this.a1.ct();
            }
            this.d0 = true;
            this.lu();
        }
        l9() {
            if (this.g6 > 0) {
                this.fc = this.g6;
                return;
            }
            let a = typeCast(XamDataChart.$, this.b7);
            if (a != null && isNaN_(this.g6) && this.df && (this.dy || this.bm == 0)) {
                this.fc = a.z3.ft;
                return;
            }
            this.fc = 0;
        }
        get c1() {
            return this.cn;
        }
        get da() {
            return this.a4 != null && this.a4.k();
        }
        l5(a) {
            this.cn = true;
            if (this.eu != a) {
                this.eu = a;
                this.ly(false);
            }
        }
        l0() {
            this.cn = false;
            this.eu = 0;
            this.ly(false);
        }
        f2() {
            if (this.c1 && (!this.da || (this.da && this.a4.angle == 0))) {
                return this.gj();
            }
            if (this.da) {
                return this.a4.angle;
            }
            return 0;
        }
        gj() {
            return this.eu;
        }
        get eg() {
            return this.c(Axis.n6);
        }
        set eg(a) {
            this.h(Axis.n6, a);
        }
        fs() {
            return 0;
        }
        n9() {
            if (this.dy) {
                return 2;
            }
            return 0;
        }
        pe() {
            return 1;
        }
        oa() {
            return 1;
        }
        pf() {
            return 1;
        }
        fu() {
            if (this.dy) {
                return DeviceUtils.g(5);
            }
            return 0;
        }
        fw() {
            if (!this.dy && !this.dc) {
                return DeviceUtils.g(5);
            }
            return 0;
        }
        fv() {
            if (this.dy) {
                return DeviceUtils.g(5);
            }
            return 0;
        }
        ft() {
            if (!this.dy && !this.dc) {
                return DeviceUtils.g(5);
            }
            return 0;
        }
        fz() {
            return NaN;
        }
        f1() {
            return NaN;
        }
        f0() {
            return NaN;
        }
        fy() {
            return NaN;
        }
        a6() {
            if (this.dy) {
                return 2;
            }
            if (this.du) {
                return 5;
            }
            return 1;
        }
        a7() {
            return 1;
        }
        lt(a) {
            if (this.rangeChanged != null) {
                this.rangeChanged(this, a);
            }
        }
        fx() {
            if (this.dy) {
                return -90;
            }
            return 0;
        }
        fr() {
            return NaN;
        }
        get as() {
            return this.aq;
        }
        get at() {
            return this.ar;
        }
        i6(a) {
            return null;
        }
        get o6() {
            if (this.o5.isEmpty) {
                return this.oy;
            }
            return this.o5;
        }
        set o6(a) {
            this.oy = a;
        }
        ma() {
            let a = 0;
            let b = typeCast(XamDataChart.$, this.b7);
            if (b != null && b.zu == 0) {
                a = 1;
            }
            this.bp.a7(a);
        }
        ek(a, b, c) {
            return this.b7 != null;
        }
        dx() {
            let a = Rect.empty;
            if (this.b7 != null) {
                a = this.b7.za;
            }
            return this.ek(this.o6, a, this.bp);
        }
        md(a, b) {
            this.d1 = false;
            this.o6 = b;
            this.d0 = true;
            this.ed();
            this.ly(false);
            if (this.b7 != null) {
                this.b7.a3.ae(1, this, this.bq, b);
            }
        }
        get d0() {
            return this.cq;
        }
        set d0(a) {
            this.cq = a;
        }
        o3() {
            if (this.b7 == null || this.b7.yv.isEmpty) {
                return Rect.empty;
            }
            let a = this.b7.yv;
            let b = this.o6;
            let c = (a.left - b.left) / b.width;
            let d = (a.top - b.top) / b.height;
            let e = (a.right - b.left) / b.width;
            let f = (a.bottom - b.top) / b.height;
            return new Rect(0, c, d, e - c, f - d);
        }
        me(a, b) {
            this.oz = b;
            this.d0 = true;
            this.ly(true);
        }
        lu() {
            this.ly(false);
        }
        la(a, b, c, d) {
            if (stringContains(b, "CompanionAxis")) {
                this.kt(b, c, d);
            }
            switch (b) {
                case Axis.$$p[38]:
                case Axis.$$p[39]:
                    if (this.jb != null) {
                        this.ai = new BindingFormatter();
                        this.ai.j = this.jb;
                        this.ai.d = this.ah;
                    }
                    else {
                        this.ai = null;
                    }
                    break;
                case "SeriesViewer":
                    let e = typeCast(SeriesViewer.$, c);
                    if (e != null) {
                        this.ha = null;
                        e.actualWindowRectChanged = delegateRemove(e.actualWindowRectChanged, this.cj);
                        e.a3.ad(1, this);
                        this.bp.al(e);
                    }
                    let f = typeCast(SeriesViewer.$, d);
                    if (f != null) {
                        this.ha = f.dw.j.ae;
                        this.oz = f.yr;
                        f.actualWindowRectChanged = delegateCombine(f.actualWindowRectChanged, this.cj);
                        this.bq = f.a3.k(1, this, runOn(this, this.ky));
                        if (this.a4 == null && this.ha != null) {
                            this.provideRenderer(this.ha);
                        }
                        this.bp.ae(f);
                        if (this.d2 && !this.bq.e) {
                            this.d2 = false;
                            this.ed();
                        }
                        this.l8();
                        this.l9();
                    }
                    break;
                case Axis.$$p[36]:
                    this.ly(false);
                    break;
                case Axis.$$p[50]:
                    this.d9 = this.d8;
                    this.ly(false);
                    break;
                case Axis.$$p[49]:
                    this.d7 = this.d6;
                    this.ly(false);
                    break;
                case Axis.$$p[37]:
                    this.dp = this.dn;
                    let g = new AxisRangeChangedEventArgs(0, 0, 0, 1, 1);
                    this.kx(g);
                    for (let h of fromEnum(this.es)) {
                        h.qp();
                        if (h.dc != null) {
                            h.q0();
                        }
                    }
                    break;
                case Axis.$$p[40]:
                    this.bp.as();
                    if (typeCast(DataTemplate.$, d) !== null) {
                        this.ej = true;
                    }
                    else {
                        this.ej = false;
                    }
                    this.d0 = true;
                    this.l2();
                    this.ly(false);
                    break;
                case Axis.$$p[44]:
                case Axis.$$p[47]:
                case Axis.$$p[54]:
                    this.ly(false);
                    break;
                case Axis.$$p[41]:
                    let i = typeCast(AxisLabelSettings.$, d);
                    if (i != null) {
                        i.registerAxis(this);
                        this.a2 = i;
                    }
                    else {
                        this.a2 = new AxisLabelSettings();
                    }
                    if (this.a1 != null) {
                        this.a1.ah = this.a2;
                    }
                    this.k8();
                    this.d0 = true;
                    this.ly(false);
                    break;
                case Axis.$$p[59]:
                    this.bp.av();
                    break;
                case Axis.$$p[60]:
                    let j = typeCast(TitleSettings.$, d);
                    if (j != null) {
                        j.registerAxis(this);
                    }
                    else {
                        j = new TitleSettings();
                    }
                    if (this.mg != null) {
                        this.mg.dataContext = j;
                    }
                    this.k9();
                    this.ly(false);
                    break;
                case Axis.$$p[55]:
                    this.d0 = true;
                    this.l9();
                    this.bp.ao();
                    this.ly(false);
                    break;
                case Axis.$$p[61]:
                case Axis.$$p[33]:
                case "UseEnhancedIntervalManagement":
                case Axis.$$p[34]:
                    this.cs = this.eh;
                    this.d0 = true;
                    this.ly(false);
                    break;
                case Axis.$$p[31]:
                    if (this.b7 != null) {
                        this.b7.pr();
                    }
                    break;
                case Axis.$$p[46]:
                    this.l8();
                    if (d != null) {
                        this.ea = true;
                        this.ly(false);
                    }
                    else {
                        this.ea = false;
                    }
                    break;
                case Axis.$$p[32]:
                    if (this.an != null) {
                        this.an.lx();
                    }
                    break;
                case Axis.$$p[53]:
                case Axis.$$p[43]:
                    this.l8();
                    this.ly(false);
                    break;
                case Axis.$$p[52]:
                case Axis.$$p[42]:
                case Axis.$$p[45]:
                case Axis.$$p[35]:
                case Axis.$$p[57]:
                case Axis.$$p[58]:
                case Axis.$$p[56]:
                case Axis.$$p[2]:
                case Axis.$$p[0]:
                case Axis.$$p[1]:
                case Axis.$$p[51]:
                    this.ly(false);
                    break;
                case "MinExtent":
                    this.bp.ao();
                    break;
            }
        }
        dw(a) {
            return this.en.containsKey(a);
        }
        kt(a, b, c) {
            if (!stringContains(a, "CompanionAxis")) {
                return;
            }
            if (this.en.containsKey(a)) {
                if (c == null || this.en.item(a) == c) {
                    this.en.removeItem(a);
                }
            }
            else {
                this.en.addItem(a, b);
            }
            switch (a) {
                case Axis.$$p[5]:
                    this.kv();
                    break;
                case Axis.$$p[26]:
                    this.ku();
                    break;
                case Axis.$$p[6]:
                case Axis.$$p[23]:
                case Axis.$$p[24]:
                case Axis.$$p[25]:
                case Axis.$$p[15]:
                case Axis.$$p[16]:
                case Axis.$$p[18]:
                case Axis.$$p[19]:
                case Axis.$$p[28]:
                case Axis.$$p[29]:
                case Axis.$$p[27]:
                case Axis.$$p[7]:
                case Axis.$$p[8]:
                case Axis.$$p[9]:
                case Axis.$$p[12]:
                case Axis.$$p[11]:
                case Axis.$$p[13]:
                case Axis.$$p[10]:
                case Axis.$$p[14]:
                case Axis.$$p[30]:
                case Axis.$$p[3]:
                case Axis.$$p[4]:
                case Axis.$$p[20]:
                case Axis.$$p[21]:
                case Axis.$$p[22]:
                    this.kw(a);
                    break;
            }
        }
        kw(a) {
            switch (a) {
                case Axis.$$p[30]:
                case Axis.$$p[6]:
                case Axis.$$p[16]:
                case Axis.$$p[19]:
                case Axis.$$p[29]:
                case Axis.$$p[28]:
                case Axis.$$p[27]:
                case Axis.$$p[25]:
                case Axis.$$p[3]:
                case Axis.$$p[4]:
                case Axis.$$p[20]:
                case Axis.$$p[21]:
                case Axis.$$p[22]:
                    this.ks(a);
                    break;
                case Axis.$$p[23]:
                case Axis.$$p[24]:
                case Axis.$$p[15]:
                case Axis.$$p[18]:
                    this.kr(a);
                    break;
                case Axis.$$p[7]:
                case Axis.$$p[8]:
                case Axis.$$p[9]:
                case Axis.$$p[12]:
                case Axis.$$p[11]:
                case Axis.$$p[13]:
                case Axis.$$p[10]:
                case Axis.$$p[14]:
                    this.kq("LabelSettings");
                    break;
            }
        }
        kq(a) {
            if (this.b5 != null && this.dt) {
                this.b5.zi(this.b5).y(this, a);
            }
        }
        kr(a) {
            let b = stringReplace(a, "CompanionAxis", "Actual");
            this.kq(b);
        }
        ks(a) {
            let b = stringReplace(a, "CompanionAxis", "");
            this.kq(b);
        }
        k8() {
            if (this.bp.r()) {
                this.bp.ah(this.a2);
            }
        }
        k9() {
            this.bp.av();
        }
        get coercionMethods() {
            return this._coercionMethods;
        }
        set coercionMethods(a) {
            this._coercionMethods = a;
        }
        get_expectFunctions() {
            return this.cm;
        }
        set_expectFunctions(a) {
            this.cm = a;
        }
        get expectFunctions() {
            return this.get_expectFunctions();
        }
        set expectFunctions(a) {
            this.set_expectFunctions(a);
        }
        l2() {
            this.ci.count = 0;
            this.ch.count = 0;
            this.cf.count = 0;
            this.ce.count = 0;
            this.cg.count = 0;
            if (this.bp.r()) {
                this.bp.az();
            }
        }
        k5(a, b, c, d) {
            let e = Math.min(b, c);
            let f = Math.max(b, c);
            if (e < d.bottom && f > d.top) {
                let g = new RectangleGeometry();
                g.e = new Rect(0, d.left, e, d.width, f - e);
                a.add(g);
            }
        }
        k4(a, b, c, d, e) {
            let f = b <= c.bottom && b >= c.top;
            if (!e && f) {
                f = !this.dl(b, d.c, c, false);
            }
            if (f) {
                if (d.a) {
                    b = this.fd(b, c.top, c.bottom, d);
                }
                let 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);
            }
        }
        mc(a, b, c, d) {
            let e = Math.min(b, c);
            let f = Math.max(b, c);
            if (f > d.left && e < d.right) {
                let g = new RectangleGeometry();
                g.e = new Rect(0, e, d.top, f - e, d.height);
                a.add(g);
            }
        }
        mb(a, b, c, d, e) {
            let f = b >= c.left && b <= c.right;
            if (!f) {
                let g = truncate(Math.round(b));
                let h = truncate(Math.round(c.left));
                let i = truncate(Math.round(c.right));
                if (g >= h && g <= i) {
                    f = true;
                }
            }
            if (!e && f) {
                f = !this.dl(b, d.c, c, true);
            }
            if (f) {
                if (d.a) {
                    b = this.fd(b, c.left, c.right, d);
                }
                let 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);
            }
        }
        dl(a, b, c, d) {
            let e = false;
            let f = typeCast(XamDataChart.$, this.b7);
            if (f != null && (f.aam || f.aan) && !c.isEmpty) {
                let g = this.b7.yr.width == 1 && this.b7.yr.height == 1;
                for (let h of fromEnum(f.zq)) {
                    if (h._visibility != 0 || h.g5 < 1 || h.oe == null || BrushUtilCore.a(h.oe) || h.o6.isEmpty) {
                        continue;
                    }
                    if (h.an != null && h.c2()) {
                        if (f.aam) {
                            let i = this.dy ? c.left : c.top;
                            let j = 0;
                            let k = h.l4(i, j, h.b7.za, c, h.o1(), d ? c.left : c.top, d ? c.right : c.bottom);
                            i = k.p0;
                            j = k.p1;
                            let l = Rect.empty;
                            let m = Rect.empty;
                            if (d && h.dy) {
                                l = new Rect(0, i - (h.g5 / 2), h.o6.top, h.g5, h.o6.height);
                                m = new Rect(0, a - (b / 2), c.top, b, c.height);
                            }
                            else if (!d && !h.dy) {
                                l = new Rect(0, h.o6.left, i - (h.g5 / 2), h.o6.width, h.g5);
                                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 {
                        let n = Rect.empty;
                        let o = Rect.empty;
                        if (d && h.dy) {
                            n = new Rect(0, h.o6.left, h.o6.top, h.g5, h.o6.height);
                            o = new Rect(0, a - (b / 2), c.top, b, c.height);
                        }
                        else if (!d && !h.dy) {
                            n = new Rect(0, h.o6.left, h.o6.bottom - (h.g5 / 2), h.o6.width, h.g5);
                            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.aan) {
                            let p = f.abh;
                            if (isNaN_(p)) {
                                if (d && h.dy) {
                                    p = 0;
                                    p = Math.max(p, f.aa9);
                                    p = Math.max(p, f.aa6);
                                }
                                else if (!d && !h.dy) {
                                    p = 0;
                                    p = Math.max(p, f.aa7);
                                    p = Math.max(p, f.aa8);
                                }
                                p += 1;
                            }
                            p *= 2;
                            if (d && h.dy) {
                                n = new Rect(0, h.o6.left, h.o6.top, h.g5, h.o6.height);
                                o = new Rect(0, a - (p / 2), c.top, p, c.height);
                            }
                            else if (!d && !h.dy) {
                                n = new Rect(0, h.o6.left, h.o6.bottom - (h.g5 / 2), h.o6.width, h.g5);
                                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;
                            }
                        }
                    }
                }
            }
            return e;
        }
        l4(a, b, c, d, e, f, g) {
            let h = Math.abs(f - g);
            if (typeCast(Date_$type, this.hr) !== null) {
                a = this.hr.getTime();
                a = this.an.gt(a);
            }
            else {
                a = this.hr;
                a = this.an.gt(a);
            }
            let i = typeCast(CategoryAxisBase.$, this.an);
            if (i != null && i.categoryMode == 2) {
                let j = 0.5 * i.getCategorySize(c, d, e);
                let k = i.bm == 0;
                if (i.dn == 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
            };
        }
        fd(a, b, c, d) {
            let e = a;
            if (d != null && d.c > 0) {
                let f = d.c % 2;
                if (f == 0 || f == 1) {
                    let 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;
        }
        kk(a) {
            this.bp.ak(a);
        }
        kj() {
            this.ci.count = 0;
            this.ch.count = 0;
            this.cf.count = 0;
            this.cg.count = 0;
            this.bp.ai();
            this.eq.clear();
            this.er.clear();
        }
        lx() {
            this.ly(false);
        }
        ly(a) {
            if (this.b7 != null) {
                this.b7.a3.ac(1, this, this.bq, a);
                if (this.renderRequested != null) {
                    let b = new RenderRequestedEventArgs();
                    b.animate = a;
                    this.renderRequested(this, b);
                    a = b.animate;
                }
            }
        }
        gn() {
            if (this.b1 == null) {
                return -1;
            }
            if (isNaN_(this.b1.b)) {
                return -1;
            }
            if (this.f2() != 0) {
                return -1;
            }
            let a = this.b1.b;
            let b = this.gr();
            let c = this.go();
            a = a + b + c;
            return Math.max(Axis.gg, a);
        }
        gr() {
            if (this.a4 == null) {
                return 0;
            }
            else {
                return this.a4.topMargin;
            }
        }
        gp() {
            if (this.a4 == null) {
                return 0;
            }
            else {
                return this.a4.leftMargin;
            }
        }
        gq() {
            if (this.a4 == null) {
                return 0;
            }
            else {
                return this.a4.rightMargin;
            }
        }
        go() {
            if (this.a4 == null) {
                return 0;
            }
            else {
                return this.a4.bottomMargin;
            }
        }
        gl() {
            if (this.b1 == null) {
                return -1;
            }
            if (isNaN_(this.b1.d) && isNaN_(this.ew)) {
                return -1;
            }
            if (this.a4 != null && (this.a4.angle != 0)) {
                return -1;
            }
            let a = this.b1.d;
            if (!isNaN_(this.ew) && this.hi == -1) {
                return this.ew;
            }
            return Math.max(Axis.gg, this.b1.d);
        }
        fo(a, b, c, d, e) {
            if (a == 1) {
                return 1;
            }
            if (b) {
                return a;
            }
            let f = 0;
            let g = this.gd(a, b, c, d, e);
            if (!b && f < 10 && this.eb(g, a, c, d, e)) {
                a = g;
                g = a - 1;
                f += 1;
                while (!b && f < 10 && this.eb(g, a, c, d, e)) {
                    a = g;
                    g = a - 1;
                    f += 1;
                }
            }
            return a;
        }
        gd(a, b, c, d, e) {
            let f = false;
            if (this.dy) {
                f = this.df && this.cy && this.b1 != null;
            }
            else {
                f = this.df && this.cy && this.c9();
            }
            if (f) {
                let g = this.f3(a, c, d, e);
                if (isNaN_(g)) {
                    return a;
                }
                let h = this.f4(a, c, d, e);
                if (g <= h) {
                    return a;
                }
                let i = Math.ceil((h / g) * a) + 1;
                if (f && i == a) {
                    i--;
                }
                return i;
            }
            return a;
        }
        f4(a, b, c, d) {
            if (this.dy) {
                let e = this.b1.b;
                return e;
            }
            else {
                let f = this.ew;
                if (this.b7 != null && this.b7.go) {
                    f = this.b1.b;
                }
                return f;
            }
        }
        eb(a, b, c, d, e) {
            if (this.dy) {
                if (this.df && this.cy && this.b1 != null) {
                    let f = this.b1.b;
                    if (a >= 1) {
                        let g = a;
                        if (g < 1) {
                            return false;
                        }
                        let h = this.f3(g, c, d, e);
                        if (isNaN_(h)) {
                            return false;
                        }
                        if (h > f) {
                            return true;
                        }
                    }
                }
            }
            else {
                if (this.df && this.cy && this.c9()) {
                    if (a >= 1) {
                        let i = a;
                        if (i < 1) {
                            return false;
                        }
                        let j = this.f3(i, c, d, e);
                        if (isNaN_(j)) {
                            return false;
                        }
                        let k = this.ew;
                        if (this.b7 != null && this.b7.go) {
                            k = this.b1.b;
                        }
                        if (j > k) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
        f3(a, b, c, d) {
            return NaN;
        }
        gm() {
            if (this.dy) {
                return this.gn();
            }
            else {
                return this.gl();
            }
        }
        get ec() {
            return this.hi == -1;
        }
        ky(a) {
            if (this.bp.p()) {
                return;
            }
            let b = 0;
            let c = 0;
            if (this.er != null && this.er.count > 0) {
                b = this.er._inner[this.er.count - 1].h;
                c = this.er.count;
            }
            if (this.d0 && this.eg) {
                this.b1 = this.b0();
            }
            this.bp.af();
            this.lz(a);
            this.bp.aw();
            if (!this.dy && this.d0 && this.eg && this.ec) {
                if (this.cz()) {
                    this.bp.af();
                    this.lz(a);
                    this.bp.aw();
                }
            }
            let d = 1;
            let e = 0;
            if (this.er != null && this.er.count > 0) {
                d = this.er._inner[this.er.count - 1].h;
                e = this.er.count;
            }
            if (this.ei) {
                this.d0 = true;
            }
            let f = false;
            if (d != b || e != c || this.d0) {
                this.d0 = false;
                if (this.bp.r()) {
                    this.bp.ao();
                    f = true;
                }
            }
            this.bp.an();
            if (!f) {
                this.kz();
            }
        }
        cz() {
            if (!isNaN_(this.ew) || this.eq == null || this.eq.count == 0) {
                return false;
            }
            let a = this.ca();
            if (a == null) {
                return false;
            }
            let b = -1.7976931348623157E+308;
            for (let c = 0; c < this.eq.count; c++) {
                let d = this.eq._inner[c];
                if (typeof d === 'string') {
                    let e = FontUtil.measureStringWidth(d, a, this.bp.l);
                    b = Math.max(e, b);
                }
            }
            b += 5;
            if (this.a4 != null) {
                b += this.a4.leftMargin + this.a4.rightMargin;
            }
            this.ew = b;
            return true;
        }
        l1() {
            this.ew = NaN;
            this.ly(false);
        }
        c9() {
            return !isNaN_(this.ew) && this.hi == -1;
        }
        fe(a, b) {
            return a;
        }
        l3() {
            this.ew = NaN;
        }
        b0() {
            let a = this.ca();
            if (a == null) {
                return null;
            }
            if (a.f == 0) {
                return null;
            }
            let b = "W";
            if (this.bp.l == null) {
                return null;
            }
            let c = FontUtil.measureStringWidth(b, a, this.bp.l);
            if (this.ex != c || this.b1 == null) {
                this.ex = c;
                let d = FontUtil.getCurrentFontHeight(this.b7.dw.j.ae, a);
                if (this.b1 == null) {
                    this.b1 = new LabelFontHeuristics();
                }
                this.b1.b = d;
                this.b1.c = this.hi;
                this.b1.a = this.cy;
                this.b1.e = c;
                this.b1.d = this.b1.e * this.b1.c;
            }
            return this.b1;
        }
        ca() {
            let a = null;
            if (this.b7 != null) {
                a = this.b7.getFontInfo();
            }
            if (this.a4 != null && this.a4.j) {
                if (this.b7 != null) {
                    a = this.a4.h(this.b7.dw.j.ae);
                }
            }
            return a;
        }
        kz() {
            if (!this.bp.r()) {
                return;
            }
            if (!this.db()) {
                this.bp.am();
            }
        }
        ed() {
            return this.ee(false);
        }
        ee(a) {
            if (a || this.b7 == null) {
                let b = this.ef();
                if (b) {
                    this.d0 = true;
                }
                this.d2 = false;
                return b;
            }
            if (!this.d2) {
                this.d2 = true;
                this.b7.a3.ab(this, this.bq);
            }
            return false;
        }
        ef() {
            return false;
        }
        kl() {
        }
        lz(a) {
            if (this.mg != null) {
                if ((this.b4 == null || this.b4.visibility == 0) && (this.a4 == null || this.a4.visibility == 0) && this.j3 != null) {
                    this.mg._visibility = 0;
                }
                else {
                    this.mg._visibility = 1;
                }
            }
        }
        l8() {
            let a = typeCast(XamDataChart.$, this.b7);
            if (a == null) {
                return;
            }
            let b = null, c = null, d = null;
            if (this.df && !this.dc) {
                b = a.adv;
                for (let e of fromEnum(this.es)) {
                    if (e.fz || e.fw || e.fs || e.fw) {
                        c = a.adt;
                        d = a.adu;
                        break;
                    }
                }
            }
            else if (this.dq && !this.dc) {
                c = a.adt;
                d = a.adu;
                b = this.an != null ? a.adv : null;
                for (let f of fromEnum(this.es)) {
                    if (f.fz || f.fw || f.fs || f.fw) {
                        b = a.adv;
                        break;
                    }
                }
            }
            else if (this.dc || this.bm == 3) {
                b = a.adv;
                c = a.adt;
                d = a.adu;
            }
            this.oe = this.op != null ? this.op : b;
            this.oc = this.ol != null ? this.ol : c;
            this.od = this.om != null ? this.om : d;
        }
        ls(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));
            }
        }
        d3(a) {
            let b = this.es.contains(a);
            if (!b) {
                this.es.add(a);
            }
            this.l8();
            return !b;
        }
        cx(a) {
            let b = this.es.contains(a);
            if (b) {
                this.es.remove(a);
            }
            this.l8();
            return b;
        }
        hu(a, b) {
            let c = this.jn(b);
            if (c == Axis.$$p[40]) {
                return this.hv(a, b, this.hx);
            }
            return null;
        }
        i7() {
            return null;
        }
        dz(a) {
            if (this.b7 != null) {
                let b = AxisMatcherHelper.a(this.b7, a);
                if (b != null && b.length == 1) {
                    return true;
                }
            }
            return false;
        }
        a9() {
            let a = this.i7();
            if (a != null) {
                let b = this.i6(a);
                if (b != null) {
                    let c = ((() => {
                        let $ret = new AxisMatcher();
                        $ret.h = a;
                        $ret.g = b;
                        return $ret;
                    })());
                    if (this.dz(c)) {
                        return c;
                    }
                }
            }
            if (this.name != null) {
                let d = ((() => {
                    let $ret = new AxisMatcher();
                    $ret.i = this.name;
                    return $ret;
                })());
                if (this.dz(d)) {
                    return d;
                }
            }
            if (this.j3 != null && typeof this.j3 === 'string') {
                let e = ((() => {
                    let $ret = new AxisMatcher();
                    $ret.j = this.j3;
                    return $ret;
                })());
                if (this.dz(e)) {
                    return e;
                }
            }
            let f = stringReplace(getInstanceType(this).typeName, "Axis", "");
            let g = 0;
            if (this.b7 != null) {
                let h = new List$1(Axis.$, 0);
                for (let i = 0; i < this.b7.zq.count; i++) {
                    let j = this.b7.zq._inner[i];
                    let k = stringReplace(getInstanceType(j).typeName, "Axis", "");
                    if (Base.equalsStatic(k, f)) {
                        h.add(j);
                    }
                }
                let l = h.indexOf(this);
                g = l;
            }
            let m = new AxisMatcher();
            m.f = f;
            m.e = g;
            return m;
        }
        jn(a) {
            if (!this.em.containsKey(a)) {
                let b = a.charAt(0).toUpperCase() + a.substr(1);
                this.em.addItem(a, b);
            }
            return this.em.item(a);
        }
        hv(a, b, c) {
            let d = null;
            if (!this.el.containsKey(b)) {
                d = new FastReflectionHelper(false, c);
                this.el.addItem(b, d);
            }
            else {
                d = this.el.item(b);
            }
            d.propertyName = c;
            return d.getPropertyValue(a);
        }
        hw(a) {
            return this.bp.t(a);
        }
        i8(a) {
            return this.bp.v(a);
        }
        gi() {
            return NaN;
        }
        f6(a, b) {
            return 0;
        }
        f7(a, b, c) {
            return 0;
        }
        o2(a) {
            if (this.b7 == null) {
                return Rect.empty;
            }
            if (!a.equals1(this.o6)) {
                return Rect.empty;
            }
            return this.b7.yv;
        }
        o1() {
            if (this.b7 == null) {
                return Rect.empty;
            }
            return this.b7.yv;
        }
        o0() {
            if (this.b7 == null || this.b7.yu.isEmpty) {
                return this.o6;
            }
            return this.b7.yu;
        }
        o4(a, b) {
            if (b.isEmpty) {
                return a;
            }
            return b;
        }
        f8(a, b, c) {
            let d = this.o2(c);
            let e = new ScalerParams(0, b, c, this.dn, d);
            return this.f6(a, e);
        }
        k1(a, b, c, d) {
        }
        k0(a, b, c, d, e) {
        }
        f9(a, b) {
            return 0;
        }
        ga(a, b, c) {
            return 0;
        }
        gb(a, b, c) {
            let d = this.o2(c);
            let e = new ScalerParams(0, b, c, this.dn, d);
            return this.f9(a, e);
        }
        k2(a, b, c, d) {
        }
        gt(a) {
            let b = this.o1();
            let c = new ScalerParams(0, this.b7.yr, this.o6, this.dn, b);
            return this.f6(a, c);
        }
        k7(a) {
            let b = false;
            if (this.pb.width == 0 || this.pb.height == 0) {
                this.o5 = new Rect(0, 0, 0, a.width, a.height);
            }
            else {
                b = true;
                this.o5 = new Rect(0, 0, 0, this.pb.width, this.pb.height);
            }
            if (b) {
                this.bq.c = true;
                this.d0 = true;
                this.a1.cm();
                this.ee(true);
            }
        }
        l7() {
            this.o5 = Rect.empty;
            this.a1.cv();
        }
        av() {
            this.au.a = this.a1;
            return this.au;
        }
        get gf() {
            return this.ev;
        }
        set gf(a) {
            let b = this.gf;
            if (a != b) {
                this.ev = a;
                this.ls("MinExtent", b, this.gf);
            }
        }
        db() {
            if (!isNaN_(this.fp)) {
                return true;
            }
            if (this.a4 == null) {
                return false;
            }
            else {
                return this.a4.l();
            }
        }
        gc() {
            if (!isNaN_(this.fp)) {
                return this.fp;
            }
            if (this.a4 == null) {
                return 50;
            }
            return this.a4.extent;
        }
        kh() {
            this.bp.ad();
        }
        kx(a) {
            this.lt(a);
        }
        get o7() {
            return this.aw().a;
        }
        get o8() {
            return this.aw().b;
        }
        get pa() {
            return this.bp.d().d;
        }
        get o9() {
            return this.aw().c;
        }
        b3() {
            return SyncManager.a(this.b6);
        }
        aw() {
            return this.bp.d();
        }
        get a3() {
            return this.a2;
        }
        lb(a, b) {
            if (this.a1 != null) {
                this.a1.cn(a);
            }
            this.bp.aq(a, b);
        }
        c2() {
            return this.hr != null;
        }
        hs() {
            return this.bz.exportVisualData(this);
        }
        *_eo() {
            for (let a = 0; a < this.es.count; a++) {
                let b = this.es._inner[a];
                yield b;
            }
        }
        eo() {
            return toEnum(() => this._eo());
        }
        ep() {
            let a = new List$1(Series.$, 0);
            for (let b = 0; b < this.es.count; b++) {
                let c = this.es._inner[b];
                a.add(c);
            }
            if (this.b7 != null && this.b7.b9 != null) {
                for (let d of fromEnum(this.b7.b9)) {
                    if (d.eq) {
                        a.add(d);
                    }
                }
            }
            return a;
        }
        lc(a) {
        }
        lf(a) {
        }
        le(a) {
        }
        ov(a, b, c, d, e) {
            if (this.dy) {
                let 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 {
                let 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;
            }
        }
        get dt() {
            return !this.dh;
        }
        ku() {
            if (this.ct) {
                this.kw("CompanionAxisIsInverted");
                this.kw("CompanionAxisStrip");
                this.kw("CompanionAxisStroke");
                this.kw("CompanionAxisStrokeThickness");
                this.kw("CompanionAxisMajorStroke");
                this.kw("CompanionAxisMajorStrokeThickness");
                this.kw("CompanionAxisMinorStroke");
                this.kw("CompanionAxisMinorStrokeThickness");
                this.kw("CompanionAxisTickStroke");
                this.kw("CompanionAxisTickStrokeThickness");
                this.kw("CompanionAxisTickLength");
                this.kw("CompanionAxisLabelAngle");
                this.kw("CompanionAxisLabelColor");
                this.kw("CompanionAxisLabelLocation");
                this.kw("CompanionAxisLabelExtent");
                this.kw("CompanionAxisTitle");
                this.kw("CompanionAxisShouldAvoidAnnotationCollisions");
                this.kw("CompanionAxisShouldAutoTruncateAnnotations");
                this.kw("CompanionAxisShouldKeepAnnotationsInView");
            }
        }
        kv() {
            if (this.b5 == null) {
                return;
            }
            if (this.ct) {
                this.b5.zi(this.b5).b(this);
            }
            else {
                this.b5.zi(this.b5).w(this);
            }
        }
        al() {
            return null;
        }
        ak() {
            let a = this.al();
            if (a == null) {
                return null;
            }
            Axis.hh++;
            if (stringIsNullOrEmpty(this.name)) {
                a.name = "CompanionAxis" + Axis.hh;
            }
            else {
                a.name = this.name + "_CompanionAxis";
            }
            a.cu = true;
            this.km(a);
            a.cu = false;
            let msg2_ = this.j6 + " CloneAxis done";
            return a;
        }
        km(a) {
            a.a4 = new AxisLabelSettings();
            this.ko(a);
            this.kp(a, "IsInverted");
            this.kp(a, "CrossingValue");
            this.kp(a, "CrossingAxis");
            this.kp(a, "EnhancedIntervalPreferMoreCategoryLabels");
            this.kp(a, "EnhancedIntervalMinimumCharacters");
            this.kp(a, "UseEnhancedIntervalManagement");
            this.kp(a, "UsePerLabelHeightMeasurement");
            this.kp(a, "ShouldAvoidAnnotationCollisions");
            this.kp(a, "ShouldAutoTruncateAnnotations");
            this.kp(a, "ShouldKeepAnnotationsInView");
            this.kp(a, "ActualStroke");
            this.kp(a, "ActualMajorStroke");
            this.kp(a, "ActualMinorStroke");
            this.kp(a, "StrokeThickness");
            this.kp(a, "MajorStrokeThickness");
            this.kp(a, "MinorStrokeThickness");
            this.kp(a, "TickStrokeThickness");
            this.kp(a, "TickStroke");
            this.kp(a, "TickLength");
            this.kp(a, "Strip");
            this.kp(a, "Title");
            this.kp(a, "MinExtent");
            this.kp(a, "Label");
        }
        kp(a, b) {
            if (a == null) {
                return;
            }
            let c = this;
            if (b == "Title") {
                if (this.dw("CompanionAxisTitle")) {
                    a.j3 = c.iy;
                }
            }
            if (b == "Label") {
                a.hx = c.hx;
            }
            if (b == "IsInverted") {
                a.dn = Axis.d4(c.br, c.dn);
            }
            if (b == "CrossingAxis") {
                a.an = c.am != null ? c.am : c.an;
            }
            if (b == "CrossingValue") {
                let d = this.hr;
                a.hr = Axis.gs(c.ff, d);
            }
            if (b == "EnhancedIntervalPreferMoreCategoryLabels") {
                a.cy = c.cy;
            }
            if (b == "EnhancedIntervalMinimumCharacters") {
                a.hi = c.hi;
            }
            if (b == "UseEnhancedIntervalManagement") {
                a.eg = c.eg;
            }
            if (b == "UsePerLabelHeightMeasurement") {
                a.eh = c.eh;
            }
            if (b == "LabelSettings") {
                this.ko(a);
            }
            if (b == "Strip") {
                a.oo = Axis.on(c.oi, c.oo);
            }
            if (b == "ActualStroke") {
                a.op = Axis.on(c.oj, c.oe);
            }
            if (b == "StrokeThickness") {
                a.g5 = Axis.gs(c.fl, c.g5);
            }
            if (b == "ActualMajorStroke") {
                a.ol = Axis.on(c.og, c.oc);
            }
            if (b == "MajorStrokeThickness") {
                a.ge = Axis.gs(c.fi, c.ge);
            }
            if (b == "ActualMinorStroke") {
                a.om = Axis.on(c.oh, c.od);
            }
            if (b == "MinorStrokeThickness") {
                a.gh = Axis.gs(c.fk, c.gh);
            }
            if (b == "TickStrokeThickness") {
                a.g7 = Axis.gs(c.fn, c.g7);
            }
            if (b == "TickStroke") {
                a.oq = Axis.on(c.ok, c.oq);
            }
            if (b == "TickLength") {
                a.g6 = Axis.gs(c.fm, c.fc);
            }
            if (b == "MinExtent") {
                a.gf = Axis.gs(c.fj, c.gf);
            }
            if (b == "ShouldAvoidAnnotationCollisions") {
                a.d6 = Axis.d4(c.bu, c.d6);
            }
            if (b == "ShouldAutoTruncateAnnotations") {
                a.d5 = Axis.d4(c.bt, c.d5);
            }
            if (b == "ShouldKeepAnnotationsInView") {
                a.d8 = Axis.d4(c.bv, c.d8);
            }
        }
        ko(a) {
            this.kn(a, "HorizontalAlignment");
            this.kn(a, "VerticalAlignment");
            this.kn(a, "Location");
            this.kn(a, "ShowFirstLabel");
            this.kn(a, "Visibility");
            this.kn(a, "Angle");
            this.kn(a, "Margin");
            this.kn(a, "TopMargin");
            this.kn(a, "LeftMargin");
            this.kn(a, "RightMargin");
            this.kn(a, "BottomMargin");
            this.kn(a, "Extent");
            this.kn(a, "TextColor");
            this.kn(a, "TextStyle");
            this.kn(a, "Foreground");
            this.kn(a, "FontFamily");
            this.kn(a, "FontSize");
            this.kn(a, "FontStyle");
            this.kn(a, "FontWeight");
            this.kn(a, "FontStretch");
            this.kn(a, "OpacityMask");
            this.kn(a, "Opacity");
            this.kn(a, "Padding");
            this.kn(a, "TextWrapping");
            this.kn(a, "TextAlignment");
        }
        kn(a, b) {
            let c = this;
            if (a == null) {
                return;
            }
            if (a.a4 == null) {
                return;
            }
            if (b == "Location") {
                a.a4.location = this.a8();
            }
            if (b == "Angle") {
                a.a4.angle = this.gk();
            }
            if (b == "VerticalAlignment") {
                a.a4.verticalAlignment = this.pg();
            }
            if (b == "HorizontalAlignment") {
                a.a4.horizontalAlignment = this.ob();
            }
            if (b == "ShowFirstLabel") {
                a.a4.showFirstLabel = c.a4.showFirstLabel;
            }
            if (b == "TopMargin") {
                a.a4.topMargin = c.a4.topMargin;
            }
            if (b == "LeftMargin") {
                a.a4.leftMargin = c.a4.leftMargin;
            }
            if (b == "RightMargin") {
                a.a4.rightMargin = c.a4.rightMargin;
            }
            if (b == "BottomMargin") {
                a.a4.bottomMargin = c.a4.bottomMargin;
            }
            if (b == "Extent") {
                a.a4.extent = Axis.gs(c.fh, c.a4.extent);
            }
            if (b == "Visibility") {
                if (this.bs == 0) {
                    a.a4.visibility = c.a4.visibility;
                }
                else {
                    a.a4.visibility = this.bs == 1 ? 0 : 1;
                }
            }
            if (b == "TextStyle") {
                a.a4.textStyle = c.a4.textStyle;
            }
            if (b == "FontInfo") {
                a.a4.g = c.a4.g;
            }
            if (b == "TextColor") {
                a.a4.textColor = Axis.on(c.of, c.a4.textColor);
            }
        }
        static gs(a, b) {
            if (!isNaN_(a)) {
                return a;
            }
            return b;
        }
        static jo(a, b) {
            if (!stringIsNullOrEmpty(a)) {
                return a;
            }
            return b;
        }
        static h0(a, b) {
            if (a != null) {
                return a;
            }
            return b;
        }
        static d4(a, b) {
            if (a == 0) {
                return b;
            }
            return a == 1 ? true : false;
        }
        static on(a, b) {
            if (a != null) {
                return a;
            }
            return b;
        }
        gk() {
            let a = this.a4.angle;
            a = Axis.gs(this.fg, a);
            return a;
        }
        ob() {
            let a = this;
            if (a.dw("CompanionAxisLabelHorizontalAlignment")) {
                return a.n8;
            }
            if (a.cv) {
                let b = a.a4.horizontalAlignment;
                if (b == 0) {
                    return 2;
                }
                if (b == 2) {
                    return 0;
                }
                return b;
            }
            return a.a4.horizontalAlignment;
        }
        pg() {
            let a = this;
            if (a.dw("CompanionAxisLabelVerticalAlignment")) {
                return a.pd;
            }
            if (a.cv) {
                let b = a.a4.verticalAlignment;
                if (b == 0) {
                    return 2;
                }
                if (b == 2) {
                    return 0;
                }
            }
            return a.a4.verticalAlignment;
        }
        a8() {
            let a = this;
            if (a.dw("CompanionAxisLabelLocation")) {
                return a.a5;
            }
            if (a.cv) {
                let b = a.a4.c;
                if (b == 0) {
                    return 1;
                }
                if (b == 1) {
                    return 0;
                }
                if (b == 2) {
                    return 3;
                }
                if (b == 3) {
                    return 2;
                }
                if (b == 6) {
                    return 7;
                }
                if (b == 7) {
                    return 6;
                }
                if (b == 4) {
                    return 5;
                }
                if (b == 5) {
                    return 4;
                }
            }
            return a.a4.c;
        }
    }
    Axis.$t = markType(Axis, 'Axis', Control.$, [INotifyPropertyChanged_$type]);
    Axis.hp = 0;
    Axis.n6 = DependencyProperty.i("UseEnhancedIntervalManagement", Boolean_$type, Axis.$, new PropertyMetadata(2, false, (a, b) => a.ls("UseEnhancedIntervalManagement", b.oldValue, b.newValue)));
    Axis.gg = 7;
    Axis.hh = 0;
    Axis.$$p = markDep(DependencyProperty, PropertyMetadata, Axis, 'ls', ['ActualMajorStroke:oc:mh', [Brush.$], 'ActualMinorStroke:od:mi', [Brush.$], 'ActualStroke:oe:mj', [Brush.$], 'CompanionAxisCrossingAxis:am:mk', [Axis.$, null], 'CompanionAxisCrossingValue:ff:ml', [1, NaN], 'CompanionAxisEnabled:ct:mm', [0, false], 'CompanionAxisIsInverted:br:mn', [FeatureState_$type, enumGetBox(FeatureState_$type, 0)], 'CompanionAxisLabelAngle:fg:mo', [1, NaN], 'CompanionAxisLabelColor:of:mp', [Brush.$, null], 'CompanionAxisLabelExtent:fh:mq', [1, NaN], 'CompanionAxisLabelHorizontalAlignment:n8:mr', [HorizontalAlignment_$type, enumGetBox(HorizontalAlignment_$type, 1)], 'CompanionAxisLabelLocation:a5:ms', [AxisLabelsLocation_$type, enumGetBox(AxisLabelsLocation_$type, 5)], 'CompanionAxisLabelOpposite:cv:mt', [0, true], 'CompanionAxisLabelVerticalAlignment:pd:mu', [VerticalAlignment_$type, enumGetBox(VerticalAlignment_$type, 1)], 'CompanionAxisLabelVisible:bs:mv', [FeatureState_$type, enumGetBox(FeatureState_$type, 0)], 'CompanionAxisMajorStroke:og:mw', [Brush.$, null], 'CompanionAxisMajorStrokeThickness:fi:mx', [1, NaN], 'CompanionAxisMinExtent:fj:my', [1, NaN], 'CompanionAxisMinorStroke:oh:mz', [Brush.$, null], 'CompanionAxisMinorStrokeThickness:fk:m0', [1, NaN], 'CompanionAxisShouldAutoTruncateAnnotations:bt:m1', [FeatureState_$type, enumGetBox(FeatureState_$type, 0)], 'CompanionAxisShouldAvoidAnnotationCollisions:bu:m2', [FeatureState_$type, enumGetBox(FeatureState_$type, 0)], 'CompanionAxisShouldKeepAnnotationsInView:bv:m3', [FeatureState_$type, enumGetBox(FeatureState_$type, 0)], 'CompanionAxisStrip:oi:m4', [Brush.$, null], 'CompanionAxisStroke:oj:m5', [Brush.$, null], 'CompanionAxisStrokeThickness:fl:m6', [1, NaN], 'CompanionAxisSyncronizedWithPrimaryAxis:cw:m7', [0, true], 'CompanionAxisTickLength:fm:m8', [1, NaN], 'CompanionAxisTickStroke:ok:m9', [Brush.$, null], 'CompanionAxisTickStrokeThickness:fn:na', [1, NaN], 'CompanionAxisTitle:iy:nb', [2, null], 'CrossingAxis:an:nc', [Axis.$], 'CrossingValue:hr:nd', [4, null], 'EnhancedIntervalMinimumCharacters:hi:ne', [1, -1], 'EnhancedIntervalPreferMoreCategoryLabels:cy:nf', [0, false], 'FormatLabel:az:ng', [Delegate_$type], 'IsDisabled:dk:nh', [0, false], 'IsInverted:dn:ni', [0, false], 'LabelFormat:jb:nj', [2, null], 'LabelFormatSpecifiers:ah:nk', [Array_$type, null], 'Label:hx:nl', [4, null], 'LabelSettings:a4:nm', [AxisLabelSettings.$, null], 'MajorStrokeDashArray:or:nn', [DoubleCollection.$], 'MajorStroke:ol:no', [Brush.$], 'MajorStrokeThickness:ge:np', [1, 1], 'MinorStrokeDashArray:os:nq', [DoubleCollection.$], 'MinorStroke:om:nr', [Brush.$], 'MinorStrokeThickness:gh:ns', [1, 1], 'ShouldAutoTruncateAnnotations:d5:nt', [0, false], 'ShouldAvoidAnnotationCollisions:d6:nu', [0, false], 'ShouldKeepAnnotationsInView:d8:nv', [0, false], 'Strip:oo:nw', [Brush.$], 'StrokeDashArray:ot:nx', [DoubleCollection.$], 'Stroke:op:ny', [Brush.$], 'StrokeThickness:g5:nz', [1, DeviceUtils.g(2)], 'TickLength:g6:n0', [1, NaN], 'TickStrokeDashArray:ou:n1', [DoubleCollection.$], 'TickStroke:oq:n2', [Brush.$], 'TickStrokeThickness:g7:n3', [1, DeviceUtils.g(2)], 'Title:j3:n4', [2], 'TitleSettings:b4:n5', [TitleSettings.$, null], 'UsePerLabelHeightMeasurement:eh:n7', [0, true]]);
    return Axis;
})();
/**
 * @hidden
 */
export let AxisCollection = /*@__PURE__*/ (() => {
    class AxisCollection extends ObservableCollection$1 {
        constructor() {
            super(Axis.$, 0);
            this.collectionBeforeChanged = null;
            this.collectionAfterChanged = null;
            this.collectionResetting = null;
            this.propertyChanged = delegateCombine(this.propertyChanged, (a, b) => {
                if (b.propertyName == "Name") {
                    for (let 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));
                        }
                    }
                }
            });
        }
        ac(a) {
            if (this.collectionBeforeChanged != null) {
                this.collectionBeforeChanged(this, a);
            }
            super.ac(a);
            if (this.collectionAfterChanged != null) {
                this.collectionAfterChanged(this, a);
            }
        }
        p() {
            if (this.collectionResetting != null) {
                this.collectionResetting(this, null);
            }
            super.p();
        }
    }
    AxisCollection.$t = markType(AxisCollection, 'AxisCollection', ObservableCollection$1.$.specialize(Axis.$));
    return AxisCollection;
})();
/**
 * @hidden
 */
export let AxisLabelManager = /*@__PURE__*/ (() => {
    class AxisLabelManager extends Base {
        constructor() {
            super();
            this.e = null;
            this.f = null;
            this.b = null;
            this.a = null;
            this.c = null;
            this.c = (a) => {
            };
        }
        n(a, b) {
            this.e.clear();
            this.f.clear();
            this.b.ae = this.a;
            this.b.da = a;
            this.b.c9 = b;
            if (b.isEmpty || a.isEmpty) {
                this.s(0);
                this.a.ch.count = 0;
                this.a.cf.count = 0;
                this.a.ce.count = 0;
                this.a.cg.count = 0;
            }
            if (this.a.ci.count == 0 && this.a.ch.count == 0 && this.a.bp.n()) {
                this.b.ab.clear();
            }
        }
        i(a, b) {
            this.e.add1(a);
            this.f.add(b);
        }
        t() {
            this.b.be = this.e;
            this.b.bf = this.f;
            this.b.cp();
        }
        static j(a, b) {
            AxisLabelManager.k(a, false, b);
        }
        static k(a, b, c) {
        }
        static l(a, b, c) {
        }
        static m(a, b) {
            AxisLabelManager.l(a, true, b);
        }
        h(a) {
            this.b.ab.add(a);
        }
        r(a) {
            this.b.b1 = a;
        }
        o(a) {
            this.c(a);
        }
        u(a) {
            let b = this.a.ci.item(a);
            return b;
        }
        s(a) {
            if (this.a == null) {
                return;
            }
            this.a.ci.count = a;
        }
        get d() {
            if (this.a == null || this.a.a4 == null) {
                return false;
            }
            return this.a.a4.visibility != 0;
        }
        q() {
            this.a.ci.count = 0;
            this.a.ch.count = 0;
            this.a.cf.count = 0;
            this.a.ce.count = 0;
            this.a.cg.count = 0;
            this.a.a1.bg.clear();
        }
        p() {
            this.a.d0 = true;
        }
        g() {
            this.a.kd();
        }
    }
    AxisLabelManager.$t = markType(AxisLabelManager, 'AxisLabelManager');
    return AxisLabelManager;
})();
/**
 * @hidden
 */
export let AxisLabelPanelBase = /*@__PURE__*/ (() => {
    class AxisLabelPanelBase extends Panel {
        constructor() {
            super();
            this.c2 = null;
            this.b1 = 0;
            this.ae = null;
            this.am = false;
            this.a8 = null;
            this.bf = null;
            this.c9 = null;
            this.c1 = Rect.empty;
            this.c0 = null;
            this.c7 = null;
            this.bh = 0;
            this.b2 = null;
            this.bg = null;
            this.bd = null;
            this.ah = null;
            this.aq = false;
            this.c8 = null;
            this.at = false;
            this.au = false;
            this.a0 = false;
            this.a1 = false;
            this.a2 = false;
            this.b4 = null;
            this.an = false;
            this.bi = 50;
            this.bj = 0;
            this.bk = 0;
            this.dc = new Size();
            this.bj = NaN;
            this.c9 = Rect.empty;
            this.c7 = Rect.empty;
            this.c6 = Rect.empty;
            this.ag = this.af();
            this.cl(this.ag);
            this.ag.am();
            this.bg = new List$1(FrameworkElement.$, 0);
            this.bf = new List$1(LabelPosition.$, 0);
            this.bd = new List$1(Rect.$, 0);
            this.a1 = false;
            this.a0 = false;
            this.a2 = false;
            this.aq = false;
            this.at = false;
            this.c8 = Rect.empty;
            this.am = false;
        }
        af() {
            return new AxisLabelPanelBaseView(this);
        }
        cl(a) {
        }
        cc() {
        }
        cu() {
        }
        ct() {
        }
        get a4() {
            return this.am;
        }
        set a4(a) {
            this.am = a;
        }
        get be() {
            return this.a8;
        }
        set be(a) {
            let b = this.a8;
            this.a8 = a;
            if (b == null && b != a) {
                this.ci();
            }
        }
        get da() {
            return this.c1;
        }
        set da(a) {
            let b = this.c1;
            this.c1 = a;
            this.cy(b, this.c1);
        }
        get c6() {
            if (!this.c7.isEmpty) {
                return this.c7;
            }
            return this.c0;
        }
        set c6(a) {
            let b = this.c0;
            this.c0 = a;
            this.ch(b, this.c0);
        }
        get bl() {
            return this.bh;
        }
        set bl(a) {
            this.bh = a;
        }
        bs() {
            let a = 1.7976931348623157E+308;
            if (this.bf != null && this.bf.count > 1) {
                for (let b = 1; b < this.bf.count; b++) {
                    let c = this.bf._inner[b];
                    let d = this.bf._inner[b - 1];
                    if (c.b || d.b) {
                        continue;
                    }
                    let e = Math.abs(c.h - d.h);
                    if (e < a) {
                        a = e;
                    }
                }
            }
            return a;
        }
        cp() {
            this.at = false;
            this.au = false;
            this.c8 = Rect.empty;
        }
        ap(a, b) {
            for (let c = 0; c < a.count - 1; c++) {
                if (b._inner[c]) {
                    continue;
                }
                for (let 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;
        }
        b3(a, b, c) {
            return {
                ret: 0,
                p1: b
            };
        }
        ba() {
            return null;
        }
        ca() {
        }
        b6(a) {
        }
        get ar() {
            return this.ah != null && this.ah.k();
        }
        bq() {
            if (this.ae.c1 && (!this.ar || (this.ar && this.ah.angle == 0))) {
                return this.ae.gj();
            }
            return this.ah != null ? this.ah.angle : 0;
        }
        bv() {
            return this.ae.b4 != null ? this.ae.b4.angle : 0;
        }
        aw(a, b) {
            if (a == 0 && !this.ae.dc && this.ah != null) {
                if (this.ae.dy) {
                    if (!this.ah.showFirstLabel && this.ae.b7.iv() == 1) {
                        return false;
                    }
                }
                else {
                    if (!this.ah.showFirstLabel && this.ae.b7.iu() == 1) {
                        return false;
                    }
                }
            }
            return true;
        }
        bp(a) {
            return this.ag.n(a);
        }
        b0(a) {
            return this.ag.x(a);
        }
        br(a) {
            return this.ag.o(a);
        }
        bo(a) {
            return this.ag.m(a);
        }
        as() {
            return false;
        }
        cy(a, b) {
        }
        ch(a, b) {
        }
        bc() {
            if (this.ab.count < 1 || this.bf.count == 0) {
                return new List$1(Rect.$, 0);
            }
            this.bg = new List$1(FrameworkElement.$, 0);
            this.bd = new List$1(Rect.$, 0);
            this.ca();
            this.ag.ae();
            let a = this.bq();
            if (a % 360 == 0) {
                this.a0 = false;
            }
            if (this.bg.count == 0) {
                return new List$1(Rect.$, 0);
            }
            this.bd = this.ba();
            this.bd = this.bb(this.bd);
            this.am = true;
            return this.bd;
        }
        bb(a) {
            if (this.ae.d6 || this.ae.d8) {
                let b = this.ag.q();
                let c = this.ag.s();
                let d = this.ag.r();
                let e = this.ag.p();
                let f = Math.max(b, Math.max(c, Math.max(d, e)));
                let g = new Thickness(0, f);
                if (this.a0) {
                    g = new Thickness(0, Math.sqrt((f * f) / 2));
                }
                let h = this.a9(a);
                let i = new List$1(Thickness.$, 0);
                if (h.count < 1) {
                    return a;
                }
                h.aa((j, k) => {
                    let l = this.c3(j, a._inner[j], g);
                    let m = this.c3(k, a._inner[k], g);
                    let n = l.top;
                    let o = m.top;
                    if (n < o) {
                        return -1;
                    }
                    if (n > o) {
                        return 1;
                    }
                    return 0;
                });
                for (let j = 0; j < h.count; j++) {
                    let k = h._inner[j];
                    let l = a._inner[k];
                    let m = this.c3(k, a._inner[k], g);
                    let n = this.ae.b7.y9.top;
                    if (this.ae.d8) {
                        if (l.top < (this.ae.b7.y9.top - n)) {
                            l = new Rect(0, l.left, l.top + ((this.ae.b7.y9.top - n) - l.top), l.width, l.height);
                            a._inner[k] = l;
                        }
                    }
                }
                let o = this.av(a, h, g);
                if (o && (this.ae.d6)) {
                    for (let p = 0; p < h.count - 1; p++) {
                        let q = h._inner[p];
                        let r = h._inner[p + 1];
                        let s = a._inner[q];
                        let t = a._inner[r];
                        let u = this.c3(q, a._inner[q], g);
                        let v = this.c3(r, a._inner[r], g);
                        if (u.intersectsWith(v) || u.top > v.bottom) {
                            let w = new Rect(0, t.left, u.bottom + 1 + (t.top - v.top), t.width, t.height);
                            a._inner[r] = w;
                        }
                    }
                }
                for (let x = h.count - 1; x >= 0; x--) {
                    let y = h._inner[x];
                    let z = a._inner[y];
                    let aa = this.c3(y, a._inner[y], g);
                    let ab = this.ae.b7.dw.a6;
                    if (this.ae.d8) {
                        if (aa.bottom > this.ae.b7.y9.bottom + ab) {
                            z = new Rect(0, z.left, z.top - (aa.bottom - (this.ae.b7.y9.bottom + ab)), z.width, z.height);
                            a._inner[y] = z;
                        }
                    }
                }
                if (this.ae.d6) {
                    for (let ac = h.count - 1; ac >= 1; ac--) {
                        let ad = h._inner[ac];
                        let ae = h._inner[ac - 1];
                        let af = a._inner[ad];
                        let ag = a._inner[ae];
                        let ah = this.c3(ad, a._inner[ad], g);
                        let ai = this.c3(ae, a._inner[ae], g);
                        if (ah.intersectsWith(ai) || ah.top < ai.bottom) {
                            let 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;
            }
        }
        c3(a, b, c) {
            let d = this.bf._inner[a];
            let e = d.i;
            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;
            }
            let f = d.a ? d.e : 0;
            let g = new Rect(0, b.left - e.left - f, b.top - e.top, b.width + e.left + e.right + f, b.height + e.top + e.bottom);
            let h = this.ag.q();
            let i = this.ag.r();
            let j = this.ag.s();
            let k = this.ag.p();
            let l = Math.max(0, g.height - (j + k));
            let m = Math.max(0, g.width - (h + i));
            let n = new Rect(0, g.left + h, g.top + j, m, l);
            return n;
        }
        av(a, b, c) {
            if (b.count <= 1) {
                return false;
            }
            for (let d = 0; d < b.count - 1; d++) {
                let e = b._inner[d];
                let f = b._inner[d + 1];
                let g = a._inner[e];
                let h = a._inner[f];
                let i = this.c3(e, a._inner[e], c);
                let j = this.c3(f, a._inner[f], c);
                if (i.intersectsWith(j)) {
                    return true;
                }
            }
            return false;
        }
        a9(a) {
            let b = new List$1(Number_$type, 0);
            for (let c = 0; c < a.count; c++) {
                let d = this.bf._inner[c].b;
                if (d) {
                    b.add(c);
                }
            }
            return b;
        }
        bu(a, b) {
            let c = a * (Math.PI / 180);
            let d = Math.abs(b.width * Math.cos(c)) + Math.abs(b.height * Math.sin(c));
            return d;
        }
        bt(a, b) {
            let c = a * (Math.PI / 180);
            let d = Math.abs(b.height * Math.cos(c)) + Math.abs(b.width * Math.sin(c));
            return d;
        }
        by() {
            let a = this.ag.l();
            return a;
        }
        bw() {
            let a = this.ag.k();
            return a;
        }
        bx() {
            if (this.ae.j3 == null || (this.ae.b4 != null && this.ae.b4.visibility == 1)) {
                return 0;
            }
            let a = this.bw();
            let b = this.by();
            let c = new Rect(0, 0, 0, b, a);
            let d = this.bv();
            let e = RectUtil.w(c, d);
            return e.height + this.ag.w() + this.ag.t();
        }
        bz() {
            if (this.ae.j3 == null || (this.ae.b4 != null && this.ae.b4.visibility == 1)) {
                return 0;
            }
            let a = this.bw();
            let b = this.by();
            let c = new Rect(0, 0, 0, b, a);
            let d = this.bv();
            let e = RectUtil.w(c, d);
            return e.width + this.ag.u() + this.ag.v();
        }
        db(a) {
            if (this.ae == null || this.ab.count == 0) {
                return a;
            }
            this.b9(a);
            this.cd();
            this.b8(a);
            this.bd = this.bc();
            if (this.bg.count != this.bd.count) {
                return a;
            }
            let b = this.ag.q();
            let c = this.ag.s();
            let d = this.ag.r();
            let e = this.ag.p();
            if (this.a0) {
                for (let f = 0; f < this.bg.count; f++) {
                    if (this.aw(f, this.bd._inner[f])) {
                        this.ag.z(this.bg._inner[f], this.bd._inner[f], b, c, d, e);
                    }
                    if (this.bf._inner[f].b && this.bf._inner[f].a) {
                        this.cr(this.bg._inner[f], this.bf._inner[f].e, this.bq());
                    }
                    else {
                        this.cq(this.bg._inner[f], this.bq());
                    }
                }
            }
            for (let g = 0; g < this.bg.count; g++) {
                if (!this.a0) {
                    this.ag.ad(this.bg._inner[g]);
                }
                if (this.aw(g, this.bd._inner[g])) {
                    this.ag.z(this.bg._inner[g], this.bd._inner[g], b, c, d, e);
                }
                else {
                    this.ag.z(this.bg._inner[g], new Rect(0, 0, 0, 0, 0), b, c, d, e);
                }
            }
            if (this.ae.ch.count > 0) {
                this.ae.bx.arrangeAnnotations(this.ae, this.ag, this.bg, this.bd, this.a0, this.bq(), b, c, d, e);
            }
            this.b6(a);
            if (this.as() && this.ao && this.ae != null && this.ae.b5 != null && !this.ae.d1 && this.ae.b5.z8 && !this.ae.b5.aaf && this.bd != null && this.bd.count > 0) {
                let h = this.bd.count - 1;
                if (this.ae.ch.count > 0) {
                    h -= this.ae.ch.count;
                }
                if (h < 0) {
                    h = 0;
                }
                this.ae.b5.acw(this, this.c6, this.bd._inner[0], this.bd._inner[h]);
            }
            return a;
        }
        get ao() {
            return this.ae.a4 != null && (this.ae.a4.c != 5 && this.ae.a4.c != 4);
        }
        c5() {
            return Rect.empty;
        }
        b9(a) {
            if (this.ae.mg == null) {
                return;
            }
            this.ag.ah(this.ae.mg, new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
            let b = Math.abs(this.bv() - 0) > 1E-06;
            let c = this.c5();
            let d = c.left + (c.width / 2);
            let e = c.top + (c.height / 2);
            let f = this.by() + this.ag.u() + this.ag.v();
            let g = this.bw() + this.ag.w() + this.ag.t();
            let h = f / 2;
            let i = g / 2;
            let j = new Rect(0, d - h, e - i, f, g);
            if (b) {
                this.cs(this.ae.mg);
            }
            else {
                this.ag.ad(this.ae.mg);
            }
            this.ag.z(this.ae.mg, j, this.ag.u(), this.ag.w(), this.ag.v(), this.ag.t());
            if ((this.ae.b4 == null || this.ae.b4.visibility == 0) && (this.ae.a4 == null || this.ae.a4.visibility == 0) && this.ae.j3 != null) {
                this.ae.mg._visibility = 0;
            }
            else {
                this.ae.mg._visibility = 1;
                this.ag.z(this.ae.mg, new Rect(0, 0, 0, 0, 0), 0, 0, 0, 0);
            }
        }
        b8(a) {
            this.ag.aa(a);
        }
        cd() {
        }
        a7() {
            if (typeCast(CategoryAxisBase.$, this.ae) !== null) {
                return this.ae.pt;
            }
            if (typeCast(NumericAxisBase.$, this.ae) !== null) {
                let a = new List$1(Number_$type, 0);
                let d = this.ae.p1.j();
                for (let c = 0; c < d.length; c++) {
                    let b = d[c];
                    let e = this.ae.o1();
                    let f = new ScalerParams(0, this.ae.b7.za, this.ae.o6, this.ae.dp, e);
                    a.add(this.ae.f6(b, f));
                }
                return a;
            }
            return null;
        }
        get ai() {
            let a = this.ah != null ? this.ah.c : this.aj();
            if (this.ae.an == 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;
        }
        cx(a, b, c, d, e, f) {
            let g = b;
            let h = b;
            if (f != null) {
                let i = f.c / 2;
                g -= i;
                h += i;
            }
            if (h >= e.left && g <= e.right) {
                if (f.a) {
                    b = this.ae.fd(b, e.left, e.right, f);
                }
                let j = new LineGeometry();
                j.d = { $type: Point_$type, x: b, y: c };
                j.c = { $type: Point_$type, x: b, y: d };
                a.add(j);
            }
        }
        cg(a, b, c, d, e, f) {
            if (b <= e.bottom && b >= e.top) {
                if (f.a) {
                    b = this.ae.fd(b, e.top, e.bottom, f);
                }
                let g = new LineGeometry();
                g.d = { $type: Point_$type, x: c, y: b };
                g.c = { $type: Point_$type, x: d, y: b };
                a.add(g);
            }
        }
        cq(a, b) {
            let c = this.bq();
            this.ag.ai(a, c);
        }
        cr(a, b, c) {
        }
        get_az() {
            return false;
        }
        get az() {
            return this.get_az();
        }
        ac(a, b) {
            let c = a.height;
            let d = a.width;
            let e = 0 + a.left;
            let f = (c / 2) + a.top;
            let g = new TransformGroup();
            let h = AngleSimplifier.a(b);
            let i = ((() => {
                let $ret = new RotateTransform();
                $ret.j = h;
                $ret.k = e;
                $ret.l = f;
                return $ret;
            })());
            let j = 0;
            let k = 0;
            if (h != 0 && h != 360) {
                if (h > 0 && h < 180) {
                    j = -Math.sin(MathUtil.p(h)) * (c / 2);
                }
                else {
                    i.k = d;
                    k = -d;
                    j = -Math.sin(MathUtil.p(h - 180)) * (c / 2);
                }
            }
            let l = ((() => {
                let $ret = new TranslateTransform();
                $ret.k = j;
                $ret.j = k;
                return $ret;
            })());
            g.j.add(i);
            g.j.add(l);
            let m = TransformMatrixHelpler.f(g);
            let n = RectUtil.n(a);
            let o = RectUtil.o(a);
            let p = RectUtil.k(a);
            let q = RectUtil.j(a);
            let r = TransformMatrixHelpler.i(m, n);
            let s = TransformMatrixHelpler.i(m, o);
            let t = TransformMatrixHelpler.i(m, p);
            let u = TransformMatrixHelpler.i(m, q);
            let v = new Array(4);
            v[0] = r;
            v[1] = s;
            v[2] = t;
            v[3] = u;
            return v;
        }
        ad(a, b) {
            let c = TransformMatrixHelpler.f(b);
            let d = RectUtil.n(a);
            let e = RectUtil.o(a);
            let f = RectUtil.k(a);
            let g = RectUtil.j(a);
            let h = TransformMatrixHelpler.i(c, d);
            let i = TransformMatrixHelpler.i(c, e);
            let j = TransformMatrixHelpler.i(c, f);
            let k = TransformMatrixHelpler.i(c, g);
            let l = new Array(4);
            l[0] = h;
            l[1] = i;
            l[2] = j;
            l[3] = k;
            return l;
        }
        c4(a, b) {
            let c = this.ac(a, b);
            let d = 1.7976931348623157E+308;
            let e = 1.7976931348623157E+308;
            let f = -1.7976931348623157E+308;
            let g = -1.7976931348623157E+308;
            for (let 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));
        }
        cs(a) {
            let b = this.bv();
            this.cf(a, b);
        }
        cf(a, b) {
            let c = typeCast(FrameworkElement.$, a);
            let d = this.bw();
            let e = this.by();
            let f = 0.5 * e;
            let g = 0.5 * d;
            let h = ((() => {
                let $ret = new RotateTransform();
                $ret.j = b;
                $ret.k = f;
                $ret.l = g;
                return $ret;
            })());
            let i = new TransformGroup();
            i.j.add(h);
            c.j = i;
        }
        dd(a) {
            if ((this.ab.contains(this.ae.mg) == false) && this.ae.mg != null) {
                this.ab.add(this.ae.mg);
                AxisLabelManager.m(this.ae.mg, this.ae.b4);
            }
            for (let b of fromEnum(this.ab)) {
                if (b != this.ae.mg && b != this.ag.aw) {
                    this.ag.ag(b);
                }
            }
            let c = (this.ae == null || this.bi <= 0 || isNaN_(this.bi)) ? 50 : this.bi;
            if (this.ae != null && (this.ae.es == null || this.ae.es.count == 0)) {
                if (this.ae.db()) {
                    c = this.ae.gc();
                }
            }
            let d = this.as();
            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);
        }
        get bm() {
            return this.c(AxisLabelPanelBase.cz);
        }
        set bm(a) {
            this.h(AxisLabelPanelBase.cz, a);
        }
        ax() {
            if (this.ae.a4 != null) {
                let a = this.ae.a4.maximumExtent;
                if (!isNaN_(a) && (a > 0)) {
                    return true;
                }
            }
            return false;
        }
        ay() {
            if (this.ae.a4 != null) {
                let a = this.ae.a4.maximumExtentPercentage;
                if (!isNaN_(a) && (a > 0) && (a <= 1)) {
                    return true;
                }
            }
            return false;
        }
        ak(a) {
            if (a == null) {
                return this.ae.b7.a1(this.ae);
            }
            if (a.position == 0) {
                if (this.ae != null && this.ae.b7 != null) {
                    return this.ae.b7.a1(this.ae);
                }
                return 4;
            }
            return a.position;
        }
        aj() {
            return 1;
        }
        a3(a) {
            return true;
        }
        *_a5() {
            for (let a of fromEnum(this.ab)) {
                if (a != this.ae.mg && a != this.ag.aw) {
                    yield a;
                }
            }
        }
        a5() {
            return toEnum(() => this._a5());
        }
        al(a, b, c, d, e) {
            let f = this.ag.c(b, c, d, e);
            return f;
        }
        cb(a) {
            if (this.b4 == null || this.bp(this.b4) < this.bp(a)) {
                this.b4 = a;
            }
        }
        ck(a) {
            this.bg.add(a);
        }
        *_a6() {
            for (let a = 0; a < this.ae.ci.count; a++) {
                yield this.ae.ci.item(a);
            }
            for (let b = 0; b < this.ae.ch.count; b++) {
                yield this.ae.ch.item(b);
            }
        }
        a6() {
            return toEnum(() => this._a6());
        }
        ce() {
            this.ag.af();
            this.cw();
        }
        cw() {
            this.bd = this.bc();
        }
        ci() {
        }
        bn(a) {
            return this.bi;
        }
        cm() {
            this.c7 = new Rect(0, 0, 0, this.dc.width, this.dc.height);
        }
        cv() {
            this.c7 = Rect.empty;
        }
        cj() {
            this.ag.aj();
        }
        cn(a) {
            this.ag.ak(a);
        }
        b7() {
            this.ag.y();
        }
        co() {
            this.ag.an();
        }
    }
    AxisLabelPanelBase.$t = markType(AxisLabelPanelBase, 'AxisLabelPanelBase', Panel.$);
    AxisLabelPanelBase.cz = DependencyProperty.i("Extent", Number_$type, AxisLabelPanelBase.$, new PropertyMetadata(2, 50, (a, b) => a.bi = b.newValue));
    return AxisLabelPanelBase;
})();
/**
 * @hidden
 */
export let CategoryAxisBase = /*@__PURE__*/ (() => {
    class CategoryAxisBase extends Axis {
        constructor() {
            super();
            this.pt = null;
            this.pl = null;
            this.p8 = 0;
            this.qa = 0;
            this.pj = 0;
            this.pv = 1;
            this.p9 = 0;
            this.pn = false;
            this.pt = new List$1(Number_$type, 0);
        }
        bo() {
            return new CategoryAxisBaseView(this);
        }
        ag() {
            return [0, this.qb - 1];
        }
        i6(a) {
            let b = this.jn(a);
            if (b == Axis.$$p[40]) {
                return this.hx != null ? this.hx.toString() : null;
            }
            return super.i6(a);
        }
        i7() {
            return Axis.$$p[40];
        }
        get_di() {
            return false;
        }
        k6(a) {
            super.k6(a);
            this.pi = a;
        }
        f3(a, b, c, d) {
            let e = this.getCategorySize(b, c, d);
            let f = e * a;
            return f;
        }
        ek(a, b, c) {
            let d = super.ek(a, b, c);
            if (!d) {
                return false;
            }
            return this.itemsSource != null && this.qa > 0;
        }
        qx() {
            if (this.pm != null && this.cd != null && this.itemsSource != null) {
                this.pm = this.cd.releaseFastItemsSource(this.itemsSource);
            }
        }
        qw() {
            if (this.pm == null && this.cd != null && this.itemsSource != null) {
                this.pm = this.cd.getFastItemsSource(this.itemsSource);
            }
        }
        get_df() {
            return true;
        }
        ra(a, b, c) {
            if (this.dc) {
                return Rect.empty;
            }
            return this.rb(a, b, c, this.dy);
        }
        rb(a, b, c, d) {
            let e = 0;
            let f = a.x;
            let g = this.o6.left;
            let h = this.o6.right;
            if (d) {
                f = a.y;
                g = this.o6.top;
                h = this.o6.bottom;
            }
            let i = this.pt;
            if ((d && !this.dn) || (!d && this.dn)) {
                i = new List$1(Number_$type, 0);
                for (let j = this.pt.count - 1; j >= 0; j--) {
                    i.add(this.pt._inner[j]);
                }
            }
            if (this.categoryMode == 0) {
                if (b) {
                    let k;
                    if (d) {
                        k = new Rect(0, this.o6.left, a.y - c / 2, this.o6.width, c);
                    }
                    else {
                        k = new Rect(0, a.x - c / 2, this.o6.top, c, this.o6.height);
                    }
                    k.intersect(this.o6);
                    return k;
                }
                else {
                    if (f > h) {
                        return Rect.empty;
                    }
                    if (f < g) {
                        return Rect.empty;
                    }
                    let l = 1.7976931348623157E+308;
                    let m = -1;
                    for (e = 0; e < i.count; e++) {
                        let n = Math.abs(i._inner[e] - f);
                        if (n < l) {
                            l = n;
                            m = e;
                        }
                    }
                    if (m == -1) {
                        return Rect.empty;
                    }
                    let o = i._inner[m];
                    let p;
                    if (d) {
                        p = new Rect(0, this.o6.left, o - c / 2, this.o6.width, c);
                    }
                    else {
                        p = new Rect(0, o - c / 2, this.o6.top, c, this.o6.height);
                    }
                    p.intersect(this.o6);
                    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;
                }
                let q = this.o6.right;
                if (d) {
                    q = this.o6.bottom;
                }
                if (e < i.count) {
                    q = i._inner[e];
                }
                if (d) {
                    return new Rect(0, this.o6.left, i._inner[e - 1], this.o6.width, q - i._inner[e - 1]);
                }
                else {
                    return new Rect(0, i._inner[e - 1], this.o6.top, q - i._inner[e - 1], this.o6.height);
                }
            }
        }
        get itemsSource() {
            return this.c(CategoryAxisBase.q5);
        }
        set itemsSource(a) {
            this.h(CategoryAxisBase.q5, a);
        }
        get qb() {
            return this.p8;
        }
        set qb(a) {
            this.p8 = a;
            this.qa = this.p8;
        }
        get categoryMode() {
            if (this.dh) {
                let a = typeCast(CategoryAxisBase.$, this.ao);
                if (a != null) {
                    return a.categoryMode;
                }
            }
            return this.pj;
        }
        set categoryMode(a) {
            if (this.pj != a) {
                let b = this.pj;
                this.pj = a;
                this.ls("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, a));
            }
        }
        p6(a, b, c) {
            let d = !isNaN_(this.pw) ? MathUtil.e(this.pw, 0, this.pv) : 0;
            if (!this.dc && this.p4 > 0) {
                let e = this.getCategorySize(a, b, c);
                let f = 0.5 * d;
                let g = e * f;
                if (g < this.p4) {
                    g = this.p4;
                    f = g / e;
                    d = f / 0.5;
                    d = MathUtil.e(d, 0, this.pv);
                }
            }
            return d;
        }
        get qc() {
            return this.p9;
        }
        set qc(a) {
            if (a != this.p9) {
                let b = this.p9;
                this.p9 = a;
                this.ls("GroupCount", b, this.p9);
            }
        }
        f9(a, b) {
            return NaN;
        }
        getUnscaledValue3(a, b, c, d) {
            return NaN;
        }
        getCategorySize(a, b, c) {
            return NaN;
        }
        pz(a, b, c) {
            return NaN;
        }
        getGroupCenter(a, b, c, d) {
            return NaN;
        }
        p7(a) {
            let b = this.b7.za;
            let c = this.o6;
            let d = this.o1();
            let e = new ScalerParams(0, b, c, this.dn, d);
            return this.f9(a, e);
        }
        *_ps() {
            for (let a of fromEnum(this.es)) {
                yield a;
            }
            if (this.b7 != null && this.b7.ga && this.pp(this.b7)) {
                for (let b of fromEnum(this.b7.hl())) {
                    if (b != this.b7) {
                        for (let c of fromEnum(b.b9)) {
                            yield c;
                        }
                    }
                }
            }
        }
        ps() {
            return toEnum(() => this._ps());
        }
        po(a) {
            return this.es.contains(a);
        }
        pp(a) {
            return false;
        }
        *_pr() {
            let a = typeCast(XamDataChart.$, this.b7);
            if (a != null && a.ga && this.pp(a)) {
                for (let b of fromEnum(a.hl())) {
                    if (b != this.b7) {
                        let c = typeCast(XamDataChart.$, b);
                        if (c != null) {
                            for (let d of fromEnum(c.zq)) {
                                if (typeCast(CategoryAxisBase.$, d) !== null) {
                                    yield typeCast(CategoryAxisBase.$, d);
                                }
                            }
                        }
                    }
                }
            }
        }
        pr() {
            return toEnum(() => this._pr());
        }
        q1(a) {
            if (this.pn) {
                return;
            }
            try {
                this.pn = true;
                let b = 0;
                let c = 0;
                let d = false;
                for (let e of fromEnum(this.ps())) {
                    if (!e.e1 && !e.fw && !e.fa) {
                        continue;
                    }
                    if (e.bo != null) {
                        continue;
                    }
                    let f = e;
                    let g = f.preferredCategoryMode(this);
                    if (g == 2) {
                        b = 2;
                        d = true;
                        if (this.po(e)) {
                            c++;
                        }
                    }
                    if (g == 1 && !d) {
                        b = 1;
                    }
                }
                let h = this.pq;
                for (let i of fromEnum(this.pr())) {
                    if (i.pq) {
                        h = true;
                    }
                    if (a) {
                        i.q1(false);
                    }
                }
                if (b == 0 && h) {
                    b = 2;
                    if (c == 0) {
                        c = 1;
                    }
                }
                this.categoryMode = b;
                this.qc = c;
            }
            finally {
                this.pn = false;
            }
        }
        qd() {
            if (this.pm == null) {
                return 0;
            }
            return this.pm.count;
        }
        km(a) {
            super.km(a);
            this.kp(a, "ItemsSource");
            this.kp(a, "Gap");
            this.kp(a, "Overlap");
            this.kp(a, "MaximumGap");
            this.kp(a, "MinimumGapSize");
            this.kp(a, "UseClusteringMode");
            this.kp(a, "CategoryMode");
        }
        kp(a, b) {
            super.kp(a, b);
            let c = typeCast(CategoryAxisBase.$, a);
            if (c == null) {
                return;
            }
            let d = this;
            if (b == "ItemsSource") {
                c.itemsSource = d.itemsSource;
            }
            if (b == "Gap") {
                c.pw = d.pw;
            }
            if (b == "Overlap") {
                c.p5 = d.p5;
            }
            if (b == "MaximumGap") {
                c.p3 = d.p3;
            }
            if (b == "MinimumGapSize") {
                c.p4 = d.p4;
            }
            if (b == "UseClusteringMode") {
                c.pq = d.pq;
            }
            if (b == "CategoryMode") {
                c.categoryMode = d.categoryMode;
            }
        }
        la(a, b, c, d) {
            super.la(a, b, c, d);
            switch (b) {
                case "FastItemsSourceProvider":
                    if ((typeCast(IFastItemsSourceProvider_$type, c)) != null) {
                        this.pm = c.releaseFastItemsSource(this.itemsSource);
                    }
                    if ((typeCast(IFastItemsSourceProvider_$type, d)) != null) {
                        this.pm = d.getFastItemsSource(this.itemsSource);
                    }
                    this.qb = 0;
                    if (this.pm != null) {
                        this.qb = this.qd();
                    }
                    this.q1(true);
                    break;
                case "ItemsSource":
                    if (this.cd != null) {
                        this.pm = this.cd.getFastItemsSource(this.itemsSource);
                    }
                    break;
                case CategoryAxisBase.$$p[0]:
                    let e = typeCast(IFastItemsSource_$type, c);
                    this.qo();
                    this.d0 = true;
                    if (e != null) {
                        e.event = delegateRemove(e.event, runOn(this, this.qr));
                    }
                    this.qb = 0;
                    if (this.pm != null) {
                        this.qb = this.qd();
                    }
                    if (this.pm != null) {
                        let f = this.pm;
                        f.event = delegateCombine(f.event, runOn(this, this.qr));
                        this.ly(false);
                        for (let g of fromEnum(this.eo())) {
                            g.r8(false);
                            if (g.dc != null) {
                                g.q0();
                            }
                        }
                        if (this.b7 != null && this.b7.gp) {
                            this.b7.s4();
                        }
                    }
                    else {
                        this.kj();
                        for (let h of fromEnum(this.eo())) {
                            h.pi(true, h.cw);
                            if (h.dc != null) {
                                h.q0();
                            }
                        }
                    }
                    break;
                case "ItemsCount":
                    this.lt(new AxisRangeChangedEventArgs(0, 0, 0, typeGetValue((c)) - 1, typeGetValue((d)) - 1));
                    this.ly(false);
                    break;
                case CategoryAxisBase.$$p[5]:
                    this.d0 = true;
                    this.q2();
                    this.ly(false);
                    this.qp();
                    break;
                case "CategoryMode":
                    this.d0 = true;
                    this.ly(false);
                    this.qz();
                    this.qp();
                    break;
                case CategoryAxisBase.$$p[4]:
                case CategoryAxisBase.$$p[3]:
                case CategoryAxisBase.$$p[2]:
                case CategoryAxisBase.$$p[1]:
                    this.pv = this.p3;
                    this.d0 = true;
                    for (let i of fromEnum(this.eo())) {
                        i.g6 = true;
                        let j = typeCast(IHasCategoryModePreference_$type, i);
                        if (j != null && j.preferredCategoryMode(this) == 2) {
                            i.r8(false);
                        }
                    }
                    this.ly(false);
                    if (this.b7 != null) {
                        this.b7.p6();
                    }
                    break;
                case Axis.$$p[32]:
                case Axis.$$p[31]:
                    this.d0 = true;
                    this.ly(true);
                    break;
            }
        }
        qp() {
            for (let a of fromEnum(this.eo())) {
                a.r8(false);
            }
        }
        qr(a, b) {
            this.qy(b);
        }
        qy(a) {
            switch (a.action) {
                case 3:
                case 0:
                case 1:
                case 2:
                case 4:
                    if (this.pm != null) {
                        this.qb = this.qd();
                    }
                    this.ly(false);
                    break;
            }
            if (this.pm != null) {
                this.qb = this.qd();
            }
        }
        q2() {
            let a = false, b = false;
            for (let c of fromEnum(this.es)) {
                let d = typeCast(IHasCategoryModePreference_$type, c);
                if (d == null) {
                    continue;
                }
                let e = d.preferredCategoryMode(this);
                a = a || e == 1;
                b = b || e == 2;
            }
            let f = b ? 2 : a ? 1 : 0;
            if (f == 0 && this.pq) {
                f = 1;
                if (this.qc == 0) {
                    this.qc = 1;
                }
            }
            this.categoryMode = f;
        }
        d3(a) {
            let b = super.d3(a);
            if (b) {
                this.q1(true);
                let c = typeCast(IHasCategoryModePreference_$type, a);
                if (c != null && c.preferredCategoryMode(this) == 2) {
                    for (let d of fromEnum(this.eo())) {
                        let e = typeCast(IHasCategoryModePreference_$type, d);
                        if (e != null && e != c && e.preferredCategoryMode(this) == 2) {
                            d.r8(false);
                        }
                    }
                }
                this.ly(false);
                this.ed();
            }
            return b;
        }
        cx(a) {
            let b = super.cx(a);
            if (b) {
                this.q1(true);
                let c = typeCast(IHasCategoryModePreference_$type, a);
                if (c != null && c.preferredCategoryMode(this) != 0) {
                    for (let d of fromEnum(this.eo())) {
                        let e = typeCast(IHasCategoryModePreference_$type, d);
                        if (e != null) {
                            d.r8(false);
                        }
                    }
                }
                this.ly(false);
            }
            return b;
        }
        qz() {
            let a = null;
            for (let b of fromEnum(this.eo())) {
                if (b.e1) {
                    let c = b.aw(this);
                    if (c != null && c.an == this) {
                        a = c;
                    }
                }
            }
            if (a != null) {
                a.lx();
            }
        }
        qo() {
            this.pl = this.pm;
        }
        q0() {
            let a = this.a4;
            if (a == null) {
                a = new AxisLabelSettings();
            }
            if (a.visibility == 1) {
                this.ci.count = 0;
                this.ch.count = 0;
                this.cf.count = 0;
                this.ce.count = 0;
                this.cg.count = 0;
            }
            else {
                let b = 0;
                b = this.pi.br(this.eq);
                this.ci.count = b;
            }
        }
        qq(a) {
            if (this.pm != null) {
                this.pm.handleCollectionChanged(a);
            }
        }
        qv(a, b, c) {
            this.qq(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
        }
        qs() {
            this.qq(new NotifyCollectionChangedEventArgs(0, 4));
        }
        qt(a, b) {
            this.qq(new NotifyCollectionChangedEventArgs(1, 0, b, a));
        }
        qu(a, b) {
            this.qq(new NotifyCollectionChangedEventArgs(1, 1, b, a));
        }
        p0(a, b, c, d) {
            return this.p1(a, b, c, d, this.categoryMode);
        }
        p1(a, b, c, d, e) {
            let f = 0;
            let 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.dy != this.dn) {
                f *= -1;
            }
            return f;
        }
        getSeriesOffset(a, b, c, d, e) {
            return this.p1(a, b, c, d, e);
        }
        get isVertical() {
            return this.dy;
        }
        j$d(a, b) {
            return this.f9.apply(this, arguments);
        }
        j$c(a, b) {
            return this.f6.apply(this, arguments);
        }
        j$e(a, b, c, d, e) {
            this.k0.apply(this, arguments);
        }
        j$f(a, b, c, d) {
            this.k1.apply(this, arguments);
        }
        j$g(a, b, c, d) {
            this.k2.apply(this, arguments);
        }
        get j$b() {
            return this.dn;
        }
        j$a() {
            return this.ag.apply(this, arguments);
        }
    }
    CategoryAxisBase.$t = markType(CategoryAxisBase, 'CategoryAxisBase', Axis.$, [ICategoryScaler_$type]);
    CategoryAxisBase.q5 = DependencyProperty.i("ItemsSource", IEnumerable_$type, CategoryAxisBase.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(CategoryAxisBase.$, a);
        if (c.cd != null) {
            c.cd.releaseFastItemsSource(b.oldValue);
        }
        a.ls("ItemsSource", b.oldValue, b.newValue);
    }));
    CategoryAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, CategoryAxisBase, 'ls', ['FastItemsSource:pm:q3', [IFastItemsSource_$type], 'Gap:pw:q4', [1, 0.2], 'MaximumGap:p3:q6', [1, 1], 'MinimumGapSize:p4:q7', [1, 0], 'Overlap:p5:q8', [1, 0], 'UseClusteringMode:pq:q9', [0, false]]);
    return CategoryAxisBase;
})();
/**
 * @hidden
 */
export let HorizontalAxisLabelPanelBase = /*@__PURE__*/ (() => {
    class HorizontalAxisLabelPanelBase extends AxisLabelPanelBase {
        constructor() {
            super(...arguments);
            this.dr = 0;
            this.dn = 0;
            this.dq = 0;
            this.dp = 0;
        }
        af() {
            return new HorizontalAxisLabelPanelBaseView(this);
        }
        cl(a) {
            super.cl(a);
            this.de = a;
        }
        ca() {
            this.de.a1();
        }
        dg() {
            return ((this.ah != null && this.ah.k()) || this.ae.c1) && this.bq() % 360 != 0;
        }
        dh() {
            return this.aq && !this.a0;
        }
        as() {
            return true;
        }
        ba() {
            let a = new List$1(Rect.$, 0);
            let b = new List$1(Boolean_$type, 0);
            this.a1 = false;
            this.a0 = false;
            this.a2 = false;
            let c = this.bq();
            let d = c * Math.PI / 180;
            if (this.dg()) {
                this.a0 = true;
            }
            this.aq = false;
            this.dt(a, b, d);
            if (this.ae != null && this.ae.b7 != null && (this.ae.b7.go || this.ae.b7.gn || this.ax() || this.ay()) && a != null) {
                for (let e = 0; e < a.count; e++) {
                    let f = a._inner[e];
                    if (this.c8.isEmpty) {
                        this.c8 = new Rect(0, f.left, f.top, f.width, f.height);
                    }
                    else {
                        if (this.c8.width < f.width) {
                            this.c8 = new Rect(0, f.left, f.top, f.width, f.height);
                        }
                    }
                }
            }
            this.aq = this.aq || this.ap(a, b);
            if (this.aq) {
                this.dv(a, b);
            }
            else {
                this.dw();
            }
            let g = this.ae.db();
            if (!g) {
                this.ds(c);
            }
            else {
                this.ag.ab();
            }
            if (this.a0) {
                for (let h = 0; h < a.count; h++) {
                    let i = a._inner[h];
                    i.x = this.bf._inner[h].h;
                    a._inner[h] = i;
                }
            }
            let j = 0;
            if (this.dh()) {
                j = ((() => { let k = this.b3(this.dn, a, b); a = k.p1; return k.ret; })());
            }
            if (this.aq && !this.a1) {
                if (j > 0) {
                    if (this.de.a0()) {
                        this.a2 = true;
                    }
                }
            }
            if (this.aq && this.df()) {
                this.at = true;
                let k = this.c6.width;
                let l = this.dl();
                let m = this.dk();
                let n = this.bf.count > 1 ? this.bf._inner[1].h - this.bf._inner[0].h : k;
                let o = Math.abs(n * 0.8);
                let p = 0;
                let q = Math.abs(Math.atan(this.dn / n) * 180 / Math.PI);
                let r = this.ag.q();
                let s = this.ag.r();
                for (let t = 0; t < a.count; t++) {
                    if (b._inner[t]) {
                        continue;
                    }
                    if (this.an) {
                        if (t > 0 && t < a.count - 1) {
                            let u = this.bf.count > 1 ? this.bf._inner[t].h - (a._inner[t - 1].x + a._inner[t - 1].width) : k;
                            let v = this.bf.count > 1 ? a._inner[t + 1].x - this.bf._inner[t].h : k;
                            o = Math.abs(Math.min(Math.abs(u * 2), Math.abs(v * 2)) * 0.8);
                        }
                        else {
                            if (t == 0) {
                                let w = this.bf.count > 1 ? a._inner[t + 1].x - this.bf._inner[t].h : k;
                                o = Math.abs((n * 2) * 0.8);
                            }
                            if (t == a.count - 1) {
                                let x = this.bf.count > 1 ? this.bf._inner[t].h - (a._inner[t - 1].x + a._inner[t - 1].width) : k;
                                o = Math.abs((x * 2) * 0.8);
                            }
                        }
                    }
                    let y = Math.min(a._inner[t].width, o);
                    p = this.a0 ? this.bf._inner[t].h : this.bf._inner[t].h - y / 2;
                    let z = AngleSimplifier.a(c);
                    let aa = (z >= q && z <= 180 - q) || (z >= 180 + q && z <= 360 - q);
                    let ab = a._inner[t];
                    if (this.a0 && aa) {
                        let ac = this.b0(this.bg._inner[t]);
                        o = Math.min((m / Math.abs(Math.sin(d))) + r + s, ac);
                    }
                    ab.x = p;
                    ab.width = Math.min(o, ab.width);
                    a._inner[t] = ab;
                    if (!(typeCast(TextBlock.$, this.bg._inner[t]) !== null)) {
                        this.bg._inner[t].width = Math.min(o, ab.width);
                    }
                    let ad = typeCast(TextBlock.$, this.bg._inner[t]);
                    if (ad != null) {
                        let ae = this.al(t, ad, o, r, s);
                        if (this.a2) {
                            ad.height = m;
                        }
                        else if (!Base.equalsStatic(ad.al, ae.b)) {
                            ad.al = ae.b;
                            this.bg._inner[t].width = Math.min(o, this.bp(this.bg._inner[t]));
                            this.dq = Math.min(this.dq, this.bg._inner[t].width);
                        }
                    }
                }
                if (!g) {
                    this.ds(c);
                }
            }
            if (this.di()) {
                this.du(a);
            }
            return a;
        }
        dt(a, b, c) {
            let d = this.bx();
            let e = this.dm();
            this.dn = -1.7976931348623157E+308;
            this.dr = -1.7976931348623157E+308;
            this.dp = -1.7976931348623157E+308;
            this.dq = -1.7976931348623157E+308;
            let f = this.ag.q();
            let g = this.ag.r();
            let h = this.ag.s();
            let i = this.ag.p();
            let j = this.c6.top;
            let k = (this.c6.height - d);
            let l = false;
            for (let m = 0; m < this.bg.count; m++) {
                if (!this.bf._inner[m].b) {
                    l = true;
                }
            }
            for (let n = 0; n < this.bg.count; n++) {
                if (this.bf == null || n >= this.bf.count) {
                    break;
                }
                let o, p, q, r, s, t;
                let u = this.bg._inner[n];
                s = this.bp(u);
                t = this.bo(u);
                r = s + this.ag.q() + this.ag.r();
                q = t + h + i;
                let v = this.bf._inner[n].b;
                let w = this.bf._inner[n].a;
                let x = this.bf._inner[n].e;
                if (this.a0) {
                    o = this.bf._inner[n].h;
                }
                else {
                    o = this.bf._inner[n].h - r / 2;
                }
                p = j + e;
                if (!v || !l) {
                    this.dn = Math.max(q, this.dn);
                    this.dr = Math.max(r, this.dr);
                    this.dp = Math.max(t, this.dp);
                    this.dq = Math.max(s, this.dq);
                }
                if (v && w) {
                    if (this.a0) {
                        o = o + x;
                    }
                    else {
                        o = o + (x / 2);
                    }
                }
                let y = new Rect(0, o, p, r, q);
                a.add(y);
                b.add(v);
                let z = r * Math.abs(Math.sin(c));
                this.aq = this.aq || z > k;
            }
            if (this.ae != null && this.ae.cs) {
                let aa = -1;
                for (let ab = 0; ab < this.bg.count; ab++) {
                    let ac = this.bg._inner[ab];
                    aa = Math.max(ac.ah, aa);
                }
                if (aa >= 0 && !isNaN_(aa)) {
                    for (let ad = 0; ad < this.bg.count; ad++) {
                        let ae = this.bg._inner[ad];
                        ae.ah = aa;
                    }
                }
            }
        }
        ds(a) {
            let b = a * (Math.PI / 180);
            let c = this.dq;
            let d = this.dp;
            if (this.ax() || this.ay()) {
                let e = this.ag.q();
                let f = this.ag.r();
                let g = this.ag.s();
                let h = this.ag.p();
                c = this.c8.width;
                d = this.c8.height;
                c = this.c8.width - (e + f);
                d = this.c8.height - (g + h);
            }
            let i = Math.abs(c * Math.sin(b)) + Math.abs(d * Math.cos(b));
            i += this.ag.s() + this.ag.p();
            let j = this.bx();
            let k = (i) + (j) + this.ae.fc;
            if (this.ae.a4 != null) {
                let l = this.ae.a4.maximumExtentPercentage;
                let m = this.ae.a4.maximumExtent;
                if (!isNaN_(m) && (m > 0)) {
                    k = Math.min(m, k);
                }
                else if (!isNaN_(l) && (l > 0) && (l <= 1)) {
                    let n = this.ae.b5.dw.ba;
                    m = l * n;
                    k = Math.min(m, k);
                }
            }
            this.bm = Math.max(this.ae.gf, k);
        }
        du(a) {
            this.de.a2(a);
        }
        dv(a, b) {
        }
        dw() {
        }
        get_az() {
            return true;
        }
        cq(a, b) {
            let c = a.l;
            let d = a.m;
            let e = 0;
            let f = c / 2;
            let g = new TransformGroup();
            let h = AngleSimplifier.a(this.bq());
            let i = ((() => {
                let $ret = new RotateTransform();
                $ret.j = h;
                $ret.k = e;
                $ret.l = f;
                return $ret;
            })());
            let j = 0;
            let k = 0;
            if (h != 0 && h != 360) {
                if (h > 0 && h < 180) {
                    j = -Math.sin(MathUtil.p(h)) * (c / 2);
                }
                else {
                    i.k = d;
                    k = -d;
                    j = -Math.sin(MathUtil.p(h - 180)) * (c / 2);
                }
            }
            let l = ((() => {
                let $ret = new TranslateTransform();
                $ret.k = j;
                $ret.j = k;
                return $ret;
            })());
            g.j.add(i);
            g.j.add(l);
            a.j = g;
        }
        cr(a, b, c) {
            let d = a.l;
            let e = a.m;
            let f = -b;
            let g = d / 2;
            let h = new TransformGroup();
            let i = AngleSimplifier.a(this.bq());
            let j = ((() => {
                let $ret = new RotateTransform();
                $ret.j = i;
                $ret.k = f;
                $ret.l = g;
                return $ret;
            })());
            let k = 0;
            let l = 0;
            if (i != 0 && i != 360) {
                if (i > 0 && i < 180) {
                    k = -Math.sin(MathUtil.p(i)) * (d / 2);
                    l = b;
                }
                else {
                    j.k = e;
                    l = -e;
                    k = -Math.sin(MathUtil.p(i - 180)) * (d / 2);
                }
            }
            let m = ((() => {
                let $ret = new TranslateTransform();
                $ret.k = k;
                $ret.j = l;
                return $ret;
            })());
            h.j.add(j);
            h.j.add(m);
            a.j = h;
        }
        di() {
            return !this.a1 && !this.a0;
        }
        df() {
            if (this.ae != null && this.ae.b7 != null && this.ae.b7.gp) {
                return false;
            }
            return true;
        }
        b3(a, b, c) {
            let d = 0;
            let e = new List$1(Rect.$, 0);
            let f = this.dm() + this.c6.top;
            let g = this.dl();
            let h = f + g;
            if (a * 3 <= this.bi) {
                d = 3;
            }
            else if (a * 2 <= this.bi) {
                d = 2;
            }
            else {
                return {
                    ret: d,
                    p1: b
                };
            }
            let i = 0;
            for (let j = 0; j < b.count; j++) {
                let 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.aq = this.ap(e, c);
            if (!this.aq) {
                this.a1 = true;
                b = e;
            }
            return {
                ret: d,
                p1: b
            };
        }
        c5() {
            let a = this.ak(this.ae.b4);
            let b = this.bx();
            let c = this.ai;
            let d = 0;
            if (a == 3) {
                d += this.c6.top;
                if (c == 1 || c == 5) {
                    d += this.ae.fc;
                }
            }
            else {
                d = this.c6.bottom - b;
                if (c == 4 || c == 0) {
                    d -= this.ae.fc;
                }
            }
            let e = this.bz();
            let f = 0;
            let g = this.ae.b4 == null ? 1 : this.ae.b4.horizontalAlignment;
            if (g == 0) {
                f = this.c6.left;
            }
            else if (g == 2) {
                f = this.c6.right - e;
            }
            else {
                f = (this.c6.left + (this.c6.width / 2)) - (e / 2);
            }
            return new Rect(0, f, d, e, b);
        }
        dm() {
            let a = 0;
            let b = this.ak(this.ae.b4);
            if (b == 3) {
                a += this.bx();
            }
            let c = this.ai;
            if (c == 1 || c == 5) {
                a += this.ae.fc;
            }
            return a;
        }
        dj() {
            let a = 0;
            let b = this.ak(this.ae.b4);
            if (b == 4) {
                a += this.bx();
            }
            let c = this.ai;
            if (c == 0 || c == 4) {
                a += this.ae.fc;
            }
            return a;
        }
        dl() {
            let a = (this.bi - this.dm()) - this.dj();
            if (a < 0) {
                a = 0;
            }
            return a;
        }
        dk() {
            let a = ((this.dl() - this.ag.s()) - this.ag.p());
            if (a < 0) {
                a = 0;
            }
            return a;
        }
        cd() {
            let a = this.ag.at();
            this.ae.kk(a);
            if (this.ah != null && this.ah.visibility != 0) {
                return;
            }
            let b = this.ae.fc;
            if (b == 0) {
                return;
            }
            let c = this.a7();
            if (c == null) {
                return;
            }
            let d = this.c6.top;
            let e;
            let f = this.ai;
            if (f == 0 || f == 4) {
                d = this.c6.bottom;
                e = d - this.ae.fc;
            }
            else {
                e = d + this.ae.fc;
            }
            let g = this.ag.b();
            for (let h of fromEnum(c)) {
                this.cx(a, h, d, e, this.c9, g);
            }
            if (!this.ab.contains(this.ag.aw)) {
                this.ab.add(this.ag.aw);
            }
        }
        bb(a) {
            if (this.ae.d6 || this.ae.d8) {
                let b = this.ag.q();
                let c = this.ag.s();
                let d = this.ag.r();
                let e = this.ag.p();
                let f = Math.max(b, Math.max(c, Math.max(d, e)));
                let g = new Thickness(0, f);
                if (this.a0) {
                    g = new Thickness(0, Math.sqrt((f * f) / 2));
                }
                let h = this.a9(a);
                let i = new List$1(Thickness.$, 0);
                if (h.count < 1) {
                    return a;
                }
                h.aa((j, k) => {
                    let l = this.c3(j, a._inner[j], g);
                    let m = this.c3(k, a._inner[k], g);
                    let n = l.left + l.width * 0.5;
                    let o = m.left + m.width * 0.5;
                    if (n < o) {
                        return -1;
                    }
                    if (n > o) {
                        return 1;
                    }
                    return 0;
                });
                if (this.ae.d6 && this.ae.d5 && h.count > 1) {
                    let j = 10;
                    let k = 2;
                    let l = new List$1(OverlayCollisionInfo.$, 0);
                    for (let m = 0; m < h.count; m++) {
                        let n = h._inner[m];
                        let o = this.bf._inner[n];
                        let p = this.c3(n, a._inner[n], g);
                        let q = p.width * 0.5;
                        let r = new OverlayCollisionInfo();
                        r.d = p.width;
                        r.e = p.width;
                        r.c = p.width;
                        l.add(r);
                        if (m > 0) {
                            let s = h._inner[m - 1];
                            let t = this.bf._inner[s];
                            let u = this.c3(s, a._inner[s], g);
                            let v = u.width * 0.5;
                            let w = (o.h - t.h) - k;
                            if (q + v > w) {
                                let x = w * 0.5;
                                if (q >= x && v >= x) {
                                    let y = q - x;
                                    r.c = p.width - (y * 2);
                                }
                                else if (q > x && v < x) {
                                    let z = q - (w - v);
                                    r.c = p.width - (z * 2);
                                }
                            }
                        }
                        if (m < h.count - 1) {
                            let aa = h._inner[m + 1];
                            let ab = this.bf._inner[aa];
                            let ac = this.c3(aa, a._inner[aa], g);
                            let ad = ac.width * 0.5;
                            let ae = (ab.h - o.h) - k;
                            if (q + ad > ae) {
                                let af = ae * 0.5;
                                if (q >= af && ad >= af) {
                                    let ag = q - af;
                                    r.e = p.width - (ag * 2);
                                }
                                else if (q > af && ad < af) {
                                    let ah = q - (ae - ad);
                                    r.e = p.width - (ah * 2);
                                }
                            }
                        }
                    }
                    for (let ai = 0; ai < h.count; ai++) {
                        let aj = h._inner[ai];
                        let ak = l._inner[ai];
                        if (ak.a) {
                            if (ai > 0) {
                                let al = l._inner[ai - 1];
                                if (al.c < al.e) {
                                    let am = al.e - al.c;
                                    ak.c = Math.min(ak.c + am, ak.d);
                                }
                            }
                            if (ai < h.count - 1) {
                                let an = l._inner[ai + 1];
                                if (an.e < an.c) {
                                    let ao = an.c - an.e;
                                    ak.e = Math.min(ak.e + ao, ak.d);
                                }
                            }
                            let ap = a._inner[aj].width - (ak.d - ak.b);
                            this.dx(aj, a, this.bg, ap, j);
                        }
                    }
                }
                else {
                    for (let aq = 0; aq < h.count; aq++) {
                        let ar = h._inner[aq];
                        let as = a._inner[ar];
                        let at = this.c3(ar, a._inner[ar], g);
                        let au = this.ae.b7.y9.left;
                        if (this.ae.d8) {
                            if (as.left < (this.ae.b7.y9.left - au)) {
                                as = new Rect(0, as.left + ((this.ae.b7.y9.left - au) - as.left), as.top, as.width, as.height);
                                a._inner[ar] = as;
                            }
                        }
                    }
                    let av = this.av(a, h, g);
                    if (av && (this.ae.d6)) {
                        for (let aw = 0; aw < h.count - 1; aw++) {
                            let ax = h._inner[aw];
                            let ay = h._inner[aw + 1];
                            let az = a._inner[ax];
                            let a0 = a._inner[ay];
                            let a1 = this.c3(ax, a._inner[ax], g);
                            let a2 = this.c3(ay, a._inner[ay], g);
                            if (a1.intersectsWith(a2) || a1.left > a2.right) {
                                let a3 = new Rect(0, a1.right + 1 + (a0.left - a2.left), a0.top, a0.width, a0.height);
                                a._inner[ay] = a3;
                            }
                        }
                    }
                    for (let a4 = h.count - 1; a4 >= 0; a4--) {
                        let a5 = h._inner[a4];
                        let a6 = a._inner[a5];
                        let a7 = this.c3(a5, a._inner[a5], g);
                        let a8 = this.ae.b7.dw.a8;
                        if (this.ae.d8) {
                            if (a7.right > this.ae.b7.y9.right + a8) {
                                a6 = new Rect(0, a6.left - (a7.right - (this.ae.b7.y9.right + a8)), a6.top, a6.width, a6.height);
                                a._inner[a5] = a6;
                            }
                        }
                    }
                    if (this.ae.d6) {
                        for (let a9 = h.count - 1; a9 >= 1; a9--) {
                            let ba = h._inner[a9];
                            let bb = h._inner[a9 - 1];
                            let bc = a._inner[ba];
                            let bd = a._inner[bb];
                            let be = this.c3(ba, a._inner[ba], g);
                            let bf = this.c3(bb, a._inner[bb], g);
                            if (be.intersectsWith(bf) || be.left < bf.right) {
                                let bg = new Rect(0, be.left - (bf.width + 1) + (bd.left - bf.left), bd.top, bd.width, bd.height);
                                a._inner[bb] = bg;
                            }
                        }
                    }
                }
            }
            return a;
        }
        dx(a, b, c, d, e) {
            let f = c._inner[a];
            let g = b._inner[a];
            let h = Math.min(g.width, Math.max(e, d));
            if (!(typeCast(TextBlock.$, f) !== null)) {
                f.width = Math.min(h, g.width);
            }
            let i = typeCast(TextBlock.$, f);
            if (i != null) {
                let j = this.al(a, i, h, 0, 0);
                if (!Base.equalsStatic(i.al, j.b)) {
                    i.al = j.b;
                    f.width = Math.min(h, this.bp(f));
                }
                h = j.a;
            }
            g.x = (g.x + g.width / 2) - h / 2;
            g.width = h;
            b._inner[a] = g;
        }
    }
    HorizontalAxisLabelPanelBase.$t = markType(HorizontalAxisLabelPanelBase, 'HorizontalAxisLabelPanelBase', AxisLabelPanelBase.$);
    return HorizontalAxisLabelPanelBase;
})();
/**
 * @hidden
 */
export let HorizontalAxisLabelPanel = /*@__PURE__*/ (() => {
    class HorizontalAxisLabelPanel extends HorizontalAxisLabelPanelBase {
        aj() {
            return 1;
        }
        a3(a) {
            return a == 5 || a == 4 || a == 1 || a == 0;
        }
    }
    HorizontalAxisLabelPanel.$t = markType(HorizontalAxisLabelPanel, 'HorizontalAxisLabelPanel', HorizontalAxisLabelPanelBase.$);
    return HorizontalAxisLabelPanel;
})();
/**
 * @hidden
 */
export let NumericAxisBase = /*@__PURE__*/ (() => {
    class NumericAxisBase extends Axis {
        constructor() {
            super();
            this.pn = 0;
            this.qo = 0;
            this.q7 = 0;
            this.qr = 0;
            this.qn = 0;
            this.q6 = 0;
            this.qq = 0;
            this.qm = 0;
            this.re = -1;
            this.rd = 0;
            this.rf = -1;
            this.p6 = false;
            this.qp = 0;
            this.p4 = false;
            this.p5 = false;
            this.rk = 0;
            this.pw = null;
            this.qi = false;
            this.qj = false;
            this.pj = null;
            this.pl = null;
            this.qt = -1;
            this.qs = -1;
            this.po = 0;
            this.qf = false;
            this.p0 = null;
            this.p3 = false;
            this.rk = 10;
        }
        bo() {
            return new NumericAxisBaseView(this);
        }
        ag() {
            return [this.qw, this.qv];
        }
        k6(a) {
            super.k6(a);
            this.pt = a;
        }
        km(a) {
            super.km(a);
            this.kp(a, "ActualMinimumValue");
            this.kp(a, "ActualMaximumValue");
            this.kp(a, "ActualMinorInterval");
            this.kp(a, "ActualInterval");
            this.kp(a, "ActualIsLogarithmic");
            this.kp(a, "LogarithmBase");
        }
        kp(a, b) {
            super.kp(a, b);
            let c = typeCast(NumericAxisBase.$, a);
            if (c == null) {
                return;
            }
            let d = this;
            if (b == "ActualMinimumValue") {
                c.q9 = Axis.gs(d.q3, d.qw);
            }
            if (b == "ActualMaximumValue") {
                c.q8 = Axis.gs(d.q2, d.qv);
            }
            if (b == "ActualMinorInterval") {
                c.ra = Axis.gs(d.q4, d.qx);
            }
            if (b == "ActualInterval") {
                c.q5 = Axis.gs(d.q0, d.qu);
            }
            if (b == "ActualIsLogarithmic") {
                c.qg = Axis.d4(d.ps, d.p8);
            }
            if (b == "LogarithmBase") {
                c.rj = truncate(Axis.gs(d.q1, d.rj));
            }
        }
        fe(a, b) {
            let c = a < this.qw ? this.qw : a;
            c = a > this.qv ? this.qv : c;
            return c;
        }
        get_dq() {
            return true;
        }
        get pp() {
            return EnumUtil.getEnumValue(AxisRangeBufferMode_$type, this.c(NumericAxisBase.s5));
        }
        set pp(a) {
            this.h(NumericAxisBase.s5, enumGetBox(AxisRangeBufferMode_$type, a));
        }
        get pq() {
            return this.pn;
        }
        set pq(a) {
            this.pn = a;
        }
        get qw() {
            return this.qo;
        }
        set qw(a) {
            if (this.qw != a) {
                let b = this.qo;
                this.qo = a;
                this.q7 = Math.log(this.qw);
                this.ls("ActualMinimumValue", b, this.qw);
            }
        }
        hz() {
            return this.q9;
        }
        get qz() {
            return this.qr;
        }
        set qz(a) {
            if (this.qz != a) {
                let b = this.qr;
                this.qr = a;
                this.ls("ActualVisibleMinimumValue", b, this.qz);
            }
        }
        get qv() {
            return this.qn;
        }
        set qv(a) {
            if (this.qv != a) {
                let b = this.qn;
                this.qn = a;
                this.q6 = Math.log(this.qv);
                this.ls("ActualMaximumValue", b, this.qv);
            }
        }
        hy() {
            return this.qv;
        }
        get qy() {
            return this.qq;
        }
        set qy(a) {
            if (this.qy != a) {
                let b = this.qq;
                this.qq = a;
                this.ls("ActualVisibleMaximumValue", b, this.qy);
            }
        }
        get qu() {
            return this.qm;
        }
        set qu(a) {
            if (this.qu != a) {
                let b = this.qm;
                this.qm = a;
                this.ls("ActualInterval", b, this.qu);
            }
        }
        gi() {
            return this.qu;
        }
        get rh() {
            return this.re;
        }
        set rh(a) {
            this.re = a;
        }
        get rg() {
            return this.rd;
        }
        set rg(a) {
            if (this.rg != a) {
                let b = this.rd;
                this.rd = a;
                this.ls("ActualMaxPrecision", b, this.rg);
            }
        }
        get ri() {
            return this.rf;
        }
        set ri(a) {
            this.rf = a;
        }
        get qa() {
            return this.p6;
        }
        set qa(a) {
            this.p6 = a;
        }
        get qx() {
            return this.qp;
        }
        set qx(a) {
            if (this.qx != a) {
                let b = this.qp;
                this.qp = a;
                this.ls("ActualMinorInterval", b, this.qx);
            }
        }
        get p8() {
            return this.p4;
        }
        set p8(a) {
            if (this.p8 != a) {
                let b = this.p4;
                if (b != a) {
                    this.p4 = a;
                    this.ls("ActualIsLogarithmic", b, this.p8);
                }
            }
        }
        get p9() {
            return this.p5;
        }
        set p9(a) {
            this.p5 = a;
        }
        get qh() {
            return this.p8 && this.qw > 0 && this.rk > 1;
        }
        lz(a) {
            super.lz(a);
            if (this.qh && this.b7 != null) {
                let b = this.o1();
                let c = this.o0();
                let d = this.px(this.o6, this.b7.yr, b, c);
                if (d == null) {
                    return;
                }
                for (let e = 0; e < d.k.count; e++) {
                    let f = this.rj;
                    let g = d.k._inner[e];
                    let h = Math.min(g.d, g.c);
                    let i = Math.max(g.d, g.c);
                    let j = Math.floor(logBase(h, f));
                    let k = Math.ceil(logBase(i, f));
                    if (k - j < 2) {
                        if (typeCast(LogarithmicTickmarkValues.$, this.p0) !== null) {
                            this.p0 = new LinearTickmarkValues();
                        }
                    }
                    else {
                        this.p0 = this.p2 != null ? this.p2 : ((() => {
                            let $ret = new LogarithmicTickmarkValues();
                            $ret.x = f;
                            return $ret;
                        })());
                    }
                }
            }
        }
        me(a, b) {
            super.me(a, b);
            if (this.rl != -1) {
                this.rg = this.rm();
            }
            else {
                if (this.rg != -1) {
                    this.rg = -1;
                }
            }
        }
        lf(a) {
            super.lf(a);
            this.q9 = a;
        }
        le(a) {
            super.lf(a);
            this.q8 = a;
        }
        la(a, b, c, d) {
            super.la(a, b, c, d);
            switch (b) {
                case "SeriesViewer":
                    this.rg = this.rm();
                    break;
                case NumericAxisBase.$$p[18]:
                    this.qa = this.qk;
                    this.rg = this.rm();
                    break;
                case NumericAxisBase.$$p[13]:
                    this.ri = this.rl;
                    this.rg = this.rm();
                    break;
                case "ActualMaxPrecision":
                    this.rh = this.rg;
                    this.ed();
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[0]:
                case NumericAxisBase.$$p[1]:
                    if (this.rn != null) {
                        this.pj = new BindingFormatter();
                        this.pj.j = this.rn;
                        this.pj.d = this.pi;
                    }
                    else {
                        this.pj = null;
                    }
                    break;
                case "AutoRangeBufferMode":
                    this.pq = this.pp;
                    this.kl();
                    this.ed();
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[15]:
                    this.ed();
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[14]:
                    this.ed();
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[8]:
                    this.p9 = this.qb;
                    this.ed();
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[11]:
                    this.qi = true;
                    this.p8 = this.qg;
                    break;
                case Axis.$$p[32]:
                case Axis.$$p[31]:
                case NumericAxisBase.$$p[10]:
                case NumericAxisBase.$$p[16]:
                    this.d0 = true;
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[12]:
                    this.qi = true;
                    this.rk = this.rj;
                    if (this.p8) {
                        this.ed();
                        this.sl();
                        this.ly(false);
                    }
                    break;
                case NumericAxisBase.$$p[17]:
                    let e = new AxisRangeChangedEventArgs(0, this.qw, this.qw, this.qv, this.qv);
                    this.lt(e);
                    this.d0 = true;
                    this.ly(false);
                    break;
                case Axis.$$p[41]:
                    this.pw = this.pu();
                    this.d0 = true;
                    this.ly(false);
                    break;
                case "TickmarkValues":
                    this.sn();
                    break;
                case "ActualIsLogarithmic":
                    this.ed();
                    this.sl();
                    this.d0 = true;
                    this.sn();
                    this.ly(false);
                    break;
                case "ActualTickmarkValues":
                    this.d0 = true;
                    this.ly(false);
                    break;
                case "AbbreviateLargeNumbers":
                    this.ly(false);
                    break;
                case NumericAxisBase.$$p[2]:
                case NumericAxisBase.$$p[7]:
                    this.kw(b);
                    break;
            }
        }
        kw(a) {
            super.kw(a);
            switch (a) {
                case NumericAxisBase.$$p[3]:
                case NumericAxisBase.$$p[4]:
                    this.ks(a);
                    break;
                case NumericAxisBase.$$p[2]:
                case NumericAxisBase.$$p[7]:
                case NumericAxisBase.$$p[6]:
                case NumericAxisBase.$$p[5]:
                    this.kr(a);
                    break;
            }
        }
        sl() {
            for (let a of fromEnum(this.eo())) {
                a.r8(false);
            }
        }
        pm() {
            let a = new AxisRange(Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY);
            let b = false;
            if (this.b7 != null) {
                for (let c of fromEnum(this.eo())) {
                    let d = c.ay(this);
                    if (d != null) {
                        b = true;
                        a = new AxisRange(Math.min(a.c, d.c), Math.max(a.b, d.b));
                    }
                }
            }
            if (b) {
                if (this.qt >= 0) {
                    a = new AxisRange(a.c - this.qt, a.b);
                }
                if (this.qs >= 0) {
                    a = new AxisRange(a.c, a.b + this.qs);
                }
                this.pl = a;
                return a;
            }
            this.pl = null;
            return null;
        }
        ql(a) {
            if (a == 1 || a == 2 || a == 3) {
                let b = this.pl;
                if (b == null) {
                    b = this.pm();
                }
                if (b == null) {
                    return false;
                }
                if (this.b7 == null || this.b7.y9.isEmpty || this.b7.y9.height == 0 || this.b7.y9.width == 0) {
                    return false;
                }
                let c = -1;
                let d = -1;
                for (let e of fromEnum(this.ep())) {
                    let 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);
                        }
                    }
                }
                if (c >= 0 || d >= 0) {
                    this.qt = c;
                    this.qs = d;
                    return true;
                }
                return false;
            }
            return false;
        }
        pr() {
            if (this.pq == 0) {
                if (this.b7 != null) {
                    if (this.dy) {
                        if (this.b7.ck == 2) {
                            return 1;
                        }
                        if (this.dp) {
                            if (this.b7.ck == 4) {
                                return 3;
                            }
                            if (this.b7.ck == 3) {
                                return 2;
                            }
                        }
                        else {
                            if (this.b7.ck == 4) {
                                return 2;
                            }
                            if (this.b7.ck == 3) {
                                return 3;
                            }
                        }
                    }
                    else {
                        if (this.b7.ci == 2) {
                            return 1;
                        }
                        if (this.dp) {
                            if (this.b7.ci == 4) {
                                return 3;
                            }
                            if (this.b7.ci == 3) {
                                return 2;
                            }
                        }
                        else {
                            if (this.b7.ci == 4) {
                                return 2;
                            }
                            if (this.b7.ci == 3) {
                                return 3;
                            }
                        }
                    }
                }
                return 4;
            }
            else {
                return this.pq;
            }
        }
        sj(a, b, c, d, e, f, g) {
            let h = AutoRangeCalculator.a(a, b, c, d, e, f, g);
            f = h.p5;
            g = h.p6;
            return {
                p5: f,
                p6: g
            };
        }
        ef() {
            if (this.d0 && this.eg) {
                this.b1 = this.b0();
            }
            let a = this.p8 && !isNaN_(this.rj) && !isInfinity(this.rj) && this.rj > 1;
            let b;
            let c;
            let d = this.pr();
            if (d != this.po) {
                this.po = d;
                this.kl();
            }
            let e = false;
            if (!this.o6.isEmpty && d != 4) {
                if (this.qt == -1 && this.qs == -1) {
                    e = true;
                }
            }
            let f = this.sj(this, this.q9, this.q8, a, this.rj, b, c);
            b = f.p5;
            c = f.p6;
            if (b != this.qw || c != this.qv || this.qi) {
                if (d != 4 && (this.qt >= 0 || this.qs >= 0)) {
                    this.kl();
                    let g = this.sj(this, this.q9, this.q8, a, this.rj, b, c);
                    b = g.p5;
                    c = g.p6;
                }
            }
            if (b != this.qw || c != this.qv || this.qi || e) {
                this.qi = false;
                let h = new AxisRangeChangedEventArgs(0, this.qw, b, this.qv, c);
                this.qw = b;
                this.qv = c;
                if (!this.o6.isEmpty && d != 4) {
                    if (this.ql(d)) {
                        let i = this.sj(this, this.q9, this.q8, a, this.rj, b, c);
                        b = i.p5;
                        c = i.p6;
                        h = new AxisRangeChangedEventArgs(0, h.oldMinimumValue, b, h.oldMaximumValue, c);
                        this.qw = b;
                        this.qv = c;
                    }
                }
                this.lt(h);
                this.sm(h);
                this.ly(true);
                return true;
            }
            return false;
        }
        kl() {
            this.qt = -1;
            this.qs = -1;
        }
        sm(a) {
        }
        d3(a) {
            let b = super.d3(a);
            if (b) {
                this.ed();
            }
            return b;
        }
        cx(a) {
            let b = super.cx(a);
            if (b) {
                this.ed();
            }
            return b;
        }
        pv(a) {
            return new NumericAxisRenderer(a);
        }
        pu() {
            let a = ((() => {
                let $ret = new AxisLabelManager();
                $ret.a = this;
                $ret.f = this.er;
                $ret.e = this.eq;
                $ret.b = this.a1;
                return $ret;
            })());
            if (this.a4 != null) {
                this.a4.registerAxis(this);
            }
            let b = this.pv(a);
            b.u = () => {
                let c = this.bp.ba();
                let d = this.bp.bd();
                let e = this.bp.bb();
                let f = this.bp.bc();
                this.ma();
                this.kk(c);
                this.kk(d);
                this.kk(e);
                this.kk(f);
            };
            b.o = (c, d) => !d.isEmpty && !c.isEmpty;
            b.d = (c, d, e, f) => this.px(c, d, e, f);
            b.g = (c, d) => {
                this.qf = d;
                let e = this.hw(c);
                this.qf = false;
                return e;
            };
            return b;
        }
        py() {
            return new NumericAxisRenderingParameters();
        }
        sk() {
        }
        pz() {
            return null;
        }
        rm() {
            if (!this.qa && (this.oz.isEmpty || this.oz.width < 1 || this.oz.height < 1)) {
                return -1;
            }
            return this.ri;
        }
        px(a, b, c, d) {
            let e = this.py();
            let f = this.bp.ba();
            let g = this.bp.bd();
            let h = this.bp.bb();
            let i = this.bp.bc();
            let j = this.bp.f();
            let k = this.bp.g();
            let l = this.bp.h();
            e.u = f;
            e.x = g;
            e.v = h;
            e.w = i;
            e.a = j;
            e.c = k;
            e.d = l;
            e.l = this.qv;
            e.m = this.qw;
            e.h = this.qd;
            e.f = this.p1;
            e.aa = a;
            e.z = c;
            e.y = d;
            e.ab = b;
            e.o = this.gm();
            e.s = this.rh;
            e.g = this.qc();
            e.p = this.q5;
            e.q = this.ra;
            e.t = this.hx;
            if (this.hx == null && (this.az != null || this.ai != null || this.pt.o())) {
                e.t = "Format";
            }
            e.j = this.ea;
            e.ac = this.p7;
            return e;
        }
        rc(a) {
            let b = this.o1();
            let c = new ScalerParams(0, this.b7.yr, this.o6, this.dn, b);
            return this.f9(a, c);
        }
        qc() {
            return !isNaN_(this.q5);
        }
        get qe() {
            return !isNaN_(this.q9);
        }
        get qd() {
            return !isNaN_(this.q8);
        }
        sn() {
            if (this.p2 != null) {
                this.p1 = this.p2;
            }
            else if (this.p8) {
                this.p1 = new LogarithmicTickmarkValues();
                this.pt.br();
            }
            else {
                this.p1 = new LinearTickmarkValues();
            }
        }
        get p2() {
            return typeCast(TickmarkValues.$, this.c(NumericAxisBase.s8));
        }
        set p2(a) {
            this.h(NumericAxisBase.s8, a);
        }
        get p1() {
            if (this.p0 == null) {
                this.sn();
            }
            return this.p0;
        }
        set p1(a) {
            let b = this.p0;
            let c = b != a;
            if (c) {
                this.p0 = a;
                this.ls("ActualTickmarkValues", b, a);
            }
        }
        get p7() {
            return this.p3;
        }
        set p7(a) {
            let b = this.p7;
            if (a != b) {
                this.p3 = a;
                this.ls("AbbreviateLargeNumbers", b, this.p7);
            }
        }
    }
    NumericAxisBase.$t = markType(NumericAxisBase, 'NumericAxisBase', Axis.$);
    NumericAxisBase.s5 = DependencyProperty.i("AutoRangeBufferMode", AxisRangeBufferMode_$type, NumericAxisBase.$, new PropertyMetadata(2, enumGetBox(AxisRangeBufferMode_$type, 0), (a, b) => a.ls("AutoRangeBufferMode", b.oldValue, b.newValue)));
    NumericAxisBase.s8 = DependencyProperty.i("TickmarkValues", TickmarkValues.$, NumericAxisBase.$, new PropertyMetadata(1, (a, b) => a.ls("TickmarkValues", b.oldValue, b.newValue)));
    NumericAxisBase.$$p = markDep(DependencyProperty, PropertyMetadata, NumericAxisBase, 'ls', ['AbbreviatedLabelFormat:rn:so', [2, null], 'AbbreviatedLabelFormatSpecifiers:pi:sp', [Array_$type, null], 'CompanionAxisInterval:q0:sq', [1, NaN], 'CompanionAxisIsLogarithmic:ps:sr', [FeatureState_$type, enumGetBox(FeatureState_$type, 0)], 'CompanionAxisLogarithmBase:q1:ss', [1, NaN], 'CompanionAxisMaximumValue:q2:st', [1, NaN], 'CompanionAxisMinimumValue:q3:su', [1, NaN], 'CompanionAxisMinorInterval:q4:sv', [1, NaN], 'FavorLabellingScaleEnd:qb:sw', [0, false], 'FormatAbbreviatedLabel:pk:sx', [Delegate_$type], 'Interval:q5:sy', [1, NaN], 'IsLogarithmic:qg:sz', [0, false], 'LogarithmBase:rj:s0', [1, 10], 'MaxPrecision:rl:s2', [1, -1], 'MaximumValue:q8:s1', [1, NaN], 'MinimumValue:q9:s3', [1, NaN], 'MinorInterval:ra:s4', [1, NaN], 'ReferenceValue:rb:s6', [1, 0], 'ShouldApplyMaxPrecisionWhenZoomed:qk:s7', [0, false]]);
    return NumericAxisBase;
})();
/**
 * @hidden
 */
export let NumericScaler = /*@__PURE__*/ (() => {
    class NumericScaler extends DependencyObject {
        constructor() {
            super(...arguments);
            this.o = 0;
            this.n = 0;
            this.m = 0;
        }
        y(a) {
            this.l = a;
        }
        x(a) {
            this.k = a;
        }
        w(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;
            }
        }
        z() {
            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;
            }
        }
        j(a, b, c, d) {
            let e = new List$1(Number_$type, 2, a.count);
            for (let f = b; f < c; f++) {
                e.add(this.q(a.item(f), d));
            }
            return e;
        }
        v(a, b, c, d) {
            for (let e = b; e < c; e++) {
                a.item(e, this.p(a.item(e), d));
            }
        }
        u(a, b, c, d, e) {
            for (let f = 0; f < b.count; f++) {
                let g = b.item(f);
                for (let 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;
})();
/**
 * @hidden
 */
export let AxisRendererBase = /*@__PURE__*/ (() => {
    class AxisRendererBase extends Base {
        constructor(a) {
            super();
            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 = () => {
            };
            this.o = (b, c) => false;
            this.v = () => {
            };
            this.m = (b, c) => c;
            this.l = (b, c, d, e) => {
            };
            this.k = (b, c, d) => {
            };
            this.q = (b, c) => false;
            this.n = (b, c) => this.q(b, c);
            this.j = (b) => {
            };
            this.e = (b) => {
            };
            this.p = (b, c, d) => false;
            this.h = (b, c) => new LabelPosition(0, c);
            this.t = (b, c) => c;
            this.g = (b, c) => null;
            this.r = (b, c, d, e) => c;
            this.a = (b, c, d, e) => c;
            this.b = a;
            this.d = (b, c, d, e) => null;
        }
        c(a, b, c, d, e) {
            this.x(c, b);
            if (this.o(b, c)) {
                this.v();
                let f = this.d(b, c, d, e);
                this.x(c, b);
                if (f == null) {
                    this.aa();
                    return null;
                }
                if (f.k.count > 1 && !f.g) {
                    this.ab(f);
                }
                for (let g of fromEnum(f.k)) {
                    f.e = g;
                    if (isNaN_(g.c) || isInfinity(g.c) || isNaN_(g.d) || isInfinity(g.d)) {
                        continue;
                    }
                    if (g.d == g.c) {
                        continue;
                    }
                    this.e(f);
                    this.b.o(f.r);
                    let h = 0;
                    let i = 0;
                    let j = false;
                    let k = (l) => l;
                    if (this.f != null) {
                        k = this.i;
                    }
                    if (typeCast(CategoryAxisRenderingParameters.$, f) !== null) {
                        h = f.ac;
                        i = f.ag;
                        j = f.ad;
                    }
                    f.f = this.s(f);
                    f.f.s(((() => {
                        let $ret = new TickmarkValuesInitializationParameters();
                        $ret.n = f.e.d;
                        $ret.m = f.e.c;
                        $ret.g = f.m;
                        $ret.f = f.l;
                        $ret.k = f.e.b;
                        $ret.d = f.g;
                        $ret.l = f.p;
                        $ret.j = f.q;
                        $ret.h = f.o;
                        $ret.i = f.e.a;
                        $ret.q = f.e.e;
                        $ret.a = h;
                        $ret.r = i;
                        $ret.t = f.ab;
                        $ret.s = f.aa;
                        $ret.e = j;
                        $ret.c = k;
                        $ret.p = f.s;
                        return $ret;
                    })()));
                    this.y(f);
                }
                this.z();
                return f;
            }
            return null;
        }
        aa() {
            this.b.q();
        }
        ab(a) {
            let b = -1.7976931348623157E+308;
            let c = -2147483648;
            let d = 0;
            let e = 0;
            let f = false;
            let g = (h) => h;
            if (this.f != null) {
                g = this.i;
            }
            if (typeCast(CategoryAxisRenderingParameters.$, a) !== null) {
                d = a.ac;
                e = a.ag;
                f = a.ad;
            }
            for (let h of fromEnum(a.k)) {
                a.e = h;
                a.f.s(((() => {
                    let $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);
                }
            }
            for (let i of fromEnum(a.k)) {
                if (i.a == b) {
                    i.a = -1;
                    i.e = -1;
                }
                else {
                    i.a = b;
                    i.e = c;
                }
            }
        }
        x(a, b) {
            this.u();
            this.b.n(a, b);
            this.b.t();
        }
        z() {
            this.b.t();
            let a = false;
            if (this.b.d) {
                this.b.s(0);
            }
            else {
                let b = 0;
                for (let c of fromEnum(this.b.e)) {
                    let d = typeCast(FrameworkElement.$, c);
                    if (d == null) {
                        d = this.b.u(b);
                        let e = d.al;
                        let f = c.toString();
                        let g = 0;
                        let h = 0;
                        if (e != null) {
                            g = e.length;
                        }
                        if (f != null) {
                            h = f.length;
                        }
                        if (g != h) {
                            a = true;
                        }
                        d.al = f;
                        b++;
                    }
                    else {
                    }
                }
                if (a) {
                    this.b.p();
                }
                this.b.g();
                this.b.s(b);
            }
        }
        s(a) {
            return a.f;
        }
        y(a) {
            let b = a.f.j();
            let c = a.f.k();
            this.b.r(this.m(a, a.f.m));
            this.j(a);
            for (let d = 0; d < b.length; d++) {
                let e = a.f.p + d;
                let f = b[d];
                let g = f;
                let 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);
                let i = this.m(a, g);
                let 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)) {
                    let k = this.w(a, g, e, a.f.m);
                    if (k != null) {
                        this.b.i(k, this.h(a, i));
                    }
                }
            }
            if (a.j) {
                for (let l = 0; l < c.length; l++) {
                    let m = c[l];
                    let n = this.m(a, m);
                    a.b = a.d;
                    this.k(a, a.w, n);
                    a.b = null;
                }
            }
        }
        w(a, b, c, d) {
            return null;
        }
    }
    AxisRendererBase.$t = markType(AxisRendererBase, 'AxisRendererBase');
    return AxisRendererBase;
})();
/**
 * @hidden
 */
export let NumericAxisRenderer = /*@__PURE__*/ (() => {
    class NumericAxisRenderer extends AxisRendererBase {
        constructor(a) {
            super(a);
            this.ac = null;
            this.ad = false;
        }
        w(a, b, c, d) {
            let 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.t(b);
            }
            return e;
        }
        ae(a, b) {
            if (this.ad) {
                return a.toString();
            }
            if (this.ac == null) {
                this.ac = NumberAbbreviatorFactory.a(this.b.a.cl);
                if (this.ac == null) {
                    this.ad = true;
                    return MathUtil.t(a);
                }
            }
            return this.ac.abbreviate(a, b);
        }
    }
    NumericAxisRenderer.$t = markType(NumericAxisRenderer, 'NumericAxisRenderer', AxisRendererBase.$);
    return NumericAxisRenderer;
})();
/**
 * @hidden
 */
export let VerticalAxisLabelPanel = /*@__PURE__*/ (() => {
    class VerticalAxisLabelPanel extends AxisLabelPanelBase {
        constructor() {
            super(...arguments);
            this.dn = 0;
            this.dk = 0;
            this.dm = 0;
            this.dl = 0;
        }
        af() {
            return new VerticalAxisLabelPanelView(this);
        }
        cl(a) {
            super.cl(a);
            this.de = a;
        }
        ca() {
            this.de.a0();
        }
        bv() {
            return this.ae.b4 != null ? this.ae.b4.angle : -90;
        }
        dg() {
            let a = 0;
            let b = this.ak(this.ae.b4);
            if (b == 1) {
                a += this.bz();
            }
            let c = this.ai;
            if (c == 3 || c == 7) {
                a += this.ae.fc;
            }
            return a;
        }
        di() {
            let a = 0;
            let b = this.ak(this.ae.b4);
            if (b == 2) {
                a += this.bz();
            }
            let c = this.ai;
            if (c == 2 || c == 6) {
                a += this.ae.fc;
            }
            return a;
        }
        dj() {
            let a = (this.bi - this.dg()) - this.di();
            if (a < 0) {
                a = 0;
            }
            return a;
        }
        dh() {
            let a = ((this.dj() - this.ag.q()) - this.ag.r());
            if (a < 0) {
                a = 0;
            }
            return a;
        }
        ba() {
            let a = new List$1(Rect.$, 0);
            this.a1 = false;
            this.a0 = false;
            if (this.ah != null && this.ah.k() && this.bq() % 360 != 0) {
                this.a0 = true;
            }
            this.dn = -1.7976931348623157E+308;
            this.dk = -1.7976931348623157E+308;
            this.dm = -1.7976931348623157E+308;
            this.dl = -1.7976931348623157E+308;
            let b = this.ag.q();
            let c = this.ag.s();
            let d = this.ag.r();
            let e = this.ag.p();
            let f = this.dg();
            let g = false;
            if (!isNaN_(this.bj)) {
                this.dn = Math.max(this.bj, this.dn);
                this.dm = Math.max(this.bk, this.dm);
            }
            for (let h = 0; h < this.bg.count; h++) {
                let i = this.bg._inner[h];
                let j = this.bf._inner[h].b;
                let k = this.bo(i);
                let l = this.bp(i);
                let m = k + c + e;
                let n = l + b + d;
                let o = this.c6.left + f;
                let p = this.bf._inner[h].h - m / 2;
                if (j) {
                    let q = this.bf._inner[h].a;
                    let r = this.bf._inner[h].e;
                    let s = n + r;
                    let t = this.bj;
                    if ((isNaN_(this.bj) || s > this.bj || this.bf._inner[h].d) && !g) {
                        if (this.bf._inner[h].d) {
                            g = true;
                        }
                        this.bf._inner[h].d = false;
                        this.bj = s;
                        this.bk = s;
                    }
                    this.dn = Math.max(this.bj, this.dn);
                    this.dk = Math.max(m, this.dk);
                    this.dm = Math.max(this.bk, this.dm);
                    this.dl = Math.max(k, this.dl);
                }
                else {
                    this.dn = Math.max(n, this.dn);
                    this.dk = Math.max(m, this.dk);
                    this.dm = Math.max(l, this.dm);
                    this.dl = Math.max(k, this.dl);
                }
                let u = new Rect(0, o, p, n, m);
                a.add(u);
            }
            if (this.ae != null && this.ae.b7 != null && (this.ax() || this.ay()) && a != null) {
                for (let v = 0; v < a.count; v++) {
                    let w = a._inner[v];
                    if (this.c8.isEmpty) {
                        this.c8 = new Rect(0, w.left, w.top, w.width, w.height);
                    }
                    else {
                        if (this.c8.width < w.width) {
                            this.c8 = new Rect(0, w.left, w.top, w.width, w.height);
                        }
                    }
                }
            }
            let x = 0;
            if (this.a0) {
                x = this.bq() % 360;
                if (x < 0) {
                    x += 360;
                }
            }
            let y = this.ae.db();
            if (!y) {
                this.dp(x, b, d);
            }
            else {
                this.ag.ab();
            }
            if (this.a0) {
                for (let z = 0; z < a.count; z++) {
                    let aa = a._inner[z];
                    aa.y = this.bf._inner[z].h - this.dk / 2;
                    a._inner[z] = aa;
                }
            }
            let ab = false;
            if (!this.a0 && this.dn <= this.bi) {
                ab = true;
            }
            if (!ab) {
                this.at = true;
                let ac = this.c6.height;
                let ad = this.dj();
                let ae = ad;
                let af = this.bf.count > 1 ? Math.abs(this.bf._inner[1].h - this.bf._inner[0].h) : ac;
                let ag = Math.abs(Math.asin(af / this.dn) * (180 / Math.PI));
                let ah = (x >= ag && x <= 180 - ag) || (x - 180 >= ag && x - 180 <= 180 - ag);
                for (let ai = 0; ai < a.count; ai++) {
                    if (this.a0) {
                        let aj = x * (Math.PI / 180);
                        let ak = this.b0(this.bg._inner[ai]);
                        ae = Math.min(ad / Math.abs(Math.cos(aj)), ak);
                        if (ah) {
                            let al;
                            if (x > 0 && x < 90) {
                                al = (Math.PI / 180) * (90 - x);
                            }
                            else if (x > 270 && x < 360) {
                                al = (Math.PI / 180) * (x - 270);
                            }
                            else {
                                al = 0;
                            }
                            ae = af / Math.cos(al);
                        }
                    }
                    let am = a._inner[ai];
                    am.width = Math.min(am.width, ae);
                    a._inner[ai] = am;
                    if (!(typeCast(TextBlock.$, this.bg._inner[ai]) !== null)) {
                        this.bg._inner[ai].width = ae;
                    }
                    let an = typeCast(TextBlock.$, this.bg._inner[ai]);
                    if (an != null) {
                        let ao = this.al(ai, an, ae, b, d);
                        if (!Base.equalsStatic(an.al, ao.b)) {
                            an.al = ao.b;
                            this.bg._inner[ai].width = ae;
                        }
                    }
                }
                if (!y) {
                    this.dp(x, b, d);
                }
            }
            if (this.df()) {
                this.dq(a);
            }
            return a;
        }
        dp(a, b, c) {
            let d = a * (Math.PI / 180);
            let e = this.dm;
            let f = this.dl;
            if (this.ax() || this.ay()) {
                let g = this.ag.q();
                let h = this.ag.r();
                let i = this.ag.s();
                let j = this.ag.p();
                e = this.c8.width;
                f = this.c8.height;
                e = this.c8.width - (g + h);
                f = this.c8.height - (i + j);
            }
            let k = Math.abs(e * Math.cos(d)) + Math.abs(f * Math.sin(d));
            let l = this.bz();
            let m = (k + b + c) + (l) + this.ae.fc;
            if (this.ae.a4 != null) {
                let n = this.ae.a4.maximumExtentPercentage;
                let o = this.ae.a4.maximumExtent;
                if (!isNaN_(o) && (o > 0)) {
                    m = Math.min(o, m);
                }
                else if (!isNaN_(n) && (n > 0) && (n <= 1)) {
                    let p = this.ae.b5.dw.bb;
                    o = n * p;
                    m = Math.min(o, m);
                }
            }
            this.bm = Math.max(this.ae.gf, m);
        }
        dq(a) {
            this.de.a1(a, this.dn);
        }
        cq(a, b) {
            let c = 0;
            let d = this.dl / 2;
            let e = new TransformGroup();
            let f = AngleSimplifier.a(this.bq());
            let g = ((() => {
                let $ret = new RotateTransform();
                $ret.j = f;
                $ret.k = c;
                $ret.l = d;
                return $ret;
            })());
            let h = 0;
            let i = 0;
            if (f != 0 && f != 360) {
                f -= 90;
                if (f > 0 && f < 180) {
                    g.k = this.dm;
                    h = -this.dm + this.dl / 2;
                    h = h + Math.sin(MathUtil.p(f - 180)) * (this.dl / 2);
                }
                else {
                    if (f >= 180) {
                        h = h - Math.cos(MathUtil.p(f)) * (this.dl / 2);
                    }
                    else {
                        h = h + Math.cos(MathUtil.p(f)) * (this.dl / 2);
                    }
                }
            }
            let j = ((() => {
                let $ret = new TranslateTransform();
                $ret.j = h;
                $ret.k = i;
                return $ret;
            })());
            e.j.add(g);
            e.j.add(j);
            a.j = e;
        }
        df() {
            return !this.a1 && !this.a0;
        }
        c5() {
            let a = this.ak(this.ae.b4);
            let b = this.bz();
            let c = this.ai;
            let d = 0;
            if (a == 1) {
                d += this.c6.left;
                if (c == 3 || c == 7) {
                    d += this.ae.fc;
                }
            }
            else {
                d = this.c6.right - b;
                if (c == 6 || c == 2) {
                    d -= this.ae.fc;
                }
            }
            let e = this.bx();
            let f = 0;
            let g = this.ae.b4 == null ? 1 : this.ae.b4.verticalAlignment;
            if (g == 0) {
                f = this.c6.top;
            }
            else if (g == 2) {
                f = this.c6.bottom - e;
            }
            else {
                f = (this.c6.top + (this.c6.height / 2)) - (e / 2);
            }
            return new Rect(0, d, f, b, e);
        }
        ak(a) {
            if (a == null) {
                return this.ae.b7.a2(this.ae);
            }
            if (a.position == 0) {
                if (this.ae != null && this.ae.b7 != null) {
                    return this.ae.b7.a2(this.ae);
                }
                return 1;
            }
            return a.position;
        }
        aj() {
            return 2;
        }
        a3(a) {
            return a == 2 || a == 3 || a == 6 || a == 7;
        }
        cd() {
            let a = this.ag.at();
            this.ae.kk(a);
            if (this.ah != null && this.ah.visibility != 0) {
                return;
            }
            let b = this.ae.fc;
            if (b == 0) {
                return;
            }
            let c = this.a7();
            if (c == null) {
                return;
            }
            let d = this.c6.left;
            let e;
            let f = this.ai;
            if (f == 2 || f == 6) {
                d = this.c6.right;
                e = d - b;
            }
            else {
                e = d + b;
            }
            let g = this.ag.b();
            for (let h of fromEnum(c)) {
                this.cg(a, h, d, e, this.c9, g);
            }
            if (!this.ab.contains(this.ag.aw)) {
                this.ab.add(this.ag.aw);
            }
        }
    }
    VerticalAxisLabelPanel.$t = markType(VerticalAxisLabelPanel, 'VerticalAxisLabelPanel', AxisLabelPanelBase.$);
    return VerticalAxisLabelPanel;
})();
/**
 * @hidden
 */
export let ViewportUtils = /*@__PURE__*/ (() => {
    class ViewportUtils extends Base {
        static e(a, b, c, d) {
            if (!d.isEmpty) {
                let e = NumericScaler.ac;
                let 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;
        }
        static b(a, b, c, d) {
            if (!d.isEmpty) {
                let e = NumericScaler.ac;
                let 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;
        }
        static i(a, b, c, d) {
            if (!d.isEmpty) {
                let e = NumericScaler.ac;
                let 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;
        }
        static g(a, b, c, d) {
            if (!d.isEmpty) {
                let e = NumericScaler.ac;
                let 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;
        }
        static d(a, b, c, d) {
            let e = d;
            if (e.isEmpty) {
                e = c;
            }
            return e.width * a / b.width;
        }
        static a(a, b, c, d) {
            let e = d;
            if (e.isEmpty) {
                e = c;
            }
            return b.width * a / e.width;
        }
        static h(a, b, c, d) {
            let e = d;
            if (e.isEmpty) {
                e = c;
            }
            return e.height * a / b.height;
        }
        static f(a, b, c) {
            return c.width * a / b.width;
        }
        static c(a, b, c) {
            return b.width * a / c.width;
        }
        static j(a, b, c) {
            return c.height * a / b.height;
        }
    }
    ViewportUtils.$t = markType(ViewportUtils, 'ViewportUtils');
    return ViewportUtils;
})();
/**
 * @hidden
 */
export let IHasCategoryAxis_$type = new Type(null, 'IHasCategoryAxis');
/**
 * @hidden
 */
export let IHasCategoryModePreference_$type = new Type(null, 'IHasCategoryModePreference', null, [IHasCategoryAxis_$type]);
/**
 * @hidden
 */
export let AutomaticAxesManager = /*@__PURE__*/ (() => {
    class AutomaticAxesManager extends Base {
        constructor(a, b, c) {
            super();
            this.j = new HashSet$1(AutomaticAxisPurpose_$type, 0);
            this.f = null;
            this.d = null;
            this.e = null;
            this.i = false;
            this.a = null;
            this.a = new AutomaticAxisRequestCollection();
            let d = this.a;
            d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.m));
            this.f = a;
            this.d = b;
            this.e = c;
        }
        o(a, b) {
            this.q();
        }
        p(a, b) {
            this.q();
        }
        m(a, b) {
            this.q();
        }
        q() {
            if (this.i) {
                return;
            }
            this.i = true;
            try {
                this.r();
            }
            finally {
                this.i = false;
            }
        }
        l(a, b) {
            this.j.add_1(b.a);
            let c = b.c.ao;
            if (c != null) {
                c.cv = b.h;
                c.cw = b.i;
                c.ko(b.c);
                AxisSynchronizer.e(c, b.c);
            }
            a.add(b.c);
        }
        r() {
            let a = new List$1(AutomaticAxisRequest.$, 0);
            let b = new List$1(AutomaticAxisRequest.$, 0);
            let c = new List$1(AutomaticAxisRequest.$, 0);
            let d = new Dictionary$2(Axis.$, List$1.$.specialize(AutomaticAxisRequest.$), 0);
            let e = new Dictionary$2(Axis.$, List$1.$.specialize(AutomaticAxisRequest.$), 0);
            this.j.clear();
            for (let f = 0; f < this.a.count; f++) {
                let g = this.a._inner[f];
                if (g.f) {
                    a.add(g);
                }
                else if (g.g) {
                    b.add(g);
                }
                else if (g.d != null) {
                    if (!d.containsKey(g.d)) {
                        d.addItem(g.d, new List$1(AutomaticAxisRequest.$, 0));
                    }
                    d.item(g.d).add(g);
                }
                else if (g.b != null) {
                    if (!e.containsKey(g.b)) {
                        e.addItem(g.b, new List$1(AutomaticAxisRequest.$, 0));
                    }
                    e.item(g.b).add(g);
                }
                else {
                    c.add(g);
                }
            }
            let h = new List$1(Axis.$, 0);
            for (let i = 0; i < a.count; i++) {
                this.j.add_1(a._inner[i].a);
                this.l(h, a._inner[i]);
            }
            let j = false;
            for (let k = 0; k < this.d.count; k++) {
                let l = this.d._inner[k];
                if (d.containsKey(l)) {
                    let m = d.item(l);
                    for (let n = 0; n < m.count; n++) {
                        this.l(h, m._inner[n]);
                    }
                }
                h.add(l);
                if (e.containsKey(l)) {
                    let o = e.item(l);
                    for (let p = 0; p < o.count; p++) {
                        this.l(h, o._inner[p]);
                    }
                }
            }
            for (let q = 0; q < c.count; q++) {
                this.l(h, c._inner[q]);
            }
            for (let r = 0; r < b.count; r++) {
                this.l(h, b._inner[r]);
            }
            this.x(h, this.e);
        }
        x(a, b) {
            let c = new HashSet$1(Axis.$, 0);
            for (let d = 0; d < a.count; d++) {
                c.add_1(a._inner[d]);
            }
            let e = new HashSet$1(Axis.$, 0);
            for (let f = 0; f < b.count; f++) {
                e.add_1(b._inner[f]);
            }
            let g = new List$1(Number_$type, 0);
            let h = 0;
            for (let i = 0; i < b.count; i++) {
                if (b._inner[i] == null) {
                    g.add(i);
                    continue;
                }
                if (h > a.count - 1) {
                    g.add(i);
                    continue;
                }
                if (Base.equalsStatic(b._inner[i], a._inner[h])) {
                    h++;
                    continue;
                }
                if (e.contains(a._inner[h])) {
                    let j = b.indexOf(a._inner[h]);
                    if (j > i) {
                        this.f.skipDataCleanup = true;
                        b.removeAt(j);
                        this.f.skipDataCleanup = false;
                    }
                }
                b.insert(i, a._inner[h]);
                h++;
            }
            for (let k = g.count - 1; k >= 0; k--) {
                if (c.contains(b._inner[g._inner[k]])) {
                    this.f.skipDataCleanup = true;
                    b.removeAt(g._inner[k]);
                    this.f.skipDataCleanup = false;
                }
                else {
                    if (b._inner[g._inner[k]].de) {
                        this.n(b._inner[g._inner[k]]);
                    }
                    b.removeAt(g._inner[k]);
                }
            }
            for (; h < a.count; h++) {
                b.add(a._inner[h]);
            }
        }
        n(a) {
            if (a.ao != null) {
                AxisSynchronizer.b(a.ao, a);
                a.ao = null;
            }
        }
        h(a) {
            return this.j.contains(a);
        }
        u(a) {
            for (let b = this.a.count - 1; b >= 0; b--) {
                if (this.a._inner[b].j == a) {
                    this.a.removeAt(b);
                }
            }
        }
        w(a) {
            if (a == null) {
                return;
            }
            for (let b = this.a.count - 1; b >= 0; b--) {
                if (this.a._inner[b].e != null && this.a._inner[b].e.j6 == a.j6) {
                    this.a.removeAt(b);
                }
            }
        }
        t(a) {
            for (let b = this.a.count - 1; b >= 0; b--) {
                if (this.a._inner[b].a == a) {
                    this.a.removeAt(b);
                }
            }
        }
        s() {
            for (let a = this.a.count - 1; a >= 0; a--) {
                this.a.removeAt(a);
            }
        }
        v() {
            this.t(1);
        }
        b(a) {
            if (a == null) {
                return null;
            }
            let b = this.c(a);
            if (b != null) {
                return b;
            }
            let c = a.ak();
            c.ao = a;
            c.dh = true;
            let d = new AutomaticAxisRequest();
            d.e = a;
            d.c = c;
            d.a = 1;
            d.h = true;
            d.i = true;
            this.k(d);
            return c;
        }
        k(a) {
            this.a.add(a);
        }
        y(a, b) {
            for (let c = this.a.count - 1; c >= 0; c--) {
                if (this.a._inner[c].e != null && this.a._inner[c].e.j6 == a.j6) {
                    let d = this.a._inner[c].c;
                    a.kp(d, b);
                }
            }
        }
        c(a) {
            for (let b = this.a.count - 1; b >= 0; b--) {
                if (this.a._inner[b].e != null && this.a._inner[b].e.j6 == a.j6) {
                    return this.a._inner[b].c;
                }
            }
            return null;
        }
        g(a) {
            return this.c(a) != null;
        }
    }
    AutomaticAxesManager.$t = markType(AutomaticAxesManager, 'AutomaticAxesManager');
    return AutomaticAxesManager;
})();
/**
 * @hidden
 */
export let AutomaticAxisRequest = /*@__PURE__*/ (() => {
    class AutomaticAxisRequest extends Base {
        constructor() {
            super();
            this.a = 0;
            this.e = null;
            this.j = null;
            this.c = null;
            this.b = null;
            this.d = null;
            this.g = false;
            this.f = false;
            this.h = false;
            this.i = false;
            this.h = true;
            this.i = true;
            this.a = 1;
        }
    }
    AutomaticAxisRequest.$t = markType(AutomaticAxisRequest, 'AutomaticAxisRequest');
    return AutomaticAxisRequest;
})();
/**
 * @hidden
 */
export let AutomaticAxisRequestCollection = /*@__PURE__*/ (() => {
    class AutomaticAxisRequestCollection extends ObservableCollection$1 {
        constructor() {
            super(AutomaticAxisRequest.$, 0);
        }
    }
    AutomaticAxisRequestCollection.$t = markType(AutomaticAxisRequestCollection, 'AutomaticAxisRequestCollection', ObservableCollection$1.$.specialize(AutomaticAxisRequest.$));
    return AutomaticAxisRequestCollection;
})();
/**
 * @hidden
 */
export let AxisSyncInfo = /*@__PURE__*/ (() => {
    class AxisSyncInfo extends Base {
        constructor() {
            super();
            this.a = null;
            this.b = null;
            this.b = new AxisSyncLookup();
        }
    }
    AxisSyncInfo.$t = markType(AxisSyncInfo, 'AxisSyncInfo');
    return AxisSyncInfo;
})();
/**
 * @hidden
 */
export let AxisSynchronizer = /*@__PURE__*/ (() => {
    class AxisSynchronizer extends Base {
        static e(a, b) {
            if (a == null) {
                return;
            }
            if (b == null) {
                return;
            }
            if (!AxisSynchronizer.a.containsKey(a.j6)) {
                let c = new AxisSyncInfo();
                c.a = a;
                AxisSynchronizer.a.addItem(a.j6, c);
            }
            if (!AxisSynchronizer.a.item(a.j6).b.containsKey(b.j6)) {
                AxisSynchronizer.a.item(a.j6).b.addItem(b.j6, b);
            }
            if (AxisSynchronizer.a.item(a.j6).b.count == 1) {
                a.propertyUpdated = delegateCombine(a.propertyUpdated, AxisSynchronizer.c);
            }
        }
        static b(a, b) {
            if (a == null) {
                return;
            }
            if (b == null) {
                return;
            }
            if (AxisSynchronizer.a.containsKey(a.j6)) {
                if (AxisSynchronizer.a.item(a.j6).b.containsKey(b.j6)) {
                    AxisSynchronizer.a.item(a.j6).b.removeItem(b.j6);
                }
                if (AxisSynchronizer.a.item(a.j6).b.count == 0) {
                    a.propertyUpdated = delegateRemove(a.propertyUpdated, AxisSynchronizer.c);
                }
            }
        }
        static c(a, b) {
            let c = a;
            if (!c.cw) {
                return;
            }
            for (let d of fromEnum(AxisSynchronizer.a.keys)) {
                if (d == c.j6) {
                    let e = AxisSynchronizer.a.item(d);
                    for (let f of fromEnum(e.b.keys)) {
                        let g = e.b.item(f);
                        e.a.kp(g, b.propertyName);
                    }
                }
            }
        }
        static d(a, b) {
            let c = a;
            for (let d of fromEnum(AxisSynchronizer.a.keys)) {
                if (d == c.j6) {
                    let e = AxisSynchronizer.a.item(d);
                    for (let f of fromEnum(e.b.keys)) {
                        let g = e.b.item(f);
                        e.a.kn(g, b.propertyName);
                    }
                }
            }
        }
    }
    AxisSynchronizer.$t = markType(AxisSynchronizer, 'AxisSynchronizer');
    AxisSynchronizer.a = new Dictionary$2(String_$type, AxisSyncInfo.$, 0);
    return AxisSynchronizer;
})();
/**
 * @hidden
 */
export let AxisSyncLookup = /*@__PURE__*/ (() => {
    class AxisSyncLookup extends Dictionary$2 {
        constructor() {
            super(String_$type, Axis.$, 0);
        }
    }
    AxisSyncLookup.$t = markType(AxisSyncLookup, 'AxisSyncLookup', Dictionary$2.$.specialize(String_$type, Axis.$));
    return AxisSyncLookup;
})();
/**
 * @hidden
 */
export let AutomaticSeriesManager = /*@__PURE__*/ (() => {
    class AutomaticSeriesManager extends Base {
        constructor(a, b, c) {
            super();
            this.i = new HashSet$1(AutomaticSeriesPurpose_$type, 0);
            this.e = null;
            this.h = false;
            this.a = null;
            this.c = null;
            this.d = null;
            this.e = a;
            this.a = new AutomaticSeriesRequestCollection();
            let d = this.a;
            d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.k));
            this.c = b;
            this.d = c;
        }
        n(a, b) {
            this.p();
        }
        o(a, b) {
            this.p();
        }
        f(a) {
            return this.i.contains(a);
        }
        k(a, b) {
            this.p();
        }
        p() {
            if (this.h) {
                return;
            }
            this.h = true;
            try {
                this.q();
            }
            finally {
                this.h = false;
            }
        }
        q() {
            let a = new List$1(AutomaticSeriesRequest.$, 0);
            let b = new List$1(AutomaticSeriesRequest.$, 0);
            let c = new List$1(AutomaticSeriesRequest.$, 0);
            let d = new Dictionary$2(Series.$, List$1.$.specialize(AutomaticSeriesRequest.$), 0);
            let e = new Dictionary$2(Series.$, List$1.$.specialize(AutomaticSeriesRequest.$), 0);
            let f = new List$1(AutomaticSeriesRequest.$, 0);
            this.i.clear();
            for (let g = 0; g < this.a.count; g++) {
                let h = this.a._inner[g];
                if (h.f) {
                    a.add(h);
                }
                else if (h.e) {
                    b.add(h);
                }
                else if (h.g) {
                    c.add(h);
                }
                else if (h.c != null) {
                    if (!d.containsKey(h.c)) {
                        d.addItem(h.c, new List$1(AutomaticSeriesRequest.$, 0));
                    }
                    d.item(h.c).add(h);
                }
                else if (h.b != null) {
                    if (!e.containsKey(h.c)) {
                        e.addItem(h.c, new List$1(AutomaticSeriesRequest.$, 0));
                    }
                    e.item(h.b).add(h);
                }
                else {
                    f.add(h);
                }
            }
            let i = new List$1(Series.$, 0);
            for (let j = 0; j < a.count; j++) {
                this.i.add_1(a._inner[j].a);
                i.add(a._inner[j].d);
            }
            let k = false;
            for (let l = 0; l < this.c.count; l++) {
                let m = this.c._inner[l];
                if (d.containsKey(m)) {
                    let n = d.item(m);
                    for (let o = 0; o < n.count; o++) {
                        this.l(i, n._inner[o]);
                    }
                }
                if (this.g(m) && !k) {
                    k = true;
                    for (let p = 0; p < c.count; p++) {
                        this.l(i, c._inner[p]);
                    }
                }
                i.add(m);
                if (e.containsKey(m)) {
                    let q = e.item(m);
                    for (let r = 0; r < q.count; r++) {
                        this.l(i, q._inner[r]);
                    }
                }
            }
            for (let s = 0; s < f.count; s++) {
                this.l(i, f._inner[s]);
            }
            if (!k) {
                for (let t = 0; t < c.count; t++) {
                    this.l(i, c._inner[t]);
                }
            }
            for (let u = 0; u < b.count; u++) {
                this.l(i, b._inner[u]);
            }
            this.u(i, this.d);
        }
        l(a, b) {
            this.i.add_1(b.a);
            b.d.ez = true;
            a.add(b.d);
        }
        u(a, b) {
            let c = new HashSet$1(Series.$, 0);
            for (let d = 0; d < a.count; d++) {
                c.add_1(a._inner[d]);
            }
            let e = new HashSet$1(Series.$, 0);
            for (let f = 0; f < b.count; f++) {
                e.add_1(b._inner[f]);
            }
            let g = new List$1(Number_$type, 0);
            let h = 0;
            for (let i = 0; i < b.count; i++) {
                if (b._inner[i] == null) {
                    g.add(i);
                    continue;
                }
                if (h > a.count - 1) {
                    g.add(i);
                    continue;
                }
                if (Base.equalsStatic(b._inner[i], a._inner[h])) {
                    h++;
                    continue;
                }
                if (e.contains(a._inner[h])) {
                    let j = b.indexOf(a._inner[h]);
                    if (j > i) {
                        this.e.skipDataCleanup = true;
                        b.removeAt(j);
                        this.e.skipDataCleanup = false;
                    }
                }
                b.insert(i, a._inner[h]);
                h++;
            }
            for (let k = g.count - 1; k >= 0; k--) {
                if (c.contains(b._inner[g._inner[k]])) {
                    this.e.skipDataCleanup = true;
                    b.removeAt(g._inner[k]);
                    this.e.skipDataCleanup = false;
                }
                else {
                    if (b._inner[g._inner[k]].ez) {
                        this.m(b._inner[g._inner[k]]);
                    }
                    b.removeAt(g._inner[k]);
                }
            }
            for (; h < a.count; h++) {
                b.add(a._inner[h]);
            }
        }
        m(a) {
        }
        r(a) {
            for (let b = this.a.count - 1; b >= 0; b--) {
                if (this.a._inner[b].a == a) {
                    this.a.removeAt(b);
                }
            }
        }
        t(a) {
            for (let b = this.a.count - 1; b >= 0; b--) {
                if (this.a._inner[b].d == a) {
                    this.a.removeAt(b);
                }
            }
        }
        s(a, b) {
            for (let c = this.a.count - 1; c >= 0; c--) {
                if (this.a._inner[c].a == b && this.a._inner[c].d != null && this.a._inner[c].d.mb == a) {
                    this.a.removeAt(c);
                }
            }
        }
        j(a, b) {
            let c = new List$1(Series.$, 0);
            for (let d = this.a.count - 1; d >= 0; d--) {
                if (this.a._inner[d].a == b && this.a._inner[d].d != null && this.a._inner[d].d.mb == a) {
                    c.add(this.a._inner[d].d);
                }
            }
            return c;
        }
        g(a) {
            if (a.ev) {
                if (a.f7 || a.er || a.et) {
                    return true;
                }
            }
            return false;
        }
        get b() {
            return this.a;
        }
    }
    AutomaticSeriesManager.$t = markType(AutomaticSeriesManager, 'AutomaticSeriesManager');
    return AutomaticSeriesManager;
})();
/**
 * @hidden
 */
export let AutomaticSeriesRequest = /*@__PURE__*/ (() => {
    class AutomaticSeriesRequest extends Base {
        constructor() {
            super(...arguments);
            this.a = 0;
            this.d = null;
            this.b = null;
            this.c = null;
            this.g = false;
            this.e = false;
            this.f = false;
        }
    }
    AutomaticSeriesRequest.$t = markType(AutomaticSeriesRequest, 'AutomaticSeriesRequest');
    return AutomaticSeriesRequest;
})();
/**
 * @hidden
 */
export let AutomaticSeriesRequestCollection = /*@__PURE__*/ (() => {
    class AutomaticSeriesRequestCollection extends ObservableCollection$1 {
        constructor() {
            super(AutomaticSeriesRequest.$, 0);
        }
    }
    AutomaticSeriesRequestCollection.$t = markType(AutomaticSeriesRequestCollection, 'AutomaticSeriesRequestCollection', ObservableCollection$1.$.specialize(AutomaticSeriesRequest.$));
    return AutomaticSeriesRequestCollection;
})();
/**
 * @hidden
 */
export let ChartSelection = /*@__PURE__*/ (() => {
    class ChartSelection extends Base {
        constructor() {
            super(...arguments);
            this._item = null;
            this._series = null;
            this.b = null;
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
        get c() {
            if (this.b == null && this.series != null) {
                this.b = this.series.cg();
            }
            return this.b;
        }
        set c(a) {
            this.b = a;
        }
        equals(a) {
            let b = typeCast(ChartSelection.$, a);
            if (b == null) {
                return false;
            }
            return b.series == this.series && b.item == this.item;
        }
        f(a) {
            if (this.b != null && this.series == null) {
                let b = SeriesMatcherHelper.a(a, this.b);
                if (b != null && b.length > 0) {
                    this.series = b[0];
                }
            }
        }
    }
    ChartSelection.$t = markType(ChartSelection, 'ChartSelection');
    return ChartSelection;
})();
/**
 * @hidden
 */
export let ChartSelectedItemCollection = /*@__PURE__*/ (() => {
    class ChartSelectedItemCollection extends ObservableCollection$1 {
        constructor() {
            super(ChartSelection.$, 0);
            this.collectionResetting = null;
        }
        p() {
            if (this.collectionResetting != null) {
                this.collectionResetting(this, null);
            }
            super.p();
        }
    }
    ChartSelectedItemCollection.$t = markType(ChartSelectedItemCollection, 'ChartSelectedItemCollection', ObservableCollection$1.$.specialize(ChartSelection.$));
    return ChartSelectedItemCollection;
})();
/**
 * @hidden
 */
export let ChartSelectionEqualityComparer = /*@__PURE__*/ (() => {
    class ChartSelectionEqualityComparer extends Base {
        equalsC(a, b) {
            if (a == b) {
                return true;
            }
            if (a == null && b != null) {
                return false;
            }
            if (a != null && b == null) {
                return false;
            }
            return a.series == b.series && a.item == b.item;
        }
        getHashCodeC(a) {
            let b = 31;
            if (a.item != null) {
                b ^= Base.getHashCodeStatic(a.item);
            }
            if (a.series != null) {
                b ^= Base.getHashCodeStatic(a.series);
            }
            return b;
        }
    }
    ChartSelectionEqualityComparer.$t = markType(ChartSelectionEqualityComparer, 'ChartSelectionEqualityComparer', Base.$, [IEqualityComparer$1_$type.specialize(ChartSelection.$)]);
    return ChartSelectionEqualityComparer;
})();
/**
 * @hidden
 */
export let SeriesMatcherHelper = /*@__PURE__*/ (() => {
    class SeriesMatcherHelper extends Base {
        static a(a, b) {
            let c = new List$1(Series.$, 0);
            a.pi((d) => {
                if (SeriesMatcherHelper.b(b, d)) {
                    c.add(d);
                }
            });
            return c.toArray();
        }
        static b(a, b) {
            if (a.d >= 0) {
                if (b.index == a.d) {
                    return true;
                }
            }
            if (a.g != null) {
                if (Base.equalsStatic(a.g, b.name)) {
                    return true;
                }
            }
            if (a.h != null) {
                if (Base.equalsStatic(a.h, b.title)) {
                    return true;
                }
            }
            if (a.f != null && a.e != null) {
                let c = a.f;
                if (!stringEndsWith(c, "MemberPath")) {
                    c += "MemberPath";
                }
                let d = b.mo(c);
                if (Base.equalsStatic(a.e, d)) {
                    return true;
                }
            }
            return false;
        }
    }
    SeriesMatcherHelper.$t = markType(SeriesMatcherHelper, 'SeriesMatcherHelper');
    return SeriesMatcherHelper;
})();
/**
 * @hidden
 */
export let AxisMatcherHelper = /*@__PURE__*/ (() => {
    class AxisMatcherHelper extends Base {
        static a(a, b) {
            let c = new List$1(Axis.$, 0);
            if (typeCast(XamDataChart.$, a) !== null) {
                let d = a;
                let e = new List$1(Axis.$, 0);
                for (let f = 0; f < d.zq.count; f++) {
                    let g = d.zq._inner[f];
                    if (g.dh) {
                        continue;
                    }
                    e.add(g);
                }
                for (let h = 0; h < e.count; h++) {
                    let i = e._inner[h];
                    if (AxisMatcherHelper.b(b, i, h)) {
                        c.add(i);
                    }
                }
                if (b.f != null && b.e > 0) {
                    let j = new List$1(Axis.$, 0);
                    for (let k = 0; k < d.zq.count; k++) {
                        let l = e._inner[k];
                        let m = stringReplace(getInstanceType(l).typeName, "Axis", "");
                        if (Base.equalsStatic(b.f.toLowerCase(), m.toLowerCase())) {
                            j.add(l);
                        }
                    }
                    for (let n = 0; n < j.count; n++) {
                        let o = e._inner[n];
                        let p = stringReplace(getInstanceType(o).typeName, "Axis", "");
                        if (Base.equalsStatic(b.f.toLowerCase(), p.toLowerCase()) && (b.e == n)) {
                            c.add(o);
                        }
                    }
                }
            }
            return c.toArray();
        }
        static b(a, b, c) {
            if (a.d >= 0) {
                if (c == a.d) {
                    return true;
                }
            }
            if (a.i != null) {
                if (Base.equalsStatic(a.i, b.name)) {
                    return true;
                }
            }
            if (a.j != null) {
                if (Base.equalsStatic(a.j, b.j3)) {
                    return true;
                }
            }
            if (a.h != null && a.g != null) {
                let d = a.h;
                if (!stringEndsWith(d, "MemberPath")) {
                    d += "MemberPath";
                }
                let e = b.i6(d);
                if (Base.equalsStatic(a.g, e)) {
                    return true;
                }
            }
            if (a.f != null) {
                let f = stringReplace(getInstanceType(b).typeName, "Axis", "");
                if (Base.equalsStatic(a.f.toLowerCase(), f.toLowerCase()) && (a.e == -1 || a.e == 0)) {
                    return true;
                }
            }
            return false;
        }
    }
    AxisMatcherHelper.$t = markType(AxisMatcherHelper, 'AxisMatcherHelper');
    return AxisMatcherHelper;
})();
/**
 * @hidden
 */
export let SeriesLayer = /*@__PURE__*/ (() => {
    class SeriesLayer extends DependencyObject {
        constructor() {
            super();
            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");
            let a = this.l;
            a.collectionResetting = delegateCombine(a.collectionResetting, runOn(this, this.al));
            let b = this.l;
            b.collectionChanged = delegateCombine(b.collectionChanged, runOn(this, this.ak));
        }
        get source() {
            return this._source;
        }
        set source(a) {
            this._source = a;
        }
        get target() {
            return this._target;
        }
        set target(a) {
            this._target = a;
        }
        ak(a, b) {
            if (b.oldItems != null) {
                for (let c = 0; c < b.oldItems.count; c++) {
                    let d = b.oldItems.item(c);
                    if (d == null) {
                        continue;
                    }
                    let 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 (let f = 0; f < b.newItems.count; f++) {
                    let g = b.newItems.item(f);
                    if (g == null) {
                        continue;
                    }
                    let 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) {
                        let i = h.y;
                        if (!h.q) {
                            i = Series.n8(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.fy) {
                this.a3();
            }
            else {
                this.a5();
            }
        }
        au() {
            if (this.target != null) {
                this.target.ro();
            }
        }
        at() {
            if (this.target != null) {
                this.target.rm();
            }
        }
        get t() {
            return this.target != null && this.target.ha;
        }
        a3() {
            if (this.p) {
                for (let a of fromEnum(this.l)) {
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, this.source, this.target);
                    }
                }
            }
        }
        a4() {
            if (this.p) {
                for (let a of fromEnum(this.l)) {
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, this.source, null);
                    }
                }
            }
        }
        a5() {
            if (this.p) {
                for (let a of fromEnum(this.l)) {
                    if (!this.aa.contains(a) && !this.ab.contains(a)) {
                        this.a2(a, null, this.target);
                    }
                }
            }
        }
        a2(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);
                }
            }
        }
        ah(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);
        }
        an(a, b) {
            if (b == null) {
                return;
            }
            let c = a.aa;
            let d = b.t5(c);
            if (d == null) {
                return;
            }
            let e = b.c(d);
            if (!a.r) {
                e = this.ah(d);
            }
            let f = this.ag(e, a, b);
            let g = this.af(a, e, f, b);
            this.ao(b, d, g);
        }
        ag(a, b, c) {
            let d = a;
            if (b.y != null) {
                let e = b.y;
                if (!b.q) {
                    e = Series.n8(b.y);
                }
                let f = c.t5(e);
                if (f != null) {
                    d = c.c(f);
                    if (!b.r) {
                        d = this.ah(f);
                    }
                }
            }
            return d;
        }
        ao(a, b, c) {
            if (a.f8(b.name) || a.f8("Actual" + b.name)) {
                this.ar(b.name, () => {
                    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);
            }
        }
        ar(a, b) {
            if (this.n == null) {
                this.n = this.source.cw.k();
            }
            if (!this.o) {
                this.o = true;
                this.n.enqueueAction(runOn(this, this.as));
            }
            this.u.item(a, b);
        }
        as() {
            this.o = false;
            let a = new List$1(Delegate_$type, 0);
            for (let b of fromEnum(this.u.values)) {
                a.add(b);
            }
            this.u.clear();
            for (let c = 0; c < a.count; c++) {
                let d = a._inner[c];
                d();
            }
        }
        az(a, b) {
            let c = b.name;
            let d = null;
            if (!this.y.containsKey(c)) {
                this.y.addItem(c, new Stack$1(Boolean_$type));
            }
            this.y.item(c).h(true);
        }
        a0(a, b) {
            let c = b.name;
            if (this.y.containsKey(c)) {
                this.y.item(c).e();
                if (this.y.item(c).f == 0) {
                    this.y.removeItem(c);
                }
            }
        }
        r(a, b) {
            if (this.y.containsKey(b.name) && this.y.item(b.name).d()) {
                return true;
            }
            return false;
        }
        af(a, b, c, d) {
            return a.t(b, c, d);
        }
        al(a, b) {
            for (let c = 0; c < this.l.count; c++) {
                let 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);
                }
            }
        }
        av(a, b) {
            let c = a;
            if (b.propertyName == SeriesLayerPropertyOverlay.$$p[0]) {
                if (b.oldValue != null) {
                    let d = b.oldValue;
                    if (!c.q) {
                        d = Series.n8(d);
                    }
                    if (this.v.containsKey(d)) {
                        let e = this.v.item(d);
                        e.remove(c);
                        if (e.count == 0) {
                            this.v.removeItem(d);
                        }
                    }
                }
                if (b.newValue != null) {
                    let f = b.newValue;
                    if (!c.q) {
                        f = Series.n8(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);
            }
        }
        ax(a, b, c) {
            this.aw(a, b, c);
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
        }
        am(a, b) {
            this.source = a;
            this.target = b;
            this.p = true;
            this.a5();
            let c = this.target;
            c.renderValid = delegateCombine(c.renderValid, runOn(this, this.a1));
            a.propertyUpdated = delegateCombine(a.propertyUpdated, runOn(this, this.ay));
        }
        ay(a, b) {
            if (this.p) {
                if (!this.source.gs(b.propertyName)) {
                    let c = this.source.t5(b.propertyName);
                    if (c != null) {
                        this.ai(this.source, this.target, c, b.newValue);
                    }
                }
            }
        }
        a1(a, b) {
            if (this.source == null || this.source.f5()) {
                return;
            }
            this.a4();
            if (this.target != null) {
                let c = this.target;
                c.renderValid = delegateRemove(c.renderValid, runOn(this, this.a1));
            }
        }
        ap(a) {
            let b = this.source;
            b.propertyUpdated = delegateRemove(b.propertyUpdated, runOn(this, this.ay));
            this.p = false;
            let c = new List$1(SeriesLayerPropertyOverlay.$, 1, this.ab);
            c.o(this.aa);
            for (let d of fromEnum(c)) {
                this.aq(d);
            }
        }
        aq(a) {
            if (a.y != null) {
                if (this.v.containsKey(a.y)) {
                    let 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;
                    }
                    let c = this.source.t5(a.aa);
                    if (c == null) {
                        return;
                    }
                    this.ao(this.source, c, a.w);
                }
            }
        }
        aw(a, b, c) {
            this.q = true;
        }
        ai(a, b, c, d) {
            let e = d;
            if (this.r(a, c)) {
                return this.ah(c);
            }
            let f = false;
            if (this.s(a, b, c)) {
                f = true;
            }
            if (this.v.containsKey(c.name)) {
                if (this.p) {
                    let g = this.v.item(c.name);
                    for (let h of fromEnum(g)) {
                        if (h.y != null) {
                            let i = h.ad;
                            if (!h.q) {
                                i = Series.n8(i);
                            }
                            let j = a.t5(i);
                            let k = a.c(j);
                            k = this.ad(a, b, j, k);
                            if (h.r) {
                                if (!a.gs(c.name)) {
                                    let 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);
                            }
                        }
                    }
                }
            }
            if (!f) {
                d = this.ad(a, b, c, d);
                b.h(c, d);
            }
            return e;
        }
        s(a, b, c) {
            if (this.z.contains(c.name)) {
                return true;
            }
            if (c.name != null && stringStartsWith(c.name, "Actual")) {
                return true;
            }
            return false;
        }
        ad(a, b, c, d) {
            if (this.w.containsKey(c.name)) {
                let e = false;
                if (this.source == null) {
                    this.source = a;
                    e = true;
                }
                let f = this.w.item(c.name);
                let g = this.ag(d, f, a);
                d = this.w.item(c.name).t(d, g, a);
                if (e) {
                    this.source = null;
                }
            }
            return d;
        }
        ae(a, b, c, d) {
            if (this.p && this.x.containsKey(c.name)) {
                let e = false;
                if (this.source == null) {
                    this.source = a;
                    e = true;
                }
                if (this.r(a, c)) {
                    d = this.ah(c);
                }
                let f = this.x.item(c.name);
                let g = this.ag(d, f, a);
                d = this.x.item(c.name).t(d, g, a);
                if (e) {
                    this.source = null;
                }
            }
            return d;
        }
        get m() {
            return this.l;
        }
    }
    SeriesLayer.$t = markType(SeriesLayer, 'SeriesLayer', DependencyObject.$, [INotifyPropertyChanged_$type]);
    SeriesLayer.$$p = markDep(DependencyProperty, PropertyMetadata, SeriesLayer, 'ax', ['ZIndex:ac:a6', [1, 0]]);
    return SeriesLayer;
})();
/**
 * @hidden
 */
export let SeriesLayerCollection = /*@__PURE__*/ (() => {
    class SeriesLayerCollection extends ObservableCollection$1 {
        constructor() {
            super(SeriesLayer.$, 0);
            this.collectionResetting = null;
        }
        p() {
            if (this.collectionResetting != null) {
                this.collectionResetting(this, null);
            }
            super.p();
        }
    }
    SeriesLayerCollection.$t = markType(SeriesLayerCollection, 'SeriesLayerCollection', ObservableCollection$1.$.specialize(SeriesLayer.$));
    return SeriesLayerCollection;
})();
/**
 * @hidden
 */
export let SeriesLayerManager = /*@__PURE__*/ (() => {
    class SeriesLayerManager extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
        }
        b(a, b) {
            if (b.propertyName == "ZIndex") {
                this.n(this.a);
            }
        }
        i(a, b) {
            if (b.oldItems != null) {
                for (let c = 0; c < b.oldItems.count; c++) {
                    let d = b.oldItems.item(c);
                    if (d == null) {
                        continue;
                    }
                    let e = d;
                    e.propertyChanged = delegateRemove(e.propertyChanged, runOn(this, this.b));
                }
            }
            if (b.newItems != null) {
                for (let f = 0; f < b.newItems.count; f++) {
                    let g = b.newItems.item(f);
                    if (g == null) {
                        continue;
                    }
                    let h = g;
                    h.propertyChanged = delegateCombine(h.propertyChanged, runOn(this, this.b));
                }
            }
            this.n(a);
        }
        n(a) {
            let b = new SeriesLayerCollection();
            for (let c of fromEnum(a.cb)) {
                b.add(c);
            }
            for (let d of fromEnum(a.cc)) {
                b.add(d);
            }
            let e = (f, g) => {
                if (f.ac < g.ac) {
                    return -1;
                }
                else if (f.ac > g.ac) {
                    return 1;
                }
                else {
                    return 0;
                }
            };
            ArrayExtension.quickSort(b, (f, g) => e(f, g));
            this.m(b, a.actualLayers);
        }
        m(a, b) {
            let c = new List$1(Number_$type, 0);
            let d = 0;
            for (let 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 (let f = c.count - 1; f >= 0; f--) {
                b.removeAt(f);
            }
            for (; d < a.count; d++) {
                b.add(a._inner[d]);
            }
        }
        h(a, b, c) {
            this.i(a, c);
        }
        j(a, b, c) {
            for (let d of fromEnum(b)) {
                d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.b));
            }
        }
        e(a, b, c) {
            this.i(a, c);
        }
        f(a, b, c) {
            for (let d of fromEnum(b)) {
                d.propertyChanged = delegateRemove(d.propertyChanged, runOn(this, this.b));
            }
        }
        c(a, b, c) {
            switch (c.action) {
                case 0:
                    if (c.newItems != null) {
                        for (let d = 0; d < c.newItems.count; d++) {
                            let e = c.newItems.item(d);
                            this.k(d + c.newStartingIndex, e);
                        }
                    }
                    break;
                case 1:
                    if (c.oldItems != null) {
                        for (let f = 0; f < c.oldItems.count; f++) {
                            let g = c.oldItems.item(f);
                            this.l(g, c.oldStartingIndex);
                        }
                    }
                    break;
                case 2:
                    if (c.oldItems != null) {
                        for (let h = 0; h < c.oldItems.count; h++) {
                            let i = c.oldItems.item(h);
                            this.l(i, c.oldStartingIndex);
                        }
                    }
                    if (c.newItems != null) {
                        for (let j = 0; j < c.newItems.count; j++) {
                            let k = c.newItems.item(j);
                            this.k(j + c.newStartingIndex, k);
                        }
                    }
                    break;
                case 4:
                    this.g();
                    let l = 0;
                    for (let m of fromEnum(b)) {
                        let n = m;
                        this.k(l, n);
                        l++;
                    }
                    break;
            }
        }
        g() {
            for (let a of fromEnum(this.a.actualLayers)) {
                this.a.pu(a);
            }
        }
        l(a, b) {
            this.a.pu(a);
        }
        k(a, b) {
            this.a.bn(a, b);
        }
        d(a, b, c) {
            this.g();
        }
    }
    SeriesLayerManager.$t = markType(SeriesLayerManager, 'SeriesLayerManager');
    return SeriesLayerManager;
})();
/**
 * @hidden
 */
export let SeriesLayerPropertyOverlay = /*@__PURE__*/ (() => {
    class SeriesLayerPropertyOverlay extends DependencyObject {
        constructor() {
            super(...arguments);
            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;
        }
        ah(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));
            }
        }
        ag(a, b, c) {
            this.n = true;
            switch (a) {
                case SeriesLayerPropertyOverlay.$$p[4]:
                    this.m = true;
                    break;
                default: break;
            }
        }
        t(a, b, c) {
            this.w = a;
            let 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) {
                let e = a;
                let f = ((() => {
                    let $ret = new SeriesLayerPropertyOverlayValueResolvingEventArgs();
                    $ret.value = e;
                    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;
        }
        aj(a, b) {
            let c = b.t5(this.aa);
            if (c == null) {
                return;
            }
            let d = PlatformAPIHelper.o(c.propertyType, a.value);
            a.value = d;
            a.b = false;
        }
        v(a, b) {
            let c = b.t5(this.aa);
            if (c == null) {
                return a;
            }
            let d = PlatformAPIHelper.o(c.propertyType, a);
            a = d;
            return a;
        }
        ai(a, b) {
            let c = b.t5(this.aa);
            if (c == null) {
                return;
            }
            let d = PlatformAPIHelper.f(c.propertyType, a.value);
            a.value = d;
            a.b = false;
        }
        u(a, b) {
            let c = b.t5(this.aa);
            if (c == null) {
                return a;
            }
            let d = PlatformAPIHelper.f(c.propertyType, a);
            a = d;
            return a;
        }
        get aa() {
            if (!this.q) {
                return Series.n8(this.ad);
            }
            return this.ad;
        }
    }
    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;
})();
/**
 * @hidden
 */
export let SeriesLayerPropertyOverlayCollection = /*@__PURE__*/ (() => {
    class SeriesLayerPropertyOverlayCollection extends ObservableCollection$1 {
        constructor() {
            super(SeriesLayerPropertyOverlay.$, 0);
            this.collectionResetting = null;
        }
        p() {
            if (this.collectionResetting != null) {
                this.collectionResetting(this, null);
            }
            super.p();
        }
    }
    SeriesLayerPropertyOverlayCollection.$t = markType(SeriesLayerPropertyOverlayCollection, 'SeriesLayerPropertyOverlayCollection', ObservableCollection$1.$.specialize(SeriesLayerPropertyOverlay.$));
    return SeriesLayerPropertyOverlayCollection;
})();
/**
 * @hidden
 */
export let IDataChartToolbarProvider_$type = new Type(null, 'IDataChartToolbarProvider');
/**
 * @hidden
 */
export let ISeriesViewerScrollbarManager_$type = new Type(null, 'ISeriesViewerScrollbarManager');
/**
 * @hidden
 */
export let IAnnotationLayerProxy_$type = new Type(null, 'IAnnotationLayerProxy');
/**
 * @hidden
 */
export let ISeriesInteractionManager_$type = new Type(null, 'ISeriesInteractionManager');
/**
 * @hidden
 */
export let ISeriesViewerInteractionManager_$type = new Type(null, 'ISeriesViewerInteractionManager');
/**
 * @hidden
 */
export let IDataChartVisualDataManager_$type = new Type(null, 'IDataChartVisualDataManager');
/**
 * @hidden
 */
export let IAxisVisualDataManager_$type = new Type(null, 'IAxisVisualDataManager');
/**
 * @hidden
 */
export let ISeriesVisualDataManager_$type = new Type(null, 'ISeriesVisualDataManager');
/**
 * @hidden
 */
export let XamDataChart = /*@__PURE__*/ (() => {
    class XamDataChart extends SeriesViewer {
        constructor() {
            super();
            this._xsr = null;
            this.zv = null;
            this.zh = null;
            this.aay = 1;
            this.aaz = 1;
            this.aaf = false;
            this.aak = false;
            this.aaj = false;
            this.aa0 = 0;
            this.aa1 = 0;
            this.abi = NaN;
            this.abj = NaN;
            this.zo = new AxisCollection();
            this.zn = new AxisCollection();
            this.aah = false;
            this.axisRangeChanged = null;
            this.z4 = null;
            this.z7 = false;
            this.aav = 0;
            this.aax = 0;
            this.aaw = 0;
            this.aau = 0;
            this.aa3 = NaN;
            this.aa5 = NaN;
            this.aa4 = NaN;
            this.aa2 = NaN;
            this.ab = XamDataChart.$;
            this.aaj = true;
            let a = this.axes;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.acx));
            let b = this.axes;
            b.collectionResetting = delegateCombine(b.collectionResetting, runOn(this, this.acy));
            let c = this.zq;
            c.collectionChanged = delegateCombine(c.collectionChanged, runOn(this, this.acp));
            let d = this.zq;
            d.collectionAfterChanged = delegateCombine(d.collectionAfterChanged, runOn(this, this.acq));
            let e = this.zq;
            e.collectionResetting = delegateCombine(e.collectionResetting, runOn(this, this.acr));
        }
        get XSRP() {
            if (this._xsr == null) {
                this._xsr = new SRProvider(this.dw.j.ae);
            }
            return this._xsr;
        }
        get zw() {
            if (this.zv == null) {
                this.zv = DVContainer.instance.createInstance(IDataChartVisualDataManager_$type, () => this.XSRP.q);
            }
            return this.zv;
        }
        static staticInit() {
            XamDataChart.abf = -1.7976931348623157E+308;
            XamDataChart.abe = 1.7976931348623157E+308;
        }
        zi(a) {
            if (this.zh == null) {
                this.zh = new AutomaticAxesManager(this, this.axes, this.zq);
            }
            return this.zh;
        }
        o3(a, b, c, d, e) {
            super.o3(a, b, c, d, e);
            let f;
            if (e) {
                f = { $type: Point_$type, x: a.x + this.y9.x, y: a.y + this.y9.y };
            }
            else {
                f = { $type: Point_$type, x: a.x, y: a.y };
            }
            for (let g = 0; g < this.zq.count; g++) {
                let h = this.zq._inner[g];
                h.ki(f, b, c, d, false);
            }
        }
        f7(a) {
            for (let b of fromEnum(this.zq)) {
                if (b.a4 != null && b.a4.visibility != 1 && b.a1.c6.containsPoint(a)) {
                    return true;
                }
                else {
                    for (let c of fromEnum(b.a1.bd)) {
                        if (c.containsPoint(a)) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
        static abr(a) {
            if (a.dc == null) {
                return -1;
            }
            if (!a.fj) {
                return -1;
            }
            let b = XamDataChartView.az(a);
            if (b.count == 0) {
                return -1;
            }
            let c = -1;
            for (let d = 0; d < b.count; d++) {
                c = Math.max(c, b._inner[d].index);
            }
            let e = c + 1;
            if (a.isFragment) {
                e = a.kb();
                if (e == -1) {
                    return -1;
                }
                let f = a.bq();
                e = f.index + e;
            }
            if (a.bo != null) {
                e = a.kf() + a.bo.index;
                if (e == -1) {
                    return -1;
                }
            }
            return e;
        }
        r8(a, b, c, d) {
            super.r8(a, b, c, d);
            switch (b) {
                case XamDataChart.$$p[23]:
                    this.aba = this.abp;
                    break;
                case XamDataChart.$$p[24]:
                    this.abb = this.abq;
                    break;
                case "ActualWindowScaleHorizontal":
                case "ActualWindowScaleVertical":
                    if (!this.g8) {
                        this.ua(this.iu(), this.iv());
                    }
                    break;
                case XamDataChart.$$p[8]:
                    this.dw.fu(d);
                    {
                        for (let e of fromEnum(this.zq)) {
                            e.lx();
                        }
                    }
                    break;
                case XamDataChart.$$p[9]:
                    this.aae = this.aad;
                    break;
                case XamDataChart.$$p[22]:
                    this.aai = this.aar;
                    break;
                case XamDataChart.$$p[11]:
                case XamDataChart.$$p[13]:
                    this.t5();
                    break;
                case XamDataChart.$$p[0]:
                case XamDataChart.$$p[17]:
                    if (c != d) {
                        for (let f of fromEnum(this.zq)) {
                            f.d0 = true;
                            f.lx();
                        }
                    }
                    break;
                case XamDataChart.$$p[7]:
                case XamDataChart.$$p[5]:
                case XamDataChart.$$p[6]:
                    for (let g of fromEnum(this.zq)) {
                        g.l8();
                    }
                    break;
                case XamDataChart.$$p[4]:
                    this.acu();
                    break;
            }
        }
        s4() {
            super.s4();
            if (this.zg == 1 || this.zg == 2) {
                this.ac0();
            }
        }
        qk() {
            super.qk();
            if (this.z8 && this.zg != 0) {
                if (!this.aaq) {
                    this.ac0();
                }
            }
        }
        p9(a, b) {
            super.p9(a, b);
            if (this.z8 && this.zg == 2) {
                if (!a.isEmpty && !b.isEmpty) {
                    if (Math.abs(a.width - b.width) > 1E-10) {
                        if (!this.aaq) {
                            this.ac0();
                        }
                    }
                }
            }
        }
        qf() {
            super.qf();
            if (this.zr == 1) {
                this.acu();
            }
        }
        ac1() {
            this.acu();
        }
        acu() {
            let a = this.adw();
            this.z7 = false;
            if (!isNaN_(this.abl)) {
                this.aa7 = this.abl;
            }
            else {
                this.aa7 = a.left;
            }
            if (!isNaN_(this.abn)) {
                this.aa9 = this.abn;
            }
            else {
                this.aa9 = a.top;
            }
            if (!isNaN_(this.abm)) {
                this.aa8 = this.abm;
            }
            else {
                this.aa8 = a.right;
            }
            if (!isNaN_(this.abk)) {
                this.aa6 = this.abk;
            }
            else {
                this.aa6 = a.bottom;
            }
            this.yv = this.yt(this.y9);
            if (this.z7) {
                this.z7 = false;
                for (let b of fromEnum(this.zq)) {
                    b.d0 = true;
                    b.lx();
                }
                for (let c of fromEnum(this.b9)) {
                    c.r8(false);
                }
            }
        }
        adw() {
            this.ac3();
            switch (this.zr) {
                case 1:
                    let a = this.adx();
                    return a;
                default: return new Thickness(1, 0, 0, 0, 0);
            }
        }
        ac3() {
            this.ci = this.zy();
            this.ck = this.z1();
        }
        z1() {
            let a = 1;
            for (let b of fromEnum(this.b9)) {
                let c = b.cm();
                a = this.z0(a, c);
            }
            return a;
        }
        z0(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;
        }
        zy() {
            let a = 1;
            for (let b of fromEnum(this.b9)) {
                let c = b.cl();
                a = this.zx(a, c);
            }
            return a;
        }
        zx(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;
        }
        adx() {
            let a = new Thickness(1, 0, 0, 0, 0);
            for (let b = 0; b < this.b9.count; b++) {
                let c = this.b9._inner[b];
                let d = c.xf();
                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;
        }
        ady(a, b) {
            let c = new Thickness(1, 0, 0, 0, 0);
            for (let d = 0; d < this.b9.count; d++) {
                let e = this.b9._inner[d];
                let f = e.xh(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;
        }
        get_fn() {
            return this.zr == 1;
        }
        iu() {
            return this.aba;
        }
        iv() {
            return this.abb;
        }
        ty() {
            super.ty();
            this.aba = this.yr.width;
            this.abb = this.yr.height;
        }
        get aba() {
            return this.aay;
        }
        set aba(a) {
            let b = this.aay;
            this.aay = a;
            this.sr("ActualWindowScaleHorizontal", b, this.aay);
        }
        get abb() {
            return this.aaz;
        }
        set abb(a) {
            let b = this.aaz;
            this.aaz = a;
            this.sr("ActualWindowScaleVertical", b, this.aaz);
        }
        gg() {
            return this.aae;
        }
        gh() {
            return this.aai;
        }
        get z8() {
            return this.aal || this.aao;
        }
        get_gp() {
            return this.z9;
        }
        get z9() {
            return this.aap;
        }
        get_go() {
            return this.aao;
        }
        get_gn() {
            return this.aal;
        }
        ac0() {
            this.aaf = false;
            this.aak = true;
            this.aaj = true;
            for (let a = 0; a < this.zq.count; a++) {
                this.zq._inner[a].d0 = true;
                this.zq._inner[a].lx();
            }
        }
        acz() {
            this.aaf = false;
            this.aaj = true;
            for (let a = 0; a < this.zq.count; a++) {
                this.zq._inner[a].d0 = true;
                this.zq._inner[a].lx();
            }
        }
        acw(a, b, c, d) {
            if (a.ae == null) {
                return;
            }
            if (a.ae.d0 || a.ae.o6.isEmpty) {
                return;
            }
            if (a.ae.dh) {
                return;
            }
            let e = false;
            for (let f = 0; f < this.zq.count; f++) {
                let g = this.zq._inner[f].a1.bm;
                this.zq._inner[f].a1.ce();
                if (this.zq._inner[f].a1.bm != g) {
                    e = true;
                }
            }
            if (e) {
                return;
            }
            if (isNaN_(this.abi)) {
                this.abi = this.dw.a7;
                this.abj = this.dw.a8;
            }
            let h = false;
            let i = false;
            let j = 0;
            if (a.az) {
                let k = this.aaj;
                if (this.aao && this.aaj) {
                    j = this.abo(a, b, c, d);
                    this.aaj = false;
                    if (a.bq() != j) {
                        if (j == 0 && a.ae.c1) {
                            if (k) {
                                this.aak = true;
                                a.ae.l0();
                                h = true;
                                i = true;
                            }
                        }
                        else {
                            if ((j > a.bq()) || k) {
                                this.aak = true;
                                a.ae.l5(j);
                                h = true;
                                i = true;
                            }
                        }
                    }
                }
            }
            this.e7 = h;
            if (a.bq() != 0 || j != 0 || h) {
                let l = a.bq();
                let m = c.left + c.width / 2;
                let n = d.left + d.width / 2;
                if (a.a0) {
                    m = c.left;
                    n = d.left;
                }
                if (l == 0) {
                    m = m - a.c8.width / 2;
                    n = n - a.c8.width / 2;
                }
                let o = a.c4(new Rect(0, m, c.top, a.c8.width, a.c8.height), l);
                let p = a.c4(new Rect(0, n, d.top, a.c8.width, a.c8.height), l);
                c = o;
                d = p;
            }
            let q = false;
            if (this.aak) {
                this.aak = false;
                q = true;
            }
            this.aaf = true;
            let r = 0;
            let s = 0;
            let t = 0;
            let u = c.left + t;
            let v = d.right + t;
            let w = 0;
            w = this.y9.right + this.dw.a8;
            if (u < 0) {
                r = -u;
                r += this.abc;
            }
            if (v > w) {
                s = v - w;
                s += this.abc;
            }
            if (q) {
                if (u > 0) {
                    r = -u;
                    r += this.abc;
                }
                if (v < w) {
                    s = -(w - v);
                    s += this.abc;
                }
            }
            let x = false;
            let y = false;
            if (r != 0 || s != 0) {
                x = true;
                this.aa0 = this.aa0 + r;
                this.aa1 = this.aa1 + s;
                if (this.aa0 > this.abd) {
                    this.aa0 = this.abd;
                    y = true;
                }
                if (this.aa1 > this.abd) {
                    this.aa1 = this.abd;
                    y = true;
                }
                if (this.aa0 < 0) {
                    this.aa0 = 0;
                    y = true;
                }
                if (this.aa1 < 0) {
                    this.aa1 = 0;
                    y = true;
                }
            }
            else {
                if (this.e7) {
                    this.act();
                }
                return;
            }
            this.g7 = true;
            this.i7 = this.abi + this.aa0;
            this.jc = this.abj + this.aa1;
            this.g7 = false;
            this.gl = x;
            if (y) {
                if (q && (this.gl || this.e7)) {
                    this.act();
                }
                return;
            }
            if (this.gl || this.e7) {
                this.act();
            }
        }
        abo(a, b, c, d) {
            let e = this.abg(-1, a, b, c, d);
            let f = a.bq();
            if (e < f) {
                let g = c.left + c.width / 2;
                let h = d.left + d.width / 2;
                if (a.a0) {
                    g = c.left;
                    h = d.left;
                }
                let i = a.c4(new Rect(0, g, c.top, a.c8.width, a.c8.height), e);
                let j = a.c4(new Rect(0, h, d.top, a.c8.width, a.c8.height), e);
                if (e == 0) {
                    i = new Rect(0, g - a.c8.width / 2, c.top, a.c8.width, a.c8.height);
                    j = new Rect(0, h - a.c8.width / 2, d.top, a.c8.width, a.c8.height);
                }
                let k = a.c4(new Rect(0, g, c.top, a.c8.width, a.c8.height), f);
                let l = a.c4(new Rect(0, h, d.top, a.c8.width, a.c8.height), f);
                let m = j.right - l.right;
                let n = 0;
                let o = 0;
                o = this.y9.right + this.dw.a8;
                let p = i.left + n;
                let q = j.right + n;
                let r = 0;
                let s = 0;
                if (p < 0) {
                    r = -p;
                    r += this.abc;
                }
                if (q > o) {
                    s = q - o;
                    s += this.abc;
                }
                let t = false;
                if (this.aak || this.aaj) {
                    t = true;
                }
                if (t) {
                    if (p > 0) {
                        r = -p;
                        r += this.abc;
                    }
                    if (q < o) {
                        s = -(o - q);
                        s += this.abc;
                    }
                }
                let u = false;
                let v = false;
                let w = 0;
                let x = 0;
                if (r != 0 || s != 0) {
                    v = true;
                    w = this.aa0 + r;
                    x = this.aa1 + s;
                    if (w > this.abd) {
                        w = this.abd;
                        u = true;
                    }
                    if (x > this.abd) {
                        x = this.abd;
                        u = true;
                    }
                    if (w < 0) {
                        w = 0;
                        u = true;
                    }
                    if (x < 0) {
                        x = 0;
                        u = true;
                    }
                }
                let y = this.dw.a7;
                let z = this.dw.a8;
                let aa = new Thickness(1, this.abi + w, 0, this.abj + x, 0);
                let ab = (aa.left - y) + (aa.right - z);
                let ac = a.ae.o0().width;
                let ad = ac - ab;
                let ae = ad / ac;
                let af = a.bs() * ae;
                let ag = this.abg(af, a, b, c, d);
                if (ag == e) {
                    return e;
                }
                else {
                    return f;
                }
            }
            return e;
        }
        abg(a, b, c, d, e) {
            let f = b.c8;
            let g = b.bs();
            if (a < 0) {
            }
            if (a > 0) {
                g = a;
            }
            if (f.width < g) {
                return 0;
            }
            let h = 45;
            let i = new Rect(0, 0, f.top, f.width, f.height);
            let j = new Rect(0, g, f.top, f.width, f.height);
            let k = b.ac(i, h);
            let l = b.ac(j, h);
            let m = true;
            for (let n = 0; n < k.length; n++) {
                if (PolygonUtil.a(l, k[n])) {
                    m = false;
                    break;
                }
            }
            if (!m) {
                h = 90;
            }
            return h;
        }
        act() {
            for (let a = 0; a < this.zq.count; a++) {
                this.zq._inner[a].d0 = true;
                this.zq._inner[a].ly(false);
            }
            this.pf(true, false, false);
            this.aaf = false;
            for (let b = 0; b < this.zq.count; b++) {
                this.zq._inner[b].d0 = true;
                this.zq._inner[b].ly(false);
            }
            this.pf(true, false, false);
        }
        zs(a) {
            let b = a;
            if (b == 0) {
                let c = true;
                let d = false;
                let e = false;
                let f = false;
                let g = false;
                let h = false;
                let i = false;
                let j = false;
                let k = false;
                let l = false;
                let m = false;
                for (let n of fromEnum(this.zq)) {
                    if (n == null || !n.dx()) {
                        continue;
                    }
                    if (!n.dq) {
                        c = false;
                    }
                    if (n.df && n.dh && n.dm) {
                        d = true;
                    }
                    if (n.df && n.dh && n.dy) {
                        e = true;
                    }
                    if (n.df && n.dt && n.dm) {
                        f = true;
                    }
                    if (n.df && n.dt && n.dy) {
                        g = true;
                    }
                    if (n.dq && n.dh && n.dm) {
                        h = true;
                    }
                    if (n.dq && n.dh && n.dy) {
                        i = true;
                    }
                    if (n.dq && n.dt && n.dm) {
                        j = true;
                    }
                    if (n.dq && n.dt && n.dy) {
                        k = true;
                    }
                    if (n.dq && n.dm) {
                        l = true;
                    }
                    if (n.dq && n.dy) {
                        m = true;
                    }
                }
                if (d) {
                    b = 7;
                }
                else if (e) {
                    b = 8;
                }
                else if (f) {
                    b = 9;
                }
                else if (g) {
                    b = 10;
                }
                else if (h) {
                    b = 7;
                }
                else if (i) {
                    b = 8;
                }
                else if (j) {
                    b = 9;
                }
                else if (k) {
                    b = 10;
                }
                else {
                    b = 1;
                }
            }
            return b;
        }
        aat(a) {
            let b = new List$1(Axis.$, 0);
            if (this.zq == null || this.zq.count == 0) {
                return b;
            }
            let c = this.zs(a);
            for (let d of fromEnum(this.zq)) {
                if (d == null || !d.dx()) {
                    continue;
                }
                if (c == 1 && (d.df || d.dj)) {
                    b.add(d);
                }
                else if (c == 4 && d.dj) {
                    b.add(d);
                }
                else if (c == 3 && d.dy) {
                    b.add(d);
                }
                else if (c == 2 && d.dm) {
                    b.add(d);
                }
                else if (c == 5 && d.df && d.dm) {
                    b.add(d);
                }
                else if (c == 6 && d.df && d.dy) {
                    b.add(d);
                }
                else if (c == 9 && d.dt && d.dm) {
                    b.add(d);
                }
                else if (c == 10 && d.dt && d.dy) {
                    b.add(d);
                }
                else if (c == 7 && d.dh && d.dm) {
                    b.add(d);
                }
                else if (c == 8 && d.dh && d.dy) {
                    b.add(d);
                }
                else if (c == 11 && d.dq && d.dm) {
                    b.add(d);
                }
                else if (c == 12 && d.dq && d.dy) {
                    b.add(d);
                }
            }
            return b;
        }
        zl() {
            let a = this.aat(9);
            if (a.count > 0) {
                return a._inner[a.count - 1];
            }
            return null;
        }
        zm() {
            let a = this.aat(10);
            if (a.count > 0) {
                return a._inner[a.count - 1];
            }
            return null;
        }
        zj() {
            let a = this.aat(7);
            if (a.count > 0) {
                return a._inner[a.count - 1];
            }
            return null;
        }
        zk() {
            let a = this.aat(8);
            if (a.count > 0) {
                return a._inner[a.count - 1];
            }
            return null;
        }
        get axes() {
            return this.zn;
        }
        get zq() {
            return this.zo;
        }
        acy(a, b) {
            if (this.zh != null) {
                this.zh.p(a, b);
            }
            else {
                this.zq.clear();
            }
        }
        acx(a, b) {
            if (this.zh != null) {
                this.zh.o(a, b);
            }
            else {
                switch (b.action) {
                    case 0:
                        if (b.newItems != null) {
                            for (let c = 0; c < b.newItems.count; c++) {
                                let d = b.newItems.item(c);
                                this.zq.insert(c + b.newStartingIndex, d);
                            }
                        }
                        break;
                    case 1:
                        if (b.oldItems != null) {
                            for (let e = 0; e < b.oldItems.count; e++) {
                                this.zq.removeAt(b.oldStartingIndex);
                            }
                        }
                        break;
                    case 2:
                        if (b.oldItems != null) {
                            for (let f = 0; f < b.oldItems.count; f++) {
                                this.zq.removeAt(b.oldStartingIndex);
                            }
                        }
                        if (b.newItems != null) {
                            for (let g = 0; g < b.newItems.count; g++) {
                                let h = b.newItems.item(g);
                                this.zq.insert(g + b.newStartingIndex, h);
                            }
                        }
                        break;
                    case 4:
                        this.zq.clear();
                        for (let i of fromEnum(this.axes)) {
                            this.zq.add(i);
                        }
                        break;
                }
            }
        }
        acp(a, b) {
            if (b.oldItems != null) {
                for (let c of fromEn(b.oldItems)) {
                    if (c != null) {
                        c.cd = null;
                        c.b7 = null;
                        this.s8(c);
                        this.dw.dz(c);
                        c.rangeChanged = delegateRemove(c.rangeChanged, runOn(this, this.acs));
                        this.dw.d0(c);
                        c.labelMouseClick = delegateRemove(c.labelMouseClick, runOn(this, this.sd));
                        c.labelMouseEnter = delegateRemove(c.labelMouseEnter, runOn(this, this.sf));
                        c.labelMouseLeave = delegateRemove(c.labelMouseLeave, runOn(this, this.sg));
                        c.labelMouseDown = delegateRemove(c.labelMouseDown, runOn(this, this.se));
                        c.labelMouseUp = delegateRemove(c.labelMouseUp, runOn(this, this.si));
                        c.labelMouseOver = delegateRemove(c.labelMouseOver, runOn(this, this.sh));
                        c.panelMouseEnter = delegateRemove(c.panelMouseEnter, runOn(this, this.sl));
                        c.panelMouseLeave = delegateRemove(c.panelMouseLeave, runOn(this, this.sm));
                        c.panelMouseOver = delegateRemove(c.panelMouseOver, runOn(this, this.sn));
                        c.panelMouseDown = delegateRemove(c.panelMouseDown, runOn(this, this.sk));
                        c.panelMouseUp = delegateRemove(c.panelMouseUp, runOn(this, this.so));
                        c.panelMouseClick = delegateRemove(c.panelMouseClick, runOn(this, this.sj));
                        if (c.es != null) {
                            for (let d of fromEnum(c.eo())) {
                                d.r8(false);
                            }
                        }
                    }
                }
                if (this.zq.count == 0) {
                    this.te();
                }
            }
            if (b.newItems != null) {
                for (let e of fromEn(b.newItems)) {
                    if (e != null) {
                        this.t1(e);
                        e.cd = this.actualSyncLink;
                        e.b7 = this;
                        e.bp.a8();
                        this.dw.br(e);
                        e.rangeChanged = delegateCombine(e.rangeChanged, runOn(this, this.acs));
                        this.dw.bo(e);
                        e.labelMouseClick = delegateCombine(e.labelMouseClick, runOn(this, this.sd));
                        e.labelMouseEnter = delegateCombine(e.labelMouseEnter, runOn(this, this.sf));
                        e.labelMouseLeave = delegateCombine(e.labelMouseLeave, runOn(this, this.sg));
                        e.labelMouseDown = delegateCombine(e.labelMouseDown, runOn(this, this.se));
                        e.labelMouseUp = delegateCombine(e.labelMouseUp, runOn(this, this.si));
                        e.labelMouseOver = delegateCombine(e.labelMouseOver, runOn(this, this.sh));
                        e.panelMouseEnter = delegateCombine(e.panelMouseEnter, runOn(this, this.sl));
                        e.panelMouseLeave = delegateCombine(e.panelMouseLeave, runOn(this, this.sm));
                        e.panelMouseOver = delegateCombine(e.panelMouseOver, runOn(this, this.sn));
                        e.panelMouseDown = delegateCombine(e.panelMouseDown, runOn(this, this.sk));
                        e.panelMouseUp = delegateCombine(e.panelMouseUp, runOn(this, this.so));
                        e.panelMouseClick = delegateCombine(e.panelMouseClick, runOn(this, this.sj));
                    }
                }
            }
            this.p6();
            if (!this.aaq && this.gp) {
                this.s4();
            }
        }
        acr(a, b) {
            let c = new List$1(Series.$, 0);
            for (let d of fromEnum(this.zq)) {
                if (d.es != null) {
                    for (let e of fromEnum(d.eo())) {
                        if (!c.contains(e)) {
                            c.add(e);
                        }
                    }
                }
                d.cd = null;
                d.b7 = null;
                this.s8(d);
                this.dw.dz(d);
                d.rangeChanged = delegateRemove(d.rangeChanged, runOn(this, this.acs));
                this.dw.d0(d);
                this.te();
            }
            for (let f of fromEnum(this.b9)) {
                if (!c.contains(f)) {
                    c.add(f);
                }
            }
            for (let g of fromEnum(c)) {
                g.r8(false);
            }
        }
        acq(a, b) {
            if (this.aah) {
                return;
            }
            this.aah = true;
            if (b.oldItems != null) {
                for (let c of fromEn(b.oldItems)) {
                    if (c != null) {
                        if (c.ct) {
                            this.zi(this).w(c);
                        }
                    }
                }
            }
            if (b.newItems != null && this.zh != null) {
                for (let d of fromEn(b.newItems)) {
                    if (d != null) {
                        if (d.ct) {
                            this.zi(this).b(d);
                        }
                    }
                }
            }
            this.aah = false;
        }
        acs(a, b) {
            let c = typeCast(Axis.$, a);
            if (c == null) {
                return;
            }
            this.p6();
            if (this.axisRangeChanged != null) {
                this.axisRangeChanged(this, new ChartAxisRangeChangedEventArgs(this, c, b.oldMinimumValue, b.minimumValue, b.oldMaximumValue, b.maximumValue));
            }
            if (c.an != null) {
                c.an.lu();
            }
            c.lu();
            let d = this.e8;
            if (typeCast(CategoryAxisBase.$, c) !== null) {
                d = true;
            }
            for (let e of fromEnum(c.eo())) {
                e.g6 = true;
                this.p6();
                e.r8(d);
            }
            if (c.b7 != null) {
                for (let f of fromEnum(c.b7.b9)) {
                    f.qr();
                    XamDataChart.acv(c, d, f);
                }
            }
            for (let g of fromEnum(this.zq)) {
                if (g != c && g.an != null && g.an == c) {
                    g.lu();
                }
            }
        }
        static acv(a, b, c) {
        }
        t7(a, b) {
            super.t7(a, b);
            if (this.zq == null) {
                return;
            }
            for (let c of fromEnum(this.zq)) {
                c.cd = this.actualSyncLink;
                c.b7 = this;
            }
        }
        getFontInfo() {
            this.z4 = this.z3.fr;
            return this.z4;
        }
        ac2() {
            this.dw.eh();
            for (let a of fromEnum(this.zq)) {
                a.ly(false);
            }
            for (let b of fromEnum(this.b9)) {
                b.cw.bx();
                b.r8(false);
            }
        }
        getFontBrush() {
            return this.z3.fz;
        }
        o2() {
            super.o2();
            let a = new List$1(Axis.$, 0);
            for (let b = 0; b < this.axes.count; b++) {
                a.add(this.axes._inner[b]);
            }
            for (let c = 0; c < a.count; c++) {
                this.axes.remove(a._inner[c]);
                if (typeCast(CategoryAxisBase.$, a._inner[c]) !== null) {
                    let d = a._inner[c];
                    this.ta(d.name, true);
                    d.itemsSource = null;
                }
                a._inner[c].lb(null, null);
            }
        }
        xv() {
            return this.z3.fv;
        }
        gz() {
            return true;
        }
        t2() {
            super.t2();
            if (!this.gj) {
                return;
            }
            for (let a of fromEnum(this.axes)) {
                this.t1(a);
            }
        }
        fj() {
            if (this.aag) {
                return true;
            }
            return this.aac();
        }
        aac() {
            for (let a = 0; a < this.b9.count; a++) {
                if (this.b9._inner[a].fw || this.b9._inner[a].fs) {
                    return true;
                }
            }
            for (let b = 0; b < this.zq.count; b++) {
                if (this.zq._inner[b].dc || this.zq._inner[b].du) {
                    return true;
                }
            }
            return false;
        }
        dv() {
            return new XamDataChartView(this);
        }
        rw(a) {
            super.rw(a);
            this.z3 = a;
        }
        s5() {
            for (let a = 0; a < this.zn.count; a++) {
                this.zn._inner[a].d0 = true;
                this.zn._inner[a].ly(false);
            }
            super.s5();
        }
        get aa7() {
            return this.aav;
        }
        set aa7(a) {
            let b = this.aav;
            this.aav = a;
            if (this.aav != b) {
                this.z7 = true;
                this.sr(XamDataChart.abu, b, this.aav);
            }
        }
        get aa9() {
            return this.aax;
        }
        set aa9(a) {
            let b = this.aax;
            this.aax = a;
            if (this.aax != b) {
                this.z7 = true;
                this.sr(XamDataChart.abw, b, this.aax);
            }
        }
        get aa8() {
            return this.aaw;
        }
        set aa8(a) {
            let b = this.aaw;
            this.aaw = a;
            if (this.aaw != b) {
                this.z7 = true;
                this.sr(XamDataChart.abv, b, this.aaw);
            }
        }
        get aa6() {
            return this.aau;
        }
        set aa6(a) {
            let b = this.aau;
            this.aau = a;
            if (this.aau != b) {
                this.z7 = true;
                this.sr(XamDataChart.abt, b, this.aau);
            }
        }
        get abl() {
            return this.aa3;
        }
        set abl(a) {
            this.aa3 = a;
            this.acu();
        }
        get abn() {
            return this.aa5;
        }
        set abn(a) {
            this.aa5 = a;
            this.acu();
        }
        get abm() {
            return this.aa4;
        }
        set abm(a) {
            this.aa4 = a;
            this.acu();
        }
        get abk() {
            return this.aa2;
        }
        set abk(a) {
            this.aa2 = a;
            this.acu();
        }
        yt(a) {
            let b = super.yt(a);
            if (a.isEmpty) {
                return Rect.empty;
            }
            if (this.aa7 == 0 && this.aa9 == 0 && this.aa8 == 0 && this.aa6 == 0) {
                return b;
            }
            if (this.aa7 + this.aa8 >= a.width || this.aa9 + this.aa6 >= a.height) {
                return b;
            }
            let c = new Rect(0, a.left + this.aa7, a.top + this.aa9, a.width - this.aa7 - this.aa8, a.height - this.aa9 - this.aa6);
            if (this.fj()) {
                let d;
                if (c.width > c.height) {
                    let e = intDivide(truncate((c.width - c.height)), 2);
                    d = new Rect(0, c.left + e, c.top, c.height, c.height);
                }
                else {
                    let 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;
        }
        y0() {
            let a = this.y9;
            let b = this.za;
            let c = this.yv;
            if (c.isEmpty || a.isEmpty) {
                return a;
            }
            if (c.containsRect(a)) {
                return a;
            }
            if (a.containsRect(c)) {
                return c;
            }
            return a;
        }
        abs() {
            return this.zw.exportVisualData(this);
        }
        ab7() {
            let cvd_ = this.abs();
            cvd_.scaleByViewport();
            return (cvd_.serialize());
        }
        r5() {
            super.r5();
            for (let a = 0; a < this.zq.count; a++) {
                let b = this.zq._inner[a];
                let c = 50;
                if (!isNaN_(b.a1.bm)) {
                    c = b.a1.bm;
                }
                b.fp = c;
            }
        }
        s7() {
            super.s7();
            for (let a = 0; a < this.zq.count; a++) {
                let b = this.zq._inner[a];
                b.fp = NaN;
                b.d0 = true;
                b.ly(false);
            }
        }
        aas(a) {
            let b = new List$1(Axis.$, 0);
            for (let c of fromEnum(this.b9)) {
                let d = c.aw(a);
                if (d != null) {
                    b.add(d);
                }
            }
            return b;
        }
    }
    XamDataChart.$t = markType(XamDataChart, 'XamDataChart', SeriesViewer.$);
    XamDataChart.abf = 0;
    XamDataChart.abe = 0;
    XamDataChart.abu = "ActualPlotAreaMarginLeft";
    XamDataChart.abw = "ActualPlotAreaMarginTop";
    XamDataChart.abv = "ActualPlotAreaMarginRight";
    XamDataChart.abt = "ActualPlotAreaMarginBottom";
    XamDataChart.$$p = markDep(DependencyProperty, PropertyMetadata, XamDataChart, 'sr', ['AlignsGridLinesToPixels:aaa:ac4', [0, true], 'AutoExpandMarginExtraPadding:abc:ac5', [1, DeviceUtils.g(2)], 'AutoExpandMarginMaximumValue:abd:ac6', [1, 60], 'AutoMarginAndAngleUpdateMode:zg:ac7', [AutoMarginsAndAngleUpdateMode_$type, enumGetBox(AutoMarginsAndAngleUpdateMode_$type, 0)], 'ComputedPlotAreaMarginMode:zr:ac8', [ComputedPlotAreaMarginMode_$type, enumGetBox(ComputedPlotAreaMarginMode_$type, 0)], 'DefaultAxisMajorStroke:adt:ac9', [Brush.$, null], 'DefaultAxisMinorStroke:adu:ada', [Brush.$, null], 'DefaultAxisStroke:adv:adb', [Brush.$, null], 'GridMode:zu:adc', [GridMode_$type, enumGetBox(GridMode_$type, 2)], 'HorizontalZoomable:aad:add', [0, false], 'InitialCloseGridlinesThreshold:abh:ade', [1, NaN], 'IsHorizontalZoomEnabled:aae:adf', [0, false], 'IsSquare:aag:adg', [0, false], 'IsVerticalZoomEnabled:aai:adh', [0, false], 'SeriesPlotAreaMarginHorizontalMode:zz:adi', [SeriesPlotAreaMarginHorizontalMode_$type, enumGetBox(SeriesPlotAreaMarginHorizontalMode_$type, 0)], 'SeriesPlotAreaMarginVerticalMode:z2:adj', [SeriesPlotAreaMarginVerticalMode_$type, enumGetBox(SeriesPlotAreaMarginVerticalMode_$type, 0)], 'ShouldAutoExpandMarginForInitialLabels:aal:adk', [0, false], 'ShouldClipGridlines:aam:adl', [0, true], 'ShouldClipInitialCloseGridlines:aan:adm', [0, true], 'ShouldConsiderAutoRotationForInitialLabels:aao:adn', [0, false], 'ShouldSuppressAxisLabelTruncation:aap:ado', [0, false], 'SuppressAutoMarginAndAngleRecalculation:aaq:adp', [0, false], 'VerticalZoomable:aar:adq', [0, false], 'WindowScaleHorizontal:abp:adr', [1, NaN], 'WindowScaleVertical:abq:ads', [1, NaN]]);
    return XamDataChart;
})();
/**
 * @hidden
 */
export let LabelPanelArranger = /*@__PURE__*/ (() => {
    class LabelPanelArranger extends Base {
        static e(a, b) {
            for (let c of fromEnum(a)) {
                let d = c.ae;
                let e = d.an;
                e = LabelPanelArranger.a(c, d, e);
                let f = LabelPanelArranger.b(c);
                let g = 0;
                let h = 0;
                let i = 0;
                if (d.db()) {
                    c.ag.ab();
                    i = c.bm;
                }
                else {
                    i = c.bn(b);
                }
                g = i;
                h = i;
                if (c.ae.a4 != null && c.ae.a4.visibility != 0) {
                    h = 0;
                    g = 0;
                }
                if (c.as()) {
                    switch (f) {
                        case 0:
                            b.y = Math.max(0, b.top + h);
                            b.height = Math.max(0, b.height - h);
                            d.a4.c = 0;
                            break;
                        case 4:
                            if (e != null && (c.bl - b.top < h && typeCast(HorizontalAxisLabelPanel.$, c) !== null)) {
                                d.a4.c = 5;
                            }
                            else {
                                d.a4.c = 4;
                            }
                            break;
                        case 5:
                            if (e != null && (b.bottom - c.bl < h && typeCast(HorizontalAxisLabelPanel.$, c) !== null)) {
                                if (d.a4 != null) {
                                    d.a4.c = 4;
                                }
                            }
                            else {
                                if (d.a4 != null) {
                                    d.a4.c = 5;
                                }
                            }
                            break;
                        case 1:
                        default:
                            if (d.a4 != null) {
                                d.a4.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.a4.c = 3;
                            break;
                        case 6:
                            if (e != null && c.bl - b.left < g) {
                                d.a4.c = 7;
                            }
                            else {
                                d.a4.c = 6;
                            }
                            break;
                        case 7:
                            if (e != null && b.right - c.bl < g) {
                                d.a4.c = 6;
                            }
                            else {
                                d.a4.c = 7;
                            }
                            break;
                        case 2:
                        default:
                            if (d.a4 != null) {
                                d.a4.c = 2;
                            }
                            b.x = Math.max(0, b.left + g);
                            b.width = Math.max(0, b.width - g);
                            break;
                    }
                }
                if (c.ae.dc) {
                    if (d.a4 != null) {
                        d.a4.c = f;
                    }
                }
            }
            return b;
        }
        static a(a, b, c) {
            return b.ap();
        }
        static b(a) {
            if (a == null) {
                return 1;
            }
            else {
                let b = a.ae;
                if (b != null && b.a4 != null) {
                    let c = b.a4.c;
                    if (!a.a3(c)) {
                        return a.aj();
                    }
                    return c;
                }
                else {
                    return a.aj();
                }
            }
        }
        static c(a, b, c, d) {
            let e = a.ae;
            let f = e.an;
            f = LabelPanelArranger.a(a, e, f);
            let g = LabelPanelArranger.b(a);
            let h;
            let i = a.bn(c);
            let j = Math.max(0, i);
            let k = Math.max(0, i);
            if (a.ae != null && a.ae.a4 != null && a.ae.a4.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.bl, 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.bl - 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.bl, 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.bl - 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.ae.dc) {
                h = new Rect(0, c.left, c.top, c.width, c.height);
                d(a, h);
            }
        }
        static d(a, b, c, d) {
            let e = new List$1(AxisLabelPanelBase.$, 0);
            let f = new List$1(AxisLabelPanelBase.$, 0);
            for (let g of fromEnum(a)) {
                let 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;
                }
            }
            for (let i of fromEnum(f)) {
                LabelPanelArranger.c(i, b, c, d);
            }
            for (let j of fromEnum(e)) {
                LabelPanelArranger.c(j, b, c, d);
            }
        }
    }
    LabelPanelArranger.$t = markType(LabelPanelArranger, 'LabelPanelArranger');
    return LabelPanelArranger;
})();
/**
 * @hidden
 */
export let ChartContentManager = /*@__PURE__*/ (() => {
    class ChartContentManager extends DependencyObject {
        constructor(a) {
            super();
            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;
        }
        get u() {
            return this.t;
        }
        set u(a) {
            this.t = a;
        }
        k(a, b, c) {
            let d = this.j(a, b);
            d.a = c;
            return d;
        }
        ad(a, b) {
            let c = this.r.item(a);
            if (c.containsKey(b)) {
                c.removeItem(b);
            }
            let d = typeCast(Series.$, b);
            if (d != null && this.u.contains(d)) {
                this.u.remove(d);
            }
        }
        aa(a) {
            let b = this.v;
            this.v = a;
            if (this.m && b == null && this.v != null) {
                this.v.setTimeout(runOn(this, this.w), 0);
            }
        }
        z() {
            if (!this.m) {
                this.m = true;
                if (this.v != null) {
                    this.v.setTimeout(runOn(this, this.w), 0);
                }
                else {
                }
            }
        }
        ac(a, b, c, d) {
            let e = c;
            if (!e.c) {
                e.b = d;
            }
            else {
                if (!d) {
                    e.b = false;
                }
            }
            if (!e.c) {
                e.c = true;
                this.z();
            }
        }
        j(a, b) {
            let c = this.r.item(a);
            let d = null;
            if (!((() => { let e = c.tryGetValue(b, d); d = e.p1; return e.ret; })())) {
                d = new ContentInfo();
                d.h = b;
                c.addItem(b, d);
                let e = typeCast(Series.$, b);
                if (e != null && !this.u.contains(e)) {
                    if (e.isFragment) {
                        let f = e.bq();
                        let g = this.u.indexOf(f) + 1;
                        g += e.kg();
                        if (this.u.count <= g || f.kl() == 0 || g == -1) {
                            this.u.add(e);
                        }
                        else {
                            this.u.insert(g, e);
                        }
                    }
                    else {
                        this.u.add(e);
                    }
                }
            }
            return d;
        }
        y() {
            this.w();
        }
        w() {
            if (this.l == null || this.r == null) {
                return;
            }
            if (!this.m) {
                return;
            }
            this.m = false;
            if (this.l != null) {
                this.l.oo();
            }
            for (let a of fromEnum(this.s())) {
                a.f();
            }
            if (!this.m) {
                this.l.ss();
            }
        }
        *_s() {
            let a = null;
            a = this.r.item(1);
            for (let b of fromEnum(a.values)) {
                yield b;
            }
            a = this.r.item(0);
            let c = new List$1(ContentInfo.$, 0);
            for (let d of fromEnum(this.u)) {
                if (!d.ev) {
                    c.add(a.item(d));
                }
            }
            for (let e of fromEnum(this.u)) {
                if (e.ev) {
                    c.add(a.item(e));
                }
            }
            for (let f of fromEnum(c)) {
                yield f;
            }
            a = this.r.item(2);
            for (let g of fromEnum(a.values)) {
                yield g;
            }
        }
        s() {
            return toEnum(() => this._s());
        }
        x(a) {
            for (let b of fromEnum(this.r.item(1).values)) {
                b.h.k7(a);
            }
            for (let c of fromEnum(this.r.item(1).values)) {
                c.f();
            }
            for (let d of fromEnum(this.r.item(1).values)) {
                d.h.l7();
            }
        }
        ae(a, b, c, d) {
            c.i = d;
        }
        ab(a, b) {
            if (!b.e) {
                b.e = true;
                this.z();
            }
        }
    }
    ChartContentManager.$t = markType(ChartContentManager, 'ChartContentManager', DependencyObject.$);
    return ChartContentManager;
})();
/**
 * @hidden
 */
export let ContentInfo = /*@__PURE__*/ (() => {
    class ContentInfo extends Base {
        constructor() {
            super(...arguments);
            this.h = null;
            this.a = null;
            this.b = false;
            this.c = false;
            this.i = null;
            this.e = false;
        }
        get d() {
            if (this.i.isEmpty) {
                return false;
            }
            if (this.i.width == 0 && this.i.height == 0) {
                return false;
            }
            return true;
        }
        g() {
            if (this.e && typeCast(Axis.$, this.h) !== null) {
                this.e = false;
                let a = this.c;
                this.c = true;
                let b = this.h.ee(true);
                if (!b) {
                    this.c = a;
                }
            }
        }
        f() {
            this.g();
            if (typeCast(Axis.$, this.h) !== null) {
                let a = typeCast(Axis.$, this.h);
                if (a.an != null) {
                    let b = a.an;
                    if (b.bq != null && b.bq.e) {
                        b.bq.g();
                    }
                }
            }
            if (this.c) {
                this.c = false;
                this.a(this.b);
                this.b = false;
            }
        }
    }
    ContentInfo.$t = markType(ContentInfo, 'ContentInfo');
    return ContentInfo;
})();
/**
 * @hidden
 */
export let Series = /*@__PURE__*/ (() => {
    class Series extends Control {
        constructor() {
            super();
            this.mb = null;
            this.cw = null;
            this.kp = 0;
            this.w3 = null;
            this.ez = false;
            this.j7 = null;
            this.cd = null;
            this.dr = null;
            this.bb = null;
            this.a9 = null;
            this.dd = null;
            this.td = null;
            this.hn = new Dictionary$2(String_$type, String_$type, 0);
            this.hm = new Dictionary$2(String_$type, FastReflectionHelper.$, 0);
            this.kr = null;
            this.propertyChanged = null;
            this.propertyUpdated = null;
            this.d9 = false;
            this.transitionOutCompleted = null;
            this.renderRequested = null;
            this.bu = 1;
            this.ce = new SeriesLayerPropertyOverlayCollection();
            this.b5 = null;
            this.dw = false;
            this.renderValid = null;
            this.g7 = false;
            this.ha = false;
            this.gq = false;
            this.cv = null;
            this.a1 = null;
            this.dz = true;
            this.h1 = new Stack$1(String_$type);
            this.gx = false;
            this.gy = false;
            this.d0 = false;
            this.d1 = false;
            this.as = null;
            this.at = null;
            this.d8 = false;
            this.c3 = null;
            this.db = null;
            this.h4 = null;
            this.bi = null;
            this.dq = null;
            this.j4 = null;
            this.ta = null;
            this.a4 = null;
            this.c2 = 0;
            this.c1 = 0;
            this.ec = false;
            this.dy = false;
            this.h8 = DeviceUtils.g(1);
            this.ic = NaN;
            this.h9 = NaN;
            this.ia = NaN;
            this.ib = NaN;
            this.v0 = null;
            this.v2 = null;
            this.v3 = BrushUtil.j(255, 255, 0, 0);
            this.v1 = BrushUtil.j(255, 255, 0, 0);
            this.is = DeviceUtils.g(2);
            this.bx = 1;
            this.co = 1;
            this.cn = 1;
            this.h6 = 0.2;
            this.h7 = 0.2;
            this.d3 = false;
            this.dx = false;
            this.eh = false;
            this.h0 = null;
            this.dv = false;
            this.cx = 1;
            this.ch = 1;
            this.ku = null;
            this.eb = false;
            this.br = new SeriesComponentsForView();
            this.d2 = false;
            this.lb = null;
            this.j6 = null;
            this._coercionMethods = null;
            this.du = false;
            this.b1 = 0;
            this.b0 = 0;
            this.dt = null;
            this.wq = { $type: Point_$type, x: NaN, y: NaN };
            this.id = NaN;
            this.ie = NaN;
            this.hr = new Dictionary$2(SeriesLayer.$, Series.$, 0);
            this.hx = new List$1(Series.$, 0);
            this.b6 = null;
            this.b9 = new SeriesLayerCollection();
            this.b8 = new SeriesLayerCollection();
            this.b7 = new SeriesLayerCollection();
            this.hu = new HashSet$1(String_$type, 0);
            this.bo = null;
            this.bl = null;
            this.hs = new Dictionary$2(String_$type, Number_$type, 0);
            this.ho = 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.kp = Series.j9++;
            this.g6 = true;
            this.w3 = Rect.empty;
            this.cw = this.ct();
            this.cw.b9 = Rect.empty;
            this.rh(this.cw);
            this.cw.q = true;
            this.cw.a4();
            this.cw.q = false;
            this.ab = Series.$;
            this.cd = new SeriesLayerManager();
            this.cd.a = this;
            this.dq = (a, b) => {
                if (this.dc == null || !this.dc.fr) {
                    this.s9(b.oldRect, b.newRect);
                }
            };
            this.bi = (a, b) => this.rq(a, b.propertyName, b.oldValue, b.newValue);
            this.j4 = (a, b) => {
                if (this.dc != null) {
                    this.g6 = true;
                    this.dc.p7();
                }
                this.po(b.action, b.position, b.count, b.propertyName);
            };
            this.propertyUpdated = delegateCombine(this.propertyUpdated, (a, b) => this.rq(a, b.propertyName, b.oldValue, b.newValue));
            let a = this.b9;
            a.collectionResetting = delegateCombine(a.collectionResetting, runOn(this, this.o7));
            let b = this.b9;
            b.collectionChanged = delegateCombine(b.collectionChanged, runOn(this, this.o6));
            let c = this.b8;
            c.collectionResetting = delegateCombine(c.collectionResetting, runOn(this, this.o3));
            let d = this.b8;
            d.collectionChanged = delegateCombine(d.collectionChanged, runOn(this, this.o2));
            let e = this.b7;
            e.collectionResetting = delegateCombine(e.collectionResetting, runOn(this, this.o1));
            let f = this.b7;
            f.collectionChanged = delegateCombine(f.collectionChanged, runOn(this, this.o0));
            let g = this.ce;
            g.collectionResetting = delegateCombine(g.collectionResetting, runOn(this, this.o5));
            let h = this.ce;
            h.collectionChanged = delegateCombine(h.collectionChanged, runOn(this, this.o4));
            this.td = new Canvas();
            this.dd = new DoubleAnimator(0, 1, this.km);
            let i = this.dd;
            i.propertyChanged = delegateCombine(i.propertyChanged, runOn(this, this.o8));
            this.g(Series.vn, ((() => {
                let $ret = new Binding(1, "Visibility");
                $ret.d = this;
                return $ret;
            })()));
            this.b2 = this.b3();
            this.cy = this.cz();
        }
        p0(a) {
            Series.pz(this, a, false);
        }
        gi() {
            if (this.dc != null && this.dc.gx()) {
                return true;
            }
            return false;
        }
        get_dataLegendKey() {
            if (!stringIsNullOrEmpty(this.name)) {
                return this.name;
            }
            return "Index___" + this.index.toString();
        }
        get dataLegendKey() {
            return this.get_dataLegendKey();
        }
        get group() {
            if (this.bo != null && !stringIsNullOrEmpty(this.mu)) {
                return this.mu;
            }
            if (!stringIsNullOrEmpty(this.me)) {
                return this.me;
            }
            return this.mn();
        }
        get parentKey() {
            return this.bo != null ? this.bo.dataLegendKey : this.dataLegendKey;
        }
        get parentTitle() {
            if (this.bo != null) {
                return this.bo.title.toString();
            }
            if (this.title != null) {
                return this.title.toString();
            }
            return "SeriesNoTitle";
        }
        get j8() {
            return this.j7;
        }
        set j8(a) {
            this.j7 = a;
            this.dd.u(this.j7);
        }
        provideRenderer(a) {
            this.j8 = a;
        }
        np() {
            return this.ba.a$v(this);
        }
        kf() {
            return this.bo.actualLayers.indexOf(this.b6);
        }
        o6(a, b) {
            this.cd.h(this, this.b9, b);
        }
        o7(a, b) {
            this.cd.j(this, this.b9, b);
        }
        o2(a, b) {
            this.cd.e(this, this.b9, b);
        }
        o3(a, b) {
            this.cd.f(this, this.b9, b);
        }
        o0(a, b) {
            this.cd.c(this, this.b9, b);
            if (this.dc != null) {
                this.dc.p0();
            }
        }
        o1(a, b) {
            this.cd.d(this, this.b9, b);
            if (this.dc != null) {
                this.dc.p0();
            }
        }
        o4(a, b) {
            switch (b.action) {
                case 0:
                    if (b.newItems != null) {
                        for (let c = 0; c < b.newItems.count; c++) {
                            let d = b.newItems.item(c);
                            d.o = true;
                            this.rb(c + b.newStartingIndex, d);
                        }
                    }
                    break;
                case 1:
                    if (b.oldItems != null) {
                        for (let e = 0; e < b.oldItems.count; e++) {
                            let f = b.oldItems.item(e);
                            this.rc(f, b.oldStartingIndex);
                        }
                    }
                    break;
                case 2:
                    if (b.oldItems != null) {
                        for (let g = 0; g < b.oldItems.count; g++) {
                            let h = b.oldItems.item(g);
                            this.rc(h, b.oldStartingIndex);
                        }
                    }
                    if (b.newItems != null) {
                        for (let i = 0; i < b.newItems.count; i++) {
                            let j = b.newItems.item(i);
                            this.rb(i + b.newStartingIndex, j);
                        }
                    }
                    break;
                case 4:
                    this.q5();
                    let k = 0;
                    for (let l of fromEnum(this.ce)) {
                        let m = l;
                        this.rb(k, m);
                        k++;
                    }
                    break;
            }
        }
        q5() {
            let a = this.b5;
            if (a != null) {
                let b = new List$1(SeriesLayerPropertyOverlay.$, 0);
                let c = new List$1(SeriesLayerPropertyOverlay.$, 0);
                for (let d of fromEnum(a.m)) {
                    if (d.o) {
                        b.add(d);
                    }
                }
                for (let e of fromEnum(b)) {
                    a.m.remove(e);
                    if (e.k != null) {
                        c.add(e.k);
                    }
                }
                for (let f of fromEnum(c)) {
                    a.m.add(f);
                }
            }
        }
        rc(a, b) {
            let c = this.b5;
            if (c != null) {
                let d = c.m.indexOf(a);
                if (d >= 0) {
                    let e = c.m._inner[d];
                    c.m.removeAt(d);
                    if (e.k != null) {
                        c.m.insert(d, a);
                    }
                }
            }
        }
        rb(a, b) {
            let c = this.b5;
            if (c != null) {
                let d = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
                for (let e of fromEnum(c.m)) {
                    d.addItem(e.ad, b);
                }
                if (d.containsKey(b.ad)) {
                    b.k = d.item(b.ad);
                    c.m.remove(d.item(b.ad));
                }
                c.m.add(b);
            }
        }
        o5(a, b) {
            this.q5();
        }
        s3(a) {
        }
        s2(a) {
        }
        s4(a) {
        }
        o8(a, b) {
            this.jz = this.dd.o;
        }
        get ds() {
            if (this.dr == null) {
                this.dr = new SRProvider(this.j8);
            }
            if (this.dr.l == null) {
                if (this.j8 != null) {
                    this.dr.l = this.j8;
                }
                else if (this.dc != null && this.dc.dw != null && this.dc.dw.j != null && this.dc.dw.j.ae != null) {
                    this.dr.l = this.dc.dw.j.ae;
                }
            }
            return this.dr;
        }
        get bc() {
            if (this.bb == null) {
                this.bb = DVContainer.instance.createInstance(ISeriesVisualDataManager_$type, () => this.ds.q);
            }
            return this.bb;
        }
        get ht() {
            return this.ba.a$k;
        }
        get ba() {
            if (this.a9 == null) {
                this.a9 = DVContainer.instance.createInstance(ISeriesInteractionManager_$type, () => this.ds.n);
                if (this.toolTip != null) {
                    this.a9.a$at(this, this.toolTip);
                }
            }
            return this.a9;
        }
        get fl() {
            return DVContainer.instance.checkLoaded("InteractivityFactoryManager");
        }
        rh(a) {
        }
        re() {
            this.o9(this.a5, this.a5);
            if (this.dp == null && this.c4 != null && this.itemsSource != null) {
                this.dp = this.c4.getFastItemsSource(this.itemsSource);
            }
            this.cw.a7();
        }
        rf() {
            this.ph();
            if (this.dp != null && this.c4 != null && this.itemsSource != null) {
                this.dp = this.c4.releaseFastItemsSource(this.itemsSource);
            }
            this.cw.a8();
        }
        cu() {
            return this.ct();
        }
        ct() {
            return new SeriesView(this);
        }
        hh() {
            return false;
        }
        kz(a, b) {
            return null;
        }
        mo(a) {
            return null;
        }
        onLegendItemOver(a) {
        }
        onLegendItemPointerUp(a) {
        }
        onLegendItemPointerDown(a) {
        }
        onLegendItemEnter(a) {
            if (this.fh && this.fl && this.dc != null && (this.dc.bs == 0 || this.dc.bs == 2) && this.by != 1) {
                this.ba.a$ac(this, a, { $type: Point_$type, x: NaN, y: NaN }, false, true, false, a == null, this == this.dc.b5, false);
            }
        }
        onLegendItemLeave(a) {
            if (this.fh && this.fl && this.dc != null && (this.dc.bs == 0 || this.dc.bs == 2) && this.by != 1) {
                this.ba.a$ac(this, a, { $type: Point_$type, x: NaN, y: NaN }, false, true, true, a == null, this == this.dc.b5, a != null);
            }
        }
        no(a) {
            if (!this.hn.containsKey(a)) {
                let b = a.substr(0, 1).toUpperCase() + a.substr(1);
                this.hn.addItem(a, b);
            }
            return this.hn.item(a);
        }
        k0(a, b, c) {
            let d = null;
            if (!this.hm.containsKey(b)) {
                d = new FastReflectionHelper(false, c);
                this.hm.addItem(b, d);
            }
            else {
                d = this.hm.item(b);
            }
            d.propertyName = c;
            let e = d.getPropertyValue(a);
            if (this.expectFunctions) {
                let func_ = e;
                let item_ = a;
                if ((typeof func_ === 'function')) {
                    e = func_.apply(item_);
                }
            }
            return e;
        }
        iy(a) {
            return this.kc(a);
        }
        ke(a) {
            return -1;
        }
        get_fv() {
            return false;
        }
        get fv() {
            return this.get_fv();
        }
        a0() {
            return null;
        }
        kc(a) {
            return -1;
        }
        xf() {
            let a = 1;
            let b = 1;
            if (this.dc != null) {
                a = this.dc.ci;
                b = this.dc.ck;
            }
            return this.xg(a, b);
        }
        xh(a, b) {
            return this.xg(a, b);
        }
        xg(a, b) {
            return new Thickness(1, 0, 0, 0, 0);
        }
        cl() {
            return 1;
        }
        cm() {
            return 1;
        }
        kw(a) {
            return null;
        }
        qi(a, b, c) {
        }
        ak(a, b) {
            return null;
        }
        k5(a, b) {
            return a.kw(b);
        }
        dj(a, b, c, d) {
            return a.dh(b, c, d);
        }
        dk(a, b, c, d) {
            return a.di(b, c, d);
        }
        kb() {
            return -1;
        }
        kg() {
            return -1;
        }
        kl() {
            return -1;
        }
        get container() {
            return this.dc;
        }
        get hasSubItems() {
            return this.ej();
        }
        ej() {
            if (this.d3 && this.h0 != null) {
                return true;
            }
            return false;
        }
        forSubItems(a) {
            this.qg(a);
        }
        qg(a) {
            if (this.d3 && this.h0 != null) {
                for (let b of fromEnum(this.h0)) {
                    a(b);
                }
            }
        }
        qh(a) {
        }
        get ei() {
            return this.b7.count > 0;
        }
        qf(a) {
            for (let b = 0; b < this.hx.count; b++) {
                let c = this.hx._inner[b];
                if (!a(c)) {
                    break;
                }
            }
        }
        nn() {
            return null;
        }
        wg() {
            return this.vz;
        }
        wh() {
            return this.wf;
        }
        resolveLegendIndex() {
            return this.index;
        }
        bq() {
            return null;
        }
        get_f7() {
            return false;
        }
        get f7() {
            return this.get_f7();
        }
        get_ev() {
            return false;
        }
        get ev() {
            return this.get_ev();
        }
        get_er() {
            return false;
        }
        get er() {
            return this.get_er();
        }
        get_eq() {
            return false;
        }
        get eq() {
            return this.get_eq();
        }
        get_eu() {
            return false;
        }
        get eu() {
            return this.get_eu();
        }
        get_et() {
            return false;
        }
        get et() {
            return this.get_et();
        }
        get_f9() {
            return false;
        }
        get f9() {
            return this.get_f9();
        }
        get_ga() {
            return false;
        }
        get ga() {
            return this.get_ga();
        }
        get_ew() {
            return false;
        }
        get ew() {
            return this.get_ew();
        }
        get_es() {
            return false;
        }
        get es() {
            return this.get_es();
        }
        get_isVertical() {
            return false;
        }
        get isVertical() {
            return this.get_isVertical();
        }
        get_isFragment() {
            return false;
        }
        get isFragment() {
            return this.get_isFragment();
        }
        get_ey() {
            return false;
        }
        get ey() {
            return this.get_ey();
        }
        get_ex() {
            return false;
        }
        get ex() {
            return this.get_ex();
        }
        get_em() {
            return false;
        }
        get em() {
            return this.get_em();
        }
        get_gb() {
            return false;
        }
        get gb() {
            return this.get_gb();
        }
        get_fn() {
            return false;
        }
        get fn() {
            return this.get_fn();
        }
        get_fm() {
            return false;
        }
        get fm() {
            return this.get_fm();
        }
        get_f3() {
            return false;
        }
        get f3() {
            return this.get_f3();
        }
        get_e2() {
            return false;
        }
        get e2() {
            return this.get_e2();
        }
        get_e0() {
            return false;
        }
        get e0() {
            return this.get_e0();
        }
        get_gc() {
            return false;
        }
        get gc() {
            return this.get_gc();
        }
        get_fu() {
            return false;
        }
        get fu() {
            return this.get_fu();
        }
        get_ft() {
            return false;
        }
        get ft() {
            return this.get_ft();
        }
        get_fr() {
            return false;
        }
        get fr() {
            return this.get_fr();
        }
        get_fq() {
            return false;
        }
        get fq() {
            return this.get_fq();
        }
        get_f6() {
            return false;
        }
        get f6() {
            return this.get_f6();
        }
        get_f4() {
            return false;
        }
        get f4() {
            return this.get_f4();
        }
        get_f1() {
            return false;
        }
        get f1() {
            return this.get_f1();
        }
        get_fs() {
            return false;
        }
        get fs() {
            return this.get_fs();
        }
        get_fz() {
            return false;
        }
        get fz() {
            return this.get_fz();
        }
        get_fw() {
            return false;
        }
        get fw() {
            return this.get_fw();
        }
        get_isStacked() {
            return false;
        }
        get isStacked() {
            return this.get_isStacked();
        }
        get_fa() {
            return false;
        }
        get fa() {
            return this.get_fa();
        }
        get_fx() {
            return false;
        }
        get fx() {
            return this.get_fx();
        }
        get_e1() {
            return false;
        }
        get e1() {
            return this.get_e1();
        }
        get_ff() {
            return false;
        }
        get ff() {
            return this.get_ff();
        }
        get_f0() {
            return false;
        }
        get f0() {
            return this.get_f0();
        }
        get_isValueOverlay() {
            return false;
        }
        get isValueOverlay() {
            return this.get_isValueOverlay();
        }
        get_fi() {
            return this.bo != null;
        }
        get fi() {
            return this.get_fi();
        }
        get_isSummarizationSupported() {
            return !this.isValueOverlay;
        }
        get isSummarizationSupported() {
            return this.get_isSummarizationSupported();
        }
        get isLayer() {
            return this.bo != null;
        }
        bp() {
            return null;
        }
        get_ek() {
            return false;
        }
        get ek() {
            return this.get_ek();
        }
        get_fd() {
            return false;
        }
        get fd() {
            return this.get_fd();
        }
        get_fc() {
            return false;
        }
        get fc() {
            return this.get_fc();
        }
        get_fb() {
            return false;
        }
        get fb() {
            return this.get_fb();
        }
        get_fe() {
            return false;
        }
        get fe() {
            return this.get_fe();
        }
        get_e4() {
            return false;
        }
        get e4() {
            return this.get_e4();
        }
        get_e5() {
            return false;
        }
        get e5() {
            return this.get_e5();
        }
        get_e6() {
            return false;
        }
        get e6() {
            return this.get_e6();
        }
        iw(a, b, c, d, e) {
            return Number.POSITIVE_INFINITY;
        }
        ix(a, b, c, d, e, f, g) {
            return this.ba.a$n(this, a, b, c, d, e, f, g);
        }
        get_hj() {
            return false;
        }
        get hj() {
            return this.get_hj();
        }
        jf(a, b, c, d, e, f, g, h) {
            return this.ba.a$q(this, a, b, c, d, e, f, g, h);
        }
        i2(a, b, c, d, e, f, g, h) {
            return this.ba.a$p(this, a, b, c, d, e, f, g, h);
        }
        kk(a, b, c, d, e) {
            return this.ba.a$s(this, a, b, c, d, e);
        }
        i1(a) {
            return (a ? 10 : 3);
        }
        aj(a) {
            return null;
        }
        al(a) {
            return null;
        }
        g1(a, b) {
            return this.ba.a$g(this, a, b);
        }
        an(a, b, c, d, e, f) {
            return this.ba.a$b(this, a, b, c, d, e, f);
        }
        am(a, b, c, d, e, f) {
            return this.ba.a$a(this, a, b, c, d, e, f);
        }
        g3(a, b, c) {
            return this.ba.a$h(this, a, b, c);
        }
        g4(a, b) {
            return this.ba.a$i(this, a, b);
        }
        ki(a, b, c, d, e) {
            return this.ba.a$r(this, a, b, c, d, e);
        }
        i0(a, b) {
            return this.ba.a$o(this, a, b);
        }
        kj(a, b) {
            return -1;
        }
        kh(a, b) {
            return -1;
        }
        jd(a, b, c) {
            return NaN;
        }
        ww(a, b, c) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        w8(a) {
            return Rect.empty;
        }
        ao(a) {
            let b = this.w8(a);
            if (!b.isEmpty) {
                let c = new Array(1);
                c[0] = b;
                return c;
            }
            return null;
        }
        w9(a) {
            return this.w8(this.w2(a));
        }
        ap(a) {
            return this.ao(this.w2(a));
        }
        ar(a, b) {
            return null;
        }
        xa(a) {
            return Rect.empty;
        }
        xb(a) {
            return this.xa(this.w2(a));
        }
        g5(a, b) {
            return this.ba.a$j(this, a, b);
        }
        wy(a, b, c, d, e, f, g, h, i) {
            return this.ba.a$av(this, a, b, c, d, e, f, g, h, i);
        }
        i9(a, b, c) {
            return this.jd(a, b, c);
        }
        ws(a, b, c) {
            return this.ww(a, b, c);
        }
        jb(a, b, c) {
            return this.jd(a, b, c);
        }
        wu(a, b, c) {
            return this.ww(a, b, c);
        }
        wx(a, b, c) {
            let d = this.w2(a);
            return this.ww(d, b, c);
        }
        je(a, b, c) {
            let d = this.w2(a);
            return this.jd(d, b, c);
        }
        wt(a, b, c) {
            let d = this.w2(a);
            return this.ws(d, b, c);
        }
        ja(a, b, c) {
            let d = this.w2(a);
            return this.i9(d, b, c);
        }
        wv(a, b, c) {
            let d = this.w2(a);
            return this.wu(d, b, c);
        }
        jc(a, b, c) {
            let d = this.w2(a);
            return this.jb(d, b, c);
        }
        kd(a) {
            let b = this.w2(a);
            return this.kc(b);
        }
        i3() {
            return 0;
        }
        static pz(a, b, c) {
            if (b != null && b.dw.j.ae != null) {
                b.dw.j.ae.getExternal(a, b.dw.j.ae.rootWrapper, b.dw.j.ae.getExternal(b, null, null));
            }
            let d = a;
        }
        iz(a) {
            let b = this.w2(a);
            return this.iy(b);
        }
        kx(a) {
            let b = this.w2(a);
            return this.kw(b);
        }
        pc(a, b) {
            a.kr = b;
        }
        k9(a) {
            return a.kr;
        }
        au(a) {
            if (a && this.as != null) {
                return this.as;
            }
            if (this.at != null) {
                return this.at;
            }
            return this.kr;
        }
        ed(a, b, c, d, e) {
            return false;
        }
        jl(a) {
            let b = this.mp();
            if (b == null) {
                return NaN;
            }
            if (a.content == null) {
                return NaN;
            }
            if (a.content.item == null) {
                return NaN;
            }
            return FastItemColumn.i(this.kz(a.content.item, b));
        }
        jk(a) {
            let b = this.mp();
            if (b == null) {
                return NaN;
            }
            if (a == null) {
                return NaN;
            }
            return FastItemColumn.i(this.kz(a, b));
        }
        mp() {
            return null;
        }
        jg(a, b) {
            return NaN;
        }
        aq(a) {
            return [NaN, NaN];
        }
        wz(a) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        w0(a) {
            return { $type: Point_$type, x: NaN, y: NaN };
        }
        raisePropertyChanged(a, b, c) {
            this.sr(a);
            if (this.propertyChanged != null) {
                this.propertyChanged(this, new PropertyChangedEventArgs(a));
            }
            c = this.lc(a, b, c);
            if (this.propertyUpdated != null) {
                if (a == Series.$$p[20] && b != null && c != null) {
                    this.d9 = true;
                }
                this.propertyUpdated(this, new PropertyUpdatedEventArgs(a, b, c));
                if (a == Series.$$p[20] && b != null && c != null) {
                    this.d9 = false;
                }
            }
            this.st(a);
        }
        lc(a, b, c) {
            this.hu.add_1(a);
            if (this.ee) {
                c = this.k7(a, b, c);
            }
            return c;
        }
        k7(a, b, c) {
            if (this.gs(a)) {
                return c;
            }
            for (let d = 0; d < this.hx.count; d++) {
                let e = this.hx._inner[d];
                let f = e.b6;
                let g = this.t5(a);
                if (g == null) {
                    continue;
                }
                c = f.ai(this, e, g, c);
            }
            return c;
        }
        t5(a) {
            if (Series.hl == null) {
                Series.hl = new Dictionary$2(String_$type, Dictionary$2.$.specialize(Type.$, DependencyProperty.$), 0);
            }
            if (Series.hl.containsKey(a) && Series.hl.item(a).containsKey(getInstanceType(this))) {
                return Series.hl.item(a).item(getInstanceType(this));
            }
            let b = DependencyProperty.h(a, getInstanceType(this));
            if (b == null) {
                return null;
            }
            if (!Series.hl.containsKey(a)) {
                Series.hl.addItem(a, new Dictionary$2(Type.$, DependencyProperty.$, 0));
            }
            Series.hl.item(a).addItem(getInstanceType(this), b);
            return b;
        }
        get_hasMarkers() {
            return false;
        }
        get hasMarkers() {
            return this.get_hasMarkers();
        }
        get_en() {
            return false;
        }
        get en() {
            return this.get_en();
        }
        ql() {
        }
        qm() {
            this.ql();
        }
        v7(a) {
            if (this.dc == null) {
                return this.vt;
            }
            let b = this.dc.xx(this.index + a);
            b = this.wd(b);
            return b;
        }
        wd(a) {
            if (this.actualLayers != null && this.actualLayers.count > 0) {
                let b = true;
                for (let c = 0; c < this.actualLayers.count; c++) {
                    let d = this.actualLayers._inner[c];
                    if (!d.target.fy) {
                        b = false;
                    }
                }
                if (!b) {
                    return a;
                }
                a = BrushUtil.s(a, this.ih);
                return a;
            }
            return a;
        }
        wa(a) {
            if (this.dc == null) {
                return this.vt;
            }
            let b = this.dc.x3(this.index + a);
            b = this.wd(b);
            return b;
        }
        v8(a) {
            if (this.dc == null) {
                return this.vt;
            }
            let b = this.dc.x1(this.index + a);
            b = this.wd(b);
            return b;
        }
        v9(a) {
            if (this.dc == null) {
                return this.vx;
            }
            let b = this.dc.x2(this.index + a);
            b = this.wd(b);
            return b;
        }
        v5() {
            return null;
        }
        v6() {
            return null;
        }
        th() {
            return null;
        }
        iu() {
            return NaN;
        }
        w2(a) {
            let b = this.cw.b9;
            let c = this.cw.ca;
            let d = this.cw.getEffectiveViewport();
            let e = { $type: Point_$type, x: ViewportUtils.b(a.x, c, b, d), y: ViewportUtils.g(a.y, c, b, d) };
            return e;
        }
        xc(a) {
            let b = this.w2({ $type: Point_$type, x: a.left, y: a.bottom });
            let c = this.w2({ $type: Point_$type, x: a.right, y: a.top });
            return new Rect(2, b, c);
        }
        wr(a) {
            let b = this.dc != null ? this.dc.yu : this.cw.b9;
            let c = this.cw.ca;
            let d = this.cw.getEffectiveViewport();
            let e = ViewportUtils.e(a.x, c, b, d);
            let f = ViewportUtils.i(a.y, c, b, d);
            return { $type: Point_$type, x: e, y: f };
        }
        k6(a, b) {
            let c = this.cw.c(a);
            let d = c != null ? c.item : null;
            if (d == null) {
                let e = this.w2(b);
                d = this.kw(e);
            }
            return d;
        }
        gj(a) {
            return false;
        }
        ay(a) {
            return new AxisRange(NaN, NaN);
        }
        az(a) {
            return new AxisRange(NaN, NaN);
        }
        xe() {
            return new Size(1, 0, 0);
        }
        ax(a, b, c) {
            this.qc();
            if (!this.isVertical) {
                if (this.im == 0 && this.iq == 0) {
                    return a;
                }
                let d = new ScalerParams(0, c, this.dc.y9, b.dn, this.getEffectiveViewport());
                d.b = this.i5();
                let e = b.f6(a.c, d);
                let f = b.f6(a.b, d);
                if (b.dn) {
                    f += this.im;
                    e -= this.iq;
                }
                else {
                    f -= this.iq;
                    e += this.im;
                }
                let g = b.f9(e, d);
                let h = b.f9(f, d);
                return new AxisRange(g, h);
            }
            else {
                if (this.io == 0 && this.ip == 0) {
                    return a;
                }
                let i = new ScalerParams(0, c, this.dc.y9, b.dn, this.getEffectiveViewport());
                i.b = this.i5();
                let j = b.f6(a.c, i);
                let k = b.f6(a.b, i);
                if (!b.dn) {
                    k += this.ip;
                    j -= this.io;
                }
                else {
                    k -= this.io;
                    j += this.ip;
                }
                let l = b.f9(j, i);
                let m = b.f9(k, i);
                return new AxisRange(l, m);
            }
        }
        qc() {
            if (isNaN_(this.iq)) {
                let a = this.xh(1, 1);
                this.iq = a.top;
                if (isNaN_(this.iq)) {
                    this.iq = 0;
                }
            }
            if (isNaN_(this.im)) {
                let b = this.xh(1, 1);
                this.im = b.bottom;
                if (isNaN_(this.im)) {
                    this.im = 0;
                }
            }
            if (isNaN_(this.io)) {
                let c = this.xh(1, 1);
                this.io = c.left;
                if (isNaN_(this.io)) {
                    this.io = 0;
                }
            }
            if (isNaN_(this.ip)) {
                let d = this.xh(1, 1);
                this.ip = d.right;
                if (isNaN_(this.ip)) {
                    this.ip = 0;
                }
            }
        }
        r8(a) {
            this.gx = false;
            if (this.dc != null) {
                this.dc.a3.ac(0, this, this.a1, a);
                if (this.renderRequested != null) {
                    let b = new RenderRequestedEventArgs();
                    b.animate = a;
                    this.renderRequested(this, b);
                    a = b.animate;
                }
            }
        }
        pv(a) {
            this.r9(a);
            if (this.hk(this.cw.b9, this.cw.ca, this.cw)) {
                this.p7();
            }
            this.gx = false;
        }
        get bv() {
            return this.bu;
        }
        set bv(a) {
            this.bu = a;
        }
        r9(a) {
            {
                this.rv();
            }
            if (this.g9 && !this.gt()) {
                this.g8 = false;
            }
            if (this.hc && !this.gu()) {
                this.hb = false;
                this.rg();
            }
        }
        get cf() {
            return this.ce;
        }
        get_eo() {
            return this.gh();
        }
        get eo() {
            return this.get_eo();
        }
        gh() {
            return this.highlightedItemsSource != null;
        }
        rv() {
            let a = false;
            if (this.bo != null) {
                a = true;
            }
            let b = this.bw;
            if (b == 0) {
                if (this.dc != null) {
                    if (this.dc.cb != 0) {
                        b = this.dc.cb;
                    }
                }
            }
            if (b == 0) {
                b = 1;
            }
            if (!this.eo || a) {
                b = 1;
            }
            if (this.bv != b) {
                if (this.bv == 1 && b != 1) {
                    this.bv = b;
                    this.px();
                }
                else {
                    this.bv = b;
                    this.pt();
                }
            }
        }
        pt() {
            if (!this.gz) {
                return;
            }
            if (this.b5 != null) {
                this.b5.au();
            }
        }
        static p1() {
            if (Series.hp == null) {
                Series.hp = new Dictionary$2(String_$type, String_$type, 0);
                Series.hq = new Dictionary$2(String_$type, String_$type, 0);
                Series.pm(Series.hp, Series.hq);
            }
        }
        static n7(a) {
            Series.p1();
            if (Series.hp.containsKey(a)) {
                return Series.hp.item(a);
            }
            return PlatformAPIHelper.r(a);
            return a;
        }
        static n8(a) {
            Series.p1();
            if (Series.hq.containsKey(a)) {
                return Series.hq.item(a);
            }
            return PlatformAPIHelper.s(a);
            return a;
        }
        q7() {
        }
        static pm(a, b) {
            Series.hp.item("ItemsSource", "dataSource");
            Series.hq.item("dataSource", "ItemsSource");
            Series.hp.item("HighlightedItemsSource", "highlightedDataSource");
            Series.hq.item("highlightedDataSource", "HighlightedItemsSource");
        }
        si(a, b) {
            let c = typeCast(Brush.$, b.value);
            if (c == null) {
                return;
            }
            b.value = BrushUtil.s(c, this.ih);
        }
        sg(a, b) {
            let c = typeCast(String_$type, b.value);
            if (c != null) {
                c += this.ms;
                b.value = c;
            }
        }
        sf(a, b) {
            if (this.highlightedItemsSource != null) {
                b.value = this.highlightedItemsSource;
                return;
            }
            b.value = this.itemsSource;
        }
        sh(a, b) {
            let c = this.km / 1000;
            if (c != 0) {
                b.value = this.km;
                return;
            }
            b.value = this.kn;
        }
        get_gz() {
            return true;
        }
        get gz() {
            return this.get_gz();
        }
        px() {
            if (!this.gz) {
                return;
            }
            if (this.b5 == null || !this.cb.contains(this.b5)) {
                let a = new SeriesLayer();
                let b = this.hy();
                for (let c of fromEnum(b)) {
                    a.m.add(c);
                }
                this.b5 = a;
                this.cb.add(a);
            }
            else {
                this.b5.at();
            }
        }
        hy() {
            let a = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "ItemsSource";
                $ret.y = "HighlightedItemsSource";
                $ret.q = true;
                return $ret;
            })());
            a.valueResolving = delegateCombine(a.valueResolving, runOn(this, this.sf));
            let b = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "ShouldAnimateOnDataSourceSwap";
                $ret.q = true;
                $ret.x = true;
                $ret.p = true;
                return $ret;
            })());
            let c = ((() => {
                let $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.sh));
            let d = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "Title";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.sg));
            let e = ((() => {
                let $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.qn));
            let f = new List$1(SeriesLayerPropertyOverlay.$, 0);
            let g = this.hz();
            {
                f.add(a);
            }
            f.add(d);
            f.add(b);
            f.add(c);
            f.add(e);
            f.o(g);
            if (this.cf.count > 0) {
                let h = new Dictionary$2(String_$type, SeriesLayerPropertyOverlay.$, 0);
                for (let i of fromEnum(f)) {
                    h.addItem(i.ad, i);
                }
                for (let j of fromEnum(this.cf)) {
                    if (h.containsKey(j.ad)) {
                        j.k = h.item(j.ad);
                        f.remove(h.item(j.ad));
                    }
                    f.add(j);
                }
            }
            return f;
        }
        qn(a, b) {
            if (this.xi == 1) {
                b.value = enumGetBox(Visibility_$type, 1);
                return;
            }
            b.value = enumGetBox(Visibility_$type, this.legendItemVisibility);
        }
        hz() {
            return new List$1(SeriesLayerPropertyOverlay.$, 0);
        }
        get fy() {
            return this.dw;
        }
        rd() {
            if (!this.dw) {
                this.pr();
            }
            this.dw = true;
            if (this.renderValid != null) {
                this.renderValid(this, new RenderValidEventArgs());
            }
        }
        pe() {
            if (this.g7 && !this.g9) {
                this.dd.r = truncate(Math.max(this.jh(), this.ji()));
                this.pj();
            }
            if (this.ha && !this.hc) {
                this.dd.r = truncate(Math.max(this.jh(), this.jj()));
                this.pj();
            }
        }
        q3() {
            if (!this.d4()) {
                if (this.dc != null) {
                    this.dc.rj(this);
                }
            }
        }
        rg() {
            if (this.gq) {
                if (this.bo != null) {
                    this.bo.r5(this);
                }
                else if (this.dc != null) {
                    this.dc.series.remove(this);
                }
            }
            if (this.bo != null) {
                if (this.bo.gp) {
                    if (this.bo.highlightedItemsSource != null) {
                        this.bo.highlightedItemsSource = null;
                    }
                }
            }
            if (this.transitionOutCompleted != null) {
                this.transitionOutCompleted(this, new TransitionOutCompletedEventArgs());
            }
        }
        r5(a) {
            if (a.b6 != null) {
                if (this.cc.contains(a.b6)) {
                    this.cc.remove(a.b6);
                }
                if (this.cb.contains(a.b6)) {
                    this.cb.remove(a.b6);
                }
            }
        }
        pj() {
        }
        sa(a, b) {
            if (this.cv == null) {
                this.cv = this.ct();
                this.cv.t = true;
                if (this.dc != null) {
                    this.dc.am.o(this.cv);
                    this.cv.a = this.dc.am;
                }
                this.cv.a4();
            }
            this.cv.b9 = a;
        }
        rp() {
        }
        sb() {
            if (this.cv == null) {
                this.cv = this.ct();
                this.cv.t = true;
                if (this.dc != null) {
                    this.dc.am.o(this.cv);
                    this.cv.a = this.dc.am;
                }
                this.cv.a4();
            }
        }
        r7(a, b, c, d, e) {
            this.ba.a$aa(this, a, b, d, e);
        }
        bd() {
            return null;
        }
        getEffectiveViewport1(a) {
            if (this.dc == null) {
                return Rect.empty;
            }
            if (a.s) {
                return this.dc.yv;
            }
            if (a.t) {
                if (this.dc.yv.isEmpty) {
                    return this.dc.yv;
                }
                let b = this.dc.y1(a.b9, this.dc.y9, this.dc.yv);
                return b;
            }
            return this.dc.yv;
        }
        getMainContentViewport() {
            return this.w4(this.cw);
        }
        w4(a) {
            if (this.dc == null || this.dc.yu.isEmpty) {
                return a.b9;
            }
            if (a.s) {
                return a.b9;
            }
            if (a.t) {
                if (this.dc.yv.isEmpty) {
                    return a.b9;
                }
                if (this.dc.yu.equals1(this.dc.y9)) {
                    return a.b9;
                }
                let b = this.dc.y1(a.b9, this.dc.y9, this.dc.yv);
                let c = this.dc.yz(a.b9, b, this.dc.yr);
                return c;
            }
            return this.dc.yu;
        }
        w7(a) {
            if (!this.xd.equals1(a)) {
                return Rect.empty;
            }
            return this.getEffectiveViewport();
        }
        w6(a) {
            if (this.dc == null || this.dc.yv.isEmpty) {
                return Rect.empty;
            }
            let b = this.dc.yv;
            let c = a.b9;
            let d = (b.left - c.left) / c.width;
            let e = (b.top - c.top) / c.height;
            let f = (b.right - c.left) / c.width;
            let g = (b.bottom - c.top) / c.height;
            return new Rect(0, d, e, f - d, g - e);
        }
        getEffectiveViewport() {
            return this.getEffectiveViewport1(this.cw);
        }
        r1() {
            this.r2(null);
        }
        get_ef() {
            return false;
        }
        get ef() {
            return this.get_ef();
        }
        get_el() {
            return this.by == 2 || this.by == 4;
        }
        get el() {
            return this.get_el();
        }
        r2(a) {
            if (this.fl) {
                this.ba.a$al(this, a);
            }
        }
        r3(a) {
            if (this.fl) {
                this.ba.a$am(this, a, this.dc);
            }
        }
        getViewInfo(a, b) {
            a = this.cw.b9;
            b = this.cw.ca;
            return {
                p0: a,
                p1: b
            };
        }
        hk(a, b, c) {
            if (a.width == 0 || a.height == 0) {
                return false;
            }
            if (this.isFragment) {
                return true;
            }
            return this._visibility == 0;
        }
        pi(a, b) {
            if (a) {
                this.g6 = true;
            }
        }
        d6() {
            return this.d7(this.cw);
        }
        d7(a) {
            let b = a.b9;
            let c = a.ca;
            if (!this.hk(b, c, a)) {
                this.pi(true, a);
                return true;
            }
            return false;
        }
        ri(a, b) {
            this.cw.b9 = b;
            this.s8(a, b);
            if (this.dc != null) {
                this.dc.a3.ae(0, this, this.a1, b);
                if (a.isEmpty || a.width == 0 || a.height == 0) {
                    this.dc.p0();
                }
            }
        }
        s9(a, b) {
        }
        s8(a, b) {
        }
        get g6() {
            return this.dz;
        }
        set g6(a) {
            this.dz = a;
        }
        qe(a) {
            a.pw(null);
        }
        q1() {
            this.gy = false;
            this.g6 = true;
            if (this.dc != null) {
                this.dc.p7();
            }
        }
        rw(a) {
            this.h1.h(a);
            this.sz();
            this.h1.e();
        }
        qv() {
            this.sz();
            this.rj();
        }
        q0() {
            this.gy = false;
            this.g6 = true;
            if (this.dc != null) {
                this.dc.p6();
            }
        }
        get_fj() {
            return true;
        }
        get fj() {
            return this.get_fj();
        }
        get_isUsableInLegend() {
            return true;
        }
        get isUsableInLegend() {
            return this.get_isUsableInLegend();
        }
        q9() {
            this.cw.a0();
        }
        q2() {
            this.rj();
        }
        rj() {
            this.cw.bb();
            this.rl(false);
            this.s0();
            if (this.isStacked) {
                this.qh((a) => {
                    a.rj();
                    if (a.ei) {
                        a.qf((b) => {
                            b.rk();
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (this.ei) {
                this.qf((a) => {
                    a.rk();
                    return true;
                });
            }
        }
        rk() {
            this.cw.bb();
            this.rl(true);
            if (this.isStacked) {
                this.qh((a) => {
                    a.rk();
                    if (a.ei) {
                        a.qf((b) => {
                            b.rk();
                            return true;
                        });
                    }
                    return true;
                });
            }
            if (this.ei) {
                this.qf((a) => {
                    a.rk();
                    return true;
                });
            }
        }
        gg() {
            return false;
        }
        rl(a) {
            if (this.a1 == null || this.a1.c) {
                return;
            }
            let b = this.cw.b9;
            let c = this.cw.ca;
            let d = this.hk(b, c, this.cw);
            let e = this.dc != null && this.dc.gb && this.cv != null && this.hk(this.cv.b9, this.cv.ca, this.cv);
            if (d) {
                if (a) {
                    this.gx = !this.gg();
                    this.pv(false);
                }
                else {
                    this.r8(false);
                    this.gx = !this.gg();
                }
            }
            if (e) {
                if (!this.g6) {
                    this.q0();
                    this.gy = true;
                }
            }
        }
        get g8() {
            return this.d0;
        }
        set g8(a) {
            this.d0 = a;
        }
        get hb() {
            return this.d1;
        }
        set hb(a) {
            this.d1 = a;
        }
        get g9() {
            if (this.g8 == false) {
                return false;
            }
            return this.ji() > 0;
        }
        get hc() {
            if (this.hb == false) {
                return false;
            }
            return this.jj() > 0;
        }
        v() {
            super.v();
            this.raisePropertyChanged("Opacity", this._opacity, this._opacity);
        }
        w(a, b) {
            super.w(a, b);
            this.raisePropertyChanged("Visibility", enumGetBox(Visibility_$type, a), enumGetBox(Visibility_$type, b));
        }
        q8() {
        }
        qu() {
            if (this.dc != null) {
                this.dc.p0();
            }
        }
        qa() {
            if (this.dc != null) {
                for (let a = 0; a < this.dc.selectedSeriesItems.count; a++) {
                    let b = this.dc.selectedSeriesItems._inner[a];
                    b.f(this.dc);
                }
                for (let c = 0; c < this.dc.selectedSeriesItems.count; c++) {
                    let d = this.dc.selectedSeriesItems._inner[c];
                    if (d.series != null && d.series != this) {
                        continue;
                    }
                    if (d.item == null) {
                        this.qb();
                    }
                    else {
                        this.p6(d.item);
                    }
                }
            }
        }
        p2() {
            if (this.dc != null) {
                for (let a = 0; a < this.dc.focusedSeriesItems.count; a++) {
                    let b = this.dc.focusedSeriesItems._inner[a];
                    if (b.series != null && b.series != this) {
                        continue;
                    }
                    this.p5(b.item);
                }
            }
        }
        rq(a, b, c, d) {
            switch (b) {
                case "SyncLink":
                    if (typeCast(SyncLink.$, c) !== null) {
                        let e = c;
                        e.propertyUpdated = delegateRemove(e.propertyUpdated, this.bi);
                        this.r0(typeCast(IFastItemsSourceProvider_$type, c));
                    }
                    if (typeCast(SyncLink.$, d) !== null) {
                        let f = d;
                        f.propertyUpdated = delegateCombine(f.propertyUpdated, this.bi);
                        this.rz(typeCast(IFastItemsSourceProvider_$type, d));
                    }
                    if (this.index == -1) {
                        this.index = XamDataChart.abr(this);
                    }
                    break;
                case Series.$$p[41]:
                    this.ci = this.ck();
                    this.sy();
                    this.pw(null);
                    this.rj();
                    break;
                case Series.$$p[68]:
                    this.d3 = this.hf;
                    this.pr();
                    this.rj();
                    break;
                case SeriesViewer.$$p[1]:
                case SeriesViewer.$$p[22]:
                case SeriesViewer.$$p[21]:
                case SeriesViewer.$$p[23]:
                    this.pw(null);
                    break;
                case "HighlightingMode":
                    this.by = this.bz();
                    break;
                case "SelectionMode":
                    this.cq = this.cs();
                    break;
                case "FocusMode":
                    this.cp = this.cr();
                    break;
                case "SeriesViewer":
                    if (typeCast(SeriesViewer.$, c) !== null) {
                        this.j8 = null;
                        let g = c;
                        g.windowRectChanged = delegateRemove(g.windowRectChanged, this.dq);
                        let h = c.b9;
                        h.collectionChanged = delegateRemove(h.collectionChanged, this.h4);
                        let i = c;
                        i.propertyUpdated = delegateRemove(i.propertyUpdated, this.bi);
                        c.a3.ad(0, this);
                        this.r2(c);
                        this.cw.at(c);
                    }
                    if (typeCast(SeriesViewer.$, d) !== null) {
                        this.j8 = d.dw.j.ae;
                        let j = d;
                        j.windowRectChanged = delegateCombine(j.windowRectChanged, this.dq);
                        let k = d.b9;
                        k.collectionChanged = delegateCombine(k.collectionChanged, this.h4);
                        let l = d;
                        l.propertyUpdated = delegateCombine(l.propertyUpdated, this.bi);
                        this.a1 = d.a3.k(0, this, runOn(this, this.pv));
                        this.cw.ao(d);
                        this.by = this.bz();
                        this.ii = this.i8();
                        this.cq = this.cs();
                        this.cp = this.cr();
                        this.vy = this.wc();
                        this.vu = this.wb();
                        this.sv();
                        this.pr();
                        if (this.f3) {
                            this.ik = this.js();
                        }
                        this.py();
                        this.kp = this.dc.j8();
                        this.qa();
                        this.p2();
                    }
                    if (this.dc == null) {
                        this.externalObject._ensureTooltipDestroyed();
                        this.dd.w();
                        if (c != null) {
                            let m = c;
                            m.rj(this);
                        }
                    }
                    if (this.index != -1) {
                        this.rw(null);
                    }
                    if (this.index == -1 || d == null) {
                        this.index = XamDataChart.abr(this);
                    }
                    this.a5 = this.a6();
                    this.pa(typeCast(SeriesViewer.$, c), typeCast(SeriesViewer.$, d));
                    break;
                case Series.$$p[57]:
                    if (this.cw != null) {
                        this.cw.ba();
                    }
                    break;
                case "HitTestMode":
                    this.b2 = this.b3();
                    break;
                case "ActualHitTestMode":
                    if (this.dc != null) {
                        this.dc.s3();
                    }
                    break;
                case Series.$$p[26]:
                    this.r8(true);
                    break;
                case Series.$$p[19]:
                case Series.$$p[25]:
                    this.qu();
                    break;
                case "LegendItemBadgeTemplate":
                case "LegendItemTemplate":
                case Series.$$p[34]:
                case Series.$$p[33]:
                    this.rw(b);
                    this.rj();
                    this.qu();
                    break;
                case Series.$$p[38]:
                    this.sx();
                    break;
                case Series.$$p[27]:
                    this.sw();
                    break;
                case Series.$$p[12]:
                case Series.$$p[13]:
                    if (this.l4 != null) {
                        this.as = new BindingFormatter();
                        this.as.j = this.l4;
                        this.as.d = this.ag;
                    }
                    else {
                        this.as = null;
                    }
                    break;
                case Series.$$p[14]:
                case Series.$$p[15]:
                    if (this.l4 != null) {
                        this.at = new BindingFormatter();
                        this.at.j = this.l7;
                        this.at.d = this.ah;
                    }
                    else {
                        this.at = null;
                    }
                    break;
                case Series.$$p[6]:
                case Series.$$p[16]:
                case Series.$$p[42]:
                case Series.$$p[17]:
                case Series.$$p[18]:
                    this.pw(b);
                    this.rj();
                    break;
                case "Index":
                    if (typeGetValue(c) != typeGetValue(d)) {
                        this.q8();
                        this.ci = this.ck();
                        this.sy();
                        this.sx();
                        this.pw(null);
                        this.rj();
                    }
                    break;
                case "RadiusX":
                case "RadiusY":
                case "RoundedCornersLocation":
                    this.rj();
                    break;
                case Series.$$p[10]:
                    this.sv();
                    this.rj();
                    break;
                case Series.$$p[37]:
                case Series.$$p[36]:
                case Series.$$p[39]:
                    this.rj();
                    break;
                case Series.$$p[31]:
                    this.q9();
                    this.rj();
                    break;
                case Series.$$p[69]:
                case Series.$$p[48]:
                case Series.$$p[47]:
                case Series.$$p[49]:
                case Series.$$p[50]:
                    this.rj();
                    break;
                case Series.$$p[56]:
                    this.sy();
                    if (this.be == 1) {
                        this.s0();
                    }
                    break;
                case Series.$$p[3]:
                case Series.$$p[4]:
                    this.pr();
                    this.rj();
                    break;
                case Series.$$p[21]:
                    this.vu = this.wb();
                    break;
                case Series.$$p[45]:
                    this.vy = this.wc();
                    break;
                case Series.$$p[8]:
                    this.v3 = this.vy;
                    this.rj();
                    break;
                case Series.$$p[2]:
                    this.v1 = this.vu;
                    this.rj();
                    break;
                case Series.$$p[1]:
                case Series.$$p[7]:
                case Series.$$p[9]:
                    this.safeActualBrush = this.we(this.vt);
                    this.v0 = this.vt;
                    this.v2 = this.vx;
                    this.is = this.il;
                    this.vw = this.vx;
                    this.vv = this.vt;
                    this.rj();
                    this.cw.bx();
                    if (this.toolTip != null && this.a9 != null) {
                        this.ba.a$at(this, this.toolTip);
                    }
                    break;
                case "Visibility":
                    this.cw.by();
                    break;
                case Series.$$p[22]:
                    this.r8(true);
                    break;
                case "ItemsSource":
                    if (this.c4 != null) {
                        this.rz(this.c4);
                    }
                    break;
                case Series.$$p[20]:
                    this.pr();
                    if (c != d && d != null) {
                        if (!this.gm || !this.d9) {
                            this.g8 = true;
                        }
                        this.hb = false;
                        this.gq = false;
                    }
                    this.q1();
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        let n = c;
                        n.event = delegateRemove(n.event, this.j4);
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        let o = d;
                        o.event = delegateCombine(o.event, this.j4);
                    }
                    this.qa();
                    this.p2();
                    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.pr();
                        this.eh = true;
                    }
                    else {
                        this.eh = false;
                    }
                    if (c != null && c.isItemwise) {
                        c.clearLegendItemsForSeries(this);
                    }
                    this.ep = this.a5 == null ? false : this.a5.isFinancial;
                    this.o9(typeCast(IChartLegend_$type, c), typeCast(IChartLegend_$type, d));
                    this.p7();
                    break;
                case "LegendItem":
                    this.pb(typeCast(Control.$, c), typeCast(Control.$, d));
                    break;
                case Series.$$p[35]:
                    this.pr();
                    this.cw.a5();
                    this.qu();
                    break;
                case Series.$$p[58]:
                    if (this.a9 != null || this.fl) {
                        this.ba.a$at(this, this.toolTip);
                    }
                    break;
                case "CrosshairPoint":
                    if (this.dc != null) {
                        this.s6(this.dc.yi);
                    }
                    if (this.dc != null) {
                        if (!this.d8) {
                            this.dc.sv(this, this.kw(this.dc.yi));
                        }
                    }
                    break;
                case Series.$$p[43]:
                    this.ik = this.js();
                    break;
                case "ActualResolution":
                    this.r8(false);
                    this.q0();
                    break;
                case Series.$$p[73]:
                    this.iq = this.j3;
                    if (this.dc != null) {
                        this.dc.pt();
                    }
                    break;
                case Series.$$p[70]:
                    this.im = this.j0;
                    if (this.dc != null) {
                        this.dc.pt();
                    }
                    break;
                case Series.$$p[59]:
                case Series.$$p[60]:
                    let p = this.dd.f();
                    this.dd.w();
                    if (p) {
                        this.q3();
                    }
                    this.dd.r = this.km;
                    this.dd.b = this.de;
                    this.r8(false);
                    break;
                case "DiscreteLegendItemTemplate":
                    this.r8(false);
                    break;
                case "VisibilityProxy":
                    if (c != d) {
                        this.r8(false);
                    }
                    this.q0();
                    this.cw.by();
                    break;
                case Series.$$p[32]:
                    this.by = this.bz();
                    this.r8(false);
                    break;
                case Series.$$p[28]:
                    this.ii = this.i8();
                    break;
                case Series.$$p[55]:
                    this.py();
                    break;
                case "FinalValue":
                    this.s5();
                    break;
                case Series.$$p[74]:
                    this.cy = this.cz();
                    break;
            }
        }
        wb() {
            if (this.v4 != null) {
                return this.v4;
            }
            else {
                if (this.dc != null && this.dc.xu != null) {
                    return this.dc.xu;
                }
                else {
                    return BrushUtil.j(255, 255, 0, 0);
                }
            }
        }
        wc() {
            if (this.wj != null) {
                return this.wj;
            }
            else {
                if (this.dc != null && this.dc.yb != null) {
                    return this.dc.yb;
                }
                else {
                    return BrushUtil.j(255, 255, 0, 0);
                }
            }
        }
        we(a) {
            if (this.gr) {
                return this.cw.b2(a);
            }
            return a;
        }
        sy() {
            let a = this.ci;
            let b = this.jy;
            if (isNaN_(b)) {
                b = DeviceUtils.g(2);
            }
            if (a == 2) {
                b = 1;
            }
            if (this.il != b) {
                this.il = b;
            }
            this.is = this.il;
        }
        s6(a) {
            if (this.dc != null && this.dc.f3 && this.by != 1 && this.dc.fy) {
                if (isNaN_(a.x) || isNaN_(a.y)) {
                    this.ba.a$ac(this, null, a, false, false, false, false, this.dc.b5 == this, true);
                }
                else {
                    this.ba.a$ac(this, this.kw(a), a, false, false, false, false, this.dc.b5 == this, false);
                }
            }
        }
        p6(a) {
            if (this.dp == null) {
                return;
            }
            let b = this.dp.indexOf(a);
            if (b < 0) {
                return;
            }
            if (this.fl) {
                this.ba.a$y(this, a, b);
            }
        }
        qb() {
            if (this.dp == null) {
                return;
            }
            if (this.fl) {
                this.ba.a$w(this);
            }
        }
        p9() {
            if (this.dp == null) {
                return;
            }
            if (this.fl) {
                this.ba.a$ap(this);
            }
        }
        p5(a) {
            if (this.dp == null) {
                return;
            }
            let b = this.dp.indexOf(a);
            if (b < 0) {
                return;
            }
            if (this.fl) {
                this.ba.a$x(this, a, b);
            }
        }
        p4(a) {
            if (this.dp == null) {
                return;
            }
            let b = this.dp.indexOf(a);
            if (b < 0) {
                return;
            }
            if (this.fl) {
                this.ba.a$ao(this, a, b);
            }
        }
        eg(a) {
            if (this.dp != null && this.dp.indexOf(a) >= 0) {
                return true;
            }
            return false;
        }
        p3(a) {
            if (this.dp == null) {
                return;
            }
            let b = this.dp.indexOf(a);
            if (b < 0) {
                return;
            }
            if (this.fl) {
                this.ba.a$an(this, a, b);
            }
        }
        py() {
            let vwr_ = this.dc;
            if (vwr_ != null) {
                if (vwr_.fz) {
                    let host_ = vwr_.kh;
                    if (host_ != null) {
                        Series.pz(this, this.dc, false);
                        this.externalObject.owner = (this.externalObject.owner) ? this.externalObject.owner : ((host_) ? host_.externalObject : null);
                    }
                }
                else {
                    Series.pz(this, this.dc, false);
                    this.externalObject.owner = (this.externalObject.owner) ? this.externalObject.owner : ((vwr_) ? vwr_.externalObject : null);
                }
            }
            if (this.dc != null && (this.externalObject.owner)) {
                let sv_ = this.dc;
                this.externalObject.owner._ensureDefaultTooltip(this.externalObject);
                ;
            }
        }
        get_fh() {
            return false;
        }
        get fh() {
            return this.get_fh();
        }
        ps(a) {
            a.d8 = true;
        }
        get c4() {
            return this.c3;
        }
        set c4(a) {
            if (this.c4 != a) {
                let b = this.c4;
                this.c3 = a;
                this.raisePropertyChanged("SyncLink", b, this.c4);
            }
        }
        get dc() {
            return this.db;
        }
        set dc(a) {
            if (this.dc != a) {
                let b = this.dc;
                this.db = a;
                this.raisePropertyChanged("SeriesViewer", b, this.db);
            }
        }
        get da() {
            return typeCast(XamDataChart.$, this.dc);
        }
        set da(a) {
            this.dc = a;
        }
        get itemsSource() {
            return this.c(Series.ui);
        }
        set itemsSource(a) {
            this.h(Series.ui, a);
        }
        po(a, b, c, d) {
            this.pr();
            if (this.dc != null) {
                this.dc.sw();
            }
        }
        get legend() {
            return this.c(Series.uo);
        }
        set legend(a) {
            this.h(Series.uo, a);
        }
        get tc() {
            if (this.ta == null && this.a5 != null) {
                this.ta = this.tb();
            }
            return this.ta;
        }
        set tc(a) {
            if (this.tc != a) {
                let b = this.tc;
                this.ta = a;
                this.raisePropertyChanged("LegendItem", b, this.ta);
            }
        }
        k8() {
            return this.tb();
        }
        tb() {
            let a = typeCast(ContentControl.$, this.ta);
            let b = this.legendItemTemplate;
            if (b == null) {
                b = this.cw.bz(this.c2);
            }
            if (b != null) {
                if (a == null) {
                    a = new ContentControl();
                }
                a.content = ((() => {
                    let $ret = new DataContext();
                    $ret.series = this;
                    $ret.item = null;
                    return $ret;
                })());
                a.ah = b;
            }
            else {
                a = null;
            }
            return a;
        }
        get a5() {
            return this.a4;
        }
        set a5(a) {
            if (this.a5 != a) {
                let b = this.a4;
                this.a4 = a;
                this.raisePropertyChanged("ActualLegend", b, this.a4);
            }
        }
        get legendItemBadgeTemplate() {
            return this.c(Series.ul);
        }
        set legendItemBadgeTemplate(a) {
            this.h(Series.ul, a);
        }
        tg() {
            return this.legendItemBadgeTemplate;
        }
        get legendItemTemplate() {
            return this.c(Series.um);
        }
        set legendItemTemplate(a) {
            this.h(Series.um, a);
        }
        get tf() {
            return this.c(Series.t2);
        }
        set tf(a) {
            this.h(Series.t2, a);
        }
        get index() {
            return typeGetValue(this.c(Series.ud));
        }
        set index(a) {
            this.h(Series.ud, a);
        }
        s7() {
            this.rw(null);
        }
        pw(a) {
            this.rw(a);
        }
        fk(a, b, c, d) {
            if (!BrushUtil.d(c, d)) {
                return true;
            }
            return false;
        }
        sz() {
            this.q0();
            if (this.index < 0) {
                return;
            }
            if (this.vz != null) {
                this.sq("ActualBrush");
                let a = this.vt;
                this.cw.bk();
                this.cw.aq();
                let b = this.vt;
                let c = this.fk("ActualBrush", this.h1.f > 0 ? this.h1.d() : null, a, b);
                this.ss("ActualBrush", c);
            }
            else {
                this.vt = this.dc == null ? null : this.dc.xx(this.index);
            }
            if (this.ci == 2) {
                this.sq("ActualOutline");
                let d = this.vx;
                this.cw.bl();
                this.vx = this.vt;
                let e = this.vx;
                let f = this.fk("ActualOutline", this.h1.f > 0 ? this.h1.d() : null, d, e);
                this.ss("ActualOutline", f);
            }
            else {
                if (this.wf != null) {
                    this.sq("ActualOutline");
                    let g = this.vx;
                    this.cw.bl();
                    this.cw.ar();
                    let h = this.vx;
                    let i = this.fk("ActualOutline", this.h1.f > 0 ? this.h1.d() : null, g, h);
                    this.ss("ActualOutline", i);
                }
                else {
                    this.vx = this.dc == null ? null : this.dc.x3(this.index);
                }
            }
            if ((this.fz || this.ff) && this.fu) {
                this.vt = this.vx;
            }
            else if ((this.fz || this.ff) && this.ex) {
                this.vx = this.vt;
            }
            else if ((this.fz || this.ff) && this.fm) {
                this.vx = this.vt;
            }
            else if (this.f6 && this.legendItemBadgeShape == 2) {
                this.vt = this.vx;
            }
        }
        d4() {
            return this.dd.f();
        }
        sp() {
            this.dd.v();
        }
        get ik() {
            if (!this.dy) {
                this.dy = true;
                this.h8 = this.js();
            }
            return this.h8;
        }
        set ik(a) {
            let b = this.h8;
            this.h8 = a;
            if (b != this.h8) {
                this.raisePropertyChanged("ActualResolution", b, this.h8);
            }
        }
        js() {
            if (!isNaN_(this.jr)) {
                return this.jr;
            }
            return DeviceUtils.g(1);
        }
        get iq() {
            return this.ic;
        }
        set iq(a) {
            this.ic = a;
        }
        get im() {
            return this.h9;
        }
        set im(a) {
            this.h9 = a;
        }
        se() {
            this.iq = NaN;
            this.io = NaN;
            this.ip = NaN;
            this.im = NaN;
        }
        get io() {
            return this.ia;
        }
        set io(a) {
            this.ia = a;
        }
        get ip() {
            return this.ib;
        }
        set ip(a) {
            this.ib = a;
        }
        iv() {
            if (isNaN_(this.ju)) {
                return NaN;
            }
            if (this.ju < 0) {
                return 0;
            }
            return DeviceUtils.g(this.ju);
        }
        get by() {
            return this.bx;
        }
        set by(a) {
            let b = this.bx;
            this.bx = a;
            if (b != this.bx) {
                this.raisePropertyChanged("ActualHighlightingMode", enumGetBox(SeriesHighlightingMode_$type, b), enumGetBox(SeriesHighlightingMode_$type, this.bx));
            }
        }
        get cq() {
            return this.co;
        }
        set cq(a) {
            let b = this.co;
            this.co = a;
            if (b != this.co) {
                this.raisePropertyChanged("ActualSelectionMode", enumGetBox(SeriesSelectionMode_$type, b), enumGetBox(SeriesSelectionMode_$type, this.co));
            }
        }
        get cp() {
            return this.cn;
        }
        set cp(a) {
            let b = this.cn;
            this.cn = a;
            if (b != this.cn) {
                this.raisePropertyChanged("ActualFocusMode", enumGetBox(SeriesSelectionMode_$type, b), enumGetBox(SeriesSelectionMode_$type, this.cn));
            }
        }
        get_gk() {
            return !this.ef;
        }
        get gk() {
            return this.get_gk();
        }
        p8() {
        }
        bz() {
            if (!this.fh) {
                return 1;
            }
            if (this.dc != null) {
                if (this.dc.cg != 1 && this.dc.cg != 0 && !this.e3) {
                    return this.dc.cg;
                }
            }
            if (this.fg) {
                return 2;
            }
            return 1;
        }
        i8() {
            if (!isNaN_(this.jn)) {
                return this.jn;
            }
            if (this.dc != null && !isNaN_(this.dc.iy)) {
                return this.dc.iy;
            }
            return 0.2;
        }
        cs() {
            if (!this.fh) {
                return 1;
            }
            if (this.dc != null) {
                if (this.dc.ct != 1 && this.dc.ct != 0) {
                    return this.dc.ct;
                }
            }
            return 1;
        }
        cr() {
            if (!this.fh) {
                return 1;
            }
            if (this.dc != null) {
                if (this.dc.ct != 1 && this.dc.ct != 0) {
                    return this.dc.cr;
                }
            }
            return 1;
        }
        f2(a) {
            switch (a) {
                case 2:
                case 4: return true;
            }
            return false;
        }
        get ih() {
            return this.h6;
        }
        set ih(a) {
            let b = this.h6;
            this.h6 = a;
            if (b != this.h6) {
                this.raisePropertyChanged("ActualHighlightedValuesFadeOpacity", b, this.h6);
            }
        }
        get ii() {
            return this.h7;
        }
        set ii(a) {
            let b = this.h7;
            this.h7 = a;
            if (b != this.h7) {
                this.raisePropertyChanged("ActualHighlightingFadeOpacity", b, this.h7);
            }
        }
        pr() {
            this.dx = true;
        }
        p7() {
            if (this.dx) {
                this.dx = false;
                if (this.d3) {
                    if (this.eh) {
                        this.rx();
                    }
                }
            }
        }
        rx() {
            if (this.dc == null) {
                return;
            }
            if (this.a5 == null) {
                return;
            }
            if (this.a5.isItemwise) {
                let a = this.a5;
                this.a5.clearLegendItemsForSeries(this);
                if (this.legendItemVisibility == 0) {
                    this.pn();
                    a.renderItemwiseContent(this);
                }
                this.a5.flushTextContentChangedCheck();
            }
        }
        g0(a) {
            return false;
        }
        pn() {
            if (this.dp == null) {
                return;
            }
            let a = typeCast(IChartItemLegend_$type, this.a5);
            if (a == null || this.dp == null) {
                return;
            }
            this.h0 = new List$1(UIElement.$, 0);
            let b = this.dp;
            let c = new List$1(SeriesPointOfInterest.$, 0);
            this.ed(c, false, false, 0, true);
            for (let d = 0; d < c.count; d++) {
                let e = c._inner[d];
                let f = this.v8(e.c);
                let g = this.v7(e.c);
                let h = this.v9(e.c);
                let i = this.wa(e.c);
                let j = new ContentControl();
                let k = this.k1(e.c, true);
                let l = this.k3(e.c);
                let m = null;
                if (typeCast(Date_$type, k) !== null) {
                    let n = k;
                    m = (n.toString());
                }
                else {
                    if (k != null) {
                        m = k.toString();
                    }
                }
                let o = null;
                if (typeCast(Date_$type, l) !== null) {
                    let p = l;
                    o = (p.toString());
                }
                else {
                    if (l != null) {
                        o = l.toString();
                    }
                    else {
                        o = m;
                    }
                }
                if (this.ek) {
                    g = f;
                    i = h;
                }
                let q = this.k2(e.c);
                j.content = ((() => {
                    let $ret = new DataContext();
                    $ret.series = this;
                    $ret.item = q;
                    $ret.itemBrush = g;
                    $ret.outline = i;
                    $ret.itemLabel = m;
                    $ret.legendLabel = o;
                    return $ret;
                })());
                let r = this.tf;
                if (r == null) {
                    r = this.cw.bz(this.c1);
                }
                j.ah = r;
                this.h0.add(j);
            }
        }
        k2(a) {
            return this.dp.item(a);
        }
        k1(a, b) {
            if (this.e1 || this.fa || this.fw) {
                let c = this.a0();
                if (c != null) {
                    if (!c.dx()) {
                        return null;
                    }
                    if (c.dv) {
                        let d = a;
                        if (d < 0) {
                            return null;
                        }
                        let e = c;
                        let f = e.i$d(d);
                        let g = this.h5(f);
                        return g;
                    }
                    else {
                        if (c.dr) {
                            let h = a;
                            if (h < 0) {
                                h = 0;
                            }
                            let i = c;
                            let j = i.getDateTime(h);
                            return j;
                        }
                        else {
                            let k = a;
                            if (k < 0) {
                                return null;
                            }
                            let l = c.pm;
                            if (l == null || l.count == 0) {
                                return null;
                            }
                            let m = false;
                            if (c.dc && c.ds) {
                                m = true;
                            }
                            if (!m) {
                                if (k >= l.count) {
                                    k = l.count - 1;
                                }
                            }
                            let n = c.i8(k);
                            return n;
                        }
                    }
                }
            }
            return null;
        }
        k3(a) {
            return null;
        }
        get_isColoredItemwise() {
            return this.d3;
        }
        get isColoredItemwise() {
            return this.get_isColoredItemwise();
        }
        get_e9() {
            return true;
        }
        get e9() {
            return this.get_e9();
        }
        sv() {
            let a = (typeCast(XamDataChart.$, this.dc));
            if (a != null) {
                this.ig = isNaN_(this.ir) ? a.z3.fs : this.ir;
            }
        }
        sx() {
            this.ij = isNaN_(this.jo) ? this.jt() : this.jo;
        }
        sw() {
            this.ih = isNaN_(this.jm) ? 0.2 : this.jm;
        }
        jt() {
            return 1;
        }
        get e7() {
            return this.dv;
        }
        set e7(a) {
            this.dv = a;
        }
        get cy() {
            return this.cx;
        }
        set cy(a) {
            this.cx = a;
        }
        cz() {
            if (this.c0 == 0) {
                return 1;
            }
            return this.c0;
        }
        get ci() {
            return this.ch;
        }
        set ci(a) {
            this.ch = a;
        }
        ck() {
            if (this.cj == 0) {
                return 1;
            }
            return this.cj;
        }
        a3(a) {
            return ((() => {
                let $ret = new DataContext();
                $ret.series = this;
                $ret.item = a;
                return $ret;
            })());
        }
        c5() {
            return 1;
        }
        c8() {
            return 1;
        }
        r6() {
            this.cw.bg();
        }
        sd() {
            this.eb = true;
            this.hb = false;
            this.g8 = true;
            this.gq = false;
            this.r8(true);
        }
        rn() {
            this.g8 = false;
            this.hb = true;
            this.gq = false;
            this.r8(true);
        }
        rm() {
            this.hb = false;
            this.g8 = true;
            this.gq = false;
            this.r8(true);
        }
        ro() {
            this.gq = true;
            if (!this.gu() || this.jj() == 0 || !this.hk(this.cw.b9, this.cw.ca, this.cw)) {
                this.rg();
            }
            this.g8 = false;
            this.hb = true;
            this.r8(true);
        }
        r4() {
            this.pf();
        }
        pf() {
        }
        qp() {
        }
        static *_hw(a, b, c) {
            for (let d = b; d < c; d++) {
                yield a(d);
            }
        }
        static hw(a, b, c) {
            return toEnum(() => Series._hw(a, b, c));
        }
        static hv(a, b) {
            return Series.hw(a, 0, b);
        }
        bs() {
            return this.br;
        }
        sk(a) {
            this.s1(a);
        }
        jh() {
            return this.km;
        }
        ji() {
            return this.kn;
        }
        jj() {
            return this.ko;
        }
        get_hd() {
            return this.d2;
        }
        set_hd(a) {
            this.d2 = a;
        }
        get hd() {
            return this.get_hd();
        }
        set hd(a) {
            this.set_hd(a);
        }
        get gn() {
            return this.hd;
        }
        pg() {
            this.ba.a$z();
        }
        dh(a, b, c) {
            return null;
        }
        di(a, b, c) {
            return null;
        }
        ra(a, b, c, d) {
            this.ba.a$af(this, a, b, c, d);
        }
        so(a) {
            this.ba.a$as(this, a);
        }
        pa(a, b) {
            if (this.a5 != null && this.tc != null) {
                if (b == null && this.a5.containsChild(this.tc)) {
                    this.a5.removeChild(this.tc);
                }
                if (b != null && !this.a5.containsChild(this.tc) && this.legendItemVisibility != 1) {
                    this.a5.addChildInOrder(this.tc, this);
                }
                this.a5.flushTextContentChangedCheck();
            }
        }
        ph() {
            if (this.a5 == null || this.tc == null) {
                return;
            }
            this.a5.removeChild(this.tc);
            this.a5.flushTextContentChangedCheck();
        }
        o9(a, b) {
            if (this.tc != null) {
                if (a != null && a.containsChild(this.tc)) {
                    a.removeChild(this.tc);
                }
                if (this.dc != null && b != null && !b.containsChild(this.tc) && this.legendItemVisibility != 1) {
                    b.addChildInOrder(this.tc, this);
                }
            }
            if (a != null) {
                a.flushTextContentChangedCheck();
            }
            if (b != null) {
                b.flushTextContentChangedCheck();
            }
        }
        pb(a, b) {
            if (this.a5 != null) {
                if (a != null && this.a5.containsChild(a)) {
                    this.a5.removeChild(a);
                }
                if (this.dc != null && b != null && this.legendItemVisibility != 1) {
                    this.a5.addChildInOrder(b, this);
                }
                this.a5.flushTextContentChangedCheck();
            }
        }
        r0(a) {
            this.dp = a.releaseFastItemsSource(this.itemsSource);
        }
        rz(a) {
            this.dp = a.getFastItemsSource(this.itemsSource);
        }
        a6() {
            if (this.legend != null) {
                return this.legend;
            }
            if (this.dc != null && this.dc.legend != null) {
                return this.dc.legend;
            }
            return null;
        }
        gt() {
            return false;
        }
        gu() {
            return false;
        }
        gl(a) {
            return (a && this.jh() > 0) || this.d4() || (this.g9 && this.gt() && this.ji() > 0) || (this.hc && this.gu() && this.jj() > 0);
        }
        pp(a) {
            if (a != null) {
                a.cx(this);
            }
        }
        ry(a) {
            if (a != null) {
                a.d3(this);
            }
        }
        bt() {
            return this.cw.h();
        }
        s1(a) {
            this.cw.bm(a);
        }
        sn(a, b) {
            this.ba.a$ar(this, a, b);
        }
        get_hg() {
            return false;
        }
        get hg() {
            return this.get_hg();
        }
        rr(a, b) {
            this.cw.a3(a, b);
        }
        rt(a) {
            this.ri(this.xd, a);
        }
        qk(a) {
            if (this.dp != null) {
                this.dp.handleCollectionChanged(a);
            }
        }
        qy(a, b, c) {
            this.qk(new NotifyCollectionChangedEventArgs(2, 2, c, b, a));
        }
        qt() {
            this.qk(new NotifyCollectionChangedEventArgs(0, 4));
        }
        qw(a, b) {
            this.qk(new NotifyCollectionChangedEventArgs(1, 0, b, a));
        }
        qx(a, b) {
            this.qk(new NotifyCollectionChangedEventArgs(1, 1, b, a));
        }
        su() {
            this.r8(false);
        }
        g2(a, b) {
            return false;
        }
        get_coercionMethods() {
            return this._coercionMethods;
        }
        set_coercionMethods(a) {
            this._coercionMethods = a;
        }
        get coercionMethods() {
            return this.get_coercionMethods();
        }
        set coercionMethods(a) {
            this.set_coercionMethods(a);
        }
        get_expectFunctions() {
            return this.du;
        }
        set_expectFunctions(a) {
            let b = this.du;
            this.du = a;
            if (b != this.du) {
                this.raisePropertyChanged("ExpectFunctions", b, this.du);
            }
        }
        get expectFunctions() {
            return this.get_expectFunctions();
        }
        set expectFunctions(a) {
            this.set_expectFunctions(a);
        }
        a2(a, b) {
            return null;
        }
        get b4() {
            return this.b1;
        }
        set b4(a) {
            let b = this.b1;
            this.b1 = a;
            if (b != this.b1) {
                this.raisePropertyChanged("HitTestMode", enumGetBox(SeriesHitTestMode_$type, b), enumGetBox(SeriesHitTestMode_$type, this.b1));
            }
        }
        b3() {
            return this.b4 == 0 ? 2 : this.b4;
        }
        get b2() {
            return this.b0;
        }
        set b2(a) {
            let b = this.b0;
            this.b0 = a;
            if (b != this.b0) {
                this.raisePropertyChanged("ActualHitTestMode", enumGetBox(SeriesHitTestMode_$type, b), enumGetBox(SeriesHitTestMode_$type, this.b0));
            }
        }
        dl(a) {
            if (a == null) {
                return this.dp.registerColumn(null, null, false);
            }
            let b = null;
            let c = SeriesViewer.de(a, this.coercionMethods);
            b = c.a;
            return this.dp.registerColumn(a, b, this.expectFunctions);
        }
        dm(a) {
            if (a == null) {
                return this.dp.registerColumnInt(null, null, false);
            }
            let b = null;
            let c = SeriesViewer.de(a, this.coercionMethods);
            b = c.a;
            return this.dp.registerColumnInt(a, b, this.expectFunctions);
        }
        dn(a) {
            if (a == null) {
                return this.dp.registerColumnObject(null, null, false);
            }
            let b = null;
            let c = SeriesViewer.de(a, this.coercionMethods);
            b = c.a;
            return this.dp.registerColumnObject(a, b, this.expectFunctions);
        }
        get xd() {
            return this.cw != null ? this.cw.b9 : Rect.empty;
        }
        get_fp() {
            return false;
        }
        get fp() {
            return this.get_fp();
        }
        get_fo() {
            return false;
        }
        get fo() {
            return this.get_fo();
        }
        sm(a) {
        }
        sl(a, b) {
        }
        pl(a, b) {
            this.bc.copyVisualData(a, b);
        }
        kv() {
            let a = this.bc.exportVisualData(this, this.xd);
            this.qd(a);
            this.cw.ax(a);
            this.bc.exportLayerVisualData(this, a);
            return a;
        }
        qd(a) {
        }
        qq(a) {
            if (this.wq.x != a.x || this.wq.y != a.y) {
                this.wq = a;
                this.q6(a);
            }
        }
        q6(a) {
        }
        qs() {
        }
        qz() {
        }
        aw(a) {
            return null;
        }
        ai() {
            return null;
        }
        i5() {
            return NaN;
        }
        static i6(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 (let 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 (let d = 0; d < a.count; d++) {
                if (!isNaN_(a.item(d)) && a.item(d) != 0) {
                    return a.item(d);
                }
            }
            return NaN;
        }
        static i7(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 (let 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 (let d = 0; d < a.count; d++) {
                if (!isNaN_(a.item(d)) && a.item(d) != 0) {
                    return a.item(d);
                }
            }
            return NaN;
        }
        q4() {
        }
        get it() {
            return this.id;
        }
        set it(a) {
            let b = this.it;
            if (a != b) {
                this.id = a;
                this.raisePropertyChanged("FinalValue", b, this.it);
            }
        }
        get jq() {
            return this.ie;
        }
        set jq(a) {
            let b = this.jq;
            if (a != b) {
                this.ie = a;
                this.raisePropertyChanged("PercentChange", b, this.jq);
            }
        }
        s5() {
            let a = this.i5();
            this.jq = (this.it - a) / a * 100;
        }
        ky(a) {
            return null;
        }
        get lt() {
            return !stringIsNullOrWhiteSpace(this.ds.bz) ? this.ds.bz : "Open";
        }
        get lf() {
            return !stringIsNullOrWhiteSpace(this.ds.bw) ? this.ds.bw : "Close";
        }
        get li() {
            return !stringIsNullOrWhiteSpace(this.ds.bx) ? this.ds.bx : "High";
        }
        get lr() {
            return !stringIsNullOrWhiteSpace(this.ds.by) ? this.ds.by : "Low";
        }
        get l1() {
            return !stringIsNullOrWhiteSpace(this.ds.b0) ? this.ds.b0 : "Volume";
        }
        get l0() {
            return !stringIsNullOrWhiteSpace(this.ds.b9) ? this.ds.b9 : "Value";
        }
        get lv() {
            return !stringIsNullOrWhiteSpace(this.ds.m) ? this.ds.m : "Radius";
        }
        s0() {
            this.te = this.tg();
            this.cw.bx();
        }
        av() {
            let a = this.legendItemBadgeShape;
            if (a == 0) {
                a = this.bg();
            }
            let b = 0;
            if (a == 3) {
                if (this.fd || this.gc) {
                    b = 6;
                }
                else if (this.fb) {
                    b = 7;
                }
                else {
                    b = 5;
                }
            }
            else if (a == 4) {
                if (this.hasMarkers && !this.fc) {
                    b = 8;
                }
                else {
                    b = 0;
                }
            }
            else if (a == 2) {
                if (this.hasMarkers && !this.ev) {
                    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;
        }
        bf(a) {
            return a;
        }
        bg() {
            if (this.ex || this.e0 || this.e2 || this.ft || this.f1 || this.fd || this.fb || this.fc || this.f6 || this.gc) {
                return this.bf(3);
            }
            else if (this.fn || this.f3 || this.fu || this.fm || this.isValueOverlay) {
                return this.bf(2);
            }
            else if (this.ev || this.fr || this.fq) {
                return this.bf(1);
            }
            else if (this.ek) {
                return this.bf(4);
            }
            return this.bf(1);
        }
        bk() {
            return null;
        }
        bm() {
            return this.bk();
        }
        get cc() {
            return this.b9;
        }
        get cb() {
            return this.b8;
        }
        get actualLayers() {
            return this.b7;
        }
        get ee() {
            return this.hx.count > 0;
        }
        sj(a, b) {
            if (b != null) {
                a.legendItemVisibility = 1;
            }
            else {
                a.legendItemVisibility = 0;
            }
            a.bl = b;
        }
        sr(a) {
            if (!this.hs.containsKey(a)) {
                this.hs.addItem(a, 0);
            }
            this.hs.item(a, this.hs.item(a) + 1);
        }
        st(a) {
            if (this.hs.containsKey(a)) {
                this.hs.item(a, this.hs.item(a) - 1);
                if (this.hs.item(a) == 0) {
                    this.hs.removeItem(a);
                }
            }
        }
        f8(a) {
            if (this.hs.containsKey(a) && this.hs.item(a) > 0) {
                return true;
            }
            return false;
        }
        sq(a) {
            if (!this.ho.containsKey(a)) {
                this.ho.addItem(a, new Stack$1(Boolean_$type));
            }
            this.ho.item(a).h(true);
        }
        ss(a, b) {
            if (this.ho.containsKey(a)) {
                this.ho.item(a).e();
                if (this.ho.item(a).f == 0) {
                    this.ho.removeItem(a);
                    let c = this.t5(a);
                    if (b && this.ei && !this.f8(a) && !this.f8("Actual" + a)) {
                        {
                            if (c != null) {
                                this.sr(a);
                                this.lc(a, this.c(c), this.c(c));
                                this.st(a);
                            }
                        }
                    }
                }
            }
        }
        gs(a) {
            if (this.ho.containsKey(a) && this.ho.item(a).d()) {
                return true;
            }
            return false;
        }
        f5() {
            return this.ho.count > 0;
        }
        k4() {
            return null;
        }
        bn(a, b) {
            if (this.hr.containsKey(b)) {
                return this.hr.item(b);
            }
            let c = this.bm();
            if (c == null) {
                return null;
            }
            c.bo = this;
            c.b6 = b;
            this.qo(c);
            this.sc(c);
            b.am(this, c);
            this.pd(a, c);
            this.hr.item(b, c);
            this.hx.insert(a, c);
            return c;
        }
        qo(a) {
            if (this.lb != null) {
                a.lb = this.lb;
            }
            if (this.gv) {
                a.gv = true;
            }
        }
        pd(a, b) {
            this.cw.ap(a, b);
        }
        pq(a) {
            this.cw.au(a);
        }
        sc(a) {
            for (let b of fromEnum(this.hu)) {
                let c = this.t5(b);
                if (c == null) {
                    continue;
                }
                this.pk(a, c);
            }
        }
        gf(a) {
            if (a.name == "ToolTip") {
                return true;
            }
            return false;
        }
        gw(a) {
            if (a.name == "ToolTip" && this.gv) {
                return true;
            }
            return false;
        }
        pk(a, b) {
            let c = a.b6;
            if (c != null) {
                let d = this.c(b);
                if (this.gw(b)) {
                    return;
                }
                if (this.gf(b)) {
                    d = this.ks(b, d);
                }
                c.ai(this, a, b, d);
            }
        }
        ks(a, b) {
            if (a.name == "ToolTip") {
                return null;
            }
            return b;
        }
        pu(a) {
            if (this.hr.containsKey(a)) {
                let b = this.hr.item(a);
                this.hr.removeItem(a);
                a.ap(b);
                this.pq(b);
                this.hx.remove(b);
            }
        }
        getDataLegendBadge() {
            let a = this.tg();
            if (a == null) {
                a = LegendTemplates.af(this);
            }
            return a;
        }
        getDataLegendBadgeContext() {
            if (this.a8 == null) {
                this.a8 = ((() => {
                    let $ret = new DataContext();
                    $ret.series = this;
                    $ret.item = null;
                    return $ret;
                })());
            }
            return this.a8;
        }
        getDataLegendBadgeContextAtPosition(a, b) {
            let c = this.getDataLegendBadgeContext();
            let d = this.getDataLegendResolvedWorldPositionX(a);
            let e = this.getDataLegendResolvedWorldPositionY(b);
            let f = this.kc({ $type: Point_$type, x: d, y: e });
            if (this.dp == null || f < 0 || f > (this.dp.count - 1)) {
                return null;
            }
            if (this.d3) {
                c.itemBrush = this.v7(f);
                c.outline = this.wa(f);
            }
            return c;
        }
        getDataLegendBadgeShapeAndMarker() {
            let a = this.av();
            if (a == 8) {
                return this.ml();
            }
            else if (a == 1) {
                if (this.be == 0) {
                    return "Line";
                }
                return "LineWith" + this.ml();
            }
            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.be == 0) {
                    return "Square";
                }
                else {
                    return "TwoColumns";
                }
            }
            else if (a == 7) {
                if (this.be == 0) {
                    return "Square";
                }
                else {
                    return "TwoBars";
                }
            }
            return EnumUtil.getName(ActualLegendItemBadgeShape_$type, a);
        }
        ml() {
            return null;
        }
        mm(a, b) {
            if (b == a.dc.uh) {
                return "Circle";
            }
            else if (b == a.dc.ui) {
                return "Diamond";
            }
            else if (b == a.dc.uj) {
                return "Hexagon";
            }
            else if (b == a.dc.uk) {
                return "Hexagram";
            }
            else if (b == a.dc.ul) {
                return "Pentagon";
            }
            else if (b == a.dc.um) {
                return "Pentagram";
            }
            else if (b == a.dc.un) {
                return "Pyramid";
            }
            else if (b == a.dc.uo) {
                return "Square";
            }
            else if (b == a.dc.up) {
                return "Tetragram";
            }
            else if (b == a.dc.uq) {
                return "Triangle";
            }
            else if (b != null) {
                return "Custom";
            }
            else {
                return "None";
            }
        }
        getDataLegendSeriesTitle() {
            return this.title == null ? null : this.title.toString();
        }
        i4(a, b) {
            return FastItemColumn.i(this.kz(a, b));
        }
        getDataLegendResolvedWorldPositionX(a) {
            if (isNaN_(a) || a < 0) {
                if (this.isVertical) {
                    a = 1;
                }
                else {
                    let b = this.a0();
                    if (b != null) {
                        if (b.dn) {
                            a = 0;
                        }
                        else {
                            a = 1;
                        }
                    }
                    else {
                        a = 1;
                    }
                }
            }
            return a;
        }
        getDataLegendResolvedWorldPositionY(a) {
            if (isNaN_(a) || a < 0) {
                if (this.isVertical) {
                    let b = this.a0();
                    if (b != null) {
                        if (b.dn) {
                            a = 1;
                        }
                        else {
                            a = 0;
                        }
                    }
                    else {
                        a = 0;
                    }
                }
                else {
                    a = 0;
                }
            }
            return a;
        }
        getDataLegendSeriesContextAt(a, b) {
            let c = new DataLegendSeriesValueInfo();
            c.l = this.jd({ $type: Point_$type, x: a, y: b }, false, false);
            c.a = 0;
            c.q = "Value";
            c.r = "Value";
            c.s = "";
            let d = new DataLegendSeriesContext();
            d.e = ((() => {
                let $ret = new List$1(DataLegendSeriesValueInfo.$, 0);
                $ret.add(c);
                return $ret;
            })());
            d.h = this.mn();
            return d;
        }
        mn() {
            let a = "Category";
            if (this.ff) {
                a = "Geographic";
            }
            if (this.fx) {
                a = "Range";
            }
            if (this.f0) {
                a = "Shape";
            }
            if (this.fz) {
                a = "Scatter";
            }
            if (this.fs) {
                a = "Polar";
            }
            if (this.fw) {
                a = "Radial";
            }
            if (this.isStacked || this.isFragment) {
                a = "Stacked";
            }
            if (this.fe) {
                a = "Category";
            }
            if (this.fa) {
                if (this.fd) {
                    a = "Financial";
                }
                else {
                    a = getInstanceType(this).typeName.toString();
                }
            }
            if (this.fi) {
                a += " Highlight";
            }
            else if (this.isValueOverlay) {
                a += " Overlay";
            }
            else {
                a += " Series";
            }
            return a;
        }
        getDataLegendAxisLabelFromCursorPosition(a, b) {
            if (this.e1 || this.fa || this.fw) {
                let c = this.a0();
                if (c != null) {
                    if (!c.dx()) {
                        return null;
                    }
                    let d = this.getDataLegendResolvedWorldPositionX(a);
                    let e = this.getDataLegendResolvedWorldPositionY(b);
                    let f = { $type: Point_$type, x: d, y: e };
                    if (c.dv) {
                        let g = this.ke(f);
                        if (g < 0) {
                            return null;
                        }
                        let h = c;
                        let i = h.i$d(g);
                        let j = this.h5(i);
                        return j;
                    }
                    else {
                        if (c.dr) {
                            let k = this.iy(f);
                            if (k < 0) {
                                k = 0;
                            }
                            let l = c;
                            let m = l.getDateTime(k);
                            return m;
                        }
                        else {
                            let n = this.kc(f);
                            if (n < 0) {
                                return null;
                            }
                            let o = c.pm;
                            if (o == null || o.count == 0) {
                                return null;
                            }
                            let p = false;
                            if (c.dc && c.ds) {
                                p = true;
                            }
                            if (!p) {
                                if (n >= o.count) {
                                    n = o.count - 1;
                                }
                            }
                            let q = c.i8(n);
                            return q;
                        }
                    }
                }
            }
            return null;
        }
        h5(ticks_) {
            let a = (new Date(ticks_));
            return a;
        }
        wk(a) {
            if (a == null) {
                return null;
            }
            if (this.b5 == null) {
                return a;
            }
            a = BrushUtil.s(a, this.ih);
            return a;
        }
        cg() {
            let a = this.mp();
            if (a != null) {
                let b = this.mo(a);
                if (b != null) {
                    let c = ((() => {
                        let $ret = new SeriesMatcher();
                        $ret.f = a;
                        $ret.e = b;
                        return $ret;
                    })());
                    if (this.gd(c)) {
                        return c;
                    }
                }
            }
            if (this.name != null) {
                let d = ((() => {
                    let $ret = new SeriesMatcher();
                    $ret.g = this.name;
                    return $ret;
                })());
                if (this.gd(d)) {
                    return d;
                }
            }
            let e = "Series Title";
            if (this.title != null && typeof this.title === 'string' && !Base.equalsStatic(this.title, e)) {
                let f = ((() => {
                    let $ret = new SeriesMatcher();
                    $ret.h = this.title;
                    return $ret;
                })());
                if (this.gd(f)) {
                    return f;
                }
            }
            if (this.index != -1) {
                let g = ((() => {
                    let $ret = new SeriesMatcher();
                    $ret.d = this.index;
                    return $ret;
                })());
                return g;
            }
            return null;
        }
        gd(a) {
            if (this.dc != null) {
                let b = SeriesMatcherHelper.a(this.dc, a);
                if (b != null && b.length == 1) {
                    return true;
                }
            }
            return false;
        }
        qr() {
        }
        w1(a) {
            let b = this.ai();
            if (b == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let c = null;
            let d = null;
            for (let e = 0; e < b.length; e++) {
                let f = b[e];
                if (!f.dy) {
                    c = f;
                }
                else {
                    d = f;
                }
            }
            if (c == null || d == null) {
                return { $type: Point_$type, x: NaN, y: NaN };
            }
            let g = 0;
            let h = 0;
            if (c.df && c.categoryMode != 0) {
                if (this.fa) {
                    g = this.getOffsetValue();
                }
                else if (this.e1) {
                    g = this.getOffsetValue();
                }
            }
            if (d.df && d.categoryMode != 0) {
                if (this.e1) {
                    h = this.getOffsetValue();
                }
            }
            let i = a.x;
            let j = a.y;
            i -= g;
            j -= h;
            let k = new ScalerParams(1, this.dc.yr, this.dc.y9, c.dn);
            k.c = this.getEffectiveViewport();
            let l = c.f9(i, k);
            let m = new ScalerParams(1, this.dc.yr, this.dc.y9, d.dn);
            m.c = this.getEffectiveViewport();
            let n = d.f9(j, m);
            return { $type: Point_$type, x: l, y: n };
        }
        oz(a, b) {
            let c = { $type: Point_$type, x: b.x, y: b.y };
            if (a.isVertical) {
                if (isNaN_(b.y)) {
                    return new Tuple$2(Boolean_$type, Point_$type, false, c);
                }
                if (isNaN_(b.x)) {
                    c.x = 0;
                    return new Tuple$2(Boolean_$type, Point_$type, true, c);
                }
            }
            else {
                if (isNaN_(b.x)) {
                    return new Tuple$2(Boolean_$type, Point_$type, false, c);
                }
                if (isNaN_(b.y)) {
                    c.y = 0;
                    return new Tuple$2(Boolean_$type, Point_$type, true, c);
                }
            }
            return new Tuple$2(Boolean_$type, Point_$type, true, c);
        }
    }
    Series.$t = markType(Series, 'Series', Control.$, [INotifyPropertyChanged_$type, IProvidesViewport_$type, ILegendSeries_$type, ILegendSeriesInternal_$type, ILegendOwner_$type, ILegendTemplateProvider_$type, IDataLegendSeries_$type]);
    Series.j9 = 0;
    Series.vn = DependencyProperty.i("VisibilityProxy", Visibility_$type, Series.$, new PropertyMetadata(2, enumGetBox(Visibility_$type, 0), (a, b) => a.raisePropertyChanged("VisibilityProxy", b.oldValue, b.newValue)));
    Series.hl = null;
    Series.hp = null;
    Series.hq = null;
    Series.ui = DependencyProperty.i("ItemsSource", IEnumerable_$type, Series.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(Series.$, a);
        if (c.c4 != null) {
            c.c4.releaseFastItemsSource(b.oldValue);
        }
        a.raisePropertyChanged("ItemsSource", b.oldValue, b.newValue);
    }));
    Series.uo = DependencyProperty.i("Legend", IChartLegend_$type, Series.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(Series.$, a);
        c.raisePropertyChanged("Legend", b.oldValue, b.newValue);
    }));
    Series.ul = DependencyProperty.i("LegendItemBadgeTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(Series.$, a);
        c.raisePropertyChanged("LegendItemBadgeTemplate", b.oldValue, b.newValue);
        if (c.tc != null) {
            c.tc = c.tb();
        }
    }));
    Series.um = DependencyProperty.i("LegendItemTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(Series.$, a);
        c.raisePropertyChanged("LegendItemTemplate", b.oldValue, b.newValue);
        if (c.tc != null) {
            c.tc = c.tb();
        }
    }));
    Series.t2 = DependencyProperty.i("DiscreteLegendItemTemplate", DataTemplate.$, Series.$, new PropertyMetadata(2, null, (a, b) => {
        let c = typeCast(Series.$, a);
        c.raisePropertyChanged("DiscreteLegendItemTemplate", b.oldValue, b.newValue);
    }));
    Series.ud = DependencyProperty.i("Index", Number_$type, Series.$, new PropertyMetadata(2, -1, (a, b) => {
        let c = typeCast(Series.$, a);
        c.raisePropertyChanged("Index", b.oldValue, b.newValue);
        if (c.tc != null) {
            c.tc = c.tb();
        }
    }));
    Series.$$p = markDep(DependencyProperty, PropertyMetadata, Series, 'raisePropertyChanged', ['ActualAreaFillOpacity:ig:ti', [1, 1], 'ActualBrush:vt:tj', [Brush.$], 'ActualFocusBrush:vu:tk', [Brush.$], 'ActualLegendItemBadgeBrush:vv:tl', [Brush.$], 'ActualLegendItemBadgeOutline:vw:tm', [Brush.$], 'ActualLegendItemBadgeTemplate:te:tn', [DataTemplate.$], 'ActualMarkerFillOpacity:ij:to', [1, 1], 'ActualOutline:vx:tp', [Brush.$], 'ActualSelectionBrush:vy:tq', [Brush.$], 'ActualThickness:il:tr', [1, DeviceUtils.g(2)], 'AreaFillOpacity:ir:ts', [1, NaN], 'AttachTooltipToRoot:d5:tt', [0, true], 'AutoCalloutLabelFormat:l4:tu', [2, null], 'AutoCalloutLabelFormatSpecifiers:ag:tv', [Array_$type, null], 'AutoCalloutValueLabelFormat:l7:tw', [2, null], 'AutoCalloutValueLabelFormatSpecifiers:ah:tx', [Array_$type, null], 'Brush:vz:ty', [Brush.$, null], 'DashArray:wm:tz', [DoubleCollection.$], 'DashCap:wn:t0', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)], 'DataLegendGroup:me:t1', [2, null], 'FastItemsSource:dp:t3', [IFastItemsSource_$type], 'FocusBrush:v4:t4', [Brush.$, null], 'HighlightedItemsSource::t6', [IEnumerable_$type, null], 'HighlightedLegendItemVisibility:xi:t7', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'HighlightedTitleSuffix:ms:t8', [2, " - Highlighted"], 'HighlightedValuesDataLegendGroup:mu:t9', [2, null], 'HighlightedValuesDisplayMode:bw:ua', [SeriesHighlightedValuesDisplayMode_$type, enumGetBox(SeriesHighlightedValuesDisplayMode_$type, 0)], 'HighlightedValuesFadeOpacity:jm:ub', [1, NaN], 'HighlightingFadeOpacity:jn:uc', [1, NaN], 'IsActualLegendFinancial:ep:ue', [0, false], 'IsComponentHighlightingModeIgnored:e3:uf', [0, false], 'IsDropShadowEnabled:e8:ug', [0, false], 'IsHighlightingEnabled:fg:uh', [0, false], 'LegendItemBadgeMode:be:uj', [LegendItemBadgeMode_$type, enumGetBox(LegendItemBadgeMode_$type, 0)], 'LegendItemBadgeShape::uk', [LegendItemBadgeShape_$type, enumGetBox(LegendItemBadgeShape_$type, 0)], 'LegendItemVisibility::un', [Visibility_$type, enumGetBox(Visibility_$type, 0)], 'LineCap:wo:up', [PenLineCap_$type, enumGetBox(PenLineCap_$type, 0)], 'LineJoin:wp:uq', [PenLineJoin_$type, enumGetBox(PenLineJoin_$type, 0)], 'MarkerFillOpacity:jo:ur', [1, NaN], 'MiterLimit:jp:us', [1, 10], 'MouseOverEnabled:ge:ut', [0, true], 'OutlineMode:cj:uu', [SeriesOutlineMode_$type, enumGetBox(SeriesOutlineMode_$type, 0)], 'Outline:wf:uv', [Brush.$, null], 'Resolution:jr:uw', [1, NaN], 'SafeActualBrush::ux', [Brush.$], 'SelectionBrush:wj:uy', [Brush.$, null], 'SelectionThickness:ju:uz', [1, NaN], 'ShadowBlur:jv:u0', [1, NaN], 'ShadowColor:wl:u1', [Color.$], 'ShadowOffsetX:jw:u2', [1, NaN], 'ShadowOffsetY:jx:u3', [1, NaN], 'ShouldAnimateOnDataSourceSwap:gm:u4', [0, false], 'ShouldHideAutoCallouts:go:u5', [0, false], 'ShouldRemoveHighlightedDataOnLayerHidden:gp:u6', [0, false], 'ShouldShiftOpacityForSafeActualBrush:gr:u7', [0, true], 'ShowDefaultTooltip:gv:u8', [0, false], 'Thickness:jy:u9', [1, DeviceUtils.g(2)], 'Title::va', [4, "Series Title"], 'ToolTip::vb', [4, null], 'TransitionDuration:km:vc', [1, 0], 'TransitionEasingFunction:de:vd', [Delegate_$type, null], 'TransitionInDuration:kn:ve', [1, 1000], 'TransitionInEasingFunction:df:vf', [Delegate_$type, null], 'TransitionInSpeedType:c6:vg', [TransitionInSpeedType_$type, enumGetBox(TransitionInSpeedType_$type, 0)], 'TransitionOutDuration:ko:vh', [1, 1000], 'TransitionOutEasingFunction:dg:vi', [Delegate_$type, null], 'TransitionOutSpeedType:c9:vj', [TransitionOutSpeedType_$type, enumGetBox(TransitionOutSpeedType_$type, 0)], 'TransitionProgress:jz:vk', [1, 0], 'UseItemWiseColors:hf:vl', [0, false], 'UseSingleShadow:hi:vm', [0, true], 'VisibleRangeMarginBottom:j0:vo', [1, NaN], 'VisibleRangeMarginLeft:j1:vp', [1, NaN], 'VisibleRangeMarginRight:j2:vq', [1, NaN], 'VisibleRangeMarginTop:j3:vr', [1, NaN], 'VisibleRangeMode:c0:vs', [SeriesVisibleRangeMode_$type, enumGetBox(SeriesVisibleRangeMode_$type, 0)]]);
    return Series;
})();
/**
 * @hidden
 */
export let MarkerSeries = /*@__PURE__*/ (() => {
    class MarkerSeries extends Series {
        constructor() {
            super();
            this.xs = 1;
            this.xn = 1;
            this.xj = 1;
            this.ym = null;
            this.xt = this.xu();
        }
        hz() {
            let a = super.hz();
            {
                let b = ((() => {
                    let $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.si));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $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.si));
                a.add(c);
            }
            return a;
        }
        xg(a, b) {
            if (this.fw || this.fs) {
                return new Thickness(1, 0, 0, 0, 0);
            }
            if (this.xt != 1 && this.xt != 13) {
                let c = this.xr.c8();
                let d = (c.width / 2) + (this.x4 / 2);
                let e = (c.height / 2) + (this.x4 / 2);
                let f = e;
                let g = e;
                let h = d;
                let 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);
        }
        rh(a) {
            super.rh(a);
            this.xr = a;
        }
        get_hasMarkers() {
            return true;
        }
        get_en() {
            return this.xt != 13 && this.xt != 1;
        }
        v5() {
            return this.y2;
        }
        v6() {
            return this.y3;
        }
        th() {
            return this.ym;
        }
        ml() {
            return this.mm(this, this.ym);
        }
        get xt() {
            return this.xs;
        }
        set xt(a) {
            let b = this.xs;
            this.xs = a;
            if (b != a) {
                this.raisePropertyChanged("ActualMarkerType", enumGetBox(MarkerType_$type, b), enumGetBox(MarkerType_$type, this.xs));
            }
        }
        xu() {
            if (this.xv == 1 || this.xv == 0) {
                if (this.fl && this.ba.a$d) {
                    return 2;
                }
                if (this.x0()) {
                    return 13;
                }
            }
            return this.xv;
        }
        x0() {
            return (this.hf && typeCast(IChartItemLegend_$type, this.legend) !== null) || this.xz();
        }
        xz() {
            if (this.dc == null) {
                return false;
            }
            if (this.dc.fm) {
                for (let a of fromEnum(this.dc.b9)) {
                    if (a.eq) {
                        if (a.g0(this)) {
                            return true;
                        }
                    }
                }
            }
            return false;
        }
        p8() {
            super.p8();
            this.xt = this.xu();
        }
        get xx() {
            return this.xy || this.yl == this.dc.uh;
        }
        get xo() {
            return this.xn;
        }
        set xo(a) {
            this.xn = a;
        }
        xq() {
            if (this.xp == 0) {
                return 1;
            }
            return this.xp;
        }
        s3(a) {
            super.s3(a);
            this.xp = a;
        }
        get xk() {
            return this.xj;
        }
        set xk(a) {
            this.xj = a;
        }
        xm() {
            if (this.xl == 0) {
                return 1;
            }
            return this.xl;
        }
        s2(a) {
            super.s2(a);
            this.xl = a;
        }
        s4(a) {
            super.s4(a);
            this.x4 = a;
        }
        iu() {
            return this.x4;
        }
        static get yo() {
            if (MarkerSeries.yk == null) {
                MarkerSeries.yk = new DataTemplate();
            }
            return MarkerSeries.yk;
        }
        get y4() {
            return this.c(MarkerSeries.yt);
        }
        set y4(a) {
            this.h(MarkerSeries.yt, a);
        }
        x1() {
            return this.ym != null && ((this.xt != 1 && this.xt != 0) || this.yn != null);
        }
        q8() {
            super.q8();
            this.xo = this.xq();
            this.xk = this.xm();
        }
        rq(a, b, c, d) {
            super.rq(a, b, c, d);
            switch (b) {
                case MarkerSeries.$$p[10]:
                    this.xt = this.xu();
                    break;
                case "MarkerBrush":
                case MarkerSeries.$$p[6]:
                case MarkerSeries.$$p[8]:
                case MarkerSeries.$$p[9]:
                    this.rw(b);
                    this.rj();
                    break;
                case "ActualMarkerType":
                    this.rw(b);
                    this.rj();
                    if (this.x0()) {
                        let e = EnumUtil.getEnumValue(MarkerType_$type, c) == 13 && this.xt != 1 && this.xt != 13;
                        let f = this.xt == 13 && EnumUtil.getEnumValue(MarkerType_$type, c) != 1 && EnumUtil.getEnumValue(MarkerType_$type, c) != 13;
                        if (e || f) {
                            if (this.dc != null) {
                                this.dc.pq();
                            }
                            this.q0();
                        }
                    }
                    break;
                case MarkerSeries.$$p[5]:
                    this.xo = this.xq();
                    this.rw(null);
                    this.rj();
                    break;
                case MarkerSeries.$$p[4]:
                    this.xk = this.xm();
                    this.rw(null);
                    this.rj();
                    break;
                case MarkerSeries.$$p[2]:
                    this.ym = d;
                    if (c == MarkerSeries.yo || d == MarkerSeries.yo || (c == null || d != null)) {
                        this.xr.cy();
                        let g = typeCast(MarkerSeriesView.$, this.cv);
                        if (g != null) {
                            g.cy();
                        }
                        this.r8(false);
                    }
                    if (this.ek) {
                        this.vv = this.v5();
                        this.vw = this.v6();
                    }
                    if (this.dc != null) {
                        this.dc.pq();
                    }
                    this.cw.bx();
                    if (this.toolTip != null && this.fl) {
                        this.ba.a$at(this, this.toolTip);
                    }
                    this.q0();
                    break;
                case MarkerSeries.$$p[11]:
                    this.xr.c5(this.x3);
                    this.r8(false);
                    break;
                case MarkerSeries.$$p[0]:
                case MarkerSeries.$$p[1]:
                    if (this.ek) {
                        this.vv = this.v5();
                        this.vw = this.v6();
                    }
                    break;
            }
        }
        static x9(a) {
            switch (a) {
                case 3:
                case 13: return SeriesViewer.$$p[2];
                case 4: return SeriesViewer.$$p[50];
                case 5: return SeriesViewer.$$p[34];
                case 6: return SeriesViewer.$$p[44];
                case 7: return SeriesViewer.$$p[5];
                case 8: return SeriesViewer.$$p[26];
                case 9: return SeriesViewer.$$p[10];
                case 10: return SeriesViewer.$$p[47];
                case 11: return SeriesViewer.$$p[27];
                case 12: return SeriesViewer.$$p[11];
                case 0:
                case 1:
                default: return null;
            }
        }
        static xw(a, b) {
            let c = 1;
            let d = 0;
            if (a != null && a.dc != null) {
                d = a.dc.bv;
            }
            if (a == null || a.dc == 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.fo) {
                        c = 1;
                    }
                    else {
                        c = 3;
                    }
                }
                else if (d == 3 || d == 2) {
                    if (d == 2) {
                        if (a.fo) {
                            c = 1;
                            return c;
                        }
                    }
                    if (a.index < 0) {
                        c = 1;
                    }
                    else {
                        let e = [3, 4, 8, 10, 7, 6, 9, 11, 5, 12];
                        c = e[a.index % e.length];
                    }
                }
            }
            return c;
        }
        v8(a) {
            if (this.dc == null) {
                return this.vt;
            }
            let b = this.dc.x1(this.index + a);
            if (this.xt == 13) {
                b = this.cw.b5();
            }
            else {
                if (this.xk != 2) {
                    if (this.dc != null) {
                        let c = b;
                        if (!isNaN_(this.ij) && this.ij != 1) {
                            c = BrushUtil.s(c, this.ij);
                        }
                        b = c;
                    }
                }
                else {
                    return this.v9(a);
                }
            }
            b = this.wd(b);
            return b;
        }
        v9(a) {
            if (this.dc == null) {
                return this.vt;
            }
            let b = this.dc.x2(this.index + a);
            if (this.xt == 13) {
                b = this.cw.b5();
            }
            else {
                if (this.xo == 2) {
                    return this.v8(a);
                }
            }
            b = this.wd(b);
            return b;
        }
        sz() {
            super.sz();
            if (this.index < 0) {
                return;
            }
            if (this.xr.ci()) {
                this.xr.cv();
                this.xr.cp();
            }
            else {
                let a = MarkerSeries.xw(this, this.xt);
                if (a == 1 && this.x0()) {
                    a = 13;
                }
                let b = MarkerSeries.x9(a);
                if (b == null) {
                    this.yl = MarkerSeries.yo;
                }
                else {
                    this.xr.cs(b);
                }
            }
            if (this.y4 != null && this.xt != 13) {
                this.sq("ActualMarkerBrush");
                let c = this.y2;
                this.xr.ct();
                this.xr.cq();
                let d = this.y2;
                let e = this.fk("ActualMarkerBrush", this.h1.f > 0 ? this.h1.d() : null, c, d);
                this.ss("ActualMarkerBrush", e);
            }
            else {
                if (this.xt == 13) {
                    if (!BrushUtilCore.a(this.y2)) {
                        this.sq("ActualMarkerBrush");
                        let f = this.y2;
                        this.y2 = this.cw.b5();
                        let g = this.y2;
                        let h = this.fk("ActualMarkerBrush", this.h1.f > 0 ? this.h1.d() : null, f, g);
                        this.ss("ActualMarkerBrush", h);
                    }
                }
                else {
                    if (this.xk != 2) {
                        if (this.dc != null) {
                            let i = this.dc.x1(this.index);
                            if (!isNaN_(this.ij) && this.ij != 1) {
                                i = BrushUtil.s(i, this.ij);
                            }
                            this.y2 = i;
                        }
                        else {
                            this.y2 = null;
                        }
                    }
                }
            }
            if (this.y5 != null && this.xt != 13) {
                this.sq("ActualMarkerOutline");
                let j = this.y3;
                this.xr.cu();
                this.xr.cr();
                let k = this.y3;
                let l = this.fk("ActualMarkerOutline", this.h1.f > 0 ? this.h1.d() : null, j, k);
                this.ss("ActualMarkerOutline", l);
            }
            else {
                if (this.xt == 13) {
                    if (!BrushUtilCore.a(this.y3)) {
                        this.sq("ActualMarkerOutline");
                        let m = this.y3;
                        this.y3 = this.cw.b5();
                        let n = this.y3;
                        let o = this.fk("ActualMarkerOutline", this.h1.f > 0 ? this.h1.d() : null, m, n);
                        this.ss("ActualMarkerOutline", o);
                    }
                }
                else {
                    if (this.xo == 2) {
                        this.y3 = this.y2;
                    }
                    else {
                        this.y3 = this.dc == null ? null : this.dc.x2(this.index);
                    }
                }
            }
            if (this.xk == 2 && this.y4 == null && this.xt != 13) {
                if (this.y3 != null) {
                    let p = this.y3;
                    if (!isNaN_(this.ij) && this.ij != 1) {
                        p = BrushUtil.s(p, this.ij);
                    }
                    this.y2 = p;
                }
                else {
                    this.y2 = null;
                }
            }
        }
        qd(a) {
            super.qd(a);
            this.bc.exportMarkerVisualData(this, a);
        }
        x2(a, b) {
            if (this.hasMarkers && this.x1()) {
                let c = this.xb(a);
                if (c.isEmpty) {
                    return false;
                }
                let d = RectUtil.r(c, this.i1(b));
                if (d.containsPoint(a)) {
                    return true;
                }
            }
            return false;
        }
        a2(a, b) {
            let c = this.xr.ce(a);
            let d = null;
            if (c != null) {
                d = c.content;
            }
            return d;
        }
    }
    MarkerSeries.$t = markType(MarkerSeries, 'MarkerSeries', Series.$);
    MarkerSeries.yk = null;
    MarkerSeries.yt = DependencyProperty.i("MarkerBrush", Brush.$, MarkerSeries.$, new PropertyMetadata(1, (a, b) => {
        let c = (typeCast(MarkerSeries.$, a));
        c.raisePropertyChanged("MarkerBrush", b.oldValue, b.newValue);
    }));
    MarkerSeries.$$p = markDep(DependencyProperty, PropertyMetadata, MarkerSeries, 'raisePropertyChanged', ['ActualMarkerBrush:y2:yp', [Brush.$], 'ActualMarkerOutline:y3:yq', [Brush.$], 'ActualMarkerTemplate:yl:yr', [DataTemplate.$, null], 'IsCustomMarkerCircular:xy:ys', [0, false], 'MarkerFillMode:xl:yu', [MarkerFillMode_$type, enumGetBox(MarkerFillMode_$type, 0)], 'MarkerOutlineMode:xp:yv', [MarkerOutlineMode_$type, enumGetBox(MarkerOutlineMode_$type, 0)], 'MarkerOutline:y5:yw', [Brush.$], 'MarkerStyle:y6:yx', [Style.$], 'MarkerTemplate:yn:yy', [DataTemplate.$, null], 'MarkerThickness:x4:yz', [1, DeviceUtils.g(2)], 'MarkerType:xv:y0', [MarkerType_$type, enumGetBox(MarkerType_$type, 1)], 'UseLightweightMarkers:x3:y1', [0, false]]);
    return MarkerSeries;
})();
/**
 * @hidden
 */
export let SyncLink = /*@__PURE__*/ (() => {
    class SyncLink extends FrameworkElement {
        constructor() {
            super();
            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, (a, b) => this.aq(a, b.propertyName, b.oldValue, b.newValue));
            this.ad = new ChartCollection();
            let a = this.ad;
            a.collectionChanged = delegateCombine(a.collectionChanged, runOn(this, this.am));
            this.av = new Rect(0, 0, 0, 1, 1);
        }
        aq(a, b, c, d) {
        }
        releaseFastItemsSource(a) {
            if (a != null) {
                let b = null;
                if (((() => { let c = this.ah.tryGetValue(a, b); b = c.p1; return c.ret; })())) {
                    --b.b;
                    if (b.b == 0) {
                        this.ah.removeItem(a);
                    }
                }
            }
            return null;
        }
        static af(a) {
            return ((() => {
                let $ret = new FastItemsSource();
                $ret.e = a;
                return $ret;
            })());
        }
        getFastItemsSource(a) {
            if (SyncLink.aj == null) {
                SyncLink.aj = SyncLink.af;
            }
            let b = null;
            if (a != null) {
                let c = null;
                if (!((() => { let d = this.ah.tryGetValue(a, c); c = d.p1; return d.ret; })())) {
                    b = SyncLink.aj(a);
                    c = new FastItemsSourceReference(b);
                    this.ah.addItem(a, c);
                }
                c.b++;
                b = c.a;
            }
            return b;
        }
        ag(a) {
            let b = null;
            if (a != null) {
                let c = null;
                if (!((() => { let d = this.ah.tryGetValue(a, c); c = d.p1; return d.ret; })())) {
                    return null;
                }
                b = c.a;
            }
            return b;
        }
        aw(a, b, c) {
            return this.ax(a, b, c, false);
        }
        ax(a, b, c, d) {
            if (!c.isEmpty) {
                c = new Rect(0, c.left, c.top, c.width, c.height);
                let e = a.io;
                let f = a.im;
                if (b == a) {
                    if (!d) {
                        if (!b.gg()) {
                            c.x = b.za.x;
                            c.width = b.za.width;
                        }
                        if (!b.gh()) {
                            c.y = b.za.y;
                            c.height = b.za.height;
                        }
                    }
                }
                else {
                    let g = SyncManager.a(b);
                    if (g == null || !g.synchronizeHorizontally) {
                        c.x = b.za.x;
                        c.width = b.za.width;
                    }
                    if (g == null || !g.synchronizeVertically) {
                        c.y = b.za.y;
                        c.height = b.za.height;
                    }
                }
                let h = 0.5 * (c.left + c.right);
                let i = 0.5 * (c.top + c.bottom);
                let j = c.width;
                let k = c.height;
                let l = MathUtil.e(c.width, e, 1);
                let m = MathUtil.e(c.height, f, 1);
                let n = false;
                if (a.hc() && !a.y9.isEmpty) {
                    let o = a.y9;
                    let p = o.width / o.height;
                    let q = l * o.width;
                    let r = m * o.height;
                    let 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.fj()) {
                    let t = false;
                    let u = false;
                    if (Math.abs(l - a.yr.width) > e) {
                        t = true;
                    }
                    if (Math.abs(m - a.yr.height) > f) {
                        u = true;
                    }
                    let v = a.pv(l, m, t, u);
                    l = v.p0;
                    m = v.p1;
                    l = MathUtil.e(l, e, 1);
                    m = MathUtil.e(m, f, 1);
                }
                else if (b.g4) {
                    let w = 1.7976931348623157E+308;
                    let x = -1.7976931348623157E+308;
                    let y = 1.7976931348623157E+308;
                    let z = -1.7976931348623157E+308;
                    let aa = c.left;
                    let ab = c.right;
                    let ac = c.top;
                    let ad = c.bottom;
                    let ae = c.width;
                    let af = c.height;
                    if (b.db == 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;
                        }
                    }
                    let ag = new Rect(0, aa, ac, ab - aa, ad - ac);
                    let ah = [w, x];
                    let ai = [y, z];
                    for (let aj = 0; aj < b.b9.count; aj++) {
                        let ak = b.b9._inner[aj];
                        if (ak.ev) {
                            continue;
                        }
                        {
                            let 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];
                                }
                            }
                        }
                    }
                    let am = (w == 1.7976931348623157E+308 || x == -1.7976931348623157E+308 || isNaN_(w) || isNaN_(x));
                    let 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;
                    }
                }
                let ao = l != j;
                let ap = m != k;
                let aq = ao && !n ? h - 0.5 * l : c.left;
                let ar = ap && !n ? i - 0.5 * m : c.top;
                let as = ao && !n ? h + 0.5 * l : c.right;
                let at = ap && !n ? i + 0.5 * m : c.bottom;
                if (b.db == 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;
        }
        ab(a, b, c, d) {
            let e = a.ai();
            let f = d[0];
            let g = d[1];
            let h = null;
            for (let i = 0; i < e.length; i++) {
                if (e[i].dy) {
                    h = e[i];
                }
            }
            if (h != null) {
                let j = new Rect(0, 0, 0, 1, 1);
                let k = new ScalerParams(0, j, j, h.dn, b.y1(j, b.y9, b.yv));
                k.b = a.i5();
                let l = a.az(c);
                let m = l == null || l.c == 1.7976931348623157E+308 || isNaN_(l.c);
                if (m) {
                    return d;
                }
                let n = h.f6(l.c, k);
                let o = h.f6(l.b, k);
                if (h.dn) {
                    let p = n;
                    n = o;
                    o = p;
                }
                g = Math.max(g, n);
                f = Math.min(f, o);
                if (a.cy == 2) {
                    if (h.dq) {
                        let q = h;
                        let r = q.rb;
                        r = h.fe(r, k);
                        let s = h.f6(r, k);
                        g = Math.max(g, s);
                        f = Math.min(f, s);
                    }
                }
            }
            d[0] = f;
            d[1] = g;
            return d;
        }
        ac(a, b, c, d) {
            let e = a.ai();
            let f = d[0];
            let g = d[1];
            let h = null;
            for (let i = 0; i < e.length; i++) {
                if (!e[i].dy) {
                    h = e[i];
                }
            }
            if (h != null) {
                let j = new Rect(0, 0, 0, 1, 1);
                let k = new ScalerParams(0, j, j, h.dn, b.y1(j, b.y9, b.yv));
                k.b = a.i5();
                let l = a.az(c);
                let m = l == null || l.c == 1.7976931348623157E+308 || isNaN_(l.c);
                if (m) {
                    return d;
                }
                let n = h.f6(l.c, k);
                let o = h.f6(l.b, k);
                if (h.dn) {
                    let p = n;
                    n = o;
                    o = p;
                }
                g = Math.max(g, o);
                f = Math.min(f, n);
                if (a.cy == 2) {
                    if (h.dq) {
                        let q = h;
                        let r = q.rb;
                        r = h.fe(r, k);
                        let s = h.f6(r, k);
                        g = Math.max(g, s);
                        f = Math.min(f, s);
                    }
                }
            }
            d[0] = f;
            d[1] = g;
            return d;
        }
        get ai() {
            return this.ad;
        }
        al(a) {
            this.ad.add(a);
        }
        as(a) {
            this.ad.remove(a);
        }
        ao() {
            for (let a of fromEnum(this.ad)) {
                if (a.za.isEmpty) {
                    a.za = this.aw(null, a, this.av);
                }
            }
        }
        am(a, b) {
            if (b.newItems != null) {
                for (let c of fromEn(b.newItems)) {
                    if (c.za.isEmpty) {
                        c.za = this.aw(null, c, this.av);
                    }
                }
            }
        }
        an(a, b) {
            for (let c of fromEnum(this.ai)) {
                if (c == a) {
                    c.yi = { $type: Point_$type, x: b.x, y: b.y };
                }
                else {
                    let d = { $type: Point_$type, x: b.x, y: b.y };
                    let e = SyncManager.a(c);
                    if (e == null || !e.synchronizeHorizontally) {
                        d.x = NaN;
                    }
                    if (e == null || !e.synchronizeVertically) {
                        d.y = NaN;
                    }
                    c.yi = d;
                }
            }
        }
        ap(a, b) {
            for (let c of fromEnum(this.ai)) {
                c.y2 = this.aw(a, c, b);
            }
        }
        at(a, b) {
            this.au(a, b, false);
        }
        au(a, b, c) {
            let d = b.isEmpty || isNaN_(b.x) || isNaN_(b.y) || isNaN_(b.width) || isNaN_(b.height);
            if (!d && !a.fh) {
                for (let e of fromEnum(this.ai)) {
                    e.fh = true;
                    e.za = this.ax(a, e, b, c);
                    e.fh = false;
                }
            }
        }
        ar(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;
})();
/**
 * @hidden
 */
export let SyncLinkManager = /*@__PURE__*/ (() => {
    class SyncLinkManager extends Base {
        constructor() {
            super();
            this.d = null;
            this.d = new Dictionary$2(String_$type, SyncLink.$, 0);
        }
        static instance() {
            if (SyncLinkManager.b == null) {
                SyncLinkManager.b = new SyncLinkManager();
            }
            return SyncLinkManager.b;
        }
        get e() {
            return this.d.count;
        }
        getLink(a) {
            let b;
            if (((() => { let 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;
        }
        releaseLink(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;
})();
/**
 * @hidden
 */
export let SyncManager = /*@__PURE__*/ (() => {
    class SyncManager extends Base {
        static e(a) {
            let b = SyncManager.a(a);
            if (b == null) {
                return;
            }
            if (!a.ga) {
                return;
            }
            if (a.syncChannel != b.syncChannel) {
                return;
            }
            SyncManager.b(a, a.syncChannel, null);
        }
        static c(a) {
            let b = SyncManager.a(a);
            if (b == null) {
                return;
            }
            if (a.ga && a.syncChannel == b.syncChannel) {
                return;
            }
            let c = null;
            if (a.ga) {
                c = a.syncChannel;
            }
            SyncManager.b(a, c, b.syncChannel);
        }
        static b(a, b, c) {
            if (a != null) {
                if (stringIsNullOrEmpty(c)) {
                    let d = a.actualSyncLink;
                    a.actualSyncLink = null;
                    a.actualSyncLink = new SyncLink();
                    if (d != null) {
                        SyncLinkManager.instance().releaseLink(d);
                    }
                    a.syncChannel = null;
                }
                else {
                    if (!stringIsNullOrEmpty(b)) {
                        let e = a.actualSyncLink;
                        a.actualSyncLink = null;
                        if (e != null) {
                            SyncLinkManager.instance().releaseLink(e);
                        }
                    }
                    a.actualSyncLink = SyncLinkManager.instance().getLink(c);
                    a.syncChannel = c;
                }
            }
        }
        static d(a, b) {
            a.syncSettings = b;
        }
        static a(a) {
            return a.syncSettings;
        }
    }
    SyncManager.$t = markType(SyncManager, 'SyncManager');
    return SyncManager;
})();
/**
 * @hidden
 */
export let ITrendLineManager_$type = new Type(null, 'ITrendLineManager');
/**
 * @hidden
 */
export let ChartCollection = /*@__PURE__*/ (() => {
    class ChartCollection extends ObservableCollection$1 {
        constructor() {
            super(SeriesViewer.$, 0);
            this.collectionResetting = null;
        }
        p() {
            if (this.collectionResetting != null) {
                this.collectionResetting(this, null);
            }
            super.p();
        }
    }
    ChartCollection.$t = markType(ChartCollection, 'ChartCollection', ObservableCollection$1.$.specialize(SeriesViewer.$));
    return ChartCollection;
})();
/**
 * @hidden
 */
export let SeriesCollection = /*@__PURE__*/ (() => {
    class SeriesCollection extends ObservableCollection$1 {
        constructor() {
            super(Series.$, 0);
            this.collectionResetting = null;
            this.collectionBeforeChanged = null;
            this.collectionAfterChanged = null;
        }
        ac(a) {
            if (this.collectionBeforeChanged != null) {
                this.collectionBeforeChanged(this, a);
            }
            super.ac(a);
            if (this.collectionAfterChanged != null) {
                this.collectionAfterChanged(this, a);
            }
        }
        p() {
            if (this.collectionResetting != null) {
                this.collectionResetting(this, null);
            }
            super.p();
        }
    }
    SeriesCollection.$t = markType(SeriesCollection, 'SeriesCollection', ObservableCollection$1.$.specialize(Series.$));
    return SeriesCollection;
})();
/**
 * @hidden
 */
export let CalloutLabelUpdatingEventArgs = /*@__PURE__*/ (() => {
    class CalloutLabelUpdatingEventArgs extends Base {
        constructor() {
            super(...arguments);
            this.d = null;
            this.e = null;
            this._item = null;
            this.a = null;
            this.f = null;
            this.c = null;
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
    }
    CalloutLabelUpdatingEventArgs.$t = markType(CalloutLabelUpdatingEventArgs, 'CalloutLabelUpdatingEventArgs');
    return CalloutLabelUpdatingEventArgs;
})();
/**
 * @hidden
 */
export let CalloutRenderStyleUpdatingEventArgs = /*@__PURE__*/ (() => {
    class CalloutRenderStyleUpdatingEventArgs extends Base {
        constructor() {
            super(...arguments);
            this._xValue = null;
            this._yValue = null;
            this._labelPositionX = 0;
            this._labelPositionY = 0;
            this._targetPositionX = 0;
            this._targetPositionY = 0;
            this._width = 0;
            this._height = 0;
            this._actualPosition = 0;
            this._item = null;
            this._series = null;
            this._background = null;
            this._backgroundCorner = 0;
            this._textColor = null;
            this._outline = null;
            this._leaderBrush = null;
            this._strokeThickness = 0;
            this._badgeBackground = null;
            this._badgeOutline = null;
            this._badgeThickness = 0;
            this._badgeImage = null;
            this.l = null;
        }
        get xValue() {
            return this._xValue;
        }
        set xValue(a) {
            this._xValue = a;
        }
        get yValue() {
            return this._yValue;
        }
        set yValue(a) {
            this._yValue = a;
        }
        get labelPositionX() {
            return this._labelPositionX;
        }
        set labelPositionX(a) {
            this._labelPositionX = a;
        }
        get labelPositionY() {
            return this._labelPositionY;
        }
        set labelPositionY(a) {
            this._labelPositionY = a;
        }
        get targetPositionX() {
            return this._targetPositionX;
        }
        set targetPositionX(a) {
            this._targetPositionX = a;
        }
        get targetPositionY() {
            return this._targetPositionY;
        }
        set targetPositionY(a) {
            this._targetPositionY = a;
        }
        get width() {
            return this._width;
        }
        set width(a) {
            this._width = a;
        }
        get height() {
            return this._height;
        }
        set height(a) {
            this._height = a;
        }
        get actualPosition() {
            return this._actualPosition;
        }
        set actualPosition(a) {
            this._actualPosition = a;
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
        get background() {
            return this._background;
        }
        set background(a) {
            this._background = a;
        }
        get backgroundCorner() {
            return this._backgroundCorner;
        }
        set backgroundCorner(a) {
            this._backgroundCorner = a;
        }
        get textColor() {
            return this._textColor;
        }
        set textColor(a) {
            this._textColor = a;
        }
        get outline() {
            return this._outline;
        }
        set outline(a) {
            this._outline = a;
        }
        get leaderBrush() {
            return this._leaderBrush;
        }
        set leaderBrush(a) {
            this._leaderBrush = a;
        }
        get strokeThickness() {
            return this._strokeThickness;
        }
        set strokeThickness(a) {
            this._strokeThickness = a;
        }
        get badgeBackground() {
            return this._badgeBackground;
        }
        set badgeBackground(a) {
            this._badgeBackground = a;
        }
        get badgeOutline() {
            return this._badgeOutline;
        }
        set badgeOutline(a) {
            this._badgeOutline = a;
        }
        get badgeThickness() {
            return this._badgeThickness;
        }
        set badgeThickness(a) {
            this._badgeThickness = a;
        }
        get badgeImage() {
            return this._badgeImage;
        }
        set badgeImage(a) {
            this._badgeImage = a;
        }
    }
    CalloutRenderStyleUpdatingEventArgs.$t = markType(CalloutRenderStyleUpdatingEventArgs, 'CalloutRenderStyleUpdatingEventArgs');
    return CalloutRenderStyleUpdatingEventArgs;
})();
/**
 * @hidden
 */
export let CalloutStyleUpdatingEventArgs = /*@__PURE__*/ (() => {
    class CalloutStyleUpdatingEventArgs extends Base {
        constructor() {
            super(...arguments);
            this._xValue = null;
            this._yValue = null;
            this._item = null;
            this._series = null;
            this._background = null;
            this._textColor = null;
            this._outline = null;
            this._leaderBrush = null;
            this._strokeThickness = 0;
            this._badgeBackground = null;
            this._badgeOutline = null;
            this._badgeThickness = 0;
            this._badgeWidth = 0;
            this._badgeHeight = 0;
            this._badgeVisible = false;
            this._badgeGap = 0;
            this._badgeImage = null;
            this._badgeCorner = 0;
            this._backgroundCorner = 0;
            this._bacgkroundPaddingLeft = 0;
            this._bacgkroundPaddingTop = 0;
            this._bacgkroundPaddingRight = 0;
            this._bacgkroundPaddingBottom = 0;
            this.o = null;
        }
        get xValue() {
            return this._xValue;
        }
        set xValue(a) {
            this._xValue = a;
        }
        get yValue() {
            return this._yValue;
        }
        set yValue(a) {
            this._yValue = a;
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
        get background() {
            return this._background;
        }
        set background(a) {
            this._background = a;
        }
        get textColor() {
            return this._textColor;
        }
        set textColor(a) {
            this._textColor = a;
        }
        get outline() {
            return this._outline;
        }
        set outline(a) {
            this._outline = a;
        }
        get leaderBrush() {
            return this._leaderBrush;
        }
        set leaderBrush(a) {
            this._leaderBrush = a;
        }
        get strokeThickness() {
            return this._strokeThickness;
        }
        set strokeThickness(a) {
            this._strokeThickness = a;
        }
        get badgeBackground() {
            return this._badgeBackground;
        }
        set badgeBackground(a) {
            this._badgeBackground = a;
        }
        get badgeOutline() {
            return this._badgeOutline;
        }
        set badgeOutline(a) {
            this._badgeOutline = a;
        }
        get badgeThickness() {
            return this._badgeThickness;
        }
        set badgeThickness(a) {
            this._badgeThickness = a;
        }
        get badgeWidth() {
            return this._badgeWidth;
        }
        set badgeWidth(a) {
            this._badgeWidth = a;
        }
        get badgeHeight() {
            return this._badgeHeight;
        }
        set badgeHeight(a) {
            this._badgeHeight = a;
        }
        get badgeVisible() {
            return this._badgeVisible;
        }
        set badgeVisible(a) {
            this._badgeVisible = a;
        }
        get badgeGap() {
            return this._badgeGap;
        }
        set badgeGap(a) {
            this._badgeGap = a;
        }
        get badgeImage() {
            return this._badgeImage;
        }
        set badgeImage(a) {
            this._badgeImage = a;
        }
        get badgeCorner() {
            return this._badgeCorner;
        }
        set badgeCorner(a) {
            this._badgeCorner = a;
        }
        get backgroundCorner() {
            return this._backgroundCorner;
        }
        set backgroundCorner(a) {
            this._backgroundCorner = a;
        }
        get bacgkroundPaddingLeft() {
            return this._bacgkroundPaddingLeft;
        }
        set bacgkroundPaddingLeft(a) {
            this._bacgkroundPaddingLeft = a;
        }
        get bacgkroundPaddingTop() {
            return this._bacgkroundPaddingTop;
        }
        set bacgkroundPaddingTop(a) {
            this._bacgkroundPaddingTop = a;
        }
        get bacgkroundPaddingRight() {
            return this._bacgkroundPaddingRight;
        }
        set bacgkroundPaddingRight(a) {
            this._bacgkroundPaddingRight = a;
        }
        get bacgkroundPaddingBottom() {
            return this._bacgkroundPaddingBottom;
        }
        set bacgkroundPaddingBottom(a) {
            this._bacgkroundPaddingBottom = a;
        }
    }
    CalloutStyleUpdatingEventArgs.$t = markType(CalloutStyleUpdatingEventArgs, 'CalloutStyleUpdatingEventArgs');
    return CalloutStyleUpdatingEventArgs;
})();
/**
 * @hidden
 */
export let PlotAreaMouseEventArgs = /*@__PURE__*/ (() => {
    class PlotAreaMouseEventArgs extends EventArgs {
        constructor(a, b, c) {
            super();
            this._chartPosition = null;
            this._plotAreaPosition = null;
            this._isDuringManipulation = false;
            this._viewer = null;
            this.viewer = a;
            this.chartPosition = b;
            this.plotAreaPosition = c;
        }
        get chartPosition() {
            return this._chartPosition;
        }
        set chartPosition(a) {
            this._chartPosition = a;
        }
        get plotAreaPosition() {
            return this._plotAreaPosition;
        }
        set plotAreaPosition(a) {
            this._plotAreaPosition = a;
        }
        get isDuringManipulation() {
            return this._isDuringManipulation;
        }
        set isDuringManipulation(a) {
            this._isDuringManipulation = a;
        }
        get viewer() {
            return this._viewer;
        }
        set viewer(a) {
            this._viewer = a;
        }
    }
    PlotAreaMouseEventArgs.$t = markType(PlotAreaMouseEventArgs, 'PlotAreaMouseEventArgs', EventArgs.$);
    return PlotAreaMouseEventArgs;
})();
/**
 * @hidden
 */
export let PlotAreaMouseButtonEventArgs = /*@__PURE__*/ (() => {
    class PlotAreaMouseButtonEventArgs extends EventArgs {
        constructor(a, b, c) {
            super();
            this._chartPosition = null;
            this._plotAreaPosition = null;
            this._manipulationOccurred = false;
            this._viewer = null;
            this.viewer = a;
            this.chartPosition = b;
            this.plotAreaPosition = c;
        }
        get chartPosition() {
            return this._chartPosition;
        }
        set chartPosition(a) {
            this._chartPosition = a;
        }
        get plotAreaPosition() {
            return this._plotAreaPosition;
        }
        set plotAreaPosition(a) {
            this._plotAreaPosition = a;
        }
        get manipulationOccurred() {
            return this._manipulationOccurred;
        }
        set manipulationOccurred(a) {
            this._manipulationOccurred = a;
        }
        get viewer() {
            return this._viewer;
        }
        set viewer(a) {
            this._viewer = a;
        }
    }
    PlotAreaMouseButtonEventArgs.$t = markType(PlotAreaMouseButtonEventArgs, 'PlotAreaMouseButtonEventArgs', EventArgs.$);
    return PlotAreaMouseButtonEventArgs;
})();
/**
 * @hidden
 */
export let ChartCursorEventArgs = /*@__PURE__*/ (() => {
    class ChartCursorEventArgs extends EventArgs {
        constructor(a, b, c) {
            super();
            this._item = null;
            this._series = null;
            this._seriesViewer = null;
            this.seriesViewer = a;
            this.series = b;
            this.item = c;
        }
        toString() {
            return this.seriesViewer.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "");
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
        get seriesViewer() {
            return this._seriesViewer;
        }
        set seriesViewer(a) {
            this._seriesViewer = a;
        }
        get chart() {
            return typeCast(XamDataChart.$, this.seriesViewer);
        }
    }
    ChartCursorEventArgs.$t = markType(ChartCursorEventArgs, 'ChartCursorEventArgs', EventArgs.$);
    return ChartCursorEventArgs;
})();
/**
 * @hidden
 */
export let SeriesViewerSelectedSeriesItemsChangedEventArgs = /*@__PURE__*/ (() => {
    class SeriesViewerSelectedSeriesItemsChangedEventArgs extends EventArgs {
        constructor(a, b, c) {
            super();
            this._oldItems = null;
            this._newItems = null;
            this._currentItems = null;
            this.oldItems = a;
            this.newItems = b;
            this.currentItems = c;
        }
        get oldItems() {
            return this._oldItems;
        }
        set oldItems(a) {
            this._oldItems = a;
        }
        get newItems() {
            return this._newItems;
        }
        set newItems(a) {
            this._newItems = a;
        }
        get currentItems() {
            return this._currentItems;
        }
        set currentItems(a) {
            this._currentItems = a;
        }
    }
    SeriesViewerSelectedSeriesItemsChangedEventArgs.$t = markType(SeriesViewerSelectedSeriesItemsChangedEventArgs, 'SeriesViewerSelectedSeriesItemsChangedEventArgs', EventArgs.$);
    return SeriesViewerSelectedSeriesItemsChangedEventArgs;
})();
/**
 * @hidden
 */
export let DataChartMouseButtonEventArgs = /*@__PURE__*/ (() => {
    class DataChartMouseButtonEventArgs extends EventArgs {
        constructor(a, b, c, d, e) {
            super();
            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._worldPosition = null;
            this._chart = null;
            this.chart = a;
            this.series = b;
            this.item = c;
            this.i = d;
            this.j = e;
            this.plotAreaPosition = { $type: Point_$type, x: e.x - this.chart.y9.left, y: e.y - this.chart.y9.top };
            let f = this.chart.y9;
            let g = this.chart.za;
            let h = this.chart.yv;
            let i = { $type: Point_$type, x: ViewportUtils.b(e.x, g, f, h), y: ViewportUtils.g(e.y, g, f, h) };
            this.worldPosition = i;
        }
        toString() {
            return this.chart.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "") + ", " + this.getPosition(null).toString();
        }
        get handled() {
            return this.i.handled;
        }
        set handled(a) {
            this.i.handled = a;
        }
        get cancelSelection() {
            return this.d;
        }
        set cancelSelection(a) {
            this.d = a;
        }
        getPosition(a) {
            return this.i.getPosition(a);
        }
        get originalSource() {
            return this.i.originalSource;
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
        get plotAreaPosition() {
            return this._plotAreaPosition;
        }
        set plotAreaPosition(a) {
            this._plotAreaPosition = a;
        }
        get chartPosition() {
            if (isNaN_(this.j.x) && isNaN_(this.j.y)) {
                this.j.x = this.plotAreaPosition.x + this.chart.y9.left;
                this.j.y = this.plotAreaPosition.y + this.chart.y9.top;
            }
            return this.j;
        }
        get worldPosition() {
            return this._worldPosition;
        }
        set worldPosition(a) {
            this._worldPosition = a;
        }
        get chart() {
            return this._chart;
        }
        set chart(a) {
            this._chart = a;
        }
    }
    DataChartMouseButtonEventArgs.$t = markType(DataChartMouseButtonEventArgs, 'DataChartMouseButtonEventArgs', EventArgs.$);
    return DataChartMouseButtonEventArgs;
})();
/**
 * @hidden
 */
export let ChartMouseEventArgs = /*@__PURE__*/ (() => {
    class ChartMouseEventArgs extends EventArgs {
        constructor(a, b, c, d, e) {
            super();
            this.f = null;
            this._item = null;
            this._series = null;
            this._plotAreaPosition = null;
            this.g = { $type: Point_$type, x: NaN, y: NaN };
            this._worldPosition = null;
            this._chart = null;
            this.chart = a;
            this.series = b;
            this.item = c;
            this.f = d;
            this.g = e;
            this.plotAreaPosition = { $type: Point_$type, x: e.x - this.chart.y9.left, y: e.y - this.chart.y9.top };
            let f = this.chart.y9;
            let g = this.chart.za;
            let h = this.chart.yv;
            let i = { $type: Point_$type, x: ViewportUtils.b(e.x, g, f, h), y: ViewportUtils.g(e.y, g, f, h) };
            this.worldPosition = i;
        }
        toString() {
            return this.chart.name + ", " + this.series.name + ", " + (this.item != null ? this.item.toString() : "") + ", " + this.getPosition(null).toString();
        }
        getPosition(a) {
            return this.f.getPosition(a);
        }
        get originalSource() {
            return this.f.originalSource;
        }
        get item() {
            return this._item;
        }
        set item(a) {
            this._item = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
        get plotAreaPosition() {
            return this._plotAreaPosition;
        }
        set plotAreaPosition(a) {
            this._plotAreaPosition = a;
        }
        get chartPosition() {
            if (isNaN_(this.g.x) && isNaN_(this.g.y)) {
                this.g.x = this.plotAreaPosition.x + this.chart.y9.left;
                this.g.y = this.plotAreaPosition.y + this.chart.y9.top;
            }
            return this.g;
        }
        get worldPosition() {
            return this._worldPosition;
        }
        set worldPosition(a) {
            this._worldPosition = a;
        }
        get chart() {
            return this._chart;
        }
        set chart(a) {
            this._chart = a;
        }
    }
    ChartMouseEventArgs.$t = markType(ChartMouseEventArgs, 'ChartMouseEventArgs', EventArgs.$);
    return ChartMouseEventArgs;
})();
/**
 * @hidden
 */
export let AnnotationBadgeView = /*@__PURE__*/ (() => {
    class AnnotationBadgeView extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.f = null;
            this.b = null;
            this.a = a;
            this.f = new Rectangle();
            this.e();
        }
        get g() {
            return this.f;
        }
        e() {
            this.f.width = this.a.width;
            this.f.height = this.a.height;
            this.f.ap = this.a.al;
            this.f.aq = this.a.al;
            this.f._fill = this.a.a5;
            this.f._stroke = this.a.a6;
            this.f.ad = this.a.ba.left;
        }
        c(a) {
            this.b = a;
            if (this.a.ah != null) {
                this.a.ah.d0 = true;
                this.a.ah.lx();
            }
        }
        d(a) {
            if (this.a._visibility != 0) {
                return;
            }
            this.f.n = this.a.n + this.a.bb.left;
            this.f.o = this.a.o;
            this.f.s = this.a.s;
            a.w(this.f);
            if (this.b != null) {
                let b = this.a.ba.left;
                let c = this.f.n + (b / 2);
                let d = this.f.o + (b / 2);
                let e = this.f.width - b;
                let f = this.f.height - b;
                a.aa();
                let g = new Rectangle();
                g.n = c;
                g.o = d;
                g.width = e;
                g.height = f;
                g.ap = this.f.ap;
                g.aq = this.f.aq;
                a.ad(g);
                a.n(this.b, 1, c, d, e, f);
                a.z();
            }
        }
    }
    AnnotationBadgeView.$t = markType(AnnotationBadgeView, 'AnnotationBadgeView');
    return AnnotationBadgeView;
})();
/**
 * @hidden
 */
export let AxisComponentsForView = /*@__PURE__*/ (() => {
    class AxisComponentsForView extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
        }
    }
    AxisComponentsForView.$t = markType(AxisComponentsForView, 'AxisComponentsForView');
    return AxisComponentsForView;
})();
/**
 * @hidden
 */
export let AxisLabelPanelBaseView = /*@__PURE__*/ (() => {
    class AxisLabelPanelBaseView extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.aw = null;
            this.f = null;
            this.au = Rect.empty;
            this.d = null;
            this.i = 0;
            this.j = NaN;
            this.a = a;
        }
        z(a, b, c, d, e, f) {
            let g = typeCast(FrameworkElement.$, a);
            if (g != null) {
                g._visibility = 0;
                if (b.width == 0 && b.height == 0) {
                    g._visibility = 1;
                }
                let h = b.height - (d + f);
                let 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) {
                    let j = g.j;
                    let k = j.j._inner[0];
                    k.k = k.k + g.n;
                    k.l = k.l + g.o;
                }
            }
        }
        av(a, b, c, d, e, f, g, h, i) {
            let j = Math.max(f, Math.max(g, Math.max(h, i)));
            let k = new Thickness(0, j);
            if (this.a.a0) {
                k = new Thickness(0, Math.sqrt((j * j) / 2));
            }
            let l = d.i;
            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;
            }
            let m = c.a7();
            let n = c._visibility == 0 ? m.width : 0;
            let o = c._visibility == 0 ? m.height : 0;
            let p = new Rect(0, e.left - l.left - n, e.top - l.top, e.width + l.left + l.right + n, e.height + l.top + l.bottom);
            let q = a.j;
            a.j = null;
            this.z(a, p, f, g, h, i);
            a.j = q;
            a.width = a.m;
            a.height = a.l;
            let r = new Rect(0, a.n, a.o, a.width, a.height);
            if (c._visibility == 0) {
                let s = b.al != null && b.al.length > 0;
                let t = s ? l.left - f : l.left;
                let u = new Rect(0, r.left + t, r.top + (r.height * 0.5) - (o * 0.5), n, o);
                let v = c.j;
                c.j = null;
                this.z(c, u, 0, 0, 0, 0);
                c.j = q;
                c.width = c.m;
                c.height = c.l;
            }
            return r;
        }
        ad(a) {
            let b = a;
            b.j = null;
        }
        ag(a) {
        }
        ah(a, b) {
        }
        ai(a, b) {
            let c = typeCast(FrameworkElement.$, a);
            let d = 0;
            let e = 0;
            let f = new TransformGroup();
            let g = ((() => {
                let $ret = new RotateTransform();
                $ret.j = b;
                $ret.k = d;
                $ret.l = e;
                return $ret;
            })());
            f.j.add(g);
            c.j = f;
        }
        aq(a, b, c, d, e, f, g, h, i, j) {
            let k = Math.max(f, Math.max(g, Math.max(h, i)));
            let l = new Thickness(0, k);
            if (this.a.a0) {
                l = new Thickness(0, Math.sqrt((k * k) / 2));
            }
            let m = d.i;
            if (isNaN_(m.left) || isNaN_(m.top) || isNaN_(m.right) || isNaN_(m.bottom)) {
                m = l;
            }
            if (m.left > l.left || m.top > l.top || m.right > l.right || m.bottom > l.bottom) {
                m = l;
            }
            let n = b.j;
            let o = new TransformGroup();
            let p = a.n + m.left;
            let q = a.o + m.top;
            o.j.add(n);
            a.j = o;
        }
        ac(a, b) {
            a.j = null;
            b.j = null;
        }
        c(a, b, c, d) {
            let e = a.al.length;
            let f = a.al;
            let g = a.al;
            let h = this.n(a) + c + d;
            while (h > b && e > 0) {
                e--;
                f = f.substr(0, e) + "\u2026";
                a.al = f;
                h = this.n(a) + c + d;
            }
            a.al = g;
            return ((() => {
                let $ret = new TrimmedTextInfo();
                $ret.b = f;
                $ret.a = h;
                return $ret;
            })());
        }
        ae() {
            if (this.f == null) {
                return;
            }
            let a = this.h();
            for (let b of fromEnum(a)) {
                let c = typeCast(FrameworkElement.$, b);
                if (c != null) {
                    this.a.ck(c);
                }
                this.a.cb(b);
            }
        }
        h() {
            let a = this.a.a6();
            let b = this.a.a5();
            if (!this.a.ae.ej) {
                return a;
            }
            else {
                return b;
            }
        }
        m(a) {
            if (this.a.ae != null && this.a.ae.cs) {
                return this.ax(a).height;
            }
            else {
                return this.i;
            }
        }
        o(a) {
            return this.m(a) + this.s() + this.p();
        }
        am() {
            this.aw = ((() => {
                let $ret = new Path();
                $ret.an = new GeometryGroup();
                $ret.ab = false;
                return $ret;
            })());
        }
        n(a) {
            if (this.a.ae != null && this.a.ae.cs) {
                return this.ax(a).width;
            }
            else {
                let b = a;
                if (b != null && b.al != null) {
                    return this.f.f(b);
                }
                return 0;
            }
        }
        x(a) {
            let b = a;
            if (b != null && b.al != null) {
                return this.n(a) + this.q() + this.r();
            }
            return 0;
        }
        ax(a) {
            let b = a;
            if (b != null && b.al != null) {
                b.ag = true;
                let c = this.f.aj(b, this.i, true);
                return new Size(1, c.c, c.b);
            }
            return new Size(1, 0, 0);
        }
        ab() {
            this.a.bm = this.a.ae.gc();
        }
        aj() {
            this.af();
            this.a.dd(new Size(1, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY));
        }
        g() {
            return this.f;
        }
        ak(a) {
            this.f = a;
        }
        y() {
            if (this.a.c6.isEmpty) {
                return;
            }
            let a = this.a.bi;
            this.a.db(new Size(1, this.a.c6.width, this.a.c6.height));
            if (this.a.bi != a) {
                this.a.ae.b5.pr();
                this.al();
            }
        }
        al() {
        }
        ao(a) {
            this.f.x(a);
        }
        an() {
            if (this.f == null) {
                return;
            }
            if (this.f.d) {
                if (this.a.ae.b7 != null && this.a.ae.b7.ij != 1) {
                    this.f.aa();
                    this.f.ab(this.a.ae.b7.ij, this.a.ae.b7.ij);
                }
                this.af();
                this.au = this.a.c6;
                let a = this.a.ae.b5.getFontBrush();
                if (this.a.ah != null && this.a.ah.textColor != null) {
                    a = this.a.ah.textColor;
                }
                if (this.a.j != null) {
                    this.f.aa();
                    this.f.k(this.a.j);
                }
                let b = false;
                for (let c of fromEnum(this.h())) {
                    let d = typeCast(TextBlock.$, c);
                    if (d != null) {
                        if (d.s != 0) {
                            b = true;
                            continue;
                        }
                        d.ao = a;
                        if (d.j != null) {
                            this.f.aa();
                            this.f.k(d.j);
                        }
                        this.ao(d);
                        if (d.j != null) {
                            this.f.z();
                        }
                    }
                }
                if (b) {
                    for (let e of fromEnum(this.a.ab)) {
                        let f = typeCast(Rectangle.$, e);
                        if (f != null) {
                            if (f.s == 0) {
                                continue;
                            }
                            if (f.j != null) {
                                this.f.aa();
                                this.f.k(f.j);
                            }
                            this.f.w(f);
                            if (f.j != null) {
                                this.f.z();
                            }
                        }
                        let g = typeCast(TextBlock.$, e);
                        if (g != null) {
                            if (g.s == 0) {
                                continue;
                            }
                            if (g.j != null) {
                                this.f.aa();
                                this.f.k(g.j);
                            }
                            if (g.ao == null) {
                                g.ao = a;
                            }
                            this.f.x(g);
                            if (g.j != null) {
                                this.f.z();
                            }
                        }
                        let h = typeCast(AnnotationBadge.$, e);
                        if (h != null) {
                            if (h.s == 0) {
                                continue;
                            }
                            if (h.j != null) {
                                this.f.aa();
                                this.f.k(g.j);
                            }
                            h.ag.d(this.f);
                            if (h.j != null) {
                                this.f.z();
                            }
                        }
                    }
                }
                if (this.a.j != null) {
                    this.f.z();
                }
                this.ap();
                a = this.as();
                this.f.af(this.e());
                let i = this.a.ae.mg;
                if (i != null) {
                    i.ao = a;
                    if (i.j != null) {
                        this.f.aa();
                        this.f.k(i.j);
                    }
                    this.f.x(i);
                    if (i.j != null) {
                        this.f.z();
                    }
                }
                if (this.a.ae.b7 != null && this.a.ae.b7.ij != 1) {
                    this.f.z();
                }
            }
        }
        e() {
            let a = this.a.ae.b7.getFontInfo();
            if (this.a.ae.b4 != null && this.a.ae.b4.textStyle != null) {
                a = this.a.ae.b4.h(this.a.ae.b7.dw.j.ae);
            }
            else {
                let b = this.a.ae.b7.d1();
                if (b != null) {
                    a = b;
                }
            }
            return a;
        }
        as() {
            let a = this.a.ae.b5.getFontBrush();
            if (this.a.ae.b4 != null && this.a.ae.b4.textColor != null) {
                a = this.a.ae.b4.textColor;
            }
            else {
                let b = this.a.ae.b7.xy();
                if (b != null) {
                    a = b;
                }
            }
            return a;
        }
        af() {
            if (this.f == null) {
                return;
            }
            let a = this.a.ae.b7.getFontInfo();
            if (this.a.ah != null && this.a.ah.j) {
                a = this.a.ah.h(this.a.ae.b7.dw.j.ae);
            }
            if (this.d != a) {
                this.d = a;
                this.ar();
            }
            this.f.af(a);
        }
        ar() {
            if (this.a.ae != null && this.a.ae.b7 != null) {
                if (this.a.ah == null || this.a.ah.textStyle == null) {
                    this.i = this.a.ae.b7.dw.bc;
                    return;
                }
                if (this.i == 0) {
                    this.i = this.a.ae.b7.dw.bc;
                }
                let a = this.i;
                let b = this.a.ae.b7.getFontInfo();
                if (this.a.ah != null && this.a.ah.textStyle != null) {
                    b = this.a.ah.h(this.a.ae.b7.dw.j.ae);
                }
                let c = FontUtil.getCurrentFontHeight(this.a.ae.b7.dw.j.ae, b);
                this.i = c;
                if (a != this.i) {
                    this.a.ae.b7.pr();
                }
            }
        }
        k() {
            if (this.a.ae.j3 == null) {
                return 0;
            }
            if (this.a.ae.b4 != null && this.a.ae.b4.visibility == 1) {
                return 0;
            }
            if (!isNaN_(this.j)) {
                return this.j;
            }
            let a = this.e();
            if (this.a.ae.b7 == null) {
                return this.i;
            }
            this.j = FontUtil.getCurrentFontHeight(this.a.ae.b7.dw.j.ae, a);
            return this.j;
        }
        l() {
            if (this.a.ae.b4 != null && this.a.ae.b4.visibility == 1) {
                return 0;
            }
            if (this.f == null) {
                return 0;
            }
            let a = this.a.ae.mg;
            if (a != null && a.al != null) {
                this.f.af(this.e());
                let b = this.f.f(a);
                this.af();
                return b;
            }
            return 0;
        }
        ap() {
            if (this.a.ab.count == 0) {
                return;
            }
            if (this.a.ae.oq == null) {
                this.aw._stroke = this.a.ae.b5.xv();
            }
            else {
                this.aw._stroke = this.a.ae.oq;
            }
            this.aw.ai = this.a.ae.ou;
            this.aw.ad = this.a.ae.g7;
            this.f.t(this.aw);
        }
        aa(a) {
        }
        ay() {
            return this.a.ae.b7.zc();
        }
        w() {
            if (this.a.ae.b4 != null && !isNaN_(this.a.ae.b4.topMargin)) {
                return Math.max(0, this.a.ae.b4.topMargin);
            }
            else {
                return this.ay().top;
            }
        }
        t() {
            if (this.a.ae.b4 != null && !isNaN_(this.a.ae.b4.bottomMargin)) {
                return Math.max(0, this.a.ae.b4.bottomMargin);
            }
            else {
                return this.ay().bottom;
            }
        }
        u() {
            if (this.a.ae.b4 != null && !isNaN_(this.a.ae.b4.leftMargin)) {
                return Math.max(0, this.a.ae.b4.leftMargin);
            }
            else {
                return this.ay().left;
            }
        }
        v() {
            if (this.a.ae.b4 != null && !isNaN_(this.a.ae.b4.rightMargin)) {
                return Math.max(0, this.a.ae.b4.rightMargin);
            }
            else {
                return this.ay().right;
            }
        }
        at() {
            return this.aw.an.d;
        }
        b() {
            let a = ((() => {
                let $ret = new PathRenderingInfo();
                $ret.e = this.a.ae.oq;
                $ret.c = this.a.ae.g7;
                return $ret;
            })());
            if (this.a.ae != null && typeCast(XamDataChart.$, this.a.ae.b5) !== null) {
                let b = this.a.ae.b5;
                if (b.aaa && b.dm != 2 && b.dm != 1) {
                    a.a = true;
                }
            }
            return a;
        }
        s() {
            if (this.a.ah == null) {
                return 0;
            }
            return Math.max(0, this.a.ah.topMargin);
        }
        q() {
            if (this.a.ah == null) {
                return 0;
            }
            return Math.max(0, this.a.ah.leftMargin);
        }
        r() {
            if (this.a.ah == null) {
                return 0;
            }
            return Math.max(0, this.a.ah.rightMargin);
        }
        p() {
            if (this.a.ah == null) {
                return 0;
            }
            return Math.max(0, this.a.ah.bottomMargin);
        }
    }
    AxisLabelPanelBaseView.$t = markType(AxisLabelPanelBaseView, 'AxisLabelPanelBaseView');
    return AxisLabelPanelBaseView;
})();
/**
 * @hidden
 */
export let AxisView = /*@__PURE__*/ (() => {
    class AxisView extends Base {
        constructor(a) {
            super();
            this.b = null;
            this.k = null;
            this.bj = null;
            this.bk = null;
            this.bm = null;
            this.bl = null;
            this.c = new AxisComponentsFromView();
            this.i = null;
            this.m = null;
            this.l = null;
            this._isDirty = false;
            this.bn = null;
            this.bh = Rect.empty;
            this.b = a;
            this.bn = new Rectangle();
        }
        ar() {
            this.k = new ImageLoader();
            this.bj = ((() => {
                let $ret = new Path();
                $ret.an = new GeometryGroup();
                return $ret;
            })());
            this.bm = ((() => {
                let $ret = new Path();
                $ret.an = new GeometryGroup();
                $ret.ab = false;
                $ret.stroke = null;
                return $ret;
            })());
            this.bk = ((() => {
                let $ret = new Path();
                $ret.an = new GeometryGroup();
                $ret.ab = false;
                return $ret;
            })());
            this.bl = ((() => {
                let $ret = new Path();
                $ret.an = new GeometryGroup();
                $ret.ab = false;
                return $ret;
            })());
            this.b.oq = AxisDefaults.axis_TickBrush;
            this.b.g6 = AxisDefaults.axis_TickLength;
            this.b.g7 = AxisDefaults.axis_TickStroke;
            this.b.ge = AxisDefaults.axis_MajorStroke;
            this.b.gh = AxisDefaults.axis_MinorStroke;
            this.b.g5 = AxisDefaults.axis_LineStroke;
        }
        at(a) {
        }
        a9() {
            let a = new TextBlock();
            return a;
        }
        a2(a) {
            a._visibility = 0;
            a.s = 0;
            if (a.x == null) {
                this.b.a1.ab.add(a);
            }
        }
        a4(a) {
            a._visibility = 1;
        }
        a3(a) {
            if (this.b.a1.ab.contains(a)) {
                this.b.a1.ab.remove(a);
            }
        }
        bo() {
            let a = new Rectangle();
            return a;
        }
        w(a) {
            if (a.x == null) {
                this.e.ab.add(a);
            }
            a._visibility = 0;
        }
        y(a) {
            a._visibility = 1;
        }
        x(a) {
            if (this.b.a1.ab.contains(a)) {
                this.b.a1.ab.remove(a);
            }
        }
        a() {
            return new AnnotationBadge(this.k);
        }
        z(a) {
            if (a.x == null) {
                this.e.ab.add(a);
            }
            a._visibility = 0;
        }
        ab(a) {
            a._visibility = 1;
        }
        aa(a) {
            if (this.b.a1.ab.contains(a)) {
                this.b.a1.ab.remove(a);
            }
        }
        au() {
        }
        r() {
            return true;
        }
        get index() {
            if (this.b.b7 != null && this.b.b7.f6) {
                return this.b.b7.b9.count + 1;
            }
            let a = typeCast(XamDataChart.$, this.b.b5);
            let b = 0;
            if (a == null) {
                return 0;
            }
            if (a != null && a.zu == 1) {
                let c = 0;
                for (let d = 0; d < this.b.b7.b9.count; d++) {
                    if (this.b.b7.b9._inner[d].isStacked) {
                        c += this.b.b7.b9._inner[d].kl();
                    }
                    else {
                        c++;
                    }
                }
                b = c;
            }
            return b + a.zq.indexOf(this.b);
        }
        ao() {
            if (this.b.b7 == null) {
                return;
            }
            this.e.cj();
            this.e.b7();
        }
        am() {
            this.e.ce();
        }
        ai() {
            if (this.e != null) {
                this.e.ab.clear();
            }
            this.ak(this.bj.an.d);
            this.ak(this.bm.an.d);
            this.ak(this.bk.an.d);
            this.ak(this.bl.an.d);
            this.ap();
        }
        a7(a) {
            this.bj._visibility = a;
            this.bk._visibility = a;
            this.bm._visibility = a;
            this.bl._visibility = a;
        }
        az() {
        }
        ah(a) {
            this.b.d0 = true;
            if (this.b.b7 != null) {
                this.b.b7.pr();
            }
            this.b.lx();
        }
        d() {
            this.c.a = this.bj;
            this.c.b = this.bk;
            this.c.c = this.bl;
            this.c.d = this.bm;
            return this.c;
        }
        ak(a) {
            if (a != null) {
                a.clear();
            }
        }
        ba() {
            return this.bj.an.d;
        }
        f() {
            let a = ((() => {
                let $ret = new PathRenderingInfo();
                $ret.e = this.b.op;
                $ret.c = this.b.g5;
                $ret.f = this.b.ot;
                return $ret;
            })());
            if (typeCast(XamDataChart.$, this.b.b5) !== null) {
                let b = this.b.b5;
                if (b.aaa && b.dm != 2 && b.dm != 1) {
                    a.a = true;
                }
            }
            return a;
        }
        bd() {
            return this.bm.an.d;
        }
        bb() {
            return this.bk.an.d;
        }
        g() {
            let a = ((() => {
                let $ret = new PathRenderingInfo();
                $ret.e = this.b.ol;
                $ret.c = this.b.ge;
                $ret.f = this.b.or;
                return $ret;
            })());
            if (typeCast(XamDataChart.$, this.b.b5) !== null) {
                let b = this.b.b5;
                if (b.aaa && b.dm != 2 && b.dm != 1) {
                    a.a = true;
                }
            }
            return a;
        }
        bc() {
            return this.bl.an.d;
        }
        h() {
            let a = ((() => {
                let $ret = new PathRenderingInfo();
                $ret.e = this.b.om;
                $ret.c = this.b.gh;
                $ret.f = this.b.os;
                return $ret;
            })());
            if (typeCast(XamDataChart.$, this.b.b5) !== null) {
                let b = this.b.b5;
                if (b.aaa && b.dm != 2 && b.dm != 1) {
                    a.a = true;
                }
            }
            return a;
        }
        get e() {
            return this.b.av().a;
        }
        a5(a, b, c) {
            this.e.ae = a;
            this.e.da = b;
            this.e.c9 = c;
            this.ap();
        }
        aj() {
            this.e.ab.clear();
            this.ap();
        }
        a1(a) {
            this.e.b1 = a;
            this.ap();
        }
        a6(a, b) {
            this.e.be = a;
            this.e.bf = b;
            this.e.at = false;
        }
        a0(a) {
            this.e.bl = a;
        }
        ag() {
        }
        v(a) {
            return null;
        }
        af() {
        }
        aw() {
        }
        n() {
            return true;
        }
        q() {
            return false;
        }
        o() {
            return false;
        }
        s(dataItem_) {
            return dataItem_;
        }
        u(dataItem_) {
            let a = this.s(dataItem_);
            if (this.b.az != null) {
                return this.b.az(a);
            }
            if (this.b.ai != null) {
                return this.b.ai.i(a);
            }
            return null;
        }
        t(dataItem_) {
            if (this.q() && this.o()) {
                return this.u(dataItem_);
            }
            else {
                let a = this.s(dataItem_);
                if (this.b.az != null) {
                    return this.b.az(a);
                }
                if (this.b.ai != null) {
                    return this.b.ai.i(a);
                }
            }
            let label_ = this.b.hx;
            let b = typeof dataItem_ === 'number' && typeof label_ === 'string';
            let labelValue_ = null;
            if (this.i != null) {
                labelValue_ = this.i.getPropertyValue(dataItem_);
                if ((labelValue_ === undefined)) {
                    labelValue_ = label_;
                }
            }
            else {
                labelValue_ = b ? stringFormat(label_, dataItem_) : (typeof dataItem_[label_] != 'undefined') ? dataItem_[label_] : label_;
                ;
            }
            if (this.b.expectFunctions) {
                if ((typeof (labelValue_) == 'function')) {
                    labelValue_ = labelValue_();
                }
            }
            return labelValue_;
        }
        aq(a, b) {
            this.l = a;
            this.m = b;
        }
        get isDirty() {
            return this._isDirty;
        }
        set isDirty(a) {
            this._isDirty = a;
        }
        ap() {
            if (this.b.b5 == null || this.l == null) {
                return;
            }
            if (!this.isDirty) {
                this.isDirty = true;
                this.b.b5.al.r(this.l, this.m);
            }
        }
        undirty(a) {
            this.isDirty = false;
            this.ax(a);
        }
        ax(a) {
            if (this.l == null) {
                return;
            }
            if (this.l.d) {
                if (this.b.b7 != null && this.b.b7.ij != 1) {
                    this.l.aa();
                    this.l.ab(this.b.b7.ij, this.b.b7.ij);
                }
                let b = this.b.b5.yx();
                if (a) {
                    if (!this.l.e) {
                        this.l.l(b.left, b.top, b.width, b.height);
                    }
                }
                if (a) {
                    if (this.b.b7.x7 != null && !this.b.o6.isEmpty) {
                        this.bn.o = this.b.o6.top;
                        this.bn.n = this.b.o6.left;
                        this.bn.width = this.b.o6.width;
                        this.bn.height = this.b.o6.height;
                        this.bn._fill = this.b.b7.x7;
                        this.l.w(this.bn);
                    }
                }
                this.l.aa();
                this.l.ah(this.b.o6);
                this.ay();
                this.l.z();
                if (this.b.b7 != null && this.b.b7.ij != 1) {
                    this.l.z();
                }
            }
            if (this.m.d) {
                if (this.b.b7 != null && this.b.b7.ij != 1) {
                    this.m.aa();
                    this.m.ab(this.b.b7.ij, this.b.b7.ij);
                }
                let c = this.bh;
                let d = this.b.b5.yx();
                if (!c.isEmpty && a) {
                    if (!this.m.e) {
                        this.m.l(d.left, d.top, d.width, d.height);
                    }
                }
                if (this.b.b7 != null && this.b.b7.ij != 1) {
                    this.m.z();
                }
            }
        }
        postRender() {
            this.e.co();
        }
        ay() {
            if (this.l.d) {
                this.bj._stroke = this.b.oe;
                this.bm._fill = this.b.oo;
                this.bl._stroke = this.b.od;
                this.bk._stroke = this.b.oc;
                this.bl.ad = this.b.gh;
                this.bk.ad = this.b.ge;
                this.bj.ad = this.b.g5;
                this.bl.ai = this.b.os;
                this.bk.ai = this.b.or;
                this.bj.ai = this.b.ot;
                this.bh = this.b.o6;
                this.l.t(this.bj);
                this.l.t(this.bm);
                this.l.t(this.bk);
                this.l.t(this.bl);
            }
        }
        an() {
            this.ap();
        }
        al(a) {
            if (a != null) {
                a.al.u(this);
                a.dw.ct();
            }
        }
        ae(a) {
            if (a != null) {
                a.al.o(this);
                this.ap();
            }
        }
        j() {
            if (this.b.b7 == null || this.b.b7.dw.j.ae == null) {
                return null;
            }
            return FontUtil.getFont(this.b.b7.dw.j.ae);
        }
        p() {
            return this.l == null;
        }
        av() {
            if (this.b.dc || this.b.du) {
                return;
            }
            if (this.b.j3 == null) {
                this.b.mg = null;
                this.b.d0 = true;
                this.b.lx();
                return;
            }
            if (this.b.mg == null) {
                let a = new TextBlock();
                a.al = this.b.j3;
                a.dataContext = this.b.b4;
                this.b.mg = a;
            }
            else {
                this.b.mg.al = this.b.j3;
                this.b.mg.dataContext = this.b.b4;
            }
            this.b.d0 = true;
            this.b.lx();
        }
        ad() {
            let a;
            let b = new AxisLabelSettings();
            if (this.b.dc) {
                a = "ui-angular-axis-labels";
                b.margin = 0;
            }
            else if (this.b.dy) {
                a = "ui-vertical-axis-labels";
                b.location = 2;
                b.leftMargin = 5;
                b.rightMargin = 5;
                b.topMargin = 2;
                b.bottomMargin = 2;
            }
            else if (this.b.bm == 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.ac(b, a);
        }
        a8() {
            if (this.b.b7 == null) {
                return;
            }
            let a = this.b.b7.z3;
            let b = a.fy;
            let c = a.fx;
            if (this.b.op == null) {
                if (b == null) {
                    this.b.op = a.fv;
                }
                else if (b.color.l != 0) {
                    this.b.op = b;
                }
            }
            if (this.b.ol == null) {
                if (c == null) {
                    this.b.ol = a.fv;
                }
                else if (c.color.l != 0) {
                    this.b.ol = c;
                }
            }
        }
        ac(a, b) {
            this.b.ha.startCSSQuery();
            let c = this.b.ha.getCssDefaultPropertyValue(b, "margin-top");
            let d = this.b.ha.getCssDefaultPropertyValue(b, "margin-right");
            let e = this.b.ha.getCssDefaultPropertyValue(b, "margin-bottom");
            let f = this.b.ha.getCssDefaultPropertyValue(b, "margin-left");
            let g = this.b.ha.getCssDefaultPropertyValue(b, "text-align");
            let h = this.b.ha.getCssDefaultPropertyValue(b, "vertical-align");
            let i = this.b.ha.getCssDefaultPropertyValue(b, "color");
            let j = FontUtil.getFontForClass(this.b.ha, b);
            this.b.ha.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.b.a4 = a;
        }
        preRender() {
            if (this.b.b7 != null) {
                this.b.b7.o5();
            }
        }
        isValid() {
            return this.b != null && !this.b.o6.isEmpty;
        }
        be(a) {
            return { $type: Point_$type, x: a.n, y: a.o };
        }
        bf() {
            return { $type: Point_$type, x: this.b.a1.c6.left, y: this.b.a1.c6.top };
        }
        bi() {
            let a = this.b.a1.c6;
            return a;
        }
        bg(a) {
            return { $type: Point_$type, x: a.n, y: a.o };
        }
        bp(a) {
            let b = this.b.a1.ag.u();
            let c = this.b.a1.ag.w();
            let d = this.b.a1.ag.v();
            let e = this.b.a1.ag.t();
            return new Thickness(1, b, c, d, e);
        }
        as() {
            if (FastReflectionHelper.needsHelper(this.b.hx)) {
                this.i = new FastReflectionHelper(true, this.b.hx);
            }
            else {
                this.i = null;
            }
        }
    }
    AxisView.$t = markType(AxisView, 'AxisView', Base.$, [ISchedulableRender_$type]);
    return AxisView;
})();
/**
 * @hidden
 */
export let CategoryAxisBaseView = /*@__PURE__*/ (() => {
    class CategoryAxisBaseView extends AxisView {
        constructor(a) {
            super(a);
            this.bq = null;
            this.bq = a;
        }
        v(a) {
            let b = 0;
            if (this.bq.categoryMode == 0) {
                b = truncate(Math.round(a));
            }
            else {
                b = truncate(Math.floor(a));
            }
            if (b < 0 || b > this.b.qb - 1) {
                return null;
            }
            let c = this.b.pm.item(b);
            let d = this.t(c);
            if (d == null) {
                return null;
            }
            return d.toString();
        }
        br(a) {
            let b = 0;
            let c = false;
            for (let d = 0; d < a.count; d++) {
                let e = typeCast(FrameworkElement.$, a._inner[d]);
                if (e == null) {
                    e = this.b.ci.item(d);
                    let f = a._inner[d] == null ? "" : a._inner[d].toString();
                    let g = e.al;
                    let h = 0;
                    let 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.e.ab.add(e);
                }
            }
            if (c) {
                this.b.d0 = true;
            }
            this.b.kd();
            return b;
        }
    }
    CategoryAxisBaseView.$t = markType(CategoryAxisBaseView, 'CategoryAxisBaseView', AxisView.$);
    return CategoryAxisBaseView;
})();
/**
 * @hidden
 */
export let HorizontalAxisLabelPanelBaseView = /*@__PURE__*/ (() => {
    class HorizontalAxisLabelPanelBaseView extends AxisLabelPanelBaseView {
        constructor(a) {
            super(a);
            this.az = null;
            this.az = a;
        }
        a1() {
        }
        a0() {
            return false;
        }
        a2(a) {
            let b = this.a.bx();
            let c, d;
            c = this.az.dm();
            d = this.az.dj();
            let e = this.a.ah != null ? this.a.ah.verticalAlignment : 1;
            let f = this.a.bi;
            let g = a.count;
            let h = this.a.c6;
            let i = this.az.dl();
            let j = i / 2;
            for (let k = 0; k < g; k++) {
                let l = a._inner[k];
                let 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;
})();
/**
 * @hidden
 */
export let NumericAxisBaseView = /*@__PURE__*/ (() => {
    class NumericAxisBaseView extends AxisView {
        constructor(a) {
            super(a);
            this.bq = null;
            this.bq = a;
        }
        br() {
        }
        q() {
            return this.bq.qf;
        }
        o() {
            if (this.bq.pk != null) {
                return true;
            }
            if (this.bq.pj != null) {
                return true;
            }
            return false;
        }
        u(dataItem_) {
            if (this.bq.pk != null) {
                return this.bq.pk(dataItem_);
            }
            if (this.bq.pj != null) {
                return this.bq.pj.i(dataItem_);
            }
            return null;
        }
        v(a) {
            let b = this.bq.pw.d(this.bq.o6, this.bq.b7.yr, this.bq.o1(), this.bq.o0());
            return this.bq.pw.w(b, a, -1, NaN);
        }
    }
    NumericAxisBaseView.$t = markType(NumericAxisBaseView, 'NumericAxisBaseView', AxisView.$);
    return NumericAxisBaseView;
})();
/**
 * @hidden
 */
export let VerticalAxisLabelPanelView = /*@__PURE__*/ (() => {
    class VerticalAxisLabelPanelView extends AxisLabelPanelBaseView {
        constructor(a) {
            super(a);
            this.az = null;
            this.az = a;
        }
        a0() {
        }
        e() {
            let a = this.a.ae.b7.getFontInfo();
            if (this.a.ae.b4 != null && this.a.ae.b4.textStyle != null) {
                a = this.a.ae.b4.h(this.a.ae.b7.dw.j.ae);
            }
            else {
                let b = this.a.ae.b7.d2();
                if (b != null) {
                    a = b;
                }
            }
            return a;
        }
        ay() {
            return this.a.ae.b7.zd();
        }
        as() {
            let a = this.a.ae.b5.getFontBrush();
            if (this.a.ae.b4 != null && this.a.ae.b4.textColor != null) {
                a = this.a.ae.b4.textColor;
            }
            else {
                let b = this.a.ae.b7.xz();
                if (b != null) {
                    a = b;
                }
            }
            return a;
        }
        a1(a, b) {
            let c, d;
            c = this.az.dg();
            d = this.az.di();
            let e = this.a.ah != null ? this.a.ah.horizontalAlignment : 1;
            let f = this.a.bi;
            let g = this.az.dj();
            let h = g / 2;
            let i = this.a.c6;
            for (let j = 0; j < a.count; j++) {
                let k = a._inner[j];
                let 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;
})();
/**
 * @hidden
 */
export let XamDataChartView = /*@__PURE__*/ (() => {
    class XamDataChartView extends SeriesViewerView {
        constructor(a) {
            super(a);
            this.fq = null;
            this.fz = null;
            this.fv = null;
            this.fw = null;
            this.fy = null;
            this.fx = null;
            this.fs = 0;
            this.ft = 0;
            this.fr = null;
            this.fq = a;
        }
        fu(a) {
            this.p.al.s();
        }
        dv() {
            super.dv();
            if (this.b.count == 0 && this.y != null) {
                if (this.p.ij != 1) {
                    this.y.aa();
                    this.y.ab(this.p.ij, this.p.ij);
                }
                if (!this.y.e) {
                    this.y.l(0, 0, this.bb, this.ba);
                }
                if (this.p.ij != 1) {
                    this.y.z();
                }
            }
        }
        d7() {
            let a, b;
            let c = 1, d = 0;
            let e = false;
            let f = this.j.e();
            let g;
            let 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.jl)) {
                this.p.jl = g[0];
            }
            if (isNaN_(this.p.jc)) {
                this.p.jc = g[1];
            }
            if (isNaN_(this.p.ir)) {
                this.p.ir = g[2];
            }
            if (isNaN_(this.p.i7)) {
                this.p.i7 = g[3];
            }
            this.fq.adv = f.i;
            this.fq.adt = AxisDefaults.axis_MajorBrush;
            this.fq.adu = AxisDefaults.axis_MinorBrush;
            this.fq.aaa = e;
            this.fy = a;
            this.fx = b;
            this.fq.ag = f.a;
            this.fq.aj = f.f;
            this.fq.ah = f.b != null ? f.b : new BrushCollection();
            this.fq.ai = f.c != null ? f.c : new BrushCollection();
            if (this.fq.ah.count == 0) {
                for (let i = 0; i < f.a.count; i++) {
                    this.fq.ah.add(f.a.item(i));
                }
            }
            if (f.c.count == 0) {
                for (let j = 0; j < f.f.count; j++) {
                    this.fq.ai.add(f.f.item(j));
                }
            }
            this.fw = f.j;
            this.fz = f.k;
            this.fr = f.h;
            this.fv = f.i;
            this.fs = c;
            for (let k of fromEnum(this.fq.b9)) {
                k.sv();
            }
            this.ft = d;
        }
        d4() {
            this.fh.ad = Defaults.crosshairLineThickness;
            this.fg.ad = Defaults.crosshairLineThickness;
            this.fh._stroke = this.p.ye != null ? this.p.ye : this.fw;
            this.fg._stroke = this.p.x4 != null ? this.p.x4 : this.fw;
            super.d4();
        }
    }
    XamDataChartView.$t = markType(XamDataChartView, 'XamDataChartView', SeriesViewerView.$);
    return XamDataChartView;
})();
/**
 * @hidden
 */
export let SeriesView = /*@__PURE__*/ (() => {
    class SeriesView extends Base {
        constructor(a) {
            super();
            this.f = null;
            this.v = false;
            this.i = null;
            this.d = null;
            this._isDirty = false;
            this.cb = null;
            this.b1 = null;
            this.ad = 0;
            this.b6 = Rect.empty;
            this.b0 = new Brush();
            this.g = new SeriesComponentsFromView();
            this.m = null;
            this.n = null;
            this.b7 = null;
            this.b8 = null;
            this.o = false;
            this.a = null;
            this.u = false;
            this.q = false;
            this.s = false;
            this.al = null;
            this.y = new List$1(ITrendLineManager_$type, 0);
            this.p = false;
            this.z = new List$1(FrameworkElement.$, 0);
            this.x = new Dictionary$2(FontInfo.$, Tuple$2.$.specialize(Number_$type, FontInfo.$), 0);
            this.ad = NaN;
            this.u = true;
            this.f = a;
            this.t = false;
            this.cb = new Rectangle();
            this.v = false;
        }
        getDefaultTooltipTemplate() {
            return this.f.ba.a$u(this.f);
        }
        a1() {
            if (this.f.fl) {
                this.f.ba.a$ab(this.f);
            }
        }
        k() {
            return new DOMExecutionContext(this.f.dc.dw.j.ae);
        }
        get j() {
            if (this.i == null) {
                this.i = this.k();
            }
            return this.i;
        }
        ap(a, b) {
            Series.pz(b, this.f.dc, false);
            b.dc = this.f.dc;
            b.c4 = this.f.c4;
            if (b.dc != null) {
                b.dc.on(b);
            }
        }
        au(a) {
            Series.pz(a, this.f.dc, true);
            a.pi(true, a.cw);
            a.dc = null;
            a.c4 = null;
            a.itemsSource = null;
            a.legend = null;
            if (a.dc != null) {
                a.dc.s9(a);
            }
        }
        a4() {
            if (!this.t) {
                this.f.ir = 0.8;
                this.f.c2 = 0;
                this.f.c1 = 1;
                this.d = new DataContext();
                this.d.series = this.f;
                this.f.df = EasingFunctions.cubicEase;
                this.an();
            }
        }
        getEffectiveViewport() {
            return this.f.getEffectiveViewport1(this);
        }
        bb() {
            this.a2();
        }
        as() {
        }
        getMainContentViewport() {
            return this.f.getMainContentViewport();
        }
        get ae() {
            if (this.f.dc != null) {
                return this.f.dc.dw.j.ae;
            }
            return null;
        }
        l(a) {
            return FontUtil.getFontInfoFromString(this.ae, a);
        }
        get isDirty() {
            return this._isDirty;
        }
        set isDirty(a) {
            this._isDirty = a;
        }
        get_index() {
            if (this.f == null || this.f.dc == null) {
                return 0;
            }
            if (this.f.dc.f6) {
                if (this.f.ff) {
                    return this.f.dc.b9.indexOf(this.f);
                }
                else {
                    let a = this.f.dc.b9.indexOf(this.f);
                    if (a >= 0) {
                        return a;
                    }
                    for (let b = 0; b < this.f.dc.b9.count; b++) {
                        if (this.f.dc.b9._inner[b].ff) {
                            let c = this.f.dc.b9._inner[b].bp();
                            if (c == this.f) {
                                return b;
                            }
                        }
                    }
                    return a;
                }
            }
            let d = typeCast(XamDataChart.$, this.f.da);
            let e = 0;
            if (d != null) {
                if (d.zu == 2 || d.zu == 0) {
                    e = d.zq.count;
                }
            }
            let f = 0;
            for (let g = 0; g < this.f.dc.b9.count; g++) {
                if (this.f.dc.b9._inner[g] == this.f) {
                    break;
                }
                if (this.f.dc.b9._inner[g].isStacked) {
                    f += this.f.dc.b9._inner[g].kl();
                }
                else if (this.f.dc.b9._inner[g].ei) {
                    if (this.f.bo != null && this.f.bo == this.f.dc.b9._inner[g]) {
                        f += 1;
                        for (let h = 0; h < this.f.dc.b9._inner[g].actualLayers.count; h++) {
                            if (this.f.dc.b9._inner[g].actualLayers._inner[h].target == this.f) {
                                return e + f + (h);
                            }
                        }
                    }
                    else {
                        f += this.f.dc.b9._inner[g].actualLayers.count + 1;
                    }
                }
                else {
                    f++;
                }
            }
            return e + f;
        }
        get index() {
            return this.get_index();
        }
        a2() {
            if (this.f.dc == null) {
                return;
            }
            if (!this.isDirty) {
                this.isDirty = true;
                this.a.r(this.m, this.n);
            }
        }
        undirty(a) {
            this.isDirty = false;
            this.bh(a);
        }
        a6() {
            this.a2();
        }
        b5() {
            if (this.b1 == null) {
                this.b1 = ((() => {
                    let $ret = new Brush();
                    $ret.color = Color.u(0, 0, 0, 0);
                    return $ret;
                })());
            }
            return this.b1;
        }
        b2(a) {
            if (a != null) {
                let b = BrushUtil.p(a, 1);
                return b;
            }
            else {
                return null;
            }
        }
        ac() {
            if (!isNaN_(this.ad)) {
                return this.ad;
            }
            if (this.f.dc != null) {
                return this.f.dc.ij;
            }
            else {
                return 1;
            }
        }
        bh(a) {
            if (this.m == null) {
                return;
            }
            if (this.b6.isEmpty) {
                this.b6 = this.b9;
            }
            let b = this.b6;
            let c = this.f.dc.yx();
            let d = c.left;
            let e = c.top;
            let f = c.width;
            let g = c.height;
            let h = this.ac();
            if (this.s) {
                d = this.b9.left;
                e = this.b9.top;
                f = this.b9.width;
                g = this.b9.height;
            }
            if (this.m.d) {
                if (h != 1) {
                    this.m.aa();
                    this.m.ab(h, h);
                }
                if (a) {
                    if (!this.m.e) {
                        this.m.l(d, e, f, g);
                    }
                }
                if (a) {
                    if (this.f.dc.x7 != null && !this.b9.isEmpty) {
                        this.cb.o = this.b9.top;
                        this.cb.n = this.b9.left;
                        this.cb.width = this.b9.width;
                        this.cb.height = this.b9.height;
                        this.cb._fill = this.f.dc.x7;
                        this.m.w(this.cb);
                    }
                }
                if (h != 1) {
                    this.m.z();
                }
            }
            if (this.n != null && this.u) {
                if (this.n.d) {
                    if (this.f.dc != null && h != 1) {
                        this.n.aa();
                        this.n.ab(h, h);
                    }
                    if (!b.isEmpty && a) {
                        if (!this.n.e) {
                            this.n.l(b.left, b.top, b.width, b.height);
                        }
                    }
                    this.bo(true);
                    this.bj(this.n, true);
                    this.bi(this.n, true);
                    if (h != 1) {
                        this.n.z();
                    }
                }
            }
            if (this.m.d && this.u) {
                if (h != 1) {
                    this.m.aa();
                    this.m.ab(h, h);
                }
                this.m.aa();
                if (!this.t && Rect.l_op_Inequality(this.f.w3, null) && !this.f.w3.isEmpty && (this.f.w3.width != 1 || this.f.w3.height != 1)) {
                    this.m.ah(new Rect(0, this.b9.left + this.b9.width * this.f.w3.left, this.b9.top + this.b9.height * this.f.w3.top, this.b9.width * this.f.w3.width, this.b9.height * this.f.w3.height));
                }
                else {
                    this.m.ah(this.b9);
                }
                this.bo(false);
                this.m.ag(this.f._opacity);
                if (this.f.e8 && this.f.e9 && !this.t) {
                    if (this.f.hi) {
                        this.m.p(this.f.wl.colorString, 0, this.f.jw, this.f.jx);
                        let i = this.f.dc.dw.j.x;
                        let j = this.f.dc.dw.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.bj(i, false);
                        this.bi(i, false);
                        this.m.n(j.getNativeElement(), 1, 0, 0, c.width, c.height);
                        if (h != 1) {
                            i.z();
                        }
                    }
                    else {
                        this.m.p(this.f.wl.colorString, this.f.jv, this.f.jw, this.f.jx);
                        this.bj(this.m, false);
                        this.bi(this.m, false);
                    }
                    this.m.m();
                }
                else {
                    this.bj(this.m, false);
                    this.bi(this.m, false);
                }
                this.m.ag(1);
                this.m.z();
                if (h != 1) {
                    this.m.z();
                }
            }
        }
        br(a, b, c) {
            if (c) {
                this.bt(a, b);
            }
            else {
                this.bs(a, b);
            }
        }
        bu(a, b, c) {
            if (c) {
                this.bw(a, b);
            }
            else {
                this.bv(a, b);
            }
        }
        ai(a, b) {
            if (b) {
                return this.aj(a);
            }
            else {
                return this.ak(a);
            }
        }
        aj(a) {
            return null;
        }
        ak(a) {
            return null;
        }
        bs(a, b) {
        }
        bv(a, b) {
        }
        bt(a, b) {
        }
        bw(a, b) {
        }
        bo(a) {
            if (a) {
                this.bq();
            }
            else {
                this.bp();
            }
        }
        bp() {
        }
        bq() {
        }
        b4(a) {
            return this.b3();
        }
        b3() {
            let a = this.f.kp;
            let num_ = (a + 1) * 1000;
            let b = ((num_ & 0x3F) << 2);
            num_ = (num_ >> 6);
            let c = ((num_ & 0x3F) << 2);
            num_ = (num_ >> 6);
            let d = ((num_ & 0x3F) << 2);
            this.b0._fill = "rgb(" + b + "," + c + "," + d + ")";
            return this.b0;
        }
        bj(a, b) {
            this.b6 = this.b9;
        }
        bi(a, b) {
        }
        a9() {
        }
        ay() {
        }
        az() {
        }
        h() {
            return this.g;
        }
        bm(a) {
        }
        w() {
            return true;
        }
        a8() {
        }
        a7() {
        }
        bk() {
            this.f.vt = null;
        }
        aq() {
            this.f.vt = this.f.vz;
        }
        bl() {
            this.f.vx = null;
        }
        ar() {
            this.f.vx = this.f.wf;
        }
        c(a) {
            if (typeCast(DataContext.$, a) !== null) {
                return a;
            }
            return null;
        }
        a3(a, b) {
            this.m = a;
            this.n = b;
        }
        get b9() {
            return this.b7;
        }
        set b9(a) {
            this.b7 = a;
        }
        get_ca() {
            if (this.s) {
                return this.b8;
            }
            else if (this.t) {
                return XamDataChart.y4;
            }
            else {
                return this.f.dc != null ? this.f.dc.yr : Rect.empty;
            }
        }
        get ca() {
            return this.get_ca();
        }
        get t() {
            return this.o;
        }
        set t(a) {
            this.o = a;
        }
        at(a) {
            if (a != null) {
                this.a.u(this);
                if (this.f.cv != null) {
                    this.f.cv.a.u(this.f.cv);
                }
            }
        }
        ao(a) {
            if (a != null) {
                if (this.f.hg) {
                    this.m = this.f.dc.dw.z;
                    a.dw.a.o(this);
                    this.a = a.dw.a;
                }
                else {
                    this.m = this.f.dc.dw.y;
                    a.al.o(this);
                    this.a = a.al;
                }
                if (this.f.cv != null) {
                    a.am.o(this.f.cv);
                    this.f.cv.a = a.am;
                    this.f.cv.a2();
                }
                if (this.f.fl) {
                    for (let b of fromEnum(this.f.ba.a$k.keys)) {
                        a.ak.o(this.f.ba.a$k.item(b));
                        this.f.ba.a$k.item(b).a = a.ak;
                        this.f.ba.a$k.item(b).a2();
                    }
                }
                this.a2();
            }
        }
        postRender() {
            this.bc();
        }
        bc() {
        }
        b(a) {
            return null;
        }
        be(a) {
            this.f.cv.m = a.a;
        }
        ax(a) {
        }
        bx() {
            if (this.q) {
                return;
            }
            if (this.f.dc != null) {
                let a = (this.f.legend != null) ? this.f.legend : this.f.dc.legend;
                if (a != null && this.f.tc != null && a.containsChild(this.f.tc)) {
                    a.removeChild(this.f.tc);
                    let b = this.f.k8();
                    b.content.actualItemBrush = this.f.vt;
                    b.content.outline = this.f.vx;
                    b.content.thickness = this.f.il;
                    a.addChildInOrder(this.f.tc, this.f);
                    a.flushTextContentChangedCheck();
                }
            }
        }
        a5() {
            this.f.o9(this.f.a5, this.f.a5);
        }
        ba() {
            this.bx();
        }
        getViewInfo(a, b) {
            a = this.b9;
            b = this.ca;
            return {
                p0: a,
                p1: b
            };
        }
        r() {
            return this.m != null;
        }
        by() {
            this.u = this.f._visibility == 0;
            this.a2();
        }
        bg() {
            this.f.ba.a$aq(this.f);
        }
        an() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.f.wl = a;
            this.f.jv = 5;
            this.f.jw = 5;
            this.f.jx = 5;
        }
        a0() {
        }
        preRender() {
            if (this.f.dc != null && !this.t) {
                this.f.dc.o5();
            }
        }
        isValid() {
            return true;
        }
        bd(a) {
            this.m = a.a;
        }
        bz(type_) {
            let legendTemplates_ = TypeRegistrar.get("LegendTemplates");
            let a = (legendTemplates_.resolveLegendItemTemplate(type_));
            return a;
        }
        get aa() {
            return this.y;
        }
        e() {
            let a = this.f.bd();
            if (a != null) {
                a.g$d = true;
                this.y.add(a);
                return a;
            }
            return null;
        }
        bf(a) {
            if (a != null) {
                this.y.remove(a);
            }
        }
        bn(a, b, c) {
            if (this.p) {
                this.z.add(a);
            }
            a.n = b;
            a.o = c;
        }
        av(a, b) {
            a.dataContext = b;
        }
        aw(a, b) {
            a.ag = true;
            let c = this.m.aj(a, this.ab(b), true);
        }
        cc(a, b) {
            this.m.af(b);
            let c = new TextBlock();
            c.al = a;
            let d = this.m.aj(c, this.ab(b), true);
            return new Size(1, d.c, d.b);
        }
        ab(a) {
            if (this.x.containsKey(a)) {
                let b = this.x.item(a);
                if (b.d.j == a.j) {
                    return b.c;
                }
            }
            let c = 20;
            let d = new Tuple$2(Number_$type, FontInfo.$, c, a);
            this.x.item(a, d);
            return c;
        }
    }
    SeriesView.$t = markType(SeriesView, 'SeriesView', Base.$, [ISchedulableRender_$type, IProvidesViewport_$type]);
    return SeriesView;
})();
/**
 * @hidden
 */
export let MarkerSeriesView = /*@__PURE__*/ (() => {
    class MarkerSeriesView extends SeriesView {
        constructor(a) {
            super(a);
            this.ch = null;
            this.cm = 1;
            this.co = Defaults.series_MarkerThickness;
            this.cn = 3;
            this.cl = null;
            this.ck = false;
            this.cd = new Marker();
            this.c6 = null;
            this.cd = new Marker();
            this.cd.content = new DataContext();
            this.ch = a;
        }
        a4() {
            super.a4();
            this.cl = new List$1(Marker.$, 0);
            this.c6 = ((() => {
                let $ret = new DataTemplate();
                $ret.render = MarkerTemplates.c;
                $ret.measure = MarkerTemplates.b;
                return $ret;
            })());
        }
        cy() {
            for (let a of fromEnum(this.cl)) {
                a.ah = this.ch.ym;
            }
            this.a2();
        }
        c8() {
            if (this.m == null) {
                return new Size(1, 0, 0);
            }
            let a = new DataTemplatePassInfo();
            a.isHitTestRender = false;
            a.context = this.m.h();
            a.viewportTop = this.b9.top;
            a.viewportLeft = this.b9.left;
            a.viewportWidth = this.b9.width;
            a.viewportHeight = this.b9.height;
            a.passID = "TestMeasure";
            let b = new DataTemplateRenderInfo();
            b.isHitTestRender = false;
            b.passInfo = a;
            let c = new DataTemplateMeasureInfo();
            c.passInfo = a;
            let d = this.m.h();
            c.context = d;
            b.context = d;
            let e = 0;
            let f = 0;
            if (this.ch.ym != null && this.ch.ym.passStarting != null) {
                this.ch.ym.passStarting(a);
            }
            let g = this.ch.ym;
            if (this.cl.count > 0) {
                let h = this.cl._inner[0];
                c.data = h.content;
                c.width = h.width;
                c.height = h.height;
                c.renderOffsetX = 0;
                c.renderOffsetY = 0;
                c.renderContext = this.m;
                g = h.ah;
            }
            let i = 0;
            let j = 0;
            if (g != null && g.measure != null) {
                g.measure(c);
                i = c.width;
                j = c.height;
            }
            if (this.ch.ym != null && this.ch.ym.passCompleted != null) {
                this.ch.ym.passCompleted(a);
            }
            return new Size(1, i, j);
        }
        c5(a) {
        }
        cg() {
            let a = new Marker();
            a.content = ((() => {
                let $ret = new DataContext();
                $ret.series = this.f;
                return $ret;
            })());
            a.ah = this.ch.ym;
            this.cl.add(a);
            return a;
        }
        cx(a) {
            for (let b = this.cl.count - 1; b >= 0; b--) {
                let c = this.cl._inner[b];
                a(c);
            }
        }
        c1(a) {
            a._visibility = 0;
        }
        c3(a) {
            a._visibility = 1;
        }
        c2(a) {
            this.cl.remove(a);
        }
        ci() {
            return this.ch.yn != null;
        }
        cv() {
            this.ch.yl = null;
        }
        cp() {
            this.ch.yl = this.ch.yn;
        }
        c7(a) {
            let b = a.n;
            let c = a.o;
            let d = a.m;
            let e = a.l;
            return new Rect(0, b - d / 2, c - d / 2, d, e);
        }
        cs(a) {
            if (this.ch.dc == null) {
                return;
            }
            switch (a) {
                case SeriesViewer.$$p[2]:
                    this.ch.yl = this.ch.dc.uh;
                    break;
                case SeriesViewer.$$p[50]:
                    this.ch.yl = this.ch.dc.uq;
                    break;
                case SeriesViewer.$$p[34]:
                    this.ch.yl = this.ch.dc.un;
                    break;
                case SeriesViewer.$$p[44]:
                    this.ch.yl = this.ch.dc.uo;
                    break;
                case SeriesViewer.$$p[5]:
                    this.ch.yl = this.ch.dc.ui;
                    break;
                case SeriesViewer.$$p[26]:
                    this.ch.yl = this.ch.dc.ul;
                    break;
                case SeriesViewer.$$p[10]:
                    this.ch.yl = this.ch.dc.uj;
                    break;
                case SeriesViewer.$$p[47]:
                    this.ch.yl = this.ch.dc.up;
                    break;
                case SeriesViewer.$$p[27]:
                    this.ch.yl = this.ch.dc.um;
                    break;
                case SeriesViewer.$$p[11]:
                    this.ch.yl = this.ch.dc.uk;
                    break;
            }
        }
        ct() {
            this.ch.y2 = null;
        }
        cq() {
            if (!isNaN_(this.f.ij) && this.f.ij != 1) {
                let a = BrushUtil.s(this.ch.y4, this.f.ij);
                this.ch.y2 = a;
            }
            else {
                this.ch.y2 = this.ch.y4;
            }
        }
        cu() {
            this.ch.y3 = null;
        }
        cr() {
            this.ch.y3 = this.ch.y5;
        }
        c4() {
            this.a2();
        }
        bv(a, b) {
            super.bv(a, b);
            if (!this.ck) {
                let c = a;
                let d = c.content;
                if (d != null) {
                    d.actualItemBrush = this.ch.y2;
                    if (d.itemBrush != null) {
                        d.actualItemBrush = d.itemBrush;
                    }
                    d.outline = this.ch.y3;
                    d.thickness = this.ch.x4;
                }
            }
        }
        bw(a, b) {
            super.bw(a, b);
            let c = a;
            this.cd._visibility = c._visibility;
            this.cd.ah = c.ah;
            this.cd.width = c.width;
            this.cd.height = c.height;
            this.cd.m = c.m;
            this.cd.l = c.l;
            this.cd.n = c.n;
            this.cd.o = c.o;
            let d = this.b4(b);
            let e = this.cd.content;
            let 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.cm + this.cn;
            }
        }
        b(a) {
            if (a >= 0 && a < this.cl.count) {
                return this.cl._inner[a].content;
            }
            return super.b(a);
        }
        bi(a, b) {
            super.bi(a, b);
            if (a.d) {
                let c = new DataTemplatePassInfo();
                c.isHitTestRender = b;
                c.context = a.h();
                c.viewportTop = this.b9.top;
                c.viewportLeft = this.b9.left;
                c.viewportWidth = this.b9.width;
                c.viewportHeight = this.b9.height;
                c.passID = "Markers";
                let d = new DataTemplateRenderInfo();
                d.isHitTestRender = b;
                d.passInfo = c;
                let e = new DataTemplateMeasureInfo();
                e.passInfo = c;
                let f = false;
                let g = a.h();
                e.context = g;
                d.context = g;
                let h = 0;
                let i = 0;
                if (this.ch.ym != null && this.ch.ym.passStarting != null) {
                    this.ch.ym.passStarting(c);
                }
                for (let j = 0; j < this.cl.count; j++) {
                    let k = this.cl._inner[j];
                    if (k._visibility == 1) {
                        continue;
                    }
                    this.bu(k, j, b);
                    if (b) {
                        k = this.cd;
                    }
                    if (!f) {
                        e.data = k.content;
                        e.width = k.width;
                        e.height = k.height;
                        e.renderOffsetX = 0;
                        e.renderOffsetY = 0;
                        e.renderContext = a;
                        let 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.ch.ym != null && this.ch.ym.passCompleted != null) {
                    this.ch.ym.passCompleted(c);
                }
            }
        }
        cz(a) {
            a.create = runOn(this, this.cg);
            a.destroy = runOn(this, this.c2);
            a.activate = runOn(this, this.c1);
            a.disactivate = runOn(this, this.c3);
        }
        c0(a) {
            a.create = runOn(this, this.cg);
            a.destroy = runOn(this, this.c2);
            a.activate = runOn(this, this.c1);
            a.disactivate = runOn(this, this.c3);
        }
        ce(a) {
            let b = this.cf(a, 0);
            if (b == null) {
                b = this.cf(a, 3);
            }
            return b;
        }
        cf(a, b) {
            let c;
            let d;
            let e;
            let f;
            for (let g = this.cl.count - 1; g >= 0; g--) {
                let h = this.cl._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.ch.xx) {
                    if (this.cj(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;
        }
        cj(a, b, c, d, e) {
            let f = e * e;
            let g = (a - c) * (a - c) + (b - d) * (b - d);
            return g < f;
        }
    }
    MarkerSeriesView.$t = markType(MarkerSeriesView, 'MarkerSeriesView', SeriesView.$);
    return MarkerSeriesView;
})();
/**
 * @hidden
 */
export let ChartAxisRangeChangedEventArgs = /*@__PURE__*/ (() => {
    class ChartAxisRangeChangedEventArgs extends EventArgs {
        constructor(a, b, c, d, e, f) {
            super();
            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;
        }
        get chart() {
            return this._chart;
        }
        set chart(a) {
            this._chart = a;
        }
        get axis() {
            return this._axis;
        }
        set axis(a) {
            this._axis = a;
        }
        get oldMinimumValue() {
            return this._oldMinimumValue;
        }
        set oldMinimumValue(a) {
            this._oldMinimumValue = a;
        }
        get minimumValue() {
            return this._minimumValue;
        }
        set minimumValue(a) {
            this._minimumValue = a;
        }
        get oldMaximumValue() {
            return this._oldMaximumValue;
        }
        set oldMaximumValue(a) {
            this._oldMaximumValue = a;
        }
        get maximumValue() {
            return this._maximumValue;
        }
        set maximumValue(a) {
            this._maximumValue = a;
        }
    }
    ChartAxisRangeChangedEventArgs.$t = markType(ChartAxisRangeChangedEventArgs, 'ChartAxisRangeChangedEventArgs', EventArgs.$);
    return ChartAxisRangeChangedEventArgs;
})();
(function (v) { callStaticConstructors(); })(true);