import { r as e, c as a, h as s, H as i } from "./index.61732cef.js";
import { d as t, e as c } from "./bodyScrollLock.esm-B0kNlhKL.c7a66a82.js";
import { c as r } 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.modalEl), this.isClosing = !1;
    });
  }
  disconnectedCallback() {
    var o;
    (o = this.modalEl) != null && o.open && this.modalEl.close(), c(this.modalEl);
  }
  async close() {
    this.isClosing = !0, setTimeout(() => {
      this.modalEl.close();
    }, d);
  }
  setDialogCustomProps() {
    this.modalEl.setAttribute("closedby", "none");
  }
  render() {
    const o = r("modal-shell", {
      "modal-shell--closing": this.isClosing
    });
    return s(i, { key: "6de0d862ba8b88bbd35bdc5c582f65e3ba71059f" }, s("dialog", { key: "f6d445a4ecc80e9c579b0c7da7b3e703b2e0e5fb", "aria-label": this.label, class: o, onClose: this.onDialogClose, onKeyDown: this.onKeyDown, ref: (l) => this.modalEl = l }, s("div", { key: "9d32010acc88b79ecbff2e66573987f7e51a16f5", class: "modal-shell__backdrop" }), s("div", { key: "1b43d46c00af31d3a618f355fb2469927931f2b0", class: "modal-shell__scroll-container", onClick: this.onClose }, s("div", { key: "2a167cf0ae30e867aade1f76fbe41f4d28c41978", class: "modal-shell__scroll-container__content", onClick: this.onContentClick }, s("slot", { key: "51b1e2d1939860d7a3b9c69dc3f922cbb79379b9" }))), s("swirl-button", { key: "0eb002b1f9ba69059c08b44920d741b77fc5d50e", 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
};
