@arcblock/did-connect-react 3.2.19 → 3.3.1

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 (54) hide show
  1. package/docs/assets/diagram/core-components-session-provider-01.ja.jpg +0 -0
  2. package/docs/assets/diagram/core-components-session-provider-01.jpg +0 -0
  3. package/docs/assets/diagram/core-components-session-provider-01.zh-TW.jpg +0 -0
  4. package/docs/assets/diagram/core-components-session-provider-01.zh.jpg +0 -0
  5. package/docs/assets/diagram/did-connect-diagram-0.ja.jpg +0 -0
  6. package/docs/assets/diagram/did-connect-diagram-0.jpg +0 -0
  7. package/docs/assets/diagram/did-connect-diagram-0.zh-TW.jpg +0 -0
  8. package/docs/assets/diagram/did-connect-diagram-0.zh.jpg +0 -0
  9. package/docs/assets/diagram/overview-01.ja.jpg +0 -0
  10. package/docs/assets/diagram/overview-01.jpg +0 -0
  11. package/docs/assets/diagram/overview-01.zh-TW.jpg +0 -0
  12. package/docs/assets/diagram/overview-01.zh.jpg +0 -0
  13. package/docs/assets/diagram/use-connect-diagram-0.ja.jpg +0 -0
  14. package/docs/assets/diagram/use-connect-diagram-0.jpg +0 -0
  15. package/docs/assets/diagram/use-connect-diagram-0.zh-TW.jpg +0 -0
  16. package/docs/assets/diagram/use-connect-diagram-0.zh.jpg +0 -0
  17. package/docs/core-components-did-connect.ja.md +3 -50
  18. package/docs/core-components-did-connect.md +5 -52
  19. package/docs/core-components-did-connect.zh-TW.md +3 -50
  20. package/docs/core-components-did-connect.zh.md +3 -50
  21. package/docs/core-components-session-provider.ja.md +3 -45
  22. package/docs/core-components-session-provider.md +3 -45
  23. package/docs/core-components-session-provider.zh-TW.md +3 -45
  24. package/docs/core-components-session-provider.zh.md +3 -45
  25. package/docs/hooks-use-connect.ja.md +3 -39
  26. package/docs/hooks-use-connect.md +4 -40
  27. package/docs/hooks-use-connect.zh-TW.md +3 -39
  28. package/docs/hooks-use-connect.zh.md +3 -39
  29. package/docs/overview.ja.md +3 -45
  30. package/docs/overview.md +3 -45
  31. package/docs/overview.zh-TW.md +3 -45
  32. package/docs/overview.zh.md +3 -45
  33. package/lib/Connect/assets/locale.js +4 -2
  34. package/lib/Connect/components/login-item/connect-choose-list.js +2 -2
  35. package/lib/Connect/components/login-item/connect-provider-list.js +299 -0
  36. package/lib/Connect/components/login-item/login-method-item.js +42 -41
  37. package/lib/Connect/hooks/provider-list.js +50 -0
  38. package/lib/Connect/index.js +180 -196
  39. package/lib/OAuth/context.js +33 -32
  40. package/lib/Passkey/context.js +64 -63
  41. package/lib/Session/hooks/use-verify.js +1 -1
  42. package/lib/Session/libs/locales.js +3 -3
  43. package/lib/package.json.js +1 -1
  44. package/package.json +9 -9
  45. package/src/Connect/assets/locale.js +2 -0
  46. package/src/Connect/components/login-item/connect-choose-list.jsx +5 -5
  47. package/src/Connect/components/login-item/connect-provider-list.jsx +392 -0
  48. package/src/Connect/components/login-item/login-method-item.jsx +31 -28
  49. package/src/Connect/hooks/provider-list.js +127 -0
  50. package/src/Connect/index.jsx +8 -27
  51. package/src/OAuth/context.jsx +10 -2
  52. package/src/Passkey/context.jsx +3 -0
  53. package/src/Session/hooks/use-verify.jsx +1 -1
  54. package/src/Session/libs/locales.js +3 -3
