mantur-components 0.1.5 → 0.1.7

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.
@@ -1,53 +1,53 @@
1
1
  import { useCallback as e, useEffect as t, useMemo as n, useRef as r, useState as i } from "react";
2
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 P } from "react-i18next";
5
- import { jsx as F, jsxs as I } from "react/jsx-runtime";
6
- import { useTheme as L } from "next-themes";
3
+ import { IconCheckCircleFill as w, IconDown as T, IconEdit as E, IconFile as D, IconLanguage as O, IconMoonFill as ee, IconPlus as k, IconPoweroff as A, IconSunFill as j, IconUpload as M } from "@arco-design/web-react/icon";
4
+ import { useTranslation as N } from "react-i18next";
5
+ import { jsx as P, jsxs as F } from "react/jsx-runtime";
6
+ import { useTheme as I } from "next-themes";
7
7
  //#region \0rolldown/runtime.js
8
- var R = Object.create, z = Object.defineProperty, B = Object.getOwnPropertyDescriptor, V = Object.getOwnPropertyNames, H = Object.getPrototypeOf, U = Object.prototype.hasOwnProperty, W = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), G = (e, t, n, r) => {
9
- if (t && typeof t == "object" || typeof t == "function") for (var i = V(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !U.call(e, s) && s !== n && z(e, s, {
8
+ var L = Object.create, R = Object.defineProperty, z = Object.getOwnPropertyDescriptor, B = Object.getOwnPropertyNames, V = Object.getPrototypeOf, H = Object.prototype.hasOwnProperty, te = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), ne = (e, t, n, r) => {
9
+ if (t && typeof t == "object" || typeof t == "function") for (var i = B(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !H.call(e, s) && s !== n && R(e, s, {
10
10
  get: ((e) => t[e]).bind(null, s),
11
- enumerable: !(r = B(t, s)) || r.enumerable
11
+ enumerable: !(r = z(t, s)) || r.enumerable
12
12
  });
13
13
  return e;
14
- }, K = (e, t, n) => (n = e == null ? {} : R(H(e)), G(t || !e || !e.__esModule ? z(n, "default", {
14
+ }, re = (e, t, n) => (n = e == null ? {} : L(V(e)), ne(t || !e || !e.__esModule ? R(n, "default", {
15
15
  value: e,
16
16
  enumerable: !0
17
- }) : n, e)), ee = "/api", te = "/users/me/points", q = "mantur-points-refresh", ne = "mantur-tenant-context-change";
18
- function re() {
19
- return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ee;
17
+ }) : n, e)), ie = "/api", ae = "/users/me/points", U = "mantur-points-refresh", oe = "mantur-tenant-context-change";
18
+ function se() {
19
+ return typeof window < "u" && window.__MANTUR_COMPONENTS_API_BASE__ ? window.__MANTUR_COMPONENTS_API_BASE__ : ie;
20
20
  }
21
- function ie() {
22
- return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : te;
21
+ function ce() {
22
+ return typeof window < "u" && window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ ? window.__MANTUR_COMPONENTS_POINTS_ENDPOINT__ : ae;
23
23
  }
24
- function ae(e) {
24
+ function W(e) {
25
25
  if (typeof document > "u") return;
26
26
  let t = `${encodeURIComponent(e)}=`;
27
27
  return document.cookie.split("; ").find((e) => e.startsWith(t))?.slice(t.length);
28
28
  }
29
- function oe(e) {
29
+ function G(e) {
30
30
  if (typeof document > "u") return;
31
31
  let t = encodeURIComponent(e), n = window.location.hostname, r = [void 0, n], i = n.split(".");
32
32
  i.length >= 2 && r.push(`.${i.slice(-2).join(".")}`), r.forEach((e) => {
33
33
  document.cookie = `${t}=; path=/; max-age=0${e ? `; domain=${e}` : ""}`;
34
34
  });
35
35
  }
36
- function se(e) {
36
+ function le(e) {
37
37
  let t = JSON.parse(e || "null");
38
38
  if (!t) throw Error("Request failed");
39
39
  if (t.code !== 0) throw Error(t.message || "Request failed");
40
40
  return t;
41
41
  }
42
- async function J(e, t = {}) {
43
- let n = ae("front-token"), r = ae("Accept-Language"), i = t.headers || {};
42
+ async function K(e, t = {}) {
43
+ let n = W("front-token"), r = W("Accept-Language"), i = t.headers || {};
44
44
  return n && (i.Authorization = decodeURIComponent(n)), r && (i["Accept-Language"] = decodeURIComponent(r)), new Promise((n, r) => {
45
45
  let a = new XMLHttpRequest();
46
- a.open(t.method || "GET", `${re()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
46
+ a.open(t.method || "GET", `${se()}${e}`, !0), a.timeout = t.timeout || 1e4, Object.entries(i).forEach(([e, t]) => {
47
47
  a.setRequestHeader(e, t);
48
48
  }), a.onload = () => {
49
49
  try {
50
- let e = se(a.responseText);
50
+ let e = le(a.responseText);
51
51
  if (a.status < 200 || a.status >= 300) {
52
52
  r(Error(e.message || a.statusText));
53
53
  return;
@@ -59,31 +59,31 @@ async function J(e, t = {}) {
59
59
  }, a.onerror = () => r(/* @__PURE__ */ Error("Network request failed")), a.ontimeout = () => r(/* @__PURE__ */ Error("Network request timed out")), a.send(t.body ?? null);
60
60
  });
61
61
  }
62
- async function ce() {
62
+ async function ue() {
63
63
  try {
64
- await J("/auth/front-logout", { method: "DELETE" });
64
+ await K("/auth/front-logout", { method: "DELETE" });
65
65
  } catch (e) {
66
66
  console.warn("Logout request failed, continuing local logout.", e);
67
67
  } finally {
68
- oe("front-token"), oe("refreshToken"), typeof window < "u" && window.location.reload();
68
+ G("front-token"), G("refreshToken"), typeof window < "u" && window.location.reload();
69
69
  }
70
70
  }
71
- async function le(e) {
71
+ async function de(e) {
72
72
  let t;
73
73
  if (e.avatarFile) {
74
74
  let n = new FormData();
75
- n.append("file", e.avatarFile), t = (await J("/users/me/avatar", {
75
+ n.append("file", e.avatarFile), t = (await K("/users/me/avatar", {
76
76
  method: "POST",
77
77
  body: n
78
78
  })).data;
79
79
  }
80
- return (await J("/users/me", {
80
+ return (await K("/users/me", {
81
81
  method: "PUT",
82
82
  headers: { "Content-Type": "application/json;charset=utf-8" },
83
83
  body: JSON.stringify({ nickname: e.nickname })
84
84
  })).data || t;
85
85
  }
86
- function ue(e) {
86
+ function fe(e) {
87
87
  let t = (...t) => {
88
88
  let n = t.map((t) => e?.[t]).find((e) => e !== void 0);
89
89
  return typeof n == "number" ? n : Number(n || 0);
@@ -94,14 +94,14 @@ function ue(e) {
94
94
  gifted: t("gifted", "giftedPoints", "bonusPoints")
95
95
  };
96
96
  }
97
- async function de() {
98
- return ue((await J(ie())).data);
97
+ async function pe() {
98
+ return fe((await K(ce())).data);
99
99
  }
100
- async function fe() {
101
- let e = await de();
102
- return typeof window < "u" && window.dispatchEvent(new CustomEvent(q, { detail: e })), e;
100
+ async function q() {
101
+ let e = await pe();
102
+ return typeof window < "u" && window.dispatchEvent(new CustomEvent(U, { detail: e })), e;
103
103
  }
104
- function pe(e, t) {
104
+ function me(e, t) {
105
105
  return t?.tenantId ? e.find((e) => e.tenantId === t.tenantId) || {
106
106
  tenantId: t.tenantId,
107
107
  tenantName: t.tenantName || t.tenantId,
@@ -111,35 +111,35 @@ function pe(e, t) {
111
111
  }))
112
112
  } : e.find((e) => e.isOwner) || e[0];
113
113
  }
114
- function me(e) {
115
- typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(ne, { detail: e })));
114
+ function J(e) {
115
+ typeof window < "u" && (window.__MANTUR_COMPONENTS_TENANT_CONTEXT__ = e, window.dispatchEvent(new CustomEvent(oe, { detail: e })));
116
116
  }
117
117
  async function he() {
118
- return (await J("/users/me/tenants")).data || [];
118
+ return (await K("/users/me/tenants")).data || [];
119
119
  }
120
120
  async function ge() {
121
- return (await J("/auth/current-tenant")).data;
121
+ return (await K("/auth/current-tenant")).data;
122
122
  }
123
123
  async function _e(e) {
124
- return (await J(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
124
+ return (await K(`/auth/current-tenant/${e}`, { method: "PUT" })).data;
125
125
  }
126
126
  async function ve(e = "refresh") {
127
127
  let [t, n] = await Promise.all([he(), ge()]), r = {
128
128
  tenants: t,
129
- currentTenant: pe(t, n),
129
+ currentTenant: me(t, n),
130
130
  auth: n,
131
131
  reason: e
132
132
  };
133
- return me(r), r;
133
+ return J(r), r;
134
134
  }
135
135
  async function ye(e) {
136
136
  let t = await _e(e), n = await he(), r = {
137
137
  tenants: n,
138
- currentTenant: pe(n, t),
138
+ currentTenant: me(n, t),
139
139
  auth: t,
140
140
  reason: "switch"
141
141
  };
142
- return me(r), r;
142
+ return J(r), r;
143
143
  }
144
144
  var be = {
145
145
  title: "Mantur",
@@ -279,33 +279,33 @@ function Ae(e, t) {
279
279
  document.cookie = `${encodeURIComponent(e)}=${encodeURIComponent(t)}; path=/`;
280
280
  }
281
281
  function je() {
282
- let { i18n: e } = P(), [n, r] = i(() => Z()), a = De(n);
282
+ let { i18n: e } = N(), [n, r] = i(() => Z()), a = De(n);
283
283
  return t(() => {
284
284
  r(X(e.language));
285
- }, [e.language]), /* @__PURE__ */ F(u, {
286
- droplist: /* @__PURE__ */ I(m, {
285
+ }, [e.language]), /* @__PURE__ */ P(u, {
286
+ droplist: /* @__PURE__ */ F(m, {
287
287
  selectedKeys: [n],
288
288
  onClickMenuItem: (t) => {
289
289
  let n = X(t);
290
290
  localStorage.setItem(Oe, t), localStorage.setItem(ke, "manual"), r(n), e.changeLanguage(t), Ae("Accept-Language", t), window.dispatchEvent(new CustomEvent(Y, { detail: n })), window.location.reload();
291
291
  },
292
- children: [/* @__PURE__ */ F(m.Item, { children: a.languageZh }, "zh-CN"), /* @__PURE__ */ F(m.Item, { children: a.languageEn }, "en-US")]
292
+ children: [/* @__PURE__ */ P(m.Item, { children: a.languageZh }, "zh-CN"), /* @__PURE__ */ P(m.Item, { children: a.languageEn }, "en-US")]
293
293
  }),
294
294
  trigger: "click",
295
295
  position: "br",
296
- children: /* @__PURE__ */ F(o, {
296
+ children: /* @__PURE__ */ P(o, {
297
297
  shape: "circle",
298
- icon: /* @__PURE__ */ F(O, {})
298
+ icon: /* @__PURE__ */ P(O, {})
299
299
  })
300
300
  });
301
301
  }
302
302
  //#endregion
303
303
  //#region src/theme-switch/ThemeSwitch.tsx
304
304
  function Me() {
305
- let { resolvedTheme: e, setTheme: t } = L();
306
- return /* @__PURE__ */ F(o, {
305
+ let { resolvedTheme: e, setTheme: t } = I();
306
+ return /* @__PURE__ */ P(o, {
307
307
  shape: "circle",
308
- icon: F(e === "light" ? k : M, {}),
308
+ icon: P(e === "light" ? ee : j, {}),
309
309
  onClick: () => {
310
310
  t(e === "light" ? "dark" : "light");
311
311
  }
@@ -427,12 +427,12 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
427
427
  {
428
428
  title: r.pointsDetail,
429
429
  dataIndex: "name",
430
- render: (e, t) => /* @__PURE__ */ I("div", {
430
+ render: (e, t) => /* @__PURE__ */ F("div", {
431
431
  className: "min-w-0",
432
- children: [/* @__PURE__ */ F(S.Text, {
432
+ children: [/* @__PURE__ */ P(S.Text, {
433
433
  className: "font-medium!",
434
434
  children: t.name
435
- }), /* @__PURE__ */ F(S.Text, {
435
+ }), /* @__PURE__ */ P(S.Text, {
436
436
  type: "secondary",
437
437
  className: "mt-1 block! text-xs!",
438
438
  children: t.meta
@@ -444,7 +444,7 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
444
444
  dataIndex: "amount",
445
445
  width: 120,
446
446
  align: "right",
447
- render: (e, t) => /* @__PURE__ */ I(S.Text, {
447
+ render: (e, t) => /* @__PURE__ */ F(S.Text, {
448
448
  className: `font-semibold! ${t.amount > 0 ? "text-arco-success-6!" : "text-arco-danger-6!"}`,
449
449
  children: [t.amount > 0 ? "+" : "", E(t.amount)]
450
450
  })
@@ -454,23 +454,23 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
454
454
  dataIndex: "badgeText",
455
455
  width: 110,
456
456
  align: "right",
457
- render: (e, t) => /* @__PURE__ */ F(x, {
457
+ render: (e, t) => /* @__PURE__ */ P(x, {
458
458
  color: Le(t.badgeKind),
459
459
  children: t.badgeText
460
460
  })
461
461
  }
462
462
  ];
463
- return /* @__PURE__ */ F(g, {
463
+ return /* @__PURE__ */ P(g, {
464
464
  title: r.pointsDetail,
465
465
  visible: e,
466
- footer: /* @__PURE__ */ I("div", {
466
+ footer: /* @__PURE__ */ F("div", {
467
467
  className: "flex justify-end gap-2",
468
- children: [/* @__PURE__ */ F(o, {
468
+ children: [/* @__PURE__ */ P(o, {
469
469
  onClick: a,
470
470
  children: r.close
471
- }), /* @__PURE__ */ F(o, {
471
+ }), /* @__PURE__ */ P(o, {
472
472
  type: "primary",
473
- icon: /* @__PURE__ */ F(A, {}),
473
+ icon: /* @__PURE__ */ P(k, {}),
474
474
  onClick: () => {
475
475
  a(), c();
476
476
  },
@@ -482,131 +482,131 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
482
482
  width: 780,
483
483
  maxWidth: "calc(100vw - 48px)"
484
484
  },
485
- children: /* @__PURE__ */ I("div", {
485
+ children: /* @__PURE__ */ F("div", {
486
486
  className: "max-h-[70vh] overflow-y-auto",
487
487
  children: [
488
- /* @__PURE__ */ I(s, {
488
+ /* @__PURE__ */ F(s, {
489
489
  bordered: !1,
490
490
  className: "from-arco-primary-light-1/40 to-cyan-400/5 rounded-none! bg-linear-to-br!",
491
491
  children: [
492
- /* @__PURE__ */ F(S.Text, {
492
+ /* @__PURE__ */ P(S.Text, {
493
493
  type: "secondary",
494
494
  className: "text-xs!",
495
495
  children: r.totalBalance
496
496
  }),
497
- /* @__PURE__ */ I("div", {
497
+ /* @__PURE__ */ F("div", {
498
498
  className: "mt-1.5 mb-3.5 ",
499
- children: [/* @__PURE__ */ F(S.Text, {
499
+ children: [/* @__PURE__ */ P(S.Text, {
500
500
  className: "text-3xl! font-bold!",
501
501
  children: E(t.total)
502
- }), /* @__PURE__ */ I(S.Text, {
502
+ }), /* @__PURE__ */ F(S.Text, {
503
503
  type: "secondary",
504
504
  className: "ml-2 text-sm! ",
505
505
  children: ["🪙 ", r.pointsUnit]
506
506
  })]
507
507
  }),
508
- /* @__PURE__ */ I(f.Row, {
508
+ /* @__PURE__ */ F(f.Row, {
509
509
  gutter: 12,
510
- children: [/* @__PURE__ */ F(f.Col, {
510
+ children: [/* @__PURE__ */ P(f.Col, {
511
511
  span: 12,
512
- children: /* @__PURE__ */ I(s, {
512
+ children: /* @__PURE__ */ F(s, {
513
513
  size: "small",
514
- children: [/* @__PURE__ */ I("div", {
514
+ children: [/* @__PURE__ */ F("div", {
515
515
  className: "mb-1 flex items-center justify-between",
516
- children: [/* @__PURE__ */ F(S.Text, {
516
+ children: [/* @__PURE__ */ P(S.Text, {
517
517
  type: "secondary",
518
518
  className: "text-xs!",
519
519
  children: r.rechargePoints
520
- }), /* @__PURE__ */ F(x, {
520
+ }), /* @__PURE__ */ P(x, {
521
521
  color: "arcoblue",
522
522
  children: r.sourceRecharge
523
523
  })]
524
- }), /* @__PURE__ */ F(S.Text, {
524
+ }), /* @__PURE__ */ P(S.Text, {
525
525
  className: "text-lg! font-semibold!",
526
526
  children: E(t.recharge)
527
527
  })]
528
528
  })
529
- }), /* @__PURE__ */ F(f.Col, {
529
+ }), /* @__PURE__ */ P(f.Col, {
530
530
  span: 12,
531
- children: /* @__PURE__ */ I(s, {
531
+ children: /* @__PURE__ */ F(s, {
532
532
  size: "small",
533
- children: [/* @__PURE__ */ I("div", {
533
+ children: [/* @__PURE__ */ F("div", {
534
534
  className: "mb-1 flex items-center justify-between",
535
- children: [/* @__PURE__ */ F(S.Text, {
535
+ children: [/* @__PURE__ */ P(S.Text, {
536
536
  type: "secondary",
537
537
  className: "text-xs!",
538
538
  children: r.giftedPoints
539
- }), /* @__PURE__ */ F(x, {
539
+ }), /* @__PURE__ */ P(x, {
540
540
  color: "success",
541
541
  children: r.sourceGifted
542
542
  })]
543
- }), /* @__PURE__ */ F(S.Text, {
543
+ }), /* @__PURE__ */ P(S.Text, {
544
544
  className: "text-lg! font-semibold!",
545
545
  children: E(t.gifted)
546
546
  })]
547
547
  })
548
548
  })]
549
549
  }),
550
- /* @__PURE__ */ F(S.Text, {
550
+ /* @__PURE__ */ P(S.Text, {
551
551
  type: "secondary",
552
552
  className: "mt-2.5 block! text-xs!",
553
553
  children: r.pointsDeductionTip
554
554
  })
555
555
  ]
556
556
  }),
557
- /* @__PURE__ */ I("div", {
557
+ /* @__PURE__ */ F("div", {
558
558
  className: "px-6 py-4",
559
559
  children: [
560
- /* @__PURE__ */ I(b, {
560
+ /* @__PURE__ */ F(b, {
561
561
  activeTab: l,
562
562
  onChange: (e) => u(e),
563
563
  children: [
564
- /* @__PURE__ */ F(b.TabPane, { title: r.all }, "all"),
565
- /* @__PURE__ */ F(b.TabPane, { title: r.income }, "income"),
566
- /* @__PURE__ */ F(b.TabPane, { title: r.expense }, "expense")
564
+ /* @__PURE__ */ P(b.TabPane, { title: r.all }, "all"),
565
+ /* @__PURE__ */ P(b.TabPane, { title: r.income }, "income"),
566
+ /* @__PURE__ */ P(b.TabPane, { title: r.expense }, "expense")
567
567
  ]
568
568
  }),
569
- /* @__PURE__ */ I("div", {
569
+ /* @__PURE__ */ F("div", {
570
570
  className: "mt-2 mb-3.5 flex flex-wrap items-center gap-2.5",
571
571
  children: [
572
- /* @__PURE__ */ I(v, {
572
+ /* @__PURE__ */ F(v, {
573
573
  value: d,
574
574
  style: { width: 140 },
575
575
  onChange: (e) => p(e),
576
576
  children: [
577
- /* @__PURE__ */ F(v.Option, {
577
+ /* @__PURE__ */ P(v.Option, {
578
578
  value: "all",
579
579
  children: r.sourceAll
580
580
  }),
581
- /* @__PURE__ */ F(v.Option, {
581
+ /* @__PURE__ */ P(v.Option, {
582
582
  value: "recharge",
583
583
  children: r.sourceRecharge
584
584
  }),
585
- /* @__PURE__ */ F(v.Option, {
585
+ /* @__PURE__ */ P(v.Option, {
586
586
  value: "gift",
587
587
  children: r.sourceGifted
588
588
  })
589
589
  ]
590
590
  }),
591
- /* @__PURE__ */ F(Pe, {
591
+ /* @__PURE__ */ P(Pe, {
592
592
  value: m,
593
593
  onChange: (e) => C(e),
594
594
  style: { width: 260 }
595
595
  }),
596
- /* @__PURE__ */ F(o, {
596
+ /* @__PURE__ */ P(o, {
597
597
  onClick: () => h.success(r.refreshed),
598
598
  children: r.query
599
599
  })
600
600
  ]
601
601
  }),
602
- /* @__PURE__ */ F(y, {
602
+ /* @__PURE__ */ P(y, {
603
603
  rowKey: "id",
604
604
  columns: O,
605
605
  data: D,
606
606
  pagination: !1,
607
607
  border: !1
608
608
  }),
609
- /* @__PURE__ */ F(_, {
609
+ /* @__PURE__ */ P(_, {
610
610
  className: "mt-3 flex justify-center!",
611
611
  current: w,
612
612
  pageSize: Ie,
@@ -615,13 +615,13 @@ function Re({ visible: e, points: t, text: r, onCancel: a, onRecharge: c }) {
615
615
  })
616
616
  ]
617
617
  }),
618
- /* @__PURE__ */ F(s, {
618
+ /* @__PURE__ */ P(s, {
619
619
  bordered: !1,
620
620
  className: "bg-arco-primary-light-1/30 rounded-none!",
621
- children: /* @__PURE__ */ I(S.Text, {
621
+ children: /* @__PURE__ */ F(S.Text, {
622
622
  type: "secondary",
623
623
  className: "text-xs! leading-6!",
624
- children: [/* @__PURE__ */ I("strong", { children: [r.pointsNoteTitle, ":"] }), r.pointsAccountNote]
624
+ children: [/* @__PURE__ */ F("strong", { children: [r.pointsNoteTitle, ":"] }), r.pointsAccountNote]
625
625
  })
626
626
  })
627
627
  ]
@@ -669,7 +669,7 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
669
669
  }, T = (e) => {
670
670
  h.success(e);
671
671
  };
672
- return /* @__PURE__ */ F(g, {
672
+ return /* @__PURE__ */ P(g, {
673
673
  title: u.profileTitle,
674
674
  visible: e,
675
675
  onOk: async () => {
@@ -689,35 +689,35 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
689
689
  confirmLoading: m,
690
690
  okText: u.profileSave,
691
691
  cancelText: u.profileCancel,
692
- children: /* @__PURE__ */ I(d, {
692
+ children: /* @__PURE__ */ F(d, {
693
693
  form: f,
694
694
  layout: "vertical",
695
- children: [/* @__PURE__ */ F(d.Item, {
695
+ children: [/* @__PURE__ */ P(d.Item, {
696
696
  label: u.profileNickname,
697
697
  field: "nickname",
698
698
  rules: [{
699
699
  required: !0,
700
700
  message: u.profileNicknamePlaceholder
701
701
  }],
702
- children: /* @__PURE__ */ F(p, {
702
+ children: /* @__PURE__ */ P(p, {
703
703
  placeholder: u.profileNicknamePlaceholder,
704
704
  allowClear: !0
705
705
  })
706
- }), /* @__PURE__ */ F(d.Item, {
706
+ }), /* @__PURE__ */ P(d.Item, {
707
707
  label: u.profileAvatar,
708
- children: /* @__PURE__ */ I("div", {
708
+ children: /* @__PURE__ */ F("div", {
709
709
  className: "flex flex-col gap-2",
710
- children: [/* @__PURE__ */ I("div", {
710
+ children: [/* @__PURE__ */ F("div", {
711
711
  className: "flex items-center gap-3",
712
- children: [/* @__PURE__ */ F(a, {
712
+ children: [/* @__PURE__ */ P(a, {
713
713
  size: 64,
714
714
  className: "shrink-0 bg-arco-primary-light-1!",
715
- children: b || n?.avatar ? /* @__PURE__ */ F("img", {
715
+ children: b || n?.avatar ? /* @__PURE__ */ P("img", {
716
716
  src: b || n?.avatar,
717
717
  alt: "",
718
718
  className: "block h-full w-full object-cover"
719
719
  }) : n?.nickname?.[0] || n?.username?.[0] || "U"
720
- }), /* @__PURE__ */ F(C, {
720
+ }), /* @__PURE__ */ P(C, {
721
721
  accept: "image/*",
722
722
  showUploadList: !1,
723
723
  beforeUpload: async (e) => {
@@ -734,14 +734,14 @@ function We({ visible: e, user: n, labels: s, onCancel: c, onSubmit: l }) {
734
734
  return S.current = n, n;
735
735
  }), y(e), !1;
736
736
  },
737
- children: /* @__PURE__ */ F(o, {
737
+ children: /* @__PURE__ */ P(o, {
738
738
  type: "outline",
739
739
  size: "small",
740
- icon: /* @__PURE__ */ F(N, {}),
740
+ icon: /* @__PURE__ */ P(M, {}),
741
741
  children: u.profileUploadAvatar
742
742
  })
743
743
  })]
744
- }), /* @__PURE__ */ F("span", {
744
+ }), /* @__PURE__ */ P("span", {
745
745
  className: "text-xs text-arco-text-3",
746
746
  children: u.profileAvatarHint
747
747
  })]
@@ -756,10 +756,10 @@ function Ge(e) {
756
756
  return e?.nickname?.[0] || e?.username?.[0] || "U";
757
757
  }
758
758
  function $({ user: e, size: t, className: n = "" }) {
759
- return /* @__PURE__ */ F(a, {
759
+ return /* @__PURE__ */ P(a, {
760
760
  size: t,
761
761
  className: `bg-arco-primary/20! text-arco-primary-6 border-2 font-bold ${n}`,
762
- children: e?.avatar ? /* @__PURE__ */ F("img", {
762
+ children: e?.avatar ? /* @__PURE__ */ P("img", {
763
763
  src: e.avatar,
764
764
  alt: "avatar",
765
765
  className: "h-full w-full object-cover"
@@ -770,15 +770,15 @@ function $({ user: e, size: t, className: n = "" }) {
770
770
  //#region src/header/components/RechargeModal.tsx
771
771
  function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c }) {
772
772
  let [l, u] = i(Q[2].id), d = (e) => new Intl.NumberFormat().format(e), p = Q.find((e) => e.id === l) || Q[0];
773
- return /* @__PURE__ */ F(g, {
773
+ return /* @__PURE__ */ P(g, {
774
774
  title: r.rechargeTitle,
775
775
  visible: e,
776
- footer: /* @__PURE__ */ I("div", {
776
+ footer: /* @__PURE__ */ F("div", {
777
777
  className: "mx-auto flex max-w-7xl items-center justify-between gap-5",
778
- children: [/* @__PURE__ */ F("span", {
778
+ children: [/* @__PURE__ */ P("span", {
779
779
  className: "text-arco-text-2 text-sm leading-6",
780
780
  children: r.rechargeHint
781
- }), /* @__PURE__ */ I(o, {
781
+ }), /* @__PURE__ */ F(o, {
782
782
  type: "primary",
783
783
  size: "large",
784
784
  className: "min-w-48! font-bold!",
@@ -800,35 +800,35 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
800
800
  paddingBottom: 0
801
801
  },
802
802
  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!",
803
- children: /* @__PURE__ */ I("div", {
803
+ children: /* @__PURE__ */ F("div", {
804
804
  className: "mx-auto flex h-full w-full max-w-7xl flex-col items-center ",
805
- children: [/* @__PURE__ */ I("div", {
805
+ children: [/* @__PURE__ */ F("div", {
806
806
  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",
807
- children: [/* @__PURE__ */ F($, {
807
+ children: [/* @__PURE__ */ P($, {
808
808
  user: t,
809
809
  size: 32,
810
810
  className: "shrink-0"
811
- }), /* @__PURE__ */ I("span", { children: [
811
+ }), /* @__PURE__ */ F("span", { children: [
812
812
  t?.nickname || t?.username,
813
813
  " · ",
814
814
  r.currentBalance,
815
815
  " ",
816
- /* @__PURE__ */ F("strong", {
816
+ /* @__PURE__ */ P("strong", {
817
817
  className: "text-arco-text-1",
818
818
  children: d(n.total)
819
819
  }),
820
820
  " ",
821
821
  r.pointsUnit
822
822
  ] })]
823
- }), /* @__PURE__ */ F("div", {
823
+ }), /* @__PURE__ */ P("div", {
824
824
  className: "mt-6 w-full",
825
- children: /* @__PURE__ */ F(f.Row, {
825
+ children: /* @__PURE__ */ P(f.Row, {
826
826
  gutter: [16, 16],
827
- children: Q.map((e) => /* @__PURE__ */ F(f.Col, {
827
+ children: Q.map((e) => /* @__PURE__ */ P(f.Col, {
828
828
  xs: 24,
829
829
  sm: 12,
830
830
  lg: 6,
831
- children: /* @__PURE__ */ I(s, {
831
+ children: /* @__PURE__ */ F(s, {
832
832
  hoverable: !0,
833
833
  role: "button",
834
834
  tabIndex: 0,
@@ -844,29 +844,29 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
844
844
  },
845
845
  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!"}`,
846
846
  children: [
847
- l === e.id ? /* @__PURE__ */ F(w, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
848
- "recommended" in e && e.recommended ? /* @__PURE__ */ F(x, {
847
+ l === e.id ? /* @__PURE__ */ P(w, { className: "text-arco-primary-6! absolute bottom-4 left-4 text-xl" }) : null,
848
+ "recommended" in e && e.recommended ? /* @__PURE__ */ P(x, {
849
849
  color: "arcoblue",
850
850
  className: "absolute top-4 right-4 text-xs! font-bold!",
851
851
  children: "HOT"
852
852
  }) : null,
853
- /* @__PURE__ */ I("div", {
853
+ /* @__PURE__ */ F("div", {
854
854
  className: "min-w-0 pr-16",
855
- children: [/* @__PURE__ */ I(S.Text, {
855
+ children: [/* @__PURE__ */ F(S.Text, {
856
856
  className: "flex items-center text-3xl! leading-tight! font-bold!",
857
- children: [d(e.points), /* @__PURE__ */ F("span", {
857
+ children: [d(e.points), /* @__PURE__ */ P("span", {
858
858
  className: "ml-1 text-2xl",
859
859
  children: "🪙"
860
860
  })]
861
- }), /* @__PURE__ */ F(S.Text, {
861
+ }), /* @__PURE__ */ P(S.Text, {
862
862
  type: "secondary",
863
863
  className: "mt-1 block! text-sm!",
864
864
  children: r.pointsUnit
865
865
  })]
866
866
  }),
867
- /* @__PURE__ */ F("div", {
867
+ /* @__PURE__ */ P("div", {
868
868
  className: "mt-7 flex w-full justify-end",
869
- children: /* @__PURE__ */ I(S.Text, {
869
+ children: /* @__PURE__ */ F(S.Text, {
870
870
  className: "text-arco-primary-6! text-right text-2xl! leading-tight! font-bold!",
871
871
  children: ["$", e.price]
872
872
  })
@@ -883,85 +883,85 @@ function Ke({ visible: e, user: t, points: n, text: r, onCancel: a, onPay: c })
883
883
  //#region src/header/components/UserMenu.tsx
884
884
  function qe({ user: e, points: t, text: n, onEditProfile: r, onRecharge: i, onPointsDetail: a, onLogout: s }) {
885
885
  let c = (e) => new Intl.NumberFormat().format(e);
886
- return /* @__PURE__ */ I("div", {
886
+ return /* @__PURE__ */ F("div", {
887
887
  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%)]",
888
888
  children: [
889
- /* @__PURE__ */ I("div", {
889
+ /* @__PURE__ */ F("div", {
890
890
  className: "flex items-center gap-3 px-6 pt-5 pb-4",
891
- children: [/* @__PURE__ */ F($, {
891
+ children: [/* @__PURE__ */ P($, {
892
892
  user: e,
893
893
  size: 48,
894
894
  className: "shrink-0"
895
- }), /* @__PURE__ */ I("div", {
895
+ }), /* @__PURE__ */ F("div", {
896
896
  className: "flex min-w-0 flex-1 flex-col gap-1",
897
- children: [/* @__PURE__ */ I("div", {
897
+ children: [/* @__PURE__ */ F("div", {
898
898
  className: "flex min-w-0 items-center gap-1.5",
899
- children: [/* @__PURE__ */ F("span", {
899
+ children: [/* @__PURE__ */ P("span", {
900
900
  className: "text-arco-text-1 truncate text-base leading-6 font-bold",
901
901
  children: e?.nickname || e?.username
902
- }), /* @__PURE__ */ F(o, {
902
+ }), /* @__PURE__ */ P(o, {
903
903
  type: "text",
904
904
  size: "mini",
905
- icon: /* @__PURE__ */ F(E, {}),
905
+ icon: /* @__PURE__ */ P(E, {}),
906
906
  className: "text-arco-text-3 h-6! min-w-6! px-0!",
907
907
  onClick: r
908
908
  })]
909
- }), e?.email ? /* @__PURE__ */ F("span", {
909
+ }), e?.email ? /* @__PURE__ */ P("span", {
910
910
  className: "text-arco-text-3 truncate text-xs leading-5",
911
911
  children: e.email
912
912
  }) : null]
913
913
  })]
914
914
  }),
915
- /* @__PURE__ */ F(l, { className: "m-0!" }),
916
- /* @__PURE__ */ I("ul", {
915
+ /* @__PURE__ */ P(l, { className: "m-0!" }),
916
+ /* @__PURE__ */ F("ul", {
917
917
  className: "flex flex-col gap-3.5 px-6 py-4",
918
918
  children: [
919
- /* @__PURE__ */ I("li", {
919
+ /* @__PURE__ */ F("li", {
920
920
  className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
921
- children: [/* @__PURE__ */ F("span", { children: n.myPoints }), /* @__PURE__ */ F("strong", {
921
+ children: [/* @__PURE__ */ P("span", { children: n.myPoints }), /* @__PURE__ */ P("strong", {
922
922
  className: "text-arco-primary-6 text-base font-bold",
923
923
  children: c(t.total)
924
924
  })]
925
925
  }),
926
- /* @__PURE__ */ I("li", {
926
+ /* @__PURE__ */ F("li", {
927
927
  className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
928
- children: [/* @__PURE__ */ F("span", { children: n.rechargePoints }), /* @__PURE__ */ F("strong", {
928
+ children: [/* @__PURE__ */ P("span", { children: n.rechargePoints }), /* @__PURE__ */ P("strong", {
929
929
  className: "text-arco-text-1 text-base font-bold",
930
930
  children: c(t.recharge)
931
931
  })]
932
932
  }),
933
- /* @__PURE__ */ I("li", {
933
+ /* @__PURE__ */ F("li", {
934
934
  className: "text-arco-text-2 flex items-center justify-between gap-4 text-sm",
935
- children: [/* @__PURE__ */ F("span", { children: n.giftedPoints }), /* @__PURE__ */ F("strong", {
935
+ children: [/* @__PURE__ */ P("span", { children: n.giftedPoints }), /* @__PURE__ */ P("strong", {
936
936
  className: "text-arco-text-1 text-base font-bold",
937
937
  children: c(t.gifted)
938
938
  })]
939
939
  })
940
940
  ]
941
941
  }),
942
- /* @__PURE__ */ F(l, { className: "m-0!" }),
943
- /* @__PURE__ */ I("div", {
942
+ /* @__PURE__ */ P(l, { className: "m-0!" }),
943
+ /* @__PURE__ */ F("div", {
944
944
  className: "flex flex-col gap-2 px-6 py-4",
945
- children: [/* @__PURE__ */ F(o, {
945
+ children: [/* @__PURE__ */ P(o, {
946
946
  type: "primary",
947
947
  long: !0,
948
- icon: /* @__PURE__ */ F(A, {}),
948
+ icon: /* @__PURE__ */ P(k, {}),
949
949
  className: "h-10! rounded-md! font-semibold!",
950
950
  onClick: i,
951
951
  children: n.recharge
952
- }), /* @__PURE__ */ F(o, {
952
+ }), /* @__PURE__ */ P(o, {
953
953
  long: !0,
954
- icon: /* @__PURE__ */ F(D, {}),
954
+ icon: /* @__PURE__ */ P(D, {}),
955
955
  className: "border-arco-border-2! bg-arco-fill-1! text-arco-text-1! h-10! rounded-md! font-semibold!",
956
956
  onClick: a,
957
957
  children: n.pointsDetail
958
958
  })]
959
959
  }),
960
- /* @__PURE__ */ F(l, { className: "m-0!" }),
961
- /* @__PURE__ */ F("div", {
960
+ /* @__PURE__ */ P(l, { className: "m-0!" }),
961
+ /* @__PURE__ */ P("div", {
962
962
  className: "px-6 py-4",
963
- children: /* @__PURE__ */ F(o, {
964
- icon: /* @__PURE__ */ F(j, {}),
963
+ children: /* @__PURE__ */ P(o, {
964
+ icon: /* @__PURE__ */ P(A, {}),
965
965
  type: "text",
966
966
  status: "danger",
967
967
  long: !0,
@@ -992,38 +992,38 @@ function Qe(e, t, n) {
992
992
  return r?.length ? r.join(", ") : e?.isOwner ? t : n;
993
993
  }
994
994
  function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantContextChange: l }) {
995
- let [d, f] = i(() => Z()), p = De(d), [g, _] = i(!1), [v, y] = i(!1), [b, x] = i(!1), [S, C] = i(a), [w, E] = i([]), [D, O] = i(), [k, A] = i(!1), j = r(l), [M, N] = i({
995
+ let [d, f] = i(() => Z()), p = De(d), [g, _] = i(!1), [v, y] = i(!1), [b, x] = i(!1), [S, C] = i(a), [w, E] = i([]), [D, O] = i(), [ee, k] = i(!1), A = r(l), [j, M] = i({
996
996
  total: 0,
997
997
  recharge: 0,
998
998
  gifted: 0
999
- }), P = D?.tenantId || "", L = o, R = {
1000
- total: M.total ?? 0,
1001
- recharge: M.recharge ?? 0,
1002
- gifted: M.gifted ?? 0
1003
- }, z = async (e) => {
1004
- let t = await le(e);
999
+ }), N = D?.tenantId || "", I = o, L = {
1000
+ total: j.total ?? 0,
1001
+ recharge: j.recharge ?? 0,
1002
+ gifted: j.gifted ?? 0
1003
+ }, R = async (e) => {
1004
+ let t = await de(e);
1005
1005
  return t && C(t), t;
1006
1006
  };
1007
1007
  t(() => {
1008
1008
  C(a);
1009
1009
  }, [a]), t(() => {
1010
- j.current = l;
1010
+ A.current = l;
1011
1011
  }, [l]);
1012
- let B = e((e) => {
1013
- E(e.tenants), O(e.currentTenant), j.current?.(e);
1012
+ let z = e((e) => {
1013
+ E(e.tenants), O(e.currentTenant), A.current?.(e);
1014
1014
  }, []);
1015
1015
  t(() => {
1016
- A(!0), ve().then(B).catch((e) => {
1016
+ k(!0), ve().then(z).catch((e) => {
1017
1017
  console.warn("Failed to refresh Mantur tenant context.", e), h.error(p.error);
1018
- }).finally(() => A(!1));
1019
- }, [B, p.error]), t(() => {
1018
+ }).finally(() => k(!1));
1019
+ }, [z, p.error]), t(() => {
1020
1020
  let e = (e) => {
1021
- e instanceof CustomEvent && N(e.detail);
1021
+ e instanceof CustomEvent && M(e.detail);
1022
1022
  };
1023
- return window.addEventListener(q, e), fe().catch((e) => {
1023
+ return window.addEventListener(U, e), q().catch((e) => {
1024
1024
  console.warn("Failed to refresh Mantur user points.", e);
1025
1025
  }), () => {
1026
- window.removeEventListener(q, e);
1026
+ window.removeEventListener(U, e);
1027
1027
  };
1028
1028
  }, []), t(() => {
1029
1029
  let e = (e) => {
@@ -1033,51 +1033,51 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
1033
1033
  window.removeEventListener(Y, e), window.removeEventListener("storage", e);
1034
1034
  };
1035
1035
  }, []);
1036
- let V = (e) => {
1036
+ let B = (e) => {
1037
1037
  h.success(e);
1038
- }, H = (e, t) => {
1038
+ }, V = (e, t) => {
1039
1039
  console.error(t), h.error(e);
1040
- }, U = e(async (e) => {
1041
- if (!L && e !== P) try {
1042
- A(!0), B(await ye(e)), V(p.switchedToTeam);
1040
+ }, H = e(async (e) => {
1041
+ if (!I && e !== N) try {
1042
+ k(!0), z(await ye(e)), B(p.switchedToTeam);
1043
1043
  } catch (e) {
1044
- H(p.error, e);
1044
+ V(p.error, e);
1045
1045
  } finally {
1046
- A(!1);
1046
+ k(!1);
1047
1047
  }
1048
1048
  }, [
1049
- B,
1050
- P,
1051
- L,
1049
+ z,
1050
+ N,
1051
+ I,
1052
1052
  p.error,
1053
1053
  p.switchedToTeam
1054
- ]), W = (e) => {
1054
+ ]), te = (e) => {
1055
1055
  let t = {
1056
- total: R.total + e.points,
1057
- recharge: R.recharge + e.points,
1058
- gifted: R.gifted
1056
+ total: L.total + e.points,
1057
+ recharge: L.recharge + e.points,
1058
+ gifted: L.gifted
1059
1059
  };
1060
- N(t), window.dispatchEvent(new CustomEvent(q, { detail: t })), h.success(p.rechargeSuccess), y(!1);
1061
- }, G = n(() => /* @__PURE__ */ I(m, {
1060
+ M(t), window.dispatchEvent(new CustomEvent(U, { detail: t })), h.success(p.rechargeSuccess), y(!1);
1061
+ }, ne = n(() => /* @__PURE__ */ F(m, {
1062
1062
  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",
1063
- selectedKeys: P ? [P] : [],
1064
- onClickMenuItem: U,
1065
- children: [/* @__PURE__ */ F("div", {
1063
+ selectedKeys: N ? [N] : [],
1064
+ onClickMenuItem: H,
1065
+ children: [/* @__PURE__ */ P("div", {
1066
1066
  className: "px-3 py-2 text-xs font-semibold tracking-[0.04em] text-arco-text-4 uppercase",
1067
1067
  children: p.switchTeam
1068
- }), w.map((e, t) => /* @__PURE__ */ F(m.Item, {
1068
+ }), w.map((e, t) => /* @__PURE__ */ P(m.Item, {
1069
1069
  className: "mb-1 h-auto! min-h-10! overflow-visible! rounded-lg! px-2! py-1! leading-normal!",
1070
- children: /* @__PURE__ */ I("div", {
1070
+ children: /* @__PURE__ */ F("div", {
1071
1071
  className: "flex w-full items-center gap-3 leading-normal",
1072
- children: [/* @__PURE__ */ F("div", {
1072
+ children: [/* @__PURE__ */ P("div", {
1073
1073
  className: Xe(t),
1074
1074
  children: Ze(e)
1075
- }), /* @__PURE__ */ I("div", {
1075
+ }), /* @__PURE__ */ F("div", {
1076
1076
  className: "flex min-w-0 flex-col justify-center gap-0.75",
1077
- children: [/* @__PURE__ */ F("span", {
1077
+ children: [/* @__PURE__ */ P("span", {
1078
1078
  className: "text-sm leading-5 font-medium text-arco-text-1",
1079
1079
  children: e.tenantName
1080
- }), /* @__PURE__ */ F("span", {
1080
+ }), /* @__PURE__ */ P("span", {
1081
1081
  className: "text-xs leading-4 text-arco-text-3",
1082
1082
  children: Qe(e, p.owner, p.member)
1083
1083
  })]
@@ -1085,29 +1085,29 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
1085
1085
  })
1086
1086
  }, e.tenantId))]
1087
1087
  }), [
1088
- U,
1089
- P,
1088
+ H,
1089
+ N,
1090
1090
  w,
1091
1091
  p
1092
- ]), K = /* @__PURE__ */ F(qe, {
1092
+ ]), re = /* @__PURE__ */ P(qe, {
1093
1093
  user: S,
1094
- points: R,
1094
+ points: L,
1095
1095
  text: p,
1096
1096
  onEditProfile: () => _(!0),
1097
1097
  onRecharge: () => y(!0),
1098
1098
  onPointsDetail: () => x(!0),
1099
- onLogout: ce
1100
- }), ee = Math.max(0, w.findIndex((e) => e.tenantId === D?.tenantId));
1101
- return /* @__PURE__ */ I("div", {
1099
+ onLogout: ue
1100
+ }), ie = Math.max(0, w.findIndex((e) => e.tenantId === D?.tenantId));
1101
+ return /* @__PURE__ */ F("div", {
1102
1102
  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",
1103
1103
  children: [
1104
- /* @__PURE__ */ I("div", {
1104
+ /* @__PURE__ */ F("div", {
1105
1105
  className: "flex items-center gap-6",
1106
- children: [/* @__PURE__ */ I("div", {
1106
+ children: [/* @__PURE__ */ F("div", {
1107
1107
  className: "flex w-65 items-center gap-3 px-8 max-md:w-auto max-md:px-4",
1108
- children: [/* @__PURE__ */ F("div", {
1108
+ children: [/* @__PURE__ */ P("div", {
1109
1109
  className: "relative flex w-12 items-center justify-center overflow-hidden ",
1110
- children: /* @__PURE__ */ F("img", {
1110
+ children: /* @__PURE__ */ P("img", {
1111
1111
  src: Je,
1112
1112
  alt: "logo",
1113
1113
  className: "w-full object-contain",
@@ -1115,96 +1115,96 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
1115
1115
  e.currentTarget.style.display = "none";
1116
1116
  }
1117
1117
  })
1118
- }), s ?? /* @__PURE__ */ F("span", {
1118
+ }), s ?? /* @__PURE__ */ P("span", {
1119
1119
  className: "text-lg font-bold tracking-normal text-arco-text-1",
1120
1120
  children: p.title
1121
1121
  })]
1122
- }), /* @__PURE__ */ F(u, {
1123
- droplist: G,
1122
+ }), /* @__PURE__ */ P(u, {
1123
+ droplist: ne,
1124
1124
  trigger: "click",
1125
1125
  position: "bl",
1126
- disabled: L,
1127
- children: /* @__PURE__ */ I("div", {
1128
- "aria-disabled": L,
1129
- className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${L ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
1126
+ disabled: I,
1127
+ children: /* @__PURE__ */ F("div", {
1128
+ "aria-disabled": I,
1129
+ className: `flex items-center gap-3 rounded-full border border-arco-border-1 bg-arco-bg-1 px-2 py-1.5 transition-all ${I ? "cursor-not-allowed opacity-60" : "cursor-pointer hover:bg-arco-fill-2 hover:shadow-[0_4px_12px_rgb(0_0_0/8%)]"}`,
1130
1130
  children: [
1131
- /* @__PURE__ */ F("div", {
1132
- className: Xe(ee, !0),
1131
+ /* @__PURE__ */ P("div", {
1132
+ className: Xe(ie, !0),
1133
1133
  children: Ze(D)
1134
1134
  }),
1135
- /* @__PURE__ */ I("div", {
1135
+ /* @__PURE__ */ F("div", {
1136
1136
  className: "flex min-w-0 flex-col",
1137
- children: [/* @__PURE__ */ F("span", {
1137
+ children: [/* @__PURE__ */ P("span", {
1138
1138
  className: "text-xs leading-none font-bold text-arco-text-1",
1139
- children: k ? p.loading : D?.tenantName || p.loading
1140
- }), /* @__PURE__ */ F("span", {
1139
+ children: ee ? p.loading : D?.tenantName || p.loading
1140
+ }), /* @__PURE__ */ P("span", {
1141
1141
  className: "mt-1 text-[10px] leading-none text-arco-text-3",
1142
1142
  children: Qe(D, p.owner, p.member)
1143
1143
  })]
1144
1144
  }),
1145
- /* @__PURE__ */ F(T, { className: "ml-1 text-arco-text-3" })
1145
+ /* @__PURE__ */ P(T, { className: "ml-1 text-arco-text-3" })
1146
1146
  ]
1147
1147
  })
1148
1148
  })]
1149
1149
  }),
1150
- /* @__PURE__ */ F("div", {
1150
+ /* @__PURE__ */ P("div", {
1151
1151
  className: "flex-1",
1152
1152
  children: c
1153
1153
  }),
1154
- /* @__PURE__ */ I("div", {
1154
+ /* @__PURE__ */ F("div", {
1155
1155
  className: "flex items-center gap-4",
1156
- children: [/* @__PURE__ */ I("div", {
1156
+ children: [/* @__PURE__ */ F("div", {
1157
1157
  className: "flex items-center gap-4",
1158
- children: [/* @__PURE__ */ F(Me, {}), /* @__PURE__ */ F(je, {})]
1159
- }), /* @__PURE__ */ F(u, {
1160
- droplist: K,
1158
+ children: [/* @__PURE__ */ P(Me, {}), /* @__PURE__ */ P(je, {})]
1159
+ }), /* @__PURE__ */ P(u, {
1160
+ droplist: re,
1161
1161
  trigger: "click",
1162
1162
  position: "br",
1163
1163
  onVisibleChange: (e) => {
1164
- e && fe().catch((e) => {
1164
+ e && q().catch((e) => {
1165
1165
  console.warn("Failed to refresh Mantur user points.", e);
1166
1166
  });
1167
1167
  },
1168
- children: /* @__PURE__ */ I("div", {
1168
+ children: /* @__PURE__ */ F("div", {
1169
1169
  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",
1170
1170
  children: [
1171
- /* @__PURE__ */ I("div", {
1171
+ /* @__PURE__ */ F("div", {
1172
1172
  className: "from-arco-primary to-transparent relative rounded-full bg-linear-to-br p-0.5 shadow-sm",
1173
- children: [/* @__PURE__ */ F($, {
1173
+ children: [/* @__PURE__ */ P($, {
1174
1174
  user: S,
1175
1175
  size: 36
1176
- }), /* @__PURE__ */ F("div", { className: "bg-arco-success border-arco-bg-white absolute right-0 bottom-0 h-3 w-3 rounded-full border-2 shadow-sm" })]
1176
+ }), /* @__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" })]
1177
1177
  }),
1178
- /* @__PURE__ */ F("div", {
1178
+ /* @__PURE__ */ P("div", {
1179
1179
  className: "hidden flex-col md:flex",
1180
- children: /* @__PURE__ */ F("span", {
1180
+ children: /* @__PURE__ */ P("span", {
1181
1181
  className: "text-arco-text-1 text-sm font-medium",
1182
1182
  children: S?.nickname || S?.username
1183
1183
  })
1184
1184
  }),
1185
- /* @__PURE__ */ F(T, { className: "text-arco-text-3 ml-1" })
1185
+ /* @__PURE__ */ P(T, { className: "text-arco-text-3 ml-1" })
1186
1186
  ]
1187
1187
  })
1188
1188
  })]
1189
1189
  }),
1190
- /* @__PURE__ */ F(We, {
1190
+ /* @__PURE__ */ P(We, {
1191
1191
  visible: g,
1192
1192
  user: S,
1193
1193
  labels: p,
1194
1194
  onCancel: () => _(!1),
1195
- onSubmit: z
1195
+ onSubmit: R
1196
1196
  }),
1197
- /* @__PURE__ */ F(Ke, {
1197
+ /* @__PURE__ */ P(Ke, {
1198
1198
  visible: v,
1199
1199
  user: S,
1200
- points: R,
1200
+ points: L,
1201
1201
  text: p,
1202
1202
  onCancel: () => y(!1),
1203
- onPay: W
1203
+ onPay: te
1204
1204
  }),
1205
- /* @__PURE__ */ F(Re, {
1205
+ /* @__PURE__ */ P(Re, {
1206
1206
  visible: b,
1207
- points: R,
1207
+ points: L,
1208
1208
  text: p,
1209
1209
  onCancel: () => x(!1),
1210
1210
  onRecharge: () => y(!0)
@@ -1214,7 +1214,7 @@ function $e({ user: a, disabled: o = !1, brandSlot: s, children: c, onTenantCont
1214
1214
  }
1215
1215
  //#endregion
1216
1216
  //#region src/utils/date.ts
1217
- var et = /* @__PURE__ */ K((/* @__PURE__ */ W(((e, t) => {
1217
+ var et = /* @__PURE__ */ re((/* @__PURE__ */ te(((e, t) => {
1218
1218
  (function(n, r) {
1219
1219
  typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n = typeof globalThis < "u" ? globalThis : n || self).dayjs = r();
1220
1220
  })(e, (function() {
@@ -1515,4 +1515,21 @@ function tt(e, t = "datetime", n) {
1515
1515
  return (0, et.default)(e).format(i);
1516
1516
  }
1517
1517
  //#endregion
1518
- export { $e as ManturHeader, tt as formatDateByLang };
1518
+ //#region src/utils/url.ts
1519
+ var nt = () => {
1520
+ if (typeof window > "u" || !window.location?.href) throw Error("redirectToManturMain requires currentUrl when window.location is unavailable.");
1521
+ return window.location.href;
1522
+ }, rt = (e, t) => {
1523
+ let n = e.split(".");
1524
+ return n.length <= 1 ? t : [t, ...n.slice(1)].join(".");
1525
+ }, it = (e) => `${e.pathname}${e.search}${e.hash}`;
1526
+ function at(e, t, n = {}) {
1527
+ let r = new URL(n.currentUrl || nt()), i = new URL(r.toString()), a = e?.trim();
1528
+ a ? i.hostname = rt(r.hostname, a) : i.port = "80";
1529
+ let o = it(r);
1530
+ i.searchParams.set("app", t?.trim()), i.searchParams.set("redirect", o);
1531
+ let s = i.toString();
1532
+ return n.navigate !== !1 && typeof window < "u" && (window.location.href = s), s;
1533
+ }
1534
+ //#endregion
1535
+ export { $e as ManturHeader, tt as formatDateByLang, at as redirectToManturMain };