@coinbase/cdp-react 0.0.54 → 0.0.56

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 (41) hide show
  1. package/dist/assets/ManageAuth.css +1 -0
  2. package/dist/assets/ManageAuthItem.css +1 -0
  3. package/dist/assets/ManageAuthModal.css +1 -0
  4. package/dist/chunks/useSendComponentCallOnce.BHZMuo6E.js +273 -0
  5. package/dist/components/AuthButton/index.js +1 -1
  6. package/dist/components/Fund/index.js +1 -1
  7. package/dist/components/FundModal/index.js +1 -1
  8. package/dist/components/ManageAuth/ManageAuthItem.d.ts +9 -0
  9. package/dist/components/ManageAuth/ManageAuthItem.js +77 -0
  10. package/dist/components/ManageAuth/ManageAuthProvider.d.ts +8 -0
  11. package/dist/components/ManageAuth/ManageAuthProvider.js +64 -0
  12. package/dist/components/ManageAuth/index.d.ts +9 -0
  13. package/dist/components/ManageAuth/index.js +51 -0
  14. package/dist/components/ManageAuth/types.d.ts +13 -0
  15. package/dist/components/ManageAuth/types.js +1 -0
  16. package/dist/components/ManageAuthModal/index.d.ts +20 -0
  17. package/dist/components/ManageAuthModal/index.js +53 -0
  18. package/dist/components/OAuthStatusModal/index.js +53 -51
  19. package/dist/components/SendEvmTransactionButton/index.js +1 -1
  20. package/dist/components/SendSolanaTransactionButton/index.js +1 -1
  21. package/dist/components/SignIn/SignInAuthMethodButtons.js +20 -15
  22. package/dist/components/SignIn/index.js +1 -1
  23. package/dist/components/SignInModal/index.js +1 -1
  24. package/dist/components/SignOutButton/index.js +1 -1
  25. package/dist/icons/IconMinus.d.ts +2 -0
  26. package/dist/icons/IconMinus.js +7 -0
  27. package/dist/icons/IconPlus.d.ts +2 -0
  28. package/dist/icons/IconPlus.js +7 -0
  29. package/dist/icons/IconXLogo.d.ts +2 -0
  30. package/dist/icons/IconXLogo.js +13 -0
  31. package/dist/icons/index.d.ts +4 -0
  32. package/dist/icons/index.js +28 -20
  33. package/dist/index.d.ts +2 -0
  34. package/dist/index.js +136 -115
  35. package/dist/theme/theme.d.ts +10 -0
  36. package/dist/theme/tokens.d.ts +30 -0
  37. package/dist/theme/tokens.js +7 -1
  38. package/dist/version.d.ts +1 -0
  39. package/dist/version.js +4 -0
  40. package/package.json +5 -5
  41. package/dist/chunks/useSendComponentCallOnce.CUgcsUye.js +0 -219
