@rhinestone/deposit-modal 0.14.1 → 0.16.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.
Files changed (70) hide show
  1. package/README.md +26 -24
  2. package/bridge-transcript.json +14 -0
  3. package/dist/{DepositModalReown-GAD45GIC.cjs → DepositModalReown-IFN6YLZJ.cjs} +20 -22
  4. package/dist/{DepositModalReown-2EVV64OA.mjs → DepositModalReown-R7UROJPJ.mjs} +5 -7
  5. package/dist/WithdrawModal-SZEAI473.cjs +11 -0
  6. package/dist/WithdrawModal-XKSSHVEJ.mjs +11 -0
  7. package/dist/{caip-D8aRWdEY.d.cts → caip-BMi-9t09.d.cts} +27 -3
  8. package/dist/{caip-D8aRWdEY.d.ts → caip-BMi-9t09.d.ts} +27 -3
  9. package/dist/{chunk-A6JPBMYY.cjs → chunk-24N4KMJX.cjs} +234 -115
  10. package/dist/{chunk-LMG46EP2.mjs → chunk-3HCCR54R.mjs} +1 -1
  11. package/dist/{chunk-AQVJUXSG.cjs → chunk-5CM3ZQ5U.cjs} +1 -1
  12. package/dist/chunk-EA5CE2UZ.mjs +7599 -0
  13. package/dist/{chunk-VUATPOWJ.mjs → chunk-EAGMY3QE.mjs} +74 -17
  14. package/dist/{chunk-5Q5CSVKF.mjs → chunk-F6ROQ6RJ.mjs} +215 -517
  15. package/dist/{chunk-RN5VKWI6.mjs → chunk-FTWKAJGN.mjs} +1 -1
  16. package/dist/chunk-H4O22O7Y.cjs +7599 -0
  17. package/dist/{chunk-GZ4GQ5MC.mjs → chunk-HMB2XQGD.mjs} +172 -53
  18. package/dist/{chunk-DW2EQA2U.cjs → chunk-LVCD6RHF.cjs} +2 -2
  19. package/dist/{chunk-4KCSH4T3.cjs → chunk-OY5N3E6L.cjs} +86 -29
  20. package/dist/{chunk-NQMC5VKQ.cjs → chunk-V466XQSG.cjs} +551 -853
  21. package/dist/{constants-DBrWhJWE.d.cts → constants-BT4ctuHo.d.cts} +7 -6
  22. package/dist/{constants-DBrWhJWE.d.ts → constants-D21ZdNOP.d.ts} +7 -6
  23. package/dist/constants.cjs +3 -3
  24. package/dist/constants.d.cts +3 -3
  25. package/dist/constants.d.ts +3 -3
  26. package/dist/constants.mjs +2 -2
  27. package/dist/deposit.cjs +6 -8
  28. package/dist/deposit.d.cts +3 -3
  29. package/dist/deposit.d.ts +3 -3
  30. package/dist/deposit.mjs +5 -7
  31. package/dist/embed.cjs +130 -80
  32. package/dist/embed.d.cts +3 -9
  33. package/dist/embed.d.ts +3 -9
  34. package/dist/embed.mjs +112 -62
  35. package/dist/index.cjs +8 -11
  36. package/dist/index.d.cts +3 -5
  37. package/dist/index.d.ts +3 -5
  38. package/dist/index.mjs +10 -13
  39. package/dist/polymarket.cjs +6 -6
  40. package/dist/polymarket.mjs +2 -2
  41. package/dist/server.d.cts +2 -2
  42. package/dist/server.d.ts +2 -2
  43. package/dist/styles.css +147 -100
  44. package/dist/{types-DP_3KwlD.d.cts → types-B9SbZQIG.d.ts} +145 -108
  45. package/dist/{types-Bho4OA03.d.ts → types-SwGGf0eH.d.cts} +145 -108
  46. package/dist/withdraw.cjs +5 -6
  47. package/dist/withdraw.d.cts +33 -5
  48. package/dist/withdraw.d.ts +33 -5
  49. package/dist/withdraw.mjs +4 -5
  50. package/package.json +6 -37
  51. package/dist/ClaimModal-GDFENSLV.mjs +0 -13
  52. package/dist/ClaimModal-L3FUBI5U.cjs +0 -13
  53. package/dist/WithdrawModal-FAQH35NG.cjs +0 -12
  54. package/dist/WithdrawModal-IKUHF5CF.mjs +0 -12
  55. package/dist/chunk-4J5ADVIN.cjs +0 -1848
  56. package/dist/chunk-62UCV2LG.cjs +0 -81
  57. package/dist/chunk-7AZFT2MV.cjs +0 -163
  58. package/dist/chunk-HAQOFI3D.cjs +0 -3699
  59. package/dist/chunk-QACOOLOE.mjs +0 -1062
  60. package/dist/chunk-R5UQ3TN4.mjs +0 -81
  61. package/dist/chunk-UX35GYLM.mjs +0 -3699
  62. package/dist/chunk-VALXN5IO.mjs +0 -163
  63. package/dist/chunk-XCTRKCNM.mjs +0 -1848
  64. package/dist/chunk-YP7QVKQ6.cjs +0 -1062
  65. package/dist/claim.cjs +0 -11
  66. package/dist/claim.d.cts +0 -17
  67. package/dist/claim.d.ts +0 -17
  68. package/dist/claim.mjs +0 -11
  69. package/dist/modal-ui-state-OD1RmKkK.d.cts +0 -30
  70. package/dist/modal-ui-state-OD1RmKkK.d.ts +0 -30
@@ -5,7 +5,6 @@
5
5
 
6
6
 
7
7
 
8
- var _chunk4J5ADVINcjs = require('./chunk-4J5ADVIN.cjs');
9
8
 
10
9
 
11
10
 
@@ -41,16 +40,20 @@ var _chunk4J5ADVINcjs = require('./chunk-4J5ADVIN.cjs');
41
40
 
42
41
 
43
42
 
44
- var _chunkHAQOFI3Dcjs = require('./chunk-HAQOFI3D.cjs');
45
43
 
46
44
 
47
45
 
48
46
 
47
+ var _chunkH4O22O7Ycjs = require('./chunk-H4O22O7Y.cjs');
49
48
 
50
49
 
51
50
 
52
51
 
53
- var _chunk4KCSH4T3cjs = require('./chunk-4KCSH4T3.cjs');
52
+
53
+
54
+
55
+
56
+ var _chunkOY5N3E6Lcjs = require('./chunk-OY5N3E6L.cjs');
54
57
 
55
58
  // src/WithdrawModal.tsx
56
59
  var _react = require('react');
