mantur-components 0.1.0

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.
@@ -0,0 +1,1208 @@
1
+ import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
+ import { Avatar as a, Button as o, Card as s, DatePicker as c, Divider as l, Dropdown as u, Form as d, Grid as f, Input as p, Menu as m, Message as h, Modal as g, Pagination as _, Select as v, Table as y, Tabs as b, Tag as x, Typography as S, Upload as C } from "@arco-design/web-react";
3
+ import { IconCheckCircleFill as w, IconDown as T, IconEdit as E, IconFile as D, IconLanguage as O, IconMoonFill as k, IconPlus as A, IconPoweroff as j, IconSunFill as M, IconUpload as N } from "@arco-design/web-react/icon";
4
+ import { useTranslation as ee } from "react-i18next";
5
+ import { jsx as P, jsxs as F } from "react/jsx-runtime";
6
+ import { useTheme as te } from "next-themes";
7
+ //#region src/api.ts
8
+ var ne = "/api", I = "/users/me/points", L = "mantur-points-refresh", R = "mantur-tenant-context-change";
9
+ function re() {
10
+ return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ne;
11
+ }
12
+ function ie() {
13
+ return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : I;
14
+ }
15
+ function z(e) {
16
+ if (typeof document > "u") return;
17
+ let t = `${encodeURIComponent(e)}=`;
18
+ return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
19
+ }
20
+ function B(e) {
21
+ if (typeof document > "u") return;
22
+ let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
23
+ i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
24
+ document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
25
+ });
26
+ }
27
+ function ae(e) {
28
+ let t = JSON.parse(e || "null");
29
+ if (!t) throw Error("Request failed");
30
+ if (t.code !== 0) throw Error(t.message || "Request failed");
31
+ return t;
32
+ }
33
+ async function V(e, t = {}) {
34
+ let n = z("front-token"), r = z("Accept-Language"), i = t.headers || {};
35
+ return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
36
+ let a = new XMLHttpRequest();
37
+ a.open(t.method || "GET", `${re()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
38
+ a.setRequestHeader(e, t);
39
+ }), a.onload = () => {
40
+ try {
41
+ let e = ae(a.responseText);
42
+ if (a.status < 200 || a.status >= 300) {
43
+ r(Error(e.message || a.statusText));
44
+ return;
45
+ }
46
+ n(e);
47
+ } catch (e) {
48
+ r(e);
49
+ }
50
+ }, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
51
+ });
52
+ }
53
+ async function oe() {
54
+ try {
55
+ await V("/auth/front-logout", { method: "DELETE" });
56
+ } catch (e) {
57
+ console.warn("Logout request failed, continuing local logout.", e);
58
+ } finally {
59
+ B("front-token"), B("refreshToken"), typeof window < "u" && window.location.reload();
60
+ }
61
+ }
62
+ async function se(e) {
63
+ let t;
64
+ if (e.avatarFile) {
65
+ let n = new FormData();
66
+ n.append("file", e.avatarFile), t = (await V("/users/me/avatar", {
67
+ method: "POST",
68
+ body: n
69
+ })).data;
70
+ }
71
+ return (await V("/users/me", {
72
+ method: "PUT",
73
+ headers: { "Content-Type": "application/json;charset=utf-8" },
74
+ body: JSON.stringify({ nickname: e.nickname })
75
+ })).data || t;
76
+ }
77
+ function ce(e) {
78
+ let t = (...t) => {
79
+ let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
80
+ return typeof n == "number" ? n : Number(n || 0);
81
+ };
82
+ return {
83
+ total: t("total", "totalPoints", "balance", "points"),
84
+ recharge: t("recharge", "rechargePoints", "paidPoints"),
85
+ gifted: t("gifted", "giftedPoints", "bonusPoints")
86
+ };
87
+ }
88
+ async function H() {
89
+ return ce((await V(ie())).data);
90
+ }
91
+ async function U() {
92
+ let e = await H();
93
+ return typeof window < "u" && window.dispatchEvent(new CustomEvent(L, { detail: e })), e;
94
+ }
95
+ function W(e, t) {
96
+ return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
97
+ tenantId: t.tenantId,
98
+ tenantName: t.tenantName || t.tenantId,
99
+ roles: t.roles?.map((e) => ({
100
+ roleCode: e,
101
+ roleName: e
102
+ }))
103
+ } : e.find((e) => e.isOwner) || e[0];
104
+ }
105
+ function G(e) {
106
+ typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(R, { detail: e })));
107
+ }
108
+ function le() {
109
+ if (!(typeof window > "u")) return window.__MANTUR_COMPONENTS_TENANT_CONTEXT__;
110
+ }
111
+ async function K() {
112
+ return (await V("/users/me/tenants")).data || [];
113
+ }
114
+ async function q() {
115
+ return (await V("/auth/current-tenant")).data;
116
+ }
117
+ async function ue(e) {
118
+ return (await V(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
119
+ }
120
+ async function de(e = "refresh") {
121
+ let [t, n] = await Promise.all([K(), q()]), r = {
122
+ tenants: t,
123
+ currentTenant: W(t, n),
124
+ auth: n,
125
+ reason: e
126
+ };
127
+ return G(r), r;
128
+ }
129
+ async function fe(e) {
130
+ let t = await ue(e), n = await K(), r = {
131
+ tenants: n,
132
+ currentTenant: W(n, t),
133
+ auth: t,
134
+ reason: "switch"
135
+ };
136
+ return G(r), r;
137
+ }
138
+ //#endregion
139
+ //#region src/labels.ts
140
+ var pe = {
141
+ title: "Mantur",
142
+ switchTeam: "Switch Team",
143
+ personalSettings: "Personal Settings",
144
+ logout: "Logout",
145
+ loading: "Loading...",
146
+ owner: "Owner",
147
+ member: "Member",
148
+ createTeam: "Create Team",
149
+ createTeamComingSoon: "Create team is coming soon",
150
+ switchedToTeam: "Switched team",
151
+ error: "Request failed",
152
+ profileTitle: "Profile",
153
+ profileNickname: "Nickname",
154
+ profileNicknamePlaceholder: "Please enter nickname",
155
+ profileAvatar: "Avatar",
156
+ profileUploadAvatar: "Upload Avatar",
157
+ profileAvatarHint: "JPG/PNG/WebP, max 2MB, max 2048px.",
158
+ profileAvatarTooLarge: "Avatar must be less than 2MB",
159
+ profileAvatarDimensionExceeded: "Avatar dimensions must be within 2048px",
160
+ profileAvatarInvalidImage: "Invalid image",
161
+ profileUpdateSuccess: "Profile updated",
162
+ profileSave: "Save",
163
+ profileCancel: "Cancel",
164
+ myPoints: "My Points",
165
+ totalBalance: "Total Balance",
166
+ rechargePoints: "Recharge Points",
167
+ giftedPoints: "Gifted Points",
168
+ recharge: "Recharge",
169
+ rechargeTitle: "Recharge Points",
170
+ pointsDetail: "Points Detail",
171
+ close: "Close",
172
+ currentBalance: "Current Balance",
173
+ pointsUnit: "points",
174
+ rechargeHint: "Recharge points are valid for 2 years after arrival.",
175
+ payNow: "Pay Now",
176
+ rechargeSuccess: "Recharge successful",
177
+ all: "All",
178
+ income: "Income",
179
+ expense: "Expense",
180
+ source: "Source",
181
+ sourceAll: "All Sources",
182
+ sourceRecharge: "Recharge",
183
+ sourceGifted: "Gifted",
184
+ dateRange: "Date Range",
185
+ startDate: "Start Date",
186
+ endDate: "End Date",
187
+ dateTo: "to",
188
+ query: "Query",
189
+ refreshed: "Refreshed",
190
+ pointsDeductionTip: "Points expiring soon are deducted first.",
191
+ pointsNoteTitle: "Note",
192
+ pointsAccountNote: "Points are attached to your personal account. You recharge, consume, and manage them yourself. Others cannot recharge or use them for you. Recharge points are valid for 2 years; gifted points follow the validity set by operations."
193
+ };
194
+ function me(e) {
195
+ return {
196
+ ...pe,
197
+ ...e
198
+ };
199
+ }
200
+ //#endregion
201
+ //#region src/i18n.ts
202
+ var he = "i18nextLng", ge = "manturLanguageSource", J = "mantur-language-change", _e = {
203
+ "zh-CN": {
204
+ title: "漫途",
205
+ switchTeam: "切换团队",
206
+ personalSettings: "个人设置",
207
+ logout: "退出登录",
208
+ loading: "加载中...",
209
+ owner: "管理员",
210
+ member: "成员",
211
+ createTeam: "创建团队",
212
+ createTeamComingSoon: "创建团队功能即将上线",
213
+ switchedToTeam: "已切换团队",
214
+ error: "请求失败",
215
+ profileTitle: "个人资料",
216
+ profileNickname: "昵称",
217
+ profileNicknamePlaceholder: "请输入昵称",
218
+ profileAvatar: "头像",
219
+ profileUploadAvatar: "上传头像",
220
+ profileAvatarHint: "支持 JPG/PNG/WebP,最大 2MB,尺寸不超过 2048px。",
221
+ profileAvatarTooLarge: "头像不能超过 2MB",
222
+ profileAvatarDimensionExceeded: "头像尺寸不能超过 2048px",
223
+ profileAvatarInvalidImage: "图片无效",
224
+ profileUpdateSuccess: "个人资料已更新",
225
+ profileSave: "保存",
226
+ profileCancel: "取消",
227
+ myPoints: "我的积分",
228
+ totalBalance: "总余额",
229
+ rechargePoints: "充值积分",
230
+ giftedPoints: "赠送积分",
231
+ recharge: "去充值",
232
+ rechargeTitle: "充值积分",
233
+ pointsDetail: "积分明细",
234
+ close: "关闭",
235
+ currentBalance: "当前余额",
236
+ pointsUnit: "积分",
237
+ rechargeHint: "充值积分有效期 2 年(自到账日起算),支付后不可退换。",
238
+ payNow: "立即支付",
239
+ rechargeSuccess: "充值成功",
240
+ all: "全部",
241
+ income: "获得",
242
+ expense: "消耗",
243
+ source: "来源",
244
+ sourceAll: "全部来源",
245
+ sourceRecharge: "充值",
246
+ sourceGifted: "赠送",
247
+ dateRange: "日期查询",
248
+ startDate: "开始日期",
249
+ endDate: "结束日期",
250
+ dateTo: "至",
251
+ query: "查询",
252
+ refreshed: "已刷新",
253
+ pointsDeductionTip: "优先扣减即将到期的积分",
254
+ pointsNoteTitle: "说明",
255
+ pointsAccountNote: "积分账户挂在你的个人账号上,自己充值、自己消耗、自己负责;他人不能代充、不能代用。充值积分有效期固定 2 年;赠送积分有效期由后台运营发放时设置。",
256
+ languageZh: "中文",
257
+ languageEn: "English"
258
+ },
259
+ "en-US": {
260
+ ...pe,
261
+ languageZh: "中文",
262
+ languageEn: "English"
263
+ }
264
+ };
265
+ function Y(e) {
266
+ return e?.toLowerCase().startsWith("en") ? "en-US" : "zh-CN";
267
+ }
268
+ function X() {
269
+ return typeof window > "u" ? "zh-CN" : Y(window.localStorage.getItem("i18nextLng") || document.documentElement.lang || navigator.language);
270
+ }
271
+ function Z(e) {
272
+ return _e[Y(e)];
273
+ }
274
+ //#endregion
275
+ //#region src/lang-switch/LangSwitch.tsx
276
+ var ve = he, ye = ge;
277
+ function be(e, t) {
278
+ document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
279
+ }
280
+ function xe() {
281
+ let { i18n: e } = ee(), [n, r] = i(() => X()), a = Z(n);
282
+ return t(() => {
283
+ r(Y(e.language));
284
+ }, [e.language]), /* @__PURE__ */ P(u, {
285
+ droplist: /* @__PURE__ */ F(m, {
286
+ selectedKeys: [n],
287
+ onClickMenuItem: (t) => {
288
+ let n = Y(t);
289
+ localStorage.setItem(ve, t), localStorage.setItem(ye, "manual"), r(n), e.changeLanguage(t), be("Accept-Language", t), window.dispatchEvent(new CustomEvent(J, { detail: n })), window.location.reload();
290
+ },
291
+ children: [/* @__PURE__ */ P(m.Item, { children: a.languageZh }, "zh-CN"), /* @__PURE__ */ P(m.Item, { children: a.languageEn }, "en-US")]
292
+ }),
293
+ trigger: "click",
294
+ position: "br",
295
+ children: /* @__PURE__ */ P(o, {
296
+ shape: "circle",
297
+ icon: /* @__PURE__ */ P(O, {})
298
+ })
299
+ });
300
+ }
301
+ //#endregion
302
+ //#region src/theme-switch/ThemeSwitch.tsx
303
+ function Se() {
304
+ let { resolvedTheme: e, setTheme: t } = te();
305
+ return /* @__PURE__ */ P(o, {
306
+ shape: "circle",
307
+ icon: P(e === "light" ? k : M, {}),
308
+ onClick: () => {
309
+ t(e === "light" ? "dark" : "light");
310
+ }
311
+ });
312
+ }
313
+ //#endregion
314
+ //#region src/header/mock.ts
315
+ var Q = [
316
+ {
317
+ id: "points-500",
318
+ points: 500,
319
+ price: 5
320
+ },
321
+ {
322
+ id: "points-1000",
323
+ points: 1e3,
324
+ price: 10
325
+ },
326
+ {
327
+ id: "points-5500",
328
+ points: 5500,
329
+ price: 50,
330
+ recommended: !0
331
+ },
332
+ {
333
+ id: "points-24000",
334
+ points: 24e3,
335
+ price: 200
336
+ }
337
+ ], Ce = [
338
+ {
339
+ id: "recharge-1",
340
+ type: "income",
341
+ source: "recharge",
342
+ name: "积分充值",
343
+ meta: "2026-05-10 14:00:00 · 订单号 R20260510140000 · 套餐 $50",
344
+ date: "2026-05-10",
345
+ amount: 5500,
346
+ badgeKind: "recharge",
347
+ badgeText: "充值"
348
+ },
349
+ {
350
+ id: "gift-1",
351
+ type: "income",
352
+ source: "gift",
353
+ name: "系统赠送 · 新人礼包",
354
+ meta: "2026-05-08 09:00:00 · 有效期 30 天",
355
+ date: "2026-05-08",
356
+ amount: 1e3,
357
+ badgeKind: "gift",
358
+ badgeText: "赠送"
359
+ },
360
+ {
361
+ id: "expense-1",
362
+ type: "expense",
363
+ name: "视频生成 — Sora 40秒 4K",
364
+ meta: "2026-05-10 16:45:22 · 制作中心",
365
+ date: "2026-05-10",
366
+ amount: -400,
367
+ badgeKind: "deducted",
368
+ badgeText: "已扣除"
369
+ },
370
+ {
371
+ id: "expense-2",
372
+ type: "expense",
373
+ name: "视频生成 — Sora 25秒 1080p",
374
+ meta: "2026-05-11 09:15:42 · 制作中心",
375
+ date: "2026-05-11",
376
+ amount: -250,
377
+ badgeKind: "deducted",
378
+ badgeText: "已扣除"
379
+ },
380
+ {
381
+ id: "expire-1",
382
+ type: "expense",
383
+ name: "积分过期",
384
+ meta: "2026-05-01 00:00:00 · 2026-04 批次到期未使用",
385
+ date: "2026-05-01",
386
+ amount: -100,
387
+ badgeKind: "expired",
388
+ badgeText: "自然过期"
389
+ },
390
+ {
391
+ id: "expense-3",
392
+ type: "expense",
393
+ name: "AI 对话 — GPT-4o 5轮",
394
+ meta: "2026-05-07 10:08:55 · 剧本中心",
395
+ date: "2026-05-07",
396
+ amount: -10,
397
+ badgeKind: "deducted",
398
+ badgeText: "已扣除"
399
+ },
400
+ {
401
+ id: "expense-4",
402
+ type: "expense",
403
+ name: "图片生成 — DALL-E 5张",
404
+ meta: "2026-05-04 14:20:11 · 制作中心",
405
+ date: "2026-05-04",
406
+ amount: -75,
407
+ badgeKind: "deducted",
408
+ badgeText: "已扣除"
409
+ }
410
+ ], { RangePicker: we } = c, Te = 21, Ee = 7;
411
+ function De(e) {
412
+ return e === "recharge" ? "arcoblue" : e === "gift" ? "cyan" : e === "expired" ? "gray" : "orange";
413
+ }
414
+ function Oe({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
415
+ let [l, u] = i("all"), [d, p] = i("all"), [m, C] = i(["2026-04-15", "2026-05-15"]), [w, T] = i(1), E = (e) => new Intl.NumberFormat().format(e), D = n(() => {
416
+ let [e, t] = m;
417
+ return Ce.filter((n) => {
418
+ let r = l === "all" || n.type === l, i = d === "all" || n.source === d, a = !e || n.date >= e, o = !t || n.date <= t;
419
+ return r && i && a && o;
420
+ });
421
+ }, [
422
+ m,
423
+ d,
424
+ l
425
+ ]), O = [
426
+ {
427
+ title: r.pointsDetail,
428
+ dataIndex: "name",
429
+ render: (e, t) => /* @__PURE__ */ F("div", {
430
+ className: "min-w-0",
431
+ children: [/* @__PURE__ */ P(S.Text, {
432
+ className: "font-medium!",
433
+ children: t.name
434
+ }), /* @__PURE__ */ P(S.Text, {
435
+ type: "secondary",
436
+ className: "mt-1 block! text-xs!",
437
+ children: t.meta
438
+ })]
439
+ })
440
+ },
441
+ {
442
+ title: r.pointsUnit,
443
+ dataIndex: "amount",
444
+ width: 120,
445
+ align: "right",
446
+ render: (e, t) => /* @__PURE__ */ F(S.Text, {
447
+ className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
448
+ children: [t.amount > 0 ? "+" : "", E(t.amount)]
449
+ })
450
+ },
451
+ {
452
+ title: r.source,
453
+ dataIndex: "badgeText",
454
+ width: 110,
455
+ align: "right",
456
+ render: (e, t) => /* @__PURE__ */ P(x, {
457
+ color: De(t.badgeKind),
458
+ children: t.badgeText
459
+ })
460
+ }
461
+ ];
462
+ return /* @__PURE__ */ P(g, {
463
+ title: r.pointsDetail,
464
+ visible: e,
465
+ footer: /* @__PURE__ */ F("div", {
466
+ className: "flex justify-end gap-2",
467
+ children: [/* @__PURE__ */ P(o, {
468
+ onClick: a,
469
+ children: r.close
470
+ }), /* @__PURE__ */ P(o, {
471
+ type: "primary",
472
+ icon: /* @__PURE__ */ P(A, {}),
473
+ onClick: () => {
474
+ a(), c();
475
+ },
476
+ children: r.recharge
477
+ })]
478
+ }),
479
+ onCancel: a,
480
+ style: {
481
+ width: 780,
482
+ maxWidth: "calc(100vw - 48px)"
483
+ },
484
+ children: /* @__PURE__ */ F("div", {
485
+ className: "max-h-[70vh] overflow-y-auto",
486
+ children: [
487
+ /* @__PURE__ */ F(s, {
488
+ bordered: !1,
489
+ className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
490
+ children: [
491
+ /* @__PURE__ */ P(S.Text, {
492
+ type: "secondary",
493
+ className: "text-xs!",
494
+ children: r.totalBalance
495
+ }),
496
+ /* @__PURE__ */ F("div", {
497
+ className: "mt-1.5 mb-3.5 ",
498
+ children: [/* @__PURE__ */ P(S.Text, {
499
+ className: "text-3xl! font-bold!",
500
+ children: E(t.total)
501
+ }), /* @__PURE__ */ F(S.Text, {
502
+ type: "secondary",
503
+ className: "ml-2 text-sm! ",
504
+ children: ["🪙 ", r.pointsUnit]
505
+ })]
506
+ }),
507
+ /* @__PURE__ */ F(f.Row, {
508
+ gutter: 12,
509
+ children: [/* @__PURE__ */ P(f.Col, {
510
+ span: 12,
511
+ children: /* @__PURE__ */ F(s, {
512
+ size: "small",
513
+ children: [/* @__PURE__ */ F("div", {
514
+ className: "mb-1 flex items-center justify-between",
515
+ children: [/* @__PURE__ */ P(S.Text, {
516
+ type: "secondary",
517
+ className: "text-xs!",
518
+ children: r.rechargePoints
519
+ }), /* @__PURE__ */ P(x, {
520
+ color: "arcoblue",
521
+ children: r.sourceRecharge
522
+ })]
523
+ }), /* @__PURE__ */ P(S.Text, {
524
+ className: "text-lg! font-semibold!",
525
+ children: E(t.recharge)
526
+ })]
527
+ })
528
+ }), /* @__PURE__ */ P(f.Col, {
529
+ span: 12,
530
+ children: /* @__PURE__ */ F(s, {
531
+ size: "small",
532
+ children: [/* @__PURE__ */ F("div", {
533
+ className: "mb-1 flex items-center justify-between",
534
+ children: [/* @__PURE__ */ P(S.Text, {
535
+ type: "secondary",
536
+ className: "text-xs!",
537
+ children: r.giftedPoints
538
+ }), /* @__PURE__ */ P(x, {
539
+ color: "success",
540
+ children: r.sourceGifted
541
+ })]
542
+ }), /* @__PURE__ */ P(S.Text, {
543
+ className: "text-lg! font-semibold!",
544
+ children: E(t.gifted)
545
+ })]
546
+ })
547
+ })]
548
+ }),
549
+ /* @__PURE__ */ P(S.Text, {
550
+ type: "secondary",
551
+ className: "mt-2.5 block! text-xs!",
552
+ children: r.pointsDeductionTip
553
+ })
554
+ ]
555
+ }),
556
+ /* @__PURE__ */ F("div", {
557
+ className: "px-6 py-4",
558
+ children: [
559
+ /* @__PURE__ */ F(b, {
560
+ activeTab: l,
561
+ onChange: (e) => u(e),
562
+ children: [
563
+ /* @__PURE__ */ P(b.TabPane, { title: r.all }, "all"),
564
+ /* @__PURE__ */ P(b.TabPane, { title: r.income }, "income"),
565
+ /* @__PURE__ */ P(b.TabPane, { title: r.expense }, "expense")
566
+ ]
567
+ }),
568
+ /* @__PURE__ */ F("div", {
569
+ className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
570
+ children: [
571
+ /* @__PURE__ */ F(v, {
572
+ value: d,
573
+ style: { width: 140 },
574
+ onChange: (e) => p(e),
575
+ children: [
576
+ /* @__PURE__ */ P(v.Option, {
577
+ value: "all",
578
+ children: r.sourceAll
579
+ }),
580
+ /* @__PURE__ */ P(v.Option, {
581
+ value: "recharge",
582
+ children: r.sourceRecharge
583
+ }),
584
+ /* @__PURE__ */ P(v.Option, {
585
+ value: "gift",
586
+ children: r.sourceGifted
587
+ })
588
+ ]
589
+ }),
590
+ /* @__PURE__ */ P(we, {
591
+ value: m,
592
+ onChange: (e) => C(e),
593
+ style: { width: 260 }
594
+ }),
595
+ /* @__PURE__ */ P(o, {
596
+ onClick: () => h.success(r.refreshed),
597
+ children: r.query
598
+ })
599
+ ]
600
+ }),
601
+ /* @__PURE__ */ P(y, {
602
+ rowKey: "id",
603
+ columns: O,
604
+ data: D,
605
+ pagination: !1,
606
+ border: !1
607
+ }),
608
+ /* @__PURE__ */ P(_, {
609
+ className: "mt-3 flex justify-center!",
610
+ current: w,
611
+ pageSize: Ee,
612
+ total: Te,
613
+ onChange: T
614
+ })
615
+ ]
616
+ }),
617
+ /* @__PURE__ */ P(s, {
618
+ bordered: !1,
619
+ className: "bg-arco-primary-light-1/30 rounded-none!",
620
+ children: /* @__PURE__ */ F(S.Text, {
621
+ type: "secondary",
622
+ className: "text-xs! leading-6!",
623
+ children: [/* @__PURE__ */ F("strong", { children: [r.pointsNoteTitle, ":"] }), r.pointsAccountNote]
624
+ })
625
+ })
626
+ ]
627
+ })
628
+ });
629
+ }
630
+ //#endregion
631
+ //#region src/header/components/ProfileModal.tsx
632
+ var ke = 2048, Ae = 2 * 1024 * 1024;
633
+ function je(e) {
634
+ return new Promise((t, n) => {
635
+ let r = URL.createObjectURL(e), i = new Image();
636
+ i.onload = () => {
637
+ URL.revokeObjectURL(r), t({
638
+ width: i.naturalWidth,
639
+ height: i.naturalHeight
640
+ });
641
+ }, i.onerror = () => {
642
+ URL.revokeObjectURL(r), n(/* @__PURE__ */ Error("invalid image"));
643
+ }, i.src = r;
644
+ });
645
+ }
646
+ function Me({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
647
+ let u = me(s), [f] = d.useForm(), [m, _] = i(!1), [v, y] = i(null), [b, x] = i(null), S = r(null);
648
+ t(() => () => {
649
+ S.current &&= (URL.revokeObjectURL(S.current), null);
650
+ }, []), t(() => {
651
+ e && (f.setFieldsValue({ nickname: n?.nickname || n?.username || "" }), y(null), x((e) => (e && URL.revokeObjectURL(e), S.current = null, null)));
652
+ }, [
653
+ e,
654
+ n,
655
+ f
656
+ ]);
657
+ let w = (e, t) => {
658
+ console.error(t), h.error(e);
659
+ }, T = (e) => {
660
+ h.success(e);
661
+ };
662
+ return /* @__PURE__ */ P(g, {
663
+ title: u.profileTitle,
664
+ visible: e,
665
+ onOk: async () => {
666
+ try {
667
+ let e = await f.validate();
668
+ _(!0), await l({
669
+ nickname: e.nickname,
670
+ avatarFile: v
671
+ }), T(u.profileUpdateSuccess), c();
672
+ } catch (e) {
673
+ e instanceof Error && w(e.message || u.error, e);
674
+ } finally {
675
+ _(!1);
676
+ }
677
+ },
678
+ onCancel: c,
679
+ confirmLoading: m,
680
+ okText: u.profileSave,
681
+ cancelText: u.profileCancel,
682
+ children: /* @__PURE__ */ F(d, {
683
+ form: f,
684
+ layout: "vertical",
685
+ children: [/* @__PURE__ */ P(d.Item, {
686
+ label: u.profileNickname,
687
+ field: "nickname",
688
+ rules: [{
689
+ required: !0,
690
+ message: u.profileNicknamePlaceholder
691
+ }],
692
+ children: /* @__PURE__ */ P(p, {
693
+ placeholder: u.profileNicknamePlaceholder,
694
+ allowClear: !0
695
+ })
696
+ }), /* @__PURE__ */ P(d.Item, {
697
+ label: u.profileAvatar,
698
+ children: /* @__PURE__ */ F("div", {
699
+ className: "flex flex-col gap-2",
700
+ children: [/* @__PURE__ */ F("div", {
701
+ className: "flex items-center gap-3",
702
+ children: [/* @__PURE__ */ P(a, {
703
+ size: 64,
704
+ className: "shrink-0 bg-arco-primary-light-1!",
705
+ children: b || n?.avatar ? /* @__PURE__ */ P("img", {
706
+ src: b || n?.avatar,
707
+ alt: "",
708
+ className: "block h-full w-full object-cover"
709
+ }) : n?.nickname?.[0] || n?.username?.[0] || "U"
710
+ }), /* @__PURE__ */ P(C, {
711
+ accept: "image/*",
712
+ showUploadList: !1,
713
+ beforeUpload: async (e) => {
714
+ if (e.size > Ae) return w(u.profileAvatarTooLarge), !1;
715
+ try {
716
+ let { width: t, height: n } = await je(e);
717
+ if (t > ke || n > ke) return w(u.profileAvatarDimensionExceeded), !1;
718
+ } catch (e) {
719
+ return w(u.profileAvatarInvalidImage, e), !1;
720
+ }
721
+ return x((t) => {
722
+ t && URL.revokeObjectURL(t);
723
+ let n = URL.createObjectURL(e);
724
+ return S.current = n, n;
725
+ }), y(e), !1;
726
+ },
727
+ children: /* @__PURE__ */ P(o, {
728
+ type: "outline",
729
+ size: "small",
730
+ icon: /* @__PURE__ */ P(N, {}),
731
+ children: u.profileUploadAvatar
732
+ })
733
+ })]
734
+ }), /* @__PURE__ */ P("span", {
735
+ className: "text-xs text-arco-text-3",
736
+ children: u.profileAvatarHint
737
+ })]
738
+ })
739
+ })]
740
+ })
741
+ });
742
+ }
743
+ //#endregion
744
+ //#region src/header/components/UserAvatar.tsx
745
+ function Ne(e) {
746
+ return e?.nickname?.[0] || e?.username?.[0] || "U";
747
+ }
748
+ function $({ user: e, size: t, className: n = "" }) {
749
+ return /* @__PURE__ */ P(a, {
750
+ size: t,
751
+ className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
752
+ children: e?.avatar ? /* @__PURE__ */ P("img", {
753
+ src: e.avatar,
754
+ alt: "avatar",
755
+ className: "h-full w-full object-cover"
756
+ }) : Ne(e)
757
+ });
758
+ }
759
+ //#endregion
760
+ //#region src/header/components/RechargeModal.tsx
761
+ function Pe({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c }) {
762
+ let [l, u] = i(Q[2].id), d = (e) => new Intl.NumberFormat().format(e), p = Q.find((e) => e.id === l) || Q[0];
763
+ return /* @__PURE__ */ P(g, {
764
+ title: r.rechargeTitle,
765
+ visible: e,
766
+ footer: /* @__PURE__ */ F("div", {
767
+ className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
768
+ children: [/* @__PURE__ */ P("span", {
769
+ className: "text-arco-text-2 text-sm leading-6",
770
+ children: r.rechargeHint
771
+ }), /* @__PURE__ */ F(o, {
772
+ type: "primary",
773
+ size: "large",
774
+ className: "min-w-48! font-bold!",
775
+ onClick: () => c(p),
776
+ children: [
777
+ r.payNow,
778
+ " · $",
779
+ p.price
780
+ ]
781
+ })]
782
+ }),
783
+ onCancel: a,
784
+ alignCenter: !1,
785
+ wrapClassName: "overflow-hidden!",
786
+ style: {
787
+ width: "100vw",
788
+ maxWidth: "100vw",
789
+ top: 0,
790
+ paddingBottom: 0
791
+ },
792
+ className: "top-0! m-0! flex! h-screen! w-screen! max-w-none! flex-col! [&_.arco-modal-body]:min-h-0! [&_.arco-modal-body]:flex-1! [&_.arco-modal-body]:overflow-hidden! [&_.arco-modal-body]:p-0! [&_.arco-modal-close-icon]:top-1.5! [&_.arco-modal-close-icon]:right-4! [&_.arco-modal-close-icon]:inline-flex! [&_.arco-modal-close-icon]:h-9! [&_.arco-modal-close-icon]:w-9! [&_.arco-modal-close-icon]:items-center! [&_.arco-modal-close-icon]:justify-center! [&_.arco-modal-close-icon]:rounded-lg! [&_.arco-modal-close-icon]:text-lg! [&_.arco-modal-close-icon]:leading-9! [&_.arco-modal-close-icon]:transition-colors [&_.arco-modal-close-icon:hover]:bg-arco-fill-2 [&_.arco-modal-close-icon:hover]:text-arco-primary-6 [&_.arco-modal-close-icon_svg]:h-[18px]! [&_.arco-modal-close-icon_svg]:w-[18px]! [&_.arco-modal-content]:flex! [&_.arco-modal-content]:h-auto! [&_.arco-modal-content]:min-h-0! [&_.arco-modal-content]:flex-1! [&_.arco-modal-content]:flex-col! [&_.arco-modal-content]:overflow-hidden! [&_.arco-modal-content]:rounded-none! [&_.arco-modal-footer]:shrink-0! [&_.arco-modal-header]:shrink-0!",
793
+ children: /* @__PURE__ */ F("div", {
794
+ className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
795
+ children: [/* @__PURE__ */ F("div", {
796
+ className: "w-full border-arco-border-1 bg-arco-fill-1 text-arco-text-2 flex items-center gap-2.5 rounded-lg border px-3.5 py-3 text-sm",
797
+ children: [/* @__PURE__ */ P($, {
798
+ user: t,
799
+ size: 32,
800
+ className: "shrink-0"
801
+ }), /* @__PURE__ */ F("span", { children: [
802
+ t?.nickname || t?.username,
803
+ " · ",
804
+ r.currentBalance,
805
+ " ",
806
+ /* @__PURE__ */ P("strong", {
807
+ className: "text-arco-text-1",
808
+ children: d(n.total)
809
+ }),
810
+ " ",
811
+ r.pointsUnit
812
+ ] })]
813
+ }), /* @__PURE__ */ P("div", {
814
+ className: "mt-6 w-full",
815
+ children: /* @__PURE__ */ P(f.Row, {
816
+ gutter: [16, 16],
817
+ children: Q.map((e) => /* @__PURE__ */ P(f.Col, {
818
+ xs: 24,
819
+ sm: 12,
820
+ lg: 6,
821
+ children: /* @__PURE__ */ F(s, {
822
+ hoverable: !0,
823
+ role: "button",
824
+ tabIndex: 0,
825
+ onClick: () => u(e.id),
826
+ onKeyDown: (t) => {
827
+ (t.key === "Enter" || t.key === " ") && u(e.id);
828
+ },
829
+ bodyStyle: {
830
+ minHeight: 192,
831
+ display: "flex",
832
+ flexDirection: "column",
833
+ justifyContent: "space-between"
834
+ },
835
+ className: `border-arco-border-2! bg-arco-bg-2! relative cursor-pointer overflow-hidden rounded-lg! shadow-sm! transition-all duration-200 before:absolute before:inset-x-0 before:top-0 before:h-1 before:bg-linear-to-r before:from-arco-primary before:to-transparent hover:shadow-md! ${l === e.id ? "border-arco-primary-6! bg-arco-primary-light-1/40! ring-arco-primary-6/20 ring-2! shadow-[0_18px_38px_rgb(var(--primary-6)/22%)]!" : "hover:border-arco-primary-6!"}`,
836
+ children: [
837
+ l === e.id ? /* @__PURE__ */ P(w, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
838
+ "recommended" in e && e.recommended ? /* @__PURE__ */ P(x, {
839
+ color: "arcoblue",
840
+ className: "absolute top-4 right-4 text-xs! font-bold!",
841
+ children: "HOT"
842
+ }) : null,
843
+ /* @__PURE__ */ F("div", {
844
+ className: "min-w-0 pr-16",
845
+ children: [/* @__PURE__ */ F(S.Text, {
846
+ className: "flex items-center text-3xl! leading-tight! font-bold!",
847
+ children: [d(e.points), /* @__PURE__ */ P("span", {
848
+ className: "ml-1 text-2xl",
849
+ children: "🪙"
850
+ })]
851
+ }), /* @__PURE__ */ P(S.Text, {
852
+ type: "secondary",
853
+ className: "mt-1 block! text-sm!",
854
+ children: r.pointsUnit
855
+ })]
856
+ }),
857
+ /* @__PURE__ */ P("div", {
858
+ className: "mt-7 flex w-full justify-end",
859
+ children: /* @__PURE__ */ F(S.Text, {
860
+ className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
861
+ children: ["$", e.price]
862
+ })
863
+ })
864
+ ]
865
+ })
866
+ }, e.id))
867
+ })
868
+ })]
869
+ })
870
+ });
871
+ }
872
+ //#endregion
873
+ //#region src/header/components/UserMenu.tsx
874
+ function Fe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: s }) {
875
+ let c = (e) => new Intl.NumberFormat().format(e);
876
+ return /* @__PURE__ */ F("div", {
877
+ className: "w-80 overflow-hidden rounded-xl border border-arco-border-2 bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)]",
878
+ children: [
879
+ /* @__PURE__ */ F("div", {
880
+ className: "flex items-center gap-3 px-6 pt-5 pb-4",
881
+ children: [/* @__PURE__ */ P($, {
882
+ user: e,
883
+ size: 48,
884
+ className: "shrink-0"
885
+ }), /* @__PURE__ */ F("div", {
886
+ className: "flex min-w-0 flex-1 flex-col gap-1",
887
+ children: [/* @__PURE__ */ F("div", {
888
+ className: "flex min-w-0 items-center gap-1.5",
889
+ children: [/* @__PURE__ */ P("span", {
890
+ className: "text-arco-text-1 truncate text-base leading-6 font-bold",
891
+ children: e?.nickname || e?.username
892
+ }), /* @__PURE__ */ P(o, {
893
+ type: "text",
894
+ size: "mini",
895
+ icon: /* @__PURE__ */ P(E, {}),
896
+ className: "text-arco-text-3 h-6! min-w-6! px-0!",
897
+ onClick: r
898
+ })]
899
+ }), e?.email ? /* @__PURE__ */ P("span", {
900
+ className: "text-arco-text-3 truncate text-xs leading-5",
901
+ children: e.email
902
+ }) : null]
903
+ })]
904
+ }),
905
+ /* @__PURE__ */ P(l, { className: "m-0!" }),
906
+ /* @__PURE__ */ F("ul", {
907
+ className: "flex flex-col gap-3.5 px-6 py-4",
908
+ children: [
909
+ /* @__PURE__ */ F("li", {
910
+ className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
911
+ children: [/* @__PURE__ */ P("span", { children: n.myPoints }), /* @__PURE__ */ P("strong", {
912
+ className: "text-arco-primary-6 text-base font-bold",
913
+ children: c(t.total)
914
+ })]
915
+ }),
916
+ /* @__PURE__ */ F("li", {
917
+ className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
918
+ children: [/* @__PURE__ */ P("span", { children: n.rechargePoints }), /* @__PURE__ */ P("strong", {
919
+ className: "text-arco-text-1 text-base font-bold",
920
+ children: c(t.recharge)
921
+ })]
922
+ }),
923
+ /* @__PURE__ */ F("li", {
924
+ className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
925
+ children: [/* @__PURE__ */ P("span", { children: n.giftedPoints }), /* @__PURE__ */ P("strong", {
926
+ className: "text-arco-text-1 text-base font-bold",
927
+ children: c(t.gifted)
928
+ })]
929
+ })
930
+ ]
931
+ }),
932
+ /* @__PURE__ */ P(l, { className: "m-0!" }),
933
+ /* @__PURE__ */ F("div", {
934
+ className: "flex flex-col gap-2 px-6 py-4",
935
+ children: [/* @__PURE__ */ P(o, {
936
+ type: "primary",
937
+ long: !0,
938
+ icon: /* @__PURE__ */ P(A, {}),
939
+ className: "h-10! rounded-md! font-semibold!",
940
+ onClick: i,
941
+ children: n.recharge
942
+ }), /* @__PURE__ */ P(o, {
943
+ long: !0,
944
+ icon: /* @__PURE__ */ P(D, {}),
945
+ className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! rounded-md! font-semibold!",
946
+ onClick: a,
947
+ children: n.pointsDetail
948
+ })]
949
+ }),
950
+ /* @__PURE__ */ P(l, { className: "m-0!" }),
951
+ /* @__PURE__ */ P("div", {
952
+ className: "px-6 py-4",
953
+ children: /* @__PURE__ */ P(o, {
954
+ icon: /* @__PURE__ */ P(j, {}),
955
+ type: "text",
956
+ status: "danger",
957
+ long: !0,
958
+ className: "flex! items-center justify-start gap-2 text-sm text-arco-text-2",
959
+ onClick: () => void s?.(),
960
+ children: n.logout
961
+ })
962
+ })
963
+ ]
964
+ });
965
+ }
966
+ //#endregion
967
+ //#region src/header/ManturHeader.tsx
968
+ var Ie = "https://mantur.ai/images/logo.png", Le = [
969
+ "from-arco-primary-light-1 to-arco-primary-light-2 text-arco-primary-6",
970
+ "from-arco-success-light-1 to-arco-success-light-2 text-arco-success-6",
971
+ "from-arco-warning-light-1 to-arco-warning-light-2 text-arco-warning-6",
972
+ "from-arco-danger-light-1 to-arco-danger-light-2 text-arco-danger-6"
973
+ ];
974
+ function Re(e, t = !1) {
975
+ return `flex h-8 min-h-8 w-8 min-w-8 flex-none items-center justify-center rounded-lg bg-linear-to-br font-bold leading-none ${Le[e % Le.length]} ${t ? "shadow-[inset_0_1px_3px_rgb(0_0_0/8%)]" : ""}`;
976
+ }
977
+ function ze(e) {
978
+ return e?.tenantName?.[0]?.toUpperCase() || "T";
979
+ }
980
+ function Be(e, t, n) {
981
+ let r = e?.roles?.map((e) => e.roleName).filter(Boolean);
982
+ return r?.length ? r.join(", ") : e?.isOwner ? t : n;
983
+ }
984
+ function Ve({ user: r, disabled: a = !1, brandSlot: o, children: s }) {
985
+ let [c, l] = i(() => X()), d = Z(c), [f, p] = i(!1), [g, _] = i(!1), [v, y] = i(!1), [b, x] = i(r), [S, C] = i([]), [w, E] = i(), [D, O] = i(!1), [k, A] = i({
986
+ total: 0,
987
+ recharge: 0,
988
+ gifted: 0
989
+ }), j = w?.tenantId || "", M = a, N = {
990
+ total: k.total ?? 0,
991
+ recharge: k.recharge ?? 0,
992
+ gifted: k.gifted ?? 0
993
+ }, ee = async (e) => {
994
+ let t = await se(e);
995
+ return t && x(t), t;
996
+ };
997
+ t(() => {
998
+ x(r);
999
+ }, [r]), t(() => {
1000
+ let e = (e) => {
1001
+ C(e.tenants), E(e.currentTenant);
1002
+ }, t = (t) => {
1003
+ t instanceof CustomEvent && e(t.detail);
1004
+ };
1005
+ return window.addEventListener(R, t), O(!0), de().then(e).catch((e) => {
1006
+ console.warn("Failed to refresh Mantur tenant context.", e), h.error(d.error);
1007
+ }).finally(() => O(!1)), () => {
1008
+ window.removeEventListener(R, t);
1009
+ };
1010
+ }, [d.error]), t(() => {
1011
+ let e = (e) => {
1012
+ e instanceof CustomEvent && A(e.detail);
1013
+ };
1014
+ return window.addEventListener(L, e), U().catch((e) => {
1015
+ console.warn("Failed to refresh Mantur user points.", e);
1016
+ }), () => {
1017
+ window.removeEventListener(L, e);
1018
+ };
1019
+ }, []), t(() => {
1020
+ let e = (e) => {
1021
+ l(e instanceof CustomEvent ? Y(e.detail) : X());
1022
+ };
1023
+ return window.addEventListener(J, e), window.addEventListener("storage", e), () => {
1024
+ window.removeEventListener(J, e), window.removeEventListener("storage", e);
1025
+ };
1026
+ }, []);
1027
+ let te = (e) => {
1028
+ h.success(e);
1029
+ }, ne = (e, t) => {
1030
+ console.error(t), h.error(e);
1031
+ }, I = e(async (e) => {
1032
+ if (!M && e !== j) try {
1033
+ O(!0);
1034
+ let t = await fe(e);
1035
+ C(t.tenants), E(t.currentTenant), te(d.switchedToTeam);
1036
+ } catch (e) {
1037
+ ne(d.error, e);
1038
+ } finally {
1039
+ O(!1);
1040
+ }
1041
+ }, [
1042
+ j,
1043
+ M,
1044
+ d.error,
1045
+ d.switchedToTeam
1046
+ ]), re = (e) => {
1047
+ let t = {
1048
+ total: N.total + e.points,
1049
+ recharge: N.recharge + e.points,
1050
+ gifted: N.gifted
1051
+ };
1052
+ A(t), window.dispatchEvent(new CustomEvent(L, { detail: t })), h.success(d.rechargeSuccess), _(!1);
1053
+ }, ie = n(() => /* @__PURE__ */ F(m, {
1054
+ className: "w-56 rounded-xl bg-arco-bg-popup shadow-[0_10px_28px_rgb(0_0_0/12%)] [&_.arco-menu-inner]:px-2 [&_.arco-menu-inner]:py-1",
1055
+ selectedKeys: j ? [j] : [],
1056
+ onClickMenuItem: I,
1057
+ children: [/* @__PURE__ */ P("div", {
1058
+ className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
1059
+ children: d.switchTeam
1060
+ }), S.map((e, t) => /* @__PURE__ */ P(m.Item, {
1061
+ className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
1062
+ children: /* @__PURE__ */ F("div", {
1063
+ className: "flex w-full items-center gap-3 leading-normal",
1064
+ children: [/* @__PURE__ */ P("div", {
1065
+ className: Re(t),
1066
+ children: ze(e)
1067
+ }), /* @__PURE__ */ F("div", {
1068
+ className: "flex min-w-0 flex-col justify-center gap-0.75",
1069
+ children: [/* @__PURE__ */ P("span", {
1070
+ className: "text-sm leading-5 font-medium text-arco-text-1",
1071
+ children: e.tenantName
1072
+ }), /* @__PURE__ */ P("span", {
1073
+ className: "text-xs leading-4 text-arco-text-3",
1074
+ children: Be(e, d.owner, d.member)
1075
+ })]
1076
+ })]
1077
+ })
1078
+ }, e.tenantId))]
1079
+ }), [
1080
+ I,
1081
+ j,
1082
+ S,
1083
+ d
1084
+ ]), z = /* @__PURE__ */ P(Fe, {
1085
+ user: b,
1086
+ points: N,
1087
+ text: d,
1088
+ onEditProfile: () => p(!0),
1089
+ onRecharge: () => _(!0),
1090
+ onPointsDetail: () => y(!0),
1091
+ onLogout: oe
1092
+ }), B = Math.max(0, S.findIndex((e) => e.tenantId === w?.tenantId));
1093
+ return /* @__PURE__ */ F("div", {
1094
+ className: "flex h-20 items-center justify-between bg-transparent pr-8 shadow-[0_2px_10px_rgb(0_0_0/2%)] backdrop-blur-md max-md:pr-4",
1095
+ children: [
1096
+ /* @__PURE__ */ F("div", {
1097
+ className: "flex items-center gap-6",
1098
+ children: [/* @__PURE__ */ F("div", {
1099
+ className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
1100
+ children: [/* @__PURE__ */ P("div", {
1101
+ className: "relative flex w-12 items-center justify-center overflow-hidden ",
1102
+ children: /* @__PURE__ */ P("img", {
1103
+ src: Ie,
1104
+ alt: "logo",
1105
+ className: "w-full object-contain",
1106
+ onError: (e) => {
1107
+ e.currentTarget.style.display = "none";
1108
+ }
1109
+ })
1110
+ }), o ?? /* @__PURE__ */ P("span", {
1111
+ className: "text-lg font-bold tracking-normal text-arco-text-1",
1112
+ children: d.title
1113
+ })]
1114
+ }), /* @__PURE__ */ P(u, {
1115
+ droplist: ie,
1116
+ trigger: "click",
1117
+ position: "bl",
1118
+ disabled: M,
1119
+ children: /* @__PURE__ */ F("div", {
1120
+ "aria-disabled": M,
1121
+ className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${M ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
1122
+ children: [
1123
+ /* @__PURE__ */ P("div", {
1124
+ className: Re(B, !0),
1125
+ children: ze(w)
1126
+ }),
1127
+ /* @__PURE__ */ F("div", {
1128
+ className: "flex min-w-0 flex-col",
1129
+ children: [/* @__PURE__ */ P("span", {
1130
+ className: "text-xs leading-none font-bold text-arco-text-1",
1131
+ children: D ? d.loading : w?.tenantName || d.loading
1132
+ }), /* @__PURE__ */ P("span", {
1133
+ className: "mt-1 text-[10px] leading-none text-arco-text-3",
1134
+ children: Be(w, d.owner, d.member)
1135
+ })]
1136
+ }),
1137
+ /* @__PURE__ */ P(T, { className: "ml-1 text-arco-text-3" })
1138
+ ]
1139
+ })
1140
+ })]
1141
+ }),
1142
+ /* @__PURE__ */ P("div", {
1143
+ className: "flex-1",
1144
+ children: s
1145
+ }),
1146
+ /* @__PURE__ */ F("div", {
1147
+ className: "flex items-center gap-4",
1148
+ children: [/* @__PURE__ */ F("div", {
1149
+ className: "flex items-center gap-4",
1150
+ children: [/* @__PURE__ */ P(Se, {}), /* @__PURE__ */ P(xe, {})]
1151
+ }), /* @__PURE__ */ P(u, {
1152
+ droplist: z,
1153
+ trigger: "click",
1154
+ position: "br",
1155
+ onVisibleChange: (e) => {
1156
+ e && U().catch((e) => {
1157
+ console.warn("Failed to refresh Mantur user points.", e);
1158
+ });
1159
+ },
1160
+ children: /* @__PURE__ */ F("div", {
1161
+ className: "hover:bg-arco-fill-2 flex cursor-pointer items-center gap-2.5 rounded-full border border-transparent p-1 pr-2 transition-all",
1162
+ children: [
1163
+ /* @__PURE__ */ F("div", {
1164
+ className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
1165
+ children: [/* @__PURE__ */ P($, {
1166
+ user: b,
1167
+ size: 36
1168
+ }), /* @__PURE__ */ P("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
1169
+ }),
1170
+ /* @__PURE__ */ P("div", {
1171
+ className: "hidden flex-col md:flex",
1172
+ children: /* @__PURE__ */ P("span", {
1173
+ className: "text-arco-text-1 text-sm font-medium",
1174
+ children: b?.nickname || b?.username
1175
+ })
1176
+ }),
1177
+ /* @__PURE__ */ P(T, { className: "text-arco-text-3 ml-1" })
1178
+ ]
1179
+ })
1180
+ })]
1181
+ }),
1182
+ /* @__PURE__ */ P(Me, {
1183
+ visible: f,
1184
+ user: b,
1185
+ labels: d,
1186
+ onCancel: () => p(!1),
1187
+ onSubmit: ee
1188
+ }),
1189
+ /* @__PURE__ */ P(Pe, {
1190
+ visible: g,
1191
+ user: b,
1192
+ points: N,
1193
+ text: d,
1194
+ onCancel: () => _(!1),
1195
+ onPay: re
1196
+ }),
1197
+ /* @__PURE__ */ P(Oe, {
1198
+ visible: v,
1199
+ points: N,
1200
+ text: d,
1201
+ onCancel: () => y(!1),
1202
+ onRecharge: () => _(!0)
1203
+ })
1204
+ ]
1205
+ });
1206
+ }
1207
+ //#endregion
1208
+ export { ye as LANGUAGE_SOURCE_STORAGE_KEY, ve as LANGUAGE_STORAGE_KEY, xe as LangSwitch, J as MANTUR_LANGUAGE_CHANGE_EVENT, ge as MANTUR_LANGUAGE_SOURCE_STORAGE_KEY, he as MANTUR_LANGUAGE_STORAGE_KEY, _e as MANTUR_MESSAGES, L as MANTUR_POINTS_REFRESH_EVENT, R as MANTUR_TENANT_CONTEXT_CHANGE_EVENT, Ve as ManturHeader, Se as ThemeSwitch, q as getManturCurrentTenant, Z as getManturMessages, le as getManturTenantContextSnapshot, K as getManturTenants, H as getManturUserPoints, X as getStoredManturLocale, Y as normalizeManturLocale, de as refreshManturTenantContext, U as refreshManturUserPoints, fe as switchAndRefreshManturTenant, ue as switchManturTenant };