import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, createVNode, withDirectives, isRef, withKeys, vModelText } from "vue";
import emojiPC from "../EditorTools/emojiPC.vue.mjs";
import useChatEditor from "./useChatEditor.mjs";
const _hoisted_1 = { class: "input-content" };
const _hoisted_2 = ["disabled", "placeholder"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "ChatEditorH5",
  setup(__props) {
    const {
      t,
      editorInputEle,
      sendMsg,
      isMessageDisabled,
      sendMessage,
      handleChooseEmoji
    } = useChatEditor();
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["chat-editor", { disable: unref(isMessageDisabled) }])
      }, [
        createElementVNode("div", _hoisted_1, [
          createVNode(unref(emojiPC), {
            class: "chat-emoji",
            onChooseEmoji: unref(handleChooseEmoji)
          }, null, 8, ["onChooseEmoji"]),
          withDirectives(createElementVNode("input", {
            ref_key: "editorInputEle",
            ref: editorInputEle,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(sendMsg) ? sendMsg.value = $event : null),
            type: "text",
            disabled: unref(isMessageDisabled),
            class: "content-bottom-input",
            placeholder: unref(isMessageDisabled) ? unref(t)("Muted by the moderator") : unref(t)("Type a message"),
            enterkeyhint: "send",
            onKeyup: _cache[1] || (_cache[1] = withKeys(
              //@ts-ignore
              (...args) => unref(sendMessage) && unref(sendMessage)(...args),
              ["enter"]
            ))
          }, null, 40, _hoisted_2), [
            [vModelText, unref(sendMsg)]
          ])
        ])
      ], 2);
    };
  }
});
export {
  _sfc_main as default
};
