import { Component, HostListener, Input } from '@angular/core';
import { CdkOverlayOrigin } from '@angular/cdk/overlay';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/cdk/overlay";
export class TooltipComponent {
    constructor(elementRef) {
        this._opened = false;
        this.overlayOrigin = new CdkOverlayOrigin(elementRef);
    }
    ngOnInit() {
    }
    get opened() {
        return this._opened;
    }
    open() {
        this._opened = true;
    }
    close() {
        this._opened = false;
    }
    toggle() {
        if (this.opened) {
            this.close();
        }
        else {
            this.open();
        }
    }
    onClick() {
        this.toggle();
    }
}
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TooltipComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: TooltipComponent, selector: "ui-tooltip, [ui-tooltip]", inputs: { text: "text", template: "template" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0, template: "<ng-content></ng-content>\n\n<ng-template\n  cdkConnectedOverlay\n  cdkConnectedOverlayLockPosition\n  cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n  cdkConnectedOverlayHasBackdrop\n  [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n  [cdkConnectedOverlayOpen]=\"opened\"\n  (backdropClick)=\"close()\">\n  <div class=\"container\">\n    <ng-container *ngIf=\"text\">{{text}}</ng-container>\n    <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n  </div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}.container{font-size:var(--font-size-xs);margin:10px 0;padding:8px;border-radius:var(--radius-small);border:1px var(--color-contrast-5) solid;background:var(--color-contrast-2);box-shadow:0 1px 4px #0000000a,0 8px 24px #0000000a,0 4px 24px #0000000a;overflow:auto;opacity:.9}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TooltipComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ui-tooltip, [ui-tooltip]', template: "<ng-content></ng-content>\n\n<ng-template\n  cdkConnectedOverlay\n  cdkConnectedOverlayLockPosition\n  cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n  cdkConnectedOverlayHasBackdrop\n  [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n  [cdkConnectedOverlayOpen]=\"opened\"\n  (backdropClick)=\"close()\">\n  <div class=\"container\">\n    <ng-container *ngIf=\"text\">{{text}}</ng-container>\n    <ng-container *ngIf=\"template\" [ngTemplateOutlet]=\"template\"></ng-container>\n  </div>\n</ng-template>\n\n", styles: [":host{cursor:pointer}.container{font-size:var(--font-size-xs);margin:10px 0;padding:8px;border-radius:var(--radius-small);border:1px var(--color-contrast-5) solid;background:var(--color-contrast-2);box-shadow:0 1px 4px #0000000a,0 8px 24px #0000000a,0 4px 24px #0000000a;overflow:auto;opacity:.9}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { text: [{
                type: Input,
                args: ['text']
            }], template: [{
                type: Input,
                args: ['template']
            }], onClick: [{
                type: HostListener,
                args: ['click']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi91aS1raXQvc3JjL2xpYi90b29sdGlwL3Rvb2x0aXAuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vdWkta2l0L3NyYy9saWIvdG9vbHRpcC90b29sdGlwLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQWMsWUFBWSxFQUFFLEtBQUssRUFBc0IsTUFBTSxlQUFlLENBQUM7QUFDOUYsT0FBTyxFQUFDLGdCQUFnQixFQUFDLE1BQU0sc0JBQXNCLENBQUM7Ozs7QUFPdEQsTUFBTSxPQUFPLGdCQUFnQjtJQVkzQixZQUFZLFVBQXNCO1FBRjFCLFlBQU8sR0FBRyxLQUFLLENBQUM7UUFHdEIsSUFBSSxDQUFDLGFBQWEsR0FBRyxJQUFJLGdCQUFnQixDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBQ3hELENBQUM7SUFFRCxRQUFRO0lBQ1IsQ0FBQztJQUVELElBQUksTUFBTTtRQUNSLE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN0QixDQUFDO0lBRUQsSUFBSTtRQUNGLElBQUksQ0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