import * as i0 from '@angular/core';
import { InjectionToken, inject, ChangeDetectorRef, signal, Injector, ElementRef, Input, HostBinding, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, EventEmitter, ViewContainerRef, booleanAttribute, forwardRef, ContentChild, Output, Directive, NgModule } from '@angular/core';
import * as i2 from '@angular/cdk/portal';
import { TemplatePortal, ComponentPortal, PortalModule } from '@angular/cdk/portal';
import { BehaviorSubject, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import * as i1 from '@ngx-translate/core';
import { TranslateModule } from '@ngx-translate/core';
import * as i3 from '@angular/cdk/overlay';
import { OverlayModule, Overlay } from '@angular/cdk/overlay';
import * as i4 from '@angular/cdk/a11y';
import { A11yModule } from '@angular/cdk/a11y';
import * as i5 from '@angular/cdk/drag-drop';
import { DragDropModule } from '@angular/cdk/drag-drop';
import { CdkScrollableModule } from '@angular/cdk/scrolling';
import * as i6 from '@eui/components/eui-button';
import { EUI_BUTTON } from '@eui/components/eui-button';
import * as i7 from '@eui/components/eui-icon';
import { EUI_ICON } from '@eui/components/eui-icon';
import { EUI_ICON_BUTTON } from '@eui/components/eui-icon-button';
import * as i8 from '@eui/components/eui-icon-state';
import { EUI_ICON_STATE } from '@eui/components/eui-icon-state';
import { AsyncPipe } from '@angular/common';
import * as i1$1 from '@eui/components/shared';
import { BaseStatesDirective } from '@eui/components/shared';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const DIALOG_CONTAINER_CONFIG = new InjectionToken('DIALOG_CONTAINER_CONFIG');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const DIALOG_COMPONENT_CONFIG = new InjectionToken('DIALOG_COMPONENT_CONFIG');

class EuiDialogConfig {
    constructor(values) {
        this.e2eAttr = 'eui-message-box';
        this.acceptLabel = 'eui.OK';
        this.dismissLabel = 'eui.CANCEL';
        this.width = '50%';
        this.height = 'auto';
        this.isFullScreen = false;
        this.hasCloseButton = true;
        this.hasAcceptButton = true;
        this.hasDismissButton = true;
        this.hasMobileCustomSize = false;
        this.hasClosedOnClickOutside = false;
        this.hasClosedOnEscape = true;
        this.isHandleCloseOnDismiss = false;
        this.isHandleCloseOnClose = false;
        this.isHandleCloseOnAccept = false;
        this.isHandleCloseOnClickOutside = false;
        this.isHandleCloseOnEscape = false;
        this.hasFooter = true;
        this.isMessageBox = false;
        this.classList = null;
        Object.assign(this, values);
    }
}
class EuiDialogComponentInstances {
    constructor() {
        this.headerComponent = null;
        this.bodyComponent = null;
        this.footerComponent = null;
    }
}

class EuiDialogContainerComponent {
    constructor() {
        this.cd = inject(ChangeDetectorRef);
        this.dialogContainerConfig = inject(DIALOG_CONTAINER_CONFIG);
        this.isHeaderTemplatePortal = false;
        this.isBodyTemplatePortal = false;
        this.isFooterTemplatePortal = false;
        this.isHeaderComponentPortal = false;
        this.isBodyComponentPortal = false;
        this.isFooterComponentPortal = false;
        this.componentInstances = new EuiDialogComponentInstances();
        this.acceptButtonDisabled$ = new BehaviorSubject(false);
        this.dismissButtonDisabled$ = new BehaviorSubject(false);
        this.string = 'eui-dialog-container';
        this.closeButtonAriaLabel = 'Close dialog';
        this.isBodyScrollable = signal(false);
        this.destroy$ = new Subject();
        this.injector = inject(Injector);
    }
    ngOnInit() {
        if (this.dialogContainerConfig.header instanceof TemplatePortal) {
            this.isHeaderTemplatePortal = true;
        }
        if (this.dialogContainerConfig.content instanceof TemplatePortal) {
            this.isBodyTemplatePortal = true;
        }
        if (this.dialogContainerConfig.footer instanceof TemplatePortal) {
            this.isFooterTemplatePortal = true;
        }
        if (this.dialogContainerConfig.headerComponent?.component) {
            this.isHeaderComponentPortal = true;
            this.headerComponentPortal = this.createComponentPortal(this.dialogContainerConfig.headerComponent.component, this.dialogContainerConfig.headerComponent.config);
        }
        if (this.dialogContainerConfig.bodyComponent?.component) {
            this.isBodyComponentPortal = true;
            this.bodyComponentPortal = this.createComponentPortal(this.dialogContainerConfig.bodyComponent.component, this.dialogContainerConfig.bodyComponent.config);
        }
        if (this.dialogContainerConfig.footerComponent?.component) {
            this.isFooterComponentPortal = true;
            this.footerComponentPortal = this.createComponentPortal(this.dialogContainerConfig.footerComponent.component, this.dialogContainerConfig.footerComponent.config);
        }
        this.dialogContainerConfig.open();
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.unsubscribe();
    }
    ngAfterViewInit() {
        this.checkScrollability();
    }
    get getComponentInstances() {
        return this.componentInstances;
    }
    get getPortalOutlet() {
        return this.dialogContainerConfig.content;
    }
    get dialogContainerConfigContent() {
        return this.dialogContainerConfig.content;
    }
    portalAttached(attachedRef, component) {
        const componentRef = attachedRef;
        componentRef.instance['overlayRef'] = this.dialogContainerConfig.overlayRef;
        this.componentInstances = {
            ...this.componentInstances,
            [component]: componentRef.instance,
        };
        this.dialogContainerConfig.init(this.componentInstances);
        if (this.dialogContainerConfig[component].config) {
            Object.keys(this.dialogContainerConfig[component].config).forEach((c) => {
                if (typeof this.dialogContainerConfig[component].config[c] === 'function') {
                    if (componentRef.instance[c] && typeof componentRef.instance[c] !== 'function') {
                        // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
                        // eslint-disable-next-line @typescript-eslint/no-explicit-any
                        componentRef.instance[c].pipe(takeUntil(this.destroy$)).subscribe((args) => {
                            this.dialogContainerConfig[component].config[c].apply(componentRef.instance[c], [args]);
                        });
                    }
                }
                else {
                    componentRef.instance[c] = this.dialogContainerConfig[component].config[c];
                }
            });
        }
    }
    closeDialog() {
        this.dialogContainerConfig.close(this.componentInstances);
    }
    onDismiss() {
        this.dialogContainerConfig.dismiss(this.componentInstances);
        if (!this.dialogContainerConfig.isHandleCloseOnDismiss) {
            this.closeDialog();
        }
    }
    onAccept() {
        this.dialogContainerConfig.accept(this.componentInstances);
        if (!this.dialogContainerConfig.isHandleCloseOnAccept) {
            this.closeDialog();
        }
    }
    /**
     * Based on certain conditions returns the id of the body content to the aria-describedby attr of the container
     */
    getContentId() {
        if (!this.isBodyTemplatePortal && !this.isBodyComponentPortal) {
            return 'containerConfigId';
        }
        else if (this.isBodyTemplatePortal && !this.isBodyComponentPortal) {
            return 'bodyTemplatePortalId';
        }
        else if (this.isBodyComponentPortal) {
            return 'bodyComponentPortalId';
        }
    }
    /**
     * Disable Accept button of default eui-dialog footer.
     */
    disableAcceptButton() {
        this.acceptButtonDisabled$.next(true);
    }
    /**
     * Enable Accept button of default eui-dialog footer.
     */
    enableAcceptButton() {
        this.acceptButtonDisabled$.next(false);
    }
    /**
     * Disable Dismiss button of default eui-dialog footer.
     */
    disableDismissButton() {
        this.dismissButtonDisabled$.next(true);
    }
    /**
     * Enable Dismiss button of default eui-dialog footer.
     */
    enableDismissButton() {
        this.dismissButtonDisabled$.next(false);
    }
    onScroll() {
        this.cd.detectChanges();
    }
    scrollToBottom() {
        const el = document.querySelector('.eui-dialog__body');
        if (el) {
            el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });
        }
    }
    scrollToTop() {
        const el = document.querySelector('.eui-dialog__body');
        if (el) {
            el.scrollTo({ top: 0, behavior: 'smooth' });
        }
    }
    createComponentPortal(component, config) {
        const extendedConfig = { ...config, id: this.dialogContainerConfig.dialogId, overlayRef: this.dialogContainerConfig.overlayRef };
        return new ComponentPortal(component, null, this.createInjector(extendedConfig));
    }
    createInjector(data) {
        const injectorTokens = [{ provide: DIALOG_COMPONENT_CONFIG, useValue: data }];
        return Injector.create({
            parent: this.injector,
            providers: injectorTokens,
        });
    }
    /**
     * Checks if the dialog body is scrollable in order to make the scrollbar focusable or not
     */
    checkScrollability() {
        if (this.dialogBody?.nativeElement) {
            const element = this.dialogBody.nativeElement;
            this.isBodyScrollable.set(element.scrollHeight > element.clientHeight);
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: EuiDialogContainerComponent, isStandalone: true, selector: "eui-dialog-container", inputs: { closeButtonAriaLabel: "closeButtonAriaLabel" }, host: { properties: { "class": "this.string" } }, viewQueries: [{ propertyName: "dialogBody", first: true, predicate: ["dialogBody"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n    class=\"eui-dialog eui-dialog--{{ dialogContainerConfig.variant }} eui-19\"\n    [class.eui-dialog--draggable]=\"dialogContainerConfig.isDraggable\"\n    [class.eui-dialog--message-box]=\"dialogContainerConfig.isMessageBox\"\n    [class.eui-dialog--no-padding]=\"dialogContainerConfig.hasNoBodyPadding\"\n    [class.eui-dialog--custom-size]=\"dialogContainerConfig.hasMobileCustomSize\"\n    [attr.role]=\"dialogContainerConfig.isMessageBox ? 'alertdialog' : 'dialog'\"\n    aria-labelledby=\"dialogContent\"\n    [attr.aria-describedby]=\"getContentId()\"\n    [attr.aria-modal]=\"true\"\n    tabindex=\"-1\"\n    attr.data-e2e=\"{{ dialogContainerConfig.e2eAttr }}\"\n    cdkDrag\n    cdkDragRootElement=\".cdk-overlay-pane\"\n    [cdkDragDisabled]=\"!dialogContainerConfig.isDraggable\"\n    cdkTrapFocus\n    cdkTrapFocusAutoCapture>\n    <div class=\"eui-dialog__content\" role=\"document\" id=\"dialogContent\" aria-labelledby=\"headerTitle\">\n        <div class=\"eui-dialog__header\" [class.eui-dialog__header--handle-disabled]=\"!dialogContainerConfig.isDraggable\" cdkDragHandle>\n            @if (!isHeaderTemplatePortal && !isHeaderComponentPortal) {\n\n                @if (dialogContainerConfig.isMessageBox) {\n                    <eui-icon-state [euiVariant]=\"dialogContainerConfig.variant\" size=\"xl\" class=\"eui-dialog__header-icon\"/>\n                }\n                <h2 id=\"headerTitle\" class=\"eui-dialog__header-title\" role=\"heading\" aria-level=\"2\">{{ dialogContainerConfig.title | translate }}</h2>\n\n                @if (dialogContainerConfig.hasCloseButton) {\n                    <div class=\"eui-dialog__header-close-container\">\n                        <button\n                            class=\"dialog-close-button\"\n                            (click)=\"closeDialog()\"\n                            euiButton\n                            euiIconButton\n                            euiRounded\n                            euiBasicButton\n                            [attr.aria-label]=\"closeButtonAriaLabel\">\n                            <eui-icon-svg icon=\"close:outline\"></eui-icon-svg>\n                        </button>\n                    </div>\n                }\n            }\n            @if (isHeaderTemplatePortal) {\n                <ng-template [cdkPortalOutlet]=\"dialogContainerConfig.header\"></ng-template>\n            }\n            @if (isHeaderComponentPortal) {\n                <ng-template [cdkPortalOutlet]=\"headerComponentPortal\" (attached)=\"portalAttached($event, 'headerComponent')\"></ng-template>\n            }\n        </div>\n        <div\n            #dialogBody\n            class=\"eui-dialog__body\"\n            cdkScrollable\n            [style.height]=\"dialogContainerConfig.height\"\n            [style.max-height]=\"dialogContainerConfig.height\"\n            (scroll)=\"onScroll()\"\n            [attr.tabindex]=\"isBodyScrollable() ? '0' : '-1'\">\n            @if (!isBodyTemplatePortal && !isBodyComponentPortal) {\n                <div\n                    id=\"containerConfigId\"\n                    class=\"eui-dialog__body-content not-isBodyTemplatePortal\"\n                    [innerHTML]=\"dialogContainerConfig.content ? (dialogContainerConfigContent | translate) : null\">\n                </div>\n            }\n            @if (isBodyTemplatePortal && !isBodyComponentPortal) {\n                <div id=\"bodyTemplatePortalId\" class=\"eui-dialog__body-content isBodyTemplatePortal\">\n                    <ng-template [cdkPortalOutlet]=\"getPortalOutlet\"></ng-template>\n                </div>\n            }\n            @if (isBodyComponentPortal) {\n                <div id=\"bodyComponentPortalId\" class=\"eui-dialog__body-content isBodyComponentPortal\">\n                    <ng-template [cdkPortalOutlet]=\"bodyComponentPortal\" (attached)=\"portalAttached($event, 'bodyComponent')\"></ng-template>\n                </div>\n            }\n        </div>\n        @if (dialogContainerConfig.hasFooter) {\n            <div class=\"eui-dialog__footer\">\n                @if (!isFooterTemplatePortal && !isFooterComponentPortal) {\n                    @if (isFooterTemplatePortal) {\n                        <ng-template [cdkPortalOutlet]=\"dialogContainerConfig.footer\"></ng-template>\n                    }\n                    @if (!isFooterTemplatePortal) {\n                        <div class=\"eui-dialog__footer-content\">\n                            @if (dialogContainerConfig.hasDismissButton) {\n                                <button\n                                    euiButton\n                                    type=\"button\"\n                                    [euiDisabled]=\"dismissButtonDisabled$ | async\"\n                                    class=\"eui-dialog__footer-dismiss-button\"\n                                    [class.eui-dialog__footer-dismiss-button--with-accept-button]=\"dialogContainerConfig.hasAcceptButton\"\n                                    (click)=\"onDismiss()\">\n                                    {{ dialogContainerConfig.dismissLabel | translate }}\n                                </button>\n                            }\n                            @if (dialogContainerConfig.hasAcceptButton) {\n                                <button\n                                    euiButton\n                                    [euiVariant]=\"dialogContainerConfig.isMessageBox && !(dialogContainerConfig.variant === 'secondary') ? dialogContainerConfig.variant: 'primary'\"\n                                    type=\"button\"\n                                    [euiDisabled]=\"acceptButtonDisabled$ | async\"\n                                    class=\"eui-dialog__footer-accept-button\"\n                                    (click)=\"onAccept()\">\n                                    {{ dialogContainerConfig.acceptLabel | translate }}\n                                </button>\n                            }\n                        </div>\n                    }\n                }\n\n                @if (isFooterTemplatePortal) {\n                    <ng-template [cdkPortalOutlet]=\"dialogContainerConfig.footer\"></ng-template>\n                }\n                @if (isFooterComponentPortal) {\n                    <ng-template [cdkPortalOutlet]=\"footerComponentPortal\" (attached)=\"portalAttached($event, 'footerComponent')\"></ng-template>\n                }\n\n            </div>\n        }\n    </div>\n</div>\n", styles: [".eui-19 .eui-dialog{--_color: var(--eui-c-text)}.eui-19 .eui-dialog.eui-dialog--primary{--_color: var(--eui-c-s-primary)}.eui-19 .eui-dialog.eui-dialog--secondary{--_color: var(--eui-c-s-secondary)}.eui-19 .eui-dialog.eui-dialog--info{--_color: var(--eui-c-s-info)}.eui-19 .eui-dialog.eui-dialog--success{--_color: var(--eui-c-s-success)}.eui-19 .eui-dialog.eui-dialog--warning{--_color: var(--eui-c-s-warning)}.eui-19 .eui-dialog.eui-dialog--danger{--_color: var(--eui-c-s-danger)}.eui-19 .eui-dialog-container{display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog{background-color:var(--eui-c-surface-page);border:var(--eui-bw-s) solid var(--eui-c-s-secondary-border-lighter);border-radius:var(--eui-br-m);box-shadow:var(--eui-sh-12);display:flex;height:100%;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content{display:flex;flex-direction:column;position:relative;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header{align-items:center;border-top-left-radius:var(--eui-br-m);border-top-right-radius:var(--eui-br-m);display:flex;flex:0 0 auto;padding:var(--eui-s-s) var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header{align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-icon{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-title{color:var(--_color);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--eui-f-l-bold)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-close-container{display:flex;margin-left:auto}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header.eui-dialog__header--handle-disabled{cursor:default!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{display:flex;overflow:auto;position:relative}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar{display:inherit;height:10px;width:10px;background-color:var(--eui-c-s-secondary-surface-light)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb{background-color:var(--_eui-scrollbars-foreground-color);border-radius:5rem;background-clip:padding-box;border:2px solid transparent}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-s-secondary-surface);border:0;cursor:grab}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-track{background-color:var(--eui-c-s-secondary-surface-light);border-radius:0}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{scrollbar-color:var(--eui-c-s-secondary-surface) var(--eui-c-s-secondary-surface-light);scrollbar-width:auto}}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible{scrollbar-color:var(--eui-c-focus-visible) var(--eui-c-s-secondary-surface-light)}}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-xs) var(--eui-s-m) var(--eui-s-xl) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer{align-items:center;background-color:var(--eui-c-surface-page);border-bottom-left-radius:var(--eui-br-m);border-bottom-right-radius:var(--eui-br-m);border-top:1px solid var(--eui-c-divider-light);display:flex;padding:var(--eui-s-s) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer{align-items:center;display:flex;justify-content:center;text-align:center;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-content{align-items:center;display:flex;justify-content:flex-end;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-dismiss-button--with-accept-button{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog--no-padding .eui-dialog__content .eui-dialog__body-content{padding:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body{align-items:center;display:flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-m);align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon-container{align-self:flex-start;padding:var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon{display:inline-flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content p{margin-top:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon{margin:0 var(--eui-c-s)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon-content{border-radius:var(--eui-br-max);font-size:var(--eui-f-size-5xl);margin-right:var(--eui-c-s);overflow:auto;padding:var(--eui-s-s)}.eui-19 .eui-dialog__backdrop.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{background-color:var(--eui-c-s-secondary-surface-light);opacity:var(--eui-o-50)}.eui-19 .eui-dialog-container .eui-dialog--draggable .eui-dialog__header{cursor:move}@media screen and (max-width: 767px){.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size){left:0;position:fixed;top:0}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content{height:100vh;height:calc(var(--eui-app-vh, 1vh) * 100);width:100vw}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__header{border-top-left-radius:0;border-top-right-radius:0;flex:0 0 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body{flex:1 1 auto;height:100vh!important;max-height:100vh!important;max-width:100vw!important;overflow-x:hidden;overflow-y:auto;width:100vw!important}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body-content{flex:1 1 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__footer{border-bottom-left-radius:0;border-bottom-right-radius:0;flex:0 0 auto;width:100vw}}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: PortalModule }, { kind: "directive", type: i2.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i3.CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i4.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i5.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: i5.CdkDragHandle, selector: "[cdkDragHandle]", inputs: ["cdkDragHandleDisabled"] }, { kind: "ngmodule", type: CdkScrollableModule }, { kind: "component", type: i6.EuiButtonComponent, selector: "button[euiButton], a[euiButton]", inputs: ["e2eAttr", "id", "euiBasicButton", "euiButtonCall", "euiCTAButton", "euiBlockButton", "euiIconButton", "euiAvatarButton", "euiLineWrap", "isCompact", "hasNoFocusRing", "isChecked", "euiDisabled"], outputs: ["buttonClick"] }, { kind: "component", type: i7.EuiIconSvgComponent, selector: "eui-icon-svg, span[euiIconSvg], i[euiIconSvg]", inputs: ["icon", "fillColor", "set", "size", "style", "iconUrl", "transform", "euiVariant", "aria-label", "ariaHidden", "focusable", "isLoading", "isInputIcon", "euiStart", "euiEnd"] }, { kind: "component", type: i8.EuiIconStateComponent, selector: "eui-icon-state", inputs: ["size", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogContainerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-dialog-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
                        AsyncPipe,
                        TranslateModule,
                        PortalModule,
                        OverlayModule,
                        A11yModule,
                        DragDropModule,
                        CdkScrollableModule,
                        ...EUI_BUTTON,
                        ...EUI_ICON,
                        ...EUI_ICON_BUTTON,
                        ...EUI_ICON_STATE,
                    ], template: "<div\n    class=\"eui-dialog eui-dialog--{{ dialogContainerConfig.variant }} eui-19\"\n    [class.eui-dialog--draggable]=\"dialogContainerConfig.isDraggable\"\n    [class.eui-dialog--message-box]=\"dialogContainerConfig.isMessageBox\"\n    [class.eui-dialog--no-padding]=\"dialogContainerConfig.hasNoBodyPadding\"\n    [class.eui-dialog--custom-size]=\"dialogContainerConfig.hasMobileCustomSize\"\n    [attr.role]=\"dialogContainerConfig.isMessageBox ? 'alertdialog' : 'dialog'\"\n    aria-labelledby=\"dialogContent\"\n    [attr.aria-describedby]=\"getContentId()\"\n    [attr.aria-modal]=\"true\"\n    tabindex=\"-1\"\n    attr.data-e2e=\"{{ dialogContainerConfig.e2eAttr }}\"\n    cdkDrag\n    cdkDragRootElement=\".cdk-overlay-pane\"\n    [cdkDragDisabled]=\"!dialogContainerConfig.isDraggable\"\n    cdkTrapFocus\n    cdkTrapFocusAutoCapture>\n    <div class=\"eui-dialog__content\" role=\"document\" id=\"dialogContent\" aria-labelledby=\"headerTitle\">\n        <div class=\"eui-dialog__header\" [class.eui-dialog__header--handle-disabled]=\"!dialogContainerConfig.isDraggable\" cdkDragHandle>\n            @if (!isHeaderTemplatePortal && !isHeaderComponentPortal) {\n\n                @if (dialogContainerConfig.isMessageBox) {\n                    <eui-icon-state [euiVariant]=\"dialogContainerConfig.variant\" size=\"xl\" class=\"eui-dialog__header-icon\"/>\n                }\n                <h2 id=\"headerTitle\" class=\"eui-dialog__header-title\" role=\"heading\" aria-level=\"2\">{{ dialogContainerConfig.title | translate }}</h2>\n\n                @if (dialogContainerConfig.hasCloseButton) {\n                    <div class=\"eui-dialog__header-close-container\">\n                        <button\n                            class=\"dialog-close-button\"\n                            (click)=\"closeDialog()\"\n                            euiButton\n                            euiIconButton\n                            euiRounded\n                            euiBasicButton\n                            [attr.aria-label]=\"closeButtonAriaLabel\">\n                            <eui-icon-svg icon=\"close:outline\"></eui-icon-svg>\n                        </button>\n                    </div>\n                }\n            }\n            @if (isHeaderTemplatePortal) {\n                <ng-template [cdkPortalOutlet]=\"dialogContainerConfig.header\"></ng-template>\n            }\n            @if (isHeaderComponentPortal) {\n                <ng-template [cdkPortalOutlet]=\"headerComponentPortal\" (attached)=\"portalAttached($event, 'headerComponent')\"></ng-template>\n            }\n        </div>\n        <div\n            #dialogBody\n            class=\"eui-dialog__body\"\n            cdkScrollable\n            [style.height]=\"dialogContainerConfig.height\"\n            [style.max-height]=\"dialogContainerConfig.height\"\n            (scroll)=\"onScroll()\"\n            [attr.tabindex]=\"isBodyScrollable() ? '0' : '-1'\">\n            @if (!isBodyTemplatePortal && !isBodyComponentPortal) {\n                <div\n                    id=\"containerConfigId\"\n                    class=\"eui-dialog__body-content not-isBodyTemplatePortal\"\n                    [innerHTML]=\"dialogContainerConfig.content ? (dialogContainerConfigContent | translate) : null\">\n                </div>\n            }\n            @if (isBodyTemplatePortal && !isBodyComponentPortal) {\n                <div id=\"bodyTemplatePortalId\" class=\"eui-dialog__body-content isBodyTemplatePortal\">\n                    <ng-template [cdkPortalOutlet]=\"getPortalOutlet\"></ng-template>\n                </div>\n            }\n            @if (isBodyComponentPortal) {\n                <div id=\"bodyComponentPortalId\" class=\"eui-dialog__body-content isBodyComponentPortal\">\n                    <ng-template [cdkPortalOutlet]=\"bodyComponentPortal\" (attached)=\"portalAttached($event, 'bodyComponent')\"></ng-template>\n                </div>\n            }\n        </div>\n        @if (dialogContainerConfig.hasFooter) {\n            <div class=\"eui-dialog__footer\">\n                @if (!isFooterTemplatePortal && !isFooterComponentPortal) {\n                    @if (isFooterTemplatePortal) {\n                        <ng-template [cdkPortalOutlet]=\"dialogContainerConfig.footer\"></ng-template>\n                    }\n                    @if (!isFooterTemplatePortal) {\n                        <div class=\"eui-dialog__footer-content\">\n                            @if (dialogContainerConfig.hasDismissButton) {\n                                <button\n                                    euiButton\n                                    type=\"button\"\n                                    [euiDisabled]=\"dismissButtonDisabled$ | async\"\n                                    class=\"eui-dialog__footer-dismiss-button\"\n                                    [class.eui-dialog__footer-dismiss-button--with-accept-button]=\"dialogContainerConfig.hasAcceptButton\"\n                                    (click)=\"onDismiss()\">\n                                    {{ dialogContainerConfig.dismissLabel | translate }}\n                                </button>\n                            }\n                            @if (dialogContainerConfig.hasAcceptButton) {\n                                <button\n                                    euiButton\n                                    [euiVariant]=\"dialogContainerConfig.isMessageBox && !(dialogContainerConfig.variant === 'secondary') ? dialogContainerConfig.variant: 'primary'\"\n                                    type=\"button\"\n                                    [euiDisabled]=\"acceptButtonDisabled$ | async\"\n                                    class=\"eui-dialog__footer-accept-button\"\n                                    (click)=\"onAccept()\">\n                                    {{ dialogContainerConfig.acceptLabel | translate }}\n                                </button>\n                            }\n                        </div>\n                    }\n                }\n\n                @if (isFooterTemplatePortal) {\n                    <ng-template [cdkPortalOutlet]=\"dialogContainerConfig.footer\"></ng-template>\n                }\n                @if (isFooterComponentPortal) {\n                    <ng-template [cdkPortalOutlet]=\"footerComponentPortal\" (attached)=\"portalAttached($event, 'footerComponent')\"></ng-template>\n                }\n\n            </div>\n        }\n    </div>\n</div>\n", styles: [".eui-19 .eui-dialog{--_color: var(--eui-c-text)}.eui-19 .eui-dialog.eui-dialog--primary{--_color: var(--eui-c-s-primary)}.eui-19 .eui-dialog.eui-dialog--secondary{--_color: var(--eui-c-s-secondary)}.eui-19 .eui-dialog.eui-dialog--info{--_color: var(--eui-c-s-info)}.eui-19 .eui-dialog.eui-dialog--success{--_color: var(--eui-c-s-success)}.eui-19 .eui-dialog.eui-dialog--warning{--_color: var(--eui-c-s-warning)}.eui-19 .eui-dialog.eui-dialog--danger{--_color: var(--eui-c-s-danger)}.eui-19 .eui-dialog-container{display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog{background-color:var(--eui-c-surface-page);border:var(--eui-bw-s) solid var(--eui-c-s-secondary-border-lighter);border-radius:var(--eui-br-m);box-shadow:var(--eui-sh-12);display:flex;height:100%;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content{display:flex;flex-direction:column;position:relative;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header{align-items:center;border-top-left-radius:var(--eui-br-m);border-top-right-radius:var(--eui-br-m);display:flex;flex:0 0 auto;padding:var(--eui-s-s) var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header{align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-icon{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-title{color:var(--_color);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--eui-f-l-bold)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-close-container{display:flex;margin-left:auto}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header.eui-dialog__header--handle-disabled{cursor:default!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{display:flex;overflow:auto;position:relative}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar{display:inherit;height:10px;width:10px;background-color:var(--eui-c-s-secondary-surface-light)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb{background-color:var(--_eui-scrollbars-foreground-color);border-radius:5rem;background-clip:padding-box;border:2px solid transparent}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-s-secondary-surface);border:0;cursor:grab}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-track{background-color:var(--eui-c-s-secondary-surface-light);border-radius:0}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{scrollbar-color:var(--eui-c-s-secondary-surface) var(--eui-c-s-secondary-surface-light);scrollbar-width:auto}}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible{scrollbar-color:var(--eui-c-focus-visible) var(--eui-c-s-secondary-surface-light)}}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-xs) var(--eui-s-m) var(--eui-s-xl) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer{align-items:center;background-color:var(--eui-c-surface-page);border-bottom-left-radius:var(--eui-br-m);border-bottom-right-radius:var(--eui-br-m);border-top:1px solid var(--eui-c-divider-light);display:flex;padding:var(--eui-s-s) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer{align-items:center;display:flex;justify-content:center;text-align:center;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-content{align-items:center;display:flex;justify-content:flex-end;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-dismiss-button--with-accept-button{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog--no-padding .eui-dialog__content .eui-dialog__body-content{padding:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body{align-items:center;display:flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-m);align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon-container{align-self:flex-start;padding:var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon{display:inline-flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content p{margin-top:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon{margin:0 var(--eui-c-s)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon-content{border-radius:var(--eui-br-max);font-size:var(--eui-f-size-5xl);margin-right:var(--eui-c-s);overflow:auto;padding:var(--eui-s-s)}.eui-19 .eui-dialog__backdrop.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{background-color:var(--eui-c-s-secondary-surface-light);opacity:var(--eui-o-50)}.eui-19 .eui-dialog-container .eui-dialog--draggable .eui-dialog__header{cursor:move}@media screen and (max-width: 767px){.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size){left:0;position:fixed;top:0}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content{height:100vh;height:calc(var(--eui-app-vh, 1vh) * 100);width:100vw}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__header{border-top-left-radius:0;border-top-right-radius:0;flex:0 0 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body{flex:1 1 auto;height:100vh!important;max-height:100vh!important;max-width:100vw!important;overflow-x:hidden;overflow-y:auto;width:100vw!important}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body-content{flex:1 1 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__footer{border-bottom-left-radius:0;border-bottom-right-radius:0;flex:0 0 auto;width:100vw}}\n"] }]
        }], propDecorators: { dialogBody: [{
                type: ViewChild,
                args: ['dialogBody', { read: ElementRef }]
            }], string: [{
                type: HostBinding,
                args: ['class']
            }], closeButtonAriaLabel: [{
                type: Input
            }] } });

