"use client";
import { jsx as a } from "react/jsx-runtime";
import { useHSModal as t } from "./useHSModal.es.js";
import r from "../../modules/HSModal/hsModal.module.css";
import { IterableModal as C } from "./components/IterableModal/IterableModal.es.js";
import { MailchimpModal as k } from "./components/MailchimpModal/MailchimpModal.es.js";
const f = (l) => {
  const { isOpen: n, closeModal: e, handleClick: i, handleOverlayClick: o } = t({
    id: l.id,
    initiallyOpen: l.initiallyOpen,
    trigger: l.trigger,
    onCloseCallback: l.onCloseCallback,
    onClickCallback: l.onClickCallback
  }), c = () => {
    switch (l.type) {
      case "mailchimp":
        return /* @__PURE__ */ a(k, { ...l, onCloseCallback: e, onClickCallback: i });
      case "iterable":
        return /* @__PURE__ */ a(C, { ...l, onCloseCallback: e, onClickCallback: i });
      default:
        return null;
    }
  };
  return n ? /* @__PURE__ */ a("div", { className: r.overlay, onClick: o, children: c() }) : null;
};
export {
  f as HSModal
};
