@pooflabs/web 0.0.81-rc5 → 0.0.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/auth/index.d.ts +10 -1
  2. package/dist/auth/providers/phantom-wallet-provider.d.ts +20 -21
  3. package/dist/global.d.ts +3 -1
  4. package/dist/{index-Fjyk5jYL.js → index-BicMkamC.js} +483 -522
  5. package/dist/index-BicMkamC.js.map +1 -0
  6. package/dist/{index-Bkr4BRoP.esm.js → index-BsY_Lgiu.esm.js} +482 -522
  7. package/dist/index-BsY_Lgiu.esm.js.map +1 -0
  8. package/dist/index-CHWmdXHE.esm.js +6 -0
  9. package/dist/index-CHWmdXHE.esm.js.map +1 -0
  10. package/dist/{index-DB9nDInp.esm.js → index-CK_2Zn89.esm.js} +3825 -563
  11. package/dist/index-CK_2Zn89.esm.js.map +1 -0
  12. package/dist/{index-D_ta2S2c.js → index-Ci3m3diI.js} +3825 -563
  13. package/dist/index-Ci3m3diI.js.map +1 -0
  14. package/dist/{index-CZhJBWap.esm.js → index-DWf2AOhe.esm.js} +3824 -562
  15. package/dist/index-DWf2AOhe.esm.js.map +1 -0
  16. package/dist/{index-Bg_ApFIo.js → index-DlKo76M3.js} +3826 -564
  17. package/dist/index-DlKo76M3.js.map +1 -0
  18. package/dist/index-Dz0bPXrU.js +8 -0
  19. package/dist/index-Dz0bPXrU.js.map +1 -0
  20. package/dist/{index.browser-DHi7UhqF.js → index.browser-BkMiHSON.js} +2 -2
  21. package/dist/{index.browser-DHi7UhqF.js.map → index.browser-BkMiHSON.js.map} +1 -1
  22. package/dist/{index.browser-Disp7Kcb.esm.js → index.browser-C9bFQZyQ.esm.js} +128 -5
  23. package/dist/index.browser-C9bFQZyQ.esm.js.map +1 -0
  24. package/dist/{index.browser-iqs5DlRU.esm.js → index.browser-DCOvqSUT.esm.js} +2 -2
  25. package/dist/{index.browser-iqs5DlRU.esm.js.map → index.browser-DCOvqSUT.esm.js.map} +1 -1
  26. package/dist/{index.browser-BTlliHCf.esm.js → index.browser-Dbq5Qf1G.esm.js} +128 -5
  27. package/dist/index.browser-Dbq5Qf1G.esm.js.map +1 -0
  28. package/dist/{index.browser-DvTeEO2r.js → index.browser-Df7yN8D5.js} +129 -6
  29. package/dist/index.browser-Df7yN8D5.js.map +1 -0
  30. package/dist/{index.browser-DRTQuf0J.js → index.browser-dszs5oe5.js} +129 -6
  31. package/dist/index.browser-dszs5oe5.js.map +1 -0
  32. package/dist/index.d.ts +1 -0
  33. package/dist/index.esm.js +1 -1
  34. package/dist/index.js +1 -1
  35. package/dist/{index.native-DJWuqJTZ.js → index.native-11supFRU.js} +2742 -240
  36. package/dist/index.native-11supFRU.js.map +1 -0
  37. package/dist/{index.native-DYgJWWY4.esm.js → index.native-CLaHKvDv.esm.js} +2740 -241
  38. package/dist/index.native-CLaHKvDv.esm.js.map +1 -0
  39. package/dist/index.native.esm.js +1 -1
  40. package/dist/index.native.js +1 -1
  41. package/dist/{phantom-wallet-provider-DSFGWSOJ.esm.js → phantom-wallet-provider-BN47klTp.esm.js} +148 -239
  42. package/dist/phantom-wallet-provider-BN47klTp.esm.js.map +1 -0
  43. package/dist/{phantom-wallet-provider-fofd8BMo.js → phantom-wallet-provider-Xb070-O6.js} +148 -239
  44. package/dist/phantom-wallet-provider-Xb070-O6.js.map +1 -0
  45. package/dist/{privy-wallet-provider-Csv34Kcc.js → privy-wallet-provider-Ch22rj_G.js} +3 -3
  46. package/dist/privy-wallet-provider-Ch22rj_G.js.map +1 -0
  47. package/dist/{privy-wallet-provider-TRToDe4Q.esm.js → privy-wallet-provider-DUJS5viU.esm.js} +3 -3
  48. package/dist/privy-wallet-provider-DUJS5viU.esm.js.map +1 -0
  49. package/dist/{solana-mobile-wallet-provider-L7nRuxhv.esm.js → solana-mobile-wallet-provider-BF04Xp8P.esm.js} +4 -83
  50. package/dist/solana-mobile-wallet-provider-BF04Xp8P.esm.js.map +1 -0
  51. package/dist/{solana-mobile-wallet-provider-Cp65LfNb.js → solana-mobile-wallet-provider-BXm94fqW.js} +4 -83
  52. package/dist/solana-mobile-wallet-provider-BXm94fqW.js.map +1 -0
  53. package/package.json +3 -3
  54. package/dist/index-Bdcc5821.js +0 -2375
  55. package/dist/index-Bdcc5821.js.map +0 -1
  56. package/dist/index-Bg_ApFIo.js.map +0 -1
  57. package/dist/index-Bkr4BRoP.esm.js.map +0 -1
  58. package/dist/index-CZhJBWap.esm.js.map +0 -1
  59. package/dist/index-CrOVJFX9.esm.js +0 -2373
  60. package/dist/index-CrOVJFX9.esm.js.map +0 -1
  61. package/dist/index-DB9nDInp.esm.js.map +0 -1
  62. package/dist/index-D_ta2S2c.js.map +0 -1
  63. package/dist/index-Fjyk5jYL.js.map +0 -1
  64. package/dist/index.browser-BTlliHCf.esm.js.map +0 -1
  65. package/dist/index.browser-DRTQuf0J.js.map +0 -1
  66. package/dist/index.browser-Disp7Kcb.esm.js.map +0 -1
  67. package/dist/index.browser-DvTeEO2r.js.map +0 -1
  68. package/dist/index.native-DJWuqJTZ.js.map +0 -1
  69. package/dist/index.native-DYgJWWY4.esm.js.map +0 -1
  70. package/dist/phantom-wallet-provider-DSFGWSOJ.esm.js.map +0 -1
  71. package/dist/phantom-wallet-provider-fofd8BMo.js.map +0 -1
  72. package/dist/privy-wallet-provider-Csv34Kcc.js.map +0 -1
  73. package/dist/privy-wallet-provider-TRToDe4Q.esm.js.map +0 -1
  74. package/dist/solana-mobile-wallet-provider-Cp65LfNb.js.map +0 -1
  75. package/dist/solana-mobile-wallet-provider-L7nRuxhv.esm.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export { U as DEFAULT_TEST_ADDRESS, Y as InsufficientBalanceError, T as MockAuthProvider, V as OffchainAuthProvider, X as PrivyExpoProvider, Z as ReactNativeSessionManager, _ as ServerSessionManager, W as WebSessionManager, M as aggregate, b as buildSetDocumentsTransaction, $ as clearCache, a0 as closeAllSubscriptions, c as convertRemainingAccounts, L as count, f as createSessionWithPrivy, n as createSessionWithSignature, P as deserializeTransaction, l as genAuthNonce, m as genSolanaMessage, z as get, u as getAuthLoading, y as getAuthProvider, a1 as getCachedData, x as getConfig, q as getCurrentUser, D as getFiles, Q as getIdToken, a2 as getMany, g as getPlatform, p as init, v as login, w as logout, t as onAuthLoadingChanged, r as onAuthStateChanged, a3 as reconnectWithNewAuth, a4 as refreshSession, G as runExpression, H as runExpressionMany, E as runQuery, F as runQueryMany, A as set, C as setFile, B as setMany, R as setPlatform, K as signAndSubmitTransaction, I as signMessage, a5 as signSessionCreateMessage, J as signTransaction, N as subscribe, O as useAuth } from './index.native-DYgJWWY4.esm.js';