@@ -1,171 +1,160 @@
1
- import { jsx as t, jsxs as p, Fragment as He } from "react/jsx-runtime";
2
- import { use as Ve, useRef as ie, useState as qe, useEffect as se } from "react";
1
+ import { jsx as t, jsxs as p, Fragment as Le } from "react/jsx-runtime";
2
+ import { use as Be, useRef as re, useState as Fe, useEffect as ne } from "react";
3
3
  import e from "prop-types";
4
- import { Box as i, Skeleton as Ye, Divider as Ge } from "@mui/material";
5
- import { useUpdate as Ke, useSize as Qe, useCreation as f, useMount as ae, useMemoizedFn as M, useDebounceFn as Xe, usePrevious as Je, useUpdateEffect as Ze } from "ahooks";
4
+ import { Box as i, Skeleton as Ne, Divider as je } from "@mui/material";
5
+ import { useUpdate as He, useSize as Ve, useCreation as d, useMount as ie, useMemoizedFn as z, useDebounceFn as qe, usePrevious as Ye, useUpdateEffect as Ge } from "ahooks";
6
6
  import b from "lodash/noop";
7
- import $e from "lodash/isUndefined";
8
- import et from "@arcblock/ux/lib/CloseButton";
9
- import { LOGIN_PROVIDER as tt, OAUTH_PROVIDER as z, DID_CONNECT_MEDIUM_WIDTH as U, LOGIN_PROVIDER_NAME as ot, DID_CONNECT_SMALL_WIDTH as rt } from "@arcblock/ux/lib/Util/constant";
10
- import nt from "@arcblock/ux/lib/QRCode";
11
- import { withUxTheme as it, withContainer as st, DIDConnectFooter as at } from "@arcblock/ux/lib/DIDConnect";
12
- import { useTheme as ct } from "@arcblock/ux/lib/Theme";
13
- import lt from "@arcblock/ux/lib/DIDConnect/provider-icon";
7
+ import Ke from "lodash/isUndefined";
8
+ import Qe from "@arcblock/ux/lib/CloseButton";
9
+ import { LOGIN_PROVIDER as Xe, OAUTH_PROVIDER as L, DID_CONNECT_MEDIUM_WIDTH as M, LOGIN_PROVIDER_NAME as Je, DID_CONNECT_SMALL_WIDTH as Ze } from "@arcblock/ux/lib/Util/constant";
10
+ import $e from "@arcblock/ux/lib/QRCode";
11
+ import { withUxTheme as et, withContainer as tt, DIDConnectFooter as ot } from "@arcblock/ux/lib/DIDConnect";
12
+ import { useTheme as rt } from "@arcblock/ux/lib/Theme";
13
+ import nt from "@arcblock/ux/lib/DIDConnect/provider-icon";
14
14
  import "@fontsource/lexend/400.css";
15
15
  import "@fontsource/lexend/600.css";
16
- import ut from "./with-blocklet.js";
17
- import dt from "./with-bridge-call.js";
18
- import { default as mo } from "./hooks/security.js";
19
- import { SessionContext as ft } from "../Session/context.js";
20
- import { StateProvider as mt, useStateContext as pt } from "./contexts/state.js";
21
- import ht from "./components/login-item/connect-choose-list.js";
22
- import gt from "./components/auto-height.js";
23
- import bt from "./hooks/token.js";
24
- import { useOAuth as xt } from "../OAuth/context.js";
25
- import Ct from "./components/connect-status.js";
26
- import { usePasskey as wt } from "../Passkey/context.js";
27
- import { CHECK_STATUS_INTERVAL as yt, API_DID_PREFIX as kt, BUSY_STATUS as y, DEFAULT_TIMEOUT as St } from "../constant.js";
16
+ import it from "./with-blocklet.js";
17
+ import st from "./with-bridge-call.js";
18
+ import { default as co } from "./hooks/security.js";
19
+ import { SessionContext as ct } from "../Session/context.js";
20
+ import { StateProvider as at, useStateContext as lt } from "./contexts/state.js";
21
+ import ut from "./components/login-item/connect-provider-list.js";
22
+ import dt from "./components/auto-height.js";
23
+ import ft from "./hooks/token.js";
24
+ import { useOAuth as mt } from "../OAuth/context.js";
25
+ import pt from "./components/connect-status.js";
26
+ import { usePasskey as ht } from "../Passkey/context.js";
27
+ import { CHECK_STATUS_INTERVAL as xt, API_DID_PREFIX as bt, BUSY_STATUS as k, DEFAULT_TIMEOUT as gt } from "../constant.js";
28
28
  import "../utils.js";
