import { inject as p, computed as m, createElementBlock as i, createCommentVNode as o, openBlock as a, createElementVNode as n, createVNode as v, createTextVNode as u, toDisplayString as c, renderSlot as r, unref as y } from "vue";
import k from "../../1_icons/AvatarIcon.vue.js";
/* empty css              */
import T from "../../../_virtual/_plugin-vue_export-helper.js";
const g = {
  key: 0,
  class: "chat-info__container"
}, A = { class: "chat-info__base-line" }, B = { class: "chat-info__avatar-container" }, C = ["src"], I = {
  key: 1,
  class: ""
}, q = { class: "chat-info__info-container" }, w = { class: "chat-info__title" }, N = {
  key: 0,
  class: "chat-info__additional-title"
}, S = {
  key: 0,
  class: "chat-info__time"
}, V = { class: "chat-info__actions" }, $ = ["id"], b = {
  __name: "ChatInfo",
  props: {
    chat: {
      type: Object,
      required: !0
    },
    showReturnButton: {
      type: Boolean,
      required: !1,
      default: !1
    },
    description: {
      type: String,
      required: !1,
      default: ""
    },
    additionalTitle: {
      type: String,
      required: !1,
      default: ""
    },
    defaultLastActivityTime: {
      type: Boolean,
      required: !1,
      default: !1
    }
  },
  emits: ["returnToChats"],
  setup(e, { emit: h }) {
    const t = e, f = h, _ = p("chatAppId"), d = m(() => {
      if (t.description) return t.description;
      if (!t.description && t.defaultLastActivityTime) return t.chat["lastActivity.time"];
    });
    return (s, l) => e.chat ? (a(), i("div", g, [
      n("div", A, [
        e.showReturnButton ? (a(), i("span", {
          key: 0,
          class: "pi pi-arrow-left chat-info__return-button",
          onClick: l[0] || (l[0] = (j) => f("returnToChats"))
        })) : o("", !0),
        n("div", B, [
          t.chat.avatar ? (a(), i("img", {
            key: 0,
            src: t.chat.avatar,
            width: "40",
            height: "40"
          }, null, 8, C)) : (a(), i("span", I, [
            v(k, { size: 40 })
          ]))
        ]),
        n("div", q, [
          n("span", w, [
            u(c(e.chat.name) + " ", 1),
            e.additionalTitle ? (a(), i("span", N, c(e.additionalTitle), 1)) : o("", !0)
          ]),
          d.value ? (a(), i("p", S, [
            r(s.$slots, "img-description", {}, void 0, !0),
            u(" " + c(d.value), 1)
          ])) : o("", !0)
        ]),
        n("div", V, [
          r(s.$slots, "actions", {}, void 0, !0)
        ])
      ]),
      n("div", {
        id: "chat-info-search-panel-" + y(_),
        class: "chat-info__search-panel"
      }, [
        r(s.$slots, "search", {}, void 0, !0)
      ], 8, $)
    ])) : o("", !0);
  }
}, x = /* @__PURE__ */ T(b, [["__scopeId", "data-v-7364088e"]]);
export {
  x as default
};
