import { defineComponent as A, useAccount as h, toRef as B, useUser as w, computed as $, useBackground as P, useProjects as S, resolveComponent as D, openBlock as s, createElementBlock as a, createBaseVNode as l, createVNode as u, unref as e, toDisplayString as x, createBlock as d, createCommentVNode as p, normalizeStyle as C, Fragment as g, renderList as q } from "./composables-Ci32s3jE.js";
import { AccountAvatar as R, MateButton as V, ChatPrivateCount as z, AccountPetname as M, AccountProfile as N, MateList as O, ProjectCard as E, AccountReactions as H } from "./components.js";
const I = { class: "flex flex-col rounded-3xl overflow-hidden shadow-xl" }, L = { class: "flex flex-col ml-4 mx-4" }, U = { class: "text-2xl font-bold" }, W = { class: "mt-2" }, F = /* @__PURE__ */ l("div", { class: "flex-1" }, null, -1), K = { class: "p-4 flex flex-col" }, T = /* @__PURE__ */ l("div", { class: "text-xl font-bold p-2 mt-4" }, "Projects", -1), Y = { class: "flex flex-col gap-4" }, X = /* @__PURE__ */ A({
  __name: "AccountHome",
  props: {
    pub: { type: String, default: "OKrDaDeD8VeA27d673RqlodSnebnaDq6Ci23Ys_ABWE.q8fI2lkxO46R8TMjeUeAf7I0yBS5mdH_Cb9_285Wkqk" }
  },
  emits: ["browse", "feed", "post", "chat", "user", "project"],
  setup(t) {
    const i = t, { account: r } = h(B(i, "pub")), { user: m } = w(), y = $(() => P({ pub: i.pub, size: 600, light: 0.5, draw: "circles" })), { projects: f } = S(i.pub);
    return (c, o) => {
      var v, k;
      const j = D("gift-wallets");
      return s(), a("div", I, [
        l("div", {
          class: "p-4 flex items-center bg-cover border-b-6",
          style: C({ borderColor: e(r).color, ...y.value })
        }, [
          u(e(R), {
            pub: t.pub,
            size: 120,
            onClick: o[0] || (o[0] = (n) => c.$emit("user", t.pub))
          }, null, 8, ["pub"]),
          l("div", L, [
            l("div", U, x((v = e(r).profile) == null ? void 0 : v.name), 1),
            l("div", W, x((k = e(r)) == null ? void 0 : k.lastSeen), 1)
          ]),
          F,
          u(e(V), {
            class: "m-4",
            pub: t.pub
          }, null, 8, ["pub"]),
          e(m).is ? (s(), d(e(z), {
            key: 0,
            pub: t.pub,
            onChat: o[1] || (o[1] = (n) => c.$emit("chat"))
          }, null, 8, ["pub"])) : p("", !0)
        ], 4),
        t.pub != e(m).pub ? (s(), d(e(M), {
          key: 0,
          pub: t.pub,
          style: C({ backgroundColor: e(r).color })
        }, null, 8, ["pub", "style"])) : p("", !0),
        u(e(N), {
          class: "p-4",
          pub: t.pub
        }, null, 8, ["pub"]),
        l("div", K, [
          u(e(O), {
            pub: t.pub,
            onBrowse: o[2] || (o[2] = (n) => c.$emit("browse", n))
          }, null, 8, ["pub"]),
          Object.keys(e(f)).length > 0 ? (s(), a(g, { key: 0 }, [
            T,
            l("div", Y, [
              (s(!0), a(g, null, q(e(f), (n, b) => (s(), d(e(E), {
                key: b,
                project: n,
                path: b + "@" + t.pub,
                onClick: (G) => c.$emit("project", b + "@" + t.pub)
              }, null, 8, ["project", "path", "onClick"]))), 128))
            ])
          ], 64)) : p("", !0),
          u(e(H), {
            class: "m-2",
            pub: t.pub,
            onPost: o[3] || (o[3] = (n) => c.$emit("post", n))
          }, null, 8, ["pub"]),
          u(j, { pub: t.pub }, null, 8, ["pub"])
        ])
      ]);
    };
  }
});
export {
  X as default
};
//# sourceMappingURL=AccountHome-qe9cmU9f.js.map
