@0xkey-io/react-wallet-kit 0.1.0
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/LICENSE +201 -0
- package/README.MD +116 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs +307 -0
- package/dist/_virtual/_rollupPluginBabelHelpers.mjs.map +1 -0
- package/dist/components/auth/Action.d.ts +10 -0
- package/dist/components/auth/Action.d.ts.map +1 -0
- package/dist/components/auth/Action.js +76 -0
- package/dist/components/auth/Action.js.map +1 -0
- package/dist/components/auth/Action.mjs +97 -0
- package/dist/components/auth/Action.mjs.map +1 -0
- package/dist/components/auth/Email.d.ts +6 -0
- package/dist/components/auth/Email.d.ts.map +1 -0
- package/dist/components/auth/Email.js +77 -0
- package/dist/components/auth/Email.js.map +1 -0
- package/dist/components/auth/Email.mjs +98 -0
- package/dist/components/auth/Email.mjs.map +1 -0
- package/dist/components/auth/OAuth.d.ts +13 -0
- package/dist/components/auth/OAuth.d.ts.map +1 -0
- package/dist/components/auth/OAuth.js +63 -0
- package/dist/components/auth/OAuth.js.map +1 -0
- package/dist/components/auth/OAuth.mjs +68 -0
- package/dist/components/auth/OAuth.mjs.map +1 -0
- package/dist/components/auth/OTP.d.ts +21 -0
- package/dist/components/auth/OTP.d.ts.map +1 -0
- package/dist/components/auth/OTP.js +218 -0
- package/dist/components/auth/OTP.js.map +1 -0
- package/dist/components/auth/OTP.mjs +301 -0
- package/dist/components/auth/OTP.mjs.map +1 -0
- package/dist/components/auth/OrSeparator.d.ts +2 -0
- package/dist/components/auth/OrSeparator.d.ts.map +1 -0
- package/dist/components/auth/OrSeparator.js +20 -0
- package/dist/components/auth/OrSeparator.js.map +1 -0
- package/dist/components/auth/OrSeparator.mjs +18 -0
- package/dist/components/auth/OrSeparator.mjs.map +1 -0
- package/dist/components/auth/Passkey.d.ts +7 -0
- package/dist/components/auth/Passkey.d.ts.map +1 -0
- package/dist/components/auth/Passkey.js +34 -0
- package/dist/components/auth/Passkey.js.map +1 -0
- package/dist/components/auth/Passkey.mjs +30 -0
- package/dist/components/auth/Passkey.mjs.map +1 -0
- package/dist/components/auth/Phone.d.ts +6 -0
- package/dist/components/auth/Phone.d.ts.map +1 -0
- package/dist/components/auth/Phone.js +67 -0
- package/dist/components/auth/Phone.js.map +1 -0
- package/dist/components/auth/Phone.mjs +92 -0
- package/dist/components/auth/Phone.mjs.map +1 -0
- package/dist/components/auth/Wallet.d.ts +34 -0
- package/dist/components/auth/Wallet.d.ts.map +1 -0
- package/dist/components/auth/Wallet.js +517 -0
- package/dist/components/auth/Wallet.js.map +1 -0
- package/dist/components/auth/Wallet.mjs +618 -0
- package/dist/components/auth/Wallet.mjs.map +1 -0
- package/dist/components/auth/index.d.ts +9 -0
- package/dist/components/auth/index.d.ts.map +1 -0
- package/dist/components/auth/index.js +457 -0
- package/dist/components/auth/index.js.map +1 -0
- package/dist/components/auth/index.mjs +672 -0
- package/dist/components/auth/index.mjs.map +1 -0
- package/dist/components/design/Buttons.d.ts +29 -0
- package/dist/components/design/Buttons.d.ts.map +1 -0
- package/dist/components/design/Buttons.js +87 -0
- package/dist/components/design/Buttons.js.map +1 -0
- package/dist/components/design/Buttons.mjs +79 -0
- package/dist/components/design/Buttons.mjs.map +1 -0
- package/dist/components/design/Failure.d.ts +9 -0
- package/dist/components/design/Failure.d.ts.map +1 -0
- package/dist/components/design/Failure.js +33 -0
- package/dist/components/design/Failure.js.map +1 -0
- package/dist/components/design/Failure.mjs +34 -0
- package/dist/components/design/Failure.mjs.map +1 -0
- package/dist/components/design/Inputs.d.ts +9 -0
- package/dist/components/design/Inputs.d.ts.map +1 -0
- package/dist/components/design/Inputs.js +135 -0
- package/dist/components/design/Inputs.js.map +1 -0
- package/dist/components/design/Inputs.mjs +133 -0
- package/dist/components/design/Inputs.mjs.map +1 -0
- package/dist/components/design/Lottie/Dynamic.d.ts +2 -0
- package/dist/components/design/Lottie/Dynamic.d.ts.map +1 -0
- package/dist/components/design/Lottie/Dynamic.js +9 -0
- package/dist/components/design/Lottie/Dynamic.js.map +1 -0
- package/dist/components/design/Lottie/Dynamic.mjs +24 -0
- package/dist/components/design/Lottie/Dynamic.mjs.map +1 -0
- package/dist/components/design/Lottie/Wrapper.d.ts +8 -0
- package/dist/components/design/Lottie/Wrapper.d.ts.map +1 -0
- package/dist/components/design/Lottie/Wrapper.js +26 -0
- package/dist/components/design/Lottie/Wrapper.js.map +1 -0
- package/dist/components/design/Lottie/Wrapper.mjs +42 -0
- package/dist/components/design/Lottie/Wrapper.mjs.map +1 -0
- package/dist/components/design/Spinners.d.ts +9 -0
- package/dist/components/design/Spinners.d.ts.map +1 -0
- package/dist/components/design/Spinners.js +38 -0
- package/dist/components/design/Spinners.js.map +1 -0
- package/dist/components/design/Spinners.mjs +37 -0
- package/dist/components/design/Spinners.mjs.map +1 -0
- package/dist/components/design/Success.d.ts +8 -0
- package/dist/components/design/Success.d.ts.map +1 -0
- package/dist/components/design/Success.js +82 -0
- package/dist/components/design/Success.js.map +1 -0
- package/dist/components/design/Success.mjs +86 -0
- package/dist/components/design/Success.mjs.map +1 -0
- package/dist/components/design/Svg.d.ts +13 -0
- package/dist/components/design/Svg.d.ts.map +1 -0
- package/dist/components/design/Svg.js +165 -0
- package/dist/components/design/Svg.js.map +1 -0
- package/dist/components/design/Svg.mjs +161 -0
- package/dist/components/design/Svg.mjs.map +1 -0
- package/dist/components/export/Export.d.ts +13 -0
- package/dist/components/export/Export.d.ts.map +1 -0
- package/dist/components/export/Export.js +169 -0
- package/dist/components/export/Export.js.map +1 -0
- package/dist/components/export/Export.mjs +213 -0
- package/dist/components/export/Export.mjs.map +1 -0
- package/dist/components/export/ExportWarning.d.ts +15 -0
- package/dist/components/export/ExportWarning.d.ts.map +1 -0
- package/dist/components/export/ExportWarning.js +141 -0
- package/dist/components/export/ExportWarning.js.map +1 -0
- package/dist/components/export/ExportWarning.mjs +174 -0
- package/dist/components/export/ExportWarning.mjs.map +1 -0
- package/dist/components/import/Import.d.ts +20 -0
- package/dist/components/import/Import.d.ts.map +1 -0
- package/dist/components/import/Import.js +290 -0
- package/dist/components/import/Import.js.map +1 -0
- package/dist/components/import/Import.mjs +422 -0
- package/dist/components/import/Import.mjs.map +1 -0
- package/dist/components/onramp/OnRamp.d.ts +14 -0
- package/dist/components/onramp/OnRamp.d.ts.map +1 -0
- package/dist/components/onramp/OnRamp.js +61 -0
- package/dist/components/onramp/OnRamp.js.map +1 -0
- package/dist/components/onramp/OnRamp.mjs +79 -0
- package/dist/components/onramp/OnRamp.mjs.map +1 -0
- package/dist/components/send-transaction/SendTransaction.d.ts +12 -0
- package/dist/components/send-transaction/SendTransaction.d.ts.map +1 -0
- package/dist/components/send-transaction/SendTransaction.js +65 -0
- package/dist/components/send-transaction/SendTransaction.js.map +1 -0
- package/dist/components/send-transaction/SendTransaction.mjs +89 -0
- package/dist/components/send-transaction/SendTransaction.mjs.map +1 -0
- package/dist/components/send-transaction/helpers.d.ts +4 -0
- package/dist/components/send-transaction/helpers.d.ts.map +1 -0
- package/dist/components/send-transaction/helpers.js +37 -0
- package/dist/components/send-transaction/helpers.js.map +1 -0
- package/dist/components/send-transaction/helpers.mjs +34 -0
- package/dist/components/send-transaction/helpers.mjs.map +1 -0
- package/dist/components/sign/Message.d.ts +18 -0
- package/dist/components/sign/Message.d.ts.map +1 -0
- package/dist/components/sign/Message.js +132 -0
- package/dist/components/sign/Message.js.map +1 -0
- package/dist/components/sign/Message.mjs +148 -0
- package/dist/components/sign/Message.mjs.map +1 -0
- package/dist/components/user/ConnectWallet.d.ts +8 -0
- package/dist/components/user/ConnectWallet.d.ts.map +1 -0
- package/dist/components/user/ConnectWallet.js +114 -0
- package/dist/components/user/ConnectWallet.js.map +1 -0
- package/dist/components/user/ConnectWallet.mjs +194 -0
- package/dist/components/user/ConnectWallet.mjs.map +1 -0
- package/dist/components/user/RemoveEmail.d.ts +12 -0
- package/dist/components/user/RemoveEmail.d.ts.map +1 -0
- package/dist/components/user/RemoveEmail.js +105 -0
- package/dist/components/user/RemoveEmail.js.map +1 -0
- package/dist/components/user/RemoveEmail.mjs +124 -0
- package/dist/components/user/RemoveEmail.mjs.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.d.ts +12 -0
- package/dist/components/user/RemoveOAuthProvider.d.ts.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.js +110 -0
- package/dist/components/user/RemoveOAuthProvider.js.map +1 -0
- package/dist/components/user/RemoveOAuthProvider.mjs +131 -0
- package/dist/components/user/RemoveOAuthProvider.mjs.map +1 -0
- package/dist/components/user/RemovePasskey.d.ts +12 -0
- package/dist/components/user/RemovePasskey.d.ts.map +1 -0
- package/dist/components/user/RemovePasskey.js +114 -0
- package/dist/components/user/RemovePasskey.js.map +1 -0
- package/dist/components/user/RemovePasskey.mjs +135 -0
- package/dist/components/user/RemovePasskey.mjs.map +1 -0
- package/dist/components/user/RemovePhoneNumber.d.ts +12 -0
- package/dist/components/user/RemovePhoneNumber.d.ts.map +1 -0
- package/dist/components/user/RemovePhoneNumber.js +105 -0
- package/dist/components/user/RemovePhoneNumber.js.map +1 -0
- package/dist/components/user/RemovePhoneNumber.mjs +124 -0
- package/dist/components/user/RemovePhoneNumber.mjs.map +1 -0
- package/dist/components/user/UpdateEmail.d.ts +12 -0
- package/dist/components/user/UpdateEmail.d.ts.map +1 -0
- package/dist/components/user/UpdateEmail.js +154 -0
- package/dist/components/user/UpdateEmail.js.map +1 -0
- package/dist/components/user/UpdateEmail.mjs +197 -0
- package/dist/components/user/UpdateEmail.mjs.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.d.ts +12 -0
- package/dist/components/user/UpdatePhoneNumber.d.ts.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.js +151 -0
- package/dist/components/user/UpdatePhoneNumber.js.map +1 -0
- package/dist/components/user/UpdatePhoneNumber.mjs +198 -0
- package/dist/components/user/UpdatePhoneNumber.mjs.map +1 -0
- package/dist/components/user/UpdateUserName.d.ts +13 -0
- package/dist/components/user/UpdateUserName.d.ts.map +1 -0
- package/dist/components/user/UpdateUserName.js +113 -0
- package/dist/components/user/UpdateUserName.js.map +1 -0
- package/dist/components/user/UpdateUserName.mjs +139 -0
- package/dist/components/user/UpdateUserName.mjs.map +1 -0
- package/dist/components/verify/Verify.d.ts +9 -0
- package/dist/components/verify/Verify.d.ts.map +1 -0
- package/dist/components/verify/Verify.js +121 -0
- package/dist/components/verify/Verify.js.map +1 -0
- package/dist/components/verify/Verify.mjs +149 -0
- package/dist/components/verify/Verify.mjs.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +74 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8 -0
- package/dist/index.mjs.map +1 -0
- package/dist/providers/ZeroXKeyProvider.d.ts +9 -0
- package/dist/providers/ZeroXKeyProvider.d.ts.map +1 -0
- package/dist/providers/ZeroXKeyProvider.js +36 -0
- package/dist/providers/ZeroXKeyProvider.js.map +1 -0
- package/dist/providers/ZeroXKeyProvider.mjs +34 -0
- package/dist/providers/ZeroXKeyProvider.mjs.map +1 -0
- package/dist/providers/client/Hook.d.ts +4 -0
- package/dist/providers/client/Hook.d.ts.map +1 -0
- package/dist/providers/client/Hook.js +15 -0
- package/dist/providers/client/Hook.js.map +1 -0
- package/dist/providers/client/Hook.mjs +13 -0
- package/dist/providers/client/Hook.mjs.map +1 -0
- package/dist/providers/client/Provider.d.ts +39 -0
- package/dist/providers/client/Provider.d.ts.map +1 -0
- package/dist/providers/client/Provider.js +3934 -0
- package/dist/providers/client/Provider.js.map +1 -0
- package/dist/providers/client/Provider.mjs +6895 -0
- package/dist/providers/client/Provider.mjs.map +1 -0
- package/dist/providers/client/Types.d.ts +711 -0
- package/dist/providers/client/Types.d.ts.map +1 -0
- package/dist/providers/client/Types.js +10 -0
- package/dist/providers/client/Types.js.map +1 -0
- package/dist/providers/client/Types.mjs +8 -0
- package/dist/providers/client/Types.mjs.map +1 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/modal/Hook.d.ts +4 -0
- package/dist/providers/modal/Hook.d.ts.map +1 -0
- package/dist/providers/modal/Hook.js +15 -0
- package/dist/providers/modal/Hook.js.map +1 -0
- package/dist/providers/modal/Hook.mjs +13 -0
- package/dist/providers/modal/Hook.mjs.map +1 -0
- package/dist/providers/modal/Provider.d.ts +27 -0
- package/dist/providers/modal/Provider.d.ts.map +1 -0
- package/dist/providers/modal/Provider.js +48 -0
- package/dist/providers/modal/Provider.js.map +1 -0
- package/dist/providers/modal/Provider.mjs +68 -0
- package/dist/providers/modal/Provider.mjs.map +1 -0
- package/dist/providers/modal/Root.d.ts +7 -0
- package/dist/providers/modal/Root.d.ts.map +1 -0
- package/dist/providers/modal/Root.js +345 -0
- package/dist/providers/modal/Root.js.map +1 -0
- package/dist/providers/modal/Root.mjs +352 -0
- package/dist/providers/modal/Root.mjs.map +1 -0
- package/dist/providers/theme/Overrides.d.ts +18 -0
- package/dist/providers/theme/Overrides.d.ts.map +1 -0
- package/dist/providers/theme/Overrides.js +35 -0
- package/dist/providers/theme/Overrides.js.map +1 -0
- package/dist/providers/theme/Overrides.mjs +37 -0
- package/dist/providers/theme/Overrides.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/tests/oauth-test.d.ts +2 -0
- package/dist/tests/oauth-test.d.ts.map +1 -0
- package/dist/tests/timers-test.d.ts +2 -0
- package/dist/tests/timers-test.d.ts.map +1 -0
- package/dist/tests/utils-test.d.ts +2 -0
- package/dist/tests/utils-test.d.ts.map +1 -0
- package/dist/typedoc-entry/index.d.ts +5 -0
- package/dist/typedoc-entry/index.d.ts.map +1 -0
- package/dist/types/base.d.ts +178 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +55 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/base.mjs +50 -0
- package/dist/types/base.mjs.map +1 -0
- package/dist/types/method-types.d.ts +258 -0
- package/dist/types/method-types.d.ts.map +1 -0
- package/dist/utils/oauth/completion.d.ts +132 -0
- package/dist/utils/oauth/completion.d.ts.map +1 -0
- package/dist/utils/oauth/completion.js +136 -0
- package/dist/utils/oauth/completion.js.map +1 -0
- package/dist/utils/oauth/completion.mjs +176 -0
- package/dist/utils/oauth/completion.mjs.map +1 -0
- package/dist/utils/oauth/config.d.ts +34 -0
- package/dist/utils/oauth/config.d.ts.map +1 -0
- package/dist/utils/oauth/config.js +69 -0
- package/dist/utils/oauth/config.js.map +1 -0
- package/dist/utils/oauth/config.mjs +54 -0
- package/dist/utils/oauth/config.mjs.map +1 -0
- package/dist/utils/oauth/helpers.d.ts +13 -0
- package/dist/utils/oauth/helpers.d.ts.map +1 -0
- package/dist/utils/oauth/helpers.js +38 -0
- package/dist/utils/oauth/helpers.js.map +1 -0
- package/dist/utils/oauth/helpers.mjs +35 -0
- package/dist/utils/oauth/helpers.mjs.map +1 -0
- package/dist/utils/oauth/index.d.ts +7 -0
- package/dist/utils/oauth/index.d.ts.map +1 -0
- package/dist/utils/oauth/pkce.d.ts +14 -0
- package/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/dist/utils/oauth/pkce.js +48 -0
- package/dist/utils/oauth/pkce.js.map +1 -0
- package/dist/utils/oauth/pkce.mjs +85 -0
- package/dist/utils/oauth/pkce.mjs.map +1 -0
- package/dist/utils/oauth/storage.d.ts +48 -0
- package/dist/utils/oauth/storage.d.ts.map +1 -0
- package/dist/utils/oauth/storage.js +87 -0
- package/dist/utils/oauth/storage.js.map +1 -0
- package/dist/utils/oauth/storage.mjs +78 -0
- package/dist/utils/oauth/storage.mjs.map +1 -0
- package/dist/utils/oauth/url.d.ts +94 -0
- package/dist/utils/oauth/url.d.ts.map +1 -0
- package/dist/utils/oauth/url.js +224 -0
- package/dist/utils/oauth/url.js.map +1 -0
- package/dist/utils/oauth/url.mjs +230 -0
- package/dist/utils/oauth/url.mjs.map +1 -0
- package/dist/utils/timers.d.ts +73 -0
- package/dist/utils/timers.d.ts.map +1 -0
- package/dist/utils/timers.js +133 -0
- package/dist/utils/timers.js.map +1 -0
- package/dist/utils/timers.mjs +142 -0
- package/dist/utils/timers.mjs.map +1 -0
- package/dist/utils/utils.d.ts +40 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +116 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/utils/utils.mjs +164 -0
- package/dist/utils/utils.mjs.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
import { toConsumableArray as _toConsumableArray, asyncToGenerator as _asyncToGenerator, regenerator as _regenerator, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.mjs';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { faDiscord, faXTwitter, faFacebook, faApple, faGoogle } from '@fortawesome/free-brands-svg-icons';
|
|
5
|
+
import { OtpType } from '@0xkey-io/core';
|
|
6
|
+
import { faEllipsisH, faFingerprint } from '@fortawesome/free-solid-svg-icons';
|
|
7
|
+
import clsx from 'clsx';
|
|
8
|
+
import { OAuthButton } from './OAuth.mjs';
|
|
9
|
+
import { EmailInput } from './Email.mjs';
|
|
10
|
+
import { OrSeparator } from './OrSeparator.mjs';
|
|
11
|
+
import { OtpVerification } from './OTP.mjs';
|
|
12
|
+
import { PhoneNumberInput } from './Phone.mjs';
|
|
13
|
+
import { ActionPage } from './Action.mjs';
|
|
14
|
+
import { PasskeyButtons } from './Passkey.mjs';
|
|
15
|
+
import { Spinner } from '../design/Spinners.mjs';
|
|
16
|
+
import { WalletAuthButton, ExternalWalletSelector, WalletConnectScreen } from './Wallet.mjs';
|
|
17
|
+
import { DeveloperError } from '../design/Failure.mjs';
|
|
18
|
+
import { useModal } from '../../providers/modal/Hook.mjs';
|
|
19
|
+
import { useZeroXKey } from '../../providers/client/Hook.mjs';
|
|
20
|
+
import { ClientState } from '../../types/base.mjs';
|
|
21
|
+
import { isWalletConnect } from '../../utils/utils.mjs';
|
|
22
|
+
|
|
23
|
+
function AuthComponent(_ref) {
|
|
24
|
+
var sessionKey = _ref.sessionKey,
|
|
25
|
+
logo = _ref.logo,
|
|
26
|
+
logoClassName = _ref.logoClassName,
|
|
27
|
+
title = _ref.title;
|
|
28
|
+
var _useZeroXKey = useZeroXKey(),
|
|
29
|
+
config = _useZeroXKey.config,
|
|
30
|
+
clientState = _useZeroXKey.clientState,
|
|
31
|
+
handleGoogleOauth = _useZeroXKey.handleGoogleOauth,
|
|
32
|
+
handleAppleOauth = _useZeroXKey.handleAppleOauth,
|
|
33
|
+
handleFacebookOauth = _useZeroXKey.handleFacebookOauth,
|
|
34
|
+
handleXOauth = _useZeroXKey.handleXOauth,
|
|
35
|
+
handleDiscordOauth = _useZeroXKey.handleDiscordOauth,
|
|
36
|
+
initOtp = _useZeroXKey.initOtp,
|
|
37
|
+
loginWithPasskey = _useZeroXKey.loginWithPasskey,
|
|
38
|
+
signUpWithPasskey = _useZeroXKey.signUpWithPasskey,
|
|
39
|
+
loginOrSignupWithWallet = _useZeroXKey.loginOrSignupWithWallet,
|
|
40
|
+
disconnectWalletAccount = _useZeroXKey.disconnectWalletAccount;
|
|
41
|
+
var _useModal = useModal(),
|
|
42
|
+
pushPage = _useModal.pushPage,
|
|
43
|
+
isMobile = _useModal.isMobile,
|
|
44
|
+
openSheet = _useModal.openSheet;
|
|
45
|
+
if (!config || clientState === ClientState.Loading) {
|
|
46
|
+
// Don't check ClientState.Error here. We already check in the modal root
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
className: "flex flex-col items-center w-96 py-5",
|
|
49
|
+
children: jsx(Spinner, {
|
|
50
|
+
strokeWidth: 2,
|
|
51
|
+
className: "w-48 h-48"
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
var _ref2 = config.auth || {},
|
|
56
|
+
_ref2$methods = _ref2.methods,
|
|
57
|
+
methods = _ref2$methods === void 0 ? {} : _ref2$methods,
|
|
58
|
+
_ref2$methodOrder = _ref2.methodOrder,
|
|
59
|
+
methodOrder = _ref2$methodOrder === void 0 ? [] : _ref2$methodOrder,
|
|
60
|
+
_ref2$oauthOrder = _ref2.oauthOrder,
|
|
61
|
+
oauthOrder = _ref2$oauthOrder === void 0 ? [] : _ref2$oauthOrder;
|
|
62
|
+
var handleEmailSubmit = /*#__PURE__*/function () {
|
|
63
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(email) {
|
|
64
|
+
var _config$auth, _config$auth2, _yield$initOtp, otpId, otpEncryptionTargetBundle, _t;
|
|
65
|
+
return _regenerator().w(function (_context) {
|
|
66
|
+
while (1) switch (_context.p = _context.n) {
|
|
67
|
+
case 0:
|
|
68
|
+
_context.p = 0;
|
|
69
|
+
_context.n = 1;
|
|
70
|
+
return initOtp({
|
|
71
|
+
otpType: OtpType.Email,
|
|
72
|
+
contact: email
|
|
73
|
+
});
|
|
74
|
+
case 1:
|
|
75
|
+
_yield$initOtp = _context.v;
|
|
76
|
+
otpId = _yield$initOtp.otpId;
|
|
77
|
+
otpEncryptionTargetBundle = _yield$initOtp.otpEncryptionTargetBundle;
|
|
78
|
+
pushPage({
|
|
79
|
+
key: "Verify OTP",
|
|
80
|
+
content: jsx(OtpVerification, _objectSpread2({
|
|
81
|
+
contact: email,
|
|
82
|
+
otpId: otpId,
|
|
83
|
+
otpEncryptionTargetBundle: otpEncryptionTargetBundle,
|
|
84
|
+
otpType: OtpType.Email,
|
|
85
|
+
otpLength: ((_config$auth = config.auth) === null || _config$auth === void 0 ? void 0 : _config$auth.otpLength) !== undefined ? Number(config.auth.otpLength) : undefined,
|
|
86
|
+
alphanumeric: (_config$auth2 = config.auth) === null || _config$auth2 === void 0 ? void 0 : _config$auth2.otpAlphanumeric
|
|
87
|
+
}, sessionKey && {
|
|
88
|
+
sessionKey: sessionKey
|
|
89
|
+
})),
|
|
90
|
+
showTitle: false
|
|
91
|
+
});
|
|
92
|
+
_context.n = 3;
|
|
93
|
+
break;
|
|
94
|
+
case 2:
|
|
95
|
+
_context.p = 2;
|
|
96
|
+
_t = _context.v;
|
|
97
|
+
throw new Error("Error initializing OTP: ".concat(_t));
|
|
98
|
+
case 3:
|
|
99
|
+
return _context.a(2);
|
|
100
|
+
}
|
|
101
|
+
}, _callee, null, [[0, 2]]);
|
|
102
|
+
}));
|
|
103
|
+
return function handleEmailSubmit(_x) {
|
|
104
|
+
return _ref3.apply(this, arguments);
|
|
105
|
+
};
|
|
106
|
+
}();
|
|
107
|
+
var handlePhoneSubmit = /*#__PURE__*/function () {
|
|
108
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(phone, formattedPhone) {
|
|
109
|
+
var _config$auth3, _config$auth4, _yield$initOtp2, otpId, otpEncryptionTargetBundle, _t2;
|
|
110
|
+
return _regenerator().w(function (_context2) {
|
|
111
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
112
|
+
case 0:
|
|
113
|
+
_context2.p = 0;
|
|
114
|
+
_context2.n = 1;
|
|
115
|
+
return initOtp({
|
|
116
|
+
otpType: OtpType.Sms,
|
|
117
|
+
contact: phone
|
|
118
|
+
});
|
|
119
|
+
case 1:
|
|
120
|
+
_yield$initOtp2 = _context2.v;
|
|
121
|
+
otpId = _yield$initOtp2.otpId;
|
|
122
|
+
otpEncryptionTargetBundle = _yield$initOtp2.otpEncryptionTargetBundle;
|
|
123
|
+
pushPage({
|
|
124
|
+
key: "Verify OTP",
|
|
125
|
+
content: jsx(OtpVerification, _objectSpread2({
|
|
126
|
+
contact: phone,
|
|
127
|
+
// Pass in the formatted phone number seperately. In the case that some weird formatting occurs, we don't want to send it into the initOtp request
|
|
128
|
+
formattedContact: formattedPhone,
|
|
129
|
+
otpId: otpId,
|
|
130
|
+
otpEncryptionTargetBundle: otpEncryptionTargetBundle,
|
|
131
|
+
otpType: OtpType.Sms,
|
|
132
|
+
otpLength: ((_config$auth3 = config.auth) === null || _config$auth3 === void 0 ? void 0 : _config$auth3.otpLength) !== undefined ? Number(config.auth.otpLength) : undefined,
|
|
133
|
+
alphanumeric: (_config$auth4 = config.auth) === null || _config$auth4 === void 0 ? void 0 : _config$auth4.otpAlphanumeric
|
|
134
|
+
}, sessionKey && {
|
|
135
|
+
sessionKey: sessionKey
|
|
136
|
+
})),
|
|
137
|
+
showTitle: false
|
|
138
|
+
});
|
|
139
|
+
_context2.n = 3;
|
|
140
|
+
break;
|
|
141
|
+
case 2:
|
|
142
|
+
_context2.p = 2;
|
|
143
|
+
_t2 = _context2.v;
|
|
144
|
+
throw new Error("Error initializing OTP: ".concat(_t2));
|
|
145
|
+
case 3:
|
|
146
|
+
return _context2.a(2);
|
|
147
|
+
}
|
|
148
|
+
}, _callee2, null, [[0, 2]]);
|
|
149
|
+
}));
|
|
150
|
+
return function handlePhoneSubmit(_x2, _x3) {
|
|
151
|
+
return _ref4.apply(this, arguments);
|
|
152
|
+
};
|
|
153
|
+
}();
|
|
154
|
+
var handlePasskeyLogin = function handlePasskeyLogin() {
|
|
155
|
+
pushPage({
|
|
156
|
+
key: "Passkey Login",
|
|
157
|
+
content: jsx(ActionPage, {
|
|
158
|
+
title: "Authenticating with passkey...",
|
|
159
|
+
action: function () {
|
|
160
|
+
var _action = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
161
|
+
return _regenerator().w(function (_context3) {
|
|
162
|
+
while (1) switch (_context3.n) {
|
|
163
|
+
case 0:
|
|
164
|
+
_context3.n = 1;
|
|
165
|
+
return loginWithPasskey(_objectSpread2({}, sessionKey && {
|
|
166
|
+
sessionKey: sessionKey
|
|
167
|
+
}));
|
|
168
|
+
case 1:
|
|
169
|
+
return _context3.a(2);
|
|
170
|
+
}
|
|
171
|
+
}, _callee3);
|
|
172
|
+
}));
|
|
173
|
+
function action() {
|
|
174
|
+
return _action.apply(this, arguments);
|
|
175
|
+
}
|
|
176
|
+
return action;
|
|
177
|
+
}(),
|
|
178
|
+
icon: jsx(FontAwesomeIcon, {
|
|
179
|
+
size: "3x",
|
|
180
|
+
icon: faFingerprint
|
|
181
|
+
})
|
|
182
|
+
}),
|
|
183
|
+
showTitle: false
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
var handlePasskeySignUp = function handlePasskeySignUp() {
|
|
187
|
+
pushPage({
|
|
188
|
+
key: "Passkey Sign Up",
|
|
189
|
+
content: jsx(ActionPage, {
|
|
190
|
+
title: "Creating account with passkey...",
|
|
191
|
+
action: function () {
|
|
192
|
+
var _action2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
193
|
+
return _regenerator().w(function (_context4) {
|
|
194
|
+
while (1) switch (_context4.n) {
|
|
195
|
+
case 0:
|
|
196
|
+
_context4.n = 1;
|
|
197
|
+
return signUpWithPasskey(_objectSpread2({}, sessionKey && {
|
|
198
|
+
sessionKey: sessionKey
|
|
199
|
+
}));
|
|
200
|
+
case 1:
|
|
201
|
+
return _context4.a(2);
|
|
202
|
+
}
|
|
203
|
+
}, _callee4);
|
|
204
|
+
}));
|
|
205
|
+
function action() {
|
|
206
|
+
return _action2.apply(this, arguments);
|
|
207
|
+
}
|
|
208
|
+
return action;
|
|
209
|
+
}(),
|
|
210
|
+
icon: jsx(FontAwesomeIcon, {
|
|
211
|
+
size: "3x",
|
|
212
|
+
icon: faFingerprint
|
|
213
|
+
})
|
|
214
|
+
}),
|
|
215
|
+
showTitle: false
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
var handleGoogle = /*#__PURE__*/function () {
|
|
219
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
220
|
+
return _regenerator().w(function (_context5) {
|
|
221
|
+
while (1) switch (_context5.n) {
|
|
222
|
+
case 0:
|
|
223
|
+
pushPage({
|
|
224
|
+
key: "Google OAuth",
|
|
225
|
+
content: jsx(ActionPage, {
|
|
226
|
+
title: "Authenticating with Google...",
|
|
227
|
+
action: function action() {
|
|
228
|
+
return handleGoogleOauth({
|
|
229
|
+
additionalState: _objectSpread2({
|
|
230
|
+
openModal: "true"
|
|
231
|
+
}, sessionKey && {
|
|
232
|
+
sessionKey: sessionKey
|
|
233
|
+
}) // Tell the provider to reopen the auth modal and show the loading state
|
|
234
|
+
});
|
|
235
|
+
},
|
|
236
|
+
icon: jsx(FontAwesomeIcon, {
|
|
237
|
+
size: "3x",
|
|
238
|
+
icon: faGoogle
|
|
239
|
+
})
|
|
240
|
+
}),
|
|
241
|
+
showTitle: false
|
|
242
|
+
});
|
|
243
|
+
case 1:
|
|
244
|
+
return _context5.a(2);
|
|
245
|
+
}
|
|
246
|
+
}, _callee5);
|
|
247
|
+
}));
|
|
248
|
+
return function handleGoogle() {
|
|
249
|
+
return _ref5.apply(this, arguments);
|
|
250
|
+
};
|
|
251
|
+
}();
|
|
252
|
+
var handleApple = /*#__PURE__*/function () {
|
|
253
|
+
var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
254
|
+
return _regenerator().w(function (_context6) {
|
|
255
|
+
while (1) switch (_context6.n) {
|
|
256
|
+
case 0:
|
|
257
|
+
pushPage({
|
|
258
|
+
key: "Apple OAuth",
|
|
259
|
+
content: jsx(ActionPage, {
|
|
260
|
+
title: "Authenticating with Apple...",
|
|
261
|
+
action: function action() {
|
|
262
|
+
return handleAppleOauth({
|
|
263
|
+
additionalState: _objectSpread2({
|
|
264
|
+
openModal: "true"
|
|
265
|
+
}, sessionKey && {
|
|
266
|
+
sessionKey: sessionKey
|
|
267
|
+
}) // Tell the provider to reopen the auth modal and show the loading state
|
|
268
|
+
});
|
|
269
|
+
},
|
|
270
|
+
icon: jsx(FontAwesomeIcon, {
|
|
271
|
+
size: "3x",
|
|
272
|
+
icon: faApple
|
|
273
|
+
})
|
|
274
|
+
}),
|
|
275
|
+
showTitle: false
|
|
276
|
+
});
|
|
277
|
+
case 1:
|
|
278
|
+
return _context6.a(2);
|
|
279
|
+
}
|
|
280
|
+
}, _callee6);
|
|
281
|
+
}));
|
|
282
|
+
return function handleApple() {
|
|
283
|
+
return _ref6.apply(this, arguments);
|
|
284
|
+
};
|
|
285
|
+
}();
|
|
286
|
+
var handleFacebook = /*#__PURE__*/function () {
|
|
287
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7() {
|
|
288
|
+
return _regenerator().w(function (_context7) {
|
|
289
|
+
while (1) switch (_context7.n) {
|
|
290
|
+
case 0:
|
|
291
|
+
pushPage({
|
|
292
|
+
key: "Facebook OAuth",
|
|
293
|
+
content: jsx(ActionPage, {
|
|
294
|
+
title: "Authenticating with Facebook...",
|
|
295
|
+
action: function action() {
|
|
296
|
+
return handleFacebookOauth({
|
|
297
|
+
additionalState: _objectSpread2({
|
|
298
|
+
openModal: "true"
|
|
299
|
+
}, sessionKey && {
|
|
300
|
+
sessionKey: sessionKey
|
|
301
|
+
}) // Tell the provider to reopen the auth modal and show the loading state
|
|
302
|
+
});
|
|
303
|
+
},
|
|
304
|
+
icon: jsx(FontAwesomeIcon, {
|
|
305
|
+
size: "3x",
|
|
306
|
+
icon: faFacebook
|
|
307
|
+
})
|
|
308
|
+
}),
|
|
309
|
+
showTitle: false
|
|
310
|
+
});
|
|
311
|
+
case 1:
|
|
312
|
+
return _context7.a(2);
|
|
313
|
+
}
|
|
314
|
+
}, _callee7);
|
|
315
|
+
}));
|
|
316
|
+
return function handleFacebook() {
|
|
317
|
+
return _ref7.apply(this, arguments);
|
|
318
|
+
};
|
|
319
|
+
}();
|
|
320
|
+
var handleX = /*#__PURE__*/function () {
|
|
321
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
322
|
+
return _regenerator().w(function (_context8) {
|
|
323
|
+
while (1) switch (_context8.n) {
|
|
324
|
+
case 0:
|
|
325
|
+
pushPage({
|
|
326
|
+
key: "X OAuth",
|
|
327
|
+
content: jsx(ActionPage, {
|
|
328
|
+
title: "Authenticating with X...",
|
|
329
|
+
action: function action() {
|
|
330
|
+
return handleXOauth({
|
|
331
|
+
additionalState: _objectSpread2({
|
|
332
|
+
openModal: "true"
|
|
333
|
+
}, sessionKey && {
|
|
334
|
+
sessionKey: sessionKey
|
|
335
|
+
}) // Tell the provider to reopen the auth modal and show the loading state
|
|
336
|
+
});
|
|
337
|
+
},
|
|
338
|
+
icon: jsx(FontAwesomeIcon, {
|
|
339
|
+
size: "3x",
|
|
340
|
+
icon: faXTwitter
|
|
341
|
+
})
|
|
342
|
+
}),
|
|
343
|
+
showTitle: false
|
|
344
|
+
});
|
|
345
|
+
case 1:
|
|
346
|
+
return _context8.a(2);
|
|
347
|
+
}
|
|
348
|
+
}, _callee8);
|
|
349
|
+
}));
|
|
350
|
+
return function handleX() {
|
|
351
|
+
return _ref8.apply(this, arguments);
|
|
352
|
+
};
|
|
353
|
+
}();
|
|
354
|
+
var handleDiscord = /*#__PURE__*/function () {
|
|
355
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9() {
|
|
356
|
+
return _regenerator().w(function (_context9) {
|
|
357
|
+
while (1) switch (_context9.n) {
|
|
358
|
+
case 0:
|
|
359
|
+
pushPage({
|
|
360
|
+
key: "Discord OAuth",
|
|
361
|
+
content: jsx(ActionPage, {
|
|
362
|
+
title: "Authenticating with Discord...",
|
|
363
|
+
action: function action() {
|
|
364
|
+
return handleDiscordOauth({
|
|
365
|
+
additionalState: _objectSpread2({
|
|
366
|
+
openModal: "true"
|
|
367
|
+
}, sessionKey && {
|
|
368
|
+
sessionKey: sessionKey
|
|
369
|
+
}) // Tell the provider to reopen the auth modal and show the loading state
|
|
370
|
+
});
|
|
371
|
+
},
|
|
372
|
+
icon: jsx(FontAwesomeIcon, {
|
|
373
|
+
size: "3x",
|
|
374
|
+
icon: faDiscord
|
|
375
|
+
})
|
|
376
|
+
}),
|
|
377
|
+
showTitle: false
|
|
378
|
+
});
|
|
379
|
+
case 1:
|
|
380
|
+
return _context9.a(2);
|
|
381
|
+
}
|
|
382
|
+
}, _callee9);
|
|
383
|
+
}));
|
|
384
|
+
return function handleDiscord() {
|
|
385
|
+
return _ref9.apply(this, arguments);
|
|
386
|
+
};
|
|
387
|
+
}();
|
|
388
|
+
var handleWalletLoginOrSignup = /*#__PURE__*/function () {
|
|
389
|
+
var _ref0 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(provider) {
|
|
390
|
+
return _regenerator().w(function (_context1) {
|
|
391
|
+
while (1) switch (_context1.n) {
|
|
392
|
+
case 0:
|
|
393
|
+
pushPage({
|
|
394
|
+
key: "Wallet Login/Signup",
|
|
395
|
+
content: jsx(ActionPage, {
|
|
396
|
+
title: "Authenticating with ".concat(provider.info.name, "..."),
|
|
397
|
+
action: function () {
|
|
398
|
+
var _action3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
399
|
+
return _regenerator().w(function (_context0) {
|
|
400
|
+
while (1) switch (_context0.n) {
|
|
401
|
+
case 0:
|
|
402
|
+
_context0.n = 1;
|
|
403
|
+
return loginOrSignupWithWallet(_objectSpread2({
|
|
404
|
+
walletProvider: provider
|
|
405
|
+
}, sessionKey && {
|
|
406
|
+
sessionKey: sessionKey
|
|
407
|
+
}));
|
|
408
|
+
case 1:
|
|
409
|
+
return _context0.a(2);
|
|
410
|
+
}
|
|
411
|
+
}, _callee0);
|
|
412
|
+
}));
|
|
413
|
+
function action() {
|
|
414
|
+
return _action3.apply(this, arguments);
|
|
415
|
+
}
|
|
416
|
+
return action;
|
|
417
|
+
}(),
|
|
418
|
+
icon: jsx("img", {
|
|
419
|
+
className: "size-11 rounded-full",
|
|
420
|
+
src: provider.info.icon || ""
|
|
421
|
+
})
|
|
422
|
+
}),
|
|
423
|
+
showTitle: false
|
|
424
|
+
});
|
|
425
|
+
case 1:
|
|
426
|
+
return _context1.a(2);
|
|
427
|
+
}
|
|
428
|
+
}, _callee1);
|
|
429
|
+
}));
|
|
430
|
+
return function handleWalletLoginOrSignup(_x4) {
|
|
431
|
+
return _ref0.apply(this, arguments);
|
|
432
|
+
};
|
|
433
|
+
}();
|
|
434
|
+
var handleSelect = /*#__PURE__*/function () {
|
|
435
|
+
var _ref1 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12(provider) {
|
|
436
|
+
return _regenerator().w(function (_context12) {
|
|
437
|
+
while (1) switch (_context12.n) {
|
|
438
|
+
case 0:
|
|
439
|
+
if (!isWalletConnect(provider)) {
|
|
440
|
+
_context12.n = 1;
|
|
441
|
+
break;
|
|
442
|
+
}
|
|
443
|
+
// for WalletConnect we route to a dedicated screen
|
|
444
|
+
// to handle the connection process, as it requires a different flow (pairing via QR code or deep link)
|
|
445
|
+
pushPage({
|
|
446
|
+
key: "Connect WalletConnect",
|
|
447
|
+
content: jsx(WalletConnectScreen, {
|
|
448
|
+
provider: provider,
|
|
449
|
+
onAction: function () {
|
|
450
|
+
var _onAction = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(provider) {
|
|
451
|
+
return _regenerator().w(function (_context10) {
|
|
452
|
+
while (1) switch (_context10.n) {
|
|
453
|
+
case 0:
|
|
454
|
+
_context10.n = 1;
|
|
455
|
+
return loginOrSignupWithWallet(_objectSpread2({
|
|
456
|
+
walletProvider: provider
|
|
457
|
+
}, sessionKey && {
|
|
458
|
+
sessionKey: sessionKey
|
|
459
|
+
}));
|
|
460
|
+
case 1:
|
|
461
|
+
return _context10.a(2);
|
|
462
|
+
}
|
|
463
|
+
}, _callee10);
|
|
464
|
+
}));
|
|
465
|
+
function onAction(_x6) {
|
|
466
|
+
return _onAction.apply(this, arguments);
|
|
467
|
+
}
|
|
468
|
+
return onAction;
|
|
469
|
+
}(),
|
|
470
|
+
onDisconnect: function () {
|
|
471
|
+
var _onDisconnect = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(provider) {
|
|
472
|
+
return _regenerator().w(function (_context11) {
|
|
473
|
+
while (1) switch (_context11.n) {
|
|
474
|
+
case 0:
|
|
475
|
+
_context11.n = 1;
|
|
476
|
+
return disconnectWalletAccount(provider);
|
|
477
|
+
case 1:
|
|
478
|
+
return _context11.a(2);
|
|
479
|
+
}
|
|
480
|
+
}, _callee11);
|
|
481
|
+
}));
|
|
482
|
+
function onDisconnect(_x7) {
|
|
483
|
+
return _onDisconnect.apply(this, arguments);
|
|
484
|
+
}
|
|
485
|
+
return onDisconnect;
|
|
486
|
+
}(),
|
|
487
|
+
successPageDuration: undefined
|
|
488
|
+
})
|
|
489
|
+
});
|
|
490
|
+
return _context12.a(2);
|
|
491
|
+
case 1:
|
|
492
|
+
_context12.n = 2;
|
|
493
|
+
return handleWalletLoginOrSignup(provider);
|
|
494
|
+
case 2:
|
|
495
|
+
return _context12.a(2);
|
|
496
|
+
}
|
|
497
|
+
}, _callee12);
|
|
498
|
+
}));
|
|
499
|
+
return function handleSelect(_x5) {
|
|
500
|
+
return _ref1.apply(this, arguments);
|
|
501
|
+
};
|
|
502
|
+
}();
|
|
503
|
+
var handleShowWalletSelector = /*#__PURE__*/function () {
|
|
504
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
|
|
505
|
+
var _t3;
|
|
506
|
+
return _regenerator().w(function (_context13) {
|
|
507
|
+
while (1) switch (_context13.p = _context13.n) {
|
|
508
|
+
case 0:
|
|
509
|
+
_context13.p = 0;
|
|
510
|
+
pushPage({
|
|
511
|
+
key: "Select wallet provider",
|
|
512
|
+
content: jsx(ExternalWalletSelector, {
|
|
513
|
+
onSelect: handleSelect
|
|
514
|
+
})
|
|
515
|
+
});
|
|
516
|
+
_context13.n = 2;
|
|
517
|
+
break;
|
|
518
|
+
case 1:
|
|
519
|
+
_context13.p = 1;
|
|
520
|
+
_t3 = _context13.v;
|
|
521
|
+
throw new Error("Error fetching wallet providers: ".concat(_t3));
|
|
522
|
+
case 2:
|
|
523
|
+
return _context13.a(2);
|
|
524
|
+
}
|
|
525
|
+
}, _callee13, null, [[0, 1]]);
|
|
526
|
+
}));
|
|
527
|
+
return function handleShowWalletSelector() {
|
|
528
|
+
return _ref10.apply(this, arguments);
|
|
529
|
+
};
|
|
530
|
+
}();
|
|
531
|
+
var oauthButtonMap = {
|
|
532
|
+
google: methods.googleOauthEnabled ? jsx(OAuthButton, {
|
|
533
|
+
name: "Google",
|
|
534
|
+
iconOnly: true,
|
|
535
|
+
icon: jsx(FontAwesomeIcon, {
|
|
536
|
+
icon: faGoogle,
|
|
537
|
+
className: "text-lg text-[#4285F4] dark:text-white"
|
|
538
|
+
}),
|
|
539
|
+
onClick: handleGoogle
|
|
540
|
+
}, "google") : null,
|
|
541
|
+
apple: methods.appleOauthEnabled ? jsx(OAuthButton, {
|
|
542
|
+
name: "Apple",
|
|
543
|
+
iconOnly: true,
|
|
544
|
+
icon: jsx(FontAwesomeIcon, {
|
|
545
|
+
icon: faApple,
|
|
546
|
+
className: "text-lg text-neutral-900 dark:text-white"
|
|
547
|
+
}),
|
|
548
|
+
onClick: handleApple
|
|
549
|
+
}, "apple") : null,
|
|
550
|
+
facebook: methods.facebookOauthEnabled ? jsx(OAuthButton, {
|
|
551
|
+
name: "Facebook",
|
|
552
|
+
iconOnly: true,
|
|
553
|
+
icon: jsx(FontAwesomeIcon, {
|
|
554
|
+
icon: faFacebook,
|
|
555
|
+
className: "text-lg text-[#1877F2] dark:text-white"
|
|
556
|
+
}),
|
|
557
|
+
onClick: handleFacebook
|
|
558
|
+
}, "facebook") : null,
|
|
559
|
+
x: methods.xOauthEnabled ? jsx(OAuthButton, {
|
|
560
|
+
name: "X",
|
|
561
|
+
iconOnly: true,
|
|
562
|
+
icon: jsx(FontAwesomeIcon, {
|
|
563
|
+
icon: faXTwitter,
|
|
564
|
+
className: "text-lg text-neutral-900 dark:text-white"
|
|
565
|
+
}),
|
|
566
|
+
onClick: handleX
|
|
567
|
+
}, "x") : null,
|
|
568
|
+
discord: methods.discordOauthEnabled ? jsx(OAuthButton, {
|
|
569
|
+
name: "Discord",
|
|
570
|
+
iconOnly: true,
|
|
571
|
+
icon: jsx(FontAwesomeIcon, {
|
|
572
|
+
icon: faDiscord,
|
|
573
|
+
className: "text-lg text-[#5865F2] dark:text-white"
|
|
574
|
+
}),
|
|
575
|
+
onClick: handleDiscord
|
|
576
|
+
}, "discord") : null
|
|
577
|
+
};
|
|
578
|
+
var oauthButtonsList = oauthOrder.map(function (provider) {
|
|
579
|
+
return oauthButtonMap[provider];
|
|
580
|
+
}).filter(Boolean);
|
|
581
|
+
var oauthButtonRow = function oauthButtonRow(buttons) {
|
|
582
|
+
return jsx("div", {
|
|
583
|
+
className: "flex w-full flex-row flex-wrap items-center justify-center gap-2",
|
|
584
|
+
children: buttons
|
|
585
|
+
});
|
|
586
|
+
};
|
|
587
|
+
var oauthBlockInner = oauthButtonsList.length > 0 && oauthButtonsList.length <= 5 ? oauthButtonRow(oauthButtonsList) : oauthButtonsList.length > 0 ? oauthButtonRow([].concat(_toConsumableArray(oauthButtonsList.slice(0, 4)), [jsx(OAuthButton, {
|
|
588
|
+
name: "More",
|
|
589
|
+
iconOnly: true,
|
|
590
|
+
icon: jsx(FontAwesomeIcon, {
|
|
591
|
+
icon: faEllipsisH
|
|
592
|
+
}),
|
|
593
|
+
onClick: function onClick() {
|
|
594
|
+
return openSheet({
|
|
595
|
+
key: "Select a social method",
|
|
596
|
+
content: jsx("div", {
|
|
597
|
+
className: "flex h-full w-full flex-wrap items-center justify-center gap-2",
|
|
598
|
+
children: oauthButtonsList.map(function (button, i) {
|
|
599
|
+
return jsx("div", {
|
|
600
|
+
className: "shrink-0",
|
|
601
|
+
children: button
|
|
602
|
+
}, i);
|
|
603
|
+
})
|
|
604
|
+
})
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
}, "more")])) : null;
|
|
608
|
+
var oauthBlock = oauthBlockInner ? jsx("div", {
|
|
609
|
+
className: "flex w-full flex-col",
|
|
610
|
+
children: oauthBlockInner
|
|
611
|
+
}) : null;
|
|
612
|
+
// -- Individual Auth Method Components --
|
|
613
|
+
var methodComponents = {
|
|
614
|
+
socials: oauthBlock,
|
|
615
|
+
email: methods.emailOtpAuthEnabled ? jsx(EmailInput, {
|
|
616
|
+
onContinue: handleEmailSubmit
|
|
617
|
+
}) : null,
|
|
618
|
+
sms: methods.smsOtpAuthEnabled ? jsx(PhoneNumberInput, {
|
|
619
|
+
onContinue: handlePhoneSubmit
|
|
620
|
+
}) : null,
|
|
621
|
+
passkey: methods.passkeyAuthEnabled ? jsx(PasskeyButtons, {
|
|
622
|
+
onLogin: handlePasskeyLogin,
|
|
623
|
+
onSignUp: handlePasskeySignUp
|
|
624
|
+
}) : null,
|
|
625
|
+
wallet: methods.walletAuthEnabled ? jsx(WalletAuthButton, {
|
|
626
|
+
onContinue: handleShowWalletSelector
|
|
627
|
+
}) : null
|
|
628
|
+
};
|
|
629
|
+
// -- Final Rendering Order --
|
|
630
|
+
var rendered = methodOrder.map(function (key) {
|
|
631
|
+
return methodComponents[key];
|
|
632
|
+
}).filter(Boolean);
|
|
633
|
+
return jsxs("div", {
|
|
634
|
+
className: clsx("flex flex-col items-center", isMobile ? "w-full" : "w-[360px]"),
|
|
635
|
+
children: [config.authProxyConfigId ? rendered.length > 0 ? jsxs(Fragment, {
|
|
636
|
+
children: [jsxs("div", {
|
|
637
|
+
className: clsx("mb-4 flex w-full flex-col items-center", logo ? "mt-3" : "mt-4"),
|
|
638
|
+
children: [logo ? jsx("img", {
|
|
639
|
+
src: logo,
|
|
640
|
+
alt: "",
|
|
641
|
+
className: "mt-3 h-fit max-h-16 w-fit max-w-32 object-contain ".concat(logoClassName !== null && logoClassName !== void 0 ? logoClassName : "")
|
|
642
|
+
}) : null, jsx("h1", {
|
|
643
|
+
className: clsx("text-center text-xl font-semibold leading-tight text-inherit", logo ? "mt-4" : "mt-0"),
|
|
644
|
+
children: title !== null && title !== void 0 ? title : "Welcome back"
|
|
645
|
+
}), jsx("p", {
|
|
646
|
+
className: "mt-1 text-center text-sm text-icon-text-light/60 dark:text-icon-text-dark/60",
|
|
647
|
+
children: "Log in or create your account"
|
|
648
|
+
})]
|
|
649
|
+
}), rendered.map(function (component, index) {
|
|
650
|
+
return jsxs("div", {
|
|
651
|
+
className: "w-full",
|
|
652
|
+
children: [index > 0 && jsx(OrSeparator, {}), component]
|
|
653
|
+
}, index);
|
|
654
|
+
})]
|
|
655
|
+
}) : jsx(DeveloperError, {
|
|
656
|
+
developerTitle: "No Auth Methods Enabled",
|
|
657
|
+
developerMessages: ["You are using ZeroXKey's Auth Proxy, but no auth methods are enabled.", "To use this modal, you must enable auth methods within the ZeroXKey dashboard.", "If you disabled autoFetchWalletKitConfig in the ZeroXKeyProvider, please ensure that you are passing in the correct auth methods in the ZeroXKeyProvider's auth config."],
|
|
658
|
+
userMessages: ["No authentication methods are available."]
|
|
659
|
+
}) : jsx(DeveloperError, {
|
|
660
|
+
developerTitle: "Proxy not Enabled",
|
|
661
|
+
developerMessages: ["You have not passed in authProxyConfigId into the ZeroXKeyProvider.", "To use this modal, you must be using ZeroXKey's Auth Proxy.", "Please enable it in the ZeroXKey dashboard and pass in the authProxyConfigId into the ZeroXKeyProvider."],
|
|
662
|
+
// Users should never see this message ever. We should give a reward for anyone who does see this.
|
|
663
|
+
userMessages: ["You touched fuzzy.... and got dizzy."]
|
|
664
|
+
}), jsx("div", {
|
|
665
|
+
className: "mt-5 max-w-sm px-1 text-center text-xs leading-relaxed text-icon-text-light/60 dark:text-icon-text-dark/60",
|
|
666
|
+
children: "Secured by 0xkey"
|
|
667
|
+
})]
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export { AuthComponent };
|
|
672
|
+
//# sourceMappingURL=index.mjs.map
|