package/dist/index.js CHANGED
@@ -1,117 +1,138 @@
1
- import { AuthButton as e } from "./components/AuthButton/index.js";
2
- import { ALL_AUTH_METHODS as n, AUTH_METHODS as m, CDPReactProvider as p, OAUTH_METHODS as f, useAppConfig as i, useProviderName as x } from "./components/CDPReactProvider/index.js";
3
- import { Fund as s, FundFooter as c } from "./components/Fund/index.js";
4
- import { FundModal as l, FundModalContent as u, FundModalTrigger as I } from "./components/FundModal/index.js";
5
- import { SendEvmTransactionButton as S } from "./components/SendEvmTransactionButton/index.js";
6
- import { SendSolanaTransactionButton as M } from "./components/SendSolanaTransactionButton/index.js";
7
- import { SignIn as F } from "./components/SignIn/index.js";
8
- import { useSignInReducer as A } from "./components/SignIn/useSignInReducer.js";
9
- import { SignInModal as B, SignInModalContent as k, SignInModalTrigger as D } from "./components/SignInModal/index.js";
10
- import { SignOutButton as v } from "./components/SignOutButton/index.js";
11
- import { ThemeProvider as O, useTheme as P } from "./components/ThemeProvider/index.js";
12
- import { Button as R } from "./components/ui/Button/index.js";
13
- import { Modal as L, ModalClose as _, ModalContent as V, ModalDescription as N, ModalTitle as j, ModalTrigger as X } from "./components/ui/Modal/index.js";
14
- import { cssVariables as y } from "./theme/cssVariables.js";
15
- import { theme as G } from "./theme/theme.js";
16
- import { borderRadius as K, borderRadiusComponents as Q, borderRadiusSemantic as W, colors as Y, colorsBase as Z, colorsComponents as $, colorsSemantic as oo, font as ro, fontComponents as eo, fontSemantic as to, tokens as no } from "./theme/tokens.js";
17
- import { flattenTokensObject as po, themeToCssVariables as fo } from "./theme/utils.js";
18
- import { IconArrowLeft as xo } from "./icons/IconArrowLeft.js";
19
- import { IconArrowsUpDown as so } from "./icons/IconArrowsUpDown.js";
20
- import { IconCheck as lo } from "./icons/IconCheck.js";
21
- import { IconCheckCircle as Io } from "./icons/IconCheckCircle.js";
22
- import { IconChevronDown as So } from "./icons/IconChevronDown.js";
23
- import { IconEnvelope as Mo } from "./icons/IconEnvelope.js";
24
- import { IconExclamationCircle as Fo } from "./icons/IconExclamationCircle.js";
25
- import { IconExclamationTriangle as Ao } from "./icons/IconExclamationTriangle.js";
26
- import { IconLock as Bo } from "./icons/IconLock.js";
27
- import { IconPhone as Do } from "./icons/IconPhone.js";
28
- import { IconXMark as vo } from "./icons/IconXMark.js";
29
- import { clamp as Oo } from "./utils/clamp.js";
30
- import { getMessageFromUnknownError as wo } from "./utils/getMessageFromUnknownError.js";
31
- import { isApiError as Uo } from "./utils/isApiError.js";
32
- import { isEmailInvalid as _o } from "./utils/isEmailInvalid.js";
33
- import { parseValuesFromPhoneNumber as No } from "./utils/parseValuesFromPhoneNumber.js";
34
- import { FundForm as Xo } from "./components/Fund/FundForm.js";
35
- import { FundTitle as yo } from "./components/Fund/FundTitle.js";
36
- import { useFundContext as Go } from "./components/Fund/FundProvider.js";
37
- import { SignInAuthMethodButtons as Ko } from "./components/SignIn/SignInAuthMethodButtons.js";
38
- import { SignInBackButton as Wo } from "./components/SignIn/SignInBackButton.js";
39
- import { SignInDescription as Zo } from "./components/SignIn/SignInDescription.js";
40
- import { SignInFooter as or } from "./components/SignIn/SignInFooter.js";
41
- import { SignInForm as er } from "./components/SignIn/SignInForm.js";
42
- import { SignInImage as nr } from "./components/SignIn/SignInImage.js";
43
- import { SignInTitle as pr } from "./components/SignIn/SignInTitle.js";
44
- import { useSignInContext as ir } from "./components/SignIn/SignInProvider.js";
1
+ import { A as o } from "./chunks/useSendComponentCallOnce.BHZMuo6E.js";
2
+ import "react";
3
+ import { VERSION as r } from "./version.js";
4
+ import { AuthButton as p } from "./components/AuthButton/index.js";
5
+ import { ALL_AUTH_METHODS as i, AUTH_METHODS as x, CDPReactProvider as s, OAUTH_METHODS as l, useAppConfig as u, useProviderName as c } from "./components/CDPReactProvider/index.js";
6
+ import { Fund as d, FundFooter as I } from "./components/Fund/index.js";
7
+ import { FundModal as S, FundModalContent as T, FundModalTrigger as A } from "./components/FundModal/index.js";
8
+ import { unstable_ManageAuth as h, unstable_ManageAuthContent as F } from "./components/ManageAuth/index.js";
9
+ import { unstable_ManageAuthItem as E } from "./components/ManageAuth/ManageAuthItem.js";
10
+ import { unstable_ManageAuthModal as k, unstable_ManageAuthModalContent as B, unstable_ManageAuthModalTrigger as D } from "./components/ManageAuthModal/index.js";
11
+ import { SendEvmTransactionButton as v } from "./components/SendEvmTransactionButton/index.js";
12
+ import { SendSolanaTransactionButton as H } from "./components/SendSolanaTransactionButton/index.js";
13
+ import { SignIn as R } from "./components/SignIn/index.js";
14
+ import { useSignInReducer as U } from "./components/SignIn/useSignInReducer.js";
15
+ import { SignInModal as N, SignInModalContent as j, SignInModalTrigger as y } from "./components/SignInModal/index.js";
16
+ import { SignOutButton as X } from "./components/SignOutButton/index.js";
17
+ import { ThemeProvider as z, useTheme as J } from "./components/ThemeProvider/index.js";
18
+ import { Button as Q } from "./components/ui/Button/index.js";
19
+ import { Modal as Y, ModalClose as Z, ModalContent as $, ModalDescription as oo, ModalTitle as ro, ModalTrigger as eo } from "./components/ui/Modal/index.js";
20
+ import { cssVariables as no } from "./theme/cssVariables.js";
21
+ import { theme as ao } from "./theme/theme.js";
22
+ import { borderRadius as fo, borderRadiusComponents as io, borderRadiusSemantic as xo, colors as so, colorsBase as lo, colorsComponents as uo, colorsSemantic as co, font as go, fontComponents as Io, fontSemantic as Mo, tokens as So } from "./theme/tokens.js";
23
+ import { flattenTokensObject as Ao, themeToCssVariables as Co } from "./theme/utils.js";
24
+ import { IconAppleLogo as Fo } from "./icons/IconAppleLogo.js";
25
+ import { IconArrowLeft as Eo } from "./icons/IconArrowLeft.js";
26
+ import { IconArrowsUpDown as ko } from "./icons/IconArrowsUpDown.js";
27
+ import { IconCheck as Do } from "./icons/IconCheck.js";
28
+ import { IconCheckCircle as vo } from "./icons/IconCheckCircle.js";
29
+ import { IconChevronDown as Ho } from "./icons/IconChevronDown.js";
30
+ import { IconEnvelope as Ro } from "./icons/IconEnvelope.js";
31
+ import { IconExclamationCircle as Uo } from "./icons/IconExclamationCircle.js";
32
+ import { IconExclamationTriangle as No } from "./icons/IconExclamationTriangle.js";
33
+ import { IconGoogleLogo as yo } from "./icons/IconGoogleLogo.js";
34
+ import { IconLock as Xo } from "./icons/IconLock.js";
35
+ import { IconPhone as zo } from "./icons/IconPhone.js";
36
+ import { IconXMark as Ko } from "./icons/IconXMark.js";
37
+ import { IconMinus as Wo } from "./icons/IconMinus.js";
38
+ import { IconPlus as Zo } from "./icons/IconPlus.js";
39
+ import { clamp as or } from "./utils/clamp.js";
40
+ import { getMessageFromUnknownError as er } from "./utils/getMessageFromUnknownError.js";
41
+ import { isApiError as nr } from "./utils/isApiError.js";
42
+ import { isEmailInvalid as ar } from "./utils/isEmailInvalid.js";
43
+ import { parseValuesFromPhoneNumber as fr } from "./utils/parseValuesFromPhoneNumber.js";
44
+ import { FundForm as xr } from "./components/Fund/FundForm.js";
45
+ import { FundTitle as lr } from "./components/Fund/FundTitle.js";
46
+ import { useFundContext as cr } from "./components/Fund/FundProvider.js";
47
+ import { SignInAuthMethodButtons as dr } from "./components/SignIn/SignInAuthMethodButtons.js";
48
+ import { SignInBackButton as Mr } from "./components/SignIn/SignInBackButton.js";
49
+ import { SignInDescription as Tr } from "./components/SignIn/SignInDescription.js";
50
+ import { SignInFooter as Cr } from "./components/SignIn/SignInFooter.js";
51
+ import { SignInForm as Fr } from "./components/SignIn/SignInForm.js";
52
+ import { SignInImage as Er } from "./components/SignIn/SignInImage.js";
53
+ import { SignInTitle as kr } from "./components/SignIn/SignInTitle.js";
54
+ import { useSignInContext as Dr } from "./components/SignIn/SignInProvider.js";
55
+ o.registerPackageVersion("react", r);
45
56
  export {
46
- n as ALL_AUTH_METHODS,
47
- m as AUTH_METHODS,
48
- e as AuthButton,
49
- R as Button,
50
- p as CDPReactProvider,
51
- s as Fund,
52
- c as FundFooter,
53
- Xo as FundForm,
54
- l as FundModal,
55
- u as FundModalContent,
56
- I as FundModalTrigger,
57
- yo as FundTitle,
58
- xo as IconArrowLeft,
59
- so as IconArrowsUpDown,
60
- lo as IconCheck,
61
- Io as IconCheckCircle,
62
- So as IconChevronDown,
63
- Mo as IconEnvelope,
64
- Fo as IconExclamationCircle,
65
- Ao as IconExclamationTriangle,
66
- Bo as IconLock,
67
- Do as IconPhone,
68
- vo as IconXMark,
69
- L as Modal,
70
- _ as ModalClose,
71
- V as ModalContent,
72
- N as ModalDescription,
73
- j as ModalTitle,
74
- X as ModalTrigger,
75
- f as OAUTH_METHODS,
76
- S as SendEvmTransactionButton,
77
- M as SendSolanaTransactionButton,
78
- F as SignIn,
79
- Ko as SignInAuthMethodButtons,
80
- Wo as SignInBackButton,
81
- Zo as SignInDescription,
82
- or as SignInFooter,
83
- er as SignInForm,
84
- nr as SignInImage,
85
- B as SignInModal,
86
- k as SignInModalContent,
87
- D as SignInModalTrigger,
88
- pr as SignInTitle,
89
- v as SignOutButton,
90
- O as ThemeProvider,
91
- K as borderRadius,
92
- Q as borderRadiusComponents,
93
- W as borderRadiusSemantic,
94
- Oo as clamp,
95
- Y as colors,
96
- Z as colorsBase,
97
- $ as colorsComponents,
98
- oo as colorsSemantic,
99
- y as cssVariables,
100
- po as flattenTokensObject,
101
- ro as font,
102
- eo as fontComponents,
103
- to as fontSemantic,
104
- wo as getMessageFromUnknownError,
105
- Uo as isApiError,
106
- _o as isEmailInvalid,
107
- No as parseValuesFromPhoneNumber,
108
- G as theme,
109
- fo as themeToCssVariables,
110
- no as tokens,
111
- i as useAppConfig,
112
- Go as useFundContext,
113
- x as useProviderName,
114
- ir as useSignInContext,
115
- A as useSignInReducer,
116
- P as useTheme
57
+ i as ALL_AUTH_METHODS,
58
+ x as AUTH_METHODS,
59
+ p as AuthButton,
60
+ Q as Button,
61
+ s as CDPReactProvider,
62
+ d as Fund,
63
+ I as FundFooter,
64
+ xr as FundForm,
65
+ S as FundModal,
66
+ T as FundModalContent,
67
+ A as FundModalTrigger,
68
+ lr as FundTitle,
69
+ Fo as IconAppleLogo,
70
+ Eo as IconArrowLeft,
71
+ ko as IconArrowsUpDown,
72
+ Do as IconCheck,
73
+ vo as IconCheckCircle,
74
+ Ho as IconChevronDown,
75
+ Ro as IconEnvelope,
76
+ Uo as IconExclamationCircle,
77
+ No as IconExclamationTriangle,
78
+ yo as IconGoogleLogo,
79
+ Xo as IconLock,
80
+ Wo as IconMinus,
81
+ zo as IconPhone,
82
+ Zo as IconPlus,
83
+ Ko as IconXMark,
84
+ Y as Modal,
85
+ Z as ModalClose,
86
+ $ as ModalContent,
87
+ oo as ModalDescription,
88
+ ro as ModalTitle,
89
+ eo as ModalTrigger,
90
+ l as OAUTH_METHODS,
91
+ v as SendEvmTransactionButton,
92
+ H as SendSolanaTransactionButton,
93
+ R as SignIn,
94
+ dr as SignInAuthMethodButtons,
95
+ Mr as SignInBackButton,
96
+ Tr as SignInDescription,
97
+ Cr as SignInFooter,
98
+ Fr as SignInForm,
99
+ Er as SignInImage,
100
+ N as SignInModal,
101
+ j as SignInModalContent,
102
+ y as SignInModalTrigger,
103
+ kr as SignInTitle,
104
+ X as SignOutButton,
105
+ z as ThemeProvider,
106
+ fo as borderRadius,
107
+ io as borderRadiusComponents,
108
+ xo as borderRadiusSemantic,
109
+ or as clamp,
110
+ so as colors,
111
+ lo as colorsBase,
112
+ uo as colorsComponents,
113
+ co as colorsSemantic,
114
+ no as cssVariables,
115
+ Ao as flattenTokensObject,
116
+ go as font,
117
+ Io as fontComponents,
118
+ Mo as fontSemantic,
119
+ er as getMessageFromUnknownError,
120
+ nr as isApiError,
121
+ ar as isEmailInvalid,
122
+ fr as parseValuesFromPhoneNumber,
123
+ ao as theme,
124
+ Co as themeToCssVariables,
125
+ So as tokens,
126
+ h as unstable_ManageAuth,
127
+ F as unstable_ManageAuthContent,
128
+ E as unstable_ManageAuthItem,
129
+ k as unstable_ManageAuthModal,
130
+ B as unstable_ManageAuthModalContent,
131
+ D as unstable_ManageAuthModalTrigger,
132
+ u as useAppConfig,
133
+ cr as useFundContext,
134
+ c as useProviderName,
135
+ Dr as useSignInContext,
136
+ U as useSignInReducer,
137
+ J as useTheme
117
138
  };
