@blocklet/ui-react 3.0.9 → 3.0.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.
Files changed (51) hide show
  1. package/lib/BlockletStudio/index.js +70 -71
  2. package/lib/ComponentInstaller/index.js +85 -88
  3. package/lib/ComponentInstaller/installer-item.js +47 -53
  4. package/lib/ComponentInstaller/use-component-installed.js +32 -38
  5. package/lib/ComponentManager/components/add-component.js +47 -50
  6. package/lib/ComponentManager/components/publish-component.js +30 -31
  7. package/lib/ComponentManager/components/resource-dialog.js +28 -30
  8. package/lib/Dashboard/index.d.ts +1 -1
  9. package/lib/Dashboard/index.js +59 -61
  10. package/lib/Footer/index.js +51 -52
  11. package/lib/Footer/internal-footer.js +43 -47
  12. package/lib/Footer/layout/standard.js +11 -12
  13. package/lib/Footer/links.js +25 -28
  14. package/lib/Footer/social-media.js +17 -17
  15. package/lib/Header/index.js +81 -83
  16. package/lib/Notifications/Snackbar.js +76 -77
  17. package/lib/Notifications/hooks/use-title.js +34 -34
  18. package/lib/Notifications/utils.js +56 -60
  19. package/lib/UserCenter/components/config-inviter.js +17 -18
  20. package/lib/UserCenter/components/danger-zone.js +49 -52
  21. package/lib/UserCenter/components/nft.js +44 -45
  22. package/lib/UserCenter/components/notification.js +92 -99
  23. package/lib/UserCenter/components/passport.js +22 -22
  24. package/lib/UserCenter/components/privacy.js +6 -6
  25. package/lib/UserCenter/components/settings.js +40 -43
  26. package/lib/UserCenter/components/status-dialog/date-picker.js +7 -8
  27. package/lib/UserCenter/components/status-dialog/index.js +112 -114
  28. package/lib/UserCenter/components/status-selector/duration-menu.js +35 -36
  29. package/lib/UserCenter/components/status-selector/index.js +13 -13
  30. package/lib/UserCenter/components/storage/action.js +21 -22
  31. package/lib/UserCenter/components/storage/delete.js +24 -24
  32. package/lib/UserCenter/components/third-party-login/index.js +53 -53
  33. package/lib/UserCenter/components/third-party-login/third-party-item.js +87 -89
  34. package/lib/UserCenter/components/user-center.js +198 -207
  35. package/lib/UserCenter/components/user-info/metadata.js +343 -353
  36. package/lib/UserCenter/components/user-info/switch-role.js +17 -20
  37. package/lib/UserCenter/components/user-info/user-basic-info.js +79 -82
  38. package/lib/UserCenter/components/user-info/user-info.js +40 -40
  39. package/lib/UserCenter/components/user-info/user-status.js +97 -99
  40. package/lib/UserCenter/components/user-info/utils.js +34 -35
  41. package/lib/UserSessions/components/user-session-info.js +25 -28
  42. package/lib/UserSessions/components/user-sessions.js +169 -181
  43. package/lib/blocklets.js +62 -72
  44. package/lib/common/domain-warning.js +31 -31
  45. package/lib/common/header-addons.d.ts +1 -1
  46. package/lib/common/header-addons.js +49 -53
  47. package/lib/common/notification-addon.js +29 -32
  48. package/lib/common/ws.js +17 -18
  49. package/lib/contexts/config-user-space.js +16 -19
  50. package/lib/utils.js +44 -48
  51. package/package.json +11 -11
