import { defineComponent as d, useUser as f, useUserAvatar as m, openBlock as s, createElementBlock as o, createVNode as i, unref as e, withCtx as v, createBaseVNode as x, withModifiers as _ } from "./composables-Ci32s3jE.js";
import { AccountAvatar as b, FormPicture as k } from "./components.js";
const y = { class: "flex flex-col relative items-center justify-center" }, z = { class: "text-2xl" }, A = {
  key: 0,
  class: "i-la-camera"
}, B = /* @__PURE__ */ d({
  __name: "UserAvatar",
  props: {
    size: { type: Number, default: 120 },
    pic: { type: Number, default: 200 }
  },
  setup(r) {
    const { user: n } = f(), l = r, { remove: c, upload: p, avatar: u } = m();
    return (N, t) => (s(), o("div", y, [
      i(e(b), {
        pub: e(n).pub,
        size: r.size
      }, null, 8, ["pub", "size"]),
      i(e(k), {
        class: "absolute",
        options: { picSize: l.pic, preserveRatio: !1 },
        onUpdate: t[1] || (t[1] = (a) => e(p)(a))
      }, {
        default: v(() => [
          x("div", z, [
            e(u) ? (s(), o("div", {
              key: 1,
              class: "i-la-trash-alt",
              onClick: t[0] || (t[0] = _((a) => e(c)(), ["stop", "prevent"]))
            })) : (s(), o("div", A))
          ])
        ]),
        _: 1
      }, 8, ["options"])
    ]));
  }
});
export {
  B as default
};
//# sourceMappingURL=UserAvatar-Bc2VJTGV.js.map