@@ -403,6 +403,13 @@ export declare const theme: Flattened<{
403
403
  readonly secondary: {
404
404
  readonly value: "#eef0f3";
405
405
  };
406
+ readonly negativeWash: {
407
+ readonly value: "{colors.fg.negative}";
408
+ readonly modify: {
409
+ readonly type: "color-mix";
410
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
411
+ };
412
+ };
406
413
  };
407
414
  readonly fg: {
408
415
  readonly default: {
@@ -420,6 +427,9 @@ export declare const theme: Flattened<{
420
427
  readonly onSecondary: {
421
428
  readonly value: "#0a0b0d";
422
429
  };
430
+ readonly onNegativeWash: {
431
+ readonly value: "{colors.fg.default}";
432
+ };
423
433
  readonly positive: {
424
434
  readonly value: "#098551";
425
435
  };
@@ -44,6 +44,13 @@ export declare const colorsSemantic: {
44
44
  readonly secondary: {
45
45
  readonly value: "#eef0f3";
46
46
  };
47
+ readonly negativeWash: {
48
+ readonly value: "{colors.fg.negative}";
49
+ readonly modify: {
50
+ readonly type: "color-mix";
51
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
52
+ };
53
+ };
47
54
  };
48
55
  readonly fg: {
49
56
  readonly default: {
@@ -61,6 +68,9 @@ export declare const colorsSemantic: {
61
68
  readonly onSecondary: {
62
69
  readonly value: "#0a0b0d";
63
70
  };
71
+ readonly onNegativeWash: {
72
+ readonly value: "{colors.fg.default}";
73
+ };
64
74
  readonly positive: {
65
75
  readonly value: "#098551";
66
76
  };
@@ -738,6 +748,13 @@ export declare const colors: {
738
748
  readonly secondary: {
739
749
  readonly value: "#eef0f3";
740
750
  };
751
+ readonly negativeWash: {
752
+ readonly value: "{colors.fg.negative}";
753
+ readonly modify: {
754
+ readonly type: "color-mix";
755
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
756
+ };
757
+ };
741
758
  };
742
759
  readonly fg: {
743
760
  readonly default: {
@@ -755,6 +772,9 @@ export declare const colors: {
755
772
  readonly onSecondary: {
756
773
  readonly value: "#0a0b0d";
757
774
  };
775
+ readonly onNegativeWash: {
776
+ readonly value: "{colors.fg.default}";
777
+ };
758
778
  readonly positive: {
759
779
  readonly value: "#098551";
760
780
  };
@@ -1396,6 +1416,13 @@ export declare const tokens: {
1396
1416
  readonly secondary: {
1397
1417
  readonly value: "#eef0f3";
1398
1418
  };
1419
+ readonly negativeWash: {
1420
+ readonly value: "{colors.fg.negative}";
1421
+ readonly modify: {
1422
+ readonly type: "color-mix";
1423
+ readonly value: readonly [readonly ["{colors.bg.default}", "90%"]];
1424
+ };
1425
+ };
1399
1426
  };
1400
1427
  readonly fg: {
1401
1428
  readonly default: {
@@ -1413,6 +1440,9 @@ export declare const tokens: {
1413
1440
  readonly onSecondary: {
1414
1441
  readonly value: "#0a0b0d";
1415
1442
  };
1443
+ readonly onNegativeWash: {
1444
+ readonly value: "{colors.fg.default}";
1445
+ };
1416
1446
  readonly positive: {
1417
1447
  readonly value: "#098551";
1418
1448
  };
@@ -29,8 +29,12 @@ const e = {
29
29
  // skeleton background
30
30
  primary: { value: e.blue500 },
31
31
  // primary color background
32
- secondary: { value: e.gray100 }
32
+ secondary: { value: e.gray100 },
33
33
  // secondary color background
34
+ negativeWash: {
35
+ value: "{colors.fg.negative}",
36
+ modify: { type: "color-mix", value: [["{colors.bg.default}", "90%"]] }
37
+ }
34
38
  },
35
39
  fg: {
36
40
  default: { value: e.black },
@@ -43,6 +47,8 @@ const e = {
43
47
  // text on primary color
44
48
  onSecondary: { value: e.black },
45
49
  // text on secondary color
50
+ onNegativeWash: { value: "{colors.fg.default}" },
51
+ // text on negative wash color
46
52
  positive: { value: e.green500 },
47
53
  // positive color text
48
54
  negative: { value: e.red500 },
@@ -0,0 +1 @@
1
+ export declare const VERSION = "0.0.56";
@@ -0,0 +1,4 @@
1
+ const o = "0.0.56";
2
+ export {
3
+ o as VERSION
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cdp-react",
3
- "version": "0.0.54",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@internationalized/number": "3.6.4",
@@ -16,8 +16,8 @@
16
16
  },
17
17
  "peerDependencies": {
18
18
  "react": ">=18.2.0 <19.2.0",
19
- "@coinbase/cdp-hooks": "^0.0.54",
20
- "@coinbase/cdp-core": "^0.0.54"
19
+ "@coinbase/cdp-core": "^0.0.56",
20
+ "@coinbase/cdp-hooks": "^0.0.56"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@size-limit/preset-big-lib": "^11.2.0",
@@ -47,8 +47,8 @@
47
47
  "vite": "^7.0.4",
48
48
  "vite-plugin-dts": "^4.5.4",
49
49
  "vite-plugin-lib-inject-css": "^2.2.2",
50
- "@coinbase/cdp-core": "^0.0.54",
51
- "@coinbase/cdp-hooks": "^0.0.54"
50
+ "@coinbase/cdp-core": "^0.0.56",
51
+ "@coinbase/cdp-hooks": "^0.0.56"
52
52
  },
53
53
  "size-limit": [
54
54
  {
@@ -1,219 +0,0 @@
1
- import { useRef as k, useEffect as q } from "react";
2
- function U(s) {
3
- return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
4
- }
5
- var F = { exports: {} }, B = { exports: {} }, S;
6
- function H() {
7
- return S || (S = 1, function() {
8
- var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = {
9
- // Bit-wise rotation left
10
- rotl: function(c, u) {
11
- return c << u | c >>> 32 - u;
12
- },
13
- // Bit-wise rotation right
14
- rotr: function(c, u) {
15
- return c << 32 - u | c >>> u;
16
- },
17
- // Swap big-endian to little-endian and vice versa
18
- endian: function(c) {
19
- if (c.constructor == Number)
20
- return l.rotl(c, 8) & 16711935 | l.rotl(c, 24) & 4278255360;
21
- for (var u = 0; u < c.length; u++)
22
- c[u] = l.endian(c[u]);
23
- return c;
24
- },
25
- // Generate an array of any length of random bytes
26
- randomBytes: function(c) {
27
- for (var u = []; c > 0; c--)
28
- u.push(Math.floor(Math.random() * 256));
29
- return u;
30
- },
31
- // Convert a byte array to big-endian 32-bit words
32
- bytesToWords: function(c) {
33
- for (var u = [], f = 0, a = 0; f < c.length; f++, a += 8)
34
- u[a >>> 5] |= c[f] << 24 - a % 32;
35
- return u;
36
- },
37
- // Convert big-endian 32-bit words to a byte array
38
- wordsToBytes: function(c) {
39
- for (var u = [], f = 0; f < c.length * 32; f += 8)
40
- u.push(c[f >>> 5] >>> 24 - f % 32 & 255);
41
- return u;
42
- },
43
- // Convert a byte array to a hex string
44
- bytesToHex: function(c) {
45
- for (var u = [], f = 0; f < c.length; f++)
46
- u.push((c[f] >>> 4).toString(16)), u.push((c[f] & 15).toString(16));
47
- return u.join("");
48
- },
49
- // Convert a hex string to a byte array
50
- hexToBytes: function(c) {
51
- for (var u = [], f = 0; f < c.length; f += 2)
52
- u.push(parseInt(c.substr(f, 2), 16));
53
- return u;
54
- },
55
- // Convert a byte array to a base-64 string
56
- bytesToBase64: function(c) {
57
- for (var u = [], f = 0; f < c.length; f += 3)
58
- for (var a = c[f] << 16 | c[f + 1] << 8 | c[f + 2], d = 0; d < 4; d++)
59
- f * 8 + d * 6 <= c.length * 8 ? u.push(s.charAt(a >>> 6 * (3 - d) & 63)) : u.push("=");
60
- return u.join("");
61
- },
62
- // Convert a base-64 string to a byte array
63
- base64ToBytes: function(c) {
64
- c = c.replace(/[^A-Z0-9+\/]/ig, "");
65
- for (var u = [], f = 0, a = 0; f < c.length; a = ++f % 4)
66
- a != 0 && u.push((s.indexOf(c.charAt(f - 1)) & Math.pow(2, -2 * a + 8) - 1) << a * 2 | s.indexOf(c.charAt(f)) >>> 6 - a * 2);
67
- return u;
68
- }
69
- };
70
- B.exports = l;
71
- }()), B.exports;
72
- }
73
- var E, w;
74
- function m() {
75
- if (w) return E;
76
- w = 1;
77
- var s = {
78
- // UTF-8 encoding
79
- utf8: {
80
- // Convert a string to a byte array
81
- stringToBytes: function(l) {
82
- return s.bin.stringToBytes(unescape(encodeURIComponent(l)));
83
- },
84
- // Convert a byte array to a string
85
- bytesToString: function(l) {
86
- return decodeURIComponent(escape(s.bin.bytesToString(l)));
87
- }
88
- },
89
- // Binary encoding
90
- bin: {
91
- // Convert a string to a byte array
92
- stringToBytes: function(l) {
93
- for (var c = [], u = 0; u < l.length; u++)
94
- c.push(l.charCodeAt(u) & 255);
95
- return c;
96
- },
97
- // Convert a byte array to a string
98
- bytesToString: function(l) {
99
- for (var c = [], u = 0; u < l.length; u++)
100
- c.push(String.fromCharCode(l[u]));
101
- return c.join("");
102
- }
103
- }
104
- };
105
- return E = s, E;
106
- }
107
- /*!
108
- * Determine if an object is a Buffer
109
- *
110
- * @author Feross Aboukhadijeh <https://feross.org>
111
- * @license MIT
112
- */
113
- var C, A;
114
- function L() {
115
- if (A) return C;
116
- A = 1, C = function(c) {
117
- return c != null && (s(c) || l(c) || !!c._isBuffer);
118
- };
119
- function s(c) {
120
- return !!c.constructor && typeof c.constructor.isBuffer == "function" && c.constructor.isBuffer(c);
121
- }
122
- function l(c) {
123
- return typeof c.readFloatLE == "function" && typeof c.slice == "function" && s(c.slice(0, 0));
124
- }
125
- return C;
126
- }
127
- var P;
128
- function J() {
129
- return P || (P = 1, function() {
130
- var s = H(), l = m().utf8, c = L(), u = m().bin, f = function(a, d) {
131
- a.constructor == String ? d && d.encoding === "binary" ? a = u.stringToBytes(a) : a = l.stringToBytes(a) : c(a) ? a = Array.prototype.slice.call(a, 0) : !Array.isArray(a) && a.constructor !== Uint8Array && (a = a.toString());
132
- for (var o = s.bytesToWords(a), g = a.length * 8, r = 1732584193, n = -271733879, e = -1732584194, t = 271733878, i = 0; i < o.length; i++)
133
- o[i] = (o[i] << 8 | o[i] >>> 24) & 16711935 | (o[i] << 24 | o[i] >>> 8) & 4278255360;
134
- o[g >>> 5] |= 128 << g % 32, o[(g + 64 >>> 9 << 4) + 14] = g;
135
- for (var p = f._ff, h = f._gg, v = f._hh, y = f._ii, i = 0; i < o.length; i += 16) {
136
- var M = r, O = n, D = e, R = t;
137
- r = p(r, n, e, t, o[i + 0], 7, -680876936), t = p(t, r, n, e, o[i + 1], 12, -389564586), e = p(e, t, r, n, o[i + 2], 17, 606105819), n = p(n, e, t, r, o[i + 3], 22, -1044525330), r = p(r, n, e, t, o[i + 4], 7, -176418897), t = p(t, r, n, e, o[i + 5], 12, 1200080426), e = p(e, t, r, n, o[i + 6], 17, -1473231341), n = p(n, e, t, r, o[i + 7], 22, -45705983), r = p(r, n, e, t, o[i + 8], 7, 1770035416), t = p(t, r, n, e, o[i + 9], 12, -1958414417), e = p(e, t, r, n, o[i + 10], 17, -42063), n = p(n, e, t, r, o[i + 11], 22, -1990404162), r = p(r, n, e, t, o[i + 12], 7, 1804603682), t = p(t, r, n, e, o[i + 13], 12, -40341101), e = p(e, t, r, n, o[i + 14], 17, -1502002290), n = p(n, e, t, r, o[i + 15], 22, 1236535329), r = h(r, n, e, t, o[i + 1], 5, -165796510), t = h(t, r, n, e, o[i + 6], 9, -1069501632), e = h(e, t, r, n, o[i + 11], 14, 643717713), n = h(n, e, t, r, o[i + 0], 20, -373897302), r = h(r, n, e, t, o[i + 5], 5, -701558691), t = h(t, r, n, e, o[i + 10], 9, 38016083), e = h(e, t, r, n, o[i + 15], 14, -660478335), n = h(n, e, t, r, o[i + 4], 20, -405537848), r = h(r, n, e, t, o[i + 9], 5, 568446438), t = h(t, r, n, e, o[i + 14], 9, -1019803690), e = h(e, t, r, n, o[i + 3], 14, -187363961), n = h(n, e, t, r, o[i + 8], 20, 1163531501), r = h(r, n, e, t, o[i + 13], 5, -1444681467), t = h(t, r, n, e, o[i + 2], 9, -51403784), e = h(e, t, r, n, o[i + 7], 14, 1735328473), n = h(n, e, t, r, o[i + 12], 20, -1926607734), r = v(r, n, e, t, o[i + 5], 4, -378558), t = v(t, r, n, e, o[i + 8], 11, -2022574463), e = v(e, t, r, n, o[i + 11], 16, 1839030562), n = v(n, e, t, r, o[i + 14], 23, -35309556), r = v(r, n, e, t, o[i + 1], 4, -1530992060), t = v(t, r, n, e, o[i + 4], 11, 1272893353), e = v(e, t, r, n, o[i + 7], 16, -155497632), n = v(n, e, t, r, o[i + 10], 23, -1094730640), r = v(r, n, e, t, o[i + 13], 4, 681279174), t = v(t, r, n, e, o[i + 0], 11, -358537222), e = v(e, t, r, n, o[i + 3], 16, -722521979), n = v(n, e, t, r, o[i + 6], 23, 76029189), r = v(r, n, e, t, o[i + 9], 4, -640364487), t = v(t, r, n, e, o[i + 12], 11, -421815835), e = v(e, t, r, n, o[i + 15], 16, 530742520), n = v(n, e, t, r, o[i + 2], 23, -995338651), r = y(r, n, e, t, o[i + 0], 6, -198630844), t = y(t, r, n, e, o[i + 7], 10, 1126891415), e = y(e, t, r, n, o[i + 14], 15, -1416354905), n = y(n, e, t, r, o[i + 5], 21, -57434055), r = y(r, n, e, t, o[i + 12], 6, 1700485571), t = y(t, r, n, e, o[i + 3], 10, -1894986606), e = y(e, t, r, n, o[i + 10], 15, -1051523), n = y(n, e, t, r, o[i + 1], 21, -2054922799), r = y(r, n, e, t, o[i + 8], 6, 1873313359), t = y(t, r, n, e, o[i + 15], 10, -30611744), e = y(e, t, r, n, o[i + 6], 15, -1560198380), n = y(n, e, t, r, o[i + 13], 21, 1309151649), r = y(r, n, e, t, o[i + 4], 6, -145523070), t = y(t, r, n, e, o[i + 11], 10, -1120210379), e = y(e, t, r, n, o[i + 2], 15, 718787259), n = y(n, e, t, r, o[i + 9], 21, -343485551), r = r + M >>> 0, n = n + O >>> 0, e = e + D >>> 0, t = t + R >>> 0;
138
- }
139
- return s.endian([r, n, e, t]);
140
- };
141
- f._ff = function(a, d, o, g, r, n, e) {
142
- var t = a + (d & o | ~d & g) + (r >>> 0) + e;
143
- return (t << n | t >>> 32 - n) + d;
144
- }, f._gg = function(a, d, o, g, r, n, e) {
145
- var t = a + (d & g | o & ~g) + (r >>> 0) + e;
146
- return (t << n | t >>> 32 - n) + d;
147
- }, f._hh = function(a, d, o, g, r, n, e) {
148
- var t = a + (d ^ o ^ g) + (r >>> 0) + e;
149
- return (t << n | t >>> 32 - n) + d;
150
- }, f._ii = function(a, d, o, g, r, n, e) {
151
- var t = a + (o ^ (d | ~g)) + (r >>> 0) + e;
152
- return (t << n | t >>> 32 - n) + d;
153
- }, f._blocksize = 16, f._digestsize = 16, F.exports = function(a, d) {
154
- if (a == null)
155
- throw new Error("Illegal argument " + a);
156
- var o = s.wordsToBytes(f(a, d));
157
- return d && d.asBytes ? o : d && d.asString ? u.bytesToString(o) : s.bytesToHex(o);
158
- };
159
- }()), F.exports;
160
- }
161
- var G = J();
162
- const N = /* @__PURE__ */ U(G), $ = "1f8d3e558f493e38a037dbfadb8ba344", z = "d473b1dcc969105adab157226cd9cf63", x = Symbol.for("@coinbase/cdp-analytics");
163
- function W() {
164
- const s = globalThis;
165
- return s[x] || (s[x] = {
166
- identifier: "",
167
- enabled: !0,
168
- isProduction: !1,
169
- isUsingMocks: !1,
170
- sendEvent: _,
171
- sendActionCallEvent: (l) => _({ ...l, type: "action_call" }),
172
- sendHookCallEvent: (l) => _({ ...l, type: "hook_call" }),
173
- sendComponentCallEvent: (l) => _({ ...l, type: "component_call" })
174
- }), s[x];
175
- }
176
- const T = W();
177
- async function _(s) {
178
- if (!T.enabled || !T.identifier)
179
- return;
180
- const l = Date.now(), u = [{
181
- user_id: T.identifier,
182
- event_type: s.type,
183
- platform: I() ? "web" : "native",
184
- timestamp: l,
185
- event_properties: {
186
- project_name: "cdp-embedded-wallet",
187
- isLocalHost: K(),
188
- isUsingMocks: T.isUsingMocks,
189
- ...s
190
- }
191
- }], f = JSON.stringify(u), a = l.toString(), d = N(f + a), o = {
192
- client: T.isProduction ? z : $,
193
- e: f,
194
- checksum: d
195
- };
196
- await fetch("https://cca-lite.coinbase.com/amp", {
197
- method: "POST",
198
- mode: "no-cors",
199
- headers: {
200
- "Content-Type": "application/json"
201
- },
202
- body: JSON.stringify(o)
203
- });
204
- }
205
- function I() {
206
- return typeof window < "u" && typeof document < "u";
207
- }
208
- function K() {
209
- return I() ? window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" : !1;
210
- }
211
- function Z(s) {
212
- const l = k(!1);
213
- q(() => {
214
- l.current || (T.sendComponentCallEvent({ name: s }), l.current = !0);
215
- }, [s]);
216
- }
217
- export {
218
- Z as u
219
- };