import { Directionality } from '@angular/cdk/bidi';
import { NgTemplateOutlet } from '@angular/common';
import * as i0 from '@angular/core';
import { input, Component, output, linkedSignal, inject, computed, NgZone, DestroyRef, DOCUMENT, viewChild, ElementRef, numberAttribute, signal, effect, untracked, ViewEncapsulation, contentChildren, NgModule } from '@angular/core';
import { NzBadgeComponent, NzBadgeModule } from 'ng-zorro-antd/badge';
import * as i1$1 from 'ng-zorro-antd/button';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { generateClassName, fromEventOutsideAngular } from 'ng-zorro-antd/core/util';
import * as i2 from 'ng-zorro-antd/core/outlet';
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import * as i1 from 'ng-zorro-antd/icon';
import { NzIconModule } from 'ng-zorro-antd/icon';
import * as i2$1 from 'ng-zorro-antd/core/transition-patch';
import * as i3 from 'ng-zorro-antd/core/wave';
import { withAnimationCheck } from 'ng-zorro-antd/core/animation';
import { normalizePassiveListenerOptions, Platform } from '@angular/cdk/platform';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Subscription, Subject } from 'rxjs';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { withConfigFactory } from 'ng-zorro-antd/core/config';
import { NzScrollService } from 'ng-zorro-antd/core/services';

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
class NzFloatButtonContentComponent {
    nzBadge = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzBadge" }] : /* istanbul ignore next */ []));
    nzIcon = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzIcon" }] : /* istanbul ignore next */ []));
    nzDescription = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzDescription" }] : /* istanbul ignore next */ []));
    nzShape = input('circle', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzShape" }] : /* istanbul ignore next */ []));
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NzFloatButtonContentComponent, isStandalone: true, selector: "nz-float-button-content", inputs: { nzBadge: { classPropertyName: "nzBadge", publicName: "nzBadge", isSignal: true, isRequired: false, transformFunction: null }, nzIcon: { classPropertyName: "nzIcon", publicName: "nzIcon", isSignal: true, isRequired: false, transformFunction: null }, nzDescription: { classPropertyName: "nzDescription", publicName: "nzDescription", isSignal: true, isRequired: false, transformFunction: null }, nzShape: { classPropertyName: "nzShape", publicName: "nzShape", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["nzFloatButtonContent"], ngImport: i0, template: `
    @if (nzBadge()) {
      <nz-badge
        [nzDot]="nzBadge()?.nzDot"
        [nzShowDot]="nzBadge()?.nzDot"
        [nzCount]="nzBadge()?.nzCount"
        [nzShowZero]="nzBadge()?.nzShowZero"
        [nzOverflowCount]="nzBadge()?.nzOverflowCount!"
        [nzColor]="nzBadge()?.nzColor"
        [nzOffset]="nzBadge()?.nzOffset"
        [nzSize]="nzBadge()?.nzSize || 'default'"
      >
        <ng-container *ngTemplateOutlet="button" />
      </nz-badge>
    } @else {
      <ng-container *ngTemplateOutlet="button" />
    }
    <ng-template #button>
      <div class="ant-float-btn-body">
        <div class="ant-float-btn-content">
          @if (nzDescription() || nzIcon()) {
            @if (nzIcon()) {
              <div class="ant-float-btn-icon">
                <ng-container *nzStringTemplateOutlet="nzIcon(); let icon">
                  <nz-icon [nzType]="icon" nzTheme="outline" />
                </ng-container>
              </div>
            }
            @if (nzDescription() && nzShape() === 'square') {
              <div class="ant-float-btn-description">
                <ng-container *nzStringTemplateOutlet="nzDescription()">
                  {{ nzDescription() }}
                </ng-container>
              </div>
            }
          } @else {
            <div class="ant-float-btn-icon">
              <nz-icon nzType="file-text" nzTheme="outline" />
            </div>
          }
        </div>
      </div>
    </ng-template>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzType", "nzTheme", "nzTwotoneColor", "nzSpin", "nzRotate", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzOutletModule }, { kind: "directive", type: i2.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "component", type: NzBadgeComponent, selector: "nz-badge", inputs: ["nzShowZero", "nzShowDot", "nzStandalone", "nzDot", "nzOverflowCount", "nzColor", "nzStyle", "nzText", "nzTitle", "nzStatus", "nzCount", "nzOffset", "nzSize"], exportAs: ["nzBadge"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonContentComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'nz-float-button-content',
                    exportAs: 'nzFloatButtonContent',
                    imports: [NzIconModule, NzOutletModule, NzBadgeComponent, NgTemplateOutlet],
                    template: `
    @if (nzBadge()) {
      <nz-badge
        [nzDot]="nzBadge()?.nzDot"
        [nzShowDot]="nzBadge()?.nzDot"
        [nzCount]="nzBadge()?.nzCount"
        [nzShowZero]="nzBadge()?.nzShowZero"
        [nzOverflowCount]="nzBadge()?.nzOverflowCount!"
        [nzColor]="nzBadge()?.nzColor"
        [nzOffset]="nzBadge()?.nzOffset"
        [nzSize]="nzBadge()?.nzSize || 'default'"
      >
        <ng-container *ngTemplateOutlet="button" />
      </nz-badge>
    } @else {
      <ng-container *ngTemplateOutlet="button" />
    }
    <ng-template #button>
      <div class="ant-float-btn-body">
        <div class="ant-float-btn-content">
          @if (nzDescription() || nzIcon()) {
            @if (nzIcon()) {
              <div class="ant-float-btn-icon">
                <ng-container *nzStringTemplateOutlet="nzIcon(); let icon">
                  <nz-icon [nzType]="icon" nzTheme="outline" />
                </ng-container>
              </div>
            }
            @if (nzDescription() && nzShape() === 'square') {
              <div class="ant-float-btn-description">
                <ng-container *nzStringTemplateOutlet="nzDescription()">
                  {{ nzDescription() }}
                </ng-container>
              </div>
            }
          } @else {
            <div class="ant-float-btn-icon">
              <nz-icon nzType="file-text" nzTheme="outline" />
            </div>
          }
        </div>
      </div>
    </ng-template>
  `
                }]
        }], propDecorators: { nzBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzBadge", required: false }] }], nzIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzIcon", required: false }] }], nzDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzDescription", required: false }] }], nzShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzShape", required: false }] }] } });

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
const CLASS_NAME$2 = 'ant-float-btn';
class NzFloatButtonComponent {
    nzHref = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzHref" }] : /* istanbul ignore next */ []));
    nzTarget = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzTarget" }] : /* istanbul ignore next */ []));
    nzType = input('default', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzType" }] : /* istanbul ignore next */ []));
    nzIcon = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzIcon" }] : /* istanbul ignore next */ []));
    nzDescription = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzDescription" }] : /* istanbul ignore next */ []));
    nzShape = input('circle', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzShape" }] : /* istanbul ignore next */ []));
    nzBadge = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzBadge" }] : /* istanbul ignore next */ []));
    nzOnClick = output();
    shape = linkedSignal(() => this.nzShape(), /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
    dir = inject(Directionality).valueSignal;
    class = computed(() => {
        const dir = this.dir();
        const classes = [CLASS_NAME$2, this.generateClass(this.shape())];
        if (dir === 'rtl') {
            classes.push(this.generateClass(dir));
        }
        return classes;
    }, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
    generateClass(suffix) {
        return generateClassName(CLASS_NAME$2, suffix);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NzFloatButtonComponent, isStandalone: true, selector: "nz-float-button", inputs: { nzHref: { classPropertyName: "nzHref", publicName: "nzHref", isSignal: true, isRequired: false, transformFunction: null }, nzTarget: { classPropertyName: "nzTarget", publicName: "nzTarget", isSignal: true, isRequired: false, transformFunction: null }, nzType: { classPropertyName: "nzType", publicName: "nzType", isSignal: true, isRequired: false, transformFunction: null }, nzIcon: { classPropertyName: "nzIcon", publicName: "nzIcon", isSignal: true, isRequired: false, transformFunction: null }, nzDescription: { classPropertyName: "nzDescription", publicName: "nzDescription", isSignal: true, isRequired: false, transformFunction: null }, nzShape: { classPropertyName: "nzShape", publicName: "nzShape", isSignal: true, isRequired: false, transformFunction: null }, nzBadge: { classPropertyName: "nzBadge", publicName: "nzBadge", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nzOnClick: "nzOnClick" }, host: { properties: { "class": "class()" } }, exportAs: ["nzFloatButton"], ngImport: i0, template: `
    @if (!!nzHref()) {
      <a
        [target]="nzTarget()"
        [href]="nzHref()"
        nz-button
        [nzType]="nzType()"
        [class.ant-float-btn-default]="nzType() === 'default'"
        class="ant-float-btn-inner"
        (click)="nzOnClick.emit(true)"
      >
        <ng-container *ngTemplateOutlet="contentTemplate" />
      </a>
    } @else {
      <button
        nz-button
        [nzType]="nzType()"
        [class.ant-float-btn-default]="nzType() === 'default'"
        class="ant-float-btn-inner"
        (click)="nzOnClick.emit(true)"
      >
        <ng-container *ngTemplateOutlet="contentTemplate" />
      </button>
    }
    <ng-template #contentTemplate>
      <nz-float-button-content
        [nzBadge]="nzBadge()"
        [nzIcon]="nzIcon()"
        [nzDescription]="nzDescription()"
        [nzShape]="shape()"
      />
    </ng-template>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i1$1.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i2$1.ɵNzTransitionPatchDirective, selector: "[nz-button], [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i3.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "component", type: NzFloatButtonContentComponent, selector: "nz-float-button-content", inputs: ["nzBadge", "nzIcon", "nzDescription", "nzShape"], exportAs: ["nzFloatButtonContent"] }, { kind: "ngmodule", type: NzBadgeModule }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'nz-float-button',
                    exportAs: 'nzFloatButton',
                    imports: [NzButtonModule, NzFloatButtonContentComponent, NzBadgeModule, NgTemplateOutlet],
                    template: `
    @if (!!nzHref()) {
      <a
        [target]="nzTarget()"
        [href]="nzHref()"
        nz-button
        [nzType]="nzType()"
        [class.ant-float-btn-default]="nzType() === 'default'"
        class="ant-float-btn-inner"
        (click)="nzOnClick.emit(true)"
      >
        <ng-container *ngTemplateOutlet="contentTemplate" />
      </a>
    } @else {
      <button
        nz-button
        [nzType]="nzType()"
        [class.ant-float-btn-default]="nzType() === 'default'"
        class="ant-float-btn-inner"
        (click)="nzOnClick.emit(true)"
      >
        <ng-container *ngTemplateOutlet="contentTemplate" />
      </button>
    }
    <ng-template #contentTemplate>
      <nz-float-button-content
        [nzBadge]="nzBadge()"
        [nzIcon]="nzIcon()"
        [nzDescription]="nzDescription()"
        [nzShape]="shape()"
      />
    </ng-template>
  `,
                    host: {
                        '[class]': 'class()'
                    }
                }]
        }], propDecorators: { nzHref: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzHref", required: false }] }], nzTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzTarget", required: false }] }], nzType: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzType", required: false }] }], nzIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzIcon", required: false }] }], nzDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzDescription", required: false }] }], nzShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzShape", required: false }] }], nzBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzBadge", required: false }] }], nzOnClick: [{ type: i0.Output, args: ["nzOnClick"] }] } });

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
const withConfig = withConfigFactory('floatButton');
const CLASS_NAME$1 = 'ant-float-btn';
const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
class NzFloatButtonTopComponent {
    scrollSrv = inject(NzScrollService);
    platform = inject(Platform);
    ngZone = inject(NgZone);
    directionality = inject(Directionality);
    destroyRef = inject(DestroyRef);
    document = inject(DOCUMENT);
    backTop = viewChild('backTop', { ...(ngDevMode ? { debugName: "backTop" } : /* istanbul ignore next */ {}), read: ElementRef });
    nzVisibilityHeight = input(/* @ts-ignore */
    ...(ngDevMode ? [undefined, { debugName: "nzVisibilityHeight" }] : /* istanbul ignore next */ []));
    nzHref = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzHref" }] : /* istanbul ignore next */ []));
    nzType = input('default', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzType" }] : /* istanbul ignore next */ []));
    nzShape = input('circle', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzShape" }] : /* istanbul ignore next */ []));
    nzIcon = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzIcon" }] : /* istanbul ignore next */ []));
    nzDescription = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzDescription" }] : /* istanbul ignore next */ []));
    nzTemplate = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzTemplate" }] : /* istanbul ignore next */ []));
    nzTarget = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzTarget" }] : /* istanbul ignore next */ []));
    nzDuration = input(450, { ...(ngDevMode ? { debugName: "nzDuration" } : /* istanbul ignore next */ {}), transform: numberAttribute });
    nzBadge = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzBadge" }] : /* istanbul ignore next */ []));
    nzOnClick = output();
    visible = signal(false, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
    // compact global config
    visibilityHeight = withConfig('nzVisibilityHeight', this.nzVisibilityHeight, 400);
    shape = linkedSignal(() => this.nzShape(), /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
    class = computed(() => {
        const dir = this.directionality.valueSignal();
        const classes = [CLASS_NAME$1, `${CLASS_NAME$1}-top`, this.generateClass(this.shape())];
        if (dir === 'rtl') {
            classes.push(this.generateClass(dir));
        }
        return classes;
    }, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
    fadeAnimationEnter = withAnimationCheck(() => `${CLASS_NAME$1}-top-motion-enter`);
    fadeAnimationLeave = withAnimationCheck(() => `${CLASS_NAME$1}-top-motion-leave`);
    target = null;
    backTopClickSubscription = Subscription.EMPTY;
    scrollListenerDestroy$ = new Subject();
    constructor() {
        this.destroyRef.onDestroy(() => {
            this.scrollListenerDestroy$.next();
            this.scrollListenerDestroy$.complete();
        });
        effect(() => {
            const target = this.nzTarget();
            if (target) {
                this.target = typeof target === 'string' ? this.document.querySelector(target) : target;
                this.registerScrollEvent();
            }
        });
        effect(onCleanup => {
            const backTop = this.backTop();
            if (backTop) {
                this.backTopClickSubscription.unsubscribe();
                this.backTopClickSubscription = fromEventOutsideAngular(backTop.nativeElement, 'click')
                    .pipe(takeUntilDestroyed(this.destroyRef))
                    .subscribe(() => {
                    this.scrollSrv.scrollTo(this.getTarget(), 0, { duration: this.nzDuration() });
                    this.ngZone.run(() => this.nzOnClick.emit(true));
                });
            }
            return onCleanup(() => {
                this.backTopClickSubscription.unsubscribe();
            });
        });
        effect(() => {
            this.visibilityHeight();
            untracked(() => this.handleScroll());
        });
    }
    ngOnInit() {
        this.registerScrollEvent();
    }
    getTarget() {
        return this.target || window;
    }
    handleScroll() {
        if (!this.platform.isBrowser ||
            this.visible() === this.scrollSrv.getScroll(this.getTarget()) > this.visibilityHeight()) {
            return;
        }
        this.visible.update(v => !v);
    }
    registerScrollEvent() {
        if (!this.platform.isBrowser) {
            return;
        }
        this.scrollListenerDestroy$.next();
        this.handleScroll();
        fromEventOutsideAngular(this.getTarget(), 'scroll', passiveEventListenerOptions)
            .pipe(debounceTime(50), takeUntil(this.scrollListenerDestroy$))
            .subscribe(() => this.handleScroll());
    }
    generateClass(suffix) {
        return generateClassName(CLASS_NAME$1, suffix);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonTopComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NzFloatButtonTopComponent, isStandalone: true, selector: "nz-float-button-top", inputs: { nzVisibilityHeight: { classPropertyName: "nzVisibilityHeight", publicName: "nzVisibilityHeight", isSignal: true, isRequired: false, transformFunction: null }, nzHref: { classPropertyName: "nzHref", publicName: "nzHref", isSignal: true, isRequired: false, transformFunction: null }, nzType: { classPropertyName: "nzType", publicName: "nzType", isSignal: true, isRequired: false, transformFunction: null }, nzShape: { classPropertyName: "nzShape", publicName: "nzShape", isSignal: true, isRequired: false, transformFunction: null }, nzIcon: { classPropertyName: "nzIcon", publicName: "nzIcon", isSignal: true, isRequired: false, transformFunction: null }, nzDescription: { classPropertyName: "nzDescription", publicName: "nzDescription", isSignal: true, isRequired: false, transformFunction: null }, nzTemplate: { classPropertyName: "nzTemplate", publicName: "nzTemplate", isSignal: true, isRequired: false, transformFunction: null }, nzTarget: { classPropertyName: "nzTarget", publicName: "nzTarget", isSignal: true, isRequired: false, transformFunction: null }, nzDuration: { classPropertyName: "nzDuration", publicName: "nzDuration", isSignal: true, isRequired: false, transformFunction: null }, nzBadge: { classPropertyName: "nzBadge", publicName: "nzBadge", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nzOnClick: "nzOnClick" }, host: { properties: { "class": "class()" } }, viewQueries: [{ propertyName: "backTop", first: true, predicate: ["backTop"], descendants: true, read: ElementRef, isSignal: true }], exportAs: ["nzFloatButtonTop"], ngImport: i0, template: `
    @if (visible()) {
      <nz-float-button
        #backTop
        [nzIcon]="nzIcon() || 'vertical-align-top'"
        [nzDescription]="nzDescription()"
        [nzHref]="nzHref()"
        [nzType]="nzType()"
        [nzShape]="shape()"
        [nzBadge]="nzBadge()"
        [animate.enter]="fadeAnimationEnter()"
        [animate.leave]="fadeAnimationLeave()"
      />
    }
  `, isInline: true, dependencies: [{ kind: "component", type: NzFloatButtonComponent, selector: "nz-float-button", inputs: ["nzHref", "nzTarget", "nzType", "nzIcon", "nzDescription", "nzShape", "nzBadge"], outputs: ["nzOnClick"], exportAs: ["nzFloatButton"] }], encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonTopComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'nz-float-button-top',
                    exportAs: 'nzFloatButtonTop',
                    imports: [NzFloatButtonComponent],
                    template: `
    @if (visible()) {
      <nz-float-button
        #backTop
        [nzIcon]="nzIcon() || 'vertical-align-top'"
        [nzDescription]="nzDescription()"
        [nzHref]="nzHref()"
        [nzType]="nzType()"
        [nzShape]="shape()"
        [nzBadge]="nzBadge()"
        [animate.enter]="fadeAnimationEnter()"
        [animate.leave]="fadeAnimationLeave()"
      />
    }
  `,
                    host: {
                        '[class]': 'class()'
                    },
                    encapsulation: ViewEncapsulation.None
                }]
        }], ctorParameters: () => [], propDecorators: { backTop: [{ type: i0.ViewChild, args: ['backTop', { ...{ read: ElementRef }, isSignal: true }] }], nzVisibilityHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzVisibilityHeight", required: false }] }], nzHref: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzHref", required: false }] }], nzType: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzType", required: false }] }], nzShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzShape", required: false }] }], nzIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzIcon", required: false }] }], nzDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzDescription", required: false }] }], nzTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzTemplate", required: false }] }], nzTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzTarget", required: false }] }], nzDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzDuration", required: false }] }], nzBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzBadge", required: false }] }], nzOnClick: [{ type: i0.Output, args: ["nzOnClick"] }] } });

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
const CLASS_NAME = 'ant-float-btn-group';
class NzFloatButtonGroupComponent {
    nzFloatButtonComponents = contentChildren(NzFloatButtonComponent, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzFloatButtonComponents" }] : /* istanbul ignore next */ []));
    nzFloatButtonTopComponents = contentChildren(NzFloatButtonTopComponent, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzFloatButtonTopComponents" }] : /* istanbul ignore next */ []));
    nzHref = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzHref" }] : /* istanbul ignore next */ []));
    nzTarget = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzTarget" }] : /* istanbul ignore next */ []));
    nzType = input('default', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzType" }] : /* istanbul ignore next */ []));
    nzIcon = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzIcon" }] : /* istanbul ignore next */ []));
    nzDescription = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzDescription" }] : /* istanbul ignore next */ []));
    nzShape = input('circle', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzShape" }] : /* istanbul ignore next */ []));
    nzTrigger = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzTrigger" }] : /* istanbul ignore next */ []));
    nzOpen = input(null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzOpen" }] : /* istanbul ignore next */ []));
    nzPlacement = input('top', /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "nzPlacement" }] : /* istanbul ignore next */ []));
    /**
     * @deprecated Use `nzOpenChange` instead. This will be removed in v23.0.0.
     */
    nzOnOpenChange = output();
    nzOpenChange = output();
    dir = inject(Directionality).valueSignal;
    open = linkedSignal(() => !!this.nzOpen(), /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []));
    isMenuMode = computed(() => !!this.nzTrigger() && ['click', 'hover'].includes(this.nzTrigger()), /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "isMenuMode" }] : /* istanbul ignore next */ []));
    isControlledMode = computed(() => this.nzOpen() !== null, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "isControlledMode" }] : /* istanbul ignore next */ []));
    class = computed(() => {
        const shape = this.nzShape();
        const dir = this.dir();
        const classes = [CLASS_NAME, this.generateClass(shape)];
        if (!this.isMenuMode()) {
            classes.push(this.generateClass(`${shape}-shadow`));
        }
        else {
            classes.push(this.generateClass(this.nzPlacement()));
        }
        if (dir === 'rtl') {
            classes.push(this.generateClass(dir));
        }
        return classes;
    }, /* @ts-ignore */
    ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
    enterAnimation = withAnimationCheck(() => `ant-float-btn-enter-${this.nzPlacement()}`);
    leaveAnimation = withAnimationCheck(() => `ant-float-btn-leave-${this.nzPlacement()}`);
    constructor() {
        effect(() => {
            if (this.nzFloatButtonComponents()) {
                this.nzFloatButtonComponents().forEach(item => {
                    item.shape.set(this.nzShape());
                });
            }
            if (this.nzFloatButtonTopComponents()) {
                this.nzFloatButtonTopComponents().forEach(item => {
                    item.shape.set(this.nzShape());
                });
            }
        });
    }
    clickOpenMenu() {
        this.handleEvent('click', true);
    }
    hoverOpenMenu() {
        this.handleEvent('hover', true);
    }
    clickCloseMenu() {
        this.handleEvent('click', false);
    }
    hoverCloseMenu() {
        this.handleEvent('hover', false);
    }
    handleEvent(type, isOpen) {
        if (this.nzTrigger() !== type || this.open() === isOpen) {
            return;
        }
        if (!this.isControlledMode()) {
            this.open.set(isOpen);
        }
        this.nzOpenChange.emit(isOpen);
        this.nzOnOpenChange.emit(isOpen);
    }
    generateClass(suffix) {
        return generateClassName(CLASS_NAME, suffix);
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NzFloatButtonGroupComponent, isStandalone: true, selector: "nz-float-button-group", inputs: { nzHref: { classPropertyName: "nzHref", publicName: "nzHref", isSignal: true, isRequired: false, transformFunction: null }, nzTarget: { classPropertyName: "nzTarget", publicName: "nzTarget", isSignal: true, isRequired: false, transformFunction: null }, nzType: { classPropertyName: "nzType", publicName: "nzType", isSignal: true, isRequired: false, transformFunction: null }, nzIcon: { classPropertyName: "nzIcon", publicName: "nzIcon", isSignal: true, isRequired: false, transformFunction: null }, nzDescription: { classPropertyName: "nzDescription", publicName: "nzDescription", isSignal: true, isRequired: false, transformFunction: null }, nzShape: { classPropertyName: "nzShape", publicName: "nzShape", isSignal: true, isRequired: false, transformFunction: null }, nzTrigger: { classPropertyName: "nzTrigger", publicName: "nzTrigger", isSignal: true, isRequired: false, transformFunction: null }, nzOpen: { classPropertyName: "nzOpen", publicName: "nzOpen", isSignal: true, isRequired: false, transformFunction: null }, nzPlacement: { classPropertyName: "nzPlacement", publicName: "nzPlacement", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nzOnOpenChange: "nzOnOpenChange", nzOpenChange: "nzOpenChange" }, host: { listeners: { "mouseleave": "hoverCloseMenu()" }, properties: { "class": "class()" } }, queries: [{ propertyName: "nzFloatButtonComponents", predicate: NzFloatButtonComponent, isSignal: true }, { propertyName: "nzFloatButtonTopComponents", predicate: NzFloatButtonTopComponent, isSignal: true }], exportAs: ["nzFloatButtonGroup"], ngImport: i0, template: `
    @if (!isMenuMode()) {
      <ng-container *ngTemplateOutlet="menu" />
    } @else {
      @if (open()) {
        <div class="ant-float-btn-group-wrap" [animate.enter]="enterAnimation()" [animate.leave]="leaveAnimation()">
          <ng-container *ngTemplateOutlet="menu" />
        </div>
      }
      <nz-float-button
        class="ant-float-btn-group-trigger"
        [nzType]="nzType()"
        [nzIcon]="open() ? close : nzIcon()"
        [nzShape]="nzShape()"
        [nzDescription]="open() ? null : nzDescription()"
        (nzOnClick)="open() ? clickCloseMenu() : clickOpenMenu()"
        (mouseover)="hoverOpenMenu()"
      />
    }
    <ng-template #menu><ng-content /></ng-template>
    <ng-template #close>
      <nz-icon nzType="close" nzTheme="outline" />
    </ng-template>
  `, isInline: true, dependencies: [{ kind: "component", type: NzFloatButtonComponent, selector: "nz-float-button", inputs: ["nzHref", "nzTarget", "nzType", "nzIcon", "nzDescription", "nzShape", "nzBadge"], outputs: ["nzOnClick"], exportAs: ["nzFloatButton"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i1.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzType", "nzTheme", "nzTwotoneColor", "nzSpin", "nzRotate", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonGroupComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'nz-float-button-group',
                    exportAs: 'nzFloatButtonGroup',
                    imports: [NzFloatButtonComponent, NzIconModule, NgTemplateOutlet],
                    template: `
    @if (!isMenuMode()) {
      <ng-container *ngTemplateOutlet="menu" />
    } @else {
      @if (open()) {
        <div class="ant-float-btn-group-wrap" [animate.enter]="enterAnimation()" [animate.leave]="leaveAnimation()">
          <ng-container *ngTemplateOutlet="menu" />
        </div>
      }
      <nz-float-button
        class="ant-float-btn-group-trigger"
        [nzType]="nzType()"
        [nzIcon]="open() ? close : nzIcon()"
        [nzShape]="nzShape()"
        [nzDescription]="open() ? null : nzDescription()"
        (nzOnClick)="open() ? clickCloseMenu() : clickOpenMenu()"
        (mouseover)="hoverOpenMenu()"
      />
    }
    <ng-template #menu><ng-content /></ng-template>
    <ng-template #close>
      <nz-icon nzType="close" nzTheme="outline" />
    </ng-template>
  `,
                    host: {
                        '[class]': 'class()',
                        '(mouseleave)': 'hoverCloseMenu()'
                    }
                }]
        }], ctorParameters: () => [], propDecorators: { nzFloatButtonComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NzFloatButtonComponent), { isSignal: true }] }], nzFloatButtonTopComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => NzFloatButtonTopComponent), { isSignal: true }] }], nzHref: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzHref", required: false }] }], nzTarget: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzTarget", required: false }] }], nzType: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzType", required: false }] }], nzIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzIcon", required: false }] }], nzDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzDescription", required: false }] }], nzShape: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzShape", required: false }] }], nzTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzTrigger", required: false }] }], nzOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzOpen", required: false }] }], nzPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "nzPlacement", required: false }] }], nzOnOpenChange: [{ type: i0.Output, args: ["nzOnOpenChange"] }], nzOpenChange: [{ type: i0.Output, args: ["nzOpenChange"] }] } });

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
class NzFloatButtonModule {
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
    static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonModule, imports: [NzFloatButtonComponent,
            NzFloatButtonGroupComponent,
            NzFloatButtonTopComponent,
            NzFloatButtonContentComponent], exports: [NzFloatButtonComponent,
            NzFloatButtonGroupComponent,
            NzFloatButtonTopComponent,
            NzFloatButtonContentComponent] });
    static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonModule, imports: [NzFloatButtonComponent,
            NzFloatButtonGroupComponent,
            NzFloatButtonTopComponent,
            NzFloatButtonContentComponent] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NzFloatButtonModule, decorators: [{
            type: NgModule,
            args: [{
                    exports: [
                        NzFloatButtonComponent,
                        NzFloatButtonGroupComponent,
                        NzFloatButtonTopComponent,
                        NzFloatButtonContentComponent
                    ],
                    imports: [
                        NzFloatButtonComponent,
                        NzFloatButtonGroupComponent,
                        NzFloatButtonTopComponent,
                        NzFloatButtonContentComponent
                    ]
                }]
        }] });

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

/**
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */

/**
 * Generated bundle index. Do not edit.
 */

export { NzFloatButtonComponent, NzFloatButtonContentComponent, NzFloatButtonGroupComponent, NzFloatButtonModule, NzFloatButtonTopComponent };
//# sourceMappingURL=ng-zorro-antd-float-button.mjs.map