class OpenedDialog {
    constructor(values) {
        this.id = null;
        this.order = null;
        this.overlayRef = null;
        // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        this.containerRef = null;
        Object.assign(this, values);
    }
}

class EuiDialogService {
    constructor() {
        this.overlay = inject(Overlay);
        this.injector = inject(Injector);
        this.openedDialogs$ = new BehaviorSubject([]);
        this.destroy$ = new Subject();
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.unsubscribe();
        this.overlayRef?.dispose();
        this.overlayRef = null;
        this.openedDialogs$.next(null);
    }
    /**
     * Open a dialog.
     *
     * @param config Configuration applied to the dialog.
     * @param parentInjector The injector of the calling component, used to expose its local providers to the dynamically created component.
     * @returns A dialog object of type `OpenedDialog`
     */
    openDialog(config = {}, parentInjector) {
        const positionStrategy = this.getPositionStrategy(config.verticalPosition);
        const scrollStrategy = this.overlay.scrollStrategies.block();
        const hasClosedOnEscape = config.hasClosedOnEscape;
        const hasCloseButton = config.hasCloseButton;
        const dialogConfig = new EuiDialogConfig({
            ...config,
            hasClosedOnEscape,
            hasCloseButton,
            width: config.isFullScreen ? '98vw' : config.width,
            height: config.isFullScreen ? '97vh' : config.height,
        });
        const dialogId = 'eui-dialog-' + Math.floor(Math.random() * 10000);
        const overlayRef = this.overlay.create({
            backdropClass: ['eui-dialog__backdrop', dialogId + '__backdrop'],
            hasBackdrop: true,
            height: dialogConfig.height,
            width: dialogConfig.width,
            positionStrategy,
            scrollStrategy,
            disposeOnNavigation: true,
            panelClass: [config.classList, 'eui-19'],
        });
        this.overlayRef = overlayRef;
        let openedDialog = new OpenedDialog({
            id: dialogId,
            order: this.openedDialogs$.value.length + 1,
            overlayRef,
            containerRef: null,
        });
        const extendedConfig = {
            ...dialogConfig,
            dialogId,
            overlayRef,
            init: (instances) => {
                config.init?.(instances);
            },
            open: () => {
                config.open?.();
            },
            clickOutside: (instances) => {
                config.clickOutside?.(instances);
            },
            escape: (instances) => {
                config.escape?.(instances);
            },
            close: (instances) => {
                if (!config.isHandleCloseOnClose) {
                    this.closeDialog(dialogId);
                }
                config.close?.(instances);
            },
            dismiss: (instances) => {
                config.dismiss?.(instances);
            },
            accept: (instances) => {
                config.accept?.(instances);
            },
        };
        const containerPortal = new ComponentPortal(EuiDialogContainerComponent, null, this.createInjector(extendedConfig, parentInjector));
        const containerRef = openedDialog.overlayRef.attach(containerPortal);
        openedDialog = { ...openedDialog, containerRef };
        openedDialog.overlayRef
            .backdropClick()
            .pipe(takeUntil(this.destroy$))
            .subscribe(() => {
            if (extendedConfig.hasClosedOnClickOutside) {
                config.clickOutside?.(containerRef.instance.componentInstances);
                if (!config.isHandleCloseOnClickOutside) {
                    containerRef.instance.closeDialog();
                }
            }
        });
        if (extendedConfig.hasClosedOnEscape) {
            openedDialog.overlayRef
                .keydownEvents()
                .pipe(takeUntil(this.destroy$))
                .subscribe((keyboardEvent) => {
                if (keyboardEvent.key?.toLowerCase() === 'escape') {
                    config.escape?.(containerRef.instance.componentInstances);
                    if (!config.isHandleCloseOnEscape) {
                        containerRef.instance.closeDialog();
                    }
                }
            });
        }
        this.openedDialogs$.next([...this.openedDialogs$.value, openedDialog]);
        return openedDialog;
    }
    /**
     * Close a dialog
     *
     * @param dialogId The id of the dialog to close. If not provided the last opened one will be closed.
     */
    closeDialog(dialogId) {
        if (dialogId) {
            this.openedDialogs$.value.find((o) => o.id === dialogId).overlayRef.dispose();
            this.openedDialogs$.next(this.openedDialogs$.value.filter((o) => o.id !== dialogId));
            this.overlayRef =
                this.openedDialogs$.value.length > 0 ? this.openedDialogs$.value[this.openedDialogs$.value.length - 1].overlayRef : null;
        }
        else {
            this.overlayRef?.dispose();
            this.openedDialogs$.next(this.openedDialogs$.value.filter((o, i) => i < this.openedDialogs$.value.length - 1));
            this.overlayRef =
                this.openedDialogs$.value.length > 0 ? this.openedDialogs$.value[this.openedDialogs$.value.length - 1].overlayRef : null;
        }
    }
    /**
     * Close all the dialogs.
     */
    closeAllDialogs() {
        this.openedDialogs$.value.forEach((dialog) => {
            dialog.containerRef.instance.dialogContainerConfig.close?.(dialog.containerRef.instance.getComponentInstances);
        });
    }
    /**
     * Returns an `Observable` with all opened windows.
     *
     * @returns `Observable` of `OpenedDialog[]`.
     */
    getOpenedDialog() {
        return this.openedDialogs$;
    }
    /**
     * Returns an `Object` with a dialog
     *
     * @param dialogId id of the dialog to be returned
     * @returns `OpenedDialog`
     */
    getDialog(dialogId) {
        return this.openedDialogs$.value.find((o) => o.id === dialogId);
    }
    /**
     * Disable Accept button of default eui-dialog footer.
     */
    disableAcceptButton() {
        this.openedDialogs$.value[this.openedDialogs$.value.length - 1].containerRef.instance.disableAcceptButton();
    }
    /**
     * Enable Accept button of default eui-dialog footer.
     */
    enableAcceptButton() {
        this.openedDialogs$.value[this.openedDialogs$.value.length - 1].containerRef.instance.enableAcceptButton();
    }
    /**
     * Disable Dismiss button of default eui-dialog footer.
     */
    disableDismissButton() {
        this.openedDialogs$.value[this.openedDialogs$.value.length - 1].containerRef.instance.disableDismissButton();
    }
    /**
     * Enable Dismiss button of default eui-dialog footer.
     */
    enableDismissButton() {
        this.openedDialogs$.value[this.openedDialogs$.value.length - 1].containerRef.instance.enableDismissButton();
    }
    // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    createInjector(data, parentInjector) {
        const injectorTokens = [{ provide: DIALOG_CONTAINER_CONFIG, useValue: data }];
        return Injector.create({
            parent: parentInjector ? parentInjector : this.injector,
            providers: injectorTokens,
        });
    }
    getPositionStrategy(verticalPosition) {
        const positionStrategy = this.overlay.position().global().centerHorizontally().centerVertically();
        if (verticalPosition === 'top') {
            positionStrategy.top();
        }
        return positionStrategy;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogService, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }] });

