@aurora-is-near/intents-swap-widget 3.14.0-redesign.3 → 3.14.0-redesign.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/components/BlockingError.js +15 -9
- package/dist/components/BlockingError.js.map +1 -1
- package/dist/components/CloseButton.js +1 -1
- package/dist/components/CloseButton.js.map +1 -1
- package/dist/config-Behl5hcc.js +2836 -0
- package/dist/config-Behl5hcc.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +4 -6
- package/dist/config.js.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/ext/alchemy/index.js +1 -1
- package/dist/ext/index.js +1 -1
- package/dist/features/BalanceRpcLoader/TokenBalanceLoader.js +1 -1
- package/dist/features/BalanceRpcLoader/index.js +1 -1
- package/dist/features/BalanceRpcLoader/useTokenBalanceRpc.js +1 -1
- package/dist/features/ChainsDropdown/index.js +1 -1
- package/dist/features/DepositMethodSwitcher.js +26 -29
- package/dist/features/DepositMethodSwitcher.js.map +1 -1
- package/dist/features/ErrorBoundary.js +1 -1
- package/dist/features/ExternalDeposit.js +13 -14
- package/dist/features/ExternalDeposit.js.map +1 -1
- package/dist/features/SendAddress/index.js +1 -1
- package/dist/features/SendAddress/useNotification.js +1 -1
- package/dist/features/SubmitButton/index.js +1 -1
- package/dist/features/SuccessScreen/SummaryItem.js +2 -2
- package/dist/features/SuccessScreen/SummaryItem.js.map +1 -1
- package/dist/features/SuccessScreen/index.js +20 -20
- package/dist/features/SuccessScreen/index.js.map +1 -1
- package/dist/features/SwapDirectionSwitcher.js +1 -1
- package/dist/features/SwapQuote/SwapQuote.js +1 -1
- package/dist/features/SwapQuote/index.js +1 -1
- package/dist/features/TokenInput/TokenInput.js +1 -1
- package/dist/features/TokenInput/TokenInputEmpty.js +1 -1
- package/dist/features/TokenInput/TokenInputSource.js +1 -1
- package/dist/features/TokenInput/TokenInputTarget.js +1 -1
- package/dist/features/TokenInput/WalletBalance.js +1 -1
- package/dist/features/TokenInput/hooks/index.js +1 -1
- package/dist/features/TokenInput/hooks/useTokenInputBalance.js +1 -1
- package/dist/features/TokenInput/index.js +1 -1
- package/dist/features/TokensList/TokenItem.js +1 -1
- package/dist/features/TokensList/TokensList.js +1 -1
- package/dist/features/TokensList/index.js +1 -1
- package/dist/features/TokensModal.js +1 -1
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js +13 -191
- package/dist/features/WalletCompatibilityCheck/WalletCompatibilityModal.js.map +1 -1
- package/dist/features/WalletCompatibilityCheck/index.js +21 -26
- package/dist/features/WalletCompatibilityCheck/index.js.map +1 -1
- package/dist/features/index.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAllTokens.js +1 -1
- package/dist/hooks/useChains.js +1 -1
- package/dist/hooks/useCompatibilityCheck.js +1 -1
- package/dist/hooks/useDefaultToken.js +1 -1
- package/dist/hooks/useExternalDepositStatus/index.js +1 -1
- package/dist/hooks/useExternalDepositStatus/usePoaExternalDepositStatus.js +1 -1
- package/dist/hooks/useIntentsBalance.js +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.d.ts +1 -1
- package/dist/hooks/useIsCompatibilityCheckRequired.js +2 -2
- package/dist/hooks/useIsCompatibilityCheckRequired.js.map +1 -1
- package/dist/hooks/useMakeDepositAddress.js +1 -1
- package/dist/hooks/useMakeIntentsTransfer.js +1 -1
- package/dist/hooks/useMakeNEARFtTransferCall.js +1 -1
- package/dist/hooks/useMakeQuote.js +1 -1
- package/dist/hooks/useMakeQuoteTransfer.js +1 -1
- package/dist/hooks/useMakeTransfer.js +1 -1
- package/dist/hooks/useMergedBalance.js +1 -1
- package/dist/hooks/useSwitchChain.js +1 -1
- package/dist/hooks/useTheme.js +1 -1
- package/dist/hooks/useToggleTheme.js +20 -17
- package/dist/hooks/useToggleTheme.js.map +1 -1
- package/dist/hooks/useTokenInputPair.js +1 -1
- package/dist/hooks/useTokens.js +1 -1
- package/dist/hooks/useTokensFiltered.js +1 -1
- package/dist/hooks/useTokensIntentsUnique.js +1 -1
- package/dist/index.js +1 -1
- package/dist/machine/effects/index.js +1 -1
- package/dist/machine/effects/useAlchemyBalanceEffect.js +1 -1
- package/dist/machine/effects/useBalancesUpdateEffect.js +1 -1
- package/dist/machine/effects/useMakeQuoteEffect.js +1 -1
- package/dist/machine/effects/useSelectedTokensEffect.js +1 -1
- package/dist/machine/effects/useSetTokenBalanceEffect.js +1 -1
- package/dist/machine/effects/useSetTokenIntentsTargetEffect.js +1 -1
- package/dist/machine/effects/useWalletConnEffect.js +1 -1
- package/dist/machine/events/index.js +1 -1
- package/dist/machine/events/tokenSelect.js +1 -1
- package/dist/machine/events/validateInputAndMoveTo.js +1 -1
- package/dist/machine/events/validateInputs.js +1 -1
- package/dist/machine/index.js +1 -1
- package/dist/machine/snap.js +1 -1
- package/dist/machine/subscriptions/checkers/isSendAddressAsConnected.js +1 -1
- package/dist/machine/subscriptions/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/ThemeProvider.js +7 -24
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/types/config.d.ts +1 -0
- package/dist/types/localisation.d.ts +1 -1
- package/dist/utils/intents/signers/near.js +1 -1
- package/dist/utils/intents/signers/privy.js +1 -1
- package/dist/utils/near/getNearNep141StorageBalance.js +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js +11 -12
- package/dist/widgets/WidgetDeposit/WidgetDepositContent.js.map +1 -1
- package/dist/widgets/WidgetDeposit/WidgetDepositSkeleton.js +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js +27 -26
- package/dist/widgets/WidgetSwap/WidgetSwapContent.js.map +1 -1
- package/dist/widgets/WidgetSwap/WidgetSwapSkeleton.js +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js +5 -6
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawContent.js.map +1 -1
- package/dist/widgets/WidgetWithdraw/WidgetWithdrawSkeleton.js +1 -1
- package/package.json +2 -1
- package/src/components/BlockingError.tsx +7 -4
- package/src/components/CloseButton.tsx +1 -1
- package/src/features/DepositMethodSwitcher.tsx +5 -17
- package/src/features/ExternalDeposit.tsx +6 -6
- package/src/features/SuccessScreen/SummaryItem.tsx +2 -2
- package/src/features/SuccessScreen/index.tsx +5 -3
- package/src/features/SwapQuote/SwapQuote.tsx +1 -1
- package/src/features/WalletCompatibilityCheck/WalletCompatibilityModal.tsx +3 -0
- package/src/features/WalletCompatibilityCheck/index.tsx +4 -8
- package/src/hooks/useIsCompatibilityCheckRequired.ts +1 -1
- package/src/hooks/useToggleTheme.ts +11 -4
- package/src/theme/ThemeProvider.tsx +33 -14
- package/src/types/config.ts +1 -0
- package/src/types/localisation.ts +1 -0
- package/src/widgets/WidgetDeposit/WidgetDepositContent.tsx +3 -3
- package/src/widgets/WidgetSwap/WidgetSwapContent.tsx +5 -3
- package/src/widgets/WidgetWithdraw/WidgetWithdrawContent.tsx +3 -3
- package/dist/config-1EcDCy24.js +0 -2628
- package/dist/config-1EcDCy24.js.map +0 -1
- package/dist/features/SuccessScreen/CloseButton.d.ts +0 -5
- package/dist/features/SuccessScreen/CloseButton.js +0 -15
- package/dist/features/SuccessScreen/CloseButton.js.map +0 -1
- package/src/features/SuccessScreen/CloseButton.tsx +0 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "virtua";
|
|
3
3
|
import "react";
|
|
4
|
-
import {
|
|
4
|
+
import { ad as f } from "../../config-Behl5hcc.js";
|
|
5
5
|
import "./TokensListPlaceholder.js";
|
|
6
6
|
import "../../utils/cn.js";
|
|
7
7
|
import "../../components/Hr.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as t, Fragment as _ } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m } from "react";
|
|
3
3
|
import * as b from "lucide-react";
|
|
4
|
-
import { b as g, y as N, d as T, q as j } from "../config-
|
|
4
|
+
import { b as g, y as N, d as T, q as j } from "../config-Behl5hcc.js";
|
|
5
5
|
import { ChainsDropdown as I } from "./ChainsDropdown/index.js";
|
|
6
6
|
import "@tanstack/react-query";
|
|
7
7
|
import "@defuse-protocol/one-click-sdk-typescript";
|
|
@@ -1,202 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "@material-symbols-svg/react-rounded";
|
|
3
|
+
import "use-timer";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../../localisation.js";
|
|
6
6
|
import "../../constants/chains.js";
|
|
7
7
|
import "viem";
|
|
8
8
|
import "ethers";
|
|
9
|
-
import
|
|
9
|
+
import "../../utils/cn.js";
|
|
10
10
|
import "lucide-react";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import "../../components/Card.js";
|
|
12
|
+
import "../../components/Button.js";
|
|
13
13
|
import "copy-text-to-clipboard";
|
|
14
14
|
import "@headlessui/react";
|
|
15
15
|
import "../../components/InputAmount.js";
|
|
16
16
|
import "../../components/Notes.js";
|
|
17
|
-
import "../../
|
|
18
|
-
import
|
|
19
|
-
const n = ({
|
|
20
|
-
text: t,
|
|
21
|
-
icon: e
|
|
22
|
-
}) => /* @__PURE__ */ a("li", { className: "flex items-center gap-sw-md", children: [
|
|
23
|
-
e && /* @__PURE__ */ l(e, { size: 20, className: "text-sw-gray-300" }),
|
|
24
|
-
/* @__PURE__ */ l("span", { className: "text-sw-label-md text-sw-gray-50", children: t })
|
|
25
|
-
] }), c = ({
|
|
26
|
-
label: t,
|
|
27
|
-
icon: e,
|
|
28
|
-
className: s
|
|
29
|
-
}) => /* @__PURE__ */ a(
|
|
30
|
-
"div",
|
|
31
|
-
{
|
|
32
|
-
className: N(
|
|
33
|
-
"rounded-sw-lg flex align-center justify-center gap-sw-md w-full py-sw-2xl",
|
|
34
|
-
s
|
|
35
|
-
),
|
|
36
|
-
children: [
|
|
37
|
-
e && /* @__PURE__ */ l(e, { size: 16 }),
|
|
38
|
-
/* @__PURE__ */ l("span", { className: "text-sw-label-md", children: t })
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
), C = ({ isSigned: t, isSigning: e, onMsg: s }) => {
|
|
42
|
-
const { t: i } = m(), o = b({
|
|
43
|
-
endTime: 0,
|
|
44
|
-
autostart: !1,
|
|
45
|
-
timerType: "DECREMENTAL",
|
|
46
|
-
initialTime: 7
|
|
47
|
-
});
|
|
48
|
-
return h(() => {
|
|
49
|
-
t ? o.start() : o.reset();
|
|
50
|
-
}, [t]), /* @__PURE__ */ a(p, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
51
|
-
/* @__PURE__ */ l(
|
|
52
|
-
d,
|
|
53
|
-
{
|
|
54
|
-
onClick: () => s({ type: "on_close" }),
|
|
55
|
-
className: "absolute top-sw-2xl right-sw-2xl"
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
/* @__PURE__ */ l(u, { size: 48, className: "text-sw-status-warning" }),
|
|
59
|
-
/* @__PURE__ */ a("header", { className: "flex flex-col gap-sw-lg", children: [
|
|
60
|
-
/* @__PURE__ */ l("h1", { className: "text-sw-label-lg text-sw-gray-50", children: i(
|
|
61
|
-
"walletCompatibility.modal.title.initial",
|
|
62
|
-
"Verify your wallet to continue"
|
|
63
|
-
) }),
|
|
64
|
-
/* @__PURE__ */ l("p", { className: "text-sw-body-md text-sw-gray-200", children: i(
|
|
65
|
-
"walletCompatibility.modal.description.initial",
|
|
66
|
-
"Please sign a message to verify your wallet. This confirms your wallet is compatible and lets us securely read your public key."
|
|
67
|
-
) })
|
|
68
|
-
] }),
|
|
69
|
-
/* @__PURE__ */ a("ul", { className: "flex flex-col gap-sw-xl", children: [
|
|
70
|
-
/* @__PURE__ */ l(
|
|
71
|
-
n,
|
|
72
|
-
{
|
|
73
|
-
text: i(
|
|
74
|
-
"walletCompatibility.modal.feature.secureTransactions",
|
|
75
|
-
"Read-only signature – no gas required."
|
|
76
|
-
),
|
|
77
|
-
icon: w
|
|
78
|
-
}
|
|
79
|
-
),
|
|
80
|
-
/* @__PURE__ */ l(
|
|
81
|
-
n,
|
|
82
|
-
{
|
|
83
|
-
text: i(
|
|
84
|
-
"walletCompatibility.modal.feature.fullAccess",
|
|
85
|
-
"No access to your funds, no hidden permissions."
|
|
86
|
-
),
|
|
87
|
-
icon: y
|
|
88
|
-
}
|
|
89
|
-
),
|
|
90
|
-
/* @__PURE__ */ l(
|
|
91
|
-
n,
|
|
92
|
-
{
|
|
93
|
-
text: i(
|
|
94
|
-
"walletCompatibility.modal.feature.fundProtection",
|
|
95
|
-
"Only checks whether your wallet is supported."
|
|
96
|
-
),
|
|
97
|
-
icon: f
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
] }),
|
|
101
|
-
t ? /* @__PURE__ */ a("div", { className: "flex flex-col gap-sw-xl mt-sw-lg w-full", children: [
|
|
102
|
-
/* @__PURE__ */ l(
|
|
103
|
-
c,
|
|
104
|
-
{
|
|
105
|
-
label: i(
|
|
106
|
-
"walletCompatibility.modal.button.verified",
|
|
107
|
-
"Wallet verified"
|
|
108
|
-
),
|
|
109
|
-
className: "bg-sw-status-success text-sw-gray-950",
|
|
110
|
-
icon: x
|
|
111
|
-
}
|
|
112
|
-
),
|
|
113
|
-
o.status === "RUNNING" && /* @__PURE__ */ l(
|
|
114
|
-
c,
|
|
115
|
-
{
|
|
116
|
-
className: "text-sw-gray-400",
|
|
117
|
-
label: i("walletCompatibility.modal.button.closeTimer", {
|
|
118
|
-
defaultValue: "Popup will close in {{count}} sec...",
|
|
119
|
-
count: o.time
|
|
120
|
-
})
|
|
121
|
-
}
|
|
122
|
-
)
|
|
123
|
-
] }) : /* @__PURE__ */ a("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
|
|
124
|
-
/* @__PURE__ */ l(
|
|
125
|
-
r,
|
|
126
|
-
{
|
|
127
|
-
size: "lg",
|
|
128
|
-
variant: "primary",
|
|
129
|
-
onClick: () => s({ type: "on_check_compatibility" }),
|
|
130
|
-
children: i("walletCompatibility.modal.button.verify", "Verify wallet")
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
/* @__PURE__ */ l(
|
|
134
|
-
r,
|
|
135
|
-
{
|
|
136
|
-
size: "lg",
|
|
137
|
-
variant: "outlined",
|
|
138
|
-
state: e ? "loading" : "default",
|
|
139
|
-
onClick: () => s({ type: "on_sign_out" }),
|
|
140
|
-
children: e ? i(
|
|
141
|
-
"walletCompatibility.modal.button.signing",
|
|
142
|
-
"Sign with your wallet"
|
|
143
|
-
) : i("walletCompatibility.modal.button.signOut", "Sign out")
|
|
144
|
-
}
|
|
145
|
-
)
|
|
146
|
-
] })
|
|
147
|
-
] });
|
|
148
|
-
}, v = ({ onMsg: t }) => {
|
|
149
|
-
const { t: e } = m();
|
|
150
|
-
return /* @__PURE__ */ a(p, { className: "relative w-full gap-sw-2xl flex flex-col", children: [
|
|
151
|
-
/* @__PURE__ */ l(
|
|
152
|
-
d,
|
|
153
|
-
{
|
|
154
|
-
onClick: () => t({ type: "on_close" }),
|
|
155
|
-
className: "absolute top-sw-2xl right-sw-2xl"
|
|
156
|
-
}
|
|
157
|
-
),
|
|
158
|
-
/* @__PURE__ */ l(g, { size: 48, className: "text-sw-status-error" }),
|
|
159
|
-
/* @__PURE__ */ a("header", { className: "flex flex-col gap-sw-lg", children: [
|
|
160
|
-
/* @__PURE__ */ l("h1", { className: "text-sw-label-lg text-sw-gray-50", children: e(
|
|
161
|
-
"walletCompatibility.modal.title.error",
|
|
162
|
-
"Unable to verify wallet"
|
|
163
|
-
) }),
|
|
164
|
-
/* @__PURE__ */ l("p", { className: "text-sw-body-md text-sw-gray-200", children: e(
|
|
165
|
-
"walletCompatibility.modal.description.error",
|
|
166
|
-
"We couldn’t complete the verification. It may have been interrupted or your wallet may not be compatible."
|
|
167
|
-
) }),
|
|
168
|
-
/* @__PURE__ */ l("p", { className: "text-sw-body-md text-sw-gray-200", children: e(
|
|
169
|
-
"walletCompatibility.modal.button.tryAgainDesc",
|
|
170
|
-
"If the issue continues, please try another wallet."
|
|
171
|
-
) })
|
|
172
|
-
] }),
|
|
173
|
-
/* @__PURE__ */ a("div", { className: "flex flex-col gap-sw-xl mt-sw-lg", children: [
|
|
174
|
-
/* @__PURE__ */ l(
|
|
175
|
-
r,
|
|
176
|
-
{
|
|
177
|
-
size: "lg",
|
|
178
|
-
variant: "primary",
|
|
179
|
-
onClick: () => t({ type: "on_try_again" }),
|
|
180
|
-
children: e("walletCompatibility.modal.button.tryAgain", "Try again")
|
|
181
|
-
}
|
|
182
|
-
),
|
|
183
|
-
/* @__PURE__ */ l(
|
|
184
|
-
r,
|
|
185
|
-
{
|
|
186
|
-
size: "lg",
|
|
187
|
-
variant: "outlined",
|
|
188
|
-
onClick: () => t({ type: "on_sign_out" }),
|
|
189
|
-
children: e("walletCompatibility.modal.button.signOut", "Sign out")
|
|
190
|
-
}
|
|
191
|
-
)
|
|
192
|
-
] })
|
|
193
|
-
] });
|
|
194
|
-
}, U = Object.assign(C, {
|
|
195
|
-
Error: v
|
|
196
|
-
});
|
|
17
|
+
import { ag as C, af as E, z as I } from "../../config-Behl5hcc.js";
|
|
18
|
+
import "../../components/CloseButton.js";
|
|
197
19
|
export {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
20
|
+
C as ErrorView,
|
|
21
|
+
E as Initial,
|
|
22
|
+
I as WalletCompatibilityModal
|
|
201
23
|
};
|
|
202
24
|
//# sourceMappingURL=WalletCompatibilityModal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletCompatibilityModal.js","sources":["../../../src/features/WalletCompatibilityCheck/WalletCompatibilityModal.tsx"],"sourcesContent":["import {\n AccountBalanceWalletFill,\n ArmingCountdownFill,\n BeenhereFill,\n CheckCircleFill,\n EncryptedFill,\n GppBadFill,\n type MaterialSymbolsComponent,\n} from '@material-symbols-svg/react-rounded';\nimport { useTimer } from 'use-timer';\nimport { useEffect } from 'react';\n\nimport { useTypedTranslation } from '@/localisation';\n\nimport { cn } from '@/utils';\nimport { Button, Card, CloseButton } from '@/components';\n\ntype Msg = { type: 'on_close' | 'on_check_compatibility' | 'on_sign_out' };\ntype MsgError = { type: 'on_close' | 'on_try_again' | 'on_sign_out' };\n\ninterface Props {\n isSigned: boolean;\n isSigning: boolean;\n onMsg: (msg: Msg) => void;\n}\n\nconst ListItem = ({\n text,\n icon: Icon,\n}: {\n text: string;\n icon: MaterialSymbolsComponent;\n}) => (\n <li className=\"flex items-center gap-sw-md\">\n {Icon && <Icon size={20} className=\"text-sw-gray-300\" />}\n <span className=\"text-sw-label-md text-sw-gray-50\">{text}</span>\n </li>\n);\n\nconst FakeButton = ({\n label,\n icon: Icon,\n className,\n}: {\n label: string;\n icon?: MaterialSymbolsComponent;\n className?: string;\n}) => (\n <div\n className={cn(\n 'rounded-sw-lg flex align-center justify-center gap-sw-md w-full py-sw-2xl',\n className,\n )}>\n {Icon && <Icon size={16} />}\n <span className=\"text-sw-label-md\">{label}</span>\n </div>\n);\n\nexport const Initial = ({ isSigned, isSigning, onMsg }: Props) => {\n const { t } = useTypedTranslation();\n\n const showTimer = useTimer({\n endTime: 0,\n autostart: false,\n timerType: 'DECREMENTAL',\n initialTime: 7,\n });\n\n useEffect(() => {\n if (isSigned) {\n showTimer.start();\n } else {\n showTimer.reset();\n }\n }, [isSigned]);\n\n return (\n <Card className=\"relative w-full gap-sw-2xl flex flex-col\">\n <CloseButton\n onClick={() => onMsg({ type: 'on_close' })}\n className=\"absolute top-sw-2xl right-sw-2xl\"\n />\n <ArmingCountdownFill size={48} className=\"text-sw-status-warning\" />\n\n <header className=\"flex flex-col gap-sw-lg\">\n <h1 className=\"text-sw-label-lg text-sw-gray-50\">\n {t(\n 'walletCompatibility.modal.title.initial',\n 'Verify your wallet to continue',\n )}\n </h1>\n <p className=\"text-sw-body-md text-sw-gray-200\">\n {t(\n 'walletCompatibility.modal.description.initial',\n 'Please sign a message to verify your wallet. This confirms your wallet is compatible and lets us securely read your public key.',\n )}\n </p>\n </header>\n\n <ul className=\"flex flex-col gap-sw-xl\">\n <ListItem\n text={t(\n 'walletCompatibility.modal.feature.secureTransactions',\n 'Read-only signature – no gas required.',\n )}\n icon={BeenhereFill}\n />\n <ListItem\n text={t(\n 'walletCompatibility.modal.feature.fullAccess',\n 'No access to your funds, no hidden permissions.',\n )}\n icon={EncryptedFill}\n />\n <ListItem\n text={t(\n 'walletCompatibility.modal.feature.fundProtection',\n 'Only checks whether your wallet is supported.',\n )}\n icon={AccountBalanceWalletFill}\n />\n </ul>\n\n {isSigned ? (\n <div className=\"flex flex-col gap-sw-xl mt-sw-lg w-full\">\n <FakeButton\n label={t(\n 'walletCompatibility.modal.button.verified',\n 'Wallet verified',\n )}\n className=\"bg-sw-status-success text-sw-gray-950\"\n icon={CheckCircleFill}\n />\n {showTimer.status === 'RUNNING' && (\n <FakeButton\n className=\"text-sw-gray-400\"\n label={t('walletCompatibility.modal.button.closeTimer', {\n defaultValue: 'Popup will close in {{count}} sec...',\n count: showTimer.time,\n })}\n />\n )}\n </div>\n ) : (\n <div className=\"flex flex-col gap-sw-xl mt-sw-lg\">\n <Button\n size=\"lg\"\n variant=\"primary\"\n onClick={() => onMsg({ type: 'on_check_compatibility' })}>\n {t('walletCompatibility.modal.button.verify', 'Verify wallet')}\n </Button>\n <Button\n size=\"lg\"\n variant=\"outlined\"\n state={isSigning ? 'loading' : 'default'}\n onClick={() => onMsg({ type: 'on_sign_out' })}>\n {isSigning\n ? t(\n 'walletCompatibility.modal.button.signing',\n 'Sign with your wallet',\n )\n : t('walletCompatibility.modal.button.signOut', 'Sign out')}\n </Button>\n </div>\n )}\n </Card>\n );\n};\n\ninterface ErrorProps {\n onMsg: (msg: MsgError) => void;\n}\n\nexport const ErrorView = ({ onMsg }: ErrorProps) => {\n const { t } = useTypedTranslation();\n\n return (\n <Card className=\"relative w-full gap-sw-2xl flex flex-col\">\n <CloseButton\n onClick={() => onMsg({ type: 'on_close' })}\n className=\"absolute top-sw-2xl right-sw-2xl\"\n />\n <GppBadFill size={48} className=\"text-sw-status-error\" />\n\n <header className=\"flex flex-col gap-sw-lg\">\n <h1 className=\"text-sw-label-lg text-sw-gray-50\">\n {t(\n 'walletCompatibility.modal.title.error',\n 'Unable to verify wallet',\n )}\n </h1>\n <p className=\"text-sw-body-md text-sw-gray-200\">\n {t(\n 'walletCompatibility.modal.description.error',\n 'We couldn’t complete the verification. It may have been interrupted or your wallet may not be compatible.',\n )}\n </p>\n <p className=\"text-sw-body-md text-sw-gray-200\">\n {t(\n 'walletCompatibility.modal.button.tryAgainDesc',\n 'If the issue continues, please try another wallet.',\n )}\n </p>\n </header>\n\n <div className=\"flex flex-col gap-sw-xl mt-sw-lg\">\n <Button\n size=\"lg\"\n variant=\"primary\"\n onClick={() => onMsg({ type: 'on_try_again' })}>\n {t('walletCompatibility.modal.button.tryAgain', 'Try again')}\n </Button>\n <Button\n size=\"lg\"\n variant=\"outlined\"\n onClick={() => onMsg({ type: 'on_sign_out' })}>\n {t('walletCompatibility.modal.button.signOut', 'Sign out')}\n </Button>\n </div>\n </Card>\n );\n};\n\nexport const WalletCompatibilityModal = Object.assign(Initial, {\n Error: ErrorView,\n});\n"],"names":["ListItem","text","Icon","jsxs","jsx","FakeButton","label","className","cn","Initial","isSigned","isSigning","onMsg","t","useTypedTranslation","showTimer","useTimer","useEffect","Card","CloseButton","ArmingCountdownFill","BeenhereFill","EncryptedFill","AccountBalanceWalletFill","CheckCircleFill","Button","ErrorView","GppBadFill","WalletCompatibilityModal"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,MAAMA,IAAW,CAAC;AAAA,EAChB,MAAAC;AAAA,EACA,MAAMC;AACR,MAIE,gBAAAC,EAAC,MAAA,EAAG,WAAU,+BACX,UAAA;AAAA,EAAAD,KAAQ,gBAAAE,EAACF,GAAA,EAAK,MAAM,IAAI,WAAU,oBAAmB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AE,MAAM,gBAAgB;AAAA,UAC5C,UAAAC,EAAE,6CAA6C,WAAW;AAAA,QAAA;AAAA,MAAA;AAAA,MAE7D,gBAAAT;AAAA,QAACqB;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,SAAQ;AAAA,UACR,SAAS,MAAMb,EAAM,EAAE,MAAM,eAAe;AAAA,UAC3C,UAAAC,EAAE,4CAA4C,UAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IAC3D,EAAA,CACF;AAAA,EAAA,GACF;AAEJ,GAEae,IAA2B,OAAO,OAAOnB,GAAS;AAAA,EAC7D,OAAOiB;AACT,CAAC;"}
|
|
1
|
+
{"version":3,"file":"WalletCompatibilityModal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,43 +1,40 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as r } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { b } from "../../config-1EcDCy24.js";
|
|
3
|
+
import { b, z as n } from "../../config-Behl5hcc.js";
|
|
5
4
|
import "ethers";
|
|
6
5
|
import "../../machine/machine.js";
|
|
7
6
|
import { notReachable as l } from "../../utils/notReachable.js";
|
|
8
7
|
import { localStorageTyped as c } from "../../utils/localstorage.js";
|
|
9
|
-
import { useCompatibilityCheck as
|
|
10
|
-
function
|
|
11
|
-
const [
|
|
12
|
-
ctx: { walletAddress:
|
|
13
|
-
} = b(), { handleSign:
|
|
8
|
+
import { useCompatibilityCheck as _ } from "../../hooks/useCompatibilityCheck.js";
|
|
9
|
+
function E({ onMsg: a, providers: p }) {
|
|
10
|
+
const [f, i] = r(!1), [y, m] = r(!1), {
|
|
11
|
+
ctx: { walletAddress: t }
|
|
12
|
+
} = b(), { handleSign: d, isSigning: u } = _({
|
|
14
13
|
providers: p,
|
|
15
|
-
walletAddress:
|
|
14
|
+
walletAddress: t
|
|
16
15
|
});
|
|
17
|
-
async function
|
|
18
|
-
if (!
|
|
16
|
+
async function h() {
|
|
17
|
+
if (!t)
|
|
19
18
|
return;
|
|
20
|
-
if (!await
|
|
19
|
+
if (!await d()) {
|
|
21
20
|
i(!0);
|
|
22
21
|
return;
|
|
23
22
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
const o = c.getItem("verifiedWallets");
|
|
24
|
+
o.push(t), c.setItem("verifiedWallets", o), m(!0);
|
|
26
25
|
}
|
|
27
|
-
return
|
|
26
|
+
return f ? /* @__PURE__ */ s(
|
|
28
27
|
n.Error,
|
|
29
28
|
{
|
|
30
29
|
onMsg: async (e) => {
|
|
31
30
|
switch (e.type) {
|
|
32
31
|
case "on_close":
|
|
33
|
-
|
|
32
|
+
case "on_sign_out":
|
|
33
|
+
a({ type: e.type });
|
|
34
34
|
break;
|
|
35
35
|
case "on_try_again":
|
|
36
36
|
i(!1);
|
|
37
37
|
break;
|
|
38
|
-
case "on_sign_out":
|
|
39
|
-
t({ type: "on_sign_out" });
|
|
40
|
-
break;
|
|
41
38
|
default:
|
|
42
39
|
l(e.type);
|
|
43
40
|
}
|
|
@@ -46,18 +43,16 @@ function I({ onMsg: t, providers: p }) {
|
|
|
46
43
|
) : /* @__PURE__ */ s(
|
|
47
44
|
n,
|
|
48
45
|
{
|
|
49
|
-
isSigned:
|
|
50
|
-
isSigning:
|
|
46
|
+
isSigned: y,
|
|
47
|
+
isSigning: u,
|
|
51
48
|
onMsg: async (e) => {
|
|
52
49
|
switch (e.type) {
|
|
53
50
|
case "on_close":
|
|
54
|
-
|
|
51
|
+
case "on_sign_out":
|
|
52
|
+
a({ type: e.type });
|
|
55
53
|
break;
|
|
56
54
|
case "on_check_compatibility":
|
|
57
|
-
await
|
|
58
|
-
break;
|
|
59
|
-
case "on_sign_out":
|
|
60
|
-
t({ type: "on_sign_out" });
|
|
55
|
+
await h();
|
|
61
56
|
break;
|
|
62
57
|
default:
|
|
63
58
|
l(e.type);
|
|
@@ -67,6 +62,6 @@ function I({ onMsg: t, providers: p }) {
|
|
|
67
62
|
);
|
|
68
63
|
}
|
|
69
64
|
export {
|
|
70
|
-
|
|
65
|
+
E as WalletCompatibilityCheck
|
|
71
66
|
};
|
|
72
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/features/WalletCompatibilityCheck/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { WalletCompatibilityModal } from './WalletCompatibilityModal';\nimport { useUnsafeSnapshot } from '../../machine';\nimport { notReachable } from '@/utils/notReachable';\nimport { localStorageTyped } from '@/utils/localstorage';\nimport { useCompatibilityCheck } from '@/hooks/useCompatibilityCheck';\nimport type { IntentsTransferArgs } from '@/types';\n\ntype Msg = { type: 'on_sign_out' | 'on_close' };\n\ntype Props = {\n providers: IntentsTransferArgs['providers'];\n onMsg: (msg: Msg) => void;\n};\n\nexport function WalletCompatibilityCheck({ onMsg, providers }: Props) {\n const [hasError, setHasError] = useState(false);\n const [isSigned, setIsSigned] = useState(false);\n\n const {\n ctx: { walletAddress },\n } = useUnsafeSnapshot();\n\n const { handleSign, isSigning } = useCompatibilityCheck({\n providers,\n walletAddress,\n });\n\n async function handleCompatibilityCheck() {\n if (!walletAddress) {\n return;\n }\n\n const isValid = await handleSign();\n\n if (!isValid) {\n setHasError(true);\n\n return;\n }\n\n // no need to verify if a wallet is already verified, the modal won't show up\n const verifiedWallets = localStorageTyped.getItem('verifiedWallets');\n\n verifiedWallets.push(walletAddress);\n localStorageTyped.setItem('verifiedWallets', verifiedWallets);\n setIsSigned(true);\n }\n\n return hasError ? (\n <WalletCompatibilityModal.Error\n onMsg={async (msg) => {\n switch (msg.type) {\n case 'on_close':\n onMsg({ type:
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/features/WalletCompatibilityCheck/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport { WalletCompatibilityModal } from './WalletCompatibilityModal';\nimport { useUnsafeSnapshot } from '../../machine';\nimport { notReachable } from '@/utils/notReachable';\nimport { localStorageTyped } from '@/utils/localstorage';\nimport { useCompatibilityCheck } from '@/hooks/useCompatibilityCheck';\nimport type { IntentsTransferArgs } from '@/types';\n\ntype Msg = { type: 'on_sign_out' | 'on_close' };\n\ntype Props = {\n providers: IntentsTransferArgs['providers'];\n onMsg: (msg: Msg) => void;\n};\n\nexport function WalletCompatibilityCheck({ onMsg, providers }: Props) {\n const [hasError, setHasError] = useState(false);\n const [isSigned, setIsSigned] = useState(false);\n\n const {\n ctx: { walletAddress },\n } = useUnsafeSnapshot();\n\n const { handleSign, isSigning } = useCompatibilityCheck({\n providers,\n walletAddress,\n });\n\n async function handleCompatibilityCheck() {\n if (!walletAddress) {\n return;\n }\n\n const isValid = await handleSign();\n\n if (!isValid) {\n setHasError(true);\n\n return;\n }\n\n // no need to verify if a wallet is already verified, the modal won't show up\n const verifiedWallets = localStorageTyped.getItem('verifiedWallets');\n\n verifiedWallets.push(walletAddress);\n localStorageTyped.setItem('verifiedWallets', verifiedWallets);\n setIsSigned(true);\n }\n\n return hasError ? (\n <WalletCompatibilityModal.Error\n onMsg={async (msg) => {\n switch (msg.type) {\n case 'on_close':\n case 'on_sign_out':\n onMsg({ type: msg.type });\n break;\n case 'on_try_again':\n setHasError(false);\n break;\n default:\n notReachable(msg.type);\n }\n }}\n />\n ) : (\n <WalletCompatibilityModal\n isSigned={isSigned}\n isSigning={isSigning}\n onMsg={async (msg) => {\n switch (msg.type) {\n case 'on_close':\n case 'on_sign_out':\n onMsg({ type: msg.type });\n break;\n case 'on_check_compatibility':\n await handleCompatibilityCheck();\n break;\n default:\n notReachable(msg.type);\n }\n }}\n />\n );\n}\n"],"names":["WalletCompatibilityCheck","onMsg","providers","hasError","setHasError","useState","isSigned","setIsSigned","walletAddress","useUnsafeSnapshot","handleSign","isSigning","useCompatibilityCheck","handleCompatibilityCheck","verifiedWallets","localStorageTyped","jsx","WalletCompatibilityModal","msg","notReachable"],"mappings":";;;;;;;;AAgBO,SAASA,E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I;AAAA,QAAA;AAAA,MAE3B;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/features/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as r, S as t, o as p, p as a, T as s, q as n } from "../config-
|
|
1
|
+
import { B as r, S as t, o as p, p as a, T as s, q as n } from "../config-Behl5hcc.js";
|
|
2
2
|
import { ChainsDropdown as m } from "./ChainsDropdown/index.js";
|
|
3
3
|
import { SendAddress as c } from "./SendAddress/index.js";
|
|
4
4
|
import { SuccessScreen as S } from "./SuccessScreen/index.js";
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as a, d as r, f as o, g as t, h as u, j as n, i as f, k as l, l as k, n as m, m as i } from "../config-
|
|
1
|
+
import { e as a, d as r, f as o, g as t, h as u, j as n, i as f, k as l, l as k, n as m, m as i } from "../config-Behl5hcc.js";
|
|
2
2
|
import { useMakeEvmTransfer as T } from "./useMakeEvmTransfer.js";
|
|
3
3
|
import { useMakeSolanaTransfer as M } from "./useMakeSolanaTransfer.js";
|
|
4
4
|
import { useTokenInputPair as c } from "./useTokenInputPair.js";
|
package/dist/hooks/useChains.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState as f } from "react";
|
|
2
2
|
import { B as l } from "../index-DEq3oXQF.js";
|
|
3
3
|
import { verifyWalletSignature as N, walletVerificationMessageFactory as p } from "../utils/intents/walletCompatibilityVerification.js";
|
|
4
|
-
import { y, w as o } from "../config-
|
|
4
|
+
import { y, w as o } from "../config-Behl5hcc.js";
|
|
5
5
|
import { notReachable as A } from "../utils/notReachable.js";
|
|
6
6
|
import { getIntentsAccountId as S } from "../utils/intents/getIntentsAccountId.js";
|
|
7
7
|
import { localStorageTyped as u } from "../utils/localstorage.js";
|
|
@@ -5,7 +5,7 @@ import "ethers";
|
|
|
5
5
|
import "../../utils/cn.js";
|
|
6
6
|
import { notReachable as l } from "../../utils/notReachable.js";
|
|
7
7
|
import { useOneClickExternalDepositStatus as p } from "./useOneClickExternalDepositStatus.js";
|
|
8
|
-
import { b as c, u as m,
|
|
8
|
+
import { b as c, u as m, A as S, v as f } from "../../config-Behl5hcc.js";
|
|
9
9
|
import { WNEAR_ASSET_ID as D } from "../../constants/tokens.js";
|
|
10
10
|
import { guardStates as h } from "../../machine/guards/index.js";
|
|
11
11
|
import "../../machine/machine.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useIsCompatibilityCheckRequired: () => boolean
|
|
1
|
+
export declare const useIsCompatibilityCheckRequired: () => boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as s } from "../config-
|
|
1
|
+
import { b as s } from "../config-Behl5hcc.js";
|
|
2
2
|
import { localStorageTyped as r } from "../utils/localstorage.js";
|
|
3
3
|
const i = () => {
|
|
4
4
|
const { ctx: e } = s(), t = r.getItem("verifiedWallets");
|
|
5
|
-
return e.walletAddress && !t.includes(e.walletAddress);
|
|
5
|
+
return !!(e.walletAddress && !t.includes(e.walletAddress));
|
|
6
6
|
};
|
|
7
7
|
export {
|
|
8
8
|
i as useIsCompatibilityCheckRequired
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsCompatibilityCheckRequired.js","sources":["../../src/hooks/useIsCompatibilityCheckRequired.ts"],"sourcesContent":["import { useUnsafeSnapshot } from '@/machine/snap';\nimport { localStorageTyped } from '@/utils/localstorage';\n\nexport const useIsCompatibilityCheckRequired = () => {\n const { ctx } = useUnsafeSnapshot();\n const verifiedWallets = localStorageTyped.getItem('verifiedWallets');\n\n return ctx.walletAddress && !verifiedWallets.includes(ctx.walletAddress);\n};\n"],"names":["useIsCompatibilityCheckRequired","ctx","useUnsafeSnapshot","verifiedWallets","localStorageTyped"],"mappings":";;AAGO,MAAMA,IAAkC,MAAM;AACnD,QAAM,EAAE,KAAAC,EAAA,IAAQC,EAAA,GACVC,IAAkBC,EAAkB,QAAQ,iBAAiB;AAEnE,
|
|
1
|
+
{"version":3,"file":"useIsCompatibilityCheckRequired.js","sources":["../../src/hooks/useIsCompatibilityCheckRequired.ts"],"sourcesContent":["import { useUnsafeSnapshot } from '@/machine/snap';\nimport { localStorageTyped } from '@/utils/localstorage';\n\nexport const useIsCompatibilityCheckRequired = () => {\n const { ctx } = useUnsafeSnapshot();\n const verifiedWallets = localStorageTyped.getItem('verifiedWallets');\n\n return !!(ctx.walletAddress && !verifiedWallets.includes(ctx.walletAddress));\n};\n"],"names":["useIsCompatibilityCheckRequired","ctx","useUnsafeSnapshot","verifiedWallets","localStorageTyped"],"mappings":";;AAGO,MAAMA,IAAkC,MAAM;AACnD,QAAM,EAAE,KAAAC,EAAA,IAAQC,EAAA,GACVC,IAAkBC,EAAkB,QAAQ,iBAAiB;AAEnE,SAAO,CAAC,EAAEH,EAAI,iBAAiB,CAACE,EAAgB,SAASF,EAAI,aAAa;AAC5E;"}
|
|
@@ -4,7 +4,7 @@ import "change-case";
|
|
|
4
4
|
import "../utils/near/getRandomBytes.js";
|
|
5
5
|
import "../utils/intents/signers/solana.js";
|
|
6
6
|
import "../logger.js";
|
|
7
|
-
import { g as M } from "../config-
|
|
7
|
+
import { g as M } from "../config-Behl5hcc.js";
|
|
8
8
|
import "../constants/chains.js";
|
|
9
9
|
import "../constants/intents.js";
|
|
10
10
|
import "../utils/notReachable.js";
|
|
@@ -3,7 +3,7 @@ import "change-case";
|
|
|
3
3
|
import "@defuse-protocol/one-click-sdk-typescript";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "../logger.js";
|
|
6
|
-
import { h as M } from "../config-
|
|
6
|
+
import { h as M } from "../config-Behl5hcc.js";
|
|
7
7
|
import "../network.js";
|
|
8
8
|
import "../machine/guards/index.js";
|
|
9
9
|
import "../constants/tokens.js";
|
|
@@ -8,7 +8,7 @@ import "../utils/cn.js";
|
|
|
8
8
|
import "./useMakeEvmTransfer.js";
|
|
9
9
|
import "../utils/evm/isEvmAddress.js";
|
|
10
10
|
import "./useMakeSolanaTransfer.js";
|
|
11
|
-
import { j as Q } from "../config-
|
|
11
|
+
import { j as Q } from "../config-Behl5hcc.js";
|
|
12
12
|
import "../utils/solana/isSolanaAddress.js";
|
|
13
13
|
import "../logger.js";
|
|
14
14
|
import "../constants/tokens.js";
|
package/dist/hooks/useTheme.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { isBrowser as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useState as h, useEffect as u } from "react";
|
|
2
|
+
import { isBrowser as l } from "browser-or-node";
|
|
3
|
+
import { y as f } from "../config-Behl5hcc.js";
|
|
4
|
+
const d = (t, o) => {
|
|
5
|
+
l && (o ?? document.body).setAttribute("data-sw-theme", t);
|
|
6
|
+
}, v = (t, o) => {
|
|
7
|
+
const { themeParentElementSelector: n } = f(), [g, c] = h(), [e, r] = h(() => l && t === void 0 ? localStorage.getItem("theme") || "dark" : t);
|
|
8
|
+
return u(() => {
|
|
9
|
+
if (l) {
|
|
10
|
+
const i = n ? document.querySelector(n) : null;
|
|
9
11
|
if (e === void 0)
|
|
10
|
-
|
|
12
|
+
r(localStorage.getItem("theme") || "dark");
|
|
11
13
|
else if (e === "auto") {
|
|
12
|
-
const
|
|
13
|
-
const s =
|
|
14
|
-
|
|
14
|
+
const a = window.matchMedia("(prefers-color-scheme: dark)"), m = () => {
|
|
15
|
+
const s = a.matches ? "dark" : "light";
|
|
16
|
+
d(s, i), c(s), o?.(s);
|
|
15
17
|
};
|
|
16
|
-
return
|
|
18
|
+
return m(), a.addEventListener("change", m), localStorage.setItem("theme", "auto"), () => a.removeEventListener("change", m);
|
|
17
19
|
} else
|
|
18
|
-
localStorage.setItem("theme", e),
|
|
20
|
+
localStorage.setItem("theme", e), d(e, i), c(e), o?.(e);
|
|
21
|
+
}
|
|
19
22
|
}, [e]), {
|
|
20
23
|
theme: e,
|
|
21
|
-
colorPalette:
|
|
24
|
+
colorPalette: g,
|
|
22
25
|
toggleTheme: () => {
|
|
23
|
-
|
|
26
|
+
r(!e || e === "dark" ? "light" : e === "light" ? "auto" : "dark");
|
|
24
27
|
}
|
|
25
28
|
};
|
|
26
29
|
};
|
|
27
30
|
export {
|
|
28
|
-
|
|
31
|
+
v as useToggleTheme
|
|
29
32
|
};
|
|
30
33
|
//# sourceMappingURL=useToggleTheme.js.map
|