1
+ export { Z as DEFAULT_TEST_ADDRESS, a0 as InsufficientBalanceError, Y as MockAuthProvider, _ as OffchainAuthProvider, $ as PrivyExpoProvider, a1 as ReactNativeSessionManager, a2 as ServerSessionManager, W as WebSessionManager, Q as aggregate, b as buildSetDocumentsTransaction, a3 as clearCache, a4 as closeAllSubscriptions, c as convertRemainingAccounts, P as count, f as createSessionWithPrivy, o as createSessionWithSignature, U as deserializeTransaction, m as genAuthNonce, n as genSolanaMessage, D as get, y as getAuthLoading, C as getAuthProvider, a5 as getCachedData, B as getConfig, v as getCurrentUser, H as getFiles, V as getIdToken, a6 as getMany, g as getPlatform, u as init, z as login, A as logout, x as onAuthLoadingChanged, w as onAuthStateChanged, a7 as reconnectWithNewAuth, a8 as refreshSession, K as runExpression, L as runExpressionMany, I as runQuery, J as runQueryMany, E as set, G as setFile, F as setMany, X as setPlatform, O as signAndSubmitTransaction, M as signMessage, a9 as signSessionCreateMessage, N as signTransaction, R as subscribe, T as useAuth } from './index.native-CLaHKvDv.esm.js';
2
2
  import 'axios';
3
3
  import '@solana/web3.js';
4
4
  import '@coral-xyz/anchor';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index_native = require('./index.native-DJWuqJTZ.js');
3
+ var index_native = require('./index.native-11supFRU.js');
4
4
  require('axios');
5
5
  require('@solana/web3.js');
6
6
  require('@coral-xyz/anchor');