@@ -1,25 +1,25 @@
1
- import { jsx as i, jsxs as m, Fragment as L } from "react/jsx-runtime";
2
- import { use as vr } from "react";
3
- import { Box as s, Typography as br, CircularProgress as yr, Divider as Pr } from "@mui/material";
4
- import { useMemoizedFn as C, useCreation as f, useRequest as or } from "ahooks";
5
- import kr from "p-wait-for";
6
- import { SessionContext as Cr } from "@arcblock/did-connect/lib/Session";
7
- import Dr from "@arcblock/ux/lib/Tabs";
8
- import F from "@arcblock/ux/lib/Empty";
9
- import Mr from "@arcblock/ux/lib/Button";
10
- import Sr from "@arcblock/ux/lib/Result";
11
- import { useConfirm as Wr } from "@arcblock/ux/lib/Dialog";
12
- import { translate as zr } from "@arcblock/ux/lib/Locale/util";
13
- import { useLocaleContext as Ur } from "@arcblock/ux/lib/Locale/context";
14
- import { ErrorFallback as Lr } from "@arcblock/ux/lib/ErrorBoundary";
15
- import { styled as fr } from "@arcblock/ux/lib/Theme";
16
- import Fr from "lodash/cloneDeep";
17
- import { joinURL as D, getQuery as Rr, withoutTrailingSlash as nr, withQuery as lr } from "ufo";
18
- import { PROFILE_URL as M } from "@arcblock/ux/lib/Util/constant";
19
- import Br from "../../Footer/index.js";
20
- import ar from "../../Header/index.js";
21
- import { translations as Ir } from "../libs/locales.js";
22
- import sr from "./user-info/user-basic-info.js";
1
+ import { jsx as e, jsxs as f, Fragment as D } from "react/jsx-runtime";
2
+ import { use as fe } from "react";
3
+ import { Box as a, Typography as pe, CircularProgress as me, Divider as he } from "@mui/material";
4
+ import { useMemoizedFn as y, useCreation as d, useRequest as Y } from "ahooks";
5
+ import xe from "p-wait-for";
6
+ import { SessionContext as ge } from "@arcblock/did-connect/lib/Session";
7
+ import ve from "@arcblock/ux/lib/Tabs";
8
+ import M from "@arcblock/ux/lib/Empty";
9
+ import be from "@arcblock/ux/lib/Button";
10
+ import we from "@arcblock/ux/lib/Result";
11
+ import { useConfirm as ye } from "@arcblock/ux/lib/Dialog";
12
+ import { translate as Ce } from "@arcblock/ux/lib/Locale/util";
13
+ import { useLocaleContext as ke } from "@arcblock/ux/lib/Locale/context";
14
+ import { ErrorFallback as Pe } from "@arcblock/ux/lib/ErrorBoundary";
15
+ import { styled as oe } from "@arcblock/ux/lib/Theme";
16
+ import Se from "lodash/cloneDeep";
17
+ import { joinURL as C, getQuery as De, withoutTrailingSlash as Z, withQuery as $ } from "ufo";
18
+ import { PROFILE_URL as k } from "@arcblock/ux/lib/Util/constant";
19
+ import Me from "../../Footer/index.js";
20
+ import ee from "../../Header/index.js";
21
+ import { translations as Te } from "../libs/locales.js";
22
+ import re from "./user-info/user-basic-info.js";
23
23
  import "@mui/icons-material";
24
24
  import "@iconify/react";
25
25
  import "@arcblock/ux/lib/DID";
@@ -30,15 +30,15 @@ import "@iconify-icons/material-symbols/settings-input-antenna-rounded";
30
30
  import "@arcblock/ux/lib/RelativeTime";
31
31
  import "@arcblock/ux/lib/UserCard/Content/shorten-label";
32
32
  import "./user-info/switch-role.js";
