import '@das-fed/upf-ui/packages/components/alert/style.css';
import { defineComponent as u, ref as o, computed as d, watch as m, onBeforeUnmount as c, openBlock as p, createElementBlock as $, normalizeClass as y, normalizeStyle as v, createVNode as k, unref as T, mergeProps as b, createSlots as C, withCtx as t, renderSlot as n } from "vue";
import { withInstall as g } from "@das-fed/upf-utils/with-install/index";
import { Alert as h } from "ant-design-vue";
import "ant-design-vue/es/alert/style/css";
const w = {
  name: "DasAlert"
}, A = /* @__PURE__ */ u({
  ...w,
  props: {
    left: { default: 0 },
    top: { default: 0 },
    banner: { type: Boolean, default: !1 },
    delayOffTime: { default: 0 }
  },
  setup(a) {
    const s = a, l = o(!1), r = o(null), f = d(() => ({
      position: s.banner ? "fixed" : "unset",
      left: s.left ? s.left + "px" : "0",
      top: s.top ? s.top + "px" : "0"
    }));
    m(
      () => s.delayOffTime,
      (e) => {
        e ? i(e) : l.value = !1;
      },
      { immediate: !0 }
    );
    function i(e) {
      r.value = setTimeout(() => {
        l.value = !0;
      }, e);
    }
    return c(() => {
      window.clearTimeout(r.value);
    }), (e, B) => (p(), $(
      "div",
      {
        class: y({ "das-ui-alert-container": !0, "leave-class": l.value }),
        style: v(f.value)
      },
      [
        k(T(h), b({ class: "das-ui-alert" }, e.$attrs, { banner: a.banner }), C({
          default: t(() => [
            n(e.$slots, "default")
          ]),
          _: 2
          /* DYNAMIC */
        }, [
          e.$slots.description ? {
            name: "description",
            fn: t(() => [
              n(e.$slots, "description")
            ]),
            key: "0"
          } : void 0,
          e.$slots.icon ? {
            name: "icon",
            fn: t(() => [
              n(e.$slots, "icon")
            ]),
            key: "1"
          } : void 0,
          e.$slots.message ? {
            name: "message",
            fn: t(() => [
              n(e.$slots, "message")
            ]),
            key: "2"
          } : void 0,
          e.$slots.closeText ? {
            name: "closeText",
            fn: t(() => [
              n(e.$slots, "closeText")
            ]),
            key: "3"
          } : void 0,
          e.$slots.closeIcon ? {
            name: "closeIcon",
            fn: t(() => [
              n(e.$slots, "closeIcon")
            ]),
            key: "4"
          } : void 0
        ]), 1040, ["banner"])
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), z = () => o(null), j = g(A);
export {
  j as DasAlert,
  z as DasAlertRef,
  j as default
};
