@24city/web-console 0.3.10 → 0.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +17 -1
- package/dist/account/account-api.d.ts +14 -0
- package/dist/account/index.d.ts +1 -0
- package/dist/account/index.js +64 -61
- package/dist/account/upgrade-modal.d.ts +3 -1
- package/dist/account/use-track.d.ts +32 -0
- package/dist/chunks/{auth-provider-7FOj7Y84.js → auth-provider-3AIfwcdS.js} +1 -1
- package/dist/chunks/console-layout-CTVkNVdl.js +214 -0
- package/dist/chunks/{logout-signal-CLdquzzn.js → logout-signal-CsnJzWTz.js} +114 -111
- package/dist/chunks/{stale-build-DwUlkKYm.js → stale-build-CpZMSNSH.js} +2 -2
- package/dist/chunks/use-show-once-mq5WGTrX.js +785 -0
- package/dist/chunks/wallet-badge-3oCaCiNm.js +629 -0
- package/dist/index.js +185 -182
- package/dist/layout/index.js +1 -1
- package/dist/runtime/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/console-layout-B4OlW1IZ.js +0 -210
- package/dist/chunks/use-show-once-Bz1ojVqb.js +0 -768
- package/dist/chunks/wallet-badge-COpdEDYI.js +0 -575
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as x } from "react/jsx-runtime";
|
|
2
|
+
import { Card as A, Button as P, Typography as ne, Tag as we, Skeleton as H, Banner as De, RadioGroup as Be, Avatar as Ve, Progress as je, Space as pe, Modal as qe } from "@douyinfe/semi-ui";
|
|
3
|
+
import { IconExternalOpen as Se, IconGift as He, IconRefresh as Pe, IconLock as Ge, IconDesktop as Ke, IconUserGroup as Ce, IconShield as Qe, IconTick as re, IconMinus as Ye, IconCrown as Je, IconUser as _e, IconChevronRight as We, IconExit as Xe, IconClose as Ze } from "@douyinfe/semi-icons";
|
|
4
|
+
import { useParams as et, useNavigate as oe, useLocation as ce, Navigate as le } from "react-router";
|
|
5
|
+
import { S as tt, F as ae, e as q, c as nt } from "./page-YBG0dEN1.js";
|
|
6
|
+
import { u as Y, a as D, b as R } from "./context-CaVim6ZO.js";
|
|
7
|
+
import { q as M, m as at, u as de, C as $e, i as st, d as ge, r as fe } from "./logout-signal-CsnJzWTz.js";
|
|
8
|
+
import { J, K as ke, s as W, n as it, L as Le, o as se, T as Ie, R as Te, j as xe, t as he, g as G, p as Ee, C as ze, B as rt, m as ot, D as ct, y as lt, N as dt, O as ht, r as mt, i as ut, F as pt, u as Ae, H as _t, I as gt, Q as ft, z as Nt } from "./wallet-badge-3oCaCiNm.js";
|
|
9
|
+
import { L as me } from "./link-button-PqZcqU6s.js";
|
|
10
|
+
import { useState as bt, useRef as K, useEffect as X, useSyncExternalStore as yt, useCallback as Ne } from "react";
|
|
11
|
+
const vt = {
|
|
12
|
+
/** 统一资料(显示名称)、修改登录密码、登录设备与导出个人数据 */
|
|
13
|
+
settings: "/app/settings",
|
|
14
|
+
/** 当前空间在 24.city 各产品里的积分消耗 */
|
|
15
|
+
points: "/app/points",
|
|
16
|
+
/** 套餐和商品订单 */
|
|
17
|
+
orders: "/app/orders",
|
|
18
|
+
/** 加入的空间、团队成员与邀请 */
|
|
19
|
+
spaces: "/app/spaces"
|
|
20
|
+
}, Me = (t) => {
|
|
21
|
+
const n = (t == null ? void 0 : t.trim()) ?? "";
|
|
22
|
+
if (!n) return null;
|
|
23
|
+
try {
|
|
24
|
+
const a = new URL(n);
|
|
25
|
+
return a.protocol !== "https:" && a.protocol !== "http:" ? null : `${a.origin}${a.pathname.replace(/\/+$/, "")}`;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}, Q = (t, n) => {
|
|
30
|
+
const a = Me(t);
|
|
31
|
+
return a ? `${a}${vt[n]}` : null;
|
|
32
|
+
}, ie = (t, n) => {
|
|
33
|
+
const a = Me(t);
|
|
34
|
+
if (!a) return null;
|
|
35
|
+
const i = new URLSearchParams();
|
|
36
|
+
return n.productCode && i.set("product_code", n.productCode), i.set("return_url", n.returnUrl), n.spaceId && i.set("space_id", n.spaceId), n.spaceType && i.set("space_type", n.spaceType), n.priceCode && i.set("price_code", n.priceCode), `${a}/plans?${i.toString()}`;
|
|
37
|
+
}, wt = "_center_14d6l_7", St = "_aside_14d6l_21", Pt = "_identityCard_14d6l_27", Ct = "_identity_14d6l_27", $t = "_identityAvatar_14d6l_42", kt = "_identityText_14d6l_55", Lt = "_identityName_14d6l_64", It = "_identitySpace_14d6l_76", Tt = "_identitySpaceName_14d6l_91", xt = "_identityRole_14d6l_98", Et = "_identityStats_14d6l_108", zt = "_identityStat_14d6l_108", At = "_identityStatLabel_14d6l_129", Mt = "_identityStatValue_14d6l_135", Ft = "_nav_14d6l_147", Ut = "_navItem_14d6l_156", Rt = "_navIcon_14d6l_191", Ot = "_navLabel_14d6l_202", Dt = "_navArrow_14d6l_207", Bt = "_asideFoot_14d6l_223", Vt = "_logout_14d6l_228", jt = "_main_14d6l_249", qt = "_head_14d6l_262", Ht = "_title_14d6l_268", Gt = "_description_14d6l_277", Kt = "_card_14d6l_286", Qt = "_usage_14d6l_285", Yt = "_fields_14d6l_318", Jt = "_field_14d6l_318", Wt = "_fieldLabel_14d6l_331", Xt = "_fieldValue_14d6l_337", Zt = "_fieldText_14d6l_345", en = "_fieldMuted_14d6l_358", tn = "_fieldHint_14d6l_364", nn = "_mono_14d6l_370", an = "_inlineTag_14d6l_379", sn = "_settingList_14d6l_384", rn = "_settingRow_14d6l_389", on = "_settingIcon_14d6l_405", cn = "_settingText_14d6l_418", ln = "_settingTitle_14d6l_426", dn = "_settingDescription_14d6l_433", hn = "_settingAction_14d6l_439", mn = "_note_14d6l_443", un = "_centerLink_14d6l_463", pn = "_centerLinkIcon_14d6l_469", _n = "_heroCard_14d6l_477", gn = "_hero_14d6l_477", fn = "_heroMain_14d6l_501", Nn = "_heroEyebrow_14d6l_510", bn = "_heroEyebrowText_14d6l_525", yn = "_heroValue_14d6l_536", vn = "_heroMeta_14d6l_546", wn = "_heroActions_14d6l_560", Sn = "_heroFoot_14d6l_569", Pn = "_ownerOnly_14d6l_587", Cn = "_heroSkeleton_14d6l_709", s = {
|
|
38
|
+
center: wt,
|
|
39
|
+
aside: St,
|
|
40
|
+
identityCard: Pt,
|
|
41
|
+
identity: Ct,
|
|
42
|
+
identityAvatar: $t,
|
|
43
|
+
identityText: kt,
|
|
44
|
+
identityName: Lt,
|
|
45
|
+
identitySpace: It,
|
|
46
|
+
identitySpaceName: Tt,
|
|
47
|
+
identityRole: xt,
|
|
48
|
+
identityStats: Et,
|
|
49
|
+
identityStat: zt,
|
|
50
|
+
identityStatLabel: At,
|
|
51
|
+
identityStatValue: Mt,
|
|
52
|
+
nav: Ft,
|
|
53
|
+
navItem: Ut,
|
|
54
|
+
navIcon: Rt,
|
|
55
|
+
navLabel: Ot,
|
|
56
|
+
navArrow: Dt,
|
|
57
|
+
asideFoot: Bt,
|
|
58
|
+
logout: Vt,
|
|
59
|
+
main: jt,
|
|
60
|
+
head: qt,
|
|
61
|
+
title: Ht,
|
|
62
|
+
description: Gt,
|
|
63
|
+
card: Kt,
|
|
64
|
+
usage: Qt,
|
|
65
|
+
fields: Yt,
|
|
66
|
+
field: Jt,
|
|
67
|
+
fieldLabel: Wt,
|
|
68
|
+
fieldValue: Xt,
|
|
69
|
+
fieldText: Zt,
|
|
70
|
+
fieldMuted: en,
|
|
71
|
+
fieldHint: tn,
|
|
72
|
+
mono: nn,
|
|
73
|
+
inlineTag: an,
|
|
74
|
+
settingList: sn,
|
|
75
|
+
settingRow: rn,
|
|
76
|
+
settingIcon: on,
|
|
77
|
+
settingText: cn,
|
|
78
|
+
settingTitle: ln,
|
|
79
|
+
settingDescription: dn,
|
|
80
|
+
settingAction: hn,
|
|
81
|
+
note: mn,
|
|
82
|
+
centerLink: un,
|
|
83
|
+
centerLinkIcon: pn,
|
|
84
|
+
heroCard: _n,
|
|
85
|
+
hero: gn,
|
|
86
|
+
heroMain: fn,
|
|
87
|
+
heroEyebrow: Nn,
|
|
88
|
+
heroEyebrowText: bn,
|
|
89
|
+
heroValue: yn,
|
|
90
|
+
heroMeta: vn,
|
|
91
|
+
heroActions: wn,
|
|
92
|
+
heroFoot: Sn,
|
|
93
|
+
ownerOnly: Pn,
|
|
94
|
+
heroSkeleton: Cn
|
|
95
|
+
}, F = ({
|
|
96
|
+
href: t,
|
|
97
|
+
children: n,
|
|
98
|
+
type: a = "secondary",
|
|
99
|
+
size: i = "default",
|
|
100
|
+
label: r
|
|
101
|
+
}) => t ? /* @__PURE__ */ o(
|
|
102
|
+
me,
|
|
103
|
+
{
|
|
104
|
+
theme: a === "primary" ? "solid" : a === "text" ? "borderless" : "light",
|
|
105
|
+
type: a === "primary" ? "primary" : "tertiary",
|
|
106
|
+
size: i,
|
|
107
|
+
href: t,
|
|
108
|
+
target: "_blank",
|
|
109
|
+
"aria-label": r,
|
|
110
|
+
className: s.centerLink,
|
|
111
|
+
children: [
|
|
112
|
+
n,
|
|
113
|
+
/* @__PURE__ */ e(Se, { className: s.centerLinkIcon, "aria-hidden": "true" })
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
) : null, Z = ({
|
|
117
|
+
icon: t,
|
|
118
|
+
title: n,
|
|
119
|
+
description: a,
|
|
120
|
+
action: i
|
|
121
|
+
}) => /* @__PURE__ */ o("div", { className: s.settingRow, children: [
|
|
122
|
+
/* @__PURE__ */ e("span", { className: s.settingIcon, "aria-hidden": "true", children: t }),
|
|
123
|
+
/* @__PURE__ */ o("div", { className: s.settingText, children: [
|
|
124
|
+
/* @__PURE__ */ e("span", { className: s.settingTitle, children: n }),
|
|
125
|
+
/* @__PURE__ */ e("span", { className: s.settingDescription, children: a })
|
|
126
|
+
] }),
|
|
127
|
+
i ? /* @__PURE__ */ e("div", { className: s.settingAction, children: i }) : null
|
|
128
|
+
] }), $n = ({ data: t }) => {
|
|
129
|
+
var f;
|
|
130
|
+
const n = Y(), { PointsDetail: a } = D(), { session: i, activeSpace: r, activeSpaceId: c, globalUserId: l, wallet: d } = t, p = Q(i == null ? void 0 : i.accountCenterUrl, "points"), _ = r ? J(r) : "当前空间", h = (f = d.data) == null ? void 0 : f.availablePoints;
|
|
131
|
+
return /* @__PURE__ */ o(x, { children: [
|
|
132
|
+
/* @__PURE__ */ o(A, { className: s.heroCard, bordered: !1, bodyStyle: { padding: 0 }, children: [
|
|
133
|
+
/* @__PURE__ */ o("div", { className: s.hero, "data-tone": "primary", children: [
|
|
134
|
+
/* @__PURE__ */ o("div", { className: s.heroMain, children: [
|
|
135
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrow, title: _, children: [
|
|
136
|
+
/* @__PURE__ */ e(He, { "aria-hidden": "true" }),
|
|
137
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrowText, children: [
|
|
138
|
+
"可用积分 · ",
|
|
139
|
+
_
|
|
140
|
+
] })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, "aria-live": "polite", children: d.isPending ? "读取中" : d.isError || h === void 0 ? "暂不可用" : M(h) }),
|
|
143
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "积分属于当前空间,24.city 各产品共用。" })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ o("div", { className: s.heroActions, children: [
|
|
146
|
+
/* @__PURE__ */ e(P, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ e(Pe, { "aria-hidden": "true" }), disabled: d.isFetching, onClick: () => void d.refetch(), children: "刷新" }),
|
|
147
|
+
/* @__PURE__ */ e(F, { type: "primary", href: p, label: "全部积分消耗(在统一账号中心打开)", children: "全部积分消耗" })
|
|
148
|
+
] })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ e("div", { className: s.heroFoot, children: /* @__PURE__ */ e("span", { children: a ? `下面是你本人在 ${n.shortName} 里的扣费明细;当前空间在 24.city 各产品里的全部积分消耗,请到统一账号中心查看。` : "当前空间在 24.city 各产品里的全部积分消耗,请到统一账号中心查看。" }) })
|
|
151
|
+
] }),
|
|
152
|
+
a ? /* @__PURE__ */ e("div", { className: s.usage, children: /* @__PURE__ */ e(a, { activeSpaceId: c, globalUserId: l }) }) : null
|
|
153
|
+
] });
|
|
154
|
+
}, j = ({ label: t, children: n, hint: a }) => /* @__PURE__ */ o("div", { className: s.field, children: [
|
|
155
|
+
/* @__PURE__ */ e("span", { className: s.fieldLabel, children: t }),
|
|
156
|
+
/* @__PURE__ */ o("div", { className: s.fieldValue, children: [
|
|
157
|
+
n,
|
|
158
|
+
a ? /* @__PURE__ */ e("span", { className: s.fieldHint, children: a }) : null
|
|
159
|
+
] })
|
|
160
|
+
] }), kn = ({ data: t }) => {
|
|
161
|
+
var f;
|
|
162
|
+
const n = Y(), { session: a, activeSpace: i, profile: r, globalUserId: c } = t, l = a == null ? void 0 : a.accountCenterUrl, d = ((f = r.data) == null ? void 0 : f.nickName) ?? "", p = ke(i == null ? void 0 : i.role), _ = Q(l, "settings"), h = Q(l, "spaces");
|
|
163
|
+
return /* @__PURE__ */ o(x, { children: [
|
|
164
|
+
/* @__PURE__ */ e(A, { title: "账号信息", className: s.card, bordered: !1, headerLine: !1, children: /* @__PURE__ */ o("div", { className: s.fields, children: [
|
|
165
|
+
/* @__PURE__ */ e(j, { label: "昵称", hint: `首次登录 ${n.shortName} 时从统一账号带来`, children: /* @__PURE__ */ e("span", { className: s.fieldText, children: d || (r.isPending ? "读取中" : "未设置") }) }),
|
|
166
|
+
/* @__PURE__ */ e(j, { label: "统一账号 ID", hint: "联系客服时可以提供", children: /* @__PURE__ */ e(ne.Text, { copyable: { copyTip: "复制", successTip: "已复制" }, className: s.mono, children: c }) }),
|
|
167
|
+
/* @__PURE__ */ e(j, { label: "当前空间", children: /* @__PURE__ */ o("span", { className: s.fieldText, children: [
|
|
168
|
+
i ? J(i) : "暂不可用",
|
|
169
|
+
i && W(i) ? /* @__PURE__ */ e(we, { size: "small", color: "blue", className: s.inlineTag, children: "团队" }) : null,
|
|
170
|
+
p ? /* @__PURE__ */ o("span", { className: s.fieldMuted, children: [
|
|
171
|
+
"· 我是",
|
|
172
|
+
p
|
|
173
|
+
] }) : null
|
|
174
|
+
] }) }),
|
|
175
|
+
/* @__PURE__ */ e(j, { label: "本次登录有效至", hint: "到期后重新登录即可", children: /* @__PURE__ */ e("span", { className: s.fieldText, children: a ? at(a.absoluteExpiresAt) : "暂无" }) })
|
|
176
|
+
] }) }),
|
|
177
|
+
/* @__PURE__ */ o(A, { title: "登录与安全", className: s.card, bordered: !1, headerLine: !1, children: [
|
|
178
|
+
/* @__PURE__ */ o("div", { className: s.settingList, children: [
|
|
179
|
+
/* @__PURE__ */ e(
|
|
180
|
+
Z,
|
|
181
|
+
{
|
|
182
|
+
icon: /* @__PURE__ */ e(Ge, {}),
|
|
183
|
+
title: "登录密码",
|
|
184
|
+
description: "验证已绑定的手机号后修改。改完后,24.city 所有产品都用新密码登录。",
|
|
185
|
+
action: /* @__PURE__ */ e(F, { href: _, label: "修改密码(在统一账号中心打开)", children: "修改密码" })
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ e(
|
|
189
|
+
Z,
|
|
190
|
+
{
|
|
191
|
+
icon: /* @__PURE__ */ e(Ke, {}),
|
|
192
|
+
title: "登录设备与个人数据",
|
|
193
|
+
description: "查看登录过的设备,导出你的个人数据。",
|
|
194
|
+
action: /* @__PURE__ */ e(F, { href: _, label: "查看登录设备(在统一账号中心打开)", children: "前往查看" })
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ e(
|
|
198
|
+
Z,
|
|
199
|
+
{
|
|
200
|
+
icon: /* @__PURE__ */ e(Ce, {}),
|
|
201
|
+
title: "空间与成员",
|
|
202
|
+
description: "查看你加入的空间;团队所有者和管理员在这里邀请、管理成员。",
|
|
203
|
+
action: /* @__PURE__ */ e(F, { href: h, label: "管理空间与成员(在统一账号中心打开)", children: "前往管理" })
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ o("div", { className: s.note, children: [
|
|
208
|
+
/* @__PURE__ */ e(Qe, { "aria-hidden": "true" }),
|
|
209
|
+
/* @__PURE__ */ e("span", { children: _ ? `${n.shortName} 使用 24.city 统一账号登录,不保存你的密码和验证码。以上设置在统一账号中心修改,所有产品同步生效。` : "统一账号中心的地址暂时不可用,请稍后刷新页面再试。" })
|
|
210
|
+
] })
|
|
211
|
+
] })
|
|
212
|
+
] });
|
|
213
|
+
}, ee = {
|
|
214
|
+
free: { tone: "basic", tagline: "先免费体验", benefits: [] },
|
|
215
|
+
standard: { tone: "standard", badge: "推荐", tagline: "个人用户的常用之选", benefits: ["按积分扣费,用多少扣多少"] },
|
|
216
|
+
pro: { tone: "pro", tagline: "高频使用,积分更充足", benefits: ["每月积分更多,适合批量使用"] }
|
|
217
|
+
}, Ln = {
|
|
218
|
+
tone: "team",
|
|
219
|
+
tagline: "团队一起用,套餐和积分共用",
|
|
220
|
+
benefits: ["成员共用套餐和积分"]
|
|
221
|
+
}, In = (t, n) => t.spaceType === "team" ? n.teamPlanCopy ?? Ln : t.isDefault || t.tier <= 0 ? ee.free : t.tier === 1 ? ee.standard : ee.pro, Fe = (t, n = {}) => {
|
|
222
|
+
var a;
|
|
223
|
+
return ((a = n.planCopy) == null ? void 0 : a[t.code]) ?? In(t, n);
|
|
224
|
+
}, Ue = (t, n = [], a = {}) => {
|
|
225
|
+
const i = [], r = (c, l = !0) => {
|
|
226
|
+
i.some((d) => d.text === c) || i.push({ text: c, included: l });
|
|
227
|
+
};
|
|
228
|
+
t.monthlyPoints > 0 && r(t.isDefault ? `每月赠送 ${M(t.monthlyPoints)} 积分` : `每月 ${M(t.monthlyPoints)} 积分`), t.spaceType === "team" && t.includedSeats > 0 && r(`含 ${M(t.includedSeats)} 个成员席位`);
|
|
229
|
+
for (const c of it(t, n, a)) r(c.text, c.included);
|
|
230
|
+
for (const c of Fe(t, a).benefits) r(c);
|
|
231
|
+
return i;
|
|
232
|
+
}, Tn = (t, n) => t.prices.filter((r) => r.billingPeriod === n && r.amountCents > 0).reduce((r, c) => !r || c.amountCents < r.amountCents ? c : r, null) ?? Le(t), xn = (t, n) => {
|
|
233
|
+
if (n.billingPeriod !== "year") return "";
|
|
234
|
+
const a = se({ amountCents: Math.round(n.amountCents / 12), currency: n.currency }), i = t.prices.find((c) => c.billingPeriod === "month" && c.currency === n.currency && c.amountCents > 0), r = i ? i.amountCents * 12 - n.amountCents : 0;
|
|
235
|
+
return r > 0 ? `约 ${a}/月 · 比月付省 ${se({ amountCents: r, currency: n.currency })}` : `约 ${a}/月`;
|
|
236
|
+
}, En = "_subtitle_m4zgm_7", zn = "_grid_m4zgm_16", An = "_skeleton_m4zgm_22", Mn = "_card_m4zgm_30", Fn = "_section_m4zgm_62", Un = "_badge_m4zgm_90", Rn = "_top_m4zgm_109", On = "_art_m4zgm_139", Dn = "_name_m4zgm_160", Bn = "_tagline_m4zgm_178", Vn = "_price_m4zgm_195", jn = "_amount_m4zgm_202", qn = "_period_m4zgm_218", Hn = "_priceNote_m4zgm_227", Gn = "_body_m4zgm_244", Kn = "_benefits_m4zgm_252", Qn = "_benefit_m4zgm_252", Yn = "_check_m4zgm_268", Jn = "_action_m4zgm_304", Wn = "_cta_m4zgm_304", Xn = "_ctaCurrent_m4zgm_345", Zn = "_ctaNote_m4zgm_354", u = {
|
|
237
|
+
subtitle: En,
|
|
238
|
+
grid: zn,
|
|
239
|
+
skeleton: An,
|
|
240
|
+
card: Mn,
|
|
241
|
+
section: Fn,
|
|
242
|
+
badge: Un,
|
|
243
|
+
top: Rn,
|
|
244
|
+
art: On,
|
|
245
|
+
name: Dn,
|
|
246
|
+
tagline: Bn,
|
|
247
|
+
price: Vn,
|
|
248
|
+
amount: jn,
|
|
249
|
+
period: qn,
|
|
250
|
+
priceNote: Hn,
|
|
251
|
+
body: Gn,
|
|
252
|
+
benefits: Kn,
|
|
253
|
+
benefit: Qn,
|
|
254
|
+
check: Yn,
|
|
255
|
+
action: Jn,
|
|
256
|
+
cta: Wn,
|
|
257
|
+
ctaCurrent: Xn,
|
|
258
|
+
ctaNote: Zn
|
|
259
|
+
}, ea = { month: "/月", year: "/年", one_time: "" }, ta = [
|
|
260
|
+
{ label: "按月付", value: "month" },
|
|
261
|
+
{ label: "按年付", value: "year" }
|
|
262
|
+
], be = (t, n) => t.some((a) => a.prices.some((i) => i.billingPeriod === n && i.amountCents > 0)), na = ({
|
|
263
|
+
plan: t,
|
|
264
|
+
price: n,
|
|
265
|
+
catalog: a,
|
|
266
|
+
current: i,
|
|
267
|
+
focus: r,
|
|
268
|
+
action: c,
|
|
269
|
+
custom: l
|
|
270
|
+
}) => {
|
|
271
|
+
const d = Fe(t, l), p = n ? xn(t, n) : "长期有效", _ = d.badge ?? (r ? "推荐升级" : void 0);
|
|
272
|
+
return /* @__PURE__ */ o(
|
|
273
|
+
"div",
|
|
274
|
+
{
|
|
275
|
+
className: u.card,
|
|
276
|
+
"data-tone": d.tone,
|
|
277
|
+
"data-current": i ? "true" : "false",
|
|
278
|
+
"data-focus": r && !i ? "true" : "false",
|
|
279
|
+
role: "group",
|
|
280
|
+
"aria-label": t.name,
|
|
281
|
+
children: [
|
|
282
|
+
i ? /* @__PURE__ */ e("span", { className: u.badge, "data-kind": "current", children: "当前套餐" }) : _ ? /* @__PURE__ */ e("span", { className: u.badge, children: _ }) : null,
|
|
283
|
+
/* @__PURE__ */ o("div", { className: d.tone === "pro" ? `${u.top} semi-always-light` : u.top, children: [
|
|
284
|
+
/* @__PURE__ */ e("span", { className: u.art, "aria-hidden": "true" }),
|
|
285
|
+
/* @__PURE__ */ e("span", { className: u.name, children: t.name }),
|
|
286
|
+
/* @__PURE__ */ e("span", { className: u.tagline, children: d.tagline }),
|
|
287
|
+
/* @__PURE__ */ e("span", { className: u.price, children: n ? /* @__PURE__ */ o(x, { children: [
|
|
288
|
+
/* @__PURE__ */ e("span", { className: u.amount, children: se(n) }),
|
|
289
|
+
/* @__PURE__ */ e("span", { className: u.period, children: ea[n.billingPeriod] })
|
|
290
|
+
] }) : /* @__PURE__ */ e("span", { className: u.amount, children: "免费" }) }),
|
|
291
|
+
/* @__PURE__ */ e("span", { className: u.priceNote, children: p || " " })
|
|
292
|
+
] }),
|
|
293
|
+
/* @__PURE__ */ o("div", { className: u.body, children: [
|
|
294
|
+
/* @__PURE__ */ e("div", { className: u.benefits, role: "list", "aria-label": `${t.name}权益`, children: Ue(t, a, l).map((h) => /* @__PURE__ */ o("div", { className: u.benefit, "data-included": h.included ? "true" : "false", role: "listitem", children: [
|
|
295
|
+
/* @__PURE__ */ e("span", { className: u.check, "aria-hidden": "true", children: h.included ? /* @__PURE__ */ e(re, {}) : /* @__PURE__ */ e(Ye, {}) }),
|
|
296
|
+
/* @__PURE__ */ e("span", { children: h.text })
|
|
297
|
+
] }, h.text)) }),
|
|
298
|
+
/* @__PURE__ */ e("div", { className: u.action, children: c })
|
|
299
|
+
] })
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
}, aa = ({ data: t, focusPlan: n }) => {
|
|
304
|
+
const { config: a } = R(), i = Ie(), r = D(), { session: c, activeSpace: l, activeSpaceId: d, subscription: p, wallet: _, allowed: h } = t, f = Te(h), [y, k] = bt("month"), C = l ? W(l) : !1, v = xe(l), g = p.isError && he(p.error), w = p.data ?? null, I = (f.data ?? []).filter((m) => m.spaceType === (C ? "team" : "personal")), T = `${window.location.origin}${G(a.routes.app, "subscription")}`, S = (m) => {
|
|
305
|
+
var L;
|
|
306
|
+
return ie(c == null ? void 0 : c.accountCenterUrl, { productCode: (L = _.data) == null ? void 0 : L.productCode, returnUrl: T, spaceId: C ? d : void 0, priceCode: m });
|
|
307
|
+
}, E = be(I, "month") && be(I, "year"), z = K(null), b = K(!1), B = !!(n && I.some((m) => m.code === n));
|
|
308
|
+
X(() => {
|
|
309
|
+
var m, L;
|
|
310
|
+
!B || b.current || (b.current = !0, (L = (m = z.current) == null ? void 0 : m.scrollIntoView) == null || L.call(m, { behavior: "smooth", block: "start" }));
|
|
311
|
+
}, [B]);
|
|
312
|
+
const Re = (m, L, O) => {
|
|
313
|
+
if (m.isDefault || !L)
|
|
314
|
+
return O ? /* @__PURE__ */ e(P, { theme: "light", type: "tertiary", block: !0, disabled: !0, className: u.ctaCurrent, children: "正在使用" }) : /* @__PURE__ */ e("span", { className: u.ctaNote, children: "会员到期后回到免费版" });
|
|
315
|
+
if (!v) return /* @__PURE__ */ e("span", { className: u.ctaNote, children: g ? "请团队所有者续费" : "请团队所有者购买" });
|
|
316
|
+
const V = O ? "续费" : g ? `续费${m.name}` : !w || w.isDefault ? "立即开通" : m.tier > w.tier ? `升级到${m.name}` : `选择${m.name}`, ue = S(L.code);
|
|
317
|
+
if (!ue) return null;
|
|
318
|
+
const Oe = V.includes(m.name) ? V : `${V}${m.name}`;
|
|
319
|
+
return /* @__PURE__ */ e(
|
|
320
|
+
me,
|
|
321
|
+
{
|
|
322
|
+
block: !0,
|
|
323
|
+
className: u.cta,
|
|
324
|
+
href: ue,
|
|
325
|
+
target: "_blank",
|
|
326
|
+
"aria-label": `${Oe}(在统一账号中心打开)`,
|
|
327
|
+
onClick: () => i("plan.selected", { target: L.code, props: { plan: m.code } }),
|
|
328
|
+
children: V
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
};
|
|
332
|
+
return f.isPending ? /* @__PURE__ */ e(A, { title: "会员套餐", className: s.card, bordered: !1, headerLine: !1, children: /* @__PURE__ */ e("div", { className: u.grid, children: [0, 1, 2].map((m) => /* @__PURE__ */ e("div", { className: u.skeleton, children: /* @__PURE__ */ e(H, { loading: !0, active: !0, placeholder: /* @__PURE__ */ e(H.Paragraph, { rows: 4 }) }) }, m)) }) }) : f.isError ? /* @__PURE__ */ e(A, { title: "会员套餐", className: s.card, bordered: !1, headerLine: !1, children: /* @__PURE__ */ e(De, { type: "info", fullMode: !1, closeIcon: null, description: "暂时读不到套餐价格,可以在统一账号中心查看全部套餐。", children: /* @__PURE__ */ e(F, { size: "small", href: S(), label: "查看全部套餐(在统一账号中心打开)", children: "查看全部套餐" }) }) }) : I.length ? /* @__PURE__ */ e("div", { ref: z, children: /* @__PURE__ */ o(
|
|
333
|
+
A,
|
|
334
|
+
{
|
|
335
|
+
title: "会员套餐",
|
|
336
|
+
className: `${s.card} ${u.section}`,
|
|
337
|
+
bordered: !1,
|
|
338
|
+
headerLine: !1,
|
|
339
|
+
headerExtraContent: E ? /* @__PURE__ */ e(
|
|
340
|
+
Be,
|
|
341
|
+
{
|
|
342
|
+
type: "button",
|
|
343
|
+
buttonSize: "small",
|
|
344
|
+
options: ta,
|
|
345
|
+
value: y,
|
|
346
|
+
onChange: (m) => k(m.target.value),
|
|
347
|
+
"aria-label": "付费周期"
|
|
348
|
+
}
|
|
349
|
+
) : null,
|
|
350
|
+
children: [
|
|
351
|
+
/* @__PURE__ */ e("span", { className: u.subtitle, children: "价格取自 24.city 统一账号中心,点按钮去统一账号中心付款,付款后回到这里。" }),
|
|
352
|
+
/* @__PURE__ */ e("div", { className: u.grid, children: I.map((m) => {
|
|
353
|
+
const L = Tn(m, y), O = !!(w && w.planCode === m.code);
|
|
354
|
+
return /* @__PURE__ */ e(
|
|
355
|
+
na,
|
|
356
|
+
{
|
|
357
|
+
plan: m,
|
|
358
|
+
price: L,
|
|
359
|
+
catalog: f.data ?? [],
|
|
360
|
+
current: O,
|
|
361
|
+
focus: m.code === n,
|
|
362
|
+
action: Re(m, L, O),
|
|
363
|
+
custom: r
|
|
364
|
+
},
|
|
365
|
+
m.code
|
|
366
|
+
);
|
|
367
|
+
}) })
|
|
368
|
+
]
|
|
369
|
+
}
|
|
370
|
+
) }) : null;
|
|
371
|
+
}, sa = "_team_13j8p_7", ia = "_art_13j8p_22", ra = "_text_13j8p_30", oa = "_eyebrow_13j8p_39", ca = "_title_13j8p_49", la = "_description_13j8p_57", da = "_highlights_13j8p_63", ha = "_highlight_13j8p_63", ma = "_highlightIcon_13j8p_83", ua = "_action_13j8p_88", pa = "_cta_13j8p_96", _a = "_ctaIcon_13j8p_116", ga = "_price_13j8p_121", $ = {
|
|
372
|
+
team: sa,
|
|
373
|
+
art: ia,
|
|
374
|
+
text: ra,
|
|
375
|
+
eyebrow: oa,
|
|
376
|
+
title: ca,
|
|
377
|
+
description: la,
|
|
378
|
+
highlights: da,
|
|
379
|
+
highlight: ha,
|
|
380
|
+
highlightIcon: ma,
|
|
381
|
+
action: ua,
|
|
382
|
+
cta: pa,
|
|
383
|
+
ctaIcon: _a,
|
|
384
|
+
price: ga
|
|
385
|
+
}, fa = ({ href: t, plan: n }) => {
|
|
386
|
+
const a = Y(), { teamPromoHighlights: i = [] } = D(), r = n ? Le(n) : null, c = [
|
|
387
|
+
n && n.includedSeats > 0 ? `含 ${M(n.includedSeats)} 个成员席位` : "",
|
|
388
|
+
n && n.monthlyPoints > 0 ? `每月 ${M(n.monthlyPoints)} 积分` : "",
|
|
389
|
+
"套餐和积分团队共用",
|
|
390
|
+
...i
|
|
391
|
+
].filter(Boolean);
|
|
392
|
+
return /* @__PURE__ */ o("section", { className: $.team, "aria-label": "开通团队版", children: [
|
|
393
|
+
/* @__PURE__ */ e("span", { className: $.art, "aria-hidden": "true" }),
|
|
394
|
+
/* @__PURE__ */ o("div", { className: $.text, children: [
|
|
395
|
+
/* @__PURE__ */ e("span", { className: $.eyebrow, children: "团队版" }),
|
|
396
|
+
/* @__PURE__ */ o("span", { className: $.title, children: [
|
|
397
|
+
"和同事一起用 ",
|
|
398
|
+
a.shortName
|
|
399
|
+
] }),
|
|
400
|
+
/* @__PURE__ */ e("span", { className: $.description, children: "开通团队版会创建一个团队空间,你是所有者;套餐、席位和积分归团队共用。" }),
|
|
401
|
+
/* @__PURE__ */ e("div", { className: $.highlights, role: "list", "aria-label": "团队版要点", children: c.map((l) => /* @__PURE__ */ o("span", { className: $.highlight, role: "listitem", children: [
|
|
402
|
+
/* @__PURE__ */ e(re, { className: $.highlightIcon, "aria-hidden": "true" }),
|
|
403
|
+
l
|
|
404
|
+
] }, l)) })
|
|
405
|
+
] }),
|
|
406
|
+
t ? /* @__PURE__ */ o("div", { className: $.action, children: [
|
|
407
|
+
/* @__PURE__ */ o(me, { className: $.cta, href: t, target: "_blank", "aria-label": "开通团队版(在统一账号中心打开)", children: [
|
|
408
|
+
"开通团队版",
|
|
409
|
+
/* @__PURE__ */ e(Se, { className: $.ctaIcon, "aria-hidden": "true" })
|
|
410
|
+
] }),
|
|
411
|
+
r ? /* @__PURE__ */ o("span", { className: $.price, children: [
|
|
412
|
+
Ee(r),
|
|
413
|
+
"起"
|
|
414
|
+
] }) : null
|
|
415
|
+
] }) : null
|
|
416
|
+
] });
|
|
417
|
+
}, Na = ({ data: t, focusPlan: n }) => {
|
|
418
|
+
var z;
|
|
419
|
+
const { config: a } = R(), { session: i, activeSpace: r, activeSpaceId: c, wallet: l, subscription: d, allowed: p } = t, _ = Te(p), h = i == null ? void 0 : i.accountCenterUrl, f = r ? W(r) : !1, y = xe(r), k = r ? J(r) : "当前空间", C = `${window.location.origin}${G(a.routes.app, "subscription")}`, v = (z = l.data) == null ? void 0 : z.productCode, g = ie(h, { productCode: v, returnUrl: C, spaceId: f ? c : void 0 }), w = ie(h, { productCode: v, returnUrl: C, spaceType: "team" }), I = Q(h, "orders"), T = d.isError && he(d.error), S = d.data, E = (b) => y ? /* @__PURE__ */ e(F, { type: "primary", href: g, label: `${b}(在统一账号中心打开)`, children: b }) : /* @__PURE__ */ e("span", { className: s.ownerOnly, children: T ? "请团队所有者续费" : "请团队所有者购买" });
|
|
420
|
+
return /* @__PURE__ */ o(x, { children: [
|
|
421
|
+
/* @__PURE__ */ o(A, { className: s.heroCard, bordered: !1, bodyStyle: { padding: 0 }, children: [
|
|
422
|
+
/* @__PURE__ */ o("div", { className: s.hero, "data-tone": T ? "warning" : "primary", children: [
|
|
423
|
+
/* @__PURE__ */ o("div", { className: s.heroMain, children: [
|
|
424
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrow, title: k, children: [
|
|
425
|
+
/* @__PURE__ */ e(Je, { "aria-hidden": "true" }),
|
|
426
|
+
/* @__PURE__ */ o("span", { className: s.heroEyebrowText, children: [
|
|
427
|
+
"当前套餐 · ",
|
|
428
|
+
k
|
|
429
|
+
] })
|
|
430
|
+
] }),
|
|
431
|
+
d.isPending ? /* @__PURE__ */ e(H, { loading: !0, active: !0, placeholder: /* @__PURE__ */ e(H.Paragraph, { rows: 2, className: s.heroSkeleton }) }) : T ? /* @__PURE__ */ o(x, { children: [
|
|
432
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: "团队版已到期" }),
|
|
433
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "该团队的团队版已到期,请在统一账号中心续费后再使用,续费后成员继续共用套餐和积分。" })
|
|
434
|
+
] }) : d.isError ? /* @__PURE__ */ o(x, { children: [
|
|
435
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: "暂不可用" }),
|
|
436
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "暂时读不到当前套餐,请稍后重试。" })
|
|
437
|
+
] }) : S ? /* @__PURE__ */ o(x, { children: [
|
|
438
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: ze(S) }),
|
|
439
|
+
/* @__PURE__ */ o("span", { className: s.heroMeta, children: [
|
|
440
|
+
/* @__PURE__ */ e(we, { size: "small", color: "green", children: "生效中" }),
|
|
441
|
+
rt(S)
|
|
442
|
+
] })
|
|
443
|
+
] }) : /* @__PURE__ */ o(x, { children: [
|
|
444
|
+
/* @__PURE__ */ e("span", { className: s.heroValue, children: "未开通" }),
|
|
445
|
+
/* @__PURE__ */ e("span", { className: s.heroMeta, children: "当前空间还没有生效的套餐。" })
|
|
446
|
+
] })
|
|
447
|
+
] }),
|
|
448
|
+
/* @__PURE__ */ o("div", { className: s.heroActions, children: [
|
|
449
|
+
d.isError && !T ? /* @__PURE__ */ e(P, { theme: "light", type: "tertiary", icon: /* @__PURE__ */ e(Pe, { "aria-hidden": "true" }), onClick: () => void d.refetch(), children: "重试" }) : null,
|
|
450
|
+
d.isPending ? null : T ? E("续费团队版") : S && !S.isDefault ? E("续费或升级") : E(S ? "升级套餐" : "选择套餐")
|
|
451
|
+
] })
|
|
452
|
+
] }),
|
|
453
|
+
/* @__PURE__ */ o("div", { className: s.heroFoot, children: [
|
|
454
|
+
/* @__PURE__ */ e("span", { children: "套餐属于当前空间,对 24.city 所有产品同时生效;购买、续费和发票在统一账号中心办理。" }),
|
|
455
|
+
/* @__PURE__ */ e(F, { type: "text", size: "small", href: I, label: "订单记录(在统一账号中心打开)", children: "订单记录" })
|
|
456
|
+
] })
|
|
457
|
+
] }),
|
|
458
|
+
/* @__PURE__ */ e(aa, { data: t, focusPlan: n }),
|
|
459
|
+
r && !f ? /* @__PURE__ */ e(fa, { href: w, plan: ot(_.data) }) : null
|
|
460
|
+
] });
|
|
461
|
+
}, ba = ({ subscription: t }) => t.isPending ? "读取中" : t.isError ? he(t.error) ? "团队版已到期" : "暂不可用" : t.data ? ze(t.data) : "未开通", ya = ({ wallet: t }) => t.isPending ? "读取中" : t.data ? M(t.data.availablePoints) : "暂不可用", os = () => {
|
|
462
|
+
var z;
|
|
463
|
+
const { section: t = "" } = et(), { config: n } = R(), a = Y(), i = D(), { PointsDetail: r } = i, c = ct(i), l = c.find((b) => b.key === t), d = oe(), p = lt(ce().state), _ = dt(), { confirmLogout: h, pending: f } = ht(), y = n.routes.app;
|
|
464
|
+
if (!mt(t) && !l) return /* @__PURE__ */ e(le, { replace: !0, to: G(y, "profile") });
|
|
465
|
+
const k = {
|
|
466
|
+
profile: "你的统一账号与当前空间。密码、登录设备和团队成员在 24.city 统一账号中心管理,所有产品同步生效。",
|
|
467
|
+
subscription: "当前空间的套餐与权益,以统一账号中心为准;购买、续费和升级都在统一账号中心完成。",
|
|
468
|
+
points: r ? `当前空间的可用积分,以及你在 ${a.shortName} 里的扣费明细。` : "当前空间的可用积分,由统一账号中心记账。"
|
|
469
|
+
}, C = l ? l.description : k[t], v = ut(y, c).items, g = v.find((b) => b.to === G(y, t)), { activeSpace: w, profile: I, allowed: T } = _, S = ((z = I.data) == null ? void 0 : z.nickName) ?? "", E = ke(w == null ? void 0 : w.role);
|
|
470
|
+
return /* @__PURE__ */ o("div", { className: s.center, children: [
|
|
471
|
+
/* @__PURE__ */ e("aside", { className: s.aside, "aria-label": "个人中心", children: /* @__PURE__ */ o(A, { className: s.identityCard, bordered: !1, bodyStyle: { padding: 0 }, children: [
|
|
472
|
+
/* @__PURE__ */ o("div", { className: s.identity, children: [
|
|
473
|
+
/* @__PURE__ */ e(Ve, { size: "medium", shape: "circle", className: s.identityAvatar, children: S ? Array.from(S)[0] : /* @__PURE__ */ e(_e, { "aria-hidden": "true" }) }),
|
|
474
|
+
/* @__PURE__ */ o("div", { className: s.identityText, children: [
|
|
475
|
+
/* @__PURE__ */ e("span", { className: s.identityName, title: S || void 0, children: S || (I.isPending ? "" : pt) }),
|
|
476
|
+
w ? /* @__PURE__ */ o("span", { className: s.identitySpace, children: [
|
|
477
|
+
W(w) ? /* @__PURE__ */ e(Ce, { "aria-hidden": "true" }) : /* @__PURE__ */ e(_e, { "aria-hidden": "true" }),
|
|
478
|
+
/* @__PURE__ */ e("span", { className: s.identitySpaceName, children: J(w) }),
|
|
479
|
+
E ? /* @__PURE__ */ e("span", { className: s.identityRole, children: E }) : null
|
|
480
|
+
] }) : null
|
|
481
|
+
] })
|
|
482
|
+
] }),
|
|
483
|
+
T ? /* @__PURE__ */ o("div", { className: s.identityStats, children: [
|
|
484
|
+
/* @__PURE__ */ o("div", { className: s.identityStat, children: [
|
|
485
|
+
/* @__PURE__ */ e("span", { className: s.identityStatLabel, children: "当前套餐" }),
|
|
486
|
+
/* @__PURE__ */ e("span", { className: s.identityStatValue, children: ba(_) })
|
|
487
|
+
] }),
|
|
488
|
+
/* @__PURE__ */ o("div", { className: s.identityStat, children: [
|
|
489
|
+
/* @__PURE__ */ e("span", { className: s.identityStatLabel, children: "可用积分" }),
|
|
490
|
+
/* @__PURE__ */ e("span", { className: s.identityStatValue, children: ya(_) })
|
|
491
|
+
] })
|
|
492
|
+
] }) : null,
|
|
493
|
+
/* @__PURE__ */ e("nav", { className: s.nav, "aria-label": "个人中心分区", children: v.map((b) => {
|
|
494
|
+
const B = b === g;
|
|
495
|
+
return /* @__PURE__ */ o(
|
|
496
|
+
P,
|
|
497
|
+
{
|
|
498
|
+
theme: "borderless",
|
|
499
|
+
type: "tertiary",
|
|
500
|
+
className: s.navItem,
|
|
501
|
+
"aria-current": B ? "page" : void 0,
|
|
502
|
+
onClick: () => d(b.to),
|
|
503
|
+
children: [
|
|
504
|
+
b.icon ? /* @__PURE__ */ e("span", { className: s.navIcon, "aria-hidden": "true", children: /* @__PURE__ */ e(b.icon, {}) }) : null,
|
|
505
|
+
/* @__PURE__ */ e("span", { className: s.navLabel, children: b.label }),
|
|
506
|
+
/* @__PURE__ */ e(We, { className: s.navArrow, "aria-hidden": "true" })
|
|
507
|
+
]
|
|
508
|
+
},
|
|
509
|
+
b.key
|
|
510
|
+
);
|
|
511
|
+
}) }),
|
|
512
|
+
/* @__PURE__ */ e("div", { className: s.asideFoot, children: /* @__PURE__ */ e(P, { theme: "borderless", type: "tertiary", className: s.logout, icon: /* @__PURE__ */ e(Xe, { "aria-hidden": "true" }), disabled: f, onClick: h, children: "退出登录" }) })
|
|
513
|
+
] }) }),
|
|
514
|
+
/* @__PURE__ */ o("div", { className: s.main, children: [
|
|
515
|
+
/* @__PURE__ */ o("header", { className: s.head, children: [
|
|
516
|
+
/* @__PURE__ */ e(ne.Title, { heading: 1, className: s.title, children: g == null ? void 0 : g.label }),
|
|
517
|
+
/* @__PURE__ */ e(ne.Paragraph, { className: s.description, children: C })
|
|
518
|
+
] }),
|
|
519
|
+
T ? l ? /* @__PURE__ */ e(l.Component, { data: _ }) : t === "profile" ? /* @__PURE__ */ e(kn, { data: _ }) : t === "subscription" ? /* @__PURE__ */ e(Na, { data: _, focusPlan: p }) : /* @__PURE__ */ e($n, { data: _ }) : /* @__PURE__ */ e(tt, {})
|
|
520
|
+
] })
|
|
521
|
+
] });
|
|
522
|
+
}, va = "_meter_o7x3q_7", wa = "_head_o7x3q_16", Sa = "_label_o7x3q_24", Pa = "_value_o7x3q_33", Ca = "_bar_o7x3q_53", $a = "_note_o7x3q_57", U = {
|
|
523
|
+
meter: va,
|
|
524
|
+
head: wa,
|
|
525
|
+
label: Sa,
|
|
526
|
+
value: Pa,
|
|
527
|
+
bar: Ca,
|
|
528
|
+
note: $a
|
|
529
|
+
}, te = (t) => t.toLocaleString("zh-CN", { maximumFractionDigits: 0 }), ka = ({ unit: t, used: n, total: a, status: i }) => i === "loading" ? "…" : i === "error" || n === void 0 || a === void 0 ? "暂不可用" : Ae(a) ? `已用 ${te(n)} ${t} · 不限` : `已用 ${te(n)}/${te(a)} ${t}`, La = ({ used: t, total: n, status: a }) => a !== void 0 || t === void 0 || n === void 0 || n <= 0 || Ae(n) ? null : Math.min(1, Math.max(0, t / n)), cs = (t) => {
|
|
530
|
+
const { label: n, note: a, exhausted: i, status: r } = t, c = ka(t), l = La(t), d = r === void 0 && (i ?? (l !== null && l >= 1)), p = d ? "warning" : c === "暂不可用" ? "muted" : void 0;
|
|
531
|
+
return /* @__PURE__ */ o("div", { className: U.meter, role: "group", "aria-label": n, children: [
|
|
532
|
+
/* @__PURE__ */ o("div", { className: U.head, children: [
|
|
533
|
+
/* @__PURE__ */ e("span", { className: U.label, children: n }),
|
|
534
|
+
/* @__PURE__ */ e("span", { className: U.value, "data-tone": p, children: c })
|
|
535
|
+
] }),
|
|
536
|
+
l !== null ? /* @__PURE__ */ e(
|
|
537
|
+
je,
|
|
538
|
+
{
|
|
539
|
+
className: U.bar,
|
|
540
|
+
size: "large",
|
|
541
|
+
percent: Math.round(l * 100),
|
|
542
|
+
stroke: d ? "var(--semi-color-warning)" : "var(--app-strong-bg)",
|
|
543
|
+
orbitStroke: "var(--semi-color-fill-1)",
|
|
544
|
+
"aria-label": n,
|
|
545
|
+
"aria-valuetext": c
|
|
546
|
+
}
|
|
547
|
+
) : null,
|
|
548
|
+
a ? /* @__PURE__ */ e("span", { className: U.note, children: a }) : null
|
|
549
|
+
] });
|
|
550
|
+
}, ls = () => {
|
|
551
|
+
const t = ce(), n = oe(), { accountApi: a, config: i } = R(), { bootstrapped: r, serviceUnavailable: c, session: l } = de(), d = $e(new URLSearchParams(t.search).get("returnPath"), i.routes.app), p = a.startLogin(d, i.routes.app);
|
|
552
|
+
return X(() => {
|
|
553
|
+
r && !l && !c && !st() && !ge() && window.location.replace(p);
|
|
554
|
+
}, [r, p, c, l]), r && l ? /* @__PURE__ */ e(le, { to: d, replace: !0 }) : r && !l && ge() ? /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
|
|
555
|
+
q,
|
|
556
|
+
{
|
|
557
|
+
status: "info",
|
|
558
|
+
title: "已退出登录",
|
|
559
|
+
description: "您已在其他窗口退出 24.city 统一账号。需要继续使用时请重新登录。",
|
|
560
|
+
extra: /* @__PURE__ */ o(pe, { spacing: 12, children: [
|
|
561
|
+
/* @__PURE__ */ e(
|
|
562
|
+
P,
|
|
563
|
+
{
|
|
564
|
+
theme: "solid",
|
|
565
|
+
type: "primary",
|
|
566
|
+
onClick: () => {
|
|
567
|
+
fe(), window.location.replace(p);
|
|
568
|
+
},
|
|
569
|
+
children: "重新登录"
|
|
570
|
+
}
|
|
571
|
+
),
|
|
572
|
+
/* @__PURE__ */ e(
|
|
573
|
+
P,
|
|
574
|
+
{
|
|
575
|
+
theme: "light",
|
|
576
|
+
type: "tertiary",
|
|
577
|
+
onClick: () => {
|
|
578
|
+
fe(), n(i.routes.publicHome);
|
|
579
|
+
},
|
|
580
|
+
children: "返回首页"
|
|
581
|
+
}
|
|
582
|
+
)
|
|
583
|
+
] })
|
|
584
|
+
}
|
|
585
|
+
) }) : /* @__PURE__ */ e(ae, { children: c ? /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
586
|
+
q,
|
|
587
|
+
{
|
|
588
|
+
status: "error",
|
|
589
|
+
title: "统一账号服务暂不可用",
|
|
590
|
+
description: "请稍后重试。",
|
|
591
|
+
extra: /* @__PURE__ */ o(pe, { spacing: 12, children: [
|
|
592
|
+
/* @__PURE__ */ e(P, { theme: "solid", type: "primary", onClick: () => window.location.replace(p), children: "重试" }),
|
|
593
|
+
/* @__PURE__ */ e(P, { theme: "light", type: "tertiary", onClick: () => n(i.routes.publicHome), children: "返回首页" })
|
|
594
|
+
] })
|
|
595
|
+
}
|
|
596
|
+
) }) : /* @__PURE__ */ e(q, { status: "loading", title: "正在前往统一登录…" }) });
|
|
597
|
+
}, Ia = "_pill_1hckq_2", Ta = "_upgrade_1hckq_24", ye = {
|
|
598
|
+
pill: Ia,
|
|
599
|
+
upgrade: Ta
|
|
600
|
+
}, ds = ({ quota: t, unit: n, onUpgrade: a }) => {
|
|
601
|
+
if (!t) return null;
|
|
602
|
+
const i = _t(t);
|
|
603
|
+
return /* @__PURE__ */ o("span", { className: ye.pill, "data-full": i ? "true" : "false", role: "status", children: [
|
|
604
|
+
/* @__PURE__ */ e("span", { children: gt(t, n) }),
|
|
605
|
+
i ? /* @__PURE__ */ e(P, { theme: "borderless", type: "tertiary", size: "small", className: ye.upgrade, onClick: a, children: "升级" }) : null
|
|
606
|
+
] });
|
|
607
|
+
}, hs = ({ children: t }) => {
|
|
608
|
+
const n = ce(), { config: a } = R(), { bootstrapped: i, serviceUnavailable: r, session: c } = de();
|
|
609
|
+
if (!i) return /* @__PURE__ */ e(nt, {});
|
|
610
|
+
if (r)
|
|
611
|
+
return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e("div", { role: "alert", children: /* @__PURE__ */ e(
|
|
612
|
+
q,
|
|
613
|
+
{
|
|
614
|
+
status: "error",
|
|
615
|
+
title: "账号服务暂不可用",
|
|
616
|
+
description: "无法确认当前会话与空间,应用已停止加载受保护数据。",
|
|
617
|
+
extra: /* @__PURE__ */ e(P, { theme: "solid", type: "primary", onClick: () => window.location.reload(), children: "重新加载" })
|
|
618
|
+
}
|
|
619
|
+
) }) });
|
|
620
|
+
if (!c || c.purpose !== "user") {
|
|
621
|
+
const l = $e(n.pathname + n.search, a.routes.app);
|
|
622
|
+
return /* @__PURE__ */ e(le, { to: `${a.routes.login}?returnPath=${encodeURIComponent(l)}`, replace: !0 });
|
|
623
|
+
}
|
|
624
|
+
return /* @__PURE__ */ e(x, { children: t });
|
|
625
|
+
}, xa = "_modal_6pw0p_6", Ea = "_hero_6pw0p_15", za = "_close_6pw0p_15", Aa = "_badge_6pw0p_35", Ma = "_art_6pw0p_48", Fa = "_title_6pw0p_61", Ua = "_description_6pw0p_69", Ra = "_body_6pw0p_76", Oa = "_offer_6pw0p_83", Da = "_offerName_6pw0p_89", Ba = "_lines_6pw0p_95", Va = "_line_6pw0p_95", ja = "_check_6pw0p_110", qa = "_cta_6pw0p_123", Ha = "_ctaPrice_6pw0p_140", Ga = "_ownerOnly_6pw0p_150", Ka = "_later_6pw0p_158", N = {
|
|
626
|
+
modal: xa,
|
|
627
|
+
hero: Ea,
|
|
628
|
+
close: za,
|
|
629
|
+
badge: Aa,
|
|
630
|
+
art: Ma,
|
|
631
|
+
title: Fa,
|
|
632
|
+
description: Ua,
|
|
633
|
+
body: Ra,
|
|
634
|
+
offer: Oa,
|
|
635
|
+
offerName: Da,
|
|
636
|
+
lines: Ba,
|
|
637
|
+
line: Va,
|
|
638
|
+
check: ja,
|
|
639
|
+
cta: qa,
|
|
640
|
+
ctaPrice: Ha,
|
|
641
|
+
ownerOnly: Ga,
|
|
642
|
+
later: Ka
|
|
643
|
+
}, ms = ({
|
|
644
|
+
title: t,
|
|
645
|
+
description: n,
|
|
646
|
+
art: a = "engine",
|
|
647
|
+
trigger: i,
|
|
648
|
+
onClose: r
|
|
649
|
+
}) => {
|
|
650
|
+
const c = oe(), l = Ie(), d = K(Date.now()), p = K(!1);
|
|
651
|
+
X(() => {
|
|
652
|
+
const g = i ?? a;
|
|
653
|
+
return d.current = Date.now(), l("upgrade_modal.opened", { target: g }), () => l("upgrade_modal.closed", { target: g, props: { durationMs: Date.now() - d.current, upgraded: p.current } });
|
|
654
|
+
}, []);
|
|
655
|
+
const _ = D(), { offer: h, plans: f, canBuy: y, subscriptionPath: k } = ft(), C = h ? Ue(h.plan, f.data ?? [], _).filter((g) => g.included).slice(0, 5).map((g) => g.text) : [], v = h != null && h.price ? `${Ee(h.price)}起` : "";
|
|
656
|
+
return (
|
|
657
|
+
// Semi 把 className 挂在最外层包装上(遮罩和弹窗的共同父元素),不在 .semi-modal 上:宽度用 width 属性给。
|
|
658
|
+
// header={null} 时 Semi 连关闭按钮也不渲染,右上角的关闭按钮自己画在插画区里。
|
|
659
|
+
/* @__PURE__ */ o(qe, { visible: !0, header: null, footer: null, onCancel: r, className: N.modal, width: 400, centered: !0, children: [
|
|
660
|
+
/* @__PURE__ */ o("div", { className: N.hero, "data-art": a, children: [
|
|
661
|
+
/* @__PURE__ */ e(
|
|
662
|
+
P,
|
|
663
|
+
{
|
|
664
|
+
theme: "borderless",
|
|
665
|
+
type: "tertiary",
|
|
666
|
+
size: "small",
|
|
667
|
+
icon: /* @__PURE__ */ e(Ze, { "aria-hidden": "true" }),
|
|
668
|
+
"aria-label": "关闭",
|
|
669
|
+
className: N.close,
|
|
670
|
+
onClick: r
|
|
671
|
+
}
|
|
672
|
+
),
|
|
673
|
+
/* @__PURE__ */ e("span", { className: N.badge, children: "会员专享" }),
|
|
674
|
+
/* @__PURE__ */ e("span", { className: N.art, "aria-hidden": "true" }),
|
|
675
|
+
/* @__PURE__ */ e("span", { className: N.title, children: t }),
|
|
676
|
+
/* @__PURE__ */ e("span", { className: N.description, children: n })
|
|
677
|
+
] }),
|
|
678
|
+
/* @__PURE__ */ o("div", { className: N.body, children: [
|
|
679
|
+
h ? /* @__PURE__ */ o("span", { className: N.offer, children: [
|
|
680
|
+
"升级到",
|
|
681
|
+
/* @__PURE__ */ e("span", { className: N.offerName, children: h.plan.name }),
|
|
682
|
+
"即可使用,同时获得:"
|
|
683
|
+
] }) : /* @__PURE__ */ e("span", { className: N.offer, children: "升级套餐即可使用。" }),
|
|
684
|
+
C.length ? /* @__PURE__ */ e("div", { className: N.lines, role: "list", "aria-label": "升级后的权益", children: C.map((g) => /* @__PURE__ */ o("div", { className: N.line, role: "listitem", children: [
|
|
685
|
+
/* @__PURE__ */ e("span", { className: N.check, "aria-hidden": "true", children: /* @__PURE__ */ e(re, {}) }),
|
|
686
|
+
g
|
|
687
|
+
] }, g)) }) : null,
|
|
688
|
+
y ? /* @__PURE__ */ o(
|
|
689
|
+
P,
|
|
690
|
+
{
|
|
691
|
+
theme: "light",
|
|
692
|
+
type: "tertiary",
|
|
693
|
+
block: !0,
|
|
694
|
+
className: N.cta,
|
|
695
|
+
"aria-label": `立即升级${v ? `,${v}` : ""}(打开订阅与套餐)`,
|
|
696
|
+
onClick: () => {
|
|
697
|
+
p.current = !0, r(), c(k, { state: Nt(h == null ? void 0 : h.plan.code) });
|
|
698
|
+
},
|
|
699
|
+
children: [
|
|
700
|
+
"立即升级",
|
|
701
|
+
v ? /* @__PURE__ */ e("span", { className: N.ctaPrice, children: v }) : null
|
|
702
|
+
]
|
|
703
|
+
}
|
|
704
|
+
) : /* @__PURE__ */ e("span", { className: N.ownerOnly, children: "团队套餐由所有者在统一账号中心升级,请联系团队所有者。" }),
|
|
705
|
+
/* @__PURE__ */ e(P, { theme: "borderless", type: "tertiary", block: !0, className: N.later, onClick: r, children: "暂不升级" })
|
|
706
|
+
] })
|
|
707
|
+
] })
|
|
708
|
+
);
|
|
709
|
+
}, Qa = /^[a-z0-9][a-z0-9._:-]{0,99}$/, Ya = () => {
|
|
710
|
+
const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
711
|
+
return {
|
|
712
|
+
get: (a) => t.get(a),
|
|
713
|
+
set(a, i) {
|
|
714
|
+
t.set(a, i), n.forEach((r) => r());
|
|
715
|
+
},
|
|
716
|
+
subscribe(a) {
|
|
717
|
+
return n.add(a), () => {
|
|
718
|
+
n.delete(a);
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
}, ve = /* @__PURE__ */ new WeakMap(), Ja = (t) => {
|
|
723
|
+
let n = ve.get(t);
|
|
724
|
+
return n || (n = Ya(), ve.set(t, n)), n;
|
|
725
|
+
}, us = (t, { enabled: n = !0 } = {}) => {
|
|
726
|
+
var _;
|
|
727
|
+
if (!Qa.test(t))
|
|
728
|
+
throw new Error(`useShowOnce 的标识无效:${t}(小写字母、数字和 . _ : -,最长 100 个字符)`);
|
|
729
|
+
const { accountApi: a } = R(), i = ((_ = de().session) == null ? void 0 : _.globalUserId) ?? null, r = Ja(a), c = i ? `${i}
|
|
730
|
+
${t}` : null, l = yt(
|
|
731
|
+
r.subscribe,
|
|
732
|
+
() => c ? r.get(c) : void 0,
|
|
733
|
+
() => {
|
|
734
|
+
}
|
|
735
|
+
);
|
|
736
|
+
X(() => {
|
|
737
|
+
if (!n || !c || r.get(c)) return;
|
|
738
|
+
if (!a.getShownPrompts || !a.claimShownPrompts) {
|
|
739
|
+
r.set(c, "done");
|
|
740
|
+
return;
|
|
741
|
+
}
|
|
742
|
+
r.set(c, "asking");
|
|
743
|
+
const h = (y) => {
|
|
744
|
+
r.get(c) === "asking" && r.set(c, y);
|
|
745
|
+
};
|
|
746
|
+
(async () => {
|
|
747
|
+
var C, v;
|
|
748
|
+
const y = await ((C = a.getShownPrompts) == null ? void 0 : C.call(a, [t]));
|
|
749
|
+
if (!y || y.includes(t)) {
|
|
750
|
+
h("done");
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
const k = await ((v = a.claimShownPrompts) == null ? void 0 : v.call(a, [t]));
|
|
754
|
+
h(k != null && k.includes(t) ? "open" : "done");
|
|
755
|
+
})().catch(() => h("done"));
|
|
756
|
+
}, [a, n, c, t, r]);
|
|
757
|
+
const d = Ne(() => {
|
|
758
|
+
c && r.set(c, "done");
|
|
759
|
+
}, [c, r]), p = Ne(() => {
|
|
760
|
+
c && r.set(c, "open");
|
|
761
|
+
}, [c, r]);
|
|
762
|
+
return { visible: l === "open", close: d, open: p };
|
|
763
|
+
};
|
|
764
|
+
export {
|
|
765
|
+
os as A,
|
|
766
|
+
F as C,
|
|
767
|
+
ls as L,
|
|
768
|
+
aa as P,
|
|
769
|
+
ds as Q,
|
|
770
|
+
hs as R,
|
|
771
|
+
Z as S,
|
|
772
|
+
fa as T,
|
|
773
|
+
ms as U,
|
|
774
|
+
cs as a,
|
|
775
|
+
$n as b,
|
|
776
|
+
kn as c,
|
|
777
|
+
Na as d,
|
|
778
|
+
Q as e,
|
|
779
|
+
Fe as f,
|
|
780
|
+
ie as g,
|
|
781
|
+
Tn as h,
|
|
782
|
+
Ue as p,
|
|
783
|
+
us as u,
|
|
784
|
+
xn as y
|
|
785
|
+
};
|