33
- import { formatBlockletInfo as jr, getLink as R, getLocalizedNavigation as Hr } from "../../blocklets.js";
34
- import Nr from "./passport.js";
35
- import _r from "./settings.js";
36
- import { client as dr } from "../../libs/client.js";
37
- import Er from "../../hooks/use-mobile.js";
38
- import { ConfigUserSpaceProvider as Or } from "../../contexts/config-user-space.js";
39
- import Qr from "./storage/index.js";
40
- import qr from "./nft.js";
41
- const B = D(M, "/nfts"), I = D(M, "/settings"), j = D(M, "/did-spaces"), ur = fr(s)(({ theme: v }) => ({
33
+ import { formatBlockletInfo as We, getLink as T, getLocalizedNavigation as ze } from "../../blocklets.js";
34
+ import Ae from "./passport.js";
35
+ import Ue from "./settings.js";
36
+ import { client as te } from "../../libs/client.js";
37
+ import Le from "../../hooks/use-mobile.js";
38
+ import { ConfigUserSpaceProvider as Be } from "../../contexts/config-user-space.js";
39
+ import Fe from "./storage/index.js";
40
+ import Re from "./nft.js";
41
+ const W = C(k, "/nfts"), z = C(k, "/settings"), A = C(k, "/did-spaces"), ie = oe(a)(({ theme: v }) => ({
42
42
  flex: 1,
43
43
  boxSizing: "border-box",
44
44
  padding: "0 16px",
@@ -52,7 +52,7 @@ const B = D(M, "/nfts"), I = D(M, "/settings"), j = D(M, "/did-spaces"), ur = fr
52
52
  [v.breakpoints.up("md")]: {
53
53
  flexDirection: "row"
54
54
  }
55
- })), H = fr(s)(({ theme: v }) => ({
55
+ })), U = oe(a)(({ theme: v }) => ({
56
56
  overflow: "hidden",
57
57
  flex: "revert",
58
58
  [v.breakpoints.up("md")]: {
@@ -64,50 +64,45 @@ const B = D(M, "/nfts"), I = D(M, "/settings"), j = D(M, "/did-spaces"), ur = fr
64
64
  }
65
65
  }
66
66
  }));
67
- function Le({
67
+ function Sr({
68
68
  children: v,
69
- notLoginContent: N = null,
70
- currentTab: x,
71
- contentProps: _ = {},
72
- disableAutoRedirect: E = !1,
73
- hideFooter: cr = !1,
74
- headerProps: pr = {},
75
- footerProps: mr = {},
76
- userDid: S = void 0,
77
- stickySidebar: O = !1,
78
- embed: Q = !1,
79
- onlyProfile: b = !1
69
+ notLoginContent: L = null,
70
+ currentTab: h,
71
+ contentProps: B = {},
72
+ disableAutoRedirect: F = !1,
73
+ hideFooter: ne = !1,
74
+ headerProps: se = {},
75
+ footerProps: ae = {},
76
+ userDid: P = void 0,
77
+ stickySidebar: R = !1,
78
+ embed: I = !1,
79
+ onlyProfile: w = !1
80
80
  // 只显示 profile 页面,用于 ArcSphere 只需要显示 Profile 的内容
81
81
  }) {
82
- var rr, er, tr;
83
- const { locale: g } = Ur(), d = Er({ key: "md" }), w = C((e, o = {}) => zr(Ir, e, g, "en", o)), W = vr(Cr), r = W == null ? void 0 : W.session, h = f(() => {
84
- var p;
85
- if (S)
86
- return S;
87
- const e = window.location.href, o = Rr(e);
88
- return o != null && o.did ? Array.isArray(o.did) ? o.did[0] : o.did : (p = r == null ? void 0 : r.user) == null ? void 0 : p.did;
89
- }, [(rr = r == null ? void 0 : r.user) == null ? void 0 : rr.did, S]), n = f(() => {
90
- var e;
91
- return r != null && r.user ? h === ((e = r == null ? void 0 : r.user) == null ? void 0 : e.did) : !1;
92
- }, [h, (er = r == null ? void 0 : r.user) == null ? void 0 : er.did]), l = or(
82
+ const { locale: x } = ke(), l = Le({ key: "md" }), g = y((r, o = {}) => Ce(Te, r, x, "en", o)), t = fe(ge)?.session, p = d(() => {
83
+ if (P)
84
+ return P;
85
+ const r = window.location.href, o = De(r);
86
+ return o?.did ? Array.isArray(o.did) ? o.did[0] : o.did : t?.user?.did;
87
+ }, [t?.user?.did, P]), i = d(() => t?.user ? p === t?.user?.did : !1, [p, t?.user?.did]), n = Y(
93
88
  // eslint-disable-next-line consistent-return
94
89
  async () => {
95
- if (await kr(() => r == null ? void 0 : r.initialized), n)
96
- return r.user;
97
- if (h)
98
- return dr.user.getUserPublicInfo({ did: h });
90
+ if (await xe(() => t?.initialized), i)
91
+ return t.user;
92
+ if (p)
93
+ return te.user.getUserPublicInfo({ did: p });
99
94
  },
100
95
  {
101
- refreshDeps: [h, n, r == null ? void 0 : r.initialized, r == null ? void 0 : r.user]
96
+ refreshDeps: [p, i, t?.initialized, t?.user]
102
97
  }
103
- ), q = C(() => n ? r.refresh() : l.refresh()), c = or(
104
- async () => l.data && x ? await dr.user.getUserPrivacyConfig({ did: h }) : null,
98
+ ), j = y(() => i ? t.refresh() : n.refresh()), m = Y(
99
+ async () => n.data && h ? await te.user.getUserPrivacyConfig({ did: p }) : null,
105
100
  {
106
- refreshDeps: [h, l.data, x],
101
+ refreshDeps: [p, n.data, h],
107
102
  loadingDelay: 300
108
103
  }
109
- ), { confirmHolder: G } = Wr({
110
- fullScreen: d,
104
+ ), { confirmHolder: H } = ye({
105
+ fullScreen: l,
111
106
  sx: {
112
107
  ".MuiDialog-paper": {
113
108
  borderRadius: 1,
@@ -126,74 +121,71 @@ function Le({
126
121
  }
127
122
  }
128
123
  }
129
- }), P = f(() => {
130
- const e = Fr(window.blocklet);
124
+ }), N = d(() => {
125
+ const r = Se(window.blocklet);
131
126
  try {
132
- return jr(e);
127
+ return We(r);
133
128
  } catch (o) {
134
- return console.error("Failed to format blocklet info", o, e), e;
129
+ return console.error("Failed to format blocklet info", o, r), r;
135
130
  }
136
- }, []), J = f(() => {
137
- const e = {
138
- label: w("common.nft"),
131
+ }, []), _ = d(() => {
132
+ const r = {
133
+ label: g("common.nft"),
139
134
  protected: !1,
140
135
  isPrivate: !1,
141
136
  // true: 隐私数据,仅自己可见
142
- value: B,
143
- url: R(B, g)
137
+ value: W,
138
+ url: T(W, x)
144
139
  };
145
- let o = [e];
146
- return n && (o = [
147
- e,
140
+ let o = [r];
141
+ return i && (o = [
142
+ r,
148
143
  {
149
- label: w("common.setting"),
144
+ label: g("common.setting"),
150
145
  protected: !0,
151
146
  isPrivate: !0,
152
- value: I,
153
- url: R(I, g)
147
+ value: z,
148
+ url: T(z, x)
154
149
  },
155
150
  {
156
- label: w("storageManagement"),
151
+ label: g("storageManagement"),
157
152
  protected: !0,
158
153
  isPrivate: !0,
159
- value: j,
160
- url: R(j, g)
154
+ value: A,
155
+ url: T(A, x)
161
156
  }
162
157
  ]), o;
163
- }, [n, g]), a = f(() => {
164
- var y;
165
- const e = ((y = P == null ? void 0 : P.navigation) == null ? void 0 : y.userCenter) || [];
166
- return (Hr(e, g) || []).concat(J).map((u) => {
167
- var k, ir;
168
- const U = u.value ?? u._rawLink ?? u.link ?? u.url;
158
+ }, [i, x]), c = d(() => {
159
+ const r = N?.navigation?.userCenter || [];
160
+ return (ze(r, x) || []).concat(_).map((u) => {
161
+ const X = u.value ?? u._rawLink ?? u.link ?? u.url;
169
162
  return {
170
- value: U,
163
+ value: X,
171
164
  label: u.title || u.label,
172
165
  url: u.link || u.url,
173
- protected: ((k = c == null ? void 0 : c.data) == null ? void 0 : k[U]) ?? !1,
174
- isPrivate: u.isPrivate || u.private || (((ir = u == null ? void 0 : u._rawLink) == null ? void 0 : ir.includes("/customer")) ?? !1)
166
+ protected: m?.data?.[X] ?? !1,
167
+ isPrivate: u.isPrivate || u.private || (u?._rawLink?.includes("/customer") ?? !1)
175
168
  // FIXME: HACK: 隐藏 /customer 菜单, 需要一个通用的解决方案,在嵌入的时候就决定是否是私有的
176
169
  // icon: x.icon,
177
170
  };
178
- }).filter((u) => n || !u.isPrivate);
179
- }, [P, l.data, c == null ? void 0 : c.data, g, J, n]), t = f(() => a.find((e) => nr(e.value) === nr(x)), [a]), hr = C((e) => {
180
- const o = a.find((p) => p.value === e);
181
- o && (window.location.href = lr(o.url, {
182
- did: n ? void 0 : h
171
+ }).filter((u) => i || !u.isPrivate);
172
+ }, [N, n.data, m?.data, x, _, i]), s = d(() => c.find((r) => Z(r.value) === Z(h)), [c]), le = y((r) => {
173
+ const o = c.find((b) => b.value === r);
174
+ o && (window.location.href = $(o.url, {
175
+ did: i ? void 0 : p
183
176
  }));
184
- }), K = f(() => /* @__PURE__ */ i(
185
- _r,
177
+ }), E = d(() => /* @__PURE__ */ e(
178
+ Ue,
186
179
  {
187
- user: l.data,
188
- settings: { userCenterTabs: a },
189
- onSave: async (e) => e === "privacy" ? (await c.runAsync(), c.data) : (e === "profile" && await r.refresh(), null),
190
- isMobile: d
180
+ user: n.data,
181
+ settings: { userCenterTabs: c },
182
+ onSave: async (r) => r === "privacy" ? (await m.runAsync(), m.data) : (r === "profile" && await t.refresh(), null),
183
+ isMobile: l
191
184
  }
192
- ), [l.data, a, c.data, c.runAsync]), V = f(() => t && (t == null ? void 0 : t.value) === I, [t]), X = f(() => t && (t == null ? void 0 : t.value) === D(M, "/profile") || (t == null ? void 0 : t.value) === B, [t]), xr = f(() => t && (t == null ? void 0 : t.value) === j, [t]), gr = r.useOAuth(), wr = r.usePasskey(), Y = C(() => {
193
- var e, o;
194
- ((e = r == null ? void 0 : r.user) == null ? void 0 : e.sourceProvider) === "passkey" ? wr.switchPassport(r.user) : ["google", "apple", "email", "github"].includes(((o = r == null ? void 0 : r.user) == null ? void 0 : o.sourceProvider) ?? "") ? gr.switchOAuthPassport(r.user) : r && r.switchPassport();
195
- }), z = f(() => X ? /* @__PURE__ */ m(
196
- s,
185
+ ), [n.data, c, m.data, m.runAsync]), O = d(() => s && s?.value === z, [s]), q = d(() => s && s?.value === C(k, "/profile") || s?.value === W, [s]), de = d(() => s && s?.value === A, [s]), ce = t.useOAuth(), ue = t.usePasskey(), Q = y(() => {
186
+ t?.user?.sourceProvider === "passkey" ? ue.switchPassport(t.user) : ["google", "apple", "email", "github"].includes(t?.user?.sourceProvider ?? "") ? ce.switchOAuthPassport(t.user) : t && t.switchPassport();
187
+ }), S = d(() => q ? /* @__PURE__ */ f(
188
+ a,
197
189
  {
198
190
  sx: {
199
191
  display: "flex",
@@ -201,37 +193,37 @@ function Le({
201
193
  gap: 2.5
202
194
  },
203
195
  children: [
204
- n ? /* @__PURE__ */ m(s, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
205
- /* @__PURE__ */ i(
206
- br,
196
+ i ? /* @__PURE__ */ f(a, { sx: { border: "1px solid", borderColor: "divider", borderRadius: 1.5, p: 2 }, children: [
197
+ /* @__PURE__ */ e(
198
+ pe,
207
199
  {
208
200
  sx: {
209
201
  color: "text.primary",
210
202
  fontWeight: 600,
211
203
  mb: 2.5
212
204
  },
213
- children: w("passport")
205
+ children: g("passport")
214
206
  }
215
207
  ),
216
- /* @__PURE__ */ i(Nr, { user: l.data })
208
+ /* @__PURE__ */ e(Ae, { user: n.data })
217
209
  ] }) : null,
218
- /* @__PURE__ */ i(qr, { user: l.data })
210
+ /* @__PURE__ */ e(Re, { user: n.data })
219
211
  ]
220
212
  }
221
- ) : V && n ? K : xr && n ? /* @__PURE__ */ i(Or, { children: /* @__PURE__ */ i(Qr, {}) }) : null, [V, X, l, n, O, K]), Z = f(() => /* @__PURE__ */ i(
222
- s,
213
+ ) : O && i ? E : de && i ? /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(Fe, {}) }) : null, [O, q, n, i, R, E]), G = d(() => /* @__PURE__ */ e(
214
+ a,
223
215
  {
224
216
  sx: {
225
217
  display: {
226
- xs: n ? "none" : "block",
218
+ xs: i ? "none" : "block",
227
219
  md: "block"
228
220
  },
229
221
  py: 3
230
222
  },
231
- children: /* @__PURE__ */ i(F, { children: w("emptyContent") })
223
+ children: /* @__PURE__ */ e(M, { children: g("emptyContent") })
232
224
  }
233
- ), [n, g]), $ = f(() => !c.data || c.loading ? /* @__PURE__ */ i(
234
- s,
225
+ ), [i, x]), J = d(() => !m.data || m.loading ? /* @__PURE__ */ e(
226
+ a,
235
227
  {
236
228
  sx: {
237
229
  height: "100%",
@@ -242,28 +234,27 @@ function Le({
242
234
  alignItems: "center",
243
235
  flex: 1
244
236
  },
245
- children: /* @__PURE__ */ i(yr, {})
237
+ children: /* @__PURE__ */ e(me, {})
246
238
  }
247
239
  ) : (
248
240
  // eslint-disable-next-line react/jsx-no-useless-fragment
249
- /* @__PURE__ */ i(s, { sx: { flex: 1 }, children: t != null && t.protected && !n ? /* @__PURE__ */ i(s, { children: /* @__PURE__ */ i(F, { children: w("underProtected") }) }) : (
241
+ /* @__PURE__ */ e(a, { sx: { flex: 1 }, children: s?.protected && !i ? /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(M, { children: g("underProtected") }) }) : (
250
242
  // eslint-disable-next-line react/jsx-no-useless-fragment
251
- /* @__PURE__ */ i(L, { children: v ? /* @__PURE__ */ i(s, { ..._, children: v }) : /* @__PURE__ */ i(L, { children: z }) })
243
+ /* @__PURE__ */ e(D, { children: v ? /* @__PURE__ */ e(a, { ...B, children: v }) : /* @__PURE__ */ e(D, { children: S }) })
252
244
  ) })
253
- ), [c, t, n, v, _, z, g]), T = f(() => {
254
- var e, o, p, y;
255
- if (l.loading || r.loading)
245
+ ), [m, s, i, v, B, S, x]), K = d(() => {
246
+ if (n.loading || t.loading)
256
247
  return null;
257
- if (l.error) {
258
- if (((o = (e = l.error) == null ? void 0 : e.response) == null ? void 0 : o.status) === 404)
259
- return /* @__PURE__ */ i(s, { sx: { width: "100%" }, children: /* @__PURE__ */ i(Sr, { status: 404, description: w("noUserFound") }) });
260
- const k = {
261
- message: ((y = (p = l.error.response) == null ? void 0 : p.data) == null ? void 0 : y.error) || l.error.message || "error occurred"
248
+ if (n.error) {
249
+ if (n.error?.response?.status === 404)
250
+ return /* @__PURE__ */ e(a, { sx: { width: "100%" }, children: /* @__PURE__ */ e(we, { status: 404, description: g("noUserFound") }) });
251
+ const b = {
252
+ message: n.error.response?.data?.error || n.error.message || "error occurred"
262
253
  };
263
- return /* @__PURE__ */ i(s, { sx: { width: "100%" }, children: /* @__PURE__ */ i(Lr, { error: k }) });
254
+ return /* @__PURE__ */ e(a, { sx: { width: "100%" }, children: /* @__PURE__ */ e(Pe, { error: b }) });
264
255
  }
265
- return !h && !l.data ? N || /* @__PURE__ */ i(s, { sx: { width: "100%" }, children: /* @__PURE__ */ m(
266
- s,
256
+ return !p && !n.data ? L || /* @__PURE__ */ e(a, { sx: { width: "100%" }, children: /* @__PURE__ */ f(
257
+ a,
267
258
  {
268
259
  sx: {
269
260
  display: "flex",
@@ -273,54 +264,54 @@ function Le({
273
264
  gap: 1
274
265
  },
275
266
  children: [
276
- /* @__PURE__ */ i(F, { children: w("viewAfterLogin") }),
277
- /* @__PURE__ */ i(Mr, { size: "small", variant: "contained", onClick: () => r.login(), children: w("loginNow") })
267
+ /* @__PURE__ */ e(M, { children: g("viewAfterLogin") }),
268
+ /* @__PURE__ */ e(be, { size: "small", variant: "contained", onClick: () => t.login(), children: g("loginNow") })
278
269
  ]
279
270
  }
280
- ) }) : Q ? /* @__PURE__ */ m(H, { children: [
281
- a.length > 0 && x ? /* @__PURE__ */ i(
282
- s,
271
+ ) }) : I ? /* @__PURE__ */ f(U, { children: [
272
+ c.length > 0 && h ? /* @__PURE__ */ e(
273
+ a,
283
274
  {
284
275
  sx: {
285
- display: d ? "block" : "flex",
276
+ display: l ? "block" : "flex",
286
277
  height: "100%",
287
278
  overflow: "auto",
288
279
  padding: "1px"
289
280
  },
290
- children: $
281
+ children: J
291
282
  }
292
283
  ) : null,
293
- a.length === 0 && Z
294
- ] }) : b ? /* @__PURE__ */ i(H, { display: "flex", flexDirection: d ? "column" : "row", children: /* @__PURE__ */ i(
295
- sr,
284
+ c.length === 0 && G
285
+ ] }) : w ? /* @__PURE__ */ e(U, { display: "flex", flexDirection: l ? "column" : "row", children: /* @__PURE__ */ e(
286
+ re,
296
287
  {
297
- isMobile: d,
298
- order: d ? 1 : "unset",
299
- isMyself: n,
300
- switchPassport: Y,
301
- switchProfile: r.switchProfile,
302
- user: l.data,
288
+ isMobile: l,
289
+ order: l ? 1 : "unset",
290
+ isMyself: i,
291
+ switchPassport: Q,
292
+ switchProfile: t.switchProfile,
293
+ user: n.data,
303
294
  showFullDid: !1,
304
- onlyProfile: b,
305
- refreshProfile: q,
295
+ onlyProfile: w,
296
+ refreshProfile: j,
306
297
  sx: {
307
- padding: d ? "16px 0 0 0" : "40px 24px 24px 40px",
308
- ...d ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
298
+ padding: l ? "16px 0 0 0" : "40px 24px 24px 40px",
299
+ ...l ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
309
300
  boxSizing: "content-box"
310
301
  }
311
302
  }
312
- ) }) : /* @__PURE__ */ m(H, { display: "flex", flexDirection: d ? "column" : "row", children: [
313
- /* @__PURE__ */ m(
314
- s,
303
+ ) }) : /* @__PURE__ */ f(U, { display: "flex", flexDirection: l ? "column" : "row", children: [
304
+ /* @__PURE__ */ f(
305
+ a,
315
306
  {
316
307
  className: "user-center-tabs",
317
308
  sx: {
318
309
  flex: "1",
319
- order: d ? 2 : "unset"
310
+ order: l ? 2 : "unset"
320
311
  },
321
312
  children: [
322
- a.length > 0 && x ? /* @__PURE__ */ m(
323
- s,
313
+ c.length > 0 && h ? /* @__PURE__ */ f(
314
+ a,
324
315
  {
325
316
  sx: {
326
317
  display: "flex",
@@ -330,20 +321,20 @@ function Le({
330
321
  padding: "1px"
331
322
  },
332
323
  children: [
333
- /* @__PURE__ */ i(
334
- Dr,
324
+ /* @__PURE__ */ e(
325
+ ve,
335
326
  {
336
327
  orientation: "horizontal",
337
328
  variant: "line",
338
- tabs: a,
339
- current: (t == null ? void 0 : t.value) ?? x,
340
- onChange: hr,
329
+ tabs: c,
330
+ current: s?.value ?? h,
331
+ onChange: le,
341
332
  sx: {
342
333
  mb: 2,
343
334
  ".MuiTabs-flexContainer": {
344
335
  gap: 3,
345
336
  ".MuiButtonBase-root": {
346
- padding: d ? "16px 4px" : "40px 4px 32px 4px",
337
+ padding: l ? "16px 4px" : "40px 4px 32px 4px",
347
338
  fontSize: 16
348
339
  },
349
340
  ".MuiTab-root": {
@@ -366,60 +357,60 @@ function Le({
366
357
  }
367
358
  }
368
359
  ),
369
- $
360
+ J
370
361
  ]
371
362
  }
372
363
  ) : null,
373
- a.length === 0 && Z
364
+ c.length === 0 && G
374
365
  ]
375
366
  }
376
367
  ),
377
- !d && /* @__PURE__ */ i(Pr, { orientation: "vertical", sx: { ml: 5 } }),
378
- /* @__PURE__ */ i(
379
- sr,
368
+ !l && /* @__PURE__ */ e(he, { orientation: "vertical", sx: { ml: 5 } }),
369
+ /* @__PURE__ */ e(
370
+ re,
380
371
  {
381
- isMobile: d,
382
- order: d ? 1 : "unset",
383
- isMyself: n,
384
- switchPassport: Y,
385
- switchProfile: r.switchProfile,
386
- user: l.data,
387
- refreshProfile: q,
372
+ isMobile: l,
373
+ order: l ? 1 : "unset",
374
+ isMyself: i,
375
+ switchPassport: Q,
376
+ switchProfile: t.switchProfile,
377
+ user: n.data,
378
+ refreshProfile: j,
388
379
  showFullDid: !1,
389
380
  sx: {
390
- padding: d ? "16px 0 0 0" : "40px 24px 24px 40px",
391
- ...d ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
381
+ padding: l ? "16px 0 0 0" : "40px 24px 24px 40px",
382
+ ...l ? {} : { width: 320, maxWidth: 320, flexShrink: 0 },
392
383
  boxSizing: "content-box"
393
384
  }
394
385
  }
395
386
  )
396
387
  ] });
397
388
  }, [
398
- l,
399
- a,
400
389
  n,
401
- t,
402
390
  c,
403
- x,
404
- O,
405
- z
406
- ]), A = f(() => n ? !1 : t == null ? void 0 : t.isPrivate, [n, t]);
407
- if (f(() => b ? !1 : !E && !x && (a == null ? void 0 : a.length) > 0 || !t || A, [E, x, a, t, A, b])) {
408
- const e = (tr = a[0]) == null ? void 0 : tr.url, o = a.find((p) => p.value === e);
409
- return e && !(o != null && o.isPrivate) && window.location.replace(
410
- lr(e, {
411
- did: n ? void 0 : h
391
+ i,
392
+ s,
393
+ m,
394
+ h,
395
+ R,
396
+ S
397
+ ]), V = d(() => i ? !1 : s?.isPrivate, [i, s]);
398
+ if (d(() => w ? !1 : !F && !h && c?.length > 0 || !s || V, [F, h, c, s, V, w])) {
399
+ const r = c[0]?.url, o = c.find((b) => b.value === r);
400
+ return r && !o?.isPrivate && window.location.replace(
401
+ $(r, {
402
+ did: i ? void 0 : p
412
403
  })
413
404
  ), null;
414
405
  }
415
- return Q || b ? /* @__PURE__ */ m(L, { children: [
416
- /* @__PURE__ */ i(ar, { style: { display: "none" } }),
417
- /* @__PURE__ */ m(ur, { children: [
418
- T,
419
- G
406
+ return I || w ? /* @__PURE__ */ f(D, { children: [
407
+ /* @__PURE__ */ e(ee, { style: { display: "none" } }),
408
+ /* @__PURE__ */ f(ie, { children: [
409
+ K,
410
+ H
420
411
  ] })
421
- ] }) : /* @__PURE__ */ m(
422
- s,
412
+ ] }) : /* @__PURE__ */ f(
413
+ a,
423
414
  {
424
415
  sx: {
425
416
  minHeight: "100vh",
@@ -427,16 +418,16 @@ function Le({
427
418
  flexDirection: "column"
428
419
  },
429
420
  children: [
430
- /* @__PURE__ */ i(ar, { bordered: !0, ...pr, maxWidth: "100%" }),
431
- /* @__PURE__ */ m(ur, { children: [
432
- T,
433
- G
421
+ /* @__PURE__ */ e(ee, { bordered: !0, ...se, maxWidth: "100%" }),
422
+ /* @__PURE__ */ f(ie, { children: [
423
+ K,
424
+ H
434
425
  ] }),
435
- cr ? null : /* @__PURE__ */ i(
436
- Br,
426
+ ne ? null : /* @__PURE__ */ e(
427
+ Me,
437
428
  {
438
429
  bordered: !0,
439
- ...mr,
430
+ ...ae,
440
431
  sx: {
441
432
  ".MuiContainer-root": {
442
433
  maxWidth: 1600
@@ -449,5 +440,5 @@ function Le({
449
440
  );
450
441
  }
451
442
  export {
452
- Le as default
443
+ Sr as default
453
444
  };