import '@das-fed/ui/packages/components/menu-header/style.css';
import { withInstall as b } from "@das-fed/utils/with-install/index";
import { computed as h, defineComponent as y, createElementBlock as F, openBlock as l, normalizeStyle as k, normalizeClass as g, createVNode as v, unref as s, mergeProps as p, withCtx as u, Fragment as j, renderList as E, createBlock as _, withDirectives as B, createTextVNode as D, toDisplayString as H, createElementVNode as n, renderSlot as c } from "vue";
import { Tabs as T, TabPane as x } from "ant-design-vue";
import "ant-design-vue/es/tabs/style/css";
import { vDasTooltip as C } from "@das-fed/ui/packages/components/text-tooltip/index";
import { setThemeRule as S } from "@das-fed/web/packages/theme/index";
function $(e) {
  return typeof e == "string" && e.includes("px") ? e : e + "px";
}
const w = (e, m) => ({
  realHeight: h(() => {
    let o;
    return e.height && (o = $(e.height)), o;
  })
}), i = {
  "--das-ui-layout-header-menu-border-color": {
    kjl: "#3C81E0",
    cjb: "#D9D9D9",
    ssl: "#313553",
    dkh: "#EB0E1B"
  },
  "--das-ui-layout-header-menu-background-color": {
    kjl: "#2673DC",
    cjb: "#ffffff",
    ssl: "#1B1F40",
    dkh: "#EB0E1B"
  },
  "--das-ui-layout-header-menu-color": {
    kjl: "#FFFFFF",
    cjb: "#212121",
    ssl: "#FFFFFF",
    dkh: "rgba(255, 255, 255, 0.8)"
  },
  "--das-ui-layout-header-menu-hover-background-color": {
    kjl: "rgba(24, 94, 190, 0.5)",
    cjb: "#F2F6FF",
    ssl: "rgba(255, 255, 255, 0.08)",
    dkh: "rgba(255, 115, 126, 0.5)"
  },
  "--das-ui-layout-header-menu-hover-color": {
    kjl: "#FFFFFF",
    cjb: "#5582F3",
    ssl: "#FFFFFF",
    dkh: "#FFFFFF"
  },
  "--das-ui-layout-header-menu-active-background-color": {
    kjl: "#185EBE",
    cjb: "#5582F3",
    ssl: "#5582F3",
    dkh: "#FF737E"
  },
  "--das-ui-layout-header-menu-active-color": {
    kjl: "#FFFFFF",
    cjb: "#FFFFFF",
    ssl: "#FFFFFF",
    dkh: "#FFFFFF"
  },
  "--das-ui-layout-header-menu-remove-btn-color": {
    kjl: "rgba(255, 255, 255, 0.6)",
    cjb: "rgba(170, 170, 172)",
    ssl: "rgba(255, 255, 255, 0.6)",
    dkh: "rgba(255, 255, 255, 0.6)"
  },
  "--das-ui-layout-header-menu-remove-btn-hover-color": {
    kjl: "#FFFFFF",
    cjb: "#FFFFFF",
    ssl: "#FFFFFF",
    dkh: "#FFFFFF"
  }
}, M = { class: "das-tab-label" }, N = { class: "header-left" }, V = { class: "header-right" }, z = {
  name: "DasMenuHeader",
  inheritAttrs: !1
}, A = /* @__PURE__ */ y({
  ...z,
  props: {
    theme: { default: "default" },
    height: {},
    menus: { default: () => [] }
  },
  emits: ["update:currentKey"],
  setup(e, { emit: m }) {
    const a = e, { realHeight: o } = w(a), f = h(() => {
      const r = {};
      return a.theme === "default" || Object.keys(i).forEach((d) => {
        var t;
        r[d] = ((t = i[d]) == null ? void 0 : t[a.theme]) ?? void 0;
      }), r;
    });
    return (r, d) => (l(), F(
      "div",
      {
        class: g(["das-ui-header-menu", `theme-${r.theme}`]),
        style: k(f.value)
      },
      [
        v(s(T), p(r.$attrs, {
          style: { height: s(o) },
          type: "editable-card",
          contextmenu: !1,
          hideAdd: !0
        }), {
          leftExtra: u(() => [
            n("div", N, [
              c(r.$slots, "header-left")
            ])
          ]),
          rightExtra: u(() => [
            n("div", V, [
              c(r.$slots, "header-right")
            ])
          ]),
          default: u(() => [
            (l(!0), F(
              j,
              null,
              E(r.menus, (t) => (l(), _(s(x), {
                key: t.code,
                closable: t.closable
              }, {
                tab: u(() => [
                  B((l(), F("div", M, [
                    D(
                      H(t.name),
                      1
                      /* TEXT */
                    )
                  ])), [
                    [s(C)]
                  ])
                ]),
                _: 2
                /* DYNAMIC */
              }, 1032, ["closable"]))),
              128
              /* KEYED_FRAGMENT */
            ))
          ]),
          _: 3
          /* FORWARDED */
        }, 16, ["style"])
      ],
      6
      /* CLASS, STYLE */
    ));
  }
}), L = {
  "--das-ui-layout-header-menu-border-color": "#ffffff",
  "--das-ui-layout-header-menu-background-color": "#ffffff",
  "--das-ui-layout-header-menu-color": "#212121",
  "--das-ui-layout-header-menu-hover-background-color": "#F2F6FF",
  "--das-ui-layout-header-menu-hover-color": "#5582F3",
  "--das-ui-layout-header-menu-active-background-color": "#5582F3",
  "--das-ui-layout-header-menu-active-color": "#ffffff",
  "--das-ui-layout-header-menu-remove-btn-color": "rgba(170, 170, 172)",
  "--das-ui-layout-header-menu-remove-btn-hover-color": "#ffffff"
};
S(L);
const G = b(A), J = { title: "Menu-Header 水平导航栏" };
export {
  G as DasMenuHeader,
  J as default
};
