import { useColor as S, useUser as $, useReaction as N, computed as h, useReactions as V, countRating as A, ref as D, openBlock as n, createElementBlock as a, createBaseVNode as k, toDisplayString as r, createVNode as u, unref as o, withCtx as g, Fragment as _, renderList as b, withModifiers as i, createCommentVNode as x, TransitionGroup as y, withDirectives as P, createBlock as z, vShow as E } from "./composables-Ci32s3jE.js";
import { PostReactionButton as F, AccountBadge as G } from "./components.js";
const L = { class: "p-1 flex flex-wrap gap-2 items-center" }, M = { class: "p-2 font-bold" }, O = ["onClick"], T = {
  key: 0,
  class: "pl-2 text-xl"
}, U = ["onClick"], J = {
  __name: "PostActionReact",
  props: {
    authors: { type: Object, default: () => ({}) },
    hash: { type: String, default: "" },
    tag: { type: String, default: "" },
    back: Boolean
  },
  emits: ["react", "user"],
  setup(d) {
    const c = d;
    S("deep");
    const { user: C } = $(), { reaction: w, react: p } = N({ ...c }), B = h(() => V(c.authors)), f = h(() => A(c.authors)), l = D();
    return (R, v) => {
      var m;
      return n(), a("div", L, [
        k("div", M, r(f.value > 0 ? "+" : "") + r(f.value), 1),
        u(o(F), {
          "is-my": (m = d.authors) == null ? void 0 : m[o(C).pub],
          reaction: o(w),
          onReact: v[0] || (v[0] = (s) => o(p)(s))
        }, null, 8, ["is-my", "reaction"]),
        u(y, { name: "fade" }, {
          default: g(() => [
            (n(!0), a(_, null, b(B.value, (s, e) => (n(), a("div", {
              class: "p-2px flex items-center rounded-3xl bg-light-500 dark-bg-dark-600 gap-1",
              key: e,
              onClick: i((t) => o(p)(e), ["stop", "prevent"])
            }, [
              e !== "true" ? (n(), a("div", T, r(e), 1)) : x("", !0),
              k("div", {
                class: "font-bold px-1",
                onClick: i((t) => l.value = l.value ? null : e, ["stop", "prevent"])
              }, r(s.length), 9, U),
              u(y, { name: "fade" }, {
                default: g(() => [
                  4 > s.length || l.value == e ? (n(!0), a(_, { key: 0 }, b(s, (t) => P((n(), z(o(G), {
                    class: "rounded-full shadow-md min-w-6",
                    key: t,
                    size: 20,
                    selectable: !0,
                    pub: t,
                    "show-name": !1,
                    onClick: i((q) => R.$emit("user", t), ["stop", "prevent"])
                  }, null, 8, ["pub", "onClick"])), [
                    [E, t]
                  ])), 128)) : x("", !0)
                ]),
                _: 2
              }, 1024)
            ], 8, O))), 128))
          ]),
          _: 1
        })
      ]);
    };
  }
};
export {
  J as default
};
//# sourceMappingURL=PostActionReact-gu6U2RcE.js.map
