import { inject as o } from "vue";
import { useMessageDraft as d } 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";
function A({ enableDoubleClickReply: p, emit: n }) {
  const i = o("chatAppId"), { setReply: s, getMessage: r, resetReply: a } = d(i);
  return {
    getMessage: r,
    messageAction: (e) => {
      n("messageAction", e);
    },
    handleClickReplied: (e) => {
      n("clickRepliedMessage", e);
    },
    feedObjectDoubleClick: (e, t) => {
      if (p && (e == null || e.preventDefault(), t.type.indexOf("system") === -1 && t.type.indexOf("typing") === -1)) {
        const l = document.getElementById("chat-input-reply-line-" + i);
        l && (l.style.display = "inherit"), s({
          messageId: t.messageId,
          type: t.type,
          text: t.text,
          filename: t.filename,
          url: t.url,
          header: t.header,
          callDuration: t.callDuration
        });
      }
    },
    handleResetReply: () => {
      a();
      const e = document.getElementById("chat-input-reply-line-" + i);
      e && (e.style.display = "none");
    }
  };
}
export {
  A as useFeedReply
};
