749 lines
26 KiB
JavaScript
749 lines
26 KiB
JavaScript
/*
|
||
* Extracted from browser-delivered Turbopack chunk: 5abe5d57a9f648de.55a495b94b.js
|
||
* Module id: 255806
|
||
* For reading/searching only; this factory depends on the original Turbopack runtime.
|
||
*/
|
||
|
||
const moduleFactory = (e) => {
|
||
"use strict";
|
||
var t,
|
||
a,
|
||
l,
|
||
s,
|
||
r,
|
||
n = e.i(462214),
|
||
i = e.i(358379);
|
||
e.i(370357);
|
||
var o = e.i(185264),
|
||
c = e.i(542703),
|
||
d = e.i(675706);
|
||
function u({ children: e, className: t, type: a, forceHide: l = !1 }) {
|
||
let [s, r] = (0, i.useState)({ activitySwitch: !1, remark: "" }),
|
||
{ promptActivityConfig: u, inTimelimit: x } = (0, o.vipInfoStore)(),
|
||
m = (0, i.useCallback)(() => {
|
||
d.configService.getActivityConfig().then((e) => {
|
||
"boolean" == typeof e?.activitySwitch && e?.remark && r(e);
|
||
});
|
||
}, []);
|
||
return ((0, i.useEffect)(() => {
|
||
m();
|
||
}, [m]),
|
||
(0, i.useEffect)(() => {
|
||
let e = () => m();
|
||
return (
|
||
window.addEventListener(c.LIBTV_REFRESH_ACTIVITY_CONFIG_EVENT, e),
|
||
() =>
|
||
window.removeEventListener(c.LIBTV_REFRESH_ACTIVITY_CONFIG_EVENT, e)
|
||
);
|
||
}, [m]),
|
||
l)
|
||
? e
|
||
: s.activitySwitch || u?.visible || x?.timeLimitedDiscount
|
||
? (0, n.jsxs)("div", {
|
||
"data-tag": "CornerMark",
|
||
className: "relative",
|
||
children: [
|
||
(0, n.jsx)("div", {
|
||
className: `absolute -top-4 z-10 flex h-4 items-center justify-center text-nowrap rounded-md rounded-bl-none bg-[#FAD6A4] px-2 py-0.5 text-center text-[10px] text-[#0D0D0D] ${t} `,
|
||
children:
|
||
u?.activityTips ||
|
||
s.remark ||
|
||
x?.discountDetail?.globalConnerMark,
|
||
}),
|
||
e,
|
||
],
|
||
})
|
||
: e;
|
||
}
|
||
e.s(["default", () => u], 91920), e.i(606823);
|
||
var x = e.i(471454),
|
||
m = e.i(637591),
|
||
h = e.i(373518);
|
||
function p({ visible: e, onInviteClick: t }) {
|
||
let { personalAccount: a } = (0, x.useAccountHooks)(),
|
||
[l, s] = (0, i.useState)(null),
|
||
r = a?.source === 2;
|
||
if (
|
||
((0, i.useEffect)(() => {
|
||
if (!r || !e) return;
|
||
let t = !1;
|
||
return (
|
||
(0, m.getInviteCodeDetails)(h.TEAM_FISSION_BATCH_NO)
|
||
.then((e) => {
|
||
t || s(e?.data ?? null);
|
||
})
|
||
.catch(() => {}),
|
||
() => {
|
||
t = !0;
|
||
}
|
||
);
|
||
}, [r, e]),
|
||
!r)
|
||
)
|
||
return null;
|
||
let o = l?.inviteCount ?? 0,
|
||
c = l?.rewardAmount ?? 0;
|
||
return (0, n.jsx)("div", {
|
||
className: "mt-2 overflow-hidden rounded-lg bg-white dark:bg-[#1c1c1c]",
|
||
children: (0, n.jsxs)("div", {
|
||
className: "flex items-center gap-2 px-4 py-2",
|
||
children: [
|
||
(0, n.jsxs)("span", {
|
||
className:
|
||
"shrink-0 whitespace-nowrap text-xs text-[#424242] dark:text-[#C7C7C7]",
|
||
children: ["已邀请 ", o, " 人"],
|
||
}),
|
||
(0, n.jsxs)("span", {
|
||
className:
|
||
"shrink-0 whitespace-nowrap text-xs text-[#424242] dark:text-[#C7C7C7]",
|
||
children: ["共获赠 ", c, " 条免费生成"],
|
||
}),
|
||
(0, n.jsx)("span", {
|
||
className:
|
||
"min-w-0 flex-1 cursor-pointer text-right text-xs text-[#05a3c5]",
|
||
onClick: t,
|
||
children: "继续邀请",
|
||
}),
|
||
],
|
||
}),
|
||
});
|
||
}
|
||
e.s(["default", () => p], 256422);
|
||
var f = e.i(687517),
|
||
v = e.i(41671),
|
||
g = e.i(211478);
|
||
let b = "libtv_login_guide_popup";
|
||
function w() {
|
||
return new Date().toISOString().slice(0, 10);
|
||
}
|
||
function y() {
|
||
let { isLogin: e } = (0, f.useLoginHook)(),
|
||
{ openLogin: t, isOpen: a } = (0, g.useLogin)(),
|
||
[l, s] = (0, i.useState)(!1),
|
||
r = (0, i.useRef)(null);
|
||
(0, i.useEffect)(() => {
|
||
if (
|
||
!e &&
|
||
(function () {
|
||
try {
|
||
let e = localStorage.getItem(b);
|
||
if (!e) return !0;
|
||
return JSON.parse(e).lastDate !== w();
|
||
} catch {
|
||
return !0;
|
||
}
|
||
})()
|
||
)
|
||
return (
|
||
(r.current = setTimeout(() => {
|
||
if ((console.log("timerRef.current", r.current), !e)) {
|
||
s(!0);
|
||
try {
|
||
localStorage.setItem(b, JSON.stringify({ lastDate: w() }));
|
||
} catch {
|
||
console.error("recordShow error");
|
||
}
|
||
}
|
||
}, 3e4)),
|
||
() => {
|
||
r.current && clearTimeout(r.current);
|
||
}
|
||
);
|
||
}, [e]),
|
||
(0, i.useEffect)(() => {
|
||
a && l && s(!1);
|
||
}, [a, l]);
|
||
let o = (0, i.useCallback)(() => {
|
||
s(!1);
|
||
}, []),
|
||
c = (0, i.useCallback)(() => {
|
||
s(!1), t({ closeOnClickOutside: !1 });
|
||
}, [t]);
|
||
return !l || e
|
||
? null
|
||
: (0, n.jsx)("div", {
|
||
className:
|
||
"animate-fade-in z-(--z-dropdown) absolute right-[-20px] top-full mt-0",
|
||
children: (0, n.jsxs)("div", {
|
||
className: "relative w-[376px] overflow-hidden",
|
||
children: [
|
||
(0, n.jsx)("div", {
|
||
className:
|
||
"absolute right-6 top-5 z-10 flex size-6 cursor-pointer items-center justify-center rounded-[8px] bg-white text-black backdrop-blur transition-colors",
|
||
onClick: o,
|
||
children: (0, n.jsx)(v.Icons.Close, {
|
||
width: 10,
|
||
height: 10,
|
||
}),
|
||
}),
|
||
(0, n.jsx)("img", {
|
||
src: "https://liblibai-online.liblib.cloud/web/976652348270470eba25b9d8ca891fda/bb512bcd-88fb-44cf-91bc-67306463e57a.png",
|
||
alt: "",
|
||
className: "block w-full cursor-pointer",
|
||
draggable: !1,
|
||
onClick: c,
|
||
}),
|
||
],
|
||
}),
|
||
});
|
||
}
|
||
e.s(["default", () => y], 904908);
|
||
var j = e.i(963527),
|
||
N = e.i(841183),
|
||
_ = e.i(691411),
|
||
k = e.i(844567);
|
||
function C() {
|
||
return (C = Object.assign.bind()).apply(null, arguments);
|
||
}
|
||
let S = function (e) {
|
||
return i.createElement(
|
||
"svg",
|
||
C(
|
||
{
|
||
xmlns: "http://www.w3.org/2000/svg",
|
||
width: 8,
|
||
height: 10,
|
||
fill: "none",
|
||
viewBox: "0 0 8 10",
|
||
},
|
||
e,
|
||
),
|
||
t ||
|
||
(t = i.createElement("path", {
|
||
fill: "currentColor",
|
||
d: "M7.306 4.36H5.79V.76c0-.84-.447-1.01-.992-.38l-.393.455-3.323 3.85c-.456.525-.265.955.422.955h1.517v3.6c0 .84.447 1.01.992.38l.392-.455 3.324-3.85c.456-.525.265-.955-.423-.955",
|
||
})),
|
||
);
|
||
};
|
||
var M = e.i(722573);
|
||
e.i(777784);
|
||
var E = e.i(216257);
|
||
e.i(704030);
|
||
let T = (e) => {
|
||
if (void 0 === e) return 0;
|
||
let t = E.stores.lang?.lang ?? "zh";
|
||
return new Intl.NumberFormat(t, { maximumFractionDigits: 0 }).format(e);
|
||
};
|
||
function I(e) {
|
||
let { onClick: t, disabled: a = !1 } = e,
|
||
{ t: l } = (0, _.useI18n)(),
|
||
s = (0, o.useUserVipInfo)(),
|
||
{ remainPower: r } = (0, N.useVipBenefitHooks)(),
|
||
c = (0, i.useMemo)(
|
||
() => Math.max(0, s?.vipInfo?.attr.libtvUsablePower ?? 0),
|
||
[s?.vipInfo],
|
||
),
|
||
d = (0, i.useMemo)(() => {
|
||
let e = s?.vipInfo?.attr?.exPowerSummary?.usablePower;
|
||
return Math.max(0, "number" == typeof e ? e : 0);
|
||
}, [s?.vipInfo?.attr?.exPowerSummary?.usablePower]),
|
||
u = (0, i.useMemo)(() => Math.max(0, r) + c + d, [r, c, d]),
|
||
[x, m] = (0, i.useState)(!0);
|
||
(0, i.useEffect)(() => {
|
||
if (!s?.vipInfo?.todaySendFreePower) return;
|
||
m(!0);
|
||
let e = window.setTimeout(() => m(!1), 5e3);
|
||
return () => window.clearTimeout(e);
|
||
}, [s?.vipInfo?.todaySendFreePower]);
|
||
let h = !!(s?.vipInfo?.todaySendFreePower && x),
|
||
p = (0, i.useMemo)(
|
||
() =>
|
||
(0, n.jsxs)("div", {
|
||
className: "flex items-center gap-1",
|
||
children: [
|
||
(0, n.jsx)(S, {}),
|
||
l("dailyCreditsRefreshed", {
|
||
total: s?.vipInfo?.todaySendFreePower ?? 0,
|
||
}),
|
||
],
|
||
}),
|
||
[l, s?.vipInfo?.todaySendFreePower],
|
||
),
|
||
f = (0, i.useMemo)(() => {
|
||
let e = Math.max(0, r);
|
||
return (0, n.jsx)("div", {
|
||
className: "w-[min(100vw-48px,320px)] p-6",
|
||
children: (0, n.jsxs)("div", {
|
||
className: "flex flex-col gap-4",
|
||
children: [
|
||
(0, n.jsxs)("p", {
|
||
className:
|
||
"text-[16px] font-semibold leading-normal text-[#262626] dark:text-[#F7F7F7]",
|
||
children: ["积分余额:", T(u), "点"],
|
||
}),
|
||
(0, n.jsxs)("div", {
|
||
className: "flex w-full items-end justify-between gap-4",
|
||
children: [
|
||
(0, n.jsxs)("div", {
|
||
className:
|
||
"flex min-w-0 flex-1 flex-col gap-1 text-[14px] leading-[1.6] text-[#262626] dark:text-[#F7F7F7]",
|
||
children: [
|
||
(0, n.jsxs)("p", {
|
||
children: ["通用积分:", T(e), "点"],
|
||
}),
|
||
(0, n.jsxs)("p", {
|
||
children: ["LibTV专属积分:", T(c), "点"],
|
||
}),
|
||
(0, n.jsxs)("p", {
|
||
children: ["模型卡积分:", T(d), "点"],
|
||
}),
|
||
],
|
||
}),
|
||
(0, n.jsx)("button", {
|
||
type: "button",
|
||
"aria-disabled": a,
|
||
className: a
|
||
? "h-7 shrink-0 cursor-not-allowed rounded-lg bg-[#ffc65d]/50 px-3 text-[13px] text-black/60"
|
||
: "h-7 shrink-0 cursor-pointer rounded-lg bg-[#ffc65d] px-3 text-[13px] text-black hover:bg-[#ffb84a]",
|
||
onClick: (e) => {
|
||
e.stopPropagation(),
|
||
e.preventDefault(),
|
||
a ||
|
||
(0, j.openVipModel)({
|
||
intent: "purchase_vip",
|
||
isShowChargePop: !0,
|
||
chargeType: 1,
|
||
});
|
||
},
|
||
children: "特惠充值",
|
||
}),
|
||
],
|
||
}),
|
||
],
|
||
}),
|
||
});
|
||
}, [a, c, d, r, u]);
|
||
return (0, n.jsxs)(k.HoverCard, {
|
||
position: "bottom-end",
|
||
shadow: "md",
|
||
radius: "lg",
|
||
openDelay: 0,
|
||
closeDelay: 200,
|
||
offset: { mainAxis: 14, crossAxis: 44 },
|
||
children: [
|
||
(0, n.jsx)(k.HoverCard.Target, {
|
||
children: (0, n.jsx)(M.Tooltip, {
|
||
visibleFrom: "sm",
|
||
position: "bottom",
|
||
label: p,
|
||
opened: !!h || void 0,
|
||
disabled: !h,
|
||
classNames: {
|
||
tooltip:
|
||
"!border-0 !px-4 !py-2 backdrop-blur-sm !bg-white !text-[#333] !shadow-[0_2px_12px_rgba(0,0,0,0.12)] dark:!bg-[#000000B2] dark:!text-white dark:!shadow-none",
|
||
},
|
||
children: (0, n.jsxs)("button", {
|
||
type: "button",
|
||
"aria-disabled": a,
|
||
className: a
|
||
? "relative flex cursor-default items-center gap-1"
|
||
: "relative flex cursor-pointer items-center gap-1 before:absolute before:-inset-x-2 before:-inset-y-1 before:rounded-lg before:content-[''] hover:before:bg-black/5 dark:hover:before:bg-white/10",
|
||
onClick: a ? void 0 : () => t?.(),
|
||
children: [
|
||
(0, n.jsx)(S, { className: "text-[#FFDBA4]" }),
|
||
(0, n.jsx)("span", { children: T(u) }),
|
||
],
|
||
}),
|
||
}),
|
||
}),
|
||
(0, n.jsx)(k.HoverCard.Dropdown, {
|
||
p: 0,
|
||
className:
|
||
"max-w-[min(100vw-32px,320px)] rounded-xl border bg-white shadow-[0px_8px_16px_rgba(0,0,0,0.18),0px_2px_4px_rgba(0,0,0,0.2)] backdrop-blur-md dark:bg-[#262626]",
|
||
children: f,
|
||
}),
|
||
],
|
||
});
|
||
}
|
||
e.s(
|
||
[
|
||
"countFormat",
|
||
0,
|
||
(e) =>
|
||
e < 1e3
|
||
? e
|
||
: e < 999999
|
||
? (e / 1e3).toFixed(1) + "k"
|
||
: Math.floor(e / 1e4) + "w",
|
||
"formatPower",
|
||
0,
|
||
T,
|
||
],
|
||
2876,
|
||
),
|
||
e.s(["default", () => I], 908184);
|
||
var A = e.i(243531),
|
||
L = e.i(904472),
|
||
D = e.i(433761);
|
||
async function F() {
|
||
let e = (0, D.getUrl)(L.urls.getTVMailCount);
|
||
return await (0, A.postWithToken)(e, {});
|
||
}
|
||
async function V(e) {
|
||
let t = (0, D.getUrl)(L.urls.getTVMailTypeList);
|
||
return await (0, A.postWithToken)(t, e);
|
||
}
|
||
async function z(e) {
|
||
let t = (0, D.getUrl)(L.urls.readAllTVMail);
|
||
return await (0, A.postWithToken)(t, e);
|
||
}
|
||
function R() {
|
||
return (R = Object.assign.bind()).apply(null, arguments);
|
||
}
|
||
function H() {
|
||
return (H = Object.assign.bind()).apply(null, arguments);
|
||
}
|
||
function W() {
|
||
return (W = Object.assign.bind()).apply(null, arguments);
|
||
}
|
||
e.s(
|
||
[
|
||
"getMailCount",
|
||
() => F,
|
||
"getMailTypeList",
|
||
() => V,
|
||
"readAllMail",
|
||
() => z,
|
||
],
|
||
92591,
|
||
),
|
||
e.s(
|
||
[
|
||
"default",
|
||
0,
|
||
function (e) {
|
||
return i.createElement(
|
||
"svg",
|
||
R(
|
||
{
|
||
xmlns: "http://www.w3.org/2000/svg",
|
||
width: 12,
|
||
height: 13,
|
||
fill: "none",
|
||
viewBox: "0 0 12 13",
|
||
},
|
||
e,
|
||
),
|
||
a ||
|
||
(a = i.createElement("path", {
|
||
fill: "currentColor",
|
||
d: "M3.831.96q.551.015 1.068.191h.035a.2.2 0 0 1 .052.035c.129.041.25.089.367.153l.222.099c.087.046.193.133.251.169.058.034.122.07.175.11A3.66 3.66 0 0 1 8.247.959c.368 0 .736.052 1.085.169 2.153.7 2.93 3.063 2.281 5.128A7.4 7.4 0 0 1 9.857 9.06a22.4 22.4 0 0 1-3.692 2.894l-.147.087-.152-.094a22.2 22.2 0 0 1-3.714-2.893A7.55 7.55 0 0 1 .395 6.256c-.659-2.065.117-4.427 2.293-5.14q.256-.087.519-.122h.07q.245-.036.49-.035zm5.198 1.843a.47.47 0 0 0-.59.29.48.48 0 0 0 .291.601c.374.14.625.509.625.916v.018a.5.5 0 0 0 .112.362.5.5 0 0 0 .332.17.48.48 0 0 0 .46-.444v-.07a1.93 1.93 0 0 0-1.23-1.843",
|
||
})),
|
||
);
|
||
},
|
||
],
|
||
720601,
|
||
),
|
||
e.s(
|
||
[
|
||
"default",
|
||
0,
|
||
function (e) {
|
||
return i.createElement(
|
||
"svg",
|
||
H(
|
||
{
|
||
xmlns: "http://www.w3.org/2000/svg",
|
||
width: 12,
|
||
height: 11,
|
||
fill: "none",
|
||
viewBox: "0 0 12 11",
|
||
},
|
||
e,
|
||
),
|
||
l ||
|
||
(l = i.createElement("path", {
|
||
fill: "currentColor",
|
||
d: "M6.449.25c.609 0 1.177.439 1.382 1.14.075.294.106.59.136.873l.027.258c.105.86.105 5.09 0 5.959l-.027.267a5 5 0 0 1-.132.848c-.205.7-.752 1.155-1.372 1.155l-.062-.001c-.343 0-.716-.21-.928-.394L3.415 8.64H2.356C1.54 8.64.943 8.05.835 7.136c-.125-.914-.1-2.481 0-3.312.118-.864.743-1.463 1.521-1.464h1.059L5.435.67c.243-.212.674-.421 1.014-.42m3.137 1.901a.53.53 0 0 1 .746.137c.591.871.918 2.012.918 3.212s-.327 2.34-.918 3.212a.528.528 0 0 1-.746.137.557.557 0 0 1-.134-.763c.468-.69.726-1.609.726-2.586 0-.978-.258-1.896-.726-2.586a.557.557 0 0 1 .134-.763",
|
||
})),
|
||
);
|
||
},
|
||
],
|
||
608619,
|
||
),
|
||
e.s(
|
||
[
|
||
"default",
|
||
0,
|
||
function (e) {
|
||
return i.createElement(
|
||
"svg",
|
||
W(
|
||
{
|
||
xmlns: "http://www.w3.org/2000/svg",
|
||
width: 12,
|
||
height: 8,
|
||
fill: "none",
|
||
viewBox: "0 0 12 8",
|
||
},
|
||
e,
|
||
),
|
||
s ||
|
||
(s = i.createElement("path", {
|
||
fill: "currentColor",
|
||
fillRule: "evenodd",
|
||
d: "M11.08.588a.583.583 0 0 1 0 .825L4.661 7.829a.583.583 0 0 1-.824 0L.92 4.913a.583.583 0 1 1 .825-.825L4.25 6.592 10.254.588a.583.583 0 0 1 .825 0",
|
||
clipRule: "evenodd",
|
||
})),
|
||
);
|
||
},
|
||
],
|
||
890889,
|
||
);
|
||
var O = e.i(396805);
|
||
let $ = { officialMsgCount: 0, likeMsgCount: 0 },
|
||
G = (0, O.createWithEqualityFn)((e) => ({
|
||
mailCountInfo: $,
|
||
setMailCountInfo: (t) => {
|
||
e({ mailCountInfo: t });
|
||
},
|
||
})),
|
||
P = !1,
|
||
B = 0,
|
||
U = () => {
|
||
let e = G((e) => e.mailCountInfo),
|
||
t = G((e) => e.setMailCountInfo),
|
||
a = () => {
|
||
let e = ++B;
|
||
F().then((a) => {
|
||
e !== B || t(a.data ?? $);
|
||
});
|
||
};
|
||
return (
|
||
(0, i.useEffect)(() => {
|
||
P || ((P = !0), a());
|
||
}, []),
|
||
{ mailCountInfo: e, refreshMailCountInfo: a }
|
||
);
|
||
},
|
||
K = (e, t) => {
|
||
let [a, l] = (0, i.useState)([]),
|
||
[s, r] = (0, i.useState)(e),
|
||
[n, o] = (0, i.useState)(t),
|
||
[c, d] = (0, i.useState)(1),
|
||
[u, x] = (0, i.useState)(0);
|
||
return (
|
||
(0, i.useEffect)(() => {
|
||
let e = { page: c, pageSize: 10, firstType: s };
|
||
void 0 !== n && (e.secondType = n),
|
||
V(e).then((e) => {
|
||
let t = e?.data?.data ?? [];
|
||
l((e) => [...e, ...t]);
|
||
let a = e?.data?.total;
|
||
x("number" == typeof a ? a : 0);
|
||
});
|
||
}, [s, n, c]),
|
||
{
|
||
mailList: a,
|
||
currentMailType: s,
|
||
setCurrentMailType: r,
|
||
changeMailType: (e, t) => {
|
||
r(e), o(t), l([]), d(1);
|
||
},
|
||
nextPage: () => {
|
||
u > a.length && d(c + 1);
|
||
},
|
||
}
|
||
);
|
||
};
|
||
e.s(["useMailCountInfo", 0, U, "useMailList", 0, K], 268145);
|
||
var Y = e.i(41114),
|
||
q = e.i(295085);
|
||
let J = ({ isCanvasLight: e }) =>
|
||
(0, n.jsxs)("div", {
|
||
className: "flex h-full w-full flex-col items-center justify-center",
|
||
children: [
|
||
(0, n.jsx)("img", {
|
||
className: "h-[68px] w-[68px] opacity-60",
|
||
src: "https://liblibai-online.liblib.cloud/web/e6484f0bca9c4ff7aaa019eb46405170/a40addb2-26f3-4a65-8e26-3a499052e85e.png",
|
||
}),
|
||
(0, n.jsx)("div", {
|
||
className: (0, Y.cn)(
|
||
"text-xs font-medium",
|
||
e ? "text-canvas-controls-text/50" : "text-[#999999]",
|
||
),
|
||
children: "- 暂无通知 -",
|
||
}),
|
||
],
|
||
});
|
||
e.s(["Empty", 0, J], 30548);
|
||
let X = (e) => {
|
||
let t = new Date(e),
|
||
a = t.getFullYear(),
|
||
l = String(t.getMonth() + 1).padStart(2, "0"),
|
||
s = String(t.getDate()).padStart(2, "0"),
|
||
r = String(t.getHours()).padStart(2, "0"),
|
||
n = String(t.getMinutes()).padStart(2, "0"),
|
||
i = String(t.getSeconds()).padStart(2, "0");
|
||
return `${a}-${l}-${s} ${r}:${n}:${i}`;
|
||
};
|
||
function Z() {
|
||
return (Z = Object.assign.bind()).apply(null, arguments);
|
||
}
|
||
e.s(
|
||
[
|
||
"isHtmlContent",
|
||
0,
|
||
(e) => /<[^>]*>/g.test(e),
|
||
"transformTimeString",
|
||
0,
|
||
X,
|
||
],
|
||
323448,
|
||
),
|
||
e.s(
|
||
[
|
||
"default",
|
||
0,
|
||
({
|
||
className: e = "",
|
||
isCanvasLight: t,
|
||
handleReadMail: a,
|
||
markAllReadTimestamp: l,
|
||
}) => {
|
||
let { mailList: s, nextPage: r } = K(4),
|
||
o = (0, i.useRef)(null),
|
||
[c, d] = (0, i.useState)([]),
|
||
{ refreshMailCountInfo: u } = U(),
|
||
x = (0, i.useCallback)(() => {
|
||
let e = o.current;
|
||
if (!e) return;
|
||
let { scrollTop: t, scrollHeight: a, clientHeight: l } = e;
|
||
a - t - l <= 20 && r();
|
||
}, [r]);
|
||
return (
|
||
(0, i.useEffect)(() => {
|
||
let e = o.current;
|
||
if (e)
|
||
return (
|
||
e.addEventListener("scroll", x),
|
||
() => {
|
||
e.removeEventListener("scroll", x);
|
||
}
|
||
);
|
||
}, [x]),
|
||
(0, i.useEffect)(() => {
|
||
l &&
|
||
s?.length &&
|
||
d((e) => {
|
||
let t = new Set(e);
|
||
return (
|
||
s.forEach((e) => {
|
||
t.add(e.id);
|
||
}),
|
||
Array.from(t)
|
||
);
|
||
});
|
||
}, [l, s]),
|
||
(0, n.jsx)("div", {
|
||
ref: o,
|
||
className: `tiny-scrollbar flex h-full flex-col gap-2 overflow-y-scroll px-4 py-2 ${e}`,
|
||
children:
|
||
s?.length > 0
|
||
? s.map((e) =>
|
||
(0, n.jsxs)(
|
||
"div",
|
||
{
|
||
className: (0, Y.cn)(
|
||
"flex cursor-pointer gap-2 rounded-lg border p-4 transition-colors",
|
||
t
|
||
? "border-canvas-controls-border bg-canvas-node-bg hover:bg-canvas-controls-hover"
|
||
: "border-[rgba(255,255,255,0.06)] bg-[#2a2a2a] hover:bg-[#333333]",
|
||
),
|
||
onClick: () => {
|
||
let t = `${window.location.origin}/detail/${e.description}`;
|
||
window.open(t, "_blank"),
|
||
0 === e.readStatus &&
|
||
z({ msgIds: [String(e.id)] }).then(() => {
|
||
d((t) => [...t, e.id]), u(), a();
|
||
});
|
||
},
|
||
children: [
|
||
(0, n.jsx)("div", {
|
||
children: (0, n.jsx)("img", {
|
||
className:
|
||
"h-[42px] w-[42px] rounded-sm object-cover",
|
||
src: (0, q.getFasterImage)(e.msgDescPic, {
|
||
length: 100,
|
||
}),
|
||
alt: "",
|
||
}),
|
||
}),
|
||
(0, n.jsxs)("div", {
|
||
className: "flex flex-1 flex-col gap-2",
|
||
children: [
|
||
(0, n.jsx)("div", {
|
||
className: (0, Y.cn)(
|
||
"flex items-center justify-between text-xs font-semibold",
|
||
t
|
||
? "text-canvas-controls-text"
|
||
: "text-white",
|
||
),
|
||
children: e.content,
|
||
}),
|
||
(0, n.jsxs)("div", {
|
||
className:
|
||
"flex items-center justify-between",
|
||
children: [
|
||
(0, n.jsx)("div", {
|
||
className: (0, Y.cn)(
|
||
"text-xs",
|
||
t
|
||
? "text-canvas-controls-text/50"
|
||
: "text-[#666666]",
|
||
),
|
||
children: X(e.createTime),
|
||
}),
|
||
0 === e.readStatus &&
|
||
!c.includes(e.id) &&
|
||
(0, n.jsx)("div", {
|
||
className:
|
||
"h-1 w-1 rounded-full bg-[#F53F3F]",
|
||
}),
|
||
],
|
||
}),
|
||
],
|
||
}),
|
||
],
|
||
},
|
||
e.uuid,
|
||
),
|
||
)
|
||
: (0, n.jsx)(J, { isCanvasLight: t }),
|
||
})
|
||
);
|
||
},
|
||
],
|
||
553361,
|
||
),
|
||
e.s(
|
||
[
|
||
"default",
|
||
0,
|
||
function (e) {
|
||
return i.createElement(
|
||
"svg",
|
||
Z(
|
||
{
|
||
xmlns: "http://www.w3.org/2000/svg",
|
||
width: 6,
|
||
height: 4,
|
||
fill: "none",
|
||
viewBox: "0 0 6 4",
|
||
},
|
||
e,
|
||
),
|
||
r ||
|
||
(r = i.createElement("path", {
|
||
fill: "currentColor",
|
||
d: "M5.038.856a.375.375 0 0 1 .53.53L3.447 3.507a.375.375 0 0 1-.53 0L.794 1.387a.375.375 0 1 1 .53-.531l1.857 1.856z",
|
||
})),
|
||
);
|
||
},
|
||
],
|
||
255806,
|
||
);
|
||
};
|
||
|
||
export default moduleFactory;
|