@@ -235,11 +238,11 @@ function WithdrawFormStep({
235
238
  const chainDropdownRef = _react.useRef.call(void 0, null);
236
239
  const tokenDropdownRef = _react.useRef.call(void 0, null);
237
240
  const publicClientChainId = _optionalChain([publicClient, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]);
238
- const onFrictionRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onFriction);
241
+ const onFrictionRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onFriction);
239
242
  useClickOutside(chainDropdownRef, () => setShowChainDropdown(false));
240
243
  useClickOutside(tokenDropdownRef, () => setShowTokenDropdown(false));
241
- const targetSymbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
242
- const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChain);
244
+ const targetSymbol = _chunkOY5N3E6Lcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
245
+ const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChain);
243
246
  const isBusy = submitting || isSubmitting;
244
247
  const seededRecipientRef = _react.useRef.call(void 0, _nullishCoalesce(defaultRecipient, () => ( "")));
245
248
  _react.useEffect.call(void 0, () => {
@@ -263,7 +266,7 @@ function WithdrawFormStep({
263
266
  return;
264
267
  }
265
268
  try {
266
- const bal = _chunkHAQOFI3Dcjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: accountAddress }) : await publicClient.readContract({
269
+ const bal = _chunkH4O22O7Ycjs.isNativeAsset.call(void 0, asset) ? await publicClient.getBalance({ address: accountAddress }) : await publicClient.readContract({
267
270
  address: asset.token,
268
271
  abi: _viem.erc20Abi,
269
272
  functionName: "balanceOf",
@@ -365,7 +368,7 @@ function WithdrawFormStep({
365
368
  await onSubmit(recipient, amount);
366
369
  } catch (err) {
367
370
  const raw = err instanceof Error ? err.message : "Withdrawal failed";
368
- setError(_chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw));
371
+ setError(_chunkH4O22O7Ycjs.formatUserError.call(void 0, raw));
369
372
  } finally {
370
373
  setIsSubmitting(false);
371
374
  }
@@ -382,16 +385,16 @@ function WithdrawFormStep({
382
385
  if (isBalanceLoading) {
383
386
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
384
387
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-withdraw-loading", children: [
385
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Spinner, { className: "rs-spinner--lg" }),
388
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.Spinner, { className: "rs-spinner--lg" }),
386
389
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-title", children: "Loading on-chain balance" }),
387
390
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-withdraw-loading-subtitle", children: "Please wait before withdrawing." })
388
391
  ] }),
389
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
392
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.PoweredBy, {})
390
393
  ] });
391
394
  }
392
395
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
393
396
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body", children: [
394
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
397
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.BodyHeader, { icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.CircleArrowOutUpLeftIcon, {}), title: "Withdraw" }),
395
398
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-section", children: [
396
399
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
397
400
  "label",
@@ -451,7 +454,7 @@ function WithdrawFormStep({
451
454
  ) })
452
455
  ] }),
