@mezo-org/passport 0.15.1-dev.6 → 0.15.1-dev.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.
- package/dist/src/config.d.ts +1 -2
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +8 -12
- package/dist/src/config.js.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts +11 -11
- package/dist/src/hooks/useSignInWithWallet.d.ts +11 -11
- package/dist/src/hooks/useSignUpWithWallet.d.ts +11 -11
- package/dist/src/hooks/useWalletAccount.d.ts +2 -2
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -1
- package/dist/src/hooks/useWalletAccount.js.map +1 -1
- package/dist/src/index.d.ts +1 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -2
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -2
- package/src/config.ts +13 -23
- package/src/hooks/useWalletAccount.ts +5 -2
- package/src/index.ts +0 -2
- package/dist/src/assets/DefaultAvatar.d.ts +0 -5
- package/dist/src/assets/DefaultAvatar.d.ts.map +0 -1
- package/dist/src/assets/DefaultAvatar.js +0 -21
- package/dist/src/assets/DefaultAvatar.js.map +0 -1
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts +0 -8
- package/dist/src/components/Dropdown/ConnectedTrigger.d.ts.map +0 -1
- package/dist/src/components/Dropdown/ConnectedTrigger.js +0 -39
- package/dist/src/components/Dropdown/ConnectedTrigger.js.map +0 -1
- package/dist/src/components/Dropdown/Content.d.ts +0 -8
- package/dist/src/components/Dropdown/Content.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Content.js +0 -27
- package/dist/src/components/Dropdown/Content.js.map +0 -1
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts +0 -7
- package/dist/src/components/Dropdown/DisconnectedTrigger.d.ts.map +0 -1
- package/dist/src/components/Dropdown/DisconnectedTrigger.js +0 -13
- package/dist/src/components/Dropdown/DisconnectedTrigger.js.map +0 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +0 -23
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Dropdown.js +0 -45
- package/dist/src/components/Dropdown/Dropdown.js.map +0 -1
- package/dist/src/components/Dropdown/ListingItem.d.ts +0 -14
- package/dist/src/components/Dropdown/ListingItem.d.ts.map +0 -1
- package/dist/src/components/Dropdown/ListingItem.js +0 -42
- package/dist/src/components/Dropdown/ListingItem.js.map +0 -1
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts +0 -8
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +0 -1
- package/dist/src/components/Dropdown/NestedViewLayout.js +0 -32
- package/dist/src/components/Dropdown/NestedViewLayout.js.map +0 -1
- package/dist/src/components/Dropdown/Receive/Receive.d.ts +0 -4
- package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Receive/Receive.js +0 -64
- package/dist/src/components/Dropdown/Receive/Receive.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +0 -4
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js +0 -49
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +0 -6
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.js +0 -32
- package/dist/src/components/Dropdown/Root/AccountBalance.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +0 -6
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js +0 -28
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountError.d.ts +0 -8
- package/dist/src/components/Dropdown/Root/AccountError.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountError.js +0 -17
- package/dist/src/components/Dropdown/Root/AccountError.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +0 -4
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js +0 -21
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +0 -8
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +0 -43
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +0 -1
- package/dist/src/components/Dropdown/Root/Root.d.ts +0 -8
- package/dist/src/components/Dropdown/Root/Root.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/Root.js +0 -45
- package/dist/src/components/Dropdown/Root/Root.js.map +0 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +0 -4
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.js +0 -66
- package/dist/src/components/Dropdown/Root/WalletAddress.js.map +0 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +0 -6
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js +0 -88
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +0 -1
- package/dist/src/components/Dropdown/SlotNumber.d.ts +0 -19
- package/dist/src/components/Dropdown/SlotNumber.d.ts.map +0 -1
- package/dist/src/components/Dropdown/SlotNumber.js +0 -67
- package/dist/src/components/Dropdown/SlotNumber.js.map +0 -1
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts +0 -3
- package/dist/src/components/Dropdown/TestnetTopBanner.d.ts.map +0 -1
- package/dist/src/components/Dropdown/TestnetTopBanner.js +0 -14
- package/dist/src/components/Dropdown/TestnetTopBanner.js.map +0 -1
- package/dist/src/components/Dropdown/index.d.ts +0 -3
- package/dist/src/components/Dropdown/index.d.ts.map +0 -1
- package/dist/src/components/Dropdown/index.js +0 -2
- package/dist/src/components/Dropdown/index.js.map +0 -1
- package/dist/src/components/index.d.ts +0 -2
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -2
- package/dist/src/components/index.js.map +0 -1
- package/src/assets/DefaultAvatar.tsx +0 -74
- package/src/components/Dropdown/ConnectedTrigger.tsx +0 -76
- package/src/components/Dropdown/Content.tsx +0 -53
- package/src/components/Dropdown/DisconnectedTrigger.tsx +0 -36
- package/src/components/Dropdown/Dropdown.tsx +0 -100
- package/src/components/Dropdown/ListingItem.tsx +0 -176
- package/src/components/Dropdown/NestedViewLayout.tsx +0 -87
- package/src/components/Dropdown/README.md +0 -41
- package/src/components/Dropdown/Receive/Receive.tsx +0 -144
- package/src/components/Dropdown/Root/AccountAddressActions.tsx +0 -99
- package/src/components/Dropdown/Root/AccountBalance.tsx +0 -69
- package/src/components/Dropdown/Root/AccountBtcListing.tsx +0 -53
- package/src/components/Dropdown/Root/AccountError.tsx +0 -34
- package/src/components/Dropdown/Root/AccountMusdListing.tsx +0 -45
- package/src/components/Dropdown/Root/AccountOtherAssets.tsx +0 -85
- package/src/components/Dropdown/Root/Root.tsx +0 -77
- package/src/components/Dropdown/Root/WalletAddress.tsx +0 -123
- package/src/components/Dropdown/Root/WelcomeBlock.tsx +0 -173
- package/src/components/Dropdown/SlotNumber.tsx +0 -131
- package/src/components/Dropdown/TestnetTopBanner.tsx +0 -32
- package/src/components/Dropdown/index.ts +0 -2
- package/src/components/index.ts +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { StatefulPopover, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import { useConnectModal } from "@rainbow-me/rainbowkit";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import DefaultAvatar from "../../assets/DefaultAvatar";
|
|
5
|
-
import ConnectedTrigger from "./ConnectedTrigger";
|
|
6
|
-
import Content from "./Content";
|
|
7
|
-
import DisconnectedTrigger from "./DisconnectedTrigger";
|
|
8
|
-
import { useWalletAccount } from "../../hooks/useWalletAccount";
|
|
9
|
-
import { useWatchTransferEventsForAllTokens } from "../../hooks/useWatchTransferEvents";
|
|
10
|
-
/**
|
|
11
|
-
* Passport Dropdown component that displays user's wallet and assets information.
|
|
12
|
-
* @param {DropdownProps} props - Component props.
|
|
13
|
-
* @returns {JSX.Element}
|
|
14
|
-
*/
|
|
15
|
-
export function Dropdown(props) {
|
|
16
|
-
const { placement = "bottomRight", animateOutTime = 120, onSignIn, onSignOut, overrides, triggerProps, onOtherAssetsClick, ...restProps } = props;
|
|
17
|
-
const [, theme] = useStyletron();
|
|
18
|
-
const walletAccount = useWalletAccount();
|
|
19
|
-
useWatchTransferEventsForAllTokens();
|
|
20
|
-
const { openConnectModal } = useConnectModal();
|
|
21
|
-
if (!walletAccount?.isConnected) {
|
|
22
|
-
return (React.createElement(DisconnectedTrigger
|
|
23
|
-
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
24
|
-
// connect modal
|
|
25
|
-
, {
|
|
26
|
-
// If connect wallet flow is not provided it fallbacks to RainbowKit's
|
|
27
|
-
// connect modal
|
|
28
|
-
onClick: onSignIn || openConnectModal, ...triggerProps?.signedOut }, "Sign in"));
|
|
29
|
-
}
|
|
30
|
-
return (React.createElement(StatefulPopover, { content: React.createElement(Content, { onSignOut: onSignOut, onOtherAssetsClick: onOtherAssetsClick }), placement: placement, animateOutTime: animateOutTime, overrides: {
|
|
31
|
-
...overrides,
|
|
32
|
-
Body: {
|
|
33
|
-
...overrides?.Body,
|
|
34
|
-
style: {
|
|
35
|
-
width: "402px",
|
|
36
|
-
borderRadius: theme.borders.radius500,
|
|
37
|
-
boxShadow: theme.lighting.shadow500,
|
|
38
|
-
overflow: "hidden",
|
|
39
|
-
...overrides?.Body?.style,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
}, ...restProps },
|
|
43
|
-
React.createElement(ConnectedTrigger, { avatar: React.createElement(DefaultAvatar, null), ...triggerProps?.signedIn })));
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=Dropdown.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/Dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEf,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,4BAA4B,CAAA;AACtD,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,oCAAoC,CAAA;AAiBvF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,MAAM,EACJ,SAAS,GAAG,aAAa,EACzB,cAAc,GAAG,GAAG,EACpB,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,kCAAkC,EAAE,CAAA;IAEpC,MAAM,EAAE,gBAAgB,EAAE,GAAG,eAAe,EAAE,CAAA;IAE9C,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,CAAC;QAChC,OAAO,CACL,oBAAC,mBAAmB;QAClB,sEAAsE;QACtE,gBAAgB;;YADhB,sEAAsE;YACtE,gBAAgB;YAChB,OAAO,EAAE,QAAQ,IAAI,gBAAgB,KACjC,YAAY,EAAE,SAAS,cAGP,CACvB,CAAA;IACH,CAAC;IAED,OAAO,CACL,oBAAC,eAAe,IACd,OAAO,EACL,oBAAC,OAAO,IACN,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,GACtC,EAEJ,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE;YACT,GAAG,SAAS;YACZ,IAAI,EAAE;gBACJ,GAAG,SAAS,EAAE,IAAI;gBAClB,KAAK,EAAE;oBACL,KAAK,EAAE,OAAO;oBACd,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;oBACrC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS;oBACnC,QAAQ,EAAE,QAAQ;oBAClB,GAAG,SAAS,EAAE,IAAI,EAAE,KAAK;iBAC1B;aACF;SACF,KACG,SAAS;QAEb,oBAAC,gBAAgB,IACf,MAAM,EAAE,oBAAC,aAAa,OAAG,KACrB,YAAY,EAAE,QAAQ,GAC1B,CACc,CACnB,CAAA;AACH,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
3
|
-
type ListingItemProps = {
|
|
4
|
-
icon?: ReactNode;
|
|
5
|
-
label?: string;
|
|
6
|
-
subLabel?: string;
|
|
7
|
-
value?: number;
|
|
8
|
-
subValue?: number;
|
|
9
|
-
overrides?: BlockProps["overrides"];
|
|
10
|
-
isLoading?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export default function ListingItem(props: ListingItemProps): React.JSX.Element;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=ListingItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListingItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/ListingItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,UAAU,EAIX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAwDxC,KAAK,gBAAgB,GAAG;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IACnC,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,gBAAgB,qBAoG1D"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { mergeOverrides, Block, useStyletron, Skeleton, LabelMedium, ParagraphSmall, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import SlotNumber from "./SlotNumber";
|
|
4
|
-
import { formatUsd } from "../../utils/currency";
|
|
5
|
-
function ListingItemLayout(props) {
|
|
6
|
-
const { icon, label, value, subLabel, subValue, overrides, ...restProps } = props;
|
|
7
|
-
const [, theme] = useStyletron();
|
|
8
|
-
return (React.createElement(Block, { display: "flex", alignItems: "center", paddingLeft: theme.sizing.scale600, paddingRight: theme.sizing.scale600, overrides: mergeOverrides({
|
|
9
|
-
Block: {
|
|
10
|
-
style: {
|
|
11
|
-
gap: theme.sizing.scale600,
|
|
12
|
-
minHeight: "72px",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
}, overrides), ...restProps },
|
|
16
|
-
icon && icon,
|
|
17
|
-
React.createElement(Block, { display: "flex", flexDirection: "column", alignItems: "flex-start" },
|
|
18
|
-
label && label,
|
|
19
|
-
subLabel && subLabel),
|
|
20
|
-
React.createElement(Block, { display: "flex", flexDirection: "column", alignItems: "flex-end", marginLeft: "auto" },
|
|
21
|
-
value && value,
|
|
22
|
-
subValue && subValue)));
|
|
23
|
-
}
|
|
24
|
-
export default function ListingItem(props) {
|
|
25
|
-
const { icon, label, subLabel, value, subValue, overrides, isLoading = false, } = props;
|
|
26
|
-
const [, theme] = useStyletron();
|
|
27
|
-
if (isLoading) {
|
|
28
|
-
return (React.createElement(ListingItemLayout, { icon: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale800, height: theme.sizing.scale800 }), label: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale2400, height: theme.sizing.scale600, overrides: {
|
|
29
|
-
Root: {
|
|
30
|
-
style: { marginBottom: theme.sizing.scale100 },
|
|
31
|
-
},
|
|
32
|
-
} }), subLabel: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale1600, height: theme.sizing.scale550 }), value: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale2400, height: theme.sizing.scale600, overrides: {
|
|
33
|
-
Root: {
|
|
34
|
-
style: { marginBottom: theme.sizing.scale100 },
|
|
35
|
-
},
|
|
36
|
-
} }), subValue: React.createElement(Skeleton, { animation: true, width: theme.sizing.scale1600, height: theme.sizing.scale550 }), overrides: overrides }));
|
|
37
|
-
}
|
|
38
|
-
return (React.createElement(ListingItemLayout, { icon: icon, label: React.createElement(LabelMedium, null, label), subLabel: React.createElement(ParagraphSmall, { margin: 0, as: "div", color: theme.colors.contentSecondary }, subLabel), value: value !== undefined && (React.createElement(LabelMedium, null,
|
|
39
|
-
React.createElement(SlotNumber, { formatFunction: formatUsd }, value))), subValue: subValue !== undefined && (React.createElement(ParagraphSmall, { margin: 0, as: "div", color: theme.colors.contentSecondary },
|
|
40
|
-
React.createElement(SlotNumber, { formatFunction: formatUsd }, subValue))), overrides: overrides }));
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=ListingItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":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AC,MAAM,CAAC,SAAS,EAC7B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,GAC7B,EAEJ,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;IACH,CAAC;IAED,OAAO,CACL,oBAAC,iBAAiB,IAChB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,oBAAC,WAAW,QAAE,KAAK,CAAe,EACzC,QAAQ,EACN,oBAAC,cAAc,IACb,MAAM,EAAE,CAAC,EACT,EAAE,EAAC,KAAK,EACR,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB,IAEnC,QAAQ,CACM,EAEnB,KAAK,EACH,KAAK,KAAK,SAAS,IAAI,CACrB,oBAAC,WAAW;YACV,oBAAC,UAAU,IAAC,cAAc,EAAE,SAAS,IAAG,KAAK,CAAc,CAC/C,CACf,EAEH,QAAQ,EACN,QAAQ,KAAK,SAAS,IAAI,CACxB,oBAAC,cAAc,IACb,MAAM,EAAE,CAAC,EACT,EAAE,EAAC,KAAK,EACR,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB;YAEpC,oBAAC,UAAU,IAAC,cAAc,EAAE,SAAS,IAAG,QAAQ,CAAc,CAC/C,CAClB,EAEH,SAAS,EAAE,SAAS,GACpB,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { ReactNode } from "react";
|
|
3
|
-
type NestedViewLayoutProps = {
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
} & BlockProps;
|
|
6
|
-
declare function NestedViewLayout(props: NestedViewLayoutProps): React.JSX.Element;
|
|
7
|
-
export default NestedViewLayout;
|
|
8
|
-
//# sourceMappingURL=NestedViewLayout.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NestedViewLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAIX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAUrD,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,UAAU,CAAA;AAEd,iBAAS,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,qBA8DrD;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ArrowLeft, Block, ButtonIcon, HeadingSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { useCallback } from "react";
|
|
3
|
-
import useDropdownStore, { DropdownView } from "../../stores/dropdownStore";
|
|
4
|
-
const getHeaderTitle = (view) => {
|
|
5
|
-
const titleMap = {
|
|
6
|
-
[DropdownView.RECEIVE]: "Scan to receive",
|
|
7
|
-
};
|
|
8
|
-
return titleMap[view];
|
|
9
|
-
};
|
|
10
|
-
function NestedViewLayout(props) {
|
|
11
|
-
const { children, ...restProps } = props;
|
|
12
|
-
const currentView = useDropdownStore((state) => state.view);
|
|
13
|
-
const setView = useDropdownStore((state) => state.setView);
|
|
14
|
-
const [, theme] = useStyletron();
|
|
15
|
-
const handleOnButtonClick = useCallback(() => {
|
|
16
|
-
setView(DropdownView.ROOT);
|
|
17
|
-
}, [setView]);
|
|
18
|
-
return (React.createElement(Block, { display: "flex", flexDirection: "column", minHeight: "588px", ...restProps },
|
|
19
|
-
React.createElement(Block, { display: "flex", alignItems: "center", padding: theme.sizing.scale100, paddingTop: theme.sizing.scale800, paddingBottom: theme.sizing.scale500, marginBottom: theme.sizing.scale300, overrides: {
|
|
20
|
-
Block: {
|
|
21
|
-
style: {
|
|
22
|
-
gap: theme.sizing.scale300,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
} },
|
|
26
|
-
React.createElement(ButtonIcon, { onClick: handleOnButtonClick, shape: "circle", size: "medium", kind: "tertiary" },
|
|
27
|
-
React.createElement(ArrowLeft, null)),
|
|
28
|
-
React.createElement(HeadingSmall, { marginTop: theme.sizing.scale300, marginBottom: theme.sizing.scale300 }, getHeaderTitle(currentView))),
|
|
29
|
-
React.createElement(Block, { display: "flex", flexDirection: "column", padding: theme.sizing.scale600, paddingTop: 0, flex: 1 }, children)));
|
|
30
|
-
}
|
|
31
|
-
export default NestedViewLayout;
|
|
32
|
-
//# sourceMappingURL=NestedViewLayout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NestedViewLayout.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/NestedViewLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EAEL,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE3E,MAAM,cAAc,GAAG,CAAC,IAAkB,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAA0C;QACtD,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,iBAAiB;KAC1C,CAAA;IACD,OAAO,QAAQ,CAAC,IAAI,CAAE,CAAA;AACxB,CAAC,CAAA;AAMD,SAAS,gBAAgB,CAAC,KAA4B;IACpD,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAExC,MAAM,WAAW,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAE1D,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,mBAAmB,GAAG,WAAW,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["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAQvC,iBAAS,OAAO,sBA4Hf;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Block, Button, LabelLarge, MezoCircle, MonoLabelXSmall, ParagraphSmall, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { useCopyToClipboard } from "usehooks-ts";
|
|
4
|
-
import { QRCodeSVG } from "qrcode.react";
|
|
5
|
-
import NestedViewLayout from "../NestedViewLayout";
|
|
6
|
-
import { getAddressExplorerUrl } from "../../../utils/address";
|
|
7
|
-
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
8
|
-
import { useWalletAccount } from "../../../hooks/useWalletAccount";
|
|
9
|
-
function Receive() {
|
|
10
|
-
const { environment } = usePassportContext();
|
|
11
|
-
const walletAccount = useWalletAccount();
|
|
12
|
-
const [, theme] = useStyletron();
|
|
13
|
-
const [, copy] = useCopyToClipboard();
|
|
14
|
-
const [isCopiedMessageVisible, setIsCopiedMessageVisible] = useState(false);
|
|
15
|
-
const handleCopyAddress = () => {
|
|
16
|
-
copy(walletAccount.accountAddress);
|
|
17
|
-
setIsCopiedMessageVisible(true);
|
|
18
|
-
setTimeout(() => {
|
|
19
|
-
setIsCopiedMessageVisible(false);
|
|
20
|
-
}, 2000);
|
|
21
|
-
};
|
|
22
|
-
const blockExplorerUrl = getAddressExplorerUrl(walletAccount.accountAddress, "mezo", environment === "testnet");
|
|
23
|
-
return (React.createElement(NestedViewLayout, null,
|
|
24
|
-
React.createElement(LabelLarge, null, "Your Mezo Address"),
|
|
25
|
-
React.createElement(ParagraphSmall, { marginTop: 0, marginBottom: theme.sizing.scale800, color: theme.colors.contentTertiary }, walletAccount.networkFamily === "bitcoin" ? (React.createElement(React.Fragment, null, "Mezo automatically created a smart account that's fully controlled by your connected Bitcoin wallet. Use this address to receive assets on Mezo.")) : (React.createElement(React.Fragment, null, "Your connected wallet address is your Mezo address. Use this address to receive assets on Mezo."))),
|
|
26
|
-
React.createElement(Block, { as: QRCodeSVG, value: walletAccount.accountAddress, flex: 1, overrides: {
|
|
27
|
-
Block: {
|
|
28
|
-
style: {
|
|
29
|
-
aspectRatio: 1,
|
|
30
|
-
width: "fit-content",
|
|
31
|
-
margin: "0 auto",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
} }),
|
|
35
|
-
React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: theme.colors.backgroundSecondary, marginTop: theme.sizing.scale800, marginBottom: theme.sizing.scale600, padding: theme.sizing.scale300, overrides: {
|
|
36
|
-
Block: {
|
|
37
|
-
style: {
|
|
38
|
-
gap: theme.sizing.scale300,
|
|
39
|
-
borderRadius: theme.borders.radius400,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
} },
|
|
43
|
-
React.createElement(MezoCircle, { size: theme.sizing.scale700, color: theme.colors.accent, symbolColor: theme.colors.white, overrides: {
|
|
44
|
-
Svg: {
|
|
45
|
-
style: {
|
|
46
|
-
backgroundColor: theme.colors.accent,
|
|
47
|
-
overflow: "hidden",
|
|
48
|
-
borderRadius: theme.borders.radius200,
|
|
49
|
-
flexShrink: 0,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
} }),
|
|
53
|
-
React.createElement(MonoLabelXSmall, null, walletAccount.accountAddress)),
|
|
54
|
-
React.createElement(Button, { onClick: handleCopyAddress, size: "medium", overrides: {
|
|
55
|
-
BaseButton: {
|
|
56
|
-
style: {
|
|
57
|
-
marginBottom: theme.sizing.scale500,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
} }, isCopiedMessageVisible ? "Copied!" : "Copy Mezo address"),
|
|
61
|
-
React.createElement(Button, { kind: "secondary", size: "medium", "$as": "a", href: blockExplorerUrl, target: "_blank" }, "View Mezo explorer")));
|
|
62
|
-
}
|
|
63
|
-
export default Receive;
|
|
64
|
-
//# sourceMappingURL=Receive.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Receive.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Receive/Receive.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,UAAU,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAElE,SAAS,OAAO;IACd,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE5C,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,kBAAkB,EAAE,CAAA;IAErC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE3E,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,IAAI,CAAC,aAAa,CAAC,cAAe,CAAC,CAAA;QACnC,yBAAyB,CAAC,IAAI,CAAC,CAAA;QAE/B,UAAU,CAAC,GAAG,EAAE;YACd,yBAAyB,CAAC,KAAK,CAAC,CAAA;QAClC,CAAC,EAAE,IAAI,CAAC,CAAA;IACV,CAAC,CAAA;IAED,MAAM,gBAAgB,GAA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,CAAC,MAAM,CAAC,KAAK,EAC/B,SAAS,EAAE;oBACT,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;4BACpC,QAAQ,EAAE,QAAQ;4BAClB,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;4BACrC,UAAU,EAAE,CAAC;yBACd;qBACF;iBACF,GACD;YAEF,oBAAC,eAAe,QAAE,aAAa,CAAC,cAAc,CAAmB,CAC3D;QAER,oBAAC,MAAM,IACL,OAAO,EAAE,iBAAiB,EAC1B,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE;gBACT,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;qBACpC;iBACF;aACF,IAEA,sBAAsB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAClD;QAET,oBAAC,MAAM,IACL,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,QAAQ,SACT,GAAG,EACP,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAC,QAAQ,yBAGR,CACQ,CACpB,CAAA;AACH,CAAC;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountAddressActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAKX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AA0BzB,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,UAAU,qBA+D9D"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ArrowNarrowLeft, Block, Button, mergeOverrides, useStyletron, } from "@mezo-org/mezo-clay";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
4
|
-
import { getAddressExplorerUrl } from "../../../utils/address";
|
|
5
|
-
import useDropdownStore, { DropdownView } from "../../../stores/dropdownStore";
|
|
6
|
-
import { useWalletAccount } from "../../../hooks/useWalletAccount";
|
|
7
|
-
const buttonStartEnhancerSize = 12;
|
|
8
|
-
const commonButtonProps = {
|
|
9
|
-
kind: "secondary",
|
|
10
|
-
size: "small",
|
|
11
|
-
shape: "pill",
|
|
12
|
-
overrides: {
|
|
13
|
-
BaseButton: {
|
|
14
|
-
style: {
|
|
15
|
-
flex: 1,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
StartEnhancer: {
|
|
19
|
-
style: {
|
|
20
|
-
stroke: "currentColor",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
export default function AccountAddressActions(props) {
|
|
26
|
-
const { overrides, ...restProps } = props;
|
|
27
|
-
const [, theme] = useStyletron();
|
|
28
|
-
const { environment } = usePassportContext();
|
|
29
|
-
const setDropdownView = useDropdownStore((state) => state.setView);
|
|
30
|
-
const handleReceiveClick = () => setDropdownView(DropdownView.RECEIVE);
|
|
31
|
-
const walletAccount = useWalletAccount();
|
|
32
|
-
const blockExplorerUrl = getAddressExplorerUrl(walletAccount.accountAddress, "mezo", environment === "testnet");
|
|
33
|
-
return (React.createElement(Block, { display: "flex", alignItems: "center", backgroundColor: "transparent", padding: `0 ${theme.sizing.scale600} ${theme.sizing.scale800}`, overrides: mergeOverrides({
|
|
34
|
-
Block: {
|
|
35
|
-
style: {
|
|
36
|
-
gap: theme.sizing.scale600,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
}, overrides), ...restProps },
|
|
40
|
-
React.createElement(Button, { onClick: handleReceiveClick, startEnhancer: React.createElement(ArrowNarrowLeft, { size: buttonStartEnhancerSize, overrides: {
|
|
41
|
-
Svg: {
|
|
42
|
-
style: {
|
|
43
|
-
transform: "rotate(-45deg)",
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
} }), ...commonButtonProps }, "Receive"),
|
|
47
|
-
React.createElement(Button, { "$as": "a", href: blockExplorerUrl, target: "_blank", ...commonButtonProps }, "Block Explorer")));
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=AccountAddressActions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountAddressActions.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountAddressActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,EAEL,MAAM,EAEN,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,gBAAgB,EAAE,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAElE,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC,MAAM,iBAAiB,GAAyB;IAC9C,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,MAAM;IACb,SAAS,EAAE;QACT,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,CAAC;aACR;SACF;QACD,aAAa,EAAE;YACb,KAAK,EAAE;gBACL,MAAM,EAAE,cAAc;aACvB;SACF;KACF;CACF,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAiB;IAC7D,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAEzC,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAChC,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAC5C,MAAM,eAAe,GAAG,gBAAgB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAClE,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;IAEtE,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAA;IAExC,MAAM,gBAAgB,GAAG,qBAAqB,CAC5C,aAAa,CAAC,cAAe,EAC7B,MAAM,EACN,WAAW,KAAK,SAAS,CAC1B,CAAA;IAED,OAAO,CACL,oBAAC,KAAK,IACJ,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,QAAQ,EACnB,eAAe,EAAC,aAAa,EAC7B,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAC9D,SAAS,EAAE,cAAc,CACvB;YACE,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;iBAC3B;aACF;SACF,EACD,SAAS,CACV,KACG,SAAS;QAEb,oBAAC,MAAM,IACL,OAAO,EAAE,kBAAkB,EAC3B,aAAa,EACX,oBAAC,eAAe,IACd,IAAI,EAAE,uBAAuB,EAC7B,SAAS,EAAE;oBACT,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL,SAAS,EAAE,gBAAgB;yBAC5B;qBACF;iBACF,GACD,KAEA,iBAAiB,cAGd;QAET,oBAAC,MAAM,WACD,GAAG,EACP,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAC,QAAQ,KACX,iBAAiB,qBAGd,CACH,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
3
|
-
type AccountBalanceProps = Omit<BlockProps, "children">;
|
|
4
|
-
export default function AccountBalance(props: AccountBalanceProps): React.JSX.Element;
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=AccountBalance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAgB,MAAM,qBAAqB,CAAA;AAS9D,KAAK,mBAAmB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAEvD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAwDhE"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useStyletron } from "@mezo-org/mezo-clay";
|
|
3
|
-
import { formatUnits } from "viem";
|
|
4
|
-
import ListingItem from "../ListingItem";
|
|
5
|
-
import { useTokensBalances } from "../../../hooks/useTokensBalances";
|
|
6
|
-
import { useBorrowData } from "../../../hooks/useBorrowData";
|
|
7
|
-
import AccountError from "./AccountError";
|
|
8
|
-
import { CONVERSION_RATE_DECIMALS } from "../../../hooks/useAssetsConversionRates";
|
|
9
|
-
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
10
|
-
export default function AccountBalance(props) {
|
|
11
|
-
const { overrides, ...restProps } = props;
|
|
12
|
-
const [, theme] = useStyletron();
|
|
13
|
-
const { nativeBalanceRefetchInterval } = usePassportContext();
|
|
14
|
-
const { data: tokensBalancesData, isError: isTokensBalancesError, isPending: isTokensBalancesDataPending, } = useTokensBalances({
|
|
15
|
-
queryOptions: {
|
|
16
|
-
staleTime: nativeBalanceRefetchInterval,
|
|
17
|
-
refetchInterval: nativeBalanceRefetchInterval,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
const { data: borrowData, isError: isBorrowDataError, isPending: isBorrowDataPending, } = useBorrowData();
|
|
21
|
-
if (isTokensBalancesDataPending || isBorrowDataPending) {
|
|
22
|
-
return React.createElement(ListingItem, { isLoading: true, overrides: overrides });
|
|
23
|
-
}
|
|
24
|
-
if (isTokensBalancesError || isBorrowDataError) {
|
|
25
|
-
return (React.createElement(AccountError, { padding: `${theme.sizing.scale500} ${theme.sizing.scale800}`, topic: "account balance", overrides: overrides }));
|
|
26
|
-
}
|
|
27
|
-
const totalBalanceInUsd = Object.values(tokensBalancesData).reduce((acc, tokenBalance) => acc + tokenBalance.usd.value, 0n);
|
|
28
|
-
const totalBalanceNumber = Number(formatUnits(totalBalanceInUsd, CONVERSION_RATE_DECIMALS));
|
|
29
|
-
const totalDebtNumber = Number(borrowData.debtInUsd.formatted);
|
|
30
|
-
return (React.createElement(ListingItem, { label: "Total assets", value: totalBalanceNumber, subLabel: "Total liabilities", subValue: totalDebtNumber, overrides: overrides, ...restProps }));
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=AccountBalance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBalance.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAItE,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAA0B;IAC/D,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IACzC,MAAM,CAAC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AAc,EACpB,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAC,mBAAmB,EAC5B,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,SAAS,KAChB,SAAS,GACb,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
3
|
-
type AccountBTCListingProps = Omit<BlockProps, "children">;
|
|
4
|
-
export default function AccountBTCListing(props: AccountBTCListingProps): React.JSX.Element;
|
|
5
|
-
export {};
|
|
6
|
-
//# sourceMappingURL=AccountBtcListing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBtcListing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBtcListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAiB,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAQ/D,KAAK,sBAAsB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAE1D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,qBAyCtE"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BitcoinCircle } from "@mezo-org/mezo-clay";
|
|
3
|
-
import ListingItem from "../ListingItem";
|
|
4
|
-
import { getAsset } from "../../../utils/assets";
|
|
5
|
-
import { useBorrowData } from "../../../hooks/useBorrowData";
|
|
6
|
-
import { useTokensBalances } from "../../../hooks/useTokensBalances";
|
|
7
|
-
import AccountError from "./AccountError";
|
|
8
|
-
import { usePassportContext } from "../../../hooks/usePassportContext";
|
|
9
|
-
export default function AccountBTCListing(props) {
|
|
10
|
-
const { nativeBalanceRefetchInterval } = usePassportContext();
|
|
11
|
-
const { data: borrowData, isError: isBorrowDataError, isPending: isBorrowDataPending, } = useBorrowData();
|
|
12
|
-
const { data: tokensBalancesData, isError: isTokensBalancesError, isPending: isTokensBalancesPending, } = useTokensBalances({
|
|
13
|
-
queryOptions: {
|
|
14
|
-
staleTime: nativeBalanceRefetchInterval,
|
|
15
|
-
refetchInterval: nativeBalanceRefetchInterval,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
if (isTokensBalancesPending || isBorrowDataPending) {
|
|
19
|
-
return React.createElement(ListingItem, { isLoading: true });
|
|
20
|
-
}
|
|
21
|
-
if (isTokensBalancesError || isBorrowDataError) {
|
|
22
|
-
return React.createElement(AccountError, { topic: "Bitcoin balance" });
|
|
23
|
-
}
|
|
24
|
-
const btcBalance = Number(tokensBalancesData.BTC.usd.formatted);
|
|
25
|
-
const lockedCollateral = Number(borrowData.collateral.usd.formatted);
|
|
26
|
-
return (React.createElement(ListingItem, { icon: React.createElement(BitcoinCircle, null), label: getAsset("BTC").name, value: btcBalance, subLabel: "Locked collateral", subValue: lockedCollateral, ...props }));
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=AccountBtcListing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountBtcListing.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountBtcListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAc,MAAM,qBAAqB,CAAA;AAC/D,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAItE,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAA6B;IACrE,MAAM,EAAE,4BAA4B,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAE7D,MAAM,EACJ,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,mBAAmB,GAC/B,GAAG,aAAa,EAAE,CAAA;IAEnB,MAAM,EACJ,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,uBAAuB,GACnC,GAAG,iBAAiB,CAAC;QACpB,YAAY,EAAE;YACZ,SAAS,EAAE,4BAA4B;YACvC,eAAe,EAAE,4BAA4B;SAC9C;KACF,CAAC,CAAA;IAEF,IAAI,uBAAuB,IAAI,mBAAmB,EAAE,CAAC;QACnD,OAAO,oBAAC,WAAW,IAAC,SAAS,SAAG,CAAA;IAClC,CAAC;IAED,IAAI,qBAAqB,IAAI,iBAAiB,EAAE,CAAC;QAC/C,OAAO,oBAAC,YAAY,IAAC,KAAK,EAAC,iBAAiB,GAAG,CAAA;IACjD,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAC/D,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAEpE,OAAO,CACL,oBAAC,WAAW,IACV,IAAI,EAAE,oBAAC,aAAa,OAAG,EACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,EAC3B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAC,mBAAmB,EAC5B,QAAQ,EAAE,gBAAgB,KACtB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
3
|
-
type AccountErrorProps = {
|
|
4
|
-
topic: string;
|
|
5
|
-
} & BlockProps;
|
|
6
|
-
export default function AccountError(props: AccountErrorProps): React.JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=AccountError.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountError.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,UAAU,EAIX,MAAM,qBAAqB,CAAA;AAE5B,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,GAAG,UAAU,CAAA;AAEd,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAqB5D"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { LabelSmall, mergeOverrides, useStyletron, } from "@mezo-org/mezo-clay";
|
|
3
|
-
export default function AccountError(props) {
|
|
4
|
-
const { topic, overrides, ...restProps } = props;
|
|
5
|
-
const [, theme] = useStyletron();
|
|
6
|
-
return (React.createElement(LabelSmall, { padding: `${theme.sizing.scale600} ${theme.sizing.scale800}`, color: "negative", overrides: mergeOverrides(overrides, {
|
|
7
|
-
Block: {
|
|
8
|
-
style: {
|
|
9
|
-
lineHeight: theme.sizing.scale700,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
}), ...restProps },
|
|
13
|
-
"An error occured loading ",
|
|
14
|
-
topic,
|
|
15
|
-
"."));
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=AccountError.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountError.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountError.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEL,UAAU,EACV,cAAc,EACd,YAAY,GACb,MAAM,qBAAqB,CAAA;AAM5B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAwB;IAC3D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAEhD,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,OAAO,CACL,oBAAC,UAAU,IACT,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,EAC5D,KAAK,EAAC,UAAU,EAChB,SAAS,EAAE,cAAc,CAAC,SAAS,EAAE;YACnC,KAAK,EAAE;gBACL,KAAK,EAAE;oBACL,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;iBAClC;aACF;SACF,CAAC,KACE,SAAS;;QAEa,KAAK;YACpB,CACd,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountMusdListing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountMusdListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAgB,MAAM,qBAAqB,CAAA;AAO9D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,qBAmCpC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { MUsdCircle02 } from "@mezo-org/mezo-clay";
|
|
3
|
-
import ListingItem from "../ListingItem";
|
|
4
|
-
import { getAsset } from "../../../utils/assets";
|
|
5
|
-
import { useBorrowData } from "../../../hooks/useBorrowData";
|
|
6
|
-
import { useTokensBalances } from "../../../hooks/useTokensBalances";
|
|
7
|
-
import AccountError from "./AccountError";
|
|
8
|
-
export default function AccountMusdListing(props) {
|
|
9
|
-
const { data: borrowData, isError: isBorrowDataError, isPending: isBorrowDataPending, } = useBorrowData();
|
|
10
|
-
const { data: tokensBalancesData, isError: isTokensBalancesError, isPending: isTokensBalancesPending, } = useTokensBalances();
|
|
11
|
-
if (isBorrowDataPending || isTokensBalancesPending) {
|
|
12
|
-
return React.createElement(ListingItem, { isLoading: true });
|
|
13
|
-
}
|
|
14
|
-
if (isBorrowDataError || isTokensBalancesError) {
|
|
15
|
-
return React.createElement(AccountError, { topic: "MUSD balance" });
|
|
16
|
-
}
|
|
17
|
-
const musdBalance = Number(tokensBalancesData.MUSD.usd.formatted);
|
|
18
|
-
const lockedCollateral = Number(borrowData.debtInUsd.formatted);
|
|
19
|
-
return (React.createElement(ListingItem, { icon: React.createElement(MUsdCircle02, null), label: getAsset("MUSD").name, value: musdBalance, subLabel: "Borrowed", subValue: lockedCollateral, ...props }));
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=AccountMusdListing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountMusdListing.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountMusdListing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAc,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAEzC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACxC,KAAmC;IAEnC,MAAM,EACJ,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,SAAS,EAAE,mBAAmB,GAC/B,GAAG,aAAa,EAAE,CAAA;IAEnB,MAAM,EACJ,IAAI,EAAE,kBAAkB,EACxB,OAAO,EAAE,qBAAqB,EAC9B,SAAS,EAAE,uBAAuB,GACnC,GAAG,iBAAiB,EAAE,CAAA;IAEvB,IAAI,mBAAmB,IAAI,uBAAuB,EAAE,CAAC;QACnD,OAAO,oBAAC,WAAW,IAAC,SAAS,SAAG,CAAA;IAClC,CAAC;IAED,IAAI,iBAAiB,IAAI,qBAAqB,EAAE,CAAC;QAC/C,OAAO,oBAAC,YAAY,IAAC,KAAK,EAAC,cAAc,GAAG,CAAA;IAC9C,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACjE,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IAE/D,OAAO,CACL,oBAAC,WAAW,IACV,IAAI,EAAE,oBAAC,YAAY,OAAG,EACtB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAC5B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAC,UAAU,EACnB,QAAQ,EAAE,gBAAgB,KACtB,KAAK,GACT,CACH,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { BlockProps } from "@mezo-org/mezo-clay";
|
|
3
|
-
type AccountOtherAssetsProps = {
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
} & Omit<BlockProps, "children">;
|
|
6
|
-
export default function AccountOtherAssets(props: AccountOtherAssetsProps): React.JSX.Element;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=AccountOtherAssets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountOtherAssets.d.ts","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountOtherAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAIL,UAAU,EACX,MAAM,qBAAqB,CAAA;AAO5B,KAAK,uBAAuB,GAAG;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,GAAG,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAEhC,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,qBAmExE"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useStyletron, CoinsStacked02, mergeOverrides, } from "@mezo-org/mezo-clay";
|
|
3
|
-
import { formatUnits } from "viem";
|
|
4
|
-
import ListingItem from "../ListingItem";
|
|
5
|
-
import { useTokensBalances } from "../../../hooks/useTokensBalances";
|
|
6
|
-
import AccountError from "./AccountError";
|
|
7
|
-
import { CONVERSION_RATE_DECIMALS } from "../../../hooks/useAssetsConversionRates";
|
|
8
|
-
export default function AccountOtherAssets(props) {
|
|
9
|
-
const { onClick, overrides, ...restProps } = props;
|
|
10
|
-
const [, theme] = useStyletron();
|
|
11
|
-
const { data: tokensBalancesData, isPending: isTokensBalancesPending, isError: isTokensBalancesError, } = useTokensBalances();
|
|
12
|
-
if (isTokensBalancesPending) {
|
|
13
|
-
return React.createElement(ListingItem, { isLoading: true, overrides: overrides });
|
|
14
|
-
}
|
|
15
|
-
if (isTokensBalancesError) {
|
|
16
|
-
return (React.createElement(AccountError, { topic: "other assets", paddingTop: theme.sizing.scale100, paddingBottom: theme.sizing.scale100, overrides: overrides }));
|
|
17
|
-
}
|
|
18
|
-
const otherAssets = Object.values(tokensBalancesData)
|
|
19
|
-
.filter((asset) => !["BTC", "MUSD"].includes(asset.symbol))
|
|
20
|
-
.filter((asset) => asset.value > 0n);
|
|
21
|
-
const assetsCount = otherAssets.length;
|
|
22
|
-
const totalAssetsInUsd = Number(formatUnits(otherAssets.reduce((total, asset) => total + asset.usd.value, 0n), CONVERSION_RATE_DECIMALS));
|
|
23
|
-
let label = "No other assets";
|
|
24
|
-
if (assetsCount === 1)
|
|
25
|
-
label = "1 more asset";
|
|
26
|
-
if (assetsCount > 1)
|
|
27
|
-
label = `${assetsCount} more assets`;
|
|
28
|
-
return (React.createElement(ListingItem, { icon: React.createElement(CoinsStacked02, { color: theme.colors.contentPrimary }), label: label, value: totalAssetsInUsd, overrides: mergeOverrides({
|
|
29
|
-
Block: {
|
|
30
|
-
props: {
|
|
31
|
-
$as: "button",
|
|
32
|
-
onClick,
|
|
33
|
-
},
|
|
34
|
-
style: {
|
|
35
|
-
borderWidth: 0,
|
|
36
|
-
cursor: "pointer",
|
|
37
|
-
backgroundColor: "transparent",
|
|
38
|
-
minHeight: "56px",
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
}, overrides), ...restProps }));
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=AccountOtherAssets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AccountOtherAssets.js","sourceRoot":"","sources":["../../../../../src/components/Dropdown/Root/AccountOtherAssets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,GAEf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,WAAW,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAA;AACpE,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAMlF,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAA8B;IACvE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAElD,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,YAAY,EAAE,CAAA;IAEhC,MAAM,EACJ,IAAI,EAAE,kBAAkB,EACxB,SAAS,EAAE,uBAAuB,EAClC,OAAO,EAAE,qBAAqB,GAC/B,GAAG,iBAAiB,EAAE,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