import { Component, HostBinding, Inject, Input, TemplateRef } from '@angular/core';
import { BehaviorSubject, map } from 'rxjs';
import { FadeInOutAnimation } from '@mintplayer/ng-animations';
import { TOOLTIP_CONTENT } from '../providers/tooltip-content.provider';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@mintplayer/ng-bootstrap/has-overlay";
export class BsTooltipComponent {
    constructor(content) {
        //#region Position
        this.position$ = new BehaviorSubject('bottom');
        this.positionRelative = true;
        this.template = content;
        this.positionClass$ = this.position$
            .pipe(map(position => `bs-tooltip-${position}`));
    }
    get position() {
        return this.position$.value;
    }
    set position(value) {
        this.position$.next(value);
    }
}
BsTooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsTooltipComponent, deps: [{ token: TOOLTIP_CONTENT }], target: i0.ɵɵFactoryTarget.Component });
BsTooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: BsTooltipComponent, selector: "bs-tooltip", inputs: { position: "position" }, host: { properties: { "class.position-relative": "this.positionRelative" } }, ngImport: i0, template: "<bs-has-overlay></bs-has-overlay>\n<div [@fadeInOut] class=\"tooltip position-absolute show\"\n    [class]=\"[positionClass$ | async]\">\n    <div class=\"tooltip-arrow position-absolute\"></div>\n    <div class=\"tooltip-inner\">\n        <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n    </div>\n</div>\n", styles: [":host ::ng-deep .tooltip{--bs-tooltip-zindex: 1080;--bs-tooltip-max-width: 200px;--bs-tooltip-padding-x: .5rem;--bs-tooltip-padding-y: .25rem;--bs-tooltip-margin: ;--bs-tooltip-font-size: .875rem;--bs-tooltip-color: #fff;--bs-tooltip-bg: #000;--bs-tooltip-border-radius: .375rem;--bs-tooltip-opacity: .9;--bs-tooltip-arrow-width: .8rem;--bs-tooltip-arrow-height: .4rem;z-index:var(--bs-tooltip-zindex);display:block;padding:var(--bs-tooltip-arrow-height);margin:var(--bs-tooltip-margin);font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-tooltip-font-size);word-wrap:break-word;opacity:0}:host ::ng-deep .tooltip.show{opacity:var(--bs-tooltip-opacity)}:host ::ng-deep .tooltip .tooltip-arrow{display:block;width:var(--bs-tooltip-arrow-width);height:var(--bs-tooltip-arrow-height)}:host ::ng-deep .tooltip .tooltip-arrow:before{position:absolute;content:\"\";border-color:transparent;border-style:solid}:host ::ng-deep .bs-tooltip-top .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow{bottom:0}:host ::ng-deep .bs-tooltip-top .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow:before{top:-1px;border-width:var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-top-color:var(--bs-tooltip-bg)}:host ::ng-deep .bs-tooltip-end .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow{left:0;width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}:host ::ng-deep .bs-tooltip-end .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow:before{right:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-right-color:var(--bs-tooltip-bg)}:host ::ng-deep .bs-tooltip-bottom .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow{top:0}:host ::ng-deep .bs-tooltip-bottom .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow:before{bottom:-1px;border-width:0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-bottom-color:var(--bs-tooltip-bg)}:host ::ng-deep .bs-tooltip-start .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow{right:0;width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}:host ::ng-deep .bs-tooltip-start .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow:before{left:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) 0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-left-color:var(--bs-tooltip-bg)}:host ::ng-deep .tooltip-inner{max-width:var(--bs-tooltip-max-width);padding:var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x);color:var(--bs-tooltip-color);text-align:center;background-color:var(--bs-tooltip-bg);border-radius:var(--bs-tooltip-border-radius)}.tooltip.bs-tooltip-start,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=left]{right:0}.tooltip.bs-tooltip-start,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=left],.tooltip.bs-tooltip-end,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=right]{transform:translateY(-50%)}.tooltip.bs-tooltip-bottom,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=bottom]{transform:translate(-50%)}.tooltip.bs-tooltip-top,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=top]{transform:translate(-50%) translateY(-100%)}.tooltip.bs-tooltip-bottom .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow,.tooltip.bs-tooltip-top .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow{left:50%;transform:translate(-50%)}.tooltip.bs-tooltip-start .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow,.tooltip.bs-tooltip-end .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow{top:50%;transform:translateY(-50%)}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.BsHasOverlayComponent, selector: "bs-has-overlay" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], animations: [FadeInOutAnimation] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsTooltipComponent, decorators: [{
            type: Component,
            args: [{ selector: 'bs-tooltip', animations: [FadeInOutAnimation], template: "<bs-has-overlay></bs-has-overlay>\n<div [@fadeInOut] class=\"tooltip position-absolute show\"\n    [class]=\"[positionClass$ | async]\">\n    <div class=\"tooltip-arrow position-absolute\"></div>\n    <div class=\"tooltip-inner\">\n        <ng-container *ngTemplateOutlet=\"template\"></ng-container>\n    </div>\n</div>\n", styles: [":host ::ng-deep .tooltip{--bs-tooltip-zindex: 1080;--bs-tooltip-max-width: 200px;--bs-tooltip-padding-x: .5rem;--bs-tooltip-padding-y: .25rem;--bs-tooltip-margin: ;--bs-tooltip-font-size: .875rem;--bs-tooltip-color: #fff;--bs-tooltip-bg: #000;--bs-tooltip-border-radius: .375rem;--bs-tooltip-opacity: .9;--bs-tooltip-arrow-width: .8rem;--bs-tooltip-arrow-height: .4rem;z-index:var(--bs-tooltip-zindex);display:block;padding:var(--bs-tooltip-arrow-height);margin:var(--bs-tooltip-margin);font-family:var(--bs-font-sans-serif);font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;white-space:normal;word-spacing:normal;line-break:auto;font-size:var(--bs-tooltip-font-size);word-wrap:break-word;opacity:0}:host ::ng-deep .tooltip.show{opacity:var(--bs-tooltip-opacity)}:host ::ng-deep .tooltip .tooltip-arrow{display:block;width:var(--bs-tooltip-arrow-width);height:var(--bs-tooltip-arrow-height)}:host ::ng-deep .tooltip .tooltip-arrow:before{position:absolute;content:\"\";border-color:transparent;border-style:solid}:host ::ng-deep .bs-tooltip-top .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow{bottom:0}:host ::ng-deep .bs-tooltip-top .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow:before{top:-1px;border-width:var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-top-color:var(--bs-tooltip-bg)}:host ::ng-deep .bs-tooltip-end .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow{left:0;width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}:host ::ng-deep .bs-tooltip-end .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow:before{right:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height) calc(var(--bs-tooltip-arrow-width) * .5) 0;border-right-color:var(--bs-tooltip-bg)}:host ::ng-deep .bs-tooltip-bottom .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow{top:0}:host ::ng-deep .bs-tooltip-bottom .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow:before{bottom:-1px;border-width:0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-bottom-color:var(--bs-tooltip-bg)}:host ::ng-deep .bs-tooltip-start .tooltip-arrow,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow{right:0;width:var(--bs-tooltip-arrow-height);height:var(--bs-tooltip-arrow-width)}:host ::ng-deep .bs-tooltip-start .tooltip-arrow:before,:host ::ng-deep .bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow:before{left:-1px;border-width:calc(var(--bs-tooltip-arrow-width) * .5) 0 calc(var(--bs-tooltip-arrow-width) * .5) var(--bs-tooltip-arrow-height);border-left-color:var(--bs-tooltip-bg)}:host ::ng-deep .tooltip-inner{max-width:var(--bs-tooltip-max-width);padding:var(--bs-tooltip-padding-y) var(--bs-tooltip-padding-x);color:var(--bs-tooltip-color);text-align:center;background-color:var(--bs-tooltip-bg);border-radius:var(--bs-tooltip-border-radius)}.tooltip.bs-tooltip-start,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=left]{right:0}.tooltip.bs-tooltip-start,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=left],.tooltip.bs-tooltip-end,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=right]{transform:translateY(-50%)}.tooltip.bs-tooltip-bottom,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=bottom]{transform:translate(-50%)}.tooltip.bs-tooltip-top,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=top]{transform:translate(-50%) translateY(-100%)}.tooltip.bs-tooltip-bottom .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=bottom] .tooltip-arrow,.tooltip.bs-tooltip-top .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=top] .tooltip-arrow{left:50%;transform:translate(-50%)}.tooltip.bs-tooltip-start .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=left] .tooltip-arrow,.tooltip.bs-tooltip-end .tooltip-arrow,:host ::ng-deep .tooltip.bs-tooltip-auto[data-popper-placement^=right] .tooltip-arrow{top:50%;transform:translateY(-50%)}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
                    type: Inject,
                    args: [TOOLTIP_CONTENT]
                }] }]; }, propDecorators: { position: [{
                type: Input
            }], positionRelative: [{
                type: HostBinding,
                args: ['class.position-relative']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9saWJzL21pbnRwbGF5ZXItbmctYm9vdHN0cmFwL3Rvb2x0aXAvc3JjL2NvbXBvbmVudC90b29sdGlwLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvbWludHBsYXllci1uZy1ib290c3RyYXAvdG9vbHRpcC9zcmMvY29tcG9uZW50L3Rvb2x0aXAuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUUsTUFBTSxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkYsT0FBTyxFQUFFLGVBQWUsRUFBRSxHQUFHLEVBQWMsTUFBTSxNQUFNLENBQUM7QUFDeEQsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFL0QsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHVDQUF1QyxDQUFDOzs7O0FBUXhFLE1BQU0sT0FBTyxrQkFBa0I7SUFDN0IsWUFBcUMsT0FBeUI7UUFNOUQsa0JBQWtCO1FBQ2xCLGNBQVMsR0FBRyxJQUFJLGVBQWUsQ0FBVyxRQUFRLENBQUMsQ0FBQztRQVlaLHFCQUFnQixHQUFHLElBQUksQ0FBQztRQWxCOUQsSUFBSSxDQUFDLFFBQVEsR0FBRyxPQUFPLENBQUM7UUFDeEIsSUFBSSxDQUFDLGNBQWMsR0FBRyxJQUFJLENBQUMsU0FBUzthQUNqQyxJQUFJLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxFQUFFLENBQUMsY0FBYyxRQU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