import { defineComponent as u, useTemplateRef as f, inject as x, createElementBlock as r, openBlock as n, normalizeClass as _, Fragment as g, renderList as y, normalizeStyle as b, createElementVNode as h, toDisplayString as k } from "vue";
import { useMessageDraft as C } from "../../../hooks/useMessageDraft.js";
import "../../../hooks/useSearchModel.js";
import "../../../hooks/useTheme.js";
/* empty css                              */
/* empty css                                              */
import "../../../node_modules/linkifyjs/dist/linkify.js";
import "../../../node_modules/linkify-string/dist/linkify-string.js";
import "../../../functions/parseMarkdown.js";
const v = ["onClick"], $ = /* @__PURE__ */ u({
  __name: "MessageKeyboard",
  props: {
    keyboard: {
      type: Array,
      required: !0
    },
    align: {
      type: String,
      default: "right",
      validator: (t) => ["left", "center", "right"].includes(t)
    }
  },
  emits: ["action"],
  setup(t, { expose: a, emit: i }) {
    const s = f("keyboard"), c = i, l = x("chatAppId"), { setMessageText: p, setForceSendMessage: d } = C(l), m = (e) => {
      e.action && typeof e.action == "function" ? e.action() : e.action != null ? c("action", e.action) : (p(e.text), d(!0));
    };
    return a({
      refKeyboard: s
    }), (e, M) => (n(), r("div", {
      ref: "keyboard",
      class: _(["keyboard__container", [`keyboard__container--${t.align}`]])
    }, [
      (n(!0), r(g, null, y(t.keyboard, (o) => (n(), r("div", {
        key: o.text,
        class: "keyboard__key",
        style: b({ "box-shadow": "0px 0px 10px 5px " + o.color }),
        onClick: (S) => m(o)
      }, [
        h("p", null, k(o.text), 1)
      ], 12, v))), 128))
    ], 2));
  }
});
export {
  $ as default
};
