import { jsx as r, jsxs as _ } from "@emotion/react/jsx-runtime";
import { useModal as k } from "../../hooks/useModal/index.js";
import { useModuleDictionary as z, useEnvironment as N } from "@m4l/core";
import { useComponentSize as x } from "../../hooks/useComponentSize/index.js";
import { getPropDataTestId as e } from "../../test/getNameDataTestId.js";
import { WINDOW_CONFIRM_KEY_COMPONENT as n } from "./constants.js";
import { getComponentSlotRoot as A } from "../../utils/getComponentSlotRoot.js";
import O from "clsx";
import { WindowConfirmRootStyled as T, WindowConfirmContentStyled as b, MessageIllustrationStyled as D, ActionsContainerStyled as E, ActionCancelStyled as P, ActionIntroStyled as R } from "./slots/WindowConfirmSlots.js";
import { WindowConfirmSlots as a } from "./slots/WindowConfirmEnum.js";
import { AppearanceComponentProvider as V } from "@m4l/graphics";
import { WindowBase as j } from "../WindowBase/WindowBase.js";
const oo = (u) => {
  const {
    variant: s = "warning",
    title: S,
    onClickCancel: f,
    onClickIntro: w,
    msg: I,
    size: o = "medium",
    dataTestId: i
    //titleAccept, // TODO: para que es
  } = u, { closeModal: c } = k(), { getLabel: l } = z(), v = () => {
    f && f(), c();
  }, y = () => {
    c(), w && w();
  }, { currentSize: p } = x(o), t = {
    windowConfirmColor: "default",
    windowConfirmSize: p,
    windowConfirmVariant: s
  }, C = ($) => ({
    warning: { color: "warning" },
    error: { color: "error" },
    info: { color: "info" }
  })[$] || { color: "warning" }, { color: M } = C(s), W = C(s).color, { host_static_assets: m, environment_assets: d } = N(), g = {
    warning: `${m}/${d}/frontend/components/window_confirm/assets/icons/warning.svg`,
    error: `${m}/${d}/frontend/components/window_confirm/assets/icons/danger+svg.svg`,
    info: `${m}/${d}/frontend/components/window_confirm/assets/icons/Info.svg`
  }, h = g[s] || g.warning;
  return /* @__PURE__ */ r(V, { defaultSize: p, children: /* @__PURE__ */ r(j, { iconUrl: h, variant: "outlined", title: l("modal_dialog.label_window_confirm"), onClose: () => c(), emergeType: "modal", children: /* @__PURE__ */ r(
    T,
    {
      className: O(A(n)),
      ...e(n, a.wrapperWindowConfirm, i),
      size: o,
      ownerState: t,
      children: /* @__PURE__ */ _(
        b,
        {
          ...e(n, a.windowConfirmContent, i),
          ownerState: t,
          size: o,
          children: [
            /* @__PURE__ */ r(
              D,
              {
                ...e(n, a.messageIllustration, i),
                size: o,
                ownerState: t,
                variant: W,
                msg: I || l("modal_dialog.label_window_confirm"),
                title: S || l("modal_dialog.title_window_confirm")
              }
            ),
            /* @__PURE__ */ _(
              E,
              {
                ...e(n, a.actionsContainer, i),
                size: o,
                ownerState: t,
                children: [
                  /* @__PURE__ */ r(
                    P,
                    {
                      ...e(n, a.actionCancel, i),
                      size: o,
                      ownerState: t,
                      onClick: v
                    }
                  ),
                  /* @__PURE__ */ r(
                    R,
                    {
                      ...e(n, a.actionIntro, i),
                      size: o,
                      ownerState: t,
                      onClick: y,
                      color: M
                    }
                  )
                ]
              }
            )
          ]
        }
      )
    }
  ) }) });
};
export {
  oo as WindowConfirm
};
