1import { c as C } from "./OKrP_LvL.js"; 2import { d as c, Y as v, z as d, f, y as n, G as m, l as t, bm as _, k as $, o as w, ah as k, br as R, Q as B, d1 as P, af as S, bt as L, bu as F, O as j, g as h, a2 as x, ae as g, h as b, B as M } from "./B5ttsc57.js"; 3import { c as U } from "./CvCWvZn2.js"; 4import { u as y, c as T } from "./DSBgBLEA.js"; 5import { P as z } from "./Dq-ojowy.js"; 6const [A, I] = T("AvatarRoot"), N = c({ __name: "AvatarRoot", props: { asChild: { type: Boolean }, as: { default: "span" } }, setup(l) { 7 return y(), I({ imageLoadingStatus: v("loading") }), (e, s) => (f(), d(t(z), { "as-child": e.asChild, as: e.as }, { default: n(() => [m(e.$slots, "default")]), _: 3 }, 8, ["as-child", "as"])); 8} }), O = c({ __name: "AvatarFallback", props: { delayMs: { default: 0 }, asChild: { type: Boolean }, as: { default: "span" } }, setup(l) { 9 const e = l, s = A(); 10 y(); 11 const r = v(false); 12 let o; 13 return _(s.imageLoadingStatus, (a) => { 14 a === "loading" && (r.value = false, e.delayMs ? o = setTimeout(() => { 15 r.value = true, clearTimeout(o); 16 }, e.delayMs) : r.value = true); 17 }, { immediate: true }), (a, p) => r.value && t(s).imageLoadingStatus.value !== "loaded" ? (f(), d(t(z), { key: 0, "as-child": a.asChild, as: a.as }, { default: n(() => [m(a.$slots, "default")]), _: 3 }, 8, ["as-child", "as"])) : $("", true); 18} }); 19function V(l, e) { 20 const s = v("idle"), r = v(false), o = (a) => () => { 21 r.value && (s.value = a); 22 }; 23 return w(() => { 24 r.value = true, _([() => l.value, () => e == null ? void 0 : e.value], ([a, p]) => { 25 if (!a) s.value = "error"; 26 else { 27 const i = new window.Image(); 28 s.value = "loading", i.onload = o("loaded"), i.onerror = o("error"), i.src = a, p && (i.referrerPolicy = p); 29 } 30 }, { immediate: true }); 31 }), k(() => { 32 r.value = false; 33 }), s; 34} 35const D = c({ __name: "AvatarImage", props: { src: {}, referrerPolicy: {}, asChild: { type: Boolean }, as: { default: "img" } }, emits: ["loadingStatusChange"], setup(l, { emit: e }) { 36 const s = l, r = e, { src: o, referrerPolicy: a } = R(s); 37 y(); 38 const p = A(), i = V(o, a); 39 return _(i, (u) => { 40 r("loadingStatusChange", u), u !== "idle" && (p.imageLoadingStatus.value = u); 41 }, { immediate: true }), (u, H) => B((f(), d(t(z), { role: "img", "as-child": u.asChild, as: u.as, src: t(o), "referrer-policy": t(a) }, { default: n(() => [m(u.$slots, "default")]), _: 3 }, 8, ["as-child", "as", "src", "referrer-policy"])), [[P, t(i) === "loaded"]]); 42} }), E = c({ __name: "Avatar", props: { class: {}, size: { default: "sm" }, shape: { default: "circle" } }, setup(l) { 43 const e = l; 44 return (s, r) => (f(), d(t(N), { class: S(t(C)(t(Q)({ size: s.size, shape: s.shape }), e.class)) }, { default: n(() => [m(s.$slots, "default")]), _: 3 }, 8, ["class"])); 45} }), q = c({ __name: "AvatarFallback", props: { delayMs: {}, asChild: { type: Boolean }, as: {} }, setup(l) { 46 const e = l; 47 return (s, r) => (f(), d(t(O), L(F(e)), { default: n(() => [m(s.$slots, "default")]), _: 3 }, 16)); 48} }), G = c({ __name: "AvatarImage", props: { src: {}, referrerPolicy: {}, asChild: { type: Boolean }, as: {} }, setup(l) { 49 const e = l; 50 return (s, r) => (f(), d(t(D), j(e, { class: "h-full w-full object-cover" }), { default: n(() => [m(s.$slots, "default")]), _: 3 }, 16)); 51} }), Q = U("bg-secondary text-foreground inline-flex shrink-0 items-center justify-center overflow-hidden font-normal select-none", { variants: { size: { sm: "h-10 w-10 text-xs", base: "h-16 w-16 text-2xl", lg: "h-32 w-32 text-5xl" }, shape: { circle: "rounded-full", square: "rounded-md" } } }), X = "" + new URL("default-avatar.uscRzRXF.png", import.meta.url).href, Y = ["src", "alt"], ae = c({ __name: "avatar", props: { class: { type: [Array, Object, String, Number, null, Boolean] }, adminUser: {}, src: {}, fallback: { default: X }, size: { default: "default" }, shape: { default: "circle" }, alt: { default: "" }, srcSet: {}, fit: { default: "cover" } }, setup(l) { 52 const e = l, s = h(() => { 53 var _a, _b; 54 const a = (_b = e.src || ((_a = e.adminUser) == null ? void 0 : _a.avatar)) == null ? void 0 : _b.trim(); 55 return a ? /^(data|blob):/.test(a) ? a : x(a, { keepOriginalType: true }) : e.fallback; 56 }), r = h(() => typeof e.size == "number" ? "size-[var(--user-avatar-size)]" : e.size === "small" ? "size-[24px]" : e.size === "large" ? "size-[56px]" : "size-[40px]"), o = h(() => typeof e.size == "number" ? { "--user-avatar-size": "".concat(e.size, "px") } : void 0); 57 return (a, p) => (f(), d(t(E), { shape: a.shape, class: S(t(C)("bg-transparent", r.value, e.class)), style: g(o.value) }, { default: n(() => [b(t(G), { src: s.value, alt: a.alt, srcset: a.srcSet, style: g({ objectFit: a.fit }) }, null, 8, ["src", "alt", "srcset", "style"]), b(t(q), { class: "size-full" }, { default: n(() => [M("img", { src: a.fallback, alt: a.alt, class: "size-full", style: g({ objectFit: a.fit }) }, null, 12, Y)]), _: 1 })]), _: 1 }, 8, ["shape", "class", "style"])); 58} }); 59export { 60 ae as _ 61};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.