import { defineComponent as v, ref as y, useSlots as $, resolveComponent as b, openBlock as o, createElementBlock as r, unref as h, createBlock as x, normalizeClass as a, withCtx as m, createElementVNode as t, createVNode as n, toDisplayString as d, renderSlot as u } from "vue";
import { _ as k } from "./Expand.vue_vue_type_script_setup_true_lang-CSzt6UW3.js";
import i from "./Icon.js";
import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
const C = { class: "flex flex-1 items-center overflow-hidden" }, z = { class: "truncate" }, A = { key: 1 }, B = { class: "flex flex-1 items-center overflow-hidden" }, E = { class: "truncate" }, I = /* @__PURE__ */ v({
  __name: "AppNavigationItem",
  props: {
    to: {},
    icon: {},
    label: {},
    isActive: { type: Boolean, default: !1 }
  },
  setup(p) {
    const l = y(!1), s = p, f = $();
    return (e, c) => {
      const _ = b("router-link");
      return o(), r("li", null, [
        h(f)["sub-items"] ? (o(), r("div", A, [
          t("button", {
            class: a([[e.$style.item, { [e.$style.expanded]: l.value }], "flex w-full items-center justify-between font-normal capitalize"]),
            onClick: c[0] || (c[0] = () => l.value = !l.value)
          }, [
            t("div", B, [
              n(i, {
                name: s.icon,
                class: "mr-3"
              }, null, 8, ["name"]),
              t("span", E, d(s.label), 1)
            ]),
            n(i, {
              class: a([e.$style.caret, { [e.$style.expandedIcon]: l.value }]),
              name: "chevron-left"
            }, null, 8, ["class"])
          ], 2),
          n(k, {
            "is-expanded": l.value,
            class: a(e.$style.expand)
          }, {
            default: m(() => [
              t("ul", {
                class: a(e.$style["sub-items"])
              }, [
                u(e.$slots, "sub-items")
              ], 2)
            ]),
            _: 3
          }, 8, ["is-expanded", "class"])
        ])) : (o(), x(_, {
          key: 0,
          to: s.to,
          class: a([[e.$style.item, { [e.$style.active]: s.isActive }], "flex w-full items-center justify-between font-normal capitalize"]),
          "active-class": e.$style.active
        }, {
          default: m(() => [
            t("div", C, [
              n(i, {
                name: s.icon,
                class: "mr-3"
              }, null, 8, ["name"]),
              t("span", z, d(s.label), 1)
            ]),
            u(e.$slots, "default")
          ]),
          _: 3
        }, 8, ["to", "class", "active-class"]))
      ]);
    };
  }
}), N = "_item_sEzmc", g = "_expanded_F4Gu9", S = "_active_wvQqm", j = "_caret_ccqxb", q = {
  item: N,
  "sub-items": "_sub-items_22Puh",
  expanded: g,
  active: S,
  caret: j
}, M = {
  $style: q
}, P = /* @__PURE__ */ w(I, [["__cssModules", M]]);
export {
  P as default
};
//# sourceMappingURL=AppNavigationItem.js.map
