import { defineComponent as k, inject as _, ref as c, createElementBlock as i, openBlock as o, Fragment as x, createElementVNode as t, createBlock as u, createCommentVNode as n, toDisplayString as M, unref as a, Teleport as C, createVNode as T, Transition as w, withCtx as p } from "vue";
import N from "../../2_modals/ModalFullscreen/ModalFullscreen.vue.js";
import "../../../hooks/useMessageDraft.js";
import "../../../hooks/useSearchModel.js";
import { useTheme as V } from "../../../hooks/useTheme.js";
/* empty css                              */
/* empty css                                              */
import { useMessageLinks as b } from "../../../hooks/messages/useMessageLinks.js";
import "../../../functions/parseMarkdown.js";
const B = ["src"], H = { class: "video-message__text-container" }, L = { key: 0 }, j = ["innerHTML"], A = ["src", "alt"], z = /* @__PURE__ */ k({
  __name: "ReplyVideoMessage",
  props: {
    message: {
      type: Object,
      required: !0
    }
  },
  setup(e) {
    const g = _("chatAppId"), { getTheme: r } = V(g), v = e, f = c(), l = c(!1), { linkedHtml: h, inNewWindow: m } = b(() => v.message.text), y = () => l.value = !1;
    return (E, s) => (o(), i(x, null, [
      t("div", {
        class: "video-message__preview-button",
        onClick: s[0] || (s[0] = (d) => l.value = !0)
      }, [
        t("video", {
          class: "video-message__video",
          src: e.message.url,
          muted: !0
        }, null, 8, B)
      ]),
      t("div", H, [
        e.message.header ? (o(), i("p", L, M(e.message.header), 1)) : n("", !0),
        s[2] || (s[2] = t("div", { class: "video-message__reply-description" }, [
          t("span", { class: "pi pi-video" }),
          t("p", null, "Видео")
        ], -1)),
        e.message.text ? (o(), i("p", {
          key: 1,
          class: "video-message__text",
          onClick: s[1] || (s[1] = //@ts-ignore
          (...d) => a(m) && a(m)(...d)),
          innerHTML: a(h)
        }, null, 8, j)) : n("", !0)
      ]),
      (o(), u(C, { to: "body" }, [
        T(w, { name: "modal-fade" }, {
          default: p(() => [
            l.value ? (o(), u(N, {
              key: 0,
              "data-theme": a(r)().theme ? a(r)().theme : "light",
              title: e.message.alt,
              onClose: y
            }, {
              default: p(() => [
                t("video", {
                  ref_key: "player",
                  ref: f,
                  class: "video-message__modal-video",
                  src: e.message.url,
                  alt: e.message.alt,
                  controls: "",
                  autoplay: ""
                }, null, 8, A)
              ]),
              _: 1
            }, 8, ["data-theme", "title"])) : n("", !0)
          ]),
          _: 1
        })
      ]))
    ], 64));
  }
});
export {
  z as default
};