class EuiDialogComponent {
    constructor() {
        this.e2eAttr = 'eui-dialog';
        this.acceptLabel = 'eui.OK';
        this.dismissLabel = 'eui.CANCEL';
        this.width = '50%';
        this.height = 'auto';
        this.isFullScreen = false;
        this.hasCloseButton = true;
        this.hasAcceptButton = true;
        this.hasDismissButton = true;
        this.hasMobileCustomSize = false;
        this.hasClosedOnClickOutside = false;
        this.hasClosedOnEscape = true;
        this.isHandleCloseOnDismiss = false;
        this.isHandleCloseOnClose = false;
        this.isHandleCloseOnAccept = false;
        this.isHandleCloseOnClickOutside = false;
        this.isHandleCloseOnEscape = false;
        this.isMessageBox = false;
        this.isDraggable = false;
        this.hasNoBodyPadding = false;
        this.hasFooter = true;
        this.classList = null;
        this.clickOutside = new EventEmitter();
        this.escape = new EventEmitter();
        this.dialogOpen = new EventEmitter();
        this.dialogClose = new EventEmitter();
        this.dismiss = new EventEmitter();
        this.accept = new EventEmitter();
        this.isOpen$ = new BehaviorSubject(false);
        this.baseStatesDirective = inject(BaseStatesDirective);
        this.destroy$ = new Subject();
        this.viewContainerRef = inject(ViewContainerRef);
        this.euiDialogService = inject(EuiDialogService);
    }
    ngOnChanges(changes) {
        if (changes.title && this.dialog && this.euiDialogService.getDialog(this.dialog.id)) {
            const newTitle = changes.title.currentValue;
            // Update the dialog service with the new title
            this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.dialogContainerConfig.title = newTitle;
            // Trigger change detection to reflect the updated title
            this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.cd.markForCheck();
        }
    }
    ngOnInit() {
        if (this.isFullScreen) {
            this.width = '98vw';
            this.height = '97vh';
        }
        if (this.isMessageBox) {
            this.hasClosedOnEscape = false;
            this.hasCloseButton = false;
        }
    }
    ngAfterViewInit() {
        if (this.euiDialogHeaderDirective) {
            this.templatePortalHeader = new TemplatePortal(this.templateRefHeader, this.viewContainerRef);
        }
        this.templatePortalContent = new TemplatePortal(this.templateRefContent, this.viewContainerRef);
        if (this.euiDialogFooterDirective) {
            this.templatePortalFooter = new TemplatePortal(this.templateRefFooter, this.viewContainerRef);
        }
    }
    ngOnDestroy() {
        this.destroy$.next(true);
        this.destroy$.unsubscribe();
    }
    /**
     * Whether the eui-dialog is open.
     *
     * @usageNotes
     * ```html
     * <eui-dialog #dialog>
     *      \@if (dialog.isOpen) {
     *          <my-component></my-component>
     *      }
     * </eui-dialog>
     * ```
     * @returns A boolean with value `true` when open, otherwise `false`.
     */
    get isOpen() {
        return this.isOpen$.value;
    }
    /**
     * Open a dialog.
     *
     * @returns A dialog object of type `OpenedDialog`
     */
    openDialog() {
        const config = {
            e2eAttr: this.e2eAttr,
            title: this.title,
            width: this.width,
            height: this.height,
            isFullScreen: this.isFullScreen,
            variant: this.baseStatesDirective.euiVariant,
            acceptLabel: this.acceptLabel,
            dismissLabel: this.dismissLabel,
            hasCloseButton: this.hasCloseButton,
            hasAcceptButton: this.hasAcceptButton,
            hasDismissButton: this.hasDismissButton,
            hasMobileCustomSize: this.hasMobileCustomSize,
            hasClosedOnClickOutside: this.hasClosedOnClickOutside,
            hasClosedOnEscape: this.hasClosedOnEscape,
            isHandleCloseOnDismiss: this.isHandleCloseOnDismiss,
            isHandleCloseOnClose: this.isHandleCloseOnClose,
            isHandleCloseOnAccept: this.isHandleCloseOnAccept,
            isHandleCloseOnClickOutside: this.isHandleCloseOnClickOutside,
            isHandleCloseOnEscape: this.isHandleCloseOnEscape,
            isDraggable: this.isDraggable,
            hasNoBodyPadding: this.hasNoBodyPadding,
            hasFooter: this.hasFooter,
            verticalPosition: this.verticalPosition,
            header: this.templatePortalHeader,
            content: this.templatePortalContent,
            footer: this.templatePortalFooter,
            classList: this.classList,
            clickOutside: () => {
                if (this.hasClosedOnClickOutside && !this.isHandleCloseOnClickOutside) {
                    this.isOpen$.next(false);
                }
                this.clickOutside.emit();
            },
            escape: () => {
                if (this.hasClosedOnEscape && !this.isHandleCloseOnEscape) {
                    this.isOpen$.next(false);
                }
                this.escape.emit();
            },
            open: () => {
                this.dialogOpen.emit();
            },
            close: () => {
                if (!this.isHandleCloseOnClose) {
                    this.isOpen$.next(false);
                }
                this.dialogClose.emit();
            },
            dismiss: () => {
                if (!this.isHandleCloseOnDismiss) {
                    this.isOpen$.next(false);
                }
                this.dismiss.emit();
            },
            accept: () => {
                if (!this.isHandleCloseOnAccept) {
                    this.isOpen$.next(false);
                }
                this.accept.emit();
            },
        };
        this.isOpen$.next(true);
        this.dialog = this.euiDialogService.openDialog(config);
        return this.dialog;
    }
    /**
     * Close a Dialog
     */
    closeDialog() {
        this.isOpen$.next(false);
        this.euiDialogService.closeDialog();
    }
    /**
     * Disable Accept button of default eui-dialog footer.
     */
    disableAcceptButton() {
        this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.disableAcceptButton();
    }
    /**
     * Enable Accept button of default eui-dialog footer.
     */
    enableAcceptButton() {
        this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.enableAcceptButton();
    }
    /**
     * Disable Dismiss button of default eui-dialog footer.
     */
    disableDismissButton() {
        this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.disableDismissButton();
    }
    /**
     * Enable Dismiss button of default eui-dialog footer.
     */
    enableDismissButton() {
        this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.enableDismissButton();
    }
    /**
     * Scroll to the bottom of the content
     */
    scrollToBottom() {
        this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.scrollToBottom();
    }
    /**
     * Scroll to the top of the content
     */
    scrollToTop() {
        this.euiDialogService.getDialog(this.dialog.id).containerRef.instance.scrollToTop();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.17", type: EuiDialogComponent, isStandalone: true, selector: "eui-dialog", inputs: { e2eAttr: "e2eAttr", title: "title", acceptLabel: "acceptLabel", dismissLabel: "dismissLabel", verticalPosition: "verticalPosition", width: "width", height: "height", isFullScreen: ["isFullScreen", "isFullScreen", booleanAttribute], hasCloseButton: ["hasCloseButton", "hasCloseButton", booleanAttribute], hasAcceptButton: ["hasAcceptButton", "hasAcceptButton", booleanAttribute], hasDismissButton: ["hasDismissButton", "hasDismissButton", booleanAttribute], hasMobileCustomSize: ["hasMobileCustomSize", "hasMobileCustomSize", booleanAttribute], hasClosedOnClickOutside: ["hasClosedOnClickOutside", "hasClosedOnClickOutside", booleanAttribute], hasClosedOnEscape: ["hasClosedOnEscape", "hasClosedOnEscape", booleanAttribute], isHandleCloseOnDismiss: ["isHandleCloseOnDismiss", "isHandleCloseOnDismiss", booleanAttribute], isHandleCloseOnClose: ["isHandleCloseOnClose", "isHandleCloseOnClose", booleanAttribute], isHandleCloseOnAccept: ["isHandleCloseOnAccept", "isHandleCloseOnAccept", booleanAttribute], isHandleCloseOnClickOutside: ["isHandleCloseOnClickOutside", "isHandleCloseOnClickOutside", booleanAttribute], isHandleCloseOnEscape: ["isHandleCloseOnEscape", "isHandleCloseOnEscape", booleanAttribute], isMessageBox: ["isMessageBox", "isMessageBox", booleanAttribute], isDraggable: ["isDraggable", "isDraggable", booleanAttribute], hasNoBodyPadding: ["hasNoBodyPadding", "hasNoBodyPadding", booleanAttribute], hasFooter: ["hasFooter", "hasFooter", booleanAttribute], classList: "classList" }, outputs: { clickOutside: "clickOutside", escape: "escape", dialogOpen: "dialogOpen", dialogClose: "dialogClose", dismiss: "dismiss", accept: "accept" }, providers: [{ provide: DIALOG_COMPONENT_CONFIG, useValue: null }], queries: [{ propertyName: "euiDialogHeaderDirective", first: true, predicate: i0.forwardRef(() => EuiDialogHeaderDirective), descendants: true }, { propertyName: "euiDialogFooterDirective", first: true, predicate: i0.forwardRef(() => EuiDialogFooterDirective), descendants: true }], viewQueries: [{ propertyName: "templateRefHeader", first: true, predicate: ["templateRefHeader"], descendants: true }, { propertyName: "templateRefContent", first: true, predicate: ["templateRefContent"], descendants: true }, { propertyName: "templateRefFooter", first: true, predicate: ["templateRefFooter"], descendants: true }], usesOnChanges: true, hostDirectives: [{ directive: i1$1.BaseStatesDirective, inputs: ["euiPrimary", "euiPrimary", "euiSecondary", "euiSecondary", "euiInfo", "euiInfo", "euiSuccess", "euiSuccess", "euiWarning", "euiWarning", "euiDanger", "euiDanger", "euiAccent", "euiAccent", "euiVariant", "euiVariant"] }], ngImport: i0, template: "<ng-template #templateRefHeader>\n    <ng-content select=\"eui-dialog-header\" />\n</ng-template>\n<ng-template #templateRefContent>\n    <ng-content />\n</ng-template>\n<ng-template #templateRefFooter>\n    <ng-content select=\"eui-dialog-footer\" />\n</ng-template>\n", styles: [".eui-19 .eui-dialog{--_color: var(--eui-c-text)}.eui-19 .eui-dialog.eui-dialog--primary{--_color: var(--eui-c-s-primary)}.eui-19 .eui-dialog.eui-dialog--secondary{--_color: var(--eui-c-s-secondary)}.eui-19 .eui-dialog.eui-dialog--info{--_color: var(--eui-c-s-info)}.eui-19 .eui-dialog.eui-dialog--success{--_color: var(--eui-c-s-success)}.eui-19 .eui-dialog.eui-dialog--warning{--_color: var(--eui-c-s-warning)}.eui-19 .eui-dialog.eui-dialog--danger{--_color: var(--eui-c-s-danger)}.eui-19 .eui-dialog-container{display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog{background-color:var(--eui-c-surface-page);border:var(--eui-bw-s) solid var(--eui-c-s-secondary-border-lighter);border-radius:var(--eui-br-m);box-shadow:var(--eui-sh-12);display:flex;height:100%;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content{display:flex;flex-direction:column;position:relative;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header{align-items:center;border-top-left-radius:var(--eui-br-m);border-top-right-radius:var(--eui-br-m);display:flex;flex:0 0 auto;padding:var(--eui-s-s) var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header{align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-icon{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-title{color:var(--_color);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--eui-f-l-bold)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-close-container{display:flex;margin-left:auto}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header.eui-dialog__header--handle-disabled{cursor:default!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{display:flex;overflow:auto;position:relative}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar{display:inherit;height:10px;width:10px;background-color:var(--eui-c-s-secondary-surface-light)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb{background-color:var(--_eui-scrollbars-foreground-color);border-radius:5rem;background-clip:padding-box;border:2px solid transparent}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-s-secondary-surface);border:0;cursor:grab}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-track{background-color:var(--eui-c-s-secondary-surface-light);border-radius:0}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{scrollbar-color:var(--eui-c-s-secondary-surface) var(--eui-c-s-secondary-surface-light);scrollbar-width:auto}}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible{scrollbar-color:var(--eui-c-focus-visible) var(--eui-c-s-secondary-surface-light)}}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-xs) var(--eui-s-m) var(--eui-s-xl) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer{align-items:center;background-color:var(--eui-c-surface-page);border-bottom-left-radius:var(--eui-br-m);border-bottom-right-radius:var(--eui-br-m);border-top:1px solid var(--eui-c-divider-light);display:flex;padding:var(--eui-s-s) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer{align-items:center;display:flex;justify-content:center;text-align:center;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-content{align-items:center;display:flex;justify-content:flex-end;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-dismiss-button--with-accept-button{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog--no-padding .eui-dialog__content .eui-dialog__body-content{padding:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body{align-items:center;display:flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-m);align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon-container{align-self:flex-start;padding:var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon{display:inline-flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content p{margin-top:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon{margin:0 var(--eui-c-s)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon-content{border-radius:var(--eui-br-max);font-size:var(--eui-f-size-5xl);margin-right:var(--eui-c-s);overflow:auto;padding:var(--eui-s-s)}.eui-19 .eui-dialog__backdrop.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{background-color:var(--eui-c-s-secondary-surface-light);opacity:var(--eui-o-50)}.eui-19 .eui-dialog-container .eui-dialog--draggable .eui-dialog__header{cursor:move}@media screen and (max-width: 767px){.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size){left:0;position:fixed;top:0}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content{height:100vh;height:calc(var(--eui-app-vh, 1vh) * 100);width:100vw}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__header{border-top-left-radius:0;border-top-right-radius:0;flex:0 0 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body{flex:1 1 auto;height:100vh!important;max-height:100vh!important;max-width:100vw!important;overflow-x:hidden;overflow-y:auto;width:100vw!important}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body-content{flex:1 1 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__footer{border-bottom-left-radius:0;border-bottom-right-radius:0;flex:0 0 auto;width:100vw}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogComponent, decorators: [{
            type: Component,
            args: [{ selector: 'eui-dialog', providers: [{ provide: DIALOG_COMPONENT_CONFIG, useValue: null }], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [], hostDirectives: [
                        {
                            directive: BaseStatesDirective,
                            inputs: [
                                'euiPrimary',
                                'euiSecondary',
                                'euiInfo',
                                'euiSuccess',
                                'euiWarning',
                                'euiDanger',
                                'euiAccent',
                                'euiVariant',
                            ],
                        },
                    ], template: "<ng-template #templateRefHeader>\n    <ng-content select=\"eui-dialog-header\" />\n</ng-template>\n<ng-template #templateRefContent>\n    <ng-content />\n</ng-template>\n<ng-template #templateRefFooter>\n    <ng-content select=\"eui-dialog-footer\" />\n</ng-template>\n", styles: [".eui-19 .eui-dialog{--_color: var(--eui-c-text)}.eui-19 .eui-dialog.eui-dialog--primary{--_color: var(--eui-c-s-primary)}.eui-19 .eui-dialog.eui-dialog--secondary{--_color: var(--eui-c-s-secondary)}.eui-19 .eui-dialog.eui-dialog--info{--_color: var(--eui-c-s-info)}.eui-19 .eui-dialog.eui-dialog--success{--_color: var(--eui-c-s-success)}.eui-19 .eui-dialog.eui-dialog--warning{--_color: var(--eui-c-s-warning)}.eui-19 .eui-dialog.eui-dialog--danger{--_color: var(--eui-c-s-danger)}.eui-19 .eui-dialog-container{display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog{background-color:var(--eui-c-surface-page);border:var(--eui-bw-s) solid var(--eui-c-s-secondary-border-lighter);border-radius:var(--eui-br-m);box-shadow:var(--eui-sh-12);display:flex;height:100%;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content{display:flex;flex-direction:column;position:relative;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header{align-items:center;border-top-left-radius:var(--eui-br-m);border-top-right-radius:var(--eui-br-m);display:flex;flex:0 0 auto;padding:var(--eui-s-s) var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header{align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-dialog-header>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header eui-message-box-header>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-icon{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-title{color:var(--_color);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--eui-f-l-bold)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header-close-container{display:flex;margin-left:auto}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__header.eui-dialog__header--handle-disabled{cursor:default!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{display:flex;overflow:auto;position:relative}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar{display:inherit;height:10px;width:10px;background-color:var(--eui-c-s-secondary-surface-light)}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb{background-color:var(--_eui-scrollbars-foreground-color);border-radius:5rem;background-clip:padding-box;border:2px solid transparent}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-thumb:hover{background-color:var(--eui-c-s-secondary-surface);border:0;cursor:grab}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible::-webkit-scrollbar-thumb{background-color:var(--eui-c-s-primary-surface);outline:2px solid var(--eui-c-focus-visible)!important;outline-offset:-2px!important}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body::-webkit-scrollbar-track{background-color:var(--eui-c-s-secondary-surface-light);border-radius:0}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body{scrollbar-color:var(--eui-c-s-secondary-surface) var(--eui-c-s-secondary-surface-light);scrollbar-width:auto}}@-moz-document url-prefix(){.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body:focus-visible{scrollbar-color:var(--eui-c-focus-visible) var(--eui-c-s-secondary-surface-light)}}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-xs) var(--eui-s-m) var(--eui-s-xl) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer{align-items:center;background-color:var(--eui-c-surface-page);border-bottom-left-radius:var(--eui-br-m);border-bottom-right-radius:var(--eui-br-m);border-top:1px solid var(--eui-c-divider-light);display:flex;padding:var(--eui-s-s) var(--eui-s-m);width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer ng-component{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer{align-items:center;display:flex;justify-content:center;text-align:center;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-dialog-footer>*,.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer eui-message-box-footer>*{width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-content{align-items:center;display:flex;justify-content:flex-end;width:100%}.eui-19 .eui-dialog-container .eui-dialog .eui-dialog__content .eui-dialog__footer .eui-dialog__footer-dismiss-button--with-accept-button{margin-right:var(--eui-s-s)}.eui-19 .eui-dialog-container .eui-dialog--no-padding .eui-dialog__content .eui-dialog__body-content{padding:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body{align-items:center;display:flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content{height:auto;padding:var(--eui-s-m);align-items:center;display:flex;width:100%}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon-container{align-self:flex-start;padding:var(--eui-s-m)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content-icon{display:inline-flex}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-content p{margin-top:0}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon{margin:0 var(--eui-c-s)}.eui-19 .eui-dialog-container .eui-dialog.eui-dialog--message-box .eui-dialog__content .eui-dialog__body-icon-content{border-radius:var(--eui-br-max);font-size:var(--eui-f-size-5xl);margin-right:var(--eui-c-s);overflow:auto;padding:var(--eui-s-s)}.eui-19 .eui-dialog__backdrop.cdk-overlay-backdrop.cdk-overlay-backdrop-showing{background-color:var(--eui-c-s-secondary-surface-light);opacity:var(--eui-o-50)}.eui-19 .eui-dialog-container .eui-dialog--draggable .eui-dialog__header{cursor:move}@media screen and (max-width: 767px){.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size){left:0;position:fixed;top:0}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content{height:100vh;height:calc(var(--eui-app-vh, 1vh) * 100);width:100vw}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__header{border-top-left-radius:0;border-top-right-radius:0;flex:0 0 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body{flex:1 1 auto;height:100vh!important;max-height:100vh!important;max-width:100vw!important;overflow-x:hidden;overflow-y:auto;width:100vw!important}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__body-content{flex:1 1 auto}.eui-19 .eui-dialog-container .eui-dialog:not(.eui-dialog--custom-size) .eui-dialog__content .eui-dialog__footer{border-bottom-left-radius:0;border-bottom-right-radius:0;flex:0 0 auto;width:100vw}}\n"] }]
        }], propDecorators: { e2eAttr: [{
                type: Input
            }], title: [{
                type: Input
            }], acceptLabel: [{
                type: Input
            }], dismissLabel: [{
                type: Input
            }], verticalPosition: [{
                type: Input
            }], width: [{
                type: Input
            }], height: [{
                type: Input
            }], isFullScreen: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasCloseButton: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasAcceptButton: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasDismissButton: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasMobileCustomSize: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasClosedOnClickOutside: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasClosedOnEscape: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isHandleCloseOnDismiss: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isHandleCloseOnClose: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isHandleCloseOnAccept: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isHandleCloseOnClickOutside: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isHandleCloseOnEscape: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isMessageBox: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], isDraggable: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasNoBodyPadding: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], hasFooter: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], classList: [{
                type: Input
            }], clickOutside: [{
                type: Output
            }], escape: [{
                type: Output
            }], dialogOpen: [{
                type: Output
            }], dialogClose: [{
                type: Output
            }], dismiss: [{
                type: Output
            }], accept: [{
                type: Output
            }], templateRefHeader: [{
                type: ViewChild,
                args: ['templateRefHeader']
            }], templateRefContent: [{
                type: ViewChild,
                args: ['templateRefContent']
            }], templateRefFooter: [{
                type: ViewChild,
                args: ['templateRefFooter']
            }], euiDialogHeaderDirective: [{
                type: ContentChild,
                args: [forwardRef(() => EuiDialogHeaderDirective)]
            }], euiDialogFooterDirective: [{
                type: ContentChild,
                args: [forwardRef(() => EuiDialogFooterDirective)]
            }] } });
