import { computed as V, resolveComponent as $, createElementBlock as l, openBlock as s, normalizeStyle as b, unref as t, createElementVNode as a, createCommentVNode as n, createVNode as v, toDisplayString as _, createBlock as D, renderSlot as E } from "vue";
import { useColor as w, usePost as I } from "./composables-BAZQlC3e.js";
import { UiLink as T, PostActionReact as U } from "./components.js";
import { _export_sfc as j } from "./_plugin-vue_export-helper-DueaC3du.js";
const z = {
  class: "flex flex-wrap items-center max-w-full w-full backdrop-blur-lg rounded-2xl bg-light-100 bg-opacity-80 dark-bg-dark-400 dark-bg-opacity-80 backdrop-blur-sm backdrop-filter shadow-md",
  style: { flex: "14 1 620px" }
}, A = {
  key: 0,
  class: "p-0",
  style: { flex: "1 1 40px" }
}, L = ["src"], O = {
  key: 1,
  class: "flex flex-col p-2 overflow-hidden",
  style: { flex: "10 1 280px" }
}, R = { class: "px-2" }, q = { class: "flex items-center" }, F = { class: "flex flex-col" }, G = {
  key: 0,
  class: "text-xl font-bold my-2"
}, H = {
  key: 1,
  class: "statement"
}, J = { class: "flex items-center flex-wrap items-center mt-2 gap-2" }, K = {
  key: 0,
  class: "i-la-youtube mx-1"
}, M = {
  key: 1,
  class: "i-mdi-text-long mx-1"
}, Q = {
  key: 2,
  class: "flex gap-1 rounded-xl p-1 bg-dark-50 bg-opacity-20 flex-wrap items-center",
  style: { flex: "1 1 230px" }
}, W = {
  __name: "PostCard",
  props: {
    hash: { type: String, default: "" },
    authors: { type: Object, default: () => ({}) },
    tag: { type: [String, Boolean], default: "" },
    back: Boolean,
    actions: { type: Boolean, default: !0 }
  },
  emits: ["user"],
  setup(o) {
    w("light");
    const B = w("deep"), C = o, { post: e } = I({ hash: C.hash }), S = V(() => e.icon || e.title || e.statement || e.link);
    return (c, r) => {
      var i, d, u, h, m, f, p, x, k, y, g;
      const P = $("post-link");
      return s(), l("div", {
        class: "card",
        style: b({ backgroundImage: `url(${((i = t(e)) == null ? void 0 : i.cover) || ((d = t(e)) == null ? void 0 : d.raw)})`, backgroundColor: t(B).hex(o.hash) })
      }, [
        a("div", {
          class: "p-0",
          style: b({ paddingTop: (u = t(e)) != null && u.cover || (h = t(e)) != null && h.raw ? "18em" : "0" })
        }, null, 4),
        a("div", z, [
          (m = t(e)) != null && m.icon ? (s(), l("div", A, [
            a("img", {
              class: "w-20 max-h-20 rounded-full m-2",
              src: t(e).icon,
              width: "40px"
            }, null, 8, L)
          ])) : n("", !0),
          S.value ? (s(), l("div", O, [
            a("div", R, [
              a("div", q, [
                a("div", F, [
                  (f = t(e)) != null && f.title ? (s(), l("div", G, _(t(e).title), 1)) : n("", !0),
                  (p = t(e)) != null && p.statement ? (s(), l("div", H, _(t(e).statement), 1)) : n("", !0)
                ]),
                r[1] || (r[1] = a("div", { class: "flex-1" }, null, -1)),
                v(P, { hash: o.hash }, null, 8, ["hash"])
              ])
            ]),
            a("div", J, [
              (x = t(e)) != null && x.youtube ? (s(), l("div", K)) : n("", !0),
              (k = t(e)) != null && k.text ? (s(), l("div", M)) : n("", !0),
              (y = t(e)) != null && y.link ? (s(), D(t(T), {
                key: 2,
                url: (g = t(e)) == null ? void 0 : g.link
              }, null, 8, ["url"])) : n("", !0),
              E(c.$slots, "default", {}, void 0, !0)
            ])
          ])) : n("", !0),
          o.actions ? (s(), l("div", Q, [
            v(t(U), {
              authors: o.authors,
              hash: o.hash,
              tag: o.tag,
              back: o.back,
              onUser: r[0] || (r[0] = (N) => c.$emit("user", N))
            }, null, 8, ["authors", "hash", "tag", "back"])
          ])) : n("", !0)
        ])
      ], 4);
    };
  }
}, te = /* @__PURE__ */ j(W, [["__scopeId", "data-v-452f279b"]]);
export {
  te as default
};
//# sourceMappingURL=PostCard-Jg4a_0s9.js.map