@@ -1,5 +1,5 @@
1
- import { b as bufferExports } from './index-CrOVJFX9.esm.js';
2
- import { h as detectAndroid, g as getPlatform, W as WebSessionManager, c as convertRemainingAccounts, b as buildSetDocumentsTransaction, e as confirmAndCheckTransaction, s as setCurrentUser, a as SOLANA_DEVNET_RPC_URL, S as SOLANA_MAINNET_RPC_URL, i as SURFNET_RPC_URL, j as detectMobile, k as setAuthLoading, l as genAuthNonce, m as genSolanaMessage, n as createSessionWithSignature } from './index.native-DYgJWWY4.esm.js';
1
+ import { b as bufferExports } from './index-CHWmdXHE.esm.js';
2
+ import { W as WebSessionManager, c as convertRemainingAccounts, b as buildSetDocumentsTransaction, e as confirmAndCheckTransaction, s as setCurrentUser, a as SOLANA_DEVNET_RPC_URL, S as SOLANA_MAINNET_RPC_URL, h as SURFNET_RPC_URL, j as detectMobile, k as detectAndroid, l as setAuthLoading, m as genAuthNonce, n as genSolanaMessage, o as createSessionWithSignature, g as getPlatform } from './index.native-CLaHKvDv.esm.js';
3
3
  import { Connection, PublicKey, VersionedTransaction } from '@solana/web3.js';
4
4
  import * as anchor from '@coral-xyz/anchor';
5
5
  import 'axios';