/* eslint-disable */
class EuiDialogHeaderDirective {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: EuiDialogHeaderDirective, isStandalone: true, selector: "eui-dialog-header", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogHeaderDirective, decorators: [{
            type: Directive,
            args: [{ selector: 'eui-dialog-header', }]
        }] });
class EuiDialogFooterDirective {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
    static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: EuiDialogFooterDirective, isStandalone: true, selector: "eui-dialog-footer", ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogFooterDirective, decorators: [{
            type: Directive,
            args: [{ selector: 'eui-dialog-footer', }]
        }] });

/**
 * @description
 * A module for the datepicker component. This module imports the
 *
 * @deprecated Use the {@link EUI_DIALOG} instead.
 */
class EuiDialogModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogModule, imports: [EuiDialogComponent,
            EuiDialogHeaderDirective,
            EuiDialogFooterDirective,
            EuiDialogContainerComponent], exports: [EuiDialogComponent,
            EuiDialogHeaderDirective,
            EuiDialogFooterDirective,
            EuiDialogContainerComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogModule, providers: [EuiDialogService], imports: [EuiDialogContainerComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EuiDialogModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        EuiDialogComponent,
                        EuiDialogHeaderDirective,
                        EuiDialogFooterDirective,
                        EuiDialogContainerComponent,
                    ],
                    exports: [
                        EuiDialogComponent,
                        EuiDialogHeaderDirective,
                        EuiDialogFooterDirective,
                        EuiDialogContainerComponent,
                    ],
                    providers: [EuiDialogService],
                }]
        }] });

const EUI_DIALOG = [
    EuiDialogComponent,
    EuiDialogHeaderDirective,
    EuiDialogFooterDirective,
    EuiDialogContainerComponent,
];

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

export { DIALOG_COMPONENT_CONFIG, DIALOG_CONTAINER_CONFIG, EUI_DIALOG, EuiDialogComponent, EuiDialogComponentInstances, EuiDialogConfig, EuiDialogContainerComponent, EuiDialogFooterDirective, EuiDialogHeaderDirective, EuiDialogModule, EuiDialogService };
//# sourceMappingURL=eui-components-eui-dialog.mjs.map
