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