import { defineComponent as M, useCssModule as C, useSlots as S, ref as B, inject as $, computed as u, openBlock as l, createElementBlock as r, normalizeClass as n, unref as a, createElementVNode as i, renderSlot as o, createCommentVNode as m, createBlock as _, resolveDynamicComponent as b, withCtx as g, createTextVNode as V, toDisplayString as v } from "vue";
import { M as y } from "./Module.keys-DcqBbvvT.js";
import { M as c } from "./Module.types-B1FfGGac.js";
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const N = { class: "flex items-center" }, T = {
  class: "stash-module-header__content__text",
  "data-test": "stash-module-header|content-text"
}, z = {
  key: 0,
  class: "mb-0 mt-3"
}, D = /* @__PURE__ */ M({
  name: "ll-module-header",
  __name: "ModuleHeader",
  props: {
    title: { default: "" },
    size: { default: "medium" },
    description: { default: "" },
    preventActionsWrap: { type: Boolean, default: !1 },
    underline: { type: Boolean, default: !1 }
  },
  setup(k) {
    const t = k, w = C(), s = S(), d = B(), f = $(y.key, y.defaults);
    if (!f.variant)
      throw new Error("<ModuleHeader> must be used within a <Module> component.");
    d.value = f.variant.value;
    const h = u(() => {
      let e;
      switch (t.size) {
        case "small":
          e = "h4";
          break;
        case "medium":
          e = "h3";
          break;
        case "large":
          e = "h2";
          break;
        default:
          e = "h3";
          break;
      }
      return e;
    }), x = u(() => s.default ? s.default({}).length === 1 && typeof s.default({})[0].children == "string" && typeof s.default({})[0].type == "symbol" : !1), p = u(() => {
      const e = ["box", "table", "list"].includes(d.value);
      return e && !t.underline ? "mb-3 lg:mb-6" : e && t.underline ? "mb-3" : "";
    });
    return (e, I) => (l(), r("header", {
      class: n(["stash-module-header flex flex-wrap justify-between", {
        "rounded-t border-b border-ice-500 bg-ice-100 p-3 lg:px-6": d.value === a(c).Card,
        "mb-6 rounded bg-white px-3 pt-3 shadow lg:mb-0 lg:rounded-b-none lg:px-6 lg:pt-6 lg:shadow-none": d.value === a(c).List,
        "mb-3 border-b border-ice-200 lg:mb-6": t.underline,
        "mb-6 rounded-t bg-white px-3 pt-3 lg:mb-0 lg:px-6 lg:pt-6": d.value === a(c).Table
      }]),
      "data-test": "stash-module-header"
    }, [
      i("div", {
        class: n(["stash-module-header__content mr-6", p.value]),
        "data-test": "stash-module-header|content"
      }, [
        i("div", N, [
          a(s).media && t.size === "large" ? (l(), r("div", {
            key: 0,
            class: n(["stash-module-header__content__media mr-3", a(w).media]),
            "data-test": "stash-module-header|content-media"
          }, [
            o(e.$slots, "media")
          ], 2)) : m("", !0),
          i("div", T, [
            a(s).title ? o(e.$slots, "title", { key: 0 }) : x.value ? (l(), _(b(h.value), {
              key: 1,
              class: "stash-module-header__default_slot_string my-0",
              "data-test": "stash-module-header|default-slot-text"
            }, {
              default: g(() => [
                o(e.$slots, "default")
              ]),
              _: 3
            })) : o(e.$slots, "default", { key: 2 }, () => [
              (l(), _(b(h.value), { class: "my-0" }, {
                default: g(() => [
                  V(v(t.title), 1)
                ]),
                _: 1
              }))
            ]),
            o(e.$slots, "description", {}, () => [
              t.description ? (l(), r("p", z, v(t.description), 1)) : m("", !0)
            ])
          ])
        ])
      ], 2),
      a(s).actions ? (l(), r("div", {
        key: 0,
        class: n(["stash-module-header__actions self-center", [
          p.value,
          {
            "w-full lg:w-auto": !t.preventActionsWrap
          }
        ]]),
        "data-test": "stash-module-header|actions"
      }, [
        o(e.$slots, "actions")
      ], 2)) : m("", !0)
    ], 2));
  }
}), O = "_media__90ZT", j = {
  media: O
}, H = {
  $style: j
}, U = /* @__PURE__ */ E(D, [["__cssModules", H]]);
export {
  U as default
};
//# sourceMappingURL=ModuleHeader.js.map