453
456
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-amount-info", children: [
454
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${_chunkHAQOFI3Dcjs.currencyFormatter.format(amountUsd)}` : "$0.00" }),
457
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-withdraw-usd", children: amountUsd !== null ? `~${_chunkH4O22O7Ycjs.currencyFormatter.format(amountUsd)}` : "$0.00" }),
455
458
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-withdraw-balance", children: [
456
459
  "Balance: ",
457
460
  formattedBalance,
@@ -482,9 +485,9 @@ function WithdrawFormStep({
482
485
  children: [
483
486
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
484
487
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
485
- _chunkHAQOFI3Dcjs.CdnIcon,
488
+ _chunkH4O22O7Ycjs.CdnIcon,
486
489
  {
487
- src: _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChain),
490
+ src: _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChain),
488
491
  alt: targetChainName,
489
492
  className: "rs-withdraw-dropdown-icon"
490
493
  }
@@ -492,7 +495,7 @@ function WithdrawFormStep({
492
495
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName })
493
496
  ] }),
494
497
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
495
- _chunkHAQOFI3Dcjs.ChevronDownIcon,
498
+ _chunkH4O22O7Ycjs.ChevronDownIcon,
496
499
  {
497
500
  className: "rs-withdraw-dropdown-arrow",
498
501
  style: {
@@ -514,9 +517,9 @@ function WithdrawFormStep({
514
517
  },
515
518
  children: [
516
519
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
517
- _chunkHAQOFI3Dcjs.CdnIcon,
520
+ _chunkH4O22O7Ycjs.CdnIcon,
518
521
  {
519
- src: _chunk4KCSH4T3cjs.getChainIcon.call(void 0, chain.id),
522
+ src: _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, chain.id),
520
523
  alt: chain.name,
521
524
  className: "rs-withdraw-dropdown-icon"
522
525
  }
@@ -551,7 +554,7 @@ function WithdrawFormStep({
551
554
  children: [
552
555
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-withdraw-dropdown-value", children: [
553
556
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
554
- _chunkHAQOFI3Dcjs.TokenIcon,
557
+ _chunkH4O22O7Ycjs.TokenIcon,
555
558
  {
556
559
  symbol: targetSymbol,
557
560
  className: "rs-withdraw-dropdown-icon"
@@ -560,7 +563,7 @@ function WithdrawFormStep({
560
563
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetSymbol })
561
564
  ] }),
562
565
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
563
- _chunkHAQOFI3Dcjs.ChevronDownIcon,
566
+ _chunkH4O22O7Ycjs.ChevronDownIcon,
564
567
  {
565
568
  className: "rs-withdraw-dropdown-arrow",
566
569
  style: {
@@ -582,7 +585,7 @@ function WithdrawFormStep({
582
585
  },
583
586
  children: [
584
587
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
585
- _chunkHAQOFI3Dcjs.TokenIcon,
588
+ _chunkH4O22O7Ycjs.TokenIcon,
586
589
  {
587
590
  symbol: option.symbol,
588
591
  className: "rs-withdraw-dropdown-icon"
@@ -598,10 +601,10 @@ function WithdrawFormStep({
598
601
  )
599
602
  ] })
600
603
  ] }),
601
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
602
- !error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: registrationError }),
604
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.Callout, { variant: "error", children: error }),
605
+ !error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.Callout, { variant: "error", children: registrationError }),
603
606
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
604
- _chunkHAQOFI3Dcjs.Button,
607
+ _chunkH4O22O7Ycjs.Button,
605
608
  {
606
609
  onClick: handleWithdraw,
607
610
  fullWidth: true,
@@ -616,7 +619,7 @@ function WithdrawFormStep({
616
619
  }
617
620
  )
618
621
  ] }),
619
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
622
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.PoweredBy, {})
620
623
  ] });
621
624
  }
622
625
  WithdrawFormStep.displayName = "WithdrawFormStep";
@@ -639,27 +642,34 @@ function WithdrawReviewStep({
639
642
  registrationPending = false,
640
643
  registrationError = null,
641
644
  service,
645
+ onSubmittingChange,
642
646
  onConfirm,
643
647
  onError
644
648
  }) {
645
649
  const [isSubmitting, setIsSubmitting] = _react.useState.call(void 0, false);
646
650
  const [error, setError] = _react.useState.call(void 0, null);
647
- const sourceChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, sourceChain);
648
- const sourceChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, sourceChain);
649
- const targetSymbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, targetToken, targetChain);
650
- const targetChainName = _chunk4KCSH4T3cjs.getChainName.call(void 0, targetChain);
651
- const targetChainIcon = _chunk4KCSH4T3cjs.getChainIcon.call(void 0, targetChain);
651
+ const onSubmittingChangeRef = _react.useRef.call(void 0, onSubmittingChange);
652
+ onSubmittingChangeRef.current = onSubmittingChange;
653
+ _react.useEffect.call(void 0, () => {
654
+ _optionalChain([onSubmittingChangeRef, 'access', _15 => _15.current, 'optionalCall', _16 => _16(isSubmitting)]);
655
+ return () => _optionalChain([onSubmittingChangeRef, 'access', _17 => _17.current, 'optionalCall', _18 => _18(false)]);
656
+ }, [isSubmitting]);
657
+ const sourceChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, sourceChain);
658
+ const sourceChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, sourceChain);
659
+ const targetSymbol = _chunkOY5N3E6Lcjs.getTokenSymbol.call(void 0, targetToken, targetChain);
660
+ const targetChainName = _chunkOY5N3E6Lcjs.getChainName.call(void 0, targetChain);
661
+ const targetChainIcon = _chunkOY5N3E6Lcjs.getChainIcon.call(void 0, targetChain);
652
662
  const amountNumber = Number(amount);
653
- const formattedSendAmount = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
654
- const prices = _chunk4J5ADVINcjs.useTokenPrices.call(void 0, service, [
663
+ const formattedSendAmount = _nullishCoalesce(_chunkH4O22O7Ycjs.formatTokenAmount.call(void 0, amountNumber, sourceSymbol), () => ( amount));
664
+ const prices = _chunkH4O22O7Ycjs.useTokenPrices.call(void 0, service, [
655
665
  { chainId: sourceChain, address: sourceToken, symbol: sourceSymbol },
656
666
  { chainId: targetChain, address: targetToken, symbol: targetSymbol }
657
667
  ]);
658
- const receiveDisplay = _nullishCoalesce(_chunkHAQOFI3Dcjs.formatReceiveEstimate.call(void 0, {
668
+ const receiveDisplay = _nullishCoalesce(_chunkH4O22O7Ycjs.formatReceiveEstimate.call(void 0, {
659
669
  sourceAmount: Number.isFinite(amountNumber) ? amountNumber : void 0,
660
670
  sourceSymbol,
661
671
  targetSymbol,
662
- sourceTrusted: _chunkHAQOFI3Dcjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
672
+ sourceTrusted: _chunkH4O22O7Ycjs.isRecognizedToken.call(void 0, sourceToken, sourceChain),
663
673
  prices
664
674
  }), () => ( // No price for the target token — an honest dash beats a wrong number.
665
675
  "\u2014"));
@@ -671,11 +681,11 @@ function WithdrawReviewStep({
671
681
  await onConfirm();
672
682
  } catch (err) {
673
683
  const raw = err instanceof Error ? err.message : "Withdraw failed";
674
- const uncertain = _chunk4J5ADVINcjs.isSubmissionUncertain.call(void 0, err);
675
- const message = uncertain ? "Withdrawal status is uncertain. Check your activity before trying again." : _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw);
684
+ const uncertain = _chunkH4O22O7Ycjs.isSubmissionUncertain.call(void 0, err);
685
+ const message = uncertain ? "Withdrawal status is uncertain. Check your activity before trying again." : _chunkH4O22O7Ycjs.formatUserError.call(void 0, raw);
676
686
  if (uncertain) setSubmissionUncertain(true);
677
687
  setError(message);
678
- _optionalChain([onError, 'optionalCall', _15 => _15(message, "WITHDRAW_REVIEW_ERROR", raw)]);
688
+ _optionalChain([onError, 'optionalCall', _19 => _19(message, "WITHDRAW_REVIEW_ERROR", raw)]);
679
689
  } finally {
680
690
  setIsSubmitting(false);
681
691
  }
@@ -684,9 +694,9 @@ function WithdrawReviewStep({
684
694
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen", children: [
685
695
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-screen-body rs-screen-body--gap-32", children: [
686
696
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
687
- _chunkHAQOFI3Dcjs.BodyHeader,
697
+ _chunkH4O22O7Ycjs.BodyHeader,
688
698
  {
689
- icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CircleArrowOutUpLeftIcon, {}),
699
+ icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.CircleArrowOutUpLeftIcon, {}),
690
700
  title: "Review withdrawal"
691
701
  }
692
702
  ),
@@ -699,14 +709,14 @@ function WithdrawReviewStep({
699
709
  " ",
700
710
  sourceSymbol
701
711
  ] }),
702
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: sourceSymbol }) })
712
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.TokenIcon, { symbol: sourceSymbol }) })
703
713
  ] })
704
714
  ] }),
705
715
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
706
716
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Source chain" }),
707
717
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
708
718
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: sourceChainName }),
709
- sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: sourceChainIcon }) })
719
+ sourceChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.CdnIcon, { src: sourceChainIcon }) })
710
720
  ] })
711
721
  ] }),
712
722
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -717,14 +727,14 @@ function WithdrawReviewStep({
717
727
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Receive" }),
718
728
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
719
729
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: receiveDisplay }),
720
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.TokenIcon, { symbol: targetSymbol }) })
730
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.TokenIcon, { symbol: targetSymbol }) })
721
731
  ] })
722
732
  ] }),
723
733
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
724
734
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: "Destination chain" }),
725
735
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "rs-review-detail-value", children: [
726
736
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { children: targetChainName }),
727
- targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CdnIcon, { src: targetChainIcon }) })
737
+ targetChainIcon && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-icon", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.CdnIcon, { src: targetChainIcon }) })
728
738
  ] })
729
739
  ] }),
730
740
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-review-detail-row", children: [
@@ -732,10 +742,10 @@ function WithdrawReviewStep({
732
742
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "rs-review-detail-value", children: estimatedTime })
733
743
  ] })
734
744
  ] }),
735
- error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: error }),
736
- !error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.Callout, { variant: "error", children: registrationError }),
745
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.Callout, { variant: "error", children: error }),
746
+ !error && registrationError && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.Callout, { variant: "error", children: registrationError }),
737
747
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
738
- _chunkHAQOFI3Dcjs.Button,
748
+ _chunkH4O22O7Ycjs.Button,
739
749
  {
740
750
  onClick: handleConfirm,
741
751
  loading: isSubmitting,
@@ -746,7 +756,7 @@ function WithdrawReviewStep({
746
756
  }
747
757
  )
748
758
  ] }),
749
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.PoweredBy, {})
759
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.PoweredBy, {})
750
760
  ] });
751
761
  }
752
762
  WithdrawReviewStep.displayName = "WithdrawReviewStep";
@@ -762,7 +772,7 @@ WithdrawReviewStep.displayName = "WithdrawReviewStep";
762
772
 
763
773
 
764
774
  function withdrawFailureReasonForError(error) {
765
- if (_chunk4J5ADVINcjs.isSubmissionUncertain.call(void 0, error)) return "submission_uncertain";
775
+ if (_chunkH4O22O7Ycjs.isSubmissionUncertain.call(void 0, error)) return "submission_uncertain";
766
776
  const message = (error instanceof Error ? error.message : String(_nullishCoalesce(error, () => ( "")))).toLowerCase();
767
777
  if (message.includes("changed before submission")) {
768
778
  return "registration_target_changed";
@@ -798,6 +808,23 @@ function createWithdrawAnalyticsController(emit) {
798
808
  opened = true;
799
809
  emit({ type: "withdraw_modal_open" });
800
810
  },
811
+ // Never deduplicated: the visit id and the per-visit dedupe belong to the
812
+ // history adapter, which knows what a visit is.
813
+ historyOpened(detail) {
814
+ send({ type: "withdraw_modal_history_open", ...detail });
815
+ },
816
+ historyRowViewed(detail) {
817
+ send({ type: "withdraw_modal_history_row_view", ...detail });
818
+ },
819
+ historyLoadMore(detail) {
820
+ send({ type: "withdraw_modal_history_load_more", ...detail });
821
+ },
822
+ historyFallbackOpened(detail) {
823
+ send({ type: "withdraw_modal_history_fallback_open", ...detail });
824
+ },
825
+ historyRecoveryStarted(detail) {
826
+ send({ type: "withdraw_modal_history_recovery_start", ...detail });
827
+ },
801
828
  openStep(nextStep) {
802
829
  controller.openSession();
803
830
  if (step === nextStep) return;
@@ -904,7 +931,7 @@ function WithdrawAnalyticsControllerProvider({
904
931
  children,
905
932
  controllerRef
906
933
  }) {
907
- const emit = _chunkHAQOFI3Dcjs.useWithdrawAnalyticsEmitter.call(void 0, );
934
+ const emit = _chunkH4O22O7Ycjs.useWithdrawAnalyticsEmitter.call(void 0, );
908
935
  const controller = _react.useMemo.call(void 0,
909
936
  () => createWithdrawAnalyticsController(emit),
910
937
  [emit]
@@ -923,7 +950,7 @@ var REGISTRATION_DEBOUNCE_MS = 600;
923
950
  var WITHDRAW_INDEXING_DELAY_MS = 2e3;
924
951
  function targetsEqual(a, b) {
925
952
  if (!a) return false;
926
- return a.chain === b.chain && a.token.toLowerCase() === b.token.toLowerCase() && (_nullishCoalesce(_optionalChain([a, 'access', _16 => _16.recipient, 'optionalAccess', _17 => _17.toLowerCase, 'call', _18 => _18()]), () => ( ""))) === (_nullishCoalesce(_optionalChain([b, 'access', _19 => _19.recipient, 'optionalAccess', _20 => _20.toLowerCase, 'call', _21 => _21()]), () => ( "")));
953
+ return a.chain === b.chain && a.token.toLowerCase() === b.token.toLowerCase() && (_nullishCoalesce(_optionalChain([a, 'access', _20 => _20.recipient, 'optionalAccess', _21 => _21.toLowerCase, 'call', _22 => _22()]), () => ( ""))) === (_nullishCoalesce(_optionalChain([b, 'access', _23 => _23.recipient, 'optionalAccess', _24 => _24.toLowerCase, 'call', _25 => _25()]), () => ( "")));
927
954
  }
928
955
  function WithdrawFlow({
929
956
  accountAddress,
@@ -938,15 +965,17 @@ function WithdrawFlow({
938
965
  onSendTransaction,
939
966
  onStepChange,
940
967
  onClose,
968
+ onDestinationChange,
969
+ onSubmittingChange,
941
970
  onLifecycle,
942
971
  onError,
943
972
  debug
944
973
  }) {
945
- const rpcUrls = _chunkHAQOFI3Dcjs.useRpcUrls.call(void 0, );
946
- const onStepChangeRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onStepChange);
974
+ const rpcUrls = _chunkH4O22O7Ycjs.useRpcUrls.call(void 0, );
975
+ const onStepChangeRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onStepChange);
947
976
  const analytics = useWithdrawAnalyticsController();
948
- const onLifecycleRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onLifecycle);
949
- const onErrorRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onError);
977
+ const onLifecycleRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onLifecycle);
978
+ const onErrorRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onError);
950
979
  const isFlowActiveRef = _react.useRef.call(void 0, true);
951
980
  const submitGenerationRef = _react.useRef.call(void 0, 0);
952
981
  const lastSubmitFailureRef = _react.useRef.call(void 0,
@@ -960,13 +989,13 @@ function WithdrawFlow({
960
989
  }, []);
961
990
  const logFlow = _react.useCallback.call(void 0,
962
991
  (message, data) => {
963
- _chunkHAQOFI3Dcjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
992
+ _chunkH4O22O7Ycjs.debugLog.call(void 0, debug, "withdraw-flow", message, data);
964
993
  },
965
994
  [debug]
966
995
  );
967
996
  const logFlowError = _react.useCallback.call(void 0,
968
997
  (message, error, data) => {
969
- _chunkHAQOFI3Dcjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
998
+ _chunkH4O22O7Ycjs.debugError.call(void 0, debug, "withdraw-flow", message, error, data);
970
999
  },
971
1000
  [debug]
972
1001
  );
@@ -988,11 +1017,26 @@ function WithdrawFlow({
988
1017
  const registration = useWithdrawStore((s) => s.registration);
989
1018
  const flowStep = useWithdrawStore((s) => s.step);
990
1019
  const reviewedRecipient = useWithdrawStore((s) => s.recipient);
991
- const publicClient = _chunkHAQOFI3Dcjs.useReadClient.call(void 0, sourceChain, rpcUrls);
1020
+ const publicClient = _chunkH4O22O7Ycjs.useReadClient.call(void 0, sourceChain, rpcUrls);
992
1021
  const recipientForRegistration = _react.useMemo.call(void 0, () => {
993
1022
  if (!recipientInput) return void 0;
994
1023
  return ADDR_REGEX.test(recipientInput) ? recipientInput : void 0;
995
1024
  }, [recipientInput]);
1025
+ const onDestinationChangeRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onDestinationChange);
1026
+ const reportedDestinationRef = _react.useRef.call(void 0, void 0);
1027
+ _react.useEffect.call(void 0, () => {
1028
+ if (reportedDestinationRef.current === recipientForRegistration) return;
1029
+ const report = () => {
1030
+ reportedDestinationRef.current = recipientForRegistration;
1031
+ _optionalChain([onDestinationChangeRef, 'access', _26 => _26.current, 'optionalCall', _27 => _27(recipientForRegistration)]);
1032
+ };
1033
+ if (!reportedDestinationRef.current) {
1034
+ report();
1035
+ return;
1036
+ }
1037
+ const timeout = setTimeout(report, REGISTRATION_DEBOUNCE_MS);
1038
+ return () => clearTimeout(timeout);
1039
+ }, [recipientForRegistration, onDestinationChangeRef]);
996
1040
  _react.useEffect.call(void 0, () => {
997
1041
  if (!recipientForRegistration) return;
998
1042
  const desiredTarget = {
@@ -1014,7 +1058,7 @@ function WithdrawFlow({
1014
1058
  targetToken,
1015
1059
  recipient: recipientForRegistration
1016
1060
  });
1017
- const salt = _chunk4J5ADVINcjs.deriveAccountSalt.call(void 0, {
1061
+ const salt = _chunkH4O22O7Ycjs.deriveAccountSalt.call(void 0, {
1018
1062
  recipient: recipientForRegistration,
1019
1063
  targetChain,
1020
1064
  targetToken
@@ -1022,7 +1066,7 @@ function WithdrawFlow({
1022
1066
  const { evmDepositAddress } = await service.registerManagedAccount({
1023
1067
  salt,
1024
1068
  target: {
1025
- chain: _chunk4KCSH4T3cjs.targetChainToCaip2.call(void 0, targetChain),
1069
+ chain: _chunkOY5N3E6Lcjs.targetChainToCaip2.call(void 0, targetChain),
1026
1070
  token: targetToken,
1027
1071
  recipient: recipientForRegistration
1028
1072
  }
@@ -1036,7 +1080,7 @@ function WithdrawFlow({
1036
1080
  smartAccount: evmDepositAddress,
1037
1081
  registeredTarget: desiredTarget
1038
1082
  });
1039
- _optionalChain([onLifecycleRef, 'access', _22 => _22.current, 'optionalCall', _23 => _23({
1083
+ _optionalChain([onLifecycleRef, 'access', _28 => _28.current, 'optionalCall', _29 => _29({
1040
1084
  type: "connected",
1041
1085
  address: accountAddress,
1042
1086
  smartAccount: evmDepositAddress
@@ -1044,7 +1088,7 @@ function WithdrawFlow({
1044
1088
  } catch (err) {
1045
1089
  if (cancelled) return;
1046
1090
  const raw = err instanceof Error ? err.message : "Registration failed";
1047
- const message = _chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw);
1091
+ const message = _chunkH4O22O7Ycjs.formatUserError.call(void 0, raw);
1048
1092
  logFlowError("auto-register:failed", err, {
1049
1093
  accountAddress,
1050
1094
  targetChain,
@@ -1054,7 +1098,7 @@ function WithdrawFlow({
1054
1098
  type: "registration/failed",
1055
1099
  error: message
1056
1100
  });
1057
- _optionalChain([onErrorRef, 'access', _24 => _24.current, 'optionalCall', _25 => _25({ message, code: "WITHDRAW_REGISTER_FAILED" })]);
1101
+ _optionalChain([onErrorRef, 'access', _30 => _30.current, 'optionalCall', _31 => _31({ message, code: "WITHDRAW_REGISTER_FAILED" })]);
1058
1102
  }
1059
1103
  }, REGISTRATION_DEBOUNCE_MS);
1060
1104
  return () => {
@@ -1075,10 +1119,10 @@ function WithdrawFlow({
1075
1119
  onErrorRef
1076
1120
  ]);
1077
1121
  const asset = _react.useMemo.call(void 0, () => {
1078
- const symbol = _chunk4KCSH4T3cjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
1079
- const decimals = _chunk4KCSH4T3cjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
1122
+ const symbol = _chunkOY5N3E6Lcjs.getTokenSymbol.call(void 0, sourceToken, sourceChain);
1123
+ const decimals = _chunkOY5N3E6Lcjs.getTokenDecimalsByAddress.call(void 0, sourceToken, sourceChain);
1080
1124
  return {
1081
- id: _chunkHAQOFI3Dcjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1125
+ id: _chunkH4O22O7Ycjs.getAssetId.call(void 0, { chainId: sourceChain, token: sourceToken }),
1082
1126
  chainId: sourceChain,
1083
1127
  token: sourceToken,
1084
1128
  symbol,
@@ -1086,7 +1130,7 @@ function WithdrawFlow({
1086
1130
  decimals
1087
1131
  };
1088
1132
  }, [sourceChain, sourceToken]);
1089
- const isSourceNative = sourceToken.toLowerCase() === _chunk4KCSH4T3cjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
1133
+ const isSourceNative = sourceToken.toLowerCase() === _chunkOY5N3E6Lcjs.NATIVE_TOKEN_ADDRESS.toLowerCase();
1090
1134
  const isSameRoute = targetChain === sourceChain && targetToken.toLowerCase() === sourceToken.toLowerCase();
1091
1135
  const reviewedTarget = reviewedRecipient ? {
1092
1136
  chain: targetChain,
@@ -1105,7 +1149,7 @@ function WithdrawFlow({
1105
1149
  storeApi.dispatch({ type: "review/back" });
1106
1150
  }, [analytics, storeApi]);
1107
1151
  _react.useEffect.call(void 0, () => {
1108
- _optionalChain([onStepChangeRef, 'access', _26 => _26.current, 'optionalCall', _27 => _27(
1152
+ _optionalChain([onStepChangeRef, 'access', _32 => _32.current, 'optionalCall', _33 => _33(
1109
1153
  flowStep === "review" ? reviewBackHandler : void 0,
1110
1154
  flowStep
1111
1155
  )]);
@@ -1147,7 +1191,7 @@ function WithdrawFlow({
1147
1191
  analytics.friction("processor_status_poll_failed", "processing");
1148
1192
  }
1149
1193
  logFlowError("flow:error", _nullishCoalesce(cause, () => ( message)), { code });
1150
- _optionalChain([onErrorRef, 'access', _28 => _28.current, 'optionalCall', _29 => _29({ message, code, cause })]);
1194
+ _optionalChain([onErrorRef, 'access', _34 => _34.current, 'optionalCall', _35 => _35({ message, code, cause })]);
1151
1195
  },
1152
1196
  [analytics, logFlowError, onErrorRef]
1153
1197
  );
@@ -1229,7 +1273,7 @@ function WithdrawFlow({
1229
1273
  if (!getMatchingRegistration()) {
1230
1274
  throw new Error("Withdrawal target changed before submission");
1231
1275
  }
1232
- if (!_optionalChain([result, 'optionalAccess', _30 => _30.txHash])) {
1276
+ if (!_optionalChain([result, 'optionalAccess', _36 => _36.txHash])) {
1233
1277
  throw new Error("onSendTransaction did not return a txHash");
1234
1278
  }
1235
1279
  analytics.handoff(
@@ -1248,7 +1292,7 @@ function WithdrawFlow({
1248
1292
  sourceChain,
1249
1293
  sourceToken
1250
1294
  });
1251
- _optionalChain([onLifecycleRef, 'access', _31 => _31.current, 'optionalCall', _32 => _32({
1295
+ _optionalChain([onLifecycleRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
1252
1296
  type: "submitted",
1253
1297
  txHash: result.txHash,
1254
1298
  sourceChain,
@@ -1276,7 +1320,7 @@ function WithdrawFlow({
1276
1320
  targetChain,
1277
1321
  targetToken
1278
1322
  });
1279
- handleError(_chunkHAQOFI3Dcjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1323
+ handleError(_chunkH4O22O7Ycjs.formatUserError.call(void 0, raw), "WITHDRAW_FLOW_ERROR");
1280
1324
  throw err;
1281
1325
  }
1282
1326
  },
@@ -1302,7 +1346,7 @@ function WithdrawFlow({
1302
1346
  analytics.openStep("processing");
1303
1347
  analytics.outcome("completed");
1304
1348
  logFlow("withdraw:complete", { txHash, destinationTxHash, ...context });
1305
- _optionalChain([onLifecycleRef, 'access', _33 => _33.current, 'optionalCall', _34 => _34({
1349
+ _optionalChain([onLifecycleRef, 'access', _39 => _39.current, 'optionalCall', _40 => _40({
1306
1350
  type: "complete",
1307
1351
  txHash,
1308
1352
  destinationTxHash,
@@ -1326,7 +1370,7 @@ function WithdrawFlow({
1326
1370
  analytics.outcome("failed");
1327
1371
  analytics.failure("processor_failed", false, "processing");
1328
1372
  logFlowError("withdraw:failed", error, { txHash });
1329
- _optionalChain([onLifecycleRef, 'access', _35 => _35.current, 'optionalCall', _36 => _36({
1373
+ _optionalChain([onLifecycleRef, 'access', _41 => _41.current, 'optionalCall', _42 => _42({
1330
1374
  type: "failed",
1331
1375
  txHash,
1332
1376
  error
@@ -1335,8 +1379,8 @@ function WithdrawFlow({
1335
1379
  },
1336
1380
  [analytics, logFlowError, onLifecycleRef, storeApi]
1337
1381
  );
1338
- const targetChainOptions = _chunkHAQOFI3Dcjs.useDestinationChains.call(void 0, );
1339
- const targetTokensFor = _chunkHAQOFI3Dcjs.useTargetTokens.call(void 0, );
1382
+ const targetChainOptions = _chunkH4O22O7Ycjs.useDestinationChains.call(void 0, );
1383
+ const targetTokensFor = _chunkH4O22O7Ycjs.useTargetTokens.call(void 0, );
1340
1384
  const targetTokenOptions = _react.useMemo.call(void 0,
1341
1385
  () => targetTokensFor(targetChain),
1342
1386
  [targetChain, targetTokensFor]
@@ -1409,12 +1453,13 @@ function WithdrawFlow({
1409
1453
  service,
1410
1454
  registrationPending: registration.kind === "pending" || registration.kind === "stale" || !isReviewedTargetReady,
1411
1455
  registrationError: registration.kind === "failed" ? registration.error : null,
1456
+ onSubmittingChange,
1412
1457
  onConfirm: handleReviewConfirm,
1413
1458
  onError: handleError
1414
1459
  }
1415
1460
  ),
1416
1461
  stepView === "processing" && registration.kind !== "idle" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1417
- _chunk4J5ADVINcjs.ProcessingStep,
1462
+ _chunkH4O22O7Ycjs.ProcessingStep,
1418
1463
  {
1419
1464
  smartAccount: _nullishCoalesce(storeApi.getState().processingSmartAccount, () => ( (registration.kind === "ready" || registration.kind === "stale" ? registration.smartAccount : "0x0"))),
1420
1465
  txHash: _nullishCoalesce(storeApi.getState().txHash, () => ( "0x0")),
@@ -1484,7 +1529,7 @@ function buildWithdrawAnalyticsSessionProperties({
1484
1529
  recipient: recipient !== void 0,
1485
1530
  amount: defaultAmount !== void 0
1486
1531
  },
1487
- ..._chunk4J5ADVINcjs.analyticsTargetProperties.call(void 0, {
1532
+ ..._chunkH4O22O7Ycjs.analyticsTargetProperties.call(void 0, {
1488
1533
  targetChain: seedTargetChain,
1489
1534
  targetToken: seedTargetToken
1490
1535
  })
@@ -1515,6 +1560,7 @@ function WithdrawModal({
1515
1560
  onError,
1516
1561
  enableAnalyticsIngest,
1517
1562
  analyticsIngestUrl,
1563
+ signRecovery,
1518
1564
  debug,
1519
1565
  // Every prop 0.9.0 removed lands here, since none of them is named above.
1520
1566
  // `uiConfig` is destructured, so its removed nested key isn't scanned — that
@@ -1524,35 +1570,61 @@ function WithdrawModal({
1524
1570
  onUiState,
1525
1571
  ...removedProps
1526
1572
  }) {
1527
- _chunk4J5ADVINcjs.warnRemovedProps.call(void 0, "WithdrawModal", removedProps);
1528
- _chunkHAQOFI3Dcjs.checkBackendUrl.call(void 0, "WithdrawModal", backendUrl);
1573
+ _chunkH4O22O7Ycjs.warnRemovedProps.call(void 0, "WithdrawModal", removedProps);
1574
+ _chunkH4O22O7Ycjs.checkBackendUrl.call(void 0, "WithdrawModal", backendUrl);
1529
1575
  const modalRef = _react.useRef.call(void 0, null);
1530
- const onReadyRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onReady);
1576
+ const onReadyRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onReady);
1531
1577
  const analyticsControllerRef = _react.useRef.call(void 0,
1532
1578
  null
1533
1579
  );
1580
+ const analyticsSessionIdRef = _react.useRef.call(void 0, null);
1534
1581
  const previousOpenRef = _react.useRef.call(void 0, isOpen);
1535
1582
  const [backHandler, setBackHandler] = _react.useState.call(void 0,
1536
1583
  void 0
1537
1584
  );
1538
1585
  const [screen, setScreen] = _react.useState.call(void 0, "form");
1539
- const onUiStateRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onUiState);
1540
- const targetChain = _chunk4KCSH4T3cjs.getChainId.call(void 0, _nullishCoalesce(targetChainProp, () => ( sourceChainProp)));
1541
- const sourceChain = _chunk4KCSH4T3cjs.getChainId.call(void 0, sourceChainProp);
1542
- const rpcUrls = _chunkHAQOFI3Dcjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
1586
+ const [submitting, setSubmitting] = _react.useState.call(void 0, false);
1587
+ const [historyRecipient, setHistoryRecipient] = _react.useState.call(void 0,
1588
+ recipient
1589
+ );
1590
+ const onUiStateRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onUiState);
1591
+ const targetChain = _chunkOY5N3E6Lcjs.getChainId.call(void 0, _nullishCoalesce(targetChainProp, () => ( sourceChainProp)));
1592
+ const sourceChain = _chunkOY5N3E6Lcjs.getChainId.call(void 0, sourceChainProp);
1593
+ const rpcUrls = _chunkH4O22O7Ycjs.useStableRpcUrls.call(void 0, rpcUrlsProp);
1543
1594
  const service = _react.useMemo.call(void 0,
1544
- () => _chunkHAQOFI3Dcjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1595
+ () => _chunkH4O22O7Ycjs.createDepositService.call(void 0, backendUrl, { debug, debugScope: "service:withdraw" }),
1545
1596
  [backendUrl, debug]
1546
1597
  );
1598
+ const historyAnalytics = _react.useMemo.call(void 0,
1599
+ () => _chunkH4O22O7Ycjs.createHistoryAnalytics.call(void 0, {
1600
+ modal: "withdraw",
1601
+ controllerRef: analyticsControllerRef,
1602
+ sessionIdRef: analyticsSessionIdRef
1603
+ }),
1604
+ []
1605
+ );
1606
+ const history = _chunkH4O22O7Ycjs.useHistoryPanel.call(void 0, {
1607
+ isOpen,
1608
+ recipient: historyRecipient,
1609
+ service,
1610
+ canRecover: Boolean(signRecovery),
1611
+ analytics: historyAnalytics
1612
+ });
1613
+ const { markStale: markHistoryStale, recoverySubmitting } = history;
1614
+ const historyButtonVisible = _chunkH4O22O7Ycjs.isHistoryEntryVisible.call(void 0, {
1615
+ screen,
1616
+ submitting,
1617
+ settled: false
1618
+ });
1547
1619
  const store = _react.useMemo.call(void 0, () => createWithdrawStore(), []);
1548
- const onErrorRef = _chunkHAQOFI3Dcjs.useLatestRef.call(void 0, onError);
1620
+ const onErrorRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onError);
1549
1621
  _react.useEffect.call(void 0, () => {
1550
1622
  if (isOpen && typeof onSendTransaction !== "function") {
1551
- _optionalChain([onErrorRef, 'access', _37 => _37.current, 'optionalCall', _38 => _38({
1623
+ _optionalChain([onErrorRef, 'access', _43 => _43.current, 'optionalCall', _44 => _44({
1552
1624
  message: "WithdrawModal requires an `onSendTransaction` function.",
1553
1625
  code: "WITHDRAW_MISSING_SEND_TRANSACTION"
1554
1626
  })]);
1555
- _optionalChain([analyticsControllerRef, 'access', _39 => _39.current, 'optionalAccess', _40 => _40.failure, 'call', _41 => _41(
1627
+ _optionalChain([analyticsControllerRef, 'access', _45 => _45.current, 'optionalAccess', _46 => _46.failure, 'call', _47 => _47(
1556
1628
  "submission_handler_missing",
1557
1629
  false,
1558
1630
  "form"
@@ -1561,12 +1633,13 @@ function WithdrawModal({
1561
1633
  }, [isOpen, onSendTransaction, onErrorRef]);
1562
1634
  const closeWithSource = _react.useCallback.call(void 0,
1563
1635
  (source) => {
1636
+ if (submitting || recoverySubmitting) return;
1564
1637
  const analytics = analyticsControllerRef.current;
1565
- _optionalChain([analytics, 'optionalAccess', _42 => _42.abandon, 'call', _43 => _43("modal_close")]);
1566
- _optionalChain([analytics, 'optionalAccess', _44 => _44.close, 'call', _45 => _45(source)]);
1638
+ _optionalChain([analytics, 'optionalAccess', _48 => _48.abandon, 'call', _49 => _49("modal_close")]);
1639
+ _optionalChain([analytics, 'optionalAccess', _50 => _50.close, 'call', _51 => _51(source)]);
1567
1640
  onClose();
1568
1641
  },
1569
- [onClose]
1642
+ [onClose, submitting, recoverySubmitting]
1570
1643
  );
1571
1644
  const handleModalDismiss = _react.useCallback.call(void 0,
1572
1645
  (reason) => {
@@ -1579,36 +1652,49 @@ function WithdrawModal({
1579
1652
  _react.useEffect.call(void 0, () => {
1580
1653
  if (previousOpenRef.current && !isOpen) {
1581
1654
  const analytics = analyticsControllerRef.current;
1582
- _optionalChain([analytics, 'optionalAccess', _46 => _46.abandon, 'call', _47 => _47("modal_close")]);
1583
- _optionalChain([analytics, 'optionalAccess', _48 => _48.close, 'call', _49 => _49("host_controlled")]);
1655
+ _optionalChain([analytics, 'optionalAccess', _52 => _52.abandon, 'call', _53 => _53("modal_close")]);
1656
+ _optionalChain([analytics, 'optionalAccess', _54 => _54.close, 'call', _55 => _55("host_controlled")]);
1584
1657
  }
1585
1658
  previousOpenRef.current = isOpen;
1586
1659
  }, [isOpen]);
1587
1660
  _react.useEffect.call(void 0, () => {
1588
1661
  if (!isOpen || !modalRef.current) return;
1589
- return _chunkHAQOFI3Dcjs.applyTheme.call(void 0, modalRef.current, theme);
1662
+ return _chunkH4O22O7Ycjs.applyTheme.call(void 0, modalRef.current, theme);
1590
1663
  }, [isOpen, theme]);
1591
1664
  _react.useEffect.call(void 0, () => {
1592
1665
  if (isOpen) {
1593
- _optionalChain([onReadyRef, 'access', _50 => _50.current, 'optionalCall', _51 => _51()]);
1666
+ _optionalChain([onReadyRef, 'access', _56 => _56.current, 'optionalCall', _57 => _57()]);
1594
1667
  }
1595
1668
  }, [isOpen, onReadyRef]);
1596
1669
  _react.useEffect.call(void 0, () => {
1597
1670
  if (!isOpen) {
1598
1671
  store.dispatch({ type: "modal/reset" });
1672
+ setHistoryRecipient(recipient);
1599
1673
  }
1600
- }, [isOpen, store]);
1674
+ }, [isOpen, store, recipient]);
1601
1675
  const handleStepChange = _react.useCallback.call(void 0, (onBack, next) => {
1602
1676
  setBackHandler(() => onBack);
1603
1677
  if (next) setScreen(next);
1604
1678
  }, []);
1605
1679
  _react.useEffect.call(void 0, () => {
1606
- _optionalChain([onUiStateRef, 'access', _52 => _52.current, 'optionalCall', _53 => _53({
1680
+ _optionalChain([onUiStateRef, 'access', _58 => _58.current, 'optionalCall', _59 => _59({
1607
1681
  screen,
1608
1682
  back: backHandler,
1609
- submitting: false
1683
+ // A transfer or a recovery in flight is a submission whose outcome is
1684
+ // unknown, so a native host's dismissal lock has to hold through it.
1685
+ submitting: submitting || recoverySubmitting
1610
1686
  })]);
1611
- }, [screen, backHandler, onUiStateRef]);
1687
+ }, [screen, backHandler, submitting, recoverySubmitting, onUiStateRef]);
1688
+ const onLifecycleRef = _chunkH4O22O7Ycjs.useLatestRef.call(void 0, onLifecycle);
1689
+ const handleLifecycle = _react.useCallback.call(void 0,
1690
+ (event) => {
1691
+ _optionalChain([onLifecycleRef, 'access', _60 => _60.current, 'optionalCall', _61 => _61(event)]);
1692
+ if (event.type === "submitted" || event.type === "complete" || event.type === "failed") {
1693
+ markHistoryStale();
1694
+ }
1695
+ },
1696
+ [onLifecycleRef, markHistoryStale]
1697
+ );
1612
1698
  const analyticsSessionProperties = buildWithdrawAnalyticsSessionProperties({
1613
1699
  inline,
1614
1700
  closeOnOverlayClick,
@@ -1619,18 +1705,19 @@ function WithdrawModal({
1619
1705
  seedTargetChain: targetChain,
1620
1706
  seedTargetToken: _nullishCoalesce(targetToken, () => ( sourceToken))
1621
1707
  });
1622
- const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _54 => _54.showBackButton]), () => ( true));
1623
- const canGoBack = backHandler !== void 0;
1624
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1625
- _chunkHAQOFI3Dcjs.Modal,
1708
+ const showBackButton = _nullishCoalesce(_optionalChain([uiConfig, 'optionalAccess', _62 => _62.showBackButton]), () => ( true));
1709
+ const canGoBack = backHandler !== void 0 && !submitting;
1710
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.RpcUrlsProvider, { value: rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.ChainCatalogProvider, { service, rpcUrls, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, WithdrawStoreProvider, { store, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1711
+ _chunkH4O22O7Ycjs.Modal,
1626
1712
  {
1627
1713
  isOpen,
1628
1714
  onClose: handleModalDismiss,
1629
1715
  className,
1630
1716
  inline,
1631
1717
  closeOnOverlayClick,
1718
+ ariaLabel: "Withdraw",
1632
1719
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1633
- _chunkHAQOFI3Dcjs.AnalyticsSession,
1720
+ _chunkH4O22O7Ycjs.AnalyticsSession,
1634
1721
  {
1635
1722
  modal: "withdraw",
1636
1723
  sessionProperties: analyticsSessionProperties,
@@ -1638,6 +1725,7 @@ function WithdrawModal({
1638
1725
  backendUrl,
1639
1726
  enableIngest: enableAnalyticsIngest,
1640
1727
  ingestUrl: analyticsIngestUrl,
1728
+ sessionIdRef: analyticsSessionIdRef,
1641
1729
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1642
1730
  WithdrawAnalyticsControllerProvider,
1643
1731
  {
@@ -1651,19 +1739,28 @@ function WithdrawModal({
1651
1739
  className: "rs-modal-header-back",
1652
1740
  "aria-label": "Go back",
1653
1741
  onClick: backHandler,
1654
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.ChevronLeftIcon, {})
1742
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.ChevronLeftIcon, {})
1655
1743
  }
1656
1744
  ) }),
1657
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "rs-modal-header-nav-right", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1658
- "button",
1659
- {
1660
- type: "button",
1661
- onClick: () => closeWithSource("header_button"),
1662
- className: "rs-modal-close",
1663
- "aria-label": "Close",
1664
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkHAQOFI3Dcjs.CloseIcon, {})
1665
- }
1666
- ) })
1745
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rs-modal-header-nav-right", children: [
1746
+ historyButtonVisible && historyRecipient && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1747
+ _chunkH4O22O7Ycjs.HistoryEntryButton,
1748
+ {
1749
+ badge: history.badge,
1750
+ onClick: history.openPanel
1751
+ }
1752
+ ),
1753
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1754
+ "button",
1755
+ {
1756
+ type: "button",
1757
+ onClick: () => closeWithSource("header_button"),
1758
+ className: "rs-modal-close",
1759
+ "aria-label": "Close",
1760
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkH4O22O7Ycjs.CloseIcon, {})
1761
+ }
1762
+ )
1763
+ ] })
1667
1764
  ] }),
1668
1765
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1669
1766
  WithdrawFlow,
@@ -1680,10 +1777,32 @@ function WithdrawModal({
1680
1777
  onSendTransaction,
1681
1778
  onStepChange: handleStepChange,
1682
1779
  onClose: closeWithSource,
1683
- onLifecycle,
1780
+ onDestinationChange: setHistoryRecipient,
1781
+ onSubmittingChange: setSubmitting,
1782
+ onLifecycle: handleLifecycle,
1684
1783
  onError,
1685
1784
  debug
1686
1785
  }
1786
+ ),
1787
+ history.isPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1788
+ _chunkH4O22O7Ycjs.HistoryOverlay,
1789
+ {
1790
+ controller: history,
1791
+ backLabel: "Withdraw",
1792
+ title: "Deposit history",
1793
+ recipient: historyRecipient,
1794
+ backendUrl,
1795
+ service,
1796
+ signRecovery,
1797
+ debug,
1798
+ onCloseModal: () => closeWithSource("header_button"),
1799
+ analytics: historyAnalytics,
1800
+ inline,
1801
+ closeOnOverlayClick,
1802
+ enableAnalyticsIngest,
1803
+ analyticsIngestUrl,
1804
+ onEvent
1805
+ }
1687
1806
  )
1688
1807
  ] })
1689
1808
  }