import { r as e, c as a, h as s, H as i } from "./index.e6beb8d9.js";
import { d as t, e as r } from "./bodyScrollLock.esm-B0kNlhKL.c7a66a82.js";
import { c } from "./index-orsBiyT_.fc4357c3.js";
import "react";
import "react-dom";
const n = () => ".sc-swirl-modal-shell-h{display:block}.sc-swirl-modal-shell-h *.sc-swirl-modal-shell{box-sizing:border-box}.modal-shell.sc-swirl-modal-shell{position:fixed;inset:0;z-index:var(--s-z-40);border:none;padding:0;width:100%;height:100%;max-width:none;max-height:none;overflow:visible;background:transparent}.modal-shell.sc-swirl-modal-shell::backdrop{display:none}.modal-shell__backdrop.sc-swirl-modal-shell{position:fixed;inset:0;z-index:1;background-color:var(--s-translucent-medium-default);opacity:1;-webkit-backdrop-filter:blur(var(--s-blur-l));backdrop-filter:blur(var(--s-blur-l));transition:opacity 0.3s ease-out, -webkit-backdrop-filter 0.3s ease-out;transition:opacity 0.3s ease-out, backdrop-filter 0.3s ease-out;transition:opacity 0.3s ease-out, backdrop-filter 0.3s ease-out, -webkit-backdrop-filter 0.3s ease-out}.modal-shell__scroll-container.sc-swirl-modal-shell{overflow-y:auto;position:fixed;inset:0;z-index:2;display:grid;padding:var(--s-space-24);justify-content:center;align-items:center}.modal-shell__scroll-container__content.sc-swirl-modal-shell{opacity:1;transform:scale(1);transition:opacity 0.2s ease-out,     transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1.1)}.modal-shell__close-button.sc-swirl-modal-shell{position:fixed;top:var(--s-space-16);right:var(--s-space-16);z-index:3;opacity:1;transform:scale(1);transition:opacity 0.2s ease-out,     transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1.1)}.modal-shell--closing.sc-swirl-modal-shell .modal-shell__backdrop.sc-swirl-modal-shell{opacity:0;-webkit-backdrop-filter:blur(0px);backdrop-filter:blur(0px)}.modal-shell--closing.sc-swirl-modal-shell .modal-shell__scroll-container__content.sc-swirl-modal-shell,.modal-shell--closing.sc-swirl-modal-shell .modal-shell__close-button.sc-swirl-modal-shell{opacity:0;transform:scale(1.1)}", d = 300, h = class {
  constructor(o) {
    e(this, o), this.closeModal = a(this, "closeModal", 7), this.isClosing = !0, this.onDialogClose = () => {
      this.closeModal.emit();
    }, this.onKeyDown = (l) => {
      l.code === "Escape" && (l.stopImmediatePropagation(), l.preventDefault(), this.close());
    }, this.onContentClick = (l) => {
      l.stopPropagation();
    }, this.onClose = () => {
      this.close();
    };
  }
  componentDidLoad() {
    this.setDialogCustomProps(), requestAnimationFrame(() => {
      this.modalEl.showModal(), t(this.scrollContainerEl), this.isClosing = !1;
    });
  }
  disconnectedCallback() {
    var o;
    (o = this.modalEl) != null && o.open && this.modalEl.close(), r(this.scrollContainerEl);
  }
  async close() {
    this.isClosing = !0, setTimeout(() => {
      this.modalEl.close();
    }, d);
  }
  setDialogCustomProps() {
    this.modalEl.setAttribute("closedby", "none");
  }
  render() {
    const o = c("modal-shell", {
      "modal-shell--closing": this.isClosing
    });
    return s(i, { key: "fe7c416f75e5113a51582693132961a74ea7e717" }, s("dialog", { key: "5dbe38a1b026ccd97e6759e3f3eaa9970bd4330e", "aria-label": this.label, class: o, onClose: this.onDialogClose, onKeyDown: this.onKeyDown, ref: (l) => this.modalEl = l }, s("div", { key: "9229277d09a18c91c1f8cbfe94e88da02209f9d4", class: "modal-shell__backdrop" }), s("div", { key: "f20cda2184a77ff2b67666f3cbdec35ea2638ec5", class: "modal-shell__scroll-container", onClick: this.onClose, ref: (l) => this.scrollContainerEl = l }, s("div", { key: "0384eb236111fe9b119e25a0125c748b9770c5ba", class: "modal-shell__scroll-container__content", onClick: this.onContentClick }, s("slot", { key: "baeef561e1a41e700e6fe5db16f941d5f0171034" }))), s("swirl-button", { key: "5006ac6f13badfdf08e1e6f812242fc44084d57f", class: "modal-shell__close-button", icon: "<swirl-icon-close color='strong'></swirl-icon-close>", label: this.closeButtonLabel, hideLabel: !0, variant: "translucent", onClick: this.onClose })));
  }
};
h.style = n();
export {
  h as swirl_modal_shell
};
