import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { IgxAxisComponent } from "./igx-axis-component";
import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { CategoryToolTipLayer } from "./CategoryToolTipLayer";
import { ensureBool } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
 * Represents an annotation layer that displays grouped tooltips for series that use a category axis.
*/
export let IgxCategoryToolTipLayerComponent = /*@__PURE__*/ (() => {
    class IgxCategoryToolTipLayerComponent extends IgxAnnotationLayerComponent {
        constructor() {
            super();
        }
        createImplementation() {
            return new CategoryToolTipLayer();
        }
        /**
                                     * @hidden
                                     */
        get i() {
            return this._implementation;
        }
        /**
         * Gets whether the series is an annotation layer displayed only when hovering over the chart.
        */
        get isAnnotationHoverLayer() {
            return this.i.db;
        }
        /**
         * Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
        */
        get isDefaultTooltipBehaviorDisabled() {
            return this.i.dl;
        }
        /**
         * Gets or sets the Axis to target this annotation to. If null, this annotation layer will not render content.
        */
        get targetAxis() {
            const r = this.i.rc;
            if (r == null) {
                return null;
            }
            if (!r.externalObject) {
                let e = IgxAxisComponent._createFromInternal(r);
                if (e) {
                    e._implementation = r;
                }
                r.externalObject = e;
            }
            return r.externalObject;
        }
        set targetAxis(v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.rc = null : this.i.rc = v.i;
        }
        /**
         * Gets or sets whether to use value interpolation when drawing the tooltips.
        */
        get useInterpolation() {
            return this.i.rg;
        }
        set useInterpolation(v) {
            this.i.rg = ensureBool(v);
        }
        findByName(name) {
            var baseResult = super.findByName(name);
            if (baseResult) {
                return baseResult;
            }
            if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
                return this.targetAxis;
            }
            return null;
        }
        _styling(container, component, parent) {
            super._styling(container, component, parent);
            this._inStyling = true;
            if (this.targetAxis && this.targetAxis._styling) {
                this.targetAxis._styling(container, component, this);
            }
            this._inStyling = false;
        }
        /**
         * Hides any tooltips presented by the layer, if any.
        
        */
        hideToolTips() {
            this.i.lg();
        }
    }
    IgxCategoryToolTipLayerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxCategoryToolTipLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    IgxCategoryToolTipLayerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.14", type: IgxCategoryToolTipLayerComponent, selector: "igx-category-tool-tip-layer", inputs: { targetAxis: "targetAxis", useInterpolation: "useInterpolation" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
    return IgxCategoryToolTipLayerComponent;
})();
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.14", ngImport: i0, type: IgxCategoryToolTipLayerComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'igx-category-tool-tip-layer',
                    template: ``,
                    providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }],
                    changeDetection: ChangeDetectionStrategy.OnPush
                }]
        }], ctorParameters: function () { return []; }, propDecorators: { targetAxis: [{
                type: Input
            }], useInterpolation: [{
                type: Input
            }] } });