@@ -52,7 +52,7 @@ async function loadDependencies() {
52
52
  const [reactModule, reactDomModule, phantomModule] = await Promise.all([
53
53
  import('react'),
54
54
  import('react-dom/client'),
55
- import('./index-DB9nDInp.esm.js')
55
+ import('./index-CK_2Zn89.esm.js')
56
56
  ]);
57
57
  // Extract default export from ESM module namespace
58
58
  // Dynamic import() returns { default: Module, ...exports }, not the module directly
@@ -64,6 +64,10 @@ async function loadDependencies() {
64
64
  return loadingPromise;
65
65
  }
66
66
  class PhantomWalletProvider {
67
+ /** Temporarily override modal appearance for a single login() call. Cleared automatically after login settles. */
68
+ setLoginOverrides(opts) {
69
+ this.loginOverrides = opts;
70
+ }
67
71
  constructor(networkUrl = null, config = {}) {
68
72
  this.containerElement = null;
69
73
  this.root = null;
@@ -73,6 +77,7 @@ class PhantomWalletProvider {
73
77
  this.loginInProgress = false;
74
78
  this.autoLoginInProgress = false;
75
79
  this.initPromise = null;
80
+ this.loginOverrides = null;
76
81
  /** Callback to swap to a Privy provider when the user clicks "Log in with email" */
77
82
  this.onSwitchToPrivy = null;
78
83
  /** Callback to swap to a Mobile Wallet Adapter provider when the user clicks "Connect Mobile Wallet" */
@@ -95,13 +100,8 @@ class PhantomWalletProvider {
95
100
  async initializeAsync() {
96
101
  // Lazy load dependencies only when actually instantiating
97
102
  await loadDependencies();
98
- // Initialize React component eagerly only when there's a real reason to
99
- // (URL callback to consume, prior session to restore, in-page wallet,
100
- // or non-Android). Otherwise defer until ensureReady() is reached from
101
- // a user-gesture flow. See shouldMountEagerly() for the rationale.
102
- if (this.shouldMountEagerly()) {
103
- this.initialize();
104
- }
103
+ // Initialize React component
104
+ this.initialize();
105
105
  }
106
106
  /**
107
107
  * Check if social login providers are configured (non-injected providers).
@@ -109,69 +109,6 @@ class PhantomWalletProvider {
109
109
  hasSocialProviders() {
110
110
  return this.resolvedProviders.some(p => p !== 'injected');
111
111
  }
112
- /**
113
- * Decide whether to mount the @phantom/react-sdk <PhantomProvider> tree
114
- * eagerly during init() or defer until the first user-triggered call
115
- * (login / sign / etc.) reaches ensureReady().
116
- *
117
- * Mounting the React tree synchronously constructs BrowserSDK, which runs
118
- * wallet-standard discovery in its constructor and fires sdk.autoConnect()
119
- * in a useEffect on mount. On Solana Seeker (Android Chrome PWA), both
120
- * pathways probe the Android intent surface to discover the Phantom mobile
121
- * app, which surfaces Chrome's system "wants to access other apps and
122
- * services" permission dialog *before* the PWA activity has window focus.
123
- * The dialog renders with grayed-out buttons until the user backgrounds
124
- * and resumes the app.
125
- *
126
- * Returns true when eager mount is needed (callback to handle, prior
127
- * session, in-page wallet present, or non-Android). Otherwise returns
128
- * false — the React tree is mounted lazily inside ensureReady() once a
129
- * user gesture brings us there.
130
- */
131
- shouldMountEagerly() {
132
- if (typeof window === 'undefined')
133
- return false;
134
- // Preserve desktop behavior: always mount eagerly.
135
- if (!detectAndroid())
136
- return true;
137
- // In-page wallet present (Phantom in-app browser / desktop extension on
138
- // a desktop-mode Android UA): no Android intent probe needed, mount free.
139
- // Tighten beyond truthy `window.phantom` since arbitrary stubs can land
140
- // on that key — require a wallet-shaped surface.
141
- const ph = window.phantom;
142
- if (ph && (ph.solana || ph.ethereum || ph.app))
143
- return true;
144
- // Returning from a Phantom redirect (OAuth or deeplink hop). SDK must
145
- // be live to read these URL params via urlParamsAccessor.
146
- const callbackKeys = ['session_id', 'wallet_id', 'selected_account_index', 'error', 'error_description'];
147
- try {
148
- const params = new URLSearchParams(window.location.search);
149
- if (callbackKeys.some(k => params.has(k)))
150
- return true;
151
- }
152
- catch (_a) {
153
- return true; // conservative on URL access failure
154
- }
155
- // Returning user with a stored Phantom session. They've already
156
- // approved the Android intent permission for this origin on first
157
- // login, so the dialog is typically pre-granted by Chrome — eager
158
- // mount lets autoConnect silently restore the wallet handshake.
159
- // Require BOTH the marker AND a session storage entry so a stale
160
- // orphaned marker doesn't keep eager-mounting forever. Note
161
- // isAuthenticated() is a raw key-existence check, not a validity
162
- // check — restoreSession() above clears the marker on the next load
163
- // if the session is unusable, so the bug self-corrects after at
164
- // most one further cold start.
165
- try {
166
- const stored = getPlatform().storage.getItem('tarobase_last_auth_method');
167
- if (stored === 'phantom' && WebSessionManager.isAuthenticated())
168
- return true;
169
- }
170
- catch (_b) {
171
- return true;
172
- }
173
- return false;
174
- }
175
112
  static getInstance(networkUrl, config) {
176
113
  if (!PhantomWalletProvider.instance) {
177
114
  new PhantomWalletProvider(networkUrl, config);
@@ -247,7 +184,7 @@ class PhantomWalletProvider {
247
184
  const sdkProviders = this.resolvedProviders.length > 0 ? [...this.resolvedProviders] : ['injected'];
248
185
  // Inner component that uses hooks
249
186
  const PhantomHooksComponent = () => {
250
- var _a, _b;
187
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
251
188
  const phantom = usePhantom();
252
189
  const { connect, error: connectError } = useConnect();
253
190
  const { disconnect, isDisconnecting } = useDisconnect();
@@ -530,63 +467,13 @@ class PhantomWalletProvider {
530
467
  }
531
468
  };
532
469
  const handleMobileWalletClick = async () => {
533
- var _a;
534
- console.log('[MWA-DEBUG] handleMobileWalletClick: entered', {
535
- documentHasFocus: typeof document !== 'undefined' ? document.hasFocus() : 'n/a',
536
- visibilityState: typeof document !== 'undefined' ? document.visibilityState : 'n/a',
537
- displayMode: typeof window !== 'undefined' && window.matchMedia
538
- ? (window.matchMedia('(display-mode: standalone)').matches ? 'standalone' : 'browser')
539
- : 'n/a',
540
- userAgent: typeof navigator !== 'undefined' ? navigator.userAgent : 'n/a',
541
- timestamp: Date.now(),
542
- });
543
470
  that.loginInProgress = false;
544
471
  walletClickedRef.current = true;
545
472
  setShowWalletModal(false);
546
- // Hide the Phantom provider container while MWA's transact()
547
- // is opening the localhost WebSocket and Chrome surfaces the
548
- // "Apps on Device" / Local Network Access permission dialog.
549
- //
550
- // The container is a singleton fixed full-viewport <div> with
551
- // z-index 2147483647 + pointer-events: none parked on body.
552
- // Even though pointer-events: none should let touches pass
553
- // through, on Android Chrome (both PWA and regular browser)
554
- // the system permission dialog rendered during MWA's
555
- // handshake comes up with disabled-looking buttons until the
556
- // activity is forced to re-composite (the user's
557
- // background+reopen workaround).
558
- //
559
- // Display:none-ing the container during MWA login removes it
560
- // from the layout tree entirely so there's nothing for the
561
- // dialog hit-testing / compositor to get confused by. It's
562
- // restored after MWA login resolves or rejects.
563
- const containerEl = that.containerElement;
564
- const previousDisplay = (_a = containerEl === null || containerEl === void 0 ? void 0 : containerEl.style.display) !== null && _a !== void 0 ? _a : '';
565
- console.log('[MWA-DEBUG] container before hide', {
566
- hasContainer: !!containerEl,
567
- previousDisplay,
568
- inDom: containerEl ? document.body.contains(containerEl) : false,
569
- zIndex: containerEl === null || containerEl === void 0 ? void 0 : containerEl.style.zIndex,
570
- pointerEvents: containerEl === null || containerEl === void 0 ? void 0 : containerEl.style.pointerEvents,
571
- });
572
- if (containerEl) {
573
- containerEl.style.display = 'none';
574
- }
575
- console.log('[MWA-DEBUG] container hidden, computed display now:', containerEl ? getComputedStyle(containerEl).display : 'n/a');
576
- const restoreContainer = () => {
577
- if (containerEl) {
578
- containerEl.style.display = previousDisplay;
579
- console.log('[MWA-DEBUG] container restored, display:', containerEl.style.display);
580
- }
581
- };
582
473
  if (that.onSwitchToMWA) {
583
474
  try {
584
- console.log('[MWA-DEBUG] calling onSwitchToMWA');
585
475
  const mwaProvider = await that.onSwitchToMWA();
586
- console.log('[MWA-DEBUG] onSwitchToMWA resolved, calling mwaProvider.login()');
587
476
  const user = await mwaProvider.login();
588
- console.log('[MWA-DEBUG] mwaProvider.login() resolved', { hasUser: !!user });
589
- restoreContainer();
590
477
  if (that.pendingLogin && user) {
591
478
  that.pendingLogin.resolve(user);
592
479
  that.pendingLogin = null;
@@ -597,22 +484,12 @@ class PhantomWalletProvider {
597
484
  }
598
485
  }
599
486
  catch (error) {
600
- console.log('[MWA-DEBUG] mwaProvider.login() threw', {
601
- errorName: error === null || error === void 0 ? void 0 : error.name,
602
- errorMessage: error === null || error === void 0 ? void 0 : error.message,
603
- errorCode: error === null || error === void 0 ? void 0 : error.code,
604
- });
605
- restoreContainer();
606
487
  if (that.pendingLogin) {
607
488
  that.pendingLogin.reject(error);
608
489
  that.pendingLogin = null;
609
490
  }
610
491
  }
611
492
  }
612
- else {
613
- console.log('[MWA-DEBUG] no onSwitchToMWA configured');
614
- restoreContainer();
615
- }
616
493
  };
617
494
  const handleCloseModal = () => {
618
495
  setShowWalletModal(false);
@@ -626,31 +503,59 @@ class PhantomWalletProvider {
626
503
  if (!showWalletModal) {
627
504
  return null;
628
505
  }
629
- const theme = that.config.theme === 'light' ? lightTheme : darkTheme;
630
- const bgColor = ((_a = theme === null || theme === void 0 ? void 0 : theme.background) === null || _a === void 0 ? void 0 : _a.primary) || (that.config.theme === 'light' ? '#FFFFFF' : '#1A1A2E');
631
- const textColor = ((_b = theme === null || theme === void 0 ? void 0 : theme.text) === null || _b === void 0 ? void 0 : _b.primary) || (that.config.theme === 'light' ? '#000000' : '#FFFFFF');
632
- const btnBg = 'rgba(152,151,156,0.1)';
633
- const btnHoverBg = 'rgba(152,151,156,0.15)';
506
+ const effectiveTheme = (_c = (_b = (_a = that.loginOverrides) === null || _a === void 0 ? void 0 : _a.theme) !== null && _b !== void 0 ? _b : that.config.theme) !== null && _c !== void 0 ? _c : 'dark';
507
+ const isLight = effectiveTheme === 'light';
508
+ const bgColor = isLight ? '#FFFFFF' : '#111113';
509
+ const cardBorder = isLight ? '1px solid rgba(0,0,0,0.08)' : '1px solid rgba(255,255,255,0.07)';
510
+ const textColor = isLight ? '#0f0f0f' : '#f5f5f5';
511
+ const subTextColor = isLight ? 'rgba(0,0,0,0.45)' : 'rgba(255,255,255,0.4)';
512
+ const btnBg = isLight ? 'rgba(0,0,0,0.04)' : 'rgba(255,255,255,0.05)';
513
+ const btnHoverBg = isLight ? 'rgba(0,0,0,0.08)' : 'rgba(255,255,255,0.09)';
514
+ const btnBorder = isLight ? '1px solid rgba(0,0,0,0.10)' : '1px solid rgba(255,255,255,0.09)';
515
+ const dividerColor = isLight ? 'rgba(0,0,0,0.10)' : 'rgba(255,255,255,0.08)';
634
516
  const fontFamily = '"SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif';
635
517
  const buttonStyle = (id) => ({
636
518
  display: 'flex',
637
519
  alignItems: 'center',
638
520
  justifyContent: 'center',
639
- gap: '12px',
521
+ gap: '10px',
640
522
  width: '100%',
641
- height: '56px',
642
- padding: '12px 16px',
643
- border: 'none',
644
- borderRadius: '16px',
523
+ height: '52px',
524
+ padding: '0 20px',
525
+ border: btnBorder,
526
+ borderRadius: '12px',
645
527
  backgroundColor: hoveredBtn === id ? btnHoverBg : btnBg,
646
528
  color: textColor,
647
529
  fontFamily,
648
530
  fontSize: '14px',
649
- fontWeight: '600',
650
- lineHeight: '17px',
651
- letterSpacing: '-0.14px',
531
+ fontWeight: '500',
532
+ lineHeight: '1',
533
+ letterSpacing: '0',
534
+ cursor: 'pointer',
535
+ transition: 'background-color 0.15s, border-color 0.15s',
536
+ boxSizing: 'border-box',
537
+ });
538
+ const emailButtonStyle = (id) => ({
539
+ display: 'flex',
540
+ alignItems: 'center',
541
+ justifyContent: 'center',
542
+ gap: '10px',
543
+ width: '100%',
544
+ height: '52px',
545
+ padding: '0 20px',
546
+ border: isLight ? '1px solid rgba(0,0,0,0.15)' : '1px solid rgba(255,255,255,0.15)',
547
+ borderRadius: '12px',
548
+ backgroundColor: hoveredBtn === id
549
+ ? (isLight ? 'rgba(0,0,0,0.06)' : 'rgba(255,255,255,0.12)')
550
+ : (isLight ? 'rgba(0,0,0,0.03)' : 'rgba(255,255,255,0.08)'),
551
+ color: textColor,
552
+ fontFamily,
553
+ fontSize: '14px',
554
+ fontWeight: '500',
555
+ lineHeight: '1',
652
556
  cursor: 'pointer',
653
- transition: 'background-color 0.2s',
557
+ transition: 'background-color 0.15s, border-color 0.15s',
558
+ boxSizing: 'border-box',
654
559
  });
655
560
  const walletButtons = [];
656
561
  // Google OAuth button — shown when 'google' is in resolved providers
@@ -662,7 +567,7 @@ class PhantomWalletProvider {
662
567
  onMouseEnter: () => setHoveredBtn('google-oauth'),
663
568
  onMouseLeave: () => setHoveredBtn(null),
664
569
  }, React.createElement('svg', {
665
- width: '20', height: '20', viewBox: '0 0 24 24',
570
+ width: '18', height: '18', viewBox: '0 0 24 24',
666
571
  style: { flexShrink: '0' },
667
572
  }, React.createElement('path', {
668
573
  d: 'M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z',
@@ -687,7 +592,7 @@ class PhantomWalletProvider {
687
592
  onMouseEnter: () => setHoveredBtn('apple-oauth'),
688
593
  onMouseLeave: () => setHoveredBtn(null),
689
594
  }, React.createElement('svg', {
690
- width: '20', height: '20', viewBox: '0 0 24 24',
595
+ width: '18', height: '18', viewBox: '0 0 24 24',
691
596
  fill: textColor,
692
597
  style: { flexShrink: '0' },
693
598
  }, React.createElement('path', {
@@ -739,11 +644,9 @@ class PhantomWalletProvider {
739
644
  onClick: handleMobileWalletClick,
740
645
  onMouseEnter: () => setHoveredBtn('mobile-wallet'),
741
646
  onMouseLeave: () => setHoveredBtn(null),
742
- },
743
- // Mobile wallet icon (phone with wallet)
744
- React.createElement('svg', {
745
- width: '20', height: '20', viewBox: '0 0 24 24', fill: 'none',
746
- style: { flexShrink: '0' },
647
+ }, React.createElement('svg', {
648
+ width: '18', height: '18', viewBox: '0 0 24 24', fill: 'none',
649
+ style: { flexShrink: '0', opacity: '0.85' },
747
650
  },
748
651
  // Phone outline
749
652
  React.createElement('rect', {
@@ -765,23 +668,51 @@ class PhantomWalletProvider {
765
668
  if (that.config.enablePrivyFallback) {
766
669
  walletButtons.push(React.createElement('button', {
767
670
  key: 'email-login',
768
- style: buttonStyle('email-login'),
671
+ style: emailButtonStyle('email-login'),
769
672
  onClick: handleEmailClick,
770
673
  onMouseEnter: () => setHoveredBtn('email-login'),
771
674
  onMouseLeave: () => setHoveredBtn(null),
772
- },
773
- // Email icon
774
- React.createElement('svg', {
775
- width: '20', height: '20', viewBox: '0 0 24 24', fill: 'none',
776
- style: { flexShrink: '0' },
675
+ }, React.createElement('svg', {
676
+ width: '18', height: '18', viewBox: '0 0 24 24', fill: 'none',
677
+ style: { flexShrink: '0', opacity: '0.7' },
777
678
  }, React.createElement('path', {
778
679
  d: 'M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z',
779
- stroke: textColor, strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none',
680
+ stroke: textColor, strokeWidth: '1.75', strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none',
780
681
  }), React.createElement('path', {
781
682
  d: 'M22 6l-10 7L2 6',
782
- stroke: textColor, strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none',
783
- })), 'Log in with email'));
683
+ stroke: textColor, strokeWidth: '1.75', strokeLinecap: 'round', strokeLinejoin: 'round', fill: 'none',
684
+ })), 'Continue with email'));
784
685
  }
686
+ // Split email button from the rest to insert OR divider
687
+ const emailBtnIndex = walletButtons.findIndex((b) => b && b.key === 'email-login');
688
+ const mainButtons = emailBtnIndex >= 0 ? walletButtons.slice(0, emailBtnIndex) : walletButtons;
689
+ const emailButton = emailBtnIndex >= 0 ? walletButtons[emailBtnIndex] : null;
690
+ // OR divider — shown when there are both wallet/social buttons and an email button
691
+ const orDivider = (mainButtons.length > 0 && emailButton)
692
+ ? React.createElement('div', {
693
+ key: 'or-divider',
694
+ style: {
695
+ display: 'flex',
696
+ alignItems: 'center',
697
+ gap: '12px',
698
+ margin: '4px 0',
699
+ },
700
+ }, React.createElement('div', {
701
+ style: { flex: '1', height: '1px', backgroundColor: dividerColor },
702
+ }), React.createElement('span', {
703
+ style: {
704
+ color: subTextColor,
705
+ fontFamily,
706
+ fontSize: '12px',
707
+ fontWeight: '500',
708
+ letterSpacing: '0.02em',
709
+ textTransform: 'uppercase',
710
+ userSelect: 'none',
711
+ },
712
+ }, 'or'), React.createElement('div', {
713
+ style: { flex: '1', height: '1px', backgroundColor: dividerColor },
714
+ }))
715
+ : null;
785
716
  // Render custom modal
786
717
  return React.createElement('div', {
787
718
  // Overlay
@@ -791,12 +722,14 @@ class PhantomWalletProvider {
791
722
  left: '0',
792
723
  right: '0',
793
724
  bottom: '0',
794
- backgroundColor: 'rgba(0,0,0,0.5)',
725
+ backgroundColor: isLight ? 'rgba(0,0,0,0.35)' : 'rgba(0,0,0,0.65)',
795
726
  display: 'flex',
796
727
  alignItems: 'center',
797
728
  justifyContent: 'center',
798
729
  zIndex: 2147483647,
799
730
  pointerEvents: 'auto',
731
+ backdropFilter: 'blur(4px)',
732
+ WebkitBackdropFilter: 'blur(4px)',
800
733
  },
801
734
  onClick: (e) => {
802
735
  if (e.target === e.currentTarget)
@@ -813,13 +746,17 @@ class PhantomWalletProvider {
813
746
  React.createElement('div', {
814
747
  style: {
815
748
  backgroundColor: bgColor,
816
- borderRadius: '24px',
817
- width: '360px',
818
- maxWidth: '90vw',
819
- padding: '24px',
749
+ border: cardBorder,
750
+ borderRadius: '20px',
751
+ width: '380px',
752
+ maxWidth: 'calc(100vw - 32px)',
753
+ padding: '28px 24px 24px',
820
754
  position: 'relative',
821
- boxShadow: '0 20px 60px rgba(0,0,0,0.3)',
755
+ boxShadow: isLight
756
+ ? '0 8px 40px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06)'
757
+ : '0 8px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.3)',
822
758
  pointerEvents: 'auto',
759
+ boxSizing: 'border-box',
823
760
  },
824
761
  onMouseDown: (e) => {
825
762
  e.stopPropagation();
@@ -828,26 +765,30 @@ class PhantomWalletProvider {
828
765
  e.stopPropagation();
829
766
  },
830
767
  },
831
- // Close button (X)
768
+ // Close button
832
769
  React.createElement('button', {
833
770
  onClick: handleCloseModal,
834
771
  style: {
835
772
  position: 'absolute',
836
- top: '16px',
837
- right: '16px',
838
- background: 'none',
839
- border: 'none',
773
+ top: '14px',
774
+ right: '14px',
775
+ background: isLight ? 'rgba(0,0,0,0.05)' : 'rgba(255,255,255,0.07)',
776
+ border: isLight ? '1px solid rgba(0,0,0,0.08)' : '1px solid rgba(255,255,255,0.08)',
777
+ borderRadius: '50%',
778
+ width: '28px',
779
+ height: '28px',
840
780
  cursor: 'pointer',
841
- padding: '4px',
842
781
  display: 'flex',
843
782
  alignItems: 'center',
844
783
  justifyContent: 'center',
784
+ padding: '0',
785
+ flexShrink: '0',
845
786
  },
846
787
  }, React.createElement('svg', {
847
- width: '14', height: '14', viewBox: '0 0 14 14', fill: 'none',
788
+ width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none',
848
789
  }, React.createElement('path', {
849
- d: 'M13 1L1 13M1 1l12 12',
850
- stroke: textColor, strokeWidth: '2', strokeLinecap: 'round',
790
+ d: 'M11 1L1 11M1 1l10 10',
791
+ stroke: subTextColor, strokeWidth: '1.75', strokeLinecap: 'round',
851
792
  }))),
852
793
  // App icon (if provided)
853
794
  that.config.appIcon ? React.createElement('div', {
@@ -855,27 +796,40 @@ class PhantomWalletProvider {
855
796
  }, React.createElement('img', {
856
797
  src: that.config.appIcon,
857
798
  alt: that.config.appName || 'App',
858
- style: { width: '48px', height: '48px', borderRadius: '12px' },
799
+ style: { width: '44px', height: '44px', borderRadius: '10px' },
859
800
  })) : null,
860
801
  // Title
861
802
  React.createElement('div', {
862
803
  style: {
863
804
  color: textColor,
864
805
  fontFamily,
865
- fontSize: '18px',
806
+ fontSize: '17px',
866
807
  fontWeight: '600',
867
808
  textAlign: 'center',
809
+ marginBottom: '6px',
810
+ letterSpacing: '-0.2px',
811
+ },
812
+ }, (_f = (_e = (_d = that.loginOverrides) === null || _d === void 0 ? void 0 : _d.modalTitle) !== null && _e !== void 0 ? _e : that.config.modalTitle) !== null && _f !== void 0 ? _f : (that.config.appName ? `Log in to ${that.config.appName}` : 'Log in to your account')),
813
+ // Subtitle
814
+ React.createElement('div', {
815
+ style: {
816
+ color: subTextColor,
817
+ fontFamily,
818
+ fontSize: '13px',
819
+ fontWeight: '400',
820
+ textAlign: 'center',
868
821
  marginBottom: '24px',
822
+ lineHeight: '1.4',
869
823
  },
870
- }, 'Connect Wallet'),
871
- // Wallet buttons
824
+ }, (_j = (_h = (_g = that.loginOverrides) === null || _g === void 0 ? void 0 : _g.modalSubtitle) !== null && _h !== void 0 ? _h : that.config.modalSubtitle) !== null && _j !== void 0 ? _j : 'Choose how you\'d like to continue'),
825
+ // Main buttons + OR divider + email button
872
826
  React.createElement('div', {
873
827
  style: {
874
828
  display: 'flex',
875
829
  flexDirection: 'column',
876
830
  gap: '8px',
877
831
  },
878
- }, ...walletButtons)));
832
+ }, ...mainButtons, orDivider, emailButton)));
879
833
  };
880
834
  // Wrapper component with PhantomProvider
881
835
  const PhantomProviderWrapper = () => {
@@ -908,13 +862,6 @@ class PhantomWalletProvider {
908
862
  if (this.initPromise) {
909
863
  await this.initPromise;
910
864
  }
911
- // Lazy-mount path: if initializeAsync deferred the React mount (e.g.
912
- // first-time visitor on Android Chrome PWA), do it now. We're being
913
- // called from a user-gesture flow like login(), so any Android intent
914
- // dialog that surfaces will appear with the activity already focused.
915
- if (!this.containerElement) {
916
- this.initialize();
917
- }
918
865
  // Wait for SDK to be ready
919
866
  await new Promise((resolve) => {
920
867
  const check = () => {
@@ -1008,7 +955,7 @@ class PhantomWalletProvider {
1008
955
  this.pendingLogin.reject = reject;
1009
956
  });
1010
957
  }
1011
- return new Promise((resolve, reject) => {
958
+ const loginPromise = new Promise((resolve, reject) => {
1012
959
  this.pendingLogin = { resolve, reject };
1013
960
  this.loginInProgress = true;
1014
961
  // Always use our custom wallet modal
@@ -1022,55 +969,17 @@ class PhantomWalletProvider {
1022
969
  }
1023
970
  }, 180000);
1024
971
  });
972
+ return loginPromise.finally(() => {
973
+ this.loginOverrides = null;
974
+ });
1025
975
  }
1026
976
  async restoreSession() {
1027
- // Read from storage directly. Do NOT ensureReady() here — that would
1028
- // mount @phantom/react-sdk's <PhantomProvider> during init(), which
1029
- // synchronously constructs BrowserSDK (running wallet-standard discovery)
1030
- // and fires sdk.autoConnect() both probing the Android intent surface
1031
- // before the PWA activity has window focus on Solana Seeker. The
1032
- // resulting "access other apps and services" system dialog renders
1033
- // with grayed-out buttons.
1034
- //
1035
- // Wrap getSession() in try/catch: WebSessionManager.getSession() runs
1036
- // JSON.parse on the stored session *outside* its internal try/catch,
1037
- // so genuinely malformed JSON in localStorage would propagate through
1038
- // restoreSession() and break init() entirely. Treat any throw as
1039
- // "no session" and fall through to the cleanup path so corrupted
1040
- // storage is recoverable on next load.
1041
- let session;
1042
- try {
1043
- session = await WebSessionManager.getSession();
1044
- }
1045
- catch (_a) {
1046
- session = null;
1047
- }
1048
- if (!session) {
1049
- // Tidy up storage so we don't leave junk behind:
1050
- // (a) clearSession() removes any stale or unparseable session
1051
- // storage entry. WebSessionManager.getSession() can't reach
1052
- // its own clearSession() if JSON.parse threw. Idempotent —
1053
- // safe to call unconditionally here.
1054
- // (b) Drop the auth-method marker if it's stale.
1055
- // WebSessionManager.clearSession() only removes the session
1056
- // storage key, not the marker — so without this cleanup
1057
- // shouldMountEagerly() would keep eager-mounting on every
1058
- // future cold start.
1059
- try {
1060
- WebSessionManager.clearSession();
1061
- }
1062
- catch ( /* best-effort */_b) { /* best-effort */ }
1063
- try {
1064
- if (getPlatform().storage.getItem('tarobase_last_auth_method') === 'phantom') {
1065
- getPlatform().storage.removeItem('tarobase_last_auth_method');
1066
- }
1067
- }
1068
- catch (_c) {
1069
- // storage unavailable — best-effort cleanup
1070
- }
1071
- return null;
977
+ await this.ensureReady();
978
+ const session = await WebSessionManager.getSession();
979
+ if (session) {
980
+ return { provider: this, address: session.address };
1072
981
  }
1073
- return { provider: this, address: session.address };
982
+ return null;
1074
983
  }
1075
984
  async address() {
1076
985
  var _a, _b, _c, _d;
@@ -1527,4 +1436,4 @@ class PhantomWalletProvider {
1527
1436
  PhantomWalletProvider.instance = null;
1528
1437
 
1529
1438
  export { PhantomWalletProvider };
1530
- //# sourceMappingURL=phantom-wallet-provider-DSFGWSOJ.esm.js.map
1439
+ //# sourceMappingURL=phantom-wallet-provider-BN47klTp.esm.js.map