29
- import It from "./components/did-connect-title.js";
30
- import Dt from "./components/download-tips.js";
31
- import Pt from "./hooks/method-list.js";
32
- import Tt from "./hooks/auth-url.js";
33
- import { getWalletDid as vt } from "../User/use-did.js";
34
- import { getWebWalletUrl as _t } from "@arcblock/ux/lib/Util/wallet";
35
- function ce({
36
- hideCloseButton: x = !1,
37
- mode: m = "dialog",
38
- action: k,
29
+ import Ct from "./components/did-connect-title.js";
30
+ import yt from "./components/download-tips.js";
31
+ import kt from "./hooks/provider-list.js";
32
+ import wt from "./hooks/auth-url.js";
33
+ import { getWalletDid as St } from "../User/use-did.js";
34
+ import { getWebWalletUrl as It } from "@arcblock/ux/lib/Util/wallet";
35
+ function se({
36
+ hideCloseButton: g = !1,
37
+ mode: f = "dialog",
38
+ action: w,
39
39
  baseUrl: h = "",
40
40
  checkFn: S,
41
- checkInterval: I = yt,
42
- checkTimeout: D = St * 1e3,
43
- prefix: P = kt,
41
+ checkInterval: I = xt,
42
+ checkTimeout: v = gt * 1e3,
43
+ prefix: D = bt,
44
44
  tokenKey: B = "_t_",
45
45
  locale: F = "en",
46
- encKey: ue = "_ek_",
47
- autoConnect: de = !0,
46
+ encKey: ae = "_ek_",
47
+ autoConnect: le = !0,
48
48
  forceConnected: N = !0,
49
- saveConnect: fe = !0,
50
- useSocket: me = !0,
49
+ saveConnect: ue = !0,
50
+ useSocket: de = !0,
51
51
  allowWallet: j = !0,
52
- provider: pe = "",
52
+ provider: fe = "",
53
53
  messages: u = {},
54
54
  passkeyBehavior: H = "none",
55
- webWalletUrl: V = _t(),
56
- enabledConnectTypes: q = ["web", "mobile", ...Object.keys(z)],
57
- extraContent: Y = null,
55
+ webWalletUrl: me = It(),
56
+ enabledConnectTypes: pe = ["web", "mobile", ...Object.keys(L)],
57
+ extraContent: V = null,
58
58
  disableSwitchApp: T = !1,
59
- magicToken: G = void 0,
59
+ magicToken: q = void 0,
60
60
  customItems: he = [],
61
- onClose: v = b,
62
- onError: K = b,
61
+ onClose: P = b,
62
+ onError: Y = b,
63
63
  onSuccess: _ = b,
64
- onRecreateSession: Q = b,
65
- setColor: ge = b
64
+ onRecreateSession: G = b,
65
+ setColor: xe = b
66
66
  }) {
67
- const R = ct(), X = Ke(), be = Ve(ft), xe = vt(be?.session?.user), {
68
- t: J,
67
+ const R = rt(), K = He(), be = Be(ct), ge = St(be?.session?.user), {
68
+ t: Q,
69
69
  staticState: Ce,
70
70
  connectState: s,
71
- extraParams: we,
72
- currentAppInfo: ye,
71
+ extraParams: ye,
72
+ currentAppInfo: ke,
73
73
  currentAppColor: O,
74
74
  // 插件相关
75
- selectedPlugin: a,
76
- blocklet: Z,
77
- masterBlocklet: ke
78
- } = pt(), { state: o, generate: $, cancelWhenScanned: Se } = bt({
79
- action: k,
75
+ selectedPlugin: c,
76
+ blocklet: X,
77
+ masterBlocklet: we
78
+ } = lt(), { state: o, generate: J, cancelWhenScanned: Se } = ft({
79
+ action: w,
80
80
  baseUrl: h,
81
81
  checkFn: S,
82
82
  checkInterval: I,
83
- checkTimeout: D,
84
- extraParams: we,
85
- prefix: P,
86
- onError: K,
83
+ checkTimeout: v,
84
+ extraParams: ye,
85
+ prefix: D,
86
+ onError: Y,
87
87
  onSuccess: _,
88
88
  locale: F,
89
89
  tokenKey: B,
90
- encKey: ue,
91
- autoConnect: de,
92
- forceConnected: N === !0 ? xe || !0 : N,
93
- saveConnect: fe,
94
- useSocket: me,
95
- provider: pe
96
- }), A = ie(!1), ee = ie(null), g = Qe(ee), L = f(() => g ? g.width < U - 50 : !0, [g, g?.width]), [te, Ie] = qe(!1);
97
- ae(() => {
98
- Ie(g?.width < U - 50);
90
+ encKey: ae,
91
+ autoConnect: le,
92
+ forceConnected: N === !0 ? ge || !0 : N,
93
+ saveConnect: ue,
94
+ useSocket: de,
95
+ provider: fe
96
+ }), A = re(!1), Z = re(null), x = Ve(Z), W = d(() => x ? x.width < M - 50 : !0, [x, x?.width]), [$, Ie] = Fe(!1);
97
+ ie(() => {
98
+ Ie(x?.width < M - 50);
99
99
  });
100
- const { oauthState: c, setBaseUrl: De } = xt(), { passkeyState: l, setTargetAppPid: Pe } = wt();
101
- ae(() => {
102
- De(h), Pe(Z?.appPid), o.reset(), c.reset(), l.reset();
103
- }), se(() => {
104
- ge(O);
100
+ const { oauthState: a, setBaseUrl: ve } = mt(), { passkeyState: l, setTargetAppPid: De } = ht();
101
+ ie(() => {
102
+ ve(h), De(X?.appPid), o.reset(), a.reset(), l.reset();
103
+ }), ne(() => {
104
+ xe(O);
105
105
  }, [O]);
106
- const Te = f(() => ({
106
+ const Te = d(() => ({
107
107
  confirm: u.confirm,
108
108
  success: u.success,
109
- error: a?.state?.error || o.error || l.error || c.error || ""
109
+ error: c?.state?.error || o.error || l.error || a.error || ""
110
110
  }), [
111
111
  u.confirm,
112
112
  u.success,
113
113
  o.error,
114
- c.error,
114
+ a.error,
115
115
  l.error,
116
- a?.state?.error
117
- ]), C = f(() => y.includes(l.status) || y.includes(c.status) || y.includes(o.status) || y.includes(a?.state?.computedStatus), [o.status, c.status, l.status, a?.state?.computedStatus]), oe = M(async () => {
118
- Q(), c.reset(), l.reset(), await $(!1);
119
- }), ve = M(() => {
116
+ c?.state?.error
117
+ ]), C = d(() => k.includes(l.status) || k.includes(a.status) || k.includes(o.status) || k.includes(c?.state?.computedStatus), [o.status, a.status, l.status, c?.state?.computedStatus]), ee = z(async () => {
118
+ G(), a.reset(), l.reset(), await J(!1);
119
+ }), Pe = z(() => {
120
120
  s?.retryConnect();
121
- }), _e = M(() => {
122
- Q(), c.reset(), l.reset(), a?.state?.reset(), Ce.current.cancelCount++, Se();
123
- }), { run: Re } = Xe(
121
+ }), _e = z(() => {
122
+ G(), a.reset(), l.reset(), c?.state?.reset(), Ce.current.cancelCount++, Se();
123
+ }), { run: Re } = qe(
124
124
  () => {
125
- A.current || o.status === "timeout" && (A.current = !0, o.reset(), oe(), A.current = !1);
125
+ A.current || o.status === "timeout" && (A.current = !0, o.reset(), ee(), A.current = !1);
126
126
  },
127
127
  { leading: !0, trailing: !1 }
128
128
  );
129
- se(Re, [o.status]);
130
- const Oe = f(() => ot[s.chooseMethod] || "DID Wallet", [s.chooseMethod]), {
131
- showMobileLogin: Ae,
132
- hideChooseList: r,
133
- oauthProviderList: Le,
134
- showOAuthLogin: We,
135
- showPasskeyLogin: Ee,
136
- showWebLogin: Me,
137
- showEmailLogin: Ue,
138
- hideQRCode: d
139
- } = Pt({
129
+ ne(Re, [o.status]);
130
+ const Oe = d(() => Je[s.chooseMethod] || "DID Wallet", [s.chooseMethod]), { providerList: Ae, hideQRCode: m, hideChooseList: n } = kt({
140
131
  action: o.action,
141
132
  sourceAppPid: s?.sourceAppPid,
142
- enabledConnectTypes: q,
143
133
  allowWallet: j,
144
134
  passkeyBehavior: H,
145
- webWalletUrl: V,
146
- mode: m,
147
- blocklet: s?.sourceAppPid ? ke : Z,
148
- isSmallView: L
149
- }), ze = Je(s?.sourceAppPid);
150
- Ze(() => {
151
- $e(ze) || $();
135
+ mode: f,
136
+ blocklet: s?.sourceAppPid ? we : X,
137
+ isSmallView: W
138
+ }), We = Ye(s?.sourceAppPid);
139
+ Ge(() => {
140
+ Ke(We) || J();
152
141
  }, [s?.sourceAppPid]);
153
- const n = (w) => {
154
- const je = R.spacing(w);
155
- return parseInt(je, 10);
156
- }, Be = f(() => x ? null : /* @__PURE__ */ t(
157
- et,
142
+ const r = (y) => {
143
+ const Me = R.spacing(y);
144
+ return parseInt(Me, 10);
145
+ }, Ee = d(() => g ? null : /* @__PURE__ */ t(
146
+ Qe,
158
147
  {
159
- onClose: v,
148
+ onClose: P,
160
149
  sx: {
161
150
  position: "absolute",
162
151
  right: 14,
163
152
  top: 14
164
153
  }
165
154
  }
166
- ), [x, v]);
167
- let re = null;
168
- C && (re = /* @__PURE__ */ t(
155
+ ), [g, P]);
156
+ let te = null;
157
+ C && (te = /* @__PURE__ */ t(
169
158
  i,
170
159
  {
171
160
  sx: {
@@ -175,45 +164,45 @@ function ce({
175
164
  justifyContent: "center"
176
165
  },
177
166
  children: /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
178
- Ct,
167
+ pt,
179
168
  {
180
- status: a?.state?.computedStatus || c.status || l.status || o.status,
169
+ status: c?.state?.computedStatus || a.status || l.status || o.status,
181
170
  nextWorkflow: o.nextWorkflow,
182
171
  mfaCode: o.mfaCode,
183
172
  onCancel: _e,
184
- onRetry: ve,
185
- onClose: v,
173
+ onRetry: Pe,
174
+ onClose: P,
186
175
  messages: Te,
187
176
  locale: F,
188
177
  className: "did-connect__auth-status auth-status",
189
- loadingIcon: s.chooseMethod ? /* @__PURE__ */ t(lt, { provider: s.chooseMethod, sx: { color: "text.primary" } }) : null,
178
+ loadingIcon: s.chooseMethod ? /* @__PURE__ */ t(nt, { provider: s.chooseMethod, sx: { color: "text.primary" } }) : null,
190
179
  chooseMethod: Oe,
191
180
  hideRetry: s.chooseMethod === "email",
192
- hideBack: !!G
181
+ hideBack: !!q
193
182
  }
194
183
  ) })
195
184
  }
196
185
  ));
197
- const ne = Tt({ disableSwitchApp: T, tokenState: o }), Fe = f(() => {
198
- const w = R.mode === "dark" ? R.palette.grey[500] : "white";
186
+ const oe = wt({ disableSwitchApp: T, tokenState: o }), Ue = d(() => {
187
+ const y = R.mode === "dark" ? R.palette.grey[600] : "white";
199
188
  return /* @__PURE__ */ t(
200
189
  i,
201
190
  {
202
191
  sx: {
203
- p: r ? 3 : 2,
204
- width: (r ? 240 : 196) + n(1) * 2,
205
- height: (r ? 240 : 196) + n(1) * 2
192
+ p: n ? 3 : 2,
193
+ width: (n ? 240 : 196) + r(1) * 2,
194
+ height: (n ? 240 : 196) + r(1) * 2
206
195
  },
207
196
  children: o.url ? /* @__PURE__ */ t(
208
- nt,
197
+ $e,
209
198
  {
210
- data: ne,
211
- size: r ? 240 - n(3) * 2 : 196 - n(2) * 2,
199
+ data: oe,
200
+ size: n ? 240 - r(3) * 2 : 196 - r(2) * 2,
212
201
  sx: {
213
- width: (r ? 240 - n(3) * 2 : 196 - n(2) * 2) + n(1) * 2,
214
- height: (r ? 240 - n(3) * 2 : 196 - n(2) * 2) + n(1) * 2,
202
+ width: (n ? 240 - r(3) * 2 : 196 - r(2) * 2) + r(1) * 2,
203
+ height: (n ? 240 - r(3) * 2 : 196 - r(2) * 2) + r(1) * 2,
215
204
  flex: 1,
216
- backgroundColor: w,
205
+ backgroundColor: y,
217
206
  p: 1,
218
207
  fontSize: 0,
219
208
  textAlign: "center",
@@ -224,21 +213,21 @@ function ce({
224
213
  },
225
214
  config: {
226
215
  backgroundOptions: {
227
- color: w
216
+ color: y
228
217
  }
229
218
  }
230
219
  }
231
220
  ) : /* @__PURE__ */ t(
232
- Ye,
221
+ Ne,
233
222
  {
234
223
  animation: "wave",
235
224
  variant: "rectangular",
236
225
  sx: {
237
226
  position: "absolute",
238
- left: n(2) + 1,
239
- right: n(2) + 1,
240
- top: n(2) + 1,
241
- bottom: n(2) + 1,
227
+ left: r(2) + 1,
228
+ right: r(2) + 1,
229
+ top: r(2) + 1,
230
+ bottom: r(2) + 1,
242
231
  borderRadius: 1,
243
232
  zIndex: 1,
244
233
  width: "auto",
@@ -248,22 +237,22 @@ function ce({
248
237
  )
249
238
  }
250
239
  );
251
- }, [ne, r]), Ne = f(() => r ? "column-reverse" : !d && te ? "column" : "row", [r, te, d]), W = /* @__PURE__ */ p(
240
+ }, [oe, n]), ze = d(() => n ? "column-reverse" : !m && $ ? "column" : "row", [n, $, m]), E = /* @__PURE__ */ p(
252
241
  i,
253
242
  {
254
243
  className: "did-connect__body",
255
244
  sx: {
256
245
  display: "flex",
257
- flexDirection: Ne,
246
+ flexDirection: ze,
258
247
  justifyContent: "center",
259
248
  alignItems: "stretch",
260
249
  flex: 1,
261
- gap: !d && L ? 0 : 1.5,
250
+ gap: !m && W ? 0 : 1.5,
262
251
  overflow: "visible",
263
- px: r ? 2 : 0
252
+ px: n ? 2 : 0
264
253
  },
265
254
  children: [
266
- !C && !d ? /* @__PURE__ */ p(He, { children: [
255
+ !C && !m ? /* @__PURE__ */ p(Le, { children: [
267
256
  /* @__PURE__ */ t(
268
257
  i,
269
258
  {
@@ -281,10 +270,10 @@ function ce({
281
270
  sx: {
282
271
  fontSize: 0,
283
272
  position: "relative",
284
- mb: r ? 4 : 2.5
273
+ mb: n ? 4 : 2.5
285
274
  },
286
275
  children: [
287
- Fe,
276
+ Ue,
288
277
  /* @__PURE__ */ p(
289
278
  i,
290
279
  {
@@ -292,18 +281,18 @@ function ce({
292
281
  position: "absolute",
293
282
  color: "text.secondary",
294
283
  fontSize: 12,
295
- bottom: r ? 8 : 4,
284
+ bottom: n ? 8 : 4,
296
285
  transform: "translateY(100%)",
297
286
  left: 0,
298
287
  right: 0,
299
288
  textAlign: "center"
300
289
  },
301
290
  children: [
302
- J("scanWithWallet1"),
291
+ Q("scanWithWallet1"),
303
292
  " ",
304
- /* @__PURE__ */ t(Dt, {}),
293
+ /* @__PURE__ */ t(yt, {}),
305
294
  " ",
306
- J("scanWithWallet2")
295
+ Q("scanWithWallet2")
307
296
  ]
308
297
  }
309
298
  )
@@ -312,8 +301,8 @@ function ce({
312
301
  )
313
302
  }
314
303
  ),
315
- r ? null : /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
316
- Ge,
304
+ n ? null : /* @__PURE__ */ t(i, { children: /* @__PURE__ */ t(
305
+ je,
317
306
  {
318
307
  orientation: "vertical",
319
308
  sx: {
@@ -335,9 +324,9 @@ function ce({
335
324
  flex: 1
336
325
  },
337
326
  children: [
338
- re,
327
+ te,
339
328
  /* @__PURE__ */ t(
340
- ht,
329
+ ut,
341
330
  {
342
331
  slotProps: {
343
332
  root: {
@@ -345,27 +334,22 @@ function ce({
345
334
  }
346
335
  },
347
336
  allowWallet: j,
348
- size: d && m !== "dialog" ? "normal" : "small",
337
+ size: m && f !== "dialog" ? "normal" : "small",
349
338
  tokenState: o,
350
339
  messages: u,
351
340
  tokenKey: B,
352
341
  onSuccess: _,
353
342
  passkeyBehavior: H,
354
- webWalletUrl: V,
355
- extraContent: Y,
356
- enabledConnectTypes: q,
357
- onRest: oe,
358
- showMobileLogin: Ae && d,
359
- showOAuthLogin: We,
360
- showPasskeyLogin: Ee,
361
- showWebLogin: Me,
362
- showEmailLogin: Ue,
363
- oauthProviderList: Le,
343
+ webWalletUrl: me,
344
+ extraContent: V,
345
+ enabledConnectTypes: pe,
346
+ onReset: ee,
364
347
  disableSwitchApp: T,
365
- forceUpdate: X,
366
- magicToken: G,
348
+ forceUpdate: K,
349
+ magicToken: q,
367
350
  baseUrl: h,
368
- customItems: he
351
+ customItems: he,
352
+ providerList: Ae
369
353
  }
370
354
  )
371
355
  ]
@@ -374,16 +358,16 @@ function ce({
374
358
  ]
375
359
  }
376
360
  );
377
- let E = W;
378
- return a ? E = a.renderPlaceholder({
379
- fallback: W,
380
- forceUpdate: X,
361
+ let U = E;
362
+ return c ? U = c.renderPlaceholder({
363
+ fallback: E,
364
+ forceUpdate: K,
381
365
  onSuccess: _,
382
- onError: K
383
- }) : E = W, /* @__PURE__ */ p(
366
+ onError: Y
367
+ }) : U = E, /* @__PURE__ */ p(
384
368
  i,
385
369
  {
386
- ref: ee,
370
+ ref: Z,
387
371
  className: "did-connect__root",
388
372
  sx: {
389
373
  backgroundColor: "background.default",
@@ -394,33 +378,33 @@ function ce({
394
378
  maxWidth: "100%",
395
379
  width: (
396
380
  // eslint-disable-next-line no-nested-ternary
397
- m === "drawer" ? "100%" : d || C || r ? rt : U
381
+ f === "drawer" ? "100%" : m || C ? Ze : M
398
382
  ),
399
383
  transition: "width 0.2s ease-in-out",
400
384
  margin: "auto",
401
- p: L ? 2 : 3,
385
+ p: W ? 2 : 3,
402
386
  pb: 0,
403
387
  gap: 2
404
388
  },
405
389
  children: [
406
390
  /* @__PURE__ */ t(i, { "data-did-auth-url": o.url, sx: { display: "none" } }),
407
391
  /* @__PURE__ */ t(
408
- It,
392
+ Ct,
409
393
  {
410
394
  title: u.title,
411
395
  description: u.scan,
412
- extraContent: Y,
396
+ extraContent: V,
413
397
  disableSwitchApp: T
414
398
  }
415
399
  ),
416
- /* @__PURE__ */ t(gt, { initHeight: 72, children: E }),
417
- /* @__PURE__ */ t(at, { currentAppInfo: ye, currentAppColor: O }),
418
- Be
400
+ /* @__PURE__ */ t(dt, { initHeight: 72, children: U }),
401
+ /* @__PURE__ */ t(ot, { currentAppInfo: ke, currentAppColor: O }),
402
+ Ee
419
403
  ]
420
404
  }
421
405
  );
422
406
  }
423
- ce.propTypes = {
407
+ se.propTypes = {
424
408
  mode: e.oneOf(["dialog", "drawer", "page"]),
425
409
  action: e.string.isRequired,
426
410
  baseUrl: e.string,
@@ -439,10 +423,10 @@ ce.propTypes = {
439
423
  useSocket: e.bool,
440
424
  extraContent: e.any,
441
425
  passkeyBehavior: e.oneOf(["none", "both", "only-existing", "only-new"]),
442
- enabledConnectTypes: e.arrayOf(e.oneOf(["web", "mobile", ...Object.keys(z)])),
426
+ enabledConnectTypes: e.arrayOf(e.oneOf(["web", "mobile", ...Object.keys(L)])),
443
427
  webWalletUrl: e.string,
444
428
  allowWallet: e.bool,
445
- provider: e.oneOf([tt.WALLET, ...Object.keys(z), ""]),
429
+ provider: e.oneOf([Xe.WALLET, ...Object.keys(L), ""]),
446
430
  hideCloseButton: e.bool,
447
431
  disableSwitchApp: e.bool,
448
432
  onClose: e.func,
@@ -453,19 +437,19 @@ ce.propTypes = {
453
437
  magicToken: e.string,
454
438
  customItems: e.arrayOf(e.node)
455
439
  };
456
- function le({ testOnlyBorderColor: x = void 0, ...m }) {
457
- const { checkFn: k, extraParams: h = {}, blocklet: S, masterBlocklet: I, action: D, locale: P = "en" } = m;
458
- if (typeof k != "function")
440
+ function ce({ testOnlyBorderColor: g = void 0, ...f }) {
441
+ const { checkFn: w, extraParams: h = {}, blocklet: S, masterBlocklet: I, action: v, locale: D = "en" } = f;
442
+ if (typeof w != "function")
459
443
  throw new Error("Cannot initialize did connect component without a fetchFn");
460
444
  return /* @__PURE__ */ t(
461
- mt,
445
+ at,
462
446
  {
463
447
  blocklet: S,
464
448
  masterBlocklet: I,
465
- action: D,
466
- locale: P,
449
+ action: v,
450
+ locale: D,
467
451
  extraParams: h,
468
- testOnlyBorderColor: x,
452
+ testOnlyBorderColor: g,
469
453
  sx: {
470
454
  position: "relative",
471
455
  width: "100%",
@@ -478,11 +462,11 @@ function le({ testOnlyBorderColor: x = void 0, ...m }) {
478
462
  boxSizing: "border-box"
479
463
  }
480
464
  },
481
- children: /* @__PURE__ */ t(ce, { ...m })
465
+ children: /* @__PURE__ */ t(se, { ...f })
482
466
  }
483
467
  );
484
468
  }
485
- le.propTypes = {
469
+ ce.propTypes = {
486
470
  checkFn: e.func.isRequired,
487
471
  extraParams: e.object,
488
472
  blocklet: e.object.isRequired,
@@ -491,8 +475,8 @@ le.propTypes = {
491
475
  locale: e.string,
492
476
  testOnlyBorderColor: e.string
493
477
  };
494
- const lo = it(dt(ut(st(le))));
478
+ const no = et(st(it(tt(ce))));
495
479
  export {
496
- lo as default,
497
- mo as useSecurity
480
+ no as default,
481
+ co as useSecurity
498
482
  };